gtsocial-umbx

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

sqlite_windows_amd64.go (7712209B)


      1 // Code generated by 'ccgo -DSQLITE_PRIVATE= -export-defines "" -export-enums "" -export-externs X -export-fields F -export-typedefs "" -ignore-unsupported-alignment -pkgname sqlite3 -volatile=sqlite3_io_error_pending,sqlite3_open_file_count,sqlite3_pager_readdb_count,sqlite3_pager_writedb_count,sqlite3_pager_writej_count,sqlite3_search_count,sqlite3_sort_count,saved_cnt,randomnessPid -o lib/sqlite_windows_amd64.go -trace-translation-units testdata/sqlite-amalgamation-3410200/sqlite3.c -full-path-comments -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_OS_WIN=1 -D_MSC_VER=1900', DO NOT EDIT.
      2 
      3 package sqlite3
      4 
      5 import (
      6 	"math"
      7 	"reflect"
      8 	"sync/atomic"
      9 	"unsafe"
     10 
     11 	"modernc.org/libc"
     12 	"modernc.org/libc/sys/types"
     13 )
     14 
     15 var _ = math.Pi
     16 var _ reflect.Kind
     17 var _ atomic.Value
     18 var _ unsafe.Pointer
     19 var _ *libc.TLS
     20 var _ types.Size_t
     21 
     22 const (
     23 	ABE_BOTTOM                                                                     = 3
     24 	ABE_LEFT                                                                       = 0
     25 	ABE_RIGHT                                                                      = 2
     26 	ABE_TOP                                                                        = 1
     27 	ABM_ACTIVATE                                                                   = 0x00000006
     28 	ABM_GETAUTOHIDEBAR                                                             = 0x00000007
     29 	ABM_GETSTATE                                                                   = 0x00000004
     30 	ABM_GETTASKBARPOS                                                              = 0x00000005
     31 	ABM_NEW                                                                        = 0x00000000
     32 	ABM_QUERYPOS                                                                   = 0x00000002
     33 	ABM_REMOVE                                                                     = 0x00000001
     34 	ABM_SETAUTOHIDEBAR                                                             = 0x00000008
     35 	ABM_SETPOS                                                                     = 0x00000003
     36 	ABM_SETSTATE                                                                   = 0x0000000a
     37 	ABM_WINDOWPOSCHANGED                                                           = 0x0000009
     38 	ABN_FULLSCREENAPP                                                              = 0x0000002
     39 	ABN_POSCHANGED                                                                 = 0x0000001
     40 	ABN_STATECHANGE                                                                = 0x0000000
     41 	ABN_WINDOWARRANGE                                                              = 0x0000003
     42 	ABORTDOC                                                                       = 2
     43 	ABOVE_NORMAL_PRIORITY_CLASS                                                    = 0x8000
     44 	ABSOLUTE                                                                       = 1
     45 	ABS_ALWAYSONTOP                                                                = 0x0000002
     46 	ABS_AUTOHIDE                                                                   = 0x0000001
     47 	ACCESS_ALLOWED_ACE_TYPE                                                        = 0
     48 	ACCESS_ALLOWED_CALLBACK_ACE_TYPE                                               = 9
     49 	ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE                                        = 11
     50 	ACCESS_ALLOWED_COMPOUND_ACE_TYPE                                               = 4
     51 	ACCESS_ALLOWED_OBJECT_ACE_TYPE                                                 = 5
     52 	ACCESS_DENIED_ACE_TYPE                                                         = 1
     53 	ACCESS_DENIED_CALLBACK_ACE_TYPE                                                = 10
     54 	ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE                                         = 12
     55 	ACCESS_DENIED_OBJECT_ACE_TYPE                                                  = 6
     56 	ACCESS_DS_OBJECT_TYPE_NAME_A                                                   = "Directory Service Object"
     57 	ACCESS_DS_SOURCE_A                                                             = "DS"
     58 	ACCESS_FILTERKEYS                                                              = 0x0002
     59 	ACCESS_MAX_LEVEL                                                               = 4
     60 	ACCESS_MAX_MS_ACE_TYPE                                                         = 8
     61 	ACCESS_MAX_MS_OBJECT_ACE_TYPE                                                  = 8
     62 	ACCESS_MAX_MS_V2_ACE_TYPE                                                      = 3
     63 	ACCESS_MAX_MS_V3_ACE_TYPE                                                      = 4
     64 	ACCESS_MAX_MS_V4_ACE_TYPE                                                      = 8
     65 	ACCESS_MAX_MS_V5_ACE_TYPE                                                      = 19
     66 	ACCESS_MIN_MS_ACE_TYPE                                                         = 0
     67 	ACCESS_MIN_MS_OBJECT_ACE_TYPE                                                  = 5
     68 	ACCESS_MOUSEKEYS                                                               = 0x0003
     69 	ACCESS_OBJECT_GUID                                                             = 0
     70 	ACCESS_PROPERTY_GUID                                                           = 2
     71 	ACCESS_PROPERTY_SET_GUID                                                       = 1
     72 	ACCESS_REASON_DATA_MASK                                                        = 0x0000ffff
     73 	ACCESS_REASON_EXDATA_MASK                                                      = 0x7f000000
     74 	ACCESS_REASON_STAGING_MASK                                                     = 0x80000000
     75 	ACCESS_REASON_TYPE_MASK                                                        = 0x00ff0000
     76 	ACCESS_STICKYKEYS                                                              = 0x0001
     77 	ACCESS_SYSTEM_SECURITY                                                         = 16777216
     78 	ACE_INHERITED_OBJECT_TYPE_PRESENT                                              = 0x2
     79 	ACE_OBJECT_TYPE_PRESENT                                                        = 0x1
     80 	ACL_REVISION                                                                   = 2
     81 	ACL_REVISION1                                                                  = 1
     82 	ACL_REVISION2                                                                  = 2
     83 	ACL_REVISION3                                                                  = 3
     84 	ACL_REVISION4                                                                  = 4
     85 	ACL_REVISION_DS                                                                = 4
     86 	ACPI_PPM_HARDWARE_ALL                                                          = 0xfe
     87 	ACPI_PPM_SOFTWARE_ALL                                                          = 0xfc
     88 	ACPI_PPM_SOFTWARE_ANY                                                          = 0xfd
     89 	ACTCTX_FLAG_APPLICATION_NAME_VALID                                             = 32
     90 	ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID                                           = 4
     91 	ACTCTX_FLAG_HMODULE_VALID                                                      = 128
     92 	ACTCTX_FLAG_LANGID_VALID                                                       = 2
     93 	ACTCTX_FLAG_PROCESSOR_ARCHITECTURE_VALID                                       = 1
     94 	ACTCTX_FLAG_RESOURCE_NAME_VALID                                                = 8
     95 	ACTCTX_FLAG_SET_PROCESS_DEFAULT                                                = 16
     96 	ACTCTX_FLAG_SOURCE_IS_ASSEMBLYREF                                              = 64
     97 	ACTIVATION_CONTEXT_BASIC_INFORMATION_DEFINED                                   = 1
     98 	ACTIVATION_CONTEXT_PATH_TYPE_ASSEMBLYREF                                       = 4
     99 	ACTIVATION_CONTEXT_PATH_TYPE_NONE                                              = 1
    100 	ACTIVATION_CONTEXT_PATH_TYPE_URL                                               = 3
    101 	ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE                                        = 2
    102 	ACTIVATION_CONTEXT_SECTION_APPLICATION_SETTINGS                                = 10
    103 	ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION                                = 1
    104 	ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES                                      = 9
    105 	ACTIVATION_CONTEXT_SECTION_COMPATIBILITY_INFO                                  = 11
    106 	ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION                           = 5
    107 	ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION                              = 7
    108 	ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION                              = 4
    109 	ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION                        = 6
    110 	ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION                                     = 2
    111 	ACTIVATION_CONTEXT_SECTION_GLOBAL_OBJECT_RENAME_TABLE                          = 8
    112 	ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION                            = 3
    113 	ACTIVEOBJECT_STRONG                                                            = 0x0
    114 	ACTIVEOBJECT_WEAK                                                              = 0x1
    115 	AC_LINE_BACKUP_POWER                                                           = 0x02
    116 	AC_LINE_OFFLINE                                                                = 0x00
    117 	AC_LINE_ONLINE                                                                 = 0x01
    118 	AC_LINE_UNKNOWN                                                                = 0xff
    119 	AC_SRC_ALPHA                                                                   = 0x01
    120 	AC_SRC_OVER                                                                    = 0x00
    121 	ADDRESS_TAG_BIT                                                                = 0x40000000000
    122 	AD_CLOCKWISE                                                                   = 2
    123 	AD_COUNTERCLOCKWISE                                                            = 1
    124 	AF_APPLETALK                                                                   = 16
    125 	AF_BAN                                                                         = 21
    126 	AF_CCITT                                                                       = 10
    127 	AF_CHAOS                                                                       = 5
    128 	AF_DATAKIT                                                                     = 9
    129 	AF_DECnet                                                                      = 12
    130 	AF_DLI                                                                         = 13
    131 	AF_ECMA                                                                        = 8
    132 	AF_FIREFOX                                                                     = 19
    133 	AF_HYLINK                                                                      = 15
    134 	AF_IMPLINK                                                                     = 3
    135 	AF_INET                                                                        = 2
    136 	AF_IPX                                                                         = 6
    137 	AF_ISO                                                                         = 7
    138 	AF_LAT                                                                         = 14
    139 	AF_MAX                                                                         = 22
    140 	AF_NETBIOS                                                                     = 17
    141 	AF_NS                                                                          = 6
    142 	AF_OSI                                                                         = 7
    143 	AF_PUP                                                                         = 4
    144 	AF_SNA                                                                         = 11
    145 	AF_UNIX                                                                        = 1
    146 	AF_UNKNOWN1                                                                    = 20
    147 	AF_UNSPEC                                                                      = 0
    148 	AF_VOICEVIEW                                                                   = 18
    149 	ALERT_SYSTEM_CRITICAL                                                          = 5
    150 	ALERT_SYSTEM_ERROR                                                             = 3
    151 	ALERT_SYSTEM_INFORMATIONAL                                                     = 1
    152 	ALERT_SYSTEM_QUERY                                                             = 4
    153 	ALERT_SYSTEM_WARNING                                                           = 2
    154 	ALGIDDEF                                                                       = 0
    155 	ALG_CLASS_ALL                                                                  = 57344
    156 	ALG_CLASS_ANY                                                                  = 0
    157 	ALG_CLASS_DATA_ENCRYPT                                                         = 24576
    158 	ALG_CLASS_HASH                                                                 = 32768
    159 	ALG_CLASS_KEY_EXCHANGE                                                         = 40960
    160 	ALG_CLASS_MSG_ENCRYPT                                                          = 16384
    161 	ALG_CLASS_SIGNATURE                                                            = 8192
    162 	ALG_SID_3DES                                                                   = 3
    163 	ALG_SID_3DES_112                                                               = 9
    164 	ALG_SID_AES                                                                    = 17
    165 	ALG_SID_AES_128                                                                = 14
    166 	ALG_SID_AES_192                                                                = 15
    167 	ALG_SID_AES_256                                                                = 16
    168 	ALG_SID_AGREED_KEY_ANY                                                         = 3
    169 	ALG_SID_ANY                                                                    = 0
    170 	ALG_SID_CAST                                                                   = 6
    171 	ALG_SID_CYLINK_MEK                                                             = 12
    172 	ALG_SID_DES                                                                    = 1
    173 	ALG_SID_DESX                                                                   = 4
    174 	ALG_SID_DH_EPHEM                                                               = 2
    175 	ALG_SID_DH_SANDF                                                               = 1
    176 	ALG_SID_DSS_ANY                                                                = 0
    177 	ALG_SID_DSS_DMS                                                                = 2
    178 	ALG_SID_DSS_PKCS                                                               = 1
    179 	ALG_SID_EXAMPLE                                                                = 80
    180 	ALG_SID_HASH_REPLACE_OWF                                                       = 11
    181 	ALG_SID_HMAC                                                                   = 9
    182 	ALG_SID_IDEA                                                                   = 5
    183 	ALG_SID_KEA                                                                    = 4
    184 	ALG_SID_MAC                                                                    = 5
    185 	ALG_SID_MD2                                                                    = 1
    186 	ALG_SID_MD4                                                                    = 2
    187 	ALG_SID_MD5                                                                    = 3
    188 	ALG_SID_PCT1_MASTER                                                            = 4
    189 	ALG_SID_RC2                                                                    = 2
    190 	ALG_SID_RC4                                                                    = 1
    191 	ALG_SID_RC5                                                                    = 13
    192 	ALG_SID_RIPEMD                                                                 = 6
    193 	ALG_SID_RIPEMD160                                                              = 7
    194 	ALG_SID_RSA_ANY                                                                = 0
    195 	ALG_SID_RSA_ENTRUST                                                            = 3
    196 	ALG_SID_RSA_MSATWORK                                                           = 2
    197 	ALG_SID_RSA_PGP                                                                = 4
    198 	ALG_SID_RSA_PKCS                                                               = 1
    199 	ALG_SID_SAFERSK128                                                             = 8
    200 	ALG_SID_SAFERSK64                                                              = 7
    201 	ALG_SID_SCHANNEL_ENC_KEY                                                       = 7
    202 	ALG_SID_SCHANNEL_MAC_KEY                                                       = 3
    203 	ALG_SID_SCHANNEL_MASTER_HASH                                                   = 2
    204 	ALG_SID_SEAL                                                                   = 2
    205 	ALG_SID_SHA                                                                    = 4
    206 	ALG_SID_SHA1                                                                   = 4
    207 	ALG_SID_SHA_256                                                                = 12
    208 	ALG_SID_SHA_384                                                                = 13
    209 	ALG_SID_SHA_512                                                                = 14
    210 	ALG_SID_SKIPJACK                                                               = 10
    211 	ALG_SID_SSL2_MASTER                                                            = 5
    212 	ALG_SID_SSL3SHAMD5                                                             = 8
    213 	ALG_SID_SSL3_MASTER                                                            = 1
    214 	ALG_SID_TEK                                                                    = 11
    215 	ALG_SID_TLS1PRF                                                                = 10
    216 	ALG_SID_TLS1_MASTER                                                            = 6
    217 	ALG_TYPE_ANY                                                                   = 0
    218 	ALG_TYPE_BLOCK                                                                 = 1536
    219 	ALG_TYPE_DH                                                                    = 2560
    220 	ALG_TYPE_DSS                                                                   = 512
    221 	ALG_TYPE_RSA                                                                   = 1024
    222 	ALG_TYPE_SECURECHANNEL                                                         = 3072
    223 	ALG_TYPE_STREAM                                                                = 2048
    224 	ALIGNMENT_MACHINE                                                              = 0
    225 	ALTERNATE                                                                      = 1
    226 	ALTNUMPAD_BIT                                                                  = 0x4000000
    227 	ANSI_CHARSET                                                                   = 0
    228 	ANSI_FIXED_FONT                                                                = 11
    229 	ANSI_VAR_FONT                                                                  = 12
    230 	ANTIALIASED_QUALITY                                                            = 4
    231 	ANYSIZE_ARRAY                                                                  = 1
    232 	APD_COPY_ALL_FILES                                                             = 0x00000004
    233 	APD_COPY_FROM_DIRECTORY                                                        = 0x00000010
    234 	APD_COPY_NEW_FILES                                                             = 0x00000008
    235 	APD_STRICT_DOWNGRADE                                                           = 0x00000002
    236 	APD_STRICT_UPGRADE                                                             = 0x00000001
    237 	APIENTRY                                                                       = 0
    238 	APIPRIVATE                                                                     = 0
    239 	API_SET_EXTENSION_NAME_A                                                       = "EXT-"
    240 	API_SET_LOAD_SCHEMA_ORDINAL                                                    = 1
    241 	API_SET_LOOKUP_ORDINAL                                                         = 2
    242 	API_SET_PREFIX_NAME_A                                                          = "API-"
    243 	API_SET_RELEASE_SCHEMA_ORDINAL                                                 = 3
    244 	API_SET_SCHEMA_VERSION                                                         = 2
    245 	API_SET_SECTION_NAME                                                           = ".apiset"
    246 	APPCLASS_MASK                                                                  = 15
    247 	APPCLASS_MONITOR                                                               = 1
    248 	APPCLASS_STANDARD                                                              = 0
    249 	APPCMD_CLIENTONLY                                                              = 16
    250 	APPCMD_FILTERINITS                                                             = 32
    251 	APPCMD_MASK                                                                    = 4080
    252 	APPCOMMAND_BASS_BOOST                                                          = 20
    253 	APPCOMMAND_BASS_DOWN                                                           = 19
    254 	APPCOMMAND_BASS_UP                                                             = 21
    255 	APPCOMMAND_BROWSER_BACKWARD                                                    = 1
    256 	APPCOMMAND_BROWSER_FAVORITES                                                   = 6
    257 	APPCOMMAND_BROWSER_FORWARD                                                     = 2
    258 	APPCOMMAND_BROWSER_HOME                                                        = 7
    259 	APPCOMMAND_BROWSER_REFRESH                                                     = 3
    260 	APPCOMMAND_BROWSER_SEARCH                                                      = 5
    261 	APPCOMMAND_BROWSER_STOP                                                        = 4
    262 	APPCOMMAND_CLOSE                                                               = 31
    263 	APPCOMMAND_COPY                                                                = 36
    264 	APPCOMMAND_CORRECTION_LIST                                                     = 45
    265 	APPCOMMAND_CUT                                                                 = 37
    266 	APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE                                   = 43
    267 	APPCOMMAND_FIND                                                                = 28
    268 	APPCOMMAND_FORWARD_MAIL                                                        = 40
    269 	APPCOMMAND_HELP                                                                = 27
    270 	APPCOMMAND_LAUNCH_APP1                                                         = 17
    271 	APPCOMMAND_LAUNCH_APP2                                                         = 18
    272 	APPCOMMAND_LAUNCH_MAIL                                                         = 15
    273 	APPCOMMAND_LAUNCH_MEDIA_SELECT                                                 = 16
    274 	APPCOMMAND_MEDIA_CHANNEL_DOWN                                                  = 52
    275 	APPCOMMAND_MEDIA_CHANNEL_UP                                                    = 51
    276 	APPCOMMAND_MEDIA_FAST_FORWARD                                                  = 49
    277 	APPCOMMAND_MEDIA_NEXTTRACK                                                     = 11
    278 	APPCOMMAND_MEDIA_PAUSE                                                         = 47
    279 	APPCOMMAND_MEDIA_PLAY                                                          = 46
    280 	APPCOMMAND_MEDIA_PLAY_PAUSE                                                    = 14
    281 	APPCOMMAND_MEDIA_PREVIOUSTRACK                                                 = 12
    282 	APPCOMMAND_MEDIA_RECORD                                                        = 48
    283 	APPCOMMAND_MEDIA_REWIND                                                        = 50
    284 	APPCOMMAND_MEDIA_STOP                                                          = 13
    285 	APPCOMMAND_MICROPHONE_VOLUME_DOWN                                              = 25
    286 	APPCOMMAND_MICROPHONE_VOLUME_MUTE                                              = 24
    287 	APPCOMMAND_MICROPHONE_VOLUME_UP                                                = 26
    288 	APPCOMMAND_MIC_ON_OFF_TOGGLE                                                   = 44
    289 	APPCOMMAND_NEW                                                                 = 29
    290 	APPCOMMAND_OPEN                                                                = 30
    291 	APPCOMMAND_PASTE                                                               = 38
    292 	APPCOMMAND_PRINT                                                               = 33
    293 	APPCOMMAND_REDO                                                                = 35
    294 	APPCOMMAND_REPLY_TO_MAIL                                                       = 39
    295 	APPCOMMAND_SAVE                                                                = 32
    296 	APPCOMMAND_SEND_MAIL                                                           = 41
    297 	APPCOMMAND_SPELL_CHECK                                                         = 42
    298 	APPCOMMAND_TREBLE_DOWN                                                         = 22
    299 	APPCOMMAND_TREBLE_UP                                                           = 23
    300 	APPCOMMAND_UNDO                                                                = 34
    301 	APPCOMMAND_VOLUME_DOWN                                                         = 9
    302 	APPCOMMAND_VOLUME_MUTE                                                         = 8
    303 	APPCOMMAND_VOLUME_UP                                                           = 10
    304 	APPIDREGFLAGS_ACTIVATE_IUSERVER_INDESKTOP                                      = 0x1
    305 	APPIDREGFLAGS_ISSUE_ACTIVATION_RPC_AT_IDENTIFY                                 = 0x4
    306 	APPIDREGFLAGS_IUSERVER_ACTIVATE_IN_CLIENT_SESSION_ONLY                         = 0x20
    307 	APPIDREGFLAGS_IUSERVER_SELF_SID_IN_LAUNCH_PERMISSION                           = 0x10
    308 	APPIDREGFLAGS_IUSERVER_UNMODIFIED_LOGON_TOKEN                                  = 0x8
    309 	APPIDREGFLAGS_RESERVED1                                                        = 0x40
    310 	APPIDREGFLAGS_SECURE_SERVER_PROCESS_SD_AND_BIND                                = 0x2
    311 	APPLICATION_ERROR_MASK                                                         = 0x20000000
    312 	APPLICATION_VERIFIER_ACCESS_VIOLATION                                          = 0x0002
    313 	APPLICATION_VERIFIER_BAD_HEAP_HANDLE                                           = 0x0005
    314 	APPLICATION_VERIFIER_COM_API_IN_DLLMAIN                                        = 0x0401
    315 	APPLICATION_VERIFIER_COM_CF_SUCCESS_WITH_NULL                                  = 0x040A
    316 	APPLICATION_VERIFIER_COM_ERROR                                                 = 0x0400
    317 	APPLICATION_VERIFIER_COM_GCO_SUCCESS_WITH_NULL                                 = 0x040B
    318 	APPLICATION_VERIFIER_COM_HOLDING_LOCKS_ON_CALL                                 = 0x0410
    319 	APPLICATION_VERIFIER_COM_NULL_DACL                                             = 0x0406
    320 	APPLICATION_VERIFIER_COM_OBJECT_IN_FREED_MEMORY                                = 0x040C
    321 	APPLICATION_VERIFIER_COM_OBJECT_IN_UNLOADED_DLL                                = 0x040D
    322 	APPLICATION_VERIFIER_COM_SMUGGLED_PROXY                                        = 0x0409
    323 	APPLICATION_VERIFIER_COM_SMUGGLED_WRAPPER                                      = 0x0408
    324 	APPLICATION_VERIFIER_COM_UNBALANCED_COINIT                                     = 0x0403
    325 	APPLICATION_VERIFIER_COM_UNBALANCED_OLEINIT                                    = 0x0404
    326 	APPLICATION_VERIFIER_COM_UNBALANCED_SWC                                        = 0x0405
    327 	APPLICATION_VERIFIER_COM_UNHANDLED_EXCEPTION                                   = 0x0402
    328 	APPLICATION_VERIFIER_COM_UNSAFE_IMPERSONATION                                  = 0x0407
    329 	APPLICATION_VERIFIER_COM_VTBL_IN_FREED_MEMORY                                  = 0x040E
    330 	APPLICATION_VERIFIER_COM_VTBL_IN_UNLOADED_DLL                                  = 0x040F
    331 	APPLICATION_VERIFIER_CONTINUABLE_BREAK                                         = 0x10000000
    332 	APPLICATION_VERIFIER_CORRUPTED_FREED_HEAP_BLOCK                                = 0x000E
    333 	APPLICATION_VERIFIER_CORRUPTED_HEAP_BLOCK                                      = 0x0008
    334 	APPLICATION_VERIFIER_CORRUPTED_HEAP_BLOCK_END_STAMP                            = 0x0011
    335 	APPLICATION_VERIFIER_CORRUPTED_HEAP_BLOCK_EXCEPTION_RAISED_FOR_HEADER          = 0x000B
    336 	APPLICATION_VERIFIER_CORRUPTED_HEAP_BLOCK_EXCEPTION_RAISED_FOR_PROBING         = 0x000C
    337 	APPLICATION_VERIFIER_CORRUPTED_HEAP_BLOCK_HEADER                               = 0x000D
    338 	APPLICATION_VERIFIER_CORRUPTED_HEAP_BLOCK_PREFIX                               = 0x0012
    339 	APPLICATION_VERIFIER_CORRUPTED_HEAP_BLOCK_START_STAMP                          = 0x0010
    340 	APPLICATION_VERIFIER_CORRUPTED_HEAP_BLOCK_SUFFIX                               = 0x000F
    341 	APPLICATION_VERIFIER_CORRUPTED_HEAP_LIST                                       = 0x0014
    342 	APPLICATION_VERIFIER_DESTROY_PROCESS_HEAP                                      = 0x0009
    343 	APPLICATION_VERIFIER_DOUBLE_FREE                                               = 0x0007
    344 	APPLICATION_VERIFIER_EXIT_THREAD_OWNS_LOCK                                     = 0x0200
    345 	APPLICATION_VERIFIER_EXTREME_SIZE_REQUEST                                      = 0x0004
    346 	APPLICATION_VERIFIER_FIRST_CHANCE_ACCESS_VIOLATION                             = 0x0013
    347 	APPLICATION_VERIFIER_INCORRECT_WAIT_CALL                                       = 0x0302
    348 	APPLICATION_VERIFIER_INTERNAL_ERROR                                            = 0x80000000
    349 	APPLICATION_VERIFIER_INTERNAL_WARNING                                          = 0x40000000
    350 	APPLICATION_VERIFIER_INVALID_ALLOCMEM                                          = 0x0601
    351 	APPLICATION_VERIFIER_INVALID_EXIT_PROCESS_CALL                                 = 0x0102
    352 	APPLICATION_VERIFIER_INVALID_FREEMEM                                           = 0x0600
    353 	APPLICATION_VERIFIER_INVALID_HANDLE                                            = 0x0300
    354 	APPLICATION_VERIFIER_INVALID_MAPVIEW                                           = 0x0602
    355 	APPLICATION_VERIFIER_INVALID_TLS_VALUE                                         = 0x0301
    356 	APPLICATION_VERIFIER_LOCK_ALREADY_INITIALIZED                                  = 0x0211
    357 	APPLICATION_VERIFIER_LOCK_CORRUPTED                                            = 0x0205
    358 	APPLICATION_VERIFIER_LOCK_DOUBLE_INITIALIZE                                    = 0x0203
    359 	APPLICATION_VERIFIER_LOCK_INVALID_LOCK_COUNT                                   = 0x0208
    360 	APPLICATION_VERIFIER_LOCK_INVALID_OWNER                                        = 0x0206
    361 	APPLICATION_VERIFIER_LOCK_INVALID_RECURSION_COUNT                              = 0x0207
    362 	APPLICATION_VERIFIER_LOCK_IN_FREED_HEAP                                        = 0x0202
    363 	APPLICATION_VERIFIER_LOCK_IN_FREED_MEMORY                                      = 0x0204
    364 	APPLICATION_VERIFIER_LOCK_IN_FREED_VMEM                                        = 0x0212
    365 	APPLICATION_VERIFIER_LOCK_IN_UNLOADED_DLL                                      = 0x0201
    366 	APPLICATION_VERIFIER_LOCK_IN_UNMAPPED_MEM                                      = 0x0213
    367 	APPLICATION_VERIFIER_LOCK_NOT_INITIALIZED                                      = 0x0210
    368 	APPLICATION_VERIFIER_LOCK_OVER_RELEASED                                        = 0x0209
    369 	APPLICATION_VERIFIER_NO_BREAK                                                  = 0x20000000
    370 	APPLICATION_VERIFIER_NULL_HANDLE                                               = 0x0303
    371 	APPLICATION_VERIFIER_PROBE_FREE_MEM                                            = 0x0604
    372 	APPLICATION_VERIFIER_PROBE_GUARD_PAGE                                          = 0x0605
    373 	APPLICATION_VERIFIER_PROBE_INVALID_ADDRESS                                     = 0x0603
    374 	APPLICATION_VERIFIER_PROBE_INVALID_START_OR_SIZE                               = 0x0607
    375 	APPLICATION_VERIFIER_PROBE_NULL                                                = 0x0606
    376 	APPLICATION_VERIFIER_RPC_ERROR                                                 = 0x0500
    377 	APPLICATION_VERIFIER_SIZE_HEAP_UNEXPECTED_EXCEPTION                            = 0x0618
    378 	APPLICATION_VERIFIER_STACK_OVERFLOW                                            = 0x0101
    379 	APPLICATION_VERIFIER_SWITCHED_HEAP_HANDLE                                      = 0x0006
    380 	APPLICATION_VERIFIER_TERMINATE_THREAD_CALL                                     = 0x0100
    381 	APPLICATION_VERIFIER_THREAD_NOT_LOCK_OWNER                                     = 0x0214
    382 	APPLICATION_VERIFIER_UNEXPECTED_EXCEPTION                                      = 0x000A
    383 	APPLICATION_VERIFIER_UNKNOWN_ERROR                                             = 0x0001
    384 	APPLICATION_VERIFIER_UNSYNCHRONIZED_ACCESS                                     = 0x0003
    385 	APPLICATION_VERIFIER_WAIT_IN_DLLMAIN                                           = 0x0304
    386 	APPMODEL_ERROR_NO_APPLICATION                                                  = 15703
    387 	APPMODEL_ERROR_NO_PACKAGE                                                      = 15700
    388 	APPMODEL_ERROR_PACKAGE_IDENTITY_CORRUPT                                        = 15702
    389 	APPMODEL_ERROR_PACKAGE_RUNTIME_CORRUPT                                         = 15701
    390 	APP_LOCAL_DEVICE_ID_SIZE                                                       = 32
    391 	ARABIC_CHARSET                                                                 = 178
    392 	ARW_BOTTOMLEFT                                                                 = 0
    393 	ARW_BOTTOMRIGHT                                                                = 1
    394 	ARW_DOWN                                                                       = 4
    395 	ARW_HIDE                                                                       = 8
    396 	ARW_LEFT                                                                       = 0
    397 	ARW_RIGHT                                                                      = 0
    398 	ARW_STARTMASK                                                                  = 3
    399 	ARW_STARTRIGHT                                                                 = 1
    400 	ARW_STARTTOP                                                                   = 2
    401 	ARW_TOPLEFT                                                                    = 2
    402 	ARW_TOPRIGHT                                                                   = 3
    403 	ARW_UP                                                                         = 4
    404 	ASPECTX                                                                        = 40
    405 	ASPECTXY                                                                       = 44
    406 	ASPECTY                                                                        = 42
    407 	ASPECT_FILTERING                                                               = 0x0001
    408 	ASSERT_ALTERNATE                                                               = 0x9
    409 	ASSERT_PRIMARY                                                                 = 0x8
    410 	ASYNCH                                                                         = 0x80
    411 	ASYNC_MODE_COMPATIBILITY                                                       = 1
    412 	ASYNC_MODE_DEFAULT                                                             = 0
    413 	ATAPI_ID_CMD                                                                   = 0xA1
    414 	ATF_ONOFFFEEDBACK                                                              = 0x00000002
    415 	ATF_TIMEOUTON                                                                  = 0x00000001
    416 	ATOM_FLAG_GLOBAL                                                               = 0x2
    417 	ATTRIBUTE_SECURITY_INFORMATION                                                 = 32
    418 	ATTR_CONVERTED                                                                 = 0x02
    419 	ATTR_FIXEDCONVERTED                                                            = 0x05
    420 	ATTR_INPUT                                                                     = 0x00
    421 	ATTR_INPUT_ERROR                                                               = 0x04
    422 	ATTR_TARGET_CONVERTED                                                          = 0x01
    423 	ATTR_TARGET_NOTCONVERTED                                                       = 0x03
    424 	AT_KEYEXCHANGE                                                                 = 1
    425 	AT_SIGNATURE                                                                   = 2
    426 	AUDIT_ALLOW_NO_PRIVILEGE                                                       = 0x1
    427 	AUTHTYPE_CLIENT                                                                = 1
    428 	AUTHTYPE_SERVER                                                                = 2
    429 	AUXCAPS_AUXIN                                                                  = 2
    430 	AUXCAPS_CDAUDIO                                                                = 1
    431 	AUXCAPS_LRVOLUME                                                               = 0x0002
    432 	AUXCAPS_VOLUME                                                                 = 0x0001
    433 	AW_ACTIVATE                                                                    = 0x00020000
    434 	AW_BLEND                                                                       = 0x00080000
    435 	AW_CENTER                                                                      = 0x00000010
    436 	AW_HIDE                                                                        = 0x00010000
    437 	AW_HOR_NEGATIVE                                                                = 0x00000002
    438 	AW_HOR_POSITIVE                                                                = 0x00000001
    439 	AW_SLIDE                                                                       = 0x00040000
    440 	AW_VER_NEGATIVE                                                                = 0x00000008
    441 	AW_VER_POSITIVE                                                                = 0x00000004
    442 	BACKGROUND_BLUE                                                                = 0x10
    443 	BACKGROUND_GREEN                                                               = 0x20
    444 	BACKGROUND_INTENSITY                                                           = 0x80
    445 	BACKGROUND_RED                                                                 = 0x40
    446 	BACKUP_ALTERNATE_DATA                                                          = 0x00000004
    447 	BACKUP_DATA                                                                    = 0x00000001
    448 	BACKUP_EA_DATA                                                                 = 0x00000002
    449 	BACKUP_INVALID                                                                 = 0x00000000
    450 	BACKUP_LINK                                                                    = 0x00000005
    451 	BACKUP_OBJECT_ID                                                               = 0x00000007
    452 	BACKUP_PROPERTY_DATA                                                           = 0x00000006
    453 	BACKUP_REPARSE_DATA                                                            = 0x00000008
    454 	BACKUP_SECURITY_DATA                                                           = 0x00000003
    455 	BACKUP_SECURITY_INFORMATION                                                    = 65536
    456 	BACKUP_SPARSE_BLOCK                                                            = 0x00000009
    457 	BACKUP_TXFS_DATA                                                               = 0x0000000a
    458 	BALTIC_CHARSET                                                                 = 186
    459 	BANDINFO                                                                       = 24
    460 	BASETYPES                                                                      = 0
    461 	BASE_SEARCH_PATH_DISABLE_SAFE_SEARCHMODE                                       = 0x10000
    462 	BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE                                        = 0x1
    463 	BASE_SEARCH_PATH_INVALID_FLAGS                                                 = -98306
    464 	BASE_SEARCH_PATH_PERMANENT                                                     = 0x8000
    465 	BASIC_CONSTRAINTS_CERT_CHAIN_POLICY_CA_FLAG                                    = 0x80000000
    466 	BASIC_CONSTRAINTS_CERT_CHAIN_POLICY_END_ENTITY_FLAG                            = 0x40000000
    467 	BATTERY_DISCHARGE_FLAGS_ENABLE                                                 = 0x80000000
    468 	BATTERY_DISCHARGE_FLAGS_EVENTCODE_MASK                                         = 0x00000007
    469 	BATTERY_FLAG_CHARGING                                                          = 0x08
    470 	BATTERY_FLAG_CRITICAL                                                          = 0x04
    471 	BATTERY_FLAG_HIGH                                                              = 0x01
    472 	BATTERY_FLAG_LOW                                                               = 0x02
    473 	BATTERY_FLAG_NO_BATTERY                                                        = 0x80
    474 	BATTERY_FLAG_UNKNOWN                                                           = 0xff
    475 	BATTERY_LIFE_UNKNOWN                                                           = 0xffffffff
    476 	BATTERY_PERCENTAGE_UNKNOWN                                                     = 0xff
    477 	BCRYPTBUFFER_VERSION                                                           = 0
    478 	BCRYPT_ALG_HANDLE_HMAC_FLAG                                                    = 0x00000008
    479 	BCRYPT_ASYMMETRIC_ENCRYPTION_INTERFACE                                         = 0x00000003
    480 	BCRYPT_ASYMMETRIC_ENCRYPTION_OPERATION                                         = 0x00000004
    481 	BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO_VERSION                                  = 1
    482 	BCRYPT_AUTH_MODE_CHAIN_CALLS_FLAG                                              = 0x00000001
    483 	BCRYPT_AUTH_MODE_IN_PROGRESS_FLAG                                              = 0x00000002
    484 	BCRYPT_BLOCK_PADDING                                                           = 0x00000001
    485 	BCRYPT_BUFFERS_LOCKED_FLAG                                                     = 0x00000040
    486 	BCRYPT_CAPI_AES_FLAG                                                           = 0x00000010
    487 	BCRYPT_CIPHER_INTERFACE                                                        = 0x00000001
    488 	BCRYPT_CIPHER_OPERATION                                                        = 0x00000001
    489 	BCRYPT_DH_PARAMETERS_MAGIC                                                     = 0x4d504844
    490 	BCRYPT_DH_PRIVATE_MAGIC                                                        = 0x56504844
    491 	BCRYPT_DH_PUBLIC_MAGIC                                                         = 0x42504844
    492 	BCRYPT_DSA_PARAMETERS_MAGIC                                                    = 0x4d505344
    493 	BCRYPT_DSA_PARAMETERS_MAGIC_V2                                                 = 0x324d5044
    494 	BCRYPT_DSA_PRIVATE_MAGIC                                                       = 0x56505344
    495 	BCRYPT_DSA_PRIVATE_MAGIC_V2                                                    = 0x32565044
    496 	BCRYPT_DSA_PUBLIC_MAGIC                                                        = 0x42505344
    497 	BCRYPT_DSA_PUBLIC_MAGIC_V2                                                     = 0x32425044
    498 	BCRYPT_ECDH_PRIVATE_P256_MAGIC                                                 = 0x324b4345
    499 	BCRYPT_ECDH_PRIVATE_P384_MAGIC                                                 = 0x344b4345
    500 	BCRYPT_ECDH_PRIVATE_P521_MAGIC                                                 = 0x364b4345
    501 	BCRYPT_ECDH_PUBLIC_P256_MAGIC                                                  = 0x314b4345
    502 	BCRYPT_ECDH_PUBLIC_P384_MAGIC                                                  = 0x334b4345
    503 	BCRYPT_ECDH_PUBLIC_P521_MAGIC                                                  = 0x354b4345
    504 	BCRYPT_ECDSA_PRIVATE_P256_MAGIC                                                = 0x32534345
    505 	BCRYPT_ECDSA_PRIVATE_P384_MAGIC                                                = 0x34534345
    506 	BCRYPT_ECDSA_PRIVATE_P521_MAGIC                                                = 0x36534345
    507 	BCRYPT_ECDSA_PUBLIC_P256_MAGIC                                                 = 0x31534345
    508 	BCRYPT_ECDSA_PUBLIC_P384_MAGIC                                                 = 0x33534345
    509 	BCRYPT_ECDSA_PUBLIC_P521_MAGIC                                                 = 0x35534345
    510 	BCRYPT_HASH_INTERFACE                                                          = 0x00000002
    511 	BCRYPT_HASH_OPERATION                                                          = 0x00000002
    512 	BCRYPT_HASH_REUSABLE_FLAG                                                      = 0x00000020
    513 	BCRYPT_KEY_DATA_BLOB_MAGIC                                                     = 0x4d42444b
    514 	BCRYPT_KEY_DATA_BLOB_VERSION1                                                  = 0x1
    515 	BCRYPT_KEY_DERIVATION_INTERFACE                                                = 0x00000007
    516 	BCRYPT_KEY_DERIVATION_OPERATION                                                = 0x00000040
    517 	BCRYPT_NO_KEY_VALIDATION                                                       = 0x00000008
    518 	BCRYPT_OBJECT_ALIGNMENT                                                        = 16
    519 	BCRYPT_PAD_NONE                                                                = 0x00000001
    520 	BCRYPT_PAD_OAEP                                                                = 0x00000004
    521 	BCRYPT_PAD_PKCS1                                                               = 0x00000002
    522 	BCRYPT_PAD_PSS                                                                 = 0x00000008
    523 	BCRYPT_PRIVATE_KEY_FLAG                                                        = 0x00000002
    524 	BCRYPT_PROV_DISPATCH                                                           = 0x00000001
    525 	BCRYPT_PUBLIC_KEY_FLAG                                                         = 0x00000001
    526 	BCRYPT_RNG_INTERFACE                                                           = 0x00000006
    527 	BCRYPT_RNG_OPERATION                                                           = 0x00000020
    528 	BCRYPT_RNG_USE_ENTROPY_IN_BUFFER                                               = 0x00000001
    529 	BCRYPT_RSAFULLPRIVATE_MAGIC                                                    = 0x33415352
    530 	BCRYPT_RSAPRIVATE_MAGIC                                                        = 0x32415352
    531 	BCRYPT_RSAPUBLIC_MAGIC                                                         = 0x31415352
    532 	BCRYPT_SECRET_AGREEMENT_INTERFACE                                              = 0x00000004
    533 	BCRYPT_SECRET_AGREEMENT_OPERATION                                              = 0x00000008
    534 	BCRYPT_SIGNATURE_INTERFACE                                                     = 0x00000005
    535 	BCRYPT_SIGNATURE_OPERATION                                                     = 0x00000010
    536 	BCRYPT_STRUCT_ALIGNMENT                                                        = 0
    537 	BCRYPT_SUPPORTED_PAD_OAEP                                                      = 0x00000008
    538 	BCRYPT_SUPPORTED_PAD_PKCS1_ENC                                                 = 0x00000002
    539 	BCRYPT_SUPPORTED_PAD_PKCS1_SIG                                                 = 0x00000004
    540 	BCRYPT_SUPPORTED_PAD_PSS                                                       = 0x00000010
    541 	BCRYPT_SUPPORTED_PAD_ROUTER                                                    = 0x00000001
    542 	BCRYPT_USE_SYSTEM_PREFERRED_RNG                                                = 0x00000002
    543 	BDR_INNER                                                                      = 12
    544 	BDR_OUTER                                                                      = 3
    545 	BDR_RAISED                                                                     = 5
    546 	BDR_RAISEDINNER                                                                = 0x0004
    547 	BDR_RAISEDOUTER                                                                = 0x0001
    548 	BDR_SUNKEN                                                                     = 10
    549 	BDR_SUNKENINNER                                                                = 0x0008
    550 	BDR_SUNKENOUTER                                                                = 0x0002
    551 	BEGIN_INTERFACE                                                                = 0
    552 	BEGIN_PATH                                                                     = 4096
    553 	BELOW_NORMAL_PRIORITY_CLASS                                                    = 0x4000
    554 	BF_ADJUST                                                                      = 0x2000
    555 	BF_BOTTOM                                                                      = 0x0008
    556 	BF_BOTTOMLEFT                                                                  = 9
    557 	BF_BOTTOMRIGHT                                                                 = 12
    558 	BF_DIAGONAL                                                                    = 0x0010
    559 	BF_DIAGONAL_ENDBOTTOMLEFT                                                      = 25
    560 	BF_DIAGONAL_ENDBOTTOMRIGHT                                                     = 28
    561 	BF_DIAGONAL_ENDTOPLEFT                                                         = 19
    562 	BF_DIAGONAL_ENDTOPRIGHT                                                        = 22
    563 	BF_FLAT                                                                        = 0x4000
    564 	BF_LEFT                                                                        = 0x0001
    565 	BF_MIDDLE                                                                      = 0x0800
    566 	BF_MONO                                                                        = 0x8000
    567 	BF_RECT                                                                        = 15
    568 	BF_RIGHT                                                                       = 0x0004
    569 	BF_SOFT                                                                        = 0x1000
    570 	BF_TOP                                                                         = 0x0002
    571 	BF_TOPLEFT                                                                     = 3
    572 	BF_TOPRIGHT                                                                    = 6
    573 	BIDI_ACCESS_ADMINISTRATOR                                                      = 0x1
    574 	BIDI_ACCESS_USER                                                               = 0x2
    575 	BITSPIXEL                                                                      = 12
    576 	BITVEC_SZ                                                                      = 512
    577 	BITVEC_SZELEM                                                                  = 8
    578 	BI_BITFIELDS                                                                   = 3
    579 	BI_JPEG                                                                        = 4
    580 	BI_PNG                                                                         = 5
    581 	BI_RGB                                                                         = 0
    582 	BI_RLE4                                                                        = 2
    583 	BI_RLE8                                                                        = 1
    584 	BKMODE_LAST                                                                    = 2
    585 	BLACKONWHITE                                                                   = 1
    586 	BLACK_BRUSH                                                                    = 4
    587 	BLACK_PEN                                                                      = 7
    588 	BLTALIGNMENT                                                                   = 119
    589 	BM_CLICK                                                                       = 0x00F5
    590 	BM_GETCHECK                                                                    = 0x00F0
    591 	BM_GETIMAGE                                                                    = 0x00F6
    592 	BM_GETSTATE                                                                    = 0x00F2
    593 	BM_SETCHECK                                                                    = 0x00F1
    594 	BM_SETIMAGE                                                                    = 0x00F7
    595 	BM_SETSTATE                                                                    = 0x00F3
    596 	BM_SETSTYLE                                                                    = 0x00F4
    597 	BN_CLICKED                                                                     = 0
    598 	BN_DBLCLK                                                                      = 5
    599 	BN_DISABLE                                                                     = 4
    600 	BN_DOUBLECLICKED                                                               = 5
    601 	BN_HILITE                                                                      = 2
    602 	BN_KILLFOCUS                                                                   = 7
    603 	BN_PAINT                                                                       = 1
    604 	BN_PUSHED                                                                      = 2
    605 	BN_SETFOCUS                                                                    = 6
    606 	BN_UNHILITE                                                                    = 3
    607 	BN_UNPUSHED                                                                    = 3
    608 	BOLD_FONTTYPE                                                                  = 0x100
    609 	BROADCAST_QUERY_DENY                                                           = 0x424D5144
    610 	BSF_ALLOWSFW                                                                   = 0x00000080
    611 	BSF_FLUSHDISK                                                                  = 0x00000004
    612 	BSF_FORCEIFHUNG                                                                = 0x00000020
    613 	BSF_IGNORECURRENTTASK                                                          = 0x00000002
    614 	BSF_LUID                                                                       = 0x00000400
    615 	BSF_NOHANG                                                                     = 0x00000008
    616 	BSF_NOTIMEOUTIFNOTHUNG                                                         = 0x00000040
    617 	BSF_POSTMESSAGE                                                                = 0x00000010
    618 	BSF_QUERY                                                                      = 0x00000001
    619 	BSF_RETURNHDESK                                                                = 0x00000200
    620 	BSF_SENDNOTIFYMESSAGE                                                          = 0x00000100
    621 	BSM_ALLCOMPONENTS                                                              = 0x00000000
    622 	BSM_ALLDESKTOPS                                                                = 0x00000010
    623 	BSM_APPLICATIONS                                                               = 0x00000008
    624 	BSM_INSTALLABLEDRIVERS                                                         = 0x00000004
    625 	BSM_NETDRIVER                                                                  = 0x00000002
    626 	BSM_VXDS                                                                       = 0x00000001
    627 	BST_CHECKED                                                                    = 0x0001
    628 	BST_FOCUS                                                                      = 0x0008
    629 	BST_INDETERMINATE                                                              = 0x0002
    630 	BST_PUSHED                                                                     = 0x0004
    631 	BST_UNCHECKED                                                                  = 0x0000
    632 	BS_3STATE                                                                      = 5
    633 	BS_AUTO3STATE                                                                  = 6
    634 	BS_AUTOCHECKBOX                                                                = 3
    635 	BS_AUTORADIOBUTTON                                                             = 9
    636 	BS_BITMAP                                                                      = 128
    637 	BS_BOTTOM                                                                      = 2048
    638 	BS_CENTER                                                                      = 768
    639 	BS_CHECKBOX                                                                    = 2
    640 	BS_DEFPUSHBUTTON                                                               = 1
    641 	BS_DIBPATTERN                                                                  = 5
    642 	BS_DIBPATTERN8X8                                                               = 8
    643 	BS_DIBPATTERNPT                                                                = 6
    644 	BS_FLAT                                                                        = 32768
    645 	BS_GROUPBOX                                                                    = 7
    646 	BS_HATCHED                                                                     = 2
    647 	BS_HOLLOW                                                                      = 1
    648 	BS_ICON                                                                        = 64
    649 	BS_INDEXED                                                                     = 4
    650 	BS_LEFT                                                                        = 256
    651 	BS_LEFTTEXT                                                                    = 32
    652 	BS_MONOPATTERN                                                                 = 9
    653 	BS_MULTILINE                                                                   = 8192
    654 	BS_NOTIFY                                                                      = 16384
    655 	BS_NULL                                                                        = 1
    656 	BS_OWNERDRAW                                                                   = 11
    657 	BS_PATTERN                                                                     = 3
    658 	BS_PATTERN8X8                                                                  = 7
    659 	BS_PUSHBOX                                                                     = 10
    660 	BS_PUSHBUTTON                                                                  = 0
    661 	BS_PUSHLIKE                                                                    = 4096
    662 	BS_RADIOBUTTON                                                                 = 4
    663 	BS_RIGHT                                                                       = 512
    664 	BS_RIGHTBUTTON                                                                 = 32
    665 	BS_SOLID                                                                       = 0
    666 	BS_TEXT                                                                        = 0
    667 	BS_TOP                                                                         = 1024
    668 	BS_TYPEMASK                                                                    = 15
    669 	BS_USERBUTTON                                                                  = 8
    670 	BS_VCENTER                                                                     = 3072
    671 	BTALLOC_ANY                                                                    = 0
    672 	BTALLOC_EXACT                                                                  = 1
    673 	BTALLOC_LE                                                                     = 2
    674 	BTCF_AtLast                                                                    = 0x08
    675 	BTCF_Incrblob                                                                  = 0x10
    676 	BTCF_Multiple                                                                  = 0x20
    677 	BTCF_Pinned                                                                    = 0x40
    678 	BTCF_ValidNKey                                                                 = 0x02
    679 	BTCF_ValidOvfl                                                                 = 0x04
    680 	BTCF_WriteFlag                                                                 = 0x01
    681 	BTCURSOR_MAX_DEPTH                                                             = 20
    682 	BTREE_APPEND                                                                   = 0x08
    683 	BTREE_APPLICATION_ID                                                           = 8
    684 	BTREE_AUTOVACUUM_FULL                                                          = 1
    685 	BTREE_AUTOVACUUM_INCR                                                          = 2
    686 	BTREE_AUTOVACUUM_NONE                                                          = 0
    687 	BTREE_AUXDELETE                                                                = 0x04
    688 	BTREE_BLOBKEY                                                                  = 2
    689 	BTREE_BULKLOAD                                                                 = 0x00000001
    690 	BTREE_DATA_VERSION                                                             = 15
    691 	BTREE_DEFAULT_CACHE_SIZE                                                       = 3
    692 	BTREE_FILE_FORMAT                                                              = 2
    693 	BTREE_FORDELETE                                                                = 0x00000008
    694 	BTREE_FREE_PAGE_COUNT                                                          = 0
    695 	BTREE_HINT_RANGE                                                               = 0
    696 	BTREE_INCR_VACUUM                                                              = 7
    697 	BTREE_INTKEY                                                                   = 1
    698 	BTREE_LARGEST_ROOT_PAGE                                                        = 4
    699 	BTREE_MEMORY                                                                   = 2
    700 	BTREE_OMIT_JOURNAL                                                             = 1
    701 	BTREE_PREFORMAT                                                                = 0x80
    702 	BTREE_SAVEPOSITION                                                             = 0x02
    703 	BTREE_SCHEMA_VERSION                                                           = 1
    704 	BTREE_SEEK_EQ                                                                  = 0x00000002
    705 	BTREE_SINGLE                                                                   = 4
    706 	BTREE_TEXT_ENCODING                                                            = 5
    707 	BTREE_UNORDERED                                                                = 8
    708 	BTREE_USER_VERSION                                                             = 6
    709 	BTREE_WRCSR                                                                    = 0x00000004
    710 	BTS_EXCLUSIVE                                                                  = 0x0040
    711 	BTS_FAST_SECURE                                                                = 0x000c
    712 	BTS_INITIALLY_EMPTY                                                            = 0x0010
    713 	BTS_NO_WAL                                                                     = 0x0020
    714 	BTS_OVERWRITE                                                                  = 0x0008
    715 	BTS_PAGESIZE_FIXED                                                             = 0x0002
    716 	BTS_PENDING                                                                    = 0x0080
    717 	BTS_READ_ONLY                                                                  = 0x0001
    718 	BTS_SECURE_DELETE                                                              = 0x0004
    719 	BUFSIZ                                                                         = 512
    720 	C1_ALPHA                                                                       = 0x0100
    721 	C1_BLANK                                                                       = 0x0040
    722 	C1_CNTRL                                                                       = 0x0020
    723 	C1_DEFINED                                                                     = 0x0200
    724 	C1_DIGIT                                                                       = 0x0004
    725 	C1_LOWER                                                                       = 0x0002
    726 	C1_PUNCT                                                                       = 0x0010
    727 	C1_SPACE                                                                       = 0x0008
    728 	C1_UPPER                                                                       = 0x0001
    729 	C1_XDIGIT                                                                      = 0x0080
    730 	C2_ARABICNUMBER                                                                = 0x0006
    731 	C2_BLOCKSEPARATOR                                                              = 0x0008
    732 	C2_COMMONSEPARATOR                                                             = 0x0007
    733 	C2_EUROPENUMBER                                                                = 0x0003
    734 	C2_EUROPESEPARATOR                                                             = 0x0004
    735 	C2_EUROPETERMINATOR                                                            = 0x0005
    736 	C2_LEFTTORIGHT                                                                 = 0x0001
    737 	C2_NOTAPPLICABLE                                                               = 0x0000
    738 	C2_OTHERNEUTRAL                                                                = 0x000b
    739 	C2_RIGHTTOLEFT                                                                 = 0x0002
    740 	C2_SEGMENTSEPARATOR                                                            = 0x0009
    741 	C2_WHITESPACE                                                                  = 0x000a
    742 	C3_ALPHA                                                                       = 0x8000
    743 	C3_DIACRITIC                                                                   = 0x0002
    744 	C3_FULLWIDTH                                                                   = 0x0080
    745 	C3_HALFWIDTH                                                                   = 0x0040
    746 	C3_HIGHSURROGATE                                                               = 0x0800
    747 	C3_HIRAGANA                                                                    = 0x0020
    748 	C3_IDEOGRAPH                                                                   = 0x0100
    749 	C3_KASHIDA                                                                     = 0x0200
    750 	C3_KATAKANA                                                                    = 0x0010
    751 	C3_LEXICAL                                                                     = 0x0400
    752 	C3_LOWSURROGATE                                                                = 0x1000
    753 	C3_NONSPACING                                                                  = 0x0001
    754 	C3_NOTAPPLICABLE                                                               = 0x0000
    755 	C3_SYMBOL                                                                      = 0x0008
    756 	C3_VOWELMARK                                                                   = 0x0004
    757 	CACHE_E_FIRST                                                                  = 2147746160
    758 	CACHE_E_LAST                                                                   = 2147746175
    759 	CACHE_FULLY_ASSOCIATIVE                                                        = 0xFF
    760 	CACHE_STALE                                                                    = 0
    761 	CACHE_S_FIRST                                                                  = 262512
    762 	CACHE_S_LAST                                                                   = 262527
    763 	CADV_LATEACK                                                                   = 0xFFFF
    764 	CALERT_SYSTEM                                                                  = 6
    765 	CALG_3DES                                                                      = 26115
    766 	CALG_3DES_112                                                                  = 26121
    767 	CALG_AES                                                                       = 26129
    768 	CALG_AES_128                                                                   = 26126
    769 	CALG_AES_192                                                                   = 26127
    770 	CALG_AES_256                                                                   = 26128
    771 	CALG_AGREEDKEY_ANY                                                             = 43523
    772 	CALG_CYLINK_MEK                                                                = 26124
    773 	CALG_DES                                                                       = 26113
    774 	CALG_DESX                                                                      = 26116
    775 	CALG_DH_EPHEM                                                                  = 43522
    776 	CALG_DH_SF                                                                     = 43521
    777 	CALG_DSS_SIGN                                                                  = 8704
    778 	CALG_HASH_REPLACE_OWF                                                          = 32779
    779 	CALG_HMAC                                                                      = 32777
    780 	CALG_HUGHES_MD5                                                                = 40963
    781 	CALG_KEA_KEYX                                                                  = 43524
    782 	CALG_MAC                                                                       = 32773
    783 	CALG_MD2                                                                       = 32769
    784 	CALG_MD4                                                                       = 32770
    785 	CALG_MD5                                                                       = 32771
    786 	CALG_NO_SIGN                                                                   = 8192
    787 	CALG_OID_INFO_CNG_ONLY                                                         = 0xffffffff
    788 	CALG_OID_INFO_PARAMETERS                                                       = 0xfffffffe
    789 	CALG_PCT1_MASTER                                                               = 19460
    790 	CALG_RC2                                                                       = 26114
    791 	CALG_RC4                                                                       = 26625
    792 	CALG_RC5                                                                       = 26125
    793 	CALG_RSA_KEYX                                                                  = 41984
    794 	CALG_RSA_SIGN                                                                  = 9216
    795 	CALG_SCHANNEL_ENC_KEY                                                          = 19463
    796 	CALG_SCHANNEL_MAC_KEY                                                          = 19459
    797 	CALG_SCHANNEL_MASTER_HASH                                                      = 19458
    798 	CALG_SEAL                                                                      = 26626
    799 	CALG_SHA                                                                       = 32772
    800 	CALG_SHA1                                                                      = 32772
    801 	CALG_SHA_256                                                                   = 32780
    802 	CALG_SHA_384                                                                   = 32781
    803 	CALG_SHA_512                                                                   = 32782
    804 	CALG_SKIPJACK                                                                  = 26122
    805 	CALG_SSL2_MASTER                                                               = 19461
    806 	CALG_SSL3_MASTER                                                               = 19457
    807 	CALG_SSL3_SHAMD5                                                               = 32776
    808 	CALG_TEK                                                                       = 26123
    809 	CALG_TLS1PRF                                                                   = 32778
    810 	CALG_TLS1_MASTER                                                               = 19462
    811 	CALLBACK                                                                       = 0
    812 	CALLBACK_CHUNK_FINISHED                                                        = 0x0
    813 	CALLBACK_EVENT                                                                 = 327680
    814 	CALLBACK_FUNCTION                                                              = 196608
    815 	CALLBACK_NULL                                                                  = 0
    816 	CALLBACK_STREAM_SWITCH                                                         = 0x1
    817 	CALLBACK_TASK                                                                  = 131072
    818 	CALLBACK_THREAD                                                                = 131072
    819 	CALLBACK_TYPEMASK                                                              = 458752
    820 	CALLBACK_WINDOW                                                                = 65536
    821 	CALL_PENDING                                                                   = 0x02
    822 	CAL_GREGORIAN                                                                  = 1
    823 	CAL_GREGORIAN_ARABIC                                                           = 10
    824 	CAL_GREGORIAN_ME_FRENCH                                                        = 9
    825 	CAL_GREGORIAN_US                                                               = 2
    826 	CAL_GREGORIAN_XLIT_ENGLISH                                                     = 11
    827 	CAL_GREGORIAN_XLIT_FRENCH                                                      = 12
    828 	CAL_HEBREW                                                                     = 8
    829 	CAL_HIJRI                                                                      = 6
    830 	CAL_ICALINTVALUE                                                               = 0x00000001
    831 	CAL_ITWODIGITYEARMAX                                                           = 0x00000030
    832 	CAL_IYEAROFFSETRANGE                                                           = 0x00000003
    833 	CAL_JAPAN                                                                      = 3
    834 	CAL_KOREA                                                                      = 5
    835 	CAL_NOUSEROVERRIDE                                                             = 2147483648
    836 	CAL_RETURN_NUMBER                                                              = 536870912
    837 	CAL_SABBREVDAYNAME1                                                            = 0x0000000e
    838 	CAL_SABBREVDAYNAME2                                                            = 0x0000000f
    839 	CAL_SABBREVDAYNAME3                                                            = 0x00000010
    840 	CAL_SABBREVDAYNAME4                                                            = 0x00000011
    841 	CAL_SABBREVDAYNAME5                                                            = 0x00000012
    842 	CAL_SABBREVDAYNAME6                                                            = 0x00000013
    843 	CAL_SABBREVDAYNAME7                                                            = 0x00000014
    844 	CAL_SABBREVMONTHNAME1                                                          = 0x00000022
    845 	CAL_SABBREVMONTHNAME10                                                         = 0x0000002b
    846 	CAL_SABBREVMONTHNAME11                                                         = 0x0000002c
    847 	CAL_SABBREVMONTHNAME12                                                         = 0x0000002d
    848 	CAL_SABBREVMONTHNAME13                                                         = 0x0000002e
    849 	CAL_SABBREVMONTHNAME2                                                          = 0x00000023
    850 	CAL_SABBREVMONTHNAME3                                                          = 0x00000024
    851 	CAL_SABBREVMONTHNAME4                                                          = 0x00000025
    852 	CAL_SABBREVMONTHNAME5                                                          = 0x00000026
    853 	CAL_SABBREVMONTHNAME6                                                          = 0x00000027
    854 	CAL_SABBREVMONTHNAME7                                                          = 0x00000028
    855 	CAL_SABBREVMONTHNAME8                                                          = 0x00000029
    856 	CAL_SABBREVMONTHNAME9                                                          = 0x0000002a
    857 	CAL_SCALNAME                                                                   = 0x00000002
    858 	CAL_SDAYNAME1                                                                  = 0x00000007
    859 	CAL_SDAYNAME2                                                                  = 0x00000008
    860 	CAL_SDAYNAME3                                                                  = 0x00000009
    861 	CAL_SDAYNAME4                                                                  = 0x0000000a
    862 	CAL_SDAYNAME5                                                                  = 0x0000000b
    863 	CAL_SDAYNAME6                                                                  = 0x0000000c
    864 	CAL_SDAYNAME7                                                                  = 0x0000000d
    865 	CAL_SERASTRING                                                                 = 0x00000004
    866 	CAL_SLONGDATE                                                                  = 0x00000006
    867 	CAL_SMONTHNAME1                                                                = 0x00000015
    868 	CAL_SMONTHNAME10                                                               = 0x0000001e
    869 	CAL_SMONTHNAME11                                                               = 0x0000001f
    870 	CAL_SMONTHNAME12                                                               = 0x00000020
    871 	CAL_SMONTHNAME13                                                               = 0x00000021
    872 	CAL_SMONTHNAME2                                                                = 0x00000016
    873 	CAL_SMONTHNAME3                                                                = 0x00000017
    874 	CAL_SMONTHNAME4                                                                = 0x00000018
    875 	CAL_SMONTHNAME5                                                                = 0x00000019
    876 	CAL_SMONTHNAME6                                                                = 0x0000001a
    877 	CAL_SMONTHNAME7                                                                = 0x0000001b
    878 	CAL_SMONTHNAME8                                                                = 0x0000001c
    879 	CAL_SMONTHNAME9                                                                = 0x0000001d
    880 	CAL_SSHORTDATE                                                                 = 0x00000005
    881 	CAL_SYEARMONTH                                                                 = 0x0000002f
    882 	CAL_TAIWAN                                                                     = 4
    883 	CAL_THAI                                                                       = 7
    884 	CAL_UMALQURA                                                                   = 23
    885 	CAL_USE_CP_ACP                                                                 = 1073741824
    886 	CAPSLOCK_ON                                                                    = 0x80
    887 	CAP_ATAPI_ID_CMD                                                               = 2
    888 	CAP_ATA_ID_CMD                                                                 = 1
    889 	CAP_SMART_CMD                                                                  = 4
    890 	CAT_E_FIRST                                                                    = 2147746144
    891 	CAT_E_LAST                                                                     = 2147746145
    892 	CA_LOG_FILTER                                                                  = 0x0002
    893 	CA_NEGATIVE                                                                    = 0x0001
    894 	CBF_FAIL_ADVISES                                                               = 0x00004000
    895 	CBF_FAIL_ALLSVRXACTIONS                                                        = 0x0003f000
    896 	CBF_FAIL_CONNECTIONS                                                           = 0x00002000
    897 	CBF_FAIL_EXECUTES                                                              = 0x00008000
    898 	CBF_FAIL_POKES                                                                 = 0x00010000
    899 	CBF_FAIL_REQUESTS                                                              = 0x00020000
    900 	CBF_FAIL_SELFCONNECTIONS                                                       = 0x00001000
    901 	CBF_SKIP_ALLNOTIFICATIONS                                                      = 0x003c0000
    902 	CBF_SKIP_CONNECT_CONFIRMS                                                      = 0x00040000
    903 	CBF_SKIP_DISCONNECTS                                                           = 0x00200000
    904 	CBF_SKIP_REGISTRATIONS                                                         = 0x00080000
    905 	CBF_SKIP_UNREGISTRATIONS                                                       = 0x00100000
    906 	CBM_INIT                                                                       = 4
    907 	CBN_CLOSEUP                                                                    = 8
    908 	CBN_DBLCLK                                                                     = 2
    909 	CBN_DROPDOWN                                                                   = 7
    910 	CBN_EDITCHANGE                                                                 = 5
    911 	CBN_EDITUPDATE                                                                 = 6
    912 	CBN_ERRSPACE                                                                   = -1
    913 	CBN_KILLFOCUS                                                                  = 4
    914 	CBN_SELCHANGE                                                                  = 1
    915 	CBN_SELENDCANCEL                                                               = 10
    916 	CBN_SELENDOK                                                                   = 9
    917 	CBN_SETFOCUS                                                                   = 3
    918 	CBR_110                                                                        = 110
    919 	CBR_115200                                                                     = 115200
    920 	CBR_1200                                                                       = 1200
    921 	CBR_128000                                                                     = 128000
    922 	CBR_14400                                                                      = 14400
    923 	CBR_19200                                                                      = 19200
    924 	CBR_2400                                                                       = 2400
    925 	CBR_256000                                                                     = 256000
    926 	CBR_300                                                                        = 300
    927 	CBR_38400                                                                      = 38400
    928 	CBR_4800                                                                       = 4800
    929 	CBR_56000                                                                      = 56000
    930 	CBR_57600                                                                      = 57600
    931 	CBR_600                                                                        = 600
    932 	CBR_9600                                                                       = 9600
    933 	CBS_AUTOHSCROLL                                                                = 64
    934 	CBS_DISABLENOSCROLL                                                            = 2048
    935 	CBS_DROPDOWN                                                                   = 2
    936 	CBS_DROPDOWNLIST                                                               = 3
    937 	CBS_HASSTRINGS                                                                 = 512
    938 	CBS_LOWERCASE                                                                  = 16384
    939 	CBS_NOINTEGRALHEIGHT                                                           = 1024
    940 	CBS_OEMCONVERT                                                                 = 128
    941 	CBS_OWNERDRAWFIXED                                                             = 16
    942 	CBS_OWNERDRAWVARIABLE                                                          = 32
    943 	CBS_SIMPLE                                                                     = 1
    944 	CBS_SORT                                                                       = 256
    945 	CBS_UPPERCASE                                                                  = 8192
    946 	CB_ADDSTRING                                                                   = 0x0143
    947 	CB_DELETESTRING                                                                = 0x0144
    948 	CB_DIR                                                                         = 0x0145
    949 	CB_ERR                                                                         = -1
    950 	CB_ERRSPACE                                                                    = -2
    951 	CB_FINDSTRING                                                                  = 0x014C
    952 	CB_FINDSTRINGEXACT                                                             = 0x0158
    953 	CB_GETCOMBOBOXINFO                                                             = 0x0164
    954 	CB_GETCOUNT                                                                    = 0x0146
    955 	CB_GETCURSEL                                                                   = 0x0147
    956 	CB_GETDROPPEDCONTROLRECT                                                       = 0x0152
    957 	CB_GETDROPPEDSTATE                                                             = 0x0157
    958 	CB_GETDROPPEDWIDTH                                                             = 0x015f
    959 	CB_GETEDITSEL                                                                  = 0x0140
    960 	CB_GETEXTENDEDUI                                                               = 0x0156
    961 	CB_GETHORIZONTALEXTENT                                                         = 0x015d
    962 	CB_GETITEMDATA                                                                 = 0x0150
    963 	CB_GETITEMHEIGHT                                                               = 0x0154
    964 	CB_GETLBTEXT                                                                   = 0x0148
    965 	CB_GETLBTEXTLEN                                                                = 0x0149
    966 	CB_GETLOCALE                                                                   = 0x015A
    967 	CB_GETTOPINDEX                                                                 = 0x015b
    968 	CB_INITSTORAGE                                                                 = 0x0161
    969 	CB_INSERTSTRING                                                                = 0x014A
    970 	CB_LIMITTEXT                                                                   = 0x0141
    971 	CB_MSGMAX                                                                      = 0x0165
    972 	CB_OKAY                                                                        = 0
    973 	CB_RESETCONTENT                                                                = 0x014B
    974 	CB_SELECTSTRING                                                                = 0x014D
    975 	CB_SETCURSEL                                                                   = 0x014E
    976 	CB_SETDROPPEDWIDTH                                                             = 0x0160
    977 	CB_SETEDITSEL                                                                  = 0x0142
    978 	CB_SETEXTENDEDUI                                                               = 0x0155
    979 	CB_SETHORIZONTALEXTENT                                                         = 0x015e
    980 	CB_SETITEMDATA                                                                 = 0x0151
    981 	CB_SETITEMHEIGHT                                                               = 0x0153
    982 	CB_SETLOCALE                                                                   = 0x0159
    983 	CB_SETTOPINDEX                                                                 = 0x015c
    984 	CB_SHOWDROPDOWN                                                                = 0x014F
    985 	CCERR_CHOOSECOLORCODES                                                         = 0x5000
    986 	CCHDEVICENAME                                                                  = 32
    987 	CCHFORMNAME                                                                    = 32
    988 	CCHILDREN_SCROLLBAR                                                            = 5
    989 	CCHILDREN_TITLEBAR                                                             = 5
    990 	CCH_MAX_PROPSTG_NAME                                                           = 31
    991 	CC_AND                                                                         = 24
    992 	CC_ANYCOLOR                                                                    = 0x100
    993 	CC_BANG                                                                        = 15
    994 	CC_BOM                                                                         = 30
    995 	CC_CHORD                                                                       = 4
    996 	CC_CIRCLES                                                                     = 1
    997 	CC_COMMA                                                                       = 23
    998 	CC_DIGIT                                                                       = 3
    999 	CC_DOLLAR                                                                      = 4
   1000 	CC_DOT                                                                         = 26
   1001 	CC_ELLIPSES                                                                    = 8
   1002 	CC_ENABLEHOOK                                                                  = 0x10
   1003 	CC_ENABLETEMPLATE                                                              = 0x20
   1004 	CC_ENABLETEMPLATEHANDLE                                                        = 0x40
   1005 	CC_EQ                                                                          = 14
   1006 	CC_FULLOPEN                                                                    = 0x2
   1007 	CC_GT                                                                          = 13
   1008 	CC_ID                                                                          = 27
   1009 	CC_ILLEGAL                                                                     = 28
   1010 	CC_INTERIORS                                                                   = 128
   1011 	CC_KYWD                                                                        = 2
   1012 	CC_KYWD0                                                                       = 1
   1013 	CC_LP                                                                          = 17
   1014 	CC_LT                                                                          = 12
   1015 	CC_MINUS                                                                       = 11
   1016 	CC_NONE                                                                        = 0
   1017 	CC_NUL                                                                         = 29
   1018 	CC_PERCENT                                                                     = 22
   1019 	CC_PIE                                                                         = 2
   1020 	CC_PIPE                                                                        = 10
   1021 	CC_PLUS                                                                        = 20
   1022 	CC_PREVENTFULLOPEN                                                             = 0x4
   1023 	CC_QUOTE                                                                       = 8
   1024 	CC_QUOTE2                                                                      = 9
   1025 	CC_RGBINIT                                                                     = 0x1
   1026 	CC_ROUNDRECT                                                                   = 256
   1027 	CC_RP                                                                          = 18
   1028 	CC_SEMI                                                                        = 19
   1029 	CC_SHOWHELP                                                                    = 0x8
   1030 	CC_SLASH                                                                       = 16
   1031 	CC_SOLIDCOLOR                                                                  = 0x80
   1032 	CC_SPACE                                                                       = 7
   1033 	CC_STAR                                                                        = 21
   1034 	CC_STYLED                                                                      = 32
   1035 	CC_TILDA                                                                       = 25
   1036 	CC_VARALPHA                                                                    = 5
   1037 	CC_VARNUM                                                                      = 6
   1038 	CC_WIDE                                                                        = 16
   1039 	CC_WIDESTYLED                                                                  = 64
   1040 	CC_X                                                                           = 0
   1041 	CDECL                                                                          = 0
   1042 	CDERR_DIALOGFAILURE                                                            = 0xFFFF
   1043 	CDERR_FINDRESFAILURE                                                           = 0x0006
   1044 	CDERR_GENERALCODES                                                             = 0x0000
   1045 	CDERR_INITIALIZATION                                                           = 0x0002
   1046 	CDERR_LOADRESFAILURE                                                           = 0x0007
   1047 	CDERR_LOADSTRFAILURE                                                           = 0x0005
   1048 	CDERR_LOCKRESFAILURE                                                           = 0x0008
   1049 	CDERR_MEMALLOCFAILURE                                                          = 0x0009
   1050 	CDERR_MEMLOCKFAILURE                                                           = 0x000A
   1051 	CDERR_NOHINSTANCE                                                              = 0x0004
   1052 	CDERR_NOHOOK                                                                   = 0x000B
   1053 	CDERR_NOTEMPLATE                                                               = 0x0003
   1054 	CDERR_REGISTERMSGFAIL                                                          = 0x000C
   1055 	CDERR_STRUCTSIZE                                                               = 0x0001
   1056 	CDM_FIRST                                                                      = 1124
   1057 	CDM_GETFILEPATH                                                                = 1125
   1058 	CDM_GETFOLDERIDLIST                                                            = 1127
   1059 	CDM_GETFOLDERPATH                                                              = 1126
   1060 	CDM_GETSPEC                                                                    = 1124
   1061 	CDM_HIDECONTROL                                                                = 1129
   1062 	CDM_LAST                                                                       = 1224
   1063 	CDM_SETCONTROLTEXT                                                             = 1128
   1064 	CDM_SETDEFEXT                                                                  = 1130
   1065 	CDN_FILEOK                                                                     = 18446744073709551010
   1066 	CDN_FIRST                                                                      = 18446744073709551015
   1067 	CDN_FOLDERCHANGE                                                               = 18446744073709551013
   1068 	CDN_HELP                                                                       = 18446744073709551011
   1069 	CDN_INCLUDEITEM                                                                = 18446744073709551008
   1070 	CDN_INITDONE                                                                   = 18446744073709551015
   1071 	CDN_LAST                                                                       = 18446744073709550917
   1072 	CDN_SELCHANGE                                                                  = 18446744073709551014
   1073 	CDN_SHAREVIOLATION                                                             = 18446744073709551012
   1074 	CDN_TYPECHANGE                                                                 = 18446744073709551009
   1075 	CDS_FULLSCREEN                                                                 = 0x00000004
   1076 	CDS_GLOBAL                                                                     = 0x00000008
   1077 	CDS_NORESET                                                                    = 0x10000000
   1078 	CDS_RESET                                                                      = 0x40000000
   1079 	CDS_RESET_EX                                                                   = 0x20000000
   1080 	CDS_SET_PRIMARY                                                                = 0x00000010
   1081 	CDS_TEST                                                                       = 0x00000002
   1082 	CDS_UPDATEREGISTRY                                                             = 0x00000001
   1083 	CDS_VIDEOPARAMETERS                                                            = 0x00000020
   1084 	CD_LBSELADD                                                                    = 2
   1085 	CD_LBSELCHANGE                                                                 = 0
   1086 	CD_LBSELNOITEMS                                                                = -1
   1087 	CD_LBSELSUB                                                                    = 1
   1088 	CERT_ACCESS_STATE_GP_SYSTEM_STORE_FLAG                                         = 0x8
   1089 	CERT_ACCESS_STATE_LM_SYSTEM_STORE_FLAG                                         = 0x4
   1090 	CERT_ACCESS_STATE_PROP_ID                                                      = 14
   1091 	CERT_ACCESS_STATE_SHARED_USER_FLAG                                             = 0x10
   1092 	CERT_ACCESS_STATE_SYSTEM_STORE_FLAG                                            = 0x2
   1093 	CERT_ACCESS_STATE_WRITE_PERSIST_FLAG                                           = 0x1
   1094 	CERT_AIA_URL_RETRIEVED_PROP_ID                                                 = 67
   1095 	CERT_ALT_NAME_DIRECTORY_NAME                                                   = 5
   1096 	CERT_ALT_NAME_DNS_NAME                                                         = 3
   1097 	CERT_ALT_NAME_EDI_PARTY_NAME                                                   = 6
   1098 	CERT_ALT_NAME_ENTRY_ERR_INDEX_MASK                                             = 0xff
   1099 	CERT_ALT_NAME_ENTRY_ERR_INDEX_SHIFT                                            = 16
   1100 	CERT_ALT_NAME_IP_ADDRESS                                                       = 8
   1101 	CERT_ALT_NAME_OTHER_NAME                                                       = 1
   1102 	CERT_ALT_NAME_REGISTERED_ID                                                    = 9
   1103 	CERT_ALT_NAME_RFC822_NAME                                                      = 2
   1104 	CERT_ALT_NAME_URL                                                              = 7
   1105 	CERT_ALT_NAME_VALUE_ERR_INDEX_MASK                                             = 0x0000ffff
   1106 	CERT_ALT_NAME_VALUE_ERR_INDEX_SHIFT                                            = 0
   1107 	CERT_ALT_NAME_X400_ADDRESS                                                     = 4
   1108 	CERT_ARCHIVED_KEY_HASH_PROP_ID                                                 = 65
   1109 	CERT_ARCHIVED_PROP_ID                                                          = 19
   1110 	CERT_AUTHORITY_INFO_ACCESS_PROP_ID                                             = 68
   1111 	CERT_AUTH_ROOT_AUTO_UPDATE_DISABLE_PARTIAL_CHAIN_LOGGING_FLAG                  = 0x2
   1112 	CERT_AUTH_ROOT_AUTO_UPDATE_DISABLE_UNTRUSTED_ROOT_LOGGING_FLAG                 = 0x1
   1113 	CERT_AUTH_ROOT_CTL_FILENAME_A                                                  = "authroot.stl"
   1114 	CERT_AUTH_ROOT_SHA256_HASH_PROP_ID                                             = 98
   1115 	CERT_AUTO_ENROLL_PROP_ID                                                       = 21
   1116 	CERT_AUTO_ENROLL_RETRY_PROP_ID                                                 = 66
   1117 	CERT_AUTO_UPDATE_DISABLE_RANDOM_QUERY_STRING_FLAG                              = 0x4
   1118 	CERT_BACKED_UP_PROP_ID                                                         = 69
   1119 	CERT_BIOMETRIC_OID_DATA_CHOICE                                                 = 2
   1120 	CERT_BIOMETRIC_PICTURE_TYPE                                                    = 0
   1121 	CERT_BIOMETRIC_PREDEFINED_DATA_CHOICE                                          = 1
   1122 	CERT_BIOMETRIC_SIGNATURE_TYPE                                                  = 1
   1123 	CERT_BUNDLE_CERTIFICATE                                                        = 0
   1124 	CERT_BUNDLE_CRL                                                                = 1
   1125 	CERT_CASE_INSENSITIVE_IS_RDN_ATTRS_FLAG                                        = 0x2
   1126 	CERT_CA_DISABLE_CRL_PROP_ID                                                    = 82
   1127 	CERT_CA_OCSP_AUTHORITY_INFO_ACCESS_PROP_ID                                     = 81
   1128 	CERT_CA_SUBJECT_FLAG                                                           = 0x80
   1129 	CERT_CEP_PROP_ID                                                               = 87
   1130 	CERT_CHAIN_AUTO_CURRENT_USER                                                   = 1
   1131 	CERT_CHAIN_AUTO_FLUSH_DISABLE_FLAG                                             = 0x00000001
   1132 	CERT_CHAIN_AUTO_FLUSH_FIRST_DELTA_SECONDS_DEFAULT                              = 300
   1133 	CERT_CHAIN_AUTO_FLUSH_NEXT_DELTA_SECONDS_DEFAULT                               = 1800
   1134 	CERT_CHAIN_AUTO_HPKP_RULE_INFO                                                 = 8
   1135 	CERT_CHAIN_AUTO_IMPERSONATED                                                   = 3
   1136 	CERT_CHAIN_AUTO_LOCAL_MACHINE                                                  = 2
   1137 	CERT_CHAIN_AUTO_LOG_CREATE_FLAG                                                = 0x00000002
   1138 	CERT_CHAIN_AUTO_LOG_FLAGS                                                      = 14
   1139 	CERT_CHAIN_AUTO_LOG_FLUSH_FLAG                                                 = 0x00000008
   1140 	CERT_CHAIN_AUTO_LOG_FREE_FLAG                                                  = 0x00000004
   1141 	CERT_CHAIN_AUTO_NETWORK_INFO                                                   = 6
   1142 	CERT_CHAIN_AUTO_PINRULE_INFO                                                   = 5
   1143 	CERT_CHAIN_AUTO_PROCESS_INFO                                                   = 4
   1144 	CERT_CHAIN_AUTO_SERIAL_LOCAL_MACHINE                                           = 7
   1145 	CERT_CHAIN_CACHE_END_CERT                                                      = 0x1
   1146 	CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL                                            = 0x4
   1147 	CERT_CHAIN_CRL_VALIDITY_EXT_PERIOD_HOURS_DEFAULT                               = 12
   1148 	CERT_CHAIN_CROSS_CERT_DOWNLOAD_INTERVAL_HOURS_DEFAULT                          = 168
   1149 	CERT_CHAIN_DISABLE_AIA                                                         = 0x2000
   1150 	CERT_CHAIN_DISABLE_ALL_EKU_WEAK_FLAG                                           = 0x00010000
   1151 	CERT_CHAIN_DISABLE_AUTH_ROOT_AUTO_UPDATE                                       = 0x100
   1152 	CERT_CHAIN_DISABLE_CODE_SIGNING_WEAK_FLAG                                      = 0x00400000
   1153 	CERT_CHAIN_DISABLE_FILE_HASH_WEAK_FLAG                                         = 0x00001000
   1154 	CERT_CHAIN_DISABLE_FILE_HASH_WEAK_FLAGS                                        = 12288
   1155 	CERT_CHAIN_DISABLE_MD2_MD4                                                     = 0x1000
   1156 	CERT_CHAIN_DISABLE_MOTW_CODE_SIGNING_WEAK_FLAG                                 = 0x00800000
   1157 	CERT_CHAIN_DISABLE_MOTW_FILE_HASH_WEAK_FLAG                                    = 0x00002000
   1158 	CERT_CHAIN_DISABLE_MOTW_TIMESTAMP_HASH_WEAK_FLAG                               = 0x00008000
   1159 	CERT_CHAIN_DISABLE_MOTW_TIMESTAMP_WEAK_FLAG                                    = 0x08000000
   1160 	CERT_CHAIN_DISABLE_MY_PEER_TRUST                                               = 0x800
   1161 	CERT_CHAIN_DISABLE_OPT_IN_SERVER_AUTH_WEAK_FLAG                                = 0x00040000
   1162 	CERT_CHAIN_DISABLE_PASS1_QUALITY_FILTERING                                     = 0x40
   1163 	CERT_CHAIN_DISABLE_SERVER_AUTH_WEAK_FLAG                                       = 0x00100000
   1164 	CERT_CHAIN_DISABLE_TIMESTAMP_HASH_WEAK_FLAG                                    = 0x00004000
   1165 	CERT_CHAIN_DISABLE_TIMESTAMP_HASH_WEAK_FLAGS                                   = 49152
   1166 	CERT_CHAIN_DISABLE_TIMESTAMP_WEAK_FLAG                                         = 0x04000000
   1167 	CERT_CHAIN_DISABLE_WEAK_FLAGS                                                  = 215285760
   1168 	CERT_CHAIN_ENABLE_ALL_EKU_HYGIENE_FLAG                                         = 0x00020000
   1169 	CERT_CHAIN_ENABLE_CACHE_AUTO_UPDATE                                            = 0x10
   1170 	CERT_CHAIN_ENABLE_CODE_SIGNING_HYGIENE_FLAG                                    = 0x01000000
   1171 	CERT_CHAIN_ENABLE_HYGIENE_FLAGS                                                = 857866240
   1172 	CERT_CHAIN_ENABLE_MD2_MD4_FLAG                                                 = 0x1
   1173 	CERT_CHAIN_ENABLE_MOTW_CODE_SIGNING_HYGIENE_FLAG                               = 0x02000000
   1174 	CERT_CHAIN_ENABLE_MOTW_TIMESTAMP_HYGIENE_FLAG                                  = 0x20000000
   1175 	CERT_CHAIN_ENABLE_ONLY_WEAK_LOGGING_FLAG                                       = 0x8
   1176 	CERT_CHAIN_ENABLE_PEER_TRUST                                                   = 0x400
   1177 	CERT_CHAIN_ENABLE_SERVER_AUTH_HYGIENE_FLAG                                     = 0x00200000
   1178 	CERT_CHAIN_ENABLE_SHARE_STORE                                                  = 0x20
   1179 	CERT_CHAIN_ENABLE_TIMESTAMP_HYGIENE_FLAG                                       = 0x10000000
   1180 	CERT_CHAIN_ENABLE_WEAK_LOGGING_FLAG                                            = 0x4
   1181 	CERT_CHAIN_ENABLE_WEAK_RSA_ROOT_FLAG                                           = 0x2
   1182 	CERT_CHAIN_ENABLE_WEAK_SETTINGS_FLAG                                           = 0x80000000
   1183 	CERT_CHAIN_FIND_BY_ISSUER                                                      = 1
   1184 	CERT_CHAIN_FIND_BY_ISSUER_CACHE_ONLY_FLAG                                      = 0x8000
   1185 	CERT_CHAIN_FIND_BY_ISSUER_CACHE_ONLY_URL_FLAG                                  = 0x4
   1186 	CERT_CHAIN_FIND_BY_ISSUER_COMPARE_KEY_FLAG                                     = 0x1
   1187 	CERT_CHAIN_FIND_BY_ISSUER_COMPLEX_CHAIN_FLAG                                   = 0x2
   1188 	CERT_CHAIN_FIND_BY_ISSUER_LOCAL_MACHINE_FLAG                                   = 0x8
   1189 	CERT_CHAIN_FIND_BY_ISSUER_NO_KEY_FLAG                                          = 0x4000
   1190 	CERT_CHAIN_HAS_MOTW                                                            = 0x4000
   1191 	CERT_CHAIN_MAX_AIA_URL_COUNT_IN_CERT_DEFAULT                                   = 5
   1192 	CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_BYTE_COUNT_DEFAULT                            = 100000
   1193 	CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_CERT_COUNT_DEFAULT                            = 10
   1194 	CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_COUNT_PER_CHAIN_DEFAULT                       = 3
   1195 	CERT_CHAIN_MAX_SSL_TIME_UPDATED_EVENT_COUNT_DEFAULT                            = 5
   1196 	CERT_CHAIN_MAX_SSL_TIME_UPDATED_EVENT_COUNT_DISABLE                            = 0xFFFFFFFF
   1197 	CERT_CHAIN_MAX_URL_RETRIEVAL_BYTE_COUNT_DEFAULT                                = 104857600
   1198 	CERT_CHAIN_MIN_PUB_KEY_BIT_LENGTH_DISABLE                                      = 0xFFFFFFFF
   1199 	CERT_CHAIN_MIN_RSA_PUB_KEY_BIT_LENGTH_DEFAULT                                  = 1023
   1200 	CERT_CHAIN_MIN_RSA_PUB_KEY_BIT_LENGTH_DISABLE                                  = 0xffffffff
   1201 	CERT_CHAIN_MOTW_IGNORE_AFTER_TIME_WEAK_FLAG                                    = 0x40000000
   1202 	CERT_CHAIN_MOTW_WEAK_FLAGS                                                     = 1786773504
   1203 	CERT_CHAIN_OCSP_VALIDITY_SECONDS_DEFAULT                                       = 43200
   1204 	CERT_CHAIN_ONLY_ADDITIONAL_AND_AUTH_ROOT                                       = 0x8000
   1205 	CERT_CHAIN_OPTION_DISABLE_AIA_URL_RETRIEVAL                                    = 0x2
   1206 	CERT_CHAIN_OPTION_ENABLE_SIA_URL_RETRIEVAL                                     = 0x4
   1207 	CERT_CHAIN_OPT_IN_WEAK_FLAGS                                                   = 262144
   1208 	CERT_CHAIN_OPT_IN_WEAK_SIGNATURE                                               = 0x10000
   1209 	CERT_CHAIN_POLICY_ALLOW_TESTROOT_FLAG                                          = 0x8000
   1210 	CERT_CHAIN_POLICY_ALLOW_UNKNOWN_CA_FLAG                                        = 0x10
   1211 	CERT_CHAIN_POLICY_IGNORE_ALL_NOT_TIME_VALID_FLAGS                              = 7
   1212 	CERT_CHAIN_POLICY_IGNORE_ALL_REV_UNKNOWN_FLAGS                                 = 3840
   1213 	CERT_CHAIN_POLICY_IGNORE_CA_REV_UNKNOWN_FLAG                                   = 0x400
   1214 	CERT_CHAIN_POLICY_IGNORE_CTL_NOT_TIME_VALID_FLAG                               = 0x2
   1215 	CERT_CHAIN_POLICY_IGNORE_CTL_SIGNER_REV_UNKNOWN_FLAG                           = 0x200
   1216 	CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG                                  = 0x100
   1217 	CERT_CHAIN_POLICY_IGNORE_INVALID_BASIC_CONSTRAINTS_FLAG                        = 0x8
   1218 	CERT_CHAIN_POLICY_IGNORE_INVALID_NAME_FLAG                                     = 0x40
   1219 	CERT_CHAIN_POLICY_IGNORE_INVALID_POLICY_FLAG                                   = 0x80
   1220 	CERT_CHAIN_POLICY_IGNORE_NOT_SUPPORTED_CRITICAL_EXT_FLAG                       = 0x2000
   1221 	CERT_CHAIN_POLICY_IGNORE_NOT_TIME_NESTED_FLAG                                  = 0x4
   1222 	CERT_CHAIN_POLICY_IGNORE_NOT_TIME_VALID_FLAG                                   = 0x1
   1223 	CERT_CHAIN_POLICY_IGNORE_PEER_TRUST_FLAG                                       = 0x1000
   1224 	CERT_CHAIN_POLICY_IGNORE_ROOT_REV_UNKNOWN_FLAG                                 = 0x800
   1225 	CERT_CHAIN_POLICY_IGNORE_WRONG_USAGE_FLAG                                      = 0x20
   1226 	CERT_CHAIN_POLICY_SSL_F12_ERROR_LEVEL                                          = 2
   1227 	CERT_CHAIN_POLICY_SSL_F12_NONE_CATEGORY                                        = 0
   1228 	CERT_CHAIN_POLICY_SSL_F12_ROOT_PROGRAM_CATEGORY                                = 2
   1229 	CERT_CHAIN_POLICY_SSL_F12_SUCCESS_LEVEL                                        = 0
   1230 	CERT_CHAIN_POLICY_SSL_F12_WARNING_LEVEL                                        = 1
   1231 	CERT_CHAIN_POLICY_SSL_F12_WEAK_CRYPTO_CATEGORY                                 = 1
   1232 	CERT_CHAIN_POLICY_SSL_KEY_PIN_MISMATCH_ERROR                                   = -2
   1233 	CERT_CHAIN_POLICY_SSL_KEY_PIN_MISMATCH_WARNING                                 = 2
   1234 	CERT_CHAIN_POLICY_SSL_KEY_PIN_MITM_ERROR                                       = -1
   1235 	CERT_CHAIN_POLICY_SSL_KEY_PIN_MITM_WARNING                                     = 1
   1236 	CERT_CHAIN_POLICY_SSL_KEY_PIN_SUCCESS                                          = 0
   1237 	CERT_CHAIN_POLICY_TRUST_TESTROOT_FLAG                                          = 0x4000
   1238 	CERT_CHAIN_RETURN_LOWER_QUALITY_CONTEXTS                                       = 0x80
   1239 	CERT_CHAIN_REVOCATION_ACCUMULATIVE_TIMEOUT                                     = 0x8000000
   1240 	CERT_CHAIN_REVOCATION_CHECK_CACHE_ONLY                                         = 0x80000000
   1241 	CERT_CHAIN_REVOCATION_CHECK_CHAIN                                              = 0x20000000
   1242 	CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT                                 = 0x40000000
   1243 	CERT_CHAIN_REVOCATION_CHECK_END_CERT                                           = 0x10000000
   1244 	CERT_CHAIN_REVOCATION_CHECK_OCSP_CERT                                          = 0x4000000
   1245 	CERT_CHAIN_REV_ACCUMULATIVE_URL_RETRIEVAL_TIMEOUT_MILLISECONDS_DEFAULT         = 20000
   1246 	CERT_CHAIN_STRONG_SIGN_DISABLE_END_CHECK_FLAG                                  = 0x1
   1247 	CERT_CHAIN_THREAD_STORE_SYNC                                                   = 0x2
   1248 	CERT_CHAIN_TIMESTAMP_TIME                                                      = 0x200
   1249 	CERT_CHAIN_URL_RETRIEVAL_TIMEOUT_MILLISECONDS_DEFAULT                          = 15000
   1250 	CERT_CHAIN_USE_LOCAL_MACHINE_STORE                                             = 0x8
   1251 	CERT_CHAIN_WEAK_RSA_PUB_KEY_TIME_DEFAULT                                       = 0x01ca8a755c6e0000
   1252 	CERT_CLOSE_STORE_CHECK_FLAG                                                    = 0x2
   1253 	CERT_CLOSE_STORE_FORCE_FLAG                                                    = 0x1
   1254 	CERT_CLR_DELETE_KEY_PROP_ID                                                    = 125
   1255 	CERT_COMPARE_ANY                                                               = 0
   1256 	CERT_COMPARE_ATTR                                                              = 3
   1257 	CERT_COMPARE_CERT_ID                                                           = 16
   1258 	CERT_COMPARE_CROSS_CERT_DIST_POINTS                                            = 17
   1259 	CERT_COMPARE_CTL_USAGE                                                         = 10
   1260 	CERT_COMPARE_ENHKEY_USAGE                                                      = 10
   1261 	CERT_COMPARE_EXISTING                                                          = 13
   1262 	CERT_COMPARE_HASH                                                              = 1
   1263 	CERT_COMPARE_HASH_STR                                                          = 20
   1264 	CERT_COMPARE_HAS_PRIVATE_KEY                                                   = 21
   1265 	CERT_COMPARE_ISSUER_OF                                                         = 12
   1266 	CERT_COMPARE_KEY_IDENTIFIER                                                    = 15
   1267 	CERT_COMPARE_KEY_SPEC                                                          = 9
   1268 	CERT_COMPARE_MASK                                                              = 0xffff
   1269 	CERT_COMPARE_MD5_HASH                                                          = 4
   1270 	CERT_COMPARE_NAME                                                              = 2
   1271 	CERT_COMPARE_NAME_STR_A                                                        = 7
   1272 	CERT_COMPARE_NAME_STR_W                                                        = 8
   1273 	CERT_COMPARE_PROPERTY                                                          = 5
   1274 	CERT_COMPARE_PUBKEY_MD5_HASH                                                   = 18
   1275 	CERT_COMPARE_PUBLIC_KEY                                                        = 6
   1276 	CERT_COMPARE_SHA1_HASH                                                         = 1
   1277 	CERT_COMPARE_SHIFT                                                             = 16
   1278 	CERT_COMPARE_SIGNATURE_HASH                                                    = 14
   1279 	CERT_COMPARE_SUBJECT_CERT                                                      = 11
   1280 	CERT_COMPARE_SUBJECT_INFO_ACCESS                                               = 19
   1281 	CERT_CONTEXT_REVOCATION_TYPE                                                   = 1
   1282 	CERT_CREATE_CONTEXT_NOCOPY_FLAG                                                = 0x1
   1283 	CERT_CREATE_CONTEXT_NO_ENTRY_FLAG                                              = 0x8
   1284 	CERT_CREATE_CONTEXT_NO_HCRYPTMSG_FLAG                                          = 0x4
   1285 	CERT_CREATE_CONTEXT_SORTED_FLAG                                                = 0x2
   1286 	CERT_CREATE_SELFSIGN_NO_KEY_INFO                                               = 2
   1287 	CERT_CREATE_SELFSIGN_NO_SIGN                                                   = 1
   1288 	CERT_CRL_SIGN_KEY_USAGE                                                        = 0x02
   1289 	CERT_CROSS_CERT_DIST_POINTS_PROP_ID                                            = 23
   1290 	CERT_CTL_USAGE_PROP_ID                                                         = 9
   1291 	CERT_DATA_ENCIPHERMENT_KEY_USAGE                                               = 0x10
   1292 	CERT_DATE_STAMP_PROP_ID                                                        = 27
   1293 	CERT_DECIPHER_ONLY_KEY_USAGE                                                   = 0x80
   1294 	CERT_DESCRIPTION_PROP_ID                                                       = 13
   1295 	CERT_DIGITAL_SIGNATURE_KEY_USAGE                                               = 0x80
   1296 	CERT_DISALLOWED_CERT_CTL_FILENAME_A                                            = "disallowedcert.stl"
   1297 	CERT_DISALLOWED_ENHKEY_USAGE_PROP_ID                                           = 122
   1298 	CERT_DISALLOWED_FILETIME_PROP_ID                                               = 104
   1299 	CERT_DSS_R_LEN                                                                 = 20
   1300 	CERT_DSS_SIGNATURE_LEN                                                         = 40
   1301 	CERT_DSS_S_LEN                                                                 = 20
   1302 	CERT_EFS_PROP_ID                                                               = 17
   1303 	CERT_ENCIPHER_ONLY_KEY_USAGE                                                   = 0x01
   1304 	CERT_ENCODING_TYPE_MASK                                                        = 0x0000ffff
   1305 	CERT_END_ENTITY_SUBJECT_FLAG                                                   = 0x40
   1306 	CERT_ENHKEY_USAGE_PROP_ID                                                      = 9
   1307 	CERT_ENROLLMENT_PROP_ID                                                        = 26
   1308 	CERT_EXCLUDED_SUBTREE_BIT                                                      = 2147483648
   1309 	CERT_EXTENDED_ERROR_INFO_PROP_ID                                               = 30
   1310 	CERT_FILE_STORE_COMMIT_ENABLE_FLAG                                             = 0x10000
   1311 	CERT_FIND_ANY                                                                  = 0
   1312 	CERT_FIND_CERT_ID                                                              = 1048576
   1313 	CERT_FIND_CROSS_CERT_DIST_POINTS                                               = 1114112
   1314 	CERT_FIND_CTL_USAGE                                                            = 655360
   1315 	CERT_FIND_ENHKEY_USAGE                                                         = 655360
   1316 	CERT_FIND_EXISTING                                                             = 851968
   1317 	CERT_FIND_EXT_ONLY_CTL_USAGE_FLAG                                              = 2
   1318 	CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG                                           = 0x2
   1319 	CERT_FIND_HASH                                                                 = 65536
   1320 	CERT_FIND_HASH_STR                                                             = 1310720
   1321 	CERT_FIND_HAS_PRIVATE_KEY                                                      = 1376256
   1322 	CERT_FIND_ISSUER_ATTR                                                          = 196612
   1323 	CERT_FIND_ISSUER_NAME                                                          = 131076
   1324 	CERT_FIND_ISSUER_OF                                                            = 786432
   1325 	CERT_FIND_ISSUER_STR                                                           = 524292
   1326 	CERT_FIND_ISSUER_STR_A                                                         = 458756
   1327 	CERT_FIND_ISSUER_STR_W                                                         = 524292
   1328 	CERT_FIND_KEY_IDENTIFIER                                                       = 983040
   1329 	CERT_FIND_KEY_SPEC                                                             = 589824
   1330 	CERT_FIND_MD5_HASH                                                             = 262144
   1331 	CERT_FIND_NO_CTL_USAGE_FLAG                                                    = 8
   1332 	CERT_FIND_NO_ENHKEY_USAGE_FLAG                                                 = 0x8
   1333 	CERT_FIND_OPTIONAL_CTL_USAGE_FLAG                                              = 1
   1334 	CERT_FIND_OPTIONAL_ENHKEY_USAGE_FLAG                                           = 0x1
   1335 	CERT_FIND_OR_CTL_USAGE_FLAG                                                    = 16
   1336 	CERT_FIND_OR_ENHKEY_USAGE_FLAG                                                 = 0x10
   1337 	CERT_FIND_PROPERTY                                                             = 327680
   1338 	CERT_FIND_PROP_ONLY_CTL_USAGE_FLAG                                             = 4
   1339 	CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG                                          = 0x4
   1340 	CERT_FIND_PUBKEY_MD5_HASH                                                      = 1179648
   1341 	CERT_FIND_PUBLIC_KEY                                                           = 393216
   1342 	CERT_FIND_SHA1_HASH                                                            = 65536
   1343 	CERT_FIND_SIGNATURE_HASH                                                       = 917504
   1344 	CERT_FIND_SUBJECT_ATTR                                                         = 196615
   1345 	CERT_FIND_SUBJECT_CERT                                                         = 720896
   1346 	CERT_FIND_SUBJECT_INFO_ACCESS                                                  = 1245184
   1347 	CERT_FIND_SUBJECT_NAME                                                         = 131079
   1348 	CERT_FIND_SUBJECT_STR                                                          = 524295
   1349 	CERT_FIND_SUBJECT_STR_A                                                        = 458759
   1350 	CERT_FIND_SUBJECT_STR_W                                                        = 524295
   1351 	CERT_FIND_VALID_CTL_USAGE_FLAG                                                 = 32
   1352 	CERT_FIND_VALID_ENHKEY_USAGE_FLAG                                              = 0x20
   1353 	CERT_FIRST_RESERVED_PROP_ID                                                    = 107
   1354 	CERT_FIRST_USER_PROP_ID                                                        = 0x8000
   1355 	CERT_FORTEZZA_DATA_PROP_ID                                                     = 18
   1356 	CERT_FRIENDLY_NAME_PROP_ID                                                     = 11
   1357 	CERT_HASH_PROP_ID                                                              = 3
   1358 	CERT_HCRYPTPROV_OR_NCRYPT_KEY_HANDLE_PROP_ID                                   = 79
   1359 	CERT_HCRYPTPROV_TRANSFER_PROP_ID                                               = 100
   1360 	CERT_ID_ISSUER_SERIAL_NUMBER                                                   = 1
   1361 	CERT_ID_KEY_IDENTIFIER                                                         = 2
   1362 	CERT_ID_SHA1_HASH                                                              = 3
   1363 	CERT_IE30_RESERVED_PROP_ID                                                     = 7
   1364 	CERT_INFO_EXTENSION_FLAG                                                       = 11
   1365 	CERT_INFO_ISSUER_FLAG                                                          = 4
   1366 	CERT_INFO_ISSUER_UNIQUE_ID_FLAG                                                = 9
   1367 	CERT_INFO_NOT_AFTER_FLAG                                                       = 6
   1368 	CERT_INFO_NOT_BEFORE_FLAG                                                      = 5
   1369 	CERT_INFO_SERIAL_NUMBER_FLAG                                                   = 2
   1370 	CERT_INFO_SIGNATURE_ALGORITHM_FLAG                                             = 3
   1371 	CERT_INFO_SUBJECT_FLAG                                                         = 7
   1372 	CERT_INFO_SUBJECT_PUBLIC_KEY_INFO_FLAG                                         = 8
   1373 	CERT_INFO_SUBJECT_UNIQUE_ID_FLAG                                               = 10
   1374 	CERT_INFO_VERSION_FLAG                                                         = 1
   1375 	CERT_ISOLATED_KEY_PROP_ID                                                      = 118
   1376 	CERT_ISSUER_CHAIN_PUB_KEY_CNG_ALG_BIT_LENGTH_PROP_ID                           = 96
   1377 	CERT_ISSUER_CHAIN_SIGN_HASH_CNG_ALG_PROP_ID                                    = 95
   1378 	CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID                                        = 24
   1379 	CERT_ISSUER_PUB_KEY_BIT_LENGTH_PROP_ID                                         = 94
   1380 	CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID                                     = 28
   1381 	CERT_KEYGEN_REQUEST_V1                                                         = 0
   1382 	CERT_KEY_AGREEMENT_KEY_USAGE                                                   = 0x08
   1383 	CERT_KEY_CERT_SIGN_KEY_USAGE                                                   = 0x04
   1384 	CERT_KEY_CLASSIFICATION_PROP_ID                                                = 120
   1385 	CERT_KEY_CONTEXT_PROP_ID                                                       = 5
   1386 	CERT_KEY_ENCIPHERMENT_KEY_USAGE                                                = 0x20
   1387 	CERT_KEY_IDENTIFIER_PROP_ID                                                    = 20
   1388 	CERT_KEY_PROV_HANDLE_PROP_ID                                                   = 1
   1389 	CERT_KEY_PROV_INFO_PROP_ID                                                     = 2
   1390 	CERT_KEY_REPAIR_ATTEMPTED_PROP_ID                                              = 103
   1391 	CERT_KEY_SPEC_PROP_ID                                                          = 6
   1392 	CERT_LAST_RESERVED_PROP_ID                                                     = 0x00007fff
   1393 	CERT_LAST_USER_PROP_ID                                                         = 0x0000ffff
   1394 	CERT_LDAP_STORE_AREC_EXCLUSIVE_FLAG                                            = 0x20000
   1395 	CERT_LDAP_STORE_OPENED_FLAG                                                    = 0x40000
   1396 	CERT_LDAP_STORE_SIGN_FLAG                                                      = 0x10000
   1397 	CERT_LDAP_STORE_UNBIND_FLAG                                                    = 0x80000
   1398 	CERT_LOGOTYPE_BITS_IMAGE_RESOLUTION_CHOICE                                     = 1
   1399 	CERT_LOGOTYPE_COLOR_IMAGE_INFO_CHOICE                                          = 2
   1400 	CERT_LOGOTYPE_DIRECT_INFO_CHOICE                                               = 1
   1401 	CERT_LOGOTYPE_GRAY_SCALE_IMAGE_INFO_CHOICE                                     = 1
   1402 	CERT_LOGOTYPE_INDIRECT_INFO_CHOICE                                             = 2
   1403 	CERT_LOGOTYPE_NO_IMAGE_RESOLUTION_CHOICE                                       = 0
   1404 	CERT_LOGOTYPE_TABLE_SIZE_IMAGE_RESOLUTION_CHOICE                               = 2
   1405 	CERT_MAX_ASN_ENCODED_DSS_SIGNATURE_LEN                                         = 48
   1406 	CERT_MD5_HASH_PROP_ID                                                          = 4
   1407 	CERT_NAME_ATTR_TYPE                                                            = 3
   1408 	CERT_NAME_DISABLE_IE4_UTF8_FLAG                                                = 0x10000
   1409 	CERT_NAME_DNS_TYPE                                                             = 6
   1410 	CERT_NAME_EMAIL_TYPE                                                           = 1
   1411 	CERT_NAME_FRIENDLY_DISPLAY_TYPE                                                = 5
   1412 	CERT_NAME_ISSUER_FLAG                                                          = 0x1
   1413 	CERT_NAME_RDN_TYPE                                                             = 2
   1414 	CERT_NAME_SEARCH_ALL_NAMES_FLAG                                                = 0x2
   1415 	CERT_NAME_SIMPLE_DISPLAY_TYPE                                                  = 4
   1416 	CERT_NAME_STR_COMMA_FLAG                                                       = 0x4000000
   1417 	CERT_NAME_STR_CRLF_FLAG                                                        = 0x8000000
   1418 	CERT_NAME_STR_DISABLE_IE4_UTF8_FLAG                                            = 0x10000
   1419 	CERT_NAME_STR_DISABLE_UTF8_DIR_STR_FLAG                                        = 0x100000
   1420 	CERT_NAME_STR_ENABLE_PUNYCODE_FLAG                                             = 0x200000
   1421 	CERT_NAME_STR_ENABLE_T61_UNICODE_FLAG                                          = 0x20000
   1422 	CERT_NAME_STR_ENABLE_UTF8_UNICODE_FLAG                                         = 0x40000
   1423 	CERT_NAME_STR_FORCE_UTF8_DIR_STR_FLAG                                          = 0x80000
   1424 	CERT_NAME_STR_FORWARD_FLAG                                                     = 0x1000000
   1425 	CERT_NAME_STR_NO_PLUS_FLAG                                                     = 0x20000000
   1426 	CERT_NAME_STR_NO_QUOTING_FLAG                                                  = 0x10000000
   1427 	CERT_NAME_STR_REVERSE_FLAG                                                     = 0x2000000
   1428 	CERT_NAME_STR_SEMICOLON_FLAG                                                   = 0x40000000
   1429 	CERT_NAME_UPN_TYPE                                                             = 8
   1430 	CERT_NAME_URL_TYPE                                                             = 7
   1431 	CERT_NCRYPT_KEY_HANDLE_PROP_ID                                                 = 78
   1432 	CERT_NCRYPT_KEY_HANDLE_TRANSFER_PROP_ID                                        = 99
   1433 	CERT_NCRYPT_KEY_SPEC                                                           = 0xffffffff
   1434 	CERT_NEW_KEY_PROP_ID                                                           = 74
   1435 	CERT_NEXT_UPDATE_LOCATION_PROP_ID                                              = 10
   1436 	CERT_NONCOMPLIANT_ROOT_URL_PROP_ID                                             = 123
   1437 	CERT_NON_REPUDIATION_KEY_USAGE                                                 = 0x40
   1438 	CERT_NOT_BEFORE_ENHKEY_USAGE_PROP_ID                                           = 127
   1439 	CERT_NOT_BEFORE_FILETIME_PROP_ID                                               = 126
   1440 	CERT_NO_AUTO_EXPIRE_CHECK_PROP_ID                                              = 77
   1441 	CERT_NO_EXPIRE_NOTIFICATION_PROP_ID                                            = 97
   1442 	CERT_OCSP_CACHE_PREFIX_PROP_ID                                                 = 75
   1443 	CERT_OCSP_MUST_STAPLE_PROP_ID                                                  = 121
   1444 	CERT_OCSP_RESPONSE_PROP_ID                                                     = 70
   1445 	CERT_OFFLINE_CRL_SIGN_KEY_USAGE                                                = 0x02
   1446 	CERT_OID_NAME_STR                                                              = 2
   1447 	CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG                                            = 0x1
   1448 	CERT_PHYSICAL_STORE_INSERT_COMPUTER_NAME_ENABLE_FLAG                           = 0x8
   1449 	CERT_PHYSICAL_STORE_OPEN_DISABLE_FLAG                                          = 0x2
   1450 	CERT_PHYSICAL_STORE_PREDEFINED_ENUM_FLAG                                       = 0x1
   1451 	CERT_PHYSICAL_STORE_REMOTE_OPEN_DISABLE_FLAG                                   = 0x4
   1452 	CERT_PIN_RULES_CTL_FILENAME_A                                                  = "pinrules.stl"
   1453 	CERT_PIN_SHA256_HASH_PROP_ID                                                   = 124
   1454 	CERT_PROT_ROOT_DISABLE_CURRENT_USER_FLAG                                       = 0x1
   1455 	CERT_PROT_ROOT_DISABLE_LM_AUTH_FLAG                                            = 0x8
   1456 	CERT_PROT_ROOT_DISABLE_NOT_DEFINED_NAME_CONSTRAINT_FLAG                        = 0x20
   1457 	CERT_PROT_ROOT_DISABLE_NT_AUTH_REQUIRED_FLAG                                   = 0x10
   1458 	CERT_PROT_ROOT_DISABLE_PEER_TRUST                                              = 0x10000
   1459 	CERT_PROT_ROOT_INHIBIT_ADD_AT_INIT_FLAG                                        = 0x2
   1460 	CERT_PROT_ROOT_INHIBIT_PURGE_LM_FLAG                                           = 0x4
   1461 	CERT_PROT_ROOT_ONLY_LM_GPT_FLAG                                                = 0x8
   1462 	CERT_PROT_ROOT_PEER_USAGES_VALUE_NAME_A                                        = "PeerUsages"
   1463 	CERT_PUBKEY_ALG_PARA_PROP_ID                                                   = 22
   1464 	CERT_PUBKEY_HASH_RESERVED_PROP_ID                                              = 8
   1465 	CERT_PUB_KEY_CNG_ALG_BIT_LENGTH_PROP_ID                                        = 93
   1466 	CERT_PVK_FILE_PROP_ID                                                          = 12
   1467 	CERT_QUERY_CONTENT_CERT                                                        = 1
   1468 	CERT_QUERY_CONTENT_CERT_PAIR                                                   = 13
   1469 	CERT_QUERY_CONTENT_CRL                                                         = 3
   1470 	CERT_QUERY_CONTENT_CTL                                                         = 2
   1471 	CERT_QUERY_CONTENT_FLAG_ALL                                                    = 16382
   1472 	CERT_QUERY_CONTENT_FLAG_ALL_ISSUER_CERT                                        = 818
   1473 	CERT_QUERY_CONTENT_FLAG_CERT                                                   = 2
   1474 	CERT_QUERY_CONTENT_FLAG_CERT_PAIR                                              = 8192
   1475 	CERT_QUERY_CONTENT_FLAG_CRL                                                    = 8
   1476 	CERT_QUERY_CONTENT_FLAG_CTL                                                    = 4
   1477 	CERT_QUERY_CONTENT_FLAG_PFX                                                    = 4096
   1478 	CERT_QUERY_CONTENT_FLAG_PFX_AND_LOAD                                           = 16384
   1479 	CERT_QUERY_CONTENT_FLAG_PKCS10                                                 = 2048
   1480 	CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED                                           = 256
   1481 	CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED                                     = 1024
   1482 	CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED                                         = 512
   1483 	CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT                                        = 32
   1484 	CERT_QUERY_CONTENT_FLAG_SERIALIZED_CRL                                         = 128
   1485 	CERT_QUERY_CONTENT_FLAG_SERIALIZED_CTL                                         = 64
   1486 	CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE                                       = 16
   1487 	CERT_QUERY_CONTENT_PFX                                                         = 12
   1488 	CERT_QUERY_CONTENT_PFX_AND_LOAD                                                = 14
   1489 	CERT_QUERY_CONTENT_PKCS10                                                      = 11
   1490 	CERT_QUERY_CONTENT_PKCS7_SIGNED                                                = 8
   1491 	CERT_QUERY_CONTENT_PKCS7_SIGNED_EMBED                                          = 10
   1492 	CERT_QUERY_CONTENT_PKCS7_UNSIGNED                                              = 9
   1493 	CERT_QUERY_CONTENT_SERIALIZED_CERT                                             = 5
   1494 	CERT_QUERY_CONTENT_SERIALIZED_CRL                                              = 7
   1495 	CERT_QUERY_CONTENT_SERIALIZED_CTL                                              = 6
   1496 	CERT_QUERY_CONTENT_SERIALIZED_STORE                                            = 4
   1497 	CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED                                        = 3
   1498 	CERT_QUERY_FORMAT_BASE64_ENCODED                                               = 2
   1499 	CERT_QUERY_FORMAT_BINARY                                                       = 1
   1500 	CERT_QUERY_FORMAT_FLAG_ALL                                                     = 14
   1501 	CERT_QUERY_FORMAT_FLAG_ASN_ASCII_HEX_ENCODED                                   = 8
   1502 	CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED                                          = 4
   1503 	CERT_QUERY_FORMAT_FLAG_BINARY                                                  = 2
   1504 	CERT_QUERY_OBJECT_BLOB                                                         = 0x2
   1505 	CERT_QUERY_OBJECT_FILE                                                         = 0x1
   1506 	CERT_RDN_ANY_TYPE                                                              = 0
   1507 	CERT_RDN_BMP_STRING                                                            = 12
   1508 	CERT_RDN_DISABLE_CHECK_TYPE_FLAG                                               = 0x40000000
   1509 	CERT_RDN_DISABLE_IE4_UTF8_FLAG                                                 = 0x1000000
   1510 	CERT_RDN_ENABLE_PUNYCODE_FLAG                                                  = 0x2000000
   1511 	CERT_RDN_ENABLE_T61_UNICODE_FLAG                                               = 0x80000000
   1512 	CERT_RDN_ENABLE_UTF8_UNICODE_FLAG                                              = 0x20000000
   1513 	CERT_RDN_ENCODED_BLOB                                                          = 1
   1514 	CERT_RDN_FLAGS_MASK                                                            = 0xff000000
   1515 	CERT_RDN_FORCE_UTF8_UNICODE_FLAG                                               = 0x10000000
   1516 	CERT_RDN_GENERAL_STRING                                                        = 10
   1517 	CERT_RDN_GRAPHIC_STRING                                                        = 8
   1518 	CERT_RDN_IA5_STRING                                                            = 7
   1519 	CERT_RDN_INT4_STRING                                                           = 11
   1520 	CERT_RDN_ISO646_STRING                                                         = 9
   1521 	CERT_RDN_NUMERIC_STRING                                                        = 3
   1522 	CERT_RDN_OCTET_STRING                                                          = 2
   1523 	CERT_RDN_PRINTABLE_STRING                                                      = 4
   1524 	CERT_RDN_T61_STRING                                                            = 5
   1525 	CERT_RDN_TELETEX_STRING                                                        = 5
   1526 	CERT_RDN_TYPE_MASK                                                             = 0x000000ff
   1527 	CERT_RDN_UNICODE_STRING                                                        = 12
   1528 	CERT_RDN_UNIVERSAL_STRING                                                      = 11
   1529 	CERT_RDN_UTF8_STRING                                                           = 13
   1530 	CERT_RDN_VIDEOTEX_STRING                                                       = 6
   1531 	CERT_RDN_VISIBLE_STRING                                                        = 9
   1532 	CERT_REGISTRY_STORE_CLIENT_GPT_FLAG                                            = 0x80000000
   1533 	CERT_REGISTRY_STORE_EXTERNAL_FLAG                                              = 0x100000
   1534 	CERT_REGISTRY_STORE_LM_GPT_FLAG                                                = 0x1000000
   1535 	CERT_REGISTRY_STORE_MY_IE_DIRTY_FLAG                                           = 0x80000
   1536 	CERT_REGISTRY_STORE_REMOTE_FLAG                                                = 0x10000
   1537 	CERT_REGISTRY_STORE_ROAMING_FLAG                                               = 0x40000
   1538 	CERT_REGISTRY_STORE_SERIALIZED_FLAG                                            = 0x20000
   1539 	CERT_RENEWAL_PROP_ID                                                           = 64
   1540 	CERT_REQUEST_ORIGINATOR_PROP_ID                                                = 71
   1541 	CERT_REQUEST_V1                                                                = 0
   1542 	CERT_ROOT_PROGRAM_CERT_POLICIES_PROP_ID                                        = 83
   1543 	CERT_ROOT_PROGRAM_CHAIN_POLICIES_PROP_ID                                       = 105
   1544 	CERT_ROOT_PROGRAM_FLAG_ADDRESS                                                 = 0x08
   1545 	CERT_ROOT_PROGRAM_FLAG_LSC                                                     = 0x40
   1546 	CERT_ROOT_PROGRAM_FLAG_ORG                                                     = 0x80
   1547 	CERT_ROOT_PROGRAM_FLAG_OU                                                      = 0x10
   1548 	CERT_ROOT_PROGRAM_FLAG_SUBJECT_LOGO                                            = 0x20
   1549 	CERT_ROOT_PROGRAM_NAME_CONSTRAINTS_PROP_ID                                     = 84
   1550 	CERT_SCARD_PIN_ID_PROP_ID                                                      = 90
   1551 	CERT_SCARD_PIN_INFO_PROP_ID                                                    = 91
   1552 	CERT_SCEP_CA_CERT_PROP_ID                                                      = 111
   1553 	CERT_SCEP_ENCRYPT_HASH_CNG_ALG_PROP_ID                                         = 114
   1554 	CERT_SCEP_FLAGS_PROP_ID                                                        = 115
   1555 	CERT_SCEP_GUID_PROP_ID                                                         = 116
   1556 	CERT_SCEP_NONCE_PROP_ID                                                        = 113
   1557 	CERT_SCEP_RA_ENCRYPTION_CERT_PROP_ID                                           = 110
   1558 	CERT_SCEP_RA_SIGNATURE_CERT_PROP_ID                                            = 109
   1559 	CERT_SCEP_SERVER_CERTS_PROP_ID                                                 = 108
   1560 	CERT_SCEP_SIGNER_CERT_PROP_ID                                                  = 112
   1561 	CERT_SEND_AS_TRUSTED_ISSUER_PROP_ID                                            = 102
   1562 	CERT_SERIALIZABLE_KEY_CONTEXT_PROP_ID                                          = 117
   1563 	CERT_SERIAL_CHAIN_PROP_ID                                                      = 119
   1564 	CERT_SET_KEY_CONTEXT_PROP_ID                                                   = 0x1
   1565 	CERT_SET_KEY_PROV_HANDLE_PROP_ID                                               = 0x1
   1566 	CERT_SET_PROPERTY_IGNORE_PERSIST_ERROR_FLAG                                    = 0x80000000
   1567 	CERT_SET_PROPERTY_INHIBIT_PERSIST_FLAG                                         = 0x40000000
   1568 	CERT_SHA1_HASH_PROP_ID                                                         = 3
   1569 	CERT_SHA256_HASH_PROP_ID                                                       = 107
   1570 	CERT_SIGNATURE_HASH_PROP_ID                                                    = 15
   1571 	CERT_SIGN_HASH_CNG_ALG_PROP_ID                                                 = 89
   1572 	CERT_SIMPLE_NAME_STR                                                           = 1
   1573 	CERT_SMART_CARD_DATA_PROP_ID                                                   = 16
   1574 	CERT_SMART_CARD_READER_NON_REMOVABLE_PROP_ID                                   = 106
   1575 	CERT_SMART_CARD_READER_PROP_ID                                                 = 101
   1576 	CERT_SMART_CARD_ROOT_INFO_PROP_ID                                              = 76
   1577 	CERT_SOURCE_LOCATION_PROP_ID                                                   = 72
   1578 	CERT_SOURCE_URL_PROP_ID                                                        = 73
   1579 	CERT_SRV_OCSP_RESP_MAX_BEFORE_NEXT_UPDATE_SECONDS_DEFAULT                      = 14400
   1580 	CERT_SRV_OCSP_RESP_MAX_SYNC_CERT_FILE_SECONDS_DEFAULT                          = 3600
   1581 	CERT_SRV_OCSP_RESP_MIN_AFTER_NEXT_UPDATE_SECONDS_DEFAULT                       = 60
   1582 	CERT_SRV_OCSP_RESP_MIN_BEFORE_NEXT_UPDATE_SECONDS_DEFAULT                      = 120
   1583 	CERT_SRV_OCSP_RESP_MIN_SYNC_CERT_FILE_SECONDS_DEFAULT                          = 5
   1584 	CERT_SRV_OCSP_RESP_MIN_VALIDITY_SECONDS_DEFAULT                                = 600
   1585 	CERT_SRV_OCSP_RESP_URL_RETRIEVAL_TIMEOUT_MILLISECONDS_DEFAULT                  = 15000
   1586 	CERT_STORE_ADD_ALWAYS                                                          = 4
   1587 	CERT_STORE_ADD_NEW                                                             = 1
   1588 	CERT_STORE_ADD_NEWER                                                           = 6
   1589 	CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES                                        = 7
   1590 	CERT_STORE_ADD_REPLACE_EXISTING                                                = 3
   1591 	CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES                             = 5
   1592 	CERT_STORE_ADD_USE_EXISTING                                                    = 2
   1593 	CERT_STORE_ALL_CONTEXT_FLAG                                                    = 18446744073709551615
   1594 	CERT_STORE_BACKUP_RESTORE_FLAG                                                 = 0x800
   1595 	CERT_STORE_BASE_CRL_FLAG                                                       = 0x100
   1596 	CERT_STORE_CERTIFICATE_CONTEXT                                                 = 1
   1597 	CERT_STORE_CERTIFICATE_CONTEXT_FLAG                                            = 2
   1598 	CERT_STORE_CREATE_NEW_FLAG                                                     = 0x2000
   1599 	CERT_STORE_CRL_CONTEXT                                                         = 2
   1600 	CERT_STORE_CRL_CONTEXT_FLAG                                                    = 4
   1601 	CERT_STORE_CTL_CONTEXT                                                         = 3
   1602 	CERT_STORE_CTL_CONTEXT_FLAG                                                    = 8
   1603 	CERT_STORE_CTRL_AUTO_RESYNC                                                    = 4
   1604 	CERT_STORE_CTRL_CANCEL_NOTIFY                                                  = 5
   1605 	CERT_STORE_CTRL_COMMIT                                                         = 3
   1606 	CERT_STORE_CTRL_COMMIT_CLEAR_FLAG                                              = 0x2
   1607 	CERT_STORE_CTRL_COMMIT_FORCE_FLAG                                              = 0x1
   1608 	CERT_STORE_CTRL_INHIBIT_DUPLICATE_HANDLE_FLAG                                  = 0x1
   1609 	CERT_STORE_CTRL_NOTIFY_CHANGE                                                  = 2
   1610 	CERT_STORE_CTRL_RESYNC                                                         = 1
   1611 	CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG                                    = 0x4
   1612 	CERT_STORE_DELETE_FLAG                                                         = 0x10
   1613 	CERT_STORE_DELTA_CRL_FLAG                                                      = 0x200
   1614 	CERT_STORE_ENUM_ARCHIVED_FLAG                                                  = 0x200
   1615 	CERT_STORE_LOCALIZED_NAME_PROP_ID                                              = 0x1000
   1616 	CERT_STORE_MANIFOLD_FLAG                                                       = 0x100
   1617 	CERT_STORE_MAXIMUM_ALLOWED_FLAG                                                = 0x1000
   1618 	CERT_STORE_NO_CRL_FLAG                                                         = 0x10000
   1619 	CERT_STORE_NO_CRYPT_RELEASE_FLAG                                               = 0x1
   1620 	CERT_STORE_NO_ISSUER_FLAG                                                      = 0x20000
   1621 	CERT_STORE_OPEN_EXISTING_FLAG                                                  = 0x4000
   1622 	CERT_STORE_PROV_CLOSE_FUNC                                                     = 0
   1623 	CERT_STORE_PROV_CONTROL_FUNC                                                   = 13
   1624 	CERT_STORE_PROV_DELETED_FLAG                                                   = 0x2
   1625 	CERT_STORE_PROV_DELETE_CERT_FUNC                                               = 3
   1626 	CERT_STORE_PROV_DELETE_CRL_FUNC                                                = 7
   1627 	CERT_STORE_PROV_DELETE_CTL_FUNC                                                = 11
   1628 	CERT_STORE_PROV_EXTERNAL_FLAG                                                  = 0x1
   1629 	CERT_STORE_PROV_FIND_CERT_FUNC                                                 = 14
   1630 	CERT_STORE_PROV_FIND_CRL_FUNC                                                  = 17
   1631 	CERT_STORE_PROV_FIND_CTL_FUNC                                                  = 20
   1632 	CERT_STORE_PROV_FREE_FIND_CERT_FUNC                                            = 15
   1633 	CERT_STORE_PROV_FREE_FIND_CRL_FUNC                                             = 18
   1634 	CERT_STORE_PROV_FREE_FIND_CTL_FUNC                                             = 21
   1635 	CERT_STORE_PROV_GET_CERT_PROPERTY_FUNC                                         = 16
   1636 	CERT_STORE_PROV_GET_CRL_PROPERTY_FUNC                                          = 19
   1637 	CERT_STORE_PROV_GET_CTL_PROPERTY_FUNC                                          = 22
   1638 	CERT_STORE_PROV_GP_SYSTEM_STORE_FLAG                                           = 0x20
   1639 	CERT_STORE_PROV_LM_SYSTEM_STORE_FLAG                                           = 0x10
   1640 	CERT_STORE_PROV_NO_PERSIST_FLAG                                                = 0x4
   1641 	CERT_STORE_PROV_READ_CERT_FUNC                                                 = 1
   1642 	CERT_STORE_PROV_READ_CRL_FUNC                                                  = 5
   1643 	CERT_STORE_PROV_READ_CTL_FUNC                                                  = 9
   1644 	CERT_STORE_PROV_SET_CERT_PROPERTY_FUNC                                         = 4
   1645 	CERT_STORE_PROV_SET_CRL_PROPERTY_FUNC                                          = 8
   1646 	CERT_STORE_PROV_SET_CTL_PROPERTY_FUNC                                          = 12
   1647 	CERT_STORE_PROV_SHARED_USER_FLAG                                               = 0x40
   1648 	CERT_STORE_PROV_SYSTEM_STORE_FLAG                                              = 0x8
   1649 	CERT_STORE_PROV_WRITE_ADD_FLAG                                                 = 0x1
   1650 	CERT_STORE_PROV_WRITE_CERT_FUNC                                                = 2
   1651 	CERT_STORE_PROV_WRITE_CRL_FUNC                                                 = 6
   1652 	CERT_STORE_PROV_WRITE_CTL_FUNC                                                 = 10
   1653 	CERT_STORE_READONLY_FLAG                                                       = 0x8000
   1654 	CERT_STORE_REVOCATION_FLAG                                                     = 0x4
   1655 	CERT_STORE_SAVE_AS_PKCS12                                                      = 3
   1656 	CERT_STORE_SAVE_AS_PKCS7                                                       = 2
   1657 	CERT_STORE_SAVE_AS_STORE                                                       = 1
   1658 	CERT_STORE_SAVE_TO_FILE                                                        = 1
   1659 	CERT_STORE_SAVE_TO_FILENAME                                                    = 4
   1660 	CERT_STORE_SAVE_TO_FILENAME_A                                                  = 3
   1661 	CERT_STORE_SAVE_TO_FILENAME_W                                                  = 4
   1662 	CERT_STORE_SAVE_TO_MEMORY                                                      = 2
   1663 	CERT_STORE_SET_LOCALIZED_NAME_FLAG                                             = 0x2
   1664 	CERT_STORE_SHARE_CONTEXT_FLAG                                                  = 0x80
   1665 	CERT_STORE_SHARE_STORE_FLAG                                                    = 0x40
   1666 	CERT_STORE_SIGNATURE_FLAG                                                      = 0x1
   1667 	CERT_STORE_TIME_VALIDITY_FLAG                                                  = 0x2
   1668 	CERT_STORE_UNSAFE_PHYSICAL_FLAG                                                = 0x20
   1669 	CERT_STORE_UPDATE_KEYID_FLAG                                                   = 0x400
   1670 	CERT_STRONG_SIGN_ENABLE_CRL_CHECK                                              = 0x1
   1671 	CERT_STRONG_SIGN_ENABLE_OCSP_CHECK                                             = 0x2
   1672 	CERT_STRONG_SIGN_OID_INFO_CHOICE                                               = 2
   1673 	CERT_STRONG_SIGN_SERIALIZED_INFO_CHOICE                                        = 1
   1674 	CERT_SUBJECT_DISABLE_CRL_PROP_ID                                               = 86
   1675 	CERT_SUBJECT_INFO_ACCESS_PROP_ID                                               = 80
   1676 	CERT_SUBJECT_NAME_MD5_HASH_PROP_ID                                             = 29
   1677 	CERT_SUBJECT_OCSP_AUTHORITY_INFO_ACCESS_PROP_ID                                = 85
   1678 	CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID                                       = 25
   1679 	CERT_SUBJECT_PUB_KEY_BIT_LENGTH_PROP_ID                                        = 92
   1680 	CERT_SYSTEM_STORE_CURRENT_SERVICE                                              = 262144
   1681 	CERT_SYSTEM_STORE_CURRENT_SERVICE_ID                                           = 4
   1682 	CERT_SYSTEM_STORE_CURRENT_USER                                                 = 65536
   1683 	CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY                                    = 458752
   1684 	CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID                                 = 7
   1685 	CERT_SYSTEM_STORE_CURRENT_USER_ID                                              = 1
   1686 	CERT_SYSTEM_STORE_DEFER_READ_FLAG                                              = 0x20000000
   1687 	CERT_SYSTEM_STORE_LOCAL_MACHINE                                                = 131072
   1688 	CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE                                     = 589824
   1689 	CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID                                  = 9
   1690 	CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY                                   = 524288
   1691 	CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID                                = 8
   1692 	CERT_SYSTEM_STORE_LOCAL_MACHINE_ID                                             = 2
   1693 	CERT_SYSTEM_STORE_LOCAL_MACHINE_WCOS                                           = 655360
   1694 	CERT_SYSTEM_STORE_LOCAL_MACHINE_WCOS_ID                                        = 10
   1695 	CERT_SYSTEM_STORE_LOCATION_MASK                                                = 0x00ff0000
   1696 	CERT_SYSTEM_STORE_LOCATION_SHIFT                                               = 16
   1697 	CERT_SYSTEM_STORE_MASK                                                         = 0xffff0000
   1698 	CERT_SYSTEM_STORE_RELOCATE_FLAG                                                = 0x80000000
   1699 	CERT_SYSTEM_STORE_SERVICES                                                     = 327680
   1700 	CERT_SYSTEM_STORE_SERVICES_ID                                                  = 5
   1701 	CERT_SYSTEM_STORE_UNPROTECTED_FLAG                                             = 0x40000000
   1702 	CERT_SYSTEM_STORE_USERS                                                        = 393216
   1703 	CERT_SYSTEM_STORE_USERS_ID                                                     = 6
   1704 	CERT_TRUST_AUTO_UPDATE_CA_REVOCATION                                           = 0x10
   1705 	CERT_TRUST_AUTO_UPDATE_END_REVOCATION                                          = 0x20
   1706 	CERT_TRUST_CTL_IS_NOT_SIGNATURE_VALID                                          = 0x40000
   1707 	CERT_TRUST_CTL_IS_NOT_TIME_VALID                                               = 0x20000
   1708 	CERT_TRUST_CTL_IS_NOT_VALID_FOR_USAGE                                          = 0x80000
   1709 	CERT_TRUST_HAS_CRL_VALIDITY_EXTENDED                                           = 0x1000
   1710 	CERT_TRUST_HAS_EXACT_MATCH_ISSUER                                              = 0x1
   1711 	CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT                                        = 0x8000
   1712 	CERT_TRUST_HAS_ISSUANCE_CHAIN_POLICY                                           = 0x200
   1713 	CERT_TRUST_HAS_KEY_MATCH_ISSUER                                                = 0x2
   1714 	CERT_TRUST_HAS_NAME_MATCH_ISSUER                                               = 0x4
   1715 	CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT                                     = 0x2000
   1716 	CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT                                   = 0x4000
   1717 	CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT                                      = 0x8000000
   1718 	CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT                                   = 0x1000
   1719 	CERT_TRUST_HAS_PREFERRED_ISSUER                                                = 0x100
   1720 	CERT_TRUST_HAS_VALID_NAME_CONSTRAINTS                                          = 0x400
   1721 	CERT_TRUST_HAS_WEAK_SIGNATURE                                                  = 0x100000
   1722 	CERT_TRUST_INVALID_BASIC_CONSTRAINTS                                           = 0x400
   1723 	CERT_TRUST_INVALID_EXTENSION                                                   = 0x100
   1724 	CERT_TRUST_INVALID_NAME_CONSTRAINTS                                            = 0x800
   1725 	CERT_TRUST_INVALID_POLICY_CONSTRAINTS                                          = 0x200
   1726 	CERT_TRUST_IS_COMPLEX_CHAIN                                                    = 0x00010000
   1727 	CERT_TRUST_IS_CYCLIC                                                           = 0x80
   1728 	CERT_TRUST_IS_EXPLICIT_DISTRUST                                                = 0x4000000
   1729 	CERT_TRUST_IS_FROM_EXCLUSIVE_TRUST_STORE                                       = 0x2000
   1730 	CERT_TRUST_IS_KEY_ROLLOVER                                                     = 0x00000080
   1731 	CERT_TRUST_IS_NOT_SIGNATURE_VALID                                              = 0x8
   1732 	CERT_TRUST_IS_NOT_TIME_NESTED                                                  = 0x2
   1733 	CERT_TRUST_IS_NOT_TIME_VALID                                                   = 0x1
   1734 	CERT_TRUST_IS_NOT_VALID_FOR_USAGE                                              = 0x10
   1735 	CERT_TRUST_IS_OFFLINE_REVOCATION                                               = 0x1000000
   1736 	CERT_TRUST_IS_PARTIAL_CHAIN                                                    = 0x10000
   1737 	CERT_TRUST_IS_PEER_TRUSTED                                                     = 0x800
   1738 	CERT_TRUST_IS_REVOKED                                                          = 0x4
   1739 	CERT_TRUST_IS_SELF_SIGNED                                                      = 0x8
   1740 	CERT_TRUST_IS_UNTRUSTED_ROOT                                                   = 0x20
   1741 	CERT_TRUST_NO_ERROR                                                            = 0x0
   1742 	CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY                                            = 0x2000000
   1743 	CERT_TRUST_NO_OCSP_FAILOVER_TO_CRL                                             = 0x40
   1744 	CERT_TRUST_NO_TIME_CHECK                                                       = 0x02000000
   1745 	CERT_TRUST_PUB_ALLOW_END_USER_TRUST                                            = 0x0
   1746 	CERT_TRUST_PUB_ALLOW_ENTERPRISE_ADMIN_TRUST                                    = 0x2
   1747 	CERT_TRUST_PUB_ALLOW_MACHINE_ADMIN_TRUST                                       = 0x1
   1748 	CERT_TRUST_PUB_ALLOW_TRUST_MASK                                                = 0x3
   1749 	CERT_TRUST_PUB_CHECK_PUBLISHER_REV_FLAG                                        = 0x100
   1750 	CERT_TRUST_PUB_CHECK_TIMESTAMP_REV_FLAG                                        = 0x200
   1751 	CERT_TRUST_REVOCATION_STATUS_UNKNOWN                                           = 0x40
   1752 	CERT_TRUST_SSL_HANDSHAKE_OCSP                                                  = 0x00040000
   1753 	CERT_TRUST_SSL_RECONNECT_OCSP                                                  = 0x00100000
   1754 	CERT_TRUST_SSL_TIME_VALID                                                      = 0x01000000
   1755 	CERT_TRUST_SSL_TIME_VALID_OCSP                                                 = 0x00080000
   1756 	CERT_UNICODE_ATTR_ERR_INDEX_MASK                                               = 0x3f
   1757 	CERT_UNICODE_ATTR_ERR_INDEX_SHIFT                                              = 16
   1758 	CERT_UNICODE_IS_RDN_ATTRS_FLAG                                                 = 0x1
   1759 	CERT_UNICODE_RDN_ERR_INDEX_MASK                                                = 0x3ff
   1760 	CERT_UNICODE_RDN_ERR_INDEX_SHIFT                                               = 22
   1761 	CERT_UNICODE_VALUE_ERR_INDEX_MASK                                              = 0xffff
   1762 	CERT_UNICODE_VALUE_ERR_INDEX_SHIFT                                             = 0
   1763 	CERT_V1                                                                        = 0
   1764 	CERT_V2                                                                        = 1
   1765 	CERT_V3                                                                        = 2
   1766 	CERT_VERIFY_ALLOW_MORE_USAGE_FLAG                                              = 0x8
   1767 	CERT_VERIFY_CACHE_ONLY_BASED_REVOCATION                                        = 0x2
   1768 	CERT_VERIFY_INHIBIT_CTL_UPDATE_FLAG                                            = 0x1
   1769 	CERT_VERIFY_NO_TIME_CHECK_FLAG                                                 = 0x4
   1770 	CERT_VERIFY_REV_ACCUMULATIVE_TIMEOUT_FLAG                                      = 0x4
   1771 	CERT_VERIFY_REV_CHAIN_FLAG                                                     = 0x1
   1772 	CERT_VERIFY_REV_NO_OCSP_FAILOVER_TO_CRL_FLAG                                   = 0x10
   1773 	CERT_VERIFY_REV_SERVER_OCSP_FLAG                                               = 0x8
   1774 	CERT_VERIFY_TRUSTED_SIGNERS_FLAG                                               = 0x2
   1775 	CERT_VERIFY_UPDATED_CTL_FLAG                                                   = 0x1
   1776 	CERT_X500_NAME_STR                                                             = 3
   1777 	CERT_XML_NAME_STR                                                              = 4
   1778 	CE_BREAK                                                                       = 0x10
   1779 	CE_DNS                                                                         = 0x800
   1780 	CE_FRAME                                                                       = 0x8
   1781 	CE_IOE                                                                         = 0x400
   1782 	CE_MODE                                                                        = 0x8000
   1783 	CE_OOP                                                                         = 0x1000
   1784 	CE_OVERRUN                                                                     = 0x2
   1785 	CE_PTO                                                                         = 0x200
   1786 	CE_RXOVER                                                                      = 0x1
   1787 	CE_RXPARITY                                                                    = 0x4
   1788 	CE_TXFULL                                                                      = 0x100
   1789 	CFERR_CHOOSEFONTCODES                                                          = 0x2000
   1790 	CFERR_MAXLESSTHANMIN                                                           = 0x2002
   1791 	CFERR_NOFONTS                                                                  = 0x2001
   1792 	CFG_CALL_TARGET_CONVERT_EXPORT_SUPPRESSED_TO_VALID                             = 0x04
   1793 	CFG_CALL_TARGET_PROCESSED                                                      = 0x02
   1794 	CFG_CALL_TARGET_VALID                                                          = 0x01
   1795 	CFSEPCHAR                                                                      = 43
   1796 	CFS_CANDIDATEPOS                                                               = 0x0040
   1797 	CFS_DEFAULT                                                                    = 0x0000
   1798 	CFS_EXCLUDE                                                                    = 0x0080
   1799 	CFS_FORCE_POSITION                                                             = 0x0020
   1800 	CFS_POINT                                                                      = 0x0002
   1801 	CFS_RECT                                                                       = 0x0001
   1802 	CF_ANSIONLY                                                                    = 1024
   1803 	CF_APPLY                                                                       = 512
   1804 	CF_BITMAP                                                                      = 2
   1805 	CF_BOTH                                                                        = 3
   1806 	CF_DIB                                                                         = 8
   1807 	CF_DIBV5                                                                       = 17
   1808 	CF_DIF                                                                         = 5
   1809 	CF_DSPBITMAP                                                                   = 0x0082
   1810 	CF_DSPENHMETAFILE                                                              = 0x008E
   1811 	CF_DSPMETAFILEPICT                                                             = 0x0083
   1812 	CF_DSPTEXT                                                                     = 0x0081
   1813 	CF_EFFECTS                                                                     = 256
   1814 	CF_ENABLEHOOK                                                                  = 8
   1815 	CF_ENABLETEMPLATE                                                              = 16
   1816 	CF_ENABLETEMPLATEHANDLE                                                        = 32
   1817 	CF_ENHMETAFILE                                                                 = 14
   1818 	CF_FIXEDPITCHONLY                                                              = 16384
   1819 	CF_FORCEFONTEXIST                                                              = 65536
   1820 	CF_GDIOBJFIRST                                                                 = 0x0300
   1821 	CF_GDIOBJLAST                                                                  = 0x03FF
   1822 	CF_HDROP                                                                       = 15
   1823 	CF_INITTOLOGFONTSTRUCT                                                         = 64
   1824 	CF_LIMITSIZE                                                                   = 8192
   1825 	CF_LOCALE                                                                      = 16
   1826 	CF_MAX                                                                         = 18
   1827 	CF_METAFILEPICT                                                                = 3
   1828 	CF_NOFACESEL                                                                   = 524288
   1829 	CF_NOOEMFONTS                                                                  = 2048
   1830 	CF_NOSCRIPTSEL                                                                 = 8388608
   1831 	CF_NOSIMULATIONS                                                               = 4096
   1832 	CF_NOSIZESEL                                                                   = 2097152
   1833 	CF_NOSTYLESEL                                                                  = 1048576
   1834 	CF_NOVECTORFONTS                                                               = 2048
   1835 	CF_NOVERTFONTS                                                                 = 16777216
   1836 	CF_NULL                                                                        = 0
   1837 	CF_OEMTEXT                                                                     = 7
   1838 	CF_OWNERDISPLAY                                                                = 0x0080
   1839 	CF_PALETTE                                                                     = 9
   1840 	CF_PENDATA                                                                     = 10
   1841 	CF_PRINTERFONTS                                                                = 0x2
   1842 	CF_PRIVATEFIRST                                                                = 0x0200
   1843 	CF_PRIVATELAST                                                                 = 0x02FF
   1844 	CF_RIFF                                                                        = 11
   1845 	CF_SCALABLEONLY                                                                = 131072
   1846 	CF_SCREENFONTS                                                                 = 0x1
   1847 	CF_SCRIPTSONLY                                                                 = 1024
   1848 	CF_SELECTSCRIPT                                                                = 4194304
   1849 	CF_SHOWHELP                                                                    = 4
   1850 	CF_SYLK                                                                        = 4
   1851 	CF_TEXT                                                                        = 1
   1852 	CF_TIFF                                                                        = 6
   1853 	CF_TTONLY                                                                      = 262144
   1854 	CF_UNICODETEXT                                                                 = 13
   1855 	CF_USESTYLE                                                                    = 128
   1856 	CF_WAVE                                                                        = 12
   1857 	CF_WYSIWYG                                                                     = 32768
   1858 	CHANGER_BAR_CODE_SCANNER_INSTALLED                                             = 0x00000001
   1859 	CHANGER_CARTRIDGE_MAGAZINE                                                     = 0x00000100
   1860 	CHANGER_CLEANER_ACCESS_NOT_VALID                                               = 0x00040000
   1861 	CHANGER_CLEANER_AUTODISMOUNT                                                   = 0x80000004
   1862 	CHANGER_CLEANER_OPS_NOT_SUPPORTED                                              = 0x80000040
   1863 	CHANGER_CLEANER_SLOT                                                           = 0x00000040
   1864 	CHANGER_CLOSE_IEPORT                                                           = 0x00000004
   1865 	CHANGER_DEVICE_REINITIALIZE_CAPABLE                                            = 0x08000000
   1866 	CHANGER_DRIVE_CLEANING_REQUIRED                                                = 0x00010000
   1867 	CHANGER_DRIVE_EMPTY_ON_DOOR_ACCESS                                             = 0x20000000
   1868 	CHANGER_EXCHANGE_MEDIA                                                         = 0x00000020
   1869 	CHANGER_IEPORT_USER_CONTROL_CLOSE                                              = 0x80000100
   1870 	CHANGER_IEPORT_USER_CONTROL_OPEN                                               = 0x80000080
   1871 	CHANGER_INIT_ELEM_STAT_WITH_RANGE                                              = 0x00000002
   1872 	CHANGER_KEYPAD_ENABLE_DISABLE                                                  = 0x10000000
   1873 	CHANGER_LOCK_UNLOCK                                                            = 0x00000080
   1874 	CHANGER_MEDIUM_FLIP                                                            = 0x00000200
   1875 	CHANGER_MOVE_EXTENDS_IEPORT                                                    = 0x80000200
   1876 	CHANGER_MOVE_RETRACTS_IEPORT                                                   = 0x80000400
   1877 	CHANGER_OPEN_IEPORT                                                            = 0x00000008
   1878 	CHANGER_POSITION_TO_ELEMENT                                                    = 0x00000400
   1879 	CHANGER_PREDISMOUNT_ALIGN_TO_DRIVE                                             = 0x80000002
   1880 	CHANGER_PREDISMOUNT_ALIGN_TO_SLOT                                              = 0x80000001
   1881 	CHANGER_PREDISMOUNT_EJECT_REQUIRED                                             = 0x00020000
   1882 	CHANGER_PREMOUNT_EJECT_REQUIRED                                                = 0x00080000
   1883 	CHANGER_REPORT_IEPORT_STATE                                                    = 0x00000800
   1884 	CHANGER_RESERVED_BIT                                                           = 0x80000000
   1885 	CHANGER_RTN_MEDIA_TO_ORIGINAL_ADDR                                             = 0x80000020
   1886 	CHANGER_SERIAL_NUMBER_VALID                                                    = 0x04000000
   1887 	CHANGER_SLOTS_USE_TRAYS                                                        = 0x80000010
   1888 	CHANGER_STATUS_NON_VOLATILE                                                    = 0x00000010
   1889 	CHANGER_STORAGE_DRIVE                                                          = 0x00001000
   1890 	CHANGER_STORAGE_IEPORT                                                         = 0x00002000
   1891 	CHANGER_STORAGE_SLOT                                                           = 0x00004000
   1892 	CHANGER_STORAGE_TRANSPORT                                                      = 0x00008000
   1893 	CHANGER_TO_DRIVE                                                               = 0x08
   1894 	CHANGER_TO_IEPORT                                                              = 0x04
   1895 	CHANGER_TO_SLOT                                                                = 0x02
   1896 	CHANGER_TO_TRANSPORT                                                           = 0x01
   1897 	CHANGER_TRUE_EXCHANGE_CAPABLE                                                  = 0x80000008
   1898 	CHANGER_VOLUME_ASSERT                                                          = 0x00400000
   1899 	CHANGER_VOLUME_IDENTIFICATION                                                  = 0x00100000
   1900 	CHANGER_VOLUME_REPLACE                                                         = 0x00800000
   1901 	CHANGER_VOLUME_SEARCH                                                          = 0x00200000
   1902 	CHANGER_VOLUME_UNDEFINE                                                        = 0x01000000
   1903 	CHAR_BIT                                                                       = 8
   1904 	CHAR_MAX                                                                       = 127
   1905 	CHAR_MIN                                                                       = -128
   1906 	CHECKJPEGFORMAT                                                                = 4119
   1907 	CHECKPNGFORMAT                                                                 = 4120
   1908 	CHILDID_SELF                                                                   = 0
   1909 	CHINESEBIG5_CHARSET                                                            = 136
   1910 	CKCNSTRNT_COLUMN                                                               = 0x01
   1911 	CKCNSTRNT_ROWID                                                                = 0x02
   1912 	CLAIM_SECURITY_ATTRIBUTES_INFORMATION_VERSION                                  = 1
   1913 	CLAIM_SECURITY_ATTRIBUTES_INFORMATION_VERSION_V1                               = 1
   1914 	CLAIM_SECURITY_ATTRIBUTE_CUSTOM_FLAGS                                          = 0xffff0000
   1915 	CLAIM_SECURITY_ATTRIBUTE_DISABLED                                              = 0x0010
   1916 	CLAIM_SECURITY_ATTRIBUTE_DISABLED_BY_DEFAULT                                   = 0x0008
   1917 	CLAIM_SECURITY_ATTRIBUTE_MANDATORY                                             = 0x0020
   1918 	CLAIM_SECURITY_ATTRIBUTE_NON_INHERITABLE                                       = 0x0001
   1919 	CLAIM_SECURITY_ATTRIBUTE_TYPE_BOOLEAN                                          = 0x06
   1920 	CLAIM_SECURITY_ATTRIBUTE_TYPE_FQBN                                             = 0x04
   1921 	CLAIM_SECURITY_ATTRIBUTE_TYPE_INT64                                            = 0x01
   1922 	CLAIM_SECURITY_ATTRIBUTE_TYPE_INVALID                                          = 0x00
   1923 	CLAIM_SECURITY_ATTRIBUTE_TYPE_OCTET_STRING                                     = 0x10
   1924 	CLAIM_SECURITY_ATTRIBUTE_TYPE_SID                                              = 0x05
   1925 	CLAIM_SECURITY_ATTRIBUTE_TYPE_STRING                                           = 0x03
   1926 	CLAIM_SECURITY_ATTRIBUTE_TYPE_UINT64                                           = 0x02
   1927 	CLAIM_SECURITY_ATTRIBUTE_USE_FOR_DENY_ONLY                                     = 0x0004
   1928 	CLAIM_SECURITY_ATTRIBUTE_VALID_FLAGS                                           = 63
   1929 	CLAIM_SECURITY_ATTRIBUTE_VALUE_CASE_SENSITIVE                                  = 0x0002
   1930 	CLASSFACTORY_E_FIRST                                                           = 2147746064
   1931 	CLASSFACTORY_E_LAST                                                            = 2147746079
   1932 	CLASSFACTORY_S_FIRST                                                           = 262416
   1933 	CLASSFACTORY_S_LAST                                                            = 262431
   1934 	CLEARTYPE_NATURAL_QUALITY                                                      = 6
   1935 	CLEARTYPE_QUALITY                                                              = 5
   1936 	CLIENTSITE_E_FIRST                                                             = 2147746192
   1937 	CLIENTSITE_E_LAST                                                              = 2147746207
   1938 	CLIENTSITE_S_FIRST                                                             = 262544
   1939 	CLIENTSITE_S_LAST                                                              = 262559
   1940 	CLIPBRD_E_FIRST                                                                = 2147746256
   1941 	CLIPBRD_E_LAST                                                                 = 2147746271
   1942 	CLIPBRD_S_FIRST                                                                = 262608
   1943 	CLIPBRD_S_LAST                                                                 = 262623
   1944 	CLIPCAPS                                                                       = 36
   1945 	CLIP_CHARACTER_PRECIS                                                          = 1
   1946 	CLIP_DEFAULT_PRECIS                                                            = 0
   1947 	CLIP_EMBEDDED                                                                  = 128
   1948 	CLIP_LH_ANGLES                                                                 = 16
   1949 	CLIP_MASK                                                                      = 0xf
   1950 	CLIP_STROKE_PRECIS                                                             = 2
   1951 	CLIP_TO_PATH                                                                   = 4097
   1952 	CLIP_TT_ALWAYS                                                                 = 32
   1953 	CLK_TCK                                                                        = 1000
   1954 	CLOCKS_PER_SEC                                                                 = 1000
   1955 	CLOCK_MONOTONIC                                                                = 1
   1956 	CLOCK_PROCESS_CPUTIME_ID                                                       = 2
   1957 	CLOCK_REALTIME                                                                 = 0
   1958 	CLOCK_THREAD_CPUTIME_ID                                                        = 3
   1959 	CLOSECHANNEL                                                                   = 4112
   1960 	CLRBREAK                                                                       = 9
   1961 	CLRDTR                                                                         = 6
   1962 	CLRRTS                                                                         = 4
   1963 	CLR_INVALID                                                                    = 0xFFFFFFFF
   1964 	CLSID_DEFINED                                                                  = 0
   1965 	CMC_FAIL_BAD_ALG                                                               = 0
   1966 	CMC_FAIL_BAD_CERT_ID                                                           = 4
   1967 	CMC_FAIL_BAD_IDENTITY                                                          = 7
   1968 	CMC_FAIL_BAD_MESSAGE_CHECK                                                     = 1
   1969 	CMC_FAIL_BAD_REQUEST                                                           = 2
   1970 	CMC_FAIL_BAD_TIME                                                              = 3
   1971 	CMC_FAIL_INTERNAL_CA_ERROR                                                     = 11
   1972 	CMC_FAIL_MUST_ARCHIVE_KEYS                                                     = 6
   1973 	CMC_FAIL_NO_KEY_REUSE                                                          = 10
   1974 	CMC_FAIL_POP_FAILED                                                            = 9
   1975 	CMC_FAIL_POP_REQUIRED                                                          = 8
   1976 	CMC_FAIL_TRY_LATER                                                             = 12
   1977 	CMC_FAIL_UNSUPORTED_EXT                                                        = 5
   1978 	CMC_OTHER_INFO_FAIL_CHOICE                                                     = 1
   1979 	CMC_OTHER_INFO_NO_CHOICE                                                       = 0
   1980 	CMC_OTHER_INFO_PEND_CHOICE                                                     = 2
   1981 	CMC_STATUS_CONFIRM_REQUIRED                                                    = 5
   1982 	CMC_STATUS_FAILED                                                              = 2
   1983 	CMC_STATUS_NO_SUPPORT                                                          = 4
   1984 	CMC_STATUS_PENDING                                                             = 3
   1985 	CMC_STATUS_SUCCESS                                                             = 0
   1986 	CMC_TAGGED_CERT_REQUEST_CHOICE                                                 = 1
   1987 	CMSG_ALL_FLAGS                                                                 = 18446744073709551615
   1988 	CMSG_ATTR_CERT_COUNT_PARAM                                                     = 31
   1989 	CMSG_ATTR_CERT_PARAM                                                           = 32
   1990 	CMSG_AUTHENTICATED_ATTRIBUTES_FLAG                                             = 0x8
   1991 	CMSG_BARE_CONTENT_FLAG                                                         = 0x1
   1992 	CMSG_BARE_CONTENT_PARAM                                                        = 3
   1993 	CMSG_CERT_COUNT_PARAM                                                          = 11
   1994 	CMSG_CERT_PARAM                                                                = 12
   1995 	CMSG_CMS_ENCAPSULATED_CONTENT_FLAG                                             = 0x40
   1996 	CMSG_CMS_ENCAPSULATED_CTL_FLAG                                                 = 0x8000
   1997 	CMSG_CMS_RECIPIENT_COUNT_PARAM                                                 = 33
   1998 	CMSG_CMS_RECIPIENT_ENCRYPTED_KEY_INDEX_PARAM                                   = 35
   1999 	CMSG_CMS_RECIPIENT_INDEX_PARAM                                                 = 34
   2000 	CMSG_CMS_RECIPIENT_INFO_PARAM                                                  = 36
   2001 	CMSG_CMS_SIGNER_INFO_PARAM                                                     = 39
   2002 	CMSG_COMPUTED_HASH_PARAM                                                       = 22
   2003 	CMSG_CONTENTS_OCTETS_FLAG                                                      = 0x10
   2004 	CMSG_CONTENT_ENCRYPT_FREE_OBJID_FLAG                                           = 0x2
   2005 	CMSG_CONTENT_ENCRYPT_FREE_PARA_FLAG                                            = 0x1
   2006 	CMSG_CONTENT_ENCRYPT_PAD_ENCODED_LEN_FLAG                                      = 0x1
   2007 	CMSG_CONTENT_ENCRYPT_RELEASE_CONTEXT_FLAG                                      = 0x8000
   2008 	CMSG_CONTENT_PARAM                                                             = 2
   2009 	CMSG_CRL_COUNT_PARAM                                                           = 13
   2010 	CMSG_CRL_PARAM                                                                 = 14
   2011 	CMSG_CRYPT_RELEASE_CONTEXT_FLAG                                                = 0x8000
   2012 	CMSG_CTRL_ADD_ATTR_CERT                                                        = 14
   2013 	CMSG_CTRL_ADD_CERT                                                             = 10
   2014 	CMSG_CTRL_ADD_CMS_SIGNER_INFO                                                  = 20
   2015 	CMSG_CTRL_ADD_CRL                                                              = 12
   2016 	CMSG_CTRL_ADD_SIGNER                                                           = 6
   2017 	CMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR                                               = 8
   2018 	CMSG_CTRL_DECRYPT                                                              = 2
   2019 	CMSG_CTRL_DEL_ATTR_CERT                                                        = 15
   2020 	CMSG_CTRL_DEL_CERT                                                             = 11
   2021 	CMSG_CTRL_DEL_CRL                                                              = 13
   2022 	CMSG_CTRL_DEL_SIGNER                                                           = 7
   2023 	CMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR                                               = 9
   2024 	CMSG_CTRL_ENABLE_STRONG_SIGNATURE                                              = 21
   2025 	CMSG_CTRL_KEY_AGREE_DECRYPT                                                    = 17
   2026 	CMSG_CTRL_KEY_TRANS_DECRYPT                                                    = 16
   2027 	CMSG_CTRL_MAIL_LIST_DECRYPT                                                    = 18
   2028 	CMSG_CTRL_VERIFY_HASH                                                          = 5
   2029 	CMSG_CTRL_VERIFY_SIGNATURE                                                     = 1
   2030 	CMSG_CTRL_VERIFY_SIGNATURE_EX                                                  = 19
   2031 	CMSG_DATA                                                                      = 1
   2032 	CMSG_DATA_FLAG                                                                 = 2
   2033 	CMSG_DETACHED_FLAG                                                             = 0x4
   2034 	CMSG_ENCODED_MESSAGE                                                           = 29
   2035 	CMSG_ENCODED_SIGNER                                                            = 28
   2036 	CMSG_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG                                     = 0x2
   2037 	CMSG_ENCODE_SORTED_CTL_FLAG                                                    = 0x1
   2038 	CMSG_ENCODING_TYPE_MASK                                                        = 0xffff0000
   2039 	CMSG_ENCRYPTED                                                                 = 6
   2040 	CMSG_ENCRYPTED_DIGEST                                                          = 27
   2041 	CMSG_ENCRYPTED_FLAG                                                            = 64
   2042 	CMSG_ENCRYPT_PARAM                                                             = 26
   2043 	CMSG_ENVELOPED                                                                 = 3
   2044 	CMSG_ENVELOPED_DATA_CMS_VERSION                                                = 2
   2045 	CMSG_ENVELOPED_DATA_PKCS_1_5_VERSION                                           = 0
   2046 	CMSG_ENVELOPED_DATA_V0                                                         = 0
   2047 	CMSG_ENVELOPED_DATA_V2                                                         = 2
   2048 	CMSG_ENVELOPED_FLAG                                                            = 8
   2049 	CMSG_ENVELOPED_RECIPIENT_V0                                                    = 0
   2050 	CMSG_ENVELOPED_RECIPIENT_V2                                                    = 2
   2051 	CMSG_ENVELOPED_RECIPIENT_V3                                                    = 3
   2052 	CMSG_ENVELOPED_RECIPIENT_V4                                                    = 4
   2053 	CMSG_ENVELOPE_ALGORITHM_PARAM                                                  = 15
   2054 	CMSG_HASHED                                                                    = 5
   2055 	CMSG_HASHED_DATA_CMS_VERSION                                                   = 2
   2056 	CMSG_HASHED_DATA_PKCS_1_5_VERSION                                              = 0
   2057 	CMSG_HASHED_DATA_V0                                                            = 0
   2058 	CMSG_HASHED_DATA_V2                                                            = 2
   2059 	CMSG_HASHED_FLAG                                                               = 32
   2060 	CMSG_HASH_ALGORITHM_PARAM                                                      = 20
   2061 	CMSG_HASH_DATA_PARAM                                                           = 21
   2062 	CMSG_INDEFINITE_LENGTH                                                         = 4294967295
   2063 	CMSG_INNER_CONTENT_TYPE_PARAM                                                  = 4
   2064 	CMSG_KEY_AGREE_ENCRYPT_FREE_MATERIAL_FLAG                                      = 0x2
   2065 	CMSG_KEY_AGREE_ENCRYPT_FREE_OBJID_FLAG                                         = 0x20
   2066 	CMSG_KEY_AGREE_ENCRYPT_FREE_PARA_FLAG                                          = 0x1
   2067 	CMSG_KEY_AGREE_ENCRYPT_FREE_PUBKEY_ALG_FLAG                                    = 0x4
   2068 	CMSG_KEY_AGREE_ENCRYPT_FREE_PUBKEY_BITS_FLAG                                   = 0x10
   2069 	CMSG_KEY_AGREE_ENCRYPT_FREE_PUBKEY_PARA_FLAG                                   = 0x8
   2070 	CMSG_KEY_AGREE_EPHEMERAL_KEY_CHOICE                                            = 1
   2071 	CMSG_KEY_AGREE_ORIGINATOR_CERT                                                 = 1
   2072 	CMSG_KEY_AGREE_ORIGINATOR_PUBLIC_KEY                                           = 2
   2073 	CMSG_KEY_AGREE_RECIPIENT                                                       = 2
   2074 	CMSG_KEY_AGREE_STATIC_KEY_CHOICE                                               = 2
   2075 	CMSG_KEY_AGREE_VERSION                                                         = 3
   2076 	CMSG_KEY_TRANS_CMS_VERSION                                                     = 2
   2077 	CMSG_KEY_TRANS_ENCRYPT_FREE_OBJID_FLAG                                         = 0x2
   2078 	CMSG_KEY_TRANS_ENCRYPT_FREE_PARA_FLAG                                          = 0x1
   2079 	CMSG_KEY_TRANS_PKCS_1_5_VERSION                                                = 0
   2080 	CMSG_KEY_TRANS_RECIPIENT                                                       = 1
   2081 	CMSG_LENGTH_ONLY_FLAG                                                          = 0x2
   2082 	CMSG_MAIL_LIST_ENCRYPT_FREE_OBJID_FLAG                                         = 0x2
   2083 	CMSG_MAIL_LIST_ENCRYPT_FREE_PARA_FLAG                                          = 0x1
   2084 	CMSG_MAIL_LIST_HANDLE_KEY_CHOICE                                               = 1
   2085 	CMSG_MAIL_LIST_RECIPIENT                                                       = 3
   2086 	CMSG_MAIL_LIST_VERSION                                                         = 4
   2087 	CMSG_MAX_LENGTH_FLAG                                                           = 0x20
   2088 	CMSG_OID_CNG_EXPORT_KEY_AGREE_FUNC                                             = "CryptMsgDllCNGExportKeyAgree"
   2089 	CMSG_OID_CNG_EXPORT_KEY_TRANS_FUNC                                             = "CryptMsgDllCNGExportKeyTrans"
   2090 	CMSG_OID_CNG_GEN_CONTENT_ENCRYPT_KEY_FUNC                                      = "CryptMsgDllCNGGenContentEncryptKey"
   2091 	CMSG_OID_CNG_IMPORT_CONTENT_ENCRYPT_KEY_FUNC                                   = "CryptMsgDllCNGImportContentEncryptKey"
   2092 	CMSG_OID_CNG_IMPORT_KEY_AGREE_FUNC                                             = "CryptMsgDllCNGImportKeyAgree"
   2093 	CMSG_OID_CNG_IMPORT_KEY_TRANS_FUNC                                             = "CryptMsgDllCNGImportKeyTrans"
   2094 	CMSG_OID_EXPORT_ENCRYPT_KEY_FUNC                                               = "CryptMsgDllExportEncryptKey"
   2095 	CMSG_OID_EXPORT_KEY_AGREE_FUNC                                                 = "CryptMsgDllExportKeyAgree"
   2096 	CMSG_OID_EXPORT_KEY_TRANS_FUNC                                                 = "CryptMsgDllExportKeyTrans"
   2097 	CMSG_OID_EXPORT_MAIL_LIST_FUNC                                                 = "CryptMsgDllExportMailList"
   2098 	CMSG_OID_GEN_CONTENT_ENCRYPT_KEY_FUNC                                          = "CryptMsgDllGenContentEncryptKey"
   2099 	CMSG_OID_GEN_ENCRYPT_KEY_FUNC                                                  = "CryptMsgDllGenEncryptKey"
   2100 	CMSG_OID_IMPORT_ENCRYPT_KEY_FUNC                                               = "CryptMsgDllImportEncryptKey"
   2101 	CMSG_OID_IMPORT_KEY_AGREE_FUNC                                                 = "CryptMsgDllImportKeyAgree"
   2102 	CMSG_OID_IMPORT_KEY_TRANS_FUNC                                                 = "CryptMsgDllImportKeyTrans"
   2103 	CMSG_OID_IMPORT_MAIL_LIST_FUNC                                                 = "CryptMsgDllImportMailList"
   2104 	CMSG_RC4_NO_SALT_FLAG                                                          = 0x40000000
   2105 	CMSG_RECIPIENT_COUNT_PARAM                                                     = 17
   2106 	CMSG_RECIPIENT_INDEX_PARAM                                                     = 18
   2107 	CMSG_RECIPIENT_INFO_PARAM                                                      = 19
   2108 	CMSG_SIGNED                                                                    = 2
   2109 	CMSG_SIGNED_AND_ENVELOPED                                                      = 4
   2110 	CMSG_SIGNED_AND_ENVELOPED_FLAG                                                 = 16
   2111 	CMSG_SIGNED_DATA_CMS_VERSION                                                   = 3
   2112 	CMSG_SIGNED_DATA_NO_SIGN_FLAG                                                  = 0x80
   2113 	CMSG_SIGNED_DATA_PKCS_1_5_VERSION                                              = 1
   2114 	CMSG_SIGNED_DATA_V1                                                            = 1
   2115 	CMSG_SIGNED_DATA_V3                                                            = 3
   2116 	CMSG_SIGNED_FLAG                                                               = 4
   2117 	CMSG_SIGNER_AUTH_ATTR_PARAM                                                    = 9
   2118 	CMSG_SIGNER_CERT_ID_PARAM                                                      = 38
   2119 	CMSG_SIGNER_CERT_INFO_PARAM                                                    = 7
   2120 	CMSG_SIGNER_COUNT_PARAM                                                        = 5
   2121 	CMSG_SIGNER_HASH_ALGORITHM_PARAM                                               = 8
   2122 	CMSG_SIGNER_INFO_CMS_VERSION                                                   = 3
   2123 	CMSG_SIGNER_INFO_PARAM                                                         = 6
   2124 	CMSG_SIGNER_INFO_PKCS_1_5_VERSION                                              = 1
   2125 	CMSG_SIGNER_INFO_V1                                                            = 1
   2126 	CMSG_SIGNER_INFO_V3                                                            = 3
   2127 	CMSG_SIGNER_ONLY_FLAG                                                          = 0x2
   2128 	CMSG_SIGNER_UNAUTH_ATTR_PARAM                                                  = 10
   2129 	CMSG_SP3_COMPATIBLE_ENCRYPT_FLAG                                               = 0x80000000
   2130 	CMSG_TRUSTED_SIGNER_FLAG                                                       = 0x1
   2131 	CMSG_TYPE_PARAM                                                                = 1
   2132 	CMSG_UNPROTECTED_ATTR_PARAM                                                    = 37
   2133 	CMSG_USE_SIGNER_INDEX_FLAG                                                     = 0x4
   2134 	CMSG_VERIFY_COUNTER_SIGN_ENABLE_STRONG_FLAG                                    = 0x1
   2135 	CMSG_VERIFY_SIGNER_CERT                                                        = 2
   2136 	CMSG_VERIFY_SIGNER_CHAIN                                                       = 3
   2137 	CMSG_VERIFY_SIGNER_NULL                                                        = 4
   2138 	CMSG_VERIFY_SIGNER_PUBKEY                                                      = 1
   2139 	CMSG_VERSION_PARAM                                                             = 30
   2140 	CM_CMYK_COLOR                                                                  = 0x00000004
   2141 	CM_DEVICE_ICM                                                                  = 0x00000001
   2142 	CM_GAMMA_RAMP                                                                  = 0x00000002
   2143 	CM_IN_GAMUT                                                                    = 0
   2144 	CM_NONE                                                                        = 0x00000000
   2145 	CM_OUT_OF_GAMUT                                                                = 255
   2146 	CM_SERVICE_MEASURED_BOOT_LOAD                                                  = 0x00000020
   2147 	CM_SERVICE_NETWORK_BOOT_LOAD                                                   = 0x00000001
   2148 	CM_SERVICE_SD_DISK_BOOT_LOAD                                                   = 0x00000008
   2149 	CM_SERVICE_USB3_DISK_BOOT_LOAD                                                 = 0x00000010
   2150 	CM_SERVICE_USB_DISK_BOOT_LOAD                                                  = 0x00000004
   2151 	CM_SERVICE_VALID_PROMOTION_MASK                                                = 255
   2152 	CM_SERVICE_VERIFIER_BOOT_LOAD                                                  = 0x00000040
   2153 	CM_SERVICE_VIRTUAL_DISK_BOOT_LOAD                                              = 0x00000002
   2154 	CM_SERVICE_WINPE_BOOT_LOAD                                                     = 0x00000080
   2155 	COLFLAG_BUSY                                                                   = 0x0100
   2156 	COLFLAG_GENERATED                                                              = 0x0060
   2157 	COLFLAG_HASCOLL                                                                = 0x0200
   2158 	COLFLAG_HASTYPE                                                                = 0x0004
   2159 	COLFLAG_HIDDEN                                                                 = 0x0002
   2160 	COLFLAG_NOEXPAND                                                               = 0x0400
   2161 	COLFLAG_NOINSERT                                                               = 0x0062
   2162 	COLFLAG_NOTAVAIL                                                               = 0x0080
   2163 	COLFLAG_PRIMKEY                                                                = 0x0001
   2164 	COLFLAG_SORTERREF                                                              = 0x0010
   2165 	COLFLAG_STORED                                                                 = 0x0040
   2166 	COLFLAG_UNIQUE                                                                 = 0x0008
   2167 	COLFLAG_VIRTUAL                                                                = 0x0020
   2168 	COLNAME_COLUMN                                                                 = 4
   2169 	COLNAME_DATABASE                                                               = 2
   2170 	COLNAME_DECLTYPE                                                               = 1
   2171 	COLNAME_N                                                                      = 5
   2172 	COLNAME_NAME                                                                   = 0
   2173 	COLNAME_TABLE                                                                  = 3
   2174 	COLORMATCHTOTARGET_EMBEDED                                                     = 0x00000001
   2175 	COLORMGMTCAPS                                                                  = 121
   2176 	COLORMGMTDLGORD                                                                = 1551
   2177 	COLOROKSTRINGA                                                                 = "commdlg_ColorOK"
   2178 	COLORONCOLOR                                                                   = 3
   2179 	COLORRES                                                                       = 108
   2180 	COLOR_3DDKSHADOW                                                               = 21
   2181 	COLOR_3DFACE                                                                   = 15
   2182 	COLOR_3DHIGHLIGHT                                                              = 20
   2183 	COLOR_3DHILIGHT                                                                = 20
   2184 	COLOR_3DLIGHT                                                                  = 22
   2185 	COLOR_3DSHADOW                                                                 = 16
   2186 	COLOR_ACTIVEBORDER                                                             = 10
   2187 	COLOR_ACTIVECAPTION                                                            = 2
   2188 	COLOR_APPWORKSPACE                                                             = 12
   2189 	COLOR_BACKGROUND                                                               = 1
   2190 	COLOR_BTNFACE                                                                  = 15
   2191 	COLOR_BTNHIGHLIGHT                                                             = 20
   2192 	COLOR_BTNHILIGHT                                                               = 20
   2193 	COLOR_BTNSHADOW                                                                = 16
   2194 	COLOR_BTNTEXT                                                                  = 18
   2195 	COLOR_CAPTIONTEXT                                                              = 9
   2196 	COLOR_DESKTOP                                                                  = 1
   2197 	COLOR_GRADIENTACTIVECAPTION                                                    = 27
   2198 	COLOR_GRADIENTINACTIVECAPTION                                                  = 28
   2199 	COLOR_GRAYTEXT                                                                 = 17
   2200 	COLOR_HIGHLIGHT                                                                = 13
   2201 	COLOR_HIGHLIGHTTEXT                                                            = 14
   2202 	COLOR_HOTLIGHT                                                                 = 26
   2203 	COLOR_INACTIVEBORDER                                                           = 11
   2204 	COLOR_INACTIVECAPTION                                                          = 3
   2205 	COLOR_INACTIVECAPTIONTEXT                                                      = 19
   2206 	COLOR_INFOBK                                                                   = 24
   2207 	COLOR_INFOTEXT                                                                 = 23
   2208 	COLOR_MENU                                                                     = 4
   2209 	COLOR_MENUBAR                                                                  = 30
   2210 	COLOR_MENUHILIGHT                                                              = 29
   2211 	COLOR_MENUTEXT                                                                 = 7
   2212 	COLOR_SCROLLBAR                                                                = 0
   2213 	COLOR_WINDOW                                                                   = 5
   2214 	COLOR_WINDOWFRAME                                                              = 6
   2215 	COLOR_WINDOWTEXT                                                               = 8
   2216 	COLTYPE_ANY                                                                    = 1
   2217 	COLTYPE_BLOB                                                                   = 2
   2218 	COLTYPE_CUSTOM                                                                 = 0
   2219 	COLTYPE_INT                                                                    = 3
   2220 	COLTYPE_INTEGER                                                                = 4
   2221 	COLTYPE_REAL                                                                   = 5
   2222 	COLTYPE_TEXT                                                                   = 6
   2223 	COMMON_LVB_GRID_HORIZONTAL                                                     = 0x400
   2224 	COMMON_LVB_GRID_LVERTICAL                                                      = 0x800
   2225 	COMMON_LVB_GRID_RVERTICAL                                                      = 0x1000
   2226 	COMMON_LVB_LEADING_BYTE                                                        = 0x100
   2227 	COMMON_LVB_REVERSE_VIDEO                                                       = 0x4000
   2228 	COMMON_LVB_SBCSDBCS                                                            = 0x300
   2229 	COMMON_LVB_TRAILING_BYTE                                                       = 0x200
   2230 	COMMON_LVB_UNDERSCORE                                                          = 0x8000
   2231 	COMPLEXREGION                                                                  = 3
   2232 	COMPRESSION_ENGINE_HIBER                                                       = 512
   2233 	COMPRESSION_ENGINE_MAXIMUM                                                     = 256
   2234 	COMPRESSION_ENGINE_STANDARD                                                    = 0
   2235 	COMPRESSION_FORMAT_DEFAULT                                                     = 1
   2236 	COMPRESSION_FORMAT_LZNT1                                                       = 2
   2237 	COMPRESSION_FORMAT_NONE                                                        = 0
   2238 	COMPRESSION_FORMAT_SPARSE                                                      = 16384
   2239 	COMPRESSION_FORMAT_XPRESS                                                      = 3
   2240 	COMPRESSION_FORMAT_XPRESS_HUFF                                                 = 4
   2241 	COM_RIGHTS_ACTIVATE_LOCAL                                                      = 8
   2242 	COM_RIGHTS_ACTIVATE_REMOTE                                                     = 16
   2243 	COM_RIGHTS_EXECUTE                                                             = 1
   2244 	COM_RIGHTS_EXECUTE_LOCAL                                                       = 2
   2245 	COM_RIGHTS_EXECUTE_REMOTE                                                      = 4
   2246 	CONCURRENCYSAL_HXX                                                             = 0
   2247 	CONDITION_VARIABLE_LOCKMODE_SHARED                                             = 1
   2248 	CONFIRMSAFETYACTION_LOADOBJECT                                                 = 0x1
   2249 	CONNDLG_CONN_POINT                                                             = 0x00000002
   2250 	CONNDLG_HIDE_BOX                                                               = 0x00000008
   2251 	CONNDLG_NOT_PERSIST                                                            = 0x00000020
   2252 	CONNDLG_PERSIST                                                                = 0x00000010
   2253 	CONNDLG_RO_PATH                                                                = 0x00000001
   2254 	CONNDLG_USE_MRU                                                                = 0x00000004
   2255 	CONNECT_CMD_SAVECRED                                                           = 0x00001000
   2256 	CONNECT_COMMANDLINE                                                            = 0x00000800
   2257 	CONNECT_CURRENT_MEDIA                                                          = 0x00000200
   2258 	CONNECT_DEFERRED                                                               = 0x00000400
   2259 	CONNECT_INTERACTIVE                                                            = 0x00000008
   2260 	CONNECT_LOCALDRIVE                                                             = 0x00000100
   2261 	CONNECT_NEED_DRIVE                                                             = 0x00000020
   2262 	CONNECT_PROMPT                                                                 = 0x00000010
   2263 	CONNECT_REDIRECT                                                               = 0x00000080
   2264 	CONNECT_REFCOUNT                                                               = 0x00000040
   2265 	CONNECT_RESERVED                                                               = 0xFF000000
   2266 	CONNECT_TEMPORARY                                                              = 0x00000004
   2267 	CONNECT_UPDATE_PROFILE                                                         = 0x00000001
   2268 	CONNECT_UPDATE_RECENT                                                          = 0x00000002
   2269 	CONSOLE_APPLICATION_16BIT                                                      = 0x0000
   2270 	CONSOLE_CARET_SELECTION                                                        = 0x0001
   2271 	CONSOLE_CARET_VISIBLE                                                          = 0x0002
   2272 	CONSOLE_FULLSCREEN                                                             = 1
   2273 	CONSOLE_FULLSCREEN_HARDWARE                                                    = 2
   2274 	CONSOLE_FULLSCREEN_MODE                                                        = 1
   2275 	CONSOLE_MOUSE_DOWN                                                             = 0x8
   2276 	CONSOLE_MOUSE_SELECTION                                                        = 0x4
   2277 	CONSOLE_NO_SELECTION                                                           = 0x0
   2278 	CONSOLE_SELECTION_IN_PROGRESS                                                  = 0x1
   2279 	CONSOLE_SELECTION_NOT_EMPTY                                                    = 0x2
   2280 	CONSOLE_TEXTMODE_BUFFER                                                        = 1
   2281 	CONSOLE_WINDOWED_MODE                                                          = 2
   2282 	CONST_VTBL                                                                     = 0
   2283 	CONTAINER_INHERIT_ACE                                                          = 2
   2284 	CONTEXT_ALL                                                                    = 1048607
   2285 	CONTEXT_AMD64                                                                  = 0x100000
   2286 	CONTEXT_CONTROL                                                                = 1048577
   2287 	CONTEXT_DEBUG_REGISTERS                                                        = 1048592
   2288 	CONTEXT_EXCEPTION_ACTIVE                                                       = 0x8000000
   2289 	CONTEXT_EXCEPTION_REPORTING                                                    = 0x80000000
   2290 	CONTEXT_EXCEPTION_REQUEST                                                      = 0x40000000
   2291 	CONTEXT_E_FIRST                                                                = 2147803136
   2292 	CONTEXT_E_LAST                                                                 = 2147803183
   2293 	CONTEXT_FLOATING_POINT                                                         = 1048584
   2294 	CONTEXT_FULL                                                                   = 1048587
   2295 	CONTEXT_INTEGER                                                                = 1048578
   2296 	CONTEXT_OID_CREATE_OBJECT_CONTEXT_FUNC                                         = "ContextDllCreateObjectContext"
   2297 	CONTEXT_SEGMENTS                                                               = 1048580
   2298 	CONTEXT_SERVICE_ACTIVE                                                         = 0x10000000
   2299 	CONTEXT_S_FIRST                                                                = 319488
   2300 	CONTEXT_S_LAST                                                                 = 319535
   2301 	CONVERT10_E_FIRST                                                              = 2147746240
   2302 	CONVERT10_E_LAST                                                               = 2147746255
   2303 	CONVERT10_S_FIRST                                                              = 262592
   2304 	CONVERT10_S_LAST                                                               = 262607
   2305 	COPYFILE_SIS_FLAGS                                                             = 0x0003
   2306 	COPYFILE_SIS_LINK                                                              = 0x0001
   2307 	COPYFILE_SIS_REPLACE                                                           = 0x0002
   2308 	COPY_FILE_ALLOW_DECRYPTED_DESTINATION                                          = 0x8
   2309 	COPY_FILE_FAIL_IF_EXISTS                                                       = 0x1
   2310 	COPY_FILE_OPEN_SOURCE_FOR_WRITE                                                = 0x4
   2311 	COPY_FILE_RESTARTABLE                                                          = 0x2
   2312 	CORE_PARKING_POLICY_CHANGE_IDEAL                                               = 0
   2313 	CORE_PARKING_POLICY_CHANGE_MAX                                                 = 3
   2314 	CORE_PARKING_POLICY_CHANGE_MULTISTEP                                           = 3
   2315 	CORE_PARKING_POLICY_CHANGE_ROCKET                                              = 2
   2316 	CORE_PARKING_POLICY_CHANGE_SINGLE                                              = 1
   2317 	CO_E_FIRST                                                                     = 2147746288
   2318 	CO_E_LAST                                                                      = 2147746303
   2319 	CO_S_FIRST                                                                     = 262640
   2320 	CO_S_LAST                                                                      = 262655
   2321 	CPS_CANCEL                                                                     = 0x0004
   2322 	CPS_COMPLETE                                                                   = 0x0001
   2323 	CPS_CONVERT                                                                    = 0x0002
   2324 	CPS_REVERT                                                                     = 0x0003
   2325 	CP_ACP                                                                         = 0
   2326 	CP_INSTALLED                                                                   = 0x00000001
   2327 	CP_MACCP                                                                       = 2
   2328 	CP_NONE                                                                        = 0
   2329 	CP_OEMCP                                                                       = 1
   2330 	CP_RECTANGLE                                                                   = 1
   2331 	CP_REGION                                                                      = 2
   2332 	CP_SUPPORTED                                                                   = 0x00000002
   2333 	CP_SYMBOL                                                                      = 42
   2334 	CP_THREAD_ACP                                                                  = 3
   2335 	CP_UTF7                                                                        = 65000
   2336 	CP_UTF8                                                                        = 65001
   2337 	CP_WINANSI                                                                     = 1004
   2338 	CP_WINNEUTRAL                                                                  = 1004
   2339 	CP_WINUNICODE                                                                  = 1200
   2340 	CREATECOLORSPACE_EMBEDED                                                       = 0x00000001
   2341 	CREATE_ALWAYS                                                                  = 2
   2342 	CREATE_BOUNDARY_DESCRIPTOR_ADD_APPCONTAINER_SID                                = 0x1
   2343 	CREATE_BREAKAWAY_FROM_JOB                                                      = 0x1000000
   2344 	CREATE_DEFAULT_ERROR_MODE                                                      = 0x4000000
   2345 	CREATE_FORCEDOS                                                                = 0x2000
   2346 	CREATE_FOR_DIR                                                                 = 2
   2347 	CREATE_FOR_IMPORT                                                              = 1
   2348 	CREATE_IGNORE_SYSTEM_DEFAULT                                                   = 0x80000000
   2349 	CREATE_NEW                                                                     = 1
   2350 	CREATE_NEW_CONSOLE                                                             = 0x10
   2351 	CREATE_NEW_PROCESS_GROUP                                                       = 0x200
   2352 	CREATE_NO_WINDOW                                                               = 0x8000000
   2353 	CREATE_PRESERVE_CODE_AUTHZ_LEVEL                                               = 0x2000000
   2354 	CREATE_PROCESS_DEBUG_EVENT                                                     = 3
   2355 	CREATE_PROTECTED_PROCESS                                                       = 0x40000
   2356 	CREATE_SEPARATE_WOW_VDM                                                        = 0x800
   2357 	CREATE_SHARED_WOW_VDM                                                          = 0x1000
   2358 	CREATE_SUSPENDED                                                               = 0x4
   2359 	CREATE_THREAD_DEBUG_EVENT                                                      = 2
   2360 	CREATE_UNICODE_ENVIRONMENT                                                     = 0x400
   2361 	CRITICAL_SECTION_NO_DEBUG_INFO                                                 = 16777216
   2362 	CRL_DIST_POINT_ERR_CRL_ISSUER_BIT                                              = 2147483648
   2363 	CRL_DIST_POINT_ERR_INDEX_MASK                                                  = 0x7f
   2364 	CRL_DIST_POINT_ERR_INDEX_SHIFT                                                 = 24
   2365 	CRL_DIST_POINT_FULL_NAME                                                       = 1
   2366 	CRL_DIST_POINT_ISSUER_RDN_NAME                                                 = 2
   2367 	CRL_DIST_POINT_NO_NAME                                                         = 0
   2368 	CRL_FIND_ANY                                                                   = 0
   2369 	CRL_FIND_EXISTING                                                              = 2
   2370 	CRL_FIND_ISSUED_BY                                                             = 1
   2371 	CRL_FIND_ISSUED_BY_AKI_FLAG                                                    = 0x1
   2372 	CRL_FIND_ISSUED_BY_BASE_FLAG                                                   = 0x8
   2373 	CRL_FIND_ISSUED_BY_DELTA_FLAG                                                  = 0x4
   2374 	CRL_FIND_ISSUED_BY_SIGNATURE_FLAG                                              = 0x2
   2375 	CRL_FIND_ISSUED_FOR                                                            = 3
   2376 	CRL_FIND_ISSUED_FOR_SET_STRONG_PROPERTIES_FLAG                                 = 0x10
   2377 	CRL_REASON_AA_COMPROMISE                                                       = 10
   2378 	CRL_REASON_AA_COMPROMISE_FLAG                                                  = 0x80
   2379 	CRL_REASON_AFFILIATION_CHANGED                                                 = 3
   2380 	CRL_REASON_AFFILIATION_CHANGED_FLAG                                            = 0x10
   2381 	CRL_REASON_CA_COMPROMISE                                                       = 2
   2382 	CRL_REASON_CA_COMPROMISE_FLAG                                                  = 0x20
   2383 	CRL_REASON_CERTIFICATE_HOLD                                                    = 6
   2384 	CRL_REASON_CERTIFICATE_HOLD_FLAG                                               = 0x02
   2385 	CRL_REASON_CESSATION_OF_OPERATION                                              = 5
   2386 	CRL_REASON_CESSATION_OF_OPERATION_FLAG                                         = 0x04
   2387 	CRL_REASON_KEY_COMPROMISE                                                      = 1
   2388 	CRL_REASON_KEY_COMPROMISE_FLAG                                                 = 0x40
   2389 	CRL_REASON_PRIVILEGE_WITHDRAWN                                                 = 9
   2390 	CRL_REASON_PRIVILEGE_WITHDRAWN_FLAG                                            = 0x01
   2391 	CRL_REASON_REMOVE_FROM_CRL                                                     = 8
   2392 	CRL_REASON_SUPERSEDED                                                          = 4
   2393 	CRL_REASON_SUPERSEDED_FLAG                                                     = 0x08
   2394 	CRL_REASON_UNSPECIFIED                                                         = 0
   2395 	CRL_REASON_UNUSED_FLAG                                                         = 0x80
   2396 	CRL_V1                                                                         = 0
   2397 	CRL_V2                                                                         = 1
   2398 	CRM_PROTOCOL_DYNAMIC_MARSHAL_INFO                                              = 0x00000002
   2399 	CRM_PROTOCOL_EXPLICIT_MARSHAL_ONLY                                             = 0x00000001
   2400 	CRM_PROTOCOL_MAXIMUM_OPTION                                                    = 0x00000003
   2401 	CROSS_CERT_DIST_POINT_ERR_INDEX_MASK                                           = 0xff
   2402 	CROSS_CERT_DIST_POINT_ERR_INDEX_SHIFT                                          = 24
   2403 	CRYPTNET_CACHED_OCSP_SWITCH_TO_CRL_COUNT_DEFAULT                               = 50
   2404 	CRYPTNET_CRL_BEFORE_OCSP_ENABLE                                                = 0xffffffff
   2405 	CRYPTNET_CRL_PRE_FETCH_MAX_AGE_SECONDS_DEFAULT                                 = 7200
   2406 	CRYPTNET_CRL_PRE_FETCH_MAX_AGE_SECONDS_MIN                                     = 300
   2407 	CRYPTNET_CRL_PRE_FETCH_MIN_AFTER_NEXT_UPDATE_SECONDS_DEFAULT                   = 300
   2408 	CRYPTNET_CRL_PRE_FETCH_MIN_BEFORE_NEXT_UPDATE_SECONDS_DEFAULT                  = 300
   2409 	CRYPTNET_CRL_PRE_FETCH_PUBLISH_BEFORE_NEXT_UPDATE_SECONDS_DEFAULT              = 3600
   2410 	CRYPTNET_CRL_PRE_FETCH_PUBLISH_RANDOM_INTERVAL_SECONDS_DEFAULT                 = 300
   2411 	CRYPTNET_CRL_PRE_FETCH_TIMEOUT_SECONDS_DEFAULT                                 = 300
   2412 	CRYPTNET_MAX_CACHED_OCSP_PER_CRL_COUNT_DEFAULT                                 = 500
   2413 	CRYPTNET_OCSP_AFTER_CRL_DISABLE                                                = 0xffffffff
   2414 	CRYPTNET_PRE_FETCH_AFTER_CURRENT_TIME_PRE_FETCH_PERIOD_SECONDS_DEFAULT         = 1800
   2415 	CRYPTNET_PRE_FETCH_AFTER_PUBLISH_PRE_FETCH_DIVISOR_DEFAULT                     = 10
   2416 	CRYPTNET_PRE_FETCH_BEFORE_NEXT_UPDATE_PRE_FETCH_DIVISOR_DEFAULT                = 20
   2417 	CRYPTNET_PRE_FETCH_MAX_AFTER_NEXT_UPDATE_PRE_FETCH_PERIOD_SECONDS_DEFAULT      = 14400
   2418 	CRYPTNET_PRE_FETCH_MAX_MAX_AGE_SECONDS_DEFAULT                                 = 1209600
   2419 	CRYPTNET_PRE_FETCH_MIN_AFTER_NEXT_UPDATE_PRE_FETCH_PERIOD_SECONDS_DEFAULT      = 1800
   2420 	CRYPTNET_PRE_FETCH_MIN_BEFORE_NEXT_UPDATE_PRE_FETCH_PERIOD_SECONDS_DEFAULT     = 3600
   2421 	CRYPTNET_PRE_FETCH_MIN_MAX_AGE_SECONDS_DEFAULT                                 = 3600
   2422 	CRYPTNET_PRE_FETCH_MIN_OCSP_VALIDITY_PERIOD_SECONDS_DEFAULT                    = 1209600
   2423 	CRYPTNET_PRE_FETCH_RETRIEVAL_TIMEOUT_SECONDS_DEFAULT                           = 300
   2424 	CRYPTNET_PRE_FETCH_SCAN_AFTER_TRIGGER_DELAY_SECONDS_DEFAULT                    = 30
   2425 	CRYPTNET_PRE_FETCH_TRIGGER_DISABLE                                             = 0xffffffff
   2426 	CRYPTNET_PRE_FETCH_TRIGGER_PERIOD_SECONDS_DEFAULT                              = 600
   2427 	CRYPTNET_PRE_FETCH_VALIDITY_PERIOD_AFTER_NEXT_UPDATE_PRE_FETCH_DIVISOR_DEFAULT = 10
   2428 	CRYPTNET_URL_CACHE_DEFAULT_FLUSH                                               = 0
   2429 	CRYPTNET_URL_CACHE_DEFAULT_FLUSH_EXEMPT_SECONDS_DEFAULT                        = 2419200
   2430 	CRYPTNET_URL_CACHE_DISABLE_FLUSH                                               = 0xffffffff
   2431 	CRYPTNET_URL_CACHE_PRE_FETCH_AUTOROOT_CAB                                      = 5
   2432 	CRYPTNET_URL_CACHE_PRE_FETCH_BLOB                                              = 1
   2433 	CRYPTNET_URL_CACHE_PRE_FETCH_CRL                                               = 2
   2434 	CRYPTNET_URL_CACHE_PRE_FETCH_DISALLOWED_CERT_CAB                               = 6
   2435 	CRYPTNET_URL_CACHE_PRE_FETCH_NONE                                              = 0
   2436 	CRYPTNET_URL_CACHE_PRE_FETCH_OCSP                                              = 3
   2437 	CRYPTNET_URL_CACHE_PRE_FETCH_PIN_RULES_CAB                                     = 7
   2438 	CRYPTNET_URL_CACHE_RESPONSE_HTTP                                               = 1
   2439 	CRYPTNET_URL_CACHE_RESPONSE_NONE                                               = 0
   2440 	CRYPTNET_URL_CACHE_RESPONSE_VALIDATED                                          = 0x8000
   2441 	CRYPTO_BLOBS_DEFINED                                                           = 0
   2442 	CRYPTPROTECTMEMORY_BLOCK_SIZE                                                  = 16
   2443 	CRYPTPROTECTMEMORY_CROSS_PROCESS                                               = 0x1
   2444 	CRYPTPROTECTMEMORY_SAME_LOGON                                                  = 0x2
   2445 	CRYPTPROTECTMEMORY_SAME_PROCESS                                                = 0x0
   2446 	CRYPTPROTECT_AUDIT                                                             = 0x10
   2447 	CRYPTPROTECT_CRED_REGENERATE                                                   = 0x80
   2448 	CRYPTPROTECT_CRED_SYNC                                                         = 0x8
   2449 	CRYPTPROTECT_FIRST_RESERVED_FLAGVAL                                            = 0x0fffffff
   2450 	CRYPTPROTECT_LAST_RESERVED_FLAGVAL                                             = 0xffffffff
   2451 	CRYPTPROTECT_LOCAL_MACHINE                                                     = 0x4
   2452 	CRYPTPROTECT_NO_RECOVERY                                                       = 0x20
   2453 	CRYPTPROTECT_PROMPT_ON_PROTECT                                                 = 0x2
   2454 	CRYPTPROTECT_PROMPT_ON_UNPROTECT                                               = 0x1
   2455 	CRYPTPROTECT_PROMPT_REQUIRE_STRONG                                             = 0x10
   2456 	CRYPTPROTECT_PROMPT_RESERVED                                                   = 0x04
   2457 	CRYPTPROTECT_PROMPT_STRONG                                                     = 0x08
   2458 	CRYPTPROTECT_UI_FORBIDDEN                                                      = 0x1
   2459 	CRYPTPROTECT_VERIFY_PROTECTION                                                 = 0x40
   2460 	CRYPT_ACCUMULATIVE_TIMEOUT                                                     = 0x800
   2461 	CRYPT_ACQUIRE_ALLOW_NCRYPT_KEY_FLAG                                            = 0x10000
   2462 	CRYPT_ACQUIRE_CACHE_FLAG                                                       = 0x1
   2463 	CRYPT_ACQUIRE_COMPARE_KEY_FLAG                                                 = 0x4
   2464 	CRYPT_ACQUIRE_NCRYPT_KEY_FLAGS_MASK                                            = 0x70000
   2465 	CRYPT_ACQUIRE_NO_HEALING                                                       = 0x8
   2466 	CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG                                             = 0x40000
   2467 	CRYPT_ACQUIRE_PREFER_NCRYPT_KEY_FLAG                                           = 0x20000
   2468 	CRYPT_ACQUIRE_SILENT_FLAG                                                      = 0x40
   2469 	CRYPT_ACQUIRE_USE_PROV_INFO_FLAG                                               = 0x2
   2470 	CRYPT_ACQUIRE_WINDOW_HANDLE_FLAG                                               = 0x80
   2471 	CRYPT_AIA_RETRIEVAL                                                            = 0x80000
   2472 	CRYPT_ALL_FUNCTIONS                                                            = 1
   2473 	CRYPT_ALL_PROVIDERS                                                            = 2
   2474 	CRYPT_ANY                                                                      = 4
   2475 	CRYPT_ARCHIVABLE                                                               = 0x4000
   2476 	CRYPT_ARCHIVE                                                                  = 0x100
   2477 	CRYPT_ASN_ENCODING                                                             = 0x1
   2478 	CRYPT_ASYNC_RETRIEVAL                                                          = 0x10
   2479 	CRYPT_BLOB_VER3                                                                = 0x80
   2480 	CRYPT_CACHE_ONLY_RETRIEVAL                                                     = 0x2
   2481 	CRYPT_CHECK_FRESHNESS_TIME_VALIDITY                                            = 0x400
   2482 	CRYPT_CREATE_IV                                                                = 0x200
   2483 	CRYPT_CREATE_NEW_FLUSH_ENTRY                                                   = 0x10000000
   2484 	CRYPT_CREATE_SALT                                                              = 0x4
   2485 	CRYPT_DATA_KEY                                                                 = 0x800
   2486 	CRYPT_DECODE_ALLOC_FLAG                                                        = 0x8000
   2487 	CRYPT_DECODE_ENABLE_IA5CONVERSION_FLAG                                         = 100663296
   2488 	CRYPT_DECODE_ENABLE_PUNYCODE_FLAG                                              = 0x2000000
   2489 	CRYPT_DECODE_ENABLE_UTF8PERCENT_FLAG                                           = 0x4000000
   2490 	CRYPT_DECODE_NOCOPY_FLAG                                                       = 0x1
   2491 	CRYPT_DECODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG                                   = 0x8
   2492 	CRYPT_DECODE_SHARE_OID_STRING_FLAG                                             = 0x4
   2493 	CRYPT_DECODE_TO_BE_SIGNED_FLAG                                                 = 0x2
   2494 	CRYPT_DECRYPT                                                                  = 0x2
   2495 	CRYPT_DECRYPT_RSA_NO_PADDING_CHECK                                             = 0x20
   2496 	CRYPT_DEFAULT_CONTEXT_AUTO_RELEASE_FLAG                                        = 0x1
   2497 	CRYPT_DEFAULT_CONTEXT_CERT_SIGN_OID                                            = 1
   2498 	CRYPT_DEFAULT_CONTEXT_MULTI_CERT_SIGN_OID                                      = 2
   2499 	CRYPT_DEFAULT_CONTEXT_PROCESS_FLAG                                             = 0x2
   2500 	CRYPT_DEFAULT_OID                                                              = "DEFAULT"
   2501 	CRYPT_DELETEKEYSET                                                             = 0x10
   2502 	CRYPT_DELETE_DEFAULT                                                           = 0x4
   2503 	CRYPT_DELETE_KEYSET                                                            = 16
   2504 	CRYPT_DESTROYKEY                                                               = 0x4
   2505 	CRYPT_DOMAIN                                                                   = 2
   2506 	CRYPT_DONT_CACHE_RESULT                                                        = 0x8
   2507 	CRYPT_DONT_CHECK_TIME_VALIDITY                                                 = 0x200
   2508 	CRYPT_DONT_VERIFY_SIGNATURE                                                    = 0x100
   2509 	CRYPT_ECC_CMS_SHARED_INFO_SUPPPUBINFO_BYTE_LENGTH                              = 4
   2510 	CRYPT_ECC_PRIVATE_KEY_INFO_v1                                                  = 1
   2511 	CRYPT_ENABLE_FILE_RETRIEVAL                                                    = 0x08000000
   2512 	CRYPT_ENABLE_SSL_REVOCATION_RETRIEVAL                                          = 0x800000
   2513 	CRYPT_ENCODE_ALLOC_FLAG                                                        = 0x8000
   2514 	CRYPT_ENCODE_DECODE_NONE                                                       = 0
   2515 	CRYPT_ENCODE_ENABLE_IA5CONVERSION_FLAG                                         = 393216
   2516 	CRYPT_ENCODE_ENABLE_PUNYCODE_FLAG                                              = 0x20000
   2517 	CRYPT_ENCODE_ENABLE_UTF8PERCENT_FLAG                                           = 0x40000
   2518 	CRYPT_ENCODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG                                   = 0x8
   2519 	CRYPT_ENCRYPT                                                                  = 0x1
   2520 	CRYPT_ENCRYPT_ALG_OID_GROUP_ID                                                 = 2
   2521 	CRYPT_ENHKEY_USAGE_OID_GROUP_ID                                                = 7
   2522 	CRYPT_EXCLUSIVE                                                                = 1
   2523 	CRYPT_EXPORT                                                                   = 0x4
   2524 	CRYPT_EXPORTABLE                                                               = 0x1
   2525 	CRYPT_EXPORT_KEY                                                               = 0x40
   2526 	CRYPT_EXT_OR_ATTR_OID_GROUP_ID                                                 = 6
   2527 	CRYPT_FAILED                                                                   = 0
   2528 	CRYPT_FASTSGC                                                                  = 0x2
   2529 	CRYPT_FIND_MACHINE_KEYSET_FLAG                                                 = 0x2
   2530 	CRYPT_FIND_SILENT_KEYSET_FLAG                                                  = 0x40
   2531 	CRYPT_FIND_USER_KEYSET_FLAG                                                    = 0x1
   2532 	CRYPT_FIRST                                                                    = 1
   2533 	CRYPT_FIRST_ALG_OID_GROUP_ID                                                   = 1
   2534 	CRYPT_FLAG_IPSEC                                                               = 0x10
   2535 	CRYPT_FLAG_PCT1                                                                = 0x1
   2536 	CRYPT_FLAG_SIGNING                                                             = 0x20
   2537 	CRYPT_FLAG_SSL2                                                                = 0x2
   2538 	CRYPT_FLAG_SSL3                                                                = 0x4
   2539 	CRYPT_FLAG_TLS1                                                                = 0x8
   2540 	CRYPT_FORMAT_COMMA                                                             = 0x1000
   2541 	CRYPT_FORMAT_CRLF                                                              = 512
   2542 	CRYPT_FORMAT_OID                                                               = 0x4
   2543 	CRYPT_FORMAT_RDN_CRLF                                                          = 0x200
   2544 	CRYPT_FORMAT_RDN_REVERSE                                                       = 0x800
   2545 	CRYPT_FORMAT_RDN_SEMICOLON                                                     = 0x100
   2546 	CRYPT_FORMAT_RDN_UNQUOTE                                                       = 0x400
   2547 	CRYPT_FORMAT_SEMICOLON                                                         = 256
   2548 	CRYPT_FORMAT_SIMPLE                                                            = 0x1
   2549 	CRYPT_FORMAT_STR_MULTI_LINE                                                    = 0x1
   2550 	CRYPT_FORMAT_STR_NO_HEX                                                        = 0x10
   2551 	CRYPT_FORMAT_X509                                                              = 0x2
   2552 	CRYPT_GET_INSTALLED_OID_FUNC_FLAG                                              = 0x1
   2553 	CRYPT_GET_URL_FROM_AUTH_ATTRIBUTE                                              = 0x8
   2554 	CRYPT_GET_URL_FROM_EXTENSION                                                   = 0x2
   2555 	CRYPT_GET_URL_FROM_PROPERTY                                                    = 0x1
   2556 	CRYPT_GET_URL_FROM_UNAUTH_ATTRIBUTE                                            = 0x4
   2557 	CRYPT_HASH_ALG_OID_GROUP_ID                                                    = 1
   2558 	CRYPT_HTTP_POST_RETRIEVAL                                                      = 0x100000
   2559 	CRYPT_IMPL_HARDWARE                                                            = 1
   2560 	CRYPT_IMPL_MIXED                                                               = 3
   2561 	CRYPT_IMPL_REMOVABLE                                                           = 8
   2562 	CRYPT_IMPL_SOFTWARE                                                            = 2
   2563 	CRYPT_IMPL_UNKNOWN                                                             = 4
   2564 	CRYPT_IMPORT_KEY                                                               = 0x80
   2565 	CRYPT_INITIATOR                                                                = 0x40
   2566 	CRYPT_INSTALL_OID_FUNC_BEFORE_FLAG                                             = 1
   2567 	CRYPT_INSTALL_OID_INFO_BEFORE_FLAG                                             = 1
   2568 	CRYPT_IPSEC_HMAC_KEY                                                           = 0x100
   2569 	CRYPT_KDF_OID_GROUP_ID                                                         = 10
   2570 	CRYPT_KEEP_TIME_VALID                                                          = 0x80
   2571 	CRYPT_KEK                                                                      = 0x400
   2572 	CRYPT_KEYID_ALLOC_FLAG                                                         = 0x8000
   2573 	CRYPT_KEYID_DELETE_FLAG                                                        = 0x10
   2574 	CRYPT_KEYID_MACHINE_FLAG                                                       = 0x20
   2575 	CRYPT_KEYID_SET_NEW_FLAG                                                       = 0x2000
   2576 	CRYPT_KM                                                                       = 2
   2577 	CRYPT_LAST_ALG_OID_GROUP_ID                                                    = 4
   2578 	CRYPT_LAST_OID_GROUP_ID                                                        = 10
   2579 	CRYPT_LDAP_AREC_EXCLUSIVE_RETRIEVAL                                            = 0x40000
   2580 	CRYPT_LDAP_INSERT_ENTRY_ATTRIBUTE                                              = 0x8000
   2581 	CRYPT_LDAP_SCOPE_BASE_ONLY_RETRIEVAL                                           = 0x2000
   2582 	CRYPT_LDAP_SIGN_RETRIEVAL                                                      = 0x10000
   2583 	CRYPT_LITTLE_ENDIAN                                                            = 0x1
   2584 	CRYPT_LOCAL                                                                    = 1
   2585 	CRYPT_LOCALIZED_NAME_ENCODING_TYPE                                             = 0
   2586 	CRYPT_LOCALIZED_NAME_OID                                                       = "LocalizedNames"
   2587 	CRYPT_MAC                                                                      = 0x20
   2588 	CRYPT_MACHINE_DEFAULT                                                          = 0x1
   2589 	CRYPT_MACHINE_KEYSET                                                           = 0x20
   2590 	CRYPT_MATCH_ANY_ENCODING_TYPE                                                  = 0xffffffff
   2591 	CRYPT_MESSAGE_BARE_CONTENT_OUT_FLAG                                            = 0x1
   2592 	CRYPT_MESSAGE_ENCAPSULATED_CONTENT_OUT_FLAG                                    = 0x2
   2593 	CRYPT_MESSAGE_KEYID_RECIPIENT_FLAG                                             = 0x4
   2594 	CRYPT_MESSAGE_KEYID_SIGNER_FLAG                                                = 0x4
   2595 	CRYPT_MESSAGE_SILENT_KEYSET_FLAG                                               = 0x40
   2596 	CRYPT_MIN_DEPENDENCIES                                                         = 1
   2597 	CRYPT_MM                                                                       = 3
   2598 	CRYPT_MODE_CBC                                                                 = 1
   2599 	CRYPT_MODE_CBCI                                                                = 6
   2600 	CRYPT_MODE_CBCOFM                                                              = 9
   2601 	CRYPT_MODE_CBCOFMI                                                             = 10
   2602 	CRYPT_MODE_CFB                                                                 = 4
   2603 	CRYPT_MODE_CFBP                                                                = 7
   2604 	CRYPT_MODE_CTS                                                                 = 5
   2605 	CRYPT_MODE_ECB                                                                 = 2
   2606 	CRYPT_MODE_OFB                                                                 = 3
   2607 	CRYPT_MODE_OFBP                                                                = 8
   2608 	CRYPT_NDR_ENCODING                                                             = 0x2
   2609 	CRYPT_NEWKEYSET                                                                = 0x8
   2610 	CRYPT_NEXT                                                                     = 2
   2611 	CRYPT_NOHASHOID                                                                = 0x1
   2612 	CRYPT_NOT_MODIFIED_RETRIEVAL                                                   = 0x400000
   2613 	CRYPT_NO_AUTH_RETRIEVAL                                                        = 0x20000
   2614 	CRYPT_NO_OCSP_FAILOVER_TO_CRL_RETRIEVAL                                        = 0x2000000
   2615 	CRYPT_NO_SALT                                                                  = 0x10
   2616 	CRYPT_OAEP                                                                     = 0x40
   2617 	CRYPT_OCSP_ONLY_RETRIEVAL                                                      = 0x1000000
   2618 	CRYPT_OFFLINE_CHECK_RETRIEVAL                                                  = 0x4000
   2619 	CRYPT_OID_CREATE_COM_OBJECT_FUNC                                               = "CryptDllCreateCOMObject"
   2620 	CRYPT_OID_DECODE_OBJECT_EX_FUNC                                                = "CryptDllDecodeObjectEx"
   2621 	CRYPT_OID_DECODE_OBJECT_FUNC                                                   = "CryptDllDecodeObject"
   2622 	CRYPT_OID_DISABLE_SEARCH_DS_FLAG                                               = 0x80000000
   2623 	CRYPT_OID_ENCODE_OBJECT_EX_FUNC                                                = "CryptDllEncodeObjectEx"
   2624 	CRYPT_OID_ENCODE_OBJECT_FUNC                                                   = "CryptDllEncodeObject"
   2625 	CRYPT_OID_ENUM_PHYSICAL_STORE_FUNC                                             = "CertDllEnumPhysicalStore"
   2626 	CRYPT_OID_ENUM_SYSTEM_STORE_FUNC                                               = "CertDllEnumSystemStore"
   2627 	CRYPT_OID_EXPORT_PRIVATE_KEY_INFO_FUNC                                         = "CryptDllExportPrivateKeyInfoEx"
   2628 	CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_EX2_FUNC                                      = "CryptDllExportPublicKeyInfoEx2"
   2629 	CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_FUNC                                          = "CryptDllExportPublicKeyInfoEx"
   2630 	CRYPT_OID_EXTRACT_ENCODED_SIGNATURE_PARAMETERS_FUNC                            = "CryptDllExtractEncodedSignatureParameters"
   2631 	CRYPT_OID_FIND_LOCALIZED_NAME_FUNC                                             = "CryptDllFindLocalizedName"
   2632 	CRYPT_OID_FIND_OID_INFO_FUNC                                                   = "CryptDllFindOIDInfo"
   2633 	CRYPT_OID_FORMAT_OBJECT_FUNC                                                   = "CryptDllFormatObject"
   2634 	CRYPT_OID_IMPORT_PRIVATE_KEY_INFO_FUNC                                         = "CryptDllImportPrivateKeyInfoEx"
   2635 	CRYPT_OID_IMPORT_PUBLIC_KEY_INFO_FUNC                                          = "CryptDllImportPublicKeyInfoEx"
   2636 	CRYPT_OID_INFO_ALGID_KEY                                                       = 3
   2637 	CRYPT_OID_INFO_CNG_ALGID_KEY                                                   = 5
   2638 	CRYPT_OID_INFO_CNG_SIGN_KEY                                                    = 6
   2639 	CRYPT_OID_INFO_NAME_KEY                                                        = 2
   2640 	CRYPT_OID_INFO_OID_GROUP_BIT_LEN_MASK                                          = 0x0fff0000
   2641 	CRYPT_OID_INFO_OID_GROUP_BIT_LEN_SHIFT                                         = 16
   2642 	CRYPT_OID_INFO_OID_KEY                                                         = 1
   2643 	CRYPT_OID_INFO_OID_KEY_FLAGS_MASK                                              = 0xffff0000
   2644 	CRYPT_OID_INFO_PUBKEY_ENCRYPT_KEY_FLAG                                         = 0x40000000
   2645 	CRYPT_OID_INFO_PUBKEY_SIGN_KEY_FLAG                                            = 0x80000000
   2646 	CRYPT_OID_INFO_SIGN_KEY                                                        = 4
   2647 	CRYPT_OID_INHIBIT_SIGNATURE_FORMAT_FLAG                                        = 0x1
   2648 	CRYPT_OID_NO_NULL_ALGORITHM_PARA_FLAG                                          = 0x4
   2649 	CRYPT_OID_OPEN_STORE_PROV_FUNC                                                 = "CertDllOpenStoreProv"
   2650 	CRYPT_OID_OPEN_SYSTEM_STORE_PROV_FUNC                                          = "CertDllOpenSystemStoreProv"
   2651 	CRYPT_OID_PUBKEY_ENCRYPT_ONLY_FLAG                                             = 0x40000000
   2652 	CRYPT_OID_PUBKEY_SIGN_ONLY_FLAG                                                = 0x80000000
   2653 	CRYPT_OID_REGISTER_PHYSICAL_STORE_FUNC                                         = "CertDllRegisterPhysicalStore"
   2654 	CRYPT_OID_REGISTER_SYSTEM_STORE_FUNC                                           = "CertDllRegisterSystemStore"
   2655 	CRYPT_OID_REGPATH                                                              = "Software\\Microsoft\\Cryptography\\OID"
   2656 	CRYPT_OID_REG_ENCODING_TYPE_PREFIX                                             = "EncodingType "
   2657 	CRYPT_OID_REG_FUNC_NAME_VALUE_NAME_A                                           = "FuncName"
   2658 	CRYPT_OID_SIGN_AND_ENCODE_HASH_FUNC                                            = "CryptDllSignAndEncodeHash"
   2659 	CRYPT_OID_UNREGISTER_PHYSICAL_STORE_FUNC                                       = "CertDllUnregisterPhysicalStore"
   2660 	CRYPT_OID_UNREGISTER_SYSTEM_STORE_FUNC                                         = "CertDllUnregisterSystemStore"
   2661 	CRYPT_OID_USE_CURVE_NAME_FOR_ENCODE_FLAG                                       = 0x20000000
   2662 	CRYPT_OID_USE_CURVE_PARAMETERS_FOR_ENCODE_FLAG                                 = 0x10000000
   2663 	CRYPT_OID_USE_PUBKEY_PARA_FOR_PKCS7_FLAG                                       = 0x2
   2664 	CRYPT_OID_VERIFY_CERTIFICATE_CHAIN_POLICY_FUNC                                 = "CertDllVerifyCertificateChainPolicy"
   2665 	CRYPT_OID_VERIFY_CTL_USAGE_FUNC                                                = "CertDllVerifyCTLUsage"
   2666 	CRYPT_OID_VERIFY_ENCODED_SIGNATURE_FUNC                                        = "CryptDllVerifyEncodedSignature"
   2667 	CRYPT_OID_VERIFY_REVOCATION_FUNC                                               = "CertDllVerifyRevocation"
   2668 	CRYPT_ONLINE                                                                   = 0x80
   2669 	CRYPT_OVERRIDE                                                                 = 65536
   2670 	CRYPT_OVERWRITE                                                                = 1
   2671 	CRYPT_OWF_REPL_LM_HASH                                                         = 0x1
   2672 	CRYPT_POLICY_OID_GROUP_ID                                                      = 8
   2673 	CRYPT_PREGEN                                                                   = 0x40
   2674 	CRYPT_PRIORITY_BOTTOM                                                          = 4294967295
   2675 	CRYPT_PRIORITY_TOP                                                             = 0
   2676 	CRYPT_PROCESS_ISOLATE                                                          = 65536
   2677 	CRYPT_PROXY_CACHE_RETRIEVAL                                                    = 0x200000
   2678 	CRYPT_PSTORE                                                                   = 0x2
   2679 	CRYPT_PUBKEY_ALG_OID_GROUP_ID                                                  = 3
   2680 	CRYPT_RANDOM_QUERY_STRING_RETRIEVAL                                            = 0x4000000
   2681 	CRYPT_RC2_128BIT_VERSION                                                       = 58
   2682 	CRYPT_RC2_40BIT_VERSION                                                        = 160
   2683 	CRYPT_RC2_56BIT_VERSION                                                        = 52
   2684 	CRYPT_RC2_64BIT_VERSION                                                        = 120
   2685 	CRYPT_RDN_ATTR_OID_GROUP_ID                                                    = 5
   2686 	CRYPT_READ                                                                     = 0x8
   2687 	CRYPT_RECIPIENT                                                                = 0x10
   2688 	CRYPT_REGISTER_FIRST_INDEX                                                     = 0
   2689 	CRYPT_REGISTER_LAST_INDEX                                                      = 0xffffffff
   2690 	CRYPT_RETRIEVE_MAX_ERROR_CONTENT_LENGTH                                        = 0x1000
   2691 	CRYPT_RETRIEVE_MULTIPLE_OBJECTS                                                = 0x1
   2692 	CRYPT_SECRETDIGEST                                                             = 0x1
   2693 	CRYPT_SEC_DESCR                                                                = 0x1
   2694 	CRYPT_SERVER                                                                   = 0x400
   2695 	CRYPT_SF                                                                       = 0x100
   2696 	CRYPT_SGC                                                                      = 0x1
   2697 	CRYPT_SGCKEY                                                                   = 0x2000
   2698 	CRYPT_SGC_ENUM                                                                 = 4
   2699 	CRYPT_SIGN_ALG_OID_GROUP_ID                                                    = 4
   2700 	CRYPT_SILENT                                                                   = 0x40
   2701 	CRYPT_SORTED_CTL_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG                         = 0x10000
   2702 	CRYPT_SSL2_FALLBACK                                                            = 0x2
   2703 	CRYPT_STICKY_CACHE_RETRIEVAL                                                   = 0x1000
   2704 	CRYPT_STRING_ANY                                                               = 0x00000007
   2705 	CRYPT_STRING_BASE64                                                            = 0x1
   2706 	CRYPT_STRING_BASE64HEADER                                                      = 0x0
   2707 	CRYPT_STRING_BASE64REQUESTHEADER                                               = 0x00000003
   2708 	CRYPT_STRING_BASE64URI                                                         = 0x0000000d
   2709 	CRYPT_STRING_BASE64X509CRLHEADER                                               = 0x00000009
   2710 	CRYPT_STRING_BASE64_ANY                                                        = 0x00000006
   2711 	CRYPT_STRING_BINARY                                                            = 0x2
   2712 	CRYPT_STRING_ENCODEMASK                                                        = 0x000000ff
   2713 	CRYPT_STRING_HASHDATA                                                          = 0x10000000
   2714 	CRYPT_STRING_HEX                                                               = 0x4
   2715 	CRYPT_STRING_HEXADDR                                                           = 0x0000000a
   2716 	CRYPT_STRING_HEXASCII                                                          = 0x00000005
   2717 	CRYPT_STRING_HEXASCIIADDR                                                      = 0x0000000b
   2718 	CRYPT_STRING_HEXRAW                                                            = 0x0000000c
   2719 	CRYPT_STRING_HEX_ANY                                                           = 0x8
   2720 	CRYPT_STRING_NOCR                                                              = 0x80000000
   2721 	CRYPT_STRING_NOCRLF                                                            = 0x40000000
   2722 	CRYPT_STRING_PERCENTESCAPE                                                     = 0x08000000
   2723 	CRYPT_STRING_RESERVED100                                                       = 0x00000100
   2724 	CRYPT_STRING_RESERVED200                                                       = 0x00000200
   2725 	CRYPT_STRING_STRICT                                                            = 0x20000000
   2726 	CRYPT_SUCCEED                                                                  = 1
   2727 	CRYPT_TEMPLATE_OID_GROUP_ID                                                    = 9
   2728 	CRYPT_TYPE2_FORMAT                                                             = 0x2
   2729 	CRYPT_UI_PROMPT                                                                = 0x4
   2730 	CRYPT_UM                                                                       = 1
   2731 	CRYPT_UNICODE_NAME_DECODE_DISABLE_IE4_UTF8_FLAG                                = 16777216
   2732 	CRYPT_UNICODE_NAME_ENCODE_DISABLE_CHECK_TYPE_FLAG                              = 1073741824
   2733 	CRYPT_UNICODE_NAME_ENCODE_ENABLE_T61_UNICODE_FLAG                              = 2147483648
   2734 	CRYPT_UNICODE_NAME_ENCODE_ENABLE_UTF8_UNICODE_FLAG                             = 536870912
   2735 	CRYPT_UNICODE_NAME_ENCODE_FORCE_UTF8_UNICODE_FLAG                              = 268435456
   2736 	CRYPT_UPDATE_KEY                                                               = 0x8
   2737 	CRYPT_USERDATA                                                                 = 1
   2738 	CRYPT_USER_DEFAULT                                                             = 0x2
   2739 	CRYPT_USER_KEYSET                                                              = 0x1000
   2740 	CRYPT_USER_PROTECTED                                                           = 0x2
   2741 	CRYPT_USER_PROTECTED_STRONG                                                    = 0x100000
   2742 	CRYPT_VERIFYCONTEXT                                                            = 0xf0000000
   2743 	CRYPT_VERIFY_CERT_SIGN_DISABLE_MD2_MD4_FLAG                                    = 0x1
   2744 	CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT                                             = 2
   2745 	CRYPT_VERIFY_CERT_SIGN_ISSUER_CHAIN                                            = 3
   2746 	CRYPT_VERIFY_CERT_SIGN_ISSUER_NULL                                             = 4
   2747 	CRYPT_VERIFY_CERT_SIGN_ISSUER_PUBKEY                                           = 1
   2748 	CRYPT_VERIFY_CERT_SIGN_RETURN_STRONG_PROPERTIES_FLAG                           = 0x4
   2749 	CRYPT_VERIFY_CERT_SIGN_SET_STRONG_PROPERTIES_FLAG                              = 0x2
   2750 	CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB                                            = 1
   2751 	CRYPT_VERIFY_CERT_SIGN_SUBJECT_CERT                                            = 2
   2752 	CRYPT_VERIFY_CERT_SIGN_SUBJECT_CRL                                             = 3
   2753 	CRYPT_VERIFY_CERT_SIGN_SUBJECT_OCSP_BASIC_SIGNED_RESPONSE                      = 4
   2754 	CRYPT_VERIFY_CONTEXT_SIGNATURE                                                 = 0x20
   2755 	CRYPT_VERIFY_DATA_HASH                                                         = 0x40
   2756 	CRYPT_VOLATILE                                                                 = 0x1000
   2757 	CRYPT_WIRE_ONLY_RETRIEVAL                                                      = 0x4
   2758 	CRYPT_WRITE                                                                    = 0x10
   2759 	CRYPT_X931_FORMAT                                                              = 0x4
   2760 	CRYPT_X942_COUNTER_BYTE_LENGTH                                                 = 4
   2761 	CRYPT_X942_KEY_LENGTH_BYTE_LENGTH                                              = 4
   2762 	CRYPT_X942_PUB_INFO_BYTE_LENGTH                                                = 64
   2763 	CRYPT_Y_ONLY                                                                   = 0x1
   2764 	CSOUND_SYSTEM                                                                  = 16
   2765 	CSTR_EQUAL                                                                     = 2
   2766 	CSTR_GREATER_THAN                                                              = 3
   2767 	CSTR_LESS_THAN                                                                 = 1
   2768 	CS_BYTEALIGNCLIENT                                                             = 0x1000
   2769 	CS_BYTEALIGNWINDOW                                                             = 0x2000
   2770 	CS_CLASSDC                                                                     = 0x0040
   2771 	CS_DBLCLKS                                                                     = 0x0008
   2772 	CS_DELETE_TRANSFORM                                                            = 3
   2773 	CS_DISABLE                                                                     = 2
   2774 	CS_DROPSHADOW                                                                  = 0x00020000
   2775 	CS_ENABLE                                                                      = 1
   2776 	CS_E_FIRST                                                                     = 2147746148
   2777 	CS_E_LAST                                                                      = 2147746159
   2778 	CS_GLOBALCLASS                                                                 = 0x4000
   2779 	CS_HREDRAW                                                                     = 0x0002
   2780 	CS_IME                                                                         = 0x00010000
   2781 	CS_INSERTCHAR                                                                  = 0x2000
   2782 	CS_NOCLOSE                                                                     = 0x0200
   2783 	CS_NOMOVECARET                                                                 = 0x4000
   2784 	CS_OWNDC                                                                       = 0x0020
   2785 	CS_PARENTDC                                                                    = 0x0080
   2786 	CS_SAVEBITS                                                                    = 0x0800
   2787 	CS_VREDRAW                                                                     = 0x0001
   2788 	CTLCOLOR_BTN                                                                   = 3
   2789 	CTLCOLOR_DLG                                                                   = 4
   2790 	CTLCOLOR_EDIT                                                                  = 1
   2791 	CTLCOLOR_LISTBOX                                                               = 2
   2792 	CTLCOLOR_MAX                                                                   = 7
   2793 	CTLCOLOR_MSGBOX                                                                = 0
   2794 	CTLCOLOR_SCROLLBAR                                                             = 5
   2795 	CTLCOLOR_STATIC                                                                = 6
   2796 	CTL_ANY_SUBJECT_TYPE                                                           = 1
   2797 	CTL_CERT_SUBJECT_TYPE                                                          = 2
   2798 	CTL_ENTRY_FROM_PROP_CHAIN_FLAG                                                 = 0x1
   2799 	CTL_FIND_ANY                                                                   = 0
   2800 	CTL_FIND_EXISTING                                                              = 5
   2801 	CTL_FIND_MD5_HASH                                                              = 2
   2802 	CTL_FIND_NO_LIST_ID_CBDATA                                                     = 0xffffffff
   2803 	CTL_FIND_SAME_USAGE_FLAG                                                       = 0x1
   2804 	CTL_FIND_SHA1_HASH                                                             = 1
   2805 	CTL_FIND_SUBJECT                                                               = 4
   2806 	CTL_FIND_USAGE                                                                 = 3
   2807 	CTL_V1                                                                         = 0
   2808 	CTRL_BREAK_EVENT                                                               = 1
   2809 	CTRL_CLOSE_EVENT                                                               = 2
   2810 	CTRL_C_EVENT                                                                   = 0
   2811 	CTRL_LOGOFF_EVENT                                                              = 5
   2812 	CTRL_SHUTDOWN_EVENT                                                            = 6
   2813 	CTRY_ALBANIA                                                                   = 355
   2814 	CTRY_ALGERIA                                                                   = 213
   2815 	CTRY_ARGENTINA                                                                 = 54
   2816 	CTRY_ARMENIA                                                                   = 374
   2817 	CTRY_AUSTRALIA                                                                 = 61
   2818 	CTRY_AUSTRIA                                                                   = 43
   2819 	CTRY_AZERBAIJAN                                                                = 994
   2820 	CTRY_BAHRAIN                                                                   = 973
   2821 	CTRY_BELARUS                                                                   = 375
   2822 	CTRY_BELGIUM                                                                   = 32
   2823 	CTRY_BELIZE                                                                    = 501
   2824 	CTRY_BOLIVIA                                                                   = 591
   2825 	CTRY_BRAZIL                                                                    = 55
   2826 	CTRY_BRUNEI_DARUSSALAM                                                         = 673
   2827 	CTRY_BULGARIA                                                                  = 359
   2828 	CTRY_CANADA                                                                    = 2
   2829 	CTRY_CARIBBEAN                                                                 = 1
   2830 	CTRY_CHILE                                                                     = 56
   2831 	CTRY_COLOMBIA                                                                  = 57
   2832 	CTRY_COSTA_RICA                                                                = 506
   2833 	CTRY_CROATIA                                                                   = 385
   2834 	CTRY_CZECH                                                                     = 420
   2835 	CTRY_DEFAULT                                                                   = 0
   2836 	CTRY_DENMARK                                                                   = 45
   2837 	CTRY_DOMINICAN_REPUBLIC                                                        = 1
   2838 	CTRY_ECUADOR                                                                   = 593
   2839 	CTRY_EGYPT                                                                     = 20
   2840 	CTRY_EL_SALVADOR                                                               = 503
   2841 	CTRY_ESTONIA                                                                   = 372
   2842 	CTRY_FAEROE_ISLANDS                                                            = 298
   2843 	CTRY_FINLAND                                                                   = 358
   2844 	CTRY_FRANCE                                                                    = 33
   2845 	CTRY_GEORGIA                                                                   = 995
   2846 	CTRY_GERMANY                                                                   = 49
   2847 	CTRY_GREECE                                                                    = 30
   2848 	CTRY_GUATEMALA                                                                 = 502
   2849 	CTRY_HONDURAS                                                                  = 504
   2850 	CTRY_HONG_KONG                                                                 = 852
   2851 	CTRY_HUNGARY                                                                   = 36
   2852 	CTRY_ICELAND                                                                   = 354
   2853 	CTRY_INDIA                                                                     = 91
   2854 	CTRY_INDONESIA                                                                 = 62
   2855 	CTRY_IRAN                                                                      = 981
   2856 	CTRY_IRAQ                                                                      = 964
   2857 	CTRY_IRELAND                                                                   = 353
   2858 	CTRY_ISRAEL                                                                    = 972
   2859 	CTRY_ITALY                                                                     = 39
   2860 	CTRY_JAMAICA                                                                   = 1
   2861 	CTRY_JAPAN                                                                     = 81
   2862 	CTRY_JORDAN                                                                    = 962
   2863 	CTRY_KAZAKSTAN                                                                 = 7
   2864 	CTRY_KENYA                                                                     = 254
   2865 	CTRY_KUWAIT                                                                    = 965
   2866 	CTRY_KYRGYZSTAN                                                                = 996
   2867 	CTRY_LATVIA                                                                    = 371
   2868 	CTRY_LEBANON                                                                   = 961
   2869 	CTRY_LIBYA                                                                     = 218
   2870 	CTRY_LIECHTENSTEIN                                                             = 41
   2871 	CTRY_LITHUANIA                                                                 = 370
   2872 	CTRY_LUXEMBOURG                                                                = 352
   2873 	CTRY_MACAU                                                                     = 853
   2874 	CTRY_MACEDONIA                                                                 = 389
   2875 	CTRY_MALAYSIA                                                                  = 60
   2876 	CTRY_MALDIVES                                                                  = 960
   2877 	CTRY_MEXICO                                                                    = 52
   2878 	CTRY_MONACO                                                                    = 33
   2879 	CTRY_MONGOLIA                                                                  = 976
   2880 	CTRY_MOROCCO                                                                   = 212
   2881 	CTRY_NETHERLANDS                                                               = 31
   2882 	CTRY_NEW_ZEALAND                                                               = 64
   2883 	CTRY_NICARAGUA                                                                 = 505
   2884 	CTRY_NORWAY                                                                    = 47
   2885 	CTRY_OMAN                                                                      = 968
   2886 	CTRY_PAKISTAN                                                                  = 92
   2887 	CTRY_PANAMA                                                                    = 507
   2888 	CTRY_PARAGUAY                                                                  = 595
   2889 	CTRY_PERU                                                                      = 51
   2890 	CTRY_PHILIPPINES                                                               = 63
   2891 	CTRY_POLAND                                                                    = 48
   2892 	CTRY_PORTUGAL                                                                  = 351
   2893 	CTRY_PRCHINA                                                                   = 86
   2894 	CTRY_PUERTO_RICO                                                               = 1
   2895 	CTRY_QATAR                                                                     = 974
   2896 	CTRY_ROMANIA                                                                   = 40
   2897 	CTRY_RUSSIA                                                                    = 7
   2898 	CTRY_SAUDI_ARABIA                                                              = 966
   2899 	CTRY_SERBIA                                                                    = 381
   2900 	CTRY_SINGAPORE                                                                 = 65
   2901 	CTRY_SLOVAK                                                                    = 421
   2902 	CTRY_SLOVENIA                                                                  = 386
   2903 	CTRY_SOUTH_AFRICA                                                              = 27
   2904 	CTRY_SOUTH_KOREA                                                               = 82
   2905 	CTRY_SPAIN                                                                     = 34
   2906 	CTRY_SWEDEN                                                                    = 46
   2907 	CTRY_SWITZERLAND                                                               = 41
   2908 	CTRY_SYRIA                                                                     = 963
   2909 	CTRY_TAIWAN                                                                    = 886
   2910 	CTRY_TATARSTAN                                                                 = 7
   2911 	CTRY_THAILAND                                                                  = 66
   2912 	CTRY_TRINIDAD_Y_TOBAGO                                                         = 1
   2913 	CTRY_TUNISIA                                                                   = 216
   2914 	CTRY_TURKEY                                                                    = 90
   2915 	CTRY_UAE                                                                       = 971
   2916 	CTRY_UKRAINE                                                                   = 380
   2917 	CTRY_UNITED_KINGDOM                                                            = 44
   2918 	CTRY_UNITED_STATES                                                             = 1
   2919 	CTRY_URUGUAY                                                                   = 598
   2920 	CTRY_UZBEKISTAN                                                                = 7
   2921 	CTRY_VENEZUELA                                                                 = 58
   2922 	CTRY_VIET_NAM                                                                  = 84
   2923 	CTRY_YEMEN                                                                     = 967
   2924 	CTRY_ZIMBABWE                                                                  = 263
   2925 	CT_CTYPE1                                                                      = 0x00000001
   2926 	CT_CTYPE2                                                                      = 0x00000002
   2927 	CT_CTYPE3                                                                      = 0x00000004
   2928 	CURRENT_IMPORT_REDIRECTION_VERSION                                             = 1
   2929 	CURSOR_FAULT                                                                   = 4
   2930 	CURSOR_INVALID                                                                 = 1
   2931 	CURSOR_REQUIRESEEK                                                             = 3
   2932 	CURSOR_SHOWING                                                                 = 0x00000001
   2933 	CURSOR_SKIPNEXT                                                                = 2
   2934 	CURSOR_VALID                                                                   = 0
   2935 	CURTYPE_BTREE                                                                  = 0
   2936 	CURTYPE_PSEUDO                                                                 = 3
   2937 	CURTYPE_SORTER                                                                 = 1
   2938 	CURTYPE_VTAB                                                                   = 2
   2939 	CURVECAPS                                                                      = 28
   2940 	CUR_BLOB_VERSION                                                               = 2
   2941 	CWCSTORAGENAME                                                                 = 32
   2942 	CWF_CREATE_ONLY                                                                = 0x00000001
   2943 	CWMO_MAX_HANDLES                                                               = 56
   2944 	CWP_ALL                                                                        = 0x0000
   2945 	CWP_SKIPDISABLED                                                               = 0x0002
   2946 	CWP_SKIPINVISIBLE                                                              = 0x0001
   2947 	CWP_SKIPTRANSPARENT                                                            = 0x0004
   2948 	DACL_SECURITY_INFORMATION                                                      = 4
   2949 	DATA_E_FIRST                                                                   = 2147746096
   2950 	DATA_E_LAST                                                                    = 2147746111
   2951 	DATA_S_FIRST                                                                   = 262448
   2952 	DATA_S_LAST                                                                    = 262463
   2953 	DATE_LONGDATE                                                                  = 0x00000002
   2954 	DATE_LTRREADING                                                                = 0x00000010
   2955 	DATE_RTLREADING                                                                = 0x00000020
   2956 	DATE_SHORTDATE                                                                 = 0x00000001
   2957 	DATE_USE_ALT_CALENDAR                                                          = 0x00000004
   2958 	DATE_YEARMONTH                                                                 = 0x00000008
   2959 	DBFLAG_EncodingFixed                                                           = 0x0040
   2960 	DBFLAG_InternalFunc                                                            = 0x0020
   2961 	DBFLAG_PreferBuiltin                                                           = 0x0002
   2962 	DBFLAG_SchemaChange                                                            = 0x0001
   2963 	DBFLAG_SchemaKnownOk                                                           = 0x0010
   2964 	DBFLAG_Vacuum                                                                  = 0x0004
   2965 	DBFLAG_VacuumInto                                                              = 0x0008
   2966 	DB_ResetWanted                                                                 = 0x0008
   2967 	DB_SchemaLoaded                                                                = 0x0001
   2968 	DB_UnresetViews                                                                = 0x0002
   2969 	DCBA_FACEDOWNCENTER                                                            = 0x0101
   2970 	DCBA_FACEDOWNLEFT                                                              = 0x0102
   2971 	DCBA_FACEDOWNNONE                                                              = 0x0100
   2972 	DCBA_FACEDOWNRIGHT                                                             = 0x0103
   2973 	DCBA_FACEUPCENTER                                                              = 0x0001
   2974 	DCBA_FACEUPLEFT                                                                = 0x0002
   2975 	DCBA_FACEUPNONE                                                                = 0x0000
   2976 	DCBA_FACEUPRIGHT                                                               = 0x0003
   2977 	DCB_ACCUMULATE                                                                 = 0x0002
   2978 	DCB_DIRTY                                                                      = 2
   2979 	DCB_DISABLE                                                                    = 0x0008
   2980 	DCB_ENABLE                                                                     = 0x0004
   2981 	DCB_RESET                                                                      = 0x0001
   2982 	DCB_SET                                                                        = 3
   2983 	DCE_C_ERROR_STRING_LEN                                                         = 256
   2984 	DCOMSCM_ACTIVATION_DISALLOW_UNSECURE_CALL                                      = 0x2
   2985 	DCOMSCM_ACTIVATION_USE_ALL_AUTHNSERVICES                                       = 0x1
   2986 	DCOMSCM_PING_DISALLOW_UNSECURE_CALL                                            = 0x20
   2987 	DCOMSCM_PING_USE_MID_AUTHNSERVICE                                              = 0x10
   2988 	DCOMSCM_RESOLVE_DISALLOW_UNSECURE_CALL                                         = 0x8
   2989 	DCOMSCM_RESOLVE_USE_ALL_AUTHNSERVICES                                          = 0x4
   2990 	DCTT_BITMAP                                                                    = 1
   2991 	DCTT_DOWNLOAD                                                                  = 2
   2992 	DCTT_DOWNLOAD_OUTLINE                                                          = 8
   2993 	DCTT_SUBDEV                                                                    = 4
   2994 	DCX_CACHE                                                                      = 2
   2995 	DCX_CLIPCHILDREN                                                               = 8
   2996 	DCX_CLIPSIBLINGS                                                               = 16
   2997 	DCX_EXCLUDERGN                                                                 = 64
   2998 	DCX_EXCLUDEUPDATE                                                              = 256
   2999 	DCX_INTERSECTRGN                                                               = 128
   3000 	DCX_INTERSECTUPDATE                                                            = 512
   3001 	DCX_LOCKWINDOWUPDATE                                                           = 1024
   3002 	DCX_NORESETATTRS                                                               = 4
   3003 	DCX_PARENTCLIP                                                                 = 32
   3004 	DCX_VALIDATE                                                                   = 2097152
   3005 	DCX_WINDOW                                                                     = 1
   3006 	DC_ACTIVE                                                                      = 0x0001
   3007 	DC_BINADJUST                                                                   = 19
   3008 	DC_BINNAMES                                                                    = 12
   3009 	DC_BINS                                                                        = 6
   3010 	DC_BRUSH                                                                       = 18
   3011 	DC_BUTTONS                                                                     = 0x1000
   3012 	DC_COLLATE                                                                     = 22
   3013 	DC_COLORDEVICE                                                                 = 32
   3014 	DC_COPIES                                                                      = 18
   3015 	DC_DATATYPE_PRODUCED                                                           = 21
   3016 	DC_DRIVER                                                                      = 11
   3017 	DC_DUPLEX                                                                      = 7
   3018 	DC_EMF_COMPLIANT                                                               = 20
   3019 	DC_ENUMRESOLUTIONS                                                             = 13
   3020 	DC_EXTRA                                                                       = 9
   3021 	DC_FIELDS                                                                      = 1
   3022 	DC_FILEDEPENDENCIES                                                            = 14
   3023 	DC_GRADIENT                                                                    = 0x0020
   3024 	DC_HASDEFID                                                                    = 0x534B
   3025 	DC_ICON                                                                        = 0x0004
   3026 	DC_INBUTTON                                                                    = 0x0010
   3027 	DC_MANUFACTURER                                                                = 23
   3028 	DC_MAXEXTENT                                                                   = 5
   3029 	DC_MEDIAREADY                                                                  = 29
   3030 	DC_MEDIATYPENAMES                                                              = 34
   3031 	DC_MEDIATYPES                                                                  = 35
   3032 	DC_MINEXTENT                                                                   = 4
   3033 	DC_MODEL                                                                       = 24
   3034 	DC_NUP                                                                         = 33
   3035 	DC_ORIENTATION                                                                 = 17
   3036 	DC_PAPERNAMES                                                                  = 16
   3037 	DC_PAPERS                                                                      = 2
   3038 	DC_PAPERSIZE                                                                   = 3
   3039 	DC_PEN                                                                         = 19
   3040 	DC_PERSONALITY                                                                 = 25
   3041 	DC_PRINTERMEM                                                                  = 28
   3042 	DC_PRINTRATE                                                                   = 26
   3043 	DC_PRINTRATEPPM                                                                = 31
   3044 	DC_PRINTRATEUNIT                                                               = 27
   3045 	DC_SIZE                                                                        = 8
   3046 	DC_SMALLCAP                                                                    = 0x0002
   3047 	DC_STAPLE                                                                      = 30
   3048 	DC_TEXT                                                                        = 0x0008
   3049 	DC_TRUETYPE                                                                    = 15
   3050 	DC_VERSION                                                                     = 10
   3051 	DDD_EXACT_MATCH_ON_REMOVE                                                      = 0x00000004
   3052 	DDD_LUID_BROADCAST_DRIVE                                                       = 0x00000010
   3053 	DDD_NO_BROADCAST_SYSTEM                                                        = 0x00000008
   3054 	DDD_RAW_TARGET_PATH                                                            = 0x00000001
   3055 	DDD_REMOVE_DEFINITION                                                          = 0x00000002
   3056 	DDE_FACK                                                                       = 0x8000
   3057 	DDE_FACKREQ                                                                    = 0x8000
   3058 	DDE_FACKRESERVED                                                               = -49408
   3059 	DDE_FADVRESERVED                                                               = -49153
   3060 	DDE_FAPPSTATUS                                                                 = 0x00ff
   3061 	DDE_FBUSY                                                                      = 0x4000
   3062 	DDE_FDATRESERVED                                                               = -45057
   3063 	DDE_FDEFERUPD                                                                  = 0x4000
   3064 	DDE_FNOTPROCESSED                                                              = 0x0000
   3065 	DDE_FPOKRESERVED                                                               = -8193
   3066 	DDE_FRELEASE                                                                   = 0x2000
   3067 	DDE_FREQUESTED                                                                 = 0x1000
   3068 	DDL_ARCHIVE                                                                    = 0x0020
   3069 	DDL_DIRECTORY                                                                  = 0x0010
   3070 	DDL_DRIVES                                                                     = 0x4000
   3071 	DDL_EXCLUSIVE                                                                  = 0x8000
   3072 	DDL_HIDDEN                                                                     = 0x0002
   3073 	DDL_POSTMSGS                                                                   = 0x2000
   3074 	DDL_READONLY                                                                   = 0x0001
   3075 	DDL_READWRITE                                                                  = 0x0000
   3076 	DDL_SYSTEM                                                                     = 0x0004
   3077 	DD_DEFDRAGDELAY                                                                = 200
   3078 	DD_DEFDRAGMINDIST                                                              = 2
   3079 	DD_DEFSCROLLDELAY                                                              = 50
   3080 	DD_DEFSCROLLINSET                                                              = 11
   3081 	DD_DEFSCROLLINTERVAL                                                           = 50
   3082 	DEACTIVATE_ACTCTX_FLAG_FORCE_EARLY_DEACTIVATION                                = 1
   3083 	DEBUG_ONLY_THIS_PROCESS                                                        = 0x2
   3084 	DEBUG_PROCESS                                                                  = 0x1
   3085 	DECLSPEC_ADDRSAFE                                                              = 0
   3086 	DECLSPEC_DEPRECATED_DDK                                                        = 0
   3087 	DECLSPEC_NOVTABLE                                                              = 0
   3088 	DEFAULT_CHARSET                                                                = 1
   3089 	DEFAULT_GUI_FONT                                                               = 17
   3090 	DEFAULT_PALETTE                                                                = 15
   3091 	DEFAULT_PITCH                                                                  = 0
   3092 	DEFAULT_QUALITY                                                                = 0
   3093 	DEFAULT_UNREACHABLE                                                            = 0
   3094 	DEFINDE_LPTYPEINFO                                                             = 0
   3095 	DEFINED_DISPID_MEMBERID                                                        = 0
   3096 	DEFINED_LPCREATETYPELIB                                                        = 0
   3097 	DEFINED_LPDISPATCH                                                             = 0
   3098 	DEFINED_LPTYPECOMP                                                             = 0
   3099 	DEFINED_LPTYPELIB                                                              = 0
   3100 	DEFINED_LPUINT                                                                 = 0
   3101 	DEFINE_LPCREATETYPEINFO                                                        = 0
   3102 	DEF_PRIORITY                                                                   = 1
   3103 	DELETE                                                                         = 65536
   3104 	DEPRECATE_SUPPORTED                                                            = 0
   3105 	DEREGISTERED                                                                   = 0x05
   3106 	DESKTOPHORZRES                                                                 = 118
   3107 	DESKTOPVERTRES                                                                 = 117
   3108 	DESKTOP_CREATEMENU                                                             = 4
   3109 	DESKTOP_CREATEWINDOW                                                           = 2
   3110 	DESKTOP_ENUMERATE                                                              = 64
   3111 	DESKTOP_HOOKCONTROL                                                            = 8
   3112 	DESKTOP_JOURNALPLAYBACK                                                        = 32
   3113 	DESKTOP_JOURNALRECORD                                                          = 16
   3114 	DESKTOP_READOBJECTS                                                            = 1
   3115 	DESKTOP_SWITCHDESKTOP                                                          = 256
   3116 	DESKTOP_WRITEOBJECTS                                                           = 128
   3117 	DETACHED_PROCESS                                                               = 0x8
   3118 	DEVICEDATA                                                                     = 19
   3119 	DEVICE_DEFAULT_FONT                                                            = 14
   3120 	DEVICE_FONTTYPE                                                                = 0x002
   3121 	DEVICE_NOTIFY_ALL_INTERFACE_CLASSES                                            = 0x00000004
   3122 	DEVICE_NOTIFY_SERVICE_HANDLE                                                   = 0x00000001
   3123 	DEVICE_NOTIFY_WINDOW_HANDLE                                                    = 0x00000000
   3124 	DFCS_ADJUSTRECT                                                                = 0x2000
   3125 	DFCS_BUTTON3STATE                                                              = 0x0008
   3126 	DFCS_BUTTONCHECK                                                               = 0x0000
   3127 	DFCS_BUTTONPUSH                                                                = 0x0010
   3128 	DFCS_BUTTONRADIO                                                               = 0x0004
   3129 	DFCS_BUTTONRADIOIMAGE                                                          = 0x0001
   3130 	DFCS_BUTTONRADIOMASK                                                           = 0x0002
   3131 	DFCS_CAPTIONCLOSE                                                              = 0x0000
   3132 	DFCS_CAPTIONHELP                                                               = 0x0004
   3133 	DFCS_CAPTIONMAX                                                                = 0x0002
   3134 	DFCS_CAPTIONMIN                                                                = 0x0001
   3135 	DFCS_CAPTIONRESTORE                                                            = 0x0003
   3136 	DFCS_CHECKED                                                                   = 0x0400
   3137 	DFCS_FLAT                                                                      = 0x4000
   3138 	DFCS_HOT                                                                       = 0x1000
   3139 	DFCS_INACTIVE                                                                  = 0x0100
   3140 	DFCS_MENUARROW                                                                 = 0x0000
   3141 	DFCS_MENUARROWRIGHT                                                            = 0x0004
   3142 	DFCS_MENUBULLET                                                                = 0x0002
   3143 	DFCS_MENUCHECK                                                                 = 0x0001
   3144 	DFCS_MONO                                                                      = 0x8000
   3145 	DFCS_PUSHED                                                                    = 0x0200
   3146 	DFCS_SCROLLCOMBOBOX                                                            = 0x0005
   3147 	DFCS_SCROLLDOWN                                                                = 0x0001
   3148 	DFCS_SCROLLLEFT                                                                = 0x0002
   3149 	DFCS_SCROLLRIGHT                                                               = 0x0003
   3150 	DFCS_SCROLLSIZEGRIP                                                            = 0x0008
   3151 	DFCS_SCROLLSIZEGRIPRIGHT                                                       = 0x0010
   3152 	DFCS_SCROLLUP                                                                  = 0x0000
   3153 	DFCS_TRANSPARENT                                                               = 0x0800
   3154 	DFC_BUTTON                                                                     = 4
   3155 	DFC_CAPTION                                                                    = 1
   3156 	DFC_MENU                                                                       = 2
   3157 	DFC_POPUPMENU                                                                  = 5
   3158 	DFC_SCROLL                                                                     = 3
   3159 	DF_ALLOWOTHERACCOUNTHOOK                                                       = 1
   3160 	DIAGNOSTIC_REASON_DETAILED_STRING                                              = 0x00000002
   3161 	DIAGNOSTIC_REASON_INVALID_FLAGS                                                = -2147483652
   3162 	DIAGNOSTIC_REASON_NOT_SPECIFIED                                                = 0x80000000
   3163 	DIAGNOSTIC_REASON_SIMPLE_STRING                                                = 0x00000001
   3164 	DIAGNOSTIC_REASON_VERSION                                                      = 0
   3165 	DIALOPTION_BILLING                                                             = 0x00000040
   3166 	DIALOPTION_DIALTONE                                                            = 0x00000100
   3167 	DIALOPTION_QUIET                                                               = 0x00000080
   3168 	DIB_PAL_COLORS                                                                 = 1
   3169 	DIB_RGB_COLORS                                                                 = 0
   3170 	DIFFERENCE                                                                     = 11
   3171 	DIRECT_MODE                                                                    = 0
   3172 	DISABLE_MAX_PRIVILEGE                                                          = 0x1
   3173 	DISABLE_NEWLINE_AUTO_RETURN                                                    = 0x8
   3174 	DISABLE_SMART                                                                  = 0xD9
   3175 	DISCHARGE_POLICY_CRITICAL                                                      = 0
   3176 	DISCHARGE_POLICY_LOW                                                           = 1
   3177 	DISC_NO_FORCE                                                                  = 0x00000040
   3178 	DISC_UPDATE_PROFILE                                                            = 0x00000001
   3179 	DISK_BINNING                                                                   = 3
   3180 	DISK_LOGGING_DUMP                                                              = 2
   3181 	DISK_LOGGING_START                                                             = 0
   3182 	DISK_LOGGING_STOP                                                              = 1
   3183 	DISPATCH_METHOD                                                                = 0x1
   3184 	DISPATCH_PROPERTYGET                                                           = 0x2
   3185 	DISPATCH_PROPERTYPUT                                                           = 0x4
   3186 	DISPATCH_PROPERTYPUTREF                                                        = 0x8
   3187 	DISPID_COLLECT                                                                 = -8
   3188 	DISPID_CONSTRUCTOR                                                             = -6
   3189 	DISPID_DESTRUCTOR                                                              = -7
   3190 	DISPID_EVALUATE                                                                = -5
   3191 	DISPID_NEWENUM                                                                 = -4
   3192 	DISPID_PROPERTYPUT                                                             = -3
   3193 	DISPID_UNKNOWN                                                                 = -1
   3194 	DISPID_VALUE                                                                   = 0
   3195 	DISPLAY_DEVICE_ACTIVE                                                          = 0x00000001
   3196 	DISPLAY_DEVICE_ATTACHED                                                        = 0x00000002
   3197 	DISPLAY_DEVICE_ATTACHED_TO_DESKTOP                                             = 0x00000001
   3198 	DISPLAY_DEVICE_DISCONNECT                                                      = 0x02000000
   3199 	DISPLAY_DEVICE_MIRRORING_DRIVER                                                = 0x00000008
   3200 	DISPLAY_DEVICE_MODESPRUNED                                                     = 0x08000000
   3201 	DISPLAY_DEVICE_MULTI_DRIVER                                                    = 0x00000002
   3202 	DISPLAY_DEVICE_PRIMARY_DEVICE                                                  = 0x00000004
   3203 	DISPLAY_DEVICE_RDPUDD                                                          = 0x01000000
   3204 	DISPLAY_DEVICE_REMOTE                                                          = 0x04000000
   3205 	DISPLAY_DEVICE_REMOVABLE                                                       = 0x00000020
   3206 	DISPLAY_DEVICE_TS_COMPATIBLE                                                   = 0x00200000
   3207 	DISPLAY_DEVICE_VGA_COMPATIBLE                                                  = 0x00000010
   3208 	DISP_CHANGE_BADDUALVIEW                                                        = -6
   3209 	DISP_CHANGE_BADFLAGS                                                           = -4
   3210 	DISP_CHANGE_BADMODE                                                            = -2
   3211 	DISP_CHANGE_BADPARAM                                                           = -5
   3212 	DISP_CHANGE_FAILED                                                             = -1
   3213 	DISP_CHANGE_NOTUPDATED                                                         = -3
   3214 	DISP_CHANGE_RESTART                                                            = 1
   3215 	DISP_CHANGE_SUCCESSFUL                                                         = 0
   3216 	DI_APPBANDING                                                                  = 0x00000001
   3217 	DI_CHANNEL                                                                     = 1
   3218 	DI_COMPAT                                                                      = 0x0004
   3219 	DI_DEFAULTSIZE                                                                 = 0x0008
   3220 	DI_IMAGE                                                                       = 0x0002
   3221 	DI_MASK                                                                        = 0x0001
   3222 	DI_MEMORYMAP_WRITE                                                             = 0x00000001
   3223 	DI_NOMIRROR                                                                    = 0x0010
   3224 	DI_NORMAL                                                                      = 0x0003
   3225 	DI_READ_SPOOL_JOB                                                              = 3
   3226 	DI_ROPS_READ_DESTINATION                                                       = 0x00000002
   3227 	DKGRAY_BRUSH                                                                   = 3
   3228 	DLGC_BUTTON                                                                    = 0x2000
   3229 	DLGC_DEFPUSHBUTTON                                                             = 0x0010
   3230 	DLGC_HASSETSEL                                                                 = 0x0008
   3231 	DLGC_RADIOBUTTON                                                               = 0x0040
   3232 	DLGC_STATIC                                                                    = 0x0100
   3233 	DLGC_UNDEFPUSHBUTTON                                                           = 0x0020
   3234 	DLGC_WANTALLKEYS                                                               = 0x0004
   3235 	DLGC_WANTARROWS                                                                = 0x0001
   3236 	DLGC_WANTCHARS                                                                 = 0x0080
   3237 	DLGC_WANTMESSAGE                                                               = 0x0004
   3238 	DLGC_WANTTAB                                                                   = 0x0002
   3239 	DLGWINDOWEXTRA                                                                 = 30
   3240 	DLL_PROCESS_ATTACH                                                             = 1
   3241 	DLL_PROCESS_DETACH                                                             = 0
   3242 	DLL_PROCESS_VERIFIER                                                           = 4
   3243 	DLL_THREAD_ATTACH                                                              = 2
   3244 	DLL_THREAD_DETACH                                                              = 3
   3245 	DMBIN_AUTO                                                                     = 7
   3246 	DMBIN_CASSETTE                                                                 = 14
   3247 	DMBIN_ENVELOPE                                                                 = 5
   3248 	DMBIN_ENVMANUAL                                                                = 6
   3249 	DMBIN_FIRST                                                                    = 1
   3250 	DMBIN_FORMSOURCE                                                               = 15
   3251 	DMBIN_LARGECAPACITY                                                            = 11
   3252 	DMBIN_LARGEFMT                                                                 = 10
   3253 	DMBIN_LAST                                                                     = 15
   3254 	DMBIN_LOWER                                                                    = 2
   3255 	DMBIN_MANUAL                                                                   = 4
   3256 	DMBIN_MIDDLE                                                                   = 3
   3257 	DMBIN_ONLYONE                                                                  = 1
   3258 	DMBIN_SMALLFMT                                                                 = 9
   3259 	DMBIN_TRACTOR                                                                  = 8
   3260 	DMBIN_UPPER                                                                    = 1
   3261 	DMBIN_USER                                                                     = 256
   3262 	DMCOLLATE_FALSE                                                                = 0
   3263 	DMCOLLATE_TRUE                                                                 = 1
   3264 	DMCOLOR_COLOR                                                                  = 2
   3265 	DMCOLOR_MONOCHROME                                                             = 1
   3266 	DMDFO_CENTER                                                                   = 2
   3267 	DMDFO_DEFAULT                                                                  = 0
   3268 	DMDFO_STRETCH                                                                  = 1
   3269 	DMDISPLAYFLAGS_TEXTMODE                                                        = 0x00000004
   3270 	DMDITHER_COARSE                                                                = 2
   3271 	DMDITHER_ERRORDIFFUSION                                                        = 5
   3272 	DMDITHER_FINE                                                                  = 3
   3273 	DMDITHER_GRAYSCALE                                                             = 10
   3274 	DMDITHER_LINEART                                                               = 4
   3275 	DMDITHER_NONE                                                                  = 1
   3276 	DMDITHER_RESERVED6                                                             = 6
   3277 	DMDITHER_RESERVED7                                                             = 7
   3278 	DMDITHER_RESERVED8                                                             = 8
   3279 	DMDITHER_RESERVED9                                                             = 9
   3280 	DMDITHER_USER                                                                  = 256
   3281 	DMDO_180                                                                       = 2
   3282 	DMDO_270                                                                       = 3
   3283 	DMDO_90                                                                        = 1
   3284 	DMDO_DEFAULT                                                                   = 0
   3285 	DMDUP_HORIZONTAL                                                               = 3
   3286 	DMDUP_SIMPLEX                                                                  = 1
   3287 	DMDUP_VERTICAL                                                                 = 2
   3288 	DMICMMETHOD_DEVICE                                                             = 4
   3289 	DMICMMETHOD_DRIVER                                                             = 3
   3290 	DMICMMETHOD_NONE                                                               = 1
   3291 	DMICMMETHOD_SYSTEM                                                             = 2
   3292 	DMICMMETHOD_USER                                                               = 256
   3293 	DMICM_ABS_COLORIMETRIC                                                         = 4
   3294 	DMICM_COLORIMETRIC                                                             = 3
   3295 	DMICM_CONTRAST                                                                 = 2
   3296 	DMICM_SATURATE                                                                 = 1
   3297 	DMICM_USER                                                                     = 256
   3298 	DMLERR_ADVACKTIMEOUT                                                           = 0x4000
   3299 	DMLERR_BUSY                                                                    = 0x4001
   3300 	DMLERR_DATAACKTIMEOUT                                                          = 0x4002
   3301 	DMLERR_DLL_NOT_INITIALIZED                                                     = 0x4003
   3302 	DMLERR_DLL_USAGE                                                               = 0x4004
   3303 	DMLERR_EXECACKTIMEOUT                                                          = 0x4005
   3304 	DMLERR_FIRST                                                                   = 0x4000
   3305 	DMLERR_INVALIDPARAMETER                                                        = 0x4006
   3306 	DMLERR_LAST                                                                    = 0x4011
   3307 	DMLERR_LOW_MEMORY                                                              = 0x4007
   3308 	DMLERR_MEMORY_ERROR                                                            = 0x4008
   3309 	DMLERR_NOTPROCESSED                                                            = 0x4009
   3310 	DMLERR_NO_CONV_ESTABLISHED                                                     = 0x400a
   3311 	DMLERR_NO_ERROR                                                                = 0
   3312 	DMLERR_POKEACKTIMEOUT                                                          = 0x400b
   3313 	DMLERR_POSTMSG_FAILED                                                          = 0x400c
   3314 	DMLERR_REENTRANCY                                                              = 0x400d
   3315 	DMLERR_SERVER_DIED                                                             = 0x400e
   3316 	DMLERR_SYS_ERROR                                                               = 0x400f
   3317 	DMLERR_UNADVACKTIMEOUT                                                         = 0x4010
   3318 	DMLERR_UNFOUND_QUEUE_ID                                                        = 0x4011
   3319 	DMMEDIA_GLOSSY                                                                 = 3
   3320 	DMMEDIA_STANDARD                                                               = 1
   3321 	DMMEDIA_TRANSPARENCY                                                           = 2
   3322 	DMMEDIA_USER                                                                   = 256
   3323 	DMNUP_ONEUP                                                                    = 2
   3324 	DMNUP_SYSTEM                                                                   = 1
   3325 	DMORIENT_LANDSCAPE                                                             = 2
   3326 	DMORIENT_PORTRAIT                                                              = 1
   3327 	DMPAPER_10X11                                                                  = 45
   3328 	DMPAPER_10X14                                                                  = 16
   3329 	DMPAPER_11X17                                                                  = 17
   3330 	DMPAPER_12X11                                                                  = 90
   3331 	DMPAPER_15X11                                                                  = 46
   3332 	DMPAPER_9X11                                                                   = 44
   3333 	DMPAPER_A2                                                                     = 66
   3334 	DMPAPER_A3                                                                     = 8
   3335 	DMPAPER_A3_EXTRA                                                               = 63
   3336 	DMPAPER_A3_EXTRA_TRANSVERSE                                                    = 68
   3337 	DMPAPER_A3_ROTATED                                                             = 76
   3338 	DMPAPER_A3_TRANSVERSE                                                          = 67
   3339 	DMPAPER_A4                                                                     = 9
   3340 	DMPAPER_A4SMALL                                                                = 10
   3341 	DMPAPER_A4_EXTRA                                                               = 53
   3342 	DMPAPER_A4_PLUS                                                                = 60
   3343 	DMPAPER_A4_ROTATED                                                             = 77
   3344 	DMPAPER_A4_TRANSVERSE                                                          = 55
   3345 	DMPAPER_A5                                                                     = 11
   3346 	DMPAPER_A5_EXTRA                                                               = 64
   3347 	DMPAPER_A5_ROTATED                                                             = 78
   3348 	DMPAPER_A5_TRANSVERSE                                                          = 61
   3349 	DMPAPER_A6                                                                     = 70
   3350 	DMPAPER_A6_ROTATED                                                             = 83
   3351 	DMPAPER_A_PLUS                                                                 = 57
   3352 	DMPAPER_B4                                                                     = 12
   3353 	DMPAPER_B4_JIS_ROTATED                                                         = 79
   3354 	DMPAPER_B5                                                                     = 13
   3355 	DMPAPER_B5_EXTRA                                                               = 65
   3356 	DMPAPER_B5_JIS_ROTATED                                                         = 80
   3357 	DMPAPER_B5_TRANSVERSE                                                          = 62
   3358 	DMPAPER_B6_JIS                                                                 = 88
   3359 	DMPAPER_B6_JIS_ROTATED                                                         = 89
   3360 	DMPAPER_B_PLUS                                                                 = 58
   3361 	DMPAPER_CSHEET                                                                 = 24
   3362 	DMPAPER_DBL_JAPANESE_POSTCARD                                                  = 69
   3363 	DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED                                          = 82
   3364 	DMPAPER_DSHEET                                                                 = 25
   3365 	DMPAPER_ENV_10                                                                 = 20
   3366 	DMPAPER_ENV_11                                                                 = 21
   3367 	DMPAPER_ENV_12                                                                 = 22
   3368 	DMPAPER_ENV_14                                                                 = 23
   3369 	DMPAPER_ENV_9                                                                  = 19
   3370 	DMPAPER_ENV_B4                                                                 = 33
   3371 	DMPAPER_ENV_B5                                                                 = 34
   3372 	DMPAPER_ENV_B6                                                                 = 35
   3373 	DMPAPER_ENV_C3                                                                 = 29
   3374 	DMPAPER_ENV_C4                                                                 = 30
   3375 	DMPAPER_ENV_C5                                                                 = 28
   3376 	DMPAPER_ENV_C6                                                                 = 31
   3377 	DMPAPER_ENV_C65                                                                = 32
   3378 	DMPAPER_ENV_DL                                                                 = 27
   3379 	DMPAPER_ENV_INVITE                                                             = 47
   3380 	DMPAPER_ENV_ITALY                                                              = 36
   3381 	DMPAPER_ENV_MONARCH                                                            = 37
   3382 	DMPAPER_ENV_PERSONAL                                                           = 38
   3383 	DMPAPER_ESHEET                                                                 = 26
   3384 	DMPAPER_EXECUTIVE                                                              = 7
   3385 	DMPAPER_FANFOLD_LGL_GERMAN                                                     = 41
   3386 	DMPAPER_FANFOLD_STD_GERMAN                                                     = 40
   3387 	DMPAPER_FANFOLD_US                                                             = 39
   3388 	DMPAPER_FIRST                                                                  = 1
   3389 	DMPAPER_FOLIO                                                                  = 14
   3390 	DMPAPER_ISO_B4                                                                 = 42
   3391 	DMPAPER_JAPANESE_POSTCARD                                                      = 43
   3392 	DMPAPER_JAPANESE_POSTCARD_ROTATED                                              = 81
   3393 	DMPAPER_JENV_CHOU3                                                             = 73
   3394 	DMPAPER_JENV_CHOU3_ROTATED                                                     = 86
   3395 	DMPAPER_JENV_CHOU4                                                             = 74
   3396 	DMPAPER_JENV_CHOU4_ROTATED                                                     = 87
   3397 	DMPAPER_JENV_KAKU2                                                             = 71
   3398 	DMPAPER_JENV_KAKU2_ROTATED                                                     = 84
   3399 	DMPAPER_JENV_KAKU3                                                             = 72
   3400 	DMPAPER_JENV_KAKU3_ROTATED                                                     = 85
   3401 	DMPAPER_JENV_YOU4                                                              = 91
   3402 	DMPAPER_JENV_YOU4_ROTATED                                                      = 92
   3403 	DMPAPER_LAST                                                                   = 118
   3404 	DMPAPER_LEDGER                                                                 = 4
   3405 	DMPAPER_LEGAL                                                                  = 5
   3406 	DMPAPER_LEGAL_EXTRA                                                            = 51
   3407 	DMPAPER_LETTER                                                                 = 1
   3408 	DMPAPER_LETTERSMALL                                                            = 2
   3409 	DMPAPER_LETTER_EXTRA                                                           = 50
   3410 	DMPAPER_LETTER_EXTRA_TRANSVERSE                                                = 56
   3411 	DMPAPER_LETTER_PLUS                                                            = 59
   3412 	DMPAPER_LETTER_ROTATED                                                         = 75
   3413 	DMPAPER_LETTER_TRANSVERSE                                                      = 54
   3414 	DMPAPER_NOTE                                                                   = 18
   3415 	DMPAPER_P16K                                                                   = 93
   3416 	DMPAPER_P16K_ROTATED                                                           = 106
   3417 	DMPAPER_P32K                                                                   = 94
   3418 	DMPAPER_P32KBIG                                                                = 95
   3419 	DMPAPER_P32KBIG_ROTATED                                                        = 108
   3420 	DMPAPER_P32K_ROTATED                                                           = 107
   3421 	DMPAPER_PENV_1                                                                 = 96
   3422 	DMPAPER_PENV_10                                                                = 105
   3423 	DMPAPER_PENV_10_ROTATED                                                        = 118
   3424 	DMPAPER_PENV_1_ROTATED                                                         = 109
   3425 	DMPAPER_PENV_2                                                                 = 97
   3426 	DMPAPER_PENV_2_ROTATED                                                         = 110
   3427 	DMPAPER_PENV_3                                                                 = 98
   3428 	DMPAPER_PENV_3_ROTATED                                                         = 111
   3429 	DMPAPER_PENV_4                                                                 = 99
   3430 	DMPAPER_PENV_4_ROTATED                                                         = 112
   3431 	DMPAPER_PENV_5                                                                 = 100
   3432 	DMPAPER_PENV_5_ROTATED                                                         = 113
   3433 	DMPAPER_PENV_6                                                                 = 101
   3434 	DMPAPER_PENV_6_ROTATED                                                         = 114
   3435 	DMPAPER_PENV_7                                                                 = 102
   3436 	DMPAPER_PENV_7_ROTATED                                                         = 115
   3437 	DMPAPER_PENV_8                                                                 = 103
   3438 	DMPAPER_PENV_8_ROTATED                                                         = 116
   3439 	DMPAPER_PENV_9                                                                 = 104
   3440 	DMPAPER_PENV_9_ROTATED                                                         = 117
   3441 	DMPAPER_QUARTO                                                                 = 15
   3442 	DMPAPER_RESERVED_48                                                            = 48
   3443 	DMPAPER_RESERVED_49                                                            = 49
   3444 	DMPAPER_STATEMENT                                                              = 6
   3445 	DMPAPER_TABLOID                                                                = 3
   3446 	DMPAPER_TABLOID_EXTRA                                                          = 52
   3447 	DMPAPER_USER                                                                   = 256
   3448 	DMRES_DRAFT                                                                    = -1
   3449 	DMRES_HIGH                                                                     = -4
   3450 	DMRES_LOW                                                                      = -2
   3451 	DMRES_MEDIUM                                                                   = -3
   3452 	DMTT_BITMAP                                                                    = 1
   3453 	DMTT_DOWNLOAD                                                                  = 2
   3454 	DMTT_DOWNLOAD_OUTLINE                                                          = 4
   3455 	DMTT_SUBDEV                                                                    = 3
   3456 	DM_BITSPERPEL                                                                  = 262144
   3457 	DM_COLLATE                                                                     = 32768
   3458 	DM_COLOR                                                                       = 2048
   3459 	DM_COPIES                                                                      = 256
   3460 	DM_COPY                                                                        = 2
   3461 	DM_DEFAULTSOURCE                                                               = 512
   3462 	DM_DISPLAYFIXEDOUTPUT                                                          = 536870912
   3463 	DM_DISPLAYFLAGS                                                                = 2097152
   3464 	DM_DISPLAYFREQUENCY                                                            = 4194304
   3465 	DM_DISPLAYORIENTATION                                                          = 128
   3466 	DM_DITHERTYPE                                                                  = 67108864
   3467 	DM_DUPLEX                                                                      = 4096
   3468 	DM_FORMNAME                                                                    = 65536
   3469 	DM_GETDEFID                                                                    = 1024
   3470 	DM_ICMINTENT                                                                   = 16777216
   3471 	DM_ICMMETHOD                                                                   = 8388608
   3472 	DM_INTERLACED                                                                  = 0x00000002
   3473 	DM_IN_BUFFER                                                                   = 8
   3474 	DM_IN_PROMPT                                                                   = 4
   3475 	DM_LOGPIXELS                                                                   = 131072
   3476 	DM_MEDIATYPE                                                                   = 33554432
   3477 	DM_MODIFY                                                                      = 8
   3478 	DM_NUP                                                                         = 64
   3479 	DM_ORIENTATION                                                                 = 1
   3480 	DM_OUT_BUFFER                                                                  = 2
   3481 	DM_OUT_DEFAULT                                                                 = 1
   3482 	DM_PANNINGHEIGHT                                                               = 268435456
   3483 	DM_PANNINGWIDTH                                                                = 134217728
   3484 	DM_PAPERLENGTH                                                                 = 4
   3485 	DM_PAPERSIZE                                                                   = 2
   3486 	DM_PAPERWIDTH                                                                  = 8
   3487 	DM_PELSHEIGHT                                                                  = 1048576
   3488 	DM_PELSWIDTH                                                                   = 524288
   3489 	DM_POSITION                                                                    = 32
   3490 	DM_PRINTQUALITY                                                                = 1024
   3491 	DM_PROMPT                                                                      = 4
   3492 	DM_REPOSITION                                                                  = 1026
   3493 	DM_SCALE                                                                       = 16
   3494 	DM_SETDEFID                                                                    = 1025
   3495 	DM_SPECVERSION                                                                 = 0x0401
   3496 	DM_TTOPTION                                                                    = 16384
   3497 	DM_UPDATE                                                                      = 1
   3498 	DM_YRESOLUTION                                                                 = 8192
   3499 	DNS_ERROR_AUTOZONE_ALREADY_EXISTS                                              = 9610
   3500 	DNS_ERROR_AXFR                                                                 = 9752
   3501 	DNS_ERROR_BAD_PACKET                                                           = 9502
   3502 	DNS_ERROR_CANNOT_FIND_ROOT_HINTS                                               = 9564
   3503 	DNS_ERROR_CNAME_COLLISION                                                      = 9709
   3504 	DNS_ERROR_CNAME_LOOP                                                           = 9707
   3505 	DNS_ERROR_DATABASE_BASE                                                        = 9700
   3506 	DNS_ERROR_DATAFILE_BASE                                                        = 9650
   3507 	DNS_ERROR_DATAFILE_OPEN_FAILURE                                                = 9653
   3508 	DNS_ERROR_DATAFILE_PARSING                                                     = 9655
   3509 	DNS_ERROR_DP_ALREADY_ENLISTED                                                  = 9904
   3510 	DNS_ERROR_DP_ALREADY_EXISTS                                                    = 9902
   3511 	DNS_ERROR_DP_BASE                                                              = 9900
   3512 	DNS_ERROR_DP_DOES_NOT_EXIST                                                    = 9901
   3513 	DNS_ERROR_DP_FSMO_ERROR                                                        = 9906
   3514 	DNS_ERROR_DP_NOT_AVAILABLE                                                     = 9905
   3515 	DNS_ERROR_DP_NOT_ENLISTED                                                      = 9903
   3516 	DNS_ERROR_DS_UNAVAILABLE                                                       = 9717
   3517 	DNS_ERROR_DS_ZONE_ALREADY_EXISTS                                               = 9718
   3518 	DNS_ERROR_FILE_WRITEBACK_FAILED                                                = 9654
   3519 	DNS_ERROR_FORWARDER_ALREADY_EXISTS                                             = 9619
   3520 	DNS_ERROR_GENERAL_API_BASE                                                     = 9550
   3521 	DNS_ERROR_INCONSISTENT_ROOT_HINTS                                              = 9565
   3522 	DNS_ERROR_INVALID_DATA                                                         = 13
   3523 	DNS_ERROR_INVALID_DATAFILE_NAME                                                = 9652
   3524 	DNS_ERROR_INVALID_IP_ADDRESS                                                   = 9552
   3525 	DNS_ERROR_INVALID_NAME                                                         = 123
   3526 	DNS_ERROR_INVALID_NAME_CHAR                                                    = 9560
   3527 	DNS_ERROR_INVALID_PROPERTY                                                     = 9553
   3528 	DNS_ERROR_INVALID_TYPE                                                         = 9551
   3529 	DNS_ERROR_INVALID_ZONE_OPERATION                                               = 9603
   3530 	DNS_ERROR_INVALID_ZONE_TYPE                                                    = 9611
   3531 	DNS_ERROR_MASK                                                                 = 0x00002328
   3532 	DNS_ERROR_NAME_DOES_NOT_EXIST                                                  = 9714
   3533 	DNS_ERROR_NAME_NOT_IN_ZONE                                                     = 9706
   3534 	DNS_ERROR_NBSTAT_INIT_FAILED                                                   = 9617
   3535 	DNS_ERROR_NEED_SECONDARY_ADDRESSES                                             = 9614
   3536 	DNS_ERROR_NEED_WINS_SERVERS                                                    = 9616
   3537 	DNS_ERROR_NODE_CREATION_FAILED                                                 = 9703
   3538 	DNS_ERROR_NODE_IS_CNAME                                                        = 9708
   3539 	DNS_ERROR_NON_RFC_NAME                                                         = 9556
   3540 	DNS_ERROR_NOT_ALLOWED_ON_ROOT_SERVER                                           = 9562
   3541 	DNS_ERROR_NOT_ALLOWED_UNDER_DELEGATION                                         = 9563
   3542 	DNS_ERROR_NOT_UNIQUE                                                           = 9555
   3543 	DNS_ERROR_NO_BOOTFILE_IF_DS_ZONE                                               = 9719
   3544 	DNS_ERROR_NO_CREATE_CACHE_DATA                                                 = 9713
   3545 	DNS_ERROR_NO_DNS_SERVERS                                                       = 9852
   3546 	DNS_ERROR_NO_MEMORY                                                            = 14
   3547 	DNS_ERROR_NO_PACKET                                                            = 9503
   3548 	DNS_ERROR_NO_TCPIP                                                             = 9851
   3549 	DNS_ERROR_NO_ZONE_INFO                                                         = 9602
   3550 	DNS_ERROR_NUMERIC_NAME                                                         = 9561
   3551 	DNS_ERROR_OPERATION_BASE                                                       = 9750
   3552 	DNS_ERROR_PACKET_FMT_BASE                                                      = 9500
   3553 	DNS_ERROR_PRIMARY_REQUIRES_DATAFILE                                            = 9651
   3554 	DNS_ERROR_RCODE                                                                = 9504
   3555 	DNS_ERROR_RCODE_BADKEY                                                         = 9017
   3556 	DNS_ERROR_RCODE_BADSIG                                                         = 9016
   3557 	DNS_ERROR_RCODE_BADTIME                                                        = 9018
   3558 	DNS_ERROR_RCODE_FORMAT_ERROR                                                   = 9001
   3559 	DNS_ERROR_RCODE_LAST                                                           = 9018
   3560 	DNS_ERROR_RCODE_NAME_ERROR                                                     = 9003
   3561 	DNS_ERROR_RCODE_NOTAUTH                                                        = 9009
   3562 	DNS_ERROR_RCODE_NOTZONE                                                        = 9010
   3563 	DNS_ERROR_RCODE_NOT_IMPLEMENTED                                                = 9004
   3564 	DNS_ERROR_RCODE_NO_ERROR                                                       = 0
   3565 	DNS_ERROR_RCODE_NXRRSET                                                        = 9008
   3566 	DNS_ERROR_RCODE_REFUSED                                                        = 9005
   3567 	DNS_ERROR_RCODE_SERVER_FAILURE                                                 = 9002
   3568 	DNS_ERROR_RCODE_YXDOMAIN                                                       = 9006
   3569 	DNS_ERROR_RCODE_YXRRSET                                                        = 9007
   3570 	DNS_ERROR_RECORD_ALREADY_EXISTS                                                = 9711
   3571 	DNS_ERROR_RECORD_DOES_NOT_EXIST                                                = 9701
   3572 	DNS_ERROR_RECORD_FORMAT                                                        = 9702
   3573 	DNS_ERROR_RECORD_ONLY_AT_ZONE_ROOT                                             = 9710
   3574 	DNS_ERROR_RECORD_TIMED_OUT                                                     = 9705
   3575 	DNS_ERROR_RESPONSE_CODES_BASE                                                  = 9000
   3576 	DNS_ERROR_SECONDARY_DATA                                                       = 9712
   3577 	DNS_ERROR_SECONDARY_REQUIRES_MASTER_IP                                         = 9612
   3578 	DNS_ERROR_SECURE_BASE                                                          = 9800
   3579 	DNS_ERROR_SETUP_BASE                                                           = 9850
   3580 	DNS_ERROR_SOA_DELETE_INVALID                                                   = 9618
   3581 	DNS_ERROR_TRY_AGAIN_LATER                                                      = 9554
   3582 	DNS_ERROR_UNKNOWN_RECORD_TYPE                                                  = 9704
   3583 	DNS_ERROR_UNSECURE_PACKET                                                      = 9505
   3584 	DNS_ERROR_WINS_INIT_FAILED                                                     = 9615
   3585 	DNS_ERROR_ZONE_ALREADY_EXISTS                                                  = 9609
   3586 	DNS_ERROR_ZONE_BASE                                                            = 9600
   3587 	DNS_ERROR_ZONE_CONFIGURATION_ERROR                                             = 9604
   3588 	DNS_ERROR_ZONE_CREATION_FAILED                                                 = 9608
   3589 	DNS_ERROR_ZONE_DOES_NOT_EXIST                                                  = 9601
   3590 	DNS_ERROR_ZONE_HAS_NO_NS_RECORDS                                               = 9606
   3591 	DNS_ERROR_ZONE_HAS_NO_SOA_RECORD                                               = 9605
   3592 	DNS_ERROR_ZONE_IS_SHUTDOWN                                                     = 9621
   3593 	DNS_ERROR_ZONE_LOCKED                                                          = 9607
   3594 	DNS_ERROR_ZONE_NOT_SECONDARY                                                   = 9613
   3595 	DNS_ERROR_ZONE_REQUIRES_MASTER_IP                                              = 9620
   3596 	DNS_FILTEROFF                                                                  = 0x0008
   3597 	DNS_FILTERON                                                                   = 0x0004
   3598 	DNS_INFO_ADDED_LOCAL_WINS                                                      = 9753
   3599 	DNS_INFO_AXFR_COMPLETE                                                         = 9751
   3600 	DNS_INFO_NO_RECORDS                                                            = 9501
   3601 	DNS_REGISTER                                                                   = 0x0001
   3602 	DNS_STATUS_CONTINUE_NEEDED                                                     = 9801
   3603 	DNS_STATUS_DOTTED_NAME                                                         = 9558
   3604 	DNS_STATUS_FQDN                                                                = 9557
   3605 	DNS_STATUS_PACKET_UNSECURE                                                     = 9505
   3606 	DNS_STATUS_SINGLE_PART_NAME                                                    = 9559
   3607 	DNS_UNREGISTER                                                                 = 0x0002
   3608 	DNS_WARNING_DOMAIN_UNDELETED                                                   = 9716
   3609 	DNS_WARNING_PTR_CREATE_FAILED                                                  = 9715
   3610 	DN_DEFAULTPRN                                                                  = 0x1
   3611 	DOCKINFO_DOCKED                                                                = 2
   3612 	DOCKINFO_UNDOCKED                                                              = 1
   3613 	DOCKINFO_USER_DOCKED                                                           = 6
   3614 	DOCKINFO_USER_SUPPLIED                                                         = 4
   3615 	DOCKINFO_USER_UNDOCKED                                                         = 5
   3616 	DOF_DIRECTORY                                                                  = 0x8003
   3617 	DOF_DOCUMENT                                                                   = 0x8002
   3618 	DOF_EXECUTABLE                                                                 = 0x8001
   3619 	DOF_MULTIPLE                                                                   = 0x8004
   3620 	DOF_PROGMAN                                                                    = 0x0001
   3621 	DOF_SHELLDATA                                                                  = 0x0002
   3622 	DOMAIN                                                                         = 1
   3623 	DOMAIN_ALIAS_RID_ACCESS_CONTROL_ASSISTANCE_OPS                                 = 579
   3624 	DOMAIN_ALIAS_RID_ACCOUNT_OPS                                                   = 548
   3625 	DOMAIN_ALIAS_RID_ADMINS                                                        = 544
   3626 	DOMAIN_ALIAS_RID_AUTHORIZATIONACCESS                                           = 560
   3627 	DOMAIN_ALIAS_RID_BACKUP_OPS                                                    = 551
   3628 	DOMAIN_ALIAS_RID_CACHEABLE_PRINCIPALS_GROUP                                    = 571
   3629 	DOMAIN_ALIAS_RID_CERTSVC_DCOM_ACCESS_GROUP                                     = 574
   3630 	DOMAIN_ALIAS_RID_CRYPTO_OPERATORS                                              = 569
   3631 	DOMAIN_ALIAS_RID_DCOM_USERS                                                    = 562
   3632 	DOMAIN_ALIAS_RID_EVENT_LOG_READERS_GROUP                                       = 573
   3633 	DOMAIN_ALIAS_RID_GUESTS                                                        = 546
   3634 	DOMAIN_ALIAS_RID_HYPER_V_ADMINS                                                = 578
   3635 	DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS                                = 557
   3636 	DOMAIN_ALIAS_RID_IUSERS                                                        = 568
   3637 	DOMAIN_ALIAS_RID_LOGGING_USERS                                                 = 559
   3638 	DOMAIN_ALIAS_RID_MONITORING_USERS                                              = 558
   3639 	DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS                                     = 556
   3640 	DOMAIN_ALIAS_RID_NON_CACHEABLE_PRINCIPALS_GROUP                                = 572
   3641 	DOMAIN_ALIAS_RID_POWER_USERS                                                   = 547
   3642 	DOMAIN_ALIAS_RID_PREW2KCOMPACCESS                                              = 554
   3643 	DOMAIN_ALIAS_RID_PRINT_OPS                                                     = 550
   3644 	DOMAIN_ALIAS_RID_RAS_SERVERS                                                   = 553
   3645 	DOMAIN_ALIAS_RID_RDS_ENDPOINT_SERVERS                                          = 576
   3646 	DOMAIN_ALIAS_RID_RDS_MANAGEMENT_SERVERS                                        = 577
   3647 	DOMAIN_ALIAS_RID_RDS_REMOTE_ACCESS_SERVERS                                     = 575
   3648 	DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS                                          = 555
   3649 	DOMAIN_ALIAS_RID_REMOTE_MANAGEMENT_USERS                                       = 580
   3650 	DOMAIN_ALIAS_RID_REPLICATOR                                                    = 552
   3651 	DOMAIN_ALIAS_RID_SYSTEM_OPS                                                    = 549
   3652 	DOMAIN_ALIAS_RID_TS_LICENSE_SERVERS                                            = 561
   3653 	DOMAIN_ALIAS_RID_USERS                                                         = 545
   3654 	DOMAIN_GROUP_RID_ADMINS                                                        = 512
   3655 	DOMAIN_GROUP_RID_AUTHORIZATION_DATA_CONTAINS_CLAIMS                            = 497
   3656 	DOMAIN_GROUP_RID_AUTHORIZATION_DATA_IS_COMPOUNDED                              = 496
   3657 	DOMAIN_GROUP_RID_CERT_ADMINS                                                   = 517
   3658 	DOMAIN_GROUP_RID_CLONEABLE_CONTROLLERS                                         = 522
   3659 	DOMAIN_GROUP_RID_COMPUTERS                                                     = 515
   3660 	DOMAIN_GROUP_RID_CONTROLLERS                                                   = 516
   3661 	DOMAIN_GROUP_RID_ENTERPRISE_ADMINS                                             = 519
   3662 	DOMAIN_GROUP_RID_ENTERPRISE_READONLY_DOMAIN_CONTROLLERS                        = 498
   3663 	DOMAIN_GROUP_RID_GUESTS                                                        = 514
   3664 	DOMAIN_GROUP_RID_POLICY_ADMINS                                                 = 520
   3665 	DOMAIN_GROUP_RID_READONLY_CONTROLLERS                                          = 521
   3666 	DOMAIN_GROUP_RID_SCHEMA_ADMINS                                                 = 518
   3667 	DOMAIN_GROUP_RID_USERS                                                         = 513
   3668 	DOMAIN_USER_RID_ADMIN                                                          = 500
   3669 	DOMAIN_USER_RID_GUEST                                                          = 501
   3670 	DOMAIN_USER_RID_KRBTGT                                                         = 502
   3671 	DOMAIN_USER_RID_MAX                                                            = 999
   3672 	DONT_RESOLVE_DLL_REFERENCES                                                    = 0x1
   3673 	DOUBLE_CLICK                                                                   = 0x2
   3674 	DOWNLOADFACE                                                                   = 514
   3675 	DOWNLOADHEADER                                                                 = 4111
   3676 	DO_DROPFILE                                                                    = 1162627398
   3677 	DO_PRINTFILE                                                                   = 1414419024
   3678 	DPD_DELETE_ALL_FILES                                                           = 0x00000004
   3679 	DPD_DELETE_SPECIFIC_VERSION                                                    = 0x00000002
   3680 	DPD_DELETE_UNUSED_FILES                                                        = 0x00000001
   3681 	DRAFTMODE                                                                      = 7
   3682 	DRAFT_QUALITY                                                                  = 1
   3683 	DRAGDROP_E_FIRST                                                               = 2147746048
   3684 	DRAGDROP_E_LAST                                                                = 2147746063
   3685 	DRAGDROP_S_FIRST                                                               = 262400
   3686 	DRAGDROP_S_LAST                                                                = 262415
   3687 	DRAWPATTERNRECT                                                                = 25
   3688 	DRIVERSPECS_H                                                                  = 0
   3689 	DRIVERVERSION                                                                  = 0
   3690 	DRIVER_KERNELMODE                                                              = 0x00000001
   3691 	DRIVER_USERMODE                                                                = 0x00000002
   3692 	DRIVE_CDROM                                                                    = 5
   3693 	DRIVE_FIXED                                                                    = 3
   3694 	DRIVE_NO_ROOT_DIR                                                              = 1
   3695 	DRIVE_RAMDISK                                                                  = 6
   3696 	DRIVE_REMOTE                                                                   = 4
   3697 	DRIVE_REMOVABLE                                                                = 2
   3698 	DRIVE_UNKNOWN                                                                  = 0
   3699 	DROPEFFECT_COPY                                                                = 1
   3700 	DROPEFFECT_LINK                                                                = 4
   3701 	DROPEFFECT_MOVE                                                                = 2
   3702 	DROPEFFECT_NONE                                                                = 0
   3703 	DROPEFFECT_SCROLL                                                              = 2147483648
   3704 	DRVCNF_CANCEL                                                                  = 0x0000
   3705 	DRVCNF_OK                                                                      = 0x0001
   3706 	DRVCNF_RESTART                                                                 = 0x0002
   3707 	DRV_CANCEL                                                                     = 0
   3708 	DRV_CLOSE                                                                      = 0x0004
   3709 	DRV_CONFIGURE                                                                  = 0x0007
   3710 	DRV_DISABLE                                                                    = 0x0005
   3711 	DRV_ENABLE                                                                     = 0x0002
   3712 	DRV_EXITSESSION                                                                = 0x000B
   3713 	DRV_FREE                                                                       = 0x0006
   3714 	DRV_INSTALL                                                                    = 0x0009
   3715 	DRV_LOAD                                                                       = 0x0001
   3716 	DRV_MCI_FIRST                                                                  = 2048
   3717 	DRV_MCI_LAST                                                                   = 6143
   3718 	DRV_OK                                                                         = 1
   3719 	DRV_OPEN                                                                       = 0x0003
   3720 	DRV_POWER                                                                      = 0x000F
   3721 	DRV_QUERYCONFIGURE                                                             = 0x0008
   3722 	DRV_REMOVE                                                                     = 0x000A
   3723 	DRV_RESERVED                                                                   = 0x0800
   3724 	DRV_RESTART                                                                    = 2
   3725 	DRV_USER                                                                       = 0x4000
   3726 	DSPRINT_PENDING                                                                = 0x80000000
   3727 	DSPRINT_PUBLISH                                                                = 0x00000001
   3728 	DSPRINT_REPUBLISH                                                              = 0x00000008
   3729 	DSPRINT_UNPUBLISH                                                              = 0x00000004
   3730 	DSPRINT_UPDATE                                                                 = 0x00000002
   3731 	DSS_DISABLED                                                                   = 0x0020
   3732 	DSS_HIDEPREFIX                                                                 = 0x0200
   3733 	DSS_MONO                                                                       = 0x0080
   3734 	DSS_NORMAL                                                                     = 0x0000
   3735 	DSS_PREFIXONLY                                                                 = 0x0400
   3736 	DSS_RIGHT                                                                      = 0x8000
   3737 	DSS_UNION                                                                      = 0x0010
   3738 	DST_BITMAP                                                                     = 0x0004
   3739 	DST_COMPLEX                                                                    = 0x0000
   3740 	DST_ICON                                                                       = 0x0003
   3741 	DST_PREFIXTEXT                                                                 = 0x0002
   3742 	DST_TEXT                                                                       = 0x0001
   3743 	DS_3DLOOK                                                                      = 4
   3744 	DS_ABSALIGN                                                                    = 1
   3745 	DS_CENTER                                                                      = 2048
   3746 	DS_CENTERMOUSE                                                                 = 4096
   3747 	DS_CONTEXTHELP                                                                 = 8192
   3748 	DS_CONTROL                                                                     = 1024
   3749 	DS_FIXEDSYS                                                                    = 8
   3750 	DS_LOCALEDIT                                                                   = 32
   3751 	DS_MODALFRAME                                                                  = 128
   3752 	DS_NOFAILCREATE                                                                = 16
   3753 	DS_NOIDLEMSG                                                                   = 256
   3754 	DS_SETFONT                                                                     = 64
   3755 	DS_SETFOREGROUND                                                               = 512
   3756 	DS_SHELLFONT                                                                   = 72
   3757 	DS_SYSMODAL                                                                    = 2
   3758 	DS_S_SUCCESS                                                                   = 0
   3759 	DTR_CONTROL_DISABLE                                                            = 0x0
   3760 	DTR_CONTROL_ENABLE                                                             = 0x1
   3761 	DTR_CONTROL_HANDSHAKE                                                          = 0x2
   3762 	DT_BOTTOM                                                                      = 0x00000008
   3763 	DT_CALCRECT                                                                    = 0x00000400
   3764 	DT_CENTER                                                                      = 0x00000001
   3765 	DT_CHARSTREAM                                                                  = 4
   3766 	DT_DISPFILE                                                                    = 6
   3767 	DT_EDITCONTROL                                                                 = 0x00002000
   3768 	DT_END_ELLIPSIS                                                                = 0x00008000
   3769 	DT_EXPANDTABS                                                                  = 0x00000040
   3770 	DT_EXTERNALLEADING                                                             = 0x00000200
   3771 	DT_HIDEPREFIX                                                                  = 0x00100000
   3772 	DT_INTERNAL                                                                    = 0x00001000
   3773 	DT_LEFT                                                                        = 0x00000000
   3774 	DT_METAFILE                                                                    = 5
   3775 	DT_MODIFYSTRING                                                                = 0x00010000
   3776 	DT_NOCLIP                                                                      = 0x00000100
   3777 	DT_NOFULLWIDTHCHARBREAK                                                        = 0x00080000
   3778 	DT_NOPREFIX                                                                    = 0x00000800
   3779 	DT_PATH_ELLIPSIS                                                               = 0x00004000
   3780 	DT_PLOTTER                                                                     = 0
   3781 	DT_PREFIXONLY                                                                  = 0x00200000
   3782 	DT_RASCAMERA                                                                   = 3
   3783 	DT_RASDISPLAY                                                                  = 1
   3784 	DT_RASPRINTER                                                                  = 2
   3785 	DT_RIGHT                                                                       = 0x00000002
   3786 	DT_RTLREADING                                                                  = 0x00020000
   3787 	DT_SINGLELINE                                                                  = 0x00000020
   3788 	DT_TABSTOP                                                                     = 0x00000080
   3789 	DT_TOP                                                                         = 0x00000000
   3790 	DT_VCENTER                                                                     = 0x00000004
   3791 	DT_WORDBREAK                                                                   = 0x00000010
   3792 	DT_WORD_ELLIPSIS                                                               = 0x00040000
   3793 	DUPLICATE                                                                      = 0x06
   3794 	DUPLICATE_CLOSE_SOURCE                                                         = 0x00000001
   3795 	DUPLICATE_DEREG                                                                = 0x07
   3796 	DUPLICATE_SAME_ACCESS                                                          = 0x00000002
   3797 	DWLP_MSGRESULT                                                                 = 0
   3798 	E2BIG                                                                          = 7
   3799 	EACCES                                                                         = 13
   3800 	EADDRINUSE                                                                     = 100
   3801 	EADDRNOTAVAIL                                                                  = 101
   3802 	EAFNOSUPPORT                                                                   = 102
   3803 	EAGAIN                                                                         = 11
   3804 	EALREADY                                                                       = 103
   3805 	EASTEUROPE_CHARSET                                                             = 238
   3806 	EBADF                                                                          = 9
   3807 	EBADMSG                                                                        = 104
   3808 	EBUSY                                                                          = 16
   3809 	ECANCELED                                                                      = 105
   3810 	ECHILD                                                                         = 10
   3811 	ECONNABORTED                                                                   = 106
   3812 	ECONNREFUSED                                                                   = 107
   3813 	ECONNRESET                                                                     = 108
   3814 	EC_DISABLE                                                                     = 8
   3815 	EC_ENABLEALL                                                                   = 0
   3816 	EC_ENABLEONE                                                                   = 128
   3817 	EC_LEFTMARGIN                                                                  = 0x0001
   3818 	EC_QUERYWAITING                                                                = 2
   3819 	EC_RIGHTMARGIN                                                                 = 0x0002
   3820 	EC_USEFONTINFO                                                                 = 0xffff
   3821 	EDD_GET_DEVICE_INTERFACE_NAME                                                  = 0x00000001
   3822 	EDEADLK                                                                        = 36
   3823 	EDEADLOCK                                                                      = 36
   3824 	EDESTADDRREQ                                                                   = 109
   3825 	EDGE_BUMP                                                                      = 9
   3826 	EDGE_ETCHED                                                                    = 6
   3827 	EDGE_RAISED                                                                    = 5
   3828 	EDGE_SUNKEN                                                                    = 10
   3829 	EDOM                                                                           = 33
   3830 	EDS_RAWMODE                                                                    = 0x00000002
   3831 	EDS_ROTATEDMODE                                                                = 0x00000004
   3832 	EEInfoGCCOM                                                                    = 11
   3833 	EEInfoGCFRS                                                                    = 12
   3834 	EEInfoNextRecordsMissing                                                       = 2
   3835 	EEInfoPreviousRecordsMissing                                                   = 1
   3836 	EEInfoUseFileTime                                                              = 4
   3837 	EEXIST                                                                         = 17
   3838 	EFAULT                                                                         = 14
   3839 	EFBIG                                                                          = 27
   3840 	EFSRPC_SECURE_ONLY                                                             = 8
   3841 	EFS_USE_RECOVERY_KEYS                                                          = 1
   3842 	EHOSTUNREACH                                                                   = 110
   3843 	EIDRM                                                                          = 111
   3844 	EILSEQ                                                                         = 42
   3845 	EIMES_CANCELCOMPSTRINFOCUS                                                     = 0x0002
   3846 	EIMES_COMPLETECOMPSTRKILLFOCUS                                                 = 0x0004
   3847 	EIMES_GETCOMPSTRATONCE                                                         = 0x0001
   3848 	EINPROGRESS                                                                    = 112
   3849 	EINTR                                                                          = 4
   3850 	EINVAL                                                                         = 22
   3851 	EIO                                                                            = 5
   3852 	EISCONN                                                                        = 113
   3853 	EISDIR                                                                         = 21
   3854 	ELEMENT_STATUS_ACCESS                                                          = 0x00000008
   3855 	ELEMENT_STATUS_AVOLTAG                                                         = 0x20000000
   3856 	ELEMENT_STATUS_EXCEPT                                                          = 0x00000004
   3857 	ELEMENT_STATUS_EXENAB                                                          = 0x00000010
   3858 	ELEMENT_STATUS_FULL                                                            = 0x00000001
   3859 	ELEMENT_STATUS_ID_VALID                                                        = 0x00002000
   3860 	ELEMENT_STATUS_IMPEXP                                                          = 0x00000002
   3861 	ELEMENT_STATUS_INENAB                                                          = 0x00000020
   3862 	ELEMENT_STATUS_INVERT                                                          = 0x00400000
   3863 	ELEMENT_STATUS_LUN_VALID                                                       = 0x00001000
   3864 	ELEMENT_STATUS_NOT_BUS                                                         = 0x00008000
   3865 	ELEMENT_STATUS_PRODUCT_DATA                                                    = 0x00000040
   3866 	ELEMENT_STATUS_PVOLTAG                                                         = 0x10000000
   3867 	ELEMENT_STATUS_SVALID                                                          = 0x00800000
   3868 	ELF_CULTURE_LATIN                                                              = 0
   3869 	ELF_VENDOR_SIZE                                                                = 4
   3870 	ELF_VERSION                                                                    = 0
   3871 	ELOOP                                                                          = 114
   3872 	EMARCH_ENC_I17_IC_INST_WORD_POS_X                                              = 12
   3873 	EMARCH_ENC_I17_IC_INST_WORD_X                                                  = 3
   3874 	EMARCH_ENC_I17_IC_SIZE_X                                                       = 1
   3875 	EMARCH_ENC_I17_IC_VAL_POS_X                                                    = 21
   3876 	EMARCH_ENC_I17_IMM41a_INST_WORD_POS_X                                          = 14
   3877 	EMARCH_ENC_I17_IMM41a_INST_WORD_X                                              = 1
   3878 	EMARCH_ENC_I17_IMM41a_SIZE_X                                                   = 10
   3879 	EMARCH_ENC_I17_IMM41a_VAL_POS_X                                                = 22
   3880 	EMARCH_ENC_I17_IMM41b_INST_WORD_POS_X                                          = 24
   3881 	EMARCH_ENC_I17_IMM41b_INST_WORD_X                                              = 1
   3882 	EMARCH_ENC_I17_IMM41b_SIZE_X                                                   = 8
   3883 	EMARCH_ENC_I17_IMM41b_VAL_POS_X                                                = 32
   3884 	EMARCH_ENC_I17_IMM41c_INST_WORD_POS_X                                          = 0
   3885 	EMARCH_ENC_I17_IMM41c_INST_WORD_X                                              = 2
   3886 	EMARCH_ENC_I17_IMM41c_SIZE_X                                                   = 23
   3887 	EMARCH_ENC_I17_IMM41c_VAL_POS_X                                                = 40
   3888 	EMARCH_ENC_I17_IMM5C_INST_WORD_POS_X                                           = 13
   3889 	EMARCH_ENC_I17_IMM5C_INST_WORD_X                                               = 3
   3890 	EMARCH_ENC_I17_IMM5C_SIZE_X                                                    = 5
   3891 	EMARCH_ENC_I17_IMM5C_VAL_POS_X                                                 = 16
   3892 	EMARCH_ENC_I17_IMM7B_INST_WORD_POS_X                                           = 4
   3893 	EMARCH_ENC_I17_IMM7B_INST_WORD_X                                               = 3
   3894 	EMARCH_ENC_I17_IMM7B_SIZE_X                                                    = 7
   3895 	EMARCH_ENC_I17_IMM7B_VAL_POS_X                                                 = 0
   3896 	EMARCH_ENC_I17_IMM9D_INST_WORD_POS_X                                           = 18
   3897 	EMARCH_ENC_I17_IMM9D_INST_WORD_X                                               = 3
   3898 	EMARCH_ENC_I17_IMM9D_SIZE_X                                                    = 9
   3899 	EMARCH_ENC_I17_IMM9D_VAL_POS_X                                                 = 7
   3900 	EMARCH_ENC_I17_SIGN_INST_WORD_POS_X                                            = 27
   3901 	EMARCH_ENC_I17_SIGN_INST_WORD_X                                                = 3
   3902 	EMARCH_ENC_I17_SIGN_SIZE_X                                                     = 1
   3903 	EMARCH_ENC_I17_SIGN_VAL_POS_X                                                  = 63
   3904 	EMBDHLP_CREATENOW                                                              = 0
   3905 	EMBDHLP_DELAYCREATE                                                            = 65536
   3906 	EMBDHLP_INPROC_HANDLER                                                         = 0
   3907 	EMBDHLP_INPROC_SERVER                                                          = 1
   3908 	EMFILE                                                                         = 24
   3909 	EMLINK                                                                         = 31
   3910 	EMR_ABORTPATH                                                                  = 68
   3911 	EMR_ALPHABLEND                                                                 = 114
   3912 	EMR_ANGLEARC                                                                   = 41
   3913 	EMR_ARC                                                                        = 45
   3914 	EMR_ARCTO                                                                      = 55
   3915 	EMR_BEGINPATH                                                                  = 59
   3916 	EMR_BITBLT                                                                     = 76
   3917 	EMR_CHORD                                                                      = 46
   3918 	EMR_CLOSEFIGURE                                                                = 61
   3919 	EMR_COLORCORRECTPALETTE                                                        = 111
   3920 	EMR_COLORMATCHTOTARGETW                                                        = 121
   3921 	EMR_CREATEBRUSHINDIRECT                                                        = 39
   3922 	EMR_CREATECOLORSPACE                                                           = 99
   3923 	EMR_CREATECOLORSPACEW                                                          = 122
   3924 	EMR_CREATEDIBPATTERNBRUSHPT                                                    = 94
   3925 	EMR_CREATEMONOBRUSH                                                            = 93
   3926 	EMR_CREATEPALETTE                                                              = 49
   3927 	EMR_CREATEPEN                                                                  = 38
   3928 	EMR_DELETECOLORSPACE                                                           = 101
   3929 	EMR_DELETEOBJECT                                                               = 40
   3930 	EMR_ELLIPSE                                                                    = 42
   3931 	EMR_ENDPATH                                                                    = 60
   3932 	EMR_EOF                                                                        = 14
   3933 	EMR_EXCLUDECLIPRECT                                                            = 29
   3934 	EMR_EXTCREATEFONTINDIRECTW                                                     = 82
   3935 	EMR_EXTCREATEPEN                                                               = 95
   3936 	EMR_EXTFLOODFILL                                                               = 53
   3937 	EMR_EXTSELECTCLIPRGN                                                           = 75
   3938 	EMR_EXTTEXTOUTA                                                                = 83
   3939 	EMR_EXTTEXTOUTW                                                                = 84
   3940 	EMR_FILLPATH                                                                   = 62
   3941 	EMR_FILLRGN                                                                    = 71
   3942 	EMR_FLATTENPATH                                                                = 65
   3943 	EMR_FRAMERGN                                                                   = 72
   3944 	EMR_GDICOMMENT                                                                 = 70
   3945 	EMR_GLSBOUNDEDRECORD                                                           = 103
   3946 	EMR_GLSRECORD                                                                  = 102
   3947 	EMR_GRADIENTFILL                                                               = 118
   3948 	EMR_HEADER                                                                     = 1
   3949 	EMR_INTERSECTCLIPRECT                                                          = 30
   3950 	EMR_INVERTRGN                                                                  = 73
   3951 	EMR_LINETO                                                                     = 54
   3952 	EMR_MASKBLT                                                                    = 78
   3953 	EMR_MAX                                                                        = 122
   3954 	EMR_MIN                                                                        = 1
   3955 	EMR_MODIFYWORLDTRANSFORM                                                       = 36
   3956 	EMR_MOVETOEX                                                                   = 27
   3957 	EMR_OFFSETCLIPRGN                                                              = 26
   3958 	EMR_PAINTRGN                                                                   = 74
   3959 	EMR_PIE                                                                        = 47
   3960 	EMR_PIXELFORMAT                                                                = 104
   3961 	EMR_PLGBLT                                                                     = 79
   3962 	EMR_POLYBEZIER                                                                 = 2
   3963 	EMR_POLYBEZIER16                                                               = 85
   3964 	EMR_POLYBEZIERTO                                                               = 5
   3965 	EMR_POLYBEZIERTO16                                                             = 88
   3966 	EMR_POLYDRAW                                                                   = 56
   3967 	EMR_POLYDRAW16                                                                 = 92
   3968 	EMR_POLYGON                                                                    = 3
   3969 	EMR_POLYGON16                                                                  = 86
   3970 	EMR_POLYLINE                                                                   = 4
   3971 	EMR_POLYLINE16                                                                 = 87
   3972 	EMR_POLYLINETO                                                                 = 6
   3973 	EMR_POLYLINETO16                                                               = 89
   3974 	EMR_POLYPOLYGON                                                                = 8
   3975 	EMR_POLYPOLYGON16                                                              = 91
   3976 	EMR_POLYPOLYLINE                                                               = 7
   3977 	EMR_POLYPOLYLINE16                                                             = 90
   3978 	EMR_POLYTEXTOUTA                                                               = 96
   3979 	EMR_POLYTEXTOUTW                                                               = 97
   3980 	EMR_REALIZEPALETTE                                                             = 52
   3981 	EMR_RECTANGLE                                                                  = 43
   3982 	EMR_RESERVED_105                                                               = 105
   3983 	EMR_RESERVED_106                                                               = 106
   3984 	EMR_RESERVED_107                                                               = 107
   3985 	EMR_RESERVED_108                                                               = 108
   3986 	EMR_RESERVED_109                                                               = 109
   3987 	EMR_RESERVED_110                                                               = 110
   3988 	EMR_RESERVED_117                                                               = 117
   3989 	EMR_RESERVED_119                                                               = 119
   3990 	EMR_RESERVED_120                                                               = 120
   3991 	EMR_RESIZEPALETTE                                                              = 51
   3992 	EMR_RESTOREDC                                                                  = 34
   3993 	EMR_ROUNDRECT                                                                  = 44
   3994 	EMR_SAVEDC                                                                     = 33
   3995 	EMR_SCALEVIEWPORTEXTEX                                                         = 31
   3996 	EMR_SCALEWINDOWEXTEX                                                           = 32
   3997 	EMR_SELECTCLIPPATH                                                             = 67
   3998 	EMR_SELECTOBJECT                                                               = 37
   3999 	EMR_SELECTPALETTE                                                              = 48
   4000 	EMR_SETARCDIRECTION                                                            = 57
   4001 	EMR_SETBKCOLOR                                                                 = 25
   4002 	EMR_SETBKMODE                                                                  = 18
   4003 	EMR_SETBRUSHORGEX                                                              = 13
   4004 	EMR_SETCOLORADJUSTMENT                                                         = 23
   4005 	EMR_SETCOLORSPACE                                                              = 100
   4006 	EMR_SETDIBITSTODEVICE                                                          = 80
   4007 	EMR_SETICMMODE                                                                 = 98
   4008 	EMR_SETICMPROFILEA                                                             = 112
   4009 	EMR_SETICMPROFILEW                                                             = 113
   4010 	EMR_SETLAYOUT                                                                  = 115
   4011 	EMR_SETMAPMODE                                                                 = 17
   4012 	EMR_SETMAPPERFLAGS                                                             = 16
   4013 	EMR_SETMETARGN                                                                 = 28
   4014 	EMR_SETMITERLIMIT                                                              = 58
   4015 	EMR_SETPALETTEENTRIES                                                          = 50
   4016 	EMR_SETPIXELV                                                                  = 15
   4017 	EMR_SETPOLYFILLMODE                                                            = 19
   4018 	EMR_SETROP2                                                                    = 20
   4019 	EMR_SETSTRETCHBLTMODE                                                          = 21
   4020 	EMR_SETTEXTALIGN                                                               = 22
   4021 	EMR_SETTEXTCOLOR                                                               = 24
   4022 	EMR_SETVIEWPORTEXTEX                                                           = 11
   4023 	EMR_SETVIEWPORTORGEX                                                           = 12
   4024 	EMR_SETWINDOWEXTEX                                                             = 9
   4025 	EMR_SETWINDOWORGEX                                                             = 10
   4026 	EMR_SETWORLDTRANSFORM                                                          = 35
   4027 	EMR_STRETCHBLT                                                                 = 77
   4028 	EMR_STRETCHDIBITS                                                              = 81
   4029 	EMR_STROKEANDFILLPATH                                                          = 63
   4030 	EMR_STROKEPATH                                                                 = 64
   4031 	EMR_TRANSPARENTBLT                                                             = 116
   4032 	EMR_WIDENPATH                                                                  = 66
   4033 	EMSGSIZE                                                                       = 115
   4034 	EMSIS_COMPOSITIONSTRING                                                        = 0x0001
   4035 	EM_CANUNDO                                                                     = 0x00C6
   4036 	EM_CHARFROMPOS                                                                 = 0x00D7
   4037 	EM_EMPTYUNDOBUFFER                                                             = 0x00CD
   4038 	EM_FMTLINES                                                                    = 0x00C8
   4039 	EM_GETFIRSTVISIBLELINE                                                         = 0x00CE
   4040 	EM_GETHANDLE                                                                   = 0x00BD
   4041 	EM_GETIMESTATUS                                                                = 0x00D9
   4042 	EM_GETLIMITTEXT                                                                = 0x00D5
   4043 	EM_GETLINE                                                                     = 0x00C4
   4044 	EM_GETLINECOUNT                                                                = 0x00BA
   4045 	EM_GETMARGINS                                                                  = 0x00D4
   4046 	EM_GETMODIFY                                                                   = 0x00B8
   4047 	EM_GETPASSWORDCHAR                                                             = 0x00D2
   4048 	EM_GETRECT                                                                     = 0x00B2
   4049 	EM_GETSEL                                                                      = 0x00B0
   4050 	EM_GETTHUMB                                                                    = 0x00BE
   4051 	EM_GETWORDBREAKPROC                                                            = 0x00D1
   4052 	EM_LIMITTEXT                                                                   = 0x00C5
   4053 	EM_LINEFROMCHAR                                                                = 0x00C9
   4054 	EM_LINEINDEX                                                                   = 0x00BB
   4055 	EM_LINELENGTH                                                                  = 0x00C1
   4056 	EM_LINESCROLL                                                                  = 0x00B6
   4057 	EM_POSFROMCHAR                                                                 = 0x00D6
   4058 	EM_REPLACESEL                                                                  = 0x00C2
   4059 	EM_SCROLL                                                                      = 0x00B5
   4060 	EM_SCROLLCARET                                                                 = 0x00B7
   4061 	EM_SETHANDLE                                                                   = 0x00BC
   4062 	EM_SETIMESTATUS                                                                = 0x00D8
   4063 	EM_SETLIMITTEXT                                                                = 197
   4064 	EM_SETMARGINS                                                                  = 0x00D3
   4065 	EM_SETMODIFY                                                                   = 0x00B9
   4066 	EM_SETPASSWORDCHAR                                                             = 0x00CC
   4067 	EM_SETREADONLY                                                                 = 0x00CF
   4068 	EM_SETRECT                                                                     = 0x00B3
   4069 	EM_SETRECTNP                                                                   = 0x00B4
   4070 	EM_SETSEL                                                                      = 0x00B1
   4071 	EM_SETTABSTOPS                                                                 = 0x00CB
   4072 	EM_SETWORDBREAKPROC                                                            = 0x00D0
   4073 	EM_UNDO                                                                        = 0x00C7
   4074 	ENABLEDUPLEX                                                                   = 28
   4075 	ENABLEPAIRKERNING                                                              = 769
   4076 	ENABLERELATIVEWIDTHS                                                           = 768
   4077 	ENABLE_AUTO_POSITION                                                           = 0x100
   4078 	ENABLE_DISABLE_AUTOSAVE                                                        = 0xD2
   4079 	ENABLE_DISABLE_AUTO_OFFLINE                                                    = 0xDB
   4080 	ENABLE_ECHO_INPUT                                                              = 0x4
   4081 	ENABLE_EXTENDED_FLAGS                                                          = 0x80
   4082 	ENABLE_INSERT_MODE                                                             = 0x20
   4083 	ENABLE_LINE_INPUT                                                              = 0x2
   4084 	ENABLE_LVB_GRID_WORLDWIDE                                                      = 0x10
   4085 	ENABLE_MOUSE_INPUT                                                             = 0x10
   4086 	ENABLE_PROCESSED_INPUT                                                         = 0x1
   4087 	ENABLE_PROCESSED_OUTPUT                                                        = 0x1
   4088 	ENABLE_QUICK_EDIT_MODE                                                         = 0x40
   4089 	ENABLE_SMART                                                                   = 0xD8
   4090 	ENABLE_VIRTUAL_TERMINAL_INPUT                                                  = 0x200
   4091 	ENABLE_VIRTUAL_TERMINAL_PROCESSING                                             = 0x4
   4092 	ENABLE_WINDOW_INPUT                                                            = 0x8
   4093 	ENABLE_WRAP_AT_EOL_OUTPUT                                                      = 0x2
   4094 	ENAMETOOLONG                                                                   = 38
   4095 	ENAME_NAME                                                                     = 0
   4096 	ENAME_SPAN                                                                     = 1
   4097 	ENAME_TAB                                                                      = 2
   4098 	ENCAPSULATED_POSTSCRIPT                                                        = 4116
   4099 	ENCRYPTION_FORMAT_DEFAULT                                                      = 1
   4100 	ENDDOC                                                                         = 11
   4101 	ENDSESSION_CLOSEAPP                                                            = 0x00000001
   4102 	ENDSESSION_CRITICAL                                                            = 0x40000000
   4103 	ENDSESSION_LOGOFF                                                              = 0x80000000
   4104 	END_INTERFACE                                                                  = 0
   4105 	END_PATH                                                                       = 4098
   4106 	ENETDOWN                                                                       = 116
   4107 	ENETRESET                                                                      = 117
   4108 	ENETUNREACH                                                                    = 118
   4109 	ENFILE                                                                         = 23
   4110 	ENHANCED_KEY                                                                   = 0x100
   4111 	ENHMETA_SIGNATURE                                                              = 0x464D4520
   4112 	ENHMETA_STOCK_OBJECT                                                           = 0x80000000
   4113 	ENLISTMENT_ALL_ACCESS                                                          = 983071
   4114 	ENLISTMENT_GENERIC_EXECUTE                                                     = 131100
   4115 	ENLISTMENT_GENERIC_READ                                                        = 131073
   4116 	ENLISTMENT_GENERIC_WRITE                                                       = 131102
   4117 	ENLISTMENT_MAXIMUM_OPTION                                                      = 0x00000001
   4118 	ENLISTMENT_QUERY_INFORMATION                                                   = 1
   4119 	ENLISTMENT_RECOVER                                                             = 4
   4120 	ENLISTMENT_SET_INFORMATION                                                     = 2
   4121 	ENLISTMENT_SUBORDINATE_RIGHTS                                                  = 8
   4122 	ENLISTMENT_SUPERIOR                                                            = 0x00000001
   4123 	ENLISTMENT_SUPERIOR_RIGHTS                                                     = 0x10
   4124 	ENOBUFS                                                                        = 119
   4125 	ENODATA                                                                        = 120
   4126 	ENODEV                                                                         = 19
   4127 	ENOENT                                                                         = 2
   4128 	ENOEXEC                                                                        = 8
   4129 	ENOFILE                                                                        = 2
   4130 	ENOLCK                                                                         = 39
   4131 	ENOLINK                                                                        = 121
   4132 	ENOMEM                                                                         = 12
   4133 	ENOMSG                                                                         = 122
   4134 	ENOPROTOOPT                                                                    = 123
   4135 	ENOSPC                                                                         = 28
   4136 	ENOSR                                                                          = 124
   4137 	ENOSTR                                                                         = 125
   4138 	ENOSYS                                                                         = 40
   4139 	ENOTCONN                                                                       = 126
   4140 	ENOTDIR                                                                        = 20
   4141 	ENOTEMPTY                                                                      = 41
   4142 	ENOTRECOVERABLE                                                                = 127
   4143 	ENOTSOCK                                                                       = 128
   4144 	ENOTSUP                                                                        = 129
   4145 	ENOTTY                                                                         = 25
   4146 	ENUMPAPERBINS                                                                  = 31
   4147 	ENUMPAPERMETRICS                                                               = 34
   4148 	ENUM_ALL_CALENDARS                                                             = 0xffffffff
   4149 	ENUM_E_FIRST                                                                   = 2147746224
   4150 	ENUM_E_LAST                                                                    = 2147746239
   4151 	ENUM_S_FIRST                                                                   = 262576
   4152 	ENUM_S_LAST                                                                    = 262591
   4153 	ENXIO                                                                          = 6
   4154 	EN_ALIGN_LTR_EC                                                                = 0x0700
   4155 	EN_ALIGN_RTL_EC                                                                = 0x0701
   4156 	EN_CHANGE                                                                      = 0x0300
   4157 	EN_ERRSPACE                                                                    = 0x0500
   4158 	EN_HSCROLL                                                                     = 0x0601
   4159 	EN_KILLFOCUS                                                                   = 0x0200
   4160 	EN_MAXTEXT                                                                     = 0x0501
   4161 	EN_SETFOCUS                                                                    = 0x0100
   4162 	EN_UPDATE                                                                      = 0x0400
   4163 	EN_VSCROLL                                                                     = 0x0602
   4164 	EOF                                                                            = -1
   4165 	EOPNOTSUPP                                                                     = 130
   4166 	EOVERFLOW                                                                      = 132
   4167 	EOWNERDEAD                                                                     = 133
   4168 	EPERM                                                                          = 1
   4169 	EPIPE                                                                          = 32
   4170 	EPROTO                                                                         = 134
   4171 	EPROTONOSUPPORT                                                                = 135
   4172 	EPROTOTYPE                                                                     = 136
   4173 	EPSPRINTING                                                                    = 33
   4174 	EPS_SIGNATURE                                                                  = 0x46535045
   4175 	EPT_S_CANT_CREATE                                                              = 1899
   4176 	EPT_S_CANT_PERFORM_OP                                                          = 1752
   4177 	EPT_S_INVALID_ENTRY                                                            = 1751
   4178 	EPT_S_NOT_REGISTERED                                                           = 1753
   4179 	EP_Agg                                                                         = 0x000010
   4180 	EP_CanBeNull                                                                   = 0x200000
   4181 	EP_Collate                                                                     = 0x000200
   4182 	EP_Commuted                                                                    = 0x000400
   4183 	EP_ConstFunc                                                                   = 0x100000
   4184 	EP_DblQuoted                                                                   = 0x000080
   4185 	EP_Distinct                                                                    = 0x000004
   4186 	EP_FixedCol                                                                    = 0x000020
   4187 	EP_FromDDL                                                                     = 0x40000000
   4188 	EP_HasFunc                                                                     = 0x000008
   4189 	EP_IfNullRow                                                                   = 0x040000
   4190 	EP_Immutable                                                                   = 0x02
   4191 	EP_InfixFunc                                                                   = 0x000100
   4192 	EP_InnerON                                                                     = 0x000002
   4193 	EP_IntValue                                                                    = 0x000800
   4194 	EP_IsFalse                                                                     = 0x20000000
   4195 	EP_IsTrue                                                                      = 0x10000000
   4196 	EP_Leaf                                                                        = 0x800000
   4197 	EP_NoReduce                                                                    = 0x01
   4198 	EP_OuterON                                                                     = 0x000001
   4199 	EP_Propagate                                                                   = 4194824
   4200 	EP_Quoted                                                                      = 0x4000000
   4201 	EP_Reduced                                                                     = 0x004000
   4202 	EP_Skip                                                                        = 0x002000
   4203 	EP_Static                                                                      = 0x8000000
   4204 	EP_Subquery                                                                    = 0x400000
   4205 	EP_Subrtn                                                                      = 0x2000000
   4206 	EP_TokenOnly                                                                   = 0x010000
   4207 	EP_Unlikely                                                                    = 0x080000
   4208 	EP_VarSelect                                                                   = 0x000040
   4209 	EP_Win                                                                         = 0x008000
   4210 	EP_WinFunc                                                                     = 0x1000000
   4211 	EP_xIsSelect                                                                   = 0x001000
   4212 	ERANGE                                                                         = 34
   4213 	EROFS                                                                          = 30
   4214 	ERROR                                                                          = 0
   4215 	ERROR_ABANDONED_WAIT_0                                                         = 735
   4216 	ERROR_ABANDONED_WAIT_63                                                        = 736
   4217 	ERROR_ACCESS_DENIED                                                            = 5
   4218 	ERROR_ACCESS_DISABLED_BY_POLICY                                                = 1260
   4219 	ERROR_ACCESS_DISABLED_WEBBLADE                                                 = 1277
   4220 	ERROR_ACCESS_DISABLED_WEBBLADE_TAMPER                                          = 1278
   4221 	ERROR_ACCOUNT_DISABLED                                                         = 1331
   4222 	ERROR_ACCOUNT_EXPIRED                                                          = 1793
   4223 	ERROR_ACCOUNT_LOCKED_OUT                                                       = 1909
   4224 	ERROR_ACCOUNT_RESTRICTION                                                      = 1327
   4225 	ERROR_ACTIVATION_COUNT_EXCEEDED                                                = 7059
   4226 	ERROR_ACTIVE_CONNECTIONS                                                       = 2402
   4227 	ERROR_ADAP_HDW_ERR                                                             = 57
   4228 	ERROR_ADDRESS_ALREADY_ASSOCIATED                                               = 1227
   4229 	ERROR_ADDRESS_NOT_ASSOCIATED                                                   = 1228
   4230 	ERROR_ADVANCED_INSTALLER_FAILED                                                = 14099
   4231 	ERROR_ALERTED                                                                  = 739
   4232 	ERROR_ALIAS_EXISTS                                                             = 1379
   4233 	ERROR_ALLOTTED_SPACE_EXCEEDED                                                  = 1344
   4234 	ERROR_ALL_NODES_NOT_AVAILABLE                                                  = 5037
   4235 	ERROR_ALL_USER_TRUST_QUOTA_EXCEEDED                                            = 1933
   4236 	ERROR_ALREADY_ASSIGNED                                                         = 85
   4237 	ERROR_ALREADY_EXISTS                                                           = 183
   4238 	ERROR_ALREADY_FIBER                                                            = 1280
   4239 	ERROR_ALREADY_INITIALIZED                                                      = 1247
   4240 	ERROR_ALREADY_REGISTERED                                                       = 1242
   4241 	ERROR_ALREADY_RUNNING_LKG                                                      = 1074
   4242 	ERROR_ALREADY_THREAD                                                           = 1281
   4243 	ERROR_ALREADY_WAITING                                                          = 1904
   4244 	ERROR_AMBIGUOUS_SYSTEM_DEVICE                                                  = 15250
   4245 	ERROR_API_UNAVAILABLE                                                          = 15841
   4246 	ERROR_APPHELP_BLOCK                                                            = 1259
   4247 	ERROR_APPX_INTEGRITY_FAILURE_CLR_NGEN                                          = 15624
   4248 	ERROR_APP_WRONG_OS                                                             = 1151
   4249 	ERROR_ARENA_TRASHED                                                            = 7
   4250 	ERROR_ARITHMETIC_OVERFLOW                                                      = 534
   4251 	ERROR_ATOMIC_LOCKS_NOT_SUPPORTED                                               = 174
   4252 	ERROR_AUTHENTICATION_FIREWALL_FAILED                                           = 1935
   4253 	ERROR_AUTHIP_FAILURE                                                           = 1469
   4254 	ERROR_AUTODATASEG_EXCEEDS_64k                                                  = 199
   4255 	ERROR_BADDB                                                                    = 1009
   4256 	ERROR_BADKEY                                                                   = 1010
   4257 	ERROR_BAD_ARGUMENTS                                                            = 160
   4258 	ERROR_BAD_COMMAND                                                              = 22
   4259 	ERROR_BAD_CONFIGURATION                                                        = 1610
   4260 	ERROR_BAD_DESCRIPTOR_FORMAT                                                    = 1361
   4261 	ERROR_BAD_DEVICE                                                               = 1200
   4262 	ERROR_BAD_DEV_TYPE                                                             = 66
   4263 	ERROR_BAD_DRIVER                                                               = 2001
   4264 	ERROR_BAD_DRIVER_LEVEL                                                         = 119
   4265 	ERROR_BAD_ENVIRONMENT                                                          = 10
   4266 	ERROR_BAD_EXE_FORMAT                                                           = 193
   4267 	ERROR_BAD_FILE_TYPE                                                            = 222
   4268 	ERROR_BAD_FORMAT                                                               = 11
   4269 	ERROR_BAD_IMPERSONATION_LEVEL                                                  = 1346
   4270 	ERROR_BAD_INHERITANCE_ACL                                                      = 1340
   4271 	ERROR_BAD_LENGTH                                                               = 24
   4272 	ERROR_BAD_LOGON_SESSION_STATE                                                  = 1365
   4273 	ERROR_BAD_NETPATH                                                              = 53
   4274 	ERROR_BAD_NET_NAME                                                             = 67
   4275 	ERROR_BAD_NET_RESP                                                             = 58
   4276 	ERROR_BAD_PATHNAME                                                             = 161
   4277 	ERROR_BAD_PIPE                                                                 = 230
   4278 	ERROR_BAD_PROFILE                                                              = 1206
   4279 	ERROR_BAD_PROVIDER                                                             = 1204
   4280 	ERROR_BAD_QUERY_SYNTAX                                                         = 1615
   4281 	ERROR_BAD_RECOVERY_POLICY                                                      = 6012
   4282 	ERROR_BAD_REM_ADAP                                                             = 60
   4283 	ERROR_BAD_THREADID_ADDR                                                        = 159
   4284 	ERROR_BAD_TOKEN_TYPE                                                           = 1349
   4285 	ERROR_BAD_UNIT                                                                 = 20
   4286 	ERROR_BAD_USERNAME                                                             = 2202
   4287 	ERROR_BAD_USER_PROFILE                                                         = 1253
   4288 	ERROR_BAD_VALIDATION_CLASS                                                     = 1348
   4289 	ERROR_BEGINNING_OF_MEDIA                                                       = 1102
   4290 	ERROR_BIDI_DEVICE_OFFLINE                                                      = 13004
   4291 	ERROR_BIDI_ERROR_BASE                                                          = 13000
   4292 	ERROR_BIDI_NOT_SUPPORTED                                                       = 50
   4293 	ERROR_BIDI_SCHEMA_NOT_SUPPORTED                                                = 13005
   4294 	ERROR_BIDI_SCHEMA_READ_ONLY                                                    = 13002
   4295 	ERROR_BIDI_SERVER_OFFLINE                                                      = 13003
   4296 	ERROR_BIDI_STATUS_OK                                                           = 0
   4297 	ERROR_BIDI_STATUS_WARNING                                                      = 13001
   4298 	ERROR_BOOT_ALREADY_ACCEPTED                                                    = 1076
   4299 	ERROR_BROKEN_PIPE                                                              = 109
   4300 	ERROR_BUFFER_OVERFLOW                                                          = 111
   4301 	ERROR_BUSY                                                                     = 170
   4302 	ERROR_BUSY_DRIVE                                                               = 142
   4303 	ERROR_BUS_RESET                                                                = 1111
   4304 	ERROR_CALLBACK_SUPPLIED_INVALID_DATA                                           = 1273
   4305 	ERROR_CALL_NOT_IMPLEMENTED                                                     = 120
   4306 	ERROR_CANCELLED                                                                = 1223
   4307 	ERROR_CANCEL_VIOLATION                                                         = 173
   4308 	ERROR_CANNOT_COPY                                                              = 266
   4309 	ERROR_CANNOT_DETECT_DRIVER_FAILURE                                             = 1080
   4310 	ERROR_CANNOT_DETECT_PROCESS_ABORT                                              = 1081
   4311 	ERROR_CANNOT_FIND_WND_CLASS                                                    = 1407
   4312 	ERROR_CANNOT_IMPERSONATE                                                       = 1368
   4313 	ERROR_CANNOT_MAKE                                                              = 82
   4314 	ERROR_CANNOT_OPEN_PROFILE                                                      = 1205
   4315 	ERROR_CANNOT_SWITCH_RUNLEVEL                                                   = 15400
   4316 	ERROR_CANTOPEN                                                                 = 1011
   4317 	ERROR_CANTREAD                                                                 = 1012
   4318 	ERROR_CANTWRITE                                                                = 1013
   4319 	ERROR_CANT_ACCESS_DOMAIN_INFO                                                  = 1351
   4320 	ERROR_CANT_ACCESS_FILE                                                         = 1920
   4321 	ERROR_CANT_DELETE_LAST_ITEM                                                    = 4335
   4322 	ERROR_CANT_DISABLE_MANDATORY                                                   = 1310
   4323 	ERROR_CANT_EVICT_ACTIVE_NODE                                                   = 5009
   4324 	ERROR_CANT_OPEN_ANONYMOUS                                                      = 1347
   4325 	ERROR_CANT_RESOLVE_FILENAME                                                    = 1921
   4326 	ERROR_CAN_NOT_COMPLETE                                                         = 1003
   4327 	ERROR_CAN_NOT_DEL_LOCAL_WINS                                                   = 4001
   4328 	ERROR_CHECKOUT_REQUIRED                                                        = 221
   4329 	ERROR_CHILD_MUST_BE_VOLATILE                                                   = 1021
   4330 	ERROR_CHILD_NOT_COMPLETE                                                       = 129
   4331 	ERROR_CHILD_WINDOW_MENU                                                        = 1436
   4332 	ERROR_CIRCULAR_DEPENDENCY                                                      = 1059
   4333 	ERROR_CLASS_ALREADY_EXISTS                                                     = 1410
   4334 	ERROR_CLASS_DOES_NOT_EXIST                                                     = 1411
   4335 	ERROR_CLASS_HAS_WINDOWS                                                        = 1412
   4336 	ERROR_CLEANER_CARTRIDGE_INSTALLED                                              = 4340
   4337 	ERROR_CLEANER_CARTRIDGE_SPENT                                                  = 4333
   4338 	ERROR_CLEANER_SLOT_NOT_SET                                                     = 4332
   4339 	ERROR_CLEANER_SLOT_SET                                                         = 4331
   4340 	ERROR_CLIPBOARD_NOT_OPEN                                                       = 1418
   4341 	ERROR_CLIPPING_NOT_SUPPORTED                                                   = 2005
   4342 	ERROR_CLUSCFG_ALREADY_COMMITTED                                                = 5901
   4343 	ERROR_CLUSCFG_ROLLBACK_FAILED                                                  = 5902
   4344 	ERROR_CLUSCFG_SYSTEM_DISK_DRIVE_LETTER_CONFLICT                                = 5903
   4345 	ERROR_CLUSTERLOG_CHKPOINT_NOT_FOUND                                            = 5032
   4346 	ERROR_CLUSTERLOG_CORRUPT                                                       = 5029
   4347 	ERROR_CLUSTERLOG_EXCEEDS_MAXSIZE                                               = 5031
   4348 	ERROR_CLUSTERLOG_NOT_ENOUGH_SPACE                                              = 5033
   4349 	ERROR_CLUSTERLOG_RECORD_EXCEEDS_MAXSIZE                                        = 5030
   4350 	ERROR_CLUSTER_CANT_CREATE_DUP_CLUSTER_NAME                                     = 5900
   4351 	ERROR_CLUSTER_DATABASE_SEQMISMATCH                                             = 5083
   4352 	ERROR_CLUSTER_EVICT_WITHOUT_CLEANUP                                            = 5896
   4353 	ERROR_CLUSTER_GUM_NOT_LOCKER                                                   = 5085
   4354 	ERROR_CLUSTER_INCOMPATIBLE_VERSIONS                                            = 5075
   4355 	ERROR_CLUSTER_INSTANCE_ID_MISMATCH                                             = 5893
   4356 	ERROR_CLUSTER_INVALID_NETWORK                                                  = 5054
   4357 	ERROR_CLUSTER_INVALID_NETWORK_PROVIDER                                         = 5049
   4358 	ERROR_CLUSTER_INVALID_NODE                                                     = 5039
   4359 	ERROR_CLUSTER_INVALID_REQUEST                                                  = 5048
   4360 	ERROR_CLUSTER_IPADDR_IN_USE                                                    = 5057
   4361 	ERROR_CLUSTER_JOIN_ABORTED                                                     = 5074
   4362 	ERROR_CLUSTER_JOIN_IN_PROGRESS                                                 = 5041
   4363 	ERROR_CLUSTER_JOIN_NOT_IN_PROGRESS                                             = 5053
   4364 	ERROR_CLUSTER_LAST_INTERNAL_NETWORK                                            = 5066
   4365 	ERROR_CLUSTER_LOCAL_NODE_NOT_FOUND                                             = 5043
   4366 	ERROR_CLUSTER_MAXNUM_OF_RESOURCES_EXCEEDED                                     = 5076
   4367 	ERROR_CLUSTER_MEMBERSHIP_HALT                                                  = 5892
   4368 	ERROR_CLUSTER_MEMBERSHIP_INVALID_STATE                                         = 5890
   4369 	ERROR_CLUSTER_MISMATCHED_COMPUTER_ACCT_NAME                                    = 5905
   4370 	ERROR_CLUSTER_NETINTERFACE_EXISTS                                              = 5046
   4371 	ERROR_CLUSTER_NETINTERFACE_NOT_FOUND                                           = 5047
   4372 	ERROR_CLUSTER_NETWORK_ALREADY_OFFLINE                                          = 5064
   4373 	ERROR_CLUSTER_NETWORK_ALREADY_ONLINE                                           = 5063
   4374 	ERROR_CLUSTER_NETWORK_EXISTS                                                   = 5044
   4375 	ERROR_CLUSTER_NETWORK_HAS_DEPENDENTS                                           = 5067
   4376 	ERROR_CLUSTER_NETWORK_NOT_FOUND                                                = 5045
   4377 	ERROR_CLUSTER_NETWORK_NOT_FOUND_FOR_IP                                         = 5894
   4378 	ERROR_CLUSTER_NETWORK_NOT_INTERNAL                                             = 5060
   4379 	ERROR_CLUSTER_NODE_ALREADY_DOWN                                                = 5062
   4380 	ERROR_CLUSTER_NODE_ALREADY_HAS_DFS_ROOT                                        = 5088
   4381 	ERROR_CLUSTER_NODE_ALREADY_MEMBER                                              = 5065
   4382 	ERROR_CLUSTER_NODE_ALREADY_UP                                                  = 5061
   4383 	ERROR_CLUSTER_NODE_DOWN                                                        = 5050
   4384 	ERROR_CLUSTER_NODE_EXISTS                                                      = 5040
   4385 	ERROR_CLUSTER_NODE_NOT_FOUND                                                   = 5042
   4386 	ERROR_CLUSTER_NODE_NOT_MEMBER                                                  = 5052
   4387 	ERROR_CLUSTER_NODE_NOT_PAUSED                                                  = 5058
   4388 	ERROR_CLUSTER_NODE_NOT_READY                                                   = 5072
   4389 	ERROR_CLUSTER_NODE_PAUSED                                                      = 5070
   4390 	ERROR_CLUSTER_NODE_SHUTTING_DOWN                                               = 5073
   4391 	ERROR_CLUSTER_NODE_UNREACHABLE                                                 = 5051
   4392 	ERROR_CLUSTER_NODE_UP                                                          = 5056
   4393 	ERROR_CLUSTER_NO_RPC_PACKAGES_REGISTERED                                       = 5081
   4394 	ERROR_CLUSTER_NO_SECURITY_CONTEXT                                              = 5059
   4395 	ERROR_CLUSTER_OLD_VERSION                                                      = 5904
   4396 	ERROR_CLUSTER_OWNER_NOT_IN_PREFLIST                                            = 5082
   4397 	ERROR_CLUSTER_PARAMETER_MISMATCH                                               = 5897
   4398 	ERROR_CLUSTER_PROPERTY_DATA_TYPE_MISMATCH                                      = 5895
   4399 	ERROR_CLUSTER_QUORUMLOG_NOT_FOUND                                              = 5891
   4400 	ERROR_CLUSTER_RESNAME_NOT_FOUND                                                = 5080
   4401 	ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND                                          = 5078
   4402 	ERROR_CLUSTER_RESTYPE_NOT_SUPPORTED                                            = 5079
   4403 	ERROR_CLUSTER_SHUTTING_DOWN                                                    = 5022
   4404 	ERROR_CLUSTER_SYSTEM_CONFIG_CHANGED                                            = 5077
   4405 	ERROR_CLUSTER_WRONG_OS_VERSION                                                 = 5899
   4406 	ERROR_COLORSPACE_MISMATCH                                                      = 2021
   4407 	ERROR_COMMITMENT_LIMIT                                                         = 1455
   4408 	ERROR_COM_TASK_STOP_PENDING                                                    = 15501
   4409 	ERROR_CONNECTED_OTHER_PASSWORD                                                 = 2108
   4410 	ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT                                         = 2109
   4411 	ERROR_CONNECTION_ABORTED                                                       = 1236
   4412 	ERROR_CONNECTION_ACTIVE                                                        = 1230
   4413 	ERROR_CONNECTION_COUNT_LIMIT                                                   = 1238
   4414 	ERROR_CONNECTION_INVALID                                                       = 1229
   4415 	ERROR_CONNECTION_REFUSED                                                       = 1225
   4416 	ERROR_CONNECTION_UNAVAIL                                                       = 1201
   4417 	ERROR_CONTEXT_EXPIRED                                                          = 1931
   4418 	ERROR_CONTINUE                                                                 = 1246
   4419 	ERROR_CONTROLLING_IEPORT                                                       = 4329
   4420 	ERROR_CONTROL_ID_NOT_FOUND                                                     = 1421
   4421 	ERROR_CORE_RESOURCE                                                            = 5026
   4422 	ERROR_COUNTER_TIMEOUT                                                          = 1121
   4423 	ERROR_CRC                                                                      = 23
   4424 	ERROR_CREATE_FAILED                                                            = 1631
   4425 	ERROR_CSCSHARE_OFFLINE                                                         = 1262
   4426 	ERROR_CTX_BAD_VIDEO_MODE                                                       = 7025
   4427 	ERROR_CTX_CANNOT_MAKE_EVENTLOG_ENTRY                                           = 7005
   4428 	ERROR_CTX_CLIENT_LICENSE_IN_USE                                                = 7052
   4429 	ERROR_CTX_CLIENT_LICENSE_NOT_SET                                               = 7053
   4430 	ERROR_CTX_CLIENT_QUERY_TIMEOUT                                                 = 7040
   4431 	ERROR_CTX_CLOSE_PENDING                                                        = 7007
   4432 	ERROR_CTX_CONSOLE_CONNECT                                                      = 7042
   4433 	ERROR_CTX_CONSOLE_DISCONNECT                                                   = 7041
   4434 	ERROR_CTX_GRAPHICS_INVALID                                                     = 7035
   4435 	ERROR_CTX_INVALID_MODEMNAME                                                    = 7010
   4436 	ERROR_CTX_INVALID_PD                                                           = 7002
   4437 	ERROR_CTX_INVALID_WD                                                           = 7049
   4438 	ERROR_CTX_LICENSE_CLIENT_INVALID                                               = 7055
   4439 	ERROR_CTX_LICENSE_EXPIRED                                                      = 7056
   4440 	ERROR_CTX_LICENSE_NOT_AVAILABLE                                                = 7054
   4441 	ERROR_CTX_LOGON_DISABLED                                                       = 7037
   4442 	ERROR_CTX_MODEM_INF_NOT_FOUND                                                  = 7009
   4443 	ERROR_CTX_MODEM_RESPONSE_BUSY                                                  = 7015
   4444 	ERROR_CTX_MODEM_RESPONSE_ERROR                                                 = 7011
   4445 	ERROR_CTX_MODEM_RESPONSE_NO_CARRIER                                            = 7013
   4446 	ERROR_CTX_MODEM_RESPONSE_NO_DIALTONE                                           = 7014
   4447 	ERROR_CTX_MODEM_RESPONSE_TIMEOUT                                               = 7012
   4448 	ERROR_CTX_MODEM_RESPONSE_VOICE                                                 = 7016
   4449 	ERROR_CTX_NOT_CONSOLE                                                          = 7038
   4450 	ERROR_CTX_NO_OUTBUF                                                            = 7008
   4451 	ERROR_CTX_PD_NOT_FOUND                                                         = 7003
   4452 	ERROR_CTX_SERVICE_NAME_COLLISION                                               = 7006
   4453 	ERROR_CTX_SHADOW_DENIED                                                        = 7044
   4454 	ERROR_CTX_SHADOW_DISABLED                                                      = 7051
   4455 	ERROR_CTX_SHADOW_ENDED_BY_MODE_CHANGE                                          = 7058
   4456 	ERROR_CTX_SHADOW_INVALID                                                       = 7050
   4457 	ERROR_CTX_SHADOW_NOT_RUNNING                                                   = 7057
   4458 	ERROR_CTX_TD_ERROR                                                             = 7017
   4459 	ERROR_CTX_WD_NOT_FOUND                                                         = 7004
   4460 	ERROR_CTX_WINSTATION_ACCESS_DENIED                                             = 7045
   4461 	ERROR_CTX_WINSTATION_ALREADY_EXISTS                                            = 7023
   4462 	ERROR_CTX_WINSTATION_BUSY                                                      = 7024
   4463 	ERROR_CTX_WINSTATION_NAME_INVALID                                              = 7001
   4464 	ERROR_CTX_WINSTATION_NOT_FOUND                                                 = 7022
   4465 	ERROR_CURRENT_DIRECTORY                                                        = 16
   4466 	ERROR_CURRENT_DOMAIN_NOT_ALLOWED                                               = 1399
   4467 	ERROR_DATABASE_BACKUP_CORRUPT                                                  = 5087
   4468 	ERROR_DATABASE_DOES_NOT_EXIST                                                  = 1065
   4469 	ERROR_DATABASE_FAILURE                                                         = 4313
   4470 	ERROR_DATABASE_FULL                                                            = 4314
   4471 	ERROR_DATATYPE_MISMATCH                                                        = 1629
   4472 	ERROR_DC_NOT_FOUND                                                             = 1425
   4473 	ERROR_DDE_FAIL                                                                 = 1156
   4474 	ERROR_DEBUGGER_INACTIVE                                                        = 1284
   4475 	ERROR_DECRYPTION_FAILED                                                        = 6001
   4476 	ERROR_DELAY_LOAD_FAILED                                                        = 1285
   4477 	ERROR_DELETE_PENDING                                                           = 303
   4478 	ERROR_DELETING_EXISTING_APPLICATIONDATA_STORE_FAILED                           = 15621
   4479 	ERROR_DELETING_ICM_XFORM                                                       = 2019
   4480 	ERROR_DEPENDENCY_ALREADY_EXISTS                                                = 5003
   4481 	ERROR_DEPENDENCY_NOT_ALLOWED                                                   = 5069
   4482 	ERROR_DEPENDENCY_NOT_FOUND                                                     = 5002
   4483 	ERROR_DEPENDENT_RESOURCE_EXISTS                                                = 5001
   4484 	ERROR_DEPENDENT_SERVICES_RUNNING                                               = 1051
   4485 	ERROR_DEPLOYMENT_BLOCKED_BY_POLICY                                             = 15617
   4486 	ERROR_DESTINATION_ELEMENT_FULL                                                 = 1161
   4487 	ERROR_DESTROY_OBJECT_OF_OTHER_THREAD                                           = 1435
   4488 	ERROR_DEVICE_ALREADY_REMEMBERED                                                = 1202
   4489 	ERROR_DEVICE_DOOR_OPEN                                                         = 1166
   4490 	ERROR_DEVICE_IN_USE                                                            = 2404
   4491 	ERROR_DEVICE_NOT_AVAILABLE                                                     = 4319
   4492 	ERROR_DEVICE_NOT_CONNECTED                                                     = 1167
   4493 	ERROR_DEVICE_NOT_PARTITIONED                                                   = 1107
   4494 	ERROR_DEVICE_REINITIALIZATION_NEEDED                                           = 1164
   4495 	ERROR_DEVICE_REMOVED                                                           = 1617
   4496 	ERROR_DEVICE_REQUIRES_CLEANING                                                 = 1165
   4497 	ERROR_DEV_NOT_EXIST                                                            = 55
   4498 	ERROR_DHCP_ADDRESS_CONFLICT                                                    = 4100
   4499 	ERROR_DIFFERENT_SERVICE_ACCOUNT                                                = 1079
   4500 	ERROR_DIRECTORY                                                                = 267
   4501 	ERROR_DIRECT_ACCESS_HANDLE                                                     = 130
   4502 	ERROR_DIR_EFS_DISALLOWED                                                       = 6010
   4503 	ERROR_DIR_NOT_EMPTY                                                            = 145
   4504 	ERROR_DIR_NOT_ROOT                                                             = 144
   4505 	ERROR_DISCARDED                                                                = 157
   4506 	ERROR_DISK_CHANGE                                                              = 107
   4507 	ERROR_DISK_CORRUPT                                                             = 1393
   4508 	ERROR_DISK_FULL                                                                = 112
   4509 	ERROR_DISK_OPERATION_FAILED                                                    = 1127
   4510 	ERROR_DISK_RECALIBRATE_FAILED                                                  = 1126
   4511 	ERROR_DISK_RESET_FAILED                                                        = 1128
   4512 	ERROR_DISK_TOO_FRAGMENTED                                                      = 302
   4513 	ERROR_DLL_INIT_FAILED                                                          = 1114
   4514 	ERROR_DLL_NOT_FOUND                                                            = 1157
   4515 	ERROR_DOMAIN_CONTROLLER_EXISTS                                                 = 1250
   4516 	ERROR_DOMAIN_CONTROLLER_NOT_FOUND                                              = 1908
   4517 	ERROR_DOMAIN_EXISTS                                                            = 1356
   4518 	ERROR_DOMAIN_LIMIT_EXCEEDED                                                    = 1357
   4519 	ERROR_DOMAIN_TRUST_INCONSISTENT                                                = 1810
   4520 	ERROR_DOWNGRADE_DETECTED                                                       = 1265
   4521 	ERROR_DRIVER_BLOCKED                                                           = 1275
   4522 	ERROR_DRIVE_LOCKED                                                             = 108
   4523 	ERROR_DRIVE_MEDIA_MISMATCH                                                     = 4303
   4524 	ERROR_DRIVE_NOT_INSTALLED                                                      = 0x00000008
   4525 	ERROR_DS_ADD_REPLICA_INHIBITED                                                 = 8302
   4526 	ERROR_DS_ADMIN_LIMIT_EXCEEDED                                                  = 8228
   4527 	ERROR_DS_AFFECTS_MULTIPLE_DSAS                                                 = 8249
   4528 	ERROR_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER                                         = 8578
   4529 	ERROR_DS_ALIASED_OBJ_MISSING                                                   = 8334
   4530 	ERROR_DS_ALIAS_DEREF_PROBLEM                                                   = 8244
   4531 	ERROR_DS_ALIAS_POINTS_TO_ALIAS                                                 = 8336
   4532 	ERROR_DS_ALIAS_PROBLEM                                                         = 8241
   4533 	ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS                                             = 8205
   4534 	ERROR_DS_ATTRIBUTE_OWNED_BY_SAM                                                = 8346
   4535 	ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED                                              = 8204
   4536 	ERROR_DS_ATT_ALREADY_EXISTS                                                    = 8318
   4537 	ERROR_DS_ATT_IS_NOT_ON_OBJ                                                     = 8310
   4538 	ERROR_DS_ATT_NOT_DEF_FOR_CLASS                                                 = 8317
   4539 	ERROR_DS_ATT_NOT_DEF_IN_SCHEMA                                                 = 8303
   4540 	ERROR_DS_ATT_SCHEMA_REQ_ID                                                     = 8399
   4541 	ERROR_DS_ATT_SCHEMA_REQ_SYNTAX                                                 = 8416
   4542 	ERROR_DS_ATT_VAL_ALREADY_EXISTS                                                = 8323
   4543 	ERROR_DS_AUTHORIZATION_FAILED                                                  = 8599
   4544 	ERROR_DS_AUTH_METHOD_NOT_SUPPORTED                                             = 8231
   4545 	ERROR_DS_AUTH_UNKNOWN                                                          = 8234
   4546 	ERROR_DS_AUX_CLS_TEST_FAIL                                                     = 8389
   4547 	ERROR_DS_BACKLINK_WITHOUT_LINK                                                 = 8482
   4548 	ERROR_DS_BAD_ATT_SCHEMA_SYNTAX                                                 = 8400
   4549 	ERROR_DS_BAD_HIERARCHY_FILE                                                    = 8425
   4550 	ERROR_DS_BAD_INSTANCE_TYPE                                                     = 8313
   4551 	ERROR_DS_BAD_NAME_SYNTAX                                                       = 8335
   4552 	ERROR_DS_BAD_RDN_ATT_ID_SYNTAX                                                 = 8392
   4553 	ERROR_DS_BUILD_HIERARCHY_TABLE_FAILED                                          = 8426
   4554 	ERROR_DS_BUSY                                                                  = 8206
   4555 	ERROR_DS_CANT_ACCESS_REMOTE_PART_OF_AD                                         = 8585
   4556 	ERROR_DS_CANT_ADD_ATT_VALUES                                                   = 8320
   4557 	ERROR_DS_CANT_ADD_SYSTEM_ONLY                                                  = 8358
   4558 	ERROR_DS_CANT_ADD_TO_GC                                                        = 8550
   4559 	ERROR_DS_CANT_CACHE_ATT                                                        = 8401
   4560 	ERROR_DS_CANT_CACHE_CLASS                                                      = 8402
   4561 	ERROR_DS_CANT_CREATE_IN_NONDOMAIN_NC                                           = 8553
   4562 	ERROR_DS_CANT_CREATE_UNDER_SCHEMA                                              = 8510
   4563 	ERROR_DS_CANT_DELETE                                                           = 8398
   4564 	ERROR_DS_CANT_DELETE_DSA_OBJ                                                   = 8340
   4565 	ERROR_DS_CANT_DEL_MASTER_CROSSREF                                              = 8375
   4566 	ERROR_DS_CANT_DEMOTE_WITH_WRITEABLE_NC                                         = 8604
   4567 	ERROR_DS_CANT_DEREF_ALIAS                                                      = 8337
   4568 	ERROR_DS_CANT_DERIVE_SPN_FOR_DELETED_DOMAIN                                    = 8603
   4569 	ERROR_DS_CANT_DERIVE_SPN_WITHOUT_SERVER_REF                                    = 8589
   4570 	ERROR_DS_CANT_FIND_DC_FOR_SRC_DOMAIN                                           = 8537
   4571 	ERROR_DS_CANT_FIND_DSA_OBJ                                                     = 8419
   4572 	ERROR_DS_CANT_FIND_EXPECTED_NC                                                 = 8420
   4573 	ERROR_DS_CANT_FIND_NC_IN_CACHE                                                 = 8421
   4574 	ERROR_DS_CANT_MIX_MASTER_AND_REPS                                              = 8331
   4575 	ERROR_DS_CANT_MOD_OBJ_CLASS                                                    = 8215
   4576 	ERROR_DS_CANT_MOD_PRIMARYGROUPID                                               = 8506
   4577 	ERROR_DS_CANT_MOD_SYSTEM_ONLY                                                  = 8369
   4578 	ERROR_DS_CANT_MOVE_ACCOUNT_GROUP                                               = 8498
   4579 	ERROR_DS_CANT_MOVE_APP_BASIC_GROUP                                             = 8608
   4580 	ERROR_DS_CANT_MOVE_APP_QUERY_GROUP                                             = 8609
   4581 	ERROR_DS_CANT_MOVE_DELETED_OBJECT                                              = 8489
   4582 	ERROR_DS_CANT_MOVE_RESOURCE_GROUP                                              = 8499
   4583 	ERROR_DS_CANT_ON_NON_LEAF                                                      = 8213
   4584 	ERROR_DS_CANT_ON_RDN                                                           = 8214
   4585 	ERROR_DS_CANT_REMOVE_ATT_CACHE                                                 = 8403
   4586 	ERROR_DS_CANT_REMOVE_CLASS_CACHE                                               = 8404
   4587 	ERROR_DS_CANT_REM_MISSING_ATT                                                  = 8324
   4588 	ERROR_DS_CANT_REM_MISSING_ATT_VAL                                              = 8325
   4589 	ERROR_DS_CANT_REPLACE_HIDDEN_REC                                               = 8424
   4590 	ERROR_DS_CANT_RETRIEVE_ATTS                                                    = 8481
   4591 	ERROR_DS_CANT_RETRIEVE_CHILD                                                   = 8422
   4592 	ERROR_DS_CANT_RETRIEVE_DN                                                      = 8405
   4593 	ERROR_DS_CANT_RETRIEVE_INSTANCE                                                = 8407
   4594 	ERROR_DS_CANT_RETRIEVE_SD                                                      = 8526
   4595 	ERROR_DS_CANT_START                                                            = 8531
   4596 	ERROR_DS_CANT_TREE_DELETE_CRITICAL_OBJ                                         = 8560
   4597 	ERROR_DS_CANT_WITH_ACCT_GROUP_MEMBERSHPS                                       = 8493
   4598 	ERROR_DS_CHILDREN_EXIST                                                        = 8332
   4599 	ERROR_DS_CLASS_MUST_BE_CONCRETE                                                = 8359
   4600 	ERROR_DS_CLASS_NOT_DSA                                                         = 8343
   4601 	ERROR_DS_CLIENT_LOOP                                                           = 8259
   4602 	ERROR_DS_CODE_INCONSISTENCY                                                    = 8408
   4603 	ERROR_DS_COMPARE_FALSE                                                         = 8229
   4604 	ERROR_DS_COMPARE_TRUE                                                          = 8230
   4605 	ERROR_DS_CONFIDENTIALITY_REQUIRED                                              = 8237
   4606 	ERROR_DS_CONFIG_PARAM_MISSING                                                  = 8427
   4607 	ERROR_DS_CONSTRAINT_VIOLATION                                                  = 8239
   4608 	ERROR_DS_CONSTRUCTED_ATT_MOD                                                   = 8475
   4609 	ERROR_DS_CONTROL_NOT_FOUND                                                     = 8258
   4610 	ERROR_DS_COULDNT_CONTACT_FSMO                                                  = 8367
   4611 	ERROR_DS_COULDNT_IDENTIFY_OBJECTS_FOR_TREE_DELETE                              = 8503
   4612 	ERROR_DS_COULDNT_LOCK_TREE_FOR_DELETE                                          = 8502
   4613 	ERROR_DS_COULDNT_UPDATE_SPNS                                                   = 8525
   4614 	ERROR_DS_COUNTING_AB_INDICES_FAILED                                            = 8428
   4615 	ERROR_DS_CROSS_DOMAIN_CLEANUP_REQD                                             = 8491
   4616 	ERROR_DS_CROSS_DOM_MOVE_ERROR                                                  = 8216
   4617 	ERROR_DS_CROSS_NC_DN_RENAME                                                    = 8368
   4618 	ERROR_DS_CROSS_REF_BUSY                                                        = 8602
   4619 	ERROR_DS_CROSS_REF_EXISTS                                                      = 8374
   4620 	ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE                                             = 8495
   4621 	ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE_V2                                          = 8586
   4622 	ERROR_DS_DATABASE_ERROR                                                        = 8409
   4623 	ERROR_DS_DECODING_ERROR                                                        = 8253
   4624 	ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED                                      = 8536
   4625 	ERROR_DS_DESTINATION_DOMAIN_NOT_IN_FOREST                                      = 8535
   4626 	ERROR_DS_DIFFERENT_REPL_EPOCHS                                                 = 8593
   4627 	ERROR_DS_DISALLOWED_IN_SYSTEM_CONTAINER                                        = 8615
   4628 	ERROR_DS_DNS_LOOKUP_FAILURE                                                    = 8524
   4629 	ERROR_DS_DOMAIN_RENAME_IN_PROGRESS                                             = 8612
   4630 	ERROR_DS_DOMAIN_VERSION_TOO_HIGH                                               = 8564
   4631 	ERROR_DS_DOMAIN_VERSION_TOO_LOW                                                = 8566
   4632 	ERROR_DS_DRA_ABANDON_SYNC                                                      = 8462
   4633 	ERROR_DS_DRA_ACCESS_DENIED                                                     = 8453
   4634 	ERROR_DS_DRA_BAD_DN                                                            = 8439
   4635 	ERROR_DS_DRA_BAD_INSTANCE_TYPE                                                 = 8445
   4636 	ERROR_DS_DRA_BAD_NC                                                            = 8440
   4637 	ERROR_DS_DRA_BUSY                                                              = 8438
   4638 	ERROR_DS_DRA_CONNECTION_FAILED                                                 = 8444
   4639 	ERROR_DS_DRA_DB_ERROR                                                          = 8451
   4640 	ERROR_DS_DRA_DN_EXISTS                                                         = 8441
   4641 	ERROR_DS_DRA_EARLIER_SCHEMA_CONFLICT                                           = 8544
   4642 	ERROR_DS_DRA_EXTN_CONNECTION_FAILED                                            = 8466
   4643 	ERROR_DS_DRA_GENERIC                                                           = 8436
   4644 	ERROR_DS_DRA_INCOMPATIBLE_PARTIAL_SET                                          = 8464
   4645 	ERROR_DS_DRA_INCONSISTENT_DIT                                                  = 8443
   4646 	ERROR_DS_DRA_INTERNAL_ERROR                                                    = 8442
   4647 	ERROR_DS_DRA_INVALID_PARAMETER                                                 = 8437
   4648 	ERROR_DS_DRA_MAIL_PROBLEM                                                      = 8447
   4649 	ERROR_DS_DRA_MISSING_PARENT                                                    = 8460
   4650 	ERROR_DS_DRA_NAME_COLLISION                                                    = 8458
   4651 	ERROR_DS_DRA_NOT_SUPPORTED                                                     = 8454
   4652 	ERROR_DS_DRA_NO_REPLICA                                                        = 8452
   4653 	ERROR_DS_DRA_OBJ_IS_REP_SOURCE                                                 = 8450
   4654 	ERROR_DS_DRA_OBJ_NC_MISMATCH                                                   = 8545
   4655 	ERROR_DS_DRA_OUT_OF_MEM                                                        = 8446
   4656 	ERROR_DS_DRA_OUT_SCHEDULE_WINDOW                                               = 8617
   4657 	ERROR_DS_DRA_PREEMPTED                                                         = 8461
   4658 	ERROR_DS_DRA_REF_ALREADY_EXISTS                                                = 8448
   4659 	ERROR_DS_DRA_REF_NOT_FOUND                                                     = 8449
   4660 	ERROR_DS_DRA_REPL_PENDING                                                      = 8477
   4661 	ERROR_DS_DRA_RPC_CANCELLED                                                     = 8455
   4662 	ERROR_DS_DRA_SCHEMA_CONFLICT                                                   = 8543
   4663 	ERROR_DS_DRA_SCHEMA_INFO_SHIP                                                  = 8542
   4664 	ERROR_DS_DRA_SCHEMA_MISMATCH                                                   = 8418
   4665 	ERROR_DS_DRA_SHUTDOWN                                                          = 8463
   4666 	ERROR_DS_DRA_SINK_DISABLED                                                     = 8457
   4667 	ERROR_DS_DRA_SOURCE_DISABLED                                                   = 8456
   4668 	ERROR_DS_DRA_SOURCE_IS_PARTIAL_REPLICA                                         = 8465
   4669 	ERROR_DS_DRA_SOURCE_REINSTALLED                                                = 8459
   4670 	ERROR_DS_DRS_EXTENSIONS_CHANGED                                                = 8594
   4671 	ERROR_DS_DSA_MUST_BE_INT_MASTER                                                = 8342
   4672 	ERROR_DS_DST_DOMAIN_NOT_NATIVE                                                 = 8496
   4673 	ERROR_DS_DST_NC_MISMATCH                                                       = 8486
   4674 	ERROR_DS_DS_REQUIRED                                                           = 8478
   4675 	ERROR_DS_DUPLICATE_ID_FOUND                                                    = 8605
   4676 	ERROR_DS_DUP_LDAP_DISPLAY_NAME                                                 = 8382
   4677 	ERROR_DS_DUP_LINK_ID                                                           = 8468
   4678 	ERROR_DS_DUP_MAPI_ID                                                           = 8380
   4679 	ERROR_DS_DUP_MSDS_INTID                                                        = 8597
   4680 	ERROR_DS_DUP_OID                                                               = 8379
   4681 	ERROR_DS_DUP_RDN                                                               = 8378
   4682 	ERROR_DS_DUP_SCHEMA_ID_GUID                                                    = 8381
   4683 	ERROR_DS_ENCODING_ERROR                                                        = 8252
   4684 	ERROR_DS_EPOCH_MISMATCH                                                        = 8483
   4685 	ERROR_DS_EXISTING_AD_CHILD_NC                                                  = 8613
   4686 	ERROR_DS_EXISTS_IN_AUX_CLS                                                     = 8393
   4687 	ERROR_DS_EXISTS_IN_MAY_HAVE                                                    = 8386
   4688 	ERROR_DS_EXISTS_IN_MUST_HAVE                                                   = 8385
   4689 	ERROR_DS_EXISTS_IN_POSS_SUP                                                    = 8395
   4690 	ERROR_DS_EXISTS_IN_RDNATTID                                                    = 8598
   4691 	ERROR_DS_EXISTS_IN_SUB_CLS                                                     = 8394
   4692 	ERROR_DS_FILTER_UNKNOWN                                                        = 8254
   4693 	ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS                                          = 8555
   4694 	ERROR_DS_FOREST_VERSION_TOO_HIGH                                               = 8563
   4695 	ERROR_DS_FOREST_VERSION_TOO_LOW                                                = 8565
   4696 	ERROR_DS_GCVERIFY_ERROR                                                        = 8417
   4697 	ERROR_DS_GC_NOT_AVAILABLE                                                      = 8217
   4698 	ERROR_DS_GC_REQUIRED                                                           = 8547
   4699 	ERROR_DS_GENERIC_ERROR                                                         = 8341
   4700 	ERROR_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER                                   = 8519
   4701 	ERROR_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER                                         = 8516
   4702 	ERROR_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER                                     = 8517
   4703 	ERROR_DS_GOVERNSID_MISSING                                                     = 8410
   4704 	ERROR_DS_GROUP_CONVERSION_ERROR                                                = 8607
   4705 	ERROR_DS_HAVE_PRIMARY_MEMBERS                                                  = 8521
   4706 	ERROR_DS_HIERARCHY_TABLE_MALLOC_FAILED                                         = 8429
   4707 	ERROR_DS_ILLEGAL_BASE_SCHEMA_MOD                                               = 8507
   4708 	ERROR_DS_ILLEGAL_MOD_OPERATION                                                 = 8311
   4709 	ERROR_DS_ILLEGAL_SUPERIOR                                                      = 8345
   4710 	ERROR_DS_ILLEGAL_XDOM_MOVE_OPERATION                                           = 8492
   4711 	ERROR_DS_INAPPROPRIATE_AUTH                                                    = 8233
   4712 	ERROR_DS_INAPPROPRIATE_MATCHING                                                = 8238
   4713 	ERROR_DS_INCOMPATIBLE_CONTROLS_USED                                            = 8574
   4714 	ERROR_DS_INCOMPATIBLE_VERSION                                                  = 8567
   4715 	ERROR_DS_INCORRECT_ROLE_OWNER                                                  = 8210
   4716 	ERROR_DS_INIT_FAILURE                                                          = 8532
   4717 	ERROR_DS_INIT_FAILURE_CONSOLE                                                  = 8561
   4718 	ERROR_DS_INSTALL_NO_SCH_VERSION_IN_INIFILE                                     = 8512
   4719 	ERROR_DS_INSTALL_NO_SRC_SCH_VERSION                                            = 8511
   4720 	ERROR_DS_INSTALL_SCHEMA_MISMATCH                                               = 8467
   4721 	ERROR_DS_INSUFFICIENT_ATTR_TO_CREATE_OBJECT                                    = 8606
   4722 	ERROR_DS_INSUFF_ACCESS_RIGHTS                                                  = 8344
   4723 	ERROR_DS_INTERNAL_FAILURE                                                      = 8430
   4724 	ERROR_DS_INVALID_ATTRIBUTE_SYNTAX                                              = 8203
   4725 	ERROR_DS_INVALID_DMD                                                           = 8360
   4726 	ERROR_DS_INVALID_DN_SYNTAX                                                     = 8242
   4727 	ERROR_DS_INVALID_GROUP_TYPE                                                    = 8513
   4728 	ERROR_DS_INVALID_LDAP_DISPLAY_NAME                                             = 8479
   4729 	ERROR_DS_INVALID_NAME_FOR_SPN                                                  = 8554
   4730 	ERROR_DS_INVALID_ROLE_OWNER                                                    = 8366
   4731 	ERROR_DS_INVALID_SCRIPT                                                        = 8600
   4732 	ERROR_DS_INVALID_SEARCH_FLAG                                                   = 8500
   4733 	ERROR_DS_IS_LEAF                                                               = 8243
   4734 	ERROR_DS_KEY_NOT_UNIQUE                                                        = 8527
   4735 	ERROR_DS_LDAP_SEND_QUEUE_FULL                                                  = 8616
   4736 	ERROR_DS_LINK_ID_NOT_AVAILABLE                                                 = 8577
   4737 	ERROR_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER                              = 8520
   4738 	ERROR_DS_LOCAL_ERROR                                                           = 8251
   4739 	ERROR_DS_LOCAL_MEMBER_OF_LOCAL_ONLY                                            = 8548
   4740 	ERROR_DS_LOOP_DETECT                                                           = 8246
   4741 	ERROR_DS_LOW_DSA_VERSION                                                       = 8568
   4742 	ERROR_DS_MACHINE_ACCOUNT_CREATED_PRENT4                                        = 8572
   4743 	ERROR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED                                        = 8557
   4744 	ERROR_DS_MASTERDSA_REQUIRED                                                    = 8314
   4745 	ERROR_DS_MAX_OBJ_SIZE_EXCEEDED                                                 = 8304
   4746 	ERROR_DS_MEMBERSHIP_EVALUATED_LOCALLY                                          = 8201
   4747 	ERROR_DS_MISSING_EXPECTED_ATT                                                  = 8411
   4748 	ERROR_DS_MISSING_FSMO_SETTINGS                                                 = 8434
   4749 	ERROR_DS_MISSING_INFRASTRUCTURE_CONTAINER                                      = 8497
   4750 	ERROR_DS_MISSING_REQUIRED_ATT                                                  = 8316
   4751 	ERROR_DS_MISSING_SUPREF                                                        = 8406
   4752 	ERROR_DS_MODIFYDN_DISALLOWED_BY_FLAG                                           = 8581
   4753 	ERROR_DS_MODIFYDN_DISALLOWED_BY_INSTANCE_TYPE                                  = 8579
   4754 	ERROR_DS_MODIFYDN_WRONG_GRANDPARENT                                            = 8582
   4755 	ERROR_DS_MUST_BE_RUN_ON_DST_DC                                                 = 8558
   4756 	ERROR_DS_NAME_ERROR_DOMAIN_ONLY                                                = 8473
   4757 	ERROR_DS_NAME_ERROR_NOT_FOUND                                                  = 8470
   4758 	ERROR_DS_NAME_ERROR_NOT_UNIQUE                                                 = 8471
   4759 	ERROR_DS_NAME_ERROR_NO_MAPPING                                                 = 8472
   4760 	ERROR_DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING                                     = 8474
   4761 	ERROR_DS_NAME_ERROR_RESOLVING                                                  = 8469
   4762 	ERROR_DS_NAME_ERROR_TRUST_REFERRAL                                             = 8583
   4763 	ERROR_DS_NAME_NOT_UNIQUE                                                       = 8571
   4764 	ERROR_DS_NAME_REFERENCE_INVALID                                                = 8373
   4765 	ERROR_DS_NAME_TOO_LONG                                                         = 8348
   4766 	ERROR_DS_NAME_TOO_MANY_PARTS                                                   = 8347
   4767 	ERROR_DS_NAME_TYPE_UNKNOWN                                                     = 8351
   4768 	ERROR_DS_NAME_UNPARSEABLE                                                      = 8350
   4769 	ERROR_DS_NAME_VALUE_TOO_LONG                                                   = 8349
   4770 	ERROR_DS_NAMING_MASTER_GC                                                      = 8523
   4771 	ERROR_DS_NAMING_VIOLATION                                                      = 8247
   4772 	ERROR_DS_NCNAME_MISSING_CR_REF                                                 = 8412
   4773 	ERROR_DS_NCNAME_MUST_BE_NC                                                     = 8357
   4774 	ERROR_DS_NC_MUST_HAVE_NC_PARENT                                                = 8494
   4775 	ERROR_DS_NC_STILL_HAS_DSAS                                                     = 8546
   4776 	ERROR_DS_NONEXISTENT_MAY_HAVE                                                  = 8387
   4777 	ERROR_DS_NONEXISTENT_MUST_HAVE                                                 = 8388
   4778 	ERROR_DS_NONEXISTENT_POSS_SUP                                                  = 8390
   4779 	ERROR_DS_NONSAFE_SCHEMA_CHANGE                                                 = 8508
   4780 	ERROR_DS_NON_BASE_SEARCH                                                       = 8480
   4781 	ERROR_DS_NOTIFY_FILTER_TOO_COMPLEX                                             = 8377
   4782 	ERROR_DS_NOT_AN_OBJECT                                                         = 8352
   4783 	ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC                                            = 8487
   4784 	ERROR_DS_NOT_CLOSEST                                                           = 8588
   4785 	ERROR_DS_NOT_INSTALLED                                                         = 8200
   4786 	ERROR_DS_NOT_ON_BACKLINK                                                       = 8362
   4787 	ERROR_DS_NOT_SUPPORTED                                                         = 8256
   4788 	ERROR_DS_NOT_SUPPORTED_SORT_ORDER                                              = 8570
   4789 	ERROR_DS_NO_ATTRIBUTE_OR_VALUE                                                 = 8202
   4790 	ERROR_DS_NO_BEHAVIOR_VERSION_IN_MIXEDDOMAIN                                    = 8569
   4791 	ERROR_DS_NO_CHAINED_EVAL                                                       = 8328
   4792 	ERROR_DS_NO_CHAINING                                                           = 8327
   4793 	ERROR_DS_NO_CHECKPOINT_WITH_PDC                                                = 8551
   4794 	ERROR_DS_NO_CROSSREF_FOR_NC                                                    = 8363
   4795 	ERROR_DS_NO_DELETED_NAME                                                       = 8355
   4796 	ERROR_DS_NO_FPO_IN_UNIVERSAL_GROUPS                                            = 8549
   4797 	ERROR_DS_NO_MORE_RIDS                                                          = 8209
   4798 	ERROR_DS_NO_MSDS_INTID                                                         = 8596
   4799 	ERROR_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN                                    = 8514
   4800 	ERROR_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN                                     = 8515
   4801 	ERROR_DS_NO_OBJECT_MOVE_IN_SCHEMA_NC                                           = 8580
   4802 	ERROR_DS_NO_PARENT_OBJECT                                                      = 8329
   4803 	ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION                                          = 8533
   4804 	ERROR_DS_NO_RDN_DEFINED_IN_SCHEMA                                              = 8306
   4805 	ERROR_DS_NO_REF_DOMAIN                                                         = 8575
   4806 	ERROR_DS_NO_REQUESTED_ATTS_FOUND                                               = 8308
   4807 	ERROR_DS_NO_RESULTS_RETURNED                                                   = 8257
   4808 	ERROR_DS_NO_RIDS_ALLOCATED                                                     = 8208
   4809 	ERROR_DS_NO_SUCH_OBJECT                                                        = 8240
   4810 	ERROR_DS_NO_TREE_DELETE_ABOVE_NC                                               = 8501
   4811 	ERROR_DS_NTDSCRIPT_PROCESS_ERROR                                               = 8592
   4812 	ERROR_DS_NTDSCRIPT_SYNTAX_ERROR                                                = 8591
   4813 	ERROR_DS_OBJECT_BEING_REMOVED                                                  = 8339
   4814 	ERROR_DS_OBJECT_CLASS_REQUIRED                                                 = 8315
   4815 	ERROR_DS_OBJECT_RESULTS_TOO_LARGE                                              = 8248
   4816 	ERROR_DS_OBJ_CLASS_NOT_DEFINED                                                 = 8371
   4817 	ERROR_DS_OBJ_CLASS_NOT_SUBCLASS                                                = 8372
   4818 	ERROR_DS_OBJ_CLASS_VIOLATION                                                   = 8212
   4819 	ERROR_DS_OBJ_GUID_EXISTS                                                       = 8361
   4820 	ERROR_DS_OBJ_NOT_FOUND                                                         = 8333
   4821 	ERROR_DS_OBJ_STRING_NAME_EXISTS                                                = 8305
   4822 	ERROR_DS_OBJ_TOO_LARGE                                                         = 8312
   4823 	ERROR_DS_OFFSET_RANGE_ERROR                                                    = 8262
   4824 	ERROR_DS_OPERATIONS_ERROR                                                      = 8224
   4825 	ERROR_DS_OUT_OF_SCOPE                                                          = 8338
   4826 	ERROR_DS_OUT_OF_VERSION_STORE                                                  = 8573
   4827 	ERROR_DS_PARAM_ERROR                                                           = 8255
   4828 	ERROR_DS_PARENT_IS_AN_ALIAS                                                    = 8330
   4829 	ERROR_DS_PDC_OPERATION_IN_PROGRESS                                             = 8490
   4830 	ERROR_DS_PROTOCOL_ERROR                                                        = 8225
   4831 	ERROR_DS_RANGE_CONSTRAINT                                                      = 8322
   4832 	ERROR_DS_RDN_DOESNT_MATCH_SCHEMA                                               = 8307
   4833 	ERROR_DS_RECALCSCHEMA_FAILED                                                   = 8396
   4834 	ERROR_DS_REFERRAL                                                              = 8235
   4835 	ERROR_DS_REFERRAL_LIMIT_EXCEEDED                                               = 8260
   4836 	ERROR_DS_REFUSING_FSMO_ROLES                                                   = 8433
   4837 	ERROR_DS_REMOTE_CROSSREF_OP_FAILED                                             = 8601
   4838 	ERROR_DS_REPLICATOR_ONLY                                                       = 8370
   4839 	ERROR_DS_REPLICA_SET_CHANGE_NOT_ALLOWED_ON_DISABLED_CR                         = 8595
   4840 	ERROR_DS_REPL_LIFETIME_EXCEEDED                                                = 8614
   4841 	ERROR_DS_RESERVED_LINK_ID                                                      = 8576
   4842 	ERROR_DS_RIDMGR_INIT_ERROR                                                     = 8211
   4843 	ERROR_DS_ROLE_NOT_VERIFIED                                                     = 8610
   4844 	ERROR_DS_ROOT_CANT_BE_SUBREF                                                   = 8326
   4845 	ERROR_DS_ROOT_MUST_BE_NC                                                       = 8301
   4846 	ERROR_DS_ROOT_REQUIRES_CLASS_TOP                                               = 8432
   4847 	ERROR_DS_SAM_INIT_FAILURE                                                      = 8504
   4848 	ERROR_DS_SAM_INIT_FAILURE_CONSOLE                                              = 8562
   4849 	ERROR_DS_SAM_NEED_BOOTKEY_FLOPPY                                               = 8530
   4850 	ERROR_DS_SAM_NEED_BOOTKEY_PASSWORD                                             = 8529
   4851 	ERROR_DS_SCHEMA_ALLOC_FAILED                                                   = 8415
   4852 	ERROR_DS_SCHEMA_NOT_LOADED                                                     = 8414
   4853 	ERROR_DS_SCHEMA_UPDATE_DISALLOWED                                              = 8509
   4854 	ERROR_DS_SECURITY_CHECKING_ERROR                                               = 8413
   4855 	ERROR_DS_SECURITY_ILLEGAL_MODIFY                                               = 8423
   4856 	ERROR_DS_SEC_DESC_INVALID                                                      = 8354
   4857 	ERROR_DS_SEC_DESC_TOO_SHORT                                                    = 8353
   4858 	ERROR_DS_SEMANTIC_ATT_TEST                                                     = 8383
   4859 	ERROR_DS_SENSITIVE_GROUP_VIOLATION                                             = 8505
   4860 	ERROR_DS_SERVER_DOWN                                                           = 8250
   4861 	ERROR_DS_SHUTTING_DOWN                                                         = 8364
   4862 	ERROR_DS_SINGLE_USER_MODE_FAILED                                               = 8590
   4863 	ERROR_DS_SINGLE_VALUE_CONSTRAINT                                               = 8321
   4864 	ERROR_DS_SIZELIMIT_EXCEEDED                                                    = 8227
   4865 	ERROR_DS_SORT_CONTROL_MISSING                                                  = 8261
   4866 	ERROR_DS_SOURCE_AUDITING_NOT_ENABLED                                           = 8552
   4867 	ERROR_DS_SOURCE_DOMAIN_IN_FOREST                                               = 8534
   4868 	ERROR_DS_SRC_AND_DST_NC_IDENTICAL                                              = 8485
   4869 	ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH                                     = 8540
   4870 	ERROR_DS_SRC_DC_MUST_BE_SP4_OR_GREATER                                         = 8559
   4871 	ERROR_DS_SRC_GUID_MISMATCH                                                     = 8488
   4872 	ERROR_DS_SRC_NAME_MISMATCH                                                     = 8484
   4873 	ERROR_DS_SRC_OBJ_NOT_GROUP_OR_USER                                             = 8538
   4874 	ERROR_DS_SRC_SID_EXISTS_IN_FOREST                                              = 8539
   4875 	ERROR_DS_STRING_SD_CONVERSION_FAILED                                           = 8522
   4876 	ERROR_DS_STRONG_AUTH_REQUIRED                                                  = 8232
   4877 	ERROR_DS_SUBREF_MUST_HAVE_PARENT                                               = 8356
   4878 	ERROR_DS_SUBTREE_NOTIFY_NOT_NC_HEAD                                            = 8376
   4879 	ERROR_DS_SUB_CLS_TEST_FAIL                                                     = 8391
   4880 	ERROR_DS_SYNTAX_MISMATCH                                                       = 8384
   4881 	ERROR_DS_THREAD_LIMIT_EXCEEDED                                                 = 8587
   4882 	ERROR_DS_TIMELIMIT_EXCEEDED                                                    = 8226
   4883 	ERROR_DS_TREE_DELETE_NOT_FINISHED                                              = 8397
   4884 	ERROR_DS_UNABLE_TO_SURRENDER_ROLES                                             = 8435
   4885 	ERROR_DS_UNAVAILABLE                                                           = 8207
   4886 	ERROR_DS_UNAVAILABLE_CRIT_EXTENSION                                            = 8236
   4887 	ERROR_DS_UNICODEPWD_NOT_IN_QUOTES                                              = 8556
   4888 	ERROR_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER                                      = 8518
   4889 	ERROR_DS_UNKNOWN_ERROR                                                         = 8431
   4890 	ERROR_DS_UNKNOWN_OPERATION                                                     = 8365
   4891 	ERROR_DS_UNWILLING_TO_PERFORM                                                  = 8245
   4892 	ERROR_DS_USER_BUFFER_TO_SMALL                                                  = 8309
   4893 	ERROR_DS_WKO_CONTAINER_CANNOT_BE_SPECIAL                                       = 8611
   4894 	ERROR_DS_WRONG_LINKED_ATT_SYNTAX                                               = 8528
   4895 	ERROR_DS_WRONG_OM_OBJ_CLASS                                                    = 8476
   4896 	ERROR_DUPLICATE_SERVICE_NAME                                                   = 1078
   4897 	ERROR_DUPLICATE_TAG                                                            = 2014
   4898 	ERROR_DUP_DOMAINNAME                                                           = 1221
   4899 	ERROR_DUP_NAME                                                                 = 52
   4900 	ERROR_DYNLINK_FROM_INVALID_RING                                                = 196
   4901 	ERROR_EAS_DIDNT_FIT                                                            = 275
   4902 	ERROR_EAS_NOT_SUPPORTED                                                        = 282
   4903 	ERROR_EA_ACCESS_DENIED                                                         = 994
   4904 	ERROR_EA_FILE_CORRUPT                                                          = 276
   4905 	ERROR_EA_LIST_INCONSISTENT                                                     = 255
   4906 	ERROR_EA_TABLE_FULL                                                            = 277
   4907 	ERROR_EC_CIRCULAR_FORWARDING                                                   = 15082
   4908 	ERROR_EC_CREDSTORE_FULL                                                        = 15083
   4909 	ERROR_EC_CRED_NOT_FOUND                                                        = 15084
   4910 	ERROR_EC_LOG_DISABLED                                                          = 15081
   4911 	ERROR_EC_NO_ACTIVE_CHANNEL                                                     = 15085
   4912 	ERROR_EC_SUBSCRIPTION_CANNOT_ACTIVATE                                          = 15080
   4913 	ERROR_EFS_ALG_BLOB_TOO_BIG                                                     = 6013
   4914 	ERROR_EFS_DISABLED                                                             = 6015
   4915 	ERROR_EFS_SERVER_NOT_TRUSTED                                                   = 6011
   4916 	ERROR_EFS_VERSION_NOT_SUPPORT                                                  = 6016
   4917 	ERROR_EMPTY                                                                    = 4306
   4918 	ERROR_ENCRYPTION_FAILED                                                        = 6000
   4919 	ERROR_END_OF_MEDIA                                                             = 1100
   4920 	ERROR_ENVVAR_NOT_FOUND                                                         = 203
   4921 	ERROR_EOM_OVERFLOW                                                             = 1129
   4922 	ERROR_EVENTLOG_CANT_START                                                      = 1501
   4923 	ERROR_EVENTLOG_FILE_CHANGED                                                    = 1503
   4924 	ERROR_EVENTLOG_FILE_CORRUPT                                                    = 1500
   4925 	ERROR_EVT_CANNOT_OPEN_CHANNEL_OF_QUERY                                         = 15036
   4926 	ERROR_EVT_CHANNEL_CANNOT_ACTIVATE                                              = 15025
   4927 	ERROR_EVT_CHANNEL_NOT_FOUND                                                    = 15007
   4928 	ERROR_EVT_CONFIGURATION_ERROR                                                  = 15010
   4929 	ERROR_EVT_EVENT_DEFINITION_NOT_FOUND                                           = 15032
   4930 	ERROR_EVT_EVENT_TEMPLATE_NOT_FOUND                                             = 15003
   4931 	ERROR_EVT_FILTER_ALREADYSCOPED                                                 = 15014
   4932 	ERROR_EVT_FILTER_INVARG                                                        = 15016
   4933 	ERROR_EVT_FILTER_INVTEST                                                       = 15017
   4934 	ERROR_EVT_FILTER_INVTYPE                                                       = 15018
   4935 	ERROR_EVT_FILTER_NOTELTSET                                                     = 15015
   4936 	ERROR_EVT_FILTER_OUT_OF_RANGE                                                  = 15038
   4937 	ERROR_EVT_FILTER_PARSEERR                                                      = 15019
   4938 	ERROR_EVT_FILTER_TOO_COMPLEX                                                   = 15026
   4939 	ERROR_EVT_FILTER_UNEXPECTEDTOKEN                                               = 15021
   4940 	ERROR_EVT_FILTER_UNSUPPORTEDOP                                                 = 15020
   4941 	ERROR_EVT_INVALID_CHANNEL_PATH                                                 = 15000
   4942 	ERROR_EVT_INVALID_CHANNEL_PROPERTY_VALUE                                       = 15023
   4943 	ERROR_EVT_INVALID_EVENT_DATA                                                   = 15005
   4944 	ERROR_EVT_INVALID_OPERATION_OVER_ENABLED_DIRECT_CHANNEL                        = 15022
   4945 	ERROR_EVT_INVALID_PUBLISHER_NAME                                               = 15004
   4946 	ERROR_EVT_INVALID_PUBLISHER_PROPERTY_VALUE                                     = 15024
   4947 	ERROR_EVT_INVALID_QUERY                                                        = 15001
   4948 	ERROR_EVT_MALFORMED_XML_TEXT                                                   = 15008
   4949 	ERROR_EVT_MAX_INSERTS_REACHED                                                  = 15031
   4950 	ERROR_EVT_MESSAGE_ID_NOT_FOUND                                                 = 15028
   4951 	ERROR_EVT_MESSAGE_LOCALE_NOT_FOUND                                             = 15033
   4952 	ERROR_EVT_MESSAGE_NOT_FOUND                                                    = 15027
   4953 	ERROR_EVT_NON_VALIDATING_MSXML                                                 = 15013
   4954 	ERROR_EVT_PUBLISHER_DISABLED                                                   = 15037
   4955 	ERROR_EVT_PUBLISHER_METADATA_NOT_FOUND                                         = 15002
   4956 	ERROR_EVT_QUERY_RESULT_INVALID_POSITION                                        = 15012
   4957 	ERROR_EVT_QUERY_RESULT_STALE                                                   = 15011
   4958 	ERROR_EVT_SUBSCRIPTION_TO_DIRECT_CHANNEL                                       = 15009
   4959 	ERROR_EVT_UNRESOLVED_PARAMETER_INSERT                                          = 15030
   4960 	ERROR_EVT_UNRESOLVED_VALUE_INSERT                                              = 15029
   4961 	ERROR_EVT_VERSION_TOO_NEW                                                      = 15035
   4962 	ERROR_EVT_VERSION_TOO_OLD                                                      = 15034
   4963 	ERROR_EXCEPTION_IN_SERVICE                                                     = 1064
   4964 	ERROR_EXCL_SEM_ALREADY_OWNED                                                   = 101
   4965 	ERROR_EXE_CANNOT_MODIFY_SIGNED_BINARY                                          = 217
   4966 	ERROR_EXE_CANNOT_MODIFY_STRONG_SIGNED_BINARY                                   = 218
   4967 	ERROR_EXE_MACHINE_TYPE_MISMATCH                                                = 216
   4968 	ERROR_EXE_MARKED_INVALID                                                       = 192
   4969 	ERROR_EXTENDED_ERROR                                                           = 1208
   4970 	ERROR_FAILED_SERVICE_CONTROLLER_CONNECT                                        = 1063
   4971 	ERROR_FAIL_I24                                                                 = 83
   4972 	ERROR_FILEMARK_DETECTED                                                        = 1101
   4973 	ERROR_FILENAME_EXCED_RANGE                                                     = 206
   4974 	ERROR_FILE_CHECKED_OUT                                                         = 220
   4975 	ERROR_FILE_CORRUPT                                                             = 1392
   4976 	ERROR_FILE_ENCRYPTED                                                           = 6002
   4977 	ERROR_FILE_EXISTS                                                              = 80
   4978 	ERROR_FILE_INVALID                                                             = 1006
   4979 	ERROR_FILE_NOT_ENCRYPTED                                                       = 6007
   4980 	ERROR_FILE_NOT_FOUND                                                           = 2
   4981 	ERROR_FILE_OFFLINE                                                             = 4350
   4982 	ERROR_FILE_READ_ONLY                                                           = 6009
   4983 	ERROR_FILE_TOO_LARGE                                                           = 223
   4984 	ERROR_FLOPPY_BAD_REGISTERS                                                     = 1125
   4985 	ERROR_FLOPPY_ID_MARK_NOT_FOUND                                                 = 1122
   4986 	ERROR_FLOPPY_UNKNOWN_ERROR                                                     = 1124
   4987 	ERROR_FLOPPY_WRONG_CYLINDER                                                    = 1123
   4988 	ERROR_FORMS_AUTH_REQUIRED                                                      = 224
   4989 	ERROR_FULLSCREEN_MODE                                                          = 1007
   4990 	ERROR_FULL_BACKUP                                                              = 4004
   4991 	ERROR_FUNCTION_FAILED                                                          = 1627
   4992 	ERROR_FUNCTION_NOT_CALLED                                                      = 1626
   4993 	ERROR_GENERIC_COMMAND_FAILED                                                   = 14109
   4994 	ERROR_GENERIC_NOT_MAPPED                                                       = 1360
   4995 	ERROR_GEN_FAILURE                                                              = 31
   4996 	ERROR_GLOBAL_ONLY_HOOK                                                         = 1429
   4997 	ERROR_GPIO_CLIENT_INFORMATION_INVALID                                          = 15322
   4998 	ERROR_GPIO_INCOMPATIBLE_CONNECT_MODE                                           = 15326
   4999 	ERROR_GPIO_INTERRUPT_ALREADY_UNMASKED                                          = 15327
   5000 	ERROR_GPIO_INVALID_REGISTRATION_PACKET                                         = 15324
   5001 	ERROR_GPIO_OPERATION_DENIED                                                    = 15325
   5002 	ERROR_GPIO_VERSION_NOT_SUPPORTED                                               = 15323
   5003 	ERROR_GRACEFUL_DISCONNECT                                                      = 1226
   5004 	ERROR_GROUP_EXISTS                                                             = 1318
   5005 	ERROR_GROUP_NOT_AVAILABLE                                                      = 5012
   5006 	ERROR_GROUP_NOT_FOUND                                                          = 5013
   5007 	ERROR_GROUP_NOT_ONLINE                                                         = 5014
   5008 	ERROR_HANDLE_DISK_FULL                                                         = 39
   5009 	ERROR_HANDLE_EOF                                                               = 38
   5010 	ERROR_HASH_NOT_PRESENT                                                         = 15301
   5011 	ERROR_HASH_NOT_SUPPORTED                                                       = 15300
   5012 	ERROR_HOOK_NEEDS_HMOD                                                          = 1428
   5013 	ERROR_HOOK_NOT_INSTALLED                                                       = 1431
   5014 	ERROR_HOOK_TYPE_NOT_ALLOWED                                                    = 1458
   5015 	ERROR_HOST_DOWN                                                                = 1256
   5016 	ERROR_HOST_NODE_NOT_AVAILABLE                                                  = 5005
   5017 	ERROR_HOST_NODE_NOT_GROUP_OWNER                                                = 5016
   5018 	ERROR_HOST_NODE_NOT_RESOURCE_OWNER                                             = 5015
   5019 	ERROR_HOST_UNREACHABLE                                                         = 1232
   5020 	ERROR_HOTKEY_ALREADY_REGISTERED                                                = 1409
   5021 	ERROR_HOTKEY_NOT_REGISTERED                                                    = 1419
   5022 	ERROR_HWNDS_HAVE_DIFF_PARENT                                                   = 1441
   5023 	ERROR_ICM_NOT_ENABLED                                                          = 2018
   5024 	ERROR_IEPORT_FULL                                                              = 4341
   5025 	ERROR_ILLEGAL_ELEMENT_ADDRESS                                                  = 1162
   5026 	ERROR_ILL_FORMED_PASSWORD                                                      = 1324
   5027 	ERROR_INCORRECT_ADDRESS                                                        = 1241
   5028 	ERROR_INCORRECT_SIZE                                                           = 1462
   5029 	ERROR_INC_BACKUP                                                               = 4003
   5030 	ERROR_INDEX_ABSENT                                                             = 1611
   5031 	ERROR_INDIGENOUS_TYPE                                                          = 4338
   5032 	ERROR_INFLOOP_IN_RELOC_CHAIN                                                   = 202
   5033 	ERROR_INIT_STATUS_NEEDED                                                       = 0x00000011
   5034 	ERROR_INSTALL_ALREADY_RUNNING                                                  = 1618
   5035 	ERROR_INSTALL_CANCEL                                                           = 15608
   5036 	ERROR_INSTALL_DEREGISTRATION_FAILURE                                           = 15607
   5037 	ERROR_INSTALL_FAILED                                                           = 15609
   5038 	ERROR_INSTALL_FAILURE                                                          = 1603
   5039 	ERROR_INSTALL_FIREWALL_SERVICE_NOT_RUNNING                                     = 15626
   5040 	ERROR_INSTALL_INVALID_PACKAGE                                                  = 15602
   5041 	ERROR_INSTALL_LANGUAGE_UNSUPPORTED                                             = 1623
   5042 	ERROR_INSTALL_LOG_FAILURE                                                      = 1622
   5043 	ERROR_INSTALL_NETWORK_FAILURE                                                  = 15605
   5044 	ERROR_INSTALL_NOTUSED                                                          = 1634
   5045 	ERROR_INSTALL_OPEN_PACKAGE_FAILED                                              = 15600
   5046 	ERROR_INSTALL_OUT_OF_DISK_SPACE                                                = 15604
   5047 	ERROR_INSTALL_PACKAGE_DOWNGRADE                                                = 15622
   5048 	ERROR_INSTALL_PACKAGE_INVALID                                                  = 1620
   5049 	ERROR_INSTALL_PACKAGE_NOT_FOUND                                                = 15601
   5050 	ERROR_INSTALL_PACKAGE_OPEN_FAILED                                              = 1619
   5051 	ERROR_INSTALL_PACKAGE_REJECTED                                                 = 1625
   5052 	ERROR_INSTALL_PACKAGE_VERSION                                                  = 1613
   5053 	ERROR_INSTALL_PLATFORM_UNSUPPORTED                                             = 1633
   5054 	ERROR_INSTALL_POLICY_FAILURE                                                   = 15615
   5055 	ERROR_INSTALL_PREREQUISITE_FAILED                                              = 15613
   5056 	ERROR_INSTALL_REGISTRATION_FAILURE                                             = 15606
   5057 	ERROR_INSTALL_REMOTE_DISALLOWED                                                = 1640
   5058 	ERROR_INSTALL_REMOTE_PROHIBITED                                                = 1645
   5059 	ERROR_INSTALL_RESOLVE_DEPENDENCY_FAILED                                        = 15603
   5060 	ERROR_INSTALL_SERVICE_FAILURE                                                  = 1601
   5061 	ERROR_INSTALL_SOURCE_ABSENT                                                    = 1612
   5062 	ERROR_INSTALL_SUSPEND                                                          = 1604
   5063 	ERROR_INSTALL_TEMP_UNWRITABLE                                                  = 1632
   5064 	ERROR_INSTALL_TRANSFORM_FAILURE                                                = 1624
   5065 	ERROR_INSTALL_TRANSFORM_REJECTED                                               = 1644
   5066 	ERROR_INSTALL_UI_FAILURE                                                       = 1621
   5067 	ERROR_INSTALL_USEREXIT                                                         = 1602
   5068 	ERROR_INSUFFICIENT_BUFFER                                                      = 122
   5069 	ERROR_INTERNAL_DB_CORRUPTION                                                   = 1358
   5070 	ERROR_INTERNAL_DB_ERROR                                                        = 1383
   5071 	ERROR_INTERNAL_ERROR                                                           = 1359
   5072 	ERROR_INVALID_ACCEL_HANDLE                                                     = 1403
   5073 	ERROR_INVALID_ACCESS                                                           = 12
   5074 	ERROR_INVALID_ACCOUNT_NAME                                                     = 1315
   5075 	ERROR_INVALID_ACL                                                              = 1336
   5076 	ERROR_INVALID_ADDRESS                                                          = 487
   5077 	ERROR_INVALID_AT_INTERRUPT_TIME                                                = 104
   5078 	ERROR_INVALID_BLOCK                                                            = 9
   5079 	ERROR_INVALID_BLOCK_LENGTH                                                     = 1106
   5080 	ERROR_INVALID_CATEGORY                                                         = 117
   5081 	ERROR_INVALID_CLEANER                                                          = 4310
   5082 	ERROR_INVALID_CMM                                                              = 2010
   5083 	ERROR_INVALID_COLORINDEX                                                       = 2022
   5084 	ERROR_INVALID_COLORSPACE                                                       = 2017
   5085 	ERROR_INVALID_COMBOBOX_MESSAGE                                                 = 1422
   5086 	ERROR_INVALID_COMMAND_LINE                                                     = 1639
   5087 	ERROR_INVALID_COMPUTERNAME                                                     = 1210
   5088 	ERROR_INVALID_CURSOR_HANDLE                                                    = 1402
   5089 	ERROR_INVALID_DATA                                                             = 13
   5090 	ERROR_INVALID_DATATYPE                                                         = 1804
   5091 	ERROR_INVALID_DLL                                                              = 1154
   5092 	ERROR_INVALID_DOMAINNAME                                                       = 1212
   5093 	ERROR_INVALID_DOMAIN_ROLE                                                      = 1354
   5094 	ERROR_INVALID_DOMAIN_STATE                                                     = 1353
   5095 	ERROR_INVALID_DRIVE                                                            = 15
   5096 	ERROR_INVALID_DRIVE_OBJECT                                                     = 4321
   5097 	ERROR_INVALID_DWP_HANDLE                                                       = 1405
   5098 	ERROR_INVALID_EA_HANDLE                                                        = 278
   5099 	ERROR_INVALID_EA_NAME                                                          = 254
   5100 	ERROR_INVALID_EDIT_HEIGHT                                                      = 1424
   5101 	ERROR_INVALID_ENVIRONMENT                                                      = 1805
   5102 	ERROR_INVALID_EVENTNAME                                                        = 1211
   5103 	ERROR_INVALID_EVENT_COUNT                                                      = 151
   5104 	ERROR_INVALID_EXE_SIGNATURE                                                    = 191
   5105 	ERROR_INVALID_FIELD                                                            = 1616
   5106 	ERROR_INVALID_FILTER_PROC                                                      = 1427
   5107 	ERROR_INVALID_FLAGS                                                            = 1004
   5108 	ERROR_INVALID_FLAG_NUMBER                                                      = 186
   5109 	ERROR_INVALID_FORM_NAME                                                        = 1902
   5110 	ERROR_INVALID_FORM_SIZE                                                        = 1903
   5111 	ERROR_INVALID_FUNCTION                                                         = 1
   5112 	ERROR_INVALID_GROUPNAME                                                        = 1209
   5113 	ERROR_INVALID_GROUP_ATTRIBUTES                                                 = 1345
   5114 	ERROR_INVALID_GW_COMMAND                                                       = 1443
   5115 	ERROR_INVALID_HANDLE                                                           = 6
   5116 	ERROR_INVALID_HANDLE_STATE                                                     = 1609
   5117 	ERROR_INVALID_HOOK_FILTER                                                      = 1426
   5118 	ERROR_INVALID_HOOK_HANDLE                                                      = 1404
   5119 	ERROR_INVALID_ICON_HANDLE                                                      = 1414
   5120 	ERROR_INVALID_ID_AUTHORITY                                                     = 1343
   5121 	ERROR_INVALID_IMPORT_OF_NON_DLL                                                = 1276
   5122 	ERROR_INVALID_INDEX                                                            = 1413
   5123 	ERROR_INVALID_KEYBOARD_HANDLE                                                  = 1457
   5124 	ERROR_INVALID_LB_MESSAGE                                                       = 1432
   5125 	ERROR_INVALID_LEVEL                                                            = 124
   5126 	ERROR_INVALID_LIBRARY                                                          = 4301
   5127 	ERROR_INVALID_LIST_FORMAT                                                      = 153
   5128 	ERROR_INVALID_LOGON_HOURS                                                      = 1328
   5129 	ERROR_INVALID_LOGON_TYPE                                                       = 1367
   5130 	ERROR_INVALID_MEDIA                                                            = 4300
   5131 	ERROR_INVALID_MEDIA_POOL                                                       = 4302
   5132 	ERROR_INVALID_MEMBER                                                           = 1388
   5133 	ERROR_INVALID_MENU_HANDLE                                                      = 1401
   5134 	ERROR_INVALID_MESSAGE                                                          = 1002
   5135 	ERROR_INVALID_MESSAGEDEST                                                      = 1218
   5136 	ERROR_INVALID_MESSAGENAME                                                      = 1217
   5137 	ERROR_INVALID_MINALLOCSIZE                                                     = 195
   5138 	ERROR_INVALID_MODULETYPE                                                       = 190
   5139 	ERROR_INVALID_MONITOR_HANDLE                                                   = 1461
   5140 	ERROR_INVALID_MSGBOX_STYLE                                                     = 1438
   5141 	ERROR_INVALID_NAME                                                             = 123
   5142 	ERROR_INVALID_NETNAME                                                          = 1214
   5143 	ERROR_INVALID_OPERATION                                                        = 4317
   5144 	ERROR_INVALID_OPERATION_ON_QUORUM                                              = 5068
   5145 	ERROR_INVALID_OPLOCK_PROTOCOL                                                  = 301
   5146 	ERROR_INVALID_ORDINAL                                                          = 182
   5147 	ERROR_INVALID_OWNER                                                            = 1307
   5148 	ERROR_INVALID_PARAMETER                                                        = 87
   5149 	ERROR_INVALID_PASSWORD                                                         = 86
   5150 	ERROR_INVALID_PASSWORDNAME                                                     = 1216
   5151 	ERROR_INVALID_PIXEL_FORMAT                                                     = 2000
   5152 	ERROR_INVALID_PRIMARY_GROUP                                                    = 1308
   5153 	ERROR_INVALID_PRINTER_COMMAND                                                  = 1803
   5154 	ERROR_INVALID_PRINTER_NAME                                                     = 1801
   5155 	ERROR_INVALID_PRINTER_STATE                                                    = 1906
   5156 	ERROR_INVALID_PRINT_MONITOR                                                    = 3007
   5157 	ERROR_INVALID_PRIORITY                                                         = 1800
   5158 	ERROR_INVALID_PROFILE                                                          = 2011
   5159 	ERROR_INVALID_REPARSE_DATA                                                     = 4392
   5160 	ERROR_INVALID_RUNLEVEL_SETTING                                                 = 15401
   5161 	ERROR_INVALID_SCROLLBAR_RANGE                                                  = 1448
   5162 	ERROR_INVALID_SECURITY_DESCR                                                   = 1338
   5163 	ERROR_INVALID_SEGDPL                                                           = 198
   5164 	ERROR_INVALID_SEGMENT_NUMBER                                                   = 180
   5165 	ERROR_INVALID_SEPARATOR_FILE                                                   = 1799
   5166 	ERROR_INVALID_SERVER_STATE                                                     = 1352
   5167 	ERROR_INVALID_SERVICENAME                                                      = 1213
   5168 	ERROR_INVALID_SERVICE_ACCOUNT                                                  = 1057
   5169 	ERROR_INVALID_SERVICE_CONTROL                                                  = 1052
   5170 	ERROR_INVALID_SERVICE_LOCK                                                     = 1071
   5171 	ERROR_INVALID_SHARENAME                                                        = 1215
   5172 	ERROR_INVALID_SHOWWIN_COMMAND                                                  = 1449
   5173 	ERROR_INVALID_SID                                                              = 1337
   5174 	ERROR_INVALID_SIGNAL_NUMBER                                                    = 209
   5175 	ERROR_INVALID_SPI_VALUE                                                        = 1439
   5176 	ERROR_INVALID_STACKSEG                                                         = 189
   5177 	ERROR_INVALID_STAGED_SIGNATURE                                                 = 15620
   5178 	ERROR_INVALID_STARTING_CODESEG                                                 = 188
   5179 	ERROR_INVALID_STATE                                                            = 5023
   5180 	ERROR_INVALID_SUB_AUTHORITY                                                    = 1335
   5181 	ERROR_INVALID_TABLE                                                            = 1628
   5182 	ERROR_INVALID_TARGET_HANDLE                                                    = 114
   5183 	ERROR_INVALID_THREAD_ID                                                        = 1444
   5184 	ERROR_INVALID_TIME                                                             = 1901
   5185 	ERROR_INVALID_TOKEN                                                            = 315
   5186 	ERROR_INVALID_TRANSFORM                                                        = 2020
   5187 	ERROR_INVALID_USER_BUFFER                                                      = 1784
   5188 	ERROR_INVALID_VERIFY_SWITCH                                                    = 118
   5189 	ERROR_INVALID_WINDOW_HANDLE                                                    = 1400
   5190 	ERROR_INVALID_WINDOW_STYLE                                                     = 2002
   5191 	ERROR_INVALID_WORKSTATION                                                      = 1329
   5192 	ERROR_IOPL_NOT_ENABLED                                                         = 197
   5193 	ERROR_IO_DEVICE                                                                = 1117
   5194 	ERROR_IO_INCOMPLETE                                                            = 996
   5195 	ERROR_IO_PENDING                                                               = 997
   5196 	ERROR_IPSEC_AUTH_FIREWALL_DROP                                                 = 13917
   5197 	ERROR_IPSEC_BAD_SPI                                                            = 13910
   5198 	ERROR_IPSEC_CLEAR_TEXT_DROP                                                    = 13916
   5199 	ERROR_IPSEC_DEFAULT_MM_AUTH_NOT_FOUND                                          = 13014
   5200 	ERROR_IPSEC_DEFAULT_MM_POLICY_NOT_FOUND                                        = 13013
   5201 	ERROR_IPSEC_DEFAULT_QM_POLICY_NOT_FOUND                                        = 13015
   5202 	ERROR_IPSEC_DOSP_BLOCK                                                         = 13925
   5203 	ERROR_IPSEC_DOSP_INVALID_PACKET                                                = 13927
   5204 	ERROR_IPSEC_DOSP_KEYMOD_NOT_ALLOWED                                            = 13930
   5205 	ERROR_IPSEC_DOSP_MAX_ENTRIES                                                   = 13929
   5206 	ERROR_IPSEC_DOSP_MAX_PER_IP_RATELIMIT_QUEUES                                   = 13932
   5207 	ERROR_IPSEC_DOSP_NOT_INSTALLED                                                 = 13931
   5208 	ERROR_IPSEC_DOSP_RECEIVED_MULTICAST                                            = 13926
   5209 	ERROR_IPSEC_DOSP_STATE_LOOKUP_FAILED                                           = 13928
   5210 	ERROR_IPSEC_IKE_ADD_UPDATE_KEY_FAILED                                          = 13860
   5211 	ERROR_IPSEC_IKE_ATTRIB_FAIL                                                    = 13802
   5212 	ERROR_IPSEC_IKE_AUTHORIZATION_FAILURE                                          = 13905
   5213 	ERROR_IPSEC_IKE_AUTHORIZATION_FAILURE_WITH_OPTIONAL_RETRY                      = 13907
   5214 	ERROR_IPSEC_IKE_AUTH_FAIL                                                      = 13801
   5215 	ERROR_IPSEC_IKE_BENIGN_REINIT                                                  = 13878
   5216 	ERROR_IPSEC_IKE_CERT_CHAIN_POLICY_MISMATCH                                     = 13887
   5217 	ERROR_IPSEC_IKE_CGA_AUTH_FAILED                                                = 13892
   5218 	ERROR_IPSEC_IKE_COEXISTENCE_SUPPRESS                                           = 13902
   5219 	ERROR_IPSEC_IKE_CRL_FAILED                                                     = 13817
   5220 	ERROR_IPSEC_IKE_DECRYPT                                                        = 13867
   5221 	ERROR_IPSEC_IKE_DH_FAIL                                                        = 13822
   5222 	ERROR_IPSEC_IKE_DH_FAILURE                                                     = 13864
   5223 	ERROR_IPSEC_IKE_DOS_COOKIE_SENT                                                = 13890
   5224 	ERROR_IPSEC_IKE_DROP_NO_RESPONSE                                               = 13813
   5225 	ERROR_IPSEC_IKE_ENCRYPT                                                        = 13866
   5226 	ERROR_IPSEC_IKE_ERROR                                                          = 13816
   5227 	ERROR_IPSEC_IKE_FAILQUERYSSP                                                   = 13854
   5228 	ERROR_IPSEC_IKE_FAILSSPINIT                                                    = 13853
   5229 	ERROR_IPSEC_IKE_GENERAL_PROCESSING_ERROR                                       = 13804
   5230 	ERROR_IPSEC_IKE_GETSPIFAIL                                                     = 13857
   5231 	ERROR_IPSEC_IKE_INNER_IP_ASSIGNMENT_FAILURE                                    = 13899
   5232 	ERROR_IPSEC_IKE_INVALID_AUTH_ALG                                               = 13874
   5233 	ERROR_IPSEC_IKE_INVALID_AUTH_PAYLOAD                                           = 13889
   5234 	ERROR_IPSEC_IKE_INVALID_CERT_KEYLEN                                            = 13881
   5235 	ERROR_IPSEC_IKE_INVALID_CERT_TYPE                                              = 13819
   5236 	ERROR_IPSEC_IKE_INVALID_COOKIE                                                 = 13846
   5237 	ERROR_IPSEC_IKE_INVALID_ENCRYPT_ALG                                            = 13873
   5238 	ERROR_IPSEC_IKE_INVALID_FILTER                                                 = 13858
   5239 	ERROR_IPSEC_IKE_INVALID_GROUP                                                  = 13865
   5240 	ERROR_IPSEC_IKE_INVALID_HASH                                                   = 13870
   5241 	ERROR_IPSEC_IKE_INVALID_HASH_ALG                                               = 13871
   5242 	ERROR_IPSEC_IKE_INVALID_HASH_SIZE                                              = 13872
   5243 	ERROR_IPSEC_IKE_INVALID_HEADER                                                 = 13824
   5244 	ERROR_IPSEC_IKE_INVALID_KEY_USAGE                                              = 13818
   5245 	ERROR_IPSEC_IKE_INVALID_MM_FOR_QM                                              = 13894
   5246 	ERROR_IPSEC_IKE_INVALID_PAYLOAD                                                = 13843
   5247 	ERROR_IPSEC_IKE_INVALID_POLICY                                                 = 13861
   5248 	ERROR_IPSEC_IKE_INVALID_RESPONDER_LIFETIME_NOTIFY                              = 13879
   5249 	ERROR_IPSEC_IKE_INVALID_SIG                                                    = 13875
   5250 	ERROR_IPSEC_IKE_INVALID_SIGNATURE                                              = 13826
   5251 	ERROR_IPSEC_IKE_INVALID_SITUATION                                              = 13863
   5252 	ERROR_IPSEC_IKE_KERBEROS_ERROR                                                 = 13827
   5253 	ERROR_IPSEC_IKE_KILL_DUMMY_NAP_TUNNEL                                          = 13898
   5254 	ERROR_IPSEC_IKE_LOAD_FAILED                                                    = 13876
   5255 	ERROR_IPSEC_IKE_LOAD_SOFT_SA                                                   = 13844
   5256 	ERROR_IPSEC_IKE_MM_ACQUIRE_DROP                                                = 13809
   5257 	ERROR_IPSEC_IKE_MM_DELAY_DROP                                                  = 13814
   5258 	ERROR_IPSEC_IKE_MM_EXPIRED                                                     = 13885
   5259 	ERROR_IPSEC_IKE_MM_LIMIT                                                       = 13882
   5260 	ERROR_IPSEC_IKE_NEGOTIATION_DISABLED                                           = 13883
   5261 	ERROR_IPSEC_IKE_NEGOTIATION_PENDING                                            = 13803
   5262 	ERROR_IPSEC_IKE_NEG_STATUS_BEGIN                                               = 13800
   5263 	ERROR_IPSEC_IKE_NEG_STATUS_END                                                 = 13897
   5264 	ERROR_IPSEC_IKE_NEG_STATUS_EXTENDED_END                                        = 13909
   5265 	ERROR_IPSEC_IKE_NOTCBPRIV                                                      = 13851
   5266 	ERROR_IPSEC_IKE_NO_CERT                                                        = 13806
   5267 	ERROR_IPSEC_IKE_NO_MM_POLICY                                                   = 13850
   5268 	ERROR_IPSEC_IKE_NO_PEER_CERT                                                   = 13847
   5269 	ERROR_IPSEC_IKE_NO_POLICY                                                      = 13825
   5270 	ERROR_IPSEC_IKE_NO_PRIVATE_KEY                                                 = 13820
   5271 	ERROR_IPSEC_IKE_NO_PUBLIC_KEY                                                  = 13828
   5272 	ERROR_IPSEC_IKE_OUT_OF_MEMORY                                                  = 13859
   5273 	ERROR_IPSEC_IKE_PEER_CRL_FAILED                                                = 13848
   5274 	ERROR_IPSEC_IKE_PEER_DOESNT_SUPPORT_MOBIKE                                     = 13904
   5275 	ERROR_IPSEC_IKE_PEER_MM_ASSUMED_INVALID                                        = 13886
   5276 	ERROR_IPSEC_IKE_POLICY_CHANGE                                                  = 13849
   5277 	ERROR_IPSEC_IKE_POLICY_MATCH                                                   = 13868
   5278 	ERROR_IPSEC_IKE_PROCESS_ERR                                                    = 13829
   5279 	ERROR_IPSEC_IKE_PROCESS_ERR_CERT                                               = 13835
   5280 	ERROR_IPSEC_IKE_PROCESS_ERR_CERT_REQ                                           = 13836
   5281 	ERROR_IPSEC_IKE_PROCESS_ERR_DELETE                                             = 13841
   5282 	ERROR_IPSEC_IKE_PROCESS_ERR_HASH                                               = 13837
   5283 	ERROR_IPSEC_IKE_PROCESS_ERR_ID                                                 = 13834
   5284 	ERROR_IPSEC_IKE_PROCESS_ERR_KE                                                 = 13833
   5285 	ERROR_IPSEC_IKE_PROCESS_ERR_NATOA                                              = 13893
   5286 	ERROR_IPSEC_IKE_PROCESS_ERR_NONCE                                              = 13839
   5287 	ERROR_IPSEC_IKE_PROCESS_ERR_NOTIFY                                             = 13840
   5288 	ERROR_IPSEC_IKE_PROCESS_ERR_PROP                                               = 13831
   5289 	ERROR_IPSEC_IKE_PROCESS_ERR_SA                                                 = 13830
   5290 	ERROR_IPSEC_IKE_PROCESS_ERR_SIG                                                = 13838
   5291 	ERROR_IPSEC_IKE_PROCESS_ERR_TRANS                                              = 13832
   5292 	ERROR_IPSEC_IKE_PROCESS_ERR_VENDOR                                             = 13842
   5293 	ERROR_IPSEC_IKE_QM_ACQUIRE_DROP                                                = 13810
   5294 	ERROR_IPSEC_IKE_QM_DELAY_DROP                                                  = 13815
   5295 	ERROR_IPSEC_IKE_QM_EXPIRED                                                     = 13895
   5296 	ERROR_IPSEC_IKE_QM_LIMIT                                                       = 13884
   5297 	ERROR_IPSEC_IKE_QUEUE_DROP_MM                                                  = 13811
   5298 	ERROR_IPSEC_IKE_QUEUE_DROP_NO_MM                                               = 13812
   5299 	ERROR_IPSEC_IKE_RATELIMIT_DROP                                                 = 13903
   5300 	ERROR_IPSEC_IKE_REQUIRE_CP_PAYLOAD_MISSING                                     = 13900
   5301 	ERROR_IPSEC_IKE_RPC_DELETE                                                     = 13877
   5302 	ERROR_IPSEC_IKE_SA_DELETED                                                     = 13807
   5303 	ERROR_IPSEC_IKE_SA_REAPED                                                      = 13808
   5304 	ERROR_IPSEC_IKE_SECLOADFAIL                                                    = 13852
   5305 	ERROR_IPSEC_IKE_SHUTTING_DOWN                                                  = 13891
   5306 	ERROR_IPSEC_IKE_SOFT_SA_TORN_DOWN                                              = 13845
   5307 	ERROR_IPSEC_IKE_SRVACQFAIL                                                     = 13855
   5308 	ERROR_IPSEC_IKE_SRVQUERYCRED                                                   = 13856
   5309 	ERROR_IPSEC_IKE_STRONG_CRED_AUTHORIZATION_AND_CERTMAP_FAILURE                  = 13908
   5310 	ERROR_IPSEC_IKE_STRONG_CRED_AUTHORIZATION_FAILURE                              = 13906
   5311 	ERROR_IPSEC_IKE_TIMED_OUT                                                      = 13805
   5312 	ERROR_IPSEC_IKE_TOO_MANY_FILTERS                                               = 13896
   5313 	ERROR_IPSEC_IKE_UNEXPECTED_MESSAGE_ID                                          = 13888
   5314 	ERROR_IPSEC_IKE_UNKNOWN_DOI                                                    = 13862
   5315 	ERROR_IPSEC_IKE_UNSUPPORTED_ID                                                 = 13869
   5316 	ERROR_IPSEC_INTEGRITY_CHECK_FAILED                                             = 13915
   5317 	ERROR_IPSEC_INVALID_PACKET                                                     = 13914
   5318 	ERROR_IPSEC_KEY_MODULE_IMPERSONATION_NEGOTIATION_PENDING                       = 13901
   5319 	ERROR_IPSEC_MM_AUTH_EXISTS                                                     = 13010
   5320 	ERROR_IPSEC_MM_AUTH_IN_USE                                                     = 13012
   5321 	ERROR_IPSEC_MM_AUTH_NOT_FOUND                                                  = 13011
   5322 	ERROR_IPSEC_MM_AUTH_PENDING_DELETION                                           = 13022
   5323 	ERROR_IPSEC_MM_FILTER_EXISTS                                                   = 13006
   5324 	ERROR_IPSEC_MM_FILTER_NOT_FOUND                                                = 13007
   5325 	ERROR_IPSEC_MM_FILTER_PENDING_DELETION                                         = 13018
   5326 	ERROR_IPSEC_MM_POLICY_EXISTS                                                   = 13003
   5327 	ERROR_IPSEC_MM_POLICY_IN_USE                                                   = 13005
   5328 	ERROR_IPSEC_MM_POLICY_NOT_FOUND                                                = 13004
   5329 	ERROR_IPSEC_MM_POLICY_PENDING_DELETION                                         = 13021
   5330 	ERROR_IPSEC_QM_POLICY_EXISTS                                                   = 13000
   5331 	ERROR_IPSEC_QM_POLICY_IN_USE                                                   = 13002
   5332 	ERROR_IPSEC_QM_POLICY_NOT_FOUND                                                = 13001
   5333 	ERROR_IPSEC_QM_POLICY_PENDING_DELETION                                         = 13023
   5334 	ERROR_IPSEC_REPLAY_CHECK_FAILED                                                = 13913
   5335 	ERROR_IPSEC_SA_LIFETIME_EXPIRED                                                = 13911
   5336 	ERROR_IPSEC_THROTTLE_DROP                                                      = 13918
   5337 	ERROR_IPSEC_TRANSPORT_FILTER_EXISTS                                            = 13008
   5338 	ERROR_IPSEC_TRANSPORT_FILTER_NOT_FOUND                                         = 13009
   5339 	ERROR_IPSEC_TRANSPORT_FILTER_PENDING_DELETION                                  = 13019
   5340 	ERROR_IPSEC_TUNNEL_FILTER_EXISTS                                               = 13016
   5341 	ERROR_IPSEC_TUNNEL_FILTER_NOT_FOUND                                            = 13017
   5342 	ERROR_IPSEC_TUNNEL_FILTER_PENDING_DELETION                                     = 13020
   5343 	ERROR_IPSEC_WRONG_SA                                                           = 13912
   5344 	ERROR_IRQ_BUSY                                                                 = 1119
   5345 	ERROR_IS_JOINED                                                                = 134
   5346 	ERROR_IS_JOIN_PATH                                                             = 147
   5347 	ERROR_IS_JOIN_TARGET                                                           = 133
   5348 	ERROR_IS_SUBSTED                                                               = 135
   5349 	ERROR_IS_SUBST_PATH                                                            = 146
   5350 	ERROR_IS_SUBST_TARGET                                                          = 149
   5351 	ERROR_ITERATED_DATA_EXCEEDS_64k                                                = 194
   5352 	ERROR_JOIN_TO_JOIN                                                             = 138
   5353 	ERROR_JOIN_TO_SUBST                                                            = 140
   5354 	ERROR_JOURNAL_DELETE_IN_PROGRESS                                               = 1178
   5355 	ERROR_JOURNAL_ENTRY_DELETED                                                    = 1181
   5356 	ERROR_JOURNAL_HOOK_SET                                                         = 1430
   5357 	ERROR_JOURNAL_NOT_ACTIVE                                                       = 1179
   5358 	ERROR_KERNEL_APC                                                               = 738
   5359 	ERROR_KEY_DELETED                                                              = 1018
   5360 	ERROR_KEY_HAS_CHILDREN                                                         = 1020
   5361 	ERROR_KM_DRIVER_BLOCKED                                                        = 1930
   5362 	ERROR_LABEL_QUESTIONABLE                                                       = 0x00000002
   5363 	ERROR_LABEL_TOO_LONG                                                           = 154
   5364 	ERROR_LABEL_UNREADABLE                                                         = 0x00000001
   5365 	ERROR_LAST_ADMIN                                                               = 1322
   5366 	ERROR_LB_WITHOUT_TABSTOPS                                                      = 1434
   5367 	ERROR_LIBRARY_FULL                                                             = 4322
   5368 	ERROR_LIBRARY_OFFLINE                                                          = 4305
   5369 	ERROR_LICENSE_QUOTA_EXCEEDED                                                   = 1395
   5370 	ERROR_LISTBOX_ID_NOT_FOUND                                                     = 1416
   5371 	ERROR_LM_CROSS_ENCRYPTION_REQUIRED                                             = 1390
   5372 	ERROR_LOCAL_USER_SESSION_KEY                                                   = 1303
   5373 	ERROR_LOCKED                                                                   = 212
   5374 	ERROR_LOCK_FAILED                                                              = 167
   5375 	ERROR_LOCK_VIOLATION                                                           = 33
   5376 	ERROR_LOGIN_TIME_RESTRICTION                                                   = 1239
   5377 	ERROR_LOGIN_WKSTA_RESTRICTION                                                  = 1240
   5378 	ERROR_LOGON_FAILURE                                                            = 1326
   5379 	ERROR_LOGON_NOT_GRANTED                                                        = 1380
   5380 	ERROR_LOGON_SESSION_COLLISION                                                  = 1366
   5381 	ERROR_LOGON_SESSION_EXISTS                                                     = 1363
   5382 	ERROR_LOGON_TYPE_NOT_GRANTED                                                   = 1385
   5383 	ERROR_LOG_FILE_FULL                                                            = 1502
   5384 	ERROR_LUIDS_EXHAUSTED                                                          = 1334
   5385 	ERROR_MACHINE_LOCKED                                                           = 1271
   5386 	ERROR_MAGAZINE_NOT_PRESENT                                                     = 1163
   5387 	ERROR_MALFORMED_SUBSTITUTION_STRING                                            = 14094
   5388 	ERROR_MAPPED_ALIGNMENT                                                         = 1132
   5389 	ERROR_MAX_THRDS_REACHED                                                        = 164
   5390 	ERROR_MCA_INTERNAL_ERROR                                                       = 15205
   5391 	ERROR_MCA_INVALID_CAPABILITIES_STRING                                          = 15200
   5392 	ERROR_MCA_INVALID_TECHNOLOGY_TYPE_RETURNED                                     = 15206
   5393 	ERROR_MCA_INVALID_VCP_VERSION                                                  = 15201
   5394 	ERROR_MCA_MCCS_VERSION_MISMATCH                                                = 15203
   5395 	ERROR_MCA_MONITOR_VIOLATES_MCCS_SPECIFICATION                                  = 15202
   5396 	ERROR_MCA_UNSUPPORTED_COLOR_TEMPERATURE                                        = 15207
   5397 	ERROR_MCA_UNSUPPORTED_MCCS_VERSION                                             = 15204
   5398 	ERROR_MEDIA_CHANGED                                                            = 1110
   5399 	ERROR_MEDIA_INCOMPATIBLE                                                       = 4315
   5400 	ERROR_MEDIA_NOT_AVAILABLE                                                      = 4318
   5401 	ERROR_MEDIA_OFFLINE                                                            = 4304
   5402 	ERROR_MEDIA_UNAVAILABLE                                                        = 4308
   5403 	ERROR_MEDIUM_NOT_ACCESSIBLE                                                    = 4323
   5404 	ERROR_MEMBERS_PRIMARY_GROUP                                                    = 1374
   5405 	ERROR_MEMBER_IN_ALIAS                                                          = 1378
   5406 	ERROR_MEMBER_IN_GROUP                                                          = 1320
   5407 	ERROR_MEMBER_NOT_IN_ALIAS                                                      = 1377
   5408 	ERROR_MEMBER_NOT_IN_GROUP                                                      = 1321
   5409 	ERROR_MENU_ITEM_NOT_FOUND                                                      = 1456
   5410 	ERROR_MESSAGE_EXCEEDS_MAX_SIZE                                                 = 4336
   5411 	ERROR_MESSAGE_SYNC_ONLY                                                        = 1159
   5412 	ERROR_METAFILE_NOT_SUPPORTED                                                   = 2003
   5413 	ERROR_META_EXPANSION_TOO_LONG                                                  = 208
   5414 	ERROR_MOD_NOT_FOUND                                                            = 126
   5415 	ERROR_MORE_DATA                                                                = 234
   5416 	ERROR_MORE_WRITES                                                              = 1120
   5417 	ERROR_MRM_AUTOMERGE_ENABLED                                                    = 15139
   5418 	ERROR_MRM_DUPLICATE_ENTRY                                                      = 15119
   5419 	ERROR_MRM_DUPLICATE_MAP_NAME                                                   = 15118
   5420 	ERROR_MRM_FILEPATH_TOO_LONG                                                    = 15121
   5421 	ERROR_MRM_INDETERMINATE_QUALIFIER_VALUE                                        = 15138
   5422 	ERROR_MRM_INVALID_FILE_TYPE                                                    = 15112
   5423 	ERROR_MRM_INVALID_PRICONFIG                                                    = 15111
   5424 	ERROR_MRM_INVALID_PRI_FILE                                                     = 15126
   5425 	ERROR_MRM_INVALID_QUALIFIER_OPERATOR                                           = 15137
   5426 	ERROR_MRM_INVALID_QUALIFIER_VALUE                                              = 15114
   5427 	ERROR_MRM_INVALID_RESOURCE_IDENTIFIER                                          = 15120
   5428 	ERROR_MRM_MAP_NOT_FOUND                                                        = 15135
   5429 	ERROR_MRM_NAMED_RESOURCE_NOT_FOUND                                             = 15127
   5430 	ERROR_MRM_NO_CANDIDATE                                                         = 15115
   5431 	ERROR_MRM_NO_MATCH_OR_DEFAULT_CANDIDATE                                        = 15116
   5432 	ERROR_MRM_RESOURCE_TYPE_MISMATCH                                               = 15117
   5433 	ERROR_MRM_RUNTIME_NO_DEFAULT_OR_NEUTRAL_RESOURCE                               = 15110
   5434 	ERROR_MRM_TOO_MANY_RESOURCES                                                   = 15140
   5435 	ERROR_MRM_UNKNOWN_QUALIFIER                                                    = 15113
   5436 	ERROR_MRM_UNSUPPORTED_DIRECTORY_TYPE                                           = 15122
   5437 	ERROR_MRM_UNSUPPORTED_PROFILE_TYPE                                             = 15136
   5438 	ERROR_MR_MID_NOT_FOUND                                                         = 317
   5439 	ERROR_MUI_FILE_NOT_FOUND                                                       = 15100
   5440 	ERROR_MUI_FILE_NOT_LOADED                                                      = 15105
   5441 	ERROR_MUI_INTLSETTINGS_INVALID_LOCALE_NAME                                     = 15108
   5442 	ERROR_MUI_INTLSETTINGS_UILANG_NOT_INSTALLED                                    = 15107
   5443 	ERROR_MUI_INVALID_FILE                                                         = 15101
   5444 	ERROR_MUI_INVALID_LOCALE_NAME                                                  = 15103
   5445 	ERROR_MUI_INVALID_RC_CONFIG                                                    = 15102
   5446 	ERROR_MUI_INVALID_ULTIMATEFALLBACK_NAME                                        = 15104
   5447 	ERROR_MUTUAL_AUTH_FAILED                                                       = 1397
   5448 	ERROR_NEEDS_REMEDIATION                                                        = 15612
   5449 	ERROR_NEGATIVE_SEEK                                                            = 131
   5450 	ERROR_NESTING_NOT_ALLOWED                                                      = 215
   5451 	ERROR_NETLOGON_NOT_STARTED                                                     = 1792
   5452 	ERROR_NETNAME_DELETED                                                          = 64
   5453 	ERROR_NETWORK_ACCESS_DENIED                                                    = 65
   5454 	ERROR_NETWORK_BUSY                                                             = 54
   5455 	ERROR_NETWORK_NOT_AVAILABLE                                                    = 5035
   5456 	ERROR_NETWORK_UNREACHABLE                                                      = 1231
   5457 	ERROR_NET_WRITE_FAULT                                                          = 88
   5458 	ERROR_NOACCESS                                                                 = 998
   5459 	ERROR_NODE_CANNOT_BE_CLUSTERED                                                 = 5898
   5460 	ERROR_NODE_CANT_HOST_RESOURCE                                                  = 5071
   5461 	ERROR_NODE_NOT_AVAILABLE                                                       = 5036
   5462 	ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT                                        = 1807
   5463 	ERROR_NOLOGON_SERVER_TRUST_ACCOUNT                                             = 1809
   5464 	ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT                                        = 1808
   5465 	ERROR_NONE_MAPPED                                                              = 1332
   5466 	ERROR_NONPAGED_SYSTEM_RESOURCES                                                = 1451
   5467 	ERROR_NON_ACCOUNT_SID                                                          = 1257
   5468 	ERROR_NON_DOMAIN_SID                                                           = 1258
   5469 	ERROR_NON_MDICHILD_WINDOW                                                      = 1445
   5470 	ERROR_NOTIFY_ENUM_DIR                                                          = 1022
   5471 	ERROR_NOT_ALL_ASSIGNED                                                         = 1300
   5472 	ERROR_NOT_AUTHENTICATED                                                        = 1244
   5473 	ERROR_NOT_A_REPARSE_POINT                                                      = 4390
   5474 	ERROR_NOT_CHILD_WINDOW                                                         = 1442
   5475 	ERROR_NOT_CONNECTED                                                            = 2250
   5476 	ERROR_NOT_CONTAINER                                                            = 1207
   5477 	ERROR_NOT_DOS_DISK                                                             = 26
   5478 	ERROR_NOT_EMPTY                                                                = 4307
   5479 	ERROR_NOT_ENOUGH_MEMORY                                                        = 8
   5480 	ERROR_NOT_ENOUGH_QUOTA                                                         = 1816
   5481 	ERROR_NOT_ENOUGH_SERVER_MEMORY                                                 = 1130
   5482 	ERROR_NOT_EXPORT_FORMAT                                                        = 6008
   5483 	ERROR_NOT_FOUND                                                                = 1168
   5484 	ERROR_NOT_GUI_PROCESS                                                          = 1471
   5485 	ERROR_NOT_JOINED                                                               = 136
   5486 	ERROR_NOT_LOCKED                                                               = 158
   5487 	ERROR_NOT_LOGGED_ON                                                            = 1245
   5488 	ERROR_NOT_LOGON_PROCESS                                                        = 1362
   5489 	ERROR_NOT_OWNER                                                                = 288
   5490 	ERROR_NOT_QUORUM_CAPABLE                                                       = 5021
   5491 	ERROR_NOT_QUORUM_CLASS                                                         = 5025
   5492 	ERROR_NOT_READY                                                                = 21
   5493 	ERROR_NOT_REGISTRY_FILE                                                        = 1017
   5494 	ERROR_NOT_SAFEBOOT_SERVICE                                                     = 1084
   5495 	ERROR_NOT_SAME_DEVICE                                                          = 17
   5496 	ERROR_NOT_SUBSTED                                                              = 137
   5497 	ERROR_NOT_SUPPORTED                                                            = 50
   5498 	ERROR_NOT_SUPPORTED_ON_SBS                                                     = 1254
   5499 	ERROR_NOT_SUPPORTED_ON_STANDARD_SERVER                                         = 8584
   5500 	ERROR_NO_ASSOCIATION                                                           = 1155
   5501 	ERROR_NO_BROWSER_SERVERS_FOUND                                                 = 6118
   5502 	ERROR_NO_DATA                                                                  = 232
   5503 	ERROR_NO_DATA_DETECTED                                                         = 1104
   5504 	ERROR_NO_EFS                                                                   = 6004
   5505 	ERROR_NO_IMPERSONATION_TOKEN                                                   = 1309
   5506 	ERROR_NO_INHERITANCE                                                           = 1391
   5507 	ERROR_NO_LOGON_SERVERS                                                         = 1311
   5508 	ERROR_NO_LOG_SPACE                                                             = 1019
   5509 	ERROR_NO_MATCH                                                                 = 1169
   5510 	ERROR_NO_MEDIA_IN_DRIVE                                                        = 1112
   5511 	ERROR_NO_MORE_DEVICES                                                          = 1248
   5512 	ERROR_NO_MORE_FILES                                                            = 18
   5513 	ERROR_NO_MORE_ITEMS                                                            = 259
   5514 	ERROR_NO_MORE_SEARCH_HANDLES                                                   = 113
   5515 	ERROR_NO_MORE_USER_HANDLES                                                     = 1158
   5516 	ERROR_NO_NETWORK                                                               = 1222
   5517 	ERROR_NO_NET_OR_BAD_PATH                                                       = 1203
   5518 	ERROR_NO_NVRAM_RESOURCES                                                       = 1470
   5519 	ERROR_NO_PROC_SLOTS                                                            = 89
   5520 	ERROR_NO_PROMOTION_ACTIVE                                                      = 8222
   5521 	ERROR_NO_QUOTAS_FOR_ACCOUNT                                                    = 1302
   5522 	ERROR_NO_RECOVERY_POLICY                                                       = 6003
   5523 	ERROR_NO_RECOVERY_PROGRAM                                                      = 1082
   5524 	ERROR_NO_SCROLLBARS                                                            = 1447
   5525 	ERROR_NO_SECURITY_ON_OBJECT                                                    = 1350
   5526 	ERROR_NO_SHUTDOWN_IN_PROGRESS                                                  = 1116
   5527 	ERROR_NO_SIGNAL_SENT                                                           = 205
   5528 	ERROR_NO_SITENAME                                                              = 1919
   5529 	ERROR_NO_SPOOL_SPACE                                                           = 62
   5530 	ERROR_NO_SUCH_ALIAS                                                            = 1376
   5531 	ERROR_NO_SUCH_DOMAIN                                                           = 1355
   5532 	ERROR_NO_SUCH_GROUP                                                            = 1319
   5533 	ERROR_NO_SUCH_LOGON_SESSION                                                    = 1312
   5534 	ERROR_NO_SUCH_MEMBER                                                           = 1387
   5535 	ERROR_NO_SUCH_PACKAGE                                                          = 1364
   5536 	ERROR_NO_SUCH_PRIVILEGE                                                        = 1313
   5537 	ERROR_NO_SUCH_SITE                                                             = 1249
   5538 	ERROR_NO_SUCH_USER                                                             = 1317
   5539 	ERROR_NO_SUPPORTING_DRIVES                                                     = 4339
   5540 	ERROR_NO_SYSTEM_MENU                                                           = 1437
   5541 	ERROR_NO_SYSTEM_RESOURCES                                                      = 1450
   5542 	ERROR_NO_TOKEN                                                                 = 1008
   5543 	ERROR_NO_TRACKING_SERVICE                                                      = 1172
   5544 	ERROR_NO_TRUST_LSA_SECRET                                                      = 1786
   5545 	ERROR_NO_TRUST_SAM_ACCOUNT                                                     = 1787
   5546 	ERROR_NO_UNICODE_TRANSLATION                                                   = 1113
   5547 	ERROR_NO_USER_KEYS                                                             = 6006
   5548 	ERROR_NO_USER_SESSION_KEY                                                      = 1394
   5549 	ERROR_NO_VOLUME_ID                                                             = 1173
   5550 	ERROR_NO_VOLUME_LABEL                                                          = 125
   5551 	ERROR_NO_WILDCARD_CHARACTERS                                                   = 1417
   5552 	ERROR_NT_CROSS_ENCRYPTION_REQUIRED                                             = 1386
   5553 	ERROR_NULL_LM_PASSWORD                                                         = 1304
   5554 	ERROR_OBJECT_ALREADY_EXISTS                                                    = 5010
   5555 	ERROR_OBJECT_IN_LIST                                                           = 5011
   5556 	ERROR_OBJECT_NOT_FOUND                                                         = 4312
   5557 	ERROR_OLD_WIN_VERSION                                                          = 1150
   5558 	ERROR_ONLY_IF_CONNECTED                                                        = 1251
   5559 	ERROR_OPEN_FAILED                                                              = 110
   5560 	ERROR_OPEN_FILES                                                               = 2401
   5561 	ERROR_OPERATION_ABORTED                                                        = 995
   5562 	ERROR_OPLOCK_NOT_GRANTED                                                       = 300
   5563 	ERROR_OUTOFMEMORY                                                              = 14
   5564 	ERROR_OUT_OF_PAPER                                                             = 28
   5565 	ERROR_OUT_OF_STRUCTURES                                                        = 84
   5566 	ERROR_OVERRIDE_NOCHANGES                                                       = 1252
   5567 	ERROR_PACKAGES_IN_USE                                                          = 15618
   5568 	ERROR_PACKAGE_ALREADY_EXISTS                                                   = 15611
   5569 	ERROR_PACKAGE_REPOSITORY_CORRUPTED                                             = 15614
   5570 	ERROR_PACKAGE_UPDATING                                                         = 15616
   5571 	ERROR_PAGED_SYSTEM_RESOURCES                                                   = 1452
   5572 	ERROR_PAGEFILE_QUOTA                                                           = 1454
   5573 	ERROR_PARAMETER_QUOTA_EXCEEDED                                                 = 1283
   5574 	ERROR_PARTIAL_COPY                                                             = 299
   5575 	ERROR_PARTITION_FAILURE                                                        = 1105
   5576 	ERROR_PASSWORD_EXPIRED                                                         = 1330
   5577 	ERROR_PASSWORD_MUST_CHANGE                                                     = 1907
   5578 	ERROR_PASSWORD_RESTRICTION                                                     = 1325
   5579 	ERROR_PATCH_PACKAGE_INVALID                                                    = 1636
   5580 	ERROR_PATCH_PACKAGE_OPEN_FAILED                                                = 1635
   5581 	ERROR_PATCH_PACKAGE_REJECTED                                                   = 1643
   5582 	ERROR_PATCH_PACKAGE_UNSUPPORTED                                                = 1637
   5583 	ERROR_PATCH_TARGET_NOT_FOUND                                                   = 1642
   5584 	ERROR_PATH_BUSY                                                                = 148
   5585 	ERROR_PATH_NOT_FOUND                                                           = 3
   5586 	ERROR_PER_USER_TRUST_QUOTA_EXCEEDED                                            = 1932
   5587 	ERROR_PIPE_BUSY                                                                = 231
   5588 	ERROR_PIPE_CONNECTED                                                           = 535
   5589 	ERROR_PIPE_LISTENING                                                           = 536
   5590 	ERROR_PIPE_LOCAL                                                               = 229
   5591 	ERROR_PIPE_NOT_CONNECTED                                                       = 233
   5592 	ERROR_PKINIT_FAILURE                                                           = 1263
   5593 	ERROR_POINT_NOT_FOUND                                                          = 1171
   5594 	ERROR_POLICY_OBJECT_NOT_FOUND                                                  = 8219
   5595 	ERROR_POLICY_ONLY_IN_DS                                                        = 8220
   5596 	ERROR_POPUP_ALREADY_ACTIVE                                                     = 1446
   5597 	ERROR_PORT_UNREACHABLE                                                         = 1234
   5598 	ERROR_POSSIBLE_DEADLOCK                                                        = 1131
   5599 	ERROR_POTENTIAL_FILE_FOUND                                                     = 1180
   5600 	ERROR_PRINTER_ALREADY_EXISTS                                                   = 1802
   5601 	ERROR_PRINTER_DELETED                                                          = 1905
   5602 	ERROR_PRINTER_DRIVER_ALREADY_INSTALLED                                         = 1795
   5603 	ERROR_PRINTER_DRIVER_BLOCKED                                                   = 3014
   5604 	ERROR_PRINTER_DRIVER_IN_USE                                                    = 3001
   5605 	ERROR_PRINTER_DRIVER_WARNED                                                    = 3013
   5606 	ERROR_PRINTER_HAS_JOBS_QUEUED                                                  = 3009
   5607 	ERROR_PRINTER_NOT_FOUND                                                        = 3012
   5608 	ERROR_PRINTQ_FULL                                                              = 61
   5609 	ERROR_PRINT_CANCELLED                                                          = 63
   5610 	ERROR_PRINT_MONITOR_ALREADY_INSTALLED                                          = 3006
   5611 	ERROR_PRINT_MONITOR_IN_USE                                                     = 3008
   5612 	ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED                                        = 3005
   5613 	ERROR_PRIVATE_DIALOG_INDEX                                                     = 1415
   5614 	ERROR_PRIVILEGE_NOT_HELD                                                       = 1314
   5615 	ERROR_PROCESS_ABORTED                                                          = 1067
   5616 	ERROR_PROC_NOT_FOUND                                                           = 127
   5617 	ERROR_PRODUCT_UNINSTALLED                                                      = 1614
   5618 	ERROR_PRODUCT_VERSION                                                          = 1638
   5619 	ERROR_PROFILE_NOT_ASSOCIATED_WITH_DEVICE                                       = 2015
   5620 	ERROR_PROFILE_NOT_FOUND                                                        = 2016
   5621 	ERROR_PROMOTION_ACTIVE                                                         = 8221
   5622 	ERROR_PROTOCOL_UNREACHABLE                                                     = 1233
   5623 	ERROR_QUORUMLOG_OPEN_FAILED                                                    = 5028
   5624 	ERROR_QUORUM_DISK_NOT_FOUND                                                    = 5086
   5625 	ERROR_QUORUM_OWNER_ALIVE                                                       = 5034
   5626 	ERROR_QUORUM_RESOURCE                                                          = 5020
   5627 	ERROR_QUORUM_RESOURCE_ONLINE_FAILED                                            = 5027
   5628 	ERROR_READ_FAULT                                                               = 30
   5629 	ERROR_RECOVERY_FAILURE                                                         = 1279
   5630 	ERROR_RECOVERY_FILE_CORRUPT                                                    = 15619
   5631 	ERROR_REC_NON_EXISTENT                                                         = 4005
   5632 	ERROR_REDIRECTOR_HAS_OPEN_HANDLES                                              = 1794
   5633 	ERROR_REDIR_PAUSED                                                             = 72
   5634 	ERROR_REGISTRY_CORRUPT                                                         = 1015
   5635 	ERROR_REGISTRY_IO_FAILED                                                       = 1016
   5636 	ERROR_REGISTRY_RECOVERED                                                       = 1014
   5637 	ERROR_REG_NAT_CONSUMPTION                                                      = 1261
   5638 	ERROR_RELOC_CHAIN_XEEDS_SEGLIM                                                 = 201
   5639 	ERROR_REMOTE_PRINT_CONNECTIONS_BLOCKED                                         = 1936
   5640 	ERROR_REMOTE_SESSION_LIMIT_EXCEEDED                                            = 1220
   5641 	ERROR_REMOTE_STORAGE_MEDIA_ERROR                                               = 4352
   5642 	ERROR_REMOTE_STORAGE_NOT_ACTIVE                                                = 4351
   5643 	ERROR_REMOVE_FAILED                                                            = 15610
   5644 	ERROR_REM_NOT_LIST                                                             = 51
   5645 	ERROR_REPARSE_ATTRIBUTE_CONFLICT                                               = 4391
   5646 	ERROR_REPARSE_TAG_INVALID                                                      = 4393
   5647 	ERROR_REPARSE_TAG_MISMATCH                                                     = 4394
   5648 	ERROR_REQUEST_ABORTED                                                          = 1235
   5649 	ERROR_REQUEST_REFUSED                                                          = 4320
   5650 	ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION                                       = 1459
   5651 	ERROR_REQ_NOT_ACCEP                                                            = 71
   5652 	ERROR_RESILIENCY_FILE_CORRUPT                                                  = 15625
   5653 	ERROR_RESMON_CREATE_FAILED                                                     = 5017
   5654 	ERROR_RESMON_INVALID_STATE                                                     = 5084
   5655 	ERROR_RESMON_ONLINE_FAILED                                                     = 5018
   5656 	ERROR_RESOURCE_DATA_NOT_FOUND                                                  = 1812
   5657 	ERROR_RESOURCE_DISABLED                                                        = 4309
   5658 	ERROR_RESOURCE_ENUM_USER_STOP                                                  = 15106
   5659 	ERROR_RESOURCE_FAILED                                                          = 5038
   5660 	ERROR_RESOURCE_LANG_NOT_FOUND                                                  = 1815
   5661 	ERROR_RESOURCE_NAME_NOT_FOUND                                                  = 1814
   5662 	ERROR_RESOURCE_NOT_AVAILABLE                                                   = 5006
   5663 	ERROR_RESOURCE_NOT_FOUND                                                       = 5007
   5664 	ERROR_RESOURCE_NOT_ONLINE                                                      = 5004
   5665 	ERROR_RESOURCE_NOT_PRESENT                                                     = 4316
   5666 	ERROR_RESOURCE_ONLINE                                                          = 5019
   5667 	ERROR_RESOURCE_PROPERTIES_STORED                                               = 5024
   5668 	ERROR_RESOURCE_PROPERTY_UNCHANGEABLE                                           = 5089
   5669 	ERROR_RESOURCE_TYPE_NOT_FOUND                                                  = 1813
   5670 	ERROR_RESTART_APPLICATION                                                      = 1467
   5671 	ERROR_RETRY                                                                    = 1237
   5672 	ERROR_REVISION_MISMATCH                                                        = 1306
   5673 	ERROR_RING2SEG_MUST_BE_MOVABLE                                                 = 200
   5674 	ERROR_RING2_STACK_IN_USE                                                       = 207
   5675 	ERROR_RMODE_APP                                                                = 1153
   5676 	ERROR_RPL_NOT_ALLOWED                                                          = 4006
   5677 	ERROR_RUNLEVEL_SWITCH_AGENT_TIMEOUT                                            = 15403
   5678 	ERROR_RUNLEVEL_SWITCH_IN_PROGRESS                                              = 15404
   5679 	ERROR_RUNLEVEL_SWITCH_TIMEOUT                                                  = 15402
   5680 	ERROR_RXACT_COMMIT_FAILURE                                                     = 1370
   5681 	ERROR_RXACT_INVALID_STATE                                                      = 1369
   5682 	ERROR_SAME_DRIVE                                                               = 143
   5683 	ERROR_SAM_INIT_FAILURE                                                         = 8541
   5684 	ERROR_SCOPE_NOT_FOUND                                                          = 318
   5685 	ERROR_SCREEN_ALREADY_LOCKED                                                    = 1440
   5686 	ERROR_SECONDARY_IC_PROVIDER_NOT_REGISTERED                                     = 15321
   5687 	ERROR_SECRET_TOO_LONG                                                          = 1382
   5688 	ERROR_SECTOR_NOT_FOUND                                                         = 27
   5689 	ERROR_SEEK                                                                     = 25
   5690 	ERROR_SEEK_ON_DEVICE                                                           = 132
   5691 	ERROR_SEM_IS_SET                                                               = 102
   5692 	ERROR_SEM_NOT_FOUND                                                            = 187
   5693 	ERROR_SEM_OWNER_DIED                                                           = 105
   5694 	ERROR_SEM_TIMEOUT                                                              = 121
   5695 	ERROR_SEM_USER_LIMIT                                                           = 106
   5696 	ERROR_SERIAL_NO_DEVICE                                                         = 1118
   5697 	ERROR_SERVER_DISABLED                                                          = 1341
   5698 	ERROR_SERVER_HAS_OPEN_HANDLES                                                  = 1811
   5699 	ERROR_SERVER_NOT_DISABLED                                                      = 1342
   5700 	ERROR_SERVER_SHUTDOWN_IN_PROGRESS                                              = 1255
   5701 	ERROR_SERVICES_FAILED_AUTOSTART                                                = 15405
   5702 	ERROR_SERVICE_ALREADY_RUNNING                                                  = 1056
   5703 	ERROR_SERVICE_CANNOT_ACCEPT_CTRL                                               = 1061
   5704 	ERROR_SERVICE_DATABASE_LOCKED                                                  = 1055
   5705 	ERROR_SERVICE_DEPENDENCY_DELETED                                               = 1075
   5706 	ERROR_SERVICE_DEPENDENCY_FAIL                                                  = 1068
   5707 	ERROR_SERVICE_DISABLED                                                         = 1058
   5708 	ERROR_SERVICE_DOES_NOT_EXIST                                                   = 1060
   5709 	ERROR_SERVICE_EXISTS                                                           = 1073
   5710 	ERROR_SERVICE_LOGON_FAILED                                                     = 1069
   5711 	ERROR_SERVICE_MARKED_FOR_DELETE                                                = 1072
   5712 	ERROR_SERVICE_NEVER_STARTED                                                    = 1077
   5713 	ERROR_SERVICE_NOT_ACTIVE                                                       = 1062
   5714 	ERROR_SERVICE_NOT_FOUND                                                        = 1243
   5715 	ERROR_SERVICE_NOT_IN_EXE                                                       = 1083
   5716 	ERROR_SERVICE_NO_THREAD                                                        = 1054
   5717 	ERROR_SERVICE_REQUEST_TIMEOUT                                                  = 1053
   5718 	ERROR_SERVICE_SPECIFIC_ERROR                                                   = 1066
   5719 	ERROR_SERVICE_START_HANG                                                       = 1070
   5720 	ERROR_SESSION_CREDENTIAL_CONFLICT                                              = 1219
   5721 	ERROR_SETCOUNT_ON_BAD_LB                                                       = 1433
   5722 	ERROR_SETMARK_DETECTED                                                         = 1103
   5723 	ERROR_SET_NOT_FOUND                                                            = 1170
   5724 	ERROR_SET_POWER_STATE_FAILED                                                   = 1141
   5725 	ERROR_SET_POWER_STATE_VETOED                                                   = 1140
   5726 	ERROR_SEVERITY_ERROR                                                           = 0xC0000000
   5727 	ERROR_SEVERITY_INFORMATIONAL                                                   = 0x40000000
   5728 	ERROR_SEVERITY_SUCCESS                                                         = 0x00000000
   5729 	ERROR_SEVERITY_WARNING                                                         = 0x80000000
   5730 	ERROR_SHARED_POLICY                                                            = 8218
   5731 	ERROR_SHARING_BUFFER_EXCEEDED                                                  = 36
   5732 	ERROR_SHARING_PAUSED                                                           = 70
   5733 	ERROR_SHARING_VIOLATION                                                        = 32
   5734 	ERROR_SHUTDOWN_CLUSTER                                                         = 5008
   5735 	ERROR_SHUTDOWN_IN_PROGRESS                                                     = 1115
   5736 	ERROR_SIGNAL_PENDING                                                           = 162
   5737 	ERROR_SIGNAL_REFUSED                                                           = 156
   5738 	ERROR_SINGLE_INSTANCE_APP                                                      = 1152
   5739 	ERROR_SLOT_NOT_PRESENT                                                         = 0x00000004
   5740 	ERROR_SMARTCARD_SUBSYSTEM_FAILURE                                              = 1264
   5741 	ERROR_SMI_PRIMITIVE_INSTALLER_FAILED                                           = 14108
   5742 	ERROR_SOME_NOT_MAPPED                                                          = 1301
   5743 	ERROR_SOURCE_ELEMENT_EMPTY                                                     = 1160
   5744 	ERROR_SPECIAL_ACCOUNT                                                          = 1371
   5745 	ERROR_SPECIAL_GROUP                                                            = 1372
   5746 	ERROR_SPECIAL_USER                                                             = 1373
   5747 	ERROR_SPL_NO_ADDJOB                                                            = 3004
   5748 	ERROR_SPL_NO_STARTDOC                                                          = 3003
   5749 	ERROR_SPOOL_FILE_NOT_FOUND                                                     = 3002
   5750 	ERROR_STACK_BUFFER_OVERRUN                                                     = 1282
   5751 	ERROR_STACK_OVERFLOW                                                           = 1001
   5752 	ERROR_STATE_COMPOSITE_SETTING_VALUE_SIZE_LIMIT_EXCEEDED                        = 15815
   5753 	ERROR_STATE_CONTAINER_NAME_SIZE_LIMIT_EXCEEDED                                 = 15818
   5754 	ERROR_STATE_CREATE_CONTAINER_FAILED                                            = 15805
   5755 	ERROR_STATE_DELETE_CONTAINER_FAILED                                            = 15806
   5756 	ERROR_STATE_DELETE_SETTING_FAILED                                              = 15809
   5757 	ERROR_STATE_ENUMERATE_CONTAINER_FAILED                                         = 15813
   5758 	ERROR_STATE_ENUMERATE_SETTINGS_FAILED                                          = 15814
   5759 	ERROR_STATE_GET_VERSION_FAILED                                                 = 15801
   5760 	ERROR_STATE_LOAD_STORE_FAILED                                                  = 15800
   5761 	ERROR_STATE_OPEN_CONTAINER_FAILED                                              = 15804
   5762 	ERROR_STATE_QUERY_SETTING_FAILED                                               = 15810
   5763 	ERROR_STATE_READ_COMPOSITE_SETTING_FAILED                                      = 15811
   5764 	ERROR_STATE_READ_SETTING_FAILED                                                = 15807
   5765 	ERROR_STATE_SETTING_NAME_SIZE_LIMIT_EXCEEDED                                   = 15817
   5766 	ERROR_STATE_SETTING_VALUE_SIZE_LIMIT_EXCEEDED                                  = 15816
   5767 	ERROR_STATE_SET_VERSION_FAILED                                                 = 15802
   5768 	ERROR_STATE_STRUCTURED_RESET_FAILED                                            = 15803
   5769 	ERROR_STATE_WRITE_COMPOSITE_SETTING_FAILED                                     = 15812
   5770 	ERROR_STATE_WRITE_SETTING_FAILED                                               = 15808
   5771 	ERROR_STATIC_INIT                                                              = 4002
   5772 	ERROR_SUBST_TO_JOIN                                                            = 141
   5773 	ERROR_SUBST_TO_SUBST                                                           = 139
   5774 	ERROR_SUCCESS                                                                  = 0
   5775 	ERROR_SUCCESS_REBOOT_INITIATED                                                 = 1641
   5776 	ERROR_SUCCESS_REBOOT_REQUIRED                                                  = 3010
   5777 	ERROR_SUCCESS_RESTART_REQUIRED                                                 = 3011
   5778 	ERROR_SWAPERROR                                                                = 999
   5779 	ERROR_SXS_ACTIVATION_CONTEXT_DISABLED                                          = 14006
   5780 	ERROR_SXS_ASSEMBLY_IS_NOT_A_DEPLOYMENT                                         = 14103
   5781 	ERROR_SXS_ASSEMBLY_MISSING                                                     = 14081
   5782 	ERROR_SXS_ASSEMBLY_NOT_FOUND                                                   = 14003
   5783 	ERROR_SXS_ASSEMBLY_NOT_LOCKED                                                  = 14097
   5784 	ERROR_SXS_CANT_GEN_ACTCTX                                                      = 14001
   5785 	ERROR_SXS_COMPONENT_STORE_CORRUPT                                              = 14098
   5786 	ERROR_SXS_CORRUPTION                                                           = 14083
   5787 	ERROR_SXS_CORRUPT_ACTIVATION_STACK                                             = 14082
   5788 	ERROR_SXS_DUPLICATE_ASSEMBLY_NAME                                              = 14027
   5789 	ERROR_SXS_DUPLICATE_CLSID                                                      = 14023
   5790 	ERROR_SXS_DUPLICATE_DLL_NAME                                                   = 14021
   5791 	ERROR_SXS_DUPLICATE_IID                                                        = 14024
   5792 	ERROR_SXS_DUPLICATE_PROGID                                                     = 14026
   5793 	ERROR_SXS_DUPLICATE_TLBID                                                      = 14025
   5794 	ERROR_SXS_DUPLICATE_WINDOWCLASS_NAME                                           = 14022
   5795 	ERROR_SXS_EARLY_DEACTIVATION                                                   = 14084
   5796 	ERROR_SXS_FILE_HASH_MISMATCH                                                   = 14028
   5797 	ERROR_SXS_FILE_HASH_MISSING                                                    = 14110
   5798 	ERROR_SXS_FILE_NOT_PART_OF_ASSEMBLY                                            = 14104
   5799 	ERROR_SXS_IDENTITIES_DIFFERENT                                                 = 14102
   5800 	ERROR_SXS_IDENTITY_DUPLICATE_ATTRIBUTE                                         = 14092
   5801 	ERROR_SXS_IDENTITY_PARSE_ERROR                                                 = 14093
   5802 	ERROR_SXS_INCORRECT_PUBLIC_KEY_TOKEN                                           = 14095
   5803 	ERROR_SXS_INVALID_ACTCTXDATA_FORMAT                                            = 14002
   5804 	ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE                                  = 14017
   5805 	ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME                             = 14080
   5806 	ERROR_SXS_INVALID_DEACTIVATION                                                 = 14085
   5807 	ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME                                      = 14091
   5808 	ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE                                     = 14090
   5809 	ERROR_SXS_INVALID_XML_NAMESPACE_URI                                            = 14014
   5810 	ERROR_SXS_KEY_NOT_FOUND                                                        = 14007
   5811 	ERROR_SXS_LEAF_MANIFEST_DEPENDENCY_NOT_INSTALLED                               = 14016
   5812 	ERROR_SXS_MANIFEST_FORMAT_ERROR                                                = 14004
   5813 	ERROR_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT                        = 14101
   5814 	ERROR_SXS_MANIFEST_INVALID_REQUIRED_DEFAULT_NAMESPACE                          = 14019
   5815 	ERROR_SXS_MANIFEST_MISSING_REQUIRED_DEFAULT_NAMESPACE                          = 14018
   5816 	ERROR_SXS_MANIFEST_PARSE_ERROR                                                 = 14005
   5817 	ERROR_SXS_MANIFEST_TOO_BIG                                                     = 14105
   5818 	ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE                                  = 14079
   5819 	ERROR_SXS_MULTIPLE_DEACTIVATION                                                = 14086
   5820 	ERROR_SXS_POLICY_PARSE_ERROR                                                   = 14029
   5821 	ERROR_SXS_PRIVATE_MANIFEST_CROSS_PATH_WITH_REPARSE_POINT                       = 14020
   5822 	ERROR_SXS_PROCESS_DEFAULT_ALREADY_SET                                          = 14011
   5823 	ERROR_SXS_PROCESS_TERMINATION_REQUESTED                                        = 14087
   5824 	ERROR_SXS_PROTECTION_CATALOG_FILE_MISSING                                      = 14078
   5825 	ERROR_SXS_PROTECTION_CATALOG_NOT_VALID                                         = 14076
   5826 	ERROR_SXS_PROTECTION_PUBLIC_KEY_TOO_SHORT                                      = 14075
   5827 	ERROR_SXS_PROTECTION_RECOVERY_FAILED                                           = 14074
   5828 	ERROR_SXS_RELEASE_ACTIVATION_CONTEXT                                           = 14088
   5829 	ERROR_SXS_ROOT_MANIFEST_DEPENDENCY_NOT_INSTALLED                               = 14015
   5830 	ERROR_SXS_SECTION_NOT_FOUND                                                    = 14000
   5831 	ERROR_SXS_SETTING_NOT_REGISTERED                                               = 14106
   5832 	ERROR_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY                              = 14089
   5833 	ERROR_SXS_THREAD_QUERIES_DISABLED                                              = 14010
   5834 	ERROR_SXS_TRANSACTION_CLOSURE_INCOMPLETE                                       = 14107
   5835 	ERROR_SXS_UNKNOWN_ENCODING                                                     = 14013
   5836 	ERROR_SXS_UNKNOWN_ENCODING_GROUP                                               = 14012
   5837 	ERROR_SXS_UNTRANSLATABLE_HRESULT                                               = 14077
   5838 	ERROR_SXS_VERSION_CONFLICT                                                     = 14008
   5839 	ERROR_SXS_WRONG_SECTION_TYPE                                                   = 14009
   5840 	ERROR_SXS_XML_E_BADCHARDATA                                                    = 14036
   5841 	ERROR_SXS_XML_E_BADCHARINSTRING                                                = 14034
   5842 	ERROR_SXS_XML_E_BADNAMECHAR                                                    = 14033
   5843 	ERROR_SXS_XML_E_BADPEREFINSUBSET                                               = 14059
   5844 	ERROR_SXS_XML_E_BADSTARTNAMECHAR                                               = 14032
   5845 	ERROR_SXS_XML_E_BADXMLCASE                                                     = 14069
   5846 	ERROR_SXS_XML_E_BADXMLDECL                                                     = 14056
   5847 	ERROR_SXS_XML_E_COMMENTSYNTAX                                                  = 14031
   5848 	ERROR_SXS_XML_E_DUPLICATEATTRIBUTE                                             = 14053
   5849 	ERROR_SXS_XML_E_EXPECTINGCLOSEQUOTE                                            = 14045
   5850 	ERROR_SXS_XML_E_EXPECTINGTAGEND                                                = 14038
   5851 	ERROR_SXS_XML_E_INCOMPLETE_ENCODING                                            = 14043
   5852 	ERROR_SXS_XML_E_INTERNALERROR                                                  = 14041
   5853 	ERROR_SXS_XML_E_INVALIDATROOTLEVEL                                             = 14055
   5854 	ERROR_SXS_XML_E_INVALIDENCODING                                                = 14067
   5855 	ERROR_SXS_XML_E_INVALIDSWITCH                                                  = 14068
   5856 	ERROR_SXS_XML_E_INVALID_DECIMAL                                                = 14047
   5857 	ERROR_SXS_XML_E_INVALID_HEXIDECIMAL                                            = 14048
   5858 	ERROR_SXS_XML_E_INVALID_STANDALONE                                             = 14070
   5859 	ERROR_SXS_XML_E_INVALID_UNICODE                                                = 14049
   5860 	ERROR_SXS_XML_E_INVALID_VERSION                                                = 14072
   5861 	ERROR_SXS_XML_E_MISSINGEQUALS                                                  = 14073
   5862 	ERROR_SXS_XML_E_MISSINGQUOTE                                                   = 14030
   5863 	ERROR_SXS_XML_E_MISSINGROOT                                                    = 14057
   5864 	ERROR_SXS_XML_E_MISSINGSEMICOLON                                               = 14039
   5865 	ERROR_SXS_XML_E_MISSINGWHITESPACE                                              = 14037
   5866 	ERROR_SXS_XML_E_MISSING_PAREN                                                  = 14044
   5867 	ERROR_SXS_XML_E_MULTIPLEROOTS                                                  = 14054
   5868 	ERROR_SXS_XML_E_MULTIPLE_COLONS                                                = 14046
   5869 	ERROR_SXS_XML_E_RESERVEDNAMESPACE                                              = 14066
   5870 	ERROR_SXS_XML_E_UNBALANCEDPAREN                                                = 14040
   5871 	ERROR_SXS_XML_E_UNCLOSEDCDATA                                                  = 14065
   5872 	ERROR_SXS_XML_E_UNCLOSEDCOMMENT                                                = 14063
   5873 	ERROR_SXS_XML_E_UNCLOSEDDECL                                                   = 14064
   5874 	ERROR_SXS_XML_E_UNCLOSEDENDTAG                                                 = 14061
   5875 	ERROR_SXS_XML_E_UNCLOSEDSTARTTAG                                               = 14060
   5876 	ERROR_SXS_XML_E_UNCLOSEDSTRING                                                 = 14062
   5877 	ERROR_SXS_XML_E_UNCLOSEDTAG                                                    = 14052
   5878 	ERROR_SXS_XML_E_UNEXPECTEDENDTAG                                               = 14051
   5879 	ERROR_SXS_XML_E_UNEXPECTEDEOF                                                  = 14058
   5880 	ERROR_SXS_XML_E_UNEXPECTED_STANDALONE                                          = 14071
   5881 	ERROR_SXS_XML_E_UNEXPECTED_WHITESPACE                                          = 14042
   5882 	ERROR_SXS_XML_E_WHITESPACEORQUESTIONMARK                                       = 14050
   5883 	ERROR_SXS_XML_E_XMLDECLSYNTAX                                                  = 14035
   5884 	ERROR_SYMLINK_CLASS_DISABLED                                                   = 1463
   5885 	ERROR_SYMLINK_NOT_SUPPORTED                                                    = 1464
   5886 	ERROR_SYNC_FOREGROUND_REFRESH_REQUIRED                                         = 1274
   5887 	ERROR_SYSTEM_DEVICE_NOT_FOUND                                                  = 15299
   5888 	ERROR_SYSTEM_NEEDS_REMEDIATION                                                 = 15623
   5889 	ERROR_SYSTEM_TRACE                                                             = 150
   5890 	ERROR_TAG_NOT_FOUND                                                            = 2012
   5891 	ERROR_TAG_NOT_PRESENT                                                          = 2013
   5892 	ERROR_THREAD_1_INACTIVE                                                        = 210
   5893 	ERROR_TIMEOUT                                                                  = 1460
   5894 	ERROR_TIME_SKEW                                                                = 1398
   5895 	ERROR_TLW_WITH_WSCHILD                                                         = 1406
   5896 	ERROR_TOKEN_ALREADY_IN_USE                                                     = 1375
   5897 	ERROR_TOO_MANY_CMDS                                                            = 56
   5898 	ERROR_TOO_MANY_CONTEXT_IDS                                                     = 1384
   5899 	ERROR_TOO_MANY_LINKS                                                           = 1142
   5900 	ERROR_TOO_MANY_LUIDS_REQUESTED                                                 = 1333
   5901 	ERROR_TOO_MANY_MODULES                                                         = 214
   5902 	ERROR_TOO_MANY_MUXWAITERS                                                      = 152
   5903 	ERROR_TOO_MANY_NAMES                                                           = 68
   5904 	ERROR_TOO_MANY_OPEN_FILES                                                      = 4
   5905 	ERROR_TOO_MANY_POSTS                                                           = 298
   5906 	ERROR_TOO_MANY_SECRETS                                                         = 1381
   5907 	ERROR_TOO_MANY_SEMAPHORES                                                      = 100
   5908 	ERROR_TOO_MANY_SEM_REQUESTS                                                    = 103
   5909 	ERROR_TOO_MANY_SESS                                                            = 69
   5910 	ERROR_TOO_MANY_SIDS                                                            = 1389
   5911 	ERROR_TOO_MANY_TCBS                                                            = 155
   5912 	ERROR_TRANSFORM_NOT_SUPPORTED                                                  = 2004
   5913 	ERROR_TRANSPORT_FULL                                                           = 4328
   5914 	ERROR_TRAY_MALFUNCTION                                                         = 0x00000010
   5915 	ERROR_TRUSTED_DOMAIN_FAILURE                                                   = 1788
   5916 	ERROR_TRUSTED_RELATIONSHIP_FAILURE                                             = 1789
   5917 	ERROR_TRUST_FAILURE                                                            = 1790
   5918 	ERROR_UNABLE_TO_CLEAN                                                          = 4311
   5919 	ERROR_UNABLE_TO_EJECT_MOUNTED_MEDIA                                            = 4330
   5920 	ERROR_UNABLE_TO_INVENTORY_DRIVE                                                = 4325
   5921 	ERROR_UNABLE_TO_INVENTORY_SLOT                                                 = 4326
   5922 	ERROR_UNABLE_TO_INVENTORY_TRANSPORT                                            = 4327
   5923 	ERROR_UNABLE_TO_LOAD_MEDIUM                                                    = 4324
   5924 	ERROR_UNABLE_TO_LOCK_MEDIA                                                     = 1108
   5925 	ERROR_UNABLE_TO_MOVE_REPLACEMENT                                               = 1176
   5926 	ERROR_UNABLE_TO_MOVE_REPLACEMENT_2                                             = 1177
   5927 	ERROR_UNABLE_TO_REMOVE_REPLACED                                                = 1175
   5928 	ERROR_UNABLE_TO_UNLOAD_MEDIA                                                   = 1109
   5929 	ERROR_UNEXPECTED_OMID                                                          = 4334
   5930 	ERROR_UNEXP_NET_ERR                                                            = 59
   5931 	ERROR_UNHANDLED_ERROR                                                          = 0xFFFFFFFF
   5932 	ERROR_UNIDENTIFIED_ERROR                                                       = 1287
   5933 	ERROR_UNKNOWN_COMPONENT                                                        = 1607
   5934 	ERROR_UNKNOWN_FEATURE                                                          = 1606
   5935 	ERROR_UNKNOWN_PORT                                                             = 1796
   5936 	ERROR_UNKNOWN_PRINTER_DRIVER                                                   = 1797
   5937 	ERROR_UNKNOWN_PRINTPROCESSOR                                                   = 1798
   5938 	ERROR_UNKNOWN_PRINT_MONITOR                                                    = 3000
   5939 	ERROR_UNKNOWN_PRODUCT                                                          = 1605
   5940 	ERROR_UNKNOWN_PROPERTY                                                         = 1608
   5941 	ERROR_UNKNOWN_REVISION                                                         = 1305
   5942 	ERROR_UNMAPPED_SUBSTITUTION_STRING                                             = 14096
   5943 	ERROR_UNRECOGNIZED_MEDIA                                                       = 1785
   5944 	ERROR_UNRECOGNIZED_VOLUME                                                      = 1005
   5945 	ERROR_UNSUPPORTED_TYPE                                                         = 1630
   5946 	ERROR_USER_APC                                                                 = 737
   5947 	ERROR_USER_DELETE_TRUST_QUOTA_EXCEEDED                                         = 1934
   5948 	ERROR_USER_EXISTS                                                              = 1316
   5949 	ERROR_USER_MAPPED_FILE                                                         = 1224
   5950 	ERROR_VC_DISCONNECTED                                                          = 240
   5951 	ERROR_VDM_DISALLOWED                                                           = 1286
   5952 	ERROR_VOLUME_CONTAINS_SYS_FILES                                                = 4337
   5953 	ERROR_VOLUME_NOT_SIS_ENABLED                                                   = 4500
   5954 	ERROR_VOLUME_NOT_SUPPORT_EFS                                                   = 6014
   5955 	ERROR_WAIT_1                                                                   = 731
   5956 	ERROR_WAIT_2                                                                   = 732
   5957 	ERROR_WAIT_3                                                                   = 733
   5958 	ERROR_WAIT_63                                                                  = 734
   5959 	ERROR_WAIT_NO_CHILDREN                                                         = 128
   5960 	ERROR_WAKE_SYSTEM                                                              = 730
   5961 	ERROR_WINDOW_NOT_COMBOBOX                                                      = 1423
   5962 	ERROR_WINDOW_NOT_DIALOG                                                        = 1420
   5963 	ERROR_WINDOW_OF_OTHER_THREAD                                                   = 1408
   5964 	ERROR_WINS_INTERNAL                                                            = 4000
   5965 	ERROR_WMI_ALREADY_DISABLED                                                     = 4212
   5966 	ERROR_WMI_ALREADY_ENABLED                                                      = 4206
   5967 	ERROR_WMI_DP_FAILED                                                            = 4209
   5968 	ERROR_WMI_DP_NOT_FOUND                                                         = 4204
   5969 	ERROR_WMI_GUID_DISCONNECTED                                                    = 4207
   5970 	ERROR_WMI_GUID_NOT_FOUND                                                       = 4200
   5971 	ERROR_WMI_INSTANCE_NOT_FOUND                                                   = 4201
   5972 	ERROR_WMI_INVALID_MOF                                                          = 4210
   5973 	ERROR_WMI_INVALID_REGINFO                                                      = 4211
   5974 	ERROR_WMI_ITEMID_NOT_FOUND                                                     = 4202
   5975 	ERROR_WMI_READ_ONLY                                                            = 4213
   5976 	ERROR_WMI_SERVER_UNAVAILABLE                                                   = 4208
   5977 	ERROR_WMI_SET_FAILURE                                                          = 4214
   5978 	ERROR_WMI_TRY_AGAIN                                                            = 4203
   5979 	ERROR_WMI_UNRESOLVED_INSTANCE_REF                                              = 4205
   5980 	ERROR_WORKING_SET_QUOTA                                                        = 1453
   5981 	ERROR_WRITE_FAULT                                                              = 29
   5982 	ERROR_WRITE_PROTECT                                                            = 19
   5983 	ERROR_WRONG_COMPARTMENT                                                        = 1468
   5984 	ERROR_WRONG_DISK                                                               = 34
   5985 	ERROR_WRONG_EFS                                                                = 6005
   5986 	ERROR_WRONG_PASSWORD                                                           = 1323
   5987 	ERROR_WRONG_TARGET_NAME                                                        = 1396
   5988 	ERROR_XMLDSIG_ERROR                                                            = 1466
   5989 	ERROR_XML_ENCODING_MISMATCH                                                    = 14100
   5990 	ERROR_XML_PARSE_ERROR                                                          = 1465
   5991 	ESB_DISABLE_BOTH                                                               = 0x0003
   5992 	ESB_DISABLE_DOWN                                                               = 0x0002
   5993 	ESB_DISABLE_LEFT                                                               = 0x0001
   5994 	ESB_DISABLE_LTUP                                                               = 1
   5995 	ESB_DISABLE_RIGHT                                                              = 0x0002
   5996 	ESB_DISABLE_RTDN                                                               = 2
   5997 	ESB_DISABLE_UP                                                                 = 0x0001
   5998 	ESB_ENABLE_BOTH                                                                = 0x0000
   5999 	ESPIPE                                                                         = 29
   6000 	ESRCH                                                                          = 3
   6001 	ES_AUTOHSCROLL                                                                 = 128
   6002 	ES_AUTOVSCROLL                                                                 = 64
   6003 	ES_CENTER                                                                      = 1
   6004 	ES_LEFT                                                                        = 0
   6005 	ES_LOWERCASE                                                                   = 16
   6006 	ES_MULTILINE                                                                   = 4
   6007 	ES_NOHIDESEL                                                                   = 256
   6008 	ES_NUMBER                                                                      = 8192
   6009 	ES_OEMCONVERT                                                                  = 1024
   6010 	ES_PASSWORD                                                                    = 32
   6011 	ES_READONLY                                                                    = 2048
   6012 	ES_RIGHT                                                                       = 2
   6013 	ES_UPPERCASE                                                                   = 8
   6014 	ES_WANTRETURN                                                                  = 4096
   6015 	ETIME                                                                          = 137
   6016 	ETIMEDOUT                                                                      = 138
   6017 	ETO_CLIPPED                                                                    = 0x0004
   6018 	ETO_GLYPH_INDEX                                                                = 0x0010
   6019 	ETO_IGNORELANGUAGE                                                             = 0x1000
   6020 	ETO_NUMERICSLATIN                                                              = 0x0800
   6021 	ETO_NUMERICSLOCAL                                                              = 0x0400
   6022 	ETO_OPAQUE                                                                     = 0x0002
   6023 	ETO_PDY                                                                        = 0x2000
   6024 	ETO_RTLREADING                                                                 = 0x0080
   6025 	ETXTBSY                                                                        = 139
   6026 	EU4_EXPR                                                                       = 2
   6027 	EU4_IDX                                                                        = 1
   6028 	EU4_NONE                                                                       = 0
   6029 	EVENPARITY                                                                     = 2
   6030 	EVENTLOG_AUDIT_FAILURE                                                         = 0x0010
   6031 	EVENTLOG_AUDIT_SUCCESS                                                         = 0x0008
   6032 	EVENTLOG_BACKWARDS_READ                                                        = 0x0008
   6033 	EVENTLOG_END_ALL_PAIRED_EVENTS                                                 = 0x0004
   6034 	EVENTLOG_END_PAIRED_EVENT                                                      = 0x0002
   6035 	EVENTLOG_ERROR_TYPE                                                            = 0x0001
   6036 	EVENTLOG_FORWARDS_READ                                                         = 0x0004
   6037 	EVENTLOG_FULL_INFO                                                             = 0
   6038 	EVENTLOG_INFORMATION_TYPE                                                      = 0x0004
   6039 	EVENTLOG_PAIRED_EVENT_ACTIVE                                                   = 0x0008
   6040 	EVENTLOG_PAIRED_EVENT_INACTIVE                                                 = 0x0010
   6041 	EVENTLOG_SEEK_READ                                                             = 0x0002
   6042 	EVENTLOG_SEQUENTIAL_READ                                                       = 0x0001
   6043 	EVENTLOG_START_PAIRED_EVENT                                                    = 0x0001
   6044 	EVENTLOG_SUCCESS                                                               = 0x0000
   6045 	EVENTLOG_WARNING_TYPE                                                          = 0x0002
   6046 	EVENT_ALL_ACCESS                                                               = 2031619
   6047 	EVENT_CONSOLE_CARET                                                            = 0x4001
   6048 	EVENT_CONSOLE_END_APPLICATION                                                  = 0x4007
   6049 	EVENT_CONSOLE_LAYOUT                                                           = 0x4005
   6050 	EVENT_CONSOLE_START_APPLICATION                                                = 0x4006
   6051 	EVENT_CONSOLE_UPDATE_REGION                                                    = 0x4002
   6052 	EVENT_CONSOLE_UPDATE_SCROLL                                                    = 0x4004
   6053 	EVENT_CONSOLE_UPDATE_SIMPLE                                                    = 0x4003
   6054 	EVENT_E_FIRST                                                                  = 2147746304
   6055 	EVENT_E_LAST                                                                   = 2147746335
   6056 	EVENT_MAX                                                                      = 0x7FFFFFFF
   6057 	EVENT_MIN                                                                      = 0x00000001
   6058 	EVENT_MODIFY_STATE                                                             = 0x0002
   6059 	EVENT_OBJECT_ACCELERATORCHANGE                                                 = 0x8012
   6060 	EVENT_OBJECT_CREATE                                                            = 0x8000
   6061 	EVENT_OBJECT_DEFACTIONCHANGE                                                   = 0x8011
   6062 	EVENT_OBJECT_DESCRIPTIONCHANGE                                                 = 0x800D
   6063 	EVENT_OBJECT_DESTROY                                                           = 0x8001
   6064 	EVENT_OBJECT_FOCUS                                                             = 0x8005
   6065 	EVENT_OBJECT_HELPCHANGE                                                        = 0x8010
   6066 	EVENT_OBJECT_HIDE                                                              = 0x8003
   6067 	EVENT_OBJECT_LOCATIONCHANGE                                                    = 0x800B
   6068 	EVENT_OBJECT_NAMECHANGE                                                        = 0x800C
   6069 	EVENT_OBJECT_PARENTCHANGE                                                      = 0x800F
   6070 	EVENT_OBJECT_REORDER                                                           = 0x8004
   6071 	EVENT_OBJECT_SELECTION                                                         = 0x8006
   6072 	EVENT_OBJECT_SELECTIONADD                                                      = 0x8007
   6073 	EVENT_OBJECT_SELECTIONREMOVE                                                   = 0x8008
   6074 	EVENT_OBJECT_SELECTIONWITHIN                                                   = 0x8009
   6075 	EVENT_OBJECT_SHOW                                                              = 0x8002
   6076 	EVENT_OBJECT_STATECHANGE                                                       = 0x800A
   6077 	EVENT_OBJECT_VALUECHANGE                                                       = 0x800E
   6078 	EVENT_SYSTEM_ALERT                                                             = 0x0002
   6079 	EVENT_SYSTEM_CAPTUREEND                                                        = 0x0009
   6080 	EVENT_SYSTEM_CAPTURESTART                                                      = 0x0008
   6081 	EVENT_SYSTEM_CONTEXTHELPEND                                                    = 0x000D
   6082 	EVENT_SYSTEM_CONTEXTHELPSTART                                                  = 0x000C
   6083 	EVENT_SYSTEM_DIALOGEND                                                         = 0x0011
   6084 	EVENT_SYSTEM_DIALOGSTART                                                       = 0x0010
   6085 	EVENT_SYSTEM_DRAGDROPEND                                                       = 0x000F
   6086 	EVENT_SYSTEM_DRAGDROPSTART                                                     = 0x000E
   6087 	EVENT_SYSTEM_FOREGROUND                                                        = 0x0003
   6088 	EVENT_SYSTEM_MENUEND                                                           = 0x0005
   6089 	EVENT_SYSTEM_MENUPOPUPEND                                                      = 0x0007
   6090 	EVENT_SYSTEM_MENUPOPUPSTART                                                    = 0x0006
   6091 	EVENT_SYSTEM_MENUSTART                                                         = 0x0004
   6092 	EVENT_SYSTEM_MINIMIZEEND                                                       = 0x0017
   6093 	EVENT_SYSTEM_MINIMIZESTART                                                     = 0x0016
   6094 	EVENT_SYSTEM_MOVESIZEEND                                                       = 0x000B
   6095 	EVENT_SYSTEM_MOVESIZESTART                                                     = 0x000A
   6096 	EVENT_SYSTEM_SCROLLINGEND                                                      = 0x0013
   6097 	EVENT_SYSTEM_SCROLLINGSTART                                                    = 0x0012
   6098 	EVENT_SYSTEM_SOUND                                                             = 0x0001
   6099 	EVENT_SYSTEM_SWITCHEND                                                         = 0x0015
   6100 	EVENT_SYSTEM_SWITCHSTART                                                       = 0x0014
   6101 	EVENT_S_FIRST                                                                  = 262656
   6102 	EVENT_S_LAST                                                                   = 262687
   6103 	EV_BREAK                                                                       = 0x40
   6104 	EV_CTS                                                                         = 0x8
   6105 	EV_DSR                                                                         = 0x10
   6106 	EV_ERR                                                                         = 0x80
   6107 	EV_EVENT1                                                                      = 0x800
   6108 	EV_EVENT2                                                                      = 0x1000
   6109 	EV_PERR                                                                        = 0x200
   6110 	EV_RING                                                                        = 0x100
   6111 	EV_RLSD                                                                        = 0x20
   6112 	EV_RX80FULL                                                                    = 0x400
   6113 	EV_RXCHAR                                                                      = 0x1
   6114 	EV_RXFLAG                                                                      = 0x2
   6115 	EV_TXEMPTY                                                                     = 0x4
   6116 	EWOULDBLOCK                                                                    = 140
   6117 	EWX_ARSO                                                                       = 0x04000000
   6118 	EWX_BOOTOPTIONS                                                                = 0x01000000
   6119 	EWX_CHECK_SAFE_FOR_SERVER                                                      = 0x08000000
   6120 	EWX_FORCE                                                                      = 0x00000004
   6121 	EWX_FORCEIFHUNG                                                                = 0x00000010
   6122 	EWX_HYBRID_SHUTDOWN                                                            = 0x00400000
   6123 	EWX_LOGOFF                                                                     = 0x00000000
   6124 	EWX_POWEROFF                                                                   = 0x00000008
   6125 	EWX_QUICKRESOLVE                                                               = 0x00000020
   6126 	EWX_REBOOT                                                                     = 0x00000002
   6127 	EWX_SHUTDOWN                                                                   = 0x00000001
   6128 	EXCEPTION_COLLIDED_UNWIND                                                      = 0x40
   6129 	EXCEPTION_CONTINUE_EXECUTION                                                   = -1
   6130 	EXCEPTION_CONTINUE_SEARCH                                                      = 0
   6131 	EXCEPTION_DEBUG_EVENT                                                          = 1
   6132 	EXCEPTION_EXECUTE_FAULT                                                        = 8
   6133 	EXCEPTION_EXECUTE_HANDLER                                                      = 1
   6134 	EXCEPTION_EXIT_UNWIND                                                          = 0x4
   6135 	EXCEPTION_MAXIMUM_PARAMETERS                                                   = 15
   6136 	EXCEPTION_NESTED_CALL                                                          = 0x10
   6137 	EXCEPTION_NONCONTINUABLE                                                       = 0x1
   6138 	EXCEPTION_READ_FAULT                                                           = 0
   6139 	EXCEPTION_STACK_INVALID                                                        = 0x8
   6140 	EXCEPTION_TARGET_UNWIND                                                        = 0x20
   6141 	EXCEPTION_UNWIND                                                               = 0x66
   6142 	EXCEPTION_UNWINDING                                                            = 0x2
   6143 	EXCEPTION_WRITE_FAULT                                                          = 1
   6144 	EXCLUDED_TABLE_NUMBER                                                          = 2
   6145 	EXCLUSIVE_LOCK                                                                 = 4
   6146 	EXDEV                                                                          = 18
   6147 	EXECUTE_OFFLINE_DIAGS                                                          = 0xD4
   6148 	EXIT_FAILURE                                                                   = 1
   6149 	EXIT_PROCESS_DEBUG_EVENT                                                       = 5
   6150 	EXIT_SUCCESS                                                                   = 0
   6151 	EXIT_THREAD_DEBUG_EVENT                                                        = 4
   6152 	EXPAND_LOCAL_DRIVES                                                            = 0
   6153 	EXPENTRY                                                                       = 0
   6154 	EXPORT_PRIVATE_KEYS                                                            = 0x4
   6155 	EXPO_OFFLOAD_FUNC_NAME                                                         = "OffloadModExpo"
   6156 	EXPO_OFFLOAD_REG_VALUE                                                         = "ExpoOffload"
   6157 	EXPRDUP_REDUCE                                                                 = 0x0001
   6158 	EXTENDED_STARTUPINFO_PRESENT                                                   = 0x80000
   6159 	EXTEND_IEPORT                                                                  = 2
   6160 	EXTTEXTOUT                                                                     = 512
   6161 	EXT_DEVICE_CAPS                                                                = 4099
   6162 	ExceptionCollidedUnwind                                                        = 3
   6163 	ExceptionContinueExecution                                                     = 0
   6164 	ExceptionContinueSearch                                                        = 1
   6165 	ExceptionExecuteHandler                                                        = 4
   6166 	ExceptionNestedException                                                       = 2
   6167 	FACILITY_AAF                                                                   = 18
   6168 	FACILITY_ACS                                                                   = 20
   6169 	FACILITY_AUDCLNT                                                               = 2185
   6170 	FACILITY_BACKGROUNDCOPY                                                        = 32
   6171 	FACILITY_CERT                                                                  = 11
   6172 	FACILITY_COMPLUS                                                               = 17
   6173 	FACILITY_CONFIGURATION                                                         = 33
   6174 	FACILITY_CONTROL                                                               = 10
   6175 	FACILITY_DIRECTORYSERVICE                                                      = 37
   6176 	FACILITY_DISPATCH                                                              = 2
   6177 	FACILITY_DPLAY                                                                 = 21
   6178 	FACILITY_HTTP                                                                  = 25
   6179 	FACILITY_INTERNET                                                              = 12
   6180 	FACILITY_ITF                                                                   = 4
   6181 	FACILITY_MEDIASERVER                                                           = 13
   6182 	FACILITY_METADIRECTORY                                                         = 35
   6183 	FACILITY_MSMQ                                                                  = 14
   6184 	FACILITY_NT_BIT                                                                = 0x10000000
   6185 	FACILITY_NULL                                                                  = 0
   6186 	FACILITY_RPC                                                                   = 1
   6187 	FACILITY_SCARD                                                                 = 16
   6188 	FACILITY_SECURITY                                                              = 9
   6189 	FACILITY_SETUPAPI                                                              = 15
   6190 	FACILITY_SSPI                                                                  = 9
   6191 	FACILITY_STATE_MANAGEMENT                                                      = 34
   6192 	FACILITY_STORAGE                                                               = 3
   6193 	FACILITY_SXS                                                                   = 23
   6194 	FACILITY_UMI                                                                   = 22
   6195 	FACILITY_URT                                                                   = 19
   6196 	FACILITY_USERMODE_FILTER_MANAGER                                               = 0x1f
   6197 	FACILITY_WIN32                                                                 = 7
   6198 	FACILITY_WINDOWS                                                               = 8
   6199 	FACILITY_WINDOWSUPDATE                                                         = 36
   6200 	FACILITY_WINDOWS_CE                                                            = 24
   6201 	FADF_AUTO                                                                      = 1
   6202 	FADF_BSTR                                                                      = 256
   6203 	FADF_DISPATCH                                                                  = 1024
   6204 	FADF_EMBEDDED                                                                  = 4
   6205 	FADF_FIXEDSIZE                                                                 = 16
   6206 	FADF_HAVEIID                                                                   = 64
   6207 	FADF_HAVEVARTYPE                                                               = 128
   6208 	FADF_RECORD                                                                    = 32
   6209 	FADF_RESERVED                                                                  = 61448
   6210 	FADF_STATIC                                                                    = 2
   6211 	FADF_UNKNOWN                                                                   = 512
   6212 	FADF_VARIANT                                                                   = 2048
   6213 	FAILED_ACCESS_ACE_FLAG                                                         = 128
   6214 	FAIL_FAST_GENERATE_EXCEPTION_ADDRESS                                           = 0x1
   6215 	FAIL_FAST_NO_HARD_ERROR_DLG                                                    = 0x2
   6216 	FALSE                                                                          = 0
   6217 	FALT                                                                           = 0x10
   6218 	FAPPCOMMAND_KEY                                                                = 0
   6219 	FAPPCOMMAND_MASK                                                               = 0xF000
   6220 	FAPPCOMMAND_MOUSE                                                              = 0x8000
   6221 	FAPPCOMMAND_OEM                                                                = 0x1000
   6222 	FAR                                                                            = 0
   6223 	FARSTRUCT                                                                      = 0
   6224 	FASTCALL                                                                       = 0
   6225 	FAST_FAIL_CORRUPT_LIST_ENTRY                                                   = 3
   6226 	FAST_FAIL_FATAL_APP_EXIT                                                       = 7
   6227 	FAST_FAIL_GS_COOKIE_INIT                                                       = 6
   6228 	FAST_FAIL_INCORRECT_STACK                                                      = 4
   6229 	FAST_FAIL_INVALID_ARG                                                          = 5
   6230 	FAST_FAIL_INVALID_FAST_FAIL_CODE                                               = 0xffffffff
   6231 	FAST_FAIL_LEGACY_GS_VIOLATION                                                  = 0
   6232 	FAST_FAIL_RANGE_CHECK_FAILURE                                                  = 8
   6233 	FAST_FAIL_STACK_COOKIE_CHECK_FAILURE                                           = 2
   6234 	FAST_FAIL_UNSAFE_REGISTRY_ACCESS                                               = 9
   6235 	FAST_FAIL_VTGUARD_CHECK_FAILURE                                                = 1
   6236 	FCONTROL                                                                       = 0x08
   6237 	FD_ACCEPT                                                                      = 0x08
   6238 	FD_CLOSE                                                                       = 0x20
   6239 	FD_CONNECT                                                                     = 0x10
   6240 	FD_OOB                                                                         = 0x04
   6241 	FD_READ                                                                        = 0x01
   6242 	FD_SETSIZE                                                                     = 64
   6243 	FD_WRITE                                                                       = 0x02
   6244 	FEATURESETTING_CUSTPAPER                                                       = 3
   6245 	FEATURESETTING_MIRROR                                                          = 4
   6246 	FEATURESETTING_NEGATIVE                                                        = 5
   6247 	FEATURESETTING_NUP                                                             = 0
   6248 	FEATURESETTING_OUTPUT                                                          = 1
   6249 	FEATURESETTING_PRIVATE_BEGIN                                                   = 0x1000
   6250 	FEATURESETTING_PRIVATE_END                                                     = 0x1FFF
   6251 	FEATURESETTING_PROTOCOL                                                        = 6
   6252 	FEATURESETTING_PSLEVEL                                                         = 2
   6253 	FE_FONTSMOOTHINGCLEARTYPE                                                      = 0x0002
   6254 	FE_FONTSMOOTHINGDOCKING                                                        = 0x8000
   6255 	FE_FONTSMOOTHINGORIENTATIONBGR                                                 = 0x0000
   6256 	FE_FONTSMOOTHINGORIENTATIONRGB                                                 = 0x0001
   6257 	FE_FONTSMOOTHINGSTANDARD                                                       = 0x0001
   6258 	FF_DECORATIVE                                                                  = 80
   6259 	FF_DONTCARE                                                                    = 0
   6260 	FF_MODERN                                                                      = 48
   6261 	FF_ROMAN                                                                       = 16
   6262 	FF_SCRIPT                                                                      = 64
   6263 	FF_SWISS                                                                       = 32
   6264 	FIBER_FLAG_FLOAT_SWITCH                                                        = 0x1
   6265 	FIEF_FLAG_FORCE_JITUI                                                          = 0x1
   6266 	FIEF_FLAG_PEEK                                                                 = 0x2
   6267 	FIEF_FLAG_SKIP_INSTALLED_VERSION_CHECK                                         = 0x4
   6268 	FILENAME_MAX                                                                   = 260
   6269 	FILEOKSTRINGA                                                                  = "commdlg_FileNameOK"
   6270 	FILEOPENORD                                                                    = 1536
   6271 	FILESYSTEM_STATISTICS_TYPE_FAT                                                 = 2
   6272 	FILESYSTEM_STATISTICS_TYPE_NTFS                                                = 1
   6273 	FILE_ACTION_ADDED                                                              = 0x00000001
   6274 	FILE_ACTION_MODIFIED                                                           = 0x00000003
   6275 	FILE_ACTION_REMOVED                                                            = 0x00000002
   6276 	FILE_ACTION_RENAMED_NEW_NAME                                                   = 0x00000005
   6277 	FILE_ACTION_RENAMED_OLD_NAME                                                   = 0x00000004
   6278 	FILE_ADD_FILE                                                                  = 2
   6279 	FILE_ADD_SUBDIRECTORY                                                          = 4
   6280 	FILE_ALL_ACCESS                                                                = 2032127
   6281 	FILE_ANY_ACCESS                                                                = 0
   6282 	FILE_APPEND_DATA                                                               = 4
   6283 	FILE_ATTRIBUTE_ARCHIVE                                                         = 0x00000020
   6284 	FILE_ATTRIBUTE_COMPRESSED                                                      = 0x00000800
   6285 	FILE_ATTRIBUTE_DEVICE                                                          = 0x00000040
   6286 	FILE_ATTRIBUTE_DIRECTORY                                                       = 0x00000010
   6287 	FILE_ATTRIBUTE_ENCRYPTED                                                       = 0x00004000
   6288 	FILE_ATTRIBUTE_HIDDEN                                                          = 0x00000002
   6289 	FILE_ATTRIBUTE_MASK                                                            = 262135
   6290 	FILE_ATTRIBUTE_NORMAL                                                          = 0x00000080
   6291 	FILE_ATTRIBUTE_NOT_CONTENT_INDEXED                                             = 0x00002000
   6292 	FILE_ATTRIBUTE_OFFLINE                                                         = 0x00001000
   6293 	FILE_ATTRIBUTE_READONLY                                                        = 0x00000001
   6294 	FILE_ATTRIBUTE_REPARSE_POINT                                                   = 0x00000400
   6295 	FILE_ATTRIBUTE_SPARSE_FILE                                                     = 0x00000200
   6296 	FILE_ATTRIBUTE_SYSTEM                                                          = 0x00000004
   6297 	FILE_ATTRIBUTE_TEMPORARY                                                       = 0x00000100
   6298 	FILE_ATTRIBUTE_VIRTUAL                                                         = 0x00010000
   6299 	FILE_BEGIN                                                                     = 0
   6300 	FILE_CACHE_FLAGS_DEFINED                                                       = 0
   6301 	FILE_CACHE_MAX_HARD_DISABLE                                                    = 0x00000002
   6302 	FILE_CACHE_MAX_HARD_ENABLE                                                     = 0x00000001
   6303 	FILE_CACHE_MIN_HARD_DISABLE                                                    = 0x00000008
   6304 	FILE_CACHE_MIN_HARD_ENABLE                                                     = 0x00000004
   6305 	FILE_CASE_PRESERVED_NAMES                                                      = 0x00000002
   6306 	FILE_CASE_SENSITIVE_SEARCH                                                     = 0x00000001
   6307 	FILE_CLEAR_ENCRYPTION                                                          = 0x00000002
   6308 	FILE_COMPLETE_IF_OPLOCKED                                                      = 0x00000100
   6309 	FILE_CREATE                                                                    = 0x00000002
   6310 	FILE_CREATE_PIPE_INSTANCE                                                      = 4
   6311 	FILE_CREATE_TREE_CONNECTION                                                    = 0x00000080
   6312 	FILE_CURRENT                                                                   = 1
   6313 	FILE_DELETE_CHILD                                                              = 64
   6314 	FILE_DELETE_ON_CLOSE                                                           = 0x00001000
   6315 	FILE_DEVICE_8042_PORT                                                          = 0x00000027
   6316 	FILE_DEVICE_ACPI                                                               = 0x00000032
   6317 	FILE_DEVICE_BATTERY                                                            = 0x00000029
   6318 	FILE_DEVICE_BEEP                                                               = 0x00000001
   6319 	FILE_DEVICE_BIOMETRIC                                                          = 0x00000044
   6320 	FILE_DEVICE_BLUETOOTH                                                          = 0x00000041
   6321 	FILE_DEVICE_BUS_EXTENDER                                                       = 0x0000002a
   6322 	FILE_DEVICE_CD_ROM                                                             = 0x00000002
   6323 	FILE_DEVICE_CD_ROM_FILE_SYSTEM                                                 = 0x00000003
   6324 	FILE_DEVICE_CHANGER                                                            = 0x00000030
   6325 	FILE_DEVICE_CONSOLE                                                            = 0x00000050
   6326 	FILE_DEVICE_CONTROLLER                                                         = 0x00000004
   6327 	FILE_DEVICE_CRYPT_PROVIDER                                                     = 0x0000003F
   6328 	FILE_DEVICE_DATALINK                                                           = 0x00000005
   6329 	FILE_DEVICE_DEVAPI                                                             = 0x00000047
   6330 	FILE_DEVICE_DFS                                                                = 0x00000006
   6331 	FILE_DEVICE_DFS_FILE_SYSTEM                                                    = 0x00000035
   6332 	FILE_DEVICE_DFS_VOLUME                                                         = 0x00000036
   6333 	FILE_DEVICE_DISK                                                               = 0x00000007
   6334 	FILE_DEVICE_DISK_FILE_SYSTEM                                                   = 0x00000008
   6335 	FILE_DEVICE_DVD                                                                = 0x00000033
   6336 	FILE_DEVICE_EHSTOR                                                             = 0x00000046
   6337 	FILE_DEVICE_FILE_SYSTEM                                                        = 0x00000009
   6338 	FILE_DEVICE_FIPS                                                               = 0x0000003A
   6339 	FILE_DEVICE_FULLSCREEN_VIDEO                                                   = 0x00000034
   6340 	FILE_DEVICE_GPIO                                                               = 0x00000048
   6341 	FILE_DEVICE_HOLOGRAPHIC                                                        = 0x0000005b
   6342 	FILE_DEVICE_INFINIBAND                                                         = 0x0000003B
   6343 	FILE_DEVICE_INPORT_PORT                                                        = 0x0000000a
   6344 	FILE_DEVICE_KEYBOARD                                                           = 0x0000000b
   6345 	FILE_DEVICE_KS                                                                 = 0x0000002f
   6346 	FILE_DEVICE_KSEC                                                               = 0x00000039
   6347 	FILE_DEVICE_MAILSLOT                                                           = 0x0000000c
   6348 	FILE_DEVICE_MASS_STORAGE                                                       = 0x0000002d
   6349 	FILE_DEVICE_MIDI_IN                                                            = 0x0000000d
   6350 	FILE_DEVICE_MIDI_OUT                                                           = 0x0000000e
   6351 	FILE_DEVICE_MODEM                                                              = 0x0000002b
   6352 	FILE_DEVICE_MOUSE                                                              = 0x0000000f
   6353 	FILE_DEVICE_MT_COMPOSITE                                                       = 0x00000042
   6354 	FILE_DEVICE_MT_TRANSPORT                                                       = 0x00000043
   6355 	FILE_DEVICE_MULTI_UNC_PROVIDER                                                 = 0x00000010
   6356 	FILE_DEVICE_NAMED_PIPE                                                         = 0x00000011
   6357 	FILE_DEVICE_NETWORK                                                            = 0x00000012
   6358 	FILE_DEVICE_NETWORK_BROWSER                                                    = 0x00000013
   6359 	FILE_DEVICE_NETWORK_FILE_SYSTEM                                                = 0x00000014
   6360 	FILE_DEVICE_NETWORK_REDIRECTOR                                                 = 0x00000028
   6361 	FILE_DEVICE_NFP                                                                = 0x00000051
   6362 	FILE_DEVICE_NULL                                                               = 0x00000015
   6363 	FILE_DEVICE_NVDIMM                                                             = 0x0000005a
   6364 	FILE_DEVICE_PARALLEL_PORT                                                      = 0x00000016
   6365 	FILE_DEVICE_PERSISTENT_MEMORY                                                  = 0x00000059
   6366 	FILE_DEVICE_PHYSICAL_NETCARD                                                   = 0x00000017
   6367 	FILE_DEVICE_PMI                                                                = 0x00000045
   6368 	FILE_DEVICE_POINT_OF_SERVICE                                                   = 0x00000054
   6369 	FILE_DEVICE_PRINTER                                                            = 0x00000018
   6370 	FILE_DEVICE_SCANNER                                                            = 0x00000019
   6371 	FILE_DEVICE_SCREEN                                                             = 0x0000001c
   6372 	FILE_DEVICE_SDFXHCI                                                            = 0x0000005c
   6373 	FILE_DEVICE_SERENUM                                                            = 0x00000037
   6374 	FILE_DEVICE_SERIAL_MOUSE_PORT                                                  = 0x0000001a
   6375 	FILE_DEVICE_SERIAL_PORT                                                        = 0x0000001b
   6376 	FILE_DEVICE_SMARTCARD                                                          = 0x00000031
   6377 	FILE_DEVICE_SMB                                                                = 0x0000002e
   6378 	FILE_DEVICE_SOUND                                                              = 0x0000001d
   6379 	FILE_DEVICE_STORAGE_REPLICATION                                                = 0x00000055
   6380 	FILE_DEVICE_STREAMS                                                            = 0x0000001e
   6381 	FILE_DEVICE_SYSENV                                                             = 0x00000052
   6382 	FILE_DEVICE_TAPE                                                               = 0x0000001f
   6383 	FILE_DEVICE_TAPE_FILE_SYSTEM                                                   = 0x00000020
   6384 	FILE_DEVICE_TERMSRV                                                            = 0x00000038
   6385 	FILE_DEVICE_TRANSPORT                                                          = 0x00000021
   6386 	FILE_DEVICE_TRUST_ENV                                                          = 0x00000056
   6387 	FILE_DEVICE_UCM                                                                = 0x00000057
   6388 	FILE_DEVICE_UCMTCPCI                                                           = 0x00000058
   6389 	FILE_DEVICE_UCMUCSI                                                            = 0x0000005d
   6390 	FILE_DEVICE_UNKNOWN                                                            = 0x00000022
   6391 	FILE_DEVICE_USBEX                                                              = 0x00000049
   6392 	FILE_DEVICE_VDM                                                                = 0x0000002c
   6393 	FILE_DEVICE_VIDEO                                                              = 0x00000023
   6394 	FILE_DEVICE_VIRTUAL_BLOCK                                                      = 0x00000053
   6395 	FILE_DEVICE_VIRTUAL_DISK                                                       = 0x00000024
   6396 	FILE_DEVICE_VMBUS                                                              = 0x0000003E
   6397 	FILE_DEVICE_WAVE_IN                                                            = 0x00000025
   6398 	FILE_DEVICE_WAVE_OUT                                                           = 0x00000026
   6399 	FILE_DEVICE_WPD                                                                = 0x00000040
   6400 	FILE_DIRECTORY_FILE                                                            = 0x00000001
   6401 	FILE_DIR_DISALLOWED                                                            = 9
   6402 	FILE_ENCRYPTABLE                                                               = 0
   6403 	FILE_END                                                                       = 2
   6404 	FILE_EXECUTE                                                                   = 32
   6405 	FILE_FILE_COMPRESSION                                                          = 0x00000010
   6406 	FILE_FLAG_BACKUP_SEMANTICS                                                     = 0x2000000
   6407 	FILE_FLAG_DELETE_ON_CLOSE                                                      = 0x4000000
   6408 	FILE_FLAG_FIRST_PIPE_INSTANCE                                                  = 0x80000
   6409 	FILE_FLAG_MASK                                                                 = 4282122240
   6410 	FILE_FLAG_NO_BUFFERING                                                         = 0x20000000
   6411 	FILE_FLAG_OPEN_NO_RECALL                                                       = 0x100000
   6412 	FILE_FLAG_OPEN_REPARSE_POINT                                                   = 0x200000
   6413 	FILE_FLAG_OVERLAPPED                                                           = 0x40000000
   6414 	FILE_FLAG_POSIX_SEMANTICS                                                      = 0x1000000
   6415 	FILE_FLAG_RANDOM_ACCESS                                                        = 0x10000000
   6416 	FILE_FLAG_SEQUENTIAL_SCAN                                                      = 0x8000000
   6417 	FILE_FLAG_SESSION_AWARE                                                        = 0x800000
   6418 	FILE_FLAG_WRITE_THROUGH                                                        = 0x80000000
   6419 	FILE_GENERIC_EXECUTE                                                           = 1179808
   6420 	FILE_GENERIC_READ                                                              = 1179785
   6421 	FILE_GENERIC_WRITE                                                             = 1179926
   6422 	FILE_IS_ENCRYPTED                                                              = 1
   6423 	FILE_LIST_DIRECTORY                                                            = 1
   6424 	FILE_MAP_ALL_ACCESS                                                            = 983071
   6425 	FILE_MAP_COPY                                                                  = 0x1
   6426 	FILE_MAP_EXECUTE                                                               = 32
   6427 	FILE_MAP_LARGE_PAGES                                                           = 0x20000000
   6428 	FILE_MAP_READ                                                                  = 4
   6429 	FILE_MAP_RESERVE                                                               = 0x80000000
   6430 	FILE_MAP_TARGETS_INVALID                                                       = 0x40000000
   6431 	FILE_MAP_WRITE                                                                 = 2
   6432 	FILE_MAXIMUM_DISPOSITION                                                       = 0x00000005
   6433 	FILE_NAMED_STREAMS                                                             = 0x00040000
   6434 	FILE_NAME_NORMALIZED                                                           = 0x0
   6435 	FILE_NAME_OPENED                                                               = 0x8
   6436 	FILE_NON_DIRECTORY_FILE                                                        = 0x00000040
   6437 	FILE_NOTIFY_CHANGE_ATTRIBUTES                                                  = 0x00000004
   6438 	FILE_NOTIFY_CHANGE_CREATION                                                    = 0x00000040
   6439 	FILE_NOTIFY_CHANGE_DIR_NAME                                                    = 0x00000002
   6440 	FILE_NOTIFY_CHANGE_FILE_NAME                                                   = 0x00000001
   6441 	FILE_NOTIFY_CHANGE_LAST_ACCESS                                                 = 0x00000020
   6442 	FILE_NOTIFY_CHANGE_LAST_WRITE                                                  = 0x00000010
   6443 	FILE_NOTIFY_CHANGE_SECURITY                                                    = 0x00000100
   6444 	FILE_NOTIFY_CHANGE_SIZE                                                        = 0x00000008
   6445 	FILE_NO_COMPRESSION                                                            = 0x00008000
   6446 	FILE_NO_EA_KNOWLEDGE                                                           = 0x00000200
   6447 	FILE_NO_INTERMEDIATE_BUFFERING                                                 = 0x00000008
   6448 	FILE_OPEN                                                                      = 0x00000001
   6449 	FILE_OPEN_BY_FILE_ID                                                           = 0x00002000
   6450 	FILE_OPEN_FOR_BACKUP_INTENT                                                    = 0x00004000
   6451 	FILE_OPEN_FOR_FREE_SPACE_QUERY                                                 = 0x00800000
   6452 	FILE_OPEN_IF                                                                   = 0x00000003
   6453 	FILE_OPEN_NO_RECALL                                                            = 0x00400000
   6454 	FILE_OPEN_REMOTE_INSTANCE                                                      = 0x00000400
   6455 	FILE_OPEN_REPARSE_POINT                                                        = 0x00200000
   6456 	FILE_OVERWRITE                                                                 = 0x00000004
   6457 	FILE_OVERWRITE_IF                                                              = 0x00000005
   6458 	FILE_PERSISTENT_ACLS                                                           = 0x00000008
   6459 	FILE_PREFETCH_TYPE_FOR_CREATE                                                  = 0x1
   6460 	FILE_RANDOM_ACCESS                                                             = 0x00000800
   6461 	FILE_READ_ACCESS                                                               = 1
   6462 	FILE_READ_ATTRIBUTES                                                           = 128
   6463 	FILE_READ_DATA                                                                 = 1
   6464 	FILE_READ_EA                                                                   = 8
   6465 	FILE_READ_ONLY                                                                 = 8
   6466 	FILE_READ_ONLY_VOLUME                                                          = 0x00080000
   6467 	FILE_RESERVE_OPFILTER                                                          = 0x00100000
   6468 	FILE_ROOT_DIR                                                                  = 3
   6469 	FILE_SEQUENTIAL_ONLY                                                           = 0x00000004
   6470 	FILE_SEQUENTIAL_WRITE_ONCE                                                     = 0x00100000
   6471 	FILE_SET_ENCRYPTION                                                            = 0x00000001
   6472 	FILE_SHARE_DELETE                                                              = 0x00000004
   6473 	FILE_SHARE_READ                                                                = 0x00000001
   6474 	FILE_SHARE_VALID_FLAGS                                                         = 0x00000007
   6475 	FILE_SHARE_WRITE                                                               = 0x00000002
   6476 	FILE_SPECIAL_ACCESS                                                            = 0
   6477 	FILE_SUPERSEDE                                                                 = 0x00000000
   6478 	FILE_SUPPORTS_ENCRYPTION                                                       = 0x00020000
   6479 	FILE_SUPPORTS_EXTENDED_ATTRIBUTES                                              = 0x00800000
   6480 	FILE_SUPPORTS_HARD_LINKS                                                       = 0x00400000
   6481 	FILE_SUPPORTS_INTEGRITY_STREAMS                                                = 0x04000000
   6482 	FILE_SUPPORTS_OBJECT_IDS                                                       = 0x00010000
   6483 	FILE_SUPPORTS_OPEN_BY_FILE_ID                                                  = 0x01000000
   6484 	FILE_SUPPORTS_REMOTE_STORAGE                                                   = 0x00000100
   6485 	FILE_SUPPORTS_REPARSE_POINTS                                                   = 0x00000080
   6486 	FILE_SUPPORTS_SPARSE_FILES                                                     = 0x00000040
   6487 	FILE_SUPPORTS_TRANSACTIONS                                                     = 0x00200000
   6488 	FILE_SUPPORTS_USN_JOURNAL                                                      = 0x02000000
   6489 	FILE_SYNCHRONOUS_IO_ALERT                                                      = 0x00000010
   6490 	FILE_SYNCHRONOUS_IO_NONALERT                                                   = 0x00000020
   6491 	FILE_SYSTEM_ATTR                                                               = 2
   6492 	FILE_SYSTEM_DIR                                                                = 4
   6493 	FILE_SYSTEM_NOT_SUPPORT                                                        = 6
   6494 	FILE_TRAVERSE                                                                  = 32
   6495 	FILE_TYPE_CHAR                                                                 = 0x2
   6496 	FILE_TYPE_DISK                                                                 = 0x1
   6497 	FILE_TYPE_PIPE                                                                 = 0x3
   6498 	FILE_TYPE_REMOTE                                                               = 0x8000
   6499 	FILE_TYPE_UNKNOWN                                                              = 0x0
   6500 	FILE_UNICODE_ON_DISK                                                           = 0x00000004
   6501 	FILE_UNKNOWN                                                                   = 5
   6502 	FILE_USER_DISALLOWED                                                           = 7
   6503 	FILE_VER_GET_LOCALISED                                                         = 0x01
   6504 	FILE_VER_GET_NEUTRAL                                                           = 0x02
   6505 	FILE_VER_GET_PREFETCHED                                                        = 0x04
   6506 	FILE_VOLUME_IS_COMPRESSED                                                      = 0x00008000
   6507 	FILE_VOLUME_QUOTAS                                                             = 0x00000020
   6508 	FILE_WRITE_ACCESS                                                              = 2
   6509 	FILE_WRITE_ATTRIBUTES                                                          = 256
   6510 	FILE_WRITE_DATA                                                                = 2
   6511 	FILE_WRITE_EA                                                                  = 16
   6512 	FILE_WRITE_THROUGH                                                             = 0x00000002
   6513 	FINDDLGORD                                                                     = 1540
   6514 	FINDMSGSTRINGA                                                                 = "commdlg_FindReplace"
   6515 	FIND_ACTCTX_SECTION_KEY_RETURN_ASSEMBLY_METADATA                               = 4
   6516 	FIND_ACTCTX_SECTION_KEY_RETURN_FLAGS                                           = 2
   6517 	FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX                                         = 1
   6518 	FIND_ENDSWITH                                                                  = 0x00200000
   6519 	FIND_FIRST_EX_CASE_SENSITIVE                                                   = 0x00000001
   6520 	FIND_FIRST_EX_LARGE_FETCH                                                      = 0x00000002
   6521 	FIND_FROMEND                                                                   = 0x00800000
   6522 	FIND_FROMSTART                                                                 = 0x00400000
   6523 	FIND_RESOURCE_DIRECTORY_LANGUAGES                                              = 1024
   6524 	FIND_RESOURCE_DIRECTORY_NAMES                                                  = 512
   6525 	FIND_RESOURCE_DIRECTORY_TYPES                                                  = 256
   6526 	FIND_STARTSWITH                                                                = 0x00100000
   6527 	FIRMWARE_PTR                                                                   = 0
   6528 	FIXED_PITCH                                                                    = 1
   6529 	FKF_AVAILABLE                                                                  = 0x00000002
   6530 	FKF_CLICKON                                                                    = 0x00000040
   6531 	FKF_CONFIRMHOTKEY                                                              = 0x00000008
   6532 	FKF_FILTERKEYSON                                                               = 0x00000001
   6533 	FKF_HOTKEYACTIVE                                                               = 0x00000004
   6534 	FKF_HOTKEYSOUND                                                                = 0x00000010
   6535 	FKF_INDICATOR                                                                  = 0x00000020
   6536 	FLAG_SIGNED                                                                    = 1
   6537 	FLAG_STRING                                                                    = 4
   6538 	FLASHW_ALL                                                                     = 3
   6539 	FLASHW_CAPTION                                                                 = 0x00000001
   6540 	FLASHW_STOP                                                                    = 0
   6541 	FLASHW_TIMER                                                                   = 0x00000004
   6542 	FLASHW_TIMERNOFG                                                               = 0x0000000c
   6543 	FLASHW_TRAY                                                                    = 0x00000002
   6544 	FLI_GLYPHS                                                                     = 262144
   6545 	FLI_MASK                                                                       = 0x103B
   6546 	FLOODFILLBORDER                                                                = 0
   6547 	FLOODFILLSURFACE                                                               = 1
   6548 	FLS_MAXIMUM_AVAILABLE                                                          = 128
   6549 	FLUSHOUTPUT                                                                    = 6
   6550 	FMFD_DEFAULT                                                                   = 0x0
   6551 	FMFD_RESPECTTEXTPLAIN                                                          = 0x10
   6552 	FMFD_RETURNUPDATEDIMGMIMES                                                     = 0x20
   6553 	FMFD_SERVERMIME                                                                = 0x8
   6554 	FMFD_URLASFILENAME                                                             = 0x1
   6555 	FNERR_BUFFERTOOSMALL                                                           = 0x3003
   6556 	FNERR_FILENAMECODES                                                            = 0x3000
   6557 	FNERR_INVALIDFILENAME                                                          = 0x3002
   6558 	FNERR_SUBCLASSFAILURE                                                          = 0x3001
   6559 	FNOINVERT                                                                      = 0x02
   6560 	FOCUS_EVENT                                                                    = 0x10
   6561 	FOF_ALLOWUNDO                                                                  = 0x40
   6562 	FOF_CONFIRMMOUSE                                                               = 0x2
   6563 	FOF_FILESONLY                                                                  = 0x80
   6564 	FOF_MULTIDESTFILES                                                             = 0x1
   6565 	FOF_NOCONFIRMATION                                                             = 0x10
   6566 	FOF_NOCONFIRMMKDIR                                                             = 0x200
   6567 	FOF_NOCOPYSECURITYATTRIBS                                                      = 0x800
   6568 	FOF_NOERRORUI                                                                  = 0x400
   6569 	FOF_NORECURSEREPARSE                                                           = 0x8000
   6570 	FOF_NORECURSION                                                                = 0x1000
   6571 	FOF_NO_CONNECTED_ELEMENTS                                                      = 0x2000
   6572 	FOF_NO_UI                                                                      = 1556
   6573 	FOF_RENAMEONCOLLISION                                                          = 0x8
   6574 	FOF_SILENT                                                                     = 0x4
   6575 	FOF_SIMPLEPROGRESS                                                             = 0x100
   6576 	FOF_WANTMAPPINGHANDLE                                                          = 0x20
   6577 	FOF_WANTNUKEWARNING                                                            = 0x4000
   6578 	FONTDLGORD                                                                     = 1542
   6579 	FONTMAPPER_MAX                                                                 = 10
   6580 	FOPEN_MAX                                                                      = 20
   6581 	FOREGROUND_BLUE                                                                = 0x1
   6582 	FOREGROUND_GREEN                                                               = 0x2
   6583 	FOREGROUND_INTENSITY                                                           = 0x8
   6584 	FOREGROUND_RED                                                                 = 0x4
   6585 	FOREST_USER_RID_MAX                                                            = 499
   6586 	FORMATDLGORD30                                                                 = 1544
   6587 	FORMATDLGORD31                                                                 = 1543
   6588 	FORMAT_MESSAGE_ALLOCATE_BUFFER                                                 = 0x00000100
   6589 	FORMAT_MESSAGE_ARGUMENT_ARRAY                                                  = 0x00002000
   6590 	FORMAT_MESSAGE_FROM_HMODULE                                                    = 0x00000800
   6591 	FORMAT_MESSAGE_FROM_STRING                                                     = 0x00000400
   6592 	FORMAT_MESSAGE_FROM_SYSTEM                                                     = 0x00001000
   6593 	FORMAT_MESSAGE_IGNORE_INSERTS                                                  = 0x00000200
   6594 	FORMAT_MESSAGE_MAX_WIDTH_MASK                                                  = 0x000000ff
   6595 	FORM_BUILTIN                                                                   = 0x00000001
   6596 	FORM_PRINTER                                                                   = 0x00000002
   6597 	FORM_USER                                                                      = 0x00000000
   6598 	FO_COPY                                                                        = 0x2
   6599 	FO_DELETE                                                                      = 0x3
   6600 	FO_MOVE                                                                        = 0x1
   6601 	FO_RENAME                                                                      = 0x4
   6602 	FP_INFINITE                                                                    = 1280
   6603 	FP_NAN                                                                         = 0x0100
   6604 	FP_NDENORM                                                                     = 16
   6605 	FP_NINF                                                                        = 4
   6606 	FP_NNORM                                                                       = 8
   6607 	FP_NORMAL                                                                      = 0x0400
   6608 	FP_NZERO                                                                       = 32
   6609 	FP_PDENORM                                                                     = 128
   6610 	FP_PINF                                                                        = 512
   6611 	FP_PNORM                                                                       = 256
   6612 	FP_PZERO                                                                       = 64
   6613 	FP_QNAN                                                                        = 2
   6614 	FP_SNAN                                                                        = 1
   6615 	FP_SUBNORMAL                                                                   = 17408
   6616 	FP_ZERO                                                                        = 0x4000
   6617 	FRAME_FPO                                                                      = 0
   6618 	FRAME_NONFPO                                                                   = 3
   6619 	FRAME_TRAP                                                                     = 1
   6620 	FRAME_TSS                                                                      = 2
   6621 	FRERR_BUFFERLENGTHZERO                                                         = 0x4001
   6622 	FRERR_FINDREPLACECODES                                                         = 0x4000
   6623 	FROM_LEFT_1ST_BUTTON_PRESSED                                                   = 0x1
   6624 	FROM_LEFT_2ND_BUTTON_PRESSED                                                   = 0x4
   6625 	FROM_LEFT_3RD_BUTTON_PRESSED                                                   = 0x8
   6626 	FROM_LEFT_4TH_BUTTON_PRESSED                                                   = 0x10
   6627 	FRS_ERR_AUTHENTICATION                                                         = 8008
   6628 	FRS_ERR_CHILD_TO_PARENT_COMM                                                   = 8011
   6629 	FRS_ERR_INSUFFICIENT_PRIV                                                      = 8007
   6630 	FRS_ERR_INTERNAL                                                               = 8005
   6631 	FRS_ERR_INTERNAL_API                                                           = 8004
   6632 	FRS_ERR_INVALID_API_SEQUENCE                                                   = 8001
   6633 	FRS_ERR_INVALID_SERVICE_PARAMETER                                              = 8017
   6634 	FRS_ERR_PARENT_AUTHENTICATION                                                  = 8010
   6635 	FRS_ERR_PARENT_INSUFFICIENT_PRIV                                               = 8009
   6636 	FRS_ERR_PARENT_TO_CHILD_COMM                                                   = 8012
   6637 	FRS_ERR_SERVICE_COMM                                                           = 8006
   6638 	FRS_ERR_STARTING_SERVICE                                                       = 8002
   6639 	FRS_ERR_STOPPING_SERVICE                                                       = 8003
   6640 	FRS_ERR_SYSVOL_DEMOTE                                                          = 8016
   6641 	FRS_ERR_SYSVOL_IS_BUSY                                                         = 8015
   6642 	FRS_ERR_SYSVOL_POPULATE                                                        = 8013
   6643 	FRS_ERR_SYSVOL_POPULATE_TIMEOUT                                                = 8014
   6644 	FR_DIALOGTERM                                                                  = 0x40
   6645 	FR_DOWN                                                                        = 0x1
   6646 	FR_ENABLEHOOK                                                                  = 0x100
   6647 	FR_ENABLETEMPLATE                                                              = 0x200
   6648 	FR_ENABLETEMPLATEHANDLE                                                        = 0x2000
   6649 	FR_FINDNEXT                                                                    = 0x8
   6650 	FR_HIDEMATCHCASE                                                               = 0x8000
   6651 	FR_HIDEUPDOWN                                                                  = 0x4000
   6652 	FR_HIDEWHOLEWORD                                                               = 0x10000
   6653 	FR_MATCHALEFHAMZA                                                              = 0x80000000
   6654 	FR_MATCHCASE                                                                   = 0x4
   6655 	FR_MATCHDIAC                                                                   = 0x20000000
   6656 	FR_MATCHKASHIDA                                                                = 0x40000000
   6657 	FR_NOMATCHCASE                                                                 = 0x800
   6658 	FR_NOT_ENUM                                                                    = 0x20
   6659 	FR_NOUPDOWN                                                                    = 0x400
   6660 	FR_NOWHOLEWORD                                                                 = 0x1000
   6661 	FR_PRIVATE                                                                     = 0x10
   6662 	FR_RAW                                                                         = 0x20000
   6663 	FR_REPLACE                                                                     = 0x10
   6664 	FR_REPLACEALL                                                                  = 0x20
   6665 	FR_SHOWHELP                                                                    = 0x80
   6666 	FR_WHOLEWORD                                                                   = 0x2
   6667 	FSCTL_ALLOW_EXTENDED_DASD_IO                                                   = 589955
   6668 	FSCTL_CREATE_OR_GET_OBJECT_ID                                                  = 590016
   6669 	FSCTL_CREATE_USN_JOURNAL                                                       = 590055
   6670 	FSCTL_DELETE_OBJECT_ID                                                         = 589984
   6671 	FSCTL_DELETE_REPARSE_POINT                                                     = 589996
   6672 	FSCTL_DELETE_USN_JOURNAL                                                       = 590072
   6673 	FSCTL_DISMOUNT_VOLUME                                                          = 589856
   6674 	FSCTL_ENCRYPTION_FSCTL_IO                                                      = 590043
   6675 	FSCTL_ENUM_USN_DATA                                                            = 590003
   6676 	FSCTL_EXTEND_VOLUME                                                            = 590064
   6677 	FSCTL_FILESYSTEM_GET_STATISTICS                                                = 589920
   6678 	FSCTL_FILE_PREFETCH                                                            = 590112
   6679 	FSCTL_FIND_FILES_BY_SID                                                        = 589967
   6680 	FSCTL_GET_COMPRESSION                                                          = 589884
   6681 	FSCTL_GET_NTFS_FILE_RECORD                                                     = 589928
   6682 	FSCTL_GET_NTFS_VOLUME_DATA                                                     = 589924
   6683 	FSCTL_GET_OBJECT_ID                                                            = 589980
   6684 	FSCTL_GET_REPARSE_POINT                                                        = 589992
   6685 	FSCTL_GET_RETRIEVAL_POINTERS                                                   = 589939
   6686 	FSCTL_GET_VOLUME_BITMAP                                                        = 589935
   6687 	FSCTL_HSM_DATA                                                                 = 639251
   6688 	FSCTL_HSM_MSG                                                                  = 639240
   6689 	FSCTL_INVALIDATE_VOLUMES                                                       = 589908
   6690 	FSCTL_IS_PATHNAME_VALID                                                        = 589868
   6691 	FSCTL_IS_VOLUME_DIRTY                                                          = 589944
   6692 	FSCTL_IS_VOLUME_MOUNTED                                                        = 589864
   6693 	FSCTL_LOCK_VOLUME                                                              = 589848
   6694 	FSCTL_MARK_AS_SYSTEM_HIVE                                                      = 589903
   6695 	FSCTL_MARK_HANDLE                                                              = 590076
   6696 	FSCTL_MARK_VOLUME_DIRTY                                                        = 589872
   6697 	FSCTL_MOVE_FILE                                                                = 589940
   6698 	FSCTL_OPBATCH_ACK_CLOSE_PENDING                                                = 589840
   6699 	FSCTL_OPLOCK_BREAK_ACKNOWLEDGE                                                 = 589836
   6700 	FSCTL_OPLOCK_BREAK_ACK_NO_2                                                    = 589904
   6701 	FSCTL_OPLOCK_BREAK_NOTIFY                                                      = 589844
   6702 	FSCTL_QUERY_ALLOCATED_RANGES                                                   = 606415
   6703 	FSCTL_QUERY_FAT_BPB                                                            = 589912
   6704 	FSCTL_QUERY_RETRIEVAL_POINTERS                                                 = 589883
   6705 	FSCTL_QUERY_USN_JOURNAL                                                        = 590068
   6706 	FSCTL_READ_FILE_USN_DATA                                                       = 590059
   6707 	FSCTL_READ_FROM_PLEX                                                           = 606494
   6708 	FSCTL_READ_RAW_ENCRYPTED                                                       = 590051
   6709 	FSCTL_READ_USN_JOURNAL                                                         = 590011
   6710 	FSCTL_RECALL_FILE                                                              = 590103
   6711 	FSCTL_REQUEST_BATCH_OPLOCK                                                     = 589832
   6712 	FSCTL_REQUEST_FILTER_OPLOCK                                                    = 589916
   6713 	FSCTL_REQUEST_OPLOCK_LEVEL_1                                                   = 589824
   6714 	FSCTL_REQUEST_OPLOCK_LEVEL_2                                                   = 589828
   6715 	FSCTL_SECURITY_ID_CHECK                                                        = 606391
   6716 	FSCTL_SET_COMPRESSION                                                          = 639040
   6717 	FSCTL_SET_ENCRYPTION                                                           = 590039
   6718 	FSCTL_SET_OBJECT_ID                                                            = 589976
   6719 	FSCTL_SET_OBJECT_ID_EXTENDED                                                   = 590012
   6720 	FSCTL_SET_REPARSE_POINT                                                        = 589988
   6721 	FSCTL_SET_SPARSE                                                               = 590020
   6722 	FSCTL_SET_ZERO_DATA                                                            = 622792
   6723 	FSCTL_SIS_COPYFILE                                                             = 590080
   6724 	FSCTL_SIS_LINK_FILES                                                           = 639236
   6725 	FSCTL_UNLOCK_VOLUME                                                            = 589852
   6726 	FSCTL_WRITE_RAW_ENCRYPTED                                                      = 590047
   6727 	FSCTL_WRITE_USN_CLOSE_RECORD                                                   = 590063
   6728 	FSHIFT                                                                         = 0x04
   6729 	FS_ARABIC                                                                      = 64
   6730 	FS_BALTIC                                                                      = 128
   6731 	FS_CASE_IS_PRESERVED                                                           = 2
   6732 	FS_CASE_SENSITIVE                                                              = 1
   6733 	FS_CHINESESIMP                                                                 = 262144
   6734 	FS_CHINESETRAD                                                                 = 1048576
   6735 	FS_CYRILLIC                                                                    = 4
   6736 	FS_FILE_COMPRESSION                                                            = 16
   6737 	FS_FILE_ENCRYPTION                                                             = 131072
   6738 	FS_GREEK                                                                       = 8
   6739 	FS_HEBREW                                                                      = 32
   6740 	FS_JISJAPAN                                                                    = 131072
   6741 	FS_JOHAB                                                                       = 2097152
   6742 	FS_LATIN1                                                                      = 1
   6743 	FS_LATIN2                                                                      = 2
   6744 	FS_PERSISTENT_ACLS                                                             = 8
   6745 	FS_SYMBOL                                                                      = 2147483648
   6746 	FS_THAI                                                                        = 65536
   6747 	FS_TURKISH                                                                     = 16
   6748 	FS_UNICODE_STORED_ON_DISK                                                      = 4
   6749 	FS_VIETNAMESE                                                                  = 256
   6750 	FS_VOL_IS_COMPRESSED                                                           = 32768
   6751 	FS_WANSUNG                                                                     = 524288
   6752 	FTS5CSR_EOF                                                                    = 0x01
   6753 	FTS5CSR_FREE_ZRANK                                                             = 0x10
   6754 	FTS5CSR_REQUIRE_CONTENT                                                        = 0x02
   6755 	FTS5CSR_REQUIRE_DOCSIZE                                                        = 0x04
   6756 	FTS5CSR_REQUIRE_INST                                                           = 0x08
   6757 	FTS5CSR_REQUIRE_POSLIST                                                        = 0x40
   6758 	FTS5CSR_REQUIRE_RESEEK                                                         = 0x20
   6759 	FTS5INDEX_QUERY_DESC                                                           = 0x0002
   6760 	FTS5INDEX_QUERY_NOOUTPUT                                                       = 0x0020
   6761 	FTS5INDEX_QUERY_PREFIX                                                         = 0x0001
   6762 	FTS5INDEX_QUERY_SCAN                                                           = 0x0008
   6763 	FTS5INDEX_QUERY_SKIPEMPTY                                                      = 0x0010
   6764 	FTS5INDEX_QUERY_TEST_NOIDX                                                     = 0x0004
   6765 	FTS5_AND                                                                       = 2
   6766 	FTS5_AVERAGES_ROWID                                                            = 1
   6767 	FTS5_BI_MATCH                                                                  = 0x0001
   6768 	FTS5_BI_ORDER_DESC                                                             = 0x0080
   6769 	FTS5_BI_ORDER_RANK                                                             = 0x0020
   6770 	FTS5_BI_ORDER_ROWID                                                            = 0x0040
   6771 	FTS5_BI_RANK                                                                   = 0x0002
   6772 	FTS5_BI_ROWID_EQ                                                               = 0x0004
   6773 	FTS5_BI_ROWID_GE                                                               = 0x0010
   6774 	FTS5_BI_ROWID_LE                                                               = 0x0008
   6775 	FTS5_CARET                                                                     = 12
   6776 	FTS5_COLON                                                                     = 5
   6777 	FTS5_COMMA                                                                     = 13
   6778 	FTS5_CONTENT_EXTERNAL                                                          = 2
   6779 	FTS5_CONTENT_NONE                                                              = 1
   6780 	FTS5_CONTENT_NORMAL                                                            = 0
   6781 	FTS5_CORRUPT                                                                   = 267
   6782 	FTS5_CURRENT_VERSION                                                           = 4
   6783 	FTS5_DATA_DLI_B                                                                = 1
   6784 	FTS5_DATA_HEIGHT_B                                                             = 5
   6785 	FTS5_DATA_ID_B                                                                 = 16
   6786 	FTS5_DATA_PADDING                                                              = 20
   6787 	FTS5_DATA_PAGE_B                                                               = 31
   6788 	FTS5_DATA_ZERO_PADDING                                                         = 8
   6789 	FTS5_DEFAULT_AUTOMERGE                                                         = 4
   6790 	FTS5_DEFAULT_CRISISMERGE                                                       = 16
   6791 	FTS5_DEFAULT_HASHSIZE                                                          = 1048576
   6792 	FTS5_DEFAULT_NEARDIST                                                          = 10
   6793 	FTS5_DEFAULT_PAGE_SIZE                                                         = 4050
   6794 	FTS5_DEFAULT_RANK                                                              = "bm25"
   6795 	FTS5_DEFAULT_USERMERGE                                                         = 4
   6796 	FTS5_DETAIL_COLUMNS                                                            = 2
   6797 	FTS5_DETAIL_FULL                                                               = 0
   6798 	FTS5_DETAIL_NONE                                                               = 1
   6799 	FTS5_EOF                                                                       = 0
   6800 	FTS5_LCP                                                                       = 7
   6801 	FTS5_LP                                                                        = 10
   6802 	FTS5_MAIN_PREFIX                                                               = 48
   6803 	FTS5_MAX_LEVEL                                                                 = 64
   6804 	FTS5_MAX_PAGE_SIZE                                                             = 65536
   6805 	FTS5_MAX_PREFIX_INDEXES                                                        = 31
   6806 	FTS5_MAX_SEGMENT                                                               = 2000
   6807 	FTS5_MAX_TOKEN_SIZE                                                            = 32768
   6808 	FTS5_MERGE_NLIST                                                               = 16
   6809 	FTS5_MINUS                                                                     = 6
   6810 	FTS5_MIN_DLIDX_SIZE                                                            = 4
   6811 	FTS5_NOT                                                                       = 3
   6812 	FTS5_OPT_WORK_UNIT                                                             = 1000
   6813 	FTS5_OR                                                                        = 1
   6814 	FTS5_PATTERN_GLOB                                                              = 66
   6815 	FTS5_PATTERN_LIKE                                                              = 65
   6816 	FTS5_PATTERN_NONE                                                              = 0
   6817 	FTS5_PLAN_MATCH                                                                = 1
   6818 	FTS5_PLAN_ROWID                                                                = 6
   6819 	FTS5_PLAN_SCAN                                                                 = 5
   6820 	FTS5_PLAN_SORTED_MATCH                                                         = 4
   6821 	FTS5_PLAN_SOURCE                                                               = 2
   6822 	FTS5_PLAN_SPECIAL                                                              = 3
   6823 	FTS5_PLUS                                                                      = 14
   6824 	FTS5_PORTER_MAX_TOKEN                                                          = 64
   6825 	FTS5_RANK_NAME                                                                 = "rank"
   6826 	FTS5_RCP                                                                       = 8
   6827 	FTS5_REMOVE_DIACRITICS_COMPLEX                                                 = 2
   6828 	FTS5_REMOVE_DIACRITICS_NONE                                                    = 0
   6829 	FTS5_REMOVE_DIACRITICS_SIMPLE                                                  = 1
   6830 	FTS5_ROWID_NAME                                                                = "rowid"
   6831 	FTS5_RP                                                                        = 11
   6832 	FTS5_SEGITER_ONETERM                                                           = 0x01
   6833 	FTS5_SEGITER_REVERSE                                                           = 0x02
   6834 	FTS5_STAR                                                                      = 15
   6835 	FTS5_STMT_DELETE_CONTENT                                                       = 5
   6836 	FTS5_STMT_DELETE_DOCSIZE                                                       = 7
   6837 	FTS5_STMT_INSERT_CONTENT                                                       = 3
   6838 	FTS5_STMT_LOOKUP                                                               = 2
   6839 	FTS5_STMT_LOOKUP_DOCSIZE                                                       = 8
   6840 	FTS5_STMT_REPLACE_CONFIG                                                       = 9
   6841 	FTS5_STMT_REPLACE_CONTENT                                                      = 4
   6842 	FTS5_STMT_REPLACE_DOCSIZE                                                      = 6
   6843 	FTS5_STMT_SCAN                                                                 = 10
   6844 	FTS5_STMT_SCAN_ASC                                                             = 0
   6845 	FTS5_STMT_SCAN_DESC                                                            = 1
   6846 	FTS5_STRING                                                                    = 9
   6847 	FTS5_STRUCTURE_ROWID                                                           = 10
   6848 	FTS5_TERM                                                                      = 4
   6849 	FTS5_TOKENIZE_AUX                                                              = 0x0008
   6850 	FTS5_TOKENIZE_DOCUMENT                                                         = 0x0004
   6851 	FTS5_TOKENIZE_PREFIX                                                           = 0x0002
   6852 	FTS5_TOKENIZE_QUERY                                                            = 0x0001
   6853 	FTS5_TOKEN_COLOCATED                                                           = 0x0001
   6854 	FTS5_VOCAB_COL                                                                 = 0
   6855 	FTS5_VOCAB_COL_SCHEMA                                                          = "term, col, doc, cnt"
   6856 	FTS5_VOCAB_INSTANCE                                                            = 2
   6857 	FTS5_VOCAB_INST_SCHEMA                                                         = "term, doc, col, offset"
   6858 	FTS5_VOCAB_ROW                                                                 = 1
   6859 	FTS5_VOCAB_ROW_SCHEMA                                                          = "term, doc, cnt"
   6860 	FTS5_VOCAB_TERM_EQ                                                             = 0x01
   6861 	FTS5_VOCAB_TERM_GE                                                             = 0x02
   6862 	FTS5_VOCAB_TERM_LE                                                             = 0x04
   6863 	FTS5_WORK_UNIT                                                                 = 64
   6864 	FULLY_WITHIN                                                                   = 2
   6865 	FUNC_PERFECT_MATCH                                                             = 6
   6866 	FVIRTKEY                                                                       = 1
   6867 	FW_BLACK                                                                       = 900
   6868 	FW_BOLD                                                                        = 700
   6869 	FW_DEMIBOLD                                                                    = 600
   6870 	FW_DONTCARE                                                                    = 0
   6871 	FW_EXTRABOLD                                                                   = 800
   6872 	FW_EXTRALIGHT                                                                  = 200
   6873 	FW_HEAVY                                                                       = 900
   6874 	FW_LIGHT                                                                       = 300
   6875 	FW_MEDIUM                                                                      = 500
   6876 	FW_NORMAL                                                                      = 400
   6877 	FW_REGULAR                                                                     = 400
   6878 	FW_SEMIBOLD                                                                    = 600
   6879 	FW_THIN                                                                        = 100
   6880 	FW_ULTRABOLD                                                                   = 800
   6881 	FW_ULTRALIGHT                                                                  = 200
   6882 	GA_PARENT                                                                      = 1
   6883 	GA_ROOT                                                                        = 2
   6884 	GA_ROOTOWNER                                                                   = 3
   6885 	GB2312_CHARSET                                                                 = 134
   6886 	GCC_VERSION                                                                    = 10000000
   6887 	GCLP_HBRBACKGROUND                                                             = -10
   6888 	GCLP_HCURSOR                                                                   = -12
   6889 	GCLP_HICON                                                                     = -14
   6890 	GCLP_HICONSM                                                                   = -34
   6891 	GCLP_HMODULE                                                                   = -16
   6892 	GCLP_MENUNAME                                                                  = -8
   6893 	GCLP_WNDPROC                                                                   = -24
   6894 	GCL_CBCLSEXTRA                                                                 = -20
   6895 	GCL_CBWNDEXTRA                                                                 = -18
   6896 	GCL_CONVERSION                                                                 = 0x0001
   6897 	GCL_REVERSECONVERSION                                                          = 0x0002
   6898 	GCL_REVERSE_LENGTH                                                             = 0x0003
   6899 	GCL_STYLE                                                                      = -26
   6900 	GCPCLASS_ARABIC                                                                = 2
   6901 	GCPCLASS_HEBREW                                                                = 2
   6902 	GCPCLASS_LATIN                                                                 = 1
   6903 	GCPCLASS_LATINNUMBER                                                           = 5
   6904 	GCPCLASS_LATINNUMERICSEPARATOR                                                 = 7
   6905 	GCPCLASS_LATINNUMERICTERMINATOR                                                = 6
   6906 	GCPCLASS_LOCALNUMBER                                                           = 4
   6907 	GCPCLASS_NEUTRAL                                                               = 3
   6908 	GCPCLASS_NUMERICSEPARATOR                                                      = 8
   6909 	GCPCLASS_POSTBOUNDLTR                                                          = 0x20
   6910 	GCPCLASS_POSTBOUNDRTL                                                          = 0x10
   6911 	GCPCLASS_PREBOUNDLTR                                                           = 0x80
   6912 	GCPCLASS_PREBOUNDRTL                                                           = 0x40
   6913 	GCPGLYPH_LINKAFTER                                                             = 0x4000
   6914 	GCPGLYPH_LINKBEFORE                                                            = 0x8000
   6915 	GCP_CLASSIN                                                                    = 524288
   6916 	GCP_DBCS                                                                       = 0x0001
   6917 	GCP_DIACRITIC                                                                  = 0x0100
   6918 	GCP_DISPLAYZWG                                                                 = 4194304
   6919 	GCP_ERROR                                                                      = 0x8000
   6920 	GCP_GLYPHSHAPE                                                                 = 0x0010
   6921 	GCP_JUSTIFY                                                                    = 65536
   6922 	GCP_JUSTIFYIN                                                                  = 2097152
   6923 	GCP_KASHIDA                                                                    = 0x0400
   6924 	GCP_LIGATE                                                                     = 0x0020
   6925 	GCP_MAXEXTENT                                                                  = 1048576
   6926 	GCP_NEUTRALOVERRIDE                                                            = 33554432
   6927 	GCP_NUMERICOVERRIDE                                                            = 16777216
   6928 	GCP_NUMERICSLATIN                                                              = 67108864
   6929 	GCP_NUMERICSLOCAL                                                              = 134217728
   6930 	GCP_REORDER                                                                    = 0x0002
   6931 	GCP_SYMSWAPOFF                                                                 = 8388608
   6932 	GCP_USEKERNING                                                                 = 0x0008
   6933 	GCS_COMPATTR                                                                   = 0x0010
   6934 	GCS_COMPCLAUSE                                                                 = 0x0020
   6935 	GCS_COMPREADATTR                                                               = 0x0002
   6936 	GCS_COMPREADCLAUSE                                                             = 0x0004
   6937 	GCS_COMPREADSTR                                                                = 0x0001
   6938 	GCS_COMPSTR                                                                    = 0x0008
   6939 	GCS_CURSORPOS                                                                  = 0x0080
   6940 	GCS_DELTASTART                                                                 = 0x0100
   6941 	GCS_RESULTCLAUSE                                                               = 0x1000
   6942 	GCS_RESULTREADCLAUSE                                                           = 0x0400
   6943 	GCS_RESULTREADSTR                                                              = 0x0200
   6944 	GCS_RESULTSTR                                                                  = 0x0800
   6945 	GCW_ATOM                                                                       = -32
   6946 	GDICOMMENT_BEGINGROUP                                                          = 0x00000002
   6947 	GDICOMMENT_ENDGROUP                                                            = 0x00000003
   6948 	GDICOMMENT_IDENTIFIER                                                          = 0x43494447
   6949 	GDICOMMENT_MULTIFORMATS                                                        = 0x40000004
   6950 	GDICOMMENT_UNICODE_END                                                         = 0x00000080
   6951 	GDICOMMENT_UNICODE_STRING                                                      = 0x00000040
   6952 	GDICOMMENT_WINDOWS_METAFILE                                                    = 0x80000001
   6953 	GDIPLUS_TS_QUERYVER                                                            = 4122
   6954 	GDIPLUS_TS_RECORD                                                              = 4123
   6955 	GDI_ERROR                                                                      = 4294967295
   6956 	GDI_OBJ_LAST                                                                   = 14
   6957 	GENERIC_ALL                                                                    = 268435456
   6958 	GENERIC_EXECUTE                                                                = 536870912
   6959 	GENERIC_READ                                                                   = 2147483648
   6960 	GENERIC_WRITE                                                                  = 1073741824
   6961 	GEOID_NOT_AVAILABLE                                                            = -1
   6962 	GEOPOLY_PI                                                                     = 3.1415926535897932385
   6963 	GETCOLORTABLE                                                                  = 5
   6964 	GETDEVICEUNITS                                                                 = 42
   6965 	GETEXTENDEDTEXTMETRICS                                                         = 256
   6966 	GETEXTENTTABLE                                                                 = 257
   6967 	GETFACENAME                                                                    = 513
   6968 	GETPAIRKERNTABLE                                                               = 258
   6969 	GETPENWIDTH                                                                    = 16
   6970 	GETPHYSPAGESIZE                                                                = 12
   6971 	GETPRINTINGOFFSET                                                              = 13
   6972 	GETSCALINGFACTOR                                                               = 14
   6973 	GETSETPAPERBINS                                                                = 29
   6974 	GETSETPAPERMETRICS                                                             = 35
   6975 	GETSETPRINTORIENT                                                              = 30
   6976 	GETSETSCREENPARAMS                                                             = 3072
   6977 	GETTECHNOLGY                                                                   = 20
   6978 	GETTECHNOLOGY                                                                  = 20
   6979 	GETTRACKKERNTABLE                                                              = 259
   6980 	GETVECTORBRUSHSIZE                                                             = 27
   6981 	GETVECTORPENSIZE                                                               = 26
   6982 	GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS                                         = 4
   6983 	GET_MODULE_HANDLE_EX_FLAG_PIN                                                  = 1
   6984 	GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT                                   = 2
   6985 	GET_PS_FEATURESETTING                                                          = 4121
   6986 	GET_SYSTEM_WOW64_DIRECTORY_NAME_A_A                                            = "GetSystemWow64DirectoryA"
   6987 	GET_SYSTEM_WOW64_DIRECTORY_NAME_W_A                                            = "GetSystemWow64DirectoryW"
   6988 	GET_TAPE_DRIVE_INFORMATION                                                     = 1
   6989 	GET_TAPE_MEDIA_INFORMATION                                                     = 0
   6990 	GGI_MARK_NONEXISTING_GLYPHS                                                    = 0x0001
   6991 	GGL_INDEX                                                                      = 0x00000002
   6992 	GGL_LEVEL                                                                      = 0x00000001
   6993 	GGL_PRIVATE                                                                    = 0x00000004
   6994 	GGL_STRING                                                                     = 0x00000003
   6995 	GGO_BEZIER                                                                     = 3
   6996 	GGO_BITMAP                                                                     = 1
   6997 	GGO_GLYPH_INDEX                                                                = 0x0080
   6998 	GGO_GRAY2_BITMAP                                                               = 4
   6999 	GGO_GRAY4_BITMAP                                                               = 5
   7000 	GGO_GRAY8_BITMAP                                                               = 6
   7001 	GGO_METRICS                                                                    = 0
   7002 	GGO_NATIVE                                                                     = 2
   7003 	GGO_UNHINTED                                                                   = 0x0100
   7004 	GHND                                                                           = 66
   7005 	GIDC_ARRIVAL                                                                   = 1
   7006 	GIDC_REMOVAL                                                                   = 2
   7007 	GL_ID_CANNOTSAVE                                                               = 0x00000011
   7008 	GL_ID_CHOOSECANDIDATE                                                          = 0x00000028
   7009 	GL_ID_INPUTCODE                                                                = 0x00000026
   7010 	GL_ID_INPUTRADICAL                                                             = 0x00000025
   7011 	GL_ID_INPUTREADING                                                             = 0x00000024
   7012 	GL_ID_INPUTSYMBOL                                                              = 0x00000027
   7013 	GL_ID_NOCONVERT                                                                = 0x00000020
   7014 	GL_ID_NODICTIONARY                                                             = 0x00000010
   7015 	GL_ID_NOMODULE                                                                 = 0x00000001
   7016 	GL_ID_PRIVATE_FIRST                                                            = 0x00008000
   7017 	GL_ID_PRIVATE_LAST                                                             = 0x0000FFFF
   7018 	GL_ID_READINGCONFLICT                                                          = 0x00000023
   7019 	GL_ID_REVERSECONVERSION                                                        = 0x00000029
   7020 	GL_ID_TOOMANYSTROKE                                                            = 0x00000022
   7021 	GL_ID_TYPINGERROR                                                              = 0x00000021
   7022 	GL_ID_UNKNOWN                                                                  = 0x00000000
   7023 	GL_LEVEL_ERROR                                                                 = 0x00000002
   7024 	GL_LEVEL_FATAL                                                                 = 0x00000001
   7025 	GL_LEVEL_INFORMATION                                                           = 0x00000004
   7026 	GL_LEVEL_NOGUIDELINE                                                           = 0x00000000
   7027 	GL_LEVEL_WARNING                                                               = 0x00000003
   7028 	GMDI_GOINTOPOPUPS                                                              = 2
   7029 	GMDI_USEDISABLED                                                               = 1
   7030 	GMEM_DDESHARE                                                                  = 0x2000
   7031 	GMEM_DISCARDABLE                                                               = 0x100
   7032 	GMEM_DISCARDED                                                                 = 0x4000
   7033 	GMEM_FIXED                                                                     = 0x0
   7034 	GMEM_INVALID_HANDLE                                                            = 0x8000
   7035 	GMEM_LOCKCOUNT                                                                 = 0x00ff
   7036 	GMEM_LOWER                                                                     = 4096
   7037 	GMEM_MODIFY                                                                    = 0x80
   7038 	GMEM_MOVEABLE                                                                  = 0x2
   7039 	GMEM_NOCOMPACT                                                                 = 0x10
   7040 	GMEM_NODISCARD                                                                 = 0x20
   7041 	GMEM_NOTIFY                                                                    = 0x4000
   7042 	GMEM_NOT_BANKED                                                                = 0x1000
   7043 	GMEM_SHARE                                                                     = 0x2000
   7044 	GMEM_VALID_FLAGS                                                               = 0x7f72
   7045 	GMEM_ZEROINIT                                                                  = 0x40
   7046 	GMMP_USE_DISPLAY_POINTS                                                        = 1
   7047 	GMMP_USE_HIGH_RESOLUTION_POINTS                                                = 2
   7048 	GM_ADVANCED                                                                    = 2
   7049 	GM_COMPATIBLE                                                                  = 1
   7050 	GM_LAST                                                                        = 2
   7051 	GPTR                                                                           = 64
   7052 	GPT_ATTRIBUTE_PLATFORM_REQUIRED                                                = 1
   7053 	GPT_BASIC_DATA_ATTRIBUTE_HIDDEN                                                = 4611686018427387904
   7054 	GPT_BASIC_DATA_ATTRIBUTE_NO_DRIVE_LETTER                                       = 9223372036854775808
   7055 	GPT_BASIC_DATA_ATTRIBUTE_READ_ONLY                                             = 1152921504606846976
   7056 	GPT_BASIC_DATA_ATTRIBUTE_SHADOW_COPY                                           = 2305843009213693952
   7057 	GRADIENT_FILL_OP_FLAG                                                          = 0x000000ff
   7058 	GRADIENT_FILL_RECT_H                                                           = 0x00000000
   7059 	GRADIENT_FILL_RECT_V                                                           = 0x00000001
   7060 	GRADIENT_FILL_TRIANGLE                                                         = 0x00000002
   7061 	GRAY_BRUSH                                                                     = 2
   7062 	GREEK_CHARSET                                                                  = 161
   7063 	GROUP_NAME                                                                     = 0x80
   7064 	GROUP_SECURITY_INFORMATION                                                     = 2
   7065 	GR_GDIOBJECTS                                                                  = 0
   7066 	GR_USEROBJECTS                                                                 = 1
   7067 	GS_8BIT_INDICES                                                                = 0x00000001
   7068 	GUID_DEFINED                                                                   = 0
   7069 	GUI_16BITTASK                                                                  = 0x00000000
   7070 	GUI_CARETBLINKING                                                              = 0x00000001
   7071 	GUI_INMENUMODE                                                                 = 0x00000004
   7072 	GUI_INMOVESIZE                                                                 = 0x00000002
   7073 	GUI_POPUPMENUMODE                                                              = 0x00000010
   7074 	GUI_SYSTEMMENUMODE                                                             = 0x00000008
   7075 	GWLP_HINSTANCE                                                                 = -6
   7076 	GWLP_HWNDPARENT                                                                = -8
   7077 	GWLP_ID                                                                        = -12
   7078 	GWLP_USERDATA                                                                  = -21
   7079 	GWLP_WNDPROC                                                                   = -4
   7080 	GWL_EXSTYLE                                                                    = -20
   7081 	GWL_ID                                                                         = -12
   7082 	GWL_STYLE                                                                      = -16
   7083 	GW_CHILD                                                                       = 5
   7084 	GW_ENABLEDPOPUP                                                                = 6
   7085 	GW_HWNDFIRST                                                                   = 0
   7086 	GW_HWNDLAST                                                                    = 1
   7087 	GW_HWNDNEXT                                                                    = 2
   7088 	GW_HWNDPREV                                                                    = 3
   7089 	GW_MAX                                                                         = 6
   7090 	GW_OWNER                                                                       = 4
   7091 	HALFTONE                                                                       = 4
   7092 	HANDLE_FLAG_INHERIT                                                            = 0x1
   7093 	HANDLE_FLAG_PROTECT_FROM_CLOSE                                                 = 0x2
   7094 	HANGEUL_CHARSET                                                                = 129
   7095 	HANGUL_CHARSET                                                                 = 129
   7096 	HANGUP_COMPLETE                                                                = 0x05
   7097 	HANGUP_PENDING                                                                 = 0x04
   7098 	HASHSIZE                                                                       = 97
   7099 	HASHTABLE_HASH_1                                                               = 383
   7100 	HASHTABLE_NPAGE                                                                = 4096
   7101 	HASHTABLE_NSLOT                                                                = 8192
   7102 	HAVE_FCHOWN                                                                    = 1
   7103 	HAVE_LSTAT                                                                     = 1
   7104 	HAVE_READLINK                                                                  = 1
   7105 	HAVE_USLEEP                                                                    = 1
   7106 	HCBT_ACTIVATE                                                                  = 5
   7107 	HCBT_CLICKSKIPPED                                                              = 6
   7108 	HCBT_CREATEWND                                                                 = 3
   7109 	HCBT_DESTROYWND                                                                = 4
   7110 	HCBT_KEYSKIPPED                                                                = 7
   7111 	HCBT_MINMAX                                                                    = 1
   7112 	HCBT_MOVESIZE                                                                  = 0
   7113 	HCBT_QS                                                                        = 2
   7114 	HCBT_SETFOCUS                                                                  = 9
   7115 	HCBT_SYSCOMMAND                                                                = 8
   7116 	HCF_AVAILABLE                                                                  = 0x00000002
   7117 	HCF_CONFIRMHOTKEY                                                              = 0x00000008
   7118 	HCF_DEFAULTDESKTOP                                                             = 0x00000200
   7119 	HCF_HIGHCONTRASTON                                                             = 0x00000001
   7120 	HCF_HOTKEYACTIVE                                                               = 0x00000004
   7121 	HCF_HOTKEYAVAILABLE                                                            = 0x00000040
   7122 	HCF_HOTKEYSOUND                                                                = 0x00000010
   7123 	HCF_INDICATOR                                                                  = 0x00000020
   7124 	HCF_LOGONDESKTOP                                                               = 0x00000100
   7125 	HCF_OPTION_NOTHEMECHANGE                                                       = 0x00001000
   7126 	HCRYPTPROV_DEFINED                                                             = 0
   7127 	HC_ACTION                                                                      = 0
   7128 	HC_GETNEXT                                                                     = 1
   7129 	HC_NOREM                                                                       = 3
   7130 	HC_NOREMOVE                                                                    = 3
   7131 	HC_SKIP                                                                        = 2
   7132 	HC_SYSMODALOFF                                                                 = 5
   7133 	HC_SYSMODALON                                                                  = 4
   7134 	HDATA_APPOWNED                                                                 = 0x0001
   7135 	HEAP_CREATE_ALIGN_16                                                           = 0x00010000
   7136 	HEAP_CREATE_ENABLE_EXECUTE                                                     = 0x00040000
   7137 	HEAP_CREATE_ENABLE_TRACING                                                     = 0x00020000
   7138 	HEAP_DISABLE_COALESCE_ON_FREE                                                  = 0x00000080
   7139 	HEAP_FREE_CHECKING_ENABLED                                                     = 0x00000040
   7140 	HEAP_GENERATE_EXCEPTIONS                                                       = 0x00000004
   7141 	HEAP_GROWABLE                                                                  = 0x00000002
   7142 	HEAP_MAXIMUM_TAG                                                               = 0x0FFF
   7143 	HEAP_NO_SERIALIZE                                                              = 0x00000001
   7144 	HEAP_PSEUDO_TAG_FLAG                                                           = 0x8000
   7145 	HEAP_REALLOC_IN_PLACE_ONLY                                                     = 0x00000010
   7146 	HEAP_TAG_SHIFT                                                                 = 18
   7147 	HEAP_TAIL_CHECKING_ENABLED                                                     = 0x00000020
   7148 	HEAP_ZERO_MEMORY                                                               = 0x00000008
   7149 	HEBREW_CHARSET                                                                 = 177
   7150 	HELPINFO_MENUITEM                                                              = 0x0002
   7151 	HELPINFO_WINDOW                                                                = 0x0001
   7152 	HELPMSGSTRINGA                                                                 = "commdlg_help"
   7153 	HELP_COMMAND                                                                   = 0x0102
   7154 	HELP_CONTENTS                                                                  = 0x0003
   7155 	HELP_CONTEXT                                                                   = 0x0001
   7156 	HELP_CONTEXTMENU                                                               = 0x000a
   7157 	HELP_CONTEXTPOPUP                                                              = 0x0008
   7158 	HELP_FINDER                                                                    = 0x000b
   7159 	HELP_FORCEFILE                                                                 = 0x0009
   7160 	HELP_HELPONHELP                                                                = 0x0004
   7161 	HELP_INDEX                                                                     = 0x0003
   7162 	HELP_KEY                                                                       = 0x0101
   7163 	HELP_MULTIKEY                                                                  = 0x0201
   7164 	HELP_PARTIALKEY                                                                = 0x0105
   7165 	HELP_QUIT                                                                      = 0x0002
   7166 	HELP_SETCONTENTS                                                               = 0x0005
   7167 	HELP_SETINDEX                                                                  = 0x0005
   7168 	HELP_SETPOPUP_POS                                                              = 0x000d
   7169 	HELP_SETWINPOS                                                                 = 0x0203
   7170 	HELP_TCARD                                                                     = 0x8000
   7171 	HELP_TCARD_DATA                                                                = 0x0010
   7172 	HELP_TCARD_OTHER_CALLER                                                        = 0x0011
   7173 	HELP_WM_HELP                                                                   = 0x000c
   7174 	HIDE_WINDOW                                                                    = 0
   7175 	HIGH_PRIORITY_CLASS                                                            = 0x80
   7176 	HIGH_SURROGATE_END                                                             = 0xdbff
   7177 	HIGH_SURROGATE_START                                                           = 0xd800
   7178 	HINSTANCE_ERROR                                                                = 32
   7179 	HISTORY_NO_DUP_FLAG                                                            = 0x1
   7180 	HIST_NO_OF_BUCKETS                                                             = 24
   7181 	HKL_NEXT                                                                       = 1
   7182 	HKL_PREV                                                                       = 0
   7183 	HMONITOR_DECLARED                                                              = 1
   7184 	HOLLOW_BRUSH                                                                   = 5
   7185 	HORZRES                                                                        = 8
   7186 	HORZSIZE                                                                       = 4
   7187 	HOST_NOT_FOUND                                                                 = 11001
   7188 	HOVER_DEFAULT                                                                  = 0xFFFFFFFF
   7189 	HP_ALGID                                                                       = 0x1
   7190 	HP_HASHSIZE                                                                    = 0x4
   7191 	HP_HASHVAL                                                                     = 0x2
   7192 	HP_HMAC_INFO                                                                   = 0x5
   7193 	HP_TLS1PRF_LABEL                                                               = 0x6
   7194 	HP_TLS1PRF_SEED                                                                = 0x7
   7195 	HSHELL_ACCESSIBILITYSTATE                                                      = 11
   7196 	HSHELL_ACTIVATESHELLWINDOW                                                     = 3
   7197 	HSHELL_APPCOMMAND                                                              = 12
   7198 	HSHELL_ENDTASK                                                                 = 10
   7199 	HSHELL_FLASH                                                                   = 32774
   7200 	HSHELL_GETMINRECT                                                              = 5
   7201 	HSHELL_HIGHBIT                                                                 = 0x8000
   7202 	HSHELL_LANGUAGE                                                                = 8
   7203 	HSHELL_REDRAW                                                                  = 6
   7204 	HSHELL_RUDEAPPACTIVATED                                                        = 32772
   7205 	HSHELL_SYSMENU                                                                 = 9
   7206 	HSHELL_TASKMAN                                                                 = 7
   7207 	HSHELL_WINDOWACTIVATED                                                         = 4
   7208 	HSHELL_WINDOWCREATED                                                           = 1
   7209 	HSHELL_WINDOWDESTROYED                                                         = 2
   7210 	HSHELL_WINDOWREPLACED                                                          = 13
   7211 	HSHELL_WINDOWREPLACING                                                         = 14
   7212 	HS_API_MAX                                                                     = 12
   7213 	HS_BDIAGONAL                                                                   = 3
   7214 	HS_CROSS                                                                       = 4
   7215 	HS_DIAGCROSS                                                                   = 5
   7216 	HS_FDIAGONAL                                                                   = 2
   7217 	HS_HORIZONTAL                                                                  = 0
   7218 	HS_VERTICAL                                                                    = 1
   7219 	HTBORDER                                                                       = 18
   7220 	HTBOTTOM                                                                       = 15
   7221 	HTBOTTOMLEFT                                                                   = 16
   7222 	HTBOTTOMRIGHT                                                                  = 17
   7223 	HTCAPTION                                                                      = 2
   7224 	HTCLIENT                                                                       = 1
   7225 	HTCLOSE                                                                        = 20
   7226 	HTERROR                                                                        = -2
   7227 	HTGROWBOX                                                                      = 4
   7228 	HTHELP                                                                         = 21
   7229 	HTHSCROLL                                                                      = 6
   7230 	HTLEFT                                                                         = 10
   7231 	HTMAXBUTTON                                                                    = 9
   7232 	HTMENU                                                                         = 5
   7233 	HTMINBUTTON                                                                    = 8
   7234 	HTNOWHERE                                                                      = 0
   7235 	HTOBJECT                                                                       = 19
   7236 	HTREDUCE                                                                       = 8
   7237 	HTRIGHT                                                                        = 11
   7238 	HTSIZE                                                                         = 4
   7239 	HTSIZEFIRST                                                                    = 10
   7240 	HTSIZELAST                                                                     = 17
   7241 	HTSYSMENU                                                                      = 3
   7242 	HTTOP                                                                          = 12
   7243 	HTTOPLEFT                                                                      = 13
   7244 	HTTOPRIGHT                                                                     = 14
   7245 	HTTRANSPARENT                                                                  = -1
   7246 	HTVSCROLL                                                                      = 7
   7247 	HTZOOM                                                                         = 9
   7248 	HUGEP                                                                          = 0
   7249 	HW_PROFILE_GUIDLEN                                                             = 39
   7250 	IACE_CHILDREN                                                                  = 0x0001
   7251 	IACE_DEFAULT                                                                   = 0x0010
   7252 	IACE_IGNORENOCONTEXT                                                           = 0x0020
   7253 	ICM_ADDPROFILE                                                                 = 1
   7254 	ICM_DELETEPROFILE                                                              = 2
   7255 	ICM_DONE_OUTSIDEDC                                                             = 4
   7256 	ICM_OFF                                                                        = 1
   7257 	ICM_ON                                                                         = 2
   7258 	ICM_QUERY                                                                      = 3
   7259 	ICM_QUERYMATCH                                                                 = 7
   7260 	ICM_QUERYPROFILE                                                               = 3
   7261 	ICM_REGISTERICMATCHER                                                          = 5
   7262 	ICM_SETDEFAULTPROFILE                                                          = 4
   7263 	ICM_UNREGISTERICMATCHER                                                        = 6
   7264 	ICON_BIG                                                                       = 1
   7265 	ICON_SMALL                                                                     = 0
   7266 	ICON_SMALL2                                                                    = 2
   7267 	IDABORT                                                                        = 3
   7268 	IDANI_CAPTION                                                                  = 3
   7269 	IDANI_OPEN                                                                     = 1
   7270 	IDCANCEL                                                                       = 2
   7271 	IDCLOSE                                                                        = 8
   7272 	IDCONTINUE                                                                     = 11
   7273 	IDENTIFY_BUFFER_SIZE                                                           = 512
   7274 	IDHELP                                                                         = 9
   7275 	IDHOT_SNAPDESKTOP                                                              = -2
   7276 	IDHOT_SNAPWINDOW                                                               = -1
   7277 	IDH_CANCEL                                                                     = 28444
   7278 	IDH_GENERIC_HELP_BUTTON                                                        = 28442
   7279 	IDH_HELP                                                                       = 28445
   7280 	IDH_MISSING_CONTEXT                                                            = 28441
   7281 	IDH_NO_HELP                                                                    = 28440
   7282 	IDH_OK                                                                         = 28443
   7283 	IDIGNORE                                                                       = 5
   7284 	IDLE_PRIORITY_CLASS                                                            = 0x40
   7285 	IDLFLAG_FIN                                                                    = 1
   7286 	IDLFLAG_FLCID                                                                  = 4
   7287 	IDLFLAG_FOUT                                                                   = 2
   7288 	IDLFLAG_FRETVAL                                                                = 8
   7289 	IDLFLAG_NONE                                                                   = 0
   7290 	IDNO                                                                           = 7
   7291 	IDOK                                                                           = 1
   7292 	IDRETRY                                                                        = 4
   7293 	IDTIMEOUT                                                                      = 32000
   7294 	IDTRYAGAIN                                                                     = 10
   7295 	IDYES                                                                          = 6
   7296 	ID_CMD                                                                         = 0xEC
   7297 	ID_DEFAULTINST                                                                 = -2
   7298 	ID_PSREBOOTSYSTEM                                                              = 3
   7299 	ID_PSRESTARTWINDOWS                                                            = 0x2
   7300 	IE_BADID                                                                       = -1
   7301 	IE_BAUDRATE                                                                    = -12
   7302 	IE_BYTESIZE                                                                    = -11
   7303 	IE_DEFAULT                                                                     = -5
   7304 	IE_HARDWARE                                                                    = -10
   7305 	IE_MEMORY                                                                      = -4
   7306 	IE_NOPEN                                                                       = -3
   7307 	IE_OPEN                                                                        = -2
   7308 	IFID_DEFINED                                                                   = 0
   7309 	IGIMIF_RIGHTMENU                                                               = 0x0001
   7310 	IGIMII_CMODE                                                                   = 0x0001
   7311 	IGIMII_CONFIGURE                                                               = 0x0004
   7312 	IGIMII_HELP                                                                    = 0x0010
   7313 	IGIMII_INPUTTOOLS                                                              = 0x0040
   7314 	IGIMII_OTHER                                                                   = 0x0020
   7315 	IGIMII_SMODE                                                                   = 0x0002
   7316 	IGIMII_TOOLS                                                                   = 0x0008
   7317 	IGNORE                                                                         = 0
   7318 	IGP_CONVERSION                                                                 = 0x00000008
   7319 	IGP_PROPERTY                                                                   = 0x00000004
   7320 	IGP_SELECT                                                                     = 0x00000018
   7321 	IGP_SENTENCE                                                                   = 0x0000000c
   7322 	IGP_SETCOMPSTR                                                                 = 0x00000014
   7323 	IGP_UI                                                                         = 0x00000010
   7324 	ILLUMINANT_A                                                                   = 1
   7325 	ILLUMINANT_B                                                                   = 2
   7326 	ILLUMINANT_C                                                                   = 3
   7327 	ILLUMINANT_D50                                                                 = 4
   7328 	ILLUMINANT_D55                                                                 = 5
   7329 	ILLUMINANT_D65                                                                 = 6
   7330 	ILLUMINANT_D75                                                                 = 7
   7331 	ILLUMINANT_DAYLIGHT                                                            = 3
   7332 	ILLUMINANT_DEVICE_DEFAULT                                                      = 0
   7333 	ILLUMINANT_F2                                                                  = 8
   7334 	ILLUMINANT_FLUORESCENT                                                         = 8
   7335 	ILLUMINANT_MAX_INDEX                                                           = 8
   7336 	ILLUMINANT_NTSC                                                                = 3
   7337 	ILLUMINANT_TUNGSTEN                                                            = 1
   7338 	IMAGE_ARCHIVE_END                                                              = "`\n"
   7339 	IMAGE_ARCHIVE_LINKER_MEMBER                                                    = "/               "
   7340 	IMAGE_ARCHIVE_LONGNAMES_MEMBER                                                 = "//              "
   7341 	IMAGE_ARCHIVE_PAD                                                              = "\n"
   7342 	IMAGE_ARCHIVE_START                                                            = "!<arch>\n"
   7343 	IMAGE_ARCHIVE_START_SIZE                                                       = 8
   7344 	IMAGE_BITMAP                                                                   = 0
   7345 	IMAGE_COMDAT_SELECT_ANY                                                        = 2
   7346 	IMAGE_COMDAT_SELECT_ASSOCIATIVE                                                = 5
   7347 	IMAGE_COMDAT_SELECT_EXACT_MATCH                                                = 4
   7348 	IMAGE_COMDAT_SELECT_LARGEST                                                    = 6
   7349 	IMAGE_COMDAT_SELECT_NEWEST                                                     = 7
   7350 	IMAGE_COMDAT_SELECT_NODUPLICATES                                               = 1
   7351 	IMAGE_COMDAT_SELECT_SAME_SIZE                                                  = 3
   7352 	IMAGE_CURSOR                                                                   = 2
   7353 	IMAGE_DEBUG_MISC_EXENAME                                                       = 1
   7354 	IMAGE_DEBUG_TYPE_BORLAND                                                       = 9
   7355 	IMAGE_DEBUG_TYPE_CLSID                                                         = 11
   7356 	IMAGE_DEBUG_TYPE_CODEVIEW                                                      = 2
   7357 	IMAGE_DEBUG_TYPE_COFF                                                          = 1
   7358 	IMAGE_DEBUG_TYPE_EXCEPTION                                                     = 5
   7359 	IMAGE_DEBUG_TYPE_FIXUP                                                         = 6
   7360 	IMAGE_DEBUG_TYPE_FPO                                                           = 3
   7361 	IMAGE_DEBUG_TYPE_MISC                                                          = 4
   7362 	IMAGE_DEBUG_TYPE_OMAP_FROM_SRC                                                 = 8
   7363 	IMAGE_DEBUG_TYPE_OMAP_TO_SRC                                                   = 7
   7364 	IMAGE_DEBUG_TYPE_RESERVED10                                                    = 10
   7365 	IMAGE_DEBUG_TYPE_UNKNOWN                                                       = 0
   7366 	IMAGE_DIRECTORY_ENTRY_ARCHITECTURE                                             = 7
   7367 	IMAGE_DIRECTORY_ENTRY_BASERELOC                                                = 5
   7368 	IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT                                             = 11
   7369 	IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR                                           = 14
   7370 	IMAGE_DIRECTORY_ENTRY_DEBUG                                                    = 6
   7371 	IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT                                             = 13
   7372 	IMAGE_DIRECTORY_ENTRY_EXCEPTION                                                = 3
   7373 	IMAGE_DIRECTORY_ENTRY_EXPORT                                                   = 0
   7374 	IMAGE_DIRECTORY_ENTRY_GLOBALPTR                                                = 8
   7375 	IMAGE_DIRECTORY_ENTRY_IAT                                                      = 12
   7376 	IMAGE_DIRECTORY_ENTRY_IMPORT                                                   = 1
   7377 	IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG                                              = 10
   7378 	IMAGE_DIRECTORY_ENTRY_RESOURCE                                                 = 2
   7379 	IMAGE_DIRECTORY_ENTRY_SECURITY                                                 = 4
   7380 	IMAGE_DIRECTORY_ENTRY_TLS                                                      = 9
   7381 	IMAGE_DLLCHARACTERISTICS_APPCONTAINER                                          = 0x1000
   7382 	IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE                                          = 0x0040
   7383 	IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY                                       = 0x0080
   7384 	IMAGE_DLLCHARACTERISTICS_GUARD_CF                                              = 0x4000
   7385 	IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA                                       = 0x0020
   7386 	IMAGE_DLLCHARACTERISTICS_NO_BIND                                               = 0x0800
   7387 	IMAGE_DLLCHARACTERISTICS_NO_ISOLATION                                          = 0x0200
   7388 	IMAGE_DLLCHARACTERISTICS_NO_SEH                                                = 0x0400
   7389 	IMAGE_DLLCHARACTERISTICS_NX_COMPAT                                             = 0x0100
   7390 	IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE                                 = 0x8000
   7391 	IMAGE_DLLCHARACTERISTICS_WDM_DRIVER                                            = 0x2000
   7392 	IMAGE_DOS_SIGNATURE                                                            = 0x5A4D
   7393 	IMAGE_ENHMETAFILE                                                              = 3
   7394 	IMAGE_FILE_32BIT_MACHINE                                                       = 0x0100
   7395 	IMAGE_FILE_AGGRESIVE_WS_TRIM                                                   = 0x0010
   7396 	IMAGE_FILE_BYTES_REVERSED_HI                                                   = 0x8000
   7397 	IMAGE_FILE_BYTES_REVERSED_LO                                                   = 0x0080
   7398 	IMAGE_FILE_DEBUG_STRIPPED                                                      = 0x0200
   7399 	IMAGE_FILE_DLL                                                                 = 0x2000
   7400 	IMAGE_FILE_EXECUTABLE_IMAGE                                                    = 0x0002
   7401 	IMAGE_FILE_LARGE_ADDRESS_AWARE                                                 = 0x0020
   7402 	IMAGE_FILE_LINE_NUMS_STRIPPED                                                  = 0x0004
   7403 	IMAGE_FILE_LOCAL_SYMS_STRIPPED                                                 = 0x0008
   7404 	IMAGE_FILE_MACHINE_ALPHA                                                       = 0x0184
   7405 	IMAGE_FILE_MACHINE_ALPHA64                                                     = 0x0284
   7406 	IMAGE_FILE_MACHINE_AM33                                                        = 0x01d3
   7407 	IMAGE_FILE_MACHINE_AMD64                                                       = 0x8664
   7408 	IMAGE_FILE_MACHINE_ARM                                                         = 0x01c0
   7409 	IMAGE_FILE_MACHINE_ARM64                                                       = 0xaa64
   7410 	IMAGE_FILE_MACHINE_ARMNT                                                       = 0x01c4
   7411 	IMAGE_FILE_MACHINE_ARMV7                                                       = 0x01c4
   7412 	IMAGE_FILE_MACHINE_AXP64                                                       = 644
   7413 	IMAGE_FILE_MACHINE_CEE                                                         = 0xc0ee
   7414 	IMAGE_FILE_MACHINE_CEF                                                         = 0x0CEF
   7415 	IMAGE_FILE_MACHINE_EBC                                                         = 0x0EBC
   7416 	IMAGE_FILE_MACHINE_I386                                                        = 0x014c
   7417 	IMAGE_FILE_MACHINE_IA64                                                        = 0x0200
   7418 	IMAGE_FILE_MACHINE_M32R                                                        = 0x9041
   7419 	IMAGE_FILE_MACHINE_MIPS16                                                      = 0x0266
   7420 	IMAGE_FILE_MACHINE_MIPSFPU                                                     = 0x0366
   7421 	IMAGE_FILE_MACHINE_MIPSFPU16                                                   = 0x0466
   7422 	IMAGE_FILE_MACHINE_POWERPC                                                     = 0x01F0
   7423 	IMAGE_FILE_MACHINE_POWERPCFP                                                   = 0x01f1
   7424 	IMAGE_FILE_MACHINE_R10000                                                      = 0x0168
   7425 	IMAGE_FILE_MACHINE_R3000                                                       = 0x0162
   7426 	IMAGE_FILE_MACHINE_R4000                                                       = 0x0166
   7427 	IMAGE_FILE_MACHINE_SH3                                                         = 0x01a2
   7428 	IMAGE_FILE_MACHINE_SH3DSP                                                      = 0x01a3
   7429 	IMAGE_FILE_MACHINE_SH3E                                                        = 0x01a4
   7430 	IMAGE_FILE_MACHINE_SH4                                                         = 0x01a6
   7431 	IMAGE_FILE_MACHINE_SH5                                                         = 0x01a8
   7432 	IMAGE_FILE_MACHINE_THUMB                                                       = 0x01c2
   7433 	IMAGE_FILE_MACHINE_TRICORE                                                     = 0x0520
   7434 	IMAGE_FILE_MACHINE_UNKNOWN                                                     = 0
   7435 	IMAGE_FILE_MACHINE_WCEMIPSV2                                                   = 0x0169
   7436 	IMAGE_FILE_NET_RUN_FROM_SWAP                                                   = 0x0800
   7437 	IMAGE_FILE_RELOCS_STRIPPED                                                     = 0x0001
   7438 	IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP                                             = 0x0400
   7439 	IMAGE_FILE_SYSTEM                                                              = 0x1000
   7440 	IMAGE_FILE_UP_SYSTEM_ONLY                                                      = 0x4000
   7441 	IMAGE_ICON                                                                     = 1
   7442 	IMAGE_NT_OPTIONAL_HDR32_MAGIC                                                  = 0x10b
   7443 	IMAGE_NT_OPTIONAL_HDR64_MAGIC                                                  = 0x20b
   7444 	IMAGE_NT_OPTIONAL_HDR_MAGIC                                                    = 523
   7445 	IMAGE_NT_SIGNATURE                                                             = 0x00004550
   7446 	IMAGE_NUMBEROF_DIRECTORY_ENTRIES                                               = 16
   7447 	IMAGE_ORDINAL_FLAG                                                             = 9223372036854775808
   7448 	IMAGE_ORDINAL_FLAG32                                                           = 0x80000000
   7449 	IMAGE_ORDINAL_FLAG64                                                           = 0x8000000000000000
   7450 	IMAGE_OS2_SIGNATURE                                                            = 0x454E
   7451 	IMAGE_OS2_SIGNATURE_LE                                                         = 0x454C
   7452 	IMAGE_REL_ALPHA_ABSOLUTE                                                       = 0x0000
   7453 	IMAGE_REL_ALPHA_BRADDR                                                         = 0x0007
   7454 	IMAGE_REL_ALPHA_GPDISP                                                         = 0x0006
   7455 	IMAGE_REL_ALPHA_GPREL32                                                        = 0x0003
   7456 	IMAGE_REL_ALPHA_GPRELHI                                                        = 0x0017
   7457 	IMAGE_REL_ALPHA_GPRELLO                                                        = 0x0016
   7458 	IMAGE_REL_ALPHA_HINT                                                           = 0x0008
   7459 	IMAGE_REL_ALPHA_INLINE_REFLONG                                                 = 0x0009
   7460 	IMAGE_REL_ALPHA_LITERAL                                                        = 0x0004
   7461 	IMAGE_REL_ALPHA_LITUSE                                                         = 0x0005
   7462 	IMAGE_REL_ALPHA_MATCH                                                          = 0x000D
   7463 	IMAGE_REL_ALPHA_PAIR                                                           = 0x000C
   7464 	IMAGE_REL_ALPHA_REFHI                                                          = 0x000A
   7465 	IMAGE_REL_ALPHA_REFLO                                                          = 0x000B
   7466 	IMAGE_REL_ALPHA_REFLONG                                                        = 0x0001
   7467 	IMAGE_REL_ALPHA_REFLONGNB                                                      = 0x0010
   7468 	IMAGE_REL_ALPHA_REFQ1                                                          = 0x0015
   7469 	IMAGE_REL_ALPHA_REFQ2                                                          = 0x0014
   7470 	IMAGE_REL_ALPHA_REFQ3                                                          = 0x0013
   7471 	IMAGE_REL_ALPHA_REFQUAD                                                        = 0x0002
   7472 	IMAGE_REL_ALPHA_SECREL                                                         = 0x000F
   7473 	IMAGE_REL_ALPHA_SECRELHI                                                       = 0x0012
   7474 	IMAGE_REL_ALPHA_SECRELLO                                                       = 0x0011
   7475 	IMAGE_REL_ALPHA_SECTION                                                        = 0x000E
   7476 	IMAGE_REL_AMD64_ABSOLUTE                                                       = 0x0000
   7477 	IMAGE_REL_AMD64_ADDR32                                                         = 0x0002
   7478 	IMAGE_REL_AMD64_ADDR32NB                                                       = 0x0003
   7479 	IMAGE_REL_AMD64_ADDR64                                                         = 0x0001
   7480 	IMAGE_REL_AMD64_PAIR                                                           = 0x000F
   7481 	IMAGE_REL_AMD64_REL32                                                          = 0x0004
   7482 	IMAGE_REL_AMD64_REL32_1                                                        = 0x0005
   7483 	IMAGE_REL_AMD64_REL32_2                                                        = 0x0006
   7484 	IMAGE_REL_AMD64_REL32_3                                                        = 0x0007
   7485 	IMAGE_REL_AMD64_REL32_4                                                        = 0x0008
   7486 	IMAGE_REL_AMD64_REL32_5                                                        = 0x0009
   7487 	IMAGE_REL_AMD64_SECREL                                                         = 0x000B
   7488 	IMAGE_REL_AMD64_SECREL7                                                        = 0x000C
   7489 	IMAGE_REL_AMD64_SECTION                                                        = 0x000A
   7490 	IMAGE_REL_AMD64_SREL32                                                         = 0x000E
   7491 	IMAGE_REL_AMD64_SSPAN32                                                        = 0x0010
   7492 	IMAGE_REL_AMD64_TOKEN                                                          = 0x000D
   7493 	IMAGE_REL_AM_ABSOLUTE                                                          = 0x0000
   7494 	IMAGE_REL_AM_ADDR32                                                            = 0x0001
   7495 	IMAGE_REL_AM_ADDR32NB                                                          = 0x0002
   7496 	IMAGE_REL_AM_CALL32                                                            = 0x0003
   7497 	IMAGE_REL_AM_FUNCINFO                                                          = 0x0004
   7498 	IMAGE_REL_AM_REL32_1                                                           = 0x0005
   7499 	IMAGE_REL_AM_REL32_2                                                           = 0x0006
   7500 	IMAGE_REL_AM_SECREL                                                            = 0x0007
   7501 	IMAGE_REL_AM_SECTION                                                           = 0x0008
   7502 	IMAGE_REL_AM_TOKEN                                                             = 0x0009
   7503 	IMAGE_REL_ARM_ABSOLUTE                                                         = 0x0000
   7504 	IMAGE_REL_ARM_ADDR32                                                           = 0x0001
   7505 	IMAGE_REL_ARM_ADDR32NB                                                         = 0x0002
   7506 	IMAGE_REL_ARM_BLX11                                                            = 0x0009
   7507 	IMAGE_REL_ARM_BLX23T                                                           = 0x0015
   7508 	IMAGE_REL_ARM_BLX24                                                            = 0x0008
   7509 	IMAGE_REL_ARM_BRANCH11                                                         = 0x0004
   7510 	IMAGE_REL_ARM_BRANCH20T                                                        = 0x0012
   7511 	IMAGE_REL_ARM_BRANCH24                                                         = 0x0003
   7512 	IMAGE_REL_ARM_BRANCH24T                                                        = 0x0014
   7513 	IMAGE_REL_ARM_GPREL12                                                          = 0x0006
   7514 	IMAGE_REL_ARM_GPREL7                                                           = 0x0007
   7515 	IMAGE_REL_ARM_MOV32                                                            = 0x0010
   7516 	IMAGE_REL_ARM_MOV32A                                                           = 0x0010
   7517 	IMAGE_REL_ARM_MOV32T                                                           = 0x0011
   7518 	IMAGE_REL_ARM_SECREL                                                           = 0x000F
   7519 	IMAGE_REL_ARM_SECTION                                                          = 0x000E
   7520 	IMAGE_REL_ARM_TOKEN                                                            = 0x0005
   7521 	IMAGE_REL_BASED_ABSOLUTE                                                       = 0
   7522 	IMAGE_REL_BASED_ARM_MOV32                                                      = 5
   7523 	IMAGE_REL_BASED_DIR64                                                          = 10
   7524 	IMAGE_REL_BASED_HIGH                                                           = 1
   7525 	IMAGE_REL_BASED_HIGHADJ                                                        = 4
   7526 	IMAGE_REL_BASED_HIGHLOW                                                        = 3
   7527 	IMAGE_REL_BASED_IA64_IMM64                                                     = 9
   7528 	IMAGE_REL_BASED_LOW                                                            = 2
   7529 	IMAGE_REL_BASED_MIPS_JMPADDR                                                   = 5
   7530 	IMAGE_REL_BASED_MIPS_JMPADDR16                                                 = 9
   7531 	IMAGE_REL_BASED_THUMB_MOV32                                                    = 7
   7532 	IMAGE_REL_CEE_ABSOLUTE                                                         = 0x0000
   7533 	IMAGE_REL_CEE_ADDR32                                                           = 0x0001
   7534 	IMAGE_REL_CEE_ADDR32NB                                                         = 0x0003
   7535 	IMAGE_REL_CEE_ADDR64                                                           = 0x0002
   7536 	IMAGE_REL_CEE_SECREL                                                           = 0x0005
   7537 	IMAGE_REL_CEE_SECTION                                                          = 0x0004
   7538 	IMAGE_REL_CEE_TOKEN                                                            = 0x0006
   7539 	IMAGE_REL_CEF_ABSOLUTE                                                         = 0x0000
   7540 	IMAGE_REL_CEF_ADDR32                                                           = 0x0001
   7541 	IMAGE_REL_CEF_ADDR32NB                                                         = 0x0003
   7542 	IMAGE_REL_CEF_ADDR64                                                           = 0x0002
   7543 	IMAGE_REL_CEF_SECREL                                                           = 0x0005
   7544 	IMAGE_REL_CEF_SECTION                                                          = 0x0004
   7545 	IMAGE_REL_CEF_TOKEN                                                            = 0x0006
   7546 	IMAGE_REL_EBC_ABSOLUTE                                                         = 0x0000
   7547 	IMAGE_REL_EBC_ADDR32NB                                                         = 0x0001
   7548 	IMAGE_REL_EBC_REL32                                                            = 0x0002
   7549 	IMAGE_REL_EBC_SECREL                                                           = 0x0004
   7550 	IMAGE_REL_EBC_SECTION                                                          = 0x0003
   7551 	IMAGE_REL_I386_ABSOLUTE                                                        = 0x0000
   7552 	IMAGE_REL_I386_DIR16                                                           = 0x0001
   7553 	IMAGE_REL_I386_DIR32                                                           = 0x0006
   7554 	IMAGE_REL_I386_DIR32NB                                                         = 0x0007
   7555 	IMAGE_REL_I386_REL16                                                           = 0x0002
   7556 	IMAGE_REL_I386_REL32                                                           = 0x0014
   7557 	IMAGE_REL_I386_SECREL                                                          = 0x000B
   7558 	IMAGE_REL_I386_SECREL7                                                         = 0x000D
   7559 	IMAGE_REL_I386_SECTION                                                         = 0x000A
   7560 	IMAGE_REL_I386_SEG12                                                           = 0x0009
   7561 	IMAGE_REL_I386_TOKEN                                                           = 0x000C
   7562 	IMAGE_REL_IA64_ABSOLUTE                                                        = 0x0000
   7563 	IMAGE_REL_IA64_ADDEND                                                          = 0x001F
   7564 	IMAGE_REL_IA64_DIR32                                                           = 0x0004
   7565 	IMAGE_REL_IA64_DIR32NB                                                         = 0x0010
   7566 	IMAGE_REL_IA64_DIR64                                                           = 0x0005
   7567 	IMAGE_REL_IA64_GPREL22                                                         = 0x0009
   7568 	IMAGE_REL_IA64_GPREL32                                                         = 0x001C
   7569 	IMAGE_REL_IA64_IMM14                                                           = 0x0001
   7570 	IMAGE_REL_IA64_IMM22                                                           = 0x0002
   7571 	IMAGE_REL_IA64_IMM64                                                           = 0x0003
   7572 	IMAGE_REL_IA64_IMMGPREL64                                                      = 0x001A
   7573 	IMAGE_REL_IA64_LTOFF22                                                         = 0x000A
   7574 	IMAGE_REL_IA64_PCREL21B                                                        = 0x0006
   7575 	IMAGE_REL_IA64_PCREL21F                                                        = 0x0008
   7576 	IMAGE_REL_IA64_PCREL21M                                                        = 0x0007
   7577 	IMAGE_REL_IA64_PCREL60B                                                        = 0x0016
   7578 	IMAGE_REL_IA64_PCREL60F                                                        = 0x0017
   7579 	IMAGE_REL_IA64_PCREL60I                                                        = 0x0018
   7580 	IMAGE_REL_IA64_PCREL60M                                                        = 0x0019
   7581 	IMAGE_REL_IA64_PCREL60X                                                        = 0x0015
   7582 	IMAGE_REL_IA64_SECREL22                                                        = 0x000C
   7583 	IMAGE_REL_IA64_SECREL32                                                        = 0x000E
   7584 	IMAGE_REL_IA64_SECREL64I                                                       = 0x000D
   7585 	IMAGE_REL_IA64_SECTION                                                         = 0x000B
   7586 	IMAGE_REL_IA64_SREL14                                                          = 0x0011
   7587 	IMAGE_REL_IA64_SREL22                                                          = 0x0012
   7588 	IMAGE_REL_IA64_SREL32                                                          = 0x0013
   7589 	IMAGE_REL_IA64_TOKEN                                                           = 0x001B
   7590 	IMAGE_REL_IA64_UREL32                                                          = 0x0014
   7591 	IMAGE_REL_M32R_ABSOLUTE                                                        = 0x0000
   7592 	IMAGE_REL_M32R_ADDR24                                                          = 0x0003
   7593 	IMAGE_REL_M32R_ADDR32                                                          = 0x0001
   7594 	IMAGE_REL_M32R_ADDR32NB                                                        = 0x0002
   7595 	IMAGE_REL_M32R_GPREL16                                                         = 0x0004
   7596 	IMAGE_REL_M32R_PAIR                                                            = 0x000B
   7597 	IMAGE_REL_M32R_PCREL16                                                         = 0x0006
   7598 	IMAGE_REL_M32R_PCREL24                                                         = 0x0005
   7599 	IMAGE_REL_M32R_PCREL8                                                          = 0x0007
   7600 	IMAGE_REL_M32R_REFHALF                                                         = 0x0008
   7601 	IMAGE_REL_M32R_REFHI                                                           = 0x0009
   7602 	IMAGE_REL_M32R_REFLO                                                           = 0x000A
   7603 	IMAGE_REL_M32R_SECREL32                                                        = 0x000D
   7604 	IMAGE_REL_M32R_SECTION                                                         = 0x000C
   7605 	IMAGE_REL_M32R_TOKEN                                                           = 0x000E
   7606 	IMAGE_REL_MIPS_ABSOLUTE                                                        = 0x0000
   7607 	IMAGE_REL_MIPS_GPREL                                                           = 0x0006
   7608 	IMAGE_REL_MIPS_JMPADDR                                                         = 0x0003
   7609 	IMAGE_REL_MIPS_JMPADDR16                                                       = 0x0010
   7610 	IMAGE_REL_MIPS_LITERAL                                                         = 0x0007
   7611 	IMAGE_REL_MIPS_PAIR                                                            = 0x0025
   7612 	IMAGE_REL_MIPS_REFHALF                                                         = 0x0001
   7613 	IMAGE_REL_MIPS_REFHI                                                           = 0x0004
   7614 	IMAGE_REL_MIPS_REFLO                                                           = 0x0005
   7615 	IMAGE_REL_MIPS_REFWORD                                                         = 0x0002
   7616 	IMAGE_REL_MIPS_REFWORDNB                                                       = 0x0022
   7617 	IMAGE_REL_MIPS_SECREL                                                          = 0x000B
   7618 	IMAGE_REL_MIPS_SECRELHI                                                        = 0x000D
   7619 	IMAGE_REL_MIPS_SECRELLO                                                        = 0x000C
   7620 	IMAGE_REL_MIPS_SECTION                                                         = 0x000A
   7621 	IMAGE_REL_MIPS_TOKEN                                                           = 0x000E
   7622 	IMAGE_REL_PPC_ABSOLUTE                                                         = 0x0000
   7623 	IMAGE_REL_PPC_ADDR14                                                           = 0x0005
   7624 	IMAGE_REL_PPC_ADDR16                                                           = 0x0004
   7625 	IMAGE_REL_PPC_ADDR24                                                           = 0x0003
   7626 	IMAGE_REL_PPC_ADDR32                                                           = 0x0002
   7627 	IMAGE_REL_PPC_ADDR32NB                                                         = 0x000A
   7628 	IMAGE_REL_PPC_ADDR64                                                           = 0x0001
   7629 	IMAGE_REL_PPC_BRNTAKEN                                                         = 0x0400
   7630 	IMAGE_REL_PPC_BRTAKEN                                                          = 0x0200
   7631 	IMAGE_REL_PPC_GPREL                                                            = 0x0015
   7632 	IMAGE_REL_PPC_IFGLUE                                                           = 0x000D
   7633 	IMAGE_REL_PPC_IMGLUE                                                           = 0x000E
   7634 	IMAGE_REL_PPC_NEG                                                              = 0x0100
   7635 	IMAGE_REL_PPC_PAIR                                                             = 0x0012
   7636 	IMAGE_REL_PPC_REFHI                                                            = 0x0010
   7637 	IMAGE_REL_PPC_REFLO                                                            = 0x0011
   7638 	IMAGE_REL_PPC_REL14                                                            = 0x0007
   7639 	IMAGE_REL_PPC_REL24                                                            = 0x0006
   7640 	IMAGE_REL_PPC_SECREL                                                           = 0x000B
   7641 	IMAGE_REL_PPC_SECREL16                                                         = 0x000F
   7642 	IMAGE_REL_PPC_SECRELHI                                                         = 0x0014
   7643 	IMAGE_REL_PPC_SECRELLO                                                         = 0x0013
   7644 	IMAGE_REL_PPC_SECTION                                                          = 0x000C
   7645 	IMAGE_REL_PPC_TOCDEFN                                                          = 0x0800
   7646 	IMAGE_REL_PPC_TOCREL14                                                         = 0x0009
   7647 	IMAGE_REL_PPC_TOCREL16                                                         = 0x0008
   7648 	IMAGE_REL_PPC_TOKEN                                                            = 0x0016
   7649 	IMAGE_REL_PPC_TYPEMASK                                                         = 0x00FF
   7650 	IMAGE_REL_SH3_ABSOLUTE                                                         = 0x0000
   7651 	IMAGE_REL_SH3_DIRECT16                                                         = 0x0001
   7652 	IMAGE_REL_SH3_DIRECT32                                                         = 0x0002
   7653 	IMAGE_REL_SH3_DIRECT32_NB                                                      = 0x0010
   7654 	IMAGE_REL_SH3_DIRECT4                                                          = 0x0006
   7655 	IMAGE_REL_SH3_DIRECT4_LONG                                                     = 0x0008
   7656 	IMAGE_REL_SH3_DIRECT4_WORD                                                     = 0x0007
   7657 	IMAGE_REL_SH3_DIRECT8                                                          = 0x0003
   7658 	IMAGE_REL_SH3_DIRECT8_LONG                                                     = 0x0005
   7659 	IMAGE_REL_SH3_DIRECT8_WORD                                                     = 0x0004
   7660 	IMAGE_REL_SH3_GPREL4_LONG                                                      = 0x0011
   7661 	IMAGE_REL_SH3_PCREL12_WORD                                                     = 0x000B
   7662 	IMAGE_REL_SH3_PCREL8_LONG                                                      = 0x000A
   7663 	IMAGE_REL_SH3_PCREL8_WORD                                                      = 0x0009
   7664 	IMAGE_REL_SH3_SECREL                                                           = 0x000F
   7665 	IMAGE_REL_SH3_SECTION                                                          = 0x000E
   7666 	IMAGE_REL_SH3_SIZEOF_SECTION                                                   = 0x000D
   7667 	IMAGE_REL_SH3_STARTOF_SECTION                                                  = 0x000C
   7668 	IMAGE_REL_SH3_TOKEN                                                            = 0x0012
   7669 	IMAGE_REL_SHM_PAIR                                                             = 0x0018
   7670 	IMAGE_REL_SHM_PCRELPT                                                          = 0x0013
   7671 	IMAGE_REL_SHM_REFHALF                                                          = 0x0015
   7672 	IMAGE_REL_SHM_REFLO                                                            = 0x0014
   7673 	IMAGE_REL_SHM_RELHALF                                                          = 0x0017
   7674 	IMAGE_REL_SHM_RELLO                                                            = 0x0016
   7675 	IMAGE_REL_SH_NOMODE                                                            = 0x8000
   7676 	IMAGE_REL_THUMB_BLX23                                                          = 0x0015
   7677 	IMAGE_REL_THUMB_BRANCH20                                                       = 0x0012
   7678 	IMAGE_REL_THUMB_BRANCH24                                                       = 0x0014
   7679 	IMAGE_REL_THUMB_MOV32                                                          = 0x0011
   7680 	IMAGE_RESOURCE_DATA_IS_DIRECTORY                                               = 0x80000000
   7681 	IMAGE_RESOURCE_NAME_IS_STRING                                                  = 0x80000000
   7682 	IMAGE_ROM_OPTIONAL_HDR_MAGIC                                                   = 0x107
   7683 	IMAGE_SCN_ALIGN_1024BYTES                                                      = 0x00B00000
   7684 	IMAGE_SCN_ALIGN_128BYTES                                                       = 0x00800000
   7685 	IMAGE_SCN_ALIGN_16BYTES                                                        = 0x00500000
   7686 	IMAGE_SCN_ALIGN_1BYTES                                                         = 0x00100000
   7687 	IMAGE_SCN_ALIGN_2048BYTES                                                      = 0x00C00000
   7688 	IMAGE_SCN_ALIGN_256BYTES                                                       = 0x00900000
   7689 	IMAGE_SCN_ALIGN_2BYTES                                                         = 0x00200000
   7690 	IMAGE_SCN_ALIGN_32BYTES                                                        = 0x00600000
   7691 	IMAGE_SCN_ALIGN_4096BYTES                                                      = 0x00D00000
   7692 	IMAGE_SCN_ALIGN_4BYTES                                                         = 0x00300000
   7693 	IMAGE_SCN_ALIGN_512BYTES                                                       = 0x00A00000
   7694 	IMAGE_SCN_ALIGN_64BYTES                                                        = 0x00700000
   7695 	IMAGE_SCN_ALIGN_8192BYTES                                                      = 0x00E00000
   7696 	IMAGE_SCN_ALIGN_8BYTES                                                         = 0x00400000
   7697 	IMAGE_SCN_ALIGN_MASK                                                           = 0x00F00000
   7698 	IMAGE_SCN_CNT_CODE                                                             = 0x00000020
   7699 	IMAGE_SCN_CNT_INITIALIZED_DATA                                                 = 0x00000040
   7700 	IMAGE_SCN_CNT_UNINITIALIZED_DATA                                               = 0x00000080
   7701 	IMAGE_SCN_GPREL                                                                = 0x00008000
   7702 	IMAGE_SCN_LNK_COMDAT                                                           = 0x00001000
   7703 	IMAGE_SCN_LNK_INFO                                                             = 0x00000200
   7704 	IMAGE_SCN_LNK_NRELOC_OVFL                                                      = 0x01000000
   7705 	IMAGE_SCN_LNK_OTHER                                                            = 0x00000100
   7706 	IMAGE_SCN_LNK_REMOVE                                                           = 0x00000800
   7707 	IMAGE_SCN_MEM_16BIT                                                            = 0x00020000
   7708 	IMAGE_SCN_MEM_DISCARDABLE                                                      = 0x02000000
   7709 	IMAGE_SCN_MEM_EXECUTE                                                          = 0x20000000
   7710 	IMAGE_SCN_MEM_FARDATA                                                          = 0x00008000
   7711 	IMAGE_SCN_MEM_LOCKED                                                           = 0x00040000
   7712 	IMAGE_SCN_MEM_NOT_CACHED                                                       = 0x04000000
   7713 	IMAGE_SCN_MEM_NOT_PAGED                                                        = 0x08000000
   7714 	IMAGE_SCN_MEM_PRELOAD                                                          = 0x00080000
   7715 	IMAGE_SCN_MEM_PURGEABLE                                                        = 0x00020000
   7716 	IMAGE_SCN_MEM_READ                                                             = 0x40000000
   7717 	IMAGE_SCN_MEM_SHARED                                                           = 0x10000000
   7718 	IMAGE_SCN_MEM_WRITE                                                            = 0x80000000
   7719 	IMAGE_SCN_NO_DEFER_SPEC_EXC                                                    = 0x00004000
   7720 	IMAGE_SCN_SCALE_INDEX                                                          = 0x00000001
   7721 	IMAGE_SCN_TYPE_NO_PAD                                                          = 0x00000008
   7722 	IMAGE_SEPARATE_DEBUG_FLAGS_MASK                                                = 0x8000
   7723 	IMAGE_SEPARATE_DEBUG_MISMATCH                                                  = 0x8000
   7724 	IMAGE_SEPARATE_DEBUG_SIGNATURE                                                 = 0x4944
   7725 	IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR                                                = 60
   7726 	IMAGE_SIZEOF_AUX_SYMBOL                                                        = 18
   7727 	IMAGE_SIZEOF_BASE_RELOCATION                                                   = 8
   7728 	IMAGE_SIZEOF_FILE_HEADER                                                       = 20
   7729 	IMAGE_SIZEOF_LINENUMBER                                                        = 6
   7730 	IMAGE_SIZEOF_NT_OPTIONAL32_HEADER                                              = 224
   7731 	IMAGE_SIZEOF_NT_OPTIONAL64_HEADER                                              = 240
   7732 	IMAGE_SIZEOF_NT_OPTIONAL_HEADER                                                = 240
   7733 	IMAGE_SIZEOF_RELOCATION                                                        = 10
   7734 	IMAGE_SIZEOF_ROM_OPTIONAL_HEADER                                               = 56
   7735 	IMAGE_SIZEOF_SECTION_HEADER                                                    = 40
   7736 	IMAGE_SIZEOF_SHORT_NAME                                                        = 8
   7737 	IMAGE_SIZEOF_STD_OPTIONAL_HEADER                                               = 28
   7738 	IMAGE_SIZEOF_SYMBOL                                                            = 18
   7739 	IMAGE_SUBSYSTEM_EFI_APPLICATION                                                = 10
   7740 	IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER                                        = 11
   7741 	IMAGE_SUBSYSTEM_EFI_ROM                                                        = 13
   7742 	IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER                                             = 12
   7743 	IMAGE_SUBSYSTEM_NATIVE                                                         = 1
   7744 	IMAGE_SUBSYSTEM_NATIVE_WINDOWS                                                 = 8
   7745 	IMAGE_SUBSYSTEM_OS2_CUI                                                        = 5
   7746 	IMAGE_SUBSYSTEM_POSIX_CUI                                                      = 7
   7747 	IMAGE_SUBSYSTEM_UNKNOWN                                                        = 0
   7748 	IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION                                       = 16
   7749 	IMAGE_SUBSYSTEM_WINDOWS_CE_GUI                                                 = 9
   7750 	IMAGE_SUBSYSTEM_WINDOWS_CUI                                                    = 3
   7751 	IMAGE_SUBSYSTEM_WINDOWS_GUI                                                    = 2
   7752 	IMAGE_SUBSYSTEM_XBOX                                                           = 14
   7753 	IMAGE_SYM_CLASS_ARGUMENT                                                       = 0x0009
   7754 	IMAGE_SYM_CLASS_AUTOMATIC                                                      = 0x0001
   7755 	IMAGE_SYM_CLASS_BIT_FIELD                                                      = 0x0012
   7756 	IMAGE_SYM_CLASS_BLOCK                                                          = 0x0064
   7757 	IMAGE_SYM_CLASS_CLR_TOKEN                                                      = 0x006B
   7758 	IMAGE_SYM_CLASS_END_OF_STRUCT                                                  = 0x0066
   7759 	IMAGE_SYM_CLASS_ENUM_TAG                                                       = 0x000F
   7760 	IMAGE_SYM_CLASS_EXTERNAL                                                       = 0x0002
   7761 	IMAGE_SYM_CLASS_EXTERNAL_DEF                                                   = 0x0005
   7762 	IMAGE_SYM_CLASS_FAR_EXTERNAL                                                   = 0x0044
   7763 	IMAGE_SYM_CLASS_FILE                                                           = 0x0067
   7764 	IMAGE_SYM_CLASS_FUNCTION                                                       = 0x0065
   7765 	IMAGE_SYM_CLASS_LABEL                                                          = 0x0006
   7766 	IMAGE_SYM_CLASS_MEMBER_OF_ENUM                                                 = 0x0010
   7767 	IMAGE_SYM_CLASS_MEMBER_OF_STRUCT                                               = 0x0008
   7768 	IMAGE_SYM_CLASS_MEMBER_OF_UNION                                                = 0x000B
   7769 	IMAGE_SYM_CLASS_NULL                                                           = 0x0000
   7770 	IMAGE_SYM_CLASS_REGISTER                                                       = 0x0004
   7771 	IMAGE_SYM_CLASS_REGISTER_PARAM                                                 = 0x0011
   7772 	IMAGE_SYM_CLASS_SECTION                                                        = 0x0068
   7773 	IMAGE_SYM_CLASS_STATIC                                                         = 0x0003
   7774 	IMAGE_SYM_CLASS_STRUCT_TAG                                                     = 0x000A
   7775 	IMAGE_SYM_CLASS_TYPE_DEFINITION                                                = 0x000D
   7776 	IMAGE_SYM_CLASS_UNDEFINED_LABEL                                                = 0x0007
   7777 	IMAGE_SYM_CLASS_UNDEFINED_STATIC                                               = 0x000E
   7778 	IMAGE_SYM_CLASS_UNION_TAG                                                      = 0x000C
   7779 	IMAGE_SYM_CLASS_WEAK_EXTERNAL                                                  = 0x0069
   7780 	IMAGE_SYM_DTYPE_ARRAY                                                          = 3
   7781 	IMAGE_SYM_DTYPE_FUNCTION                                                       = 2
   7782 	IMAGE_SYM_DTYPE_NULL                                                           = 0
   7783 	IMAGE_SYM_DTYPE_POINTER                                                        = 1
   7784 	IMAGE_SYM_SECTION_MAX                                                          = 0xFEFF
   7785 	IMAGE_SYM_SECTION_MAX_EX                                                       = 2147483647
   7786 	IMAGE_SYM_TYPE_BYTE                                                            = 0x000C
   7787 	IMAGE_SYM_TYPE_CHAR                                                            = 0x0002
   7788 	IMAGE_SYM_TYPE_DOUBLE                                                          = 0x0007
   7789 	IMAGE_SYM_TYPE_DWORD                                                           = 0x000F
   7790 	IMAGE_SYM_TYPE_ENUM                                                            = 0x000A
   7791 	IMAGE_SYM_TYPE_FLOAT                                                           = 0x0006
   7792 	IMAGE_SYM_TYPE_INT                                                             = 0x0004
   7793 	IMAGE_SYM_TYPE_LONG                                                            = 0x0005
   7794 	IMAGE_SYM_TYPE_MOE                                                             = 0x000B
   7795 	IMAGE_SYM_TYPE_NULL                                                            = 0x0000
   7796 	IMAGE_SYM_TYPE_PCODE                                                           = 0x8000
   7797 	IMAGE_SYM_TYPE_SHORT                                                           = 0x0003
   7798 	IMAGE_SYM_TYPE_STRUCT                                                          = 0x0008
   7799 	IMAGE_SYM_TYPE_UINT                                                            = 0x000E
   7800 	IMAGE_SYM_TYPE_UNION                                                           = 0x0009
   7801 	IMAGE_SYM_TYPE_VOID                                                            = 0x0001
   7802 	IMAGE_SYM_TYPE_WORD                                                            = 0x000D
   7803 	IMAGE_VXD_SIGNATURE                                                            = 0x454C
   7804 	IMAGE_WEAK_EXTERN_SEARCH_ALIAS                                                 = 3
   7805 	IMAGE_WEAK_EXTERN_SEARCH_LIBRARY                                               = 2
   7806 	IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY                                             = 1
   7807 	IMC_CLOSESTATUSWINDOW                                                          = 0x0021
   7808 	IMC_GETCANDIDATEPOS                                                            = 0x0007
   7809 	IMC_GETCOMPOSITIONFONT                                                         = 0x0009
   7810 	IMC_GETCOMPOSITIONWINDOW                                                       = 0x000B
   7811 	IMC_GETSTATUSWINDOWPOS                                                         = 0x000F
   7812 	IMC_OPENSTATUSWINDOW                                                           = 0x0022
   7813 	IMC_SETCANDIDATEPOS                                                            = 0x0008
   7814 	IMC_SETCOMPOSITIONFONT                                                         = 0x000A
   7815 	IMC_SETCOMPOSITIONWINDOW                                                       = 0x000C
   7816 	IMC_SETSTATUSWINDOWPOS                                                         = 0x0010
   7817 	IMEMENUITEM_STRING_SIZE                                                        = 80
   7818 	IMEVER_0310                                                                    = 0x0003000A
   7819 	IMEVER_0400                                                                    = 0x00040000
   7820 	IME_CAND_CODE                                                                  = 0x0002
   7821 	IME_CAND_MEANING                                                               = 0x0003
   7822 	IME_CAND_RADICAL                                                               = 0x0004
   7823 	IME_CAND_READ                                                                  = 0x0001
   7824 	IME_CAND_STROKE                                                                = 0x0005
   7825 	IME_CAND_UNKNOWN                                                               = 0x0000
   7826 	IME_CHOTKEY_IME_NONIME_TOGGLE                                                  = 0x10
   7827 	IME_CHOTKEY_SHAPE_TOGGLE                                                       = 0x11
   7828 	IME_CHOTKEY_SYMBOL_TOGGLE                                                      = 0x12
   7829 	IME_CMODE_ALPHANUMERIC                                                         = 0x0000
   7830 	IME_CMODE_CHARCODE                                                             = 0x0020
   7831 	IME_CMODE_CHINESE                                                              = 1
   7832 	IME_CMODE_EUDC                                                                 = 0x0200
   7833 	IME_CMODE_FIXED                                                                = 0x0800
   7834 	IME_CMODE_FULLSHAPE                                                            = 0x0008
   7835 	IME_CMODE_HANGEUL                                                              = 1
   7836 	IME_CMODE_HANGUL                                                               = 1
   7837 	IME_CMODE_HANJACONVERT                                                         = 0x0040
   7838 	IME_CMODE_JAPANESE                                                             = 1
   7839 	IME_CMODE_KATAKANA                                                             = 0x0002
   7840 	IME_CMODE_LANGUAGE                                                             = 0x0003
   7841 	IME_CMODE_NATIVE                                                               = 0x0001
   7842 	IME_CMODE_NOCONVERSION                                                         = 0x0100
   7843 	IME_CMODE_RESERVED                                                             = 0xF0000000
   7844 	IME_CMODE_ROMAN                                                                = 0x0010
   7845 	IME_CMODE_SOFTKBD                                                              = 0x0080
   7846 	IME_CMODE_SYMBOL                                                               = 0x0400
   7847 	IME_CONFIG_GENERAL                                                             = 1
   7848 	IME_CONFIG_REGISTERWORD                                                        = 2
   7849 	IME_CONFIG_SELECTDICTIONARY                                                    = 3
   7850 	IME_ESC_AUTOMATA                                                               = 0x1009
   7851 	IME_ESC_GETHELPFILENAME                                                        = 0x100b
   7852 	IME_ESC_GET_EUDC_DICTIONARY                                                    = 0x1003
   7853 	IME_ESC_HANJA_MODE                                                             = 0x1008
   7854 	IME_ESC_IME_NAME                                                               = 0x1006
   7855 	IME_ESC_MAX_KEY                                                                = 0x1005
   7856 	IME_ESC_PRIVATE_FIRST                                                          = 0x0800
   7857 	IME_ESC_PRIVATE_HOTKEY                                                         = 0x100a
   7858 	IME_ESC_PRIVATE_LAST                                                           = 0x0FFF
   7859 	IME_ESC_QUERY_SUPPORT                                                          = 0x0003
   7860 	IME_ESC_RESERVED_FIRST                                                         = 0x0004
   7861 	IME_ESC_RESERVED_LAST                                                          = 0x07FF
   7862 	IME_ESC_SEQUENCE_TO_INTERNAL                                                   = 0x1001
   7863 	IME_ESC_SET_EUDC_DICTIONARY                                                    = 0x1004
   7864 	IME_ESC_SYNC_HOTKEY                                                            = 0x1007
   7865 	IME_HOTKEY_DSWITCH_FIRST                                                       = 0x100
   7866 	IME_HOTKEY_DSWITCH_LAST                                                        = 0x11F
   7867 	IME_HOTKEY_PRIVATE_FIRST                                                       = 0x200
   7868 	IME_HOTKEY_PRIVATE_LAST                                                        = 0x21F
   7869 	IME_ITHOTKEY_PREVIOUS_COMPOSITION                                              = 0x201
   7870 	IME_ITHOTKEY_RECONVERTSTRING                                                   = 0x203
   7871 	IME_ITHOTKEY_RESEND_RESULTSTR                                                  = 0x200
   7872 	IME_ITHOTKEY_UISTYLE_TOGGLE                                                    = 0x202
   7873 	IME_JHOTKEY_CLOSE_OPEN                                                         = 0x30
   7874 	IME_KHOTKEY_ENGLISH                                                            = 0x52
   7875 	IME_KHOTKEY_HANJACONVERT                                                       = 0x51
   7876 	IME_KHOTKEY_SHAPE_TOGGLE                                                       = 0x50
   7877 	IME_PROP_AT_CARET                                                              = 0x00010000
   7878 	IME_PROP_CANDLIST_START_FROM_1                                                 = 0x00040000
   7879 	IME_PROP_COMPLETE_ON_UNSELECT                                                  = 0x00100000
   7880 	IME_PROP_SPECIAL_UI                                                            = 0x00020000
   7881 	IME_PROP_UNICODE                                                               = 0x00080000
   7882 	IME_REGWORD_STYLE_EUDC                                                         = 0x00000001
   7883 	IME_REGWORD_STYLE_USER_FIRST                                                   = 0x80000000
   7884 	IME_REGWORD_STYLE_USER_LAST                                                    = 0xFFFFFFFF
   7885 	IME_SMODE_AUTOMATIC                                                            = 0x0004
   7886 	IME_SMODE_CONVERSATION                                                         = 0x0010
   7887 	IME_SMODE_NONE                                                                 = 0x0000
   7888 	IME_SMODE_PHRASEPREDICT                                                        = 0x0008
   7889 	IME_SMODE_PLAURALCLAUSE                                                        = 0x0001
   7890 	IME_SMODE_RESERVED                                                             = 0x0000F000
   7891 	IME_SMODE_SINGLECONVERT                                                        = 0x0002
   7892 	IME_THOTKEY_IME_NONIME_TOGGLE                                                  = 0x70
   7893 	IME_THOTKEY_SHAPE_TOGGLE                                                       = 0x71
   7894 	IME_THOTKEY_SYMBOL_TOGGLE                                                      = 0x72
   7895 	IMFS_CHECKED                                                                   = 8
   7896 	IMFS_DEFAULT                                                                   = 4096
   7897 	IMFS_DISABLED                                                                  = 3
   7898 	IMFS_ENABLED                                                                   = 0
   7899 	IMFS_GRAYED                                                                    = 3
   7900 	IMFS_HILITE                                                                    = 128
   7901 	IMFS_UNCHECKED                                                                 = 0
   7902 	IMFS_UNHILITE                                                                  = 0
   7903 	IMFT_RADIOCHECK                                                                = 0x00001
   7904 	IMFT_SEPARATOR                                                                 = 0x00002
   7905 	IMFT_SUBMENU                                                                   = 0x00004
   7906 	IMM_ERROR_GENERAL                                                              = -2
   7907 	IMM_ERROR_NODATA                                                               = -1
   7908 	IMN_CHANGECANDIDATE                                                            = 0x0003
   7909 	IMN_CLOSECANDIDATE                                                             = 0x0004
   7910 	IMN_CLOSESTATUSWINDOW                                                          = 0x0001
   7911 	IMN_GUIDELINE                                                                  = 0x000D
   7912 	IMN_OPENCANDIDATE                                                              = 0x0005
   7913 	IMN_OPENSTATUSWINDOW                                                           = 0x0002
   7914 	IMN_PRIVATE                                                                    = 0x000E
   7915 	IMN_SETCANDIDATEPOS                                                            = 0x0009
   7916 	IMN_SETCOMPOSITIONFONT                                                         = 0x000A
   7917 	IMN_SETCOMPOSITIONWINDOW                                                       = 0x000B
   7918 	IMN_SETCONVERSIONMODE                                                          = 0x0006
   7919 	IMN_SETOPENSTATUS                                                              = 0x0008
   7920 	IMN_SETSENTENCEMODE                                                            = 0x0007
   7921 	IMN_SETSTATUSWINDOWPOS                                                         = 0x000C
   7922 	IMPLINK_HIGHEXPER                                                              = 158
   7923 	IMPLINK_IP                                                                     = 155
   7924 	IMPLINK_LOWEXPER                                                               = 156
   7925 	IMPLTYPEFLAG_FDEFAULT                                                          = 1
   7926 	IMPLTYPEFLAG_FDEFAULTVTABLE                                                    = 8
   7927 	IMPLTYPEFLAG_FRESTRICTED                                                       = 4
   7928 	IMPLTYPEFLAG_FSOURCE                                                           = 2
   7929 	IMPORT_OBJECT_HDR_SIG2                                                         = 0xffff
   7930 	IMR_CANDIDATEWINDOW                                                            = 0x0002
   7931 	IMR_COMPOSITIONFONT                                                            = 0x0003
   7932 	IMR_COMPOSITIONWINDOW                                                          = 0x0001
   7933 	IMR_CONFIRMRECONVERTSTRING                                                     = 0x0005
   7934 	IMR_DOCUMENTFEED                                                               = 0x0007
   7935 	IMR_QUERYCHARPOSITION                                                          = 0x0006
   7936 	IMR_RECONVERTSTRING                                                            = 0x0004
   7937 	IN                                                                             = 0
   7938 	INADDR_LOOPBACK                                                                = 0x7f000001
   7939 	INADDR_NONE                                                                    = 0xffffffff
   7940 	INCRINIT_NORMAL                                                                = 0
   7941 	INCRINIT_ROOT                                                                  = 2
   7942 	INCRINIT_TASK                                                                  = 1
   7943 	INDEXID_CONTAINER                                                              = 0
   7944 	INDEXID_OBJECT                                                                 = 0
   7945 	INFINITE                                                                       = 0xffffffff
   7946 	INHERITED_ACE                                                                  = 16
   7947 	INHERIT_CALLER_PRIORITY                                                        = 0x20000
   7948 	INHERIT_ONLY_ACE                                                               = 8
   7949 	INHERIT_PARENT_AFFINITY                                                        = 0x10000
   7950 	INITFLAG_AlterAdd                                                              = 0x0003
   7951 	INITFLAG_AlterDrop                                                             = 0x0002
   7952 	INITFLAG_AlterMask                                                             = 0x0003
   7953 	INITFLAG_AlterRename                                                           = 0x0001
   7954 	INITIAL_FPCSR                                                                  = 0x027f
   7955 	INITIAL_MXCSR                                                                  = 0x1f80
   7956 	INIT_ONCE_ASYNC                                                                = 2
   7957 	INIT_ONCE_CHECK_ONLY                                                           = 1
   7958 	INIT_ONCE_CTX_RESERVED_BITS                                                    = 2
   7959 	INIT_ONCE_INIT_FAILED                                                          = 4
   7960 	INLINEFUNC_affinity                                                            = 4
   7961 	INLINEFUNC_coalesce                                                            = 0
   7962 	INLINEFUNC_expr_compare                                                        = 3
   7963 	INLINEFUNC_expr_implies_expr                                                   = 2
   7964 	INLINEFUNC_iif                                                                 = 5
   7965 	INLINEFUNC_implies_nonnull_row                                                 = 1
   7966 	INLINEFUNC_sqlite_offset                                                       = 6
   7967 	INLINEFUNC_unlikely                                                            = 99
   7968 	INPLACE_E_FIRST                                                                = 2147746208
   7969 	INPLACE_E_LAST                                                                 = 2147746223
   7970 	INPLACE_S_FIRST                                                                = 262560
   7971 	INPLACE_S_LAST                                                                 = 262575
   7972 	INPUTLANGCHANGE_BACKWARD                                                       = 0x0004
   7973 	INPUTLANGCHANGE_FORWARD                                                        = 0x0002
   7974 	INPUTLANGCHANGE_SYSCHARSET                                                     = 0x0001
   7975 	INPUT_HARDWARE                                                                 = 2
   7976 	INPUT_KEYBOARD                                                                 = 1
   7977 	INPUT_MOUSE                                                                    = 0
   7978 	INTERNATIONAL_USAGE                                                            = 0x1
   7979 	INT_MAX                                                                        = 2147483647
   7980 	INT_MIN                                                                        = -2147483648
   7981 	INVALID_OS_COUNT                                                               = 65535
   7982 	IN_CLASSA_HOST                                                                 = 0x00ffffff
   7983 	IN_CLASSA_MAX                                                                  = 128
   7984 	IN_CLASSA_NET                                                                  = 0xff000000
   7985 	IN_CLASSA_NSHIFT                                                               = 24
   7986 	IN_CLASSB_HOST                                                                 = 0x0000ffff
   7987 	IN_CLASSB_MAX                                                                  = 65536
   7988 	IN_CLASSB_NET                                                                  = 0xffff0000
   7989 	IN_CLASSB_NSHIFT                                                               = 16
   7990 	IN_CLASSC_HOST                                                                 = 0x000000ff
   7991 	IN_CLASSC_NET                                                                  = 0xffffff00
   7992 	IN_CLASSC_NSHIFT                                                               = 8
   7993 	IN_INDEX_EPH                                                                   = 2
   7994 	IN_INDEX_INDEX_ASC                                                             = 3
   7995 	IN_INDEX_INDEX_DESC                                                            = 4
   7996 	IN_INDEX_LOOP                                                                  = 0x0004
   7997 	IN_INDEX_MEMBERSHIP                                                            = 0x0002
   7998 	IN_INDEX_NOOP                                                                  = 5
   7999 	IN_INDEX_NOOP_OK                                                               = 0x0001
   8000 	IN_INDEX_ROWID                                                                 = 1
   8001 	IOCPARM_MASK                                                                   = 0x7f
   8002 	IOCTL_CHANGER_BASE                                                             = 48
   8003 	IOCTL_CHANGER_EXCHANGE_MEDIUM                                                  = 3162144
   8004 	IOCTL_CHANGER_GET_ELEMENT_STATUS                                               = 3194900
   8005 	IOCTL_CHANGER_GET_PARAMETERS                                                   = 3162112
   8006 	IOCTL_CHANGER_GET_PRODUCT_DATA                                                 = 3162120
   8007 	IOCTL_CHANGER_GET_STATUS                                                       = 3162116
   8008 	IOCTL_CHANGER_INITIALIZE_ELEMENT_STATUS                                        = 3162136
   8009 	IOCTL_CHANGER_MOVE_MEDIUM                                                      = 3162148
   8010 	IOCTL_CHANGER_QUERY_VOLUME_TAGS                                                = 3194924
   8011 	IOCTL_CHANGER_REINITIALIZE_TRANSPORT                                           = 3162152
   8012 	IOCTL_CHANGER_SET_ACCESS                                                       = 3194896
   8013 	IOCTL_CHANGER_SET_POSITION                                                     = 3162140
   8014 	IOCTL_DISK_BASE                                                                = 7
   8015 	IOCTL_DISK_CHECK_VERIFY                                                        = 477184
   8016 	IOCTL_DISK_CONTROLLER_NUMBER                                                   = 458820
   8017 	IOCTL_DISK_CREATE_DISK                                                         = 507992
   8018 	IOCTL_DISK_DELETE_DRIVE_LAYOUT                                                 = 508160
   8019 	IOCTL_DISK_EJECT_MEDIA                                                         = 477192
   8020 	IOCTL_DISK_FIND_NEW_DEVICES                                                    = 477208
   8021 	IOCTL_DISK_FORMAT_DRIVE                                                        = 508876
   8022 	IOCTL_DISK_FORMAT_TRACKS                                                       = 507928
   8023 	IOCTL_DISK_FORMAT_TRACKS_EX                                                    = 507948
   8024 	IOCTL_DISK_GET_CACHE_INFORMATION                                               = 475348
   8025 	IOCTL_DISK_GET_DRIVE_GEOMETRY                                                  = 458752
   8026 	IOCTL_DISK_GET_DRIVE_GEOMETRY_EX                                               = 458912
   8027 	IOCTL_DISK_GET_DRIVE_LAYOUT                                                    = 475148
   8028 	IOCTL_DISK_GET_DRIVE_LAYOUT_EX                                                 = 458832
   8029 	IOCTL_DISK_GET_LENGTH_INFO                                                     = 475228
   8030 	IOCTL_DISK_GET_MEDIA_TYPES                                                     = 461824
   8031 	IOCTL_DISK_GET_PARTITION_INFO                                                  = 475140
   8032 	IOCTL_DISK_GET_PARTITION_INFO_EX                                               = 458824
   8033 	IOCTL_DISK_GROW_PARTITION                                                      = 508112
   8034 	IOCTL_DISK_HISTOGRAM_DATA                                                      = 458804
   8035 	IOCTL_DISK_HISTOGRAM_RESET                                                     = 458808
   8036 	IOCTL_DISK_HISTOGRAM_STRUCTURE                                                 = 458800
   8037 	IOCTL_DISK_IS_WRITABLE                                                         = 458788
   8038 	IOCTL_DISK_LOAD_MEDIA                                                          = 477196
   8039 	IOCTL_DISK_LOGGING                                                             = 458792
   8040 	IOCTL_DISK_MEDIA_REMOVAL                                                       = 477188
   8041 	IOCTL_DISK_PERFORMANCE                                                         = 458784
   8042 	IOCTL_DISK_PERFORMANCE_OFF                                                     = 458848
   8043 	IOCTL_DISK_REASSIGN_BLOCKS                                                     = 507932
   8044 	IOCTL_DISK_REASSIGN_BLOCKS_EX                                                  = 508068
   8045 	IOCTL_DISK_RELEASE                                                             = 477204
   8046 	IOCTL_DISK_REQUEST_DATA                                                        = 458816
   8047 	IOCTL_DISK_REQUEST_STRUCTURE                                                   = 458812
   8048 	IOCTL_DISK_RESERVE                                                             = 477200
   8049 	IOCTL_DISK_RESET_SNAPSHOT_INFO                                                 = 508432
   8050 	IOCTL_DISK_SENSE_DEVICE                                                        = 459744
   8051 	IOCTL_DISK_SET_CACHE_INFORMATION                                               = 508120
   8052 	IOCTL_DISK_SET_DRIVE_LAYOUT                                                    = 507920
   8053 	IOCTL_DISK_SET_DRIVE_LAYOUT_EX                                                 = 507988
   8054 	IOCTL_DISK_SET_PARTITION_INFO                                                  = 507912
   8055 	IOCTL_DISK_SET_PARTITION_INFO_EX                                               = 507980
   8056 	IOCTL_DISK_UPDATE_DRIVE_SIZE                                                   = 508104
   8057 	IOCTL_DISK_UPDATE_PROPERTIES                                                   = 459072
   8058 	IOCTL_DISK_VERIFY                                                              = 458772
   8059 	IOCTL_SERENUM_EXPOSE_HARDWARE                                                  = 3604992
   8060 	IOCTL_SERENUM_GET_PORT_NAME                                                    = 3605004
   8061 	IOCTL_SERENUM_PORT_DESC                                                        = 3605000
   8062 	IOCTL_SERENUM_REMOVE_HARDWARE                                                  = 3604996
   8063 	IOCTL_SERIAL_LSRMST_INSERT                                                     = 1769596
   8064 	IOCTL_SMARTCARD_CONFISCATE                                                     = 3211280
   8065 	IOCTL_SMARTCARD_EJECT                                                          = 3211288
   8066 	IOCTL_SMARTCARD_GET_ATTRIBUTE                                                  = 3211272
   8067 	IOCTL_SMARTCARD_GET_LAST_ERROR                                                 = 3211324
   8068 	IOCTL_SMARTCARD_GET_PERF_CNTR                                                  = 3211328
   8069 	IOCTL_SMARTCARD_GET_STATE                                                      = 3211320
   8070 	IOCTL_SMARTCARD_IS_ABSENT                                                      = 3211308
   8071 	IOCTL_SMARTCARD_IS_PRESENT                                                     = 3211304
   8072 	IOCTL_SMARTCARD_POWER                                                          = 3211268
   8073 	IOCTL_SMARTCARD_SET_ATTRIBUTE                                                  = 3211276
   8074 	IOCTL_SMARTCARD_SET_PROTOCOL                                                   = 3211312
   8075 	IOCTL_SMARTCARD_SWALLOW                                                        = 3211292
   8076 	IOCTL_SMARTCARD_TRANSMIT                                                       = 3211284
   8077 	IOCTL_STORAGE_BASE                                                             = 45
   8078 	IOCTL_STORAGE_BREAK_RESERVATION                                                = 2969620
   8079 	IOCTL_STORAGE_CHECK_VERIFY                                                     = 2967552
   8080 	IOCTL_STORAGE_CHECK_VERIFY2                                                    = 2951168
   8081 	IOCTL_STORAGE_EJECTION_CONTROL                                                 = 2951488
   8082 	IOCTL_STORAGE_EJECT_MEDIA                                                      = 2967560
   8083 	IOCTL_STORAGE_FIND_NEW_DEVICES                                                 = 2967576
   8084 	IOCTL_STORAGE_GET_DEVICE_NUMBER                                                = 2953344
   8085 	IOCTL_STORAGE_GET_HOTPLUG_INFO                                                 = 2952212
   8086 	IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER                                          = 2952208
   8087 	IOCTL_STORAGE_GET_MEDIA_TYPES                                                  = 2952192
   8088 	IOCTL_STORAGE_GET_MEDIA_TYPES_EX                                               = 2952196
   8089 	IOCTL_STORAGE_LOAD_MEDIA                                                       = 2967564
   8090 	IOCTL_STORAGE_LOAD_MEDIA2                                                      = 2951180
   8091 	IOCTL_STORAGE_MCN_CONTROL                                                      = 2951492
   8092 	IOCTL_STORAGE_MEDIA_REMOVAL                                                    = 2967556
   8093 	IOCTL_STORAGE_PREDICT_FAILURE                                                  = 2953472
   8094 	IOCTL_STORAGE_QUERY_PROPERTY                                                   = 2954240
   8095 	IOCTL_STORAGE_READ_CAPACITY                                                    = 2969920
   8096 	IOCTL_STORAGE_RELEASE                                                          = 2967572
   8097 	IOCTL_STORAGE_RESERVE                                                          = 2967568
   8098 	IOCTL_STORAGE_RESET_BUS                                                        = 2969600
   8099 	IOCTL_STORAGE_RESET_DEVICE                                                     = 2969604
   8100 	IOCTL_STORAGE_SET_HOTPLUG_INFO                                                 = 3001368
   8101 	IOC_IN                                                                         = 0x80000000
   8102 	IOC_INOUT                                                                      = 3221225472
   8103 	IOC_OUT                                                                        = 0x40000000
   8104 	IOC_VOID                                                                       = 0x20000000
   8105 	IO_COMPLETION_ALL_ACCESS                                                       = 2031619
   8106 	IO_COMPLETION_MODIFY_STATE                                                     = 0x0002
   8107 	IO_REPARSE_TAG_AF_UNIX                                                         = 2147483683
   8108 	IO_REPARSE_TAG_APPEXECLINK                                                     = 2147483675
   8109 	IO_REPARSE_TAG_CLOUD                                                           = 2415919130
   8110 	IO_REPARSE_TAG_CLOUD_1                                                         = 2415923226
   8111 	IO_REPARSE_TAG_CLOUD_2                                                         = 2415927322
   8112 	IO_REPARSE_TAG_CLOUD_3                                                         = 2415931418
   8113 	IO_REPARSE_TAG_CLOUD_4                                                         = 2415935514
   8114 	IO_REPARSE_TAG_CLOUD_5                                                         = 2415939610
   8115 	IO_REPARSE_TAG_CLOUD_6                                                         = 2415943706
   8116 	IO_REPARSE_TAG_CLOUD_7                                                         = 2415947802
   8117 	IO_REPARSE_TAG_CLOUD_8                                                         = 2415951898
   8118 	IO_REPARSE_TAG_CLOUD_9                                                         = 2415955994
   8119 	IO_REPARSE_TAG_CLOUD_A                                                         = 2415960090
   8120 	IO_REPARSE_TAG_CLOUD_B                                                         = 2415964186
   8121 	IO_REPARSE_TAG_CLOUD_C                                                         = 2415968282
   8122 	IO_REPARSE_TAG_CLOUD_D                                                         = 2415972378
   8123 	IO_REPARSE_TAG_CLOUD_E                                                         = 2415976474
   8124 	IO_REPARSE_TAG_CLOUD_F                                                         = 2415980570
   8125 	IO_REPARSE_TAG_CLOUD_MASK                                                      = 61440
   8126 	IO_REPARSE_TAG_CSV                                                             = 2147483657
   8127 	IO_REPARSE_TAG_DEDUP                                                           = 2147483667
   8128 	IO_REPARSE_TAG_DFS                                                             = 2147483658
   8129 	IO_REPARSE_TAG_DFSR                                                            = 2147483666
   8130 	IO_REPARSE_TAG_DRIVE_EXTENDER                                                  = 2147483653
   8131 	IO_REPARSE_TAG_FILE_PLACEHOLDER                                                = 2147483669
   8132 	IO_REPARSE_TAG_FILTER_MANAGER                                                  = 2147483659
   8133 	IO_REPARSE_TAG_GLOBAL_REPARSE                                                  = 2684354585
   8134 	IO_REPARSE_TAG_HSM                                                             = 3221225476
   8135 	IO_REPARSE_TAG_HSM2                                                            = 2147483654
   8136 	IO_REPARSE_TAG_IIS_CACHE                                                       = 2684354576
   8137 	IO_REPARSE_TAG_MOUNT_POINT                                                     = 2684354563
   8138 	IO_REPARSE_TAG_NFS                                                             = 2147483668
   8139 	IO_REPARSE_TAG_ONEDRIVE                                                        = 2147483681
   8140 	IO_REPARSE_TAG_PROJFS                                                          = 2415919132
   8141 	IO_REPARSE_TAG_PROJFS_TOMBSTONE                                                = 2684354594
   8142 	IO_REPARSE_TAG_RESERVED_ONE                                                    = 1
   8143 	IO_REPARSE_TAG_RESERVED_RANGE                                                  = 1
   8144 	IO_REPARSE_TAG_RESERVED_ZERO                                                   = 0
   8145 	IO_REPARSE_TAG_SIS                                                             = 2147483655
   8146 	IO_REPARSE_TAG_STORAGE_SYNC                                                    = 2147483678
   8147 	IO_REPARSE_TAG_SYMLINK                                                         = 2684354572
   8148 	IO_REPARSE_TAG_UNHANDLED                                                       = 2147483680
   8149 	IO_REPARSE_TAG_WCI                                                             = 2147483672
   8150 	IO_REPARSE_TAG_WCI_1                                                           = 2415923224
   8151 	IO_REPARSE_TAG_WCI_TOMBSTONE                                                   = 2684354591
   8152 	IO_REPARSE_TAG_WIM                                                             = 2147483656
   8153 	IO_REPARSE_TAG_WOF                                                             = 2147483671
   8154 	IPPORT_BIFFUDP                                                                 = 512
   8155 	IPPORT_CMDSERVER                                                               = 514
   8156 	IPPORT_DAYTIME                                                                 = 13
   8157 	IPPORT_DISCARD                                                                 = 9
   8158 	IPPORT_ECHO                                                                    = 7
   8159 	IPPORT_EFSSERVER                                                               = 520
   8160 	IPPORT_EXECSERVER                                                              = 512
   8161 	IPPORT_FINGER                                                                  = 79
   8162 	IPPORT_FTP                                                                     = 21
   8163 	IPPORT_LOGINSERVER                                                             = 513
   8164 	IPPORT_MTP                                                                     = 57
   8165 	IPPORT_NAMESERVER                                                              = 42
   8166 	IPPORT_NETSTAT                                                                 = 15
   8167 	IPPORT_RESERVED                                                                = 1024
   8168 	IPPORT_RJE                                                                     = 77
   8169 	IPPORT_ROUTESERVER                                                             = 520
   8170 	IPPORT_SMTP                                                                    = 25
   8171 	IPPORT_SUPDUP                                                                  = 95
   8172 	IPPORT_SYSTAT                                                                  = 11
   8173 	IPPORT_TELNET                                                                  = 23
   8174 	IPPORT_TFTP                                                                    = 69
   8175 	IPPORT_TIMESERVER                                                              = 37
   8176 	IPPORT_TTYLINK                                                                 = 87
   8177 	IPPORT_WHOIS                                                                   = 43
   8178 	IPPORT_WHOSERVER                                                               = 513
   8179 	IPPROTO_GGP                                                                    = 3
   8180 	IPPROTO_ICMP                                                                   = 1
   8181 	IPPROTO_IDP                                                                    = 22
   8182 	IPPROTO_IGMP                                                                   = 2
   8183 	IPPROTO_IP                                                                     = 0
   8184 	IPPROTO_MAX                                                                    = 256
   8185 	IPPROTO_ND                                                                     = 77
   8186 	IPPROTO_PUP                                                                    = 12
   8187 	IPPROTO_RAW                                                                    = 255
   8188 	IPPROTO_TCP                                                                    = 6
   8189 	IPPROTO_UDP                                                                    = 17
   8190 	IP_ADD_MEMBERSHIP                                                              = 5
   8191 	IP_DEFAULT_MULTICAST_LOOP                                                      = 1
   8192 	IP_DEFAULT_MULTICAST_TTL                                                       = 1
   8193 	IP_DONTFRAGMENT                                                                = 9
   8194 	IP_DROP_MEMBERSHIP                                                             = 6
   8195 	IP_MAX_MEMBERSHIPS                                                             = 20
   8196 	IP_MULTICAST_IF                                                                = 2
   8197 	IP_MULTICAST_LOOP                                                              = 4
   8198 	IP_MULTICAST_TTL                                                               = 3
   8199 	IP_OPTIONS                                                                     = 1
   8200 	IP_TOS                                                                         = 8
   8201 	IP_TTL                                                                         = 7
   8202 	ISC_SHOWUIALL                                                                  = 0xC000000F
   8203 	ISC_SHOWUIALLCANDIDATEWINDOW                                                   = 0x0000000F
   8204 	ISC_SHOWUICANDIDATEWINDOW                                                      = 0x00000001
   8205 	ISC_SHOWUICOMPOSITIONWINDOW                                                    = 0x80000000
   8206 	ISC_SHOWUIGUIDELINE                                                            = 0x40000000
   8207 	ISMEX_CALLBACK                                                                 = 0x00000004
   8208 	ISMEX_NOSEND                                                                   = 0x00000000
   8209 	ISMEX_NOTIFY                                                                   = 0x00000002
   8210 	ISMEX_REPLIED                                                                  = 0x00000008
   8211 	ISMEX_SEND                                                                     = 0x00000001
   8212 	IS_TEXT_UNICODE_ASCII16                                                        = 0x0001
   8213 	IS_TEXT_UNICODE_CONTROLS                                                       = 0x0004
   8214 	IS_TEXT_UNICODE_DBCS_LEADBYTE                                                  = 0x0400
   8215 	IS_TEXT_UNICODE_ILLEGAL_CHARS                                                  = 0x0100
   8216 	IS_TEXT_UNICODE_NOT_ASCII_MASK                                                 = 0xF000
   8217 	IS_TEXT_UNICODE_NOT_UNICODE_MASK                                               = 0x0F00
   8218 	IS_TEXT_UNICODE_NULL_BYTES                                                     = 0x1000
   8219 	IS_TEXT_UNICODE_ODD_LENGTH                                                     = 0x0200
   8220 	IS_TEXT_UNICODE_REVERSE_ASCII16                                                = 0x0010
   8221 	IS_TEXT_UNICODE_REVERSE_CONTROLS                                               = 0x0040
   8222 	IS_TEXT_UNICODE_REVERSE_MASK                                                   = 0x00F0
   8223 	IS_TEXT_UNICODE_REVERSE_SIGNATURE                                              = 0x0080
   8224 	IS_TEXT_UNICODE_REVERSE_STATISTICS                                             = 0x0020
   8225 	IS_TEXT_UNICODE_SIGNATURE                                                      = 0x0008
   8226 	IS_TEXT_UNICODE_STATISTICS                                                     = 0x0002
   8227 	IS_TEXT_UNICODE_UNICODE_MASK                                                   = 0x000F
   8228 	ITALIC_FONTTYPE                                                                = 0x200
   8229 	IsStat4                                                                        = 1
   8230 	JEACH_ATOM                                                                     = 3
   8231 	JEACH_FULLKEY                                                                  = 6
   8232 	JEACH_ID                                                                       = 4
   8233 	JEACH_JSON                                                                     = 8
   8234 	JEACH_KEY                                                                      = 0
   8235 	JEACH_PARENT                                                                   = 5
   8236 	JEACH_PATH                                                                     = 7
   8237 	JEACH_ROOT                                                                     = 9
   8238 	JEACH_TYPE                                                                     = 2
   8239 	JEACH_VALUE                                                                    = 1
   8240 	JNODE_APPEND                                                                   = 0x20
   8241 	JNODE_ESCAPE                                                                   = 0x02
   8242 	JNODE_LABEL                                                                    = 0x40
   8243 	JNODE_PATCH                                                                    = 0x10
   8244 	JNODE_RAW                                                                      = 0x01
   8245 	JNODE_REMOVE                                                                   = 0x04
   8246 	JNODE_REPLACE                                                                  = 0x08
   8247 	JOB_ACCESS_ADMINISTER                                                          = 0x00000010
   8248 	JOB_ACCESS_READ                                                                = 0x00000020
   8249 	JOB_ALL_ACCESS                                                                 = 983088
   8250 	JOB_CONTROL_CANCEL                                                             = 3
   8251 	JOB_CONTROL_DELETE                                                             = 5
   8252 	JOB_CONTROL_LAST_PAGE_EJECTED                                                  = 7
   8253 	JOB_CONTROL_PAUSE                                                              = 1
   8254 	JOB_CONTROL_RESTART                                                            = 4
   8255 	JOB_CONTROL_RESUME                                                             = 2
   8256 	JOB_CONTROL_SENT_TO_PRINTER                                                    = 6
   8257 	JOB_EXECUTE                                                                    = 131088
   8258 	JOB_NOTIFY_FIELD_BYTES_PRINTED                                                 = 0x17
   8259 	JOB_NOTIFY_FIELD_DATATYPE                                                      = 0x05
   8260 	JOB_NOTIFY_FIELD_DEVMODE                                                       = 0x09
   8261 	JOB_NOTIFY_FIELD_DOCUMENT                                                      = 0x0D
   8262 	JOB_NOTIFY_FIELD_DRIVER_NAME                                                   = 0x08
   8263 	JOB_NOTIFY_FIELD_MACHINE_NAME                                                  = 0x01
   8264 	JOB_NOTIFY_FIELD_NOTIFY_NAME                                                   = 0x04
   8265 	JOB_NOTIFY_FIELD_PAGES_PRINTED                                                 = 0x15
   8266 	JOB_NOTIFY_FIELD_PARAMETERS                                                    = 0x07
   8267 	JOB_NOTIFY_FIELD_PORT_NAME                                                     = 0x02
   8268 	JOB_NOTIFY_FIELD_POSITION                                                      = 0x0F
   8269 	JOB_NOTIFY_FIELD_PRINTER_NAME                                                  = 0x00
   8270 	JOB_NOTIFY_FIELD_PRINT_PROCESSOR                                               = 0x06
   8271 	JOB_NOTIFY_FIELD_PRIORITY                                                      = 0x0E
   8272 	JOB_NOTIFY_FIELD_SECURITY_DESCRIPTOR                                           = 0x0C
   8273 	JOB_NOTIFY_FIELD_START_TIME                                                    = 0x11
   8274 	JOB_NOTIFY_FIELD_STATUS                                                        = 0x0A
   8275 	JOB_NOTIFY_FIELD_STATUS_STRING                                                 = 0x0B
   8276 	JOB_NOTIFY_FIELD_SUBMITTED                                                     = 0x10
   8277 	JOB_NOTIFY_FIELD_TIME                                                          = 0x13
   8278 	JOB_NOTIFY_FIELD_TOTAL_BYTES                                                   = 0x16
   8279 	JOB_NOTIFY_FIELD_TOTAL_PAGES                                                   = 0x14
   8280 	JOB_NOTIFY_FIELD_UNTIL_TIME                                                    = 0x12
   8281 	JOB_NOTIFY_FIELD_USER_NAME                                                     = 0x03
   8282 	JOB_NOTIFY_TYPE                                                                = 0x01
   8283 	JOB_OBJECT_ALL_ACCESS                                                          = 2031647
   8284 	JOB_OBJECT_ASSIGN_PROCESS                                                      = 1
   8285 	JOB_OBJECT_BASIC_LIMIT_VALID_FLAGS                                             = 0x000000ff
   8286 	JOB_OBJECT_CPU_RATE_CONTROL_ENABLE                                             = 0x1
   8287 	JOB_OBJECT_CPU_RATE_CONTROL_HARD_CAP                                           = 0x4
   8288 	JOB_OBJECT_CPU_RATE_CONTROL_NOTIFY                                             = 0x8
   8289 	JOB_OBJECT_CPU_RATE_CONTROL_VALID_FLAGS                                        = 0xf
   8290 	JOB_OBJECT_CPU_RATE_CONTROL_WEIGHT_BASED                                       = 0x2
   8291 	JOB_OBJECT_EXTENDED_LIMIT_VALID_FLAGS                                          = 0x00007fff
   8292 	JOB_OBJECT_LIMIT_ACTIVE_PROCESS                                                = 0x00000008
   8293 	JOB_OBJECT_LIMIT_AFFINITY                                                      = 0x00000010
   8294 	JOB_OBJECT_LIMIT_BREAKAWAY_OK                                                  = 0x00000800
   8295 	JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION                                    = 0x00000400
   8296 	JOB_OBJECT_LIMIT_JOB_MEMORY                                                    = 0x00000200
   8297 	JOB_OBJECT_LIMIT_JOB_READ_BYTES                                                = 0x00010000
   8298 	JOB_OBJECT_LIMIT_JOB_TIME                                                      = 0x00000004
   8299 	JOB_OBJECT_LIMIT_JOB_WRITE_BYTES                                               = 0x00020000
   8300 	JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE                                             = 0x00002000
   8301 	JOB_OBJECT_LIMIT_PRESERVE_JOB_TIME                                             = 0x00000040
   8302 	JOB_OBJECT_LIMIT_PRIORITY_CLASS                                                = 0x00000020
   8303 	JOB_OBJECT_LIMIT_PROCESS_MEMORY                                                = 0x00000100
   8304 	JOB_OBJECT_LIMIT_PROCESS_TIME                                                  = 0x00000002
   8305 	JOB_OBJECT_LIMIT_RATE_CONTROL                                                  = 0x00040000
   8306 	JOB_OBJECT_LIMIT_RESERVED3                                                     = 0x00008000
   8307 	JOB_OBJECT_LIMIT_RESERVED4                                                     = 0x00010000
   8308 	JOB_OBJECT_LIMIT_RESERVED5                                                     = 0x00020000
   8309 	JOB_OBJECT_LIMIT_RESERVED6                                                     = 0x00040000
   8310 	JOB_OBJECT_LIMIT_SCHEDULING_CLASS                                              = 0x00000080
   8311 	JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK                                           = 0x00001000
   8312 	JOB_OBJECT_LIMIT_SUBSET_AFFINITY                                               = 0x00004000
   8313 	JOB_OBJECT_LIMIT_VALID_FLAGS                                                   = 0x0007ffff
   8314 	JOB_OBJECT_LIMIT_WORKINGSET                                                    = 0x00000001
   8315 	JOB_OBJECT_MSG_ABNORMAL_EXIT_PROCESS                                           = 8
   8316 	JOB_OBJECT_MSG_ACTIVE_PROCESS_LIMIT                                            = 3
   8317 	JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO                                             = 4
   8318 	JOB_OBJECT_MSG_END_OF_JOB_TIME                                                 = 1
   8319 	JOB_OBJECT_MSG_END_OF_PROCESS_TIME                                             = 2
   8320 	JOB_OBJECT_MSG_EXIT_PROCESS                                                    = 7
   8321 	JOB_OBJECT_MSG_JOB_CYCLE_TIME_LIMIT                                            = 12
   8322 	JOB_OBJECT_MSG_JOB_MEMORY_LIMIT                                                = 10
   8323 	JOB_OBJECT_MSG_MAXIMUM                                                         = 12
   8324 	JOB_OBJECT_MSG_MINIMUM                                                         = 1
   8325 	JOB_OBJECT_MSG_NEW_PROCESS                                                     = 6
   8326 	JOB_OBJECT_MSG_NOTIFICATION_LIMIT                                              = 11
   8327 	JOB_OBJECT_MSG_PROCESS_MEMORY_LIMIT                                            = 9
   8328 	JOB_OBJECT_NOTIFICATION_LIMIT_VALID_FLAGS                                      = 0x00070204
   8329 	JOB_OBJECT_POST_AT_END_OF_JOB                                                  = 1
   8330 	JOB_OBJECT_QUERY                                                               = 4
   8331 	JOB_OBJECT_RESERVED_LIMIT_VALID_FLAGS                                          = 0x0007ffff
   8332 	JOB_OBJECT_SECURITY_FILTER_TOKENS                                              = 0x00000008
   8333 	JOB_OBJECT_SECURITY_NO_ADMIN                                                   = 0x00000001
   8334 	JOB_OBJECT_SECURITY_ONLY_TOKEN                                                 = 0x00000004
   8335 	JOB_OBJECT_SECURITY_RESTRICTED_TOKEN                                           = 0x00000002
   8336 	JOB_OBJECT_SECURITY_VALID_FLAGS                                                = 0x0000000f
   8337 	JOB_OBJECT_SET_ATTRIBUTES                                                      = 2
   8338 	JOB_OBJECT_SET_SECURITY_ATTRIBUTES                                             = 16
   8339 	JOB_OBJECT_TERMINATE                                                           = 8
   8340 	JOB_OBJECT_TERMINATE_AT_END_OF_JOB                                             = 0
   8341 	JOB_OBJECT_UILIMIT_ALL                                                         = 0x000000FF
   8342 	JOB_OBJECT_UILIMIT_DESKTOP                                                     = 0x00000040
   8343 	JOB_OBJECT_UILIMIT_DISPLAYSETTINGS                                             = 0x00000010
   8344 	JOB_OBJECT_UILIMIT_EXITWINDOWS                                                 = 0x00000080
   8345 	JOB_OBJECT_UILIMIT_GLOBALATOMS                                                 = 0x00000020
   8346 	JOB_OBJECT_UILIMIT_HANDLES                                                     = 0x00000001
   8347 	JOB_OBJECT_UILIMIT_NONE                                                        = 0x00000000
   8348 	JOB_OBJECT_UILIMIT_READCLIPBOARD                                               = 0x00000002
   8349 	JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS                                            = 0x00000008
   8350 	JOB_OBJECT_UILIMIT_WRITECLIPBOARD                                              = 0x00000004
   8351 	JOB_OBJECT_UI_VALID_FLAGS                                                      = 0x000000FF
   8352 	JOB_POSITION_UNSPECIFIED                                                       = 0
   8353 	JOB_READ                                                                       = 131104
   8354 	JOB_STATUS_BLOCKED_DEVQ                                                        = 0x00000200
   8355 	JOB_STATUS_COMPLETE                                                            = 0x00001000
   8356 	JOB_STATUS_DELETED                                                             = 0x00000100
   8357 	JOB_STATUS_DELETING                                                            = 0x00000004
   8358 	JOB_STATUS_ERROR                                                               = 0x00000002
   8359 	JOB_STATUS_OFFLINE                                                             = 0x00000020
   8360 	JOB_STATUS_PAPEROUT                                                            = 0x00000040
   8361 	JOB_STATUS_PAUSED                                                              = 0x00000001
   8362 	JOB_STATUS_PRINTED                                                             = 0x00000080
   8363 	JOB_STATUS_PRINTING                                                            = 0x00000010
   8364 	JOB_STATUS_RESTART                                                             = 0x00000800
   8365 	JOB_STATUS_SPOOLING                                                            = 0x00000008
   8366 	JOB_STATUS_USER_INTERVENTION                                                   = 0x00000400
   8367 	JOB_WRITE                                                                      = 131088
   8368 	JOHAB_CHARSET                                                                  = 130
   8369 	JOYCAPS_HASPOV                                                                 = 0x0010
   8370 	JOYCAPS_HASR                                                                   = 0x0002
   8371 	JOYCAPS_HASU                                                                   = 0x0004
   8372 	JOYCAPS_HASV                                                                   = 0x0008
   8373 	JOYCAPS_HASZ                                                                   = 0x0001
   8374 	JOYCAPS_POV4DIR                                                                = 0x0020
   8375 	JOYCAPS_POVCTS                                                                 = 0x0040
   8376 	JOYERR_BASE                                                                    = 160
   8377 	JOYERR_NOCANDO                                                                 = 166
   8378 	JOYERR_NOERROR                                                                 = 0
   8379 	JOYERR_PARMS                                                                   = 165
   8380 	JOYERR_UNPLUGGED                                                               = 167
   8381 	JOYSTICKID1                                                                    = 0
   8382 	JOYSTICKID2                                                                    = 1
   8383 	JOY_BUTTON1                                                                    = 0x0001
   8384 	JOY_BUTTON10                                                                   = 512
   8385 	JOY_BUTTON11                                                                   = 1024
   8386 	JOY_BUTTON12                                                                   = 2048
   8387 	JOY_BUTTON13                                                                   = 4096
   8388 	JOY_BUTTON14                                                                   = 8192
   8389 	JOY_BUTTON15                                                                   = 16384
   8390 	JOY_BUTTON16                                                                   = 32768
   8391 	JOY_BUTTON17                                                                   = 65536
   8392 	JOY_BUTTON18                                                                   = 131072
   8393 	JOY_BUTTON19                                                                   = 262144
   8394 	JOY_BUTTON1CHG                                                                 = 0x0100
   8395 	JOY_BUTTON2                                                                    = 0x0002
   8396 	JOY_BUTTON20                                                                   = 524288
   8397 	JOY_BUTTON21                                                                   = 1048576
   8398 	JOY_BUTTON22                                                                   = 2097152
   8399 	JOY_BUTTON23                                                                   = 4194304
   8400 	JOY_BUTTON24                                                                   = 8388608
   8401 	JOY_BUTTON25                                                                   = 16777216
   8402 	JOY_BUTTON26                                                                   = 33554432
   8403 	JOY_BUTTON27                                                                   = 67108864
   8404 	JOY_BUTTON28                                                                   = 134217728
   8405 	JOY_BUTTON29                                                                   = 268435456
   8406 	JOY_BUTTON2CHG                                                                 = 0x0200
   8407 	JOY_BUTTON3                                                                    = 0x0004
   8408 	JOY_BUTTON30                                                                   = 536870912
   8409 	JOY_BUTTON31                                                                   = 1073741824
   8410 	JOY_BUTTON32                                                                   = 2147483648
   8411 	JOY_BUTTON3CHG                                                                 = 0x0400
   8412 	JOY_BUTTON4                                                                    = 0x0008
   8413 	JOY_BUTTON4CHG                                                                 = 0x0800
   8414 	JOY_BUTTON5                                                                    = 16
   8415 	JOY_BUTTON6                                                                    = 32
   8416 	JOY_BUTTON7                                                                    = 64
   8417 	JOY_BUTTON8                                                                    = 128
   8418 	JOY_BUTTON9                                                                    = 256
   8419 	JOY_CAL_READ3                                                                  = 262144
   8420 	JOY_CAL_READ4                                                                  = 524288
   8421 	JOY_CAL_READ5                                                                  = 4194304
   8422 	JOY_CAL_READ6                                                                  = 8388608
   8423 	JOY_CAL_READALWAYS                                                             = 65536
   8424 	JOY_CAL_READRONLY                                                              = 33554432
   8425 	JOY_CAL_READUONLY                                                              = 67108864
   8426 	JOY_CAL_READVONLY                                                              = 134217728
   8427 	JOY_CAL_READXONLY                                                              = 1048576
   8428 	JOY_CAL_READXYONLY                                                             = 131072
   8429 	JOY_CAL_READYONLY                                                              = 2097152
   8430 	JOY_CAL_READZONLY                                                              = 16777216
   8431 	JOY_POVBACKWARD                                                                = 18000
   8432 	JOY_POVFORWARD                                                                 = 0
   8433 	JOY_POVLEFT                                                                    = 27000
   8434 	JOY_POVRIGHT                                                                   = 9000
   8435 	JOY_RETURNALL                                                                  = 255
   8436 	JOY_RETURNBUTTONS                                                              = 128
   8437 	JOY_RETURNCENTERED                                                             = 1024
   8438 	JOY_RETURNPOV                                                                  = 64
   8439 	JOY_RETURNPOVCTS                                                               = 512
   8440 	JOY_RETURNR                                                                    = 8
   8441 	JOY_RETURNRAWDATA                                                              = 256
   8442 	JOY_RETURNU                                                                    = 16
   8443 	JOY_RETURNV                                                                    = 32
   8444 	JOY_RETURNX                                                                    = 1
   8445 	JOY_RETURNY                                                                    = 2
   8446 	JOY_RETURNZ                                                                    = 4
   8447 	JOY_USEDEADZONE                                                                = 2048
   8448 	JSON_ABPATH                                                                    = 0x03
   8449 	JSON_ARRAY                                                                     = 6
   8450 	JSON_CACHE_ID                                                                  = -429938
   8451 	JSON_CACHE_SZ                                                                  = 4
   8452 	JSON_FALSE                                                                     = 2
   8453 	JSON_INT                                                                       = 3
   8454 	JSON_ISSET                                                                     = 0x04
   8455 	JSON_JSON                                                                      = 0x01
   8456 	JSON_MAX_DEPTH                                                                 = 2000
   8457 	JSON_NULL                                                                      = 0
   8458 	JSON_OBJECT                                                                    = 7
   8459 	JSON_REAL                                                                      = 4
   8460 	JSON_SQL                                                                       = 0x02
   8461 	JSON_STRING                                                                    = 5
   8462 	JSON_SUBTYPE                                                                   = 74
   8463 	JSON_TRUE                                                                      = 1
   8464 	JT_CROSS                                                                       = 0x02
   8465 	JT_ERROR                                                                       = 0x80
   8466 	JT_INNER                                                                       = 0x01
   8467 	JT_LEFT                                                                        = 0x08
   8468 	JT_LTORJ                                                                       = 0x40
   8469 	JT_NATURAL                                                                     = 0x04
   8470 	JT_OUTER                                                                       = 0x20
   8471 	JT_RIGHT                                                                       = 0x10
   8472 	KDF_ALGORITHMID                                                                = 0x8
   8473 	KDF_CONTEXT                                                                    = 0xe
   8474 	KDF_GENERIC_PARAMETER                                                          = 0x11
   8475 	KDF_HASH_ALGORITHM                                                             = 0x0
   8476 	KDF_HMAC_KEY                                                                   = 0x3
   8477 	KDF_ITERATION_COUNT                                                            = 0x10
   8478 	KDF_KEYBITLENGTH                                                               = 0x12
   8479 	KDF_LABEL                                                                      = 0xd
   8480 	KDF_PARTYUINFO                                                                 = 0x9
   8481 	KDF_PARTYVINFO                                                                 = 0xa
   8482 	KDF_SALT                                                                       = 0xf
   8483 	KDF_SECRET_APPEND                                                              = 0x2
   8484 	KDF_SECRET_HANDLE                                                              = 0x6
   8485 	KDF_SECRET_PREPEND                                                             = 0x1
   8486 	KDF_SUPPPRIVINFO                                                               = 0xc
   8487 	KDF_SUPPPUBINFO                                                                = 0xb
   8488 	KDF_TLS_PRF_LABEL                                                              = 0x4
   8489 	KDF_TLS_PRF_PROTOCOL                                                           = 0x7
   8490 	KDF_TLS_PRF_SEED                                                               = 0x5
   8491 	KDF_USE_SECRET_AS_HMAC_KEY_FLAG                                                = 1
   8492 	KEYBOARD_OVERRUN_MAKE_CODE                                                     = 0xFF
   8493 	KEYEVENTF_EXTENDEDKEY                                                          = 0x0001
   8494 	KEYEVENTF_KEYUP                                                                = 0x0002
   8495 	KEYEVENTF_SCANCODE                                                             = 0x0008
   8496 	KEYEVENTF_UNICODE                                                              = 0x0004
   8497 	KEYINFO_ORDER_BIGNULL                                                          = 0x02
   8498 	KEYINFO_ORDER_DESC                                                             = 0x01
   8499 	KEYSTATEBLOB                                                                   = 0xc
   8500 	KEY_ALL_ACCESS                                                                 = 983103
   8501 	KEY_CREATE_LINK                                                                = 32
   8502 	KEY_CREATE_SUB_KEY                                                             = 4
   8503 	KEY_ENUMERATE_SUB_KEYS                                                         = 8
   8504 	KEY_EVENT                                                                      = 0x1
   8505 	KEY_EXECUTE                                                                    = 131097
   8506 	KEY_LENGTH_MASK                                                                = 0xffff0000
   8507 	KEY_NOTIFY                                                                     = 16
   8508 	KEY_QUERY_VALUE                                                                = 1
   8509 	KEY_READ                                                                       = 131097
   8510 	KEY_SET_VALUE                                                                  = 2
   8511 	KEY_WOW64_32KEY                                                                = 512
   8512 	KEY_WOW64_64KEY                                                                = 256
   8513 	KEY_WOW64_RES                                                                  = 768
   8514 	KEY_WRITE                                                                      = 131078
   8515 	KF_ALTDOWN                                                                     = 0x2000
   8516 	KF_DLGMODE                                                                     = 0x0800
   8517 	KF_EXTENDED                                                                    = 0x0100
   8518 	KF_MENUMODE                                                                    = 0x1000
   8519 	KF_REPEAT                                                                      = 0x4000
   8520 	KF_UP                                                                          = 0x8000
   8521 	KLF_ACTIVATE                                                                   = 0x00000001
   8522 	KLF_NOTELLSHELL                                                                = 0x00000080
   8523 	KLF_REORDER                                                                    = 0x00000008
   8524 	KLF_REPLACELANG                                                                = 0x00000010
   8525 	KLF_RESET                                                                      = 0x40000000
   8526 	KLF_SETFORPROCESS                                                              = 0x00000100
   8527 	KLF_SHIFTLOCK                                                                  = 0x00010000
   8528 	KLF_SUBSTITUTE_OK                                                              = 0x00000002
   8529 	KL_NAMELENGTH                                                                  = 9
   8530 	KP_ADMIN_PIN                                                                   = 31
   8531 	KP_ALGID                                                                       = 7
   8532 	KP_BLOCKLEN                                                                    = 8
   8533 	KP_CERTIFICATE                                                                 = 26
   8534 	KP_CLEAR_KEY                                                                   = 27
   8535 	KP_CLIENT_RANDOM                                                               = 21
   8536 	KP_CMS_DH_KEY_INFO                                                             = 38
   8537 	KP_CMS_KEY_INFO                                                                = 37
   8538 	KP_EFFECTIVE_KEYLEN                                                            = 19
   8539 	KP_G                                                                           = 12
   8540 	KP_GET_USE_COUNT                                                               = 42
   8541 	KP_HIGHEST_VERSION                                                             = 41
   8542 	KP_INFO                                                                        = 18
   8543 	KP_IV                                                                          = 1
   8544 	KP_KEYEXCHANGE_PIN                                                             = 32
   8545 	KP_KEYLEN                                                                      = 9
   8546 	KP_KEYVAL                                                                      = 30
   8547 	KP_MODE                                                                        = 4
   8548 	KP_MODE_BITS                                                                   = 5
   8549 	KP_OAEP_PARAMS                                                                 = 36
   8550 	KP_P                                                                           = 11
   8551 	KP_PADDING                                                                     = 3
   8552 	KP_PERMISSIONS                                                                 = 6
   8553 	KP_PIN_ID                                                                      = 43
   8554 	KP_PIN_INFO                                                                    = 44
   8555 	KP_PRECOMP_MD5                                                                 = 24
   8556 	KP_PRECOMP_SHA                                                                 = 25
   8557 	KP_PREHASH                                                                     = 34
   8558 	KP_PUB_EX_LEN                                                                  = 28
   8559 	KP_PUB_EX_VAL                                                                  = 29
   8560 	KP_PUB_PARAMS                                                                  = 39
   8561 	KP_Q                                                                           = 13
   8562 	KP_RA                                                                          = 16
   8563 	KP_RB                                                                          = 17
   8564 	KP_ROUNDS                                                                      = 35
   8565 	KP_RP                                                                          = 23
   8566 	KP_SALT                                                                        = 2
   8567 	KP_SALT_EX                                                                     = 10
   8568 	KP_SCHANNEL_ALG                                                                = 20
   8569 	KP_SERVER_RANDOM                                                               = 22
   8570 	KP_SIGNATURE_PIN                                                               = 33
   8571 	KP_VERIFY_PARAMS                                                               = 40
   8572 	KP_X                                                                           = 14
   8573 	KP_Y                                                                           = 15
   8574 	KTM_MARSHAL_BLOB_VERSION_MAJOR                                                 = 1
   8575 	KTM_MARSHAL_BLOB_VERSION_MINOR                                                 = 1
   8576 	LABEL_SECURITY_INFORMATION                                                     = 16
   8577 	LANG_AFRIKAANS                                                                 = 0x36
   8578 	LANG_ALBANIAN                                                                  = 0x1c
   8579 	LANG_ALSATIAN                                                                  = 0x84
   8580 	LANG_AMHARIC                                                                   = 0x5e
   8581 	LANG_ARABIC                                                                    = 0x01
   8582 	LANG_ARMENIAN                                                                  = 0x2b
   8583 	LANG_ASSAMESE                                                                  = 0x4d
   8584 	LANG_AZERBAIJANI                                                               = 0x2c
   8585 	LANG_AZERI                                                                     = 0x2c
   8586 	LANG_BANGLA                                                                    = 0x45
   8587 	LANG_BASHKIR                                                                   = 0x6d
   8588 	LANG_BASQUE                                                                    = 0x2d
   8589 	LANG_BELARUSIAN                                                                = 0x23
   8590 	LANG_BENGALI                                                                   = 0x45
   8591 	LANG_BOSNIAN                                                                   = 0x1a
   8592 	LANG_BOSNIAN_NEUTRAL                                                           = 0x781a
   8593 	LANG_BRETON                                                                    = 0x7e
   8594 	LANG_BULGARIAN                                                                 = 0x02
   8595 	LANG_CATALAN                                                                   = 0x03
   8596 	LANG_CENTRAL_KURDISH                                                           = 0x92
   8597 	LANG_CHEROKEE                                                                  = 0x5c
   8598 	LANG_CHINESE                                                                   = 0x04
   8599 	LANG_CHINESE_SIMPLIFIED                                                        = 0x04
   8600 	LANG_CHINESE_TRADITIONAL                                                       = 0x7c04
   8601 	LANG_CORSICAN                                                                  = 0x83
   8602 	LANG_CROATIAN                                                                  = 0x1a
   8603 	LANG_CZECH                                                                     = 0x05
   8604 	LANG_DANISH                                                                    = 0x06
   8605 	LANG_DARI                                                                      = 0x8c
   8606 	LANG_DIVEHI                                                                    = 0x65
   8607 	LANG_DUTCH                                                                     = 0x13
   8608 	LANG_ENGLISH                                                                   = 0x09
   8609 	LANG_ESTONIAN                                                                  = 0x25
   8610 	LANG_FAEROESE                                                                  = 0x38
   8611 	LANG_FARSI                                                                     = 0x29
   8612 	LANG_FILIPINO                                                                  = 0x64
   8613 	LANG_FINNISH                                                                   = 0x0b
   8614 	LANG_FRENCH                                                                    = 0x0c
   8615 	LANG_FRISIAN                                                                   = 0x62
   8616 	LANG_FULAH                                                                     = 0x67
   8617 	LANG_GALICIAN                                                                  = 0x56
   8618 	LANG_GEORGIAN                                                                  = 0x37
   8619 	LANG_GERMAN                                                                    = 0x07
   8620 	LANG_GREEK                                                                     = 0x08
   8621 	LANG_GREENLANDIC                                                               = 0x6f
   8622 	LANG_GUJARATI                                                                  = 0x47
   8623 	LANG_HAUSA                                                                     = 0x68
   8624 	LANG_HEBREW                                                                    = 0x0d
   8625 	LANG_HINDI                                                                     = 0x39
   8626 	LANG_HUNGARIAN                                                                 = 0x0e
   8627 	LANG_ICELANDIC                                                                 = 0x0f
   8628 	LANG_IGBO                                                                      = 0x70
   8629 	LANG_INDONESIAN                                                                = 0x21
   8630 	LANG_INUKTITUT                                                                 = 0x5d
   8631 	LANG_INVARIANT                                                                 = 0x7f
   8632 	LANG_IRISH                                                                     = 0x3c
   8633 	LANG_ITALIAN                                                                   = 0x10
   8634 	LANG_JAPANESE                                                                  = 0x11
   8635 	LANG_KANNADA                                                                   = 0x4b
   8636 	LANG_KASHMIRI                                                                  = 0x60
   8637 	LANG_KAZAK                                                                     = 0x3f
   8638 	LANG_KHMER                                                                     = 0x53
   8639 	LANG_KICHE                                                                     = 0x86
   8640 	LANG_KINYARWANDA                                                               = 0x87
   8641 	LANG_KONKANI                                                                   = 0x57
   8642 	LANG_KOREAN                                                                    = 0x12
   8643 	LANG_KYRGYZ                                                                    = 0x40
   8644 	LANG_LAO                                                                       = 0x54
   8645 	LANG_LATVIAN                                                                   = 0x26
   8646 	LANG_LITHUANIAN                                                                = 0x27
   8647 	LANG_LOWER_SORBIAN                                                             = 0x2e
   8648 	LANG_LUXEMBOURGISH                                                             = 0x6e
   8649 	LANG_MACEDONIAN                                                                = 0x2f
   8650 	LANG_MALAY                                                                     = 0x3e
   8651 	LANG_MALAYALAM                                                                 = 0x4c
   8652 	LANG_MALTESE                                                                   = 0x3a
   8653 	LANG_MANIPURI                                                                  = 0x58
   8654 	LANG_MAORI                                                                     = 0x81
   8655 	LANG_MAPUDUNGUN                                                                = 0x7a
   8656 	LANG_MARATHI                                                                   = 0x4e
   8657 	LANG_MOHAWK                                                                    = 0x7c
   8658 	LANG_MONGOLIAN                                                                 = 0x50
   8659 	LANG_NEPALI                                                                    = 0x61
   8660 	LANG_NEUTRAL                                                                   = 0x00
   8661 	LANG_NORWEGIAN                                                                 = 0x14
   8662 	LANG_OCCITAN                                                                   = 0x82
   8663 	LANG_ODIA                                                                      = 0x48
   8664 	LANG_ORIYA                                                                     = 0x48
   8665 	LANG_PASHTO                                                                    = 0x63
   8666 	LANG_PERSIAN                                                                   = 0x29
   8667 	LANG_POLISH                                                                    = 0x15
   8668 	LANG_PORTUGUESE                                                                = 0x16
   8669 	LANG_PULAR                                                                     = 0x67
   8670 	LANG_PUNJABI                                                                   = 0x46
   8671 	LANG_QUECHUA                                                                   = 0x6b
   8672 	LANG_ROMANIAN                                                                  = 0x18
   8673 	LANG_ROMANSH                                                                   = 0x17
   8674 	LANG_RUSSIAN                                                                   = 0x19
   8675 	LANG_SAKHA                                                                     = 0x85
   8676 	LANG_SAMI                                                                      = 0x3b
   8677 	LANG_SANSKRIT                                                                  = 0x4f
   8678 	LANG_SCOTTISH_GAELIC                                                           = 0x91
   8679 	LANG_SERBIAN                                                                   = 0x1a
   8680 	LANG_SERBIAN_NEUTRAL                                                           = 0x7c1a
   8681 	LANG_SINDHI                                                                    = 0x59
   8682 	LANG_SINHALESE                                                                 = 0x5b
   8683 	LANG_SLOVAK                                                                    = 0x1b
   8684 	LANG_SLOVENIAN                                                                 = 0x24
   8685 	LANG_SOTHO                                                                     = 0x6c
   8686 	LANG_SPANISH                                                                   = 0x0a
   8687 	LANG_SWAHILI                                                                   = 0x41
   8688 	LANG_SWEDISH                                                                   = 0x1d
   8689 	LANG_SYRIAC                                                                    = 0x5a
   8690 	LANG_TAJIK                                                                     = 0x28
   8691 	LANG_TAMAZIGHT                                                                 = 0x5f
   8692 	LANG_TAMIL                                                                     = 0x49
   8693 	LANG_TATAR                                                                     = 0x44
   8694 	LANG_TELUGU                                                                    = 0x4a
   8695 	LANG_THAI                                                                      = 0x1e
   8696 	LANG_TIBETAN                                                                   = 0x51
   8697 	LANG_TIGRIGNA                                                                  = 0x73
   8698 	LANG_TIGRINYA                                                                  = 0x73
   8699 	LANG_TSWANA                                                                    = 0x32
   8700 	LANG_TURKISH                                                                   = 0x1f
   8701 	LANG_TURKMEN                                                                   = 0x42
   8702 	LANG_UIGHUR                                                                    = 0x80
   8703 	LANG_UKRAINIAN                                                                 = 0x22
   8704 	LANG_UPPER_SORBIAN                                                             = 0x2e
   8705 	LANG_URDU                                                                      = 0x20
   8706 	LANG_UZBEK                                                                     = 0x43
   8707 	LANG_VALENCIAN                                                                 = 0x03
   8708 	LANG_VIETNAMESE                                                                = 0x2a
   8709 	LANG_WELSH                                                                     = 0x52
   8710 	LANG_WOLOF                                                                     = 0x88
   8711 	LANG_XHOSA                                                                     = 0x34
   8712 	LANG_YAKUT                                                                     = 0x85
   8713 	LANG_YI                                                                        = 0x78
   8714 	LANG_YORUBA                                                                    = 0x6a
   8715 	LANG_ZULU                                                                      = 0x35
   8716 	LAYOUT_BITMAPORIENTATIONPRESERVED                                              = 0x00000008
   8717 	LAYOUT_BTT                                                                     = 0x00000002
   8718 	LAYOUT_ORIENTATIONMASK                                                         = 7
   8719 	LAYOUT_RTL                                                                     = 0x00000001
   8720 	LAYOUT_VBH                                                                     = 0x00000004
   8721 	LBN_DBLCLK                                                                     = 2
   8722 	LBN_ERRSPACE                                                                   = -2
   8723 	LBN_KILLFOCUS                                                                  = 5
   8724 	LBN_SELCANCEL                                                                  = 3
   8725 	LBN_SELCHANGE                                                                  = 1
   8726 	LBN_SETFOCUS                                                                   = 4
   8727 	LBSELCHSTRINGA                                                                 = "commdlg_LBSelChangedNotify"
   8728 	LBS_COMBOBOX                                                                   = 32768
   8729 	LBS_DISABLENOSCROLL                                                            = 4096
   8730 	LBS_EXTENDEDSEL                                                                = 2048
   8731 	LBS_HASSTRINGS                                                                 = 64
   8732 	LBS_MULTICOLUMN                                                                = 512
   8733 	LBS_MULTIPLESEL                                                                = 8
   8734 	LBS_NODATA                                                                     = 8192
   8735 	LBS_NOINTEGRALHEIGHT                                                           = 256
   8736 	LBS_NOREDRAW                                                                   = 4
   8737 	LBS_NOSEL                                                                      = 16384
   8738 	LBS_NOTIFY                                                                     = 1
   8739 	LBS_OWNERDRAWFIXED                                                             = 16
   8740 	LBS_OWNERDRAWVARIABLE                                                          = 32
   8741 	LBS_SORT                                                                       = 2
   8742 	LBS_STANDARD                                                                   = 10485763
   8743 	LBS_USETABSTOPS                                                                = 128
   8744 	LBS_WANTKEYBOARDINPUT                                                          = 1024
   8745 	LB_ADDFILE                                                                     = 0x0196
   8746 	LB_ADDSTRING                                                                   = 0x0180
   8747 	LB_CTLCODE                                                                     = 0
   8748 	LB_DELETESTRING                                                                = 0x0182
   8749 	LB_DIR                                                                         = 0x018D
   8750 	LB_ERR                                                                         = -1
   8751 	LB_ERRSPACE                                                                    = -2
   8752 	LB_FINDSTRING                                                                  = 0x018F
   8753 	LB_FINDSTRINGEXACT                                                             = 0x01A2
   8754 	LB_GETANCHORINDEX                                                              = 0x019D
   8755 	LB_GETCARETINDEX                                                               = 0x019F
   8756 	LB_GETCOUNT                                                                    = 0x018B
   8757 	LB_GETCURSEL                                                                   = 0x0188
   8758 	LB_GETHORIZONTALEXTENT                                                         = 0x0193
   8759 	LB_GETITEMDATA                                                                 = 0x0199
   8760 	LB_GETITEMHEIGHT                                                               = 0x01A1
   8761 	LB_GETITEMRECT                                                                 = 0x0198
   8762 	LB_GETLISTBOXINFO                                                              = 0x01B2
   8763 	LB_GETLOCALE                                                                   = 0x01A6
   8764 	LB_GETSEL                                                                      = 0x0187
   8765 	LB_GETSELCOUNT                                                                 = 0x0190
   8766 	LB_GETSELITEMS                                                                 = 0x0191
   8767 	LB_GETTEXT                                                                     = 0x0189
   8768 	LB_GETTEXTLEN                                                                  = 0x018A
   8769 	LB_GETTOPINDEX                                                                 = 0x018E
   8770 	LB_INITSTORAGE                                                                 = 0x01A8
   8771 	LB_INSERTSTRING                                                                = 0x0181
   8772 	LB_ITEMFROMPOINT                                                               = 0x01A9
   8773 	LB_MSGMAX                                                                      = 0x01B3
   8774 	LB_OKAY                                                                        = 0
   8775 	LB_RESETCONTENT                                                                = 0x0184
   8776 	LB_SELECTSTRING                                                                = 0x018C
   8777 	LB_SELITEMRANGE                                                                = 0x019B
   8778 	LB_SELITEMRANGEEX                                                              = 0x0183
   8779 	LB_SETANCHORINDEX                                                              = 0x019C
   8780 	LB_SETCARETINDEX                                                               = 0x019E
   8781 	LB_SETCOLUMNWIDTH                                                              = 0x0195
   8782 	LB_SETCOUNT                                                                    = 0x01A7
   8783 	LB_SETCURSEL                                                                   = 0x0186
   8784 	LB_SETHORIZONTALEXTENT                                                         = 0x0194
   8785 	LB_SETITEMDATA                                                                 = 0x019A
   8786 	LB_SETITEMHEIGHT                                                               = 0x01A0
   8787 	LB_SETLOCALE                                                                   = 0x01A5
   8788 	LB_SETSEL                                                                      = 0x0185
   8789 	LB_SETTABSTOPS                                                                 = 0x0192
   8790 	LB_SETTOPINDEX                                                                 = 0x0197
   8791 	LCID_ALTERNATE_SORTS                                                           = 0x00000004
   8792 	LCID_INSTALLED                                                                 = 0x00000001
   8793 	LCID_SUPPORTED                                                                 = 0x00000002
   8794 	LCMAP_BYTEREV                                                                  = 0x00000800
   8795 	LCMAP_FULLWIDTH                                                                = 0x00800000
   8796 	LCMAP_HALFWIDTH                                                                = 0x00400000
   8797 	LCMAP_HIRAGANA                                                                 = 0x00100000
   8798 	LCMAP_KATAKANA                                                                 = 0x00200000
   8799 	LCMAP_LINGUISTIC_CASING                                                        = 0x01000000
   8800 	LCMAP_LOWERCASE                                                                = 0x00000100
   8801 	LCMAP_SIMPLIFIED_CHINESE                                                       = 0x02000000
   8802 	LCMAP_SORTKEY                                                                  = 0x00000400
   8803 	LCMAP_TRADITIONAL_CHINESE                                                      = 0x04000000
   8804 	LCMAP_UPPERCASE                                                                = 0x00000200
   8805 	LCS_CALIBRATED_RGB                                                             = 0
   8806 	LCS_GM_ABS_COLORIMETRIC                                                        = 8
   8807 	LCS_GM_BUSINESS                                                                = 1
   8808 	LCS_GM_GRAPHICS                                                                = 2
   8809 	LCS_GM_IMAGES                                                                  = 4
   8810 	LCS_SIGNATURE                                                                  = 80
   8811 	LCS_WINDOWS_COLOR_SPACE                                                        = 87
   8812 	LCS_sRGB                                                                       = 115
   8813 	LC_INTERIORS                                                                   = 128
   8814 	LC_MARKER                                                                      = 4
   8815 	LC_NONE                                                                        = 0
   8816 	LC_POLYLINE                                                                    = 2
   8817 	LC_POLYMARKER                                                                  = 8
   8818 	LC_STYLED                                                                      = 32
   8819 	LC_WIDE                                                                        = 16
   8820 	LC_WIDESTYLED                                                                  = 64
   8821 	LEFT_ALT_PRESSED                                                               = 0x2
   8822 	LEFT_CTRL_PRESSED                                                              = 0x8
   8823 	LEGACY_SCHEMA_TABLE                                                            = "sqlite_master"
   8824 	LEGACY_TEMP_SCHEMA_TABLE                                                       = "sqlite_temp_master"
   8825 	LF_FACESIZE                                                                    = 32
   8826 	LF_FULLFACESIZE                                                                = 64
   8827 	LGRPID_ARABIC                                                                  = 0x000d
   8828 	LGRPID_ARMENIAN                                                                = 0x0011
   8829 	LGRPID_BALTIC                                                                  = 0x0003
   8830 	LGRPID_CENTRAL_EUROPE                                                          = 0x0002
   8831 	LGRPID_CYRILLIC                                                                = 0x0005
   8832 	LGRPID_GEORGIAN                                                                = 0x0010
   8833 	LGRPID_GREEK                                                                   = 0x0004
   8834 	LGRPID_HEBREW                                                                  = 0x000c
   8835 	LGRPID_INDIC                                                                   = 0x000f
   8836 	LGRPID_INSTALLED                                                               = 0x00000001
   8837 	LGRPID_JAPANESE                                                                = 0x0007
   8838 	LGRPID_KOREAN                                                                  = 0x0008
   8839 	LGRPID_SIMPLIFIED_CHINESE                                                      = 0x000a
   8840 	LGRPID_SUPPORTED                                                               = 0x00000002
   8841 	LGRPID_THAI                                                                    = 0x000b
   8842 	LGRPID_TRADITIONAL_CHINESE                                                     = 0x0009
   8843 	LGRPID_TURKIC                                                                  = 0x0006
   8844 	LGRPID_TURKISH                                                                 = 0x0006
   8845 	LGRPID_VIETNAMESE                                                              = 0x000e
   8846 	LGRPID_WESTERN_EUROPE                                                          = 0x0001
   8847 	LHND                                                                           = 66
   8848 	LINECAPS                                                                       = 30
   8849 	LINGUISTIC_IGNORECASE                                                          = 0x00000010
   8850 	LINGUISTIC_IGNOREDIACRITIC                                                     = 0x00000020
   8851 	LISTEN_OUTSTANDING                                                             = 0x01
   8852 	LLKHF_ALTDOWN                                                                  = 32
   8853 	LLKHF_EXTENDED                                                                 = 1
   8854 	LLKHF_INJECTED                                                                 = 0x00000010
   8855 	LLKHF_LOWER_IL_INJECTED                                                        = 0x00000002
   8856 	LLKHF_UP                                                                       = 128
   8857 	LLMHF_INJECTED                                                                 = 0x00000001
   8858 	LLMHF_LOWER_IL_INJECTED                                                        = 0x00000002
   8859 	LLONG_MAX                                                                      = 9223372036854775807
   8860 	LLONG_MIN                                                                      = -9223372036854775808
   8861 	LMEM_DISCARDABLE                                                               = 0xf00
   8862 	LMEM_DISCARDED                                                                 = 0x4000
   8863 	LMEM_FIXED                                                                     = 0x0
   8864 	LMEM_INVALID_HANDLE                                                            = 0x8000
   8865 	LMEM_LOCKCOUNT                                                                 = 0xff
   8866 	LMEM_MODIFY                                                                    = 0x80
   8867 	LMEM_MOVEABLE                                                                  = 0x2
   8868 	LMEM_NOCOMPACT                                                                 = 0x10
   8869 	LMEM_NODISCARD                                                                 = 0x20
   8870 	LMEM_VALID_FLAGS                                                               = 0xf72
   8871 	LMEM_ZEROINIT                                                                  = 0x40
   8872 	LOAD_DLL_DEBUG_EVENT                                                           = 6
   8873 	LOAD_IGNORE_CODE_AUTHZ_LEVEL                                                   = 0x10
   8874 	LOAD_LIBRARY_AS_DATAFILE                                                       = 0x2
   8875 	LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE                                             = 0x40
   8876 	LOAD_LIBRARY_AS_IMAGE_RESOURCE                                                 = 0x20
   8877 	LOAD_LIBRARY_REQUIRE_SIGNED_TARGET                                             = 0x80
   8878 	LOAD_LIBRARY_SEARCH_APPLICATION_DIR                                            = 0x200
   8879 	LOAD_LIBRARY_SEARCH_DEFAULT_DIRS                                               = 0x1000
   8880 	LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR                                               = 0x100
   8881 	LOAD_LIBRARY_SEARCH_SYSTEM32                                                   = 0x800
   8882 	LOAD_LIBRARY_SEARCH_SYSTEM32_NO_FORWARDER                                      = 2048
   8883 	LOAD_LIBRARY_SEARCH_USER_DIRS                                                  = 0x400
   8884 	LOAD_TLB_AS_32BIT                                                              = 0x20
   8885 	LOAD_TLB_AS_64BIT                                                              = 0x40
   8886 	LOAD_WITH_ALTERED_SEARCH_PATH                                                  = 0x8
   8887 	LOCALE_FONTSIGNATURE                                                           = 0x00000058
   8888 	LOCALE_ICALENDARTYPE                                                           = 0x00001009
   8889 	LOCALE_ICENTURY                                                                = 0x00000024
   8890 	LOCALE_ICOUNTRY                                                                = 0x00000005
   8891 	LOCALE_ICURRDIGITS                                                             = 0x00000019
   8892 	LOCALE_ICURRENCY                                                               = 0x0000001b
   8893 	LOCALE_IDATE                                                                   = 0x00000021
   8894 	LOCALE_IDAYLZERO                                                               = 0x00000026
   8895 	LOCALE_IDEFAULTANSICODEPAGE                                                    = 0x00001004
   8896 	LOCALE_IDEFAULTCODEPAGE                                                        = 0x0000000b
   8897 	LOCALE_IDEFAULTCOUNTRY                                                         = 0x0000000a
   8898 	LOCALE_IDEFAULTEBCDICCODEPAGE                                                  = 0x00001012
   8899 	LOCALE_IDEFAULTLANGUAGE                                                        = 0x00000009
   8900 	LOCALE_IDEFAULTMACCODEPAGE                                                     = 0x00001011
   8901 	LOCALE_IDIGITS                                                                 = 0x00000011
   8902 	LOCALE_IDIGITSUBSTITUTION                                                      = 0x00001014
   8903 	LOCALE_IFIRSTDAYOFWEEK                                                         = 0x0000100c
   8904 	LOCALE_IFIRSTWEEKOFYEAR                                                        = 0x0000100d
   8905 	LOCALE_IGEOID                                                                  = 0x0000005b
   8906 	LOCALE_IINTLCURRDIGITS                                                         = 0x0000001a
   8907 	LOCALE_ILANGUAGE                                                               = 0x00000001
   8908 	LOCALE_ILDATE                                                                  = 0x00000022
   8909 	LOCALE_ILZERO                                                                  = 0x00000012
   8910 	LOCALE_IMEASURE                                                                = 0x0000000d
   8911 	LOCALE_IMONLZERO                                                               = 0x00000027
   8912 	LOCALE_INEGCURR                                                                = 0x0000001c
   8913 	LOCALE_INEGNUMBER                                                              = 0x00001010
   8914 	LOCALE_INEGSEPBYSPACE                                                          = 0x00000057
   8915 	LOCALE_INEGSIGNPOSN                                                            = 0x00000053
   8916 	LOCALE_INEGSYMPRECEDES                                                         = 0x00000056
   8917 	LOCALE_IOPTIONALCALENDAR                                                       = 0x0000100b
   8918 	LOCALE_IPAPERSIZE                                                              = 0x0000100a
   8919 	LOCALE_IPOSSEPBYSPACE                                                          = 0x00000055
   8920 	LOCALE_IPOSSIGNPOSN                                                            = 0x00000052
   8921 	LOCALE_IPOSSYMPRECEDES                                                         = 0x00000054
   8922 	LOCALE_ITIME                                                                   = 0x00000023
   8923 	LOCALE_ITIMEMARKPOSN                                                           = 0x00001005
   8924 	LOCALE_ITLZERO                                                                 = 0x00000025
   8925 	LOCALE_NAME_MAX_LENGTH                                                         = 85
   8926 	LOCALE_NOUSEROVERRIDE                                                          = 0x80000000
   8927 	LOCALE_RETURN_NUMBER                                                           = 0x20000000
   8928 	LOCALE_S1159                                                                   = 0x00000028
   8929 	LOCALE_S2359                                                                   = 0x00000029
   8930 	LOCALE_SABBREVCTRYNAME                                                         = 0x00000007
   8931 	LOCALE_SABBREVDAYNAME1                                                         = 0x00000031
   8932 	LOCALE_SABBREVDAYNAME2                                                         = 0x00000032
   8933 	LOCALE_SABBREVDAYNAME3                                                         = 0x00000033
   8934 	LOCALE_SABBREVDAYNAME4                                                         = 0x00000034
   8935 	LOCALE_SABBREVDAYNAME5                                                         = 0x00000035
   8936 	LOCALE_SABBREVDAYNAME6                                                         = 0x00000036
   8937 	LOCALE_SABBREVDAYNAME7                                                         = 0x00000037
   8938 	LOCALE_SABBREVLANGNAME                                                         = 0x00000003
   8939 	LOCALE_SABBREVMONTHNAME1                                                       = 0x00000044
   8940 	LOCALE_SABBREVMONTHNAME10                                                      = 0x0000004d
   8941 	LOCALE_SABBREVMONTHNAME11                                                      = 0x0000004e
   8942 	LOCALE_SABBREVMONTHNAME12                                                      = 0x0000004f
   8943 	LOCALE_SABBREVMONTHNAME13                                                      = 0x0000100f
   8944 	LOCALE_SABBREVMONTHNAME2                                                       = 0x00000045
   8945 	LOCALE_SABBREVMONTHNAME3                                                       = 0x00000046
   8946 	LOCALE_SABBREVMONTHNAME4                                                       = 0x00000047
   8947 	LOCALE_SABBREVMONTHNAME5                                                       = 0x00000048
   8948 	LOCALE_SABBREVMONTHNAME6                                                       = 0x00000049
   8949 	LOCALE_SABBREVMONTHNAME7                                                       = 0x0000004a
   8950 	LOCALE_SABBREVMONTHNAME8                                                       = 0x0000004b
   8951 	LOCALE_SABBREVMONTHNAME9                                                       = 0x0000004c
   8952 	LOCALE_SCOUNTRY                                                                = 0x00000006
   8953 	LOCALE_SCURRENCY                                                               = 0x00000014
   8954 	LOCALE_SDATE                                                                   = 0x0000001d
   8955 	LOCALE_SDAYNAME1                                                               = 0x0000002a
   8956 	LOCALE_SDAYNAME2                                                               = 0x0000002b
   8957 	LOCALE_SDAYNAME3                                                               = 0x0000002c
   8958 	LOCALE_SDAYNAME4                                                               = 0x0000002d
   8959 	LOCALE_SDAYNAME5                                                               = 0x0000002e
   8960 	LOCALE_SDAYNAME6                                                               = 0x0000002f
   8961 	LOCALE_SDAYNAME7                                                               = 0x00000030
   8962 	LOCALE_SDECIMAL                                                                = 0x0000000e
   8963 	LOCALE_SENGCOUNTRY                                                             = 0x00001002
   8964 	LOCALE_SENGCURRNAME                                                            = 0x00001007
   8965 	LOCALE_SENGLANGUAGE                                                            = 0x00001001
   8966 	LOCALE_SENGLISHCOUNTRYNAME                                                     = 0x00001002
   8967 	LOCALE_SENGLISHLANGUAGENAME                                                    = 0x00001001
   8968 	LOCALE_SGROUPING                                                               = 0x00000010
   8969 	LOCALE_SINTLSYMBOL                                                             = 0x00000015
   8970 	LOCALE_SISO3166CTRYNAME                                                        = 0x0000005a
   8971 	LOCALE_SISO639LANGNAME                                                         = 0x00000059
   8972 	LOCALE_SLANGUAGE                                                               = 0x00000002
   8973 	LOCALE_SLIST                                                                   = 0x0000000c
   8974 	LOCALE_SLOCALIZEDCOUNTRYNAME                                                   = 0x00000006
   8975 	LOCALE_SLOCALIZEDDISPLAYNAME                                                   = 0x00000002
   8976 	LOCALE_SLONGDATE                                                               = 0x00000020
   8977 	LOCALE_SMONDECIMALSEP                                                          = 0x00000016
   8978 	LOCALE_SMONGROUPING                                                            = 0x00000018
   8979 	LOCALE_SMONTHNAME1                                                             = 0x00000038
   8980 	LOCALE_SMONTHNAME10                                                            = 0x00000041
   8981 	LOCALE_SMONTHNAME11                                                            = 0x00000042
   8982 	LOCALE_SMONTHNAME12                                                            = 0x00000043
   8983 	LOCALE_SMONTHNAME13                                                            = 0x0000100e
   8984 	LOCALE_SMONTHNAME2                                                             = 0x00000039
   8985 	LOCALE_SMONTHNAME3                                                             = 0x0000003a
   8986 	LOCALE_SMONTHNAME4                                                             = 0x0000003b
   8987 	LOCALE_SMONTHNAME5                                                             = 0x0000003c
   8988 	LOCALE_SMONTHNAME6                                                             = 0x0000003d
   8989 	LOCALE_SMONTHNAME7                                                             = 0x0000003e
   8990 	LOCALE_SMONTHNAME8                                                             = 0x0000003f
   8991 	LOCALE_SMONTHNAME9                                                             = 0x00000040
   8992 	LOCALE_SMONTHOUSANDSEP                                                         = 0x00000017
   8993 	LOCALE_SNATIVECOUNTRYNAME                                                      = 0x00000008
   8994 	LOCALE_SNATIVECTRYNAME                                                         = 0x00000008
   8995 	LOCALE_SNATIVECURRNAME                                                         = 0x00001008
   8996 	LOCALE_SNATIVEDIGITS                                                           = 0x00000013
   8997 	LOCALE_SNATIVELANGNAME                                                         = 0x00000004
   8998 	LOCALE_SNATIVELANGUAGENAME                                                     = 0x00000004
   8999 	LOCALE_SNEGATIVESIGN                                                           = 0x00000051
   9000 	LOCALE_SPOSITIVESIGN                                                           = 0x00000050
   9001 	LOCALE_SSHORTDATE                                                              = 0x0000001f
   9002 	LOCALE_SSORTNAME                                                               = 0x00001013
   9003 	LOCALE_STHOUSAND                                                               = 0x0000000f
   9004 	LOCALE_STIME                                                                   = 0x0000001e
   9005 	LOCALE_STIMEFORMAT                                                             = 0x00001003
   9006 	LOCALE_SYEARMONTH                                                              = 0x00001006
   9007 	LOCALE_USE_CP_ACP                                                              = 0x40000000
   9008 	LOCALE_USE_NLS                                                                 = 0x10000000
   9009 	LOCATE_NOERR                                                                   = 0x02
   9010 	LOCATE_VIEW                                                                    = 0x01
   9011 	LOCKFILE_EXCLUSIVE_LOCK                                                        = 0x2
   9012 	LOCKFILE_FAIL_IMMEDIATELY                                                      = 0x1
   9013 	LOCK_ELEMENT                                                                   = 0
   9014 	LOCK_UNLOCK_DOOR                                                               = 0x02
   9015 	LOCK_UNLOCK_IEPORT                                                             = 0x01
   9016 	LOCK_UNLOCK_KEYPAD                                                             = 0x04
   9017 	LOGON32_LOGON_BATCH                                                            = 4
   9018 	LOGON32_LOGON_INTERACTIVE                                                      = 2
   9019 	LOGON32_LOGON_NETWORK                                                          = 3
   9020 	LOGON32_LOGON_NETWORK_CLEARTEXT                                                = 8
   9021 	LOGON32_LOGON_NEW_CREDENTIALS                                                  = 9
   9022 	LOGON32_LOGON_SERVICE                                                          = 5
   9023 	LOGON32_LOGON_UNLOCK                                                           = 7
   9024 	LOGON32_PROVIDER_DEFAULT                                                       = 0
   9025 	LOGON32_PROVIDER_WINNT35                                                       = 1
   9026 	LOGON32_PROVIDER_WINNT40                                                       = 2
   9027 	LOGON32_PROVIDER_WINNT50                                                       = 3
   9028 	LOGON_NETCREDENTIALS_ONLY                                                      = 0x00000002
   9029 	LOGON_WITH_PROFILE                                                             = 0x00000001
   9030 	LOGON_ZERO_PASSWORD_BUFFER                                                     = 0x80000000
   9031 	LOGPIXELSX                                                                     = 88
   9032 	LOGPIXELSY                                                                     = 90
   9033 	LONG_LONG_MAX                                                                  = 9223372036854775807
   9034 	LONG_LONG_MIN                                                                  = -9223372036854775808
   9035 	LONG_MAX                                                                       = 2147483647
   9036 	LONG_MIN                                                                       = -2147483648
   9037 	LOOKASIDE_SMALL                                                                = 128
   9038 	LOW_SURROGATE_END                                                              = 0xdfff
   9039 	LOW_SURROGATE_START                                                            = 0xdc00
   9040 	LPD_DOUBLEBUFFER                                                               = 0x00000001
   9041 	LPD_SHARE_ACCUM                                                                = 0x00000100
   9042 	LPD_SHARE_DEPTH                                                                = 0x00000040
   9043 	LPD_SHARE_STENCIL                                                              = 0x00000080
   9044 	LPD_STEREO                                                                     = 0x00000002
   9045 	LPD_SUPPORT_GDI                                                                = 0x00000010
   9046 	LPD_SUPPORT_OPENGL                                                             = 0x00000020
   9047 	LPD_SWAP_COPY                                                                  = 0x00000400
   9048 	LPD_SWAP_EXCHANGE                                                              = 0x00000200
   9049 	LPD_TRANSPARENT                                                                = 0x00001000
   9050 	LPD_TYPE_COLORINDEX                                                            = 1
   9051 	LPD_TYPE_RGBA                                                                  = 0
   9052 	LPTR                                                                           = 64
   9053 	LPTx                                                                           = 0x80
   9054 	LR_COLOR                                                                       = 0x0002
   9055 	LR_COPYDELETEORG                                                               = 0x0008
   9056 	LR_COPYFROMRESOURCE                                                            = 0x4000
   9057 	LR_COPYRETURNORG                                                               = 0x0004
   9058 	LR_CREATEDIBSECTION                                                            = 0x2000
   9059 	LR_DEFAULTCOLOR                                                                = 0x0000
   9060 	LR_DEFAULTSIZE                                                                 = 0x0040
   9061 	LR_LOADFROMFILE                                                                = 0x0010
   9062 	LR_LOADMAP3DCOLORS                                                             = 0x1000
   9063 	LR_LOADTRANSPARENT                                                             = 0x0020
   9064 	LR_MONOCHROME                                                                  = 0x0001
   9065 	LR_SHARED                                                                      = 0x8000
   9066 	LR_VGACOLOR                                                                    = 0x0080
   9067 	LSFW_LOCK                                                                      = 1
   9068 	LSFW_UNLOCK                                                                    = 2
   9069 	LTGRAY_BRUSH                                                                   = 1
   9070 	LTP_PC_SMT                                                                     = 0x1
   9071 	LUA_TOKEN                                                                      = 0x4
   9072 	LWA_ALPHA                                                                      = 0x00000002
   9073 	LWA_COLORKEY                                                                   = 0x00000001
   9074 	LZERROR_BADINHANDLE                                                            = -1
   9075 	LZERROR_BADOUTHANDLE                                                           = -2
   9076 	LZERROR_BADVALUE                                                               = -7
   9077 	LZERROR_GLOBALLOC                                                              = -5
   9078 	LZERROR_GLOBLOCK                                                               = -6
   9079 	LZERROR_READ                                                                   = -3
   9080 	LZERROR_UNKNOWNALG                                                             = -8
   9081 	LZERROR_WRITE                                                                  = -4
   9082 	M10d_Any                                                                       = 1
   9083 	M10d_No                                                                        = 2
   9084 	M10d_Yes                                                                       = 0
   9085 	MAC_CHARSET                                                                    = 77
   9086 	MAPVK_VK_TO_CHAR                                                               = 2
   9087 	MAPVK_VK_TO_VSC                                                                = 0
   9088 	MAPVK_VSC_TO_VK                                                                = 1
   9089 	MAPVK_VSC_TO_VK_EX                                                             = 3
   9090 	MAP_COMPOSITE                                                                  = 0x00000040
   9091 	MAP_EXPAND_LIGATURES                                                           = 0x00002000
   9092 	MAP_FOLDCZONE                                                                  = 0x00000010
   9093 	MAP_FOLDDIGITS                                                                 = 0x00000080
   9094 	MAP_PRECOMPOSED                                                                = 0x00000020
   9095 	MARKPARITY                                                                     = 3
   9096 	MARK_HANDLE_NOT_REALTIME                                                       = 64
   9097 	MARK_HANDLE_NOT_TXF_SYSTEM_LOG                                                 = 8
   9098 	MARK_HANDLE_PROTECT_CLUSTERS                                                   = 1
   9099 	MARK_HANDLE_REALTIME                                                           = 32
   9100 	MARK_HANDLE_TXF_SYSTEM_LOG                                                     = 4
   9101 	MARSHALINTERFACE_MIN                                                           = 500
   9102 	MARSHAL_E_FIRST                                                                = 2147746080
   9103 	MARSHAL_E_LAST                                                                 = 2147746095
   9104 	MARSHAL_S_FIRST                                                                = 262432
   9105 	MARSHAL_S_LAST                                                                 = 262447
   9106 	MASK_TO_RESET_TLB_BITS                                                         = -97
   9107 	MAXBYTE                                                                        = 0xff
   9108 	MAXCHAR                                                                        = 0x7f
   9109 	MAXDWORD                                                                       = 0xffffffff
   9110 	MAXERRORLENGTH                                                                 = 256
   9111 	MAXGETHOSTSTRUCT                                                               = 1024
   9112 	MAXIMUM_ALLOWED                                                                = 33554432
   9113 	MAXIMUM_ATTR_STRING_LENGTH                                                     = 32
   9114 	MAXIMUM_ENCRYPTION_VALUE                                                       = 0x00000004
   9115 	MAXIMUM_PROCESSORS                                                             = 64
   9116 	MAXIMUM_PROC_PER_GROUP                                                         = 64
   9117 	MAXIMUM_REPARSE_DATA_BUFFER_SIZE                                               = 16384
   9118 	MAXIMUM_SMARTCARD_READERS                                                      = 10
   9119 	MAXIMUM_SUSPEND_COUNT                                                          = 127
   9120 	MAXIMUM_WAIT_OBJECTS                                                           = 64
   9121 	MAXIMUM_XSTATE_FEATURES                                                        = 64
   9122 	MAXINTATOM                                                                     = 0xc000
   9123 	MAXLOGICALLOGNAMESIZE                                                          = 256
   9124 	MAXLONG                                                                        = 0x7fffffff
   9125 	MAXLONGLONG                                                                    = 9223372036854775807
   9126 	MAXPNAMELEN                                                                    = 32
   9127 	MAXPROPPAGES                                                                   = 100
   9128 	MAXSHORT                                                                       = 0x7fff
   9129 	MAXSTRETCHBLTMODE                                                              = 4
   9130 	MAXUIDLEN                                                                      = 64
   9131 	MAXWORD                                                                        = 0xffff
   9132 	MAX_ACL_REVISION                                                               = 4
   9133 	MAX_COMPUTERNAME_LENGTH                                                        = 15
   9134 	MAX_DEFAULTCHAR                                                                = 2
   9135 	MAX_HW_COUNTERS                                                                = 16
   9136 	MAX_JOYSTICKOEMVXDNAME                                                         = 260
   9137 	MAX_LANA                                                                       = 254
   9138 	MAX_LEADBYTES                                                                  = 12
   9139 	MAX_MONITORS                                                                   = 4
   9140 	MAX_NUM_REASONS                                                                = 256
   9141 	MAX_PATH                                                                       = 260
   9142 	MAX_PERF_OBJECTS_IN_QUERY_FUNCTION                                             = 64
   9143 	MAX_PRIORITY                                                                   = 99
   9144 	MAX_PROFILE_LEN                                                                = 80
   9145 	MAX_REASON_BUGID_LEN                                                           = 32
   9146 	MAX_REASON_COMMENT_LEN                                                         = 512
   9147 	MAX_REASON_DESC_LEN                                                            = 256
   9148 	MAX_REASON_NAME_LEN                                                            = 64
   9149 	MAX_RESOURCEMANAGER_DESCRIPTION_LENGTH                                         = 64
   9150 	MAX_SECTOR_SIZE                                                                = 0x10000
   9151 	MAX_SHUTDOWN_TIMEOUT                                                           = 315360000
   9152 	MAX_SID_SIZE                                                                   = 256
   9153 	MAX_SIZE_SECURITY_ID                                                           = 512
   9154 	MAX_STR_BLOCKREASON                                                            = 256
   9155 	MAX_SUPPORTED_OS_NUM                                                           = 4
   9156 	MAX_TRANSACTION_DESCRIPTION_LENGTH                                             = 64
   9157 	MAX_VOLUME_ID_SIZE                                                             = 36
   9158 	MAX_VOLUME_TEMPLATE_SIZE                                                       = 40
   9159 	MA_ACTIVATE                                                                    = 1
   9160 	MA_ACTIVATEANDEAT                                                              = 2
   9161 	MA_NOACTIVATE                                                                  = 3
   9162 	MA_NOACTIVATEANDEAT                                                            = 4
   9163 	MB_ABORTRETRYIGNORE                                                            = 2
   9164 	MB_APPLMODAL                                                                   = 0
   9165 	MB_CANCELTRYCONTINUE                                                           = 6
   9166 	MB_COMPOSITE                                                                   = 0x00000002
   9167 	MB_DEFAULT_DESKTOP_ONLY                                                        = 131072
   9168 	MB_DEFBUTTON1                                                                  = 0
   9169 	MB_DEFBUTTON2                                                                  = 256
   9170 	MB_DEFBUTTON3                                                                  = 512
   9171 	MB_DEFBUTTON4                                                                  = 768
   9172 	MB_DEFMASK                                                                     = 3840
   9173 	MB_ERR_INVALID_CHARS                                                           = 0x00000008
   9174 	MB_HELP                                                                        = 16384
   9175 	MB_ICONASTERISK                                                                = 64
   9176 	MB_ICONERROR                                                                   = 16
   9177 	MB_ICONEXCLAMATION                                                             = 48
   9178 	MB_ICONHAND                                                                    = 16
   9179 	MB_ICONINFORMATION                                                             = 64
   9180 	MB_ICONMASK                                                                    = 240
   9181 	MB_ICONQUESTION                                                                = 32
   9182 	MB_ICONSTOP                                                                    = 16
   9183 	MB_ICONWARNING                                                                 = 48
   9184 	MB_LEN_MAX                                                                     = 5
   9185 	MB_MISCMASK                                                                    = 49152
   9186 	MB_MODEMASK                                                                    = 12288
   9187 	MB_NOFOCUS                                                                     = 32768
   9188 	MB_OK                                                                          = 0
   9189 	MB_OKCANCEL                                                                    = 1
   9190 	MB_PRECOMPOSED                                                                 = 0x00000001
   9191 	MB_RETRYCANCEL                                                                 = 5
   9192 	MB_RIGHT                                                                       = 524288
   9193 	MB_RTLREADING                                                                  = 1048576
   9194 	MB_SERVICE_NOTIFICATION                                                        = 2097152
   9195 	MB_SERVICE_NOTIFICATION_NT3X                                                   = 262144
   9196 	MB_SETFOREGROUND                                                               = 65536
   9197 	MB_SYSTEMMODAL                                                                 = 4096
   9198 	MB_TASKMODAL                                                                   = 8192
   9199 	MB_TOPMOST                                                                     = 262144
   9200 	MB_TYPEMASK                                                                    = 15
   9201 	MB_USEGLYPHCHARS                                                               = 0x00000004
   9202 	MB_USERICON                                                                    = 128
   9203 	MB_YESNO                                                                       = 4
   9204 	MB_YESNOCANCEL                                                                 = 3
   9205 	MCIERR_BAD_CONSTANT                                                            = 290
   9206 	MCIERR_BAD_INTEGER                                                             = 270
   9207 	MCIERR_BAD_TIME_FORMAT                                                         = 293
   9208 	MCIERR_BASE                                                                    = 256
   9209 	MCIERR_CANNOT_LOAD_DRIVER                                                      = 266
   9210 	MCIERR_CANNOT_USE_ALL                                                          = 279
   9211 	MCIERR_CREATEWINDOW                                                            = 347
   9212 	MCIERR_CUSTOM_DRIVER_BASE                                                      = 512
   9213 	MCIERR_DEVICE_LENGTH                                                           = 310
   9214 	MCIERR_DEVICE_LOCKED                                                           = 288
   9215 	MCIERR_DEVICE_NOT_INSTALLED                                                    = 306
   9216 	MCIERR_DEVICE_NOT_READY                                                        = 276
   9217 	MCIERR_DEVICE_OPEN                                                             = 265
   9218 	MCIERR_DEVICE_ORD_LENGTH                                                       = 311
   9219 	MCIERR_DEVICE_TYPE_REQUIRED                                                    = 287
   9220 	MCIERR_DRIVER                                                                  = 278
   9221 	MCIERR_DRIVER_INTERNAL                                                         = 272
   9222 	MCIERR_DUPLICATE_ALIAS                                                         = 289
   9223 	MCIERR_DUPLICATE_FLAGS                                                         = 295
   9224 	MCIERR_EXTENSION_NOT_FOUND                                                     = 281
   9225 	MCIERR_EXTRA_CHARACTERS                                                        = 305
   9226 	MCIERR_FILENAME_REQUIRED                                                       = 304
   9227 	MCIERR_FILE_NOT_FOUND                                                          = 275
   9228 	MCIERR_FILE_NOT_SAVED                                                          = 286
   9229 	MCIERR_FILE_READ                                                               = 348
   9230 	MCIERR_FILE_WRITE                                                              = 349
   9231 	MCIERR_FLAGS_NOT_COMPATIBLE                                                    = 284
   9232 	MCIERR_GET_CD                                                                  = 307
   9233 	MCIERR_HARDWARE                                                                = 262
   9234 	MCIERR_ILLEGAL_FOR_AUTO_OPEN                                                   = 303
   9235 	MCIERR_INTERNAL                                                                = 277
   9236 	MCIERR_INVALID_DEVICE_ID                                                       = 257
   9237 	MCIERR_INVALID_DEVICE_NAME                                                     = 263
   9238 	MCIERR_INVALID_FILE                                                            = 296
   9239 	MCIERR_MISSING_COMMAND_STRING                                                  = 267
   9240 	MCIERR_MISSING_DEVICE_NAME                                                     = 292
   9241 	MCIERR_MISSING_PARAMETER                                                       = 273
   9242 	MCIERR_MISSING_STRING_ARGUMENT                                                 = 269
   9243 	MCIERR_MULTIPLE                                                                = 280
   9244 	MCIERR_MUST_USE_SHAREABLE                                                      = 291
   9245 	MCIERR_NEW_REQUIRES_ALIAS                                                      = 299
   9246 	MCIERR_NONAPPLICABLE_FUNCTION                                                  = 302
   9247 	MCIERR_NOTIFY_ON_AUTO_OPEN                                                     = 300
   9248 	MCIERR_NO_CLOSING_QUOTE                                                        = 294
   9249 	MCIERR_NO_ELEMENT_ALLOWED                                                      = 301
   9250 	MCIERR_NO_IDENTITY                                                             = 350
   9251 	MCIERR_NO_INTEGER                                                              = 312
   9252 	MCIERR_NO_WINDOW                                                               = 346
   9253 	MCIERR_NULL_PARAMETER_BLOCK                                                    = 297
   9254 	MCIERR_OUTOFRANGE                                                              = 282
   9255 	MCIERR_OUT_OF_MEMORY                                                           = 264
   9256 	MCIERR_PARAM_OVERFLOW                                                          = 268
   9257 	MCIERR_PARSER_INTERNAL                                                         = 271
   9258 	MCIERR_SEQ_DIV_INCOMPATIBLE                                                    = 336
   9259 	MCIERR_SEQ_NOMIDIPRESENT                                                       = 343
   9260 	MCIERR_SEQ_PORTUNSPECIFIED                                                     = 342
   9261 	MCIERR_SEQ_PORT_INUSE                                                          = 337
   9262 	MCIERR_SEQ_PORT_MAPNODEVICE                                                    = 339
   9263 	MCIERR_SEQ_PORT_MISCERROR                                                      = 340
   9264 	MCIERR_SEQ_PORT_NONEXISTENT                                                    = 338
   9265 	MCIERR_SEQ_TIMER                                                               = 341
   9266 	MCIERR_SET_CD                                                                  = 308
   9267 	MCIERR_SET_DRIVE                                                               = 309
   9268 	MCIERR_UNNAMED_RESOURCE                                                        = 298
   9269 	MCIERR_UNRECOGNIZED_COMMAND                                                    = 261
   9270 	MCIERR_UNRECOGNIZED_KEYWORD                                                    = 259
   9271 	MCIERR_UNSUPPORTED_FUNCTION                                                    = 274
   9272 	MCIERR_WAVE_INPUTSINUSE                                                        = 322
   9273 	MCIERR_WAVE_INPUTSUNSUITABLE                                                   = 328
   9274 	MCIERR_WAVE_INPUTUNSPECIFIED                                                   = 325
   9275 	MCIERR_WAVE_OUTPUTSINUSE                                                       = 320
   9276 	MCIERR_WAVE_OUTPUTSUNSUITABLE                                                  = 326
   9277 	MCIERR_WAVE_OUTPUTUNSPECIFIED                                                  = 324
   9278 	MCIERR_WAVE_SETINPUTINUSE                                                      = 323
   9279 	MCIERR_WAVE_SETINPUTUNSUITABLE                                                 = 329
   9280 	MCIERR_WAVE_SETOUTPUTINUSE                                                     = 321
   9281 	MCIERR_WAVE_SETOUTPUTUNSUITABLE                                                = 327
   9282 	MCI_ANIM_GETDEVCAPS_CAN_REVERSE                                                = 16385
   9283 	MCI_ANIM_GETDEVCAPS_CAN_STRETCH                                                = 16391
   9284 	MCI_ANIM_GETDEVCAPS_FAST_RATE                                                  = 16386
   9285 	MCI_ANIM_GETDEVCAPS_MAX_WINDOWS                                                = 16392
   9286 	MCI_ANIM_GETDEVCAPS_NORMAL_RATE                                                = 16388
   9287 	MCI_ANIM_GETDEVCAPS_PALETTES                                                   = 16390
   9288 	MCI_ANIM_GETDEVCAPS_SLOW_RATE                                                  = 16387
   9289 	MCI_ANIM_INFO_TEXT                                                             = 65536
   9290 	MCI_ANIM_OPEN_NOSTATIC                                                         = 262144
   9291 	MCI_ANIM_OPEN_PARENT                                                           = 131072
   9292 	MCI_ANIM_OPEN_WS                                                               = 65536
   9293 	MCI_ANIM_PLAY_FAST                                                             = 262144
   9294 	MCI_ANIM_PLAY_REVERSE                                                          = 131072
   9295 	MCI_ANIM_PLAY_SCAN                                                             = 1048576
   9296 	MCI_ANIM_PLAY_SLOW                                                             = 524288
   9297 	MCI_ANIM_PLAY_SPEED                                                            = 65536
   9298 	MCI_ANIM_PUT_DESTINATION                                                       = 262144
   9299 	MCI_ANIM_PUT_SOURCE                                                            = 131072
   9300 	MCI_ANIM_REALIZE_BKGD                                                          = 131072
   9301 	MCI_ANIM_REALIZE_NORM                                                          = 65536
   9302 	MCI_ANIM_RECT                                                                  = 65536
   9303 	MCI_ANIM_STATUS_FORWARD                                                        = 16386
   9304 	MCI_ANIM_STATUS_HPAL                                                           = 16388
   9305 	MCI_ANIM_STATUS_HWND                                                           = 16387
   9306 	MCI_ANIM_STATUS_SPEED                                                          = 16385
   9307 	MCI_ANIM_STATUS_STRETCH                                                        = 16389
   9308 	MCI_ANIM_STEP_FRAMES                                                           = 131072
   9309 	MCI_ANIM_STEP_REVERSE                                                          = 65536
   9310 	MCI_ANIM_UPDATE_HDC                                                            = 131072
   9311 	MCI_ANIM_WHERE_DESTINATION                                                     = 262144
   9312 	MCI_ANIM_WHERE_SOURCE                                                          = 131072
   9313 	MCI_ANIM_WINDOW_DEFAULT                                                        = 0
   9314 	MCI_ANIM_WINDOW_DISABLE_STRETCH                                                = 2097152
   9315 	MCI_ANIM_WINDOW_ENABLE_STRETCH                                                 = 1048576
   9316 	MCI_ANIM_WINDOW_HWND                                                           = 65536
   9317 	MCI_ANIM_WINDOW_STATE                                                          = 262144
   9318 	MCI_ANIM_WINDOW_TEXT                                                           = 524288
   9319 	MCI_BREAK                                                                      = 0x0811
   9320 	MCI_BREAK_HWND                                                                 = 512
   9321 	MCI_BREAK_KEY                                                                  = 256
   9322 	MCI_BREAK_OFF                                                                  = 1024
   9323 	MCI_CDA_STATUS_TYPE_TRACK                                                      = 16385
   9324 	MCI_CDA_TRACK_AUDIO                                                            = 1088
   9325 	MCI_CDA_TRACK_OTHER                                                            = 1089
   9326 	MCI_CD_OFFSET                                                                  = 1088
   9327 	MCI_CLOSE                                                                      = 0x0804
   9328 	MCI_COPY                                                                       = 0x0852
   9329 	MCI_CUE                                                                        = 0x0830
   9330 	MCI_CUT                                                                        = 0x0851
   9331 	MCI_DELETE                                                                     = 0x0856
   9332 	MCI_DEVTYPE_ANIMATION                                                          = 519
   9333 	MCI_DEVTYPE_CD_AUDIO                                                           = 516
   9334 	MCI_DEVTYPE_DAT                                                                = 517
   9335 	MCI_DEVTYPE_DIGITAL_VIDEO                                                      = 520
   9336 	MCI_DEVTYPE_FIRST                                                              = 513
   9337 	MCI_DEVTYPE_FIRST_USER                                                         = 0x1000
   9338 	MCI_DEVTYPE_LAST                                                               = 523
   9339 	MCI_DEVTYPE_OTHER                                                              = 521
   9340 	MCI_DEVTYPE_OVERLAY                                                            = 515
   9341 	MCI_DEVTYPE_SCANNER                                                            = 518
   9342 	MCI_DEVTYPE_SEQUENCER                                                          = 523
   9343 	MCI_DEVTYPE_VCR                                                                = 513
   9344 	MCI_DEVTYPE_VIDEODISC                                                          = 514
   9345 	MCI_DEVTYPE_WAVEFORM_AUDIO                                                     = 522
   9346 	MCI_ESCAPE                                                                     = 0x0805
   9347 	MCI_FIRST                                                                      = 2048
   9348 	MCI_FORMAT_BYTES                                                               = 8
   9349 	MCI_FORMAT_FRAMES                                                              = 3
   9350 	MCI_FORMAT_HMS                                                                 = 1
   9351 	MCI_FORMAT_MILLISECONDS                                                        = 0
   9352 	MCI_FORMAT_MSF                                                                 = 2
   9353 	MCI_FORMAT_SAMPLES                                                             = 9
   9354 	MCI_FORMAT_SMPTE_24                                                            = 4
   9355 	MCI_FORMAT_SMPTE_25                                                            = 5
   9356 	MCI_FORMAT_SMPTE_30                                                            = 6
   9357 	MCI_FORMAT_SMPTE_30DROP                                                        = 7
   9358 	MCI_FORMAT_TMSF                                                                = 10
   9359 	MCI_FREEZE                                                                     = 0x0844
   9360 	MCI_FROM                                                                       = 4
   9361 	MCI_GETDEVCAPS                                                                 = 0x080B
   9362 	MCI_GETDEVCAPS_CAN_EJECT                                                       = 7
   9363 	MCI_GETDEVCAPS_CAN_PLAY                                                        = 8
   9364 	MCI_GETDEVCAPS_CAN_RECORD                                                      = 1
   9365 	MCI_GETDEVCAPS_CAN_SAVE                                                        = 9
   9366 	MCI_GETDEVCAPS_COMPOUND_DEVICE                                                 = 6
   9367 	MCI_GETDEVCAPS_DEVICE_TYPE                                                     = 4
   9368 	MCI_GETDEVCAPS_HAS_AUDIO                                                       = 2
   9369 	MCI_GETDEVCAPS_HAS_VIDEO                                                       = 3
   9370 	MCI_GETDEVCAPS_ITEM                                                            = 256
   9371 	MCI_GETDEVCAPS_USES_FILES                                                      = 5
   9372 	MCI_INFO                                                                       = 0x080A
   9373 	MCI_INFO_COPYRIGHT                                                             = 8192
   9374 	MCI_INFO_FILE                                                                  = 512
   9375 	MCI_INFO_MEDIA_IDENTITY                                                        = 2048
   9376 	MCI_INFO_MEDIA_UPC                                                             = 1024
   9377 	MCI_INFO_NAME                                                                  = 4096
   9378 	MCI_INFO_PRODUCT                                                               = 256
   9379 	MCI_LAST                                                                       = 0x0FFF
   9380 	MCI_LOAD                                                                       = 0x0850
   9381 	MCI_LOAD_FILE                                                                  = 256
   9382 	MCI_MODE_NOT_READY                                                             = 524
   9383 	MCI_MODE_OPEN                                                                  = 530
   9384 	MCI_MODE_PAUSE                                                                 = 529
   9385 	MCI_MODE_PLAY                                                                  = 526
   9386 	MCI_MODE_RECORD                                                                = 527
   9387 	MCI_MODE_SEEK                                                                  = 528
   9388 	MCI_MODE_STOP                                                                  = 525
   9389 	MCI_NOTIFY                                                                     = 1
   9390 	MCI_NOTIFY_ABORTED                                                             = 0x0004
   9391 	MCI_NOTIFY_FAILURE                                                             = 0x0008
   9392 	MCI_NOTIFY_SUCCESSFUL                                                          = 0x0001
   9393 	MCI_NOTIFY_SUPERSEDED                                                          = 0x0002
   9394 	MCI_OPEN                                                                       = 0x0803
   9395 	MCI_OPEN_ALIAS                                                                 = 1024
   9396 	MCI_OPEN_ELEMENT                                                               = 512
   9397 	MCI_OPEN_ELEMENT_ID                                                            = 2048
   9398 	MCI_OPEN_SHAREABLE                                                             = 256
   9399 	MCI_OPEN_TYPE                                                                  = 8192
   9400 	MCI_OPEN_TYPE_ID                                                               = 4096
   9401 	MCI_OVLY_GETDEVCAPS_CAN_FREEZE                                                 = 16386
   9402 	MCI_OVLY_GETDEVCAPS_CAN_STRETCH                                                = 16385
   9403 	MCI_OVLY_GETDEVCAPS_MAX_WINDOWS                                                = 16387
   9404 	MCI_OVLY_INFO_TEXT                                                             = 65536
   9405 	MCI_OVLY_OPEN_PARENT                                                           = 131072
   9406 	MCI_OVLY_OPEN_WS                                                               = 65536
   9407 	MCI_OVLY_PUT_DESTINATION                                                       = 262144
   9408 	MCI_OVLY_PUT_FRAME                                                             = 524288
   9409 	MCI_OVLY_PUT_SOURCE                                                            = 131072
   9410 	MCI_OVLY_PUT_VIDEO                                                             = 1048576
   9411 	MCI_OVLY_RECT                                                                  = 65536
   9412 	MCI_OVLY_STATUS_HWND                                                           = 16385
   9413 	MCI_OVLY_STATUS_STRETCH                                                        = 16386
   9414 	MCI_OVLY_WHERE_DESTINATION                                                     = 262144
   9415 	MCI_OVLY_WHERE_FRAME                                                           = 524288
   9416 	MCI_OVLY_WHERE_SOURCE                                                          = 131072
   9417 	MCI_OVLY_WHERE_VIDEO                                                           = 1048576
   9418 	MCI_OVLY_WINDOW_DEFAULT                                                        = 0
   9419 	MCI_OVLY_WINDOW_DISABLE_STRETCH                                                = 2097152
   9420 	MCI_OVLY_WINDOW_ENABLE_STRETCH                                                 = 1048576
   9421 	MCI_OVLY_WINDOW_HWND                                                           = 65536
   9422 	MCI_OVLY_WINDOW_STATE                                                          = 262144
   9423 	MCI_OVLY_WINDOW_TEXT                                                           = 524288
   9424 	MCI_PASTE                                                                      = 0x0853
   9425 	MCI_PAUSE                                                                      = 0x0809
   9426 	MCI_PLAY                                                                       = 0x0806
   9427 	MCI_PUT                                                                        = 0x0842
   9428 	MCI_REALIZE                                                                    = 0x0840
   9429 	MCI_RECORD                                                                     = 0x080F
   9430 	MCI_RECORD_INSERT                                                              = 256
   9431 	MCI_RECORD_OVERWRITE                                                           = 512
   9432 	MCI_RESUME                                                                     = 0x0855
   9433 	MCI_SAVE                                                                       = 0x0813
   9434 	MCI_SAVE_FILE                                                                  = 256
   9435 	MCI_SEEK                                                                       = 0x0807
   9436 	MCI_SEEK_TO_END                                                                = 512
   9437 	MCI_SEEK_TO_START                                                              = 256
   9438 	MCI_SEQ_DIV_PPQN                                                               = 1216
   9439 	MCI_SEQ_DIV_SMPTE_24                                                           = 1217
   9440 	MCI_SEQ_DIV_SMPTE_25                                                           = 1218
   9441 	MCI_SEQ_DIV_SMPTE_30                                                           = 1220
   9442 	MCI_SEQ_DIV_SMPTE_30DROP                                                       = 1219
   9443 	MCI_SEQ_FILE                                                                   = 0x4002
   9444 	MCI_SEQ_FORMAT_SONGPTR                                                         = 0x4001
   9445 	MCI_SEQ_MAPPER                                                                 = 65535
   9446 	MCI_SEQ_MIDI                                                                   = 0x4003
   9447 	MCI_SEQ_NONE                                                                   = 65533
   9448 	MCI_SEQ_OFFSET                                                                 = 1216
   9449 	MCI_SEQ_SET_MASTER                                                             = 524288
   9450 	MCI_SEQ_SET_OFFSET                                                             = 16777216
   9451 	MCI_SEQ_SET_PORT                                                               = 131072
   9452 	MCI_SEQ_SET_SLAVE                                                              = 262144
   9453 	MCI_SEQ_SET_TEMPO                                                              = 65536
   9454 	MCI_SEQ_SMPTE                                                                  = 0x4004
   9455 	MCI_SEQ_STATUS_COPYRIGHT                                                       = 16396
   9456 	MCI_SEQ_STATUS_DIVTYPE                                                         = 16394
   9457 	MCI_SEQ_STATUS_MASTER                                                          = 16392
   9458 	MCI_SEQ_STATUS_NAME                                                            = 16395
   9459 	MCI_SEQ_STATUS_OFFSET                                                          = 16393
   9460 	MCI_SEQ_STATUS_PORT                                                            = 16387
   9461 	MCI_SEQ_STATUS_SLAVE                                                           = 16391
   9462 	MCI_SEQ_STATUS_TEMPO                                                           = 16386
   9463 	MCI_SET                                                                        = 0x080D
   9464 	MCI_SET_AUDIO                                                                  = 2048
   9465 	MCI_SET_AUDIO_ALL                                                              = 0
   9466 	MCI_SET_AUDIO_LEFT                                                             = 1
   9467 	MCI_SET_AUDIO_RIGHT                                                            = 2
   9468 	MCI_SET_DOOR_CLOSED                                                            = 512
   9469 	MCI_SET_DOOR_OPEN                                                              = 256
   9470 	MCI_SET_OFF                                                                    = 16384
   9471 	MCI_SET_ON                                                                     = 8192
   9472 	MCI_SET_TIME_FORMAT                                                            = 1024
   9473 	MCI_SET_VIDEO                                                                  = 4096
   9474 	MCI_SPIN                                                                       = 0x080C
   9475 	MCI_STATUS                                                                     = 0x0814
   9476 	MCI_STATUS_CURRENT_TRACK                                                       = 8
   9477 	MCI_STATUS_ITEM                                                                = 256
   9478 	MCI_STATUS_LENGTH                                                              = 1
   9479 	MCI_STATUS_MEDIA_PRESENT                                                       = 5
   9480 	MCI_STATUS_MODE                                                                = 4
   9481 	MCI_STATUS_NUMBER_OF_TRACKS                                                    = 3
   9482 	MCI_STATUS_POSITION                                                            = 2
   9483 	MCI_STATUS_READY                                                               = 7
   9484 	MCI_STATUS_START                                                               = 512
   9485 	MCI_STATUS_TIME_FORMAT                                                         = 6
   9486 	MCI_STEP                                                                       = 0x080E
   9487 	MCI_STOP                                                                       = 0x0808
   9488 	MCI_STRING_OFFSET                                                              = 512
   9489 	MCI_SYSINFO                                                                    = 0x0810
   9490 	MCI_SYSINFO_INSTALLNAME                                                        = 2048
   9491 	MCI_SYSINFO_NAME                                                               = 1024
   9492 	MCI_SYSINFO_OPEN                                                               = 512
   9493 	MCI_SYSINFO_QUANTITY                                                           = 256
   9494 	MCI_TO                                                                         = 8
   9495 	MCI_TRACK                                                                      = 16
   9496 	MCI_UNFREEZE                                                                   = 0x0845
   9497 	MCI_UPDATE                                                                     = 0x0854
   9498 	MCI_USER_MESSAGES                                                              = 3072
   9499 	MCI_VD_ESCAPE_STRING                                                           = 256
   9500 	MCI_VD_FORMAT_TRACK                                                            = 0x4001
   9501 	MCI_VD_GETDEVCAPS_CAN_REVERSE                                                  = 16386
   9502 	MCI_VD_GETDEVCAPS_CAV                                                          = 131072
   9503 	MCI_VD_GETDEVCAPS_CLV                                                          = 65536
   9504 	MCI_VD_GETDEVCAPS_FAST_RATE                                                    = 16387
   9505 	MCI_VD_GETDEVCAPS_NORMAL_RATE                                                  = 16389
   9506 	MCI_VD_GETDEVCAPS_SLOW_RATE                                                    = 16388
   9507 	MCI_VD_MEDIA_CAV                                                               = 1027
   9508 	MCI_VD_MEDIA_CLV                                                               = 1026
   9509 	MCI_VD_MEDIA_OTHER                                                             = 1028
   9510 	MCI_VD_MODE_PARK                                                               = 1025
   9511 	MCI_VD_OFFSET                                                                  = 1024
   9512 	MCI_VD_PLAY_FAST                                                               = 131072
   9513 	MCI_VD_PLAY_REVERSE                                                            = 65536
   9514 	MCI_VD_PLAY_SCAN                                                               = 524288
   9515 	MCI_VD_PLAY_SLOW                                                               = 1048576
   9516 	MCI_VD_PLAY_SPEED                                                              = 262144
   9517 	MCI_VD_SEEK_REVERSE                                                            = 65536
   9518 	MCI_VD_SPIN_DOWN                                                               = 131072
   9519 	MCI_VD_SPIN_UP                                                                 = 65536
   9520 	MCI_VD_STATUS_DISC_SIZE                                                        = 16390
   9521 	MCI_VD_STATUS_FORWARD                                                          = 16387
   9522 	MCI_VD_STATUS_MEDIA_TYPE                                                       = 16388
   9523 	MCI_VD_STATUS_SIDE                                                             = 16389
   9524 	MCI_VD_STATUS_SPEED                                                            = 16386
   9525 	MCI_VD_STEP_FRAMES                                                             = 65536
   9526 	MCI_VD_STEP_REVERSE                                                            = 131072
   9527 	MCI_WAIT                                                                       = 2
   9528 	MCI_WAVE_GETDEVCAPS_INPUTS                                                     = 16385
   9529 	MCI_WAVE_GETDEVCAPS_OUTPUTS                                                    = 16386
   9530 	MCI_WAVE_INPUT                                                                 = 4194304
   9531 	MCI_WAVE_MAPPER                                                                = 1153
   9532 	MCI_WAVE_OFFSET                                                                = 1152
   9533 	MCI_WAVE_OPEN_BUFFER                                                           = 65536
   9534 	MCI_WAVE_OUTPUT                                                                = 8388608
   9535 	MCI_WAVE_PCM                                                                   = 1152
   9536 	MCI_WAVE_SET_ANYINPUT                                                          = 67108864
   9537 	MCI_WAVE_SET_ANYOUTPUT                                                         = 134217728
   9538 	MCI_WAVE_SET_AVGBYTESPERSEC                                                    = 524288
   9539 	MCI_WAVE_SET_BITSPERSAMPLE                                                     = 2097152
   9540 	MCI_WAVE_SET_BLOCKALIGN                                                        = 1048576
   9541 	MCI_WAVE_SET_CHANNELS                                                          = 131072
   9542 	MCI_WAVE_SET_FORMATTAG                                                         = 65536
   9543 	MCI_WAVE_SET_SAMPLESPERSEC                                                     = 262144
   9544 	MCI_WAVE_STATUS_AVGBYTESPERSEC                                                 = 16388
   9545 	MCI_WAVE_STATUS_BITSPERSAMPLE                                                  = 16390
   9546 	MCI_WAVE_STATUS_BLOCKALIGN                                                     = 16389
   9547 	MCI_WAVE_STATUS_CHANNELS                                                       = 16386
   9548 	MCI_WAVE_STATUS_FORMATTAG                                                      = 16385
   9549 	MCI_WAVE_STATUS_LEVEL                                                          = 16391
   9550 	MCI_WAVE_STATUS_SAMPLESPERSEC                                                  = 16387
   9551 	MCI_WHERE                                                                      = 0x0843
   9552 	MCI_WINDOW                                                                     = 0x0841
   9553 	MDIS_ALLCHILDSTYLES                                                            = 0x0001
   9554 	MDITILE_HORIZONTAL                                                             = 0x0001
   9555 	MDITILE_SKIPDISABLED                                                           = 0x0002
   9556 	MDITILE_VERTICAL                                                               = 0x0000
   9557 	MDITILE_ZORDER                                                                 = 0x0004
   9558 	MDMSPKRFLAG_CALLSETUP                                                          = 0x00000008
   9559 	MDMSPKRFLAG_DIAL                                                               = 0x00000002
   9560 	MDMSPKRFLAG_OFF                                                                = 0x00000001
   9561 	MDMSPKRFLAG_ON                                                                 = 0x00000004
   9562 	MDMSPKR_CALLSETUP                                                              = 0x00000003
   9563 	MDMSPKR_DIAL                                                                   = 0x00000001
   9564 	MDMSPKR_OFF                                                                    = 0x00000000
   9565 	MDMSPKR_ON                                                                     = 0x00000002
   9566 	MDMVOLFLAG_HIGH                                                                = 0x00000004
   9567 	MDMVOLFLAG_LOW                                                                 = 0x00000001
   9568 	MDMVOLFLAG_MEDIUM                                                              = 0x00000002
   9569 	MDMVOL_HIGH                                                                    = 0x00000002
   9570 	MDMVOL_LOW                                                                     = 0x00000000
   9571 	MDMVOL_MEDIUM                                                                  = 0x00000001
   9572 	MDM_ANALOG_RLP_OFF                                                             = 0x1
   9573 	MDM_ANALOG_RLP_ON                                                              = 0x0
   9574 	MDM_ANALOG_V34                                                                 = 0x2
   9575 	MDM_AUTO_ML_2                                                                  = 0x2
   9576 	MDM_AUTO_ML_DEFAULT                                                            = 0x0
   9577 	MDM_AUTO_ML_NONE                                                               = 0x1
   9578 	MDM_AUTO_SPEED_DEFAULT                                                         = 0x0
   9579 	MDM_BEARERMODE_ANALOG                                                          = 0x0
   9580 	MDM_BEARERMODE_GSM                                                             = 0x2
   9581 	MDM_BEARERMODE_ISDN                                                            = 0x1
   9582 	MDM_BLIND_DIAL                                                                 = 0x00000200
   9583 	MDM_CCITT_OVERRIDE                                                             = 0x00000040
   9584 	MDM_CELLULAR                                                                   = 0x00000008
   9585 	MDM_COMPRESSION                                                                = 0x00000001
   9586 	MDM_DIAGNOSTICS                                                                = 0x00000800
   9587 	MDM_ERROR_CONTROL                                                              = 0x00000002
   9588 	MDM_FLOWCONTROL_HARD                                                           = 0x00000010
   9589 	MDM_FLOWCONTROL_SOFT                                                           = 0x00000020
   9590 	MDM_FORCED_EC                                                                  = 0x00000004
   9591 	MDM_HDLCPPP_AUTH_CHAP                                                          = 0x3
   9592 	MDM_HDLCPPP_AUTH_DEFAULT                                                       = 0x0
   9593 	MDM_HDLCPPP_AUTH_MSCHAP                                                        = 0x4
   9594 	MDM_HDLCPPP_AUTH_NONE                                                          = 0x1
   9595 	MDM_HDLCPPP_AUTH_PAP                                                           = 0x2
   9596 	MDM_HDLCPPP_ML_2                                                               = 0x2
   9597 	MDM_HDLCPPP_ML_DEFAULT                                                         = 0x0
   9598 	MDM_HDLCPPP_ML_NONE                                                            = 0x1
   9599 	MDM_HDLCPPP_SPEED_56K                                                          = 0x2
   9600 	MDM_HDLCPPP_SPEED_64K                                                          = 0x1
   9601 	MDM_HDLCPPP_SPEED_DEFAULT                                                      = 0x0
   9602 	MDM_MASK_AUTO_ML                                                               = 192
   9603 	MDM_MASK_AUTO_SPEED                                                            = 0x7
   9604 	MDM_MASK_BEARERMODE                                                            = 0x0000f000
   9605 	MDM_MASK_EXTENDEDINFO                                                          = 268431360
   9606 	MDM_MASK_HDLCPPP_AUTH                                                          = 56
   9607 	MDM_MASK_HDLCPPP_ML                                                            = 192
   9608 	MDM_MASK_HDLCPPP_SPEED                                                         = 0x7
   9609 	MDM_MASK_PROTOCOLDATA                                                          = 0x0ff00000
   9610 	MDM_MASK_PROTOCOLID                                                            = 0x000f0000
   9611 	MDM_MASK_PROTOCOLINFO                                                          = 268369920
   9612 	MDM_MASK_V110_SPEED                                                            = 0xf
   9613 	MDM_MASK_V120_ML                                                               = 192
   9614 	MDM_MASK_V120_SPEED                                                            = 0x7
   9615 	MDM_MASK_X75_DATA                                                              = 0x7
   9616 	MDM_PIAFS_INCOMING                                                             = 0
   9617 	MDM_PIAFS_OUTGOING                                                             = 1
   9618 	MDM_PROTOCOLID_ANALOG                                                          = 0x7
   9619 	MDM_PROTOCOLID_AUTO                                                            = 0x6
   9620 	MDM_PROTOCOLID_DEFAULT                                                         = 0x0
   9621 	MDM_PROTOCOLID_GPRS                                                            = 0x8
   9622 	MDM_PROTOCOLID_HDLCPPP                                                         = 0x1
   9623 	MDM_PROTOCOLID_PIAFS                                                           = 0x9
   9624 	MDM_PROTOCOLID_V110                                                            = 0x4
   9625 	MDM_PROTOCOLID_V120                                                            = 0x5
   9626 	MDM_PROTOCOLID_V128                                                            = 0x2
   9627 	MDM_PROTOCOLID_X75                                                             = 0x3
   9628 	MDM_PROTOCOL_ANALOG_NRLP                                                       = 1507328
   9629 	MDM_PROTOCOL_ANALOG_RLP                                                        = 458752
   9630 	MDM_PROTOCOL_ANALOG_V34                                                        = 2555904
   9631 	MDM_PROTOCOL_AUTO_1CH                                                          = 67502080
   9632 	MDM_PROTOCOL_AUTO_2CH                                                          = 134610944
   9633 	MDM_PROTOCOL_GPRS                                                              = 524288
   9634 	MDM_PROTOCOL_HDLCPPP_112K                                                      = 136380416
   9635 	MDM_PROTOCOL_HDLCPPP_112K_CHAP                                                 = 161546240
   9636 	MDM_PROTOCOL_HDLCPPP_112K_MSCHAP                                               = 169934848
   9637 	MDM_PROTOCOL_HDLCPPP_112K_PAP                                                  = 153157632
   9638 	MDM_PROTOCOL_HDLCPPP_128K                                                      = 135331840
   9639 	MDM_PROTOCOL_HDLCPPP_128K_CHAP                                                 = 160497664
   9640 	MDM_PROTOCOL_HDLCPPP_128K_MSCHAP                                               = 168886272
   9641 	MDM_PROTOCOL_HDLCPPP_128K_PAP                                                  = 152109056
   9642 	MDM_PROTOCOL_HDLCPPP_56K                                                       = 2162688
   9643 	MDM_PROTOCOL_HDLCPPP_64K                                                       = 1114112
   9644 	MDM_PROTOCOL_PIAFS_INCOMING                                                    = 589824
   9645 	MDM_PROTOCOL_PIAFS_OUTGOING                                                    = 1638400
   9646 	MDM_PROTOCOL_V110_12DOT0K                                                      = 5505024
   9647 	MDM_PROTOCOL_V110_14DOT4K                                                      = 6553600
   9648 	MDM_PROTOCOL_V110_19DOT2K                                                      = 7602176
   9649 	MDM_PROTOCOL_V110_1DOT2K                                                       = 1310720
   9650 	MDM_PROTOCOL_V110_28DOT8K                                                      = 8650752
   9651 	MDM_PROTOCOL_V110_2DOT4K                                                       = 2359296
   9652 	MDM_PROTOCOL_V110_38DOT4K                                                      = 9699328
   9653 	MDM_PROTOCOL_V110_4DOT8K                                                       = 3407872
   9654 	MDM_PROTOCOL_V110_57DOT6K                                                      = 10747904
   9655 	MDM_PROTOCOL_V110_9DOT6K                                                       = 4456448
   9656 	MDM_PROTOCOL_V120_112K                                                         = 136642560
   9657 	MDM_PROTOCOL_V120_128K                                                         = 135593984
   9658 	MDM_PROTOCOL_V120_56K                                                          = 69533696
   9659 	MDM_PROTOCOL_V120_64K                                                          = 68485120
   9660 	MDM_PROTOCOL_X75_128K                                                          = 2293760
   9661 	MDM_PROTOCOL_X75_64K                                                           = 1245184
   9662 	MDM_PROTOCOL_X75_BTX                                                           = 4390912
   9663 	MDM_PROTOCOL_X75_T_70                                                          = 3342336
   9664 	MDM_SHIFT_AUTO_ML                                                              = 0x6
   9665 	MDM_SHIFT_AUTO_SPEED                                                           = 0x0
   9666 	MDM_SHIFT_BEARERMODE                                                           = 12
   9667 	MDM_SHIFT_EXTENDEDINFO                                                         = 12
   9668 	MDM_SHIFT_HDLCPPP_AUTH                                                         = 0x3
   9669 	MDM_SHIFT_HDLCPPP_ML                                                           = 0x6
   9670 	MDM_SHIFT_HDLCPPP_SPEED                                                        = 0x0
   9671 	MDM_SHIFT_PROTOCOLDATA                                                         = 20
   9672 	MDM_SHIFT_PROTOCOLID                                                           = 16
   9673 	MDM_SHIFT_PROTOCOLINFO                                                         = 16
   9674 	MDM_SHIFT_V110_SPEED                                                           = 0x0
   9675 	MDM_SHIFT_V120_ML                                                              = 0x6
   9676 	MDM_SHIFT_V120_SPEED                                                           = 0x0
   9677 	MDM_SHIFT_X75_DATA                                                             = 0x0
   9678 	MDM_SPEED_ADJUST                                                               = 0x00000080
   9679 	MDM_TONE_DIAL                                                                  = 0x00000100
   9680 	MDM_V110_SPEED_12DOT0K                                                         = 0x5
   9681 	MDM_V110_SPEED_14DOT4K                                                         = 0x6
   9682 	MDM_V110_SPEED_19DOT2K                                                         = 0x7
   9683 	MDM_V110_SPEED_1DOT2K                                                          = 0x1
   9684 	MDM_V110_SPEED_28DOT8K                                                         = 0x8
   9685 	MDM_V110_SPEED_2DOT4K                                                          = 0x2
   9686 	MDM_V110_SPEED_38DOT4K                                                         = 0x9
   9687 	MDM_V110_SPEED_4DOT8K                                                          = 0x3
   9688 	MDM_V110_SPEED_57DOT6K                                                         = 0xA
   9689 	MDM_V110_SPEED_9DOT6K                                                          = 0x4
   9690 	MDM_V110_SPEED_DEFAULT                                                         = 0x0
   9691 	MDM_V120_ML_2                                                                  = 0x2
   9692 	MDM_V120_ML_DEFAULT                                                            = 0x0
   9693 	MDM_V120_ML_NONE                                                               = 0x1
   9694 	MDM_V120_SPEED_56K                                                             = 0x2
   9695 	MDM_V120_SPEED_64K                                                             = 0x1
   9696 	MDM_V120_SPEED_DEFAULT                                                         = 0x0
   9697 	MDM_V23_OVERRIDE                                                               = 0x00000400
   9698 	MDM_X75_DATA_128K                                                              = 0x2
   9699 	MDM_X75_DATA_64K                                                               = 0x1
   9700 	MDM_X75_DATA_BTX                                                               = 0x4
   9701 	MDM_X75_DATA_DEFAULT                                                           = 0x0
   9702 	MDM_X75_DATA_T_70                                                              = 0x3
   9703 	MEDIA_CURRENTLY_MOUNTED                                                        = 0x80000000
   9704 	MEDIA_ERASEABLE                                                                = 0x00000001
   9705 	MEDIA_READ_ONLY                                                                = 0x00000004
   9706 	MEDIA_READ_WRITE                                                               = 0x00000008
   9707 	MEDIA_WRITE_ONCE                                                               = 0x00000002
   9708 	MEDIA_WRITE_PROTECTED                                                          = 0x00000100
   9709 	MEMBERID_NIL                                                                   = -1
   9710 	MEMJOURNAL_DFLT_FILECHUNKSIZE                                                  = 1024
   9711 	MEMORY_ALLOCATION_ALIGNMENT                                                    = 16
   9712 	MEMORY_PRIORITY_BELOW_NORMAL                                                   = 4
   9713 	MEMORY_PRIORITY_LOW                                                            = 2
   9714 	MEMORY_PRIORITY_MEDIUM                                                         = 3
   9715 	MEMORY_PRIORITY_NORMAL                                                         = 5
   9716 	MEMORY_PRIORITY_VERY_LOW                                                       = 1
   9717 	MEMTYPE_HEAP                                                                   = 0x01
   9718 	MEMTYPE_LOOKASIDE                                                              = 0x02
   9719 	MEMTYPE_PCACHE                                                                 = 0x04
   9720 	MEM_4MB_PAGES                                                                  = 0x80000000
   9721 	MEM_64K_PAGES                                                                  = 541065216
   9722 	MEM_AffMask                                                                    = 0x003f
   9723 	MEM_Agg                                                                        = 0x8000
   9724 	MEM_Blob                                                                       = 0x0010
   9725 	MEM_COMMIT                                                                     = 0x1000
   9726 	MEM_Cleared                                                                    = 0x0100
   9727 	MEM_DECOMMIT                                                                   = 0x4000
   9728 	MEM_DIFFERENT_IMAGE_BASE_OK                                                    = 0x800000
   9729 	MEM_Dyn                                                                        = 0x1000
   9730 	MEM_EXTENDED_PARAMETER_GRAPHICS                                                = 0x01
   9731 	MEM_EXTENDED_PARAMETER_NONPAGED                                                = 0x02
   9732 	MEM_EXTENDED_PARAMETER_NONPAGED_HUGE                                           = 0x10
   9733 	MEM_EXTENDED_PARAMETER_NONPAGED_LARGE                                          = 0x08
   9734 	MEM_EXTENDED_PARAMETER_TYPE_BITS                                               = 8
   9735 	MEM_EXTENDED_PARAMETER_ZERO_PAGES_OPTIONAL                                     = 0x04
   9736 	MEM_Ephem                                                                      = 0x4000
   9737 	MEM_FREE                                                                       = 0x10000
   9738 	MEM_FromBind                                                                   = 0x0040
   9739 	MEM_IMAGE                                                                      = 16777216
   9740 	MEM_Int                                                                        = 0x0004
   9741 	MEM_IntReal                                                                    = 0x0020
   9742 	MEM_LARGE_PAGES                                                                = 0x20000000
   9743 	MEM_MAPPED                                                                     = 0x40000
   9744 	MEM_Null                                                                       = 0x0001
   9745 	MEM_PHYSICAL                                                                   = 0x400000
   9746 	MEM_PRIVATE                                                                    = 0x20000
   9747 	MEM_RELEASE                                                                    = 0x8000
   9748 	MEM_RESERVE                                                                    = 0x2000
   9749 	MEM_RESET                                                                      = 0x80000
   9750 	MEM_RESET_UNDO                                                                 = 0x1000000
   9751 	MEM_ROTATE                                                                     = 0x800000
   9752 	MEM_Real                                                                       = 0x0008
   9753 	MEM_Static                                                                     = 0x2000
   9754 	MEM_Str                                                                        = 0x0002
   9755 	MEM_Subtype                                                                    = 0x0800
   9756 	MEM_TOP_DOWN                                                                   = 0x100000
   9757 	MEM_Term                                                                       = 0x0200
   9758 	MEM_TypeMask                                                                   = 0x0dbf
   9759 	MEM_UNMAP_WITH_TRANSIENT_BOOST                                                 = 0x01
   9760 	MEM_Undefined                                                                  = 0x0000
   9761 	MEM_WRITE_WATCH                                                                = 0x200000
   9762 	MEM_Zero                                                                       = 0x0400
   9763 	MENU_EVENT                                                                     = 0x8
   9764 	MESSAGE_RESOURCE_UNICODE                                                       = 0x0001
   9765 	METAFILE_DRIVER                                                                = 2049
   9766 	META_ANIMATEPALETTE                                                            = 0x0436
   9767 	META_ARC                                                                       = 0x0817
   9768 	META_BITBLT                                                                    = 0x0922
   9769 	META_CHORD                                                                     = 0x0830
   9770 	META_CREATEBRUSHINDIRECT                                                       = 0x02FC
   9771 	META_CREATEFONTINDIRECT                                                        = 0x02FB
   9772 	META_CREATEPALETTE                                                             = 0x00f7
   9773 	META_CREATEPATTERNBRUSH                                                        = 0x01F9
   9774 	META_CREATEPENINDIRECT                                                         = 0x02FA
   9775 	META_CREATEREGION                                                              = 0x06FF
   9776 	META_DELETEOBJECT                                                              = 0x01f0
   9777 	META_DIBBITBLT                                                                 = 0x0940
   9778 	META_DIBCREATEPATTERNBRUSH                                                     = 0x0142
   9779 	META_DIBSTRETCHBLT                                                             = 0x0b41
   9780 	META_ELLIPSE                                                                   = 0x0418
   9781 	META_ESCAPE                                                                    = 0x0626
   9782 	META_EXCLUDECLIPRECT                                                           = 0x0415
   9783 	META_EXTFLOODFILL                                                              = 0x0548
   9784 	META_EXTTEXTOUT                                                                = 0x0a32
   9785 	META_FILLREGION                                                                = 0x0228
   9786 	META_FLOODFILL                                                                 = 0x0419
   9787 	META_FRAMEREGION                                                               = 0x0429
   9788 	META_INTERSECTCLIPRECT                                                         = 0x0416
   9789 	META_INVERTREGION                                                              = 0x012A
   9790 	META_LINETO                                                                    = 0x0213
   9791 	META_MOVETO                                                                    = 0x0214
   9792 	META_OFFSETCLIPRGN                                                             = 0x0220
   9793 	META_OFFSETVIEWPORTORG                                                         = 0x0211
   9794 	META_OFFSETWINDOWORG                                                           = 0x020F
   9795 	META_PAINTREGION                                                               = 0x012B
   9796 	META_PATBLT                                                                    = 0x061D
   9797 	META_PIE                                                                       = 0x081A
   9798 	META_POLYGON                                                                   = 0x0324
   9799 	META_POLYLINE                                                                  = 0x0325
   9800 	META_POLYPOLYGON                                                               = 0x0538
   9801 	META_REALIZEPALETTE                                                            = 0x0035
   9802 	META_RECTANGLE                                                                 = 0x041B
   9803 	META_RESIZEPALETTE                                                             = 0x0139
   9804 	META_RESTOREDC                                                                 = 0x0127
   9805 	META_ROUNDRECT                                                                 = 0x061C
   9806 	META_SAVEDC                                                                    = 0x001E
   9807 	META_SCALEVIEWPORTEXT                                                          = 0x0412
   9808 	META_SCALEWINDOWEXT                                                            = 0x0410
   9809 	META_SELECTCLIPREGION                                                          = 0x012C
   9810 	META_SELECTOBJECT                                                              = 0x012D
   9811 	META_SELECTPALETTE                                                             = 0x0234
   9812 	META_SETBKCOLOR                                                                = 0x0201
   9813 	META_SETBKMODE                                                                 = 0x0102
   9814 	META_SETDIBTODEV                                                               = 0x0d33
   9815 	META_SETLAYOUT                                                                 = 0x0149
   9816 	META_SETMAPMODE                                                                = 0x0103
   9817 	META_SETMAPPERFLAGS                                                            = 0x0231
   9818 	META_SETPALENTRIES                                                             = 0x0037
   9819 	META_SETPIXEL                                                                  = 0x041F
   9820 	META_SETPOLYFILLMODE                                                           = 0x0106
   9821 	META_SETRELABS                                                                 = 0x0105
   9822 	META_SETROP2                                                                   = 0x0104
   9823 	META_SETSTRETCHBLTMODE                                                         = 0x0107
   9824 	META_SETTEXTALIGN                                                              = 0x012E
   9825 	META_SETTEXTCHAREXTRA                                                          = 0x0108
   9826 	META_SETTEXTCOLOR                                                              = 0x0209
   9827 	META_SETTEXTJUSTIFICATION                                                      = 0x020A
   9828 	META_SETVIEWPORTEXT                                                            = 0x020E
   9829 	META_SETVIEWPORTORG                                                            = 0x020D
   9830 	META_SETWINDOWEXT                                                              = 0x020C
   9831 	META_SETWINDOWORG                                                              = 0x020B
   9832 	META_STRETCHBLT                                                                = 0x0B23
   9833 	META_STRETCHDIB                                                                = 0x0f43
   9834 	META_TEXTOUT                                                                   = 0x0521
   9835 	METHOD_BUFFERED                                                                = 0
   9836 	METHOD_DIRECT_FROM_HARDWARE                                                    = 2
   9837 	METHOD_DIRECT_TO_HARDWARE                                                      = 1
   9838 	METHOD_IN_DIRECT                                                               = 1
   9839 	METHOD_NEITHER                                                                 = 3
   9840 	METHOD_OUT_DIRECT                                                              = 2
   9841 	METRICS_USEDEFAULT                                                             = -1
   9842 	MEVT_F_CALLBACK                                                                = 1073741824
   9843 	MEVT_F_LONG                                                                    = 2147483648
   9844 	MEVT_F_SHORT                                                                   = 0
   9845 	MFCOMMENT                                                                      = 15
   9846 	MFS_CHECKED                                                                    = 8
   9847 	MFS_DEFAULT                                                                    = 4096
   9848 	MFS_DISABLED                                                                   = 3
   9849 	MFS_ENABLED                                                                    = 0
   9850 	MFS_GRAYED                                                                     = 3
   9851 	MFS_HILITE                                                                     = 128
   9852 	MFS_UNCHECKED                                                                  = 0
   9853 	MFS_UNHILITE                                                                   = 0
   9854 	MFT_BITMAP                                                                     = 4
   9855 	MFT_MENUBARBREAK                                                               = 32
   9856 	MFT_MENUBREAK                                                                  = 64
   9857 	MFT_OWNERDRAW                                                                  = 256
   9858 	MFT_RADIOCHECK                                                                 = 512
   9859 	MFT_RIGHTJUSTIFY                                                               = 16384
   9860 	MFT_RIGHTORDER                                                                 = 8192
   9861 	MFT_SEPARATOR                                                                  = 2048
   9862 	MFT_STRING                                                                     = 0
   9863 	MF_APPEND                                                                      = 256
   9864 	MF_BITMAP                                                                      = 4
   9865 	MF_BYCOMMAND                                                                   = 0
   9866 	MF_BYPOSITION                                                                  = 1024
   9867 	MF_CALLBACKS                                                                   = 0x08000000
   9868 	MF_CHANGE                                                                      = 128
   9869 	MF_CHECKED                                                                     = 8
   9870 	MF_CONV                                                                        = 0x40000000
   9871 	MF_DEFAULT                                                                     = 4096
   9872 	MF_DELETE                                                                      = 512
   9873 	MF_DISABLED                                                                    = 2
   9874 	MF_ENABLED                                                                     = 0
   9875 	MF_END                                                                         = 128
   9876 	MF_ERRORS                                                                      = 0x10000000
   9877 	MF_GRAYED                                                                      = 1
   9878 	MF_HELP                                                                        = 16384
   9879 	MF_HILITE                                                                      = 128
   9880 	MF_HSZ_INFO                                                                    = 0x01000000
   9881 	MF_INSERT                                                                      = 0
   9882 	MF_LINKS                                                                       = 0x20000000
   9883 	MF_MASK                                                                        = 0xFF000000
   9884 	MF_MENUBARBREAK                                                                = 32
   9885 	MF_MENUBREAK                                                                   = 64
   9886 	MF_MOUSESELECT                                                                 = 32768
   9887 	MF_OWNERDRAW                                                                   = 256
   9888 	MF_POPUP                                                                       = 16
   9889 	MF_POSTMSGS                                                                    = 0x04000000
   9890 	MF_REMOVE                                                                      = 4096
   9891 	MF_RIGHTJUSTIFY                                                                = 16384
   9892 	MF_SENDMSGS                                                                    = 0x02000000
   9893 	MF_SEPARATOR                                                                   = 2048
   9894 	MF_STRING                                                                      = 0
   9895 	MF_SYSMENU                                                                     = 8192
   9896 	MF_UNCHECKED                                                                   = 0
   9897 	MF_UNHILITE                                                                    = 0
   9898 	MF_USECHECKBITMAPS                                                             = 512
   9899 	MHDR_DONE                                                                      = 0x00000001
   9900 	MHDR_INQUEUE                                                                   = 0x00000004
   9901 	MHDR_ISSTRM                                                                    = 0x00000008
   9902 	MHDR_PREPARED                                                                  = 0x00000002
   9903 	MH_CLEANUP                                                                     = 4
   9904 	MH_CREATE                                                                      = 1
   9905 	MH_DELETE                                                                      = 3
   9906 	MH_KEEP                                                                        = 2
   9907 	MICROSOFT_ROOT_CERT_CHAIN_POLICY_CHECK_APPLICATION_ROOT_FLAG                   = 0x00020000
   9908 	MICROSOFT_ROOT_CERT_CHAIN_POLICY_DISABLE_FLIGHT_ROOT_FLAG                      = 0x00040000
   9909 	MICROSOFT_ROOT_CERT_CHAIN_POLICY_ENABLE_TEST_ROOT_FLAG                         = 0x00010000
   9910 	MICROSOFT_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS                     = 0
   9911 	MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS             = 1
   9912 	MICROSOFT_WINDOWS_WINBASE_INTERLOCKED_CPLUSPLUS_H_INCLUDED                     = 0
   9913 	MIDICAPS_CACHE                                                                 = 0x0004
   9914 	MIDICAPS_LRVOLUME                                                              = 0x0002
   9915 	MIDICAPS_STREAM                                                                = 0x0008
   9916 	MIDICAPS_VOLUME                                                                = 0x0001
   9917 	MIDIERR_BADOPENMODE                                                            = 70
   9918 	MIDIERR_BASE                                                                   = 64
   9919 	MIDIERR_DONT_CONTINUE                                                          = 71
   9920 	MIDIERR_INVALIDSETUP                                                           = 69
   9921 	MIDIERR_LASTERROR                                                              = 71
   9922 	MIDIERR_NODEVICE                                                               = 68
   9923 	MIDIERR_NOMAP                                                                  = 66
   9924 	MIDIERR_NOTREADY                                                               = 67
   9925 	MIDIERR_STILLPLAYING                                                           = 65
   9926 	MIDIERR_UNPREPARED                                                             = 64
   9927 	MIDIPATCHSIZE                                                                  = 128
   9928 	MIDIPROP_GET                                                                   = 1073741824
   9929 	MIDIPROP_SET                                                                   = 2147483648
   9930 	MIDIPROP_TEMPO                                                                 = 2
   9931 	MIDIPROP_TIMEDIV                                                               = 1
   9932 	MIDISTRM_ERROR                                                                 = -2
   9933 	MIDI_CACHE_ALL                                                                 = 1
   9934 	MIDI_CACHE_BESTFIT                                                             = 2
   9935 	MIDI_CACHE_QUERY                                                               = 3
   9936 	MIDI_IO_STATUS                                                                 = 32
   9937 	MIDI_UNCACHE                                                                   = 4
   9938 	MIIM_BITMAP                                                                    = 0x00000080
   9939 	MIIM_CHECKMARKS                                                                = 0x00000008
   9940 	MIIM_DATA                                                                      = 0x00000020
   9941 	MIIM_FTYPE                                                                     = 0x00000100
   9942 	MIIM_ID                                                                        = 0x00000002
   9943 	MIIM_STATE                                                                     = 0x00000001
   9944 	MIIM_STRING                                                                    = 0x00000040
   9945 	MIIM_SUBMENU                                                                   = 0x00000004
   9946 	MIIM_TYPE                                                                      = 0x00000010
   9947 	MIM_APPLYTOSUBMENUS                                                            = 0x80000000
   9948 	MIM_BACKGROUND                                                                 = 0x00000002
   9949 	MIM_CLOSE                                                                      = 962
   9950 	MIM_DATA                                                                       = 963
   9951 	MIM_ERROR                                                                      = 965
   9952 	MIM_HELPID                                                                     = 0x00000004
   9953 	MIM_LONGDATA                                                                   = 964
   9954 	MIM_LONGERROR                                                                  = 966
   9955 	MIM_MAXHEIGHT                                                                  = 0x00000001
   9956 	MIM_MENUDATA                                                                   = 0x00000008
   9957 	MIM_MOREDATA                                                                   = 972
   9958 	MIM_OPEN                                                                       = 961
   9959 	MIM_STYLE                                                                      = 0x00000010
   9960 	MINCHAR                                                                        = 0x80
   9961 	MINGW_DDK_H                                                                    = 0
   9962 	MINGW_HAS_DDK_H                                                                = 1
   9963 	MINGW_HAS_SECURE_API                                                           = 1
   9964 	MINGW_SDK_INIT                                                                 = 0
   9965 	MINLONG                                                                        = 0x80000000
   9966 	MINSHORT                                                                       = 0x8000
   9967 	MIN_ACL_REVISION                                                               = 2
   9968 	MIN_PRIORITY                                                                   = 1
   9969 	MIXERCONTROL_CONTROLF_DISABLED                                                 = 2147483648
   9970 	MIXERCONTROL_CONTROLF_MULTIPLE                                                 = 2
   9971 	MIXERCONTROL_CONTROLF_UNIFORM                                                  = 1
   9972 	MIXERCONTROL_CONTROLTYPE_BASS                                                  = 1342373890
   9973 	MIXERCONTROL_CONTROLTYPE_BASS_BOOST                                            = 536945271
   9974 	MIXERCONTROL_CONTROLTYPE_BOOLEAN                                               = 536936448
   9975 	MIXERCONTROL_CONTROLTYPE_BOOLEANMETER                                          = 268500992
   9976 	MIXERCONTROL_CONTROLTYPE_BUTTON                                                = 553713664
   9977 	MIXERCONTROL_CONTROLTYPE_CUSTOM                                                = 0
   9978 	MIXERCONTROL_CONTROLTYPE_DECIBELS                                              = 805568512
   9979 	MIXERCONTROL_CONTROLTYPE_EQUALIZER                                             = 1342373892
   9980 	MIXERCONTROL_CONTROLTYPE_FADER                                                 = 1342373888
   9981 	MIXERCONTROL_CONTROLTYPE_LOUDNESS                                              = 536936452
   9982 	MIXERCONTROL_CONTROLTYPE_MICROTIME                                             = 1610809344
   9983 	MIXERCONTROL_CONTROLTYPE_MILLITIME                                             = 1627586560
   9984 	MIXERCONTROL_CONTROLTYPE_MIXER                                                 = 1895890945
   9985 	MIXERCONTROL_CONTROLTYPE_MONO                                                  = 536936451
   9986 	MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT                                        = 1895890944
   9987 	MIXERCONTROL_CONTROLTYPE_MUTE                                                  = 536936450
   9988 	MIXERCONTROL_CONTROLTYPE_MUX                                                   = 1879113729
   9989 	MIXERCONTROL_CONTROLTYPE_ONOFF                                                 = 536936449
   9990 	MIXERCONTROL_CONTROLTYPE_PAN                                                   = 1073872897
   9991 	MIXERCONTROL_CONTROLTYPE_PEAKMETER                                             = 268566529
   9992 	MIXERCONTROL_CONTROLTYPE_PERCENT                                               = 805634048
   9993 	MIXERCONTROL_CONTROLTYPE_QSOUNDPAN                                             = 1073872898
   9994 	MIXERCONTROL_CONTROLTYPE_SIGNED                                                = 805437440
   9995 	MIXERCONTROL_CONTROLTYPE_SIGNEDMETER                                           = 268566528
   9996 	MIXERCONTROL_CONTROLTYPE_SINGLESELECT                                          = 1879113728
   9997 	MIXERCONTROL_CONTROLTYPE_SLIDER                                                = 1073872896
   9998 	MIXERCONTROL_CONTROLTYPE_STEREOENH                                             = 536936453
   9999 	MIXERCONTROL_CONTROLTYPE_TREBLE                                                = 1342373891
  10000 	MIXERCONTROL_CONTROLTYPE_UNSIGNED                                              = 805502976
  10001 	MIXERCONTROL_CONTROLTYPE_UNSIGNEDMETER                                         = 268632064
  10002 	MIXERCONTROL_CONTROLTYPE_VOLUME                                                = 1342373889
  10003 	MIXERCONTROL_CT_CLASS_CUSTOM                                                   = 0
  10004 	MIXERCONTROL_CT_CLASS_FADER                                                    = 1342177280
  10005 	MIXERCONTROL_CT_CLASS_LIST                                                     = 1879048192
  10006 	MIXERCONTROL_CT_CLASS_MASK                                                     = 4026531840
  10007 	MIXERCONTROL_CT_CLASS_METER                                                    = 268435456
  10008 	MIXERCONTROL_CT_CLASS_NUMBER                                                   = 805306368
  10009 	MIXERCONTROL_CT_CLASS_SLIDER                                                   = 1073741824
  10010 	MIXERCONTROL_CT_CLASS_SWITCH                                                   = 536870912
  10011 	MIXERCONTROL_CT_CLASS_TIME                                                     = 1610612736
  10012 	MIXERCONTROL_CT_SC_LIST_MULTIPLE                                               = 16777216
  10013 	MIXERCONTROL_CT_SC_LIST_SINGLE                                                 = 0
  10014 	MIXERCONTROL_CT_SC_METER_POLLED                                                = 0
  10015 	MIXERCONTROL_CT_SC_SWITCH_BOOLEAN                                              = 0
  10016 	MIXERCONTROL_CT_SC_SWITCH_BUTTON                                               = 16777216
  10017 	MIXERCONTROL_CT_SC_TIME_MICROSECS                                              = 0
  10018 	MIXERCONTROL_CT_SC_TIME_MILLISECS                                              = 16777216
  10019 	MIXERCONTROL_CT_SUBCLASS_MASK                                                  = 251658240
  10020 	MIXERCONTROL_CT_UNITS_BOOLEAN                                                  = 65536
  10021 	MIXERCONTROL_CT_UNITS_CUSTOM                                                   = 0
  10022 	MIXERCONTROL_CT_UNITS_DECIBELS                                                 = 262144
  10023 	MIXERCONTROL_CT_UNITS_MASK                                                     = 16711680
  10024 	MIXERCONTROL_CT_UNITS_PERCENT                                                  = 327680
  10025 	MIXERCONTROL_CT_UNITS_SIGNED                                                   = 131072
  10026 	MIXERCONTROL_CT_UNITS_UNSIGNED                                                 = 196608
  10027 	MIXERLINE_COMPONENTTYPE_DST_DIGITAL                                            = 1
  10028 	MIXERLINE_COMPONENTTYPE_DST_FIRST                                              = 0
  10029 	MIXERLINE_COMPONENTTYPE_DST_HEADPHONES                                         = 5
  10030 	MIXERLINE_COMPONENTTYPE_DST_LAST                                               = 8
  10031 	MIXERLINE_COMPONENTTYPE_DST_LINE                                               = 2
  10032 	MIXERLINE_COMPONENTTYPE_DST_MONITOR                                            = 3
  10033 	MIXERLINE_COMPONENTTYPE_DST_SPEAKERS                                           = 4
  10034 	MIXERLINE_COMPONENTTYPE_DST_TELEPHONE                                          = 6
  10035 	MIXERLINE_COMPONENTTYPE_DST_UNDEFINED                                          = 0
  10036 	MIXERLINE_COMPONENTTYPE_DST_VOICEIN                                            = 8
  10037 	MIXERLINE_COMPONENTTYPE_DST_WAVEIN                                             = 7
  10038 	MIXERLINE_COMPONENTTYPE_SRC_ANALOG                                             = 4106
  10039 	MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY                                          = 4105
  10040 	MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC                                        = 4101
  10041 	MIXERLINE_COMPONENTTYPE_SRC_DIGITAL                                            = 4097
  10042 	MIXERLINE_COMPONENTTYPE_SRC_FIRST                                              = 4096
  10043 	MIXERLINE_COMPONENTTYPE_SRC_LAST                                               = 4106
  10044 	MIXERLINE_COMPONENTTYPE_SRC_LINE                                               = 4098
  10045 	MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE                                         = 4099
  10046 	MIXERLINE_COMPONENTTYPE_SRC_PCSPEAKER                                          = 4103
  10047 	MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER                                        = 4100
  10048 	MIXERLINE_COMPONENTTYPE_SRC_TELEPHONE                                          = 4102
  10049 	MIXERLINE_COMPONENTTYPE_SRC_UNDEFINED                                          = 4096
  10050 	MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT                                            = 4104
  10051 	MIXERLINE_LINEF_ACTIVE                                                         = 1
  10052 	MIXERLINE_LINEF_DISCONNECTED                                                   = 32768
  10053 	MIXERLINE_LINEF_SOURCE                                                         = 2147483648
  10054 	MIXERLINE_TARGETTYPE_AUX                                                       = 5
  10055 	MIXERLINE_TARGETTYPE_MIDIIN                                                    = 4
  10056 	MIXERLINE_TARGETTYPE_MIDIOUT                                                   = 3
  10057 	MIXERLINE_TARGETTYPE_UNDEFINED                                                 = 0
  10058 	MIXERLINE_TARGETTYPE_WAVEIN                                                    = 2
  10059 	MIXERLINE_TARGETTYPE_WAVEOUT                                                   = 1
  10060 	MIXERR_BASE                                                                    = 1024
  10061 	MIXERR_INVALCONTROL                                                            = 1025
  10062 	MIXERR_INVALLINE                                                               = 1024
  10063 	MIXERR_INVALVALUE                                                              = 1026
  10064 	MIXERR_LASTERROR                                                               = 1026
  10065 	MIXER_GETCONTROLDETAILSF_LISTTEXT                                              = 1
  10066 	MIXER_GETCONTROLDETAILSF_QUERYMASK                                             = 15
  10067 	MIXER_GETCONTROLDETAILSF_VALUE                                                 = 0
  10068 	MIXER_GETLINECONTROLSF_ALL                                                     = 0
  10069 	MIXER_GETLINECONTROLSF_ONEBYID                                                 = 1
  10070 	MIXER_GETLINECONTROLSF_ONEBYTYPE                                               = 2
  10071 	MIXER_GETLINECONTROLSF_QUERYMASK                                               = 15
  10072 	MIXER_GETLINEINFOF_COMPONENTTYPE                                               = 3
  10073 	MIXER_GETLINEINFOF_DESTINATION                                                 = 0
  10074 	MIXER_GETLINEINFOF_LINEID                                                      = 2
  10075 	MIXER_GETLINEINFOF_QUERYMASK                                                   = 15
  10076 	MIXER_GETLINEINFOF_SOURCE                                                      = 1
  10077 	MIXER_GETLINEINFOF_TARGETTYPE                                                  = 4
  10078 	MIXER_LONG_NAME_CHARS                                                          = 64
  10079 	MIXER_OBJECTF_AUX                                                              = 1342177280
  10080 	MIXER_OBJECTF_HANDLE                                                           = 2147483648
  10081 	MIXER_OBJECTF_HMIDIIN                                                          = 3221225472
  10082 	MIXER_OBJECTF_HMIDIOUT                                                         = 2952790016
  10083 	MIXER_OBJECTF_HMIXER                                                           = 2147483648
  10084 	MIXER_OBJECTF_HWAVEIN                                                          = 2684354560
  10085 	MIXER_OBJECTF_HWAVEOUT                                                         = 2415919104
  10086 	MIXER_OBJECTF_MIDIIN                                                           = 1073741824
  10087 	MIXER_OBJECTF_MIDIOUT                                                          = 805306368
  10088 	MIXER_OBJECTF_MIXER                                                            = 0
  10089 	MIXER_OBJECTF_WAVEIN                                                           = 536870912
  10090 	MIXER_OBJECTF_WAVEOUT                                                          = 268435456
  10091 	MIXER_SETCONTROLDETAILSF_CUSTOM                                                = 1
  10092 	MIXER_SETCONTROLDETAILSF_QUERYMASK                                             = 15
  10093 	MIXER_SETCONTROLDETAILSF_VALUE                                                 = 0
  10094 	MIXER_SHORT_NAME_CHARS                                                         = 16
  10095 	MKF_AVAILABLE                                                                  = 0x00000002
  10096 	MKF_CONFIRMHOTKEY                                                              = 0x00000008
  10097 	MKF_HOTKEYACTIVE                                                               = 0x00000004
  10098 	MKF_HOTKEYSOUND                                                                = 0x00000010
  10099 	MKF_INDICATOR                                                                  = 0x00000020
  10100 	MKF_LEFTBUTTONDOWN                                                             = 0x01000000
  10101 	MKF_LEFTBUTTONSEL                                                              = 0x10000000
  10102 	MKF_MODIFIERS                                                                  = 0x00000040
  10103 	MKF_MOUSEKEYSON                                                                = 0x00000001
  10104 	MKF_MOUSEMODE                                                                  = 0x80000000
  10105 	MKF_REPLACENUMBERS                                                             = 0x00000080
  10106 	MKF_RIGHTBUTTONDOWN                                                            = 0x02000000
  10107 	MKF_RIGHTBUTTONSEL                                                             = 0x20000000
  10108 	MKSYS_URLMONIKER                                                               = 6
  10109 	MK_ALT                                                                         = 32
  10110 	MK_CONTROL                                                                     = 0x0008
  10111 	MK_E_FIRST                                                                     = 2147746272
  10112 	MK_E_LAST                                                                      = 2147746287
  10113 	MK_LBUTTON                                                                     = 0x0001
  10114 	MK_MBUTTON                                                                     = 0x0010
  10115 	MK_RBUTTON                                                                     = 0x0002
  10116 	MK_SHIFT                                                                       = 0x0004
  10117 	MK_S_FIRST                                                                     = 262624
  10118 	MK_S_LAST                                                                      = 262639
  10119 	MK_XBUTTON1                                                                    = 0x0020
  10120 	MK_XBUTTON2                                                                    = 0x0040
  10121 	MMIOERR_ACCESSDENIED                                                           = 268
  10122 	MMIOERR_BASE                                                                   = 256
  10123 	MMIOERR_CANNOTCLOSE                                                            = 260
  10124 	MMIOERR_CANNOTEXPAND                                                           = 264
  10125 	MMIOERR_CANNOTOPEN                                                             = 259
  10126 	MMIOERR_CANNOTREAD                                                             = 261
  10127 	MMIOERR_CANNOTSEEK                                                             = 263
  10128 	MMIOERR_CANNOTWRITE                                                            = 262
  10129 	MMIOERR_CHUNKNOTFOUND                                                          = 265
  10130 	MMIOERR_FILENOTFOUND                                                           = 257
  10131 	MMIOERR_INVALIDFILE                                                            = 272
  10132 	MMIOERR_NETWORKERROR                                                           = 270
  10133 	MMIOERR_OUTOFMEMORY                                                            = 258
  10134 	MMIOERR_PATHNOTFOUND                                                           = 267
  10135 	MMIOERR_SHARINGVIOLATION                                                       = 269
  10136 	MMIOERR_TOOMANYOPENFILES                                                       = 271
  10137 	MMIOERR_UNBUFFERED                                                             = 266
  10138 	MMIOM_CLOSE                                                                    = 4
  10139 	MMIOM_OPEN                                                                     = 3
  10140 	MMIOM_READ                                                                     = 0
  10141 	MMIOM_RENAME                                                                   = 6
  10142 	MMIOM_SEEK                                                                     = 2
  10143 	MMIOM_USER                                                                     = 0x8000
  10144 	MMIOM_WRITE                                                                    = 1
  10145 	MMIOM_WRITEFLUSH                                                               = 5
  10146 	MMIO_ALLOCBUF                                                                  = 0x00010000
  10147 	MMIO_COMPAT                                                                    = 0x00000000
  10148 	MMIO_CREATE                                                                    = 0x00001000
  10149 	MMIO_CREATELIST                                                                = 0x0040
  10150 	MMIO_CREATERIFF                                                                = 0x0020
  10151 	MMIO_DEFAULTBUFFER                                                             = 8192
  10152 	MMIO_DELETE                                                                    = 0x00000200
  10153 	MMIO_DENYNONE                                                                  = 0x00000040
  10154 	MMIO_DENYREAD                                                                  = 0x00000030
  10155 	MMIO_DENYWRITE                                                                 = 0x00000020
  10156 	MMIO_DIRTY                                                                     = 0x10000000
  10157 	MMIO_EMPTYBUF                                                                  = 0x0010
  10158 	MMIO_EXCLUSIVE                                                                 = 0x00000010
  10159 	MMIO_EXIST                                                                     = 0x00004000
  10160 	MMIO_FHOPEN                                                                    = 0x0010
  10161 	MMIO_FINDCHUNK                                                                 = 0x0010
  10162 	MMIO_FINDLIST                                                                  = 0x0040
  10163 	MMIO_FINDPROC                                                                  = 0x00040000
  10164 	MMIO_FINDRIFF                                                                  = 0x0020
  10165 	MMIO_GETTEMP                                                                   = 0x00020000
  10166 	MMIO_GLOBALPROC                                                                = 0x10000000
  10167 	MMIO_INSTALLPROC                                                               = 0x00010000
  10168 	MMIO_PARSE                                                                     = 0x00000100
  10169 	MMIO_READ                                                                      = 0x00000000
  10170 	MMIO_READWRITE                                                                 = 0x00000002
  10171 	MMIO_REMOVEPROC                                                                = 0x00020000
  10172 	MMIO_RWMODE                                                                    = 0x00000003
  10173 	MMIO_SHAREMODE                                                                 = 0x00000070
  10174 	MMIO_TOUPPER                                                                   = 0x0010
  10175 	MMIO_UNICODEPROC                                                               = 0x01000000
  10176 	MMIO_WRITE                                                                     = 0x00000001
  10177 	MMSYSERR_ALLOCATED                                                             = 4
  10178 	MMSYSERR_BADDB                                                                 = 14
  10179 	MMSYSERR_BADDEVICEID                                                           = 2
  10180 	MMSYSERR_BADERRNUM                                                             = 9
  10181 	MMSYSERR_BASE                                                                  = 0
  10182 	MMSYSERR_DELETEERROR                                                           = 18
  10183 	MMSYSERR_ERROR                                                                 = 1
  10184 	MMSYSERR_HANDLEBUSY                                                            = 12
  10185 	MMSYSERR_INVALFLAG                                                             = 10
  10186 	MMSYSERR_INVALHANDLE                                                           = 5
  10187 	MMSYSERR_INVALIDALIAS                                                          = 13
  10188 	MMSYSERR_INVALPARAM                                                            = 11
  10189 	MMSYSERR_KEYNOTFOUND                                                           = 15
  10190 	MMSYSERR_LASTERROR                                                             = 21
  10191 	MMSYSERR_MOREDATA                                                              = 21
  10192 	MMSYSERR_NODRIVER                                                              = 6
  10193 	MMSYSERR_NODRIVERCB                                                            = 20
  10194 	MMSYSERR_NOERROR                                                               = 0
  10195 	MMSYSERR_NOMEM                                                                 = 7
  10196 	MMSYSERR_NOTENABLED                                                            = 3
  10197 	MMSYSERR_NOTSUPPORTED                                                          = 8
  10198 	MMSYSERR_READERROR                                                             = 16
  10199 	MMSYSERR_VALNOTFOUND                                                           = 19
  10200 	MMSYSERR_WRITEERROR                                                            = 17
  10201 	MM_ANISOTROPIC                                                                 = 8
  10202 	MM_DRVM_CLOSE                                                                  = 0x3D1
  10203 	MM_DRVM_DATA                                                                   = 0x3D2
  10204 	MM_DRVM_ERROR                                                                  = 0x3D3
  10205 	MM_DRVM_OPEN                                                                   = 0x3D0
  10206 	MM_HIENGLISH                                                                   = 5
  10207 	MM_HIMETRIC                                                                    = 3
  10208 	MM_ISOTROPIC                                                                   = 7
  10209 	MM_JOY1BUTTONDOWN                                                              = 0x3B5
  10210 	MM_JOY1BUTTONUP                                                                = 0x3B7
  10211 	MM_JOY1MOVE                                                                    = 0x3A0
  10212 	MM_JOY1ZMOVE                                                                   = 0x3A2
  10213 	MM_JOY2BUTTONDOWN                                                              = 0x3B6
  10214 	MM_JOY2BUTTONUP                                                                = 0x3B8
  10215 	MM_JOY2MOVE                                                                    = 0x3A1
  10216 	MM_JOY2ZMOVE                                                                   = 0x3A3
  10217 	MM_LOENGLISH                                                                   = 4
  10218 	MM_LOMETRIC                                                                    = 2
  10219 	MM_MAX                                                                         = 8
  10220 	MM_MAX_AXES_NAMELEN                                                            = 16
  10221 	MM_MAX_FIXEDSCALE                                                              = 6
  10222 	MM_MAX_NUMAXES                                                                 = 16
  10223 	MM_MCINOTIFY                                                                   = 0x3B9
  10224 	MM_MCISIGNAL                                                                   = 0x3CB
  10225 	MM_MIM_CLOSE                                                                   = 0x3C2
  10226 	MM_MIM_DATA                                                                    = 0x3C3
  10227 	MM_MIM_ERROR                                                                   = 0x3C5
  10228 	MM_MIM_LONGDATA                                                                = 0x3C4
  10229 	MM_MIM_LONGERROR                                                               = 0x3C6
  10230 	MM_MIM_MOREDATA                                                                = 0x3CC
  10231 	MM_MIM_OPEN                                                                    = 0x3C1
  10232 	MM_MIN                                                                         = 1
  10233 	MM_MIXM_CONTROL_CHANGE                                                         = 0x3D1
  10234 	MM_MIXM_LINE_CHANGE                                                            = 0x3D0
  10235 	MM_MOM_CLOSE                                                                   = 0x3C8
  10236 	MM_MOM_DONE                                                                    = 0x3C9
  10237 	MM_MOM_OPEN                                                                    = 0x3C7
  10238 	MM_MOM_POSITIONCB                                                              = 0x3CA
  10239 	MM_STREAM_CLOSE                                                                = 0x3D5
  10240 	MM_STREAM_DONE                                                                 = 0x3D6
  10241 	MM_STREAM_ERROR                                                                = 0x3D7
  10242 	MM_STREAM_OPEN                                                                 = 0x3D4
  10243 	MM_TEXT                                                                        = 1
  10244 	MM_TWIPS                                                                       = 6
  10245 	MM_WIM_CLOSE                                                                   = 0x3BF
  10246 	MM_WIM_DATA                                                                    = 0x3C0
  10247 	MM_WIM_OPEN                                                                    = 0x3BE
  10248 	MM_WOM_CLOSE                                                                   = 0x3BC
  10249 	MM_WOM_DONE                                                                    = 0x3BD
  10250 	MM_WOM_OPEN                                                                    = 0x3BB
  10251 	MNC_CLOSE                                                                      = 1
  10252 	MNC_EXECUTE                                                                    = 2
  10253 	MNC_IGNORE                                                                     = 0
  10254 	MNC_SELECT                                                                     = 3
  10255 	MND_CONTINUE                                                                   = 0
  10256 	MND_ENDMENU                                                                    = 1
  10257 	MNGOF_BOTTOMGAP                                                                = 0x00000002
  10258 	MNGOF_TOPGAP                                                                   = 0x00000001
  10259 	MNGO_NOERROR                                                                   = 0x00000001
  10260 	MNGO_NOINTERFACE                                                               = 0x00000000
  10261 	MNS_AUTODISMISS                                                                = 0x10000000
  10262 	MNS_CHECKORBMP                                                                 = 0x04000000
  10263 	MNS_DRAGDROP                                                                   = 0x20000000
  10264 	MNS_MODELESS                                                                   = 0x40000000
  10265 	MNS_NOCHECK                                                                    = 0x80000000
  10266 	MNS_NOTIFYBYPOS                                                                = 0x08000000
  10267 	MN_GETHMENU                                                                    = 0x01E1
  10268 	MOD_ALT                                                                        = 0x0001
  10269 	MOD_CONTROL                                                                    = 0x0002
  10270 	MOD_FMSYNTH                                                                    = 4
  10271 	MOD_IGNORE_ALL_MODIFIER                                                        = 0x0400
  10272 	MOD_LEFT                                                                       = 0x8000
  10273 	MOD_MAPPER                                                                     = 5
  10274 	MOD_MIDIPORT                                                                   = 1
  10275 	MOD_ON_KEYUP                                                                   = 0x0800
  10276 	MOD_RIGHT                                                                      = 0x4000
  10277 	MOD_SHIFT                                                                      = 0x0004
  10278 	MOD_SQSYNTH                                                                    = 3
  10279 	MOD_SWSYNTH                                                                    = 7
  10280 	MOD_SYNTH                                                                      = 2
  10281 	MOD_WAVETABLE                                                                  = 6
  10282 	MOD_WIN                                                                        = 0x0008
  10283 	MOM_CLOSE                                                                      = 968
  10284 	MOM_DONE                                                                       = 969
  10285 	MOM_OPEN                                                                       = 967
  10286 	MOM_POSITIONCB                                                                 = 970
  10287 	MONITORINFOF_PRIMARY                                                           = 0x00000001
  10288 	MONITOR_DEFAULTTONEAREST                                                       = 0x00000002
  10289 	MONITOR_DEFAULTTONULL                                                          = 0x00000000
  10290 	MONITOR_DEFAULTTOPRIMARY                                                       = 0x00000001
  10291 	MONO_FONT                                                                      = 8
  10292 	MOUSEEVENTF_ABSOLUTE                                                           = 0x8000
  10293 	MOUSEEVENTF_LEFTDOWN                                                           = 0x0002
  10294 	MOUSEEVENTF_LEFTUP                                                             = 0x0004
  10295 	MOUSEEVENTF_MIDDLEDOWN                                                         = 0x0020
  10296 	MOUSEEVENTF_MIDDLEUP                                                           = 0x0040
  10297 	MOUSEEVENTF_MOVE                                                               = 0x0001
  10298 	MOUSEEVENTF_RIGHTDOWN                                                          = 0x0008
  10299 	MOUSEEVENTF_RIGHTUP                                                            = 0x0010
  10300 	MOUSEEVENTF_VIRTUALDESK                                                        = 0x4000
  10301 	MOUSEEVENTF_WHEEL                                                              = 0x0800
  10302 	MOUSEEVENTF_XDOWN                                                              = 0x0080
  10303 	MOUSEEVENTF_XUP                                                                = 0x0100
  10304 	MOUSETRAILS                                                                    = 39
  10305 	MOUSE_ATTRIBUTES_CHANGED                                                       = 0x04
  10306 	MOUSE_EVENT                                                                    = 0x2
  10307 	MOUSE_MOVED                                                                    = 0x1
  10308 	MOUSE_MOVE_ABSOLUTE                                                            = 1
  10309 	MOUSE_MOVE_RELATIVE                                                            = 0
  10310 	MOUSE_VIRTUAL_DESKTOP                                                          = 0x02
  10311 	MOUSE_WHEELED                                                                  = 0x4
  10312 	MOVEFILE_COPY_ALLOWED                                                          = 0x00000002
  10313 	MOVEFILE_CREATE_HARDLINK                                                       = 0x00000010
  10314 	MOVEFILE_DELAY_UNTIL_REBOOT                                                    = 0x00000004
  10315 	MOVEFILE_FAIL_IF_NOT_TRACKABLE                                                 = 0x00000020
  10316 	MOVEFILE_REPLACE_EXISTING                                                      = 0x00000001
  10317 	MOVEFILE_WRITE_THROUGH                                                         = 0x00000008
  10318 	MSGF_DDEMGR                                                                    = 0x8001
  10319 	MSGF_DIALOGBOX                                                                 = 0
  10320 	MSGF_MAX                                                                       = 8
  10321 	MSGF_MENU                                                                      = 2
  10322 	MSGF_MESSAGEBOX                                                                = 1
  10323 	MSGF_NEXTWINDOW                                                                = 6
  10324 	MSGF_SCROLLBAR                                                                 = 5
  10325 	MSGF_USER                                                                      = 4096
  10326 	MSG_DONTROUTE                                                                  = 0x4
  10327 	MSG_MAXIOVLEN                                                                  = 16
  10328 	MSG_OOB                                                                        = 0x1
  10329 	MSG_PARTIAL                                                                    = 0x8000
  10330 	MSG_PEEK                                                                       = 0x2
  10331 	MSVC_VERSION                                                                   = 1900
  10332 	MS_DEF_DH_SCHANNEL_PROV_A                                                      = "Microsoft DH SChannel Cryptographic Provider"
  10333 	MS_DEF_DSS_DH_PROV_A                                                           = "Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"
  10334 	MS_DEF_DSS_PROV_A                                                              = "Microsoft Base DSS Cryptographic Provider"
  10335 	MS_DEF_PROV_A                                                                  = "Microsoft Base Cryptographic Provider v1.0"
  10336 	MS_DEF_RSA_SCHANNEL_PROV_A                                                     = "Microsoft RSA SChannel Cryptographic Provider"
  10337 	MS_DEF_RSA_SIG_PROV_A                                                          = "Microsoft RSA Signature Cryptographic Provider"
  10338 	MS_ENHANCED_PROV_A                                                             = "Microsoft Enhanced Cryptographic Provider v1.0"
  10339 	MS_ENH_DSS_DH_PROV_A                                                           = "Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"
  10340 	MS_ENH_RSA_AES_PROV_A                                                          = "Microsoft Enhanced RSA and AES Cryptographic Provider"
  10341 	MS_ENH_RSA_AES_PROV_XP_A                                                       = "Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)"
  10342 	MS_NBF                                                                         = "MNBF"
  10343 	MS_PPM_SOFTWARE_ALL                                                            = 0x1
  10344 	MS_SCARD_PROV_A                                                                = "Microsoft Base Smart Card Crypto Provider"
  10345 	MS_STRONG_PROV_A                                                               = "Microsoft Strong Cryptographic Provider"
  10346 	MULTIFILEOPENORD                                                               = 1537
  10347 	MUTANT_ALL_ACCESS                                                              = 2031617
  10348 	MUTANT_QUERY_STATE                                                             = 0x0001
  10349 	MUTEX_ALL_ACCESS                                                               = 2031617
  10350 	MUTEX_MODIFY_STATE                                                             = 1
  10351 	MUTZ_ACCEPT_WILDCARD_SCHEME                                                    = 0x80
  10352 	MUTZ_DONT_UNESCAPE                                                             = 0x800
  10353 	MUTZ_DONT_USE_CACHE                                                            = 0x1000
  10354 	MUTZ_ENFORCERESTRICTED                                                         = 0x100
  10355 	MUTZ_FORCE_INTRANET_FLAGS                                                      = 0x2000
  10356 	MUTZ_IGNORE_ZONE_MAPPINGS                                                      = 0x4000
  10357 	MUTZ_ISFILE                                                                    = 0x2
  10358 	MUTZ_NOSAVEDFILECHECK                                                          = 0x1
  10359 	MUTZ_REQUIRESAVEDFILECHECK                                                     = 0x400
  10360 	MUTZ_RESERVED                                                                  = 0x200
  10361 	MWMO_ALERTABLE                                                                 = 0x0002
  10362 	MWMO_INPUTAVAILABLE                                                            = 0x0004
  10363 	MWMO_WAITALL                                                                   = 0x0001
  10364 	MWT_IDENTITY                                                                   = 1
  10365 	MWT_LEFTMULTIPLY                                                               = 2
  10366 	MWT_MAX                                                                        = 3
  10367 	MWT_MIN                                                                        = 1
  10368 	MWT_RIGHTMULTIPLY                                                              = 3
  10369 	MX_CLOSE_ATTEMPT                                                               = 3
  10370 	M_1_PI                                                                         = 0.31830988618379067154
  10371 	M_2_PI                                                                         = 0.63661977236758134308
  10372 	M_2_SQRTPI                                                                     = 1.12837916709551257390
  10373 	M_E                                                                            = 2.7182818284590452354
  10374 	M_LN10                                                                         = 2.30258509299404568402
  10375 	M_LN2                                                                          = 0.69314718055994530942
  10376 	M_LOG10E                                                                       = 0.43429448190325182765
  10377 	M_LOG2E                                                                        = 1.4426950408889634074
  10378 	M_PI                                                                           = 3.14159265358979323846
  10379 	M_PI_2                                                                         = 1.57079632679489661923
  10380 	M_PI_4                                                                         = 0.78539816339744830962
  10381 	M_SQRT1_2                                                                      = 0.70710678118654752440
  10382 	M_SQRT2                                                                        = 1.41421356237309504880
  10383 	MaxNumberOfEEInfoParams                                                        = 4
  10384 	NAME_FLAGS_MASK                                                                = 0x87
  10385 	NB                                                                             = 3
  10386 	NCBACTION                                                                      = 0x77
  10387 	NCBADDGRNAME                                                                   = 0x36
  10388 	NCBADDNAME                                                                     = 0x30
  10389 	NCBASTAT                                                                       = 0x33
  10390 	NCBCALL                                                                        = 0x10
  10391 	NCBCANCEL                                                                      = 0x35
  10392 	NCBCHAINSEND                                                                   = 0x17
  10393 	NCBCHAINSENDNA                                                                 = 0x72
  10394 	NCBDELNAME                                                                     = 0x31
  10395 	NCBDGRECV                                                                      = 0x21
  10396 	NCBDGRECVBC                                                                    = 0x23
  10397 	NCBDGSEND                                                                      = 0x20
  10398 	NCBDGSENDBC                                                                    = 0x22
  10399 	NCBENUM                                                                        = 0x37
  10400 	NCBFINDNAME                                                                    = 0x78
  10401 	NCBHANGUP                                                                      = 0x12
  10402 	NCBLANSTALERT                                                                  = 0x73
  10403 	NCBLISTEN                                                                      = 0x11
  10404 	NCBNAMSZ                                                                       = 16
  10405 	NCBRECV                                                                        = 0x15
  10406 	NCBRECVANY                                                                     = 0x16
  10407 	NCBRESET                                                                       = 0x32
  10408 	NCBSEND                                                                        = 0x14
  10409 	NCBSENDNA                                                                      = 0x71
  10410 	NCBSSTAT                                                                       = 0x34
  10411 	NCBTRACE                                                                       = 0x79
  10412 	NCBUNLINK                                                                      = 0x70
  10413 	NCB_INCLUDED                                                                   = 0
  10414 	NCRYPTBUFFER_CERT_BLOB                                                         = 47
  10415 	NCRYPTBUFFER_DATA                                                              = 1
  10416 	NCRYPTBUFFER_EMPTY                                                             = 0
  10417 	NCRYPTBUFFER_PKCS_ALG_ID                                                       = 43
  10418 	NCRYPTBUFFER_PKCS_ALG_OID                                                      = 41
  10419 	NCRYPTBUFFER_PKCS_ALG_PARAM                                                    = 42
  10420 	NCRYPTBUFFER_PKCS_ATTRS                                                        = 44
  10421 	NCRYPTBUFFER_PKCS_KEY_NAME                                                     = 45
  10422 	NCRYPTBUFFER_PKCS_OID                                                          = 40
  10423 	NCRYPTBUFFER_PKCS_SECRET                                                       = 46
  10424 	NCRYPTBUFFER_PROTECTION_DESCRIPTOR_STRING                                      = 3
  10425 	NCRYPTBUFFER_PROTECTION_FLAGS                                                  = 4
  10426 	NCRYPTBUFFER_SSL_CLEAR_KEY                                                     = 23
  10427 	NCRYPTBUFFER_SSL_CLIENT_RANDOM                                                 = 20
  10428 	NCRYPTBUFFER_SSL_HIGHEST_VERSION                                               = 22
  10429 	NCRYPTBUFFER_SSL_KEY_ARG_DATA                                                  = 24
  10430 	NCRYPTBUFFER_SSL_SERVER_RANDOM                                                 = 21
  10431 	NCRYPTBUFFER_VERSION                                                           = 0
  10432 	NCRYPT_ALLOW_ALL_USAGES                                                        = 0x00ffffff
  10433 	NCRYPT_ALLOW_ARCHIVING_FLAG                                                    = 0x00000004
  10434 	NCRYPT_ALLOW_DECRYPT_FLAG                                                      = 0x1
  10435 	NCRYPT_ALLOW_EXPORT_FLAG                                                       = 0x1
  10436 	NCRYPT_ALLOW_KEY_AGREEMENT_FLAG                                                = 0x00000004
  10437 	NCRYPT_ALLOW_PLAINTEXT_ARCHIVING_FLAG                                          = 0x00000008
  10438 	NCRYPT_ALLOW_PLAINTEXT_EXPORT_FLAG                                             = 0x2
  10439 	NCRYPT_ALLOW_SIGNING_FLAG                                                      = 0x2
  10440 	NCRYPT_ASYMMETRIC_ENCRYPTION_INTERFACE                                         = 3
  10441 	NCRYPT_ASYMMETRIC_ENCRYPTION_OPERATION                                         = 4
  10442 	NCRYPT_CIPHER_INTERFACE                                                        = 1
  10443 	NCRYPT_CIPHER_OPERATION                                                        = 1
  10444 	NCRYPT_DO_NOT_FINALIZE_FLAG                                                    = 0x400
  10445 	NCRYPT_EXPORT_LEGACY_FLAG                                                      = 0x00000800
  10446 	NCRYPT_HASH_INTERFACE                                                          = 2
  10447 	NCRYPT_HASH_OPERATION                                                          = 2
  10448 	NCRYPT_IMPL_HARDWARE_FLAG                                                      = 0x1
  10449 	NCRYPT_IMPL_HARDWARE_RNG_FLAG                                                  = 0x00000010
  10450 	NCRYPT_IMPL_REMOVABLE_FLAG                                                     = 0x00000008
  10451 	NCRYPT_IMPL_SOFTWARE_FLAG                                                      = 0x2
  10452 	NCRYPT_KEY_STORAGE_INTERFACE                                                   = 0x00010001
  10453 	NCRYPT_MACHINE_KEY_FLAG                                                        = 0x20
  10454 	NCRYPT_MAX_ALG_ID_LENGTH                                                       = 512
  10455 	NCRYPT_MAX_KEY_NAME_LENGTH                                                     = 512
  10456 	NCRYPT_MAX_PROPERTY_DATA                                                       = 0x100000
  10457 	NCRYPT_MAX_PROPERTY_NAME                                                       = 64
  10458 	NCRYPT_NO_KEY_VALIDATION                                                       = 8
  10459 	NCRYPT_NO_PADDING_FLAG                                                         = 0x1
  10460 	NCRYPT_OVERWRITE_KEY_FLAG                                                      = 0x80
  10461 	NCRYPT_PAD_OAEP_FLAG                                                           = 0x4
  10462 	NCRYPT_PAD_PKCS1_FLAG                                                          = 0x2
  10463 	NCRYPT_PAD_PSS_FLAG                                                            = 0x8
  10464 	NCRYPT_PERSIST_FLAG                                                            = 0x80000000
  10465 	NCRYPT_PERSIST_ONLY_FLAG                                                       = 0x40000000
  10466 	NCRYPT_REGISTER_NOTIFY_FLAG                                                    = 0x1
  10467 	NCRYPT_RNG_OPERATION                                                           = 32
  10468 	NCRYPT_SCHANNEL_INTERFACE                                                      = 0x00010002
  10469 	NCRYPT_SCHANNEL_SIGNATURE_INTERFACE                                            = 0x00010003
  10470 	NCRYPT_SECRET_AGREEMENT_INTERFACE                                              = 4
  10471 	NCRYPT_SECRET_AGREEMENT_OPERATION                                              = 8
  10472 	NCRYPT_SIGNATURE_INTERFACE                                                     = 5
  10473 	NCRYPT_SIGNATURE_OPERATION                                                     = 16
  10474 	NCRYPT_SILENT_FLAG                                                             = 0x40
  10475 	NCRYPT_UI_FORCE_HIGH_PROTECTION_FLAG                                           = 0x2
  10476 	NCRYPT_UI_PROTECT_KEY_FLAG                                                     = 0x1
  10477 	NCRYPT_UNREGISTER_NOTIFY_FLAG                                                  = 0x2
  10478 	NCRYPT_WRITE_KEY_TO_LEGACY_STORE_FLAG                                          = 0x200
  10479 	NC_AllowAgg                                                                    = 0x000001
  10480 	NC_AllowWin                                                                    = 0x004000
  10481 	NC_Complex                                                                     = 0x002000
  10482 	NC_FromDDL                                                                     = 0x040000
  10483 	NC_GenCol                                                                      = 0x000008
  10484 	NC_HasAgg                                                                      = 0x000010
  10485 	NC_HasWin                                                                      = 0x008000
  10486 	NC_IdxExpr                                                                     = 0x000020
  10487 	NC_InAggFunc                                                                   = 0x020000
  10488 	NC_IsCheck                                                                     = 0x000004
  10489 	NC_IsDDL                                                                       = 0x010000
  10490 	NC_MinMaxAgg                                                                   = 0x001000
  10491 	NC_NoSelect                                                                    = 0x080000
  10492 	NC_OrderAgg                                                                    = 0x8000000
  10493 	NC_PartIdx                                                                     = 0x000002
  10494 	NC_SelfRef                                                                     = 0x00002e
  10495 	NC_Subquery                                                                    = 0x000040
  10496 	NC_UAggInfo                                                                    = 0x000100
  10497 	NC_UBaseReg                                                                    = 0x000400
  10498 	NC_UEList                                                                      = 0x000080
  10499 	NC_UUpsert                                                                     = 0x000200
  10500 	NDEBUG                                                                         = 1
  10501 	NDR_ASCII_CHAR                                                                 = 0
  10502 	NDR_BIG_ENDIAN                                                                 = 0
  10503 	NDR_CHAR_REP_MASK                                                              = 15
  10504 	NDR_EBCDIC_CHAR                                                                = 1
  10505 	NDR_FLOAT_REP_MASK                                                             = 65280
  10506 	NDR_IBM_FLOAT                                                                  = 768
  10507 	NDR_IEEE_FLOAT                                                                 = 0
  10508 	NDR_INT_REP_MASK                                                               = 240
  10509 	NDR_LITTLE_ENDIAN                                                              = 16
  10510 	NDR_LOCAL_DATA_REPRESENTATION                                                  = 16
  10511 	NDR_LOCAL_ENDIAN                                                               = 16
  10512 	NDR_VAX_FLOAT                                                                  = 256
  10513 	NEAR                                                                           = 0
  10514 	NETINFO_DISKRED                                                                = 0x00000004
  10515 	NETINFO_DLL16                                                                  = 0x00000001
  10516 	NETINFO_PRINTERRED                                                             = 0x00000008
  10517 	NETPROPERTY_PERSISTENT                                                         = 1
  10518 	NETSCAPE_SIGN_CA_CERT_TYPE                                                     = 0x01
  10519 	NETSCAPE_SIGN_CERT_TYPE                                                        = 0x10
  10520 	NETSCAPE_SMIME_CA_CERT_TYPE                                                    = 0x02
  10521 	NETSCAPE_SMIME_CERT_TYPE                                                       = 0x20
  10522 	NETSCAPE_SSL_CA_CERT_TYPE                                                      = 0x04
  10523 	NETSCAPE_SSL_CLIENT_AUTH_CERT_TYPE                                             = 0x80
  10524 	NETSCAPE_SSL_SERVER_AUTH_CERT_TYPE                                             = 0x40
  10525 	NEWFILEOPENORD                                                                 = 1547
  10526 	NEWFILEOPENV2ORD                                                               = 1552
  10527 	NEWFRAME                                                                       = 1
  10528 	NEWTRANSPARENT                                                                 = 3
  10529 	NEXTBAND                                                                       = 3
  10530 	NFR_ANSI                                                                       = 1
  10531 	NFR_UNICODE                                                                    = 2
  10532 	NF_QUERY                                                                       = 3
  10533 	NF_REQUERY                                                                     = 4
  10534 	NIF_GUID                                                                       = 0x00000020
  10535 	NIF_ICON                                                                       = 0x00000002
  10536 	NIF_INFO                                                                       = 0x00000010
  10537 	NIF_MESSAGE                                                                    = 0x00000001
  10538 	NIF_STATE                                                                      = 0x00000008
  10539 	NIF_TIP                                                                        = 0x00000004
  10540 	NIIF_ERROR                                                                     = 0x00000003
  10541 	NIIF_ICON_MASK                                                                 = 0x0000000f
  10542 	NIIF_INFO                                                                      = 0x00000001
  10543 	NIIF_NONE                                                                      = 0x00000000
  10544 	NIIF_NOSOUND                                                                   = 0x00000010
  10545 	NIIF_USER                                                                      = 0x00000004
  10546 	NIIF_WARNING                                                                   = 0x00000002
  10547 	NIM_ADD                                                                        = 0x00000000
  10548 	NIM_DELETE                                                                     = 0x00000002
  10549 	NIM_MODIFY                                                                     = 0x00000001
  10550 	NIM_SETFOCUS                                                                   = 0x00000003
  10551 	NIM_SETVERSION                                                                 = 0x00000004
  10552 	NINF_KEY                                                                       = 0x1
  10553 	NIN_BALLOONHIDE                                                                = 1027
  10554 	NIN_BALLOONSHOW                                                                = 1026
  10555 	NIN_BALLOONTIMEOUT                                                             = 1028
  10556 	NIN_BALLOONUSERCLICK                                                           = 1029
  10557 	NIN_KEYSELECT                                                                  = 1025
  10558 	NIN_SELECT                                                                     = 1024
  10559 	NIS_HIDDEN                                                                     = 0x00000001
  10560 	NIS_SHAREDICON                                                                 = 0x00000002
  10561 	NI_CHANGECANDIDATELIST                                                         = 0x0013
  10562 	NI_CLOSECANDIDATE                                                              = 0x0011
  10563 	NI_COMPOSITIONSTR                                                              = 0x0015
  10564 	NI_FINALIZECONVERSIONRESULT                                                    = 0x0014
  10565 	NI_IMEMENUSELECTED                                                             = 0x0018
  10566 	NI_OPENCANDIDATE                                                               = 0x0010
  10567 	NI_SELECTCANDIDATESTR                                                          = 0x0012
  10568 	NI_SETCANDIDATE_PAGESIZE                                                       = 0x0017
  10569 	NI_SETCANDIDATE_PAGESTART                                                      = 0x0016
  10570 	NLS_ALPHANUMERIC                                                               = 0x0
  10571 	NLS_DBCSCHAR                                                                   = 0x10000
  10572 	NLS_HIRAGANA                                                                   = 0x40000
  10573 	NLS_IME_CONVERSION                                                             = 0x800000
  10574 	NLS_IME_DISABLE                                                                = 0x20000000
  10575 	NLS_KATAKANA                                                                   = 0x20000
  10576 	NLS_ROMAN                                                                      = 0x400000
  10577 	NLS_VALID_LOCALE_MASK                                                          = 0x000fffff
  10578 	NMPWAIT_NOWAIT                                                                 = 0x1
  10579 	NMPWAIT_USE_DEFAULT_WAIT                                                       = 0x0
  10580 	NMPWAIT_WAIT_FOREVER                                                           = 0xffffffff
  10581 	NN                                                                             = 1
  10582 	NOERROR                                                                        = 0
  10583 	NONAMELESSSTRUCT                                                               = 1
  10584 	NONAMELESSUNION                                                                = 1
  10585 	NONANTIALIASED_QUALITY                                                         = 3
  10586 	NONZEROLHND                                                                    = 2
  10587 	NONZEROLPTR                                                                    = 0
  10588 	NON_PAGED_DEBUG_SIGNATURE                                                      = 0x494E
  10589 	NOPARITY                                                                       = 0
  10590 	NORMAL_PRINT                                                                   = 0x00000000
  10591 	NORMAL_PRIORITY_CLASS                                                          = 0x20
  10592 	NORM_IGNORECASE                                                                = 0x00000001
  10593 	NORM_IGNOREKANATYPE                                                            = 0x00010000
  10594 	NORM_IGNORENONSPACE                                                            = 0x00000002
  10595 	NORM_IGNORESYMBOLS                                                             = 0x00000004
  10596 	NORM_IGNOREWIDTH                                                               = 0x00020000
  10597 	NORM_LINGUISTIC_CASING                                                         = 0x08000000
  10598 	NOTIFYICON_VERSION                                                             = 3
  10599 	NOT_WITHIN                                                                     = 0
  10600 	NO_ADDRESS                                                                     = 11004
  10601 	NO_DATA                                                                        = 11004
  10602 	NO_ERROR                                                                       = 0
  10603 	NO_LOCK                                                                        = 0
  10604 	NO_PRIORITY                                                                    = 0
  10605 	NO_PROPAGATE_INHERIT_ACE                                                       = 4
  10606 	NO_RECOVERY                                                                    = 11003
  10607 	NRC_ACTSES                                                                     = 0x0f
  10608 	NRC_BADDR                                                                      = 0x07
  10609 	NRC_BRIDGE                                                                     = 0x23
  10610 	NRC_BUFLEN                                                                     = 0x01
  10611 	NRC_CANCEL                                                                     = 0x26
  10612 	NRC_CANOCCR                                                                    = 0x24
  10613 	NRC_CMDCAN                                                                     = 0x0b
  10614 	NRC_CMDTMO                                                                     = 0x05
  10615 	NRC_DUPENV                                                                     = 0x30
  10616 	NRC_DUPNAME                                                                    = 0x0d
  10617 	NRC_ENVNOTDEF                                                                  = 0x34
  10618 	NRC_GOODRET                                                                    = 0x00
  10619 	NRC_IFBUSY                                                                     = 0x21
  10620 	NRC_ILLCMD                                                                     = 0x03
  10621 	NRC_ILLNN                                                                      = 0x13
  10622 	NRC_INCOMP                                                                     = 0x06
  10623 	NRC_INUSE                                                                      = 0x16
  10624 	NRC_INVADDRESS                                                                 = 0x39
  10625 	NRC_INVDDID                                                                    = 0x3B
  10626 	NRC_LOCKFAIL                                                                   = 0x3C
  10627 	NRC_LOCTFUL                                                                    = 0x11
  10628 	NRC_MAXAPPS                                                                    = 0x36
  10629 	NRC_NAMCONF                                                                    = 0x19
  10630 	NRC_NAMERR                                                                     = 0x17
  10631 	NRC_NAMTFUL                                                                    = 0x0e
  10632 	NRC_NOCALL                                                                     = 0x14
  10633 	NRC_NORES                                                                      = 0x09
  10634 	NRC_NORESOURCES                                                                = 0x38
  10635 	NRC_NOSAPS                                                                     = 0x37
  10636 	NRC_NOWILD                                                                     = 0x15
  10637 	NRC_OPENERR                                                                    = 0x3f
  10638 	NRC_OSRESNOTAV                                                                 = 0x35
  10639 	NRC_PENDING                                                                    = 0xff
  10640 	NRC_REMTFUL                                                                    = 0x12
  10641 	NRC_SABORT                                                                     = 0x18
  10642 	NRC_SCLOSED                                                                    = 0x0a
  10643 	NRC_SNUMOUT                                                                    = 0x08
  10644 	NRC_SYSTEM                                                                     = 0x40
  10645 	NRC_TOOMANY                                                                    = 0x22
  10646 	NT351_INTERFACE_SIZE                                                           = 0x40
  10647 	NTAPI                                                                          = 0
  10648 	NTAPI_INLINE                                                                   = 0
  10649 	NTDDI_LONGHORN                                                                 = 100663296
  10650 	NTDDI_VERSION                                                                  = 84017152
  10651 	NTDDI_VISTA                                                                    = 100663296
  10652 	NTDDI_VISTASP1                                                                 = 100663552
  10653 	NTDDI_VISTASP2                                                                 = 100663808
  10654 	NTDDI_VISTASP3                                                                 = 100664064
  10655 	NTDDI_VISTASP4                                                                 = 100664320
  10656 	NTDDI_WIN10                                                                    = 0x0A000000
  10657 	NTDDI_WIN10_19H1                                                               = 0x0A000007
  10658 	NTDDI_WIN10_FE                                                                 = 0x0A00000A
  10659 	NTDDI_WIN10_MN                                                                 = 0x0A000009
  10660 	NTDDI_WIN10_RS1                                                                = 0x0A000002
  10661 	NTDDI_WIN10_RS2                                                                = 0x0A000003
  10662 	NTDDI_WIN10_RS3                                                                = 0x0A000004
  10663 	NTDDI_WIN10_RS4                                                                = 0x0A000005
  10664 	NTDDI_WIN10_RS5                                                                = 0x0A000006
  10665 	NTDDI_WIN10_TH2                                                                = 0x0A000001
  10666 	NTDDI_WIN10_VB                                                                 = 0x0A000008
  10667 	NTDDI_WIN2K                                                                    = 0x05000000
  10668 	NTDDI_WIN2KSP1                                                                 = 0x05000100
  10669 	NTDDI_WIN2KSP2                                                                 = 0x05000200
  10670 	NTDDI_WIN2KSP3                                                                 = 0x05000300
  10671 	NTDDI_WIN2KSP4                                                                 = 0x05000400
  10672 	NTDDI_WIN6                                                                     = 0x06000000
  10673 	NTDDI_WIN6SP1                                                                  = 0x06000100
  10674 	NTDDI_WIN6SP2                                                                  = 0x06000200
  10675 	NTDDI_WIN6SP3                                                                  = 0x06000300
  10676 	NTDDI_WIN6SP4                                                                  = 0x06000400
  10677 	NTDDI_WIN7                                                                     = 0x06010000
  10678 	NTDDI_WIN8                                                                     = 0x06020000
  10679 	NTDDI_WINBLUE                                                                  = 0x06030000
  10680 	NTDDI_WINTHRESHOLD                                                             = 0x0A000000
  10681 	NTDDI_WINXP                                                                    = 0x05010000
  10682 	NTDDI_WINXPSP1                                                                 = 0x05010100
  10683 	NTDDI_WINXPSP2                                                                 = 0x05010200
  10684 	NTDDI_WINXPSP3                                                                 = 0x05010300
  10685 	NTDDI_WINXPSP4                                                                 = 0x05010400
  10686 	NTDDI_WS03                                                                     = 0x05020000
  10687 	NTDDI_WS03SP1                                                                  = 0x05020100
  10688 	NTDDI_WS03SP2                                                                  = 0x05020200
  10689 	NTDDI_WS03SP3                                                                  = 0x05020300
  10690 	NTDDI_WS03SP4                                                                  = 0x05020400
  10691 	NTDDI_WS08                                                                     = 100663552
  10692 	NTDDI_WS08SP2                                                                  = 100663808
  10693 	NTDDI_WS08SP3                                                                  = 100664064
  10694 	NTDDI_WS08SP4                                                                  = 100664320
  10695 	NTE_OP_OK                                                                      = 0
  10696 	NTM_BOLD                                                                       = 32
  10697 	NTM_DSIG                                                                       = 0x00200000
  10698 	NTM_ITALIC                                                                     = 1
  10699 	NTM_MULTIPLEMASTER                                                             = 0x00080000
  10700 	NTM_NONNEGATIVE_AC                                                             = 0x00010000
  10701 	NTM_PS_OPENTYPE                                                                = 0x00020000
  10702 	NTM_REGULAR                                                                    = 64
  10703 	NTM_TT_OPENTYPE                                                                = 0x00040000
  10704 	NTM_TYPE1                                                                      = 0x00100000
  10705 	NULLREGION                                                                     = 1
  10706 	NULL_BRUSH                                                                     = 5
  10707 	NULL_PEN                                                                       = 8
  10708 	NUMBRUSHES                                                                     = 16
  10709 	NUMCOLORS                                                                      = 24
  10710 	NUMFONTS                                                                       = 22
  10711 	NUMLOCK_ON                                                                     = 0x20
  10712 	NUMMARKERS                                                                     = 20
  10713 	NUMPENS                                                                        = 18
  10714 	NUMPRS_CURRENCY                                                                = 0x0400
  10715 	NUMPRS_DECIMAL                                                                 = 0x0100
  10716 	NUMPRS_EXPONENT                                                                = 0x0800
  10717 	NUMPRS_HEX_OCT                                                                 = 0x0040
  10718 	NUMPRS_INEXACT                                                                 = 0x20000
  10719 	NUMPRS_LEADING_MINUS                                                           = 0x0010
  10720 	NUMPRS_LEADING_PLUS                                                            = 0x0004
  10721 	NUMPRS_LEADING_WHITE                                                           = 0x0001
  10722 	NUMPRS_NEG                                                                     = 0x10000
  10723 	NUMPRS_PARENS                                                                  = 0x0080
  10724 	NUMPRS_STD                                                                     = 0x1FFF
  10725 	NUMPRS_THOUSANDS                                                               = 0x0200
  10726 	NUMPRS_TRAILING_MINUS                                                          = 0x0020
  10727 	NUMPRS_TRAILING_PLUS                                                           = 0x0008
  10728 	NUMPRS_TRAILING_WHITE                                                          = 0x0002
  10729 	NUMPRS_USE_ALL                                                                 = 0x1000
  10730 	NUMRESERVED                                                                    = 106
  10731 	NUM_DISCHARGE_POLICIES                                                         = 4
  10732 	N_BTMASK                                                                       = 0x000F
  10733 	N_BTSHFT                                                                       = 4
  10734 	N_OR_COST                                                                      = 3
  10735 	N_SORT_BUCKET                                                                  = 32
  10736 	N_STATEMENT                                                                    = 8
  10737 	N_TMASK                                                                        = 0x0030
  10738 	N_TMASK1                                                                       = 0x00C0
  10739 	N_TMASK2                                                                       = 0x00F0
  10740 	N_TSHIFT                                                                       = 2
  10741 	OBJECT_INHERIT_ACE                                                             = 1
  10742 	OBJ_BITMAP                                                                     = 7
  10743 	OBJ_BRUSH                                                                      = 2
  10744 	OBJ_COLORSPACE                                                                 = 14
  10745 	OBJ_DC                                                                         = 3
  10746 	OBJ_ENHMETADC                                                                  = 12
  10747 	OBJ_ENHMETAFILE                                                                = 13
  10748 	OBJ_EXTPEN                                                                     = 11
  10749 	OBJ_FONT                                                                       = 6
  10750 	OBJ_MEMDC                                                                      = 10
  10751 	OBJ_METADC                                                                     = 4
  10752 	OBJ_METAFILE                                                                   = 9
  10753 	OBJ_PAL                                                                        = 5
  10754 	OBJ_PEN                                                                        = 1
  10755 	OBJ_REGION                                                                     = 8
  10756 	OBSOLETE_DISK_GET_WRITE_CACHE_STATE                                            = 475356
  10757 	OBSOLETE_IOCTL_STORAGE_RESET_BUS                                               = 3002368
  10758 	OBSOLETE_IOCTL_STORAGE_RESET_DEVICE                                            = 3002372
  10759 	OCSP_BASIC_BY_KEY_RESPONDER_ID                                                 = 2
  10760 	OCSP_BASIC_BY_NAME_RESPONDER_ID                                                = 1
  10761 	OCSP_BASIC_GOOD_CERT_STATUS                                                    = 0
  10762 	OCSP_BASIC_RESPONSE_V1                                                         = 0
  10763 	OCSP_BASIC_REVOKED_CERT_STATUS                                                 = 1
  10764 	OCSP_BASIC_UNKNOWN_CERT_STATUS                                                 = 2
  10765 	OCSP_INTERNAL_ERROR_RESPONSE                                                   = 2
  10766 	OCSP_MALFORMED_REQUEST_RESPONSE                                                = 1
  10767 	OCSP_REQUEST_V1                                                                = 0
  10768 	OCSP_SIG_REQUIRED_RESPONSE                                                     = 5
  10769 	OCSP_SUCCESSFUL_RESPONSE                                                       = 0
  10770 	OCSP_TRY_LATER_RESPONSE                                                        = 3
  10771 	OCSP_UNAUTHORIZED_RESPONSE                                                     = 6
  10772 	ODA_DRAWENTIRE                                                                 = 0x0001
  10773 	ODA_FOCUS                                                                      = 0x0004
  10774 	ODA_SELECT                                                                     = 0x0002
  10775 	ODDPARITY                                                                      = 1
  10776 	ODS_CHECKED                                                                    = 0x0008
  10777 	ODS_COMBOBOXEDIT                                                               = 0x1000
  10778 	ODS_DEFAULT                                                                    = 0x0020
  10779 	ODS_DISABLED                                                                   = 0x0004
  10780 	ODS_FOCUS                                                                      = 0x0010
  10781 	ODS_GRAYED                                                                     = 0x0002
  10782 	ODS_HOTLIGHT                                                                   = 0x0040
  10783 	ODS_INACTIVE                                                                   = 0x0080
  10784 	ODS_NOACCEL                                                                    = 0x0100
  10785 	ODS_NOFOCUSRECT                                                                = 0x0200
  10786 	ODS_SELECTED                                                                   = 0x0001
  10787 	ODT_BUTTON                                                                     = 4
  10788 	ODT_COMBOBOX                                                                   = 3
  10789 	ODT_LISTBOX                                                                    = 2
  10790 	ODT_MENU                                                                       = 1
  10791 	ODT_STATIC                                                                     = 5
  10792 	OEM_CHARSET                                                                    = 255
  10793 	OEM_FIXED_FONT                                                                 = 10
  10794 	OE_Abort                                                                       = 2
  10795 	OE_Cascade                                                                     = 10
  10796 	OE_Default                                                                     = 11
  10797 	OE_Fail                                                                        = 3
  10798 	OE_Ignore                                                                      = 4
  10799 	OE_None                                                                        = 0
  10800 	OE_Replace                                                                     = 5
  10801 	OE_Restrict                                                                    = 7
  10802 	OE_Rollback                                                                    = 1
  10803 	OE_SetDflt                                                                     = 9
  10804 	OE_SetNull                                                                     = 8
  10805 	OE_Update                                                                      = 6
  10806 	OFFLINE_STATUS_INCOMPLETE                                                      = 0x0004
  10807 	OFFLINE_STATUS_LOCAL                                                           = 0x0001
  10808 	OFFLINE_STATUS_REMOTE                                                          = 0x0002
  10809 	OFN_ALLOWMULTISELECT                                                           = 0x200
  10810 	OFN_CREATEPROMPT                                                               = 0x2000
  10811 	OFN_DONTADDTORECENT                                                            = 0x2000000
  10812 	OFN_ENABLEHOOK                                                                 = 0x20
  10813 	OFN_ENABLEINCLUDENOTIFY                                                        = 0x400000
  10814 	OFN_ENABLESIZING                                                               = 0x800000
  10815 	OFN_ENABLETEMPLATE                                                             = 0x40
  10816 	OFN_ENABLETEMPLATEHANDLE                                                       = 0x80
  10817 	OFN_EXPLORER                                                                   = 0x80000
  10818 	OFN_EXTENSIONDIFFERENT                                                         = 0x400
  10819 	OFN_EX_NOPLACESBAR                                                             = 0x1
  10820 	OFN_FILEMUSTEXIST                                                              = 0x1000
  10821 	OFN_FORCESHOWHIDDEN                                                            = 0x10000000
  10822 	OFN_HIDEREADONLY                                                               = 0x4
  10823 	OFN_LONGNAMES                                                                  = 0x200000
  10824 	OFN_NOCHANGEDIR                                                                = 0x8
  10825 	OFN_NODEREFERENCELINKS                                                         = 0x100000
  10826 	OFN_NOLONGNAMES                                                                = 0x40000
  10827 	OFN_NONETWORKBUTTON                                                            = 0x20000
  10828 	OFN_NOREADONLYRETURN                                                           = 0x8000
  10829 	OFN_NOTESTFILECREATE                                                           = 0x10000
  10830 	OFN_NOVALIDATE                                                                 = 0x100
  10831 	OFN_OVERWRITEPROMPT                                                            = 0x2
  10832 	OFN_PATHMUSTEXIST                                                              = 0x800
  10833 	OFN_READONLY                                                                   = 0x1
  10834 	OFN_SHAREAWARE                                                                 = 0x4000
  10835 	OFN_SHAREFALLTHROUGH                                                           = 2
  10836 	OFN_SHARENOWARN                                                                = 1
  10837 	OFN_SHAREWARN                                                                  = 0
  10838 	OFN_SHOWHELP                                                                   = 0x10
  10839 	OFS_MAXPATHNAME                                                                = 128
  10840 	OF_CANCEL                                                                      = 0x800
  10841 	OF_CREATE                                                                      = 0x1000
  10842 	OF_DELETE                                                                      = 0x200
  10843 	OF_EXIST                                                                       = 0x4000
  10844 	OF_PARSE                                                                       = 0x100
  10845 	OF_PROMPT                                                                      = 0x2000
  10846 	OF_READ                                                                        = 0x0
  10847 	OF_READWRITE                                                                   = 0x2
  10848 	OF_REOPEN                                                                      = 0x8000
  10849 	OF_SHARE_COMPAT                                                                = 0x0
  10850 	OF_SHARE_DENY_NONE                                                             = 0x40
  10851 	OF_SHARE_DENY_READ                                                             = 0x30
  10852 	OF_SHARE_DENY_WRITE                                                            = 0x20
  10853 	OF_SHARE_EXCLUSIVE                                                             = 0x10
  10854 	OF_VERIFY                                                                      = 0x400
  10855 	OF_WRITE                                                                       = 0x1
  10856 	OLD_P_OVERLAY                                                                  = 2
  10857 	OLECREATE_LEAVERUNNING                                                         = 0x1
  10858 	OLEIVERB_DISCARDUNDOSTATE                                                      = -6
  10859 	OLEIVERB_HIDE                                                                  = -3
  10860 	OLEIVERB_INPLACEACTIVATE                                                       = -5
  10861 	OLEIVERB_OPEN                                                                  = -2
  10862 	OLEIVERB_PRIMARY                                                               = 0
  10863 	OLEIVERB_SHOW                                                                  = -1
  10864 	OLEIVERB_UIACTIVATE                                                            = -4
  10865 	OLEOBJ_E_FIRST                                                                 = 2147746176
  10866 	OLEOBJ_E_LAST                                                                  = 2147746191
  10867 	OLEOBJ_S_FIRST                                                                 = 262528
  10868 	OLEOBJ_S_LAST                                                                  = 262543
  10869 	OMIT_TEMPDB                                                                    = 0
  10870 	ONE5STOPBITS                                                                   = 1
  10871 	ONEPASS_MULTI                                                                  = 2
  10872 	ONEPASS_OFF                                                                    = 0
  10873 	ONEPASS_SINGLE                                                                 = 1
  10874 	ONESTOPBIT                                                                     = 0
  10875 	OPAQUE                                                                         = 2
  10876 	OPAQUEKEYBLOB                                                                  = 0x9
  10877 	OPENCHANNEL                                                                    = 4110
  10878 	OPEN_ALWAYS                                                                    = 4
  10879 	OPEN_EXISTING                                                                  = 3
  10880 	OPFLAG_APPEND                                                                  = 0x08
  10881 	OPFLAG_AUXDELETE                                                               = 0x04
  10882 	OPFLAG_BULKCSR                                                                 = 0x01
  10883 	OPFLAG_EPHEM                                                                   = 0x01
  10884 	OPFLAG_FORDELETE                                                               = 0x08
  10885 	OPFLAG_ISNOOP                                                                  = 0x40
  10886 	OPFLAG_ISUPDATE                                                                = 0x04
  10887 	OPFLAG_LASTROWID                                                               = 0x20
  10888 	OPFLAG_LENGTHARG                                                               = 0x40
  10889 	OPFLAG_NCHANGE                                                                 = 0x01
  10890 	OPFLAG_NOCHNG                                                                  = 0x01
  10891 	OPFLAG_NOCHNG_MAGIC                                                            = 0x6d
  10892 	OPFLAG_P2ISREG                                                                 = 0x10
  10893 	OPFLAG_PERMUTE                                                                 = 0x01
  10894 	OPFLAG_PREFORMAT                                                               = 0x80
  10895 	OPFLAG_SAVEPOSITION                                                            = 0x02
  10896 	OPFLAG_SEEKEQ                                                                  = 0x02
  10897 	OPFLAG_TYPEOFARG                                                               = 0x80
  10898 	OPFLAG_USESEEKRESULT                                                           = 0x10
  10899 	OPFLG_IN1                                                                      = 0x02
  10900 	OPFLG_IN2                                                                      = 0x04
  10901 	OPFLG_IN3                                                                      = 0x08
  10902 	OPFLG_JUMP                                                                     = 0x01
  10903 	OPFLG_NCYCLE                                                                   = 0x40
  10904 	OPFLG_OUT2                                                                     = 0x10
  10905 	OPFLG_OUT3                                                                     = 0x20
  10906 	OPTIONAL                                                                       = 0
  10907 	OP_Abortable                                                                   = 186
  10908 	OP_Add                                                                         = 106
  10909 	OP_AddImm                                                                      = 86
  10910 	OP_Affinity                                                                    = 96
  10911 	OP_AggFinal                                                                    = 165
  10912 	OP_AggInverse                                                                  = 161
  10913 	OP_AggStep                                                                     = 162
  10914 	OP_AggStep1                                                                    = 163
  10915 	OP_AggValue                                                                    = 164
  10916 	OP_And                                                                         = 44
  10917 	OP_AutoCommit                                                                  = 1
  10918 	OP_BeginSubrtn                                                                 = 74
  10919 	OP_BitAnd                                                                      = 102
  10920 	OP_BitNot                                                                      = 114
  10921 	OP_BitOr                                                                       = 103
  10922 	OP_Blob                                                                        = 77
  10923 	OP_Cast                                                                        = 88
  10924 	OP_Checkpoint                                                                  = 3
  10925 	OP_Clear                                                                       = 145
  10926 	OP_Close                                                                       = 122
  10927 	OP_ClrSubtype                                                                  = 179
  10928 	OP_CollSeq                                                                     = 85
  10929 	OP_Column                                                                      = 94
  10930 	OP_ColumnsUsed                                                                 = 123
  10931 	OP_Compare                                                                     = 90
  10932 	OP_Concat                                                                      = 111
  10933 	OP_Copy                                                                        = 80
  10934 	OP_Count                                                                       = 98
  10935 	OP_CreateBtree                                                                 = 147
  10936 	OP_CursorHint                                                                  = 182
  10937 	OP_CursorLock                                                                  = 167
  10938 	OP_CursorUnlock                                                                = 168
  10939 	OP_DecrJumpZero                                                                = 61
  10940 	OP_DeferredSeek                                                                = 141
  10941 	OP_Delete                                                                      = 130
  10942 	OP_Destroy                                                                     = 144
  10943 	OP_Divide                                                                      = 109
  10944 	OP_DropIndex                                                                   = 152
  10945 	OP_DropTable                                                                   = 151
  10946 	OP_DropTrigger                                                                 = 154
  10947 	OP_ElseEq                                                                      = 58
  10948 	OP_EndCoroutine                                                                = 68
  10949 	OP_Eq                                                                          = 53
  10950 	OP_Expire                                                                      = 166
  10951 	OP_Explain                                                                     = 185
  10952 	OP_Filter                                                                      = 64
  10953 	OP_FilterAdd                                                                   = 180
  10954 	OP_FinishSeek                                                                  = 143
  10955 	OP_FkCheck                                                                     = 83
  10956 	OP_FkCounter                                                                   = 158
  10957 	OP_FkIfZero                                                                    = 49
  10958 	OP_Found                                                                       = 29
  10959 	OP_Function                                                                    = 66
  10960 	OP_Ge                                                                          = 57
  10961 	OP_Gosub                                                                       = 10
  10962 	OP_Goto                                                                        = 9
  10963 	OP_Gt                                                                          = 54
  10964 	OP_Halt                                                                        = 70
  10965 	OP_HaltIfNull                                                                  = 69
  10966 	OP_IdxDelete                                                                   = 140
  10967 	OP_IdxGE                                                                       = 45
  10968 	OP_IdxGT                                                                       = 41
  10969 	OP_IdxInsert                                                                   = 138
  10970 	OP_IdxLE                                                                       = 40
  10971 	OP_IdxLT                                                                       = 42
  10972 	OP_IdxRowid                                                                    = 142
  10973 	OP_If                                                                          = 16
  10974 	OP_IfNoHope                                                                    = 26
  10975 	OP_IfNot                                                                       = 17
  10976 	OP_IfNotOpen                                                                   = 25
  10977 	OP_IfNotZero                                                                   = 60
  10978 	OP_IfNullRow                                                                   = 20
  10979 	OP_IfPos                                                                       = 59
  10980 	OP_IfSmaller                                                                   = 33
  10981 	OP_IncrVacuum                                                                  = 62
  10982 	OP_Init                                                                        = 8
  10983 	OP_InitCoroutine                                                               = 11
  10984 	OP_Insert                                                                      = 128
  10985 	OP_Int64                                                                       = 72
  10986 	OP_IntCopy                                                                     = 82
  10987 	OP_Integer                                                                     = 71
  10988 	OP_IntegrityCk                                                                 = 155
  10989 	OP_IsNull                                                                      = 50
  10990 	OP_IsTrue                                                                      = 91
  10991 	OP_IsType                                                                      = 18
  10992 	OP_JournalMode                                                                 = 4
  10993 	OP_Jump                                                                        = 14
  10994 	OP_Last                                                                        = 32
  10995 	OP_Le                                                                          = 55
  10996 	OP_LoadAnalysis                                                                = 150
  10997 	OP_Lt                                                                          = 56
  10998 	OP_MakeRecord                                                                  = 97
  10999 	OP_MaxPgcnt                                                                    = 178
  11000 	OP_MemMax                                                                      = 159
  11001 	OP_Move                                                                        = 79
  11002 	OP_Multiply                                                                    = 108
  11003 	OP_MustBeInt                                                                   = 13
  11004 	OP_Ne                                                                          = 52
  11005 	OP_NewRowid                                                                    = 127
  11006 	OP_Next                                                                        = 39
  11007 	OP_NoConflict                                                                  = 27
  11008 	OP_Noop                                                                        = 184
  11009 	OP_Not                                                                         = 19
  11010 	OP_NotExists                                                                   = 31
  11011 	OP_NotFound                                                                    = 28
  11012 	OP_NotNull                                                                     = 51
  11013 	OP_Null                                                                        = 75
  11014 	OP_NullRow                                                                     = 136
  11015 	OP_Offset                                                                      = 93
  11016 	OP_OffsetLimit                                                                 = 160
  11017 	OP_Once                                                                        = 15
  11018 	OP_OpenAutoindex                                                               = 116
  11019 	OP_OpenDup                                                                     = 115
  11020 	OP_OpenEphemeral                                                               = 118
  11021 	OP_OpenPseudo                                                                  = 121
  11022 	OP_OpenRead                                                                    = 112
  11023 	OP_OpenWrite                                                                   = 113
  11024 	OP_Or                                                                          = 43
  11025 	OP_Pagecount                                                                   = 177
  11026 	OP_Param                                                                       = 157
  11027 	OP_ParseSchema                                                                 = 149
  11028 	OP_Permutation                                                                 = 89
  11029 	OP_Prev                                                                        = 38
  11030 	OP_Program                                                                     = 48
  11031 	OP_PureFunc                                                                    = 65
  11032 	OP_ReadCookie                                                                  = 99
  11033 	OP_Real                                                                        = 153
  11034 	OP_RealAffinity                                                                = 87
  11035 	OP_ReleaseReg                                                                  = 183
  11036 	OP_Remainder                                                                   = 110
  11037 	OP_ReopenIdx                                                                   = 101
  11038 	OP_ResetCount                                                                  = 131
  11039 	OP_ResetSorter                                                                 = 146
  11040 	OP_ResultRow                                                                   = 84
  11041 	OP_Return                                                                      = 67
  11042 	OP_Rewind                                                                      = 36
  11043 	OP_RowCell                                                                     = 129
  11044 	OP_RowData                                                                     = 134
  11045 	OP_RowSetAdd                                                                   = 156
  11046 	OP_RowSetRead                                                                  = 46
  11047 	OP_RowSetTest                                                                  = 47
  11048 	OP_Rowid                                                                       = 135
  11049 	OP_SCopy                                                                       = 81
  11050 	OP_Savepoint                                                                   = 0
  11051 	OP_SeekEnd                                                                     = 137
  11052 	OP_SeekGE                                                                      = 23
  11053 	OP_SeekGT                                                                      = 24
  11054 	OP_SeekHit                                                                     = 125
  11055 	OP_SeekLE                                                                      = 22
  11056 	OP_SeekLT                                                                      = 21
  11057 	OP_SeekRowid                                                                   = 30
  11058 	OP_SeekScan                                                                    = 124
  11059 	OP_Sequence                                                                    = 126
  11060 	OP_SequenceTest                                                                = 120
  11061 	OP_SetCookie                                                                   = 100
  11062 	OP_ShiftLeft                                                                   = 104
  11063 	OP_ShiftRight                                                                  = 105
  11064 	OP_SoftNull                                                                    = 76
  11065 	OP_Sort                                                                        = 35
  11066 	OP_SorterCompare                                                               = 132
  11067 	OP_SorterData                                                                  = 133
  11068 	OP_SorterInsert                                                                = 139
  11069 	OP_SorterNext                                                                  = 37
  11070 	OP_SorterOpen                                                                  = 119
  11071 	OP_SorterSort                                                                  = 34
  11072 	OP_SqlExec                                                                     = 148
  11073 	OP_String                                                                      = 73
  11074 	OP_String8                                                                     = 117
  11075 	OP_Subtract                                                                    = 107
  11076 	OP_TableLock                                                                   = 169
  11077 	OP_Trace                                                                       = 181
  11078 	OP_Transaction                                                                 = 2
  11079 	OP_TypeCheck                                                                   = 95
  11080 	OP_VBegin                                                                      = 170
  11081 	OP_VColumn                                                                     = 175
  11082 	OP_VCreate                                                                     = 171
  11083 	OP_VDestroy                                                                    = 172
  11084 	OP_VFilter                                                                     = 6
  11085 	OP_VInitIn                                                                     = 174
  11086 	OP_VNext                                                                       = 63
  11087 	OP_VOpen                                                                       = 173
  11088 	OP_VRename                                                                     = 176
  11089 	OP_VUpdate                                                                     = 7
  11090 	OP_Vacuum                                                                      = 5
  11091 	OP_Variable                                                                    = 78
  11092 	OP_Yield                                                                       = 12
  11093 	OP_ZeroOrNull                                                                  = 92
  11094 	ORD_LANGDRIVER                                                                 = 1
  11095 	OR_INVALID_OID                                                                 = 1911
  11096 	OR_INVALID_OXID                                                                = 1910
  11097 	OR_INVALID_SET                                                                 = 1912
  11098 	OSVERSION_MASK                                                                 = 0xFFFF0000
  11099 	OS_VXWORKS                                                                     = 0
  11100 	OUT                                                                            = 0
  11101 	OUTPUT_DEBUG_STRING_EVENT                                                      = 8
  11102 	OUT_CHARACTER_PRECIS                                                           = 2
  11103 	OUT_DEFAULT_PRECIS                                                             = 0
  11104 	OUT_DEVICE_PRECIS                                                              = 5
  11105 	OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK_EXPORT_NAME                             = "OutOfProcessFunctionTableCallback"
  11106 	OUT_OUTLINE_PRECIS                                                             = 8
  11107 	OUT_PS_ONLY_PRECIS                                                             = 10
  11108 	OUT_RASTER_PRECIS                                                              = 6
  11109 	OUT_SCREEN_OUTLINE_PRECIS                                                      = 9
  11110 	OUT_STRING_PRECIS                                                              = 1
  11111 	OUT_STROKE_PRECIS                                                              = 3
  11112 	OUT_TT_ONLY_PRECIS                                                             = 7
  11113 	OUT_TT_PRECIS                                                                  = 4
  11114 	OVERFLOW                                                                       = 3
  11115 	OVERWRITE_HIDDEN                                                               = 4
  11116 	OWNER_SECURITY_INFORMATION                                                     = 1
  11117 	P4_COLLSEQ                                                                     = -2
  11118 	P4_DYNAMIC                                                                     = -6
  11119 	P4_EXPR                                                                        = -9
  11120 	P4_FREE_IF_LE                                                                  = -6
  11121 	P4_FUNCCTX                                                                     = -15
  11122 	P4_FUNCDEF                                                                     = -7
  11123 	P4_INT32                                                                       = -3
  11124 	P4_INT64                                                                       = -13
  11125 	P4_INTARRAY                                                                    = -14
  11126 	P4_KEYINFO                                                                     = -8
  11127 	P4_MEM                                                                         = -10
  11128 	P4_NOTUSED                                                                     = 0
  11129 	P4_REAL                                                                        = -12
  11130 	P4_STATIC                                                                      = -1
  11131 	P4_SUBPROGRAM                                                                  = -4
  11132 	P4_TABLE                                                                       = -5
  11133 	P4_TRANSIENT                                                                   = 0
  11134 	P4_VTAB                                                                        = -11
  11135 	P5_ConstraintCheck                                                             = 3
  11136 	P5_ConstraintFK                                                                = 4
  11137 	P5_ConstraintNotNull                                                           = 1
  11138 	P5_ConstraintUnique                                                            = 2
  11139 	PAGER_CACHESPILL                                                               = 0x20
  11140 	PAGER_CKPT_FULLFSYNC                                                           = 0x10
  11141 	PAGER_ERROR                                                                    = 6
  11142 	PAGER_FLAGS_MASK                                                               = 0x38
  11143 	PAGER_FULLFSYNC                                                                = 0x08
  11144 	PAGER_GET_NOCONTENT                                                            = 0x01
  11145 	PAGER_GET_READONLY                                                             = 0x02
  11146 	PAGER_JOURNALMODE_DELETE                                                       = 0
  11147 	PAGER_JOURNALMODE_MEMORY                                                       = 4
  11148 	PAGER_JOURNALMODE_OFF                                                          = 2
  11149 	PAGER_JOURNALMODE_PERSIST                                                      = 1
  11150 	PAGER_JOURNALMODE_QUERY                                                        = -1
  11151 	PAGER_JOURNALMODE_TRUNCATE                                                     = 3
  11152 	PAGER_JOURNALMODE_WAL                                                          = 5
  11153 	PAGER_LOCKINGMODE_EXCLUSIVE                                                    = 1
  11154 	PAGER_LOCKINGMODE_NORMAL                                                       = 0
  11155 	PAGER_LOCKINGMODE_QUERY                                                        = -1
  11156 	PAGER_MEMORY                                                                   = 0x0002
  11157 	PAGER_OMIT_JOURNAL                                                             = 0x0001
  11158 	PAGER_OPEN                                                                     = 0
  11159 	PAGER_READER                                                                   = 1
  11160 	PAGER_STAT_HIT                                                                 = 0
  11161 	PAGER_STAT_MISS                                                                = 1
  11162 	PAGER_STAT_SPILL                                                               = 3
  11163 	PAGER_STAT_WRITE                                                               = 2
  11164 	PAGER_SYNCHRONOUS_EXTRA                                                        = 0x04
  11165 	PAGER_SYNCHRONOUS_FULL                                                         = 0x03
  11166 	PAGER_SYNCHRONOUS_MASK                                                         = 0x07
  11167 	PAGER_SYNCHRONOUS_NORMAL                                                       = 0x02
  11168 	PAGER_SYNCHRONOUS_OFF                                                          = 0x01
  11169 	PAGER_WRITER_CACHEMOD                                                          = 3
  11170 	PAGER_WRITER_DBMOD                                                             = 4
  11171 	PAGER_WRITER_FINISHED                                                          = 5
  11172 	PAGER_WRITER_LOCKED                                                            = 2
  11173 	PAGESETUPDLGORD                                                                = 1546
  11174 	PAGESETUPDLGORDMOTIF                                                           = 1550
  11175 	PAGE_ENCLAVE_DECOMMIT                                                          = 0x10000000
  11176 	PAGE_ENCLAVE_THREAD_CONTROL                                                    = 0x80000000
  11177 	PAGE_ENCLAVE_UNVALIDATED                                                       = 0x20000000
  11178 	PAGE_EXECUTE                                                                   = 0x10
  11179 	PAGE_EXECUTE_READ                                                              = 0x20
  11180 	PAGE_EXECUTE_READWRITE                                                         = 0x40
  11181 	PAGE_EXECUTE_WRITECOPY                                                         = 0x80
  11182 	PAGE_GRAPHICS_COHERENT                                                         = 0x20000
  11183 	PAGE_GRAPHICS_EXECUTE                                                          = 0x4000
  11184 	PAGE_GRAPHICS_EXECUTE_READ                                                     = 0x8000
  11185 	PAGE_GRAPHICS_EXECUTE_READWRITE                                                = 0x10000
  11186 	PAGE_GRAPHICS_NOACCESS                                                         = 0x0800
  11187 	PAGE_GRAPHICS_READONLY                                                         = 0x1000
  11188 	PAGE_GRAPHICS_READWRITE                                                        = 0x2000
  11189 	PAGE_GUARD                                                                     = 0x100
  11190 	PAGE_NOACCESS                                                                  = 0x01
  11191 	PAGE_NOCACHE                                                                   = 0x200
  11192 	PAGE_READONLY                                                                  = 0x02
  11193 	PAGE_READWRITE                                                                 = 0x04
  11194 	PAGE_REVERT_TO_FILE_MAP                                                        = 0x80000000
  11195 	PAGE_TARGETS_INVALID                                                           = 0x40000000
  11196 	PAGE_TARGETS_NO_UPDATE                                                         = 0x40000000
  11197 	PAGE_WRITECOMBINE                                                              = 0x400
  11198 	PAGE_WRITECOPY                                                                 = 0x08
  11199 	PANOSE_COUNT                                                                   = 10
  11200 	PAN_ANY                                                                        = 0
  11201 	PAN_ARMSTYLE_INDEX                                                             = 6
  11202 	PAN_BENT_ARMS_DOUBLE_SERIF                                                     = 11
  11203 	PAN_BENT_ARMS_HORZ                                                             = 7
  11204 	PAN_BENT_ARMS_SINGLE_SERIF                                                     = 10
  11205 	PAN_BENT_ARMS_VERT                                                             = 9
  11206 	PAN_BENT_ARMS_WEDGE                                                            = 8
  11207 	PAN_CONTRAST_HIGH                                                              = 8
  11208 	PAN_CONTRAST_INDEX                                                             = 4
  11209 	PAN_CONTRAST_LOW                                                               = 4
  11210 	PAN_CONTRAST_MEDIUM                                                            = 6
  11211 	PAN_CONTRAST_MEDIUM_HIGH                                                       = 7
  11212 	PAN_CONTRAST_MEDIUM_LOW                                                        = 5
  11213 	PAN_CONTRAST_NONE                                                              = 2
  11214 	PAN_CONTRAST_VERY_HIGH                                                         = 9
  11215 	PAN_CONTRAST_VERY_LOW                                                          = 3
  11216 	PAN_CULTURE_LATIN                                                              = 0
  11217 	PAN_FAMILYTYPE_INDEX                                                           = 0
  11218 	PAN_FAMILY_DECORATIVE                                                          = 4
  11219 	PAN_FAMILY_PICTORIAL                                                           = 5
  11220 	PAN_FAMILY_SCRIPT                                                              = 3
  11221 	PAN_FAMILY_TEXT_DISPLAY                                                        = 2
  11222 	PAN_LETTERFORM_INDEX                                                           = 7
  11223 	PAN_LETT_NORMAL_BOXED                                                          = 4
  11224 	PAN_LETT_NORMAL_CONTACT                                                        = 2
  11225 	PAN_LETT_NORMAL_FLATTENED                                                      = 5
  11226 	PAN_LETT_NORMAL_OFF_CENTER                                                     = 7
  11227 	PAN_LETT_NORMAL_ROUNDED                                                        = 6
  11228 	PAN_LETT_NORMAL_SQUARE                                                         = 8
  11229 	PAN_LETT_NORMAL_WEIGHTED                                                       = 3
  11230 	PAN_LETT_OBLIQUE_BOXED                                                         = 11
  11231 	PAN_LETT_OBLIQUE_CONTACT                                                       = 9
  11232 	PAN_LETT_OBLIQUE_FLATTENED                                                     = 12
  11233 	PAN_LETT_OBLIQUE_OFF_CENTER                                                    = 14
  11234 	PAN_LETT_OBLIQUE_ROUNDED                                                       = 13
  11235 	PAN_LETT_OBLIQUE_SQUARE                                                        = 15
  11236 	PAN_LETT_OBLIQUE_WEIGHTED                                                      = 10
  11237 	PAN_MIDLINE_CONSTANT_POINTED                                                   = 9
  11238 	PAN_MIDLINE_CONSTANT_SERIFED                                                   = 10
  11239 	PAN_MIDLINE_CONSTANT_TRIMMED                                                   = 8
  11240 	PAN_MIDLINE_HIGH_POINTED                                                       = 6
  11241 	PAN_MIDLINE_HIGH_SERIFED                                                       = 7
  11242 	PAN_MIDLINE_HIGH_TRIMMED                                                       = 5
  11243 	PAN_MIDLINE_INDEX                                                              = 8
  11244 	PAN_MIDLINE_LOW_POINTED                                                        = 12
  11245 	PAN_MIDLINE_LOW_SERIFED                                                        = 13
  11246 	PAN_MIDLINE_LOW_TRIMMED                                                        = 11
  11247 	PAN_MIDLINE_STANDARD_POINTED                                                   = 3
  11248 	PAN_MIDLINE_STANDARD_SERIFED                                                   = 4
  11249 	PAN_MIDLINE_STANDARD_TRIMMED                                                   = 2
  11250 	PAN_NO_FIT                                                                     = 1
  11251 	PAN_PROPORTION_INDEX                                                           = 3
  11252 	PAN_PROP_CONDENSED                                                             = 6
  11253 	PAN_PROP_EVEN_WIDTH                                                            = 4
  11254 	PAN_PROP_EXPANDED                                                              = 5
  11255 	PAN_PROP_MODERN                                                                = 3
  11256 	PAN_PROP_MONOSPACED                                                            = 9
  11257 	PAN_PROP_OLD_STYLE                                                             = 2
  11258 	PAN_PROP_VERY_CONDENSED                                                        = 8
  11259 	PAN_PROP_VERY_EXPANDED                                                         = 7
  11260 	PAN_SERIFSTYLE_INDEX                                                           = 1
  11261 	PAN_SERIF_BONE                                                                 = 8
  11262 	PAN_SERIF_COVE                                                                 = 2
  11263 	PAN_SERIF_EXAGGERATED                                                          = 9
  11264 	PAN_SERIF_FLARED                                                               = 14
  11265 	PAN_SERIF_NORMAL_SANS                                                          = 11
  11266 	PAN_SERIF_OBTUSE_COVE                                                          = 3
  11267 	PAN_SERIF_OBTUSE_SANS                                                          = 12
  11268 	PAN_SERIF_OBTUSE_SQUARE_COVE                                                   = 5
  11269 	PAN_SERIF_PERP_SANS                                                            = 13
  11270 	PAN_SERIF_ROUNDED                                                              = 15
  11271 	PAN_SERIF_SQUARE                                                               = 6
  11272 	PAN_SERIF_SQUARE_COVE                                                          = 4
  11273 	PAN_SERIF_THIN                                                                 = 7
  11274 	PAN_SERIF_TRIANGLE                                                             = 10
  11275 	PAN_STRAIGHT_ARMS_DOUBLE_SERIF                                                 = 6
  11276 	PAN_STRAIGHT_ARMS_HORZ                                                         = 2
  11277 	PAN_STRAIGHT_ARMS_SINGLE_SERIF                                                 = 5
  11278 	PAN_STRAIGHT_ARMS_VERT                                                         = 4
  11279 	PAN_STRAIGHT_ARMS_WEDGE                                                        = 3
  11280 	PAN_STROKEVARIATION_INDEX                                                      = 5
  11281 	PAN_STROKE_GRADUAL_DIAG                                                        = 2
  11282 	PAN_STROKE_GRADUAL_HORZ                                                        = 5
  11283 	PAN_STROKE_GRADUAL_TRAN                                                        = 3
  11284 	PAN_STROKE_GRADUAL_VERT                                                        = 4
  11285 	PAN_STROKE_INSTANT_VERT                                                        = 8
  11286 	PAN_STROKE_RAPID_HORZ                                                          = 7
  11287 	PAN_STROKE_RAPID_VERT                                                          = 6
  11288 	PAN_WEIGHT_BLACK                                                               = 10
  11289 	PAN_WEIGHT_BOLD                                                                = 8
  11290 	PAN_WEIGHT_BOOK                                                                = 5
  11291 	PAN_WEIGHT_DEMI                                                                = 7
  11292 	PAN_WEIGHT_HEAVY                                                               = 9
  11293 	PAN_WEIGHT_INDEX                                                               = 2
  11294 	PAN_WEIGHT_LIGHT                                                               = 3
  11295 	PAN_WEIGHT_MEDIUM                                                              = 6
  11296 	PAN_WEIGHT_NORD                                                                = 11
  11297 	PAN_WEIGHT_THIN                                                                = 4
  11298 	PAN_WEIGHT_VERY_LIGHT                                                          = 2
  11299 	PAN_XHEIGHT_CONSTANT_LARGE                                                     = 4
  11300 	PAN_XHEIGHT_CONSTANT_SMALL                                                     = 2
  11301 	PAN_XHEIGHT_CONSTANT_STD                                                       = 3
  11302 	PAN_XHEIGHT_DUCKING_LARGE                                                      = 7
  11303 	PAN_XHEIGHT_DUCKING_SMALL                                                      = 5
  11304 	PAN_XHEIGHT_DUCKING_STD                                                        = 6
  11305 	PAN_XHEIGHT_INDEX                                                              = 9
  11306 	PARAMFLAG_FHASCUSTDATA                                                         = 64
  11307 	PARAMFLAG_FHASDEFAULT                                                          = 32
  11308 	PARAMFLAG_FIN                                                                  = 1
  11309 	PARAMFLAG_FLCID                                                                = 4
  11310 	PARAMFLAG_FOPT                                                                 = 16
  11311 	PARAMFLAG_FOUT                                                                 = 2
  11312 	PARAMFLAG_FRETVAL                                                              = 8
  11313 	PARAMFLAG_NONE                                                                 = 0
  11314 	PARSE_MODE_DECLARE_VTAB                                                        = 1
  11315 	PARSE_MODE_NORMAL                                                              = 0
  11316 	PARSE_MODE_RENAME                                                              = 2
  11317 	PARSE_MODE_UNMAP                                                               = 3
  11318 	PARTITION_ENTRY_UNUSED                                                         = 0x00
  11319 	PARTITION_EXTENDED                                                             = 0x05
  11320 	PARTITION_FAT32                                                                = 0x0B
  11321 	PARTITION_FAT32_XINT13                                                         = 0x0C
  11322 	PARTITION_FAT_12                                                               = 0x01
  11323 	PARTITION_FAT_16                                                               = 0x04
  11324 	PARTITION_HUGE                                                                 = 0x06
  11325 	PARTITION_IFS                                                                  = 0x07
  11326 	PARTITION_LDM                                                                  = 0x42
  11327 	PARTITION_NTFT                                                                 = 0x80
  11328 	PARTITION_OS2BOOTMGR                                                           = 0x0A
  11329 	PARTITION_PREP                                                                 = 0x41
  11330 	PARTITION_UNIX                                                                 = 0x63
  11331 	PARTITION_XENIX_1                                                              = 0x02
  11332 	PARTITION_XENIX_2                                                              = 0x03
  11333 	PARTITION_XINT13                                                               = 0x0E
  11334 	PARTITION_XINT13_EXTENDED                                                      = 0x0F
  11335 	PARTLY_WITHIN                                                                  = 1
  11336 	PASCAL                                                                         = 0
  11337 	PASSTHROUGH                                                                    = 19
  11338 	PATH_MAX                                                                       = 260
  11339 	PBTF_APMRESUMEFROMFAILURE                                                      = 0x00000001
  11340 	PBT_APMBATTERYLOW                                                              = 0x0009
  11341 	PBT_APMOEMEVENT                                                                = 0x000B
  11342 	PBT_APMPOWERSTATUSCHANGE                                                       = 0x000A
  11343 	PBT_APMQUERYSTANDBY                                                            = 0x0001
  11344 	PBT_APMQUERYSTANDBYFAILED                                                      = 0x0003
  11345 	PBT_APMQUERYSUSPEND                                                            = 0x0000
  11346 	PBT_APMQUERYSUSPENDFAILED                                                      = 0x0002
  11347 	PBT_APMRESUMEAUTOMATIC                                                         = 0x0012
  11348 	PBT_APMRESUMECRITICAL                                                          = 0x0006
  11349 	PBT_APMRESUMESTANDBY                                                           = 0x0008
  11350 	PBT_APMRESUMESUSPEND                                                           = 0x0007
  11351 	PBT_APMSTANDBY                                                                 = 0x0005
  11352 	PBT_APMSUSPEND                                                                 = 0x0004
  11353 	PBT_POWERSETTINGCHANGE                                                         = 32787
  11354 	PCACHE1_MIGHT_USE_GROUP_MUTEX                                                  = 1
  11355 	PCACHE_DIRTYLIST_ADD                                                           = 2
  11356 	PCACHE_DIRTYLIST_FRONT                                                         = 3
  11357 	PCACHE_DIRTYLIST_REMOVE                                                        = 1
  11358 	PCLEANUI                                                                       = 2214592512
  11359 	PC_EXPLICIT                                                                    = 0x02
  11360 	PC_INTERIORS                                                                   = 128
  11361 	PC_NOCOLLAPSE                                                                  = 0x04
  11362 	PC_NONE                                                                        = 0
  11363 	PC_PATHS                                                                       = 512
  11364 	PC_POLYGON                                                                     = 1
  11365 	PC_POLYPOLYGON                                                                 = 256
  11366 	PC_RECTANGLE                                                                   = 2
  11367 	PC_RESERVED                                                                    = 0x01
  11368 	PC_SCANLINE                                                                    = 8
  11369 	PC_STYLED                                                                      = 32
  11370 	PC_TRAPEZOID                                                                   = 4
  11371 	PC_WIDE                                                                        = 16
  11372 	PC_WIDESTYLED                                                                  = 64
  11373 	PC_WINDPOLYGON                                                                 = 4
  11374 	PDCAP_D0_SUPPORTED                                                             = 0x00000001
  11375 	PDCAP_D1_SUPPORTED                                                             = 0x00000002
  11376 	PDCAP_D2_SUPPORTED                                                             = 0x00000004
  11377 	PDCAP_D3_SUPPORTED                                                             = 0x00000008
  11378 	PDCAP_WAKE_FROM_D0_SUPPORTED                                                   = 0x00000010
  11379 	PDCAP_WAKE_FROM_D1_SUPPORTED                                                   = 0x00000020
  11380 	PDCAP_WAKE_FROM_D2_SUPPORTED                                                   = 0x00000040
  11381 	PDCAP_WAKE_FROM_D3_SUPPORTED                                                   = 0x00000080
  11382 	PDCAP_WARM_EJECT_SUPPORTED                                                     = 0x00000100
  11383 	PDERR_CREATEICFAILURE                                                          = 0x100A
  11384 	PDERR_DEFAULTDIFFERENT                                                         = 0x100C
  11385 	PDERR_DNDMMISMATCH                                                             = 0x1009
  11386 	PDERR_GETDEVMODEFAIL                                                           = 0x1005
  11387 	PDERR_INITFAILURE                                                              = 0x1006
  11388 	PDERR_LOADDRVFAILURE                                                           = 0x1004
  11389 	PDERR_NODEFAULTPRN                                                             = 0x1008
  11390 	PDERR_NODEVICES                                                                = 0x1007
  11391 	PDERR_PARSEFAILURE                                                             = 0x1002
  11392 	PDERR_PRINTERCODES                                                             = 0x1000
  11393 	PDERR_PRINTERNOTFOUND                                                          = 0x100B
  11394 	PDERR_RETDEFFAILURE                                                            = 0x1003
  11395 	PDERR_SETUPFAILURE                                                             = 0x1001
  11396 	PDEVICESIZE                                                                    = 26
  11397 	PDIRTYUI                                                                       = 2281701376
  11398 	PD_ALLPAGES                                                                    = 0x0
  11399 	PD_COLLATE                                                                     = 0x10
  11400 	PD_CURRENTPAGE                                                                 = 0x400000
  11401 	PD_DISABLEPRINTTOFILE                                                          = 0x80000
  11402 	PD_ENABLEPRINTHOOK                                                             = 0x1000
  11403 	PD_ENABLEPRINTTEMPLATE                                                         = 0x4000
  11404 	PD_ENABLEPRINTTEMPLATEHANDLE                                                   = 0x10000
  11405 	PD_ENABLESETUPHOOK                                                             = 0x2000
  11406 	PD_ENABLESETUPTEMPLATE                                                         = 0x8000
  11407 	PD_ENABLESETUPTEMPLATEHANDLE                                                   = 0x20000
  11408 	PD_EXCLUSIONFLAGS                                                              = 0x1000000
  11409 	PD_EXCL_COPIESANDCOLLATE                                                       = 33024
  11410 	PD_HIDEPRINTTOFILE                                                             = 0x100000
  11411 	PD_NOCURRENTPAGE                                                               = 0x800000
  11412 	PD_NONETWORKBUTTON                                                             = 0x200000
  11413 	PD_NOPAGENUMS                                                                  = 0x8
  11414 	PD_NOSELECTION                                                                 = 0x4
  11415 	PD_NOWARNING                                                                   = 0x80
  11416 	PD_PAGENUMS                                                                    = 0x2
  11417 	PD_PRINTSETUP                                                                  = 0x40
  11418 	PD_PRINTTOFILE                                                                 = 0x20
  11419 	PD_RESULT_APPLY                                                                = 2
  11420 	PD_RESULT_CANCEL                                                               = 0
  11421 	PD_RESULT_PRINT                                                                = 1
  11422 	PD_RETURNDC                                                                    = 0x100
  11423 	PD_RETURNDEFAULT                                                               = 0x400
  11424 	PD_RETURNIC                                                                    = 0x200
  11425 	PD_SELECTION                                                                   = 0x1
  11426 	PD_SHOWHELP                                                                    = 0x800
  11427 	PD_USEDEVMODECOPIES                                                            = 0x40000
  11428 	PD_USEDEVMODECOPIESANDCOLLATE                                                  = 0x40000
  11429 	PD_USELARGETEMPLATE                                                            = 0x10000000
  11430 	PENDING_LOCK                                                                   = 3
  11431 	PERFORMANCE_DATA_VERSION                                                       = 1
  11432 	PERFSTATE_POLICY_CHANGE_IDEAL                                                  = 0
  11433 	PERFSTATE_POLICY_CHANGE_MAX                                                    = 2
  11434 	PERFSTATE_POLICY_CHANGE_ROCKET                                                 = 2
  11435 	PERFSTATE_POLICY_CHANGE_SINGLE                                                 = 1
  11436 	PERF_100NSEC_MULTI_TIMER                                                       = 575735040
  11437 	PERF_100NSEC_MULTI_TIMER_INV                                                   = 592512256
  11438 	PERF_100NSEC_TIMER                                                             = 542180608
  11439 	PERF_100NSEC_TIMER_INV                                                         = 558957824
  11440 	PERF_AVERAGE_BASE                                                              = 1073939458
  11441 	PERF_AVERAGE_BULK                                                              = 1073874176
  11442 	PERF_AVERAGE_TIMER                                                             = 805438464
  11443 	PERF_COUNTER_100NS_QUEUELEN_TYPE                                               = 5571840
  11444 	PERF_COUNTER_BASE                                                              = 0x00030000
  11445 	PERF_COUNTER_BULK_COUNT                                                        = 272696576
  11446 	PERF_COUNTER_COUNTER                                                           = 272696320
  11447 	PERF_COUNTER_DELTA                                                             = 4195328
  11448 	PERF_COUNTER_ELAPSED                                                           = 0x00040000
  11449 	PERF_COUNTER_FRACTION                                                          = 0x00020000
  11450 	PERF_COUNTER_HISTOGRAM                                                         = 0x00060000
  11451 	PERF_COUNTER_HISTOGRAM_TYPE                                                    = 0x80000000
  11452 	PERF_COUNTER_LARGE_DELTA                                                       = 4195584
  11453 	PERF_COUNTER_LARGE_QUEUELEN_TYPE                                               = 4523264
  11454 	PERF_COUNTER_LARGE_RAWCOUNT                                                    = 65792
  11455 	PERF_COUNTER_LARGE_RAWCOUNT_HEX                                                = 256
  11456 	PERF_COUNTER_MULTI_BASE                                                        = 1107494144
  11457 	PERF_COUNTER_MULTI_TIMER                                                       = 574686464
  11458 	PERF_COUNTER_MULTI_TIMER_INV                                                   = 591463680
  11459 	PERF_COUNTER_NODATA                                                            = 1073742336
  11460 	PERF_COUNTER_OBJ_TIME_QUEUELEN_TYPE                                            = 6620416
  11461 	PERF_COUNTER_PRECISION                                                         = 0x00070000
  11462 	PERF_COUNTER_QUEUELEN                                                          = 0x00050000
  11463 	PERF_COUNTER_QUEUELEN_TYPE                                                     = 4523008
  11464 	PERF_COUNTER_RATE                                                              = 0x00010000
  11465 	PERF_COUNTER_RAWCOUNT                                                          = 65536
  11466 	PERF_COUNTER_RAWCOUNT_HEX                                                      = 0
  11467 	PERF_COUNTER_TEXT                                                              = 2816
  11468 	PERF_COUNTER_TIMER                                                             = 541132032
  11469 	PERF_COUNTER_TIMER_INV                                                         = 557909248
  11470 	PERF_COUNTER_VALUE                                                             = 0x00000000
  11471 	PERF_DATA_REVISION                                                             = 1
  11472 	PERF_DATA_VERSION                                                              = 1
  11473 	PERF_DELTA_BASE                                                                = 0x00800000
  11474 	PERF_DELTA_COUNTER                                                             = 0x00400000
  11475 	PERF_DETAIL_ADVANCED                                                           = 200
  11476 	PERF_DETAIL_EXPERT                                                             = 300
  11477 	PERF_DETAIL_NOVICE                                                             = 100
  11478 	PERF_DETAIL_WIZARD                                                             = 400
  11479 	PERF_DISPLAY_NOSHOW                                                            = 0x40000000
  11480 	PERF_DISPLAY_NO_SUFFIX                                                         = 0x00000000
  11481 	PERF_DISPLAY_PERCENT                                                           = 0x20000000
  11482 	PERF_DISPLAY_PER_SEC                                                           = 0x10000000
  11483 	PERF_DISPLAY_SECONDS                                                           = 0x30000000
  11484 	PERF_ELAPSED_TIME                                                              = 807666944
  11485 	PERF_INVERSE_COUNTER                                                           = 0x01000000
  11486 	PERF_LARGE_RAW_BASE                                                            = 1073939712
  11487 	PERF_LARGE_RAW_FRACTION                                                        = 537003264
  11488 	PERF_MULTI_COUNTER                                                             = 0x02000000
  11489 	PERF_NO_INSTANCES                                                              = -1
  11490 	PERF_NO_UNIQUE_ID                                                              = -1
  11491 	PERF_NUMBER_DECIMAL                                                            = 0x00010000
  11492 	PERF_NUMBER_DEC_1000                                                           = 0x00020000
  11493 	PERF_NUMBER_HEX                                                                = 0x00000000
  11494 	PERF_OBJECT_TIMER                                                              = 0x00200000
  11495 	PERF_OBJ_TIME_TIMER                                                            = 543229184
  11496 	PERF_PRECISION_100NS_TIMER                                                     = 542573824
  11497 	PERF_PRECISION_OBJECT_TIMER                                                    = 543622400
  11498 	PERF_PRECISION_SYSTEM_TIMER                                                    = 541525248
  11499 	PERF_PRECISION_TIMESTAMP                                                       = 1073939712
  11500 	PERF_RAW_BASE                                                                  = 1073939459
  11501 	PERF_RAW_FRACTION                                                              = 537003008
  11502 	PERF_SAMPLE_BASE                                                               = 1073939457
  11503 	PERF_SAMPLE_COUNTER                                                            = 4260864
  11504 	PERF_SAMPLE_FRACTION                                                           = 549585920
  11505 	PERF_SIZE_DWORD                                                                = 0x00000000
  11506 	PERF_SIZE_LARGE                                                                = 0x00000100
  11507 	PERF_SIZE_VARIABLE_LEN                                                         = 0x00000300
  11508 	PERF_SIZE_ZERO                                                                 = 0x00000200
  11509 	PERF_TEXT_ASCII                                                                = 0x00010000
  11510 	PERF_TEXT_UNICODE                                                              = 0x00000000
  11511 	PERF_TIMER_100NS                                                               = 0x00100000
  11512 	PERF_TIMER_TICK                                                                = 0x00000000
  11513 	PERF_TYPE_COUNTER                                                              = 0x00000400
  11514 	PERF_TYPE_NUMBER                                                               = 0x00000000
  11515 	PERF_TYPE_TEXT                                                                 = 0x00000800
  11516 	PERF_TYPE_ZERO                                                                 = 0x00000C00
  11517 	PFD_DEPTH_DONTCARE                                                             = 0x20000000
  11518 	PFD_DIRECT3D_ACCELERATED                                                       = 0x00004000
  11519 	PFD_DOUBLEBUFFER                                                               = 0x00000001
  11520 	PFD_DOUBLEBUFFER_DONTCARE                                                      = 0x40000000
  11521 	PFD_DRAW_TO_BITMAP                                                             = 0x00000008
  11522 	PFD_DRAW_TO_WINDOW                                                             = 0x00000004
  11523 	PFD_GENERIC_ACCELERATED                                                        = 0x00001000
  11524 	PFD_GENERIC_FORMAT                                                             = 0x00000040
  11525 	PFD_MAIN_PLANE                                                                 = 0
  11526 	PFD_NEED_PALETTE                                                               = 0x00000080
  11527 	PFD_NEED_SYSTEM_PALETTE                                                        = 0x00000100
  11528 	PFD_OVERLAY_PLANE                                                              = 1
  11529 	PFD_STEREO                                                                     = 0x00000002
  11530 	PFD_STEREO_DONTCARE                                                            = 0x80000000
  11531 	PFD_SUPPORT_COMPOSITION                                                        = 0x00008000
  11532 	PFD_SUPPORT_DIRECTDRAW                                                         = 0x00002000
  11533 	PFD_SUPPORT_GDI                                                                = 0x00000010
  11534 	PFD_SUPPORT_OPENGL                                                             = 0x00000020
  11535 	PFD_SWAP_COPY                                                                  = 0x00000400
  11536 	PFD_SWAP_EXCHANGE                                                              = 0x00000200
  11537 	PFD_SWAP_LAYER_BUFFERS                                                         = 0x00000800
  11538 	PFD_TYPE_COLORINDEX                                                            = 1
  11539 	PFD_TYPE_RGBA                                                                  = 0
  11540 	PFD_UNDERLAY_PLANE                                                             = -1
  11541 	PF_3DNOW_INSTRUCTIONS_AVAILABLE                                                = 7
  11542 	PF_ALPHA_BYTE_INSTRUCTIONS                                                     = 5
  11543 	PF_APPLETALK                                                                   = 16
  11544 	PF_ARM_64BIT_LOADSTORE_ATOMIC                                                  = 25
  11545 	PF_ARM_DIVIDE_INSTRUCTION_AVAILABLE                                            = 24
  11546 	PF_ARM_EXTERNAL_CACHE_AVAILABLE                                                = 26
  11547 	PF_ARM_FMAC_INSTRUCTIONS_AVAILABLE                                             = 27
  11548 	PF_ARM_NEON_INSTRUCTIONS_AVAILABLE                                             = 19
  11549 	PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE                                         = 31
  11550 	PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE                                        = 30
  11551 	PF_ARM_V8_INSTRUCTIONS_AVAILABLE                                               = 29
  11552 	PF_ARM_VFP_32_REGISTERS_AVAILABLE                                              = 18
  11553 	PF_BAN                                                                         = 21
  11554 	PF_CCITT                                                                       = 10
  11555 	PF_CHANNELS_ENABLED                                                            = 16
  11556 	PF_CHAOS                                                                       = 5
  11557 	PF_COMPARE64_EXCHANGE128                                                       = 15
  11558 	PF_COMPARE_EXCHANGE128                                                         = 14
  11559 	PF_COMPARE_EXCHANGE_DOUBLE                                                     = 2
  11560 	PF_DATAKIT                                                                     = 9
  11561 	PF_DECnet                                                                      = 12
  11562 	PF_DLI                                                                         = 13
  11563 	PF_ECMA                                                                        = 8
  11564 	PF_FASTFAIL_AVAILABLE                                                          = 23
  11565 	PF_FIREFOX                                                                     = 19
  11566 	PF_FLOATING_POINT_EMULATED                                                     = 1
  11567 	PF_FLOATING_POINT_PRECISION_ERRATA                                             = 0
  11568 	PF_HYLINK                                                                      = 15
  11569 	PF_IMPLINK                                                                     = 3
  11570 	PF_INET                                                                        = 2
  11571 	PF_IPX                                                                         = 6
  11572 	PF_ISO                                                                         = 7
  11573 	PF_LAT                                                                         = 14
  11574 	PF_MAX                                                                         = 22
  11575 	PF_MMX_INSTRUCTIONS_AVAILABLE                                                  = 3
  11576 	PF_NS                                                                          = 6
  11577 	PF_NX_ENABLED                                                                  = 12
  11578 	PF_OSI                                                                         = 7
  11579 	PF_PAE_ENABLED                                                                 = 9
  11580 	PF_PPC_MOVEMEM_64BIT_OK                                                        = 4
  11581 	PF_PUP                                                                         = 4
  11582 	PF_RDPID_INSTRUCTION_AVAILABLE                                                 = 33
  11583 	PF_RDRAND_INSTRUCTION_AVAILABLE                                                = 28
  11584 	PF_RDTSCP_INSTRUCTION_AVAILABLE                                                = 32
  11585 	PF_RDTSC_INSTRUCTION_AVAILABLE                                                 = 8
  11586 	PF_RDWRFSGSBASE_AVAILABLE                                                      = 22
  11587 	PF_SECOND_LEVEL_ADDRESS_TRANSLATION                                            = 20
  11588 	PF_SNA                                                                         = 11
  11589 	PF_SSE3_INSTRUCTIONS_AVAILABLE                                                 = 13
  11590 	PF_SSE_DAZ_MODE_AVAILABLE                                                      = 11
  11591 	PF_UNIX                                                                        = 1
  11592 	PF_UNKNOWN1                                                                    = 20
  11593 	PF_UNSPEC                                                                      = 0
  11594 	PF_VIRT_FIRMWARE_ENABLED                                                       = 21
  11595 	PF_VOICEVIEW                                                                   = 18
  11596 	PF_XMMI64_INSTRUCTIONS_AVAILABLE                                               = 10
  11597 	PF_XMMI_INSTRUCTIONS_AVAILABLE                                                 = 6
  11598 	PF_XSAVE_ENABLED                                                               = 17
  11599 	PGHDR_CLEAN                                                                    = 0x001
  11600 	PGHDR_DIRTY                                                                    = 0x002
  11601 	PGHDR_DONT_WRITE                                                               = 0x010
  11602 	PGHDR_MMAP                                                                     = 0x020
  11603 	PGHDR_NEED_SYNC                                                                = 0x008
  11604 	PGHDR_WAL_APPEND                                                               = 0x040
  11605 	PGHDR_WRITEABLE                                                                = 0x004
  11606 	PHYSICALHEIGHT                                                                 = 111
  11607 	PHYSICALOFFSETX                                                                = 112
  11608 	PHYSICALOFFSETY                                                                = 113
  11609 	PHYSICALWIDTH                                                                  = 110
  11610 	PIDDI_THUMBNAIL                                                                = 2
  11611 	PIDDSI_BYTECOUNT                                                               = 0x00000004
  11612 	PIDDSI_CATEGORY                                                                = 0x00000002
  11613 	PIDDSI_COMPANY                                                                 = 0x0000000F
  11614 	PIDDSI_DOCPARTS                                                                = 0x0000000D
  11615 	PIDDSI_HEADINGPAIR                                                             = 0x0000000C
  11616 	PIDDSI_HIDDENCOUNT                                                             = 0x00000009
  11617 	PIDDSI_LINECOUNT                                                               = 0x00000005
  11618 	PIDDSI_LINKSDIRTY                                                              = 0x00000010
  11619 	PIDDSI_MANAGER                                                                 = 0x0000000E
  11620 	PIDDSI_MMCLIPCOUNT                                                             = 0x0000000A
  11621 	PIDDSI_NOTECOUNT                                                               = 0x00000008
  11622 	PIDDSI_PARCOUNT                                                                = 0x00000006
  11623 	PIDDSI_PRESFORMAT                                                              = 0x00000003
  11624 	PIDDSI_SCALE                                                                   = 0x0000000B
  11625 	PIDDSI_SLIDECOUNT                                                              = 0x00000007
  11626 	PIDMSI_COPYRIGHT                                                               = 11
  11627 	PIDMSI_EDITOR                                                                  = 2
  11628 	PIDMSI_OWNER                                                                   = 8
  11629 	PIDMSI_PRODUCTION                                                              = 10
  11630 	PIDMSI_PROJECT                                                                 = 6
  11631 	PIDMSI_RATING                                                                  = 9
  11632 	PIDMSI_SEQUENCE_NO                                                             = 5
  11633 	PIDMSI_SOURCE                                                                  = 4
  11634 	PIDMSI_STATUS                                                                  = 7
  11635 	PIDMSI_SUPPLIER                                                                = 3
  11636 	PIDSI_APPNAME                                                                  = 18
  11637 	PIDSI_AUTHOR                                                                   = 4
  11638 	PIDSI_CHARCOUNT                                                                = 16
  11639 	PIDSI_COMMENTS                                                                 = 6
  11640 	PIDSI_CREATE_DTM                                                               = 12
  11641 	PIDSI_DOC_SECURITY                                                             = 19
  11642 	PIDSI_EDITTIME                                                                 = 10
  11643 	PIDSI_KEYWORDS                                                                 = 5
  11644 	PIDSI_LASTAUTHOR                                                               = 8
  11645 	PIDSI_LASTPRINTED                                                              = 11
  11646 	PIDSI_LASTSAVE_DTM                                                             = 13
  11647 	PIDSI_PAGECOUNT                                                                = 14
  11648 	PIDSI_REVNUMBER                                                                = 9
  11649 	PIDSI_SUBJECT                                                                  = 3
  11650 	PIDSI_TEMPLATE                                                                 = 7
  11651 	PIDSI_THUMBNAIL                                                                = 17
  11652 	PIDSI_TITLE                                                                    = 2
  11653 	PIDSI_WORDCOUNT                                                                = 15
  11654 	PID_BEHAVIOR                                                                   = 2147483651
  11655 	PID_CODEPAGE                                                                   = 1
  11656 	PID_DICTIONARY                                                                 = 0
  11657 	PID_FIRST_NAME_DEFAULT                                                         = 4095
  11658 	PID_FIRST_USABLE                                                               = 2
  11659 	PID_ILLEGAL                                                                    = 4294967295
  11660 	PID_LOCALE                                                                     = 2147483648
  11661 	PID_MAX_READONLY                                                               = 3221225471
  11662 	PID_MIN_READONLY                                                               = 2147483648
  11663 	PID_MODIFY_TIME                                                                = 2147483649
  11664 	PID_SECURITY                                                                   = 2147483650
  11665 	PIPE_ACCEPT_REMOTE_CLIENTS                                                     = 0x0
  11666 	PIPE_ACCESS_DUPLEX                                                             = 0x3
  11667 	PIPE_ACCESS_INBOUND                                                            = 0x1
  11668 	PIPE_ACCESS_OUTBOUND                                                           = 0x2
  11669 	PIPE_CLIENT_END                                                                = 0x0
  11670 	PIPE_NOWAIT                                                                    = 0x1
  11671 	PIPE_READMODE_BYTE                                                             = 0x0
  11672 	PIPE_READMODE_MESSAGE                                                          = 0x2
  11673 	PIPE_REJECT_REMOTE_CLIENTS                                                     = 0x8
  11674 	PIPE_SERVER_END                                                                = 0x1
  11675 	PIPE_TYPE_BYTE                                                                 = 0x0
  11676 	PIPE_TYPE_MESSAGE                                                              = 0x4
  11677 	PIPE_UNLIMITED_INSTANCES                                                       = 255
  11678 	PIPE_WAIT                                                                      = 0x0
  11679 	PKCS12_ALLOW_OVERWRITE_KEY                                                     = 0x4000
  11680 	PKCS12_ALWAYS_CNG_KSP                                                          = 0x200
  11681 	PKCS12_DISABLE_ENCRYPT_CERTIFICATES                                            = 0x0100
  11682 	PKCS12_ENCRYPT_CERTIFICATES                                                    = 0x0200
  11683 	PKCS12_EXPORT_ECC_CURVE_OID                                                    = 0x2000
  11684 	PKCS12_EXPORT_ECC_CURVE_PARAMETERS                                             = 0x1000
  11685 	PKCS12_EXPORT_PBES2_PARAMS                                                     = 0x0080
  11686 	PKCS12_EXPORT_RESERVED_MASK                                                    = 0xffff0000
  11687 	PKCS12_EXPORT_SILENT                                                           = 0x40
  11688 	PKCS12_IMPORT_RESERVED_MASK                                                    = 0xffff0000
  11689 	PKCS12_IMPORT_SILENT                                                           = 0x40
  11690 	PKCS12_INCLUDE_EXTENDED_PROPERTIES                                             = 0x10
  11691 	PKCS12_NO_PERSIST_KEY                                                          = 0x8000
  11692 	PKCS12_OBJECT_LOCATOR_ALL_IMPORT_FLAGS                                         = 33360
  11693 	PKCS12_ONLY_CERTIFICATES                                                       = 0x00000400
  11694 	PKCS12_ONLY_CERTIFICATES_PROVIDER_TYPE                                         = 0
  11695 	PKCS12_ONLY_NOT_ENCRYPTED_CERTIFICATES                                         = 0x00000800
  11696 	PKCS12_PBKDF2_ID_HMAC_SHA1                                                     = "1.2.840.113549.2.7"
  11697 	PKCS12_PBKDF2_ID_HMAC_SHA256                                                   = "1.2.840.113549.2.9"
  11698 	PKCS12_PBKDF2_ID_HMAC_SHA384                                                   = "1.2.840.113549.2.10"
  11699 	PKCS12_PBKDF2_ID_HMAC_SHA512                                                   = "1.2.840.113549.2.11"
  11700 	PKCS12_PREFER_CNG_KSP                                                          = 0x100
  11701 	PKCS12_PROTECT_TO_DOMAIN_SIDS                                                  = 0x20
  11702 	PKCS12_VIRTUAL_ISOLATION_KEY                                                   = 0x00010000
  11703 	PKCS5_PADDING                                                                  = 1
  11704 	PKCS_7_ASN_ENCODING                                                            = 0x10000
  11705 	PKCS_7_NDR_ENCODING                                                            = 0x20000
  11706 	PKCS_RSA_SSA_PSS_TRAILER_FIELD_BC                                              = 1
  11707 	PLAINTEXTKEYBLOB                                                               = 0x8
  11708 	PLANES                                                                         = 14
  11709 	PLOSS                                                                          = 6
  11710 	PMB_ACTIVE                                                                     = 0x00000001
  11711 	PM_NOREMOVE                                                                    = 0x0000
  11712 	PM_NOYIELD                                                                     = 0x0002
  11713 	PM_QS_INPUT                                                                    = 67567616
  11714 	PM_QS_PAINT                                                                    = 2097152
  11715 	PM_QS_POSTMESSAGE                                                              = 9961472
  11716 	PM_QS_SENDMESSAGE                                                              = 4194304
  11717 	PM_REMOVE                                                                      = 0x0001
  11718 	POINTER_32                                                                     = 0
  11719 	POINTER_64                                                                     = 0
  11720 	POINTER_SIGNED                                                                 = 0
  11721 	POINTER_UNSIGNED                                                               = 0
  11722 	POLICY_AUDIT_SUBCATEGORY_COUNT                                                 = 56
  11723 	POLICY_SHOWREASONUI_ALWAYS                                                     = 1
  11724 	POLICY_SHOWREASONUI_NEVER                                                      = 0
  11725 	POLICY_SHOWREASONUI_SERVERONLY                                                 = 3
  11726 	POLICY_SHOWREASONUI_WORKSTATIONONLY                                            = 2
  11727 	POLYFILL_LAST                                                                  = 2
  11728 	POLYGONALCAPS                                                                  = 32
  11729 	PORT_STATUS_DOOR_OPEN                                                          = 7
  11730 	PORT_STATUS_NO_TONER                                                           = 6
  11731 	PORT_STATUS_OFFLINE                                                            = 1
  11732 	PORT_STATUS_OUTPUT_BIN_FULL                                                    = 4
  11733 	PORT_STATUS_OUT_OF_MEMORY                                                      = 9
  11734 	PORT_STATUS_PAPER_JAM                                                          = 2
  11735 	PORT_STATUS_PAPER_OUT                                                          = 3
  11736 	PORT_STATUS_PAPER_PROBLEM                                                      = 5
  11737 	PORT_STATUS_POWER_SAVE                                                         = 12
  11738 	PORT_STATUS_TONER_LOW                                                          = 10
  11739 	PORT_STATUS_TYPE_ERROR                                                         = 1
  11740 	PORT_STATUS_TYPE_INFO                                                          = 3
  11741 	PORT_STATUS_TYPE_WARNING                                                       = 2
  11742 	PORT_STATUS_USER_INTERVENTION                                                  = 8
  11743 	PORT_STATUS_WARMING_UP                                                         = 11
  11744 	PORT_TYPE_NET_ATTACHED                                                         = 0x0008
  11745 	PORT_TYPE_READ                                                                 = 0x0002
  11746 	PORT_TYPE_REDIRECTED                                                           = 0x0004
  11747 	PORT_TYPE_WRITE                                                                = 0x0001
  11748 	POSTSCRIPT_DATA                                                                = 37
  11749 	POSTSCRIPT_IDENTIFY                                                            = 4117
  11750 	POSTSCRIPT_IGNORE                                                              = 38
  11751 	POSTSCRIPT_INJECTION                                                           = 4118
  11752 	POSTSCRIPT_PASSTHROUGH                                                         = 4115
  11753 	POWERBUTTON_ACTION_INDEX_HIBERNATE                                             = 2
  11754 	POWERBUTTON_ACTION_INDEX_NOTHING                                               = 0
  11755 	POWERBUTTON_ACTION_INDEX_SHUTDOWN                                              = 3
  11756 	POWERBUTTON_ACTION_INDEX_SLEEP                                                 = 1
  11757 	POWERBUTTON_ACTION_VALUE_HIBERNATE                                             = 3
  11758 	POWERBUTTON_ACTION_VALUE_NOTHING                                               = 0
  11759 	POWERBUTTON_ACTION_VALUE_SHUTDOWN                                              = 6
  11760 	POWERBUTTON_ACTION_VALUE_SLEEP                                                 = 2
  11761 	POWER_ACTION_CRITICAL                                                          = 0x80000000
  11762 	POWER_ACTION_DISABLE_WAKES                                                     = 0x40000000
  11763 	POWER_ACTION_HIBERBOOT                                                         = 0x00000008
  11764 	POWER_ACTION_LIGHTEST_FIRST                                                    = 0x10000000
  11765 	POWER_ACTION_LOCK_CONSOLE                                                      = 0x20000000
  11766 	POWER_ACTION_OVERRIDE_APPS                                                     = 0x00000004
  11767 	POWER_ACTION_PSEUDO_TRANSITION                                                 = 0x08000000
  11768 	POWER_ACTION_QUERY_ALLOWED                                                     = 0x00000001
  11769 	POWER_ACTION_UI_ALLOWED                                                        = 0x00000002
  11770 	POWER_DEVICE_IDLE_POLICY_CONSERVATIVE                                          = 1
  11771 	POWER_DEVICE_IDLE_POLICY_PERFORMANCE                                           = 0
  11772 	POWER_FORCE_TRIGGER_RESET                                                      = 0x80000000
  11773 	POWER_LEVEL_USER_NOTIFY_EXEC                                                   = 0x00000004
  11774 	POWER_LEVEL_USER_NOTIFY_SOUND                                                  = 0x00000002
  11775 	POWER_LEVEL_USER_NOTIFY_TEXT                                                   = 0x00000001
  11776 	POWER_PLATFORM_ROLE_V1                                                         = 1
  11777 	POWER_PLATFORM_ROLE_V2                                                         = 2
  11778 	POWER_PLATFORM_ROLE_VERSION                                                    = 1
  11779 	POWER_REQUEST_CONTEXT_DETAILED_STRING                                          = 0x00000002
  11780 	POWER_REQUEST_CONTEXT_SIMPLE_STRING                                            = 0x00000001
  11781 	POWER_REQUEST_CONTEXT_VERSION                                                  = 0
  11782 	POWER_SETTING_VALUE_VERSION                                                    = 1
  11783 	POWER_SYSTEM_MAXIMUM                                                           = 7
  11784 	POWER_USER_NOTIFY_BUTTON                                                       = 0x00000008
  11785 	POWER_USER_NOTIFY_FORCED_SHUTDOWN                                              = 0x00000020
  11786 	POWER_USER_NOTIFY_SHUTDOWN                                                     = 0x00000010
  11787 	PO_DELETE                                                                      = 0x0013
  11788 	PO_PORTCHANGE                                                                  = 0x0020
  11789 	PO_RENAME                                                                      = 0x0014
  11790 	PO_REN_PORT                                                                    = 0x0034
  11791 	PO_THROTTLE_ADAPTIVE                                                           = 3
  11792 	PO_THROTTLE_CONSTANT                                                           = 1
  11793 	PO_THROTTLE_DEGRADE                                                            = 2
  11794 	PO_THROTTLE_MAXIMUM                                                            = 4
  11795 	PO_THROTTLE_NONE                                                               = 0
  11796 	PPM_FIRMWARE_ACPI1C2                                                           = 0x1
  11797 	PPM_FIRMWARE_ACPI1C3                                                           = 0x2
  11798 	PPM_FIRMWARE_ACPI1TSTATES                                                      = 0x4
  11799 	PPM_FIRMWARE_CPC                                                               = 0x40000
  11800 	PPM_FIRMWARE_CSD                                                               = 0x10
  11801 	PPM_FIRMWARE_CST                                                               = 0x8
  11802 	PPM_FIRMWARE_OSC                                                               = 0x10000
  11803 	PPM_FIRMWARE_PCCH                                                              = 0x4000
  11804 	PPM_FIRMWARE_PCCP                                                              = 0x8000
  11805 	PPM_FIRMWARE_PCT                                                               = 0x20
  11806 	PPM_FIRMWARE_PDC                                                               = 0x20000
  11807 	PPM_FIRMWARE_PPC                                                               = 0x100
  11808 	PPM_FIRMWARE_PSD                                                               = 0x200
  11809 	PPM_FIRMWARE_PSS                                                               = 0x40
  11810 	PPM_FIRMWARE_PTC                                                               = 0x400
  11811 	PPM_FIRMWARE_TPC                                                               = 0x1000
  11812 	PPM_FIRMWARE_TSD                                                               = 0x2000
  11813 	PPM_FIRMWARE_TSS                                                               = 0x800
  11814 	PPM_FIRMWARE_XPSS                                                              = 0x80
  11815 	PPM_IDLE_IMPLEMENTATION_CSTATES                                                = 0x1
  11816 	PPM_IDLE_IMPLEMENTATION_NONE                                                   = 0x0
  11817 	PPM_IDLE_IMPLEMENTATION_PEP                                                    = 0x2
  11818 	PPM_PERFORMANCE_IMPLEMENTATION_CPPC                                            = 3
  11819 	PPM_PERFORMANCE_IMPLEMENTATION_NONE                                            = 0
  11820 	PPM_PERFORMANCE_IMPLEMENTATION_PCCV1                                           = 2
  11821 	PPM_PERFORMANCE_IMPLEMENTATION_PEP                                             = 4
  11822 	PPM_PERFORMANCE_IMPLEMENTATION_PSTATES                                         = 1
  11823 	PP_ADMIN_PIN                                                                   = 31
  11824 	PP_APPLI_CERT                                                                  = 18
  11825 	PP_CERTCHAIN                                                                   = 9
  11826 	PP_CHANGE_PASSWORD                                                             = 7
  11827 	PP_CLIENT_HWND                                                                 = 1
  11828 	PP_CONTAINER                                                                   = 6
  11829 	PP_CONTEXT_INFO                                                                = 11
  11830 	PP_CRYPT_COUNT_KEY_USE                                                         = 41
  11831 	PP_DELETEKEY                                                                   = 24
  11832 	PP_DISPLAYERRORS                                                               = 0x01
  11833 	PP_ENUMALGS                                                                    = 1
  11834 	PP_ENUMALGS_EX                                                                 = 22
  11835 	PP_ENUMCONTAINERS                                                              = 2
  11836 	PP_ENUMELECTROOTS                                                              = 26
  11837 	PP_ENUMEX_SIGNING_PROT                                                         = 40
  11838 	PP_ENUMMANDROOTS                                                               = 25
  11839 	PP_IMPTYPE                                                                     = 3
  11840 	PP_KEYEXCHANGE_ALG                                                             = 14
  11841 	PP_KEYEXCHANGE_KEYSIZE                                                         = 12
  11842 	PP_KEYEXCHANGE_PIN                                                             = 32
  11843 	PP_KEYSET_SEC_DESCR                                                            = 8
  11844 	PP_KEYSET_TYPE                                                                 = 27
  11845 	PP_KEYSPEC                                                                     = 39
  11846 	PP_KEYSTORAGE                                                                  = 17
  11847 	PP_KEYX_KEYSIZE_INC                                                            = 35
  11848 	PP_KEY_TYPE_SUBTYPE                                                            = 10
  11849 	PP_NAME                                                                        = 4
  11850 	PP_PROVTYPE                                                                    = 16
  11851 	PP_SESSION_KEYSIZE                                                             = 20
  11852 	PP_SGC_INFO                                                                    = 37
  11853 	PP_SIGNATURE_ALG                                                               = 15
  11854 	PP_SIGNATURE_KEYSIZE                                                           = 13
  11855 	PP_SIGNATURE_PIN                                                               = 33
  11856 	PP_SIG_KEYSIZE_INC                                                             = 34
  11857 	PP_SYM_KEYSIZE                                                                 = 19
  11858 	PP_UI_PROMPT                                                                   = 21
  11859 	PP_UNIQUE_CONTAINER                                                            = 36
  11860 	PP_USE_HARDWARE_RNG                                                            = 38
  11861 	PP_VERSION                                                                     = 5
  11862 	PRAGMA_DEPRECATED_DDK                                                          = 0
  11863 	PREFERRED_SCHEMA_TABLE                                                         = "sqlite_schema"
  11864 	PREFERRED_TEMP_SCHEMA_TABLE                                                    = "sqlite_temp_schema"
  11865 	PRF_CHECKVISIBLE                                                               = 1
  11866 	PRF_CHILDREN                                                                   = 16
  11867 	PRF_CLIENT                                                                     = 4
  11868 	PRF_ERASEBKGND                                                                 = 8
  11869 	PRF_NONCLIENT                                                                  = 2
  11870 	PRF_OWNED                                                                      = 32
  11871 	PRINTACTION_DOCUMENTDEFAULTS                                                   = 6
  11872 	PRINTACTION_NETINSTALL                                                         = 2
  11873 	PRINTACTION_NETINSTALLLINK                                                     = 3
  11874 	PRINTACTION_OPEN                                                               = 0
  11875 	PRINTACTION_OPENNETPRN                                                         = 5
  11876 	PRINTACTION_PROPERTIES                                                         = 1
  11877 	PRINTACTION_SERVERPROPERTIES                                                   = 7
  11878 	PRINTACTION_TESTPAGE                                                           = 4
  11879 	PRINTDLGEXORD                                                                  = 1549
  11880 	PRINTDLGORD                                                                    = 1538
  11881 	PRINTER_ACCESS_ADMINISTER                                                      = 0x00000004
  11882 	PRINTER_ACCESS_USE                                                             = 0x00000008
  11883 	PRINTER_ALL_ACCESS                                                             = 983052
  11884 	PRINTER_ATTRIBUTE_DEFAULT                                                      = 0x00000004
  11885 	PRINTER_ATTRIBUTE_DIRECT                                                       = 0x00000002
  11886 	PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST                                            = 0x00000200
  11887 	PRINTER_ATTRIBUTE_ENABLE_BIDI                                                  = 0x00000800
  11888 	PRINTER_ATTRIBUTE_ENABLE_DEVQ                                                  = 0x00000080
  11889 	PRINTER_ATTRIBUTE_FAX                                                          = 0x00004000
  11890 	PRINTER_ATTRIBUTE_HIDDEN                                                       = 0x00000020
  11891 	PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS                                              = 0x00000100
  11892 	PRINTER_ATTRIBUTE_LOCAL                                                        = 0x00000040
  11893 	PRINTER_ATTRIBUTE_NETWORK                                                      = 0x00000010
  11894 	PRINTER_ATTRIBUTE_PUBLISHED                                                    = 0x00002000
  11895 	PRINTER_ATTRIBUTE_QUEUED                                                       = 0x00000001
  11896 	PRINTER_ATTRIBUTE_RAW_ONLY                                                     = 0x00001000
  11897 	PRINTER_ATTRIBUTE_SHARED                                                       = 0x00000008
  11898 	PRINTER_ATTRIBUTE_TS                                                           = 0x00008000
  11899 	PRINTER_ATTRIBUTE_WORK_OFFLINE                                                 = 0x00000400
  11900 	PRINTER_CHANGE_ADD_FORM                                                        = 0x00010000
  11901 	PRINTER_CHANGE_ADD_JOB                                                         = 0x00000100
  11902 	PRINTER_CHANGE_ADD_PORT                                                        = 0x00100000
  11903 	PRINTER_CHANGE_ADD_PRINTER                                                     = 0x00000001
  11904 	PRINTER_CHANGE_ADD_PRINTER_DRIVER                                              = 0x10000000
  11905 	PRINTER_CHANGE_ADD_PRINT_PROCESSOR                                             = 0x01000000
  11906 	PRINTER_CHANGE_ALL                                                             = 0x7777FFFF
  11907 	PRINTER_CHANGE_CONFIGURE_PORT                                                  = 0x00200000
  11908 	PRINTER_CHANGE_DELETE_FORM                                                     = 0x00040000
  11909 	PRINTER_CHANGE_DELETE_JOB                                                      = 0x00000400
  11910 	PRINTER_CHANGE_DELETE_PORT                                                     = 0x00400000
  11911 	PRINTER_CHANGE_DELETE_PRINTER                                                  = 0x00000004
  11912 	PRINTER_CHANGE_DELETE_PRINTER_DRIVER                                           = 0x40000000
  11913 	PRINTER_CHANGE_DELETE_PRINT_PROCESSOR                                          = 0x04000000
  11914 	PRINTER_CHANGE_FAILED_CONNECTION_PRINTER                                       = 0x00000008
  11915 	PRINTER_CHANGE_FORM                                                            = 0x00070000
  11916 	PRINTER_CHANGE_JOB                                                             = 0x0000FF00
  11917 	PRINTER_CHANGE_PORT                                                            = 0x00700000
  11918 	PRINTER_CHANGE_PRINTER                                                         = 0x000000FF
  11919 	PRINTER_CHANGE_PRINTER_DRIVER                                                  = 0x70000000
  11920 	PRINTER_CHANGE_PRINT_PROCESSOR                                                 = 0x07000000
  11921 	PRINTER_CHANGE_SET_FORM                                                        = 0x00020000
  11922 	PRINTER_CHANGE_SET_JOB                                                         = 0x00000200
  11923 	PRINTER_CHANGE_SET_PRINTER                                                     = 0x00000002
  11924 	PRINTER_CHANGE_SET_PRINTER_DRIVER                                              = 0x20000000
  11925 	PRINTER_CHANGE_TIMEOUT                                                         = 0x80000000
  11926 	PRINTER_CHANGE_WRITE_JOB                                                       = 0x00000800
  11927 	PRINTER_CONTROL_PAUSE                                                          = 1
  11928 	PRINTER_CONTROL_PURGE                                                          = 3
  11929 	PRINTER_CONTROL_RESUME                                                         = 2
  11930 	PRINTER_CONTROL_SET_STATUS                                                     = 4
  11931 	PRINTER_ENUM_CONNECTIONS                                                       = 0x00000004
  11932 	PRINTER_ENUM_CONTAINER                                                         = 0x00008000
  11933 	PRINTER_ENUM_DEFAULT                                                           = 0x00000001
  11934 	PRINTER_ENUM_EXPAND                                                            = 0x00004000
  11935 	PRINTER_ENUM_FAVORITE                                                          = 0x00000004
  11936 	PRINTER_ENUM_HIDE                                                              = 0x01000000
  11937 	PRINTER_ENUM_ICON1                                                             = 0x00010000
  11938 	PRINTER_ENUM_ICON2                                                             = 0x00020000
  11939 	PRINTER_ENUM_ICON3                                                             = 0x00040000
  11940 	PRINTER_ENUM_ICON4                                                             = 0x00080000
  11941 	PRINTER_ENUM_ICON5                                                             = 0x00100000
  11942 	PRINTER_ENUM_ICON6                                                             = 0x00200000
  11943 	PRINTER_ENUM_ICON7                                                             = 0x00400000
  11944 	PRINTER_ENUM_ICON8                                                             = 0x00800000
  11945 	PRINTER_ENUM_ICONMASK                                                          = 0x00ff0000
  11946 	PRINTER_ENUM_LOCAL                                                             = 0x00000002
  11947 	PRINTER_ENUM_NAME                                                              = 0x00000008
  11948 	PRINTER_ENUM_NETWORK                                                           = 0x00000040
  11949 	PRINTER_ENUM_REMOTE                                                            = 0x00000010
  11950 	PRINTER_ENUM_SHARED                                                            = 0x00000020
  11951 	PRINTER_ERROR_INFORMATION                                                      = 0x80000000
  11952 	PRINTER_ERROR_JAM                                                              = 0x00000002
  11953 	PRINTER_ERROR_OUTOFPAPER                                                       = 0x00000001
  11954 	PRINTER_ERROR_OUTOFTONER                                                       = 0x00000004
  11955 	PRINTER_ERROR_SEVERE                                                           = 0x20000000
  11956 	PRINTER_ERROR_WARNING                                                          = 0x40000000
  11957 	PRINTER_EXECUTE                                                                = 131080
  11958 	PRINTER_FONTTYPE                                                               = 0x4000
  11959 	PRINTER_NOTIFY_FIELD_ATTRIBUTES                                                = 0x0D
  11960 	PRINTER_NOTIFY_FIELD_AVERAGE_PPM                                               = 0x15
  11961 	PRINTER_NOTIFY_FIELD_BYTES_PRINTED                                             = 0x19
  11962 	PRINTER_NOTIFY_FIELD_CJOBS                                                     = 0x14
  11963 	PRINTER_NOTIFY_FIELD_COMMENT                                                   = 0x05
  11964 	PRINTER_NOTIFY_FIELD_DATATYPE                                                  = 0x0B
  11965 	PRINTER_NOTIFY_FIELD_DEFAULT_PRIORITY                                          = 0x0F
  11966 	PRINTER_NOTIFY_FIELD_DEVMODE                                                   = 0x07
  11967 	PRINTER_NOTIFY_FIELD_DRIVER_NAME                                               = 0x04
  11968 	PRINTER_NOTIFY_FIELD_LOCATION                                                  = 0x06
  11969 	PRINTER_NOTIFY_FIELD_OBJECT_GUID                                               = 0x1A
  11970 	PRINTER_NOTIFY_FIELD_PAGES_PRINTED                                             = 0x17
  11971 	PRINTER_NOTIFY_FIELD_PARAMETERS                                                = 0x0A
  11972 	PRINTER_NOTIFY_FIELD_PORT_NAME                                                 = 0x03
  11973 	PRINTER_NOTIFY_FIELD_PRINTER_NAME                                              = 0x01
  11974 	PRINTER_NOTIFY_FIELD_PRINT_PROCESSOR                                           = 0x09
  11975 	PRINTER_NOTIFY_FIELD_PRIORITY                                                  = 0x0E
  11976 	PRINTER_NOTIFY_FIELD_SECURITY_DESCRIPTOR                                       = 0x0C
  11977 	PRINTER_NOTIFY_FIELD_SEPFILE                                                   = 0x08
  11978 	PRINTER_NOTIFY_FIELD_SERVER_NAME                                               = 0x00
  11979 	PRINTER_NOTIFY_FIELD_SHARE_NAME                                                = 0x02
  11980 	PRINTER_NOTIFY_FIELD_START_TIME                                                = 0x10
  11981 	PRINTER_NOTIFY_FIELD_STATUS                                                    = 0x12
  11982 	PRINTER_NOTIFY_FIELD_STATUS_STRING                                             = 0x13
  11983 	PRINTER_NOTIFY_FIELD_TOTAL_BYTES                                               = 0x18
  11984 	PRINTER_NOTIFY_FIELD_TOTAL_PAGES                                               = 0x16
  11985 	PRINTER_NOTIFY_FIELD_UNTIL_TIME                                                = 0x11
  11986 	PRINTER_NOTIFY_INFO_DISCARDED                                                  = 0x01
  11987 	PRINTER_NOTIFY_OPTIONS_REFRESH                                                 = 0x01
  11988 	PRINTER_NOTIFY_TYPE                                                            = 0x00
  11989 	PRINTER_READ                                                                   = 131080
  11990 	PRINTER_STATUS_BUSY                                                            = 0x00000200
  11991 	PRINTER_STATUS_DOOR_OPEN                                                       = 0x00400000
  11992 	PRINTER_STATUS_ERROR                                                           = 0x00000002
  11993 	PRINTER_STATUS_INITIALIZING                                                    = 0x00008000
  11994 	PRINTER_STATUS_IO_ACTIVE                                                       = 0x00000100
  11995 	PRINTER_STATUS_MANUAL_FEED                                                     = 0x00000020
  11996 	PRINTER_STATUS_NOT_AVAILABLE                                                   = 0x00001000
  11997 	PRINTER_STATUS_NO_TONER                                                        = 0x00040000
  11998 	PRINTER_STATUS_OFFLINE                                                         = 0x00000080
  11999 	PRINTER_STATUS_OUTPUT_BIN_FULL                                                 = 0x00000800
  12000 	PRINTER_STATUS_OUT_OF_MEMORY                                                   = 0x00200000
  12001 	PRINTER_STATUS_PAGE_PUNT                                                       = 0x00080000
  12002 	PRINTER_STATUS_PAPER_JAM                                                       = 0x00000008
  12003 	PRINTER_STATUS_PAPER_OUT                                                       = 0x00000010
  12004 	PRINTER_STATUS_PAPER_PROBLEM                                                   = 0x00000040
  12005 	PRINTER_STATUS_PAUSED                                                          = 0x00000001
  12006 	PRINTER_STATUS_PENDING_DELETION                                                = 0x00000004
  12007 	PRINTER_STATUS_POWER_SAVE                                                      = 0x01000000
  12008 	PRINTER_STATUS_PRINTING                                                        = 0x00000400
  12009 	PRINTER_STATUS_PROCESSING                                                      = 0x00004000
  12010 	PRINTER_STATUS_SERVER_UNKNOWN                                                  = 0x00800000
  12011 	PRINTER_STATUS_TONER_LOW                                                       = 0x00020000
  12012 	PRINTER_STATUS_USER_INTERVENTION                                               = 0x00100000
  12013 	PRINTER_STATUS_WAITING                                                         = 0x00002000
  12014 	PRINTER_STATUS_WARMING_UP                                                      = 0x00010000
  12015 	PRINTER_WRITE                                                                  = 131080
  12016 	PRINTRATEUNIT_CPS                                                              = 2
  12017 	PRINTRATEUNIT_IPM                                                              = 4
  12018 	PRINTRATEUNIT_LPM                                                              = 3
  12019 	PRINTRATEUNIT_PPM                                                              = 1
  12020 	PRIVATEKEYBLOB                                                                 = 0x7
  12021 	PRIVATE_NAMESPACE_FLAG_DESTROY                                                 = 0x1
  12022 	PRIVILEGE_SET_ALL_NECESSARY                                                    = 1
  12023 	PRNSETUPDLGORD                                                                 = 1539
  12024 	PROCESSOR_ALPHA_21064                                                          = 21064
  12025 	PROCESSOR_AMD_X8664                                                            = 8664
  12026 	PROCESSOR_ARCHITECTURE_ALPHA                                                   = 2
  12027 	PROCESSOR_ARCHITECTURE_ALPHA64                                                 = 7
  12028 	PROCESSOR_ARCHITECTURE_AMD64                                                   = 9
  12029 	PROCESSOR_ARCHITECTURE_ARM                                                     = 5
  12030 	PROCESSOR_ARCHITECTURE_ARM32_ON_WIN64                                          = 13
  12031 	PROCESSOR_ARCHITECTURE_ARM64                                                   = 12
  12032 	PROCESSOR_ARCHITECTURE_IA32_ON_ARM64                                           = 14
  12033 	PROCESSOR_ARCHITECTURE_IA32_ON_WIN64                                           = 10
  12034 	PROCESSOR_ARCHITECTURE_IA64                                                    = 6
  12035 	PROCESSOR_ARCHITECTURE_INTEL                                                   = 0
  12036 	PROCESSOR_ARCHITECTURE_MIPS                                                    = 1
  12037 	PROCESSOR_ARCHITECTURE_MSIL                                                    = 8
  12038 	PROCESSOR_ARCHITECTURE_NEUTRAL                                                 = 11
  12039 	PROCESSOR_ARCHITECTURE_PPC                                                     = 3
  12040 	PROCESSOR_ARCHITECTURE_SHX                                                     = 4
  12041 	PROCESSOR_ARCHITECTURE_UNKNOWN                                                 = 0xffff
  12042 	PROCESSOR_ARM720                                                               = 1824
  12043 	PROCESSOR_ARM820                                                               = 2080
  12044 	PROCESSOR_ARM920                                                               = 2336
  12045 	PROCESSOR_ARM_7TDMI                                                            = 70001
  12046 	PROCESSOR_HITACHI_SH3                                                          = 10003
  12047 	PROCESSOR_HITACHI_SH3E                                                         = 10004
  12048 	PROCESSOR_HITACHI_SH4                                                          = 10005
  12049 	PROCESSOR_IDLESTATE_POLICY_COUNT                                               = 0x3
  12050 	PROCESSOR_INTEL_386                                                            = 386
  12051 	PROCESSOR_INTEL_486                                                            = 486
  12052 	PROCESSOR_INTEL_IA64                                                           = 2200
  12053 	PROCESSOR_INTEL_PENTIUM                                                        = 586
  12054 	PROCESSOR_MIPS_R4000                                                           = 4000
  12055 	PROCESSOR_MOTOROLA_821                                                         = 821
  12056 	PROCESSOR_OPTIL                                                                = 0x494f
  12057 	PROCESSOR_PERF_BOOST_MODE_AGGRESSIVE                                           = 2
  12058 	PROCESSOR_PERF_BOOST_MODE_DISABLED                                             = 0
  12059 	PROCESSOR_PERF_BOOST_MODE_EFFICIENT_AGGRESSIVE                                 = 4
  12060 	PROCESSOR_PERF_BOOST_MODE_EFFICIENT_ENABLED                                    = 3
  12061 	PROCESSOR_PERF_BOOST_MODE_ENABLED                                              = 1
  12062 	PROCESSOR_PERF_BOOST_MODE_MAX                                                  = 4
  12063 	PROCESSOR_PERF_BOOST_POLICY_DISABLED                                           = 0
  12064 	PROCESSOR_PERF_BOOST_POLICY_MAX                                                = 100
  12065 	PROCESSOR_PPC_601                                                              = 601
  12066 	PROCESSOR_PPC_603                                                              = 603
  12067 	PROCESSOR_PPC_604                                                              = 604
  12068 	PROCESSOR_PPC_620                                                              = 620
  12069 	PROCESSOR_SHx_SH3                                                              = 103
  12070 	PROCESSOR_SHx_SH4                                                              = 104
  12071 	PROCESSOR_STRONGARM                                                            = 2577
  12072 	PROCESS_ALL_ACCESS                                                             = 2035711
  12073 	PROCESS_CREATE_PROCESS                                                         = 128
  12074 	PROCESS_CREATE_THREAD                                                          = 2
  12075 	PROCESS_DUP_HANDLE                                                             = 64
  12076 	PROCESS_HEAP_ENTRY_BUSY                                                        = 0x4
  12077 	PROCESS_HEAP_ENTRY_DDESHARE                                                    = 0x20
  12078 	PROCESS_HEAP_ENTRY_MOVEABLE                                                    = 0x10
  12079 	PROCESS_HEAP_REGION                                                            = 0x1
  12080 	PROCESS_HEAP_SEG_ALLOC                                                         = 0x8
  12081 	PROCESS_HEAP_UNCOMMITTED_RANGE                                                 = 0x2
  12082 	PROCESS_MODE_BACKGROUND_BEGIN                                                  = 0x100000
  12083 	PROCESS_MODE_BACKGROUND_END                                                    = 0x200000
  12084 	PROCESS_QUERY_INFORMATION                                                      = 1024
  12085 	PROCESS_QUERY_LIMITED_INFORMATION                                              = 4096
  12086 	PROCESS_SET_INFORMATION                                                        = 512
  12087 	PROCESS_SET_QUOTA                                                              = 256
  12088 	PROCESS_SET_SESSIONID                                                          = 4
  12089 	PROCESS_SUSPEND_RESUME                                                         = 2048
  12090 	PROCESS_TERMINATE                                                              = 1
  12091 	PROCESS_VM_OPERATION                                                           = 8
  12092 	PROCESS_VM_READ                                                                = 16
  12093 	PROCESS_VM_WRITE                                                               = 32
  12094 	PROC_IDLE_BUCKET_COUNT                                                         = 6
  12095 	PROC_IDLE_BUCKET_COUNT_EX                                                      = 16
  12096 	PRODUCT_ARM64_SERVER                                                           = 0x78
  12097 	PRODUCT_BUSINESS                                                               = 0x6
  12098 	PRODUCT_BUSINESS_N                                                             = 0x10
  12099 	PRODUCT_CLOUD_HOST_INFRASTRUCTURE_SERVER                                       = 0x7C
  12100 	PRODUCT_CLOUD_STORAGE_SERVER                                                   = 0x6E
  12101 	PRODUCT_CLUSTER_SERVER                                                         = 0x12
  12102 	PRODUCT_CLUSTER_SERVER_V                                                       = 0x40
  12103 	PRODUCT_CONNECTED_CAR                                                          = 0x75
  12104 	PRODUCT_CORE                                                                   = 0x65
  12105 	PRODUCT_CORE_ARM                                                               = 0x61
  12106 	PRODUCT_CORE_CONNECTED                                                         = 0x6F
  12107 	PRODUCT_CORE_CONNECTED_COUNTRYSPECIFIC                                         = 0x74
  12108 	PRODUCT_CORE_CONNECTED_N                                                       = 0x71
  12109 	PRODUCT_CORE_CONNECTED_SINGLELANGUAGE                                          = 0x73
  12110 	PRODUCT_CORE_COUNTRYSPECIFIC                                                   = 0x63
  12111 	PRODUCT_CORE_LANGUAGESPECIFIC                                                  = 0x64
  12112 	PRODUCT_CORE_N                                                                 = 0x62
  12113 	PRODUCT_CORE_SINGLELANGUAGE                                                    = 0x64
  12114 	PRODUCT_DATACENTER_EVALUATION_SERVER                                           = 0x50
  12115 	PRODUCT_DATACENTER_SERVER                                                      = 0x8
  12116 	PRODUCT_DATACENTER_SERVER_CORE                                                 = 0xc
  12117 	PRODUCT_DATACENTER_SERVER_CORE_V                                               = 0x27
  12118 	PRODUCT_DATACENTER_SERVER_V                                                    = 0x25
  12119 	PRODUCT_EDUCATION                                                              = 0x79
  12120 	PRODUCT_EDUCATION_N                                                            = 0x7a
  12121 	PRODUCT_EMBEDDED                                                               = 0x41
  12122 	PRODUCT_EMBEDDED_A                                                             = 0x58
  12123 	PRODUCT_EMBEDDED_AUTOMOTIVE                                                    = 0x55
  12124 	PRODUCT_EMBEDDED_E                                                             = 0x5A
  12125 	PRODUCT_EMBEDDED_EVAL                                                          = 0x6B
  12126 	PRODUCT_EMBEDDED_E_EVAL                                                        = 0x6C
  12127 	PRODUCT_EMBEDDED_INDUSTRY                                                      = 0x59
  12128 	PRODUCT_EMBEDDED_INDUSTRY_A                                                    = 0x56
  12129 	PRODUCT_EMBEDDED_INDUSTRY_A_E                                                  = 0x5C
  12130 	PRODUCT_EMBEDDED_INDUSTRY_E                                                    = 0x5B
  12131 	PRODUCT_EMBEDDED_INDUSTRY_EVAL                                                 = 0x69
  12132 	PRODUCT_EMBEDDED_INDUSTRY_E_EVAL                                               = 0x6A
  12133 	PRODUCT_ENTERPRISE                                                             = 0x4
  12134 	PRODUCT_ENTERPRISE_E                                                           = 0x46
  12135 	PRODUCT_ENTERPRISE_EVALUATION                                                  = 0x48
  12136 	PRODUCT_ENTERPRISE_N                                                           = 0x1b
  12137 	PRODUCT_ENTERPRISE_N_EVALUATION                                                = 0x54
  12138 	PRODUCT_ENTERPRISE_S                                                           = 0x7D
  12139 	PRODUCT_ENTERPRISE_SERVER                                                      = 0xa
  12140 	PRODUCT_ENTERPRISE_SERVER_CORE                                                 = 0xe
  12141 	PRODUCT_ENTERPRISE_SERVER_CORE_V                                               = 0x29
  12142 	PRODUCT_ENTERPRISE_SERVER_IA64                                                 = 0xf
  12143 	PRODUCT_ENTERPRISE_SERVER_V                                                    = 0x26
  12144 	PRODUCT_ENTERPRISE_S_EVALUATION                                                = 0x81
  12145 	PRODUCT_ENTERPRISE_S_N                                                         = 0x7E
  12146 	PRODUCT_ENTERPRISE_S_N_EVALUATION                                              = 0x82
  12147 	PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL                                          = 0x3C
  12148 	PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC                                       = 0x3E
  12149 	PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT                                          = 0x3B
  12150 	PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC                                       = 0x3D
  12151 	PRODUCT_HOME_BASIC                                                             = 0x2
  12152 	PRODUCT_HOME_BASIC_E                                                           = 0x43
  12153 	PRODUCT_HOME_BASIC_N                                                           = 0x5
  12154 	PRODUCT_HOME_PREMIUM                                                           = 0x3
  12155 	PRODUCT_HOME_PREMIUM_E                                                         = 0x44
  12156 	PRODUCT_HOME_PREMIUM_N                                                         = 0x1a
  12157 	PRODUCT_HOME_PREMIUM_SERVER                                                    = 0x22
  12158 	PRODUCT_HOME_SERVER                                                            = 0x13
  12159 	PRODUCT_HYPERV                                                                 = 0x2a
  12160 	PRODUCT_ID_LENGTH                                                              = 16
  12161 	PRODUCT_INDUSTRY_HANDHELD                                                      = 0x76
  12162 	PRODUCT_IOTUAP                                                                 = 0x7B
  12163 	PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT                                       = 0x1e
  12164 	PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING                                        = 0x20
  12165 	PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY                                         = 0x1f
  12166 	PRODUCT_MOBILE_CORE                                                            = 0x68
  12167 	PRODUCT_MOBILE_ENTERPRISE                                                      = 0x85
  12168 	PRODUCT_MULTIPOINT_PREMIUM_SERVER                                              = 0x4D
  12169 	PRODUCT_MULTIPOINT_STANDARD_SERVER                                             = 0x4C
  12170 	PRODUCT_NANO_SERVER                                                            = 0x6D
  12171 	PRODUCT_PPI_PRO                                                                = 0x77
  12172 	PRODUCT_PROFESSIONAL                                                           = 0x30
  12173 	PRODUCT_PROFESSIONAL_E                                                         = 0x45
  12174 	PRODUCT_PROFESSIONAL_EMBEDDED                                                  = 0x3A
  12175 	PRODUCT_PROFESSIONAL_N                                                         = 0x31
  12176 	PRODUCT_PROFESSIONAL_S                                                         = 0x7F
  12177 	PRODUCT_PROFESSIONAL_STUDENT                                                   = 0x70
  12178 	PRODUCT_PROFESSIONAL_STUDENT_N                                                 = 0x72
  12179 	PRODUCT_PROFESSIONAL_S_N                                                       = 0x80
  12180 	PRODUCT_PROFESSIONAL_WMC                                                       = 0x67
  12181 	PRODUCT_SB_SOLUTION_SERVER                                                     = 0x32
  12182 	PRODUCT_SB_SOLUTION_SERVER_EM                                                  = 0x36
  12183 	PRODUCT_SERVER_FOR_SB_SOLUTIONS                                                = 0x33
  12184 	PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM                                             = 0x37
  12185 	PRODUCT_SERVER_FOR_SMALLBUSINESS                                               = 0x18
  12186 	PRODUCT_SERVER_FOR_SMALLBUSINESS_V                                             = 0x23
  12187 	PRODUCT_SERVER_FOUNDATION                                                      = 0x21
  12188 	PRODUCT_SERVER_V                                                               = 0x25
  12189 	PRODUCT_SMALLBUSINESS_SERVER                                                   = 0x9
  12190 	PRODUCT_SMALLBUSINESS_SERVER_PREMIUM                                           = 0x19
  12191 	PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE                                      = 0x3f
  12192 	PRODUCT_SOLUTION_EMBEDDEDSERVER                                                = 0x38
  12193 	PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE                                           = 0x39
  12194 	PRODUCT_STANDARD_EVALUATION_SERVER                                             = 0x4F
  12195 	PRODUCT_STANDARD_SERVER                                                        = 0x7
  12196 	PRODUCT_STANDARD_SERVER_CORE                                                   = 0xd
  12197 	PRODUCT_STANDARD_SERVER_CORE_V                                                 = 0x28
  12198 	PRODUCT_STANDARD_SERVER_SOLUTIONS                                              = 0x34
  12199 	PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE                                         = 0x35
  12200 	PRODUCT_STANDARD_SERVER_V                                                      = 0x24
  12201 	PRODUCT_STARTER                                                                = 0xb
  12202 	PRODUCT_STARTER_E                                                              = 0x42
  12203 	PRODUCT_STARTER_N                                                              = 0x2f
  12204 	PRODUCT_STORAGE_ENTERPRISE_SERVER                                              = 0x17
  12205 	PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE                                         = 0x2e
  12206 	PRODUCT_STORAGE_EXPRESS_SERVER                                                 = 0x14
  12207 	PRODUCT_STORAGE_EXPRESS_SERVER_CORE                                            = 0x2b
  12208 	PRODUCT_STORAGE_STANDARD_EVALUATION_SERVER                                     = 0x60
  12209 	PRODUCT_STORAGE_STANDARD_SERVER                                                = 0x15
  12210 	PRODUCT_STORAGE_STANDARD_SERVER_CORE                                           = 0x2c
  12211 	PRODUCT_STORAGE_WORKGROUP_EVALUATION_SERVER                                    = 0x5F
  12212 	PRODUCT_STORAGE_WORKGROUP_SERVER                                               = 0x16
  12213 	PRODUCT_STORAGE_WORKGROUP_SERVER_CORE                                          = 0x2d
  12214 	PRODUCT_THINPC                                                                 = 0x57
  12215 	PRODUCT_ULTIMATE                                                               = 0x1
  12216 	PRODUCT_ULTIMATE_E                                                             = 0x47
  12217 	PRODUCT_ULTIMATE_N                                                             = 0x1c
  12218 	PRODUCT_UNDEFINED                                                              = 0x0
  12219 	PRODUCT_UNLICENSED                                                             = 0xabcdabcd
  12220 	PRODUCT_WEB_SERVER                                                             = 0x11
  12221 	PRODUCT_WEB_SERVER_CORE                                                        = 0x1d
  12222 	PROFILE_EMBEDDED                                                               = 77
  12223 	PROFILE_KERNEL                                                                 = 0x20000000
  12224 	PROFILE_LINKED                                                                 = 76
  12225 	PROFILE_SERVER                                                                 = 0x40000000
  12226 	PROFILE_USER                                                                   = 0x10000000
  12227 	PROGRESS_CANCEL                                                                = 1
  12228 	PROGRESS_CONTINUE                                                              = 0
  12229 	PROGRESS_QUIET                                                                 = 3
  12230 	PROGRESS_STOP                                                                  = 2
  12231 	PROOF_QUALITY                                                                  = 2
  12232 	PROPERTYKEY_DEFINED                                                            = 0
  12233 	PROPSETFLAG_ANSI                                                               = 2
  12234 	PROPSETFLAG_CASE_SENSITIVE                                                     = 8
  12235 	PROPSETFLAG_DEFAULT                                                            = 0
  12236 	PROPSETFLAG_NONSIMPLE                                                          = 1
  12237 	PROPSETFLAG_UNBUFFERED                                                         = 4
  12238 	PROPSETHDR_OSVERSION_UNKNOWN                                                   = 0xffffffff
  12239 	PROPSET_BEHAVIOR_CASE_SENSITIVE                                                = 1
  12240 	PROP_LG_CXDLG                                                                  = 252
  12241 	PROP_LG_CYDLG                                                                  = 218
  12242 	PROP_MED_CXDLG                                                                 = 227
  12243 	PROP_MED_CYDLG                                                                 = 215
  12244 	PROP_SM_CXDLG                                                                  = 212
  12245 	PROP_SM_CYDLG                                                                  = 188
  12246 	PROTECTED_DACL_SECURITY_INFORMATION                                            = 2147483648
  12247 	PROTECTED_SACL_SECURITY_INFORMATION                                            = 1073741824
  12248 	PROTOCOLFLAG_NO_PICS_CHECK                                                     = 0x1
  12249 	PROVIDER_KEEPS_VALUE_LENGTH                                                    = 0x1
  12250 	PROV_DH_SCHANNEL                                                               = 18
  12251 	PROV_DSS                                                                       = 3
  12252 	PROV_DSS_DH                                                                    = 13
  12253 	PROV_EC_ECDSA_FULL                                                             = 16
  12254 	PROV_EC_ECDSA_SIG                                                              = 14
  12255 	PROV_EC_ECNRA_FULL                                                             = 17
  12256 	PROV_EC_ECNRA_SIG                                                              = 15
  12257 	PROV_FORTEZZA                                                                  = 4
  12258 	PROV_INTEL_SEC                                                                 = 22
  12259 	PROV_MS_EXCHANGE                                                               = 5
  12260 	PROV_REPLACE_OWF                                                               = 23
  12261 	PROV_RNG                                                                       = 21
  12262 	PROV_RSA_AES                                                                   = 24
  12263 	PROV_RSA_FULL                                                                  = 1
  12264 	PROV_RSA_SCHANNEL                                                              = 12
  12265 	PROV_RSA_SIG                                                                   = 2
  12266 	PROV_SPYRUS_LYNKS                                                              = 20
  12267 	PROV_SSL                                                                       = 6
  12268 	PROV_STT_ACQ                                                                   = 8
  12269 	PROV_STT_BRND                                                                  = 9
  12270 	PROV_STT_ISS                                                                   = 11
  12271 	PROV_STT_MER                                                                   = 7
  12272 	PROV_STT_ROOT                                                                  = 10
  12273 	PRSPEC_INVALID                                                                 = 4294967295
  12274 	PRSPEC_LPWSTR                                                                  = 0
  12275 	PRSPEC_PROPID                                                                  = 1
  12276 	PR_JOBSTATUS                                                                   = 0x0000
  12277 	PSBTN_APPLYNOW                                                                 = 4
  12278 	PSBTN_BACK                                                                     = 0
  12279 	PSBTN_CANCEL                                                                   = 5
  12280 	PSBTN_FINISH                                                                   = 2
  12281 	PSBTN_HELP                                                                     = 6
  12282 	PSBTN_MAX                                                                      = 6
  12283 	PSBTN_NEXT                                                                     = 1
  12284 	PSBTN_OK                                                                       = 3
  12285 	PSCB_BUTTONPRESSED                                                             = 3
  12286 	PSCB_INITIALIZED                                                               = 1
  12287 	PSCB_PRECREATE                                                                 = 2
  12288 	PSD_DEFAULTMINMARGINS                                                          = 0x0
  12289 	PSD_DISABLEMARGINS                                                             = 0x10
  12290 	PSD_DISABLEORIENTATION                                                         = 0x100
  12291 	PSD_DISABLEPAGEPAINTING                                                        = 0x80000
  12292 	PSD_DISABLEPAPER                                                               = 0x200
  12293 	PSD_DISABLEPRINTER                                                             = 0x20
  12294 	PSD_ENABLEPAGEPAINTHOOK                                                        = 0x40000
  12295 	PSD_ENABLEPAGESETUPHOOK                                                        = 0x2000
  12296 	PSD_ENABLEPAGESETUPTEMPLATE                                                    = 0x8000
  12297 	PSD_ENABLEPAGESETUPTEMPLATEHANDLE                                              = 0x20000
  12298 	PSD_INHUNDREDTHSOFMILLIMETERS                                                  = 0x8
  12299 	PSD_INTHOUSANDTHSOFINCHES                                                      = 0x4
  12300 	PSD_INWININIINTLMEASURE                                                        = 0x0
  12301 	PSD_MARGINS                                                                    = 0x2
  12302 	PSD_MINMARGINS                                                                 = 0x1
  12303 	PSD_NONETWORKBUTTON                                                            = 0x200000
  12304 	PSD_NOWARNING                                                                  = 0x80
  12305 	PSD_RETURNDEFAULT                                                              = 0x400
  12306 	PSD_SHOWHELP                                                                   = 0x800
  12307 	PSH_DEFAULT                                                                    = 0x00000000
  12308 	PSH_HASHELP                                                                    = 0x00000200
  12309 	PSH_HEADER                                                                     = 0x00080000
  12310 	PSH_MODELESS                                                                   = 0x00000400
  12311 	PSH_NOAPPLYNOW                                                                 = 0x00000080
  12312 	PSH_NOCONTEXTHELP                                                              = 0x02000000
  12313 	PSH_PROPSHEETPAGE                                                              = 0x00000008
  12314 	PSH_PROPTITLE                                                                  = 0x00000001
  12315 	PSH_RTLREADING                                                                 = 0x00000800
  12316 	PSH_STRETCHWATERMARK                                                           = 0x00040000
  12317 	PSH_USECALLBACK                                                                = 0x00000100
  12318 	PSH_USEHBMHEADER                                                               = 0x00100000
  12319 	PSH_USEHBMWATERMARK                                                            = 0x00010000
  12320 	PSH_USEHICON                                                                   = 0x00000002
  12321 	PSH_USEHPLWATERMARK                                                            = 0x00020000
  12322 	PSH_USEICONID                                                                  = 0x00000004
  12323 	PSH_USEPAGELANG                                                                = 0x00200000
  12324 	PSH_USEPSTARTPAGE                                                              = 0x00000040
  12325 	PSH_WATERMARK                                                                  = 0x00008000
  12326 	PSH_WIZARD                                                                     = 0x00000020
  12327 	PSH_WIZARD97                                                                   = 0x01000000
  12328 	PSH_WIZARDCONTEXTHELP                                                          = 0x00001000
  12329 	PSH_WIZARDHASFINISH                                                            = 0x00000010
  12330 	PSH_WIZARD_LITE                                                                = 0x00400000
  12331 	PSIDENT_GDICENTRIC                                                             = 0
  12332 	PSIDENT_PSCENTRIC                                                              = 1
  12333 	PSINJECT_BEGINDEFAULTS                                                         = 12
  12334 	PSINJECT_BEGINPAGESETUP                                                        = 101
  12335 	PSINJECT_BEGINPROLOG                                                           = 14
  12336 	PSINJECT_BEGINSETUP                                                            = 16
  12337 	PSINJECT_BEGINSTREAM                                                           = 1
  12338 	PSINJECT_BOUNDINGBOX                                                           = 9
  12339 	PSINJECT_COMMENTS                                                              = 11
  12340 	PSINJECT_DLFONT                                                                = 0xdddddddd
  12341 	PSINJECT_DOCNEEDEDRES                                                          = 5
  12342 	PSINJECT_DOCSUPPLIEDRES                                                        = 6
  12343 	PSINJECT_DOCUMENTPROCESSCOLORS                                                 = 10
  12344 	PSINJECT_DOCUMENTPROCESSCOLORSATEND                                            = 21
  12345 	PSINJECT_ENDDEFAULTS                                                           = 13
  12346 	PSINJECT_ENDPAGECOMMENTS                                                       = 107
  12347 	PSINJECT_ENDPAGESETUP                                                          = 102
  12348 	PSINJECT_ENDPROLOG                                                             = 15
  12349 	PSINJECT_ENDSETUP                                                              = 17
  12350 	PSINJECT_ENDSTREAM                                                             = 20
  12351 	PSINJECT_EOF                                                                   = 19
  12352 	PSINJECT_ORIENTATION                                                           = 8
  12353 	PSINJECT_PAGEBBOX                                                              = 106
  12354 	PSINJECT_PAGENUMBER                                                            = 100
  12355 	PSINJECT_PAGEORDER                                                             = 7
  12356 	PSINJECT_PAGES                                                                 = 4
  12357 	PSINJECT_PAGESATEND                                                            = 3
  12358 	PSINJECT_PAGETRAILER                                                           = 103
  12359 	PSINJECT_PLATECOLOR                                                            = 104
  12360 	PSINJECT_PSADOBE                                                               = 2
  12361 	PSINJECT_SHOWPAGE                                                              = 105
  12362 	PSINJECT_TRAILER                                                               = 18
  12363 	PSINJECT_VMRESTORE                                                             = 201
  12364 	PSINJECT_VMSAVE                                                                = 200
  12365 	PSM_ADDPAGE                                                                    = 1127
  12366 	PSM_APPLY                                                                      = 1134
  12367 	PSM_CANCELTOCLOSE                                                              = 1131
  12368 	PSM_CHANGED                                                                    = 1128
  12369 	PSM_GETCURRENTPAGEHWND                                                         = 1142
  12370 	PSM_GETRESULT                                                                  = 1159
  12371 	PSM_GETTABCONTROL                                                              = 1140
  12372 	PSM_HWNDTOINDEX                                                                = 1153
  12373 	PSM_IDTOINDEX                                                                  = 1157
  12374 	PSM_INDEXTOHWND                                                                = 1154
  12375 	PSM_INDEXTOID                                                                  = 1158
  12376 	PSM_INDEXTOPAGE                                                                = 1156
  12377 	PSM_INSERTPAGE                                                                 = 1143
  12378 	PSM_ISDIALOGMESSAGE                                                            = 1141
  12379 	PSM_PAGETOINDEX                                                                = 1155
  12380 	PSM_PRESSBUTTON                                                                = 1137
  12381 	PSM_QUERYSIBLINGS                                                              = 1132
  12382 	PSM_REBOOTSYSTEM                                                               = 1130
  12383 	PSM_RECALCPAGESIZES                                                            = 1160
  12384 	PSM_REMOVEPAGE                                                                 = 1126
  12385 	PSM_RESTARTWINDOWS                                                             = 1129
  12386 	PSM_SETCURSEL                                                                  = 1125
  12387 	PSM_SETCURSELID                                                                = 1138
  12388 	PSM_SETFINISHTEXT                                                              = 1139
  12389 	PSM_SETFINISHTEXTA                                                             = 1139
  12390 	PSM_SETFINISHTEXTW                                                             = 1145
  12391 	PSM_SETHEADERSUBTITLE                                                          = 1151
  12392 	PSM_SETHEADERSUBTITLEA                                                         = 1151
  12393 	PSM_SETHEADERSUBTITLEW                                                         = 1152
  12394 	PSM_SETHEADERTITLE                                                             = 1149
  12395 	PSM_SETHEADERTITLEA                                                            = 1149
  12396 	PSM_SETHEADERTITLEW                                                            = 1150
  12397 	PSM_SETTITLE                                                                   = 1135
  12398 	PSM_SETTITLEA                                                                  = 1135
  12399 	PSM_SETTITLEW                                                                  = 1144
  12400 	PSM_SETWIZBUTTONS                                                              = 1136
  12401 	PSM_UNCHANGED                                                                  = 1133
  12402 	PSNRET_INVALID                                                                 = 1
  12403 	PSNRET_INVALID_NOCHANGEPAGE                                                    = 2
  12404 	PSNRET_MESSAGEHANDLED                                                          = 3
  12405 	PSNRET_NOERROR                                                                 = 0
  12406 	PSN_APPLY                                                                      = 18446744073709551414
  12407 	PSN_FIRST                                                                      = 18446744073709551416
  12408 	PSN_GETOBJECT                                                                  = 18446744073709551406
  12409 	PSN_HELP                                                                       = 18446744073709551411
  12410 	PSN_KILLACTIVE                                                                 = 18446744073709551415
  12411 	PSN_LAST                                                                       = 18446744073709551317
  12412 	PSN_QUERYCANCEL                                                                = 18446744073709551407
  12413 	PSN_QUERYINITIALFOCUS                                                          = 18446744073709551403
  12414 	PSN_RESET                                                                      = 18446744073709551413
  12415 	PSN_SETACTIVE                                                                  = 18446744073709551416
  12416 	PSN_TRANSLATEACCELERATOR                                                       = 18446744073709551404
  12417 	PSN_WIZBACK                                                                    = 18446744073709551410
  12418 	PSN_WIZFINISH                                                                  = 18446744073709551408
  12419 	PSN_WIZNEXT                                                                    = 18446744073709551409
  12420 	PSPCB_ADDREF                                                                   = 0
  12421 	PSPCB_CREATE                                                                   = 2
  12422 	PSPCB_RELEASE                                                                  = 1
  12423 	PSPROTOCOL_ASCII                                                               = 0
  12424 	PSPROTOCOL_BCP                                                                 = 1
  12425 	PSPROTOCOL_BINARY                                                              = 3
  12426 	PSPROTOCOL_TBCP                                                                = 2
  12427 	PSP_DEFAULT                                                                    = 0x00000000
  12428 	PSP_DLGINDIRECT                                                                = 0x00000001
  12429 	PSP_HASHELP                                                                    = 0x00000020
  12430 	PSP_HIDEHEADER                                                                 = 0x00000800
  12431 	PSP_PREMATURE                                                                  = 0x00000400
  12432 	PSP_RTLREADING                                                                 = 0x00000010
  12433 	PSP_USECALLBACK                                                                = 0x00000080
  12434 	PSP_USEFUSIONCONTEXT                                                           = 0x00004000
  12435 	PSP_USEHEADERSUBTITLE                                                          = 0x00002000
  12436 	PSP_USEHEADERTITLE                                                             = 0x00001000
  12437 	PSP_USEHICON                                                                   = 0x00000002
  12438 	PSP_USEICONID                                                                  = 0x00000004
  12439 	PSP_USEREFPARENT                                                               = 0x00000040
  12440 	PSP_USETITLE                                                                   = 0x00000008
  12441 	PSWIZB_BACK                                                                    = 0x00000001
  12442 	PSWIZB_DISABLEDFINISH                                                          = 0x00000008
  12443 	PSWIZB_FINISH                                                                  = 0x00000004
  12444 	PSWIZB_NEXT                                                                    = 0x00000002
  12445 	PS_ALTERNATE                                                                   = 8
  12446 	PS_COSMETIC                                                                    = 0x00000000
  12447 	PS_DASH                                                                        = 1
  12448 	PS_DASHDOT                                                                     = 3
  12449 	PS_DASHDOTDOT                                                                  = 4
  12450 	PS_DOT                                                                         = 2
  12451 	PS_ENDCAP_FLAT                                                                 = 0x00000200
  12452 	PS_ENDCAP_MASK                                                                 = 0x00000F00
  12453 	PS_ENDCAP_ROUND                                                                = 0x00000000
  12454 	PS_ENDCAP_SQUARE                                                               = 0x00000100
  12455 	PS_GEOMETRIC                                                                   = 0x00010000
  12456 	PS_INSIDEFRAME                                                                 = 6
  12457 	PS_JOIN_BEVEL                                                                  = 0x00001000
  12458 	PS_JOIN_MASK                                                                   = 0x0000F000
  12459 	PS_JOIN_MITER                                                                  = 0x00002000
  12460 	PS_JOIN_ROUND                                                                  = 0x00000000
  12461 	PS_NULL                                                                        = 5
  12462 	PS_OPENTYPE_FONTTYPE                                                           = 0x10000
  12463 	PS_SOLID                                                                       = 0
  12464 	PS_STYLE_MASK                                                                  = 0x0000000F
  12465 	PS_TYPE_MASK                                                                   = 0x000F0000
  12466 	PS_USERSTYLE                                                                   = 7
  12467 	PTF_INTKEY                                                                     = 0x01
  12468 	PTF_LEAF                                                                       = 0x08
  12469 	PTF_LEAFDATA                                                                   = 0x04
  12470 	PTF_ZERODATA                                                                   = 0x02
  12471 	PTRMAP_BTREE                                                                   = 5
  12472 	PTRMAP_FREEPAGE                                                                = 2
  12473 	PTRMAP_OVERFLOW1                                                               = 3
  12474 	PTRMAP_OVERFLOW2                                                               = 4
  12475 	PTRMAP_ROOTPAGE                                                                = 1
  12476 	PT_BEZIERTO                                                                    = 0x04
  12477 	PT_CLOSEFIGURE                                                                 = 0x01
  12478 	PT_LINETO                                                                      = 0x02
  12479 	PT_MOVETO                                                                      = 0x06
  12480 	PUBLICKEYBLOB                                                                  = 0x6
  12481 	PUBLICKEYBLOBEX                                                                = 0xa
  12482 	PURE                                                                           = 0
  12483 	PURGE_RXABORT                                                                  = 0x2
  12484 	PURGE_RXCLEAR                                                                  = 0x8
  12485 	PURGE_TXABORT                                                                  = 0x1
  12486 	PURGE_TXCLEAR                                                                  = 0x4
  12487 	PWR_CRITICALRESUME                                                             = 3
  12488 	PWR_FAIL                                                                       = -1
  12489 	PWR_OK                                                                         = 1
  12490 	PWR_SUSPENDREQUEST                                                             = 1
  12491 	PWR_SUSPENDRESUME                                                              = 2
  12492 	PW_CLIENTONLY                                                                  = 0x00000001
  12493 	P_DETACH                                                                       = 4
  12494 	P_NOWAIT                                                                       = 1
  12495 	P_NOWAITO                                                                      = 3
  12496 	P_OVERLAY                                                                      = 2
  12497 	P_WAIT                                                                         = 0
  12498 	PragFlg_NeedSchema                                                             = 0x01
  12499 	PragFlg_NoColumns                                                              = 0x02
  12500 	PragFlg_NoColumns1                                                             = 0x04
  12501 	PragFlg_ReadOnly                                                               = 0x08
  12502 	PragFlg_Result0                                                                = 0x10
  12503 	PragFlg_Result1                                                                = 0x20
  12504 	PragFlg_SchemaOpt                                                              = 0x40
  12505 	PragFlg_SchemaReq                                                              = 0x80
  12506 	PragTyp_ACTIVATE_EXTENSIONS                                                    = 0
  12507 	PragTyp_ANALYSIS_LIMIT                                                         = 1
  12508 	PragTyp_AUTO_VACUUM                                                            = 3
  12509 	PragTyp_BUSY_TIMEOUT                                                           = 5
  12510 	PragTyp_CACHE_SIZE                                                             = 6
  12511 	PragTyp_CACHE_SPILL                                                            = 7
  12512 	PragTyp_CASE_SENSITIVE_LIKE                                                    = 8
  12513 	PragTyp_COLLATION_LIST                                                         = 9
  12514 	PragTyp_COMPILE_OPTIONS                                                        = 10
  12515 	PragTyp_DATABASE_LIST                                                          = 12
  12516 	PragTyp_DATA_STORE_DIRECTORY                                                   = 11
  12517 	PragTyp_DEFAULT_CACHE_SIZE                                                     = 13
  12518 	PragTyp_ENCODING                                                               = 14
  12519 	PragTyp_FLAG                                                                   = 4
  12520 	PragTyp_FOREIGN_KEY_CHECK                                                      = 15
  12521 	PragTyp_FOREIGN_KEY_LIST                                                       = 16
  12522 	PragTyp_FUNCTION_LIST                                                          = 17
  12523 	PragTyp_HARD_HEAP_LIMIT                                                        = 18
  12524 	PragTyp_HEADER_VALUE                                                           = 2
  12525 	PragTyp_INCREMENTAL_VACUUM                                                     = 19
  12526 	PragTyp_INDEX_INFO                                                             = 20
  12527 	PragTyp_INDEX_LIST                                                             = 21
  12528 	PragTyp_INTEGRITY_CHECK                                                        = 22
  12529 	PragTyp_JOURNAL_MODE                                                           = 23
  12530 	PragTyp_JOURNAL_SIZE_LIMIT                                                     = 24
  12531 	PragTyp_LOCKING_MODE                                                           = 26
  12532 	PragTyp_LOCK_PROXY_FILE                                                        = 25
  12533 	PragTyp_LOCK_STATUS                                                            = 44
  12534 	PragTyp_MMAP_SIZE                                                              = 28
  12535 	PragTyp_MODULE_LIST                                                            = 29
  12536 	PragTyp_OPTIMIZE                                                               = 30
  12537 	PragTyp_PAGE_COUNT                                                             = 27
  12538 	PragTyp_PAGE_SIZE                                                              = 31
  12539 	PragTyp_PRAGMA_LIST                                                            = 32
  12540 	PragTyp_SECURE_DELETE                                                          = 33
  12541 	PragTyp_SHRINK_MEMORY                                                          = 34
  12542 	PragTyp_SOFT_HEAP_LIMIT                                                        = 35
  12543 	PragTyp_STATS                                                                  = 45
  12544 	PragTyp_SYNCHRONOUS                                                            = 36
  12545 	PragTyp_TABLE_INFO                                                             = 37
  12546 	PragTyp_TABLE_LIST                                                             = 38
  12547 	PragTyp_TEMP_STORE                                                             = 39
  12548 	PragTyp_TEMP_STORE_DIRECTORY                                                   = 40
  12549 	PragTyp_THREADS                                                                = 41
  12550 	PragTyp_WAL_AUTOCHECKPOINT                                                     = 42
  12551 	PragTyp_WAL_CHECKPOINT                                                         = 43
  12552 	QDI_DIBTOSCREEN                                                                = 4
  12553 	QDI_GETDIBITS                                                                  = 2
  12554 	QDI_SETDIBITS                                                                  = 1
  12555 	QDI_STRETCHDIB                                                                 = 8
  12556 	QID_SYNC                                                                       = 0xFFFFFFFF
  12557 	QS_ALLEVENTS                                                                   = 1215
  12558 	QS_ALLINPUT                                                                    = 1279
  12559 	QS_ALLPOSTMESSAGE                                                              = 0x0100
  12560 	QS_HOTKEY                                                                      = 0x0080
  12561 	QS_INPUT                                                                       = 1031
  12562 	QS_KEY                                                                         = 0x0001
  12563 	QS_MOUSE                                                                       = 6
  12564 	QS_MOUSEBUTTON                                                                 = 0x0004
  12565 	QS_MOUSEMOVE                                                                   = 0x0002
  12566 	QS_PAINT                                                                       = 0x0020
  12567 	QS_POSTMESSAGE                                                                 = 0x0008
  12568 	QS_RAWINPUT                                                                    = 0x0400
  12569 	QS_SENDMESSAGE                                                                 = 0x0040
  12570 	QS_TIMER                                                                       = 0x0010
  12571 	QUERYDIBSUPPORT                                                                = 3073
  12572 	QUERYESCSUPPORT                                                                = 8
  12573 	QUERYROPSUPPORT                                                                = 40
  12574 	QUERY_ACTCTX_FLAG_ACTCTX_IS_ADDRESS                                            = 16
  12575 	QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE                                            = 8
  12576 	QUERY_ACTCTX_FLAG_NO_ADDREF                                                    = 2147483648
  12577 	QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX                                            = 4
  12578 	QUOTA_LIMITS_HARDWS_MAX_DISABLE                                                = 0x00000008
  12579 	QUOTA_LIMITS_HARDWS_MAX_ENABLE                                                 = 0x00000004
  12580 	QUOTA_LIMITS_HARDWS_MIN_DISABLE                                                = 0x00000002
  12581 	QUOTA_LIMITS_HARDWS_MIN_ENABLE                                                 = 0x00000001
  12582 	QUOTA_LIMITS_USE_DEFAULT_LIMITS                                                = 0x00000010
  12583 	R2_BLACK                                                                       = 1
  12584 	R2_COPYPEN                                                                     = 13
  12585 	R2_LAST                                                                        = 16
  12586 	R2_MASKNOTPEN                                                                  = 3
  12587 	R2_MASKPEN                                                                     = 9
  12588 	R2_MASKPENNOT                                                                  = 5
  12589 	R2_MERGENOTPEN                                                                 = 12
  12590 	R2_MERGEPEN                                                                    = 15
  12591 	R2_MERGEPENNOT                                                                 = 14
  12592 	R2_NOP                                                                         = 11
  12593 	R2_NOT                                                                         = 6
  12594 	R2_NOTCOPYPEN                                                                  = 4
  12595 	R2_NOTMASKPEN                                                                  = 8
  12596 	R2_NOTMERGEPEN                                                                 = 2
  12597 	R2_NOTXORPEN                                                                   = 10
  12598 	R2_WHITE                                                                       = 16
  12599 	R2_XORPEN                                                                      = 7
  12600 	RANDOM_PADDING                                                                 = 2
  12601 	RAND_MAX                                                                       = 0x7fff
  12602 	RASTERCAPS                                                                     = 38
  12603 	RASTER_FONTTYPE                                                                = 0x0001
  12604 	RBU_CREATE_STATE                                                               = "CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)"
  12605 	RBU_DELETE                                                                     = 2
  12606 	RBU_ENABLE_DELTA_CKSUM                                                         = 0
  12607 	RBU_EXCLUSIVE_CHECKPOINT                                                       = "rbu_exclusive_checkpoint"
  12608 	RBU_IDX_DELETE                                                                 = 4
  12609 	RBU_IDX_INSERT                                                                 = 5
  12610 	RBU_INSERT                                                                     = 1
  12611 	RBU_PK_EXTERNAL                                                                = 3
  12612 	RBU_PK_IPK                                                                     = 2
  12613 	RBU_PK_NONE                                                                    = 1
  12614 	RBU_PK_NOTABLE                                                                 = 0
  12615 	RBU_PK_VTAB                                                                    = 5
  12616 	RBU_PK_WITHOUT_ROWID                                                           = 4
  12617 	RBU_REPLACE                                                                    = 3
  12618 	RBU_STAGE_CAPTURE                                                              = 3
  12619 	RBU_STAGE_CKPT                                                                 = 4
  12620 	RBU_STAGE_DONE                                                                 = 5
  12621 	RBU_STAGE_MOVE                                                                 = 2
  12622 	RBU_STAGE_OAL                                                                  = 1
  12623 	RBU_STATE_CKPT                                                                 = 6
  12624 	RBU_STATE_COOKIE                                                               = 7
  12625 	RBU_STATE_DATATBL                                                              = 10
  12626 	RBU_STATE_IDX                                                                  = 3
  12627 	RBU_STATE_OALSZ                                                                = 8
  12628 	RBU_STATE_PHASEONESTEP                                                         = 9
  12629 	RBU_STATE_PROGRESS                                                             = 5
  12630 	RBU_STATE_ROW                                                                  = 4
  12631 	RBU_STATE_STAGE                                                                = 1
  12632 	RBU_STATE_TBL                                                                  = 2
  12633 	RBU_UPDATE                                                                     = 6
  12634 	RC_BANDING                                                                     = 2
  12635 	RC_BIGFONT                                                                     = 0x0400
  12636 	RC_BITBLT                                                                      = 1
  12637 	RC_BITMAP64                                                                    = 8
  12638 	RC_DEVBITS                                                                     = 0x8000
  12639 	RC_DIBTODEV                                                                    = 0x0200
  12640 	RC_DI_BITMAP                                                                   = 0x0080
  12641 	RC_FLOODFILL                                                                   = 0x1000
  12642 	RC_GDI20_OUTPUT                                                                = 0x0010
  12643 	RC_GDI20_STATE                                                                 = 0x0020
  12644 	RC_NONE                                                                        = 0
  12645 	RC_OP_DX_OUTPUT                                                                = 0x4000
  12646 	RC_PALETTE                                                                     = 0x0100
  12647 	RC_SAVEBITMAP                                                                  = 0x0040
  12648 	RC_SCALING                                                                     = 4
  12649 	RC_STRETCHBLT                                                                  = 0x0800
  12650 	RC_STRETCHDIB                                                                  = 0x2000
  12651 	RDH_RECTANGLES                                                                 = 1
  12652 	RDW_ALLCHILDREN                                                                = 0x0080
  12653 	RDW_ERASE                                                                      = 0x0004
  12654 	RDW_ERASENOW                                                                   = 0x0200
  12655 	RDW_FRAME                                                                      = 0x0400
  12656 	RDW_INTERNALPAINT                                                              = 0x0002
  12657 	RDW_INVALIDATE                                                                 = 0x0001
  12658 	RDW_NOCHILDREN                                                                 = 0x0040
  12659 	RDW_NOERASE                                                                    = 0x0020
  12660 	RDW_NOFRAME                                                                    = 0x0800
  12661 	RDW_NOINTERNALPAINT                                                            = 0x0010
  12662 	RDW_UPDATENOW                                                                  = 0x0100
  12663 	RDW_VALIDATE                                                                   = 0x0008
  12664 	READMARK_NOT_USED                                                              = 0xffffffff
  12665 	READ_ATTRIBUTES                                                                = 0xD0
  12666 	READ_ATTRIBUTE_BUFFER_SIZE                                                     = 512
  12667 	READ_COMPRESSION_INFO_VALID                                                    = 0x00000020
  12668 	READ_CONTROL                                                                   = 131072
  12669 	READ_LOCK                                                                      = 1
  12670 	READ_THREAD_PROFILING_FLAG_DISPATCHING                                         = 0x00000001
  12671 	READ_THREAD_PROFILING_FLAG_HARDWARE_COUNTERS                                   = 0x00000002
  12672 	READ_THRESHOLDS                                                                = 0xD1
  12673 	READ_THRESHOLD_BUFFER_SIZE                                                     = 512
  12674 	REALTIME_PRIORITY_CLASS                                                        = 0x100
  12675 	REASON_HWINSTALL                                                               = 65538
  12676 	REASON_LEGACY_API                                                              = 2147942400
  12677 	REASON_OTHER                                                                   = 0
  12678 	REASON_PLANNED_FLAG                                                            = 2147483648
  12679 	REASON_SERVICEHANG                                                             = 196613
  12680 	REASON_SWHWRECONF                                                              = 196612
  12681 	REASON_SWINSTALL                                                               = 196610
  12682 	REASON_UNKNOWN                                                                 = 255
  12683 	REASON_UNSTABLE                                                                = 327686
  12684 	RECOVERED_READS_VALID                                                          = 0x00000004
  12685 	RECOVERED_WRITES_VALID                                                         = 0x00000001
  12686 	RECOVERY_DEFAULT_PING_INTERVAL                                                 = 5000
  12687 	RECOVERY_MAX_PING_INTERVAL                                                     = 300000
  12688 	REGDB_E_FIRST                                                                  = 2147746128
  12689 	REGDB_E_LAST                                                                   = 2147746143
  12690 	REGDB_S_FIRST                                                                  = 262480
  12691 	REGDB_S_LAST                                                                   = 262495
  12692 	REGISTERED                                                                     = 0x04
  12693 	REGISTERING                                                                    = 0x00
  12694 	REGULAR_FONTTYPE                                                               = 0x400
  12695 	REG_APP_HIVE                                                                   = 16
  12696 	REG_BINARY                                                                     = 3
  12697 	REG_BOOT_HIVE                                                                  = 1024
  12698 	REG_CREATED_NEW_KEY                                                            = 1
  12699 	REG_DWORD                                                                      = 4
  12700 	REG_DWORD_BIG_ENDIAN                                                           = 5
  12701 	REG_DWORD_LITTLE_ENDIAN                                                        = 4
  12702 	REG_EXPAND_SZ                                                                  = 2
  12703 	REG_FORCE_RESTORE                                                              = 8
  12704 	REG_FORCE_UNLOAD                                                               = 1
  12705 	REG_FULL_RESOURCE_DESCRIPTOR                                                   = 9
  12706 	REG_HIVE_EXACT_FILE_GROWTH                                                     = 128
  12707 	REG_HIVE_NO_RM                                                                 = 256
  12708 	REG_HIVE_SINGLE_LOG                                                            = 512
  12709 	REG_LATEST_FORMAT                                                              = 2
  12710 	REG_LEGAL_CHANGE_FILTER                                                        = 268435471
  12711 	REG_LEGAL_OPTION                                                               = 15
  12712 	REG_LINK                                                                       = 6
  12713 	REG_MUI_STRING_TRUNCATE                                                        = 0x00000001
  12714 	REG_MULTI_SZ                                                                   = 7
  12715 	REG_NONE                                                                       = 0
  12716 	REG_NOTIFY_CHANGE_ATTRIBUTES                                                   = 2
  12717 	REG_NOTIFY_CHANGE_LAST_SET                                                     = 4
  12718 	REG_NOTIFY_CHANGE_NAME                                                         = 1
  12719 	REG_NOTIFY_CHANGE_SECURITY                                                     = 8
  12720 	REG_NOTIFY_THREAD_AGNOSTIC                                                     = 268435456
  12721 	REG_NO_COMPRESSION                                                             = 4
  12722 	REG_NO_LAZY_FLUSH                                                              = 4
  12723 	REG_OPENED_EXISTING_KEY                                                        = 2
  12724 	REG_OPTION_BACKUP_RESTORE                                                      = 4
  12725 	REG_OPTION_CREATE_LINK                                                         = 2
  12726 	REG_OPTION_NON_VOLATILE                                                        = 0
  12727 	REG_OPTION_OPEN_LINK                                                           = 8
  12728 	REG_OPTION_RESERVED                                                            = 0
  12729 	REG_OPTION_VOLATILE                                                            = 1
  12730 	REG_PROCESS_APPKEY                                                             = 0x00000001
  12731 	REG_PROCESS_PRIVATE                                                            = 32
  12732 	REG_QWORD                                                                      = 11
  12733 	REG_QWORD_LITTLE_ENDIAN                                                        = 11
  12734 	REG_REFRESH_HIVE                                                               = 2
  12735 	REG_RESOURCE_LIST                                                              = 8
  12736 	REG_RESOURCE_REQUIREMENTS_LIST                                                 = 10
  12737 	REG_SECURE_CONNECTION                                                          = 1
  12738 	REG_STANDARD_FORMAT                                                            = 1
  12739 	REG_START_JOURNAL                                                              = 64
  12740 	REG_SZ                                                                         = 1
  12741 	REG_WHOLE_HIVE_VOLATILE                                                        = 1
  12742 	RELATIVE                                                                       = 2
  12743 	REMOTE_NAME_INFO_LEVEL                                                         = 0x00000002
  12744 	REPLACEDLGORD                                                                  = 1541
  12745 	REPLACEFILE_IGNORE_MERGE_ERRORS                                                = 0x2
  12746 	REPLACEFILE_WRITE_THROUGH                                                      = 0x1
  12747 	REPLACE_ALTERNATE                                                              = 0xB
  12748 	REPLACE_PRIMARY                                                                = 0xA
  12749 	REPORT_NOT_ABLE_TO_EXPORT_PRIVATE_KEY                                          = 0x2
  12750 	REPORT_NO_PRIVATE_KEY                                                          = 0x1
  12751 	RESERVED_LOCK                                                                  = 2
  12752 	RESETDEV                                                                       = 7
  12753 	RESOURCEDISPLAYTYPE_DIRECTORY                                                  = 0x00000009
  12754 	RESOURCEDISPLAYTYPE_DOMAIN                                                     = 0x00000001
  12755 	RESOURCEDISPLAYTYPE_FILE                                                       = 0x00000004
  12756 	RESOURCEDISPLAYTYPE_GENERIC                                                    = 0x00000000
  12757 	RESOURCEDISPLAYTYPE_GROUP                                                      = 0x00000005
  12758 	RESOURCEDISPLAYTYPE_NDSCONTAINER                                               = 0x0000000b
  12759 	RESOURCEDISPLAYTYPE_NETWORK                                                    = 0x00000006
  12760 	RESOURCEDISPLAYTYPE_ROOT                                                       = 0x00000007
  12761 	RESOURCEDISPLAYTYPE_SERVER                                                     = 0x00000002
  12762 	RESOURCEDISPLAYTYPE_SHARE                                                      = 0x00000003
  12763 	RESOURCEDISPLAYTYPE_SHAREADMIN                                                 = 0x00000008
  12764 	RESOURCEDISPLAYTYPE_TREE                                                       = 0x0000000a
  12765 	RESOURCEMANAGER_ALL_ACCESS                                                     = 2031743
  12766 	RESOURCEMANAGER_COMPLETE_PROPAGATION                                           = 64
  12767 	RESOURCEMANAGER_ENLIST                                                         = 8
  12768 	RESOURCEMANAGER_GENERIC_EXECUTE                                                = 1179740
  12769 	RESOURCEMANAGER_GENERIC_READ                                                   = 1179649
  12770 	RESOURCEMANAGER_GENERIC_WRITE                                                  = 1179774
  12771 	RESOURCEMANAGER_GET_NOTIFICATION                                               = 16
  12772 	RESOURCEMANAGER_QUERY_INFORMATION                                              = 1
  12773 	RESOURCEMANAGER_RECOVER                                                        = 4
  12774 	RESOURCEMANAGER_REGISTER_PROTOCOL                                              = 32
  12775 	RESOURCEMANAGER_SET_INFORMATION                                                = 2
  12776 	RESOURCETYPE_ANY                                                               = 0x00000000
  12777 	RESOURCETYPE_DISK                                                              = 0x00000001
  12778 	RESOURCETYPE_PRINT                                                             = 0x00000002
  12779 	RESOURCETYPE_RESERVED                                                          = 0x00000008
  12780 	RESOURCETYPE_UNKNOWN                                                           = 0xFFFFFFFF
  12781 	RESOURCEUSAGE_ALL                                                              = 19
  12782 	RESOURCEUSAGE_ATTACHED                                                         = 0x00000010
  12783 	RESOURCEUSAGE_CONNECTABLE                                                      = 0x00000001
  12784 	RESOURCEUSAGE_CONTAINER                                                        = 0x00000002
  12785 	RESOURCEUSAGE_NOLOCALDEVICE                                                    = 0x00000004
  12786 	RESOURCEUSAGE_RESERVED                                                         = 0x80000000
  12787 	RESOURCEUSAGE_SIBLING                                                          = 0x00000008
  12788 	RESOURCE_CONNECTED                                                             = 0x00000001
  12789 	RESOURCE_CONTEXT                                                               = 0x00000005
  12790 	RESOURCE_ENUM_LN                                                               = 1
  12791 	RESOURCE_ENUM_MODULE_EXACT                                                     = 16
  12792 	RESOURCE_ENUM_MUI                                                              = 2
  12793 	RESOURCE_ENUM_MUI_SYSTEM                                                       = 4
  12794 	RESOURCE_ENUM_VALIDATE                                                         = 8
  12795 	RESOURCE_GLOBALNET                                                             = 0x00000002
  12796 	RESOURCE_MANAGER_COMMUNICATION                                                 = 0x00000002
  12797 	RESOURCE_MANAGER_MAXIMUM_OPTION                                                = 0x00000003
  12798 	RESOURCE_MANAGER_VOLATILE                                                      = 0x00000001
  12799 	RESOURCE_RECENT                                                                = 0x00000004
  12800 	RESOURCE_REMEMBERED                                                            = 0x00000003
  12801 	RESTART_MAX_CMD_LINE                                                           = 1024
  12802 	RESTART_NO_CRASH                                                               = 1
  12803 	RESTART_NO_HANG                                                                = 2
  12804 	RESTART_NO_PATCH                                                               = 4
  12805 	RESTART_NO_REBOOT                                                              = 8
  12806 	RESTORE_CTM                                                                    = 4100
  12807 	RESTRICTED_POINTER                                                             = 0
  12808 	RES_CURSOR                                                                     = 2
  12809 	RES_ICON                                                                       = 1
  12810 	RETRACT_IEPORT                                                                 = 3
  12811 	RETURNING_TRIGGER_NAME                                                         = "sqlite_returning"
  12812 	RETURN_SMART_STATUS                                                            = 0xDA
  12813 	REVERSE_PRINT                                                                  = 0x00000001
  12814 	REVISION_LENGTH                                                                = 4
  12815 	RGN_AND                                                                        = 1
  12816 	RGN_COPY                                                                       = 5
  12817 	RGN_DIFF                                                                       = 4
  12818 	RGN_ERROR                                                                      = 0
  12819 	RGN_MAX                                                                        = 5
  12820 	RGN_MIN                                                                        = 1
  12821 	RGN_OR                                                                         = 2
  12822 	RGN_XOR                                                                        = 3
  12823 	RIDEV_APPKEYS                                                                  = 0x00000400
  12824 	RIDEV_CAPTUREMOUSE                                                             = 0x00000200
  12825 	RIDEV_DEVNOTIFY                                                                = 0x00002000
  12826 	RIDEV_EXCLUDE                                                                  = 0x00000010
  12827 	RIDEV_EXINPUTSINK                                                              = 0x00001000
  12828 	RIDEV_EXMODEMASK                                                               = 0x000000F0
  12829 	RIDEV_INPUTSINK                                                                = 0x00000100
  12830 	RIDEV_NOHOTKEYS                                                                = 0x00000200
  12831 	RIDEV_NOLEGACY                                                                 = 0x00000030
  12832 	RIDEV_PAGEONLY                                                                 = 0x00000020
  12833 	RIDEV_REMOVE                                                                   = 0x00000001
  12834 	RIDI_DEVICEINFO                                                                = 0x2000000b
  12835 	RIDI_DEVICENAME                                                                = 0x20000007
  12836 	RIDI_PREPARSEDDATA                                                             = 0x20000005
  12837 	RID_HEADER                                                                     = 0x10000005
  12838 	RID_INPUT                                                                      = 0x10000003
  12839 	RIGHTMOST_BUTTON_PRESSED                                                       = 0x2
  12840 	RIGHT_ALT_PRESSED                                                              = 0x1
  12841 	RIGHT_CTRL_PRESSED                                                             = 0x4
  12842 	RIM_INPUT                                                                      = 0
  12843 	RIM_INPUTSINK                                                                  = 1
  12844 	RIM_TYPEHID                                                                    = 2
  12845 	RIM_TYPEKEYBOARD                                                               = 1
  12846 	RIM_TYPEMAX                                                                    = 2
  12847 	RIM_TYPEMOUSE                                                                  = 0
  12848 	RIP_EVENT                                                                      = 9
  12849 	RI_KEY_BREAK                                                                   = 1
  12850 	RI_KEY_E0                                                                      = 2
  12851 	RI_KEY_E1                                                                      = 4
  12852 	RI_KEY_MAKE                                                                    = 0
  12853 	RI_KEY_TERMSRV_SET_LED                                                         = 8
  12854 	RI_KEY_TERMSRV_SHADOW                                                          = 0x10
  12855 	RI_MOUSE_BUTTON_1_DOWN                                                         = 1
  12856 	RI_MOUSE_BUTTON_1_UP                                                           = 2
  12857 	RI_MOUSE_BUTTON_2_DOWN                                                         = 4
  12858 	RI_MOUSE_BUTTON_2_UP                                                           = 8
  12859 	RI_MOUSE_BUTTON_3_DOWN                                                         = 16
  12860 	RI_MOUSE_BUTTON_3_UP                                                           = 32
  12861 	RI_MOUSE_BUTTON_4_DOWN                                                         = 0x0040
  12862 	RI_MOUSE_BUTTON_4_UP                                                           = 0x0080
  12863 	RI_MOUSE_BUTTON_5_DOWN                                                         = 0x0100
  12864 	RI_MOUSE_BUTTON_5_UP                                                           = 0x0200
  12865 	RI_MOUSE_LEFT_BUTTON_DOWN                                                      = 0x0001
  12866 	RI_MOUSE_LEFT_BUTTON_UP                                                        = 0x0002
  12867 	RI_MOUSE_MIDDLE_BUTTON_DOWN                                                    = 0x0010
  12868 	RI_MOUSE_MIDDLE_BUTTON_UP                                                      = 0x0020
  12869 	RI_MOUSE_RIGHT_BUTTON_DOWN                                                     = 0x0004
  12870 	RI_MOUSE_RIGHT_BUTTON_UP                                                       = 0x0008
  12871 	RI_MOUSE_WHEEL                                                                 = 0x0400
  12872 	RNDAWAY                                                                        = 0
  12873 	RNDTOWARDS                                                                     = 0
  12874 	ROTFLAGS_ALLOWANYCLIENT                                                        = 0x2
  12875 	ROTFLAGS_REGISTRATIONKEEPSALIVE                                                = 0x1
  12876 	ROTREGFLAGS_ALLOWANYCLIENT                                                     = 0x1
  12877 	ROT_COMPARE_MAX                                                                = 2048
  12878 	ROWSET_ALLOCATION_SIZE                                                         = 1024
  12879 	ROWSET_NEXT                                                                    = 0x02
  12880 	ROWSET_SORTED                                                                  = 0x01
  12881 	RPCFLG_ASYNCHRONOUS                                                            = 1073741824
  12882 	RPCFLG_AUTO_COMPLETE                                                           = 134217728
  12883 	RPCFLG_HAS_CALLBACK                                                            = 67108864
  12884 	RPCFLG_HAS_MULTI_SYNTAXES                                                      = 33554432
  12885 	RPCFLG_INPUT_SYNCHRONOUS                                                       = 536870912
  12886 	RPCFLG_LOCAL_CALL                                                              = 268435456
  12887 	RPCFLG_MESSAGE                                                                 = 16777216
  12888 	RPCFLG_NON_NDR                                                                 = 2147483648
  12889 	RPC_BUFFER_ASYNC                                                               = 0x00008000
  12890 	RPC_BUFFER_COMPLETE                                                            = 0x00001000
  12891 	RPC_BUFFER_EXTRA                                                               = 0x00004000
  12892 	RPC_BUFFER_NONOTIFY                                                            = 0x00010000
  12893 	RPC_BUFFER_PARTIAL                                                             = 0x00002000
  12894 	RPC_CALL_ATTRIBUTES_VERSION                                                    = 1
  12895 	RPC_CONTEXT_HANDLE_DEFAULT_FLAGS                                               = 0
  12896 	RPC_CONTEXT_HANDLE_DONT_SERIALIZE                                              = 536870912
  12897 	RPC_CONTEXT_HANDLE_FLAGS                                                       = 805306368
  12898 	RPC_CONTEXT_HANDLE_SERIALIZE                                                   = 268435456
  12899 	RPC_C_AUTHN_DCE_PRIVATE                                                        = 1
  12900 	RPC_C_AUTHN_DCE_PUBLIC                                                         = 2
  12901 	RPC_C_AUTHN_DEC_PUBLIC                                                         = 4
  12902 	RPC_C_AUTHN_DEFAULT                                                            = 4294967295
  12903 	RPC_C_AUTHN_DIGEST                                                             = 21
  12904 	RPC_C_AUTHN_DPA                                                                = 17
  12905 	RPC_C_AUTHN_GSS_KERBEROS                                                       = 16
  12906 	RPC_C_AUTHN_GSS_NEGOTIATE                                                      = 9
  12907 	RPC_C_AUTHN_GSS_SCHANNEL                                                       = 14
  12908 	RPC_C_AUTHN_INFO_TYPE_HTTP                                                     = 1
  12909 	RPC_C_AUTHN_LEVEL_CALL                                                         = 3
  12910 	RPC_C_AUTHN_LEVEL_CONNECT                                                      = 2
  12911 	RPC_C_AUTHN_LEVEL_DEFAULT                                                      = 0
  12912 	RPC_C_AUTHN_LEVEL_NONE                                                         = 1
  12913 	RPC_C_AUTHN_LEVEL_PKT                                                          = 4
  12914 	RPC_C_AUTHN_LEVEL_PKT_INTEGRITY                                                = 5
  12915 	RPC_C_AUTHN_LEVEL_PKT_PRIVACY                                                  = 6
  12916 	RPC_C_AUTHN_MQ                                                                 = 100
  12917 	RPC_C_AUTHN_MSN                                                                = 18
  12918 	RPC_C_AUTHN_NONE                                                               = 0
  12919 	RPC_C_AUTHN_WINNT                                                              = 10
  12920 	RPC_C_AUTHZ_DCE                                                                = 2
  12921 	RPC_C_AUTHZ_DEFAULT                                                            = 0xffffffff
  12922 	RPC_C_AUTHZ_NAME                                                               = 1
  12923 	RPC_C_AUTHZ_NONE                                                               = 0
  12924 	RPC_C_BINDING_DEFAULT_TIMEOUT                                                  = 5
  12925 	RPC_C_BINDING_INFINITE_TIMEOUT                                                 = 10
  12926 	RPC_C_BINDING_MAX_TIMEOUT                                                      = 9
  12927 	RPC_C_BINDING_MIN_TIMEOUT                                                      = 0
  12928 	RPC_C_BIND_TO_ALL_NICS                                                         = 1
  12929 	RPC_C_CANCEL_INFINITE_TIMEOUT                                                  = -1
  12930 	RPC_C_DONT_FAIL                                                                = 0x4
  12931 	RPC_C_EP_ALL_ELTS                                                              = 0
  12932 	RPC_C_EP_MATCH_BY_BOTH                                                         = 3
  12933 	RPC_C_EP_MATCH_BY_IF                                                           = 1
  12934 	RPC_C_EP_MATCH_BY_OBJ                                                          = 2
  12935 	RPC_C_FULL_CERT_CHAIN                                                          = 0x0001
  12936 	RPC_C_HTTP_AUTHN_SCHEME_BASIC                                                  = 0x00000001
  12937 	RPC_C_HTTP_AUTHN_SCHEME_CERT                                                   = 0x00010000
  12938 	RPC_C_HTTP_AUTHN_SCHEME_DIGEST                                                 = 0x00000008
  12939 	RPC_C_HTTP_AUTHN_SCHEME_NEGOTIATE                                              = 0x00000010
  12940 	RPC_C_HTTP_AUTHN_SCHEME_NTLM                                                   = 0x00000002
  12941 	RPC_C_HTTP_AUTHN_SCHEME_PASSPORT                                               = 0x00000004
  12942 	RPC_C_HTTP_AUTHN_TARGET_PROXY                                                  = 2
  12943 	RPC_C_HTTP_AUTHN_TARGET_SERVER                                                 = 1
  12944 	RPC_C_HTTP_FLAG_IGNORE_CERT_CN_INVALID                                         = 8
  12945 	RPC_C_HTTP_FLAG_USE_FIRST_AUTH_SCHEME                                          = 2
  12946 	RPC_C_HTTP_FLAG_USE_SSL                                                        = 1
  12947 	RPC_C_IMP_LEVEL_ANONYMOUS                                                      = 1
  12948 	RPC_C_IMP_LEVEL_DEFAULT                                                        = 0
  12949 	RPC_C_IMP_LEVEL_DELEGATE                                                       = 4
  12950 	RPC_C_IMP_LEVEL_IDENTIFY                                                       = 2
  12951 	RPC_C_IMP_LEVEL_IMPERSONATE                                                    = 3
  12952 	RPC_C_INFINITE_TIMEOUT                                                         = 4294967295
  12953 	RPC_C_LISTEN_MAX_CALLS_DEFAULT                                                 = 1234
  12954 	RPC_C_MGMT_INQ_IF_IDS                                                          = 0
  12955 	RPC_C_MGMT_INQ_PRINC_NAME                                                      = 1
  12956 	RPC_C_MGMT_INQ_STATS                                                           = 2
  12957 	RPC_C_MGMT_IS_SERVER_LISTEN                                                    = 3
  12958 	RPC_C_MGMT_STOP_SERVER_LISTEN                                                  = 4
  12959 	RPC_C_MQ_AUTHN_LEVEL_NONE                                                      = 0x0000
  12960 	RPC_C_MQ_AUTHN_LEVEL_PKT_INTEGRITY                                             = 0x0008
  12961 	RPC_C_MQ_AUTHN_LEVEL_PKT_PRIVACY                                               = 0x0010
  12962 	RPC_C_MQ_CLEAR_ON_OPEN                                                         = 0x0002
  12963 	RPC_C_MQ_EXPRESS                                                               = 0
  12964 	RPC_C_MQ_JOURNAL_ALWAYS                                                        = 2
  12965 	RPC_C_MQ_JOURNAL_DEADLETTER                                                    = 1
  12966 	RPC_C_MQ_JOURNAL_NONE                                                          = 0
  12967 	RPC_C_MQ_PERMANENT                                                             = 0x0001
  12968 	RPC_C_MQ_RECOVERABLE                                                           = 1
  12969 	RPC_C_MQ_TEMPORARY                                                             = 0x0000
  12970 	RPC_C_MQ_USE_EXISTING_SECURITY                                                 = 0x0004
  12971 	RPC_C_NOTIFY_ON_SEND_COMPLETE                                                  = 0x1
  12972 	RPC_C_NS_DEFAULT_EXP_AGE                                                       = -1
  12973 	RPC_C_NS_SYNTAX_DCE                                                            = 3
  12974 	RPC_C_NS_SYNTAX_DEFAULT                                                        = 0
  12975 	RPC_C_OPT_BINDING_NONCAUSAL                                                    = 9
  12976 	RPC_C_OPT_CALL_TIMEOUT                                                         = 12
  12977 	RPC_C_OPT_DONT_LINGER                                                          = 13
  12978 	RPC_C_OPT_MAX_OPTIONS                                                          = 14
  12979 	RPC_C_OPT_MQ_ACKNOWLEDGE                                                       = 4
  12980 	RPC_C_OPT_MQ_AUTHN_LEVEL                                                       = 6
  12981 	RPC_C_OPT_MQ_AUTHN_SERVICE                                                     = 5
  12982 	RPC_C_OPT_MQ_DELIVERY                                                          = 1
  12983 	RPC_C_OPT_MQ_JOURNAL                                                           = 3
  12984 	RPC_C_OPT_MQ_PRIORITY                                                          = 2
  12985 	RPC_C_OPT_MQ_TIME_TO_BE_RECEIVED                                               = 8
  12986 	RPC_C_OPT_MQ_TIME_TO_REACH_QUEUE                                               = 7
  12987 	RPC_C_OPT_SECURITY_CALLBACK                                                    = 10
  12988 	RPC_C_OPT_UNIQUE_BINDING                                                       = 11
  12989 	RPC_C_PARM_BUFFER_LENGTH                                                       = 2
  12990 	RPC_C_PARM_MAX_PACKET_LENGTH                                                   = 1
  12991 	RPC_C_PROFILE_ALL_ELT                                                          = 1
  12992 	RPC_C_PROFILE_ALL_ELTS                                                         = 1
  12993 	RPC_C_PROFILE_DEFAULT_ELT                                                      = 0
  12994 	RPC_C_PROFILE_MATCH_BY_BOTH                                                    = 4
  12995 	RPC_C_PROFILE_MATCH_BY_IF                                                      = 2
  12996 	RPC_C_PROFILE_MATCH_BY_MBR                                                     = 3
  12997 	RPC_C_PROTECT_LEVEL_CALL                                                       = 3
  12998 	RPC_C_PROTECT_LEVEL_CONNECT                                                    = 2
  12999 	RPC_C_PROTECT_LEVEL_DEFAULT                                                    = 0
  13000 	RPC_C_PROTECT_LEVEL_NONE                                                       = 1
  13001 	RPC_C_PROTECT_LEVEL_PKT                                                        = 4
  13002 	RPC_C_PROTECT_LEVEL_PKT_INTEGRITY                                              = 5
  13003 	RPC_C_PROTECT_LEVEL_PKT_PRIVACY                                                = 6
  13004 	RPC_C_PROTSEQ_MAX_REQS_DEFAULT                                                 = 10
  13005 	RPC_C_QOS_CAPABILITIES_ANY_AUTHORITY                                           = 0x4
  13006 	RPC_C_QOS_CAPABILITIES_DEFAULT                                                 = 0x0
  13007 	RPC_C_QOS_CAPABILITIES_IGNORE_DELEGATE_FAILURE                                 = 0x8
  13008 	RPC_C_QOS_CAPABILITIES_LOCAL_MA_HINT                                           = 0x10
  13009 	RPC_C_QOS_CAPABILITIES_MAKE_FULLSIC                                            = 0x2
  13010 	RPC_C_QOS_CAPABILITIES_MUTUAL_AUTH                                             = 0x1
  13011 	RPC_C_QOS_IDENTITY_DYNAMIC                                                     = 1
  13012 	RPC_C_QOS_IDENTITY_STATIC                                                      = 0
  13013 	RPC_C_SECURITY_QOS_VERSION                                                     = 1
  13014 	RPC_C_SECURITY_QOS_VERSION_1                                                   = 1
  13015 	RPC_C_SECURITY_QOS_VERSION_2                                                   = 2
  13016 	RPC_C_SECURITY_QOS_VERSION_3                                                   = 3
  13017 	RPC_C_STATS_CALLS_IN                                                           = 0
  13018 	RPC_C_STATS_CALLS_OUT                                                          = 1
  13019 	RPC_C_STATS_PKTS_IN                                                            = 2
  13020 	RPC_C_STATS_PKTS_OUT                                                           = 3
  13021 	RPC_C_USE_INTERNET_PORT                                                        = 0x1
  13022 	RPC_C_USE_INTRANET_PORT                                                        = 0x2
  13023 	RPC_C_VERS_ALL                                                                 = 1
  13024 	RPC_C_VERS_COMPATIBLE                                                          = 2
  13025 	RPC_C_VERS_EXACT                                                               = 3
  13026 	RPC_C_VERS_MAJOR_ONLY                                                          = 4
  13027 	RPC_C_VERS_UPTO                                                                = 5
  13028 	RPC_EEINFO_VERSION                                                             = 1
  13029 	RPC_ENTRY                                                                      = 0
  13030 	RPC_FLAGS_VALID_BIT                                                            = 0x00008000
  13031 	RPC_IF_ALLOW_CALLBACKS_WITH_NO_AUTH                                            = 0x0010
  13032 	RPC_IF_ALLOW_LOCAL_ONLY                                                        = 0x0020
  13033 	RPC_IF_ALLOW_SECURE_ONLY                                                       = 0x0008
  13034 	RPC_IF_ALLOW_UNKNOWN_AUTHORITY                                                 = 0x0004
  13035 	RPC_IF_AUTOLISTEN                                                              = 0x0001
  13036 	RPC_IF_OLE                                                                     = 0x0002
  13037 	RPC_IF_SEC_NO_CACHE                                                            = 0x0040
  13038 	RPC_INTERFACE_HAS_PIPES                                                        = 0x0001
  13039 	RPC_NCA_FLAGS_BROADCAST                                                        = 0x00000002
  13040 	RPC_NCA_FLAGS_DEFAULT                                                          = 0x00000000
  13041 	RPC_NCA_FLAGS_IDEMPOTENT                                                       = 0x00000001
  13042 	RPC_NCA_FLAGS_MAYBE                                                            = 0x00000004
  13043 	RPC_PROXY_CONNECTION_TYPE_IN_PROXY                                             = 0
  13044 	RPC_PROXY_CONNECTION_TYPE_OUT_PROXY                                            = 1
  13045 	RPC_P_ADDR_FORMAT_TCP_IPV4                                                     = 1
  13046 	RPC_P_ADDR_FORMAT_TCP_IPV6                                                     = 2
  13047 	RPC_QUERY_CLIENT_PRINCIPAL_NAME                                                = 4
  13048 	RPC_QUERY_SERVER_PRINCIPAL_NAME                                                = 2
  13049 	RPC_S_ACCESS_DENIED                                                            = 5
  13050 	RPC_S_ADDRESS_ERROR                                                            = 1768
  13051 	RPC_S_ALREADY_LISTENING                                                        = 1713
  13052 	RPC_S_ALREADY_REGISTERED                                                       = 1711
  13053 	RPC_S_ASYNC_CALL_PENDING                                                       = 997
  13054 	RPC_S_BINDING_HAS_NO_AUTH                                                      = 1746
  13055 	RPC_S_BINDING_INCOMPLETE                                                       = 1819
  13056 	RPC_S_BUFFER_TOO_SMALL                                                         = 122
  13057 	RPC_S_CALL_CANCELLED                                                           = 1818
  13058 	RPC_S_CALL_FAILED                                                              = 1726
  13059 	RPC_S_CALL_FAILED_DNE                                                          = 1727
  13060 	RPC_S_CALL_IN_PROGRESS                                                         = 1791
  13061 	RPC_S_CANNOT_SUPPORT                                                           = 1764
  13062 	RPC_S_CANT_CREATE_ENDPOINT                                                     = 1720
  13063 	RPC_S_COMM_FAILURE                                                             = 1820
  13064 	RPC_S_DUPLICATE_ENDPOINT                                                       = 1740
  13065 	RPC_S_ENTRY_ALREADY_EXISTS                                                     = 1760
  13066 	RPC_S_ENTRY_NOT_FOUND                                                          = 1761
  13067 	RPC_S_ENTRY_TYPE_MISMATCH                                                      = 1922
  13068 	RPC_S_FP_DIV_ZERO                                                              = 1769
  13069 	RPC_S_FP_OVERFLOW                                                              = 1771
  13070 	RPC_S_FP_UNDERFLOW                                                             = 1770
  13071 	RPC_S_GROUP_MEMBER_NOT_FOUND                                                   = 1898
  13072 	RPC_S_GRP_ELT_NOT_ADDED                                                        = 1928
  13073 	RPC_S_GRP_ELT_NOT_REMOVED                                                      = 1929
  13074 	RPC_S_INCOMPLETE_NAME                                                          = 1755
  13075 	RPC_S_INTERFACE_NOT_EXPORTED                                                   = 1924
  13076 	RPC_S_INTERFACE_NOT_FOUND                                                      = 1759
  13077 	RPC_S_INTERNAL_ERROR                                                           = 1766
  13078 	RPC_S_INVALID_ARG                                                              = 87
  13079 	RPC_S_INVALID_ASYNC_CALL                                                       = 1915
  13080 	RPC_S_INVALID_ASYNC_HANDLE                                                     = 1914
  13081 	RPC_S_INVALID_AUTH_IDENTITY                                                    = 1749
  13082 	RPC_S_INVALID_BINDING                                                          = 1702
  13083 	RPC_S_INVALID_BOUND                                                            = 1734
  13084 	RPC_S_INVALID_ENDPOINT_FORMAT                                                  = 1706
  13085 	RPC_S_INVALID_LEVEL                                                            = 87
  13086 	RPC_S_INVALID_NAF_ID                                                           = 1763
  13087 	RPC_S_INVALID_NAME_SYNTAX                                                      = 1736
  13088 	RPC_S_INVALID_NETWORK_OPTIONS                                                  = 1724
  13089 	RPC_S_INVALID_NET_ADDR                                                         = 1707
  13090 	RPC_S_INVALID_OBJECT                                                           = 1900
  13091 	RPC_S_INVALID_RPC_PROTSEQ                                                      = 1704
  13092 	RPC_S_INVALID_SECURITY_DESC                                                    = 1338
  13093 	RPC_S_INVALID_STRING_BINDING                                                   = 1700
  13094 	RPC_S_INVALID_STRING_UUID                                                      = 1705
  13095 	RPC_S_INVALID_TAG                                                              = 1733
  13096 	RPC_S_INVALID_TIMEOUT                                                          = 1709
  13097 	RPC_S_INVALID_VERS_OPTION                                                      = 1756
  13098 	RPC_S_MAX_CALLS_TOO_SMALL                                                      = 1742
  13099 	RPC_S_NAME_SERVICE_UNAVAILABLE                                                 = 1762
  13100 	RPC_S_NOTHING_TO_EXPORT                                                        = 1754
  13101 	RPC_S_NOT_ALL_OBJS_EXPORTED                                                    = 1923
  13102 	RPC_S_NOT_ALL_OBJS_UNEXPORTED                                                  = 1758
  13103 	RPC_S_NOT_CANCELLED                                                            = 1826
  13104 	RPC_S_NOT_LISTENING                                                            = 1715
  13105 	RPC_S_NOT_RPC_ERROR                                                            = 1823
  13106 	RPC_S_NO_BINDINGS                                                              = 1718
  13107 	RPC_S_NO_CALL_ACTIVE                                                           = 1725
  13108 	RPC_S_NO_CONTEXT_AVAILABLE                                                     = 1765
  13109 	RPC_S_NO_ENDPOINT_FOUND                                                        = 1708
  13110 	RPC_S_NO_ENTRY_NAME                                                            = 1735
  13111 	RPC_S_NO_INTERFACES                                                            = 1817
  13112 	RPC_S_NO_MORE_BINDINGS                                                         = 1806
  13113 	RPC_S_NO_MORE_MEMBERS                                                          = 1757
  13114 	RPC_S_NO_PRINC_NAME                                                            = 1822
  13115 	RPC_S_NO_PROTSEQS                                                              = 1719
  13116 	RPC_S_NO_PROTSEQS_REGISTERED                                                   = 1714
  13117 	RPC_S_OBJECT_NOT_FOUND                                                         = 1710
  13118 	RPC_S_OK                                                                       = 0
  13119 	RPC_S_OUT_OF_MEMORY                                                            = 14
  13120 	RPC_S_OUT_OF_RESOURCES                                                         = 1721
  13121 	RPC_S_OUT_OF_THREADS                                                           = 164
  13122 	RPC_S_PRF_ELT_NOT_ADDED                                                        = 1926
  13123 	RPC_S_PRF_ELT_NOT_REMOVED                                                      = 1927
  13124 	RPC_S_PROCNUM_OUT_OF_RANGE                                                     = 1745
  13125 	RPC_S_PROFILE_NOT_ADDED                                                        = 1925
  13126 	RPC_S_PROTOCOL_ERROR                                                           = 1728
  13127 	RPC_S_PROTSEQ_NOT_FOUND                                                        = 1744
  13128 	RPC_S_PROTSEQ_NOT_SUPPORTED                                                    = 1703
  13129 	RPC_S_SEC_PKG_ERROR                                                            = 1825
  13130 	RPC_S_SEND_INCOMPLETE                                                          = 1913
  13131 	RPC_S_SERVER_OUT_OF_MEMORY                                                     = 1130
  13132 	RPC_S_SERVER_TOO_BUSY                                                          = 1723
  13133 	RPC_S_SERVER_UNAVAILABLE                                                       = 1722
  13134 	RPC_S_STRING_TOO_LONG                                                          = 1743
  13135 	RPC_S_TIMEOUT                                                                  = 1460
  13136 	RPC_S_TYPE_ALREADY_REGISTERED                                                  = 1712
  13137 	RPC_S_UNKNOWN_AUTHN_LEVEL                                                      = 1748
  13138 	RPC_S_UNKNOWN_AUTHN_SERVICE                                                    = 1747
  13139 	RPC_S_UNKNOWN_AUTHN_TYPE                                                       = 1741
  13140 	RPC_S_UNKNOWN_AUTHZ_SERVICE                                                    = 1750
  13141 	RPC_S_UNKNOWN_IF                                                               = 1717
  13142 	RPC_S_UNKNOWN_MGR_TYPE                                                         = 1716
  13143 	RPC_S_UNKNOWN_PRINCIPAL                                                        = 1332
  13144 	RPC_S_UNSUPPORTED_AUTHN_LEVEL                                                  = 1821
  13145 	RPC_S_UNSUPPORTED_NAME_SYNTAX                                                  = 1737
  13146 	RPC_S_UNSUPPORTED_TRANS_SYN                                                    = 1730
  13147 	RPC_S_UNSUPPORTED_TYPE                                                         = 1732
  13148 	RPC_S_UUID_LOCAL_ONLY                                                          = 1824
  13149 	RPC_S_UUID_NO_ADDRESS                                                          = 1739
  13150 	RPC_S_WRONG_KIND_OF_BINDING                                                    = 1701
  13151 	RPC_S_ZERO_DIVIDE                                                              = 1767
  13152 	RPC_UNICODE_SUPPORTED                                                          = 0
  13153 	RPC_X_BAD_STUB_DATA                                                            = 1783
  13154 	RPC_X_BYTE_COUNT_TOO_SMALL                                                     = 1782
  13155 	RPC_X_ENUM_VALUE_OUT_OF_RANGE                                                  = 1781
  13156 	RPC_X_ENUM_VALUE_TOO_LARGE                                                     = 1781
  13157 	RPC_X_INVALID_BOUND                                                            = 1734
  13158 	RPC_X_INVALID_BUFFER                                                           = 1784
  13159 	RPC_X_INVALID_ES_ACTION                                                        = 1827
  13160 	RPC_X_INVALID_PIPE_OBJECT                                                      = 1830
  13161 	RPC_X_INVALID_PIPE_OPERATION                                                   = 1831
  13162 	RPC_X_INVALID_TAG                                                              = 1733
  13163 	RPC_X_NO_MEMORY                                                                = 14
  13164 	RPC_X_NO_MORE_ENTRIES                                                          = 1772
  13165 	RPC_X_NULL_REF_POINTER                                                         = 1780
  13166 	RPC_X_PIPE_APP_MEMORY                                                          = 14
  13167 	RPC_X_PIPE_CLOSED                                                              = 1916
  13168 	RPC_X_PIPE_DISCIPLINE_ERROR                                                    = 1917
  13169 	RPC_X_PIPE_EMPTY                                                               = 1918
  13170 	RPC_X_SS_CANNOT_GET_CALL_HANDLE                                                = 1779
  13171 	RPC_X_SS_CHAR_TRANS_OPEN_FAIL                                                  = 1773
  13172 	RPC_X_SS_CHAR_TRANS_SHORT_FILE                                                 = 1774
  13173 	RPC_X_SS_CONTEXT_DAMAGED                                                       = 1777
  13174 	RPC_X_SS_CONTEXT_MISMATCH                                                      = 6
  13175 	RPC_X_SS_HANDLES_MISMATCH                                                      = 1778
  13176 	RPC_X_SS_IN_NULL_CONTEXT                                                       = 1775
  13177 	RPC_X_WRONG_ES_VERSION                                                         = 1828
  13178 	RPC_X_WRONG_PIPE_ORDER                                                         = 1831
  13179 	RPC_X_WRONG_PIPE_VERSION                                                       = 1832
  13180 	RPC_X_WRONG_STUB_VERSION                                                       = 1829
  13181 	RP_INIFILE                                                                     = 0x02
  13182 	RP_LOGON                                                                       = 0x01
  13183 	RRF_NOEXPAND                                                                   = 0x10000000
  13184 	RRF_RT_ANY                                                                     = 0x0000ffff
  13185 	RRF_RT_DWORD                                                                   = 24
  13186 	RRF_RT_QWORD                                                                   = 72
  13187 	RRF_RT_REG_BINARY                                                              = 0x00000008
  13188 	RRF_RT_REG_DWORD                                                               = 0x00000010
  13189 	RRF_RT_REG_EXPAND_SZ                                                           = 0x00000004
  13190 	RRF_RT_REG_MULTI_SZ                                                            = 0x00000020
  13191 	RRF_RT_REG_NONE                                                                = 0x00000001
  13192 	RRF_RT_REG_QWORD                                                               = 0x00000040
  13193 	RRF_RT_REG_SZ                                                                  = 0x00000002
  13194 	RRF_ZEROONFAILURE                                                              = 0x20000000
  13195 	RSA1024BIT_KEY                                                                 = 0x4000000
  13196 	RTL_CONDITION_VARIABLE_LOCKMODE_SHARED                                         = 0x1
  13197 	RTL_CRITICAL_SECTION_ALL_FLAG_BITS                                             = 0xff000000
  13198 	RTL_CRITICAL_SECTION_DEBUG_FLAG_STATIC_INIT                                    = 0x00000001
  13199 	RTL_CRITICAL_SECTION_FLAG_DYNAMIC_SPIN                                         = 0x02000000
  13200 	RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO                                     = 0x10000000
  13201 	RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO                                        = 0x01000000
  13202 	RTL_CRITICAL_SECTION_FLAG_RESERVED                                             = 3758096384
  13203 	RTL_CRITICAL_SECTION_FLAG_RESOURCE_TYPE                                        = 0x08000000
  13204 	RTL_CRITICAL_SECTION_FLAG_STATIC_INIT                                          = 0x04000000
  13205 	RTL_CRITSECT_TYPE                                                              = 0
  13206 	RTL_RESOURCE_TYPE                                                              = 1
  13207 	RTL_RUN_ONCE_ASYNC                                                             = 2
  13208 	RTL_RUN_ONCE_CHECK_ONLY                                                        = 1
  13209 	RTL_RUN_ONCE_CTX_RESERVED_BITS                                                 = 2
  13210 	RTL_RUN_ONCE_INIT_FAILED                                                       = 4
  13211 	RTL_UMS_VERSION                                                                = 256
  13212 	RTL_VRF_FLG_APPCOMPAT_CHECKS                                                   = 0x00000010
  13213 	RTL_VRF_FLG_COM_CHECKS                                                         = 0x00000100
  13214 	RTL_VRF_FLG_DANGEROUS_APIS                                                     = 0x00000200
  13215 	RTL_VRF_FLG_DEADLOCK_CHECKS                                                    = 0x00000800
  13216 	RTL_VRF_FLG_DIRTY_STACKS                                                       = 0x00000040
  13217 	RTL_VRF_FLG_ENABLED_SYSTEM_WIDE                                                = 0x00020000
  13218 	RTL_VRF_FLG_ENABLE_LOGGING                                                     = 0x00004000
  13219 	RTL_VRF_FLG_FAST_FILL_HEAP                                                     = 0x00008000
  13220 	RTL_VRF_FLG_FIRST_CHANCE_EXCEPTION_CHECKS                                      = 0x00001000
  13221 	RTL_VRF_FLG_FULL_PAGE_HEAP                                                     = 0x00000001
  13222 	RTL_VRF_FLG_HANDLE_CHECKS                                                      = 0x00000004
  13223 	RTL_VRF_FLG_LOCK_CHECKS                                                        = 0x00040000
  13224 	RTL_VRF_FLG_MISCELLANEOUS_CHECKS                                               = 0x00020000
  13225 	RTL_VRF_FLG_RACE_CHECKS                                                        = 0x00000400
  13226 	RTL_VRF_FLG_RESERVED_DONOTUSE                                                  = 0x00000002
  13227 	RTL_VRF_FLG_RPC_CHECKS                                                         = 0x00000080
  13228 	RTL_VRF_FLG_STACK_CHECKS                                                       = 0x00000008
  13229 	RTL_VRF_FLG_TLS_CHECKS                                                         = 0x00000020
  13230 	RTL_VRF_FLG_VIRTUAL_MEM_CHECKS                                                 = 0x00002000
  13231 	RTL_VRF_FLG_VIRTUAL_SPACE_TRACKING                                             = 0x00010000
  13232 	RTREE_CACHE_SZ                                                                 = 5
  13233 	RTREE_CHECK_MAX_ERROR                                                          = 100
  13234 	RTREE_COORD_INT32                                                              = 1
  13235 	RTREE_COORD_REAL32                                                             = 0
  13236 	RTREE_DEFAULT_ROWEST                                                           = 1048576
  13237 	RTREE_EQ                                                                       = 0x41
  13238 	RTREE_FALSE                                                                    = 0x40
  13239 	RTREE_GE                                                                       = 0x44
  13240 	RTREE_GT                                                                       = 0x45
  13241 	RTREE_LE                                                                       = 0x42
  13242 	RTREE_LT                                                                       = 0x43
  13243 	RTREE_MATCH                                                                    = 0x46
  13244 	RTREE_MAXCELLS                                                                 = 51
  13245 	RTREE_MAX_AUX_COLUMN                                                           = 100
  13246 	RTREE_MAX_DEPTH                                                                = 40
  13247 	RTREE_MAX_DIMENSIONS                                                           = 5
  13248 	RTREE_MIN_ROWEST                                                               = 100
  13249 	RTREE_QUERY                                                                    = 0x47
  13250 	RTREE_TRUE                                                                     = 0x3f
  13251 	RTREE_ZERO                                                                     = 0.0
  13252 	RTS_CONTROL_DISABLE                                                            = 0x0
  13253 	RTS_CONTROL_ENABLE                                                             = 0x1
  13254 	RTS_CONTROL_HANDSHAKE                                                          = 0x2
  13255 	RTS_CONTROL_TOGGLE                                                             = 0x3
  13256 	RUNDLGORD                                                                      = 1545
  13257 	RUNTIME_FUNCTION_INDIRECT                                                      = 0x1
  13258 	RUSSIAN_CHARSET                                                                = 204
  13259 	SACL_SECURITY_INFORMATION                                                      = 8
  13260 	SAL_HXX                                                                        = 0
  13261 	SAL__callback                                                                  = 0
  13262 	SAL__checkReturn                                                               = 0
  13263 	SAL__deref                                                                     = 0
  13264 	SAL__deref_in                                                                  = 0
  13265 	SAL__deref_in_opt                                                              = 0
  13266 	SAL__deref_inout                                                               = 0
  13267 	SAL__deref_inout_nz                                                            = 0
  13268 	SAL__deref_inout_nz_opt                                                        = 0
  13269 	SAL__deref_inout_opt                                                           = 0
  13270 	SAL__deref_inout_z                                                             = 0
  13271 	SAL__deref_inout_z_opt                                                         = 0
  13272 	SAL__deref_opt_in                                                              = 0
  13273 	SAL__deref_opt_in_opt                                                          = 0
  13274 	SAL__deref_opt_inout                                                           = 0
  13275 	SAL__deref_opt_inout_nz                                                        = 0
  13276 	SAL__deref_opt_inout_nz_opt                                                    = 0
  13277 	SAL__deref_opt_inout_opt                                                       = 0
  13278 	SAL__deref_opt_inout_z                                                         = 0
  13279 	SAL__deref_opt_inout_z_opt                                                     = 0
  13280 	SAL__deref_opt_out                                                             = 0
  13281 	SAL__deref_opt_out_nz_opt                                                      = 0
  13282 	SAL__deref_opt_out_opt                                                         = 0
  13283 	SAL__deref_opt_out_z                                                           = 0
  13284 	SAL__deref_opt_out_z_opt                                                       = 0
  13285 	SAL__deref_out                                                                 = 0
  13286 	SAL__deref_out_nz                                                              = 0
  13287 	SAL__deref_out_nz_opt                                                          = 0
  13288 	SAL__deref_out_opt                                                             = 0
  13289 	SAL__deref_out_z                                                               = 0
  13290 	SAL__deref_out_z_opt                                                           = 0
  13291 	SAL__exceptthat                                                                = 0
  13292 	SAL__execeptthat                                                               = 0
  13293 	SAL__format_string                                                             = 0
  13294 	SAL__in                                                                        = 0
  13295 	SAL__in_nz                                                                     = 0
  13296 	SAL__in_nz_opt                                                                 = 0
  13297 	SAL__in_opt                                                                    = 0
  13298 	SAL__in_z                                                                      = 0
  13299 	SAL__in_z_opt                                                                  = 0
  13300 	SAL__inner_callback                                                            = 0
  13301 	SAL__inner_checkReturn                                                         = 0
  13302 	SAL__inner_fallthrough                                                         = 0
  13303 	SAL__inner_fallthrough_dec                                                     = 0
  13304 	SAL__inner_override                                                            = 0
  13305 	SAL__inout                                                                     = 0
  13306 	SAL__inout_nz                                                                  = 0
  13307 	SAL__inout_nz_opt                                                              = 0
  13308 	SAL__inout_opt                                                                 = 0
  13309 	SAL__inout_z                                                                   = 0
  13310 	SAL__inout_z_opt                                                               = 0
  13311 	SAL__maybenull                                                                 = 0
  13312 	SAL__maybereadonly                                                             = 0
  13313 	SAL__maybevalid                                                                = 0
  13314 	SAL__notnull                                                                   = 0
  13315 	SAL__notreadonly                                                               = 0
  13316 	SAL__notvalid                                                                  = 0
  13317 	SAL__null                                                                      = 0
  13318 	SAL__nullnullterminated                                                        = 0
  13319 	SAL__nullterminated                                                            = 0
  13320 	SAL__out                                                                       = 0
  13321 	SAL__out_nz                                                                    = 0
  13322 	SAL__out_nz_opt                                                                = 0
  13323 	SAL__out_opt                                                                   = 0
  13324 	SAL__out_z                                                                     = 0
  13325 	SAL__out_z_opt                                                                 = 0
  13326 	SAL__override                                                                  = 0
  13327 	SAL__post                                                                      = 0
  13328 	SAL__pre                                                                       = 0
  13329 	SAL__readonly                                                                  = 0
  13330 	SAL__reserved                                                                  = 0
  13331 	SAL__valid                                                                     = 0
  13332 	SANDBOX_INERT                                                                  = 0x2
  13333 	SAVEPOINT_BEGIN                                                                = 0
  13334 	SAVEPOINT_RELEASE                                                              = 1
  13335 	SAVEPOINT_ROLLBACK                                                             = 2
  13336 	SAVE_ATTRIBUTE_VALUES                                                          = 0xD3
  13337 	SAVE_CTM                                                                       = 4101
  13338 	SBM_ENABLE_ARROWS                                                              = 0x00E4
  13339 	SBM_GETPOS                                                                     = 0x00E1
  13340 	SBM_GETRANGE                                                                   = 0x00E3
  13341 	SBM_GETSCROLLBARINFO                                                           = 0x00EB
  13342 	SBM_GETSCROLLINFO                                                              = 0x00EA
  13343 	SBM_SETPOS                                                                     = 0x00E0
  13344 	SBM_SETRANGE                                                                   = 0x00E2
  13345 	SBM_SETRANGEREDRAW                                                             = 0x00E6
  13346 	SBM_SETSCROLLINFO                                                              = 0x00E9
  13347 	SBS_BOTTOMALIGN                                                                = 4
  13348 	SBS_HORZ                                                                       = 0
  13349 	SBS_LEFTALIGN                                                                  = 2
  13350 	SBS_RIGHTALIGN                                                                 = 4
  13351 	SBS_SIZEBOX                                                                    = 8
  13352 	SBS_SIZEBOXBOTTOMRIGHTALIGN                                                    = 4
  13353 	SBS_SIZEBOXTOPLEFTALIGN                                                        = 2
  13354 	SBS_SIZEGRIP                                                                   = 16
  13355 	SBS_TOPALIGN                                                                   = 2
  13356 	SBS_VERT                                                                       = 1
  13357 	SB_BOTH                                                                        = 3
  13358 	SB_BOTTOM                                                                      = 7
  13359 	SB_CONST_ALPHA                                                                 = 0x00000001
  13360 	SB_CTL                                                                         = 2
  13361 	SB_ENDSCROLL                                                                   = 8
  13362 	SB_GRAD_RECT                                                                   = 0x00000010
  13363 	SB_GRAD_TRI                                                                    = 0x00000020
  13364 	SB_HORZ                                                                        = 0
  13365 	SB_LEFT                                                                        = 6
  13366 	SB_LINEDOWN                                                                    = 1
  13367 	SB_LINELEFT                                                                    = 0
  13368 	SB_LINERIGHT                                                                   = 1
  13369 	SB_LINEUP                                                                      = 0
  13370 	SB_NONE                                                                        = 0x00000000
  13371 	SB_PAGEDOWN                                                                    = 3
  13372 	SB_PAGELEFT                                                                    = 2
  13373 	SB_PAGERIGHT                                                                   = 3
  13374 	SB_PAGEUP                                                                      = 2
  13375 	SB_PIXEL_ALPHA                                                                 = 0x00000002
  13376 	SB_PREMULT_ALPHA                                                               = 0x00000004
  13377 	SB_RIGHT                                                                       = 7
  13378 	SB_THUMBPOSITION                                                               = 4
  13379 	SB_THUMBTRACK                                                                  = 5
  13380 	SB_TOP                                                                         = 6
  13381 	SB_VERT                                                                        = 1
  13382 	SCALINGFACTORX                                                                 = 114
  13383 	SCALINGFACTORY                                                                 = 115
  13384 	SCARD_ABSENT                                                                   = 1
  13385 	SCARD_ATR_LENGTH                                                               = 33
  13386 	SCARD_CLASS_COMMUNICATIONS                                                     = 2
  13387 	SCARD_CLASS_ICC_STATE                                                          = 9
  13388 	SCARD_CLASS_IFD_PROTOCOL                                                       = 8
  13389 	SCARD_CLASS_MECHANICAL                                                         = 6
  13390 	SCARD_CLASS_PERF                                                               = 0x7ffe
  13391 	SCARD_CLASS_POWER_MGMT                                                         = 4
  13392 	SCARD_CLASS_PROTOCOL                                                           = 3
  13393 	SCARD_CLASS_SECURITY                                                           = 5
  13394 	SCARD_CLASS_SYSTEM                                                             = 0x7fff
  13395 	SCARD_CLASS_VENDOR_DEFINED                                                     = 7
  13396 	SCARD_CLASS_VENDOR_INFO                                                        = 1
  13397 	SCARD_COLD_RESET                                                               = 1
  13398 	SCARD_EJECT_CARD                                                               = 3
  13399 	SCARD_LEAVE_CARD                                                               = 0
  13400 	SCARD_NEGOTIABLE                                                               = 5
  13401 	SCARD_POWERED                                                                  = 4
  13402 	SCARD_POWER_DOWN                                                               = 0
  13403 	SCARD_PRESENT                                                                  = 2
  13404 	SCARD_PROTOCOL_DEFAULT                                                         = 0x80000000
  13405 	SCARD_PROTOCOL_OPTIMAL                                                         = 0x00000000
  13406 	SCARD_PROTOCOL_RAW                                                             = 0x00010000
  13407 	SCARD_PROTOCOL_T0                                                              = 0x00000001
  13408 	SCARD_PROTOCOL_T1                                                              = 0x00000002
  13409 	SCARD_PROTOCOL_Tx                                                              = 3
  13410 	SCARD_PROTOCOL_UNDEFINED                                                       = 0x00000000
  13411 	SCARD_PROVIDER_CSP                                                             = 2
  13412 	SCARD_PROVIDER_PRIMARY                                                         = 1
  13413 	SCARD_READER_CONFISCATES                                                       = 0x00000004
  13414 	SCARD_READER_EJECTS                                                            = 0x00000002
  13415 	SCARD_READER_SWALLOWS                                                          = 0x00000001
  13416 	SCARD_READER_TYPE_IDE                                                          = 0x10
  13417 	SCARD_READER_TYPE_KEYBOARD                                                     = 0x04
  13418 	SCARD_READER_TYPE_PARALELL                                                     = 0x02
  13419 	SCARD_READER_TYPE_PCMCIA                                                       = 0x40
  13420 	SCARD_READER_TYPE_SCSI                                                         = 0x08
  13421 	SCARD_READER_TYPE_SERIAL                                                       = 0x01
  13422 	SCARD_READER_TYPE_USB                                                          = 0x20
  13423 	SCARD_READER_TYPE_VENDOR                                                       = 0xF0
  13424 	SCARD_RESET_CARD                                                               = 1
  13425 	SCARD_SCOPE_SYSTEM                                                             = 2
  13426 	SCARD_SCOPE_TERMINAL                                                           = 1
  13427 	SCARD_SCOPE_USER                                                               = 0
  13428 	SCARD_SHARE_DIRECT                                                             = 3
  13429 	SCARD_SHARE_EXCLUSIVE                                                          = 1
  13430 	SCARD_SHARE_SHARED                                                             = 2
  13431 	SCARD_SPECIFIC                                                                 = 6
  13432 	SCARD_STATE_ATRMATCH                                                           = 0x00000040
  13433 	SCARD_STATE_CHANGED                                                            = 0x00000002
  13434 	SCARD_STATE_EMPTY                                                              = 0x00000010
  13435 	SCARD_STATE_EXCLUSIVE                                                          = 0x00000080
  13436 	SCARD_STATE_IGNORE                                                             = 0x00000001
  13437 	SCARD_STATE_INUSE                                                              = 0x00000100
  13438 	SCARD_STATE_MUTE                                                               = 0x00000200
  13439 	SCARD_STATE_PRESENT                                                            = 0x00000020
  13440 	SCARD_STATE_UNAVAILABLE                                                        = 0x00000008
  13441 	SCARD_STATE_UNAWARE                                                            = 0x00000000
  13442 	SCARD_STATE_UNKNOWN                                                            = 0x00000004
  13443 	SCARD_STATE_UNPOWERED                                                          = 0x00000400
  13444 	SCARD_SWALLOWED                                                                = 3
  13445 	SCARD_S_SUCCESS                                                                = 0
  13446 	SCARD_T0_CMD_LENGTH                                                            = 5
  13447 	SCARD_T0_HEADER_LENGTH                                                         = 7
  13448 	SCARD_T1_EPILOGUE_LENGTH                                                       = 2
  13449 	SCARD_T1_MAX_IFS                                                               = 254
  13450 	SCARD_T1_PROLOGUE_LENGTH                                                       = 3
  13451 	SCARD_UNKNOWN                                                                  = 0
  13452 	SCARD_UNPOWER_CARD                                                             = 2
  13453 	SCARD_WARM_RESET                                                               = 2
  13454 	SCERR_NOCARDNAME                                                               = 0x4000
  13455 	SCERR_NOGUIDS                                                                  = 0x8000
  13456 	SCHANNEL_ENC_KEY                                                               = 0x1
  13457 	SCHANNEL_MAC_KEY                                                               = 0x0
  13458 	SCHAR_MAX                                                                      = 127
  13459 	SCHAR_MIN                                                                      = -128
  13460 	SCHED_E_SERVICE_NOT_LOCALSYSTEM                                                = 6200
  13461 	SCHEMA_ROOT                                                                    = 1
  13462 	SCHEME_OID_RETRIEVE_ENCODED_OBJECTW_FUNC                                       = "SchemeDllRetrieveEncodedObjectW"
  13463 	SCHEME_OID_RETRIEVE_ENCODED_OBJECT_FUNC                                        = "SchemeDllRetrieveEncodedObject"
  13464 	SCOPE_SECURITY_INFORMATION                                                     = 64
  13465 	SCREEN_FONTTYPE                                                                = 0x2000
  13466 	SCROLLLOCK_ON                                                                  = 0x40
  13467 	SCS_32BIT_BINARY                                                               = 0
  13468 	SCS_64BIT_BINARY                                                               = 6
  13469 	SCS_CAP_COMPSTR                                                                = 0x00000001
  13470 	SCS_CAP_MAKEREAD                                                               = 0x00000002
  13471 	SCS_CAP_SETRECONVERTSTRING                                                     = 0x00000004
  13472 	SCS_CHANGEATTR                                                                 = 18
  13473 	SCS_CHANGECLAUSE                                                               = 36
  13474 	SCS_DOS_BINARY                                                                 = 1
  13475 	SCS_OS216_BINARY                                                               = 5
  13476 	SCS_PIF_BINARY                                                                 = 3
  13477 	SCS_POSIX_BINARY                                                               = 4
  13478 	SCS_QUERYRECONVERTSTRING                                                       = 0x00020000
  13479 	SCS_SETRECONVERTSTRING                                                         = 0x00010000
  13480 	SCS_SETSTR                                                                     = 9
  13481 	SCS_THIS_PLATFORM_BINARY                                                       = 6
  13482 	SCS_WOW_BINARY                                                                 = 2
  13483 	SC_ARRANGE                                                                     = 0xF110
  13484 	SC_CLOSE                                                                       = 0xF060
  13485 	SC_CONTEXTHELP                                                                 = 0xF180
  13486 	SC_DEFAULT                                                                     = 0xF160
  13487 	SC_DLG_FORCE_UI                                                                = 0x04
  13488 	SC_DLG_MINIMAL_UI                                                              = 0x01
  13489 	SC_DLG_NO_UI                                                                   = 0x02
  13490 	SC_GROUP_IDENTIFIER                                                            = 43
  13491 	SC_GROUP_IDENTIFIERA                                                           = 43
  13492 	SC_GROUP_IDENTIFIERW                                                           = 43
  13493 	SC_HOTKEY                                                                      = 0xF150
  13494 	SC_HSCROLL                                                                     = 0xF080
  13495 	SC_ICON                                                                        = 61472
  13496 	SC_KEYMENU                                                                     = 0xF100
  13497 	SC_MANAGER_ALL_ACCESS                                                          = 983103
  13498 	SC_MANAGER_CONNECT                                                             = 0x0001
  13499 	SC_MANAGER_CREATE_SERVICE                                                      = 0x0002
  13500 	SC_MANAGER_ENUMERATE_SERVICE                                                   = 0x0004
  13501 	SC_MANAGER_LOCK                                                                = 0x0008
  13502 	SC_MANAGER_MODIFY_BOOT_CONFIG                                                  = 0x0020
  13503 	SC_MANAGER_QUERY_LOCK_STATUS                                                   = 0x0010
  13504 	SC_MAXIMIZE                                                                    = 0xF030
  13505 	SC_MINIMIZE                                                                    = 0xF020
  13506 	SC_MONITORPOWER                                                                = 0xF170
  13507 	SC_MOUSEMENU                                                                   = 0xF090
  13508 	SC_MOVE                                                                        = 0xF010
  13509 	SC_NEXTWINDOW                                                                  = 0xF040
  13510 	SC_PREVWINDOW                                                                  = 0xF050
  13511 	SC_RESTORE                                                                     = 0xF120
  13512 	SC_SCREENSAVE                                                                  = 0xF140
  13513 	SC_SEPARATOR                                                                   = 0xF00F
  13514 	SC_SIZE                                                                        = 0xF000
  13515 	SC_TASKLIST                                                                    = 0xF130
  13516 	SC_VSCROLL                                                                     = 0xF070
  13517 	SC_ZOOM                                                                        = 61488
  13518 	SEARCH_ALL                                                                     = 0x0
  13519 	SEARCH_ALL_NO_SEQ                                                              = 0x4
  13520 	SEARCH_ALTERNATE                                                               = 0x2
  13521 	SEARCH_ALT_NO_SEQ                                                              = 0x6
  13522 	SEARCH_PRIMARY                                                                 = 0x1
  13523 	SEARCH_PRI_NO_SEQ                                                              = 0x5
  13524 	SECTION_ALL_ACCESS                                                             = 983071
  13525 	SECTION_EXTEND_SIZE                                                            = 0x0010
  13526 	SECTION_MAP_EXECUTE                                                            = 0x0008
  13527 	SECTION_MAP_EXECUTE_EXPLICIT                                                   = 0x0020
  13528 	SECTION_MAP_READ                                                               = 0x0004
  13529 	SECTION_MAP_WRITE                                                              = 0x0002
  13530 	SECTION_QUERY                                                                  = 0x0001
  13531 	SECURITY_ANONYMOUS_LOGON_RID                                                   = 7
  13532 	SECURITY_APPPOOL_ID_BASE_RID                                                   = 82
  13533 	SECURITY_APPPOOL_ID_RID_COUNT                                                  = 6
  13534 	SECURITY_APP_PACKAGE_BASE_RID                                                  = 2
  13535 	SECURITY_APP_PACKAGE_RID_COUNT                                                 = 8
  13536 	SECURITY_AUTHENTICATED_USER_RID                                                = 11
  13537 	SECURITY_AUTHENTICATION_AUTHORITY_ASSERTED_RID                                 = 1
  13538 	SECURITY_AUTHENTICATION_AUTHORITY_RID_COUNT                                    = 1
  13539 	SECURITY_AUTHENTICATION_SERVICE_ASSERTED_RID                                   = 2
  13540 	SECURITY_BATCH_RID                                                             = 3
  13541 	SECURITY_BUILTIN_APP_PACKAGE_RID_COUNT                                         = 2
  13542 	SECURITY_BUILTIN_CAPABILITY_RID_COUNT                                          = 2
  13543 	SECURITY_BUILTIN_DOMAIN_RID                                                    = 32
  13544 	SECURITY_BUILTIN_PACKAGE_ANY_PACKAGE                                           = 1
  13545 	SECURITY_BUILTIN_PACKAGE_ANY_RESTRICTED_PACKAGE                                = 2
  13546 	SECURITY_CAPABILITY_APPOINTMENTS                                               = 11
  13547 	SECURITY_CAPABILITY_BASE_RID                                                   = 3
  13548 	SECURITY_CAPABILITY_CONTACTS                                                   = 12
  13549 	SECURITY_CAPABILITY_DOCUMENTS_LIBRARY                                          = 7
  13550 	SECURITY_CAPABILITY_ENTERPRISE_AUTHENTICATION                                  = 8
  13551 	SECURITY_CAPABILITY_INTERNET_CLIENT                                            = 1
  13552 	SECURITY_CAPABILITY_INTERNET_CLIENT_SERVER                                     = 2
  13553 	SECURITY_CAPABILITY_INTERNET_EXPLORER                                          = 4096
  13554 	SECURITY_CAPABILITY_MUSIC_LIBRARY                                              = 6
  13555 	SECURITY_CAPABILITY_PICTURES_LIBRARY                                           = 4
  13556 	SECURITY_CAPABILITY_PRIVATE_NETWORK_CLIENT_SERVER                              = 3
  13557 	SECURITY_CAPABILITY_REMOVABLE_STORAGE                                          = 10
  13558 	SECURITY_CAPABILITY_RID_COUNT                                                  = 5
  13559 	SECURITY_CAPABILITY_SHARED_USER_CERTIFICATES                                   = 9
  13560 	SECURITY_CAPABILITY_VIDEOS_LIBRARY                                             = 5
  13561 	SECURITY_CLOUD_INFRASTRUCTURE_SERVICES_ID_BASE_RID                             = 85
  13562 	SECURITY_CLOUD_INFRASTRUCTURE_SERVICES_ID_RID_COUNT                            = 6
  13563 	SECURITY_COM_ID_BASE_RID                                                       = 89
  13564 	SECURITY_CONTEXT_TRACKING                                                      = 0x40000
  13565 	SECURITY_CREATOR_GROUP_RID                                                     = 1
  13566 	SECURITY_CREATOR_GROUP_SERVER_RID                                              = 3
  13567 	SECURITY_CREATOR_OWNER_RID                                                     = 0
  13568 	SECURITY_CREATOR_OWNER_RIGHTS_RID                                              = 4
  13569 	SECURITY_CREATOR_OWNER_SERVER_RID                                              = 2
  13570 	SECURITY_CRED_TYPE_BASE_RID                                                    = 65
  13571 	SECURITY_CRED_TYPE_RID_COUNT                                                   = 2
  13572 	SECURITY_CRED_TYPE_THIS_ORG_CERT_RID                                           = 1
  13573 	SECURITY_DASHOST_ID_BASE_RID                                                   = 92
  13574 	SECURITY_DASHOST_ID_RID_COUNT                                                  = 6
  13575 	SECURITY_DESCRIPTOR_REVISION                                                   = 1
  13576 	SECURITY_DESCRIPTOR_REVISION1                                                  = 1
  13577 	SECURITY_DIALUP_RID                                                            = 1
  13578 	SECURITY_DYNAMIC_TRACKING                                                      = 1
  13579 	SECURITY_EFFECTIVE_ONLY                                                        = 0x80000
  13580 	SECURITY_ENTERPRISE_CONTROLLERS_RID                                            = 9
  13581 	SECURITY_ENTERPRISE_READONLY_CONTROLLERS_RID                                   = 22
  13582 	SECURITY_INTERACTIVE_RID                                                       = 4
  13583 	SECURITY_IUSER_RID                                                             = 17
  13584 	SECURITY_LOCAL_LOGON_RID                                                       = 1
  13585 	SECURITY_LOCAL_RID                                                             = 0
  13586 	SECURITY_LOCAL_SERVICE_RID                                                     = 19
  13587 	SECURITY_LOCAL_SYSTEM_RID                                                      = 18
  13588 	SECURITY_LOGON_IDS_RID                                                         = 5
  13589 	SECURITY_LOGON_IDS_RID_COUNT                                                   = 3
  13590 	SECURITY_MANDATORY_HIGH_RID                                                    = 12288
  13591 	SECURITY_MANDATORY_LOW_RID                                                     = 4096
  13592 	SECURITY_MANDATORY_MAXIMUM_USER_RID                                            = 16384
  13593 	SECURITY_MANDATORY_MEDIUM_RID                                                  = 8192
  13594 	SECURITY_MANDATORY_PROTECTED_PROCESS_RID                                       = 20480
  13595 	SECURITY_MANDATORY_SYSTEM_RID                                                  = 16384
  13596 	SECURITY_MANDATORY_UNTRUSTED_RID                                               = 0
  13597 	SECURITY_MAX_ALWAYS_FILTERED                                                   = 999
  13598 	SECURITY_MAX_BASE_RID                                                          = 111
  13599 	SECURITY_MIN_BASE_RID                                                          = 80
  13600 	SECURITY_MIN_NEVER_FILTERED                                                    = 1000
  13601 	SECURITY_NETWORK_RID                                                           = 2
  13602 	SECURITY_NETWORK_SERVICE_RID                                                   = 20
  13603 	SECURITY_NFS_ID_BASE_RID                                                       = 88
  13604 	SECURITY_NT_NON_UNIQUE                                                         = 21
  13605 	SECURITY_NT_NON_UNIQUE_SUB_AUTH_COUNT                                          = 3
  13606 	SECURITY_NULL_RID                                                              = 0
  13607 	SECURITY_OTHER_ORGANIZATION_RID                                                = 1000
  13608 	SECURITY_PACKAGE_BASE_RID                                                      = 64
  13609 	SECURITY_PACKAGE_DIGEST_RID                                                    = 21
  13610 	SECURITY_PACKAGE_NTLM_RID                                                      = 10
  13611 	SECURITY_PACKAGE_RID_COUNT                                                     = 2
  13612 	SECURITY_PACKAGE_SCHANNEL_RID                                                  = 14
  13613 	SECURITY_PRINCIPAL_SELF_RID                                                    = 10
  13614 	SECURITY_PROXY_RID                                                             = 8
  13615 	SECURITY_RDV_GFX_BASE_RID                                                      = 91
  13616 	SECURITY_REMOTE_LOGON_RID                                                      = 14
  13617 	SECURITY_RESERVED_ID_BASE_RID                                                  = 81
  13618 	SECURITY_RESTRICTED_CODE_RID                                                   = 12
  13619 	SECURITY_SERVER_LOGON_RID                                                      = 9
  13620 	SECURITY_SERVICE_ID_BASE_RID                                                   = 80
  13621 	SECURITY_SERVICE_ID_RID_COUNT                                                  = 6
  13622 	SECURITY_SERVICE_RID                                                           = 6
  13623 	SECURITY_SQOS_PRESENT                                                          = 0x100000
  13624 	SECURITY_STATIC_TRACKING                                                       = 0
  13625 	SECURITY_TASK_ID_BASE_RID                                                      = 87
  13626 	SECURITY_TERMINAL_SERVER_RID                                                   = 13
  13627 	SECURITY_THIS_ORGANIZATION_RID                                                 = 15
  13628 	SECURITY_TRUSTED_INSTALLER_RID1                                                = 956008885
  13629 	SECURITY_TRUSTED_INSTALLER_RID2                                                = 3418522649
  13630 	SECURITY_TRUSTED_INSTALLER_RID3                                                = 1831038044
  13631 	SECURITY_TRUSTED_INSTALLER_RID4                                                = 1853292631
  13632 	SECURITY_TRUSTED_INSTALLER_RID5                                                = 2271478464
  13633 	SECURITY_USERMODEDRIVERHOST_ID_BASE_RID                                        = 84
  13634 	SECURITY_USERMODEDRIVERHOST_ID_RID_COUNT                                       = 6
  13635 	SECURITY_VALID_SQOS_FLAGS                                                      = 0x1f0000
  13636 	SECURITY_VIRTUALACCOUNT_ID_RID_COUNT                                           = 6
  13637 	SECURITY_VIRTUALSERVER_ID_BASE_RID                                             = 83
  13638 	SECURITY_VIRTUALSERVER_ID_RID_COUNT                                            = 6
  13639 	SECURITY_WINDOWSMOBILE_ID_BASE_RID                                             = 112
  13640 	SECURITY_WINDOW_MANAGER_BASE_RID                                               = 90
  13641 	SECURITY_WMIHOST_ID_BASE_RID                                                   = 86
  13642 	SECURITY_WMIHOST_ID_RID_COUNT                                                  = 6
  13643 	SECURITY_WORLD_RID                                                             = 0
  13644 	SECURITY_WRITE_RESTRICTED_CODE_RID                                             = 33
  13645 	SEC_64K_PAGES                                                                  = 0x80000
  13646 	SEC_COMMIT                                                                     = 0x8000000
  13647 	SEC_FILE                                                                       = 0x800000
  13648 	SEC_IMAGE                                                                      = 0x1000000
  13649 	SEC_IMAGE_NO_EXECUTE                                                           = 285212672
  13650 	SEC_LARGE_PAGES                                                                = 0x80000000
  13651 	SEC_NOCACHE                                                                    = 0x10000000
  13652 	SEC_PARTITION_OWNER_HANDLE                                                     = 0x40000
  13653 	SEC_PROTECTED_IMAGE                                                            = 0x2000000
  13654 	SEC_RESERVE                                                                    = 0x4000000
  13655 	SEC_WINNT_AUTH_IDENTITY_ANSI                                                   = 0x1
  13656 	SEC_WINNT_AUTH_IDENTITY_UNICODE                                                = 0x2
  13657 	SEC_WRITECOMBINE                                                               = 0x40000000
  13658 	SEEK_CUR                                                                       = 1
  13659 	SEEK_END                                                                       = 2
  13660 	SEEK_SET                                                                       = 0
  13661 	SEE_MASK_ASYNCOK                                                               = 0x100000
  13662 	SEE_MASK_CLASSKEY                                                              = 0x3
  13663 	SEE_MASK_CLASSNAME                                                             = 0x1
  13664 	SEE_MASK_CONNECTNETDRV                                                         = 0x80
  13665 	SEE_MASK_DEFAULT                                                               = 0x0
  13666 	SEE_MASK_DOENVSUBST                                                            = 0x200
  13667 	SEE_MASK_FLAG_DDEWAIT                                                          = 256
  13668 	SEE_MASK_FLAG_LOG_USAGE                                                        = 0x4000000
  13669 	SEE_MASK_FLAG_NO_UI                                                            = 0x400
  13670 	SEE_MASK_HMONITOR                                                              = 0x200000
  13671 	SEE_MASK_HOTKEY                                                                = 0x20
  13672 	SEE_MASK_ICON                                                                  = 0x10
  13673 	SEE_MASK_IDLIST                                                                = 0x4
  13674 	SEE_MASK_INVOKEIDLIST                                                          = 0xc
  13675 	SEE_MASK_NOASYNC                                                               = 0x100
  13676 	SEE_MASK_NOCLOSEPROCESS                                                        = 0x40
  13677 	SEE_MASK_NOQUERYCLASSSTORE                                                     = 0x1000000
  13678 	SEE_MASK_NOZONECHECKS                                                          = 0x800000
  13679 	SEE_MASK_NO_CONSOLE                                                            = 0x8000
  13680 	SEE_MASK_UNICODE                                                               = 0x4000
  13681 	SEE_MASK_WAITFORINPUTIDLE                                                      = 0x2000000
  13682 	SEF_AVOID_OWNER_CHECK                                                          = 0x10
  13683 	SEF_AVOID_OWNER_RESTRICTION                                                    = 0x1000
  13684 	SEF_AVOID_PRIVILEGE_CHECK                                                      = 0x08
  13685 	SEF_DACL_AUTO_INHERIT                                                          = 0x01
  13686 	SEF_DEFAULT_DESCRIPTOR_FOR_OBJECT                                              = 0x04
  13687 	SEF_DEFAULT_GROUP_FROM_PARENT                                                  = 0x40
  13688 	SEF_DEFAULT_OWNER_FROM_PARENT                                                  = 0x20
  13689 	SEF_MACL_NO_EXECUTE_UP                                                         = 0x400
  13690 	SEF_MACL_NO_READ_UP                                                            = 0x200
  13691 	SEF_MACL_NO_WRITE_UP                                                           = 0x100
  13692 	SEF_MACL_VALID_FLAGS                                                           = 1792
  13693 	SEF_SACL_AUTO_INHERIT                                                          = 0x02
  13694 	SELECTDIB                                                                      = 41
  13695 	SELECTPAPERSOURCE                                                              = 18
  13696 	SELECT_CAP_CONVERSION                                                          = 0x00000001
  13697 	SELECT_CAP_SENTENCE                                                            = 0x00000002
  13698 	SEMAPHORE_ALL_ACCESS                                                           = 2031619
  13699 	SEMAPHORE_MODIFY_STATE                                                         = 0x0002
  13700 	SEM_FAILCRITICALERRORS                                                         = 0x0001
  13701 	SEM_NOALIGNMENTFAULTEXCEPT                                                     = 0x0004
  13702 	SEM_NOGPFAULTERRORBOX                                                          = 0x0002
  13703 	SEM_NOOPENFILEERRORBOX                                                         = 0x8000
  13704 	SENTINEL_Reason                                                                = 0
  13705 	SERIAL_NUMBER_LENGTH                                                           = 32
  13706 	SERKF_AVAILABLE                                                                = 0x00000002
  13707 	SERKF_INDICATOR                                                                = 0x00000004
  13708 	SERKF_SERIALKEYSON                                                             = 0x00000001
  13709 	SERVER_ACCESS_ADMINISTER                                                       = 0x00000001
  13710 	SERVER_ACCESS_ENUMERATE                                                        = 0x00000002
  13711 	SERVER_ALL_ACCESS                                                              = 983043
  13712 	SERVER_EXECUTE                                                                 = 131074
  13713 	SERVER_READ                                                                    = 131074
  13714 	SERVER_WRITE                                                                   = 131075
  13715 	SERVICES_ACTIVE_DATABASEA                                                      = "ServicesActive"
  13716 	SERVICES_FAILED_DATABASEA                                                      = "ServicesFailed"
  13717 	SERVICE_ACCEPT_HARDWAREPROFILECHANGE                                           = 0x00000020
  13718 	SERVICE_ACCEPT_NETBINDCHANGE                                                   = 0x00000010
  13719 	SERVICE_ACCEPT_PARAMCHANGE                                                     = 0x00000008
  13720 	SERVICE_ACCEPT_PAUSE_CONTINUE                                                  = 0x00000002
  13721 	SERVICE_ACCEPT_POWEREVENT                                                      = 0x00000040
  13722 	SERVICE_ACCEPT_SESSIONCHANGE                                                   = 0x00000080
  13723 	SERVICE_ACCEPT_SHUTDOWN                                                        = 0x00000004
  13724 	SERVICE_ACCEPT_STOP                                                            = 0x00000001
  13725 	SERVICE_ACTIVE                                                                 = 0x00000001
  13726 	SERVICE_ADAPTER                                                                = 0x00000004
  13727 	SERVICE_ALL_ACCESS                                                             = 983551
  13728 	SERVICE_AUTO_START                                                             = 0x00000002
  13729 	SERVICE_BOOT_START                                                             = 0x00000000
  13730 	SERVICE_CHANGE_CONFIG                                                          = 0x0002
  13731 	SERVICE_CONFIG_DESCRIPTION                                                     = 1
  13732 	SERVICE_CONFIG_FAILURE_ACTIONS                                                 = 2
  13733 	SERVICE_CONTINUE_PENDING                                                       = 0x00000005
  13734 	SERVICE_CONTROL_CONTINUE                                                       = 0x00000003
  13735 	SERVICE_CONTROL_DEVICEEVENT                                                    = 0x0000000B
  13736 	SERVICE_CONTROL_HARDWAREPROFILECHANGE                                          = 0x0000000C
  13737 	SERVICE_CONTROL_INTERROGATE                                                    = 0x00000004
  13738 	SERVICE_CONTROL_NETBINDADD                                                     = 0x00000007
  13739 	SERVICE_CONTROL_NETBINDDISABLE                                                 = 0x0000000A
  13740 	SERVICE_CONTROL_NETBINDENABLE                                                  = 0x00000009
  13741 	SERVICE_CONTROL_NETBINDREMOVE                                                  = 0x00000008
  13742 	SERVICE_CONTROL_PARAMCHANGE                                                    = 0x00000006
  13743 	SERVICE_CONTROL_PAUSE                                                          = 0x00000002
  13744 	SERVICE_CONTROL_POWEREVENT                                                     = 0x0000000D
  13745 	SERVICE_CONTROL_SESSIONCHANGE                                                  = 0x0000000E
  13746 	SERVICE_CONTROL_SHUTDOWN                                                       = 0x00000005
  13747 	SERVICE_CONTROL_STOP                                                           = 0x00000001
  13748 	SERVICE_DEMAND_START                                                           = 0x00000003
  13749 	SERVICE_DISABLED                                                               = 0x00000004
  13750 	SERVICE_DRIVER                                                                 = 11
  13751 	SERVICE_ENUMERATE_DEPENDENTS                                                   = 0x0008
  13752 	SERVICE_ERROR_CRITICAL                                                         = 0x00000003
  13753 	SERVICE_ERROR_IGNORE                                                           = 0x00000000
  13754 	SERVICE_ERROR_NORMAL                                                           = 0x00000001
  13755 	SERVICE_ERROR_SEVERE                                                           = 0x00000002
  13756 	SERVICE_FILE_SYSTEM_DRIVER                                                     = 0x00000002
  13757 	SERVICE_INACTIVE                                                               = 0x00000002
  13758 	SERVICE_INTERACTIVE_PROCESS                                                    = 0x00000100
  13759 	SERVICE_INTERROGATE                                                            = 0x0080
  13760 	SERVICE_KERNEL_DRIVER                                                          = 0x00000001
  13761 	SERVICE_NO_CHANGE                                                              = 0xffffffff
  13762 	SERVICE_PAUSED                                                                 = 0x00000007
  13763 	SERVICE_PAUSE_CONTINUE                                                         = 0x0040
  13764 	SERVICE_PAUSE_PENDING                                                          = 0x00000006
  13765 	SERVICE_QUERY_CONFIG                                                           = 0x0001
  13766 	SERVICE_QUERY_STATUS                                                           = 0x0004
  13767 	SERVICE_RECOGNIZER_DRIVER                                                      = 0x00000008
  13768 	SERVICE_RUNNING                                                                = 0x00000004
  13769 	SERVICE_RUNS_IN_SYSTEM_PROCESS                                                 = 0x00000001
  13770 	SERVICE_START                                                                  = 0x0010
  13771 	SERVICE_START_PENDING                                                          = 0x00000002
  13772 	SERVICE_STATE_ALL                                                              = 3
  13773 	SERVICE_STOP                                                                   = 0x0020
  13774 	SERVICE_STOPPED                                                                = 0x00000001
  13775 	SERVICE_STOP_PENDING                                                           = 0x00000003
  13776 	SERVICE_SYSTEM_START                                                           = 0x00000001
  13777 	SERVICE_TYPE_ALL                                                               = 319
  13778 	SERVICE_USER_DEFINED_CONTROL                                                   = 0x0100
  13779 	SERVICE_WIN32                                                                  = 48
  13780 	SERVICE_WIN32_OWN_PROCESS                                                      = 0x00000010
  13781 	SERVICE_WIN32_SHARE_PROCESS                                                    = 0x00000020
  13782 	SESSIONS_STRM_CHUNK_SIZE                                                       = 1024
  13783 	SESSION_ABORTED                                                                = 0x06
  13784 	SESSION_ALL_ACCESS                                                             = 983043
  13785 	SESSION_ESTABLISHED                                                            = 0x03
  13786 	SESSION_MAX_BUFFER_SZ                                                          = 2147483391
  13787 	SESSION_MODIFY_ACCESS                                                          = 0x2
  13788 	SESSION_QUERY_ACCESS                                                           = 0x1
  13789 	SESSION_UPDATE_CACHE_SZ                                                        = 12
  13790 	SETABORTPROC                                                                   = 9
  13791 	SETALLJUSTVALUES                                                               = 771
  13792 	SETBREAK                                                                       = 8
  13793 	SETCHARSET                                                                     = 772
  13794 	SETCOLORTABLE                                                                  = 4
  13795 	SETCOPYCOUNT                                                                   = 17
  13796 	SETDIBSCALING                                                                  = 32
  13797 	SETDTR                                                                         = 5
  13798 	SETICMPROFILE_EMBEDED                                                          = 0x00000001
  13799 	SETKERNTRACK                                                                   = 770
  13800 	SETLINECAP                                                                     = 21
  13801 	SETLINEJOIN                                                                    = 22
  13802 	SETMITERLIMIT                                                                  = 23
  13803 	SETRGBSTRINGA                                                                  = "commdlg_SetRGBColor"
  13804 	SETRTS                                                                         = 3
  13805 	SETXOFF                                                                        = 1
  13806 	SETXON                                                                         = 2
  13807 	SET_ARC_DIRECTION                                                              = 4102
  13808 	SET_BACKGROUND_COLOR                                                           = 4103
  13809 	SET_BOUNDS                                                                     = 4109
  13810 	SET_CLIP_BOX                                                                   = 4108
  13811 	SET_MIRROR_MODE                                                                = 4110
  13812 	SET_POLY_MODE                                                                  = 4104
  13813 	SET_SCREEN_ANGLE                                                               = 4105
  13814 	SET_SPREAD                                                                     = 4106
  13815 	SET_TAPE_DRIVE_INFORMATION                                                     = 1
  13816 	SET_TAPE_MEDIA_INFORMATION                                                     = 0
  13817 	SEVERITY_ERROR                                                                 = 1
  13818 	SEVERITY_SUCCESS                                                               = 0
  13819 	SE_DACL_AUTO_INHERITED                                                         = 1024
  13820 	SE_DACL_AUTO_INHERIT_REQ                                                       = 256
  13821 	SE_DACL_DEFAULTED                                                              = 8
  13822 	SE_DACL_PRESENT                                                                = 4
  13823 	SE_DACL_PROTECTED                                                              = 4096
  13824 	SE_ERR_ACCESSDENIED                                                            = 5
  13825 	SE_ERR_ASSOCINCOMPLETE                                                         = 27
  13826 	SE_ERR_DDEBUSY                                                                 = 30
  13827 	SE_ERR_DDEFAIL                                                                 = 29
  13828 	SE_ERR_DDETIMEOUT                                                              = 28
  13829 	SE_ERR_DLLNOTFOUND                                                             = 32
  13830 	SE_ERR_FNF                                                                     = 2
  13831 	SE_ERR_NOASSOC                                                                 = 31
  13832 	SE_ERR_OOM                                                                     = 8
  13833 	SE_ERR_PNF                                                                     = 3
  13834 	SE_ERR_SHARE                                                                   = 26
  13835 	SE_GROUP_DEFAULTED                                                             = 2
  13836 	SE_GROUP_ENABLED                                                               = 4
  13837 	SE_GROUP_ENABLED_BY_DEFAULT                                                    = 2
  13838 	SE_GROUP_INTEGRITY                                                             = 32
  13839 	SE_GROUP_INTEGRITY_ENABLED                                                     = 64
  13840 	SE_GROUP_LOGON_ID                                                              = 3221225472
  13841 	SE_GROUP_MANDATORY                                                             = 1
  13842 	SE_GROUP_OWNER                                                                 = 8
  13843 	SE_GROUP_RESOURCE                                                              = 536870912
  13844 	SE_GROUP_USE_FOR_DENY_ONLY                                                     = 16
  13845 	SE_GROUP_VALID_ATTRIBUTES                                                      = 3758096511
  13846 	SE_LEARNING_MODE_FLAG_PERMISSIVE                                               = 0x00000001
  13847 	SE_OWNER_DEFAULTED                                                             = 1
  13848 	SE_PRIVILEGE_ENABLED                                                           = 2
  13849 	SE_PRIVILEGE_ENABLED_BY_DEFAULT                                                = 1
  13850 	SE_PRIVILEGE_REMOVED                                                           = 4
  13851 	SE_PRIVILEGE_USED_FOR_ACCESS                                                   = 2147483648
  13852 	SE_PRIVILEGE_VALID_ATTRIBUTES                                                  = 2147483655
  13853 	SE_RM_CONTROL_VALID                                                            = 16384
  13854 	SE_SACL_AUTO_INHERITED                                                         = 2048
  13855 	SE_SACL_AUTO_INHERIT_REQ                                                       = 512
  13856 	SE_SACL_DEFAULTED                                                              = 32
  13857 	SE_SACL_PRESENT                                                                = 16
  13858 	SE_SACL_PROTECTED                                                              = 8192
  13859 	SE_SECURITY_DESCRIPTOR_FLAG_NO_LABEL_ACE                                       = 0x00000002
  13860 	SE_SECURITY_DESCRIPTOR_FLAG_NO_OWNER_ACE                                       = 0x00000001
  13861 	SE_SECURITY_DESCRIPTOR_VALID_FLAGS                                             = 0x00000003
  13862 	SE_SELF_RELATIVE                                                               = 32768
  13863 	SF_Aggregate                                                                   = 0x0000008
  13864 	SF_All                                                                         = 0x0000002
  13865 	SF_ComplexResult                                                               = 0x0040000
  13866 	SF_Compound                                                                    = 0x0000100
  13867 	SF_Converted                                                                   = 0x0010000
  13868 	SF_CopyCte                                                                     = 0x4000000
  13869 	SF_Distinct                                                                    = 0x0000001
  13870 	SF_Expanded                                                                    = 0x0000040
  13871 	SF_FixedLimit                                                                  = 0x0004000
  13872 	SF_HasAgg                                                                      = 0x0000010
  13873 	SF_HasTypeInfo                                                                 = 0x0000080
  13874 	SF_IncludeHidden                                                               = 0x0020000
  13875 	SF_MaybeConvert                                                                = 0x0008000
  13876 	SF_MinMaxAgg                                                                   = 0x0001000
  13877 	SF_MultiPart                                                                   = 0x2000000
  13878 	SF_MultiValue                                                                  = 0x0000400
  13879 	SF_NestedFrom                                                                  = 0x0000800
  13880 	SF_NoopOrderBy                                                                 = 0x0400000
  13881 	SF_OrderByReqd                                                                 = 0x8000000
  13882 	SF_PushDown                                                                    = 0x1000000
  13883 	SF_Recursive                                                                   = 0x0002000
  13884 	SF_Resolved                                                                    = 0x0000004
  13885 	SF_UFSrcCheck                                                                  = 0x0800000
  13886 	SF_UpdateFrom                                                                  = 0x10000000
  13887 	SF_UsesEphemeral                                                               = 0x0000020
  13888 	SF_Values                                                                      = 0x0000200
  13889 	SF_View                                                                        = 0x0200000
  13890 	SF_WhereBegin                                                                  = 0x0080000
  13891 	SF_WinRewrite                                                                  = 0x0100000
  13892 	SHADEBLENDCAPS                                                                 = 120
  13893 	SHARED_LOCK                                                                    = 1
  13894 	SHARED_SIZE                                                                    = 510
  13895 	SHAREVISTRINGA                                                                 = "commdlg_ShareViolation"
  13896 	SHERB_NOCONFIRMATION                                                           = 0x00000001
  13897 	SHERB_NOPROGRESSUI                                                             = 0x00000002
  13898 	SHERB_NOSOUND                                                                  = 0x00000004
  13899 	SHFILEINFO_DEFINED                                                             = 0
  13900 	SHGFI_ADDOVERLAYS                                                              = 0x000000020
  13901 	SHGFI_ATTRIBUTES                                                               = 0x000000800
  13902 	SHGFI_ATTR_SPECIFIED                                                           = 0x000020000
  13903 	SHGFI_DISPLAYNAME                                                              = 0x000000200
  13904 	SHGFI_EXETYPE                                                                  = 0x000002000
  13905 	SHGFI_ICON                                                                     = 0x000000100
  13906 	SHGFI_ICONLOCATION                                                             = 0x000001000
  13907 	SHGFI_LARGEICON                                                                = 0x000000000
  13908 	SHGFI_LINKOVERLAY                                                              = 0x000008000
  13909 	SHGFI_OPENICON                                                                 = 0x000000002
  13910 	SHGFI_OVERLAYINDEX                                                             = 0x000000040
  13911 	SHGFI_PIDL                                                                     = 0x000000008
  13912 	SHGFI_SELECTED                                                                 = 0x000010000
  13913 	SHGFI_SHELLICONSIZE                                                            = 0x000000004
  13914 	SHGFI_SMALLICON                                                                = 0x000000001
  13915 	SHGFI_SYSICONINDEX                                                             = 0x000004000
  13916 	SHGFI_TYPENAME                                                                 = 0x000000400
  13917 	SHGFI_USEFILEATTRIBUTES                                                        = 0x000000010
  13918 	SHGNLI_NOLNK                                                                   = 0x000000008
  13919 	SHGNLI_NOLOCNAME                                                               = 0x000000010
  13920 	SHGNLI_NOUNIQUE                                                                = 0x000000004
  13921 	SHGNLI_PIDL                                                                    = 0x000000001
  13922 	SHGNLI_PREFIXNAME                                                              = 0x000000002
  13923 	SHIFTJIS_CHARSET                                                               = 128
  13924 	SHIFT_PRESSED                                                                  = 0x10
  13925 	SHIL_EXTRALARGE                                                                = 2
  13926 	SHIL_LARGE                                                                     = 0
  13927 	SHIL_LAST                                                                      = 3
  13928 	SHIL_SMALL                                                                     = 1
  13929 	SHIL_SYSSMALL                                                                  = 3
  13930 	SHOW_FULLSCREEN                                                                = 3
  13931 	SHOW_ICONWINDOW                                                                = 2
  13932 	SHOW_OPENNOACTIVATE                                                            = 4
  13933 	SHOW_OPENWINDOW                                                                = 1
  13934 	SHRT_MAX                                                                       = 32767
  13935 	SHRT_MIN                                                                       = -32768
  13936 	SHTDN_REASON_FLAG_CLEAN_UI                                                     = 0x04000000
  13937 	SHTDN_REASON_FLAG_COMMENT_REQUIRED                                             = 0x01000000
  13938 	SHTDN_REASON_FLAG_DIRTY_PROBLEM_ID_REQUIRED                                    = 0x02000000
  13939 	SHTDN_REASON_FLAG_DIRTY_UI                                                     = 0x08000000
  13940 	SHTDN_REASON_FLAG_PLANNED                                                      = 0x80000000
  13941 	SHTDN_REASON_FLAG_USER_DEFINED                                                 = 0x40000000
  13942 	SHTDN_REASON_LEGACY_API                                                        = 2147942400
  13943 	SHTDN_REASON_MAJOR_APPLICATION                                                 = 0x00040000
  13944 	SHTDN_REASON_MAJOR_HARDWARE                                                    = 0x00010000
  13945 	SHTDN_REASON_MAJOR_LEGACY_API                                                  = 0x00070000
  13946 	SHTDN_REASON_MAJOR_NONE                                                        = 0x00000000
  13947 	SHTDN_REASON_MAJOR_OPERATINGSYSTEM                                             = 0x00020000
  13948 	SHTDN_REASON_MAJOR_OTHER                                                       = 0x00000000
  13949 	SHTDN_REASON_MAJOR_POWER                                                       = 0x00060000
  13950 	SHTDN_REASON_MAJOR_SOFTWARE                                                    = 0x00030000
  13951 	SHTDN_REASON_MAJOR_SYSTEM                                                      = 0x00050000
  13952 	SHTDN_REASON_MINOR_BLUESCREEN                                                  = 0x0000000F
  13953 	SHTDN_REASON_MINOR_CORDUNPLUGGED                                               = 0x0000000b
  13954 	SHTDN_REASON_MINOR_DC_DEMOTION                                                 = 0x00000022
  13955 	SHTDN_REASON_MINOR_DC_PROMOTION                                                = 0x00000021
  13956 	SHTDN_REASON_MINOR_DISK                                                        = 0x00000007
  13957 	SHTDN_REASON_MINOR_ENVIRONMENT                                                 = 0x0000000c
  13958 	SHTDN_REASON_MINOR_HARDWARE_DRIVER                                             = 0x0000000d
  13959 	SHTDN_REASON_MINOR_HOTFIX                                                      = 0x00000011
  13960 	SHTDN_REASON_MINOR_HOTFIX_UNINSTALL                                            = 0x00000017
  13961 	SHTDN_REASON_MINOR_HUNG                                                        = 0x00000005
  13962 	SHTDN_REASON_MINOR_INSTALLATION                                                = 0x00000002
  13963 	SHTDN_REASON_MINOR_MAINTENANCE                                                 = 0x00000001
  13964 	SHTDN_REASON_MINOR_MMC                                                         = 0x00000019
  13965 	SHTDN_REASON_MINOR_NETWORKCARD                                                 = 0x00000009
  13966 	SHTDN_REASON_MINOR_NETWORK_CONNECTIVITY                                        = 0x00000014
  13967 	SHTDN_REASON_MINOR_NONE                                                        = 0x000000ff
  13968 	SHTDN_REASON_MINOR_OTHER                                                       = 0x00000000
  13969 	SHTDN_REASON_MINOR_OTHERDRIVER                                                 = 0x0000000e
  13970 	SHTDN_REASON_MINOR_POWER_SUPPLY                                                = 0x0000000a
  13971 	SHTDN_REASON_MINOR_PROCESSOR                                                   = 0x00000008
  13972 	SHTDN_REASON_MINOR_RECONFIG                                                    = 0x00000004
  13973 	SHTDN_REASON_MINOR_SECURITY                                                    = 0x00000013
  13974 	SHTDN_REASON_MINOR_SECURITYFIX                                                 = 0x00000012
  13975 	SHTDN_REASON_MINOR_SECURITYFIX_UNINSTALL                                       = 0x00000018
  13976 	SHTDN_REASON_MINOR_SERVICEPACK                                                 = 0x00000010
  13977 	SHTDN_REASON_MINOR_SERVICEPACK_UNINSTALL                                       = 0x00000016
  13978 	SHTDN_REASON_MINOR_SYSTEMRESTORE                                               = 0x0000001a
  13979 	SHTDN_REASON_MINOR_TERMSRV                                                     = 0x00000020
  13980 	SHTDN_REASON_MINOR_UNSTABLE                                                    = 0x00000006
  13981 	SHTDN_REASON_MINOR_UPGRADE                                                     = 0x00000003
  13982 	SHTDN_REASON_MINOR_WMI                                                         = 0x00000015
  13983 	SHTDN_REASON_UNKNOWN                                                           = 255
  13984 	SHTDN_REASON_VALID_BIT_MASK                                                    = 0xc0ffffff
  13985 	SHUTDOWN_NORETRY                                                               = 0x1
  13986 	SHUTDOWN_TYPE_LEN                                                              = 32
  13987 	SID_DEFINED                                                                    = 0
  13988 	SID_HASH_SIZE                                                                  = 32
  13989 	SID_IDENTIFIER_AUTHORITY_DEFINED                                               = 0
  13990 	SID_MAX_SUB_AUTHORITIES                                                        = 15
  13991 	SID_RECOMMENDED_SUB_AUTHORITIES                                                = 1
  13992 	SID_REVISION                                                                   = 1
  13993 	SIF_ALL                                                                        = 23
  13994 	SIF_DISABLENOSCROLL                                                            = 0x0008
  13995 	SIF_PAGE                                                                       = 0x0002
  13996 	SIF_POS                                                                        = 0x0004
  13997 	SIF_RANGE                                                                      = 0x0001
  13998 	SIF_TRACKPOS                                                                   = 0x0010
  13999 	SIMPLEBLOB                                                                     = 0x1
  14000 	SIMPLEREGION                                                                   = 2
  14001 	SIMULATED_FONTTYPE                                                             = 0x8000
  14002 	SING                                                                           = 2
  14003 	SITE_PIN_RULES_ALL_SUBDOMAINS_FLAG                                             = 0x1
  14004 	SIZEFULLSCREEN                                                                 = 2
  14005 	SIZEICONIC                                                                     = 1
  14006 	SIZENORMAL                                                                     = 0
  14007 	SIZEOF_RFPO_DATA                                                               = 16
  14008 	SIZEPALETTE                                                                    = 104
  14009 	SIZEZOOMHIDE                                                                   = 4
  14010 	SIZEZOOMSHOW                                                                   = 3
  14011 	SIZE_MAX                                                                       = 18446744073709551615
  14012 	SIZE_MAXHIDE                                                                   = 4
  14013 	SIZE_MAXIMIZED                                                                 = 2
  14014 	SIZE_MAXSHOW                                                                   = 3
  14015 	SIZE_MINIMIZED                                                                 = 1
  14016 	SIZE_RESTORED                                                                  = 0
  14017 	SKF_AUDIBLEFEEDBACK                                                            = 0x00000040
  14018 	SKF_AVAILABLE                                                                  = 0x00000002
  14019 	SKF_CONFIRMHOTKEY                                                              = 0x00000008
  14020 	SKF_HOTKEYACTIVE                                                               = 0x00000004
  14021 	SKF_HOTKEYSOUND                                                                = 0x00000010
  14022 	SKF_INDICATOR                                                                  = 0x00000020
  14023 	SKF_LALTLATCHED                                                                = 0x10000000
  14024 	SKF_LALTLOCKED                                                                 = 0x00100000
  14025 	SKF_LCTLLATCHED                                                                = 0x04000000
  14026 	SKF_LCTLLOCKED                                                                 = 0x00040000
  14027 	SKF_LSHIFTLATCHED                                                              = 0x01000000
  14028 	SKF_LSHIFTLOCKED                                                               = 0x00010000
  14029 	SKF_LWINLATCHED                                                                = 0x40000000
  14030 	SKF_LWINLOCKED                                                                 = 0x00400000
  14031 	SKF_RALTLATCHED                                                                = 0x20000000
  14032 	SKF_RALTLOCKED                                                                 = 0x00200000
  14033 	SKF_RCTLLATCHED                                                                = 0x08000000
  14034 	SKF_RCTLLOCKED                                                                 = 0x00080000
  14035 	SKF_RSHIFTLATCHED                                                              = 0x02000000
  14036 	SKF_RSHIFTLOCKED                                                               = 0x00020000
  14037 	SKF_RWINLATCHED                                                                = 0x80000000
  14038 	SKF_RWINLOCKED                                                                 = 0x00800000
  14039 	SKF_STICKYKEYSON                                                               = 0x00000001
  14040 	SKF_TRISTATE                                                                   = 0x00000080
  14041 	SKF_TWOKEYSOFF                                                                 = 0x00000100
  14042 	SLE_ERROR                                                                      = 0x00000001
  14043 	SLE_MINORERROR                                                                 = 0x00000002
  14044 	SLE_WARNING                                                                    = 0x00000003
  14045 	SLOT_2_0                                                                       = 0x001fc07f
  14046 	SLOT_4_2_0                                                                     = 0xf01fc07f
  14047 	SMART_ABORT_OFFLINE_SELFTEST                                                   = 127
  14048 	SMART_CMD                                                                      = 0xB0
  14049 	SMART_CYL_HI                                                                   = 0xC2
  14050 	SMART_CYL_LOW                                                                  = 0x4F
  14051 	SMART_ERROR_NO_MEM                                                             = 7
  14052 	SMART_EXTENDED_SELFTEST_CAPTIVE                                                = 130
  14053 	SMART_EXTENDED_SELFTEST_OFFLINE                                                = 2
  14054 	SMART_GET_VERSION                                                              = 475264
  14055 	SMART_IDE_ERROR                                                                = 1
  14056 	SMART_INVALID_BUFFER                                                           = 4
  14057 	SMART_INVALID_COMMAND                                                          = 3
  14058 	SMART_INVALID_DRIVE                                                            = 5
  14059 	SMART_INVALID_FLAG                                                             = 2
  14060 	SMART_INVALID_IOCTL                                                            = 6
  14061 	SMART_INVALID_REGISTER                                                         = 8
  14062 	SMART_LOG_SECTOR_SIZE                                                          = 512
  14063 	SMART_NOT_SUPPORTED                                                            = 9
  14064 	SMART_NO_ERROR                                                                 = 0
  14065 	SMART_NO_IDE_DEVICE                                                            = 10
  14066 	SMART_OFFLINE_ROUTINE_OFFLINE                                                  = 0
  14067 	SMART_RCV_DRIVE_DATA                                                           = 508040
  14068 	SMART_READ_LOG                                                                 = 0xD5
  14069 	SMART_SEND_DRIVE_COMMAND                                                       = 508036
  14070 	SMART_SHORT_SELFTEST_CAPTIVE                                                   = 129
  14071 	SMART_SHORT_SELFTEST_OFFLINE                                                   = 1
  14072 	SMART_WRITE_LOG                                                                = 0xd6
  14073 	SMTO_ABORTIFHUNG                                                               = 0x0002
  14074 	SMTO_BLOCK                                                                     = 0x0001
  14075 	SMTO_NORMAL                                                                    = 0x0000
  14076 	SMTO_NOTIMEOUTIFNOTHUNG                                                        = 0x0008
  14077 	SM_ARRANGE                                                                     = 56
  14078 	SM_CARETBLINKINGENABLED                                                        = 0x2002
  14079 	SM_CLEANBOOT                                                                   = 67
  14080 	SM_CMETRICS                                                                    = 97
  14081 	SM_CMONITORS                                                                   = 80
  14082 	SM_CMOUSEBUTTONS                                                               = 43
  14083 	SM_CXBORDER                                                                    = 5
  14084 	SM_CXCURSOR                                                                    = 13
  14085 	SM_CXDLGFRAME                                                                  = 7
  14086 	SM_CXDOUBLECLK                                                                 = 36
  14087 	SM_CXDRAG                                                                      = 68
  14088 	SM_CXEDGE                                                                      = 45
  14089 	SM_CXFIXEDFRAME                                                                = 7
  14090 	SM_CXFOCUSBORDER                                                               = 83
  14091 	SM_CXFRAME                                                                     = 32
  14092 	SM_CXFULLSCREEN                                                                = 16
  14093 	SM_CXHSCROLL                                                                   = 21
  14094 	SM_CXHTHUMB                                                                    = 10
  14095 	SM_CXICON                                                                      = 11
  14096 	SM_CXICONSPACING                                                               = 38
  14097 	SM_CXMAXIMIZED                                                                 = 61
  14098 	SM_CXMAXTRACK                                                                  = 59
  14099 	SM_CXMENUCHECK                                                                 = 71
  14100 	SM_CXMENUSIZE                                                                  = 54
  14101 	SM_CXMIN                                                                       = 28
  14102 	SM_CXMINIMIZED                                                                 = 57
  14103 	SM_CXMINSPACING                                                                = 47
  14104 	SM_CXMINTRACK                                                                  = 34
  14105 	SM_CXSCREEN                                                                    = 0
  14106 	SM_CXSIZE                                                                      = 30
  14107 	SM_CXSIZEFRAME                                                                 = 32
  14108 	SM_CXSMICON                                                                    = 49
  14109 	SM_CXSMSIZE                                                                    = 52
  14110 	SM_CXVIRTUALSCREEN                                                             = 78
  14111 	SM_CXVSCROLL                                                                   = 2
  14112 	SM_CYBORDER                                                                    = 6
  14113 	SM_CYCAPTION                                                                   = 4
  14114 	SM_CYCURSOR                                                                    = 14
  14115 	SM_CYDLGFRAME                                                                  = 8
  14116 	SM_CYDOUBLECLK                                                                 = 37
  14117 	SM_CYDRAG                                                                      = 69
  14118 	SM_CYEDGE                                                                      = 46
  14119 	SM_CYFIXEDFRAME                                                                = 8
  14120 	SM_CYFOCUSBORDER                                                               = 84
  14121 	SM_CYFRAME                                                                     = 33
  14122 	SM_CYFULLSCREEN                                                                = 17
  14123 	SM_CYHSCROLL                                                                   = 3
  14124 	SM_CYICON                                                                      = 12
  14125 	SM_CYICONSPACING                                                               = 39
  14126 	SM_CYKANJIWINDOW                                                               = 18
  14127 	SM_CYMAXIMIZED                                                                 = 62
  14128 	SM_CYMAXTRACK                                                                  = 60
  14129 	SM_CYMENU                                                                      = 15
  14130 	SM_CYMENUCHECK                                                                 = 72
  14131 	SM_CYMENUSIZE                                                                  = 55
  14132 	SM_CYMIN                                                                       = 29
  14133 	SM_CYMINIMIZED                                                                 = 58
  14134 	SM_CYMINSPACING                                                                = 48
  14135 	SM_CYMINTRACK                                                                  = 35
  14136 	SM_CYSCREEN                                                                    = 1
  14137 	SM_CYSIZE                                                                      = 31
  14138 	SM_CYSIZEFRAME                                                                 = 33
  14139 	SM_CYSMCAPTION                                                                 = 51
  14140 	SM_CYSMICON                                                                    = 50
  14141 	SM_CYSMSIZE                                                                    = 53
  14142 	SM_CYVIRTUALSCREEN                                                             = 79
  14143 	SM_CYVSCROLL                                                                   = 20
  14144 	SM_CYVTHUMB                                                                    = 9
  14145 	SM_DBCSENABLED                                                                 = 42
  14146 	SM_DEBUG                                                                       = 22
  14147 	SM_IMMENABLED                                                                  = 82
  14148 	SM_MEDIACENTER                                                                 = 87
  14149 	SM_MENUDROPALIGNMENT                                                           = 40
  14150 	SM_MIDEASTENABLED                                                              = 74
  14151 	SM_MOUSEPRESENT                                                                = 19
  14152 	SM_MOUSEWHEELPRESENT                                                           = 75
  14153 	SM_NETWORK                                                                     = 63
  14154 	SM_PENWINDOWS                                                                  = 41
  14155 	SM_REMOTECONTROL                                                               = 0x2001
  14156 	SM_REMOTESESSION                                                               = 0x1000
  14157 	SM_RESERVED1                                                                   = 24
  14158 	SM_RESERVED2                                                                   = 25
  14159 	SM_RESERVED3                                                                   = 26
  14160 	SM_RESERVED4                                                                   = 27
  14161 	SM_SAMEDISPLAYFORMAT                                                           = 81
  14162 	SM_SECURE                                                                      = 44
  14163 	SM_SERVERR2                                                                    = 89
  14164 	SM_SHOWSOUNDS                                                                  = 70
  14165 	SM_SHUTTINGDOWN                                                                = 0x2000
  14166 	SM_SLOWMACHINE                                                                 = 73
  14167 	SM_STARTER                                                                     = 88
  14168 	SM_SWAPBUTTON                                                                  = 23
  14169 	SM_TABLETPC                                                                    = 86
  14170 	SM_XVIRTUALSCREEN                                                              = 76
  14171 	SM_YVIRTUALSCREEN                                                              = 77
  14172 	SNAPSHOT_POLICY_ALWAYS                                                         = 1
  14173 	SNAPSHOT_POLICY_NEVER                                                          = 0
  14174 	SNAPSHOT_POLICY_UNPLANNED                                                      = 2
  14175 	SND_ALIAS                                                                      = 65536
  14176 	SND_ALIAS_ID                                                                   = 1114112
  14177 	SND_ALIAS_START                                                                = 0
  14178 	SND_APPLICATION                                                                = 0x0080
  14179 	SND_ASYNC                                                                      = 0x0001
  14180 	SND_FILENAME                                                                   = 131072
  14181 	SND_LOOP                                                                       = 0x0008
  14182 	SND_MEMORY                                                                     = 0x0004
  14183 	SND_NODEFAULT                                                                  = 0x0002
  14184 	SND_NOSTOP                                                                     = 0x0010
  14185 	SND_NOWAIT                                                                     = 8192
  14186 	SND_PURGE                                                                      = 0x0040
  14187 	SND_RESOURCE                                                                   = 262148
  14188 	SND_SYNC                                                                       = 0x0000
  14189 	SOCKET_ERROR                                                                   = -1
  14190 	SOCK_DGRAM                                                                     = 2
  14191 	SOCK_RAW                                                                       = 3
  14192 	SOCK_RDM                                                                       = 4
  14193 	SOCK_SEQPACKET                                                                 = 5
  14194 	SOCK_STREAM                                                                    = 1
  14195 	SOFTDIST_ADSTATE_AVAILABLE                                                     = 0x1
  14196 	SOFTDIST_ADSTATE_DOWNLOADED                                                    = 0x2
  14197 	SOFTDIST_ADSTATE_INSTALLED                                                     = 0x3
  14198 	SOFTDIST_ADSTATE_NONE                                                          = 0x0
  14199 	SOFTDIST_FLAG_DELETE_SUBSCRIPTION                                              = 0x8
  14200 	SOFTDIST_FLAG_USAGE_AUTOINSTALL                                                = 0x4
  14201 	SOFTDIST_FLAG_USAGE_EMAIL                                                      = 0x1
  14202 	SOFTDIST_FLAG_USAGE_PRECACHE                                                   = 0x2
  14203 	SOFTKEYBOARD_TYPE_C1                                                           = 0x0002
  14204 	SOFTKEYBOARD_TYPE_T1                                                           = 0x0001
  14205 	SOL_SOCKET                                                                     = 0xffff
  14206 	SOMAXCONN                                                                      = 5
  14207 	SORTED_CTL_EXT_COUNT_OFFSET                                                    = 4
  14208 	SORTED_CTL_EXT_FLAGS_OFFSET                                                    = 0
  14209 	SORTED_CTL_EXT_HASHED_SUBJECT_IDENTIFIER_FLAG                                  = 0x1
  14210 	SORTED_CTL_EXT_HASH_BUCKET_OFFSET                                              = 12
  14211 	SORTED_CTL_EXT_MAX_COLLISION_OFFSET                                            = 8
  14212 	SORTER_MAX_MERGE_COUNT                                                         = 16
  14213 	SORTER_TYPE_INTEGER                                                            = 0x01
  14214 	SORTER_TYPE_TEXT                                                               = 0x02
  14215 	SORTFLAG_UseSorter                                                             = 0x01
  14216 	SORT_CHINESE_BIG5                                                              = 0x0
  14217 	SORT_CHINESE_BOPOMOFO                                                          = 0x3
  14218 	SORT_CHINESE_PRC                                                               = 0x2
  14219 	SORT_CHINESE_PRCP                                                              = 0x0
  14220 	SORT_CHINESE_RADICALSTROKE                                                     = 0x4
  14221 	SORT_CHINESE_UNICODE                                                           = 0x1
  14222 	SORT_DEFAULT                                                                   = 0x0
  14223 	SORT_GEORGIAN_MODERN                                                           = 0x1
  14224 	SORT_GEORGIAN_TRADITIONAL                                                      = 0x0
  14225 	SORT_GERMAN_PHONE_BOOK                                                         = 0x1
  14226 	SORT_HUNGARIAN_DEFAULT                                                         = 0x0
  14227 	SORT_HUNGARIAN_TECHNICAL                                                       = 0x1
  14228 	SORT_INVARIANT_MATH                                                            = 0x1
  14229 	SORT_JAPANESE_RADICALSTROKE                                                    = 0x4
  14230 	SORT_JAPANESE_UNICODE                                                          = 0x1
  14231 	SORT_JAPANESE_XJIS                                                             = 0x0
  14232 	SORT_KOREAN_KSC                                                                = 0x0
  14233 	SORT_KOREAN_UNICODE                                                            = 0x1
  14234 	SORT_STRINGSORT                                                                = 0x00001000
  14235 	SOUND_SYSTEM_APPEND                                                            = 14
  14236 	SOUND_SYSTEM_APPSTART                                                          = 12
  14237 	SOUND_SYSTEM_BEEP                                                              = 3
  14238 	SOUND_SYSTEM_ERROR                                                             = 4
  14239 	SOUND_SYSTEM_FAULT                                                             = 13
  14240 	SOUND_SYSTEM_INFORMATION                                                       = 7
  14241 	SOUND_SYSTEM_MAXIMIZE                                                          = 8
  14242 	SOUND_SYSTEM_MENUCOMMAND                                                       = 15
  14243 	SOUND_SYSTEM_MENUPOPUP                                                         = 16
  14244 	SOUND_SYSTEM_MINIMIZE                                                          = 9
  14245 	SOUND_SYSTEM_QUESTION                                                          = 5
  14246 	SOUND_SYSTEM_RESTOREDOWN                                                       = 11
  14247 	SOUND_SYSTEM_RESTOREUP                                                         = 10
  14248 	SOUND_SYSTEM_SHUTDOWN                                                          = 2
  14249 	SOUND_SYSTEM_STARTUP                                                           = 1
  14250 	SOUND_SYSTEM_WARNING                                                           = 6
  14251 	SO_ACCEPTCONN                                                                  = 0x0002
  14252 	SO_BROADCAST                                                                   = 0x0020
  14253 	SO_CONNDATA                                                                    = 0x7000
  14254 	SO_CONNDATALEN                                                                 = 0x7004
  14255 	SO_CONNECT_TIME                                                                = 0x700C
  14256 	SO_CONNOPT                                                                     = 0x7001
  14257 	SO_CONNOPTLEN                                                                  = 0x7005
  14258 	SO_DEBUG                                                                       = 0x0001
  14259 	SO_DISCDATA                                                                    = 0x7002
  14260 	SO_DISCDATALEN                                                                 = 0x7006
  14261 	SO_DISCOPT                                                                     = 0x7003
  14262 	SO_DISCOPTLEN                                                                  = 0x7007
  14263 	SO_DONTROUTE                                                                   = 0x0010
  14264 	SO_ERROR                                                                       = 0x1007
  14265 	SO_KEEPALIVE                                                                   = 0x0008
  14266 	SO_LINGER                                                                      = 0x0080
  14267 	SO_MAXDG                                                                       = 0x7009
  14268 	SO_MAXPATHDG                                                                   = 0x700A
  14269 	SO_OOBINLINE                                                                   = 0x0100
  14270 	SO_OPENTYPE                                                                    = 0x7008
  14271 	SO_RCVBUF                                                                      = 0x1002
  14272 	SO_RCVLOWAT                                                                    = 0x1004
  14273 	SO_RCVTIMEO                                                                    = 0x1006
  14274 	SO_REUSEADDR                                                                   = 0x0004
  14275 	SO_SNDBUF                                                                      = 0x1001
  14276 	SO_SNDLOWAT                                                                    = 0x1003
  14277 	SO_SNDTIMEO                                                                    = 0x1005
  14278 	SO_SYNCHRONOUS_ALERT                                                           = 0x10
  14279 	SO_SYNCHRONOUS_NONALERT                                                        = 0x20
  14280 	SO_TYPE                                                                        = 0x1008
  14281 	SO_UPDATE_ACCEPT_CONTEXT                                                       = 0x700B
  14282 	SO_USELOOPBACK                                                                 = 0x0040
  14283 	SPACEPARITY                                                                    = 4
  14284 	SPCLPASSTHROUGH2                                                               = 4568
  14285 	SPECIFIC_RIGHTS_ALL                                                            = 65535
  14286 	SPECSTRINGS_H                                                                  = 0
  14287 	SPIF_SENDCHANGE                                                                = 2
  14288 	SPIF_SENDWININICHANGE                                                          = 0x0002
  14289 	SPIF_UPDATEINIFILE                                                             = 0x0001
  14290 	SPILLFLAG_NOSYNC                                                               = 0x04
  14291 	SPILLFLAG_OFF                                                                  = 0x01
  14292 	SPILLFLAG_ROLLBACK                                                             = 0x02
  14293 	SPI_GETACCESSTIMEOUT                                                           = 0x003C
  14294 	SPI_GETACTIVEWINDOWTRACKING                                                    = 0x1000
  14295 	SPI_GETACTIVEWNDTRKTIMEOUT                                                     = 0x2002
  14296 	SPI_GETACTIVEWNDTRKZORDER                                                      = 0x100C
  14297 	SPI_GETANIMATION                                                               = 0x0048
  14298 	SPI_GETBEEP                                                                    = 0x0001
  14299 	SPI_GETBLOCKSENDINPUTRESETS                                                    = 0x1026
  14300 	SPI_GETBORDER                                                                  = 0x0005
  14301 	SPI_GETCARETWIDTH                                                              = 0x2006
  14302 	SPI_GETCOMBOBOXANIMATION                                                       = 0x1004
  14303 	SPI_GETCURSORSHADOW                                                            = 0x101A
  14304 	SPI_GETDEFAULTINPUTLANG                                                        = 0x0059
  14305 	SPI_GETDESKWALLPAPER                                                           = 0x0073
  14306 	SPI_GETDRAGFULLWINDOWS                                                         = 0x0026
  14307 	SPI_GETDROPSHADOW                                                              = 0x1024
  14308 	SPI_GETFASTTASKSWITCH                                                          = 0x0023
  14309 	SPI_GETFILTERKEYS                                                              = 0x0032
  14310 	SPI_GETFLATMENU                                                                = 0x1022
  14311 	SPI_GETFOCUSBORDERHEIGHT                                                       = 0x2010
  14312 	SPI_GETFOCUSBORDERWIDTH                                                        = 0x200E
  14313 	SPI_GETFONTSMOOTHING                                                           = 0x004A
  14314 	SPI_GETFONTSMOOTHINGCONTRAST                                                   = 0x200C
  14315 	SPI_GETFONTSMOOTHINGORIENTATION                                                = 0x2012
  14316 	SPI_GETFONTSMOOTHINGTYPE                                                       = 0x200A
  14317 	SPI_GETFOREGROUNDFLASHCOUNT                                                    = 0x2004
  14318 	SPI_GETFOREGROUNDLOCKTIMEOUT                                                   = 0x2000
  14319 	SPI_GETGRADIENTCAPTIONS                                                        = 0x1008
  14320 	SPI_GETGRIDGRANULARITY                                                         = 0x0012
  14321 	SPI_GETHIGHCONTRAST                                                            = 0x0042
  14322 	SPI_GETHOTTRACKING                                                             = 0x100E
  14323 	SPI_GETICONMETRICS                                                             = 0x002D
  14324 	SPI_GETICONTITLELOGFONT                                                        = 0x001F
  14325 	SPI_GETICONTITLEWRAP                                                           = 0x0019
  14326 	SPI_GETKEYBOARDCUES                                                            = 0x100A
  14327 	SPI_GETKEYBOARDDELAY                                                           = 0x0016
  14328 	SPI_GETKEYBOARDPREF                                                            = 0x0044
  14329 	SPI_GETKEYBOARDSPEED                                                           = 0x000A
  14330 	SPI_GETLISTBOXSMOOTHSCROLLING                                                  = 0x1006
  14331 	SPI_GETLOWPOWERACTIVE                                                          = 0x0053
  14332 	SPI_GETLOWPOWERTIMEOUT                                                         = 0x004F
  14333 	SPI_GETMENUANIMATION                                                           = 0x1002
  14334 	SPI_GETMENUDROPALIGNMENT                                                       = 0x001B
  14335 	SPI_GETMENUFADE                                                                = 0x1012
  14336 	SPI_GETMENUSHOWDELAY                                                           = 0x006A
  14337 	SPI_GETMENUUNDERLINES                                                          = 4106
  14338 	SPI_GETMINIMIZEDMETRICS                                                        = 0x002B
  14339 	SPI_GETMOUSE                                                                   = 0x0003
  14340 	SPI_GETMOUSECLICKLOCK                                                          = 0x101E
  14341 	SPI_GETMOUSECLICKLOCKTIME                                                      = 0x2008
  14342 	SPI_GETMOUSEHOVERHEIGHT                                                        = 0x0064
  14343 	SPI_GETMOUSEHOVERTIME                                                          = 0x0066
  14344 	SPI_GETMOUSEHOVERWIDTH                                                         = 0x0062
  14345 	SPI_GETMOUSEKEYS                                                               = 0x0036
  14346 	SPI_GETMOUSESONAR                                                              = 0x101C
  14347 	SPI_GETMOUSESPEED                                                              = 0x0070
  14348 	SPI_GETMOUSETRAILS                                                             = 0x005E
  14349 	SPI_GETMOUSEVANISH                                                             = 0x1020
  14350 	SPI_GETNONCLIENTMETRICS                                                        = 0x0029
  14351 	SPI_GETPOWEROFFACTIVE                                                          = 0x0054
  14352 	SPI_GETPOWEROFFTIMEOUT                                                         = 0x0050
  14353 	SPI_GETSCREENREADER                                                            = 0x0046
  14354 	SPI_GETSCREENSAVEACTIVE                                                        = 0x0010
  14355 	SPI_GETSCREENSAVERRUNNING                                                      = 0x0072
  14356 	SPI_GETSCREENSAVETIMEOUT                                                       = 0x000E
  14357 	SPI_GETSELECTIONFADE                                                           = 0x1014
  14358 	SPI_GETSERIALKEYS                                                              = 0x003E
  14359 	SPI_GETSHOWIMEUI                                                               = 0x006E
  14360 	SPI_GETSHOWSOUNDS                                                              = 0x0038
  14361 	SPI_GETSNAPTODEFBUTTON                                                         = 0x005F
  14362 	SPI_GETSOUNDSENTRY                                                             = 0x0040
  14363 	SPI_GETSTICKYKEYS                                                              = 0x003A
  14364 	SPI_GETTOGGLEKEYS                                                              = 0x0034
  14365 	SPI_GETTOOLTIPANIMATION                                                        = 0x1016
  14366 	SPI_GETTOOLTIPFADE                                                             = 0x1018
  14367 	SPI_GETUIEFFECTS                                                               = 0x103E
  14368 	SPI_GETWHEELSCROLLLINES                                                        = 0x0068
  14369 	SPI_GETWINDOWSEXTENSION                                                        = 0x005C
  14370 	SPI_GETWORKAREA                                                                = 0x0030
  14371 	SPI_ICONHORIZONTALSPACING                                                      = 0x000D
  14372 	SPI_ICONVERTICALSPACING                                                        = 0x0018
  14373 	SPI_LANGDRIVER                                                                 = 0x000C
  14374 	SPI_SCREENSAVERRUNNING                                                         = 97
  14375 	SPI_SETACCESSTIMEOUT                                                           = 0x003D
  14376 	SPI_SETACTIVEWINDOWTRACKING                                                    = 0x1001
  14377 	SPI_SETACTIVEWNDTRKTIMEOUT                                                     = 0x2003
  14378 	SPI_SETACTIVEWNDTRKZORDER                                                      = 0x100D
  14379 	SPI_SETANIMATION                                                               = 0x0049
  14380 	SPI_SETBEEP                                                                    = 0x0002
  14381 	SPI_SETBLOCKSENDINPUTRESETS                                                    = 0x1027
  14382 	SPI_SETBORDER                                                                  = 0x0006
  14383 	SPI_SETCARETWIDTH                                                              = 0x2007
  14384 	SPI_SETCOMBOBOXANIMATION                                                       = 0x1005
  14385 	SPI_SETCURSORS                                                                 = 0x0057
  14386 	SPI_SETCURSORSHADOW                                                            = 0x101B
  14387 	SPI_SETDEFAULTINPUTLANG                                                        = 0x005A
  14388 	SPI_SETDESKPATTERN                                                             = 0x0015
  14389 	SPI_SETDESKWALLPAPER                                                           = 0x0014
  14390 	SPI_SETDOUBLECLICKTIME                                                         = 0x0020
  14391 	SPI_SETDOUBLECLKHEIGHT                                                         = 0x001E
  14392 	SPI_SETDOUBLECLKWIDTH                                                          = 0x001D
  14393 	SPI_SETDRAGFULLWINDOWS                                                         = 0x0025
  14394 	SPI_SETDRAGHEIGHT                                                              = 0x004D
  14395 	SPI_SETDRAGWIDTH                                                               = 0x004C
  14396 	SPI_SETDROPSHADOW                                                              = 0x1025
  14397 	SPI_SETFASTTASKSWITCH                                                          = 0x0024
  14398 	SPI_SETFILTERKEYS                                                              = 0x0033
  14399 	SPI_SETFLATMENU                                                                = 0x1023
  14400 	SPI_SETFOCUSBORDERHEIGHT                                                       = 0x2011
  14401 	SPI_SETFOCUSBORDERWIDTH                                                        = 0x200F
  14402 	SPI_SETFONTSMOOTHING                                                           = 0x004B
  14403 	SPI_SETFONTSMOOTHINGCONTRAST                                                   = 0x200D
  14404 	SPI_SETFONTSMOOTHINGORIENTATION                                                = 0x2013
  14405 	SPI_SETFONTSMOOTHINGTYPE                                                       = 0x200B
  14406 	SPI_SETFOREGROUNDFLASHCOUNT                                                    = 0x2005
  14407 	SPI_SETFOREGROUNDLOCKTIMEOUT                                                   = 0x2001
  14408 	SPI_SETGRADIENTCAPTIONS                                                        = 0x1009
  14409 	SPI_SETGRIDGRANULARITY                                                         = 0x0013
  14410 	SPI_SETHANDHELD                                                                = 0x004E
  14411 	SPI_SETHIGHCONTRAST                                                            = 0x0043
  14412 	SPI_SETHOTTRACKING                                                             = 0x100F
  14413 	SPI_SETICONMETRICS                                                             = 0x002E
  14414 	SPI_SETICONS                                                                   = 0x0058
  14415 	SPI_SETICONTITLELOGFONT                                                        = 0x0022
  14416 	SPI_SETICONTITLEWRAP                                                           = 0x001A
  14417 	SPI_SETKEYBOARDCUES                                                            = 0x100B
  14418 	SPI_SETKEYBOARDDELAY                                                           = 0x0017
  14419 	SPI_SETKEYBOARDPREF                                                            = 0x0045
  14420 	SPI_SETKEYBOARDSPEED                                                           = 0x000B
  14421 	SPI_SETLANGTOGGLE                                                              = 0x005B
  14422 	SPI_SETLISTBOXSMOOTHSCROLLING                                                  = 0x1007
  14423 	SPI_SETLOWPOWERACTIVE                                                          = 0x0055
  14424 	SPI_SETLOWPOWERTIMEOUT                                                         = 0x0051
  14425 	SPI_SETMENUANIMATION                                                           = 0x1003
  14426 	SPI_SETMENUDROPALIGNMENT                                                       = 0x001C
  14427 	SPI_SETMENUFADE                                                                = 0x1013
  14428 	SPI_SETMENUSHOWDELAY                                                           = 0x006B
  14429 	SPI_SETMENUUNDERLINES                                                          = 4107
  14430 	SPI_SETMINIMIZEDMETRICS                                                        = 0x002C
  14431 	SPI_SETMOUSE                                                                   = 0x0004
  14432 	SPI_SETMOUSEBUTTONSWAP                                                         = 0x0021
  14433 	SPI_SETMOUSECLICKLOCK                                                          = 0x101F
  14434 	SPI_SETMOUSECLICKLOCKTIME                                                      = 0x2009
  14435 	SPI_SETMOUSEHOVERHEIGHT                                                        = 0x0065
  14436 	SPI_SETMOUSEHOVERTIME                                                          = 0x0067
  14437 	SPI_SETMOUSEHOVERWIDTH                                                         = 0x0063
  14438 	SPI_SETMOUSEKEYS                                                               = 0x0037
  14439 	SPI_SETMOUSESONAR                                                              = 0x101D
  14440 	SPI_SETMOUSESPEED                                                              = 0x0071
  14441 	SPI_SETMOUSETRAILS                                                             = 0x005D
  14442 	SPI_SETMOUSEVANISH                                                             = 0x1021
  14443 	SPI_SETNONCLIENTMETRICS                                                        = 0x002A
  14444 	SPI_SETPENWINDOWS                                                              = 0x0031
  14445 	SPI_SETPOWEROFFACTIVE                                                          = 0x0056
  14446 	SPI_SETPOWEROFFTIMEOUT                                                         = 0x0052
  14447 	SPI_SETSCREENREADER                                                            = 0x0047
  14448 	SPI_SETSCREENSAVEACTIVE                                                        = 0x0011
  14449 	SPI_SETSCREENSAVERRUNNING                                                      = 0x0061
  14450 	SPI_SETSCREENSAVETIMEOUT                                                       = 0x000F
  14451 	SPI_SETSELECTIONFADE                                                           = 0x1015
  14452 	SPI_SETSERIALKEYS                                                              = 0x003F
  14453 	SPI_SETSHOWIMEUI                                                               = 0x006F
  14454 	SPI_SETSHOWSOUNDS                                                              = 0x0039
  14455 	SPI_SETSNAPTODEFBUTTON                                                         = 0x0060
  14456 	SPI_SETSOUNDSENTRY                                                             = 0x0041
  14457 	SPI_SETSTICKYKEYS                                                              = 0x003B
  14458 	SPI_SETTOGGLEKEYS                                                              = 0x0035
  14459 	SPI_SETTOOLTIPANIMATION                                                        = 0x1017
  14460 	SPI_SETTOOLTIPFADE                                                             = 0x1019
  14461 	SPI_SETUIEFFECTS                                                               = 0x103F
  14462 	SPI_SETWHEELSCROLLLINES                                                        = 0x0069
  14463 	SPI_SETWORKAREA                                                                = 0x002F
  14464 	SPOINTER_32                                                                    = 0
  14465 	SPOOL_FILE_PERSISTENT                                                          = 0x00000001
  14466 	SPOOL_FILE_TEMPORARY                                                           = 0x00000002
  14467 	SPVERSION_MASK                                                                 = 0x0000FF00
  14468 	SP_APPABORT                                                                    = -2
  14469 	SP_ERROR                                                                       = -1
  14470 	SP_NOTREPORTED                                                                 = 0x4000
  14471 	SP_OUTOFDISK                                                                   = -4
  14472 	SP_OUTOFMEMORY                                                                 = -5
  14473 	SP_USERABORT                                                                   = -3
  14474 	SQLITE3EXT_H                                                                   = 0
  14475 	SQLITE3_H                                                                      = 0
  14476 	SQLITE3_TEXT                                                                   = 3
  14477 	SQLITEINT_H                                                                    = 0
  14478 	SQLITE_ABORT                                                                   = 4
  14479 	SQLITE_ABORT_ROLLBACK                                                          = 516
  14480 	SQLITE_ACCESS_EXISTS                                                           = 0
  14481 	SQLITE_ACCESS_READ                                                             = 2
  14482 	SQLITE_ACCESS_READWRITE                                                        = 1
  14483 	SQLITE_AFF_BLOB                                                                = 0x41
  14484 	SQLITE_AFF_FLEXNUM                                                             = 0x46
  14485 	SQLITE_AFF_INTEGER                                                             = 0x44
  14486 	SQLITE_AFF_MASK                                                                = 0x47
  14487 	SQLITE_AFF_NONE                                                                = 0x40
  14488 	SQLITE_AFF_NUMERIC                                                             = 0x43
  14489 	SQLITE_AFF_REAL                                                                = 0x45
  14490 	SQLITE_AFF_TEXT                                                                = 0x42
  14491 	SQLITE_ALLOW_COVERING_INDEX_SCAN                                               = 1
  14492 	SQLITE_ALTER_TABLE                                                             = 26
  14493 	SQLITE_AMALGAMATION                                                            = 1
  14494 	SQLITE_ANALYZE                                                                 = 28
  14495 	SQLITE_ANY                                                                     = 5
  14496 	SQLITE_API                                                                     = 0
  14497 	SQLITE_APICALL                                                                 = 0
  14498 	SQLITE_ASCII                                                                   = 1
  14499 	SQLITE_ATOMIC_INTRINSICS                                                       = 1
  14500 	SQLITE_ATTACH                                                                  = 24
  14501 	SQLITE_AUTH                                                                    = 23
  14502 	SQLITE_AUTH_USER                                                               = 279
  14503 	SQLITE_AllOpts                                                                 = 0xffffffff
  14504 	SQLITE_AutoIndex                                                               = 0x00008000
  14505 	SQLITE_BIGENDIAN                                                               = 0
  14506 	SQLITE_BIG_DBL                                                                 = 0
  14507 	SQLITE_BLDF1_INDEXED                                                           = 0x0001
  14508 	SQLITE_BLDF1_UNIQUE                                                            = 0x0002
  14509 	SQLITE_BLDF2_2NDPASS                                                           = 0x0004
  14510 	SQLITE_BLOB                                                                    = 4
  14511 	SQLITE_BTREE_H                                                                 = 0
  14512 	SQLITE_BUSY                                                                    = 5
  14513 	SQLITE_BUSY_RECOVERY                                                           = 261
  14514 	SQLITE_BUSY_SNAPSHOT                                                           = 517
  14515 	SQLITE_BUSY_TIMEOUT                                                            = 773
  14516 	SQLITE_BYTEORDER                                                               = 1234
  14517 	SQLITE_BalancedMerge                                                           = 0x00200000
  14518 	SQLITE_BloomFilter                                                             = 0x00080000
  14519 	SQLITE_BloomPulldown                                                           = 0x00100000
  14520 	SQLITE_CALLBACK                                                                = 0
  14521 	SQLITE_CANTOPEN                                                                = 14
  14522 	SQLITE_CANTOPEN_CONVPATH                                                       = 1038
  14523 	SQLITE_CANTOPEN_DIRTYWAL                                                       = 1294
  14524 	SQLITE_CANTOPEN_FULLPATH                                                       = 782
  14525 	SQLITE_CANTOPEN_ISDIR                                                          = 526
  14526 	SQLITE_CANTOPEN_NOTEMPDIR                                                      = 270
  14527 	SQLITE_CANTOPEN_SYMLINK                                                        = 1550
  14528 	SQLITE_CDECL                                                                   = 0
  14529 	SQLITE_CHANGESETAPPLY_INVERT                                                   = 0x0002
  14530 	SQLITE_CHANGESETAPPLY_NOSAVEPOINT                                              = 0x0001
  14531 	SQLITE_CHANGESETSTART_INVERT                                                   = 0x0002
  14532 	SQLITE_CHANGESET_ABORT                                                         = 2
  14533 	SQLITE_CHANGESET_CONFLICT                                                      = 3
  14534 	SQLITE_CHANGESET_CONSTRAINT                                                    = 4
  14535 	SQLITE_CHANGESET_DATA                                                          = 1
  14536 	SQLITE_CHANGESET_FOREIGN_KEY                                                   = 5
  14537 	SQLITE_CHANGESET_NOTFOUND                                                      = 2
  14538 	SQLITE_CHANGESET_OMIT                                                          = 0
  14539 	SQLITE_CHANGESET_REPLACE                                                       = 1
  14540 	SQLITE_CHECKPOINT_FULL                                                         = 1
  14541 	SQLITE_CHECKPOINT_PASSIVE                                                      = 0
  14542 	SQLITE_CHECKPOINT_RESTART                                                      = 2
  14543 	SQLITE_CHECKPOINT_TRUNCATE                                                     = 3
  14544 	SQLITE_CONFIG_COVERING_INDEX_SCAN                                              = 20
  14545 	SQLITE_CONFIG_GETMALLOC                                                        = 5
  14546 	SQLITE_CONFIG_GETMUTEX                                                         = 11
  14547 	SQLITE_CONFIG_GETPCACHE                                                        = 15
  14548 	SQLITE_CONFIG_GETPCACHE2                                                       = 19
  14549 	SQLITE_CONFIG_HEAP                                                             = 8
  14550 	SQLITE_CONFIG_LOG                                                              = 16
  14551 	SQLITE_CONFIG_LOOKASIDE                                                        = 13
  14552 	SQLITE_CONFIG_MALLOC                                                           = 4
  14553 	SQLITE_CONFIG_MEMDB_MAXSIZE                                                    = 29
  14554 	SQLITE_CONFIG_MEMSTATUS                                                        = 9
  14555 	SQLITE_CONFIG_MMAP_SIZE                                                        = 22
  14556 	SQLITE_CONFIG_MULTITHREAD                                                      = 2
  14557 	SQLITE_CONFIG_MUTEX                                                            = 10
  14558 	SQLITE_CONFIG_PAGECACHE                                                        = 7
  14559 	SQLITE_CONFIG_PCACHE                                                           = 14
  14560 	SQLITE_CONFIG_PCACHE2                                                          = 18
  14561 	SQLITE_CONFIG_PCACHE_HDRSZ                                                     = 24
  14562 	SQLITE_CONFIG_PMASZ                                                            = 25
  14563 	SQLITE_CONFIG_SCRATCH                                                          = 6
  14564 	SQLITE_CONFIG_SERIALIZED                                                       = 3
  14565 	SQLITE_CONFIG_SINGLETHREAD                                                     = 1
  14566 	SQLITE_CONFIG_SMALL_MALLOC                                                     = 27
  14567 	SQLITE_CONFIG_SORTERREF_SIZE                                                   = 28
  14568 	SQLITE_CONFIG_SQLLOG                                                           = 21
  14569 	SQLITE_CONFIG_STMTJRNL_SPILL                                                   = 26
  14570 	SQLITE_CONFIG_URI                                                              = 17
  14571 	SQLITE_CONFIG_WIN32_HEAPSIZE                                                   = 23
  14572 	SQLITE_CONSTRAINT                                                              = 19
  14573 	SQLITE_CONSTRAINT_CHECK                                                        = 275
  14574 	SQLITE_CONSTRAINT_COMMITHOOK                                                   = 531
  14575 	SQLITE_CONSTRAINT_DATATYPE                                                     = 3091
  14576 	SQLITE_CONSTRAINT_FOREIGNKEY                                                   = 787
  14577 	SQLITE_CONSTRAINT_FUNCTION                                                     = 1043
  14578 	SQLITE_CONSTRAINT_NOTNULL                                                      = 1299
  14579 	SQLITE_CONSTRAINT_PINNED                                                       = 2835
  14580 	SQLITE_CONSTRAINT_PRIMARYKEY                                                   = 1555
  14581 	SQLITE_CONSTRAINT_ROWID                                                        = 2579
  14582 	SQLITE_CONSTRAINT_TRIGGER                                                      = 1811
  14583 	SQLITE_CONSTRAINT_UNIQUE                                                       = 2067
  14584 	SQLITE_CONSTRAINT_VTAB                                                         = 2323
  14585 	SQLITE_COPY                                                                    = 0
  14586 	SQLITE_CORE                                                                    = 1
  14587 	SQLITE_CORRUPT                                                                 = 11
  14588 	SQLITE_CORRUPT_INDEX                                                           = 779
  14589 	SQLITE_CORRUPT_SEQUENCE                                                        = 523
  14590 	SQLITE_CORRUPT_VTAB                                                            = 267
  14591 	SQLITE_CREATE_INDEX                                                            = 1
  14592 	SQLITE_CREATE_TABLE                                                            = 2
  14593 	SQLITE_CREATE_TEMP_INDEX                                                       = 3
  14594 	SQLITE_CREATE_TEMP_TABLE                                                       = 4
  14595 	SQLITE_CREATE_TEMP_TRIGGER                                                     = 5
  14596 	SQLITE_CREATE_TEMP_VIEW                                                        = 6
  14597 	SQLITE_CREATE_TRIGGER                                                          = 7
  14598 	SQLITE_CREATE_VIEW                                                             = 8
  14599 	SQLITE_CREATE_VTABLE                                                           = 29
  14600 	SQLITE_CacheSpill                                                              = 0x00000020
  14601 	SQLITE_CellSizeCk                                                              = 0x00200000
  14602 	SQLITE_CkptFullFSync                                                           = 0x00000010
  14603 	SQLITE_Coroutines                                                              = 0x02000000
  14604 	SQLITE_CountOfView                                                             = 0x00000200
  14605 	SQLITE_CoverIdxScan                                                            = 0x00000020
  14606 	SQLITE_CursorHints                                                             = 0x00000400
  14607 	SQLITE_DBCONFIG_DEFENSIVE                                                      = 1010
  14608 	SQLITE_DBCONFIG_DQS_DDL                                                        = 1014
  14609 	SQLITE_DBCONFIG_DQS_DML                                                        = 1013
  14610 	SQLITE_DBCONFIG_ENABLE_FKEY                                                    = 1002
  14611 	SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER                                          = 1004
  14612 	SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION                                          = 1005
  14613 	SQLITE_DBCONFIG_ENABLE_QPSG                                                    = 1007
  14614 	SQLITE_DBCONFIG_ENABLE_TRIGGER                                                 = 1003
  14615 	SQLITE_DBCONFIG_ENABLE_VIEW                                                    = 1015
  14616 	SQLITE_DBCONFIG_LEGACY_ALTER_TABLE                                             = 1012
  14617 	SQLITE_DBCONFIG_LEGACY_FILE_FORMAT                                             = 1016
  14618 	SQLITE_DBCONFIG_LOOKASIDE                                                      = 1001
  14619 	SQLITE_DBCONFIG_MAINDBNAME                                                     = 1000
  14620 	SQLITE_DBCONFIG_MAX                                                            = 1017
  14621 	SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE                                               = 1006
  14622 	SQLITE_DBCONFIG_RESET_DATABASE                                                 = 1009
  14623 	SQLITE_DBCONFIG_TRIGGER_EQP                                                    = 1008
  14624 	SQLITE_DBCONFIG_TRUSTED_SCHEMA                                                 = 1017
  14625 	SQLITE_DBCONFIG_WRITABLE_SCHEMA                                                = 1011
  14626 	SQLITE_DBSTATUS_CACHE_HIT                                                      = 7
  14627 	SQLITE_DBSTATUS_CACHE_MISS                                                     = 8
  14628 	SQLITE_DBSTATUS_CACHE_SPILL                                                    = 12
  14629 	SQLITE_DBSTATUS_CACHE_USED                                                     = 1
  14630 	SQLITE_DBSTATUS_CACHE_USED_SHARED                                              = 11
  14631 	SQLITE_DBSTATUS_CACHE_WRITE                                                    = 9
  14632 	SQLITE_DBSTATUS_DEFERRED_FKS                                                   = 10
  14633 	SQLITE_DBSTATUS_LOOKASIDE_HIT                                                  = 4
  14634 	SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL                                            = 6
  14635 	SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE                                            = 5
  14636 	SQLITE_DBSTATUS_LOOKASIDE_USED                                                 = 0
  14637 	SQLITE_DBSTATUS_MAX                                                            = 12
  14638 	SQLITE_DBSTATUS_SCHEMA_USED                                                    = 2
  14639 	SQLITE_DBSTATUS_STMT_USED                                                      = 3
  14640 	SQLITE_DEFAULT_AUTOVACUUM                                                      = 0
  14641 	SQLITE_DEFAULT_CACHE_SIZE                                                      = -2000
  14642 	SQLITE_DEFAULT_FILE_FORMAT                                                     = 4
  14643 	SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT                                              = -1
  14644 	SQLITE_DEFAULT_LOOKASIDE                                                       = 40
  14645 	SQLITE_DEFAULT_MEMSTATUS                                                       = 0
  14646 	SQLITE_DEFAULT_MMAP_SIZE                                                       = 0
  14647 	SQLITE_DEFAULT_PAGE_SIZE                                                       = 4096
  14648 	SQLITE_DEFAULT_PCACHE_INITSZ                                                   = 20
  14649 	SQLITE_DEFAULT_RECURSIVE_TRIGGERS                                              = 0
  14650 	SQLITE_DEFAULT_SECTOR_SIZE                                                     = 4096
  14651 	SQLITE_DEFAULT_SORTERREF_SIZE                                                  = 0x7fffffff
  14652 	SQLITE_DEFAULT_SYNCHRONOUS                                                     = 2
  14653 	SQLITE_DEFAULT_WAL_AUTOCHECKPOINT                                              = 1000
  14654 	SQLITE_DEFAULT_WAL_SYNCHRONOUS                                                 = 2
  14655 	SQLITE_DEFAULT_WORKER_THREADS                                                  = 0
  14656 	SQLITE_DELETE                                                                  = 9
  14657 	SQLITE_DENY                                                                    = 1
  14658 	SQLITE_DEPRECATED                                                              = 0
  14659 	SQLITE_DESERIALIZE_FREEONCLOSE                                                 = 1
  14660 	SQLITE_DESERIALIZE_READONLY                                                    = 4
  14661 	SQLITE_DESERIALIZE_RESIZEABLE                                                  = 2
  14662 	SQLITE_DETACH                                                                  = 25
  14663 	SQLITE_DETERMINISTIC                                                           = 0x000000800
  14664 	SQLITE_DIRECTONLY                                                              = 0x000080000
  14665 	SQLITE_DONE                                                                    = 101
  14666 	SQLITE_DQS                                                                     = 3
  14667 	SQLITE_DROP_INDEX                                                              = 10
  14668 	SQLITE_DROP_TABLE                                                              = 11
  14669 	SQLITE_DROP_TEMP_INDEX                                                         = 12
  14670 	SQLITE_DROP_TEMP_TABLE                                                         = 13
  14671 	SQLITE_DROP_TEMP_TRIGGER                                                       = 14
  14672 	SQLITE_DROP_TEMP_VIEW                                                          = 15
  14673 	SQLITE_DROP_TRIGGER                                                            = 16
  14674 	SQLITE_DROP_VIEW                                                               = 17
  14675 	SQLITE_DROP_VTABLE                                                             = 30
  14676 	SQLITE_Defensive                                                               = 0x10000000
  14677 	SQLITE_DeferFKs                                                                = 0x00080000
  14678 	SQLITE_DistinctOpt                                                             = 0x00000010
  14679 	SQLITE_DqsDDL                                                                  = 0x20000000
  14680 	SQLITE_DqsDML                                                                  = 0x40000000
  14681 	SQLITE_ECEL_DUP                                                                = 0x01
  14682 	SQLITE_ECEL_FACTOR                                                             = 0x02
  14683 	SQLITE_ECEL_OMITREF                                                            = 0x08
  14684 	SQLITE_ECEL_REF                                                                = 0x04
  14685 	SQLITE_EMPTY                                                                   = 16
  14686 	SQLITE_ENABLE_COLUMN_METADATA                                                  = 1
  14687 	SQLITE_ENABLE_FTS5                                                             = 1
  14688 	SQLITE_ENABLE_GEOPOLY                                                          = 1
  14689 	SQLITE_ENABLE_LOCKING_STYLE                                                    = 0
  14690 	SQLITE_ENABLE_MATH_FUNCTIONS                                                   = 1
  14691 	SQLITE_ENABLE_MEMORY_MANAGEMENT                                                = 1
  14692 	SQLITE_ENABLE_OFFSET_SQL_FUNC                                                  = 1
  14693 	SQLITE_ENABLE_PREUPDATE_HOOK                                                   = 1
  14694 	SQLITE_ENABLE_RBU                                                              = 1
  14695 	SQLITE_ENABLE_RTREE                                                            = 1
  14696 	SQLITE_ENABLE_SESSION                                                          = 1
  14697 	SQLITE_ENABLE_SNAPSHOT                                                         = 1
  14698 	SQLITE_ENABLE_STAT4                                                            = 1
  14699 	SQLITE_ENABLE_UNLOCK_NOTIFY                                                    = 1
  14700 	SQLITE_ERROR                                                                   = 1
  14701 	SQLITE_ERROR_MISSING_COLLSEQ                                                   = 257
  14702 	SQLITE_ERROR_RETRY                                                             = 513
  14703 	SQLITE_ERROR_SNAPSHOT                                                          = 769
  14704 	SQLITE_EXPERIMENTAL                                                            = 0
  14705 	SQLITE_EXTENSION_INIT1                                                         = 0
  14706 	SQLITE_EXTENSION_INIT3                                                         = 0
  14707 	SQLITE_EnableQPSG                                                              = 0x00800000
  14708 	SQLITE_EnableTrigger                                                           = 0x00040000
  14709 	SQLITE_EnableView                                                              = 0x80000000
  14710 	SQLITE_FAIL                                                                    = 3
  14711 	SQLITE_FAULTINJECTOR_COUNT                                                     = 1
  14712 	SQLITE_FAULTINJECTOR_MALLOC                                                    = 0
  14713 	SQLITE_FCNTL_BEGIN_ATOMIC_WRITE                                                = 31
  14714 	SQLITE_FCNTL_BUSYHANDLER                                                       = 15
  14715 	SQLITE_FCNTL_CHUNK_SIZE                                                        = 6
  14716 	SQLITE_FCNTL_CKPT_DONE                                                         = 37
  14717 	SQLITE_FCNTL_CKPT_START                                                        = 39
  14718 	SQLITE_FCNTL_CKSM_FILE                                                         = 41
  14719 	SQLITE_FCNTL_COMMIT_ATOMIC_WRITE                                               = 32
  14720 	SQLITE_FCNTL_COMMIT_PHASETWO                                                   = 22
  14721 	SQLITE_FCNTL_DATA_VERSION                                                      = 35
  14722 	SQLITE_FCNTL_DB_UNCHANGED                                                      = 0xca093fa0
  14723 	SQLITE_FCNTL_EXTERNAL_READER                                                   = 40
  14724 	SQLITE_FCNTL_FILE_POINTER                                                      = 7
  14725 	SQLITE_FCNTL_GET_LOCKPROXYFILE                                                 = 2
  14726 	SQLITE_FCNTL_HAS_MOVED                                                         = 20
  14727 	SQLITE_FCNTL_JOURNAL_POINTER                                                   = 28
  14728 	SQLITE_FCNTL_LAST_ERRNO                                                        = 4
  14729 	SQLITE_FCNTL_LOCKSTATE                                                         = 1
  14730 	SQLITE_FCNTL_LOCK_TIMEOUT                                                      = 34
  14731 	SQLITE_FCNTL_MMAP_SIZE                                                         = 18
  14732 	SQLITE_FCNTL_OVERWRITE                                                         = 11
  14733 	SQLITE_FCNTL_PDB                                                               = 30
  14734 	SQLITE_FCNTL_PERSIST_WAL                                                       = 10
  14735 	SQLITE_FCNTL_POWERSAFE_OVERWRITE                                               = 13
  14736 	SQLITE_FCNTL_PRAGMA                                                            = 14
  14737 	SQLITE_FCNTL_RBU                                                               = 26
  14738 	SQLITE_FCNTL_RBUCNT                                                            = 5149216
  14739 	SQLITE_FCNTL_RESERVE_BYTES                                                     = 38
  14740 	SQLITE_FCNTL_RESET_CACHE                                                       = 42
  14741 	SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE                                             = 33
  14742 	SQLITE_FCNTL_SET_LOCKPROXYFILE                                                 = 3
  14743 	SQLITE_FCNTL_SIZE_HINT                                                         = 5
  14744 	SQLITE_FCNTL_SIZE_LIMIT                                                        = 36
  14745 	SQLITE_FCNTL_SYNC                                                              = 21
  14746 	SQLITE_FCNTL_SYNC_OMITTED                                                      = 8
  14747 	SQLITE_FCNTL_TEMPFILENAME                                                      = 16
  14748 	SQLITE_FCNTL_TRACE                                                             = 19
  14749 	SQLITE_FCNTL_VFSNAME                                                           = 12
  14750 	SQLITE_FCNTL_VFS_POINTER                                                       = 27
  14751 	SQLITE_FCNTL_WAL_BLOCK                                                         = 24
  14752 	SQLITE_FCNTL_WIN32_AV_RETRY                                                    = 9
  14753 	SQLITE_FCNTL_WIN32_GET_HANDLE                                                  = 29
  14754 	SQLITE_FCNTL_WIN32_SET_HANDLE                                                  = 23
  14755 	SQLITE_FCNTL_ZIPVFS                                                            = 25
  14756 	SQLITE_FILE_HEADER                                                             = "SQLite format 3"
  14757 	SQLITE_FLOAT                                                                   = 2
  14758 	SQLITE_FORMAT                                                                  = 24
  14759 	SQLITE_FP_PRECISION_LIMIT                                                      = 100000000
  14760 	SQLITE_FRAME_MAGIC                                                             = 0x879fb71e
  14761 	SQLITE_FULL                                                                    = 13
  14762 	SQLITE_FUNCTION                                                                = 31
  14763 	SQLITE_FUNC_ANYORDER                                                           = 0x08000000
  14764 	SQLITE_FUNC_BUILTIN                                                            = 0x00800000
  14765 	SQLITE_FUNC_CASE                                                               = 0x0008
  14766 	SQLITE_FUNC_CONSTANT                                                           = 0x0800
  14767 	SQLITE_FUNC_COUNT                                                              = 0x0100
  14768 	SQLITE_FUNC_DIRECT                                                             = 0x00080000
  14769 	SQLITE_FUNC_ENCMASK                                                            = 0x0003
  14770 	SQLITE_FUNC_EPHEM                                                              = 0x0010
  14771 	SQLITE_FUNC_HASH_SZ                                                            = 23
  14772 	SQLITE_FUNC_INLINE                                                             = 0x00400000
  14773 	SQLITE_FUNC_INTERNAL                                                           = 0x00040000
  14774 	SQLITE_FUNC_LENGTH                                                             = 0x0040
  14775 	SQLITE_FUNC_LIKE                                                               = 0x0004
  14776 	SQLITE_FUNC_MINMAX                                                             = 0x1000
  14777 	SQLITE_FUNC_NEEDCOLL                                                           = 0x0020
  14778 	SQLITE_FUNC_SLOCHNG                                                            = 0x2000
  14779 	SQLITE_FUNC_SUBTYPE                                                            = 0x00100000
  14780 	SQLITE_FUNC_TEST                                                               = 0x4000
  14781 	SQLITE_FUNC_TYPEOF                                                             = 0x0080
  14782 	SQLITE_FUNC_UNLIKELY                                                           = 0x0400
  14783 	SQLITE_FUNC_UNSAFE                                                             = 0x00200000
  14784 	SQLITE_FUNC_WINDOW                                                             = 0x00010000
  14785 	SQLITE_FactorOutConst                                                          = 0x00000008
  14786 	SQLITE_FlttnUnionAll                                                           = 0x00800000
  14787 	SQLITE_ForeignKeys                                                             = 0x00004000
  14788 	SQLITE_Fts3Tokenizer                                                           = 0x00400000
  14789 	SQLITE_FullColNames                                                            = 0x00000004
  14790 	SQLITE_FullFSync                                                               = 0x00000008
  14791 	SQLITE_GET_LOCKPROXYFILE                                                       = 2
  14792 	SQLITE_GroupByOrder                                                            = 0x00000004
  14793 	SQLITE_HASH_H                                                                  = 0
  14794 	SQLITE_HAVE_C99_MATH_FUNCS                                                     = 1
  14795 	SQLITE_IDXTYPE_APPDEF                                                          = 0
  14796 	SQLITE_IDXTYPE_IPK                                                             = 3
  14797 	SQLITE_IDXTYPE_PRIMARYKEY                                                      = 2
  14798 	SQLITE_IDXTYPE_UNIQUE                                                          = 1
  14799 	SQLITE_IGNORE                                                                  = 2
  14800 	SQLITE_INDEX_CONSTRAINT_EQ                                                     = 2
  14801 	SQLITE_INDEX_CONSTRAINT_FUNCTION                                               = 150
  14802 	SQLITE_INDEX_CONSTRAINT_GE                                                     = 32
  14803 	SQLITE_INDEX_CONSTRAINT_GLOB                                                   = 66
  14804 	SQLITE_INDEX_CONSTRAINT_GT                                                     = 4
  14805 	SQLITE_INDEX_CONSTRAINT_IS                                                     = 72
  14806 	SQLITE_INDEX_CONSTRAINT_ISNOT                                                  = 69
  14807 	SQLITE_INDEX_CONSTRAINT_ISNOTNULL                                              = 70
  14808 	SQLITE_INDEX_CONSTRAINT_ISNULL                                                 = 71
  14809 	SQLITE_INDEX_CONSTRAINT_LE                                                     = 8
  14810 	SQLITE_INDEX_CONSTRAINT_LIKE                                                   = 65
  14811 	SQLITE_INDEX_CONSTRAINT_LIMIT                                                  = 73
  14812 	SQLITE_INDEX_CONSTRAINT_LT                                                     = 16
  14813 	SQLITE_INDEX_CONSTRAINT_MATCH                                                  = 64
  14814 	SQLITE_INDEX_CONSTRAINT_NE                                                     = 68
  14815 	SQLITE_INDEX_CONSTRAINT_OFFSET                                                 = 74
  14816 	SQLITE_INDEX_CONSTRAINT_REGEXP                                                 = 67
  14817 	SQLITE_INDEX_SCAN_UNIQUE                                                       = 1
  14818 	SQLITE_INNOCUOUS                                                               = 0x000200000
  14819 	SQLITE_INSERT                                                                  = 18
  14820 	SQLITE_INTEGER                                                                 = 1
  14821 	SQLITE_INTEGRITY_CHECK_ERROR_MAX                                               = 100
  14822 	SQLITE_INTERNAL                                                                = 2
  14823 	SQLITE_INTERRUPT                                                               = 9
  14824 	SQLITE_IOCAP_ATOMIC                                                            = 0x00000001
  14825 	SQLITE_IOCAP_ATOMIC16K                                                         = 0x00000040
  14826 	SQLITE_IOCAP_ATOMIC1K                                                          = 0x00000004
  14827 	SQLITE_IOCAP_ATOMIC2K                                                          = 0x00000008
  14828 	SQLITE_IOCAP_ATOMIC32K                                                         = 0x00000080
  14829 	SQLITE_IOCAP_ATOMIC4K                                                          = 0x00000010
  14830 	SQLITE_IOCAP_ATOMIC512                                                         = 0x00000002
  14831 	SQLITE_IOCAP_ATOMIC64K                                                         = 0x00000100
  14832 	SQLITE_IOCAP_ATOMIC8K                                                          = 0x00000020
  14833 	SQLITE_IOCAP_BATCH_ATOMIC                                                      = 0x00004000
  14834 	SQLITE_IOCAP_IMMUTABLE                                                         = 0x00002000
  14835 	SQLITE_IOCAP_POWERSAFE_OVERWRITE                                               = 0x00001000
  14836 	SQLITE_IOCAP_SAFE_APPEND                                                       = 0x00000200
  14837 	SQLITE_IOCAP_SEQUENTIAL                                                        = 0x00000400
  14838 	SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN                                             = 0x00000800
  14839 	SQLITE_IOERR                                                                   = 10
  14840 	SQLITE_IOERR_ACCESS                                                            = 3338
  14841 	SQLITE_IOERR_AUTH                                                              = 7178
  14842 	SQLITE_IOERR_BEGIN_ATOMIC                                                      = 7434
  14843 	SQLITE_IOERR_BLOCKED                                                           = 2826
  14844 	SQLITE_IOERR_CHECKRESERVEDLOCK                                                 = 3594
  14845 	SQLITE_IOERR_CLOSE                                                             = 4106
  14846 	SQLITE_IOERR_COMMIT_ATOMIC                                                     = 7690
  14847 	SQLITE_IOERR_CONVPATH                                                          = 6666
  14848 	SQLITE_IOERR_CORRUPTFS                                                         = 8458
  14849 	SQLITE_IOERR_DATA                                                              = 8202
  14850 	SQLITE_IOERR_DELETE                                                            = 2570
  14851 	SQLITE_IOERR_DELETE_NOENT                                                      = 5898
  14852 	SQLITE_IOERR_DIR_CLOSE                                                         = 4362
  14853 	SQLITE_IOERR_DIR_FSYNC                                                         = 1290
  14854 	SQLITE_IOERR_FSTAT                                                             = 1802
  14855 	SQLITE_IOERR_FSYNC                                                             = 1034
  14856 	SQLITE_IOERR_GETTEMPPATH                                                       = 6410
  14857 	SQLITE_IOERR_LOCK                                                              = 3850
  14858 	SQLITE_IOERR_MMAP                                                              = 6154
  14859 	SQLITE_IOERR_NOMEM                                                             = 3082
  14860 	SQLITE_IOERR_NOMEM_BKPT                                                        = 3082
  14861 	SQLITE_IOERR_RDLOCK                                                            = 2314
  14862 	SQLITE_IOERR_READ                                                              = 266
  14863 	SQLITE_IOERR_ROLLBACK_ATOMIC                                                   = 7946
  14864 	SQLITE_IOERR_SEEK                                                              = 5642
  14865 	SQLITE_IOERR_SHMLOCK                                                           = 5130
  14866 	SQLITE_IOERR_SHMMAP                                                            = 5386
  14867 	SQLITE_IOERR_SHMOPEN                                                           = 4618
  14868 	SQLITE_IOERR_SHMSIZE                                                           = 4874
  14869 	SQLITE_IOERR_SHORT_READ                                                        = 522
  14870 	SQLITE_IOERR_TRUNCATE                                                          = 1546
  14871 	SQLITE_IOERR_UNLOCK                                                            = 2058
  14872 	SQLITE_IOERR_VNODE                                                             = 6922
  14873 	SQLITE_IOERR_WRITE                                                             = 778
  14874 	SQLITE_IgnoreChecks                                                            = 0x00000200
  14875 	SQLITE_IndexedExpr                                                             = 0x01000000
  14876 	SQLITE_JUMPIFNULL                                                              = 0x10
  14877 	SQLITE_LAST_ERRNO                                                              = 4
  14878 	SQLITE_LIKE_DOESNT_MATCH_BLOBS                                                 = 1
  14879 	SQLITE_LIMIT_ATTACHED                                                          = 7
  14880 	SQLITE_LIMIT_COLUMN                                                            = 2
  14881 	SQLITE_LIMIT_COMPOUND_SELECT                                                   = 4
  14882 	SQLITE_LIMIT_EXPR_DEPTH                                                        = 3
  14883 	SQLITE_LIMIT_FUNCTION_ARG                                                      = 6
  14884 	SQLITE_LIMIT_LENGTH                                                            = 0
  14885 	SQLITE_LIMIT_LIKE_PATTERN_LENGTH                                               = 8
  14886 	SQLITE_LIMIT_SQL_LENGTH                                                        = 1
  14887 	SQLITE_LIMIT_TRIGGER_DEPTH                                                     = 10
  14888 	SQLITE_LIMIT_VARIABLE_NUMBER                                                   = 9
  14889 	SQLITE_LIMIT_VDBE_OP                                                           = 5
  14890 	SQLITE_LIMIT_WORKER_THREADS                                                    = 11
  14891 	SQLITE_LITTLEENDIAN                                                            = 1
  14892 	SQLITE_LOCKED                                                                  = 6
  14893 	SQLITE_LOCKED_SHAREDCACHE                                                      = 262
  14894 	SQLITE_LOCKED_VTAB                                                             = 518
  14895 	SQLITE_LOCKFILEEX_FLAGS                                                        = 1
  14896 	SQLITE_LOCKFILE_FLAGS                                                          = 3
  14897 	SQLITE_LOCK_EXCLUSIVE                                                          = 4
  14898 	SQLITE_LOCK_NONE                                                               = 0
  14899 	SQLITE_LOCK_PENDING                                                            = 3
  14900 	SQLITE_LOCK_RESERVED                                                           = 2
  14901 	SQLITE_LOCK_SHARED                                                             = 1
  14902 	SQLITE_LegacyAlter                                                             = 0x04000000
  14903 	SQLITE_LegacyFileFmt                                                           = 0x00000002
  14904 	SQLITE_LoadExtFunc                                                             = 0x00020000
  14905 	SQLITE_LoadExtension                                                           = 0x00010000
  14906 	SQLITE_MALLOC_SOFT_LIMIT                                                       = 1024
  14907 	SQLITE_MATCH                                                                   = 0
  14908 	SQLITE_MAX_ALLOCATION_SIZE                                                     = 2147483391
  14909 	SQLITE_MAX_ATTACHED                                                            = 10
  14910 	SQLITE_MAX_COLUMN                                                              = 2000
  14911 	SQLITE_MAX_COMPOUND_SELECT                                                     = 500
  14912 	SQLITE_MAX_DB                                                                  = 12
  14913 	SQLITE_MAX_DEFAULT_PAGE_SIZE                                                   = 8192
  14914 	SQLITE_MAX_EXPR_DEPTH                                                          = 1000
  14915 	SQLITE_MAX_FILE_FORMAT                                                         = 4
  14916 	SQLITE_MAX_FUNCTION_ARG                                                        = 127
  14917 	SQLITE_MAX_LENGTH                                                              = 1000000000
  14918 	SQLITE_MAX_LIKE_PATTERN_LENGTH                                                 = 50000
  14919 	SQLITE_MAX_MEMORY                                                              = 0
  14920 	SQLITE_MAX_MMAP_SIZE                                                           = 0x7fff0000
  14921 	SQLITE_MAX_PAGE_COUNT                                                          = 1073741823
  14922 	SQLITE_MAX_PAGE_SIZE                                                           = 65536
  14923 	SQLITE_MAX_PATHLEN                                                             = 260
  14924 	SQLITE_MAX_PMASZ                                                               = 536870912
  14925 	SQLITE_MAX_PREPARE_RETRY                                                       = 25
  14926 	SQLITE_MAX_SCHEMA_RETRY                                                        = 50
  14927 	SQLITE_MAX_SQL_LENGTH                                                          = 1000000000
  14928 	SQLITE_MAX_SRCLIST                                                             = 200
  14929 	SQLITE_MAX_SYMLINK                                                             = 200
  14930 	SQLITE_MAX_TRIGGER_DEPTH                                                       = 1000
  14931 	SQLITE_MAX_VARIABLE_NUMBER                                                     = 32766
  14932 	SQLITE_MAX_VDBE_OP                                                             = 250000000
  14933 	SQLITE_MAX_WORKER_THREADS                                                      = 8
  14934 	SQLITE_MEMDB_DEFAULT_MAXSIZE                                                   = 1073741824
  14935 	SQLITE_MISMATCH                                                                = 20
  14936 	SQLITE_MISUSE                                                                  = 21
  14937 	SQLITE_MSVC_H                                                                  = 0
  14938 	SQLITE_MUTEX_APPDEF                                                            = 1
  14939 	SQLITE_MUTEX_FAST                                                              = 0
  14940 	SQLITE_MUTEX_NOOP                                                              = 1
  14941 	SQLITE_MUTEX_RECURSIVE                                                         = 1
  14942 	SQLITE_MUTEX_STATIC_APP1                                                       = 8
  14943 	SQLITE_MUTEX_STATIC_APP2                                                       = 9
  14944 	SQLITE_MUTEX_STATIC_APP3                                                       = 10
  14945 	SQLITE_MUTEX_STATIC_LRU                                                        = 6
  14946 	SQLITE_MUTEX_STATIC_LRU2                                                       = 7
  14947 	SQLITE_MUTEX_STATIC_MAIN                                                       = 2
  14948 	SQLITE_MUTEX_STATIC_MASTER                                                     = 2
  14949 	SQLITE_MUTEX_STATIC_MEM                                                        = 3
  14950 	SQLITE_MUTEX_STATIC_MEM2                                                       = 4
  14951 	SQLITE_MUTEX_STATIC_OPEN                                                       = 4
  14952 	SQLITE_MUTEX_STATIC_PMEM                                                       = 7
  14953 	SQLITE_MUTEX_STATIC_PRNG                                                       = 5
  14954 	SQLITE_MUTEX_STATIC_TEMPDIR                                                    = 11
  14955 	SQLITE_MUTEX_STATIC_VFS1                                                       = 11
  14956 	SQLITE_MUTEX_STATIC_VFS2                                                       = 12
  14957 	SQLITE_MUTEX_STATIC_VFS3                                                       = 13
  14958 	SQLITE_MX_JUMP_OPCODE                                                          = 64
  14959 	SQLITE_MinMaxOpt                                                               = 0x00010000
  14960 	SQLITE_NOLFS                                                                   = 22
  14961 	SQLITE_NOMATCH                                                                 = 1
  14962 	SQLITE_NOMEM                                                                   = 7
  14963 	SQLITE_NOMEM_BKPT                                                              = 7
  14964 	SQLITE_NOTADB                                                                  = 26
  14965 	SQLITE_NOTFOUND                                                                = 12
  14966 	SQLITE_NOTICE                                                                  = 27
  14967 	SQLITE_NOTICE_RBU                                                              = 795
  14968 	SQLITE_NOTICE_RECOVER_ROLLBACK                                                 = 539
  14969 	SQLITE_NOTICE_RECOVER_WAL                                                      = 283
  14970 	SQLITE_NOTNULL                                                                 = 0x90
  14971 	SQLITE_NOWILDCARDMATCH                                                         = 2
  14972 	SQLITE_NO_TSAN                                                                 = 0
  14973 	SQLITE_NTUNE                                                                   = 6
  14974 	SQLITE_NULL                                                                    = 5
  14975 	SQLITE_NULLEQ                                                                  = 0x80
  14976 	SQLITE_N_BTREE_META                                                            = 16
  14977 	SQLITE_N_KEYWORD                                                               = 147
  14978 	SQLITE_N_LIMIT                                                                 = 12
  14979 	SQLITE_N_STDTYPE                                                               = 6
  14980 	SQLITE_NoCkptOnClose                                                           = 0x00000800
  14981 	SQLITE_NoSchemaError                                                           = 0x08000000
  14982 	SQLITE_NullCallback                                                            = 0x00000100
  14983 	SQLITE_OK                                                                      = 0
  14984 	SQLITE_OK_LOAD_PERMANENTLY                                                     = 256
  14985 	SQLITE_OK_SYMLINK                                                              = 512
  14986 	SQLITE_OPEN_AUTOPROXY                                                          = 0x00000020
  14987 	SQLITE_OPEN_CREATE                                                             = 0x00000004
  14988 	SQLITE_OPEN_DELETEONCLOSE                                                      = 0x00000008
  14989 	SQLITE_OPEN_EXCLUSIVE                                                          = 0x00000010
  14990 	SQLITE_OPEN_EXRESCODE                                                          = 0x02000000
  14991 	SQLITE_OPEN_FULLMUTEX                                                          = 0x00010000
  14992 	SQLITE_OPEN_MAIN_DB                                                            = 0x00000100
  14993 	SQLITE_OPEN_MAIN_JOURNAL                                                       = 0x00000800
  14994 	SQLITE_OPEN_MASTER_JOURNAL                                                     = 0x00004000
  14995 	SQLITE_OPEN_MEMORY                                                             = 0x00000080
  14996 	SQLITE_OPEN_NOFOLLOW                                                           = 0x01000000
  14997 	SQLITE_OPEN_NOMUTEX                                                            = 0x00008000
  14998 	SQLITE_OPEN_PRIVATECACHE                                                       = 0x00040000
  14999 	SQLITE_OPEN_READONLY                                                           = 0x00000001
  15000 	SQLITE_OPEN_READWRITE                                                          = 0x00000002
  15001 	SQLITE_OPEN_SHAREDCACHE                                                        = 0x00020000
  15002 	SQLITE_OPEN_SUBJOURNAL                                                         = 0x00002000
  15003 	SQLITE_OPEN_SUPER_JOURNAL                                                      = 0x00004000
  15004 	SQLITE_OPEN_TEMP_DB                                                            = 0x00000200
  15005 	SQLITE_OPEN_TEMP_JOURNAL                                                       = 0x00001000
  15006 	SQLITE_OPEN_TRANSIENT_DB                                                       = 0x00000400
  15007 	SQLITE_OPEN_URI                                                                = 0x00000040
  15008 	SQLITE_OPEN_WAL                                                                = 0x00080000
  15009 	SQLITE_OS_KV                                                                   = 0
  15010 	SQLITE_OS_OTHER                                                                = 0
  15011 	SQLITE_OS_SETUP_H                                                              = 0
  15012 	SQLITE_OS_UNIX                                                                 = 0
  15013 	SQLITE_OS_WIN                                                                  = 1
  15014 	SQLITE_OS_WINCE                                                                = 0
  15015 	SQLITE_OS_WINNT                                                                = 1
  15016 	SQLITE_OS_WINRT                                                                = 0
  15017 	SQLITE_OS_WIN_H                                                                = 0
  15018 	SQLITE_OS_WIN_THREADS                                                          = 1
  15019 	SQLITE_OmitNoopJoin                                                            = 0x00000100
  15020 	SQLITE_OmitOrderBy                                                             = 0x00040000
  15021 	SQLITE_OrderByIdxJoin                                                          = 0x00000040
  15022 	SQLITE_PAGER_H                                                                 = 0
  15023 	SQLITE_PERM                                                                    = 3
  15024 	SQLITE_POWERSAFE_OVERWRITE                                                     = 1
  15025 	SQLITE_PRAGMA                                                                  = 19
  15026 	SQLITE_PREPARE_MASK                                                            = 0x0f
  15027 	SQLITE_PREPARE_NORMALIZE                                                       = 0x02
  15028 	SQLITE_PREPARE_NO_VTAB                                                         = 0x04
  15029 	SQLITE_PREPARE_PERSISTENT                                                      = 0x01
  15030 	SQLITE_PREPARE_SAVESQL                                                         = 0x80
  15031 	SQLITE_PRINTF_INTERNAL                                                         = 0x01
  15032 	SQLITE_PRINTF_MALLOCED                                                         = 0x04
  15033 	SQLITE_PRINTF_SQLFUNC                                                          = 0x02
  15034 	SQLITE_PRINT_BUF_SIZE                                                          = 70
  15035 	SQLITE_PRIVATE                                                                 = 0
  15036 	SQLITE_PROTOCOL                                                                = 15
  15037 	SQLITE_PTRSIZE                                                                 = 8
  15038 	SQLITE_PropagateConst                                                          = 0x00008000
  15039 	SQLITE_PushDown                                                                = 0x00001000
  15040 	SQLITE_QUERY_PLANNER_LIMIT                                                     = 20000
  15041 	SQLITE_QUERY_PLANNER_LIMIT_INCR                                                = 1000
  15042 	SQLITE_QueryFlattener                                                          = 0x00000001
  15043 	SQLITE_QueryOnly                                                               = 0x00100000
  15044 	SQLITE_RANGE                                                                   = 25
  15045 	SQLITE_RBU_STATE_CHECKPOINT                                                    = 3
  15046 	SQLITE_RBU_STATE_DONE                                                          = 4
  15047 	SQLITE_RBU_STATE_ERROR                                                         = 5
  15048 	SQLITE_RBU_STATE_MOVE                                                          = 2
  15049 	SQLITE_RBU_STATE_OAL                                                           = 1
  15050 	SQLITE_RBU_UPDATE_CACHESIZE                                                    = 16
  15051 	SQLITE_READ                                                                    = 20
  15052 	SQLITE_READONLY                                                                = 8
  15053 	SQLITE_READONLY_CANTINIT                                                       = 1288
  15054 	SQLITE_READONLY_CANTLOCK                                                       = 520
  15055 	SQLITE_READONLY_DBMOVED                                                        = 1032
  15056 	SQLITE_READONLY_DIRECTORY                                                      = 1544
  15057 	SQLITE_READONLY_RECOVERY                                                       = 264
  15058 	SQLITE_READONLY_ROLLBACK                                                       = 776
  15059 	SQLITE_RECURSIVE                                                               = 33
  15060 	SQLITE_REINDEX                                                                 = 27
  15061 	SQLITE_REPLACE                                                                 = 5
  15062 	SQLITE_ROLLBACK                                                                = 1
  15063 	SQLITE_ROW                                                                     = 100
  15064 	SQLITE_ReadUncommit                                                            = 0x00000400
  15065 	SQLITE_RecTriggers                                                             = 0x00002000
  15066 	SQLITE_ReleaseReg                                                              = 0x00400000
  15067 	SQLITE_ResetDatabase                                                           = 0x02000000
  15068 	SQLITE_ReverseOrder                                                            = 0x00001000
  15069 	SQLITE_SAVEPOINT                                                               = 32
  15070 	SQLITE_SCANSTAT_COMPLEX                                                        = 0x0001
  15071 	SQLITE_SCANSTAT_EST                                                            = 2
  15072 	SQLITE_SCANSTAT_EXPLAIN                                                        = 4
  15073 	SQLITE_SCANSTAT_NAME                                                           = 3
  15074 	SQLITE_SCANSTAT_NCYCLE                                                         = 7
  15075 	SQLITE_SCANSTAT_NLOOP                                                          = 0
  15076 	SQLITE_SCANSTAT_NVISIT                                                         = 1
  15077 	SQLITE_SCANSTAT_PARENTID                                                       = 6
  15078 	SQLITE_SCANSTAT_SELECTID                                                       = 5
  15079 	SQLITE_SCHEMA                                                                  = 17
  15080 	SQLITE_SELECT                                                                  = 21
  15081 	SQLITE_SERIALIZE_NOCOPY                                                        = 0x001
  15082 	SQLITE_SESSION_CONFIG_STRMSIZE                                                 = 1
  15083 	SQLITE_SESSION_OBJCONFIG_SIZE                                                  = 1
  15084 	SQLITE_SET_LOCKPROXYFILE                                                       = 3
  15085 	SQLITE_SHM_EXCLUSIVE                                                           = 8
  15086 	SQLITE_SHM_LOCK                                                                = 2
  15087 	SQLITE_SHM_NLOCK                                                               = 8
  15088 	SQLITE_SHM_SHARED                                                              = 4
  15089 	SQLITE_SHM_UNLOCK                                                              = 1
  15090 	SQLITE_SORTER_PMASZ                                                            = 250
  15091 	SQLITE_SOUNDEX                                                                 = 1
  15092 	SQLITE_SOURCE_ID                                                               = "2023-03-22 11:56:21 0d1fc92f94cb6b76bffe3ec34d69cffde2924203304e8ffc4155597af0c191da"
  15093 	SQLITE_SO_ASC                                                                  = 0
  15094 	SQLITE_SO_DESC                                                                 = 1
  15095 	SQLITE_SO_UNDEFINED                                                            = -1
  15096 	SQLITE_STAT4_SAMPLES                                                           = 24
  15097 	SQLITE_STATE_BUSY                                                              = 0x6d
  15098 	SQLITE_STATE_CLOSED                                                            = 0xce
  15099 	SQLITE_STATE_ERROR                                                             = 0xd5
  15100 	SQLITE_STATE_OPEN                                                              = 0x76
  15101 	SQLITE_STATE_SICK                                                              = 0xba
  15102 	SQLITE_STATE_ZOMBIE                                                            = 0xa7
  15103 	SQLITE_STATUS_MALLOC_COUNT                                                     = 9
  15104 	SQLITE_STATUS_MALLOC_SIZE                                                      = 5
  15105 	SQLITE_STATUS_MEMORY_USED                                                      = 0
  15106 	SQLITE_STATUS_PAGECACHE_OVERFLOW                                               = 2
  15107 	SQLITE_STATUS_PAGECACHE_SIZE                                                   = 7
  15108 	SQLITE_STATUS_PAGECACHE_USED                                                   = 1
  15109 	SQLITE_STATUS_PARSER_STACK                                                     = 6
  15110 	SQLITE_STATUS_SCRATCH_OVERFLOW                                                 = 4
  15111 	SQLITE_STATUS_SCRATCH_SIZE                                                     = 8
  15112 	SQLITE_STATUS_SCRATCH_USED                                                     = 3
  15113 	SQLITE_STDCALL                                                                 = 0
  15114 	SQLITE_STMTJRNL_SPILL                                                          = 65536
  15115 	SQLITE_STMTSTATUS_AUTOINDEX                                                    = 3
  15116 	SQLITE_STMTSTATUS_FILTER_HIT                                                   = 8
  15117 	SQLITE_STMTSTATUS_FILTER_MISS                                                  = 7
  15118 	SQLITE_STMTSTATUS_FULLSCAN_STEP                                                = 1
  15119 	SQLITE_STMTSTATUS_MEMUSED                                                      = 99
  15120 	SQLITE_STMTSTATUS_REPREPARE                                                    = 5
  15121 	SQLITE_STMTSTATUS_RUN                                                          = 6
  15122 	SQLITE_STMTSTATUS_SORT                                                         = 2
  15123 	SQLITE_STMTSTATUS_VM_STEP                                                      = 4
  15124 	SQLITE_SUBTYPE                                                                 = 0x000100000
  15125 	SQLITE_SYNC_DATAONLY                                                           = 0x00010
  15126 	SQLITE_SYNC_FULL                                                               = 0x00003
  15127 	SQLITE_SYNC_NORMAL                                                             = 0x00002
  15128 	SQLITE_SYSAPI                                                                  = 0
  15129 	SQLITE_SYSTEM_MALLOC                                                           = 1
  15130 	SQLITE_SeekScan                                                                = 0x00020000
  15131 	SQLITE_ShortColNames                                                           = 0x00000040
  15132 	SQLITE_SimplifyJoin                                                            = 0x00002000
  15133 	SQLITE_SkipScan                                                                = 0x00004000
  15134 	SQLITE_Stat4                                                                   = 0x00000800
  15135 	SQLITE_TCLAPI                                                                  = 0
  15136 	SQLITE_TEMP_FILE_PREFIX                                                        = "etilqs_"
  15137 	SQLITE_TEMP_STORE                                                              = 1
  15138 	SQLITE_TESTCTRL_ALWAYS                                                         = 13
  15139 	SQLITE_TESTCTRL_ASSERT                                                         = 12
  15140 	SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS                                            = 10
  15141 	SQLITE_TESTCTRL_BITVEC_TEST                                                    = 8
  15142 	SQLITE_TESTCTRL_BYTEORDER                                                      = 22
  15143 	SQLITE_TESTCTRL_EXPLAIN_STMT                                                   = 19
  15144 	SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS                                            = 29
  15145 	SQLITE_TESTCTRL_FAULT_INSTALL                                                  = 9
  15146 	SQLITE_TESTCTRL_FIRST                                                          = 5
  15147 	SQLITE_TESTCTRL_IMPOSTER                                                       = 25
  15148 	SQLITE_TESTCTRL_INTERNAL_FUNCTIONS                                             = 17
  15149 	SQLITE_TESTCTRL_ISINIT                                                         = 23
  15150 	SQLITE_TESTCTRL_ISKEYWORD                                                      = 16
  15151 	SQLITE_TESTCTRL_LAST                                                           = 33
  15152 	SQLITE_TESTCTRL_LOCALTIME_FAULT                                                = 18
  15153 	SQLITE_TESTCTRL_LOGEST                                                         = 33
  15154 	SQLITE_TESTCTRL_NEVER_CORRUPT                                                  = 20
  15155 	SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD                                           = 19
  15156 	SQLITE_TESTCTRL_OPTIMIZATIONS                                                  = 15
  15157 	SQLITE_TESTCTRL_PARSER_COVERAGE                                                = 26
  15158 	SQLITE_TESTCTRL_PENDING_BYTE                                                   = 11
  15159 	SQLITE_TESTCTRL_PRNG_RESET                                                     = 7
  15160 	SQLITE_TESTCTRL_PRNG_RESTORE                                                   = 6
  15161 	SQLITE_TESTCTRL_PRNG_SAVE                                                      = 5
  15162 	SQLITE_TESTCTRL_PRNG_SEED                                                      = 28
  15163 	SQLITE_TESTCTRL_RESERVE                                                        = 14
  15164 	SQLITE_TESTCTRL_RESULT_INTREAL                                                 = 27
  15165 	SQLITE_TESTCTRL_SCRATCHMALLOC                                                  = 17
  15166 	SQLITE_TESTCTRL_SEEK_COUNT                                                     = 30
  15167 	SQLITE_TESTCTRL_SORTER_MMAP                                                    = 24
  15168 	SQLITE_TESTCTRL_TRACEFLAGS                                                     = 31
  15169 	SQLITE_TESTCTRL_TUNE                                                           = 32
  15170 	SQLITE_TESTCTRL_VDBE_COVERAGE                                                  = 21
  15171 	SQLITE_TEXT                                                                    = 3
  15172 	SQLITE_THREADSAFE                                                              = 1
  15173 	SQLITE_THREADS_IMPLEMENTED                                                     = 1
  15174 	SQLITE_TOKEN_KEYWORD                                                           = 0x2
  15175 	SQLITE_TOKEN_QUOTED                                                            = 0x1
  15176 	SQLITE_TOOBIG                                                                  = 18
  15177 	SQLITE_TRACE_CLOSE                                                             = 0x08
  15178 	SQLITE_TRACE_LEGACY                                                            = 0x40
  15179 	SQLITE_TRACE_NONLEGACY_MASK                                                    = 0x0f
  15180 	SQLITE_TRACE_PROFILE                                                           = 0x02
  15181 	SQLITE_TRACE_ROW                                                               = 0x04
  15182 	SQLITE_TRACE_STMT                                                              = 0x01
  15183 	SQLITE_TRACE_XPROFILE                                                          = 0x80
  15184 	SQLITE_TRANSACTION                                                             = 22
  15185 	SQLITE_TXN_NONE                                                                = 0
  15186 	SQLITE_TXN_READ                                                                = 1
  15187 	SQLITE_TXN_WRITE                                                               = 2
  15188 	SQLITE_Transitive                                                              = 0x00000080
  15189 	SQLITE_TriggerEQP                                                              = 0x01000000
  15190 	SQLITE_TrustedSchema                                                           = 0x00000080
  15191 	SQLITE_UPDATE                                                                  = 23
  15192 	SQLITE_USE_MALLOC_H                                                            = 0
  15193 	SQLITE_USE_MSIZE                                                               = 0
  15194 	SQLITE_USE_URI                                                                 = 0
  15195 	SQLITE_UTF16                                                                   = 4
  15196 	SQLITE_UTF16BE                                                                 = 3
  15197 	SQLITE_UTF16LE                                                                 = 2
  15198 	SQLITE_UTF16NATIVE                                                             = 2
  15199 	SQLITE_UTF16_ALIGNED                                                           = 8
  15200 	SQLITE_UTF8                                                                    = 1
  15201 	SQLITE_VDBEINT_H                                                               = 0
  15202 	SQLITE_VDBE_H                                                                  = 0
  15203 	SQLITE_VERSION                                                                 = "3.41.2"
  15204 	SQLITE_VERSION_NUMBER                                                          = 3041002
  15205 	SQLITE_VTABRISK_High                                                           = 2
  15206 	SQLITE_VTABRISK_Low                                                            = 0
  15207 	SQLITE_VTABRISK_Normal                                                         = 1
  15208 	SQLITE_VTAB_CONSTRAINT_SUPPORT                                                 = 1
  15209 	SQLITE_VTAB_DIRECTONLY                                                         = 3
  15210 	SQLITE_VTAB_INNOCUOUS                                                          = 2
  15211 	SQLITE_WAL_H                                                                   = 0
  15212 	SQLITE_WARNING                                                                 = 28
  15213 	SQLITE_WARNING_AUTOINDEX                                                       = 284
  15214 	SQLITE_WHEREINT_H                                                              = 0
  15215 	SQLITE_WIN32_CREATEFILEMAPPINGA                                                = 1
  15216 	SQLITE_WIN32_DATA_DIRECTORY_TYPE                                               = 1
  15217 	SQLITE_WIN32_GETVERSIONEX                                                      = 1
  15218 	SQLITE_WIN32_HAS_ANSI                                                          = 0
  15219 	SQLITE_WIN32_HAS_WIDE                                                          = 0
  15220 	SQLITE_WIN32_IOERR_RETRY                                                       = 10
  15221 	SQLITE_WIN32_IOERR_RETRY_DELAY                                                 = 25
  15222 	SQLITE_WIN32_MAX_ERRMSG_CHARS                                                  = 1024
  15223 	SQLITE_WIN32_MAX_PATH_BYTES                                                    = 1040
  15224 	SQLITE_WIN32_MAX_PATH_CHARS                                                    = 260
  15225 	SQLITE_WIN32_TEMP_DIRECTORY_TYPE                                               = 2
  15226 	SQLITE_WINNT_MAX_PATH_CHARS                                                    = 32767
  15227 	SQLITE_WSD                                                                     = 0
  15228 	SQLITE_WindowFunc                                                              = 0x00000002
  15229 	SQLITE_WriteSchema                                                             = 0x00000001
  15230 	SRT_Coroutine                                                                  = 13
  15231 	SRT_Discard                                                                    = 4
  15232 	SRT_DistFifo                                                                   = 5
  15233 	SRT_DistQueue                                                                  = 6
  15234 	SRT_EphemTab                                                                   = 12
  15235 	SRT_Except                                                                     = 2
  15236 	SRT_Exists                                                                     = 3
  15237 	SRT_Fifo                                                                       = 8
  15238 	SRT_Mem                                                                        = 10
  15239 	SRT_Output                                                                     = 9
  15240 	SRT_Queue                                                                      = 7
  15241 	SRT_Set                                                                        = 11
  15242 	SRT_Table                                                                      = 14
  15243 	SRT_Union                                                                      = 1
  15244 	SRT_Upfrom                                                                     = 15
  15245 	SSF_AVAILABLE                                                                  = 0x00000002
  15246 	SSF_INDICATOR                                                                  = 0x00000004
  15247 	SSF_SOUNDSENTRYON                                                              = 0x00000001
  15248 	SSGF_DISPLAY                                                                   = 3
  15249 	SSGF_NONE                                                                      = 0
  15250 	SSIZE_MAX                                                                      = 9223372036854775807
  15251 	SSL_F12_ERROR_TEXT_LENGTH                                                      = 256
  15252 	SSL_HPKP_HEADER_COUNT                                                          = 2
  15253 	SSL_HPKP_PKP_HEADER_INDEX                                                      = 0
  15254 	SSL_HPKP_PKP_RO_HEADER_INDEX                                                   = 1
  15255 	SSL_KEY_PIN_ERROR_TEXT_LENGTH                                                  = 512
  15256 	SSTF_BORDER                                                                    = 2
  15257 	SSTF_CHARS                                                                     = 1
  15258 	SSTF_DISPLAY                                                                   = 3
  15259 	SSTF_NONE                                                                      = 0
  15260 	SSWF_CUSTOM                                                                    = 4
  15261 	SSWF_DISPLAY                                                                   = 3
  15262 	SSWF_NONE                                                                      = 0
  15263 	SSWF_TITLE                                                                     = 1
  15264 	SSWF_WINDOW                                                                    = 2
  15265 	SS_BITMAP                                                                      = 14
  15266 	SS_BLACKFRAME                                                                  = 7
  15267 	SS_BLACKRECT                                                                   = 4
  15268 	SS_CENTER                                                                      = 1
  15269 	SS_CENTERIMAGE                                                                 = 512
  15270 	SS_EDITCONTROL                                                                 = 8192
  15271 	SS_ELLIPSISMASK                                                                = 49152
  15272 	SS_ENDELLIPSIS                                                                 = 16384
  15273 	SS_ENHMETAFILE                                                                 = 15
  15274 	SS_ETCHEDFRAME                                                                 = 18
  15275 	SS_ETCHEDHORZ                                                                  = 16
  15276 	SS_ETCHEDVERT                                                                  = 17
  15277 	SS_GRAYFRAME                                                                   = 8
  15278 	SS_GRAYRECT                                                                    = 5
  15279 	SS_ICON                                                                        = 3
  15280 	SS_LEFT                                                                        = 0
  15281 	SS_LEFTNOWORDWRAP                                                              = 12
  15282 	SS_NOPREFIX                                                                    = 128
  15283 	SS_NOTIFY                                                                      = 256
  15284 	SS_OWNERDRAW                                                                   = 13
  15285 	SS_PATHELLIPSIS                                                                = 32768
  15286 	SS_REALSIZECONTROL                                                             = 64
  15287 	SS_REALSIZEIMAGE                                                               = 2048
  15288 	SS_RIGHT                                                                       = 2
  15289 	SS_RIGHTJUST                                                                   = 1024
  15290 	SS_SIMPLE                                                                      = 11
  15291 	SS_SUNKEN                                                                      = 4096
  15292 	SS_TYPEMASK                                                                    = 31
  15293 	SS_USERITEM                                                                    = 10
  15294 	SS_WHITEFRAME                                                                  = 9
  15295 	SS_WHITERECT                                                                   = 6
  15296 	SS_WORDELLIPSIS                                                                = 49152
  15297 	STACK_SIZE_PARAM_IS_A_RESERVATION                                              = 0x10000
  15298 	STAMP_AXESLIST                                                                 = 134245473
  15299 	STAMP_CFF2                                                                     = 134248035
  15300 	STAMP_DESIGNVECTOR                                                             = 134248036
  15301 	STAMP_TRUETYPE_VARIATION                                                       = 134248052
  15302 	STANDARD_RIGHTS_ALL                                                            = 2031616
  15303 	STANDARD_RIGHTS_EXECUTE                                                        = 131072
  15304 	STANDARD_RIGHTS_READ                                                           = 131072
  15305 	STANDARD_RIGHTS_REQUIRED                                                       = 983040
  15306 	STANDARD_RIGHTS_WRITE                                                          = 131072
  15307 	STARTDOC                                                                       = 10
  15308 	STARTF_FORCEOFFFEEDBACK                                                        = 0x00000080
  15309 	STARTF_FORCEONFEEDBACK                                                         = 0x00000040
  15310 	STARTF_PREVENTPINNING                                                          = 0x00002000
  15311 	STARTF_RUNFULLSCREEN                                                           = 0x00000020
  15312 	STARTF_TITLEISAPPID                                                            = 0x00001000
  15313 	STARTF_TITLEISLINKNAME                                                         = 0x00000800
  15314 	STARTF_USECOUNTCHARS                                                           = 0x00000008
  15315 	STARTF_USEFILLATTRIBUTE                                                        = 0x00000010
  15316 	STARTF_USEHOTKEY                                                               = 0x00000200
  15317 	STARTF_USEPOSITION                                                             = 0x00000004
  15318 	STARTF_USESHOWWINDOW                                                           = 0x00000001
  15319 	STARTF_USESIZE                                                                 = 0x00000002
  15320 	STARTF_USESTDHANDLES                                                           = 0x00000100
  15321 	START_PAGE_GENERAL                                                             = 0xffffffff
  15322 	STATE_SYSTEM_ALERT_HIGH                                                        = 0x10000000
  15323 	STATE_SYSTEM_ALERT_LOW                                                         = 0x04000000
  15324 	STATE_SYSTEM_ALERT_MEDIUM                                                      = 0x08000000
  15325 	STATE_SYSTEM_ANIMATED                                                          = 0x00004000
  15326 	STATE_SYSTEM_BUSY                                                              = 0x00000800
  15327 	STATE_SYSTEM_CHECKED                                                           = 0x00000010
  15328 	STATE_SYSTEM_COLLAPSED                                                         = 0x00000400
  15329 	STATE_SYSTEM_DEFAULT                                                           = 0x00000100
  15330 	STATE_SYSTEM_EXPANDED                                                          = 0x00000200
  15331 	STATE_SYSTEM_EXTSELECTABLE                                                     = 0x02000000
  15332 	STATE_SYSTEM_FLOATING                                                          = 0x00001000
  15333 	STATE_SYSTEM_FOCUSABLE                                                         = 0x00100000
  15334 	STATE_SYSTEM_FOCUSED                                                           = 0x00000004
  15335 	STATE_SYSTEM_HOTTRACKED                                                        = 0x00000080
  15336 	STATE_SYSTEM_INDETERMINATE                                                     = 32
  15337 	STATE_SYSTEM_INVISIBLE                                                         = 0x00008000
  15338 	STATE_SYSTEM_LINKED                                                            = 0x00400000
  15339 	STATE_SYSTEM_MARQUEED                                                          = 0x00002000
  15340 	STATE_SYSTEM_MIXED                                                             = 0x00000020
  15341 	STATE_SYSTEM_MOVEABLE                                                          = 0x00040000
  15342 	STATE_SYSTEM_MULTISELECTABLE                                                   = 0x01000000
  15343 	STATE_SYSTEM_OFFSCREEN                                                         = 0x00010000
  15344 	STATE_SYSTEM_PRESSED                                                           = 0x00000008
  15345 	STATE_SYSTEM_PROTECTED                                                         = 0x20000000
  15346 	STATE_SYSTEM_READONLY                                                          = 0x00000040
  15347 	STATE_SYSTEM_SELECTABLE                                                        = 0x00200000
  15348 	STATE_SYSTEM_SELECTED                                                          = 0x00000002
  15349 	STATE_SYSTEM_SELFVOICING                                                       = 0x00080000
  15350 	STATE_SYSTEM_SIZEABLE                                                          = 0x00020000
  15351 	STATE_SYSTEM_TRAVERSED                                                         = 0x00800000
  15352 	STATE_SYSTEM_UNAVAILABLE                                                       = 0x00000001
  15353 	STATE_SYSTEM_VALID                                                             = 0x3FFFFFFF
  15354 	STAT_GET_NDLT                                                                  = 4
  15355 	STAT_GET_NEQ                                                                   = 2
  15356 	STAT_GET_NLT                                                                   = 3
  15357 	STAT_GET_ROWID                                                                 = 1
  15358 	STAT_GET_STAT1                                                                 = 0
  15359 	STDAPICALLTYPE                                                                 = 0
  15360 	STDERR_FILENO                                                                  = 2
  15361 	STDIN_FILENO                                                                   = 0
  15362 	STDMETHODCALLTYPE                                                              = 0
  15363 	STDOLE2_LCID                                                                   = 0x0000
  15364 	STDOLE2_MAJORVERNUM                                                            = 0x2
  15365 	STDOLE2_MINORVERNUM                                                            = 0x0
  15366 	STDOLE_LCID                                                                    = 0x0000
  15367 	STDOLE_MAJORVERNUM                                                             = 0x1
  15368 	STDOLE_MINORVERNUM                                                             = 0x0
  15369 	STDOUT_FILENO                                                                  = 1
  15370 	STGFMT_ANY                                                                     = 4
  15371 	STGFMT_DOCFILE                                                                 = 5
  15372 	STGFMT_DOCUMENT                                                                = 0
  15373 	STGFMT_FILE                                                                    = 3
  15374 	STGFMT_NATIVE                                                                  = 1
  15375 	STGFMT_STORAGE                                                                 = 0
  15376 	STGM_CONVERT                                                                   = 131072
  15377 	STGM_CREATE                                                                    = 4096
  15378 	STGM_DELETEONRELEASE                                                           = 67108864
  15379 	STGM_DIRECT                                                                    = 0
  15380 	STGM_DIRECT_SWMR                                                               = 4194304
  15381 	STGM_FAILIFTHERE                                                               = 0
  15382 	STGM_NOSCRATCH                                                                 = 1048576
  15383 	STGM_NOSNAPSHOT                                                                = 2097152
  15384 	STGM_PRIORITY                                                                  = 262144
  15385 	STGM_READ                                                                      = 0
  15386 	STGM_READWRITE                                                                 = 2
  15387 	STGM_SHARE_DENY_NONE                                                           = 64
  15388 	STGM_SHARE_DENY_READ                                                           = 48
  15389 	STGM_SHARE_DENY_WRITE                                                          = 32
  15390 	STGM_SHARE_EXCLUSIVE                                                           = 16
  15391 	STGM_SIMPLE                                                                    = 134217728
  15392 	STGM_TRANSACTED                                                                = 65536
  15393 	STGM_WRITE                                                                     = 1
  15394 	STGOPTIONS_VERSION                                                             = 2
  15395 	STGTY_REPEAT                                                                   = 256
  15396 	STG_LAYOUT_INTERLEAVED                                                         = 1
  15397 	STG_LAYOUT_SEQUENTIAL                                                          = 0
  15398 	STG_TOEND                                                                      = 4294967295
  15399 	STM_GETICON                                                                    = 0x0171
  15400 	STM_GETIMAGE                                                                   = 0x0173
  15401 	STM_MSGMAX                                                                     = 0x0174
  15402 	STM_SETICON                                                                    = 0x0170
  15403 	STM_SETIMAGE                                                                   = 0x0172
  15404 	STN_CLICKED                                                                    = 0
  15405 	STN_DBLCLK                                                                     = 1
  15406 	STN_DISABLE                                                                    = 3
  15407 	STN_ENABLE                                                                     = 2
  15408 	STOCK_LAST                                                                     = 19
  15409 	STREAM_CLEAR_ENCRYPTION                                                        = 0x00000004
  15410 	STREAM_CONTAINS_PROPERTIES                                                     = 0x00000004
  15411 	STREAM_CONTAINS_SECURITY                                                       = 0x00000002
  15412 	STREAM_MODIFIED_WHEN_READ                                                      = 0x00000001
  15413 	STREAM_NORMAL_ATTRIBUTE                                                        = 0x00000000
  15414 	STREAM_SET_ENCRYPTION                                                          = 0x00000003
  15415 	STREAM_SPARSE_ATTRIBUTE                                                        = 0x00000008
  15416 	STRETCHBLT                                                                     = 2048
  15417 	STRETCH_ANDSCANS                                                               = 1
  15418 	STRETCH_DELETESCANS                                                            = 3
  15419 	STRETCH_HALFTONE                                                               = 4
  15420 	STRETCH_ORSCANS                                                                = 2
  15421 	STRICT                                                                         = 1
  15422 	STRUNCATE                                                                      = 80
  15423 	STYLE_DESCRIPTION_SIZE                                                         = 32
  15424 	ST_ADVISE                                                                      = 0x0002
  15425 	ST_BLOCKED                                                                     = 0x0008
  15426 	ST_BLOCKNEXT                                                                   = 0x0080
  15427 	ST_CLIENT                                                                      = 0x0010
  15428 	ST_CONNECTED                                                                   = 0x0001
  15429 	ST_INLIST                                                                      = 0x0040
  15430 	ST_ISLOCAL                                                                     = 0x0004
  15431 	ST_ISSELF                                                                      = 0x0100
  15432 	ST_TERMINATED                                                                  = 0x0020
  15433 	SUBLANG_AFRIKAANS_SOUTH_AFRICA                                                 = 0x01
  15434 	SUBLANG_ALBANIAN_ALBANIA                                                       = 0x01
  15435 	SUBLANG_ALSATIAN_FRANCE                                                        = 0x01
  15436 	SUBLANG_AMHARIC_ETHIOPIA                                                       = 0x01
  15437 	SUBLANG_ARABIC_ALGERIA                                                         = 0x05
  15438 	SUBLANG_ARABIC_BAHRAIN                                                         = 0x0f
  15439 	SUBLANG_ARABIC_EGYPT                                                           = 0x03
  15440 	SUBLANG_ARABIC_IRAQ                                                            = 0x02
  15441 	SUBLANG_ARABIC_JORDAN                                                          = 0x0b
  15442 	SUBLANG_ARABIC_KUWAIT                                                          = 0x0d
  15443 	SUBLANG_ARABIC_LEBANON                                                         = 0x0c
  15444 	SUBLANG_ARABIC_LIBYA                                                           = 0x04
  15445 	SUBLANG_ARABIC_MOROCCO                                                         = 0x06
  15446 	SUBLANG_ARABIC_OMAN                                                            = 0x08
  15447 	SUBLANG_ARABIC_QATAR                                                           = 0x10
  15448 	SUBLANG_ARABIC_SAUDI_ARABIA                                                    = 0x01
  15449 	SUBLANG_ARABIC_SYRIA                                                           = 0x0a
  15450 	SUBLANG_ARABIC_TUNISIA                                                         = 0x07
  15451 	SUBLANG_ARABIC_UAE                                                             = 0x0e
  15452 	SUBLANG_ARABIC_YEMEN                                                           = 0x09
  15453 	SUBLANG_ARMENIAN_ARMENIA                                                       = 0x01
  15454 	SUBLANG_ASSAMESE_INDIA                                                         = 0x01
  15455 	SUBLANG_AZERBAIJANI_AZERBAIJAN_CYRILLIC                                        = 0x02
  15456 	SUBLANG_AZERBAIJANI_AZERBAIJAN_LATIN                                           = 0x01
  15457 	SUBLANG_AZERI_CYRILLIC                                                         = 0x02
  15458 	SUBLANG_AZERI_LATIN                                                            = 0x01
  15459 	SUBLANG_BANGLA_BANGLADESH                                                      = 0x02
  15460 	SUBLANG_BANGLA_INDIA                                                           = 0x01
  15461 	SUBLANG_BASHKIR_RUSSIA                                                         = 0x01
  15462 	SUBLANG_BASQUE_BASQUE                                                          = 0x01
  15463 	SUBLANG_BELARUSIAN_BELARUS                                                     = 0x01
  15464 	SUBLANG_BENGALI_BANGLADESH                                                     = 0x02
  15465 	SUBLANG_BENGALI_INDIA                                                          = 0x01
  15466 	SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC                                    = 0x08
  15467 	SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN                                       = 0x05
  15468 	SUBLANG_BRETON_FRANCE                                                          = 0x01
  15469 	SUBLANG_BULGARIAN_BULGARIA                                                     = 0x01
  15470 	SUBLANG_CATALAN_CATALAN                                                        = 0x01
  15471 	SUBLANG_CENTRAL_KURDISH_IRAQ                                                   = 0x01
  15472 	SUBLANG_CHEROKEE_CHEROKEE                                                      = 0x01
  15473 	SUBLANG_CHINESE_HONGKONG                                                       = 0x03
  15474 	SUBLANG_CHINESE_MACAU                                                          = 0x05
  15475 	SUBLANG_CHINESE_SIMPLIFIED                                                     = 0x02
  15476 	SUBLANG_CHINESE_SINGAPORE                                                      = 0x04
  15477 	SUBLANG_CHINESE_TRADITIONAL                                                    = 0x01
  15478 	SUBLANG_CORSICAN_FRANCE                                                        = 0x01
  15479 	SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN                                      = 0x04
  15480 	SUBLANG_CROATIAN_CROATIA                                                       = 0x01
  15481 	SUBLANG_CUSTOM_DEFAULT                                                         = 0x03
  15482 	SUBLANG_CUSTOM_UNSPECIFIED                                                     = 0x04
  15483 	SUBLANG_CZECH_CZECH_REPUBLIC                                                   = 0x01
  15484 	SUBLANG_DANISH_DENMARK                                                         = 0x01
  15485 	SUBLANG_DARI_AFGHANISTAN                                                       = 0x01
  15486 	SUBLANG_DEFAULT                                                                = 0x01
  15487 	SUBLANG_DIVEHI_MALDIVES                                                        = 0x01
  15488 	SUBLANG_DUTCH                                                                  = 0x01
  15489 	SUBLANG_DUTCH_BELGIAN                                                          = 0x02
  15490 	SUBLANG_ENGLISH_AUS                                                            = 0x03
  15491 	SUBLANG_ENGLISH_BELIZE                                                         = 0x0a
  15492 	SUBLANG_ENGLISH_CAN                                                            = 0x04
  15493 	SUBLANG_ENGLISH_CARIBBEAN                                                      = 0x09
  15494 	SUBLANG_ENGLISH_EIRE                                                           = 0x06
  15495 	SUBLANG_ENGLISH_INDIA                                                          = 0x10
  15496 	SUBLANG_ENGLISH_IRELAND                                                        = 0x06
  15497 	SUBLANG_ENGLISH_JAMAICA                                                        = 0x08
  15498 	SUBLANG_ENGLISH_MALAYSIA                                                       = 0x11
  15499 	SUBLANG_ENGLISH_NZ                                                             = 0x05
  15500 	SUBLANG_ENGLISH_PHILIPPINES                                                    = 0x0d
  15501 	SUBLANG_ENGLISH_SINGAPORE                                                      = 0x12
  15502 	SUBLANG_ENGLISH_SOUTH_AFRICA                                                   = 0x07
  15503 	SUBLANG_ENGLISH_TRINIDAD                                                       = 0x0b
  15504 	SUBLANG_ENGLISH_UK                                                             = 0x02
  15505 	SUBLANG_ENGLISH_US                                                             = 0x01
  15506 	SUBLANG_ENGLISH_ZIMBABWE                                                       = 0x0c
  15507 	SUBLANG_ESTONIAN_ESTONIA                                                       = 0x01
  15508 	SUBLANG_FAEROESE_FAROE_ISLANDS                                                 = 0x01
  15509 	SUBLANG_FILIPINO_PHILIPPINES                                                   = 0x01
  15510 	SUBLANG_FINNISH_FINLAND                                                        = 0x01
  15511 	SUBLANG_FRENCH                                                                 = 0x01
  15512 	SUBLANG_FRENCH_BELGIAN                                                         = 0x02
  15513 	SUBLANG_FRENCH_CANADIAN                                                        = 0x03
  15514 	SUBLANG_FRENCH_LUXEMBOURG                                                      = 0x05
  15515 	SUBLANG_FRENCH_MONACO                                                          = 0x06
  15516 	SUBLANG_FRENCH_SWISS                                                           = 0x04
  15517 	SUBLANG_FRISIAN_NETHERLANDS                                                    = 0x01
  15518 	SUBLANG_FULAH_SENEGAL                                                          = 0x02
  15519 	SUBLANG_GALICIAN_GALICIAN                                                      = 0x01
  15520 	SUBLANG_GEORGIAN_GEORGIA                                                       = 0x01
  15521 	SUBLANG_GERMAN                                                                 = 0x01
  15522 	SUBLANG_GERMAN_AUSTRIAN                                                        = 0x03
  15523 	SUBLANG_GERMAN_LIECHTENSTEIN                                                   = 0x05
  15524 	SUBLANG_GERMAN_LUXEMBOURG                                                      = 0x04
  15525 	SUBLANG_GERMAN_SWISS                                                           = 0x02
  15526 	SUBLANG_GREEK_GREECE                                                           = 0x01
  15527 	SUBLANG_GREENLANDIC_GREENLAND                                                  = 0x01
  15528 	SUBLANG_GUJARATI_INDIA                                                         = 0x01
  15529 	SUBLANG_HAUSA_NIGERIA                                                          = 1
  15530 	SUBLANG_HAUSA_NIGERIA_LATIN                                                    = 0x01
  15531 	SUBLANG_HAWAIIAN_US                                                            = 0x01
  15532 	SUBLANG_HEBREW_ISRAEL                                                          = 0x01
  15533 	SUBLANG_HINDI_INDIA                                                            = 0x01
  15534 	SUBLANG_HUNGARIAN_HUNGARY                                                      = 0x01
  15535 	SUBLANG_ICELANDIC_ICELAND                                                      = 0x01
  15536 	SUBLANG_IGBO_NIGERIA                                                           = 0x01
  15537 	SUBLANG_INDONESIAN_INDONESIA                                                   = 0x01
  15538 	SUBLANG_INUKTITUT_CANADA                                                       = 0x01
  15539 	SUBLANG_INUKTITUT_CANADA_LATIN                                                 = 0x02
  15540 	SUBLANG_IRISH_IRELAND                                                          = 0x02
  15541 	SUBLANG_ITALIAN                                                                = 0x01
  15542 	SUBLANG_ITALIAN_SWISS                                                          = 0x02
  15543 	SUBLANG_JAPANESE_JAPAN                                                         = 0x01
  15544 	SUBLANG_KANNADA_INDIA                                                          = 0x01
  15545 	SUBLANG_KASHMIRI_INDIA                                                         = 0x02
  15546 	SUBLANG_KASHMIRI_SASIA                                                         = 0x02
  15547 	SUBLANG_KAZAK_KAZAKHSTAN                                                       = 0x01
  15548 	SUBLANG_KHMER_CAMBODIA                                                         = 0x01
  15549 	SUBLANG_KICHE_GUATEMALA                                                        = 0x01
  15550 	SUBLANG_KINYARWANDA_RWANDA                                                     = 0x01
  15551 	SUBLANG_KONKANI_INDIA                                                          = 0x01
  15552 	SUBLANG_KOREAN                                                                 = 0x01
  15553 	SUBLANG_KYRGYZ_KYRGYZSTAN                                                      = 0x01
  15554 	SUBLANG_LAO_LAO                                                                = 0x01
  15555 	SUBLANG_LAO_LAO_PDR                                                            = 1
  15556 	SUBLANG_LATVIAN_LATVIA                                                         = 0x01
  15557 	SUBLANG_LITHUANIAN                                                             = 0x01
  15558 	SUBLANG_LOWER_SORBIAN_GERMANY                                                  = 0x02
  15559 	SUBLANG_LUXEMBOURGISH_LUXEMBOURG                                               = 0x01
  15560 	SUBLANG_MACEDONIAN_MACEDONIA                                                   = 0x01
  15561 	SUBLANG_MALAYALAM_INDIA                                                        = 0x01
  15562 	SUBLANG_MALAY_BRUNEI_DARUSSALAM                                                = 0x02
  15563 	SUBLANG_MALAY_MALAYSIA                                                         = 0x01
  15564 	SUBLANG_MALTESE_MALTA                                                          = 0x01
  15565 	SUBLANG_MAORI_NEW_ZEALAND                                                      = 0x01
  15566 	SUBLANG_MAPUDUNGUN_CHILE                                                       = 0x01
  15567 	SUBLANG_MARATHI_INDIA                                                          = 0x01
  15568 	SUBLANG_MOHAWK_MOHAWK                                                          = 0x01
  15569 	SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA                                            = 0x01
  15570 	SUBLANG_MONGOLIAN_PRC                                                          = 0x02
  15571 	SUBLANG_NEPALI_INDIA                                                           = 0x02
  15572 	SUBLANG_NEPALI_NEPAL                                                           = 0x01
  15573 	SUBLANG_NEUTRAL                                                                = 0x00
  15574 	SUBLANG_NORWEGIAN_BOKMAL                                                       = 0x01
  15575 	SUBLANG_NORWEGIAN_NYNORSK                                                      = 0x02
  15576 	SUBLANG_OCCITAN_FRANCE                                                         = 0x01
  15577 	SUBLANG_ORIYA_INDIA                                                            = 0x01
  15578 	SUBLANG_PASHTO_AFGHANISTAN                                                     = 0x01
  15579 	SUBLANG_PERSIAN_IRAN                                                           = 0x01
  15580 	SUBLANG_POLISH_POLAND                                                          = 0x01
  15581 	SUBLANG_PORTUGUESE                                                             = 0x02
  15582 	SUBLANG_PORTUGUESE_BRAZILIAN                                                   = 0x01
  15583 	SUBLANG_PULAR_SENEGAL                                                          = 0x02
  15584 	SUBLANG_PUNJABI_INDIA                                                          = 0x01
  15585 	SUBLANG_PUNJABI_PAKISTAN                                                       = 0x02
  15586 	SUBLANG_QUECHUA_BOLIVIA                                                        = 0x01
  15587 	SUBLANG_QUECHUA_ECUADOR                                                        = 0x02
  15588 	SUBLANG_QUECHUA_PERU                                                           = 0x03
  15589 	SUBLANG_ROMANIAN_ROMANIA                                                       = 0x01
  15590 	SUBLANG_ROMANSH_SWITZERLAND                                                    = 0x01
  15591 	SUBLANG_RUSSIAN_RUSSIA                                                         = 0x01
  15592 	SUBLANG_SAKHA_RUSSIA                                                           = 0x01
  15593 	SUBLANG_SAMI_INARI_FINLAND                                                     = 0x09
  15594 	SUBLANG_SAMI_LULE_NORWAY                                                       = 0x04
  15595 	SUBLANG_SAMI_LULE_SWEDEN                                                       = 0x05
  15596 	SUBLANG_SAMI_NORTHERN_FINLAND                                                  = 0x03
  15597 	SUBLANG_SAMI_NORTHERN_NORWAY                                                   = 0x01
  15598 	SUBLANG_SAMI_NORTHERN_SWEDEN                                                   = 0x02
  15599 	SUBLANG_SAMI_SKOLT_FINLAND                                                     = 0x08
  15600 	SUBLANG_SAMI_SOUTHERN_NORWAY                                                   = 0x06
  15601 	SUBLANG_SAMI_SOUTHERN_SWEDEN                                                   = 0x07
  15602 	SUBLANG_SANSKRIT_INDIA                                                         = 0x01
  15603 	SUBLANG_SCOTTISH_GAELIC                                                        = 0x01
  15604 	SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC                                    = 0x07
  15605 	SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_LATIN                                       = 0x06
  15606 	SUBLANG_SERBIAN_CYRILLIC                                                       = 0x03
  15607 	SUBLANG_SERBIAN_LATIN                                                          = 0x02
  15608 	SUBLANG_SERBIAN_MONTENEGRO_CYRILLIC                                            = 0x0c
  15609 	SUBLANG_SERBIAN_MONTENEGRO_LATIN                                               = 0x0b
  15610 	SUBLANG_SERBIAN_SERBIA_CYRILLIC                                                = 0x0a
  15611 	SUBLANG_SERBIAN_SERBIA_LATIN                                                   = 0x09
  15612 	SUBLANG_SINDHI_AFGHANISTAN                                                     = 0x02
  15613 	SUBLANG_SINDHI_INDIA                                                           = 0x01
  15614 	SUBLANG_SINDHI_PAKISTAN                                                        = 0x02
  15615 	SUBLANG_SINHALESE_SRI_LANKA                                                    = 0x01
  15616 	SUBLANG_SLOVAK_SLOVAKIA                                                        = 0x01
  15617 	SUBLANG_SLOVENIAN_SLOVENIA                                                     = 0x01
  15618 	SUBLANG_SOTHO_NORTHERN_SOUTH_AFRICA                                            = 0x01
  15619 	SUBLANG_SPANISH                                                                = 0x01
  15620 	SUBLANG_SPANISH_ARGENTINA                                                      = 0x0b
  15621 	SUBLANG_SPANISH_BOLIVIA                                                        = 0x10
  15622 	SUBLANG_SPANISH_CHILE                                                          = 0x0d
  15623 	SUBLANG_SPANISH_COLOMBIA                                                       = 0x09
  15624 	SUBLANG_SPANISH_COSTA_RICA                                                     = 0x05
  15625 	SUBLANG_SPANISH_DOMINICAN_REPUBLIC                                             = 0x07
  15626 	SUBLANG_SPANISH_ECUADOR                                                        = 0x0c
  15627 	SUBLANG_SPANISH_EL_SALVADOR                                                    = 0x11
  15628 	SUBLANG_SPANISH_GUATEMALA                                                      = 0x04
  15629 	SUBLANG_SPANISH_HONDURAS                                                       = 0x12
  15630 	SUBLANG_SPANISH_MEXICAN                                                        = 0x02
  15631 	SUBLANG_SPANISH_MODERN                                                         = 0x03
  15632 	SUBLANG_SPANISH_NICARAGUA                                                      = 0x13
  15633 	SUBLANG_SPANISH_PANAMA                                                         = 0x06
  15634 	SUBLANG_SPANISH_PARAGUAY                                                       = 0x0f
  15635 	SUBLANG_SPANISH_PERU                                                           = 0x0a
  15636 	SUBLANG_SPANISH_PUERTO_RICO                                                    = 0x14
  15637 	SUBLANG_SPANISH_URUGUAY                                                        = 0x0e
  15638 	SUBLANG_SPANISH_US                                                             = 0x15
  15639 	SUBLANG_SPANISH_VENEZUELA                                                      = 0x08
  15640 	SUBLANG_SWAHILI_KENYA                                                          = 0x01
  15641 	SUBLANG_SWEDISH                                                                = 0x01
  15642 	SUBLANG_SWEDISH_FINLAND                                                        = 0x02
  15643 	SUBLANG_SYRIAC                                                                 = 0x01
  15644 	SUBLANG_SYRIAC_SYRIA                                                           = 1
  15645 	SUBLANG_SYS_DEFAULT                                                            = 0x02
  15646 	SUBLANG_TAJIK_TAJIKISTAN                                                       = 0x01
  15647 	SUBLANG_TAMAZIGHT_ALGERIA_LATIN                                                = 0x02
  15648 	SUBLANG_TAMAZIGHT_MOROCCO_TIFINAGH                                             = 0x04
  15649 	SUBLANG_TAMIL_INDIA                                                            = 0x01
  15650 	SUBLANG_TAMIL_SRI_LANKA                                                        = 0x02
  15651 	SUBLANG_TATAR_RUSSIA                                                           = 0x01
  15652 	SUBLANG_TELUGU_INDIA                                                           = 0x01
  15653 	SUBLANG_THAI_THAILAND                                                          = 0x01
  15654 	SUBLANG_TIBETAN_BHUTAN                                                         = 0x02
  15655 	SUBLANG_TIBETAN_PRC                                                            = 0x01
  15656 	SUBLANG_TIGRIGNA_ERITREA                                                       = 0x02
  15657 	SUBLANG_TIGRINYA_ERITREA                                                       = 0x02
  15658 	SUBLANG_TIGRINYA_ETHIOPIA                                                      = 0x01
  15659 	SUBLANG_TSWANA_BOTSWANA                                                        = 0x02
  15660 	SUBLANG_TSWANA_SOUTH_AFRICA                                                    = 0x01
  15661 	SUBLANG_TURKISH_TURKEY                                                         = 0x01
  15662 	SUBLANG_TURKMEN_TURKMENISTAN                                                   = 0x01
  15663 	SUBLANG_UIGHUR_PRC                                                             = 0x01
  15664 	SUBLANG_UI_CUSTOM_DEFAULT                                                      = 0x05
  15665 	SUBLANG_UKRAINIAN_UKRAINE                                                      = 0x01
  15666 	SUBLANG_UPPER_SORBIAN_GERMANY                                                  = 0x01
  15667 	SUBLANG_URDU_INDIA                                                             = 0x02
  15668 	SUBLANG_URDU_PAKISTAN                                                          = 0x01
  15669 	SUBLANG_UZBEK_CYRILLIC                                                         = 0x02
  15670 	SUBLANG_UZBEK_LATIN                                                            = 0x01
  15671 	SUBLANG_VALENCIAN_VALENCIA                                                     = 0x02
  15672 	SUBLANG_VIETNAMESE_VIETNAM                                                     = 0x01
  15673 	SUBLANG_WELSH_UNITED_KINGDOM                                                   = 0x01
  15674 	SUBLANG_WOLOF_SENEGAL                                                          = 0x01
  15675 	SUBLANG_XHOSA_SOUTH_AFRICA                                                     = 0x01
  15676 	SUBLANG_YAKUT_RUSSIA                                                           = 0x01
  15677 	SUBLANG_YI_PRC                                                                 = 0x01
  15678 	SUBLANG_YORUBA_NIGERIA                                                         = 0x01
  15679 	SUBLANG_ZULU_SOUTH_AFRICA                                                      = 0x01
  15680 	SUBVERSION_MASK                                                                = 0x000000FF
  15681 	SUCCESSFUL_ACCESS_ACE_FLAG                                                     = 64
  15682 	SUPPORT_LANG_NUMBER                                                            = 32
  15683 	SWP_ASYNCWINDOWPOS                                                             = 0x4000
  15684 	SWP_DEFERERASE                                                                 = 0x2000
  15685 	SWP_DRAWFRAME                                                                  = 32
  15686 	SWP_FRAMECHANGED                                                               = 0x0020
  15687 	SWP_HIDEWINDOW                                                                 = 0x0080
  15688 	SWP_NOACTIVATE                                                                 = 0x0010
  15689 	SWP_NOCOPYBITS                                                                 = 0x0100
  15690 	SWP_NOMOVE                                                                     = 0x0002
  15691 	SWP_NOOWNERZORDER                                                              = 0x0200
  15692 	SWP_NOREDRAW                                                                   = 0x0008
  15693 	SWP_NOREPOSITION                                                               = 512
  15694 	SWP_NOSENDCHANGING                                                             = 0x0400
  15695 	SWP_NOSIZE                                                                     = 0x0001
  15696 	SWP_NOZORDER                                                                   = 0x0004
  15697 	SWP_SHOWWINDOW                                                                 = 0x0040
  15698 	SW_ERASE                                                                       = 0x0004
  15699 	SW_FORCEMINIMIZE                                                               = 11
  15700 	SW_HIDE                                                                        = 0
  15701 	SW_INVALIDATE                                                                  = 0x0002
  15702 	SW_MAX                                                                         = 11
  15703 	SW_MAXIMIZE                                                                    = 3
  15704 	SW_MINIMIZE                                                                    = 6
  15705 	SW_NORMAL                                                                      = 1
  15706 	SW_OTHERUNZOOM                                                                 = 4
  15707 	SW_OTHERZOOM                                                                   = 2
  15708 	SW_PARENTCLOSING                                                               = 1
  15709 	SW_PARENTOPENING                                                               = 3
  15710 	SW_RESTORE                                                                     = 9
  15711 	SW_SCROLLCHILDREN                                                              = 0x0001
  15712 	SW_SHOW                                                                        = 5
  15713 	SW_SHOWDEFAULT                                                                 = 10
  15714 	SW_SHOWMAXIMIZED                                                               = 3
  15715 	SW_SHOWMINIMIZED                                                               = 2
  15716 	SW_SHOWMINNOACTIVE                                                             = 7
  15717 	SW_SHOWNA                                                                      = 8
  15718 	SW_SHOWNOACTIVATE                                                              = 4
  15719 	SW_SHOWNORMAL                                                                  = 1
  15720 	SW_SMOOTHSCROLL                                                                = 0x0010
  15721 	SYMBOL_CHARSET                                                                 = 2
  15722 	SYMLINK_FLAG_RELATIVE                                                          = 1
  15723 	SYMMETRICWRAPKEYBLOB                                                           = 0xb
  15724 	SYNCHRONIZATION_BARRIER_FLAGS_BLOCK_ONLY                                       = 0x02
  15725 	SYNCHRONIZATION_BARRIER_FLAGS_NO_DELETE                                        = 0x04
  15726 	SYNCHRONIZATION_BARRIER_FLAGS_SPIN_ONLY                                        = 0x01
  15727 	SYNCHRONIZE                                                                    = 1048576
  15728 	SYSPAL_ERROR                                                                   = 0
  15729 	SYSPAL_NOSTATIC                                                                = 2
  15730 	SYSPAL_NOSTATIC256                                                             = 3
  15731 	SYSPAL_STATIC                                                                  = 1
  15732 	SYSRGN                                                                         = 4
  15733 	SYSTEM_ALARM_ACE_TYPE                                                          = 3
  15734 	SYSTEM_ALARM_CALLBACK_ACE_TYPE                                                 = 14
  15735 	SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE                                          = 16
  15736 	SYSTEM_ALARM_OBJECT_ACE_TYPE                                                   = 8
  15737 	SYSTEM_AUDIT_ACE_TYPE                                                          = 2
  15738 	SYSTEM_AUDIT_CALLBACK_ACE_TYPE                                                 = 13
  15739 	SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE                                          = 15
  15740 	SYSTEM_AUDIT_OBJECT_ACE_TYPE                                                   = 7
  15741 	SYSTEM_CACHE_ALIGNMENT_SIZE                                                    = 64
  15742 	SYSTEM_FIXED_FONT                                                              = 16
  15743 	SYSTEM_FONT                                                                    = 13
  15744 	SYSTEM_MANDATORY_LABEL_ACE_TYPE                                                = 17
  15745 	SYSTEM_MANDATORY_LABEL_NO_EXECUTE_UP                                           = 0x4
  15746 	SYSTEM_MANDATORY_LABEL_NO_READ_UP                                              = 0x2
  15747 	SYSTEM_MANDATORY_LABEL_NO_WRITE_UP                                             = 0x1
  15748 	SYSTEM_MANDATORY_LABEL_VALID_MASK                                              = 7
  15749 	SYSTEM_RESOURCE_ATTRIBUTE_ACE_TYPE                                             = 18
  15750 	SYSTEM_SCOPED_POLICY_ID_ACE_TYPE                                               = 19
  15751 	SYS_OPEN                                                                       = 20
  15752 	S_ALLTHRESHOLD                                                                 = 2
  15753 	S_LEGATO                                                                       = 1
  15754 	S_NORMAL                                                                       = 0
  15755 	S_PERIOD1024                                                                   = 1
  15756 	S_PERIOD2048                                                                   = 2
  15757 	S_PERIOD512                                                                    = 0
  15758 	S_PERIODVOICE                                                                  = 3
  15759 	S_QUEUEEMPTY                                                                   = 0
  15760 	S_SERBDNT                                                                      = -5
  15761 	S_SERDCC                                                                       = -7
  15762 	S_SERDDR                                                                       = -14
  15763 	S_SERDFQ                                                                       = -13
  15764 	S_SERDLN                                                                       = -6
  15765 	S_SERDMD                                                                       = -10
  15766 	S_SERDPT                                                                       = -12
  15767 	S_SERDSH                                                                       = -11
  15768 	S_SERDSR                                                                       = -15
  15769 	S_SERDST                                                                       = -16
  15770 	S_SERDTP                                                                       = -8
  15771 	S_SERDVL                                                                       = -9
  15772 	S_SERDVNA                                                                      = -1
  15773 	S_SERMACT                                                                      = -3
  15774 	S_SEROFM                                                                       = -2
  15775 	S_SERQFUL                                                                      = -4
  15776 	S_STACCATO                                                                     = 2
  15777 	S_THRESHOLD                                                                    = 1
  15778 	S_WHITE1024                                                                    = 5
  15779 	S_WHITE2048                                                                    = 6
  15780 	S_WHITE512                                                                     = 4
  15781 	S_WHITEVOICE                                                                   = 7
  15782 	TABTYP_NORM                                                                    = 0
  15783 	TABTYP_VIEW                                                                    = 2
  15784 	TABTYP_VTAB                                                                    = 1
  15785 	TAPE_ABSOLUTE_BLOCK                                                            = 1
  15786 	TAPE_ABSOLUTE_POSITION                                                         = 0
  15787 	TAPE_CHECK_FOR_DRIVE_PROBLEM                                                   = 2
  15788 	TAPE_DRIVE_ABSOLUTE_BLK                                                        = 0x80001000
  15789 	TAPE_DRIVE_ABS_BLK_IMMED                                                       = 0x80002000
  15790 	TAPE_DRIVE_CLEAN_REQUESTS                                                      = 0x02000000
  15791 	TAPE_DRIVE_COMPRESSION                                                         = 0x00020000
  15792 	TAPE_DRIVE_ECC                                                                 = 0x00010000
  15793 	TAPE_DRIVE_EJECT_MEDIA                                                         = 0x01000000
  15794 	TAPE_DRIVE_END_OF_DATA                                                         = 0x80010000
  15795 	TAPE_DRIVE_EOT_WZ_SIZE                                                         = 0x00002000
  15796 	TAPE_DRIVE_ERASE_BOP_ONLY                                                      = 0x00000040
  15797 	TAPE_DRIVE_ERASE_IMMEDIATE                                                     = 0x00000080
  15798 	TAPE_DRIVE_ERASE_LONG                                                          = 0x00000020
  15799 	TAPE_DRIVE_ERASE_SHORT                                                         = 0x00000010
  15800 	TAPE_DRIVE_FILEMARKS                                                           = 0x80040000
  15801 	TAPE_DRIVE_FIXED                                                               = 0x00000001
  15802 	TAPE_DRIVE_FIXED_BLOCK                                                         = 0x00000400
  15803 	TAPE_DRIVE_FORMAT                                                              = 0xA0000000
  15804 	TAPE_DRIVE_FORMAT_IMMEDIATE                                                    = 0xC0000000
  15805 	TAPE_DRIVE_GET_ABSOLUTE_BLK                                                    = 0x00100000
  15806 	TAPE_DRIVE_GET_LOGICAL_BLK                                                     = 0x00200000
  15807 	TAPE_DRIVE_HIGH_FEATURES                                                       = 0x80000000
  15808 	TAPE_DRIVE_INITIATOR                                                           = 0x00000004
  15809 	TAPE_DRIVE_LOAD_UNLD_IMMED                                                     = 0x80000020
  15810 	TAPE_DRIVE_LOAD_UNLOAD                                                         = 0x80000001
  15811 	TAPE_DRIVE_LOCK_UNLK_IMMED                                                     = 0x80000080
  15812 	TAPE_DRIVE_LOCK_UNLOCK                                                         = 0x80000004
  15813 	TAPE_DRIVE_LOGICAL_BLK                                                         = 0x80004000
  15814 	TAPE_DRIVE_LOG_BLK_IMMED                                                       = 0x80008000
  15815 	TAPE_DRIVE_PADDING                                                             = 0x00040000
  15816 	TAPE_DRIVE_RELATIVE_BLKS                                                       = 0x80020000
  15817 	TAPE_DRIVE_REPORT_SMKS                                                         = 0x00080000
  15818 	TAPE_DRIVE_RESERVED_BIT                                                        = 0x80000000
  15819 	TAPE_DRIVE_REVERSE_POSITION                                                    = 0x80400000
  15820 	TAPE_DRIVE_REWIND_IMMEDIATE                                                    = 0x80000008
  15821 	TAPE_DRIVE_SELECT                                                              = 0x00000002
  15822 	TAPE_DRIVE_SEQUENTIAL_FMKS                                                     = 0x80080000
  15823 	TAPE_DRIVE_SEQUENTIAL_SMKS                                                     = 0x80200000
  15824 	TAPE_DRIVE_SETMARKS                                                            = 0x80100000
  15825 	TAPE_DRIVE_SET_BLOCK_SIZE                                                      = 0x80000010
  15826 	TAPE_DRIVE_SET_CMP_BOP_ONLY                                                    = 0x04000000
  15827 	TAPE_DRIVE_SET_COMPRESSION                                                     = 0x80000200
  15828 	TAPE_DRIVE_SET_ECC                                                             = 0x80000100
  15829 	TAPE_DRIVE_SET_EOT_WZ_SIZE                                                     = 0x00400000
  15830 	TAPE_DRIVE_SET_PADDING                                                         = 0x80000400
  15831 	TAPE_DRIVE_SET_REPORT_SMKS                                                     = 0x80000800
  15832 	TAPE_DRIVE_SPACE_IMMEDIATE                                                     = 0x80800000
  15833 	TAPE_DRIVE_TAPE_CAPACITY                                                       = 0x00000100
  15834 	TAPE_DRIVE_TAPE_REMAINING                                                      = 0x00000200
  15835 	TAPE_DRIVE_TENSION                                                             = 0x80000002
  15836 	TAPE_DRIVE_TENSION_IMMED                                                       = 0x80000040
  15837 	TAPE_DRIVE_VARIABLE_BLOCK                                                      = 0x00000800
  15838 	TAPE_DRIVE_WRITE_FILEMARKS                                                     = 0x82000000
  15839 	TAPE_DRIVE_WRITE_LONG_FMKS                                                     = 0x88000000
  15840 	TAPE_DRIVE_WRITE_MARK_IMMED                                                    = 0x90000000
  15841 	TAPE_DRIVE_WRITE_PROTECT                                                       = 0x00001000
  15842 	TAPE_DRIVE_WRITE_SETMARKS                                                      = 0x81000000
  15843 	TAPE_DRIVE_WRITE_SHORT_FMKS                                                    = 0x84000000
  15844 	TAPE_ERASE_LONG                                                                = 1
  15845 	TAPE_ERASE_SHORT                                                               = 0
  15846 	TAPE_FILEMARKS                                                                 = 1
  15847 	TAPE_FIXED_PARTITIONS                                                          = 0
  15848 	TAPE_FORMAT                                                                    = 5
  15849 	TAPE_INITIATOR_PARTITIONS                                                      = 2
  15850 	TAPE_LOAD                                                                      = 0
  15851 	TAPE_LOCK                                                                      = 3
  15852 	TAPE_LOGICAL_BLOCK                                                             = 2
  15853 	TAPE_LOGICAL_POSITION                                                          = 1
  15854 	TAPE_LONG_FILEMARKS                                                            = 3
  15855 	TAPE_PSEUDO_LOGICAL_BLOCK                                                      = 3
  15856 	TAPE_PSEUDO_LOGICAL_POSITION                                                   = 2
  15857 	TAPE_QUERY_DEVICE_ERROR_DATA                                                   = 4
  15858 	TAPE_QUERY_DRIVE_PARAMETERS                                                    = 0
  15859 	TAPE_QUERY_IO_ERROR_DATA                                                       = 3
  15860 	TAPE_QUERY_MEDIA_CAPACITY                                                      = 1
  15861 	TAPE_RESET_STATISTICS                                                          = 2
  15862 	TAPE_RETURN_ENV_INFO                                                           = 1
  15863 	TAPE_RETURN_STATISTICS                                                         = 0
  15864 	TAPE_REWIND                                                                    = 0
  15865 	TAPE_SELECT_PARTITIONS                                                         = 1
  15866 	TAPE_SETMARKS                                                                  = 0
  15867 	TAPE_SHORT_FILEMARKS                                                           = 2
  15868 	TAPE_SPACE_END_OF_DATA                                                         = 4
  15869 	TAPE_SPACE_FILEMARKS                                                           = 6
  15870 	TAPE_SPACE_RELATIVE_BLOCKS                                                     = 5
  15871 	TAPE_SPACE_SEQUENTIAL_FMKS                                                     = 7
  15872 	TAPE_SPACE_SEQUENTIAL_SMKS                                                     = 9
  15873 	TAPE_SPACE_SETMARKS                                                            = 8
  15874 	TAPE_TENSION                                                                   = 2
  15875 	TAPE_UNLOAD                                                                    = 1
  15876 	TAPE_UNLOCK                                                                    = 4
  15877 	TARGET_IS_NT351_OR_WIN95_OR_LATER                                              = 1
  15878 	TARGET_IS_NT40_OR_LATER                                                        = 1
  15879 	TARGET_IS_NT50_OR_LATER                                                        = 1
  15880 	TARGET_IS_NT51_OR_LATER                                                        = 1
  15881 	TARGET_IS_NT60_OR_LATER                                                        = 0
  15882 	TARGET_IS_NT61_OR_LATER                                                        = 0
  15883 	TA_BASELINE                                                                    = 24
  15884 	TA_BOTTOM                                                                      = 8
  15885 	TA_CENTER                                                                      = 6
  15886 	TA_LEFT                                                                        = 0
  15887 	TA_MASK                                                                        = 287
  15888 	TA_NOUPDATECP                                                                  = 0
  15889 	TA_RIGHT                                                                       = 2
  15890 	TA_RTLREADING                                                                  = 256
  15891 	TA_TOP                                                                         = 0
  15892 	TA_UPDATECP                                                                    = 1
  15893 	TCI_SRCCHARSET                                                                 = 1
  15894 	TCI_SRCCODEPAGE                                                                = 2
  15895 	TCI_SRCFONTSIG                                                                 = 3
  15896 	TCI_SRCLOCALE                                                                  = 0x1000
  15897 	TCP_BSDURGENT                                                                  = 0x7000
  15898 	TCP_NODELAY                                                                    = 0x0001
  15899 	TC_CP_STROKE                                                                   = 0x00000004
  15900 	TC_CR_90                                                                       = 0x00000008
  15901 	TC_CR_ANY                                                                      = 0x00000010
  15902 	TC_EA_DOUBLE                                                                   = 0x00000200
  15903 	TC_GP_TRAP                                                                     = 2
  15904 	TC_HARDERR                                                                     = 1
  15905 	TC_IA_ABLE                                                                     = 0x00000400
  15906 	TC_NORMAL                                                                      = 0
  15907 	TC_OP_CHARACTER                                                                = 0x00000001
  15908 	TC_OP_STROKE                                                                   = 0x00000002
  15909 	TC_RA_ABLE                                                                     = 0x00002000
  15910 	TC_RESERVED                                                                    = 0x00008000
  15911 	TC_SA_CONTIN                                                                   = 0x00000100
  15912 	TC_SA_DOUBLE                                                                   = 0x00000040
  15913 	TC_SA_INTEGER                                                                  = 0x00000080
  15914 	TC_SCROLLBLT                                                                   = 0x00010000
  15915 	TC_SF_X_YINDEP                                                                 = 0x00000020
  15916 	TC_SIGNAL                                                                      = 3
  15917 	TC_SO_ABLE                                                                     = 0x00001000
  15918 	TC_UA_ABLE                                                                     = 0x00000800
  15919 	TC_VA_ABLE                                                                     = 0x00004000
  15920 	TECHNOLOGY                                                                     = 2
  15921 	TERM_ANDINFO                                                                   = 0x0020
  15922 	TERM_CODED                                                                     = 0x0004
  15923 	TERM_COPIED                                                                    = 0x0008
  15924 	TERM_DYNAMIC                                                                   = 0x0001
  15925 	TERM_HEURTRUTH                                                                 = 0x2000
  15926 	TERM_HIGHTRUTH                                                                 = 0x4000
  15927 	TERM_IS                                                                        = 0x0800
  15928 	TERM_LIKE                                                                      = 0x0400
  15929 	TERM_LIKECOND                                                                  = 0x0200
  15930 	TERM_LIKEOPT                                                                   = 0x0100
  15931 	TERM_OK                                                                        = 0x0040
  15932 	TERM_ORINFO                                                                    = 0x0010
  15933 	TERM_SLICE                                                                     = 0x8000
  15934 	TERM_VARSELECT                                                                 = 0x1000
  15935 	TERM_VIRTUAL                                                                   = 0x0002
  15936 	TERM_VNULL                                                                     = 0x0080
  15937 	TEXTCAPS                                                                       = 34
  15938 	TF_Autoincrement                                                               = 0x00000008
  15939 	TF_DISCONNECT                                                                  = 0x01
  15940 	TF_Ephemeral                                                                   = 0x00004000
  15941 	TF_Eponymous                                                                   = 0x00008000
  15942 	TF_HasGenerated                                                                = 0x00000060
  15943 	TF_HasHidden                                                                   = 0x00000002
  15944 	TF_HasNotNull                                                                  = 0x00000800
  15945 	TF_HasPrimaryKey                                                               = 0x00000004
  15946 	TF_HasStat1                                                                    = 0x00000010
  15947 	TF_HasStat4                                                                    = 0x00002000
  15948 	TF_HasStored                                                                   = 0x00000040
  15949 	TF_HasVirtual                                                                  = 0x00000020
  15950 	TF_NoVisibleRowid                                                              = 0x00000200
  15951 	TF_OOOHidden                                                                   = 0x00000400
  15952 	TF_REUSE_SOCKET                                                                = 0x02
  15953 	TF_Readonly                                                                    = 0x00000001
  15954 	TF_Shadow                                                                      = 0x00001000
  15955 	TF_StatsUsed                                                                   = 0x00000100
  15956 	TF_Strict                                                                      = 0x00010000
  15957 	TF_WRITE_BEHIND                                                                = 0x04
  15958 	TF_WithoutRowid                                                                = 0x00000080
  15959 	THAI_CHARSET                                                                   = 222
  15960 	THREAD_ALL_ACCESS                                                              = 2032639
  15961 	THREAD_BASE_PRIORITY_IDLE                                                      = -15
  15962 	THREAD_BASE_PRIORITY_LOWRT                                                     = 15
  15963 	THREAD_BASE_PRIORITY_MAX                                                       = 2
  15964 	THREAD_BASE_PRIORITY_MIN                                                       = -2
  15965 	THREAD_DIRECT_IMPERSONATION                                                    = 512
  15966 	THREAD_GET_CONTEXT                                                             = 8
  15967 	THREAD_IMPERSONATE                                                             = 256
  15968 	THREAD_MODE_BACKGROUND_BEGIN                                                   = 0x00010000
  15969 	THREAD_MODE_BACKGROUND_END                                                     = 0x00020000
  15970 	THREAD_PRIORITY_ABOVE_NORMAL                                                   = 1
  15971 	THREAD_PRIORITY_BELOW_NORMAL                                                   = -1
  15972 	THREAD_PRIORITY_ERROR_RETURN                                                   = 2147483647
  15973 	THREAD_PRIORITY_HIGHEST                                                        = 2
  15974 	THREAD_PRIORITY_IDLE                                                           = -15
  15975 	THREAD_PRIORITY_LOWEST                                                         = -2
  15976 	THREAD_PRIORITY_NORMAL                                                         = 0
  15977 	THREAD_PRIORITY_TIME_CRITICAL                                                  = 15
  15978 	THREAD_PROFILING_FLAG_DISPATCH                                                 = 0x1
  15979 	THREAD_QUERY_INFORMATION                                                       = 64
  15980 	THREAD_QUERY_LIMITED_INFORMATION                                               = 2048
  15981 	THREAD_SET_CONTEXT                                                             = 16
  15982 	THREAD_SET_INFORMATION                                                         = 32
  15983 	THREAD_SET_LIMITED_INFORMATION                                                 = 1024
  15984 	THREAD_SET_THREAD_TOKEN                                                        = 128
  15985 	THREAD_SUSPEND_RESUME                                                          = 2
  15986 	THREAD_TERMINATE                                                               = 1
  15987 	TIMEOUT_ASYNC                                                                  = 0xFFFFFFFF
  15988 	TIMERR_BASE                                                                    = 96
  15989 	TIMERR_NOCANDO                                                                 = 97
  15990 	TIMERR_NOERROR                                                                 = 0
  15991 	TIMERR_STRUCT                                                                  = 129
  15992 	TIMER_ABSTIME                                                                  = 1
  15993 	TIMER_ALL_ACCESS                                                               = 2031619
  15994 	TIMER_END                                                                      = 0
  15995 	TIMER_MODIFY_STATE                                                             = 0x0002
  15996 	TIMER_QUERY_STATE                                                              = 0x0001
  15997 	TIMER_START                                                                    = 0
  15998 	TIME_BYTES                                                                     = 0x0004
  15999 	TIME_CALLBACK_EVENT_PULSE                                                      = 0x0020
  16000 	TIME_CALLBACK_EVENT_SET                                                        = 0x0010
  16001 	TIME_CALLBACK_FUNCTION                                                         = 0x0000
  16002 	TIME_FORCE24HOURFORMAT                                                         = 0x00000008
  16003 	TIME_KILL_SYNCHRONOUS                                                          = 0x0100
  16004 	TIME_MIDI                                                                      = 0x0010
  16005 	TIME_MS                                                                        = 0x0001
  16006 	TIME_NOMINUTESORSECONDS                                                        = 0x00000001
  16007 	TIME_NOSECONDS                                                                 = 0x00000002
  16008 	TIME_NOTIMEMARKER                                                              = 0x00000004
  16009 	TIME_ONESHOT                                                                   = 0x0000
  16010 	TIME_PERIODIC                                                                  = 0x0001
  16011 	TIME_SAMPLES                                                                   = 0x0002
  16012 	TIME_SMPTE                                                                     = 0x0008
  16013 	TIME_TICKS                                                                     = 0x0020
  16014 	TIME_VALID_OID_FLUSH_OBJECT_FUNC                                               = "TimeValidDllFlushObject"
  16015 	TIME_VALID_OID_GET_OBJECT_FUNC                                                 = "TimeValidDllGetObject"
  16016 	TIME_ZONE_ID_DAYLIGHT                                                          = 2
  16017 	TIME_ZONE_ID_STANDARD                                                          = 1
  16018 	TIME_ZONE_ID_UNKNOWN                                                           = 0
  16019 	TKF_AVAILABLE                                                                  = 0x00000002
  16020 	TKF_CONFIRMHOTKEY                                                              = 0x00000008
  16021 	TKF_HOTKEYACTIVE                                                               = 0x00000004
  16022 	TKF_HOTKEYSOUND                                                                = 0x00000010
  16023 	TKF_INDICATOR                                                                  = 0x00000020
  16024 	TKF_TOGGLEKEYSON                                                               = 0x00000001
  16025 	TK_ABORT                                                                       = 27
  16026 	TK_ACTION                                                                      = 28
  16027 	TK_ADD                                                                         = 163
  16028 	TK_AFTER                                                                       = 29
  16029 	TK_AGG_COLUMN                                                                  = 169
  16030 	TK_AGG_FUNCTION                                                                = 168
  16031 	TK_ALL                                                                         = 135
  16032 	TK_ALTER                                                                       = 162
  16033 	TK_ALWAYS                                                                      = 96
  16034 	TK_ANALYZE                                                                     = 30
  16035 	TK_AND                                                                         = 44
  16036 	TK_ANY                                                                         = 101
  16037 	TK_AS                                                                          = 24
  16038 	TK_ASC                                                                         = 31
  16039 	TK_ASTERISK                                                                    = 180
  16040 	TK_ATTACH                                                                      = 32
  16041 	TK_AUTOINCR                                                                    = 126
  16042 	TK_BEFORE                                                                      = 33
  16043 	TK_BEGIN                                                                       = 5
  16044 	TK_BETWEEN                                                                     = 48
  16045 	TK_BITAND                                                                      = 102
  16046 	TK_BITNOT                                                                      = 114
  16047 	TK_BITOR                                                                       = 103
  16048 	TK_BLOB                                                                        = 154
  16049 	TK_BY                                                                          = 34
  16050 	TK_CASCADE                                                                     = 35
  16051 	TK_CASE                                                                        = 157
  16052 	TK_CAST                                                                        = 36
  16053 	TK_CHECK                                                                       = 124
  16054 	TK_COLLATE                                                                     = 113
  16055 	TK_COLUMN                                                                      = 167
  16056 	TK_COLUMNKW                                                                    = 60
  16057 	TK_COMMA                                                                       = 25
  16058 	TK_COMMIT                                                                      = 10
  16059 	TK_CONCAT                                                                      = 111
  16060 	TK_CONFLICT                                                                    = 37
  16061 	TK_CONSTRAINT                                                                  = 119
  16062 	TK_CREATE                                                                      = 17
  16063 	TK_CTIME_KW                                                                    = 100
  16064 	TK_CURRENT                                                                     = 85
  16065 	TK_DATABASE                                                                    = 38
  16066 	TK_DEFAULT                                                                     = 120
  16067 	TK_DEFERRABLE                                                                  = 131
  16068 	TK_DEFERRED                                                                    = 7
  16069 	TK_DELETE                                                                      = 128
  16070 	TK_DESC                                                                        = 39
  16071 	TK_DETACH                                                                      = 40
  16072 	TK_DISTINCT                                                                    = 140
  16073 	TK_DO                                                                          = 61
  16074 	TK_DOT                                                                         = 141
  16075 	TK_DROP                                                                        = 133
  16076 	TK_EACH                                                                        = 41
  16077 	TK_ELSE                                                                        = 160
  16078 	TK_END                                                                         = 11
  16079 	TK_EQ                                                                          = 53
  16080 	TK_ERROR                                                                       = 182
  16081 	TK_ESCAPE                                                                      = 58
  16082 	TK_EXCEPT                                                                      = 136
  16083 	TK_EXCLUDE                                                                     = 91
  16084 	TK_EXCLUSIVE                                                                   = 9
  16085 	TK_EXISTS                                                                      = 20
  16086 	TK_EXPLAIN                                                                     = 2
  16087 	TK_FAIL                                                                        = 42
  16088 	TK_FILTER                                                                      = 166
  16089 	TK_FIRST                                                                       = 83
  16090 	TK_FLOAT                                                                       = 153
  16091 	TK_FOLLOWING                                                                   = 86
  16092 	TK_FOR                                                                         = 62
  16093 	TK_FOREIGN                                                                     = 132
  16094 	TK_FROM                                                                        = 142
  16095 	TK_FUNCTION                                                                    = 172
  16096 	TK_GE                                                                          = 57
  16097 	TK_GENERATED                                                                   = 95
  16098 	TK_GROUP                                                                       = 146
  16099 	TK_GROUPS                                                                      = 92
  16100 	TK_GT                                                                          = 54
  16101 	TK_HAVING                                                                      = 147
  16102 	TK_ID                                                                          = 59
  16103 	TK_IF                                                                          = 18
  16104 	TK_IF_NULL_ROW                                                                 = 179
  16105 	TK_IGNORE                                                                      = 63
  16106 	TK_ILLEGAL                                                                     = 184
  16107 	TK_IMMEDIATE                                                                   = 8
  16108 	TK_IN                                                                          = 49
  16109 	TK_INDEX                                                                       = 161
  16110 	TK_INDEXED                                                                     = 116
  16111 	TK_INITIALLY                                                                   = 64
  16112 	TK_INSERT                                                                      = 127
  16113 	TK_INSTEAD                                                                     = 65
  16114 	TK_INTEGER                                                                     = 155
  16115 	TK_INTERSECT                                                                   = 137
  16116 	TK_INTO                                                                        = 151
  16117 	TK_IS                                                                          = 45
  16118 	TK_ISNOT                                                                       = 171
  16119 	TK_ISNULL                                                                      = 50
  16120 	TK_JOIN                                                                        = 143
  16121 	TK_JOIN_KW                                                                     = 118
  16122 	TK_KEY                                                                         = 67
  16123 	TK_LAST                                                                        = 84
  16124 	TK_LE                                                                          = 55
  16125 	TK_LIKE_KW                                                                     = 47
  16126 	TK_LIMIT                                                                       = 148
  16127 	TK_LP                                                                          = 22
  16128 	TK_LSHIFT                                                                      = 104
  16129 	TK_LT                                                                          = 56
  16130 	TK_MATCH                                                                       = 46
  16131 	TK_MATERIALIZED                                                                = 97
  16132 	TK_MINUS                                                                       = 107
  16133 	TK_NE                                                                          = 52
  16134 	TK_NO                                                                          = 66
  16135 	TK_NOT                                                                         = 19
  16136 	TK_NOTHING                                                                     = 152
  16137 	TK_NOTNULL                                                                     = 51
  16138 	TK_NULL                                                                        = 121
  16139 	TK_NULLS                                                                       = 82
  16140 	TK_OF                                                                          = 68
  16141 	TK_OFFSET                                                                      = 69
  16142 	TK_ON                                                                          = 115
  16143 	TK_OR                                                                          = 43
  16144 	TK_ORDER                                                                       = 145
  16145 	TK_OTHERS                                                                      = 93
  16146 	TK_OVER                                                                        = 165
  16147 	TK_PARTITION                                                                   = 87
  16148 	TK_PLAN                                                                        = 4
  16149 	TK_PLUS                                                                        = 106
  16150 	TK_PRAGMA                                                                      = 70
  16151 	TK_PRECEDING                                                                   = 88
  16152 	TK_PRIMARY                                                                     = 122
  16153 	TK_PTR                                                                         = 112
  16154 	TK_QUERY                                                                       = 3
  16155 	TK_RAISE                                                                       = 71
  16156 	TK_RANGE                                                                       = 89
  16157 	TK_RECURSIVE                                                                   = 72
  16158 	TK_REFERENCES                                                                  = 125
  16159 	TK_REGISTER                                                                    = 176
  16160 	TK_REINDEX                                                                     = 98
  16161 	TK_RELEASE                                                                     = 14
  16162 	TK_REM                                                                         = 110
  16163 	TK_RENAME                                                                      = 99
  16164 	TK_REPLACE                                                                     = 73
  16165 	TK_RESTRICT                                                                    = 74
  16166 	TK_RETURNING                                                                   = 150
  16167 	TK_ROLLBACK                                                                    = 12
  16168 	TK_ROW                                                                         = 75
  16169 	TK_ROWS                                                                        = 76
  16170 	TK_RP                                                                          = 23
  16171 	TK_RSHIFT                                                                      = 105
  16172 	TK_SAVEPOINT                                                                   = 13
  16173 	TK_SELECT                                                                      = 138
  16174 	TK_SELECT_COLUMN                                                               = 178
  16175 	TK_SEMI                                                                        = 1
  16176 	TK_SET                                                                         = 130
  16177 	TK_SLASH                                                                       = 109
  16178 	TK_SPACE                                                                       = 183
  16179 	TK_SPAN                                                                        = 181
  16180 	TK_STAR                                                                        = 108
  16181 	TK_STRING                                                                      = 117
  16182 	TK_TABLE                                                                       = 16
  16183 	TK_TEMP                                                                        = 21
  16184 	TK_THEN                                                                        = 159
  16185 	TK_TIES                                                                        = 94
  16186 	TK_TO                                                                          = 15
  16187 	TK_TRANSACTION                                                                 = 6
  16188 	TK_TRIGGER                                                                     = 77
  16189 	TK_TRUEFALSE                                                                   = 170
  16190 	TK_TRUTH                                                                       = 175
  16191 	TK_UMINUS                                                                      = 173
  16192 	TK_UNBOUNDED                                                                   = 90
  16193 	TK_UNION                                                                       = 134
  16194 	TK_UNIQUE                                                                      = 123
  16195 	TK_UPDATE                                                                      = 129
  16196 	TK_UPLUS                                                                       = 174
  16197 	TK_USING                                                                       = 144
  16198 	TK_VACUUM                                                                      = 78
  16199 	TK_VALUES                                                                      = 139
  16200 	TK_VARIABLE                                                                    = 156
  16201 	TK_VECTOR                                                                      = 177
  16202 	TK_VIEW                                                                        = 79
  16203 	TK_VIRTUAL                                                                     = 80
  16204 	TK_WHEN                                                                        = 158
  16205 	TK_WHERE                                                                       = 149
  16206 	TK_WINDOW                                                                      = 164
  16207 	TK_WITH                                                                        = 81
  16208 	TK_WITHOUT                                                                     = 26
  16209 	TLOSS                                                                          = 5
  16210 	TLS_MINIMUM_AVAILABLE                                                          = 64
  16211 	TME_CANCEL                                                                     = 0x80000000
  16212 	TME_HOVER                                                                      = 0x00000001
  16213 	TME_LEAVE                                                                      = 0x00000002
  16214 	TME_NONCLIENT                                                                  = 0x00000010
  16215 	TME_QUERY                                                                      = 0x40000000
  16216 	TMPF_DEVICE                                                                    = 0x08
  16217 	TMPF_FIXED_PITCH                                                               = 0x01
  16218 	TMPF_TRUETYPE                                                                  = 0x04
  16219 	TMPF_VECTOR                                                                    = 0x02
  16220 	TMP_MAX                                                                        = 32767
  16221 	TMP_MAX_S                                                                      = 32767
  16222 	TOKEN_ADJUST_DEFAULT                                                           = 128
  16223 	TOKEN_ADJUST_GROUPS                                                            = 64
  16224 	TOKEN_ADJUST_PRIVILEGES                                                        = 32
  16225 	TOKEN_ADJUST_SESSIONID                                                         = 256
  16226 	TOKEN_ALL_ACCESS                                                               = 983551
  16227 	TOKEN_ALL_ACCESS_P                                                             = 983295
  16228 	TOKEN_ASSIGN_PRIMARY                                                           = 1
  16229 	TOKEN_DUPLICATE                                                                = 2
  16230 	TOKEN_EXECUTE                                                                  = 131072
  16231 	TOKEN_IMPERSONATE                                                              = 4
  16232 	TOKEN_MANDATORY_POLICY_NEW_PROCESS_MIN                                         = 0x2
  16233 	TOKEN_MANDATORY_POLICY_NO_WRITE_UP                                             = 0x1
  16234 	TOKEN_MANDATORY_POLICY_OFF                                                     = 0x0
  16235 	TOKEN_MANDATORY_POLICY_VALID_MASK                                              = 3
  16236 	TOKEN_QUERY                                                                    = 8
  16237 	TOKEN_QUERY_SOURCE                                                             = 16
  16238 	TOKEN_READ                                                                     = 131080
  16239 	TOKEN_SOURCE_LENGTH                                                            = 8
  16240 	TOKEN_WRITE                                                                    = 131296
  16241 	TPM_BOTTOMALIGN                                                                = 32
  16242 	TPM_CENTERALIGN                                                                = 4
  16243 	TPM_HORIZONTAL                                                                 = 0
  16244 	TPM_HORNEGANIMATION                                                            = 2048
  16245 	TPM_HORPOSANIMATION                                                            = 1024
  16246 	TPM_LAYOUTRTL                                                                  = 32768
  16247 	TPM_LEFTALIGN                                                                  = 0
  16248 	TPM_LEFTBUTTON                                                                 = 0
  16249 	TPM_NOANIMATION                                                                = 16384
  16250 	TPM_NONOTIFY                                                                   = 128
  16251 	TPM_RECURSE                                                                    = 1
  16252 	TPM_RETURNCMD                                                                  = 256
  16253 	TPM_RIGHTALIGN                                                                 = 8
  16254 	TPM_RIGHTBUTTON                                                                = 2
  16255 	TPM_TOPALIGN                                                                   = 0
  16256 	TPM_VCENTERALIGN                                                               = 16
  16257 	TPM_VERNEGANIMATION                                                            = 8192
  16258 	TPM_VERPOSANIMATION                                                            = 4096
  16259 	TPM_VERTICAL                                                                   = 64
  16260 	TRANSACTIONMANAGER_ALL_ACCESS                                                  = 983103
  16261 	TRANSACTIONMANAGER_BIND_TRANSACTION                                            = 0x00020
  16262 	TRANSACTIONMANAGER_CREATE_RM                                                   = 0x00010
  16263 	TRANSACTIONMANAGER_GENERIC_EXECUTE                                             = 131072
  16264 	TRANSACTIONMANAGER_GENERIC_READ                                                = 131073
  16265 	TRANSACTIONMANAGER_GENERIC_WRITE                                               = 131102
  16266 	TRANSACTIONMANAGER_QUERY_INFORMATION                                           = 0x00001
  16267 	TRANSACTIONMANAGER_RECOVER                                                     = 0x00004
  16268 	TRANSACTIONMANAGER_RENAME                                                      = 0x00008
  16269 	TRANSACTIONMANAGER_SET_INFORMATION                                             = 0x00002
  16270 	TRANSACTION_ALL_ACCESS                                                         = 2031679
  16271 	TRANSACTION_COMMIT                                                             = 8
  16272 	TRANSACTION_DO_NOT_PROMOTE                                                     = 0x00000001
  16273 	TRANSACTION_ENLIST                                                             = 4
  16274 	TRANSACTION_GENERIC_EXECUTE                                                    = 1179672
  16275 	TRANSACTION_GENERIC_READ                                                       = 1179649
  16276 	TRANSACTION_GENERIC_WRITE                                                      = 1179710
  16277 	TRANSACTION_MANAGER_COMMIT_DEFAULT                                             = 0x00000000
  16278 	TRANSACTION_MANAGER_COMMIT_LOWEST                                              = 0x00000008
  16279 	TRANSACTION_MANAGER_COMMIT_SYSTEM_HIVES                                        = 0x00000004
  16280 	TRANSACTION_MANAGER_COMMIT_SYSTEM_VOLUME                                       = 0x00000002
  16281 	TRANSACTION_MANAGER_CORRUPT_FOR_PROGRESS                                       = 0x00000020
  16282 	TRANSACTION_MANAGER_CORRUPT_FOR_RECOVERY                                       = 0x00000010
  16283 	TRANSACTION_MANAGER_MAXIMUM_OPTION                                             = 0x0000003f
  16284 	TRANSACTION_MANAGER_VOLATILE                                                   = 0x00000001
  16285 	TRANSACTION_MAXIMUM_OPTION                                                     = 0x00000001
  16286 	TRANSACTION_NOTIFICATION_TM_ONLINE_FLAG_IS_CLUSTERED                           = 0x1
  16287 	TRANSACTION_NOTIFY_COMMIT                                                      = 0x00000004
  16288 	TRANSACTION_NOTIFY_COMMIT_COMPLETE                                             = 0x00000040
  16289 	TRANSACTION_NOTIFY_COMMIT_FINALIZE                                             = 0x40000000
  16290 	TRANSACTION_NOTIFY_COMMIT_REQUEST                                              = 0x04000000
  16291 	TRANSACTION_NOTIFY_DELEGATE_COMMIT                                             = 0x00000400
  16292 	TRANSACTION_NOTIFY_ENLIST_MASK                                                 = 0x00040000
  16293 	TRANSACTION_NOTIFY_ENLIST_PREPREPARE                                           = 0x00001000
  16294 	TRANSACTION_NOTIFY_INDOUBT                                                     = 0x00004000
  16295 	TRANSACTION_NOTIFY_LAST_RECOVER                                                = 0x00002000
  16296 	TRANSACTION_NOTIFY_MARSHAL                                                     = 0x00020000
  16297 	TRANSACTION_NOTIFY_MASK                                                        = 0x3fffffff
  16298 	TRANSACTION_NOTIFY_PREPARE                                                     = 0x00000002
  16299 	TRANSACTION_NOTIFY_PREPARE_COMPLETE                                            = 0x00000020
  16300 	TRANSACTION_NOTIFY_PREPREPARE                                                  = 0x00000001
  16301 	TRANSACTION_NOTIFY_PREPREPARE_COMPLETE                                         = 0x00000010
  16302 	TRANSACTION_NOTIFY_PROMOTE                                                     = 0x08000000
  16303 	TRANSACTION_NOTIFY_PROMOTE_NEW                                                 = 0x10000000
  16304 	TRANSACTION_NOTIFY_PROPAGATE_PULL                                              = 0x00008000
  16305 	TRANSACTION_NOTIFY_PROPAGATE_PUSH                                              = 0x00010000
  16306 	TRANSACTION_NOTIFY_RECOVER                                                     = 0x00000100
  16307 	TRANSACTION_NOTIFY_RECOVER_QUERY                                               = 0x00000800
  16308 	TRANSACTION_NOTIFY_REQUEST_OUTCOME                                             = 0x20000000
  16309 	TRANSACTION_NOTIFY_RM_DISCONNECTED                                             = 0x01000000
  16310 	TRANSACTION_NOTIFY_ROLLBACK                                                    = 0x00000008
  16311 	TRANSACTION_NOTIFY_ROLLBACK_COMPLETE                                           = 0x00000080
  16312 	TRANSACTION_NOTIFY_SINGLE_PHASE_COMMIT                                         = 0x00000200
  16313 	TRANSACTION_NOTIFY_TM_ONLINE                                                   = 0x02000000
  16314 	TRANSACTION_PROPAGATE                                                          = 32
  16315 	TRANSACTION_QUERY_INFORMATION                                                  = 1
  16316 	TRANSACTION_RESOURCE_MANAGER_RIGHTS                                            = 1179703
  16317 	TRANSACTION_RIGHT_RESERVED1                                                    = 64
  16318 	TRANSACTION_ROLLBACK                                                           = 16
  16319 	TRANSACTION_SET_INFORMATION                                                    = 2
  16320 	TRANSFORM_CTM                                                                  = 4107
  16321 	TRANSPARENT                                                                    = 1
  16322 	TRANSPORT_TYPE_CN                                                              = 0x01
  16323 	TRANSPORT_TYPE_DG                                                              = 0x02
  16324 	TRANSPORT_TYPE_LPC                                                             = 0x04
  16325 	TRANSPORT_TYPE_WMSG                                                            = 0x08
  16326 	TRANS_NONE                                                                     = 0
  16327 	TRANS_READ                                                                     = 1
  16328 	TRANS_WRITE                                                                    = 2
  16329 	TREETRACE_ENABLED                                                              = 0
  16330 	TRIGGER_AFTER                                                                  = 2
  16331 	TRIGGER_BEFORE                                                                 = 1
  16332 	TRUE                                                                           = 1
  16333 	TRUETYPE_FONTTYPE                                                              = 0x004
  16334 	TRUNCATE_EXISTING                                                              = 5
  16335 	TRY_AGAIN                                                                      = 11002
  16336 	TT_AVAILABLE                                                                   = 0x0001
  16337 	TT_ENABLED                                                                     = 0x0002
  16338 	TT_OPENTYPE_FONTTYPE                                                           = 0x20000
  16339 	TT_POLYGON_TYPE                                                                = 24
  16340 	TT_PRIM_CSPLINE                                                                = 3
  16341 	TT_PRIM_LINE                                                                   = 1
  16342 	TT_PRIM_QSPLINE                                                                = 2
  16343 	TURKISH_CHARSET                                                                = 162
  16344 	TWOSTOPBITS                                                                    = 2
  16345 	TYPE1_FONTTYPE                                                                 = 0x40000
  16346 	UAS_EXACTLEGACY                                                                = 0x1000
  16347 	UCHAR_MAX                                                                      = 255
  16348 	UCLEANUI                                                                       = 67108864
  16349 	UDIRTYUI                                                                       = 134217728
  16350 	UINT_MAX                                                                       = 4294967295
  16351 	UISF_ACTIVE                                                                    = 0x4
  16352 	UISF_HIDEACCEL                                                                 = 0x2
  16353 	UISF_HIDEFOCUS                                                                 = 0x1
  16354 	UIS_CLEAR                                                                      = 2
  16355 	UIS_INITIALIZE                                                                 = 3
  16356 	UIS_SET                                                                        = 1
  16357 	UI_CAP_2700                                                                    = 0x00000001
  16358 	UI_CAP_ROT90                                                                   = 0x00000002
  16359 	UI_CAP_ROTANY                                                                  = 0x00000004
  16360 	ULLONG_MAX                                                                     = 18446744073709551615
  16361 	ULONG_LONG_MAX                                                                 = 18446744073709551615
  16362 	ULONG_MAX                                                                      = 4294967295
  16363 	ULW_ALPHA                                                                      = 0x00000002
  16364 	ULW_COLORKEY                                                                   = 0x00000001
  16365 	ULW_EX_NORESIZE                                                                = 0x00000008
  16366 	ULW_OPAQUE                                                                     = 0x00000004
  16367 	UNALIGNED                                                                      = 0
  16368 	UNALIGNED64                                                                    = 0
  16369 	UNDEFINE_ALTERNATE                                                             = 0xD
  16370 	UNDEFINE_PRIMARY                                                               = 0xC
  16371 	UNDERFLOW                                                                      = 4
  16372 	UNICODE_NOCHAR                                                                 = 0xFFFF
  16373 	UNICODE_STRING_MAX_CHARS                                                       = 32767
  16374 	UNIQUE_NAME                                                                    = 0x00
  16375 	UNIVERSAL_NAME_INFO_LEVEL                                                      = 0x00000001
  16376 	UNKNOWN_LOCK                                                                   = 5
  16377 	UNLOAD_DLL_DEBUG_EVENT                                                         = 7
  16378 	UNLOCK_ELEMENT                                                                 = 1
  16379 	UNPROTECTED_DACL_SECURITY_INFORMATION                                          = 536870912
  16380 	UNPROTECTED_SACL_SECURITY_INFORMATION                                          = 268435456
  16381 	UNRECOVERED_READS_VALID                                                        = 0x00000008
  16382 	UNRECOVERED_WRITES_VALID                                                       = 0x00000002
  16383 	UNWIND_HISTORY_TABLE_GLOBAL                                                    = 1
  16384 	UNWIND_HISTORY_TABLE_LOCAL                                                     = 2
  16385 	UNWIND_HISTORY_TABLE_NONE                                                      = 0
  16386 	UNWIND_HISTORY_TABLE_SIZE                                                      = 12
  16387 	UNW_FLAG_CHAININFO                                                             = 0x4
  16388 	UNW_FLAG_EHANDLER                                                              = 0x1
  16389 	UNW_FLAG_NHANDLER                                                              = 0x0
  16390 	UNW_FLAG_UHANDLER                                                              = 0x2
  16391 	UOI_FLAGS                                                                      = 1
  16392 	UOI_NAME                                                                       = 2
  16393 	UOI_TIMERPROC_EXCEPTION_SUPPRESSION                                            = 7
  16394 	UOI_TYPE                                                                       = 3
  16395 	UOI_USER_SID                                                                   = 4
  16396 	UPDFCACHE_IFBLANK                                                              = 16
  16397 	UPDFCACHE_IFBLANKORONSAVECACHE                                                 = 18
  16398 	UPDFCACHE_NODATACACHE                                                          = 1
  16399 	UPDFCACHE_NORMALCACHE                                                          = 8
  16400 	UPDFCACHE_ONLYIFBLANK                                                          = 2147483648
  16401 	UPDFCACHE_ONSAVECACHE                                                          = 2
  16402 	UPDFCACHE_ONSTOPCACHE                                                          = 4
  16403 	UPOINTER_32                                                                    = 0
  16404 	URLACTION_ACTIVEX_CONFIRM_NOOBJECTSAFETY                                       = 0x1204
  16405 	URLACTION_ACTIVEX_CURR_MAX                                                     = 0x120B
  16406 	URLACTION_ACTIVEX_DYNSRC_VIDEO_AND_ANIMATION                                   = 0x120A
  16407 	URLACTION_ACTIVEX_MAX                                                          = 0x13ff
  16408 	URLACTION_ACTIVEX_MIN                                                          = 0x1200
  16409 	URLACTION_ACTIVEX_NO_WEBOC_SCRIPT                                              = 0x1206
  16410 	URLACTION_ACTIVEX_OVERRIDE_DATA_SAFETY                                         = 0x1202
  16411 	URLACTION_ACTIVEX_OVERRIDE_DOMAINLIST                                          = 0x120B
  16412 	URLACTION_ACTIVEX_OVERRIDE_OBJECT_SAFETY                                       = 0x1201
  16413 	URLACTION_ACTIVEX_OVERRIDE_OPTIN                                               = 0x1208
  16414 	URLACTION_ACTIVEX_OVERRIDE_REPURPOSEDETECTION                                  = 0x1207
  16415 	URLACTION_ACTIVEX_OVERRIDE_SCRIPT_SAFETY                                       = 0x1203
  16416 	URLACTION_ACTIVEX_RUN                                                          = 0x1200
  16417 	URLACTION_ACTIVEX_SCRIPTLET_RUN                                                = 0x1209
  16418 	URLACTION_ACTIVEX_TREATASUNTRUSTED                                             = 0x1205
  16419 	URLACTION_ALLOW_ACTIVEX_FILTERING                                              = 0x2702
  16420 	URLACTION_ALLOW_AUDIO_VIDEO                                                    = 0x2701
  16421 	URLACTION_ALLOW_AUDIO_VIDEO_PLUGINS                                            = 0x2704
  16422 	URLACTION_ALLOW_CROSSDOMAIN_APPCACHE_MANIFEST                                  = 0x270A
  16423 	URLACTION_ALLOW_CROSSDOMAIN_DROP_ACROSS_WINDOWS                                = 0x2709
  16424 	URLACTION_ALLOW_CROSSDOMAIN_DROP_WITHIN_WINDOW                                 = 0x2708
  16425 	URLACTION_ALLOW_RENDER_LEGACY_DXTFILTERS                                       = 0x270B
  16426 	URLACTION_ALLOW_STRUCTURED_STORAGE_SNIFFING                                    = 0x2703
  16427 	URLACTION_ALLOW_XDOMAIN_SUBFRAME_RESIZE                                        = 0x1408
  16428 	URLACTION_ALLOW_ZONE_ELEVATION_OPT_OUT_ADDITION                                = 0x2706
  16429 	URLACTION_ALLOW_ZONE_ELEVATION_VIA_OPT_OUT                                     = 0x2705
  16430 	URLACTION_AUTHENTICATE_CLIENT                                                  = 0x1A01
  16431 	URLACTION_CHANNEL_SOFTDIST_MAX                                                 = 0x1Eff
  16432 	URLACTION_CHANNEL_SOFTDIST_MIN                                                 = 0x1E00
  16433 	URLACTION_CHANNEL_SOFTDIST_PERMISSIONS                                         = 0x1E05
  16434 	URLACTION_CLIENT_CERT_PROMPT                                                   = 0x1A04
  16435 	URLACTION_COOKIES                                                              = 0x1A02
  16436 	URLACTION_COOKIES_ENABLED                                                      = 0x1A10
  16437 	URLACTION_COOKIES_SESSION                                                      = 0x1A03
  16438 	URLACTION_COOKIES_SESSION_THIRD_PARTY                                          = 0x1A06
  16439 	URLACTION_COOKIES_THIRD_PARTY                                                  = 0x1A05
  16440 	URLACTION_CREDENTIALS_USE                                                      = 0x1A00
  16441 	URLACTION_CROSS_DOMAIN_DATA                                                    = 0x1406
  16442 	URLACTION_DOWNLOAD_CURR_MAX                                                    = 0x1004
  16443 	URLACTION_DOWNLOAD_MAX                                                         = 0x11FF
  16444 	URLACTION_DOWNLOAD_MIN                                                         = 0x1000
  16445 	URLACTION_DOWNLOAD_SIGNED_ACTIVEX                                              = 0x1001
  16446 	URLACTION_DOWNLOAD_UNSIGNED_ACTIVEX                                            = 0x1004
  16447 	URLACTION_HTML_ALLOW_CROSS_DOMAIN_CANVAS                                       = 0x160D
  16448 	URLACTION_HTML_ALLOW_CROSS_DOMAIN_TEXTTRACK                                    = 0x1610
  16449 	URLACTION_HTML_ALLOW_CROSS_DOMAIN_WEBWORKER                                    = 0x160F
  16450 	URLACTION_HTML_ALLOW_INDEXEDDB                                                 = 0x1611
  16451 	URLACTION_HTML_ALLOW_INJECTED_DYNAMIC_HTML                                     = 0x160B
  16452 	URLACTION_HTML_ALLOW_WINDOW_CLOSE                                              = 0x160E
  16453 	URLACTION_HTML_FONT_DOWNLOAD                                                   = 0x1604
  16454 	URLACTION_HTML_INCLUDE_FILE_PATH                                               = 0x160A
  16455 	URLACTION_HTML_JAVA_RUN                                                        = 0x1605
  16456 	URLACTION_HTML_MAX                                                             = 0x17ff
  16457 	URLACTION_HTML_META_REFRESH                                                    = 0x1608
  16458 	URLACTION_HTML_MIN                                                             = 0x1600
  16459 	URLACTION_HTML_MIXED_CONTENT                                                   = 0x1609
  16460 	URLACTION_HTML_REQUIRE_UTF8_DOCUMENT_CODEPAGE                                  = 0x160C
  16461 	URLACTION_HTML_SUBFRAME_NAVIGATE                                               = 0x1607
  16462 	URLACTION_HTML_SUBMIT_FORMS                                                    = 0x1601
  16463 	URLACTION_HTML_SUBMIT_FORMS_FROM                                               = 0x1602
  16464 	URLACTION_HTML_SUBMIT_FORMS_TO                                                 = 0x1603
  16465 	URLACTION_HTML_USERDATA_SAVE                                                   = 0x1606
  16466 	URLACTION_INFODELIVERY_CURR_MAX                                                = 0x1D06
  16467 	URLACTION_INFODELIVERY_MAX                                                     = 0x1Dff
  16468 	URLACTION_INFODELIVERY_MIN                                                     = 0x1D00
  16469 	URLACTION_INFODELIVERY_NO_ADDING_CHANNELS                                      = 0x1D00
  16470 	URLACTION_INFODELIVERY_NO_ADDING_SUBSCRIPTIONS                                 = 0x1D03
  16471 	URLACTION_INFODELIVERY_NO_CHANNEL_LOGGING                                      = 0x1D06
  16472 	URLACTION_INFODELIVERY_NO_EDITING_CHANNELS                                     = 0x1D01
  16473 	URLACTION_INFODELIVERY_NO_EDITING_SUBSCRIPTIONS                                = 0x1D04
  16474 	URLACTION_INFODELIVERY_NO_REMOVING_CHANNELS                                    = 0x1D02
  16475 	URLACTION_INFODELIVERY_NO_REMOVING_SUBSCRIPTIONS                               = 0x1D05
  16476 	URLACTION_JAVA_CURR_MAX                                                        = 0x1C00
  16477 	URLACTION_JAVA_MAX                                                             = 0x1Cff
  16478 	URLACTION_JAVA_MIN                                                             = 0x1C00
  16479 	URLACTION_JAVA_PERMISSIONS                                                     = 0x1C00
  16480 	URLACTION_MIN                                                                  = 0x1000
  16481 	URLACTION_NETWORK_CURR_MAX                                                     = 0x1A10
  16482 	URLACTION_NETWORK_MAX                                                          = 0x1Bff
  16483 	URLACTION_NETWORK_MIN                                                          = 0x1A00
  16484 	URLACTION_PLUGGABLE_PROTOCOL_XHR                                               = 0x140B
  16485 	URLACTION_SCRIPT_CURR_MAX                                                      = 0x140B
  16486 	URLACTION_SCRIPT_JAVA_USE                                                      = 0x1402
  16487 	URLACTION_SCRIPT_MAX                                                           = 0x15ff
  16488 	URLACTION_SCRIPT_MIN                                                           = 0x1400
  16489 	URLACTION_SCRIPT_NAVIGATE                                                      = 0x140A
  16490 	URLACTION_SCRIPT_OVERRIDE_SAFETY                                               = 0x1401
  16491 	URLACTION_SCRIPT_PASTE                                                         = 0x1407
  16492 	URLACTION_SCRIPT_RUN                                                           = 0x1400
  16493 	URLACTION_SCRIPT_SAFE_ACTIVEX                                                  = 0x1405
  16494 	URLACTION_SCRIPT_XSSFILTER                                                     = 0x1409
  16495 	URLACTION_SHELL_CURR_MAX                                                       = 0x1811
  16496 	URLACTION_SHELL_FILE_DOWNLOAD                                                  = 0x1803
  16497 	URLACTION_SHELL_INSTALL_DTITEMS                                                = 0x1800
  16498 	URLACTION_SHELL_MAX                                                            = 0x19ff
  16499 	URLACTION_SHELL_MIN                                                            = 0x1800
  16500 	URLACTION_SHELL_MOVE_OR_COPY                                                   = 0x1802
  16501 	URLACTION_SHELL_SHELLEXECUTE                                                   = 0x1806
  16502 	URLACTION_SHELL_VERB                                                           = 0x1804
  16503 	URLACTION_SHELL_WEBVIEW_VERB                                                   = 0x1805
  16504 	URLMON_OPTION_URL_ENCODING                                                     = 0x10000004
  16505 	URLMON_OPTION_USERAGENT                                                        = 0x10000001
  16506 	URLMON_OPTION_USERAGENT_REFRESH                                                = 0x10000002
  16507 	URLOSTRM_GETNEWESTVERSION                                                      = 0x3
  16508 	URLOSTRM_USECACHEDCOPY                                                         = 0x2
  16509 	URLOSTRM_USECACHEDCOPY_ONLY                                                    = 0x1
  16510 	URLPOLICY_ACTIVEX_CHECK_LIST                                                   = 0x10000
  16511 	URLPOLICY_ALLOW                                                                = 0x0
  16512 	URLPOLICY_AUTHENTICATE_CHALLENGE_RESPONSE                                      = 0x10000
  16513 	URLPOLICY_AUTHENTICATE_CLEARTEXT_OK                                            = 0x0
  16514 	URLPOLICY_AUTHENTICATE_MUTUAL_ONLY                                             = 0x30000
  16515 	URLPOLICY_CHANNEL_SOFTDIST_AUTOINSTALL                                         = 0x30000
  16516 	URLPOLICY_CHANNEL_SOFTDIST_PRECACHE                                            = 0x20000
  16517 	URLPOLICY_CHANNEL_SOFTDIST_PROHIBIT                                            = 0x10000
  16518 	URLPOLICY_CREDENTIALS_ANONYMOUS_ONLY                                           = 0x30000
  16519 	URLPOLICY_CREDENTIALS_CONDITIONAL_PROMPT                                       = 0x20000
  16520 	URLPOLICY_CREDENTIALS_MUST_PROMPT_USER                                         = 0x10000
  16521 	URLPOLICY_CREDENTIALS_SILENT_LOGON_OK                                          = 0x0
  16522 	URLPOLICY_DISALLOW                                                             = 0x3
  16523 	URLPOLICY_DONTCHECKDLGBOX                                                      = 0x100
  16524 	URLPOLICY_JAVA_CUSTOM                                                          = 0x800000
  16525 	URLPOLICY_JAVA_HIGH                                                            = 0x10000
  16526 	URLPOLICY_JAVA_LOW                                                             = 0x30000
  16527 	URLPOLICY_JAVA_MEDIUM                                                          = 0x20000
  16528 	URLPOLICY_JAVA_PROHIBIT                                                        = 0x0
  16529 	URLPOLICY_LOG_ON_ALLOW                                                         = 0x40
  16530 	URLPOLICY_LOG_ON_DISALLOW                                                      = 0x80
  16531 	URLPOLICY_MASK_PERMISSIONS                                                     = 0x0f
  16532 	URLPOLICY_NOTIFY_ON_ALLOW                                                      = 0x10
  16533 	URLPOLICY_NOTIFY_ON_DISALLOW                                                   = 0x20
  16534 	URLPOLICY_QUERY                                                                = 0x1
  16535 	URLZONE_ESC_FLAG                                                               = 0x100
  16536 	URL_MK_LEGACY                                                                  = 0
  16537 	URL_MK_NO_CANONICALIZE                                                         = 2
  16538 	URL_MK_UNIFORM                                                                 = 1
  16539 	URL_OID_GET_OBJECT_URL_FUNC                                                    = "UrlDllGetObjectUrl"
  16540 	USAGE_MATCH_TYPE_AND                                                           = 0x0
  16541 	USAGE_MATCH_TYPE_OR                                                            = 0x1
  16542 	USER_CALL_IS_ASYNC                                                             = 0x0100
  16543 	USER_CALL_NEW_CORRELATION_DESC                                                 = 0x0200
  16544 	USER_MARSHAL_CB_SIGNATURE                                                      = 85
  16545 	USER_MARSHAL_FC_BYTE                                                           = 1
  16546 	USER_MARSHAL_FC_CHAR                                                           = 2
  16547 	USER_MARSHAL_FC_DOUBLE                                                         = 12
  16548 	USER_MARSHAL_FC_FLOAT                                                          = 10
  16549 	USER_MARSHAL_FC_HYPER                                                          = 11
  16550 	USER_MARSHAL_FC_LONG                                                           = 8
  16551 	USER_MARSHAL_FC_SHORT                                                          = 6
  16552 	USER_MARSHAL_FC_SMALL                                                          = 3
  16553 	USER_MARSHAL_FC_ULONG                                                          = 9
  16554 	USER_MARSHAL_FC_USHORT                                                         = 7
  16555 	USER_MARSHAL_FC_USMALL                                                         = 4
  16556 	USER_MARSHAL_FC_WCHAR                                                          = 5
  16557 	USER_TIMER_MAXIMUM                                                             = 0x7FFFFFFF
  16558 	USER_TIMER_MINIMUM                                                             = 0x0000000A
  16559 	USE___UUIDOF                                                                   = 1
  16560 	USHRT_MAX                                                                      = 65535
  16561 	USN_DELETE_FLAG_DELETE                                                         = 1
  16562 	USN_DELETE_FLAG_NOTIFY                                                         = 2
  16563 	USN_DELETE_VALID_FLAGS                                                         = 3
  16564 	USN_PAGE_SIZE                                                                  = 4096
  16565 	USN_REASON_BASIC_INFO_CHANGE                                                   = 32768
  16566 	USN_REASON_CLOSE                                                               = 2147483648
  16567 	USN_REASON_COMPRESSION_CHANGE                                                  = 131072
  16568 	USN_REASON_DATA_EXTEND                                                         = 2
  16569 	USN_REASON_DATA_OVERWRITE                                                      = 1
  16570 	USN_REASON_DATA_TRUNCATION                                                     = 4
  16571 	USN_REASON_EA_CHANGE                                                           = 1024
  16572 	USN_REASON_ENCRYPTION_CHANGE                                                   = 262144
  16573 	USN_REASON_FILE_CREATE                                                         = 256
  16574 	USN_REASON_FILE_DELETE                                                         = 512
  16575 	USN_REASON_HARD_LINK_CHANGE                                                    = 65536
  16576 	USN_REASON_INDEXABLE_CHANGE                                                    = 16384
  16577 	USN_REASON_NAMED_DATA_EXTEND                                                   = 32
  16578 	USN_REASON_NAMED_DATA_OVERWRITE                                                = 16
  16579 	USN_REASON_NAMED_DATA_TRUNCATION                                               = 64
  16580 	USN_REASON_OBJECT_ID_CHANGE                                                    = 524288
  16581 	USN_REASON_RENAME_NEW_NAME                                                     = 8192
  16582 	USN_REASON_RENAME_OLD_NAME                                                     = 4096
  16583 	USN_REASON_REPARSE_POINT_CHANGE                                                = 1048576
  16584 	USN_REASON_SECURITY_CHANGE                                                     = 2048
  16585 	USN_REASON_STREAM_CHANGE                                                       = 2097152
  16586 	USN_SOURCE_AUXILIARY_DATA                                                      = 2
  16587 	USN_SOURCE_DATA_MANAGEMENT                                                     = 1
  16588 	USN_SOURCE_REPLICATION_MANAGEMENT                                              = 4
  16589 	UUID_DEFINED                                                                   = 0
  16590 	VALID_INHERIT_FLAGS                                                            = 31
  16591 	VALID_NTFT                                                                     = 0xC0
  16592 	VARCMP_EQ                                                                      = 1
  16593 	VARCMP_GT                                                                      = 2
  16594 	VARCMP_LT                                                                      = 0
  16595 	VARCMP_NULL                                                                    = 3
  16596 	VARIABLE_PITCH                                                                 = 2
  16597 	VARIANT_ALPHABOOL                                                              = 0x02
  16598 	VARIANT_CALENDAR_GREGORIAN                                                     = 0x40
  16599 	VARIANT_CALENDAR_HIJRI                                                         = 0x08
  16600 	VARIANT_CALENDAR_THAI                                                          = 0x20
  16601 	VARIANT_LOCALBOOL                                                              = 0x10
  16602 	VARIANT_NOUSEROVERRIDE                                                         = 0x04
  16603 	VARIANT_NOVALUEPROP                                                            = 0x01
  16604 	VARIANT_USE_NLS                                                                = 0x80
  16605 	VDBE_DISPLAY_P4                                                                = 1
  16606 	VDBE_HALT_STATE                                                                = 3
  16607 	VDBE_INIT_STATE                                                                = 0
  16608 	VDBE_READY_STATE                                                               = 1
  16609 	VDBE_RUN_STATE                                                                 = 2
  16610 	VENDOR_ID_LENGTH                                                               = 8
  16611 	VERTRES                                                                        = 10
  16612 	VERTSIZE                                                                       = 6
  16613 	VER_AND                                                                        = 6
  16614 	VER_BUILDNUMBER                                                                = 0x0000004
  16615 	VER_CONDITION_MASK                                                             = 7
  16616 	VER_EQUAL                                                                      = 1
  16617 	VER_GREATER                                                                    = 2
  16618 	VER_GREATER_EQUAL                                                              = 3
  16619 	VER_H                                                                          = 0
  16620 	VER_LESS                                                                       = 4
  16621 	VER_LESS_EQUAL                                                                 = 5
  16622 	VER_MAJORVERSION                                                               = 0x0000002
  16623 	VER_MINORVERSION                                                               = 0x0000001
  16624 	VER_NT_DOMAIN_CONTROLLER                                                       = 0x0000002
  16625 	VER_NT_SERVER                                                                  = 0x0000003
  16626 	VER_NT_WORKSTATION                                                             = 0x0000001
  16627 	VER_NUM_BITS_PER_CONDITION_MASK                                                = 3
  16628 	VER_OR                                                                         = 7
  16629 	VER_PLATFORMID                                                                 = 0x0000008
  16630 	VER_PLATFORM_WIN32_NT                                                          = 2
  16631 	VER_PLATFORM_WIN32_WINDOWS                                                     = 1
  16632 	VER_PLATFORM_WIN32s                                                            = 0
  16633 	VER_PRODUCT_TYPE                                                               = 0x0000080
  16634 	VER_SERVER_NT                                                                  = 0x80000000
  16635 	VER_SERVICEPACKMAJOR                                                           = 0x0000020
  16636 	VER_SERVICEPACKMINOR                                                           = 0x0000010
  16637 	VER_SUITENAME                                                                  = 0x0000040
  16638 	VER_SUITE_BACKOFFICE                                                           = 0x00000004
  16639 	VER_SUITE_BLADE                                                                = 0x00000400
  16640 	VER_SUITE_COMMUNICATIONS                                                       = 0x00000008
  16641 	VER_SUITE_COMPUTE_SERVER                                                       = 0x00004000
  16642 	VER_SUITE_DATACENTER                                                           = 0x00000080
  16643 	VER_SUITE_EMBEDDEDNT                                                           = 0x00000040
  16644 	VER_SUITE_EMBEDDED_RESTRICTED                                                  = 0x00000800
  16645 	VER_SUITE_ENTERPRISE                                                           = 0x00000002
  16646 	VER_SUITE_PERSONAL                                                             = 0x00000200
  16647 	VER_SUITE_SECURITY_APPLIANCE                                                   = 0x00001000
  16648 	VER_SUITE_SINGLEUSERTS                                                         = 0x00000100
  16649 	VER_SUITE_SMALLBUSINESS                                                        = 0x00000001
  16650 	VER_SUITE_SMALLBUSINESS_RESTRICTED                                             = 0x00000020
  16651 	VER_SUITE_STORAGE_SERVER                                                       = 0x00002000
  16652 	VER_SUITE_TERMINAL                                                             = 0x00000010
  16653 	VER_SUITE_WH_SERVER                                                            = 0x00008000
  16654 	VER_WORKSTATION_NT                                                             = 0x40000000
  16655 	VFFF_ISSHAREDFILE                                                              = 0x0001
  16656 	VFF_BUFFTOOSMALL                                                               = 0x0004
  16657 	VFF_CURNEDEST                                                                  = 0x0001
  16658 	VFF_FILEINUSE                                                                  = 0x0002
  16659 	VFT2_DRV_COMM                                                                  = 10
  16660 	VFT2_DRV_DISPLAY                                                               = 4
  16661 	VFT2_DRV_INPUTMETHOD                                                           = 11
  16662 	VFT2_DRV_INSTALLABLE                                                           = 8
  16663 	VFT2_DRV_KEYBOARD                                                              = 2
  16664 	VFT2_DRV_LANGUAGE                                                              = 3
  16665 	VFT2_DRV_MOUSE                                                                 = 5
  16666 	VFT2_DRV_NETWORK                                                               = 6
  16667 	VFT2_DRV_PRINTER                                                               = 1
  16668 	VFT2_DRV_SOUND                                                                 = 9
  16669 	VFT2_DRV_SYSTEM                                                                = 7
  16670 	VFT2_DRV_VERSIONED_PRINTER                                                     = 12
  16671 	VFT2_FONT_RASTER                                                               = 1
  16672 	VFT2_FONT_TRUETYPE                                                             = 3
  16673 	VFT2_FONT_VECTOR                                                               = 2
  16674 	VFT2_UNKNOWN                                                                   = 0
  16675 	VFT_APP                                                                        = 1
  16676 	VFT_DLL                                                                        = 2
  16677 	VFT_DRV                                                                        = 3
  16678 	VFT_FONT                                                                       = 4
  16679 	VFT_STATIC_LIB                                                                 = 7
  16680 	VFT_UNKNOWN                                                                    = 0
  16681 	VFT_VXD                                                                        = 5
  16682 	VIETNAMESE_CHARSET                                                             = 163
  16683 	VIEW_E_FIRST                                                                   = 2147746112
  16684 	VIEW_E_LAST                                                                    = 2147746127
  16685 	VIEW_S_FIRST                                                                   = 262464
  16686 	VIEW_S_LAST                                                                    = 262479
  16687 	VIFF_DONTDELETEOLD                                                             = 0x0002
  16688 	VIFF_FORCEINSTALL                                                              = 0x0001
  16689 	VIF_ACCESSVIOLATION                                                            = 512
  16690 	VIF_BUFFTOOSMALL                                                               = 262144
  16691 	VIF_CANNOTCREATE                                                               = 2048
  16692 	VIF_CANNOTDELETE                                                               = 4096
  16693 	VIF_CANNOTDELETECUR                                                            = 16384
  16694 	VIF_CANNOTLOADCABINET                                                          = 1048576
  16695 	VIF_CANNOTLOADLZ32                                                             = 524288
  16696 	VIF_CANNOTREADDST                                                              = 131072
  16697 	VIF_CANNOTREADSRC                                                              = 65536
  16698 	VIF_CANNOTRENAME                                                               = 8192
  16699 	VIF_DIFFCODEPG                                                                 = 16
  16700 	VIF_DIFFLANG                                                                   = 8
  16701 	VIF_DIFFTYPE                                                                   = 32
  16702 	VIF_FILEINUSE                                                                  = 128
  16703 	VIF_MISMATCH                                                                   = 2
  16704 	VIF_OUTOFMEMORY                                                                = 32768
  16705 	VIF_OUTOFSPACE                                                                 = 256
  16706 	VIF_SHARINGVIOLATION                                                           = 1024
  16707 	VIF_SRCOLD                                                                     = 4
  16708 	VIF_TEMPFILE                                                                   = 1
  16709 	VIF_WRITEPROT                                                                  = 64
  16710 	VK_ACCEPT                                                                      = 0x1E
  16711 	VK_ADD                                                                         = 0x6B
  16712 	VK_APPS                                                                        = 0x5D
  16713 	VK_ATTN                                                                        = 0xF6
  16714 	VK_BACK                                                                        = 0x08
  16715 	VK_BROWSER_BACK                                                                = 0xA6
  16716 	VK_BROWSER_FAVORITES                                                           = 0xAB
  16717 	VK_BROWSER_FORWARD                                                             = 0xA7
  16718 	VK_BROWSER_HOME                                                                = 0xAC
  16719 	VK_BROWSER_REFRESH                                                             = 0xA8
  16720 	VK_BROWSER_SEARCH                                                              = 0xAA
  16721 	VK_BROWSER_STOP                                                                = 0xA9
  16722 	VK_CANCEL                                                                      = 0x03
  16723 	VK_CAPITAL                                                                     = 0x14
  16724 	VK_CLEAR                                                                       = 0x0C
  16725 	VK_CONTROL                                                                     = 0x11
  16726 	VK_CONVERT                                                                     = 0x1C
  16727 	VK_CRSEL                                                                       = 0xF7
  16728 	VK_DECIMAL                                                                     = 0x6E
  16729 	VK_DELETE                                                                      = 0x2E
  16730 	VK_DIVIDE                                                                      = 0x6F
  16731 	VK_DOWN                                                                        = 0x28
  16732 	VK_END                                                                         = 0x23
  16733 	VK_EREOF                                                                       = 0xF9
  16734 	VK_ESCAPE                                                                      = 0x1B
  16735 	VK_EXECUTE                                                                     = 0x2B
  16736 	VK_EXSEL                                                                       = 0xF8
  16737 	VK_F1                                                                          = 0x70
  16738 	VK_F10                                                                         = 0x79
  16739 	VK_F11                                                                         = 0x7A
  16740 	VK_F12                                                                         = 0x7B
  16741 	VK_F13                                                                         = 0x7C
  16742 	VK_F14                                                                         = 0x7D
  16743 	VK_F15                                                                         = 0x7E
  16744 	VK_F16                                                                         = 0x7F
  16745 	VK_F17                                                                         = 0x80
  16746 	VK_F18                                                                         = 0x81
  16747 	VK_F19                                                                         = 0x82
  16748 	VK_F2                                                                          = 0x71
  16749 	VK_F20                                                                         = 0x83
  16750 	VK_F21                                                                         = 0x84
  16751 	VK_F22                                                                         = 0x85
  16752 	VK_F23                                                                         = 0x86
  16753 	VK_F24                                                                         = 0x87
  16754 	VK_F3                                                                          = 0x72
  16755 	VK_F4                                                                          = 0x73
  16756 	VK_F5                                                                          = 0x74
  16757 	VK_F6                                                                          = 0x75
  16758 	VK_F7                                                                          = 0x76
  16759 	VK_F8                                                                          = 0x77
  16760 	VK_F9                                                                          = 0x78
  16761 	VK_FINAL                                                                       = 0x18
  16762 	VK_HANGEUL                                                                     = 0x15
  16763 	VK_HANGUL                                                                      = 0x15
  16764 	VK_HANJA                                                                       = 0x19
  16765 	VK_HELP                                                                        = 0x2F
  16766 	VK_HOME                                                                        = 0x24
  16767 	VK_ICO_00                                                                      = 0xE4
  16768 	VK_ICO_CLEAR                                                                   = 0xE6
  16769 	VK_ICO_HELP                                                                    = 0xE3
  16770 	VK_IME_OFF                                                                     = 0x1A
  16771 	VK_IME_ON                                                                      = 0x16
  16772 	VK_INSERT                                                                      = 0x2D
  16773 	VK_JUNJA                                                                       = 0x17
  16774 	VK_KANA                                                                        = 0x15
  16775 	VK_KANJI                                                                       = 0x19
  16776 	VK_LAUNCH_APP1                                                                 = 0xB6
  16777 	VK_LAUNCH_APP2                                                                 = 0xB7
  16778 	VK_LAUNCH_MAIL                                                                 = 0xB4
  16779 	VK_LAUNCH_MEDIA_SELECT                                                         = 0xB5
  16780 	VK_LBUTTON                                                                     = 0x01
  16781 	VK_LCONTROL                                                                    = 0xA2
  16782 	VK_LEFT                                                                        = 0x25
  16783 	VK_LMENU                                                                       = 0xA4
  16784 	VK_LSHIFT                                                                      = 0xA0
  16785 	VK_LWIN                                                                        = 0x5B
  16786 	VK_MBUTTON                                                                     = 0x04
  16787 	VK_MEDIA_NEXT_TRACK                                                            = 0xB0
  16788 	VK_MEDIA_PLAY_PAUSE                                                            = 0xB3
  16789 	VK_MEDIA_PREV_TRACK                                                            = 0xB1
  16790 	VK_MEDIA_STOP                                                                  = 0xB2
  16791 	VK_MENU                                                                        = 0x12
  16792 	VK_MODECHANGE                                                                  = 0x1F
  16793 	VK_MULTIPLY                                                                    = 0x6A
  16794 	VK_NEXT                                                                        = 0x22
  16795 	VK_NONAME                                                                      = 0xFC
  16796 	VK_NONCONVERT                                                                  = 0x1D
  16797 	VK_NUMLOCK                                                                     = 0x90
  16798 	VK_NUMPAD0                                                                     = 0x60
  16799 	VK_NUMPAD1                                                                     = 0x61
  16800 	VK_NUMPAD2                                                                     = 0x62
  16801 	VK_NUMPAD3                                                                     = 0x63
  16802 	VK_NUMPAD4                                                                     = 0x64
  16803 	VK_NUMPAD5                                                                     = 0x65
  16804 	VK_NUMPAD6                                                                     = 0x66
  16805 	VK_NUMPAD7                                                                     = 0x67
  16806 	VK_NUMPAD8                                                                     = 0x68
  16807 	VK_NUMPAD9                                                                     = 0x69
  16808 	VK_OEM_1                                                                       = 0xBA
  16809 	VK_OEM_102                                                                     = 0xE2
  16810 	VK_OEM_2                                                                       = 0xBF
  16811 	VK_OEM_3                                                                       = 0xC0
  16812 	VK_OEM_4                                                                       = 0xDB
  16813 	VK_OEM_5                                                                       = 0xDC
  16814 	VK_OEM_6                                                                       = 0xDD
  16815 	VK_OEM_7                                                                       = 0xDE
  16816 	VK_OEM_8                                                                       = 0xDF
  16817 	VK_OEM_ATTN                                                                    = 0xF0
  16818 	VK_OEM_AUTO                                                                    = 0xF3
  16819 	VK_OEM_AX                                                                      = 0xE1
  16820 	VK_OEM_BACKTAB                                                                 = 0xF5
  16821 	VK_OEM_CLEAR                                                                   = 0xFE
  16822 	VK_OEM_COMMA                                                                   = 0xBC
  16823 	VK_OEM_COPY                                                                    = 0xF2
  16824 	VK_OEM_CUSEL                                                                   = 0xEF
  16825 	VK_OEM_ENLW                                                                    = 0xF4
  16826 	VK_OEM_FINISH                                                                  = 0xF1
  16827 	VK_OEM_FJ_JISHO                                                                = 0x92
  16828 	VK_OEM_FJ_LOYA                                                                 = 0x95
  16829 	VK_OEM_FJ_MASSHOU                                                              = 0x93
  16830 	VK_OEM_FJ_ROYA                                                                 = 0x96
  16831 	VK_OEM_FJ_TOUROKU                                                              = 0x94
  16832 	VK_OEM_JUMP                                                                    = 0xEA
  16833 	VK_OEM_MINUS                                                                   = 0xBD
  16834 	VK_OEM_NEC_EQUAL                                                               = 0x92
  16835 	VK_OEM_PA1                                                                     = 0xEB
  16836 	VK_OEM_PA2                                                                     = 0xEC
  16837 	VK_OEM_PA3                                                                     = 0xED
  16838 	VK_OEM_PERIOD                                                                  = 0xBE
  16839 	VK_OEM_PLUS                                                                    = 0xBB
  16840 	VK_OEM_RESET                                                                   = 0xE9
  16841 	VK_OEM_WSCTRL                                                                  = 0xEE
  16842 	VK_PA1                                                                         = 0xFD
  16843 	VK_PACKET                                                                      = 0xE7
  16844 	VK_PAUSE                                                                       = 0x13
  16845 	VK_PLAY                                                                        = 0xFA
  16846 	VK_PRINT                                                                       = 0x2A
  16847 	VK_PRIOR                                                                       = 0x21
  16848 	VK_PROCESSKEY                                                                  = 0xE5
  16849 	VK_RBUTTON                                                                     = 0x02
  16850 	VK_RCONTROL                                                                    = 0xA3
  16851 	VK_RETURN                                                                      = 0x0D
  16852 	VK_RIGHT                                                                       = 0x27
  16853 	VK_RMENU                                                                       = 0xA5
  16854 	VK_RSHIFT                                                                      = 0xA1
  16855 	VK_RWIN                                                                        = 0x5C
  16856 	VK_SCROLL                                                                      = 0x91
  16857 	VK_SELECT                                                                      = 0x29
  16858 	VK_SEPARATOR                                                                   = 0x6C
  16859 	VK_SHIFT                                                                       = 0x10
  16860 	VK_SLEEP                                                                       = 0x5F
  16861 	VK_SNAPSHOT                                                                    = 0x2C
  16862 	VK_SPACE                                                                       = 0x20
  16863 	VK_SUBTRACT                                                                    = 0x6D
  16864 	VK_TAB                                                                         = 0x09
  16865 	VK_UP                                                                          = 0x26
  16866 	VK_VOLUME_DOWN                                                                 = 0xAE
  16867 	VK_VOLUME_MUTE                                                                 = 0xAD
  16868 	VK_VOLUME_UP                                                                   = 0xAF
  16869 	VK_XBUTTON1                                                                    = 0x05
  16870 	VK_XBUTTON2                                                                    = 0x06
  16871 	VK_ZOOM                                                                        = 0xFB
  16872 	VOLUME_IS_DIRTY                                                                = 1
  16873 	VOLUME_NAME_DOS                                                                = 0x0
  16874 	VOLUME_NAME_GUID                                                               = 0x1
  16875 	VOLUME_NAME_NONE                                                               = 0x4
  16876 	VOLUME_NAME_NT                                                                 = 0x2
  16877 	VOLUME_UPGRADE_SCHEDULED                                                       = 2
  16878 	VOS_DOS                                                                        = 65536
  16879 	VOS_DOS_WINDOWS16                                                              = 65537
  16880 	VOS_DOS_WINDOWS32                                                              = 65540
  16881 	VOS_NT                                                                         = 262144
  16882 	VOS_NT_WINDOWS32                                                               = 262148
  16883 	VOS_OS216                                                                      = 131072
  16884 	VOS_OS216_PM16                                                                 = 131074
  16885 	VOS_OS232                                                                      = 196608
  16886 	VOS_OS232_PM32                                                                 = 196611
  16887 	VOS_UNKNOWN                                                                    = 0
  16888 	VOS_WINCE                                                                      = 327680
  16889 	VOS__BASE                                                                      = 0
  16890 	VOS__PM16                                                                      = 2
  16891 	VOS__PM32                                                                      = 3
  16892 	VOS__WINDOWS16                                                                 = 1
  16893 	VOS__WINDOWS32                                                                 = 4
  16894 	VP_COMMAND_GET                                                                 = 0x0001
  16895 	VP_COMMAND_SET                                                                 = 0x0002
  16896 	VP_CP_CMD_ACTIVATE                                                             = 0x0001
  16897 	VP_CP_CMD_CHANGE                                                               = 0x0004
  16898 	VP_CP_CMD_DEACTIVATE                                                           = 0x0002
  16899 	VP_CP_TYPE_APS_TRIGGER                                                         = 0x0001
  16900 	VP_CP_TYPE_MACROVISION                                                         = 0x0002
  16901 	VP_FLAGS_BRIGHTNESS                                                            = 0x0040
  16902 	VP_FLAGS_CONTRAST                                                              = 0x0080
  16903 	VP_FLAGS_COPYPROTECT                                                           = 0x0100
  16904 	VP_FLAGS_FLICKER                                                               = 0x0004
  16905 	VP_FLAGS_MAX_UNSCALED                                                          = 0x0010
  16906 	VP_FLAGS_OVERSCAN                                                              = 0x0008
  16907 	VP_FLAGS_POSITION                                                              = 0x0020
  16908 	VP_FLAGS_TV_MODE                                                               = 0x0001
  16909 	VP_FLAGS_TV_STANDARD                                                           = 0x0002
  16910 	VP_MODE_TV_PLAYBACK                                                            = 0x0002
  16911 	VP_MODE_WIN_GRAPHICS                                                           = 0x0001
  16912 	VP_TV_STANDARD_NTSC_433                                                        = 0x00010000
  16913 	VP_TV_STANDARD_NTSC_M                                                          = 0x0001
  16914 	VP_TV_STANDARD_NTSC_M_J                                                        = 0x0002
  16915 	VP_TV_STANDARD_PAL_60                                                          = 0x00040000
  16916 	VP_TV_STANDARD_PAL_B                                                           = 0x0004
  16917 	VP_TV_STANDARD_PAL_D                                                           = 0x0008
  16918 	VP_TV_STANDARD_PAL_G                                                           = 0x00020000
  16919 	VP_TV_STANDARD_PAL_H                                                           = 0x0010
  16920 	VP_TV_STANDARD_PAL_I                                                           = 0x0020
  16921 	VP_TV_STANDARD_PAL_M                                                           = 0x0040
  16922 	VP_TV_STANDARD_PAL_N                                                           = 0x0080
  16923 	VP_TV_STANDARD_SECAM_B                                                         = 0x0100
  16924 	VP_TV_STANDARD_SECAM_D                                                         = 0x0200
  16925 	VP_TV_STANDARD_SECAM_G                                                         = 0x0400
  16926 	VP_TV_STANDARD_SECAM_H                                                         = 0x0800
  16927 	VP_TV_STANDARD_SECAM_K                                                         = 0x1000
  16928 	VP_TV_STANDARD_SECAM_K1                                                        = 0x2000
  16929 	VP_TV_STANDARD_SECAM_L                                                         = 0x4000
  16930 	VP_TV_STANDARD_SECAM_L1                                                        = 0x00080000
  16931 	VP_TV_STANDARD_WIN_VGA                                                         = 0x8000
  16932 	VREFRESH                                                                       = 116
  16933 	VS_FFI_FILEFLAGSMASK                                                           = 63
  16934 	VS_FFI_SIGNATURE                                                               = 4277077181
  16935 	VS_FFI_STRUCVERSION                                                            = 65536
  16936 	VS_FF_DEBUG                                                                    = 1
  16937 	VS_FF_INFOINFERRED                                                             = 16
  16938 	VS_FF_PATCHED                                                                  = 4
  16939 	VS_FF_PRERELEASE                                                               = 2
  16940 	VS_FF_PRIVATEBUILD                                                             = 8
  16941 	VS_FF_SPECIALBUILD                                                             = 32
  16942 	VS_USER_DEFINED                                                                = 100
  16943 	VS_VERSION_INFO                                                                = 1
  16944 	VTA_BASELINE                                                                   = 24
  16945 	VTA_BOTTOM                                                                     = 2
  16946 	VTA_CENTER                                                                     = 6
  16947 	VTA_LEFT                                                                       = 8
  16948 	VTA_RIGHT                                                                      = 0
  16949 	VTA_TOP                                                                        = 0
  16950 	VTDATEGRE_MAX                                                                  = 2958465
  16951 	VTDATEGRE_MIN                                                                  = -657434
  16952 	WAIT_CHILD                                                                     = 0
  16953 	WAIT_GRANDCHILD                                                                = 1
  16954 	WAIT_TIMEOUT                                                                   = 258
  16955 	WALINDEX_MAX_VERSION                                                           = 3007000
  16956 	WAL_ALL_BUT_WRITE                                                              = 1
  16957 	WAL_CKPT_LOCK                                                                  = 1
  16958 	WAL_EXCLUSIVE_MODE                                                             = 1
  16959 	WAL_FRAME_HDRSIZE                                                              = 24
  16960 	WAL_HDRSIZE                                                                    = 32
  16961 	WAL_HEAPMEMORY_MODE                                                            = 2
  16962 	WAL_LOCK_CKPT                                                                  = 1
  16963 	WAL_LOCK_READ0                                                                 = 3
  16964 	WAL_LOCK_WRITE                                                                 = 0
  16965 	WAL_MAGIC                                                                      = 0x377f0682
  16966 	WAL_MAX_VERSION                                                                = 3007000
  16967 	WAL_NORMAL_MODE                                                                = 0
  16968 	WAL_NREADER                                                                    = 5
  16969 	WAL_RDONLY                                                                     = 1
  16970 	WAL_RDWR                                                                       = 0
  16971 	WAL_RECOVER_LOCK                                                               = 2
  16972 	WAL_RETRY                                                                      = -1
  16973 	WAL_SAVEPOINT_NDATA                                                            = 4
  16974 	WAL_SHM_RDONLY                                                                 = 2
  16975 	WAL_WRITE_LOCK                                                                 = 0
  16976 	WARNING_IPSEC_MM_POLICY_PRUNED                                                 = 13024
  16977 	WARNING_IPSEC_QM_POLICY_PRUNED                                                 = 13025
  16978 	WAVECAPS_LRVOLUME                                                              = 0x0008
  16979 	WAVECAPS_PITCH                                                                 = 0x0001
  16980 	WAVECAPS_PLAYBACKRATE                                                          = 0x0002
  16981 	WAVECAPS_SAMPLEACCURATE                                                        = 0x0020
  16982 	WAVECAPS_SYNC                                                                  = 0x0010
  16983 	WAVECAPS_VOLUME                                                                = 0x0004
  16984 	WAVERR_BADFORMAT                                                               = 32
  16985 	WAVERR_BASE                                                                    = 32
  16986 	WAVERR_LASTERROR                                                               = 35
  16987 	WAVERR_STILLPLAYING                                                            = 33
  16988 	WAVERR_SYNC                                                                    = 35
  16989 	WAVERR_UNPREPARED                                                              = 34
  16990 	WAVE_ALLOWSYNC                                                                 = 0x0002
  16991 	WAVE_FORMAT_1M08                                                               = 0x00000001
  16992 	WAVE_FORMAT_1M16                                                               = 0x00000004
  16993 	WAVE_FORMAT_1S08                                                               = 0x00000002
  16994 	WAVE_FORMAT_1S16                                                               = 0x00000008
  16995 	WAVE_FORMAT_2M08                                                               = 0x00000010
  16996 	WAVE_FORMAT_2M16                                                               = 0x00000040
  16997 	WAVE_FORMAT_2S08                                                               = 0x00000020
  16998 	WAVE_FORMAT_2S16                                                               = 0x00000080
  16999 	WAVE_FORMAT_44M08                                                              = 0x00000100
  17000 	WAVE_FORMAT_44M16                                                              = 0x00000400
  17001 	WAVE_FORMAT_44S08                                                              = 0x00000200
  17002 	WAVE_FORMAT_44S16                                                              = 0x00000800
  17003 	WAVE_FORMAT_48M08                                                              = 0x00001000
  17004 	WAVE_FORMAT_48M16                                                              = 0x00004000
  17005 	WAVE_FORMAT_48S08                                                              = 0x00002000
  17006 	WAVE_FORMAT_48S16                                                              = 0x00008000
  17007 	WAVE_FORMAT_4M08                                                               = 0x00000100
  17008 	WAVE_FORMAT_4M16                                                               = 0x00000400
  17009 	WAVE_FORMAT_4S08                                                               = 0x00000200
  17010 	WAVE_FORMAT_4S16                                                               = 0x00000800
  17011 	WAVE_FORMAT_96M08                                                              = 0x00010000
  17012 	WAVE_FORMAT_96M16                                                              = 0x00040000
  17013 	WAVE_FORMAT_96S08                                                              = 0x00020000
  17014 	WAVE_FORMAT_96S16                                                              = 0x00080000
  17015 	WAVE_FORMAT_DIRECT                                                             = 0x0008
  17016 	WAVE_FORMAT_DIRECT_QUERY                                                       = 9
  17017 	WAVE_FORMAT_PCM                                                                = 1
  17018 	WAVE_FORMAT_QUERY                                                              = 0x0001
  17019 	WAVE_INVALIDFORMAT                                                             = 0x00000000
  17020 	WAVE_MAPPED                                                                    = 0x0004
  17021 	WA_ACTIVE                                                                      = 1
  17022 	WA_CLICKACTIVE                                                                 = 2
  17023 	WA_INACTIVE                                                                    = 0
  17024 	WB_ISDELIMITER                                                                 = 2
  17025 	WB_LEFT                                                                        = 0
  17026 	WB_RIGHT                                                                       = 1
  17027 	WC_COMPOSITECHECK                                                              = 0x00000200
  17028 	WC_DEFAULTCHAR                                                                 = 0x00000040
  17029 	WC_DISCARDNS                                                                   = 0x00000010
  17030 	WC_NO_BEST_FIT_CHARS                                                           = 0x00000400
  17031 	WC_SEPCHARS                                                                    = 0x00000020
  17032 	WDK_NTDDI_VERSION                                                              = 167772170
  17033 	WDT_INPROC64_CALL                                                              = 1349805143
  17034 	WDT_INPROC_CALL                                                                = 1215587415
  17035 	WDT_REMOTE_CALL                                                                = 1383359575
  17036 	WGL_FONT_LINES                                                                 = 0
  17037 	WGL_FONT_POLYGONS                                                              = 1
  17038 	WGL_SWAPMULTIPLE_MAX                                                           = 16
  17039 	WGL_SWAP_MAIN_PLANE                                                            = 0x00000001
  17040 	WGL_SWAP_OVERLAY1                                                              = 0x00000002
  17041 	WGL_SWAP_OVERLAY10                                                             = 0x00000400
  17042 	WGL_SWAP_OVERLAY11                                                             = 0x00000800
  17043 	WGL_SWAP_OVERLAY12                                                             = 0x00001000
  17044 	WGL_SWAP_OVERLAY13                                                             = 0x00002000
  17045 	WGL_SWAP_OVERLAY14                                                             = 0x00004000
  17046 	WGL_SWAP_OVERLAY15                                                             = 0x00008000
  17047 	WGL_SWAP_OVERLAY2                                                              = 0x00000004
  17048 	WGL_SWAP_OVERLAY3                                                              = 0x00000008
  17049 	WGL_SWAP_OVERLAY4                                                              = 0x00000010
  17050 	WGL_SWAP_OVERLAY5                                                              = 0x00000020
  17051 	WGL_SWAP_OVERLAY6                                                              = 0x00000040
  17052 	WGL_SWAP_OVERLAY7                                                              = 0x00000080
  17053 	WGL_SWAP_OVERLAY8                                                              = 0x00000100
  17054 	WGL_SWAP_OVERLAY9                                                              = 0x00000200
  17055 	WGL_SWAP_UNDERLAY1                                                             = 0x00010000
  17056 	WGL_SWAP_UNDERLAY10                                                            = 0x02000000
  17057 	WGL_SWAP_UNDERLAY11                                                            = 0x04000000
  17058 	WGL_SWAP_UNDERLAY12                                                            = 0x08000000
  17059 	WGL_SWAP_UNDERLAY13                                                            = 0x10000000
  17060 	WGL_SWAP_UNDERLAY14                                                            = 0x20000000
  17061 	WGL_SWAP_UNDERLAY15                                                            = 0x40000000
  17062 	WGL_SWAP_UNDERLAY2                                                             = 0x00020000
  17063 	WGL_SWAP_UNDERLAY3                                                             = 0x00040000
  17064 	WGL_SWAP_UNDERLAY4                                                             = 0x00080000
  17065 	WGL_SWAP_UNDERLAY5                                                             = 0x00100000
  17066 	WGL_SWAP_UNDERLAY6                                                             = 0x00200000
  17067 	WGL_SWAP_UNDERLAY7                                                             = 0x00400000
  17068 	WGL_SWAP_UNDERLAY8                                                             = 0x00800000
  17069 	WGL_SWAP_UNDERLAY9                                                             = 0x01000000
  17070 	WHDR_BEGINLOOP                                                                 = 0x00000004
  17071 	WHDR_DONE                                                                      = 0x00000001
  17072 	WHDR_ENDLOOP                                                                   = 0x00000008
  17073 	WHDR_INQUEUE                                                                   = 0x00000010
  17074 	WHDR_PREPARED                                                                  = 0x00000002
  17075 	WHEEL_DELTA                                                                    = 120
  17076 	WHEEL_PAGESCROLL                                                               = 4294967295
  17077 	WHERE_AGG_DISTINCT                                                             = 0x0400
  17078 	WHERE_AUTO_INDEX                                                               = 0x00004000
  17079 	WHERE_BIGNULL_SORT                                                             = 0x00080000
  17080 	WHERE_BLOOMFILTER                                                              = 0x00400000
  17081 	WHERE_BOTH_LIMIT                                                               = 0x00000030
  17082 	WHERE_BTM_LIMIT                                                                = 0x00000020
  17083 	WHERE_COLUMN_EQ                                                                = 0x00000001
  17084 	WHERE_COLUMN_IN                                                                = 0x00000004
  17085 	WHERE_COLUMN_NULL                                                              = 0x00000008
  17086 	WHERE_COLUMN_RANGE                                                             = 0x00000002
  17087 	WHERE_CONSTRAINT                                                               = 0x0000000f
  17088 	WHERE_DISTINCTBY                                                               = 0x0080
  17089 	WHERE_DISTINCT_NOOP                                                            = 0
  17090 	WHERE_DISTINCT_ORDERED                                                         = 2
  17091 	WHERE_DISTINCT_UNIQUE                                                          = 1
  17092 	WHERE_DISTINCT_UNORDERED                                                       = 3
  17093 	WHERE_DUPLICATES_OK                                                            = 0x0010
  17094 	WHERE_EXPRIDX                                                                  = 0x04000000
  17095 	WHERE_GROUPBY                                                                  = 0x0040
  17096 	WHERE_IDX_ONLY                                                                 = 0x00000040
  17097 	WHERE_INDEXED                                                                  = 0x00000200
  17098 	WHERE_IN_ABLE                                                                  = 0x00000800
  17099 	WHERE_IN_EARLYOUT                                                              = 0x00040000
  17100 	WHERE_IN_SEEKSCAN                                                              = 0x00100000
  17101 	WHERE_IPK                                                                      = 0x00000100
  17102 	WHERE_MULTI_OR                                                                 = 0x00002000
  17103 	WHERE_OMIT_OFFSET                                                              = 0x01000000
  17104 	WHERE_ONEPASS_DESIRED                                                          = 0x0004
  17105 	WHERE_ONEPASS_MULTIROW                                                         = 0x0008
  17106 	WHERE_ONEROW                                                                   = 0x00001000
  17107 	WHERE_ORDERBY_LIMIT                                                            = 0x0800
  17108 	WHERE_ORDERBY_MAX                                                              = 0x0002
  17109 	WHERE_ORDERBY_MIN                                                              = 0x0001
  17110 	WHERE_ORDERBY_NORMAL                                                           = 0x0000
  17111 	WHERE_OR_SUBCLAUSE                                                             = 0x0020
  17112 	WHERE_PARTIALIDX                                                               = 0x00020000
  17113 	WHERE_RIGHT_JOIN                                                               = 0x1000
  17114 	WHERE_SELFCULL                                                                 = 0x00800000
  17115 	WHERE_SKIPSCAN                                                                 = 0x00008000
  17116 	WHERE_SORTBYGROUP                                                              = 0x0200
  17117 	WHERE_TOP_LIMIT                                                                = 0x00000010
  17118 	WHERE_TRANSCONS                                                                = 0x00200000
  17119 	WHERE_UNQ_WANTED                                                               = 0x00010000
  17120 	WHERE_USE_LIMIT                                                                = 0x4000
  17121 	WHERE_VIEWSCAN                                                                 = 0x02000000
  17122 	WHERE_VIRTUALTABLE                                                             = 0x00000400
  17123 	WHERE_WANT_DISTINCT                                                            = 0x0100
  17124 	WHITEONBLACK                                                                   = 2
  17125 	WHITE_BRUSH                                                                    = 0
  17126 	WHITE_PEN                                                                      = 6
  17127 	WH_CALLWNDPROC                                                                 = 4
  17128 	WH_CALLWNDPROCRET                                                              = 12
  17129 	WH_CBT                                                                         = 5
  17130 	WH_DEBUG                                                                       = 9
  17131 	WH_FOREGROUNDIDLE                                                              = 11
  17132 	WH_GETMESSAGE                                                                  = 3
  17133 	WH_HARDWARE                                                                    = 8
  17134 	WH_JOURNALPLAYBACK                                                             = 1
  17135 	WH_JOURNALRECORD                                                               = 0
  17136 	WH_KEYBOARD                                                                    = 2
  17137 	WH_KEYBOARD_LL                                                                 = 13
  17138 	WH_MAX                                                                         = 14
  17139 	WH_MAXHOOK                                                                     = 14
  17140 	WH_MIN                                                                         = -1
  17141 	WH_MINHOOK                                                                     = -1
  17142 	WH_MOUSE                                                                       = 7
  17143 	WH_MOUSE_LL                                                                    = 14
  17144 	WH_MSGFILTER                                                                   = -1
  17145 	WH_SHELL                                                                       = 10
  17146 	WH_SYSMSGFILTER                                                                = 6
  17147 	WIM_CLOSE                                                                      = 959
  17148 	WIM_DATA                                                                       = 960
  17149 	WIM_OPEN                                                                       = 958
  17150 	WIN32                                                                          = 1
  17151 	WIN64                                                                          = 1
  17152 	WINAPI                                                                         = 0
  17153 	WINAPI_FAMILY                                                                  = 3
  17154 	WINAPI_FAMILY_APP                                                              = 2
  17155 	WINAPI_FAMILY_DESKTOP_APP                                                      = 3
  17156 	WINAPI_INLINE                                                                  = 0
  17157 	WINAPI_PARTITION_APP                                                           = 0x2
  17158 	WINAPI_PARTITION_DESKTOP                                                       = 0x1
  17159 	WINCRYPT_DWORD_CPP_ONLY                                                        = 0
  17160 	WINDING                                                                        = 2
  17161 	WINDOW_AGGINVERSE                                                              = 2
  17162 	WINDOW_AGGSTEP                                                                 = 3
  17163 	WINDOW_BUFFER_SIZE_EVENT                                                       = 0x4
  17164 	WINDOW_ENDING_INT                                                              = 1
  17165 	WINDOW_ENDING_NUM                                                              = 4
  17166 	WINDOW_NTH_VALUE_INT                                                           = 2
  17167 	WINDOW_RETURN_ROW                                                              = 1
  17168 	WINDOW_STARTING_INT                                                            = 0
  17169 	WINDOW_STARTING_NUM                                                            = 3
  17170 	WINEVENT_INCONTEXT                                                             = 0x0004
  17171 	WINEVENT_OUTOFCONTEXT                                                          = 0x0000
  17172 	WINEVENT_SKIPOWNPROCESS                                                        = 0x0002
  17173 	WINEVENT_SKIPOWNTHREAD                                                         = 0x0001
  17174 	WINFILE_PERSIST_WAL                                                            = 0x04
  17175 	WINFILE_PSOW                                                                   = 0x10
  17176 	WINFILE_RDONLY                                                                 = 0x02
  17177 	WININETINFO_OPTION_LOCK_HANDLE                                                 = 65534
  17178 	WINNT                                                                          = 1
  17179 	WINPERF_LOG_DEBUG                                                              = 2
  17180 	WINPERF_LOG_NONE                                                               = 0
  17181 	WINPERF_LOG_USER                                                               = 1
  17182 	WINPERF_LOG_VERBOSE                                                            = 3
  17183 	WINPTHREAD_API                                                                 = 0
  17184 	WINSCARDAPI                                                                    = 0
  17185 	WINSHM_RDLCK                                                                   = 2
  17186 	WINSHM_UNLCK                                                                   = 1
  17187 	WINSHM_WRLCK                                                                   = 3
  17188 	WINSTA_ACCESSCLIPBOARD                                                         = 4
  17189 	WINSTA_ACCESSGLOBALATOMS                                                       = 32
  17190 	WINSTA_ALL_ACCESS                                                              = 895
  17191 	WINSTA_CREATEDESKTOP                                                           = 8
  17192 	WINSTA_ENUMDESKTOPS                                                            = 1
  17193 	WINSTA_ENUMERATE                                                               = 256
  17194 	WINSTA_EXITWINDOWS                                                             = 64
  17195 	WINSTA_READATTRIBUTES                                                          = 2
  17196 	WINSTA_READSCREEN                                                              = 512
  17197 	WINSTA_WRITEATTRIBUTES                                                         = 16
  17198 	WINVER                                                                         = 1282
  17199 	WIN_PTHREADS_TIME_H                                                            = 0
  17200 	WIN_SHM_BASE                                                                   = 120
  17201 	WIN_SHM_DMS                                                                    = 128
  17202 	WIZ_BODYCX                                                                     = 184
  17203 	WIZ_BODYX                                                                      = 92
  17204 	WIZ_CXBMP                                                                      = 80
  17205 	WIZ_CXDLG                                                                      = 276
  17206 	WIZ_CYDLG                                                                      = 140
  17207 	WMSZ_BOTTOM                                                                    = 6
  17208 	WMSZ_BOTTOMLEFT                                                                = 7
  17209 	WMSZ_BOTTOMRIGHT                                                               = 8
  17210 	WMSZ_LEFT                                                                      = 1
  17211 	WMSZ_RIGHT                                                                     = 2
  17212 	WMSZ_TOP                                                                       = 3
  17213 	WMSZ_TOPLEFT                                                                   = 4
  17214 	WMSZ_TOPRIGHT                                                                  = 5
  17215 	WM_ACTIVATE                                                                    = 0x0006
  17216 	WM_ACTIVATEAPP                                                                 = 0x001C
  17217 	WM_AFXFIRST                                                                    = 0x0360
  17218 	WM_AFXLAST                                                                     = 0x037F
  17219 	WM_APP                                                                         = 0x8000
  17220 	WM_APPCOMMAND                                                                  = 0x0319
  17221 	WM_ASKCBFORMATNAME                                                             = 0x030C
  17222 	WM_CANCELJOURNAL                                                               = 0x004B
  17223 	WM_CANCELMODE                                                                  = 0x001F
  17224 	WM_CAPTURECHANGED                                                              = 0x0215
  17225 	WM_CHANGECBCHAIN                                                               = 0x030D
  17226 	WM_CHANGEUISTATE                                                               = 0x0127
  17227 	WM_CHAR                                                                        = 0x0102
  17228 	WM_CHARTOITEM                                                                  = 0x002F
  17229 	WM_CHILDACTIVATE                                                               = 0x0022
  17230 	WM_CHOOSEFONT_GETLOGFONT                                                       = 1025
  17231 	WM_CHOOSEFONT_SETFLAGS                                                         = 1126
  17232 	WM_CHOOSEFONT_SETLOGFONT                                                       = 1125
  17233 	WM_CLEAR                                                                       = 0x0303
  17234 	WM_CLIPBOARDUPDATE                                                             = 0x031d
  17235 	WM_CLOSE                                                                       = 0x0010
  17236 	WM_COMMAND                                                                     = 0x0111
  17237 	WM_COMMNOTIFY                                                                  = 0x0044
  17238 	WM_COMPACTING                                                                  = 0x0041
  17239 	WM_COMPAREITEM                                                                 = 0x0039
  17240 	WM_CONTEXTMENU                                                                 = 0x007B
  17241 	WM_COPY                                                                        = 0x0301
  17242 	WM_COPYDATA                                                                    = 0x004A
  17243 	WM_CREATE                                                                      = 0x0001
  17244 	WM_CTLCOLORBTN                                                                 = 0x0135
  17245 	WM_CTLCOLORDLG                                                                 = 0x0136
  17246 	WM_CTLCOLOREDIT                                                                = 0x0133
  17247 	WM_CTLCOLORLISTBOX                                                             = 0x0134
  17248 	WM_CTLCOLORMSGBOX                                                              = 0x0132
  17249 	WM_CTLCOLORSCROLLBAR                                                           = 0x0137
  17250 	WM_CTLCOLORSTATIC                                                              = 0x0138
  17251 	WM_CUT                                                                         = 0x0300
  17252 	WM_DDE_ACK                                                                     = 996
  17253 	WM_DDE_ADVISE                                                                  = 994
  17254 	WM_DDE_DATA                                                                    = 997
  17255 	WM_DDE_EXECUTE                                                                 = 1000
  17256 	WM_DDE_FIRST                                                                   = 0x03E0
  17257 	WM_DDE_INITIATE                                                                = 992
  17258 	WM_DDE_LAST                                                                    = 1000
  17259 	WM_DDE_POKE                                                                    = 999
  17260 	WM_DDE_REQUEST                                                                 = 998
  17261 	WM_DDE_TERMINATE                                                               = 993
  17262 	WM_DDE_UNADVISE                                                                = 995
  17263 	WM_DEADCHAR                                                                    = 0x0103
  17264 	WM_DELETEITEM                                                                  = 0x002D
  17265 	WM_DESTROY                                                                     = 0x0002
  17266 	WM_DESTROYCLIPBOARD                                                            = 0x0307
  17267 	WM_DEVICECHANGE                                                                = 0x0219
  17268 	WM_DEVMODECHANGE                                                               = 0x001B
  17269 	WM_DISPLAYCHANGE                                                               = 0x007E
  17270 	WM_DRAWCLIPBOARD                                                               = 0x0308
  17271 	WM_DRAWITEM                                                                    = 0x002B
  17272 	WM_DROPFILES                                                                   = 0x0233
  17273 	WM_ENABLE                                                                      = 0x000A
  17274 	WM_ENDSESSION                                                                  = 0x0016
  17275 	WM_ENTERIDLE                                                                   = 0x0121
  17276 	WM_ENTERMENULOOP                                                               = 0x0211
  17277 	WM_ENTERSIZEMOVE                                                               = 0x0231
  17278 	WM_ERASEBKGND                                                                  = 0x0014
  17279 	WM_EXITMENULOOP                                                                = 0x0212
  17280 	WM_EXITSIZEMOVE                                                                = 0x0232
  17281 	WM_FONTCHANGE                                                                  = 0x001D
  17282 	WM_GETDLGCODE                                                                  = 0x0087
  17283 	WM_GETFONT                                                                     = 0x0031
  17284 	WM_GETHOTKEY                                                                   = 0x0033
  17285 	WM_GETICON                                                                     = 0x007F
  17286 	WM_GETMINMAXINFO                                                               = 0x0024
  17287 	WM_GETOBJECT                                                                   = 0x003D
  17288 	WM_GETTEXT                                                                     = 0x000D
  17289 	WM_GETTEXTLENGTH                                                               = 0x000E
  17290 	WM_HANDHELDFIRST                                                               = 0x0358
  17291 	WM_HANDHELDLAST                                                                = 0x035F
  17292 	WM_HELP                                                                        = 0x0053
  17293 	WM_HOTKEY                                                                      = 0x0312
  17294 	WM_HSCROLL                                                                     = 0x0114
  17295 	WM_HSCROLLCLIPBOARD                                                            = 0x030E
  17296 	WM_ICONERASEBKGND                                                              = 0x0027
  17297 	WM_IME_CHAR                                                                    = 0x0286
  17298 	WM_IME_COMPOSITION                                                             = 0x010F
  17299 	WM_IME_COMPOSITIONFULL                                                         = 0x0284
  17300 	WM_IME_CONTROL                                                                 = 0x0283
  17301 	WM_IME_ENDCOMPOSITION                                                          = 0x010E
  17302 	WM_IME_KEYDOWN                                                                 = 0x0290
  17303 	WM_IME_KEYLAST                                                                 = 0x010F
  17304 	WM_IME_KEYUP                                                                   = 0x0291
  17305 	WM_IME_NOTIFY                                                                  = 0x0282
  17306 	WM_IME_REQUEST                                                                 = 0x0288
  17307 	WM_IME_SELECT                                                                  = 0x0285
  17308 	WM_IME_SETCONTEXT                                                              = 0x0281
  17309 	WM_IME_STARTCOMPOSITION                                                        = 0x010D
  17310 	WM_INITDIALOG                                                                  = 0x0110
  17311 	WM_INITMENU                                                                    = 0x0116
  17312 	WM_INITMENUPOPUP                                                               = 0x0117
  17313 	WM_INPUT                                                                       = 0x00FF
  17314 	WM_INPUTLANGCHANGE                                                             = 0x0051
  17315 	WM_INPUTLANGCHANGEREQUEST                                                      = 0x0050
  17316 	WM_INPUT_DEVICE_CHANGE                                                         = 0x00fe
  17317 	WM_KEYDOWN                                                                     = 0x0100
  17318 	WM_KEYFIRST                                                                    = 0x0100
  17319 	WM_KEYLAST                                                                     = 0x0109
  17320 	WM_KEYUP                                                                       = 0x0101
  17321 	WM_KILLFOCUS                                                                   = 0x0008
  17322 	WM_LBUTTONDBLCLK                                                               = 0x0203
  17323 	WM_LBUTTONDOWN                                                                 = 0x0201
  17324 	WM_LBUTTONUP                                                                   = 0x0202
  17325 	WM_MBUTTONDBLCLK                                                               = 0x0209
  17326 	WM_MBUTTONDOWN                                                                 = 0x0207
  17327 	WM_MBUTTONUP                                                                   = 0x0208
  17328 	WM_MDIACTIVATE                                                                 = 0x0222
  17329 	WM_MDICASCADE                                                                  = 0x0227
  17330 	WM_MDICREATE                                                                   = 0x0220
  17331 	WM_MDIDESTROY                                                                  = 0x0221
  17332 	WM_MDIGETACTIVE                                                                = 0x0229
  17333 	WM_MDIICONARRANGE                                                              = 0x0228
  17334 	WM_MDIMAXIMIZE                                                                 = 0x0225
  17335 	WM_MDINEXT                                                                     = 0x0224
  17336 	WM_MDIREFRESHMENU                                                              = 0x0234
  17337 	WM_MDIRESTORE                                                                  = 0x0223
  17338 	WM_MDISETMENU                                                                  = 0x0230
  17339 	WM_MDITILE                                                                     = 0x0226
  17340 	WM_MEASUREITEM                                                                 = 0x002C
  17341 	WM_MENUCHAR                                                                    = 0x0120
  17342 	WM_MENUCOMMAND                                                                 = 0x0126
  17343 	WM_MENUDRAG                                                                    = 0x0123
  17344 	WM_MENUGETOBJECT                                                               = 0x0124
  17345 	WM_MENURBUTTONUP                                                               = 0x0122
  17346 	WM_MENUSELECT                                                                  = 0x011F
  17347 	WM_MOUSEACTIVATE                                                               = 0x0021
  17348 	WM_MOUSEFIRST                                                                  = 0x0200
  17349 	WM_MOUSEHOVER                                                                  = 0x02A1
  17350 	WM_MOUSELAST                                                                   = 0x020d
  17351 	WM_MOUSELEAVE                                                                  = 0x02A3
  17352 	WM_MOUSEMOVE                                                                   = 0x0200
  17353 	WM_MOUSEWHEEL                                                                  = 0x020A
  17354 	WM_MOVE                                                                        = 0x0003
  17355 	WM_MOVING                                                                      = 0x0216
  17356 	WM_NCACTIVATE                                                                  = 0x0086
  17357 	WM_NCCALCSIZE                                                                  = 0x0083
  17358 	WM_NCCREATE                                                                    = 0x0081
  17359 	WM_NCDESTROY                                                                   = 0x0082
  17360 	WM_NCHITTEST                                                                   = 0x0084
  17361 	WM_NCLBUTTONDBLCLK                                                             = 0x00A3
  17362 	WM_NCLBUTTONDOWN                                                               = 0x00A1
  17363 	WM_NCLBUTTONUP                                                                 = 0x00A2
  17364 	WM_NCMBUTTONDBLCLK                                                             = 0x00A9
  17365 	WM_NCMBUTTONDOWN                                                               = 0x00A7
  17366 	WM_NCMBUTTONUP                                                                 = 0x00A8
  17367 	WM_NCMOUSEHOVER                                                                = 0x02A0
  17368 	WM_NCMOUSELEAVE                                                                = 0x02A2
  17369 	WM_NCMOUSEMOVE                                                                 = 0x00A0
  17370 	WM_NCPAINT                                                                     = 0x0085
  17371 	WM_NCRBUTTONDBLCLK                                                             = 0x00A6
  17372 	WM_NCRBUTTONDOWN                                                               = 0x00A4
  17373 	WM_NCRBUTTONUP                                                                 = 0x00A5
  17374 	WM_NCXBUTTONDBLCLK                                                             = 0x00AD
  17375 	WM_NCXBUTTONDOWN                                                               = 0x00AB
  17376 	WM_NCXBUTTONUP                                                                 = 0x00AC
  17377 	WM_NEXTDLGCTL                                                                  = 0x0028
  17378 	WM_NEXTMENU                                                                    = 0x0213
  17379 	WM_NOTIFY                                                                      = 0x004E
  17380 	WM_NOTIFYFORMAT                                                                = 0x0055
  17381 	WM_NULL                                                                        = 0x0000
  17382 	WM_PAINT                                                                       = 0x000F
  17383 	WM_PAINTCLIPBOARD                                                              = 0x0309
  17384 	WM_PAINTICON                                                                   = 0x0026
  17385 	WM_PALETTECHANGED                                                              = 0x0311
  17386 	WM_PALETTEISCHANGING                                                           = 0x0310
  17387 	WM_PARENTNOTIFY                                                                = 0x0210
  17388 	WM_PASTE                                                                       = 0x0302
  17389 	WM_PENWINFIRST                                                                 = 0x0380
  17390 	WM_PENWINLAST                                                                  = 0x038F
  17391 	WM_POWER                                                                       = 0x0048
  17392 	WM_POWERBROADCAST                                                              = 0x0218
  17393 	WM_PRINT                                                                       = 0x0317
  17394 	WM_PRINTCLIENT                                                                 = 0x0318
  17395 	WM_PSD_ENVSTAMPRECT                                                            = 1029
  17396 	WM_PSD_FULLPAGERECT                                                            = 1025
  17397 	WM_PSD_GREEKTEXTRECT                                                           = 1028
  17398 	WM_PSD_MARGINRECT                                                              = 1027
  17399 	WM_PSD_MINMARGINRECT                                                           = 1026
  17400 	WM_PSD_PAGESETUPDLG                                                            = 1024
  17401 	WM_PSD_YAFULLPAGERECT                                                          = 1030
  17402 	WM_QUERYDRAGICON                                                               = 0x0037
  17403 	WM_QUERYENDSESSION                                                             = 0x0011
  17404 	WM_QUERYNEWPALETTE                                                             = 0x030F
  17405 	WM_QUERYOPEN                                                                   = 0x0013
  17406 	WM_QUERYUISTATE                                                                = 0x0129
  17407 	WM_QUEUESYNC                                                                   = 0x0023
  17408 	WM_QUIT                                                                        = 0x0012
  17409 	WM_RBUTTONDBLCLK                                                               = 0x0206
  17410 	WM_RBUTTONDOWN                                                                 = 0x0204
  17411 	WM_RBUTTONUP                                                                   = 0x0205
  17412 	WM_RENDERALLFORMATS                                                            = 0x0306
  17413 	WM_RENDERFORMAT                                                                = 0x0305
  17414 	WM_SETCURSOR                                                                   = 0x0020
  17415 	WM_SETFOCUS                                                                    = 0x0007
  17416 	WM_SETFONT                                                                     = 0x0030
  17417 	WM_SETHOTKEY                                                                   = 0x0032
  17418 	WM_SETICON                                                                     = 0x0080
  17419 	WM_SETREDRAW                                                                   = 0x000B
  17420 	WM_SETTEXT                                                                     = 0x000C
  17421 	WM_SETTINGCHANGE                                                               = 26
  17422 	WM_SHOWWINDOW                                                                  = 0x0018
  17423 	WM_SIZE                                                                        = 0x0005
  17424 	WM_SIZECLIPBOARD                                                               = 0x030B
  17425 	WM_SIZING                                                                      = 0x0214
  17426 	WM_SPOOLERSTATUS                                                               = 0x002A
  17427 	WM_STYLECHANGED                                                                = 0x007D
  17428 	WM_STYLECHANGING                                                               = 0x007C
  17429 	WM_SYNCPAINT                                                                   = 0x0088
  17430 	WM_SYSCHAR                                                                     = 0x0106
  17431 	WM_SYSCOLORCHANGE                                                              = 0x0015
  17432 	WM_SYSCOMMAND                                                                  = 0x0112
  17433 	WM_SYSDEADCHAR                                                                 = 0x0107
  17434 	WM_SYSKEYDOWN                                                                  = 0x0104
  17435 	WM_SYSKEYUP                                                                    = 0x0105
  17436 	WM_TABLET_FIRST                                                                = 0x02c0
  17437 	WM_TABLET_LAST                                                                 = 0x02df
  17438 	WM_TCARD                                                                       = 0x0052
  17439 	WM_THEMECHANGED                                                                = 0x031A
  17440 	WM_TIMECHANGE                                                                  = 0x001E
  17441 	WM_TIMER                                                                       = 0x0113
  17442 	WM_UNDO                                                                        = 0x0304
  17443 	WM_UNICHAR                                                                     = 0x0109
  17444 	WM_UNINITMENUPOPUP                                                             = 0x0125
  17445 	WM_UPDATEUISTATE                                                               = 0x0128
  17446 	WM_USER                                                                        = 0x0400
  17447 	WM_USERCHANGED                                                                 = 0x0054
  17448 	WM_VKEYTOITEM                                                                  = 0x002E
  17449 	WM_VSCROLL                                                                     = 0x0115
  17450 	WM_VSCROLLCLIPBOARD                                                            = 0x030A
  17451 	WM_WINDOWPOSCHANGED                                                            = 0x0047
  17452 	WM_WINDOWPOSCHANGING                                                           = 0x0046
  17453 	WM_WININICHANGE                                                                = 0x001A
  17454 	WM_WTSSESSION_CHANGE                                                           = 0x02B1
  17455 	WM_XBUTTONDBLCLK                                                               = 0x020D
  17456 	WM_XBUTTONDOWN                                                                 = 0x020B
  17457 	WM_XBUTTONUP                                                                   = 0x020C
  17458 	WNCON_DYNAMIC                                                                  = 0x00000008
  17459 	WNCON_FORNETCARD                                                               = 0x00000001
  17460 	WNCON_NOTROUTED                                                                = 0x00000002
  17461 	WNCON_SLOWLINK                                                                 = 0x00000004
  17462 	WNFMT_ABBREVIATED                                                              = 0x02
  17463 	WNFMT_CONNECTION                                                               = 0x20
  17464 	WNFMT_INENUM                                                                   = 0x10
  17465 	WNFMT_MULTILINE                                                                = 0x01
  17466 	WNNC_CRED_MANAGER                                                              = 0xffff0000
  17467 	WNNC_NET_10NET                                                                 = 0x00050000
  17468 	WNNC_NET_3IN1                                                                  = 0x00270000
  17469 	WNNC_NET_9TILES                                                                = 0x00090000
  17470 	WNNC_NET_APPLETALK                                                             = 0x00130000
  17471 	WNNC_NET_AS400                                                                 = 0x000b0000
  17472 	WNNC_NET_AVID                                                                  = 0x001a0000
  17473 	WNNC_NET_AVID1                                                                 = 0x003a0000
  17474 	WNNC_NET_BMC                                                                   = 0x00180000
  17475 	WNNC_NET_BWNFS                                                                 = 0x00100000
  17476 	WNNC_NET_CLEARCASE                                                             = 0x00160000
  17477 	WNNC_NET_COGENT                                                                = 0x00110000
  17478 	WNNC_NET_CSC                                                                   = 0x00260000
  17479 	WNNC_NET_DAV                                                                   = 0x002e0000
  17480 	WNNC_NET_DCE                                                                   = 0x00190000
  17481 	WNNC_NET_DECORB                                                                = 0x00200000
  17482 	WNNC_NET_DFS                                                                   = 0x003b0000
  17483 	WNNC_NET_DISTINCT                                                              = 0x00230000
  17484 	WNNC_NET_DOCUSPACE                                                             = 0x001b0000
  17485 	WNNC_NET_DRIVEONWEB                                                            = 0x003e0000
  17486 	WNNC_NET_EXIFS                                                                 = 0x002d0000
  17487 	WNNC_NET_EXTENDNET                                                             = 0x00290000
  17488 	WNNC_NET_FARALLON                                                              = 0x00120000
  17489 	WNNC_NET_FJ_REDIR                                                              = 0x00220000
  17490 	WNNC_NET_FOXBAT                                                                = 0x002b0000
  17491 	WNNC_NET_FRONTIER                                                              = 0x00170000
  17492 	WNNC_NET_FTP_NFS                                                               = 0x000c0000
  17493 	WNNC_NET_GOOGLE                                                                = 0x00430000
  17494 	WNNC_NET_HOB_NFS                                                               = 0x00320000
  17495 	WNNC_NET_IBMAL                                                                 = 0x00340000
  17496 	WNNC_NET_INTERGRAPH                                                            = 0x00140000
  17497 	WNNC_NET_KNOWARE                                                               = 0x002f0000
  17498 	WNNC_NET_KWNP                                                                  = 0x003c0000
  17499 	WNNC_NET_LANMAN                                                                = 131072
  17500 	WNNC_NET_LANSTEP                                                               = 0x00080000
  17501 	WNNC_NET_LANTASTIC                                                             = 0x000a0000
  17502 	WNNC_NET_LIFENET                                                               = 0x000e0000
  17503 	WNNC_NET_LOCK                                                                  = 0x00350000
  17504 	WNNC_NET_LOCUS                                                                 = 0x00060000
  17505 	WNNC_NET_MANGOSOFT                                                             = 0x001c0000
  17506 	WNNC_NET_MASFAX                                                                = 0x00310000
  17507 	WNNC_NET_MFILES                                                                = 0x00410000
  17508 	WNNC_NET_MSNET                                                                 = 0x00010000
  17509 	WNNC_NET_MS_NFS                                                                = 0x00420000
  17510 	WNNC_NET_NDFS                                                                  = 0x00440000
  17511 	WNNC_NET_NETWARE                                                               = 0x00030000
  17512 	WNNC_NET_OBJECT_DIRE                                                           = 0x00300000
  17513 	WNNC_NET_OPENAFS                                                               = 0x00390000
  17514 	WNNC_NET_PATHWORKS                                                             = 0x000d0000
  17515 	WNNC_NET_POWERLAN                                                              = 0x000f0000
  17516 	WNNC_NET_PROTSTOR                                                              = 0x00210000
  17517 	WNNC_NET_QUINCY                                                                = 0x00380000
  17518 	WNNC_NET_RDR2SAMPLE                                                            = 0x00250000
  17519 	WNNC_NET_RIVERFRONT1                                                           = 0x001e0000
  17520 	WNNC_NET_RIVERFRONT2                                                           = 0x001f0000
  17521 	WNNC_NET_RSFX                                                                  = 0x00400000
  17522 	WNNC_NET_SERNET                                                                = 0x001d0000
  17523 	WNNC_NET_SHIVA                                                                 = 0x00330000
  17524 	WNNC_NET_SMB                                                                   = 0x00020000
  17525 	WNNC_NET_SRT                                                                   = 0x00370000
  17526 	WNNC_NET_STAC                                                                  = 0x002a0000
  17527 	WNNC_NET_SUN_PC_NFS                                                            = 0x00070000
  17528 	WNNC_NET_SYMFONET                                                              = 0x00150000
  17529 	WNNC_NET_TERMSRV                                                               = 0x00360000
  17530 	WNNC_NET_TWINS                                                                 = 0x00240000
  17531 	WNNC_NET_VINES                                                                 = 0x00040000
  17532 	WNNC_NET_VMWARE                                                                = 0x003f0000
  17533 	WNNC_NET_YAHOO                                                                 = 0x002c0000
  17534 	WNNC_NET_ZENWORKS                                                              = 0x003d0000
  17535 	WN_ACCESS_DENIED                                                               = 5
  17536 	WN_ALREADY_CONNECTED                                                           = 85
  17537 	WN_BAD_DEV_TYPE                                                                = 66
  17538 	WN_BAD_HANDLE                                                                  = 6
  17539 	WN_BAD_LEVEL                                                                   = 124
  17540 	WN_BAD_LOCALNAME                                                               = 1200
  17541 	WN_BAD_NETNAME                                                                 = 67
  17542 	WN_BAD_PASSWORD                                                                = 86
  17543 	WN_BAD_POINTER                                                                 = 487
  17544 	WN_BAD_PROFILE                                                                 = 1206
  17545 	WN_BAD_PROVIDER                                                                = 1204
  17546 	WN_BAD_USER                                                                    = 2202
  17547 	WN_BAD_VALUE                                                                   = 87
  17548 	WN_CANCEL                                                                      = 1223
  17549 	WN_CANNOT_OPEN_PROFILE                                                         = 1205
  17550 	WN_CONNECTED_OTHER_PASSWORD                                                    = 2108
  17551 	WN_CONNECTED_OTHER_PASSWORD_DEFAULT                                            = 2109
  17552 	WN_CONNECTION_CLOSED                                                           = 1201
  17553 	WN_DEVICE_ALREADY_REMEMBERED                                                   = 1202
  17554 	WN_DEVICE_ERROR                                                                = 31
  17555 	WN_DEVICE_IN_USE                                                               = 2404
  17556 	WN_EXTENDED_ERROR                                                              = 1208
  17557 	WN_FUNCTION_BUSY                                                               = 170
  17558 	WN_MORE_DATA                                                                   = 234
  17559 	WN_NET_ERROR                                                                   = 59
  17560 	WN_NOT_AUTHENTICATED                                                           = 1244
  17561 	WN_NOT_CONNECTED                                                               = 2250
  17562 	WN_NOT_CONTAINER                                                               = 1207
  17563 	WN_NOT_INITIALIZING                                                            = 1247
  17564 	WN_NOT_LOGGED_ON                                                               = 1245
  17565 	WN_NOT_SUPPORTED                                                               = 50
  17566 	WN_NOT_VALIDATED                                                               = 1311
  17567 	WN_NO_ERROR                                                                    = 0
  17568 	WN_NO_MORE_DEVICES                                                             = 1248
  17569 	WN_NO_MORE_ENTRIES                                                             = 259
  17570 	WN_NO_NETWORK                                                                  = 1222
  17571 	WN_NO_NET_OR_BAD_PATH                                                          = 1203
  17572 	WN_OPEN_FILES                                                                  = 2401
  17573 	WN_OUT_OF_MEMORY                                                               = 8
  17574 	WN_RETRY                                                                       = 1237
  17575 	WN_SUCCESS                                                                     = 0
  17576 	WN_WINDOWS_ERROR                                                               = 59
  17577 	WOM_CLOSE                                                                      = 956
  17578 	WOM_DONE                                                                       = 957
  17579 	WOM_OPEN                                                                       = 955
  17580 	WOW64_CONTEXT_ALL                                                              = 65599
  17581 	WOW64_CONTEXT_CONTROL                                                          = 65537
  17582 	WOW64_CONTEXT_DEBUG_REGISTERS                                                  = 65552
  17583 	WOW64_CONTEXT_EXCEPTION_ACTIVE                                                 = 0x08000000
  17584 	WOW64_CONTEXT_EXCEPTION_REPORTING                                              = 0x80000000
  17585 	WOW64_CONTEXT_EXCEPTION_REQUEST                                                = 0x40000000
  17586 	WOW64_CONTEXT_EXTENDED_REGISTERS                                               = 65568
  17587 	WOW64_CONTEXT_FLOATING_POINT                                                   = 65544
  17588 	WOW64_CONTEXT_FULL                                                             = 65543
  17589 	WOW64_CONTEXT_INTEGER                                                          = 65538
  17590 	WOW64_CONTEXT_SEGMENTS                                                         = 65540
  17591 	WOW64_CONTEXT_SERVICE_ACTIVE                                                   = 0x10000000
  17592 	WOW64_CONTEXT_XSTATE                                                           = 65600
  17593 	WOW64_CONTEXT_i386                                                             = 0x00010000
  17594 	WOW64_CONTEXT_i486                                                             = 0x00010000
  17595 	WOW64_MAXIMUM_SUPPORTED_EXTENSION                                              = 512
  17596 	WOW64_SIZE_OF_80387_REGISTERS                                                  = 80
  17597 	WO_ALL                                                                         = 0x3fff
  17598 	WO_AND                                                                         = 0x0400
  17599 	WO_AUX                                                                         = 0x0040
  17600 	WO_EQ                                                                          = 0x0002
  17601 	WO_EQUIV                                                                       = 0x0800
  17602 	WO_GE                                                                          = 32
  17603 	WO_GT                                                                          = 4
  17604 	WO_IN                                                                          = 0x0001
  17605 	WO_IS                                                                          = 0x0080
  17606 	WO_ISNULL                                                                      = 0x0100
  17607 	WO_LE                                                                          = 8
  17608 	WO_LT                                                                          = 16
  17609 	WO_NOOP                                                                        = 0x1000
  17610 	WO_OR                                                                          = 0x0200
  17611 	WO_ROWVAL                                                                      = 0x2000
  17612 	WO_SINGLE                                                                      = 0x01ff
  17613 	WPF_ASYNCWINDOWPLACEMENT                                                       = 0x0004
  17614 	WPF_RESTORETOMAXIMIZED                                                         = 0x0002
  17615 	WPF_SETMINPOSITION                                                             = 0x0001
  17616 	WRC_Abort                                                                      = 2
  17617 	WRC_Continue                                                                   = 0
  17618 	WRC_Prune                                                                      = 1
  17619 	WRITE_COMPRESSION_INFO_VALID                                                   = 0x00000010
  17620 	WRITE_DAC                                                                      = 262144
  17621 	WRITE_LOCK                                                                     = 2
  17622 	WRITE_OWNER                                                                    = 524288
  17623 	WRITE_RESTRICTED                                                               = 0x8
  17624 	WRITE_WATCH_FLAG_RESET                                                         = 0x01
  17625 	WSABASEERR                                                                     = 10000
  17626 	WSADESCRIPTION_LEN                                                             = 256
  17627 	WSAEACCES                                                                      = 10013
  17628 	WSAEADDRINUSE                                                                  = 10048
  17629 	WSAEADDRNOTAVAIL                                                               = 10049
  17630 	WSAEAFNOSUPPORT                                                                = 10047
  17631 	WSAEALREADY                                                                    = 10037
  17632 	WSAEBADF                                                                       = 10009
  17633 	WSAECANCELLED                                                                  = 10103
  17634 	WSAECONNABORTED                                                                = 10053
  17635 	WSAECONNREFUSED                                                                = 10061
  17636 	WSAECONNRESET                                                                  = 10054
  17637 	WSAEDESTADDRREQ                                                                = 10039
  17638 	WSAEDISCON                                                                     = 10101
  17639 	WSAEDQUOT                                                                      = 10069
  17640 	WSAEFAULT                                                                      = 10014
  17641 	WSAEHOSTDOWN                                                                   = 10064
  17642 	WSAEHOSTUNREACH                                                                = 10065
  17643 	WSAEINPROGRESS                                                                 = 10036
  17644 	WSAEINTR                                                                       = 10004
  17645 	WSAEINVAL                                                                      = 10022
  17646 	WSAEINVALIDPROCTABLE                                                           = 10104
  17647 	WSAEINVALIDPROVIDER                                                            = 10105
  17648 	WSAEISCONN                                                                     = 10056
  17649 	WSAELOOP                                                                       = 10062
  17650 	WSAEMFILE                                                                      = 10024
  17651 	WSAEMSGSIZE                                                                    = 10040
  17652 	WSAENAMETOOLONG                                                                = 10063
  17653 	WSAENETDOWN                                                                    = 10050
  17654 	WSAENETRESET                                                                   = 10052
  17655 	WSAENETUNREACH                                                                 = 10051
  17656 	WSAENOBUFS                                                                     = 10055
  17657 	WSAENOMORE                                                                     = 10102
  17658 	WSAENOPROTOOPT                                                                 = 10042
  17659 	WSAENOTCONN                                                                    = 10057
  17660 	WSAENOTEMPTY                                                                   = 10066
  17661 	WSAENOTSOCK                                                                    = 10038
  17662 	WSAEOPNOTSUPP                                                                  = 10045
  17663 	WSAEPFNOSUPPORT                                                                = 10046
  17664 	WSAEPROCLIM                                                                    = 10067
  17665 	WSAEPROTONOSUPPORT                                                             = 10043
  17666 	WSAEPROTOTYPE                                                                  = 10041
  17667 	WSAEPROVIDERFAILEDINIT                                                         = 10106
  17668 	WSAEREFUSED                                                                    = 10112
  17669 	WSAEREMOTE                                                                     = 10071
  17670 	WSAESHUTDOWN                                                                   = 10058
  17671 	WSAESOCKTNOSUPPORT                                                             = 10044
  17672 	WSAESTALE                                                                      = 10070
  17673 	WSAETIMEDOUT                                                                   = 10060
  17674 	WSAETOOMANYREFS                                                                = 10059
  17675 	WSAEUSERS                                                                      = 10068
  17676 	WSAEWOULDBLOCK                                                                 = 10035
  17677 	WSAHOST_NOT_FOUND                                                              = 11001
  17678 	WSANOTINITIALISED                                                              = 10093
  17679 	WSANO_ADDRESS                                                                  = 11004
  17680 	WSANO_DATA                                                                     = 11004
  17681 	WSANO_RECOVERY                                                                 = 11003
  17682 	WSASERVICE_NOT_FOUND                                                           = 10108
  17683 	WSASYSCALLFAILURE                                                              = 10107
  17684 	WSASYSNOTREADY                                                                 = 10091
  17685 	WSASYS_STATUS_LEN                                                              = 128
  17686 	WSATRY_AGAIN                                                                   = 11002
  17687 	WSATYPE_NOT_FOUND                                                              = 10109
  17688 	WSAVERNOTSUPPORTED                                                             = 10092
  17689 	WSA_E_CANCELLED                                                                = 10111
  17690 	WSA_E_NO_MORE                                                                  = 10110
  17691 	WSA_QOS_ADMISSION_FAILURE                                                      = 11010
  17692 	WSA_QOS_BAD_OBJECT                                                             = 11013
  17693 	WSA_QOS_BAD_STYLE                                                              = 11012
  17694 	WSA_QOS_EFILTERCOUNT                                                           = 11021
  17695 	WSA_QOS_EFILTERSTYLE                                                           = 11019
  17696 	WSA_QOS_EFILTERTYPE                                                            = 11020
  17697 	WSA_QOS_EFLOWCOUNT                                                             = 11023
  17698 	WSA_QOS_EFLOWDESC                                                              = 11026
  17699 	WSA_QOS_EFLOWSPEC                                                              = 11017
  17700 	WSA_QOS_EOBJLENGTH                                                             = 11022
  17701 	WSA_QOS_EPOLICYOBJ                                                             = 11025
  17702 	WSA_QOS_EPROVSPECBUF                                                           = 11018
  17703 	WSA_QOS_EPSFILTERSPEC                                                          = 11028
  17704 	WSA_QOS_EPSFLOWSPEC                                                            = 11027
  17705 	WSA_QOS_ESDMODEOBJ                                                             = 11029
  17706 	WSA_QOS_ESERVICETYPE                                                           = 11016
  17707 	WSA_QOS_ESHAPERATEOBJ                                                          = 11030
  17708 	WSA_QOS_EUNKNOWNPSOBJ                                                          = 11024
  17709 	WSA_QOS_EUNKOWNPSOBJ                                                           = 11024
  17710 	WSA_QOS_GENERIC_ERROR                                                          = 11015
  17711 	WSA_QOS_NO_RECEIVERS                                                           = 11008
  17712 	WSA_QOS_NO_SENDERS                                                             = 11007
  17713 	WSA_QOS_POLICY_FAILURE                                                         = 11011
  17714 	WSA_QOS_RECEIVERS                                                              = 11005
  17715 	WSA_QOS_REQUEST_CONFIRMED                                                      = 11009
  17716 	WSA_QOS_RESERVED_PETYPE                                                        = 11031
  17717 	WSA_QOS_SENDERS                                                                = 11006
  17718 	WSA_QOS_TRAFFIC_CTRL_ERROR                                                     = 11014
  17719 	WSF_VISIBLE                                                                    = 1
  17720 	WS_ACTIVECAPTION                                                               = 0x0001
  17721 	WS_BORDER                                                                      = 8388608
  17722 	WS_CAPTION                                                                     = 12582912
  17723 	WS_CHILD                                                                       = 1073741824
  17724 	WS_CHILDWINDOW                                                                 = 1073741824
  17725 	WS_CLIPCHILDREN                                                                = 33554432
  17726 	WS_CLIPSIBLINGS                                                                = 67108864
  17727 	WS_DISABLED                                                                    = 134217728
  17728 	WS_DLGFRAME                                                                    = 4194304
  17729 	WS_EX_ACCEPTFILES                                                              = 16
  17730 	WS_EX_APPWINDOW                                                                = 262144
  17731 	WS_EX_CLIENTEDGE                                                               = 512
  17732 	WS_EX_COMPOSITED                                                               = 33554432
  17733 	WS_EX_CONTEXTHELP                                                              = 1024
  17734 	WS_EX_CONTROLPARENT                                                            = 65536
  17735 	WS_EX_DLGMODALFRAME                                                            = 1
  17736 	WS_EX_LAYERED                                                                  = 0x00080000
  17737 	WS_EX_LAYOUTRTL                                                                = 4194304
  17738 	WS_EX_LEFT                                                                     = 0
  17739 	WS_EX_LEFTSCROLLBAR                                                            = 16384
  17740 	WS_EX_LTRREADING                                                               = 0
  17741 	WS_EX_MDICHILD                                                                 = 64
  17742 	WS_EX_NOACTIVATE                                                               = 134217728
  17743 	WS_EX_NOINHERITLAYOUT                                                          = 1048576
  17744 	WS_EX_NOPARENTNOTIFY                                                           = 4
  17745 	WS_EX_OVERLAPPEDWINDOW                                                         = 768
  17746 	WS_EX_PALETTEWINDOW                                                            = 392
  17747 	WS_EX_RIGHT                                                                    = 4096
  17748 	WS_EX_RIGHTSCROLLBAR                                                           = 0
  17749 	WS_EX_RTLREADING                                                               = 8192
  17750 	WS_EX_STATICEDGE                                                               = 131072
  17751 	WS_EX_TOOLWINDOW                                                               = 128
  17752 	WS_EX_TOPMOST                                                                  = 8
  17753 	WS_EX_TRANSPARENT                                                              = 32
  17754 	WS_EX_WINDOWEDGE                                                               = 256
  17755 	WS_GROUP                                                                       = 131072
  17756 	WS_HSCROLL                                                                     = 1048576
  17757 	WS_ICONIC                                                                      = 536870912
  17758 	WS_MAXIMIZE                                                                    = 16777216
  17759 	WS_MAXIMIZEBOX                                                                 = 65536
  17760 	WS_MINIMIZE                                                                    = 536870912
  17761 	WS_MINIMIZEBOX                                                                 = 131072
  17762 	WS_OVERLAPPED                                                                  = 0
  17763 	WS_OVERLAPPEDWINDOW                                                            = 13565952
  17764 	WS_POPUP                                                                       = 2147483648
  17765 	WS_POPUPWINDOW                                                                 = 2156396544
  17766 	WS_SIZEBOX                                                                     = 262144
  17767 	WS_SYSMENU                                                                     = 524288
  17768 	WS_TABSTOP                                                                     = 65536
  17769 	WS_THICKFRAME                                                                  = 262144
  17770 	WS_TILED                                                                       = 0
  17771 	WS_TILEDWINDOW                                                                 = 13565952
  17772 	WS_VISIBLE                                                                     = 268435456
  17773 	WS_VSCROLL                                                                     = 2097152
  17774 	WTS_CONSOLE_CONNECT                                                            = 0x1
  17775 	WTS_CONSOLE_DISCONNECT                                                         = 0x2
  17776 	WTS_REMOTE_CONNECT                                                             = 0x3
  17777 	WTS_REMOTE_DISCONNECT                                                          = 0x4
  17778 	WTS_SESSION_CREATE                                                             = 0xa
  17779 	WTS_SESSION_LOCK                                                               = 0x7
  17780 	WTS_SESSION_LOGOFF                                                             = 0x6
  17781 	WTS_SESSION_LOGON                                                              = 0x5
  17782 	WTS_SESSION_REMOTE_CONTROL                                                     = 0x9
  17783 	WTS_SESSION_TERMINATE                                                          = 0xb
  17784 	WTS_SESSION_UNLOCK                                                             = 0x8
  17785 	WT_EXECUTEDEFAULT                                                              = 0x00000000
  17786 	WT_EXECUTEDELETEWAIT                                                           = 0x00000008
  17787 	WT_EXECUTEINIOTHREAD                                                           = 0x00000001
  17788 	WT_EXECUTEINLONGTHREAD                                                         = 0x00000010
  17789 	WT_EXECUTEINPERSISTENTIOTHREAD                                                 = 0x00000040
  17790 	WT_EXECUTEINPERSISTENTTHREAD                                                   = 0x00000080
  17791 	WT_EXECUTEINTIMERTHREAD                                                        = 0x00000020
  17792 	WT_EXECUTEINUITHREAD                                                           = 0x00000002
  17793 	WT_EXECUTEINWAITTHREAD                                                         = 0x00000004
  17794 	WT_EXECUTELONGFUNCTION                                                         = 0x00000010
  17795 	WT_EXECUTEONLYONCE                                                             = 0x00000008
  17796 	WT_TRANSFER_IMPERSONATION                                                      = 0x00000100
  17797 	WVR_ALIGNBOTTOM                                                                = 0x0040
  17798 	WVR_ALIGNLEFT                                                                  = 0x0020
  17799 	WVR_ALIGNRIGHT                                                                 = 0x0080
  17800 	WVR_ALIGNTOP                                                                   = 0x0010
  17801 	WVR_HREDRAW                                                                    = 0x0100
  17802 	WVR_REDRAW                                                                     = 768
  17803 	WVR_VALIDRECTS                                                                 = 0x0400
  17804 	WVR_VREDRAW                                                                    = 0x0200
  17805 	X3_BTYPE_QP_INST_VAL_POS_X                                                     = 0
  17806 	X3_BTYPE_QP_INST_WORD_POS_X                                                    = 23
  17807 	X3_BTYPE_QP_INST_WORD_X                                                        = 2
  17808 	X3_BTYPE_QP_SIZE_X                                                             = 9
  17809 	X3_D_WH_INST_WORD_POS_X                                                        = 24
  17810 	X3_D_WH_INST_WORD_X                                                            = 3
  17811 	X3_D_WH_SIGN_VAL_POS_X                                                         = 0
  17812 	X3_D_WH_SIZE_X                                                                 = 3
  17813 	X3_EMPTY_INST_VAL_POS_X                                                        = 0
  17814 	X3_EMPTY_INST_WORD_POS_X                                                       = 14
  17815 	X3_EMPTY_INST_WORD_X                                                           = 1
  17816 	X3_EMPTY_SIZE_X                                                                = 2
  17817 	X3_IMM20_INST_WORD_POS_X                                                       = 4
  17818 	X3_IMM20_INST_WORD_X                                                           = 3
  17819 	X3_IMM20_SIGN_VAL_POS_X                                                        = 0
  17820 	X3_IMM20_SIZE_X                                                                = 20
  17821 	X3_IMM39_1_INST_WORD_POS_X                                                     = 0
  17822 	X3_IMM39_1_INST_WORD_X                                                         = 2
  17823 	X3_IMM39_1_SIGN_VAL_POS_X                                                      = 36
  17824 	X3_IMM39_1_SIZE_X                                                              = 23
  17825 	X3_IMM39_2_INST_WORD_POS_X                                                     = 16
  17826 	X3_IMM39_2_INST_WORD_X                                                         = 1
  17827 	X3_IMM39_2_SIGN_VAL_POS_X                                                      = 20
  17828 	X3_IMM39_2_SIZE_X                                                              = 16
  17829 	X3_I_INST_WORD_POS_X                                                           = 27
  17830 	X3_I_INST_WORD_X                                                               = 3
  17831 	X3_I_SIGN_VAL_POS_X                                                            = 59
  17832 	X3_I_SIZE_X                                                                    = 1
  17833 	X3_OPCODE_INST_WORD_POS_X                                                      = 28
  17834 	X3_OPCODE_INST_WORD_X                                                          = 3
  17835 	X3_OPCODE_SIGN_VAL_POS_X                                                       = 0
  17836 	X3_OPCODE_SIZE_X                                                               = 4
  17837 	X3_P_INST_WORD_POS_X                                                           = 0
  17838 	X3_P_INST_WORD_X                                                               = 3
  17839 	X3_P_SIGN_VAL_POS_X                                                            = 0
  17840 	X3_P_SIZE_X                                                                    = 4
  17841 	X3_TMPLT_INST_WORD_POS_X                                                       = 0
  17842 	X3_TMPLT_INST_WORD_X                                                           = 0
  17843 	X3_TMPLT_SIGN_VAL_POS_X                                                        = 0
  17844 	X3_TMPLT_SIZE_X                                                                = 4
  17845 	X509_ASN_ENCODING                                                              = 0x1
  17846 	X509_NDR_ENCODING                                                              = 0x2
  17847 	XACT_E_FIRST                                                                   = 0x8004D000
  17848 	XACT_E_LAST                                                                    = 0x8004D029
  17849 	XACT_S_FIRST                                                                   = 0x0004D000
  17850 	XACT_S_LAST                                                                    = 0x0004D010
  17851 	XBUTTON1                                                                       = 0x0001
  17852 	XBUTTON2                                                                       = 0x0002
  17853 	XCLASS_BOOL                                                                    = 0x1000
  17854 	XCLASS_DATA                                                                    = 0x2000
  17855 	XCLASS_FLAGS                                                                   = 0x4000
  17856 	XCLASS_MASK                                                                    = 0xFC00
  17857 	XCLASS_NOTIFICATION                                                            = 0x8000
  17858 	XN_EXPR                                                                        = -2
  17859 	XN_ROWID                                                                       = -1
  17860 	XSTATE_AVX                                                                     = 2
  17861 	XSTATE_GSSE                                                                    = 2
  17862 	XSTATE_LEGACY_FLOATING_POINT                                                   = 0
  17863 	XSTATE_LEGACY_SSE                                                              = 1
  17864 	XSTATE_MASK_AVX                                                                = 4
  17865 	XSTATE_MASK_GSSE                                                               = 4
  17866 	XSTATE_MASK_LEGACY                                                             = 3
  17867 	XSTATE_MASK_LEGACY_FLOATING_POINT                                              = 1
  17868 	XSTATE_MASK_LEGACY_SSE                                                         = 2
  17869 	XST_ADVACKRCVD                                                                 = 13
  17870 	XST_ADVDATAACKRCVD                                                             = 16
  17871 	XST_ADVDATASENT                                                                = 15
  17872 	XST_ADVSENT                                                                    = 11
  17873 	XST_CONNECTED                                                                  = 2
  17874 	XST_DATARCVD                                                                   = 6
  17875 	XST_EXECACKRCVD                                                                = 10
  17876 	XST_EXECSENT                                                                   = 9
  17877 	XST_INCOMPLETE                                                                 = 1
  17878 	XST_INIT1                                                                      = 3
  17879 	XST_INIT2                                                                      = 4
  17880 	XST_NULL                                                                       = 0
  17881 	XST_POKEACKRCVD                                                                = 8
  17882 	XST_POKESENT                                                                   = 7
  17883 	XST_REQSENT                                                                    = 5
  17884 	XST_UNADVACKRCVD                                                               = 14
  17885 	XST_UNADVSENT                                                                  = 12
  17886 	XTYPF_ACKREQ                                                                   = 0x0008
  17887 	XTYPF_NOBLOCK                                                                  = 0x0002
  17888 	XTYPF_NODATA                                                                   = 0x0004
  17889 	XTYP_ADVDATA                                                                   = 16400
  17890 	XTYP_ADVREQ                                                                    = 8226
  17891 	XTYP_ADVSTART                                                                  = 4144
  17892 	XTYP_ADVSTOP                                                                   = 32832
  17893 	XTYP_CONNECT                                                                   = 4194
  17894 	XTYP_CONNECT_CONFIRM                                                           = 32882
  17895 	XTYP_DISCONNECT                                                                = 32962
  17896 	XTYP_ERROR                                                                     = 32770
  17897 	XTYP_EXECUTE                                                                   = 16464
  17898 	XTYP_MASK                                                                      = 0x00F0
  17899 	XTYP_MONITOR                                                                   = 33010
  17900 	XTYP_POKE                                                                      = 16528
  17901 	XTYP_REGISTER                                                                  = 32930
  17902 	XTYP_REQUEST                                                                   = 8368
  17903 	XTYP_SHIFT                                                                     = 4
  17904 	XTYP_UNREGISTER                                                                = 32978
  17905 	XTYP_WILDCONNECT                                                               = 8418
  17906 	XTYP_XACT_COMPLETE                                                             = 32896
  17907 	YYFALLBACK                                                                     = 1
  17908 	YYNOCODE                                                                       = 319
  17909 	YYNOERRORRECOVERY                                                              = 1
  17910 	YYNRULE                                                                        = 405
  17911 	YYNRULE_WITH_ACTION                                                            = 342
  17912 	YYNSTATE                                                                       = 576
  17913 	YYNTOKEN                                                                       = 185
  17914 	YYPARSEFREENEVERNULL                                                           = 1
  17915 	YYSTACKDEPTH                                                                   = 100
  17916 	YYWILDCARD                                                                     = 101
  17917 	YY_ACCEPT_ACTION                                                               = 1241
  17918 	YY_ACTTAB_COUNT                                                                = 2098
  17919 	YY_ERROR_ACTION                                                                = 1240
  17920 	YY_MAX_REDUCE                                                                  = 1647
  17921 	YY_MAX_SHIFT                                                                   = 575
  17922 	YY_MAX_SHIFTREDUCE                                                             = 1239
  17923 	YY_MIN_REDUCE                                                                  = 1243
  17924 	YY_MIN_SHIFTREDUCE                                                             = 835
  17925 	YY_NO_ACTION                                                                   = 1242
  17926 	YY_REDUCE_COUNT                                                                = 408
  17927 	YY_REDUCE_MAX                                                                  = 1740
  17928 	YY_REDUCE_MIN                                                                  = -271
  17929 	YY_SHIFT_COUNT                                                                 = 575
  17930 	YY_SHIFT_MAX                                                                   = 2074
  17931 	YY_SHIFT_MIN                                                                   = 0
  17932 	ZERO_PADDING                                                                   = 3
  17933 	X_ADXINTRIN_H_INCLUDED                                                         = 0
  17934 	X_AGLOBAL                                                                      = 0
  17935 	X_ALLOCA_S_HEAP_MARKER                                                         = 0xDDDD
  17936 	X_ALLOCA_S_MARKER_SIZE                                                         = 16
  17937 	X_ALLOCA_S_STACK_MARKER                                                        = 0xCCCC
  17938 	X_ALLOCA_S_THRESHOLD                                                           = 1024
  17939 	X_ALPHA                                                                        = 259
  17940 	X_AMD64_                                                                       = 0
  17941 	X_AMMINTRIN_H_INCLUDED                                                         = 0
  17942 	X_ANONYMOUS_STRUCT                                                             = 0
  17943 	X_ANONYMOUS_UNION                                                              = 0
  17944 	X_ANSI_STDARG_H_                                                               = 0
  17945 	X_ANSI_STDDEF_H                                                                = 0
  17946 	X_APIAPPCONTAINER_                                                             = 0
  17947 	X_APISECUREBASE_                                                               = 0
  17948 	X_APISETCCONV_                                                                 = 0
  17949 	X_APISETDEBUG_                                                                 = 0
  17950 	X_APISETFILE_                                                                  = 0
  17951 	X_APISETHANDLE_                                                                = 0
  17952 	X_APISETLIBLOADER_                                                             = 0
  17953 	X_APISETNAMESPACE_                                                             = 0
  17954 	X_APISETREALTIME_                                                              = 0
  17955 	X_APISETSTRING_                                                                = 0
  17956 	X_APISETUTIL_                                                                  = 0
  17957 	X_API_SET_H_                                                                   = 0
  17958 	X_APPIDREGFLAGS_DEFINED                                                        = 0
  17959 	X_ARGMAX                                                                       = 100
  17960 	X_AUTH_IDENTITY_DEFINED                                                        = 0
  17961 	X_AVX2INTRIN_H_INCLUDED                                                        = 0
  17962 	X_AVX5124FMAPSINTRIN_H_INCLUDED                                                = 0
  17963 	X_AVX5124VNNIWINTRIN_H_INCLUDED                                                = 0
  17964 	X_AVX512BF16INTRIN_H_INCLUDED                                                  = 0
  17965 	X_AVX512BF16VLINTRIN_H_INCLUDED                                                = 0
  17966 	X_AVX512BITALGINTRIN_H_INCLUDED                                                = 0
  17967 	X_AVX512BWINTRIN_H_INCLUDED                                                    = 0
  17968 	X_AVX512CDINTRIN_H_INCLUDED                                                    = 0
  17969 	X_AVX512DQINTRIN_H_INCLUDED                                                    = 0
  17970 	X_AVX512ERINTRIN_H_INCLUDED                                                    = 0
  17971 	X_AVX512FINTRIN_H_INCLUDED                                                     = 0
  17972 	X_AVX512IFMAINTRIN_H_INCLUDED                                                  = 0
  17973 	X_AVX512IFMAVLINTRIN_H_INCLUDED                                                = 0
  17974 	X_AVX512PFINTRIN_H_INCLUDED                                                    = 0
  17975 	X_AVX512VBMI2VLINTRIN_H_INCLUDED                                               = 0
  17976 	X_AVX512VBMIINTRIN_H_INCLUDED                                                  = 0
  17977 	X_AVX512VBMIVLINTRIN_H_INCLUDED                                                = 0
  17978 	X_AVX512VLBWINTRIN_H_INCLUDED                                                  = 0
  17979 	X_AVX512VLDQINTRIN_H_INCLUDED                                                  = 0
  17980 	X_AVX512VLINTRIN_H_INCLUDED                                                    = 0
  17981 	X_AVX512VNNIVLINTRIN_H_INCLUDED                                                = 0
  17982 	X_AVX512VP2INTERSECTINTRIN_H_INCLUDED                                          = 0
  17983 	X_AVX512VP2INTERSECTVLINTRIN_H_INCLUDED                                        = 0
  17984 	X_AVX512VPOPCNTDQINTRIN_H_INCLUDED                                             = 0
  17985 	X_AVX512VPOPCNTDQVLINTRIN_H_INCLUDED                                           = 0
  17986 	X_AVXINTRIN_H_INCLUDED                                                         = 0
  17987 	X_BASETSD_H_                                                                   = 0
  17988 	X_BEM_H_                                                                       = 0
  17989 	X_BLANK                                                                        = 0x40
  17990 	X_BLOB_DEFINED                                                                 = 0
  17991 	X_BMI2INTRIN_H_INCLUDED                                                        = 0
  17992 	X_BMIINTRIN_H_INCLUDED                                                         = 0
  17993 	X_BOOLEAN_                                                                     = 0
  17994 	X_BSDTYPES_DEFINED                                                             = 0
  17995 	X_Benign_race_begin_                                                           = 0
  17996 	X_Benign_race_end_                                                             = 0
  17997 	X_CALL_REPORTFAULT                                                             = 0x2
  17998 	X_CETINTRIN_H_INCLUDED                                                         = 0
  17999 	X_CLDEMOTE_H_INCLUDED                                                          = 0
  18000 	X_CLFLUSHOPTINTRIN_H_INCLUDED                                                  = 0
  18001 	X_CLOCK_T_DEFINED                                                              = 0
  18002 	X_CLWBINTRIN_H_INCLUDED                                                        = 0
  18003 	X_CLZEROINTRIN_H_INCLUDED                                                      = 0
  18004 	X_CMP_EQ_OQ                                                                    = 0x00
  18005 	X_CMP_EQ_OS                                                                    = 0x10
  18006 	X_CMP_EQ_UQ                                                                    = 0x08
  18007 	X_CMP_EQ_US                                                                    = 0x18
  18008 	X_CMP_FALSE_OQ                                                                 = 0x0b
  18009 	X_CMP_FALSE_OS                                                                 = 0x1b
  18010 	X_CMP_GE_OQ                                                                    = 0x1d
  18011 	X_CMP_GE_OS                                                                    = 0x0d
  18012 	X_CMP_GT_OQ                                                                    = 0x1e
  18013 	X_CMP_GT_OS                                                                    = 0x0e
  18014 	X_CMP_LE_OQ                                                                    = 0x12
  18015 	X_CMP_LE_OS                                                                    = 0x02
  18016 	X_CMP_LT_OQ                                                                    = 0x11
  18017 	X_CMP_LT_OS                                                                    = 0x01
  18018 	X_CMP_NEQ_OQ                                                                   = 0x0c
  18019 	X_CMP_NEQ_OS                                                                   = 0x1c
  18020 	X_CMP_NEQ_UQ                                                                   = 0x04
  18021 	X_CMP_NEQ_US                                                                   = 0x14
  18022 	X_CMP_NGE_UQ                                                                   = 0x19
  18023 	X_CMP_NGE_US                                                                   = 0x09
  18024 	X_CMP_NGT_UQ                                                                   = 0x1a
  18025 	X_CMP_NGT_US                                                                   = 0x0a
  18026 	X_CMP_NLE_UQ                                                                   = 0x16
  18027 	X_CMP_NLE_US                                                                   = 0x06
  18028 	X_CMP_NLT_UQ                                                                   = 0x15
  18029 	X_CMP_NLT_US                                                                   = 0x05
  18030 	X_CMP_ORD_Q                                                                    = 0x07
  18031 	X_CMP_ORD_S                                                                    = 0x17
  18032 	X_CMP_TRUE_UQ                                                                  = 0x0f
  18033 	X_CMP_TRUE_US                                                                  = 0x1f
  18034 	X_CMP_UNORD_Q                                                                  = 0x03
  18035 	X_CMP_UNORD_S                                                                  = 0x13
  18036 	X_COMBASEAPI_H_                                                                = 0
  18037 	X_COMPLEX_DEFINED                                                              = 0
  18038 	X_COM_Outptr_                                                                  = 0
  18039 	X_COM_Outptr_opt_                                                              = 0
  18040 	X_COM_Outptr_opt_result_maybenull_                                             = 0
  18041 	X_COM_Outptr_result_maybenull_                                                 = 0
  18042 	X_CONST_RETURN                                                                 = 0
  18043 	X_CONTROL                                                                      = 0x20
  18044 	X_CRTNOALIAS                                                                   = 0
  18045 	X_CRTRESTRICT                                                                  = 0
  18046 	X_CRT_ABS_DEFINED                                                              = 0
  18047 	X_CRT_ALGO_DEFINED                                                             = 0
  18048 	X_CRT_ALLOCATION_DEFINED                                                       = 0
  18049 	X_CRT_ALTERNATIVE_IMPORTED                                                     = 0
  18050 	X_CRT_ATOF_DEFINED                                                             = 0
  18051 	X_CRT_CTYPEDATA_DEFINED                                                        = 0
  18052 	X_CRT_DIRECTORY_DEFINED                                                        = 0
  18053 	X_CRT_DOUBLE_DEC                                                               = 0
  18054 	X_CRT_ERRNO_DEFINED                                                            = 0
  18055 	X_CRT_GETPID_DEFINED                                                           = 0
  18056 	X_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS                                            = 4
  18057 	X_CRT_INTERNAL_LOCAL_SCANF_OPTIONS                                             = 2
  18058 	X_CRT_INTERNAL_PRINTF_LEGACY_MSVCRT_COMPATIBILITY                              = 0x0008
  18059 	X_CRT_INTERNAL_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS                             = 0x0010
  18060 	X_CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION                         = 0x0001
  18061 	X_CRT_INTERNAL_PRINTF_LEGACY_WIDE_SPECIFIERS                                   = 0x0004
  18062 	X_CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR                               = 0x0002
  18063 	X_CRT_INTERNAL_SCANF_LEGACY_MSVCRT_COMPATIBILITY                               = 0x0004
  18064 	X_CRT_INTERNAL_SCANF_LEGACY_WIDE_SPECIFIERS                                    = 0x0002
  18065 	X_CRT_INTERNAL_SCANF_SECURECRT                                                 = 0x0001
  18066 	X_CRT_MANAGED_HEAP_DEPRECATE                                                   = 0
  18067 	X_CRT_MATHERR_DEFINED                                                          = 0
  18068 	X_CRT_MEMORY_DEFINED                                                           = 0
  18069 	X_CRT_PACKING                                                                  = 8
  18070 	X_CRT_PERROR_DEFINED                                                           = 0
  18071 	X_CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES                                         = 0
  18072 	X_CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES_MEMORY                                  = 0
  18073 	X_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES                                       = 0
  18074 	X_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT                                 = 0
  18075 	X_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_MEMORY                                = 0
  18076 	X_CRT_SECURE_NO_DEPRECATE                                                      = 0
  18077 	X_CRT_SWAB_DEFINED                                                             = 0
  18078 	X_CRT_SYSTEM_DEFINED                                                           = 0
  18079 	X_CRT_TERMINATE_DEFINED                                                        = 0
  18080 	X_CRT_USE_WINAPI_FAMILY_DESKTOP_APP                                            = 0
  18081 	X_CRT_WCTYPEDATA_DEFINED                                                       = 0
  18082 	X_CRT_WPERROR_DEFINED                                                          = 0
  18083 	X_CRT_WSYSTEM_DEFINED                                                          = 0
  18084 	X_CTYPE_DEFINED                                                                = 0
  18085 	X_CVTBUFSIZE                                                                   = 349
  18086 	X_CY_DEFINED                                                                   = 0
  18087 	X_Const_                                                                       = 0
  18088 	X_DATETIMEAPI_H_                                                               = 0
  18089 	X_DCOMSCM_REMOTECALL_FLAGS_DEFINED                                             = 0
  18090 	X_DDEHEADER_INCLUDED_                                                          = 0
  18091 	X_DEF_WINBOOL_                                                                 = 0
  18092 	X_DEVIOCTL_                                                                    = 0
  18093 	X_DEV_T_DEFINED                                                                = 0
  18094 	X_DIGIT                                                                        = 0x4
  18095 	X_DIV_T_DEFINED                                                                = 0
  18096 	X_DLGSH_INCLUDED_                                                              = 0
  18097 	X_DLL                                                                          = 0
  18098 	X_DOMAIN                                                                       = 1
  18099 	X_DPI_AWARENESS_CONTEXTS_                                                      = 0
  18100 	X_DWORDLONG_                                                                   = 0
  18101 	X_EMMINTRIN_H_INCLUDED                                                         = 0
  18102 	X_ENQCMDINTRIN_H_INCLUDED                                                      = 0
  18103 	X_ERRCODE_DEFINED                                                              = 0
  18104 	X_ERRHANDLING_H_                                                               = 0
  18105 	X_ERROR_STATUS_T_DEFINED                                                       = 0
  18106 	X_EXCEPTION_DEFINED                                                            = 0
  18107 	X_F16CINTRIN_H_INCLUDED                                                        = 0
  18108 	X_FD_SET_WINSOCK_DEFINED                                                       = 0
  18109 	X_FIBERS_H_                                                                    = 0
  18110 	X_FILESYSTEMFSCTL_                                                             = 0
  18111 	X_FILETIME_                                                                    = 0
  18112 	X_FILE_DEFINED                                                                 = 0
  18113 	X_FILE_OFFSET_BITS                                                             = 64
  18114 	X_FILE_OFFSET_BITS_SET_FSEEKO                                                  = 0
  18115 	X_FILE_OFFSET_BITS_SET_FTELLO                                                  = 0
  18116 	X_FILE_OFFSET_BITS_SET_OFFT                                                    = 0
  18117 	X_FLT_WINERROR_                                                                = 0
  18118 	X_FMA4INTRIN_H_INCLUDED                                                        = 0
  18119 	X_FMAINTRIN_H_INCLUDED                                                         = 0
  18120 	X_FORCENAMELESSUNION                                                           = 1
  18121 	X_FPCLASS_ND                                                                   = 0x0010
  18122 	X_FPCLASS_NINF                                                                 = 0x0004
  18123 	X_FPCLASS_NN                                                                   = 0x0008
  18124 	X_FPCLASS_NZ                                                                   = 0x0020
  18125 	X_FPCLASS_PD                                                                   = 0x0080
  18126 	X_FPCLASS_PINF                                                                 = 0x0200
  18127 	X_FPCLASS_PN                                                                   = 0x0100
  18128 	X_FPCLASS_PZ                                                                   = 0x0040
  18129 	X_FPCLASS_QNAN                                                                 = 0x0002
  18130 	X_FPCLASS_SNAN                                                                 = 0x0001
  18131 	X_FPOS_T_DEFINED                                                               = 0
  18132 	X_FREEA_INLINE                                                                 = 0
  18133 	X_FREEENTRY                                                                    = 0
  18134 	X_FTS5INT_H                                                                    = 0
  18135 	X_FTS5_H                                                                       = 0
  18136 	X_FTSINT_H                                                                     = 0
  18137 	X_FXSRINTRIN_H_INCLUDED                                                        = 0
  18138 	X_Field_z_                                                                     = 0
  18139 	X_GCC_LIMITS_H_                                                                = 0
  18140 	X_GCC_MAX_ALIGN_T                                                              = 0
  18141 	X_GFNIINTRIN_H_INCLUDED                                                        = 0
  18142 	X_GNU_SOURCE                                                                   = 0
  18143 	X_GUIDDEF_H_                                                                   = 0
  18144 	X_HEAPAPI_H_                                                                   = 0
  18145 	X_HEAPBADBEGIN                                                                 = -3
  18146 	X_HEAPBADNODE                                                                  = -4
  18147 	X_HEAPBADPTR                                                                   = -6
  18148 	X_HEAPEMPTY                                                                    = -1
  18149 	X_HEAPEND                                                                      = -5
  18150 	X_HEAPINFO_DEFINED                                                             = 0
  18151 	X_HEAPOK                                                                       = -2
  18152 	X_HEAP_MAXREQ                                                                  = 0xFFFFFFFFFFFFFFE0
  18153 	X_HEX                                                                          = 0x80
  18154 	X_HITLOGGING_DEFINED                                                           = 0
  18155 	X_HPOWERNOTIFY_DEF_                                                            = 0
  18156 	X_HRESULT_DEFINED                                                              = 0
  18157 	X_HYPER_DEFINED                                                                = 0
  18158 	X_I16_MAX                                                                      = 32767
  18159 	X_I16_MIN                                                                      = -32768
  18160 	X_I32_MAX                                                                      = 2147483647
  18161 	X_I32_MIN                                                                      = -2147483648
  18162 	X_I64_MAX                                                                      = 9223372036854775807
  18163 	X_I64_MIN                                                                      = -9223372036854775808
  18164 	X_I8_MAX                                                                       = 127
  18165 	X_I8_MIN                                                                       = -128
  18166 	X_IMMINTRIN_H_INCLUDED                                                         = 0
  18167 	X_IMM_                                                                         = 0
  18168 	X_IMM_SDK_DEFINED_                                                             = 0
  18169 	X_INC_CDERR                                                                    = 0
  18170 	X_INC_COMMDLG                                                                  = 0
  18171 	X_INC_CORECRT                                                                  = 0
  18172 	X_INC_CORECRT_STARTUP                                                          = 0
  18173 	X_INC_CORECRT_WSTDLIB                                                          = 0
  18174 	X_INC_CRTDEFS                                                                  = 0
  18175 	X_INC_CRTDEFS_MACRO                                                            = 0
  18176 	X_INC_CRT_UNICODE_MACROS                                                       = 2
  18177 	X_INC_CTYPE                                                                    = 0
  18178 	X_INC_DDEMLH                                                                   = 0
  18179 	X_INC_ERRNO                                                                    = 0
  18180 	X_INC_EXCPT                                                                    = 0
  18181 	X_INC_LIMITS                                                                   = 0
  18182 	X_INC_MINGW_SECAPI                                                             = 0
  18183 	X_INC_MMSYSTEM                                                                 = 0
  18184 	X_INC_PROCESS                                                                  = 0
  18185 	X_INC_SDKDDKVER                                                                = 0
  18186 	X_INC_SETJMP                                                                   = 0
  18187 	X_INC_SHELLAPI                                                                 = 0
  18188 	X_INC_STDARG                                                                   = 0
  18189 	X_INC_STDDEF                                                                   = 0
  18190 	X_INC_STDIO                                                                    = 0
  18191 	X_INC_STDIO_S                                                                  = 0
  18192 	X_INC_STDLIB                                                                   = 0
  18193 	X_INC_STDLIB_S                                                                 = 0
  18194 	X_INC_STRING                                                                   = 0
  18195 	X_INC_STRING_S                                                                 = 0
  18196 	X_INC_SWPRINTF_INL                                                             = 0
  18197 	X_INC_TYPES                                                                    = 0
  18198 	X_INC_VADEFS                                                                   = 0
  18199 	X_INC_VIRTDISK                                                                 = 0
  18200 	X_INC_WINAPIFAMILY                                                             = 0
  18201 	X_INC_WINDOWS                                                                  = 0
  18202 	X_INC_WTIME_INL                                                                = 0
  18203 	X_INC_WTIME_S_INL                                                              = 0
  18204 	X_INC__MINGW_H                                                                 = 0
  18205 	X_INO_T_DEFINED                                                                = 0
  18206 	X_INT128_DEFINED                                                               = 0
  18207 	X_INTEGRAL_MAX_BITS                                                            = 64
  18208 	X_INTERLOCKAPI_H_                                                              = 0
  18209 	X_INTPTR_T_DEFINED                                                             = 0
  18210 	X_INTRIN_MAC_                                                                  = 0
  18211 	X_IOB_ENTRIES                                                                  = 20
  18212 	X_IOEOF                                                                        = 0x0010
  18213 	X_IOERR                                                                        = 0x0020
  18214 	X_IOFBF                                                                        = 0x0000
  18215 	X_IOLBF                                                                        = 0x0040
  18216 	X_IOMYBUF                                                                      = 0x0008
  18217 	X_IONBF                                                                        = 0x0004
  18218 	X_IOREAD                                                                       = 0x0001
  18219 	X_IORW                                                                         = 0x0080
  18220 	X_IOSTRG                                                                       = 0x0040
  18221 	X_IOWRT                                                                        = 0x0002
  18222 	X_IO_APISET_H_                                                                 = 0
  18223 	X_IRQL_requires_same_                                                          = 0
  18224 	X_IRQL_restores_                                                               = 0
  18225 	X_IRQL_saves_                                                                  = 0
  18226 	X_In_                                                                          = 0
  18227 	X_In_opt_                                                                      = 0
  18228 	X_In_opt_z_                                                                    = 0
  18229 	X_In_z_                                                                        = 0
  18230 	X_Inout_                                                                       = 0
  18231 	X_Inout_opt_                                                                   = 0
  18232 	X_Inout_opt_z_                                                                 = 0
  18233 	X_Inout_z_                                                                     = 0
  18234 	X_Interlocked_                                                                 = 0
  18235 	X_JBLEN                                                                        = 16
  18236 	X_JMP_BUF_DEFINED                                                              = 0
  18237 	X_JOBAPISET_H_                                                                 = 0
  18238 	X_KTMTYPES_                                                                    = 0
  18239 	X_LANGID_DEFINED                                                               = 0
  18240 	X_LARGEFILE_SOURCE                                                             = 1
  18241 	X_LARGE_FILE                                                                   = 1
  18242 	X_LARGE_INTEGER_DEFINED                                                        = 0
  18243 	X_LCID_DEFINED                                                                 = 0
  18244 	X_LDT_ENTRY_DEFINED                                                            = 0
  18245 	X_LEADBYTE                                                                     = 0x8000
  18246 	X_LIMITS_H___                                                                  = 0
  18247 	X_LIST_ENTRY_DEFINED                                                           = 0
  18248 	X_LOGPALETTE_DEFINED                                                           = 0
  18249 	X_LOWER                                                                        = 0x2
  18250 	X_LPAUTHENTICATIONEX_DEFINED                                                   = 0
  18251 	X_LPAUTHENTICATION_DEFINED                                                     = 0
  18252 	X_LPBINDCALLBACKREDIRECT_DEFINED                                               = 0
  18253 	X_LPBINDHOST_DEFINED                                                           = 0
  18254 	X_LPBINDING_DEFINED                                                            = 0
  18255 	X_LPBINDPROTOCOL_DEFINED                                                       = 0
  18256 	X_LPBINDSTATUSCALLBACKEX_DEFINED                                               = 0
  18257 	X_LPBINDSTATUSCALLBACK_DEFINED                                                 = 0
  18258 	X_LPBLOB_DEFINED                                                               = 0
  18259 	X_LPCATALOGFILEINFO_DEFINED                                                    = 0
  18260 	X_LPCBYTE_DEFINED                                                              = 0
  18261 	X_LPCODEINSTALL_DEFINED                                                        = 0
  18262 	X_LPCVOID_DEFINED                                                              = 0
  18263 	X_LPDATAFILTER_DEFINED                                                         = 0
  18264 	X_LPENCODINGFILTERFACTORY_DEFINED                                              = 0
  18265 	X_LPGETBINDHANDLE_DEFINED                                                      = 0
  18266 	X_LPHTTPNEGOTIATE2_DEFINED                                                     = 0
  18267 	X_LPHTTPNEGOTIATE3_DEFINED                                                     = 0
  18268 	X_LPHTTPNEGOTIATE_DEFINED                                                      = 0
  18269 	X_LPHTTPSECURITY_DEFINED                                                       = 0
  18270 	X_LPIINTERNET                                                                  = 0
  18271 	X_LPIINTERNETBINDINFO                                                          = 0
  18272 	X_LPIINTERNETBINDINFOEX                                                        = 0
  18273 	X_LPIINTERNETPRIORITY_DEFINED                                                  = 0
  18274 	X_LPIINTERNETPROTOCOLINFO_DEFINED                                              = 0
  18275 	X_LPIINTERNETPROTOCOLROOT_DEFINED                                              = 0
  18276 	X_LPIINTERNETPROTOCOLSINKSTACKABLE_DEFINED                                     = 0
  18277 	X_LPIINTERNETPROTOCOLSINK_DEFINED                                              = 0
  18278 	X_LPIINTERNETPROTOCOL_DEFINED                                                  = 0
  18279 	X_LPIINTERNETSESSION_DEFINED                                                   = 0
  18280 	X_LPIINTERNETTHREADSWITCH_DEFINED                                              = 0
  18281 	X_LPINTERNETHOSTSECURITYMANANGER_DEFINED                                       = 0
  18282 	X_LPINTERNETSECURITYMANANGER_DEFINED                                           = 0
  18283 	X_LPINTERNETSECURITYMGRSITE_DEFINED                                            = 0
  18284 	X_LPINTERNETZONEMANAGER_DEFINED                                                = 0
  18285 	X_LPIWRAPPEDPROTOCOL_DEFINED                                                   = 0
  18286 	X_LPMONIKERPROP_DEFINED                                                        = 0
  18287 	X_LPPERSISTMONIKER_DEFINED                                                     = 0
  18288 	X_LPSOFTDISTEXT_DEFINED                                                        = 0
  18289 	X_LPWINDOWFORBINDINGUI_DEFINED                                                 = 0
  18290 	X_LPWININETFILESTREAM_DEFINED                                                  = 0
  18291 	X_LPWININETHTTPINFO_DEFINED                                                    = 0
  18292 	X_LPWININETHTTPTIMEOUTS_DEFINED                                                = 0
  18293 	X_LPWININETINFO_DEFINED                                                        = 0
  18294 	X_LWPINTRIN_H_INCLUDED                                                         = 0
  18295 	X_LZCNTINTRIN_H_INCLUDED                                                       = 0
  18296 	X_LZEXPAND_                                                                    = 0
  18297 	X_Literal_                                                                     = 0
  18298 	X_MALLOC_H_                                                                    = 0
  18299 	X_MATH_H_                                                                      = 0
  18300 	X_MAX_DIR                                                                      = 256
  18301 	X_MAX_DRIVE                                                                    = 3
  18302 	X_MAX_ENV                                                                      = 32767
  18303 	X_MAX_EXT                                                                      = 256
  18304 	X_MAX_FNAME                                                                    = 256
  18305 	X_MAX_PATH                                                                     = 260
  18306 	X_MAX_WAIT_MALLOC_CRT                                                          = 60000
  18307 	X_MCIDEVICEID_                                                                 = 0
  18308 	X_MCIERROR_                                                                    = 0
  18309 	X_MCX_H_                                                                       = 0
  18310 	X_MEMORYAPI_H_                                                                 = 0
  18311 	X_MINGW_IP_MREQ1_H                                                             = 0
  18312 	X_MINGW_IP_TYPES_H                                                             = 0
  18313 	X_MINWINBASE_                                                                  = 0
  18314 	X_MINWINDEF_                                                                   = 0
  18315 	X_MM3DNOW_H_INCLUDED                                                           = 0
  18316 	X_MMINTRIN_H_INCLUDED                                                          = 0
  18317 	X_MMRESULT_                                                                    = 0
  18318 	X_MM_CMPINT_EQ                                                                 = 0x0
  18319 	X_MM_CMPINT_GE                                                                 = 0x5
  18320 	X_MM_CMPINT_GT                                                                 = 0x6
  18321 	X_MM_CMPINT_LE                                                                 = 0x2
  18322 	X_MM_CMPINT_LT                                                                 = 0x1
  18323 	X_MM_CMPINT_NE                                                                 = 0x4
  18324 	X_MM_CMPINT_NLE                                                                = 0x6
  18325 	X_MM_CMPINT_NLT                                                                = 0x5
  18326 	X_MM_CMPINT_UNUSED                                                             = 0x3
  18327 	X_MM_DENORMALS_ZERO_MASK                                                       = 0x0040
  18328 	X_MM_DENORMALS_ZERO_OFF                                                        = 0x0000
  18329 	X_MM_DENORMALS_ZERO_ON                                                         = 0x0040
  18330 	X_MM_EXCEPT_DENORM                                                             = 0x0002
  18331 	X_MM_EXCEPT_DIV_ZERO                                                           = 0x0004
  18332 	X_MM_EXCEPT_INEXACT                                                            = 0x0020
  18333 	X_MM_EXCEPT_INVALID                                                            = 0x0001
  18334 	X_MM_EXCEPT_MASK                                                               = 0x003f
  18335 	X_MM_EXCEPT_OVERFLOW                                                           = 0x0008
  18336 	X_MM_EXCEPT_UNDERFLOW                                                          = 0x0010
  18337 	X_MM_FLUSH_ZERO_MASK                                                           = 0x8000
  18338 	X_MM_FLUSH_ZERO_OFF                                                            = 0x0000
  18339 	X_MM_FLUSH_ZERO_ON                                                             = 0x8000
  18340 	X_MM_FROUND_CEIL                                                               = 2
  18341 	X_MM_FROUND_CUR_DIRECTION                                                      = 0x04
  18342 	X_MM_FROUND_FLOOR                                                              = 1
  18343 	X_MM_FROUND_NEARBYINT                                                          = 12
  18344 	X_MM_FROUND_NINT                                                               = 0
  18345 	X_MM_FROUND_NO_EXC                                                             = 0x08
  18346 	X_MM_FROUND_RAISE_EXC                                                          = 0x00
  18347 	X_MM_FROUND_RINT                                                               = 4
  18348 	X_MM_FROUND_TO_NEAREST_INT                                                     = 0x00
  18349 	X_MM_FROUND_TO_NEG_INF                                                         = 0x01
  18350 	X_MM_FROUND_TO_POS_INF                                                         = 0x02
  18351 	X_MM_FROUND_TO_ZERO                                                            = 0x03
  18352 	X_MM_FROUND_TRUNC                                                              = 3
  18353 	X_MM_MALLOC_H_INCLUDED                                                         = 0
  18354 	X_MM_MASK_DENORM                                                               = 0x0100
  18355 	X_MM_MASK_DIV_ZERO                                                             = 0x0200
  18356 	X_MM_MASK_INEXACT                                                              = 0x1000
  18357 	X_MM_MASK_INVALID                                                              = 0x0080
  18358 	X_MM_MASK_MASK                                                                 = 0x1f80
  18359 	X_MM_MASK_OVERFLOW                                                             = 0x0400
  18360 	X_MM_MASK_UNDERFLOW                                                            = 0x0800
  18361 	X_MM_ROUND_DOWN                                                                = 0x2000
  18362 	X_MM_ROUND_MASK                                                                = 0x6000
  18363 	X_MM_ROUND_NEAREST                                                             = 0x0000
  18364 	X_MM_ROUND_TOWARD_ZERO                                                         = 0x6000
  18365 	X_MM_ROUND_UP                                                                  = 0x4000
  18366 	X_MODE_T_                                                                      = 0
  18367 	X_MOVDIRINTRIN_H_INCLUDED                                                      = 0
  18368 	X_MSC_VER                                                                      = 1900
  18369 	X_MT                                                                           = 0
  18370 	X_MWAITXINTRIN_H_INCLUDED                                                      = 0
  18371 	X_M_AMD64                                                                      = 100
  18372 	X_M_X64                                                                        = 100
  18373 	X_Maybe_raises_SEH_exception_                                                  = 0
  18374 	X_Must_inspect_result_                                                         = 0
  18375 	X_NAMEDPIPE_H_                                                                 = 0
  18376 	X_NFILE                                                                        = 512
  18377 	X_NLSCMPERROR                                                                  = 2147483647
  18378 	X_NLSCMP_DEFINED                                                               = 0
  18379 	X_NSTREAM_                                                                     = 512
  18380 	X_NTDDDISK_H_                                                                  = 0
  18381 	X_NTDDSCRD_H2_                                                                 = 0
  18382 	X_NTDDSTOR_H_                                                                  = 0
  18383 	X_NTDDTAPE_WINNT_                                                              = 0
  18384 	X_NTSTATUS_PSDK                                                                = 0
  18385 	X_NTTMAPI_                                                                     = 0
  18386 	X_NT_TIB_DEFINED                                                               = 0
  18387 	X_No_competing_thread_                                                         = 0
  18388 	X_No_competing_thread_begin_                                                   = 0
  18389 	X_No_competing_thread_end_                                                     = 0
  18390 	X_Notliteral_                                                                  = 0
  18391 	X_NullNull_terminated_                                                         = 0
  18392 	X_Null_terminated_                                                             = 0
  18393 	X_OBJBASE_H_                                                                   = 0
  18394 	X_OBJIDLBASE_                                                                  = 0
  18395 	X_OFF64_T_DEFINED                                                              = 0
  18396 	X_OFF_T_                                                                       = 0
  18397 	X_OFF_T_DEFINED                                                                = 0
  18398 	X_OLD_P_OVERLAY                                                                = 2
  18399 	X_OLE2_H_                                                                      = 0
  18400 	X_OLEAUTO_H_                                                                   = 0
  18401 	X_ONEXIT_T_DEFINED                                                             = 0
  18402 	X_OS_COMMON_H_                                                                 = 0
  18403 	X_OUT_TO_DEFAULT                                                               = 0
  18404 	X_OUT_TO_MSGBOX                                                                = 2
  18405 	X_OUT_TO_STDERR                                                                = 1
  18406 	X_OVERFLOW                                                                     = 3
  18407 	X_Out_                                                                         = 0
  18408 	X_Out_opt_                                                                     = 0
  18409 	X_Outptr_                                                                      = 0
  18410 	X_Outptr_opt_                                                                  = 0
  18411 	X_Outptr_opt_result_maybenull_                                                 = 0
  18412 	X_Outptr_opt_result_maybenull_z_                                               = 0
  18413 	X_Outptr_opt_result_nullonfailure_                                             = 0
  18414 	X_Outptr_opt_result_z_                                                         = 0
  18415 	X_Outptr_result_maybenull_                                                     = 0
  18416 	X_Outptr_result_maybenull_z_                                                   = 0
  18417 	X_Outptr_result_nullonfailure_                                                 = 0
  18418 	X_Outptr_result_z_                                                             = 0
  18419 	X_Outref_                                                                      = 0
  18420 	X_Outref_result_maybenull_                                                     = 0
  18421 	X_Outref_result_nullonfailure_                                                 = 0
  18422 	X_PALETTEENTRY_DEFINED                                                         = 0
  18423 	X_PCONFIGINTRIN_H_INCLUDED                                                     = 0
  18424 	X_PGLOBAL                                                                      = 0
  18425 	X_PID_T_                                                                       = 0
  18426 	X_PKUINTRIN_H_INCLUDED                                                         = 0
  18427 	X_PLOSS                                                                        = 6
  18428 	X_PMMINTRIN_H_INCLUDED                                                         = 0
  18429 	X_POPCNTINTRIN_H_INCLUDED                                                      = 0
  18430 	X_POSIX_CPUTIME                                                                = 200809
  18431 	X_POSIX_MONOTONIC_CLOCK                                                        = 200809
  18432 	X_POSIX_THREAD_CPUTIME                                                         = 200809
  18433 	X_POSIX_TIMERS                                                                 = 200809
  18434 	X_PRFCHWINTRIN_H_INCLUDED                                                      = 0
  18435 	X_PROCESSENV_                                                                  = 0
  18436 	X_PROCESSTHREADSAPI_H_                                                         = 0
  18437 	X_PROCESSTOPOLOGYAPI_H_                                                        = 0
  18438 	X_PROFILEAPI_H_                                                                = 0
  18439 	X_PROPVARIANTINIT_DEFINED_                                                     = 0
  18440 	X_PROVIDER_STRUCTS_DEFINED                                                     = 0
  18441 	X_PRSHT_H_                                                                     = 0
  18442 	X_PTRDIFF_T_                                                                   = 0
  18443 	X_PTRDIFF_T_DEFINED                                                            = 0
  18444 	X_PUNCT                                                                        = 0x10
  18445 	X_P_DETACH                                                                     = 4
  18446 	X_P_NOWAIT                                                                     = 1
  18447 	X_P_NOWAITO                                                                    = 3
  18448 	X_P_OVERLAY                                                                    = 2
  18449 	X_P_WAIT                                                                       = 0
  18450 	X_P_tmpdir                                                                     = "\\"
  18451 	X_Points_to_data_                                                              = 0
  18452 	X_Post_                                                                        = 0
  18453 	X_Post_equals_last_error_                                                      = 0
  18454 	X_Pre_notnull_                                                                 = 0
  18455 	X_Printf_format_string_                                                        = 0
  18456 	X_QSORT_S_DEFINED                                                              = 0
  18457 	X_RDSEEDINTRIN_H_INCLUDED                                                      = 0
  18458 	X_REFCLSID_DEFINED                                                             = 0
  18459 	X_REFFMTID_DEFINED                                                             = 0
  18460 	X_REFGUID_DEFINED                                                              = 0
  18461 	X_REFIID_DEFINED                                                               = 0
  18462 	X_REFPROPVARIANT_DEFINED                                                       = 0
  18463 	X_REFVARIANT_DEFINED                                                           = 0
  18464 	X_REPORT_ERRMODE                                                               = 3
  18465 	X_ROTFLAGS_DEFINED                                                             = 0
  18466 	X_ROTREGFLAGS_DEFINED                                                          = 0
  18467 	X_ROT_COMPARE_MAX_DEFINED                                                      = 0
  18468 	X_RSIZE_T_DEFINED                                                              = 0
  18469 	X_RTL_RUN_ONCE_DEF                                                             = 1
  18470 	X_RTMINTRIN_H_INCLUDED                                                         = 0
  18471 	X_Raises_SEH_exception_                                                        = 0
  18472 	X_Requires_no_locks_held_                                                      = 0
  18473 	X_Reserved_                                                                    = 0
  18474 	X_Result_nullonfailure_                                                        = 0
  18475 	X_Result_zeroonfailure_                                                        = 0
  18476 	X_Ret_maybenull_                                                               = 0
  18477 	X_Ret_maybenull_z_                                                             = 0
  18478 	X_Ret_notnull_                                                                 = 0
  18479 	X_Ret_null_                                                                    = 0
  18480 	X_Ret_valid_                                                                   = 0
  18481 	X_Ret_z_                                                                       = 0
  18482 	X_SECURECRT_ERRCODE_VALUES_DEFINED                                             = 0
  18483 	X_SECURECRT_FILL_BUFFER_PATTERN                                                = 0xFD
  18484 	X_SERIALIZEDPROPERTYVALUE_DEFINED_                                             = 0
  18485 	X_SGXINTRIN_H_INCLUDED                                                         = 0
  18486 	X_SHAINTRIN_H_INCLUDED                                                         = 0
  18487 	X_SIDD_BIT_MASK                                                                = 0x00
  18488 	X_SIDD_CMP_EQUAL_ANY                                                           = 0x00
  18489 	X_SIDD_CMP_EQUAL_EACH                                                          = 0x08
  18490 	X_SIDD_CMP_EQUAL_ORDERED                                                       = 0x0c
  18491 	X_SIDD_CMP_RANGES                                                              = 0x04
  18492 	X_SIDD_LEAST_SIGNIFICANT                                                       = 0x00
  18493 	X_SIDD_MASKED_NEGATIVE_POLARITY                                                = 0x30
  18494 	X_SIDD_MASKED_POSITIVE_POLARITY                                                = 0x20
  18495 	X_SIDD_MOST_SIGNIFICANT                                                        = 0x40
  18496 	X_SIDD_NEGATIVE_POLARITY                                                       = 0x10
  18497 	X_SIDD_POSITIVE_POLARITY                                                       = 0x00
  18498 	X_SIDD_SBYTE_OPS                                                               = 0x02
  18499 	X_SIDD_SWORD_OPS                                                               = 0x03
  18500 	X_SIDD_UBYTE_OPS                                                               = 0x00
  18501 	X_SIDD_UNIT_MASK                                                               = 0x40
  18502 	X_SIDD_UWORD_OPS                                                               = 0x01
  18503 	X_SIGN_DEFINED                                                                 = 0
  18504 	X_SIGSET_T_                                                                    = 0
  18505 	X_SING                                                                         = 2
  18506 	X_SIZE_T_DEFINED                                                               = 0
  18507 	X_SLIST_HEADER_                                                                = 0
  18508 	X_SMMINTRIN_H_INCLUDED                                                         = 0
  18509 	X_SPACE                                                                        = 0x8
  18510 	X_SPAWNV_DEFINED                                                               = 0
  18511 	X_SQLITE3RBU_H                                                                 = 0
  18512 	X_SQLITE3RTREE_H_                                                              = 0
  18513 	X_SQLITE_OS_H_                                                                 = 0
  18514 	X_SSIZE_T_DEFINED                                                              = 0
  18515 	X_STDARG_H                                                                     = 0
  18516 	X_STDDEF_H                                                                     = 0
  18517 	X_STDDEF_H_                                                                    = 0
  18518 	X_STDIO_CONFIG_DEFINED                                                         = 0
  18519 	X_STDIO_DEFINED                                                                = 0
  18520 	X_STDIO_S_DEFINED                                                              = 0
  18521 	X_STDSTREAM_DEFINED                                                            = 0
  18522 	X_STRALIGN_USE_SECURE_CRT                                                      = 0
  18523 	X_SYNCHAPI_H_                                                                  = 0
  18524 	X_SYSINFOAPI_H_                                                                = 0
  18525 	X_SYSTEMTIME_                                                                  = 0
  18526 	X_SYSTEMTOPOLOGY_H_                                                            = 0
  18527 	X_SYS_GUID_OPERATORS_                                                          = 0
  18528 	X_SYS_GUID_OPERATOR_EQ_                                                        = 0
  18529 	X_SYS_OPEN                                                                     = 20
  18530 	X_Scanf_format_string_                                                         = 0
  18531 	X_Scanf_s_format_string_                                                       = 0
  18532 	X_Strict_type_match_                                                           = 0
  18533 	X_TAGLC_ID_DEFINED                                                             = 0
  18534 	X_TBMINTRIN_H_INCLUDED                                                         = 0
  18535 	X_TCHAR_DEFINED                                                                = 0
  18536 	X_TEXTMETRIC_DEFINED                                                           = 0
  18537 	X_THREADLOCALEINFO                                                             = 0
  18538 	X_THREADPOOLAPISET_H_                                                          = 0
  18539 	X_THREADPOOLLEGACYAPISET_H_                                                    = 0
  18540 	X_TIME32_T_DEFINED                                                             = 0
  18541 	X_TIME64_T_DEFINED                                                             = 0
  18542 	X_TIMEB_DEFINED                                                                = 0
  18543 	X_TIMEB_H_                                                                     = 0
  18544 	X_TIMEB_H_S                                                                    = 0
  18545 	X_TIMESPEC_DEFINED                                                             = 0
  18546 	X_TIMEVAL_DEFINED                                                              = 0
  18547 	X_TIMEZONEAPI_H_                                                               = 0
  18548 	X_TIMEZONE_DEFINED                                                             = 0
  18549 	X_TIME_H_                                                                      = 0
  18550 	X_TIME_T_DEFINED                                                               = 0
  18551 	X_TLOSS                                                                        = 5
  18552 	X_TMMINTRIN_H_INCLUDED                                                         = 0
  18553 	X_TM_DEFINED                                                                   = 0
  18554 	X_TWO_DIGIT_EXPONENT                                                           = 0x1
  18555 	X_UI16_MAX                                                                     = 0xffff
  18556 	X_UI32_MAX                                                                     = 0xffffffff
  18557 	X_UI64_MAX                                                                     = 0xffffffffffffffff
  18558 	X_UI8_MAX                                                                      = 0xff
  18559 	X_UINTPTR_T_DEFINED                                                            = 0
  18560 	X_ULONGLONG_                                                                   = 0
  18561 	X_UNDERFLOW                                                                    = 4
  18562 	X_UPPER                                                                        = 0x1
  18563 	X_USEDENTRY                                                                    = 1
  18564 	X_Use_decl_annotations_                                                        = 0
  18565 	X_VA_LIST                                                                      = 0
  18566 	X_VA_LIST_                                                                     = 0
  18567 	X_VA_LIST_DEFINED                                                              = 0
  18568 	X_VA_LIST_T_H                                                                  = 0
  18569 	X_VPCLMULQDQINTRIN_H_INCLUDED                                                  = 0
  18570 	X_W64                                                                          = 0
  18571 	X_WAITPKG_H_INCLUDED                                                           = 0
  18572 	X_WAIT_CHILD                                                                   = 0
  18573 	X_WAIT_GRANDCHILD                                                              = 1
  18574 	X_WAVEFORMATEX_                                                                = 0
  18575 	X_WBNOINVDINTRIN_H_INCLUDED                                                    = 0
  18576 	X_WCHAR_T_DEFINED                                                              = 0
  18577 	X_WCTYPE_DEFINED                                                               = 0
  18578 	X_WCTYPE_INLINE_DEFINED                                                        = 0
  18579 	X_WCTYPE_T_DEFINED                                                             = 0
  18580 	X_WConst_return                                                                = 0
  18581 	X_WEXEC_DEFINED                                                                = 0
  18582 	X_WIN32                                                                        = 1
  18583 	X_WIN32_IE                                                                     = 1538
  18584 	X_WIN32_IE_IE100                                                               = 0x0a00
  18585 	X_WIN32_IE_IE110                                                               = 0x0A00
  18586 	X_WIN32_IE_IE20                                                                = 0x0200
  18587 	X_WIN32_IE_IE30                                                                = 0x0300
  18588 	X_WIN32_IE_IE302                                                               = 0x0302
  18589 	X_WIN32_IE_IE40                                                                = 0x0400
  18590 	X_WIN32_IE_IE401                                                               = 0x0401
  18591 	X_WIN32_IE_IE50                                                                = 0x0500
  18592 	X_WIN32_IE_IE501                                                               = 0x0501
  18593 	X_WIN32_IE_IE55                                                                = 0x0550
  18594 	X_WIN32_IE_IE60                                                                = 0x0600
  18595 	X_WIN32_IE_IE60SP1                                                             = 0x0601
  18596 	X_WIN32_IE_IE60SP2                                                             = 0x0603
  18597 	X_WIN32_IE_IE70                                                                = 0x0700
  18598 	X_WIN32_IE_IE80                                                                = 0x0800
  18599 	X_WIN32_IE_IE90                                                                = 0x0900
  18600 	X_WIN32_IE_LONGHORN                                                            = 1792
  18601 	X_WIN32_IE_NT4                                                                 = 512
  18602 	X_WIN32_IE_NT4SP1                                                              = 512
  18603 	X_WIN32_IE_NT4SP2                                                              = 512
  18604 	X_WIN32_IE_NT4SP3                                                              = 770
  18605 	X_WIN32_IE_NT4SP4                                                              = 1025
  18606 	X_WIN32_IE_NT4SP5                                                              = 1025
  18607 	X_WIN32_IE_NT4SP6                                                              = 1280
  18608 	X_WIN32_IE_WIN10                                                               = 2560
  18609 	X_WIN32_IE_WIN2K                                                               = 1281
  18610 	X_WIN32_IE_WIN2KSP1                                                            = 1281
  18611 	X_WIN32_IE_WIN2KSP2                                                            = 1281
  18612 	X_WIN32_IE_WIN2KSP3                                                            = 1281
  18613 	X_WIN32_IE_WIN2KSP4                                                            = 1281
  18614 	X_WIN32_IE_WIN6                                                                = 1792
  18615 	X_WIN32_IE_WIN7                                                                = 2048
  18616 	X_WIN32_IE_WIN8                                                                = 2560
  18617 	X_WIN32_IE_WIN98                                                               = 1025
  18618 	X_WIN32_IE_WIN98SE                                                             = 1280
  18619 	X_WIN32_IE_WINBLUE                                                             = 2560
  18620 	X_WIN32_IE_WINME                                                               = 1360
  18621 	X_WIN32_IE_WINTHRESHOLD                                                        = 2560
  18622 	X_WIN32_IE_WS03                                                                = 0x0602
  18623 	X_WIN32_IE_WS03SP1                                                             = 1539
  18624 	X_WIN32_IE_XP                                                                  = 1536
  18625 	X_WIN32_IE_XPSP1                                                               = 1537
  18626 	X_WIN32_IE_XPSP2                                                               = 1539
  18627 	X_WIN32_WINNT                                                                  = 0x502
  18628 	X_WIN32_WINNT_LONGHORN                                                         = 0x0600
  18629 	X_WIN32_WINNT_NT4                                                              = 0x0400
  18630 	X_WIN32_WINNT_VISTA                                                            = 0x0600
  18631 	X_WIN32_WINNT_WIN10                                                            = 0x0A00
  18632 	X_WIN32_WINNT_WIN2K                                                            = 0x0500
  18633 	X_WIN32_WINNT_WIN6                                                             = 0x0600
  18634 	X_WIN32_WINNT_WIN7                                                             = 0x0601
  18635 	X_WIN32_WINNT_WIN8                                                             = 0x0602
  18636 	X_WIN32_WINNT_WINBLUE                                                          = 0x0603
  18637 	X_WIN32_WINNT_WINTHRESHOLD                                                     = 0x0A00
  18638 	X_WIN32_WINNT_WINXP                                                            = 0x0501
  18639 	X_WIN32_WINNT_WS03                                                             = 0x0502
  18640 	X_WIN32_WINNT_WS08                                                             = 0x0600
  18641 	X_WIN64                                                                        = 1
  18642 	X_WINBASE_                                                                     = 0
  18643 	X_WINCON_                                                                      = 0
  18644 	X_WINDEF_                                                                      = 0
  18645 	X_WINDOWS_                                                                     = 0
  18646 	X_WINERROR_                                                                    = 0
  18647 	X_WINGDI_                                                                      = 0
  18648 	X_WINIOCTL_                                                                    = 0
  18649 	X_WINNETWK_                                                                    = 0
  18650 	X_WINNLS_                                                                      = 0
  18651 	X_WINNT_                                                                       = 0
  18652 	X_WINPERF_                                                                     = 0
  18653 	X_WINREG_                                                                      = 0
  18654 	X_WINSCARD_H_                                                                  = 0
  18655 	X_WINSOCKAPI_                                                                  = 0
  18656 	X_WINSPOOL_                                                                    = 0
  18657 	X_WINSVC_                                                                      = 0
  18658 	X_WINT_T                                                                       = 0
  18659 	X_WINUSER_                                                                     = 0
  18660 	X_WMMINTRIN_H_INCLUDED                                                         = 0
  18661 	X_WNNC_                                                                        = 0
  18662 	X_WOW64APISET_H_                                                               = 0
  18663 	X_WRITE_ABORT_MSG                                                              = 0x1
  18664 	X_WSPAWN_DEFINED                                                               = 0
  18665 	X_WSTDIO_DEFINED                                                               = 0
  18666 	X_WSTDIO_S_DEFINED                                                             = 0
  18667 	X_WSTDLIBP_DEFINED                                                             = 0
  18668 	X_WSTDLIB_DEFINED                                                              = 0
  18669 	X_WSTRING_DEFINED                                                              = 0
  18670 	X_WSTRING_S_DEFINED                                                            = 0
  18671 	X_WTIME_DEFINED                                                                = 0
  18672 	X_X86INTRIN_H_INCLUDED                                                         = 0
  18673 	X_XABORT_CAPACITY                                                              = 8
  18674 	X_XABORT_CONFLICT                                                              = 4
  18675 	X_XABORT_DEBUG                                                                 = 16
  18676 	X_XABORT_EXPLICIT                                                              = 1
  18677 	X_XABORT_NESTED                                                                = 32
  18678 	X_XABORT_RETRY                                                                 = 2
  18679 	X_XBEGIN_STARTED                                                               = 18446744073709551615
  18680 	X_XFORM_                                                                       = 0
  18681 	X_XHRPLUGGABLEPROTOCOL_DEFINED                                                 = 0
  18682 	X_XMMINTRIN_H_INCLUDED                                                         = 0
  18683 	X_XOPEN_SOURCE                                                                 = 600
  18684 	X_XOPMMINTRIN_H_INCLUDED                                                       = 0
  18685 	X_XSAVECINTRIN_H_INCLUDED                                                      = 0
  18686 	X_XSAVEINTRIN_H_INCLUDED                                                       = 0
  18687 	X_XSAVEOPTINTRIN_H_INCLUDED                                                    = 0
  18688 	X_XSAVESINTRIN_H_INCLUDED                                                      = 0
  18689 	X_XTESTINTRIN_H_INCLUDED                                                       = 0
  18690 	X_huge                                                                         = 0
  18691 	X_loadds                                                                       = 0
  18692 	X_tagBLOB_DEFINED                                                              = 0
  18693 	X_tagBSTRBLOB_DEFINED                                                          = 0
  18694 	X_tagCY_DEFINED                                                                = 0
  18695 	BBatch                                                                         = 0
  18696 	CPRIV_KEY_CACHE_MAX_ITEMS_DEFAULT                                              = 20
  18697 	CPRIV_KEY_CACHE_PURGE_INTERVAL_SECONDS_DEFAULT                                 = 86400
  18698 	CbNDRContext                                                                   = 20
  18699 	Cdecl                                                                          = 0
  18700 	Chx1                                                                           = 0x0410
  18701 	Chx10                                                                          = 0x0419
  18702 	Chx11                                                                          = 0x041a
  18703 	Chx12                                                                          = 0x041b
  18704 	Chx13                                                                          = 0x041c
  18705 	Chx14                                                                          = 0x041d
  18706 	Chx15                                                                          = 0x041e
  18707 	Chx16                                                                          = 0x041f
  18708 	Chx2                                                                           = 0x0411
  18709 	Chx3                                                                           = 0x0412
  18710 	Chx4                                                                           = 0x0413
  18711 	Chx5                                                                           = 0x0414
  18712 	Chx6                                                                           = 0x0415
  18713 	Chx7                                                                           = 0x0416
  18714 	Chx8                                                                           = 0x0417
  18715 	Chx9                                                                           = 0x0418
  18716 	Cmb1                                                                           = 0x0470
  18717 	Cmb10                                                                          = 0x0479
  18718 	Cmb11                                                                          = 0x047a
  18719 	Cmb12                                                                          = 0x047b
  18720 	Cmb13                                                                          = 0x047c
  18721 	Cmb14                                                                          = 0x047d
  18722 	Cmb15                                                                          = 0x047e
  18723 	Cmb16                                                                          = 0x047f
  18724 	Cmb2                                                                           = 0x0471
  18725 	Cmb3                                                                           = 0x0472
  18726 	Cmb4                                                                           = 0x0473
  18727 	Cmb5                                                                           = 0x0474
  18728 	Cmb6                                                                           = 0x0475
  18729 	Cmb7                                                                           = 0x0476
  18730 	Cmb8                                                                           = 0x0477
  18731 	Cmb9                                                                           = 0x0478
  18732 	Ctl1                                                                           = 0x04A0
  18733 	CtlFirst                                                                       = 0x0400
  18734 	CtlLast                                                                        = 0x04ff
  18735 	DwFORCE_KEY_PROTECTION_DISABLED                                                = 0x0
  18736 	DwFORCE_KEY_PROTECTION_HIGH                                                    = 0x2
  18737 	DwFORCE_KEY_PROTECTION_USER_SELECT                                             = 0x1
  18738 	Edt1                                                                           = 0x0480
  18739 	Edt10                                                                          = 0x0489
  18740 	Edt11                                                                          = 0x048a
  18741 	Edt12                                                                          = 0x048b
  18742 	Edt13                                                                          = 0x048c
  18743 	Edt14                                                                          = 0x048d
  18744 	Edt15                                                                          = 0x048e
  18745 	Edt16                                                                          = 0x048f
  18746 	Edt2                                                                           = 0x0481
  18747 	Edt3                                                                           = 0x0482
  18748 	Edt4                                                                           = 0x0483
  18749 	Edt5                                                                           = 0x0484
  18750 	Edt6                                                                           = 0x0485
  18751 	Edt7                                                                           = 0x0486
  18752 	Edt8                                                                           = 0x0487
  18753 	Edt9                                                                           = 0x0488
  18754 	EtBUFSIZE                                                                      = 70
  18755 	EtCHARX                                                                        = 8
  18756 	EtDECIMAL                                                                      = 16
  18757 	EtDYNSTRING                                                                    = 6
  18758 	EtEXP                                                                          = 2
  18759 	EtFLOAT                                                                        = 1
  18760 	EtGENERIC                                                                      = 3
  18761 	EtINVALID                                                                      = 17
  18762 	EtORDINAL                                                                      = 15
  18763 	EtPERCENT                                                                      = 7
  18764 	EtPOINTER                                                                      = 13
  18765 	EtRADIX                                                                        = 0
  18766 	EtSIZE                                                                         = 4
  18767 	EtSQLESCAPE                                                                    = 9
  18768 	EtSQLESCAPE2                                                                   = 10
  18769 	EtSQLESCAPE3                                                                   = 14
  18770 	EtSRCITEM                                                                      = 12
  18771 	EtSTRING                                                                       = 5
  18772 	EtTOKEN                                                                        = 11
  18773 	Far                                                                            = 0
  18774 	Frm1                                                                           = 0x0434
  18775 	Frm2                                                                           = 0x0435
  18776 	Frm3                                                                           = 0x0436
  18777 	Frm4                                                                           = 0x0437
  18778 	Fts5YYNFTS5TOKEN                                                               = 16
  18779 	Fts5YYNOCODE                                                                   = 27
  18780 	Fts5YYNOERRORRECOVERY                                                          = 1
  18781 	Fts5YYNRULE                                                                    = 28
  18782 	Fts5YYNRULE_WITH_ACTION                                                        = 28
  18783 	Fts5YYNSTATE                                                                   = 35
  18784 	Fts5YYPARSEFREENOTNULL                                                         = 1
  18785 	Fts5YYSTACKDEPTH                                                               = 100
  18786 	Fts5YY_ACCEPT_ACTION                                                           = 81
  18787 	Fts5YY_ACTTAB_COUNT                                                            = 105
  18788 	Fts5YY_ERROR_ACTION                                                            = 80
  18789 	Fts5YY_MAX_REDUCE                                                              = 110
  18790 	Fts5YY_MAX_SHIFT                                                               = 34
  18791 	Fts5YY_MAX_SHIFTREDUCE                                                         = 79
  18792 	Fts5YY_MIN_REDUCE                                                              = 83
  18793 	Fts5YY_MIN_SHIFTREDUCE                                                         = 52
  18794 	Fts5YY_NO_ACTION                                                               = 82
  18795 	Fts5YY_REDUCE_COUNT                                                            = 17
  18796 	Fts5YY_REDUCE_MAX                                                              = 67
  18797 	Fts5YY_REDUCE_MIN                                                              = -17
  18798 	Fts5YY_SHIFT_COUNT                                                             = 34
  18799 	Fts5YY_SHIFT_MAX                                                               = 93
  18800 	Fts5YY_SHIFT_MIN                                                               = 0
  18801 	Grp1                                                                           = 0x0430
  18802 	Grp2                                                                           = 0x0431
  18803 	Grp3                                                                           = 0x0432
  18804 	Grp4                                                                           = 0x0433
  18805 	Ico1                                                                           = 0x043c
  18806 	Ico2                                                                           = 0x043d
  18807 	Ico3                                                                           = 0x043e
  18808 	Ico4                                                                           = 0x043f
  18809 	Lst1                                                                           = 0x0460
  18810 	Lst10                                                                          = 0x0469
  18811 	Lst11                                                                          = 0x046a
  18812 	Lst12                                                                          = 0x046b
  18813 	Lst13                                                                          = 0x046c
  18814 	Lst14                                                                          = 0x046d
  18815 	Lst15                                                                          = 0x046e
  18816 	Lst16                                                                          = 0x046f
  18817 	Lst2                                                                           = 0x0461
  18818 	Lst3                                                                           = 0x0462
  18819 	Lst4                                                                           = 0x0463
  18820 	Lst5                                                                           = 0x0464
  18821 	Lst6                                                                           = 0x0465
  18822 	Lst7                                                                           = 0x0466
  18823 	Lst8                                                                           = 0x0467
  18824 	Lst9                                                                           = 0x0468
  18825 	Near                                                                           = 0
  18826 	Pascal                                                                         = 0
  18827 	Psh1                                                                           = 0x0400
  18828 	Psh10                                                                          = 0x0409
  18829 	Psh11                                                                          = 0x040a
  18830 	Psh12                                                                          = 0x040b
  18831 	Psh13                                                                          = 0x040c
  18832 	Psh14                                                                          = 0x040d
  18833 	Psh15                                                                          = 0x040e
  18834 	Psh16                                                                          = 0x040f
  18835 	Psh2                                                                           = 0x0401
  18836 	Psh3                                                                           = 0x0402
  18837 	Psh4                                                                           = 0x0403
  18838 	Psh5                                                                           = 0x0404
  18839 	Psh6                                                                           = 0x0405
  18840 	Psh7                                                                           = 0x0406
  18841 	Psh8                                                                           = 0x0407
  18842 	Psh9                                                                           = 0x0408
  18843 	PshHelp                                                                        = 1038
  18844 	Rad1                                                                           = 0x0420
  18845 	Rad10                                                                          = 0x0429
  18846 	Rad11                                                                          = 0x042a
  18847 	Rad12                                                                          = 0x042b
  18848 	Rad13                                                                          = 0x042c
  18849 	Rad14                                                                          = 0x042d
  18850 	Rad15                                                                          = 0x042e
  18851 	Rad16                                                                          = 0x042f
  18852 	Rad2                                                                           = 0x0421
  18853 	Rad3                                                                           = 0x0422
  18854 	Rad4                                                                           = 0x0423
  18855 	Rad5                                                                           = 0x0424
  18856 	Rad6                                                                           = 0x0425
  18857 	Rad7                                                                           = 0x0426
  18858 	Rad8                                                                           = 0x0427
  18859 	Rad9                                                                           = 0x0428
  18860 	Rct1                                                                           = 0x0438
  18861 	Rct2                                                                           = 0x0439
  18862 	Rct3                                                                           = 0x043a
  18863 	Rct4                                                                           = 0x043b
  18864 	Scr1                                                                           = 0x0490
  18865 	Scr2                                                                           = 0x0491
  18866 	Scr3                                                                           = 0x0492
  18867 	Scr4                                                                           = 0x0493
  18868 	Scr5                                                                           = 0x0494
  18869 	Scr6                                                                           = 0x0495
  18870 	Scr7                                                                           = 0x0496
  18871 	Scr8                                                                           = 0x0497
  18872 	Sqlite3Fts5ParserCTX_FETCH                                                     = 0
  18873 	Sqlite3Fts5ParserCTX_PARAM                                                     = 0
  18874 	Sqlite3Fts5ParserCTX_PDECL                                                     = 0
  18875 	Sqlite3Fts5ParserCTX_SDECL                                                     = 0
  18876 	Sqlite3Fts5ParserCTX_STORE                                                     = 0
  18877 	Sqlite3ParserARG_FETCH                                                         = 0
  18878 	Sqlite3ParserARG_PARAM                                                         = 0
  18879 	Sqlite3ParserARG_PDECL                                                         = 0
  18880 	Sqlite3ParserARG_SDECL                                                         = 0
  18881 	Sqlite3ParserARG_STORE                                                         = 0
  18882 	Sqlite3Parser_ENGINEALWAYSONSTACK                                              = 1
  18883 	Stc1                                                                           = 0x0440
  18884 	Stc10                                                                          = 0x0449
  18885 	Stc11                                                                          = 0x044a
  18886 	Stc12                                                                          = 0x044b
  18887 	Stc13                                                                          = 0x044c
  18888 	Stc14                                                                          = 0x044d
  18889 	Stc15                                                                          = 0x044e
  18890 	Stc16                                                                          = 0x044f
  18891 	Stc17                                                                          = 0x0450
  18892 	Stc18                                                                          = 0x0451
  18893 	Stc19                                                                          = 0x0452
  18894 	Stc2                                                                           = 0x0441
  18895 	Stc20                                                                          = 0x0453
  18896 	Stc21                                                                          = 0x0454
  18897 	Stc22                                                                          = 0x0455
  18898 	Stc23                                                                          = 0x0456
  18899 	Stc24                                                                          = 0x0457
  18900 	Stc25                                                                          = 0x0458
  18901 	Stc26                                                                          = 0x0459
  18902 	Stc27                                                                          = 0x045a
  18903 	Stc28                                                                          = 0x045b
  18904 	Stc29                                                                          = 0x045c
  18905 	Stc3                                                                           = 0x0442
  18906 	Stc30                                                                          = 0x045d
  18907 	Stc31                                                                          = 0x045e
  18908 	Stc32                                                                          = 0x045f
  18909 	Stc4                                                                           = 0x0443
  18910 	Stc5                                                                           = 0x0444
  18911 	Stc6                                                                           = 0x0445
  18912 	Stc7                                                                           = 0x0446
  18913 	Stc8                                                                           = 0x0447
  18914 	Stc9                                                                           = 0x0448
  18915 	SzFORCE_KEY_PROTECTION                                                         = "ForceKeyProtection"
  18916 	SzKEY_CACHE_ENABLED                                                            = "CachePrivateKeys"
  18917 	SzKEY_CACHE_SECONDS                                                            = "PrivateKeyLifetimeSeconds"
  18918 	SzKEY_CRYPTOAPI_PRIVATE_KEY_OPTIONS                                            = "Software\\Policies\\Microsoft\\Cryptography"
  18919 	SzOIDVerisign_FailInfo                                                         = "2.16.840.1.113733.1.9.4"
  18920 	SzOIDVerisign_MessageType                                                      = "2.16.840.1.113733.1.9.2"
  18921 	SzOIDVerisign_PkiStatus                                                        = "2.16.840.1.113733.1.9.3"
  18922 	SzOIDVerisign_RecipientNonce                                                   = "2.16.840.1.113733.1.9.6"
  18923 	SzOIDVerisign_SenderNonce                                                      = "2.16.840.1.113733.1.9.5"
  18924 	SzOIDVerisign_TransactionID                                                    = "2.16.840.1.113733.1.9.7"
  18925 	SzOID_ANSI_X942                                                                = "1.2.840.10046"
  18926 	SzOID_ANSI_X942_DH                                                             = "1.2.840.10046.2.1"
  18927 	SzOID_ANY_APPLICATION_POLICY                                                   = "1.3.6.1.4.1.311.10.12.1"
  18928 	SzOID_ANY_CERT_POLICY                                                          = "2.5.29.32.0"
  18929 	SzOID_ANY_ENHANCED_KEY_USAGE                                                   = "2.5.29.37.0"
  18930 	SzOID_APPLICATION_CERT_POLICIES                                                = "1.3.6.1.4.1.311.21.10"
  18931 	SzOID_APPLICATION_POLICY_CONSTRAINTS                                           = "1.3.6.1.4.1.311.21.12"
  18932 	SzOID_APPLICATION_POLICY_MAPPINGS                                              = "1.3.6.1.4.1.311.21.11"
  18933 	SzOID_ARCHIVED_KEY_ATTR                                                        = "1.3.6.1.4.1.311.21.13"
  18934 	SzOID_ARCHIVED_KEY_CERT_HASH                                                   = "1.3.6.1.4.1.311.21.16"
  18935 	SzOID_ATTEST_WHQL_CRYPTO                                                       = "1.3.6.1.4.1.311.10.3.5.1"
  18936 	SzOID_ATTR_PLATFORM_SPECIFICATION                                              = "2.23.133.2.17"
  18937 	SzOID_ATTR_SUPPORTED_ALGORITHMS                                                = "2.5.4.52"
  18938 	SzOID_ATTR_TPM_SECURITY_ASSERTIONS                                             = "2.23.133.2.18"
  18939 	SzOID_ATTR_TPM_SPECIFICATION                                                   = "2.23.133.2.16"
  18940 	SzOID_AUTHORITY_INFO_ACCESS                                                    = "1.3.6.1.5.5.7.1.1"
  18941 	SzOID_AUTHORITY_KEY_IDENTIFIER                                                 = "2.5.29.1"
  18942 	SzOID_AUTHORITY_KEY_IDENTIFIER2                                                = "2.5.29.35"
  18943 	SzOID_AUTHORITY_REVOCATION_LIST                                                = "2.5.4.38"
  18944 	SzOID_AUTO_ENROLL_CTL_USAGE                                                    = "1.3.6.1.4.1.311.20.1"
  18945 	SzOID_BACKGROUND_OTHER_LOGOTYPE                                                = "1.3.6.1.5.5.7.20.2"
  18946 	SzOID_BASIC_CONSTRAINTS                                                        = "2.5.29.10"
  18947 	SzOID_BASIC_CONSTRAINTS2                                                       = "2.5.29.19"
  18948 	SzOID_BIOMETRIC_EXT                                                            = "1.3.6.1.5.5.7.1.2"
  18949 	SzOID_BIOMETRIC_SIGNING                                                        = "1.3.6.1.4.1.311.10.3.41"
  18950 	SzOID_BUSINESS_CATEGORY                                                        = "2.5.4.15"
  18951 	SzOID_CA_CERTIFICATE                                                           = "2.5.4.37"
  18952 	SzOID_CERTIFICATE_REVOCATION_LIST                                              = "2.5.4.39"
  18953 	SzOID_CERTIFICATE_TEMPLATE                                                     = "1.3.6.1.4.1.311.21.7"
  18954 	SzOID_CERTSRV_CA_VERSION                                                       = "1.3.6.1.4.1.311.21.1"
  18955 	SzOID_CERTSRV_CROSSCA_VERSION                                                  = "1.3.6.1.4.1.311.21.22"
  18956 	SzOID_CERTSRV_PREVIOUS_CERT_HASH                                               = "1.3.6.1.4.1.311.21.2"
  18957 	SzOID_CERT_DISALLOWED_FILETIME_PROP_ID                                         = "1.3.6.1.4.1.311.10.11.104"
  18958 	SzOID_CERT_EXTENSIONS                                                          = "1.3.6.1.4.1.311.2.1.14"
  18959 	SzOID_CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID                               = "1.3.6.1.4.1.311.10.11.28"
  18960 	SzOID_CERT_KEY_IDENTIFIER_PROP_ID                                              = "1.3.6.1.4.1.311.10.11.20"
  18961 	SzOID_CERT_MANIFOLD                                                            = "1.3.6.1.4.1.311.20.3"
  18962 	SzOID_CERT_MD5_HASH_PROP_ID                                                    = "1.3.6.1.4.1.311.10.11.4"
  18963 	SzOID_CERT_POLICIES                                                            = "2.5.29.32"
  18964 	SzOID_CERT_POLICIES_95                                                         = "2.5.29.3"
  18965 	SzOID_CERT_POLICIES_95_QUALIFIER1                                              = "2.16.840.1.113733.1.7.1.1"
  18966 	SzOID_CERT_PROP_ID_PREFIX                                                      = "1.3.6.1.4.1.311.10.11."
  18967 	SzOID_CERT_SIGNATURE_HASH_PROP_ID                                              = "1.3.6.1.4.1.311.10.11.15"
  18968 	SzOID_CERT_STRONG_KEY_OS_1                                                     = "1.3.6.1.4.1.311.72.2.1"
  18969 	SzOID_CERT_STRONG_KEY_OS_PREFIX                                                = "1.3.6.1.4.1.311.72.2."
  18970 	SzOID_CERT_STRONG_SIGN_OS_1                                                    = "1.3.6.1.4.1.311.72.1.1"
  18971 	SzOID_CERT_STRONG_SIGN_OS_PREFIX                                               = "1.3.6.1.4.1.311.72.1."
  18972 	SzOID_CERT_SUBJECT_NAME_MD5_HASH_PROP_ID                                       = "1.3.6.1.4.1.311.10.11.29"
  18973 	SzOID_CMC                                                                      = "1.3.6.1.5.5.7.7"
  18974 	SzOID_CMC_ADD_ATTRIBUTES                                                       = "1.3.6.1.4.1.311.10.10.1"
  18975 	SzOID_CMC_ADD_EXTENSIONS                                                       = "1.3.6.1.5.5.7.7.8"
  18976 	SzOID_CMC_DATA_RETURN                                                          = "1.3.6.1.5.5.7.7.4"
  18977 	SzOID_CMC_DECRYPTED_POP                                                        = "1.3.6.1.5.5.7.7.10"
  18978 	SzOID_CMC_ENCRYPTED_POP                                                        = "1.3.6.1.5.5.7.7.9"
  18979 	SzOID_CMC_GET_CERT                                                             = "1.3.6.1.5.5.7.7.15"
  18980 	SzOID_CMC_GET_CRL                                                              = "1.3.6.1.5.5.7.7.16"
  18981 	SzOID_CMC_IDENTIFICATION                                                       = "1.3.6.1.5.5.7.7.2"
  18982 	SzOID_CMC_IDENTITY_PROOF                                                       = "1.3.6.1.5.5.7.7.3"
  18983 	SzOID_CMC_ID_CONFIRM_CERT_ACCEPTANCE                                           = "1.3.6.1.5.5.7.7.24"
  18984 	SzOID_CMC_ID_POP_LINK_RANDOM                                                   = "1.3.6.1.5.5.7.7.22"
  18985 	SzOID_CMC_ID_POP_LINK_WITNESS                                                  = "1.3.6.1.5.5.7.7.23"
  18986 	SzOID_CMC_LRA_POP_WITNESS                                                      = "1.3.6.1.5.5.7.7.11"
  18987 	SzOID_CMC_QUERY_PENDING                                                        = "1.3.6.1.5.5.7.7.21"
  18988 	SzOID_CMC_RECIPIENT_NONCE                                                      = "1.3.6.1.5.5.7.7.7"
  18989 	SzOID_CMC_REG_INFO                                                             = "1.3.6.1.5.5.7.7.18"
  18990 	SzOID_CMC_RESPONSE_INFO                                                        = "1.3.6.1.5.5.7.7.19"
  18991 	SzOID_CMC_REVOKE_REQUEST                                                       = "1.3.6.1.5.5.7.7.17"
  18992 	SzOID_CMC_SENDER_NONCE                                                         = "1.3.6.1.5.5.7.7.6"
  18993 	SzOID_CMC_STATUS_INFO                                                          = "1.3.6.1.5.5.7.7.1"
  18994 	SzOID_CMC_TRANSACTION_ID                                                       = "1.3.6.1.5.5.7.7.5"
  18995 	SzOID_CN_ECDSA_SHA256                                                          = "1.2.156.11235.1.1.1"
  18996 	SzOID_COMMON_NAME                                                              = "2.5.4.3"
  18997 	SzOID_COUNTRY_NAME                                                             = "2.5.4.6"
  18998 	SzOID_CRL_DIST_POINTS                                                          = "2.5.29.31"
  18999 	SzOID_CRL_NEXT_PUBLISH                                                         = "1.3.6.1.4.1.311.21.4"
  19000 	SzOID_CRL_NUMBER                                                               = "2.5.29.20"
  19001 	SzOID_CRL_REASON_CODE                                                          = "2.5.29.21"
  19002 	SzOID_CRL_SELF_CDP                                                             = "1.3.6.1.4.1.311.21.14"
  19003 	SzOID_CRL_VIRTUAL_BASE                                                         = "1.3.6.1.4.1.311.21.3"
  19004 	SzOID_CROSS_CERTIFICATE_PAIR                                                   = "2.5.4.40"
  19005 	SzOID_CROSS_CERT_DIST_POINTS                                                   = "1.3.6.1.4.1.311.10.9.1"
  19006 	SzOID_CTL                                                                      = "1.3.6.1.4.1.311.10.1"
  19007 	SzOID_CT_CERT_SCTLIST                                                          = "1.3.6.1.4.1.11129.2.4.2"
  19008 	SzOID_CT_PKI_DATA                                                              = "1.3.6.1.5.5.7.12.2"
  19009 	SzOID_CT_PKI_RESPONSE                                                          = "1.3.6.1.5.5.7.12.3"
  19010 	SzOID_DELTA_CRL_INDICATOR                                                      = "2.5.29.27"
  19011 	SzOID_DESCRIPTION                                                              = "2.5.4.13"
  19012 	SzOID_DESTINATION_INDICATOR                                                    = "2.5.4.27"
  19013 	SzOID_DEVICE_SERIAL_NUMBER                                                     = "2.5.4.5"
  19014 	SzOID_DH_SINGLE_PASS_STDDH_SHA1_KDF                                            = "1.3.133.16.840.63.0.2"
  19015 	SzOID_DH_SINGLE_PASS_STDDH_SHA256_KDF                                          = "1.3.132.1.11.1"
  19016 	SzOID_DH_SINGLE_PASS_STDDH_SHA384_KDF                                          = "1.3.132.1.11.2"
  19017 	SzOID_DISALLOWED_LIST                                                          = "1.3.6.1.4.1.311.10.3.30"
  19018 	SzOID_DN_QUALIFIER                                                             = "2.5.4.46"
  19019 	SzOID_DOMAIN_COMPONENT                                                         = "0.9.2342.19200300.100.1.25"
  19020 	SzOID_DRM                                                                      = "1.3.6.1.4.1.311.10.5.1"
  19021 	SzOID_DRM_INDIVIDUALIZATION                                                    = "1.3.6.1.4.1.311.10.5.2"
  19022 	SzOID_DS                                                                       = "2.5"
  19023 	SzOID_DSALG                                                                    = "2.5.8"
  19024 	SzOID_DSALG_CRPT                                                               = "2.5.8.1"
  19025 	SzOID_DSALG_HASH                                                               = "2.5.8.2"
  19026 	SzOID_DSALG_RSA                                                                = "2.5.8.1.1"
  19027 	SzOID_DSALG_SIGN                                                               = "2.5.8.3"
  19028 	SzOID_DS_EMAIL_REPLICATION                                                     = "1.3.6.1.4.1.311.21.19"
  19029 	SzOID_DYNAMIC_CODE_GEN_SIGNER                                                  = "1.3.6.1.4.1.311.76.5.1"
  19030 	SzOID_ECC_CURVE_BRAINPOOLP160R1                                                = "1.3.36.3.3.2.8.1.1.1"
  19031 	SzOID_ECC_CURVE_BRAINPOOLP160T1                                                = "1.3.36.3.3.2.8.1.1.2"
  19032 	SzOID_ECC_CURVE_BRAINPOOLP192R1                                                = "1.3.36.3.3.2.8.1.1.3"
  19033 	SzOID_ECC_CURVE_BRAINPOOLP192T1                                                = "1.3.36.3.3.2.8.1.1.4"
  19034 	SzOID_ECC_CURVE_BRAINPOOLP224R1                                                = "1.3.36.3.3.2.8.1.1.5"
  19035 	SzOID_ECC_CURVE_BRAINPOOLP224T1                                                = "1.3.36.3.3.2.8.1.1.6"
  19036 	SzOID_ECC_CURVE_BRAINPOOLP256R1                                                = "1.3.36.3.3.2.8.1.1.7"
  19037 	SzOID_ECC_CURVE_BRAINPOOLP256T1                                                = "1.3.36.3.3.2.8.1.1.8"
  19038 	SzOID_ECC_CURVE_BRAINPOOLP320R1                                                = "1.3.36.3.3.2.8.1.1.9"
  19039 	SzOID_ECC_CURVE_BRAINPOOLP320T1                                                = "1.3.36.3.3.2.8.1.1.10"
  19040 	SzOID_ECC_CURVE_BRAINPOOLP384R1                                                = "1.3.36.3.3.2.8.1.1.11"
  19041 	SzOID_ECC_CURVE_BRAINPOOLP384T1                                                = "1.3.36.3.3.2.8.1.1.12"
  19042 	SzOID_ECC_CURVE_BRAINPOOLP512R1                                                = "1.3.36.3.3.2.8.1.1.13"
  19043 	SzOID_ECC_CURVE_BRAINPOOLP512T1                                                = "1.3.36.3.3.2.8.1.1.14"
  19044 	SzOID_ECC_CURVE_EC192WAPI                                                      = "1.2.156.11235.1.1.2.1"
  19045 	SzOID_ECC_CURVE_NISTP192                                                       = "1.2.840.10045.3.1.1"
  19046 	SzOID_ECC_CURVE_NISTP224                                                       = "1.3.132.0.33"
  19047 	SzOID_ECC_CURVE_P256                                                           = "1.2.840.10045.3.1.7"
  19048 	SzOID_ECC_CURVE_P384                                                           = "1.3.132.0.34"
  19049 	SzOID_ECC_CURVE_P521                                                           = "1.3.132.0.35"
  19050 	SzOID_ECC_CURVE_SECP160K1                                                      = "1.3.132.0.9"
  19051 	SzOID_ECC_CURVE_SECP160R1                                                      = "1.3.132.0.8"
  19052 	SzOID_ECC_CURVE_SECP160R2                                                      = "1.3.132.0.30"
  19053 	SzOID_ECC_CURVE_SECP192K1                                                      = "1.3.132.0.31"
  19054 	SzOID_ECC_CURVE_SECP224K1                                                      = "1.3.132.0.32"
  19055 	SzOID_ECC_CURVE_SECP256K1                                                      = "1.3.132.0.10"
  19056 	SzOID_ECC_CURVE_WTLS9                                                          = "2.23.43.1.4.9"
  19057 	SzOID_ECC_CURVE_X962P192V1                                                     = "1.2.840.10045.3.1.1"
  19058 	SzOID_ECC_CURVE_X962P192V2                                                     = "1.2.840.10045.3.1.2"
  19059 	SzOID_ECC_CURVE_X962P192V3                                                     = "1.2.840.10045.3.1.3"
  19060 	SzOID_ECC_CURVE_X962P239V1                                                     = "1.2.840.10045.3.1.4"
  19061 	SzOID_ECC_CURVE_X962P239V2                                                     = "1.2.840.10045.3.1.5"
  19062 	SzOID_ECC_CURVE_X962P239V3                                                     = "1.2.840.10045.3.1.6"
  19063 	SzOID_ECC_PUBLIC_KEY                                                           = "1.2.840.10045.2.1"
  19064 	SzOID_ECDSA_SHA1                                                               = "1.2.840.10045.4.1"
  19065 	SzOID_ECDSA_SHA256                                                             = "1.2.840.10045.4.3.2"
  19066 	SzOID_ECDSA_SHA384                                                             = "1.2.840.10045.4.3.3"
  19067 	SzOID_ECDSA_SHA512                                                             = "1.2.840.10045.4.3.4"
  19068 	SzOID_ECDSA_SPECIFIED                                                          = "1.2.840.10045.4.3"
  19069 	SzOID_EFS_RECOVERY                                                             = "1.3.6.1.4.1.311.10.3.4.1"
  19070 	SzOID_EMBEDDED_NT_CRYPTO                                                       = "1.3.6.1.4.1.311.10.3.8"
  19071 	SzOID_ENCLAVE_SIGNING                                                          = "1.3.6.1.4.1.311.10.3.42"
  19072 	SzOID_ENCRYPTED_KEY_HASH                                                       = "1.3.6.1.4.1.311.21.21"
  19073 	SzOID_ENHANCED_KEY_USAGE                                                       = "2.5.29.37"
  19074 	SzOID_ENROLLMENT_AGENT                                                         = "1.3.6.1.4.1.311.20.2.1"
  19075 	SzOID_ENROLLMENT_CSP_PROVIDER                                                  = "1.3.6.1.4.1.311.13.2.2"
  19076 	SzOID_ENROLLMENT_NAME_VALUE_PAIR                                               = "1.3.6.1.4.1.311.13.2.1"
  19077 	SzOID_ENROLL_AIK_INFO                                                          = "1.3.6.1.4.1.311.21.39"
  19078 	SzOID_ENROLL_ATTESTATION_CHALLENGE                                             = "1.3.6.1.4.1.311.21.28"
  19079 	SzOID_ENROLL_ATTESTATION_STATEMENT                                             = "1.3.6.1.4.1.311.21.24"
  19080 	SzOID_ENROLL_CAXCHGCERT_HASH                                                   = "1.3.6.1.4.1.311.21.27"
  19081 	SzOID_ENROLL_CERTTYPE_EXTENSION                                                = "1.3.6.1.4.1.311.20.2"
  19082 	SzOID_ENROLL_EKPUB_CHALLENGE                                                   = "1.3.6.1.4.1.311.21.26"
  19083 	SzOID_ENROLL_EKVERIFYCERT                                                      = "1.3.6.1.4.1.311.21.31"
  19084 	SzOID_ENROLL_EKVERIFYCREDS                                                     = "1.3.6.1.4.1.311.21.32"
  19085 	SzOID_ENROLL_EKVERIFYKEY                                                       = "1.3.6.1.4.1.311.21.30"
  19086 	SzOID_ENROLL_EK_CA_KEYID                                                       = "1.3.6.1.4.1.311.21.43"
  19087 	SzOID_ENROLL_EK_INFO                                                           = "1.3.6.1.4.1.311.21.23"
  19088 	SzOID_ENROLL_ENCRYPTION_ALGORITHM                                              = "1.3.6.1.4.1.311.21.29"
  19089 	SzOID_ENROLL_KEY_AFFINITY                                                      = "1.3.6.1.4.1.311.21.41"
  19090 	SzOID_ENROLL_KSP_NAME                                                          = "1.3.6.1.4.1.311.21.25"
  19091 	SzOID_ENROLL_SCEP_CHALLENGE_ANSWER                                             = "1.3.6.1.4.1.311.21.35"
  19092 	SzOID_ENROLL_SCEP_CLIENT_REQUEST                                               = "1.3.6.1.4.1.311.21.37"
  19093 	SzOID_ENROLL_SCEP_ERROR                                                        = "1.3.6.1.4.1.311.21.33"
  19094 	SzOID_ENROLL_SCEP_SERVER_MESSAGE                                               = "1.3.6.1.4.1.311.21.38"
  19095 	SzOID_ENROLL_SCEP_SERVER_SECRET                                                = "1.3.6.1.4.1.311.21.40"
  19096 	SzOID_ENROLL_SCEP_SERVER_STATE                                                 = "1.3.6.1.4.1.311.21.34"
  19097 	SzOID_ENROLL_SCEP_SIGNER_HASH                                                  = "1.3.6.1.4.1.311.21.42"
  19098 	SzOID_ENTERPRISE_OID_ROOT                                                      = "1.3.6.1.4.1.311.21.8"
  19099 	SzOID_EV_RDN_COUNTRY                                                           = "1.3.6.1.4.1.311.60.2.1.3"
  19100 	SzOID_EV_RDN_LOCALE                                                            = "1.3.6.1.4.1.311.60.2.1.1"
  19101 	SzOID_EV_RDN_STATE_OR_PROVINCE                                                 = "1.3.6.1.4.1.311.60.2.1.2"
  19102 	SzOID_EV_WHQL_CRYPTO                                                           = "1.3.6.1.4.1.311.10.3.39"
  19103 	SzOID_FACSIMILE_TELEPHONE_NUMBER                                               = "2.5.4.23"
  19104 	SzOID_FRESHEST_CRL                                                             = "2.5.29.46"
  19105 	SzOID_GIVEN_NAME                                                               = "2.5.4.42"
  19106 	SzOID_HPKP_DOMAIN_NAME_CTL                                                     = "1.3.6.1.4.1.311.10.3.60"
  19107 	SzOID_HPKP_HEADER_VALUE_CTL                                                    = "1.3.6.1.4.1.311.10.3.61"
  19108 	SzOID_INFOSEC                                                                  = "2.16.840.1.101.2.1"
  19109 	SzOID_INFOSEC_SuiteAConfidentiality                                            = "2.16.840.1.101.2.1.1.14"
  19110 	SzOID_INFOSEC_SuiteAIntegrity                                                  = "2.16.840.1.101.2.1.1.15"
  19111 	SzOID_INFOSEC_SuiteAKMandSig                                                   = "2.16.840.1.101.2.1.1.18"
  19112 	SzOID_INFOSEC_SuiteAKeyManagement                                              = "2.16.840.1.101.2.1.1.17"
  19113 	SzOID_INFOSEC_SuiteASignature                                                  = "2.16.840.1.101.2.1.1.13"
  19114 	SzOID_INFOSEC_SuiteATokenProtection                                            = "2.16.840.1.101.2.1.1.16"
  19115 	SzOID_INFOSEC_mosaicConfidentiality                                            = "2.16.840.1.101.2.1.1.4"
  19116 	SzOID_INFOSEC_mosaicIntegrity                                                  = "2.16.840.1.101.2.1.1.6"
  19117 	SzOID_INFOSEC_mosaicKMandSig                                                   = "2.16.840.1.101.2.1.1.12"
  19118 	SzOID_INFOSEC_mosaicKMandUpdSig                                                = "2.16.840.1.101.2.1.1.20"
  19119 	SzOID_INFOSEC_mosaicKeyManagement                                              = "2.16.840.1.101.2.1.1.10"
  19120 	SzOID_INFOSEC_mosaicSignature                                                  = "2.16.840.1.101.2.1.1.2"
  19121 	SzOID_INFOSEC_mosaicTokenProtection                                            = "2.16.840.1.101.2.1.1.8"
  19122 	SzOID_INFOSEC_mosaicUpdatedInteg                                               = "2.16.840.1.101.2.1.1.21"
  19123 	SzOID_INFOSEC_mosaicUpdatedSig                                                 = "2.16.840.1.101.2.1.1.19"
  19124 	SzOID_INFOSEC_sdnsConfidentiality                                              = "2.16.840.1.101.2.1.1.3"
  19125 	SzOID_INFOSEC_sdnsIntegrity                                                    = "2.16.840.1.101.2.1.1.5"
  19126 	SzOID_INFOSEC_sdnsKMandSig                                                     = "2.16.840.1.101.2.1.1.11"
  19127 	SzOID_INFOSEC_sdnsKeyManagement                                                = "2.16.840.1.101.2.1.1.9"
  19128 	SzOID_INFOSEC_sdnsSignature                                                    = "2.16.840.1.101.2.1.1.1"
  19129 	SzOID_INFOSEC_sdnsTokenProtection                                              = "2.16.840.1.101.2.1.1.7"
  19130 	SzOID_INHIBIT_ANY_POLICY                                                       = "2.5.29.54"
  19131 	SzOID_INITIALS                                                                 = "2.5.4.43"
  19132 	SzOID_INTERNATIONALIZED_EMAIL_ADDRESS                                          = "1.3.6.1.4.1.311.20.2.4"
  19133 	SzOID_INTERNATIONAL_ISDN_NUMBER                                                = "2.5.4.25"
  19134 	SzOID_IPSEC_KP_IKE_INTERMEDIATE                                                = "1.3.6.1.5.5.8.2.2"
  19135 	SzOID_ISSUED_CERT_HASH                                                         = "1.3.6.1.4.1.311.21.17"
  19136 	SzOID_ISSUER_ALT_NAME                                                          = "2.5.29.8"
  19137 	SzOID_ISSUER_ALT_NAME2                                                         = "2.5.29.18"
  19138 	SzOID_ISSUING_DIST_POINT                                                       = "2.5.29.28"
  19139 	SzOID_IUM_SIGNING                                                              = "1.3.6.1.4.1.311.10.3.37"
  19140 	SzOID_KEYID_RDN                                                                = "1.3.6.1.4.1.311.10.7.1"
  19141 	SzOID_KEY_ATTRIBUTES                                                           = "2.5.29.2"
  19142 	SzOID_KEY_USAGE                                                                = "2.5.29.15"
  19143 	SzOID_KEY_USAGE_RESTRICTION                                                    = "2.5.29.4"
  19144 	SzOID_KP_CA_EXCHANGE                                                           = "1.3.6.1.4.1.311.21.5"
  19145 	SzOID_KP_CSP_SIGNATURE                                                         = "1.3.6.1.4.1.311.10.3.16"
  19146 	SzOID_KP_CTL_USAGE_SIGNING                                                     = "1.3.6.1.4.1.311.10.3.1"
  19147 	SzOID_KP_DOCUMENT_SIGNING                                                      = "1.3.6.1.4.1.311.10.3.12"
  19148 	SzOID_KP_EFS                                                                   = "1.3.6.1.4.1.311.10.3.4"
  19149 	SzOID_KP_FLIGHT_SIGNING                                                        = "1.3.6.1.4.1.311.10.3.27"
  19150 	SzOID_KP_KERNEL_MODE_CODE_SIGNING                                              = "1.3.6.1.4.1.311.61.1.1"
  19151 	SzOID_KP_KERNEL_MODE_HAL_EXTENSION_SIGNING                                     = "1.3.6.1.4.1.311.61.5.1"
  19152 	SzOID_KP_KERNEL_MODE_TRUSTED_BOOT_SIGNING                                      = "1.3.6.1.4.1.311.61.4.1"
  19153 	SzOID_KP_KEY_RECOVERY                                                          = "1.3.6.1.4.1.311.10.3.11"
  19154 	SzOID_KP_KEY_RECOVERY_AGENT                                                    = "1.3.6.1.4.1.311.21.6"
  19155 	SzOID_KP_LIFETIME_SIGNING                                                      = "1.3.6.1.4.1.311.10.3.13"
  19156 	SzOID_KP_MOBILE_DEVICE_SOFTWARE                                                = "1.3.6.1.4.1.311.10.3.14"
  19157 	SzOID_KP_QUALIFIED_SUBORDINATION                                               = "1.3.6.1.4.1.311.10.3.10"
  19158 	SzOID_KP_SMARTCARD_LOGON                                                       = "1.3.6.1.4.1.311.20.2.2"
  19159 	SzOID_KP_SMART_DISPLAY                                                         = "1.3.6.1.4.1.311.10.3.15"
  19160 	SzOID_KP_TIME_STAMP_SIGNING                                                    = "1.3.6.1.4.1.311.10.3.2"
  19161 	SzOID_KP_TPM_AIK_CERTIFICATE                                                   = "2.23.133.8.3"
  19162 	SzOID_KP_TPM_EK_CERTIFICATE                                                    = "2.23.133.8.1"
  19163 	SzOID_KP_TPM_PLATFORM_CERTIFICATE                                              = "2.23.133.8.2"
  19164 	SzOID_LEGACY_POLICY_MAPPINGS                                                   = "2.5.29.5"
  19165 	SzOID_LICENSES                                                                 = "1.3.6.1.4.1.311.10.6.1"
  19166 	SzOID_LICENSE_SERVER                                                           = "1.3.6.1.4.1.311.10.6.2"
  19167 	SzOID_LOCALITY_NAME                                                            = "2.5.4.7"
  19168 	SzOID_LOCAL_MACHINE_KEYSET                                                     = "1.3.6.1.4.1.311.17.2"
  19169 	SzOID_LOGOTYPE_EXT                                                             = "1.3.6.1.5.5.7.1.12"
  19170 	SzOID_LOYALTY_OTHER_LOGOTYPE                                                   = "1.3.6.1.5.5.7.20.1"
  19171 	SzOID_MEMBER                                                                   = "2.5.4.31"
  19172 	SzOID_MICROSOFT_PUBLISHER_SIGNER                                               = "1.3.6.1.4.1.311.76.8.1"
  19173 	SzOID_NAME_CONSTRAINTS                                                         = "2.5.29.30"
  19174 	SzOID_NETSCAPE                                                                 = "2.16.840.1.113730"
  19175 	SzOID_NETSCAPE_BASE_URL                                                        = "2.16.840.1.113730.1.2"
  19176 	SzOID_NETSCAPE_CA_POLICY_URL                                                   = "2.16.840.1.113730.1.8"
  19177 	SzOID_NETSCAPE_CA_REVOCATION_URL                                               = "2.16.840.1.113730.1.4"
  19178 	SzOID_NETSCAPE_CERT_EXTENSION                                                  = "2.16.840.1.113730.1"
  19179 	SzOID_NETSCAPE_CERT_RENEWAL_URL                                                = "2.16.840.1.113730.1.7"
  19180 	SzOID_NETSCAPE_CERT_SEQUENCE                                                   = "2.16.840.1.113730.2.5"
  19181 	SzOID_NETSCAPE_CERT_TYPE                                                       = "2.16.840.1.113730.1.1"
  19182 	SzOID_NETSCAPE_COMMENT                                                         = "2.16.840.1.113730.1.13"
  19183 	SzOID_NETSCAPE_DATA_TYPE                                                       = "2.16.840.1.113730.2"
  19184 	SzOID_NETSCAPE_REVOCATION_URL                                                  = "2.16.840.1.113730.1.3"
  19185 	SzOID_NETSCAPE_SSL_SERVER_NAME                                                 = "2.16.840.1.113730.1.12"
  19186 	SzOID_NEXT_UPDATE_LOCATION                                                     = "1.3.6.1.4.1.311.10.2"
  19187 	SzOID_NIST_AES128_CBC                                                          = "2.16.840.1.101.3.4.1.2"
  19188 	SzOID_NIST_AES128_WRAP                                                         = "2.16.840.1.101.3.4.1.5"
  19189 	SzOID_NIST_AES192_CBC                                                          = "2.16.840.1.101.3.4.1.22"
  19190 	SzOID_NIST_AES192_WRAP                                                         = "2.16.840.1.101.3.4.1.25"
  19191 	SzOID_NIST_AES256_CBC                                                          = "2.16.840.1.101.3.4.1.42"
  19192 	SzOID_NIST_AES256_WRAP                                                         = "2.16.840.1.101.3.4.1.45"
  19193 	SzOID_NIST_sha256                                                              = "2.16.840.1.101.3.4.2.1"
  19194 	SzOID_NIST_sha384                                                              = "2.16.840.1.101.3.4.2.2"
  19195 	SzOID_NIST_sha512                                                              = "2.16.840.1.101.3.4.2.3"
  19196 	SzOID_NT5_CRYPTO                                                               = "1.3.6.1.4.1.311.10.3.6"
  19197 	SzOID_NTDS_REPLICATION                                                         = "1.3.6.1.4.1.311.25.1"
  19198 	SzOID_NT_PRINCIPAL_NAME                                                        = "1.3.6.1.4.1.311.20.2.3"
  19199 	SzOID_OEM_WHQL_CRYPTO                                                          = "1.3.6.1.4.1.311.10.3.7"
  19200 	SzOID_OIW                                                                      = "1.3.14"
  19201 	SzOID_OIWDIR                                                                   = "1.3.14.7.2"
  19202 	SzOID_OIWDIR_CRPT                                                              = "1.3.14.7.2.1"
  19203 	SzOID_OIWDIR_HASH                                                              = "1.3.14.7.2.2"
  19204 	SzOID_OIWDIR_SIGN                                                              = "1.3.14.7.2.3"
  19205 	SzOID_OIWDIR_md2                                                               = "1.3.14.7.2.2.1"
  19206 	SzOID_OIWDIR_md2RSA                                                            = "1.3.14.7.2.3.1"
  19207 	SzOID_OIWSEC                                                                   = "1.3.14.3.2"
  19208 	SzOID_OIWSEC_desCBC                                                            = "1.3.14.3.2.7"
  19209 	SzOID_OIWSEC_desCFB                                                            = "1.3.14.3.2.9"
  19210 	SzOID_OIWSEC_desECB                                                            = "1.3.14.3.2.6"
  19211 	SzOID_OIWSEC_desEDE                                                            = "1.3.14.3.2.17"
  19212 	SzOID_OIWSEC_desMAC                                                            = "1.3.14.3.2.10"
  19213 	SzOID_OIWSEC_desOFB                                                            = "1.3.14.3.2.8"
  19214 	SzOID_OIWSEC_dhCommMod                                                         = "1.3.14.3.2.16"
  19215 	SzOID_OIWSEC_dsa                                                               = "1.3.14.3.2.12"
  19216 	SzOID_OIWSEC_dsaComm                                                           = "1.3.14.3.2.20"
  19217 	SzOID_OIWSEC_dsaCommSHA                                                        = "1.3.14.3.2.21"
  19218 	SzOID_OIWSEC_dsaCommSHA1                                                       = "1.3.14.3.2.28"
  19219 	SzOID_OIWSEC_dsaSHA1                                                           = "1.3.14.3.2.27"
  19220 	SzOID_OIWSEC_keyHashSeal                                                       = "1.3.14.3.2.23"
  19221 	SzOID_OIWSEC_md2RSASign                                                        = "1.3.14.3.2.24"
  19222 	SzOID_OIWSEC_md4RSA                                                            = "1.3.14.3.2.2"
  19223 	SzOID_OIWSEC_md4RSA2                                                           = "1.3.14.3.2.4"
  19224 	SzOID_OIWSEC_md5RSA                                                            = "1.3.14.3.2.3"
  19225 	SzOID_OIWSEC_md5RSASign                                                        = "1.3.14.3.2.25"
  19226 	SzOID_OIWSEC_mdc2                                                              = "1.3.14.3.2.19"
  19227 	SzOID_OIWSEC_mdc2RSA                                                           = "1.3.14.3.2.14"
  19228 	SzOID_OIWSEC_rsaSign                                                           = "1.3.14.3.2.11"
  19229 	SzOID_OIWSEC_rsaXchg                                                           = "1.3.14.3.2.22"
  19230 	SzOID_OIWSEC_sha                                                               = "1.3.14.3.2.18"
  19231 	SzOID_OIWSEC_sha1                                                              = "1.3.14.3.2.26"
  19232 	SzOID_OIWSEC_sha1RSASign                                                       = "1.3.14.3.2.29"
  19233 	SzOID_OIWSEC_shaDSA                                                            = "1.3.14.3.2.13"
  19234 	SzOID_OIWSEC_shaRSA                                                            = "1.3.14.3.2.15"
  19235 	SzOID_ORGANIZATIONAL_UNIT_NAME                                                 = "2.5.4.11"
  19236 	SzOID_ORGANIZATION_NAME                                                        = "2.5.4.10"
  19237 	SzOID_OS_VERSION                                                               = "1.3.6.1.4.1.311.13.2.3"
  19238 	SzOID_OWNER                                                                    = "2.5.4.32"
  19239 	SzOID_PHYSICAL_DELIVERY_OFFICE_NAME                                            = "2.5.4.19"
  19240 	SzOID_PIN_RULES_CTL                                                            = "1.3.6.1.4.1.311.10.3.32"
  19241 	SzOID_PIN_RULES_DOMAIN_NAME                                                    = "1.3.6.1.4.1.311.10.3.34"
  19242 	SzOID_PIN_RULES_EXT                                                            = "1.3.6.1.4.1.311.10.3.33"
  19243 	SzOID_PIN_RULES_LOG_END_DATE_EXT                                               = "1.3.6.1.4.1.311.10.3.35"
  19244 	SzOID_PIN_RULES_SIGNER                                                         = "1.3.6.1.4.1.311.10.3.31"
  19245 	SzOID_PKCS                                                                     = "1.2.840.113549.1"
  19246 	SzOID_PKCS_1                                                                   = "1.2.840.113549.1.1"
  19247 	SzOID_PKCS_10                                                                  = "1.2.840.113549.1.10"
  19248 	SzOID_PKCS_12                                                                  = "1.2.840.113549.1.12"
  19249 	SzOID_PKCS_12_EXTENDED_ATTRIBUTES                                              = "1.3.6.1.4.1.311.17.3"
  19250 	SzOID_PKCS_12_FRIENDLY_NAME_ATTR                                               = "1.2.840.113549.1.9.20"
  19251 	SzOID_PKCS_12_KEY_PROVIDER_NAME_ATTR                                           = "1.3.6.1.4.1.311.17.1"
  19252 	SzOID_PKCS_12_LOCAL_KEY_ID                                                     = "1.2.840.113549.1.9.21"
  19253 	SzOID_PKCS_12_PROTECTED_PASSWORD_SECRET_BAG_TYPE_ID                            = "1.3.6.1.4.1.311.17.4"
  19254 	SzOID_PKCS_12_PbeIds                                                           = "1.2.840.113549.1.12.1"
  19255 	SzOID_PKCS_12_pbeWithSHA1And128BitRC2                                          = "1.2.840.113549.1.12.1.5"
  19256 	SzOID_PKCS_12_pbeWithSHA1And128BitRC4                                          = "1.2.840.113549.1.12.1.1"
  19257 	SzOID_PKCS_12_pbeWithSHA1And2KeyTripleDES                                      = "1.2.840.113549.1.12.1.4"
  19258 	SzOID_PKCS_12_pbeWithSHA1And3KeyTripleDES                                      = "1.2.840.113549.1.12.1.3"
  19259 	SzOID_PKCS_12_pbeWithSHA1And40BitRC2                                           = "1.2.840.113549.1.12.1.6"
  19260 	SzOID_PKCS_12_pbeWithSHA1And40BitRC4                                           = "1.2.840.113549.1.12.1.2"
  19261 	SzOID_PKCS_2                                                                   = "1.2.840.113549.1.2"
  19262 	SzOID_PKCS_3                                                                   = "1.2.840.113549.1.3"
  19263 	SzOID_PKCS_4                                                                   = "1.2.840.113549.1.4"
  19264 	SzOID_PKCS_5                                                                   = "1.2.840.113549.1.5"
  19265 	SzOID_PKCS_5_PBES2                                                             = "1.2.840.113549.1.5.13"
  19266 	SzOID_PKCS_5_PBKDF2                                                            = "1.2.840.113549.1.5.12"
  19267 	SzOID_PKCS_6                                                                   = "1.2.840.113549.1.6"
  19268 	SzOID_PKCS_7                                                                   = "1.2.840.113549.1.7"
  19269 	SzOID_PKCS_7_DATA                                                              = "1.2.840.113549.1.7.1"
  19270 	SzOID_PKCS_7_DIGESTED                                                          = "1.2.840.113549.1.7.5"
  19271 	SzOID_PKCS_7_ENCRYPTED                                                         = "1.2.840.113549.1.7.6"
  19272 	SzOID_PKCS_7_ENVELOPED                                                         = "1.2.840.113549.1.7.3"
  19273 	SzOID_PKCS_7_SIGNED                                                            = "1.2.840.113549.1.7.2"
  19274 	SzOID_PKCS_7_SIGNEDANDENVELOPED                                                = "1.2.840.113549.1.7.4"
  19275 	SzOID_PKCS_8                                                                   = "1.2.840.113549.1.8"
  19276 	SzOID_PKCS_9                                                                   = "1.2.840.113549.1.9"
  19277 	SzOID_PKCS_9_CONTENT_TYPE                                                      = "1.2.840.113549.1.9.3"
  19278 	SzOID_PKCS_9_MESSAGE_DIGEST                                                    = "1.2.840.113549.1.9.4"
  19279 	SzOID_PKINIT_KP_KDC                                                            = "1.3.6.1.5.2.3.5"
  19280 	SzOID_PKIX                                                                     = "1.3.6.1.5.5.7"
  19281 	SzOID_PKIX_ACC_DESCR                                                           = "1.3.6.1.5.5.7.48"
  19282 	SzOID_PKIX_CA_ISSUERS                                                          = "1.3.6.1.5.5.7.48.2"
  19283 	SzOID_PKIX_CA_REPOSITORY                                                       = "1.3.6.1.5.5.7.48.5"
  19284 	SzOID_PKIX_KP                                                                  = "1.3.6.1.5.5.7.3"
  19285 	SzOID_PKIX_KP_CLIENT_AUTH                                                      = "1.3.6.1.5.5.7.3.2"
  19286 	SzOID_PKIX_KP_CODE_SIGNING                                                     = "1.3.6.1.5.5.7.3.3"
  19287 	SzOID_PKIX_KP_EMAIL_PROTECTION                                                 = "1.3.6.1.5.5.7.3.4"
  19288 	SzOID_PKIX_KP_IPSEC_END_SYSTEM                                                 = "1.3.6.1.5.5.7.3.5"
  19289 	SzOID_PKIX_KP_IPSEC_TUNNEL                                                     = "1.3.6.1.5.5.7.3.6"
  19290 	SzOID_PKIX_KP_IPSEC_USER                                                       = "1.3.6.1.5.5.7.3.7"
  19291 	SzOID_PKIX_KP_OCSP_SIGNING                                                     = "1.3.6.1.5.5.7.3.9"
  19292 	SzOID_PKIX_KP_SERVER_AUTH                                                      = "1.3.6.1.5.5.7.3.1"
  19293 	SzOID_PKIX_KP_TIMESTAMP_SIGNING                                                = "1.3.6.1.5.5.7.3.8"
  19294 	SzOID_PKIX_NO_SIGNATURE                                                        = "1.3.6.1.5.5.7.6.2"
  19295 	SzOID_PKIX_OCSP                                                                = "1.3.6.1.5.5.7.48.1"
  19296 	SzOID_PKIX_OCSP_BASIC_SIGNED_RESPONSE                                          = "1.3.6.1.5.5.7.48.1.1"
  19297 	SzOID_PKIX_OCSP_NOCHECK                                                        = "1.3.6.1.5.5.7.48.1.5"
  19298 	SzOID_PKIX_OCSP_NONCE                                                          = "1.3.6.1.5.5.7.48.1.2"
  19299 	SzOID_PKIX_PE                                                                  = "1.3.6.1.5.5.7.1"
  19300 	SzOID_PKIX_POLICY_QUALIFIER_CPS                                                = "1.3.6.1.5.5.7.2.1"
  19301 	SzOID_PKIX_POLICY_QUALIFIER_USERNOTICE                                         = "1.3.6.1.5.5.7.2.2"
  19302 	SzOID_PKIX_TIME_STAMPING                                                       = "1.3.6.1.5.5.7.48.3"
  19303 	SzOID_PLATFORM_MANIFEST_BINARY_ID                                              = "1.3.6.1.4.1.311.10.3.28"
  19304 	SzOID_POLICY_CONSTRAINTS                                                       = "2.5.29.36"
  19305 	SzOID_POLICY_MAPPINGS                                                          = "2.5.29.33"
  19306 	SzOID_POSTAL_ADDRESS                                                           = "2.5.4.16"
  19307 	SzOID_POSTAL_CODE                                                              = "2.5.4.17"
  19308 	SzOID_POST_OFFICE_BOX                                                          = "2.5.4.18"
  19309 	SzOID_PREFERRED_DELIVERY_METHOD                                                = "2.5.4.28"
  19310 	SzOID_PRESENTATION_ADDRESS                                                     = "2.5.4.29"
  19311 	SzOID_PRIVATEKEY_USAGE_PERIOD                                                  = "2.5.29.16"
  19312 	SzOID_PRODUCT_UPDATE                                                           = "1.3.6.1.4.1.311.31.1"
  19313 	SzOID_PROTECTED_PROCESS_LIGHT_SIGNER                                           = "1.3.6.1.4.1.311.10.3.22"
  19314 	SzOID_PROTECTED_PROCESS_SIGNER                                                 = "1.3.6.1.4.1.311.10.3.24"
  19315 	SzOID_QC_EU_COMPLIANCE                                                         = "0.4.0.1862.1.1"
  19316 	SzOID_QC_SSCD                                                                  = "0.4.0.1862.1.4"
  19317 	SzOID_QC_STATEMENTS_EXT                                                        = "1.3.6.1.5.5.7.1.3"
  19318 	SzOID_RDN_DUMMY_SIGNER                                                         = "1.3.6.1.4.1.311.21.9"
  19319 	SzOID_RDN_TCG_PLATFORM_MANUFACTURER                                            = "2.23.133.2.4"
  19320 	SzOID_RDN_TCG_PLATFORM_MODEL                                                   = "2.23.133.2.5"
  19321 	SzOID_RDN_TCG_PLATFORM_VERSION                                                 = "2.23.133.2.6"
  19322 	SzOID_RDN_TPM_MANUFACTURER                                                     = "2.23.133.2.1"
  19323 	SzOID_RDN_TPM_MODEL                                                            = "2.23.133.2.2"
  19324 	SzOID_RDN_TPM_VERSION                                                          = "2.23.133.2.3"
  19325 	SzOID_REASON_CODE_HOLD                                                         = "2.5.29.23"
  19326 	SzOID_REGISTERED_ADDRESS                                                       = "2.5.4.26"
  19327 	SzOID_REMOVE_CERTIFICATE                                                       = "1.3.6.1.4.1.311.10.8.1"
  19328 	SzOID_RENEWAL_CERTIFICATE                                                      = "1.3.6.1.4.1.311.13.1"
  19329 	SzOID_REQUEST_CLIENT_INFO                                                      = "1.3.6.1.4.1.311.21.20"
  19330 	SzOID_REQUIRE_CERT_CHAIN_POLICY                                                = "1.3.6.1.4.1.311.21.15"
  19331 	SzOID_REVOKED_LIST_SIGNER                                                      = "1.3.6.1.4.1.311.10.3.19"
  19332 	SzOID_RFC3161_counterSign                                                      = "1.3.6.1.4.1.311.3.3.1"
  19333 	SzOID_ROLE_OCCUPANT                                                            = "2.5.4.33"
  19334 	SzOID_ROOT_LIST_SIGNER                                                         = "1.3.6.1.4.1.311.10.3.9"
  19335 	SzOID_ROOT_PROGRAM_AUTO_UPDATE_CA_REVOCATION                                   = "1.3.6.1.4.1.311.60.3.1"
  19336 	SzOID_ROOT_PROGRAM_AUTO_UPDATE_END_REVOCATION                                  = "1.3.6.1.4.1.311.60.3.2"
  19337 	SzOID_ROOT_PROGRAM_FLAGS                                                       = "1.3.6.1.4.1.311.60.1.1"
  19338 	SzOID_ROOT_PROGRAM_NO_OCSP_FAILOVER_TO_CRL                                     = "1.3.6.1.4.1.311.60.3.3"
  19339 	SzOID_RSA                                                                      = "1.2.840.113549"
  19340 	SzOID_RSAES_OAEP                                                               = "1.2.840.113549.1.1.7"
  19341 	SzOID_RSA_DES_EDE3_CBC                                                         = "1.2.840.113549.3.7"
  19342 	SzOID_RSA_DH                                                                   = "1.2.840.113549.1.3.1"
  19343 	SzOID_RSA_ENCRYPT                                                              = "1.2.840.113549.3"
  19344 	SzOID_RSA_HASH                                                                 = "1.2.840.113549.2"
  19345 	SzOID_RSA_MD2                                                                  = "1.2.840.113549.2.2"
  19346 	SzOID_RSA_MD2RSA                                                               = "1.2.840.113549.1.1.2"
  19347 	SzOID_RSA_MD4                                                                  = "1.2.840.113549.2.4"
  19348 	SzOID_RSA_MD4RSA                                                               = "1.2.840.113549.1.1.3"
  19349 	SzOID_RSA_MD5                                                                  = "1.2.840.113549.2.5"
  19350 	SzOID_RSA_MD5RSA                                                               = "1.2.840.113549.1.1.4"
  19351 	SzOID_RSA_MGF1                                                                 = "1.2.840.113549.1.1.8"
  19352 	SzOID_RSA_PSPECIFIED                                                           = "1.2.840.113549.1.1.9"
  19353 	SzOID_RSA_RC2CBC                                                               = "1.2.840.113549.3.2"
  19354 	SzOID_RSA_RC4                                                                  = "1.2.840.113549.3.4"
  19355 	SzOID_RSA_RC5_CBCPad                                                           = "1.2.840.113549.3.9"
  19356 	SzOID_RSA_RSA                                                                  = "1.2.840.113549.1.1.1"
  19357 	SzOID_RSA_SETOAEP_RSA                                                          = "1.2.840.113549.1.1.6"
  19358 	SzOID_RSA_SHA1RSA                                                              = "1.2.840.113549.1.1.5"
  19359 	SzOID_RSA_SHA256RSA                                                            = "1.2.840.113549.1.1.11"
  19360 	SzOID_RSA_SHA384RSA                                                            = "1.2.840.113549.1.1.12"
  19361 	SzOID_RSA_SHA512RSA                                                            = "1.2.840.113549.1.1.13"
  19362 	SzOID_RSA_SMIMECapabilities                                                    = "1.2.840.113549.1.9.15"
  19363 	SzOID_RSA_SMIMEalg                                                             = "1.2.840.113549.1.9.16.3"
  19364 	SzOID_RSA_SMIMEalgCMS3DESwrap                                                  = "1.2.840.113549.1.9.16.3.6"
  19365 	SzOID_RSA_SMIMEalgCMSRC2wrap                                                   = "1.2.840.113549.1.9.16.3.7"
  19366 	SzOID_RSA_SMIMEalgESDH                                                         = "1.2.840.113549.1.9.16.3.5"
  19367 	SzOID_RSA_SSA_PSS                                                              = "1.2.840.113549.1.1.10"
  19368 	SzOID_RSA_certExtensions                                                       = "1.2.840.113549.1.9.14"
  19369 	SzOID_RSA_challengePwd                                                         = "1.2.840.113549.1.9.7"
  19370 	SzOID_RSA_contentType                                                          = "1.2.840.113549.1.9.3"
  19371 	SzOID_RSA_counterSign                                                          = "1.2.840.113549.1.9.6"
  19372 	SzOID_RSA_data                                                                 = "1.2.840.113549.1.7.1"
  19373 	SzOID_RSA_digestedData                                                         = "1.2.840.113549.1.7.5"
  19374 	SzOID_RSA_emailAddr                                                            = "1.2.840.113549.1.9.1"
  19375 	SzOID_RSA_encryptedData                                                        = "1.2.840.113549.1.7.6"
  19376 	SzOID_RSA_envelopedData                                                        = "1.2.840.113549.1.7.3"
  19377 	SzOID_RSA_extCertAttrs                                                         = "1.2.840.113549.1.9.9"
  19378 	SzOID_RSA_hashedData                                                           = "1.2.840.113549.1.7.5"
  19379 	SzOID_RSA_messageDigest                                                        = "1.2.840.113549.1.9.4"
  19380 	SzOID_RSA_preferSignedData                                                     = "1.2.840.113549.1.9.15.1"
  19381 	SzOID_RSA_signEnvData                                                          = "1.2.840.113549.1.7.4"
  19382 	SzOID_RSA_signedData                                                           = "1.2.840.113549.1.7.2"
  19383 	SzOID_RSA_signingTime                                                          = "1.2.840.113549.1.9.5"
  19384 	SzOID_RSA_unstructAddr                                                         = "1.2.840.113549.1.9.8"
  19385 	SzOID_RSA_unstructName                                                         = "1.2.840.113549.1.9.2"
  19386 	SzOID_SEARCH_GUIDE                                                             = "2.5.4.14"
  19387 	SzOID_SEE_ALSO                                                                 = "2.5.4.34"
  19388 	SzOID_SERIALIZED                                                               = "1.3.6.1.4.1.311.10.3.3.1"
  19389 	SzOID_SERVER_GATED_CRYPTO                                                      = "1.3.6.1.4.1.311.10.3.3"
  19390 	SzOID_SGC_NETSCAPE                                                             = "2.16.840.1.113730.4.1"
  19391 	SzOID_SITE_PIN_RULES_FLAGS_ATTR                                                = "1.3.6.1.4.1.311.10.4.3"
  19392 	SzOID_SITE_PIN_RULES_INDEX_ATTR                                                = "1.3.6.1.4.1.311.10.4.2"
  19393 	SzOID_SORTED_CTL                                                               = "1.3.6.1.4.1.311.10.1.1"
  19394 	SzOID_STATE_OR_PROVINCE_NAME                                                   = "2.5.4.8"
  19395 	SzOID_STREET_ADDRESS                                                           = "2.5.4.9"
  19396 	SzOID_SUBJECT_ALT_NAME                                                         = "2.5.29.7"
  19397 	SzOID_SUBJECT_ALT_NAME2                                                        = "2.5.29.17"
  19398 	SzOID_SUBJECT_DIR_ATTRS                                                        = "2.5.29.9"
  19399 	SzOID_SUBJECT_INFO_ACCESS                                                      = "1.3.6.1.5.5.7.1.11"
  19400 	SzOID_SUBJECT_KEY_IDENTIFIER                                                   = "2.5.29.14"
  19401 	SzOID_SUPPORTED_APPLICATION_CONTEXT                                            = "2.5.4.30"
  19402 	SzOID_SUR_NAME                                                                 = "2.5.4.4"
  19403 	SzOID_SYNC_ROOT_CTL_EXT                                                        = "1.3.6.1.4.1.311.10.3.50"
  19404 	SzOID_TELEPHONE_NUMBER                                                         = "2.5.4.20"
  19405 	SzOID_TELETEXT_TERMINAL_IDENTIFIER                                             = "2.5.4.22"
  19406 	SzOID_TELEX_NUMBER                                                             = "2.5.4.21"
  19407 	SzOID_TIMESTAMP_TOKEN                                                          = "1.2.840.113549.1.9.16.1.4"
  19408 	SzOID_TITLE                                                                    = "2.5.4.12"
  19409 	SzOID_TLS_FEATURES_EXT                                                         = "1.3.6.1.5.5.7.1.24"
  19410 	SzOID_USER_CERTIFICATE                                                         = "2.5.4.36"
  19411 	SzOID_USER_PASSWORD                                                            = "2.5.4.35"
  19412 	SzOID_VERISIGN_BITSTRING_6_13                                                  = "2.16.840.1.113733.1.6.13"
  19413 	SzOID_VERISIGN_ISS_STRONG_CRYPTO                                               = "2.16.840.1.113733.1.8.1"
  19414 	SzOID_VERISIGN_ONSITE_JURISDICTION_HASH                                        = "2.16.840.1.113733.1.6.11"
  19415 	SzOID_VERISIGN_PRIVATE_6_9                                                     = "2.16.840.1.113733.1.6.9"
  19416 	SzOID_WHQL_CRYPTO                                                              = "1.3.6.1.4.1.311.10.3.5"
  19417 	SzOID_WINDOWS_KITS_SIGNER                                                      = "1.3.6.1.4.1.311.10.3.20"
  19418 	SzOID_WINDOWS_RT_SIGNER                                                        = "1.3.6.1.4.1.311.10.3.21"
  19419 	SzOID_WINDOWS_SOFTWARE_EXTENSION_SIGNER                                        = "1.3.6.1.4.1.311.10.3.26"
  19420 	SzOID_WINDOWS_STORE_SIGNER                                                     = "1.3.6.1.4.1.311.76.3.1"
  19421 	SzOID_WINDOWS_TCB_SIGNER                                                       = "1.3.6.1.4.1.311.10.3.23"
  19422 	SzOID_WINDOWS_THIRD_PARTY_COMPONENT_SIGNER                                     = "1.3.6.1.4.1.311.10.3.25"
  19423 	SzOID_X21_ADDRESS                                                              = "2.5.4.24"
  19424 	SzOID_X957                                                                     = "1.2.840.10040"
  19425 	SzOID_X957_DSA                                                                 = "1.2.840.10040.4.1"
  19426 	SzOID_X957_SHA1DSA                                                             = "1.2.840.10040.4.3"
  19427 	SzOID_YESNO_TRUST_ATTR                                                         = "1.3.6.1.4.1.311.10.4.1"
  19428 	SzPRIV_KEY_CACHE_MAX_ITEMS                                                     = "PrivKeyCacheMaxItems"
  19429 	SzPRIV_KEY_CACHE_PURGE_INTERVAL_SECONDS                                        = "PrivKeyCachePurgeIntervalSeconds"
  19430 	Sz_CERT_STORE_PROV_COLLECTION                                                  = "Collection"
  19431 	Sz_CERT_STORE_PROV_FILENAME_W                                                  = "File"
  19432 	Sz_CERT_STORE_PROV_LDAP_W                                                      = "Ldap"
  19433 	Sz_CERT_STORE_PROV_MEMORY                                                      = "Memory"
  19434 	Sz_CERT_STORE_PROV_PHYSICAL_W                                                  = "Physical"
  19435 	Sz_CERT_STORE_PROV_PKCS12                                                      = "PKCS12"
  19436 	Sz_CERT_STORE_PROV_PKCS7                                                       = "PKCS7"
  19437 	Sz_CERT_STORE_PROV_SERIALIZED                                                  = "Serialized"
  19438 	Sz_CERT_STORE_PROV_SMART_CARD_W                                                = "SmartCard"
  19439 	Sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W                                           = "SystemRegistry"
  19440 	Sz_CERT_STORE_PROV_SYSTEM_W                                                    = "System"
  19441 	Tag_inner_PROPVARIANT                                                          = 0
  19442 	TkCREATE                                                                       = 4
  19443 	TkEND                                                                          = 7
  19444 	TkEXPLAIN                                                                      = 3
  19445 	TkOTHER                                                                        = 2
  19446 	TkSEMI                                                                         = 0
  19447 	TkTEMP                                                                         = 5
  19448 	TkTRIGGER                                                                      = 6
  19449 	TkWS                                                                           = 1
  19450 	WsdAutoextInit                                                                 = 0
  19451 	WsdHooksInit                                                                   = 0
  19452 	WsdStatInit                                                                    = 0
  19453 )
  19454 
  19455 const (
  19456 	X_MM_PERM_AAAA = 0
  19457 	X_MM_PERM_AAAB = 1
  19458 	X_MM_PERM_AAAC = 2
  19459 	X_MM_PERM_AAAD = 3
  19460 	X_MM_PERM_AABA = 4
  19461 	X_MM_PERM_AABB = 5
  19462 	X_MM_PERM_AABC = 6
  19463 	X_MM_PERM_AABD = 7
  19464 	X_MM_PERM_AACA = 8
  19465 	X_MM_PERM_AACB = 9
  19466 	X_MM_PERM_AACC = 10
  19467 	X_MM_PERM_AACD = 11
  19468 	X_MM_PERM_AADA = 12
  19469 	X_MM_PERM_AADB = 13
  19470 	X_MM_PERM_AADC = 14
  19471 	X_MM_PERM_AADD = 15
  19472 	X_MM_PERM_ABAA = 16
  19473 	X_MM_PERM_ABAB = 17
  19474 	X_MM_PERM_ABAC = 18
  19475 	X_MM_PERM_ABAD = 19
  19476 	X_MM_PERM_ABBA = 20
  19477 	X_MM_PERM_ABBB = 21
  19478 	X_MM_PERM_ABBC = 22
  19479 	X_MM_PERM_ABBD = 23
  19480 	X_MM_PERM_ABCA = 24
  19481 	X_MM_PERM_ABCB = 25
  19482 	X_MM_PERM_ABCC = 26
  19483 	X_MM_PERM_ABCD = 27
  19484 	X_MM_PERM_ABDA = 28
  19485 	X_MM_PERM_ABDB = 29
  19486 	X_MM_PERM_ABDC = 30
  19487 	X_MM_PERM_ABDD = 31
  19488 	X_MM_PERM_ACAA = 32
  19489 	X_MM_PERM_ACAB = 33
  19490 	X_MM_PERM_ACAC = 34
  19491 	X_MM_PERM_ACAD = 35
  19492 	X_MM_PERM_ACBA = 36
  19493 	X_MM_PERM_ACBB = 37
  19494 	X_MM_PERM_ACBC = 38
  19495 	X_MM_PERM_ACBD = 39
  19496 	X_MM_PERM_ACCA = 40
  19497 	X_MM_PERM_ACCB = 41
  19498 	X_MM_PERM_ACCC = 42
  19499 	X_MM_PERM_ACCD = 43
  19500 	X_MM_PERM_ACDA = 44
  19501 	X_MM_PERM_ACDB = 45
  19502 	X_MM_PERM_ACDC = 46
  19503 	X_MM_PERM_ACDD = 47
  19504 	X_MM_PERM_ADAA = 48
  19505 	X_MM_PERM_ADAB = 49
  19506 	X_MM_PERM_ADAC = 50
  19507 	X_MM_PERM_ADAD = 51
  19508 	X_MM_PERM_ADBA = 52
  19509 	X_MM_PERM_ADBB = 53
  19510 	X_MM_PERM_ADBC = 54
  19511 	X_MM_PERM_ADBD = 55
  19512 	X_MM_PERM_ADCA = 56
  19513 	X_MM_PERM_ADCB = 57
  19514 	X_MM_PERM_ADCC = 58
  19515 	X_MM_PERM_ADCD = 59
  19516 	X_MM_PERM_ADDA = 60
  19517 	X_MM_PERM_ADDB = 61
  19518 	X_MM_PERM_ADDC = 62
  19519 	X_MM_PERM_ADDD = 63
  19520 	X_MM_PERM_BAAA = 64
  19521 	X_MM_PERM_BAAB = 65
  19522 	X_MM_PERM_BAAC = 66
  19523 	X_MM_PERM_BAAD = 67
  19524 	X_MM_PERM_BABA = 68
  19525 	X_MM_PERM_BABB = 69
  19526 	X_MM_PERM_BABC = 70
  19527 	X_MM_PERM_BABD = 71
  19528 	X_MM_PERM_BACA = 72
  19529 	X_MM_PERM_BACB = 73
  19530 	X_MM_PERM_BACC = 74
  19531 	X_MM_PERM_BACD = 75
  19532 	X_MM_PERM_BADA = 76
  19533 	X_MM_PERM_BADB = 77
  19534 	X_MM_PERM_BADC = 78
  19535 	X_MM_PERM_BADD = 79
  19536 	X_MM_PERM_BBAA = 80
  19537 	X_MM_PERM_BBAB = 81
  19538 	X_MM_PERM_BBAC = 82
  19539 	X_MM_PERM_BBAD = 83
  19540 	X_MM_PERM_BBBA = 84
  19541 	X_MM_PERM_BBBB = 85
  19542 	X_MM_PERM_BBBC = 86
  19543 	X_MM_PERM_BBBD = 87
  19544 	X_MM_PERM_BBCA = 88
  19545 	X_MM_PERM_BBCB = 89
  19546 	X_MM_PERM_BBCC = 90
  19547 	X_MM_PERM_BBCD = 91
  19548 	X_MM_PERM_BBDA = 92
  19549 	X_MM_PERM_BBDB = 93
  19550 	X_MM_PERM_BBDC = 94
  19551 	X_MM_PERM_BBDD = 95
  19552 	X_MM_PERM_BCAA = 96
  19553 	X_MM_PERM_BCAB = 97
  19554 	X_MM_PERM_BCAC = 98
  19555 	X_MM_PERM_BCAD = 99
  19556 	X_MM_PERM_BCBA = 100
  19557 	X_MM_PERM_BCBB = 101
  19558 	X_MM_PERM_BCBC = 102
  19559 	X_MM_PERM_BCBD = 103
  19560 	X_MM_PERM_BCCA = 104
  19561 	X_MM_PERM_BCCB = 105
  19562 	X_MM_PERM_BCCC = 106
  19563 	X_MM_PERM_BCCD = 107
  19564 	X_MM_PERM_BCDA = 108
  19565 	X_MM_PERM_BCDB = 109
  19566 	X_MM_PERM_BCDC = 110
  19567 	X_MM_PERM_BCDD = 111
  19568 	X_MM_PERM_BDAA = 112
  19569 	X_MM_PERM_BDAB = 113
  19570 	X_MM_PERM_BDAC = 114
  19571 	X_MM_PERM_BDAD = 115
  19572 	X_MM_PERM_BDBA = 116
  19573 	X_MM_PERM_BDBB = 117
  19574 	X_MM_PERM_BDBC = 118
  19575 	X_MM_PERM_BDBD = 119
  19576 	X_MM_PERM_BDCA = 120
  19577 	X_MM_PERM_BDCB = 121
  19578 	X_MM_PERM_BDCC = 122
  19579 	X_MM_PERM_BDCD = 123
  19580 	X_MM_PERM_BDDA = 124
  19581 	X_MM_PERM_BDDB = 125
  19582 	X_MM_PERM_BDDC = 126
  19583 	X_MM_PERM_BDDD = 127
  19584 	X_MM_PERM_CAAA = 128
  19585 	X_MM_PERM_CAAB = 129
  19586 	X_MM_PERM_CAAC = 130
  19587 	X_MM_PERM_CAAD = 131
  19588 	X_MM_PERM_CABA = 132
  19589 	X_MM_PERM_CABB = 133
  19590 	X_MM_PERM_CABC = 134
  19591 	X_MM_PERM_CABD = 135
  19592 	X_MM_PERM_CACA = 136
  19593 	X_MM_PERM_CACB = 137
  19594 	X_MM_PERM_CACC = 138
  19595 	X_MM_PERM_CACD = 139
  19596 	X_MM_PERM_CADA = 140
  19597 	X_MM_PERM_CADB = 141
  19598 	X_MM_PERM_CADC = 142
  19599 	X_MM_PERM_CADD = 143
  19600 	X_MM_PERM_CBAA = 144
  19601 	X_MM_PERM_CBAB = 145
  19602 	X_MM_PERM_CBAC = 146
  19603 	X_MM_PERM_CBAD = 147
  19604 	X_MM_PERM_CBBA = 148
  19605 	X_MM_PERM_CBBB = 149
  19606 	X_MM_PERM_CBBC = 150
  19607 	X_MM_PERM_CBBD = 151
  19608 	X_MM_PERM_CBCA = 152
  19609 	X_MM_PERM_CBCB = 153
  19610 	X_MM_PERM_CBCC = 154
  19611 	X_MM_PERM_CBCD = 155
  19612 	X_MM_PERM_CBDA = 156
  19613 	X_MM_PERM_CBDB = 157
  19614 	X_MM_PERM_CBDC = 158
  19615 	X_MM_PERM_CBDD = 159
  19616 	X_MM_PERM_CCAA = 160
  19617 	X_MM_PERM_CCAB = 161
  19618 	X_MM_PERM_CCAC = 162
  19619 	X_MM_PERM_CCAD = 163
  19620 	X_MM_PERM_CCBA = 164
  19621 	X_MM_PERM_CCBB = 165
  19622 	X_MM_PERM_CCBC = 166
  19623 	X_MM_PERM_CCBD = 167
  19624 	X_MM_PERM_CCCA = 168
  19625 	X_MM_PERM_CCCB = 169
  19626 	X_MM_PERM_CCCC = 170
  19627 	X_MM_PERM_CCCD = 171
  19628 	X_MM_PERM_CCDA = 172
  19629 	X_MM_PERM_CCDB = 173
  19630 	X_MM_PERM_CCDC = 174
  19631 	X_MM_PERM_CCDD = 175
  19632 	X_MM_PERM_CDAA = 176
  19633 	X_MM_PERM_CDAB = 177
  19634 	X_MM_PERM_CDAC = 178
  19635 	X_MM_PERM_CDAD = 179
  19636 	X_MM_PERM_CDBA = 180
  19637 	X_MM_PERM_CDBB = 181
  19638 	X_MM_PERM_CDBC = 182
  19639 	X_MM_PERM_CDBD = 183
  19640 	X_MM_PERM_CDCA = 184
  19641 	X_MM_PERM_CDCB = 185
  19642 	X_MM_PERM_CDCC = 186
  19643 	X_MM_PERM_CDCD = 187
  19644 	X_MM_PERM_CDDA = 188
  19645 	X_MM_PERM_CDDB = 189
  19646 	X_MM_PERM_CDDC = 190
  19647 	X_MM_PERM_CDDD = 191
  19648 	X_MM_PERM_DAAA = 192
  19649 	X_MM_PERM_DAAB = 193
  19650 	X_MM_PERM_DAAC = 194
  19651 	X_MM_PERM_DAAD = 195
  19652 	X_MM_PERM_DABA = 196
  19653 	X_MM_PERM_DABB = 197
  19654 	X_MM_PERM_DABC = 198
  19655 	X_MM_PERM_DABD = 199
  19656 	X_MM_PERM_DACA = 200
  19657 	X_MM_PERM_DACB = 201
  19658 	X_MM_PERM_DACC = 202
  19659 	X_MM_PERM_DACD = 203
  19660 	X_MM_PERM_DADA = 204
  19661 	X_MM_PERM_DADB = 205
  19662 	X_MM_PERM_DADC = 206
  19663 	X_MM_PERM_DADD = 207
  19664 	X_MM_PERM_DBAA = 208
  19665 	X_MM_PERM_DBAB = 209
  19666 	X_MM_PERM_DBAC = 210
  19667 	X_MM_PERM_DBAD = 211
  19668 	X_MM_PERM_DBBA = 212
  19669 	X_MM_PERM_DBBB = 213
  19670 	X_MM_PERM_DBBC = 214
  19671 	X_MM_PERM_DBBD = 215
  19672 	X_MM_PERM_DBCA = 216
  19673 	X_MM_PERM_DBCB = 217
  19674 	X_MM_PERM_DBCC = 218
  19675 	X_MM_PERM_DBCD = 219
  19676 	X_MM_PERM_DBDA = 220
  19677 	X_MM_PERM_DBDB = 221
  19678 	X_MM_PERM_DBDC = 222
  19679 	X_MM_PERM_DBDD = 223
  19680 	X_MM_PERM_DCAA = 224
  19681 	X_MM_PERM_DCAB = 225
  19682 	X_MM_PERM_DCAC = 226
  19683 	X_MM_PERM_DCAD = 227
  19684 	X_MM_PERM_DCBA = 228
  19685 	X_MM_PERM_DCBB = 229
  19686 	X_MM_PERM_DCBC = 230
  19687 	X_MM_PERM_DCBD = 231
  19688 	X_MM_PERM_DCCA = 232
  19689 	X_MM_PERM_DCCB = 233
  19690 	X_MM_PERM_DCCC = 234
  19691 	X_MM_PERM_DCCD = 235
  19692 	X_MM_PERM_DCDA = 236
  19693 	X_MM_PERM_DCDB = 237
  19694 	X_MM_PERM_DCDC = 238
  19695 	X_MM_PERM_DCDD = 239
  19696 	X_MM_PERM_DDAA = 240
  19697 	X_MM_PERM_DDAB = 241
  19698 	X_MM_PERM_DDAC = 242
  19699 	X_MM_PERM_DDAD = 243
  19700 	X_MM_PERM_DDBA = 244
  19701 	X_MM_PERM_DDBB = 245
  19702 	X_MM_PERM_DDBC = 246
  19703 	X_MM_PERM_DDBD = 247
  19704 	X_MM_PERM_DDCA = 248
  19705 	X_MM_PERM_DDCB = 249
  19706 	X_MM_PERM_DDCC = 250
  19707 	X_MM_PERM_DDCD = 251
  19708 	X_MM_PERM_DDDA = 252
  19709 	X_MM_PERM_DDDB = 253
  19710 	X_MM_PERM_DDDC = 254
  19711 	X_MM_PERM_DDDD = 255
  19712 )
  19713 
  19714 const (
  19715 	X_MM_MANT_NORM_1_2     = 0
  19716 	X_MM_MANT_NORM_p5_2    = 1
  19717 	X_MM_MANT_NORM_p5_1    = 2
  19718 	X_MM_MANT_NORM_p75_1p5 = 3
  19719 )
  19720 
  19721 const (
  19722 	X_MM_MANT_SIGN_src  = 0
  19723 	X_MM_MANT_SIGN_zero = 1
  19724 	X_MM_MANT_SIGN_nan  = 2
  19725 )
  19726 
  19727 const (
  19728 	X_MM_HINT_ET0 = 7
  19729 	X_MM_HINT_ET1 = 6
  19730 	X_MM_HINT_T0  = 3
  19731 	X_MM_HINT_T1  = 2
  19732 	X_MM_HINT_T2  = 1
  19733 	X_MM_HINT_NTA = 0
  19734 )
  19735 
  19736 const (
  19737 	DSA_HASH_ALGORITHM_SHA1   = 0
  19738 	DSA_HASH_ALGORITHM_SHA256 = 1
  19739 	DSA_HASH_ALGORITHM_SHA512 = 2
  19740 )
  19741 
  19742 const (
  19743 	DSA_FIPS186_2 = 0
  19744 	DSA_FIPS186_3 = 1
  19745 )
  19746 
  19747 const (
  19748 	REGCLS_SINGLEUSE      = 0
  19749 	REGCLS_MULTIPLEUSE    = 1
  19750 	REGCLS_MULTI_SEPARATE = 2
  19751 	REGCLS_SUSPENDED      = 4
  19752 	REGCLS_SURROGATE      = 8
  19753 )
  19754 
  19755 const (
  19756 	COINITBASE_MULTITHREADED = 0
  19757 )
  19758 
  19759 const (
  19760 	SMEXF_SERVER  = 1
  19761 	SMEXF_HANDLER = 2
  19762 )
  19763 
  19764 const (
  19765 	COWAIT_DEFAULT                  = 0
  19766 	COWAIT_WAITALL                  = 1
  19767 	COWAIT_ALERTABLE                = 2
  19768 	COWAIT_INPUTAVAILABLE           = 4
  19769 	COWAIT_DISPATCH_CALLS           = 8
  19770 	COWAIT_DISPATCH_WINDOW_MESSAGES = 16
  19771 )
  19772 
  19773 const (
  19774 	LowMemoryResourceNotification  = 0
  19775 	HighMemoryResourceNotification = 1
  19776 )
  19777 
  19778 const (
  19779 	FindExInfoStandard     = 0
  19780 	FindExInfoBasic        = 1
  19781 	FindExInfoMaxInfoLevel = 2
  19782 )
  19783 
  19784 const (
  19785 	FindExSearchNameMatch          = 0
  19786 	FindExSearchLimitToDirectories = 1
  19787 	FindExSearchLimitToDevices     = 2
  19788 	FindExSearchMaxSearchOp        = 3
  19789 )
  19790 
  19791 const (
  19792 	GetFileExInfoStandard = 0
  19793 	GetFileExMaxInfoLevel = 1
  19794 )
  19795 
  19796 const (
  19797 	NODE_INVALID                = 0
  19798 	NODE_ELEMENT                = 1
  19799 	NODE_ATTRIBUTE              = 2
  19800 	NODE_TEXT                   = 3
  19801 	NODE_CDATA_SECTION          = 4
  19802 	NODE_ENTITY_REFERENCE       = 5
  19803 	NODE_ENTITY                 = 6
  19804 	NODE_PROCESSING_INSTRUCTION = 7
  19805 	NODE_COMMENT                = 8
  19806 	NODE_DOCUMENT               = 9
  19807 	NODE_DOCUMENT_TYPE          = 10
  19808 	NODE_DOCUMENT_FRAGMENT      = 11
  19809 	NODE_NOTATION               = 12
  19810 )
  19811 
  19812 const (
  19813 	XMLELEMTYPE_ELEMENT  = 0
  19814 	XMLELEMTYPE_TEXT     = 1
  19815 	XMLELEMTYPE_COMMENT  = 2
  19816 	XMLELEMTYPE_DOCUMENT = 3
  19817 	XMLELEMTYPE_DTD      = 4
  19818 	XMLELEMTYPE_PI       = 5
  19819 	XMLELEMTYPE_OTHER    = 6
  19820 )
  19821 
  19822 const (
  19823 	DESCKIND_NONE           = 0
  19824 	DESCKIND_FUNCDESC       = 1
  19825 	DESCKIND_VARDESC        = 2
  19826 	DESCKIND_TYPECOMP       = 3
  19827 	DESCKIND_IMPLICITAPPOBJ = 4
  19828 	DESCKIND_MAX            = 5
  19829 )
  19830 
  19831 const (
  19832 	SYS_WIN16 = 0
  19833 	SYS_WIN32 = 1
  19834 	SYS_MAC   = 2
  19835 	SYS_WIN64 = 3
  19836 )
  19837 
  19838 const (
  19839 	LIBFLAG_FRESTRICTED   = 1
  19840 	LIBFLAG_FCONTROL      = 2
  19841 	LIBFLAG_FHIDDEN       = 4
  19842 	LIBFLAG_FHASDISKIMAGE = 8
  19843 )
  19844 
  19845 const (
  19846 	SF_ERROR    = 10
  19847 	SF_I1       = 16
  19848 	SF_I2       = 2
  19849 	SF_I4       = 3
  19850 	SF_I8       = 20
  19851 	SF_BSTR     = 8
  19852 	SF_UNKNOWN  = 13
  19853 	SF_DISPATCH = 9
  19854 	SF_VARIANT  = 12
  19855 	SF_RECORD   = 36
  19856 	SF_HAVEIID  = 32781
  19857 )
  19858 
  19859 const (
  19860 	CHANGEKIND_ADDMEMBER        = 0
  19861 	CHANGEKIND_DELETEMEMBER     = 1
  19862 	CHANGEKIND_SETNAMES         = 2
  19863 	CHANGEKIND_SETDOCUMENTATION = 3
  19864 	CHANGEKIND_GENERAL          = 4
  19865 	CHANGEKIND_INVALIDATE       = 5
  19866 	CHANGEKIND_CHANGEFAILED     = 6
  19867 	CHANGEKIND_MAX              = 7
  19868 )
  19869 const (
  19870 	TKIND_ENUM      = 0
  19871 	TKIND_RECORD    = 1
  19872 	TKIND_MODULE    = 2
  19873 	TKIND_INTERFACE = 3
  19874 	TKIND_DISPATCH  = 4
  19875 	TKIND_COCLASS   = 5
  19876 	TKIND_ALIAS     = 6
  19877 	TKIND_UNION     = 7
  19878 	TKIND_MAX       = 8
  19879 )
  19880 
  19881 const (
  19882 	CC_FASTCALL   = 0
  19883 	CC_CDECL      = 1
  19884 	CC_MSCPASCAL  = 2
  19885 	CC_PASCAL     = 2
  19886 	CC_MACPASCAL  = 3
  19887 	CC_STDCALL    = 4
  19888 	CC_FPFASTCALL = 5
  19889 	CC_SYSCALL    = 6
  19890 	CC_MPWCDECL   = 7
  19891 	CC_MPWPASCAL  = 8
  19892 	CC_MAX        = 9
  19893 )
  19894 
  19895 const (
  19896 	FUNC_VIRTUAL     = 0
  19897 	FUNC_PUREVIRTUAL = 1
  19898 	FUNC_NONVIRTUAL  = 2
  19899 	FUNC_STATIC      = 3
  19900 	FUNC_DISPATCH    = 4
  19901 )
  19902 
  19903 const (
  19904 	INVOKE_FUNC           = 1
  19905 	INVOKE_PROPERTYGET    = 2
  19906 	INVOKE_PROPERTYPUT    = 4
  19907 	INVOKE_PROPERTYPUTREF = 8
  19908 )
  19909 
  19910 const (
  19911 	VAR_PERINSTANCE = 0
  19912 	VAR_STATIC      = 1
  19913 	VAR_CONST       = 2
  19914 	VAR_DISPATCH    = 3
  19915 )
  19916 
  19917 const (
  19918 	TYPEFLAG_FAPPOBJECT     = 1
  19919 	TYPEFLAG_FCANCREATE     = 2
  19920 	TYPEFLAG_FLICENSED      = 4
  19921 	TYPEFLAG_FPREDECLID     = 8
  19922 	TYPEFLAG_FHIDDEN        = 16
  19923 	TYPEFLAG_FCONTROL       = 32
  19924 	TYPEFLAG_FDUAL          = 64
  19925 	TYPEFLAG_FNONEXTENSIBLE = 128
  19926 	TYPEFLAG_FOLEAUTOMATION = 256
  19927 	TYPEFLAG_FRESTRICTED    = 512
  19928 	TYPEFLAG_FAGGREGATABLE  = 1024
  19929 	TYPEFLAG_FREPLACEABLE   = 2048
  19930 	TYPEFLAG_FDISPATCHABLE  = 4096
  19931 	TYPEFLAG_FREVERSEBIND   = 8192
  19932 	TYPEFLAG_FPROXY         = 16384
  19933 )
  19934 
  19935 const (
  19936 	FUNCFLAG_FRESTRICTED       = 1
  19937 	FUNCFLAG_FSOURCE           = 2
  19938 	FUNCFLAG_FBINDABLE         = 4
  19939 	FUNCFLAG_FREQUESTEDIT      = 8
  19940 	FUNCFLAG_FDISPLAYBIND      = 16
  19941 	FUNCFLAG_FDEFAULTBIND      = 32
  19942 	FUNCFLAG_FHIDDEN           = 64
  19943 	FUNCFLAG_FUSESGETLASTERROR = 128
  19944 	FUNCFLAG_FDEFAULTCOLLELEM  = 256
  19945 	FUNCFLAG_FUIDEFAULT        = 512
  19946 	FUNCFLAG_FNONBROWSABLE     = 1024
  19947 	FUNCFLAG_FREPLACEABLE      = 2048
  19948 	FUNCFLAG_FIMMEDIATEBIND    = 4096
  19949 )
  19950 
  19951 const (
  19952 	VARFLAG_FREADONLY        = 1
  19953 	VARFLAG_FSOURCE          = 2
  19954 	VARFLAG_FBINDABLE        = 4
  19955 	VARFLAG_FREQUESTEDIT     = 8
  19956 	VARFLAG_FDISPLAYBIND     = 16
  19957 	VARFLAG_FDEFAULTBIND     = 32
  19958 	VARFLAG_FHIDDEN          = 64
  19959 	VARFLAG_FRESTRICTED      = 128
  19960 	VARFLAG_FDEFAULTCOLLELEM = 256
  19961 	VARFLAG_FUIDEFAULT       = 512
  19962 	VARFLAG_FNONBROWSABLE    = 1024
  19963 	VARFLAG_FREPLACEABLE     = 2048
  19964 	VARFLAG_FIMMEDIATEBIND   = 4096
  19965 )
  19966 
  19967 const (
  19968 	COINIT_APARTMENTTHREADED = 2
  19969 	COINIT_MULTITHREADED     = 0
  19970 	COINIT_DISABLE_OLE1DDE   = 4
  19971 	COINIT_SPEED_OVER_MEMORY = 8
  19972 )
  19973 
  19974 const (
  19975 	SD_LAUNCHPERMISSIONS  = 0
  19976 	SD_ACCESSPERMISSIONS  = 1
  19977 	SD_LAUNCHRESTRICTIONS = 2
  19978 	SD_ACCESSRESTRICTIONS = 3
  19979 )
  19980 const (
  19981 	ADVF_NODATA            = 1
  19982 	ADVF_PRIMEFIRST        = 2
  19983 	ADVF_ONLYONCE          = 4
  19984 	ADVF_DATAONSTOP        = 64
  19985 	ADVFCACHE_NOHANDLER    = 8
  19986 	ADVFCACHE_FORCEBUILTIN = 16
  19987 	ADVFCACHE_ONSAVE       = 32
  19988 )
  19989 const (
  19990 	TYMED_HGLOBAL  = 1
  19991 	TYMED_FILE     = 2
  19992 	TYMED_ISTREAM  = 4
  19993 	TYMED_ISTORAGE = 8
  19994 	TYMED_GDI      = 16
  19995 	TYMED_MFPICT   = 32
  19996 	TYMED_ENHMF    = 64
  19997 	TYMED_NULL     = 0
  19998 )
  19999 const (
  20000 	DATADIR_GET = 1
  20001 	DATADIR_SET = 2
  20002 )
  20003 const (
  20004 	CALLTYPE_TOPLEVEL             = 1
  20005 	CALLTYPE_NESTED               = 2
  20006 	CALLTYPE_ASYNC                = 3
  20007 	CALLTYPE_TOPLEVEL_CALLPENDING = 4
  20008 	CALLTYPE_ASYNC_CALLPENDING    = 5
  20009 )
  20010 const (
  20011 	SERVERCALL_ISHANDLED  = 0
  20012 	SERVERCALL_REJECTED   = 1
  20013 	SERVERCALL_RETRYLATER = 2
  20014 )
  20015 const (
  20016 	PENDINGTYPE_TOPLEVEL = 1
  20017 	PENDINGTYPE_NESTED   = 2
  20018 )
  20019 const (
  20020 	PENDINGMSG_CANCELCALL     = 0
  20021 	PENDINGMSG_WAITNOPROCESS  = 1
  20022 	PENDINGMSG_WAITDEFPROCESS = 2
  20023 )
  20024 
  20025 const (
  20026 	ServerApplication  = 0
  20027 	LibraryApplication = 1
  20028 )
  20029 const (
  20030 	IdleShutdown   = 0
  20031 	ForcedShutdown = 1
  20032 )
  20033 const (
  20034 	BIND_MAYBOTHERUSER     = 1
  20035 	BIND_JUSTTESTEXISTENCE = 2
  20036 )
  20037 const (
  20038 	MKSYS_NONE             = 0
  20039 	MKSYS_GENERICCOMPOSITE = 1
  20040 	MKSYS_FILEMONIKER      = 2
  20041 	MKSYS_ANTIMONIKER      = 3
  20042 	MKSYS_ITEMMONIKER      = 4
  20043 	MKSYS_POINTERMONIKER   = 5
  20044 	MKSYS_CLASSMONIKER     = 7
  20045 	MKSYS_OBJREFMONIKER    = 8
  20046 	MKSYS_SESSIONMONIKER   = 9
  20047 	MKSYS_LUAMONIKER       = 10
  20048 )
  20049 const (
  20050 	MKRREDUCE_ONE         = 196608
  20051 	MKRREDUCE_TOUSER      = 131072
  20052 	MKRREDUCE_THROUGHUSER = 65536
  20053 	MKRREDUCE_ALL         = 0
  20054 )
  20055 
  20056 const (
  20057 	EXTCONN_STRONG   = 1
  20058 	EXTCONN_WEAK     = 2
  20059 	EXTCONN_CALLABLE = 4
  20060 )
  20061 
  20062 const (
  20063 	STGTY_STORAGE   = 1
  20064 	STGTY_STREAM    = 2
  20065 	STGTY_LOCKBYTES = 3
  20066 	STGTY_PROPERTY  = 4
  20067 )
  20068 
  20069 const (
  20070 	STREAM_SEEK_SET = 0
  20071 	STREAM_SEEK_CUR = 1
  20072 	STREAM_SEEK_END = 2
  20073 )
  20074 
  20075 const (
  20076 	LOCK_WRITE     = 1
  20077 	LOCK_EXCLUSIVE = 2
  20078 	LOCK_ONLYONCE  = 4
  20079 )
  20080 
  20081 const (
  20082 	EOAC_NONE              = 0
  20083 	EOAC_MUTUAL_AUTH       = 1
  20084 	EOAC_STATIC_CLOAKING   = 32
  20085 	EOAC_DYNAMIC_CLOAKING  = 64
  20086 	EOAC_ANY_AUTHORITY     = 128
  20087 	EOAC_MAKE_FULLSIC      = 256
  20088 	EOAC_DEFAULT           = 2048
  20089 	EOAC_SECURE_REFS       = 2
  20090 	EOAC_ACCESS_CONTROL    = 4
  20091 	EOAC_APPID             = 8
  20092 	EOAC_DYNAMIC           = 16
  20093 	EOAC_REQUIRE_FULLSIC   = 512
  20094 	EOAC_AUTO_IMPERSONATE  = 1024
  20095 	EOAC_NO_CUSTOM_MARSHAL = 8192
  20096 	EOAC_DISABLE_AAA       = 4096
  20097 )
  20098 
  20099 const (
  20100 	COMBND_RPCTIMEOUT      = 1
  20101 	COMBND_SERVER_LOCALITY = 2
  20102 	COMBND_RESERVED1       = 4
  20103 )
  20104 
  20105 const (
  20106 	SERVER_LOCALITY_PROCESS_LOCAL = 0
  20107 	SERVER_LOCALITY_MACHINE_LOCAL = 1
  20108 	SERVER_LOCALITY_REMOTE        = 2
  20109 )
  20110 
  20111 const (
  20112 	COMGLB_EXCEPTION_HANDLING     = 1
  20113 	COMGLB_APPID                  = 2
  20114 	COMGLB_RPC_THREADPOOL_SETTING = 3
  20115 	COMGLB_RO_SETTINGS            = 4
  20116 	COMGLB_UNMARSHALING_POLICY    = 5
  20117 )
  20118 
  20119 const (
  20120 	COMGLB_EXCEPTION_HANDLE             = 0
  20121 	COMGLB_EXCEPTION_DONOT_HANDLE_FATAL = 1
  20122 	COMGLB_EXCEPTION_DONOT_HANDLE       = 1
  20123 	COMGLB_EXCEPTION_DONOT_HANDLE_ANY   = 2
  20124 )
  20125 
  20126 const (
  20127 	COMGLB_RPC_THREADPOOL_SETTING_DEFAULT_POOL = 0
  20128 	COMGLB_RPC_THREADPOOL_SETTING_PRIVATE_POOL = 1
  20129 )
  20130 
  20131 const (
  20132 	COMGLB_STA_MODALLOOP_REMOVE_TOUCH_MESSAGES                    = 1
  20133 	COMGLB_STA_MODALLOOP_SHARED_QUEUE_REMOVE_INPUT_MESSAGES       = 2
  20134 	COMGLB_STA_MODALLOOP_SHARED_QUEUE_DONOT_REMOVE_INPUT_MESSAGES = 4
  20135 	COMGLB_FAST_RUNDOWN                                           = 8
  20136 	COMGLB_RESERVED1                                              = 16
  20137 	COMGLB_RESERVED2                                              = 32
  20138 	COMGLB_RESERVED3                                              = 64
  20139 	COMGLB_STA_MODALLOOP_SHARED_QUEUE_REORDER_POINTER_MESSAGES    = 128
  20140 )
  20141 
  20142 const (
  20143 	COMGLB_UNMARSHALING_POLICY_NORMAL = 0
  20144 	COMGLB_UNMARSHALING_POLICY_STRONG = 1
  20145 	COMGLB_UNMARSHALING_POLICY_HYBRID = 2
  20146 )
  20147 
  20148 const (
  20149 	DCOM_NONE          = 0
  20150 	DCOM_CALL_COMPLETE = 1
  20151 	DCOM_CALL_CANCELED = 2
  20152 )
  20153 
  20154 const (
  20155 	APTTYPEQUALIFIER_NONE               = 0
  20156 	APTTYPEQUALIFIER_IMPLICIT_MTA       = 1
  20157 	APTTYPEQUALIFIER_NA_ON_MTA          = 2
  20158 	APTTYPEQUALIFIER_NA_ON_STA          = 3
  20159 	APTTYPEQUALIFIER_NA_ON_IMPLICIT_MTA = 4
  20160 	APTTYPEQUALIFIER_NA_ON_MAINSTA      = 5
  20161 	APTTYPEQUALIFIER_APPLICATION_STA    = 6
  20162 )
  20163 
  20164 const (
  20165 	APTTYPE_CURRENT = -1
  20166 	APTTYPE_STA     = 0
  20167 	APTTYPE_MTA     = 1
  20168 	APTTYPE_NA      = 2
  20169 	APTTYPE_MAINSTA = 3
  20170 )
  20171 
  20172 const (
  20173 	THDTYPE_BLOCKMESSAGES   = 0
  20174 	THDTYPE_PROCESSMESSAGES = 1
  20175 )
  20176 
  20177 const (
  20178 	CO_MARSHALING_SOURCE_IS_APP_CONTAINER = 0
  20179 )
  20180 
  20181 const (
  20182 	REGKIND_DEFAULT  = 0
  20183 	REGKIND_REGISTER = 1
  20184 	REGKIND_NONE     = 2
  20185 )
  20186 
  20187 const (
  20188 	OLEGETMONIKER_ONLYIFTHERE = 1
  20189 	OLEGETMONIKER_FORCEASSIGN = 2
  20190 	OLEGETMONIKER_UNASSIGN    = 3
  20191 	OLEGETMONIKER_TEMPFORUSER = 4
  20192 )
  20193 
  20194 const (
  20195 	OLEWHICHMK_CONTAINER = 1
  20196 	OLEWHICHMK_OBJREL    = 2
  20197 	OLEWHICHMK_OBJFULL   = 3
  20198 )
  20199 
  20200 const (
  20201 	USERCLASSTYPE_FULL    = 1
  20202 	USERCLASSTYPE_SHORT   = 2
  20203 	USERCLASSTYPE_APPNAME = 3
  20204 )
  20205 
  20206 const (
  20207 	OLEMISC_RECOMPOSEONRESIZE            = 1
  20208 	OLEMISC_ONLYICONIC                   = 2
  20209 	OLEMISC_INSERTNOTREPLACE             = 4
  20210 	OLEMISC_STATIC                       = 8
  20211 	OLEMISC_CANTLINKINSIDE               = 16
  20212 	OLEMISC_CANLINKBYOLE1                = 32
  20213 	OLEMISC_ISLINKOBJECT                 = 64
  20214 	OLEMISC_INSIDEOUT                    = 128
  20215 	OLEMISC_ACTIVATEWHENVISIBLE          = 256
  20216 	OLEMISC_RENDERINGISDEVICEINDEPENDENT = 512
  20217 	OLEMISC_INVISIBLEATRUNTIME           = 1024
  20218 	OLEMISC_ALWAYSRUN                    = 2048
  20219 	OLEMISC_ACTSLIKEBUTTON               = 4096
  20220 	OLEMISC_ACTSLIKELABEL                = 8192
  20221 	OLEMISC_NOUIACTIVATE                 = 16384
  20222 	OLEMISC_ALIGNABLE                    = 32768
  20223 	OLEMISC_SIMPLEFRAME                  = 65536
  20224 	OLEMISC_SETCLIENTSITEFIRST           = 131072
  20225 	OLEMISC_IMEMODE                      = 262144
  20226 	OLEMISC_IGNOREACTIVATEWHENVISIBLE    = 524288
  20227 	OLEMISC_WANTSTOMENUMERGE             = 1048576
  20228 	OLEMISC_SUPPORTSMULTILEVELUNDO       = 2097152
  20229 )
  20230 const (
  20231 	OLECLOSE_SAVEIFDIRTY = 0
  20232 	OLECLOSE_NOSAVE      = 1
  20233 	OLECLOSE_PROMPTSAVE  = 2
  20234 )
  20235 const (
  20236 	OLERENDER_NONE   = 0
  20237 	OLERENDER_DRAW   = 1
  20238 	OLERENDER_FORMAT = 2
  20239 	OLERENDER_ASIS   = 3
  20240 )
  20241 
  20242 const (
  20243 	OLEUPDATE_ALWAYS = 1
  20244 	OLEUPDATE_ONCALL = 3
  20245 )
  20246 
  20247 const (
  20248 	OLELINKBIND_EVENIFCLASSDIFF = 1
  20249 )
  20250 
  20251 const (
  20252 	BINDSPEED_INDEFINITE = 1
  20253 	BINDSPEED_MODERATE   = 2
  20254 	BINDSPEED_IMMEDIATE  = 3
  20255 )
  20256 
  20257 const (
  20258 	OLECONTF_EMBEDDINGS    = 1
  20259 	OLECONTF_LINKS         = 2
  20260 	OLECONTF_OTHERS        = 4
  20261 	OLECONTF_ONLYUSER      = 8
  20262 	OLECONTF_ONLYIFRUNNING = 16
  20263 )
  20264 
  20265 const (
  20266 	OLEVERBATTRIB_NEVERDIRTIES    = 1
  20267 	OLEVERBATTRIB_ONCONTAINERMENU = 2
  20268 )
  20269 
  20270 const (
  20271 	DISCARDCACHE_SAVEIFDIRTY = 0
  20272 	DISCARDCACHE_NOSAVE      = 1
  20273 )
  20274 
  20275 const (
  20276 	PIDMSI_STATUS_NORMAL     = 0
  20277 	PIDMSI_STATUS_NEW        = 1
  20278 	PIDMSI_STATUS_PRELIM     = 2
  20279 	PIDMSI_STATUS_DRAFT      = 3
  20280 	PIDMSI_STATUS_INPROGRESS = 4
  20281 	PIDMSI_STATUS_EDIT       = 5
  20282 	PIDMSI_STATUS_REVIEW     = 6
  20283 	PIDMSI_STATUS_PROOF      = 7
  20284 	PIDMSI_STATUS_FINAL      = 8
  20285 	PIDMSI_STATUS_OTHER      = 32767
  20286 )
  20287 
  20288 const (
  20289 	RpcNotificationTypeNone     = 0
  20290 	RpcNotificationTypeEvent    = 1
  20291 	RpcNotificationTypeApc      = 2
  20292 	RpcNotificationTypeIoc      = 3
  20293 	RpcNotificationTypeHwnd     = 4
  20294 	RpcNotificationTypeCallback = 5
  20295 )
  20296 
  20297 const (
  20298 	RctInvalid    = 0
  20299 	RctNormal     = 1
  20300 	RctTraining   = 2
  20301 	RctGuaranteed = 3
  20302 )
  20303 
  20304 const (
  20305 	RlafInvalid = 0
  20306 	RlafIPv4    = 1
  20307 	RlafIPv6    = 2
  20308 )
  20309 
  20310 const (
  20311 	RpcNotificationCallNone         = 0
  20312 	RpcNotificationClientDisconnect = 1
  20313 	RpcNotificationCallCancel       = 2
  20314 )
  20315 
  20316 const (
  20317 	RcclInvalid               = 0
  20318 	RcclLocal                 = 1
  20319 	RcclRemote                = 2
  20320 	RcclClientUnknownLocality = 3
  20321 )
  20322 
  20323 const (
  20324 	RpcCallComplete    = 0
  20325 	RpcSendComplete    = 1
  20326 	RpcReceiveComplete = 2
  20327 )
  20328 
  20329 const (
  20330 	EeptAnsiString    = 1
  20331 	EeptUnicodeString = 2
  20332 	EeptLongVal       = 3
  20333 	EeptShortVal      = 4
  20334 	EeptPointerVal    = 5
  20335 	EeptNone          = 6
  20336 	EeptBinary        = 7
  20337 )
  20338 
  20339 const (
  20340 	RPCHTTP_RS_REDIRECT  = 1
  20341 	RPCHTTP_RS_ACCESS_1  = 2
  20342 	RPCHTTP_RS_SESSION   = 3
  20343 	RPCHTTP_RS_ACCESS_2  = 4
  20344 	RPCHTTP_RS_INTERFACE = 5
  20345 )
  20346 
  20347 const (
  20348 	PROTOCOL_NOT_LOADED     = 1
  20349 	PROTOCOL_LOADED         = 2
  20350 	PROTOCOL_ADDRESS_CHANGE = 3
  20351 )
  20352 
  20353 const (
  20354 	USER_MARSHAL_CB_BUFFER_SIZE = 0
  20355 	USER_MARSHAL_CB_MARSHALL    = 1
  20356 	USER_MARSHAL_CB_UNMARSHALL  = 2
  20357 	USER_MARSHAL_CB_FREE        = 3
  20358 )
  20359 
  20360 const (
  20361 	IDL_CS_NO_CONVERT         = 0
  20362 	IDL_CS_IN_PLACE_CONVERT   = 1
  20363 	IDL_CS_NEW_BUFFER_CONVERT = 2
  20364 )
  20365 
  20366 const (
  20367 	XLAT_SERVER = 1
  20368 	XLAT_CLIENT = 2
  20369 )
  20370 
  20371 const (
  20372 	STUB_UNMARSHAL              = 0
  20373 	STUB_CALL_SERVER            = 1
  20374 	STUB_MARSHAL                = 2
  20375 	STUB_CALL_SERVER_NO_HRESULT = 3
  20376 )
  20377 
  20378 const (
  20379 	PROXY_CALCSIZE    = 0
  20380 	PROXY_GETBUFFER   = 1
  20381 	PROXY_MARSHAL     = 2
  20382 	PROXY_SENDRECEIVE = 3
  20383 	PROXY_UNMARSHAL   = 4
  20384 )
  20385 
  20386 const (
  20387 	ComputerNameNetBIOS                   = 0
  20388 	ComputerNameDnsHostname               = 1
  20389 	ComputerNameDnsDomain                 = 2
  20390 	ComputerNameDnsFullyQualified         = 3
  20391 	ComputerNamePhysicalNetBIOS           = 4
  20392 	ComputerNamePhysicalDnsHostname       = 5
  20393 	ComputerNamePhysicalDnsDomain         = 6
  20394 	ComputerNamePhysicalDnsFullyQualified = 7
  20395 	ComputerNameMax                       = 8
  20396 )
  20397 
  20398 const (
  20399 	BINDVERB_GET       = 0
  20400 	BINDVERB_POST      = 1
  20401 	BINDVERB_PUT       = 2
  20402 	BINDVERB_CUSTOM    = 3
  20403 	BINDVERB_RESERVED1 = 4
  20404 )
  20405 
  20406 const (
  20407 	BINDINFOF_URLENCODESTGMEDDATA = 1
  20408 	BINDINFOF_URLENCODEDEXTRAINFO = 2
  20409 )
  20410 
  20411 const (
  20412 	BINDF_ASYNCHRONOUS             = 1
  20413 	BINDF_ASYNCSTORAGE             = 2
  20414 	BINDF_NOPROGRESSIVERENDERING   = 4
  20415 	BINDF_OFFLINEOPERATION         = 8
  20416 	BINDF_GETNEWESTVERSION         = 16
  20417 	BINDF_NOWRITECACHE             = 32
  20418 	BINDF_NEEDFILE                 = 64
  20419 	BINDF_PULLDATA                 = 128
  20420 	BINDF_IGNORESECURITYPROBLEM    = 256
  20421 	BINDF_RESYNCHRONIZE            = 512
  20422 	BINDF_HYPERLINK                = 1024
  20423 	BINDF_NO_UI                    = 2048
  20424 	BINDF_SILENTOPERATION          = 4096
  20425 	BINDF_PRAGMA_NO_CACHE          = 8192
  20426 	BINDF_GETCLASSOBJECT           = 16384
  20427 	BINDF_RESERVED_1               = 32768
  20428 	BINDF_FREE_THREADED            = 65536
  20429 	BINDF_DIRECT_READ              = 131072
  20430 	BINDF_FORMS_SUBMIT             = 262144
  20431 	BINDF_GETFROMCACHE_IF_NET_FAIL = 524288
  20432 	BINDF_FROMURLMON               = 1048576
  20433 	BINDF_FWD_BACK                 = 2097152
  20434 	BINDF_PREFERDEFAULTHANDLER     = 4194304
  20435 	BINDF_ENFORCERESTRICTED        = 8388608
  20436 	BINDF_RESERVED_2               = 2147483648
  20437 	BINDF_RESERVED_3               = 16777216
  20438 	BINDF_RESERVED_4               = 33554432
  20439 	BINDF_RESERVED_5               = 67108864
  20440 	BINDF_RESERVED_6               = 134217728
  20441 	BINDF_RESERVED_7               = 1073741824
  20442 	BINDF_RESERVED_8               = 536870912
  20443 )
  20444 
  20445 const (
  20446 	URL_ENCODING_NONE         = 0
  20447 	URL_ENCODING_ENABLE_UTF8  = 268435456
  20448 	URL_ENCODING_DISABLE_UTF8 = 536870912
  20449 )
  20450 
  20451 const (
  20452 	BINDINFO_OPTIONS_WININETFLAG              = 65536
  20453 	BINDINFO_OPTIONS_ENABLE_UTF8              = 131072
  20454 	BINDINFO_OPTIONS_DISABLE_UTF8             = 262144
  20455 	BINDINFO_OPTIONS_USE_IE_ENCODING          = 524288
  20456 	BINDINFO_OPTIONS_BINDTOOBJECT             = 1048576
  20457 	BINDINFO_OPTIONS_SECURITYOPTOUT           = 2097152
  20458 	BINDINFO_OPTIONS_IGNOREMIMETEXTPLAIN      = 4194304
  20459 	BINDINFO_OPTIONS_USEBINDSTRINGCREDS       = 8388608
  20460 	BINDINFO_OPTIONS_IGNOREHTTPHTTPSREDIRECTS = 16777216
  20461 	BINDINFO_OPTIONS_IGNORE_SSLERRORS_ONCE    = 33554432
  20462 	BINDINFO_WPC_DOWNLOADBLOCKED              = 134217728
  20463 	BINDINFO_WPC_LOGGING_ENABLED              = 268435456
  20464 	BINDINFO_OPTIONS_ALLOWCONNECTDATA         = 536870912
  20465 	BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS     = 1073741824
  20466 	BINDINFO_OPTIONS_SHDOCVW_NAVIGATE         = -2147483648
  20467 )
  20468 
  20469 const (
  20470 	BSCF_FIRSTDATANOTIFICATION        = 1
  20471 	BSCF_INTERMEDIATEDATANOTIFICATION = 2
  20472 	BSCF_LASTDATANOTIFICATION         = 4
  20473 	BSCF_DATAFULLYAVAILABLE           = 8
  20474 	BSCF_AVAILABLEDATASIZEUNKNOWN     = 16
  20475 	BSCF_SKIPDRAINDATAFORFILEURLS     = 32
  20476 	BSCF_64BITLENGTHDOWNLOAD          = 64
  20477 )
  20478 
  20479 const (
  20480 	BINDSTATUS_FINDINGRESOURCE            = 1
  20481 	BINDSTATUS_CONNECTING                 = 2
  20482 	BINDSTATUS_REDIRECTING                = 3
  20483 	BINDSTATUS_BEGINDOWNLOADDATA          = 4
  20484 	BINDSTATUS_DOWNLOADINGDATA            = 5
  20485 	BINDSTATUS_ENDDOWNLOADDATA            = 6
  20486 	BINDSTATUS_BEGINDOWNLOADCOMPONENTS    = 7
  20487 	BINDSTATUS_INSTALLINGCOMPONENTS       = 8
  20488 	BINDSTATUS_ENDDOWNLOADCOMPONENTS      = 9
  20489 	BINDSTATUS_USINGCACHEDCOPY            = 10
  20490 	BINDSTATUS_SENDINGREQUEST             = 11
  20491 	BINDSTATUS_CLASSIDAVAILABLE           = 12
  20492 	BINDSTATUS_MIMETYPEAVAILABLE          = 13
  20493 	BINDSTATUS_CACHEFILENAMEAVAILABLE     = 14
  20494 	BINDSTATUS_BEGINSYNCOPERATION         = 15
  20495 	BINDSTATUS_ENDSYNCOPERATION           = 16
  20496 	BINDSTATUS_BEGINUPLOADDATA            = 17
  20497 	BINDSTATUS_UPLOADINGDATA              = 18
  20498 	BINDSTATUS_ENDUPLOADDATA              = 19
  20499 	BINDSTATUS_PROTOCOLCLASSID            = 20
  20500 	BINDSTATUS_ENCODING                   = 21
  20501 	BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE  = 22
  20502 	BINDSTATUS_CLASSINSTALLLOCATION       = 23
  20503 	BINDSTATUS_DECODING                   = 24
  20504 	BINDSTATUS_LOADINGMIMEHANDLER         = 25
  20505 	BINDSTATUS_CONTENTDISPOSITIONATTACH   = 26
  20506 	BINDSTATUS_FILTERREPORTMIMETYPE       = 27
  20507 	BINDSTATUS_CLSIDCANINSTANTIATE        = 28
  20508 	BINDSTATUS_IUNKNOWNAVAILABLE          = 29
  20509 	BINDSTATUS_DIRECTBIND                 = 30
  20510 	BINDSTATUS_RAWMIMETYPE                = 31
  20511 	BINDSTATUS_PROXYDETECTING             = 32
  20512 	BINDSTATUS_ACCEPTRANGES               = 33
  20513 	BINDSTATUS_COOKIE_SENT                = 34
  20514 	BINDSTATUS_COMPACT_POLICY_RECEIVED    = 35
  20515 	BINDSTATUS_COOKIE_SUPPRESSED          = 36
  20516 	BINDSTATUS_COOKIE_STATE_UNKNOWN       = 37
  20517 	BINDSTATUS_COOKIE_STATE_ACCEPT        = 38
  20518 	BINDSTATUS_COOKIE_STATE_REJECT        = 39
  20519 	BINDSTATUS_COOKIE_STATE_PROMPT        = 40
  20520 	BINDSTATUS_COOKIE_STATE_LEASH         = 41
  20521 	BINDSTATUS_COOKIE_STATE_DOWNGRADE     = 42
  20522 	BINDSTATUS_POLICY_HREF                = 43
  20523 	BINDSTATUS_P3P_HEADER                 = 44
  20524 	BINDSTATUS_SESSION_COOKIE_RECEIVED    = 45
  20525 	BINDSTATUS_PERSISTENT_COOKIE_RECEIVED = 46
  20526 	BINDSTATUS_SESSION_COOKIES_ALLOWED    = 47
  20527 	BINDSTATUS_CACHECONTROL               = 48
  20528 	BINDSTATUS_CONTENTDISPOSITIONFILENAME = 49
  20529 	BINDSTATUS_MIMETEXTPLAINMISMATCH      = 50
  20530 	BINDSTATUS_PUBLISHERAVAILABLE         = 51
  20531 	BINDSTATUS_DISPLAYNAMEAVAILABLE       = 52
  20532 	BINDSTATUS_SSLUX_NAVBLOCKED           = 53
  20533 	BINDSTATUS_SERVER_MIMETYPEAVAILABLE   = 54
  20534 	BINDSTATUS_SNIFFED_CLASSIDAVAILABLE   = 55
  20535 	BINDSTATUS_64BIT_PROGRESS             = 56
  20536 	BINDSTATUS_LAST                       = 56
  20537 	BINDSTATUS_RESERVED_0                 = 57
  20538 	BINDSTATUS_RESERVED_1                 = 58
  20539 	BINDSTATUS_RESERVED_2                 = 59
  20540 	BINDSTATUS_RESERVED_3                 = 60
  20541 	BINDSTATUS_RESERVED_4                 = 61
  20542 	BINDSTATUS_RESERVED_5                 = 62
  20543 	BINDSTATUS_RESERVED_6                 = 63
  20544 	BINDSTATUS_RESERVED_7                 = 64
  20545 	BINDSTATUS_RESERVED_8                 = 65
  20546 	BINDSTATUS_RESERVED_9                 = 66
  20547 	BINDSTATUS_LAST_PRIVATE               = 66
  20548 )
  20549 
  20550 const (
  20551 	BINDF2_DISABLEBASICOVERHTTP              = 1
  20552 	BINDF2_DISABLEAUTOCOOKIEHANDLING         = 2
  20553 	BINDF2_READ_DATA_GREATER_THAN_4GB        = 4
  20554 	BINDF2_DISABLE_HTTP_REDIRECT_XSECURITYID = 8
  20555 	BINDF2_SETDOWNLOADMODE                   = 32
  20556 	BINDF2_DISABLE_HTTP_REDIRECT_CACHING     = 64
  20557 	BINDF2_KEEP_CALLBACK_MODULE_LOADED       = 128
  20558 	BINDF2_ALLOW_PROXY_CRED_PROMPT           = 256
  20559 	BINDF2_RESERVED_F                        = 131072
  20560 	BINDF2_RESERVED_E                        = 262144
  20561 	BINDF2_RESERVED_D                        = 524288
  20562 	BINDF2_RESERVED_C                        = 1048576
  20563 	BINDF2_RESERVED_B                        = 2097152
  20564 	BINDF2_RESERVED_A                        = 4194304
  20565 	BINDF2_RESERVED_9                        = 8388608
  20566 	BINDF2_RESERVED_8                        = 16777216
  20567 	BINDF2_RESERVED_7                        = 33554432
  20568 	BINDF2_RESERVED_6                        = 67108864
  20569 	BINDF2_RESERVED_5                        = 134217728
  20570 	BINDF2_RESERVED_4                        = 268435456
  20571 	BINDF2_RESERVED_3                        = 536870912
  20572 	BINDF2_RESERVED_2                        = 1073741824
  20573 	BINDF2_RESERVED_1                        = 2147483648
  20574 )
  20575 
  20576 const (
  20577 	AUTHENTICATEF_PROXY = 1
  20578 	AUTHENTICATEF_BASIC = 2
  20579 	AUTHENTICATEF_HTTP  = 4
  20580 )
  20581 
  20582 const (
  20583 	CIP_DISK_FULL                            = 0
  20584 	CIP_ACCESS_DENIED                        = 1
  20585 	CIP_NEWER_VERSION_EXISTS                 = 2
  20586 	CIP_OLDER_VERSION_EXISTS                 = 3
  20587 	CIP_NAME_CONFLICT                        = 4
  20588 	CIP_TRUST_VERIFICATION_COMPONENT_MISSING = 5
  20589 	CIP_EXE_SELF_REGISTERATION_TIMEOUT       = 6
  20590 	CIP_UNSAFE_TO_ABORT                      = 7
  20591 	CIP_NEED_REBOOT                          = 8
  20592 	CIP_NEED_REBOOT_UI_PERMISSION            = 9
  20593 )
  20594 
  20595 const (
  20596 	BINDSTRING_HEADERS             = 1
  20597 	BINDSTRING_ACCEPT_MIMES        = 2
  20598 	BINDSTRING_EXTRA_URL           = 3
  20599 	BINDSTRING_LANGUAGE            = 4
  20600 	BINDSTRING_USERNAME            = 5
  20601 	BINDSTRING_PASSWORD            = 6
  20602 	BINDSTRING_UA_PIXELS           = 7
  20603 	BINDSTRING_UA_COLOR            = 8
  20604 	BINDSTRING_OS                  = 9
  20605 	BINDSTRING_USER_AGENT          = 10
  20606 	BINDSTRING_ACCEPT_ENCODINGS    = 11
  20607 	BINDSTRING_POST_COOKIE         = 12
  20608 	BINDSTRING_POST_DATA_MIME      = 13
  20609 	BINDSTRING_URL                 = 14
  20610 	BINDSTRING_IID                 = 15
  20611 	BINDSTRING_FLAG_BIND_TO_OBJECT = 16
  20612 	BINDSTRING_PTR_BIND_CONTEXT    = 17
  20613 	BINDSTRING_XDR_ORIGIN          = 18
  20614 	BINDSTRING_DOWNLOADPATH        = 19
  20615 	BINDSTRING_ROOTDOC_URL         = 20
  20616 	BINDSTRING_INITIAL_FILENAME    = 21
  20617 	BINDSTRING_PROXY_USERNAME      = 22
  20618 	BINDSTRING_PROXY_PASSWORD      = 23
  20619 )
  20620 
  20621 const (
  20622 	PI_PARSE_URL            = 1
  20623 	PI_FILTER_MODE          = 2
  20624 	PI_FORCE_ASYNC          = 4
  20625 	PI_USE_WORKERTHREAD     = 8
  20626 	PI_MIMEVERIFICATION     = 16
  20627 	PI_CLSIDLOOKUP          = 32
  20628 	PI_DATAPROGRESS         = 64
  20629 	PI_SYNCHRONOUS          = 128
  20630 	PI_APARTMENTTHREADED    = 256
  20631 	PI_CLASSINSTALL         = 512
  20632 	PI_PASSONBINDCTX        = 8192
  20633 	PI_NOMIMEHANDLER        = 32768
  20634 	PI_LOADAPPDIRECT        = 16384
  20635 	PD_FORCE_SWITCH         = 65536
  20636 	PI_PREFERDEFAULTHANDLER = 131072
  20637 )
  20638 
  20639 const (
  20640 	OIBDG_APARTMENTTHREADED = 256
  20641 	OIBDG_DATAONLY          = 4096
  20642 )
  20643 
  20644 const (
  20645 	PARSE_CANONICALIZE       = 1
  20646 	PARSE_FRIENDLY           = 2
  20647 	PARSE_SECURITY_URL       = 3
  20648 	PARSE_ROOTDOCUMENT       = 4
  20649 	PARSE_DOCUMENT           = 5
  20650 	PARSE_ANCHOR             = 6
  20651 	PARSE_ENCODE_IS_UNESCAPE = 7
  20652 	PARSE_DECODE_IS_ESCAPE   = 8
  20653 	PARSE_PATH_FROM_URL      = 9
  20654 	PARSE_URL_FROM_PATH      = 10
  20655 	PARSE_MIME               = 11
  20656 	PARSE_SERVER             = 12
  20657 	PARSE_SCHEMA             = 13
  20658 	PARSE_SITE               = 14
  20659 	PARSE_DOMAIN             = 15
  20660 	PARSE_LOCATION           = 16
  20661 	PARSE_SECURITY_DOMAIN    = 17
  20662 	PARSE_ESCAPE             = 18
  20663 	PARSE_UNESCAPE           = 19
  20664 )
  20665 
  20666 const (
  20667 	PSU_DEFAULT           = 1
  20668 	PSU_SECURITY_URL_ONLY = 2
  20669 )
  20670 
  20671 const (
  20672 	QUERY_EXPIRATION_DATE              = 1
  20673 	QUERY_TIME_OF_LAST_CHANGE          = 2
  20674 	QUERY_CONTENT_ENCODING             = 3
  20675 	QUERY_CONTENT_TYPE                 = 4
  20676 	QUERY_REFRESH                      = 5
  20677 	QUERY_RECOMBINE                    = 6
  20678 	QUERY_CAN_NAVIGATE                 = 7
  20679 	QUERY_USES_NETWORK                 = 8
  20680 	QUERY_IS_CACHED                    = 9
  20681 	QUERY_IS_INSTALLEDENTRY            = 10
  20682 	QUERY_IS_CACHED_OR_MAPPED          = 11
  20683 	QUERY_USES_CACHE                   = 12
  20684 	QUERY_IS_SECURE                    = 13
  20685 	QUERY_IS_SAFE                      = 14
  20686 	QUERY_USES_HISTORYFOLDER           = 15
  20687 	QUERY_IS_CACHED_AND_USABLE_OFFLINE = 16
  20688 )
  20689 
  20690 const (
  20691 	PUAF_DEFAULT                      = 0
  20692 	PUAF_NOUI                         = 1
  20693 	PUAF_ISFILE                       = 2
  20694 	PUAF_WARN_IF_DENIED               = 4
  20695 	PUAF_FORCEUI_FOREGROUND           = 8
  20696 	PUAF_CHECK_TIFS                   = 16
  20697 	PUAF_DONTCHECKBOXINDIALOG         = 32
  20698 	PUAF_TRUSTED                      = 64
  20699 	PUAF_ACCEPT_WILDCARD_SCHEME       = 128
  20700 	PUAF_ENFORCERESTRICTED            = 256
  20701 	PUAF_NOSAVEDFILECHECK             = 512
  20702 	PUAF_REQUIRESAVEDFILECHECK        = 1024
  20703 	PUAF_DONT_USE_CACHE               = 4096
  20704 	PUAF_RESERVED1                    = 8192
  20705 	PUAF_RESERVED2                    = 16384
  20706 	PUAF_LMZ_UNLOCKED                 = 65536
  20707 	PUAF_LMZ_LOCKED                   = 131072
  20708 	PUAF_DEFAULTZONEPOL               = 262144
  20709 	PUAF_NPL_USE_LOCKED_IF_RESTRICTED = 524288
  20710 	PUAF_NOUIIFLOCKED                 = 1048576
  20711 	PUAF_DRAGPROTOCOLCHECK            = 2097152
  20712 )
  20713 const (
  20714 	PUAFOUT_DEFAULT          = 0
  20715 	PUAFOUT_ISLOCKZONEPOLICY = 1
  20716 )
  20717 
  20718 const (
  20719 	SZM_CREATE = 0
  20720 	SZM_DELETE = 1
  20721 )
  20722 
  20723 const (
  20724 	URLZONE_INVALID        = -1
  20725 	URLZONE_PREDEFINED_MIN = 0
  20726 	URLZONE_LOCAL_MACHINE  = 0
  20727 	URLZONE_INTRANET       = 1
  20728 	URLZONE_TRUSTED        = 2
  20729 	URLZONE_INTERNET       = 3
  20730 	URLZONE_UNTRUSTED      = 4
  20731 	URLZONE_PREDEFINED_MAX = 999
  20732 	URLZONE_USER_MIN       = 1000
  20733 	URLZONE_USER_MAX       = 10000
  20734 )
  20735 
  20736 const (
  20737 	URLTEMPLATE_CUSTOM         = 0
  20738 	URLTEMPLATE_PREDEFINED_MIN = 65536
  20739 	URLTEMPLATE_LOW            = 65536
  20740 	URLTEMPLATE_MEDLOW         = 66816
  20741 	URLTEMPLATE_MEDIUM         = 69632
  20742 	URLTEMPLATE_MEDHIGH        = 70912
  20743 	URLTEMPLATE_HIGH           = 73728
  20744 	URLTEMPLATE_PREDEFINED_MAX = 131072
  20745 )
  20746 
  20747 const (
  20748 	MAX_ZONE_PATH        = 260
  20749 	MAX_ZONE_DESCRIPTION = 200
  20750 )
  20751 
  20752 const (
  20753 	ZAFLAGS_CUSTOM_EDIT              = 1
  20754 	ZAFLAGS_ADD_SITES                = 2
  20755 	ZAFLAGS_REQUIRE_VERIFICATION     = 4
  20756 	ZAFLAGS_INCLUDE_PROXY_OVERRIDE   = 8
  20757 	ZAFLAGS_INCLUDE_INTRANET_SITES   = 16
  20758 	ZAFLAGS_NO_UI                    = 32
  20759 	ZAFLAGS_SUPPORTS_VERIFICATION    = 64
  20760 	ZAFLAGS_UNC_AS_INTRANET          = 128
  20761 	ZAFLAGS_DETECT_INTRANET          = 256
  20762 	ZAFLAGS_USE_LOCKED_ZONES         = 65536
  20763 	ZAFLAGS_VERIFY_TEMPLATE_SETTINGS = 131072
  20764 	ZAFLAGS_NO_CACHE                 = 262144
  20765 )
  20766 
  20767 const (
  20768 	URLZONEREG_DEFAULT = 0
  20769 	URLZONEREG_HKLM    = 1
  20770 	URLZONEREG_HKCU    = 2
  20771 )
  20772 
  20773 const (
  20774 	BINDHANDLETYPES_APPCACHE   = 0
  20775 	BINDHANDLETYPES_DEPENDENCY = 1
  20776 	BINDHANDLETYPES_COUNT      = 2
  20777 )
  20778 
  20779 const (
  20780 	MIMETYPEPROP        = 0
  20781 	USE_SRC_URL         = 1
  20782 	CLASSIDPROP         = 2
  20783 	TRUSTEDDOWNLOADPROP = 3
  20784 	POPUPLEVELPROP      = 4
  20785 )
  20786 
  20787 const (
  20788 	ThreadMemoryPriority      = 0
  20789 	ThreadAbsoluteCpuPriority = 1
  20790 	ThreadInformationClassMax = 2
  20791 )
  20792 
  20793 const (
  20794 	DEPPolicyAlwaysOff  = 0
  20795 	DEPPolicyAlwaysOn   = 1
  20796 	DEPPolicyOptIn      = 2
  20797 	DEPPolicyOptOut     = 3
  20798 	DEPTotalPolicyCount = 4
  20799 )
  20800 
  20801 const (
  20802 	ProcessMemoryPriority      = 0
  20803 	ProcessInformationClassMax = 1
  20804 )
  20805 
  20806 const (
  20807 	FindStreamInfoStandard     = 0
  20808 	FindStreamInfoMaxInfoLevel = 1
  20809 )
  20810 
  20811 const (
  20812 	KeyTypeOther             = 0
  20813 	KeyTypeVirtualSmartCard  = 1
  20814 	KeyTypePhysicalSmartCard = 2
  20815 	KeyTypePassport          = 3
  20816 	KeyTypePassportRemote    = 4
  20817 	KeyTypePassportSmartCard = 5
  20818 	KeyTypeHardware          = 6
  20819 	KeyTypeSoftware          = 7
  20820 	KeyTypeSelfSigned        = 8
  20821 )
  20822 
  20823 const (
  20824 	DPI_AWARENESS_INVALID           = -1
  20825 	DPI_AWARENESS_UNAWARE           = 0
  20826 	DPI_AWARENESS_SYSTEM_AWARE      = 1
  20827 	DPI_AWARENESS_PER_MONITOR_AWARE = 2
  20828 )
  20829 
  20830 const (
  20831 	DPI_HOSTING_BEHAVIOR_INVALID = -1
  20832 	DPI_HOSTING_BEHAVIOR_DEFAULT = 0
  20833 	DPI_HOSTING_BEHAVIOR_MIXED   = 1
  20834 )
  20835 
  20836 const (
  20837 	DeviceProblemNone                 = 0
  20838 	DeviceProblemHardware             = 1
  20839 	DeviceProblemCHMError             = 2
  20840 	DeviceProblemDoorOpen             = 3
  20841 	DeviceProblemCalibrationError     = 4
  20842 	DeviceProblemTargetFailure        = 5
  20843 	DeviceProblemCHMMoveError         = 6
  20844 	DeviceProblemCHMZeroError         = 7
  20845 	DeviceProblemCartridgeInsertError = 8
  20846 	DeviceProblemPositionError        = 9
  20847 	DeviceProblemSensorError          = 10
  20848 	DeviceProblemCartridgeEjectError  = 11
  20849 	DeviceProblemGripperError         = 12
  20850 	DeviceProblemDriveError           = 13
  20851 )
  20852 
  20853 const (
  20854 	StorageDeviceProperty            = 0
  20855 	StorageAdapterProperty           = 1
  20856 	StorageDeviceIdProperty          = 2
  20857 	StorageDeviceUniqueIdProperty    = 3
  20858 	StorageDeviceWriteCacheProperty  = 4
  20859 	StorageMiniportProperty          = 5
  20860 	StorageAccessAlignmentProperty   = 6
  20861 	StorageDeviceSeekPenaltyProperty = 7
  20862 	StorageDeviceTrimProperty        = 8
  20863 )
  20864 
  20865 const (
  20866 	PropertyStandardQuery   = 0
  20867 	PropertyExistsQuery     = 1
  20868 	PropertyMaskQuery       = 2
  20869 	PropertyQueryMaxDefined = 3
  20870 )
  20871 
  20872 const (
  20873 	DDS_4mm            = 32
  20874 	MiniQic            = 33
  20875 	Travan             = 34
  20876 	QIC                = 35
  20877 	MP_8mm             = 36
  20878 	AME_8mm            = 37
  20879 	AIT1_8mm           = 38
  20880 	DLT                = 39
  20881 	NCTP               = 40
  20882 	IBM_3480           = 41
  20883 	IBM_3490E          = 42
  20884 	IBM_Magstar_3590   = 43
  20885 	IBM_Magstar_MP     = 44
  20886 	STK_DATA_D3        = 45
  20887 	SONY_DTF           = 46
  20888 	DV_6mm             = 47
  20889 	DMI                = 48
  20890 	SONY_D2            = 49
  20891 	CLEANER_CARTRIDGE  = 50
  20892 	CD_ROM             = 51
  20893 	CD_R               = 52
  20894 	CD_RW              = 53
  20895 	DVD_ROM            = 54
  20896 	DVD_R              = 55
  20897 	DVD_RW             = 56
  20898 	MO_3_RW            = 57
  20899 	MO_5_WO            = 58
  20900 	MO_5_RW            = 59
  20901 	MO_5_LIMDOW        = 60
  20902 	PC_5_WO            = 61
  20903 	PC_5_RW            = 62
  20904 	PD_5_RW            = 63
  20905 	ABL_5_WO           = 64
  20906 	PINNACLE_APEX_5_RW = 65
  20907 	SONY_12_WO         = 66
  20908 	PHILIPS_12_WO      = 67
  20909 	HITACHI_12_WO      = 68
  20910 	CYGNET_12_WO       = 69
  20911 	KODAK_14_WO        = 70
  20912 	MO_NFR_525         = 71
  20913 	NIKON_12_RW        = 72
  20914 	IOMEGA_ZIP         = 73
  20915 	IOMEGA_JAZ         = 74
  20916 	SYQUEST_EZ135      = 75
  20917 	SYQUEST_EZFLYER    = 76
  20918 	SYQUEST_SYJET      = 77
  20919 	AVATAR_F2          = 78
  20920 	MP2_8mm            = 79
  20921 	DST_S              = 80
  20922 	DST_M              = 81
  20923 	DST_L              = 82
  20924 	VXATape_1          = 83
  20925 	VXATape_2          = 84
  20926 	STK_9840           = 85
  20927 	LTO_Ultrium        = 86
  20928 	LTO_Accelis        = 87
  20929 	DVD_RAM            = 88
  20930 	AIT_8mm            = 89
  20931 	ADR_1              = 90
  20932 	ADR_2              = 91
  20933 	STK_9940           = 92
  20934 	SAIT               = 93
  20935 	VXATape            = 94
  20936 )
  20937 
  20938 const (
  20939 	BusTypeUnknown     = 0
  20940 	BusTypeScsi        = 1
  20941 	BusTypeAtapi       = 2
  20942 	BusTypeAta         = 3
  20943 	BusType1394        = 4
  20944 	BusTypeSsa         = 5
  20945 	BusTypeFibre       = 6
  20946 	BusTypeUsb         = 7
  20947 	BusTypeRAID        = 8
  20948 	BusTypeMax         = 9
  20949 	BusTypeMaxReserved = 127
  20950 )
  20951 
  20952 const (
  20953 	Unknown        = 0
  20954 	F5_1Pt2_512    = 1
  20955 	F3_1Pt44_512   = 2
  20956 	F3_2Pt88_512   = 3
  20957 	F3_20Pt8_512   = 4
  20958 	F3_720_512     = 5
  20959 	F5_360_512     = 6
  20960 	F5_320_512     = 7
  20961 	F5_320_1024    = 8
  20962 	F5_180_512     = 9
  20963 	F5_160_512     = 10
  20964 	RemovableMedia = 11
  20965 	FixedMedia     = 12
  20966 	F3_120M_512    = 13
  20967 	F3_640_512     = 14
  20968 	F5_640_512     = 15
  20969 	F5_720_512     = 16
  20970 	F3_1Pt2_512    = 17
  20971 	F3_1Pt23_1024  = 18
  20972 	F5_1Pt23_1024  = 19
  20973 	F3_128Mb_512   = 20
  20974 	F3_230Mb_512   = 21
  20975 	F8_256_128     = 22
  20976 	F3_200Mb_512   = 23
  20977 	F3_240M_512    = 24
  20978 	F3_32M_512     = 25
  20979 )
  20980 
  20981 const (
  20982 	PARTITION_STYLE_MBR = 0
  20983 	PARTITION_STYLE_GPT = 1
  20984 	PARTITION_STYLE_RAW = 2
  20985 )
  20986 
  20987 const (
  20988 	DetectNone    = 0
  20989 	DetectInt13   = 1
  20990 	DetectExInt13 = 2
  20991 )
  20992 
  20993 const (
  20994 	EqualPriority      = 0
  20995 	KeepPrefetchedData = 1
  20996 	KeepReadData       = 2
  20997 )
  20998 
  20999 const (
  21000 	RequestSize     = 0
  21001 	RequestLocation = 1
  21002 )
  21003 
  21004 const (
  21005 	AllElements       = 0
  21006 	ChangerTransport  = 1
  21007 	ChangerSlot       = 2
  21008 	ChangerIEPort     = 3
  21009 	ChangerDrive      = 4
  21010 	ChangerDoor       = 5
  21011 	ChangerKeypad     = 6
  21012 	ChangerMaxElement = 7
  21013 )
  21014 
  21015 const (
  21016 	COMPARE_STRING = 1
  21017 )
  21018 
  21019 const (
  21020 	GEO_NATION            = 1
  21021 	GEO_LATITUDE          = 2
  21022 	GEO_LONGITUDE         = 3
  21023 	GEO_ISO2              = 4
  21024 	GEO_ISO3              = 5
  21025 	GEO_RFC1766           = 6
  21026 	GEO_LCID              = 7
  21027 	GEO_FRIENDLYNAME      = 8
  21028 	GEO_OFFICIALNAME      = 9
  21029 	GEO_TIMEZONES         = 10
  21030 	GEO_OFFICIALLANGUAGES = 11
  21031 	GEO_ISO_UN_NUMBER     = 12
  21032 	GEO_PARENT            = 13
  21033 )
  21034 
  21035 const (
  21036 	GEOCLASS_NATION = 16
  21037 	GEOCLASS_REGION = 14
  21038 	GEOCLASS_ALL    = 0
  21039 )
  21040 
  21041 const (
  21042 	SidTypeUser           = 1
  21043 	SidTypeGroup          = 2
  21044 	SidTypeDomain         = 3
  21045 	SidTypeAlias          = 4
  21046 	SidTypeWellKnownGroup = 5
  21047 	SidTypeDeletedAccount = 6
  21048 	SidTypeInvalid        = 7
  21049 	SidTypeUnknown        = 8
  21050 	SidTypeComputer       = 9
  21051 	SidTypeLabel          = 10
  21052 	SidTypeLogonSession   = 11
  21053 )
  21054 
  21055 const (
  21056 	WinNullSid                                    = 0
  21057 	WinWorldSid                                   = 1
  21058 	WinLocalSid                                   = 2
  21059 	WinCreatorOwnerSid                            = 3
  21060 	WinCreatorGroupSid                            = 4
  21061 	WinCreatorOwnerServerSid                      = 5
  21062 	WinCreatorGroupServerSid                      = 6
  21063 	WinNtAuthoritySid                             = 7
  21064 	WinDialupSid                                  = 8
  21065 	WinNetworkSid                                 = 9
  21066 	WinBatchSid                                   = 10
  21067 	WinInteractiveSid                             = 11
  21068 	WinServiceSid                                 = 12
  21069 	WinAnonymousSid                               = 13
  21070 	WinProxySid                                   = 14
  21071 	WinEnterpriseControllersSid                   = 15
  21072 	WinSelfSid                                    = 16
  21073 	WinAuthenticatedUserSid                       = 17
  21074 	WinRestrictedCodeSid                          = 18
  21075 	WinTerminalServerSid                          = 19
  21076 	WinRemoteLogonIdSid                           = 20
  21077 	WinLogonIdsSid                                = 21
  21078 	WinLocalSystemSid                             = 22
  21079 	WinLocalServiceSid                            = 23
  21080 	WinNetworkServiceSid                          = 24
  21081 	WinBuiltinDomainSid                           = 25
  21082 	WinBuiltinAdministratorsSid                   = 26
  21083 	WinBuiltinUsersSid                            = 27
  21084 	WinBuiltinGuestsSid                           = 28
  21085 	WinBuiltinPowerUsersSid                       = 29
  21086 	WinBuiltinAccountOperatorsSid                 = 30
  21087 	WinBuiltinSystemOperatorsSid                  = 31
  21088 	WinBuiltinPrintOperatorsSid                   = 32
  21089 	WinBuiltinBackupOperatorsSid                  = 33
  21090 	WinBuiltinReplicatorSid                       = 34
  21091 	WinBuiltinPreWindows2000CompatibleAccessSid   = 35
  21092 	WinBuiltinRemoteDesktopUsersSid               = 36
  21093 	WinBuiltinNetworkConfigurationOperatorsSid    = 37
  21094 	WinAccountAdministratorSid                    = 38
  21095 	WinAccountGuestSid                            = 39
  21096 	WinAccountKrbtgtSid                           = 40
  21097 	WinAccountDomainAdminsSid                     = 41
  21098 	WinAccountDomainUsersSid                      = 42
  21099 	WinAccountDomainGuestsSid                     = 43
  21100 	WinAccountComputersSid                        = 44
  21101 	WinAccountControllersSid                      = 45
  21102 	WinAccountCertAdminsSid                       = 46
  21103 	WinAccountSchemaAdminsSid                     = 47
  21104 	WinAccountEnterpriseAdminsSid                 = 48
  21105 	WinAccountPolicyAdminsSid                     = 49
  21106 	WinAccountRasAndIasServersSid                 = 50
  21107 	WinNTLMAuthenticationSid                      = 51
  21108 	WinDigestAuthenticationSid                    = 52
  21109 	WinSChannelAuthenticationSid                  = 53
  21110 	WinThisOrganizationSid                        = 54
  21111 	WinOtherOrganizationSid                       = 55
  21112 	WinBuiltinIncomingForestTrustBuildersSid      = 56
  21113 	WinBuiltinPerfMonitoringUsersSid              = 57
  21114 	WinBuiltinPerfLoggingUsersSid                 = 58
  21115 	WinBuiltinAuthorizationAccessSid              = 59
  21116 	WinBuiltinTerminalServerLicenseServersSid     = 60
  21117 	WinBuiltinDCOMUsersSid                        = 61
  21118 	WinBuiltinIUsersSid                           = 62
  21119 	WinIUserSid                                   = 63
  21120 	WinBuiltinCryptoOperatorsSid                  = 64
  21121 	WinUntrustedLabelSid                          = 65
  21122 	WinLowLabelSid                                = 66
  21123 	WinMediumLabelSid                             = 67
  21124 	WinHighLabelSid                               = 68
  21125 	WinSystemLabelSid                             = 69
  21126 	WinWriteRestrictedCodeSid                     = 70
  21127 	WinCreatorOwnerRightsSid                      = 71
  21128 	WinCacheablePrincipalsGroupSid                = 72
  21129 	WinNonCacheablePrincipalsGroupSid             = 73
  21130 	WinEnterpriseReadonlyControllersSid           = 74
  21131 	WinAccountReadonlyControllersSid              = 75
  21132 	WinBuiltinEventLogReadersGroup                = 76
  21133 	WinNewEnterpriseReadonlyControllersSid        = 77
  21134 	WinBuiltinCertSvcDComAccessGroup              = 78
  21135 	WinMediumPlusLabelSid                         = 79
  21136 	WinLocalLogonSid                              = 80
  21137 	WinConsoleLogonSid                            = 81
  21138 	WinThisOrganizationCertificateSid             = 82
  21139 	WinApplicationPackageAuthoritySid             = 83
  21140 	WinBuiltinAnyPackageSid                       = 84
  21141 	WinCapabilityInternetClientSid                = 85
  21142 	WinCapabilityInternetClientServerSid          = 86
  21143 	WinCapabilityPrivateNetworkClientServerSid    = 87
  21144 	WinCapabilityPicturesLibrarySid               = 88
  21145 	WinCapabilityVideosLibrarySid                 = 89
  21146 	WinCapabilityMusicLibrarySid                  = 90
  21147 	WinCapabilityDocumentsLibrarySid              = 91
  21148 	WinCapabilitySharedUserCertificatesSid        = 92
  21149 	WinCapabilityEnterpriseAuthenticationSid      = 93
  21150 	WinCapabilityRemovableStorageSid              = 94
  21151 	WinBuiltinRDSRemoteAccessServersSid           = 95
  21152 	WinBuiltinRDSEndpointServersSid               = 96
  21153 	WinBuiltinRDSManagementServersSid             = 97
  21154 	WinUserModeDriversSid                         = 98
  21155 	WinBuiltinHyperVAdminsSid                     = 99
  21156 	WinAccountCloneableControllersSid             = 100
  21157 	WinBuiltinAccessControlAssistanceOperatorsSid = 101
  21158 	WinBuiltinRemoteManagementUsersSid            = 102
  21159 	WinAuthenticationAuthorityAssertedSid         = 103
  21160 	WinAuthenticationServiceAssertedSid           = 104
  21161 	WinLocalAccountSid                            = 105
  21162 	WinLocalAccountAndAdministratorSid            = 106
  21163 	WinAccountProtectedUsersSid                   = 107
  21164 	WinCapabilityAppointmentsSid                  = 108
  21165 	WinCapabilityContactsSid                      = 109
  21166 	WinAccountDefaultSystemManagedSid             = 110
  21167 	WinBuiltinDefaultSystemManagedGroupSid        = 111
  21168 	WinBuiltinStorageReplicaAdminsSid             = 112
  21169 	WinAccountKeyAdminsSid                        = 113
  21170 	WinAccountEnterpriseKeyAdminsSid              = 114
  21171 	WinAuthenticationKeyTrustSid                  = 115
  21172 	WinAuthenticationKeyPropertyMFASid            = 116
  21173 	WinAuthenticationKeyPropertyAttestationSid    = 117
  21174 )
  21175 
  21176 const (
  21177 	AclRevisionInformation = 1
  21178 	AclSizeInformation     = 2
  21179 )
  21180 
  21181 const (
  21182 	AuditEventObjectAccess           = 0
  21183 	AuditEventDirectoryServiceAccess = 1
  21184 )
  21185 
  21186 const (
  21187 	AccessReasonNone                     = 0
  21188 	AccessReasonAllowedAce               = 65536
  21189 	AccessReasonDeniedAce                = 131072
  21190 	AccessReasonAllowedParentAce         = 196608
  21191 	AccessReasonDeniedParentAce          = 262144
  21192 	AccessReasonNotGrantedByCape         = 327680
  21193 	AccessReasonNotGrantedByParentCape   = 393216
  21194 	AccessReasonNotGrantedToAppContainer = 458752
  21195 	AccessReasonMissingPrivilege         = 1048576
  21196 	AccessReasonFromPrivilege            = 2097152
  21197 	AccessReasonIntegrityLevel           = 3145728
  21198 	AccessReasonOwnership                = 4194304
  21199 	AccessReasonNullDacl                 = 5242880
  21200 	AccessReasonEmptyDacl                = 6291456
  21201 	AccessReasonNoSD                     = 7340032
  21202 	AccessReasonNoGrant                  = 8388608
  21203 )
  21204 
  21205 const (
  21206 	SecurityAnonymous      = 0
  21207 	SecurityIdentification = 1
  21208 	SecurityImpersonation  = 2
  21209 	SecurityDelegation     = 3
  21210 )
  21211 
  21212 const (
  21213 	TokenPrimary       = 1
  21214 	TokenImpersonation = 2
  21215 )
  21216 
  21217 const (
  21218 	TokenElevationTypeDefault = 1
  21219 	TokenElevationTypeFull    = 2
  21220 	TokenElevationTypeLimited = 3
  21221 )
  21222 
  21223 const (
  21224 	TokenUser                            = 1
  21225 	TokenGroups                          = 2
  21226 	TokenPrivileges                      = 3
  21227 	TokenOwner                           = 4
  21228 	TokenPrimaryGroup                    = 5
  21229 	TokenDefaultDacl                     = 6
  21230 	TokenSource                          = 7
  21231 	TokenType                            = 8
  21232 	TokenImpersonationLevel              = 9
  21233 	TokenStatistics                      = 10
  21234 	TokenRestrictedSids                  = 11
  21235 	TokenSessionId                       = 12
  21236 	TokenGroupsAndPrivileges             = 13
  21237 	TokenSessionReference                = 14
  21238 	TokenSandBoxInert                    = 15
  21239 	TokenAuditPolicy                     = 16
  21240 	TokenOrigin                          = 17
  21241 	TokenElevationType                   = 18
  21242 	TokenLinkedToken                     = 19
  21243 	TokenElevation                       = 20
  21244 	TokenHasRestrictions                 = 21
  21245 	TokenAccessInformation               = 22
  21246 	TokenVirtualizationAllowed           = 23
  21247 	TokenVirtualizationEnabled           = 24
  21248 	TokenIntegrityLevel                  = 25
  21249 	TokenUIAccess                        = 26
  21250 	TokenMandatoryPolicy                 = 27
  21251 	TokenLogonSid                        = 28
  21252 	TokenIsAppContainer                  = 29
  21253 	TokenCapabilities                    = 30
  21254 	TokenAppContainerSid                 = 31
  21255 	TokenAppContainerNumber              = 32
  21256 	TokenUserClaimAttributes             = 33
  21257 	TokenDeviceClaimAttributes           = 34
  21258 	TokenRestrictedUserClaimAttributes   = 35
  21259 	TokenRestrictedDeviceClaimAttributes = 36
  21260 	TokenDeviceGroups                    = 37
  21261 	TokenRestrictedDeviceGroups          = 38
  21262 	TokenSecurityAttributes              = 39
  21263 	TokenIsRestricted                    = 40
  21264 	MaxTokenInfoClass                    = 41
  21265 )
  21266 
  21267 const (
  21268 	MandatoryLevelUntrusted     = 0
  21269 	MandatoryLevelLow           = 1
  21270 	MandatoryLevelMedium        = 2
  21271 	MandatoryLevelHigh          = 3
  21272 	MandatoryLevelSystem        = 4
  21273 	MandatoryLevelSecureProcess = 5
  21274 	MandatoryLevelCount         = 6
  21275 )
  21276 
  21277 const (
  21278 	SeLearningModeInvalidType = 0
  21279 	SeLearningModeSettings    = 1
  21280 	SeLearningModeMax         = 2
  21281 )
  21282 
  21283 const (
  21284 	PMCCounter             = 0
  21285 	MaxHardwareCounterType = 1
  21286 )
  21287 
  21288 const (
  21289 	ProcessDEPPolicy                   = 0
  21290 	ProcessASLRPolicy                  = 1
  21291 	ProcessDynamicCodePolicy           = 2
  21292 	ProcessStrictHandleCheckPolicy     = 3
  21293 	ProcessSystemCallDisablePolicy     = 4
  21294 	ProcessMitigationOptionsMask       = 5
  21295 	ProcessExtensionPointDisablePolicy = 6
  21296 	ProcessControlFlowGuardPolicy      = 7
  21297 	ProcessSignaturePolicy             = 8
  21298 	ProcessFontDisablePolicy           = 9
  21299 	ProcessImageLoadPolicy             = 10
  21300 	MaxProcessMitigationPolicy         = 11
  21301 )
  21302 
  21303 const (
  21304 	ToleranceLow    = 1
  21305 	ToleranceMedium = 2
  21306 	ToleranceHigh   = 3
  21307 )
  21308 
  21309 const (
  21310 	ToleranceIntervalShort  = 1
  21311 	ToleranceIntervalMedium = 2
  21312 	ToleranceIntervalLong   = 3
  21313 )
  21314 
  21315 const (
  21316 	JobObjectBasicAccountingInformation         = 1
  21317 	JobObjectBasicLimitInformation              = 2
  21318 	JobObjectBasicProcessIdList                 = 3
  21319 	JobObjectBasicUIRestrictions                = 4
  21320 	JobObjectSecurityLimitInformation           = 5
  21321 	JobObjectEndOfJobTimeInformation            = 6
  21322 	JobObjectAssociateCompletionPortInformation = 7
  21323 	JobObjectBasicAndIoAccountingInformation    = 8
  21324 	JobObjectExtendedLimitInformation           = 9
  21325 	JobObjectJobSetInformation                  = 10
  21326 	JobObjectGroupInformation                   = 11
  21327 	JobObjectNotificationLimitInformation       = 12
  21328 	JobObjectLimitViolationInformation          = 13
  21329 	JobObjectGroupInformationEx                 = 14
  21330 	JobObjectCpuRateControlInformation          = 15
  21331 	JobObjectCompletionFilter                   = 16
  21332 	JobObjectCompletionCounter                  = 17
  21333 	JobObjectReserved1Information               = 18
  21334 	JobObjectReserved2Information               = 19
  21335 	JobObjectReserved3Information               = 20
  21336 	JobObjectReserved4Information               = 21
  21337 	JobObjectReserved5Information               = 22
  21338 	JobObjectReserved6Information               = 23
  21339 	JobObjectReserved7Information               = 24
  21340 	JobObjectReserved8Information               = 25
  21341 	MaxJobObjectInfoClass                       = 26
  21342 )
  21343 
  21344 const (
  21345 	FirmwareTypeUnknown = 0
  21346 	FirmwareTypeBios    = 1
  21347 	FirmwareTypeUefi    = 2
  21348 	FirmwareTypeMax     = 3
  21349 )
  21350 
  21351 const (
  21352 	RelationProcessorCore    = 0
  21353 	RelationNumaNode         = 1
  21354 	RelationCache            = 2
  21355 	RelationProcessorPackage = 3
  21356 	RelationGroup            = 4
  21357 	RelationAll              = 65535
  21358 )
  21359 
  21360 const (
  21361 	CacheUnified     = 0
  21362 	CacheInstruction = 1
  21363 	CacheData        = 2
  21364 	CacheTrace       = 3
  21365 )
  21366 
  21367 const (
  21368 	UNSPECIFIED_COMPARTMENT_ID = 0
  21369 	DEFAULT_COMPARTMENT_ID     = 1
  21370 )
  21371 
  21372 const (
  21373 	MemExtendedParameterInvalidType         = 0
  21374 	MemExtendedParameterAddressRequirements = 1
  21375 	MemExtendedParameterNumaNode            = 2
  21376 	MemExtendedParameterPartitionHandle     = 3
  21377 	MemExtendedParameterUserPhysicalHandle  = 4
  21378 	MemExtendedParameterAttributeFlags      = 5
  21379 	MemExtendedParameterMax                 = 6
  21380 )
  21381 
  21382 const (
  21383 	MemSectionExtendedParameterInvalidType       = 0
  21384 	MemSectionExtendedParameterUserPhysicalFlags = 1
  21385 	MemSectionExtendedParameterNumaNode          = 2
  21386 	MemSectionExtendedParameterMax               = 3
  21387 )
  21388 
  21389 const (
  21390 	PowerSystemUnspecified = 0
  21391 	PowerSystemWorking     = 1
  21392 	PowerSystemSleeping1   = 2
  21393 	PowerSystemSleeping2   = 3
  21394 	PowerSystemSleeping3   = 4
  21395 	PowerSystemHibernate   = 5
  21396 	PowerSystemShutdown    = 6
  21397 	PowerSystemMaximum     = 7
  21398 )
  21399 
  21400 const (
  21401 	PowerActionNone          = 0
  21402 	PowerActionReserved      = 1
  21403 	PowerActionSleep         = 2
  21404 	PowerActionHibernate     = 3
  21405 	PowerActionShutdown      = 4
  21406 	PowerActionShutdownReset = 5
  21407 	PowerActionShutdownOff   = 6
  21408 	PowerActionWarmEject     = 7
  21409 )
  21410 
  21411 const (
  21412 	PowerDeviceUnspecified = 0
  21413 	PowerDeviceD0          = 1
  21414 	PowerDeviceD1          = 2
  21415 	PowerDeviceD2          = 3
  21416 	PowerDeviceD3          = 4
  21417 	PowerDeviceMaximum     = 5
  21418 )
  21419 
  21420 const (
  21421 	PowerMonitorOff = 0
  21422 	PowerMonitorOn  = 1
  21423 	PowerMonitorDim = 2
  21424 )
  21425 
  21426 const (
  21427 	PowerUserPresent    = 0
  21428 	PowerUserNotPresent = 1
  21429 	PowerUserInactive   = 2
  21430 	PowerUserMaximum    = 3
  21431 	PowerUserInvalid    = 3
  21432 )
  21433 
  21434 const (
  21435 	LT_DONT_CARE      = 0
  21436 	LT_LOWEST_LATENCY = 1
  21437 )
  21438 
  21439 const (
  21440 	PowerRequestDisplayRequired   = 0
  21441 	PowerRequestSystemRequired    = 1
  21442 	PowerRequestAwayModeRequired  = 2
  21443 	PowerRequestExecutionRequired = 3
  21444 )
  21445 
  21446 const (
  21447 	SystemPowerPolicyAc                = 0
  21448 	SystemPowerPolicyDc                = 1
  21449 	VerifySystemPolicyAc               = 2
  21450 	VerifySystemPolicyDc               = 3
  21451 	SystemPowerCapabilities            = 4
  21452 	SystemBatteryState                 = 5
  21453 	SystemPowerStateHandler            = 6
  21454 	ProcessorStateHandler              = 7
  21455 	SystemPowerPolicyCurrent           = 8
  21456 	AdministratorPowerPolicy           = 9
  21457 	SystemReserveHiberFile             = 10
  21458 	ProcessorInformation               = 11
  21459 	SystemPowerInformation             = 12
  21460 	ProcessorStateHandler2             = 13
  21461 	LastWakeTime                       = 14
  21462 	LastSleepTime                      = 15
  21463 	SystemExecutionState               = 16
  21464 	SystemPowerStateNotifyHandler      = 17
  21465 	ProcessorPowerPolicyAc             = 18
  21466 	ProcessorPowerPolicyDc             = 19
  21467 	VerifyProcessorPowerPolicyAc       = 20
  21468 	VerifyProcessorPowerPolicyDc       = 21
  21469 	ProcessorPowerPolicyCurrent        = 22
  21470 	SystemPowerStateLogging            = 23
  21471 	SystemPowerLoggingEntry            = 24
  21472 	SetPowerSettingValue               = 25
  21473 	NotifyUserPowerSetting             = 26
  21474 	PowerInformationLevelUnused0       = 27
  21475 	SystemMonitorHiberBootPowerOff     = 28
  21476 	SystemVideoState                   = 29
  21477 	TraceApplicationPowerMessage       = 30
  21478 	TraceApplicationPowerMessageEnd    = 31
  21479 	ProcessorPerfStates                = 32
  21480 	ProcessorIdleStates                = 33
  21481 	ProcessorCap                       = 34
  21482 	SystemWakeSource                   = 35
  21483 	SystemHiberFileInformation         = 36
  21484 	TraceServicePowerMessage           = 37
  21485 	ProcessorLoad                      = 38
  21486 	PowerShutdownNotification          = 39
  21487 	MonitorCapabilities                = 40
  21488 	SessionPowerInit                   = 41
  21489 	SessionDisplayState                = 42
  21490 	PowerRequestCreate                 = 43
  21491 	PowerRequestAction                 = 44
  21492 	GetPowerRequestList                = 45
  21493 	ProcessorInformationEx             = 46
  21494 	NotifyUserModeLegacyPowerEvent     = 47
  21495 	GroupPark                          = 48
  21496 	ProcessorIdleDomains               = 49
  21497 	WakeTimerList                      = 50
  21498 	SystemHiberFileSize                = 51
  21499 	ProcessorIdleStatesHv              = 52
  21500 	ProcessorPerfStatesHv              = 53
  21501 	ProcessorPerfCapHv                 = 54
  21502 	ProcessorSetIdle                   = 55
  21503 	LogicalProcessorIdling             = 56
  21504 	UserPresence                       = 57
  21505 	PowerSettingNotificationName       = 58
  21506 	GetPowerSettingValue               = 59
  21507 	IdleResiliency                     = 60
  21508 	SessionRITState                    = 61
  21509 	SessionConnectNotification         = 62
  21510 	SessionPowerCleanup                = 63
  21511 	SessionLockState                   = 64
  21512 	SystemHiberbootState               = 65
  21513 	PlatformInformation                = 66
  21514 	PdcInvocation                      = 67
  21515 	MonitorInvocation                  = 68
  21516 	FirmwareTableInformationRegistered = 69
  21517 	SetShutdownSelectedTime            = 70
  21518 	SuspendResumeInvocation            = 71
  21519 	PlmPowerRequestCreate              = 72
  21520 	ScreenOff                          = 73
  21521 	CsDeviceNotification               = 74
  21522 	PlatformRole                       = 75
  21523 	LastResumePerformance              = 76
  21524 	DisplayBurst                       = 77
  21525 	ExitLatencySamplingPercentage      = 78
  21526 	ApplyLowPowerScenarioSettings      = 79
  21527 	PowerInformationLevelMaximum       = 80
  21528 )
  21529 
  21530 const (
  21531 	UserNotPresent = 0
  21532 	UserPresent    = 1
  21533 	UserUnknown    = 255
  21534 )
  21535 
  21536 const (
  21537 	MonitorRequestReasonUnknown                 = 0
  21538 	MonitorRequestReasonPowerButton             = 1
  21539 	MonitorRequestReasonRemoteConnection        = 2
  21540 	MonitorRequestReasonScMonitorpower          = 3
  21541 	MonitorRequestReasonUserInput               = 4
  21542 	MonitorRequestReasonAcDcDisplayBurst        = 5
  21543 	MonitorRequestReasonUserDisplayBurst        = 6
  21544 	MonitorRequestReasonPoSetSystemState        = 7
  21545 	MonitorRequestReasonSetThreadExecutionState = 8
  21546 	MonitorRequestReasonFullWake                = 9
  21547 	MonitorRequestReasonSessionUnlock           = 10
  21548 	MonitorRequestReasonScreenOffRequest        = 11
  21549 	MonitorRequestReasonIdleTimeout             = 12
  21550 	MonitorRequestReasonPolicyChange            = 13
  21551 	MonitorRequestReasonMax                     = 14
  21552 )
  21553 
  21554 const (
  21555 	PoAc               = 0
  21556 	PoDc               = 1
  21557 	PoHot              = 2
  21558 	PoConditionMaximum = 3
  21559 )
  21560 
  21561 const (
  21562 	PlatformRoleUnspecified       = 0
  21563 	PlatformRoleDesktop           = 1
  21564 	PlatformRoleMobile            = 2
  21565 	PlatformRoleWorkstation       = 3
  21566 	PlatformRoleEnterpriseServer  = 4
  21567 	PlatformRoleSOHOServer        = 5
  21568 	PlatformRoleAppliancePC       = 6
  21569 	PlatformRolePerformanceServer = 7
  21570 	PlatformRoleSlate             = 8
  21571 	PlatformRoleMaximum           = 9
  21572 )
  21573 
  21574 const (
  21575 	IMAGE_AUX_SYMBOL_TYPE_TOKEN_DEF = 1
  21576 )
  21577 
  21578 const (
  21579 	IMPORT_OBJECT_CODE  = 0
  21580 	IMPORT_OBJECT_DATA  = 1
  21581 	IMPORT_OBJECT_CONST = 2
  21582 )
  21583 
  21584 const (
  21585 	IMPORT_OBJECT_ORDINAL         = 0
  21586 	IMPORT_OBJECT_NAME            = 1
  21587 	IMPORT_OBJECT_NAME_NO_PREFIX  = 2
  21588 	IMPORT_OBJECT_NAME_UNDECORATE = 3
  21589 )
  21590 
  21591 const (
  21592 	COMIMAGE_FLAGS_ILONLY                = 1
  21593 	COMIMAGE_FLAGS_32BITREQUIRED         = 2
  21594 	COMIMAGE_FLAGS_IL_LIBRARY            = 4
  21595 	COMIMAGE_FLAGS_STRONGNAMESIGNED      = 8
  21596 	COMIMAGE_FLAGS_TRACKDEBUGDATA        = 65536
  21597 	COR_VERSION_MAJOR_V2                 = 2
  21598 	COR_VERSION_MAJOR                    = 2
  21599 	COR_VERSION_MINOR                    = 0
  21600 	COR_DELETED_NAME_LENGTH              = 8
  21601 	COR_VTABLEGAP_NAME_LENGTH            = 8
  21602 	NATIVE_TYPE_MAX_CB                   = 1
  21603 	COR_ILMETHOD_SECT_SMALL_MAX_DATASIZE = 255
  21604 	IMAGE_COR_MIH_METHODRVA              = 1
  21605 	IMAGE_COR_MIH_EHRVA                  = 2
  21606 	IMAGE_COR_MIH_BASICBLOCK             = 8
  21607 	COR_VTABLE_32BIT                     = 1
  21608 	COR_VTABLE_64BIT                     = 2
  21609 	COR_VTABLE_FROM_UNMANAGED            = 4
  21610 	COR_VTABLE_CALL_MOST_DERIVED         = 16
  21611 	IMAGE_COR_EATJ_THUNK_SIZE            = 32
  21612 	MAX_CLASS_NAME                       = 1024
  21613 	MAX_PACKAGE_NAME                     = 1024
  21614 )
  21615 
  21616 const (
  21617 	UmsThreadInvalidInfoClass = 0
  21618 	UmsThreadUserContext      = 1
  21619 	UmsThreadPriority         = 2
  21620 	UmsThreadAffinity         = 3
  21621 	UmsThreadTeb              = 4
  21622 	UmsThreadIsSuspended      = 5
  21623 	UmsThreadIsTerminated     = 6
  21624 	UmsThreadMaxInfoClass     = 7
  21625 )
  21626 
  21627 const (
  21628 	UmsSchedulerStartup       = 0
  21629 	UmsSchedulerThreadBlocked = 1
  21630 	UmsSchedulerThreadYield   = 2
  21631 )
  21632 
  21633 const (
  21634 	HeapCompatibilityInformation      = 0
  21635 	HeapEnableTerminationOnCorruption = 1
  21636 )
  21637 
  21638 const (
  21639 	ActivationContextBasicInformation                      = 1
  21640 	ActivationContextDetailedInformation                   = 2
  21641 	AssemblyDetailedInformationInActivationContext         = 3
  21642 	FileInformationInAssemblyOfAssemblyInActivationContext = 4
  21643 	RunlevelInformationInActivationContext                 = 5
  21644 	CompatibilityInformationInActivationContext            = 6
  21645 	ActivationContextManifestResourceName                  = 7
  21646 	MaxActivationContextInfoClass                          = 8
  21647 	AssemblyDetailedInformationInActivationContxt          = 3
  21648 	FileInformationInAssemblyOfAssemblyInActivationContxt  = 4
  21649 )
  21650 
  21651 const (
  21652 	ACTCTX_RUN_LEVEL_UNSPECIFIED       = 0
  21653 	ACTCTX_RUN_LEVEL_AS_INVOKER        = 1
  21654 	ACTCTX_RUN_LEVEL_HIGHEST_AVAILABLE = 2
  21655 	ACTCTX_RUN_LEVEL_REQUIRE_ADMIN     = 3
  21656 	ACTCTX_RUN_LEVEL_NUMBERS           = 4
  21657 )
  21658 
  21659 const (
  21660 	ACTCTX_COMPATIBILITY_ELEMENT_TYPE_UNKNOWN    = 0
  21661 	ACTCTX_COMPATIBILITY_ELEMENT_TYPE_OS         = 1
  21662 	ACTCTX_COMPATIBILITY_ELEMENT_TYPE_MITIGATION = 2
  21663 )
  21664 
  21665 const (
  21666 	DriverType               = 1
  21667 	FileSystemType           = 2
  21668 	Win32ServiceOwnProcess   = 16
  21669 	Win32ServiceShareProcess = 32
  21670 	AdapterType              = 4
  21671 	RecognizerType           = 8
  21672 )
  21673 
  21674 const (
  21675 	BootLoad    = 0
  21676 	SystemLoad  = 1
  21677 	AutoLoad    = 2
  21678 	DemandLoad  = 3
  21679 	DisableLoad = 4
  21680 )
  21681 
  21682 const (
  21683 	IgnoreError   = 0
  21684 	NormalError   = 1
  21685 	SevereError   = 2
  21686 	CriticalError = 3
  21687 )
  21688 
  21689 const (
  21690 	TapeDriveProblemNone         = 0
  21691 	TapeDriveReadWriteWarning    = 1
  21692 	TapeDriveReadWriteError      = 2
  21693 	TapeDriveReadWarning         = 3
  21694 	TapeDriveWriteWarning        = 4
  21695 	TapeDriveReadError           = 5
  21696 	TapeDriveWriteError          = 6
  21697 	TapeDriveHardwareError       = 7
  21698 	TapeDriveUnsupportedMedia    = 8
  21699 	TapeDriveScsiConnectionError = 9
  21700 	TapeDriveTimetoClean         = 10
  21701 	TapeDriveCleanDriveNow       = 11
  21702 	TapeDriveMediaLifeExpired    = 12
  21703 	TapeDriveSnappedTape         = 13
  21704 )
  21705 
  21706 const (
  21707 	TP_CALLBACK_PRIORITY_HIGH    = 0
  21708 	TP_CALLBACK_PRIORITY_NORMAL  = 1
  21709 	TP_CALLBACK_PRIORITY_LOW     = 2
  21710 	TP_CALLBACK_PRIORITY_INVALID = 3
  21711 	TP_CALLBACK_PRIORITY_COUNT   = 3
  21712 )
  21713 
  21714 const (
  21715 	TransactionOutcomeUndetermined = 1
  21716 	TransactionOutcomeCommitted    = 2
  21717 	TransactionOutcomeAborted      = 3
  21718 )
  21719 
  21720 const (
  21721 	TransactionStateNormal          = 1
  21722 	TransactionStateIndoubt         = 2
  21723 	TransactionStateCommittedNotify = 3
  21724 )
  21725 
  21726 const (
  21727 	TransactionBasicInformation              = 0
  21728 	TransactionPropertiesInformation         = 1
  21729 	TransactionEnlistmentInformation         = 2
  21730 	TransactionSuperiorEnlistmentInformation = 3
  21731 	TransactionBindInformation               = 4
  21732 	TransactionDTCPrivateInformation         = 5
  21733 )
  21734 
  21735 const (
  21736 	TransactionManagerBasicInformation             = 0
  21737 	TransactionManagerLogInformation               = 1
  21738 	TransactionManagerLogPathInformation           = 2
  21739 	TransactionManagerOnlineProbeInformation       = 3
  21740 	TransactionManagerRecoveryInformation          = 4
  21741 	TransactionManagerOldestTransactionInformation = 5
  21742 )
  21743 
  21744 const (
  21745 	ResourceManagerBasicInformation      = 0
  21746 	ResourceManagerCompletionInformation = 1
  21747 )
  21748 
  21749 const (
  21750 	EnlistmentBasicInformation    = 0
  21751 	EnlistmentRecoveryInformation = 1
  21752 	EnlistmentCrmInformation      = 2
  21753 )
  21754 
  21755 const (
  21756 	KTMOBJECT_TRANSACTION         = 0
  21757 	KTMOBJECT_TRANSACTION_MANAGER = 1
  21758 	KTMOBJECT_RESOURCE_MANAGER    = 2
  21759 	KTMOBJECT_ENLISTMENT          = 3
  21760 	KTMOBJECT_INVALID             = 4
  21761 )
  21762 
  21763 const (
  21764 	BIDI_NULL   = 0
  21765 	BIDI_INT    = 1
  21766 	BIDI_FLOAT  = 2
  21767 	BIDI_BOOL   = 3
  21768 	BIDI_STRING = 4
  21769 	BIDI_TEXT   = 5
  21770 	BIDI_ENUM   = 6
  21771 	BIDI_BLOB   = 7
  21772 )
  21773 
  21774 const (
  21775 	SC_ACTION_NONE        = 0
  21776 	SC_ACTION_RESTART     = 1
  21777 	SC_ACTION_REBOOT      = 2
  21778 	SC_ACTION_RUN_COMMAND = 3
  21779 )
  21780 
  21781 const (
  21782 	SC_STATUS_PROCESS_INFO = 0
  21783 )
  21784 
  21785 const (
  21786 	SC_ENUM_PROCESS_INFO = 0
  21787 )
  21788 
  21789 const (
  21790 	DCDC_DEFAULT             = 0
  21791 	DCDC_DISABLE_FONT_UPDATE = 1
  21792 	DCDC_DISABLE_RELAYOUT    = 2
  21793 )
  21794 
  21795 const (
  21796 	DDC_DEFAULT                  = 0
  21797 	DDC_DISABLE_ALL              = 1
  21798 	DDC_DISABLE_RESIZE           = 2
  21799 	DDC_DISABLE_CONTROL_RELAYOUT = 4
  21800 )
  21801 
  21802 const (
  21803 	DVASPECT_CONTENT   = 1
  21804 	DVASPECT_THUMBNAIL = 2
  21805 	DVASPECT_ICON      = 4
  21806 	DVASPECT_DOCPRINT  = 8
  21807 )
  21808 
  21809 const (
  21810 	STGC_DEFAULT                            = 0
  21811 	STGC_OVERWRITE                          = 1
  21812 	STGC_ONLYIFCURRENT                      = 2
  21813 	STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE = 4
  21814 	STGC_CONSOLIDATE                        = 8
  21815 )
  21816 
  21817 const (
  21818 	STGMOVE_MOVE        = 0
  21819 	STGMOVE_COPY        = 1
  21820 	STGMOVE_SHALLOWCOPY = 2
  21821 )
  21822 
  21823 const (
  21824 	STATFLAG_DEFAULT = 0
  21825 	STATFLAG_NONAME  = 1
  21826 	STATFLAG_NOOPEN  = 2
  21827 )
  21828 
  21829 const (
  21830 	VT_EMPTY            = 0
  21831 	VT_NULL             = 1
  21832 	VT_I2               = 2
  21833 	VT_I4               = 3
  21834 	VT_R4               = 4
  21835 	VT_R8               = 5
  21836 	VT_CY               = 6
  21837 	VT_DATE             = 7
  21838 	VT_BSTR             = 8
  21839 	VT_DISPATCH         = 9
  21840 	VT_ERROR            = 10
  21841 	VT_BOOL             = 11
  21842 	VT_VARIANT          = 12
  21843 	VT_UNKNOWN          = 13
  21844 	VT_DECIMAL          = 14
  21845 	VT_I1               = 16
  21846 	VT_UI1              = 17
  21847 	VT_UI2              = 18
  21848 	VT_UI4              = 19
  21849 	VT_I8               = 20
  21850 	VT_UI8              = 21
  21851 	VT_INT              = 22
  21852 	VT_UINT             = 23
  21853 	VT_VOID             = 24
  21854 	VT_HRESULT          = 25
  21855 	VT_PTR              = 26
  21856 	VT_SAFEARRAY        = 27
  21857 	VT_CARRAY           = 28
  21858 	VT_USERDEFINED      = 29
  21859 	VT_LPSTR            = 30
  21860 	VT_LPWSTR           = 31
  21861 	VT_RECORD           = 36
  21862 	VT_INT_PTR          = 37
  21863 	VT_UINT_PTR         = 38
  21864 	VT_FILETIME         = 64
  21865 	VT_BLOB             = 65
  21866 	VT_STREAM           = 66
  21867 	VT_STORAGE          = 67
  21868 	VT_STREAMED_OBJECT  = 68
  21869 	VT_STORED_OBJECT    = 69
  21870 	VT_BLOB_OBJECT      = 70
  21871 	VT_CF               = 71
  21872 	VT_CLSID            = 72
  21873 	VT_VERSIONED_STREAM = 73
  21874 	VT_BSTR_BLOB        = 4095
  21875 	VT_VECTOR           = 4096
  21876 	VT_ARRAY            = 8192
  21877 	VT_BYREF            = 16384
  21878 	VT_RESERVED         = 32768
  21879 	VT_ILLEGAL          = 65535
  21880 	VT_ILLEGALMASKED    = 4095
  21881 	VT_TYPEMASK         = 4095
  21882 )
  21883 
  21884 const (
  21885 	TYSPEC_CLSID       = 0
  21886 	TYSPEC_FILEEXT     = 1
  21887 	TYSPEC_MIMETYPE    = 2
  21888 	TYSPEC_FILENAME    = 3
  21889 	TYSPEC_PROGID      = 4
  21890 	TYSPEC_PACKAGENAME = 5
  21891 	TYSPEC_OBJECTID    = 6
  21892 )
  21893 
  21894 const (
  21895 	MEMCTX_TASK      = 1
  21896 	MEMCTX_SHARED    = 2
  21897 	MEMCTX_MACSYSTEM = 3
  21898 	MEMCTX_UNKNOWN   = -1
  21899 	MEMCTX_SAME      = -2
  21900 )
  21901 
  21902 const (
  21903 	CLSCTX_INPROC_SERVER          = 1
  21904 	CLSCTX_INPROC_HANDLER         = 2
  21905 	CLSCTX_LOCAL_SERVER           = 4
  21906 	CLSCTX_INPROC_SERVER16        = 8
  21907 	CLSCTX_REMOTE_SERVER          = 16
  21908 	CLSCTX_INPROC_HANDLER16       = 32
  21909 	CLSCTX_RESERVED1              = 64
  21910 	CLSCTX_RESERVED2              = 128
  21911 	CLSCTX_RESERVED3              = 256
  21912 	CLSCTX_RESERVED4              = 512
  21913 	CLSCTX_NO_CODE_DOWNLOAD       = 1024
  21914 	CLSCTX_RESERVED5              = 2048
  21915 	CLSCTX_NO_CUSTOM_MARSHAL      = 4096
  21916 	CLSCTX_ENABLE_CODE_DOWNLOAD   = 8192
  21917 	CLSCTX_NO_FAILURE_LOG         = 16384
  21918 	CLSCTX_DISABLE_AAA            = 32768
  21919 	CLSCTX_ENABLE_AAA             = 65536
  21920 	CLSCTX_FROM_DEFAULT_CONTEXT   = 131072
  21921 	CLSCTX_ACTIVATE_32_BIT_SERVER = 262144
  21922 	CLSCTX_ACTIVATE_64_BIT_SERVER = 524288
  21923 	CLSCTX_ENABLE_CLOAKING        = 1048576
  21924 	CLSCTX_APPCONTAINER           = 4194304
  21925 	CLSCTX_ACTIVATE_AAA_AS_IU     = 8388608
  21926 	CLSCTX_PS_DLL                 = -2147483648
  21927 )
  21928 
  21929 const (
  21930 	MSHLFLAGS_NORMAL      = 0
  21931 	MSHLFLAGS_TABLESTRONG = 1
  21932 	MSHLFLAGS_TABLEWEAK   = 2
  21933 	MSHLFLAGS_NOPING      = 4
  21934 	MSHLFLAGS_RESERVED1   = 8
  21935 	MSHLFLAGS_RESERVED2   = 16
  21936 	MSHLFLAGS_RESERVED3   = 32
  21937 	MSHLFLAGS_RESERVED4   = 64
  21938 )
  21939 
  21940 const (
  21941 	MSHCTX_LOCAL            = 0
  21942 	MSHCTX_NOSHAREDMEM      = 1
  21943 	MSHCTX_DIFFERENTMACHINE = 2
  21944 	MSHCTX_INPROC           = 3
  21945 	MSHCTX_CROSSCTX         = 4
  21946 )
  21947 
  21948 type Ptrdiff_t = int64
  21949 
  21950 type Size_t = uint64
  21951 
  21952 type Wchar_t = uint16
  21953 
  21954 type X__int128_t = struct {
  21955 	Flo int64
  21956 	Fhi int64
  21957 }
  21958 type X__uint128_t = struct {
  21959 	Flo uint64
  21960 	Fhi uint64
  21961 }
  21962 
  21963 type X__builtin_va_list = uintptr
  21964 type X__float128 = float64
  21965 
  21966 type Va_list = X__builtin_va_list
  21967 
  21968 type X__gnuc_va_list = X__builtin_va_list
  21969 
  21970 // CAPI3REF: Run-Time Library Version Numbers
  21971 // KEYWORDS: sqlite3_version sqlite3_sourceid
  21972 //
  21973 // These interfaces provide the same information as the [SQLITE_VERSION],
  21974 // [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
  21975 // but are associated with the library instead of the header file.  ^(Cautious
  21976 // programmers might include assert() statements in their application to
  21977 // verify that values returned by these interfaces match the macros in
  21978 // the header, and thus ensure that the application is
  21979 // compiled with matching library and header files.
  21980 //
  21981 //	assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
  21982 //	assert( strncmp(sqlite3_sourceid(),SQLITE_SOURCE_ID,80)==0 );
  21983 //	assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );
  21984 //
  21985 // ^The sqlite3_version[] string constant contains the text of [SQLITE_VERSION]
  21986 // macro.  ^The sqlite3_libversion() function returns a pointer to the
  21987 // to the sqlite3_version[] string constant.  The sqlite3_libversion()
  21988 // function is provided for use in DLLs since DLL users usually do not have
  21989 // direct access to string constants within the DLL.  ^The
  21990 // sqlite3_libversion_number() function returns an integer equal to
  21991 // [SQLITE_VERSION_NUMBER].  ^(The sqlite3_sourceid() function returns
  21992 // a pointer to a string constant whose value is the same as the
  21993 // [SQLITE_SOURCE_ID] C preprocessor macro.  Except if SQLite is built
  21994 // using an edited copy of [the amalgamation], then the last four characters
  21995 // of the hash might be different from [SQLITE_SOURCE_ID].)^
  21996 //
  21997 // See also: [sqlite_version()] and [sqlite_source_id()].
  21998 var Xsqlite3_version = *(*[7]int8)(unsafe.Pointer(ts))
  21999 
  22000 type sqlite3 = struct {
  22001 	FpVfs                   uintptr
  22002 	FpVdbe                  uintptr
  22003 	FpDfltColl              uintptr
  22004 	Fmutex                  uintptr
  22005 	FaDb                    uintptr
  22006 	FnDb                    int32
  22007 	FmDbFlags               U32
  22008 	Fflags                  U64
  22009 	FlastRowid              I64
  22010 	FszMmap                 I64
  22011 	FnSchemaLock            U32
  22012 	FopenFlags              uint32
  22013 	FerrCode                int32
  22014 	FerrByteOffset          int32
  22015 	FerrMask                int32
  22016 	FiSysErrno              int32
  22017 	FdbOptFlags             U32
  22018 	Fenc                    U8
  22019 	FautoCommit             U8
  22020 	Ftemp_store             U8
  22021 	FmallocFailed           U8
  22022 	FbBenignMalloc          U8
  22023 	FdfltLockMode           U8
  22024 	FnextAutovac            int8
  22025 	FsuppressErr            U8
  22026 	FvtabOnConflict         U8
  22027 	FisTransactionSavepoint U8
  22028 	FmTrace                 U8
  22029 	FnoSharedCache          U8
  22030 	FnSqlExec               U8
  22031 	FeOpenState             U8
  22032 	F__ccgo_pad1            [2]byte
  22033 	FnextPagesize           int32
  22034 	FnChange                I64
  22035 	FnTotalChange           I64
  22036 	FaLimit                 [12]int32
  22037 	FnMaxSorterMmap         int32
  22038 	F__ccgo_pad2            [4]byte
  22039 	Finit                   struct {
  22040 		FnewTnum       Pgno
  22041 		FiDb           U8
  22042 		Fbusy          U8
  22043 		F__ccgo_pad1   [2]byte
  22044 		ForphanTrigger uint8
  22045 		F__ccgo_pad2   [7]byte
  22046 		FazInit        uintptr
  22047 	}
  22048 	FnVdbeActive        int32
  22049 	FnVdbeRead          int32
  22050 	FnVdbeWrite         int32
  22051 	FnVdbeExec          int32
  22052 	FnVDestroy          int32
  22053 	FnExtension         int32
  22054 	FaExtension         uintptr
  22055 	Ftrace              struct{ FxLegacy uintptr }
  22056 	FpTraceArg          uintptr
  22057 	FxProfile           uintptr
  22058 	FpProfileArg        uintptr
  22059 	FpCommitArg         uintptr
  22060 	FxCommitCallback    uintptr
  22061 	FpRollbackArg       uintptr
  22062 	FxRollbackCallback  uintptr
  22063 	FpUpdateArg         uintptr
  22064 	FxUpdateCallback    uintptr
  22065 	FpAutovacPagesArg   uintptr
  22066 	FxAutovacDestr      uintptr
  22067 	FxAutovacPages      uintptr
  22068 	FpParse             uintptr
  22069 	FpPreUpdateArg      uintptr
  22070 	FxPreUpdateCallback uintptr
  22071 	FpPreUpdate         uintptr
  22072 	FxWalCallback       uintptr
  22073 	FpWalArg            uintptr
  22074 	FxCollNeeded        uintptr
  22075 	FxCollNeeded16      uintptr
  22076 	FpCollNeededArg     uintptr
  22077 	FpErr               uintptr
  22078 	Fu1                 struct {
  22079 		F__ccgo_pad1   [0]uint64
  22080 		FisInterrupted int32
  22081 		F__ccgo_pad2   [4]byte
  22082 	}
  22083 	Flookaside           Lookaside
  22084 	FxAuth               Sqlite3_xauth
  22085 	FpAuthArg            uintptr
  22086 	FxProgress           uintptr
  22087 	FpProgressArg        uintptr
  22088 	FnProgressOps        uint32
  22089 	FnVTrans             int32
  22090 	FaModule             Hash
  22091 	FpVtabCtx            uintptr
  22092 	FaVTrans             uintptr
  22093 	FpDisconnect         uintptr
  22094 	FaFunc               Hash
  22095 	FaCollSeq            Hash
  22096 	FbusyHandler         BusyHandler
  22097 	FaDbStatic           [2]Db
  22098 	FpSavepoint          uintptr
  22099 	FnAnalysisLimit      int32
  22100 	FbusyTimeout         int32
  22101 	FnSavepoint          int32
  22102 	FnStatement          int32
  22103 	FnDeferredCons       I64
  22104 	FnDeferredImmCons    I64
  22105 	FpnBytesFreed        uintptr
  22106 	FpBlockingConnection uintptr
  22107 	FpUnlockConnection   uintptr
  22108 	FpUnlockArg          uintptr
  22109 	FxUnlockNotify       uintptr
  22110 	FpNextBlocked        uintptr
  22111 }
  22112 
  22113 // CAPI3REF: Database Connection Handle
  22114 // KEYWORDS: {database connection} {database connections}
  22115 //
  22116 // Each open SQLite database is represented by a pointer to an instance of
  22117 // the opaque structure named "sqlite3".  It is useful to think of an sqlite3
  22118 // pointer as an object.  The [sqlite3_open()], [sqlite3_open16()], and
  22119 // [sqlite3_open_v2()] interfaces are its constructors, and [sqlite3_close()]
  22120 // and [sqlite3_close_v2()] are its destructors.  There are many other
  22121 // interfaces (such as
  22122 // [sqlite3_prepare_v2()], [sqlite3_create_function()], and
  22123 // [sqlite3_busy_timeout()] to name but three) that are methods on an
  22124 // sqlite3 object.
  22125 type Sqlite3 = sqlite3
  22126 
  22127 // CAPI3REF: 64-Bit Integer Types
  22128 // KEYWORDS: sqlite_int64 sqlite_uint64
  22129 //
  22130 // Because there is no cross-platform way to specify 64-bit integer types
  22131 // SQLite includes typedefs for 64-bit signed and unsigned integers.
  22132 //
  22133 // The sqlite3_int64 and sqlite3_uint64 are the preferred type definitions.
  22134 // The sqlite_int64 and sqlite_uint64 types are supported for backwards
  22135 // compatibility only.
  22136 //
  22137 // ^The sqlite3_int64 and sqlite_int64 types can store integer values
  22138 // between -9223372036854775808 and +9223372036854775807 inclusive.  ^The
  22139 // sqlite3_uint64 and sqlite_uint64 types can store integer values
  22140 // between 0 and +18446744073709551615 inclusive.
  22141 type Sqlite_int64 = int64
  22142 type Sqlite_uint64 = uint64
  22143 type Sqlite3_int64 = Sqlite_int64
  22144 type Sqlite3_uint64 = Sqlite_uint64
  22145 
  22146 // The type for a callback function.
  22147 // This is legacy and deprecated.  It is included for historical
  22148 // compatibility and is not documented.
  22149 type Sqlite3_callback = uintptr
  22150 
  22151 type sqlite3_file = struct{ FpMethods uintptr }
  22152 
  22153 // CAPI3REF: OS Interface Open File Handle
  22154 //
  22155 // An [sqlite3_file] object represents an open file in the
  22156 // [sqlite3_vfs | OS interface layer].  Individual OS interface
  22157 // implementations will
  22158 // want to subclass this object by appending additional fields
  22159 // for their own use.  The pMethods entry is a pointer to an
  22160 // [sqlite3_io_methods] object that defines methods for performing
  22161 // I/O operations on the open file.
  22162 type Sqlite3_file = sqlite3_file
  22163 type sqlite3_io_methods = struct {
  22164 	FiVersion               int32
  22165 	F__ccgo_pad1            [4]byte
  22166 	FxClose                 uintptr
  22167 	FxRead                  uintptr
  22168 	FxWrite                 uintptr
  22169 	FxTruncate              uintptr
  22170 	FxSync                  uintptr
  22171 	FxFileSize              uintptr
  22172 	FxLock                  uintptr
  22173 	FxUnlock                uintptr
  22174 	FxCheckReservedLock     uintptr
  22175 	FxFileControl           uintptr
  22176 	FxSectorSize            uintptr
  22177 	FxDeviceCharacteristics uintptr
  22178 	FxShmMap                uintptr
  22179 	FxShmLock               uintptr
  22180 	FxShmBarrier            uintptr
  22181 	FxShmUnmap              uintptr
  22182 	FxFetch                 uintptr
  22183 	FxUnfetch               uintptr
  22184 }
  22185 
  22186 // CAPI3REF: OS Interface File Virtual Methods Object
  22187 //
  22188 // Every file opened by the [sqlite3_vfs.xOpen] method populates an
  22189 // [sqlite3_file] object (or, more commonly, a subclass of the
  22190 // [sqlite3_file] object) with a pointer to an instance of this object.
  22191 // This object defines the methods used to perform various operations
  22192 // against the open file represented by the [sqlite3_file] object.
  22193 //
  22194 // If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element
  22195 // to a non-NULL pointer, then the sqlite3_io_methods.xClose method
  22196 // may be invoked even if the [sqlite3_vfs.xOpen] reported that it failed.  The
  22197 // only way to prevent a call to xClose following a failed [sqlite3_vfs.xOpen]
  22198 // is for the [sqlite3_vfs.xOpen] to set the sqlite3_file.pMethods element
  22199 // to NULL.
  22200 //
  22201 // The flags argument to xSync may be one of [SQLITE_SYNC_NORMAL] or
  22202 // [SQLITE_SYNC_FULL].  The first choice is the normal fsync().
  22203 // The second choice is a Mac OS X style fullsync.  The [SQLITE_SYNC_DATAONLY]
  22204 // flag may be ORed in to indicate that only the data of the file
  22205 // and not its inode needs to be synced.
  22206 //
  22207 // The integer values to xLock() and xUnlock() are one of
  22208 // <ul>
  22209 // <li> [SQLITE_LOCK_NONE],
  22210 // <li> [SQLITE_LOCK_SHARED],
  22211 // <li> [SQLITE_LOCK_RESERVED],
  22212 // <li> [SQLITE_LOCK_PENDING], or
  22213 // <li> [SQLITE_LOCK_EXCLUSIVE].
  22214 // </ul>
  22215 // xLock() upgrades the database file lock.  In other words, xLock() moves the
  22216 // database file lock in the direction NONE toward EXCLUSIVE. The argument to
  22217 // xLock() is always on of SHARED, RESERVED, PENDING, or EXCLUSIVE, never
  22218 // SQLITE_LOCK_NONE.  If the database file lock is already at or above the
  22219 // requested lock, then the call to xLock() is a no-op.
  22220 // xUnlock() downgrades the database file lock to either SHARED or NONE.
  22221 //
  22222 //	If the lock is already at or below the requested lock state, then the call
  22223 //
  22224 // to xUnlock() is a no-op.
  22225 // The xCheckReservedLock() method checks whether any database connection,
  22226 // either in this process or in some other process, is holding a RESERVED,
  22227 // PENDING, or EXCLUSIVE lock on the file.  It returns true
  22228 // if such a lock exists and false otherwise.
  22229 //
  22230 // The xFileControl() method is a generic interface that allows custom
  22231 // VFS implementations to directly control an open file using the
  22232 // [sqlite3_file_control()] interface.  The second "op" argument is an
  22233 // integer opcode.  The third argument is a generic pointer intended to
  22234 // point to a structure that may contain arguments or space in which to
  22235 // write return values.  Potential uses for xFileControl() might be
  22236 // functions to enable blocking locks with timeouts, to change the
  22237 // locking strategy (for example to use dot-file locks), to inquire
  22238 // about the status of a lock, or to break stale locks.  The SQLite
  22239 // core reserves all opcodes less than 100 for its own use.
  22240 // A [file control opcodes | list of opcodes] less than 100 is available.
  22241 // Applications that define a custom xFileControl method should use opcodes
  22242 // greater than 100 to avoid conflicts.  VFS implementations should
  22243 // return [SQLITE_NOTFOUND] for file control opcodes that they do not
  22244 // recognize.
  22245 //
  22246 // The xSectorSize() method returns the sector size of the
  22247 // device that underlies the file.  The sector size is the
  22248 // minimum write that can be performed without disturbing
  22249 // other bytes in the file.  The xDeviceCharacteristics()
  22250 // method returns a bit vector describing behaviors of the
  22251 // underlying device:
  22252 //
  22253 // <ul>
  22254 // <li> [SQLITE_IOCAP_ATOMIC]
  22255 // <li> [SQLITE_IOCAP_ATOMIC512]
  22256 // <li> [SQLITE_IOCAP_ATOMIC1K]
  22257 // <li> [SQLITE_IOCAP_ATOMIC2K]
  22258 // <li> [SQLITE_IOCAP_ATOMIC4K]
  22259 // <li> [SQLITE_IOCAP_ATOMIC8K]
  22260 // <li> [SQLITE_IOCAP_ATOMIC16K]
  22261 // <li> [SQLITE_IOCAP_ATOMIC32K]
  22262 // <li> [SQLITE_IOCAP_ATOMIC64K]
  22263 // <li> [SQLITE_IOCAP_SAFE_APPEND]
  22264 // <li> [SQLITE_IOCAP_SEQUENTIAL]
  22265 // <li> [SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN]
  22266 // <li> [SQLITE_IOCAP_POWERSAFE_OVERWRITE]
  22267 // <li> [SQLITE_IOCAP_IMMUTABLE]
  22268 // <li> [SQLITE_IOCAP_BATCH_ATOMIC]
  22269 // </ul>
  22270 //
  22271 // The SQLITE_IOCAP_ATOMIC property means that all writes of
  22272 // any size are atomic.  The SQLITE_IOCAP_ATOMICnnn values
  22273 // mean that writes of blocks that are nnn bytes in size and
  22274 // are aligned to an address which is an integer multiple of
  22275 // nnn are atomic.  The SQLITE_IOCAP_SAFE_APPEND value means
  22276 // that when data is appended to a file, the data is appended
  22277 // first then the size of the file is extended, never the other
  22278 // way around.  The SQLITE_IOCAP_SEQUENTIAL property means that
  22279 // information is written to disk in the same order as calls
  22280 // to xWrite().
  22281 //
  22282 // If xRead() returns SQLITE_IOERR_SHORT_READ it must also fill
  22283 // in the unread portions of the buffer with zeros.  A VFS that
  22284 // fails to zero-fill short reads might seem to work.  However,
  22285 // failure to zero-fill short reads will eventually lead to
  22286 // database corruption.
  22287 type Sqlite3_io_methods = sqlite3_io_methods
  22288 
  22289 type sqlite3_api_routines = struct {
  22290 	Faggregate_context      uintptr
  22291 	Faggregate_count        uintptr
  22292 	Fbind_blob              uintptr
  22293 	Fbind_double            uintptr
  22294 	Fbind_int               uintptr
  22295 	Fbind_int64             uintptr
  22296 	Fbind_null              uintptr
  22297 	Fbind_parameter_count   uintptr
  22298 	Fbind_parameter_index   uintptr
  22299 	Fbind_parameter_name    uintptr
  22300 	Fbind_text              uintptr
  22301 	Fbind_text16            uintptr
  22302 	Fbind_value             uintptr
  22303 	Fbusy_handler           uintptr
  22304 	Fbusy_timeout           uintptr
  22305 	Fchanges                uintptr
  22306 	Fclose                  uintptr
  22307 	Fcollation_needed       uintptr
  22308 	Fcollation_needed16     uintptr
  22309 	Fcolumn_blob            uintptr
  22310 	Fcolumn_bytes           uintptr
  22311 	Fcolumn_bytes16         uintptr
  22312 	Fcolumn_count           uintptr
  22313 	Fcolumn_database_name   uintptr
  22314 	Fcolumn_database_name16 uintptr
  22315 	Fcolumn_decltype        uintptr
  22316 	Fcolumn_decltype16      uintptr
  22317 	Fcolumn_double          uintptr
  22318 	Fcolumn_int             uintptr
  22319 	Fcolumn_int64           uintptr
  22320 	Fcolumn_name            uintptr
  22321 	Fcolumn_name16          uintptr
  22322 	Fcolumn_origin_name     uintptr
  22323 	Fcolumn_origin_name16   uintptr
  22324 	Fcolumn_table_name      uintptr
  22325 	Fcolumn_table_name16    uintptr
  22326 	Fcolumn_text            uintptr
  22327 	Fcolumn_text16          uintptr
  22328 	Fcolumn_type            uintptr
  22329 	Fcolumn_value           uintptr
  22330 	Fcommit_hook            uintptr
  22331 	Fcomplete               uintptr
  22332 	Fcomplete16             uintptr
  22333 	Fcreate_collation       uintptr
  22334 	Fcreate_collation16     uintptr
  22335 	Fcreate_function        uintptr
  22336 	Fcreate_function16      uintptr
  22337 	Fcreate_module          uintptr
  22338 	Fdata_count             uintptr
  22339 	Fdb_handle              uintptr
  22340 	Fdeclare_vtab           uintptr
  22341 	Fenable_shared_cache    uintptr
  22342 	Ferrcode                uintptr
  22343 	Ferrmsg                 uintptr
  22344 	Ferrmsg16               uintptr
  22345 	Fexec                   uintptr
  22346 	Fexpired                uintptr
  22347 	Ffinalize               uintptr
  22348 	Ffree                   uintptr
  22349 	Ffree_table             uintptr
  22350 	Fget_autocommit         uintptr
  22351 	Fget_auxdata            uintptr
  22352 	Fget_table              uintptr
  22353 	Fglobal_recover         uintptr
  22354 	Finterruptx             uintptr
  22355 	Flast_insert_rowid      uintptr
  22356 	Flibversion             uintptr
  22357 	Flibversion_number      uintptr
  22358 	Fmalloc                 uintptr
  22359 	Fmprintf                uintptr
  22360 	Fopen                   uintptr
  22361 	Fopen16                 uintptr
  22362 	Fprepare                uintptr
  22363 	Fprepare16              uintptr
  22364 	Fprofile                uintptr
  22365 	Fprogress_handler       uintptr
  22366 	Frealloc                uintptr
  22367 	Freset                  uintptr
  22368 	Fresult_blob            uintptr
  22369 	Fresult_double          uintptr
  22370 	Fresult_error           uintptr
  22371 	Fresult_error16         uintptr
  22372 	Fresult_int             uintptr
  22373 	Fresult_int64           uintptr
  22374 	Fresult_null            uintptr
  22375 	Fresult_text            uintptr
  22376 	Fresult_text16          uintptr
  22377 	Fresult_text16be        uintptr
  22378 	Fresult_text16le        uintptr
  22379 	Fresult_value           uintptr
  22380 	Frollback_hook          uintptr
  22381 	Fset_authorizer         uintptr
  22382 	Fset_auxdata            uintptr
  22383 	Fxsnprintf              uintptr
  22384 	Fstep                   uintptr
  22385 	Ftable_column_metadata  uintptr
  22386 	Fthread_cleanup         uintptr
  22387 	Ftotal_changes          uintptr
  22388 	Ftrace                  uintptr
  22389 	Ftransfer_bindings      uintptr
  22390 	Fupdate_hook            uintptr
  22391 	Fuser_data              uintptr
  22392 	Fvalue_blob             uintptr
  22393 	Fvalue_bytes            uintptr
  22394 	Fvalue_bytes16          uintptr
  22395 	Fvalue_double           uintptr
  22396 	Fvalue_int              uintptr
  22397 	Fvalue_int64            uintptr
  22398 	Fvalue_numeric_type     uintptr
  22399 	Fvalue_text             uintptr
  22400 	Fvalue_text16           uintptr
  22401 	Fvalue_text16be         uintptr
  22402 	Fvalue_text16le         uintptr
  22403 	Fvalue_type             uintptr
  22404 	Fvmprintf               uintptr
  22405 	Foverload_function      uintptr
  22406 	Fprepare_v2             uintptr
  22407 	Fprepare16_v2           uintptr
  22408 	Fclear_bindings         uintptr
  22409 	Fcreate_module_v2       uintptr
  22410 	Fbind_zeroblob          uintptr
  22411 	Fblob_bytes             uintptr
  22412 	Fblob_close             uintptr
  22413 	Fblob_open              uintptr
  22414 	Fblob_read              uintptr
  22415 	Fblob_write             uintptr
  22416 	Fcreate_collation_v2    uintptr
  22417 	Ffile_control           uintptr
  22418 	Fmemory_highwater       uintptr
  22419 	Fmemory_used            uintptr
  22420 	Fmutex_alloc            uintptr
  22421 	Fmutex_enter            uintptr
  22422 	Fmutex_free             uintptr
  22423 	Fmutex_leave            uintptr
  22424 	Fmutex_try              uintptr
  22425 	Fopen_v2                uintptr
  22426 	Frelease_memory         uintptr
  22427 	Fresult_error_nomem     uintptr
  22428 	Fresult_error_toobig    uintptr
  22429 	Fsleep                  uintptr
  22430 	Fsoft_heap_limit        uintptr
  22431 	Fvfs_find               uintptr
  22432 	Fvfs_register           uintptr
  22433 	Fvfs_unregister         uintptr
  22434 	Fxthreadsafe            uintptr
  22435 	Fresult_zeroblob        uintptr
  22436 	Fresult_error_code      uintptr
  22437 	Ftest_control           uintptr
  22438 	Frandomness             uintptr
  22439 	Fcontext_db_handle      uintptr
  22440 	Fextended_result_codes  uintptr
  22441 	Flimit                  uintptr
  22442 	Fnext_stmt              uintptr
  22443 	Fsql                    uintptr
  22444 	Fstatus                 uintptr
  22445 	Fbackup_finish          uintptr
  22446 	Fbackup_init            uintptr
  22447 	Fbackup_pagecount       uintptr
  22448 	Fbackup_remaining       uintptr
  22449 	Fbackup_step            uintptr
  22450 	Fcompileoption_get      uintptr
  22451 	Fcompileoption_used     uintptr
  22452 	Fcreate_function_v2     uintptr
  22453 	Fdb_config              uintptr
  22454 	Fdb_mutex               uintptr
  22455 	Fdb_status              uintptr
  22456 	Fextended_errcode       uintptr
  22457 	Flog                    uintptr
  22458 	Fsoft_heap_limit64      uintptr
  22459 	Fsourceid               uintptr
  22460 	Fstmt_status            uintptr
  22461 	Fstrnicmp               uintptr
  22462 	Funlock_notify          uintptr
  22463 	Fwal_autocheckpoint     uintptr
  22464 	Fwal_checkpoint         uintptr
  22465 	Fwal_hook               uintptr
  22466 	Fblob_reopen            uintptr
  22467 	Fvtab_config            uintptr
  22468 	Fvtab_on_conflict       uintptr
  22469 	Fclose_v2               uintptr
  22470 	Fdb_filename            uintptr
  22471 	Fdb_readonly            uintptr
  22472 	Fdb_release_memory      uintptr
  22473 	Ferrstr                 uintptr
  22474 	Fstmt_busy              uintptr
  22475 	Fstmt_readonly          uintptr
  22476 	Fstricmp                uintptr
  22477 	Furi_boolean            uintptr
  22478 	Furi_int64              uintptr
  22479 	Furi_parameter          uintptr
  22480 	Fxvsnprintf             uintptr
  22481 	Fwal_checkpoint_v2      uintptr
  22482 	Fauto_extension         uintptr
  22483 	Fbind_blob64            uintptr
  22484 	Fbind_text64            uintptr
  22485 	Fcancel_auto_extension  uintptr
  22486 	Fload_extension         uintptr
  22487 	Fmalloc64               uintptr
  22488 	Fmsize                  uintptr
  22489 	Frealloc64              uintptr
  22490 	Freset_auto_extension   uintptr
  22491 	Fresult_blob64          uintptr
  22492 	Fresult_text64          uintptr
  22493 	Fstrglob                uintptr
  22494 	Fvalue_dup              uintptr
  22495 	Fvalue_free             uintptr
  22496 	Fresult_zeroblob64      uintptr
  22497 	Fbind_zeroblob64        uintptr
  22498 	Fvalue_subtype          uintptr
  22499 	Fresult_subtype         uintptr
  22500 	Fstatus64               uintptr
  22501 	Fstrlike                uintptr
  22502 	Fdb_cacheflush          uintptr
  22503 	Fsystem_errno           uintptr
  22504 	Ftrace_v2               uintptr
  22505 	Fexpanded_sql           uintptr
  22506 	Fset_last_insert_rowid  uintptr
  22507 	Fprepare_v3             uintptr
  22508 	Fprepare16_v3           uintptr
  22509 	Fbind_pointer           uintptr
  22510 	Fresult_pointer         uintptr
  22511 	Fvalue_pointer          uintptr
  22512 	Fvtab_nochange          uintptr
  22513 	Fvalue_nochange         uintptr
  22514 	Fvtab_collation         uintptr
  22515 	Fkeyword_count          uintptr
  22516 	Fkeyword_name           uintptr
  22517 	Fkeyword_check          uintptr
  22518 	Fstr_new                uintptr
  22519 	Fstr_finish             uintptr
  22520 	Fstr_appendf            uintptr
  22521 	Fstr_vappendf           uintptr
  22522 	Fstr_append             uintptr
  22523 	Fstr_appendall          uintptr
  22524 	Fstr_appendchar         uintptr
  22525 	Fstr_reset              uintptr
  22526 	Fstr_errcode            uintptr
  22527 	Fstr_length             uintptr
  22528 	Fstr_value              uintptr
  22529 	Fcreate_window_function uintptr
  22530 	Fnormalized_sql         uintptr
  22531 	Fstmt_isexplain         uintptr
  22532 	Fvalue_frombind         uintptr
  22533 	Fdrop_modules           uintptr
  22534 	Fhard_heap_limit64      uintptr
  22535 	Furi_key                uintptr
  22536 	Ffilename_database      uintptr
  22537 	Ffilename_journal       uintptr
  22538 	Ffilename_wal           uintptr
  22539 	Fcreate_filename        uintptr
  22540 	Ffree_filename          uintptr
  22541 	Fdatabase_file_object   uintptr
  22542 	Ftxn_state              uintptr
  22543 	Fchanges64              uintptr
  22544 	Ftotal_changes64        uintptr
  22545 	Fautovacuum_pages       uintptr
  22546 	Ferror_offset           uintptr
  22547 	Fvtab_rhs_value         uintptr
  22548 	Fvtab_distinct          uintptr
  22549 	Fvtab_in                uintptr
  22550 	Fvtab_in_first          uintptr
  22551 	Fvtab_in_next           uintptr
  22552 	Fdeserialize            uintptr
  22553 	Fserialize              uintptr
  22554 	Fdb_name                uintptr
  22555 	Fvalue_encoding         uintptr
  22556 	Fis_interrupted         uintptr
  22557 }
  22558 
  22559 // CAPI3REF: Loadable Extension Thunk
  22560 //
  22561 // A pointer to the opaque sqlite3_api_routines structure is passed as
  22562 // the third parameter to entry points of [loadable extensions].  This
  22563 // structure must be typedefed in order to work around compiler warnings
  22564 // on some platforms.
  22565 type Sqlite3_api_routines = sqlite3_api_routines
  22566 
  22567 // CAPI3REF: File Name
  22568 //
  22569 // Type [sqlite3_filename] is used by SQLite to pass filenames to the
  22570 // xOpen method of a [VFS]. It may be cast to (const char*) and treated
  22571 // as a normal, nul-terminated, UTF-8 buffer containing the filename, but
  22572 // may also be passed to special APIs such as:
  22573 //
  22574 // <ul>
  22575 // <li>  sqlite3_filename_database()
  22576 // <li>  sqlite3_filename_journal()
  22577 // <li>  sqlite3_filename_wal()
  22578 // <li>  sqlite3_uri_parameter()
  22579 // <li>  sqlite3_uri_boolean()
  22580 // <li>  sqlite3_uri_int64()
  22581 // <li>  sqlite3_uri_key()
  22582 // </ul>
  22583 type Sqlite3_filename = uintptr
  22584 
  22585 type sqlite3_vfs = struct {
  22586 	FiVersion          int32
  22587 	FszOsFile          int32
  22588 	FmxPathname        int32
  22589 	F__ccgo_pad1       [4]byte
  22590 	FpNext             uintptr
  22591 	FzName             uintptr
  22592 	FpAppData          uintptr
  22593 	FxOpen             uintptr
  22594 	FxDelete           uintptr
  22595 	FxAccess           uintptr
  22596 	FxFullPathname     uintptr
  22597 	FxDlOpen           uintptr
  22598 	FxDlError          uintptr
  22599 	FxDlSym            uintptr
  22600 	FxDlClose          uintptr
  22601 	FxRandomness       uintptr
  22602 	FxSleep            uintptr
  22603 	FxCurrentTime      uintptr
  22604 	FxGetLastError     uintptr
  22605 	FxCurrentTimeInt64 uintptr
  22606 	FxSetSystemCall    uintptr
  22607 	FxGetSystemCall    uintptr
  22608 	FxNextSystemCall   uintptr
  22609 }
  22610 
  22611 // CAPI3REF: OS Interface Object
  22612 //
  22613 // An instance of the sqlite3_vfs object defines the interface between
  22614 // the SQLite core and the underlying operating system.  The "vfs"
  22615 // in the name of the object stands for "virtual file system".  See
  22616 // the [VFS | VFS documentation] for further information.
  22617 //
  22618 // The VFS interface is sometimes extended by adding new methods onto
  22619 // the end.  Each time such an extension occurs, the iVersion field
  22620 // is incremented.  The iVersion value started out as 1 in
  22621 // SQLite [version 3.5.0] on [dateof:3.5.0], then increased to 2
  22622 // with SQLite [version 3.7.0] on [dateof:3.7.0], and then increased
  22623 // to 3 with SQLite [version 3.7.6] on [dateof:3.7.6].  Additional fields
  22624 // may be appended to the sqlite3_vfs object and the iVersion value
  22625 // may increase again in future versions of SQLite.
  22626 // Note that due to an oversight, the structure
  22627 // of the sqlite3_vfs object changed in the transition from
  22628 // SQLite [version 3.5.9] to [version 3.6.0] on [dateof:3.6.0]
  22629 // and yet the iVersion field was not increased.
  22630 //
  22631 // The szOsFile field is the size of the subclassed [sqlite3_file]
  22632 // structure used by this VFS.  mxPathname is the maximum length of
  22633 // a pathname in this VFS.
  22634 //
  22635 // Registered sqlite3_vfs objects are kept on a linked list formed by
  22636 // the pNext pointer.  The [sqlite3_vfs_register()]
  22637 // and [sqlite3_vfs_unregister()] interfaces manage this list
  22638 // in a thread-safe way.  The [sqlite3_vfs_find()] interface
  22639 // searches the list.  Neither the application code nor the VFS
  22640 // implementation should use the pNext pointer.
  22641 //
  22642 // The pNext field is the only field in the sqlite3_vfs
  22643 // structure that SQLite will ever modify.  SQLite will only access
  22644 // or modify this field while holding a particular static mutex.
  22645 // The application should never modify anything within the sqlite3_vfs
  22646 // object once the object has been registered.
  22647 //
  22648 // The zName field holds the name of the VFS module.  The name must
  22649 // be unique across all VFS modules.
  22650 //
  22651 // [[sqlite3_vfs.xOpen]]
  22652 // ^SQLite guarantees that the zFilename parameter to xOpen
  22653 // is either a NULL pointer or string obtained
  22654 // from xFullPathname() with an optional suffix added.
  22655 // ^If a suffix is added to the zFilename parameter, it will
  22656 // consist of a single "-" character followed by no more than
  22657 // 11 alphanumeric and/or "-" characters.
  22658 // ^SQLite further guarantees that
  22659 // the string will be valid and unchanged until xClose() is
  22660 // called. Because of the previous sentence,
  22661 // the [sqlite3_file] can safely store a pointer to the
  22662 // filename if it needs to remember the filename for some reason.
  22663 // If the zFilename parameter to xOpen is a NULL pointer then xOpen
  22664 // must invent its own temporary name for the file.  ^Whenever the
  22665 // xFilename parameter is NULL it will also be the case that the
  22666 // flags parameter will include [SQLITE_OPEN_DELETEONCLOSE].
  22667 //
  22668 // The flags argument to xOpen() includes all bits set in
  22669 // the flags argument to [sqlite3_open_v2()].  Or if [sqlite3_open()]
  22670 // or [sqlite3_open16()] is used, then flags includes at least
  22671 // [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE].
  22672 // If xOpen() opens a file read-only then it sets *pOutFlags to
  22673 // include [SQLITE_OPEN_READONLY].  Other bits in *pOutFlags may be set.
  22674 //
  22675 // ^(SQLite will also add one of the following flags to the xOpen()
  22676 // call, depending on the object being opened:
  22677 //
  22678 // <ul>
  22679 // <li>  [SQLITE_OPEN_MAIN_DB]
  22680 // <li>  [SQLITE_OPEN_MAIN_JOURNAL]
  22681 // <li>  [SQLITE_OPEN_TEMP_DB]
  22682 // <li>  [SQLITE_OPEN_TEMP_JOURNAL]
  22683 // <li>  [SQLITE_OPEN_TRANSIENT_DB]
  22684 // <li>  [SQLITE_OPEN_SUBJOURNAL]
  22685 // <li>  [SQLITE_OPEN_SUPER_JOURNAL]
  22686 // <li>  [SQLITE_OPEN_WAL]
  22687 // </ul>)^
  22688 //
  22689 // The file I/O implementation can use the object type flags to
  22690 // change the way it deals with files.  For example, an application
  22691 // that does not care about crash recovery or rollback might make
  22692 // the open of a journal file a no-op.  Writes to this journal would
  22693 // also be no-ops, and any attempt to read the journal would return
  22694 // SQLITE_IOERR.  Or the implementation might recognize that a database
  22695 // file will be doing page-aligned sector reads and writes in a random
  22696 // order and set up its I/O subsystem accordingly.
  22697 //
  22698 // SQLite might also add one of the following flags to the xOpen method:
  22699 //
  22700 // <ul>
  22701 // <li> [SQLITE_OPEN_DELETEONCLOSE]
  22702 // <li> [SQLITE_OPEN_EXCLUSIVE]
  22703 // </ul>
  22704 //
  22705 // The [SQLITE_OPEN_DELETEONCLOSE] flag means the file should be
  22706 // deleted when it is closed.  ^The [SQLITE_OPEN_DELETEONCLOSE]
  22707 // will be set for TEMP databases and their journals, transient
  22708 // databases, and subjournals.
  22709 //
  22710 // ^The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction
  22711 // with the [SQLITE_OPEN_CREATE] flag, which are both directly
  22712 // analogous to the O_EXCL and O_CREAT flags of the POSIX open()
  22713 // API.  The SQLITE_OPEN_EXCLUSIVE flag, when paired with the
  22714 // SQLITE_OPEN_CREATE, is used to indicate that file should always
  22715 // be created, and that it is an error if it already exists.
  22716 // It is <i>not</i> used to indicate the file should be opened
  22717 // for exclusive access.
  22718 //
  22719 // ^At least szOsFile bytes of memory are allocated by SQLite
  22720 // to hold the [sqlite3_file] structure passed as the third
  22721 // argument to xOpen.  The xOpen method does not have to
  22722 // allocate the structure; it should just fill it in.  Note that
  22723 // the xOpen method must set the sqlite3_file.pMethods to either
  22724 // a valid [sqlite3_io_methods] object or to NULL.  xOpen must do
  22725 // this even if the open fails.  SQLite expects that the sqlite3_file.pMethods
  22726 // element will be valid after xOpen returns regardless of the success
  22727 // or failure of the xOpen call.
  22728 //
  22729 // [[sqlite3_vfs.xAccess]]
  22730 // ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS]
  22731 // to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to
  22732 // test whether a file is readable and writable, or [SQLITE_ACCESS_READ]
  22733 // to test whether a file is at least readable.  The SQLITE_ACCESS_READ
  22734 // flag is never actually used and is not implemented in the built-in
  22735 // VFSes of SQLite.  The file is named by the second argument and can be a
  22736 // directory. The xAccess method returns [SQLITE_OK] on success or some
  22737 // non-zero error code if there is an I/O error or if the name of
  22738 // the file given in the second argument is illegal.  If SQLITE_OK
  22739 // is returned, then non-zero or zero is written into *pResOut to indicate
  22740 // whether or not the file is accessible.
  22741 //
  22742 // ^SQLite will always allocate at least mxPathname+1 bytes for the
  22743 // output buffer xFullPathname.  The exact size of the output buffer
  22744 // is also passed as a parameter to both  methods. If the output buffer
  22745 // is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is
  22746 // handled as a fatal error by SQLite, vfs implementations should endeavor
  22747 // to prevent this by setting mxPathname to a sufficiently large value.
  22748 //
  22749 // The xRandomness(), xSleep(), xCurrentTime(), and xCurrentTimeInt64()
  22750 // interfaces are not strictly a part of the filesystem, but they are
  22751 // included in the VFS structure for completeness.
  22752 // The xRandomness() function attempts to return nBytes bytes
  22753 // of good-quality randomness into zOut.  The return value is
  22754 // the actual number of bytes of randomness obtained.
  22755 // The xSleep() method causes the calling thread to sleep for at
  22756 // least the number of microseconds given.  ^The xCurrentTime()
  22757 // method returns a Julian Day Number for the current date and time as
  22758 // a floating point value.
  22759 // ^The xCurrentTimeInt64() method returns, as an integer, the Julian
  22760 // Day Number multiplied by 86400000 (the number of milliseconds in
  22761 // a 24-hour day).
  22762 // ^SQLite will use the xCurrentTimeInt64() method to get the current
  22763 // date and time if that method is available (if iVersion is 2 or
  22764 // greater and the function pointer is not NULL) and will fall back
  22765 // to xCurrentTime() if xCurrentTimeInt64() is unavailable.
  22766 //
  22767 // ^The xSetSystemCall(), xGetSystemCall(), and xNestSystemCall() interfaces
  22768 // are not used by the SQLite core.  These optional interfaces are provided
  22769 // by some VFSes to facilitate testing of the VFS code. By overriding
  22770 // system calls with functions under its control, a test program can
  22771 // simulate faults and error conditions that would otherwise be difficult
  22772 // or impossible to induce.  The set of system calls that can be overridden
  22773 // varies from one VFS to another, and from one version of the same VFS to the
  22774 // next.  Applications that use these interfaces must be prepared for any
  22775 // or all of these interfaces to be NULL or for their behavior to change
  22776 // from one release to the next.  Applications must not attempt to access
  22777 // any of these methods if the iVersion of the VFS is less than 3.
  22778 type Sqlite3_vfs = sqlite3_vfs
  22779 type Sqlite3_syscall_ptr = uintptr
  22780 
  22781 type sqlite3_mem_methods = struct {
  22782 	FxMalloc   uintptr
  22783 	FxFree     uintptr
  22784 	FxRealloc  uintptr
  22785 	FxSize     uintptr
  22786 	FxRoundup  uintptr
  22787 	FxInit     uintptr
  22788 	FxShutdown uintptr
  22789 	FpAppData  uintptr
  22790 }
  22791 
  22792 // CAPI3REF: Memory Allocation Routines
  22793 //
  22794 // An instance of this object defines the interface between SQLite
  22795 // and low-level memory allocation routines.
  22796 //
  22797 // This object is used in only one place in the SQLite interface.
  22798 // A pointer to an instance of this object is the argument to
  22799 // [sqlite3_config()] when the configuration option is
  22800 // [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC].
  22801 // By creating an instance of this object
  22802 // and passing it to [sqlite3_config]([SQLITE_CONFIG_MALLOC])
  22803 // during configuration, an application can specify an alternative
  22804 // memory allocation subsystem for SQLite to use for all of its
  22805 // dynamic memory needs.
  22806 //
  22807 // Note that SQLite comes with several [built-in memory allocators]
  22808 // that are perfectly adequate for the overwhelming majority of applications
  22809 // and that this object is only useful to a tiny minority of applications
  22810 // with specialized memory allocation requirements.  This object is
  22811 // also used during testing of SQLite in order to specify an alternative
  22812 // memory allocator that simulates memory out-of-memory conditions in
  22813 // order to verify that SQLite recovers gracefully from such
  22814 // conditions.
  22815 //
  22816 // The xMalloc, xRealloc, and xFree methods must work like the
  22817 // malloc(), realloc() and free() functions from the standard C library.
  22818 // ^SQLite guarantees that the second argument to
  22819 // xRealloc is always a value returned by a prior call to xRoundup.
  22820 //
  22821 // xSize should return the allocated size of a memory allocation
  22822 // previously obtained from xMalloc or xRealloc.  The allocated size
  22823 // is always at least as big as the requested size but may be larger.
  22824 //
  22825 // The xRoundup method returns what would be the allocated size of
  22826 // a memory allocation given a particular requested size.  Most memory
  22827 // allocators round up memory allocations at least to the next multiple
  22828 // of 8.  Some allocators round up to a larger multiple or to a power of 2.
  22829 // Every memory allocation request coming in through [sqlite3_malloc()]
  22830 // or [sqlite3_realloc()] first calls xRoundup.  If xRoundup returns 0,
  22831 // that causes the corresponding memory allocation to fail.
  22832 //
  22833 // The xInit method initializes the memory allocator.  For example,
  22834 // it might allocate any required mutexes or initialize internal data
  22835 // structures.  The xShutdown method is invoked (indirectly) by
  22836 // [sqlite3_shutdown()] and should deallocate any resources acquired
  22837 // by xInit.  The pAppData pointer is used as the only parameter to
  22838 // xInit and xShutdown.
  22839 //
  22840 // SQLite holds the [SQLITE_MUTEX_STATIC_MAIN] mutex when it invokes
  22841 // the xInit method, so the xInit method need not be threadsafe.  The
  22842 // xShutdown method is only called from [sqlite3_shutdown()] so it does
  22843 // not need to be threadsafe either.  For all other methods, SQLite
  22844 // holds the [SQLITE_MUTEX_STATIC_MEM] mutex as long as the
  22845 // [SQLITE_CONFIG_MEMSTATUS] configuration option is turned on (which
  22846 // it is by default) and so the methods are automatically serialized.
  22847 // However, if [SQLITE_CONFIG_MEMSTATUS] is disabled, then the other
  22848 // methods must be threadsafe or else make their own arrangements for
  22849 // serialization.
  22850 //
  22851 // SQLite will never invoke xInit() more than once without an intervening
  22852 // call to xShutdown().
  22853 type Sqlite3_mem_methods = sqlite3_mem_methods
  22854 
  22855 type sqlite3_value = struct {
  22856 	Fu        struct{ Fr float64 }
  22857 	Fz        uintptr
  22858 	Fn        int32
  22859 	Fflags    U16
  22860 	Fenc      U8
  22861 	FeSubtype U8
  22862 	Fdb       uintptr
  22863 	FszMalloc int32
  22864 	FuTemp    U32
  22865 	FzMalloc  uintptr
  22866 	FxDel     uintptr
  22867 }
  22868 
  22869 // CAPI3REF: Dynamically Typed Value Object
  22870 // KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
  22871 //
  22872 // SQLite uses the sqlite3_value object to represent all values
  22873 // that can be stored in a database table. SQLite uses dynamic typing
  22874 // for the values it stores.  ^Values stored in sqlite3_value objects
  22875 // can be integers, floating point values, strings, BLOBs, or NULL.
  22876 //
  22877 // An sqlite3_value object may be either "protected" or "unprotected".
  22878 // Some interfaces require a protected sqlite3_value.  Other interfaces
  22879 // will accept either a protected or an unprotected sqlite3_value.
  22880 // Every interface that accepts sqlite3_value arguments specifies
  22881 // whether or not it requires a protected sqlite3_value.  The
  22882 // [sqlite3_value_dup()] interface can be used to construct a new
  22883 // protected sqlite3_value from an unprotected sqlite3_value.
  22884 //
  22885 // The terms "protected" and "unprotected" refer to whether or not
  22886 // a mutex is held.  An internal mutex is held for a protected
  22887 // sqlite3_value object but no mutex is held for an unprotected
  22888 // sqlite3_value object.  If SQLite is compiled to be single-threaded
  22889 // (with [SQLITE_THREADSAFE=0] and with [sqlite3_threadsafe()] returning 0)
  22890 // or if SQLite is run in one of reduced mutex modes
  22891 // [SQLITE_CONFIG_SINGLETHREAD] or [SQLITE_CONFIG_MULTITHREAD]
  22892 // then there is no distinction between protected and unprotected
  22893 // sqlite3_value objects and they can be used interchangeably.  However,
  22894 // for maximum code portability it is recommended that applications
  22895 // still make the distinction between protected and unprotected
  22896 // sqlite3_value objects even when not strictly required.
  22897 //
  22898 // ^The sqlite3_value objects that are passed as parameters into the
  22899 // implementation of [application-defined SQL functions] are protected.
  22900 // ^The sqlite3_value objects returned by [sqlite3_vtab_rhs_value()]
  22901 // are protected.
  22902 // ^The sqlite3_value object returned by
  22903 // [sqlite3_column_value()] is unprotected.
  22904 // Unprotected sqlite3_value objects may only be used as arguments
  22905 // to [sqlite3_result_value()], [sqlite3_bind_value()], and
  22906 // [sqlite3_value_dup()].
  22907 // The [sqlite3_value_blob | sqlite3_value_type()] family of
  22908 // interfaces require protected sqlite3_value objects.
  22909 type Sqlite3_value = sqlite3_value
  22910 
  22911 type sqlite3_context = struct {
  22912 	FpOut        uintptr
  22913 	FpFunc       uintptr
  22914 	FpMem        uintptr
  22915 	FpVdbe       uintptr
  22916 	FiOp         int32
  22917 	FisError     int32
  22918 	Fenc         U8
  22919 	FskipFlag    U8
  22920 	Fargc        U8
  22921 	F__ccgo_pad1 [5]byte
  22922 	Fargv        [1]uintptr
  22923 }
  22924 
  22925 // CAPI3REF: SQL Function Context Object
  22926 //
  22927 // The context in which an SQL function executes is stored in an
  22928 // sqlite3_context object.  ^A pointer to an sqlite3_context object
  22929 // is always first parameter to [application-defined SQL functions].
  22930 // The application-defined SQL function implementation will pass this
  22931 // pointer through into calls to [sqlite3_result_int | sqlite3_result()],
  22932 // [sqlite3_aggregate_context()], [sqlite3_user_data()],
  22933 // [sqlite3_context_db_handle()], [sqlite3_get_auxdata()],
  22934 // and/or [sqlite3_set_auxdata()].
  22935 type Sqlite3_context = sqlite3_context
  22936 
  22937 // CAPI3REF: Constants Defining Special Destructor Behavior
  22938 //
  22939 // These are special values for the destructor that is passed in as the
  22940 // final argument to routines like [sqlite3_result_blob()].  ^If the destructor
  22941 // argument is SQLITE_STATIC, it means that the content pointer is constant
  22942 // and will never change.  It does not need to be destroyed.  ^The
  22943 // SQLITE_TRANSIENT value means that the content will likely change in
  22944 // the near future and that SQLite should make its own private copy of
  22945 // the content before returning.
  22946 //
  22947 // The typedef is necessary to work around problems in certain
  22948 // C++ compilers.
  22949 type Sqlite3_destructor_type = uintptr
  22950 
  22951 type sqlite3_vtab = struct {
  22952 	FpModule     uintptr
  22953 	FnRef        int32
  22954 	F__ccgo_pad1 [4]byte
  22955 	FzErrMsg     uintptr
  22956 }
  22957 
  22958 // Structures used by the virtual table interface
  22959 type Sqlite3_vtab = sqlite3_vtab
  22960 type sqlite3_index_info = struct {
  22961 	FnConstraint      int32
  22962 	F__ccgo_pad1      [4]byte
  22963 	FaConstraint      uintptr
  22964 	FnOrderBy         int32
  22965 	F__ccgo_pad2      [4]byte
  22966 	FaOrderBy         uintptr
  22967 	FaConstraintUsage uintptr
  22968 	FidxNum           int32
  22969 	F__ccgo_pad3      [4]byte
  22970 	FidxStr           uintptr
  22971 	FneedToFreeIdxStr int32
  22972 	ForderByConsumed  int32
  22973 	FestimatedCost    float64
  22974 	FestimatedRows    Sqlite3_int64
  22975 	FidxFlags         int32
  22976 	F__ccgo_pad4      [4]byte
  22977 	FcolUsed          Sqlite3_uint64
  22978 }
  22979 
  22980 type Sqlite3_index_info = sqlite3_index_info
  22981 type sqlite3_vtab_cursor = struct{ FpVtab uintptr }
  22982 
  22983 type Sqlite3_vtab_cursor = sqlite3_vtab_cursor
  22984 type sqlite3_module = struct {
  22985 	FiVersion      int32
  22986 	F__ccgo_pad1   [4]byte
  22987 	FxCreate       uintptr
  22988 	FxConnect      uintptr
  22989 	FxBestIndex    uintptr
  22990 	FxDisconnect   uintptr
  22991 	FxDestroy      uintptr
  22992 	FxOpen         uintptr
  22993 	FxClose        uintptr
  22994 	FxFilter       uintptr
  22995 	FxNext         uintptr
  22996 	FxEof          uintptr
  22997 	FxColumn       uintptr
  22998 	FxRowid        uintptr
  22999 	FxUpdate       uintptr
  23000 	FxBegin        uintptr
  23001 	FxSync         uintptr
  23002 	FxCommit       uintptr
  23003 	FxRollback     uintptr
  23004 	FxFindFunction uintptr
  23005 	FxRename       uintptr
  23006 	FxSavepoint    uintptr
  23007 	FxRelease      uintptr
  23008 	FxRollbackTo   uintptr
  23009 	FxShadowName   uintptr
  23010 }
  23011 
  23012 type Sqlite3_module = sqlite3_module
  23013 
  23014 type sqlite3_index_constraint = struct {
  23015 	FiColumn     int32
  23016 	Fop          uint8
  23017 	Fusable      uint8
  23018 	F__ccgo_pad1 [2]byte
  23019 	FiTermOffset int32
  23020 }
  23021 
  23022 type sqlite3_index_orderby = struct {
  23023 	FiColumn     int32
  23024 	Fdesc        uint8
  23025 	F__ccgo_pad1 [3]byte
  23026 }
  23027 
  23028 type sqlite3_index_constraint_usage = struct {
  23029 	FargvIndex   int32
  23030 	Fomit        uint8
  23031 	F__ccgo_pad1 [3]byte
  23032 }
  23033 
  23034 type sqlite3_mutex_methods = struct {
  23035 	FxMutexInit    uintptr
  23036 	FxMutexEnd     uintptr
  23037 	FxMutexAlloc   uintptr
  23038 	FxMutexFree    uintptr
  23039 	FxMutexEnter   uintptr
  23040 	FxMutexTry     uintptr
  23041 	FxMutexLeave   uintptr
  23042 	FxMutexHeld    uintptr
  23043 	FxMutexNotheld uintptr
  23044 }
  23045 
  23046 // CAPI3REF: Mutex Methods Object
  23047 //
  23048 // An instance of this structure defines the low-level routines
  23049 // used to allocate and use mutexes.
  23050 //
  23051 // Usually, the default mutex implementations provided by SQLite are
  23052 // sufficient, however the application has the option of substituting a custom
  23053 // implementation for specialized deployments or systems for which SQLite
  23054 // does not provide a suitable implementation. In this case, the application
  23055 // creates and populates an instance of this structure to pass
  23056 // to sqlite3_config() along with the [SQLITE_CONFIG_MUTEX] option.
  23057 // Additionally, an instance of this structure can be used as an
  23058 // output variable when querying the system for the current mutex
  23059 // implementation, using the [SQLITE_CONFIG_GETMUTEX] option.
  23060 //
  23061 // ^The xMutexInit method defined by this structure is invoked as
  23062 // part of system initialization by the sqlite3_initialize() function.
  23063 // ^The xMutexInit routine is called by SQLite exactly once for each
  23064 // effective call to [sqlite3_initialize()].
  23065 //
  23066 // ^The xMutexEnd method defined by this structure is invoked as
  23067 // part of system shutdown by the sqlite3_shutdown() function. The
  23068 // implementation of this method is expected to release all outstanding
  23069 // resources obtained by the mutex methods implementation, especially
  23070 // those obtained by the xMutexInit method.  ^The xMutexEnd()
  23071 // interface is invoked exactly once for each call to [sqlite3_shutdown()].
  23072 //
  23073 // ^(The remaining seven methods defined by this structure (xMutexAlloc,
  23074 // xMutexFree, xMutexEnter, xMutexTry, xMutexLeave, xMutexHeld and
  23075 // xMutexNotheld) implement the following interfaces (respectively):
  23076 //
  23077 // <ul>
  23078 //
  23079 //	<li>  [sqlite3_mutex_alloc()] </li>
  23080 //	<li>  [sqlite3_mutex_free()] </li>
  23081 //	<li>  [sqlite3_mutex_enter()] </li>
  23082 //	<li>  [sqlite3_mutex_try()] </li>
  23083 //	<li>  [sqlite3_mutex_leave()] </li>
  23084 //	<li>  [sqlite3_mutex_held()] </li>
  23085 //	<li>  [sqlite3_mutex_notheld()] </li>
  23086 //
  23087 // </ul>)^
  23088 //
  23089 // The only difference is that the public sqlite3_XXX functions enumerated
  23090 // above silently ignore any invocations that pass a NULL pointer instead
  23091 // of a valid mutex handle. The implementations of the methods defined
  23092 // by this structure are not required to handle this case. The results
  23093 // of passing a NULL pointer instead of a valid mutex handle are undefined
  23094 // (i.e. it is acceptable to provide an implementation that segfaults if
  23095 // it is passed a NULL pointer).
  23096 //
  23097 // The xMutexInit() method must be threadsafe.  It must be harmless to
  23098 // invoke xMutexInit() multiple times within the same process and without
  23099 // intervening calls to xMutexEnd().  Second and subsequent calls to
  23100 // xMutexInit() must be no-ops.
  23101 //
  23102 // xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()]
  23103 // and its associates).  Similarly, xMutexAlloc() must not use SQLite memory
  23104 // allocation for a static mutex.  ^However xMutexAlloc() may use SQLite
  23105 // memory allocation for a fast or recursive mutex.
  23106 //
  23107 // ^SQLite will invoke the xMutexEnd() method when [sqlite3_shutdown()] is
  23108 // called, but only if the prior call to xMutexInit returned SQLITE_OK.
  23109 // If xMutexInit fails in any way, it is expected to clean up after itself
  23110 // prior to returning.
  23111 type Sqlite3_mutex_methods = sqlite3_mutex_methods
  23112 
  23113 type sqlite3_str = struct {
  23114 	Fdb          uintptr
  23115 	FzText       uintptr
  23116 	FnAlloc      U32
  23117 	FmxAlloc     U32
  23118 	FnChar       U32
  23119 	FaccError    U8
  23120 	FprintfFlags U8
  23121 	F__ccgo_pad1 [2]byte
  23122 }
  23123 
  23124 // CAPI3REF: Dynamic String Object
  23125 // KEYWORDS: {dynamic string}
  23126 //
  23127 // An instance of the sqlite3_str object contains a dynamically-sized
  23128 // string under construction.
  23129 //
  23130 // The lifecycle of an sqlite3_str object is as follows:
  23131 // <ol>
  23132 // <li> ^The sqlite3_str object is created using [sqlite3_str_new()].
  23133 // <li> ^Text is appended to the sqlite3_str object using various
  23134 // methods, such as [sqlite3_str_appendf()].
  23135 // <li> ^The sqlite3_str object is destroyed and the string it created
  23136 // is returned using the [sqlite3_str_finish()] interface.
  23137 // </ol>
  23138 type Sqlite3_str = sqlite3_str
  23139 
  23140 type sqlite3_pcache_page = struct {
  23141 	FpBuf   uintptr
  23142 	FpExtra uintptr
  23143 }
  23144 
  23145 // CAPI3REF: Custom Page Cache Object
  23146 //
  23147 // The sqlite3_pcache_page object represents a single page in the
  23148 // page cache.  The page cache will allocate instances of this
  23149 // object.  Various methods of the page cache use pointers to instances
  23150 // of this object as parameters or as their return value.
  23151 //
  23152 // See [sqlite3_pcache_methods2] for additional information.
  23153 type Sqlite3_pcache_page = sqlite3_pcache_page
  23154 
  23155 type sqlite3_pcache_methods2 = struct {
  23156 	FiVersion    int32
  23157 	F__ccgo_pad1 [4]byte
  23158 	FpArg        uintptr
  23159 	FxInit       uintptr
  23160 	FxShutdown   uintptr
  23161 	FxCreate     uintptr
  23162 	FxCachesize  uintptr
  23163 	FxPagecount  uintptr
  23164 	FxFetch      uintptr
  23165 	FxUnpin      uintptr
  23166 	FxRekey      uintptr
  23167 	FxTruncate   uintptr
  23168 	FxDestroy    uintptr
  23169 	FxShrink     uintptr
  23170 }
  23171 
  23172 // CAPI3REF: Application Defined Page Cache.
  23173 // KEYWORDS: {page cache}
  23174 //
  23175 // ^(The [sqlite3_config]([SQLITE_CONFIG_PCACHE2], ...) interface can
  23176 // register an alternative page cache implementation by passing in an
  23177 // instance of the sqlite3_pcache_methods2 structure.)^
  23178 // In many applications, most of the heap memory allocated by
  23179 // SQLite is used for the page cache.
  23180 // By implementing a
  23181 // custom page cache using this API, an application can better control
  23182 // the amount of memory consumed by SQLite, the way in which
  23183 // that memory is allocated and released, and the policies used to
  23184 // determine exactly which parts of a database file are cached and for
  23185 // how long.
  23186 //
  23187 // The alternative page cache mechanism is an
  23188 // extreme measure that is only needed by the most demanding applications.
  23189 // The built-in page cache is recommended for most uses.
  23190 //
  23191 // ^(The contents of the sqlite3_pcache_methods2 structure are copied to an
  23192 // internal buffer by SQLite within the call to [sqlite3_config].  Hence
  23193 // the application may discard the parameter after the call to
  23194 // [sqlite3_config()] returns.)^
  23195 //
  23196 // [[the xInit() page cache method]]
  23197 // ^(The xInit() method is called once for each effective
  23198 // call to [sqlite3_initialize()])^
  23199 // (usually only once during the lifetime of the process). ^(The xInit()
  23200 // method is passed a copy of the sqlite3_pcache_methods2.pArg value.)^
  23201 // The intent of the xInit() method is to set up global data structures
  23202 // required by the custom page cache implementation.
  23203 // ^(If the xInit() method is NULL, then the
  23204 // built-in default page cache is used instead of the application defined
  23205 // page cache.)^
  23206 //
  23207 // [[the xShutdown() page cache method]]
  23208 // ^The xShutdown() method is called by [sqlite3_shutdown()].
  23209 // It can be used to clean up
  23210 // any outstanding resources before process shutdown, if required.
  23211 // ^The xShutdown() method may be NULL.
  23212 //
  23213 // ^SQLite automatically serializes calls to the xInit method,
  23214 // so the xInit method need not be threadsafe.  ^The
  23215 // xShutdown method is only called from [sqlite3_shutdown()] so it does
  23216 // not need to be threadsafe either.  All other methods must be threadsafe
  23217 // in multithreaded applications.
  23218 //
  23219 // ^SQLite will never invoke xInit() more than once without an intervening
  23220 // call to xShutdown().
  23221 //
  23222 // [[the xCreate() page cache methods]]
  23223 // ^SQLite invokes the xCreate() method to construct a new cache instance.
  23224 // SQLite will typically create one cache instance for each open database file,
  23225 // though this is not guaranteed. ^The
  23226 // first parameter, szPage, is the size in bytes of the pages that must
  23227 // be allocated by the cache.  ^szPage will always a power of two.  ^The
  23228 // second parameter szExtra is a number of bytes of extra storage
  23229 // associated with each page cache entry.  ^The szExtra parameter will
  23230 // a number less than 250.  SQLite will use the
  23231 // extra szExtra bytes on each page to store metadata about the underlying
  23232 // database page on disk.  The value passed into szExtra depends
  23233 // on the SQLite version, the target platform, and how SQLite was compiled.
  23234 // ^The third argument to xCreate(), bPurgeable, is true if the cache being
  23235 // created will be used to cache database pages of a file stored on disk, or
  23236 // false if it is used for an in-memory database. The cache implementation
  23237 // does not have to do anything special based with the value of bPurgeable;
  23238 // it is purely advisory.  ^On a cache where bPurgeable is false, SQLite will
  23239 // never invoke xUnpin() except to deliberately delete a page.
  23240 // ^In other words, calls to xUnpin() on a cache with bPurgeable set to
  23241 // false will always have the "discard" flag set to true.
  23242 // ^Hence, a cache created with bPurgeable false will
  23243 // never contain any unpinned pages.
  23244 //
  23245 // [[the xCachesize() page cache method]]
  23246 // ^(The xCachesize() method may be called at any time by SQLite to set the
  23247 // suggested maximum cache-size (number of pages stored by) the cache
  23248 // instance passed as the first argument. This is the value configured using
  23249 // the SQLite "[PRAGMA cache_size]" command.)^  As with the bPurgeable
  23250 // parameter, the implementation is not required to do anything with this
  23251 // value; it is advisory only.
  23252 //
  23253 // [[the xPagecount() page cache methods]]
  23254 // The xPagecount() method must return the number of pages currently
  23255 // stored in the cache, both pinned and unpinned.
  23256 //
  23257 // [[the xFetch() page cache methods]]
  23258 // The xFetch() method locates a page in the cache and returns a pointer to
  23259 // an sqlite3_pcache_page object associated with that page, or a NULL pointer.
  23260 // The pBuf element of the returned sqlite3_pcache_page object will be a
  23261 // pointer to a buffer of szPage bytes used to store the content of a
  23262 // single database page.  The pExtra element of sqlite3_pcache_page will be
  23263 // a pointer to the szExtra bytes of extra storage that SQLite has requested
  23264 // for each entry in the page cache.
  23265 //
  23266 // The page to be fetched is determined by the key. ^The minimum key value
  23267 // is 1.  After it has been retrieved using xFetch, the page is considered
  23268 // to be "pinned".
  23269 //
  23270 // If the requested page is already in the page cache, then the page cache
  23271 // implementation must return a pointer to the page buffer with its content
  23272 // intact.  If the requested page is not already in the cache, then the
  23273 // cache implementation should use the value of the createFlag
  23274 // parameter to help it determined what action to take:
  23275 //
  23276 // <table border=1 width=85% align=center>
  23277 // <tr><th> createFlag <th> Behavior when page is not already in cache
  23278 // <tr><td> 0 <td> Do not allocate a new page.  Return NULL.
  23279 // <tr><td> 1 <td> Allocate a new page if it easy and convenient to do so.
  23280 //
  23281 //	Otherwise return NULL.
  23282 //
  23283 // <tr><td> 2 <td> Make every effort to allocate a new page.  Only return
  23284 //
  23285 //	NULL if allocating a new page is effectively impossible.
  23286 //
  23287 // </table>
  23288 //
  23289 // ^(SQLite will normally invoke xFetch() with a createFlag of 0 or 1.  SQLite
  23290 // will only use a createFlag of 2 after a prior call with a createFlag of 1
  23291 // failed.)^  In between the xFetch() calls, SQLite may
  23292 // attempt to unpin one or more cache pages by spilling the content of
  23293 // pinned pages to disk and synching the operating system disk cache.
  23294 //
  23295 // [[the xUnpin() page cache method]]
  23296 // ^xUnpin() is called by SQLite with a pointer to a currently pinned page
  23297 // as its second argument.  If the third parameter, discard, is non-zero,
  23298 // then the page must be evicted from the cache.
  23299 // ^If the discard parameter is
  23300 // zero, then the page may be discarded or retained at the discretion of
  23301 // page cache implementation. ^The page cache implementation
  23302 // may choose to evict unpinned pages at any time.
  23303 //
  23304 // The cache must not perform any reference counting. A single
  23305 // call to xUnpin() unpins the page regardless of the number of prior calls
  23306 // to xFetch().
  23307 //
  23308 // [[the xRekey() page cache methods]]
  23309 // The xRekey() method is used to change the key value associated with the
  23310 // page passed as the second argument. If the cache
  23311 // previously contains an entry associated with newKey, it must be
  23312 // discarded. ^Any prior cache entry associated with newKey is guaranteed not
  23313 // to be pinned.
  23314 //
  23315 // When SQLite calls the xTruncate() method, the cache must discard all
  23316 // existing cache entries with page numbers (keys) greater than or equal
  23317 // to the value of the iLimit parameter passed to xTruncate(). If any
  23318 // of these pages are pinned, they are implicitly unpinned, meaning that
  23319 // they can be safely discarded.
  23320 //
  23321 // [[the xDestroy() page cache method]]
  23322 // ^The xDestroy() method is used to delete a cache allocated by xCreate().
  23323 // All resources associated with the specified cache should be freed. ^After
  23324 // calling the xDestroy() method, SQLite considers the [sqlite3_pcache*]
  23325 // handle invalid, and will not use it with any other sqlite3_pcache_methods2
  23326 // functions.
  23327 //
  23328 // [[the xShrink() page cache method]]
  23329 // ^SQLite invokes the xShrink() method when it wants the page cache to
  23330 // free up as much of heap memory as possible.  The page cache implementation
  23331 // is not obligated to free any memory, but well-behaved implementations should
  23332 // do their best.
  23333 type Sqlite3_pcache_methods2 = sqlite3_pcache_methods2
  23334 
  23335 type sqlite3_pcache_methods = struct {
  23336 	FpArg       uintptr
  23337 	FxInit      uintptr
  23338 	FxShutdown  uintptr
  23339 	FxCreate    uintptr
  23340 	FxCachesize uintptr
  23341 	FxPagecount uintptr
  23342 	FxFetch     uintptr
  23343 	FxUnpin     uintptr
  23344 	FxRekey     uintptr
  23345 	FxTruncate  uintptr
  23346 	FxDestroy   uintptr
  23347 }
  23348 
  23349 // This is the obsolete pcache_methods object that has now been replaced
  23350 // by sqlite3_pcache_methods2.  This object is not used by SQLite.  It is
  23351 // retained in the header file for backwards compatibility only.
  23352 type Sqlite3_pcache_methods = sqlite3_pcache_methods
  23353 
  23354 type sqlite3_backup = struct {
  23355 	FpDestDb     uintptr
  23356 	FpDest       uintptr
  23357 	FiDestSchema U32
  23358 	FbDestLocked int32
  23359 	FiNext       Pgno
  23360 	F__ccgo_pad1 [4]byte
  23361 	FpSrcDb      uintptr
  23362 	FpSrc        uintptr
  23363 	Frc          int32
  23364 	FnRemaining  Pgno
  23365 	FnPagecount  Pgno
  23366 	FisAttached  int32
  23367 	FpNext       uintptr
  23368 }
  23369 
  23370 // CAPI3REF: Online Backup Object
  23371 //
  23372 // The sqlite3_backup object records state information about an ongoing
  23373 // online backup operation.  ^The sqlite3_backup object is created by
  23374 // a call to [sqlite3_backup_init()] and is destroyed by a call to
  23375 // [sqlite3_backup_finish()].
  23376 //
  23377 // See Also: [Using the SQLite Online Backup API]
  23378 type Sqlite3_backup = sqlite3_backup
  23379 
  23380 type sqlite3_snapshot = struct{ Fhidden [48]uint8 }
  23381 
  23382 // CAPI3REF: Database Snapshot
  23383 // KEYWORDS: {snapshot} {sqlite3_snapshot}
  23384 //
  23385 // An instance of the snapshot object records the state of a [WAL mode]
  23386 // database for some specific point in history.
  23387 //
  23388 // In [WAL mode], multiple [database connections] that are open on the
  23389 // same database file can each be reading a different historical version
  23390 // of the database file.  When a [database connection] begins a read
  23391 // transaction, that connection sees an unchanging copy of the database
  23392 // as it existed for the point in time when the transaction first started.
  23393 // Subsequent changes to the database from other connections are not seen
  23394 // by the reader until a new read transaction is started.
  23395 //
  23396 // The sqlite3_snapshot object records state information about an historical
  23397 // version of the database file so that it is possible to later open a new read
  23398 // transaction that sees that historical version of the database rather than
  23399 // the most recent version.
  23400 type Sqlite3_snapshot = sqlite3_snapshot
  23401 
  23402 type sqlite3_rtree_geometry = struct {
  23403 	FpContext    uintptr
  23404 	FnParam      int32
  23405 	F__ccgo_pad1 [4]byte
  23406 	FaParam      uintptr
  23407 	FpUser       uintptr
  23408 	FxDelUser    uintptr
  23409 }
  23410 
  23411 type Sqlite3_rtree_geometry = sqlite3_rtree_geometry
  23412 type sqlite3_rtree_query_info = struct {
  23413 	FpContext      uintptr
  23414 	FnParam        int32
  23415 	F__ccgo_pad1   [4]byte
  23416 	FaParam        uintptr
  23417 	FpUser         uintptr
  23418 	FxDelUser      uintptr
  23419 	FaCoord        uintptr
  23420 	FanQueue       uintptr
  23421 	FnCoord        int32
  23422 	FiLevel        int32
  23423 	FmxLevel       int32
  23424 	F__ccgo_pad2   [4]byte
  23425 	FiRowid        Sqlite3_int64
  23426 	FrParentScore  Sqlite3_rtree_dbl
  23427 	FeParentWithin int32
  23428 	FeWithin       int32
  23429 	FrScore        Sqlite3_rtree_dbl
  23430 	FapSqlParam    uintptr
  23431 }
  23432 
  23433 type Sqlite3_rtree_query_info = sqlite3_rtree_query_info
  23434 
  23435 // The double-precision datatype used by RTree depends on the
  23436 // SQLITE_RTREE_INT_ONLY compile-time option.
  23437 type Sqlite3_rtree_dbl = float64
  23438 
  23439 type sqlite3_session = struct {
  23440 	Fdb                uintptr
  23441 	FzDb               uintptr
  23442 	FbEnableSize       int32
  23443 	FbEnable           int32
  23444 	FbIndirect         int32
  23445 	FbAutoAttach       int32
  23446 	Frc                int32
  23447 	F__ccgo_pad1       [4]byte
  23448 	FpFilterCtx        uintptr
  23449 	FxTableFilter      uintptr
  23450 	FnMalloc           I64
  23451 	FnMaxChangesetSize I64
  23452 	FpZeroBlob         uintptr
  23453 	FpNext             uintptr
  23454 	FpTable            uintptr
  23455 	Fhook              SessionHook
  23456 }
  23457 
  23458 // CAPI3REF: Session Object Handle
  23459 //
  23460 // An instance of this object is a [session] that can be used to
  23461 // record changes to a database.
  23462 type Sqlite3_session = sqlite3_session
  23463 
  23464 type sqlite3_changeset_iter = struct {
  23465 	Fin          SessionInput
  23466 	Ftblhdr      SessionBuffer
  23467 	FbPatchset   int32
  23468 	FbInvert     int32
  23469 	FbSkipEmpty  int32
  23470 	Frc          int32
  23471 	FpConflict   uintptr
  23472 	FzTab        uintptr
  23473 	FnCol        int32
  23474 	Fop          int32
  23475 	FbIndirect   int32
  23476 	F__ccgo_pad1 [4]byte
  23477 	FabPK        uintptr
  23478 	FapValue     uintptr
  23479 }
  23480 
  23481 // CAPI3REF: Changeset Iterator Handle
  23482 //
  23483 // An instance of this object acts as a cursor for iterating
  23484 // over the elements of a [changeset] or [patchset].
  23485 type Sqlite3_changeset_iter = sqlite3_changeset_iter
  23486 
  23487 type sqlite3_changegroup = struct {
  23488 	Frc     int32
  23489 	FbPatch int32
  23490 	FpList  uintptr
  23491 }
  23492 
  23493 // CAPI3REF: Changegroup Handle
  23494 //
  23495 // A changegroup is an object used to combine two or more
  23496 // [changesets] or [patchsets]
  23497 type Sqlite3_changegroup = sqlite3_changegroup
  23498 
  23499 type sqlite3_rebaser = struct{ Fgrp Sqlite3_changegroup }
  23500 
  23501 // CAPI3REF: Rebasing changesets
  23502 // EXPERIMENTAL
  23503 //
  23504 // Suppose there is a site hosting a database in state S0. And that
  23505 // modifications are made that move that database to state S1 and a
  23506 // changeset recorded (the "local" changeset). Then, a changeset based
  23507 // on S0 is received from another site (the "remote" changeset) and
  23508 // applied to the database. The database is then in state
  23509 // (S1+"remote"), where the exact state depends on any conflict
  23510 // resolution decisions (OMIT or REPLACE) made while applying "remote".
  23511 // Rebasing a changeset is to update it to take those conflict
  23512 // resolution decisions into account, so that the same conflicts
  23513 // do not have to be resolved elsewhere in the network.
  23514 //
  23515 // For example, if both the local and remote changesets contain an
  23516 // INSERT of the same key on "CREATE TABLE t1(a PRIMARY KEY, b)":
  23517 //
  23518 //	local:  INSERT INTO t1 VALUES(1, 'v1');
  23519 //	remote: INSERT INTO t1 VALUES(1, 'v2');
  23520 //
  23521 // and the conflict resolution is REPLACE, then the INSERT change is
  23522 // removed from the local changeset (it was overridden). Or, if the
  23523 // conflict resolution was "OMIT", then the local changeset is modified
  23524 // to instead contain:
  23525 //
  23526 //	UPDATE t1 SET b = 'v2' WHERE a=1;
  23527 //
  23528 // Changes within the local changeset are rebased as follows:
  23529 //
  23530 // <dl>
  23531 // <dt>Local INSERT<dd>
  23532 //
  23533 //	This may only conflict with a remote INSERT. If the conflict
  23534 //	resolution was OMIT, then add an UPDATE change to the rebased
  23535 //	changeset. Or, if the conflict resolution was REPLACE, add
  23536 //	nothing to the rebased changeset.
  23537 //
  23538 // <dt>Local DELETE<dd>
  23539 //
  23540 //	This may conflict with a remote UPDATE or DELETE. In both cases the
  23541 //	only possible resolution is OMIT. If the remote operation was a
  23542 //	DELETE, then add no change to the rebased changeset. If the remote
  23543 //	operation was an UPDATE, then the old.* fields of change are updated
  23544 //	to reflect the new.* values in the UPDATE.
  23545 //
  23546 // <dt>Local UPDATE<dd>
  23547 //
  23548 //	This may conflict with a remote UPDATE or DELETE. If it conflicts
  23549 //	with a DELETE, and the conflict resolution was OMIT, then the update
  23550 //	is changed into an INSERT. Any undefined values in the new.* record
  23551 //	from the update change are filled in using the old.* values from
  23552 //	the conflicting DELETE. Or, if the conflict resolution was REPLACE,
  23553 //	the UPDATE change is simply omitted from the rebased changeset.
  23554 //
  23555 //	If conflict is with a remote UPDATE and the resolution is OMIT, then
  23556 //	the old.* values are rebased using the new.* values in the remote
  23557 //	change. Or, if the resolution is REPLACE, then the change is copied
  23558 //	into the rebased changeset with updates to columns also updated by
  23559 //	the conflicting remote UPDATE removed. If this means no columns would
  23560 //	be updated, the change is omitted.
  23561 //
  23562 // </dl>
  23563 //
  23564 // A local change may be rebased against multiple remote changes
  23565 // simultaneously. If a single key is modified by multiple remote
  23566 // changesets, they are combined as follows before the local changeset
  23567 // is rebased:
  23568 //
  23569 // <ul>
  23570 //
  23571 //	<li> If there has been one or more REPLACE resolutions on a
  23572 //	     key, it is rebased according to a REPLACE.
  23573 //
  23574 //	<li> If there have been no REPLACE resolutions on a key, then
  23575 //	     the local changeset is rebased according to the most recent
  23576 //	     of the OMIT resolutions.
  23577 //
  23578 // </ul>
  23579 //
  23580 // Note that conflict resolutions from multiple remote changesets are
  23581 // combined on a per-field basis, not per-row. This means that in the
  23582 // case of multiple remote UPDATE operations, some fields of a single
  23583 // local change may be rebased for REPLACE while others are rebased for
  23584 // OMIT.
  23585 //
  23586 // In order to rebase a local changeset, the remote changeset must first
  23587 // be applied to the local database using sqlite3changeset_apply_v2() and
  23588 // the buffer of rebase information captured. Then:
  23589 //
  23590 // <ol>
  23591 //
  23592 //	<li> An sqlite3_rebaser object is created by calling
  23593 //	     sqlite3rebaser_create().
  23594 //	<li> The new object is configured with the rebase buffer obtained from
  23595 //	     sqlite3changeset_apply_v2() by calling sqlite3rebaser_configure().
  23596 //	     If the local changeset is to be rebased against multiple remote
  23597 //	     changesets, then sqlite3rebaser_configure() should be called
  23598 //	     multiple times, in the same order that the multiple
  23599 //	     sqlite3changeset_apply_v2() calls were made.
  23600 //	<li> Each local changeset is rebased by calling sqlite3rebaser_rebase().
  23601 //	<li> The sqlite3_rebaser object is deleted by calling
  23602 //	     sqlite3rebaser_delete().
  23603 //
  23604 // </ol>
  23605 type Sqlite3_rebaser = sqlite3_rebaser
  23606 
  23607 type Fts5ExtensionApi1 = struct {
  23608 	FiVersion           int32
  23609 	F__ccgo_pad1        [4]byte
  23610 	FxUserData          uintptr
  23611 	FxColumnCount       uintptr
  23612 	FxRowCount          uintptr
  23613 	FxColumnTotalSize   uintptr
  23614 	FxTokenize          uintptr
  23615 	FxPhraseCount       uintptr
  23616 	FxPhraseSize        uintptr
  23617 	FxInstCount         uintptr
  23618 	FxInst              uintptr
  23619 	FxRowid             uintptr
  23620 	FxColumnText        uintptr
  23621 	FxColumnSize        uintptr
  23622 	FxQueryPhrase       uintptr
  23623 	FxSetAuxdata        uintptr
  23624 	FxGetAuxdata        uintptr
  23625 	FxPhraseFirst       uintptr
  23626 	FxPhraseNext        uintptr
  23627 	FxPhraseFirstColumn uintptr
  23628 	FxPhraseNextColumn  uintptr
  23629 }
  23630 
  23631 type Fts5ExtensionApi = Fts5ExtensionApi1
  23632 type Fts5PhraseIter1 = struct {
  23633 	Fa uintptr
  23634 	Fb uintptr
  23635 }
  23636 
  23637 type Fts5PhraseIter = Fts5PhraseIter1
  23638 
  23639 type Fts5_extension_function = uintptr
  23640 type fts5_tokenizer = struct {
  23641 	FxCreate   uintptr
  23642 	FxDelete   uintptr
  23643 	FxTokenize uintptr
  23644 }
  23645 
  23646 type Fts5_tokenizer = fts5_tokenizer
  23647 
  23648 type fts5_api = struct {
  23649 	FiVersion         int32
  23650 	F__ccgo_pad1      [4]byte
  23651 	FxCreateTokenizer uintptr
  23652 	FxFindTokenizer   uintptr
  23653 	FxCreateFunction  uintptr
  23654 }
  23655 
  23656 // ************************************************************************
  23657 //
  23658 // FTS5 EXTENSION REGISTRATION API
  23659 type Fts5_api = fts5_api
  23660 
  23661 type Ssize_t = int64
  23662 
  23663 type Rsize_t = Size_t
  23664 
  23665 type Intptr_t = int64
  23666 
  23667 type Uintptr_t = uint64
  23668 
  23669 type Wint_t = uint16
  23670 type Wctype_t = uint16
  23671 
  23672 type Errno_t = int32
  23673 
  23674 type X__time32_t = int32
  23675 
  23676 type X__time64_t = int64
  23677 
  23678 type Time_t = X__time64_t
  23679 
  23680 type threadlocaleinfostruct = struct {
  23681 	Frefcount      int32
  23682 	Flc_codepage   uint32
  23683 	Flc_collate_cp uint32
  23684 	Flc_handle     [6]uint32
  23685 	Flc_id         [6]LC_ID
  23686 	Flc_category   [6]struct {
  23687 		Flocale    uintptr
  23688 		Fwlocale   uintptr
  23689 		Frefcount  uintptr
  23690 		Fwrefcount uintptr
  23691 	}
  23692 	Flc_clike            int32
  23693 	Fmb_cur_max          int32
  23694 	Flconv_intl_refcount uintptr
  23695 	Flconv_num_refcount  uintptr
  23696 	Flconv_mon_refcount  uintptr
  23697 	Flconv               uintptr
  23698 	Fctype1_refcount     uintptr
  23699 	Fctype1              uintptr
  23700 	Fpctype              uintptr
  23701 	Fpclmap              uintptr
  23702 	Fpcumap              uintptr
  23703 	Flc_time_curr        uintptr
  23704 }
  23705 
  23706 type Pthreadlocinfo = uintptr
  23707 type Pthreadmbcinfo = uintptr
  23708 
  23709 type localeinfo_struct = struct {
  23710 	Flocinfo Pthreadlocinfo
  23711 	Fmbcinfo Pthreadmbcinfo
  23712 }
  23713 
  23714 type X_locale_tstruct = localeinfo_struct
  23715 type X_locale_t = uintptr
  23716 
  23717 type tagLC_ID = struct {
  23718 	FwLanguage uint16
  23719 	FwCountry  uint16
  23720 	FwCodePage uint16
  23721 }
  23722 
  23723 type LC_ID = tagLC_ID
  23724 type LPLC_ID = uintptr
  23725 
  23726 type Threadlocinfo = threadlocaleinfostruct
  23727 
  23728 type _SETJMP_FLOAT128 = struct{ FPart [2]uint64 }
  23729 
  23730 type SETJMP_FLOAT128 = _SETJMP_FLOAT128
  23731 
  23732 type X_JBTYPE = SETJMP_FLOAT128
  23733 
  23734 type _JUMP_BUFFER = struct {
  23735 	FFrame uint64
  23736 	FRbx   uint64
  23737 	FRsp   uint64
  23738 	FRbp   uint64
  23739 	FRsi   uint64
  23740 	FRdi   uint64
  23741 	FR12   uint64
  23742 	FR13   uint64
  23743 	FR14   uint64
  23744 	FR15   uint64
  23745 	FRip   uint64
  23746 	FSpare uint64
  23747 	FXmm6  SETJMP_FLOAT128
  23748 	FXmm7  SETJMP_FLOAT128
  23749 	FXmm8  SETJMP_FLOAT128
  23750 	FXmm9  SETJMP_FLOAT128
  23751 	FXmm10 SETJMP_FLOAT128
  23752 	FXmm11 SETJMP_FLOAT128
  23753 	FXmm12 SETJMP_FLOAT128
  23754 	FXmm13 SETJMP_FLOAT128
  23755 	FXmm14 SETJMP_FLOAT128
  23756 	FXmm15 SETJMP_FLOAT128
  23757 }
  23758 
  23759 type X_JUMP_BUFFER = _JUMP_BUFFER
  23760 
  23761 type Jmp_buf = [16]X_JBTYPE
  23762 
  23763 // Type whose alignment is supported in every context and is at least
  23764 //
  23765 //	as great as that of any standard type not using alignment
  23766 //	specifiers.
  23767 type Max_align_t = struct {
  23768 	F__max_align_ll int64
  23769 	F__max_align_ld float64
  23770 }
  23771 
  23772 type X_onexit_t = uintptr
  23773 
  23774 type _div_t = struct {
  23775 	Fquot int32
  23776 	Frem  int32
  23777 }
  23778 
  23779 type Div_t = _div_t
  23780 
  23781 type _ldiv_t = struct {
  23782 	Fquot int32
  23783 	Frem  int32
  23784 }
  23785 
  23786 type Ldiv_t = _ldiv_t
  23787 
  23788 type X_LDOUBLE = struct{ Fld [10]uint8 }
  23789 
  23790 type X_CRT_DOUBLE = struct{ Fx float64 }
  23791 
  23792 type X_CRT_FLOAT = struct{ Ff float32 }
  23793 
  23794 type X_LONGDOUBLE = struct{ Fx float64 }
  23795 
  23796 type X_LDBL12 = struct{ Fld12 [12]uint8 }
  23797 
  23798 type X_purecall_handler = uintptr
  23799 
  23800 type X_invalid_parameter_handler = uintptr
  23801 
  23802 type Lldiv_t = struct {
  23803 	Fquot int64
  23804 	Frem  int64
  23805 }
  23806 
  23807 type _heapinfo = struct {
  23808 	F_pentry     uintptr
  23809 	F_size       Size_t
  23810 	F_useflag    int32
  23811 	F__ccgo_pad1 [4]byte
  23812 }
  23813 
  23814 // The structure used to walk through the heap with _heapwalk.
  23815 type X_HEAPINFO = _heapinfo
  23816 
  23817 // The Intel API is flexible enough that we must allow aliasing with other
  23818 //
  23819 //	vector types, and their scalar components.
  23820 type X__m64 = [2]int32
  23821 
  23822 // Unaligned version of the same type
  23823 type X__m64_u = [2]int32
  23824 
  23825 // Internal data types for implementing the intrinsics.
  23826 type X__v2si = [2]int32
  23827 type X__v4hi = [4]int16
  23828 type X__v8qi = [8]int8
  23829 type X__v1di = [1]int64
  23830 type X__v2sf = [2]float32
  23831 
  23832 // The Intel API is flexible enough that we must allow aliasing with other
  23833 //
  23834 //	vector types, and their scalar components.
  23835 type X__m128 = [4]float32
  23836 
  23837 // Unaligned version of the same type.
  23838 type X__m128_u = [4]float32
  23839 
  23840 // Internal data types for implementing the intrinsics.
  23841 type X__v4sf = [4]float32
  23842 
  23843 // SSE2
  23844 type X__v2df = [2]float64
  23845 type X__v2di = [2]int64
  23846 type X__v2du = [2]uint64
  23847 type X__v4si = [4]int32
  23848 type X__v4su = [4]uint32
  23849 type X__v8hi = [8]int16
  23850 type X__v8hu = [8]uint16
  23851 type X__v16qi = [16]int8
  23852 type X__v16qs = [16]int8
  23853 type X__v16qu = [16]uint8
  23854 
  23855 // The Intel API is flexible enough that we must allow aliasing with other
  23856 //
  23857 //	vector types, and their scalar components.
  23858 type X__m128i = [2]int64
  23859 type X__m128d = [2]float64
  23860 
  23861 // Unaligned version of the same types.
  23862 type X__m128i_u = [2]int64
  23863 type X__m128d_u = [2]float64
  23864 
  23865 // Internal data types for implementing the intrinsics.
  23866 type X__v4df = [4]float64
  23867 type X__v8sf = [8]float32
  23868 type X__v4di = [4]int64
  23869 type X__v4du = [4]uint64
  23870 type X__v8si = [8]int32
  23871 type X__v8su = [8]uint32
  23872 type X__v16hi = [16]int16
  23873 type X__v16hu = [16]uint16
  23874 type X__v32qi = [32]int8
  23875 type X__v32qs = [32]int8
  23876 type X__v32qu = [32]uint8
  23877 
  23878 // The Intel API is flexible enough that we must allow aliasing with other
  23879 //
  23880 //	vector types, and their scalar components.
  23881 type X__m256 = [8]float32
  23882 type X__m256i = [4]int64
  23883 type X__m256d = [4]float64
  23884 
  23885 // Unaligned version of the same types.
  23886 type X__m256_u = [8]float32
  23887 type X__m256i_u = [4]int64
  23888 type X__m256d_u = [4]float64
  23889 
  23890 // Internal data types for implementing the intrinsics.
  23891 type X__v8df = [8]float64
  23892 type X__v16sf = [16]float32
  23893 type X__v8di = [8]int64
  23894 type X__v8du = [8]uint64
  23895 type X__v16si = [16]int32
  23896 type X__v16su = [16]uint32
  23897 type X__v32hi = [32]int16
  23898 type X__v32hu = [32]uint16
  23899 type X__v64qi = [64]int8
  23900 type X__v64qu = [64]uint8
  23901 
  23902 // The Intel API is flexible enough that we must allow aliasing with other
  23903 //
  23904 //	vector types, and their scalar components.
  23905 type X__m512 = [16]float32
  23906 type X__m512i = [8]int64
  23907 type X__m512d = [8]float64
  23908 
  23909 // Unaligned version of the same type.
  23910 type X__m512_u = [16]float32
  23911 type X__m512i_u = [8]int64
  23912 type X__m512d_u = [8]float64
  23913 
  23914 type X__mmask8 = uint8
  23915 type X__mmask16 = uint16
  23916 
  23917 type X_MM_PERM_ENUM = uint32
  23918 
  23919 // Constants for mantissa extraction
  23920 type X_MM_MANTISSA_NORM_ENUM = uint32
  23921 
  23922 type X_MM_MANTISSA_SIGN_ENUM = uint32
  23923 
  23924 // Internal data types for implementing the intrinsics.
  23925 type X__mmask32 = uint32
  23926 
  23927 type X__mmask64 = uint64
  23928 
  23929 // Internal data types for implementing the intrinsics.
  23930 type X__v16bh = [16]int16
  23931 type X__v8bh = [8]int16
  23932 
  23933 // The Intel API is flexible enough that we must allow aliasing with other
  23934 //
  23935 //	vector types, and their scalar components.
  23936 type X__m256bh = [16]int16
  23937 type X__m128bh = [8]int16
  23938 
  23939 // Internal data types for implementing the intrinsics.
  23940 type X__v32bh = [32]int16
  23941 
  23942 // The Intel API is flexible enough that we must allow aliasing with other
  23943 //
  23944 //	vector types, and their scalar components.
  23945 type X__m512bh = [32]int16
  23946 
  23947 // Forward declarations of structures.
  23948 type Hash1 = struct {
  23949 	Fhtsize uint32
  23950 	Fcount  uint32
  23951 	Ffirst  uintptr
  23952 	Fht     uintptr
  23953 }
  23954 
  23955 // Forward declarations of structures.
  23956 type Hash = Hash1
  23957 type HashElem1 = struct {
  23958 	Fnext uintptr
  23959 	Fprev uintptr
  23960 	Fdata uintptr
  23961 	FpKey uintptr
  23962 }
  23963 
  23964 type HashElem = HashElem1
  23965 
  23966 type _ht = struct {
  23967 	Fcount       uint32
  23968 	F__ccgo_pad1 [4]byte
  23969 	Fchain       uintptr
  23970 }
  23971 
  23972 type _iobuf = struct {
  23973 	F_ptr        uintptr
  23974 	F_cnt        int32
  23975 	F__ccgo_pad1 [4]byte
  23976 	F_base       uintptr
  23977 	F_flag       int32
  23978 	F_file       int32
  23979 	F_charbuf    int32
  23980 	F_bufsiz     int32
  23981 	F_tmpfname   uintptr
  23982 }
  23983 
  23984 type FILE = _iobuf
  23985 
  23986 type X_off_t = int32
  23987 type Off32_t = int32
  23988 
  23989 type X_off64_t = int64
  23990 type Off64_t = int64
  23991 
  23992 type Off_t = Off64_t
  23993 
  23994 type Fpos_t = int64
  23995 
  23996 func vsnwprintf(tls *libc.TLS, __stream uintptr, __n Size_t, __format uintptr, __local_argv X__builtin_va_list) int32 {
  23997 	return libc.X__mingw_vsnwprintf(tls, __stream, __n, __format, __local_argv)
  23998 }
  23999 
  24000 func vswprintf(tls *libc.TLS, __stream uintptr, __count Size_t, __format uintptr, __local_argv X__builtin_va_list) int32 {
  24001 	return vsnwprintf(tls, __stream, __count, __format, __local_argv)
  24002 }
  24003 
  24004 // Integers of known sizes.  These typedefs might change for architectures
  24005 // where the sizes very.  Preprocessor macros are available so that the
  24006 // types can be conveniently redefined at compile-type.  Like this:
  24007 //
  24008 //	cc '-DUINTPTR_TYPE=long long int' ...
  24009 type I64 = Sqlite_int64
  24010 type U64 = Sqlite_uint64
  24011 type U32 = uint32
  24012 type U16 = uint16
  24013 type I16 = int16
  24014 type U8 = uint8
  24015 type I8 = int8
  24016 
  24017 // The datatype used to store estimates of the number of rows in a
  24018 // table or index.
  24019 type TRowcnt = U64
  24020 
  24021 // Estimated quantities used for query planning are stored as 16-bit
  24022 // logarithms.  For quantity X, the value stored is 10*log2(X).  This
  24023 // gives a possible range of values of approximately 1.0e986 to 1e-986.
  24024 // But the allowed values are "grainy".  Not every value is representable.
  24025 // For example, quantities 16 and 17 are both represented by a LogEst
  24026 // of 40.  However, since LogEst quantities are suppose to be estimates,
  24027 // not exact values, this imprecision is not a problem.
  24028 //
  24029 // "LogEst" is short for "Logarithmic Estimate".
  24030 //
  24031 // Examples:
  24032 //
  24033 //	 1 -> 0              20 -> 43          10000 -> 132
  24034 //	 2 -> 10             25 -> 46          25000 -> 146
  24035 //	 3 -> 16            100 -> 66        1000000 -> 199
  24036 //	 4 -> 20           1000 -> 99        1048576 -> 200
  24037 //	10 -> 33           1024 -> 100    4294967296 -> 320
  24038 //
  24039 // The LogEst can be negative to indicate fractional values.
  24040 // Examples:
  24041 //
  24042 //	0.5 -> -10           0.1 -> -33        0.0625 -> -40
  24043 type LogEst = int16
  24044 
  24045 // The uptr type is an unsigned integer large enough to hold a pointer
  24046 type Uptr = U64
  24047 
  24048 // An instance of the following structure is used to store the busy-handler
  24049 // callback for a given sqlite handle.
  24050 //
  24051 // The sqlite.busyHandler member of the sqlite struct contains the busy
  24052 // callback for the database handle. Each pager opened via the sqlite
  24053 // handle is passed a pointer to sqlite.busyHandler. The busy-handler
  24054 // callback is currently invoked only from within pager.c.
  24055 type BusyHandler1 = struct {
  24056 	FxBusyHandler uintptr
  24057 	FpBusyArg     uintptr
  24058 	FnBusy        int32
  24059 	F__ccgo_pad1  [4]byte
  24060 }
  24061 
  24062 // An instance of the following structure is used to store the busy-handler
  24063 // callback for a given sqlite handle.
  24064 //
  24065 // The sqlite.busyHandler member of the sqlite struct contains the busy
  24066 // callback for the database handle. Each pager opened via the sqlite
  24067 // handle is passed a pointer to sqlite.busyHandler. The busy-handler
  24068 // callback is currently invoked only from within pager.c.
  24069 type BusyHandler = BusyHandler1
  24070 
  24071 // Forward references to structures
  24072 type AggInfo1 = struct {
  24073 	FdirectMode     U8
  24074 	FuseSortingIdx  U8
  24075 	FnSortingColumn U16
  24076 	FsortingIdx     int32
  24077 	FsortingIdxPTab int32
  24078 	FiFirstReg      int32
  24079 	FpGroupBy       uintptr
  24080 	FaCol           uintptr
  24081 	FnColumn        int32
  24082 	FnAccumulator   int32
  24083 	FaFunc          uintptr
  24084 	FnFunc          int32
  24085 	FselId          U32
  24086 }
  24087 
  24088 // Forward references to structures
  24089 type AggInfo = AggInfo1
  24090 type AuthContext1 = struct {
  24091 	FzAuthContext uintptr
  24092 	FpParse       uintptr
  24093 }
  24094 
  24095 type AuthContext = AuthContext1
  24096 type AutoincInfo1 = struct {
  24097 	FpNext  uintptr
  24098 	FpTab   uintptr
  24099 	FiDb    int32
  24100 	FregCtr int32
  24101 }
  24102 
  24103 type AutoincInfo = AutoincInfo1
  24104 type Bitvec1 = struct {
  24105 	FiSize       U32
  24106 	FnSet        U32
  24107 	FiDivisor    U32
  24108 	F__ccgo_pad1 [4]byte
  24109 	Fu           struct {
  24110 		F__ccgo_pad1 [0]uint64
  24111 		FaBitmap     [496]U8
  24112 	}
  24113 }
  24114 
  24115 type Bitvec = Bitvec1
  24116 type CollSeq1 = struct {
  24117 	FzName       uintptr
  24118 	Fenc         U8
  24119 	F__ccgo_pad1 [7]byte
  24120 	FpUser       uintptr
  24121 	FxCmp        uintptr
  24122 	FxDel        uintptr
  24123 }
  24124 
  24125 type CollSeq = CollSeq1
  24126 type Column1 = struct {
  24127 	FzCnName     uintptr
  24128 	FnotNull     uint8
  24129 	F__ccgo_pad1 [1]byte
  24130 	Faffinity    int8
  24131 	FszEst       U8
  24132 	FhName       U8
  24133 	F__ccgo_pad2 [1]byte
  24134 	FiDflt       U16
  24135 	FcolFlags    U16
  24136 	F__ccgo_pad3 [6]byte
  24137 }
  24138 
  24139 type Column = Column1
  24140 type Cte1 = struct {
  24141 	FzName       uintptr
  24142 	FpCols       uintptr
  24143 	FpSelect     uintptr
  24144 	FzCteErr     uintptr
  24145 	FpUse        uintptr
  24146 	FeM10d       U8
  24147 	F__ccgo_pad1 [7]byte
  24148 }
  24149 
  24150 type Cte = Cte1
  24151 type CteUse1 = struct {
  24152 	FnUse        int32
  24153 	FaddrM9e     int32
  24154 	FregRtn      int32
  24155 	FiCur        int32
  24156 	FnRowEst     LogEst
  24157 	FeM10d       U8
  24158 	F__ccgo_pad1 [1]byte
  24159 }
  24160 
  24161 type CteUse = CteUse1
  24162 type Db1 = struct {
  24163 	FzDbSName     uintptr
  24164 	FpBt          uintptr
  24165 	Fsafety_level U8
  24166 	FbSyncSet     U8
  24167 	F__ccgo_pad1  [6]byte
  24168 	FpSchema      uintptr
  24169 }
  24170 
  24171 type Db = Db1
  24172 type DbFixer1 = struct {
  24173 	FpParse      uintptr
  24174 	Fw           Walker
  24175 	FpSchema     uintptr
  24176 	FbTemp       U8
  24177 	F__ccgo_pad1 [7]byte
  24178 	FzDb         uintptr
  24179 	FzType       uintptr
  24180 	FpName       uintptr
  24181 }
  24182 
  24183 type DbFixer = DbFixer1
  24184 type Schema1 = struct {
  24185 	Fschema_cookie int32
  24186 	FiGeneration   int32
  24187 	FtblHash       Hash
  24188 	FidxHash       Hash
  24189 	FtrigHash      Hash
  24190 	FfkeyHash      Hash
  24191 	FpSeqTab       uintptr
  24192 	Ffile_format   U8
  24193 	Fenc           U8
  24194 	FschemaFlags   U16
  24195 	Fcache_size    int32
  24196 }
  24197 
  24198 type Schema = Schema1
  24199 type Expr1 = struct {
  24200 	Fop          U8
  24201 	FaffExpr     int8
  24202 	Fop2         U8
  24203 	F__ccgo_pad1 [1]byte
  24204 	Fflags       U32
  24205 	Fu           struct{ FzToken uintptr }
  24206 	FpLeft       uintptr
  24207 	FpRight      uintptr
  24208 	Fx           struct{ FpList uintptr }
  24209 	FnHeight     int32
  24210 	FiTable      int32
  24211 	FiColumn     YnVar
  24212 	FiAgg        I16
  24213 	Fw           struct{ FiJoin int32 }
  24214 	FpAggInfo    uintptr
  24215 	Fy           struct{ FpTab uintptr }
  24216 }
  24217 
  24218 type Expr = Expr1
  24219 type ExprList1 = struct {
  24220 	FnExpr  int32
  24221 	FnAlloc int32
  24222 	Fa      [1]struct {
  24223 		FpExpr  uintptr
  24224 		FzEName uintptr
  24225 		Ffg     struct {
  24226 			F__ccgo_pad1 [0]uint32
  24227 			FsortFlags   U8
  24228 			F__ccgo_pad2 [3]byte
  24229 			FeEName      uint16
  24230 			F__ccgo_pad3 [2]byte
  24231 		}
  24232 		Fu struct {
  24233 			F__ccgo_pad1 [0]uint32
  24234 			Fx           struct {
  24235 				FiOrderByCol U16
  24236 				FiAlias      U16
  24237 			}
  24238 		}
  24239 		F__ccgo_pad1 [4]byte
  24240 	}
  24241 }
  24242 
  24243 type ExprList = ExprList1
  24244 type FKey1 = struct {
  24245 	FpFrom       uintptr
  24246 	FpNextFrom   uintptr
  24247 	FzTo         uintptr
  24248 	FpNextTo     uintptr
  24249 	FpPrevTo     uintptr
  24250 	FnCol        int32
  24251 	FisDeferred  U8
  24252 	FaAction     [2]U8
  24253 	F__ccgo_pad1 [1]byte
  24254 	FapTrigger   [2]uintptr
  24255 	FaCol        [1]struct {
  24256 		FiFrom       int32
  24257 		F__ccgo_pad1 [4]byte
  24258 		FzCol        uintptr
  24259 	}
  24260 }
  24261 
  24262 type FKey = FKey1
  24263 type FuncDestructor1 = struct {
  24264 	FnRef        int32
  24265 	F__ccgo_pad1 [4]byte
  24266 	FxDestroy    uintptr
  24267 	FpUserData   uintptr
  24268 }
  24269 
  24270 type FuncDestructor = FuncDestructor1
  24271 type FuncDef1 = struct {
  24272 	FnArg        I8
  24273 	F__ccgo_pad1 [3]byte
  24274 	FfuncFlags   U32
  24275 	FpUserData   uintptr
  24276 	FpNext       uintptr
  24277 	FxSFunc      uintptr
  24278 	FxFinalize   uintptr
  24279 	FxValue      uintptr
  24280 	FxInverse    uintptr
  24281 	FzName       uintptr
  24282 	Fu           struct{ FpHash uintptr }
  24283 }
  24284 
  24285 type FuncDef = FuncDef1
  24286 type FuncDefHash1 = struct{ Fa [23]uintptr }
  24287 
  24288 type FuncDefHash = FuncDefHash1
  24289 type IdList1 = struct {
  24290 	FnId         int32
  24291 	FeU4         U8
  24292 	F__ccgo_pad1 [3]byte
  24293 	Fa           [1]struct {
  24294 		FzName uintptr
  24295 		Fu4    struct {
  24296 			F__ccgo_pad1 [0]uint64
  24297 			Fidx         int32
  24298 			F__ccgo_pad2 [4]byte
  24299 		}
  24300 	}
  24301 }
  24302 
  24303 type IdList = IdList1
  24304 type Index1 = struct {
  24305 	FzName         uintptr
  24306 	FaiColumn      uintptr
  24307 	FaiRowLogEst   uintptr
  24308 	FpTable        uintptr
  24309 	FzColAff       uintptr
  24310 	FpNext         uintptr
  24311 	FpSchema       uintptr
  24312 	FaSortOrder    uintptr
  24313 	FazColl        uintptr
  24314 	FpPartIdxWhere uintptr
  24315 	FaColExpr      uintptr
  24316 	Ftnum          Pgno
  24317 	FszIdxRow      LogEst
  24318 	FnKeyCol       U16
  24319 	FnColumn       U16
  24320 	FonError       U8
  24321 	F__ccgo_pad1   [1]byte
  24322 	FidxType       uint16
  24323 	F__ccgo_pad2   [2]byte
  24324 	FnSample       int32
  24325 	FnSampleCol    int32
  24326 	FaAvgEq        uintptr
  24327 	FaSample       uintptr
  24328 	FaiRowEst      uintptr
  24329 	FnRowEst0      TRowcnt
  24330 	FcolNotIdxed   Bitmask
  24331 }
  24332 
  24333 type Index = Index1
  24334 type IndexedExpr1 = struct {
  24335 	FpExpr         uintptr
  24336 	FiDataCur      int32
  24337 	FiIdxCur       int32
  24338 	FiIdxCol       int32
  24339 	FbMaybeNullRow U8
  24340 	Faff           U8
  24341 	F__ccgo_pad1   [2]byte
  24342 	FpIENext       uintptr
  24343 }
  24344 
  24345 type IndexedExpr = IndexedExpr1
  24346 type IndexSample1 = struct {
  24347 	Fp           uintptr
  24348 	Fn           int32
  24349 	F__ccgo_pad1 [4]byte
  24350 	FanEq        uintptr
  24351 	FanLt        uintptr
  24352 	FanDLt       uintptr
  24353 }
  24354 
  24355 type IndexSample = IndexSample1
  24356 type KeyInfo1 = struct {
  24357 	FnRef        U32
  24358 	Fenc         U8
  24359 	F__ccgo_pad1 [1]byte
  24360 	FnKeyField   U16
  24361 	FnAllField   U16
  24362 	F__ccgo_pad2 [6]byte
  24363 	Fdb          uintptr
  24364 	FaSortFlags  uintptr
  24365 	FaColl       [1]uintptr
  24366 }
  24367 
  24368 type KeyInfo = KeyInfo1
  24369 type Lookaside1 = struct {
  24370 	FbDisable    U32
  24371 	Fsz          U16
  24372 	FszTrue      U16
  24373 	FbMalloced   U8
  24374 	F__ccgo_pad1 [3]byte
  24375 	FnSlot       U32
  24376 	FanStat      [3]U32
  24377 	F__ccgo_pad2 [4]byte
  24378 	FpInit       uintptr
  24379 	FpFree       uintptr
  24380 	FpSmallInit  uintptr
  24381 	FpSmallFree  uintptr
  24382 	FpMiddle     uintptr
  24383 	FpStart      uintptr
  24384 	FpEnd        uintptr
  24385 	FpTrueEnd    uintptr
  24386 }
  24387 
  24388 type Lookaside = Lookaside1
  24389 type LookasideSlot1 = struct{ FpNext uintptr }
  24390 
  24391 type LookasideSlot = LookasideSlot1
  24392 type Module1 = struct {
  24393 	FpModule     uintptr
  24394 	FzName       uintptr
  24395 	FnRefModule  int32
  24396 	F__ccgo_pad1 [4]byte
  24397 	FpAux        uintptr
  24398 	FxDestroy    uintptr
  24399 	FpEpoTab     uintptr
  24400 }
  24401 
  24402 type Module = Module1
  24403 type NameContext1 = struct {
  24404 	FpParse      uintptr
  24405 	FpSrcList    uintptr
  24406 	FuNC         struct{ FpEList uintptr }
  24407 	FpNext       uintptr
  24408 	FnRef        int32
  24409 	FnNcErr      int32
  24410 	FncFlags     int32
  24411 	F__ccgo_pad1 [4]byte
  24412 	FpWinSelect  uintptr
  24413 }
  24414 
  24415 type NameContext = NameContext1
  24416 type OnOrUsing1 = struct {
  24417 	FpOn    uintptr
  24418 	FpUsing uintptr
  24419 }
  24420 
  24421 type OnOrUsing = OnOrUsing1
  24422 type Parse1 = struct {
  24423 	Fdb               uintptr
  24424 	FzErrMsg          uintptr
  24425 	FpVdbe            uintptr
  24426 	Frc               int32
  24427 	FcolNamesSet      U8
  24428 	FcheckSchema      U8
  24429 	Fnested           U8
  24430 	FnTempReg         U8
  24431 	FisMultiWrite     U8
  24432 	FmayAbort         U8
  24433 	FhasCompound      U8
  24434 	FokConstFactor    U8
  24435 	FdisableLookaside U8
  24436 	FprepFlags        U8
  24437 	FwithinRJSubrtn   U8
  24438 	F__ccgo_pad1      [1]byte
  24439 	FnRangeReg        int32
  24440 	FiRangeReg        int32
  24441 	FnErr             int32
  24442 	FnTab             int32
  24443 	FnMem             int32
  24444 	FszOpAlloc        int32
  24445 	FiSelfTab         int32
  24446 	FnLabel           int32
  24447 	FnLabelAlloc      int32
  24448 	F__ccgo_pad2      [4]byte
  24449 	FaLabel           uintptr
  24450 	FpConstExpr       uintptr
  24451 	FpIdxEpr          uintptr
  24452 	FconstraintName   Token
  24453 	FwriteMask        YDbMask
  24454 	FcookieMask       YDbMask
  24455 	FregRowid         int32
  24456 	FregRoot          int32
  24457 	FnMaxArg          int32
  24458 	FnSelect          int32
  24459 	FnTableLock       int32
  24460 	F__ccgo_pad3      [4]byte
  24461 	FaTableLock       uintptr
  24462 	FpAinc            uintptr
  24463 	FpToplevel        uintptr
  24464 	FpTriggerTab      uintptr
  24465 	FpTriggerPrg      uintptr
  24466 	FpCleanup         uintptr
  24467 	Fu1               struct {
  24468 		F__ccgo_pad1 [0]uint64
  24469 		FaddrCrTab   int32
  24470 		F__ccgo_pad2 [4]byte
  24471 	}
  24472 	FnQueryLoop      U32
  24473 	Foldmask         U32
  24474 	Fnewmask         U32
  24475 	FnProgressSteps  U32
  24476 	FeTriggerOp      U8
  24477 	FbReturning      U8
  24478 	FeOrconf         U8
  24479 	FdisableTriggers U8
  24480 	FaTempReg        [8]int32
  24481 	F__ccgo_pad4     [4]byte
  24482 	FpOuterParse     uintptr
  24483 	FsNameToken      Token
  24484 	FsLastToken      Token
  24485 	FnVar            YnVar
  24486 	FiPkSortOrder    U8
  24487 	Fexplain         U8
  24488 	FeParseMode      U8
  24489 	F__ccgo_pad5     [3]byte
  24490 	FnVtabLock       int32
  24491 	FnHeight         int32
  24492 	FaddrExplain     int32
  24493 	F__ccgo_pad6     [4]byte
  24494 	FpVList          uintptr
  24495 	FpReprepare      uintptr
  24496 	FzTail           uintptr
  24497 	FpNewTable       uintptr
  24498 	FpNewIndex       uintptr
  24499 	FpNewTrigger     uintptr
  24500 	FzAuthContext    uintptr
  24501 	FsArg            Token
  24502 	FapVtabLock      uintptr
  24503 	FpWith           uintptr
  24504 	FpRename         uintptr
  24505 }
  24506 
  24507 type Parse = Parse1
  24508 type ParseCleanup1 = struct {
  24509 	FpNext    uintptr
  24510 	FpPtr     uintptr
  24511 	FxCleanup uintptr
  24512 }
  24513 
  24514 type ParseCleanup = ParseCleanup1
  24515 type PreUpdate1 = struct {
  24516 	Fv            uintptr
  24517 	FpCsr         uintptr
  24518 	Fop           int32
  24519 	F__ccgo_pad1  [4]byte
  24520 	FaRecord      uintptr
  24521 	Fkeyinfo      KeyInfo
  24522 	FpUnpacked    uintptr
  24523 	FpNewUnpacked uintptr
  24524 	FiNewReg      int32
  24525 	FiBlobWrite   int32
  24526 	FiKey1        I64
  24527 	FiKey2        I64
  24528 	FaNew         uintptr
  24529 	FpTab         uintptr
  24530 	FpPk          uintptr
  24531 }
  24532 
  24533 type PreUpdate = PreUpdate1
  24534 type PrintfArguments1 = struct {
  24535 	FnArg  int32
  24536 	FnUsed int32
  24537 	FapArg uintptr
  24538 }
  24539 
  24540 type PrintfArguments = PrintfArguments1
  24541 type RenameToken1 = struct {
  24542 	Fp     uintptr
  24543 	Ft     Token
  24544 	FpNext uintptr
  24545 }
  24546 
  24547 type RenameToken = RenameToken1
  24548 type Returning1 = struct {
  24549 	FpParse      uintptr
  24550 	FpReturnEL   uintptr
  24551 	FretTrig     Trigger
  24552 	FretTStep    TriggerStep
  24553 	FiRetCur     int32
  24554 	FnRetCol     int32
  24555 	FiRetReg     int32
  24556 	F__ccgo_pad1 [4]byte
  24557 }
  24558 
  24559 type Returning = Returning1
  24560 type RowSet1 = struct {
  24561 	FpChunk  uintptr
  24562 	Fdb      uintptr
  24563 	FpEntry  uintptr
  24564 	FpLast   uintptr
  24565 	FpFresh  uintptr
  24566 	FpForest uintptr
  24567 	FnFresh  U16
  24568 	FrsFlags U16
  24569 	FiBatch  int32
  24570 }
  24571 
  24572 type RowSet = RowSet1
  24573 type Savepoint1 = struct {
  24574 	FzName            uintptr
  24575 	FnDeferredCons    I64
  24576 	FnDeferredImmCons I64
  24577 	FpNext            uintptr
  24578 }
  24579 
  24580 type Savepoint = Savepoint1
  24581 type Select1 = struct {
  24582 	Fop           U8
  24583 	F__ccgo_pad1  [1]byte
  24584 	FnSelectRow   LogEst
  24585 	FselFlags     U32
  24586 	FiLimit       int32
  24587 	FiOffset      int32
  24588 	FselId        U32
  24589 	FaddrOpenEphm [2]int32
  24590 	F__ccgo_pad2  [4]byte
  24591 	FpEList       uintptr
  24592 	FpSrc         uintptr
  24593 	FpWhere       uintptr
  24594 	FpGroupBy     uintptr
  24595 	FpHaving      uintptr
  24596 	FpOrderBy     uintptr
  24597 	FpPrior       uintptr
  24598 	FpNext        uintptr
  24599 	FpLimit       uintptr
  24600 	FpWith        uintptr
  24601 	FpWin         uintptr
  24602 	FpWinDefn     uintptr
  24603 }
  24604 
  24605 type Select = Select1
  24606 type SQLiteThread1 = struct {
  24607 	Ftid         uintptr
  24608 	Fid          uint32
  24609 	F__ccgo_pad1 [4]byte
  24610 	FxTask       uintptr
  24611 	FpIn         uintptr
  24612 	FpResult     uintptr
  24613 }
  24614 
  24615 type SQLiteThread = SQLiteThread1
  24616 type SelectDest1 = struct {
  24617 	FeDest       U8
  24618 	F__ccgo_pad1 [3]byte
  24619 	FiSDParm     int32
  24620 	FiSDParm2    int32
  24621 	FiSdst       int32
  24622 	FnSdst       int32
  24623 	F__ccgo_pad2 [4]byte
  24624 	FzAffSdst    uintptr
  24625 	FpOrderBy    uintptr
  24626 }
  24627 
  24628 type SelectDest = SelectDest1
  24629 type SrcItem1 = struct {
  24630 	FpSchema     uintptr
  24631 	FzDatabase   uintptr
  24632 	FzName       uintptr
  24633 	FzAlias      uintptr
  24634 	FpTab        uintptr
  24635 	FpSelect     uintptr
  24636 	FaddrFillSub int32
  24637 	FregReturn   int32
  24638 	FregResult   int32
  24639 	Ffg          struct {
  24640 		F__ccgo_pad1 [0]uint32
  24641 		Fjointype    U8
  24642 		F__ccgo_pad2 [3]byte
  24643 		FnotIndexed  uint16
  24644 		F__ccgo_pad3 [2]byte
  24645 	}
  24646 	FiCursor int32
  24647 	Fu3      struct{ FpOn uintptr }
  24648 	FcolUsed Bitmask
  24649 	Fu1      struct{ FzIndexedBy uintptr }
  24650 	Fu2      struct{ FpIBIndex uintptr }
  24651 }
  24652 
  24653 type SrcItem = SrcItem1
  24654 type SrcList1 = struct {
  24655 	FnSrc   int32
  24656 	FnAlloc U32
  24657 	Fa      [1]SrcItem
  24658 }
  24659 
  24660 type SrcList = SrcList1
  24661 type StrAccum = sqlite3_str
  24662 type Table1 = struct {
  24663 	FzName      uintptr
  24664 	FaCol       uintptr
  24665 	FpIndex     uintptr
  24666 	FzColAff    uintptr
  24667 	FpCheck     uintptr
  24668 	Ftnum       Pgno
  24669 	FnTabRef    U32
  24670 	FtabFlags   U32
  24671 	FiPKey      I16
  24672 	FnCol       I16
  24673 	FnNVCol     I16
  24674 	FnRowLogEst LogEst
  24675 	FszTabRow   LogEst
  24676 	FkeyConf    U8
  24677 	FeTabType   U8
  24678 	Fu          struct {
  24679 		Ftab struct {
  24680 			FaddColOffset int32
  24681 			F__ccgo_pad1  [4]byte
  24682 			FpFKey        uintptr
  24683 			FpDfltList    uintptr
  24684 		}
  24685 	}
  24686 	FpTrigger uintptr
  24687 	FpSchema  uintptr
  24688 }
  24689 
  24690 // Internal alias for sqlite3_str
  24691 type Table = Table1
  24692 type TableLock1 = struct {
  24693 	FiDb         int32
  24694 	FiTab        Pgno
  24695 	FisWriteLock U8
  24696 	F__ccgo_pad1 [7]byte
  24697 	FzLockName   uintptr
  24698 }
  24699 
  24700 type TableLock = TableLock1
  24701 type Token1 = struct {
  24702 	Fz           uintptr
  24703 	Fn           uint32
  24704 	F__ccgo_pad1 [4]byte
  24705 }
  24706 
  24707 type Token = Token1
  24708 type Trigger1 = struct {
  24709 	FzName       uintptr
  24710 	Ftable       uintptr
  24711 	Fop          U8
  24712 	Ftr_tm       U8
  24713 	FbReturning  U8
  24714 	F__ccgo_pad1 [5]byte
  24715 	FpWhen       uintptr
  24716 	FpColumns    uintptr
  24717 	FpSchema     uintptr
  24718 	FpTabSchema  uintptr
  24719 	Fstep_list   uintptr
  24720 	FpNext       uintptr
  24721 }
  24722 
  24723 type Trigger = Trigger1
  24724 type TriggerPrg1 = struct {
  24725 	FpTrigger    uintptr
  24726 	FpNext       uintptr
  24727 	FpProgram    uintptr
  24728 	Forconf      int32
  24729 	FaColmask    [2]U32
  24730 	F__ccgo_pad1 [4]byte
  24731 }
  24732 
  24733 type TriggerPrg = TriggerPrg1
  24734 type TriggerStep1 = struct {
  24735 	Fop          U8
  24736 	Forconf      U8
  24737 	F__ccgo_pad1 [6]byte
  24738 	FpTrig       uintptr
  24739 	FpSelect     uintptr
  24740 	FzTarget     uintptr
  24741 	FpFrom       uintptr
  24742 	FpWhere      uintptr
  24743 	FpExprList   uintptr
  24744 	FpIdList     uintptr
  24745 	FpUpsert     uintptr
  24746 	FzSpan       uintptr
  24747 	FpNext       uintptr
  24748 	FpLast       uintptr
  24749 }
  24750 
  24751 type TriggerStep = TriggerStep1
  24752 type UnpackedRecord1 = struct {
  24753 	FpKeyInfo    uintptr
  24754 	FaMem        uintptr
  24755 	Fu           struct{ Fz uintptr }
  24756 	Fn           int32
  24757 	FnField      U16
  24758 	Fdefault_rc  I8
  24759 	FerrCode     U8
  24760 	Fr1          I8
  24761 	Fr2          I8
  24762 	FeqSeen      U8
  24763 	F__ccgo_pad1 [5]byte
  24764 }
  24765 
  24766 type UnpackedRecord = UnpackedRecord1
  24767 type Upsert1 = struct {
  24768 	FpUpsertTarget      uintptr
  24769 	FpUpsertTargetWhere uintptr
  24770 	FpUpsertSet         uintptr
  24771 	FpUpsertWhere       uintptr
  24772 	FpNextUpsert        uintptr
  24773 	FisDoUpdate         U8
  24774 	F__ccgo_pad1        [7]byte
  24775 	FpToFree            uintptr
  24776 	FpUpsertIdx         uintptr
  24777 	FpUpsertSrc         uintptr
  24778 	FregData            int32
  24779 	FiDataCur           int32
  24780 	FiIdxCur            int32
  24781 	F__ccgo_pad2        [4]byte
  24782 }
  24783 
  24784 type Upsert = Upsert1
  24785 type VTable1 = struct {
  24786 	Fdb          uintptr
  24787 	FpMod        uintptr
  24788 	FpVtab       uintptr
  24789 	FnRef        int32
  24790 	FbConstraint U8
  24791 	FeVtabRisk   U8
  24792 	F__ccgo_pad1 [2]byte
  24793 	FiSavepoint  int32
  24794 	F__ccgo_pad2 [4]byte
  24795 	FpNext       uintptr
  24796 }
  24797 
  24798 type VTable = VTable1
  24799 type VtabCtx1 = struct {
  24800 	FpVTable     uintptr
  24801 	FpTab        uintptr
  24802 	FpPrior      uintptr
  24803 	FbDeclared   int32
  24804 	F__ccgo_pad1 [4]byte
  24805 }
  24806 
  24807 type VtabCtx = VtabCtx1
  24808 type Walker1 = struct {
  24809 	FpParse           uintptr
  24810 	FxExprCallback    uintptr
  24811 	FxSelectCallback  uintptr
  24812 	FxSelectCallback2 uintptr
  24813 	FwalkerDepth      int32
  24814 	FeCode            U16
  24815 	F__ccgo_pad1      [2]byte
  24816 	Fu                struct{ FpNC uintptr }
  24817 }
  24818 
  24819 type Walker = Walker1
  24820 type WhereInfo1 = struct {
  24821 	FpParse          uintptr
  24822 	FpTabList        uintptr
  24823 	FpOrderBy        uintptr
  24824 	FpResultSet      uintptr
  24825 	FpSelect         uintptr
  24826 	FaiCurOnePass    [2]int32
  24827 	FiContinue       int32
  24828 	FiBreak          int32
  24829 	FsavedNQueryLoop int32
  24830 	FwctrlFlags      U16
  24831 	FiLimit          LogEst
  24832 	FnLevel          U8
  24833 	FnOBSat          I8
  24834 	FeOnePass        U8
  24835 	FeDistinct       U8
  24836 	FbDeferredSeek   uint8
  24837 	F__ccgo_pad1     [1]byte
  24838 	FnRowOut         LogEst
  24839 	FiTop            int32
  24840 	FiEndWhere       int32
  24841 	FpLoops          uintptr
  24842 	FpMemToFree      uintptr
  24843 	FrevMask         Bitmask
  24844 	FsWC             WhereClause
  24845 	FsMaskSet        WhereMaskSet
  24846 	Fa               [1]WhereLevel
  24847 }
  24848 
  24849 type WhereInfo = WhereInfo1
  24850 type Window1 = struct {
  24851 	FzName          uintptr
  24852 	FzBase          uintptr
  24853 	FpPartition     uintptr
  24854 	FpOrderBy       uintptr
  24855 	FeFrmType       U8
  24856 	FeStart         U8
  24857 	FeEnd           U8
  24858 	FbImplicitFrame U8
  24859 	FeExclude       U8
  24860 	F__ccgo_pad1    [3]byte
  24861 	FpStart         uintptr
  24862 	FpEnd           uintptr
  24863 	FppThis         uintptr
  24864 	FpNextWin       uintptr
  24865 	FpFilter        uintptr
  24866 	FpWFunc         uintptr
  24867 	FiEphCsr        int32
  24868 	FregAccum       int32
  24869 	FregResult      int32
  24870 	FcsrApp         int32
  24871 	FregApp         int32
  24872 	FregPart        int32
  24873 	FpOwner         uintptr
  24874 	FnBufferCol     int32
  24875 	FiArgCol        int32
  24876 	FregOne         int32
  24877 	FregStartRowid  int32
  24878 	FregEndRowid    int32
  24879 	FbExprArgs      U8
  24880 	F__ccgo_pad2    [3]byte
  24881 }
  24882 
  24883 type Window = Window1
  24884 type With1 = struct {
  24885 	FnCte   int32
  24886 	FbView  int32
  24887 	FpOuter uintptr
  24888 	Fa      [1]Cte
  24889 }
  24890 
  24891 type With = With1
  24892 
  24893 // The bitmask datatype defined below is used for various optimizations.
  24894 //
  24895 // Changing this from a 64-bit to a 32-bit type limits the number of
  24896 // tables in a join to 32 instead of 64.  But it also reduces the size
  24897 // of the library by 738 bytes on ix86.
  24898 type Bitmask = U64
  24899 
  24900 // A VList object records a mapping between parameters/variables/wildcards
  24901 // in the SQL statement (such as $abc, @pqr, or :xyz) and the integer
  24902 // variable number associated with that parameter.  See the format description
  24903 // on the sqlite3VListAdd() routine for more information.  A VList is really
  24904 // just an array of integers.
  24905 type VList = int32
  24906 
  24907 // The type used to represent a page number.  The first page in a file
  24908 // is called page 1.  0 is used to represent "not a page".
  24909 type Pgno = U32
  24910 
  24911 // Each open file is managed by a separate instance of the "Pager" structure.
  24912 type Pager1 = struct {
  24913 	FpVfs              uintptr
  24914 	FexclusiveMode     U8
  24915 	FjournalMode       U8
  24916 	FuseJournal        U8
  24917 	FnoSync            U8
  24918 	FfullSync          U8
  24919 	FextraSync         U8
  24920 	FsyncFlags         U8
  24921 	FwalSyncFlags      U8
  24922 	FtempFile          U8
  24923 	FnoLock            U8
  24924 	FreadOnly          U8
  24925 	FmemDb             U8
  24926 	FmemVfs            U8
  24927 	FeState            U8
  24928 	FeLock             U8
  24929 	FchangeCountDone   U8
  24930 	FsetSuper          U8
  24931 	FdoNotSpill        U8
  24932 	FsubjInMemory      U8
  24933 	FbUseFetch         U8
  24934 	FhasHeldSharedLock U8
  24935 	F__ccgo_pad1       [3]byte
  24936 	FdbSize            Pgno
  24937 	FdbOrigSize        Pgno
  24938 	FdbFileSize        Pgno
  24939 	FdbHintSize        Pgno
  24940 	FerrCode           int32
  24941 	FnRec              int32
  24942 	FcksumInit         U32
  24943 	FnSubRec           U32
  24944 	FpInJournal        uintptr
  24945 	Ffd                uintptr
  24946 	Fjfd               uintptr
  24947 	Fsjfd              uintptr
  24948 	FjournalOff        I64
  24949 	FjournalHdr        I64
  24950 	FpBackup           uintptr
  24951 	FaSavepoint        uintptr
  24952 	FnSavepoint        int32
  24953 	FiDataVersion      U32
  24954 	FdbFileVers        [16]int8
  24955 	FnMmapOut          int32
  24956 	F__ccgo_pad2       [4]byte
  24957 	FszMmap            Sqlite3_int64
  24958 	FpMmapFreelist     uintptr
  24959 	FnExtra            U16
  24960 	FnReserve          I16
  24961 	FvfsFlags          U32
  24962 	FsectorSize        U32
  24963 	FmxPgno            Pgno
  24964 	FlckPgno           Pgno
  24965 	F__ccgo_pad3       [4]byte
  24966 	FpageSize          I64
  24967 	FjournalSizeLimit  I64
  24968 	FzFilename         uintptr
  24969 	FzJournal          uintptr
  24970 	FxBusyHandler      uintptr
  24971 	FpBusyHandlerArg   uintptr
  24972 	FaStat             [4]int32
  24973 	FxReiniter         uintptr
  24974 	FxGet              uintptr
  24975 	FpTmpSpace         uintptr
  24976 	FpPCache           uintptr
  24977 	FpWal              uintptr
  24978 	FzWal              uintptr
  24979 }
  24980 
  24981 // Each open file is managed by a separate instance of the "Pager" structure.
  24982 type Pager = Pager1
  24983 
  24984 // Handle type for pages.
  24985 type PgHdr2 = struct {
  24986 	FpPage       uintptr
  24987 	FpData       uintptr
  24988 	FpExtra      uintptr
  24989 	FpCache      uintptr
  24990 	FpDirty      uintptr
  24991 	FpPager      uintptr
  24992 	Fpgno        Pgno
  24993 	Fflags       U16
  24994 	F__ccgo_pad1 [2]byte
  24995 	FnRef        I64
  24996 	FpDirtyNext  uintptr
  24997 	FpDirtyPrev  uintptr
  24998 }
  24999 
  25000 // Handle type for pages.
  25001 type DbPage = PgHdr2
  25002 
  25003 // Forward declarations of structure
  25004 type Btree1 = struct {
  25005 	Fdb             uintptr
  25006 	FpBt            uintptr
  25007 	FinTrans        U8
  25008 	Fsharable       U8
  25009 	Flocked         U8
  25010 	FhasIncrblobCur U8
  25011 	FwantToLock     int32
  25012 	FnBackup        int32
  25013 	FiBDataVersion  U32
  25014 	FpNext          uintptr
  25015 	FpPrev          uintptr
  25016 	Flock           BtLock
  25017 }
  25018 
  25019 // Forward declarations of structure
  25020 type Btree = Btree1
  25021 type BtCursor1 = struct {
  25022 	FeState        U8
  25023 	FcurFlags      U8
  25024 	FcurPagerFlags U8
  25025 	Fhints         U8
  25026 	FskipNext      int32
  25027 	FpBtree        uintptr
  25028 	FaOverflow     uintptr
  25029 	FpKey          uintptr
  25030 	FpBt           uintptr
  25031 	FpNext         uintptr
  25032 	Finfo          CellInfo
  25033 	FnKey          I64
  25034 	FpgnoRoot      Pgno
  25035 	FiPage         I8
  25036 	FcurIntKey     U8
  25037 	Fix            U16
  25038 	FaiIdx         [19]U16
  25039 	F__ccgo_pad1   [2]byte
  25040 	FpKeyInfo      uintptr
  25041 	FpPage         uintptr
  25042 	FapPage        [19]uintptr
  25043 }
  25044 
  25045 type BtCursor = BtCursor1
  25046 type BtShared1 = struct {
  25047 	FpPager          uintptr
  25048 	Fdb              uintptr
  25049 	FpCursor         uintptr
  25050 	FpPage1          uintptr
  25051 	FopenFlags       U8
  25052 	FautoVacuum      U8
  25053 	FincrVacuum      U8
  25054 	FbDoTruncate     U8
  25055 	FinTransaction   U8
  25056 	Fmax1bytePayload U8
  25057 	FnReserveWanted  U8
  25058 	F__ccgo_pad1     [1]byte
  25059 	FbtsFlags        U16
  25060 	FmaxLocal        U16
  25061 	FminLocal        U16
  25062 	FmaxLeaf         U16
  25063 	FminLeaf         U16
  25064 	F__ccgo_pad2     [2]byte
  25065 	FpageSize        U32
  25066 	FusableSize      U32
  25067 	FnTransaction    int32
  25068 	FnPage           U32
  25069 	F__ccgo_pad3     [4]byte
  25070 	FpSchema         uintptr
  25071 	FxFreeSchema     uintptr
  25072 	Fmutex           uintptr
  25073 	FpHasContent     uintptr
  25074 	FnRef            int32
  25075 	F__ccgo_pad4     [4]byte
  25076 	FpNext           uintptr
  25077 	FpLock           uintptr
  25078 	FpWriter         uintptr
  25079 	FpTmpSpace       uintptr
  25080 	FnPreformatSize  int32
  25081 	F__ccgo_pad5     [4]byte
  25082 }
  25083 
  25084 type BtShared = BtShared1
  25085 type BtreePayload1 = struct {
  25086 	FpKey        uintptr
  25087 	FnKey        Sqlite3_int64
  25088 	FpData       uintptr
  25089 	FaMem        uintptr
  25090 	FnMem        U16
  25091 	F__ccgo_pad1 [2]byte
  25092 	FnData       int32
  25093 	FnZero       int32
  25094 	F__ccgo_pad2 [4]byte
  25095 }
  25096 
  25097 type BtreePayload = BtreePayload1
  25098 
  25099 // A single VDBE is an opaque structure named "Vdbe".  Only routines
  25100 // in the source file sqliteVdbe.c are allowed to see the insides
  25101 // of this structure.
  25102 type Vdbe1 = struct {
  25103 	Fdb                 uintptr
  25104 	FppVPrev            uintptr
  25105 	FpVNext             uintptr
  25106 	FpParse             uintptr
  25107 	FnVar               YnVar
  25108 	F__ccgo_pad1        [2]byte
  25109 	FnMem               int32
  25110 	FnCursor            int32
  25111 	FcacheCtr           U32
  25112 	Fpc                 int32
  25113 	Frc                 int32
  25114 	FnChange            I64
  25115 	FiStatement         int32
  25116 	F__ccgo_pad2        [4]byte
  25117 	FiCurrentTime       I64
  25118 	FnFkConstraint      I64
  25119 	FnStmtDefCons       I64
  25120 	FnStmtDefImmCons    I64
  25121 	FaMem               uintptr
  25122 	FapArg              uintptr
  25123 	FapCsr              uintptr
  25124 	FaVar               uintptr
  25125 	FaOp                uintptr
  25126 	FnOp                int32
  25127 	FnOpAlloc           int32
  25128 	FaColName           uintptr
  25129 	FpResultRow         uintptr
  25130 	FzErrMsg            uintptr
  25131 	FpVList             uintptr
  25132 	FstartTime          I64
  25133 	FnResColumn         U16
  25134 	FerrorAction        U8
  25135 	FminWriteFileFormat U8
  25136 	FprepFlags          U8
  25137 	FeVdbeState         U8
  25138 	F__ccgo_pad3        [2]byte
  25139 	Fexpired            uint8
  25140 	F__ccgo_pad4        [3]byte
  25141 	FbtreeMask          YDbMask
  25142 	FlockMask           YDbMask
  25143 	FaCounter           [9]U32
  25144 	FzSql               uintptr
  25145 	FpFree              uintptr
  25146 	FpFrame             uintptr
  25147 	FpDelFrame          uintptr
  25148 	FnFrame             int32
  25149 	Fexpmask            U32
  25150 	FpProgram           uintptr
  25151 	FpAuxData           uintptr
  25152 }
  25153 
  25154 // A single VDBE is an opaque structure named "Vdbe".  Only routines
  25155 // in the source file sqliteVdbe.c are allowed to see the insides
  25156 // of this structure.
  25157 type Vdbe = Vdbe1
  25158 
  25159 // The names of the following types declared in vdbeInt.h are required
  25160 // for the VdbeOp definition.
  25161 type Mem = sqlite3_value
  25162 type SubProgram1 = struct {
  25163 	FaOp         uintptr
  25164 	FnOp         int32
  25165 	FnMem        int32
  25166 	FnCsr        int32
  25167 	F__ccgo_pad1 [4]byte
  25168 	FaOnce       uintptr
  25169 	Ftoken       uintptr
  25170 	FpNext       uintptr
  25171 }
  25172 
  25173 type SubProgram = SubProgram1
  25174 
  25175 // A single instruction of the virtual machine has an opcode
  25176 // and as many as three operands.  The instruction is recorded
  25177 // as an instance of the following structure:
  25178 type VdbeOp1 = struct {
  25179 	Fopcode U8
  25180 	Fp4type int8
  25181 	Fp5     U16
  25182 	Fp1     int32
  25183 	Fp2     int32
  25184 	Fp3     int32
  25185 	Fp4     struct {
  25186 		F__ccgo_pad1 [0]uint64
  25187 		Fi           int32
  25188 		F__ccgo_pad2 [4]byte
  25189 	}
  25190 }
  25191 
  25192 type p4union = struct {
  25193 	F__ccgo_pad1 [0]uint64
  25194 	Fi           int32
  25195 	F__ccgo_pad2 [4]byte
  25196 }
  25197 
  25198 type VdbeOp = VdbeOp1
  25199 
  25200 // A smaller version of VdbeOp used for the VdbeAddOpList() function because
  25201 // it takes up less space.
  25202 type VdbeOpList1 = struct {
  25203 	Fopcode U8
  25204 	Fp1     int8
  25205 	Fp2     int8
  25206 	Fp3     int8
  25207 }
  25208 
  25209 type VdbeOpList = VdbeOpList1
  25210 
  25211 type RecordCompare = uintptr
  25212 
  25213 type PgHdr = PgHdr2
  25214 type PCache2 = struct {
  25215 	FpDirty      uintptr
  25216 	FpDirtyTail  uintptr
  25217 	FpSynced     uintptr
  25218 	FnRefSum     I64
  25219 	FszCache     int32
  25220 	FszSpill     int32
  25221 	FszPage      int32
  25222 	FszExtra     int32
  25223 	FbPurgeable  U8
  25224 	FeCreate     U8
  25225 	F__ccgo_pad1 [6]byte
  25226 	FxStress     uintptr
  25227 	FpStress     uintptr
  25228 	FpCache      uintptr
  25229 }
  25230 
  25231 type PCache = PCache2
  25232 
  25233 // typedef for the authorization callback function.
  25234 type Sqlite3_xauth = uintptr
  25235 
  25236 type sqlite3InitInfo = struct {
  25237 	FnewTnum       Pgno
  25238 	FiDb           U8
  25239 	Fbusy          U8
  25240 	F__ccgo_pad1   [2]byte
  25241 	ForphanTrigger uint8
  25242 	F__ccgo_pad2   [7]byte
  25243 	FazInit        uintptr
  25244 }
  25245 
  25246 type sColMap = struct {
  25247 	FiFrom       int32
  25248 	F__ccgo_pad1 [4]byte
  25249 	FzCol        uintptr
  25250 }
  25251 
  25252 // An instance of this structure contains information needed to generate
  25253 // code for a SELECT that contains aggregate functions.
  25254 //
  25255 // If Expr.op==TK_AGG_COLUMN or TK_AGG_FUNCTION then Expr.pAggInfo is a
  25256 // pointer to this structure.  The Expr.iAgg field is the index in
  25257 // AggInfo.aCol[] or AggInfo.aFunc[] of information needed to generate
  25258 // code for that node.
  25259 //
  25260 // AggInfo.pGroupBy and AggInfo.aFunc.pExpr point to fields within the
  25261 // original Select structure that describes the SELECT statement.  These
  25262 // fields do not need to be freed when deallocating the AggInfo structure.
  25263 type AggInfo_col = struct {
  25264 	FpTab          uintptr
  25265 	FpCExpr        uintptr
  25266 	FiTable        int32
  25267 	FiColumn       I16
  25268 	FiSorterColumn I16
  25269 }
  25270 
  25271 // An instance of this structure contains information needed to generate
  25272 // code for a SELECT that contains aggregate functions.
  25273 //
  25274 // If Expr.op==TK_AGG_COLUMN or TK_AGG_FUNCTION then Expr.pAggInfo is a
  25275 // pointer to this structure.  The Expr.iAgg field is the index in
  25276 // AggInfo.aCol[] or AggInfo.aFunc[] of information needed to generate
  25277 // code for that node.
  25278 //
  25279 // AggInfo.pGroupBy and AggInfo.aFunc.pExpr point to fields within the
  25280 // original Select structure that describes the SELECT statement.  These
  25281 // fields do not need to be freed when deallocating the AggInfo structure.
  25282 type AggInfo_func = struct {
  25283 	FpFExpr    uintptr
  25284 	FpFunc     uintptr
  25285 	FiDistinct int32
  25286 	FiDistAddr int32
  25287 }
  25288 
  25289 // The datatype ynVar is a signed integer, either 16-bit or 32-bit.
  25290 // Usually it is 16-bits.  But if SQLITE_MAX_VARIABLE_NUMBER is greater
  25291 // than 32767 we have to make it 32-bit.  16-bit is preferred because
  25292 // it uses less memory in the Expr object, which is a big memory user
  25293 // in systems with lots of prepared statements.  And few applications
  25294 // need more than about 10 or 20 variables.  But some extreme users want
  25295 // to have prepared statements with over 32766 variables, and for them
  25296 // the option is available (at compile-time).
  25297 type YnVar = I16
  25298 
  25299 // A list of expressions.  Each expression may optionally have a
  25300 // name.  An expr/name combination can be used in several ways, such
  25301 // as the list of "expr AS ID" fields following a "SELECT" or in the
  25302 // list of "ID = expr" items in an UPDATE.  A list of expressions can
  25303 // also be used as the argument to a function, in which case the a.zName
  25304 // field is not used.
  25305 //
  25306 // In order to try to keep memory usage down, the Expr.a.zEName field
  25307 // is used for multiple purposes:
  25308 //
  25309 //	 eEName          Usage
  25310 //	----------       -------------------------
  25311 //	ENAME_NAME       (1) the AS of result set column
  25312 //	                 (2) COLUMN= of an UPDATE
  25313 //
  25314 //	ENAME_TAB        DB.TABLE.NAME used to resolve names
  25315 //	                 of subqueries
  25316 //
  25317 //	ENAME_SPAN       Text of the original result set
  25318 //	                 expression.
  25319 type ExprList_item = struct {
  25320 	FpExpr  uintptr
  25321 	FzEName uintptr
  25322 	Ffg     struct {
  25323 		F__ccgo_pad1 [0]uint32
  25324 		FsortFlags   U8
  25325 		F__ccgo_pad2 [3]byte
  25326 		FeEName      uint16
  25327 		F__ccgo_pad3 [2]byte
  25328 	}
  25329 	Fu struct {
  25330 		F__ccgo_pad1 [0]uint32
  25331 		Fx           struct {
  25332 			FiOrderByCol U16
  25333 			FiAlias      U16
  25334 		}
  25335 	}
  25336 	F__ccgo_pad1 [4]byte
  25337 }
  25338 
  25339 // An instance of this structure can hold a simple list of identifiers,
  25340 // such as the list "a,b,c" in the following statements:
  25341 //
  25342 //	INSERT INTO t(a,b,c) VALUES ...;
  25343 //	CREATE INDEX idx ON t(a,b,c);
  25344 //	CREATE TRIGGER trig BEFORE UPDATE ON t(a,b,c) ...;
  25345 //
  25346 // The IdList.a.idx field is used when the IdList represents the list of
  25347 // column names after a table name in an INSERT statement.  In the statement
  25348 //
  25349 //	INSERT INTO t(a,b,c) ...
  25350 //
  25351 // If "a" is the k-th column of table "t", then IdList.a[0].idx==k.
  25352 type IdList_item = struct {
  25353 	FzName uintptr
  25354 	Fu4    struct {
  25355 		F__ccgo_pad1 [0]uint64
  25356 		Fidx         int32
  25357 		F__ccgo_pad2 [4]byte
  25358 	}
  25359 }
  25360 
  25361 // The yDbMask datatype for the bitmask of all attached databases.
  25362 type YDbMask = uint32
  25363 
  25364 // A pointer to this structure is used to communicate information
  25365 // from sqlite3Init and OP_ParseSchema into the sqlite3InitCallback.
  25366 type InitData = struct {
  25367 	Fdb          uintptr
  25368 	FpzErrMsg    uintptr
  25369 	FiDb         int32
  25370 	Frc          int32
  25371 	FmInitFlags  U32
  25372 	FnInitRow    U32
  25373 	FmxPage      Pgno
  25374 	F__ccgo_pad1 [4]byte
  25375 }
  25376 
  25377 // Structure containing global configuration data for the SQLite library.
  25378 //
  25379 // This structure also contains some state information.
  25380 type Sqlite3Config = struct {
  25381 	FbMemstat            int32
  25382 	FbCoreMutex          U8
  25383 	FbFullMutex          U8
  25384 	FbOpenUri            U8
  25385 	FbUseCis             U8
  25386 	FbSmallMalloc        U8
  25387 	FbExtraSchemaChecks  U8
  25388 	F__ccgo_pad1         [2]byte
  25389 	FmxStrlen            int32
  25390 	FneverCorrupt        int32
  25391 	FszLookaside         int32
  25392 	FnLookaside          int32
  25393 	FnStmtSpill          int32
  25394 	Fm                   Sqlite3_mem_methods
  25395 	Fmutex               Sqlite3_mutex_methods
  25396 	Fpcache2             Sqlite3_pcache_methods2
  25397 	FpHeap               uintptr
  25398 	FnHeap               int32
  25399 	FmnReq               int32
  25400 	FmxReq               int32
  25401 	F__ccgo_pad2         [4]byte
  25402 	FszMmap              Sqlite3_int64
  25403 	FmxMmap              Sqlite3_int64
  25404 	FpPage               uintptr
  25405 	FszPage              int32
  25406 	FnPage               int32
  25407 	FmxParserStack       int32
  25408 	FsharedCacheEnabled  int32
  25409 	FszPma               U32
  25410 	FisInit              int32
  25411 	FinProgress          int32
  25412 	FisMutexInit         int32
  25413 	FisMallocInit        int32
  25414 	FisPCacheInit        int32
  25415 	FnRefInitMutex       int32
  25416 	F__ccgo_pad3         [4]byte
  25417 	FpInitMutex          uintptr
  25418 	FxLog                uintptr
  25419 	FpLogArg             uintptr
  25420 	FmxMemdbSize         Sqlite3_int64
  25421 	FxTestCallback       uintptr
  25422 	FbLocaltimeFault     int32
  25423 	F__ccgo_pad4         [4]byte
  25424 	FxAltLocaltime       uintptr
  25425 	FiOnceResetThreshold int32
  25426 	FszSorterRef         U32
  25427 	FiPrngSeed           uint32
  25428 	F__ccgo_pad5         [4]byte
  25429 }
  25430 
  25431 // Context pointer passed down through the tree-walk.
  25432 type RefSrcList = struct {
  25433 	Fdb        uintptr
  25434 	FpRef      uintptr
  25435 	FnExclude  I64
  25436 	FaiExclude uintptr
  25437 }
  25438 
  25439 // Context pointer passed down through the tree-walk.
  25440 type IdxCover = struct {
  25441 	FpIdx        uintptr
  25442 	FiCur        int32
  25443 	F__ccgo_pad1 [4]byte
  25444 }
  25445 
  25446 // Context pointer passed down through the tree-walk.
  25447 type WindowRewrite1 = struct {
  25448 	FpWin       uintptr
  25449 	FpSrc       uintptr
  25450 	FpSub       uintptr
  25451 	FpTab       uintptr
  25452 	FpSubSelect uintptr
  25453 }
  25454 
  25455 // Context pointer passed down through the tree-walk.
  25456 type WhereConst1 = struct {
  25457 	FpParse      uintptr
  25458 	FpOomFault   uintptr
  25459 	FnConst      int32
  25460 	FnChng       int32
  25461 	FbHasAffBlob int32
  25462 	FmExcludeOn  U32
  25463 	FapExpr      uintptr
  25464 }
  25465 
  25466 // Context pointer passed down through the tree-walk.
  25467 type RenameCtx1 = struct {
  25468 	FpList uintptr
  25469 	FnList int32
  25470 	FiCol  int32
  25471 	FpTab  uintptr
  25472 	FzOld  uintptr
  25473 }
  25474 
  25475 // Context pointer passed down through the tree-walk.
  25476 type CoveringIndexCheck1 = struct {
  25477 	FpIdx        uintptr
  25478 	FiTabCur     int32
  25479 	FbExpr       U8
  25480 	FbUnidx      U8
  25481 	F__ccgo_pad1 [2]byte
  25482 }
  25483 
  25484 var sqlite3azCompileOpt = [52]uintptr{
  25485 	ts + 7,
  25486 	ts + 27,
  25487 	ts + 46,
  25488 	ts + 65,
  25489 	ts + 90,
  25490 	ts + 112,
  25491 	ts + 142,
  25492 	ts + 162,
  25493 	ts + 182,
  25494 	ts + 205,
  25495 	ts + 230,
  25496 	ts + 257,
  25497 	ts + 282,
  25498 	ts + 304,
  25499 	ts + 336,
  25500 	ts + 362,
  25501 	ts + 387,
  25502 	ts + 410,
  25503 	ts + 422,
  25504 	ts + 437,
  25505 	ts + 459,
  25506 	ts + 484,
  25507 	ts + 507,
  25508 	ts + 529,
  25509 	ts + 540,
  25510 	ts + 553,
  25511 	ts + 568,
  25512 	ts + 584,
  25513 	ts + 597,
  25514 	ts + 618,
  25515 	ts + 642,
  25516 	ts + 665,
  25517 	ts + 681,
  25518 	ts + 697,
  25519 	ts + 721,
  25520 	ts + 748,
  25521 	ts + 768,
  25522 	ts + 789,
  25523 	ts + 811,
  25524 	ts + 841,
  25525 	ts + 866,
  25526 	ts + 892,
  25527 	ts + 912,
  25528 	ts + 938,
  25529 	ts + 961,
  25530 	ts + 987,
  25531 	ts + 1009,
  25532 	ts + 1030,
  25533 	ts + 1041,
  25534 	ts + 1049,
  25535 	ts + 1063,
  25536 	ts + 1076,
  25537 }
  25538 
  25539 func Xsqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) uintptr {
  25540 	*(*int32)(unsafe.Pointer(pnOpt)) = int32(uint64(unsafe.Sizeof(sqlite3azCompileOpt)) / uint64(unsafe.Sizeof(uintptr(0))))
  25541 	return uintptr(unsafe.Pointer(&sqlite3azCompileOpt))
  25542 }
  25543 
  25544 // An array to map all upper-case characters into their corresponding
  25545 // lower-case character.
  25546 //
  25547 // SQLite only considers US-ASCII (or EBCDIC) characters.  We do not
  25548 // handle case conversions for the UTF character set since the tables
  25549 // involved are nearly as big or bigger than SQLite itself.
  25550 var Xsqlite3UpperToLower = [274]uint8{
  25551 	uint8(0), uint8(1), uint8(2), uint8(3), uint8(4), uint8(5), uint8(6), uint8(7), uint8(8), uint8(9), uint8(10), uint8(11), uint8(12), uint8(13), uint8(14), uint8(15), uint8(16), uint8(17),
  25552 	uint8(18), uint8(19), uint8(20), uint8(21), uint8(22), uint8(23), uint8(24), uint8(25), uint8(26), uint8(27), uint8(28), uint8(29), uint8(30), uint8(31), uint8(32), uint8(33), uint8(34), uint8(35),
  25553 	uint8(36), uint8(37), uint8(38), uint8(39), uint8(40), uint8(41), uint8(42), uint8(43), uint8(44), uint8(45), uint8(46), uint8(47), uint8(48), uint8(49), uint8(50), uint8(51), uint8(52), uint8(53),
  25554 	uint8(54), uint8(55), uint8(56), uint8(57), uint8(58), uint8(59), uint8(60), uint8(61), uint8(62), uint8(63), uint8(64), uint8(97), uint8(98), uint8(99), uint8(100), uint8(101), uint8(102), uint8(103),
  25555 	uint8(104), uint8(105), uint8(106), uint8(107), uint8(108), uint8(109), uint8(110), uint8(111), uint8(112), uint8(113), uint8(114), uint8(115), uint8(116), uint8(117), uint8(118), uint8(119), uint8(120), uint8(121),
  25556 	uint8(122), uint8(91), uint8(92), uint8(93), uint8(94), uint8(95), uint8(96), uint8(97), uint8(98), uint8(99), uint8(100), uint8(101), uint8(102), uint8(103), uint8(104), uint8(105), uint8(106), uint8(107),
  25557 	uint8(108), uint8(109), uint8(110), uint8(111), uint8(112), uint8(113), uint8(114), uint8(115), uint8(116), uint8(117), uint8(118), uint8(119), uint8(120), uint8(121), uint8(122), uint8(123), uint8(124), uint8(125),
  25558 	uint8(126), uint8(127), uint8(128), uint8(129), uint8(130), uint8(131), uint8(132), uint8(133), uint8(134), uint8(135), uint8(136), uint8(137), uint8(138), uint8(139), uint8(140), uint8(141), uint8(142), uint8(143),
  25559 	uint8(144), uint8(145), uint8(146), uint8(147), uint8(148), uint8(149), uint8(150), uint8(151), uint8(152), uint8(153), uint8(154), uint8(155), uint8(156), uint8(157), uint8(158), uint8(159), uint8(160), uint8(161),
  25560 	uint8(162), uint8(163), uint8(164), uint8(165), uint8(166), uint8(167), uint8(168), uint8(169), uint8(170), uint8(171), uint8(172), uint8(173), uint8(174), uint8(175), uint8(176), uint8(177), uint8(178), uint8(179),
  25561 	uint8(180), uint8(181), uint8(182), uint8(183), uint8(184), uint8(185), uint8(186), uint8(187), uint8(188), uint8(189), uint8(190), uint8(191), uint8(192), uint8(193), uint8(194), uint8(195), uint8(196), uint8(197),
  25562 	uint8(198), uint8(199), uint8(200), uint8(201), uint8(202), uint8(203), uint8(204), uint8(205), uint8(206), uint8(207), uint8(208), uint8(209), uint8(210), uint8(211), uint8(212), uint8(213), uint8(214), uint8(215),
  25563 	uint8(216), uint8(217), uint8(218), uint8(219), uint8(220), uint8(221), uint8(222), uint8(223), uint8(224), uint8(225), uint8(226), uint8(227), uint8(228), uint8(229), uint8(230), uint8(231), uint8(232), uint8(233),
  25564 	uint8(234), uint8(235), uint8(236), uint8(237), uint8(238), uint8(239), uint8(240), uint8(241), uint8(242), uint8(243), uint8(244), uint8(245), uint8(246), uint8(247), uint8(248), uint8(249), uint8(250), uint8(251),
  25565 	uint8(252), uint8(253), uint8(254), uint8(255),
  25566 	uint8(1), uint8(0), uint8(0), uint8(1), uint8(1), uint8(0),
  25567 	uint8(0), uint8(1), uint8(0), uint8(1), uint8(0), uint8(1),
  25568 	uint8(1), uint8(0), uint8(1), uint8(0), uint8(0), uint8(1),
  25569 }
  25570 var Xsqlite3aLTb uintptr = 0
  25571 var Xsqlite3aEQb uintptr = 0
  25572 var Xsqlite3aGTb uintptr = 0
  25573 
  25574 // The following 256 byte lookup table is used to support SQLites built-in
  25575 // equivalents to the following standard library functions:
  25576 //
  25577 //	isspace()                        0x01
  25578 //	isalpha()                        0x02
  25579 //	isdigit()                        0x04
  25580 //	isalnum()                        0x06
  25581 //	isxdigit()                       0x08
  25582 //	toupper()                        0x20
  25583 //	SQLite identifier character      0x40
  25584 //	Quote character                  0x80
  25585 //
  25586 // Bit 0x20 is set if the mapped character requires translation to upper
  25587 // case. i.e. if the character is a lower-case ASCII character.
  25588 // If x is a lower-case ASCII character, then its upper-case equivalent
  25589 // is (x - 0x20). Therefore toupper() can be implemented as:
  25590 //
  25591 //	(x & ~(map[x]&0x20))
  25592 //
  25593 // The equivalent of tolower() is implemented using the sqlite3UpperToLower[]
  25594 // array. tolower() is used more often than toupper() by SQLite.
  25595 //
  25596 // Bit 0x40 is set if the character is non-alphanumeric and can be used in an
  25597 // SQLite identifier.  Identifiers are alphanumerics, "_", "$", and any
  25598 // non-ASCII UTF character. Hence the test for whether or not a character is
  25599 // part of an identifier is 0x46.
  25600 var Xsqlite3CtypeMap = [256]uint8{
  25601 	uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00),
  25602 	uint8(0x00), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x00), uint8(0x00),
  25603 	uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00),
  25604 	uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00),
  25605 	uint8(0x01), uint8(0x00), uint8(0x80), uint8(0x00), uint8(0x40), uint8(0x00), uint8(0x00), uint8(0x80),
  25606 	uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00),
  25607 	uint8(0x0c), uint8(0x0c), uint8(0x0c), uint8(0x0c), uint8(0x0c), uint8(0x0c), uint8(0x0c), uint8(0x0c),
  25608 	uint8(0x0c), uint8(0x0c), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00),
  25609 	uint8(0x00), uint8(0x0a), uint8(0x0a), uint8(0x0a), uint8(0x0a), uint8(0x0a), uint8(0x0a), uint8(0x02),
  25610 	uint8(0x02), uint8(0x02), uint8(0x02), uint8(0x02), uint8(0x02), uint8(0x02), uint8(0x02), uint8(0x02),
  25611 	uint8(0x02), uint8(0x02), uint8(0x02), uint8(0x02), uint8(0x02), uint8(0x02), uint8(0x02), uint8(0x02),
  25612 	uint8(0x02), uint8(0x02), uint8(0x02), uint8(0x80), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x40),
  25613 	uint8(0x80), uint8(0x2a), uint8(0x2a), uint8(0x2a), uint8(0x2a), uint8(0x2a), uint8(0x2a), uint8(0x22),
  25614 	uint8(0x22), uint8(0x22), uint8(0x22), uint8(0x22), uint8(0x22), uint8(0x22), uint8(0x22), uint8(0x22),
  25615 	uint8(0x22), uint8(0x22), uint8(0x22), uint8(0x22), uint8(0x22), uint8(0x22), uint8(0x22), uint8(0x22),
  25616 	uint8(0x22), uint8(0x22), uint8(0x22), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00),
  25617 	uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40),
  25618 	uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40),
  25619 	uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40),
  25620 	uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40),
  25621 	uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40),
  25622 	uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40),
  25623 	uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40),
  25624 	uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40),
  25625 	uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40),
  25626 	uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40),
  25627 	uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40),
  25628 	uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40),
  25629 	uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40),
  25630 	uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40),
  25631 	uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40),
  25632 	uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40),
  25633 }
  25634 
  25635 // The following singleton contains the global configuration for
  25636 // the SQLite library.
  25637 var Xsqlite3Config = Sqlite3Config{
  25638 	FbCoreMutex:         U8(1),
  25639 	FbFullMutex:         U8(libc.Bool32(SQLITE_THREADSAFE == 1)),
  25640 	FbUseCis:            U8(SQLITE_ALLOW_COVERING_INDEX_SCAN),
  25641 	FbExtraSchemaChecks: U8(1),
  25642 	FmxStrlen:           0x7ffffffe,
  25643 	FszLookaside:        1200, FnLookaside: 40,
  25644 	FnStmtSpill:          64 * 1024,
  25645 	FmxMmap:              int64(SQLITE_MAX_MMAP_SIZE),
  25646 	FnPage:               SQLITE_DEFAULT_PCACHE_INITSZ,
  25647 	FszPma:               U32(SQLITE_SORTER_PMASZ),
  25648 	FmxMemdbSize:         int64(SQLITE_MEMDB_DEFAULT_MAXSIZE),
  25649 	FiOnceResetThreshold: 0x7ffffffe,
  25650 	FszSorterRef:         U32(SQLITE_DEFAULT_SORTERREF_SIZE),
  25651 }
  25652 
  25653 // Hash table for global functions - functions common to all
  25654 // database connections.  After initialization, this table is
  25655 // read-only.
  25656 var Xsqlite3BuiltinFunctions FuncDefHash
  25657 
  25658 // The value of the "pending" byte must be 0x40000000 (1 byte past the
  25659 // 1-gibabyte boundary) in a compatible database.  SQLite never uses
  25660 // the database page that contains the pending byte.  It never attempts
  25661 // to read or write that page.  The pending byte page is set aside
  25662 // for use by the VFS layers as space for managing file locks.
  25663 //
  25664 // During testing, it is often desirable to move the pending byte to
  25665 // a different position in the file.  This allows code that has to
  25666 // deal with the pending byte to run on files that are much smaller
  25667 // than 1 GiB.  The sqlite3_test_control() interface can be used to
  25668 // move the pending byte.
  25669 //
  25670 // IMPORTANT:  Changing the pending byte to any value other than
  25671 // 0x40000000 results in an incompatible database file format!
  25672 // Changing the pending byte during operation will result in undefined
  25673 // and incorrect behavior.
  25674 var Xsqlite3PendingByte int32 = 0x40000000
  25675 
  25676 // Tracing flags set by SQLITE_TESTCTRL_TRACEFLAGS.
  25677 var Xsqlite3TreeTrace U32 = U32(0)
  25678 var Xsqlite3WhereTrace U32 = U32(0)
  25679 
  25680 // #include "opcodes.h"
  25681 // Properties of opcodes.  The OPFLG_INITIALIZER macro is
  25682 // created by mkopcodeh.awk during compilation.  Data is obtained
  25683 // from the comments following the "case OP_xxxx:" statements in
  25684 // the vdbe.c file.
  25685 var Xsqlite3OpcodeProperty = [187]uint8{uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x41), uint8(0x00), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x03), uint8(0x03), uint8(0x01), uint8(0x01), uint8(0x03), uint8(0x03), uint8(0x01), uint8(0x12), uint8(0x01), uint8(0x49), uint8(0x49), uint8(0x49), uint8(0x49), uint8(0x01), uint8(0x49), uint8(0x49), uint8(0x49), uint8(0x49), uint8(0x49), uint8(0x49), uint8(0x41), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x41), uint8(0x01), uint8(0x41), uint8(0x41), uint8(0x41), uint8(0x41), uint8(0x41), uint8(0x26), uint8(0x26), uint8(0x41), uint8(0x23), uint8(0x0b), uint8(0x01), uint8(0x01), uint8(0x03), uint8(0x03), uint8(0x0b), uint8(0x0b), uint8(0x0b), uint8(0x0b), uint8(0x0b), uint8(0x0b), uint8(0x01), uint8(0x03), uint8(0x03), uint8(0x03), uint8(0x01), uint8(0x41), uint8(0x01), uint8(0x00), uint8(0x00), uint8(0x02), uint8(0x02), uint8(0x08), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x02), uint8(0x02), uint8(0x02), uint8(0x00), uint8(0x00), uint8(0x12), uint8(0x1e), uint8(0x20), uint8(0x40), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x40), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x40), uint8(0x00), uint8(0x12), uint8(0x40), uint8(0x40), uint8(0x10), uint8(0x40), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x40), uint8(0x00), uint8(0x40), uint8(0x40), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x50), uint8(0x00), uint8(0x40), uint8(0x04), uint8(0x04), uint8(0x00), uint8(0x40), uint8(0x50), uint8(0x40), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x06), uint8(0x10), uint8(0x00), uint8(0x04), uint8(0x1a), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x40), uint8(0x50), uint8(0x40), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x02), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00)}
  25686 
  25687 // Name of the default collating sequence
  25688 var Xsqlite3StrBINARY = *(*[7]int8)(unsafe.Pointer(ts + 1089))
  25689 
  25690 // Standard typenames.  These names must match the COLTYPE_* definitions.
  25691 // Adjust the SQLITE_N_STDTYPE value if adding or removing entries.
  25692 //
  25693 //	sqlite3StdType[]            The actual names of the datatypes.
  25694 //
  25695 //	sqlite3StdTypeLen[]         The length (in bytes) of each entry
  25696 //	                            in sqlite3StdType[].
  25697 //
  25698 //	sqlite3StdTypeAffinity[]    The affinity associated with each entry
  25699 //	                            in sqlite3StdType[].
  25700 var Xsqlite3StdTypeLen = [6]uint8{uint8(3), uint8(4), uint8(3), uint8(7), uint8(4), uint8(4)}
  25701 var Xsqlite3StdTypeAffinity = [6]int8{
  25702 	int8(SQLITE_AFF_NUMERIC),
  25703 	int8(SQLITE_AFF_BLOB),
  25704 	int8(SQLITE_AFF_INTEGER),
  25705 	int8(SQLITE_AFF_INTEGER),
  25706 	int8(SQLITE_AFF_REAL),
  25707 	int8(SQLITE_AFF_TEXT),
  25708 }
  25709 var Xsqlite3StdType = [6]uintptr{
  25710 	ts + 1096,
  25711 	ts + 1100,
  25712 	ts + 1105,
  25713 	ts + 1109,
  25714 	ts + 1117,
  25715 	ts + 1122,
  25716 }
  25717 
  25718 // SQL is translated into a sequence of instructions to be
  25719 // executed by a virtual machine.  Each instruction is an instance
  25720 // of the following structure.
  25721 type Op = VdbeOp1
  25722 
  25723 // Boolean values
  25724 type Bool = uint32
  25725 
  25726 // Opaque type used by code in vdbesort.c
  25727 type VdbeSorter1 = struct {
  25728 	FmnPmaSize   int32
  25729 	FmxPmaSize   int32
  25730 	FmxKeysize   int32
  25731 	Fpgsz        int32
  25732 	FpReader     uintptr
  25733 	FpMerger     uintptr
  25734 	Fdb          uintptr
  25735 	FpKeyInfo    uintptr
  25736 	FpUnpacked   uintptr
  25737 	Flist        SorterList
  25738 	FiMemory     int32
  25739 	FnMemory     int32
  25740 	FbUsePMA     U8
  25741 	FbUseThreads U8
  25742 	FiPrev       U8
  25743 	FnTask       U8
  25744 	FtypeMask    U8
  25745 	F__ccgo_pad1 [3]byte
  25746 	FaTask       [1]SortSubtask
  25747 }
  25748 
  25749 // Opaque type used by code in vdbesort.c
  25750 type VdbeSorter = VdbeSorter1
  25751 
  25752 // Elements of the linked list at Vdbe.pAuxData
  25753 type AuxData1 = struct {
  25754 	FiAuxOp     int32
  25755 	FiAuxArg    int32
  25756 	FpAux       uintptr
  25757 	FxDeleteAux uintptr
  25758 	FpNextAux   uintptr
  25759 }
  25760 
  25761 // Elements of the linked list at Vdbe.pAuxData
  25762 type AuxData = AuxData1
  25763 
  25764 // A VdbeCursor is an superclass (a wrapper) for various cursor objects:
  25765 //
  25766 //   - A b-tree cursor
  25767 //   - In the main database or in an ephemeral database
  25768 //   - On either an index or a table
  25769 //   - A sorter
  25770 //   - A virtual table
  25771 //   - A one-row "pseudotable" stored in a single register
  25772 type VdbeCursor1 = struct {
  25773 	FeCurType       U8
  25774 	FiDb            I8
  25775 	FnullRow        U8
  25776 	FdeferredMoveto U8
  25777 	FisTable        U8
  25778 	F__ccgo_pad1    [3]byte
  25779 	FisEphemeral    uint8
  25780 	F__ccgo_pad2    [1]byte
  25781 	FseekHit        U16
  25782 	F__ccgo_pad3    [4]byte
  25783 	Fub             struct{ FpBtx uintptr }
  25784 	FseqCount       I64
  25785 	FcacheStatus    U32
  25786 	FseekResult     int32
  25787 	FpAltCursor     uintptr
  25788 	Fuc             struct{ FpCursor uintptr }
  25789 	FpKeyInfo       uintptr
  25790 	FiHdrOffset     U32
  25791 	FpgnoRoot       Pgno
  25792 	FnField         I16
  25793 	FnHdrParsed     U16
  25794 	F__ccgo_pad4    [4]byte
  25795 	FmovetoTarget   I64
  25796 	FaOffset        uintptr
  25797 	FaRow           uintptr
  25798 	FpayloadSize    U32
  25799 	FszRow          U32
  25800 	FaType          [1]U32
  25801 	F__ccgo_pad5    [4]byte
  25802 }
  25803 
  25804 // A VdbeCursor is an superclass (a wrapper) for various cursor objects:
  25805 //
  25806 //   - A b-tree cursor
  25807 //   - In the main database or in an ephemeral database
  25808 //   - On either an index or a table
  25809 //   - A sorter
  25810 //   - A virtual table
  25811 //   - A one-row "pseudotable" stored in a single register
  25812 type VdbeCursor = VdbeCursor1
  25813 
  25814 // When a sub-program is executed (OP_Program), a structure of this type
  25815 // is allocated to store the current value of the program counter, as
  25816 // well as the current memory cell array and various other frame specific
  25817 // values stored in the Vdbe struct. When the sub-program is finished,
  25818 // these values are copied back to the Vdbe from the VdbeFrame structure,
  25819 // restoring the state of the VM to as it was before the sub-program
  25820 // began executing.
  25821 //
  25822 // The memory for a VdbeFrame object is allocated and managed by a memory
  25823 // cell in the parent (calling) frame. When the memory cell is deleted or
  25824 // overwritten, the VdbeFrame object is not freed immediately. Instead, it
  25825 // is linked into the Vdbe.pDelFrame list. The contents of the Vdbe.pDelFrame
  25826 // list is deleted when the VM is reset in VdbeHalt(). The reason for doing
  25827 // this instead of deleting the VdbeFrame immediately is to avoid recursive
  25828 // calls to sqlite3VdbeMemRelease() when the memory cells belonging to the
  25829 // child frame are released.
  25830 //
  25831 // The currently executing frame is stored in Vdbe.pFrame. Vdbe.pFrame is
  25832 // set to NULL if the currently executing frame is the main program.
  25833 type VdbeFrame1 = struct {
  25834 	Fv         uintptr
  25835 	FpParent   uintptr
  25836 	FaOp       uintptr
  25837 	FaMem      uintptr
  25838 	FapCsr     uintptr
  25839 	FaOnce     uintptr
  25840 	Ftoken     uintptr
  25841 	FlastRowid I64
  25842 	FpAuxData  uintptr
  25843 	FnCursor   int32
  25844 	Fpc        int32
  25845 	FnOp       int32
  25846 	FnMem      int32
  25847 	FnChildMem int32
  25848 	FnChildCsr int32
  25849 	FnChange   I64
  25850 	FnDbChange I64
  25851 }
  25852 
  25853 // When a sub-program is executed (OP_Program), a structure of this type
  25854 // is allocated to store the current value of the program counter, as
  25855 // well as the current memory cell array and various other frame specific
  25856 // values stored in the Vdbe struct. When the sub-program is finished,
  25857 // these values are copied back to the Vdbe from the VdbeFrame structure,
  25858 // restoring the state of the VM to as it was before the sub-program
  25859 // began executing.
  25860 //
  25861 // The memory for a VdbeFrame object is allocated and managed by a memory
  25862 // cell in the parent (calling) frame. When the memory cell is deleted or
  25863 // overwritten, the VdbeFrame object is not freed immediately. Instead, it
  25864 // is linked into the Vdbe.pDelFrame list. The contents of the Vdbe.pDelFrame
  25865 // list is deleted when the VM is reset in VdbeHalt(). The reason for doing
  25866 // this instead of deleting the VdbeFrame immediately is to avoid recursive
  25867 // calls to sqlite3VdbeMemRelease() when the memory cells belonging to the
  25868 // child frame are released.
  25869 //
  25870 // The currently executing frame is stored in Vdbe.pFrame. Vdbe.pFrame is
  25871 // set to NULL if the currently executing frame is the main program.
  25872 type VdbeFrame = VdbeFrame1
  25873 
  25874 // Internally, the vdbe manipulates nearly all SQL values as Mem
  25875 // structures. Each Mem struct may cache multiple representations (string,
  25876 // integer etc.) of the same value.
  25877 type MemValue = struct{ Fr float64 }
  25878 
  25879 // A bitfield type for use inside of structures.  Always follow with :N where
  25880 // N is the number of bits.
  25881 type Bft = uint32
  25882 
  25883 // The ScanStatus object holds a single value for the
  25884 // sqlite3_stmt_scanstatus() interface.
  25885 //
  25886 // aAddrRange[]:
  25887 //
  25888 //	This array is used by ScanStatus elements associated with EQP
  25889 //	notes that make an SQLITE_SCANSTAT_NCYCLE value available. It is
  25890 //	an array of up to 3 ranges of VM addresses for which the Vdbe.anCycle[]
  25891 //	values should be summed to calculate the NCYCLE value. Each pair of
  25892 //	integer addresses is a start and end address (both inclusive) for a range
  25893 //	instructions. A start value of 0 indicates an empty range.
  25894 type ScanStatus1 = struct {
  25895 	FaddrExplain int32
  25896 	FaAddrRange  [6]int32
  25897 	FaddrLoop    int32
  25898 	FaddrVisit   int32
  25899 	FiSelectID   int32
  25900 	FnEst        LogEst
  25901 	F__ccgo_pad1 [6]byte
  25902 	FzName       uintptr
  25903 }
  25904 
  25905 // The ScanStatus object holds a single value for the
  25906 // sqlite3_stmt_scanstatus() interface.
  25907 //
  25908 // aAddrRange[]:
  25909 //
  25910 //	This array is used by ScanStatus elements associated with EQP
  25911 //	notes that make an SQLITE_SCANSTAT_NCYCLE value available. It is
  25912 //	an array of up to 3 ranges of VM addresses for which the Vdbe.anCycle[]
  25913 //	values should be summed to calculate the NCYCLE value. Each pair of
  25914 //	integer addresses is a start and end address (both inclusive) for a range
  25915 //	instructions. A start value of 0 indicates an empty range.
  25916 type ScanStatus = ScanStatus1
  25917 
  25918 // The DblquoteStr object holds the text of a double-quoted
  25919 // string for a prepared statement.  A linked list of these objects
  25920 // is constructed during statement parsing and is held on Vdbe.pDblStr.
  25921 // When computing a normalized SQL statement for an SQL statement, that
  25922 // list is consulted for each double-quoted identifier to see if the
  25923 // identifier should really be a string literal.
  25924 type DblquoteStr1 = struct {
  25925 	FpNextStr uintptr
  25926 	Fz        [8]int8
  25927 }
  25928 
  25929 // The DblquoteStr object holds the text of a double-quoted
  25930 // string for a prepared statement.  A linked list of these objects
  25931 // is constructed during statement parsing and is held on Vdbe.pDblStr.
  25932 // When computing a normalized SQL statement for an SQL statement, that
  25933 // list is consulted for each double-quoted identifier to see if the
  25934 // identifier should really be a string literal.
  25935 type DblquoteStr = DblquoteStr1
  25936 
  25937 // An instance of this object is used to pass an vector of values into
  25938 // OP_VFilter, the xFilter method of a virtual table.  The vector is the
  25939 // set of values on the right-hand side of an IN constraint.
  25940 //
  25941 // The value as passed into xFilter is an sqlite3_value with a "pointer"
  25942 // type, such as is generated by sqlite3_result_pointer() and read by
  25943 // sqlite3_value_pointer.  Such values have MEM_Term|MEM_Subtype|MEM_Null
  25944 // and a subtype of 'p'.  The sqlite3_vtab_in_first() and _next() interfaces
  25945 // know how to use this object to step through all the values in the
  25946 // right operand of the IN constraint.
  25947 type ValueList1 = struct {
  25948 	FpCsr uintptr
  25949 	FpOut uintptr
  25950 }
  25951 
  25952 // An instance of this object is used to pass an vector of values into
  25953 // OP_VFilter, the xFilter method of a virtual table.  The vector is the
  25954 // set of values on the right-hand side of an IN constraint.
  25955 //
  25956 // The value as passed into xFilter is an sqlite3_value with a "pointer"
  25957 // type, such as is generated by sqlite3_result_pointer() and read by
  25958 // sqlite3_value_pointer.  Such values have MEM_Term|MEM_Subtype|MEM_Null
  25959 // and a subtype of 'p'.  The sqlite3_vtab_in_first() and _next() interfaces
  25960 // know how to use this object to step through all the values in the
  25961 // right operand of the IN constraint.
  25962 type ValueList = ValueList1
  25963 
  25964 // Variables in which to record status information.
  25965 type Sqlite3StatValueType = Sqlite3_int64
  25966 type sqlite3StatType = struct {
  25967 	FnowValue [10]Sqlite3StatValueType
  25968 	FmxValue  [10]Sqlite3StatValueType
  25969 }
  25970 
  25971 type Sqlite3StatType = sqlite3StatType
  25972 
  25973 var sqlite3Stat = sqlite3StatType{}
  25974 
  25975 var statMutex = [10]int8{
  25976 	int8(0),
  25977 	int8(1),
  25978 	int8(1),
  25979 	int8(0),
  25980 	int8(0),
  25981 	int8(0),
  25982 	int8(0),
  25983 	int8(1),
  25984 	int8(0),
  25985 	int8(0),
  25986 }
  25987 
  25988 // Return the current value of a status parameter.  The caller must
  25989 // be holding the appropriate mutex.
  25990 func Xsqlite3StatusValue(tls *libc.TLS, op int32) Sqlite3_int64 {
  25991 	return *(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + uintptr(op)*8))
  25992 }
  25993 
  25994 // Add N to the value of a status record.  The caller must hold the
  25995 // appropriate mutex.  (Locking is checked by assert()).
  25996 //
  25997 // The StatusUp() routine can accept positive or negative values for N.
  25998 // The value of N is added to the current status value and the high-water
  25999 // mark is adjusted if necessary.
  26000 //
  26001 // The StatusDown() routine lowers the current value by N.  The highwater
  26002 // mark is unchanged.  N must be non-negative for StatusDown().
  26003 func Xsqlite3StatusUp(tls *libc.TLS, op int32, N int32) {
  26004 	*(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + uintptr(op)*8)) += Sqlite3StatValueType(N)
  26005 	if *(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + uintptr(op)*8)) > *(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + 80 + uintptr(op)*8)) {
  26006 		*(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + 80 + uintptr(op)*8)) = *(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + uintptr(op)*8))
  26007 	}
  26008 }
  26009 
  26010 func Xsqlite3StatusDown(tls *libc.TLS, op int32, N int32) {
  26011 	*(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + uintptr(op)*8)) -= Sqlite3StatValueType(N)
  26012 }
  26013 
  26014 // Adjust the highwater mark if necessary.
  26015 // The caller must hold the appropriate mutex.
  26016 func Xsqlite3StatusHighwater(tls *libc.TLS, op int32, X int32) {
  26017 	var newValue Sqlite3StatValueType
  26018 
  26019 	newValue = Sqlite3StatValueType(X)
  26020 
  26021 	if newValue > *(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + 80 + uintptr(op)*8)) {
  26022 		*(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + 80 + uintptr(op)*8)) = newValue
  26023 	}
  26024 }
  26025 
  26026 // Query status information.
  26027 func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 {
  26028 	var pMutex uintptr
  26029 	_ = pMutex
  26030 
  26031 	if op < 0 || op >= int32(uint64(unsafe.Sizeof([10]Sqlite3StatValueType{}))/uint64(unsafe.Sizeof(Sqlite3StatValueType(0)))) {
  26032 		return Xsqlite3MisuseError(tls, 23233)
  26033 	}
  26034 	if statMutex[op] != 0 {
  26035 		pMutex = Xsqlite3Pcache1Mutex(tls)
  26036 	} else {
  26037 		pMutex = Xsqlite3MallocMutex(tls)
  26038 	}
  26039 	Xsqlite3_mutex_enter(tls, pMutex)
  26040 	*(*Sqlite3_int64)(unsafe.Pointer(pCurrent)) = *(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + uintptr(op)*8))
  26041 	*(*Sqlite3_int64)(unsafe.Pointer(pHighwater)) = *(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + 80 + uintptr(op)*8))
  26042 	if resetFlag != 0 {
  26043 		*(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + 80 + uintptr(op)*8)) = *(*Sqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Stat)) + uintptr(op)*8))
  26044 	}
  26045 	Xsqlite3_mutex_leave(tls, pMutex)
  26046 	_ = pMutex
  26047 	return SQLITE_OK
  26048 }
  26049 
  26050 func Xsqlite3_status(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 {
  26051 	bp := tls.Alloc(16)
  26052 	defer tls.Free(16)
  26053 
  26054 	*(*Sqlite3_int64)(unsafe.Pointer(bp)) = int64(0)
  26055 	*(*Sqlite3_int64)(unsafe.Pointer(bp + 8)) = int64(0)
  26056 	var rc int32
  26057 	rc = Xsqlite3_status64(tls, op, bp, bp+8, resetFlag)
  26058 	if rc == 0 {
  26059 		*(*int32)(unsafe.Pointer(pCurrent)) = int32(*(*Sqlite3_int64)(unsafe.Pointer(bp)))
  26060 		*(*int32)(unsafe.Pointer(pHighwater)) = int32(*(*Sqlite3_int64)(unsafe.Pointer(bp + 8)))
  26061 	}
  26062 	return rc
  26063 }
  26064 
  26065 func countLookasideSlots(tls *libc.TLS, p uintptr) U32 {
  26066 	var cnt U32 = U32(0)
  26067 	for p != 0 {
  26068 		p = (*LookasideSlot)(unsafe.Pointer(p)).FpNext
  26069 		cnt++
  26070 	}
  26071 	return cnt
  26072 }
  26073 
  26074 // Count the number of slots of lookaside memory that are outstanding
  26075 func Xsqlite3LookasideUsed(tls *libc.TLS, db uintptr, pHighwater uintptr) int32 {
  26076 	var nInit U32 = countLookasideSlots(tls, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit)
  26077 	var nFree U32 = countLookasideSlots(tls, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree)
  26078 	nInit = nInit + countLookasideSlots(tls, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit)
  26079 	nFree = nFree + countLookasideSlots(tls, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree)
  26080 	if pHighwater != 0 {
  26081 		*(*int32)(unsafe.Pointer(pHighwater)) = int32((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FnSlot - nInit)
  26082 	}
  26083 	return int32((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FnSlot - (nInit + nFree))
  26084 }
  26085 
  26086 // Query status information for a single database connection
  26087 func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 {
  26088 	bp := tls.Alloc(12)
  26089 	defer tls.Free(12)
  26090 
  26091 	var rc int32 = SQLITE_OK
  26092 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
  26093 	{
  26094 		switch op {
  26095 		case SQLITE_DBSTATUS_LOOKASIDE_USED:
  26096 			{
  26097 				*(*int32)(unsafe.Pointer(pCurrent)) = Xsqlite3LookasideUsed(tls, db, pHighwater)
  26098 				if resetFlag != 0 {
  26099 					var p uintptr = (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree
  26100 					if p != 0 {
  26101 						for (*LookasideSlot)(unsafe.Pointer(p)).FpNext != 0 {
  26102 							p = (*LookasideSlot)(unsafe.Pointer(p)).FpNext
  26103 						}
  26104 						(*LookasideSlot)(unsafe.Pointer(p)).FpNext = (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit
  26105 						(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit = (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree
  26106 						(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree = uintptr(0)
  26107 					}
  26108 					p = (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree
  26109 					if p != 0 {
  26110 						for (*LookasideSlot)(unsafe.Pointer(p)).FpNext != 0 {
  26111 							p = (*LookasideSlot)(unsafe.Pointer(p)).FpNext
  26112 						}
  26113 						(*LookasideSlot)(unsafe.Pointer(p)).FpNext = (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit
  26114 						(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit = (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree
  26115 						(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree = uintptr(0)
  26116 					}
  26117 				}
  26118 				break
  26119 
  26120 			}
  26121 
  26122 		case SQLITE_DBSTATUS_LOOKASIDE_HIT:
  26123 			fallthrough
  26124 		case SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE:
  26125 			fallthrough
  26126 		case SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL:
  26127 			{
  26128 				*(*int32)(unsafe.Pointer(pCurrent)) = 0
  26129 				*(*int32)(unsafe.Pointer(pHighwater)) = int32(*(*U32)(unsafe.Pointer(db + 440 + 16 + uintptr(op-SQLITE_DBSTATUS_LOOKASIDE_HIT)*4)))
  26130 				if resetFlag != 0 {
  26131 					*(*U32)(unsafe.Pointer(db + 440 + 16 + uintptr(op-SQLITE_DBSTATUS_LOOKASIDE_HIT)*4)) = U32(0)
  26132 				}
  26133 				break
  26134 
  26135 			}
  26136 
  26137 		case SQLITE_DBSTATUS_CACHE_USED_SHARED:
  26138 			fallthrough
  26139 		case SQLITE_DBSTATUS_CACHE_USED:
  26140 			{
  26141 				var totalUsed int32 = 0
  26142 				var i int32
  26143 				Xsqlite3BtreeEnterAll(tls, db)
  26144 				for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
  26145 					var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt
  26146 					if pBt != 0 {
  26147 						var pPager uintptr = Xsqlite3BtreePager(tls, pBt)
  26148 						var nByte int32 = Xsqlite3PagerMemUsed(tls, pPager)
  26149 						if op == SQLITE_DBSTATUS_CACHE_USED_SHARED {
  26150 							nByte = nByte / Xsqlite3BtreeConnectionCount(tls, pBt)
  26151 						}
  26152 						totalUsed = totalUsed + nByte
  26153 					}
  26154 				}
  26155 				Xsqlite3BtreeLeaveAll(tls, db)
  26156 				*(*int32)(unsafe.Pointer(pCurrent)) = totalUsed
  26157 				*(*int32)(unsafe.Pointer(pHighwater)) = 0
  26158 				break
  26159 
  26160 			}
  26161 
  26162 		case SQLITE_DBSTATUS_SCHEMA_USED:
  26163 			{
  26164 				var i int32
  26165 				*(*int32)(unsafe.Pointer(bp)) = 0
  26166 
  26167 				Xsqlite3BtreeEnterAll(tls, db)
  26168 				(*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed = bp
  26169 
  26170 				(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart
  26171 				for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
  26172 					var pSchema uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpSchema
  26173 					if pSchema != uintptr(0) {
  26174 						var p uintptr
  26175 
  26176 						*(*int32)(unsafe.Pointer(bp)) += int32(uint32((*struct{ f func(*libc.TLS, int32) int32 })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fm.FxRoundup})).f(tls, int32(unsafe.Sizeof(HashElem{})))) * ((*Schema)(unsafe.Pointer(pSchema)).FtblHash.Fcount +
  26177 							(*Schema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount +
  26178 							(*Schema)(unsafe.Pointer(pSchema)).FidxHash.Fcount +
  26179 							(*Schema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount))
  26180 						*(*int32)(unsafe.Pointer(bp)) += int32(Xsqlite3_msize(tls, (*Schema)(unsafe.Pointer(pSchema)).FtblHash.Fht))
  26181 						*(*int32)(unsafe.Pointer(bp)) += int32(Xsqlite3_msize(tls, (*Schema)(unsafe.Pointer(pSchema)).FtrigHash.Fht))
  26182 						*(*int32)(unsafe.Pointer(bp)) += int32(Xsqlite3_msize(tls, (*Schema)(unsafe.Pointer(pSchema)).FidxHash.Fht))
  26183 						*(*int32)(unsafe.Pointer(bp)) += int32(Xsqlite3_msize(tls, (*Schema)(unsafe.Pointer(pSchema)).FfkeyHash.Fht))
  26184 
  26185 						for p = (*Hash)(unsafe.Pointer(pSchema + 56)).Ffirst; p != 0; p = (*HashElem)(unsafe.Pointer(p)).Fnext {
  26186 							Xsqlite3DeleteTrigger(tls, db, (*HashElem)(unsafe.Pointer(p)).Fdata)
  26187 						}
  26188 						for p = (*Hash)(unsafe.Pointer(pSchema + 8)).Ffirst; p != 0; p = (*HashElem)(unsafe.Pointer(p)).Fnext {
  26189 							Xsqlite3DeleteTable(tls, db, (*HashElem)(unsafe.Pointer(p)).Fdata)
  26190 						}
  26191 					}
  26192 				}
  26193 				(*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed = uintptr(0)
  26194 				(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd
  26195 				Xsqlite3BtreeLeaveAll(tls, db)
  26196 
  26197 				*(*int32)(unsafe.Pointer(pHighwater)) = 0
  26198 				*(*int32)(unsafe.Pointer(pCurrent)) = *(*int32)(unsafe.Pointer(bp))
  26199 				break
  26200 
  26201 			}
  26202 
  26203 		case SQLITE_DBSTATUS_STMT_USED:
  26204 			{
  26205 				var pVdbe uintptr
  26206 				*(*int32)(unsafe.Pointer(bp + 4)) = 0
  26207 
  26208 				(*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed = bp + 4
  26209 
  26210 				(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart
  26211 				for pVdbe = (*Sqlite3)(unsafe.Pointer(db)).FpVdbe; pVdbe != 0; pVdbe = (*Vdbe1)(unsafe.Pointer(pVdbe)).FpVNext {
  26212 					Xsqlite3VdbeDelete(tls, pVdbe)
  26213 				}
  26214 				(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd
  26215 				(*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed = uintptr(0)
  26216 
  26217 				*(*int32)(unsafe.Pointer(pHighwater)) = 0
  26218 				*(*int32)(unsafe.Pointer(pCurrent)) = *(*int32)(unsafe.Pointer(bp + 4))
  26219 
  26220 				break
  26221 
  26222 			}
  26223 
  26224 		case SQLITE_DBSTATUS_CACHE_SPILL:
  26225 			op = SQLITE_DBSTATUS_CACHE_WRITE + 1
  26226 			fallthrough
  26227 		case SQLITE_DBSTATUS_CACHE_HIT:
  26228 			fallthrough
  26229 		case SQLITE_DBSTATUS_CACHE_MISS:
  26230 			fallthrough
  26231 		case SQLITE_DBSTATUS_CACHE_WRITE:
  26232 			{
  26233 				var i int32
  26234 				*(*int32)(unsafe.Pointer(bp + 8)) = 0
  26235 
  26236 				for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
  26237 					if (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FpBt != 0 {
  26238 						var pPager uintptr = Xsqlite3BtreePager(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FpBt)
  26239 						Xsqlite3PagerCacheStat(tls, pPager, op, resetFlag, bp+8)
  26240 					}
  26241 				}
  26242 				*(*int32)(unsafe.Pointer(pHighwater)) = 0
  26243 
  26244 				*(*int32)(unsafe.Pointer(pCurrent)) = *(*int32)(unsafe.Pointer(bp + 8))
  26245 				break
  26246 
  26247 			}
  26248 
  26249 		case SQLITE_DBSTATUS_DEFERRED_FKS:
  26250 			{
  26251 				*(*int32)(unsafe.Pointer(pHighwater)) = 0
  26252 				*(*int32)(unsafe.Pointer(pCurrent)) = libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons > int64(0) || (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons > int64(0))
  26253 				break
  26254 
  26255 			}
  26256 
  26257 		default:
  26258 			{
  26259 				rc = SQLITE_ERROR
  26260 
  26261 			}
  26262 		}
  26263 	}
  26264 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
  26265 	return rc
  26266 }
  26267 
  26268 type Clock_t = int32
  26269 
  26270 type tm = struct {
  26271 	Ftm_sec   int32
  26272 	Ftm_min   int32
  26273 	Ftm_hour  int32
  26274 	Ftm_mday  int32
  26275 	Ftm_mon   int32
  26276 	Ftm_year  int32
  26277 	Ftm_wday  int32
  26278 	Ftm_yday  int32
  26279 	Ftm_isdst int32
  26280 }
  26281 
  26282 func localtime(tls *libc.TLS, _Time uintptr) uintptr {
  26283 	return libc.X_localtime64(tls, _Time)
  26284 }
  26285 
  26286 var Xdaylight int32
  26287 var Xtimezone int32
  26288 var Xtzname [2]uintptr
  26289 
  26290 type timeval = struct {
  26291 	Ftv_sec  int32
  26292 	Ftv_usec int32
  26293 }
  26294 
  26295 type timezone = struct {
  26296 	Ftz_minuteswest int32
  26297 	Ftz_dsttime     int32
  26298 }
  26299 
  26300 type __timeb32 = struct {
  26301 	Ftime        X__time32_t
  26302 	Fmillitm     uint16
  26303 	Ftimezone    int16
  26304 	Fdstflag     int16
  26305 	F__ccgo_pad1 [2]byte
  26306 }
  26307 
  26308 type timeb = struct {
  26309 	Ftime        Time_t
  26310 	Fmillitm     uint16
  26311 	Ftimezone    int16
  26312 	Fdstflag     int16
  26313 	F__ccgo_pad1 [2]byte
  26314 }
  26315 
  26316 type __timeb64 = struct {
  26317 	Ftime        X__time64_t
  26318 	Fmillitm     uint16
  26319 	Ftimezone    int16
  26320 	Fdstflag     int16
  26321 	F__ccgo_pad1 [2]byte
  26322 }
  26323 
  26324 type timespec = struct {
  26325 	Ftv_sec      Time_t
  26326 	Ftv_nsec     int32
  26327 	F__ccgo_pad1 [4]byte
  26328 }
  26329 
  26330 type itimerspec = struct {
  26331 	Fit_interval struct {
  26332 		Ftv_sec      Time_t
  26333 		Ftv_nsec     int32
  26334 		F__ccgo_pad1 [4]byte
  26335 	}
  26336 	Fit_value struct {
  26337 		Ftv_sec      Time_t
  26338 		Ftv_nsec     int32
  26339 		F__ccgo_pad1 [4]byte
  26340 	}
  26341 }
  26342 
  26343 type Clockid_t = int32
  26344 
  26345 // A structure for holding a single date and time.
  26346 type DateTime1 = struct {
  26347 	FiJD         Sqlite3_int64
  26348 	FY           int32
  26349 	FM           int32
  26350 	FD           int32
  26351 	Fh           int32
  26352 	Fm           int32
  26353 	Ftz          int32
  26354 	Fs           float64
  26355 	FvalidJD     int8
  26356 	FrawS        int8
  26357 	FvalidYMD    int8
  26358 	FvalidHMS    int8
  26359 	FvalidTZ     int8
  26360 	FtzSet       int8
  26361 	FisError     int8
  26362 	F__ccgo_pad1 [1]byte
  26363 }
  26364 
  26365 // A structure for holding a single date and time.
  26366 type DateTime = DateTime1
  26367 
  26368 func getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) int32 {
  26369 	var ap Va_list
  26370 	_ = ap
  26371 	var cnt int32
  26372 	var nextC int8
  26373 	var N int8
  26374 	var min int8
  26375 	var val int32
  26376 	var max U16
  26377 	cnt = 0
  26378 	ap = va
  26379 __1:
  26380 	N = int8(int32(*(*int8)(unsafe.Pointer(zFormat))) - '0')
  26381 	min = int8(int32(*(*int8)(unsafe.Pointer(zFormat + 1))) - '0')
  26382 	val = 0
  26383 
  26384 	max = aMx[int32(*(*int8)(unsafe.Pointer(zFormat + 2)))-'a']
  26385 	nextC = *(*int8)(unsafe.Pointer(zFormat + 3))
  26386 	val = 0
  26387 __4:
  26388 	if !(libc.PostDecInt8(&N, 1) != 0) {
  26389 		goto __5
  26390 	}
  26391 	if !!(int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zDate)))])&0x04 != 0) {
  26392 		goto __6
  26393 	}
  26394 	goto end_getDigits
  26395 __6:
  26396 	;
  26397 	val = val*10 + int32(*(*int8)(unsafe.Pointer(zDate))) - '0'
  26398 	zDate++
  26399 	goto __4
  26400 __5:
  26401 	;
  26402 	if !(val < int32(min) || val > int32(max) || int32(nextC) != 0 && int32(nextC) != int32(*(*int8)(unsafe.Pointer(zDate)))) {
  26403 		goto __7
  26404 	}
  26405 	goto end_getDigits
  26406 __7:
  26407 	;
  26408 	*(*int32)(unsafe.Pointer(libc.VaUintptr(&ap))) = val
  26409 	zDate++
  26410 	cnt++
  26411 	zFormat += uintptr(4)
  26412 	goto __2
  26413 __2:
  26414 	if nextC != 0 {
  26415 		goto __1
  26416 	}
  26417 	goto __3
  26418 __3:
  26419 	;
  26420 end_getDigits:
  26421 	_ = ap
  26422 	return cnt
  26423 }
  26424 
  26425 var aMx = [6]U16{U16(12), U16(14), U16(24), U16(31), U16(59), U16(9999)}
  26426 
  26427 func parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) int32 {
  26428 	bp := tls.Alloc(24)
  26429 	defer tls.Free(24)
  26430 
  26431 	var sgn int32
  26432 
  26433 	var c int32
  26434 	sgn = 0
  26435 __1:
  26436 	if !(int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zDate)))])&0x01 != 0) {
  26437 		goto __2
  26438 	}
  26439 	zDate++
  26440 	goto __1
  26441 __2:
  26442 	;
  26443 	(*DateTime)(unsafe.Pointer(p)).Ftz = 0
  26444 	c = int32(*(*int8)(unsafe.Pointer(zDate)))
  26445 	if !(c == '-') {
  26446 		goto __3
  26447 	}
  26448 	sgn = -1
  26449 	goto __4
  26450 __3:
  26451 	if !(c == '+') {
  26452 		goto __5
  26453 	}
  26454 	sgn = +1
  26455 	goto __6
  26456 __5:
  26457 	if !(c == 'Z' || c == 'z') {
  26458 		goto __7
  26459 	}
  26460 	zDate++
  26461 	goto zulu_time
  26462 	goto __8
  26463 __7:
  26464 	return libc.Bool32(c != 0)
  26465 __8:
  26466 	;
  26467 __6:
  26468 	;
  26469 __4:
  26470 	;
  26471 	zDate++
  26472 	if !(getDigits(tls, zDate, ts+1127, libc.VaList(bp, bp+16, bp+20)) != 2) {
  26473 		goto __9
  26474 	}
  26475 	return 1
  26476 __9:
  26477 	;
  26478 	zDate += uintptr(5)
  26479 	(*DateTime)(unsafe.Pointer(p)).Ftz = sgn * (*(*int32)(unsafe.Pointer(bp + 20)) + *(*int32)(unsafe.Pointer(bp + 16))*60)
  26480 zulu_time:
  26481 __10:
  26482 	if !(int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zDate)))])&0x01 != 0) {
  26483 		goto __11
  26484 	}
  26485 	zDate++
  26486 	goto __10
  26487 __11:
  26488 	;
  26489 	(*DateTime)(unsafe.Pointer(p)).FtzSet = int8(1)
  26490 	return libc.Bool32(int32(*(*int8)(unsafe.Pointer(zDate))) != 0)
  26491 }
  26492 
  26493 func parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) int32 {
  26494 	bp := tls.Alloc(36)
  26495 	defer tls.Free(36)
  26496 
  26497 	var ms float64 = 0.0
  26498 	if getDigits(tls, zDate, ts+1135, libc.VaList(bp, bp+24, bp+28)) != 2 {
  26499 		return 1
  26500 	}
  26501 	zDate += uintptr(5)
  26502 	if int32(*(*int8)(unsafe.Pointer(zDate))) == ':' {
  26503 		zDate++
  26504 		if getDigits(tls, zDate, ts+1143, libc.VaList(bp+16, bp+32)) != 1 {
  26505 			return 1
  26506 		}
  26507 		zDate += uintptr(2)
  26508 		if int32(*(*int8)(unsafe.Pointer(zDate))) == '.' && int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zDate + 1)))])&0x04 != 0 {
  26509 			var rScale float64 = 1.0
  26510 			zDate++
  26511 			for int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zDate)))])&0x04 != 0 {
  26512 				ms = ms*10.0 + float64(*(*int8)(unsafe.Pointer(zDate))) - float64('0')
  26513 				rScale = rScale * 10.0
  26514 				zDate++
  26515 			}
  26516 			ms = ms / rScale
  26517 		}
  26518 	} else {
  26519 		*(*int32)(unsafe.Pointer(bp + 32)) = 0
  26520 	}
  26521 	(*DateTime)(unsafe.Pointer(p)).FvalidJD = int8(0)
  26522 	(*DateTime)(unsafe.Pointer(p)).FrawS = int8(0)
  26523 	(*DateTime)(unsafe.Pointer(p)).FvalidHMS = int8(1)
  26524 	(*DateTime)(unsafe.Pointer(p)).Fh = *(*int32)(unsafe.Pointer(bp + 24))
  26525 	(*DateTime)(unsafe.Pointer(p)).Fm = *(*int32)(unsafe.Pointer(bp + 28))
  26526 	(*DateTime)(unsafe.Pointer(p)).Fs = float64(*(*int32)(unsafe.Pointer(bp + 32))) + ms
  26527 	if parseTimezone(tls, zDate, p) != 0 {
  26528 		return 1
  26529 	}
  26530 	(*DateTime)(unsafe.Pointer(p)).FvalidTZ = func() int8 {
  26531 		if (*DateTime)(unsafe.Pointer(p)).Ftz != 0 {
  26532 			return int8(1)
  26533 		}
  26534 		return int8(0)
  26535 	}()
  26536 	return 0
  26537 }
  26538 
  26539 func datetimeError(tls *libc.TLS, p uintptr) {
  26540 	libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(DateTime{})))
  26541 	(*DateTime)(unsafe.Pointer(p)).FisError = int8(1)
  26542 }
  26543 
  26544 func computeJD(tls *libc.TLS, p uintptr) {
  26545 	var Y int32
  26546 	var M int32
  26547 	var D int32
  26548 	var A int32
  26549 	var B int32
  26550 	var X1 int32
  26551 	var X2 int32
  26552 
  26553 	if (*DateTime)(unsafe.Pointer(p)).FvalidJD != 0 {
  26554 		return
  26555 	}
  26556 	if (*DateTime)(unsafe.Pointer(p)).FvalidYMD != 0 {
  26557 		Y = (*DateTime)(unsafe.Pointer(p)).FY
  26558 		M = (*DateTime)(unsafe.Pointer(p)).FM
  26559 		D = (*DateTime)(unsafe.Pointer(p)).FD
  26560 	} else {
  26561 		Y = 2000
  26562 		M = 1
  26563 		D = 1
  26564 	}
  26565 	if Y < -4713 || Y > 9999 || (*DateTime)(unsafe.Pointer(p)).FrawS != 0 {
  26566 		datetimeError(tls, p)
  26567 		return
  26568 	}
  26569 	if M <= 2 {
  26570 		Y--
  26571 		M = M + 12
  26572 	}
  26573 	A = Y / 100
  26574 	B = 2 - A + A/4
  26575 	X1 = 36525 * (Y + 4716) / 100
  26576 	X2 = 306001 * (M + 1) / 10000
  26577 	(*DateTime)(unsafe.Pointer(p)).FiJD = libc.Int64FromFloat64((float64(X1+X2+D+B) - 1524.5) * float64(86400000))
  26578 	(*DateTime)(unsafe.Pointer(p)).FvalidJD = int8(1)
  26579 	if (*DateTime)(unsafe.Pointer(p)).FvalidHMS != 0 {
  26580 		*(*Sqlite3_int64)(unsafe.Pointer(p)) += Sqlite3_int64((*DateTime)(unsafe.Pointer(p)).Fh*3600000+(*DateTime)(unsafe.Pointer(p)).Fm*60000) + libc.Int64FromFloat64((*DateTime)(unsafe.Pointer(p)).Fs*float64(1000)+0.5)
  26581 		if (*DateTime)(unsafe.Pointer(p)).FvalidTZ != 0 {
  26582 			*(*Sqlite3_int64)(unsafe.Pointer(p)) -= Sqlite3_int64((*DateTime)(unsafe.Pointer(p)).Ftz * 60000)
  26583 			(*DateTime)(unsafe.Pointer(p)).FvalidYMD = int8(0)
  26584 			(*DateTime)(unsafe.Pointer(p)).FvalidHMS = int8(0)
  26585 			(*DateTime)(unsafe.Pointer(p)).FvalidTZ = int8(0)
  26586 		}
  26587 	}
  26588 }
  26589 
  26590 func parseYyyyMmDd(tls *libc.TLS, zDate uintptr, p uintptr) int32 {
  26591 	bp := tls.Alloc(36)
  26592 	defer tls.Free(36)
  26593 
  26594 	var neg int32
  26595 
  26596 	if int32(*(*int8)(unsafe.Pointer(zDate))) == '-' {
  26597 		zDate++
  26598 		neg = 1
  26599 	} else {
  26600 		neg = 0
  26601 	}
  26602 	if getDigits(tls, zDate, ts+1147, libc.VaList(bp, bp+24, bp+28, bp+32)) != 3 {
  26603 		return 1
  26604 	}
  26605 	zDate += uintptr(10)
  26606 	for int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zDate)))])&0x01 != 0 || 'T' == int32(*(*U8)(unsafe.Pointer(zDate))) {
  26607 		zDate++
  26608 	}
  26609 	if parseHhMmSs(tls, zDate, p) == 0 {
  26610 	} else if int32(*(*int8)(unsafe.Pointer(zDate))) == 0 {
  26611 		(*DateTime)(unsafe.Pointer(p)).FvalidHMS = int8(0)
  26612 	} else {
  26613 		return 1
  26614 	}
  26615 	(*DateTime)(unsafe.Pointer(p)).FvalidJD = int8(0)
  26616 	(*DateTime)(unsafe.Pointer(p)).FvalidYMD = int8(1)
  26617 	(*DateTime)(unsafe.Pointer(p)).FY = func() int32 {
  26618 		if neg != 0 {
  26619 			return -*(*int32)(unsafe.Pointer(bp + 24))
  26620 		}
  26621 		return *(*int32)(unsafe.Pointer(bp + 24))
  26622 	}()
  26623 	(*DateTime)(unsafe.Pointer(p)).FM = *(*int32)(unsafe.Pointer(bp + 28))
  26624 	(*DateTime)(unsafe.Pointer(p)).FD = *(*int32)(unsafe.Pointer(bp + 32))
  26625 	if (*DateTime)(unsafe.Pointer(p)).FvalidTZ != 0 {
  26626 		computeJD(tls, p)
  26627 	}
  26628 	return 0
  26629 }
  26630 
  26631 func setDateTimeToCurrent(tls *libc.TLS, context uintptr, p uintptr) int32 {
  26632 	(*DateTime)(unsafe.Pointer(p)).FiJD = Xsqlite3StmtCurrentTime(tls, context)
  26633 	if (*DateTime)(unsafe.Pointer(p)).FiJD > int64(0) {
  26634 		(*DateTime)(unsafe.Pointer(p)).FvalidJD = int8(1)
  26635 		return 0
  26636 	} else {
  26637 		return 1
  26638 	}
  26639 	return int32(0)
  26640 }
  26641 
  26642 func setRawDateNumber(tls *libc.TLS, p uintptr, r float64) {
  26643 	(*DateTime)(unsafe.Pointer(p)).Fs = r
  26644 	(*DateTime)(unsafe.Pointer(p)).FrawS = int8(1)
  26645 	if r >= 0.0 && r < 5373484.5 {
  26646 		(*DateTime)(unsafe.Pointer(p)).FiJD = libc.Int64FromFloat64(r*86400000.0 + 0.5)
  26647 		(*DateTime)(unsafe.Pointer(p)).FvalidJD = int8(1)
  26648 	}
  26649 }
  26650 
  26651 func parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) int32 {
  26652 	bp := tls.Alloc(8)
  26653 	defer tls.Free(8)
  26654 
  26655 	if parseYyyyMmDd(tls, zDate, p) == 0 {
  26656 		return 0
  26657 	} else if parseHhMmSs(tls, zDate, p) == 0 {
  26658 		return 0
  26659 	} else if Xsqlite3StrICmp(tls, zDate, ts+1159) == 0 && Xsqlite3NotPureFunc(tls, context) != 0 {
  26660 		return setDateTimeToCurrent(tls, context, p)
  26661 	} else if Xsqlite3AtoF(tls, zDate, bp, Xsqlite3Strlen30(tls, zDate), uint8(SQLITE_UTF8)) > 0 {
  26662 		setRawDateNumber(tls, p, *(*float64)(unsafe.Pointer(bp)))
  26663 		return 0
  26664 	}
  26665 	return 1
  26666 }
  26667 
  26668 func validJulianDay(tls *libc.TLS, iJD Sqlite3_int64) int32 {
  26669 	return libc.Bool32(iJD >= int64(0) && iJD <= int64(0x1a640)<<32|int64(0x1072fdff))
  26670 }
  26671 
  26672 func computeYMD(tls *libc.TLS, p uintptr) {
  26673 	var Z int32
  26674 	var A int32
  26675 	var B int32
  26676 	var C int32
  26677 	var D int32
  26678 	var E int32
  26679 	var X1 int32
  26680 	if (*DateTime)(unsafe.Pointer(p)).FvalidYMD != 0 {
  26681 		return
  26682 	}
  26683 	if !(int32((*DateTime)(unsafe.Pointer(p)).FvalidJD) != 0) {
  26684 		(*DateTime)(unsafe.Pointer(p)).FY = 2000
  26685 		(*DateTime)(unsafe.Pointer(p)).FM = 1
  26686 		(*DateTime)(unsafe.Pointer(p)).FD = 1
  26687 	} else if !(validJulianDay(tls, (*DateTime)(unsafe.Pointer(p)).FiJD) != 0) {
  26688 		datetimeError(tls, p)
  26689 		return
  26690 	} else {
  26691 		Z = int32(((*DateTime)(unsafe.Pointer(p)).FiJD + int64(43200000)) / int64(86400000))
  26692 		A = libc.Int32FromFloat64((float64(Z) - 1867216.25) / 36524.25)
  26693 		A = Z + 1 + A - A/4
  26694 		B = A + 1524
  26695 		C = libc.Int32FromFloat64((float64(B) - 122.1) / 365.25)
  26696 		D = 36525 * (C & 32767) / 100
  26697 		E = libc.Int32FromFloat64(float64(B-D) / 30.6001)
  26698 		X1 = libc.Int32FromFloat64(30.6001 * float64(E))
  26699 		(*DateTime)(unsafe.Pointer(p)).FD = B - D - X1
  26700 		(*DateTime)(unsafe.Pointer(p)).FM = func() int32 {
  26701 			if E < 14 {
  26702 				return E - 1
  26703 			}
  26704 			return E - 13
  26705 		}()
  26706 		(*DateTime)(unsafe.Pointer(p)).FY = func() int32 {
  26707 			if (*DateTime)(unsafe.Pointer(p)).FM > 2 {
  26708 				return C - 4716
  26709 			}
  26710 			return C - 4715
  26711 		}()
  26712 	}
  26713 	(*DateTime)(unsafe.Pointer(p)).FvalidYMD = int8(1)
  26714 }
  26715 
  26716 func computeHMS(tls *libc.TLS, p uintptr) {
  26717 	var s int32
  26718 	if (*DateTime)(unsafe.Pointer(p)).FvalidHMS != 0 {
  26719 		return
  26720 	}
  26721 	computeJD(tls, p)
  26722 	s = int32(((*DateTime)(unsafe.Pointer(p)).FiJD + int64(43200000)) % int64(86400000))
  26723 	(*DateTime)(unsafe.Pointer(p)).Fs = float64(s) / 1000.0
  26724 	s = libc.Int32FromFloat64((*DateTime)(unsafe.Pointer(p)).Fs)
  26725 	*(*float64)(unsafe.Pointer(p + 32)) -= float64(s)
  26726 	(*DateTime)(unsafe.Pointer(p)).Fh = s / 3600
  26727 	s = s - (*DateTime)(unsafe.Pointer(p)).Fh*3600
  26728 	(*DateTime)(unsafe.Pointer(p)).Fm = s / 60
  26729 	*(*float64)(unsafe.Pointer(p + 32)) += float64(s - (*DateTime)(unsafe.Pointer(p)).Fm*60)
  26730 	(*DateTime)(unsafe.Pointer(p)).FrawS = int8(0)
  26731 	(*DateTime)(unsafe.Pointer(p)).FvalidHMS = int8(1)
  26732 }
  26733 
  26734 func computeYMD_HMS(tls *libc.TLS, p uintptr) {
  26735 	computeYMD(tls, p)
  26736 	computeHMS(tls, p)
  26737 }
  26738 
  26739 func clearYMD_HMS_TZ(tls *libc.TLS, p uintptr) {
  26740 	(*DateTime)(unsafe.Pointer(p)).FvalidYMD = int8(0)
  26741 	(*DateTime)(unsafe.Pointer(p)).FvalidHMS = int8(0)
  26742 	(*DateTime)(unsafe.Pointer(p)).FvalidTZ = int8(0)
  26743 }
  26744 
  26745 func osLocaltime(tls *libc.TLS, t uintptr, pTm uintptr) int32 {
  26746 	var rc int32
  26747 	var pX uintptr
  26748 	var mutex uintptr = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN)
  26749 	Xsqlite3_mutex_enter(tls, mutex)
  26750 	pX = localtime(tls, t)
  26751 	if Xsqlite3Config.FbLocaltimeFault != 0 {
  26752 		if Xsqlite3Config.FxAltLocaltime != uintptr(0) &&
  26753 			0 == (*struct {
  26754 				f func(*libc.TLS, uintptr, uintptr) int32
  26755 			})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.FxAltLocaltime})).f(tls, t, pTm) {
  26756 			pX = pTm
  26757 		} else {
  26758 			pX = uintptr(0)
  26759 		}
  26760 	}
  26761 	if pX != 0 {
  26762 		*(*tm)(unsafe.Pointer(pTm)) = *(*tm)(unsafe.Pointer(pX))
  26763 	}
  26764 	Xsqlite3_mutex_leave(tls, mutex)
  26765 	rc = libc.Bool32(pX == uintptr(0))
  26766 	return rc
  26767 }
  26768 
  26769 func toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) int32 {
  26770 	bp := tls.Alloc(96)
  26771 	defer tls.Free(96)
  26772 
  26773 	var iYearDiff int32
  26774 
  26775 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(tm{})))
  26776 
  26777 	computeJD(tls, p)
  26778 	if (*DateTime)(unsafe.Pointer(p)).FiJD < int64(2108667600)*int64(100000) ||
  26779 		(*DateTime)(unsafe.Pointer(p)).FiJD > int64(2130141456)*int64(100000) {
  26780 		*(*DateTime)(unsafe.Pointer(bp + 40)) = *(*DateTime)(unsafe.Pointer(p))
  26781 		computeYMD_HMS(tls, bp+40)
  26782 		iYearDiff = 2000 + (*DateTime)(unsafe.Pointer(bp+40)).FY%4 - (*DateTime)(unsafe.Pointer(bp+40)).FY
  26783 		*(*int32)(unsafe.Pointer(bp + 40 + 8)) += iYearDiff
  26784 		(*DateTime)(unsafe.Pointer(bp + 40)).FvalidJD = int8(0)
  26785 		computeJD(tls, bp+40)
  26786 		*(*Time_t)(unsafe.Pointer(bp + 88)) = (*DateTime)(unsafe.Pointer(bp+40)).FiJD/int64(1000) - int64(21086676)*int64(10000)
  26787 	} else {
  26788 		iYearDiff = 0
  26789 		*(*Time_t)(unsafe.Pointer(bp + 88)) = (*DateTime)(unsafe.Pointer(p)).FiJD/int64(1000) - int64(21086676)*int64(10000)
  26790 	}
  26791 	if osLocaltime(tls, bp+88, bp) != 0 {
  26792 		Xsqlite3_result_error(tls, pCtx, ts+1163, -1)
  26793 		return SQLITE_ERROR
  26794 	}
  26795 	(*DateTime)(unsafe.Pointer(p)).FY = (*tm)(unsafe.Pointer(bp)).Ftm_year + 1900 - iYearDiff
  26796 	(*DateTime)(unsafe.Pointer(p)).FM = (*tm)(unsafe.Pointer(bp)).Ftm_mon + 1
  26797 	(*DateTime)(unsafe.Pointer(p)).FD = (*tm)(unsafe.Pointer(bp)).Ftm_mday
  26798 	(*DateTime)(unsafe.Pointer(p)).Fh = (*tm)(unsafe.Pointer(bp)).Ftm_hour
  26799 	(*DateTime)(unsafe.Pointer(p)).Fm = (*tm)(unsafe.Pointer(bp)).Ftm_min
  26800 	(*DateTime)(unsafe.Pointer(p)).Fs = float64((*tm)(unsafe.Pointer(bp)).Ftm_sec) + float64((*DateTime)(unsafe.Pointer(p)).FiJD%int64(1000))*0.001
  26801 	(*DateTime)(unsafe.Pointer(p)).FvalidYMD = int8(1)
  26802 	(*DateTime)(unsafe.Pointer(p)).FvalidHMS = int8(1)
  26803 	(*DateTime)(unsafe.Pointer(p)).FvalidJD = int8(0)
  26804 	(*DateTime)(unsafe.Pointer(p)).FrawS = int8(0)
  26805 	(*DateTime)(unsafe.Pointer(p)).FvalidTZ = int8(0)
  26806 	(*DateTime)(unsafe.Pointer(p)).FisError = int8(0)
  26807 	return SQLITE_OK
  26808 }
  26809 
  26810 var aXformType = [6]struct {
  26811 	FnName  U8
  26812 	FzName  [7]int8
  26813 	FrLimit float32
  26814 	FrXform float32
  26815 }{
  26816 	{FnName: U8(6), FzName: *(*[7]int8)(unsafe.Pointer(ts + 1186)), FrLimit: 4.6427e+14, FrXform: 1.0},
  26817 	{FnName: U8(6), FzName: *(*[7]int8)(unsafe.Pointer(ts + 1193)), FrLimit: 7.7379e+12, FrXform: 60.0},
  26818 	{FnName: U8(4), FzName: *(*[7]int8)(unsafe.Pointer(ts + 1200)), FrLimit: 1.2897e+11, FrXform: 3600.0},
  26819 	{FnName: U8(3), FzName: *(*[7]int8)(unsafe.Pointer(ts + 1207)), FrLimit: 5373485.0, FrXform: 86400.0},
  26820 	{FnName: U8(5), FzName: *(*[7]int8)(unsafe.Pointer(ts + 1214)), FrLimit: 176546.0, FrXform: 2592000.0},
  26821 	{FnName: U8(4), FzName: *(*[7]int8)(unsafe.Pointer(ts + 1221)), FrLimit: 14713.0, FrXform: 31536000.0},
  26822 }
  26823 
  26824 func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, idx int32) int32 {
  26825 	bp := tls.Alloc(104)
  26826 	defer tls.Free(104)
  26827 
  26828 	var rc int32 = 1
  26829 
  26830 	switch int32(Xsqlite3UpperToLower[U8(*(*int8)(unsafe.Pointer(z)))]) {
  26831 	case 'a':
  26832 		{
  26833 			if Xsqlite3_stricmp(tls, z, ts+1228) == 0 {
  26834 				if idx > 1 {
  26835 					return 1
  26836 				}
  26837 				if !(int32((*DateTime)(unsafe.Pointer(p)).FrawS) != 0) || (*DateTime)(unsafe.Pointer(p)).FvalidJD != 0 {
  26838 					rc = 0
  26839 					(*DateTime)(unsafe.Pointer(p)).FrawS = int8(0)
  26840 				} else if (*DateTime)(unsafe.Pointer(p)).Fs >= float64(int64(-21086676)*int64(10000)) &&
  26841 					(*DateTime)(unsafe.Pointer(p)).Fs <= float64(int64(25340230)*int64(10000)+int64(799)) {
  26842 					*(*float64)(unsafe.Pointer(bp + 48)) = (*DateTime)(unsafe.Pointer(p)).Fs*1000.0 + 210866760000000.0
  26843 					clearYMD_HMS_TZ(tls, p)
  26844 					(*DateTime)(unsafe.Pointer(p)).FiJD = libc.Int64FromFloat64(*(*float64)(unsafe.Pointer(bp + 48)) + 0.5)
  26845 					(*DateTime)(unsafe.Pointer(p)).FvalidJD = int8(1)
  26846 					(*DateTime)(unsafe.Pointer(p)).FrawS = int8(0)
  26847 					rc = 0
  26848 				}
  26849 			}
  26850 			break
  26851 
  26852 		}
  26853 	case 'j':
  26854 		{
  26855 			if Xsqlite3_stricmp(tls, z, ts+1233) == 0 {
  26856 				if idx > 1 {
  26857 					return 1
  26858 				}
  26859 				if (*DateTime)(unsafe.Pointer(p)).FvalidJD != 0 && (*DateTime)(unsafe.Pointer(p)).FrawS != 0 {
  26860 					rc = 0
  26861 					(*DateTime)(unsafe.Pointer(p)).FrawS = int8(0)
  26862 				}
  26863 			}
  26864 			break
  26865 
  26866 		}
  26867 	case 'l':
  26868 		{
  26869 			if Xsqlite3_stricmp(tls, z, ts+1243) == 0 && Xsqlite3NotPureFunc(tls, pCtx) != 0 {
  26870 				rc = toLocaltime(tls, p, pCtx)
  26871 			}
  26872 			break
  26873 
  26874 		}
  26875 	case 'u':
  26876 		{
  26877 			if Xsqlite3_stricmp(tls, z, ts+1253) == 0 && (*DateTime)(unsafe.Pointer(p)).FrawS != 0 {
  26878 				if idx > 1 {
  26879 					return 1
  26880 				}
  26881 				*(*float64)(unsafe.Pointer(bp + 48)) = (*DateTime)(unsafe.Pointer(p)).Fs*1000.0 + 210866760000000.0
  26882 				if *(*float64)(unsafe.Pointer(bp + 48)) >= 0.0 && *(*float64)(unsafe.Pointer(bp + 48)) < 464269060800000.0 {
  26883 					clearYMD_HMS_TZ(tls, p)
  26884 					(*DateTime)(unsafe.Pointer(p)).FiJD = libc.Int64FromFloat64(*(*float64)(unsafe.Pointer(bp + 48)) + 0.5)
  26885 					(*DateTime)(unsafe.Pointer(p)).FvalidJD = int8(1)
  26886 					(*DateTime)(unsafe.Pointer(p)).FrawS = int8(0)
  26887 					rc = 0
  26888 				}
  26889 			} else if Xsqlite3_stricmp(tls, z, ts+1263) == 0 && Xsqlite3NotPureFunc(tls, pCtx) != 0 {
  26890 				if int32((*DateTime)(unsafe.Pointer(p)).FtzSet) == 0 {
  26891 					var iOrigJD I64
  26892 					var iGuess I64
  26893 					var cnt int32 = 0
  26894 					var iErr I64
  26895 
  26896 					computeJD(tls, p)
  26897 					iGuess = libc.AssignInt64(&iOrigJD, (*DateTime)(unsafe.Pointer(p)).FiJD)
  26898 					iErr = int64(0)
  26899 					for __ccgo := true; __ccgo; __ccgo = iErr != 0 && libc.PostIncInt32(&cnt, 1) < 3 {
  26900 						libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(DateTime{})))
  26901 						iGuess = iGuess - iErr
  26902 						(*DateTime)(unsafe.Pointer(bp)).FiJD = iGuess
  26903 						(*DateTime)(unsafe.Pointer(bp)).FvalidJD = int8(1)
  26904 						rc = toLocaltime(tls, bp, pCtx)
  26905 						if rc != 0 {
  26906 							return rc
  26907 						}
  26908 						computeJD(tls, bp)
  26909 						iErr = (*DateTime)(unsafe.Pointer(bp)).FiJD - iOrigJD
  26910 					}
  26911 					libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(DateTime{})))
  26912 					(*DateTime)(unsafe.Pointer(p)).FiJD = iGuess
  26913 					(*DateTime)(unsafe.Pointer(p)).FvalidJD = int8(1)
  26914 					(*DateTime)(unsafe.Pointer(p)).FtzSet = int8(1)
  26915 				}
  26916 				rc = SQLITE_OK
  26917 			}
  26918 			break
  26919 
  26920 		}
  26921 	case 'w':
  26922 		{
  26923 			if Xsqlite3_strnicmp(tls, z, ts+1267, 8) == 0 &&
  26924 				Xsqlite3AtoF(tls, z+8, bp+48, Xsqlite3Strlen30(tls, z+8), uint8(SQLITE_UTF8)) > 0 &&
  26925 				*(*float64)(unsafe.Pointer(bp + 48)) >= 0.0 && *(*float64)(unsafe.Pointer(bp + 48)) < 7.0 && float64(libc.AssignInt32(&n, int32(*(*float64)(unsafe.Pointer(bp + 48))))) == *(*float64)(unsafe.Pointer(bp + 48)) {
  26926 				var Z Sqlite3_int64
  26927 				computeYMD_HMS(tls, p)
  26928 				(*DateTime)(unsafe.Pointer(p)).FvalidTZ = int8(0)
  26929 				(*DateTime)(unsafe.Pointer(p)).FvalidJD = int8(0)
  26930 				computeJD(tls, p)
  26931 				Z = ((*DateTime)(unsafe.Pointer(p)).FiJD + int64(129600000)) / int64(86400000) % int64(7)
  26932 				if Z > Sqlite3_int64(n) {
  26933 					Z = Z - int64(7)
  26934 				}
  26935 				*(*Sqlite3_int64)(unsafe.Pointer(p)) += (Sqlite3_int64(n) - Z) * int64(86400000)
  26936 				clearYMD_HMS_TZ(tls, p)
  26937 				rc = 0
  26938 			}
  26939 			break
  26940 
  26941 		}
  26942 	case 's':
  26943 		{
  26944 			if Xsqlite3_strnicmp(tls, z, ts+1276, 9) != 0 {
  26945 				break
  26946 			}
  26947 			if !(int32((*DateTime)(unsafe.Pointer(p)).FvalidJD) != 0) && !(int32((*DateTime)(unsafe.Pointer(p)).FvalidYMD) != 0) && !(int32((*DateTime)(unsafe.Pointer(p)).FvalidHMS) != 0) {
  26948 				break
  26949 			}
  26950 			z += uintptr(9)
  26951 			computeYMD(tls, p)
  26952 			(*DateTime)(unsafe.Pointer(p)).FvalidHMS = int8(1)
  26953 			(*DateTime)(unsafe.Pointer(p)).Fh = libc.AssignPtrInt32(p+24, 0)
  26954 			(*DateTime)(unsafe.Pointer(p)).Fs = 0.0
  26955 			(*DateTime)(unsafe.Pointer(p)).FrawS = int8(0)
  26956 			(*DateTime)(unsafe.Pointer(p)).FvalidTZ = int8(0)
  26957 			(*DateTime)(unsafe.Pointer(p)).FvalidJD = int8(0)
  26958 			if Xsqlite3_stricmp(tls, z, ts+1286) == 0 {
  26959 				(*DateTime)(unsafe.Pointer(p)).FD = 1
  26960 				rc = 0
  26961 			} else if Xsqlite3_stricmp(tls, z, ts+1292) == 0 {
  26962 				(*DateTime)(unsafe.Pointer(p)).FM = 1
  26963 				(*DateTime)(unsafe.Pointer(p)).FD = 1
  26964 				rc = 0
  26965 			} else if Xsqlite3_stricmp(tls, z, ts+1297) == 0 {
  26966 				rc = 0
  26967 			}
  26968 			break
  26969 
  26970 		}
  26971 	case '+':
  26972 		fallthrough
  26973 	case '-':
  26974 		fallthrough
  26975 	case '0':
  26976 		fallthrough
  26977 	case '1':
  26978 		fallthrough
  26979 	case '2':
  26980 		fallthrough
  26981 	case '3':
  26982 		fallthrough
  26983 	case '4':
  26984 		fallthrough
  26985 	case '5':
  26986 		fallthrough
  26987 	case '6':
  26988 		fallthrough
  26989 	case '7':
  26990 		fallthrough
  26991 	case '8':
  26992 		fallthrough
  26993 	case '9':
  26994 		{
  26995 			var rRounder float64
  26996 			var i int32
  26997 			for n = 1; *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 && int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) != ':' && !(int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(n))))])&0x01 != 0); n++ {
  26998 			}
  26999 			if Xsqlite3AtoF(tls, z, bp+48, n, uint8(SQLITE_UTF8)) <= 0 {
  27000 				rc = 1
  27001 				break
  27002 			}
  27003 			if int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == ':' {
  27004 				var z2 uintptr = z
  27005 
  27006 				var day Sqlite3_int64
  27007 				if !(int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z2)))])&0x04 != 0) {
  27008 					z2++
  27009 				}
  27010 				libc.Xmemset(tls, bp+56, 0, uint64(unsafe.Sizeof(DateTime{})))
  27011 				if parseHhMmSs(tls, z2, bp+56) != 0 {
  27012 					break
  27013 				}
  27014 				computeJD(tls, bp+56)
  27015 				*(*Sqlite3_int64)(unsafe.Pointer(bp + 56)) -= int64(43200000)
  27016 				day = (*DateTime)(unsafe.Pointer(bp+56)).FiJD / int64(86400000)
  27017 				*(*Sqlite3_int64)(unsafe.Pointer(bp + 56)) -= day * int64(86400000)
  27018 				if int32(*(*int8)(unsafe.Pointer(z))) == '-' {
  27019 					(*DateTime)(unsafe.Pointer(bp + 56)).FiJD = -(*DateTime)(unsafe.Pointer(bp + 56)).FiJD
  27020 				}
  27021 				computeJD(tls, p)
  27022 				clearYMD_HMS_TZ(tls, p)
  27023 				*(*Sqlite3_int64)(unsafe.Pointer(p)) += (*DateTime)(unsafe.Pointer(bp + 56)).FiJD
  27024 				rc = 0
  27025 				break
  27026 			}
  27027 
  27028 			z += uintptr(n)
  27029 			for int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&0x01 != 0 {
  27030 				z++
  27031 			}
  27032 			n = Xsqlite3Strlen30(tls, z)
  27033 			if n > 10 || n < 3 {
  27034 				break
  27035 			}
  27036 			if int32(Xsqlite3UpperToLower[U8(*(*int8)(unsafe.Pointer(z + uintptr(n-1))))]) == 's' {
  27037 				n--
  27038 			}
  27039 			computeJD(tls, p)
  27040 			rc = 1
  27041 			if *(*float64)(unsafe.Pointer(bp + 48)) < float64(0) {
  27042 				rRounder = -0.5
  27043 			} else {
  27044 				rRounder = +0.5
  27045 			}
  27046 			for i = 0; i < int32(uint64(unsafe.Sizeof(aXformType))/uint64(unsafe.Sizeof(struct {
  27047 				FnName  U8
  27048 				FzName  [7]int8
  27049 				FrLimit float32
  27050 				FrXform float32
  27051 			}{}))); i++ {
  27052 				if int32(aXformType[i].FnName) == n &&
  27053 					Xsqlite3_strnicmp(tls, uintptr(unsafe.Pointer(&aXformType))+uintptr(i)*16+1, z, n) == 0 &&
  27054 					*(*float64)(unsafe.Pointer(bp + 48)) > float64(-aXformType[i].FrLimit) && *(*float64)(unsafe.Pointer(bp + 48)) < float64(aXformType[i].FrLimit) {
  27055 					switch i {
  27056 					case 4:
  27057 						{
  27058 							var x int32
  27059 
  27060 							computeYMD_HMS(tls, p)
  27061 							*(*int32)(unsafe.Pointer(p + 12)) += int32(*(*float64)(unsafe.Pointer(bp + 48)))
  27062 							if (*DateTime)(unsafe.Pointer(p)).FM > 0 {
  27063 								x = ((*DateTime)(unsafe.Pointer(p)).FM - 1) / 12
  27064 							} else {
  27065 								x = ((*DateTime)(unsafe.Pointer(p)).FM - 12) / 12
  27066 							}
  27067 							*(*int32)(unsafe.Pointer(p + 8)) += x
  27068 							*(*int32)(unsafe.Pointer(p + 12)) -= x * 12
  27069 							(*DateTime)(unsafe.Pointer(p)).FvalidJD = int8(0)
  27070 							*(*float64)(unsafe.Pointer(bp + 48)) -= float64(int32(*(*float64)(unsafe.Pointer(bp + 48))))
  27071 							break
  27072 
  27073 						}
  27074 						fallthrough
  27075 					case 5:
  27076 						{
  27077 							var y int32 = int32(*(*float64)(unsafe.Pointer(bp + 48)))
  27078 
  27079 							computeYMD_HMS(tls, p)
  27080 							*(*int32)(unsafe.Pointer(p + 8)) += y
  27081 							(*DateTime)(unsafe.Pointer(p)).FvalidJD = int8(0)
  27082 							*(*float64)(unsafe.Pointer(bp + 48)) -= float64(int32(*(*float64)(unsafe.Pointer(bp + 48))))
  27083 							break
  27084 
  27085 						}
  27086 					}
  27087 					computeJD(tls, p)
  27088 					*(*Sqlite3_int64)(unsafe.Pointer(p)) += libc.Int64FromFloat64(*(*float64)(unsafe.Pointer(bp + 48))*1000.0*float64(aXformType[i].FrXform) + rRounder)
  27089 					rc = 0
  27090 					break
  27091 				}
  27092 			}
  27093 			clearYMD_HMS_TZ(tls, p)
  27094 			break
  27095 
  27096 		}
  27097 	default:
  27098 		{
  27099 			break
  27100 
  27101 		}
  27102 	}
  27103 	return rc
  27104 }
  27105 
  27106 func isDate(tls *libc.TLS, context uintptr, argc int32, argv uintptr, p uintptr) int32 {
  27107 	var i int32
  27108 	var n int32
  27109 	var z uintptr
  27110 	var eType int32
  27111 	libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(DateTime{})))
  27112 	if argc == 0 {
  27113 		if !(Xsqlite3NotPureFunc(tls, context) != 0) {
  27114 			return 1
  27115 		}
  27116 		return setDateTimeToCurrent(tls, context, p)
  27117 	}
  27118 	if libc.AssignInt32(&eType, Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv)))) == SQLITE_FLOAT ||
  27119 		eType == SQLITE_INTEGER {
  27120 		setRawDateNumber(tls, p, Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv))))
  27121 	} else {
  27122 		z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
  27123 		if !(z != 0) || parseDateOrTime(tls, context, z, p) != 0 {
  27124 			return 1
  27125 		}
  27126 	}
  27127 	for i = 1; i < argc; i++ {
  27128 		z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
  27129 		n = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
  27130 		if z == uintptr(0) || parseModifier(tls, context, z, n, p, i) != 0 {
  27131 			return 1
  27132 		}
  27133 	}
  27134 	computeJD(tls, p)
  27135 	if (*DateTime)(unsafe.Pointer(p)).FisError != 0 || !(validJulianDay(tls, (*DateTime)(unsafe.Pointer(p)).FiJD) != 0) {
  27136 		return 1
  27137 	}
  27138 	return 0
  27139 }
  27140 
  27141 func juliandayFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
  27142 	bp := tls.Alloc(48)
  27143 	defer tls.Free(48)
  27144 
  27145 	if isDate(tls, context, argc, argv, bp) == 0 {
  27146 		computeJD(tls, bp)
  27147 		Xsqlite3_result_double(tls, context, float64((*DateTime)(unsafe.Pointer(bp)).FiJD)/86400000.0)
  27148 	}
  27149 }
  27150 
  27151 func unixepochFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
  27152 	bp := tls.Alloc(48)
  27153 	defer tls.Free(48)
  27154 
  27155 	if isDate(tls, context, argc, argv, bp) == 0 {
  27156 		computeJD(tls, bp)
  27157 		Xsqlite3_result_int64(tls, context, (*DateTime)(unsafe.Pointer(bp)).FiJD/int64(1000)-int64(21086676)*int64(10000))
  27158 	}
  27159 }
  27160 
  27161 func datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
  27162 	bp := tls.Alloc(72)
  27163 	defer tls.Free(72)
  27164 
  27165 	if isDate(tls, context, argc, argv, bp) == 0 {
  27166 		var Y int32
  27167 		var s int32
  27168 
  27169 		computeYMD_HMS(tls, bp)
  27170 		Y = (*DateTime)(unsafe.Pointer(bp)).FY
  27171 		if Y < 0 {
  27172 			Y = -Y
  27173 		}
  27174 		*(*int8)(unsafe.Pointer(bp + 48 + 1)) = int8('0' + Y/1000%10)
  27175 		*(*int8)(unsafe.Pointer(bp + 48 + 2)) = int8('0' + Y/100%10)
  27176 		*(*int8)(unsafe.Pointer(bp + 48 + 3)) = int8('0' + Y/10%10)
  27177 		*(*int8)(unsafe.Pointer(bp + 48 + 4)) = int8('0' + Y%10)
  27178 		*(*int8)(unsafe.Pointer(bp + 48 + 5)) = int8('-')
  27179 		*(*int8)(unsafe.Pointer(bp + 48 + 6)) = int8('0' + (*DateTime)(unsafe.Pointer(bp)).FM/10%10)
  27180 		*(*int8)(unsafe.Pointer(bp + 48 + 7)) = int8('0' + (*DateTime)(unsafe.Pointer(bp)).FM%10)
  27181 		*(*int8)(unsafe.Pointer(bp + 48 + 8)) = int8('-')
  27182 		*(*int8)(unsafe.Pointer(bp + 48 + 9)) = int8('0' + (*DateTime)(unsafe.Pointer(bp)).FD/10%10)
  27183 		*(*int8)(unsafe.Pointer(bp + 48 + 10)) = int8('0' + (*DateTime)(unsafe.Pointer(bp)).FD%10)
  27184 		*(*int8)(unsafe.Pointer(bp + 48 + 11)) = int8(' ')
  27185 		*(*int8)(unsafe.Pointer(bp + 48 + 12)) = int8('0' + (*DateTime)(unsafe.Pointer(bp)).Fh/10%10)
  27186 		*(*int8)(unsafe.Pointer(bp + 48 + 13)) = int8('0' + (*DateTime)(unsafe.Pointer(bp)).Fh%10)
  27187 		*(*int8)(unsafe.Pointer(bp + 48 + 14)) = int8(':')
  27188 		*(*int8)(unsafe.Pointer(bp + 48 + 15)) = int8('0' + (*DateTime)(unsafe.Pointer(bp)).Fm/10%10)
  27189 		*(*int8)(unsafe.Pointer(bp + 48 + 16)) = int8('0' + (*DateTime)(unsafe.Pointer(bp)).Fm%10)
  27190 		*(*int8)(unsafe.Pointer(bp + 48 + 17)) = int8(':')
  27191 		s = libc.Int32FromFloat64((*DateTime)(unsafe.Pointer(bp)).Fs)
  27192 		*(*int8)(unsafe.Pointer(bp + 48 + 18)) = int8('0' + s/10%10)
  27193 		*(*int8)(unsafe.Pointer(bp + 48 + 19)) = int8('0' + s%10)
  27194 		*(*int8)(unsafe.Pointer(bp + 48 + 20)) = int8(0)
  27195 		if (*DateTime)(unsafe.Pointer(bp)).FY < 0 {
  27196 			*(*int8)(unsafe.Pointer(bp + 48)) = int8('-')
  27197 			Xsqlite3_result_text(tls, context, bp+48, 20, libc.UintptrFromInt32(-1))
  27198 		} else {
  27199 			Xsqlite3_result_text(tls, context, bp+48+1, 19, libc.UintptrFromInt32(-1))
  27200 		}
  27201 	}
  27202 }
  27203 
  27204 func timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
  27205 	bp := tls.Alloc(64)
  27206 	defer tls.Free(64)
  27207 
  27208 	if isDate(tls, context, argc, argv, bp) == 0 {
  27209 		var s int32
  27210 
  27211 		computeHMS(tls, bp)
  27212 		*(*int8)(unsafe.Pointer(bp + 48)) = int8('0' + (*DateTime)(unsafe.Pointer(bp)).Fh/10%10)
  27213 		*(*int8)(unsafe.Pointer(bp + 48 + 1)) = int8('0' + (*DateTime)(unsafe.Pointer(bp)).Fh%10)
  27214 		*(*int8)(unsafe.Pointer(bp + 48 + 2)) = int8(':')
  27215 		*(*int8)(unsafe.Pointer(bp + 48 + 3)) = int8('0' + (*DateTime)(unsafe.Pointer(bp)).Fm/10%10)
  27216 		*(*int8)(unsafe.Pointer(bp + 48 + 4)) = int8('0' + (*DateTime)(unsafe.Pointer(bp)).Fm%10)
  27217 		*(*int8)(unsafe.Pointer(bp + 48 + 5)) = int8(':')
  27218 		s = libc.Int32FromFloat64((*DateTime)(unsafe.Pointer(bp)).Fs)
  27219 		*(*int8)(unsafe.Pointer(bp + 48 + 6)) = int8('0' + s/10%10)
  27220 		*(*int8)(unsafe.Pointer(bp + 48 + 7)) = int8('0' + s%10)
  27221 		*(*int8)(unsafe.Pointer(bp + 48 + 8)) = int8(0)
  27222 		Xsqlite3_result_text(tls, context, bp+48, 8, libc.UintptrFromInt32(-1))
  27223 	}
  27224 }
  27225 
  27226 func dateFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
  27227 	bp := tls.Alloc(64)
  27228 	defer tls.Free(64)
  27229 
  27230 	if isDate(tls, context, argc, argv, bp) == 0 {
  27231 		var Y int32
  27232 
  27233 		computeYMD(tls, bp)
  27234 		Y = (*DateTime)(unsafe.Pointer(bp)).FY
  27235 		if Y < 0 {
  27236 			Y = -Y
  27237 		}
  27238 		*(*int8)(unsafe.Pointer(bp + 48 + 1)) = int8('0' + Y/1000%10)
  27239 		*(*int8)(unsafe.Pointer(bp + 48 + 2)) = int8('0' + Y/100%10)
  27240 		*(*int8)(unsafe.Pointer(bp + 48 + 3)) = int8('0' + Y/10%10)
  27241 		*(*int8)(unsafe.Pointer(bp + 48 + 4)) = int8('0' + Y%10)
  27242 		*(*int8)(unsafe.Pointer(bp + 48 + 5)) = int8('-')
  27243 		*(*int8)(unsafe.Pointer(bp + 48 + 6)) = int8('0' + (*DateTime)(unsafe.Pointer(bp)).FM/10%10)
  27244 		*(*int8)(unsafe.Pointer(bp + 48 + 7)) = int8('0' + (*DateTime)(unsafe.Pointer(bp)).FM%10)
  27245 		*(*int8)(unsafe.Pointer(bp + 48 + 8)) = int8('-')
  27246 		*(*int8)(unsafe.Pointer(bp + 48 + 9)) = int8('0' + (*DateTime)(unsafe.Pointer(bp)).FD/10%10)
  27247 		*(*int8)(unsafe.Pointer(bp + 48 + 10)) = int8('0' + (*DateTime)(unsafe.Pointer(bp)).FD%10)
  27248 		*(*int8)(unsafe.Pointer(bp + 48 + 11)) = int8(0)
  27249 		if (*DateTime)(unsafe.Pointer(bp)).FY < 0 {
  27250 			*(*int8)(unsafe.Pointer(bp + 48)) = int8('-')
  27251 			Xsqlite3_result_text(tls, context, bp+48, 11, libc.UintptrFromInt32(-1))
  27252 		} else {
  27253 			Xsqlite3_result_text(tls, context, bp+48+1, 10, libc.UintptrFromInt32(-1))
  27254 		}
  27255 	}
  27256 }
  27257 
  27258 func strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
  27259 	bp := tls.Alloc(216)
  27260 	defer tls.Free(216)
  27261 
  27262 	var i Size_t
  27263 	var j Size_t
  27264 	var db uintptr
  27265 	var zFmt uintptr
  27266 
  27267 	if argc == 0 {
  27268 		return
  27269 	}
  27270 	zFmt = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
  27271 	if zFmt == uintptr(0) || isDate(tls, context, argc-1, argv+uintptr(1)*8, bp+88) != 0 {
  27272 		return
  27273 	}
  27274 	db = Xsqlite3_context_db_handle(tls, context)
  27275 	Xsqlite3StrAccumInit(tls, bp+136, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer(db + 136)))
  27276 
  27277 	computeJD(tls, bp+88)
  27278 	computeYMD_HMS(tls, bp+88)
  27279 	for i = libc.AssignUint64(&j, uint64(0)); *(*int8)(unsafe.Pointer(zFmt + uintptr(i))) != 0; i++ {
  27280 		if int32(*(*int8)(unsafe.Pointer(zFmt + uintptr(i)))) != '%' {
  27281 			continue
  27282 		}
  27283 		if j < i {
  27284 			Xsqlite3_str_append(tls, bp+136, zFmt+uintptr(j), int32(i-j))
  27285 		}
  27286 		i++
  27287 		j = i + uint64(1)
  27288 		switch int32(*(*int8)(unsafe.Pointer(zFmt + uintptr(i)))) {
  27289 		case 'd':
  27290 			{
  27291 				Xsqlite3_str_appendf(tls, bp+136, ts+1301, libc.VaList(bp, (*DateTime)(unsafe.Pointer(bp+88)).FD))
  27292 				break
  27293 
  27294 			}
  27295 		case 'f':
  27296 			{
  27297 				var s float64 = (*DateTime)(unsafe.Pointer(bp + 88)).Fs
  27298 				if s > 59.999 {
  27299 					s = 59.999
  27300 				}
  27301 				Xsqlite3_str_appendf(tls, bp+136, ts+1306, libc.VaList(bp+8, s))
  27302 				break
  27303 
  27304 			}
  27305 		case 'H':
  27306 			{
  27307 				Xsqlite3_str_appendf(tls, bp+136, ts+1301, libc.VaList(bp+16, (*DateTime)(unsafe.Pointer(bp+88)).Fh))
  27308 				break
  27309 
  27310 			}
  27311 		case 'W':
  27312 			fallthrough
  27313 		case 'j':
  27314 			{
  27315 				var nDay int32
  27316 				*(*DateTime)(unsafe.Pointer(bp + 168)) = *(*DateTime)(unsafe.Pointer(bp + 88))
  27317 				(*DateTime)(unsafe.Pointer(bp + 168)).FvalidJD = int8(0)
  27318 				(*DateTime)(unsafe.Pointer(bp + 168)).FM = 1
  27319 				(*DateTime)(unsafe.Pointer(bp + 168)).FD = 1
  27320 				computeJD(tls, bp+168)
  27321 				nDay = int32(((*DateTime)(unsafe.Pointer(bp+88)).FiJD - (*DateTime)(unsafe.Pointer(bp+168)).FiJD + int64(43200000)) / int64(86400000))
  27322 				if int32(*(*int8)(unsafe.Pointer(zFmt + uintptr(i)))) == 'W' {
  27323 					var wd int32
  27324 					wd = int32(((*DateTime)(unsafe.Pointer(bp+88)).FiJD + int64(43200000)) / int64(86400000) % int64(7))
  27325 					Xsqlite3_str_appendf(tls, bp+136, ts+1301, libc.VaList(bp+24, (nDay+7-wd)/7))
  27326 				} else {
  27327 					Xsqlite3_str_appendf(tls, bp+136, ts+1313, libc.VaList(bp+32, nDay+1))
  27328 				}
  27329 				break
  27330 
  27331 			}
  27332 		case 'J':
  27333 			{
  27334 				Xsqlite3_str_appendf(tls, bp+136, ts+1318, libc.VaList(bp+40, float64((*DateTime)(unsafe.Pointer(bp+88)).FiJD)/86400000.0))
  27335 				break
  27336 
  27337 			}
  27338 		case 'm':
  27339 			{
  27340 				Xsqlite3_str_appendf(tls, bp+136, ts+1301, libc.VaList(bp+48, (*DateTime)(unsafe.Pointer(bp+88)).FM))
  27341 				break
  27342 
  27343 			}
  27344 		case 'M':
  27345 			{
  27346 				Xsqlite3_str_appendf(tls, bp+136, ts+1301, libc.VaList(bp+56, (*DateTime)(unsafe.Pointer(bp+88)).Fm))
  27347 				break
  27348 
  27349 			}
  27350 		case 's':
  27351 			{
  27352 				var iS I64 = (*DateTime)(unsafe.Pointer(bp+88)).FiJD/int64(1000) - int64(21086676)*int64(10000)
  27353 				Xsqlite3_str_appendf(tls, bp+136, ts+1324, libc.VaList(bp+64, iS))
  27354 				break
  27355 
  27356 			}
  27357 		case 'S':
  27358 			{
  27359 				Xsqlite3_str_appendf(tls, bp+136, ts+1301, libc.VaList(bp+72, libc.Int32FromFloat64((*DateTime)(unsafe.Pointer(bp+88)).Fs)))
  27360 				break
  27361 
  27362 			}
  27363 		case 'w':
  27364 			{
  27365 				Xsqlite3_str_appendchar(tls, bp+136, 1,
  27366 					int8(int32(int8(((*DateTime)(unsafe.Pointer(bp+88)).FiJD+int64(129600000))/int64(86400000)%int64(7)))+'0'))
  27367 				break
  27368 
  27369 			}
  27370 		case 'Y':
  27371 			{
  27372 				Xsqlite3_str_appendf(tls, bp+136, ts+1329, libc.VaList(bp+80, (*DateTime)(unsafe.Pointer(bp+88)).FY))
  27373 				break
  27374 
  27375 			}
  27376 		case '%':
  27377 			{
  27378 				Xsqlite3_str_appendchar(tls, bp+136, 1, int8('%'))
  27379 				break
  27380 
  27381 			}
  27382 		default:
  27383 			{
  27384 				Xsqlite3_str_reset(tls, bp+136)
  27385 				return
  27386 
  27387 			}
  27388 		}
  27389 	}
  27390 	if j < i {
  27391 		Xsqlite3_str_append(tls, bp+136, zFmt+uintptr(j), int32(i-j))
  27392 	}
  27393 	Xsqlite3ResultStrAccum(tls, context, bp+136)
  27394 }
  27395 
  27396 func ctimeFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) {
  27397 	_ = NotUsed
  27398 	_ = NotUsed2
  27399 	timeFunc(tls, context, 0, uintptr(0))
  27400 }
  27401 
  27402 func cdateFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) {
  27403 	_ = NotUsed
  27404 	_ = NotUsed2
  27405 	dateFunc(tls, context, 0, uintptr(0))
  27406 }
  27407 
  27408 func ctimestampFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) {
  27409 	_ = NotUsed
  27410 	_ = NotUsed2
  27411 	datetimeFunc(tls, context, 0, uintptr(0))
  27412 }
  27413 
  27414 // This function registered all of the above C functions as SQL
  27415 // functions.  This should be the only routine in this file with
  27416 // external linkage.
  27417 func Xsqlite3RegisterDateTimeFunctions(tls *libc.TLS) {
  27418 	Xsqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&aDateTimeFuncs)), int32(uint64(unsafe.Sizeof(aDateTimeFuncs))/uint64(unsafe.Sizeof(FuncDef{}))))
  27419 }
  27420 
  27421 var aDateTimeFuncs = [9]FuncDef{
  27422 	{FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8 | SQLITE_FUNC_CONSTANT), FpUserData: 0, FxSFunc: 0, FzName: ts + 1233},
  27423 	{FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8 | SQLITE_FUNC_CONSTANT), FpUserData: 0, FxSFunc: 0, FzName: ts + 1253},
  27424 	{FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8 | SQLITE_FUNC_CONSTANT), FpUserData: 0, FxSFunc: 0, FzName: ts + 1334},
  27425 	{FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8 | SQLITE_FUNC_CONSTANT), FpUserData: 0, FxSFunc: 0, FzName: ts + 1339},
  27426 	{FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8 | SQLITE_FUNC_CONSTANT), FpUserData: 0, FxSFunc: 0, FzName: ts + 1344},
  27427 	{FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8 | SQLITE_FUNC_CONSTANT), FpUserData: 0, FxSFunc: 0, FzName: ts + 1353},
  27428 	{FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 1362},
  27429 	{FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 1375},
  27430 	{FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 1393}}
  27431 
  27432 // The following routines are convenience wrappers around methods
  27433 // of the sqlite3_file object.  This is mostly just syntactic sugar. All
  27434 // of this would be completely automatic if SQLite were coded using
  27435 // C++ instead of plain old C.
  27436 func Xsqlite3OsClose(tls *libc.TLS, pId uintptr) {
  27437 	if (*Sqlite3_file)(unsafe.Pointer(pId)).FpMethods != 0 {
  27438 		(*struct {
  27439 			f func(*libc.TLS, uintptr) int32
  27440 		})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})).f(tls, pId)
  27441 		(*Sqlite3_file)(unsafe.Pointer(pId)).FpMethods = uintptr(0)
  27442 	}
  27443 }
  27444 
  27445 func Xsqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset I64) int32 {
  27446 	return (*struct {
  27447 		f func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32
  27448 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})).f(tls, id, pBuf, amt, offset)
  27449 }
  27450 
  27451 func Xsqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset I64) int32 {
  27452 	return (*struct {
  27453 		f func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32
  27454 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})).f(tls, id, pBuf, amt, offset)
  27455 }
  27456 
  27457 func Xsqlite3OsTruncate(tls *libc.TLS, id uintptr, size I64) int32 {
  27458 	return (*struct {
  27459 		f func(*libc.TLS, uintptr, Sqlite3_int64) int32
  27460 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})).f(tls, id, size)
  27461 }
  27462 
  27463 func Xsqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) int32 {
  27464 	if flags != 0 {
  27465 		return (*struct {
  27466 			f func(*libc.TLS, uintptr, int32) int32
  27467 		})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})).f(tls, id, flags)
  27468 	}
  27469 	return SQLITE_OK
  27470 }
  27471 
  27472 func Xsqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) int32 {
  27473 	return (*struct {
  27474 		f func(*libc.TLS, uintptr, uintptr) int32
  27475 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})).f(tls, id, pSize)
  27476 }
  27477 
  27478 func Xsqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) int32 {
  27479 	return (*struct {
  27480 		f func(*libc.TLS, uintptr, int32) int32
  27481 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})).f(tls, id, lockType)
  27482 }
  27483 
  27484 func Xsqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) int32 {
  27485 	return (*struct {
  27486 		f func(*libc.TLS, uintptr, int32) int32
  27487 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})).f(tls, id, lockType)
  27488 }
  27489 
  27490 func Xsqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 {
  27491 	return (*struct {
  27492 		f func(*libc.TLS, uintptr, uintptr) int32
  27493 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})).f(tls, id, pResOut)
  27494 }
  27495 
  27496 // Use sqlite3OsFileControl() when we are doing something that might fail
  27497 // and we need to know about the failures.  Use sqlite3OsFileControlHint()
  27498 // when simply tossing information over the wall to the VFS and we do not
  27499 // really care if the VFS receives and understands the information since it
  27500 // is only a hint and can be safely ignored.  The sqlite3OsFileControlHint()
  27501 // routine has no return value since the return value would be meaningless.
  27502 func Xsqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 {
  27503 	if (*Sqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) {
  27504 		return SQLITE_NOTFOUND
  27505 	}
  27506 	return (*struct {
  27507 		f func(*libc.TLS, uintptr, int32, uintptr) int32
  27508 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})).f(tls, id, op, pArg)
  27509 }
  27510 
  27511 func Xsqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr) {
  27512 	if (*Sqlite3_file)(unsafe.Pointer(id)).FpMethods != 0 {
  27513 		(*struct {
  27514 			f func(*libc.TLS, uintptr, int32, uintptr) int32
  27515 		})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})).f(tls, id, op, pArg)
  27516 	}
  27517 }
  27518 
  27519 func Xsqlite3OsSectorSize(tls *libc.TLS, id uintptr) int32 {
  27520 	var xSectorSize uintptr = (*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize
  27521 	return func() int32 {
  27522 		if xSectorSize != 0 {
  27523 			return (*struct {
  27524 				f func(*libc.TLS, uintptr) int32
  27525 			})(unsafe.Pointer(&struct{ uintptr }{xSectorSize})).f(tls, id)
  27526 		}
  27527 		return SQLITE_DEFAULT_SECTOR_SIZE
  27528 	}()
  27529 }
  27530 
  27531 func Xsqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) int32 {
  27532 	if (*Sqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) {
  27533 		return 0
  27534 	}
  27535 	return (*struct {
  27536 		f func(*libc.TLS, uintptr) int32
  27537 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})).f(tls, id)
  27538 }
  27539 
  27540 func Xsqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) int32 {
  27541 	return (*struct {
  27542 		f func(*libc.TLS, uintptr, int32, int32, int32) int32
  27543 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})).f(tls, id, offset, n, flags)
  27544 }
  27545 
  27546 func Xsqlite3OsShmBarrier(tls *libc.TLS, id uintptr) {
  27547 	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})).f(tls, id)
  27548 }
  27549 
  27550 func Xsqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) int32 {
  27551 	return (*struct {
  27552 		f func(*libc.TLS, uintptr, int32) int32
  27553 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})).f(tls, id, deleteFlag)
  27554 }
  27555 
  27556 func Xsqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) int32 {
  27557 	return (*struct {
  27558 		f func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32
  27559 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})).f(tls, id, iPage, pgsz, bExtend, pp)
  27560 }
  27561 
  27562 // The real implementation of xFetch and xUnfetch
  27563 func Xsqlite3OsFetch(tls *libc.TLS, id uintptr, iOff I64, iAmt int32, pp uintptr) int32 {
  27564 	return (*struct {
  27565 		f func(*libc.TLS, uintptr, Sqlite3_int64, int32, uintptr) int32
  27566 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})).f(tls, id, iOff, iAmt, pp)
  27567 }
  27568 
  27569 func Xsqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff I64, p uintptr) int32 {
  27570 	return (*struct {
  27571 		f func(*libc.TLS, uintptr, Sqlite3_int64, uintptr) int32
  27572 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})).f(tls, id, iOff, p)
  27573 }
  27574 
  27575 // The next group of routines are convenience wrappers around the
  27576 // VFS methods.
  27577 func Xsqlite3OsOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags int32, pFlagsOut uintptr) int32 {
  27578 	var rc int32
  27579 
  27580 	rc = (*struct {
  27581 		f func(*libc.TLS, uintptr, Sqlite3_filename, uintptr, int32, uintptr) int32
  27582 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxOpen})).f(tls, pVfs, zPath, pFile, flags&0x1087f7f, pFlagsOut)
  27583 
  27584 	return rc
  27585 }
  27586 
  27587 func Xsqlite3OsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 {
  27588 	if (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxDelete != uintptr(0) {
  27589 		return (*struct {
  27590 			f func(*libc.TLS, uintptr, uintptr, int32) int32
  27591 		})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxDelete})).f(tls, pVfs, zPath, dirSync)
  27592 	}
  27593 	return SQLITE_OK
  27594 }
  27595 
  27596 func Xsqlite3OsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 {
  27597 	return (*struct {
  27598 		f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
  27599 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxAccess})).f(tls, pVfs, zPath, flags, pResOut)
  27600 }
  27601 
  27602 func Xsqlite3OsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nPathOut int32, zPathOut uintptr) int32 {
  27603 	*(*int8)(unsafe.Pointer(zPathOut)) = int8(0)
  27604 	return (*struct {
  27605 		f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
  27606 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxFullPathname})).f(tls, pVfs, zPath, nPathOut, zPathOut)
  27607 }
  27608 
  27609 func Xsqlite3OsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr {
  27610 	return (*struct {
  27611 		f func(*libc.TLS, uintptr, uintptr) uintptr
  27612 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxDlOpen})).f(tls, pVfs, zPath)
  27613 }
  27614 
  27615 func Xsqlite3OsDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) {
  27616 	(*struct {
  27617 		f func(*libc.TLS, uintptr, int32, uintptr)
  27618 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxDlError})).f(tls, pVfs, nByte, zBufOut)
  27619 }
  27620 
  27621 func Xsqlite3OsDlSym(tls *libc.TLS, pVfs uintptr, pHdle uintptr, zSym uintptr) uintptr {
  27622 	return (*struct {
  27623 		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
  27624 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxDlSym})).f(tls, pVfs, pHdle, zSym)
  27625 }
  27626 
  27627 func Xsqlite3OsDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) {
  27628 	(*struct {
  27629 		f func(*libc.TLS, uintptr, uintptr)
  27630 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxDlClose})).f(tls, pVfs, pHandle)
  27631 }
  27632 
  27633 func Xsqlite3OsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 {
  27634 	if Xsqlite3Config.FiPrngSeed != 0 {
  27635 		libc.Xmemset(tls, zBufOut, 0, uint64(nByte))
  27636 		if nByte > int32(unsafe.Sizeof(uint32(0))) {
  27637 			nByte = int32(unsafe.Sizeof(uint32(0)))
  27638 		}
  27639 		libc.Xmemcpy(tls, zBufOut, uintptr(unsafe.Pointer(&Xsqlite3Config))+432, uint64(nByte))
  27640 		return SQLITE_OK
  27641 	} else {
  27642 		return (*struct {
  27643 			f func(*libc.TLS, uintptr, int32, uintptr) int32
  27644 		})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxRandomness})).f(tls, pVfs, nByte, zBufOut)
  27645 	}
  27646 	return int32(0)
  27647 
  27648 }
  27649 
  27650 func Xsqlite3OsSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 {
  27651 	return (*struct {
  27652 		f func(*libc.TLS, uintptr, int32) int32
  27653 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxSleep})).f(tls, pVfs, nMicro)
  27654 }
  27655 
  27656 func Xsqlite3OsGetLastError(tls *libc.TLS, pVfs uintptr) int32 {
  27657 	if (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxGetLastError != 0 {
  27658 		return (*struct {
  27659 			f func(*libc.TLS, uintptr, int32, uintptr) int32
  27660 		})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxGetLastError})).f(tls, pVfs, 0, uintptr(0))
  27661 	}
  27662 	return 0
  27663 }
  27664 
  27665 func Xsqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 {
  27666 	bp := tls.Alloc(8)
  27667 	defer tls.Free(8)
  27668 
  27669 	var rc int32
  27670 
  27671 	if (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FiVersion >= 2 && (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTimeInt64 != 0 {
  27672 		rc = (*struct {
  27673 			f func(*libc.TLS, uintptr, uintptr) int32
  27674 		})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTimeInt64})).f(tls, pVfs, pTimeOut)
  27675 	} else {
  27676 		rc = (*struct {
  27677 			f func(*libc.TLS, uintptr, uintptr) int32
  27678 		})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTime})).f(tls, pVfs, bp)
  27679 		*(*Sqlite3_int64)(unsafe.Pointer(pTimeOut)) = libc.Int64FromFloat64(*(*float64)(unsafe.Pointer(bp)) * 86400000.0)
  27680 	}
  27681 	return rc
  27682 }
  27683 
  27684 func Xsqlite3OsOpenMalloc(tls *libc.TLS, pVfs uintptr, zFile uintptr, ppFile uintptr, flags int32, pOutFlags uintptr) int32 {
  27685 	var rc int32
  27686 	var pFile uintptr
  27687 	pFile = Xsqlite3MallocZero(tls, uint64((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))
  27688 	if pFile != 0 {
  27689 		rc = Xsqlite3OsOpen(tls, pVfs, zFile, pFile, flags, pOutFlags)
  27690 		if rc != SQLITE_OK {
  27691 			Xsqlite3_free(tls, pFile)
  27692 			*(*uintptr)(unsafe.Pointer(ppFile)) = uintptr(0)
  27693 		} else {
  27694 			*(*uintptr)(unsafe.Pointer(ppFile)) = pFile
  27695 		}
  27696 	} else {
  27697 		*(*uintptr)(unsafe.Pointer(ppFile)) = uintptr(0)
  27698 		rc = SQLITE_NOMEM
  27699 	}
  27700 
  27701 	return rc
  27702 }
  27703 
  27704 func Xsqlite3OsCloseFree(tls *libc.TLS, pFile uintptr) {
  27705 	Xsqlite3OsClose(tls, pFile)
  27706 	Xsqlite3_free(tls, pFile)
  27707 }
  27708 
  27709 // This function is a wrapper around the OS specific implementation of
  27710 // sqlite3_os_init(). The purpose of the wrapper is to provide the
  27711 // ability to simulate a malloc failure, so that the handling of an
  27712 // error in sqlite3_os_init() by the upper layers can be tested.
  27713 func Xsqlite3OsInit(tls *libc.TLS) int32 {
  27714 	var p uintptr = Xsqlite3_malloc(tls, 10)
  27715 	if p == uintptr(0) {
  27716 		return SQLITE_NOMEM
  27717 	}
  27718 	Xsqlite3_free(tls, p)
  27719 	return Xsqlite3_os_init(tls)
  27720 }
  27721 
  27722 var vfsList uintptr = uintptr(0)
  27723 
  27724 // Locate a VFS by name.  If no name is given, simply return the
  27725 // first VFS on the list.
  27726 func Xsqlite3_vfs_find(tls *libc.TLS, zVfs uintptr) uintptr {
  27727 	var pVfs uintptr = uintptr(0)
  27728 	var mutex uintptr
  27729 	var rc int32 = Xsqlite3_initialize(tls)
  27730 	if rc != 0 {
  27731 		return uintptr(0)
  27732 	}
  27733 	mutex = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN)
  27734 	Xsqlite3_mutex_enter(tls, mutex)
  27735 	for pVfs = vfsList; pVfs != 0; pVfs = (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpNext {
  27736 		if zVfs == uintptr(0) {
  27737 			break
  27738 		}
  27739 		if libc.Xstrcmp(tls, zVfs, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FzName) == 0 {
  27740 			break
  27741 		}
  27742 	}
  27743 	Xsqlite3_mutex_leave(tls, mutex)
  27744 	return pVfs
  27745 }
  27746 
  27747 func vfsUnlink(tls *libc.TLS, pVfs uintptr) {
  27748 	if pVfs == uintptr(0) {
  27749 	} else if vfsList == pVfs {
  27750 		vfsList = (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpNext
  27751 	} else if vfsList != 0 {
  27752 		var p uintptr = vfsList
  27753 		for (*Sqlite3_vfs)(unsafe.Pointer(p)).FpNext != 0 && (*Sqlite3_vfs)(unsafe.Pointer(p)).FpNext != pVfs {
  27754 			p = (*Sqlite3_vfs)(unsafe.Pointer(p)).FpNext
  27755 		}
  27756 		if (*Sqlite3_vfs)(unsafe.Pointer(p)).FpNext == pVfs {
  27757 			(*Sqlite3_vfs)(unsafe.Pointer(p)).FpNext = (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpNext
  27758 		}
  27759 	}
  27760 }
  27761 
  27762 // Register a VFS with the system.  It is harmless to register the same
  27763 // VFS multiple times.  The new VFS becomes the default if makeDflt is
  27764 // true.
  27765 func Xsqlite3_vfs_register(tls *libc.TLS, pVfs uintptr, makeDflt int32) int32 {
  27766 	var mutex uintptr
  27767 	var rc int32 = Xsqlite3_initialize(tls)
  27768 	if rc != 0 {
  27769 		return rc
  27770 	}
  27771 
  27772 	mutex = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN)
  27773 	Xsqlite3_mutex_enter(tls, mutex)
  27774 	vfsUnlink(tls, pVfs)
  27775 	if makeDflt != 0 || vfsList == uintptr(0) {
  27776 		(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpNext = vfsList
  27777 		vfsList = pVfs
  27778 	} else {
  27779 		(*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpNext = (*Sqlite3_vfs)(unsafe.Pointer(vfsList)).FpNext
  27780 		(*Sqlite3_vfs)(unsafe.Pointer(vfsList)).FpNext = pVfs
  27781 	}
  27782 
  27783 	Xsqlite3_mutex_leave(tls, mutex)
  27784 	return SQLITE_OK
  27785 }
  27786 
  27787 // Unregister a VFS so that it is no longer accessible.
  27788 func Xsqlite3_vfs_unregister(tls *libc.TLS, pVfs uintptr) int32 {
  27789 	var mutex uintptr
  27790 	var rc int32 = Xsqlite3_initialize(tls)
  27791 	if rc != 0 {
  27792 		return rc
  27793 	}
  27794 	mutex = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN)
  27795 	Xsqlite3_mutex_enter(tls, mutex)
  27796 	vfsUnlink(tls, pVfs)
  27797 	Xsqlite3_mutex_leave(tls, mutex)
  27798 	return SQLITE_OK
  27799 }
  27800 
  27801 // Global variables.
  27802 type BenignMallocHooks1 = struct {
  27803 	FxBenignBegin uintptr
  27804 	FxBenignEnd   uintptr
  27805 }
  27806 
  27807 // Global variables.
  27808 type BenignMallocHooks = BenignMallocHooks1
  27809 
  27810 var sqlite3Hooks = BenignMallocHooks1{}
  27811 
  27812 // Register hooks to call when sqlite3BeginBenignMalloc() and
  27813 // sqlite3EndBenignMalloc() are called, respectively.
  27814 func Xsqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr) {
  27815 	sqlite3Hooks.FxBenignBegin = xBenignBegin
  27816 	sqlite3Hooks.FxBenignEnd = xBenignEnd
  27817 }
  27818 
  27819 // This (sqlite3EndBenignMalloc()) is called by SQLite code to indicate that
  27820 // subsequent malloc failures are benign. A call to sqlite3EndBenignMalloc()
  27821 // indicates that subsequent malloc failures are non-benign.
  27822 func Xsqlite3BeginBenignMalloc(tls *libc.TLS) {
  27823 	if sqlite3Hooks.FxBenignBegin != 0 {
  27824 		(*struct{ f func(*libc.TLS) })(unsafe.Pointer(&struct{ uintptr }{sqlite3Hooks.FxBenignBegin})).f(tls)
  27825 	}
  27826 }
  27827 
  27828 func Xsqlite3EndBenignMalloc(tls *libc.TLS) {
  27829 	if sqlite3Hooks.FxBenignEnd != 0 {
  27830 		(*struct{ f func(*libc.TLS) })(unsafe.Pointer(&struct{ uintptr }{sqlite3Hooks.FxBenignEnd})).f(tls)
  27831 	}
  27832 }
  27833 
  27834 func sqlite3MemMalloc(tls *libc.TLS, nByte int32) uintptr {
  27835 	bp := tls.Alloc(8)
  27836 	defer tls.Free(8)
  27837 
  27838 	var p uintptr
  27839 
  27840 	p = libc.Xmalloc(tls, uint64(nByte))
  27841 	if p == uintptr(0) {
  27842 		Xsqlite3_log(tls, SQLITE_NOMEM, ts+1406, libc.VaList(bp, nByte))
  27843 	}
  27844 	return p
  27845 }
  27846 
  27847 func sqlite3MemFree(tls *libc.TLS, pPrior uintptr) {
  27848 	libc.Xfree(tls, pPrior)
  27849 }
  27850 
  27851 func sqlite3MemSize(tls *libc.TLS, pPrior uintptr) int32 {
  27852 	return int32(libc.X_msize(tls, pPrior))
  27853 }
  27854 
  27855 func sqlite3MemRealloc(tls *libc.TLS, pPrior uintptr, nByte int32) uintptr {
  27856 	bp := tls.Alloc(16)
  27857 	defer tls.Free(16)
  27858 
  27859 	var p uintptr = libc.Xrealloc(tls, pPrior, uint64(nByte))
  27860 	if p == uintptr(0) {
  27861 		Xsqlite3_log(tls, SQLITE_NOMEM,
  27862 			ts+1444,
  27863 			libc.VaList(bp, libc.X_msize(tls, pPrior), nByte))
  27864 	}
  27865 	return p
  27866 }
  27867 
  27868 func sqlite3MemRoundup(tls *libc.TLS, n int32) int32 {
  27869 	return (n + 7) & libc.CplInt32(7)
  27870 }
  27871 
  27872 func sqlite3MemInit(tls *libc.TLS, NotUsed uintptr) int32 {
  27873 	_ = NotUsed
  27874 	return SQLITE_OK
  27875 }
  27876 
  27877 func sqlite3MemShutdown(tls *libc.TLS, NotUsed uintptr) {
  27878 	_ = NotUsed
  27879 	return
  27880 }
  27881 
  27882 // This routine is the only routine in this file with external linkage.
  27883 //
  27884 // Populate the low-level memory allocation function pointers in
  27885 // sqlite3GlobalConfig.m with pointers to the routines in this file.
  27886 func Xsqlite3MemSetDefault(tls *libc.TLS) {
  27887 	bp := tls.Alloc(8)
  27888 	defer tls.Free(8)
  27889 
  27890 	Xsqlite3_config(tls, SQLITE_CONFIG_MALLOC, libc.VaList(bp, uintptr(unsafe.Pointer(&defaultMethods))))
  27891 }
  27892 
  27893 var defaultMethods = Sqlite3_mem_methods{
  27894 	FxMalloc:   0,
  27895 	FxFree:     0,
  27896 	FxRealloc:  0,
  27897 	FxSize:     0,
  27898 	FxRoundup:  0,
  27899 	FxInit:     0,
  27900 	FxShutdown: 0,
  27901 }
  27902 
  27903 // Initialize the mutex system.
  27904 func Xsqlite3MutexInit(tls *libc.TLS) int32 {
  27905 	var rc int32 = SQLITE_OK
  27906 	if !(int32(Xsqlite3Config.Fmutex.FxMutexAlloc) != 0) {
  27907 		var pFrom uintptr
  27908 		var pTo uintptr = uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96
  27909 
  27910 		if Xsqlite3Config.FbCoreMutex != 0 {
  27911 			pFrom = Xsqlite3DefaultMutex(tls)
  27912 		} else {
  27913 			pFrom = Xsqlite3NoopMutex(tls)
  27914 		}
  27915 		(*Sqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexInit = (*Sqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexInit
  27916 		(*Sqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexEnd = (*Sqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexEnd
  27917 		(*Sqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexFree = (*Sqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexFree
  27918 		(*Sqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexEnter = (*Sqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexEnter
  27919 		(*Sqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexTry = (*Sqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexTry
  27920 		(*Sqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexLeave = (*Sqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexLeave
  27921 		(*Sqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexHeld = (*Sqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexHeld
  27922 		(*Sqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexNotheld = (*Sqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexNotheld
  27923 
  27924 		(*Sqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexAlloc = (*Sqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexAlloc
  27925 	}
  27926 
  27927 	rc = (*struct{ f func(*libc.TLS) int32 })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fmutex.FxMutexInit})).f(tls)
  27928 
  27929 	return rc
  27930 }
  27931 
  27932 // Shutdown the mutex system. This call frees resources allocated by
  27933 // sqlite3MutexInit().
  27934 func Xsqlite3MutexEnd(tls *libc.TLS) int32 {
  27935 	var rc int32 = SQLITE_OK
  27936 	if Xsqlite3Config.Fmutex.FxMutexEnd != 0 {
  27937 		rc = (*struct{ f func(*libc.TLS) int32 })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fmutex.FxMutexEnd})).f(tls)
  27938 	}
  27939 
  27940 	return rc
  27941 }
  27942 
  27943 // Retrieve a pointer to a static mutex or allocate a new dynamic one.
  27944 func Xsqlite3_mutex_alloc(tls *libc.TLS, id int32) uintptr {
  27945 	if id <= SQLITE_MUTEX_RECURSIVE && Xsqlite3_initialize(tls) != 0 {
  27946 		return uintptr(0)
  27947 	}
  27948 	if id > SQLITE_MUTEX_RECURSIVE && Xsqlite3MutexInit(tls) != 0 {
  27949 		return uintptr(0)
  27950 	}
  27951 
  27952 	return (*struct {
  27953 		f func(*libc.TLS, int32) uintptr
  27954 	})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fmutex.FxMutexAlloc})).f(tls, id)
  27955 }
  27956 
  27957 func Xsqlite3MutexAlloc(tls *libc.TLS, id int32) uintptr {
  27958 	if !(int32(Xsqlite3Config.FbCoreMutex) != 0) {
  27959 		return uintptr(0)
  27960 	}
  27961 
  27962 	return (*struct {
  27963 		f func(*libc.TLS, int32) uintptr
  27964 	})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fmutex.FxMutexAlloc})).f(tls, id)
  27965 }
  27966 
  27967 // Free a dynamic mutex.
  27968 func Xsqlite3_mutex_free(tls *libc.TLS, p uintptr) {
  27969 	if p != 0 {
  27970 		(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fmutex.FxMutexFree})).f(tls, p)
  27971 	}
  27972 }
  27973 
  27974 // Obtain the mutex p. If some other thread already has the mutex, block
  27975 // until it can be obtained.
  27976 func Xsqlite3_mutex_enter(tls *libc.TLS, p uintptr) {
  27977 	if p != 0 {
  27978 		(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fmutex.FxMutexEnter})).f(tls, p)
  27979 	}
  27980 }
  27981 
  27982 // Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another
  27983 // thread holds the mutex and it cannot be obtained, return SQLITE_BUSY.
  27984 func Xsqlite3_mutex_try(tls *libc.TLS, p uintptr) int32 {
  27985 	var rc int32 = SQLITE_OK
  27986 	if p != 0 {
  27987 		return (*struct {
  27988 			f func(*libc.TLS, uintptr) int32
  27989 		})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fmutex.FxMutexTry})).f(tls, p)
  27990 	}
  27991 	return rc
  27992 }
  27993 
  27994 // The sqlite3_mutex_leave() routine exits a mutex that was previously
  27995 // entered by the same thread.  The behavior is undefined if the mutex
  27996 // is not currently entered. If a NULL pointer is passed as an argument
  27997 // this function is a no-op.
  27998 func Xsqlite3_mutex_leave(tls *libc.TLS, p uintptr) {
  27999 	if p != 0 {
  28000 		(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fmutex.FxMutexLeave})).f(tls, p)
  28001 	}
  28002 }
  28003 
  28004 func noopMutexInit(tls *libc.TLS) int32 {
  28005 	return SQLITE_OK
  28006 }
  28007 
  28008 func noopMutexEnd(tls *libc.TLS) int32 {
  28009 	return SQLITE_OK
  28010 }
  28011 
  28012 func noopMutexAlloc(tls *libc.TLS, id int32) uintptr {
  28013 	_ = id
  28014 	return uintptr(8)
  28015 }
  28016 
  28017 func noopMutexFree(tls *libc.TLS, p uintptr) {
  28018 	_ = p
  28019 	return
  28020 }
  28021 
  28022 func noopMutexEnter(tls *libc.TLS, p uintptr) {
  28023 	_ = p
  28024 	return
  28025 }
  28026 
  28027 func noopMutexTry(tls *libc.TLS, p uintptr) int32 {
  28028 	_ = p
  28029 	return SQLITE_OK
  28030 }
  28031 
  28032 func noopMutexLeave(tls *libc.TLS, p uintptr) {
  28033 	_ = p
  28034 	return
  28035 }
  28036 
  28037 func Xsqlite3NoopMutex(tls *libc.TLS) uintptr {
  28038 	return uintptr(unsafe.Pointer(&sMutex))
  28039 }
  28040 
  28041 var sMutex = Sqlite3_mutex_methods{
  28042 	FxMutexInit:  0,
  28043 	FxMutexEnd:   0,
  28044 	FxMutexAlloc: 0,
  28045 	FxMutexFree:  0,
  28046 	FxMutexEnter: 0,
  28047 	FxMutexTry:   0,
  28048 	FxMutexLeave: 0,
  28049 }
  28050 
  28051 // If compiled with SQLITE_MUTEX_NOOP, then the no-op mutex implementation
  28052 // is used regardless of the run-time threadsafety setting.
  28053 func Xsqlite3DefaultMutex(tls *libc.TLS) uintptr {
  28054 	return Xsqlite3NoopMutex(tls)
  28055 }
  28056 
  28057 type _EXCEPTION_POINTERS = struct {
  28058 	FExceptionRecord PEXCEPTION_RECORD
  28059 	FContextRecord   PCONTEXT
  28060 }
  28061 
  28062 type _EXCEPTION_RECORD = struct {
  28063 	FExceptionCode        DWORD
  28064 	FExceptionFlags       DWORD
  28065 	FExceptionRecord      uintptr
  28066 	FExceptionAddress     PVOID
  28067 	FNumberParameters     DWORD
  28068 	F__ccgo_pad1          [4]byte
  28069 	FExceptionInformation [15]ULONG_PTR
  28070 }
  28071 
  28072 type _CONTEXT = struct {
  28073 	FP1Home               DWORD64
  28074 	FP2Home               DWORD64
  28075 	FP3Home               DWORD64
  28076 	FP4Home               DWORD64
  28077 	FP5Home               DWORD64
  28078 	FP6Home               DWORD64
  28079 	FContextFlags         DWORD
  28080 	FMxCsr                DWORD
  28081 	FSegCs                WORD
  28082 	FSegDs                WORD
  28083 	FSegEs                WORD
  28084 	FSegFs                WORD
  28085 	FSegGs                WORD
  28086 	FSegSs                WORD
  28087 	FEFlags               DWORD
  28088 	FDr0                  DWORD64
  28089 	FDr1                  DWORD64
  28090 	FDr2                  DWORD64
  28091 	FDr3                  DWORD64
  28092 	FDr6                  DWORD64
  28093 	FDr7                  DWORD64
  28094 	FRax                  DWORD64
  28095 	FRcx                  DWORD64
  28096 	FRdx                  DWORD64
  28097 	FRbx                  DWORD64
  28098 	FRsp                  DWORD64
  28099 	FRbp                  DWORD64
  28100 	FRsi                  DWORD64
  28101 	FRdi                  DWORD64
  28102 	FR8                   DWORD64
  28103 	FR9                   DWORD64
  28104 	FR10                  DWORD64
  28105 	FR11                  DWORD64
  28106 	FR12                  DWORD64
  28107 	FR13                  DWORD64
  28108 	FR14                  DWORD64
  28109 	FR15                  DWORD64
  28110 	FRip                  DWORD64
  28111 	F__256                struct{ FFltSave XMM_SAVE_AREA32 }
  28112 	FVectorRegister       [26]M128A
  28113 	FVectorControl        DWORD64
  28114 	FDebugControl         DWORD64
  28115 	FLastBranchToRip      DWORD64
  28116 	FLastBranchFromRip    DWORD64
  28117 	FLastExceptionToRip   DWORD64
  28118 	FLastExceptionFromRip DWORD64
  28119 }
  28120 
  28121 type _DISPATCHER_CONTEXT = struct {
  28122 	FControlPc        ULONG64
  28123 	FImageBase        ULONG64
  28124 	FFunctionEntry    PRUNTIME_FUNCTION
  28125 	FEstablisherFrame ULONG64
  28126 	FTargetIp         ULONG64
  28127 	FContextRecord    PCONTEXT
  28128 	FLanguageHandler  PEXCEPTION_ROUTINE
  28129 	FHandlerData      PVOID
  28130 	FHistoryTable     PUNWIND_HISTORY_TABLE
  28131 	FScopeIndex       ULONG
  28132 	FFill0            ULONG
  28133 }
  28134 
  28135 // CRT stuff
  28136 type X_PHNDLR = uintptr
  28137 
  28138 type _XCPT_ACTION = struct {
  28139 	FXcptNum    uint32
  28140 	FSigNum     int32
  28141 	FXcptAction X_PHNDLR
  28142 }
  28143 
  28144 // The type of function that is expected as an exception handler to be
  28145 // installed with __try1.
  28146 type PEXCEPTION_HANDLER = uintptr
  28147 
  28148 type ULONG = uint32
  28149 type PULONG = uintptr
  28150 type USHORT = uint16
  28151 type PUSHORT = uintptr
  28152 type UCHAR = uint8
  28153 type PUCHAR = uintptr
  28154 type PSZ = uintptr
  28155 
  28156 type WINBOOL = int32
  28157 type BOOL = int32
  28158 type PBOOL = uintptr
  28159 type LPBOOL = uintptr
  28160 
  28161 type BYTE = uint8
  28162 type WORD = uint16
  28163 type DWORD = uint32
  28164 type FLOAT = float32
  28165 type PFLOAT = uintptr
  28166 type PBYTE = uintptr
  28167 type LPBYTE = uintptr
  28168 type PINT = uintptr
  28169 type LPINT = uintptr
  28170 type PWORD = uintptr
  28171 type LPWORD = uintptr
  28172 type LPLONG = uintptr
  28173 type PDWORD = uintptr
  28174 type LPDWORD = uintptr
  28175 type LPVOID = uintptr
  28176 type LPCVOID = uintptr
  28177 type INT = int32
  28178 type UINT = uint32
  28179 type PUINT = uintptr
  28180 
  28181 type POINTER_64_INT = uint64
  28182 
  28183 type INT8 = int8
  28184 type PINT8 = uintptr
  28185 type INT16 = int16
  28186 type PINT16 = uintptr
  28187 type INT32 = int32
  28188 type PINT32 = uintptr
  28189 type INT64 = int64
  28190 type PINT64 = uintptr
  28191 type UINT8 = uint8
  28192 type PUINT8 = uintptr
  28193 type UINT16 = uint16
  28194 type PUINT16 = uintptr
  28195 type UINT32 = uint32
  28196 type PUINT32 = uintptr
  28197 type UINT64 = uint64
  28198 type PUINT64 = uintptr
  28199 type LONG32 = int32
  28200 type PLONG32 = uintptr
  28201 type ULONG32 = uint32
  28202 type PULONG32 = uintptr
  28203 type DWORD32 = uint32
  28204 type PDWORD32 = uintptr
  28205 
  28206 type INT_PTR = int64
  28207 type PINT_PTR = uintptr
  28208 type UINT_PTR = uint64
  28209 type PUINT_PTR = uintptr
  28210 type LONG_PTR = int64
  28211 type PLONG_PTR = uintptr
  28212 type ULONG_PTR = uint64
  28213 type PULONG_PTR = uintptr
  28214 
  28215 type SHANDLE_PTR = int64
  28216 type HANDLE_PTR = uint64
  28217 type UHALF_PTR = uint32
  28218 type PUHALF_PTR = uintptr
  28219 type HALF_PTR = int32
  28220 type PHALF_PTR = uintptr
  28221 
  28222 type SIZE_T = ULONG_PTR
  28223 type PSIZE_T = uintptr
  28224 type SSIZE_T = LONG_PTR
  28225 type PSSIZE_T = uintptr
  28226 
  28227 type DWORD_PTR = ULONG_PTR
  28228 type PDWORD_PTR = uintptr
  28229 type LONG64 = int64
  28230 type PLONG64 = uintptr
  28231 type ULONG64 = uint64
  28232 type PULONG64 = uintptr
  28233 type DWORD64 = uint64
  28234 type PDWORD64 = uintptr
  28235 type KAFFINITY = ULONG_PTR
  28236 type PKAFFINITY = uintptr
  28237 
  28238 type PVOID = uintptr
  28239 type PVOID64 = uintptr
  28240 
  28241 type CHAR = int8
  28242 type SHORT = int16
  28243 type LONG = int32
  28244 
  28245 type WCHAR = Wchar_t
  28246 type PWCHAR = uintptr
  28247 type LPWCH = uintptr
  28248 type PWCH = uintptr
  28249 type LPCWCH = uintptr
  28250 type PCWCH = uintptr
  28251 type NWPSTR = uintptr
  28252 type LPWSTR = uintptr
  28253 type PWSTR = uintptr
  28254 type PZPWSTR = uintptr
  28255 type PCZPWSTR = uintptr
  28256 type LPUWSTR = uintptr
  28257 type PUWSTR = uintptr
  28258 type LPCWSTR = uintptr
  28259 type PCWSTR = uintptr
  28260 type PZPCWSTR = uintptr
  28261 type LPCUWSTR = uintptr
  28262 type PCUWSTR = uintptr
  28263 type PZZWSTR = uintptr
  28264 type PCZZWSTR = uintptr
  28265 type PUZZWSTR = uintptr
  28266 type PCUZZWSTR = uintptr
  28267 type PNZWCH = uintptr
  28268 type PCNZWCH = uintptr
  28269 type PUNZWCH = uintptr
  28270 type PCUNZWCH = uintptr
  28271 
  28272 type PCHAR = uintptr
  28273 type LPCH = uintptr
  28274 type PCH = uintptr
  28275 type LPCCH = uintptr
  28276 type PCCH = uintptr
  28277 type NPSTR = uintptr
  28278 type LPSTR = uintptr
  28279 type PSTR = uintptr
  28280 type PZPSTR = uintptr
  28281 type PCZPSTR = uintptr
  28282 type LPCSTR = uintptr
  28283 type PCSTR = uintptr
  28284 type PZPCSTR = uintptr
  28285 type PZZSTR = uintptr
  28286 type PCZZSTR = uintptr
  28287 type PNZCH = uintptr
  28288 type PCNZCH = uintptr
  28289 
  28290 type TCHAR = int8
  28291 type PTCHAR = uintptr
  28292 type TBYTE = uint8
  28293 type PTBYTE = uintptr
  28294 
  28295 type LPTCH = LPSTR
  28296 type PTCH = LPSTR
  28297 type LPCTCH = LPCCH
  28298 type PCTCH = LPCCH
  28299 type PTSTR = LPSTR
  28300 type LPTSTR = LPSTR
  28301 type PUTSTR = LPSTR
  28302 type LPUTSTR = LPSTR
  28303 type PCTSTR = LPCSTR
  28304 type LPCTSTR = LPCSTR
  28305 type PCUTSTR = LPCSTR
  28306 type LPCUTSTR = LPCSTR
  28307 type PZZTSTR = PZZSTR
  28308 type PUZZTSTR = PZZSTR
  28309 type PCZZTSTR = PCZZSTR
  28310 type PCUZZTSTR = PCZZSTR
  28311 type PZPTSTR = PZPSTR
  28312 type PNZTCH = PNZCH
  28313 type PUNZTCH = PNZCH
  28314 type PCNZTCH = PCNZCH
  28315 type PCUNZTCH = PCNZCH
  28316 
  28317 type PSHORT = uintptr
  28318 type PLONG = uintptr
  28319 
  28320 type _GROUP_AFFINITY = struct {
  28321 	FMask     KAFFINITY
  28322 	FGroup    WORD
  28323 	FReserved [3]WORD
  28324 }
  28325 
  28326 type GROUP_AFFINITY = _GROUP_AFFINITY
  28327 type PGROUP_AFFINITY = uintptr
  28328 
  28329 type HANDLE = uintptr
  28330 
  28331 type PHANDLE = uintptr
  28332 type FCHAR = BYTE
  28333 type FSHORT = WORD
  28334 type FLONG = DWORD
  28335 
  28336 type HRESULT = LONG
  28337 
  28338 type CCHAR = int8
  28339 type LCID = DWORD
  28340 type PLCID = PDWORD
  28341 type LANGID = WORD
  28342 
  28343 type COMPARTMENT_ID = uint32
  28344 type PCOMPARTMENT_ID = uintptr
  28345 
  28346 type _FLOAT128 = struct {
  28347 	FLowPart  int64
  28348 	FHighPart int64
  28349 }
  28350 
  28351 type FLOAT128 = _FLOAT128
  28352 
  28353 type PFLOAT128 = uintptr
  28354 
  28355 type LONGLONG = int64
  28356 type ULONGLONG = uint64
  28357 
  28358 type PLONGLONG = uintptr
  28359 type PULONGLONG = uintptr
  28360 type USN = LONGLONG
  28361 
  28362 type _LARGE_INTEGER = struct {
  28363 	F__ccgo_pad1 [0]uint64
  28364 	Fs           struct {
  28365 		FLowPart  DWORD
  28366 		FHighPart LONG
  28367 	}
  28368 }
  28369 
  28370 type LARGE_INTEGER = _LARGE_INTEGER
  28371 
  28372 type PLARGE_INTEGER = uintptr
  28373 
  28374 type _ULARGE_INTEGER = struct {
  28375 	F__ccgo_pad1 [0]uint64
  28376 	Fs           struct {
  28377 		FLowPart  DWORD
  28378 		FHighPart DWORD
  28379 	}
  28380 }
  28381 
  28382 type ULARGE_INTEGER = _ULARGE_INTEGER
  28383 
  28384 type PULARGE_INTEGER = uintptr
  28385 
  28386 type _LUID = struct {
  28387 	FLowPart  DWORD
  28388 	FHighPart LONG
  28389 }
  28390 
  28391 type LUID = _LUID
  28392 type PLUID = uintptr
  28393 
  28394 type DWORDLONG = ULONGLONG
  28395 type PDWORDLONG = uintptr
  28396 
  28397 type BOOLEAN = BYTE
  28398 type PBOOLEAN = uintptr
  28399 
  28400 type _LIST_ENTRY = struct {
  28401 	FFlink uintptr
  28402 	FBlink uintptr
  28403 }
  28404 
  28405 type LIST_ENTRY = _LIST_ENTRY
  28406 type PLIST_ENTRY = uintptr
  28407 type PRLIST_ENTRY = uintptr
  28408 
  28409 type _SINGLE_LIST_ENTRY = struct{ FNext uintptr }
  28410 
  28411 type SINGLE_LIST_ENTRY = _SINGLE_LIST_ENTRY
  28412 type PSINGLE_LIST_ENTRY = uintptr
  28413 
  28414 type LIST_ENTRY321 = struct {
  28415 	FFlink DWORD
  28416 	FBlink DWORD
  28417 }
  28418 
  28419 type LIST_ENTRY32 = LIST_ENTRY321
  28420 type PLIST_ENTRY32 = uintptr
  28421 
  28422 type LIST_ENTRY641 = struct {
  28423 	FFlink ULONGLONG
  28424 	FBlink ULONGLONG
  28425 }
  28426 
  28427 type LIST_ENTRY64 = LIST_ENTRY641
  28428 type PLIST_ENTRY64 = uintptr
  28429 
  28430 type _GUID = struct {
  28431 	FData1 uint32
  28432 	FData2 uint16
  28433 	FData3 uint16
  28434 	FData4 [8]uint8
  28435 }
  28436 
  28437 type GUID = _GUID
  28438 
  28439 type LPGUID = uintptr
  28440 
  28441 type LPCGUID = uintptr
  28442 
  28443 type IID = GUID
  28444 type LPIID = uintptr
  28445 
  28446 type CLSID = GUID
  28447 
  28448 type LPCLSID = uintptr
  28449 
  28450 type FMTID = GUID
  28451 type LPFMTID = uintptr
  28452 
  28453 type _OBJECTID = struct {
  28454 	FLineage    GUID
  28455 	FUniquifier DWORD
  28456 }
  28457 
  28458 type OBJECTID = _OBJECTID
  28459 type PEXCEPTION_ROUTINE = uintptr
  28460 
  28461 type KSPIN_LOCK = ULONG_PTR
  28462 type PKSPIN_LOCK = uintptr
  28463 
  28464 type _M128A = struct {
  28465 	FLow  ULONGLONG
  28466 	FHigh LONGLONG
  28467 }
  28468 
  28469 type M128A = _M128A
  28470 type PM128A = uintptr
  28471 
  28472 type _XSAVE_FORMAT = struct {
  28473 	FControlWord    WORD
  28474 	FStatusWord     WORD
  28475 	FTagWord        BYTE
  28476 	FReserved1      BYTE
  28477 	FErrorOpcode    WORD
  28478 	FErrorOffset    DWORD
  28479 	FErrorSelector  WORD
  28480 	FReserved2      WORD
  28481 	FDataOffset     DWORD
  28482 	FDataSelector   WORD
  28483 	FReserved3      WORD
  28484 	FMxCsr          DWORD
  28485 	FMxCsr_Mask     DWORD
  28486 	FFloatRegisters [8]M128A
  28487 	FXmmRegisters   [16]M128A
  28488 	FReserved4      [96]BYTE
  28489 }
  28490 
  28491 type XSAVE_FORMAT = _XSAVE_FORMAT
  28492 type PXSAVE_FORMAT = uintptr
  28493 
  28494 type _XSAVE_AREA_HEADER = struct {
  28495 	FMask     DWORD64
  28496 	FReserved [7]DWORD64
  28497 }
  28498 
  28499 type XSAVE_AREA_HEADER = _XSAVE_AREA_HEADER
  28500 type PXSAVE_AREA_HEADER = uintptr
  28501 
  28502 type _XSAVE_AREA = struct {
  28503 	FLegacyState XSAVE_FORMAT
  28504 	FHeader      XSAVE_AREA_HEADER
  28505 }
  28506 
  28507 type XSAVE_AREA = _XSAVE_AREA
  28508 type PXSAVE_AREA = uintptr
  28509 
  28510 type _XSTATE_CONTEXT = struct {
  28511 	FMask      DWORD64
  28512 	FLength    DWORD
  28513 	FReserved1 DWORD
  28514 	FArea      PXSAVE_AREA
  28515 	FBuffer    PVOID
  28516 }
  28517 
  28518 type XSTATE_CONTEXT = _XSTATE_CONTEXT
  28519 type PXSTATE_CONTEXT = uintptr
  28520 
  28521 type _SCOPE_TABLE_AMD64 = struct {
  28522 	FCount       DWORD
  28523 	FScopeRecord [1]struct {
  28524 		FBeginAddress   DWORD
  28525 		FEndAddress     DWORD
  28526 		FHandlerAddress DWORD
  28527 		FJumpTarget     DWORD
  28528 	}
  28529 }
  28530 
  28531 type SCOPE_TABLE_AMD64 = _SCOPE_TABLE_AMD64
  28532 type PSCOPE_TABLE_AMD64 = uintptr
  28533 
  28534 type _XMM_SAVE_AREA32 = struct {
  28535 	FControlWord    WORD
  28536 	FStatusWord     WORD
  28537 	FTagWord        BYTE
  28538 	FReserved1      BYTE
  28539 	FErrorOpcode    WORD
  28540 	FErrorOffset    DWORD
  28541 	FErrorSelector  WORD
  28542 	FReserved2      WORD
  28543 	FDataOffset     DWORD
  28544 	FDataSelector   WORD
  28545 	FReserved3      WORD
  28546 	FMxCsr          DWORD
  28547 	FMxCsr_Mask     DWORD
  28548 	FFloatRegisters [8]M128A
  28549 	FXmmRegisters   [16]M128A
  28550 	FReserved4      [96]BYTE
  28551 }
  28552 
  28553 type XMM_SAVE_AREA32 = _XMM_SAVE_AREA32
  28554 type PXMM_SAVE_AREA32 = uintptr
  28555 
  28556 type CONTEXT = _CONTEXT
  28557 type PCONTEXT = uintptr
  28558 
  28559 type _RUNTIME_FUNCTION = struct {
  28560 	FBeginAddress DWORD
  28561 	FEndAddress   DWORD
  28562 	FUnwindData   DWORD
  28563 }
  28564 
  28565 type RUNTIME_FUNCTION = _RUNTIME_FUNCTION
  28566 type PRUNTIME_FUNCTION = uintptr
  28567 
  28568 type PGET_RUNTIME_FUNCTION_CALLBACK = uintptr
  28569 type POUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK = uintptr
  28570 
  28571 type _LDT_ENTRY = struct {
  28572 	FLimitLow WORD
  28573 	FBaseLow  WORD
  28574 	FHighWord struct {
  28575 		F__ccgo_pad1 [0]uint32
  28576 		FBytes       struct {
  28577 			FBaseMid BYTE
  28578 			FFlags1  BYTE
  28579 			FFlags2  BYTE
  28580 			FBaseHi  BYTE
  28581 		}
  28582 	}
  28583 }
  28584 
  28585 type LDT_ENTRY = _LDT_ENTRY
  28586 type PLDT_ENTRY = uintptr
  28587 
  28588 type EXCEPTION_RECORD = _EXCEPTION_RECORD
  28589 
  28590 type PEXCEPTION_RECORD = uintptr
  28591 
  28592 type _EXCEPTION_RECORD32 = struct {
  28593 	FExceptionCode        DWORD
  28594 	FExceptionFlags       DWORD
  28595 	FExceptionRecord      DWORD
  28596 	FExceptionAddress     DWORD
  28597 	FNumberParameters     DWORD
  28598 	FExceptionInformation [15]DWORD
  28599 }
  28600 
  28601 type EXCEPTION_RECORD32 = _EXCEPTION_RECORD32
  28602 type PEXCEPTION_RECORD32 = uintptr
  28603 
  28604 type _EXCEPTION_RECORD64 = struct {
  28605 	FExceptionCode        DWORD
  28606 	FExceptionFlags       DWORD
  28607 	FExceptionRecord      DWORD64
  28608 	FExceptionAddress     DWORD64
  28609 	FNumberParameters     DWORD
  28610 	F__unusedAlignment    DWORD
  28611 	FExceptionInformation [15]DWORD64
  28612 }
  28613 
  28614 type EXCEPTION_RECORD64 = _EXCEPTION_RECORD64
  28615 type PEXCEPTION_RECORD64 = uintptr
  28616 
  28617 type EXCEPTION_POINTERS = _EXCEPTION_POINTERS
  28618 type PEXCEPTION_POINTERS = uintptr
  28619 
  28620 type _UNWIND_HISTORY_TABLE_ENTRY = struct {
  28621 	FImageBase     ULONG64
  28622 	FFunctionEntry PRUNTIME_FUNCTION
  28623 }
  28624 
  28625 type UNWIND_HISTORY_TABLE_ENTRY = _UNWIND_HISTORY_TABLE_ENTRY
  28626 type PUNWIND_HISTORY_TABLE_ENTRY = uintptr
  28627 
  28628 type _UNWIND_HISTORY_TABLE = struct {
  28629 	FCount       ULONG
  28630 	FLocalHint   BYTE
  28631 	FGlobalHint  BYTE
  28632 	FSearch      BYTE
  28633 	FOnce        BYTE
  28634 	FLowAddress  ULONG64
  28635 	FHighAddress ULONG64
  28636 	FEntry       [12]UNWIND_HISTORY_TABLE_ENTRY
  28637 }
  28638 
  28639 type UNWIND_HISTORY_TABLE = _UNWIND_HISTORY_TABLE
  28640 type PUNWIND_HISTORY_TABLE = uintptr
  28641 type DISPATCHER_CONTEXT = _DISPATCHER_CONTEXT
  28642 type PDISPATCHER_CONTEXT = uintptr
  28643 
  28644 type _KNONVOLATILE_CONTEXT_POINTERS = struct {
  28645 	FFloatingContext [16]PM128A
  28646 	FIntegerContext  [16]PULONG64
  28647 }
  28648 
  28649 type KNONVOLATILE_CONTEXT_POINTERS = _KNONVOLATILE_CONTEXT_POINTERS
  28650 type PKNONVOLATILE_CONTEXT_POINTERS = uintptr
  28651 
  28652 type PACCESS_TOKEN = PVOID
  28653 type PSECURITY_DESCRIPTOR = PVOID
  28654 type PSID = PVOID
  28655 type PCLAIMS_BLOB = PVOID
  28656 type ACCESS_MASK = DWORD
  28657 type PACCESS_MASK = uintptr
  28658 
  28659 type _GENERIC_MAPPING = struct {
  28660 	FGenericRead    ACCESS_MASK
  28661 	FGenericWrite   ACCESS_MASK
  28662 	FGenericExecute ACCESS_MASK
  28663 	FGenericAll     ACCESS_MASK
  28664 }
  28665 
  28666 type GENERIC_MAPPING = _GENERIC_MAPPING
  28667 type PGENERIC_MAPPING = uintptr
  28668 
  28669 type _LUID_AND_ATTRIBUTES = struct {
  28670 	FLuid       LUID
  28671 	FAttributes DWORD
  28672 }
  28673 
  28674 // *
  28675 // This file has no copyright assigned and is placed in the Public Domain.
  28676 // This file is part of the mingw-w64 runtime package.
  28677 // No warranty is given; refer to the file DISCLAIMER.PD within this package.
  28678 type LUID_AND_ATTRIBUTES = _LUID_AND_ATTRIBUTES
  28679 type PLUID_AND_ATTRIBUTES = uintptr
  28680 type LUID_AND_ATTRIBUTES_ARRAY = [1]LUID_AND_ATTRIBUTES
  28681 type PLUID_AND_ATTRIBUTES_ARRAY = uintptr
  28682 
  28683 type _SID_IDENTIFIER_AUTHORITY = struct{ FValue [6]BYTE }
  28684 
  28685 type SID_IDENTIFIER_AUTHORITY = _SID_IDENTIFIER_AUTHORITY
  28686 type PSID_IDENTIFIER_AUTHORITY = uintptr
  28687 
  28688 type _SID = struct {
  28689 	FRevision            BYTE
  28690 	FSubAuthorityCount   BYTE
  28691 	FIdentifierAuthority SID_IDENTIFIER_AUTHORITY
  28692 	FSubAuthority        [1]DWORD
  28693 }
  28694 
  28695 type SID = _SID
  28696 type PISID = uintptr
  28697 
  28698 type SID_NAME_USE = uint32
  28699 type PSID_NAME_USE = uintptr
  28700 
  28701 type _SID_AND_ATTRIBUTES = struct {
  28702 	FSid         PSID
  28703 	FAttributes  DWORD
  28704 	F__ccgo_pad1 [4]byte
  28705 }
  28706 
  28707 type SID_AND_ATTRIBUTES = _SID_AND_ATTRIBUTES
  28708 type PSID_AND_ATTRIBUTES = uintptr
  28709 
  28710 type SID_AND_ATTRIBUTES_ARRAY = [1]SID_AND_ATTRIBUTES
  28711 type PSID_AND_ATTRIBUTES_ARRAY = uintptr
  28712 
  28713 type SID_HASH_ENTRY = ULONG_PTR
  28714 type PSID_HASH_ENTRY = uintptr
  28715 
  28716 type _SID_AND_ATTRIBUTES_HASH = struct {
  28717 	FSidCount    DWORD
  28718 	F__ccgo_pad1 [4]byte
  28719 	FSidAttr     PSID_AND_ATTRIBUTES
  28720 	FHash        [32]SID_HASH_ENTRY
  28721 }
  28722 
  28723 type SID_AND_ATTRIBUTES_HASH = _SID_AND_ATTRIBUTES_HASH
  28724 type PSID_AND_ATTRIBUTES_HASH = uintptr
  28725 
  28726 type WELL_KNOWN_SID_TYPE = uint32
  28727 
  28728 type _ACL = struct {
  28729 	FAclRevision BYTE
  28730 	FSbz1        BYTE
  28731 	FAclSize     WORD
  28732 	FAceCount    WORD
  28733 	FSbz2        WORD
  28734 }
  28735 
  28736 type ACL = _ACL
  28737 type PACL = uintptr
  28738 
  28739 type _ACE_HEADER = struct {
  28740 	FAceType  BYTE
  28741 	FAceFlags BYTE
  28742 	FAceSize  WORD
  28743 }
  28744 
  28745 type ACE_HEADER = _ACE_HEADER
  28746 type PACE_HEADER = uintptr
  28747 
  28748 type _ACCESS_ALLOWED_ACE = struct {
  28749 	FHeader   ACE_HEADER
  28750 	FMask     ACCESS_MASK
  28751 	FSidStart DWORD
  28752 }
  28753 
  28754 type ACCESS_ALLOWED_ACE = _ACCESS_ALLOWED_ACE
  28755 
  28756 type PACCESS_ALLOWED_ACE = uintptr
  28757 
  28758 type _ACCESS_DENIED_ACE = struct {
  28759 	FHeader   ACE_HEADER
  28760 	FMask     ACCESS_MASK
  28761 	FSidStart DWORD
  28762 }
  28763 
  28764 type ACCESS_DENIED_ACE = _ACCESS_DENIED_ACE
  28765 type PACCESS_DENIED_ACE = uintptr
  28766 
  28767 type _SYSTEM_AUDIT_ACE = struct {
  28768 	FHeader   ACE_HEADER
  28769 	FMask     ACCESS_MASK
  28770 	FSidStart DWORD
  28771 }
  28772 
  28773 type SYSTEM_AUDIT_ACE = _SYSTEM_AUDIT_ACE
  28774 type PSYSTEM_AUDIT_ACE = uintptr
  28775 
  28776 type _SYSTEM_ALARM_ACE = struct {
  28777 	FHeader   ACE_HEADER
  28778 	FMask     ACCESS_MASK
  28779 	FSidStart DWORD
  28780 }
  28781 
  28782 type SYSTEM_ALARM_ACE = _SYSTEM_ALARM_ACE
  28783 type PSYSTEM_ALARM_ACE = uintptr
  28784 
  28785 type _SYSTEM_RESOURCE_ATTRIBUTE_ACE = struct {
  28786 	FHeader   ACE_HEADER
  28787 	FMask     ACCESS_MASK
  28788 	FSidStart DWORD
  28789 }
  28790 
  28791 type SYSTEM_RESOURCE_ATTRIBUTE_ACE = _SYSTEM_RESOURCE_ATTRIBUTE_ACE
  28792 type PSYSTEM_RESOURCE_ATTRIBUTE_ACE = uintptr
  28793 
  28794 type _SYSTEM_SCOPED_POLICY_ID_ACE = struct {
  28795 	FHeader   ACE_HEADER
  28796 	FMask     ACCESS_MASK
  28797 	FSidStart DWORD
  28798 }
  28799 
  28800 type SYSTEM_SCOPED_POLICY_ID_ACE = _SYSTEM_SCOPED_POLICY_ID_ACE
  28801 type PSYSTEM_SCOPED_POLICY_ID_ACE = uintptr
  28802 
  28803 type _SYSTEM_MANDATORY_LABEL_ACE = struct {
  28804 	FHeader   ACE_HEADER
  28805 	FMask     ACCESS_MASK
  28806 	FSidStart DWORD
  28807 }
  28808 
  28809 type SYSTEM_MANDATORY_LABEL_ACE = _SYSTEM_MANDATORY_LABEL_ACE
  28810 type PSYSTEM_MANDATORY_LABEL_ACE = uintptr
  28811 
  28812 type _ACCESS_ALLOWED_OBJECT_ACE = struct {
  28813 	FHeader              ACE_HEADER
  28814 	FMask                ACCESS_MASK
  28815 	FFlags               DWORD
  28816 	FObjectType          GUID
  28817 	FInheritedObjectType GUID
  28818 	FSidStart            DWORD
  28819 }
  28820 
  28821 type ACCESS_ALLOWED_OBJECT_ACE = _ACCESS_ALLOWED_OBJECT_ACE
  28822 type PACCESS_ALLOWED_OBJECT_ACE = uintptr
  28823 
  28824 type _ACCESS_DENIED_OBJECT_ACE = struct {
  28825 	FHeader              ACE_HEADER
  28826 	FMask                ACCESS_MASK
  28827 	FFlags               DWORD
  28828 	FObjectType          GUID
  28829 	FInheritedObjectType GUID
  28830 	FSidStart            DWORD
  28831 }
  28832 
  28833 type ACCESS_DENIED_OBJECT_ACE = _ACCESS_DENIED_OBJECT_ACE
  28834 type PACCESS_DENIED_OBJECT_ACE = uintptr
  28835 
  28836 type _SYSTEM_AUDIT_OBJECT_ACE = struct {
  28837 	FHeader              ACE_HEADER
  28838 	FMask                ACCESS_MASK
  28839 	FFlags               DWORD
  28840 	FObjectType          GUID
  28841 	FInheritedObjectType GUID
  28842 	FSidStart            DWORD
  28843 }
  28844 
  28845 type SYSTEM_AUDIT_OBJECT_ACE = _SYSTEM_AUDIT_OBJECT_ACE
  28846 type PSYSTEM_AUDIT_OBJECT_ACE = uintptr
  28847 
  28848 type _SYSTEM_ALARM_OBJECT_ACE = struct {
  28849 	FHeader              ACE_HEADER
  28850 	FMask                ACCESS_MASK
  28851 	FFlags               DWORD
  28852 	FObjectType          GUID
  28853 	FInheritedObjectType GUID
  28854 	FSidStart            DWORD
  28855 }
  28856 
  28857 type SYSTEM_ALARM_OBJECT_ACE = _SYSTEM_ALARM_OBJECT_ACE
  28858 type PSYSTEM_ALARM_OBJECT_ACE = uintptr
  28859 
  28860 type _ACCESS_ALLOWED_CALLBACK_ACE = struct {
  28861 	FHeader   ACE_HEADER
  28862 	FMask     ACCESS_MASK
  28863 	FSidStart DWORD
  28864 }
  28865 
  28866 type ACCESS_ALLOWED_CALLBACK_ACE = _ACCESS_ALLOWED_CALLBACK_ACE
  28867 type PACCESS_ALLOWED_CALLBACK_ACE = uintptr
  28868 
  28869 type _ACCESS_DENIED_CALLBACK_ACE = struct {
  28870 	FHeader   ACE_HEADER
  28871 	FMask     ACCESS_MASK
  28872 	FSidStart DWORD
  28873 }
  28874 
  28875 type ACCESS_DENIED_CALLBACK_ACE = _ACCESS_DENIED_CALLBACK_ACE
  28876 type PACCESS_DENIED_CALLBACK_ACE = uintptr
  28877 
  28878 type _SYSTEM_AUDIT_CALLBACK_ACE = struct {
  28879 	FHeader   ACE_HEADER
  28880 	FMask     ACCESS_MASK
  28881 	FSidStart DWORD
  28882 }
  28883 
  28884 type SYSTEM_AUDIT_CALLBACK_ACE = _SYSTEM_AUDIT_CALLBACK_ACE
  28885 type PSYSTEM_AUDIT_CALLBACK_ACE = uintptr
  28886 
  28887 type _SYSTEM_ALARM_CALLBACK_ACE = struct {
  28888 	FHeader   ACE_HEADER
  28889 	FMask     ACCESS_MASK
  28890 	FSidStart DWORD
  28891 }
  28892 
  28893 type SYSTEM_ALARM_CALLBACK_ACE = _SYSTEM_ALARM_CALLBACK_ACE
  28894 type PSYSTEM_ALARM_CALLBACK_ACE = uintptr
  28895 
  28896 type _ACCESS_ALLOWED_CALLBACK_OBJECT_ACE = struct {
  28897 	FHeader              ACE_HEADER
  28898 	FMask                ACCESS_MASK
  28899 	FFlags               DWORD
  28900 	FObjectType          GUID
  28901 	FInheritedObjectType GUID
  28902 	FSidStart            DWORD
  28903 }
  28904 
  28905 type ACCESS_ALLOWED_CALLBACK_OBJECT_ACE = _ACCESS_ALLOWED_CALLBACK_OBJECT_ACE
  28906 type PACCESS_ALLOWED_CALLBACK_OBJECT_ACE = uintptr
  28907 
  28908 type _ACCESS_DENIED_CALLBACK_OBJECT_ACE = struct {
  28909 	FHeader              ACE_HEADER
  28910 	FMask                ACCESS_MASK
  28911 	FFlags               DWORD
  28912 	FObjectType          GUID
  28913 	FInheritedObjectType GUID
  28914 	FSidStart            DWORD
  28915 }
  28916 
  28917 type ACCESS_DENIED_CALLBACK_OBJECT_ACE = _ACCESS_DENIED_CALLBACK_OBJECT_ACE
  28918 type PACCESS_DENIED_CALLBACK_OBJECT_ACE = uintptr
  28919 
  28920 type _SYSTEM_AUDIT_CALLBACK_OBJECT_ACE = struct {
  28921 	FHeader              ACE_HEADER
  28922 	FMask                ACCESS_MASK
  28923 	FFlags               DWORD
  28924 	FObjectType          GUID
  28925 	FInheritedObjectType GUID
  28926 	FSidStart            DWORD
  28927 }
  28928 
  28929 type SYSTEM_AUDIT_CALLBACK_OBJECT_ACE = _SYSTEM_AUDIT_CALLBACK_OBJECT_ACE
  28930 type PSYSTEM_AUDIT_CALLBACK_OBJECT_ACE = uintptr
  28931 
  28932 type _SYSTEM_ALARM_CALLBACK_OBJECT_ACE = struct {
  28933 	FHeader              ACE_HEADER
  28934 	FMask                ACCESS_MASK
  28935 	FFlags               DWORD
  28936 	FObjectType          GUID
  28937 	FInheritedObjectType GUID
  28938 	FSidStart            DWORD
  28939 }
  28940 
  28941 type SYSTEM_ALARM_CALLBACK_OBJECT_ACE = _SYSTEM_ALARM_CALLBACK_OBJECT_ACE
  28942 type PSYSTEM_ALARM_CALLBACK_OBJECT_ACE = uintptr
  28943 
  28944 type ACL_INFORMATION_CLASS = uint32
  28945 
  28946 type _ACL_REVISION_INFORMATION = struct{ FAclRevision DWORD }
  28947 
  28948 type ACL_REVISION_INFORMATION = _ACL_REVISION_INFORMATION
  28949 type PACL_REVISION_INFORMATION = uintptr
  28950 
  28951 type _ACL_SIZE_INFORMATION = struct {
  28952 	FAceCount      DWORD
  28953 	FAclBytesInUse DWORD
  28954 	FAclBytesFree  DWORD
  28955 }
  28956 
  28957 type ACL_SIZE_INFORMATION = _ACL_SIZE_INFORMATION
  28958 type PACL_SIZE_INFORMATION = uintptr
  28959 
  28960 type SECURITY_DESCRIPTOR_CONTROL = WORD
  28961 type PSECURITY_DESCRIPTOR_CONTROL = uintptr
  28962 
  28963 type _SECURITY_DESCRIPTOR_RELATIVE = struct {
  28964 	FRevision BYTE
  28965 	FSbz1     BYTE
  28966 	FControl  SECURITY_DESCRIPTOR_CONTROL
  28967 	FOwner    DWORD
  28968 	FGroup    DWORD
  28969 	FSacl     DWORD
  28970 	FDacl     DWORD
  28971 }
  28972 
  28973 type SECURITY_DESCRIPTOR_RELATIVE = _SECURITY_DESCRIPTOR_RELATIVE
  28974 type PISECURITY_DESCRIPTOR_RELATIVE = uintptr
  28975 
  28976 type _SECURITY_DESCRIPTOR = struct {
  28977 	FRevision    BYTE
  28978 	FSbz1        BYTE
  28979 	FControl     SECURITY_DESCRIPTOR_CONTROL
  28980 	F__ccgo_pad1 [4]byte
  28981 	FOwner       PSID
  28982 	FGroup       PSID
  28983 	FSacl        PACL
  28984 	FDacl        PACL
  28985 }
  28986 
  28987 type SECURITY_DESCRIPTOR = _SECURITY_DESCRIPTOR
  28988 type PISECURITY_DESCRIPTOR = uintptr
  28989 
  28990 type _OBJECT_TYPE_LIST = struct {
  28991 	FLevel       WORD
  28992 	FSbz         WORD
  28993 	F__ccgo_pad1 [4]byte
  28994 	FObjectType  uintptr
  28995 }
  28996 
  28997 type OBJECT_TYPE_LIST = _OBJECT_TYPE_LIST
  28998 type POBJECT_TYPE_LIST = uintptr
  28999 
  29000 type AUDIT_EVENT_TYPE = uint32
  29001 type PAUDIT_EVENT_TYPE = uintptr
  29002 
  29003 type _PRIVILEGE_SET = struct {
  29004 	FPrivilegeCount DWORD
  29005 	FControl        DWORD
  29006 	FPrivilege      [1]LUID_AND_ATTRIBUTES
  29007 }
  29008 
  29009 type PRIVILEGE_SET = _PRIVILEGE_SET
  29010 type PPRIVILEGE_SET = uintptr
  29011 
  29012 type ACCESS_REASON_TYPE = uint32
  29013 type ACCESS_REASON = DWORD
  29014 
  29015 type _ACCESS_REASONS = struct{ FData [32]ACCESS_REASON }
  29016 
  29017 type ACCESS_REASONS = _ACCESS_REASONS
  29018 type PACCESS_REASONS = uintptr
  29019 
  29020 type _SE_SECURITY_DESCRIPTOR = struct {
  29021 	FSize               DWORD
  29022 	FFlags              DWORD
  29023 	FSecurityDescriptor PSECURITY_DESCRIPTOR
  29024 }
  29025 
  29026 type SE_SECURITY_DESCRIPTOR = _SE_SECURITY_DESCRIPTOR
  29027 type PSE_SECURITY_DESCRIPTOR = uintptr
  29028 
  29029 type _SE_ACCESS_REQUEST = struct {
  29030 	FSize                    DWORD
  29031 	F__ccgo_pad1             [4]byte
  29032 	FSeSecurityDescriptor    PSE_SECURITY_DESCRIPTOR
  29033 	FDesiredAccess           ACCESS_MASK
  29034 	FPreviouslyGrantedAccess ACCESS_MASK
  29035 	FPrincipalSelfSid        PSID
  29036 	FGenericMapping          PGENERIC_MAPPING
  29037 	FObjectTypeListCount     DWORD
  29038 	F__ccgo_pad2             [4]byte
  29039 	FObjectTypeList          POBJECT_TYPE_LIST
  29040 }
  29041 
  29042 type SE_ACCESS_REQUEST = _SE_ACCESS_REQUEST
  29043 type PSE_ACCESS_REQUEST = uintptr
  29044 
  29045 type _SE_ACCESS_REPLY = struct {
  29046 	FSize            DWORD
  29047 	FResultListCount DWORD
  29048 	FGrantedAccess   PACCESS_MASK
  29049 	FAccessStatus    PDWORD
  29050 	FAccessReason    PACCESS_REASONS
  29051 	FPrivileges      uintptr
  29052 }
  29053 
  29054 type SE_ACCESS_REPLY = _SE_ACCESS_REPLY
  29055 type PSE_ACCESS_REPLY = uintptr
  29056 
  29057 type SECURITY_IMPERSONATION_LEVEL = uint32
  29058 type PSECURITY_IMPERSONATION_LEVEL = uintptr
  29059 
  29060 type TOKEN_TYPE = uint32
  29061 type PTOKEN_TYPE = uintptr
  29062 
  29063 type TOKEN_ELEVATION_TYPE = uint32
  29064 type PTOKEN_ELEVATION_TYPE = uintptr
  29065 
  29066 type TOKEN_INFORMATION_CLASS = uint32
  29067 type PTOKEN_INFORMATION_CLASS = uintptr
  29068 
  29069 type _TOKEN_USER = struct{ FUser SID_AND_ATTRIBUTES }
  29070 
  29071 type TOKEN_USER = _TOKEN_USER
  29072 type PTOKEN_USER = uintptr
  29073 
  29074 type _TOKEN_GROUPS = struct {
  29075 	FGroupCount  DWORD
  29076 	F__ccgo_pad1 [4]byte
  29077 	FGroups      [1]SID_AND_ATTRIBUTES
  29078 }
  29079 
  29080 type TOKEN_GROUPS = _TOKEN_GROUPS
  29081 type PTOKEN_GROUPS = uintptr
  29082 
  29083 type _TOKEN_PRIVILEGES = struct {
  29084 	FPrivilegeCount DWORD
  29085 	FPrivileges     [1]LUID_AND_ATTRIBUTES
  29086 }
  29087 
  29088 type TOKEN_PRIVILEGES = _TOKEN_PRIVILEGES
  29089 type PTOKEN_PRIVILEGES = uintptr
  29090 
  29091 type _TOKEN_OWNER = struct{ FOwner PSID }
  29092 
  29093 type TOKEN_OWNER = _TOKEN_OWNER
  29094 type PTOKEN_OWNER = uintptr
  29095 
  29096 type _TOKEN_PRIMARY_GROUP = struct{ FPrimaryGroup PSID }
  29097 
  29098 type TOKEN_PRIMARY_GROUP = _TOKEN_PRIMARY_GROUP
  29099 type PTOKEN_PRIMARY_GROUP = uintptr
  29100 
  29101 type _TOKEN_DEFAULT_DACL = struct{ FDefaultDacl PACL }
  29102 
  29103 type TOKEN_DEFAULT_DACL = _TOKEN_DEFAULT_DACL
  29104 type PTOKEN_DEFAULT_DACL = uintptr
  29105 
  29106 type _TOKEN_USER_CLAIMS = struct{ FUserClaims PCLAIMS_BLOB }
  29107 
  29108 type TOKEN_USER_CLAIMS = _TOKEN_USER_CLAIMS
  29109 type PTOKEN_USER_CLAIMS = uintptr
  29110 
  29111 type _TOKEN_DEVICE_CLAIMS = struct{ FDeviceClaims PCLAIMS_BLOB }
  29112 
  29113 type TOKEN_DEVICE_CLAIMS = _TOKEN_DEVICE_CLAIMS
  29114 type PTOKEN_DEVICE_CLAIMS = uintptr
  29115 
  29116 type _TOKEN_GROUPS_AND_PRIVILEGES = struct {
  29117 	FSidCount            DWORD
  29118 	FSidLength           DWORD
  29119 	FSids                PSID_AND_ATTRIBUTES
  29120 	FRestrictedSidCount  DWORD
  29121 	FRestrictedSidLength DWORD
  29122 	FRestrictedSids      PSID_AND_ATTRIBUTES
  29123 	FPrivilegeCount      DWORD
  29124 	FPrivilegeLength     DWORD
  29125 	FPrivileges          PLUID_AND_ATTRIBUTES
  29126 	FAuthenticationId    LUID
  29127 }
  29128 
  29129 type TOKEN_GROUPS_AND_PRIVILEGES = _TOKEN_GROUPS_AND_PRIVILEGES
  29130 type PTOKEN_GROUPS_AND_PRIVILEGES = uintptr
  29131 
  29132 type _TOKEN_LINKED_TOKEN = struct{ FLinkedToken HANDLE }
  29133 
  29134 type TOKEN_LINKED_TOKEN = _TOKEN_LINKED_TOKEN
  29135 type PTOKEN_LINKED_TOKEN = uintptr
  29136 
  29137 type _TOKEN_ELEVATION = struct{ FTokenIsElevated DWORD }
  29138 
  29139 type TOKEN_ELEVATION = _TOKEN_ELEVATION
  29140 type PTOKEN_ELEVATION = uintptr
  29141 
  29142 type _TOKEN_MANDATORY_LABEL = struct{ FLabel SID_AND_ATTRIBUTES }
  29143 
  29144 type TOKEN_MANDATORY_LABEL = _TOKEN_MANDATORY_LABEL
  29145 type PTOKEN_MANDATORY_LABEL = uintptr
  29146 
  29147 type _TOKEN_MANDATORY_POLICY = struct{ FPolicy DWORD }
  29148 
  29149 type TOKEN_MANDATORY_POLICY = _TOKEN_MANDATORY_POLICY
  29150 type PTOKEN_MANDATORY_POLICY = uintptr
  29151 
  29152 type _TOKEN_ACCESS_INFORMATION = struct {
  29153 	FSidHash            PSID_AND_ATTRIBUTES_HASH
  29154 	FRestrictedSidHash  PSID_AND_ATTRIBUTES_HASH
  29155 	FPrivileges         PTOKEN_PRIVILEGES
  29156 	FAuthenticationId   LUID
  29157 	FTokenType          TOKEN_TYPE
  29158 	FImpersonationLevel SECURITY_IMPERSONATION_LEVEL
  29159 	FMandatoryPolicy    TOKEN_MANDATORY_POLICY
  29160 	FFlags              DWORD
  29161 	FAppContainerNumber DWORD
  29162 	F__ccgo_pad1        [4]byte
  29163 	FPackageSid         PSID
  29164 	FCapabilitiesHash   PSID_AND_ATTRIBUTES_HASH
  29165 }
  29166 
  29167 type TOKEN_ACCESS_INFORMATION = _TOKEN_ACCESS_INFORMATION
  29168 type PTOKEN_ACCESS_INFORMATION = uintptr
  29169 
  29170 type _TOKEN_AUDIT_POLICY = struct{ FPerUserPolicy [29]UCHAR }
  29171 
  29172 type TOKEN_AUDIT_POLICY = _TOKEN_AUDIT_POLICY
  29173 type PTOKEN_AUDIT_POLICY = uintptr
  29174 
  29175 type _TOKEN_SOURCE = struct {
  29176 	FSourceName       [8]CHAR
  29177 	FSourceIdentifier LUID
  29178 }
  29179 
  29180 type TOKEN_SOURCE = _TOKEN_SOURCE
  29181 type PTOKEN_SOURCE = uintptr
  29182 
  29183 type _TOKEN_STATISTICS = struct {
  29184 	FTokenId            LUID
  29185 	FAuthenticationId   LUID
  29186 	FExpirationTime     LARGE_INTEGER
  29187 	FTokenType          TOKEN_TYPE
  29188 	FImpersonationLevel SECURITY_IMPERSONATION_LEVEL
  29189 	FDynamicCharged     DWORD
  29190 	FDynamicAvailable   DWORD
  29191 	FGroupCount         DWORD
  29192 	FPrivilegeCount     DWORD
  29193 	FModifiedId         LUID
  29194 }
  29195 
  29196 type TOKEN_STATISTICS = _TOKEN_STATISTICS
  29197 type PTOKEN_STATISTICS = uintptr
  29198 
  29199 type _TOKEN_CONTROL = struct {
  29200 	FTokenId          LUID
  29201 	FAuthenticationId LUID
  29202 	FModifiedId       LUID
  29203 	FTokenSource      TOKEN_SOURCE
  29204 }
  29205 
  29206 type TOKEN_CONTROL = _TOKEN_CONTROL
  29207 type PTOKEN_CONTROL = uintptr
  29208 
  29209 type _TOKEN_ORIGIN = struct{ FOriginatingLogonSession LUID }
  29210 
  29211 type TOKEN_ORIGIN = _TOKEN_ORIGIN
  29212 type PTOKEN_ORIGIN = uintptr
  29213 
  29214 type MANDATORY_LEVEL = uint32
  29215 type PMANDATORY_LEVEL = uintptr
  29216 
  29217 type _TOKEN_APPCONTAINER_INFORMATION = struct{ FTokenAppContainer PSID }
  29218 
  29219 type TOKEN_APPCONTAINER_INFORMATION = _TOKEN_APPCONTAINER_INFORMATION
  29220 type PTOKEN_APPCONTAINER_INFORMATION = uintptr
  29221 
  29222 type _CLAIM_SECURITY_ATTRIBUTE_FQBN_VALUE = struct {
  29223 	FVersion DWORD64
  29224 	FName    PWSTR
  29225 }
  29226 
  29227 type CLAIM_SECURITY_ATTRIBUTE_FQBN_VALUE = _CLAIM_SECURITY_ATTRIBUTE_FQBN_VALUE
  29228 type PCLAIM_SECURITY_ATTRIBUTE_FQBN_VALUE = uintptr
  29229 
  29230 type _CLAIM_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE = struct {
  29231 	FpValue      PVOID
  29232 	FValueLength DWORD
  29233 	F__ccgo_pad1 [4]byte
  29234 }
  29235 
  29236 type CLAIM_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE = _CLAIM_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE
  29237 type PCLAIM_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE = uintptr
  29238 
  29239 type _CLAIM_SECURITY_ATTRIBUTE_V1 = struct {
  29240 	FName        PWSTR
  29241 	FValueType   WORD
  29242 	FReserved    WORD
  29243 	FFlags       DWORD
  29244 	FValueCount  DWORD
  29245 	F__ccgo_pad1 [4]byte
  29246 	FValues      struct{ FpInt64 PLONG64 }
  29247 }
  29248 
  29249 type CLAIM_SECURITY_ATTRIBUTE_V1 = _CLAIM_SECURITY_ATTRIBUTE_V1
  29250 type PCLAIM_SECURITY_ATTRIBUTE_V1 = uintptr
  29251 
  29252 type _CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 = struct {
  29253 	FName       DWORD
  29254 	FValueType  WORD
  29255 	FReserved   WORD
  29256 	FFlags      DWORD
  29257 	FValueCount DWORD
  29258 	FValues     struct{ FpInt64 [1]DWORD }
  29259 }
  29260 
  29261 type CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 = _CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1
  29262 type PCLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 = uintptr
  29263 
  29264 type _CLAIM_SECURITY_ATTRIBUTES_INFORMATION = struct {
  29265 	FVersion        WORD
  29266 	FReserved       WORD
  29267 	FAttributeCount DWORD
  29268 	FAttribute      struct{ FpAttributeV1 PCLAIM_SECURITY_ATTRIBUTE_V1 }
  29269 }
  29270 
  29271 type CLAIM_SECURITY_ATTRIBUTES_INFORMATION = _CLAIM_SECURITY_ATTRIBUTES_INFORMATION
  29272 type PCLAIM_SECURITY_ATTRIBUTES_INFORMATION = uintptr
  29273 
  29274 type SECURITY_CONTEXT_TRACKING_MODE = BOOLEAN
  29275 type PSECURITY_CONTEXT_TRACKING_MODE = uintptr
  29276 
  29277 type _SECURITY_QUALITY_OF_SERVICE = struct {
  29278 	FLength              DWORD
  29279 	FImpersonationLevel  SECURITY_IMPERSONATION_LEVEL
  29280 	FContextTrackingMode SECURITY_CONTEXT_TRACKING_MODE
  29281 	FEffectiveOnly       BOOLEAN
  29282 	F__ccgo_pad1         [2]byte
  29283 }
  29284 
  29285 type SECURITY_QUALITY_OF_SERVICE = _SECURITY_QUALITY_OF_SERVICE
  29286 type PSECURITY_QUALITY_OF_SERVICE = uintptr
  29287 
  29288 type _SE_IMPERSONATION_STATE = struct {
  29289 	FToken         PACCESS_TOKEN
  29290 	FCopyOnOpen    BOOLEAN
  29291 	FEffectiveOnly BOOLEAN
  29292 	F__ccgo_pad1   [2]byte
  29293 	FLevel         SECURITY_IMPERSONATION_LEVEL
  29294 }
  29295 
  29296 type SE_IMPERSONATION_STATE = _SE_IMPERSONATION_STATE
  29297 type PSE_IMPERSONATION_STATE = uintptr
  29298 
  29299 type SECURITY_INFORMATION = DWORD
  29300 type PSECURITY_INFORMATION = uintptr
  29301 
  29302 type SE_LEARNING_MODE_DATA_TYPE = uint32
  29303 
  29304 type _SECURITY_CAPABILITIES = struct {
  29305 	FAppContainerSid PSID
  29306 	FCapabilities    PSID_AND_ATTRIBUTES
  29307 	FCapabilityCount DWORD
  29308 	FReserved        DWORD
  29309 }
  29310 
  29311 type SECURITY_CAPABILITIES = _SECURITY_CAPABILITIES
  29312 type PSECURITY_CAPABILITIES = uintptr
  29313 type LPSECURITY_CAPABILITIES = uintptr
  29314 
  29315 type _JOB_SET_ARRAY = struct {
  29316 	FJobHandle   HANDLE
  29317 	FMemberLevel DWORD
  29318 	FFlags       DWORD
  29319 }
  29320 
  29321 type JOB_SET_ARRAY = _JOB_SET_ARRAY
  29322 type PJOB_SET_ARRAY = uintptr
  29323 
  29324 type _EXCEPTION_REGISTRATION_RECORD = struct {
  29325 	F__0 struct{ FNext uintptr }
  29326 	F__8 struct{ FHandler PEXCEPTION_ROUTINE }
  29327 }
  29328 
  29329 type EXCEPTION_REGISTRATION_RECORD = _EXCEPTION_REGISTRATION_RECORD
  29330 
  29331 type PEXCEPTION_REGISTRATION_RECORD = uintptr
  29332 
  29333 type EXCEPTION_REGISTRATION = EXCEPTION_REGISTRATION_RECORD
  29334 type PEXCEPTION_REGISTRATION = PEXCEPTION_REGISTRATION_RECORD
  29335 
  29336 type _NT_TIB = struct {
  29337 	FExceptionList        uintptr
  29338 	FStackBase            PVOID
  29339 	FStackLimit           PVOID
  29340 	FSubSystemTib         PVOID
  29341 	F__32                 struct{ FFiberData PVOID }
  29342 	FArbitraryUserPointer PVOID
  29343 	FSelf                 uintptr
  29344 }
  29345 
  29346 type NT_TIB = _NT_TIB
  29347 type PNT_TIB = uintptr
  29348 
  29349 type _NT_TIB32 = struct {
  29350 	FExceptionList        DWORD
  29351 	FStackBase            DWORD
  29352 	FStackLimit           DWORD
  29353 	FSubSystemTib         DWORD
  29354 	F__16                 struct{ FFiberData DWORD }
  29355 	FArbitraryUserPointer DWORD
  29356 	FSelf                 DWORD
  29357 }
  29358 
  29359 type NT_TIB32 = _NT_TIB32
  29360 type PNT_TIB32 = uintptr
  29361 
  29362 type _NT_TIB64 = struct {
  29363 	FExceptionList        DWORD64
  29364 	FStackBase            DWORD64
  29365 	FStackLimit           DWORD64
  29366 	FSubSystemTib         DWORD64
  29367 	F__32                 struct{ FFiberData DWORD64 }
  29368 	FArbitraryUserPointer DWORD64
  29369 	FSelf                 DWORD64
  29370 }
  29371 
  29372 type NT_TIB64 = _NT_TIB64
  29373 type PNT_TIB64 = uintptr
  29374 
  29375 type _UMS_CREATE_THREAD_ATTRIBUTES = struct {
  29376 	FUmsVersion        DWORD
  29377 	F__ccgo_pad1       [4]byte
  29378 	FUmsContext        PVOID
  29379 	FUmsCompletionList PVOID
  29380 }
  29381 
  29382 type UMS_CREATE_THREAD_ATTRIBUTES = _UMS_CREATE_THREAD_ATTRIBUTES
  29383 type PUMS_CREATE_THREAD_ATTRIBUTES = uintptr
  29384 
  29385 type _QUOTA_LIMITS = struct {
  29386 	FPagedPoolLimit        SIZE_T
  29387 	FNonPagedPoolLimit     SIZE_T
  29388 	FMinimumWorkingSetSize SIZE_T
  29389 	FMaximumWorkingSetSize SIZE_T
  29390 	FPagefileLimit         SIZE_T
  29391 	FTimeLimit             LARGE_INTEGER
  29392 }
  29393 
  29394 type QUOTA_LIMITS = _QUOTA_LIMITS
  29395 type PQUOTA_LIMITS = uintptr
  29396 
  29397 type _RATE_QUOTA_LIMIT = struct{ FRateData DWORD }
  29398 
  29399 type RATE_QUOTA_LIMIT = _RATE_QUOTA_LIMIT
  29400 type PRATE_QUOTA_LIMIT = uintptr
  29401 
  29402 type _QUOTA_LIMITS_EX = struct {
  29403 	FPagedPoolLimit        SIZE_T
  29404 	FNonPagedPoolLimit     SIZE_T
  29405 	FMinimumWorkingSetSize SIZE_T
  29406 	FMaximumWorkingSetSize SIZE_T
  29407 	FPagefileLimit         SIZE_T
  29408 	FTimeLimit             LARGE_INTEGER
  29409 	FWorkingSetLimit       SIZE_T
  29410 	FReserved2             SIZE_T
  29411 	FReserved3             SIZE_T
  29412 	FReserved4             SIZE_T
  29413 	FFlags                 DWORD
  29414 	FCpuRateLimit          RATE_QUOTA_LIMIT
  29415 }
  29416 
  29417 type QUOTA_LIMITS_EX = _QUOTA_LIMITS_EX
  29418 type PQUOTA_LIMITS_EX = uintptr
  29419 
  29420 type _IO_COUNTERS = struct {
  29421 	FReadOperationCount  ULONGLONG
  29422 	FWriteOperationCount ULONGLONG
  29423 	FOtherOperationCount ULONGLONG
  29424 	FReadTransferCount   ULONGLONG
  29425 	FWriteTransferCount  ULONGLONG
  29426 	FOtherTransferCount  ULONGLONG
  29427 }
  29428 
  29429 type IO_COUNTERS = _IO_COUNTERS
  29430 type PIO_COUNTERS = uintptr
  29431 
  29432 type HARDWARE_COUNTER_TYPE = uint32
  29433 type PHARDWARE_COUNTER_TYPE = uintptr
  29434 
  29435 type PROCESS_MITIGATION_POLICY = uint32
  29436 type PPROCESS_MITIGATION_POLICY = uintptr
  29437 
  29438 type _PROCESS_MITIGATION_ASLR_POLICY = struct{ F__0 struct{ FFlags DWORD } }
  29439 
  29440 type PROCESS_MITIGATION_ASLR_POLICY = _PROCESS_MITIGATION_ASLR_POLICY
  29441 type PPROCESS_MITIGATION_ASLR_POLICY = uintptr
  29442 
  29443 type _PROCESS_MITIGATION_DEP_POLICY = struct {
  29444 	F__0         struct{ FFlags DWORD }
  29445 	FPermanent   BOOLEAN
  29446 	F__ccgo_pad1 [3]byte
  29447 }
  29448 
  29449 type PROCESS_MITIGATION_DEP_POLICY = _PROCESS_MITIGATION_DEP_POLICY
  29450 type PPROCESS_MITIGATION_DEP_POLICY = uintptr
  29451 
  29452 type _PROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY = struct{ F__0 struct{ FFlags DWORD } }
  29453 
  29454 type PROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY = _PROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY
  29455 type PPROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY = uintptr
  29456 
  29457 type _PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY = struct{ F__0 struct{ FFlags DWORD } }
  29458 
  29459 type PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY = _PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY
  29460 type PPROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY = uintptr
  29461 
  29462 type _PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY = struct{ F__0 struct{ FFlags DWORD } }
  29463 
  29464 type PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY = _PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY
  29465 type PPROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY = uintptr
  29466 
  29467 type _PROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY = struct{ F__0 struct{ FFlags DWORD } }
  29468 
  29469 type PROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY = _PROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY
  29470 type PPROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY = uintptr
  29471 
  29472 type _PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY = struct{ F__0 struct{ FFlags DWORD } }
  29473 
  29474 type PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY = _PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY
  29475 type PPROCESS_MITIGATION_BINARY_SIGNATURE_POLICY = uintptr
  29476 
  29477 type _PROCESS_MITIGATION_DYNAMIC_CODE_POLICY = struct {
  29478 	F__0 struct {
  29479 		FFlags       DWORD
  29480 		F__ccgo_pad1 [4]byte
  29481 	}
  29482 }
  29483 
  29484 type PROCESS_MITIGATION_DYNAMIC_CODE_POLICY = _PROCESS_MITIGATION_DYNAMIC_CODE_POLICY
  29485 type PPROCESS_MITIGATION_DYNAMIC_CODE_POLICY = uintptr
  29486 
  29487 type _PROCESS_MITIGATION_FONT_DISABLE_POLICY = struct{ F__0 struct{ FFlags DWORD } }
  29488 
  29489 type PROCESS_MITIGATION_FONT_DISABLE_POLICY = _PROCESS_MITIGATION_FONT_DISABLE_POLICY
  29490 type PPROCESS_MITIGATION_FONT_DISABLE_POLICY = uintptr
  29491 
  29492 type _PROCESS_MITIGATION_IMAGE_LOAD_POLICY = struct{ F__0 struct{ FFlags DWORD } }
  29493 
  29494 type PROCESS_MITIGATION_IMAGE_LOAD_POLICY = _PROCESS_MITIGATION_IMAGE_LOAD_POLICY
  29495 type PPROCESS_MITIGATION_IMAGE_LOAD_POLICY = uintptr
  29496 
  29497 type _JOBOBJECT_BASIC_ACCOUNTING_INFORMATION = struct {
  29498 	FTotalUserTime             LARGE_INTEGER
  29499 	FTotalKernelTime           LARGE_INTEGER
  29500 	FThisPeriodTotalUserTime   LARGE_INTEGER
  29501 	FThisPeriodTotalKernelTime LARGE_INTEGER
  29502 	FTotalPageFaultCount       DWORD
  29503 	FTotalProcesses            DWORD
  29504 	FActiveProcesses           DWORD
  29505 	FTotalTerminatedProcesses  DWORD
  29506 }
  29507 
  29508 type JOBOBJECT_BASIC_ACCOUNTING_INFORMATION = _JOBOBJECT_BASIC_ACCOUNTING_INFORMATION
  29509 type PJOBOBJECT_BASIC_ACCOUNTING_INFORMATION = uintptr
  29510 
  29511 type _JOBOBJECT_BASIC_LIMIT_INFORMATION = struct {
  29512 	FPerProcessUserTimeLimit LARGE_INTEGER
  29513 	FPerJobUserTimeLimit     LARGE_INTEGER
  29514 	FLimitFlags              DWORD
  29515 	F__ccgo_pad1             [4]byte
  29516 	FMinimumWorkingSetSize   SIZE_T
  29517 	FMaximumWorkingSetSize   SIZE_T
  29518 	FActiveProcessLimit      DWORD
  29519 	F__ccgo_pad2             [4]byte
  29520 	FAffinity                ULONG_PTR
  29521 	FPriorityClass           DWORD
  29522 	FSchedulingClass         DWORD
  29523 }
  29524 
  29525 type JOBOBJECT_BASIC_LIMIT_INFORMATION = _JOBOBJECT_BASIC_LIMIT_INFORMATION
  29526 type PJOBOBJECT_BASIC_LIMIT_INFORMATION = uintptr
  29527 
  29528 type _JOBOBJECT_EXTENDED_LIMIT_INFORMATION = struct {
  29529 	FBasicLimitInformation JOBOBJECT_BASIC_LIMIT_INFORMATION
  29530 	FIoInfo                IO_COUNTERS
  29531 	FProcessMemoryLimit    SIZE_T
  29532 	FJobMemoryLimit        SIZE_T
  29533 	FPeakProcessMemoryUsed SIZE_T
  29534 	FPeakJobMemoryUsed     SIZE_T
  29535 }
  29536 
  29537 type JOBOBJECT_EXTENDED_LIMIT_INFORMATION = _JOBOBJECT_EXTENDED_LIMIT_INFORMATION
  29538 type PJOBOBJECT_EXTENDED_LIMIT_INFORMATION = uintptr
  29539 
  29540 type _JOBOBJECT_BASIC_PROCESS_ID_LIST = struct {
  29541 	FNumberOfAssignedProcesses DWORD
  29542 	FNumberOfProcessIdsInList  DWORD
  29543 	FProcessIdList             [1]ULONG_PTR
  29544 }
  29545 
  29546 type JOBOBJECT_BASIC_PROCESS_ID_LIST = _JOBOBJECT_BASIC_PROCESS_ID_LIST
  29547 type PJOBOBJECT_BASIC_PROCESS_ID_LIST = uintptr
  29548 
  29549 type _JOBOBJECT_BASIC_UI_RESTRICTIONS = struct{ FUIRestrictionsClass DWORD }
  29550 
  29551 type JOBOBJECT_BASIC_UI_RESTRICTIONS = _JOBOBJECT_BASIC_UI_RESTRICTIONS
  29552 type PJOBOBJECT_BASIC_UI_RESTRICTIONS = uintptr
  29553 
  29554 type _JOBOBJECT_SECURITY_LIMIT_INFORMATION = struct {
  29555 	FSecurityLimitFlags DWORD
  29556 	F__ccgo_pad1        [4]byte
  29557 	FJobToken           HANDLE
  29558 	FSidsToDisable      PTOKEN_GROUPS
  29559 	FPrivilegesToDelete PTOKEN_PRIVILEGES
  29560 	FRestrictedSids     PTOKEN_GROUPS
  29561 }
  29562 
  29563 type JOBOBJECT_SECURITY_LIMIT_INFORMATION = _JOBOBJECT_SECURITY_LIMIT_INFORMATION
  29564 type PJOBOBJECT_SECURITY_LIMIT_INFORMATION = uintptr
  29565 
  29566 type _JOBOBJECT_END_OF_JOB_TIME_INFORMATION = struct{ FEndOfJobTimeAction DWORD }
  29567 
  29568 type JOBOBJECT_END_OF_JOB_TIME_INFORMATION = _JOBOBJECT_END_OF_JOB_TIME_INFORMATION
  29569 type PJOBOBJECT_END_OF_JOB_TIME_INFORMATION = uintptr
  29570 
  29571 type _JOBOBJECT_ASSOCIATE_COMPLETION_PORT = struct {
  29572 	FCompletionKey  PVOID
  29573 	FCompletionPort HANDLE
  29574 }
  29575 
  29576 type JOBOBJECT_ASSOCIATE_COMPLETION_PORT = _JOBOBJECT_ASSOCIATE_COMPLETION_PORT
  29577 type PJOBOBJECT_ASSOCIATE_COMPLETION_PORT = uintptr
  29578 
  29579 type _JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION = struct {
  29580 	FBasicInfo JOBOBJECT_BASIC_ACCOUNTING_INFORMATION
  29581 	FIoInfo    IO_COUNTERS
  29582 }
  29583 
  29584 type JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION = _JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION
  29585 type PJOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION = uintptr
  29586 
  29587 type _JOBOBJECT_JOBSET_INFORMATION = struct{ FMemberLevel DWORD }
  29588 
  29589 type JOBOBJECT_JOBSET_INFORMATION = _JOBOBJECT_JOBSET_INFORMATION
  29590 type PJOBOBJECT_JOBSET_INFORMATION = uintptr
  29591 
  29592 type JOBOBJECT_RATE_CONTROL_TOLERANCE = uint32
  29593 
  29594 type JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL = uint32
  29595 
  29596 type _JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION = struct {
  29597 	FIoReadBytesLimit             DWORD64
  29598 	FIoWriteBytesLimit            DWORD64
  29599 	FPerJobUserTimeLimit          LARGE_INTEGER
  29600 	FJobMemoryLimit               DWORD64
  29601 	FRateControlTolerance         JOBOBJECT_RATE_CONTROL_TOLERANCE
  29602 	FRateControlToleranceInterval JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL
  29603 	FLimitFlags                   DWORD
  29604 	F__ccgo_pad1                  [4]byte
  29605 }
  29606 
  29607 type JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION = _JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION
  29608 type PJOBOBJECT_NOTIFICATION_LIMIT_INFORMATION = uintptr
  29609 
  29610 type _JOBOBJECT_LIMIT_VIOLATION_INFORMATION = struct {
  29611 	FLimitFlags                DWORD
  29612 	FViolationLimitFlags       DWORD
  29613 	FIoReadBytes               DWORD64
  29614 	FIoReadBytesLimit          DWORD64
  29615 	FIoWriteBytes              DWORD64
  29616 	FIoWriteBytesLimit         DWORD64
  29617 	FPerJobUserTime            LARGE_INTEGER
  29618 	FPerJobUserTimeLimit       LARGE_INTEGER
  29619 	FJobMemory                 DWORD64
  29620 	FJobMemoryLimit            DWORD64
  29621 	FRateControlTolerance      JOBOBJECT_RATE_CONTROL_TOLERANCE
  29622 	FRateControlToleranceLimit JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL
  29623 }
  29624 
  29625 type JOBOBJECT_LIMIT_VIOLATION_INFORMATION = _JOBOBJECT_LIMIT_VIOLATION_INFORMATION
  29626 type PJOBOBJECT_LIMIT_VIOLATION_INFORMATION = uintptr
  29627 
  29628 type _JOBOBJECT_CPU_RATE_CONTROL_INFORMATION = struct {
  29629 	FControlFlags DWORD
  29630 	F__4          struct{ FCpuRate DWORD }
  29631 }
  29632 
  29633 type JOBOBJECT_CPU_RATE_CONTROL_INFORMATION = _JOBOBJECT_CPU_RATE_CONTROL_INFORMATION
  29634 type PJOBOBJECT_CPU_RATE_CONTROL_INFORMATION = uintptr
  29635 
  29636 type JOBOBJECTINFOCLASS = uint32
  29637 
  29638 type FIRMWARE_TYPE = uint32
  29639 type PFIRMWARE_TYPE = uintptr
  29640 
  29641 type LOGICAL_PROCESSOR_RELATIONSHIP = uint32
  29642 
  29643 type PROCESSOR_CACHE_TYPE = uint32
  29644 
  29645 type _CACHE_DESCRIPTOR = struct {
  29646 	FLevel         BYTE
  29647 	FAssociativity BYTE
  29648 	FLineSize      WORD
  29649 	FSize          DWORD
  29650 	FType          PROCESSOR_CACHE_TYPE
  29651 }
  29652 
  29653 type CACHE_DESCRIPTOR = _CACHE_DESCRIPTOR
  29654 type PCACHE_DESCRIPTOR = uintptr
  29655 
  29656 type _SYSTEM_LOGICAL_PROCESSOR_INFORMATION = struct {
  29657 	FProcessorMask ULONG_PTR
  29658 	FRelationship  LOGICAL_PROCESSOR_RELATIONSHIP
  29659 	F__ccgo_pad1   [4]byte
  29660 	Fu             struct {
  29661 		F__ccgo_pad1   [0]uint64
  29662 		FProcessorCore struct{ FFlags BYTE }
  29663 		F__ccgo_pad2   [15]byte
  29664 	}
  29665 }
  29666 
  29667 type SYSTEM_LOGICAL_PROCESSOR_INFORMATION = _SYSTEM_LOGICAL_PROCESSOR_INFORMATION
  29668 type PSYSTEM_LOGICAL_PROCESSOR_INFORMATION = uintptr
  29669 
  29670 type _PROCESSOR_RELATIONSHIP = struct {
  29671 	FFlags      BYTE
  29672 	FReserved   [21]BYTE
  29673 	FGroupCount WORD
  29674 	FGroupMask  [1]GROUP_AFFINITY
  29675 }
  29676 
  29677 type PROCESSOR_RELATIONSHIP = _PROCESSOR_RELATIONSHIP
  29678 type PPROCESSOR_RELATIONSHIP = uintptr
  29679 
  29680 type _NUMA_NODE_RELATIONSHIP = struct {
  29681 	FNodeNumber DWORD
  29682 	FReserved   [20]BYTE
  29683 	FGroupMask  GROUP_AFFINITY
  29684 }
  29685 
  29686 type NUMA_NODE_RELATIONSHIP = _NUMA_NODE_RELATIONSHIP
  29687 type PNUMA_NODE_RELATIONSHIP = uintptr
  29688 
  29689 type _CACHE_RELATIONSHIP = struct {
  29690 	FLevel         BYTE
  29691 	FAssociativity BYTE
  29692 	FLineSize      WORD
  29693 	FCacheSize     DWORD
  29694 	FType          PROCESSOR_CACHE_TYPE
  29695 	FReserved      [20]BYTE
  29696 	FGroupMask     GROUP_AFFINITY
  29697 }
  29698 
  29699 type CACHE_RELATIONSHIP = _CACHE_RELATIONSHIP
  29700 type PCACHE_RELATIONSHIP = uintptr
  29701 
  29702 type _PROCESSOR_GROUP_INFO = struct {
  29703 	FMaximumProcessorCount BYTE
  29704 	FActiveProcessorCount  BYTE
  29705 	FReserved              [38]BYTE
  29706 	FActiveProcessorMask   KAFFINITY
  29707 }
  29708 
  29709 type PROCESSOR_GROUP_INFO = _PROCESSOR_GROUP_INFO
  29710 type PPROCESSOR_GROUP_INFO = uintptr
  29711 
  29712 type _GROUP_RELATIONSHIP = struct {
  29713 	FMaximumGroupCount WORD
  29714 	FActiveGroupCount  WORD
  29715 	FReserved          [20]BYTE
  29716 	FGroupInfo         [1]PROCESSOR_GROUP_INFO
  29717 }
  29718 
  29719 type GROUP_RELATIONSHIP = _GROUP_RELATIONSHIP
  29720 type PGROUP_RELATIONSHIP = uintptr
  29721 
  29722 type _SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX = struct {
  29723 	FRelationship LOGICAL_PROCESSOR_RELATIONSHIP
  29724 	FSize         DWORD
  29725 	Fu            struct {
  29726 		FProcessor   PROCESSOR_RELATIONSHIP
  29727 		F__ccgo_pad1 [32]byte
  29728 	}
  29729 }
  29730 
  29731 type SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX = _SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
  29732 type PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX = uintptr
  29733 
  29734 type _SYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION = struct{ FCycleTime DWORD64 }
  29735 
  29736 type SYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION = _SYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION
  29737 type PSYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION = uintptr
  29738 
  29739 type _XSTATE_FEATURE = struct {
  29740 	FOffset DWORD
  29741 	FSize   DWORD
  29742 }
  29743 
  29744 type XSTATE_FEATURE = _XSTATE_FEATURE
  29745 type PXSTATE_FEATURE = uintptr
  29746 
  29747 type _XSTATE_CONFIGURATION = struct {
  29748 	FEnabledFeatures         DWORD64
  29749 	FEnabledVolatileFeatures DWORD64
  29750 	FSize                    DWORD
  29751 	FOptimizedSave           uint8
  29752 	F__ccgo_pad1             [3]byte
  29753 	FFeatures                [64]XSTATE_FEATURE
  29754 }
  29755 
  29756 type XSTATE_CONFIGURATION = _XSTATE_CONFIGURATION
  29757 type PXSTATE_CONFIGURATION = uintptr
  29758 
  29759 type _MEMORY_BASIC_INFORMATION = struct {
  29760 	FBaseAddress       PVOID
  29761 	FAllocationBase    PVOID
  29762 	FAllocationProtect DWORD
  29763 	F__ccgo_pad1       [4]byte
  29764 	FRegionSize        SIZE_T
  29765 	FState             DWORD
  29766 	FProtect           DWORD
  29767 	FType              DWORD
  29768 	F__ccgo_pad2       [4]byte
  29769 }
  29770 
  29771 type MEMORY_BASIC_INFORMATION = _MEMORY_BASIC_INFORMATION
  29772 type PMEMORY_BASIC_INFORMATION = uintptr
  29773 
  29774 type _MEMORY_BASIC_INFORMATION32 = struct {
  29775 	FBaseAddress       DWORD
  29776 	FAllocationBase    DWORD
  29777 	FAllocationProtect DWORD
  29778 	FRegionSize        DWORD
  29779 	FState             DWORD
  29780 	FProtect           DWORD
  29781 	FType              DWORD
  29782 }
  29783 
  29784 type MEMORY_BASIC_INFORMATION32 = _MEMORY_BASIC_INFORMATION32
  29785 type PMEMORY_BASIC_INFORMATION32 = uintptr
  29786 
  29787 type _MEMORY_BASIC_INFORMATION64 = struct {
  29788 	FBaseAddress       ULONGLONG
  29789 	FAllocationBase    ULONGLONG
  29790 	FAllocationProtect DWORD
  29791 	F__alignment1      DWORD
  29792 	FRegionSize        ULONGLONG
  29793 	FState             DWORD
  29794 	FProtect           DWORD
  29795 	FType              DWORD
  29796 	F__alignment2      DWORD
  29797 }
  29798 
  29799 type MEMORY_BASIC_INFORMATION64 = _MEMORY_BASIC_INFORMATION64
  29800 type PMEMORY_BASIC_INFORMATION64 = uintptr
  29801 
  29802 type _CFG_CALL_TARGET_INFO = struct {
  29803 	FOffset ULONG_PTR
  29804 	FFlags  ULONG_PTR
  29805 }
  29806 
  29807 type CFG_CALL_TARGET_INFO = _CFG_CALL_TARGET_INFO
  29808 type PCFG_CALL_TARGET_INFO = uintptr
  29809 
  29810 type _MEM_ADDRESS_REQUIREMENTS = struct {
  29811 	FLowestStartingAddress PVOID
  29812 	FHighestEndingAddress  PVOID
  29813 	FAlignment             SIZE_T
  29814 }
  29815 
  29816 type MEM_ADDRESS_REQUIREMENTS = _MEM_ADDRESS_REQUIREMENTS
  29817 type PMEM_ADDRESS_REQUIREMENTS = uintptr
  29818 
  29819 type MEM_EXTENDED_PARAMETER_TYPE = uint32
  29820 type PMEM_EXTENDED_PARAMETER_TYPE = uintptr
  29821 
  29822 type MEM_EXTENDED_PARAMETER1 = struct {
  29823 	F__0 struct {
  29824 		F__ccgo_pad1 [0]uint64
  29825 		FType        uint64
  29826 	}
  29827 	F__8 struct{ FULong64 DWORD64 }
  29828 }
  29829 
  29830 type MEM_EXTENDED_PARAMETER = MEM_EXTENDED_PARAMETER1
  29831 type PMEM_EXTENDED_PARAMETER = uintptr
  29832 
  29833 type MEM_SECTION_EXTENDED_PARAMETER_TYPE = uint32
  29834 type PMEM_SECTION_EXTENDED_PARAMETER_TYPE = uintptr
  29835 
  29836 type FILE_ID_1281 = struct{ FIdentifier [16]BYTE }
  29837 
  29838 type FILE_ID_128 = FILE_ID_1281
  29839 type PFILE_ID_128 = uintptr
  29840 
  29841 type _FILE_NOTIFY_INFORMATION = struct {
  29842 	FNextEntryOffset DWORD
  29843 	FAction          DWORD
  29844 	FFileNameLength  DWORD
  29845 	FFileName        [1]WCHAR
  29846 	F__ccgo_pad1     [2]byte
  29847 }
  29848 
  29849 type FILE_NOTIFY_INFORMATION = _FILE_NOTIFY_INFORMATION
  29850 type PFILE_NOTIFY_INFORMATION = uintptr
  29851 
  29852 type _FILE_SEGMENT_ELEMENT = struct{ FBuffer PVOID64 }
  29853 
  29854 type FILE_SEGMENT_ELEMENT = _FILE_SEGMENT_ELEMENT
  29855 type PFILE_SEGMENT_ELEMENT = uintptr
  29856 
  29857 type _REPARSE_GUID_DATA_BUFFER = struct {
  29858 	FReparseTag           DWORD
  29859 	FReparseDataLength    WORD
  29860 	FReserved             WORD
  29861 	FReparseGuid          GUID
  29862 	FGenericReparseBuffer struct{ FDataBuffer [1]BYTE }
  29863 	F__ccgo_pad1          [3]byte
  29864 }
  29865 
  29866 type REPARSE_GUID_DATA_BUFFER = _REPARSE_GUID_DATA_BUFFER
  29867 type PREPARSE_GUID_DATA_BUFFER = uintptr
  29868 
  29869 type SYSTEM_POWER_STATE = uint32
  29870 type PSYSTEM_POWER_STATE = uintptr
  29871 
  29872 type POWER_ACTION = uint32
  29873 type PPOWER_ACTION = uintptr
  29874 
  29875 type DEVICE_POWER_STATE = uint32
  29876 type PDEVICE_POWER_STATE = uintptr
  29877 
  29878 type MONITOR_DISPLAY_STATE = uint32
  29879 type PMONITOR_DISPLAY_STATE = uintptr
  29880 
  29881 type USER_ACTIVITY_PRESENCE = uint32
  29882 type PUSER_ACTIVITY_PRESENCE = uintptr
  29883 
  29884 type EXECUTION_STATE = DWORD
  29885 type PEXECUTION_STATE = uintptr
  29886 
  29887 type LATENCY_TIME = uint32
  29888 
  29889 type POWER_REQUEST_TYPE = uint32
  29890 type PPOWER_REQUEST_TYPE = uintptr
  29891 
  29892 type CM_Power_Data_s = struct {
  29893 	FPD_Size                 DWORD
  29894 	FPD_MostRecentPowerState DEVICE_POWER_STATE
  29895 	FPD_Capabilities         DWORD
  29896 	FPD_D1Latency            DWORD
  29897 	FPD_D2Latency            DWORD
  29898 	FPD_D3Latency            DWORD
  29899 	FPD_PowerStateMapping    [7]DEVICE_POWER_STATE
  29900 	FPD_DeepestSystemWake    SYSTEM_POWER_STATE
  29901 }
  29902 
  29903 type CM_POWER_DATA = CM_Power_Data_s
  29904 type PCM_POWER_DATA = uintptr
  29905 
  29906 type POWER_INFORMATION_LEVEL = uint32
  29907 
  29908 type POWER_USER_PRESENCE_TYPE = uint32
  29909 type PPOWER_USER_PRESENCE_TYPE = uintptr
  29910 
  29911 type _POWER_USER_PRESENCE = struct{ FUserPresence POWER_USER_PRESENCE_TYPE }
  29912 
  29913 type POWER_USER_PRESENCE = _POWER_USER_PRESENCE
  29914 type PPOWER_USER_PRESENCE = uintptr
  29915 
  29916 type _POWER_SESSION_CONNECT = struct {
  29917 	FConnected BOOLEAN
  29918 	FConsole   BOOLEAN
  29919 }
  29920 
  29921 type POWER_SESSION_CONNECT = _POWER_SESSION_CONNECT
  29922 type PPOWER_SESSION_CONNECT = uintptr
  29923 
  29924 type _POWER_SESSION_TIMEOUTS = struct {
  29925 	FInputTimeout   DWORD
  29926 	FDisplayTimeout DWORD
  29927 }
  29928 
  29929 type POWER_SESSION_TIMEOUTS = _POWER_SESSION_TIMEOUTS
  29930 type PPOWER_SESSION_TIMEOUTS = uintptr
  29931 
  29932 type _POWER_SESSION_RIT_STATE = struct {
  29933 	FActive        BOOLEAN
  29934 	F__ccgo_pad1   [3]byte
  29935 	FLastInputTime DWORD
  29936 }
  29937 
  29938 type POWER_SESSION_RIT_STATE = _POWER_SESSION_RIT_STATE
  29939 type PPOWER_SESSION_RIT_STATE = uintptr
  29940 
  29941 type _POWER_SESSION_WINLOGON = struct {
  29942 	FSessionId   DWORD
  29943 	FConsole     BOOLEAN
  29944 	FLocked      BOOLEAN
  29945 	F__ccgo_pad1 [2]byte
  29946 }
  29947 
  29948 type POWER_SESSION_WINLOGON = _POWER_SESSION_WINLOGON
  29949 type PPOWER_SESSION_WINLOGON = uintptr
  29950 
  29951 type _POWER_IDLE_RESILIENCY = struct {
  29952 	FCoalescingTimeout    DWORD
  29953 	FIdleResiliencyPeriod DWORD
  29954 }
  29955 
  29956 type POWER_IDLE_RESILIENCY = _POWER_IDLE_RESILIENCY
  29957 type PPOWER_IDLE_RESILIENCY = uintptr
  29958 
  29959 type POWER_MONITOR_REQUEST_REASON = uint32
  29960 
  29961 type _POWER_MONITOR_INVOCATION = struct {
  29962 	FOn            BOOLEAN
  29963 	FConsole       BOOLEAN
  29964 	F__ccgo_pad1   [2]byte
  29965 	FRequestReason POWER_MONITOR_REQUEST_REASON
  29966 }
  29967 
  29968 type POWER_MONITOR_INVOCATION = _POWER_MONITOR_INVOCATION
  29969 type PPOWER_MONITOR_INVOCATION = uintptr
  29970 
  29971 type _RESUME_PERFORMANCE = struct {
  29972 	FPostTimeMs              DWORD
  29973 	F__ccgo_pad1             [4]byte
  29974 	FTotalResumeTimeMs       ULONGLONG
  29975 	FResumeCompleteTimestamp ULONGLONG
  29976 }
  29977 
  29978 type RESUME_PERFORMANCE = _RESUME_PERFORMANCE
  29979 type PRESUME_PERFORMANCE = uintptr
  29980 
  29981 type SYSTEM_POWER_CONDITION = uint32
  29982 
  29983 type SET_POWER_SETTING_VALUE = struct {
  29984 	FVersion        DWORD
  29985 	FGuid           GUID
  29986 	FPowerCondition SYSTEM_POWER_CONDITION
  29987 	FDataLength     DWORD
  29988 	FData           [1]BYTE
  29989 	F__ccgo_pad1    [3]byte
  29990 }
  29991 type PSET_POWER_SETTING_VALUE = uintptr
  29992 
  29993 type NOTIFY_USER_POWER_SETTING = struct{ FGuid GUID }
  29994 type PNOTIFY_USER_POWER_SETTING = uintptr
  29995 
  29996 type _APPLICATIONLAUNCH_SETTING_VALUE = struct {
  29997 	FActivationTime   LARGE_INTEGER
  29998 	FFlags            DWORD
  29999 	FButtonInstanceID DWORD
  30000 }
  30001 
  30002 type APPLICATIONLAUNCH_SETTING_VALUE = _APPLICATIONLAUNCH_SETTING_VALUE
  30003 type PAPPLICATIONLAUNCH_SETTING_VALUE = uintptr
  30004 
  30005 type POWER_PLATFORM_ROLE = uint32
  30006 type PPOWER_PLATFORM_ROLE = uintptr
  30007 
  30008 type _POWER_PLATFORM_INFORMATION = struct{ FAoAc BOOLEAN }
  30009 
  30010 type POWER_PLATFORM_INFORMATION = _POWER_PLATFORM_INFORMATION
  30011 type PPOWER_PLATFORM_INFORMATION = uintptr
  30012 
  30013 type BATTERY_REPORTING_SCALE = struct {
  30014 	FGranularity DWORD
  30015 	FCapacity    DWORD
  30016 }
  30017 type PBATTERY_REPORTING_SCALE = uintptr
  30018 
  30019 type PPM_WMI_LEGACY_PERFSTATE = struct {
  30020 	FFrequency        DWORD
  30021 	FFlags            DWORD
  30022 	FPercentFrequency DWORD
  30023 }
  30024 type PPPM_WMI_LEGACY_PERFSTATE = uintptr
  30025 
  30026 type PPM_WMI_IDLE_STATE = struct {
  30027 	FLatency        DWORD
  30028 	FPower          DWORD
  30029 	FTimeCheck      DWORD
  30030 	FPromotePercent BYTE
  30031 	FDemotePercent  BYTE
  30032 	FStateType      BYTE
  30033 	FReserved       BYTE
  30034 	FStateFlags     DWORD
  30035 	FContext        DWORD
  30036 	FIdleHandler    DWORD
  30037 	FReserved1      DWORD
  30038 }
  30039 type PPPM_WMI_IDLE_STATE = uintptr
  30040 
  30041 type PPM_WMI_IDLE_STATES = struct {
  30042 	FType             DWORD
  30043 	FCount            DWORD
  30044 	FTargetState      DWORD
  30045 	FOldState         DWORD
  30046 	FTargetProcessors DWORD64
  30047 	FState            [1]PPM_WMI_IDLE_STATE
  30048 }
  30049 type PPPM_WMI_IDLE_STATES = uintptr
  30050 
  30051 type PPM_WMI_IDLE_STATES_EX = struct {
  30052 	FType             DWORD
  30053 	FCount            DWORD
  30054 	FTargetState      DWORD
  30055 	FOldState         DWORD
  30056 	FTargetProcessors PVOID
  30057 	FState            [1]PPM_WMI_IDLE_STATE
  30058 }
  30059 type PPPM_WMI_IDLE_STATES_EX = uintptr
  30060 
  30061 type PPM_WMI_PERF_STATE = struct {
  30062 	FFrequency        DWORD
  30063 	FPower            DWORD
  30064 	FPercentFrequency BYTE
  30065 	FIncreaseLevel    BYTE
  30066 	FDecreaseLevel    BYTE
  30067 	FType             BYTE
  30068 	FIncreaseTime     DWORD
  30069 	FDecreaseTime     DWORD
  30070 	F__ccgo_pad1      [4]byte
  30071 	FControl          DWORD64
  30072 	FStatus           DWORD64
  30073 	FHitCount         DWORD
  30074 	FReserved1        DWORD
  30075 	FReserved2        DWORD64
  30076 	FReserved3        DWORD64
  30077 }
  30078 type PPPM_WMI_PERF_STATE = uintptr
  30079 
  30080 type PPM_WMI_PERF_STATES = struct {
  30081 	FCount             DWORD
  30082 	FMaxFrequency      DWORD
  30083 	FCurrentState      DWORD
  30084 	FMaxPerfState      DWORD
  30085 	FMinPerfState      DWORD
  30086 	FLowestPerfState   DWORD
  30087 	FThermalConstraint DWORD
  30088 	FBusyAdjThreshold  BYTE
  30089 	FPolicyType        BYTE
  30090 	FType              BYTE
  30091 	FReserved          BYTE
  30092 	FTimerInterval     DWORD
  30093 	F__ccgo_pad1       [4]byte
  30094 	FTargetProcessors  DWORD64
  30095 	FPStateHandler     DWORD
  30096 	FPStateContext     DWORD
  30097 	FTStateHandler     DWORD
  30098 	FTStateContext     DWORD
  30099 	FFeedbackHandler   DWORD
  30100 	FReserved1         DWORD
  30101 	FReserved2         DWORD64
  30102 	FState             [1]PPM_WMI_PERF_STATE
  30103 }
  30104 type PPPM_WMI_PERF_STATES = uintptr
  30105 
  30106 type PPM_WMI_PERF_STATES_EX = struct {
  30107 	FCount             DWORD
  30108 	FMaxFrequency      DWORD
  30109 	FCurrentState      DWORD
  30110 	FMaxPerfState      DWORD
  30111 	FMinPerfState      DWORD
  30112 	FLowestPerfState   DWORD
  30113 	FThermalConstraint DWORD
  30114 	FBusyAdjThreshold  BYTE
  30115 	FPolicyType        BYTE
  30116 	FType              BYTE
  30117 	FReserved          BYTE
  30118 	FTimerInterval     DWORD
  30119 	F__ccgo_pad1       [4]byte
  30120 	FTargetProcessors  PVOID
  30121 	FPStateHandler     DWORD
  30122 	FPStateContext     DWORD
  30123 	FTStateHandler     DWORD
  30124 	FTStateContext     DWORD
  30125 	FFeedbackHandler   DWORD
  30126 	FReserved1         DWORD
  30127 	FReserved2         DWORD64
  30128 	FState             [1]PPM_WMI_PERF_STATE
  30129 }
  30130 type PPPM_WMI_PERF_STATES_EX = uintptr
  30131 
  30132 type PPM_IDLE_STATE_ACCOUNTING = struct {
  30133 	FIdleTransitions    DWORD
  30134 	FFailedTransitions  DWORD
  30135 	FInvalidBucketIndex DWORD
  30136 	F__ccgo_pad1        [4]byte
  30137 	FTotalTime          DWORD64
  30138 	FIdleTimeBuckets    [6]DWORD
  30139 }
  30140 type PPPM_IDLE_STATE_ACCOUNTING = uintptr
  30141 
  30142 type PPM_IDLE_ACCOUNTING = struct {
  30143 	FStateCount       DWORD
  30144 	FTotalTransitions DWORD
  30145 	FResetCount       DWORD
  30146 	F__ccgo_pad1      [4]byte
  30147 	FStartTime        DWORD64
  30148 	FState            [1]PPM_IDLE_STATE_ACCOUNTING
  30149 }
  30150 type PPPM_IDLE_ACCOUNTING = uintptr
  30151 
  30152 type PPM_IDLE_STATE_BUCKET_EX = struct {
  30153 	FTotalTimeUs DWORD64
  30154 	FMinTimeUs   DWORD
  30155 	FMaxTimeUs   DWORD
  30156 	FCount       DWORD
  30157 	F__ccgo_pad1 [4]byte
  30158 }
  30159 type PPPM_IDLE_STATE_BUCKET_EX = uintptr
  30160 
  30161 type PPM_IDLE_STATE_ACCOUNTING_EX = struct {
  30162 	FTotalTime            DWORD64
  30163 	FIdleTransitions      DWORD
  30164 	FFailedTransitions    DWORD
  30165 	FInvalidBucketIndex   DWORD
  30166 	FMinTimeUs            DWORD
  30167 	FMaxTimeUs            DWORD
  30168 	FCancelledTransitions DWORD
  30169 	FIdleTimeBuckets      [16]PPM_IDLE_STATE_BUCKET_EX
  30170 }
  30171 type PPPM_IDLE_STATE_ACCOUNTING_EX = uintptr
  30172 
  30173 type PPM_IDLE_ACCOUNTING_EX = struct {
  30174 	FStateCount       DWORD
  30175 	FTotalTransitions DWORD
  30176 	FResetCount       DWORD
  30177 	FAbortCount       DWORD
  30178 	FStartTime        DWORD64
  30179 	FState            [1]PPM_IDLE_STATE_ACCOUNTING_EX
  30180 }
  30181 type PPPM_IDLE_ACCOUNTING_EX = uintptr
  30182 
  30183 type PPM_PERFSTATE_EVENT = struct {
  30184 	FState     DWORD
  30185 	FStatus    DWORD
  30186 	FLatency   DWORD
  30187 	FSpeed     DWORD
  30188 	FProcessor DWORD
  30189 }
  30190 type PPPM_PERFSTATE_EVENT = uintptr
  30191 
  30192 type PPM_PERFSTATE_DOMAIN_EVENT = struct {
  30193 	FState       DWORD
  30194 	FLatency     DWORD
  30195 	FSpeed       DWORD
  30196 	F__ccgo_pad1 [4]byte
  30197 	FProcessors  DWORD64
  30198 }
  30199 type PPPM_PERFSTATE_DOMAIN_EVENT = uintptr
  30200 
  30201 type PPM_IDLESTATE_EVENT = struct {
  30202 	FNewState   DWORD
  30203 	FOldState   DWORD
  30204 	FProcessors DWORD64
  30205 }
  30206 type PPPM_IDLESTATE_EVENT = uintptr
  30207 
  30208 type PPM_THERMALCHANGE_EVENT = struct {
  30209 	FThermalConstraint DWORD
  30210 	F__ccgo_pad1       [4]byte
  30211 	FProcessors        DWORD64
  30212 }
  30213 type PPPM_THERMALCHANGE_EVENT = uintptr
  30214 type PPM_THERMAL_POLICY_EVENT = struct {
  30215 	FMode        BYTE
  30216 	F__ccgo_pad1 [7]byte
  30217 	FProcessors  DWORD64
  30218 }
  30219 type PPPM_THERMAL_POLICY_EVENT = uintptr
  30220 
  30221 type POWER_ACTION_POLICY = struct {
  30222 	FAction    POWER_ACTION
  30223 	FFlags     DWORD
  30224 	FEventCode DWORD
  30225 }
  30226 type PPOWER_ACTION_POLICY = uintptr
  30227 
  30228 type PROCESSOR_IDLESTATE_INFO = struct {
  30229 	FTimeCheck      DWORD
  30230 	FDemotePercent  BYTE
  30231 	FPromotePercent BYTE
  30232 	FSpare          [2]BYTE
  30233 }
  30234 type PPROCESSOR_IDLESTATE_INFO = uintptr
  30235 
  30236 type SYSTEM_POWER_LEVEL = struct {
  30237 	FEnable         BOOLEAN
  30238 	FSpare          [3]BYTE
  30239 	FBatteryLevel   DWORD
  30240 	FPowerPolicy    POWER_ACTION_POLICY
  30241 	FMinSystemState SYSTEM_POWER_STATE
  30242 }
  30243 type PSYSTEM_POWER_LEVEL = uintptr
  30244 
  30245 type _SYSTEM_POWER_POLICY = struct {
  30246 	FRevision                    DWORD
  30247 	FPowerButton                 POWER_ACTION_POLICY
  30248 	FSleepButton                 POWER_ACTION_POLICY
  30249 	FLidClose                    POWER_ACTION_POLICY
  30250 	FLidOpenWake                 SYSTEM_POWER_STATE
  30251 	FReserved                    DWORD
  30252 	FIdle                        POWER_ACTION_POLICY
  30253 	FIdleTimeout                 DWORD
  30254 	FIdleSensitivity             BYTE
  30255 	FDynamicThrottle             BYTE
  30256 	FSpare2                      [2]BYTE
  30257 	FMinSleep                    SYSTEM_POWER_STATE
  30258 	FMaxSleep                    SYSTEM_POWER_STATE
  30259 	FReducedLatencySleep         SYSTEM_POWER_STATE
  30260 	FWinLogonFlags               DWORD
  30261 	FSpare3                      DWORD
  30262 	FDozeS4Timeout               DWORD
  30263 	FBroadcastCapacityResolution DWORD
  30264 	FDischargePolicy             [4]SYSTEM_POWER_LEVEL
  30265 	FVideoTimeout                DWORD
  30266 	FVideoDimDisplay             BOOLEAN
  30267 	F__ccgo_pad1                 [3]byte
  30268 	FVideoReserved               [3]DWORD
  30269 	FSpindownTimeout             DWORD
  30270 	FOptimizeForPower            BOOLEAN
  30271 	FFanThrottleTolerance        BYTE
  30272 	FForcedThrottle              BYTE
  30273 	FMinThrottle                 BYTE
  30274 	FOverThrottled               POWER_ACTION_POLICY
  30275 }
  30276 
  30277 type SYSTEM_POWER_POLICY = _SYSTEM_POWER_POLICY
  30278 type PSYSTEM_POWER_POLICY = uintptr
  30279 
  30280 type PROCESSOR_IDLESTATE_POLICY = struct {
  30281 	FRevision    WORD
  30282 	FFlags       struct{ FAsWORD WORD }
  30283 	FPolicyCount DWORD
  30284 	FPolicy      [3]PROCESSOR_IDLESTATE_INFO
  30285 }
  30286 type PPROCESSOR_IDLESTATE_POLICY = uintptr
  30287 
  30288 type _PROCESSOR_POWER_POLICY_INFO = struct {
  30289 	FTimeCheck      DWORD
  30290 	FDemoteLimit    DWORD
  30291 	FPromoteLimit   DWORD
  30292 	FDemotePercent  BYTE
  30293 	FPromotePercent BYTE
  30294 	FSpare          [2]BYTE
  30295 	FAllowDemotion  uint32
  30296 }
  30297 
  30298 type PROCESSOR_POWER_POLICY_INFO = _PROCESSOR_POWER_POLICY_INFO
  30299 type PPROCESSOR_POWER_POLICY_INFO = uintptr
  30300 
  30301 type _PROCESSOR_POWER_POLICY = struct {
  30302 	FRevision        DWORD
  30303 	FDynamicThrottle BYTE
  30304 	FSpare           [3]BYTE
  30305 	FDisableCStates  uint32
  30306 	F__ccgo_pad1     [4]byte
  30307 	FPolicyCount     DWORD
  30308 	FPolicy          [3]PROCESSOR_POWER_POLICY_INFO
  30309 }
  30310 
  30311 type PROCESSOR_POWER_POLICY = _PROCESSOR_POWER_POLICY
  30312 type PPROCESSOR_POWER_POLICY = uintptr
  30313 
  30314 type PROCESSOR_PERFSTATE_POLICY = struct {
  30315 	FRevision         DWORD
  30316 	FMaxThrottle      BYTE
  30317 	FMinThrottle      BYTE
  30318 	FBusyAdjThreshold BYTE
  30319 	Fu                struct{ FSpare BYTE }
  30320 	FTimeCheck        DWORD
  30321 	FIncreaseTime     DWORD
  30322 	FDecreaseTime     DWORD
  30323 	FIncreasePercent  DWORD
  30324 	FDecreasePercent  DWORD
  30325 }
  30326 type PPROCESSOR_PERFSTATE_POLICY = uintptr
  30327 
  30328 type _ADMINISTRATOR_POWER_POLICY = struct {
  30329 	FMinSleep           SYSTEM_POWER_STATE
  30330 	FMaxSleep           SYSTEM_POWER_STATE
  30331 	FMinVideoTimeout    DWORD
  30332 	FMaxVideoTimeout    DWORD
  30333 	FMinSpindownTimeout DWORD
  30334 	FMaxSpindownTimeout DWORD
  30335 }
  30336 
  30337 type ADMINISTRATOR_POWER_POLICY = _ADMINISTRATOR_POWER_POLICY
  30338 type PADMINISTRATOR_POWER_POLICY = uintptr
  30339 
  30340 type SYSTEM_POWER_CAPABILITIES = struct {
  30341 	FPowerButtonPresent     BOOLEAN
  30342 	FSleepButtonPresent     BOOLEAN
  30343 	FLidPresent             BOOLEAN
  30344 	FSystemS1               BOOLEAN
  30345 	FSystemS2               BOOLEAN
  30346 	FSystemS3               BOOLEAN
  30347 	FSystemS4               BOOLEAN
  30348 	FSystemS5               BOOLEAN
  30349 	FHiberFilePresent       BOOLEAN
  30350 	FFullWake               BOOLEAN
  30351 	FVideoDimPresent        BOOLEAN
  30352 	FApmPresent             BOOLEAN
  30353 	FUpsPresent             BOOLEAN
  30354 	FThermalControl         BOOLEAN
  30355 	FProcessorThrottle      BOOLEAN
  30356 	FProcessorMinThrottle   BYTE
  30357 	FProcessorMaxThrottle   BYTE
  30358 	FFastSystemS4           BOOLEAN
  30359 	Fspare2                 [3]BYTE
  30360 	FDiskSpinDown           BOOLEAN
  30361 	Fspare3                 [8]BYTE
  30362 	FSystemBatteriesPresent BOOLEAN
  30363 	FBatteriesAreShortTerm  BOOLEAN
  30364 	FBatteryScale           [3]BATTERY_REPORTING_SCALE
  30365 	FAcOnLineWake           SYSTEM_POWER_STATE
  30366 	FSoftLidWake            SYSTEM_POWER_STATE
  30367 	FRtcWake                SYSTEM_POWER_STATE
  30368 	FMinDeviceWakeState     SYSTEM_POWER_STATE
  30369 	FDefaultLowLatencyWake  SYSTEM_POWER_STATE
  30370 }
  30371 type PSYSTEM_POWER_CAPABILITIES = uintptr
  30372 
  30373 type SYSTEM_BATTERY_STATE = struct {
  30374 	FAcOnLine          BOOLEAN
  30375 	FBatteryPresent    BOOLEAN
  30376 	FCharging          BOOLEAN
  30377 	FDischarging       BOOLEAN
  30378 	FSpare1            [4]BOOLEAN
  30379 	FMaxCapacity       DWORD
  30380 	FRemainingCapacity DWORD
  30381 	FRate              DWORD
  30382 	FEstimatedTime     DWORD
  30383 	FDefaultAlert1     DWORD
  30384 	FDefaultAlert2     DWORD
  30385 }
  30386 type PSYSTEM_BATTERY_STATE = uintptr
  30387 
  30388 type _IMAGE_DOS_HEADER = struct {
  30389 	Fe_magic    WORD
  30390 	Fe_cblp     WORD
  30391 	Fe_cp       WORD
  30392 	Fe_crlc     WORD
  30393 	Fe_cparhdr  WORD
  30394 	Fe_minalloc WORD
  30395 	Fe_maxalloc WORD
  30396 	Fe_ss       WORD
  30397 	Fe_sp       WORD
  30398 	Fe_csum     WORD
  30399 	Fe_ip       WORD
  30400 	Fe_cs       WORD
  30401 	Fe_lfarlc   WORD
  30402 	Fe_ovno     WORD
  30403 	Fe_res      [4]WORD
  30404 	Fe_oemid    WORD
  30405 	Fe_oeminfo  WORD
  30406 	Fe_res2     [10]WORD
  30407 	Fe_lfanew   LONG
  30408 }
  30409 
  30410 type IMAGE_DOS_HEADER = _IMAGE_DOS_HEADER
  30411 type PIMAGE_DOS_HEADER = uintptr
  30412 
  30413 type _IMAGE_OS2_HEADER = struct {
  30414 	Fne_magic        WORD
  30415 	Fne_ver          CHAR
  30416 	Fne_rev          CHAR
  30417 	Fne_enttab       WORD
  30418 	Fne_cbenttab     WORD
  30419 	Fne_crc          LONG
  30420 	Fne_flags        WORD
  30421 	Fne_autodata     WORD
  30422 	Fne_heap         WORD
  30423 	Fne_stack        WORD
  30424 	Fne_csip         LONG
  30425 	Fne_sssp         LONG
  30426 	Fne_cseg         WORD
  30427 	Fne_cmod         WORD
  30428 	Fne_cbnrestab    WORD
  30429 	Fne_segtab       WORD
  30430 	Fne_rsrctab      WORD
  30431 	Fne_restab       WORD
  30432 	Fne_modtab       WORD
  30433 	Fne_imptab       WORD
  30434 	Fne_nrestab      LONG
  30435 	Fne_cmovent      WORD
  30436 	Fne_align        WORD
  30437 	Fne_cres         WORD
  30438 	Fne_exetyp       BYTE
  30439 	Fne_flagsothers  BYTE
  30440 	Fne_pretthunks   WORD
  30441 	Fne_psegrefbytes WORD
  30442 	Fne_swaparea     WORD
  30443 	Fne_expver       WORD
  30444 }
  30445 
  30446 type IMAGE_OS2_HEADER = _IMAGE_OS2_HEADER
  30447 type PIMAGE_OS2_HEADER = uintptr
  30448 
  30449 type _IMAGE_VXD_HEADER = struct {
  30450 	Fe32_magic        WORD
  30451 	Fe32_border       BYTE
  30452 	Fe32_worder       BYTE
  30453 	Fe32_level        DWORD
  30454 	Fe32_cpu          WORD
  30455 	Fe32_os           WORD
  30456 	Fe32_ver          DWORD
  30457 	Fe32_mflags       DWORD
  30458 	Fe32_mpages       DWORD
  30459 	Fe32_startobj     DWORD
  30460 	Fe32_eip          DWORD
  30461 	Fe32_stackobj     DWORD
  30462 	Fe32_esp          DWORD
  30463 	Fe32_pagesize     DWORD
  30464 	Fe32_lastpagesize DWORD
  30465 	Fe32_fixupsize    DWORD
  30466 	Fe32_fixupsum     DWORD
  30467 	Fe32_ldrsize      DWORD
  30468 	Fe32_ldrsum       DWORD
  30469 	Fe32_objtab       DWORD
  30470 	Fe32_objcnt       DWORD
  30471 	Fe32_objmap       DWORD
  30472 	Fe32_itermap      DWORD
  30473 	Fe32_rsrctab      DWORD
  30474 	Fe32_rsrccnt      DWORD
  30475 	Fe32_restab       DWORD
  30476 	Fe32_enttab       DWORD
  30477 	Fe32_dirtab       DWORD
  30478 	Fe32_dircnt       DWORD
  30479 	Fe32_fpagetab     DWORD
  30480 	Fe32_frectab      DWORD
  30481 	Fe32_impmod       DWORD
  30482 	Fe32_impmodcnt    DWORD
  30483 	Fe32_impproc      DWORD
  30484 	Fe32_pagesum      DWORD
  30485 	Fe32_datapage     DWORD
  30486 	Fe32_preload      DWORD
  30487 	Fe32_nrestab      DWORD
  30488 	Fe32_cbnrestab    DWORD
  30489 	Fe32_nressum      DWORD
  30490 	Fe32_autodata     DWORD
  30491 	Fe32_debuginfo    DWORD
  30492 	Fe32_debuglen     DWORD
  30493 	Fe32_instpreload  DWORD
  30494 	Fe32_instdemand   DWORD
  30495 	Fe32_heapsize     DWORD
  30496 	Fe32_res3         [12]BYTE
  30497 	Fe32_winresoff    DWORD
  30498 	Fe32_winreslen    DWORD
  30499 	Fe32_devid        WORD
  30500 	Fe32_ddkver       WORD
  30501 }
  30502 
  30503 type IMAGE_VXD_HEADER = _IMAGE_VXD_HEADER
  30504 type PIMAGE_VXD_HEADER = uintptr
  30505 
  30506 type _IMAGE_FILE_HEADER = struct {
  30507 	FMachine              WORD
  30508 	FNumberOfSections     WORD
  30509 	FTimeDateStamp        DWORD
  30510 	FPointerToSymbolTable DWORD
  30511 	FNumberOfSymbols      DWORD
  30512 	FSizeOfOptionalHeader WORD
  30513 	FCharacteristics      WORD
  30514 }
  30515 
  30516 type IMAGE_FILE_HEADER = _IMAGE_FILE_HEADER
  30517 type PIMAGE_FILE_HEADER = uintptr
  30518 
  30519 type _IMAGE_DATA_DIRECTORY = struct {
  30520 	FVirtualAddress DWORD
  30521 	FSize           DWORD
  30522 }
  30523 
  30524 type IMAGE_DATA_DIRECTORY = _IMAGE_DATA_DIRECTORY
  30525 type PIMAGE_DATA_DIRECTORY = uintptr
  30526 
  30527 type _IMAGE_OPTIONAL_HEADER = struct {
  30528 	FMagic                       WORD
  30529 	FMajorLinkerVersion          BYTE
  30530 	FMinorLinkerVersion          BYTE
  30531 	FSizeOfCode                  DWORD
  30532 	FSizeOfInitializedData       DWORD
  30533 	FSizeOfUninitializedData     DWORD
  30534 	FAddressOfEntryPoint         DWORD
  30535 	FBaseOfCode                  DWORD
  30536 	FBaseOfData                  DWORD
  30537 	FImageBase                   DWORD
  30538 	FSectionAlignment            DWORD
  30539 	FFileAlignment               DWORD
  30540 	FMajorOperatingSystemVersion WORD
  30541 	FMinorOperatingSystemVersion WORD
  30542 	FMajorImageVersion           WORD
  30543 	FMinorImageVersion           WORD
  30544 	FMajorSubsystemVersion       WORD
  30545 	FMinorSubsystemVersion       WORD
  30546 	FWin32VersionValue           DWORD
  30547 	FSizeOfImage                 DWORD
  30548 	FSizeOfHeaders               DWORD
  30549 	FCheckSum                    DWORD
  30550 	FSubsystem                   WORD
  30551 	FDllCharacteristics          WORD
  30552 	FSizeOfStackReserve          DWORD
  30553 	FSizeOfStackCommit           DWORD
  30554 	FSizeOfHeapReserve           DWORD
  30555 	FSizeOfHeapCommit            DWORD
  30556 	FLoaderFlags                 DWORD
  30557 	FNumberOfRvaAndSizes         DWORD
  30558 	FDataDirectory               [16]IMAGE_DATA_DIRECTORY
  30559 }
  30560 
  30561 type IMAGE_OPTIONAL_HEADER32 = _IMAGE_OPTIONAL_HEADER
  30562 type PIMAGE_OPTIONAL_HEADER32 = uintptr
  30563 
  30564 type _IMAGE_ROM_OPTIONAL_HEADER = struct {
  30565 	FMagic                   WORD
  30566 	FMajorLinkerVersion      BYTE
  30567 	FMinorLinkerVersion      BYTE
  30568 	FSizeOfCode              DWORD
  30569 	FSizeOfInitializedData   DWORD
  30570 	FSizeOfUninitializedData DWORD
  30571 	FAddressOfEntryPoint     DWORD
  30572 	FBaseOfCode              DWORD
  30573 	FBaseOfData              DWORD
  30574 	FBaseOfBss               DWORD
  30575 	FGprMask                 DWORD
  30576 	FCprMask                 [4]DWORD
  30577 	FGpValue                 DWORD
  30578 }
  30579 
  30580 type IMAGE_ROM_OPTIONAL_HEADER = _IMAGE_ROM_OPTIONAL_HEADER
  30581 type PIMAGE_ROM_OPTIONAL_HEADER = uintptr
  30582 
  30583 type _IMAGE_OPTIONAL_HEADER64 = struct {
  30584 	FMagic                       WORD
  30585 	FMajorLinkerVersion          BYTE
  30586 	FMinorLinkerVersion          BYTE
  30587 	FSizeOfCode                  DWORD
  30588 	FSizeOfInitializedData       DWORD
  30589 	FSizeOfUninitializedData     DWORD
  30590 	FAddressOfEntryPoint         DWORD
  30591 	FBaseOfCode                  DWORD
  30592 	FImageBase                   ULONGLONG
  30593 	FSectionAlignment            DWORD
  30594 	FFileAlignment               DWORD
  30595 	FMajorOperatingSystemVersion WORD
  30596 	FMinorOperatingSystemVersion WORD
  30597 	FMajorImageVersion           WORD
  30598 	FMinorImageVersion           WORD
  30599 	FMajorSubsystemVersion       WORD
  30600 	FMinorSubsystemVersion       WORD
  30601 	FWin32VersionValue           DWORD
  30602 	FSizeOfImage                 DWORD
  30603 	FSizeOfHeaders               DWORD
  30604 	FCheckSum                    DWORD
  30605 	FSubsystem                   WORD
  30606 	FDllCharacteristics          WORD
  30607 	FSizeOfStackReserve          ULONGLONG
  30608 	FSizeOfStackCommit           ULONGLONG
  30609 	FSizeOfHeapReserve           ULONGLONG
  30610 	FSizeOfHeapCommit            ULONGLONG
  30611 	FLoaderFlags                 DWORD
  30612 	FNumberOfRvaAndSizes         DWORD
  30613 	FDataDirectory               [16]IMAGE_DATA_DIRECTORY
  30614 }
  30615 
  30616 type IMAGE_OPTIONAL_HEADER64 = _IMAGE_OPTIONAL_HEADER64
  30617 type PIMAGE_OPTIONAL_HEADER64 = uintptr
  30618 
  30619 type IMAGE_OPTIONAL_HEADER = IMAGE_OPTIONAL_HEADER64
  30620 type PIMAGE_OPTIONAL_HEADER = PIMAGE_OPTIONAL_HEADER64
  30621 
  30622 type _IMAGE_NT_HEADERS64 = struct {
  30623 	FSignature      DWORD
  30624 	FFileHeader     IMAGE_FILE_HEADER
  30625 	FOptionalHeader IMAGE_OPTIONAL_HEADER64
  30626 }
  30627 
  30628 type IMAGE_NT_HEADERS64 = _IMAGE_NT_HEADERS64
  30629 type PIMAGE_NT_HEADERS64 = uintptr
  30630 
  30631 type _IMAGE_NT_HEADERS = struct {
  30632 	FSignature      DWORD
  30633 	FFileHeader     IMAGE_FILE_HEADER
  30634 	FOptionalHeader IMAGE_OPTIONAL_HEADER32
  30635 }
  30636 
  30637 type IMAGE_NT_HEADERS32 = _IMAGE_NT_HEADERS
  30638 type PIMAGE_NT_HEADERS32 = uintptr
  30639 
  30640 type _IMAGE_ROM_HEADERS = struct {
  30641 	FFileHeader     IMAGE_FILE_HEADER
  30642 	FOptionalHeader IMAGE_ROM_OPTIONAL_HEADER
  30643 }
  30644 
  30645 type IMAGE_ROM_HEADERS = _IMAGE_ROM_HEADERS
  30646 type PIMAGE_ROM_HEADERS = uintptr
  30647 
  30648 type IMAGE_NT_HEADERS = IMAGE_NT_HEADERS64
  30649 type PIMAGE_NT_HEADERS = PIMAGE_NT_HEADERS64
  30650 
  30651 type ANON_OBJECT_HEADER1 = struct {
  30652 	FSig1          WORD
  30653 	FSig2          WORD
  30654 	FVersion       WORD
  30655 	FMachine       WORD
  30656 	FTimeDateStamp DWORD
  30657 	FClassID       CLSID
  30658 	FSizeOfData    DWORD
  30659 }
  30660 
  30661 type ANON_OBJECT_HEADER = ANON_OBJECT_HEADER1
  30662 
  30663 type ANON_OBJECT_HEADER_V21 = struct {
  30664 	FSig1           WORD
  30665 	FSig2           WORD
  30666 	FVersion        WORD
  30667 	FMachine        WORD
  30668 	FTimeDateStamp  DWORD
  30669 	FClassID        CLSID
  30670 	FSizeOfData     DWORD
  30671 	FFlags          DWORD
  30672 	FMetaDataSize   DWORD
  30673 	FMetaDataOffset DWORD
  30674 }
  30675 
  30676 type ANON_OBJECT_HEADER_V2 = ANON_OBJECT_HEADER_V21
  30677 
  30678 type ANON_OBJECT_HEADER_BIGOBJ1 = struct {
  30679 	FSig1                 WORD
  30680 	FSig2                 WORD
  30681 	FVersion              WORD
  30682 	FMachine              WORD
  30683 	FTimeDateStamp        DWORD
  30684 	FClassID              CLSID
  30685 	FSizeOfData           DWORD
  30686 	FFlags                DWORD
  30687 	FMetaDataSize         DWORD
  30688 	FMetaDataOffset       DWORD
  30689 	FNumberOfSections     DWORD
  30690 	FPointerToSymbolTable DWORD
  30691 	FNumberOfSymbols      DWORD
  30692 }
  30693 
  30694 type ANON_OBJECT_HEADER_BIGOBJ = ANON_OBJECT_HEADER_BIGOBJ1
  30695 
  30696 type _IMAGE_SECTION_HEADER = struct {
  30697 	FName                 [8]BYTE
  30698 	FMisc                 struct{ FPhysicalAddress DWORD }
  30699 	FVirtualAddress       DWORD
  30700 	FSizeOfRawData        DWORD
  30701 	FPointerToRawData     DWORD
  30702 	FPointerToRelocations DWORD
  30703 	FPointerToLinenumbers DWORD
  30704 	FNumberOfRelocations  WORD
  30705 	FNumberOfLinenumbers  WORD
  30706 	FCharacteristics      DWORD
  30707 }
  30708 
  30709 type IMAGE_SECTION_HEADER = _IMAGE_SECTION_HEADER
  30710 type PIMAGE_SECTION_HEADER = uintptr
  30711 
  30712 type _IMAGE_SYMBOL = struct {
  30713 	FN struct {
  30714 		F__ccgo_pad1 [0]uint32
  30715 		FShortName   [8]BYTE
  30716 	}
  30717 	FValue              DWORD
  30718 	FSectionNumber      SHORT
  30719 	FType               WORD
  30720 	FStorageClass       BYTE
  30721 	FNumberOfAuxSymbols BYTE
  30722 	F__ccgo_pad1        [2]byte
  30723 }
  30724 
  30725 // *
  30726 // This file has no copyright assigned and is placed in the Public Domain.
  30727 // This file is part of the mingw-w64 runtime package.
  30728 // No warranty is given; refer to the file DISCLAIMER.PD within this package.
  30729 type IMAGE_SYMBOL = _IMAGE_SYMBOL
  30730 type PIMAGE_SYMBOL = uintptr
  30731 
  30732 type _IMAGE_SYMBOL_EX = struct {
  30733 	FN struct {
  30734 		F__ccgo_pad1 [0]uint32
  30735 		FShortName   [8]BYTE
  30736 	}
  30737 	FValue              DWORD
  30738 	FSectionNumber      LONG
  30739 	FType               WORD
  30740 	FStorageClass       BYTE
  30741 	FNumberOfAuxSymbols BYTE
  30742 }
  30743 
  30744 type IMAGE_SYMBOL_EX = _IMAGE_SYMBOL_EX
  30745 type PIMAGE_SYMBOL_EX = uintptr
  30746 
  30747 // *
  30748 // This file has no copyright assigned and is placed in the Public Domain.
  30749 // This file is part of the mingw-w64 runtime package.
  30750 // No warranty is given; refer to the file DISCLAIMER.PD within this package.
  30751 type IMAGE_AUX_SYMBOL_TOKEN_DEF1 = struct {
  30752 	FbAuxType         BYTE
  30753 	FbReserved        BYTE
  30754 	F__ccgo_pad1      [2]byte
  30755 	FSymbolTableIndex DWORD
  30756 	FrgbReserved      [12]BYTE
  30757 }
  30758 
  30759 // *
  30760 // This file has no copyright assigned and is placed in the Public Domain.
  30761 // This file is part of the mingw-w64 runtime package.
  30762 // No warranty is given; refer to the file DISCLAIMER.PD within this package.
  30763 type IMAGE_AUX_SYMBOL_TOKEN_DEF = IMAGE_AUX_SYMBOL_TOKEN_DEF1
  30764 type PIMAGE_AUX_SYMBOL_TOKEN_DEF = uintptr
  30765 
  30766 type _IMAGE_AUX_SYMBOL = struct {
  30767 	FSym struct {
  30768 		FTagIndex DWORD
  30769 		FMisc     struct {
  30770 			F__ccgo_pad1 [0]uint32
  30771 			FLnSz        struct {
  30772 				FLinenumber WORD
  30773 				FSize       WORD
  30774 			}
  30775 		}
  30776 		FFcnAry struct {
  30777 			FFunction struct {
  30778 				FPointerToLinenumber   DWORD
  30779 				FPointerToNextFunction DWORD
  30780 			}
  30781 		}
  30782 		FTvIndex     WORD
  30783 		F__ccgo_pad1 [2]byte
  30784 	}
  30785 }
  30786 
  30787 type IMAGE_AUX_SYMBOL = _IMAGE_AUX_SYMBOL
  30788 type PIMAGE_AUX_SYMBOL = uintptr
  30789 
  30790 type _IMAGE_AUX_SYMBOL_EX = struct {
  30791 	FSym struct {
  30792 		FWeakDefaultSymIndex DWORD
  30793 		FWeakSearchType      DWORD
  30794 		FrgbReserved         [12]BYTE
  30795 	}
  30796 	F__ccgo_pad1 [4]byte
  30797 }
  30798 
  30799 type IMAGE_AUX_SYMBOL_EX = _IMAGE_AUX_SYMBOL_EX
  30800 type PIMAGE_AUX_SYMBOL_EX = uintptr
  30801 
  30802 type IMAGE_AUX_SYMBOL_TYPE = uint32
  30803 
  30804 type _IMAGE_RELOCATION = struct {
  30805 	Fu                struct{ FVirtualAddress DWORD }
  30806 	FSymbolTableIndex DWORD
  30807 	FType             WORD
  30808 	F__ccgo_pad1      [2]byte
  30809 }
  30810 
  30811 type IMAGE_RELOCATION = _IMAGE_RELOCATION
  30812 type PIMAGE_RELOCATION = uintptr
  30813 
  30814 type _IMAGE_LINENUMBER = struct {
  30815 	FType        struct{ FSymbolTableIndex DWORD }
  30816 	FLinenumber  WORD
  30817 	F__ccgo_pad1 [2]byte
  30818 }
  30819 
  30820 type IMAGE_LINENUMBER = _IMAGE_LINENUMBER
  30821 type PIMAGE_LINENUMBER = uintptr
  30822 
  30823 type _IMAGE_BASE_RELOCATION = struct {
  30824 	FVirtualAddress DWORD
  30825 	FSizeOfBlock    DWORD
  30826 }
  30827 
  30828 type IMAGE_BASE_RELOCATION = _IMAGE_BASE_RELOCATION
  30829 type PIMAGE_BASE_RELOCATION = uintptr
  30830 
  30831 type _IMAGE_ARCHIVE_MEMBER_HEADER = struct {
  30832 	FName      [16]BYTE
  30833 	FDate      [12]BYTE
  30834 	FUserID    [6]BYTE
  30835 	FGroupID   [6]BYTE
  30836 	FMode      [8]BYTE
  30837 	FSize      [10]BYTE
  30838 	FEndHeader [2]BYTE
  30839 }
  30840 
  30841 type IMAGE_ARCHIVE_MEMBER_HEADER = _IMAGE_ARCHIVE_MEMBER_HEADER
  30842 type PIMAGE_ARCHIVE_MEMBER_HEADER = uintptr
  30843 
  30844 type _IMAGE_EXPORT_DIRECTORY = struct {
  30845 	FCharacteristics       DWORD
  30846 	FTimeDateStamp         DWORD
  30847 	FMajorVersion          WORD
  30848 	FMinorVersion          WORD
  30849 	FName                  DWORD
  30850 	FBase                  DWORD
  30851 	FNumberOfFunctions     DWORD
  30852 	FNumberOfNames         DWORD
  30853 	FAddressOfFunctions    DWORD
  30854 	FAddressOfNames        DWORD
  30855 	FAddressOfNameOrdinals DWORD
  30856 }
  30857 
  30858 type IMAGE_EXPORT_DIRECTORY = _IMAGE_EXPORT_DIRECTORY
  30859 type PIMAGE_EXPORT_DIRECTORY = uintptr
  30860 
  30861 type _IMAGE_IMPORT_BY_NAME = struct {
  30862 	FHint        WORD
  30863 	FName        [1]CHAR
  30864 	F__ccgo_pad1 [1]byte
  30865 }
  30866 
  30867 type IMAGE_IMPORT_BY_NAME = _IMAGE_IMPORT_BY_NAME
  30868 type PIMAGE_IMPORT_BY_NAME = uintptr
  30869 
  30870 type _IMAGE_THUNK_DATA64 = struct {
  30871 	Fu1 struct{ FForwarderString ULONGLONG }
  30872 }
  30873 
  30874 type IMAGE_THUNK_DATA64 = _IMAGE_THUNK_DATA64
  30875 type PIMAGE_THUNK_DATA64 = uintptr
  30876 
  30877 type _IMAGE_THUNK_DATA32 = struct {
  30878 	Fu1 struct{ FForwarderString DWORD }
  30879 }
  30880 
  30881 type IMAGE_THUNK_DATA32 = _IMAGE_THUNK_DATA32
  30882 type PIMAGE_THUNK_DATA32 = uintptr
  30883 
  30884 type PIMAGE_TLS_CALLBACK = uintptr
  30885 
  30886 type _IMAGE_TLS_DIRECTORY64 = struct {
  30887 	FStartAddressOfRawData ULONGLONG
  30888 	FEndAddressOfRawData   ULONGLONG
  30889 	FAddressOfIndex        ULONGLONG
  30890 	FAddressOfCallBacks    ULONGLONG
  30891 	FSizeOfZeroFill        DWORD
  30892 	FCharacteristics       DWORD
  30893 }
  30894 
  30895 type IMAGE_TLS_DIRECTORY64 = _IMAGE_TLS_DIRECTORY64
  30896 type PIMAGE_TLS_DIRECTORY64 = uintptr
  30897 
  30898 type _IMAGE_TLS_DIRECTORY32 = struct {
  30899 	FStartAddressOfRawData DWORD
  30900 	FEndAddressOfRawData   DWORD
  30901 	FAddressOfIndex        DWORD
  30902 	FAddressOfCallBacks    DWORD
  30903 	FSizeOfZeroFill        DWORD
  30904 	FCharacteristics       DWORD
  30905 }
  30906 
  30907 type IMAGE_TLS_DIRECTORY32 = _IMAGE_TLS_DIRECTORY32
  30908 type PIMAGE_TLS_DIRECTORY32 = uintptr
  30909 
  30910 type IMAGE_THUNK_DATA = IMAGE_THUNK_DATA64
  30911 type PIMAGE_THUNK_DATA = PIMAGE_THUNK_DATA64
  30912 type IMAGE_TLS_DIRECTORY = IMAGE_TLS_DIRECTORY64
  30913 type PIMAGE_TLS_DIRECTORY = PIMAGE_TLS_DIRECTORY64
  30914 
  30915 type _IMAGE_IMPORT_DESCRIPTOR = struct {
  30916 	Fu              struct{ FCharacteristics DWORD }
  30917 	FTimeDateStamp  DWORD
  30918 	FForwarderChain DWORD
  30919 	FName           DWORD
  30920 	FFirstThunk     DWORD
  30921 }
  30922 
  30923 type IMAGE_IMPORT_DESCRIPTOR = _IMAGE_IMPORT_DESCRIPTOR
  30924 type PIMAGE_IMPORT_DESCRIPTOR = uintptr
  30925 
  30926 type _IMAGE_BOUND_IMPORT_DESCRIPTOR = struct {
  30927 	FTimeDateStamp               DWORD
  30928 	FOffsetModuleName            WORD
  30929 	FNumberOfModuleForwarderRefs WORD
  30930 }
  30931 
  30932 type IMAGE_BOUND_IMPORT_DESCRIPTOR = _IMAGE_BOUND_IMPORT_DESCRIPTOR
  30933 type PIMAGE_BOUND_IMPORT_DESCRIPTOR = uintptr
  30934 
  30935 type _IMAGE_BOUND_FORWARDER_REF = struct {
  30936 	FTimeDateStamp    DWORD
  30937 	FOffsetModuleName WORD
  30938 	FReserved         WORD
  30939 }
  30940 
  30941 type IMAGE_BOUND_FORWARDER_REF = _IMAGE_BOUND_FORWARDER_REF
  30942 type PIMAGE_BOUND_FORWARDER_REF = uintptr
  30943 
  30944 type _IMAGE_DELAYLOAD_DESCRIPTOR = struct {
  30945 	FAttributes                 struct{ FAllAttributes DWORD }
  30946 	FDllNameRVA                 DWORD
  30947 	FModuleHandleRVA            DWORD
  30948 	FImportAddressTableRVA      DWORD
  30949 	FImportNameTableRVA         DWORD
  30950 	FBoundImportAddressTableRVA DWORD
  30951 	FUnloadInformationTableRVA  DWORD
  30952 	FTimeDateStamp              DWORD
  30953 }
  30954 
  30955 type IMAGE_DELAYLOAD_DESCRIPTOR = _IMAGE_DELAYLOAD_DESCRIPTOR
  30956 type PIMAGE_DELAYLOAD_DESCRIPTOR = uintptr
  30957 type PCIMAGE_DELAYLOAD_DESCRIPTOR = uintptr
  30958 
  30959 type _IMAGE_RESOURCE_DIRECTORY = struct {
  30960 	FCharacteristics      DWORD
  30961 	FTimeDateStamp        DWORD
  30962 	FMajorVersion         WORD
  30963 	FMinorVersion         WORD
  30964 	FNumberOfNamedEntries WORD
  30965 	FNumberOfIdEntries    WORD
  30966 }
  30967 
  30968 type IMAGE_RESOURCE_DIRECTORY = _IMAGE_RESOURCE_DIRECTORY
  30969 type PIMAGE_RESOURCE_DIRECTORY = uintptr
  30970 
  30971 type _IMAGE_RESOURCE_DIRECTORY_ENTRY = struct {
  30972 	Fu struct {
  30973 		Fs struct {
  30974 			F__ccgo_pad1 [0]uint32
  30975 			FNameOffset  uint32
  30976 		}
  30977 	}
  30978 	Fu2 struct{ FOffsetToData DWORD }
  30979 }
  30980 
  30981 type IMAGE_RESOURCE_DIRECTORY_ENTRY = _IMAGE_RESOURCE_DIRECTORY_ENTRY
  30982 type PIMAGE_RESOURCE_DIRECTORY_ENTRY = uintptr
  30983 
  30984 type _IMAGE_RESOURCE_DIRECTORY_STRING = struct {
  30985 	FLength      WORD
  30986 	FNameString  [1]CHAR
  30987 	F__ccgo_pad1 [1]byte
  30988 }
  30989 
  30990 type IMAGE_RESOURCE_DIRECTORY_STRING = _IMAGE_RESOURCE_DIRECTORY_STRING
  30991 type PIMAGE_RESOURCE_DIRECTORY_STRING = uintptr
  30992 
  30993 type _IMAGE_RESOURCE_DIR_STRING_U = struct {
  30994 	FLength     WORD
  30995 	FNameString [1]WCHAR
  30996 }
  30997 
  30998 type IMAGE_RESOURCE_DIR_STRING_U = _IMAGE_RESOURCE_DIR_STRING_U
  30999 type PIMAGE_RESOURCE_DIR_STRING_U = uintptr
  31000 
  31001 type _IMAGE_RESOURCE_DATA_ENTRY = struct {
  31002 	FOffsetToData DWORD
  31003 	FSize         DWORD
  31004 	FCodePage     DWORD
  31005 	FReserved     DWORD
  31006 }
  31007 
  31008 type IMAGE_RESOURCE_DATA_ENTRY = _IMAGE_RESOURCE_DATA_ENTRY
  31009 type PIMAGE_RESOURCE_DATA_ENTRY = uintptr
  31010 
  31011 type IMAGE_LOAD_CONFIG_DIRECTORY32 = struct {
  31012 	FSize                          DWORD
  31013 	FTimeDateStamp                 DWORD
  31014 	FMajorVersion                  WORD
  31015 	FMinorVersion                  WORD
  31016 	FGlobalFlagsClear              DWORD
  31017 	FGlobalFlagsSet                DWORD
  31018 	FCriticalSectionDefaultTimeout DWORD
  31019 	FDeCommitFreeBlockThreshold    DWORD
  31020 	FDeCommitTotalFreeThreshold    DWORD
  31021 	FLockPrefixTable               DWORD
  31022 	FMaximumAllocationSize         DWORD
  31023 	FVirtualMemoryThreshold        DWORD
  31024 	FProcessHeapFlags              DWORD
  31025 	FProcessAffinityMask           DWORD
  31026 	FCSDVersion                    WORD
  31027 	FReserved1                     WORD
  31028 	FEditList                      DWORD
  31029 	FSecurityCookie                DWORD
  31030 	FSEHandlerTable                DWORD
  31031 	FSEHandlerCount                DWORD
  31032 }
  31033 type PIMAGE_LOAD_CONFIG_DIRECTORY32 = uintptr
  31034 
  31035 type IMAGE_LOAD_CONFIG_DIRECTORY64 = struct {
  31036 	FSize                          DWORD
  31037 	FTimeDateStamp                 DWORD
  31038 	FMajorVersion                  WORD
  31039 	FMinorVersion                  WORD
  31040 	FGlobalFlagsClear              DWORD
  31041 	FGlobalFlagsSet                DWORD
  31042 	FCriticalSectionDefaultTimeout DWORD
  31043 	FDeCommitFreeBlockThreshold    ULONGLONG
  31044 	FDeCommitTotalFreeThreshold    ULONGLONG
  31045 	FLockPrefixTable               ULONGLONG
  31046 	FMaximumAllocationSize         ULONGLONG
  31047 	FVirtualMemoryThreshold        ULONGLONG
  31048 	FProcessAffinityMask           ULONGLONG
  31049 	FProcessHeapFlags              DWORD
  31050 	FCSDVersion                    WORD
  31051 	FReserved1                     WORD
  31052 	FEditList                      ULONGLONG
  31053 	FSecurityCookie                ULONGLONG
  31054 	FSEHandlerTable                ULONGLONG
  31055 	FSEHandlerCount                ULONGLONG
  31056 }
  31057 type PIMAGE_LOAD_CONFIG_DIRECTORY64 = uintptr
  31058 
  31059 type IMAGE_LOAD_CONFIG_DIRECTORY = IMAGE_LOAD_CONFIG_DIRECTORY64
  31060 type PIMAGE_LOAD_CONFIG_DIRECTORY = PIMAGE_LOAD_CONFIG_DIRECTORY64
  31061 
  31062 type _IMAGE_CE_RUNTIME_FUNCTION_ENTRY = struct {
  31063 	FFuncStart DWORD
  31064 	FPrologLen uint32
  31065 }
  31066 
  31067 type IMAGE_CE_RUNTIME_FUNCTION_ENTRY = _IMAGE_CE_RUNTIME_FUNCTION_ENTRY
  31068 type PIMAGE_CE_RUNTIME_FUNCTION_ENTRY = uintptr
  31069 
  31070 type _IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY = struct {
  31071 	FBeginAddress     ULONGLONG
  31072 	FEndAddress       ULONGLONG
  31073 	FExceptionHandler ULONGLONG
  31074 	FHandlerData      ULONGLONG
  31075 	FPrologEndAddress ULONGLONG
  31076 }
  31077 
  31078 type IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY = _IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY
  31079 type PIMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY = uintptr
  31080 
  31081 type _IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY = struct {
  31082 	FBeginAddress     DWORD
  31083 	FEndAddress       DWORD
  31084 	FExceptionHandler DWORD
  31085 	FHandlerData      DWORD
  31086 	FPrologEndAddress DWORD
  31087 }
  31088 
  31089 type IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY = _IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY
  31090 type PIMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY = uintptr
  31091 
  31092 type _IMAGE_ARM_RUNTIME_FUNCTION_ENTRY = struct {
  31093 	FBeginAddress DWORD
  31094 	Fu            struct{ FUnwindData DWORD }
  31095 }
  31096 
  31097 type IMAGE_ARM_RUNTIME_FUNCTION_ENTRY = _IMAGE_ARM_RUNTIME_FUNCTION_ENTRY
  31098 type PIMAGE_ARM_RUNTIME_FUNCTION_ENTRY = uintptr
  31099 
  31100 type _IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY = struct {
  31101 	FBeginAddress DWORD
  31102 	Fu            struct{ FUnwindData DWORD }
  31103 }
  31104 
  31105 type IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY = _IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY
  31106 type PIMAGE_ARM64_RUNTIME_FUNCTION_ENTRY = uintptr
  31107 
  31108 type _IMAGE_RUNTIME_FUNCTION_ENTRY = struct {
  31109 	FBeginAddress DWORD
  31110 	FEndAddress   DWORD
  31111 	Fu            struct{ FUnwindInfoAddress DWORD }
  31112 }
  31113 
  31114 type X_IMAGE_RUNTIME_FUNCTION_ENTRY = _IMAGE_RUNTIME_FUNCTION_ENTRY
  31115 type X_PIMAGE_RUNTIME_FUNCTION_ENTRY = uintptr
  31116 
  31117 type IMAGE_IA64_RUNTIME_FUNCTION_ENTRY = X_IMAGE_RUNTIME_FUNCTION_ENTRY
  31118 type PIMAGE_IA64_RUNTIME_FUNCTION_ENTRY = X_PIMAGE_RUNTIME_FUNCTION_ENTRY
  31119 
  31120 type IMAGE_RUNTIME_FUNCTION_ENTRY = X_IMAGE_RUNTIME_FUNCTION_ENTRY
  31121 type PIMAGE_RUNTIME_FUNCTION_ENTRY = X_PIMAGE_RUNTIME_FUNCTION_ENTRY
  31122 
  31123 type _IMAGE_DEBUG_DIRECTORY = struct {
  31124 	FCharacteristics  DWORD
  31125 	FTimeDateStamp    DWORD
  31126 	FMajorVersion     WORD
  31127 	FMinorVersion     WORD
  31128 	FType             DWORD
  31129 	FSizeOfData       DWORD
  31130 	FAddressOfRawData DWORD
  31131 	FPointerToRawData DWORD
  31132 }
  31133 
  31134 type IMAGE_DEBUG_DIRECTORY = _IMAGE_DEBUG_DIRECTORY
  31135 type PIMAGE_DEBUG_DIRECTORY = uintptr
  31136 
  31137 type _IMAGE_COFF_SYMBOLS_HEADER = struct {
  31138 	FNumberOfSymbols      DWORD
  31139 	FLvaToFirstSymbol     DWORD
  31140 	FNumberOfLinenumbers  DWORD
  31141 	FLvaToFirstLinenumber DWORD
  31142 	FRvaToFirstByteOfCode DWORD
  31143 	FRvaToLastByteOfCode  DWORD
  31144 	FRvaToFirstByteOfData DWORD
  31145 	FRvaToLastByteOfData  DWORD
  31146 }
  31147 
  31148 type IMAGE_COFF_SYMBOLS_HEADER = _IMAGE_COFF_SYMBOLS_HEADER
  31149 type PIMAGE_COFF_SYMBOLS_HEADER = uintptr
  31150 
  31151 type _FPO_DATA = struct {
  31152 	FulOffStart DWORD
  31153 	FcbProcSize DWORD
  31154 	FcdwLocals  DWORD
  31155 	FcdwParams  WORD
  31156 	FcbProlog   uint16
  31157 }
  31158 
  31159 type FPO_DATA = _FPO_DATA
  31160 type PFPO_DATA = uintptr
  31161 
  31162 type _IMAGE_DEBUG_MISC = struct {
  31163 	FDataType    DWORD
  31164 	FLength      DWORD
  31165 	FUnicode     BOOLEAN
  31166 	FReserved    [3]BYTE
  31167 	FData        [1]BYTE
  31168 	F__ccgo_pad1 [3]byte
  31169 }
  31170 
  31171 type IMAGE_DEBUG_MISC = _IMAGE_DEBUG_MISC
  31172 type PIMAGE_DEBUG_MISC = uintptr
  31173 
  31174 type _IMAGE_FUNCTION_ENTRY = struct {
  31175 	FStartingAddress DWORD
  31176 	FEndingAddress   DWORD
  31177 	FEndOfPrologue   DWORD
  31178 }
  31179 
  31180 type IMAGE_FUNCTION_ENTRY = _IMAGE_FUNCTION_ENTRY
  31181 type PIMAGE_FUNCTION_ENTRY = uintptr
  31182 
  31183 type _IMAGE_FUNCTION_ENTRY64 = struct {
  31184 	FStartingAddress ULONGLONG
  31185 	FEndingAddress   ULONGLONG
  31186 	Fu               struct{ FEndOfPrologue ULONGLONG }
  31187 }
  31188 
  31189 type IMAGE_FUNCTION_ENTRY64 = _IMAGE_FUNCTION_ENTRY64
  31190 type PIMAGE_FUNCTION_ENTRY64 = uintptr
  31191 
  31192 type _IMAGE_SEPARATE_DEBUG_HEADER = struct {
  31193 	FSignature          WORD
  31194 	FFlags              WORD
  31195 	FMachine            WORD
  31196 	FCharacteristics    WORD
  31197 	FTimeDateStamp      DWORD
  31198 	FCheckSum           DWORD
  31199 	FImageBase          DWORD
  31200 	FSizeOfImage        DWORD
  31201 	FNumberOfSections   DWORD
  31202 	FExportedNamesSize  DWORD
  31203 	FDebugDirectorySize DWORD
  31204 	FSectionAlignment   DWORD
  31205 	FReserved           [2]DWORD
  31206 }
  31207 
  31208 type IMAGE_SEPARATE_DEBUG_HEADER = _IMAGE_SEPARATE_DEBUG_HEADER
  31209 type PIMAGE_SEPARATE_DEBUG_HEADER = uintptr
  31210 
  31211 type _NON_PAGED_DEBUG_INFO = struct {
  31212 	FSignature       WORD
  31213 	FFlags           WORD
  31214 	FSize            DWORD
  31215 	FMachine         WORD
  31216 	FCharacteristics WORD
  31217 	FTimeDateStamp   DWORD
  31218 	FCheckSum        DWORD
  31219 	FSizeOfImage     DWORD
  31220 	FImageBase       ULONGLONG
  31221 }
  31222 
  31223 type NON_PAGED_DEBUG_INFO = _NON_PAGED_DEBUG_INFO
  31224 type PNON_PAGED_DEBUG_INFO = uintptr
  31225 
  31226 type _ImageArchitectureHeader = struct {
  31227 	FAmaskValue    uint32
  31228 	F__ccgo_pad1   [4]byte
  31229 	FFirstEntryRVA DWORD
  31230 }
  31231 
  31232 type IMAGE_ARCHITECTURE_HEADER = _ImageArchitectureHeader
  31233 type PIMAGE_ARCHITECTURE_HEADER = uintptr
  31234 
  31235 type _ImageArchitectureEntry = struct {
  31236 	FFixupInstRVA DWORD
  31237 	FNewInst      DWORD
  31238 }
  31239 
  31240 type IMAGE_ARCHITECTURE_ENTRY = _ImageArchitectureEntry
  31241 type PIMAGE_ARCHITECTURE_ENTRY = uintptr
  31242 
  31243 type IMPORT_OBJECT_HEADER1 = struct {
  31244 	FSig1          WORD
  31245 	FSig2          WORD
  31246 	FVersion       WORD
  31247 	FMachine       WORD
  31248 	FTimeDateStamp DWORD
  31249 	FSizeOfData    DWORD
  31250 	F__16          struct{ FOrdinal WORD }
  31251 	FType          uint16
  31252 }
  31253 
  31254 type IMPORT_OBJECT_HEADER = IMPORT_OBJECT_HEADER1
  31255 
  31256 type IMPORT_OBJECT_TYPE = uint32
  31257 
  31258 type IMPORT_OBJECT_NAME_TYPE = uint32
  31259 
  31260 type ReplacesCorHdrNumericDefines = uint32
  31261 
  31262 type IMAGE_COR20_HEADER1 = struct {
  31263 	Fcb                      DWORD
  31264 	FMajorRuntimeVersion     WORD
  31265 	FMinorRuntimeVersion     WORD
  31266 	FMetaData                IMAGE_DATA_DIRECTORY
  31267 	FFlags                   DWORD
  31268 	Fu                       struct{ FEntryPointToken DWORD }
  31269 	FResources               IMAGE_DATA_DIRECTORY
  31270 	FStrongNameSignature     IMAGE_DATA_DIRECTORY
  31271 	FCodeManagerTable        IMAGE_DATA_DIRECTORY
  31272 	FVTableFixups            IMAGE_DATA_DIRECTORY
  31273 	FExportAddressTableJumps IMAGE_DATA_DIRECTORY
  31274 	FManagedNativeHeader     IMAGE_DATA_DIRECTORY
  31275 }
  31276 
  31277 type IMAGE_COR20_HEADER = IMAGE_COR20_HEADER1
  31278 type PIMAGE_COR20_HEADER = uintptr
  31279 
  31280 type _SLIST_ENTRY = struct{ FNext uintptr }
  31281 
  31282 type SLIST_ENTRY = _SLIST_ENTRY
  31283 type PSLIST_ENTRY = uintptr
  31284 
  31285 type _SLIST_HEADER = struct {
  31286 	Fs struct {
  31287 		FAlignment ULONGLONG
  31288 		FRegion    ULONGLONG
  31289 	}
  31290 }
  31291 
  31292 type SLIST_HEADER = _SLIST_HEADER
  31293 type PSLIST_HEADER = uintptr
  31294 
  31295 type _RTL_RUN_ONCE = struct{ FPtr PVOID }
  31296 
  31297 type RTL_RUN_ONCE = _RTL_RUN_ONCE
  31298 type PRTL_RUN_ONCE = uintptr
  31299 type PRTL_RUN_ONCE_INIT_FN = uintptr
  31300 
  31301 type _RTL_BARRIER = struct {
  31302 	FReserved1 DWORD
  31303 	FReserved2 DWORD
  31304 	FReserved3 [2]ULONG_PTR
  31305 	FReserved4 DWORD
  31306 	FReserved5 DWORD
  31307 }
  31308 
  31309 type RTL_BARRIER = _RTL_BARRIER
  31310 type PRTL_BARRIER = uintptr
  31311 
  31312 type _MESSAGE_RESOURCE_ENTRY = struct {
  31313 	FLength      WORD
  31314 	FFlags       WORD
  31315 	FText        [1]BYTE
  31316 	F__ccgo_pad1 [1]byte
  31317 }
  31318 
  31319 type MESSAGE_RESOURCE_ENTRY = _MESSAGE_RESOURCE_ENTRY
  31320 type PMESSAGE_RESOURCE_ENTRY = uintptr
  31321 
  31322 type _MESSAGE_RESOURCE_BLOCK = struct {
  31323 	FLowId           DWORD
  31324 	FHighId          DWORD
  31325 	FOffsetToEntries DWORD
  31326 }
  31327 
  31328 type MESSAGE_RESOURCE_BLOCK = _MESSAGE_RESOURCE_BLOCK
  31329 type PMESSAGE_RESOURCE_BLOCK = uintptr
  31330 
  31331 type _MESSAGE_RESOURCE_DATA = struct {
  31332 	FNumberOfBlocks DWORD
  31333 	FBlocks         [1]MESSAGE_RESOURCE_BLOCK
  31334 }
  31335 
  31336 type MESSAGE_RESOURCE_DATA = _MESSAGE_RESOURCE_DATA
  31337 type PMESSAGE_RESOURCE_DATA = uintptr
  31338 
  31339 type _OSVERSIONINFOA = struct {
  31340 	FdwOSVersionInfoSize DWORD
  31341 	FdwMajorVersion      DWORD
  31342 	FdwMinorVersion      DWORD
  31343 	FdwBuildNumber       DWORD
  31344 	FdwPlatformId        DWORD
  31345 	FszCSDVersion        [128]CHAR
  31346 }
  31347 
  31348 type OSVERSIONINFOA = _OSVERSIONINFOA
  31349 type POSVERSIONINFOA = uintptr
  31350 type LPOSVERSIONINFOA = uintptr
  31351 
  31352 type _OSVERSIONINFOW = struct {
  31353 	FdwOSVersionInfoSize DWORD
  31354 	FdwMajorVersion      DWORD
  31355 	FdwMinorVersion      DWORD
  31356 	FdwBuildNumber       DWORD
  31357 	FdwPlatformId        DWORD
  31358 	FszCSDVersion        [128]WCHAR
  31359 }
  31360 
  31361 type OSVERSIONINFOW = _OSVERSIONINFOW
  31362 type POSVERSIONINFOW = uintptr
  31363 type LPOSVERSIONINFOW = uintptr
  31364 type RTL_OSVERSIONINFOW = _OSVERSIONINFOW
  31365 type PRTL_OSVERSIONINFOW = uintptr
  31366 
  31367 type OSVERSIONINFO = OSVERSIONINFOA
  31368 type POSVERSIONINFO = POSVERSIONINFOA
  31369 type LPOSVERSIONINFO = LPOSVERSIONINFOA
  31370 
  31371 type _OSVERSIONINFOEXA = struct {
  31372 	FdwOSVersionInfoSize DWORD
  31373 	FdwMajorVersion      DWORD
  31374 	FdwMinorVersion      DWORD
  31375 	FdwBuildNumber       DWORD
  31376 	FdwPlatformId        DWORD
  31377 	FszCSDVersion        [128]CHAR
  31378 	FwServicePackMajor   WORD
  31379 	FwServicePackMinor   WORD
  31380 	FwSuiteMask          WORD
  31381 	FwProductType        BYTE
  31382 	FwReserved           BYTE
  31383 }
  31384 
  31385 type OSVERSIONINFOEXA = _OSVERSIONINFOEXA
  31386 type POSVERSIONINFOEXA = uintptr
  31387 type LPOSVERSIONINFOEXA = uintptr
  31388 
  31389 type _OSVERSIONINFOEXW = struct {
  31390 	FdwOSVersionInfoSize DWORD
  31391 	FdwMajorVersion      DWORD
  31392 	FdwMinorVersion      DWORD
  31393 	FdwBuildNumber       DWORD
  31394 	FdwPlatformId        DWORD
  31395 	FszCSDVersion        [128]WCHAR
  31396 	FwServicePackMajor   WORD
  31397 	FwServicePackMinor   WORD
  31398 	FwSuiteMask          WORD
  31399 	FwProductType        BYTE
  31400 	FwReserved           BYTE
  31401 }
  31402 
  31403 type OSVERSIONINFOEXW = _OSVERSIONINFOEXW
  31404 type POSVERSIONINFOEXW = uintptr
  31405 type LPOSVERSIONINFOEXW = uintptr
  31406 type RTL_OSVERSIONINFOEXW = _OSVERSIONINFOEXW
  31407 type PRTL_OSVERSIONINFOEXW = uintptr
  31408 
  31409 type OSVERSIONINFOEX = OSVERSIONINFOEXA
  31410 type POSVERSIONINFOEX = POSVERSIONINFOEXA
  31411 type LPOSVERSIONINFOEX = LPOSVERSIONINFOEXA
  31412 
  31413 type RTL_UMS_THREAD_INFO_CLASS = uint32
  31414 type PRTL_UMS_THREAD_INFO_CLASS = uintptr
  31415 
  31416 type RTL_UMS_SCHEDULER_REASON = uint32
  31417 type PRTL_UMS_SCHEDULER_REASON = uintptr
  31418 type PRTL_UMS_SCHEDULER_ENTRY_POINT = uintptr
  31419 
  31420 type _RTL_CRITICAL_SECTION_DEBUG = struct {
  31421 	FType                      WORD
  31422 	FCreatorBackTraceIndex     WORD
  31423 	F__ccgo_pad1               [4]byte
  31424 	FCriticalSection           uintptr
  31425 	FProcessLocksList          LIST_ENTRY
  31426 	FEntryCount                DWORD
  31427 	FContentionCount           DWORD
  31428 	FFlags                     DWORD
  31429 	FCreatorBackTraceIndexHigh WORD
  31430 	FSpareWORD                 WORD
  31431 }
  31432 
  31433 type _RTL_CRITICAL_SECTION = struct {
  31434 	FDebugInfo      PRTL_CRITICAL_SECTION_DEBUG
  31435 	FLockCount      LONG
  31436 	FRecursionCount LONG
  31437 	FOwningThread   HANDLE
  31438 	FLockSemaphore  HANDLE
  31439 	FSpinCount      ULONG_PTR
  31440 }
  31441 
  31442 type RTL_CRITICAL_SECTION_DEBUG = _RTL_CRITICAL_SECTION_DEBUG
  31443 type PRTL_CRITICAL_SECTION_DEBUG = uintptr
  31444 type RTL_RESOURCE_DEBUG = _RTL_CRITICAL_SECTION_DEBUG
  31445 type PRTL_RESOURCE_DEBUG = uintptr
  31446 
  31447 // *
  31448 // This file has no copyright assigned and is placed in the Public Domain.
  31449 // This file is part of the mingw-w64 runtime package.
  31450 // No warranty is given; refer to the file DISCLAIMER.PD within this package.
  31451 type RTL_CRITICAL_SECTION = _RTL_CRITICAL_SECTION
  31452 type PRTL_CRITICAL_SECTION = uintptr
  31453 
  31454 type _RTL_SRWLOCK = struct{ FPtr PVOID }
  31455 
  31456 type RTL_SRWLOCK = _RTL_SRWLOCK
  31457 type PRTL_SRWLOCK = uintptr
  31458 type _RTL_CONDITION_VARIABLE = struct{ FPtr PVOID }
  31459 
  31460 type RTL_CONDITION_VARIABLE = _RTL_CONDITION_VARIABLE
  31461 type PRTL_CONDITION_VARIABLE = uintptr
  31462 
  31463 type PAPCFUNC = uintptr
  31464 type PVECTORED_EXCEPTION_HANDLER = uintptr
  31465 
  31466 type HEAP_INFORMATION_CLASS = uint32
  31467 
  31468 type WORKERCALLBACKFUNC = uintptr
  31469 type APC_CALLBACK_FUNCTION = uintptr
  31470 type WAITORTIMERCALLBACKFUNC = uintptr
  31471 type WAITORTIMERCALLBACK = WAITORTIMERCALLBACKFUNC
  31472 type PFLS_CALLBACK_FUNCTION = uintptr
  31473 type PSECURE_MEMORY_CACHE_CALLBACK = uintptr
  31474 
  31475 type ACTIVATION_CONTEXT_INFO_CLASS = uint32
  31476 
  31477 type ACTCTX_REQUESTED_RUN_LEVEL = uint32
  31478 
  31479 type ACTCTX_COMPATIBILITY_ELEMENT_TYPE = uint32
  31480 
  31481 type _ACTIVATION_CONTEXT_QUERY_INDEX = struct {
  31482 	FulAssemblyIndex       DWORD
  31483 	FulFileIndexInAssembly DWORD
  31484 }
  31485 
  31486 type ACTIVATION_CONTEXT_QUERY_INDEX = _ACTIVATION_CONTEXT_QUERY_INDEX
  31487 type PACTIVATION_CONTEXT_QUERY_INDEX = uintptr
  31488 
  31489 type _ASSEMBLY_FILE_DETAILED_INFORMATION = struct {
  31490 	FulFlags          DWORD
  31491 	FulFilenameLength DWORD
  31492 	FulPathLength     DWORD
  31493 	F__ccgo_pad1      [4]byte
  31494 	FlpFileName       PCWSTR
  31495 	FlpFilePath       PCWSTR
  31496 }
  31497 
  31498 type ASSEMBLY_FILE_DETAILED_INFORMATION = _ASSEMBLY_FILE_DETAILED_INFORMATION
  31499 type PASSEMBLY_FILE_DETAILED_INFORMATION = uintptr
  31500 
  31501 type _ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION = struct {
  31502 	FulFlags                           DWORD
  31503 	FulEncodedAssemblyIdentityLength   DWORD
  31504 	FulManifestPathType                DWORD
  31505 	FulManifestPathLength              DWORD
  31506 	FliManifestLastWriteTime           LARGE_INTEGER
  31507 	FulPolicyPathType                  DWORD
  31508 	FulPolicyPathLength                DWORD
  31509 	FliPolicyLastWriteTime             LARGE_INTEGER
  31510 	FulMetadataSatelliteRosterIndex    DWORD
  31511 	FulManifestVersionMajor            DWORD
  31512 	FulManifestVersionMinor            DWORD
  31513 	FulPolicyVersionMajor              DWORD
  31514 	FulPolicyVersionMinor              DWORD
  31515 	FulAssemblyDirectoryNameLength     DWORD
  31516 	FlpAssemblyEncodedAssemblyIdentity PCWSTR
  31517 	FlpAssemblyManifestPath            PCWSTR
  31518 	FlpAssemblyPolicyPath              PCWSTR
  31519 	FlpAssemblyDirectoryName           PCWSTR
  31520 	FulFileCount                       DWORD
  31521 	F__ccgo_pad1                       [4]byte
  31522 }
  31523 
  31524 type ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION = _ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION
  31525 type PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION = uintptr
  31526 
  31527 type _ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION = struct {
  31528 	FulFlags  DWORD
  31529 	FRunLevel ACTCTX_REQUESTED_RUN_LEVEL
  31530 	FUiAccess DWORD
  31531 }
  31532 
  31533 type ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION = _ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION
  31534 type PACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION = uintptr
  31535 
  31536 type _COMPATIBILITY_CONTEXT_ELEMENT = struct {
  31537 	FId   GUID
  31538 	FType ACTCTX_COMPATIBILITY_ELEMENT_TYPE
  31539 }
  31540 
  31541 type COMPATIBILITY_CONTEXT_ELEMENT = _COMPATIBILITY_CONTEXT_ELEMENT
  31542 type PCOMPATIBILITY_CONTEXT_ELEMENT = uintptr
  31543 
  31544 type _ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION = struct {
  31545 	F__ccgo_pad1  [0]uint32
  31546 	FElementCount DWORD
  31547 }
  31548 
  31549 // Vista: {e2011457-1546-43c5-a5fe-008deee3d3f0}
  31550 // Seven: {35138b9a-5d96-4fbd-8e2d-a2440225f93a}
  31551 type ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION = _ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION
  31552 type PACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION = uintptr
  31553 
  31554 type _SUPPORTED_OS_INFO = struct {
  31555 	FOsCount         WORD
  31556 	FMitigationExist WORD
  31557 	FOsList          [4]WORD
  31558 }
  31559 
  31560 type SUPPORTED_OS_INFO = _SUPPORTED_OS_INFO
  31561 type PSUPPORTED_OS_INFO = uintptr
  31562 
  31563 type _ACTIVATION_CONTEXT_DETAILED_INFORMATION = struct {
  31564 	FdwFlags                      DWORD
  31565 	FulFormatVersion              DWORD
  31566 	FulAssemblyCount              DWORD
  31567 	FulRootManifestPathType       DWORD
  31568 	FulRootManifestPathChars      DWORD
  31569 	FulRootConfigurationPathType  DWORD
  31570 	FulRootConfigurationPathChars DWORD
  31571 	FulAppDirPathType             DWORD
  31572 	FulAppDirPathChars            DWORD
  31573 	F__ccgo_pad1                  [4]byte
  31574 	FlpRootManifestPath           PCWSTR
  31575 	FlpRootConfigurationPath      PCWSTR
  31576 	FlpAppDirPath                 PCWSTR
  31577 }
  31578 
  31579 type ACTIVATION_CONTEXT_DETAILED_INFORMATION = _ACTIVATION_CONTEXT_DETAILED_INFORMATION
  31580 type PACTIVATION_CONTEXT_DETAILED_INFORMATION = uintptr
  31581 
  31582 type PCACTIVATION_CONTEXT_QUERY_INDEX = uintptr
  31583 type PCASSEMBLY_FILE_DETAILED_INFORMATION = uintptr
  31584 type PCACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION = uintptr
  31585 type PCACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION = uintptr
  31586 type PCCOMPATIBILITY_CONTEXT_ELEMENT = uintptr
  31587 type PCACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION = uintptr
  31588 type PCACTIVATION_CONTEXT_DETAILED_INFORMATION = uintptr
  31589 
  31590 type RTL_VERIFIER_DLL_LOAD_CALLBACK = uintptr
  31591 type RTL_VERIFIER_DLL_UNLOAD_CALLBACK = uintptr
  31592 type RTL_VERIFIER_NTDLLHEAPFREE_CALLBACK = uintptr
  31593 
  31594 type _RTL_VERIFIER_THUNK_DESCRIPTOR = struct {
  31595 	FThunkName       PCHAR
  31596 	FThunkOldAddress PVOID
  31597 	FThunkNewAddress PVOID
  31598 }
  31599 
  31600 type RTL_VERIFIER_THUNK_DESCRIPTOR = _RTL_VERIFIER_THUNK_DESCRIPTOR
  31601 type PRTL_VERIFIER_THUNK_DESCRIPTOR = uintptr
  31602 
  31603 type _RTL_VERIFIER_DLL_DESCRIPTOR = struct {
  31604 	FDllName     PWCHAR
  31605 	FDllFlags    DWORD
  31606 	F__ccgo_pad1 [4]byte
  31607 	FDllAddress  PVOID
  31608 	FDllThunks   PRTL_VERIFIER_THUNK_DESCRIPTOR
  31609 }
  31610 
  31611 type RTL_VERIFIER_DLL_DESCRIPTOR = _RTL_VERIFIER_DLL_DESCRIPTOR
  31612 type PRTL_VERIFIER_DLL_DESCRIPTOR = uintptr
  31613 
  31614 type _RTL_VERIFIER_PROVIDER_DESCRIPTOR = struct {
  31615 	FLength                        DWORD
  31616 	F__ccgo_pad1                   [4]byte
  31617 	FProviderDlls                  PRTL_VERIFIER_DLL_DESCRIPTOR
  31618 	FProviderDllLoadCallback       RTL_VERIFIER_DLL_LOAD_CALLBACK
  31619 	FProviderDllUnloadCallback     RTL_VERIFIER_DLL_UNLOAD_CALLBACK
  31620 	FVerifierImage                 PWSTR
  31621 	FVerifierFlags                 DWORD
  31622 	FVerifierDebug                 DWORD
  31623 	FRtlpGetStackTraceAddress      PVOID
  31624 	FRtlpDebugPageHeapCreate       PVOID
  31625 	FRtlpDebugPageHeapDestroy      PVOID
  31626 	FProviderNtdllHeapFreeCallback RTL_VERIFIER_NTDLLHEAPFREE_CALLBACK
  31627 }
  31628 
  31629 type RTL_VERIFIER_PROVIDER_DESCRIPTOR = _RTL_VERIFIER_PROVIDER_DESCRIPTOR
  31630 type PRTL_VERIFIER_PROVIDER_DESCRIPTOR = uintptr
  31631 
  31632 type _HARDWARE_COUNTER_DATA = struct {
  31633 	FType     HARDWARE_COUNTER_TYPE
  31634 	FReserved DWORD
  31635 	FValue    DWORD64
  31636 }
  31637 
  31638 type HARDWARE_COUNTER_DATA = _HARDWARE_COUNTER_DATA
  31639 type PHARDWARE_COUNTER_DATA = uintptr
  31640 
  31641 type _PERFORMANCE_DATA = struct {
  31642 	FSize               WORD
  31643 	FVersion            BYTE
  31644 	FHwCountersCount    BYTE
  31645 	FContextSwitchCount DWORD
  31646 	FWaitReasonBitMap   DWORD64
  31647 	FCycleTime          DWORD64
  31648 	FRetryCount         DWORD
  31649 	FReserved           DWORD
  31650 	FHwCounters         [16]HARDWARE_COUNTER_DATA
  31651 }
  31652 
  31653 type PERFORMANCE_DATA = _PERFORMANCE_DATA
  31654 type PPERFORMANCE_DATA = uintptr
  31655 
  31656 type _EVENTLOGRECORD = struct {
  31657 	FLength              DWORD
  31658 	FReserved            DWORD
  31659 	FRecordNumber        DWORD
  31660 	FTimeGenerated       DWORD
  31661 	FTimeWritten         DWORD
  31662 	FEventID             DWORD
  31663 	FEventType           WORD
  31664 	FNumStrings          WORD
  31665 	FEventCategory       WORD
  31666 	FReservedFlags       WORD
  31667 	FClosingRecordNumber DWORD
  31668 	FStringOffset        DWORD
  31669 	FUserSidLength       DWORD
  31670 	FUserSidOffset       DWORD
  31671 	FDataLength          DWORD
  31672 	FDataOffset          DWORD
  31673 }
  31674 
  31675 type EVENTLOGRECORD = _EVENTLOGRECORD
  31676 type PEVENTLOGRECORD = uintptr
  31677 
  31678 type _EVENTSFORLOGFILE = struct {
  31679 	F__ccgo_pad1      [0]uint32
  31680 	FulSize           DWORD
  31681 	FszLogicalLogFile [256]WCHAR
  31682 	FulNumRecords     DWORD
  31683 }
  31684 
  31685 type EVENTSFORLOGFILE = _EVENTSFORLOGFILE
  31686 type PEVENTSFORLOGFILE = uintptr
  31687 
  31688 type _PACKEDEVENTINFO = struct {
  31689 	F__ccgo_pad1           [0]uint32
  31690 	FulSize                DWORD
  31691 	FulNumEventsForLogFile DWORD
  31692 }
  31693 
  31694 type PACKEDEVENTINFO = _PACKEDEVENTINFO
  31695 type PPACKEDEVENTINFO = uintptr
  31696 
  31697 type SERVICE_NODE_TYPE = uint32
  31698 
  31699 type SERVICE_LOAD_TYPE = uint32
  31700 
  31701 type SERVICE_ERROR_TYPE = uint32
  31702 
  31703 type _TAPE_ERASE = struct {
  31704 	FType        DWORD
  31705 	FImmediate   BOOLEAN
  31706 	F__ccgo_pad1 [3]byte
  31707 }
  31708 
  31709 type TAPE_ERASE = _TAPE_ERASE
  31710 type PTAPE_ERASE = uintptr
  31711 
  31712 type _TAPE_PREPARE = struct {
  31713 	FOperation   DWORD
  31714 	FImmediate   BOOLEAN
  31715 	F__ccgo_pad1 [3]byte
  31716 }
  31717 
  31718 type TAPE_PREPARE = _TAPE_PREPARE
  31719 type PTAPE_PREPARE = uintptr
  31720 
  31721 type _TAPE_WRITE_MARKS = struct {
  31722 	FType        DWORD
  31723 	FCount       DWORD
  31724 	FImmediate   BOOLEAN
  31725 	F__ccgo_pad1 [3]byte
  31726 }
  31727 
  31728 type TAPE_WRITE_MARKS = _TAPE_WRITE_MARKS
  31729 type PTAPE_WRITE_MARKS = uintptr
  31730 
  31731 type _TAPE_GET_POSITION = struct {
  31732 	FType      DWORD
  31733 	FPartition DWORD
  31734 	FOffset    LARGE_INTEGER
  31735 }
  31736 
  31737 type TAPE_GET_POSITION = _TAPE_GET_POSITION
  31738 type PTAPE_GET_POSITION = uintptr
  31739 
  31740 type _TAPE_SET_POSITION = struct {
  31741 	FMethod      DWORD
  31742 	FPartition   DWORD
  31743 	FOffset      LARGE_INTEGER
  31744 	FImmediate   BOOLEAN
  31745 	F__ccgo_pad1 [7]byte
  31746 }
  31747 
  31748 type TAPE_SET_POSITION = _TAPE_SET_POSITION
  31749 type PTAPE_SET_POSITION = uintptr
  31750 
  31751 type _TAPE_GET_DRIVE_PARAMETERS = struct {
  31752 	FECC                   BOOLEAN
  31753 	FCompression           BOOLEAN
  31754 	FDataPadding           BOOLEAN
  31755 	FReportSetmarks        BOOLEAN
  31756 	FDefaultBlockSize      DWORD
  31757 	FMaximumBlockSize      DWORD
  31758 	FMinimumBlockSize      DWORD
  31759 	FMaximumPartitionCount DWORD
  31760 	FFeaturesLow           DWORD
  31761 	FFeaturesHigh          DWORD
  31762 	FEOTWarningZoneSize    DWORD
  31763 }
  31764 
  31765 type TAPE_GET_DRIVE_PARAMETERS = _TAPE_GET_DRIVE_PARAMETERS
  31766 type PTAPE_GET_DRIVE_PARAMETERS = uintptr
  31767 
  31768 type _TAPE_SET_DRIVE_PARAMETERS = struct {
  31769 	FECC                BOOLEAN
  31770 	FCompression        BOOLEAN
  31771 	FDataPadding        BOOLEAN
  31772 	FReportSetmarks     BOOLEAN
  31773 	FEOTWarningZoneSize DWORD
  31774 }
  31775 
  31776 type TAPE_SET_DRIVE_PARAMETERS = _TAPE_SET_DRIVE_PARAMETERS
  31777 type PTAPE_SET_DRIVE_PARAMETERS = uintptr
  31778 
  31779 type _TAPE_GET_MEDIA_PARAMETERS = struct {
  31780 	FCapacity       LARGE_INTEGER
  31781 	FRemaining      LARGE_INTEGER
  31782 	FBlockSize      DWORD
  31783 	FPartitionCount DWORD
  31784 	FWriteProtected BOOLEAN
  31785 	F__ccgo_pad1    [7]byte
  31786 }
  31787 
  31788 type TAPE_GET_MEDIA_PARAMETERS = _TAPE_GET_MEDIA_PARAMETERS
  31789 type PTAPE_GET_MEDIA_PARAMETERS = uintptr
  31790 
  31791 type _TAPE_SET_MEDIA_PARAMETERS = struct{ FBlockSize DWORD }
  31792 
  31793 type TAPE_SET_MEDIA_PARAMETERS = _TAPE_SET_MEDIA_PARAMETERS
  31794 type PTAPE_SET_MEDIA_PARAMETERS = uintptr
  31795 
  31796 type _TAPE_CREATE_PARTITION = struct {
  31797 	FMethod DWORD
  31798 	FCount  DWORD
  31799 	FSize   DWORD
  31800 }
  31801 
  31802 type TAPE_CREATE_PARTITION = _TAPE_CREATE_PARTITION
  31803 type PTAPE_CREATE_PARTITION = uintptr
  31804 
  31805 type _TAPE_WMI_OPERATIONS = struct {
  31806 	FMethod         DWORD
  31807 	FDataBufferSize DWORD
  31808 	FDataBuffer     PVOID
  31809 }
  31810 
  31811 type TAPE_WMI_OPERATIONS = _TAPE_WMI_OPERATIONS
  31812 type PTAPE_WMI_OPERATIONS = uintptr
  31813 
  31814 type TAPE_DRIVE_PROBLEM_TYPE = uint32
  31815 
  31816 type TP_VERSION = DWORD
  31817 type PTP_VERSION = uintptr
  31818 type PTP_CALLBACK_INSTANCE = uintptr
  31819 type PTP_SIMPLE_CALLBACK = uintptr
  31820 type PTP_POOL = uintptr
  31821 
  31822 type TP_CALLBACK_PRIORITY = uint32
  31823 
  31824 type _TP_POOL_STACK_INFORMATION = struct {
  31825 	FStackReserve SIZE_T
  31826 	FStackCommit  SIZE_T
  31827 }
  31828 
  31829 type TP_POOL_STACK_INFORMATION = _TP_POOL_STACK_INFORMATION
  31830 type PTP_POOL_STACK_INFORMATION = uintptr
  31831 type PTP_CLEANUP_GROUP = uintptr
  31832 type PTP_CLEANUP_GROUP_CANCEL_CALLBACK = uintptr
  31833 
  31834 type _TP_CALLBACK_ENVIRON_V1 = struct {
  31835 	FVersion                    TP_VERSION
  31836 	F__ccgo_pad1                [4]byte
  31837 	FPool                       PTP_POOL
  31838 	FCleanupGroup               PTP_CLEANUP_GROUP
  31839 	FCleanupGroupCancelCallback PTP_CLEANUP_GROUP_CANCEL_CALLBACK
  31840 	FRaceDll                    PVOID
  31841 	FActivationContext          uintptr
  31842 	FFinalizationCallback       PTP_SIMPLE_CALLBACK
  31843 	Fu                          struct{ FFlags DWORD }
  31844 	F__ccgo_pad2                [4]byte
  31845 }
  31846 
  31847 type TP_CALLBACK_ENVIRON_V1 = _TP_CALLBACK_ENVIRON_V1
  31848 type TP_CALLBACK_ENVIRON = TP_CALLBACK_ENVIRON_V1
  31849 type PTP_CALLBACK_ENVIRON = uintptr
  31850 type PTP_WORK = uintptr
  31851 type PTP_WORK_CALLBACK = uintptr
  31852 type PTP_TIMER = uintptr
  31853 type PTP_TIMER_CALLBACK = uintptr
  31854 type TP_WAIT_RESULT = DWORD
  31855 type PTP_WAIT = uintptr
  31856 type PTP_WAIT_CALLBACK = uintptr
  31857 type PTP_IO = uintptr
  31858 
  31859 type CRM_PROTOCOL_ID = GUID
  31860 type PCRM_PROTOCOL_ID = uintptr
  31861 
  31862 type NOTIFICATION_MASK = ULONG
  31863 
  31864 type _TRANSACTION_NOTIFICATION = struct {
  31865 	FTransactionKey          PVOID
  31866 	FTransactionNotification ULONG
  31867 	F__ccgo_pad1             [4]byte
  31868 	FTmVirtualClock          LARGE_INTEGER
  31869 	FArgumentLength          ULONG
  31870 	F__ccgo_pad2             [4]byte
  31871 }
  31872 
  31873 type TRANSACTION_NOTIFICATION = _TRANSACTION_NOTIFICATION
  31874 type PTRANSACTION_NOTIFICATION = uintptr
  31875 
  31876 type _TRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT = struct {
  31877 	FEnlistmentId GUID
  31878 	FUOW          GUID
  31879 }
  31880 
  31881 type TRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT = _TRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT
  31882 type PTRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT = uintptr
  31883 
  31884 type _TRANSACTION_NOTIFICATION_TM_ONLINE_ARGUMENT = struct {
  31885 	FTmIdentity GUID
  31886 	FFlags      ULONG
  31887 }
  31888 
  31889 type TRANSACTION_NOTIFICATION_TM_ONLINE_ARGUMENT = _TRANSACTION_NOTIFICATION_TM_ONLINE_ARGUMENT
  31890 type PTRANSACTION_NOTIFICATION_TM_ONLINE_ARGUMENT = uintptr
  31891 
  31892 type SAVEPOINT_ID = ULONG
  31893 type PSAVEPOINT_ID = uintptr
  31894 
  31895 type _TRANSACTION_NOTIFICATION_SAVEPOINT_ARGUMENT = struct{ FSavepointId SAVEPOINT_ID }
  31896 
  31897 type TRANSACTION_NOTIFICATION_SAVEPOINT_ARGUMENT = _TRANSACTION_NOTIFICATION_SAVEPOINT_ARGUMENT
  31898 type PTRANSACTION_NOTIFICATION_SAVEPOINT_ARGUMENT = uintptr
  31899 
  31900 type _TRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT = struct {
  31901 	FPropagationCookie ULONG
  31902 	FUOW               GUID
  31903 	FTmIdentity        GUID
  31904 	FBufferLength      ULONG
  31905 }
  31906 
  31907 type TRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT = _TRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT
  31908 type PTRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT = uintptr
  31909 
  31910 type _TRANSACTION_NOTIFICATION_MARSHAL_ARGUMENT = struct {
  31911 	FMarshalCookie ULONG
  31912 	FUOW           GUID
  31913 }
  31914 
  31915 type TRANSACTION_NOTIFICATION_MARSHAL_ARGUMENT = _TRANSACTION_NOTIFICATION_MARSHAL_ARGUMENT
  31916 type PTRANSACTION_NOTIFICATION_MARSHAL_ARGUMENT = uintptr
  31917 
  31918 type TRANSACTION_NOTIFICATION_PROMOTE_ARGUMENT = TRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT
  31919 type PTRANSACTION_NOTIFICATION_PROMOTE_ARGUMENT = uintptr
  31920 
  31921 type _KCRM_MARSHAL_HEADER = struct {
  31922 	FVersionMajor ULONG
  31923 	FVersionMinor ULONG
  31924 	FNumProtocols ULONG
  31925 	FUnused       ULONG
  31926 }
  31927 
  31928 type KCRM_MARSHAL_HEADER = _KCRM_MARSHAL_HEADER
  31929 type PKCRM_MARSHAL_HEADER = uintptr
  31930 type PRKCRM_MARSHAL_HEADER = uintptr
  31931 
  31932 type _KCRM_TRANSACTION_BLOB = struct {
  31933 	FUOW            GUID
  31934 	FTmIdentity     GUID
  31935 	FIsolationLevel ULONG
  31936 	FIsolationFlags ULONG
  31937 	FTimeout        ULONG
  31938 	FDescription    [64]WCHAR
  31939 }
  31940 
  31941 type KCRM_TRANSACTION_BLOB = _KCRM_TRANSACTION_BLOB
  31942 type PKCRM_TRANSACTION_BLOB = uintptr
  31943 type PRKCRM_TRANSACTION_BLOB = uintptr
  31944 
  31945 type _KCRM_PROTOCOL_BLOB = struct {
  31946 	FProtocolId              CRM_PROTOCOL_ID
  31947 	FStaticInfoLength        ULONG
  31948 	FTransactionIdInfoLength ULONG
  31949 	FUnused1                 ULONG
  31950 	FUnused2                 ULONG
  31951 }
  31952 
  31953 type KCRM_PROTOCOL_BLOB = _KCRM_PROTOCOL_BLOB
  31954 type PKCRM_PROTOCOL_BLOB = uintptr
  31955 type PRKCRM_PROTOCOL_BLOB = uintptr
  31956 
  31957 type TRANSACTION_OUTCOME = uint32
  31958 
  31959 type TRANSACTION_STATE = uint32
  31960 
  31961 type _TRANSACTION_BASIC_INFORMATION = struct {
  31962 	FTransactionId GUID
  31963 	FState         DWORD
  31964 	FOutcome       DWORD
  31965 }
  31966 
  31967 type TRANSACTION_BASIC_INFORMATION = _TRANSACTION_BASIC_INFORMATION
  31968 type PTRANSACTION_BASIC_INFORMATION = uintptr
  31969 
  31970 type _TRANSACTIONMANAGER_BASIC_INFORMATION = struct {
  31971 	FTmIdentity   GUID
  31972 	FVirtualClock LARGE_INTEGER
  31973 }
  31974 
  31975 type TRANSACTIONMANAGER_BASIC_INFORMATION = _TRANSACTIONMANAGER_BASIC_INFORMATION
  31976 type PTRANSACTIONMANAGER_BASIC_INFORMATION = uintptr
  31977 
  31978 type _TRANSACTIONMANAGER_LOG_INFORMATION = struct{ FLogIdentity GUID }
  31979 
  31980 type TRANSACTIONMANAGER_LOG_INFORMATION = _TRANSACTIONMANAGER_LOG_INFORMATION
  31981 type PTRANSACTIONMANAGER_LOG_INFORMATION = uintptr
  31982 
  31983 type _TRANSACTIONMANAGER_LOGPATH_INFORMATION = struct {
  31984 	FLogPathLength DWORD
  31985 	FLogPath       [1]WCHAR
  31986 	F__ccgo_pad1   [2]byte
  31987 }
  31988 
  31989 type TRANSACTIONMANAGER_LOGPATH_INFORMATION = _TRANSACTIONMANAGER_LOGPATH_INFORMATION
  31990 type PTRANSACTIONMANAGER_LOGPATH_INFORMATION = uintptr
  31991 
  31992 type _TRANSACTIONMANAGER_RECOVERY_INFORMATION = struct{ FLastRecoveredLsn ULONGLONG }
  31993 
  31994 type TRANSACTIONMANAGER_RECOVERY_INFORMATION = _TRANSACTIONMANAGER_RECOVERY_INFORMATION
  31995 type PTRANSACTIONMANAGER_RECOVERY_INFORMATION = uintptr
  31996 
  31997 type _TRANSACTIONMANAGER_OLDEST_INFORMATION = struct{ FOldestTransactionGuid GUID }
  31998 
  31999 type TRANSACTIONMANAGER_OLDEST_INFORMATION = _TRANSACTIONMANAGER_OLDEST_INFORMATION
  32000 type PTRANSACTIONMANAGER_OLDEST_INFORMATION = uintptr
  32001 
  32002 type _TRANSACTION_PROPERTIES_INFORMATION = struct {
  32003 	FIsolationLevel    DWORD
  32004 	FIsolationFlags    DWORD
  32005 	FTimeout           LARGE_INTEGER
  32006 	FOutcome           DWORD
  32007 	FDescriptionLength DWORD
  32008 	FDescription       [1]WCHAR
  32009 	F__ccgo_pad1       [6]byte
  32010 }
  32011 
  32012 type TRANSACTION_PROPERTIES_INFORMATION = _TRANSACTION_PROPERTIES_INFORMATION
  32013 type PTRANSACTION_PROPERTIES_INFORMATION = uintptr
  32014 
  32015 type _TRANSACTION_BIND_INFORMATION = struct{ FTmHandle HANDLE }
  32016 
  32017 type TRANSACTION_BIND_INFORMATION = _TRANSACTION_BIND_INFORMATION
  32018 type PTRANSACTION_BIND_INFORMATION = uintptr
  32019 
  32020 type _TRANSACTION_ENLISTMENT_PAIR = struct {
  32021 	FEnlistmentId      GUID
  32022 	FResourceManagerId GUID
  32023 }
  32024 
  32025 type TRANSACTION_ENLISTMENT_PAIR = _TRANSACTION_ENLISTMENT_PAIR
  32026 type PTRANSACTION_ENLISTMENT_PAIR = uintptr
  32027 
  32028 type _TRANSACTION_ENLISTMENTS_INFORMATION = struct {
  32029 	FNumberOfEnlistments DWORD
  32030 	FEnlistmentPair      [1]TRANSACTION_ENLISTMENT_PAIR
  32031 }
  32032 
  32033 type TRANSACTION_ENLISTMENTS_INFORMATION = _TRANSACTION_ENLISTMENTS_INFORMATION
  32034 type PTRANSACTION_ENLISTMENTS_INFORMATION = uintptr
  32035 
  32036 type _TRANSACTION_SUPERIOR_ENLISTMENT_INFORMATION = struct{ FSuperiorEnlistmentPair TRANSACTION_ENLISTMENT_PAIR }
  32037 
  32038 type TRANSACTION_SUPERIOR_ENLISTMENT_INFORMATION = _TRANSACTION_SUPERIOR_ENLISTMENT_INFORMATION
  32039 type PTRANSACTION_SUPERIOR_ENLISTMENT_INFORMATION = uintptr
  32040 
  32041 type _RESOURCEMANAGER_BASIC_INFORMATION = struct {
  32042 	FResourceManagerId GUID
  32043 	FDescriptionLength DWORD
  32044 	FDescription       [1]WCHAR
  32045 	F__ccgo_pad1       [2]byte
  32046 }
  32047 
  32048 type RESOURCEMANAGER_BASIC_INFORMATION = _RESOURCEMANAGER_BASIC_INFORMATION
  32049 type PRESOURCEMANAGER_BASIC_INFORMATION = uintptr
  32050 
  32051 type _RESOURCEMANAGER_COMPLETION_INFORMATION = struct {
  32052 	FIoCompletionPortHandle HANDLE
  32053 	FCompletionKey          ULONG_PTR
  32054 }
  32055 
  32056 type RESOURCEMANAGER_COMPLETION_INFORMATION = _RESOURCEMANAGER_COMPLETION_INFORMATION
  32057 type PRESOURCEMANAGER_COMPLETION_INFORMATION = uintptr
  32058 
  32059 type TRANSACTION_INFORMATION_CLASS = uint32
  32060 
  32061 type TRANSACTIONMANAGER_INFORMATION_CLASS = uint32
  32062 
  32063 type RESOURCEMANAGER_INFORMATION_CLASS = uint32
  32064 
  32065 type _ENLISTMENT_BASIC_INFORMATION = struct {
  32066 	FEnlistmentId      GUID
  32067 	FTransactionId     GUID
  32068 	FResourceManagerId GUID
  32069 }
  32070 
  32071 type ENLISTMENT_BASIC_INFORMATION = _ENLISTMENT_BASIC_INFORMATION
  32072 type PENLISTMENT_BASIC_INFORMATION = uintptr
  32073 
  32074 type _ENLISTMENT_CRM_INFORMATION = struct {
  32075 	FCrmTransactionManagerId GUID
  32076 	FCrmResourceManagerId    GUID
  32077 	FCrmEnlistmentId         GUID
  32078 }
  32079 
  32080 type ENLISTMENT_CRM_INFORMATION = _ENLISTMENT_CRM_INFORMATION
  32081 type PENLISTMENT_CRM_INFORMATION = uintptr
  32082 
  32083 type ENLISTMENT_INFORMATION_CLASS = uint32
  32084 
  32085 type _TRANSACTION_LIST_ENTRY = struct{ FUOW GUID }
  32086 
  32087 type TRANSACTION_LIST_ENTRY = _TRANSACTION_LIST_ENTRY
  32088 type PTRANSACTION_LIST_ENTRY = uintptr
  32089 
  32090 type _TRANSACTION_LIST_INFORMATION = struct {
  32091 	FNumberOfTransactions   DWORD
  32092 	FTransactionInformation [1]TRANSACTION_LIST_ENTRY
  32093 }
  32094 
  32095 type TRANSACTION_LIST_INFORMATION = _TRANSACTION_LIST_INFORMATION
  32096 type PTRANSACTION_LIST_INFORMATION = uintptr
  32097 
  32098 type KTMOBJECT_TYPE = uint32
  32099 type PKTMOBJECT_TYPE = uintptr
  32100 
  32101 type _KTMOBJECT_CURSOR = struct {
  32102 	FLastQuery     GUID
  32103 	FObjectIdCount DWORD
  32104 	FObjectIds     [1]GUID
  32105 }
  32106 
  32107 type KTMOBJECT_CURSOR = _KTMOBJECT_CURSOR
  32108 type PKTMOBJECT_CURSOR = uintptr
  32109 
  32110 type _WOW64_FLOATING_SAVE_AREA = struct {
  32111 	FControlWord   DWORD
  32112 	FStatusWord    DWORD
  32113 	FTagWord       DWORD
  32114 	FErrorOffset   DWORD
  32115 	FErrorSelector DWORD
  32116 	FDataOffset    DWORD
  32117 	FDataSelector  DWORD
  32118 	FRegisterArea  [80]BYTE
  32119 	FCr0NpxState   DWORD
  32120 }
  32121 
  32122 type WOW64_FLOATING_SAVE_AREA = _WOW64_FLOATING_SAVE_AREA
  32123 type PWOW64_FLOATING_SAVE_AREA = uintptr
  32124 
  32125 type _WOW64_CONTEXT = struct {
  32126 	FContextFlags      DWORD
  32127 	FDr0               DWORD
  32128 	FDr1               DWORD
  32129 	FDr2               DWORD
  32130 	FDr3               DWORD
  32131 	FDr6               DWORD
  32132 	FDr7               DWORD
  32133 	FFloatSave         WOW64_FLOATING_SAVE_AREA
  32134 	FSegGs             DWORD
  32135 	FSegFs             DWORD
  32136 	FSegEs             DWORD
  32137 	FSegDs             DWORD
  32138 	FEdi               DWORD
  32139 	FEsi               DWORD
  32140 	FEbx               DWORD
  32141 	FEdx               DWORD
  32142 	FEcx               DWORD
  32143 	FEax               DWORD
  32144 	FEbp               DWORD
  32145 	FEip               DWORD
  32146 	FSegCs             DWORD
  32147 	FEFlags            DWORD
  32148 	FEsp               DWORD
  32149 	FSegSs             DWORD
  32150 	FExtendedRegisters [512]BYTE
  32151 }
  32152 
  32153 // *
  32154 // This file has no copyright assigned and is placed in the Public Domain.
  32155 // This file is part of the mingw-w64 runtime package.
  32156 // No warranty is given; refer to the file DISCLAIMER.PD within this package.
  32157 type WOW64_CONTEXT = _WOW64_CONTEXT
  32158 type PWOW64_CONTEXT = uintptr
  32159 
  32160 type _WOW64_LDT_ENTRY = struct {
  32161 	FLimitLow WORD
  32162 	FBaseLow  WORD
  32163 	FHighWord struct {
  32164 		F__ccgo_pad1 [0]uint32
  32165 		FBytes       struct {
  32166 			FBaseMid BYTE
  32167 			FFlags1  BYTE
  32168 			FFlags2  BYTE
  32169 			FBaseHi  BYTE
  32170 		}
  32171 	}
  32172 }
  32173 
  32174 type WOW64_LDT_ENTRY = _WOW64_LDT_ENTRY
  32175 type PWOW64_LDT_ENTRY = uintptr
  32176 
  32177 type _WOW64_DESCRIPTOR_TABLE_ENTRY = struct {
  32178 	FSelector   DWORD
  32179 	FDescriptor WOW64_LDT_ENTRY
  32180 }
  32181 
  32182 type WOW64_DESCRIPTOR_TABLE_ENTRY = _WOW64_DESCRIPTOR_TABLE_ENTRY
  32183 type PWOW64_DESCRIPTOR_TABLE_ENTRY = uintptr
  32184 
  32185 type WPARAM = UINT_PTR
  32186 type LPARAM = LONG_PTR
  32187 type LRESULT = LONG_PTR
  32188 
  32189 type SPHANDLE = uintptr
  32190 type LPHANDLE = uintptr
  32191 type HGLOBAL = HANDLE
  32192 type HLOCAL = HANDLE
  32193 type GLOBALHANDLE = HANDLE
  32194 type LOCALHANDLE = HANDLE
  32195 type FARPROC = uintptr
  32196 type NEARPROC = uintptr
  32197 type PROC = uintptr
  32198 
  32199 type ATOM = WORD
  32200 
  32201 type HFILE = int32
  32202 type HINSTANCE__ = struct{ Funused int32 }
  32203 
  32204 type HINSTANCE = uintptr
  32205 type HKEY__ = struct{ Funused int32 }
  32206 
  32207 type HKEY = uintptr
  32208 type PHKEY = uintptr
  32209 type HKL__ = struct{ Funused int32 }
  32210 
  32211 type HKL = uintptr
  32212 type HLSURF__ = struct{ Funused int32 }
  32213 
  32214 type HLSURF = uintptr
  32215 type HMETAFILE__ = struct{ Funused int32 }
  32216 
  32217 type HMETAFILE = uintptr
  32218 type HMODULE = HINSTANCE
  32219 type HRGN__ = struct{ Funused int32 }
  32220 
  32221 type HRGN = uintptr
  32222 type HRSRC__ = struct{ Funused int32 }
  32223 
  32224 type HRSRC = uintptr
  32225 type HSPRITE__ = struct{ Funused int32 }
  32226 
  32227 type HSPRITE = uintptr
  32228 type HSTR__ = struct{ Funused int32 }
  32229 
  32230 type HSTR = uintptr
  32231 type HTASK__ = struct{ Funused int32 }
  32232 
  32233 type HTASK = uintptr
  32234 type HWINSTA__ = struct{ Funused int32 }
  32235 
  32236 type HWINSTA = uintptr
  32237 
  32238 type _FILETIME = struct {
  32239 	FdwLowDateTime  DWORD
  32240 	FdwHighDateTime DWORD
  32241 }
  32242 
  32243 type FILETIME = _FILETIME
  32244 type PFILETIME = uintptr
  32245 type LPFILETIME = uintptr
  32246 
  32247 type HWND__ = struct{ Funused int32 }
  32248 
  32249 type HWND = uintptr
  32250 type HHOOK__ = struct{ Funused int32 }
  32251 
  32252 type HHOOK = uintptr
  32253 
  32254 type HGDIOBJ = uintptr
  32255 
  32256 type HACCEL__ = struct{ Funused int32 }
  32257 
  32258 type HACCEL = uintptr
  32259 type HBITMAP__ = struct{ Funused int32 }
  32260 
  32261 type HBITMAP = uintptr
  32262 type HBRUSH__ = struct{ Funused int32 }
  32263 
  32264 type HBRUSH = uintptr
  32265 type HCOLORSPACE__ = struct{ Funused int32 }
  32266 
  32267 type HCOLORSPACE = uintptr
  32268 type HDC__ = struct{ Funused int32 }
  32269 
  32270 type HDC = uintptr
  32271 type HGLRC__ = struct{ Funused int32 }
  32272 
  32273 type HGLRC = uintptr
  32274 type HDESK__ = struct{ Funused int32 }
  32275 
  32276 type HDESK = uintptr
  32277 type HENHMETAFILE__ = struct{ Funused int32 }
  32278 
  32279 type HENHMETAFILE = uintptr
  32280 type HFONT__ = struct{ Funused int32 }
  32281 
  32282 type HFONT = uintptr
  32283 type HICON__ = struct{ Funused int32 }
  32284 
  32285 type HICON = uintptr
  32286 type HMENU__ = struct{ Funused int32 }
  32287 
  32288 type HMENU = uintptr
  32289 type HPALETTE__ = struct{ Funused int32 }
  32290 
  32291 type HPALETTE = uintptr
  32292 type HPEN__ = struct{ Funused int32 }
  32293 
  32294 type HPEN = uintptr
  32295 type HMONITOR__ = struct{ Funused int32 }
  32296 
  32297 type HMONITOR = uintptr
  32298 type HWINEVENTHOOK__ = struct{ Funused int32 }
  32299 
  32300 type HWINEVENTHOOK = uintptr
  32301 
  32302 type HCURSOR = HICON
  32303 type COLORREF = DWORD
  32304 
  32305 type HUMPD__ = struct{ Funused int32 }
  32306 
  32307 type HUMPD = uintptr
  32308 
  32309 type LPCOLORREF = uintptr
  32310 
  32311 type tagRECT = struct {
  32312 	Fleft   LONG
  32313 	Ftop    LONG
  32314 	Fright  LONG
  32315 	Fbottom LONG
  32316 }
  32317 
  32318 type RECT = tagRECT
  32319 type PRECT = uintptr
  32320 type NPRECT = uintptr
  32321 type LPRECT = uintptr
  32322 
  32323 type LPCRECT = uintptr
  32324 
  32325 type _RECTL = struct {
  32326 	Fleft   LONG
  32327 	Ftop    LONG
  32328 	Fright  LONG
  32329 	Fbottom LONG
  32330 }
  32331 
  32332 type RECTL = _RECTL
  32333 type PRECTL = uintptr
  32334 type LPRECTL = uintptr
  32335 
  32336 type LPCRECTL = uintptr
  32337 
  32338 type tagPOINT = struct {
  32339 	Fx LONG
  32340 	Fy LONG
  32341 }
  32342 
  32343 type POINT = tagPOINT
  32344 type PPOINT = uintptr
  32345 type NPPOINT = uintptr
  32346 type LPPOINT = uintptr
  32347 
  32348 type _POINTL = struct {
  32349 	Fx LONG
  32350 	Fy LONG
  32351 }
  32352 
  32353 type POINTL = _POINTL
  32354 type PPOINTL = uintptr
  32355 
  32356 type tagSIZE = struct {
  32357 	Fcx LONG
  32358 	Fcy LONG
  32359 }
  32360 
  32361 type SIZE = tagSIZE
  32362 type PSIZE = uintptr
  32363 type LPSIZE = uintptr
  32364 
  32365 type SIZEL = SIZE
  32366 type PSIZEL = uintptr
  32367 type LPSIZEL = uintptr
  32368 
  32369 type tagPOINTS = struct {
  32370 	Fx SHORT
  32371 	Fy SHORT
  32372 }
  32373 
  32374 type POINTS = tagPOINTS
  32375 type PPOINTS = uintptr
  32376 type LPPOINTS = uintptr
  32377 
  32378 type APP_LOCAL_DEVICE_ID1 = struct{ Fvalue [32]BYTE }
  32379 
  32380 type APP_LOCAL_DEVICE_ID = APP_LOCAL_DEVICE_ID1
  32381 
  32382 type DPI_AWARENESS_CONTEXT__ = struct{ Funused int32 }
  32383 
  32384 type DPI_AWARENESS_CONTEXT = uintptr
  32385 
  32386 type DPI_AWARENESS = int32
  32387 
  32388 type DPI_HOSTING_BEHAVIOR = int32
  32389 
  32390 type _SECURITY_ATTRIBUTES = struct {
  32391 	FnLength              DWORD
  32392 	F__ccgo_pad1          [4]byte
  32393 	FlpSecurityDescriptor LPVOID
  32394 	FbInheritHandle       WINBOOL
  32395 	F__ccgo_pad2          [4]byte
  32396 }
  32397 
  32398 type SECURITY_ATTRIBUTES = _SECURITY_ATTRIBUTES
  32399 type PSECURITY_ATTRIBUTES = uintptr
  32400 type LPSECURITY_ATTRIBUTES = uintptr
  32401 
  32402 type _OVERLAPPED = struct {
  32403 	FInternal     ULONG_PTR
  32404 	FInternalHigh ULONG_PTR
  32405 	Fu            struct {
  32406 		F__ccgo_pad1 [0]uint64
  32407 		Fs           struct {
  32408 			FOffset     DWORD
  32409 			FOffsetHigh DWORD
  32410 		}
  32411 	}
  32412 	FhEvent HANDLE
  32413 }
  32414 
  32415 type OVERLAPPED = _OVERLAPPED
  32416 type LPOVERLAPPED = uintptr
  32417 
  32418 type _OVERLAPPED_ENTRY = struct {
  32419 	FlpCompletionKey            ULONG_PTR
  32420 	FlpOverlapped               LPOVERLAPPED
  32421 	FInternal                   ULONG_PTR
  32422 	FdwNumberOfBytesTransferred DWORD
  32423 	F__ccgo_pad1                [4]byte
  32424 }
  32425 
  32426 type OVERLAPPED_ENTRY = _OVERLAPPED_ENTRY
  32427 type LPOVERLAPPED_ENTRY = uintptr
  32428 
  32429 type _SYSTEMTIME = struct {
  32430 	FwYear         WORD
  32431 	FwMonth        WORD
  32432 	FwDayOfWeek    WORD
  32433 	FwDay          WORD
  32434 	FwHour         WORD
  32435 	FwMinute       WORD
  32436 	FwSecond       WORD
  32437 	FwMilliseconds WORD
  32438 }
  32439 
  32440 type SYSTEMTIME = _SYSTEMTIME
  32441 type PSYSTEMTIME = uintptr
  32442 type LPSYSTEMTIME = uintptr
  32443 
  32444 type _WIN32_FIND_DATAA = struct {
  32445 	FdwFileAttributes   DWORD
  32446 	FftCreationTime     FILETIME
  32447 	FftLastAccessTime   FILETIME
  32448 	FftLastWriteTime    FILETIME
  32449 	FnFileSizeHigh      DWORD
  32450 	FnFileSizeLow       DWORD
  32451 	FdwReserved0        DWORD
  32452 	FdwReserved1        DWORD
  32453 	FcFileName          [260]CHAR
  32454 	FcAlternateFileName [14]CHAR
  32455 	F__ccgo_pad1        [2]byte
  32456 }
  32457 
  32458 type WIN32_FIND_DATAA = _WIN32_FIND_DATAA
  32459 type PWIN32_FIND_DATAA = uintptr
  32460 type LPWIN32_FIND_DATAA = uintptr
  32461 
  32462 type _WIN32_FIND_DATAW = struct {
  32463 	FdwFileAttributes   DWORD
  32464 	FftCreationTime     FILETIME
  32465 	FftLastAccessTime   FILETIME
  32466 	FftLastWriteTime    FILETIME
  32467 	FnFileSizeHigh      DWORD
  32468 	FnFileSizeLow       DWORD
  32469 	FdwReserved0        DWORD
  32470 	FdwReserved1        DWORD
  32471 	FcFileName          [260]WCHAR
  32472 	FcAlternateFileName [14]WCHAR
  32473 }
  32474 
  32475 type WIN32_FIND_DATAW = _WIN32_FIND_DATAW
  32476 type PWIN32_FIND_DATAW = uintptr
  32477 type LPWIN32_FIND_DATAW = uintptr
  32478 
  32479 type WIN32_FIND_DATA = WIN32_FIND_DATAA
  32480 type PWIN32_FIND_DATA = PWIN32_FIND_DATAA
  32481 type LPWIN32_FIND_DATA = LPWIN32_FIND_DATAA
  32482 
  32483 type FINDEX_INFO_LEVELS = uint32
  32484 
  32485 type FINDEX_SEARCH_OPS = uint32
  32486 
  32487 type GET_FILEEX_INFO_LEVELS = uint32
  32488 
  32489 type CRITICAL_SECTION = RTL_CRITICAL_SECTION
  32490 type PCRITICAL_SECTION = PRTL_CRITICAL_SECTION
  32491 type LPCRITICAL_SECTION = PRTL_CRITICAL_SECTION
  32492 type CRITICAL_SECTION_DEBUG = RTL_CRITICAL_SECTION_DEBUG
  32493 type PCRITICAL_SECTION_DEBUG = PRTL_CRITICAL_SECTION_DEBUG
  32494 type LPCRITICAL_SECTION_DEBUG = PRTL_CRITICAL_SECTION_DEBUG
  32495 
  32496 type LPOVERLAPPED_COMPLETION_ROUTINE = uintptr
  32497 
  32498 type _PROCESS_HEAP_ENTRY = struct {
  32499 	FlpData       PVOID
  32500 	FcbData       DWORD
  32501 	FcbOverhead   BYTE
  32502 	FiRegionIndex BYTE
  32503 	FwFlags       WORD
  32504 	Fu            struct {
  32505 		FBlock struct {
  32506 			FhMem        HANDLE
  32507 			FdwReserved  [3]DWORD
  32508 			F__ccgo_pad1 [4]byte
  32509 		}
  32510 	}
  32511 }
  32512 
  32513 type PROCESS_HEAP_ENTRY = _PROCESS_HEAP_ENTRY
  32514 type LPPROCESS_HEAP_ENTRY = uintptr
  32515 type PPROCESS_HEAP_ENTRY = uintptr
  32516 
  32517 type _REASON_CONTEXT = struct {
  32518 	FVersion ULONG
  32519 	FFlags   DWORD
  32520 	FReason  struct {
  32521 		FDetailed struct {
  32522 			FLocalizedReasonModule HMODULE
  32523 			FLocalizedReasonId     ULONG
  32524 			FReasonStringCount     ULONG
  32525 			FReasonStrings         uintptr
  32526 		}
  32527 	}
  32528 }
  32529 
  32530 type REASON_CONTEXT = _REASON_CONTEXT
  32531 type PREASON_CONTEXT = uintptr
  32532 
  32533 type PTHREAD_START_ROUTINE = uintptr
  32534 type LPTHREAD_START_ROUTINE = PTHREAD_START_ROUTINE
  32535 
  32536 type PENCLAVE_ROUTINE = uintptr
  32537 type LPENCLAVE_ROUTINE = PENCLAVE_ROUTINE
  32538 
  32539 type _EXCEPTION_DEBUG_INFO = struct {
  32540 	FExceptionRecord EXCEPTION_RECORD
  32541 	FdwFirstChance   DWORD
  32542 	F__ccgo_pad1     [4]byte
  32543 }
  32544 
  32545 type EXCEPTION_DEBUG_INFO = _EXCEPTION_DEBUG_INFO
  32546 type LPEXCEPTION_DEBUG_INFO = uintptr
  32547 
  32548 type _CREATE_THREAD_DEBUG_INFO = struct {
  32549 	FhThread           HANDLE
  32550 	FlpThreadLocalBase LPVOID
  32551 	FlpStartAddress    LPTHREAD_START_ROUTINE
  32552 }
  32553 
  32554 type CREATE_THREAD_DEBUG_INFO = _CREATE_THREAD_DEBUG_INFO
  32555 type LPCREATE_THREAD_DEBUG_INFO = uintptr
  32556 
  32557 type _CREATE_PROCESS_DEBUG_INFO = struct {
  32558 	FhFile                 HANDLE
  32559 	FhProcess              HANDLE
  32560 	FhThread               HANDLE
  32561 	FlpBaseOfImage         LPVOID
  32562 	FdwDebugInfoFileOffset DWORD
  32563 	FnDebugInfoSize        DWORD
  32564 	FlpThreadLocalBase     LPVOID
  32565 	FlpStartAddress        LPTHREAD_START_ROUTINE
  32566 	FlpImageName           LPVOID
  32567 	FfUnicode              WORD
  32568 	F__ccgo_pad1           [6]byte
  32569 }
  32570 
  32571 type CREATE_PROCESS_DEBUG_INFO = _CREATE_PROCESS_DEBUG_INFO
  32572 type LPCREATE_PROCESS_DEBUG_INFO = uintptr
  32573 
  32574 type _EXIT_THREAD_DEBUG_INFO = struct{ FdwExitCode DWORD }
  32575 
  32576 type EXIT_THREAD_DEBUG_INFO = _EXIT_THREAD_DEBUG_INFO
  32577 type LPEXIT_THREAD_DEBUG_INFO = uintptr
  32578 
  32579 type _EXIT_PROCESS_DEBUG_INFO = struct{ FdwExitCode DWORD }
  32580 
  32581 type EXIT_PROCESS_DEBUG_INFO = _EXIT_PROCESS_DEBUG_INFO
  32582 type LPEXIT_PROCESS_DEBUG_INFO = uintptr
  32583 
  32584 type _LOAD_DLL_DEBUG_INFO = struct {
  32585 	FhFile                 HANDLE
  32586 	FlpBaseOfDll           LPVOID
  32587 	FdwDebugInfoFileOffset DWORD
  32588 	FnDebugInfoSize        DWORD
  32589 	FlpImageName           LPVOID
  32590 	FfUnicode              WORD
  32591 	F__ccgo_pad1           [6]byte
  32592 }
  32593 
  32594 type LOAD_DLL_DEBUG_INFO = _LOAD_DLL_DEBUG_INFO
  32595 type LPLOAD_DLL_DEBUG_INFO = uintptr
  32596 
  32597 type _UNLOAD_DLL_DEBUG_INFO = struct{ FlpBaseOfDll LPVOID }
  32598 
  32599 type UNLOAD_DLL_DEBUG_INFO = _UNLOAD_DLL_DEBUG_INFO
  32600 type LPUNLOAD_DLL_DEBUG_INFO = uintptr
  32601 
  32602 type _OUTPUT_DEBUG_STRING_INFO = struct {
  32603 	FlpDebugStringData  LPSTR
  32604 	FfUnicode           WORD
  32605 	FnDebugStringLength WORD
  32606 	F__ccgo_pad1        [4]byte
  32607 }
  32608 
  32609 type OUTPUT_DEBUG_STRING_INFO = _OUTPUT_DEBUG_STRING_INFO
  32610 type LPOUTPUT_DEBUG_STRING_INFO = uintptr
  32611 
  32612 type _RIP_INFO = struct {
  32613 	FdwError DWORD
  32614 	FdwType  DWORD
  32615 }
  32616 
  32617 type RIP_INFO = _RIP_INFO
  32618 type LPRIP_INFO = uintptr
  32619 
  32620 type _DEBUG_EVENT = struct {
  32621 	FdwDebugEventCode DWORD
  32622 	FdwProcessId      DWORD
  32623 	FdwThreadId       DWORD
  32624 	F__ccgo_pad1      [4]byte
  32625 	Fu                struct{ FException EXCEPTION_DEBUG_INFO }
  32626 }
  32627 
  32628 type DEBUG_EVENT = _DEBUG_EVENT
  32629 type LPDEBUG_EVENT = uintptr
  32630 
  32631 type LPCONTEXT = PCONTEXT
  32632 type BEM_FREE_INTERFACE_CALLBACK = uintptr
  32633 
  32634 type PTOP_LEVEL_EXCEPTION_FILTER = uintptr
  32635 type LPTOP_LEVEL_EXCEPTION_FILTER = PTOP_LEVEL_EXCEPTION_FILTER
  32636 type _BY_HANDLE_FILE_INFORMATION = struct {
  32637 	FdwFileAttributes     DWORD
  32638 	FftCreationTime       FILETIME
  32639 	FftLastAccessTime     FILETIME
  32640 	FftLastWriteTime      FILETIME
  32641 	FdwVolumeSerialNumber DWORD
  32642 	FnFileSizeHigh        DWORD
  32643 	FnFileSizeLow         DWORD
  32644 	FnNumberOfLinks       DWORD
  32645 	FnFileIndexHigh       DWORD
  32646 	FnFileIndexLow        DWORD
  32647 }
  32648 
  32649 type BY_HANDLE_FILE_INFORMATION = _BY_HANDLE_FILE_INFORMATION
  32650 type PBY_HANDLE_FILE_INFORMATION = uintptr
  32651 type LPBY_HANDLE_FILE_INFORMATION = uintptr
  32652 
  32653 type _WIN32_FILE_ATTRIBUTE_DATA = struct {
  32654 	FdwFileAttributes DWORD
  32655 	FftCreationTime   FILETIME
  32656 	FftLastAccessTime FILETIME
  32657 	FftLastWriteTime  FILETIME
  32658 	FnFileSizeHigh    DWORD
  32659 	FnFileSizeLow     DWORD
  32660 }
  32661 
  32662 type WIN32_FILE_ATTRIBUTE_DATA = _WIN32_FILE_ATTRIBUTE_DATA
  32663 type LPWIN32_FILE_ATTRIBUTE_DATA = uintptr
  32664 
  32665 type _HEAP_SUMMARY = struct {
  32666 	Fcb           DWORD
  32667 	F__ccgo_pad1  [4]byte
  32668 	FcbAllocated  SIZE_T
  32669 	FcbCommitted  SIZE_T
  32670 	FcbReserved   SIZE_T
  32671 	FcbMaxReserve SIZE_T
  32672 }
  32673 
  32674 type HEAP_SUMMARY = _HEAP_SUMMARY
  32675 type PHEAP_SUMMARY = uintptr
  32676 
  32677 type LPHEAP_SUMMARY = PHEAP_SUMMARY
  32678 
  32679 type tagENUMUILANG = struct {
  32680 	FNumOfEnumUILang    ULONG
  32681 	FSizeOfEnumUIBuffer ULONG
  32682 	FpEnumUIBuffer      uintptr
  32683 }
  32684 
  32685 type ENUMUILANG = tagENUMUILANG
  32686 type PENUMUILANG = uintptr
  32687 
  32688 type ENUMRESLANGPROCA = uintptr
  32689 type ENUMRESLANGPROCW = uintptr
  32690 type ENUMRESNAMEPROCA = uintptr
  32691 type ENUMRESNAMEPROCW = uintptr
  32692 type ENUMRESTYPEPROCA = uintptr
  32693 type ENUMRESTYPEPROCW = uintptr
  32694 
  32695 type PGET_MODULE_HANDLE_EXA = uintptr
  32696 type PGET_MODULE_HANDLE_EXW = uintptr
  32697 
  32698 type DLL_DIRECTORY_COOKIE = PVOID
  32699 type PDLL_DIRECTORY_COOKIE = uintptr
  32700 
  32701 type _REDIRECTION_FUNCTION_DESCRIPTOR = struct {
  32702 	FDllName           PCSTR
  32703 	FFunctionName      PCSTR
  32704 	FRedirectionTarget PVOID
  32705 }
  32706 
  32707 type REDIRECTION_FUNCTION_DESCRIPTOR = _REDIRECTION_FUNCTION_DESCRIPTOR
  32708 type PREDIRECTION_FUNCTION_DESCRIPTOR = uintptr
  32709 
  32710 type PCREDIRECTION_FUNCTION_DESCRIPTOR = uintptr
  32711 
  32712 type _REDIRECTION_DESCRIPTOR = struct {
  32713 	FVersion       ULONG
  32714 	FFunctionCount ULONG
  32715 	FRedirections  PCREDIRECTION_FUNCTION_DESCRIPTOR
  32716 }
  32717 
  32718 type REDIRECTION_DESCRIPTOR = _REDIRECTION_DESCRIPTOR
  32719 type PREDIRECTION_DESCRIPTOR = uintptr
  32720 
  32721 type PCREDIRECTION_DESCRIPTOR = uintptr
  32722 
  32723 type MEMORY_RESOURCE_NOTIFICATION_TYPE = uint32
  32724 
  32725 type _STARTUPINFOA = struct {
  32726 	Fcb              DWORD
  32727 	F__ccgo_pad1     [4]byte
  32728 	FlpReserved      LPSTR
  32729 	FlpDesktop       LPSTR
  32730 	FlpTitle         LPSTR
  32731 	FdwX             DWORD
  32732 	FdwY             DWORD
  32733 	FdwXSize         DWORD
  32734 	FdwYSize         DWORD
  32735 	FdwXCountChars   DWORD
  32736 	FdwYCountChars   DWORD
  32737 	FdwFillAttribute DWORD
  32738 	FdwFlags         DWORD
  32739 	FwShowWindow     WORD
  32740 	FcbReserved2     WORD
  32741 	F__ccgo_pad2     [4]byte
  32742 	FlpReserved2     LPBYTE
  32743 	FhStdInput       HANDLE
  32744 	FhStdOutput      HANDLE
  32745 	FhStdError       HANDLE
  32746 }
  32747 
  32748 type STARTUPINFOA = _STARTUPINFOA
  32749 type LPSTARTUPINFOA = uintptr
  32750 
  32751 type _STARTUPINFOW = struct {
  32752 	Fcb              DWORD
  32753 	F__ccgo_pad1     [4]byte
  32754 	FlpReserved      LPWSTR
  32755 	FlpDesktop       LPWSTR
  32756 	FlpTitle         LPWSTR
  32757 	FdwX             DWORD
  32758 	FdwY             DWORD
  32759 	FdwXSize         DWORD
  32760 	FdwYSize         DWORD
  32761 	FdwXCountChars   DWORD
  32762 	FdwYCountChars   DWORD
  32763 	FdwFillAttribute DWORD
  32764 	FdwFlags         DWORD
  32765 	FwShowWindow     WORD
  32766 	FcbReserved2     WORD
  32767 	F__ccgo_pad2     [4]byte
  32768 	FlpReserved2     LPBYTE
  32769 	FhStdInput       HANDLE
  32770 	FhStdOutput      HANDLE
  32771 	FhStdError       HANDLE
  32772 }
  32773 
  32774 type STARTUPINFOW = _STARTUPINFOW
  32775 type LPSTARTUPINFOW = uintptr
  32776 
  32777 type STARTUPINFO = STARTUPINFOA
  32778 type LPSTARTUPINFO = LPSTARTUPINFOA
  32779 
  32780 type _PROCESS_INFORMATION = struct {
  32781 	FhProcess    HANDLE
  32782 	FhThread     HANDLE
  32783 	FdwProcessId DWORD
  32784 	FdwThreadId  DWORD
  32785 }
  32786 
  32787 type PROCESS_INFORMATION = _PROCESS_INFORMATION
  32788 type PPROCESS_INFORMATION = uintptr
  32789 type LPPROCESS_INFORMATION = uintptr
  32790 
  32791 type PPROC_THREAD_ATTRIBUTE_LIST = uintptr
  32792 type LPPROC_THREAD_ATTRIBUTE_LIST = uintptr
  32793 
  32794 type SRWLOCK = RTL_SRWLOCK
  32795 type PSRWLOCK = uintptr
  32796 
  32797 type INIT_ONCE = RTL_RUN_ONCE
  32798 type PINIT_ONCE = PRTL_RUN_ONCE
  32799 type LPINIT_ONCE = PRTL_RUN_ONCE
  32800 
  32801 type PINIT_ONCE_FN = uintptr
  32802 type CONDITION_VARIABLE = RTL_CONDITION_VARIABLE
  32803 type PCONDITION_VARIABLE = uintptr
  32804 
  32805 type PTIMERAPCROUTINE = uintptr
  32806 
  32807 type SYNCHRONIZATION_BARRIER = RTL_BARRIER
  32808 type PSYNCHRONIZATION_BARRIER = PRTL_BARRIER
  32809 type LPSYNCHRONIZATION_BARRIER = PRTL_BARRIER
  32810 
  32811 type _SYSTEM_INFO = struct {
  32812 	Fu                           struct{ FdwOemId DWORD }
  32813 	FdwPageSize                  DWORD
  32814 	FlpMinimumApplicationAddress LPVOID
  32815 	FlpMaximumApplicationAddress LPVOID
  32816 	FdwActiveProcessorMask       DWORD_PTR
  32817 	FdwNumberOfProcessors        DWORD
  32818 	FdwProcessorType             DWORD
  32819 	FdwAllocationGranularity     DWORD
  32820 	FwProcessorLevel             WORD
  32821 	FwProcessorRevision          WORD
  32822 }
  32823 
  32824 type SYSTEM_INFO = _SYSTEM_INFO
  32825 type LPSYSTEM_INFO = uintptr
  32826 
  32827 type _MEMORYSTATUSEX = struct {
  32828 	FdwLength                DWORD
  32829 	FdwMemoryLoad            DWORD
  32830 	FullTotalPhys            DWORDLONG
  32831 	FullAvailPhys            DWORDLONG
  32832 	FullTotalPageFile        DWORDLONG
  32833 	FullAvailPageFile        DWORDLONG
  32834 	FullTotalVirtual         DWORDLONG
  32835 	FullAvailVirtual         DWORDLONG
  32836 	FullAvailExtendedVirtual DWORDLONG
  32837 }
  32838 
  32839 type MEMORYSTATUSEX = _MEMORYSTATUSEX
  32840 type LPMEMORYSTATUSEX = uintptr
  32841 
  32842 type COMPUTER_NAME_FORMAT = uint32
  32843 
  32844 type PTP_WIN32_IO_CALLBACK = uintptr
  32845 
  32846 type PFIBER_START_ROUTINE = uintptr
  32847 type LPFIBER_START_ROUTINE = PFIBER_START_ROUTINE
  32848 
  32849 type LPLDT_ENTRY = LPVOID
  32850 
  32851 type _COMMPROP = struct {
  32852 	FwPacketLength       WORD
  32853 	FwPacketVersion      WORD
  32854 	FdwServiceMask       DWORD
  32855 	FdwReserved1         DWORD
  32856 	FdwMaxTxQueue        DWORD
  32857 	FdwMaxRxQueue        DWORD
  32858 	FdwMaxBaud           DWORD
  32859 	FdwProvSubType       DWORD
  32860 	FdwProvCapabilities  DWORD
  32861 	FdwSettableParams    DWORD
  32862 	FdwSettableBaud      DWORD
  32863 	FwSettableData       WORD
  32864 	FwSettableStopParity WORD
  32865 	FdwCurrentTxQueue    DWORD
  32866 	FdwCurrentRxQueue    DWORD
  32867 	FdwProvSpec1         DWORD
  32868 	FdwProvSpec2         DWORD
  32869 	FwcProvChar          [1]WCHAR
  32870 	F__ccgo_pad1         [2]byte
  32871 }
  32872 
  32873 type COMMPROP = _COMMPROP
  32874 type LPCOMMPROP = uintptr
  32875 
  32876 type _COMSTAT = struct {
  32877 	FfCtsHold    uint32
  32878 	F__ccgo_pad1 [4]byte
  32879 	FcbInQue     DWORD
  32880 	FcbOutQue    DWORD
  32881 }
  32882 
  32883 type COMSTAT = _COMSTAT
  32884 type LPCOMSTAT = uintptr
  32885 
  32886 type _DCB = struct {
  32887 	FDCBlength   DWORD
  32888 	FBaudRate    DWORD
  32889 	FfBinary     uint32
  32890 	F__ccgo_pad1 [2]byte
  32891 	FwReserved   WORD
  32892 	FXonLim      WORD
  32893 	FXoffLim     WORD
  32894 	FByteSize    BYTE
  32895 	FParity      BYTE
  32896 	FStopBits    BYTE
  32897 	FXonChar     int8
  32898 	FXoffChar    int8
  32899 	FErrorChar   int8
  32900 	FEofChar     int8
  32901 	FEvtChar     int8
  32902 	FwReserved1  WORD
  32903 	F__ccgo_pad2 [2]byte
  32904 }
  32905 
  32906 type DCB = _DCB
  32907 type LPDCB = uintptr
  32908 
  32909 type _COMMTIMEOUTS = struct {
  32910 	FReadIntervalTimeout         DWORD
  32911 	FReadTotalTimeoutMultiplier  DWORD
  32912 	FReadTotalTimeoutConstant    DWORD
  32913 	FWriteTotalTimeoutMultiplier DWORD
  32914 	FWriteTotalTimeoutConstant   DWORD
  32915 }
  32916 
  32917 type COMMTIMEOUTS = _COMMTIMEOUTS
  32918 type LPCOMMTIMEOUTS = uintptr
  32919 
  32920 type _COMMCONFIG = struct {
  32921 	FdwSize            DWORD
  32922 	FwVersion          WORD
  32923 	FwReserved         WORD
  32924 	Fdcb               DCB
  32925 	FdwProviderSubType DWORD
  32926 	FdwProviderOffset  DWORD
  32927 	FdwProviderSize    DWORD
  32928 	FwcProviderData    [1]WCHAR
  32929 	F__ccgo_pad1       [2]byte
  32930 }
  32931 
  32932 type COMMCONFIG = _COMMCONFIG
  32933 type LPCOMMCONFIG = uintptr
  32934 
  32935 type _MEMORYSTATUS = struct {
  32936 	FdwLength        DWORD
  32937 	FdwMemoryLoad    DWORD
  32938 	FdwTotalPhys     SIZE_T
  32939 	FdwAvailPhys     SIZE_T
  32940 	FdwTotalPageFile SIZE_T
  32941 	FdwAvailPageFile SIZE_T
  32942 	FdwTotalVirtual  SIZE_T
  32943 	FdwAvailVirtual  SIZE_T
  32944 }
  32945 
  32946 type MEMORYSTATUS = _MEMORYSTATUS
  32947 type LPMEMORYSTATUS = uintptr
  32948 
  32949 type _JIT_DEBUG_INFO = struct {
  32950 	FdwSize                  DWORD
  32951 	FdwProcessorArchitecture DWORD
  32952 	FdwThreadID              DWORD
  32953 	FdwReserved0             DWORD
  32954 	FlpExceptionAddress      ULONG64
  32955 	FlpExceptionRecord       ULONG64
  32956 	FlpContextRecord         ULONG64
  32957 }
  32958 
  32959 type JIT_DEBUG_INFO = _JIT_DEBUG_INFO
  32960 type LPJIT_DEBUG_INFO = uintptr
  32961 
  32962 type JIT_DEBUG_INFO32 = JIT_DEBUG_INFO
  32963 type LPJIT_DEBUG_INFO32 = uintptr
  32964 type JIT_DEBUG_INFO64 = JIT_DEBUG_INFO
  32965 type LPJIT_DEBUG_INFO64 = uintptr
  32966 
  32967 type LPEXCEPTION_RECORD = PEXCEPTION_RECORD
  32968 type LPEXCEPTION_POINTERS = PEXCEPTION_POINTERS
  32969 
  32970 type _OFSTRUCT = struct {
  32971 	FcBytes     BYTE
  32972 	FfFixedDisk BYTE
  32973 	FnErrCode   WORD
  32974 	FReserved1  WORD
  32975 	FReserved2  WORD
  32976 	FszPathName [128]CHAR
  32977 }
  32978 
  32979 type OFSTRUCT = _OFSTRUCT
  32980 type LPOFSTRUCT = uintptr
  32981 type POFSTRUCT = uintptr
  32982 
  32983 type THREAD_INFORMATION_CLASS = uint32
  32984 
  32985 type DEP_SYSTEM_POLICY_TYPE = uint32
  32986 
  32987 type PFE_EXPORT_FUNC = uintptr
  32988 type PFE_IMPORT_FUNC = uintptr
  32989 
  32990 type _WIN32_STREAM_ID = struct {
  32991 	FdwStreamId         DWORD
  32992 	FdwStreamAttributes DWORD
  32993 	FSize               LARGE_INTEGER
  32994 	FdwStreamNameSize   DWORD
  32995 	FcStreamName        [1]WCHAR
  32996 	F__ccgo_pad1        [2]byte
  32997 }
  32998 
  32999 type WIN32_STREAM_ID = _WIN32_STREAM_ID
  33000 type LPWIN32_STREAM_ID = uintptr
  33001 
  33002 type PROCESS_INFORMATION_CLASS = uint32
  33003 
  33004 type PGET_SYSTEM_WOW64_DIRECTORY_A = uintptr
  33005 type PGET_SYSTEM_WOW64_DIRECTORY_W = uintptr
  33006 
  33007 type LPPROGRESS_ROUTINE = uintptr
  33008 
  33009 type STREAM_INFO_LEVELS = uint32
  33010 
  33011 type _WIN32_FIND_STREAM_DATA = struct {
  33012 	FStreamSize  LARGE_INTEGER
  33013 	FcStreamName [296]WCHAR
  33014 }
  33015 
  33016 type WIN32_FIND_STREAM_DATA = _WIN32_FIND_STREAM_DATA
  33017 type PWIN32_FIND_STREAM_DATA = uintptr
  33018 
  33019 type _EVENTLOG_FULL_INFORMATION = struct{ FdwFull DWORD }
  33020 
  33021 type EVENTLOG_FULL_INFORMATION = _EVENTLOG_FULL_INFORMATION
  33022 type LPEVENTLOG_FULL_INFORMATION = uintptr
  33023 
  33024 type tagHW_PROFILE_INFOA = struct {
  33025 	FdwDockInfo      DWORD
  33026 	FszHwProfileGuid [39]CHAR
  33027 	FszHwProfileName [80]CHAR
  33028 	F__ccgo_pad1     [1]byte
  33029 }
  33030 
  33031 type HW_PROFILE_INFOA = tagHW_PROFILE_INFOA
  33032 type LPHW_PROFILE_INFOA = uintptr
  33033 
  33034 type tagHW_PROFILE_INFOW = struct {
  33035 	FdwDockInfo      DWORD
  33036 	FszHwProfileGuid [39]WCHAR
  33037 	FszHwProfileName [80]WCHAR
  33038 	F__ccgo_pad1     [2]byte
  33039 }
  33040 
  33041 type HW_PROFILE_INFOW = tagHW_PROFILE_INFOW
  33042 type LPHW_PROFILE_INFOW = uintptr
  33043 
  33044 type HW_PROFILE_INFO = HW_PROFILE_INFOA
  33045 type LPHW_PROFILE_INFO = LPHW_PROFILE_INFOA
  33046 
  33047 type _TIME_ZONE_INFORMATION = struct {
  33048 	FBias         LONG
  33049 	FStandardName [32]WCHAR
  33050 	FStandardDate SYSTEMTIME
  33051 	FStandardBias LONG
  33052 	FDaylightName [32]WCHAR
  33053 	FDaylightDate SYSTEMTIME
  33054 	FDaylightBias LONG
  33055 }
  33056 
  33057 type TIME_ZONE_INFORMATION = _TIME_ZONE_INFORMATION
  33058 type PTIME_ZONE_INFORMATION = uintptr
  33059 type LPTIME_ZONE_INFORMATION = uintptr
  33060 
  33061 type _TIME_DYNAMIC_ZONE_INFORMATION = struct {
  33062 	FBias                        LONG
  33063 	FStandardName                [32]WCHAR
  33064 	FStandardDate                SYSTEMTIME
  33065 	FStandardBias                LONG
  33066 	FDaylightName                [32]WCHAR
  33067 	FDaylightDate                SYSTEMTIME
  33068 	FDaylightBias                LONG
  33069 	FTimeZoneKeyName             [128]WCHAR
  33070 	FDynamicDaylightTimeDisabled BOOLEAN
  33071 	F__ccgo_pad1                 [3]byte
  33072 }
  33073 
  33074 type DYNAMIC_TIME_ZONE_INFORMATION = _TIME_DYNAMIC_ZONE_INFORMATION
  33075 type PDYNAMIC_TIME_ZONE_INFORMATION = uintptr
  33076 
  33077 type _SYSTEM_POWER_STATUS = struct {
  33078 	FACLineStatus        BYTE
  33079 	FBatteryFlag         BYTE
  33080 	FBatteryLifePercent  BYTE
  33081 	FReserved1           BYTE
  33082 	FBatteryLifeTime     DWORD
  33083 	FBatteryFullLifeTime DWORD
  33084 }
  33085 
  33086 type SYSTEM_POWER_STATUS = _SYSTEM_POWER_STATUS
  33087 type LPSYSTEM_POWER_STATUS = uintptr
  33088 
  33089 type tagACTCTXA = struct {
  33090 	FcbSize                 ULONG
  33091 	FdwFlags                DWORD
  33092 	FlpSource               LPCSTR
  33093 	FwProcessorArchitecture USHORT
  33094 	FwLangId                LANGID
  33095 	F__ccgo_pad1            [4]byte
  33096 	FlpAssemblyDirectory    LPCSTR
  33097 	FlpResourceName         LPCSTR
  33098 	FlpApplicationName      LPCSTR
  33099 	FhModule                HMODULE
  33100 }
  33101 
  33102 type ACTCTXA = tagACTCTXA
  33103 type PACTCTXA = uintptr
  33104 
  33105 type tagACTCTXW = struct {
  33106 	FcbSize                 ULONG
  33107 	FdwFlags                DWORD
  33108 	FlpSource               LPCWSTR
  33109 	FwProcessorArchitecture USHORT
  33110 	FwLangId                LANGID
  33111 	F__ccgo_pad1            [4]byte
  33112 	FlpAssemblyDirectory    LPCWSTR
  33113 	FlpResourceName         LPCWSTR
  33114 	FlpApplicationName      LPCWSTR
  33115 	FhModule                HMODULE
  33116 }
  33117 
  33118 type ACTCTXW = tagACTCTXW
  33119 type PACTCTXW = uintptr
  33120 
  33121 type ACTCTX = ACTCTXA
  33122 type PACTCTX = PACTCTXA
  33123 
  33124 type PCACTCTXA = uintptr
  33125 type PCACTCTXW = uintptr
  33126 
  33127 type PCACTCTX = PCACTCTXA
  33128 
  33129 type tagACTCTX_SECTION_KEYED_DATA_2600 = struct {
  33130 	FcbSize                    ULONG
  33131 	FulDataFormatVersion       ULONG
  33132 	FlpData                    PVOID
  33133 	FulLength                  ULONG
  33134 	F__ccgo_pad1               [4]byte
  33135 	FlpSectionGlobalData       PVOID
  33136 	FulSectionGlobalDataLength ULONG
  33137 	F__ccgo_pad2               [4]byte
  33138 	FlpSectionBase             PVOID
  33139 	FulSectionTotalLength      ULONG
  33140 	F__ccgo_pad3               [4]byte
  33141 	FhActCtx                   HANDLE
  33142 	FulAssemblyRosterIndex     ULONG
  33143 	F__ccgo_pad4               [4]byte
  33144 }
  33145 
  33146 type ACTCTX_SECTION_KEYED_DATA_2600 = tagACTCTX_SECTION_KEYED_DATA_2600
  33147 type PACTCTX_SECTION_KEYED_DATA_2600 = uintptr
  33148 
  33149 type PCACTCTX_SECTION_KEYED_DATA_2600 = uintptr
  33150 
  33151 type tagACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA = struct {
  33152 	FlpInformation             PVOID
  33153 	FlpSectionBase             PVOID
  33154 	FulSectionLength           ULONG
  33155 	F__ccgo_pad1               [4]byte
  33156 	FlpSectionGlobalDataBase   PVOID
  33157 	FulSectionGlobalDataLength ULONG
  33158 	F__ccgo_pad2               [4]byte
  33159 }
  33160 
  33161 type ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA = tagACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA
  33162 type PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA = uintptr
  33163 
  33164 type PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA = uintptr
  33165 
  33166 type tagACTCTX_SECTION_KEYED_DATA = struct {
  33167 	FcbSize                    ULONG
  33168 	FulDataFormatVersion       ULONG
  33169 	FlpData                    PVOID
  33170 	FulLength                  ULONG
  33171 	F__ccgo_pad1               [4]byte
  33172 	FlpSectionGlobalData       PVOID
  33173 	FulSectionGlobalDataLength ULONG
  33174 	F__ccgo_pad2               [4]byte
  33175 	FlpSectionBase             PVOID
  33176 	FulSectionTotalLength      ULONG
  33177 	F__ccgo_pad3               [4]byte
  33178 	FhActCtx                   HANDLE
  33179 	FulAssemblyRosterIndex     ULONG
  33180 	FulFlags                   ULONG
  33181 	FAssemblyMetadata          ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA
  33182 }
  33183 
  33184 type ACTCTX_SECTION_KEYED_DATA = tagACTCTX_SECTION_KEYED_DATA
  33185 type PACTCTX_SECTION_KEYED_DATA = uintptr
  33186 
  33187 type PCACTCTX_SECTION_KEYED_DATA = uintptr
  33188 
  33189 type _ACTIVATION_CONTEXT_BASIC_INFORMATION = struct {
  33190 	FhActCtx     HANDLE
  33191 	FdwFlags     DWORD
  33192 	F__ccgo_pad1 [4]byte
  33193 }
  33194 
  33195 type ACTIVATION_CONTEXT_BASIC_INFORMATION = _ACTIVATION_CONTEXT_BASIC_INFORMATION
  33196 type PACTIVATION_CONTEXT_BASIC_INFORMATION = uintptr
  33197 
  33198 type PCACTIVATION_CONTEXT_BASIC_INFORMATION = uintptr
  33199 
  33200 type PQUERYACTCTXW_FUNC = uintptr
  33201 
  33202 type APPLICATION_RECOVERY_CALLBACK = uintptr
  33203 
  33204 type _DRAWPATRECT = struct {
  33205 	FptPosition POINT
  33206 	FptSize     POINT
  33207 	FwStyle     WORD
  33208 	FwPattern   WORD
  33209 }
  33210 
  33211 type DRAWPATRECT = _DRAWPATRECT
  33212 type PDRAWPATRECT = uintptr
  33213 
  33214 type _PSINJECTDATA = struct {
  33215 	FDataBytes      DWORD
  33216 	FInjectionPoint WORD
  33217 	FPageNumber     WORD
  33218 }
  33219 
  33220 type PSINJECTDATA = _PSINJECTDATA
  33221 type PPSINJECTDATA = uintptr
  33222 
  33223 type _PSFEATURE_OUTPUT = struct {
  33224 	FbPageIndependent WINBOOL
  33225 	FbSetPageDevice   WINBOOL
  33226 }
  33227 
  33228 type PSFEATURE_OUTPUT = _PSFEATURE_OUTPUT
  33229 type PPSFEATURE_OUTPUT = uintptr
  33230 
  33231 type _PSFEATURE_CUSTPAPER = struct {
  33232 	FlOrientation  LONG
  33233 	FlWidth        LONG
  33234 	FlHeight       LONG
  33235 	FlWidthOffset  LONG
  33236 	FlHeightOffset LONG
  33237 }
  33238 
  33239 type PSFEATURE_CUSTPAPER = _PSFEATURE_CUSTPAPER
  33240 type PPSFEATURE_CUSTPAPER = uintptr
  33241 
  33242 type tagXFORM = struct {
  33243 	FeM11 FLOAT
  33244 	FeM12 FLOAT
  33245 	FeM21 FLOAT
  33246 	FeM22 FLOAT
  33247 	FeDx  FLOAT
  33248 	FeDy  FLOAT
  33249 }
  33250 
  33251 type XFORM = tagXFORM
  33252 type PXFORM = uintptr
  33253 type LPXFORM = uintptr
  33254 
  33255 type tagBITMAP = struct {
  33256 	FbmType       LONG
  33257 	FbmWidth      LONG
  33258 	FbmHeight     LONG
  33259 	FbmWidthBytes LONG
  33260 	FbmPlanes     WORD
  33261 	FbmBitsPixel  WORD
  33262 	F__ccgo_pad1  [4]byte
  33263 	FbmBits       LPVOID
  33264 }
  33265 
  33266 type BITMAP = tagBITMAP
  33267 type PBITMAP = uintptr
  33268 type NPBITMAP = uintptr
  33269 type LPBITMAP = uintptr
  33270 
  33271 type tagRGBTRIPLE = struct {
  33272 	FrgbtBlue  BYTE
  33273 	FrgbtGreen BYTE
  33274 	FrgbtRed   BYTE
  33275 }
  33276 
  33277 // *
  33278 // This file has no copyright assigned and is placed in the Public Domain.
  33279 // This file is part of the mingw-w64 runtime package.
  33280 // No warranty is given; refer to the file DISCLAIMER.PD within this package.
  33281 type RGBTRIPLE = tagRGBTRIPLE
  33282 type PRGBTRIPLE = uintptr
  33283 type NPRGBTRIPLE = uintptr
  33284 type LPRGBTRIPLE = uintptr
  33285 
  33286 type tagRGBQUAD = struct {
  33287 	FrgbBlue     BYTE
  33288 	FrgbGreen    BYTE
  33289 	FrgbRed      BYTE
  33290 	FrgbReserved BYTE
  33291 }
  33292 
  33293 type RGBQUAD = tagRGBQUAD
  33294 
  33295 type LPRGBQUAD = uintptr
  33296 
  33297 type LCSCSTYPE = LONG
  33298 
  33299 type LCSGAMUTMATCH = LONG
  33300 
  33301 type FXPT16DOT16 = int32
  33302 type LPFXPT16DOT16 = uintptr
  33303 type FXPT2DOT30 = int32
  33304 type LPFXPT2DOT30 = uintptr
  33305 
  33306 type tagCIEXYZ = struct {
  33307 	FciexyzX FXPT2DOT30
  33308 	FciexyzY FXPT2DOT30
  33309 	FciexyzZ FXPT2DOT30
  33310 }
  33311 
  33312 type CIEXYZ = tagCIEXYZ
  33313 type LPCIEXYZ = uintptr
  33314 type tagICEXYZTRIPLE = struct {
  33315 	FciexyzRed   CIEXYZ
  33316 	FciexyzGreen CIEXYZ
  33317 	FciexyzBlue  CIEXYZ
  33318 }
  33319 
  33320 type CIEXYZTRIPLE = tagICEXYZTRIPLE
  33321 type LPCIEXYZTRIPLE = uintptr
  33322 
  33323 type tagLOGCOLORSPACEA = struct {
  33324 	FlcsSignature  DWORD
  33325 	FlcsVersion    DWORD
  33326 	FlcsSize       DWORD
  33327 	FlcsCSType     LCSCSTYPE
  33328 	FlcsIntent     LCSGAMUTMATCH
  33329 	FlcsEndpoints  CIEXYZTRIPLE
  33330 	FlcsGammaRed   DWORD
  33331 	FlcsGammaGreen DWORD
  33332 	FlcsGammaBlue  DWORD
  33333 	FlcsFilename   [260]CHAR
  33334 }
  33335 
  33336 type LOGCOLORSPACEA = tagLOGCOLORSPACEA
  33337 type LPLOGCOLORSPACEA = uintptr
  33338 
  33339 type tagLOGCOLORSPACEW = struct {
  33340 	FlcsSignature  DWORD
  33341 	FlcsVersion    DWORD
  33342 	FlcsSize       DWORD
  33343 	FlcsCSType     LCSCSTYPE
  33344 	FlcsIntent     LCSGAMUTMATCH
  33345 	FlcsEndpoints  CIEXYZTRIPLE
  33346 	FlcsGammaRed   DWORD
  33347 	FlcsGammaGreen DWORD
  33348 	FlcsGammaBlue  DWORD
  33349 	FlcsFilename   [260]WCHAR
  33350 }
  33351 
  33352 type LOGCOLORSPACEW = tagLOGCOLORSPACEW
  33353 type LPLOGCOLORSPACEW = uintptr
  33354 
  33355 type LOGCOLORSPACE = LOGCOLORSPACEA
  33356 type LPLOGCOLORSPACE = LPLOGCOLORSPACEA
  33357 
  33358 type tagBITMAPCOREHEADER = struct {
  33359 	FbcSize     DWORD
  33360 	FbcWidth    WORD
  33361 	FbcHeight   WORD
  33362 	FbcPlanes   WORD
  33363 	FbcBitCount WORD
  33364 }
  33365 
  33366 type BITMAPCOREHEADER = tagBITMAPCOREHEADER
  33367 type LPBITMAPCOREHEADER = uintptr
  33368 type PBITMAPCOREHEADER = uintptr
  33369 
  33370 type tagBITMAPINFOHEADER = struct {
  33371 	FbiSize          DWORD
  33372 	FbiWidth         LONG
  33373 	FbiHeight        LONG
  33374 	FbiPlanes        WORD
  33375 	FbiBitCount      WORD
  33376 	FbiCompression   DWORD
  33377 	FbiSizeImage     DWORD
  33378 	FbiXPelsPerMeter LONG
  33379 	FbiYPelsPerMeter LONG
  33380 	FbiClrUsed       DWORD
  33381 	FbiClrImportant  DWORD
  33382 }
  33383 
  33384 type BITMAPINFOHEADER = tagBITMAPINFOHEADER
  33385 type LPBITMAPINFOHEADER = uintptr
  33386 type PBITMAPINFOHEADER = uintptr
  33387 
  33388 type BITMAPV4HEADER = struct {
  33389 	FbV4Size          DWORD
  33390 	FbV4Width         LONG
  33391 	FbV4Height        LONG
  33392 	FbV4Planes        WORD
  33393 	FbV4BitCount      WORD
  33394 	FbV4V4Compression DWORD
  33395 	FbV4SizeImage     DWORD
  33396 	FbV4XPelsPerMeter LONG
  33397 	FbV4YPelsPerMeter LONG
  33398 	FbV4ClrUsed       DWORD
  33399 	FbV4ClrImportant  DWORD
  33400 	FbV4RedMask       DWORD
  33401 	FbV4GreenMask     DWORD
  33402 	FbV4BlueMask      DWORD
  33403 	FbV4AlphaMask     DWORD
  33404 	FbV4CSType        DWORD
  33405 	FbV4Endpoints     CIEXYZTRIPLE
  33406 	FbV4GammaRed      DWORD
  33407 	FbV4GammaGreen    DWORD
  33408 	FbV4GammaBlue     DWORD
  33409 }
  33410 type LPBITMAPV4HEADER = uintptr
  33411 type PBITMAPV4HEADER = uintptr
  33412 
  33413 type BITMAPV5HEADER = struct {
  33414 	FbV5Size          DWORD
  33415 	FbV5Width         LONG
  33416 	FbV5Height        LONG
  33417 	FbV5Planes        WORD
  33418 	FbV5BitCount      WORD
  33419 	FbV5Compression   DWORD
  33420 	FbV5SizeImage     DWORD
  33421 	FbV5XPelsPerMeter LONG
  33422 	FbV5YPelsPerMeter LONG
  33423 	FbV5ClrUsed       DWORD
  33424 	FbV5ClrImportant  DWORD
  33425 	FbV5RedMask       DWORD
  33426 	FbV5GreenMask     DWORD
  33427 	FbV5BlueMask      DWORD
  33428 	FbV5AlphaMask     DWORD
  33429 	FbV5CSType        DWORD
  33430 	FbV5Endpoints     CIEXYZTRIPLE
  33431 	FbV5GammaRed      DWORD
  33432 	FbV5GammaGreen    DWORD
  33433 	FbV5GammaBlue     DWORD
  33434 	FbV5Intent        DWORD
  33435 	FbV5ProfileData   DWORD
  33436 	FbV5ProfileSize   DWORD
  33437 	FbV5Reserved      DWORD
  33438 }
  33439 type LPBITMAPV5HEADER = uintptr
  33440 type PBITMAPV5HEADER = uintptr
  33441 
  33442 type tagBITMAPINFO = struct {
  33443 	FbmiHeader BITMAPINFOHEADER
  33444 	FbmiColors [1]RGBQUAD
  33445 }
  33446 
  33447 type BITMAPINFO = tagBITMAPINFO
  33448 type LPBITMAPINFO = uintptr
  33449 type PBITMAPINFO = uintptr
  33450 
  33451 type tagBITMAPCOREINFO = struct {
  33452 	FbmciHeader  BITMAPCOREHEADER
  33453 	FbmciColors  [1]RGBTRIPLE
  33454 	F__ccgo_pad1 [1]byte
  33455 }
  33456 
  33457 type BITMAPCOREINFO = tagBITMAPCOREINFO
  33458 type LPBITMAPCOREINFO = uintptr
  33459 type PBITMAPCOREINFO = uintptr
  33460 
  33461 type tagBITMAPFILEHEADER = struct {
  33462 	FbfType      WORD
  33463 	F__ccgo_pad1 [2]byte
  33464 	FbfSize      DWORD
  33465 	FbfReserved1 WORD
  33466 	FbfReserved2 WORD
  33467 	FbfOffBits   DWORD
  33468 }
  33469 
  33470 // *
  33471 // This file has no copyright assigned and is placed in the Public Domain.
  33472 // This file is part of the mingw-w64 runtime package.
  33473 // No warranty is given; refer to the file DISCLAIMER.PD within this package.
  33474 type BITMAPFILEHEADER = tagBITMAPFILEHEADER
  33475 type LPBITMAPFILEHEADER = uintptr
  33476 type PBITMAPFILEHEADER = uintptr
  33477 
  33478 type tagFONTSIGNATURE = struct {
  33479 	FfsUsb [4]DWORD
  33480 	FfsCsb [2]DWORD
  33481 }
  33482 
  33483 type FONTSIGNATURE = tagFONTSIGNATURE
  33484 type PFONTSIGNATURE = uintptr
  33485 type LPFONTSIGNATURE = uintptr
  33486 
  33487 type tagCHARSETINFO = struct {
  33488 	FciCharset UINT
  33489 	FciACP     UINT
  33490 	Ffs        FONTSIGNATURE
  33491 }
  33492 
  33493 type CHARSETINFO = tagCHARSETINFO
  33494 type PCHARSETINFO = uintptr
  33495 type NPCHARSETINFO = uintptr
  33496 type LPCHARSETINFO = uintptr
  33497 
  33498 type tagLOCALESIGNATURE = struct {
  33499 	FlsUsb          [4]DWORD
  33500 	FlsCsbDefault   [2]DWORD
  33501 	FlsCsbSupported [2]DWORD
  33502 }
  33503 
  33504 type LOCALESIGNATURE = tagLOCALESIGNATURE
  33505 type PLOCALESIGNATURE = uintptr
  33506 type LPLOCALESIGNATURE = uintptr
  33507 
  33508 type tagHANDLETABLE = struct{ FobjectHandle [1]HGDIOBJ }
  33509 
  33510 type HANDLETABLE = tagHANDLETABLE
  33511 type PHANDLETABLE = uintptr
  33512 type LPHANDLETABLE = uintptr
  33513 
  33514 type tagMETARECORD = struct {
  33515 	FrdSize     DWORD
  33516 	FrdFunction WORD
  33517 	FrdParm     [1]WORD
  33518 }
  33519 
  33520 type METARECORD = tagMETARECORD
  33521 type PMETARECORD = uintptr
  33522 type LPMETARECORD = uintptr
  33523 
  33524 type tagMETAFILEPICT = struct {
  33525 	Fmm          LONG
  33526 	FxExt        LONG
  33527 	FyExt        LONG
  33528 	F__ccgo_pad1 [4]byte
  33529 	FhMF         HMETAFILE
  33530 }
  33531 
  33532 type METAFILEPICT = tagMETAFILEPICT
  33533 type LPMETAFILEPICT = uintptr
  33534 
  33535 type tagMETAHEADER = struct {
  33536 	FmtType         WORD
  33537 	FmtHeaderSize   WORD
  33538 	FmtVersion      WORD
  33539 	F__ccgo_pad1    [2]byte
  33540 	FmtSize         DWORD
  33541 	FmtNoObjects    WORD
  33542 	F__ccgo_pad2    [2]byte
  33543 	FmtMaxRecord    DWORD
  33544 	FmtNoParameters WORD
  33545 	F__ccgo_pad3    [2]byte
  33546 }
  33547 
  33548 // *
  33549 // This file has no copyright assigned and is placed in the Public Domain.
  33550 // This file is part of the mingw-w64 runtime package.
  33551 // No warranty is given; refer to the file DISCLAIMER.PD within this package.
  33552 type METAHEADER = tagMETAHEADER
  33553 type PMETAHEADER = uintptr
  33554 type LPMETAHEADER = uintptr
  33555 
  33556 type tagENHMETARECORD = struct {
  33557 	FiType DWORD
  33558 	FnSize DWORD
  33559 	FdParm [1]DWORD
  33560 }
  33561 
  33562 type ENHMETARECORD = tagENHMETARECORD
  33563 type PENHMETARECORD = uintptr
  33564 type LPENHMETARECORD = uintptr
  33565 
  33566 type tagENHMETAHEADER = struct {
  33567 	FiType          DWORD
  33568 	FnSize          DWORD
  33569 	FrclBounds      RECTL
  33570 	FrclFrame       RECTL
  33571 	FdSignature     DWORD
  33572 	FnVersion       DWORD
  33573 	FnBytes         DWORD
  33574 	FnRecords       DWORD
  33575 	FnHandles       WORD
  33576 	FsReserved      WORD
  33577 	FnDescription   DWORD
  33578 	FoffDescription DWORD
  33579 	FnPalEntries    DWORD
  33580 	FszlDevice      SIZEL
  33581 	FszlMillimeters SIZEL
  33582 	FcbPixelFormat  DWORD
  33583 	FoffPixelFormat DWORD
  33584 	FbOpenGL        DWORD
  33585 	FszlMicrometers SIZEL
  33586 }
  33587 
  33588 type ENHMETAHEADER = tagENHMETAHEADER
  33589 type PENHMETAHEADER = uintptr
  33590 type LPENHMETAHEADER = uintptr
  33591 
  33592 type BCHAR = BYTE
  33593 
  33594 type tagTEXTMETRICA = struct {
  33595 	FtmHeight           LONG
  33596 	FtmAscent           LONG
  33597 	FtmDescent          LONG
  33598 	FtmInternalLeading  LONG
  33599 	FtmExternalLeading  LONG
  33600 	FtmAveCharWidth     LONG
  33601 	FtmMaxCharWidth     LONG
  33602 	FtmWeight           LONG
  33603 	FtmOverhang         LONG
  33604 	FtmDigitizedAspectX LONG
  33605 	FtmDigitizedAspectY LONG
  33606 	FtmFirstChar        BYTE
  33607 	FtmLastChar         BYTE
  33608 	FtmDefaultChar      BYTE
  33609 	FtmBreakChar        BYTE
  33610 	FtmItalic           BYTE
  33611 	FtmUnderlined       BYTE
  33612 	FtmStruckOut        BYTE
  33613 	FtmPitchAndFamily   BYTE
  33614 	FtmCharSet          BYTE
  33615 	F__ccgo_pad1        [3]byte
  33616 }
  33617 
  33618 type TEXTMETRICA = tagTEXTMETRICA
  33619 type PTEXTMETRICA = uintptr
  33620 type NPTEXTMETRICA = uintptr
  33621 type LPTEXTMETRICA = uintptr
  33622 
  33623 type tagTEXTMETRICW = struct {
  33624 	FtmHeight           LONG
  33625 	FtmAscent           LONG
  33626 	FtmDescent          LONG
  33627 	FtmInternalLeading  LONG
  33628 	FtmExternalLeading  LONG
  33629 	FtmAveCharWidth     LONG
  33630 	FtmMaxCharWidth     LONG
  33631 	FtmWeight           LONG
  33632 	FtmOverhang         LONG
  33633 	FtmDigitizedAspectX LONG
  33634 	FtmDigitizedAspectY LONG
  33635 	FtmFirstChar        WCHAR
  33636 	FtmLastChar         WCHAR
  33637 	FtmDefaultChar      WCHAR
  33638 	FtmBreakChar        WCHAR
  33639 	FtmItalic           BYTE
  33640 	FtmUnderlined       BYTE
  33641 	FtmStruckOut        BYTE
  33642 	FtmPitchAndFamily   BYTE
  33643 	FtmCharSet          BYTE
  33644 	F__ccgo_pad1        [3]byte
  33645 }
  33646 
  33647 type TEXTMETRICW = tagTEXTMETRICW
  33648 type PTEXTMETRICW = uintptr
  33649 type NPTEXTMETRICW = uintptr
  33650 type LPTEXTMETRICW = uintptr
  33651 
  33652 type TEXTMETRIC = TEXTMETRICA
  33653 type PTEXTMETRIC = PTEXTMETRICA
  33654 type NPTEXTMETRIC = NPTEXTMETRICA
  33655 type LPTEXTMETRIC = LPTEXTMETRICA
  33656 
  33657 type tagNEWTEXTMETRICA = struct {
  33658 	FtmHeight           LONG
  33659 	FtmAscent           LONG
  33660 	FtmDescent          LONG
  33661 	FtmInternalLeading  LONG
  33662 	FtmExternalLeading  LONG
  33663 	FtmAveCharWidth     LONG
  33664 	FtmMaxCharWidth     LONG
  33665 	FtmWeight           LONG
  33666 	FtmOverhang         LONG
  33667 	FtmDigitizedAspectX LONG
  33668 	FtmDigitizedAspectY LONG
  33669 	FtmFirstChar        BYTE
  33670 	FtmLastChar         BYTE
  33671 	FtmDefaultChar      BYTE
  33672 	FtmBreakChar        BYTE
  33673 	FtmItalic           BYTE
  33674 	FtmUnderlined       BYTE
  33675 	FtmStruckOut        BYTE
  33676 	FtmPitchAndFamily   BYTE
  33677 	FtmCharSet          BYTE
  33678 	F__ccgo_pad1        [3]byte
  33679 	FntmFlags           DWORD
  33680 	FntmSizeEM          UINT
  33681 	FntmCellHeight      UINT
  33682 	FntmAvgWidth        UINT
  33683 }
  33684 
  33685 // *
  33686 // This file has no copyright assigned and is placed in the Public Domain.
  33687 // This file is part of the mingw-w64 runtime package.
  33688 // No warranty is given; refer to the file DISCLAIMER.PD within this package.
  33689 type NEWTEXTMETRICA = tagNEWTEXTMETRICA
  33690 type PNEWTEXTMETRICA = uintptr
  33691 type NPNEWTEXTMETRICA = uintptr
  33692 type LPNEWTEXTMETRICA = uintptr
  33693 
  33694 type tagNEWTEXTMETRICW = struct {
  33695 	FtmHeight           LONG
  33696 	FtmAscent           LONG
  33697 	FtmDescent          LONG
  33698 	FtmInternalLeading  LONG
  33699 	FtmExternalLeading  LONG
  33700 	FtmAveCharWidth     LONG
  33701 	FtmMaxCharWidth     LONG
  33702 	FtmWeight           LONG
  33703 	FtmOverhang         LONG
  33704 	FtmDigitizedAspectX LONG
  33705 	FtmDigitizedAspectY LONG
  33706 	FtmFirstChar        WCHAR
  33707 	FtmLastChar         WCHAR
  33708 	FtmDefaultChar      WCHAR
  33709 	FtmBreakChar        WCHAR
  33710 	FtmItalic           BYTE
  33711 	FtmUnderlined       BYTE
  33712 	FtmStruckOut        BYTE
  33713 	FtmPitchAndFamily   BYTE
  33714 	FtmCharSet          BYTE
  33715 	F__ccgo_pad1        [3]byte
  33716 	FntmFlags           DWORD
  33717 	FntmSizeEM          UINT
  33718 	FntmCellHeight      UINT
  33719 	FntmAvgWidth        UINT
  33720 }
  33721 
  33722 type NEWTEXTMETRICW = tagNEWTEXTMETRICW
  33723 type PNEWTEXTMETRICW = uintptr
  33724 type NPNEWTEXTMETRICW = uintptr
  33725 type LPNEWTEXTMETRICW = uintptr
  33726 
  33727 type NEWTEXTMETRIC = NEWTEXTMETRICA
  33728 type PNEWTEXTMETRIC = PNEWTEXTMETRICA
  33729 type NPNEWTEXTMETRIC = NPNEWTEXTMETRICA
  33730 type LPNEWTEXTMETRIC = LPNEWTEXTMETRICA
  33731 
  33732 type tagNEWTEXTMETRICEXA = struct {
  33733 	FntmTm      NEWTEXTMETRICA
  33734 	FntmFontSig FONTSIGNATURE
  33735 }
  33736 
  33737 type NEWTEXTMETRICEXA = tagNEWTEXTMETRICEXA
  33738 
  33739 type tagNEWTEXTMETRICEXW = struct {
  33740 	FntmTm      NEWTEXTMETRICW
  33741 	FntmFontSig FONTSIGNATURE
  33742 }
  33743 
  33744 type NEWTEXTMETRICEXW = tagNEWTEXTMETRICEXW
  33745 
  33746 type NEWTEXTMETRICEX = NEWTEXTMETRICEXA
  33747 
  33748 type tagPELARRAY = struct {
  33749 	FpaXCount    LONG
  33750 	FpaYCount    LONG
  33751 	FpaXExt      LONG
  33752 	FpaYExt      LONG
  33753 	FpaRGBs      BYTE
  33754 	F__ccgo_pad1 [3]byte
  33755 }
  33756 
  33757 type PELARRAY = tagPELARRAY
  33758 type PPELARRAY = uintptr
  33759 type NPPELARRAY = uintptr
  33760 type LPPELARRAY = uintptr
  33761 type tagLOGBRUSH = struct {
  33762 	FlbStyle UINT
  33763 	FlbColor COLORREF
  33764 	FlbHatch ULONG_PTR
  33765 }
  33766 
  33767 type LOGBRUSH = tagLOGBRUSH
  33768 type PLOGBRUSH = uintptr
  33769 type NPLOGBRUSH = uintptr
  33770 type LPLOGBRUSH = uintptr
  33771 
  33772 type tagLOGBRUSH32 = struct {
  33773 	FlbStyle UINT
  33774 	FlbColor COLORREF
  33775 	FlbHatch ULONG
  33776 }
  33777 
  33778 type LOGBRUSH32 = tagLOGBRUSH32
  33779 type PLOGBRUSH32 = uintptr
  33780 type NPLOGBRUSH32 = uintptr
  33781 type LPLOGBRUSH32 = uintptr
  33782 type PATTERN = LOGBRUSH
  33783 type PPATTERN = uintptr
  33784 type NPPATTERN = uintptr
  33785 type LPPATTERN = uintptr
  33786 
  33787 type tagLOGPEN = struct {
  33788 	FlopnStyle UINT
  33789 	FlopnWidth POINT
  33790 	FlopnColor COLORREF
  33791 }
  33792 
  33793 type LOGPEN = tagLOGPEN
  33794 type PLOGPEN = uintptr
  33795 type NPLOGPEN = uintptr
  33796 type LPLOGPEN = uintptr
  33797 
  33798 type tagEXTLOGPEN = struct {
  33799 	FelpPenStyle   DWORD
  33800 	FelpWidth      DWORD
  33801 	FelpBrushStyle UINT
  33802 	FelpColor      COLORREF
  33803 	FelpHatch      ULONG_PTR
  33804 	FelpNumEntries DWORD
  33805 	FelpStyleEntry [1]DWORD
  33806 }
  33807 
  33808 type EXTLOGPEN = tagEXTLOGPEN
  33809 type PEXTLOGPEN = uintptr
  33810 type NPEXTLOGPEN = uintptr
  33811 type LPEXTLOGPEN = uintptr
  33812 
  33813 type tagEXTLOGPEN32 = struct {
  33814 	FelpPenStyle   DWORD
  33815 	FelpWidth      DWORD
  33816 	FelpBrushStyle UINT
  33817 	FelpColor      COLORREF
  33818 	FelpHatch      ULONG
  33819 	FelpNumEntries DWORD
  33820 	FelpStyleEntry [1]DWORD
  33821 }
  33822 
  33823 type EXTLOGPEN32 = tagEXTLOGPEN32
  33824 type PEXTLOGPEN32 = uintptr
  33825 type NPEXTLOGPEN32 = uintptr
  33826 type LPEXTLOGPEN32 = uintptr
  33827 
  33828 type tagPALETTEENTRY = struct {
  33829 	FpeRed   BYTE
  33830 	FpeGreen BYTE
  33831 	FpeBlue  BYTE
  33832 	FpeFlags BYTE
  33833 }
  33834 
  33835 type PALETTEENTRY = tagPALETTEENTRY
  33836 type PPALETTEENTRY = uintptr
  33837 type LPPALETTEENTRY = uintptr
  33838 
  33839 type tagLOGPALETTE = struct {
  33840 	FpalVersion    WORD
  33841 	FpalNumEntries WORD
  33842 	FpalPalEntry   [1]PALETTEENTRY
  33843 }
  33844 
  33845 type LOGPALETTE = tagLOGPALETTE
  33846 type PLOGPALETTE = uintptr
  33847 type NPLOGPALETTE = uintptr
  33848 type LPLOGPALETTE = uintptr
  33849 
  33850 type tagLOGFONTA = struct {
  33851 	FlfHeight         LONG
  33852 	FlfWidth          LONG
  33853 	FlfEscapement     LONG
  33854 	FlfOrientation    LONG
  33855 	FlfWeight         LONG
  33856 	FlfItalic         BYTE
  33857 	FlfUnderline      BYTE
  33858 	FlfStrikeOut      BYTE
  33859 	FlfCharSet        BYTE
  33860 	FlfOutPrecision   BYTE
  33861 	FlfClipPrecision  BYTE
  33862 	FlfQuality        BYTE
  33863 	FlfPitchAndFamily BYTE
  33864 	FlfFaceName       [32]CHAR
  33865 }
  33866 
  33867 type LOGFONTA = tagLOGFONTA
  33868 type PLOGFONTA = uintptr
  33869 type NPLOGFONTA = uintptr
  33870 type LPLOGFONTA = uintptr
  33871 
  33872 type tagLOGFONTW = struct {
  33873 	FlfHeight         LONG
  33874 	FlfWidth          LONG
  33875 	FlfEscapement     LONG
  33876 	FlfOrientation    LONG
  33877 	FlfWeight         LONG
  33878 	FlfItalic         BYTE
  33879 	FlfUnderline      BYTE
  33880 	FlfStrikeOut      BYTE
  33881 	FlfCharSet        BYTE
  33882 	FlfOutPrecision   BYTE
  33883 	FlfClipPrecision  BYTE
  33884 	FlfQuality        BYTE
  33885 	FlfPitchAndFamily BYTE
  33886 	FlfFaceName       [32]WCHAR
  33887 }
  33888 
  33889 type LOGFONTW = tagLOGFONTW
  33890 type PLOGFONTW = uintptr
  33891 type NPLOGFONTW = uintptr
  33892 type LPLOGFONTW = uintptr
  33893 
  33894 type LOGFONT = LOGFONTA
  33895 type PLOGFONT = PLOGFONTA
  33896 type NPLOGFONT = NPLOGFONTA
  33897 type LPLOGFONT = LPLOGFONTA
  33898 
  33899 type tagENUMLOGFONTA = struct {
  33900 	FelfLogFont  LOGFONTA
  33901 	FelfFullName [64]BYTE
  33902 	FelfStyle    [32]BYTE
  33903 }
  33904 
  33905 type ENUMLOGFONTA = tagENUMLOGFONTA
  33906 type LPENUMLOGFONTA = uintptr
  33907 
  33908 type tagENUMLOGFONTW = struct {
  33909 	FelfLogFont  LOGFONTW
  33910 	FelfFullName [64]WCHAR
  33911 	FelfStyle    [32]WCHAR
  33912 }
  33913 
  33914 type ENUMLOGFONTW = tagENUMLOGFONTW
  33915 type LPENUMLOGFONTW = uintptr
  33916 
  33917 type ENUMLOGFONT = ENUMLOGFONTA
  33918 type LPENUMLOGFONT = LPENUMLOGFONTA
  33919 
  33920 type tagENUMLOGFONTEXA = struct {
  33921 	FelfLogFont  LOGFONTA
  33922 	FelfFullName [64]BYTE
  33923 	FelfStyle    [32]BYTE
  33924 	FelfScript   [32]BYTE
  33925 }
  33926 
  33927 type ENUMLOGFONTEXA = tagENUMLOGFONTEXA
  33928 type LPENUMLOGFONTEXA = uintptr
  33929 
  33930 type tagENUMLOGFONTEXW = struct {
  33931 	FelfLogFont  LOGFONTW
  33932 	FelfFullName [64]WCHAR
  33933 	FelfStyle    [32]WCHAR
  33934 	FelfScript   [32]WCHAR
  33935 }
  33936 
  33937 type ENUMLOGFONTEXW = tagENUMLOGFONTEXW
  33938 type LPENUMLOGFONTEXW = uintptr
  33939 
  33940 type ENUMLOGFONTEX = ENUMLOGFONTEXA
  33941 type LPENUMLOGFONTEX = LPENUMLOGFONTEXA
  33942 
  33943 type tagPANOSE = struct {
  33944 	FbFamilyType      BYTE
  33945 	FbSerifStyle      BYTE
  33946 	FbWeight          BYTE
  33947 	FbProportion      BYTE
  33948 	FbContrast        BYTE
  33949 	FbStrokeVariation BYTE
  33950 	FbArmStyle        BYTE
  33951 	FbLetterform      BYTE
  33952 	FbMidline         BYTE
  33953 	FbXHeight         BYTE
  33954 }
  33955 
  33956 type PANOSE = tagPANOSE
  33957 type LPPANOSE = uintptr
  33958 
  33959 type tagEXTLOGFONTA = struct {
  33960 	FelfLogFont   LOGFONTA
  33961 	FelfFullName  [64]BYTE
  33962 	FelfStyle     [32]BYTE
  33963 	FelfVersion   DWORD
  33964 	FelfStyleSize DWORD
  33965 	FelfMatch     DWORD
  33966 	FelfReserved  DWORD
  33967 	FelfVendorId  [4]BYTE
  33968 	FelfCulture   DWORD
  33969 	FelfPanose    PANOSE
  33970 	F__ccgo_pad1  [2]byte
  33971 }
  33972 
  33973 type EXTLOGFONTA = tagEXTLOGFONTA
  33974 type PEXTLOGFONTA = uintptr
  33975 type NPEXTLOGFONTA = uintptr
  33976 type LPEXTLOGFONTA = uintptr
  33977 
  33978 type tagEXTLOGFONTW = struct {
  33979 	FelfLogFont   LOGFONTW
  33980 	FelfFullName  [64]WCHAR
  33981 	FelfStyle     [32]WCHAR
  33982 	FelfVersion   DWORD
  33983 	FelfStyleSize DWORD
  33984 	FelfMatch     DWORD
  33985 	FelfReserved  DWORD
  33986 	FelfVendorId  [4]BYTE
  33987 	FelfCulture   DWORD
  33988 	FelfPanose    PANOSE
  33989 	F__ccgo_pad1  [2]byte
  33990 }
  33991 
  33992 type EXTLOGFONTW = tagEXTLOGFONTW
  33993 type PEXTLOGFONTW = uintptr
  33994 type NPEXTLOGFONTW = uintptr
  33995 type LPEXTLOGFONTW = uintptr
  33996 
  33997 type EXTLOGFONT = EXTLOGFONTA
  33998 type PEXTLOGFONT = PEXTLOGFONTA
  33999 type NPEXTLOGFONT = NPEXTLOGFONTA
  34000 type LPEXTLOGFONT = LPEXTLOGFONTA
  34001 
  34002 type _devicemodeA = struct {
  34003 	FdmDeviceName    [32]BYTE
  34004 	FdmSpecVersion   WORD
  34005 	FdmDriverVersion WORD
  34006 	FdmSize          WORD
  34007 	FdmDriverExtra   WORD
  34008 	FdmFields        DWORD
  34009 	F__44            struct {
  34010 		F__ccgo_pad1 [0]uint32
  34011 		F__0         struct {
  34012 			FdmOrientation   int16
  34013 			FdmPaperSize     int16
  34014 			FdmPaperLength   int16
  34015 			FdmPaperWidth    int16
  34016 			FdmScale         int16
  34017 			FdmCopies        int16
  34018 			FdmDefaultSource int16
  34019 			FdmPrintQuality  int16
  34020 		}
  34021 	}
  34022 	FdmColor            int16
  34023 	FdmDuplex           int16
  34024 	FdmYResolution      int16
  34025 	FdmTTOption         int16
  34026 	FdmCollate          int16
  34027 	FdmFormName         [32]BYTE
  34028 	FdmLogPixels        WORD
  34029 	FdmBitsPerPel       DWORD
  34030 	FdmPelsWidth        DWORD
  34031 	FdmPelsHeight       DWORD
  34032 	F__116              struct{ FdmDisplayFlags DWORD }
  34033 	FdmDisplayFrequency DWORD
  34034 	FdmICMMethod        DWORD
  34035 	FdmICMIntent        DWORD
  34036 	FdmMediaType        DWORD
  34037 	FdmDitherType       DWORD
  34038 	FdmReserved1        DWORD
  34039 	FdmReserved2        DWORD
  34040 	FdmPanningWidth     DWORD
  34041 	FdmPanningHeight    DWORD
  34042 }
  34043 
  34044 type DEVMODEA = _devicemodeA
  34045 type PDEVMODEA = uintptr
  34046 type NPDEVMODEA = uintptr
  34047 type LPDEVMODEA = uintptr
  34048 
  34049 type _devicemodeW = struct {
  34050 	FdmDeviceName    [32]WCHAR
  34051 	FdmSpecVersion   WORD
  34052 	FdmDriverVersion WORD
  34053 	FdmSize          WORD
  34054 	FdmDriverExtra   WORD
  34055 	FdmFields        DWORD
  34056 	F__76            struct {
  34057 		F__ccgo_pad1 [0]uint32
  34058 		F__0         struct {
  34059 			FdmOrientation   int16
  34060 			FdmPaperSize     int16
  34061 			FdmPaperLength   int16
  34062 			FdmPaperWidth    int16
  34063 			FdmScale         int16
  34064 			FdmCopies        int16
  34065 			FdmDefaultSource int16
  34066 			FdmPrintQuality  int16
  34067 		}
  34068 	}
  34069 	FdmColor            int16
  34070 	FdmDuplex           int16
  34071 	FdmYResolution      int16
  34072 	FdmTTOption         int16
  34073 	FdmCollate          int16
  34074 	FdmFormName         [32]WCHAR
  34075 	FdmLogPixels        WORD
  34076 	FdmBitsPerPel       DWORD
  34077 	FdmPelsWidth        DWORD
  34078 	FdmPelsHeight       DWORD
  34079 	F__180              struct{ FdmDisplayFlags DWORD }
  34080 	FdmDisplayFrequency DWORD
  34081 	FdmICMMethod        DWORD
  34082 	FdmICMIntent        DWORD
  34083 	FdmMediaType        DWORD
  34084 	FdmDitherType       DWORD
  34085 	FdmReserved1        DWORD
  34086 	FdmReserved2        DWORD
  34087 	FdmPanningWidth     DWORD
  34088 	FdmPanningHeight    DWORD
  34089 }
  34090 
  34091 type DEVMODEW = _devicemodeW
  34092 type PDEVMODEW = uintptr
  34093 type NPDEVMODEW = uintptr
  34094 type LPDEVMODEW = uintptr
  34095 
  34096 type DEVMODE = DEVMODEA
  34097 type PDEVMODE = PDEVMODEA
  34098 type NPDEVMODE = NPDEVMODEA
  34099 type LPDEVMODE = LPDEVMODEA
  34100 
  34101 type _DISPLAY_DEVICEA = struct {
  34102 	Fcb           DWORD
  34103 	FDeviceName   [32]CHAR
  34104 	FDeviceString [128]CHAR
  34105 	FStateFlags   DWORD
  34106 	FDeviceID     [128]CHAR
  34107 	FDeviceKey    [128]CHAR
  34108 }
  34109 
  34110 type DISPLAY_DEVICEA = _DISPLAY_DEVICEA
  34111 type PDISPLAY_DEVICEA = uintptr
  34112 type LPDISPLAY_DEVICEA = uintptr
  34113 
  34114 type _DISPLAY_DEVICEW = struct {
  34115 	Fcb           DWORD
  34116 	FDeviceName   [32]WCHAR
  34117 	FDeviceString [128]WCHAR
  34118 	FStateFlags   DWORD
  34119 	FDeviceID     [128]WCHAR
  34120 	FDeviceKey    [128]WCHAR
  34121 }
  34122 
  34123 type DISPLAY_DEVICEW = _DISPLAY_DEVICEW
  34124 type PDISPLAY_DEVICEW = uintptr
  34125 type LPDISPLAY_DEVICEW = uintptr
  34126 
  34127 type DISPLAY_DEVICE = DISPLAY_DEVICEA
  34128 type PDISPLAY_DEVICE = PDISPLAY_DEVICEA
  34129 type LPDISPLAY_DEVICE = LPDISPLAY_DEVICEA
  34130 
  34131 type _RGNDATAHEADER = struct {
  34132 	FdwSize   DWORD
  34133 	FiType    DWORD
  34134 	FnCount   DWORD
  34135 	FnRgnSize DWORD
  34136 	FrcBound  RECT
  34137 }
  34138 
  34139 type RGNDATAHEADER = _RGNDATAHEADER
  34140 type PRGNDATAHEADER = uintptr
  34141 
  34142 type _RGNDATA = struct {
  34143 	Frdh         RGNDATAHEADER
  34144 	FBuffer      [1]int8
  34145 	F__ccgo_pad1 [3]byte
  34146 }
  34147 
  34148 type RGNDATA = _RGNDATA
  34149 type PRGNDATA = uintptr
  34150 type NPRGNDATA = uintptr
  34151 type LPRGNDATA = uintptr
  34152 
  34153 type _ABC = struct {
  34154 	FabcA int32
  34155 	FabcB UINT
  34156 	FabcC int32
  34157 }
  34158 
  34159 type ABC = _ABC
  34160 type PABC = uintptr
  34161 type NPABC = uintptr
  34162 type LPABC = uintptr
  34163 
  34164 type _ABCFLOAT = struct {
  34165 	FabcfA FLOAT
  34166 	FabcfB FLOAT
  34167 	FabcfC FLOAT
  34168 }
  34169 
  34170 type ABCFLOAT = _ABCFLOAT
  34171 type PABCFLOAT = uintptr
  34172 type NPABCFLOAT = uintptr
  34173 type LPABCFLOAT = uintptr
  34174 
  34175 type _OUTLINETEXTMETRICA = struct {
  34176 	FotmSize                UINT
  34177 	FotmTextMetrics         TEXTMETRICA
  34178 	FotmFiller              BYTE
  34179 	FotmPanoseNumber        PANOSE
  34180 	F__ccgo_pad1            [1]byte
  34181 	FotmfsSelection         UINT
  34182 	FotmfsType              UINT
  34183 	FotmsCharSlopeRise      int32
  34184 	FotmsCharSlopeRun       int32
  34185 	FotmItalicAngle         int32
  34186 	FotmEMSquare            UINT
  34187 	FotmAscent              int32
  34188 	FotmDescent             int32
  34189 	FotmLineGap             UINT
  34190 	FotmsCapEmHeight        UINT
  34191 	FotmsXHeight            UINT
  34192 	FotmrcFontBox           RECT
  34193 	FotmMacAscent           int32
  34194 	FotmMacDescent          int32
  34195 	FotmMacLineGap          UINT
  34196 	FotmusMinimumPPEM       UINT
  34197 	FotmptSubscriptSize     POINT
  34198 	FotmptSubscriptOffset   POINT
  34199 	FotmptSuperscriptSize   POINT
  34200 	FotmptSuperscriptOffset POINT
  34201 	FotmsStrikeoutSize      UINT
  34202 	FotmsStrikeoutPosition  int32
  34203 	FotmsUnderscoreSize     int32
  34204 	FotmsUnderscorePosition int32
  34205 	F__ccgo_pad2            [4]byte
  34206 	FotmpFamilyName         PSTR
  34207 	FotmpFaceName           PSTR
  34208 	FotmpStyleName          PSTR
  34209 	FotmpFullName           PSTR
  34210 }
  34211 
  34212 type OUTLINETEXTMETRICA = _OUTLINETEXTMETRICA
  34213 type POUTLINETEXTMETRICA = uintptr
  34214 type NPOUTLINETEXTMETRICA = uintptr
  34215 type LPOUTLINETEXTMETRICA = uintptr
  34216 
  34217 type _OUTLINETEXTMETRICW = struct {
  34218 	FotmSize                UINT
  34219 	FotmTextMetrics         TEXTMETRICW
  34220 	FotmFiller              BYTE
  34221 	FotmPanoseNumber        PANOSE
  34222 	F__ccgo_pad1            [1]byte
  34223 	FotmfsSelection         UINT
  34224 	FotmfsType              UINT
  34225 	FotmsCharSlopeRise      int32
  34226 	FotmsCharSlopeRun       int32
  34227 	FotmItalicAngle         int32
  34228 	FotmEMSquare            UINT
  34229 	FotmAscent              int32
  34230 	FotmDescent             int32
  34231 	FotmLineGap             UINT
  34232 	FotmsCapEmHeight        UINT
  34233 	FotmsXHeight            UINT
  34234 	FotmrcFontBox           RECT
  34235 	FotmMacAscent           int32
  34236 	FotmMacDescent          int32
  34237 	FotmMacLineGap          UINT
  34238 	FotmusMinimumPPEM       UINT
  34239 	FotmptSubscriptSize     POINT
  34240 	FotmptSubscriptOffset   POINT
  34241 	FotmptSuperscriptSize   POINT
  34242 	FotmptSuperscriptOffset POINT
  34243 	FotmsStrikeoutSize      UINT
  34244 	FotmsStrikeoutPosition  int32
  34245 	FotmsUnderscoreSize     int32
  34246 	FotmsUnderscorePosition int32
  34247 	FotmpFamilyName         PSTR
  34248 	FotmpFaceName           PSTR
  34249 	FotmpStyleName          PSTR
  34250 	FotmpFullName           PSTR
  34251 }
  34252 
  34253 type OUTLINETEXTMETRICW = _OUTLINETEXTMETRICW
  34254 type POUTLINETEXTMETRICW = uintptr
  34255 type NPOUTLINETEXTMETRICW = uintptr
  34256 type LPOUTLINETEXTMETRICW = uintptr
  34257 
  34258 type OUTLINETEXTMETRIC = OUTLINETEXTMETRICA
  34259 type POUTLINETEXTMETRIC = POUTLINETEXTMETRICA
  34260 type NPOUTLINETEXTMETRIC = NPOUTLINETEXTMETRICA
  34261 type LPOUTLINETEXTMETRIC = LPOUTLINETEXTMETRICA
  34262 
  34263 type tagPOLYTEXTA = struct {
  34264 	Fx           int32
  34265 	Fy           int32
  34266 	Fn           UINT
  34267 	F__ccgo_pad1 [4]byte
  34268 	Flpstr       LPCSTR
  34269 	FuiFlags     UINT
  34270 	Frcl         RECT
  34271 	F__ccgo_pad2 [4]byte
  34272 	Fpdx         uintptr
  34273 }
  34274 
  34275 type POLYTEXTA = tagPOLYTEXTA
  34276 type PPOLYTEXTA = uintptr
  34277 type NPPOLYTEXTA = uintptr
  34278 type LPPOLYTEXTA = uintptr
  34279 
  34280 type tagPOLYTEXTW = struct {
  34281 	Fx           int32
  34282 	Fy           int32
  34283 	Fn           UINT
  34284 	F__ccgo_pad1 [4]byte
  34285 	Flpstr       LPCWSTR
  34286 	FuiFlags     UINT
  34287 	Frcl         RECT
  34288 	F__ccgo_pad2 [4]byte
  34289 	Fpdx         uintptr
  34290 }
  34291 
  34292 type POLYTEXTW = tagPOLYTEXTW
  34293 type PPOLYTEXTW = uintptr
  34294 type NPPOLYTEXTW = uintptr
  34295 type LPPOLYTEXTW = uintptr
  34296 
  34297 type POLYTEXT = POLYTEXTA
  34298 type PPOLYTEXT = PPOLYTEXTA
  34299 type NPPOLYTEXT = NPPOLYTEXTA
  34300 type LPPOLYTEXT = LPPOLYTEXTA
  34301 
  34302 type _FIXED = struct {
  34303 	Ffract WORD
  34304 	Fvalue int16
  34305 }
  34306 
  34307 type FIXED = _FIXED
  34308 
  34309 type _MAT2 = struct {
  34310 	FeM11 FIXED
  34311 	FeM12 FIXED
  34312 	FeM21 FIXED
  34313 	FeM22 FIXED
  34314 }
  34315 
  34316 type MAT2 = _MAT2
  34317 type LPMAT2 = uintptr
  34318 
  34319 type _GLYPHMETRICS = struct {
  34320 	FgmBlackBoxX     UINT
  34321 	FgmBlackBoxY     UINT
  34322 	FgmptGlyphOrigin POINT
  34323 	FgmCellIncX      int16
  34324 	FgmCellIncY      int16
  34325 }
  34326 
  34327 type GLYPHMETRICS = _GLYPHMETRICS
  34328 type LPGLYPHMETRICS = uintptr
  34329 
  34330 type tagPOINTFX = struct {
  34331 	Fx FIXED
  34332 	Fy FIXED
  34333 }
  34334 
  34335 type POINTFX = tagPOINTFX
  34336 type LPPOINTFX = uintptr
  34337 
  34338 type tagTTPOLYCURVE = struct {
  34339 	FwType WORD
  34340 	Fcpfx  WORD
  34341 	Fapfx  [1]POINTFX
  34342 }
  34343 
  34344 type TTPOLYCURVE = tagTTPOLYCURVE
  34345 type LPTTPOLYCURVE = uintptr
  34346 
  34347 type tagTTPOLYGONHEADER = struct {
  34348 	Fcb       DWORD
  34349 	FdwType   DWORD
  34350 	FpfxStart POINTFX
  34351 }
  34352 
  34353 type TTPOLYGONHEADER = tagTTPOLYGONHEADER
  34354 type LPTTPOLYGONHEADER = uintptr
  34355 
  34356 type tagGCP_RESULTSA = struct {
  34357 	FlStructSize DWORD
  34358 	F__ccgo_pad1 [4]byte
  34359 	FlpOutString LPSTR
  34360 	FlpOrder     uintptr
  34361 	FlpDx        uintptr
  34362 	FlpCaretPos  uintptr
  34363 	FlpClass     LPSTR
  34364 	FlpGlyphs    LPWSTR
  34365 	FnGlyphs     UINT
  34366 	FnMaxFit     int32
  34367 }
  34368 
  34369 type GCP_RESULTSA = tagGCP_RESULTSA
  34370 type LPGCP_RESULTSA = uintptr
  34371 type tagGCP_RESULTSW = struct {
  34372 	FlStructSize DWORD
  34373 	F__ccgo_pad1 [4]byte
  34374 	FlpOutString LPWSTR
  34375 	FlpOrder     uintptr
  34376 	FlpDx        uintptr
  34377 	FlpCaretPos  uintptr
  34378 	FlpClass     LPSTR
  34379 	FlpGlyphs    LPWSTR
  34380 	FnGlyphs     UINT
  34381 	FnMaxFit     int32
  34382 }
  34383 
  34384 type GCP_RESULTSW = tagGCP_RESULTSW
  34385 type LPGCP_RESULTSW = uintptr
  34386 
  34387 type GCP_RESULTS = GCP_RESULTSA
  34388 type LPGCP_RESULTS = LPGCP_RESULTSA
  34389 
  34390 type _RASTERIZER_STATUS = struct {
  34391 	FnSize       int16
  34392 	FwFlags      int16
  34393 	FnLanguageID int16
  34394 }
  34395 
  34396 type RASTERIZER_STATUS = _RASTERIZER_STATUS
  34397 type LPRASTERIZER_STATUS = uintptr
  34398 
  34399 type tagPIXELFORMATDESCRIPTOR = struct {
  34400 	FnSize           WORD
  34401 	FnVersion        WORD
  34402 	FdwFlags         DWORD
  34403 	FiPixelType      BYTE
  34404 	FcColorBits      BYTE
  34405 	FcRedBits        BYTE
  34406 	FcRedShift       BYTE
  34407 	FcGreenBits      BYTE
  34408 	FcGreenShift     BYTE
  34409 	FcBlueBits       BYTE
  34410 	FcBlueShift      BYTE
  34411 	FcAlphaBits      BYTE
  34412 	FcAlphaShift     BYTE
  34413 	FcAccumBits      BYTE
  34414 	FcAccumRedBits   BYTE
  34415 	FcAccumGreenBits BYTE
  34416 	FcAccumBlueBits  BYTE
  34417 	FcAccumAlphaBits BYTE
  34418 	FcDepthBits      BYTE
  34419 	FcStencilBits    BYTE
  34420 	FcAuxBuffers     BYTE
  34421 	FiLayerType      BYTE
  34422 	FbReserved       BYTE
  34423 	FdwLayerMask     DWORD
  34424 	FdwVisibleMask   DWORD
  34425 	FdwDamageMask    DWORD
  34426 }
  34427 
  34428 type PIXELFORMATDESCRIPTOR = tagPIXELFORMATDESCRIPTOR
  34429 type PPIXELFORMATDESCRIPTOR = uintptr
  34430 type LPPIXELFORMATDESCRIPTOR = uintptr
  34431 
  34432 type OLDFONTENUMPROCA = uintptr
  34433 type OLDFONTENUMPROCW = uintptr
  34434 
  34435 type FONTENUMPROCA = OLDFONTENUMPROCA
  34436 type FONTENUMPROCW = OLDFONTENUMPROCW
  34437 
  34438 type FONTENUMPROC = FONTENUMPROCA
  34439 
  34440 type GOBJENUMPROC = uintptr
  34441 type LINEDDAPROC = uintptr
  34442 
  34443 type LPFNDEVMODE = uintptr
  34444 type LPFNDEVCAPS = uintptr
  34445 
  34446 type tagWCRANGE = struct {
  34447 	FwcLow   WCHAR
  34448 	FcGlyphs USHORT
  34449 }
  34450 
  34451 type WCRANGE = tagWCRANGE
  34452 type PWCRANGE = uintptr
  34453 type LPWCRANGE = uintptr
  34454 
  34455 type tagGLYPHSET = struct {
  34456 	FcbThis           DWORD
  34457 	FflAccel          DWORD
  34458 	FcGlyphsSupported DWORD
  34459 	FcRanges          DWORD
  34460 	Franges           [1]WCRANGE
  34461 }
  34462 
  34463 type GLYPHSET = tagGLYPHSET
  34464 type PGLYPHSET = uintptr
  34465 type LPGLYPHSET = uintptr
  34466 
  34467 type tagDESIGNVECTOR = struct {
  34468 	FdvReserved DWORD
  34469 	FdvNumAxes  DWORD
  34470 	FdvValues   [16]LONG
  34471 }
  34472 
  34473 type DESIGNVECTOR = tagDESIGNVECTOR
  34474 type PDESIGNVECTOR = uintptr
  34475 type LPDESIGNVECTOR = uintptr
  34476 
  34477 type tagAXISINFOA = struct {
  34478 	FaxMinValue LONG
  34479 	FaxMaxValue LONG
  34480 	FaxAxisName [16]BYTE
  34481 }
  34482 
  34483 type AXISINFOA = tagAXISINFOA
  34484 type PAXISINFOA = uintptr
  34485 type LPAXISINFOA = uintptr
  34486 
  34487 type tagAXISINFOW = struct {
  34488 	FaxMinValue LONG
  34489 	FaxMaxValue LONG
  34490 	FaxAxisName [16]WCHAR
  34491 }
  34492 
  34493 type AXISINFOW = tagAXISINFOW
  34494 type PAXISINFOW = uintptr
  34495 type LPAXISINFOW = uintptr
  34496 
  34497 type AXISINFO = AXISINFOA
  34498 type PAXISINFO = PAXISINFOA
  34499 type LPAXISINFO = LPAXISINFOA
  34500 
  34501 type tagAXESLISTA = struct {
  34502 	FaxlReserved DWORD
  34503 	FaxlNumAxes  DWORD
  34504 	FaxlAxisInfo [16]AXISINFOA
  34505 }
  34506 
  34507 type AXESLISTA = tagAXESLISTA
  34508 type PAXESLISTA = uintptr
  34509 type LPAXESLISTA = uintptr
  34510 
  34511 type tagAXESLISTW = struct {
  34512 	FaxlReserved DWORD
  34513 	FaxlNumAxes  DWORD
  34514 	FaxlAxisInfo [16]AXISINFOW
  34515 }
  34516 
  34517 type AXESLISTW = tagAXESLISTW
  34518 type PAXESLISTW = uintptr
  34519 type LPAXESLISTW = uintptr
  34520 
  34521 type AXESLIST = AXESLISTA
  34522 type PAXESLIST = PAXESLISTA
  34523 type LPAXESLIST = LPAXESLISTA
  34524 
  34525 type tagENUMLOGFONTEXDVA = struct {
  34526 	FelfEnumLogfontEx ENUMLOGFONTEXA
  34527 	FelfDesignVector  DESIGNVECTOR
  34528 }
  34529 
  34530 type ENUMLOGFONTEXDVA = tagENUMLOGFONTEXDVA
  34531 type PENUMLOGFONTEXDVA = uintptr
  34532 type LPENUMLOGFONTEXDVA = uintptr
  34533 
  34534 type tagENUMLOGFONTEXDVW = struct {
  34535 	FelfEnumLogfontEx ENUMLOGFONTEXW
  34536 	FelfDesignVector  DESIGNVECTOR
  34537 }
  34538 
  34539 type ENUMLOGFONTEXDVW = tagENUMLOGFONTEXDVW
  34540 type PENUMLOGFONTEXDVW = uintptr
  34541 type LPENUMLOGFONTEXDVW = uintptr
  34542 
  34543 type ENUMLOGFONTEXDV = ENUMLOGFONTEXDVA
  34544 type PENUMLOGFONTEXDV = PENUMLOGFONTEXDVA
  34545 type LPENUMLOGFONTEXDV = LPENUMLOGFONTEXDVA
  34546 
  34547 type tagENUMTEXTMETRICA = struct {
  34548 	FetmNewTextMetricEx NEWTEXTMETRICEXA
  34549 	FetmAxesList        AXESLISTA
  34550 }
  34551 
  34552 type ENUMTEXTMETRICA = tagENUMTEXTMETRICA
  34553 type PENUMTEXTMETRICA = uintptr
  34554 type LPENUMTEXTMETRICA = uintptr
  34555 type tagENUMTEXTMETRICW = struct {
  34556 	FetmNewTextMetricEx NEWTEXTMETRICEXW
  34557 	FetmAxesList        AXESLISTW
  34558 }
  34559 
  34560 type ENUMTEXTMETRICW = tagENUMTEXTMETRICW
  34561 type PENUMTEXTMETRICW = uintptr
  34562 type LPENUMTEXTMETRICW = uintptr
  34563 
  34564 type ENUMTEXTMETRIC = ENUMTEXTMETRICA
  34565 type PENUMTEXTMETRIC = PENUMTEXTMETRICA
  34566 type LPENUMTEXTMETRIC = LPENUMTEXTMETRICA
  34567 
  34568 type COLOR16 = USHORT
  34569 
  34570 type _TRIVERTEX = struct {
  34571 	Fx     LONG
  34572 	Fy     LONG
  34573 	FRed   COLOR16
  34574 	FGreen COLOR16
  34575 	FBlue  COLOR16
  34576 	FAlpha COLOR16
  34577 }
  34578 
  34579 type TRIVERTEX = _TRIVERTEX
  34580 type PTRIVERTEX = uintptr
  34581 type LPTRIVERTEX = uintptr
  34582 type _GRADIENT_TRIANGLE = struct {
  34583 	FVertex1 ULONG
  34584 	FVertex2 ULONG
  34585 	FVertex3 ULONG
  34586 }
  34587 
  34588 type GRADIENT_TRIANGLE = _GRADIENT_TRIANGLE
  34589 type PGRADIENT_TRIANGLE = uintptr
  34590 type LPGRADIENT_TRIANGLE = uintptr
  34591 
  34592 type _GRADIENT_RECT = struct {
  34593 	FUpperLeft  ULONG
  34594 	FLowerRight ULONG
  34595 }
  34596 
  34597 type GRADIENT_RECT = _GRADIENT_RECT
  34598 type PGRADIENT_RECT = uintptr
  34599 type LPGRADIENT_RECT = uintptr
  34600 type _BLENDFUNCTION = struct {
  34601 	FBlendOp             BYTE
  34602 	FBlendFlags          BYTE
  34603 	FSourceConstantAlpha BYTE
  34604 	FAlphaFormat         BYTE
  34605 }
  34606 
  34607 type BLENDFUNCTION = _BLENDFUNCTION
  34608 type PBLENDFUNCTION = uintptr
  34609 
  34610 type MFENUMPROC = uintptr
  34611 
  34612 type ENHMFENUMPROC = uintptr
  34613 
  34614 type tagDIBSECTION = struct {
  34615 	FdsBm        BITMAP
  34616 	FdsBmih      BITMAPINFOHEADER
  34617 	FdsBitfields [3]DWORD
  34618 	F__ccgo_pad1 [4]byte
  34619 	FdshSection  HANDLE
  34620 	FdsOffset    DWORD
  34621 	F__ccgo_pad2 [4]byte
  34622 }
  34623 
  34624 type DIBSECTION = tagDIBSECTION
  34625 type LPDIBSECTION = uintptr
  34626 type PDIBSECTION = uintptr
  34627 
  34628 type tagCOLORADJUSTMENT = struct {
  34629 	FcaSize            WORD
  34630 	FcaFlags           WORD
  34631 	FcaIlluminantIndex WORD
  34632 	FcaRedGamma        WORD
  34633 	FcaGreenGamma      WORD
  34634 	FcaBlueGamma       WORD
  34635 	FcaReferenceBlack  WORD
  34636 	FcaReferenceWhite  WORD
  34637 	FcaContrast        SHORT
  34638 	FcaBrightness      SHORT
  34639 	FcaColorfulness    SHORT
  34640 	FcaRedGreenTint    SHORT
  34641 }
  34642 
  34643 type COLORADJUSTMENT = tagCOLORADJUSTMENT
  34644 type PCOLORADJUSTMENT = uintptr
  34645 type LPCOLORADJUSTMENT = uintptr
  34646 
  34647 type ABORTPROC = uintptr
  34648 
  34649 type _DOCINFOA = struct {
  34650 	FcbSize       int32
  34651 	F__ccgo_pad1  [4]byte
  34652 	FlpszDocName  LPCSTR
  34653 	FlpszOutput   LPCSTR
  34654 	FlpszDatatype LPCSTR
  34655 	FfwType       DWORD
  34656 	F__ccgo_pad2  [4]byte
  34657 }
  34658 
  34659 type DOCINFOA = _DOCINFOA
  34660 type LPDOCINFOA = uintptr
  34661 
  34662 type _DOCINFOW = struct {
  34663 	FcbSize       int32
  34664 	F__ccgo_pad1  [4]byte
  34665 	FlpszDocName  LPCWSTR
  34666 	FlpszOutput   LPCWSTR
  34667 	FlpszDatatype LPCWSTR
  34668 	FfwType       DWORD
  34669 	F__ccgo_pad2  [4]byte
  34670 }
  34671 
  34672 type DOCINFOW = _DOCINFOW
  34673 type LPDOCINFOW = uintptr
  34674 
  34675 type DOCINFO = DOCINFOA
  34676 type LPDOCINFO = LPDOCINFOA
  34677 
  34678 type tagKERNINGPAIR = struct {
  34679 	FwFirst      WORD
  34680 	FwSecond     WORD
  34681 	FiKernAmount int32
  34682 }
  34683 
  34684 type KERNINGPAIR = tagKERNINGPAIR
  34685 type LPKERNINGPAIR = uintptr
  34686 
  34687 type ICMENUMPROCA = uintptr
  34688 type ICMENUMPROCW = uintptr
  34689 
  34690 type tagEMR = struct {
  34691 	FiType DWORD
  34692 	FnSize DWORD
  34693 }
  34694 
  34695 type EMR = tagEMR
  34696 type PEMR = uintptr
  34697 
  34698 type tagEMRTEXT = struct {
  34699 	FptlReference POINTL
  34700 	FnChars       DWORD
  34701 	FoffString    DWORD
  34702 	FfOptions     DWORD
  34703 	Frcl          RECTL
  34704 	FoffDx        DWORD
  34705 }
  34706 
  34707 type EMRTEXT = tagEMRTEXT
  34708 type PEMRTEXT = uintptr
  34709 
  34710 type tagABORTPATH = struct{ Femr EMR }
  34711 
  34712 type EMRABORTPATH = tagABORTPATH
  34713 type PEMRABORTPATH = uintptr
  34714 type EMRBEGINPATH = tagABORTPATH
  34715 type PEMRBEGINPATH = uintptr
  34716 type EMRENDPATH = tagABORTPATH
  34717 type PEMRENDPATH = uintptr
  34718 type EMRCLOSEFIGURE = tagABORTPATH
  34719 type PEMRCLOSEFIGURE = uintptr
  34720 type EMRFLATTENPATH = tagABORTPATH
  34721 type PEMRFLATTENPATH = uintptr
  34722 type EMRWIDENPATH = tagABORTPATH
  34723 type PEMRWIDENPATH = uintptr
  34724 type EMRSETMETARGN = tagABORTPATH
  34725 type PEMRSETMETARGN = uintptr
  34726 type EMRSAVEDC = tagABORTPATH
  34727 type PEMRSAVEDC = uintptr
  34728 type EMRREALIZEPALETTE = tagABORTPATH
  34729 type PEMRREALIZEPALETTE = uintptr
  34730 
  34731 type tagEMRSELECTCLIPPATH = struct {
  34732 	Femr   EMR
  34733 	FiMode DWORD
  34734 }
  34735 
  34736 type EMRSELECTCLIPPATH = tagEMRSELECTCLIPPATH
  34737 type PEMRSELECTCLIPPATH = uintptr
  34738 type EMRSETBKMODE = tagEMRSELECTCLIPPATH
  34739 type PEMRSETBKMODE = uintptr
  34740 type EMRSETMAPMODE = tagEMRSELECTCLIPPATH
  34741 type PEMRSETMAPMODE = uintptr
  34742 type EMRSETLAYOUT = tagEMRSELECTCLIPPATH
  34743 type PEMRSETLAYOUT = uintptr
  34744 type EMRSETPOLYFILLMODE = tagEMRSELECTCLIPPATH
  34745 type PEMRSETPOLYFILLMODE = uintptr
  34746 type EMRSETROP2 = tagEMRSELECTCLIPPATH
  34747 type PEMRSETROP2 = uintptr
  34748 type EMRSETSTRETCHBLTMODE = tagEMRSELECTCLIPPATH
  34749 type PEMRSETSTRETCHBLTMODE = uintptr
  34750 type EMRSETICMMODE = tagEMRSELECTCLIPPATH
  34751 type PEMRSETICMMODE = uintptr
  34752 type EMRSETTEXTALIGN = tagEMRSELECTCLIPPATH
  34753 type PEMRSETTEXTALIGN = uintptr
  34754 
  34755 type tagEMRSETMITERLIMIT = struct {
  34756 	Femr         EMR
  34757 	FeMiterLimit FLOAT
  34758 }
  34759 
  34760 type EMRSETMITERLIMIT = tagEMRSETMITERLIMIT
  34761 type PEMRSETMITERLIMIT = uintptr
  34762 
  34763 type tagEMRRESTOREDC = struct {
  34764 	Femr       EMR
  34765 	FiRelative LONG
  34766 }
  34767 
  34768 type EMRRESTOREDC = tagEMRRESTOREDC
  34769 type PEMRRESTOREDC = uintptr
  34770 
  34771 type tagEMRSETARCDIRECTION = struct {
  34772 	Femr           EMR
  34773 	FiArcDirection DWORD
  34774 }
  34775 
  34776 type EMRSETARCDIRECTION = tagEMRSETARCDIRECTION
  34777 type PEMRSETARCDIRECTION = uintptr
  34778 
  34779 type tagEMRSETMAPPERFLAGS = struct {
  34780 	Femr     EMR
  34781 	FdwFlags DWORD
  34782 }
  34783 
  34784 type EMRSETMAPPERFLAGS = tagEMRSETMAPPERFLAGS
  34785 type PEMRSETMAPPERFLAGS = uintptr
  34786 
  34787 type tagEMRSETTEXTCOLOR = struct {
  34788 	Femr     EMR
  34789 	FcrColor COLORREF
  34790 }
  34791 
  34792 type EMRSETBKCOLOR = tagEMRSETTEXTCOLOR
  34793 type PEMRSETBKCOLOR = uintptr
  34794 type EMRSETTEXTCOLOR = tagEMRSETTEXTCOLOR
  34795 type PEMRSETTEXTCOLOR = uintptr
  34796 
  34797 type tagEMRSELECTOBJECT = struct {
  34798 	Femr      EMR
  34799 	FihObject DWORD
  34800 }
  34801 
  34802 type EMRSELECTOBJECT = tagEMRSELECTOBJECT
  34803 type PEMRSELECTOBJECT = uintptr
  34804 type EMRDELETEOBJECT = tagEMRSELECTOBJECT
  34805 type PEMRDELETEOBJECT = uintptr
  34806 
  34807 type tagEMRSELECTPALETTE = struct {
  34808 	Femr   EMR
  34809 	FihPal DWORD
  34810 }
  34811 
  34812 type EMRSELECTPALETTE = tagEMRSELECTPALETTE
  34813 type PEMRSELECTPALETTE = uintptr
  34814 
  34815 type tagEMRRESIZEPALETTE = struct {
  34816 	Femr      EMR
  34817 	FihPal    DWORD
  34818 	FcEntries DWORD
  34819 }
  34820 
  34821 type EMRRESIZEPALETTE = tagEMRRESIZEPALETTE
  34822 type PEMRRESIZEPALETTE = uintptr
  34823 
  34824 type tagEMRSETPALETTEENTRIES = struct {
  34825 	Femr         EMR
  34826 	FihPal       DWORD
  34827 	FiStart      DWORD
  34828 	FcEntries    DWORD
  34829 	FaPalEntries [1]PALETTEENTRY
  34830 }
  34831 
  34832 type EMRSETPALETTEENTRIES = tagEMRSETPALETTEENTRIES
  34833 type PEMRSETPALETTEENTRIES = uintptr
  34834 
  34835 type tagEMRSETCOLORADJUSTMENT = struct {
  34836 	Femr             EMR
  34837 	FColorAdjustment COLORADJUSTMENT
  34838 }
  34839 
  34840 type EMRSETCOLORADJUSTMENT = tagEMRSETCOLORADJUSTMENT
  34841 type PEMRSETCOLORADJUSTMENT = uintptr
  34842 
  34843 type tagEMRGDICOMMENT = struct {
  34844 	Femr         EMR
  34845 	FcbData      DWORD
  34846 	FData        [1]BYTE
  34847 	F__ccgo_pad1 [3]byte
  34848 }
  34849 
  34850 type EMRGDICOMMENT = tagEMRGDICOMMENT
  34851 type PEMRGDICOMMENT = uintptr
  34852 
  34853 type tagEMREOF = struct {
  34854 	Femr           EMR
  34855 	FnPalEntries   DWORD
  34856 	FoffPalEntries DWORD
  34857 	FnSizeLast     DWORD
  34858 }
  34859 
  34860 type EMREOF = tagEMREOF
  34861 type PEMREOF = uintptr
  34862 
  34863 type tagEMRLINETO = struct {
  34864 	Femr EMR
  34865 	Fptl POINTL
  34866 }
  34867 
  34868 type EMRLINETO = tagEMRLINETO
  34869 type PEMRLINETO = uintptr
  34870 type EMRMOVETOEX = tagEMRLINETO
  34871 type PEMRMOVETOEX = uintptr
  34872 
  34873 type tagEMROFFSETCLIPRGN = struct {
  34874 	Femr       EMR
  34875 	FptlOffset POINTL
  34876 }
  34877 
  34878 type EMROFFSETCLIPRGN = tagEMROFFSETCLIPRGN
  34879 type PEMROFFSETCLIPRGN = uintptr
  34880 
  34881 type tagEMRFILLPATH = struct {
  34882 	Femr       EMR
  34883 	FrclBounds RECTL
  34884 }
  34885 
  34886 type EMRFILLPATH = tagEMRFILLPATH
  34887 type PEMRFILLPATH = uintptr
  34888 type EMRSTROKEANDFILLPATH = tagEMRFILLPATH
  34889 type PEMRSTROKEANDFILLPATH = uintptr
  34890 type EMRSTROKEPATH = tagEMRFILLPATH
  34891 type PEMRSTROKEPATH = uintptr
  34892 
  34893 type tagEMREXCLUDECLIPRECT = struct {
  34894 	Femr     EMR
  34895 	FrclClip RECTL
  34896 }
  34897 
  34898 type EMREXCLUDECLIPRECT = tagEMREXCLUDECLIPRECT
  34899 type PEMREXCLUDECLIPRECT = uintptr
  34900 type EMRINTERSECTCLIPRECT = tagEMREXCLUDECLIPRECT
  34901 type PEMRINTERSECTCLIPRECT = uintptr
  34902 
  34903 type tagEMRSETVIEWPORTORGEX = struct {
  34904 	Femr       EMR
  34905 	FptlOrigin POINTL
  34906 }
  34907 
  34908 type EMRSETVIEWPORTORGEX = tagEMRSETVIEWPORTORGEX
  34909 type PEMRSETVIEWPORTORGEX = uintptr
  34910 type EMRSETWINDOWORGEX = tagEMRSETVIEWPORTORGEX
  34911 type PEMRSETWINDOWORGEX = uintptr
  34912 type EMRSETBRUSHORGEX = tagEMRSETVIEWPORTORGEX
  34913 type PEMRSETBRUSHORGEX = uintptr
  34914 
  34915 type tagEMRSETVIEWPORTEXTEX = struct {
  34916 	Femr       EMR
  34917 	FszlExtent SIZEL
  34918 }
  34919 
  34920 type EMRSETVIEWPORTEXTEX = tagEMRSETVIEWPORTEXTEX
  34921 type PEMRSETVIEWPORTEXTEX = uintptr
  34922 type EMRSETWINDOWEXTEX = tagEMRSETVIEWPORTEXTEX
  34923 type PEMRSETWINDOWEXTEX = uintptr
  34924 
  34925 type tagEMRSCALEVIEWPORTEXTEX = struct {
  34926 	Femr    EMR
  34927 	FxNum   LONG
  34928 	FxDenom LONG
  34929 	FyNum   LONG
  34930 	FyDenom LONG
  34931 }
  34932 
  34933 type EMRSCALEVIEWPORTEXTEX = tagEMRSCALEVIEWPORTEXTEX
  34934 type PEMRSCALEVIEWPORTEXTEX = uintptr
  34935 type EMRSCALEWINDOWEXTEX = tagEMRSCALEVIEWPORTEXTEX
  34936 type PEMRSCALEWINDOWEXTEX = uintptr
  34937 
  34938 type tagEMRSETWORLDTRANSFORM = struct {
  34939 	Femr   EMR
  34940 	Fxform XFORM
  34941 }
  34942 
  34943 type EMRSETWORLDTRANSFORM = tagEMRSETWORLDTRANSFORM
  34944 type PEMRSETWORLDTRANSFORM = uintptr
  34945 
  34946 type tagEMRMODIFYWORLDTRANSFORM = struct {
  34947 	Femr   EMR
  34948 	Fxform XFORM
  34949 	FiMode DWORD
  34950 }
  34951 
  34952 type EMRMODIFYWORLDTRANSFORM = tagEMRMODIFYWORLDTRANSFORM
  34953 type PEMRMODIFYWORLDTRANSFORM = uintptr
  34954 
  34955 type tagEMRSETPIXELV = struct {
  34956 	Femr      EMR
  34957 	FptlPixel POINTL
  34958 	FcrColor  COLORREF
  34959 }
  34960 
  34961 type EMRSETPIXELV = tagEMRSETPIXELV
  34962 type PEMRSETPIXELV = uintptr
  34963 
  34964 type tagEMREXTFLOODFILL = struct {
  34965 	Femr      EMR
  34966 	FptlStart POINTL
  34967 	FcrColor  COLORREF
  34968 	FiMode    DWORD
  34969 }
  34970 
  34971 type EMREXTFLOODFILL = tagEMREXTFLOODFILL
  34972 type PEMREXTFLOODFILL = uintptr
  34973 
  34974 type tagEMRELLIPSE = struct {
  34975 	Femr    EMR
  34976 	FrclBox RECTL
  34977 }
  34978 
  34979 type EMRELLIPSE = tagEMRELLIPSE
  34980 type PEMRELLIPSE = uintptr
  34981 type EMRRECTANGLE = tagEMRELLIPSE
  34982 type PEMRRECTANGLE = uintptr
  34983 
  34984 type tagEMRROUNDRECT = struct {
  34985 	Femr       EMR
  34986 	FrclBox    RECTL
  34987 	FszlCorner SIZEL
  34988 }
  34989 
  34990 type EMRROUNDRECT = tagEMRROUNDRECT
  34991 type PEMRROUNDRECT = uintptr
  34992 
  34993 type tagEMRARC = struct {
  34994 	Femr      EMR
  34995 	FrclBox   RECTL
  34996 	FptlStart POINTL
  34997 	FptlEnd   POINTL
  34998 }
  34999 
  35000 type EMRARC = tagEMRARC
  35001 type PEMRARC = uintptr
  35002 type EMRARCTO = tagEMRARC
  35003 type PEMRARCTO = uintptr
  35004 type EMRCHORD = tagEMRARC
  35005 type PEMRCHORD = uintptr
  35006 type EMRPIE = tagEMRARC
  35007 type PEMRPIE = uintptr
  35008 
  35009 type tagEMRANGLEARC = struct {
  35010 	Femr         EMR
  35011 	FptlCenter   POINTL
  35012 	FnRadius     DWORD
  35013 	FeStartAngle FLOAT
  35014 	FeSweepAngle FLOAT
  35015 }
  35016 
  35017 type EMRANGLEARC = tagEMRANGLEARC
  35018 type PEMRANGLEARC = uintptr
  35019 
  35020 type tagEMRPOLYLINE = struct {
  35021 	Femr       EMR
  35022 	FrclBounds RECTL
  35023 	Fcptl      DWORD
  35024 	Faptl      [1]POINTL
  35025 }
  35026 
  35027 type EMRPOLYLINE = tagEMRPOLYLINE
  35028 type PEMRPOLYLINE = uintptr
  35029 type EMRPOLYBEZIER = tagEMRPOLYLINE
  35030 type PEMRPOLYBEZIER = uintptr
  35031 type EMRPOLYGON = tagEMRPOLYLINE
  35032 type PEMRPOLYGON = uintptr
  35033 type EMRPOLYBEZIERTO = tagEMRPOLYLINE
  35034 type PEMRPOLYBEZIERTO = uintptr
  35035 type EMRPOLYLINETO = tagEMRPOLYLINE
  35036 type PEMRPOLYLINETO = uintptr
  35037 
  35038 type tagEMRPOLYLINE16 = struct {
  35039 	Femr       EMR
  35040 	FrclBounds RECTL
  35041 	Fcpts      DWORD
  35042 	Fapts      [1]POINTS
  35043 }
  35044 
  35045 type EMRPOLYLINE16 = tagEMRPOLYLINE16
  35046 type PEMRPOLYLINE16 = uintptr
  35047 type EMRPOLYBEZIER16 = tagEMRPOLYLINE16
  35048 type PEMRPOLYBEZIER16 = uintptr
  35049 type EMRPOLYGON16 = tagEMRPOLYLINE16
  35050 type PEMRPOLYGON16 = uintptr
  35051 type EMRPOLYBEZIERTO16 = tagEMRPOLYLINE16
  35052 type PEMRPOLYBEZIERTO16 = uintptr
  35053 type EMRPOLYLINETO16 = tagEMRPOLYLINE16
  35054 type PEMRPOLYLINETO16 = uintptr
  35055 
  35056 type tagEMRPOLYDRAW = struct {
  35057 	Femr         EMR
  35058 	FrclBounds   RECTL
  35059 	Fcptl        DWORD
  35060 	Faptl        [1]POINTL
  35061 	FabTypes     [1]BYTE
  35062 	F__ccgo_pad1 [3]byte
  35063 }
  35064 
  35065 type EMRPOLYDRAW = tagEMRPOLYDRAW
  35066 type PEMRPOLYDRAW = uintptr
  35067 
  35068 type tagEMRPOLYDRAW16 = struct {
  35069 	Femr         EMR
  35070 	FrclBounds   RECTL
  35071 	Fcpts        DWORD
  35072 	Fapts        [1]POINTS
  35073 	FabTypes     [1]BYTE
  35074 	F__ccgo_pad1 [3]byte
  35075 }
  35076 
  35077 type EMRPOLYDRAW16 = tagEMRPOLYDRAW16
  35078 type PEMRPOLYDRAW16 = uintptr
  35079 
  35080 type tagEMRPOLYPOLYLINE = struct {
  35081 	Femr         EMR
  35082 	FrclBounds   RECTL
  35083 	FnPolys      DWORD
  35084 	Fcptl        DWORD
  35085 	FaPolyCounts [1]DWORD
  35086 	Faptl        [1]POINTL
  35087 }
  35088 
  35089 type EMRPOLYPOLYLINE = tagEMRPOLYPOLYLINE
  35090 type PEMRPOLYPOLYLINE = uintptr
  35091 type EMRPOLYPOLYGON = tagEMRPOLYPOLYLINE
  35092 type PEMRPOLYPOLYGON = uintptr
  35093 
  35094 type tagEMRPOLYPOLYLINE16 = struct {
  35095 	Femr         EMR
  35096 	FrclBounds   RECTL
  35097 	FnPolys      DWORD
  35098 	Fcpts        DWORD
  35099 	FaPolyCounts [1]DWORD
  35100 	Fapts        [1]POINTS
  35101 }
  35102 
  35103 type EMRPOLYPOLYLINE16 = tagEMRPOLYPOLYLINE16
  35104 type PEMRPOLYPOLYLINE16 = uintptr
  35105 type EMRPOLYPOLYGON16 = tagEMRPOLYPOLYLINE16
  35106 type PEMRPOLYPOLYGON16 = uintptr
  35107 
  35108 type tagEMRINVERTRGN = struct {
  35109 	Femr         EMR
  35110 	FrclBounds   RECTL
  35111 	FcbRgnData   DWORD
  35112 	FRgnData     [1]BYTE
  35113 	F__ccgo_pad1 [3]byte
  35114 }
  35115 
  35116 type EMRINVERTRGN = tagEMRINVERTRGN
  35117 type PEMRINVERTRGN = uintptr
  35118 type EMRPAINTRGN = tagEMRINVERTRGN
  35119 type PEMRPAINTRGN = uintptr
  35120 
  35121 type tagEMRFILLRGN = struct {
  35122 	Femr         EMR
  35123 	FrclBounds   RECTL
  35124 	FcbRgnData   DWORD
  35125 	FihBrush     DWORD
  35126 	FRgnData     [1]BYTE
  35127 	F__ccgo_pad1 [3]byte
  35128 }
  35129 
  35130 type EMRFILLRGN = tagEMRFILLRGN
  35131 type PEMRFILLRGN = uintptr
  35132 
  35133 type tagEMRFRAMERGN = struct {
  35134 	Femr         EMR
  35135 	FrclBounds   RECTL
  35136 	FcbRgnData   DWORD
  35137 	FihBrush     DWORD
  35138 	FszlStroke   SIZEL
  35139 	FRgnData     [1]BYTE
  35140 	F__ccgo_pad1 [3]byte
  35141 }
  35142 
  35143 type EMRFRAMERGN = tagEMRFRAMERGN
  35144 type PEMRFRAMERGN = uintptr
  35145 
  35146 type tagEMREXTSELECTCLIPRGN = struct {
  35147 	Femr         EMR
  35148 	FcbRgnData   DWORD
  35149 	FiMode       DWORD
  35150 	FRgnData     [1]BYTE
  35151 	F__ccgo_pad1 [3]byte
  35152 }
  35153 
  35154 type EMREXTSELECTCLIPRGN = tagEMREXTSELECTCLIPRGN
  35155 type PEMREXTSELECTCLIPRGN = uintptr
  35156 
  35157 type tagEMREXTTEXTOUTA = struct {
  35158 	Femr           EMR
  35159 	FrclBounds     RECTL
  35160 	FiGraphicsMode DWORD
  35161 	FexScale       FLOAT
  35162 	FeyScale       FLOAT
  35163 	Femrtext       EMRTEXT
  35164 }
  35165 
  35166 type EMREXTTEXTOUTA = tagEMREXTTEXTOUTA
  35167 type PEMREXTTEXTOUTA = uintptr
  35168 type EMREXTTEXTOUTW = tagEMREXTTEXTOUTA
  35169 type PEMREXTTEXTOUTW = uintptr
  35170 
  35171 type tagEMRPOLYTEXTOUTA = struct {
  35172 	Femr           EMR
  35173 	FrclBounds     RECTL
  35174 	FiGraphicsMode DWORD
  35175 	FexScale       FLOAT
  35176 	FeyScale       FLOAT
  35177 	FcStrings      LONG
  35178 	Faemrtext      [1]EMRTEXT
  35179 }
  35180 
  35181 type EMRPOLYTEXTOUTA = tagEMRPOLYTEXTOUTA
  35182 type PEMRPOLYTEXTOUTA = uintptr
  35183 type EMRPOLYTEXTOUTW = tagEMRPOLYTEXTOUTA
  35184 type PEMRPOLYTEXTOUTW = uintptr
  35185 
  35186 type tagEMRBITBLT = struct {
  35187 	Femr          EMR
  35188 	FrclBounds    RECTL
  35189 	FxDest        LONG
  35190 	FyDest        LONG
  35191 	FcxDest       LONG
  35192 	FcyDest       LONG
  35193 	FdwRop        DWORD
  35194 	FxSrc         LONG
  35195 	FySrc         LONG
  35196 	FxformSrc     XFORM
  35197 	FcrBkColorSrc COLORREF
  35198 	FiUsageSrc    DWORD
  35199 	FoffBmiSrc    DWORD
  35200 	FcbBmiSrc     DWORD
  35201 	FoffBitsSrc   DWORD
  35202 	FcbBitsSrc    DWORD
  35203 }
  35204 
  35205 type EMRBITBLT = tagEMRBITBLT
  35206 type PEMRBITBLT = uintptr
  35207 
  35208 type tagEMRSTRETCHBLT = struct {
  35209 	Femr          EMR
  35210 	FrclBounds    RECTL
  35211 	FxDest        LONG
  35212 	FyDest        LONG
  35213 	FcxDest       LONG
  35214 	FcyDest       LONG
  35215 	FdwRop        DWORD
  35216 	FxSrc         LONG
  35217 	FySrc         LONG
  35218 	FxformSrc     XFORM
  35219 	FcrBkColorSrc COLORREF
  35220 	FiUsageSrc    DWORD
  35221 	FoffBmiSrc    DWORD
  35222 	FcbBmiSrc     DWORD
  35223 	FoffBitsSrc   DWORD
  35224 	FcbBitsSrc    DWORD
  35225 	FcxSrc        LONG
  35226 	FcySrc        LONG
  35227 }
  35228 
  35229 type EMRSTRETCHBLT = tagEMRSTRETCHBLT
  35230 type PEMRSTRETCHBLT = uintptr
  35231 
  35232 type tagEMRMASKBLT = struct {
  35233 	Femr          EMR
  35234 	FrclBounds    RECTL
  35235 	FxDest        LONG
  35236 	FyDest        LONG
  35237 	FcxDest       LONG
  35238 	FcyDest       LONG
  35239 	FdwRop        DWORD
  35240 	FxSrc         LONG
  35241 	FySrc         LONG
  35242 	FxformSrc     XFORM
  35243 	FcrBkColorSrc COLORREF
  35244 	FiUsageSrc    DWORD
  35245 	FoffBmiSrc    DWORD
  35246 	FcbBmiSrc     DWORD
  35247 	FoffBitsSrc   DWORD
  35248 	FcbBitsSrc    DWORD
  35249 	FxMask        LONG
  35250 	FyMask        LONG
  35251 	FiUsageMask   DWORD
  35252 	FoffBmiMask   DWORD
  35253 	FcbBmiMask    DWORD
  35254 	FoffBitsMask  DWORD
  35255 	FcbBitsMask   DWORD
  35256 }
  35257 
  35258 type EMRMASKBLT = tagEMRMASKBLT
  35259 type PEMRMASKBLT = uintptr
  35260 
  35261 type tagEMRPLGBLT = struct {
  35262 	Femr          EMR
  35263 	FrclBounds    RECTL
  35264 	FaptlDest     [3]POINTL
  35265 	FxSrc         LONG
  35266 	FySrc         LONG
  35267 	FcxSrc        LONG
  35268 	FcySrc        LONG
  35269 	FxformSrc     XFORM
  35270 	FcrBkColorSrc COLORREF
  35271 	FiUsageSrc    DWORD
  35272 	FoffBmiSrc    DWORD
  35273 	FcbBmiSrc     DWORD
  35274 	FoffBitsSrc   DWORD
  35275 	FcbBitsSrc    DWORD
  35276 	FxMask        LONG
  35277 	FyMask        LONG
  35278 	FiUsageMask   DWORD
  35279 	FoffBmiMask   DWORD
  35280 	FcbBmiMask    DWORD
  35281 	FoffBitsMask  DWORD
  35282 	FcbBitsMask   DWORD
  35283 }
  35284 
  35285 type EMRPLGBLT = tagEMRPLGBLT
  35286 type PEMRPLGBLT = uintptr
  35287 
  35288 type tagEMRSETDIBITSTODEVICE = struct {
  35289 	Femr        EMR
  35290 	FrclBounds  RECTL
  35291 	FxDest      LONG
  35292 	FyDest      LONG
  35293 	FxSrc       LONG
  35294 	FySrc       LONG
  35295 	FcxSrc      LONG
  35296 	FcySrc      LONG
  35297 	FoffBmiSrc  DWORD
  35298 	FcbBmiSrc   DWORD
  35299 	FoffBitsSrc DWORD
  35300 	FcbBitsSrc  DWORD
  35301 	FiUsageSrc  DWORD
  35302 	FiStartScan DWORD
  35303 	FcScans     DWORD
  35304 }
  35305 
  35306 type EMRSETDIBITSTODEVICE = tagEMRSETDIBITSTODEVICE
  35307 type PEMRSETDIBITSTODEVICE = uintptr
  35308 
  35309 type tagEMRSTRETCHDIBITS = struct {
  35310 	Femr        EMR
  35311 	FrclBounds  RECTL
  35312 	FxDest      LONG
  35313 	FyDest      LONG
  35314 	FxSrc       LONG
  35315 	FySrc       LONG
  35316 	FcxSrc      LONG
  35317 	FcySrc      LONG
  35318 	FoffBmiSrc  DWORD
  35319 	FcbBmiSrc   DWORD
  35320 	FoffBitsSrc DWORD
  35321 	FcbBitsSrc  DWORD
  35322 	FiUsageSrc  DWORD
  35323 	FdwRop      DWORD
  35324 	FcxDest     LONG
  35325 	FcyDest     LONG
  35326 }
  35327 
  35328 type EMRSTRETCHDIBITS = tagEMRSTRETCHDIBITS
  35329 type PEMRSTRETCHDIBITS = uintptr
  35330 
  35331 type tagEMREXTCREATEFONTINDIRECTW = struct {
  35332 	Femr    EMR
  35333 	FihFont DWORD
  35334 	Felfw   EXTLOGFONTW
  35335 }
  35336 
  35337 type EMREXTCREATEFONTINDIRECTW = tagEMREXTCREATEFONTINDIRECTW
  35338 type PEMREXTCREATEFONTINDIRECTW = uintptr
  35339 
  35340 type tagEMRCREATEPALETTE = struct {
  35341 	Femr   EMR
  35342 	FihPal DWORD
  35343 	Flgpl  LOGPALETTE
  35344 }
  35345 
  35346 type EMRCREATEPALETTE = tagEMRCREATEPALETTE
  35347 type PEMRCREATEPALETTE = uintptr
  35348 
  35349 type tagEMRCREATEPEN = struct {
  35350 	Femr   EMR
  35351 	FihPen DWORD
  35352 	Flopn  LOGPEN
  35353 }
  35354 
  35355 type EMRCREATEPEN = tagEMRCREATEPEN
  35356 type PEMRCREATEPEN = uintptr
  35357 
  35358 type tagEMREXTCREATEPEN = struct {
  35359 	Femr         EMR
  35360 	FihPen       DWORD
  35361 	FoffBmi      DWORD
  35362 	FcbBmi       DWORD
  35363 	FoffBits     DWORD
  35364 	FcbBits      DWORD
  35365 	F__ccgo_pad1 [4]byte
  35366 	Felp         EXTLOGPEN
  35367 }
  35368 
  35369 type EMREXTCREATEPEN = tagEMREXTCREATEPEN
  35370 type PEMREXTCREATEPEN = uintptr
  35371 
  35372 type tagEMRCREATEBRUSHINDIRECT = struct {
  35373 	Femr     EMR
  35374 	FihBrush DWORD
  35375 	Flb      LOGBRUSH32
  35376 }
  35377 
  35378 type EMRCREATEBRUSHINDIRECT = tagEMRCREATEBRUSHINDIRECT
  35379 type PEMRCREATEBRUSHINDIRECT = uintptr
  35380 
  35381 type tagEMRCREATEMONOBRUSH = struct {
  35382 	Femr     EMR
  35383 	FihBrush DWORD
  35384 	FiUsage  DWORD
  35385 	FoffBmi  DWORD
  35386 	FcbBmi   DWORD
  35387 	FoffBits DWORD
  35388 	FcbBits  DWORD
  35389 }
  35390 
  35391 type EMRCREATEMONOBRUSH = tagEMRCREATEMONOBRUSH
  35392 type PEMRCREATEMONOBRUSH = uintptr
  35393 
  35394 type tagEMRCREATEDIBPATTERNBRUSHPT = struct {
  35395 	Femr     EMR
  35396 	FihBrush DWORD
  35397 	FiUsage  DWORD
  35398 	FoffBmi  DWORD
  35399 	FcbBmi   DWORD
  35400 	FoffBits DWORD
  35401 	FcbBits  DWORD
  35402 }
  35403 
  35404 type EMRCREATEDIBPATTERNBRUSHPT = tagEMRCREATEDIBPATTERNBRUSHPT
  35405 type PEMRCREATEDIBPATTERNBRUSHPT = uintptr
  35406 
  35407 type tagEMRFORMAT = struct {
  35408 	FdSignature DWORD
  35409 	FnVersion   DWORD
  35410 	FcbData     DWORD
  35411 	FoffData    DWORD
  35412 }
  35413 
  35414 type EMRFORMAT = tagEMRFORMAT
  35415 type PEMRFORMAT = uintptr
  35416 
  35417 type tagEMRGLSRECORD = struct {
  35418 	Femr         EMR
  35419 	FcbData      DWORD
  35420 	FData        [1]BYTE
  35421 	F__ccgo_pad1 [3]byte
  35422 }
  35423 
  35424 type EMRGLSRECORD = tagEMRGLSRECORD
  35425 type PEMRGLSRECORD = uintptr
  35426 
  35427 type tagEMRGLSBOUNDEDRECORD = struct {
  35428 	Femr         EMR
  35429 	FrclBounds   RECTL
  35430 	FcbData      DWORD
  35431 	FData        [1]BYTE
  35432 	F__ccgo_pad1 [3]byte
  35433 }
  35434 
  35435 type EMRGLSBOUNDEDRECORD = tagEMRGLSBOUNDEDRECORD
  35436 type PEMRGLSBOUNDEDRECORD = uintptr
  35437 
  35438 type tagEMRPIXELFORMAT = struct {
  35439 	Femr EMR
  35440 	Fpfd PIXELFORMATDESCRIPTOR
  35441 }
  35442 
  35443 type EMRPIXELFORMAT = tagEMRPIXELFORMAT
  35444 type PEMRPIXELFORMAT = uintptr
  35445 
  35446 type tagEMRCREATECOLORSPACE = struct {
  35447 	Femr  EMR
  35448 	FihCS DWORD
  35449 	Flcs  LOGCOLORSPACEA
  35450 }
  35451 
  35452 type EMRCREATECOLORSPACE = tagEMRCREATECOLORSPACE
  35453 type PEMRCREATECOLORSPACE = uintptr
  35454 
  35455 type tagEMRSETCOLORSPACE = struct {
  35456 	Femr  EMR
  35457 	FihCS DWORD
  35458 }
  35459 
  35460 type EMRSETCOLORSPACE = tagEMRSETCOLORSPACE
  35461 type PEMRSETCOLORSPACE = uintptr
  35462 type EMRSELECTCOLORSPACE = tagEMRSETCOLORSPACE
  35463 type PEMRSELECTCOLORSPACE = uintptr
  35464 type EMRDELETECOLORSPACE = tagEMRSETCOLORSPACE
  35465 type PEMRDELETECOLORSPACE = uintptr
  35466 
  35467 type tagEMREXTESCAPE = struct {
  35468 	Femr         EMR
  35469 	FiEscape     INT
  35470 	FcbEscData   INT
  35471 	FEscData     [1]BYTE
  35472 	F__ccgo_pad1 [3]byte
  35473 }
  35474 
  35475 type EMREXTESCAPE = tagEMREXTESCAPE
  35476 type PEMREXTESCAPE = uintptr
  35477 type EMRDRAWESCAPE = tagEMREXTESCAPE
  35478 type PEMRDRAWESCAPE = uintptr
  35479 
  35480 type tagEMRNAMEDESCAPE = struct {
  35481 	Femr         EMR
  35482 	FiEscape     INT
  35483 	FcbDriver    INT
  35484 	FcbEscData   INT
  35485 	FEscData     [1]BYTE
  35486 	F__ccgo_pad1 [3]byte
  35487 }
  35488 
  35489 type EMRNAMEDESCAPE = tagEMRNAMEDESCAPE
  35490 type PEMRNAMEDESCAPE = uintptr
  35491 
  35492 type tagEMRSETICMPROFILE = struct {
  35493 	Femr         EMR
  35494 	FdwFlags     DWORD
  35495 	FcbName      DWORD
  35496 	FcbData      DWORD
  35497 	FData        [1]BYTE
  35498 	F__ccgo_pad1 [3]byte
  35499 }
  35500 
  35501 type EMRSETICMPROFILE = tagEMRSETICMPROFILE
  35502 type PEMRSETICMPROFILE = uintptr
  35503 type EMRSETICMPROFILEA = tagEMRSETICMPROFILE
  35504 type PEMRSETICMPROFILEA = uintptr
  35505 type EMRSETICMPROFILEW = tagEMRSETICMPROFILE
  35506 type PEMRSETICMPROFILEW = uintptr
  35507 
  35508 type tagEMRCREATECOLORSPACEW = struct {
  35509 	Femr         EMR
  35510 	FihCS        DWORD
  35511 	Flcs         LOGCOLORSPACEW
  35512 	FdwFlags     DWORD
  35513 	FcbData      DWORD
  35514 	FData        [1]BYTE
  35515 	F__ccgo_pad1 [3]byte
  35516 }
  35517 
  35518 type EMRCREATECOLORSPACEW = tagEMRCREATECOLORSPACEW
  35519 type PEMRCREATECOLORSPACEW = uintptr
  35520 
  35521 type tagCOLORMATCHTOTARGET = struct {
  35522 	Femr         EMR
  35523 	FdwAction    DWORD
  35524 	FdwFlags     DWORD
  35525 	FcbName      DWORD
  35526 	FcbData      DWORD
  35527 	FData        [1]BYTE
  35528 	F__ccgo_pad1 [3]byte
  35529 }
  35530 
  35531 type EMRCOLORMATCHTOTARGET = tagCOLORMATCHTOTARGET
  35532 type PEMRCOLORMATCHTOTARGET = uintptr
  35533 
  35534 type tagCOLORCORRECTPALETTE = struct {
  35535 	Femr         EMR
  35536 	FihPalette   DWORD
  35537 	FnFirstEntry DWORD
  35538 	FnPalEntries DWORD
  35539 	FnReserved   DWORD
  35540 }
  35541 
  35542 type EMRCOLORCORRECTPALETTE = tagCOLORCORRECTPALETTE
  35543 type PEMRCOLORCORRECTPALETTE = uintptr
  35544 
  35545 type tagEMRALPHABLEND = struct {
  35546 	Femr          EMR
  35547 	FrclBounds    RECTL
  35548 	FxDest        LONG
  35549 	FyDest        LONG
  35550 	FcxDest       LONG
  35551 	FcyDest       LONG
  35552 	FdwRop        DWORD
  35553 	FxSrc         LONG
  35554 	FySrc         LONG
  35555 	FxformSrc     XFORM
  35556 	FcrBkColorSrc COLORREF
  35557 	FiUsageSrc    DWORD
  35558 	FoffBmiSrc    DWORD
  35559 	FcbBmiSrc     DWORD
  35560 	FoffBitsSrc   DWORD
  35561 	FcbBitsSrc    DWORD
  35562 	FcxSrc        LONG
  35563 	FcySrc        LONG
  35564 }
  35565 
  35566 type EMRALPHABLEND = tagEMRALPHABLEND
  35567 type PEMRALPHABLEND = uintptr
  35568 
  35569 type tagEMRGRADIENTFILL = struct {
  35570 	Femr       EMR
  35571 	FrclBounds RECTL
  35572 	FnVer      DWORD
  35573 	FnTri      DWORD
  35574 	FulMode    ULONG
  35575 	FVer       [1]TRIVERTEX
  35576 }
  35577 
  35578 type EMRGRADIENTFILL = tagEMRGRADIENTFILL
  35579 type PEMRGRADIENTFILL = uintptr
  35580 
  35581 type tagEMRTRANSPARENTBLT = struct {
  35582 	Femr          EMR
  35583 	FrclBounds    RECTL
  35584 	FxDest        LONG
  35585 	FyDest        LONG
  35586 	FcxDest       LONG
  35587 	FcyDest       LONG
  35588 	FdwRop        DWORD
  35589 	FxSrc         LONG
  35590 	FySrc         LONG
  35591 	FxformSrc     XFORM
  35592 	FcrBkColorSrc COLORREF
  35593 	FiUsageSrc    DWORD
  35594 	FoffBmiSrc    DWORD
  35595 	FcbBmiSrc     DWORD
  35596 	FoffBitsSrc   DWORD
  35597 	FcbBitsSrc    DWORD
  35598 	FcxSrc        LONG
  35599 	FcySrc        LONG
  35600 }
  35601 
  35602 type EMRTRANSPARENTBLT = tagEMRTRANSPARENTBLT
  35603 type PEMRTRANSPARENTBLT = uintptr
  35604 
  35605 type _POINTFLOAT = struct {
  35606 	Fx FLOAT
  35607 	Fy FLOAT
  35608 }
  35609 
  35610 type POINTFLOAT = _POINTFLOAT
  35611 type PPOINTFLOAT = uintptr
  35612 
  35613 type _GLYPHMETRICSFLOAT = struct {
  35614 	FgmfBlackBoxX     FLOAT
  35615 	FgmfBlackBoxY     FLOAT
  35616 	FgmfptGlyphOrigin POINTFLOAT
  35617 	FgmfCellIncX      FLOAT
  35618 	FgmfCellIncY      FLOAT
  35619 }
  35620 
  35621 type GLYPHMETRICSFLOAT = _GLYPHMETRICSFLOAT
  35622 type PGLYPHMETRICSFLOAT = uintptr
  35623 type LPGLYPHMETRICSFLOAT = uintptr
  35624 
  35625 type tagLAYERPLANEDESCRIPTOR = struct {
  35626 	FnSize           WORD
  35627 	FnVersion        WORD
  35628 	FdwFlags         DWORD
  35629 	FiPixelType      BYTE
  35630 	FcColorBits      BYTE
  35631 	FcRedBits        BYTE
  35632 	FcRedShift       BYTE
  35633 	FcGreenBits      BYTE
  35634 	FcGreenShift     BYTE
  35635 	FcBlueBits       BYTE
  35636 	FcBlueShift      BYTE
  35637 	FcAlphaBits      BYTE
  35638 	FcAlphaShift     BYTE
  35639 	FcAccumBits      BYTE
  35640 	FcAccumRedBits   BYTE
  35641 	FcAccumGreenBits BYTE
  35642 	FcAccumBlueBits  BYTE
  35643 	FcAccumAlphaBits BYTE
  35644 	FcDepthBits      BYTE
  35645 	FcStencilBits    BYTE
  35646 	FcAuxBuffers     BYTE
  35647 	FiLayerPlane     BYTE
  35648 	FbReserved       BYTE
  35649 	FcrTransparent   COLORREF
  35650 }
  35651 
  35652 type LAYERPLANEDESCRIPTOR = tagLAYERPLANEDESCRIPTOR
  35653 type PLAYERPLANEDESCRIPTOR = uintptr
  35654 type LPLAYERPLANEDESCRIPTOR = uintptr
  35655 
  35656 type _WGLSWAP = struct {
  35657 	Fhdc         HDC
  35658 	FuiFlags     UINT
  35659 	F__ccgo_pad1 [4]byte
  35660 }
  35661 
  35662 type WGLSWAP = _WGLSWAP
  35663 type PWGLSWAP = uintptr
  35664 type LPWGLSWAP = uintptr
  35665 
  35666 type HDWP = HANDLE
  35667 type LPMENUTEMPLATEA = PVOID
  35668 type LPMENUTEMPLATEW = PVOID
  35669 type LPMENUTEMPLATE = LPMENUTEMPLATEA
  35670 
  35671 type WNDPROC = uintptr
  35672 
  35673 type DLGPROC = uintptr
  35674 
  35675 type TIMERPROC = uintptr
  35676 type GRAYSTRINGPROC = uintptr
  35677 type WNDENUMPROC = uintptr
  35678 type HOOKPROC = uintptr
  35679 type SENDASYNCPROC = uintptr
  35680 
  35681 type PROPENUMPROCA = uintptr
  35682 type PROPENUMPROCW = uintptr
  35683 
  35684 type PROPENUMPROCEXA = uintptr
  35685 type PROPENUMPROCEXW = uintptr
  35686 
  35687 type EDITWORDBREAKPROCA = uintptr
  35688 type EDITWORDBREAKPROCW = uintptr
  35689 
  35690 type DRAWSTATEPROC = uintptr
  35691 
  35692 type PROPENUMPROC = PROPENUMPROCA
  35693 type PROPENUMPROCEX = PROPENUMPROCEXA
  35694 type EDITWORDBREAKPROC = EDITWORDBREAKPROCA
  35695 
  35696 type NAMEENUMPROCA = uintptr
  35697 type NAMEENUMPROCW = uintptr
  35698 type WINSTAENUMPROCA = NAMEENUMPROCA
  35699 type WINSTAENUMPROCW = NAMEENUMPROCW
  35700 type DESKTOPENUMPROCA = NAMEENUMPROCA
  35701 type DESKTOPENUMPROCW = NAMEENUMPROCW
  35702 
  35703 type WINSTAENUMPROC = WINSTAENUMPROCA
  35704 type DESKTOPENUMPROC = DESKTOPENUMPROCA
  35705 
  35706 type tagCBT_CREATEWNDA = struct {
  35707 	Flpcs            uintptr
  35708 	FhwndInsertAfter HWND
  35709 }
  35710 
  35711 type tagCREATESTRUCTA = struct {
  35712 	FlpCreateParams LPVOID
  35713 	FhInstance      HINSTANCE
  35714 	FhMenu          HMENU
  35715 	FhwndParent     HWND
  35716 	Fcy             int32
  35717 	Fcx             int32
  35718 	Fy              int32
  35719 	Fx              int32
  35720 	Fstyle          LONG
  35721 	F__ccgo_pad1    [4]byte
  35722 	FlpszName       LPCSTR
  35723 	FlpszClass      LPCSTR
  35724 	FdwExStyle      DWORD
  35725 	F__ccgo_pad2    [4]byte
  35726 }
  35727 
  35728 type CBT_CREATEWNDA = tagCBT_CREATEWNDA
  35729 type LPCBT_CREATEWNDA = uintptr
  35730 
  35731 type tagCBT_CREATEWNDW = struct {
  35732 	Flpcs            uintptr
  35733 	FhwndInsertAfter HWND
  35734 }
  35735 
  35736 type tagCREATESTRUCTW = struct {
  35737 	FlpCreateParams LPVOID
  35738 	FhInstance      HINSTANCE
  35739 	FhMenu          HMENU
  35740 	FhwndParent     HWND
  35741 	Fcy             int32
  35742 	Fcx             int32
  35743 	Fy              int32
  35744 	Fx              int32
  35745 	Fstyle          LONG
  35746 	F__ccgo_pad1    [4]byte
  35747 	FlpszName       LPCWSTR
  35748 	FlpszClass      LPCWSTR
  35749 	FdwExStyle      DWORD
  35750 	F__ccgo_pad2    [4]byte
  35751 }
  35752 
  35753 type CBT_CREATEWNDW = tagCBT_CREATEWNDW
  35754 type LPCBT_CREATEWNDW = uintptr
  35755 
  35756 type CBT_CREATEWND = CBT_CREATEWNDA
  35757 type LPCBT_CREATEWND = LPCBT_CREATEWNDA
  35758 
  35759 type tagCBTACTIVATESTRUCT = struct {
  35760 	FfMouse      WINBOOL
  35761 	F__ccgo_pad1 [4]byte
  35762 	FhWndActive  HWND
  35763 }
  35764 
  35765 type CBTACTIVATESTRUCT = tagCBTACTIVATESTRUCT
  35766 type LPCBTACTIVATESTRUCT = uintptr
  35767 
  35768 type tagWTSSESSION_NOTIFICATION = struct {
  35769 	FcbSize      DWORD
  35770 	FdwSessionId DWORD
  35771 }
  35772 
  35773 type WTSSESSION_NOTIFICATION = tagWTSSESSION_NOTIFICATION
  35774 type PWTSSESSION_NOTIFICATION = uintptr
  35775 
  35776 type SHELLHOOKINFO = struct {
  35777 	Fhwnd HWND
  35778 	Frc   RECT
  35779 }
  35780 type LPSHELLHOOKINFO = uintptr
  35781 
  35782 type tagEVENTMSG = struct {
  35783 	Fmessage UINT
  35784 	FparamL  UINT
  35785 	FparamH  UINT
  35786 	Ftime    DWORD
  35787 	Fhwnd    HWND
  35788 }
  35789 
  35790 type EVENTMSG = tagEVENTMSG
  35791 type PEVENTMSGMSG = uintptr
  35792 type NPEVENTMSGMSG = uintptr
  35793 type LPEVENTMSGMSG = uintptr
  35794 
  35795 type PEVENTMSG = uintptr
  35796 type NPEVENTMSG = uintptr
  35797 type LPEVENTMSG = uintptr
  35798 
  35799 type tagCWPSTRUCT = struct {
  35800 	FlParam      LPARAM
  35801 	FwParam      WPARAM
  35802 	Fmessage     UINT
  35803 	F__ccgo_pad1 [4]byte
  35804 	Fhwnd        HWND
  35805 }
  35806 
  35807 type CWPSTRUCT = tagCWPSTRUCT
  35808 type PCWPSTRUCT = uintptr
  35809 type NPCWPSTRUCT = uintptr
  35810 type LPCWPSTRUCT = uintptr
  35811 
  35812 type tagCWPRETSTRUCT = struct {
  35813 	FlResult     LRESULT
  35814 	FlParam      LPARAM
  35815 	FwParam      WPARAM
  35816 	Fmessage     UINT
  35817 	F__ccgo_pad1 [4]byte
  35818 	Fhwnd        HWND
  35819 }
  35820 
  35821 type CWPRETSTRUCT = tagCWPRETSTRUCT
  35822 type PCWPRETSTRUCT = uintptr
  35823 type NPCWPRETSTRUCT = uintptr
  35824 type LPCWPRETSTRUCT = uintptr
  35825 
  35826 type tagKBDLLHOOKSTRUCT = struct {
  35827 	FvkCode      DWORD
  35828 	FscanCode    DWORD
  35829 	Fflags       DWORD
  35830 	Ftime        DWORD
  35831 	FdwExtraInfo ULONG_PTR
  35832 }
  35833 
  35834 type KBDLLHOOKSTRUCT = tagKBDLLHOOKSTRUCT
  35835 type LPKBDLLHOOKSTRUCT = uintptr
  35836 type PKBDLLHOOKSTRUCT = uintptr
  35837 
  35838 type tagMSLLHOOKSTRUCT = struct {
  35839 	Fpt          POINT
  35840 	FmouseData   DWORD
  35841 	Fflags       DWORD
  35842 	Ftime        DWORD
  35843 	F__ccgo_pad1 [4]byte
  35844 	FdwExtraInfo ULONG_PTR
  35845 }
  35846 
  35847 type MSLLHOOKSTRUCT = tagMSLLHOOKSTRUCT
  35848 type LPMSLLHOOKSTRUCT = uintptr
  35849 type PMSLLHOOKSTRUCT = uintptr
  35850 
  35851 type tagDEBUGHOOKINFO = struct {
  35852 	FidThread          DWORD
  35853 	FidThreadInstaller DWORD
  35854 	FlParam            LPARAM
  35855 	FwParam            WPARAM
  35856 	Fcode              int32
  35857 	F__ccgo_pad1       [4]byte
  35858 }
  35859 
  35860 type DEBUGHOOKINFO = tagDEBUGHOOKINFO
  35861 type PDEBUGHOOKINFO = uintptr
  35862 type NPDEBUGHOOKINFO = uintptr
  35863 type LPDEBUGHOOKINFO = uintptr
  35864 
  35865 type tagMOUSEHOOKSTRUCT = struct {
  35866 	Fpt           POINT
  35867 	Fhwnd         HWND
  35868 	FwHitTestCode UINT
  35869 	F__ccgo_pad1  [4]byte
  35870 	FdwExtraInfo  ULONG_PTR
  35871 }
  35872 
  35873 type MOUSEHOOKSTRUCT = tagMOUSEHOOKSTRUCT
  35874 type LPMOUSEHOOKSTRUCT = uintptr
  35875 type PMOUSEHOOKSTRUCT = uintptr
  35876 
  35877 type tagMOUSEHOOKSTRUCTEX = struct {
  35878 	F__unnamed   MOUSEHOOKSTRUCT
  35879 	FmouseData   DWORD
  35880 	F__ccgo_pad1 [4]byte
  35881 }
  35882 
  35883 type MOUSEHOOKSTRUCTEX = tagMOUSEHOOKSTRUCTEX
  35884 type LPMOUSEHOOKSTRUCTEX = uintptr
  35885 type PMOUSEHOOKSTRUCTEX = uintptr
  35886 
  35887 type tagHARDWAREHOOKSTRUCT = struct {
  35888 	Fhwnd        HWND
  35889 	Fmessage     UINT
  35890 	F__ccgo_pad1 [4]byte
  35891 	FwParam      WPARAM
  35892 	FlParam      LPARAM
  35893 }
  35894 
  35895 type HARDWAREHOOKSTRUCT = tagHARDWAREHOOKSTRUCT
  35896 type LPHARDWAREHOOKSTRUCT = uintptr
  35897 type PHARDWAREHOOKSTRUCT = uintptr
  35898 
  35899 type tagMOUSEMOVEPOINT = struct {
  35900 	Fx           int32
  35901 	Fy           int32
  35902 	Ftime        DWORD
  35903 	F__ccgo_pad1 [4]byte
  35904 	FdwExtraInfo ULONG_PTR
  35905 }
  35906 
  35907 type MOUSEMOVEPOINT = tagMOUSEMOVEPOINT
  35908 type PMOUSEMOVEPOINT = uintptr
  35909 type LPMOUSEMOVEPOINT = uintptr
  35910 
  35911 type tagUSEROBJECTFLAGS = struct {
  35912 	FfInherit  WINBOOL
  35913 	FfReserved WINBOOL
  35914 	FdwFlags   DWORD
  35915 }
  35916 
  35917 type USEROBJECTFLAGS = tagUSEROBJECTFLAGS
  35918 type PUSEROBJECTFLAGS = uintptr
  35919 
  35920 type tagWNDCLASSEXA = struct {
  35921 	FcbSize        UINT
  35922 	Fstyle         UINT
  35923 	FlpfnWndProc   WNDPROC
  35924 	FcbClsExtra    int32
  35925 	FcbWndExtra    int32
  35926 	FhInstance     HINSTANCE
  35927 	FhIcon         HICON
  35928 	FhCursor       HCURSOR
  35929 	FhbrBackground HBRUSH
  35930 	FlpszMenuName  LPCSTR
  35931 	FlpszClassName LPCSTR
  35932 	FhIconSm       HICON
  35933 }
  35934 
  35935 type WNDCLASSEXA = tagWNDCLASSEXA
  35936 type PWNDCLASSEXA = uintptr
  35937 type NPWNDCLASSEXA = uintptr
  35938 type LPWNDCLASSEXA = uintptr
  35939 
  35940 type tagWNDCLASSEXW = struct {
  35941 	FcbSize        UINT
  35942 	Fstyle         UINT
  35943 	FlpfnWndProc   WNDPROC
  35944 	FcbClsExtra    int32
  35945 	FcbWndExtra    int32
  35946 	FhInstance     HINSTANCE
  35947 	FhIcon         HICON
  35948 	FhCursor       HCURSOR
  35949 	FhbrBackground HBRUSH
  35950 	FlpszMenuName  LPCWSTR
  35951 	FlpszClassName LPCWSTR
  35952 	FhIconSm       HICON
  35953 }
  35954 
  35955 type WNDCLASSEXW = tagWNDCLASSEXW
  35956 type PWNDCLASSEXW = uintptr
  35957 type NPWNDCLASSEXW = uintptr
  35958 type LPWNDCLASSEXW = uintptr
  35959 
  35960 type WNDCLASSEX = WNDCLASSEXA
  35961 type PWNDCLASSEX = PWNDCLASSEXA
  35962 type NPWNDCLASSEX = NPWNDCLASSEXA
  35963 type LPWNDCLASSEX = LPWNDCLASSEXA
  35964 
  35965 type tagWNDCLASSA = struct {
  35966 	Fstyle         UINT
  35967 	F__ccgo_pad1   [4]byte
  35968 	FlpfnWndProc   WNDPROC
  35969 	FcbClsExtra    int32
  35970 	FcbWndExtra    int32
  35971 	FhInstance     HINSTANCE
  35972 	FhIcon         HICON
  35973 	FhCursor       HCURSOR
  35974 	FhbrBackground HBRUSH
  35975 	FlpszMenuName  LPCSTR
  35976 	FlpszClassName LPCSTR
  35977 }
  35978 
  35979 type WNDCLASSA = tagWNDCLASSA
  35980 type PWNDCLASSA = uintptr
  35981 type NPWNDCLASSA = uintptr
  35982 type LPWNDCLASSA = uintptr
  35983 
  35984 type tagWNDCLASSW = struct {
  35985 	Fstyle         UINT
  35986 	F__ccgo_pad1   [4]byte
  35987 	FlpfnWndProc   WNDPROC
  35988 	FcbClsExtra    int32
  35989 	FcbWndExtra    int32
  35990 	FhInstance     HINSTANCE
  35991 	FhIcon         HICON
  35992 	FhCursor       HCURSOR
  35993 	FhbrBackground HBRUSH
  35994 	FlpszMenuName  LPCWSTR
  35995 	FlpszClassName LPCWSTR
  35996 }
  35997 
  35998 type WNDCLASSW = tagWNDCLASSW
  35999 type PWNDCLASSW = uintptr
  36000 type NPWNDCLASSW = uintptr
  36001 type LPWNDCLASSW = uintptr
  36002 
  36003 type WNDCLASS = WNDCLASSA
  36004 type PWNDCLASS = PWNDCLASSA
  36005 type NPWNDCLASS = NPWNDCLASSA
  36006 type LPWNDCLASS = LPWNDCLASSA
  36007 
  36008 type tagMSG = struct {
  36009 	Fhwnd        HWND
  36010 	Fmessage     UINT
  36011 	F__ccgo_pad1 [4]byte
  36012 	FwParam      WPARAM
  36013 	FlParam      LPARAM
  36014 	Ftime        DWORD
  36015 	Fpt          POINT
  36016 	F__ccgo_pad2 [4]byte
  36017 }
  36018 
  36019 type MSG = tagMSG
  36020 type PMSG = uintptr
  36021 type NPMSG = uintptr
  36022 type LPMSG = uintptr
  36023 
  36024 type tagMINMAXINFO = struct {
  36025 	FptReserved     POINT
  36026 	FptMaxSize      POINT
  36027 	FptMaxPosition  POINT
  36028 	FptMinTrackSize POINT
  36029 	FptMaxTrackSize POINT
  36030 }
  36031 
  36032 type MINMAXINFO = tagMINMAXINFO
  36033 type PMINMAXINFO = uintptr
  36034 type LPMINMAXINFO = uintptr
  36035 
  36036 type tagCOPYDATASTRUCT = struct {
  36037 	FdwData      ULONG_PTR
  36038 	FcbData      DWORD
  36039 	F__ccgo_pad1 [4]byte
  36040 	FlpData      PVOID
  36041 }
  36042 
  36043 type COPYDATASTRUCT = tagCOPYDATASTRUCT
  36044 type PCOPYDATASTRUCT = uintptr
  36045 
  36046 type tagMDINEXTMENU = struct {
  36047 	FhmenuIn   HMENU
  36048 	FhmenuNext HMENU
  36049 	FhwndNext  HWND
  36050 }
  36051 
  36052 type MDINEXTMENU = tagMDINEXTMENU
  36053 type PMDINEXTMENU = uintptr
  36054 type LPMDINEXTMENU = uintptr
  36055 
  36056 type POWERBROADCAST_SETTING = struct {
  36057 	FPowerSetting GUID
  36058 	FDataLength   DWORD
  36059 	FData         [1]UCHAR
  36060 	F__ccgo_pad1  [3]byte
  36061 }
  36062 type PPOWERBROADCAST_SETTING = uintptr
  36063 
  36064 type tagWINDOWPOS = struct {
  36065 	Fhwnd            HWND
  36066 	FhwndInsertAfter HWND
  36067 	Fx               int32
  36068 	Fy               int32
  36069 	Fcx              int32
  36070 	Fcy              int32
  36071 	Fflags           UINT
  36072 	F__ccgo_pad1     [4]byte
  36073 }
  36074 
  36075 type WINDOWPOS = tagWINDOWPOS
  36076 type LPWINDOWPOS = uintptr
  36077 type PWINDOWPOS = uintptr
  36078 
  36079 type tagNCCALCSIZE_PARAMS = struct {
  36080 	Frgrc  [3]RECT
  36081 	Flppos PWINDOWPOS
  36082 }
  36083 
  36084 type NCCALCSIZE_PARAMS = tagNCCALCSIZE_PARAMS
  36085 type LPNCCALCSIZE_PARAMS = uintptr
  36086 
  36087 type tagTRACKMOUSEEVENT = struct {
  36088 	FcbSize      DWORD
  36089 	FdwFlags     DWORD
  36090 	FhwndTrack   HWND
  36091 	FdwHoverTime DWORD
  36092 	F__ccgo_pad1 [4]byte
  36093 }
  36094 
  36095 type TRACKMOUSEEVENT = tagTRACKMOUSEEVENT
  36096 type LPTRACKMOUSEEVENT = uintptr
  36097 
  36098 type tagACCEL = struct {
  36099 	FfVirt       BYTE
  36100 	F__ccgo_pad1 [1]byte
  36101 	Fkey         WORD
  36102 	Fcmd         WORD
  36103 }
  36104 
  36105 type ACCEL = tagACCEL
  36106 type LPACCEL = uintptr
  36107 
  36108 type tagPAINTSTRUCT = struct {
  36109 	Fhdc         HDC
  36110 	FfErase      WINBOOL
  36111 	FrcPaint     RECT
  36112 	FfRestore    WINBOOL
  36113 	FfIncUpdate  WINBOOL
  36114 	FrgbReserved [32]BYTE
  36115 	F__ccgo_pad1 [4]byte
  36116 }
  36117 
  36118 type PAINTSTRUCT = tagPAINTSTRUCT
  36119 type PPAINTSTRUCT = uintptr
  36120 type NPPAINTSTRUCT = uintptr
  36121 type LPPAINTSTRUCT = uintptr
  36122 
  36123 type CREATESTRUCTA = tagCREATESTRUCTA
  36124 type LPCREATESTRUCTA = uintptr
  36125 
  36126 type CREATESTRUCTW = tagCREATESTRUCTW
  36127 type LPCREATESTRUCTW = uintptr
  36128 
  36129 type CREATESTRUCT = CREATESTRUCTA
  36130 type LPCREATESTRUCT = LPCREATESTRUCTA
  36131 
  36132 type tagWINDOWPLACEMENT = struct {
  36133 	Flength           UINT
  36134 	Fflags            UINT
  36135 	FshowCmd          UINT
  36136 	FptMinPosition    POINT
  36137 	FptMaxPosition    POINT
  36138 	FrcNormalPosition RECT
  36139 }
  36140 
  36141 type WINDOWPLACEMENT = tagWINDOWPLACEMENT
  36142 type PWINDOWPLACEMENT = uintptr
  36143 type LPWINDOWPLACEMENT = uintptr
  36144 
  36145 type tagNMHDR = struct {
  36146 	FhwndFrom    HWND
  36147 	FidFrom      UINT_PTR
  36148 	Fcode        UINT
  36149 	F__ccgo_pad1 [4]byte
  36150 }
  36151 
  36152 type NMHDR = tagNMHDR
  36153 
  36154 type LPNMHDR = uintptr
  36155 
  36156 type tagSTYLESTRUCT = struct {
  36157 	FstyleOld DWORD
  36158 	FstyleNew DWORD
  36159 }
  36160 
  36161 type STYLESTRUCT = tagSTYLESTRUCT
  36162 type LPSTYLESTRUCT = uintptr
  36163 
  36164 type tagMEASUREITEMSTRUCT = struct {
  36165 	FCtlType     UINT
  36166 	FCtlID       UINT
  36167 	FitemID      UINT
  36168 	FitemWidth   UINT
  36169 	FitemHeight  UINT
  36170 	F__ccgo_pad1 [4]byte
  36171 	FitemData    ULONG_PTR
  36172 }
  36173 
  36174 type MEASUREITEMSTRUCT = tagMEASUREITEMSTRUCT
  36175 type PMEASUREITEMSTRUCT = uintptr
  36176 type LPMEASUREITEMSTRUCT = uintptr
  36177 
  36178 type tagDRAWITEMSTRUCT = struct {
  36179 	FCtlType     UINT
  36180 	FCtlID       UINT
  36181 	FitemID      UINT
  36182 	FitemAction  UINT
  36183 	FitemState   UINT
  36184 	F__ccgo_pad1 [4]byte
  36185 	FhwndItem    HWND
  36186 	FhDC         HDC
  36187 	FrcItem      RECT
  36188 	FitemData    ULONG_PTR
  36189 }
  36190 
  36191 type DRAWITEMSTRUCT = tagDRAWITEMSTRUCT
  36192 type PDRAWITEMSTRUCT = uintptr
  36193 type LPDRAWITEMSTRUCT = uintptr
  36194 
  36195 type tagDELETEITEMSTRUCT = struct {
  36196 	FCtlType     UINT
  36197 	FCtlID       UINT
  36198 	FitemID      UINT
  36199 	F__ccgo_pad1 [4]byte
  36200 	FhwndItem    HWND
  36201 	FitemData    ULONG_PTR
  36202 }
  36203 
  36204 type DELETEITEMSTRUCT = tagDELETEITEMSTRUCT
  36205 type PDELETEITEMSTRUCT = uintptr
  36206 type LPDELETEITEMSTRUCT = uintptr
  36207 
  36208 type tagCOMPAREITEMSTRUCT = struct {
  36209 	FCtlType     UINT
  36210 	FCtlID       UINT
  36211 	FhwndItem    HWND
  36212 	FitemID1     UINT
  36213 	F__ccgo_pad1 [4]byte
  36214 	FitemData1   ULONG_PTR
  36215 	FitemID2     UINT
  36216 	F__ccgo_pad2 [4]byte
  36217 	FitemData2   ULONG_PTR
  36218 	FdwLocaleId  DWORD
  36219 	F__ccgo_pad3 [4]byte
  36220 }
  36221 
  36222 type COMPAREITEMSTRUCT = tagCOMPAREITEMSTRUCT
  36223 type PCOMPAREITEMSTRUCT = uintptr
  36224 type LPCOMPAREITEMSTRUCT = uintptr
  36225 
  36226 type BSMINFO = struct {
  36227 	FcbSize      UINT
  36228 	F__ccgo_pad1 [4]byte
  36229 	Fhdesk       HDESK
  36230 	Fhwnd        HWND
  36231 	Fluid        LUID
  36232 }
  36233 type PBSMINFO = uintptr
  36234 
  36235 type HDEVNOTIFY = PVOID
  36236 type PHDEVNOTIFY = uintptr
  36237 
  36238 type HPOWERNOTIFY = HANDLE
  36239 type PHPOWERNOTIFY = uintptr
  36240 
  36241 type PREGISTERCLASSNAMEW = uintptr
  36242 
  36243 type tagUPDATELAYEREDWINDOWINFO = struct {
  36244 	FcbSize      DWORD
  36245 	F__ccgo_pad1 [4]byte
  36246 	FhdcDst      HDC
  36247 	FpptDst      uintptr
  36248 	Fpsize       uintptr
  36249 	FhdcSrc      HDC
  36250 	FpptSrc      uintptr
  36251 	FcrKey       COLORREF
  36252 	F__ccgo_pad2 [4]byte
  36253 	Fpblend      uintptr
  36254 	FdwFlags     DWORD
  36255 	F__ccgo_pad3 [4]byte
  36256 	FprcDirty    uintptr
  36257 }
  36258 
  36259 type UPDATELAYEREDWINDOWINFO = tagUPDATELAYEREDWINDOWINFO
  36260 type PUPDATELAYEREDWINDOWINFO = uintptr
  36261 
  36262 type FLASHWINFO = struct {
  36263 	FcbSize      UINT
  36264 	F__ccgo_pad1 [4]byte
  36265 	Fhwnd        HWND
  36266 	FdwFlags     DWORD
  36267 	FuCount      UINT
  36268 	FdwTimeout   DWORD
  36269 	F__ccgo_pad2 [4]byte
  36270 }
  36271 type PFLASHWINFO = uintptr
  36272 
  36273 type DLGTEMPLATE = struct {
  36274 	Fstyle           DWORD
  36275 	FdwExtendedStyle DWORD
  36276 	Fcdit            WORD
  36277 	Fx               int16
  36278 	Fy               int16
  36279 	Fcx              int16
  36280 	Fcy              int16
  36281 	F__ccgo_pad1     [2]byte
  36282 }
  36283 
  36284 type LPDLGTEMPLATEA = uintptr
  36285 type LPDLGTEMPLATEW = uintptr
  36286 
  36287 type LPDLGTEMPLATE = LPDLGTEMPLATEA
  36288 
  36289 type LPCDLGTEMPLATEA = uintptr
  36290 type LPCDLGTEMPLATEW = uintptr
  36291 
  36292 type LPCDLGTEMPLATE = LPCDLGTEMPLATEA
  36293 
  36294 type DLGITEMTEMPLATE = struct {
  36295 	Fstyle           DWORD
  36296 	FdwExtendedStyle DWORD
  36297 	Fx               int16
  36298 	Fy               int16
  36299 	Fcx              int16
  36300 	Fcy              int16
  36301 	Fid              WORD
  36302 	F__ccgo_pad1     [2]byte
  36303 }
  36304 
  36305 type PDLGITEMTEMPLATEA = uintptr
  36306 type PDLGITEMTEMPLATEW = uintptr
  36307 
  36308 type PDLGITEMTEMPLATE = PDLGITEMTEMPLATEA
  36309 
  36310 type LPDLGITEMTEMPLATEA = uintptr
  36311 type LPDLGITEMTEMPLATEW = uintptr
  36312 
  36313 type LPDLGITEMTEMPLATE = LPDLGITEMTEMPLATEA
  36314 
  36315 type DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS = uint32
  36316 
  36317 type DIALOG_DPI_CHANGE_BEHAVIORS = uint32
  36318 
  36319 type tagMOUSEINPUT = struct {
  36320 	Fdx          LONG
  36321 	Fdy          LONG
  36322 	FmouseData   DWORD
  36323 	FdwFlags     DWORD
  36324 	Ftime        DWORD
  36325 	F__ccgo_pad1 [4]byte
  36326 	FdwExtraInfo ULONG_PTR
  36327 }
  36328 
  36329 type MOUSEINPUT = tagMOUSEINPUT
  36330 type PMOUSEINPUT = uintptr
  36331 type LPMOUSEINPUT = uintptr
  36332 
  36333 type tagKEYBDINPUT = struct {
  36334 	FwVk         WORD
  36335 	FwScan       WORD
  36336 	FdwFlags     DWORD
  36337 	Ftime        DWORD
  36338 	F__ccgo_pad1 [4]byte
  36339 	FdwExtraInfo ULONG_PTR
  36340 }
  36341 
  36342 type KEYBDINPUT = tagKEYBDINPUT
  36343 type PKEYBDINPUT = uintptr
  36344 type LPKEYBDINPUT = uintptr
  36345 
  36346 type tagHARDWAREINPUT = struct {
  36347 	FuMsg    DWORD
  36348 	FwParamL WORD
  36349 	FwParamH WORD
  36350 }
  36351 
  36352 type HARDWAREINPUT = tagHARDWAREINPUT
  36353 type PHARDWAREINPUT = uintptr
  36354 type LPHARDWAREINPUT = uintptr
  36355 
  36356 type tagINPUT = struct {
  36357 	Ftype        DWORD
  36358 	F__ccgo_pad1 [4]byte
  36359 	Fu           struct{ Fmi MOUSEINPUT }
  36360 }
  36361 
  36362 type INPUT = tagINPUT
  36363 type PINPUT = uintptr
  36364 type LPINPUT = uintptr
  36365 
  36366 type tagLASTINPUTINFO = struct {
  36367 	FcbSize UINT
  36368 	FdwTime DWORD
  36369 }
  36370 
  36371 type LASTINPUTINFO = tagLASTINPUTINFO
  36372 type PLASTINPUTINFO = uintptr
  36373 
  36374 type tagTPMPARAMS = struct {
  36375 	FcbSize    UINT
  36376 	FrcExclude RECT
  36377 }
  36378 
  36379 type TPMPARAMS = tagTPMPARAMS
  36380 
  36381 type tagMENUINFO = struct {
  36382 	FcbSize          DWORD
  36383 	FfMask           DWORD
  36384 	FdwStyle         DWORD
  36385 	FcyMax           UINT
  36386 	FhbrBack         HBRUSH
  36387 	FdwContextHelpID DWORD
  36388 	F__ccgo_pad1     [4]byte
  36389 	FdwMenuData      ULONG_PTR
  36390 }
  36391 
  36392 type MENUINFO = tagMENUINFO
  36393 type LPMENUINFO = uintptr
  36394 
  36395 type LPTPMPARAMS = uintptr
  36396 type LPCMENUINFO = uintptr
  36397 
  36398 type tagMENUGETOBJECTINFO = struct {
  36399 	FdwFlags DWORD
  36400 	FuPos    UINT
  36401 	Fhmenu   HMENU
  36402 	Friid    PVOID
  36403 	FpvObj   PVOID
  36404 }
  36405 
  36406 type MENUGETOBJECTINFO = tagMENUGETOBJECTINFO
  36407 type PMENUGETOBJECTINFO = uintptr
  36408 
  36409 type tagMENUITEMINFOA = struct {
  36410 	FcbSize        UINT
  36411 	FfMask         UINT
  36412 	FfType         UINT
  36413 	FfState        UINT
  36414 	FwID           UINT
  36415 	F__ccgo_pad1   [4]byte
  36416 	FhSubMenu      HMENU
  36417 	FhbmpChecked   HBITMAP
  36418 	FhbmpUnchecked HBITMAP
  36419 	FdwItemData    ULONG_PTR
  36420 	FdwTypeData    LPSTR
  36421 	Fcch           UINT
  36422 	F__ccgo_pad2   [4]byte
  36423 	FhbmpItem      HBITMAP
  36424 }
  36425 
  36426 type MENUITEMINFOA = tagMENUITEMINFOA
  36427 type LPMENUITEMINFOA = uintptr
  36428 
  36429 type tagMENUITEMINFOW = struct {
  36430 	FcbSize        UINT
  36431 	FfMask         UINT
  36432 	FfType         UINT
  36433 	FfState        UINT
  36434 	FwID           UINT
  36435 	F__ccgo_pad1   [4]byte
  36436 	FhSubMenu      HMENU
  36437 	FhbmpChecked   HBITMAP
  36438 	FhbmpUnchecked HBITMAP
  36439 	FdwItemData    ULONG_PTR
  36440 	FdwTypeData    LPWSTR
  36441 	Fcch           UINT
  36442 	F__ccgo_pad2   [4]byte
  36443 	FhbmpItem      HBITMAP
  36444 }
  36445 
  36446 type MENUITEMINFOW = tagMENUITEMINFOW
  36447 type LPMENUITEMINFOW = uintptr
  36448 
  36449 type MENUITEMINFO = MENUITEMINFOA
  36450 type LPMENUITEMINFO = LPMENUITEMINFOA
  36451 
  36452 type LPCMENUITEMINFOA = uintptr
  36453 type LPCMENUITEMINFOW = uintptr
  36454 
  36455 type LPCMENUITEMINFO = LPCMENUITEMINFOA
  36456 
  36457 type tagDROPSTRUCT = struct {
  36458 	FhwndSource    HWND
  36459 	FhwndSink      HWND
  36460 	FwFmt          DWORD
  36461 	F__ccgo_pad1   [4]byte
  36462 	FdwData        ULONG_PTR
  36463 	FptDrop        POINT
  36464 	FdwControlData DWORD
  36465 	F__ccgo_pad2   [4]byte
  36466 }
  36467 
  36468 type DROPSTRUCT = tagDROPSTRUCT
  36469 type PDROPSTRUCT = uintptr
  36470 type LPDROPSTRUCT = uintptr
  36471 
  36472 type tagDRAWTEXTPARAMS = struct {
  36473 	FcbSize        UINT
  36474 	FiTabLength    int32
  36475 	FiLeftMargin   int32
  36476 	FiRightMargin  int32
  36477 	FuiLengthDrawn UINT
  36478 }
  36479 
  36480 type DRAWTEXTPARAMS = tagDRAWTEXTPARAMS
  36481 type LPDRAWTEXTPARAMS = uintptr
  36482 
  36483 type tagHELPINFO = struct {
  36484 	FcbSize       UINT
  36485 	FiContextType int32
  36486 	FiCtrlId      int32
  36487 	F__ccgo_pad1  [4]byte
  36488 	FhItemHandle  HANDLE
  36489 	FdwContextId  DWORD_PTR
  36490 	FMousePos     POINT
  36491 }
  36492 
  36493 type HELPINFO = tagHELPINFO
  36494 type LPHELPINFO = uintptr
  36495 
  36496 type MSGBOXCALLBACK = uintptr
  36497 
  36498 type tagMSGBOXPARAMSA = struct {
  36499 	FcbSize             UINT
  36500 	F__ccgo_pad1        [4]byte
  36501 	FhwndOwner          HWND
  36502 	FhInstance          HINSTANCE
  36503 	FlpszText           LPCSTR
  36504 	FlpszCaption        LPCSTR
  36505 	FdwStyle            DWORD
  36506 	F__ccgo_pad2        [4]byte
  36507 	FlpszIcon           LPCSTR
  36508 	FdwContextHelpId    DWORD_PTR
  36509 	FlpfnMsgBoxCallback MSGBOXCALLBACK
  36510 	FdwLanguageId       DWORD
  36511 	F__ccgo_pad3        [4]byte
  36512 }
  36513 
  36514 type MSGBOXPARAMSA = tagMSGBOXPARAMSA
  36515 type PMSGBOXPARAMSA = uintptr
  36516 type LPMSGBOXPARAMSA = uintptr
  36517 
  36518 type tagMSGBOXPARAMSW = struct {
  36519 	FcbSize             UINT
  36520 	F__ccgo_pad1        [4]byte
  36521 	FhwndOwner          HWND
  36522 	FhInstance          HINSTANCE
  36523 	FlpszText           LPCWSTR
  36524 	FlpszCaption        LPCWSTR
  36525 	FdwStyle            DWORD
  36526 	F__ccgo_pad2        [4]byte
  36527 	FlpszIcon           LPCWSTR
  36528 	FdwContextHelpId    DWORD_PTR
  36529 	FlpfnMsgBoxCallback MSGBOXCALLBACK
  36530 	FdwLanguageId       DWORD
  36531 	F__ccgo_pad3        [4]byte
  36532 }
  36533 
  36534 type MSGBOXPARAMSW = tagMSGBOXPARAMSW
  36535 type PMSGBOXPARAMSW = uintptr
  36536 type LPMSGBOXPARAMSW = uintptr
  36537 
  36538 type MSGBOXPARAMS = MSGBOXPARAMSA
  36539 type PMSGBOXPARAMS = PMSGBOXPARAMSA
  36540 type LPMSGBOXPARAMS = LPMSGBOXPARAMSA
  36541 
  36542 type MENUITEMTEMPLATEHEADER = struct {
  36543 	FversionNumber WORD
  36544 	Foffset        WORD
  36545 }
  36546 type PMENUITEMTEMPLATEHEADER = uintptr
  36547 
  36548 type MENUITEMTEMPLATE = struct {
  36549 	FmtOption WORD
  36550 	FmtID     WORD
  36551 	FmtString [1]WCHAR
  36552 }
  36553 type PMENUITEMTEMPLATE = uintptr
  36554 
  36555 type _ICONINFO = struct {
  36556 	FfIcon       WINBOOL
  36557 	FxHotspot    DWORD
  36558 	FyHotspot    DWORD
  36559 	F__ccgo_pad1 [4]byte
  36560 	FhbmMask     HBITMAP
  36561 	FhbmColor    HBITMAP
  36562 }
  36563 
  36564 type ICONINFO = _ICONINFO
  36565 type PICONINFO = uintptr
  36566 
  36567 type tagCURSORSHAPE = struct {
  36568 	FxHotSpot    int32
  36569 	FyHotSpot    int32
  36570 	Fcx          int32
  36571 	Fcy          int32
  36572 	FcbWidth     int32
  36573 	FPlanes      BYTE
  36574 	FBitsPixel   BYTE
  36575 	F__ccgo_pad1 [2]byte
  36576 }
  36577 
  36578 type CURSORSHAPE = tagCURSORSHAPE
  36579 type LPCURSORSHAPE = uintptr
  36580 
  36581 type tagSCROLLINFO = struct {
  36582 	FcbSize    UINT
  36583 	FfMask     UINT
  36584 	FnMin      int32
  36585 	FnMax      int32
  36586 	FnPage     UINT
  36587 	FnPos      int32
  36588 	FnTrackPos int32
  36589 }
  36590 
  36591 type SCROLLINFO = tagSCROLLINFO
  36592 type LPSCROLLINFO = uintptr
  36593 type LPCSCROLLINFO = uintptr
  36594 
  36595 type tagMDICREATESTRUCTA = struct {
  36596 	FszClass     LPCSTR
  36597 	FszTitle     LPCSTR
  36598 	FhOwner      HANDLE
  36599 	Fx           int32
  36600 	Fy           int32
  36601 	Fcx          int32
  36602 	Fcy          int32
  36603 	Fstyle       DWORD
  36604 	F__ccgo_pad1 [4]byte
  36605 	FlParam      LPARAM
  36606 }
  36607 
  36608 type MDICREATESTRUCTA = tagMDICREATESTRUCTA
  36609 type LPMDICREATESTRUCTA = uintptr
  36610 
  36611 type tagMDICREATESTRUCTW = struct {
  36612 	FszClass     LPCWSTR
  36613 	FszTitle     LPCWSTR
  36614 	FhOwner      HANDLE
  36615 	Fx           int32
  36616 	Fy           int32
  36617 	Fcx          int32
  36618 	Fcy          int32
  36619 	Fstyle       DWORD
  36620 	F__ccgo_pad1 [4]byte
  36621 	FlParam      LPARAM
  36622 }
  36623 
  36624 type MDICREATESTRUCTW = tagMDICREATESTRUCTW
  36625 type LPMDICREATESTRUCTW = uintptr
  36626 
  36627 type MDICREATESTRUCT = MDICREATESTRUCTA
  36628 type LPMDICREATESTRUCT = LPMDICREATESTRUCTA
  36629 
  36630 type tagCLIENTCREATESTRUCT = struct {
  36631 	FhWindowMenu  HANDLE
  36632 	FidFirstChild UINT
  36633 	F__ccgo_pad1  [4]byte
  36634 }
  36635 
  36636 type CLIENTCREATESTRUCT = tagCLIENTCREATESTRUCT
  36637 type LPCLIENTCREATESTRUCT = uintptr
  36638 
  36639 type HELPPOLY = DWORD
  36640 
  36641 type tagMULTIKEYHELPA = struct {
  36642 	FmkSize      DWORD
  36643 	FmkKeylist   CHAR
  36644 	FszKeyphrase [1]CHAR
  36645 	F__ccgo_pad1 [2]byte
  36646 }
  36647 
  36648 type MULTIKEYHELPA = tagMULTIKEYHELPA
  36649 type PMULTIKEYHELPA = uintptr
  36650 type LPMULTIKEYHELPA = uintptr
  36651 
  36652 type tagMULTIKEYHELPW = struct {
  36653 	FmkSize      DWORD
  36654 	FmkKeylist   WCHAR
  36655 	FszKeyphrase [1]WCHAR
  36656 }
  36657 
  36658 type MULTIKEYHELPW = tagMULTIKEYHELPW
  36659 type PMULTIKEYHELPW = uintptr
  36660 type LPMULTIKEYHELPW = uintptr
  36661 
  36662 type MULTIKEYHELP = MULTIKEYHELPA
  36663 type PMULTIKEYHELP = PMULTIKEYHELPA
  36664 type LPMULTIKEYHELP = LPMULTIKEYHELPA
  36665 
  36666 type tagHELPWININFOA = struct {
  36667 	FwStructSize int32
  36668 	Fx           int32
  36669 	Fy           int32
  36670 	Fdx          int32
  36671 	Fdy          int32
  36672 	FwMax        int32
  36673 	FrgchMember  [2]CHAR
  36674 	F__ccgo_pad1 [2]byte
  36675 }
  36676 
  36677 type HELPWININFOA = tagHELPWININFOA
  36678 type PHELPWININFOA = uintptr
  36679 type LPHELPWININFOA = uintptr
  36680 
  36681 type tagHELPWININFOW = struct {
  36682 	FwStructSize int32
  36683 	Fx           int32
  36684 	Fy           int32
  36685 	Fdx          int32
  36686 	Fdy          int32
  36687 	FwMax        int32
  36688 	FrgchMember  [2]WCHAR
  36689 }
  36690 
  36691 type HELPWININFOW = tagHELPWININFOW
  36692 type PHELPWININFOW = uintptr
  36693 type LPHELPWININFOW = uintptr
  36694 
  36695 type HELPWININFO = HELPWININFOA
  36696 type PHELPWININFO = PHELPWININFOA
  36697 type LPHELPWININFO = LPHELPWININFOA
  36698 
  36699 type tagNONCLIENTMETRICSA = struct {
  36700 	FcbSize           UINT
  36701 	FiBorderWidth     int32
  36702 	FiScrollWidth     int32
  36703 	FiScrollHeight    int32
  36704 	FiCaptionWidth    int32
  36705 	FiCaptionHeight   int32
  36706 	FlfCaptionFont    LOGFONTA
  36707 	FiSmCaptionWidth  int32
  36708 	FiSmCaptionHeight int32
  36709 	FlfSmCaptionFont  LOGFONTA
  36710 	FiMenuWidth       int32
  36711 	FiMenuHeight      int32
  36712 	FlfMenuFont       LOGFONTA
  36713 	FlfStatusFont     LOGFONTA
  36714 	FlfMessageFont    LOGFONTA
  36715 }
  36716 
  36717 type NONCLIENTMETRICSA = tagNONCLIENTMETRICSA
  36718 type PNONCLIENTMETRICSA = uintptr
  36719 type LPNONCLIENTMETRICSA = uintptr
  36720 
  36721 type tagNONCLIENTMETRICSW = struct {
  36722 	FcbSize           UINT
  36723 	FiBorderWidth     int32
  36724 	FiScrollWidth     int32
  36725 	FiScrollHeight    int32
  36726 	FiCaptionWidth    int32
  36727 	FiCaptionHeight   int32
  36728 	FlfCaptionFont    LOGFONTW
  36729 	FiSmCaptionWidth  int32
  36730 	FiSmCaptionHeight int32
  36731 	FlfSmCaptionFont  LOGFONTW
  36732 	FiMenuWidth       int32
  36733 	FiMenuHeight      int32
  36734 	FlfMenuFont       LOGFONTW
  36735 	FlfStatusFont     LOGFONTW
  36736 	FlfMessageFont    LOGFONTW
  36737 }
  36738 
  36739 type NONCLIENTMETRICSW = tagNONCLIENTMETRICSW
  36740 type PNONCLIENTMETRICSW = uintptr
  36741 type LPNONCLIENTMETRICSW = uintptr
  36742 
  36743 type NONCLIENTMETRICS = NONCLIENTMETRICSA
  36744 type PNONCLIENTMETRICS = PNONCLIENTMETRICSA
  36745 type LPNONCLIENTMETRICS = LPNONCLIENTMETRICSA
  36746 
  36747 type tagMINIMIZEDMETRICS = struct {
  36748 	FcbSize   UINT
  36749 	FiWidth   int32
  36750 	FiHorzGap int32
  36751 	FiVertGap int32
  36752 	FiArrange int32
  36753 }
  36754 
  36755 type MINIMIZEDMETRICS = tagMINIMIZEDMETRICS
  36756 type PMINIMIZEDMETRICS = uintptr
  36757 type LPMINIMIZEDMETRICS = uintptr
  36758 
  36759 type tagICONMETRICSA = struct {
  36760 	FcbSize       UINT
  36761 	FiHorzSpacing int32
  36762 	FiVertSpacing int32
  36763 	FiTitleWrap   int32
  36764 	FlfFont       LOGFONTA
  36765 }
  36766 
  36767 type ICONMETRICSA = tagICONMETRICSA
  36768 type PICONMETRICSA = uintptr
  36769 type LPICONMETRICSA = uintptr
  36770 
  36771 type tagICONMETRICSW = struct {
  36772 	FcbSize       UINT
  36773 	FiHorzSpacing int32
  36774 	FiVertSpacing int32
  36775 	FiTitleWrap   int32
  36776 	FlfFont       LOGFONTW
  36777 }
  36778 
  36779 type ICONMETRICSW = tagICONMETRICSW
  36780 type PICONMETRICSW = uintptr
  36781 type LPICONMETRICSW = uintptr
  36782 
  36783 type ICONMETRICS = ICONMETRICSA
  36784 type PICONMETRICS = PICONMETRICSA
  36785 type LPICONMETRICS = LPICONMETRICSA
  36786 
  36787 type tagANIMATIONINFO = struct {
  36788 	FcbSize      UINT
  36789 	FiMinAnimate int32
  36790 }
  36791 
  36792 type ANIMATIONINFO = tagANIMATIONINFO
  36793 type LPANIMATIONINFO = uintptr
  36794 
  36795 type tagSERIALKEYSA = struct {
  36796 	FcbSize         UINT
  36797 	FdwFlags        DWORD
  36798 	FlpszActivePort LPSTR
  36799 	FlpszPort       LPSTR
  36800 	FiBaudRate      UINT
  36801 	FiPortState     UINT
  36802 	FiActive        UINT
  36803 	F__ccgo_pad1    [4]byte
  36804 }
  36805 
  36806 type SERIALKEYSA = tagSERIALKEYSA
  36807 type LPSERIALKEYSA = uintptr
  36808 
  36809 type tagSERIALKEYSW = struct {
  36810 	FcbSize         UINT
  36811 	FdwFlags        DWORD
  36812 	FlpszActivePort LPWSTR
  36813 	FlpszPort       LPWSTR
  36814 	FiBaudRate      UINT
  36815 	FiPortState     UINT
  36816 	FiActive        UINT
  36817 	F__ccgo_pad1    [4]byte
  36818 }
  36819 
  36820 type SERIALKEYSW = tagSERIALKEYSW
  36821 type LPSERIALKEYSW = uintptr
  36822 
  36823 type SERIALKEYS = SERIALKEYSA
  36824 type LPSERIALKEYS = LPSERIALKEYSA
  36825 
  36826 type tagHIGHCONTRASTA = struct {
  36827 	FcbSize            UINT
  36828 	FdwFlags           DWORD
  36829 	FlpszDefaultScheme LPSTR
  36830 }
  36831 
  36832 type HIGHCONTRASTA = tagHIGHCONTRASTA
  36833 type LPHIGHCONTRASTA = uintptr
  36834 
  36835 type tagHIGHCONTRASTW = struct {
  36836 	FcbSize            UINT
  36837 	FdwFlags           DWORD
  36838 	FlpszDefaultScheme LPWSTR
  36839 }
  36840 
  36841 type HIGHCONTRASTW = tagHIGHCONTRASTW
  36842 type LPHIGHCONTRASTW = uintptr
  36843 
  36844 type HIGHCONTRAST = HIGHCONTRASTA
  36845 type LPHIGHCONTRAST = LPHIGHCONTRASTA
  36846 
  36847 type _VIDEOPARAMETERS = struct {
  36848 	FGuid                  GUID
  36849 	FdwOffset              ULONG
  36850 	FdwCommand             ULONG
  36851 	FdwFlags               ULONG
  36852 	FdwMode                ULONG
  36853 	FdwTVStandard          ULONG
  36854 	FdwAvailableModes      ULONG
  36855 	FdwAvailableTVStandard ULONG
  36856 	FdwFlickerFilter       ULONG
  36857 	FdwOverScanX           ULONG
  36858 	FdwOverScanY           ULONG
  36859 	FdwMaxUnscaledX        ULONG
  36860 	FdwMaxUnscaledY        ULONG
  36861 	FdwPositionX           ULONG
  36862 	FdwPositionY           ULONG
  36863 	FdwBrightness          ULONG
  36864 	FdwContrast            ULONG
  36865 	FdwCPType              ULONG
  36866 	FdwCPCommand           ULONG
  36867 	FdwCPStandard          ULONG
  36868 	FdwCPKey               ULONG
  36869 	FbCP_APSTriggerBits    ULONG
  36870 	FbOEMCopyProtection    [256]UCHAR
  36871 }
  36872 
  36873 type VIDEOPARAMETERS = _VIDEOPARAMETERS
  36874 type PVIDEOPARAMETERS = uintptr
  36875 type LPVIDEOPARAMETERS = uintptr
  36876 
  36877 type tagFILTERKEYS = struct {
  36878 	FcbSize      UINT
  36879 	FdwFlags     DWORD
  36880 	FiWaitMSec   DWORD
  36881 	FiDelayMSec  DWORD
  36882 	FiRepeatMSec DWORD
  36883 	FiBounceMSec DWORD
  36884 }
  36885 
  36886 type FILTERKEYS = tagFILTERKEYS
  36887 type LPFILTERKEYS = uintptr
  36888 
  36889 type tagSTICKYKEYS = struct {
  36890 	FcbSize  UINT
  36891 	FdwFlags DWORD
  36892 }
  36893 
  36894 type STICKYKEYS = tagSTICKYKEYS
  36895 type LPSTICKYKEYS = uintptr
  36896 
  36897 type tagMOUSEKEYS = struct {
  36898 	FcbSize          UINT
  36899 	FdwFlags         DWORD
  36900 	FiMaxSpeed       DWORD
  36901 	FiTimeToMaxSpeed DWORD
  36902 	FiCtrlSpeed      DWORD
  36903 	FdwReserved1     DWORD
  36904 	FdwReserved2     DWORD
  36905 }
  36906 
  36907 type MOUSEKEYS = tagMOUSEKEYS
  36908 type LPMOUSEKEYS = uintptr
  36909 
  36910 type tagACCESSTIMEOUT = struct {
  36911 	FcbSize       UINT
  36912 	FdwFlags      DWORD
  36913 	FiTimeOutMSec DWORD
  36914 }
  36915 
  36916 type ACCESSTIMEOUT = tagACCESSTIMEOUT
  36917 type LPACCESSTIMEOUT = uintptr
  36918 
  36919 type tagSOUNDSENTRYA = struct {
  36920 	FcbSize                 UINT
  36921 	FdwFlags                DWORD
  36922 	FiFSTextEffect          DWORD
  36923 	FiFSTextEffectMSec      DWORD
  36924 	FiFSTextEffectColorBits DWORD
  36925 	FiFSGrafEffect          DWORD
  36926 	FiFSGrafEffectMSec      DWORD
  36927 	FiFSGrafEffectColor     DWORD
  36928 	FiWindowsEffect         DWORD
  36929 	FiWindowsEffectMSec     DWORD
  36930 	FlpszWindowsEffectDLL   LPSTR
  36931 	FiWindowsEffectOrdinal  DWORD
  36932 	F__ccgo_pad1            [4]byte
  36933 }
  36934 
  36935 type SOUNDSENTRYA = tagSOUNDSENTRYA
  36936 type LPSOUNDSENTRYA = uintptr
  36937 
  36938 type tagSOUNDSENTRYW = struct {
  36939 	FcbSize                 UINT
  36940 	FdwFlags                DWORD
  36941 	FiFSTextEffect          DWORD
  36942 	FiFSTextEffectMSec      DWORD
  36943 	FiFSTextEffectColorBits DWORD
  36944 	FiFSGrafEffect          DWORD
  36945 	FiFSGrafEffectMSec      DWORD
  36946 	FiFSGrafEffectColor     DWORD
  36947 	FiWindowsEffect         DWORD
  36948 	FiWindowsEffectMSec     DWORD
  36949 	FlpszWindowsEffectDLL   LPWSTR
  36950 	FiWindowsEffectOrdinal  DWORD
  36951 	F__ccgo_pad1            [4]byte
  36952 }
  36953 
  36954 type SOUNDSENTRYW = tagSOUNDSENTRYW
  36955 type LPSOUNDSENTRYW = uintptr
  36956 
  36957 type SOUNDSENTRY = SOUNDSENTRYA
  36958 type LPSOUNDSENTRY = LPSOUNDSENTRYA
  36959 
  36960 type tagTOGGLEKEYS = struct {
  36961 	FcbSize  UINT
  36962 	FdwFlags DWORD
  36963 }
  36964 
  36965 type TOGGLEKEYS = tagTOGGLEKEYS
  36966 type LPTOGGLEKEYS = uintptr
  36967 
  36968 type tagMONITORINFO = struct {
  36969 	FcbSize    DWORD
  36970 	FrcMonitor RECT
  36971 	FrcWork    RECT
  36972 	FdwFlags   DWORD
  36973 }
  36974 
  36975 type MONITORINFO = tagMONITORINFO
  36976 type LPMONITORINFO = uintptr
  36977 
  36978 type tagMONITORINFOEXA = struct {
  36979 	F__0 struct {
  36980 		FcbSize    DWORD
  36981 		FrcMonitor RECT
  36982 		FrcWork    RECT
  36983 		FdwFlags   DWORD
  36984 	}
  36985 	FszDevice [32]CHAR
  36986 }
  36987 
  36988 type MONITORINFOEXA = tagMONITORINFOEXA
  36989 type LPMONITORINFOEXA = uintptr
  36990 
  36991 type tagMONITORINFOEXW = struct {
  36992 	F__0 struct {
  36993 		FcbSize    DWORD
  36994 		FrcMonitor RECT
  36995 		FrcWork    RECT
  36996 		FdwFlags   DWORD
  36997 	}
  36998 	FszDevice [32]WCHAR
  36999 }
  37000 
  37001 type MONITORINFOEXW = tagMONITORINFOEXW
  37002 type LPMONITORINFOEXW = uintptr
  37003 
  37004 type MONITORINFOEX = MONITORINFOEXA
  37005 type LPMONITORINFOEX = LPMONITORINFOEXA
  37006 
  37007 type MONITORENUMPROC = uintptr
  37008 
  37009 type WINEVENTPROC = uintptr
  37010 
  37011 type tagGUITHREADINFO = struct {
  37012 	FcbSize        DWORD
  37013 	Fflags         DWORD
  37014 	FhwndActive    HWND
  37015 	FhwndFocus     HWND
  37016 	FhwndCapture   HWND
  37017 	FhwndMenuOwner HWND
  37018 	FhwndMoveSize  HWND
  37019 	FhwndCaret     HWND
  37020 	FrcCaret       RECT
  37021 }
  37022 
  37023 type GUITHREADINFO = tagGUITHREADINFO
  37024 type PGUITHREADINFO = uintptr
  37025 type LPGUITHREADINFO = uintptr
  37026 
  37027 type tagCURSORINFO = struct {
  37028 	FcbSize      DWORD
  37029 	Fflags       DWORD
  37030 	FhCursor     HCURSOR
  37031 	FptScreenPos POINT
  37032 }
  37033 
  37034 type CURSORINFO = tagCURSORINFO
  37035 type PCURSORINFO = uintptr
  37036 type LPCURSORINFO = uintptr
  37037 
  37038 type tagWINDOWINFO = struct {
  37039 	FcbSize          DWORD
  37040 	FrcWindow        RECT
  37041 	FrcClient        RECT
  37042 	FdwStyle         DWORD
  37043 	FdwExStyle       DWORD
  37044 	FdwWindowStatus  DWORD
  37045 	FcxWindowBorders UINT
  37046 	FcyWindowBorders UINT
  37047 	FatomWindowType  ATOM
  37048 	FwCreatorVersion WORD
  37049 }
  37050 
  37051 type WINDOWINFO = tagWINDOWINFO
  37052 type PWINDOWINFO = uintptr
  37053 type LPWINDOWINFO = uintptr
  37054 
  37055 type tagTITLEBARINFO = struct {
  37056 	FcbSize     DWORD
  37057 	FrcTitleBar RECT
  37058 	Frgstate    [6]DWORD
  37059 }
  37060 
  37061 type TITLEBARINFO = tagTITLEBARINFO
  37062 type PTITLEBARINFO = uintptr
  37063 type LPTITLEBARINFO = uintptr
  37064 
  37065 type tagMENUBARINFO = struct {
  37066 	FcbSize      DWORD
  37067 	FrcBar       RECT
  37068 	F__ccgo_pad1 [4]byte
  37069 	FhMenu       HMENU
  37070 	FhwndMenu    HWND
  37071 	FfBarFocused uint8
  37072 	F__ccgo_pad2 [7]byte
  37073 }
  37074 
  37075 type MENUBARINFO = tagMENUBARINFO
  37076 type PMENUBARINFO = uintptr
  37077 type LPMENUBARINFO = uintptr
  37078 
  37079 type tagSCROLLBARINFO = struct {
  37080 	FcbSize        DWORD
  37081 	FrcScrollBar   RECT
  37082 	FdxyLineButton int32
  37083 	FxyThumbTop    int32
  37084 	FxyThumbBottom int32
  37085 	Freserved      int32
  37086 	Frgstate       [6]DWORD
  37087 }
  37088 
  37089 type SCROLLBARINFO = tagSCROLLBARINFO
  37090 type PSCROLLBARINFO = uintptr
  37091 type LPSCROLLBARINFO = uintptr
  37092 
  37093 type tagCOMBOBOXINFO = struct {
  37094 	FcbSize      DWORD
  37095 	FrcItem      RECT
  37096 	FrcButton    RECT
  37097 	FstateButton DWORD
  37098 	FhwndCombo   HWND
  37099 	FhwndItem    HWND
  37100 	FhwndList    HWND
  37101 }
  37102 
  37103 type COMBOBOXINFO = tagCOMBOBOXINFO
  37104 type PCOMBOBOXINFO = uintptr
  37105 type LPCOMBOBOXINFO = uintptr
  37106 
  37107 type tagALTTABINFO = struct {
  37108 	FcbSize    DWORD
  37109 	FcItems    int32
  37110 	FcColumns  int32
  37111 	FcRows     int32
  37112 	FiColFocus int32
  37113 	FiRowFocus int32
  37114 	FcxItem    int32
  37115 	FcyItem    int32
  37116 	FptStart   POINT
  37117 }
  37118 
  37119 type ALTTABINFO = tagALTTABINFO
  37120 type PALTTABINFO = uintptr
  37121 type LPALTTABINFO = uintptr
  37122 
  37123 type HRAWINPUT__ = struct{ Funused int32 }
  37124 
  37125 type HRAWINPUT = uintptr
  37126 
  37127 type tagRAWINPUTHEADER = struct {
  37128 	FdwType  DWORD
  37129 	FdwSize  DWORD
  37130 	FhDevice HANDLE
  37131 	FwParam  WPARAM
  37132 }
  37133 
  37134 type RAWINPUTHEADER = tagRAWINPUTHEADER
  37135 type PRAWINPUTHEADER = uintptr
  37136 type LPRAWINPUTHEADER = uintptr
  37137 
  37138 type tagRAWMOUSE = struct {
  37139 	FusFlags            USHORT
  37140 	F__ccgo_pad1        [2]byte
  37141 	F__4                struct{ FulButtons ULONG }
  37142 	FulRawButtons       ULONG
  37143 	FlLastX             LONG
  37144 	FlLastY             LONG
  37145 	FulExtraInformation ULONG
  37146 }
  37147 
  37148 type RAWMOUSE = tagRAWMOUSE
  37149 type PRAWMOUSE = uintptr
  37150 type LPRAWMOUSE = uintptr
  37151 
  37152 type tagRAWKEYBOARD = struct {
  37153 	FMakeCode         USHORT
  37154 	FFlags            USHORT
  37155 	FReserved         USHORT
  37156 	FVKey             USHORT
  37157 	FMessage          UINT
  37158 	FExtraInformation ULONG
  37159 }
  37160 
  37161 type RAWKEYBOARD = tagRAWKEYBOARD
  37162 type PRAWKEYBOARD = uintptr
  37163 type LPRAWKEYBOARD = uintptr
  37164 
  37165 type tagRAWHID = struct {
  37166 	FdwSizeHid   DWORD
  37167 	FdwCount     DWORD
  37168 	FbRawData    [1]BYTE
  37169 	F__ccgo_pad1 [3]byte
  37170 }
  37171 
  37172 type RAWHID = tagRAWHID
  37173 type PRAWHID = uintptr
  37174 type LPRAWHID = uintptr
  37175 
  37176 type tagRAWINPUT = struct {
  37177 	Fheader RAWINPUTHEADER
  37178 	Fdata   struct{ Fmouse RAWMOUSE }
  37179 }
  37180 
  37181 type RAWINPUT = tagRAWINPUT
  37182 type PRAWINPUT = uintptr
  37183 type LPRAWINPUT = uintptr
  37184 
  37185 type tagRID_DEVICE_INFO_MOUSE = struct {
  37186 	FdwId                DWORD
  37187 	FdwNumberOfButtons   DWORD
  37188 	FdwSampleRate        DWORD
  37189 	FfHasHorizontalWheel WINBOOL
  37190 }
  37191 
  37192 type RID_DEVICE_INFO_MOUSE = tagRID_DEVICE_INFO_MOUSE
  37193 type PRID_DEVICE_INFO_MOUSE = uintptr
  37194 
  37195 type tagRID_DEVICE_INFO_KEYBOARD = struct {
  37196 	FdwType                 DWORD
  37197 	FdwSubType              DWORD
  37198 	FdwKeyboardMode         DWORD
  37199 	FdwNumberOfFunctionKeys DWORD
  37200 	FdwNumberOfIndicators   DWORD
  37201 	FdwNumberOfKeysTotal    DWORD
  37202 }
  37203 
  37204 type RID_DEVICE_INFO_KEYBOARD = tagRID_DEVICE_INFO_KEYBOARD
  37205 type PRID_DEVICE_INFO_KEYBOARD = uintptr
  37206 
  37207 type tagRID_DEVICE_INFO_HID = struct {
  37208 	FdwVendorId      DWORD
  37209 	FdwProductId     DWORD
  37210 	FdwVersionNumber DWORD
  37211 	FusUsagePage     USHORT
  37212 	FusUsage         USHORT
  37213 }
  37214 
  37215 type RID_DEVICE_INFO_HID = tagRID_DEVICE_INFO_HID
  37216 type PRID_DEVICE_INFO_HID = uintptr
  37217 
  37218 type tagRID_DEVICE_INFO = struct {
  37219 	FcbSize DWORD
  37220 	FdwType DWORD
  37221 	Fu      struct {
  37222 		Fmouse       RID_DEVICE_INFO_MOUSE
  37223 		F__ccgo_pad1 [8]byte
  37224 	}
  37225 }
  37226 
  37227 type RID_DEVICE_INFO = tagRID_DEVICE_INFO
  37228 type PRID_DEVICE_INFO = uintptr
  37229 type LPRID_DEVICE_INFO = uintptr
  37230 
  37231 type tagRAWINPUTDEVICE = struct {
  37232 	FusUsagePage USHORT
  37233 	FusUsage     USHORT
  37234 	FdwFlags     DWORD
  37235 	FhwndTarget  HWND
  37236 }
  37237 
  37238 type RAWINPUTDEVICE = tagRAWINPUTDEVICE
  37239 type PRAWINPUTDEVICE = uintptr
  37240 type LPRAWINPUTDEVICE = uintptr
  37241 
  37242 type PCRAWINPUTDEVICE = uintptr
  37243 
  37244 type tagRAWINPUTDEVICELIST = struct {
  37245 	FhDevice     HANDLE
  37246 	FdwType      DWORD
  37247 	F__ccgo_pad1 [4]byte
  37248 }
  37249 
  37250 type RAWINPUTDEVICELIST = tagRAWINPUTDEVICELIST
  37251 type PRAWINPUTDEVICELIST = uintptr
  37252 
  37253 type LGRPID = DWORD
  37254 type LCTYPE = DWORD
  37255 type CALTYPE = DWORD
  37256 type CALID = DWORD
  37257 
  37258 type _cpinfo = struct {
  37259 	FMaxCharSize UINT
  37260 	FDefaultChar [2]BYTE
  37261 	FLeadByte    [12]BYTE
  37262 	F__ccgo_pad1 [2]byte
  37263 }
  37264 
  37265 type CPINFO = _cpinfo
  37266 type LPCPINFO = uintptr
  37267 type _cpinfoexA = struct {
  37268 	FMaxCharSize        UINT
  37269 	FDefaultChar        [2]BYTE
  37270 	FLeadByte           [12]BYTE
  37271 	FUnicodeDefaultChar WCHAR
  37272 	FCodePage           UINT
  37273 	FCodePageName       [260]CHAR
  37274 }
  37275 
  37276 type CPINFOEXA = _cpinfoexA
  37277 type LPCPINFOEXA = uintptr
  37278 
  37279 type _cpinfoexW = struct {
  37280 	FMaxCharSize        UINT
  37281 	FDefaultChar        [2]BYTE
  37282 	FLeadByte           [12]BYTE
  37283 	FUnicodeDefaultChar WCHAR
  37284 	FCodePage           UINT
  37285 	FCodePageName       [260]WCHAR
  37286 }
  37287 
  37288 type CPINFOEXW = _cpinfoexW
  37289 type LPCPINFOEXW = uintptr
  37290 
  37291 type CPINFOEX = CPINFOEXA
  37292 type LPCPINFOEX = LPCPINFOEXA
  37293 
  37294 type _numberfmtA = struct {
  37295 	FNumDigits     UINT
  37296 	FLeadingZero   UINT
  37297 	FGrouping      UINT
  37298 	F__ccgo_pad1   [4]byte
  37299 	FlpDecimalSep  LPSTR
  37300 	FlpThousandSep LPSTR
  37301 	FNegativeOrder UINT
  37302 	F__ccgo_pad2   [4]byte
  37303 }
  37304 
  37305 type NUMBERFMTA = _numberfmtA
  37306 type LPNUMBERFMTA = uintptr
  37307 type _numberfmtW = struct {
  37308 	FNumDigits     UINT
  37309 	FLeadingZero   UINT
  37310 	FGrouping      UINT
  37311 	F__ccgo_pad1   [4]byte
  37312 	FlpDecimalSep  LPWSTR
  37313 	FlpThousandSep LPWSTR
  37314 	FNegativeOrder UINT
  37315 	F__ccgo_pad2   [4]byte
  37316 }
  37317 
  37318 type NUMBERFMTW = _numberfmtW
  37319 type LPNUMBERFMTW = uintptr
  37320 
  37321 type NUMBERFMT = NUMBERFMTA
  37322 type LPNUMBERFMT = LPNUMBERFMTA
  37323 
  37324 type _currencyfmtA = struct {
  37325 	FNumDigits        UINT
  37326 	FLeadingZero      UINT
  37327 	FGrouping         UINT
  37328 	F__ccgo_pad1      [4]byte
  37329 	FlpDecimalSep     LPSTR
  37330 	FlpThousandSep    LPSTR
  37331 	FNegativeOrder    UINT
  37332 	FPositiveOrder    UINT
  37333 	FlpCurrencySymbol LPSTR
  37334 }
  37335 
  37336 type CURRENCYFMTA = _currencyfmtA
  37337 type LPCURRENCYFMTA = uintptr
  37338 
  37339 type _currencyfmtW = struct {
  37340 	FNumDigits        UINT
  37341 	FLeadingZero      UINT
  37342 	FGrouping         UINT
  37343 	F__ccgo_pad1      [4]byte
  37344 	FlpDecimalSep     LPWSTR
  37345 	FlpThousandSep    LPWSTR
  37346 	FNegativeOrder    UINT
  37347 	FPositiveOrder    UINT
  37348 	FlpCurrencySymbol LPWSTR
  37349 }
  37350 
  37351 type CURRENCYFMTW = _currencyfmtW
  37352 type LPCURRENCYFMTW = uintptr
  37353 
  37354 type CURRENCYFMT = CURRENCYFMTA
  37355 type LPCURRENCYFMT = LPCURRENCYFMTA
  37356 
  37357 type NLS_FUNCTION = DWORD
  37358 
  37359 type _nlsversioninfo = struct {
  37360 	FdwNLSVersionInfoSize DWORD
  37361 	FdwNLSVersion         DWORD
  37362 	FdwDefinedVersion     DWORD
  37363 }
  37364 
  37365 type NLSVERSIONINFO = _nlsversioninfo
  37366 type LPNLSVERSIONINFO = uintptr
  37367 
  37368 type _nlsversioninfoex = struct {
  37369 	FdwNLSVersionInfoSize DWORD
  37370 	FdwNLSVersion         DWORD
  37371 	FdwDefinedVersion     DWORD
  37372 	FdwEffectiveId        DWORD
  37373 	FguidCustomVersion    GUID
  37374 }
  37375 
  37376 type NLSVERSIONINFOEX = _nlsversioninfoex
  37377 type LPNLSVERSIONINFOEX = uintptr
  37378 
  37379 type GEOID = LONG
  37380 type GEOTYPE = DWORD
  37381 type GEOCLASS = DWORD
  37382 
  37383 type LANGUAGEGROUP_ENUMPROCA = uintptr
  37384 type LANGGROUPLOCALE_ENUMPROCA = uintptr
  37385 type UILANGUAGE_ENUMPROCA = uintptr
  37386 type CODEPAGE_ENUMPROCA = uintptr
  37387 type DATEFMT_ENUMPROCA = uintptr
  37388 type DATEFMT_ENUMPROCEXA = uintptr
  37389 type TIMEFMT_ENUMPROCA = uintptr
  37390 type CALINFO_ENUMPROCA = uintptr
  37391 type CALINFO_ENUMPROCEXA = uintptr
  37392 type LOCALE_ENUMPROCA = uintptr
  37393 type LOCALE_ENUMPROCW = uintptr
  37394 type LANGUAGEGROUP_ENUMPROCW = uintptr
  37395 type LANGGROUPLOCALE_ENUMPROCW = uintptr
  37396 type UILANGUAGE_ENUMPROCW = uintptr
  37397 type CODEPAGE_ENUMPROCW = uintptr
  37398 type DATEFMT_ENUMPROCW = uintptr
  37399 type DATEFMT_ENUMPROCEXW = uintptr
  37400 type TIMEFMT_ENUMPROCW = uintptr
  37401 type CALINFO_ENUMPROCW = uintptr
  37402 type CALINFO_ENUMPROCEXW = uintptr
  37403 type GEO_ENUMPROC = uintptr
  37404 
  37405 type _FILEMUIINFO = struct {
  37406 	FdwSize               DWORD
  37407 	FdwVersion            DWORD
  37408 	FdwFileType           DWORD
  37409 	FpChecksum            [16]BYTE
  37410 	FpServiceChecksum     [16]BYTE
  37411 	FdwLanguageNameOffset DWORD
  37412 	FdwTypeIDMainSize     DWORD
  37413 	FdwTypeIDMainOffset   DWORD
  37414 	FdwTypeNameMainOffset DWORD
  37415 	FdwTypeIDMUISize      DWORD
  37416 	FdwTypeIDMUIOffset    DWORD
  37417 	FdwTypeNameMUIOffset  DWORD
  37418 	FabBuffer             [8]BYTE
  37419 }
  37420 
  37421 type FILEMUIINFO = _FILEMUIINFO
  37422 type PFILEMUIINFO = uintptr
  37423 
  37424 type _COORD = struct {
  37425 	FX SHORT
  37426 	FY SHORT
  37427 }
  37428 
  37429 type COORD = _COORD
  37430 type PCOORD = uintptr
  37431 
  37432 type _SMALL_RECT = struct {
  37433 	FLeft   SHORT
  37434 	FTop    SHORT
  37435 	FRight  SHORT
  37436 	FBottom SHORT
  37437 }
  37438 
  37439 type SMALL_RECT = _SMALL_RECT
  37440 type PSMALL_RECT = uintptr
  37441 
  37442 type _KEY_EVENT_RECORD = struct {
  37443 	FbKeyDown          WINBOOL
  37444 	FwRepeatCount      WORD
  37445 	FwVirtualKeyCode   WORD
  37446 	FwVirtualScanCode  WORD
  37447 	FuChar             struct{ FUnicodeChar WCHAR }
  37448 	FdwControlKeyState DWORD
  37449 }
  37450 
  37451 type KEY_EVENT_RECORD = _KEY_EVENT_RECORD
  37452 type PKEY_EVENT_RECORD = uintptr
  37453 
  37454 type _MOUSE_EVENT_RECORD = struct {
  37455 	FdwMousePosition   COORD
  37456 	FdwButtonState     DWORD
  37457 	FdwControlKeyState DWORD
  37458 	FdwEventFlags      DWORD
  37459 }
  37460 
  37461 type MOUSE_EVENT_RECORD = _MOUSE_EVENT_RECORD
  37462 type PMOUSE_EVENT_RECORD = uintptr
  37463 
  37464 type _WINDOW_BUFFER_SIZE_RECORD = struct{ FdwSize COORD }
  37465 
  37466 type WINDOW_BUFFER_SIZE_RECORD = _WINDOW_BUFFER_SIZE_RECORD
  37467 type PWINDOW_BUFFER_SIZE_RECORD = uintptr
  37468 
  37469 type _MENU_EVENT_RECORD = struct{ FdwCommandId UINT }
  37470 
  37471 type MENU_EVENT_RECORD = _MENU_EVENT_RECORD
  37472 type PMENU_EVENT_RECORD = uintptr
  37473 
  37474 type _FOCUS_EVENT_RECORD = struct{ FbSetFocus WINBOOL }
  37475 
  37476 type FOCUS_EVENT_RECORD = _FOCUS_EVENT_RECORD
  37477 type PFOCUS_EVENT_RECORD = uintptr
  37478 
  37479 type _INPUT_RECORD = struct {
  37480 	FEventType   WORD
  37481 	F__ccgo_pad1 [2]byte
  37482 	FEvent       struct{ FKeyEvent KEY_EVENT_RECORD }
  37483 }
  37484 
  37485 type INPUT_RECORD = _INPUT_RECORD
  37486 type PINPUT_RECORD = uintptr
  37487 
  37488 type _CHAR_INFO = struct {
  37489 	FChar       struct{ FUnicodeChar WCHAR }
  37490 	FAttributes WORD
  37491 }
  37492 
  37493 type CHAR_INFO = _CHAR_INFO
  37494 type PCHAR_INFO = uintptr
  37495 
  37496 type _CONSOLE_SCREEN_BUFFER_INFO = struct {
  37497 	FdwSize              COORD
  37498 	FdwCursorPosition    COORD
  37499 	FwAttributes         WORD
  37500 	FsrWindow            SMALL_RECT
  37501 	FdwMaximumWindowSize COORD
  37502 }
  37503 
  37504 type CONSOLE_SCREEN_BUFFER_INFO = _CONSOLE_SCREEN_BUFFER_INFO
  37505 type PCONSOLE_SCREEN_BUFFER_INFO = uintptr
  37506 
  37507 type _CONSOLE_CURSOR_INFO = struct {
  37508 	FdwSize   DWORD
  37509 	FbVisible WINBOOL
  37510 }
  37511 
  37512 type CONSOLE_CURSOR_INFO = _CONSOLE_CURSOR_INFO
  37513 type PCONSOLE_CURSOR_INFO = uintptr
  37514 
  37515 type _CONSOLE_FONT_INFO = struct {
  37516 	FnFont      DWORD
  37517 	FdwFontSize COORD
  37518 }
  37519 
  37520 type CONSOLE_FONT_INFO = _CONSOLE_FONT_INFO
  37521 type PCONSOLE_FONT_INFO = uintptr
  37522 
  37523 type _CONSOLE_SELECTION_INFO = struct {
  37524 	FdwFlags           DWORD
  37525 	FdwSelectionAnchor COORD
  37526 	FsrSelection       SMALL_RECT
  37527 }
  37528 
  37529 type CONSOLE_SELECTION_INFO = _CONSOLE_SELECTION_INFO
  37530 type PCONSOLE_SELECTION_INFO = uintptr
  37531 
  37532 type PHANDLER_ROUTINE = uintptr
  37533 
  37534 type _CONSOLE_FONT_INFOEX = struct {
  37535 	FcbSize     ULONG
  37536 	FnFont      DWORD
  37537 	FdwFontSize COORD
  37538 	FFontFamily UINT
  37539 	FFontWeight UINT
  37540 	FFaceName   [32]WCHAR
  37541 }
  37542 
  37543 type CONSOLE_FONT_INFOEX = _CONSOLE_FONT_INFOEX
  37544 type PCONSOLE_FONT_INFOEX = uintptr
  37545 
  37546 type _CONSOLE_HISTORY_INFO = struct {
  37547 	FcbSize                 UINT
  37548 	FHistoryBufferSize      UINT
  37549 	FNumberOfHistoryBuffers UINT
  37550 	FdwFlags                DWORD
  37551 }
  37552 
  37553 type CONSOLE_HISTORY_INFO = _CONSOLE_HISTORY_INFO
  37554 type PCONSOLE_HISTORY_INFO = uintptr
  37555 
  37556 type _CONSOLE_READCONSOLE_CONTROL = struct {
  37557 	FnLength           ULONG
  37558 	FnInitialChars     ULONG
  37559 	FdwCtrlWakeupMask  ULONG
  37560 	FdwControlKeyState ULONG
  37561 }
  37562 
  37563 type CONSOLE_READCONSOLE_CONTROL = _CONSOLE_READCONSOLE_CONTROL
  37564 type PCONSOLE_READCONSOLE_CONTROL = uintptr
  37565 
  37566 type _CONSOLE_SCREEN_BUFFER_INFOEX = struct {
  37567 	FcbSize               ULONG
  37568 	FdwSize               COORD
  37569 	FdwCursorPosition     COORD
  37570 	FwAttributes          WORD
  37571 	FsrWindow             SMALL_RECT
  37572 	FdwMaximumWindowSize  COORD
  37573 	FwPopupAttributes     WORD
  37574 	FbFullscreenSupported WINBOOL
  37575 	FColorTable           [16]COLORREF
  37576 }
  37577 
  37578 type CONSOLE_SCREEN_BUFFER_INFOEX = _CONSOLE_SCREEN_BUFFER_INFOEX
  37579 type PCONSOLE_SCREEN_BUFFER_INFOEX = uintptr
  37580 
  37581 type tagVS_FIXEDFILEINFO = struct {
  37582 	FdwSignature        DWORD
  37583 	FdwStrucVersion     DWORD
  37584 	FdwFileVersionMS    DWORD
  37585 	FdwFileVersionLS    DWORD
  37586 	FdwProductVersionMS DWORD
  37587 	FdwProductVersionLS DWORD
  37588 	FdwFileFlagsMask    DWORD
  37589 	FdwFileFlags        DWORD
  37590 	FdwFileOS           DWORD
  37591 	FdwFileType         DWORD
  37592 	FdwFileSubtype      DWORD
  37593 	FdwFileDateMS       DWORD
  37594 	FdwFileDateLS       DWORD
  37595 }
  37596 
  37597 type VS_FIXEDFILEINFO = tagVS_FIXEDFILEINFO
  37598 
  37599 type REGSAM = ACCESS_MASK
  37600 type LSTATUS = LONG
  37601 
  37602 type val_context = struct {
  37603 	Fvaluelen      int32
  37604 	F__ccgo_pad1   [4]byte
  37605 	Fvalue_context LPVOID
  37606 	Fval_buff_ptr  LPVOID
  37607 }
  37608 
  37609 type PVALCONTEXT = uintptr
  37610 
  37611 type pvalueA = struct {
  37612 	Fpv_valuename     LPSTR
  37613 	Fpv_valuelen      int32
  37614 	F__ccgo_pad1      [4]byte
  37615 	Fpv_value_context LPVOID
  37616 	Fpv_type          DWORD
  37617 	F__ccgo_pad2      [4]byte
  37618 }
  37619 
  37620 type PVALUEA = pvalueA
  37621 type PPVALUEA = uintptr
  37622 
  37623 type pvalueW = struct {
  37624 	Fpv_valuename     LPWSTR
  37625 	Fpv_valuelen      int32
  37626 	F__ccgo_pad1      [4]byte
  37627 	Fpv_value_context LPVOID
  37628 	Fpv_type          DWORD
  37629 	F__ccgo_pad2      [4]byte
  37630 }
  37631 
  37632 type PVALUEW = pvalueW
  37633 type PPVALUEW = uintptr
  37634 
  37635 type PVALUE = PVALUEA
  37636 type PPVALUE = PPVALUEA
  37637 
  37638 type PQUERYHANDLER = uintptr
  37639 
  37640 type provider_info = struct {
  37641 	Fpi_R0_1val     PQUERYHANDLER
  37642 	Fpi_R0_allvals  PQUERYHANDLER
  37643 	Fpi_R3_1val     PQUERYHANDLER
  37644 	Fpi_R3_allvals  PQUERYHANDLER
  37645 	Fpi_flags       DWORD
  37646 	F__ccgo_pad1    [4]byte
  37647 	Fpi_key_context LPVOID
  37648 }
  37649 
  37650 type REG_PROVIDER = provider_info
  37651 
  37652 type PPROVIDER = uintptr
  37653 
  37654 type value_entA = struct {
  37655 	Fve_valuename LPSTR
  37656 	Fve_valuelen  DWORD
  37657 	F__ccgo_pad1  [4]byte
  37658 	Fve_valueptr  DWORD_PTR
  37659 	Fve_type      DWORD
  37660 	F__ccgo_pad2  [4]byte
  37661 }
  37662 
  37663 type VALENTA = value_entA
  37664 type PVALENTA = uintptr
  37665 
  37666 type value_entW = struct {
  37667 	Fve_valuename LPWSTR
  37668 	Fve_valuelen  DWORD
  37669 	F__ccgo_pad1  [4]byte
  37670 	Fve_valueptr  DWORD_PTR
  37671 	Fve_type      DWORD
  37672 	F__ccgo_pad2  [4]byte
  37673 }
  37674 
  37675 type VALENTW = value_entW
  37676 type PVALENTW = uintptr
  37677 
  37678 type VALENT = VALENTA
  37679 type PVALENT = PVALENTA
  37680 
  37681 type _NETRESOURCEA = struct {
  37682 	FdwScope       DWORD
  37683 	FdwType        DWORD
  37684 	FdwDisplayType DWORD
  37685 	FdwUsage       DWORD
  37686 	FlpLocalName   LPSTR
  37687 	FlpRemoteName  LPSTR
  37688 	FlpComment     LPSTR
  37689 	FlpProvider    LPSTR
  37690 }
  37691 
  37692 type NETRESOURCEA = _NETRESOURCEA
  37693 type LPNETRESOURCEA = uintptr
  37694 type _NETRESOURCEW = struct {
  37695 	FdwScope       DWORD
  37696 	FdwType        DWORD
  37697 	FdwDisplayType DWORD
  37698 	FdwUsage       DWORD
  37699 	FlpLocalName   LPWSTR
  37700 	FlpRemoteName  LPWSTR
  37701 	FlpComment     LPWSTR
  37702 	FlpProvider    LPWSTR
  37703 }
  37704 
  37705 type NETRESOURCEW = _NETRESOURCEW
  37706 type LPNETRESOURCEW = uintptr
  37707 
  37708 type NETRESOURCE = NETRESOURCEA
  37709 type LPNETRESOURCE = LPNETRESOURCEA
  37710 
  37711 type _CONNECTDLGSTRUCTA = struct {
  37712 	FcbStructure DWORD
  37713 	F__ccgo_pad1 [4]byte
  37714 	FhwndOwner   HWND
  37715 	FlpConnRes   LPNETRESOURCEA
  37716 	FdwFlags     DWORD
  37717 	FdwDevNum    DWORD
  37718 }
  37719 
  37720 type CONNECTDLGSTRUCTA = _CONNECTDLGSTRUCTA
  37721 type LPCONNECTDLGSTRUCTA = uintptr
  37722 
  37723 type _CONNECTDLGSTRUCTW = struct {
  37724 	FcbStructure DWORD
  37725 	F__ccgo_pad1 [4]byte
  37726 	FhwndOwner   HWND
  37727 	FlpConnRes   LPNETRESOURCEW
  37728 	FdwFlags     DWORD
  37729 	FdwDevNum    DWORD
  37730 }
  37731 
  37732 type CONNECTDLGSTRUCTW = _CONNECTDLGSTRUCTW
  37733 type LPCONNECTDLGSTRUCTW = uintptr
  37734 
  37735 type CONNECTDLGSTRUCT = CONNECTDLGSTRUCTA
  37736 type LPCONNECTDLGSTRUCT = LPCONNECTDLGSTRUCTA
  37737 
  37738 type _DISCDLGSTRUCTA = struct {
  37739 	FcbStructure  DWORD
  37740 	F__ccgo_pad1  [4]byte
  37741 	FhwndOwner    HWND
  37742 	FlpLocalName  LPSTR
  37743 	FlpRemoteName LPSTR
  37744 	FdwFlags      DWORD
  37745 	F__ccgo_pad2  [4]byte
  37746 }
  37747 
  37748 type DISCDLGSTRUCTA = _DISCDLGSTRUCTA
  37749 type LPDISCDLGSTRUCTA = uintptr
  37750 
  37751 type _DISCDLGSTRUCTW = struct {
  37752 	FcbStructure  DWORD
  37753 	F__ccgo_pad1  [4]byte
  37754 	FhwndOwner    HWND
  37755 	FlpLocalName  LPWSTR
  37756 	FlpRemoteName LPWSTR
  37757 	FdwFlags      DWORD
  37758 	F__ccgo_pad2  [4]byte
  37759 }
  37760 
  37761 type DISCDLGSTRUCTW = _DISCDLGSTRUCTW
  37762 type LPDISCDLGSTRUCTW = uintptr
  37763 
  37764 type DISCDLGSTRUCT = DISCDLGSTRUCTA
  37765 type LPDISCDLGSTRUCT = LPDISCDLGSTRUCTA
  37766 
  37767 type _UNIVERSAL_NAME_INFOA = struct{ FlpUniversalName LPSTR }
  37768 
  37769 type UNIVERSAL_NAME_INFOA = _UNIVERSAL_NAME_INFOA
  37770 type LPUNIVERSAL_NAME_INFOA = uintptr
  37771 
  37772 type _UNIVERSAL_NAME_INFOW = struct{ FlpUniversalName LPWSTR }
  37773 
  37774 type UNIVERSAL_NAME_INFOW = _UNIVERSAL_NAME_INFOW
  37775 type LPUNIVERSAL_NAME_INFOW = uintptr
  37776 
  37777 type UNIVERSAL_NAME_INFO = UNIVERSAL_NAME_INFOA
  37778 type LPUNIVERSAL_NAME_INFO = LPUNIVERSAL_NAME_INFOA
  37779 
  37780 type _REMOTE_NAME_INFOA = struct {
  37781 	FlpUniversalName  LPSTR
  37782 	FlpConnectionName LPSTR
  37783 	FlpRemainingPath  LPSTR
  37784 }
  37785 
  37786 type REMOTE_NAME_INFOA = _REMOTE_NAME_INFOA
  37787 type LPREMOTE_NAME_INFOA = uintptr
  37788 
  37789 type _REMOTE_NAME_INFOW = struct {
  37790 	FlpUniversalName  LPWSTR
  37791 	FlpConnectionName LPWSTR
  37792 	FlpRemainingPath  LPWSTR
  37793 }
  37794 
  37795 type REMOTE_NAME_INFOW = _REMOTE_NAME_INFOW
  37796 type LPREMOTE_NAME_INFOW = uintptr
  37797 
  37798 type REMOTE_NAME_INFO = REMOTE_NAME_INFOA
  37799 type LPREMOTE_NAME_INFO = LPREMOTE_NAME_INFOA
  37800 
  37801 type _NETINFOSTRUCT = struct {
  37802 	FcbStructure       DWORD
  37803 	FdwProviderVersion DWORD
  37804 	FdwStatus          DWORD
  37805 	FdwCharacteristics DWORD
  37806 	FdwHandle          ULONG_PTR
  37807 	FwNetType          WORD
  37808 	F__ccgo_pad1       [2]byte
  37809 	FdwPrinters        DWORD
  37810 	FdwDrives          DWORD
  37811 	F__ccgo_pad2       [4]byte
  37812 }
  37813 
  37814 type NETINFOSTRUCT = _NETINFOSTRUCT
  37815 type LPNETINFOSTRUCT = uintptr
  37816 
  37817 type PFNGETPROFILEPATHA = uintptr
  37818 type PFNGETPROFILEPATHW = uintptr
  37819 
  37820 type PFNRECONCILEPROFILEA = uintptr
  37821 type PFNRECONCILEPROFILEW = uintptr
  37822 
  37823 type PFNPROCESSPOLICIESA = uintptr
  37824 type PFNPROCESSPOLICIESW = uintptr
  37825 
  37826 type _NETCONNECTINFOSTRUCT = struct {
  37827 	FcbStructure   DWORD
  37828 	FdwFlags       DWORD
  37829 	FdwSpeed       DWORD
  37830 	FdwDelay       DWORD
  37831 	FdwOptDataSize DWORD
  37832 }
  37833 
  37834 type NETCONNECTINFOSTRUCT = _NETCONNECTINFOSTRUCT
  37835 type LPNETCONNECTINFOSTRUCT = uintptr
  37836 
  37837 type DDEACK = struct {
  37838 	F__ccgo_pad1    [0]uint16
  37839 	FbAppReturnCode uint16
  37840 }
  37841 
  37842 type DDEADVISE = struct {
  37843 	Freserved    uint16
  37844 	F__ccgo_pad1 [2]byte
  37845 	FcfFormat    int16
  37846 }
  37847 
  37848 type DDEDATA = struct {
  37849 	Funused      uint16
  37850 	F__ccgo_pad1 [2]byte
  37851 	FcfFormat    int16
  37852 	FValue       [1]BYTE
  37853 	F__ccgo_pad2 [1]byte
  37854 }
  37855 
  37856 type DDEPOKE = struct {
  37857 	Funused      uint16
  37858 	F__ccgo_pad1 [2]byte
  37859 	FcfFormat    int16
  37860 	FValue       [1]BYTE
  37861 	F__ccgo_pad2 [1]byte
  37862 }
  37863 
  37864 type DDELN = struct {
  37865 	Funused      uint16
  37866 	F__ccgo_pad1 [2]byte
  37867 	FcfFormat    int16
  37868 }
  37869 
  37870 type DDEUP = struct {
  37871 	Funused      uint16
  37872 	F__ccgo_pad1 [2]byte
  37873 	FcfFormat    int16
  37874 	Frgb         [1]BYTE
  37875 	F__ccgo_pad2 [1]byte
  37876 }
  37877 
  37878 type HCONVLIST__ = struct{ Funused int32 }
  37879 
  37880 type HCONVLIST = uintptr
  37881 type HCONV__ = struct{ Funused int32 }
  37882 
  37883 type HCONV = uintptr
  37884 type HSZ__ = struct{ Funused int32 }
  37885 
  37886 type HSZ = uintptr
  37887 type HDDEDATA__ = struct{ Funused int32 }
  37888 
  37889 type HDDEDATA = uintptr
  37890 
  37891 type tagHSZPAIR = struct {
  37892 	FhszSvc   HSZ
  37893 	FhszTopic HSZ
  37894 }
  37895 
  37896 type HSZPAIR = tagHSZPAIR
  37897 type PHSZPAIR = uintptr
  37898 
  37899 type tagCONVCONTEXT = struct {
  37900 	Fcb         UINT
  37901 	FwFlags     UINT
  37902 	FwCountryID UINT
  37903 	FiCodePage  int32
  37904 	FdwLangID   DWORD
  37905 	FdwSecurity DWORD
  37906 	Fqos        SECURITY_QUALITY_OF_SERVICE
  37907 }
  37908 
  37909 type CONVCONTEXT = tagCONVCONTEXT
  37910 type PCONVCONTEXT = uintptr
  37911 
  37912 type tagCONVINFO = struct {
  37913 	Fcb            DWORD
  37914 	F__ccgo_pad1   [4]byte
  37915 	FhUser         DWORD_PTR
  37916 	FhConvPartner  HCONV
  37917 	FhszSvcPartner HSZ
  37918 	FhszServiceReq HSZ
  37919 	FhszTopic      HSZ
  37920 	FhszItem       HSZ
  37921 	FwFmt          UINT
  37922 	FwType         UINT
  37923 	FwStatus       UINT
  37924 	FwConvst       UINT
  37925 	FwLastError    UINT
  37926 	F__ccgo_pad2   [4]byte
  37927 	FhConvList     HCONVLIST
  37928 	FConvCtxt      CONVCONTEXT
  37929 	F__ccgo_pad3   [4]byte
  37930 	Fhwnd          HWND
  37931 	FhwndPartner   HWND
  37932 }
  37933 
  37934 type CONVINFO = tagCONVINFO
  37935 type PCONVINFO = uintptr
  37936 type PFNCALLBACK = uintptr
  37937 
  37938 type tagDDEML_MSG_HOOK_DATA = struct {
  37939 	FuiLo        UINT_PTR
  37940 	FuiHi        UINT_PTR
  37941 	FcbData      DWORD
  37942 	FData        [8]DWORD
  37943 	F__ccgo_pad1 [4]byte
  37944 }
  37945 
  37946 type DDEML_MSG_HOOK_DATA = tagDDEML_MSG_HOOK_DATA
  37947 type PDDEML_MSG_HOOK_DATA = uintptr
  37948 
  37949 type tagMONMSGSTRUCT = struct {
  37950 	Fcb          UINT
  37951 	F__ccgo_pad1 [4]byte
  37952 	FhwndTo      HWND
  37953 	FdwTime      DWORD
  37954 	F__ccgo_pad2 [4]byte
  37955 	FhTask       HANDLE
  37956 	FwMsg        UINT
  37957 	F__ccgo_pad3 [4]byte
  37958 	FwParam      WPARAM
  37959 	FlParam      LPARAM
  37960 	Fdmhd        DDEML_MSG_HOOK_DATA
  37961 }
  37962 
  37963 type MONMSGSTRUCT = tagMONMSGSTRUCT
  37964 type PMONMSGSTRUCT = uintptr
  37965 
  37966 type tagMONCBSTRUCT = struct {
  37967 	Fcb          UINT
  37968 	FdwTime      DWORD
  37969 	FhTask       HANDLE
  37970 	FdwRet       DWORD
  37971 	FwType       UINT
  37972 	FwFmt        UINT
  37973 	F__ccgo_pad1 [4]byte
  37974 	FhConv       HCONV
  37975 	Fhsz1        HSZ
  37976 	Fhsz2        HSZ
  37977 	FhData       HDDEDATA
  37978 	FdwData1     ULONG_PTR
  37979 	FdwData2     ULONG_PTR
  37980 	Fcc          CONVCONTEXT
  37981 	FcbData      DWORD
  37982 	FData        [8]DWORD
  37983 }
  37984 
  37985 type MONCBSTRUCT = tagMONCBSTRUCT
  37986 type PMONCBSTRUCT = uintptr
  37987 
  37988 type tagMONHSZSTRUCTA = struct {
  37989 	Fcb          UINT
  37990 	FfsAction    WINBOOL
  37991 	FdwTime      DWORD
  37992 	F__ccgo_pad1 [4]byte
  37993 	Fhsz         HSZ
  37994 	FhTask       HANDLE
  37995 	Fstr         [1]CHAR
  37996 	F__ccgo_pad2 [7]byte
  37997 }
  37998 
  37999 type MONHSZSTRUCTA = tagMONHSZSTRUCTA
  38000 type PMONHSZSTRUCTA = uintptr
  38001 
  38002 type tagMONHSZSTRUCTW = struct {
  38003 	Fcb          UINT
  38004 	FfsAction    WINBOOL
  38005 	FdwTime      DWORD
  38006 	F__ccgo_pad1 [4]byte
  38007 	Fhsz         HSZ
  38008 	FhTask       HANDLE
  38009 	Fstr         [1]WCHAR
  38010 	F__ccgo_pad2 [6]byte
  38011 }
  38012 
  38013 type MONHSZSTRUCTW = tagMONHSZSTRUCTW
  38014 type PMONHSZSTRUCTW = uintptr
  38015 
  38016 type MONHSZSTRUCT = MONHSZSTRUCTA
  38017 type PMONHSZSTRUCT = PMONHSZSTRUCTA
  38018 
  38019 type tagMONERRSTRUCT = struct {
  38020 	Fcb          UINT
  38021 	FwLastError  UINT
  38022 	FdwTime      DWORD
  38023 	F__ccgo_pad1 [4]byte
  38024 	FhTask       HANDLE
  38025 }
  38026 
  38027 type MONERRSTRUCT = tagMONERRSTRUCT
  38028 type PMONERRSTRUCT = uintptr
  38029 
  38030 type tagMONLINKSTRUCT = struct {
  38031 	Fcb           UINT
  38032 	FdwTime       DWORD
  38033 	FhTask        HANDLE
  38034 	FfEstablished WINBOOL
  38035 	FfNoData      WINBOOL
  38036 	FhszSvc       HSZ
  38037 	FhszTopic     HSZ
  38038 	FhszItem      HSZ
  38039 	FwFmt         UINT
  38040 	FfServer      WINBOOL
  38041 	FhConvServer  HCONV
  38042 	FhConvClient  HCONV
  38043 }
  38044 
  38045 type MONLINKSTRUCT = tagMONLINKSTRUCT
  38046 type PMONLINKSTRUCT = uintptr
  38047 
  38048 type tagMONCONVSTRUCT = struct {
  38049 	Fcb          UINT
  38050 	FfConnect    WINBOOL
  38051 	FdwTime      DWORD
  38052 	F__ccgo_pad1 [4]byte
  38053 	FhTask       HANDLE
  38054 	FhszSvc      HSZ
  38055 	FhszTopic    HSZ
  38056 	FhConvClient HCONV
  38057 	FhConvServer HCONV
  38058 }
  38059 
  38060 type MONCONVSTRUCT = tagMONCONVSTRUCT
  38061 type PMONCONVSTRUCT = uintptr
  38062 
  38063 type tagCRGB = struct {
  38064 	FbRed   BYTE
  38065 	FbGreen BYTE
  38066 	FbBlue  BYTE
  38067 	FbExtra BYTE
  38068 }
  38069 
  38070 type CRGB = tagCRGB
  38071 
  38072 type MMVERSION = UINT
  38073 type MMRESULT = UINT
  38074 
  38075 type LPUINT = uintptr
  38076 
  38077 type mmtime_tag = struct {
  38078 	FwType UINT
  38079 	Fu     struct {
  38080 		Fms          DWORD
  38081 		F__ccgo_pad1 [4]byte
  38082 	}
  38083 }
  38084 
  38085 type MMTIME = mmtime_tag
  38086 type PMMTIME = uintptr
  38087 type NPMMTIME = uintptr
  38088 type LPMMTIME = uintptr
  38089 
  38090 type HDRVR__ = struct{ Funused int32 }
  38091 
  38092 type HDRVR = uintptr
  38093 
  38094 type DRVCONFIGINFOEX1 = struct {
  38095 	FdwDCISize          DWORD
  38096 	F__ccgo_pad1        [4]byte
  38097 	FlpszDCISectionName LPCWSTR
  38098 	FlpszDCIAliasName   LPCWSTR
  38099 	FdnDevNode          DWORD
  38100 	F__ccgo_pad2        [4]byte
  38101 }
  38102 
  38103 type DRVCONFIGINFOEX = DRVCONFIGINFOEX1
  38104 type PDRVCONFIGINFOEX = uintptr
  38105 type NPDRVCONFIGINFOEX = uintptr
  38106 type LPDRVCONFIGINFOEX = uintptr
  38107 
  38108 type tagDRVCONFIGINFO = struct {
  38109 	FdwDCISize          DWORD
  38110 	F__ccgo_pad1        [4]byte
  38111 	FlpszDCISectionName LPCWSTR
  38112 	FlpszDCIAliasName   LPCWSTR
  38113 }
  38114 
  38115 type DRVCONFIGINFO = tagDRVCONFIGINFO
  38116 type PDRVCONFIGINFO = uintptr
  38117 type NPDRVCONFIGINFO = uintptr
  38118 type LPDRVCONFIGINFO = uintptr
  38119 
  38120 type DRIVERPROC = uintptr
  38121 
  38122 type LPDRVCALLBACK = uintptr
  38123 type PDRVCALLBACK = uintptr
  38124 
  38125 type HWAVE__ = struct{ Funused int32 }
  38126 
  38127 type HWAVE = uintptr
  38128 type HWAVEIN__ = struct{ Funused int32 }
  38129 
  38130 type HWAVEIN = uintptr
  38131 type HWAVEOUT__ = struct{ Funused int32 }
  38132 
  38133 type HWAVEOUT = uintptr
  38134 type LPHWAVEIN = uintptr
  38135 type LPHWAVEOUT = uintptr
  38136 type LPWAVECALLBACK = uintptr
  38137 
  38138 type wavehdr_tag = struct {
  38139 	FlpData          LPSTR
  38140 	FdwBufferLength  DWORD
  38141 	FdwBytesRecorded DWORD
  38142 	FdwUser          DWORD_PTR
  38143 	FdwFlags         DWORD
  38144 	FdwLoops         DWORD
  38145 	FlpNext          uintptr
  38146 	Freserved        DWORD_PTR
  38147 }
  38148 
  38149 type WAVEHDR = wavehdr_tag
  38150 type PWAVEHDR = uintptr
  38151 type NPWAVEHDR = uintptr
  38152 type LPWAVEHDR = uintptr
  38153 
  38154 type tagWAVEOUTCAPSA = struct {
  38155 	FwMid           WORD
  38156 	FwPid           WORD
  38157 	FvDriverVersion MMVERSION
  38158 	FszPname        [32]CHAR
  38159 	FdwFormats      DWORD
  38160 	FwChannels      WORD
  38161 	FwReserved1     WORD
  38162 	FdwSupport      DWORD
  38163 }
  38164 
  38165 type WAVEOUTCAPSA = tagWAVEOUTCAPSA
  38166 type PWAVEOUTCAPSA = uintptr
  38167 type NPWAVEOUTCAPSA = uintptr
  38168 type LPWAVEOUTCAPSA = uintptr
  38169 
  38170 type tagWAVEOUTCAPSW = struct {
  38171 	FwMid           WORD
  38172 	FwPid           WORD
  38173 	FvDriverVersion MMVERSION
  38174 	FszPname        [32]WCHAR
  38175 	FdwFormats      DWORD
  38176 	FwChannels      WORD
  38177 	FwReserved1     WORD
  38178 	FdwSupport      DWORD
  38179 }
  38180 
  38181 type WAVEOUTCAPSW = tagWAVEOUTCAPSW
  38182 type PWAVEOUTCAPSW = uintptr
  38183 type NPWAVEOUTCAPSW = uintptr
  38184 type LPWAVEOUTCAPSW = uintptr
  38185 
  38186 type WAVEOUTCAPS = WAVEOUTCAPSA
  38187 type PWAVEOUTCAPS = PWAVEOUTCAPSA
  38188 type NPWAVEOUTCAPS = NPWAVEOUTCAPSA
  38189 type LPWAVEOUTCAPS = LPWAVEOUTCAPSA
  38190 
  38191 type tagWAVEOUTCAPS2A = struct {
  38192 	FwMid             WORD
  38193 	FwPid             WORD
  38194 	FvDriverVersion   MMVERSION
  38195 	FszPname          [32]CHAR
  38196 	FdwFormats        DWORD
  38197 	FwChannels        WORD
  38198 	FwReserved1       WORD
  38199 	FdwSupport        DWORD
  38200 	FManufacturerGuid GUID
  38201 	FProductGuid      GUID
  38202 	FNameGuid         GUID
  38203 }
  38204 
  38205 type WAVEOUTCAPS2A = tagWAVEOUTCAPS2A
  38206 type PWAVEOUTCAPS2A = uintptr
  38207 type NPWAVEOUTCAPS2A = uintptr
  38208 type LPWAVEOUTCAPS2A = uintptr
  38209 
  38210 type tagWAVEOUTCAPS2W = struct {
  38211 	FwMid             WORD
  38212 	FwPid             WORD
  38213 	FvDriverVersion   MMVERSION
  38214 	FszPname          [32]WCHAR
  38215 	FdwFormats        DWORD
  38216 	FwChannels        WORD
  38217 	FwReserved1       WORD
  38218 	FdwSupport        DWORD
  38219 	FManufacturerGuid GUID
  38220 	FProductGuid      GUID
  38221 	FNameGuid         GUID
  38222 }
  38223 
  38224 type WAVEOUTCAPS2W = tagWAVEOUTCAPS2W
  38225 type PWAVEOUTCAPS2W = uintptr
  38226 type NPWAVEOUTCAPS2W = uintptr
  38227 type LPWAVEOUTCAPS2W = uintptr
  38228 
  38229 type WAVEOUTCAPS2 = WAVEOUTCAPS2A
  38230 type PWAVEOUTCAPS2 = PWAVEOUTCAPS2A
  38231 type NPWAVEOUTCAPS2 = NPWAVEOUTCAPS2A
  38232 type LPWAVEOUTCAPS2 = LPWAVEOUTCAPS2A
  38233 
  38234 type tagWAVEINCAPSA = struct {
  38235 	FwMid           WORD
  38236 	FwPid           WORD
  38237 	FvDriverVersion MMVERSION
  38238 	FszPname        [32]CHAR
  38239 	FdwFormats      DWORD
  38240 	FwChannels      WORD
  38241 	FwReserved1     WORD
  38242 }
  38243 
  38244 type WAVEINCAPSA = tagWAVEINCAPSA
  38245 type PWAVEINCAPSA = uintptr
  38246 type NPWAVEINCAPSA = uintptr
  38247 type LPWAVEINCAPSA = uintptr
  38248 
  38249 type tagWAVEINCAPSW = struct {
  38250 	FwMid           WORD
  38251 	FwPid           WORD
  38252 	FvDriverVersion MMVERSION
  38253 	FszPname        [32]WCHAR
  38254 	FdwFormats      DWORD
  38255 	FwChannels      WORD
  38256 	FwReserved1     WORD
  38257 }
  38258 
  38259 type WAVEINCAPSW = tagWAVEINCAPSW
  38260 type PWAVEINCAPSW = uintptr
  38261 type NPWAVEINCAPSW = uintptr
  38262 type LPWAVEINCAPSW = uintptr
  38263 
  38264 type WAVEINCAPS = WAVEINCAPSA
  38265 type PWAVEINCAPS = PWAVEINCAPSA
  38266 type NPWAVEINCAPS = NPWAVEINCAPSA
  38267 type LPWAVEINCAPS = LPWAVEINCAPSA
  38268 
  38269 type tagWAVEINCAPS2A = struct {
  38270 	FwMid             WORD
  38271 	FwPid             WORD
  38272 	FvDriverVersion   MMVERSION
  38273 	FszPname          [32]CHAR
  38274 	FdwFormats        DWORD
  38275 	FwChannels        WORD
  38276 	FwReserved1       WORD
  38277 	FManufacturerGuid GUID
  38278 	FProductGuid      GUID
  38279 	FNameGuid         GUID
  38280 }
  38281 
  38282 type WAVEINCAPS2A = tagWAVEINCAPS2A
  38283 type PWAVEINCAPS2A = uintptr
  38284 type NPWAVEINCAPS2A = uintptr
  38285 type LPWAVEINCAPS2A = uintptr
  38286 
  38287 type tagWAVEINCAPS2W = struct {
  38288 	FwMid             WORD
  38289 	FwPid             WORD
  38290 	FvDriverVersion   MMVERSION
  38291 	FszPname          [32]WCHAR
  38292 	FdwFormats        DWORD
  38293 	FwChannels        WORD
  38294 	FwReserved1       WORD
  38295 	FManufacturerGuid GUID
  38296 	FProductGuid      GUID
  38297 	FNameGuid         GUID
  38298 }
  38299 
  38300 type WAVEINCAPS2W = tagWAVEINCAPS2W
  38301 type PWAVEINCAPS2W = uintptr
  38302 type NPWAVEINCAPS2W = uintptr
  38303 type LPWAVEINCAPS2W = uintptr
  38304 
  38305 type WAVEINCAPS2 = WAVEINCAPS2A
  38306 type PWAVEINCAPS2 = PWAVEINCAPS2A
  38307 type NPWAVEINCAPS2 = NPWAVEINCAPS2A
  38308 type LPWAVEINCAPS2 = LPWAVEINCAPS2A
  38309 
  38310 type waveformat_tag = struct {
  38311 	FwFormatTag      WORD
  38312 	FnChannels       WORD
  38313 	FnSamplesPerSec  DWORD
  38314 	FnAvgBytesPerSec DWORD
  38315 	FnBlockAlign     WORD
  38316 	F__ccgo_pad1     [2]byte
  38317 }
  38318 
  38319 type WAVEFORMAT = waveformat_tag
  38320 type PWAVEFORMAT = uintptr
  38321 type NPWAVEFORMAT = uintptr
  38322 type LPWAVEFORMAT = uintptr
  38323 
  38324 type pcmwaveformat_tag = struct {
  38325 	Fwf             WAVEFORMAT
  38326 	FwBitsPerSample WORD
  38327 	F__ccgo_pad1    [2]byte
  38328 }
  38329 
  38330 type PCMWAVEFORMAT = pcmwaveformat_tag
  38331 type PPCMWAVEFORMAT = uintptr
  38332 type NPPCMWAVEFORMAT = uintptr
  38333 type LPPCMWAVEFORMAT = uintptr
  38334 
  38335 type tWAVEFORMATEX = struct {
  38336 	FwFormatTag      WORD
  38337 	FnChannels       WORD
  38338 	FnSamplesPerSec  DWORD
  38339 	FnAvgBytesPerSec DWORD
  38340 	FnBlockAlign     WORD
  38341 	FwBitsPerSample  WORD
  38342 	FcbSize          WORD
  38343 	F__ccgo_pad1     [2]byte
  38344 }
  38345 
  38346 type WAVEFORMATEX = tWAVEFORMATEX
  38347 type PWAVEFORMATEX = uintptr
  38348 type NPWAVEFORMATEX = uintptr
  38349 type LPWAVEFORMATEX = uintptr
  38350 type LPCWAVEFORMATEX = uintptr
  38351 
  38352 type HMIDI__ = struct{ Funused int32 }
  38353 
  38354 type HMIDI = uintptr
  38355 type HMIDIIN__ = struct{ Funused int32 }
  38356 
  38357 type HMIDIIN = uintptr
  38358 type HMIDIOUT__ = struct{ Funused int32 }
  38359 
  38360 type HMIDIOUT = uintptr
  38361 type HMIDISTRM__ = struct{ Funused int32 }
  38362 
  38363 type HMIDISTRM = uintptr
  38364 type LPHMIDI = uintptr
  38365 type LPHMIDIIN = uintptr
  38366 type LPHMIDIOUT = uintptr
  38367 type LPHMIDISTRM = uintptr
  38368 type LPMIDICALLBACK = uintptr
  38369 type PATCHARRAY = [128]WORD
  38370 type LPPATCHARRAY = uintptr
  38371 type KEYARRAY = [128]WORD
  38372 type LPKEYARRAY = uintptr
  38373 
  38374 type tagMIDIOUTCAPSA = struct {
  38375 	FwMid           WORD
  38376 	FwPid           WORD
  38377 	FvDriverVersion MMVERSION
  38378 	FszPname        [32]CHAR
  38379 	FwTechnology    WORD
  38380 	FwVoices        WORD
  38381 	FwNotes         WORD
  38382 	FwChannelMask   WORD
  38383 	FdwSupport      DWORD
  38384 }
  38385 
  38386 type MIDIOUTCAPSA = tagMIDIOUTCAPSA
  38387 type PMIDIOUTCAPSA = uintptr
  38388 type NPMIDIOUTCAPSA = uintptr
  38389 type LPMIDIOUTCAPSA = uintptr
  38390 
  38391 type tagMIDIOUTCAPSW = struct {
  38392 	FwMid           WORD
  38393 	FwPid           WORD
  38394 	FvDriverVersion MMVERSION
  38395 	FszPname        [32]WCHAR
  38396 	FwTechnology    WORD
  38397 	FwVoices        WORD
  38398 	FwNotes         WORD
  38399 	FwChannelMask   WORD
  38400 	FdwSupport      DWORD
  38401 }
  38402 
  38403 type MIDIOUTCAPSW = tagMIDIOUTCAPSW
  38404 type PMIDIOUTCAPSW = uintptr
  38405 type NPMIDIOUTCAPSW = uintptr
  38406 type LPMIDIOUTCAPSW = uintptr
  38407 
  38408 type MIDIOUTCAPS = MIDIOUTCAPSA
  38409 type PMIDIOUTCAPS = PMIDIOUTCAPSA
  38410 type NPMIDIOUTCAPS = NPMIDIOUTCAPSA
  38411 type LPMIDIOUTCAPS = LPMIDIOUTCAPSA
  38412 
  38413 type tagMIDIOUTCAPS2A = struct {
  38414 	FwMid             WORD
  38415 	FwPid             WORD
  38416 	FvDriverVersion   MMVERSION
  38417 	FszPname          [32]CHAR
  38418 	FwTechnology      WORD
  38419 	FwVoices          WORD
  38420 	FwNotes           WORD
  38421 	FwChannelMask     WORD
  38422 	FdwSupport        DWORD
  38423 	FManufacturerGuid GUID
  38424 	FProductGuid      GUID
  38425 	FNameGuid         GUID
  38426 }
  38427 
  38428 type MIDIOUTCAPS2A = tagMIDIOUTCAPS2A
  38429 type PMIDIOUTCAPS2A = uintptr
  38430 type NPMIDIOUTCAPS2A = uintptr
  38431 type LPMIDIOUTCAPS2A = uintptr
  38432 
  38433 type tagMIDIOUTCAPS2W = struct {
  38434 	FwMid             WORD
  38435 	FwPid             WORD
  38436 	FvDriverVersion   MMVERSION
  38437 	FszPname          [32]WCHAR
  38438 	FwTechnology      WORD
  38439 	FwVoices          WORD
  38440 	FwNotes           WORD
  38441 	FwChannelMask     WORD
  38442 	FdwSupport        DWORD
  38443 	FManufacturerGuid GUID
  38444 	FProductGuid      GUID
  38445 	FNameGuid         GUID
  38446 }
  38447 
  38448 type MIDIOUTCAPS2W = tagMIDIOUTCAPS2W
  38449 type PMIDIOUTCAPS2W = uintptr
  38450 type NPMIDIOUTCAPS2W = uintptr
  38451 type LPMIDIOUTCAPS2W = uintptr
  38452 
  38453 type MIDIOUTCAPS2 = MIDIOUTCAPS2A
  38454 type PMIDIOUTCAPS2 = PMIDIOUTCAPS2A
  38455 type NPMIDIOUTCAPS2 = NPMIDIOUTCAPS2A
  38456 type LPMIDIOUTCAPS2 = LPMIDIOUTCAPS2A
  38457 
  38458 type tagMIDIINCAPSA = struct {
  38459 	FwMid           WORD
  38460 	FwPid           WORD
  38461 	FvDriverVersion MMVERSION
  38462 	FszPname        [32]CHAR
  38463 	FdwSupport      DWORD
  38464 }
  38465 
  38466 type MIDIINCAPSA = tagMIDIINCAPSA
  38467 type PMIDIINCAPSA = uintptr
  38468 type NPMIDIINCAPSA = uintptr
  38469 type LPMIDIINCAPSA = uintptr
  38470 
  38471 type tagMIDIINCAPSW = struct {
  38472 	FwMid           WORD
  38473 	FwPid           WORD
  38474 	FvDriverVersion MMVERSION
  38475 	FszPname        [32]WCHAR
  38476 	FdwSupport      DWORD
  38477 }
  38478 
  38479 type MIDIINCAPSW = tagMIDIINCAPSW
  38480 type PMIDIINCAPSW = uintptr
  38481 type NPMIDIINCAPSW = uintptr
  38482 type LPMIDIINCAPSW = uintptr
  38483 
  38484 type MIDIINCAPS = MIDIINCAPSA
  38485 type PMIDIINCAPS = PMIDIINCAPSA
  38486 type NPMIDIINCAPS = NPMIDIINCAPSA
  38487 type LPMIDIINCAPS = LPMIDIINCAPSA
  38488 
  38489 type tagMIDIINCAPS2A = struct {
  38490 	FwMid             WORD
  38491 	FwPid             WORD
  38492 	FvDriverVersion   MMVERSION
  38493 	FszPname          [32]CHAR
  38494 	FdwSupport        DWORD
  38495 	FManufacturerGuid GUID
  38496 	FProductGuid      GUID
  38497 	FNameGuid         GUID
  38498 }
  38499 
  38500 type MIDIINCAPS2A = tagMIDIINCAPS2A
  38501 type PMIDIINCAPS2A = uintptr
  38502 type NPMIDIINCAPS2A = uintptr
  38503 type LPMIDIINCAPS2A = uintptr
  38504 
  38505 type tagMIDIINCAPS2W = struct {
  38506 	FwMid             WORD
  38507 	FwPid             WORD
  38508 	FvDriverVersion   MMVERSION
  38509 	FszPname          [32]WCHAR
  38510 	FdwSupport        DWORD
  38511 	FManufacturerGuid GUID
  38512 	FProductGuid      GUID
  38513 	FNameGuid         GUID
  38514 }
  38515 
  38516 type MIDIINCAPS2W = tagMIDIINCAPS2W
  38517 type PMIDIINCAPS2W = uintptr
  38518 type NPMIDIINCAPS2W = uintptr
  38519 type LPMIDIINCAPS2W = uintptr
  38520 
  38521 type MIDIINCAPS2 = MIDIINCAPS2A
  38522 type PMIDIINCAPS2 = PMIDIINCAPS2A
  38523 type NPMIDIINCAPS2 = NPMIDIINCAPS2A
  38524 type LPMIDIINCAPS2 = LPMIDIINCAPS2A
  38525 
  38526 type midihdr_tag = struct {
  38527 	FlpData          LPSTR
  38528 	FdwBufferLength  DWORD
  38529 	FdwBytesRecorded DWORD
  38530 	FdwUser          DWORD_PTR
  38531 	FdwFlags         DWORD
  38532 	F__ccgo_pad1     [4]byte
  38533 	FlpNext          uintptr
  38534 	Freserved        DWORD_PTR
  38535 	FdwOffset        DWORD
  38536 	F__ccgo_pad2     [4]byte
  38537 	FdwReserved      [8]DWORD_PTR
  38538 }
  38539 
  38540 type MIDIHDR = midihdr_tag
  38541 type PMIDIHDR = uintptr
  38542 type NPMIDIHDR = uintptr
  38543 type LPMIDIHDR = uintptr
  38544 
  38545 type midievent_tag = struct {
  38546 	FdwDeltaTime DWORD
  38547 	FdwStreamID  DWORD
  38548 	FdwEvent     DWORD
  38549 	FdwParms     [1]DWORD
  38550 }
  38551 
  38552 type MIDIEVENT = midievent_tag
  38553 
  38554 type midistrmbuffver_tag = struct {
  38555 	FdwVersion    DWORD
  38556 	FdwMid        DWORD
  38557 	FdwOEMVersion DWORD
  38558 }
  38559 
  38560 type MIDISTRMBUFFVER = midistrmbuffver_tag
  38561 
  38562 type midiproptimediv_tag = struct {
  38563 	FcbStruct  DWORD
  38564 	FdwTimeDiv DWORD
  38565 }
  38566 
  38567 type MIDIPROPTIMEDIV = midiproptimediv_tag
  38568 type LPMIDIPROPTIMEDIV = uintptr
  38569 
  38570 type midiproptempo_tag = struct {
  38571 	FcbStruct DWORD
  38572 	FdwTempo  DWORD
  38573 }
  38574 
  38575 type MIDIPROPTEMPO = midiproptempo_tag
  38576 type LPMIDIPROPTEMPO = uintptr
  38577 
  38578 type tagAUXCAPSA = struct {
  38579 	FwMid           WORD
  38580 	FwPid           WORD
  38581 	FvDriverVersion MMVERSION
  38582 	FszPname        [32]CHAR
  38583 	FwTechnology    WORD
  38584 	FwReserved1     WORD
  38585 	FdwSupport      DWORD
  38586 }
  38587 
  38588 type AUXCAPSA = tagAUXCAPSA
  38589 type PAUXCAPSA = uintptr
  38590 type NPAUXCAPSA = uintptr
  38591 type LPAUXCAPSA = uintptr
  38592 
  38593 type tagAUXCAPSW = struct {
  38594 	FwMid           WORD
  38595 	FwPid           WORD
  38596 	FvDriverVersion MMVERSION
  38597 	FszPname        [32]WCHAR
  38598 	FwTechnology    WORD
  38599 	FwReserved1     WORD
  38600 	FdwSupport      DWORD
  38601 }
  38602 
  38603 type AUXCAPSW = tagAUXCAPSW
  38604 type PAUXCAPSW = uintptr
  38605 type NPAUXCAPSW = uintptr
  38606 type LPAUXCAPSW = uintptr
  38607 
  38608 type AUXCAPS = AUXCAPSA
  38609 type PAUXCAPS = PAUXCAPSA
  38610 type NPAUXCAPS = NPAUXCAPSA
  38611 type LPAUXCAPS = LPAUXCAPSA
  38612 
  38613 type tagAUXCAPS2A = struct {
  38614 	FwMid             WORD
  38615 	FwPid             WORD
  38616 	FvDriverVersion   MMVERSION
  38617 	FszPname          [32]CHAR
  38618 	FwTechnology      WORD
  38619 	FwReserved1       WORD
  38620 	FdwSupport        DWORD
  38621 	FManufacturerGuid GUID
  38622 	FProductGuid      GUID
  38623 	FNameGuid         GUID
  38624 }
  38625 
  38626 type AUXCAPS2A = tagAUXCAPS2A
  38627 type PAUXCAPS2A = uintptr
  38628 type NPAUXCAPS2A = uintptr
  38629 type LPAUXCAPS2A = uintptr
  38630 
  38631 type tagAUXCAPS2W = struct {
  38632 	FwMid             WORD
  38633 	FwPid             WORD
  38634 	FvDriverVersion   MMVERSION
  38635 	FszPname          [32]WCHAR
  38636 	FwTechnology      WORD
  38637 	FwReserved1       WORD
  38638 	FdwSupport        DWORD
  38639 	FManufacturerGuid GUID
  38640 	FProductGuid      GUID
  38641 	FNameGuid         GUID
  38642 }
  38643 
  38644 type AUXCAPS2W = tagAUXCAPS2W
  38645 type PAUXCAPS2W = uintptr
  38646 type NPAUXCAPS2W = uintptr
  38647 type LPAUXCAPS2W = uintptr
  38648 
  38649 type AUXCAPS2 = AUXCAPS2A
  38650 type PAUXCAPS2 = PAUXCAPS2A
  38651 type NPAUXCAPS2 = NPAUXCAPS2A
  38652 type LPAUXCAPS2 = LPAUXCAPS2A
  38653 
  38654 type HMIXEROBJ__ = struct{ Funused int32 }
  38655 
  38656 type HMIXEROBJ = uintptr
  38657 type LPHMIXEROBJ = uintptr
  38658 
  38659 type HMIXER__ = struct{ Funused int32 }
  38660 
  38661 type HMIXER = uintptr
  38662 type LPHMIXER = uintptr
  38663 
  38664 type tagMIXERCAPSA = struct {
  38665 	FwMid           WORD
  38666 	FwPid           WORD
  38667 	FvDriverVersion MMVERSION
  38668 	FszPname        [32]CHAR
  38669 	FfdwSupport     DWORD
  38670 	FcDestinations  DWORD
  38671 }
  38672 
  38673 type MIXERCAPSA = tagMIXERCAPSA
  38674 type PMIXERCAPSA = uintptr
  38675 type LPMIXERCAPSA = uintptr
  38676 
  38677 type tagMIXERCAPSW = struct {
  38678 	FwMid           WORD
  38679 	FwPid           WORD
  38680 	FvDriverVersion MMVERSION
  38681 	FszPname        [32]WCHAR
  38682 	FfdwSupport     DWORD
  38683 	FcDestinations  DWORD
  38684 }
  38685 
  38686 type MIXERCAPSW = tagMIXERCAPSW
  38687 type PMIXERCAPSW = uintptr
  38688 type LPMIXERCAPSW = uintptr
  38689 
  38690 type MIXERCAPS = MIXERCAPSA
  38691 type PMIXERCAPS = PMIXERCAPSA
  38692 type LPMIXERCAPS = LPMIXERCAPSA
  38693 
  38694 type tagMIXERCAPS2A = struct {
  38695 	FwMid             WORD
  38696 	FwPid             WORD
  38697 	FvDriverVersion   MMVERSION
  38698 	FszPname          [32]CHAR
  38699 	FfdwSupport       DWORD
  38700 	FcDestinations    DWORD
  38701 	FManufacturerGuid GUID
  38702 	FProductGuid      GUID
  38703 	FNameGuid         GUID
  38704 }
  38705 
  38706 type MIXERCAPS2A = tagMIXERCAPS2A
  38707 type PMIXERCAPS2A = uintptr
  38708 type LPMIXERCAPS2A = uintptr
  38709 
  38710 type tagMIXERCAPS2W = struct {
  38711 	FwMid             WORD
  38712 	FwPid             WORD
  38713 	FvDriverVersion   MMVERSION
  38714 	FszPname          [32]WCHAR
  38715 	FfdwSupport       DWORD
  38716 	FcDestinations    DWORD
  38717 	FManufacturerGuid GUID
  38718 	FProductGuid      GUID
  38719 	FNameGuid         GUID
  38720 }
  38721 
  38722 type MIXERCAPS2W = tagMIXERCAPS2W
  38723 type PMIXERCAPS2W = uintptr
  38724 type LPMIXERCAPS2W = uintptr
  38725 
  38726 type MIXERCAPS2 = MIXERCAPS2A
  38727 type PMIXERCAPS2 = PMIXERCAPS2A
  38728 type LPMIXERCAPS2 = LPMIXERCAPS2A
  38729 
  38730 type tagMIXERLINEA = struct {
  38731 	FcbStruct        DWORD
  38732 	FdwDestination   DWORD
  38733 	FdwSource        DWORD
  38734 	FdwLineID        DWORD
  38735 	FfdwLine         DWORD
  38736 	F__ccgo_pad1     [4]byte
  38737 	FdwUser          DWORD_PTR
  38738 	FdwComponentType DWORD
  38739 	FcChannels       DWORD
  38740 	FcConnections    DWORD
  38741 	FcControls       DWORD
  38742 	FszShortName     [16]CHAR
  38743 	FszName          [64]CHAR
  38744 	FTarget          struct {
  38745 		FdwType         DWORD
  38746 		FdwDeviceID     DWORD
  38747 		FwMid           WORD
  38748 		FwPid           WORD
  38749 		FvDriverVersion MMVERSION
  38750 		FszPname        [32]CHAR
  38751 	}
  38752 }
  38753 
  38754 type MIXERLINEA = tagMIXERLINEA
  38755 type PMIXERLINEA = uintptr
  38756 type LPMIXERLINEA = uintptr
  38757 
  38758 type tagMIXERLINEW = struct {
  38759 	FcbStruct        DWORD
  38760 	FdwDestination   DWORD
  38761 	FdwSource        DWORD
  38762 	FdwLineID        DWORD
  38763 	FfdwLine         DWORD
  38764 	F__ccgo_pad1     [4]byte
  38765 	FdwUser          DWORD_PTR
  38766 	FdwComponentType DWORD
  38767 	FcChannels       DWORD
  38768 	FcConnections    DWORD
  38769 	FcControls       DWORD
  38770 	FszShortName     [16]WCHAR
  38771 	FszName          [64]WCHAR
  38772 	FTarget          struct {
  38773 		FdwType         DWORD
  38774 		FdwDeviceID     DWORD
  38775 		FwMid           WORD
  38776 		FwPid           WORD
  38777 		FvDriverVersion MMVERSION
  38778 		FszPname        [32]WCHAR
  38779 	}
  38780 }
  38781 
  38782 type MIXERLINEW = tagMIXERLINEW
  38783 type PMIXERLINEW = uintptr
  38784 type LPMIXERLINEW = uintptr
  38785 
  38786 type MIXERLINE = MIXERLINEA
  38787 type PMIXERLINE = PMIXERLINEA
  38788 type LPMIXERLINE = LPMIXERLINEA
  38789 
  38790 type tagMIXERCONTROLA = struct {
  38791 	FcbStruct       DWORD
  38792 	FdwControlID    DWORD
  38793 	FdwControlType  DWORD
  38794 	FfdwControl     DWORD
  38795 	FcMultipleItems DWORD
  38796 	FszShortName    [16]CHAR
  38797 	FszName         [64]CHAR
  38798 	FBounds         struct {
  38799 		Fs struct {
  38800 			FlMinimum LONG
  38801 			FlMaximum LONG
  38802 		}
  38803 		F__ccgo_pad1 [16]byte
  38804 	}
  38805 	FMetrics struct {
  38806 		FcSteps      DWORD
  38807 		F__ccgo_pad1 [20]byte
  38808 	}
  38809 }
  38810 
  38811 type MIXERCONTROLA = tagMIXERCONTROLA
  38812 type PMIXERCONTROLA = uintptr
  38813 type LPMIXERCONTROLA = uintptr
  38814 
  38815 type tagMIXERCONTROLW = struct {
  38816 	FcbStruct       DWORD
  38817 	FdwControlID    DWORD
  38818 	FdwControlType  DWORD
  38819 	FfdwControl     DWORD
  38820 	FcMultipleItems DWORD
  38821 	FszShortName    [16]WCHAR
  38822 	FszName         [64]WCHAR
  38823 	FBounds         struct {
  38824 		Fs struct {
  38825 			FlMinimum LONG
  38826 			FlMaximum LONG
  38827 		}
  38828 		F__ccgo_pad1 [16]byte
  38829 	}
  38830 	FMetrics struct {
  38831 		FcSteps      DWORD
  38832 		F__ccgo_pad1 [20]byte
  38833 	}
  38834 }
  38835 
  38836 type MIXERCONTROLW = tagMIXERCONTROLW
  38837 type PMIXERCONTROLW = uintptr
  38838 type LPMIXERCONTROLW = uintptr
  38839 
  38840 type MIXERCONTROL = MIXERCONTROLA
  38841 type PMIXERCONTROL = PMIXERCONTROLA
  38842 type LPMIXERCONTROL = LPMIXERCONTROLA
  38843 
  38844 type tagMIXERLINECONTROLSA = struct {
  38845 	FcbStruct    DWORD
  38846 	FdwLineID    DWORD
  38847 	Fu           struct{ FdwControlID DWORD }
  38848 	FcControls   DWORD
  38849 	Fcbmxctrl    DWORD
  38850 	F__ccgo_pad1 [4]byte
  38851 	Fpamxctrl    LPMIXERCONTROLA
  38852 }
  38853 
  38854 type MIXERLINECONTROLSA = tagMIXERLINECONTROLSA
  38855 type PMIXERLINECONTROLSA = uintptr
  38856 type LPMIXERLINECONTROLSA = uintptr
  38857 
  38858 type tagMIXERLINECONTROLSW = struct {
  38859 	FcbStruct    DWORD
  38860 	FdwLineID    DWORD
  38861 	Fu           struct{ FdwControlID DWORD }
  38862 	FcControls   DWORD
  38863 	Fcbmxctrl    DWORD
  38864 	F__ccgo_pad1 [4]byte
  38865 	Fpamxctrl    LPMIXERCONTROLW
  38866 }
  38867 
  38868 type MIXERLINECONTROLSW = tagMIXERLINECONTROLSW
  38869 type PMIXERLINECONTROLSW = uintptr
  38870 type LPMIXERLINECONTROLSW = uintptr
  38871 
  38872 type MIXERLINECONTROLS = MIXERLINECONTROLSA
  38873 type PMIXERLINECONTROLS = PMIXERLINECONTROLSA
  38874 type LPMIXERLINECONTROLS = LPMIXERLINECONTROLSA
  38875 
  38876 type tMIXERCONTROLDETAILS = struct {
  38877 	FcbStruct    DWORD
  38878 	FdwControlID DWORD
  38879 	FcChannels   DWORD
  38880 	F__ccgo_pad1 [4]byte
  38881 	Fu           struct{ FhwndOwner HWND }
  38882 	FcbDetails   DWORD
  38883 	F__ccgo_pad2 [4]byte
  38884 	FpaDetails   LPVOID
  38885 }
  38886 
  38887 type MIXERCONTROLDETAILS = tMIXERCONTROLDETAILS
  38888 type PMIXERCONTROLDETAILS = uintptr
  38889 type LPMIXERCONTROLDETAILS = uintptr
  38890 
  38891 type tagMIXERCONTROLDETAILS_LISTTEXTA = struct {
  38892 	FdwParam1 DWORD
  38893 	FdwParam2 DWORD
  38894 	FszName   [64]CHAR
  38895 }
  38896 
  38897 type MIXERCONTROLDETAILS_LISTTEXTA = tagMIXERCONTROLDETAILS_LISTTEXTA
  38898 type PMIXERCONTROLDETAILS_LISTTEXTA = uintptr
  38899 type LPMIXERCONTROLDETAILS_LISTTEXTA = uintptr
  38900 type tagMIXERCONTROLDETAILS_LISTTEXTW = struct {
  38901 	FdwParam1 DWORD
  38902 	FdwParam2 DWORD
  38903 	FszName   [64]WCHAR
  38904 }
  38905 
  38906 type MIXERCONTROLDETAILS_LISTTEXTW = tagMIXERCONTROLDETAILS_LISTTEXTW
  38907 type PMIXERCONTROLDETAILS_LISTTEXTW = uintptr
  38908 type LPMIXERCONTROLDETAILS_LISTTEXTW = uintptr
  38909 
  38910 type MIXERCONTROLDETAILS_LISTTEXT = MIXERCONTROLDETAILS_LISTTEXTA
  38911 type PMIXERCONTROLDETAILS_LISTTEXT = PMIXERCONTROLDETAILS_LISTTEXTA
  38912 type LPMIXERCONTROLDETAILS_LISTTEXT = LPMIXERCONTROLDETAILS_LISTTEXTA
  38913 
  38914 type tMIXERCONTROLDETAILS_BOOLEAN = struct{ FfValue LONG }
  38915 
  38916 type MIXERCONTROLDETAILS_BOOLEAN = tMIXERCONTROLDETAILS_BOOLEAN
  38917 type PMIXERCONTROLDETAILS_BOOLEAN = uintptr
  38918 type LPMIXERCONTROLDETAILS_BOOLEAN = uintptr
  38919 
  38920 type tMIXERCONTROLDETAILS_SIGNED = struct{ FlValue LONG }
  38921 
  38922 type MIXERCONTROLDETAILS_SIGNED = tMIXERCONTROLDETAILS_SIGNED
  38923 type PMIXERCONTROLDETAILS_SIGNED = uintptr
  38924 type LPMIXERCONTROLDETAILS_SIGNED = uintptr
  38925 
  38926 type tMIXERCONTROLDETAILS_UNSIGNED = struct{ FdwValue DWORD }
  38927 
  38928 type MIXERCONTROLDETAILS_UNSIGNED = tMIXERCONTROLDETAILS_UNSIGNED
  38929 type PMIXERCONTROLDETAILS_UNSIGNED = uintptr
  38930 type LPMIXERCONTROLDETAILS_UNSIGNED = uintptr
  38931 type LPTIMECALLBACK = uintptr
  38932 
  38933 type timecaps_tag = struct {
  38934 	FwPeriodMin UINT
  38935 	FwPeriodMax UINT
  38936 }
  38937 
  38938 type TIMECAPS = timecaps_tag
  38939 type PTIMECAPS = uintptr
  38940 type NPTIMECAPS = uintptr
  38941 type LPTIMECAPS = uintptr
  38942 
  38943 type tagJOYCAPSA = struct {
  38944 	FwMid        WORD
  38945 	FwPid        WORD
  38946 	FszPname     [32]CHAR
  38947 	FwXmin       UINT
  38948 	FwXmax       UINT
  38949 	FwYmin       UINT
  38950 	FwYmax       UINT
  38951 	FwZmin       UINT
  38952 	FwZmax       UINT
  38953 	FwNumButtons UINT
  38954 	FwPeriodMin  UINT
  38955 	FwPeriodMax  UINT
  38956 	FwRmin       UINT
  38957 	FwRmax       UINT
  38958 	FwUmin       UINT
  38959 	FwUmax       UINT
  38960 	FwVmin       UINT
  38961 	FwVmax       UINT
  38962 	FwCaps       UINT
  38963 	FwMaxAxes    UINT
  38964 	FwNumAxes    UINT
  38965 	FwMaxButtons UINT
  38966 	FszRegKey    [32]CHAR
  38967 	FszOEMVxD    [260]CHAR
  38968 }
  38969 
  38970 type JOYCAPSA = tagJOYCAPSA
  38971 type PJOYCAPSA = uintptr
  38972 type NPJOYCAPSA = uintptr
  38973 type LPJOYCAPSA = uintptr
  38974 
  38975 type tagJOYCAPSW = struct {
  38976 	FwMid        WORD
  38977 	FwPid        WORD
  38978 	FszPname     [32]WCHAR
  38979 	FwXmin       UINT
  38980 	FwXmax       UINT
  38981 	FwYmin       UINT
  38982 	FwYmax       UINT
  38983 	FwZmin       UINT
  38984 	FwZmax       UINT
  38985 	FwNumButtons UINT
  38986 	FwPeriodMin  UINT
  38987 	FwPeriodMax  UINT
  38988 	FwRmin       UINT
  38989 	FwRmax       UINT
  38990 	FwUmin       UINT
  38991 	FwUmax       UINT
  38992 	FwVmin       UINT
  38993 	FwVmax       UINT
  38994 	FwCaps       UINT
  38995 	FwMaxAxes    UINT
  38996 	FwNumAxes    UINT
  38997 	FwMaxButtons UINT
  38998 	FszRegKey    [32]WCHAR
  38999 	FszOEMVxD    [260]WCHAR
  39000 }
  39001 
  39002 type JOYCAPSW = tagJOYCAPSW
  39003 type PJOYCAPSW = uintptr
  39004 type NPJOYCAPSW = uintptr
  39005 type LPJOYCAPSW = uintptr
  39006 
  39007 type JOYCAPS = JOYCAPSA
  39008 type PJOYCAPS = PJOYCAPSA
  39009 type NPJOYCAPS = NPJOYCAPSA
  39010 type LPJOYCAPS = LPJOYCAPSA
  39011 
  39012 type tagJOYCAPS2A = struct {
  39013 	FwMid             WORD
  39014 	FwPid             WORD
  39015 	FszPname          [32]CHAR
  39016 	FwXmin            UINT
  39017 	FwXmax            UINT
  39018 	FwYmin            UINT
  39019 	FwYmax            UINT
  39020 	FwZmin            UINT
  39021 	FwZmax            UINT
  39022 	FwNumButtons      UINT
  39023 	FwPeriodMin       UINT
  39024 	FwPeriodMax       UINT
  39025 	FwRmin            UINT
  39026 	FwRmax            UINT
  39027 	FwUmin            UINT
  39028 	FwUmax            UINT
  39029 	FwVmin            UINT
  39030 	FwVmax            UINT
  39031 	FwCaps            UINT
  39032 	FwMaxAxes         UINT
  39033 	FwNumAxes         UINT
  39034 	FwMaxButtons      UINT
  39035 	FszRegKey         [32]CHAR
  39036 	FszOEMVxD         [260]CHAR
  39037 	FManufacturerGuid GUID
  39038 	FProductGuid      GUID
  39039 	FNameGuid         GUID
  39040 }
  39041 
  39042 type JOYCAPS2A = tagJOYCAPS2A
  39043 type PJOYCAPS2A = uintptr
  39044 type NPJOYCAPS2A = uintptr
  39045 type LPJOYCAPS2A = uintptr
  39046 
  39047 type tagJOYCAPS2W = struct {
  39048 	FwMid             WORD
  39049 	FwPid             WORD
  39050 	FszPname          [32]WCHAR
  39051 	FwXmin            UINT
  39052 	FwXmax            UINT
  39053 	FwYmin            UINT
  39054 	FwYmax            UINT
  39055 	FwZmin            UINT
  39056 	FwZmax            UINT
  39057 	FwNumButtons      UINT
  39058 	FwPeriodMin       UINT
  39059 	FwPeriodMax       UINT
  39060 	FwRmin            UINT
  39061 	FwRmax            UINT
  39062 	FwUmin            UINT
  39063 	FwUmax            UINT
  39064 	FwVmin            UINT
  39065 	FwVmax            UINT
  39066 	FwCaps            UINT
  39067 	FwMaxAxes         UINT
  39068 	FwNumAxes         UINT
  39069 	FwMaxButtons      UINT
  39070 	FszRegKey         [32]WCHAR
  39071 	FszOEMVxD         [260]WCHAR
  39072 	FManufacturerGuid GUID
  39073 	FProductGuid      GUID
  39074 	FNameGuid         GUID
  39075 }
  39076 
  39077 type JOYCAPS2W = tagJOYCAPS2W
  39078 type PJOYCAPS2W = uintptr
  39079 type NPJOYCAPS2W = uintptr
  39080 type LPJOYCAPS2W = uintptr
  39081 
  39082 type JOYCAPS2 = JOYCAPS2A
  39083 type PJOYCAPS2 = PJOYCAPS2A
  39084 type NPJOYCAPS2 = NPJOYCAPS2A
  39085 type LPJOYCAPS2 = LPJOYCAPS2A
  39086 
  39087 type joyinfo_tag = struct {
  39088 	FwXpos    UINT
  39089 	FwYpos    UINT
  39090 	FwZpos    UINT
  39091 	FwButtons UINT
  39092 }
  39093 
  39094 type JOYINFO = joyinfo_tag
  39095 type PJOYINFO = uintptr
  39096 type NPJOYINFO = uintptr
  39097 type LPJOYINFO = uintptr
  39098 
  39099 type joyinfoex_tag = struct {
  39100 	FdwSize         DWORD
  39101 	FdwFlags        DWORD
  39102 	FdwXpos         DWORD
  39103 	FdwYpos         DWORD
  39104 	FdwZpos         DWORD
  39105 	FdwRpos         DWORD
  39106 	FdwUpos         DWORD
  39107 	FdwVpos         DWORD
  39108 	FdwButtons      DWORD
  39109 	FdwButtonNumber DWORD
  39110 	FdwPOV          DWORD
  39111 	FdwReserved1    DWORD
  39112 	FdwReserved2    DWORD
  39113 }
  39114 
  39115 type JOYINFOEX = joyinfoex_tag
  39116 type PJOYINFOEX = uintptr
  39117 type NPJOYINFOEX = uintptr
  39118 type LPJOYINFOEX = uintptr
  39119 
  39120 type FOURCC = DWORD
  39121 type HPSTR = uintptr
  39122 type HMMIO__ = struct{ Funused int32 }
  39123 
  39124 type HMMIO = uintptr
  39125 type LPMMIOPROC = uintptr
  39126 
  39127 type _MMIOINFO = struct {
  39128 	FdwFlags     DWORD
  39129 	FfccIOProc   FOURCC
  39130 	FpIOProc     LPMMIOPROC
  39131 	FwErrorRet   UINT
  39132 	F__ccgo_pad1 [4]byte
  39133 	Fhtask       HTASK
  39134 	FcchBuffer   LONG
  39135 	F__ccgo_pad2 [4]byte
  39136 	FpchBuffer   HPSTR
  39137 	FpchNext     HPSTR
  39138 	FpchEndRead  HPSTR
  39139 	FpchEndWrite HPSTR
  39140 	FlBufOffset  LONG
  39141 	FlDiskOffset LONG
  39142 	FadwInfo     [3]DWORD
  39143 	FdwReserved1 DWORD
  39144 	FdwReserved2 DWORD
  39145 	F__ccgo_pad3 [4]byte
  39146 	Fhmmio       HMMIO
  39147 }
  39148 
  39149 type MMIOINFO = _MMIOINFO
  39150 type PMMIOINFO = uintptr
  39151 type NPMMIOINFO = uintptr
  39152 type LPMMIOINFO = uintptr
  39153 
  39154 type LPCMMIOINFO = uintptr
  39155 
  39156 type _MMCKINFO = struct {
  39157 	Fckid         FOURCC
  39158 	Fcksize       DWORD
  39159 	FfccType      FOURCC
  39160 	FdwDataOffset DWORD
  39161 	FdwFlags      DWORD
  39162 }
  39163 
  39164 type MMCKINFO = _MMCKINFO
  39165 type PMMCKINFO = uintptr
  39166 type NPMMCKINFO = uintptr
  39167 type LPMMCKINFO = uintptr
  39168 
  39169 type LPCMMCKINFO = uintptr
  39170 
  39171 type MCIERROR = DWORD
  39172 
  39173 type MCIDEVICEID = UINT
  39174 
  39175 type YIELDPROC = uintptr
  39176 
  39177 type tagMCI_GENERIC_PARMS = struct{ FdwCallback DWORD_PTR }
  39178 
  39179 type MCI_GENERIC_PARMS = tagMCI_GENERIC_PARMS
  39180 type PMCI_GENERIC_PARMS = uintptr
  39181 type LPMCI_GENERIC_PARMS = uintptr
  39182 
  39183 type tagMCI_OPEN_PARMSA = struct {
  39184 	FdwCallback       DWORD_PTR
  39185 	FwDeviceID        MCIDEVICEID
  39186 	F__ccgo_pad1      [4]byte
  39187 	FlpstrDeviceType  LPCSTR
  39188 	FlpstrElementName LPCSTR
  39189 	FlpstrAlias       LPCSTR
  39190 }
  39191 
  39192 type MCI_OPEN_PARMSA = tagMCI_OPEN_PARMSA
  39193 type PMCI_OPEN_PARMSA = uintptr
  39194 type LPMCI_OPEN_PARMSA = uintptr
  39195 
  39196 type tagMCI_OPEN_PARMSW = struct {
  39197 	FdwCallback       DWORD_PTR
  39198 	FwDeviceID        MCIDEVICEID
  39199 	F__ccgo_pad1      [4]byte
  39200 	FlpstrDeviceType  LPCWSTR
  39201 	FlpstrElementName LPCWSTR
  39202 	FlpstrAlias       LPCWSTR
  39203 }
  39204 
  39205 type MCI_OPEN_PARMSW = tagMCI_OPEN_PARMSW
  39206 type PMCI_OPEN_PARMSW = uintptr
  39207 type LPMCI_OPEN_PARMSW = uintptr
  39208 
  39209 type MCI_OPEN_PARMS = MCI_OPEN_PARMSA
  39210 type PMCI_OPEN_PARMS = PMCI_OPEN_PARMSA
  39211 type LPMCI_OPEN_PARMS = LPMCI_OPEN_PARMSA
  39212 
  39213 type tagMCI_PLAY_PARMS = struct {
  39214 	FdwCallback DWORD_PTR
  39215 	FdwFrom     DWORD
  39216 	FdwTo       DWORD
  39217 }
  39218 
  39219 type MCI_PLAY_PARMS = tagMCI_PLAY_PARMS
  39220 type PMCI_PLAY_PARMS = uintptr
  39221 type LPMCI_PLAY_PARMS = uintptr
  39222 
  39223 type tagMCI_SEEK_PARMS = struct {
  39224 	FdwCallback  DWORD_PTR
  39225 	FdwTo        DWORD
  39226 	F__ccgo_pad1 [4]byte
  39227 }
  39228 
  39229 type MCI_SEEK_PARMS = tagMCI_SEEK_PARMS
  39230 type PMCI_SEEK_PARMS = uintptr
  39231 type LPMCI_SEEK_PARMS = uintptr
  39232 
  39233 type tagMCI_STATUS_PARMS = struct {
  39234 	FdwCallback DWORD_PTR
  39235 	FdwReturn   DWORD_PTR
  39236 	FdwItem     DWORD
  39237 	FdwTrack    DWORD
  39238 }
  39239 
  39240 type MCI_STATUS_PARMS = tagMCI_STATUS_PARMS
  39241 type PMCI_STATUS_PARMS = uintptr
  39242 type LPMCI_STATUS_PARMS = uintptr
  39243 
  39244 type tagMCI_INFO_PARMSA = struct {
  39245 	FdwCallback  DWORD_PTR
  39246 	FlpstrReturn LPSTR
  39247 	FdwRetSize   DWORD
  39248 	F__ccgo_pad1 [4]byte
  39249 }
  39250 
  39251 type MCI_INFO_PARMSA = tagMCI_INFO_PARMSA
  39252 type LPMCI_INFO_PARMSA = uintptr
  39253 type tagMCI_INFO_PARMSW = struct {
  39254 	FdwCallback  DWORD_PTR
  39255 	FlpstrReturn LPWSTR
  39256 	FdwRetSize   DWORD
  39257 	F__ccgo_pad1 [4]byte
  39258 }
  39259 
  39260 type MCI_INFO_PARMSW = tagMCI_INFO_PARMSW
  39261 type LPMCI_INFO_PARMSW = uintptr
  39262 
  39263 type MCI_INFO_PARMS = MCI_INFO_PARMSA
  39264 type LPMCI_INFO_PARMS = LPMCI_INFO_PARMSA
  39265 
  39266 type tagMCI_GETDEVCAPS_PARMS = struct {
  39267 	FdwCallback DWORD_PTR
  39268 	FdwReturn   DWORD
  39269 	FdwItem     DWORD
  39270 }
  39271 
  39272 type MCI_GETDEVCAPS_PARMS = tagMCI_GETDEVCAPS_PARMS
  39273 type PMCI_GETDEVCAPS_PARMS = uintptr
  39274 type LPMCI_GETDEVCAPS_PARMS = uintptr
  39275 
  39276 type tagMCI_SYSINFO_PARMSA = struct {
  39277 	FdwCallback  DWORD_PTR
  39278 	FlpstrReturn LPSTR
  39279 	FdwRetSize   DWORD
  39280 	FdwNumber    DWORD
  39281 	FwDeviceType UINT
  39282 	F__ccgo_pad1 [4]byte
  39283 }
  39284 
  39285 type MCI_SYSINFO_PARMSA = tagMCI_SYSINFO_PARMSA
  39286 type PMCI_SYSINFO_PARMSA = uintptr
  39287 type LPMCI_SYSINFO_PARMSA = uintptr
  39288 
  39289 type tagMCI_SYSINFO_PARMSW = struct {
  39290 	FdwCallback  DWORD_PTR
  39291 	FlpstrReturn LPWSTR
  39292 	FdwRetSize   DWORD
  39293 	FdwNumber    DWORD
  39294 	FwDeviceType UINT
  39295 	F__ccgo_pad1 [4]byte
  39296 }
  39297 
  39298 type MCI_SYSINFO_PARMSW = tagMCI_SYSINFO_PARMSW
  39299 type PMCI_SYSINFO_PARMSW = uintptr
  39300 type LPMCI_SYSINFO_PARMSW = uintptr
  39301 
  39302 type MCI_SYSINFO_PARMS = MCI_SYSINFO_PARMSA
  39303 type PMCI_SYSINFO_PARMS = PMCI_SYSINFO_PARMSA
  39304 type LPMCI_SYSINFO_PARMS = LPMCI_SYSINFO_PARMSA
  39305 
  39306 type tagMCI_SET_PARMS = struct {
  39307 	FdwCallback   DWORD_PTR
  39308 	FdwTimeFormat DWORD
  39309 	FdwAudio      DWORD
  39310 }
  39311 
  39312 type MCI_SET_PARMS = tagMCI_SET_PARMS
  39313 type PMCI_SET_PARMS = uintptr
  39314 type LPMCI_SET_PARMS = uintptr
  39315 
  39316 type tagMCI_BREAK_PARMS = struct {
  39317 	FdwCallback  DWORD_PTR
  39318 	FnVirtKey    int32
  39319 	F__ccgo_pad1 [4]byte
  39320 	FhwndBreak   HWND
  39321 }
  39322 
  39323 type MCI_BREAK_PARMS = tagMCI_BREAK_PARMS
  39324 type PMCI_BREAK_PARMS = uintptr
  39325 type LPMCI_BREAK_PARMS = uintptr
  39326 
  39327 type tagMCI_SAVE_PARMSA = struct {
  39328 	FdwCallback DWORD_PTR
  39329 	Flpfilename LPCSTR
  39330 }
  39331 
  39332 type MCI_SAVE_PARMSA = tagMCI_SAVE_PARMSA
  39333 type PMCI_SAVE_PARMSA = uintptr
  39334 type LPMCI_SAVE_PARMSA = uintptr
  39335 
  39336 type tagMCI_SAVE_PARMSW = struct {
  39337 	FdwCallback DWORD_PTR
  39338 	Flpfilename LPCWSTR
  39339 }
  39340 
  39341 type MCI_SAVE_PARMSW = tagMCI_SAVE_PARMSW
  39342 type PMCI_SAVE_PARMSW = uintptr
  39343 type LPMCI_SAVE_PARMSW = uintptr
  39344 
  39345 type MCI_SAVE_PARMS = MCI_SAVE_PARMSA
  39346 type PMCI_SAVE_PARMS = PMCI_SAVE_PARMSA
  39347 type LPMCI_SAVE_PARMS = LPMCI_SAVE_PARMSA
  39348 
  39349 type tagMCI_LOAD_PARMSA = struct {
  39350 	FdwCallback DWORD_PTR
  39351 	Flpfilename LPCSTR
  39352 }
  39353 
  39354 type MCI_LOAD_PARMSA = tagMCI_LOAD_PARMSA
  39355 type PMCI_LOAD_PARMSA = uintptr
  39356 type LPMCI_LOAD_PARMSA = uintptr
  39357 
  39358 type tagMCI_LOAD_PARMSW = struct {
  39359 	FdwCallback DWORD_PTR
  39360 	Flpfilename LPCWSTR
  39361 }
  39362 
  39363 type MCI_LOAD_PARMSW = tagMCI_LOAD_PARMSW
  39364 type PMCI_LOAD_PARMSW = uintptr
  39365 type LPMCI_LOAD_PARMSW = uintptr
  39366 
  39367 type MCI_LOAD_PARMS = MCI_LOAD_PARMSA
  39368 type PMCI_LOAD_PARMS = PMCI_LOAD_PARMSA
  39369 type LPMCI_LOAD_PARMS = LPMCI_LOAD_PARMSA
  39370 
  39371 type tagMCI_RECORD_PARMS = struct {
  39372 	FdwCallback DWORD_PTR
  39373 	FdwFrom     DWORD
  39374 	FdwTo       DWORD
  39375 }
  39376 
  39377 type MCI_RECORD_PARMS = tagMCI_RECORD_PARMS
  39378 type LPMCI_RECORD_PARMS = uintptr
  39379 
  39380 type tagMCI_VD_PLAY_PARMS = struct {
  39381 	FdwCallback  DWORD_PTR
  39382 	FdwFrom      DWORD
  39383 	FdwTo        DWORD
  39384 	FdwSpeed     DWORD
  39385 	F__ccgo_pad1 [4]byte
  39386 }
  39387 
  39388 type MCI_VD_PLAY_PARMS = tagMCI_VD_PLAY_PARMS
  39389 type PMCI_VD_PLAY_PARMS = uintptr
  39390 type LPMCI_VD_PLAY_PARMS = uintptr
  39391 
  39392 type tagMCI_VD_STEP_PARMS = struct {
  39393 	FdwCallback  DWORD_PTR
  39394 	FdwFrames    DWORD
  39395 	F__ccgo_pad1 [4]byte
  39396 }
  39397 
  39398 type MCI_VD_STEP_PARMS = tagMCI_VD_STEP_PARMS
  39399 type PMCI_VD_STEP_PARMS = uintptr
  39400 type LPMCI_VD_STEP_PARMS = uintptr
  39401 
  39402 type tagMCI_VD_ESCAPE_PARMSA = struct {
  39403 	FdwCallback   DWORD_PTR
  39404 	FlpstrCommand LPCSTR
  39405 }
  39406 
  39407 type MCI_VD_ESCAPE_PARMSA = tagMCI_VD_ESCAPE_PARMSA
  39408 type PMCI_VD_ESCAPE_PARMSA = uintptr
  39409 type LPMCI_VD_ESCAPE_PARMSA = uintptr
  39410 
  39411 type tagMCI_VD_ESCAPE_PARMSW = struct {
  39412 	FdwCallback   DWORD_PTR
  39413 	FlpstrCommand LPCWSTR
  39414 }
  39415 
  39416 type MCI_VD_ESCAPE_PARMSW = tagMCI_VD_ESCAPE_PARMSW
  39417 type PMCI_VD_ESCAPE_PARMSW = uintptr
  39418 type LPMCI_VD_ESCAPE_PARMSW = uintptr
  39419 
  39420 type MCI_VD_ESCAPE_PARMS = MCI_VD_ESCAPE_PARMSA
  39421 type PMCI_VD_ESCAPE_PARMS = PMCI_VD_ESCAPE_PARMSA
  39422 type LPMCI_VD_ESCAPE_PARMS = LPMCI_VD_ESCAPE_PARMSA
  39423 
  39424 type tagMCI_WAVE_OPEN_PARMSA = struct {
  39425 	FdwCallback       DWORD_PTR
  39426 	FwDeviceID        MCIDEVICEID
  39427 	F__ccgo_pad1      [4]byte
  39428 	FlpstrDeviceType  LPCSTR
  39429 	FlpstrElementName LPCSTR
  39430 	FlpstrAlias       LPCSTR
  39431 	FdwBufferSeconds  DWORD
  39432 	F__ccgo_pad2      [4]byte
  39433 }
  39434 
  39435 type MCI_WAVE_OPEN_PARMSA = tagMCI_WAVE_OPEN_PARMSA
  39436 type PMCI_WAVE_OPEN_PARMSA = uintptr
  39437 type LPMCI_WAVE_OPEN_PARMSA = uintptr
  39438 
  39439 type tagMCI_WAVE_OPEN_PARMSW = struct {
  39440 	FdwCallback       DWORD_PTR
  39441 	FwDeviceID        MCIDEVICEID
  39442 	F__ccgo_pad1      [4]byte
  39443 	FlpstrDeviceType  LPCWSTR
  39444 	FlpstrElementName LPCWSTR
  39445 	FlpstrAlias       LPCWSTR
  39446 	FdwBufferSeconds  DWORD
  39447 	F__ccgo_pad2      [4]byte
  39448 }
  39449 
  39450 type MCI_WAVE_OPEN_PARMSW = tagMCI_WAVE_OPEN_PARMSW
  39451 type PMCI_WAVE_OPEN_PARMSW = uintptr
  39452 type LPMCI_WAVE_OPEN_PARMSW = uintptr
  39453 
  39454 type MCI_WAVE_OPEN_PARMS = MCI_WAVE_OPEN_PARMSA
  39455 type PMCI_WAVE_OPEN_PARMS = PMCI_WAVE_OPEN_PARMSA
  39456 type LPMCI_WAVE_OPEN_PARMS = LPMCI_WAVE_OPEN_PARMSA
  39457 
  39458 type tagMCI_WAVE_DELETE_PARMS = struct {
  39459 	FdwCallback DWORD_PTR
  39460 	FdwFrom     DWORD
  39461 	FdwTo       DWORD
  39462 }
  39463 
  39464 type MCI_WAVE_DELETE_PARMS = tagMCI_WAVE_DELETE_PARMS
  39465 type PMCI_WAVE_DELETE_PARMS = uintptr
  39466 type LPMCI_WAVE_DELETE_PARMS = uintptr
  39467 
  39468 type tagMCI_WAVE_SET_PARMS = struct {
  39469 	FdwCallback      DWORD_PTR
  39470 	FdwTimeFormat    DWORD
  39471 	FdwAudio         DWORD
  39472 	FwInput          UINT
  39473 	FwOutput         UINT
  39474 	FwFormatTag      WORD
  39475 	FwReserved2      WORD
  39476 	FnChannels       WORD
  39477 	FwReserved3      WORD
  39478 	FnSamplesPerSec  DWORD
  39479 	FnAvgBytesPerSec DWORD
  39480 	FnBlockAlign     WORD
  39481 	FwReserved4      WORD
  39482 	FwBitsPerSample  WORD
  39483 	FwReserved5      WORD
  39484 }
  39485 
  39486 type MCI_WAVE_SET_PARMS = tagMCI_WAVE_SET_PARMS
  39487 type PMCI_WAVE_SET_PARMS = uintptr
  39488 type LPMCI_WAVE_SET_PARMS = uintptr
  39489 
  39490 type tagMCI_SEQ_SET_PARMS = struct {
  39491 	FdwCallback   DWORD_PTR
  39492 	FdwTimeFormat DWORD
  39493 	FdwAudio      DWORD
  39494 	FdwTempo      DWORD
  39495 	FdwPort       DWORD
  39496 	FdwSlave      DWORD
  39497 	FdwMaster     DWORD
  39498 	FdwOffset     DWORD
  39499 	F__ccgo_pad1  [4]byte
  39500 }
  39501 
  39502 type MCI_SEQ_SET_PARMS = tagMCI_SEQ_SET_PARMS
  39503 type PMCI_SEQ_SET_PARMS = uintptr
  39504 type LPMCI_SEQ_SET_PARMS = uintptr
  39505 
  39506 type tagMCI_ANIM_OPEN_PARMSA = struct {
  39507 	FdwCallback       DWORD_PTR
  39508 	FwDeviceID        MCIDEVICEID
  39509 	F__ccgo_pad1      [4]byte
  39510 	FlpstrDeviceType  LPCSTR
  39511 	FlpstrElementName LPCSTR
  39512 	FlpstrAlias       LPCSTR
  39513 	FdwStyle          DWORD
  39514 	F__ccgo_pad2      [4]byte
  39515 	FhWndParent       HWND
  39516 }
  39517 
  39518 type MCI_ANIM_OPEN_PARMSA = tagMCI_ANIM_OPEN_PARMSA
  39519 type PMCI_ANIM_OPEN_PARMSA = uintptr
  39520 type LPMCI_ANIM_OPEN_PARMSA = uintptr
  39521 
  39522 type tagMCI_ANIM_OPEN_PARMSW = struct {
  39523 	FdwCallback       DWORD_PTR
  39524 	FwDeviceID        MCIDEVICEID
  39525 	F__ccgo_pad1      [4]byte
  39526 	FlpstrDeviceType  LPCWSTR
  39527 	FlpstrElementName LPCWSTR
  39528 	FlpstrAlias       LPCWSTR
  39529 	FdwStyle          DWORD
  39530 	F__ccgo_pad2      [4]byte
  39531 	FhWndParent       HWND
  39532 }
  39533 
  39534 type MCI_ANIM_OPEN_PARMSW = tagMCI_ANIM_OPEN_PARMSW
  39535 type PMCI_ANIM_OPEN_PARMSW = uintptr
  39536 type LPMCI_ANIM_OPEN_PARMSW = uintptr
  39537 
  39538 type MCI_ANIM_OPEN_PARMS = MCI_ANIM_OPEN_PARMSA
  39539 type PMCI_ANIM_OPEN_PARMS = PMCI_ANIM_OPEN_PARMSA
  39540 type LPMCI_ANIM_OPEN_PARMS = LPMCI_ANIM_OPEN_PARMSA
  39541 
  39542 type tagMCI_ANIM_PLAY_PARMS = struct {
  39543 	FdwCallback  DWORD_PTR
  39544 	FdwFrom      DWORD
  39545 	FdwTo        DWORD
  39546 	FdwSpeed     DWORD
  39547 	F__ccgo_pad1 [4]byte
  39548 }
  39549 
  39550 type MCI_ANIM_PLAY_PARMS = tagMCI_ANIM_PLAY_PARMS
  39551 type PMCI_ANIM_PLAY_PARMS = uintptr
  39552 type LPMCI_ANIM_PLAY_PARMS = uintptr
  39553 
  39554 type tagMCI_ANIM_STEP_PARMS = struct {
  39555 	FdwCallback  DWORD_PTR
  39556 	FdwFrames    DWORD
  39557 	F__ccgo_pad1 [4]byte
  39558 }
  39559 
  39560 type MCI_ANIM_STEP_PARMS = tagMCI_ANIM_STEP_PARMS
  39561 type PMCI_ANIM_STEP_PARMS = uintptr
  39562 type LPMCI_ANIM_STEP_PARMS = uintptr
  39563 
  39564 type tagMCI_ANIM_WINDOW_PARMSA = struct {
  39565 	FdwCallback  DWORD_PTR
  39566 	FhWnd        HWND
  39567 	FnCmdShow    UINT
  39568 	F__ccgo_pad1 [4]byte
  39569 	FlpstrText   LPCSTR
  39570 }
  39571 
  39572 type MCI_ANIM_WINDOW_PARMSA = tagMCI_ANIM_WINDOW_PARMSA
  39573 type PMCI_ANIM_WINDOW_PARMSA = uintptr
  39574 type LPMCI_ANIM_WINDOW_PARMSA = uintptr
  39575 
  39576 type tagMCI_ANIM_WINDOW_PARMSW = struct {
  39577 	FdwCallback  DWORD_PTR
  39578 	FhWnd        HWND
  39579 	FnCmdShow    UINT
  39580 	F__ccgo_pad1 [4]byte
  39581 	FlpstrText   LPCWSTR
  39582 }
  39583 
  39584 type MCI_ANIM_WINDOW_PARMSW = tagMCI_ANIM_WINDOW_PARMSW
  39585 type PMCI_ANIM_WINDOW_PARMSW = uintptr
  39586 type LPMCI_ANIM_WINDOW_PARMSW = uintptr
  39587 
  39588 type MCI_ANIM_WINDOW_PARMS = MCI_ANIM_WINDOW_PARMSA
  39589 type PMCI_ANIM_WINDOW_PARMS = PMCI_ANIM_WINDOW_PARMSA
  39590 type LPMCI_ANIM_WINDOW_PARMS = LPMCI_ANIM_WINDOW_PARMSA
  39591 
  39592 type tagMCI_ANIM_RECT_PARMS = struct {
  39593 	FdwCallback DWORD_PTR
  39594 	Frc         RECT
  39595 }
  39596 
  39597 type MCI_ANIM_RECT_PARMS = tagMCI_ANIM_RECT_PARMS
  39598 
  39599 type PMCI_ANIM_RECT_PARMS = uintptr
  39600 type LPMCI_ANIM_RECT_PARMS = uintptr
  39601 
  39602 type tagMCI_ANIM_UPDATE_PARMS = struct {
  39603 	FdwCallback DWORD_PTR
  39604 	Frc         RECT
  39605 	FhDC        HDC
  39606 }
  39607 
  39608 type MCI_ANIM_UPDATE_PARMS = tagMCI_ANIM_UPDATE_PARMS
  39609 type PMCI_ANIM_UPDATE_PARMS = uintptr
  39610 type LPMCI_ANIM_UPDATE_PARMS = uintptr
  39611 
  39612 type tagMCI_OVLY_OPEN_PARMSA = struct {
  39613 	FdwCallback       DWORD_PTR
  39614 	FwDeviceID        MCIDEVICEID
  39615 	F__ccgo_pad1      [4]byte
  39616 	FlpstrDeviceType  LPCSTR
  39617 	FlpstrElementName LPCSTR
  39618 	FlpstrAlias       LPCSTR
  39619 	FdwStyle          DWORD
  39620 	F__ccgo_pad2      [4]byte
  39621 	FhWndParent       HWND
  39622 }
  39623 
  39624 type MCI_OVLY_OPEN_PARMSA = tagMCI_OVLY_OPEN_PARMSA
  39625 type PMCI_OVLY_OPEN_PARMSA = uintptr
  39626 type LPMCI_OVLY_OPEN_PARMSA = uintptr
  39627 
  39628 type tagMCI_OVLY_OPEN_PARMSW = struct {
  39629 	FdwCallback       DWORD_PTR
  39630 	FwDeviceID        MCIDEVICEID
  39631 	F__ccgo_pad1      [4]byte
  39632 	FlpstrDeviceType  LPCWSTR
  39633 	FlpstrElementName LPCWSTR
  39634 	FlpstrAlias       LPCWSTR
  39635 	FdwStyle          DWORD
  39636 	F__ccgo_pad2      [4]byte
  39637 	FhWndParent       HWND
  39638 }
  39639 
  39640 type MCI_OVLY_OPEN_PARMSW = tagMCI_OVLY_OPEN_PARMSW
  39641 type PMCI_OVLY_OPEN_PARMSW = uintptr
  39642 type LPMCI_OVLY_OPEN_PARMSW = uintptr
  39643 
  39644 type MCI_OVLY_OPEN_PARMS = MCI_OVLY_OPEN_PARMSA
  39645 type PMCI_OVLY_OPEN_PARMS = PMCI_OVLY_OPEN_PARMSA
  39646 type LPMCI_OVLY_OPEN_PARMS = LPMCI_OVLY_OPEN_PARMSA
  39647 
  39648 type tagMCI_OVLY_WINDOW_PARMSA = struct {
  39649 	FdwCallback  DWORD_PTR
  39650 	FhWnd        HWND
  39651 	FnCmdShow    UINT
  39652 	F__ccgo_pad1 [4]byte
  39653 	FlpstrText   LPCSTR
  39654 }
  39655 
  39656 type MCI_OVLY_WINDOW_PARMSA = tagMCI_OVLY_WINDOW_PARMSA
  39657 type PMCI_OVLY_WINDOW_PARMSA = uintptr
  39658 type LPMCI_OVLY_WINDOW_PARMSA = uintptr
  39659 
  39660 type tagMCI_OVLY_WINDOW_PARMSW = struct {
  39661 	FdwCallback  DWORD_PTR
  39662 	FhWnd        HWND
  39663 	FnCmdShow    UINT
  39664 	F__ccgo_pad1 [4]byte
  39665 	FlpstrText   LPCWSTR
  39666 }
  39667 
  39668 type MCI_OVLY_WINDOW_PARMSW = tagMCI_OVLY_WINDOW_PARMSW
  39669 type PMCI_OVLY_WINDOW_PARMSW = uintptr
  39670 type LPMCI_OVLY_WINDOW_PARMSW = uintptr
  39671 
  39672 type MCI_OVLY_WINDOW_PARMS = MCI_OVLY_WINDOW_PARMSA
  39673 type PMCI_OVLY_WINDOW_PARMS = PMCI_OVLY_WINDOW_PARMSA
  39674 type LPMCI_OVLY_WINDOW_PARMS = LPMCI_OVLY_WINDOW_PARMSA
  39675 
  39676 type tagMCI_OVLY_RECT_PARMS = struct {
  39677 	FdwCallback DWORD_PTR
  39678 	Frc         RECT
  39679 }
  39680 
  39681 type MCI_OVLY_RECT_PARMS = tagMCI_OVLY_RECT_PARMS
  39682 type PMCI_OVLY_RECT_PARMS = uintptr
  39683 type LPMCI_OVLY_RECT_PARMS = uintptr
  39684 
  39685 type tagMCI_OVLY_SAVE_PARMSA = struct {
  39686 	FdwCallback DWORD_PTR
  39687 	Flpfilename LPCSTR
  39688 	Frc         RECT
  39689 }
  39690 
  39691 type MCI_OVLY_SAVE_PARMSA = tagMCI_OVLY_SAVE_PARMSA
  39692 type PMCI_OVLY_SAVE_PARMSA = uintptr
  39693 type LPMCI_OVLY_SAVE_PARMSA = uintptr
  39694 
  39695 type tagMCI_OVLY_SAVE_PARMSW = struct {
  39696 	FdwCallback DWORD_PTR
  39697 	Flpfilename LPCWSTR
  39698 	Frc         RECT
  39699 }
  39700 
  39701 type MCI_OVLY_SAVE_PARMSW = tagMCI_OVLY_SAVE_PARMSW
  39702 type PMCI_OVLY_SAVE_PARMSW = uintptr
  39703 type LPMCI_OVLY_SAVE_PARMSW = uintptr
  39704 
  39705 type MCI_OVLY_SAVE_PARMS = MCI_OVLY_SAVE_PARMSA
  39706 type PMCI_OVLY_SAVE_PARMS = PMCI_OVLY_SAVE_PARMSA
  39707 type LPMCI_OVLY_SAVE_PARMS = LPMCI_OVLY_SAVE_PARMSA
  39708 
  39709 type tagMCI_OVLY_LOAD_PARMSA = struct {
  39710 	FdwCallback DWORD_PTR
  39711 	Flpfilename LPCSTR
  39712 	Frc         RECT
  39713 }
  39714 
  39715 type MCI_OVLY_LOAD_PARMSA = tagMCI_OVLY_LOAD_PARMSA
  39716 type PMCI_OVLY_LOAD_PARMSA = uintptr
  39717 type LPMCI_OVLY_LOAD_PARMSA = uintptr
  39718 
  39719 type tagMCI_OVLY_LOAD_PARMSW = struct {
  39720 	FdwCallback DWORD_PTR
  39721 	Flpfilename LPCWSTR
  39722 	Frc         RECT
  39723 }
  39724 
  39725 type MCI_OVLY_LOAD_PARMSW = tagMCI_OVLY_LOAD_PARMSW
  39726 type PMCI_OVLY_LOAD_PARMSW = uintptr
  39727 type LPMCI_OVLY_LOAD_PARMSW = uintptr
  39728 
  39729 type MCI_OVLY_LOAD_PARMS = MCI_OVLY_LOAD_PARMSA
  39730 type PMCI_OVLY_LOAD_PARMS = PMCI_OVLY_LOAD_PARMSA
  39731 type LPMCI_OVLY_LOAD_PARMS = LPMCI_OVLY_LOAD_PARMSA
  39732 
  39733 type _NCB = struct {
  39734 	Fncb_command  UCHAR
  39735 	Fncb_retcode  UCHAR
  39736 	Fncb_lsn      UCHAR
  39737 	Fncb_num      UCHAR
  39738 	F__ccgo_pad1  [4]byte
  39739 	Fncb_buffer   PUCHAR
  39740 	Fncb_length   WORD
  39741 	Fncb_callname [16]UCHAR
  39742 	Fncb_name     [16]UCHAR
  39743 	Fncb_rto      UCHAR
  39744 	Fncb_sto      UCHAR
  39745 	F__ccgo_pad2  [4]byte
  39746 	Fncb_post     uintptr
  39747 	Fncb_lana_num UCHAR
  39748 	Fncb_cmd_cplt UCHAR
  39749 	Fncb_reserve  [18]UCHAR
  39750 	F__ccgo_pad3  [4]byte
  39751 	Fncb_event    HANDLE
  39752 }
  39753 
  39754 type NCB = _NCB
  39755 type PNCB = uintptr
  39756 
  39757 type _ADAPTER_STATUS = struct {
  39758 	Fadapter_address   [6]UCHAR
  39759 	Frev_major         UCHAR
  39760 	Freserved0         UCHAR
  39761 	Fadapter_type      UCHAR
  39762 	Frev_minor         UCHAR
  39763 	Fduration          WORD
  39764 	Ffrmr_recv         WORD
  39765 	Ffrmr_xmit         WORD
  39766 	Fiframe_recv_err   WORD
  39767 	Fxmit_aborts       WORD
  39768 	Fxmit_success      DWORD
  39769 	Frecv_success      DWORD
  39770 	Fiframe_xmit_err   WORD
  39771 	Frecv_buff_unavail WORD
  39772 	Ft1_timeouts       WORD
  39773 	Fti_timeouts       WORD
  39774 	Freserved1         DWORD
  39775 	Ffree_ncbs         WORD
  39776 	Fmax_cfg_ncbs      WORD
  39777 	Fmax_ncbs          WORD
  39778 	Fxmit_buf_unavail  WORD
  39779 	Fmax_dgram_size    WORD
  39780 	Fpending_sess      WORD
  39781 	Fmax_cfg_sess      WORD
  39782 	Fmax_sess          WORD
  39783 	Fmax_sess_pkt_size WORD
  39784 	Fname_count        WORD
  39785 }
  39786 
  39787 type ADAPTER_STATUS = _ADAPTER_STATUS
  39788 type PADAPTER_STATUS = uintptr
  39789 
  39790 type _NAME_BUFFER = struct {
  39791 	Fname       [16]UCHAR
  39792 	Fname_num   UCHAR
  39793 	Fname_flags UCHAR
  39794 }
  39795 
  39796 type NAME_BUFFER = _NAME_BUFFER
  39797 type PNAME_BUFFER = uintptr
  39798 
  39799 type _SESSION_HEADER = struct {
  39800 	Fsess_name           UCHAR
  39801 	Fnum_sess            UCHAR
  39802 	Frcv_dg_outstanding  UCHAR
  39803 	Frcv_any_outstanding UCHAR
  39804 }
  39805 
  39806 type SESSION_HEADER = _SESSION_HEADER
  39807 type PSESSION_HEADER = uintptr
  39808 
  39809 type _SESSION_BUFFER = struct {
  39810 	Flsn               UCHAR
  39811 	Fstate             UCHAR
  39812 	Flocal_name        [16]UCHAR
  39813 	Fremote_name       [16]UCHAR
  39814 	Frcvs_outstanding  UCHAR
  39815 	Fsends_outstanding UCHAR
  39816 }
  39817 
  39818 type SESSION_BUFFER = _SESSION_BUFFER
  39819 type PSESSION_BUFFER = uintptr
  39820 
  39821 type _LANA_ENUM = struct {
  39822 	Flength UCHAR
  39823 	Flana   [255]UCHAR
  39824 }
  39825 
  39826 type LANA_ENUM = _LANA_ENUM
  39827 type PLANA_ENUM = uintptr
  39828 
  39829 type _FIND_NAME_HEADER = struct {
  39830 	Fnode_count   WORD
  39831 	Freserved     UCHAR
  39832 	Funique_group UCHAR
  39833 }
  39834 
  39835 type FIND_NAME_HEADER = _FIND_NAME_HEADER
  39836 type PFIND_NAME_HEADER = uintptr
  39837 
  39838 type _FIND_NAME_BUFFER = struct {
  39839 	Flength           UCHAR
  39840 	Faccess_control   UCHAR
  39841 	Fframe_control    UCHAR
  39842 	Fdestination_addr [6]UCHAR
  39843 	Fsource_addr      [6]UCHAR
  39844 	Frouting_info     [18]UCHAR
  39845 }
  39846 
  39847 type FIND_NAME_BUFFER = _FIND_NAME_BUFFER
  39848 type PFIND_NAME_BUFFER = uintptr
  39849 
  39850 type _ACTION_HEADER = struct {
  39851 	Ftransport_id ULONG
  39852 	Faction_code  USHORT
  39853 	Freserved     USHORT
  39854 }
  39855 
  39856 type ACTION_HEADER = _ACTION_HEADER
  39857 type PACTION_HEADER = uintptr
  39858 
  39859 type I_RPC_HANDLE = uintptr
  39860 type RPC_STATUS = int32
  39861 
  39862 type RPC_CSTR = uintptr
  39863 type RPC_WSTR = uintptr
  39864 type RPC_BINDING_HANDLE = I_RPC_HANDLE
  39865 type Handle_t = RPC_BINDING_HANDLE
  39866 
  39867 type UUID = GUID
  39868 
  39869 type _RPC_BINDING_VECTOR = struct {
  39870 	FCount       uint32
  39871 	F__ccgo_pad1 [4]byte
  39872 	FBindingH    [1]RPC_BINDING_HANDLE
  39873 }
  39874 
  39875 type RPC_BINDING_VECTOR = _RPC_BINDING_VECTOR
  39876 
  39877 type _UUID_VECTOR = struct {
  39878 	FCount       uint32
  39879 	F__ccgo_pad1 [4]byte
  39880 	FUuid        [1]uintptr
  39881 }
  39882 
  39883 type UUID_VECTOR = _UUID_VECTOR
  39884 
  39885 type RPC_IF_HANDLE = uintptr
  39886 
  39887 type _RPC_IF_ID = struct {
  39888 	FUuid      UUID
  39889 	FVersMajor uint16
  39890 	FVersMinor uint16
  39891 }
  39892 
  39893 type RPC_IF_ID = _RPC_IF_ID
  39894 
  39895 type _RPC_PROTSEQ_VECTORA = struct {
  39896 	FCount       uint32
  39897 	F__ccgo_pad1 [4]byte
  39898 	FProtseq     [1]uintptr
  39899 }
  39900 
  39901 type RPC_PROTSEQ_VECTORA = _RPC_PROTSEQ_VECTORA
  39902 
  39903 type _RPC_PROTSEQ_VECTORW = struct {
  39904 	FCount       uint32
  39905 	F__ccgo_pad1 [4]byte
  39906 	FProtseq     [1]uintptr
  39907 }
  39908 
  39909 type RPC_PROTSEQ_VECTORW = _RPC_PROTSEQ_VECTORW
  39910 
  39911 type _RPC_POLICY = struct {
  39912 	FLength        uint32
  39913 	FEndpointFlags uint32
  39914 	FNICFlags      uint32
  39915 }
  39916 
  39917 type RPC_POLICY = _RPC_POLICY
  39918 type PRPC_POLICY = uintptr
  39919 
  39920 type RPC_STATS_VECTOR = struct {
  39921 	FCount uint32
  39922 	FStats [1]uint32
  39923 }
  39924 
  39925 type RPC_IF_ID_VECTOR = struct {
  39926 	FCount       uint32
  39927 	F__ccgo_pad1 [4]byte
  39928 	FIfId        [1]uintptr
  39929 }
  39930 
  39931 type RPC_AUTH_IDENTITY_HANDLE = uintptr
  39932 type RPC_AUTHZ_HANDLE = uintptr
  39933 
  39934 type _RPC_SECURITY_QOS = struct {
  39935 	FVersion           uint32
  39936 	FCapabilities      uint32
  39937 	FIdentityTracking  uint32
  39938 	FImpersonationType uint32
  39939 }
  39940 
  39941 type RPC_SECURITY_QOS = _RPC_SECURITY_QOS
  39942 type PRPC_SECURITY_QOS = uintptr
  39943 
  39944 type _SEC_WINNT_AUTH_IDENTITY_W = struct {
  39945 	FUser           uintptr
  39946 	FUserLength     uint32
  39947 	F__ccgo_pad1    [4]byte
  39948 	FDomain         uintptr
  39949 	FDomainLength   uint32
  39950 	F__ccgo_pad2    [4]byte
  39951 	FPassword       uintptr
  39952 	FPasswordLength uint32
  39953 	FFlags          uint32
  39954 }
  39955 
  39956 type SEC_WINNT_AUTH_IDENTITY_W = _SEC_WINNT_AUTH_IDENTITY_W
  39957 type PSEC_WINNT_AUTH_IDENTITY_W = uintptr
  39958 
  39959 type _SEC_WINNT_AUTH_IDENTITY_A = struct {
  39960 	FUser           uintptr
  39961 	FUserLength     uint32
  39962 	F__ccgo_pad1    [4]byte
  39963 	FDomain         uintptr
  39964 	FDomainLength   uint32
  39965 	F__ccgo_pad2    [4]byte
  39966 	FPassword       uintptr
  39967 	FPasswordLength uint32
  39968 	FFlags          uint32
  39969 }
  39970 
  39971 type SEC_WINNT_AUTH_IDENTITY_A = _SEC_WINNT_AUTH_IDENTITY_A
  39972 type PSEC_WINNT_AUTH_IDENTITY_A = uintptr
  39973 
  39974 type _RPC_HTTP_TRANSPORT_CREDENTIALS_W = struct {
  39975 	FTransportCredentials     uintptr
  39976 	FFlags                    uint32
  39977 	FAuthenticationTarget     uint32
  39978 	FNumberOfAuthnSchemes     uint32
  39979 	F__ccgo_pad1              [4]byte
  39980 	FAuthnSchemes             uintptr
  39981 	FServerCertificateSubject uintptr
  39982 }
  39983 
  39984 type RPC_HTTP_TRANSPORT_CREDENTIALS_W = _RPC_HTTP_TRANSPORT_CREDENTIALS_W
  39985 type PRPC_HTTP_TRANSPORT_CREDENTIALS_W = uintptr
  39986 
  39987 type _RPC_HTTP_TRANSPORT_CREDENTIALS_A = struct {
  39988 	FTransportCredentials     uintptr
  39989 	FFlags                    uint32
  39990 	FAuthenticationTarget     uint32
  39991 	FNumberOfAuthnSchemes     uint32
  39992 	F__ccgo_pad1              [4]byte
  39993 	FAuthnSchemes             uintptr
  39994 	FServerCertificateSubject uintptr
  39995 }
  39996 
  39997 type RPC_HTTP_TRANSPORT_CREDENTIALS_A = _RPC_HTTP_TRANSPORT_CREDENTIALS_A
  39998 type PRPC_HTTP_TRANSPORT_CREDENTIALS_A = uintptr
  39999 
  40000 type _RPC_SECURITY_QOS_V2_W = struct {
  40001 	FVersion                    uint32
  40002 	FCapabilities               uint32
  40003 	FIdentityTracking           uint32
  40004 	FImpersonationType          uint32
  40005 	FAdditionalSecurityInfoType uint32
  40006 	F__ccgo_pad1                [4]byte
  40007 	Fu                          struct{ FHttpCredentials uintptr }
  40008 }
  40009 
  40010 type RPC_SECURITY_QOS_V2_W = _RPC_SECURITY_QOS_V2_W
  40011 type PRPC_SECURITY_QOS_V2_W = uintptr
  40012 
  40013 type _RPC_SECURITY_QOS_V2_A = struct {
  40014 	FVersion                    uint32
  40015 	FCapabilities               uint32
  40016 	FIdentityTracking           uint32
  40017 	FImpersonationType          uint32
  40018 	FAdditionalSecurityInfoType uint32
  40019 	F__ccgo_pad1                [4]byte
  40020 	Fu                          struct{ FHttpCredentials uintptr }
  40021 }
  40022 
  40023 type RPC_SECURITY_QOS_V2_A = _RPC_SECURITY_QOS_V2_A
  40024 type PRPC_SECURITY_QOS_V2_A = uintptr
  40025 
  40026 type _RPC_SECURITY_QOS_V3_W = struct {
  40027 	FVersion                    uint32
  40028 	FCapabilities               uint32
  40029 	FIdentityTracking           uint32
  40030 	FImpersonationType          uint32
  40031 	FAdditionalSecurityInfoType uint32
  40032 	F__ccgo_pad1                [4]byte
  40033 	Fu                          struct{ FHttpCredentials uintptr }
  40034 	FSid                        uintptr
  40035 }
  40036 
  40037 type RPC_SECURITY_QOS_V3_W = _RPC_SECURITY_QOS_V3_W
  40038 type PRPC_SECURITY_QOS_V3_W = uintptr
  40039 
  40040 type _RPC_SECURITY_QOS_V3_A = struct {
  40041 	FVersion                    uint32
  40042 	FCapabilities               uint32
  40043 	FIdentityTracking           uint32
  40044 	FImpersonationType          uint32
  40045 	FAdditionalSecurityInfoType uint32
  40046 	F__ccgo_pad1                [4]byte
  40047 	Fu                          struct{ FHttpCredentials uintptr }
  40048 	FSid                        uintptr
  40049 }
  40050 
  40051 type RPC_SECURITY_QOS_V3_A = _RPC_SECURITY_QOS_V3_A
  40052 type PRPC_SECURITY_QOS_V3_A = uintptr
  40053 
  40054 type RPC_HTTP_REDIRECTOR_STAGE = uint32
  40055 
  40056 type RPC_NEW_HTTP_PROXY_CHANNEL = uintptr
  40057 type RPC_HTTP_PROXY_FREE_STRING = uintptr
  40058 
  40059 type RPC_AUTH_KEY_RETRIEVAL_FN = uintptr
  40060 
  40061 type RPC_CLIENT_INFORMATION1 = struct {
  40062 	FUserName     uintptr
  40063 	FComputerName uintptr
  40064 	FPrivilege    uint16
  40065 	F__ccgo_pad1  [2]byte
  40066 	FAuthFlags    uint32
  40067 }
  40068 type PRPC_CLIENT_INFORMATION1 = uintptr
  40069 
  40070 type RPC_EP_INQ_HANDLE = uintptr
  40071 
  40072 type RPC_MGMT_AUTHORIZATION_FN = uintptr
  40073 
  40074 type _RPC_VERSION = struct {
  40075 	FMajorVersion uint16
  40076 	FMinorVersion uint16
  40077 }
  40078 
  40079 type RPC_VERSION = _RPC_VERSION
  40080 
  40081 type _RPC_SYNTAX_IDENTIFIER = struct {
  40082 	FSyntaxGUID    GUID
  40083 	FSyntaxVersion RPC_VERSION
  40084 }
  40085 
  40086 type RPC_SYNTAX_IDENTIFIER = _RPC_SYNTAX_IDENTIFIER
  40087 type PRPC_SYNTAX_IDENTIFIER = uintptr
  40088 
  40089 type _RPC_MESSAGE = struct {
  40090 	FHandle                  RPC_BINDING_HANDLE
  40091 	FDataRepresentation      uint32
  40092 	F__ccgo_pad1             [4]byte
  40093 	FBuffer                  uintptr
  40094 	FBufferLength            uint32
  40095 	FProcNum                 uint32
  40096 	FTransferSyntax          PRPC_SYNTAX_IDENTIFIER
  40097 	FRpcInterfaceInformation uintptr
  40098 	FReservedForRuntime      uintptr
  40099 	FManagerEpv              uintptr
  40100 	FImportContext           uintptr
  40101 	FRpcFlags                uint32
  40102 	F__ccgo_pad2             [4]byte
  40103 }
  40104 
  40105 type RPC_MESSAGE = _RPC_MESSAGE
  40106 type PRPC_MESSAGE = uintptr
  40107 
  40108 type RPC_DISPATCH_FUNCTION = uintptr
  40109 
  40110 type RPC_DISPATCH_TABLE = struct {
  40111 	FDispatchTableCount uint32
  40112 	F__ccgo_pad1        [4]byte
  40113 	FDispatchTable      uintptr
  40114 	FReserved           LONG_PTR
  40115 }
  40116 type PRPC_DISPATCH_TABLE = uintptr
  40117 
  40118 type _RPC_PROTSEQ_ENDPOINT = struct {
  40119 	FRpcProtocolSequence uintptr
  40120 	FEndpoint            uintptr
  40121 }
  40122 
  40123 type RPC_PROTSEQ_ENDPOINT = _RPC_PROTSEQ_ENDPOINT
  40124 type PRPC_PROTSEQ_ENDPOINT = uintptr
  40125 
  40126 type _RPC_SERVER_INTERFACE = struct {
  40127 	FLength                  uint32
  40128 	FInterfaceId             RPC_SYNTAX_IDENTIFIER
  40129 	FTransferSyntax          RPC_SYNTAX_IDENTIFIER
  40130 	F__ccgo_pad1             [4]byte
  40131 	FDispatchTable           PRPC_DISPATCH_TABLE
  40132 	FRpcProtseqEndpointCount uint32
  40133 	F__ccgo_pad2             [4]byte
  40134 	FRpcProtseqEndpoint      PRPC_PROTSEQ_ENDPOINT
  40135 	FDefaultManagerEpv       uintptr
  40136 	FInterpreterInfo         uintptr
  40137 	FFlags                   uint32
  40138 	F__ccgo_pad3             [4]byte
  40139 }
  40140 
  40141 type RPC_SERVER_INTERFACE = _RPC_SERVER_INTERFACE
  40142 type PRPC_SERVER_INTERFACE = uintptr
  40143 
  40144 type _RPC_CLIENT_INTERFACE = struct {
  40145 	FLength                  uint32
  40146 	FInterfaceId             RPC_SYNTAX_IDENTIFIER
  40147 	FTransferSyntax          RPC_SYNTAX_IDENTIFIER
  40148 	F__ccgo_pad1             [4]byte
  40149 	FDispatchTable           PRPC_DISPATCH_TABLE
  40150 	FRpcProtseqEndpointCount uint32
  40151 	F__ccgo_pad2             [4]byte
  40152 	FRpcProtseqEndpoint      PRPC_PROTSEQ_ENDPOINT
  40153 	FReserved                ULONG_PTR
  40154 	FInterpreterInfo         uintptr
  40155 	FFlags                   uint32
  40156 	F__ccgo_pad3             [4]byte
  40157 }
  40158 
  40159 type RPC_CLIENT_INTERFACE = _RPC_CLIENT_INTERFACE
  40160 type PRPC_CLIENT_INTERFACE = uintptr
  40161 
  40162 type I_RPC_MUTEX = uintptr
  40163 
  40164 type PRPC_RUNDOWN = uintptr
  40165 
  40166 type _RPC_TRANSFER_SYNTAX = struct {
  40167 	FUuid      UUID
  40168 	FVersMajor uint16
  40169 	FVersMinor uint16
  40170 }
  40171 
  40172 type RPC_TRANSFER_SYNTAX = _RPC_TRANSFER_SYNTAX
  40173 
  40174 type RPCLT_PDU_FILTER_FUNC = uintptr
  40175 type RPC_SETFILTER_FUNC = uintptr
  40176 
  40177 type _RPC_C_OPT_METADATA_DESCRIPTOR = struct {
  40178 	FBufferSize  uint32
  40179 	F__ccgo_pad1 [4]byte
  40180 	FBuffer      uintptr
  40181 }
  40182 
  40183 type RPC_C_OPT_METADATA_DESCRIPTOR = _RPC_C_OPT_METADATA_DESCRIPTOR
  40184 
  40185 type _RDR_CALLOUT_STATE = struct {
  40186 	FLastError           RPC_STATUS
  40187 	F__ccgo_pad1         [4]byte
  40188 	FLastEEInfo          uintptr
  40189 	FLastCalledStage     RPC_HTTP_REDIRECTOR_STAGE
  40190 	F__ccgo_pad2         [4]byte
  40191 	FServerName          uintptr
  40192 	FServerPort          uintptr
  40193 	FRemoteUser          uintptr
  40194 	FAuthType            uintptr
  40195 	FResourceTypePresent uint8
  40196 	FMetadataPresent     uint8
  40197 	FSessionIdPresent    uint8
  40198 	FInterfacePresent    uint8
  40199 	FResourceType        UUID
  40200 	F__ccgo_pad3         [4]byte
  40201 	FMetadata            RPC_C_OPT_METADATA_DESCRIPTOR
  40202 	FSessionId           UUID
  40203 	FInterface           RPC_SYNTAX_IDENTIFIER
  40204 	F__ccgo_pad4         [4]byte
  40205 	FCertContext         uintptr
  40206 }
  40207 
  40208 type RDR_CALLOUT_STATE = _RDR_CALLOUT_STATE
  40209 
  40210 type I_RpcProxyIsValidMachineFn = uintptr
  40211 type I_RpcProxyGetClientAddressFn = uintptr
  40212 type I_RpcProxyGetConnectionTimeoutFn = uintptr
  40213 type I_RpcPerformCalloutFn = uintptr
  40214 type I_RpcFreeCalloutStateFn = uintptr
  40215 
  40216 type tagI_RpcProxyCallbackInterface = struct {
  40217 	FIsValidMachineFn       I_RpcProxyIsValidMachineFn
  40218 	FGetClientAddressFn     I_RpcProxyGetClientAddressFn
  40219 	FGetConnectionTimeoutFn I_RpcProxyGetConnectionTimeoutFn
  40220 	FPerformCalloutFn       I_RpcPerformCalloutFn
  40221 	FFreeCalloutStateFn     I_RpcFreeCalloutStateFn
  40222 }
  40223 
  40224 type I_RpcProxyCallbackInterface = tagI_RpcProxyCallbackInterface
  40225 
  40226 type RPC_NS_HANDLE = uintptr
  40227 
  40228 type RPC_NOTIFICATION_TYPES = uint32
  40229 
  40230 type RPC_ASYNC_EVENT = uint32
  40231 
  40232 type _RPC_ASYNC_STATE = struct {
  40233 	FSize             uint32
  40234 	FSignature        uint32
  40235 	FLock             int32
  40236 	FFlags            uint32
  40237 	FStubInfo         uintptr
  40238 	FUserInfo         uintptr
  40239 	FRuntimeInfo      uintptr
  40240 	FEvent            RPC_ASYNC_EVENT
  40241 	FNotificationType RPC_NOTIFICATION_TYPES
  40242 	Fu                struct {
  40243 		FAPC struct {
  40244 			FNotificationRoutine PFN_RPCNOTIFICATION_ROUTINE
  40245 			FhThread             HANDLE
  40246 		}
  40247 		F__ccgo_pad1 [16]byte
  40248 	}
  40249 	FReserved [4]LONG_PTR
  40250 }
  40251 
  40252 type PFN_RPCNOTIFICATION_ROUTINE = uintptr
  40253 
  40254 type RPC_ASYNC_STATE = _RPC_ASYNC_STATE
  40255 type PRPC_ASYNC_STATE = uintptr
  40256 
  40257 type ExtendedErrorParamTypes = uint32
  40258 
  40259 type tagBinaryParam = struct {
  40260 	FBuffer      uintptr
  40261 	FSize        int16
  40262 	F__ccgo_pad1 [6]byte
  40263 }
  40264 
  40265 type BinaryParam = tagBinaryParam
  40266 
  40267 type tagRPC_EE_INFO_PARAM = struct {
  40268 	FParameterType ExtendedErrorParamTypes
  40269 	F__ccgo_pad1   [4]byte
  40270 	Fu             struct {
  40271 		FAnsiString  LPSTR
  40272 		F__ccgo_pad1 [8]byte
  40273 	}
  40274 }
  40275 
  40276 type RPC_EE_INFO_PARAM = tagRPC_EE_INFO_PARAM
  40277 
  40278 type tagRPC_EXTENDED_ERROR_INFO = struct {
  40279 	FVersion      ULONG
  40280 	F__ccgo_pad1  [4]byte
  40281 	FComputerName LPWSTR
  40282 	FProcessID    ULONG
  40283 	Fu            struct {
  40284 		F__ccgo_pad1 [0]uint32
  40285 		FSystemTime  SYSTEMTIME
  40286 	}
  40287 	FGeneratingComponent ULONG
  40288 	FStatus              ULONG
  40289 	FDetectionLocation   USHORT
  40290 	FFlags               USHORT
  40291 	FNumberOfParameters  int32
  40292 	F__ccgo_pad2         [4]byte
  40293 	FParameters          [4]RPC_EE_INFO_PARAM
  40294 }
  40295 
  40296 type RPC_EXTENDED_ERROR_INFO = tagRPC_EXTENDED_ERROR_INFO
  40297 
  40298 type tagRPC_ERROR_ENUM_HANDLE = struct {
  40299 	FSignature   ULONG
  40300 	F__ccgo_pad1 [4]byte
  40301 	FCurrentPos  uintptr
  40302 	FHead        uintptr
  40303 }
  40304 
  40305 type RPC_ERROR_ENUM_HANDLE = tagRPC_ERROR_ENUM_HANDLE
  40306 
  40307 type tagRPC_CALL_ATTRIBUTES_V1_W = struct {
  40308 	FVersion                         uint32
  40309 	FFlags                           uint32
  40310 	FServerPrincipalNameBufferLength uint32
  40311 	F__ccgo_pad1                     [4]byte
  40312 	FServerPrincipalName             uintptr
  40313 	FClientPrincipalNameBufferLength uint32
  40314 	F__ccgo_pad2                     [4]byte
  40315 	FClientPrincipalName             uintptr
  40316 	FAuthenticationLevel             uint32
  40317 	FAuthenticationService           uint32
  40318 	FNullSession                     WINBOOL
  40319 	F__ccgo_pad3                     [4]byte
  40320 }
  40321 
  40322 type RPC_CALL_ATTRIBUTES_V1_W = tagRPC_CALL_ATTRIBUTES_V1_W
  40323 
  40324 type tagRPC_CALL_ATTRIBUTES_V1_A = struct {
  40325 	FVersion                         uint32
  40326 	FFlags                           uint32
  40327 	FServerPrincipalNameBufferLength uint32
  40328 	F__ccgo_pad1                     [4]byte
  40329 	FServerPrincipalName             uintptr
  40330 	FClientPrincipalNameBufferLength uint32
  40331 	F__ccgo_pad2                     [4]byte
  40332 	FClientPrincipalName             uintptr
  40333 	FAuthenticationLevel             uint32
  40334 	FAuthenticationService           uint32
  40335 	FNullSession                     WINBOOL
  40336 	F__ccgo_pad3                     [4]byte
  40337 }
  40338 
  40339 type RPC_CALL_ATTRIBUTES_V1_A = tagRPC_CALL_ATTRIBUTES_V1_A
  40340 
  40341 type RPC_CALL_ATTRIBUTES = RPC_CALL_ATTRIBUTES_V1_A
  40342 
  40343 type _RPC_ASYNC_NOTIFICATION_INFO = struct {
  40344 	FAPC struct {
  40345 		FNotificationRoutine PFN_RPCNOTIFICATION_ROUTINE
  40346 		FhThread             HANDLE
  40347 	}
  40348 	F__ccgo_pad1 [16]byte
  40349 }
  40350 
  40351 type RPC_ASYNC_NOTIFICATION_INFO = _RPC_ASYNC_NOTIFICATION_INFO
  40352 type PRPC_ASYNC_NOTIFICATION_INFO = uintptr
  40353 
  40354 type RpcCallType = uint32
  40355 
  40356 type RpcLocalAddressFormat = uint32
  40357 
  40358 type RPC_NOTIFICATIONS = uint32
  40359 
  40360 type RpcCallClientLocality = uint32
  40361 
  40362 type HDROP__ = struct{ Funused int32 }
  40363 
  40364 type HDROP = uintptr
  40365 
  40366 type _DRAGINFOA = struct {
  40367 	FuSize       UINT
  40368 	Fpt          POINT
  40369 	FfNC         WINBOOL
  40370 	FlpFileList  LPSTR
  40371 	FgrfKeyState DWORD
  40372 	F__ccgo_pad1 [4]byte
  40373 }
  40374 
  40375 type DRAGINFOA = _DRAGINFOA
  40376 type LPDRAGINFOA = uintptr
  40377 
  40378 type _DRAGINFOW = struct {
  40379 	FuSize       UINT
  40380 	Fpt          POINT
  40381 	FfNC         WINBOOL
  40382 	FlpFileList  LPWSTR
  40383 	FgrfKeyState DWORD
  40384 	F__ccgo_pad1 [4]byte
  40385 }
  40386 
  40387 type DRAGINFOW = _DRAGINFOW
  40388 type LPDRAGINFOW = uintptr
  40389 
  40390 type DRAGINFO = DRAGINFOA
  40391 type LPDRAGINFO = LPDRAGINFOA
  40392 
  40393 type _AppBarData = struct {
  40394 	FcbSize           DWORD
  40395 	F__ccgo_pad1      [4]byte
  40396 	FhWnd             HWND
  40397 	FuCallbackMessage UINT
  40398 	FuEdge            UINT
  40399 	Frc               RECT
  40400 	FlParam           LPARAM
  40401 }
  40402 
  40403 type APPBARDATA = _AppBarData
  40404 type PAPPBARDATA = uintptr
  40405 
  40406 type FILEOP_FLAGS = WORD
  40407 
  40408 type PRINTEROP_FLAGS = WORD
  40409 
  40410 type _SHFILEOPSTRUCTA = struct {
  40411 	Fhwnd                  HWND
  40412 	FwFunc                 UINT
  40413 	F__ccgo_pad1           [4]byte
  40414 	FpFrom                 LPCSTR
  40415 	FpTo                   LPCSTR
  40416 	FfFlags                FILEOP_FLAGS
  40417 	F__ccgo_pad2           [2]byte
  40418 	FfAnyOperationsAborted WINBOOL
  40419 	FhNameMappings         LPVOID
  40420 	FlpszProgressTitle     PCSTR
  40421 }
  40422 
  40423 type SHFILEOPSTRUCTA = _SHFILEOPSTRUCTA
  40424 type LPSHFILEOPSTRUCTA = uintptr
  40425 
  40426 type _SHFILEOPSTRUCTW = struct {
  40427 	Fhwnd                  HWND
  40428 	FwFunc                 UINT
  40429 	F__ccgo_pad1           [4]byte
  40430 	FpFrom                 LPCWSTR
  40431 	FpTo                   LPCWSTR
  40432 	FfFlags                FILEOP_FLAGS
  40433 	F__ccgo_pad2           [2]byte
  40434 	FfAnyOperationsAborted WINBOOL
  40435 	FhNameMappings         LPVOID
  40436 	FlpszProgressTitle     PCWSTR
  40437 }
  40438 
  40439 type SHFILEOPSTRUCTW = _SHFILEOPSTRUCTW
  40440 type LPSHFILEOPSTRUCTW = uintptr
  40441 
  40442 type SHFILEOPSTRUCT = SHFILEOPSTRUCTA
  40443 type LPSHFILEOPSTRUCT = LPSHFILEOPSTRUCTA
  40444 
  40445 type _SHNAMEMAPPINGA = struct {
  40446 	FpszOldPath LPSTR
  40447 	FpszNewPath LPSTR
  40448 	FcchOldPath int32
  40449 	FcchNewPath int32
  40450 }
  40451 
  40452 type SHNAMEMAPPINGA = _SHNAMEMAPPINGA
  40453 type LPSHNAMEMAPPINGA = uintptr
  40454 
  40455 type _SHNAMEMAPPINGW = struct {
  40456 	FpszOldPath LPWSTR
  40457 	FpszNewPath LPWSTR
  40458 	FcchOldPath int32
  40459 	FcchNewPath int32
  40460 }
  40461 
  40462 type SHNAMEMAPPINGW = _SHNAMEMAPPINGW
  40463 type LPSHNAMEMAPPINGW = uintptr
  40464 
  40465 type SHNAMEMAPPING = SHNAMEMAPPINGA
  40466 type LPSHNAMEMAPPING = LPSHNAMEMAPPINGA
  40467 
  40468 type _SHELLEXECUTEINFOA = struct {
  40469 	FcbSize       DWORD
  40470 	FfMask        ULONG
  40471 	Fhwnd         HWND
  40472 	FlpVerb       LPCSTR
  40473 	FlpFile       LPCSTR
  40474 	FlpParameters LPCSTR
  40475 	FlpDirectory  LPCSTR
  40476 	FnShow        int32
  40477 	F__ccgo_pad1  [4]byte
  40478 	FhInstApp     HINSTANCE
  40479 	FlpIDList     uintptr
  40480 	FlpClass      LPCSTR
  40481 	FhkeyClass    HKEY
  40482 	FdwHotKey     DWORD
  40483 	F__ccgo_pad2  [4]byte
  40484 	Fu            struct{ FhIcon HANDLE }
  40485 	FhProcess     HANDLE
  40486 }
  40487 
  40488 type SHELLEXECUTEINFOA = _SHELLEXECUTEINFOA
  40489 type LPSHELLEXECUTEINFOA = uintptr
  40490 
  40491 type _SHELLEXECUTEINFOW = struct {
  40492 	FcbSize       DWORD
  40493 	FfMask        ULONG
  40494 	Fhwnd         HWND
  40495 	FlpVerb       LPCWSTR
  40496 	FlpFile       LPCWSTR
  40497 	FlpParameters LPCWSTR
  40498 	FlpDirectory  LPCWSTR
  40499 	FnShow        int32
  40500 	F__ccgo_pad1  [4]byte
  40501 	FhInstApp     HINSTANCE
  40502 	FlpIDList     uintptr
  40503 	FlpClass      LPCWSTR
  40504 	FhkeyClass    HKEY
  40505 	FdwHotKey     DWORD
  40506 	F__ccgo_pad2  [4]byte
  40507 	Fu            struct{ FhIcon HANDLE }
  40508 	FhProcess     HANDLE
  40509 }
  40510 
  40511 type SHELLEXECUTEINFOW = _SHELLEXECUTEINFOW
  40512 type LPSHELLEXECUTEINFOW = uintptr
  40513 
  40514 type SHELLEXECUTEINFO = SHELLEXECUTEINFOA
  40515 type LPSHELLEXECUTEINFO = LPSHELLEXECUTEINFOA
  40516 
  40517 type _SHCREATEPROCESSINFOW = struct {
  40518 	FcbSize               DWORD
  40519 	FfMask                ULONG
  40520 	Fhwnd                 HWND
  40521 	FpszFile              LPCWSTR
  40522 	FpszParameters        LPCWSTR
  40523 	FpszCurrentDirectory  LPCWSTR
  40524 	FhUserToken           HANDLE
  40525 	FlpProcessAttributes  LPSECURITY_ATTRIBUTES
  40526 	FlpThreadAttributes   LPSECURITY_ATTRIBUTES
  40527 	FbInheritHandles      WINBOOL
  40528 	FdwCreationFlags      DWORD
  40529 	FlpStartupInfo        LPSTARTUPINFOW
  40530 	FlpProcessInformation LPPROCESS_INFORMATION
  40531 }
  40532 
  40533 type SHCREATEPROCESSINFOW = _SHCREATEPROCESSINFOW
  40534 type PSHCREATEPROCESSINFOW = uintptr
  40535 
  40536 type _SHQUERYRBINFO = struct {
  40537 	FcbSize      DWORD
  40538 	F__ccgo_pad1 [4]byte
  40539 	Fi64Size     int64
  40540 	Fi64NumItems int64
  40541 }
  40542 
  40543 type SHQUERYRBINFO = _SHQUERYRBINFO
  40544 type LPSHQUERYRBINFO = uintptr
  40545 
  40546 type _NOTIFYICONDATAA = struct {
  40547 	FcbSize           DWORD
  40548 	F__ccgo_pad1      [4]byte
  40549 	FhWnd             HWND
  40550 	FuID              UINT
  40551 	FuFlags           UINT
  40552 	FuCallbackMessage UINT
  40553 	F__ccgo_pad2      [4]byte
  40554 	FhIcon            HICON
  40555 	FszTip            [128]CHAR
  40556 	FdwState          DWORD
  40557 	FdwStateMask      DWORD
  40558 	FszInfo           [256]CHAR
  40559 	Fu                struct{ FuTimeout UINT }
  40560 	FszInfoTitle      [64]CHAR
  40561 	FdwInfoFlags      DWORD
  40562 	FguidItem         GUID
  40563 }
  40564 
  40565 type NOTIFYICONDATAA = _NOTIFYICONDATAA
  40566 type PNOTIFYICONDATAA = uintptr
  40567 
  40568 type _NOTIFYICONDATAW = struct {
  40569 	FcbSize           DWORD
  40570 	F__ccgo_pad1      [4]byte
  40571 	FhWnd             HWND
  40572 	FuID              UINT
  40573 	FuFlags           UINT
  40574 	FuCallbackMessage UINT
  40575 	F__ccgo_pad2      [4]byte
  40576 	FhIcon            HICON
  40577 	FszTip            [128]WCHAR
  40578 	FdwState          DWORD
  40579 	FdwStateMask      DWORD
  40580 	FszInfo           [256]WCHAR
  40581 	Fu                struct{ FuTimeout UINT }
  40582 	FszInfoTitle      [64]WCHAR
  40583 	FdwInfoFlags      DWORD
  40584 	FguidItem         GUID
  40585 }
  40586 
  40587 type NOTIFYICONDATAW = _NOTIFYICONDATAW
  40588 type PNOTIFYICONDATAW = uintptr
  40589 
  40590 type NOTIFYICONDATA = NOTIFYICONDATAA
  40591 type PNOTIFYICONDATA = PNOTIFYICONDATAA
  40592 
  40593 type _NOTIFYICONIDENTIFIER = struct {
  40594 	FcbSize      DWORD
  40595 	F__ccgo_pad1 [4]byte
  40596 	FhWnd        HWND
  40597 	FuID         UINT
  40598 	FguidItem    GUID
  40599 	F__ccgo_pad2 [4]byte
  40600 }
  40601 
  40602 type NOTIFYICONIDENTIFIER = _NOTIFYICONIDENTIFIER
  40603 type PNOTIFYICONIDENTIFIER = uintptr
  40604 
  40605 type _SHFILEINFOA = struct {
  40606 	FhIcon         HICON
  40607 	FiIcon         int32
  40608 	FdwAttributes  DWORD
  40609 	FszDisplayName [260]CHAR
  40610 	FszTypeName    [80]CHAR
  40611 	F__ccgo_pad1   [4]byte
  40612 }
  40613 
  40614 type SHFILEINFOA = _SHFILEINFOA
  40615 
  40616 type _SHFILEINFOW = struct {
  40617 	FhIcon         HICON
  40618 	FiIcon         int32
  40619 	FdwAttributes  DWORD
  40620 	FszDisplayName [260]WCHAR
  40621 	FszTypeName    [80]WCHAR
  40622 }
  40623 
  40624 type SHFILEINFOW = _SHFILEINFOW
  40625 
  40626 type SHFILEINFO = SHFILEINFOA
  40627 
  40628 type PFNCANSHAREFOLDERW = uintptr
  40629 type PFNSHOWSHAREFOLDERUIW = uintptr
  40630 
  40631 type _PERF_DATA_BLOCK = struct {
  40632 	FSignature        [4]WCHAR
  40633 	FLittleEndian     DWORD
  40634 	FVersion          DWORD
  40635 	FRevision         DWORD
  40636 	FTotalByteLength  DWORD
  40637 	FHeaderLength     DWORD
  40638 	FNumObjectTypes   DWORD
  40639 	FDefaultObject    LONG
  40640 	FSystemTime       SYSTEMTIME
  40641 	F__ccgo_pad1      [4]byte
  40642 	FPerfTime         LARGE_INTEGER
  40643 	FPerfFreq         LARGE_INTEGER
  40644 	FPerfTime100nSec  LARGE_INTEGER
  40645 	FSystemNameLength DWORD
  40646 	FSystemNameOffset DWORD
  40647 }
  40648 
  40649 type PERF_DATA_BLOCK = _PERF_DATA_BLOCK
  40650 type PPERF_DATA_BLOCK = uintptr
  40651 
  40652 type _PERF_OBJECT_TYPE = struct {
  40653 	FTotalByteLength      DWORD
  40654 	FDefinitionLength     DWORD
  40655 	FHeaderLength         DWORD
  40656 	FObjectNameTitleIndex DWORD
  40657 	FObjectNameTitle      DWORD
  40658 	FObjectHelpTitleIndex DWORD
  40659 	FObjectHelpTitle      DWORD
  40660 	FDetailLevel          DWORD
  40661 	FNumCounters          DWORD
  40662 	FDefaultCounter       LONG
  40663 	FNumInstances         LONG
  40664 	FCodePage             DWORD
  40665 	FPerfTime             LARGE_INTEGER
  40666 	FPerfFreq             LARGE_INTEGER
  40667 }
  40668 
  40669 type PERF_OBJECT_TYPE = _PERF_OBJECT_TYPE
  40670 type PPERF_OBJECT_TYPE = uintptr
  40671 
  40672 type _PERF_COUNTER_DEFINITION = struct {
  40673 	FByteLength            DWORD
  40674 	FCounterNameTitleIndex DWORD
  40675 	FCounterNameTitle      DWORD
  40676 	FCounterHelpTitleIndex DWORD
  40677 	FCounterHelpTitle      DWORD
  40678 	FDefaultScale          LONG
  40679 	FDetailLevel           DWORD
  40680 	FCounterType           DWORD
  40681 	FCounterSize           DWORD
  40682 	FCounterOffset         DWORD
  40683 }
  40684 
  40685 type PERF_COUNTER_DEFINITION = _PERF_COUNTER_DEFINITION
  40686 type PPERF_COUNTER_DEFINITION = uintptr
  40687 
  40688 type _PERF_INSTANCE_DEFINITION = struct {
  40689 	FByteLength             DWORD
  40690 	FParentObjectTitleIndex DWORD
  40691 	FParentObjectInstance   DWORD
  40692 	FUniqueID               LONG
  40693 	FNameOffset             DWORD
  40694 	FNameLength             DWORD
  40695 }
  40696 
  40697 type PERF_INSTANCE_DEFINITION = _PERF_INSTANCE_DEFINITION
  40698 type PPERF_INSTANCE_DEFINITION = uintptr
  40699 
  40700 type _PERF_COUNTER_BLOCK = struct{ FByteLength DWORD }
  40701 
  40702 type PERF_COUNTER_BLOCK = _PERF_COUNTER_BLOCK
  40703 type PPERF_COUNTER_BLOCK = uintptr
  40704 
  40705 type U_char = uint8
  40706 type U_short = uint16
  40707 type U_int = uint32
  40708 type U_long = uint32
  40709 
  40710 type U_int64 = uint64
  40711 
  40712 type in_addr = struct {
  40713 	FS_un struct {
  40714 		F__ccgo_pad1 [0]uint32
  40715 		FS_un_b      struct {
  40716 			Fs_b1 U_char
  40717 			Fs_b2 U_char
  40718 			Fs_b3 U_char
  40719 			Fs_b4 U_char
  40720 		}
  40721 	}
  40722 }
  40723 
  40724 type IN_ADDR = in_addr
  40725 type PIN_ADDR = uintptr
  40726 type LPIN_ADDR = uintptr
  40727 
  40728 type SOCKET = UINT_PTR
  40729 
  40730 type fd_set = struct {
  40731 	Ffd_count    U_int
  40732 	F__ccgo_pad1 [4]byte
  40733 	Ffd_array    [64]SOCKET
  40734 }
  40735 
  40736 type Fd_set = fd_set
  40737 
  40738 type FD_SET = fd_set
  40739 type PFD_SET = uintptr
  40740 type LPFD_SET = uintptr
  40741 
  40742 type hostent = struct {
  40743 	Fh_name      uintptr
  40744 	Fh_aliases   uintptr
  40745 	Fh_addrtype  int16
  40746 	Fh_length    int16
  40747 	F__ccgo_pad1 [4]byte
  40748 	Fh_addr_list uintptr
  40749 }
  40750 
  40751 type netent = struct {
  40752 	Fn_name      uintptr
  40753 	Fn_aliases   uintptr
  40754 	Fn_addrtype  int16
  40755 	F__ccgo_pad1 [2]byte
  40756 	Fn_net       U_long
  40757 }
  40758 
  40759 type servent = struct {
  40760 	Fs_name      uintptr
  40761 	Fs_aliases   uintptr
  40762 	Fs_proto     uintptr
  40763 	Fs_port      int16
  40764 	F__ccgo_pad1 [6]byte
  40765 }
  40766 
  40767 type protoent = struct {
  40768 	Fp_name      uintptr
  40769 	Fp_aliases   uintptr
  40770 	Fp_proto     int16
  40771 	F__ccgo_pad1 [6]byte
  40772 }
  40773 
  40774 type sockproto = struct {
  40775 	Fsp_family   U_short
  40776 	Fsp_protocol U_short
  40777 }
  40778 
  40779 type linger = struct {
  40780 	Fl_onoff  U_short
  40781 	Fl_linger U_short
  40782 }
  40783 
  40784 type sockaddr = struct {
  40785 	Fsa_family U_short
  40786 	Fsa_data   [14]int8
  40787 }
  40788 
  40789 type sockaddr_in = struct {
  40790 	Fsin_family int16
  40791 	Fsin_port   U_short
  40792 	Fsin_addr   struct {
  40793 		FS_un struct {
  40794 			F__ccgo_pad1 [0]uint32
  40795 			FS_un_b      struct {
  40796 				Fs_b1 U_char
  40797 				Fs_b2 U_char
  40798 				Fs_b3 U_char
  40799 				Fs_b4 U_char
  40800 			}
  40801 		}
  40802 	}
  40803 	Fsin_zero [8]int8
  40804 }
  40805 
  40806 type HOSTENT = hostent
  40807 type PHOSTENT = uintptr
  40808 type LPHOSTENT = uintptr
  40809 
  40810 type SERVENT = servent
  40811 type PSERVENT = uintptr
  40812 type LPSERVENT = uintptr
  40813 
  40814 type PROTOENT = protoent
  40815 type PPROTOENT = uintptr
  40816 type LPPROTOENT = uintptr
  40817 
  40818 type SOCKADDR = sockaddr
  40819 type PSOCKADDR = uintptr
  40820 type LPSOCKADDR = uintptr
  40821 
  40822 type SOCKADDR_IN = sockaddr_in
  40823 type PSOCKADDR_IN = uintptr
  40824 type LPSOCKADDR_IN = uintptr
  40825 
  40826 type LINGER = linger
  40827 type PLINGER = uintptr
  40828 type LPLINGER = uintptr
  40829 
  40830 type TIMEVAL = timeval
  40831 type PTIMEVAL = uintptr
  40832 type LPTIMEVAL = uintptr
  40833 
  40834 type ip_mreq = struct {
  40835 	Fimr_multiaddr struct {
  40836 		FS_un struct {
  40837 			F__ccgo_pad1 [0]uint32
  40838 			FS_un_b      struct {
  40839 				Fs_b1 U_char
  40840 				Fs_b2 U_char
  40841 				Fs_b3 U_char
  40842 				Fs_b4 U_char
  40843 			}
  40844 		}
  40845 	}
  40846 	Fimr_interface struct {
  40847 		FS_un struct {
  40848 			F__ccgo_pad1 [0]uint32
  40849 			FS_un_b      struct {
  40850 				Fs_b1 U_char
  40851 				Fs_b2 U_char
  40852 				Fs_b3 U_char
  40853 				Fs_b4 U_char
  40854 			}
  40855 		}
  40856 	}
  40857 }
  40858 
  40859 type WSAData = struct {
  40860 	FwVersion       WORD
  40861 	FwHighVersion   WORD
  40862 	FiMaxSockets    uint16
  40863 	FiMaxUdpDg      uint16
  40864 	FlpVendorInfo   uintptr
  40865 	FszDescription  [257]int8
  40866 	FszSystemStatus [129]int8
  40867 	F__ccgo_pad1    [6]byte
  40868 }
  40869 
  40870 type WSADATA = WSAData
  40871 type LPWSADATA = uintptr
  40872 
  40873 type _TRANSMIT_FILE_BUFFERS = struct {
  40874 	FHead        LPVOID
  40875 	FHeadLength  DWORD
  40876 	F__ccgo_pad1 [4]byte
  40877 	FTail        LPVOID
  40878 	FTailLength  DWORD
  40879 	F__ccgo_pad2 [4]byte
  40880 }
  40881 
  40882 type TRANSMIT_FILE_BUFFERS = _TRANSMIT_FILE_BUFFERS
  40883 type PTRANSMIT_FILE_BUFFERS = uintptr
  40884 type LPTRANSMIT_FILE_BUFFERS = uintptr
  40885 
  40886 type ALG_ID = uint32
  40887 
  40888 // In ncrypt.h too
  40889 type HCRYPTHASH = ULONG_PTR
  40890 type HCRYPTKEY = ULONG_PTR
  40891 type HCRYPTPROV = ULONG_PTR
  40892 
  40893 type _CMS_KEY_INFO = struct {
  40894 	FdwVersion   DWORD
  40895 	FAlgid       ALG_ID
  40896 	FpbOID       uintptr
  40897 	FcbOID       DWORD
  40898 	F__ccgo_pad1 [4]byte
  40899 }
  40900 
  40901 type CMS_KEY_INFO = _CMS_KEY_INFO
  40902 type PCMS_KEY_INFO = uintptr
  40903 
  40904 type _HMAC_Info = struct {
  40905 	FHashAlgid     ALG_ID
  40906 	F__ccgo_pad1   [4]byte
  40907 	FpbInnerString uintptr
  40908 	FcbInnerString DWORD
  40909 	F__ccgo_pad2   [4]byte
  40910 	FpbOuterString uintptr
  40911 	FcbOuterString DWORD
  40912 	F__ccgo_pad3   [4]byte
  40913 }
  40914 
  40915 type HMAC_INFO = _HMAC_Info
  40916 type PHMAC_INFO = uintptr
  40917 
  40918 type _SCHANNEL_ALG = struct {
  40919 	FdwUse      DWORD
  40920 	FAlgid      ALG_ID
  40921 	FcBits      DWORD
  40922 	FdwFlags    DWORD
  40923 	FdwReserved DWORD
  40924 }
  40925 
  40926 type SCHANNEL_ALG = _SCHANNEL_ALG
  40927 type PSCHANNEL_ALG = uintptr
  40928 
  40929 type _PROV_ENUMALGS = struct {
  40930 	FaiAlgid   ALG_ID
  40931 	FdwBitLen  DWORD
  40932 	FdwNameLen DWORD
  40933 	FszName    [20]CHAR
  40934 }
  40935 
  40936 type PROV_ENUMALGS = _PROV_ENUMALGS
  40937 
  40938 type _PROV_ENUMALGS_EX = struct {
  40939 	FaiAlgid       ALG_ID
  40940 	FdwDefaultLen  DWORD
  40941 	FdwMinLen      DWORD
  40942 	FdwMaxLen      DWORD
  40943 	FdwProtocols   DWORD
  40944 	FdwNameLen     DWORD
  40945 	FszName        [20]CHAR
  40946 	FdwLongNameLen DWORD
  40947 	FszLongName    [40]CHAR
  40948 }
  40949 
  40950 type PROV_ENUMALGS_EX = _PROV_ENUMALGS_EX
  40951 
  40952 type _PUBLICKEYSTRUC = struct {
  40953 	FbType    BYTE
  40954 	FbVersion BYTE
  40955 	Freserved WORD
  40956 	FaiKeyAlg ALG_ID
  40957 }
  40958 
  40959 type BLOBHEADER = _PUBLICKEYSTRUC
  40960 type PUBLICKEYSTRUC = _PUBLICKEYSTRUC
  40961 
  40962 type _RSAPUBKEY = struct {
  40963 	Fmagic  DWORD
  40964 	Fbitlen DWORD
  40965 	Fpubexp DWORD
  40966 }
  40967 
  40968 type RSAPUBKEY = _RSAPUBKEY
  40969 
  40970 type _PUBKEY = struct {
  40971 	Fmagic  DWORD
  40972 	Fbitlen DWORD
  40973 }
  40974 
  40975 type DHPUBKEY = _PUBKEY
  40976 type DSSPUBKEY = _PUBKEY
  40977 type KEAPUBKEY = _PUBKEY
  40978 type TEKPUBKEY = _PUBKEY
  40979 
  40980 type _DSSSEED = struct {
  40981 	Fcounter DWORD
  40982 	Fseed    [20]BYTE
  40983 }
  40984 
  40985 type DSSSEED = _DSSSEED
  40986 
  40987 type _PUBKEYVER3 = struct {
  40988 	Fmagic   DWORD
  40989 	FbitlenP DWORD
  40990 	FbitlenQ DWORD
  40991 	FbitlenJ DWORD
  40992 	FDSSSeed DSSSEED
  40993 }
  40994 
  40995 type DHPUBKEY_VER3 = _PUBKEYVER3
  40996 type DSSPUBKEY_VER3 = _PUBKEYVER3
  40997 
  40998 type _PRIVKEYVER3 = struct {
  40999 	Fmagic   DWORD
  41000 	FbitlenP DWORD
  41001 	FbitlenQ DWORD
  41002 	FbitlenJ DWORD
  41003 	FbitlenX DWORD
  41004 	FDSSSeed DSSSEED
  41005 }
  41006 
  41007 type DHPRIVKEY_VER3 = _PRIVKEYVER3
  41008 type DSSPRIVKEY_VER3 = _PRIVKEYVER3
  41009 
  41010 type _KEY_TYPE_SUBTYPE = struct {
  41011 	FdwKeySpec DWORD
  41012 	FType      GUID
  41013 	FSubtype   GUID
  41014 }
  41015 
  41016 type KEY_TYPE_SUBTYPE = _KEY_TYPE_SUBTYPE
  41017 type PKEY_TYPE_SUBTYPE = uintptr
  41018 
  41019 type _CERT_FORTEZZA_DATA_PROP = struct {
  41020 	FSerialNumber [8]uint8
  41021 	FCertIndex    int32
  41022 	FCertLabel    [36]uint8
  41023 }
  41024 
  41025 type CERT_FORTEZZA_DATA_PROP = _CERT_FORTEZZA_DATA_PROP
  41026 
  41027 type _CRYPT_RC4_KEY_STATE = struct {
  41028 	FKey  [16]uint8
  41029 	FSBox [256]uint8
  41030 	Fi    uint8
  41031 	Fj    uint8
  41032 }
  41033 
  41034 type CRYPT_RC4_KEY_STATE = _CRYPT_RC4_KEY_STATE
  41035 type PCRYPT_RC4_KEY_STATE = uintptr
  41036 
  41037 type _CRYPT_DES_KEY_STATE = struct {
  41038 	FKey      [8]uint8
  41039 	FIV       [8]uint8
  41040 	FFeedback [8]uint8
  41041 }
  41042 
  41043 type CRYPT_DES_KEY_STATE = _CRYPT_DES_KEY_STATE
  41044 type PCRYPT_DES_KEY_STATE = uintptr
  41045 
  41046 type _CRYPT_3DES_KEY_STATE = struct {
  41047 	FKey      [24]uint8
  41048 	FIV       [8]uint8
  41049 	FFeedback [8]uint8
  41050 }
  41051 
  41052 type CRYPT_3DES_KEY_STATE = _CRYPT_3DES_KEY_STATE
  41053 type PCRYPT_3DES_KEY_STATE = uintptr
  41054 
  41055 type _CRYPTOAPI_BLOB = struct {
  41056 	FcbData      DWORD
  41057 	F__ccgo_pad1 [4]byte
  41058 	FpbData      uintptr
  41059 }
  41060 
  41061 type CRYPT_INTEGER_BLOB = _CRYPTOAPI_BLOB
  41062 type PCRYPT_INTEGER_BLOB = uintptr
  41063 type CRYPT_UINT_BLOB = _CRYPTOAPI_BLOB
  41064 type PCRYPT_UINT_BLOB = uintptr
  41065 type CRYPT_OBJID_BLOB = _CRYPTOAPI_BLOB
  41066 type PCRYPT_OBJID_BLOB = uintptr
  41067 type CERT_NAME_BLOB = _CRYPTOAPI_BLOB
  41068 type PCERT_NAME_BLOB = uintptr
  41069 type CERT_RDN_VALUE_BLOB = _CRYPTOAPI_BLOB
  41070 type PCERT_RDN_VALUE_BLOB = uintptr
  41071 type CERT_BLOB = _CRYPTOAPI_BLOB
  41072 type PCERT_BLOB = uintptr
  41073 type CRL_BLOB = _CRYPTOAPI_BLOB
  41074 type PCRL_BLOB = uintptr
  41075 type DATA_BLOB = _CRYPTOAPI_BLOB
  41076 type PDATA_BLOB = uintptr
  41077 type CRYPT_DATA_BLOB = _CRYPTOAPI_BLOB
  41078 type PCRYPT_DATA_BLOB = uintptr
  41079 type CRYPT_HASH_BLOB = _CRYPTOAPI_BLOB
  41080 type PCRYPT_HASH_BLOB = uintptr
  41081 type CRYPT_DIGEST_BLOB = _CRYPTOAPI_BLOB
  41082 type PCRYPT_DIGEST_BLOB = uintptr
  41083 type CRYPT_DER_BLOB = _CRYPTOAPI_BLOB
  41084 type PCRYPT_DER_BLOB = uintptr
  41085 type CRYPT_ATTR_BLOB = _CRYPTOAPI_BLOB
  41086 type PCRYPT_ATTR_BLOB = uintptr
  41087 type _CMS_DH_KEY_INFO = struct {
  41088 	FdwVersion          DWORD
  41089 	FAlgid              ALG_ID
  41090 	FpszContentEncObjId LPSTR
  41091 	FPubInfo            CRYPT_DATA_BLOB
  41092 	FpReserved          uintptr
  41093 }
  41094 
  41095 type CMS_DH_KEY_INFO = _CMS_DH_KEY_INFO
  41096 type PCMS_DH_KEY_INFO = uintptr
  41097 
  41098 type HCRYPTPROV_OR_NCRYPT_KEY_HANDLE = ULONG_PTR
  41099 type HCRYPTPROV_LEGACY = ULONG_PTR
  41100 
  41101 type NTSTATUS = LONG
  41102 type PNTSTATUS = uintptr
  41103 
  41104 type __BCRYPT_KEY_LENGTHS_STRUCT = struct {
  41105 	FdwMinLength ULONG
  41106 	FdwMaxLength ULONG
  41107 	FdwIncrement ULONG
  41108 }
  41109 
  41110 type BCRYPT_KEY_LENGTHS_STRUCT = __BCRYPT_KEY_LENGTHS_STRUCT
  41111 
  41112 type BCRYPT_AUTH_TAG_LENGTHS_STRUCT = BCRYPT_KEY_LENGTHS_STRUCT
  41113 
  41114 type _BCRYPT_OID = struct {
  41115 	FcbOID       ULONG
  41116 	F__ccgo_pad1 [4]byte
  41117 	FpbOID       PUCHAR
  41118 }
  41119 
  41120 type BCRYPT_OID = _BCRYPT_OID
  41121 
  41122 type _BCRYPT_OID_LIST = struct {
  41123 	FdwOIDCount  ULONG
  41124 	F__ccgo_pad1 [4]byte
  41125 	FpOIDs       uintptr
  41126 }
  41127 
  41128 type BCRYPT_OID_LIST = _BCRYPT_OID_LIST
  41129 
  41130 type _BCRYPT_PKCS1_PADDING_INFO = struct{ FpszAlgId LPCWSTR }
  41131 
  41132 type BCRYPT_PKCS1_PADDING_INFO = _BCRYPT_PKCS1_PADDING_INFO
  41133 
  41134 type _BCRYPT_PSS_PADDING_INFO = struct {
  41135 	FpszAlgId    LPCWSTR
  41136 	FcbSalt      ULONG
  41137 	F__ccgo_pad1 [4]byte
  41138 }
  41139 
  41140 type BCRYPT_PSS_PADDING_INFO = _BCRYPT_PSS_PADDING_INFO
  41141 
  41142 type _BCRYPT_OAEP_PADDING_INFO = struct {
  41143 	FpszAlgId    LPCWSTR
  41144 	FpbLabel     PUCHAR
  41145 	FcbLabel     ULONG
  41146 	F__ccgo_pad1 [4]byte
  41147 }
  41148 
  41149 type BCRYPT_OAEP_PADDING_INFO = _BCRYPT_OAEP_PADDING_INFO
  41150 
  41151 type _BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO = struct {
  41152 	FcbSize        ULONG
  41153 	FdwInfoVersion ULONG
  41154 	FpbNonce       PUCHAR
  41155 	FcbNonce       ULONG
  41156 	F__ccgo_pad1   [4]byte
  41157 	FpbAuthData    PUCHAR
  41158 	FcbAuthData    ULONG
  41159 	F__ccgo_pad2   [4]byte
  41160 	FpbTag         PUCHAR
  41161 	FcbTag         ULONG
  41162 	F__ccgo_pad3   [4]byte
  41163 	FpbMacContext  PUCHAR
  41164 	FcbMacContext  ULONG
  41165 	FcbAAD         ULONG
  41166 	FcbData        ULONGLONG
  41167 	FdwFlags       ULONG
  41168 	F__ccgo_pad4   [4]byte
  41169 }
  41170 
  41171 type BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO = _BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO
  41172 type PBCRYPT_AUTHENTICATED_CIPHER_MODE_INFO = uintptr
  41173 
  41174 type _BCryptBuffer = struct {
  41175 	FcbBuffer   ULONG
  41176 	FBufferType ULONG
  41177 	FpvBuffer   PVOID
  41178 }
  41179 
  41180 type BCryptBuffer = _BCryptBuffer
  41181 type PBCryptBuffer = uintptr
  41182 
  41183 type _BCryptBufferDesc = struct {
  41184 	FulVersion ULONG
  41185 	FcBuffers  ULONG
  41186 	FpBuffers  PBCryptBuffer
  41187 }
  41188 
  41189 type BCryptBufferDesc = _BCryptBufferDesc
  41190 type PBCryptBufferDesc = uintptr
  41191 
  41192 type BCRYPT_HANDLE = PVOID
  41193 type BCRYPT_ALG_HANDLE = PVOID
  41194 type BCRYPT_KEY_HANDLE = PVOID
  41195 type BCRYPT_HASH_HANDLE = PVOID
  41196 type BCRYPT_SECRET_HANDLE = PVOID
  41197 
  41198 type _BCRYPT_KEY_BLOB = struct{ FMagic ULONG }
  41199 
  41200 type BCRYPT_KEY_BLOB = _BCRYPT_KEY_BLOB
  41201 
  41202 type _BCRYPT_RSAKEY_BLOB = struct {
  41203 	FMagic       ULONG
  41204 	FBitLength   ULONG
  41205 	FcbPublicExp ULONG
  41206 	FcbModulus   ULONG
  41207 	FcbPrime1    ULONG
  41208 	FcbPrime2    ULONG
  41209 }
  41210 
  41211 type BCRYPT_RSAKEY_BLOB = _BCRYPT_RSAKEY_BLOB
  41212 
  41213 type _BCRYPT_ECCKEY_BLOB = struct {
  41214 	FdwMagic ULONG
  41215 	FcbKey   ULONG
  41216 }
  41217 
  41218 type BCRYPT_ECCKEY_BLOB = _BCRYPT_ECCKEY_BLOB
  41219 type PBCRYPT_ECCKEY_BLOB = uintptr
  41220 
  41221 type _BCRYPT_DH_KEY_BLOB = struct {
  41222 	FdwMagic ULONG
  41223 	FcbKey   ULONG
  41224 }
  41225 
  41226 type BCRYPT_DH_KEY_BLOB = _BCRYPT_DH_KEY_BLOB
  41227 type PBCRYPT_DH_KEY_BLOB = uintptr
  41228 
  41229 type _BCRYPT_DH_PARAMETER_HEADER = struct {
  41230 	FcbLength    ULONG
  41231 	FdwMagic     ULONG
  41232 	FcbKeyLength ULONG
  41233 }
  41234 
  41235 type BCRYPT_DH_PARAMETER_HEADER = _BCRYPT_DH_PARAMETER_HEADER
  41236 
  41237 type _BCRYPT_DSA_KEY_BLOB = struct {
  41238 	FdwMagic ULONG
  41239 	FcbKey   ULONG
  41240 	FCount   [4]UCHAR
  41241 	FSeed    [20]UCHAR
  41242 	Fq       [20]UCHAR
  41243 }
  41244 
  41245 type BCRYPT_DSA_KEY_BLOB = _BCRYPT_DSA_KEY_BLOB
  41246 type PBCRYPT_DSA_KEY_BLOB = uintptr
  41247 
  41248 type HASHALGORITHM_ENUM = uint32
  41249 
  41250 type DSAFIPSVERSION_ENUM = uint32
  41251 type _BCRYPT_DSA_KEY_BLOB_V2 = struct {
  41252 	FdwMagic         ULONG
  41253 	FcbKey           ULONG
  41254 	FhashAlgorithm   HASHALGORITHM_ENUM
  41255 	FstandardVersion DSAFIPSVERSION_ENUM
  41256 	FcbSeedLength    ULONG
  41257 	FcbGroupSize     ULONG
  41258 	FCount           [4]UCHAR
  41259 }
  41260 
  41261 type BCRYPT_DSA_KEY_BLOB_V2 = _BCRYPT_DSA_KEY_BLOB_V2
  41262 type PBCRYPT_DSA_KEY_BLOB_V2 = uintptr
  41263 
  41264 type _BCRYPT_KEY_DATA_BLOB_HEADER = struct {
  41265 	FdwMagic   ULONG
  41266 	FdwVersion ULONG
  41267 	FcbKeyData ULONG
  41268 }
  41269 
  41270 type BCRYPT_KEY_DATA_BLOB_HEADER = _BCRYPT_KEY_DATA_BLOB_HEADER
  41271 type PBCRYPT_KEY_DATA_BLOB_HEADER = uintptr
  41272 
  41273 type _BCRYPT_DSA_PARAMETER_HEADER = struct {
  41274 	FcbLength    ULONG
  41275 	FdwMagic     ULONG
  41276 	FcbKeyLength ULONG
  41277 	FCount       [4]UCHAR
  41278 	FSeed        [20]UCHAR
  41279 	Fq           [20]UCHAR
  41280 }
  41281 
  41282 type BCRYPT_DSA_PARAMETER_HEADER = _BCRYPT_DSA_PARAMETER_HEADER
  41283 
  41284 type _BCRYPT_DSA_PARAMETER_HEADER_V2 = struct {
  41285 	FcbLength        ULONG
  41286 	FdwMagic         ULONG
  41287 	FcbKeyLength     ULONG
  41288 	FhashAlgorithm   HASHALGORITHM_ENUM
  41289 	FstandardVersion DSAFIPSVERSION_ENUM
  41290 	FcbSeedLength    ULONG
  41291 	FcbGroupSize     ULONG
  41292 	FCount           [4]UCHAR
  41293 }
  41294 
  41295 type BCRYPT_DSA_PARAMETER_HEADER_V2 = _BCRYPT_DSA_PARAMETER_HEADER_V2
  41296 
  41297 type _BCRYPT_ALGORITHM_IDENTIFIER = struct {
  41298 	FpszName LPWSTR
  41299 	FdwClass ULONG
  41300 	FdwFlags ULONG
  41301 }
  41302 
  41303 type BCRYPT_ALGORITHM_IDENTIFIER = _BCRYPT_ALGORITHM_IDENTIFIER
  41304 
  41305 type _BCRYPT_PROVIDER_NAME = struct{ FpszProviderName LPWSTR }
  41306 
  41307 type BCRYPT_PROVIDER_NAME = _BCRYPT_PROVIDER_NAME
  41308 
  41309 type _BCRYPT_INTERFACE_VERSION = struct {
  41310 	FMajorVersion USHORT
  41311 	FMinorVersion USHORT
  41312 }
  41313 
  41314 type BCRYPT_INTERFACE_VERSION = _BCRYPT_INTERFACE_VERSION
  41315 type PBCRYPT_INTERFACE_VERSION = uintptr
  41316 
  41317 type _CRYPT_INTERFACE_REG = struct {
  41318 	FdwInterface    ULONG
  41319 	FdwFlags        ULONG
  41320 	FcFunctions     ULONG
  41321 	F__ccgo_pad1    [4]byte
  41322 	FrgpszFunctions uintptr
  41323 }
  41324 
  41325 type CRYPT_INTERFACE_REG = _CRYPT_INTERFACE_REG
  41326 type PCRYPT_INTERFACE_REG = uintptr
  41327 
  41328 type _CRYPT_IMAGE_REG = struct {
  41329 	FpszImage      PWSTR
  41330 	FcInterfaces   ULONG
  41331 	F__ccgo_pad1   [4]byte
  41332 	FrgpInterfaces uintptr
  41333 }
  41334 
  41335 type CRYPT_IMAGE_REG = _CRYPT_IMAGE_REG
  41336 type PCRYPT_IMAGE_REG = uintptr
  41337 
  41338 type _CRYPT_PROVIDER_REG = struct {
  41339 	FcAliases     ULONG
  41340 	F__ccgo_pad1  [4]byte
  41341 	FrgpszAliases uintptr
  41342 	FpUM          PCRYPT_IMAGE_REG
  41343 	FpKM          PCRYPT_IMAGE_REG
  41344 }
  41345 
  41346 type CRYPT_PROVIDER_REG = _CRYPT_PROVIDER_REG
  41347 type PCRYPT_PROVIDER_REG = uintptr
  41348 
  41349 type _CRYPT_PROVIDERS = struct {
  41350 	FcProviders     ULONG
  41351 	F__ccgo_pad1    [4]byte
  41352 	FrgpszProviders uintptr
  41353 }
  41354 
  41355 type CRYPT_PROVIDERS = _CRYPT_PROVIDERS
  41356 type PCRYPT_PROVIDERS = uintptr
  41357 
  41358 type _CRYPT_CONTEXT_CONFIG = struct {
  41359 	FdwFlags    ULONG
  41360 	FdwReserved ULONG
  41361 }
  41362 
  41363 type CRYPT_CONTEXT_CONFIG = _CRYPT_CONTEXT_CONFIG
  41364 type PCRYPT_CONTEXT_CONFIG = uintptr
  41365 
  41366 type _CRYPT_CONTEXT_FUNCTION_CONFIG = struct {
  41367 	FdwFlags    ULONG
  41368 	FdwReserved ULONG
  41369 }
  41370 
  41371 type CRYPT_CONTEXT_FUNCTION_CONFIG = _CRYPT_CONTEXT_FUNCTION_CONFIG
  41372 type PCRYPT_CONTEXT_FUNCTION_CONFIG = uintptr
  41373 
  41374 type _CRYPT_CONTEXTS = struct {
  41375 	FcContexts     ULONG
  41376 	F__ccgo_pad1   [4]byte
  41377 	FrgpszContexts uintptr
  41378 }
  41379 
  41380 type CRYPT_CONTEXTS = _CRYPT_CONTEXTS
  41381 type PCRYPT_CONTEXTS = uintptr
  41382 
  41383 type _CRYPT_CONTEXT_FUNCTIONS = struct {
  41384 	FcFunctions     ULONG
  41385 	F__ccgo_pad1    [4]byte
  41386 	FrgpszFunctions uintptr
  41387 }
  41388 
  41389 type CRYPT_CONTEXT_FUNCTIONS = _CRYPT_CONTEXT_FUNCTIONS
  41390 type PCRYPT_CONTEXT_FUNCTIONS = uintptr
  41391 
  41392 type _CRYPT_CONTEXT_FUNCTION_PROVIDERS = struct {
  41393 	FcProviders     ULONG
  41394 	F__ccgo_pad1    [4]byte
  41395 	FrgpszProviders uintptr
  41396 }
  41397 
  41398 type CRYPT_CONTEXT_FUNCTION_PROVIDERS = _CRYPT_CONTEXT_FUNCTION_PROVIDERS
  41399 type PCRYPT_CONTEXT_FUNCTION_PROVIDERS = uintptr
  41400 
  41401 type _CRYPT_PROPERTY_REF = struct {
  41402 	FpszProperty PWSTR
  41403 	FcbValue     ULONG
  41404 	F__ccgo_pad1 [4]byte
  41405 	FpbValue     PUCHAR
  41406 }
  41407 
  41408 type CRYPT_PROPERTY_REF = _CRYPT_PROPERTY_REF
  41409 type PCRYPT_PROPERTY_REF = uintptr
  41410 
  41411 type _CRYPT_IMAGE_REF = struct {
  41412 	FpszImage    PWSTR
  41413 	FdwFlags     ULONG
  41414 	F__ccgo_pad1 [4]byte
  41415 }
  41416 
  41417 type CRYPT_IMAGE_REF = _CRYPT_IMAGE_REF
  41418 type PCRYPT_IMAGE_REF = uintptr
  41419 
  41420 type _CRYPT_PROVIDER_REF = struct {
  41421 	FdwInterface   ULONG
  41422 	F__ccgo_pad1   [4]byte
  41423 	FpszFunction   PWSTR
  41424 	FpszProvider   PWSTR
  41425 	FcProperties   ULONG
  41426 	F__ccgo_pad2   [4]byte
  41427 	FrgpProperties uintptr
  41428 	FpUM           PCRYPT_IMAGE_REF
  41429 	FpKM           PCRYPT_IMAGE_REF
  41430 }
  41431 
  41432 type CRYPT_PROVIDER_REF = _CRYPT_PROVIDER_REF
  41433 type PCRYPT_PROVIDER_REF = uintptr
  41434 
  41435 type _CRYPT_PROVIDER_REFS = struct {
  41436 	FcProviders   ULONG
  41437 	F__ccgo_pad1  [4]byte
  41438 	FrgpProviders uintptr
  41439 }
  41440 
  41441 type CRYPT_PROVIDER_REFS = _CRYPT_PROVIDER_REFS
  41442 type PCRYPT_PROVIDER_REFS = uintptr
  41443 
  41444 type SECURITY_STATUS = LONG
  41445 
  41446 type PFN_NCRYPT_ALLOC = uintptr
  41447 type PFN_NCRYPT_FREE = uintptr
  41448 
  41449 type NCRYPT_ALLOC_PARA1 = struct {
  41450 	FcbSize      DWORD
  41451 	F__ccgo_pad1 [4]byte
  41452 	FpfnAlloc    PFN_NCRYPT_ALLOC
  41453 	FpfnFree     PFN_NCRYPT_FREE
  41454 }
  41455 
  41456 type NCRYPT_ALLOC_PARA = NCRYPT_ALLOC_PARA1
  41457 
  41458 type NCryptBuffer = BCryptBuffer
  41459 type PNCryptBuffer = uintptr
  41460 type NCryptBufferDesc = BCryptBufferDesc
  41461 type PNCryptBufferDesc = uintptr
  41462 
  41463 type NCRYPT_HANDLE = ULONG_PTR
  41464 type NCRYPT_PROV_HANDLE = ULONG_PTR
  41465 type NCRYPT_KEY_HANDLE = ULONG_PTR
  41466 type NCRYPT_HASH_HANDLE = ULONG_PTR
  41467 type NCRYPT_SECRET_HANDLE = ULONG_PTR
  41468 
  41469 type _NCryptAlgorithmName = struct {
  41470 	FpszName         LPWSTR
  41471 	FdwClass         DWORD
  41472 	FdwAlgOperations DWORD
  41473 	FdwFlags         DWORD
  41474 	F__ccgo_pad1     [4]byte
  41475 }
  41476 
  41477 type NCryptAlgorithmName = _NCryptAlgorithmName
  41478 
  41479 type NCryptKeyName1 = struct {
  41480 	FpszName         LPWSTR
  41481 	FpszAlgid        LPWSTR
  41482 	FdwLegacyKeySpec DWORD
  41483 	FdwFlags         DWORD
  41484 }
  41485 
  41486 type NCryptKeyName = NCryptKeyName1
  41487 
  41488 type NCryptProviderName1 = struct {
  41489 	FpszName    LPWSTR
  41490 	FpszComment LPWSTR
  41491 }
  41492 
  41493 type NCryptProviderName = NCryptProviderName1
  41494 
  41495 type __NCRYPT_UI_POLICY = struct {
  41496 	FdwVersion        DWORD
  41497 	FdwFlags          DWORD
  41498 	FpszCreationTitle LPCWSTR
  41499 	FpszFriendlyName  LPCWSTR
  41500 	FpszDescription   LPCWSTR
  41501 }
  41502 
  41503 type NCRYPT_UI_POLICY = __NCRYPT_UI_POLICY
  41504 
  41505 type __NCRYPT_SUPPORTED_LENGTHS = struct {
  41506 	FdwMinLength     DWORD
  41507 	FdwMaxLength     DWORD
  41508 	FdwIncrement     DWORD
  41509 	FdwDefaultLength DWORD
  41510 }
  41511 
  41512 type NCRYPT_SUPPORTED_LENGTHS = __NCRYPT_SUPPORTED_LENGTHS
  41513 
  41514 type _CRYPT_BIT_BLOB = struct {
  41515 	FcbData      DWORD
  41516 	F__ccgo_pad1 [4]byte
  41517 	FpbData      uintptr
  41518 	FcUnusedBits DWORD
  41519 	F__ccgo_pad2 [4]byte
  41520 }
  41521 
  41522 type CRYPT_BIT_BLOB = _CRYPT_BIT_BLOB
  41523 type PCRYPT_BIT_BLOB = uintptr
  41524 
  41525 type _CRYPT_ALGORITHM_IDENTIFIER = struct {
  41526 	FpszObjId   LPSTR
  41527 	FParameters CRYPT_OBJID_BLOB
  41528 }
  41529 
  41530 type CRYPT_ALGORITHM_IDENTIFIER = _CRYPT_ALGORITHM_IDENTIFIER
  41531 type PCRYPT_ALGORITHM_IDENTIFIER = uintptr
  41532 
  41533 type _CRYPT_OBJID_TABLE = struct {
  41534 	FdwAlgId     DWORD
  41535 	F__ccgo_pad1 [4]byte
  41536 	FpszObjId    LPCSTR
  41537 }
  41538 
  41539 type CRYPT_OBJID_TABLE = _CRYPT_OBJID_TABLE
  41540 type PCRYPT_OBJID_TABLE = uintptr
  41541 
  41542 type _CRYPT_HASH_INFO = struct {
  41543 	FHashAlgorithm CRYPT_ALGORITHM_IDENTIFIER
  41544 	FHash          CRYPT_HASH_BLOB
  41545 }
  41546 
  41547 type CRYPT_HASH_INFO = _CRYPT_HASH_INFO
  41548 type PCRYPT_HASH_INFO = uintptr
  41549 
  41550 type _CERT_EXTENSION = struct {
  41551 	FpszObjId    LPSTR
  41552 	FfCritical   WINBOOL
  41553 	F__ccgo_pad1 [4]byte
  41554 	FValue       CRYPT_OBJID_BLOB
  41555 }
  41556 
  41557 type CERT_EXTENSION = _CERT_EXTENSION
  41558 type PCERT_EXTENSION = uintptr
  41559 
  41560 type PCCERT_EXTENSION = uintptr
  41561 
  41562 type _CRYPT_ATTRIBUTE_TYPE_VALUE = struct {
  41563 	FpszObjId LPSTR
  41564 	FValue    CRYPT_OBJID_BLOB
  41565 }
  41566 
  41567 type CRYPT_ATTRIBUTE_TYPE_VALUE = _CRYPT_ATTRIBUTE_TYPE_VALUE
  41568 type PCRYPT_ATTRIBUTE_TYPE_VALUE = uintptr
  41569 
  41570 type _CRYPT_ATTRIBUTE = struct {
  41571 	FpszObjId    LPSTR
  41572 	FcValue      DWORD
  41573 	F__ccgo_pad1 [4]byte
  41574 	FrgValue     PCRYPT_ATTR_BLOB
  41575 }
  41576 
  41577 type CRYPT_ATTRIBUTE = _CRYPT_ATTRIBUTE
  41578 type PCRYPT_ATTRIBUTE = uintptr
  41579 
  41580 type _CRYPT_ATTRIBUTES = struct {
  41581 	FcAttr       DWORD
  41582 	F__ccgo_pad1 [4]byte
  41583 	FrgAttr      PCRYPT_ATTRIBUTE
  41584 }
  41585 
  41586 type CRYPT_ATTRIBUTES = _CRYPT_ATTRIBUTES
  41587 type PCRYPT_ATTRIBUTES = uintptr
  41588 
  41589 type _CERT_RDN_ATTR = struct {
  41590 	FpszObjId    LPSTR
  41591 	FdwValueType DWORD
  41592 	F__ccgo_pad1 [4]byte
  41593 	FValue       CERT_RDN_VALUE_BLOB
  41594 }
  41595 
  41596 type CERT_RDN_ATTR = _CERT_RDN_ATTR
  41597 type PCERT_RDN_ATTR = uintptr
  41598 
  41599 type _CERT_RDN = struct {
  41600 	FcRDNAttr    DWORD
  41601 	F__ccgo_pad1 [4]byte
  41602 	FrgRDNAttr   PCERT_RDN_ATTR
  41603 }
  41604 
  41605 type CERT_RDN = _CERT_RDN
  41606 type PCERT_RDN = uintptr
  41607 
  41608 type _CERT_NAME_INFO = struct {
  41609 	FcRDN        DWORD
  41610 	F__ccgo_pad1 [4]byte
  41611 	FrgRDN       PCERT_RDN
  41612 }
  41613 
  41614 type CERT_NAME_INFO = _CERT_NAME_INFO
  41615 type PCERT_NAME_INFO = uintptr
  41616 
  41617 type _CERT_NAME_VALUE = struct {
  41618 	FdwValueType DWORD
  41619 	F__ccgo_pad1 [4]byte
  41620 	FValue       CERT_RDN_VALUE_BLOB
  41621 }
  41622 
  41623 type CERT_NAME_VALUE = _CERT_NAME_VALUE
  41624 type PCERT_NAME_VALUE = uintptr
  41625 
  41626 type _CERT_PUBLIC_KEY_INFO = struct {
  41627 	FAlgorithm CRYPT_ALGORITHM_IDENTIFIER
  41628 	FPublicKey CRYPT_BIT_BLOB
  41629 }
  41630 
  41631 type CERT_PUBLIC_KEY_INFO = _CERT_PUBLIC_KEY_INFO
  41632 type PCERT_PUBLIC_KEY_INFO = uintptr
  41633 
  41634 type _CRYPT_ECC_PRIVATE_KEY_INFO = struct {
  41635 	FdwVersion   DWORD
  41636 	F__ccgo_pad1 [4]byte
  41637 	FPrivateKey  CRYPT_DER_BLOB
  41638 	FszCurveOid  LPSTR
  41639 	FPublicKey   CRYPT_BIT_BLOB
  41640 }
  41641 
  41642 type CRYPT_ECC_PRIVATE_KEY_INFO = _CRYPT_ECC_PRIVATE_KEY_INFO
  41643 type PCRYPT_ECC_PRIVATE_KEY_INFO = uintptr
  41644 
  41645 type _CRYPT_PRIVATE_KEY_INFO = struct {
  41646 	FVersion     DWORD
  41647 	F__ccgo_pad1 [4]byte
  41648 	FAlgorithm   CRYPT_ALGORITHM_IDENTIFIER
  41649 	FPrivateKey  CRYPT_DER_BLOB
  41650 	FpAttributes PCRYPT_ATTRIBUTES
  41651 }
  41652 
  41653 type CRYPT_PRIVATE_KEY_INFO = _CRYPT_PRIVATE_KEY_INFO
  41654 type PCRYPT_PRIVATE_KEY_INFO = uintptr
  41655 
  41656 type _CRYPT_ENCRYPTED_PRIVATE_KEY_INFO = struct {
  41657 	FEncryptionAlgorithm CRYPT_ALGORITHM_IDENTIFIER
  41658 	FEncryptedPrivateKey CRYPT_DATA_BLOB
  41659 }
  41660 
  41661 type CRYPT_ENCRYPTED_PRIVATE_KEY_INFO = _CRYPT_ENCRYPTED_PRIVATE_KEY_INFO
  41662 type PCRYPT_ENCRYPTED_PRIVATE_KEY_INFO = uintptr
  41663 
  41664 type PCRYPT_DECRYPT_PRIVATE_KEY_FUNC = uintptr
  41665 type PCRYPT_ENCRYPT_PRIVATE_KEY_FUNC = uintptr
  41666 type PCRYPT_RESOLVE_HCRYPTPROV_FUNC = uintptr
  41667 
  41668 type _CRYPT_PKCS8_IMPORT_PARAMS = struct {
  41669 	FPrivateKey             CRYPT_DIGEST_BLOB
  41670 	FpResolvehCryptProvFunc PCRYPT_RESOLVE_HCRYPTPROV_FUNC
  41671 	FpVoidResolveFunc       LPVOID
  41672 	FpDecryptPrivateKeyFunc PCRYPT_DECRYPT_PRIVATE_KEY_FUNC
  41673 	FpVoidDecryptFunc       LPVOID
  41674 }
  41675 
  41676 type CRYPT_PKCS8_IMPORT_PARAMS = _CRYPT_PKCS8_IMPORT_PARAMS
  41677 type PCRYPT_PKCS8_IMPORT_PARAMS = uintptr
  41678 type CRYPT_PRIVATE_KEY_BLOB_AND_PARAMS = _CRYPT_PKCS8_IMPORT_PARAMS
  41679 type PCRYPT_PRIVATE_KEY_BLOB_AND_PARAMS = uintptr
  41680 
  41681 type _CRYPT_PKCS8_EXPORT_PARAMS = struct {
  41682 	FhCryptProv             HCRYPTPROV
  41683 	FdwKeySpec              DWORD
  41684 	F__ccgo_pad1            [4]byte
  41685 	FpszPrivateKeyObjId     LPSTR
  41686 	FpEncryptPrivateKeyFunc PCRYPT_ENCRYPT_PRIVATE_KEY_FUNC
  41687 	FpVoidEncryptFunc       LPVOID
  41688 }
  41689 
  41690 type CRYPT_PKCS8_EXPORT_PARAMS = _CRYPT_PKCS8_EXPORT_PARAMS
  41691 type PCRYPT_PKCS8_EXPORT_PARAMS = uintptr
  41692 
  41693 type _CERT_INFO = struct {
  41694 	FdwVersion            DWORD
  41695 	F__ccgo_pad1          [4]byte
  41696 	FSerialNumber         CRYPT_INTEGER_BLOB
  41697 	FSignatureAlgorithm   CRYPT_ALGORITHM_IDENTIFIER
  41698 	FIssuer               CERT_NAME_BLOB
  41699 	FNotBefore            FILETIME
  41700 	FNotAfter             FILETIME
  41701 	FSubject              CERT_NAME_BLOB
  41702 	FSubjectPublicKeyInfo CERT_PUBLIC_KEY_INFO
  41703 	FIssuerUniqueId       CRYPT_BIT_BLOB
  41704 	FSubjectUniqueId      CRYPT_BIT_BLOB
  41705 	FcExtension           DWORD
  41706 	F__ccgo_pad2          [4]byte
  41707 	FrgExtension          PCERT_EXTENSION
  41708 }
  41709 
  41710 type CERT_INFO = _CERT_INFO
  41711 type PCERT_INFO = uintptr
  41712 
  41713 type _CRL_ENTRY = struct {
  41714 	FSerialNumber   CRYPT_INTEGER_BLOB
  41715 	FRevocationDate FILETIME
  41716 	FcExtension     DWORD
  41717 	F__ccgo_pad1    [4]byte
  41718 	FrgExtension    PCERT_EXTENSION
  41719 }
  41720 
  41721 type CRL_ENTRY = _CRL_ENTRY
  41722 type PCRL_ENTRY = uintptr
  41723 
  41724 type _CRL_INFO = struct {
  41725 	FdwVersion          DWORD
  41726 	F__ccgo_pad1        [4]byte
  41727 	FSignatureAlgorithm CRYPT_ALGORITHM_IDENTIFIER
  41728 	FIssuer             CERT_NAME_BLOB
  41729 	FThisUpdate         FILETIME
  41730 	FNextUpdate         FILETIME
  41731 	FcCRLEntry          DWORD
  41732 	F__ccgo_pad2        [4]byte
  41733 	FrgCRLEntry         PCRL_ENTRY
  41734 	FcExtension         DWORD
  41735 	F__ccgo_pad3        [4]byte
  41736 	FrgExtension        PCERT_EXTENSION
  41737 }
  41738 
  41739 type CRL_INFO = _CRL_INFO
  41740 type PCRL_INFO = uintptr
  41741 
  41742 type _CERT_OR_CRL_BLOB = struct {
  41743 	FdwChoice  DWORD
  41744 	FcbEncoded DWORD
  41745 	FpbEncoded uintptr
  41746 }
  41747 
  41748 type CERT_OR_CRL_BLOB = _CERT_OR_CRL_BLOB
  41749 type PCERT_OR_CRL_BLOB = uintptr
  41750 
  41751 type _CERT_OR_CRL_BUNDLE = struct {
  41752 	FcItem       DWORD
  41753 	F__ccgo_pad1 [4]byte
  41754 	FrgItem      PCERT_OR_CRL_BLOB
  41755 }
  41756 
  41757 type CERT_OR_CRL_BUNDLE = _CERT_OR_CRL_BUNDLE
  41758 type PCERT_OR_CRL_BUNDLE = uintptr
  41759 
  41760 type _CERT_REQUEST_INFO = struct {
  41761 	FdwVersion            DWORD
  41762 	F__ccgo_pad1          [4]byte
  41763 	FSubject              CERT_NAME_BLOB
  41764 	FSubjectPublicKeyInfo CERT_PUBLIC_KEY_INFO
  41765 	FcAttribute           DWORD
  41766 	F__ccgo_pad2          [4]byte
  41767 	FrgAttribute          PCRYPT_ATTRIBUTE
  41768 }
  41769 
  41770 type CERT_REQUEST_INFO = _CERT_REQUEST_INFO
  41771 type PCERT_REQUEST_INFO = uintptr
  41772 
  41773 type _CERT_KEYGEN_REQUEST_INFO = struct {
  41774 	FdwVersion            DWORD
  41775 	F__ccgo_pad1          [4]byte
  41776 	FSubjectPublicKeyInfo CERT_PUBLIC_KEY_INFO
  41777 	FpwszChallengeString  LPWSTR
  41778 }
  41779 
  41780 type CERT_KEYGEN_REQUEST_INFO = _CERT_KEYGEN_REQUEST_INFO
  41781 type PCERT_KEYGEN_REQUEST_INFO = uintptr
  41782 
  41783 type _CERT_SIGNED_CONTENT_INFO = struct {
  41784 	FToBeSigned         CRYPT_DER_BLOB
  41785 	FSignatureAlgorithm CRYPT_ALGORITHM_IDENTIFIER
  41786 	FSignature          CRYPT_BIT_BLOB
  41787 }
  41788 
  41789 type CERT_SIGNED_CONTENT_INFO = _CERT_SIGNED_CONTENT_INFO
  41790 type PCERT_SIGNED_CONTENT_INFO = uintptr
  41791 
  41792 type _CTL_USAGE = struct {
  41793 	FcUsageIdentifier     DWORD
  41794 	F__ccgo_pad1          [4]byte
  41795 	FrgpszUsageIdentifier uintptr
  41796 }
  41797 
  41798 type CTL_USAGE = _CTL_USAGE
  41799 type PCTL_USAGE = uintptr
  41800 type CERT_ENHKEY_USAGE = _CTL_USAGE
  41801 type PCERT_ENHKEY_USAGE = uintptr
  41802 
  41803 type PCCTL_USAGE = uintptr
  41804 type PCCERT_ENHKEY_USAGE = uintptr
  41805 
  41806 type _CTL_ENTRY = struct {
  41807 	FSubjectIdentifier CRYPT_DATA_BLOB
  41808 	FcAttribute        DWORD
  41809 	F__ccgo_pad1       [4]byte
  41810 	FrgAttribute       PCRYPT_ATTRIBUTE
  41811 }
  41812 
  41813 type CTL_ENTRY = _CTL_ENTRY
  41814 type PCTL_ENTRY = uintptr
  41815 
  41816 type _CTL_INFO = struct {
  41817 	FdwVersion        DWORD
  41818 	F__ccgo_pad1      [4]byte
  41819 	FSubjectUsage     CTL_USAGE
  41820 	FListIdentifier   CRYPT_DATA_BLOB
  41821 	FSequenceNumber   CRYPT_INTEGER_BLOB
  41822 	FThisUpdate       FILETIME
  41823 	FNextUpdate       FILETIME
  41824 	FSubjectAlgorithm CRYPT_ALGORITHM_IDENTIFIER
  41825 	FcCTLEntry        DWORD
  41826 	F__ccgo_pad2      [4]byte
  41827 	FrgCTLEntry       PCTL_ENTRY
  41828 	FcExtension       DWORD
  41829 	F__ccgo_pad3      [4]byte
  41830 	FrgExtension      PCERT_EXTENSION
  41831 }
  41832 
  41833 type CTL_INFO = _CTL_INFO
  41834 type PCTL_INFO = uintptr
  41835 
  41836 type _CRYPT_TIME_STAMP_REQUEST_INFO = struct {
  41837 	FpszTimeStampAlgorithm LPSTR
  41838 	FpszContentType        LPSTR
  41839 	FContent               CRYPT_OBJID_BLOB
  41840 	FcAttribute            DWORD
  41841 	F__ccgo_pad1           [4]byte
  41842 	FrgAttribute           PCRYPT_ATTRIBUTE
  41843 }
  41844 
  41845 type CRYPT_TIME_STAMP_REQUEST_INFO = _CRYPT_TIME_STAMP_REQUEST_INFO
  41846 type PCRYPT_TIME_STAMP_REQUEST_INFO = uintptr
  41847 
  41848 type _CRYPT_ENROLLMENT_NAME_VALUE_PAIR = struct {
  41849 	FpwszName  LPWSTR
  41850 	FpwszValue LPWSTR
  41851 }
  41852 
  41853 type CRYPT_ENROLLMENT_NAME_VALUE_PAIR = _CRYPT_ENROLLMENT_NAME_VALUE_PAIR
  41854 type PCRYPT_ENROLLMENT_NAME_VALUE_PAIR = uintptr
  41855 
  41856 type _CRYPT_CSP_PROVIDER = struct {
  41857 	FdwKeySpec        DWORD
  41858 	F__ccgo_pad1      [4]byte
  41859 	FpwszProviderName LPWSTR
  41860 	FSignature        CRYPT_BIT_BLOB
  41861 }
  41862 
  41863 type CRYPT_CSP_PROVIDER = _CRYPT_CSP_PROVIDER
  41864 type PCRYPT_CSP_PROVIDER = uintptr
  41865 
  41866 type PFN_CRYPT_ALLOC = uintptr
  41867 type PFN_CRYPT_FREE = uintptr
  41868 
  41869 type _CRYPT_ENCODE_PARA = struct {
  41870 	FcbSize      DWORD
  41871 	F__ccgo_pad1 [4]byte
  41872 	FpfnAlloc    PFN_CRYPT_ALLOC
  41873 	FpfnFree     PFN_CRYPT_FREE
  41874 }
  41875 
  41876 type CRYPT_ENCODE_PARA = _CRYPT_ENCODE_PARA
  41877 type PCRYPT_ENCODE_PARA = uintptr
  41878 
  41879 type _CRYPT_DECODE_PARA = struct {
  41880 	FcbSize      DWORD
  41881 	F__ccgo_pad1 [4]byte
  41882 	FpfnAlloc    PFN_CRYPT_ALLOC
  41883 	FpfnFree     PFN_CRYPT_FREE
  41884 }
  41885 
  41886 type CRYPT_DECODE_PARA = _CRYPT_DECODE_PARA
  41887 type PCRYPT_DECODE_PARA = uintptr
  41888 
  41889 type _CERT_EXTENSIONS = struct {
  41890 	FcExtension  DWORD
  41891 	F__ccgo_pad1 [4]byte
  41892 	FrgExtension PCERT_EXTENSION
  41893 }
  41894 
  41895 type CERT_EXTENSIONS = _CERT_EXTENSIONS
  41896 type PCERT_EXTENSIONS = uintptr
  41897 
  41898 type _CERT_AUTHORITY_KEY_ID_INFO = struct {
  41899 	FKeyId            CRYPT_DATA_BLOB
  41900 	FCertIssuer       CERT_NAME_BLOB
  41901 	FCertSerialNumber CRYPT_INTEGER_BLOB
  41902 }
  41903 
  41904 type CERT_AUTHORITY_KEY_ID_INFO = _CERT_AUTHORITY_KEY_ID_INFO
  41905 type PCERT_AUTHORITY_KEY_ID_INFO = uintptr
  41906 
  41907 type _CERT_PRIVATE_KEY_VALIDITY = struct {
  41908 	FNotBefore FILETIME
  41909 	FNotAfter  FILETIME
  41910 }
  41911 
  41912 type CERT_PRIVATE_KEY_VALIDITY = _CERT_PRIVATE_KEY_VALIDITY
  41913 type PCERT_PRIVATE_KEY_VALIDITY = uintptr
  41914 
  41915 type _CERT_KEY_ATTRIBUTES_INFO = struct {
  41916 	FKeyId                  CRYPT_DATA_BLOB
  41917 	FIntendedKeyUsage       CRYPT_BIT_BLOB
  41918 	FpPrivateKeyUsagePeriod PCERT_PRIVATE_KEY_VALIDITY
  41919 }
  41920 
  41921 type CERT_KEY_ATTRIBUTES_INFO = _CERT_KEY_ATTRIBUTES_INFO
  41922 type PCERT_KEY_ATTRIBUTES_INFO = uintptr
  41923 
  41924 type _CERT_POLICY_ID = struct {
  41925 	FcCertPolicyElementId     DWORD
  41926 	F__ccgo_pad1              [4]byte
  41927 	FrgpszCertPolicyElementId uintptr
  41928 }
  41929 
  41930 type CERT_POLICY_ID = _CERT_POLICY_ID
  41931 type PCERT_POLICY_ID = uintptr
  41932 
  41933 type _CERT_KEY_USAGE_RESTRICTION_INFO = struct {
  41934 	FcCertPolicyId      DWORD
  41935 	F__ccgo_pad1        [4]byte
  41936 	FrgCertPolicyId     PCERT_POLICY_ID
  41937 	FRestrictedKeyUsage CRYPT_BIT_BLOB
  41938 }
  41939 
  41940 type CERT_KEY_USAGE_RESTRICTION_INFO = _CERT_KEY_USAGE_RESTRICTION_INFO
  41941 type PCERT_KEY_USAGE_RESTRICTION_INFO = uintptr
  41942 
  41943 type _CERT_OTHER_NAME = struct {
  41944 	FpszObjId LPSTR
  41945 	FValue    CRYPT_OBJID_BLOB
  41946 }
  41947 
  41948 type CERT_OTHER_NAME = _CERT_OTHER_NAME
  41949 type PCERT_OTHER_NAME = uintptr
  41950 
  41951 type _CERT_ALT_NAME_ENTRY = struct {
  41952 	FdwAltNameChoice DWORD
  41953 	F__ccgo_pad1     [4]byte
  41954 	F__8             struct {
  41955 		FpOtherName  PCERT_OTHER_NAME
  41956 		F__ccgo_pad1 [8]byte
  41957 	}
  41958 }
  41959 
  41960 type CERT_ALT_NAME_ENTRY = _CERT_ALT_NAME_ENTRY
  41961 type PCERT_ALT_NAME_ENTRY = uintptr
  41962 
  41963 type _CERT_ALT_NAME_INFO = struct {
  41964 	FcAltEntry   DWORD
  41965 	F__ccgo_pad1 [4]byte
  41966 	FrgAltEntry  PCERT_ALT_NAME_ENTRY
  41967 }
  41968 
  41969 type CERT_ALT_NAME_INFO = _CERT_ALT_NAME_INFO
  41970 type PCERT_ALT_NAME_INFO = uintptr
  41971 
  41972 type _CERT_BASIC_CONSTRAINTS_INFO = struct {
  41973 	FSubjectType          CRYPT_BIT_BLOB
  41974 	FfPathLenConstraint   WINBOOL
  41975 	FdwPathLenConstraint  DWORD
  41976 	FcSubtreesConstraint  DWORD
  41977 	F__ccgo_pad1          [4]byte
  41978 	FrgSubtreesConstraint uintptr
  41979 }
  41980 
  41981 type CERT_BASIC_CONSTRAINTS_INFO = _CERT_BASIC_CONSTRAINTS_INFO
  41982 type PCERT_BASIC_CONSTRAINTS_INFO = uintptr
  41983 
  41984 type _CERT_BASIC_CONSTRAINTS2_INFO = struct {
  41985 	FfCA                 WINBOOL
  41986 	FfPathLenConstraint  WINBOOL
  41987 	FdwPathLenConstraint DWORD
  41988 }
  41989 
  41990 type CERT_BASIC_CONSTRAINTS2_INFO = _CERT_BASIC_CONSTRAINTS2_INFO
  41991 type PCERT_BASIC_CONSTRAINTS2_INFO = uintptr
  41992 
  41993 type _CERT_POLICY_QUALIFIER_INFO = struct {
  41994 	FpszPolicyQualifierId LPSTR
  41995 	FQualifier            CRYPT_OBJID_BLOB
  41996 }
  41997 
  41998 type CERT_POLICY_QUALIFIER_INFO = _CERT_POLICY_QUALIFIER_INFO
  41999 type PCERT_POLICY_QUALIFIER_INFO = uintptr
  42000 
  42001 type _CERT_POLICY_INFO = struct {
  42002 	FpszPolicyIdentifier LPSTR
  42003 	FcPolicyQualifier    DWORD
  42004 	F__ccgo_pad1         [4]byte
  42005 	FrgPolicyQualifier   uintptr
  42006 }
  42007 
  42008 type CERT_POLICY_INFO = _CERT_POLICY_INFO
  42009 type PCERT_POLICY_INFO = uintptr
  42010 
  42011 type _CERT_POLICIES_INFO = struct {
  42012 	FcPolicyInfo  DWORD
  42013 	F__ccgo_pad1  [4]byte
  42014 	FrgPolicyInfo uintptr
  42015 }
  42016 
  42017 type CERT_POLICIES_INFO = _CERT_POLICIES_INFO
  42018 type PCERT_POLICIES_INFO = uintptr
  42019 
  42020 type _CERT_POLICY_QUALIFIER_NOTICE_REFERENCE = struct {
  42021 	FpszOrganization LPSTR
  42022 	FcNoticeNumbers  DWORD
  42023 	F__ccgo_pad1     [4]byte
  42024 	FrgNoticeNumbers uintptr
  42025 }
  42026 
  42027 type CERT_POLICY_QUALIFIER_NOTICE_REFERENCE = _CERT_POLICY_QUALIFIER_NOTICE_REFERENCE
  42028 type PCERT_POLICY_QUALIFIER_NOTICE_REFERENCE = uintptr
  42029 
  42030 type _CERT_POLICY_QUALIFIER_USER_NOTICE = struct {
  42031 	FpNoticeReference uintptr
  42032 	FpszDisplayText   LPWSTR
  42033 }
  42034 
  42035 type CERT_POLICY_QUALIFIER_USER_NOTICE = _CERT_POLICY_QUALIFIER_USER_NOTICE
  42036 type PCERT_POLICY_QUALIFIER_USER_NOTICE = uintptr
  42037 
  42038 type _CPS_URLS = struct {
  42039 	FpszURL     LPWSTR
  42040 	FpAlgorithm uintptr
  42041 	FpDigest    uintptr
  42042 }
  42043 
  42044 type CPS_URLS = _CPS_URLS
  42045 type PCPS_URLS = uintptr
  42046 
  42047 type _CERT_POLICY95_QUALIFIER1 = struct {
  42048 	FpszPracticesReference  LPWSTR
  42049 	FpszNoticeIdentifier    LPSTR
  42050 	FpszNSINoticeIdentifier LPSTR
  42051 	FcCPSURLs               DWORD
  42052 	F__ccgo_pad1            [4]byte
  42053 	FrgCPSURLs              uintptr
  42054 }
  42055 
  42056 type CERT_POLICY95_QUALIFIER1 = _CERT_POLICY95_QUALIFIER1
  42057 type PCERT_POLICY95_QUALIFIER1 = uintptr
  42058 
  42059 type _CERT_POLICY_MAPPING = struct {
  42060 	FpszIssuerDomainPolicy  LPSTR
  42061 	FpszSubjectDomainPolicy LPSTR
  42062 }
  42063 
  42064 type CERT_POLICY_MAPPING = _CERT_POLICY_MAPPING
  42065 type PCERT_POLICY_MAPPING = uintptr
  42066 
  42067 type _CERT_POLICY_MAPPINGS_INFO = struct {
  42068 	FcPolicyMapping  DWORD
  42069 	F__ccgo_pad1     [4]byte
  42070 	FrgPolicyMapping PCERT_POLICY_MAPPING
  42071 }
  42072 
  42073 type CERT_POLICY_MAPPINGS_INFO = _CERT_POLICY_MAPPINGS_INFO
  42074 type PCERT_POLICY_MAPPINGS_INFO = uintptr
  42075 
  42076 type _CERT_POLICY_CONSTRAINTS_INFO = struct {
  42077 	FfRequireExplicitPolicy           WINBOOL
  42078 	FdwRequireExplicitPolicySkipCerts DWORD
  42079 	FfInhibitPolicyMapping            WINBOOL
  42080 	FdwInhibitPolicyMappingSkipCerts  DWORD
  42081 }
  42082 
  42083 type CERT_POLICY_CONSTRAINTS_INFO = _CERT_POLICY_CONSTRAINTS_INFO
  42084 type PCERT_POLICY_CONSTRAINTS_INFO = uintptr
  42085 
  42086 type _CRYPT_CONTENT_INFO_SEQUENCE_OF_ANY = struct {
  42087 	FpszObjId    LPSTR
  42088 	FcValue      DWORD
  42089 	F__ccgo_pad1 [4]byte
  42090 	FrgValue     PCRYPT_DER_BLOB
  42091 }
  42092 
  42093 type CRYPT_CONTENT_INFO_SEQUENCE_OF_ANY = _CRYPT_CONTENT_INFO_SEQUENCE_OF_ANY
  42094 type PCRYPT_CONTENT_INFO_SEQUENCE_OF_ANY = uintptr
  42095 
  42096 type _CRYPT_CONTENT_INFO = struct {
  42097 	FpszObjId LPSTR
  42098 	FContent  CRYPT_DER_BLOB
  42099 }
  42100 
  42101 type CRYPT_CONTENT_INFO = _CRYPT_CONTENT_INFO
  42102 type PCRYPT_CONTENT_INFO = uintptr
  42103 
  42104 type _CRYPT_SEQUENCE_OF_ANY = struct {
  42105 	FcValue      DWORD
  42106 	F__ccgo_pad1 [4]byte
  42107 	FrgValue     PCRYPT_DER_BLOB
  42108 }
  42109 
  42110 type CRYPT_SEQUENCE_OF_ANY = _CRYPT_SEQUENCE_OF_ANY
  42111 type PCRYPT_SEQUENCE_OF_ANY = uintptr
  42112 
  42113 type _CERT_AUTHORITY_KEY_ID2_INFO = struct {
  42114 	FKeyId                     CRYPT_DATA_BLOB
  42115 	FAuthorityCertIssuer       CERT_ALT_NAME_INFO
  42116 	FAuthorityCertSerialNumber CRYPT_INTEGER_BLOB
  42117 }
  42118 
  42119 type CERT_AUTHORITY_KEY_ID2_INFO = _CERT_AUTHORITY_KEY_ID2_INFO
  42120 type PCERT_AUTHORITY_KEY_ID2_INFO = uintptr
  42121 
  42122 type _CERT_ACCESS_DESCRIPTION = struct {
  42123 	FpszAccessMethod LPSTR
  42124 	FAccessLocation  CERT_ALT_NAME_ENTRY
  42125 }
  42126 
  42127 type CERT_ACCESS_DESCRIPTION = _CERT_ACCESS_DESCRIPTION
  42128 type PCERT_ACCESS_DESCRIPTION = uintptr
  42129 
  42130 type _CERT_AUTHORITY_INFO_ACCESS = struct {
  42131 	FcAccDescr   DWORD
  42132 	F__ccgo_pad1 [4]byte
  42133 	FrgAccDescr  PCERT_ACCESS_DESCRIPTION
  42134 }
  42135 
  42136 type CERT_AUTHORITY_INFO_ACCESS = _CERT_AUTHORITY_INFO_ACCESS
  42137 type PCERT_AUTHORITY_INFO_ACCESS = uintptr
  42138 
  42139 type CERT_SUBJECT_INFO_ACCESS = CERT_AUTHORITY_INFO_ACCESS
  42140 type PCERT_SUBJECT_INFO_ACCESS = uintptr
  42141 
  42142 type _CRL_DIST_POINT_NAME = struct {
  42143 	FdwDistPointNameChoice DWORD
  42144 	F__ccgo_pad1           [4]byte
  42145 	F__8                   struct{ FFullName CERT_ALT_NAME_INFO }
  42146 }
  42147 
  42148 type CRL_DIST_POINT_NAME = _CRL_DIST_POINT_NAME
  42149 type PCRL_DIST_POINT_NAME = uintptr
  42150 
  42151 type _CRL_DIST_POINT = struct {
  42152 	FDistPointName CRL_DIST_POINT_NAME
  42153 	FReasonFlags   CRYPT_BIT_BLOB
  42154 	FCRLIssuer     CERT_ALT_NAME_INFO
  42155 }
  42156 
  42157 type CRL_DIST_POINT = _CRL_DIST_POINT
  42158 type PCRL_DIST_POINT = uintptr
  42159 
  42160 type _CRL_DIST_POINTS_INFO = struct {
  42161 	FcDistPoint  DWORD
  42162 	F__ccgo_pad1 [4]byte
  42163 	FrgDistPoint PCRL_DIST_POINT
  42164 }
  42165 
  42166 type CRL_DIST_POINTS_INFO = _CRL_DIST_POINTS_INFO
  42167 type PCRL_DIST_POINTS_INFO = uintptr
  42168 
  42169 type _CROSS_CERT_DIST_POINTS_INFO = struct {
  42170 	FdwSyncDeltaTime DWORD
  42171 	FcDistPoint      DWORD
  42172 	FrgDistPoint     PCERT_ALT_NAME_INFO
  42173 }
  42174 
  42175 type CROSS_CERT_DIST_POINTS_INFO = _CROSS_CERT_DIST_POINTS_INFO
  42176 type PCROSS_CERT_DIST_POINTS_INFO = uintptr
  42177 
  42178 type _CERT_PAIR = struct {
  42179 	FForward CERT_BLOB
  42180 	FReverse CERT_BLOB
  42181 }
  42182 
  42183 type CERT_PAIR = _CERT_PAIR
  42184 type PCERT_PAIR = uintptr
  42185 
  42186 type _CRL_ISSUING_DIST_POINT = struct {
  42187 	FDistPointName          CRL_DIST_POINT_NAME
  42188 	FfOnlyContainsUserCerts WINBOOL
  42189 	FfOnlyContainsCACerts   WINBOOL
  42190 	FOnlySomeReasonFlags    CRYPT_BIT_BLOB
  42191 	FfIndirectCRL           WINBOOL
  42192 	F__ccgo_pad1            [4]byte
  42193 }
  42194 
  42195 type CRL_ISSUING_DIST_POINT = _CRL_ISSUING_DIST_POINT
  42196 type PCRL_ISSUING_DIST_POINT = uintptr
  42197 
  42198 type _CERT_GENERAL_SUBTREE = struct {
  42199 	FBase        CERT_ALT_NAME_ENTRY
  42200 	FdwMinimum   DWORD
  42201 	FfMaximum    WINBOOL
  42202 	FdwMaximum   DWORD
  42203 	F__ccgo_pad1 [4]byte
  42204 }
  42205 
  42206 type CERT_GENERAL_SUBTREE = _CERT_GENERAL_SUBTREE
  42207 type PCERT_GENERAL_SUBTREE = uintptr
  42208 
  42209 type _CERT_NAME_CONSTRAINTS_INFO = struct {
  42210 	FcPermittedSubtree  DWORD
  42211 	F__ccgo_pad1        [4]byte
  42212 	FrgPermittedSubtree PCERT_GENERAL_SUBTREE
  42213 	FcExcludedSubtree   DWORD
  42214 	F__ccgo_pad2        [4]byte
  42215 	FrgExcludedSubtree  PCERT_GENERAL_SUBTREE
  42216 }
  42217 
  42218 type CERT_NAME_CONSTRAINTS_INFO = _CERT_NAME_CONSTRAINTS_INFO
  42219 type PCERT_NAME_CONSTRAINTS_INFO = uintptr
  42220 
  42221 type _CERT_DSS_PARAMETERS = struct {
  42222 	Fp CRYPT_UINT_BLOB
  42223 	Fq CRYPT_UINT_BLOB
  42224 	Fg CRYPT_UINT_BLOB
  42225 }
  42226 
  42227 type CERT_DSS_PARAMETERS = _CERT_DSS_PARAMETERS
  42228 type PCERT_DSS_PARAMETERS = uintptr
  42229 
  42230 type _CERT_DH_PARAMETERS = struct {
  42231 	Fp CRYPT_UINT_BLOB
  42232 	Fg CRYPT_UINT_BLOB
  42233 }
  42234 
  42235 type CERT_DH_PARAMETERS = _CERT_DH_PARAMETERS
  42236 type PCERT_DH_PARAMETERS = uintptr
  42237 
  42238 type _CERT_ECC_SIGNATURE = struct {
  42239 	Fr CRYPT_UINT_BLOB
  42240 	Fs CRYPT_UINT_BLOB
  42241 }
  42242 
  42243 type CERT_ECC_SIGNATURE = _CERT_ECC_SIGNATURE
  42244 type PCERT_ECC_SIGNATURE = uintptr
  42245 
  42246 type _CERT_X942_DH_VALIDATION_PARAMS = struct {
  42247 	Fseed        CRYPT_BIT_BLOB
  42248 	FpgenCounter DWORD
  42249 	F__ccgo_pad1 [4]byte
  42250 }
  42251 
  42252 type CERT_X942_DH_VALIDATION_PARAMS = _CERT_X942_DH_VALIDATION_PARAMS
  42253 type PCERT_X942_DH_VALIDATION_PARAMS = uintptr
  42254 
  42255 type _CERT_X942_DH_PARAMETERS = struct {
  42256 	Fp                 CRYPT_UINT_BLOB
  42257 	Fg                 CRYPT_UINT_BLOB
  42258 	Fq                 CRYPT_UINT_BLOB
  42259 	Fj                 CRYPT_UINT_BLOB
  42260 	FpValidationParams PCERT_X942_DH_VALIDATION_PARAMS
  42261 }
  42262 
  42263 type CERT_X942_DH_PARAMETERS = _CERT_X942_DH_PARAMETERS
  42264 type PCERT_X942_DH_PARAMETERS = uintptr
  42265 
  42266 type _CRYPT_X942_OTHER_INFO = struct {
  42267 	FpszContentEncryptionObjId LPSTR
  42268 	FrgbCounter                [4]BYTE
  42269 	FrgbKeyLength              [4]BYTE
  42270 	FPubInfo                   CRYPT_DATA_BLOB
  42271 }
  42272 
  42273 type CRYPT_X942_OTHER_INFO = _CRYPT_X942_OTHER_INFO
  42274 type PCRYPT_X942_OTHER_INFO = uintptr
  42275 
  42276 type _CRYPT_ECC_CMS_SHARED_INFO = struct {
  42277 	FAlgorithm      CRYPT_ALGORITHM_IDENTIFIER
  42278 	FEntityUInfo    CRYPT_DATA_BLOB
  42279 	FrgbSuppPubInfo [4]BYTE
  42280 	F__ccgo_pad1    [4]byte
  42281 }
  42282 
  42283 type CRYPT_ECC_CMS_SHARED_INFO = _CRYPT_ECC_CMS_SHARED_INFO
  42284 type PCRYPT_ECC_CMS_SHARED_INFO = uintptr
  42285 
  42286 type _CRYPT_RC2_CBC_PARAMETERS = struct {
  42287 	FdwVersion DWORD
  42288 	FfIV       WINBOOL
  42289 	FrgbIV     [8]BYTE
  42290 }
  42291 
  42292 type CRYPT_RC2_CBC_PARAMETERS = _CRYPT_RC2_CBC_PARAMETERS
  42293 type PCRYPT_RC2_CBC_PARAMETERS = uintptr
  42294 
  42295 type _CRYPT_SMIME_CAPABILITY = struct {
  42296 	FpszObjId   LPSTR
  42297 	FParameters CRYPT_OBJID_BLOB
  42298 }
  42299 
  42300 type CRYPT_SMIME_CAPABILITY = _CRYPT_SMIME_CAPABILITY
  42301 type PCRYPT_SMIME_CAPABILITY = uintptr
  42302 
  42303 type _CRYPT_SMIME_CAPABILITIES = struct {
  42304 	FcCapability  DWORD
  42305 	F__ccgo_pad1  [4]byte
  42306 	FrgCapability PCRYPT_SMIME_CAPABILITY
  42307 }
  42308 
  42309 type CRYPT_SMIME_CAPABILITIES = _CRYPT_SMIME_CAPABILITIES
  42310 type PCRYPT_SMIME_CAPABILITIES = uintptr
  42311 
  42312 type _CERT_QC_STATEMENT = struct {
  42313 	FpszStatementId LPSTR
  42314 	FStatementInfo  CRYPT_OBJID_BLOB
  42315 }
  42316 
  42317 type CERT_QC_STATEMENT = _CERT_QC_STATEMENT
  42318 type PCERT_QC_STATEMENT = uintptr
  42319 
  42320 type _CERT_QC_STATEMENTS_EXT_INFO = struct {
  42321 	FcStatement  DWORD
  42322 	F__ccgo_pad1 [4]byte
  42323 	FrgStatement PCERT_QC_STATEMENT
  42324 }
  42325 
  42326 type CERT_QC_STATEMENTS_EXT_INFO = _CERT_QC_STATEMENTS_EXT_INFO
  42327 type PCERT_QC_STATEMENTS_EXT_INFO = uintptr
  42328 
  42329 type _CRYPT_MASK_GEN_ALGORITHM = struct {
  42330 	FpszObjId      LPSTR
  42331 	FHashAlgorithm CRYPT_ALGORITHM_IDENTIFIER
  42332 }
  42333 
  42334 type CRYPT_MASK_GEN_ALGORITHM = _CRYPT_MASK_GEN_ALGORITHM
  42335 type PCRYPT_MASK_GEN_ALGORITHM = uintptr
  42336 
  42337 type _CRYPT_RSA_SSA_PSS_PARAMETERS = struct {
  42338 	FHashAlgorithm    CRYPT_ALGORITHM_IDENTIFIER
  42339 	FMaskGenAlgorithm CRYPT_MASK_GEN_ALGORITHM
  42340 	FdwSaltLength     DWORD
  42341 	FdwTrailerField   DWORD
  42342 }
  42343 
  42344 type CRYPT_RSA_SSA_PSS_PARAMETERS = _CRYPT_RSA_SSA_PSS_PARAMETERS
  42345 type PCRYPT_RSA_SSA_PSS_PARAMETERS = uintptr
  42346 
  42347 type _CRYPT_PSOURCE_ALGORITHM = struct {
  42348 	FpszObjId           LPSTR
  42349 	FEncodingParameters CRYPT_DATA_BLOB
  42350 }
  42351 
  42352 type CRYPT_PSOURCE_ALGORITHM = _CRYPT_PSOURCE_ALGORITHM
  42353 type PCRYPT_PSOURCE_ALGORITHM = uintptr
  42354 
  42355 type _CRYPT_RSAES_OAEP_PARAMETERS = struct {
  42356 	FHashAlgorithm    CRYPT_ALGORITHM_IDENTIFIER
  42357 	FMaskGenAlgorithm CRYPT_MASK_GEN_ALGORITHM
  42358 	FPSourceAlgorithm CRYPT_PSOURCE_ALGORITHM
  42359 }
  42360 
  42361 type CRYPT_RSAES_OAEP_PARAMETERS = _CRYPT_RSAES_OAEP_PARAMETERS
  42362 type PCRYPT_RSAES_OAEP_PARAMETERS = uintptr
  42363 
  42364 type _CMC_TAGGED_ATTRIBUTE = struct {
  42365 	FdwBodyPartID DWORD
  42366 	F__ccgo_pad1  [4]byte
  42367 	FAttribute    CRYPT_ATTRIBUTE
  42368 }
  42369 
  42370 type CMC_TAGGED_ATTRIBUTE = _CMC_TAGGED_ATTRIBUTE
  42371 type PCMC_TAGGED_ATTRIBUTE = uintptr
  42372 
  42373 type _CMC_TAGGED_CERT_REQUEST = struct {
  42374 	FdwBodyPartID      DWORD
  42375 	F__ccgo_pad1       [4]byte
  42376 	FSignedCertRequest CRYPT_DER_BLOB
  42377 }
  42378 
  42379 type CMC_TAGGED_CERT_REQUEST = _CMC_TAGGED_CERT_REQUEST
  42380 type PCMC_TAGGED_CERT_REQUEST = uintptr
  42381 
  42382 type _CMC_TAGGED_REQUEST = struct {
  42383 	FdwTaggedRequestChoice DWORD
  42384 	F__ccgo_pad1           [4]byte
  42385 	F__8                   struct{ FpTaggedCertRequest PCMC_TAGGED_CERT_REQUEST }
  42386 }
  42387 
  42388 type CMC_TAGGED_REQUEST = _CMC_TAGGED_REQUEST
  42389 type PCMC_TAGGED_REQUEST = uintptr
  42390 
  42391 type _CMC_TAGGED_CONTENT_INFO = struct {
  42392 	FdwBodyPartID       DWORD
  42393 	F__ccgo_pad1        [4]byte
  42394 	FEncodedContentInfo CRYPT_DER_BLOB
  42395 }
  42396 
  42397 type CMC_TAGGED_CONTENT_INFO = _CMC_TAGGED_CONTENT_INFO
  42398 type PCMC_TAGGED_CONTENT_INFO = uintptr
  42399 
  42400 type _CMC_TAGGED_OTHER_MSG = struct {
  42401 	FdwBodyPartID DWORD
  42402 	F__ccgo_pad1  [4]byte
  42403 	FpszObjId     LPSTR
  42404 	FValue        CRYPT_OBJID_BLOB
  42405 }
  42406 
  42407 type CMC_TAGGED_OTHER_MSG = _CMC_TAGGED_OTHER_MSG
  42408 type PCMC_TAGGED_OTHER_MSG = uintptr
  42409 
  42410 type _CMC_DATA_INFO = struct {
  42411 	FcTaggedAttribute    DWORD
  42412 	F__ccgo_pad1         [4]byte
  42413 	FrgTaggedAttribute   PCMC_TAGGED_ATTRIBUTE
  42414 	FcTaggedRequest      DWORD
  42415 	F__ccgo_pad2         [4]byte
  42416 	FrgTaggedRequest     PCMC_TAGGED_REQUEST
  42417 	FcTaggedContentInfo  DWORD
  42418 	F__ccgo_pad3         [4]byte
  42419 	FrgTaggedContentInfo PCMC_TAGGED_CONTENT_INFO
  42420 	FcTaggedOtherMsg     DWORD
  42421 	F__ccgo_pad4         [4]byte
  42422 	FrgTaggedOtherMsg    PCMC_TAGGED_OTHER_MSG
  42423 }
  42424 
  42425 type CMC_DATA_INFO = _CMC_DATA_INFO
  42426 type PCMC_DATA_INFO = uintptr
  42427 
  42428 type _CMC_RESPONSE_INFO = struct {
  42429 	FcTaggedAttribute    DWORD
  42430 	F__ccgo_pad1         [4]byte
  42431 	FrgTaggedAttribute   PCMC_TAGGED_ATTRIBUTE
  42432 	FcTaggedContentInfo  DWORD
  42433 	F__ccgo_pad2         [4]byte
  42434 	FrgTaggedContentInfo PCMC_TAGGED_CONTENT_INFO
  42435 	FcTaggedOtherMsg     DWORD
  42436 	F__ccgo_pad3         [4]byte
  42437 	FrgTaggedOtherMsg    PCMC_TAGGED_OTHER_MSG
  42438 }
  42439 
  42440 type CMC_RESPONSE_INFO = _CMC_RESPONSE_INFO
  42441 type PCMC_RESPONSE_INFO = uintptr
  42442 
  42443 type _CMC_PEND_INFO = struct {
  42444 	FPendToken CRYPT_DATA_BLOB
  42445 	FPendTime  FILETIME
  42446 }
  42447 
  42448 type CMC_PEND_INFO = _CMC_PEND_INFO
  42449 type PCMC_PEND_INFO = uintptr
  42450 
  42451 type _CMC_STATUS_INFO = struct {
  42452 	FdwStatus          DWORD
  42453 	FcBodyList         DWORD
  42454 	FrgdwBodyList      uintptr
  42455 	FpwszStatusString  LPWSTR
  42456 	FdwOtherInfoChoice DWORD
  42457 	F__ccgo_pad1       [4]byte
  42458 	F__32              struct {
  42459 		F__ccgo_pad1 [0]uint64
  42460 		FdwFailInfo  DWORD
  42461 		F__ccgo_pad2 [4]byte
  42462 	}
  42463 }
  42464 
  42465 type CMC_STATUS_INFO = _CMC_STATUS_INFO
  42466 type PCMC_STATUS_INFO = uintptr
  42467 
  42468 type _CMC_ADD_EXTENSIONS_INFO = struct {
  42469 	FdwCmcDataReference DWORD
  42470 	FcCertReference     DWORD
  42471 	FrgdwCertReference  uintptr
  42472 	FcExtension         DWORD
  42473 	F__ccgo_pad1        [4]byte
  42474 	FrgExtension        PCERT_EXTENSION
  42475 }
  42476 
  42477 type CMC_ADD_EXTENSIONS_INFO = _CMC_ADD_EXTENSIONS_INFO
  42478 type PCMC_ADD_EXTENSIONS_INFO = uintptr
  42479 
  42480 type _CMC_ADD_ATTRIBUTES_INFO = struct {
  42481 	FdwCmcDataReference DWORD
  42482 	FcCertReference     DWORD
  42483 	FrgdwCertReference  uintptr
  42484 	FcAttribute         DWORD
  42485 	F__ccgo_pad1        [4]byte
  42486 	FrgAttribute        PCRYPT_ATTRIBUTE
  42487 }
  42488 
  42489 type CMC_ADD_ATTRIBUTES_INFO = _CMC_ADD_ATTRIBUTES_INFO
  42490 type PCMC_ADD_ATTRIBUTES_INFO = uintptr
  42491 
  42492 type _CERT_TEMPLATE_EXT = struct {
  42493 	FpszObjId       LPSTR
  42494 	FdwMajorVersion DWORD
  42495 	FfMinorVersion  WINBOOL
  42496 	FdwMinorVersion DWORD
  42497 	F__ccgo_pad1    [4]byte
  42498 }
  42499 
  42500 type CERT_TEMPLATE_EXT = _CERT_TEMPLATE_EXT
  42501 type PCERT_TEMPLATE_EXT = uintptr
  42502 
  42503 type _CERT_HASHED_URL = struct {
  42504 	FHashAlgorithm CRYPT_ALGORITHM_IDENTIFIER
  42505 	FHash          CRYPT_HASH_BLOB
  42506 	FpwszUrl       LPWSTR
  42507 }
  42508 
  42509 type CERT_HASHED_URL = _CERT_HASHED_URL
  42510 type PCERT_HASHED_URL = uintptr
  42511 
  42512 type _CERT_LOGOTYPE_DETAILS = struct {
  42513 	FpwszMimeType LPWSTR
  42514 	FcHashedUrl   DWORD
  42515 	F__ccgo_pad1  [4]byte
  42516 	FrgHashedUrl  PCERT_HASHED_URL
  42517 }
  42518 
  42519 type CERT_LOGOTYPE_DETAILS = _CERT_LOGOTYPE_DETAILS
  42520 type PCERT_LOGOTYPE_DETAILS = uintptr
  42521 
  42522 type _CERT_LOGOTYPE_REFERENCE = struct {
  42523 	FcHashedUrl  DWORD
  42524 	F__ccgo_pad1 [4]byte
  42525 	FrgHashedUrl PCERT_HASHED_URL
  42526 }
  42527 
  42528 type CERT_LOGOTYPE_REFERENCE = _CERT_LOGOTYPE_REFERENCE
  42529 type PCERT_LOGOTYPE_REFERENCE = uintptr
  42530 
  42531 type _CERT_LOGOTYPE_IMAGE_INFO = struct {
  42532 	FdwLogotypeImageInfoChoice       DWORD
  42533 	FdwFileSize                      DWORD
  42534 	FdwXSize                         DWORD
  42535 	FdwYSize                         DWORD
  42536 	FdwLogotypeImageResolutionChoice DWORD
  42537 	F__20                            struct{ FdwNumBits DWORD }
  42538 	FpwszLanguage                    LPWSTR
  42539 }
  42540 
  42541 type CERT_LOGOTYPE_IMAGE_INFO = _CERT_LOGOTYPE_IMAGE_INFO
  42542 type PCERT_LOGOTYPE_IMAGE_INFO = uintptr
  42543 
  42544 type _CERT_LOGOTYPE_IMAGE = struct {
  42545 	FLogotypeDetails    CERT_LOGOTYPE_DETAILS
  42546 	FpLogotypeImageInfo PCERT_LOGOTYPE_IMAGE_INFO
  42547 }
  42548 
  42549 type CERT_LOGOTYPE_IMAGE = _CERT_LOGOTYPE_IMAGE
  42550 type PCERT_LOGOTYPE_IMAGE = uintptr
  42551 
  42552 type _CERT_LOGOTYPE_AUDIO_INFO = struct {
  42553 	FdwFileSize   DWORD
  42554 	FdwPlayTime   DWORD
  42555 	FdwChannels   DWORD
  42556 	FdwSampleRate DWORD
  42557 	FpwszLanguage LPWSTR
  42558 }
  42559 
  42560 type CERT_LOGOTYPE_AUDIO_INFO = _CERT_LOGOTYPE_AUDIO_INFO
  42561 type PCERT_LOGOTYPE_AUDIO_INFO = uintptr
  42562 
  42563 type _CERT_LOGOTYPE_AUDIO = struct {
  42564 	FLogotypeDetails    CERT_LOGOTYPE_DETAILS
  42565 	FpLogotypeAudioInfo PCERT_LOGOTYPE_AUDIO_INFO
  42566 }
  42567 
  42568 type CERT_LOGOTYPE_AUDIO = _CERT_LOGOTYPE_AUDIO
  42569 type PCERT_LOGOTYPE_AUDIO = uintptr
  42570 
  42571 type _CERT_LOGOTYPE_DATA = struct {
  42572 	FcLogotypeImage  DWORD
  42573 	F__ccgo_pad1     [4]byte
  42574 	FrgLogotypeImage PCERT_LOGOTYPE_IMAGE
  42575 	FcLogotypeAudio  DWORD
  42576 	F__ccgo_pad2     [4]byte
  42577 	FrgLogotypeAudio PCERT_LOGOTYPE_AUDIO
  42578 }
  42579 
  42580 type CERT_LOGOTYPE_DATA = _CERT_LOGOTYPE_DATA
  42581 type PCERT_LOGOTYPE_DATA = uintptr
  42582 
  42583 type _CERT_LOGOTYPE_INFO = struct {
  42584 	FdwLogotypeInfoChoice DWORD
  42585 	F__ccgo_pad1          [4]byte
  42586 	F__8                  struct{ FpLogotypeDirectInfo PCERT_LOGOTYPE_DATA }
  42587 }
  42588 
  42589 type CERT_LOGOTYPE_INFO = _CERT_LOGOTYPE_INFO
  42590 type PCERT_LOGOTYPE_INFO = uintptr
  42591 
  42592 type _CERT_OTHER_LOGOTYPE_INFO = struct {
  42593 	FpszObjId     LPSTR
  42594 	FLogotypeInfo CERT_LOGOTYPE_INFO
  42595 }
  42596 
  42597 type CERT_OTHER_LOGOTYPE_INFO = _CERT_OTHER_LOGOTYPE_INFO
  42598 type PCERT_OTHER_LOGOTYPE_INFO = uintptr
  42599 
  42600 type _CERT_LOGOTYPE_EXT_INFO = struct {
  42601 	FcCommunityLogo  DWORD
  42602 	F__ccgo_pad1     [4]byte
  42603 	FrgCommunityLogo PCERT_LOGOTYPE_INFO
  42604 	FpIssuerLogo     PCERT_LOGOTYPE_INFO
  42605 	FpSubjectLogo    PCERT_LOGOTYPE_INFO
  42606 	FcOtherLogo      DWORD
  42607 	F__ccgo_pad2     [4]byte
  42608 	FrgOtherLogo     PCERT_OTHER_LOGOTYPE_INFO
  42609 }
  42610 
  42611 type CERT_LOGOTYPE_EXT_INFO = _CERT_LOGOTYPE_EXT_INFO
  42612 type PCERT_LOGOTYPE_EXT_INFO = uintptr
  42613 
  42614 type _CERT_BIOMETRIC_DATA = struct {
  42615 	FdwTypeOfBiometricDataChoice DWORD
  42616 	F__ccgo_pad1                 [4]byte
  42617 	F__8                         struct {
  42618 		F__ccgo_pad1  [0]uint64
  42619 		FdwPredefined DWORD
  42620 		F__ccgo_pad2  [4]byte
  42621 	}
  42622 	FHashedUrl CERT_HASHED_URL
  42623 }
  42624 
  42625 type CERT_BIOMETRIC_DATA = _CERT_BIOMETRIC_DATA
  42626 type PCERT_BIOMETRIC_DATA = uintptr
  42627 
  42628 type _CERT_BIOMETRIC_EXT_INFO = struct {
  42629 	FcBiometricData  DWORD
  42630 	F__ccgo_pad1     [4]byte
  42631 	FrgBiometricData PCERT_BIOMETRIC_DATA
  42632 }
  42633 
  42634 type CERT_BIOMETRIC_EXT_INFO = _CERT_BIOMETRIC_EXT_INFO
  42635 type PCERT_BIOMETRIC_EXT_INFO = uintptr
  42636 
  42637 type _OCSP_SIGNATURE_INFO = struct {
  42638 	FSignatureAlgorithm CRYPT_ALGORITHM_IDENTIFIER
  42639 	FSignature          CRYPT_BIT_BLOB
  42640 	FcCertEncoded       DWORD
  42641 	F__ccgo_pad1        [4]byte
  42642 	FrgCertEncoded      PCERT_BLOB
  42643 }
  42644 
  42645 type OCSP_SIGNATURE_INFO = _OCSP_SIGNATURE_INFO
  42646 type POCSP_SIGNATURE_INFO = uintptr
  42647 
  42648 type _OCSP_SIGNED_REQUEST_INFO = struct {
  42649 	FToBeSigned             CRYPT_DER_BLOB
  42650 	FpOptionalSignatureInfo POCSP_SIGNATURE_INFO
  42651 }
  42652 
  42653 type OCSP_SIGNED_REQUEST_INFO = _OCSP_SIGNED_REQUEST_INFO
  42654 type POCSP_SIGNED_REQUEST_INFO = uintptr
  42655 
  42656 type _OCSP_CERT_ID = struct {
  42657 	FHashAlgorithm  CRYPT_ALGORITHM_IDENTIFIER
  42658 	FIssuerNameHash CRYPT_HASH_BLOB
  42659 	FIssuerKeyHash  CRYPT_HASH_BLOB
  42660 	FSerialNumber   CRYPT_INTEGER_BLOB
  42661 }
  42662 
  42663 type OCSP_CERT_ID = _OCSP_CERT_ID
  42664 type POCSP_CERT_ID = uintptr
  42665 
  42666 type _OCSP_REQUEST_ENTRY = struct {
  42667 	FCertId      OCSP_CERT_ID
  42668 	FcExtension  DWORD
  42669 	F__ccgo_pad1 [4]byte
  42670 	FrgExtension PCERT_EXTENSION
  42671 }
  42672 
  42673 type OCSP_REQUEST_ENTRY = _OCSP_REQUEST_ENTRY
  42674 type POCSP_REQUEST_ENTRY = uintptr
  42675 
  42676 type _OCSP_REQUEST_INFO = struct {
  42677 	FdwVersion      DWORD
  42678 	F__ccgo_pad1    [4]byte
  42679 	FpRequestorName PCERT_ALT_NAME_ENTRY
  42680 	FcRequestEntry  DWORD
  42681 	F__ccgo_pad2    [4]byte
  42682 	FrgRequestEntry POCSP_REQUEST_ENTRY
  42683 	FcExtension     DWORD
  42684 	F__ccgo_pad3    [4]byte
  42685 	FrgExtension    PCERT_EXTENSION
  42686 }
  42687 
  42688 type OCSP_REQUEST_INFO = _OCSP_REQUEST_INFO
  42689 type POCSP_REQUEST_INFO = uintptr
  42690 
  42691 type _OCSP_RESPONSE_INFO = struct {
  42692 	FdwStatus    DWORD
  42693 	F__ccgo_pad1 [4]byte
  42694 	FpszObjId    LPSTR
  42695 	FValue       CRYPT_OBJID_BLOB
  42696 }
  42697 
  42698 type OCSP_RESPONSE_INFO = _OCSP_RESPONSE_INFO
  42699 type POCSP_RESPONSE_INFO = uintptr
  42700 
  42701 type _OCSP_BASIC_SIGNED_RESPONSE_INFO = struct {
  42702 	FToBeSigned    CRYPT_DER_BLOB
  42703 	FSignatureInfo OCSP_SIGNATURE_INFO
  42704 }
  42705 
  42706 type OCSP_BASIC_SIGNED_RESPONSE_INFO = _OCSP_BASIC_SIGNED_RESPONSE_INFO
  42707 type POCSP_BASIC_SIGNED_RESPONSE_INFO = uintptr
  42708 
  42709 type _OCSP_BASIC_REVOKED_INFO = struct {
  42710 	FRevocationDate  FILETIME
  42711 	FdwCrlReasonCode DWORD
  42712 }
  42713 
  42714 type OCSP_BASIC_REVOKED_INFO = _OCSP_BASIC_REVOKED_INFO
  42715 type POCSP_BASIC_REVOKED_INFO = uintptr
  42716 
  42717 type _OCSP_BASIC_RESPONSE_ENTRY = struct {
  42718 	FCertId       OCSP_CERT_ID
  42719 	FdwCertStatus DWORD
  42720 	F__ccgo_pad1  [4]byte
  42721 	F__80         struct{ FpRevokedInfo POCSP_BASIC_REVOKED_INFO }
  42722 	FThisUpdate   FILETIME
  42723 	FNextUpdate   FILETIME
  42724 	FcExtension   DWORD
  42725 	F__ccgo_pad2  [4]byte
  42726 	FrgExtension  PCERT_EXTENSION
  42727 }
  42728 
  42729 type OCSP_BASIC_RESPONSE_ENTRY = _OCSP_BASIC_RESPONSE_ENTRY
  42730 type POCSP_BASIC_RESPONSE_ENTRY = uintptr
  42731 
  42732 type _OCSP_BASIC_RESPONSE_INFO = struct {
  42733 	FdwVersion           DWORD
  42734 	FdwResponderIdChoice DWORD
  42735 	F__8                 struct{ FByNameResponderId CERT_NAME_BLOB }
  42736 	FProducedAt          FILETIME
  42737 	FcResponseEntry      DWORD
  42738 	F__ccgo_pad1         [4]byte
  42739 	FrgResponseEntry     POCSP_BASIC_RESPONSE_ENTRY
  42740 	FcExtension          DWORD
  42741 	F__ccgo_pad2         [4]byte
  42742 	FrgExtension         PCERT_EXTENSION
  42743 }
  42744 
  42745 type OCSP_BASIC_RESPONSE_INFO = _OCSP_BASIC_RESPONSE_INFO
  42746 type POCSP_BASIC_RESPONSE_INFO = uintptr
  42747 
  42748 type _CERT_SUPPORTED_ALGORITHM_INFO = struct {
  42749 	FAlgorithm            CRYPT_ALGORITHM_IDENTIFIER
  42750 	FIntendedKeyUsage     CRYPT_BIT_BLOB
  42751 	FIntendedCertPolicies CERT_POLICIES_INFO
  42752 }
  42753 
  42754 type CERT_SUPPORTED_ALGORITHM_INFO = _CERT_SUPPORTED_ALGORITHM_INFO
  42755 type PCERT_SUPPORTED_ALGORITHM_INFO = uintptr
  42756 
  42757 type _CERT_TPM_SPECIFICATION_INFO = struct {
  42758 	FpwszFamily LPWSTR
  42759 	FdwLevel    DWORD
  42760 	FdwRevision DWORD
  42761 }
  42762 
  42763 type CERT_TPM_SPECIFICATION_INFO = _CERT_TPM_SPECIFICATION_INFO
  42764 type PCERT_TPM_SPECIFICATION_INFO = uintptr
  42765 
  42766 type HCRYPTOIDFUNCSET = uintptr
  42767 type HCRYPTOIDFUNCADDR = uintptr
  42768 
  42769 type _CRYPT_OID_FUNC_ENTRY = struct {
  42770 	FpszOID     LPCSTR
  42771 	FpvFuncAddr uintptr
  42772 }
  42773 
  42774 type CRYPT_OID_FUNC_ENTRY = _CRYPT_OID_FUNC_ENTRY
  42775 type PCRYPT_OID_FUNC_ENTRY = uintptr
  42776 
  42777 type PFN_CRYPT_ENUM_OID_FUNC = uintptr
  42778 
  42779 type _CRYPT_OID_INFO = struct {
  42780 	FcbSize      DWORD
  42781 	F__ccgo_pad1 [4]byte
  42782 	FpszOID      LPCSTR
  42783 	FpwszName    LPCWSTR
  42784 	FdwGroupId   DWORD
  42785 	F__28        struct{ FdwValue DWORD }
  42786 	FExtraInfo   CRYPT_DATA_BLOB
  42787 }
  42788 
  42789 type CRYPT_OID_INFO = _CRYPT_OID_INFO
  42790 type PCRYPT_OID_INFO = uintptr
  42791 
  42792 type CCRYPT_OID_INFO = CRYPT_OID_INFO
  42793 type PCCRYPT_OID_INFO = uintptr
  42794 
  42795 type PFN_CRYPT_ENUM_OID_INFO = uintptr
  42796 
  42797 type _CERT_STRONG_SIGN_SERIALIZED_INFO = struct {
  42798 	FdwFlags                    DWORD
  42799 	F__ccgo_pad1                [4]byte
  42800 	FpwszCNGSignHashAlgids      LPWSTR
  42801 	FpwszCNGPubKeyMinBitLengths LPWSTR
  42802 }
  42803 
  42804 type CERT_STRONG_SIGN_SERIALIZED_INFO = _CERT_STRONG_SIGN_SERIALIZED_INFO
  42805 type PCERT_STRONG_SIGN_SERIALIZED_INFO = uintptr
  42806 
  42807 type _CERT_STRONG_SIGN_PARA = struct {
  42808 	FcbSize       DWORD
  42809 	FdwInfoChoice DWORD
  42810 	F__8          struct{ FpvInfo uintptr }
  42811 }
  42812 
  42813 type CERT_STRONG_SIGN_PARA = _CERT_STRONG_SIGN_PARA
  42814 type PCERT_STRONG_SIGN_PARA = uintptr
  42815 
  42816 type PCCERT_STRONG_SIGN_PARA = uintptr
  42817 
  42818 type HCRYPTMSG = uintptr
  42819 
  42820 type _CERT_ISSUER_SERIAL_NUMBER = struct {
  42821 	FIssuer       CERT_NAME_BLOB
  42822 	FSerialNumber CRYPT_INTEGER_BLOB
  42823 }
  42824 
  42825 type CERT_ISSUER_SERIAL_NUMBER = _CERT_ISSUER_SERIAL_NUMBER
  42826 type PCERT_ISSUER_SERIAL_NUMBER = uintptr
  42827 
  42828 type _CERT_ID = struct {
  42829 	FdwIdChoice  DWORD
  42830 	F__ccgo_pad1 [4]byte
  42831 	F__8         struct{ FIssuerSerialNumber CERT_ISSUER_SERIAL_NUMBER }
  42832 }
  42833 
  42834 type CERT_ID = _CERT_ID
  42835 type PCERT_ID = uintptr
  42836 
  42837 type _CMSG_SIGNER_ENCODE_INFO = struct {
  42838 	FcbSize        DWORD
  42839 	F__ccgo_pad1   [4]byte
  42840 	FpCertInfo     PCERT_INFO
  42841 	F__16          struct{ FhCryptProv HCRYPTPROV }
  42842 	FdwKeySpec     DWORD
  42843 	F__ccgo_pad2   [4]byte
  42844 	FHashAlgorithm CRYPT_ALGORITHM_IDENTIFIER
  42845 	FpvHashAuxInfo uintptr
  42846 	FcAuthAttr     DWORD
  42847 	F__ccgo_pad3   [4]byte
  42848 	FrgAuthAttr    PCRYPT_ATTRIBUTE
  42849 	FcUnauthAttr   DWORD
  42850 	F__ccgo_pad4   [4]byte
  42851 	FrgUnauthAttr  PCRYPT_ATTRIBUTE
  42852 }
  42853 
  42854 type CMSG_SIGNER_ENCODE_INFO = _CMSG_SIGNER_ENCODE_INFO
  42855 type PCMSG_SIGNER_ENCODE_INFO = uintptr
  42856 
  42857 type _CMSG_SIGNED_ENCODE_INFO = struct {
  42858 	FcbSize        DWORD
  42859 	FcSigners      DWORD
  42860 	FrgSigners     PCMSG_SIGNER_ENCODE_INFO
  42861 	FcCertEncoded  DWORD
  42862 	F__ccgo_pad1   [4]byte
  42863 	FrgCertEncoded PCERT_BLOB
  42864 	FcCrlEncoded   DWORD
  42865 	F__ccgo_pad2   [4]byte
  42866 	FrgCrlEncoded  PCRL_BLOB
  42867 }
  42868 
  42869 type CMSG_SIGNED_ENCODE_INFO = _CMSG_SIGNED_ENCODE_INFO
  42870 type PCMSG_SIGNED_ENCODE_INFO = uintptr
  42871 
  42872 type _CMSG_RECIPIENT_ENCODE_INFO = struct {
  42873 	FdwRecipientChoice DWORD
  42874 	F__ccgo_pad1       [4]byte
  42875 	F__8               struct {
  42876 		FpKeyTrans PCMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO
  42877 	}
  42878 }
  42879 
  42880 type CMSG_RECIPIENT_ENCODE_INFO = _CMSG_RECIPIENT_ENCODE_INFO
  42881 type PCMSG_RECIPIENT_ENCODE_INFO = uintptr
  42882 
  42883 type _CMSG_ENVELOPED_ENCODE_INFO = struct {
  42884 	FcbSize                     DWORD
  42885 	F__ccgo_pad1                [4]byte
  42886 	FhCryptProv                 HCRYPTPROV_LEGACY
  42887 	FContentEncryptionAlgorithm CRYPT_ALGORITHM_IDENTIFIER
  42888 	FpvEncryptionAuxInfo        uintptr
  42889 	FcRecipients                DWORD
  42890 	F__ccgo_pad2                [4]byte
  42891 	FrgpRecipients              uintptr
  42892 }
  42893 
  42894 type CMSG_ENVELOPED_ENCODE_INFO = _CMSG_ENVELOPED_ENCODE_INFO
  42895 type PCMSG_ENVELOPED_ENCODE_INFO = uintptr
  42896 
  42897 type _CMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO = struct {
  42898 	FcbSize                 DWORD
  42899 	F__ccgo_pad1            [4]byte
  42900 	FKeyEncryptionAlgorithm CRYPT_ALGORITHM_IDENTIFIER
  42901 	FpvKeyEncryptionAuxInfo uintptr
  42902 	FhCryptProv             HCRYPTPROV_LEGACY
  42903 	FRecipientPublicKey     CRYPT_BIT_BLOB
  42904 	FRecipientId            CERT_ID
  42905 }
  42906 
  42907 type CMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO = _CMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO
  42908 type PCMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO = uintptr
  42909 
  42910 type _CMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO = struct {
  42911 	FcbSize             DWORD
  42912 	F__ccgo_pad1        [4]byte
  42913 	FRecipientPublicKey CRYPT_BIT_BLOB
  42914 	FRecipientId        CERT_ID
  42915 	FDate               FILETIME
  42916 	FpOtherAttr         PCRYPT_ATTRIBUTE_TYPE_VALUE
  42917 }
  42918 
  42919 type CMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO = _CMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO
  42920 type PCMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO = uintptr
  42921 
  42922 type _CMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO = struct {
  42923 	FcbSize                    DWORD
  42924 	F__ccgo_pad1               [4]byte
  42925 	FKeyEncryptionAlgorithm    CRYPT_ALGORITHM_IDENTIFIER
  42926 	FpvKeyEncryptionAuxInfo    uintptr
  42927 	FKeyWrapAlgorithm          CRYPT_ALGORITHM_IDENTIFIER
  42928 	FpvKeyWrapAuxInfo          uintptr
  42929 	FhCryptProv                HCRYPTPROV_LEGACY
  42930 	FdwKeySpec                 DWORD
  42931 	FdwKeyChoice               DWORD
  42932 	F__88                      struct{ FpEphemeralAlgorithm PCRYPT_ALGORITHM_IDENTIFIER }
  42933 	FUserKeyingMaterial        CRYPT_DATA_BLOB
  42934 	FcRecipientEncryptedKeys   DWORD
  42935 	F__ccgo_pad2               [4]byte
  42936 	FrgpRecipientEncryptedKeys uintptr
  42937 }
  42938 
  42939 type CMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO = _CMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO
  42940 type PCMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO = uintptr
  42941 
  42942 type _CMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO = struct {
  42943 	FcbSize                 DWORD
  42944 	F__ccgo_pad1            [4]byte
  42945 	FKeyEncryptionAlgorithm CRYPT_ALGORITHM_IDENTIFIER
  42946 	FpvKeyEncryptionAuxInfo uintptr
  42947 	FhCryptProv             HCRYPTPROV
  42948 	FdwKeyChoice            DWORD
  42949 	F__ccgo_pad2            [4]byte
  42950 	F__56                   struct{ FhKeyEncryptionKey HCRYPTKEY }
  42951 	FKeyId                  CRYPT_DATA_BLOB
  42952 	FDate                   FILETIME
  42953 	FpOtherAttr             PCRYPT_ATTRIBUTE_TYPE_VALUE
  42954 }
  42955 
  42956 type CMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO = _CMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO
  42957 type PCMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO = uintptr
  42958 
  42959 type _CMSG_RC2_AUX_INFO = struct {
  42960 	FcbSize   DWORD
  42961 	FdwBitLen DWORD
  42962 }
  42963 
  42964 type CMSG_RC2_AUX_INFO = _CMSG_RC2_AUX_INFO
  42965 type PCMSG_RC2_AUX_INFO = uintptr
  42966 
  42967 type _CMSG_SP3_COMPATIBLE_AUX_INFO = struct {
  42968 	FcbSize  DWORD
  42969 	FdwFlags DWORD
  42970 }
  42971 
  42972 type CMSG_SP3_COMPATIBLE_AUX_INFO = _CMSG_SP3_COMPATIBLE_AUX_INFO
  42973 type PCMSG_SP3_COMPATIBLE_AUX_INFO = uintptr
  42974 
  42975 type _CMSG_RC4_AUX_INFO = struct {
  42976 	FcbSize   DWORD
  42977 	FdwBitLen DWORD
  42978 }
  42979 
  42980 type CMSG_RC4_AUX_INFO = _CMSG_RC4_AUX_INFO
  42981 type PCMSG_RC4_AUX_INFO = uintptr
  42982 
  42983 type _CMSG_SIGNED_AND_ENVELOPED_ENCODE_INFO = struct {
  42984 	FcbSize        DWORD
  42985 	F__ccgo_pad1   [4]byte
  42986 	FSignedInfo    CMSG_SIGNED_ENCODE_INFO
  42987 	FEnvelopedInfo CMSG_ENVELOPED_ENCODE_INFO
  42988 }
  42989 
  42990 type CMSG_SIGNED_AND_ENVELOPED_ENCODE_INFO = _CMSG_SIGNED_AND_ENVELOPED_ENCODE_INFO
  42991 type PCMSG_SIGNED_AND_ENVELOPED_ENCODE_INFO = uintptr
  42992 
  42993 type _CMSG_HASHED_ENCODE_INFO = struct {
  42994 	FcbSize        DWORD
  42995 	F__ccgo_pad1   [4]byte
  42996 	FhCryptProv    HCRYPTPROV_LEGACY
  42997 	FHashAlgorithm CRYPT_ALGORITHM_IDENTIFIER
  42998 	FpvHashAuxInfo uintptr
  42999 }
  43000 
  43001 type CMSG_HASHED_ENCODE_INFO = _CMSG_HASHED_ENCODE_INFO
  43002 type PCMSG_HASHED_ENCODE_INFO = uintptr
  43003 
  43004 type _CMSG_ENCRYPTED_ENCODE_INFO = struct {
  43005 	FcbSize                     DWORD
  43006 	F__ccgo_pad1                [4]byte
  43007 	FContentEncryptionAlgorithm CRYPT_ALGORITHM_IDENTIFIER
  43008 	FpvEncryptionAuxInfo        uintptr
  43009 }
  43010 
  43011 type CMSG_ENCRYPTED_ENCODE_INFO = _CMSG_ENCRYPTED_ENCODE_INFO
  43012 type PCMSG_ENCRYPTED_ENCODE_INFO = uintptr
  43013 
  43014 type PFN_CMSG_STREAM_OUTPUT = uintptr
  43015 
  43016 type _CMSG_STREAM_INFO = struct {
  43017 	FcbContent       DWORD
  43018 	F__ccgo_pad1     [4]byte
  43019 	FpfnStreamOutput PFN_CMSG_STREAM_OUTPUT
  43020 	FpvArg           uintptr
  43021 }
  43022 
  43023 type CMSG_STREAM_INFO = _CMSG_STREAM_INFO
  43024 type PCMSG_STREAM_INFO = uintptr
  43025 
  43026 type _CMSG_SIGNER_INFO = struct {
  43027 	FdwVersion               DWORD
  43028 	F__ccgo_pad1             [4]byte
  43029 	FIssuer                  CERT_NAME_BLOB
  43030 	FSerialNumber            CRYPT_INTEGER_BLOB
  43031 	FHashAlgorithm           CRYPT_ALGORITHM_IDENTIFIER
  43032 	FHashEncryptionAlgorithm CRYPT_ALGORITHM_IDENTIFIER
  43033 	FEncryptedHash           CRYPT_DATA_BLOB
  43034 	FAuthAttrs               CRYPT_ATTRIBUTES
  43035 	FUnauthAttrs             CRYPT_ATTRIBUTES
  43036 }
  43037 
  43038 type CMSG_SIGNER_INFO = _CMSG_SIGNER_INFO
  43039 type PCMSG_SIGNER_INFO = uintptr
  43040 
  43041 type _CMSG_CMS_SIGNER_INFO = struct {
  43042 	FdwVersion               DWORD
  43043 	F__ccgo_pad1             [4]byte
  43044 	FSignerId                CERT_ID
  43045 	FHashAlgorithm           CRYPT_ALGORITHM_IDENTIFIER
  43046 	FHashEncryptionAlgorithm CRYPT_ALGORITHM_IDENTIFIER
  43047 	FEncryptedHash           CRYPT_DATA_BLOB
  43048 	FAuthAttrs               CRYPT_ATTRIBUTES
  43049 	FUnauthAttrs             CRYPT_ATTRIBUTES
  43050 }
  43051 
  43052 type CMSG_CMS_SIGNER_INFO = _CMSG_CMS_SIGNER_INFO
  43053 type PCMSG_CMS_SIGNER_INFO = uintptr
  43054 
  43055 type CMSG_ATTR = CRYPT_ATTRIBUTES
  43056 type PCMSG_ATTR = uintptr
  43057 
  43058 type _CMSG_KEY_TRANS_RECIPIENT_INFO = struct {
  43059 	FdwVersion              DWORD
  43060 	F__ccgo_pad1            [4]byte
  43061 	FRecipientId            CERT_ID
  43062 	FKeyEncryptionAlgorithm CRYPT_ALGORITHM_IDENTIFIER
  43063 	FEncryptedKey           CRYPT_DATA_BLOB
  43064 }
  43065 
  43066 type CMSG_KEY_TRANS_RECIPIENT_INFO = _CMSG_KEY_TRANS_RECIPIENT_INFO
  43067 type PCMSG_KEY_TRANS_RECIPIENT_INFO = uintptr
  43068 
  43069 type _CMSG_RECIPIENT_ENCRYPTED_KEY_INFO = struct {
  43070 	FRecipientId  CERT_ID
  43071 	FEncryptedKey CRYPT_DATA_BLOB
  43072 	FDate         FILETIME
  43073 	FpOtherAttr   PCRYPT_ATTRIBUTE_TYPE_VALUE
  43074 }
  43075 
  43076 type CMSG_RECIPIENT_ENCRYPTED_KEY_INFO = _CMSG_RECIPIENT_ENCRYPTED_KEY_INFO
  43077 type PCMSG_RECIPIENT_ENCRYPTED_KEY_INFO = uintptr
  43078 
  43079 type _CMSG_KEY_AGREE_RECIPIENT_INFO = struct {
  43080 	FdwVersion          DWORD
  43081 	FdwOriginatorChoice DWORD
  43082 	F__8                struct {
  43083 		FOriginatorCertId CERT_ID
  43084 		F__ccgo_pad1      [8]byte
  43085 	}
  43086 	FUserKeyingMaterial        CRYPT_DATA_BLOB
  43087 	FKeyEncryptionAlgorithm    CRYPT_ALGORITHM_IDENTIFIER
  43088 	FcRecipientEncryptedKeys   DWORD
  43089 	F__ccgo_pad1               [4]byte
  43090 	FrgpRecipientEncryptedKeys uintptr
  43091 }
  43092 
  43093 type CMSG_KEY_AGREE_RECIPIENT_INFO = _CMSG_KEY_AGREE_RECIPIENT_INFO
  43094 type PCMSG_KEY_AGREE_RECIPIENT_INFO = uintptr
  43095 
  43096 type _CMSG_MAIL_LIST_RECIPIENT_INFO = struct {
  43097 	FdwVersion              DWORD
  43098 	F__ccgo_pad1            [4]byte
  43099 	FKeyId                  CRYPT_DATA_BLOB
  43100 	FKeyEncryptionAlgorithm CRYPT_ALGORITHM_IDENTIFIER
  43101 	FEncryptedKey           CRYPT_DATA_BLOB
  43102 	FDate                   FILETIME
  43103 	FpOtherAttr             PCRYPT_ATTRIBUTE_TYPE_VALUE
  43104 }
  43105 
  43106 type CMSG_MAIL_LIST_RECIPIENT_INFO = _CMSG_MAIL_LIST_RECIPIENT_INFO
  43107 type PCMSG_MAIL_LIST_RECIPIENT_INFO = uintptr
  43108 
  43109 type _CMSG_CMS_RECIPIENT_INFO = struct {
  43110 	FdwRecipientChoice DWORD
  43111 	F__ccgo_pad1       [4]byte
  43112 	F__8               struct {
  43113 		FpKeyTrans PCMSG_KEY_TRANS_RECIPIENT_INFO
  43114 	}
  43115 }
  43116 
  43117 type CMSG_CMS_RECIPIENT_INFO = _CMSG_CMS_RECIPIENT_INFO
  43118 type PCMSG_CMS_RECIPIENT_INFO = uintptr
  43119 
  43120 type _CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA = struct {
  43121 	FcbSize        DWORD
  43122 	F__ccgo_pad1   [4]byte
  43123 	FhCryptProv    HCRYPTPROV_LEGACY
  43124 	FdwSignerIndex DWORD
  43125 	FdwSignerType  DWORD
  43126 	FpvSigner      uintptr
  43127 }
  43128 
  43129 type CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA = _CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA
  43130 type PCMSG_CTRL_VERIFY_SIGNATURE_EX_PARA = uintptr
  43131 
  43132 type _CMSG_CTRL_DECRYPT_PARA = struct {
  43133 	FcbSize           DWORD
  43134 	F__ccgo_pad1      [4]byte
  43135 	F__8              struct{ FhCryptProv HCRYPTPROV }
  43136 	FdwKeySpec        DWORD
  43137 	FdwRecipientIndex DWORD
  43138 }
  43139 
  43140 type CMSG_CTRL_DECRYPT_PARA = _CMSG_CTRL_DECRYPT_PARA
  43141 type PCMSG_CTRL_DECRYPT_PARA = uintptr
  43142 
  43143 type _CMSG_CTRL_KEY_TRANS_DECRYPT_PARA = struct {
  43144 	FcbSize           DWORD
  43145 	F__ccgo_pad1      [4]byte
  43146 	F__8              struct{ FhCryptProv HCRYPTPROV }
  43147 	FdwKeySpec        DWORD
  43148 	F__ccgo_pad2      [4]byte
  43149 	FpKeyTrans        PCMSG_KEY_TRANS_RECIPIENT_INFO
  43150 	FdwRecipientIndex DWORD
  43151 	F__ccgo_pad3      [4]byte
  43152 }
  43153 
  43154 type CMSG_CTRL_KEY_TRANS_DECRYPT_PARA = _CMSG_CTRL_KEY_TRANS_DECRYPT_PARA
  43155 type PCMSG_CTRL_KEY_TRANS_DECRYPT_PARA = uintptr
  43156 
  43157 type _CMSG_CTRL_KEY_AGREE_DECRYPT_PARA = struct {
  43158 	FcbSize                       DWORD
  43159 	F__ccgo_pad1                  [4]byte
  43160 	F__8                          struct{ FhCryptProv HCRYPTPROV }
  43161 	FdwKeySpec                    DWORD
  43162 	F__ccgo_pad2                  [4]byte
  43163 	FpKeyAgree                    PCMSG_KEY_AGREE_RECIPIENT_INFO
  43164 	FdwRecipientIndex             DWORD
  43165 	FdwRecipientEncryptedKeyIndex DWORD
  43166 	FOriginatorPublicKey          CRYPT_BIT_BLOB
  43167 }
  43168 
  43169 type CMSG_CTRL_KEY_AGREE_DECRYPT_PARA = _CMSG_CTRL_KEY_AGREE_DECRYPT_PARA
  43170 type PCMSG_CTRL_KEY_AGREE_DECRYPT_PARA = uintptr
  43171 
  43172 type _CMSG_CTRL_MAIL_LIST_DECRYPT_PARA = struct {
  43173 	FcbSize           DWORD
  43174 	F__ccgo_pad1      [4]byte
  43175 	FhCryptProv       HCRYPTPROV
  43176 	FpMailList        PCMSG_MAIL_LIST_RECIPIENT_INFO
  43177 	FdwRecipientIndex DWORD
  43178 	FdwKeyChoice      DWORD
  43179 	F__32             struct{ FhKeyEncryptionKey HCRYPTKEY }
  43180 }
  43181 
  43182 type CMSG_CTRL_MAIL_LIST_DECRYPT_PARA = _CMSG_CTRL_MAIL_LIST_DECRYPT_PARA
  43183 type PCMSG_CTRL_MAIL_LIST_DECRYPT_PARA = uintptr
  43184 
  43185 type _CMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR_PARA = struct {
  43186 	FcbSize        DWORD
  43187 	FdwSignerIndex DWORD
  43188 	Fblob          CRYPT_DATA_BLOB
  43189 }
  43190 
  43191 type CMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR_PARA = _CMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR_PARA
  43192 type PCMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR_PARA = uintptr
  43193 
  43194 type _CMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR_PARA = struct {
  43195 	FcbSize            DWORD
  43196 	FdwSignerIndex     DWORD
  43197 	FdwUnauthAttrIndex DWORD
  43198 }
  43199 
  43200 type CMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR_PARA = _CMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR_PARA
  43201 type PCMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR_PARA = uintptr
  43202 
  43203 type PFN_CMSG_ALLOC = uintptr
  43204 type PFN_CMSG_FREE = uintptr
  43205 
  43206 type PFN_CMSG_GEN_ENCRYPT_KEY = uintptr
  43207 type PFN_CMSG_EXPORT_ENCRYPT_KEY = uintptr
  43208 type PFN_CMSG_IMPORT_ENCRYPT_KEY = uintptr
  43209 
  43210 type _CMSG_CONTENT_ENCRYPT_INFO = struct {
  43211 	FcbSize                       DWORD
  43212 	F__ccgo_pad1                  [4]byte
  43213 	FhCryptProv                   HCRYPTPROV_LEGACY
  43214 	FContentEncryptionAlgorithm   CRYPT_ALGORITHM_IDENTIFIER
  43215 	FpvEncryptionAuxInfo          uintptr
  43216 	FcRecipients                  DWORD
  43217 	F__ccgo_pad2                  [4]byte
  43218 	FrgCmsRecipients              PCMSG_RECIPIENT_ENCODE_INFO
  43219 	FpfnAlloc                     PFN_CMSG_ALLOC
  43220 	FpfnFree                      PFN_CMSG_FREE
  43221 	FdwEncryptFlags               DWORD
  43222 	F__ccgo_pad3                  [4]byte
  43223 	F__88                         struct{ FhContentEncryptKey HCRYPTKEY }
  43224 	FdwFlags                      DWORD
  43225 	FfCNG                         WINBOOL
  43226 	FpbCNGContentEncryptKeyObject uintptr
  43227 	FpbContentEncryptKey          uintptr
  43228 	FcbContentEncryptKey          DWORD
  43229 	F__ccgo_pad4                  [4]byte
  43230 }
  43231 
  43232 type CMSG_CONTENT_ENCRYPT_INFO = _CMSG_CONTENT_ENCRYPT_INFO
  43233 type PCMSG_CONTENT_ENCRYPT_INFO = uintptr
  43234 
  43235 type PFN_CMSG_GEN_CONTENT_ENCRYPT_KEY = uintptr
  43236 
  43237 type _CMSG_KEY_TRANS_ENCRYPT_INFO = struct {
  43238 	FcbSize                 DWORD
  43239 	FdwRecipientIndex       DWORD
  43240 	FKeyEncryptionAlgorithm CRYPT_ALGORITHM_IDENTIFIER
  43241 	FEncryptedKey           CRYPT_DATA_BLOB
  43242 	FdwFlags                DWORD
  43243 	F__ccgo_pad1            [4]byte
  43244 }
  43245 
  43246 type CMSG_KEY_TRANS_ENCRYPT_INFO = _CMSG_KEY_TRANS_ENCRYPT_INFO
  43247 type PCMSG_KEY_TRANS_ENCRYPT_INFO = uintptr
  43248 
  43249 type PFN_CMSG_EXPORT_KEY_TRANS = uintptr
  43250 
  43251 type _CMSG_KEY_AGREE_KEY_ENCRYPT_INFO = struct {
  43252 	FcbSize       DWORD
  43253 	F__ccgo_pad1  [4]byte
  43254 	FEncryptedKey CRYPT_DATA_BLOB
  43255 }
  43256 
  43257 type CMSG_KEY_AGREE_KEY_ENCRYPT_INFO = _CMSG_KEY_AGREE_KEY_ENCRYPT_INFO
  43258 type PCMSG_KEY_AGREE_KEY_ENCRYPT_INFO = uintptr
  43259 
  43260 type _CMSG_KEY_AGREE_ENCRYPT_INFO = struct {
  43261 	FcbSize                 DWORD
  43262 	FdwRecipientIndex       DWORD
  43263 	FKeyEncryptionAlgorithm CRYPT_ALGORITHM_IDENTIFIER
  43264 	FUserKeyingMaterial     CRYPT_DATA_BLOB
  43265 	FdwOriginatorChoice     DWORD
  43266 	F__ccgo_pad1            [4]byte
  43267 	F__56                   struct {
  43268 		FOriginatorCertId CERT_ID
  43269 		F__ccgo_pad1      [8]byte
  43270 	}
  43271 	FcKeyAgreeKeyEncryptInfo   DWORD
  43272 	F__ccgo_pad2               [4]byte
  43273 	FrgpKeyAgreeKeyEncryptInfo uintptr
  43274 	FdwFlags                   DWORD
  43275 	F__ccgo_pad3               [4]byte
  43276 }
  43277 
  43278 type CMSG_KEY_AGREE_ENCRYPT_INFO = _CMSG_KEY_AGREE_ENCRYPT_INFO
  43279 type PCMSG_KEY_AGREE_ENCRYPT_INFO = uintptr
  43280 
  43281 type PFN_CMSG_EXPORT_KEY_AGREE = uintptr
  43282 
  43283 type _CMSG_MAIL_LIST_ENCRYPT_INFO = struct {
  43284 	FcbSize                 DWORD
  43285 	FdwRecipientIndex       DWORD
  43286 	FKeyEncryptionAlgorithm CRYPT_ALGORITHM_IDENTIFIER
  43287 	FEncryptedKey           CRYPT_DATA_BLOB
  43288 	FdwFlags                DWORD
  43289 	F__ccgo_pad1            [4]byte
  43290 }
  43291 
  43292 type CMSG_MAIL_LIST_ENCRYPT_INFO = _CMSG_MAIL_LIST_ENCRYPT_INFO
  43293 type PCMSG_MAIL_LIST_ENCRYPT_INFO = uintptr
  43294 
  43295 type PFN_CMSG_EXPORT_MAIL_LIST = uintptr
  43296 type PFN_CMSG_IMPORT_KEY_TRANS = uintptr
  43297 type PFN_CMSG_IMPORT_KEY_AGREE = uintptr
  43298 type PFN_CMSG_IMPORT_MAIL_LIST = uintptr
  43299 
  43300 type _CMSG_CNG_CONTENT_DECRYPT_INFO = struct {
  43301 	FcbSize                       DWORD
  43302 	F__ccgo_pad1                  [4]byte
  43303 	FContentEncryptionAlgorithm   CRYPT_ALGORITHM_IDENTIFIER
  43304 	FpfnAlloc                     PFN_CMSG_ALLOC
  43305 	FpfnFree                      PFN_CMSG_FREE
  43306 	FhNCryptKey                   NCRYPT_KEY_HANDLE
  43307 	FpbContentEncryptKey          uintptr
  43308 	FcbContentEncryptKey          DWORD
  43309 	F__ccgo_pad2                  [4]byte
  43310 	FhCNGContentEncryptKey        BCRYPT_KEY_HANDLE
  43311 	FpbCNGContentEncryptKeyObject uintptr
  43312 }
  43313 
  43314 type CMSG_CNG_CONTENT_DECRYPT_INFO = _CMSG_CNG_CONTENT_DECRYPT_INFO
  43315 type PCMSG_CNG_CONTENT_DECRYPT_INFO = uintptr
  43316 
  43317 type PFN_CMSG_CNG_IMPORT_KEY_TRANS = uintptr
  43318 type PFN_CMSG_CNG_IMPORT_KEY_AGREE = uintptr
  43319 type PFN_CMSG_CNG_IMPORT_CONTENT_ENCRYPT_KEY = uintptr
  43320 
  43321 type HCERTSTORE = uintptr
  43322 
  43323 type _CERT_CONTEXT = struct {
  43324 	FdwCertEncodingType DWORD
  43325 	F__ccgo_pad1        [4]byte
  43326 	FpbCertEncoded      uintptr
  43327 	FcbCertEncoded      DWORD
  43328 	F__ccgo_pad2        [4]byte
  43329 	FpCertInfo          PCERT_INFO
  43330 	FhCertStore         HCERTSTORE
  43331 }
  43332 
  43333 type CERT_CONTEXT = _CERT_CONTEXT
  43334 type PCERT_CONTEXT = uintptr
  43335 
  43336 type PCCERT_CONTEXT = uintptr
  43337 
  43338 type _CRL_CONTEXT = struct {
  43339 	FdwCertEncodingType DWORD
  43340 	F__ccgo_pad1        [4]byte
  43341 	FpbCrlEncoded       uintptr
  43342 	FcbCrlEncoded       DWORD
  43343 	F__ccgo_pad2        [4]byte
  43344 	FpCrlInfo           PCRL_INFO
  43345 	FhCertStore         HCERTSTORE
  43346 }
  43347 
  43348 type CRL_CONTEXT = _CRL_CONTEXT
  43349 type PCRL_CONTEXT = uintptr
  43350 
  43351 type PCCRL_CONTEXT = uintptr
  43352 
  43353 type _CTL_CONTEXT = struct {
  43354 	FdwMsgAndCertEncodingType DWORD
  43355 	F__ccgo_pad1              [4]byte
  43356 	FpbCtlEncoded             uintptr
  43357 	FcbCtlEncoded             DWORD
  43358 	F__ccgo_pad2              [4]byte
  43359 	FpCtlInfo                 PCTL_INFO
  43360 	FhCertStore               HCERTSTORE
  43361 	FhCryptMsg                HCRYPTMSG
  43362 	FpbCtlContent             uintptr
  43363 	FcbCtlContent             DWORD
  43364 	F__ccgo_pad3              [4]byte
  43365 }
  43366 
  43367 type CTL_CONTEXT = _CTL_CONTEXT
  43368 type PCTL_CONTEXT = uintptr
  43369 
  43370 type PCCTL_CONTEXT = uintptr
  43371 
  43372 type CertKeyType = uint32
  43373 
  43374 type _CRYPT_KEY_PROV_PARAM = struct {
  43375 	FdwParam     DWORD
  43376 	F__ccgo_pad1 [4]byte
  43377 	FpbData      uintptr
  43378 	FcbData      DWORD
  43379 	FdwFlags     DWORD
  43380 }
  43381 
  43382 type CRYPT_KEY_PROV_PARAM = _CRYPT_KEY_PROV_PARAM
  43383 type PCRYPT_KEY_PROV_PARAM = uintptr
  43384 
  43385 type _CRYPT_KEY_PROV_INFO = struct {
  43386 	FpwszContainerName LPWSTR
  43387 	FpwszProvName      LPWSTR
  43388 	FdwProvType        DWORD
  43389 	FdwFlags           DWORD
  43390 	FcProvParam        DWORD
  43391 	F__ccgo_pad1       [4]byte
  43392 	FrgProvParam       PCRYPT_KEY_PROV_PARAM
  43393 	FdwKeySpec         DWORD
  43394 	F__ccgo_pad2       [4]byte
  43395 }
  43396 
  43397 type CRYPT_KEY_PROV_INFO = _CRYPT_KEY_PROV_INFO
  43398 type PCRYPT_KEY_PROV_INFO = uintptr
  43399 
  43400 type _CERT_KEY_CONTEXT = struct {
  43401 	FcbSize      DWORD
  43402 	F__ccgo_pad1 [4]byte
  43403 	F__8         struct{ FhCryptProv HCRYPTPROV }
  43404 	FdwKeySpec   DWORD
  43405 	F__ccgo_pad2 [4]byte
  43406 }
  43407 
  43408 type CERT_KEY_CONTEXT = _CERT_KEY_CONTEXT
  43409 type PCERT_KEY_CONTEXT = uintptr
  43410 
  43411 type _ROOT_INFO_LUID = struct {
  43412 	FLowPart  DWORD
  43413 	FHighPart LONG
  43414 }
  43415 
  43416 type ROOT_INFO_LUID = _ROOT_INFO_LUID
  43417 type PROOT_INFO_LUID = uintptr
  43418 
  43419 type _CRYPT_SMART_CARD_ROOT_INFO = struct {
  43420 	FrgbCardID [16]BYTE
  43421 	Fluid      ROOT_INFO_LUID
  43422 }
  43423 
  43424 type CRYPT_SMART_CARD_ROOT_INFO = _CRYPT_SMART_CARD_ROOT_INFO
  43425 type PCRYPT_SMART_CARD_ROOT_INFO = uintptr
  43426 
  43427 type _CERT_SYSTEM_STORE_RELOCATE_PARA = struct {
  43428 	F__0 struct{ FhKeyBase HKEY }
  43429 	F__8 struct{ FpvSystemStore uintptr }
  43430 }
  43431 
  43432 type CERT_SYSTEM_STORE_RELOCATE_PARA = _CERT_SYSTEM_STORE_RELOCATE_PARA
  43433 type PCERT_SYSTEM_STORE_RELOCATE_PARA = uintptr
  43434 
  43435 type _CERT_REGISTRY_STORE_CLIENT_GPT_PARA = struct {
  43436 	FhKeyBase    HKEY
  43437 	FpwszRegPath LPWSTR
  43438 }
  43439 
  43440 type CERT_REGISTRY_STORE_CLIENT_GPT_PARA = _CERT_REGISTRY_STORE_CLIENT_GPT_PARA
  43441 type PCERT_REGISTRY_STORE_CLIENT_GPT_PARA = uintptr
  43442 
  43443 type _CERT_REGISTRY_STORE_ROAMING_PARA = struct {
  43444 	FhKey               HKEY
  43445 	FpwszStoreDirectory LPWSTR
  43446 }
  43447 
  43448 type CERT_REGISTRY_STORE_ROAMING_PARA = _CERT_REGISTRY_STORE_ROAMING_PARA
  43449 type PCERT_REGISTRY_STORE_ROAMING_PARA = uintptr
  43450 
  43451 type _CERT_LDAP_STORE_OPENED_PARA = struct {
  43452 	FpvLdapSessionHandle uintptr
  43453 	FpwszLdapUrl         LPCWSTR
  43454 }
  43455 
  43456 type CERT_LDAP_STORE_OPENED_PARA = _CERT_LDAP_STORE_OPENED_PARA
  43457 type PCERT_LDAP_STORE_OPENED_PARA = uintptr
  43458 
  43459 type HCERTSTOREPROV = uintptr
  43460 
  43461 type _CERT_STORE_PROV_INFO = struct {
  43462 	FcbSize              DWORD
  43463 	FcStoreProvFunc      DWORD
  43464 	FrgpvStoreProvFunc   uintptr
  43465 	FhStoreProv          HCERTSTOREPROV
  43466 	FdwStoreProvFlags    DWORD
  43467 	F__ccgo_pad1         [4]byte
  43468 	FhStoreProvFuncAddr2 HCRYPTOIDFUNCADDR
  43469 }
  43470 
  43471 type CERT_STORE_PROV_INFO = _CERT_STORE_PROV_INFO
  43472 type PCERT_STORE_PROV_INFO = uintptr
  43473 
  43474 type PFN_CERT_DLL_OPEN_STORE_PROV_FUNC = uintptr
  43475 
  43476 type PFN_CERT_STORE_PROV_CLOSE = uintptr
  43477 type PFN_CERT_STORE_PROV_READ_CERT = uintptr
  43478 type PFN_CERT_STORE_PROV_WRITE_CERT = uintptr
  43479 type PFN_CERT_STORE_PROV_DELETE_CERT = uintptr
  43480 type PFN_CERT_STORE_PROV_SET_CERT_PROPERTY = uintptr
  43481 type PFN_CERT_STORE_PROV_READ_CRL = uintptr
  43482 type PFN_CERT_STORE_PROV_WRITE_CRL = uintptr
  43483 type PFN_CERT_STORE_PROV_DELETE_CRL = uintptr
  43484 type PFN_CERT_STORE_PROV_SET_CRL_PROPERTY = uintptr
  43485 type PFN_CERT_STORE_PROV_READ_CTL = uintptr
  43486 type PFN_CERT_STORE_PROV_WRITE_CTL = uintptr
  43487 type PFN_CERT_STORE_PROV_DELETE_CTL = uintptr
  43488 type PFN_CERT_STORE_PROV_SET_CTL_PROPERTY = uintptr
  43489 type PFN_CERT_STORE_PROV_CONTROL = uintptr
  43490 
  43491 type _CERT_STORE_PROV_FIND_INFO = struct {
  43492 	FcbSize                   DWORD
  43493 	FdwMsgAndCertEncodingType DWORD
  43494 	FdwFindFlags              DWORD
  43495 	FdwFindType               DWORD
  43496 	FpvFindPara               uintptr
  43497 }
  43498 
  43499 type CERT_STORE_PROV_FIND_INFO = _CERT_STORE_PROV_FIND_INFO
  43500 type PCERT_STORE_PROV_FIND_INFO = uintptr
  43501 
  43502 type CCERT_STORE_PROV_FIND_INFO = CERT_STORE_PROV_FIND_INFO
  43503 type PCCERT_STORE_PROV_FIND_INFO = uintptr
  43504 
  43505 type PFN_CERT_STORE_PROV_FIND_CERT = uintptr
  43506 type PFN_CERT_STORE_PROV_FREE_FIND_CERT = uintptr
  43507 type PFN_CERT_STORE_PROV_GET_CERT_PROPERTY = uintptr
  43508 type PFN_CERT_STORE_PROV_FIND_CRL = uintptr
  43509 type PFN_CERT_STORE_PROV_FREE_FIND_CRL = uintptr
  43510 type PFN_CERT_STORE_PROV_GET_CRL_PROPERTY = uintptr
  43511 type PFN_CERT_STORE_PROV_FIND_CTL = uintptr
  43512 type PFN_CERT_STORE_PROV_FREE_FIND_CTL = uintptr
  43513 type PFN_CERT_STORE_PROV_GET_CTL_PROPERTY = uintptr
  43514 
  43515 type _CRL_FIND_ISSUED_FOR_PARA = struct {
  43516 	FpSubjectCert PCCERT_CONTEXT
  43517 	FpIssuerCert  PCCERT_CONTEXT
  43518 }
  43519 
  43520 type CRL_FIND_ISSUED_FOR_PARA = _CRL_FIND_ISSUED_FOR_PARA
  43521 type PCRL_FIND_ISSUED_FOR_PARA = uintptr
  43522 
  43523 type _CTL_ANY_SUBJECT_INFO = struct {
  43524 	FSubjectAlgorithm  CRYPT_ALGORITHM_IDENTIFIER
  43525 	FSubjectIdentifier CRYPT_DATA_BLOB
  43526 }
  43527 
  43528 type CTL_ANY_SUBJECT_INFO = _CTL_ANY_SUBJECT_INFO
  43529 type PCTL_ANY_SUBJECT_INFO = uintptr
  43530 
  43531 type _CTL_FIND_USAGE_PARA = struct {
  43532 	FcbSize         DWORD
  43533 	F__ccgo_pad1    [4]byte
  43534 	FSubjectUsage   CTL_USAGE
  43535 	FListIdentifier CRYPT_DATA_BLOB
  43536 	FpSigner        PCERT_INFO
  43537 }
  43538 
  43539 type CTL_FIND_USAGE_PARA = _CTL_FIND_USAGE_PARA
  43540 type PCTL_FIND_USAGE_PARA = uintptr
  43541 
  43542 type _CTL_FIND_SUBJECT_PARA = struct {
  43543 	FcbSize        DWORD
  43544 	F__ccgo_pad1   [4]byte
  43545 	FpUsagePara    PCTL_FIND_USAGE_PARA
  43546 	FdwSubjectType DWORD
  43547 	F__ccgo_pad2   [4]byte
  43548 	FpvSubject     uintptr
  43549 }
  43550 
  43551 type CTL_FIND_SUBJECT_PARA = _CTL_FIND_SUBJECT_PARA
  43552 type PCTL_FIND_SUBJECT_PARA = uintptr
  43553 
  43554 type PFN_CERT_CREATE_CONTEXT_SORT_FUNC = uintptr
  43555 
  43556 type _CERT_CREATE_CONTEXT_PARA = struct {
  43557 	FcbSize      DWORD
  43558 	F__ccgo_pad1 [4]byte
  43559 	FpfnFree     PFN_CRYPT_FREE
  43560 	FpvFree      uintptr
  43561 	FpfnSort     PFN_CERT_CREATE_CONTEXT_SORT_FUNC
  43562 	FpvSort      uintptr
  43563 }
  43564 
  43565 type CERT_CREATE_CONTEXT_PARA = _CERT_CREATE_CONTEXT_PARA
  43566 type PCERT_CREATE_CONTEXT_PARA = uintptr
  43567 
  43568 type _CERT_SYSTEM_STORE_INFO = struct{ FcbSize DWORD }
  43569 
  43570 type CERT_SYSTEM_STORE_INFO = _CERT_SYSTEM_STORE_INFO
  43571 type PCERT_SYSTEM_STORE_INFO = uintptr
  43572 
  43573 type _CERT_PHYSICAL_STORE_INFO = struct {
  43574 	FcbSize               DWORD
  43575 	F__ccgo_pad1          [4]byte
  43576 	FpszOpenStoreProvider LPSTR
  43577 	FdwOpenEncodingType   DWORD
  43578 	FdwOpenFlags          DWORD
  43579 	FOpenParameters       CRYPT_DATA_BLOB
  43580 	FdwFlags              DWORD
  43581 	FdwPriority           DWORD
  43582 }
  43583 
  43584 type CERT_PHYSICAL_STORE_INFO = _CERT_PHYSICAL_STORE_INFO
  43585 type PCERT_PHYSICAL_STORE_INFO = uintptr
  43586 
  43587 type PFN_CERT_ENUM_SYSTEM_STORE_LOCATION = uintptr
  43588 type PFN_CERT_ENUM_SYSTEM_STORE = uintptr
  43589 type PFN_CERT_ENUM_PHYSICAL_STORE = uintptr
  43590 
  43591 type _CTL_VERIFY_USAGE_PARA = struct {
  43592 	FcbSize         DWORD
  43593 	F__ccgo_pad1    [4]byte
  43594 	FListIdentifier CRYPT_DATA_BLOB
  43595 	FcCtlStore      DWORD
  43596 	F__ccgo_pad2    [4]byte
  43597 	FrghCtlStore    uintptr
  43598 	FcSignerStore   DWORD
  43599 	F__ccgo_pad3    [4]byte
  43600 	FrghSignerStore uintptr
  43601 }
  43602 
  43603 type CTL_VERIFY_USAGE_PARA = _CTL_VERIFY_USAGE_PARA
  43604 type PCTL_VERIFY_USAGE_PARA = uintptr
  43605 
  43606 type _CTL_VERIFY_USAGE_STATUS = struct {
  43607 	FcbSize          DWORD
  43608 	FdwError         DWORD
  43609 	FdwFlags         DWORD
  43610 	F__ccgo_pad1     [4]byte
  43611 	FppCtl           uintptr
  43612 	FdwCtlEntryIndex DWORD
  43613 	F__ccgo_pad2     [4]byte
  43614 	FppSigner        uintptr
  43615 	FdwSignerIndex   DWORD
  43616 	F__ccgo_pad3     [4]byte
  43617 }
  43618 
  43619 type CTL_VERIFY_USAGE_STATUS = _CTL_VERIFY_USAGE_STATUS
  43620 type PCTL_VERIFY_USAGE_STATUS = uintptr
  43621 
  43622 type _CERT_REVOCATION_CRL_INFO = struct {
  43623 	FcbSize           DWORD
  43624 	F__ccgo_pad1      [4]byte
  43625 	FpBaseCrlContext  PCCRL_CONTEXT
  43626 	FpDeltaCrlContext PCCRL_CONTEXT
  43627 	FpCrlEntry        PCRL_ENTRY
  43628 	FfDeltaCrlEntry   WINBOOL
  43629 	F__ccgo_pad2      [4]byte
  43630 }
  43631 
  43632 type CERT_REVOCATION_CRL_INFO = _CERT_REVOCATION_CRL_INFO
  43633 type PCERT_REVOCATION_CRL_INFO = uintptr
  43634 
  43635 type _CERT_REVOCATION_CHAIN_PARA = struct {
  43636 	FcbSize                     DWORD
  43637 	F__ccgo_pad1                [4]byte
  43638 	FhChainEngine               HCERTCHAINENGINE
  43639 	FhAdditionalStore           HCERTSTORE
  43640 	FdwChainFlags               DWORD
  43641 	FdwUrlRetrievalTimeout      DWORD
  43642 	FpftCurrentTime             LPFILETIME
  43643 	FpftCacheResync             LPFILETIME
  43644 	FcbMaxUrlRetrievalByteCount DWORD
  43645 	F__ccgo_pad2                [4]byte
  43646 }
  43647 
  43648 type CERT_REVOCATION_CHAIN_PARA = _CERT_REVOCATION_CHAIN_PARA
  43649 type PCERT_REVOCATION_CHAIN_PARA = uintptr
  43650 
  43651 type _CERT_REVOCATION_PARA = struct {
  43652 	FcbSize       DWORD
  43653 	F__ccgo_pad1  [4]byte
  43654 	FpIssuerCert  PCCERT_CONTEXT
  43655 	FcCertStore   DWORD
  43656 	F__ccgo_pad2  [4]byte
  43657 	FrgCertStore  uintptr
  43658 	FhCrlStore    HCERTSTORE
  43659 	FpftTimeToUse LPFILETIME
  43660 }
  43661 
  43662 type CERT_REVOCATION_PARA = _CERT_REVOCATION_PARA
  43663 type PCERT_REVOCATION_PARA = uintptr
  43664 
  43665 type _CERT_REVOCATION_STATUS = struct {
  43666 	FcbSize            DWORD
  43667 	FdwIndex           DWORD
  43668 	FdwError           DWORD
  43669 	FdwReason          DWORD
  43670 	FfHasFreshnessTime WINBOOL
  43671 	FdwFreshnessTime   DWORD
  43672 }
  43673 
  43674 type CERT_REVOCATION_STATUS = _CERT_REVOCATION_STATUS
  43675 type PCERT_REVOCATION_STATUS = uintptr
  43676 
  43677 type _CRYPT_VERIFY_CERT_SIGN_STRONG_PROPERTIES_INFO = struct {
  43678 	FCertSignHashCNGAlgPropData        CRYPT_DATA_BLOB
  43679 	FCertIssuerPubKeyBitLengthPropData CRYPT_DATA_BLOB
  43680 }
  43681 
  43682 type CRYPT_VERIFY_CERT_SIGN_STRONG_PROPERTIES_INFO = _CRYPT_VERIFY_CERT_SIGN_STRONG_PROPERTIES_INFO
  43683 type PCRYPT_VERIFY_CERT_SIGN_STRONG_PROPERTIES_INFO = uintptr
  43684 
  43685 type PFN_CRYPT_EXTRACT_ENCODED_SIGNATURE_PARAMETERS_FUNC = uintptr
  43686 type PFN_CRYPT_SIGN_AND_ENCODE_HASH_FUNC = uintptr
  43687 type PFN_CRYPT_VERIFY_ENCODED_SIGNATURE_FUNC = uintptr
  43688 
  43689 type HCRYPTDEFAULTCONTEXT = uintptr
  43690 
  43691 type _CRYPT_DEFAULT_CONTEXT_MULTI_OID_PARA = struct {
  43692 	FcOID        DWORD
  43693 	F__ccgo_pad1 [4]byte
  43694 	FrgpszOID    uintptr
  43695 }
  43696 
  43697 type CRYPT_DEFAULT_CONTEXT_MULTI_OID_PARA = _CRYPT_DEFAULT_CONTEXT_MULTI_OID_PARA
  43698 type PCRYPT_DEFAULT_CONTEXT_MULTI_OID_PARA = uintptr
  43699 
  43700 type PFN_CRYPT_EXPORT_PUBLIC_KEY_INFO_EX2_FUNC = uintptr
  43701 
  43702 type PFN_IMPORT_PRIV_KEY_FUNC = uintptr
  43703 type PFN_EXPORT_PRIV_KEY_FUNC = uintptr
  43704 
  43705 type PFN_CRYPT_GET_SIGNER_CERTIFICATE = uintptr
  43706 
  43707 type _CRYPT_SIGN_MESSAGE_PARA = struct {
  43708 	FcbSize             DWORD
  43709 	FdwMsgEncodingType  DWORD
  43710 	FpSigningCert       PCCERT_CONTEXT
  43711 	FHashAlgorithm      CRYPT_ALGORITHM_IDENTIFIER
  43712 	FpvHashAuxInfo      uintptr
  43713 	FcMsgCert           DWORD
  43714 	F__ccgo_pad1        [4]byte
  43715 	FrgpMsgCert         uintptr
  43716 	FcMsgCrl            DWORD
  43717 	F__ccgo_pad2        [4]byte
  43718 	FrgpMsgCrl          uintptr
  43719 	FcAuthAttr          DWORD
  43720 	F__ccgo_pad3        [4]byte
  43721 	FrgAuthAttr         PCRYPT_ATTRIBUTE
  43722 	FcUnauthAttr        DWORD
  43723 	F__ccgo_pad4        [4]byte
  43724 	FrgUnauthAttr       PCRYPT_ATTRIBUTE
  43725 	FdwFlags            DWORD
  43726 	FdwInnerContentType DWORD
  43727 }
  43728 
  43729 type CRYPT_SIGN_MESSAGE_PARA = _CRYPT_SIGN_MESSAGE_PARA
  43730 type PCRYPT_SIGN_MESSAGE_PARA = uintptr
  43731 
  43732 type _CRYPT_VERIFY_MESSAGE_PARA = struct {
  43733 	FcbSize                   DWORD
  43734 	FdwMsgAndCertEncodingType DWORD
  43735 	FhCryptProv               HCRYPTPROV_LEGACY
  43736 	FpfnGetSignerCertificate  PFN_CRYPT_GET_SIGNER_CERTIFICATE
  43737 	FpvGetArg                 uintptr
  43738 }
  43739 
  43740 type CRYPT_VERIFY_MESSAGE_PARA = _CRYPT_VERIFY_MESSAGE_PARA
  43741 type PCRYPT_VERIFY_MESSAGE_PARA = uintptr
  43742 
  43743 type _CRYPT_ENCRYPT_MESSAGE_PARA = struct {
  43744 	FcbSize                     DWORD
  43745 	FdwMsgEncodingType          DWORD
  43746 	FhCryptProv                 HCRYPTPROV_LEGACY
  43747 	FContentEncryptionAlgorithm CRYPT_ALGORITHM_IDENTIFIER
  43748 	FpvEncryptionAuxInfo        uintptr
  43749 	FdwFlags                    DWORD
  43750 	FdwInnerContentType         DWORD
  43751 }
  43752 
  43753 type CRYPT_ENCRYPT_MESSAGE_PARA = _CRYPT_ENCRYPT_MESSAGE_PARA
  43754 type PCRYPT_ENCRYPT_MESSAGE_PARA = uintptr
  43755 
  43756 type _CRYPT_DECRYPT_MESSAGE_PARA = struct {
  43757 	FcbSize                   DWORD
  43758 	FdwMsgAndCertEncodingType DWORD
  43759 	FcCertStore               DWORD
  43760 	F__ccgo_pad1              [4]byte
  43761 	FrghCertStore             uintptr
  43762 }
  43763 
  43764 type CRYPT_DECRYPT_MESSAGE_PARA = _CRYPT_DECRYPT_MESSAGE_PARA
  43765 type PCRYPT_DECRYPT_MESSAGE_PARA = uintptr
  43766 
  43767 type _CRYPT_HASH_MESSAGE_PARA = struct {
  43768 	FcbSize            DWORD
  43769 	FdwMsgEncodingType DWORD
  43770 	FhCryptProv        HCRYPTPROV_LEGACY
  43771 	FHashAlgorithm     CRYPT_ALGORITHM_IDENTIFIER
  43772 	FpvHashAuxInfo     uintptr
  43773 }
  43774 
  43775 type CRYPT_HASH_MESSAGE_PARA = _CRYPT_HASH_MESSAGE_PARA
  43776 type PCRYPT_HASH_MESSAGE_PARA = uintptr
  43777 
  43778 type _CRYPT_KEY_SIGN_MESSAGE_PARA = struct {
  43779 	FcbSize                   DWORD
  43780 	FdwMsgAndCertEncodingType DWORD
  43781 	F__8                      struct{ FhCryptProv HCRYPTPROV }
  43782 	FdwKeySpec                DWORD
  43783 	F__ccgo_pad1              [4]byte
  43784 	FHashAlgorithm            CRYPT_ALGORITHM_IDENTIFIER
  43785 	FpvHashAuxInfo            uintptr
  43786 	FPubKeyAlgorithm          CRYPT_ALGORITHM_IDENTIFIER
  43787 }
  43788 
  43789 type CRYPT_KEY_SIGN_MESSAGE_PARA = _CRYPT_KEY_SIGN_MESSAGE_PARA
  43790 type PCRYPT_KEY_SIGN_MESSAGE_PARA = uintptr
  43791 
  43792 type _CRYPT_KEY_VERIFY_MESSAGE_PARA = struct {
  43793 	FcbSize            DWORD
  43794 	FdwMsgEncodingType DWORD
  43795 	FhCryptProv        HCRYPTPROV_LEGACY
  43796 }
  43797 
  43798 type CRYPT_KEY_VERIFY_MESSAGE_PARA = _CRYPT_KEY_VERIFY_MESSAGE_PARA
  43799 type PCRYPT_KEY_VERIFY_MESSAGE_PARA = uintptr
  43800 
  43801 type _CERT_CHAIN = struct {
  43802 	FcCerts         DWORD
  43803 	F__ccgo_pad1    [4]byte
  43804 	Fcerts          PCERT_BLOB
  43805 	FkeyLocatorInfo CRYPT_KEY_PROV_INFO
  43806 }
  43807 
  43808 type CERT_CHAIN = _CERT_CHAIN
  43809 type PCERT_CHAIN = uintptr
  43810 
  43811 type HCRYPTASYNC = HANDLE
  43812 type PHCRYPTASYNC = uintptr
  43813 type PFN_CRYPT_ASYNC_PARAM_FREE_FUNC = uintptr
  43814 
  43815 type _CRYPT_BLOB_ARRAY = struct {
  43816 	FcBlob       DWORD
  43817 	F__ccgo_pad1 [4]byte
  43818 	FrgBlob      PCRYPT_DATA_BLOB
  43819 }
  43820 
  43821 type CRYPT_BLOB_ARRAY = _CRYPT_BLOB_ARRAY
  43822 type PCRYPT_BLOB_ARRAY = uintptr
  43823 
  43824 type _CRYPT_CREDENTIALS = struct {
  43825 	FcbSize            DWORD
  43826 	F__ccgo_pad1       [4]byte
  43827 	FpszCredentialsOid LPCSTR
  43828 	FpvCredentials     LPVOID
  43829 }
  43830 
  43831 type CRYPT_CREDENTIALS = _CRYPT_CREDENTIALS
  43832 type PCRYPT_CREDENTIALS = uintptr
  43833 
  43834 type _CRYPT_PASSWORD_CREDENTIALSA = struct {
  43835 	FcbSize      DWORD
  43836 	F__ccgo_pad1 [4]byte
  43837 	FpszUsername LPSTR
  43838 	FpszPassword LPSTR
  43839 }
  43840 
  43841 type CRYPT_PASSWORD_CREDENTIALSA = _CRYPT_PASSWORD_CREDENTIALSA
  43842 type PCRYPT_PASSWORD_CREDENTIALSA = uintptr
  43843 
  43844 type _CRYPT_PASSWORD_CREDENTIALSW = struct {
  43845 	FcbSize      DWORD
  43846 	F__ccgo_pad1 [4]byte
  43847 	FpszUsername LPWSTR
  43848 	FpszPassword LPWSTR
  43849 }
  43850 
  43851 type CRYPT_PASSWORD_CREDENTIALSW = _CRYPT_PASSWORD_CREDENTIALSW
  43852 type PCRYPT_PASSWORD_CREDENTIALSW = uintptr
  43853 
  43854 type CRYPT_PASSWORD_CREDENTIALS = CRYPT_PASSWORD_CREDENTIALSA
  43855 type PCRYPT_PASSWORD_CREDENTIALS = PCRYPT_PASSWORD_CREDENTIALSA
  43856 
  43857 type PFN_FREE_ENCODED_OBJECT_FUNC = uintptr
  43858 
  43859 type _CRYPTNET_URL_CACHE_PRE_FETCH_INFO = struct {
  43860 	FcbSize         DWORD
  43861 	FdwObjectType   DWORD
  43862 	FdwError        DWORD
  43863 	FdwReserved     DWORD
  43864 	FThisUpdateTime FILETIME
  43865 	FNextUpdateTime FILETIME
  43866 	FPublishTime    FILETIME
  43867 }
  43868 
  43869 type CRYPTNET_URL_CACHE_PRE_FETCH_INFO = _CRYPTNET_URL_CACHE_PRE_FETCH_INFO
  43870 type PCRYPTNET_URL_CACHE_PRE_FETCH_INFO = uintptr
  43871 
  43872 type _CRYPTNET_URL_CACHE_FLUSH_INFO = struct {
  43873 	FcbSize          DWORD
  43874 	FdwExemptSeconds DWORD
  43875 	FExpireTime      FILETIME
  43876 }
  43877 
  43878 type CRYPTNET_URL_CACHE_FLUSH_INFO = _CRYPTNET_URL_CACHE_FLUSH_INFO
  43879 type PCRYPTNET_URL_CACHE_FLUSH_INFO = uintptr
  43880 
  43881 type _CRYPTNET_URL_CACHE_RESPONSE_INFO = struct {
  43882 	FcbSize           DWORD
  43883 	FwResponseType    WORD
  43884 	FwResponseFlags   WORD
  43885 	FLastModifiedTime FILETIME
  43886 	FdwMaxAge         DWORD
  43887 	F__ccgo_pad1      [4]byte
  43888 	FpwszETag         LPCWSTR
  43889 	FdwProxyId        DWORD
  43890 	F__ccgo_pad2      [4]byte
  43891 }
  43892 
  43893 type CRYPTNET_URL_CACHE_RESPONSE_INFO = _CRYPTNET_URL_CACHE_RESPONSE_INFO
  43894 type PCRYPTNET_URL_CACHE_RESPONSE_INFO = uintptr
  43895 
  43896 type _CRYPT_RETRIEVE_AUX_INFO = struct {
  43897 	FcbSize                     DWORD
  43898 	F__ccgo_pad1                [4]byte
  43899 	FpLastSyncTime              uintptr
  43900 	FdwMaxUrlRetrievalByteCount DWORD
  43901 	F__ccgo_pad2                [4]byte
  43902 	FpPreFetchInfo              PCRYPTNET_URL_CACHE_PRE_FETCH_INFO
  43903 	FpFlushInfo                 PCRYPTNET_URL_CACHE_FLUSH_INFO
  43904 	FppResponseInfo             uintptr
  43905 	FpwszCacheFileNamePrefix    LPWSTR
  43906 	FpftCacheResync             LPFILETIME
  43907 	FfProxyCacheRetrieval       WINBOOL
  43908 	FdwHttpStatusCode           DWORD
  43909 }
  43910 
  43911 type CRYPT_RETRIEVE_AUX_INFO = _CRYPT_RETRIEVE_AUX_INFO
  43912 type PCRYPT_RETRIEVE_AUX_INFO = uintptr
  43913 
  43914 type PFN_CRYPT_CANCEL_RETRIEVAL = uintptr
  43915 
  43916 type PFN_CRYPT_ASYNC_RETRIEVAL_COMPLETION_FUNC = uintptr
  43917 
  43918 type _CRYPT_ASYNC_RETRIEVAL_COMPLETION = struct {
  43919 	FpfnCompletion PFN_CRYPT_ASYNC_RETRIEVAL_COMPLETION_FUNC
  43920 	FpvCompletion  LPVOID
  43921 }
  43922 
  43923 type CRYPT_ASYNC_RETRIEVAL_COMPLETION = _CRYPT_ASYNC_RETRIEVAL_COMPLETION
  43924 type PCRYPT_ASYNC_RETRIEVAL_COMPLETION = uintptr
  43925 
  43926 type PFN_CANCEL_ASYNC_RETRIEVAL_FUNC = uintptr
  43927 
  43928 type _CRYPT_URL_ARRAY = struct {
  43929 	FcUrl        DWORD
  43930 	F__ccgo_pad1 [4]byte
  43931 	FrgwszUrl    uintptr
  43932 }
  43933 
  43934 type CRYPT_URL_ARRAY = _CRYPT_URL_ARRAY
  43935 type PCRYPT_URL_ARRAY = uintptr
  43936 
  43937 type _CRYPT_URL_INFO = struct {
  43938 	FcbSize          DWORD
  43939 	FdwSyncDeltaTime DWORD
  43940 	FcGroup          DWORD
  43941 	F__ccgo_pad1     [4]byte
  43942 	FrgcGroupEntry   uintptr
  43943 }
  43944 
  43945 type CRYPT_URL_INFO = _CRYPT_URL_INFO
  43946 type PCRYPT_URL_INFO = uintptr
  43947 
  43948 type _CERT_CRL_CONTEXT_PAIR = struct {
  43949 	FpCertContext PCCERT_CONTEXT
  43950 	FpCrlContext  PCCRL_CONTEXT
  43951 }
  43952 
  43953 type CERT_CRL_CONTEXT_PAIR = _CERT_CRL_CONTEXT_PAIR
  43954 type PCERT_CRL_CONTEXT_PAIR = uintptr
  43955 
  43956 type PCCERT_CRL_CONTEXT_PAIR = uintptr
  43957 
  43958 type _CRYPT_GET_TIME_VALID_OBJECT_EXTRA_INFO = struct {
  43959 	FcbSize             DWORD
  43960 	FiDeltaCrlIndicator int32
  43961 	FpftCacheResync     LPFILETIME
  43962 	FpLastSyncTime      LPFILETIME
  43963 	FpMaxAgeTime        LPFILETIME
  43964 	FpChainPara         PCERT_REVOCATION_CHAIN_PARA
  43965 	FpDeltaCrlIndicator PCRYPT_INTEGER_BLOB
  43966 }
  43967 
  43968 type CRYPT_GET_TIME_VALID_OBJECT_EXTRA_INFO = _CRYPT_GET_TIME_VALID_OBJECT_EXTRA_INFO
  43969 type PCRYPT_GET_TIME_VALID_OBJECT_EXTRA_INFO = uintptr
  43970 
  43971 type PFN_CRYPT_ENUM_KEYID_PROP = uintptr
  43972 
  43973 type HCERTCHAINENGINE = HANDLE
  43974 
  43975 type _CERT_CHAIN_ENGINE_CONFIG = struct {
  43976 	FcbSize                    DWORD
  43977 	F__ccgo_pad1               [4]byte
  43978 	FhRestrictedRoot           HCERTSTORE
  43979 	FhRestrictedTrust          HCERTSTORE
  43980 	FhRestrictedOther          HCERTSTORE
  43981 	FcAdditionalStore          DWORD
  43982 	F__ccgo_pad2               [4]byte
  43983 	FrghAdditionalStore        uintptr
  43984 	FdwFlags                   DWORD
  43985 	FdwUrlRetrievalTimeout     DWORD
  43986 	FMaximumCachedCertificates DWORD
  43987 	FCycleDetectionModulus     DWORD
  43988 }
  43989 
  43990 type CERT_CHAIN_ENGINE_CONFIG = _CERT_CHAIN_ENGINE_CONFIG
  43991 type PCERT_CHAIN_ENGINE_CONFIG = uintptr
  43992 
  43993 type _CERT_TRUST_STATUS = struct {
  43994 	FdwErrorStatus DWORD
  43995 	FdwInfoStatus  DWORD
  43996 }
  43997 
  43998 type CERT_TRUST_STATUS = _CERT_TRUST_STATUS
  43999 type PCERT_TRUST_STATUS = uintptr
  44000 
  44001 type _CERT_REVOCATION_INFO = struct {
  44002 	FcbSize             DWORD
  44003 	FdwRevocationResult DWORD
  44004 	FpszRevocationOid   LPCSTR
  44005 	FpvOidSpecificInfo  LPVOID
  44006 	FfHasFreshnessTime  WINBOOL
  44007 	FdwFreshnessTime    DWORD
  44008 	FpCrlInfo           PCERT_REVOCATION_CRL_INFO
  44009 }
  44010 
  44011 type CERT_REVOCATION_INFO = _CERT_REVOCATION_INFO
  44012 type PCERT_REVOCATION_INFO = uintptr
  44013 
  44014 type _CERT_TRUST_LIST_INFO = struct {
  44015 	FcbSize      DWORD
  44016 	F__ccgo_pad1 [4]byte
  44017 	FpCtlEntry   PCTL_ENTRY
  44018 	FpCtlContext PCCTL_CONTEXT
  44019 }
  44020 
  44021 type CERT_TRUST_LIST_INFO = _CERT_TRUST_LIST_INFO
  44022 type PCERT_TRUST_LIST_INFO = uintptr
  44023 
  44024 type _CERT_CHAIN_ELEMENT = struct {
  44025 	FcbSize                DWORD
  44026 	F__ccgo_pad1           [4]byte
  44027 	FpCertContext          PCCERT_CONTEXT
  44028 	FTrustStatus           CERT_TRUST_STATUS
  44029 	FpRevocationInfo       PCERT_REVOCATION_INFO
  44030 	FpIssuanceUsage        PCERT_ENHKEY_USAGE
  44031 	FpApplicationUsage     PCERT_ENHKEY_USAGE
  44032 	FpwszExtendedErrorInfo LPCWSTR
  44033 }
  44034 
  44035 type CERT_CHAIN_ELEMENT = _CERT_CHAIN_ELEMENT
  44036 type PCERT_CHAIN_ELEMENT = uintptr
  44037 
  44038 type PCCERT_CHAIN_ELEMENT = uintptr
  44039 
  44040 type _CERT_SIMPLE_CHAIN = struct {
  44041 	FcbSize                      DWORD
  44042 	FTrustStatus                 CERT_TRUST_STATUS
  44043 	FcElement                    DWORD
  44044 	FrgpElement                  uintptr
  44045 	FpTrustListInfo              PCERT_TRUST_LIST_INFO
  44046 	FfHasRevocationFreshnessTime WINBOOL
  44047 	FdwRevocationFreshnessTime   DWORD
  44048 }
  44049 
  44050 type CERT_SIMPLE_CHAIN = _CERT_SIMPLE_CHAIN
  44051 type PCERT_SIMPLE_CHAIN = uintptr
  44052 
  44053 type PCCERT_SIMPLE_CHAIN = uintptr
  44054 
  44055 type _CERT_CHAIN_CONTEXT = struct {
  44056 	FcbSize                      DWORD
  44057 	FTrustStatus                 CERT_TRUST_STATUS
  44058 	FcChain                      DWORD
  44059 	FrgpChain                    uintptr
  44060 	FcLowerQualityChainContext   DWORD
  44061 	F__ccgo_pad1                 [4]byte
  44062 	FrgpLowerQualityChainContext uintptr
  44063 	FfHasRevocationFreshnessTime WINBOOL
  44064 	FdwRevocationFreshnessTime   DWORD
  44065 	FdwCreateFlags               DWORD
  44066 	FChainId                     GUID
  44067 	F__ccgo_pad2                 [4]byte
  44068 }
  44069 
  44070 type CERT_CHAIN_CONTEXT = _CERT_CHAIN_CONTEXT
  44071 type PCERT_CHAIN_CONTEXT = uintptr
  44072 type PCCERT_CHAIN_CONTEXT = uintptr
  44073 
  44074 type _CERT_USAGE_MATCH = struct {
  44075 	FdwType      DWORD
  44076 	F__ccgo_pad1 [4]byte
  44077 	FUsage       CERT_ENHKEY_USAGE
  44078 }
  44079 
  44080 type CERT_USAGE_MATCH = _CERT_USAGE_MATCH
  44081 type PCERT_USAGE_MATCH = uintptr
  44082 
  44083 type _CTL_USAGE_MATCH = struct {
  44084 	FdwType      DWORD
  44085 	F__ccgo_pad1 [4]byte
  44086 	FUsage       CTL_USAGE
  44087 }
  44088 
  44089 type CTL_USAGE_MATCH = _CTL_USAGE_MATCH
  44090 type PCTL_USAGE_MATCH = uintptr
  44091 
  44092 type _CERT_CHAIN_PARA = struct {
  44093 	FcbSize         DWORD
  44094 	F__ccgo_pad1    [4]byte
  44095 	FRequestedUsage CERT_USAGE_MATCH
  44096 }
  44097 
  44098 type CERT_CHAIN_PARA = _CERT_CHAIN_PARA
  44099 type PCERT_CHAIN_PARA = uintptr
  44100 
  44101 type _CRL_REVOCATION_INFO = struct {
  44102 	FpCrlEntry       PCRL_ENTRY
  44103 	FpCrlContext     PCCRL_CONTEXT
  44104 	FpCrlIssuerChain PCCERT_CHAIN_CONTEXT
  44105 }
  44106 
  44107 type CRL_REVOCATION_INFO = _CRL_REVOCATION_INFO
  44108 type PCRL_REVOCATION_INFO = uintptr
  44109 
  44110 type PFN_CERT_CHAIN_FIND_BY_ISSUER_CALLBACK = uintptr
  44111 
  44112 type _CERT_CHAIN_FIND_BY_ISSUER_PARA = struct {
  44113 	FcbSize                   DWORD
  44114 	F__ccgo_pad1              [4]byte
  44115 	FpszUsageIdentifier       LPCSTR
  44116 	FdwKeySpec                DWORD
  44117 	FdwAcquirePrivateKeyFlags DWORD
  44118 	FcIssuer                  DWORD
  44119 	F__ccgo_pad2              [4]byte
  44120 	FrgIssuer                 uintptr
  44121 	FpfnFindCallback          PFN_CERT_CHAIN_FIND_BY_ISSUER_CALLBACK
  44122 	FpvFindArg                uintptr
  44123 }
  44124 
  44125 type CERT_CHAIN_FIND_ISSUER_PARA = _CERT_CHAIN_FIND_BY_ISSUER_PARA
  44126 type PCERT_CHAIN_FIND_ISSUER_PARA = uintptr
  44127 type CERT_CHAIN_FIND_BY_ISSUER_PARA = _CERT_CHAIN_FIND_BY_ISSUER_PARA
  44128 type PCERT_CHAIN_FIND_BY_ISSUER_PARA = uintptr
  44129 
  44130 type _CERT_CHAIN_POLICY_PARA = struct {
  44131 	FcbSize            DWORD
  44132 	FdwFlags           DWORD
  44133 	FpvExtraPolicyPara uintptr
  44134 }
  44135 
  44136 type CERT_CHAIN_POLICY_PARA = _CERT_CHAIN_POLICY_PARA
  44137 type PCERT_CHAIN_POLICY_PARA = uintptr
  44138 
  44139 type _CERT_CHAIN_POLICY_STATUS = struct {
  44140 	FcbSize              DWORD
  44141 	FdwError             DWORD
  44142 	FlChainIndex         LONG
  44143 	FlElementIndex       LONG
  44144 	FpvExtraPolicyStatus uintptr
  44145 }
  44146 
  44147 type CERT_CHAIN_POLICY_STATUS = _CERT_CHAIN_POLICY_STATUS
  44148 type PCERT_CHAIN_POLICY_STATUS = uintptr
  44149 
  44150 type _AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_PARA = struct {
  44151 	FcbSize              DWORD
  44152 	FdwRegPolicySettings DWORD
  44153 	FpSignerInfo         PCMSG_SIGNER_INFO
  44154 }
  44155 
  44156 type AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_PARA = _AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_PARA
  44157 type PAUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_PARA = uintptr
  44158 
  44159 type _AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_STATUS = struct {
  44160 	FcbSize      DWORD
  44161 	FfCommercial WINBOOL
  44162 }
  44163 
  44164 type AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_STATUS = _AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_STATUS
  44165 type PAUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_STATUS = uintptr
  44166 
  44167 type _AUTHENTICODE_TS_EXTRA_CERT_CHAIN_POLICY_PARA = struct {
  44168 	FcbSize              DWORD
  44169 	FdwRegPolicySettings DWORD
  44170 	FfCommercial         WINBOOL
  44171 }
  44172 
  44173 type AUTHENTICODE_TS_EXTRA_CERT_CHAIN_POLICY_PARA = _AUTHENTICODE_TS_EXTRA_CERT_CHAIN_POLICY_PARA
  44174 type PAUTHENTICODE_TS_EXTRA_CERT_CHAIN_POLICY_PARA = uintptr
  44175 
  44176 type _HTTPSPolicyCallbackData = struct {
  44177 	F__0            struct{ FcbStruct DWORD }
  44178 	FdwAuthType     DWORD
  44179 	FfdwChecks      DWORD
  44180 	F__ccgo_pad1    [4]byte
  44181 	FpwszServerName uintptr
  44182 }
  44183 
  44184 type HTTPSPolicyCallbackData = _HTTPSPolicyCallbackData
  44185 type PHTTPSPolicyCallbackData = uintptr
  44186 type SSL_EXTRA_CERT_CHAIN_POLICY_PARA = _HTTPSPolicyCallbackData
  44187 type PSSL_EXTRA_CERT_CHAIN_POLICY_PARA = uintptr
  44188 
  44189 type _EV_EXTRA_CERT_CHAIN_POLICY_PARA = struct {
  44190 	FcbSize                      DWORD
  44191 	FdwRootProgramQualifierFlags DWORD
  44192 }
  44193 
  44194 type EV_EXTRA_CERT_CHAIN_POLICY_PARA = _EV_EXTRA_CERT_CHAIN_POLICY_PARA
  44195 type PEV_EXTRA_CERT_CHAIN_POLICY_PARA = uintptr
  44196 
  44197 type _EV_EXTRA_CERT_CHAIN_POLICY_STATUS = struct {
  44198 	FcbSize               DWORD
  44199 	FdwQualifiers         DWORD
  44200 	FdwIssuanceUsageIndex DWORD
  44201 }
  44202 
  44203 type EV_EXTRA_CERT_CHAIN_POLICY_STATUS = _EV_EXTRA_CERT_CHAIN_POLICY_STATUS
  44204 type PEV_EXTRA_CERT_CHAIN_POLICY_STATUS = uintptr
  44205 
  44206 type _SSL_F12_EXTRA_CERT_CHAIN_POLICY_STATUS = struct {
  44207 	FcbSize          DWORD
  44208 	FdwErrorLevel    DWORD
  44209 	FdwErrorCategory DWORD
  44210 	FdwReserved      DWORD
  44211 	FwszErrorText    [256]WCHAR
  44212 }
  44213 
  44214 type SSL_F12_EXTRA_CERT_CHAIN_POLICY_STATUS = _SSL_F12_EXTRA_CERT_CHAIN_POLICY_STATUS
  44215 type PSSL_F12_EXTRA_CERT_CHAIN_POLICY_STATUS = uintptr
  44216 
  44217 type _SSL_HPKP_HEADER_EXTRA_CERT_CHAIN_POLICY_PARA = struct {
  44218 	FcbSize         DWORD
  44219 	FdwReserved     DWORD
  44220 	FpwszServerName LPWSTR
  44221 	FrgpszHpkpValue [2]LPSTR
  44222 }
  44223 
  44224 type SSL_HPKP_HEADER_EXTRA_CERT_CHAIN_POLICY_PARA = _SSL_HPKP_HEADER_EXTRA_CERT_CHAIN_POLICY_PARA
  44225 type PSSL_HPKP_HEADER_EXTRA_CERT_CHAIN_POLICY_PARA = uintptr
  44226 
  44227 type _SSL_KEY_PIN_EXTRA_CERT_CHAIN_POLICY_PARA = struct {
  44228 	FcbSize         DWORD
  44229 	FdwReserved     DWORD
  44230 	FpwszServerName PCWSTR
  44231 }
  44232 
  44233 type SSL_KEY_PIN_EXTRA_CERT_CHAIN_POLICY_PARA = _SSL_KEY_PIN_EXTRA_CERT_CHAIN_POLICY_PARA
  44234 type PSSL_KEY_PIN_EXTRA_CERT_CHAIN_POLICY_PARA = uintptr
  44235 
  44236 type _SSL_KEY_PIN_EXTRA_CERT_CHAIN_POLICY_STATUS = struct {
  44237 	FcbSize       DWORD
  44238 	FlError       LONG
  44239 	FwszErrorText [512]WCHAR
  44240 }
  44241 
  44242 type SSL_KEY_PIN_EXTRA_CERT_CHAIN_POLICY_STATUS = _SSL_KEY_PIN_EXTRA_CERT_CHAIN_POLICY_STATUS
  44243 type PSSL_KEY_PIN_EXTRA_CERT_CHAIN_POLICY_STATUS = uintptr
  44244 
  44245 type _CRYPT_PKCS12_PBE_PARAMS = struct {
  44246 	FiIterations int32
  44247 	FcbSalt      ULONG
  44248 }
  44249 
  44250 type CRYPT_PKCS12_PBE_PARAMS = _CRYPT_PKCS12_PBE_PARAMS
  44251 
  44252 type _PKCS12_PBES2_EXPORT_PARAMS = struct {
  44253 	FdwSize            DWORD
  44254 	F__ccgo_pad1       [4]byte
  44255 	FhNcryptDescriptor PVOID
  44256 	FpwszPbes2Alg      LPWSTR
  44257 }
  44258 
  44259 type PKCS12_PBES2_EXPORT_PARAMS = _PKCS12_PBES2_EXPORT_PARAMS
  44260 type PPKCS12_PBES2_EXPORT_PARAMS = uintptr
  44261 
  44262 type _CRYPTPROTECT_PROMPTSTRUCT = struct {
  44263 	FcbSize        DWORD
  44264 	FdwPromptFlags DWORD
  44265 	FhwndApp       HWND
  44266 	FszPrompt      LPCWSTR
  44267 }
  44268 
  44269 type CRYPTPROTECT_PROMPTSTRUCT = _CRYPTPROTECT_PROMPTSTRUCT
  44270 type PCRYPTPROTECT_PROMPTSTRUCT = uintptr
  44271 
  44272 type _CERTIFICATE_BLOB = struct {
  44273 	FdwCertEncodingType DWORD
  44274 	FcbData             DWORD
  44275 	FpbData             PBYTE
  44276 }
  44277 
  44278 type EFS_CERTIFICATE_BLOB = _CERTIFICATE_BLOB
  44279 type PEFS_CERTIFICATE_BLOB = uintptr
  44280 
  44281 type _EFS_HASH_BLOB = struct {
  44282 	FcbData      DWORD
  44283 	F__ccgo_pad1 [4]byte
  44284 	FpbData      PBYTE
  44285 }
  44286 
  44287 type EFS_HASH_BLOB = _EFS_HASH_BLOB
  44288 type PEFS_HASH_BLOB = uintptr
  44289 
  44290 type _EFS_RPC_BLOB = struct {
  44291 	FcbData      DWORD
  44292 	F__ccgo_pad1 [4]byte
  44293 	FpbData      PBYTE
  44294 }
  44295 
  44296 type EFS_RPC_BLOB = _EFS_RPC_BLOB
  44297 type PEFS_RPC_BLOB = uintptr
  44298 
  44299 type _EFS_KEY_INFO = struct {
  44300 	FdwVersion DWORD
  44301 	FEntropy   ULONG
  44302 	FAlgorithm ALG_ID
  44303 	FKeyLength ULONG
  44304 }
  44305 
  44306 type EFS_KEY_INFO = _EFS_KEY_INFO
  44307 type PEFS_KEY_INFO = uintptr
  44308 
  44309 type _ENCRYPTION_CERTIFICATE = struct {
  44310 	FcbTotalLength DWORD
  44311 	F__ccgo_pad1   [4]byte
  44312 	FpUserSid      uintptr
  44313 	FpCertBlob     PEFS_CERTIFICATE_BLOB
  44314 }
  44315 
  44316 type ENCRYPTION_CERTIFICATE = _ENCRYPTION_CERTIFICATE
  44317 type PENCRYPTION_CERTIFICATE = uintptr
  44318 
  44319 type _ENCRYPTION_CERTIFICATE_HASH = struct {
  44320 	FcbTotalLength        DWORD
  44321 	F__ccgo_pad1          [4]byte
  44322 	FpUserSid             uintptr
  44323 	FpHash                PEFS_HASH_BLOB
  44324 	FlpDisplayInformation LPWSTR
  44325 }
  44326 
  44327 type ENCRYPTION_CERTIFICATE_HASH = _ENCRYPTION_CERTIFICATE_HASH
  44328 type PENCRYPTION_CERTIFICATE_HASH = uintptr
  44329 
  44330 type _ENCRYPTION_CERTIFICATE_HASH_LIST = struct {
  44331 	FnCert_Hash  DWORD
  44332 	F__ccgo_pad1 [4]byte
  44333 	FpUsers      uintptr
  44334 }
  44335 
  44336 type ENCRYPTION_CERTIFICATE_HASH_LIST = _ENCRYPTION_CERTIFICATE_HASH_LIST
  44337 type PENCRYPTION_CERTIFICATE_HASH_LIST = uintptr
  44338 
  44339 type _ENCRYPTION_CERTIFICATE_LIST = struct {
  44340 	FnUsers      DWORD
  44341 	F__ccgo_pad1 [4]byte
  44342 	FpUsers      uintptr
  44343 }
  44344 
  44345 type ENCRYPTION_CERTIFICATE_LIST = _ENCRYPTION_CERTIFICATE_LIST
  44346 type PENCRYPTION_CERTIFICATE_LIST = uintptr
  44347 
  44348 type RPC_IMPORT_CONTEXT_P = struct {
  44349 	FLookupContext  RPC_NS_HANDLE
  44350 	FProposedHandle RPC_BINDING_HANDLE
  44351 	FBindings       uintptr
  44352 }
  44353 type PRPC_IMPORT_CONTEXT_P = uintptr
  44354 
  44355 type Byte = uint8
  44356 type Cs_byte = Byte
  44357 type Boolean = uint8
  44358 
  44359 type NDR_CCONTEXT = uintptr
  44360 
  44361 type _NDR_SCONTEXT = struct {
  44362 	Fpad         [2]uintptr
  44363 	FuserContext uintptr
  44364 }
  44365 
  44366 type NDR_SCONTEXT = uintptr
  44367 
  44368 type NDR_RUNDOWN = uintptr
  44369 type NDR_NOTIFY_ROUTINE = uintptr
  44370 type NDR_NOTIFY2_ROUTINE = uintptr
  44371 
  44372 type _SCONTEXT_QUEUE = struct {
  44373 	FNumberOfObjects uint32
  44374 	F__ccgo_pad1     [4]byte
  44375 	FArrayOfObjects  uintptr
  44376 }
  44377 
  44378 type SCONTEXT_QUEUE = _SCONTEXT_QUEUE
  44379 type PSCONTEXT_QUEUE = uintptr
  44380 
  44381 type Error_status_t = uint32
  44382 
  44383 type _MIDL_STUB_MESSAGE = struct {
  44384 	FRpcMsg                 PRPC_MESSAGE
  44385 	FBuffer                 uintptr
  44386 	FBufferStart            uintptr
  44387 	FBufferEnd              uintptr
  44388 	FBufferMark             uintptr
  44389 	FBufferLength           uint32
  44390 	FMemorySize             uint32
  44391 	FMemory                 uintptr
  44392 	FIsClient               uint8
  44393 	FPad                    uint8
  44394 	FuFlags2                uint16
  44395 	FReuseBuffer            int32
  44396 	FpAllocAllNodesContext  uintptr
  44397 	FpPointerQueueState     uintptr
  44398 	FIgnoreEmbeddedPointers int32
  44399 	F__ccgo_pad1            [4]byte
  44400 	FPointerBufferMark      uintptr
  44401 	FfBufferValid           uint8
  44402 	FuFlags                 uint8
  44403 	FUniquePtrCount         uint16
  44404 	F__ccgo_pad2            [4]byte
  44405 	FMaxCount               ULONG_PTR
  44406 	FOffset                 uint32
  44407 	FActualCount            uint32
  44408 	FpfnAllocate            uintptr
  44409 	FpfnFree                uintptr
  44410 	FStackTop               uintptr
  44411 	FpPresentedType         uintptr
  44412 	FpTransmitType          uintptr
  44413 	FSavedHandle            Handle_t
  44414 	FStubDesc               uintptr
  44415 	FFullPtrXlatTables      uintptr
  44416 	FFullPtrRefId           uint32
  44417 	FPointerLength          uint32
  44418 	FfInDontFree            uint32
  44419 	F__ccgo_pad3            [4]byte
  44420 	FdwDestContext          uint32
  44421 	F__ccgo_pad4            [4]byte
  44422 	FpvDestContext          uintptr
  44423 	FSavedContextHandles    uintptr
  44424 	FParamNumber            int32
  44425 	F__ccgo_pad5            [4]byte
  44426 	FpRpcChannelBuffer      uintptr
  44427 	FpArrayInfo             PARRAY_INFO
  44428 	FSizePtrCountArray      uintptr
  44429 	FSizePtrOffsetArray     uintptr
  44430 	FSizePtrLengthArray     uintptr
  44431 	FpArgQueue              uintptr
  44432 	FdwStubPhase            uint32
  44433 	F__ccgo_pad6            [4]byte
  44434 	FLowStackMark           uintptr
  44435 	FpAsyncMsg              PNDR_ASYNC_MESSAGE
  44436 	FpCorrInfo              PNDR_CORRELATION_INFO
  44437 	FpCorrMemory            uintptr
  44438 	FpMemoryList            uintptr
  44439 	FpCSInfo                uintptr
  44440 	FConformanceMark        uintptr
  44441 	FVarianceMark           uintptr
  44442 	FUnused                 INT_PTR
  44443 	FpContext               uintptr
  44444 	FpUserMarshalList       uintptr
  44445 	FReserved51_2           INT_PTR
  44446 	FReserved51_3           INT_PTR
  44447 	FReserved51_4           INT_PTR
  44448 	FReserved51_5           INT_PTR
  44449 }
  44450 
  44451 type _MIDL_STUB_DESC = struct {
  44452 	FRpcInterfaceInformation     uintptr
  44453 	FpfnAllocate                 uintptr
  44454 	FpfnFree                     uintptr
  44455 	FIMPLICIT_HANDLE_INFO        struct{ FpAutoHandle uintptr }
  44456 	FapfnNdrRundownRoutines      uintptr
  44457 	FaGenericBindingRoutinePairs uintptr
  44458 	FapfnExprEval                uintptr
  44459 	FaXmitQuintuple              uintptr
  44460 	FpFormatTypes                uintptr
  44461 	FfCheckBounds                int32
  44462 	FVersion                     uint32
  44463 	FpMallocFreeStruct           uintptr
  44464 	FMIDLVersion                 int32
  44465 	F__ccgo_pad1                 [4]byte
  44466 	FCommFaultOffsets            uintptr
  44467 	FaUserMarshalQuadruple       uintptr
  44468 	FNotifyRoutineTable          uintptr
  44469 	FmFlags                      ULONG_PTR
  44470 	FCsRoutineTables             uintptr
  44471 	FReserved4                   uintptr
  44472 	FReserved5                   ULONG_PTR
  44473 }
  44474 
  44475 type _FULL_PTR_XLAT_TABLES = struct {
  44476 	FRefIdToPointer struct {
  44477 		FXlatTable       uintptr
  44478 		FStateTable      uintptr
  44479 		FNumberOfEntries uint32
  44480 		F__ccgo_pad1     [4]byte
  44481 	}
  44482 	FPointerToRefId struct {
  44483 		FXlatTable       uintptr
  44484 		FNumberOfBuckets uint32
  44485 		FHashMask        uint32
  44486 	}
  44487 	FNextRefId uint32
  44488 	FXlatSide  XLAT_SIDE
  44489 }
  44490 
  44491 type RPC_BUFPTR = uintptr
  44492 type RPC_LENGTH = uint32
  44493 type EXPR_EVAL = uintptr
  44494 type PFORMAT_STRING = uintptr
  44495 
  44496 type ARRAY_INFO = struct {
  44497 	FDimension             int32
  44498 	F__ccgo_pad1           [4]byte
  44499 	FBufferConformanceMark uintptr
  44500 	FBufferVarianceMark    uintptr
  44501 	FMaxCountArray         uintptr
  44502 	FOffsetArray           uintptr
  44503 	FActualCountArray      uintptr
  44504 }
  44505 type PARRAY_INFO = uintptr
  44506 
  44507 type PNDR_ASYNC_MESSAGE = uintptr
  44508 type PNDR_CORRELATION_INFO = uintptr
  44509 
  44510 type CS_STUB_INFO = struct {
  44511 	FWireCodeset             uint32
  44512 	FDesiredReceivingCodeset uint32
  44513 	FCSArrayInfo             uintptr
  44514 }
  44515 
  44516 type _MIDL_SYNTAX_INFO = struct {
  44517 	FTransferSyntax        RPC_SYNTAX_IDENTIFIER
  44518 	F__ccgo_pad1           [4]byte
  44519 	FDispatchTable         uintptr
  44520 	FProcString            PFORMAT_STRING
  44521 	FFmtStringOffset       uintptr
  44522 	FTypeString            PFORMAT_STRING
  44523 	FaUserMarshalQuadruple uintptr
  44524 	FpReserved1            ULONG_PTR
  44525 	FpReserved2            ULONG_PTR
  44526 }
  44527 
  44528 type MIDL_SYNTAX_INFO = _MIDL_SYNTAX_INFO
  44529 type PMIDL_SYNTAX_INFO = uintptr
  44530 
  44531 type IRpcChannelBuffer1 = struct{ FlpVtbl uintptr }
  44532 
  44533 type MIDL_STUB_MESSAGE = _MIDL_STUB_MESSAGE
  44534 type PMIDL_STUB_MESSAGE = uintptr
  44535 
  44536 type GENERIC_BINDING_ROUTINE = uintptr
  44537 type GENERIC_UNBIND_ROUTINE = uintptr
  44538 
  44539 type _GENERIC_BINDING_ROUTINE_PAIR = struct {
  44540 	FpfnBind   GENERIC_BINDING_ROUTINE
  44541 	FpfnUnbind GENERIC_UNBIND_ROUTINE
  44542 }
  44543 
  44544 type GENERIC_BINDING_ROUTINE_PAIR = _GENERIC_BINDING_ROUTINE_PAIR
  44545 type PGENERIC_BINDING_ROUTINE_PAIR = uintptr
  44546 
  44547 type __GENERIC_BINDING_INFO = struct {
  44548 	FpObj        uintptr
  44549 	FSize        uint32
  44550 	F__ccgo_pad1 [4]byte
  44551 	FpfnBind     GENERIC_BINDING_ROUTINE
  44552 	FpfnUnbind   GENERIC_UNBIND_ROUTINE
  44553 }
  44554 
  44555 type GENERIC_BINDING_INFO = __GENERIC_BINDING_INFO
  44556 type PGENERIC_BINDING_INFO = uintptr
  44557 
  44558 type XMIT_HELPER_ROUTINE = uintptr
  44559 
  44560 type _XMIT_ROUTINE_QUINTUPLE = struct {
  44561 	FpfnTranslateToXmit   XMIT_HELPER_ROUTINE
  44562 	FpfnTranslateFromXmit XMIT_HELPER_ROUTINE
  44563 	FpfnFreeXmit          XMIT_HELPER_ROUTINE
  44564 	FpfnFreeInst          XMIT_HELPER_ROUTINE
  44565 }
  44566 
  44567 type XMIT_ROUTINE_QUINTUPLE = _XMIT_ROUTINE_QUINTUPLE
  44568 type PXMIT_ROUTINE_QUINTUPLE = uintptr
  44569 
  44570 type USER_MARSHAL_SIZING_ROUTINE = uintptr
  44571 type USER_MARSHAL_MARSHALLING_ROUTINE = uintptr
  44572 type USER_MARSHAL_UNMARSHALLING_ROUTINE = uintptr
  44573 type USER_MARSHAL_FREEING_ROUTINE = uintptr
  44574 
  44575 type _USER_MARSHAL_ROUTINE_QUADRUPLE = struct {
  44576 	FpfnBufferSize USER_MARSHAL_SIZING_ROUTINE
  44577 	FpfnMarshall   USER_MARSHAL_MARSHALLING_ROUTINE
  44578 	FpfnUnmarshall USER_MARSHAL_UNMARSHALLING_ROUTINE
  44579 	FpfnFree       USER_MARSHAL_FREEING_ROUTINE
  44580 }
  44581 
  44582 type USER_MARSHAL_ROUTINE_QUADRUPLE = _USER_MARSHAL_ROUTINE_QUADRUPLE
  44583 
  44584 type USER_MARSHAL_CB_TYPE = uint32
  44585 
  44586 type _USER_MARSHAL_CB = struct {
  44587 	FFlags       uint32
  44588 	F__ccgo_pad1 [4]byte
  44589 	FpStubMsg    PMIDL_STUB_MESSAGE
  44590 	FpReserve    PFORMAT_STRING
  44591 	FSignature   uint32
  44592 	FCBType      USER_MARSHAL_CB_TYPE
  44593 	FpFormat     PFORMAT_STRING
  44594 	FpTypeFormat PFORMAT_STRING
  44595 }
  44596 
  44597 type USER_MARSHAL_CB = _USER_MARSHAL_CB
  44598 
  44599 type _MALLOC_FREE_STRUCT = struct {
  44600 	FpfnAllocate uintptr
  44601 	FpfnFree     uintptr
  44602 }
  44603 
  44604 type MALLOC_FREE_STRUCT = _MALLOC_FREE_STRUCT
  44605 
  44606 type _COMM_FAULT_OFFSETS = struct {
  44607 	FCommOffset  int16
  44608 	FFaultOffset int16
  44609 }
  44610 
  44611 type COMM_FAULT_OFFSETS = _COMM_FAULT_OFFSETS
  44612 
  44613 type IDL_CS_CONVERT = uint32
  44614 
  44615 type CS_TYPE_NET_SIZE_ROUTINE = uintptr
  44616 type CS_TYPE_LOCAL_SIZE_ROUTINE = uintptr
  44617 type CS_TYPE_TO_NETCS_ROUTINE = uintptr
  44618 type CS_TYPE_FROM_NETCS_ROUTINE = uintptr
  44619 type CS_TAG_GETTING_ROUTINE = uintptr
  44620 
  44621 type _NDR_CS_SIZE_CONVERT_ROUTINES = struct {
  44622 	FpfnNetSize   CS_TYPE_NET_SIZE_ROUTINE
  44623 	FpfnToNetCs   CS_TYPE_TO_NETCS_ROUTINE
  44624 	FpfnLocalSize CS_TYPE_LOCAL_SIZE_ROUTINE
  44625 	FpfnFromNetCs CS_TYPE_FROM_NETCS_ROUTINE
  44626 }
  44627 
  44628 type NDR_CS_SIZE_CONVERT_ROUTINES = _NDR_CS_SIZE_CONVERT_ROUTINES
  44629 
  44630 type _NDR_CS_ROUTINES = struct {
  44631 	FpSizeConvertRoutines uintptr
  44632 	FpTagGettingRoutines  uintptr
  44633 }
  44634 
  44635 type NDR_CS_ROUTINES = _NDR_CS_ROUTINES
  44636 
  44637 type MIDL_STUB_DESC = _MIDL_STUB_DESC
  44638 
  44639 type PMIDL_STUB_DESC = uintptr
  44640 type PMIDL_XMIT_TYPE = uintptr
  44641 
  44642 type _MIDL_FORMAT_STRING = struct {
  44643 	F__ccgo_pad1 [0]uint16
  44644 	FPad         int16
  44645 }
  44646 
  44647 type MIDL_FORMAT_STRING = _MIDL_FORMAT_STRING
  44648 
  44649 type STUB_THUNK = uintptr
  44650 type SERVER_ROUTINE = uintptr
  44651 
  44652 type _MIDL_SERVER_INFO_ = struct {
  44653 	FpStubDesc       PMIDL_STUB_DESC
  44654 	FDispatchTable   uintptr
  44655 	FProcString      PFORMAT_STRING
  44656 	FFmtStringOffset uintptr
  44657 	FThunkTable      uintptr
  44658 	FpTransferSyntax PRPC_SYNTAX_IDENTIFIER
  44659 	FnCount          ULONG_PTR
  44660 	FpSyntaxInfo     PMIDL_SYNTAX_INFO
  44661 }
  44662 
  44663 type MIDL_SERVER_INFO = _MIDL_SERVER_INFO_
  44664 type PMIDL_SERVER_INFO = uintptr
  44665 
  44666 type _MIDL_STUBLESS_PROXY_INFO = struct {
  44667 	FpStubDesc          PMIDL_STUB_DESC
  44668 	FProcFormatString   PFORMAT_STRING
  44669 	FFormatStringOffset uintptr
  44670 	FpTransferSyntax    PRPC_SYNTAX_IDENTIFIER
  44671 	FnCount             ULONG_PTR
  44672 	FpSyntaxInfo        PMIDL_SYNTAX_INFO
  44673 }
  44674 
  44675 type MIDL_STUBLESS_PROXY_INFO = _MIDL_STUBLESS_PROXY_INFO
  44676 
  44677 type PMIDL_STUBLESS_PROXY_INFO = uintptr
  44678 
  44679 type PARAM_OFFSETTABLE = uintptr
  44680 type PPARAM_OFFSETTABLE = uintptr
  44681 
  44682 type _CLIENT_CALL_RETURN = struct{ FPointer uintptr }
  44683 
  44684 type CLIENT_CALL_RETURN = _CLIENT_CALL_RETURN
  44685 
  44686 type XLAT_SIDE = uint32
  44687 
  44688 type _FULL_PTR_TO_REFID_ELEMENT = struct {
  44689 	FNext        uintptr
  44690 	FPointer     uintptr
  44691 	FRefId       uint32
  44692 	FState       uint8
  44693 	F__ccgo_pad1 [3]byte
  44694 }
  44695 
  44696 type FULL_PTR_TO_REFID_ELEMENT = _FULL_PTR_TO_REFID_ELEMENT
  44697 type PFULL_PTR_TO_REFID_ELEMENT = uintptr
  44698 
  44699 type FULL_PTR_XLAT_TABLES = _FULL_PTR_XLAT_TABLES
  44700 type PFULL_PTR_XLAT_TABLES = uintptr
  44701 
  44702 type STUB_PHASE = uint32
  44703 
  44704 type PROXY_PHASE = uint32
  44705 
  44706 type IRpcStubBuffer1 = struct{ FlpVtbl uintptr }
  44707 
  44708 type RPC_SS_THREAD_HANDLE = uintptr
  44709 
  44710 type _NDR_USER_MARSHAL_INFO_LEVEL1 = struct {
  44711 	FBuffer            uintptr
  44712 	FBufferSize        uint32
  44713 	F__ccgo_pad1       [4]byte
  44714 	FpfnAllocate       uintptr
  44715 	FpfnFree           uintptr
  44716 	FpRpcChannelBuffer uintptr
  44717 	FReserved          [5]ULONG_PTR
  44718 }
  44719 
  44720 type NDR_USER_MARSHAL_INFO_LEVEL1 = _NDR_USER_MARSHAL_INFO_LEVEL1
  44721 
  44722 type _NDR_USER_MARSHAL_INFO = struct {
  44723 	FInformationLevel uint32
  44724 	F__ccgo_pad1      [4]byte
  44725 	F__8              struct{ FLevel1 NDR_USER_MARSHAL_INFO_LEVEL1 }
  44726 }
  44727 
  44728 type NDR_USER_MARSHAL_INFO = _NDR_USER_MARSHAL_INFO
  44729 
  44730 type REGCLS = uint32
  44731 
  44732 type IRpcStubBuffer = IRpcStubBuffer1
  44733 type IRpcChannelBuffer = IRpcChannelBuffer1
  44734 
  44735 type COINITBASE = uint32
  44736 
  44737 type OLECHAR = WCHAR
  44738 type LPOLESTR = uintptr
  44739 type LPCOLESTR = uintptr
  44740 type DOUBLE = float64
  44741 
  44742 type _COAUTHIDENTITY = struct {
  44743 	FUser           uintptr
  44744 	FUserLength     ULONG
  44745 	F__ccgo_pad1    [4]byte
  44746 	FDomain         uintptr
  44747 	FDomainLength   ULONG
  44748 	F__ccgo_pad2    [4]byte
  44749 	FPassword       uintptr
  44750 	FPasswordLength ULONG
  44751 	FFlags          ULONG
  44752 }
  44753 
  44754 type COAUTHIDENTITY = _COAUTHIDENTITY
  44755 
  44756 type _COAUTHINFO = struct {
  44757 	FdwAuthnSvc           DWORD
  44758 	FdwAuthzSvc           DWORD
  44759 	FpwszServerPrincName  LPWSTR
  44760 	FdwAuthnLevel         DWORD
  44761 	FdwImpersonationLevel DWORD
  44762 	FpAuthIdentityData    uintptr
  44763 	FdwCapabilities       DWORD
  44764 	F__ccgo_pad1          [4]byte
  44765 }
  44766 
  44767 type COAUTHINFO = _COAUTHINFO
  44768 
  44769 type SCODE = LONG
  44770 type PSCODE = uintptr
  44771 
  44772 type MEMCTX = int32
  44773 
  44774 type CLSCTX = int32
  44775 
  44776 type MSHLFLAGS = uint32
  44777 
  44778 type MSHCTX = uint32
  44779 
  44780 type _BYTE_BLOB = struct {
  44781 	FclSize      ULONG
  44782 	FabData      [1]Byte
  44783 	F__ccgo_pad1 [3]byte
  44784 }
  44785 
  44786 type BYTE_BLOB = _BYTE_BLOB
  44787 
  44788 type UP_BYTE_BLOB = uintptr
  44789 
  44790 type _WORD_BLOB = struct {
  44791 	FclSize      ULONG
  44792 	FasData      [1]uint16
  44793 	F__ccgo_pad1 [2]byte
  44794 }
  44795 
  44796 type WORD_BLOB = _WORD_BLOB
  44797 
  44798 type UP_WORD_BLOB = uintptr
  44799 
  44800 type _DWORD_BLOB = struct {
  44801 	FclSize ULONG
  44802 	FalData [1]ULONG
  44803 }
  44804 
  44805 type DWORD_BLOB = _DWORD_BLOB
  44806 
  44807 type UP_DWORD_BLOB = uintptr
  44808 
  44809 type _FLAGGED_BYTE_BLOB = struct {
  44810 	FfFlags      ULONG
  44811 	FclSize      ULONG
  44812 	FabData      [1]Byte
  44813 	F__ccgo_pad1 [3]byte
  44814 }
  44815 
  44816 type FLAGGED_BYTE_BLOB = _FLAGGED_BYTE_BLOB
  44817 
  44818 type UP_FLAGGED_BYTE_BLOB = uintptr
  44819 
  44820 type _FLAGGED_WORD_BLOB = struct {
  44821 	FfFlags      ULONG
  44822 	FclSize      ULONG
  44823 	FasData      [1]uint16
  44824 	F__ccgo_pad1 [2]byte
  44825 }
  44826 
  44827 type FLAGGED_WORD_BLOB = _FLAGGED_WORD_BLOB
  44828 
  44829 type UP_FLAGGED_WORD_BLOB = uintptr
  44830 
  44831 type _BYTE_SIZEDARR = struct {
  44832 	FclSize      ULONG
  44833 	F__ccgo_pad1 [4]byte
  44834 	FpData       uintptr
  44835 }
  44836 
  44837 type BYTE_SIZEDARR = _BYTE_SIZEDARR
  44838 
  44839 type _SHORT_SIZEDARR = struct {
  44840 	FclSize      ULONG
  44841 	F__ccgo_pad1 [4]byte
  44842 	FpData       uintptr
  44843 }
  44844 
  44845 type WORD_SIZEDARR = _SHORT_SIZEDARR
  44846 
  44847 type _LONG_SIZEDARR = struct {
  44848 	FclSize      ULONG
  44849 	F__ccgo_pad1 [4]byte
  44850 	FpData       uintptr
  44851 }
  44852 
  44853 type DWORD_SIZEDARR = _LONG_SIZEDARR
  44854 
  44855 type _HYPER_SIZEDARR = struct {
  44856 	FclSize      ULONG
  44857 	F__ccgo_pad1 [4]byte
  44858 	FpData       uintptr
  44859 }
  44860 
  44861 type HYPER_SIZEDARR = _HYPER_SIZEDARR
  44862 
  44863 type tagBLOB = struct {
  44864 	FcbSize      ULONG
  44865 	F__ccgo_pad1 [4]byte
  44866 	FpBlobData   uintptr
  44867 }
  44868 
  44869 type BLOB = tagBLOB
  44870 type LPBLOB = uintptr
  44871 
  44872 type IUnknown1 = struct{ FlpVtbl uintptr }
  44873 
  44874 type IUnknown = IUnknown1
  44875 
  44876 type AsyncIUnknown1 = struct{ FlpVtbl uintptr }
  44877 
  44878 type AsyncIUnknown = AsyncIUnknown1
  44879 
  44880 type IClassFactory1 = struct{ FlpVtbl uintptr }
  44881 
  44882 type IClassFactory = IClassFactory1
  44883 
  44884 type LPUNKNOWN = uintptr
  44885 type IUnknownVtbl1 = struct {
  44886 	FQueryInterface uintptr
  44887 	FAddRef         uintptr
  44888 	FRelease        uintptr
  44889 }
  44890 
  44891 type IUnknownVtbl = IUnknownVtbl1
  44892 type AsyncIUnknownVtbl1 = struct {
  44893 	FQueryInterface        uintptr
  44894 	FAddRef                uintptr
  44895 	FRelease               uintptr
  44896 	FBegin_QueryInterface  uintptr
  44897 	FFinish_QueryInterface uintptr
  44898 	FBegin_AddRef          uintptr
  44899 	FFinish_AddRef         uintptr
  44900 	FBegin_Release         uintptr
  44901 	FFinish_Release        uintptr
  44902 }
  44903 
  44904 type AsyncIUnknownVtbl = AsyncIUnknownVtbl1
  44905 
  44906 type LPCLASSFACTORY = uintptr
  44907 type IClassFactoryVtbl1 = struct {
  44908 	FQueryInterface uintptr
  44909 	FAddRef         uintptr
  44910 	FRelease        uintptr
  44911 	FCreateInstance uintptr
  44912 	FLockServer     uintptr
  44913 }
  44914 
  44915 type IClassFactoryVtbl = IClassFactoryVtbl1
  44916 
  44917 type IMarshal1 = struct{ FlpVtbl uintptr }
  44918 
  44919 type IMarshal = IMarshal1
  44920 
  44921 type INoMarshal1 = struct{ FlpVtbl uintptr }
  44922 
  44923 type INoMarshal = INoMarshal1
  44924 
  44925 type IAgileObject1 = struct{ FlpVtbl uintptr }
  44926 
  44927 type IAgileObject = IAgileObject1
  44928 
  44929 type IAgileReference1 = struct{ FlpVtbl uintptr }
  44930 
  44931 type IAgileReference = IAgileReference1
  44932 
  44933 type IMarshal21 = struct{ FlpVtbl uintptr }
  44934 
  44935 type IMarshal2 = IMarshal21
  44936 
  44937 type IMalloc1 = struct{ FlpVtbl uintptr }
  44938 
  44939 type IMalloc = IMalloc1
  44940 
  44941 type IStdMarshalInfo1 = struct{ FlpVtbl uintptr }
  44942 
  44943 type IStdMarshalInfo = IStdMarshalInfo1
  44944 
  44945 type IExternalConnection1 = struct{ FlpVtbl uintptr }
  44946 
  44947 type IExternalConnection = IExternalConnection1
  44948 
  44949 type IMultiQI1 = struct{ FlpVtbl uintptr }
  44950 
  44951 type IMultiQI = IMultiQI1
  44952 
  44953 type AsyncIMultiQI1 = struct{ FlpVtbl uintptr }
  44954 
  44955 type AsyncIMultiQI = AsyncIMultiQI1
  44956 
  44957 type IInternalUnknown1 = struct{ FlpVtbl uintptr }
  44958 
  44959 type IInternalUnknown = IInternalUnknown1
  44960 
  44961 type IEnumUnknown1 = struct{ FlpVtbl uintptr }
  44962 
  44963 type IEnumUnknown = IEnumUnknown1
  44964 
  44965 type IEnumString1 = struct{ FlpVtbl uintptr }
  44966 
  44967 type IEnumString = IEnumString1
  44968 
  44969 type ISequentialStream1 = struct{ FlpVtbl uintptr }
  44970 
  44971 type ISequentialStream = ISequentialStream1
  44972 
  44973 type IStream1 = struct{ FlpVtbl uintptr }
  44974 
  44975 type IStream = IStream1
  44976 
  44977 type IRpcChannelBuffer21 = struct{ FlpVtbl uintptr }
  44978 
  44979 type IRpcChannelBuffer2 = IRpcChannelBuffer21
  44980 
  44981 type IAsyncRpcChannelBuffer1 = struct{ FlpVtbl uintptr }
  44982 
  44983 type IAsyncRpcChannelBuffer = IAsyncRpcChannelBuffer1
  44984 
  44985 type IRpcChannelBuffer31 = struct{ FlpVtbl uintptr }
  44986 
  44987 type IRpcChannelBuffer3 = IRpcChannelBuffer31
  44988 
  44989 type IRpcSyntaxNegotiate1 = struct{ FlpVtbl uintptr }
  44990 
  44991 type IRpcSyntaxNegotiate = IRpcSyntaxNegotiate1
  44992 
  44993 type IRpcProxyBuffer1 = struct{ FlpVtbl uintptr }
  44994 
  44995 type IRpcProxyBuffer = IRpcProxyBuffer1
  44996 
  44997 type IPSFactoryBuffer1 = struct{ FlpVtbl uintptr }
  44998 
  44999 type IPSFactoryBuffer = IPSFactoryBuffer1
  45000 
  45001 type IChannelHook1 = struct{ FlpVtbl uintptr }
  45002 
  45003 type IChannelHook = IChannelHook1
  45004 
  45005 type IClientSecurity1 = struct{ FlpVtbl uintptr }
  45006 
  45007 type IClientSecurity = IClientSecurity1
  45008 
  45009 type IServerSecurity1 = struct{ FlpVtbl uintptr }
  45010 
  45011 type IServerSecurity = IServerSecurity1
  45012 
  45013 type IRpcOptions1 = struct{ FlpVtbl uintptr }
  45014 
  45015 type IRpcOptions = IRpcOptions1
  45016 
  45017 type IGlobalOptions1 = struct{ FlpVtbl uintptr }
  45018 
  45019 type IGlobalOptions = IGlobalOptions1
  45020 
  45021 type ISurrogate1 = struct{ FlpVtbl uintptr }
  45022 
  45023 type ISurrogate = ISurrogate1
  45024 
  45025 type IGlobalInterfaceTable1 = struct{ FlpVtbl uintptr }
  45026 
  45027 type IGlobalInterfaceTable = IGlobalInterfaceTable1
  45028 
  45029 type ISynchronize1 = struct{ FlpVtbl uintptr }
  45030 
  45031 type ISynchronize = ISynchronize1
  45032 
  45033 type ISynchronizeHandle1 = struct{ FlpVtbl uintptr }
  45034 
  45035 type ISynchronizeHandle = ISynchronizeHandle1
  45036 
  45037 type ISynchronizeEvent1 = struct{ FlpVtbl uintptr }
  45038 
  45039 type ISynchronizeEvent = ISynchronizeEvent1
  45040 
  45041 type ISynchronizeContainer1 = struct{ FlpVtbl uintptr }
  45042 
  45043 type ISynchronizeContainer = ISynchronizeContainer1
  45044 
  45045 type ISynchronizeMutex1 = struct{ FlpVtbl uintptr }
  45046 
  45047 type ISynchronizeMutex = ISynchronizeMutex1
  45048 
  45049 type ICancelMethodCalls1 = struct{ FlpVtbl uintptr }
  45050 
  45051 type ICancelMethodCalls = ICancelMethodCalls1
  45052 
  45053 type IAsyncManager1 = struct{ FlpVtbl uintptr }
  45054 
  45055 type IAsyncManager = IAsyncManager1
  45056 
  45057 type ICallFactory1 = struct{ FlpVtbl uintptr }
  45058 
  45059 type ICallFactory = ICallFactory1
  45060 
  45061 type IRpcHelper1 = struct{ FlpVtbl uintptr }
  45062 
  45063 type IRpcHelper = IRpcHelper1
  45064 
  45065 type IReleaseMarshalBuffers1 = struct{ FlpVtbl uintptr }
  45066 
  45067 type IReleaseMarshalBuffers = IReleaseMarshalBuffers1
  45068 
  45069 type IWaitMultiple1 = struct{ FlpVtbl uintptr }
  45070 
  45071 type IWaitMultiple = IWaitMultiple1
  45072 
  45073 type IAddrTrackingControl1 = struct{ FlpVtbl uintptr }
  45074 
  45075 type IAddrTrackingControl = IAddrTrackingControl1
  45076 
  45077 type IAddrExclusionControl1 = struct{ FlpVtbl uintptr }
  45078 
  45079 type IAddrExclusionControl = IAddrExclusionControl1
  45080 
  45081 type IPipeByte1 = struct{ FlpVtbl uintptr }
  45082 
  45083 type IPipeByte = IPipeByte1
  45084 
  45085 type IPipeLong1 = struct{ FlpVtbl uintptr }
  45086 
  45087 type IPipeLong = IPipeLong1
  45088 
  45089 type IPipeDouble1 = struct{ FlpVtbl uintptr }
  45090 
  45091 type IPipeDouble = IPipeDouble1
  45092 
  45093 type IComThreadingInfo1 = struct{ FlpVtbl uintptr }
  45094 
  45095 type IComThreadingInfo = IComThreadingInfo1
  45096 
  45097 type IProcessInitControl1 = struct{ FlpVtbl uintptr }
  45098 
  45099 type IProcessInitControl = IProcessInitControl1
  45100 
  45101 type IFastRundown1 = struct{ FlpVtbl uintptr }
  45102 
  45103 type IFastRundown = IFastRundown1
  45104 
  45105 type IMarshalingStream1 = struct{ FlpVtbl uintptr }
  45106 
  45107 type IMarshalingStream = IMarshalingStream1
  45108 
  45109 type _COSERVERINFO = struct {
  45110 	FdwReserved1 DWORD
  45111 	F__ccgo_pad1 [4]byte
  45112 	FpwszName    LPWSTR
  45113 	FpAuthInfo   uintptr
  45114 	FdwReserved2 DWORD
  45115 	F__ccgo_pad2 [4]byte
  45116 }
  45117 
  45118 type COSERVERINFO = _COSERVERINFO
  45119 
  45120 type LPMARSHAL = uintptr
  45121 type IMarshalVtbl1 = struct {
  45122 	FQueryInterface     uintptr
  45123 	FAddRef             uintptr
  45124 	FRelease            uintptr
  45125 	FGetUnmarshalClass  uintptr
  45126 	FGetMarshalSizeMax  uintptr
  45127 	FMarshalInterface   uintptr
  45128 	FUnmarshalInterface uintptr
  45129 	FReleaseMarshalData uintptr
  45130 	FDisconnectObject   uintptr
  45131 }
  45132 
  45133 type IMarshalVtbl = IMarshalVtbl1
  45134 type INoMarshalVtbl1 = struct {
  45135 	FQueryInterface uintptr
  45136 	FAddRef         uintptr
  45137 	FRelease        uintptr
  45138 }
  45139 
  45140 type INoMarshalVtbl = INoMarshalVtbl1
  45141 type IAgileObjectVtbl1 = struct {
  45142 	FQueryInterface uintptr
  45143 	FAddRef         uintptr
  45144 	FRelease        uintptr
  45145 }
  45146 
  45147 type IAgileObjectVtbl = IAgileObjectVtbl1
  45148 type IAgileReferenceVtbl1 = struct {
  45149 	FQueryInterface uintptr
  45150 	FAddRef         uintptr
  45151 	FRelease        uintptr
  45152 	FResolve        uintptr
  45153 }
  45154 
  45155 type IAgileReferenceVtbl = IAgileReferenceVtbl1
  45156 
  45157 type LPMARSHAL2 = uintptr
  45158 type IMarshal2Vtbl1 = struct {
  45159 	FQueryInterface     uintptr
  45160 	FAddRef             uintptr
  45161 	FRelease            uintptr
  45162 	FGetUnmarshalClass  uintptr
  45163 	FGetMarshalSizeMax  uintptr
  45164 	FMarshalInterface   uintptr
  45165 	FUnmarshalInterface uintptr
  45166 	FReleaseMarshalData uintptr
  45167 	FDisconnectObject   uintptr
  45168 }
  45169 
  45170 type IMarshal2Vtbl = IMarshal2Vtbl1
  45171 
  45172 type LPMALLOC = uintptr
  45173 type IMallocVtbl1 = struct {
  45174 	FQueryInterface uintptr
  45175 	FAddRef         uintptr
  45176 	FRelease        uintptr
  45177 	FAlloc          uintptr
  45178 	FRealloc        uintptr
  45179 	FFree           uintptr
  45180 	FGetSize        uintptr
  45181 	FDidAlloc       uintptr
  45182 	FHeapMinimize   uintptr
  45183 }
  45184 
  45185 type IMallocVtbl = IMallocVtbl1
  45186 
  45187 type LPSTDMARSHALINFO = uintptr
  45188 type IStdMarshalInfoVtbl1 = struct {
  45189 	FQueryInterface     uintptr
  45190 	FAddRef             uintptr
  45191 	FRelease            uintptr
  45192 	FGetClassForHandler uintptr
  45193 }
  45194 
  45195 type IStdMarshalInfoVtbl = IStdMarshalInfoVtbl1
  45196 
  45197 type LPEXTERNALCONNECTION = uintptr
  45198 
  45199 type EXTCONN = uint32
  45200 type IExternalConnectionVtbl1 = struct {
  45201 	FQueryInterface    uintptr
  45202 	FAddRef            uintptr
  45203 	FRelease           uintptr
  45204 	FAddConnection     uintptr
  45205 	FReleaseConnection uintptr
  45206 }
  45207 
  45208 type IExternalConnectionVtbl = IExternalConnectionVtbl1
  45209 
  45210 type LPMULTIQI = uintptr
  45211 
  45212 type tagMULTI_QI = struct {
  45213 	FpIID        uintptr
  45214 	FpItf        uintptr
  45215 	Fhr          HRESULT
  45216 	F__ccgo_pad1 [4]byte
  45217 }
  45218 
  45219 type MULTI_QI = tagMULTI_QI
  45220 type IMultiQIVtbl1 = struct {
  45221 	FQueryInterface          uintptr
  45222 	FAddRef                  uintptr
  45223 	FRelease                 uintptr
  45224 	FQueryMultipleInterfaces uintptr
  45225 }
  45226 
  45227 type IMultiQIVtbl = IMultiQIVtbl1
  45228 type AsyncIMultiQIVtbl1 = struct {
  45229 	FQueryInterface                 uintptr
  45230 	FAddRef                         uintptr
  45231 	FRelease                        uintptr
  45232 	FBegin_QueryMultipleInterfaces  uintptr
  45233 	FFinish_QueryMultipleInterfaces uintptr
  45234 }
  45235 
  45236 type AsyncIMultiQIVtbl = AsyncIMultiQIVtbl1
  45237 type IInternalUnknownVtbl1 = struct {
  45238 	FQueryInterface         uintptr
  45239 	FAddRef                 uintptr
  45240 	FRelease                uintptr
  45241 	FQueryInternalInterface uintptr
  45242 }
  45243 
  45244 type IInternalUnknownVtbl = IInternalUnknownVtbl1
  45245 
  45246 type LPENUMUNKNOWN = uintptr
  45247 type IEnumUnknownVtbl1 = struct {
  45248 	FQueryInterface uintptr
  45249 	FAddRef         uintptr
  45250 	FRelease        uintptr
  45251 	FNext           uintptr
  45252 	FSkip           uintptr
  45253 	FReset          uintptr
  45254 	FClone          uintptr
  45255 }
  45256 
  45257 type IEnumUnknownVtbl = IEnumUnknownVtbl1
  45258 
  45259 type LPENUMSTRING = uintptr
  45260 type IEnumStringVtbl1 = struct {
  45261 	FQueryInterface uintptr
  45262 	FAddRef         uintptr
  45263 	FRelease        uintptr
  45264 	FNext           uintptr
  45265 	FSkip           uintptr
  45266 	FReset          uintptr
  45267 	FClone          uintptr
  45268 }
  45269 
  45270 type IEnumStringVtbl = IEnumStringVtbl1
  45271 type ISequentialStreamVtbl1 = struct {
  45272 	FQueryInterface uintptr
  45273 	FAddRef         uintptr
  45274 	FRelease        uintptr
  45275 	FRead           uintptr
  45276 	FWrite          uintptr
  45277 }
  45278 
  45279 type ISequentialStreamVtbl = ISequentialStreamVtbl1
  45280 
  45281 type LPSTREAM = uintptr
  45282 
  45283 type tagSTATSTG = struct {
  45284 	FpwcsName          LPOLESTR
  45285 	Ftype              DWORD
  45286 	F__ccgo_pad1       [4]byte
  45287 	FcbSize            ULARGE_INTEGER
  45288 	Fmtime             FILETIME
  45289 	Fctime             FILETIME
  45290 	Fatime             FILETIME
  45291 	FgrfMode           DWORD
  45292 	FgrfLocksSupported DWORD
  45293 	Fclsid             CLSID
  45294 	FgrfStateBits      DWORD
  45295 	Freserved          DWORD
  45296 }
  45297 
  45298 type STATSTG = tagSTATSTG
  45299 
  45300 type STGTY = uint32
  45301 
  45302 type STREAM_SEEK = uint32
  45303 
  45304 type LOCKTYPE = uint32
  45305 type IStreamVtbl1 = struct {
  45306 	FQueryInterface uintptr
  45307 	FAddRef         uintptr
  45308 	FRelease        uintptr
  45309 	FRead           uintptr
  45310 	FWrite          uintptr
  45311 	FSeek           uintptr
  45312 	FSetSize        uintptr
  45313 	FCopyTo         uintptr
  45314 	FCommit         uintptr
  45315 	FRevert         uintptr
  45316 	FLockRegion     uintptr
  45317 	FUnlockRegion   uintptr
  45318 	FStat           uintptr
  45319 	FClone          uintptr
  45320 }
  45321 
  45322 type IStreamVtbl = IStreamVtbl1
  45323 
  45324 type RPCOLEDATAREP = ULONG
  45325 
  45326 type tagRPCOLEMESSAGE = struct {
  45327 	Freserved1          uintptr
  45328 	FdataRepresentation RPCOLEDATAREP
  45329 	F__ccgo_pad1        [4]byte
  45330 	FBuffer             uintptr
  45331 	FcbBuffer           ULONG
  45332 	FiMethod            ULONG
  45333 	Freserved2          [5]uintptr
  45334 	FrpcFlags           ULONG
  45335 	F__ccgo_pad2        [4]byte
  45336 }
  45337 
  45338 type RPCOLEMESSAGE = tagRPCOLEMESSAGE
  45339 
  45340 type PRPCOLEMESSAGE = uintptr
  45341 type IRpcChannelBufferVtbl1 = struct {
  45342 	FQueryInterface uintptr
  45343 	FAddRef         uintptr
  45344 	FRelease        uintptr
  45345 	FGetBuffer      uintptr
  45346 	FSendReceive    uintptr
  45347 	FFreeBuffer     uintptr
  45348 	FGetDestCtx     uintptr
  45349 	FIsConnected    uintptr
  45350 }
  45351 
  45352 type IRpcChannelBufferVtbl = IRpcChannelBufferVtbl1
  45353 type IRpcChannelBuffer2Vtbl1 = struct {
  45354 	FQueryInterface     uintptr
  45355 	FAddRef             uintptr
  45356 	FRelease            uintptr
  45357 	FGetBuffer          uintptr
  45358 	FSendReceive        uintptr
  45359 	FFreeBuffer         uintptr
  45360 	FGetDestCtx         uintptr
  45361 	FIsConnected        uintptr
  45362 	FGetProtocolVersion uintptr
  45363 }
  45364 
  45365 type IRpcChannelBuffer2Vtbl = IRpcChannelBuffer2Vtbl1
  45366 type IAsyncRpcChannelBufferVtbl1 = struct {
  45367 	FQueryInterface     uintptr
  45368 	FAddRef             uintptr
  45369 	FRelease            uintptr
  45370 	FGetBuffer          uintptr
  45371 	FSendReceive        uintptr
  45372 	FFreeBuffer         uintptr
  45373 	FGetDestCtx         uintptr
  45374 	FIsConnected        uintptr
  45375 	FGetProtocolVersion uintptr
  45376 	FSend               uintptr
  45377 	FReceive            uintptr
  45378 	FGetDestCtxEx       uintptr
  45379 }
  45380 
  45381 type IAsyncRpcChannelBufferVtbl = IAsyncRpcChannelBufferVtbl1
  45382 type IRpcChannelBuffer3Vtbl1 = struct {
  45383 	FQueryInterface     uintptr
  45384 	FAddRef             uintptr
  45385 	FRelease            uintptr
  45386 	FGetBuffer          uintptr
  45387 	FSendReceive        uintptr
  45388 	FFreeBuffer         uintptr
  45389 	FGetDestCtx         uintptr
  45390 	FIsConnected        uintptr
  45391 	FGetProtocolVersion uintptr
  45392 	FSend               uintptr
  45393 	FReceive            uintptr
  45394 	FCancel             uintptr
  45395 	FGetCallContext     uintptr
  45396 	FGetDestCtxEx       uintptr
  45397 	FGetState           uintptr
  45398 	FRegisterAsync      uintptr
  45399 }
  45400 
  45401 type IRpcChannelBuffer3Vtbl = IRpcChannelBuffer3Vtbl1
  45402 type IRpcSyntaxNegotiateVtbl1 = struct {
  45403 	FQueryInterface  uintptr
  45404 	FAddRef          uintptr
  45405 	FRelease         uintptr
  45406 	FNegotiateSyntax uintptr
  45407 }
  45408 
  45409 type IRpcSyntaxNegotiateVtbl = IRpcSyntaxNegotiateVtbl1
  45410 type IRpcProxyBufferVtbl1 = struct {
  45411 	FQueryInterface uintptr
  45412 	FAddRef         uintptr
  45413 	FRelease        uintptr
  45414 	FConnect        uintptr
  45415 	FDisconnect     uintptr
  45416 }
  45417 
  45418 type IRpcProxyBufferVtbl = IRpcProxyBufferVtbl1
  45419 type IRpcStubBufferVtbl1 = struct {
  45420 	FQueryInterface            uintptr
  45421 	FAddRef                    uintptr
  45422 	FRelease                   uintptr
  45423 	FConnect                   uintptr
  45424 	FDisconnect                uintptr
  45425 	FInvoke                    uintptr
  45426 	FIsIIDSupported            uintptr
  45427 	FCountRefs                 uintptr
  45428 	FDebugServerQueryInterface uintptr
  45429 	FDebugServerRelease        uintptr
  45430 }
  45431 
  45432 type IRpcStubBufferVtbl = IRpcStubBufferVtbl1
  45433 type IPSFactoryBufferVtbl1 = struct {
  45434 	FQueryInterface uintptr
  45435 	FAddRef         uintptr
  45436 	FRelease        uintptr
  45437 	FCreateProxy    uintptr
  45438 	FCreateStub     uintptr
  45439 }
  45440 
  45441 type IPSFactoryBufferVtbl = IPSFactoryBufferVtbl1
  45442 
  45443 type SChannelHookCallInfo1 = struct {
  45444 	Fiid         IID
  45445 	FcbSize      DWORD
  45446 	FuCausality  GUID
  45447 	FdwServerPid DWORD
  45448 	FiMethod     DWORD
  45449 	F__ccgo_pad1 [4]byte
  45450 	FpObject     uintptr
  45451 }
  45452 
  45453 type SChannelHookCallInfo = SChannelHookCallInfo1
  45454 type IChannelHookVtbl1 = struct {
  45455 	FQueryInterface   uintptr
  45456 	FAddRef           uintptr
  45457 	FRelease          uintptr
  45458 	FClientGetSize    uintptr
  45459 	FClientFillBuffer uintptr
  45460 	FClientNotify     uintptr
  45461 	FServerNotify     uintptr
  45462 	FServerGetSize    uintptr
  45463 	FServerFillBuffer uintptr
  45464 }
  45465 
  45466 type IChannelHookVtbl = IChannelHookVtbl1
  45467 
  45468 type tagSOLE_AUTHENTICATION_SERVICE = struct {
  45469 	FdwAuthnSvc     DWORD
  45470 	FdwAuthzSvc     DWORD
  45471 	FpPrincipalName uintptr
  45472 	Fhr             HRESULT
  45473 	F__ccgo_pad1    [4]byte
  45474 }
  45475 
  45476 type SOLE_AUTHENTICATION_SERVICE = tagSOLE_AUTHENTICATION_SERVICE
  45477 
  45478 type PSOLE_AUTHENTICATION_SERVICE = uintptr
  45479 
  45480 type EOLE_AUTHENTICATION_CAPABILITIES = uint32
  45481 
  45482 type tagSOLE_AUTHENTICATION_INFO = struct {
  45483 	FdwAuthnSvc DWORD
  45484 	FdwAuthzSvc DWORD
  45485 	FpAuthInfo  uintptr
  45486 }
  45487 
  45488 type SOLE_AUTHENTICATION_INFO = tagSOLE_AUTHENTICATION_INFO
  45489 type PSOLE_AUTHENTICATION_INFO = uintptr
  45490 
  45491 type tagSOLE_AUTHENTICATION_LIST = struct {
  45492 	FcAuthInfo   DWORD
  45493 	F__ccgo_pad1 [4]byte
  45494 	FaAuthInfo   uintptr
  45495 }
  45496 
  45497 type SOLE_AUTHENTICATION_LIST = tagSOLE_AUTHENTICATION_LIST
  45498 type PSOLE_AUTHENTICATION_LIST = uintptr
  45499 type IClientSecurityVtbl1 = struct {
  45500 	FQueryInterface uintptr
  45501 	FAddRef         uintptr
  45502 	FRelease        uintptr
  45503 	FQueryBlanket   uintptr
  45504 	FSetBlanket     uintptr
  45505 	FCopyProxy      uintptr
  45506 }
  45507 
  45508 type IClientSecurityVtbl = IClientSecurityVtbl1
  45509 type IServerSecurityVtbl1 = struct {
  45510 	FQueryInterface    uintptr
  45511 	FAddRef            uintptr
  45512 	FRelease           uintptr
  45513 	FQueryBlanket      uintptr
  45514 	FImpersonateClient uintptr
  45515 	FRevertToSelf      uintptr
  45516 	FIsImpersonating   uintptr
  45517 }
  45518 
  45519 type IServerSecurityVtbl = IServerSecurityVtbl1
  45520 
  45521 type RPCOPT_PROPERTIES = uint32
  45522 
  45523 type RPCOPT_SERVER_LOCALITY_VALUES = uint32
  45524 type IRpcOptionsVtbl1 = struct {
  45525 	FQueryInterface uintptr
  45526 	FAddRef         uintptr
  45527 	FRelease        uintptr
  45528 	FSet            uintptr
  45529 	FQuery          uintptr
  45530 }
  45531 
  45532 type IRpcOptionsVtbl = IRpcOptionsVtbl1
  45533 
  45534 type GLOBALOPT_PROPERTIES = uint32
  45535 
  45536 type GLOBALOPT_EH_VALUES = uint32
  45537 
  45538 type GLOBALOPT_RPCTP_VALUES = uint32
  45539 
  45540 type GLOBALOPT_RO_FLAGS = uint32
  45541 
  45542 type GLOBALOPT_UNMARSHALING_POLICY_VALUES = uint32
  45543 type IGlobalOptionsVtbl1 = struct {
  45544 	FQueryInterface uintptr
  45545 	FAddRef         uintptr
  45546 	FRelease        uintptr
  45547 	FSet            uintptr
  45548 	FQuery          uintptr
  45549 }
  45550 
  45551 type IGlobalOptionsVtbl = IGlobalOptionsVtbl1
  45552 
  45553 type LPSURROGATE = uintptr
  45554 type ISurrogateVtbl1 = struct {
  45555 	FQueryInterface uintptr
  45556 	FAddRef         uintptr
  45557 	FRelease        uintptr
  45558 	FLoadDllServer  uintptr
  45559 	FFreeSurrogate  uintptr
  45560 }
  45561 
  45562 type ISurrogateVtbl = ISurrogateVtbl1
  45563 
  45564 type LPGLOBALINTERFACETABLE = uintptr
  45565 type IGlobalInterfaceTableVtbl1 = struct {
  45566 	FQueryInterface            uintptr
  45567 	FAddRef                    uintptr
  45568 	FRelease                   uintptr
  45569 	FRegisterInterfaceInGlobal uintptr
  45570 	FRevokeInterfaceFromGlobal uintptr
  45571 	FGetInterfaceFromGlobal    uintptr
  45572 }
  45573 
  45574 type IGlobalInterfaceTableVtbl = IGlobalInterfaceTableVtbl1
  45575 type ISynchronizeVtbl1 = struct {
  45576 	FQueryInterface uintptr
  45577 	FAddRef         uintptr
  45578 	FRelease        uintptr
  45579 	FWait           uintptr
  45580 	FSignal         uintptr
  45581 	FReset          uintptr
  45582 }
  45583 
  45584 type ISynchronizeVtbl = ISynchronizeVtbl1
  45585 type ISynchronizeHandleVtbl1 = struct {
  45586 	FQueryInterface uintptr
  45587 	FAddRef         uintptr
  45588 	FRelease        uintptr
  45589 	FGetHandle      uintptr
  45590 }
  45591 
  45592 type ISynchronizeHandleVtbl = ISynchronizeHandleVtbl1
  45593 type ISynchronizeEventVtbl1 = struct {
  45594 	FQueryInterface uintptr
  45595 	FAddRef         uintptr
  45596 	FRelease        uintptr
  45597 	FGetHandle      uintptr
  45598 	FSetEventHandle uintptr
  45599 }
  45600 
  45601 type ISynchronizeEventVtbl = ISynchronizeEventVtbl1
  45602 type ISynchronizeContainerVtbl1 = struct {
  45603 	FQueryInterface uintptr
  45604 	FAddRef         uintptr
  45605 	FRelease        uintptr
  45606 	FAddSynchronize uintptr
  45607 	FWaitMultiple   uintptr
  45608 }
  45609 
  45610 type ISynchronizeContainerVtbl = ISynchronizeContainerVtbl1
  45611 type ISynchronizeMutexVtbl1 = struct {
  45612 	FQueryInterface uintptr
  45613 	FAddRef         uintptr
  45614 	FRelease        uintptr
  45615 	FWait           uintptr
  45616 	FSignal         uintptr
  45617 	FReset          uintptr
  45618 	FReleaseMutex   uintptr
  45619 }
  45620 
  45621 type ISynchronizeMutexVtbl = ISynchronizeMutexVtbl1
  45622 
  45623 type LPCANCELMETHODCALLS = uintptr
  45624 type ICancelMethodCallsVtbl1 = struct {
  45625 	FQueryInterface uintptr
  45626 	FAddRef         uintptr
  45627 	FRelease        uintptr
  45628 	FCancel         uintptr
  45629 	FTestCancel     uintptr
  45630 }
  45631 
  45632 type ICancelMethodCallsVtbl = ICancelMethodCallsVtbl1
  45633 
  45634 type DCOM_CALL_STATE = uint32
  45635 type IAsyncManagerVtbl1 = struct {
  45636 	FQueryInterface uintptr
  45637 	FAddRef         uintptr
  45638 	FRelease        uintptr
  45639 	FCompleteCall   uintptr
  45640 	FGetCallContext uintptr
  45641 	FGetState       uintptr
  45642 }
  45643 
  45644 type IAsyncManagerVtbl = IAsyncManagerVtbl1
  45645 type ICallFactoryVtbl1 = struct {
  45646 	FQueryInterface uintptr
  45647 	FAddRef         uintptr
  45648 	FRelease        uintptr
  45649 	FCreateCall     uintptr
  45650 }
  45651 
  45652 type ICallFactoryVtbl = ICallFactoryVtbl1
  45653 type IRpcHelperVtbl1 = struct {
  45654 	FQueryInterface         uintptr
  45655 	FAddRef                 uintptr
  45656 	FRelease                uintptr
  45657 	FGetDCOMProtocolVersion uintptr
  45658 	FGetIIDFromOBJREF       uintptr
  45659 }
  45660 
  45661 type IRpcHelperVtbl = IRpcHelperVtbl1
  45662 type IReleaseMarshalBuffersVtbl1 = struct {
  45663 	FQueryInterface       uintptr
  45664 	FAddRef               uintptr
  45665 	FRelease              uintptr
  45666 	FReleaseMarshalBuffer uintptr
  45667 }
  45668 
  45669 type IReleaseMarshalBuffersVtbl = IReleaseMarshalBuffersVtbl1
  45670 type IWaitMultipleVtbl1 = struct {
  45671 	FQueryInterface uintptr
  45672 	FAddRef         uintptr
  45673 	FRelease        uintptr
  45674 	FWaitMultiple   uintptr
  45675 	FAddSynchronize uintptr
  45676 }
  45677 
  45678 type IWaitMultipleVtbl = IWaitMultipleVtbl1
  45679 
  45680 type LPADDRTRACKINGCONTROL = uintptr
  45681 type IAddrTrackingControlVtbl1 = struct {
  45682 	FQueryInterface                uintptr
  45683 	FAddRef                        uintptr
  45684 	FRelease                       uintptr
  45685 	FEnableCOMDynamicAddrTracking  uintptr
  45686 	FDisableCOMDynamicAddrTracking uintptr
  45687 }
  45688 
  45689 type IAddrTrackingControlVtbl = IAddrTrackingControlVtbl1
  45690 
  45691 type LPADDREXCLUSIONCONTROL = uintptr
  45692 type IAddrExclusionControlVtbl1 = struct {
  45693 	FQueryInterface              uintptr
  45694 	FAddRef                      uintptr
  45695 	FRelease                     uintptr
  45696 	FGetCurrentAddrExclusionList uintptr
  45697 	FUpdateAddrExclusionList     uintptr
  45698 }
  45699 
  45700 type IAddrExclusionControlVtbl = IAddrExclusionControlVtbl1
  45701 type IPipeByteVtbl1 = struct {
  45702 	FQueryInterface uintptr
  45703 	FAddRef         uintptr
  45704 	FRelease        uintptr
  45705 	FPull           uintptr
  45706 	FPush           uintptr
  45707 }
  45708 
  45709 type IPipeByteVtbl = IPipeByteVtbl1
  45710 type IPipeLongVtbl1 = struct {
  45711 	FQueryInterface uintptr
  45712 	FAddRef         uintptr
  45713 	FRelease        uintptr
  45714 	FPull           uintptr
  45715 	FPush           uintptr
  45716 }
  45717 
  45718 type IPipeLongVtbl = IPipeLongVtbl1
  45719 type IPipeDoubleVtbl1 = struct {
  45720 	FQueryInterface uintptr
  45721 	FAddRef         uintptr
  45722 	FRelease        uintptr
  45723 	FPull           uintptr
  45724 	FPush           uintptr
  45725 }
  45726 
  45727 type IPipeDoubleVtbl = IPipeDoubleVtbl1
  45728 
  45729 type APTTYPEQUALIFIER = uint32
  45730 
  45731 type APTTYPE = int32
  45732 
  45733 type THDTYPE = uint32
  45734 
  45735 type APARTMENTID = DWORD
  45736 type IComThreadingInfoVtbl1 = struct {
  45737 	FQueryInterface            uintptr
  45738 	FAddRef                    uintptr
  45739 	FRelease                   uintptr
  45740 	FGetCurrentApartmentType   uintptr
  45741 	FGetCurrentThreadType      uintptr
  45742 	FGetCurrentLogicalThreadId uintptr
  45743 	FSetCurrentLogicalThreadId uintptr
  45744 }
  45745 
  45746 type IComThreadingInfoVtbl = IComThreadingInfoVtbl1
  45747 type IProcessInitControlVtbl1 = struct {
  45748 	FQueryInterface          uintptr
  45749 	FAddRef                  uintptr
  45750 	FRelease                 uintptr
  45751 	FResetInitializerTimeout uintptr
  45752 }
  45753 
  45754 type IProcessInitControlVtbl = IProcessInitControlVtbl1
  45755 type IFastRundownVtbl1 = struct {
  45756 	FQueryInterface uintptr
  45757 	FAddRef         uintptr
  45758 	FRelease        uintptr
  45759 }
  45760 
  45761 type IFastRundownVtbl = IFastRundownVtbl1
  45762 
  45763 type CO_MARSHALING_CONTEXT_ATTRIBUTES = uint32
  45764 type IMarshalingStreamVtbl1 = struct {
  45765 	FQueryInterface                uintptr
  45766 	FAddRef                        uintptr
  45767 	FRelease                       uintptr
  45768 	FRead                          uintptr
  45769 	FWrite                         uintptr
  45770 	FSeek                          uintptr
  45771 	FSetSize                       uintptr
  45772 	FCopyTo                        uintptr
  45773 	FCommit                        uintptr
  45774 	FRevert                        uintptr
  45775 	FLockRegion                    uintptr
  45776 	FUnlockRegion                  uintptr
  45777 	FStat                          uintptr
  45778 	FClone                         uintptr
  45779 	FGetMarshalingContextAttribute uintptr
  45780 }
  45781 
  45782 type IMarshalingStreamVtbl = IMarshalingStreamVtbl1
  45783 
  45784 type STDMSHLFLAGS = uint32
  45785 
  45786 type tagPROPVARIANT = struct {
  45787 	F__0 struct {
  45788 		F__0 struct {
  45789 			Fvt         VARTYPE
  45790 			FwReserved1 PROPVAR_PAD1
  45791 			FwReserved2 PROPVAR_PAD2
  45792 			FwReserved3 PROPVAR_PAD3
  45793 			F__8        struct {
  45794 				F__ccgo_pad1 [0]uint64
  45795 				FcVal        CHAR
  45796 				F__ccgo_pad2 [15]byte
  45797 			}
  45798 		}
  45799 	}
  45800 }
  45801 
  45802 type PROPVARIANT = tagPROPVARIANT
  45803 
  45804 type COWAIT_FLAGS = uint32
  45805 
  45806 type LPFNGETCLASSOBJECT = uintptr
  45807 type LPFNCANUNLOADNOW = uintptr
  45808 
  45809 type COINIT = uint32
  45810 
  45811 type STGFMT = DWORD
  45812 
  45813 type IMallocSpy1 = struct{ FlpVtbl uintptr }
  45814 
  45815 type IMallocSpy = IMallocSpy1
  45816 
  45817 type IBindCtx1 = struct{ FlpVtbl uintptr }
  45818 
  45819 type IBindCtx = IBindCtx1
  45820 
  45821 type IEnumMoniker1 = struct{ FlpVtbl uintptr }
  45822 
  45823 type IEnumMoniker = IEnumMoniker1
  45824 
  45825 type IRunnableObject1 = struct{ FlpVtbl uintptr }
  45826 
  45827 type IRunnableObject = IRunnableObject1
  45828 
  45829 type IRunningObjectTable1 = struct{ FlpVtbl uintptr }
  45830 
  45831 type IRunningObjectTable = IRunningObjectTable1
  45832 
  45833 type IPersist1 = struct{ FlpVtbl uintptr }
  45834 
  45835 type IPersist = IPersist1
  45836 
  45837 type IPersistStream1 = struct{ FlpVtbl uintptr }
  45838 
  45839 type IPersistStream = IPersistStream1
  45840 
  45841 type IMoniker1 = struct{ FlpVtbl uintptr }
  45842 
  45843 type IMoniker = IMoniker1
  45844 
  45845 type IROTData1 = struct{ FlpVtbl uintptr }
  45846 
  45847 type IROTData = IROTData1
  45848 
  45849 type IEnumSTATSTG1 = struct{ FlpVtbl uintptr }
  45850 
  45851 type IEnumSTATSTG = IEnumSTATSTG1
  45852 
  45853 type IStorage1 = struct{ FlpVtbl uintptr }
  45854 
  45855 type IStorage = IStorage1
  45856 
  45857 type IPersistFile1 = struct{ FlpVtbl uintptr }
  45858 
  45859 type IPersistFile = IPersistFile1
  45860 
  45861 type IPersistStorage1 = struct{ FlpVtbl uintptr }
  45862 
  45863 type IPersistStorage = IPersistStorage1
  45864 
  45865 type ILockBytes1 = struct{ FlpVtbl uintptr }
  45866 
  45867 type ILockBytes = ILockBytes1
  45868 
  45869 type IEnumFORMATETC1 = struct{ FlpVtbl uintptr }
  45870 
  45871 type IEnumFORMATETC = IEnumFORMATETC1
  45872 
  45873 type IEnumSTATDATA1 = struct{ FlpVtbl uintptr }
  45874 
  45875 type IEnumSTATDATA = IEnumSTATDATA1
  45876 
  45877 type IRootStorage1 = struct{ FlpVtbl uintptr }
  45878 
  45879 type IRootStorage = IRootStorage1
  45880 
  45881 type IAdviseSink1 = struct{ FlpVtbl uintptr }
  45882 
  45883 type IAdviseSink = IAdviseSink1
  45884 
  45885 type AsyncIAdviseSink1 = struct{ FlpVtbl uintptr }
  45886 
  45887 type AsyncIAdviseSink = AsyncIAdviseSink1
  45888 
  45889 type IAdviseSink21 = struct{ FlpVtbl uintptr }
  45890 
  45891 type IAdviseSink2 = IAdviseSink21
  45892 
  45893 type AsyncIAdviseSink21 = struct{ FlpVtbl uintptr }
  45894 
  45895 type AsyncIAdviseSink2 = AsyncIAdviseSink21
  45896 
  45897 type IDataObject1 = struct{ FlpVtbl uintptr }
  45898 
  45899 type IDataObject = IDataObject1
  45900 
  45901 type IDataAdviseHolder1 = struct{ FlpVtbl uintptr }
  45902 
  45903 type IDataAdviseHolder = IDataAdviseHolder1
  45904 
  45905 type IMessageFilter1 = struct{ FlpVtbl uintptr }
  45906 
  45907 type IMessageFilter = IMessageFilter1
  45908 
  45909 type IClassActivator1 = struct{ FlpVtbl uintptr }
  45910 
  45911 type IClassActivator = IClassActivator1
  45912 
  45913 type IFillLockBytes1 = struct{ FlpVtbl uintptr }
  45914 
  45915 type IFillLockBytes = IFillLockBytes1
  45916 
  45917 type IProgressNotify1 = struct{ FlpVtbl uintptr }
  45918 
  45919 type IProgressNotify = IProgressNotify1
  45920 
  45921 type ILayoutStorage1 = struct{ FlpVtbl uintptr }
  45922 
  45923 type ILayoutStorage = ILayoutStorage1
  45924 
  45925 type IBlockingLock1 = struct{ FlpVtbl uintptr }
  45926 
  45927 type IBlockingLock = IBlockingLock1
  45928 
  45929 type ITimeAndNoticeControl1 = struct{ FlpVtbl uintptr }
  45930 
  45931 type ITimeAndNoticeControl = ITimeAndNoticeControl1
  45932 
  45933 type IOplockStorage1 = struct{ FlpVtbl uintptr }
  45934 
  45935 type IOplockStorage = IOplockStorage1
  45936 
  45937 type IDirectWriterLock1 = struct{ FlpVtbl uintptr }
  45938 
  45939 type IDirectWriterLock = IDirectWriterLock1
  45940 
  45941 type IUrlMon1 = struct{ FlpVtbl uintptr }
  45942 
  45943 type IUrlMon = IUrlMon1
  45944 
  45945 type IForegroundTransfer1 = struct{ FlpVtbl uintptr }
  45946 
  45947 type IForegroundTransfer = IForegroundTransfer1
  45948 
  45949 type IThumbnailExtractor1 = struct{ FlpVtbl uintptr }
  45950 
  45951 type IThumbnailExtractor = IThumbnailExtractor1
  45952 
  45953 type IDummyHICONIncluder1 = struct{ FlpVtbl uintptr }
  45954 
  45955 type IDummyHICONIncluder = IDummyHICONIncluder1
  45956 
  45957 type IProcessLock1 = struct{ FlpVtbl uintptr }
  45958 
  45959 type IProcessLock = IProcessLock1
  45960 
  45961 type ISurrogateService1 = struct{ FlpVtbl uintptr }
  45962 
  45963 type ISurrogateService = ISurrogateService1
  45964 
  45965 type IInitializeSpy1 = struct{ FlpVtbl uintptr }
  45966 
  45967 type IInitializeSpy = IInitializeSpy1
  45968 
  45969 type IApartmentShutdown1 = struct{ FlpVtbl uintptr }
  45970 
  45971 type IApartmentShutdown = IApartmentShutdown1
  45972 type tagRemHGLOBAL = struct {
  45973 	FfNullHGlobal LONG
  45974 	FcbData       ULONG
  45975 	Fdata         [1]Byte
  45976 	F__ccgo_pad1  [3]byte
  45977 }
  45978 
  45979 type RemHGLOBAL = tagRemHGLOBAL
  45980 
  45981 type tagRemHMETAFILEPICT = struct {
  45982 	Fmm          LONG
  45983 	FxExt        LONG
  45984 	FyExt        LONG
  45985 	FcbData      ULONG
  45986 	Fdata        [1]Byte
  45987 	F__ccgo_pad1 [3]byte
  45988 }
  45989 
  45990 type RemHMETAFILEPICT = tagRemHMETAFILEPICT
  45991 
  45992 type tagRemHENHMETAFILE = struct {
  45993 	FcbData      ULONG
  45994 	Fdata        [1]Byte
  45995 	F__ccgo_pad1 [3]byte
  45996 }
  45997 
  45998 type RemHENHMETAFILE = tagRemHENHMETAFILE
  45999 type tagRemHBITMAP = struct {
  46000 	FcbData      ULONG
  46001 	Fdata        [1]Byte
  46002 	F__ccgo_pad1 [3]byte
  46003 }
  46004 
  46005 type RemHBITMAP = tagRemHBITMAP
  46006 
  46007 type tagRemHPALETTE = struct {
  46008 	FcbData      ULONG
  46009 	Fdata        [1]Byte
  46010 	F__ccgo_pad1 [3]byte
  46011 }
  46012 
  46013 type RemHPALETTE = tagRemHPALETTE
  46014 
  46015 type tagRemBRUSH = struct {
  46016 	FcbData      ULONG
  46017 	Fdata        [1]Byte
  46018 	F__ccgo_pad1 [3]byte
  46019 }
  46020 
  46021 type RemHBRUSH = tagRemBRUSH
  46022 
  46023 type DVASPECT = uint32
  46024 
  46025 type STGC = uint32
  46026 
  46027 type STGMOVE = uint32
  46028 
  46029 type STATFLAG = uint32
  46030 type HCONTEXT = uintptr
  46031 
  46032 type _userCLIPFORMAT = struct {
  46033 	FfContext    LONG
  46034 	F__ccgo_pad1 [4]byte
  46035 	Fu           struct {
  46036 		F__ccgo_pad1 [0]uint64
  46037 		FdwValue     DWORD
  46038 		F__ccgo_pad2 [4]byte
  46039 	}
  46040 }
  46041 
  46042 type UserCLIPFORMAT = _userCLIPFORMAT
  46043 
  46044 type WireCLIPFORMAT = uintptr
  46045 type CLIPFORMAT = WORD
  46046 
  46047 type _GDI_NONREMOTE = struct {
  46048 	FfContext    LONG
  46049 	F__ccgo_pad1 [4]byte
  46050 	Fu           struct {
  46051 		F__ccgo_pad1 [0]uint64
  46052 		FhInproc     LONG
  46053 		F__ccgo_pad2 [4]byte
  46054 	}
  46055 }
  46056 
  46057 type GDI_NONREMOTE = _GDI_NONREMOTE
  46058 
  46059 type _userHGLOBAL = struct {
  46060 	FfContext    LONG
  46061 	F__ccgo_pad1 [4]byte
  46062 	Fu           struct {
  46063 		F__ccgo_pad1 [0]uint64
  46064 		FhInproc     LONG
  46065 		F__ccgo_pad2 [4]byte
  46066 	}
  46067 }
  46068 
  46069 type UserHGLOBAL = _userHGLOBAL
  46070 
  46071 type WireHGLOBAL = uintptr
  46072 
  46073 type _userHMETAFILE = struct {
  46074 	FfContext    LONG
  46075 	F__ccgo_pad1 [4]byte
  46076 	Fu           struct {
  46077 		F__ccgo_pad1 [0]uint64
  46078 		FhInproc     LONG
  46079 		F__ccgo_pad2 [4]byte
  46080 	}
  46081 }
  46082 
  46083 type UserHMETAFILE = _userHMETAFILE
  46084 
  46085 type _remoteMETAFILEPICT = struct {
  46086 	Fmm          LONG
  46087 	FxExt        LONG
  46088 	FyExt        LONG
  46089 	F__ccgo_pad1 [4]byte
  46090 	FhMF         uintptr
  46091 }
  46092 
  46093 type RemoteMETAFILEPICT = _remoteMETAFILEPICT
  46094 
  46095 type _userHMETAFILEPICT = struct {
  46096 	FfContext    LONG
  46097 	F__ccgo_pad1 [4]byte
  46098 	Fu           struct {
  46099 		F__ccgo_pad1 [0]uint64
  46100 		FhInproc     LONG
  46101 		F__ccgo_pad2 [4]byte
  46102 	}
  46103 }
  46104 
  46105 type UserHMETAFILEPICT = _userHMETAFILEPICT
  46106 
  46107 type _userHENHMETAFILE = struct {
  46108 	FfContext    LONG
  46109 	F__ccgo_pad1 [4]byte
  46110 	Fu           struct {
  46111 		F__ccgo_pad1 [0]uint64
  46112 		FhInproc     LONG
  46113 		F__ccgo_pad2 [4]byte
  46114 	}
  46115 }
  46116 
  46117 type UserHENHMETAFILE = _userHENHMETAFILE
  46118 
  46119 type _userBITMAP = struct {
  46120 	FbmType       LONG
  46121 	FbmWidth      LONG
  46122 	FbmHeight     LONG
  46123 	FbmWidthBytes LONG
  46124 	FbmPlanes     WORD
  46125 	FbmBitsPixel  WORD
  46126 	FcbSize       ULONG
  46127 	FpBuffer      [1]Byte
  46128 	F__ccgo_pad1  [3]byte
  46129 }
  46130 
  46131 type UserBITMAP = _userBITMAP
  46132 
  46133 type _userHBITMAP = struct {
  46134 	FfContext    LONG
  46135 	F__ccgo_pad1 [4]byte
  46136 	Fu           struct {
  46137 		F__ccgo_pad1 [0]uint64
  46138 		FhInproc     LONG
  46139 		F__ccgo_pad2 [4]byte
  46140 	}
  46141 }
  46142 
  46143 type UserHBITMAP = _userHBITMAP
  46144 
  46145 type _userHPALETTE = struct {
  46146 	FfContext    LONG
  46147 	F__ccgo_pad1 [4]byte
  46148 	Fu           struct {
  46149 		F__ccgo_pad1 [0]uint64
  46150 		FhInproc     LONG
  46151 		F__ccgo_pad2 [4]byte
  46152 	}
  46153 }
  46154 
  46155 type UserHPALETTE = _userHPALETTE
  46156 
  46157 type _RemotableHandle = struct {
  46158 	FfContext LONG
  46159 	Fu        struct{ FhInproc LONG }
  46160 }
  46161 
  46162 type RemotableHandle = _RemotableHandle
  46163 
  46164 type WireHWND = uintptr
  46165 type WireHMENU = uintptr
  46166 type WireHACCEL = uintptr
  46167 type WireHBRUSH = uintptr
  46168 type WireHFONT = uintptr
  46169 type WireHDC = uintptr
  46170 type WireHICON = uintptr
  46171 type WireHRGN = uintptr
  46172 type WireHMONITOR = uintptr
  46173 
  46174 type WireHBITMAP = uintptr
  46175 type WireHPALETTE = uintptr
  46176 type WireHENHMETAFILE = uintptr
  46177 type WireHMETAFILE = uintptr
  46178 type WireHMETAFILEPICT = uintptr
  46179 
  46180 type HMETAFILEPICT = uintptr
  46181 
  46182 type DATE = float64
  46183 
  46184 type tagCY = struct {
  46185 	F__ccgo_pad1 [0]uint64
  46186 	Fs           struct {
  46187 		FLo uint32
  46188 		FHi int32
  46189 	}
  46190 }
  46191 
  46192 type CY = tagCY
  46193 
  46194 type LPCY = uintptr
  46195 
  46196 type tagDEC = struct {
  46197 	FwReserved USHORT
  46198 	Fu         struct {
  46199 		F__ccgo_pad1 [0]uint16
  46200 		Fs           struct {
  46201 			Fscale BYTE
  46202 			Fsign  BYTE
  46203 		}
  46204 	}
  46205 	FHi32 ULONG
  46206 	Fu2   struct {
  46207 		F__ccgo_pad1 [0]uint64
  46208 		Fs2          struct {
  46209 			FLo32  ULONG
  46210 			FMid32 ULONG
  46211 		}
  46212 	}
  46213 }
  46214 
  46215 type DECIMAL = tagDEC
  46216 
  46217 type LPDECIMAL = uintptr
  46218 
  46219 type WireBSTR = uintptr
  46220 type BSTR = uintptr
  46221 
  46222 type LPBSTR = uintptr
  46223 
  46224 type VARIANT_BOOL = int16
  46225 
  46226 type tagBSTRBLOB = struct {
  46227 	FcbSize      ULONG
  46228 	F__ccgo_pad1 [4]byte
  46229 	FpData       uintptr
  46230 }
  46231 
  46232 type BSTRBLOB = tagBSTRBLOB
  46233 type LPBSTRBLOB = uintptr
  46234 
  46235 type tagCLIPDATA = struct {
  46236 	FcbSize    ULONG
  46237 	FulClipFmt LONG
  46238 	FpClipData uintptr
  46239 }
  46240 
  46241 type CLIPDATA = tagCLIPDATA
  46242 
  46243 type VARTYPE = uint16
  46244 
  46245 type PROPID = ULONG
  46246 
  46247 type _tagpropertykey = struct {
  46248 	Ffmtid GUID
  46249 	Fpid   DWORD
  46250 }
  46251 
  46252 type PROPERTYKEY = _tagpropertykey
  46253 
  46254 type tagCSPLATFORM = struct {
  46255 	FdwPlatformId    DWORD
  46256 	FdwVersionHi     DWORD
  46257 	FdwVersionLo     DWORD
  46258 	FdwProcessorArch DWORD
  46259 }
  46260 
  46261 type CSPLATFORM = tagCSPLATFORM
  46262 
  46263 type tagQUERYCONTEXT = struct {
  46264 	FdwContext   DWORD
  46265 	FPlatform    CSPLATFORM
  46266 	FLocale      LCID
  46267 	FdwVersionHi DWORD
  46268 	FdwVersionLo DWORD
  46269 }
  46270 
  46271 type QUERYCONTEXT = tagQUERYCONTEXT
  46272 
  46273 type TYSPEC = uint32
  46274 
  46275 type __WIDL_wtypes_generated_name_00000001 = struct {
  46276 	Ftyspec       DWORD
  46277 	F__ccgo_pad1  [4]byte
  46278 	Ftagged_union struct {
  46279 		F__ccgo_pad1 [0]uint64
  46280 		Fclsid       CLSID
  46281 		F__ccgo_pad2 [16]byte
  46282 	}
  46283 }
  46284 
  46285 type UCLSSPEC = __WIDL_wtypes_generated_name_00000001
  46286 
  46287 type LPMALLOCSPY = uintptr
  46288 type IMallocSpyVtbl1 = struct {
  46289 	FQueryInterface   uintptr
  46290 	FAddRef           uintptr
  46291 	FRelease          uintptr
  46292 	FPreAlloc         uintptr
  46293 	FPostAlloc        uintptr
  46294 	FPreFree          uintptr
  46295 	FPostFree         uintptr
  46296 	FPreRealloc       uintptr
  46297 	FPostRealloc      uintptr
  46298 	FPreGetSize       uintptr
  46299 	FPostGetSize      uintptr
  46300 	FPreDidAlloc      uintptr
  46301 	FPostDidAlloc     uintptr
  46302 	FPreHeapMinimize  uintptr
  46303 	FPostHeapMinimize uintptr
  46304 }
  46305 
  46306 type IMallocSpyVtbl = IMallocSpyVtbl1
  46307 
  46308 type LPBC = uintptr
  46309 type LPBINDCTX = uintptr
  46310 type tagBIND_OPTS = struct {
  46311 	FcbStruct            DWORD
  46312 	FgrfFlags            DWORD
  46313 	FgrfMode             DWORD
  46314 	FdwTickCountDeadline DWORD
  46315 }
  46316 
  46317 type BIND_OPTS = tagBIND_OPTS
  46318 type LPBIND_OPTS = uintptr
  46319 type tagBIND_OPTS2 = struct {
  46320 	FcbStruct            DWORD
  46321 	FgrfFlags            DWORD
  46322 	FgrfMode             DWORD
  46323 	FdwTickCountDeadline DWORD
  46324 	FdwTrackFlags        DWORD
  46325 	FdwClassContext      DWORD
  46326 	Flocale              LCID
  46327 	F__ccgo_pad1         [4]byte
  46328 	FpServerInfo         uintptr
  46329 }
  46330 
  46331 type BIND_OPTS2 = tagBIND_OPTS2
  46332 type LPBIND_OPTS2 = uintptr
  46333 type tagBIND_OPTS3 = struct {
  46334 	FcbStruct            DWORD
  46335 	FgrfFlags            DWORD
  46336 	FgrfMode             DWORD
  46337 	FdwTickCountDeadline DWORD
  46338 	FdwTrackFlags        DWORD
  46339 	FdwClassContext      DWORD
  46340 	Flocale              LCID
  46341 	F__ccgo_pad1         [4]byte
  46342 	FpServerInfo         uintptr
  46343 	Fhwnd                HWND
  46344 }
  46345 
  46346 type BIND_OPTS3 = tagBIND_OPTS3
  46347 type LPBIND_OPTS3 = uintptr
  46348 type BIND_FLAGS = uint32
  46349 type IBindCtxVtbl1 = struct {
  46350 	FQueryInterface        uintptr
  46351 	FAddRef                uintptr
  46352 	FRelease               uintptr
  46353 	FRegisterObjectBound   uintptr
  46354 	FRevokeObjectBound     uintptr
  46355 	FReleaseBoundObjects   uintptr
  46356 	FSetBindOptions        uintptr
  46357 	FGetBindOptions        uintptr
  46358 	FGetRunningObjectTable uintptr
  46359 	FRegisterObjectParam   uintptr
  46360 	FGetObjectParam        uintptr
  46361 	FEnumObjectParam       uintptr
  46362 	FRevokeObjectParam     uintptr
  46363 }
  46364 
  46365 type IBindCtxVtbl = IBindCtxVtbl1
  46366 
  46367 type LPENUMMONIKER = uintptr
  46368 type IEnumMonikerVtbl1 = struct {
  46369 	FQueryInterface uintptr
  46370 	FAddRef         uintptr
  46371 	FRelease        uintptr
  46372 	FNext           uintptr
  46373 	FSkip           uintptr
  46374 	FReset          uintptr
  46375 	FClone          uintptr
  46376 }
  46377 
  46378 type IEnumMonikerVtbl = IEnumMonikerVtbl1
  46379 
  46380 type LPRUNNABLEOBJECT = uintptr
  46381 type IRunnableObjectVtbl1 = struct {
  46382 	FQueryInterface     uintptr
  46383 	FAddRef             uintptr
  46384 	FRelease            uintptr
  46385 	FGetRunningClass    uintptr
  46386 	FRun                uintptr
  46387 	FIsRunning          uintptr
  46388 	FLockRunning        uintptr
  46389 	FSetContainedObject uintptr
  46390 }
  46391 
  46392 type IRunnableObjectVtbl = IRunnableObjectVtbl1
  46393 
  46394 type LPRUNNINGOBJECTTABLE = uintptr
  46395 type IRunningObjectTableVtbl1 = struct {
  46396 	FQueryInterface      uintptr
  46397 	FAddRef              uintptr
  46398 	FRelease             uintptr
  46399 	FRegister            uintptr
  46400 	FRevoke              uintptr
  46401 	FIsRunning           uintptr
  46402 	FGetObjectA          uintptr
  46403 	FNoteChangeTime      uintptr
  46404 	FGetTimeOfLastChange uintptr
  46405 	FEnumRunning         uintptr
  46406 }
  46407 
  46408 type IRunningObjectTableVtbl = IRunningObjectTableVtbl1
  46409 
  46410 type LPPERSIST = uintptr
  46411 type IPersistVtbl1 = struct {
  46412 	FQueryInterface uintptr
  46413 	FAddRef         uintptr
  46414 	FRelease        uintptr
  46415 	FGetClassID     uintptr
  46416 }
  46417 
  46418 type IPersistVtbl = IPersistVtbl1
  46419 
  46420 type LPPERSISTSTREAM = uintptr
  46421 type IPersistStreamVtbl1 = struct {
  46422 	FQueryInterface uintptr
  46423 	FAddRef         uintptr
  46424 	FRelease        uintptr
  46425 	FGetClassID     uintptr
  46426 	FIsDirty        uintptr
  46427 	FLoad           uintptr
  46428 	FSave           uintptr
  46429 	FGetSizeMax     uintptr
  46430 }
  46431 
  46432 type IPersistStreamVtbl = IPersistStreamVtbl1
  46433 
  46434 type LPMONIKER = uintptr
  46435 type MKSYS = uint32
  46436 type MKRREDUCE = uint32
  46437 type IMonikerVtbl1 = struct {
  46438 	FQueryInterface      uintptr
  46439 	FAddRef              uintptr
  46440 	FRelease             uintptr
  46441 	FGetClassID          uintptr
  46442 	FIsDirty             uintptr
  46443 	FLoad                uintptr
  46444 	FSave                uintptr
  46445 	FGetSizeMax          uintptr
  46446 	FBindToObject        uintptr
  46447 	FBindToStorage       uintptr
  46448 	FReduce              uintptr
  46449 	FComposeWith         uintptr
  46450 	FEnum                uintptr
  46451 	FIsEqual             uintptr
  46452 	FHash                uintptr
  46453 	FIsRunning           uintptr
  46454 	FGetTimeOfLastChange uintptr
  46455 	FInverse             uintptr
  46456 	FCommonPrefixWith    uintptr
  46457 	FRelativePathTo      uintptr
  46458 	FGetDisplayName      uintptr
  46459 	FParseDisplayName    uintptr
  46460 	FIsSystemMoniker     uintptr
  46461 }
  46462 
  46463 type IMonikerVtbl = IMonikerVtbl1
  46464 type IROTDataVtbl1 = struct {
  46465 	FQueryInterface    uintptr
  46466 	FAddRef            uintptr
  46467 	FRelease           uintptr
  46468 	FGetComparisonData uintptr
  46469 }
  46470 
  46471 type IROTDataVtbl = IROTDataVtbl1
  46472 
  46473 type LPENUMSTATSTG = uintptr
  46474 type IEnumSTATSTGVtbl1 = struct {
  46475 	FQueryInterface uintptr
  46476 	FAddRef         uintptr
  46477 	FRelease        uintptr
  46478 	FNext           uintptr
  46479 	FSkip           uintptr
  46480 	FReset          uintptr
  46481 	FClone          uintptr
  46482 }
  46483 
  46484 type IEnumSTATSTGVtbl = IEnumSTATSTGVtbl1
  46485 
  46486 type LPSTORAGE = uintptr
  46487 type tagRemSNB = struct {
  46488 	FulCntStr    ULONG
  46489 	FulCntChar   ULONG
  46490 	FrgString    [1]OLECHAR
  46491 	F__ccgo_pad1 [2]byte
  46492 }
  46493 
  46494 type RemSNB = tagRemSNB
  46495 type WireSNB = uintptr
  46496 type SNB = uintptr
  46497 type IStorageVtbl1 = struct {
  46498 	FQueryInterface  uintptr
  46499 	FAddRef          uintptr
  46500 	FRelease         uintptr
  46501 	FCreateStream    uintptr
  46502 	FOpenStream      uintptr
  46503 	FCreateStorage   uintptr
  46504 	FOpenStorage     uintptr
  46505 	FCopyTo          uintptr
  46506 	FMoveElementTo   uintptr
  46507 	FCommit          uintptr
  46508 	FRevert          uintptr
  46509 	FEnumElements    uintptr
  46510 	FDestroyElement  uintptr
  46511 	FRenameElement   uintptr
  46512 	FSetElementTimes uintptr
  46513 	FSetClass        uintptr
  46514 	FSetStateBits    uintptr
  46515 	FStat            uintptr
  46516 }
  46517 
  46518 type IStorageVtbl = IStorageVtbl1
  46519 
  46520 type LPPERSISTFILE = uintptr
  46521 type IPersistFileVtbl1 = struct {
  46522 	FQueryInterface uintptr
  46523 	FAddRef         uintptr
  46524 	FRelease        uintptr
  46525 	FGetClassID     uintptr
  46526 	FIsDirty        uintptr
  46527 	FLoad           uintptr
  46528 	FSave           uintptr
  46529 	FSaveCompleted  uintptr
  46530 	FGetCurFile     uintptr
  46531 }
  46532 
  46533 type IPersistFileVtbl = IPersistFileVtbl1
  46534 
  46535 type LPPERSISTSTORAGE = uintptr
  46536 type IPersistStorageVtbl1 = struct {
  46537 	FQueryInterface  uintptr
  46538 	FAddRef          uintptr
  46539 	FRelease         uintptr
  46540 	FGetClassID      uintptr
  46541 	FIsDirty         uintptr
  46542 	FInitNew         uintptr
  46543 	FLoad            uintptr
  46544 	FSave            uintptr
  46545 	FSaveCompleted   uintptr
  46546 	FHandsOffStorage uintptr
  46547 }
  46548 
  46549 type IPersistStorageVtbl = IPersistStorageVtbl1
  46550 
  46551 type LPLOCKBYTES = uintptr
  46552 type ILockBytesVtbl1 = struct {
  46553 	FQueryInterface uintptr
  46554 	FAddRef         uintptr
  46555 	FRelease        uintptr
  46556 	FReadAt         uintptr
  46557 	FWriteAt        uintptr
  46558 	FFlush          uintptr
  46559 	FSetSize        uintptr
  46560 	FLockRegion     uintptr
  46561 	FUnlockRegion   uintptr
  46562 	FStat           uintptr
  46563 }
  46564 
  46565 type ILockBytesVtbl = ILockBytesVtbl1
  46566 
  46567 type LPENUMFORMATETC = uintptr
  46568 type tagDVTARGETDEVICE = struct {
  46569 	FtdSize             DWORD
  46570 	FtdDriverNameOffset WORD
  46571 	FtdDeviceNameOffset WORD
  46572 	FtdPortNameOffset   WORD
  46573 	FtdExtDevmodeOffset WORD
  46574 	FtdData             [1]BYTE
  46575 	F__ccgo_pad1        [3]byte
  46576 }
  46577 
  46578 type DVTARGETDEVICE = tagDVTARGETDEVICE
  46579 type LPCLIPFORMAT = uintptr
  46580 type tagFORMATETC = struct {
  46581 	FcfFormat    CLIPFORMAT
  46582 	F__ccgo_pad1 [6]byte
  46583 	Fptd         uintptr
  46584 	FdwAspect    DWORD
  46585 	Flindex      LONG
  46586 	Ftymed       DWORD
  46587 	F__ccgo_pad2 [4]byte
  46588 }
  46589 
  46590 type FORMATETC = tagFORMATETC
  46591 type LPFORMATETC = uintptr
  46592 type IEnumFORMATETCVtbl1 = struct {
  46593 	FQueryInterface uintptr
  46594 	FAddRef         uintptr
  46595 	FRelease        uintptr
  46596 	FNext           uintptr
  46597 	FSkip           uintptr
  46598 	FReset          uintptr
  46599 	FClone          uintptr
  46600 }
  46601 
  46602 type IEnumFORMATETCVtbl = IEnumFORMATETCVtbl1
  46603 
  46604 type LPENUMSTATDATA = uintptr
  46605 type ADVF = uint32
  46606 type tagSTATDATA = struct {
  46607 	Fformatetc    FORMATETC
  46608 	Fadvf         DWORD
  46609 	F__ccgo_pad1  [4]byte
  46610 	FpAdvSink     uintptr
  46611 	FdwConnection DWORD
  46612 	F__ccgo_pad2  [4]byte
  46613 }
  46614 
  46615 type STATDATA = tagSTATDATA
  46616 type LPSTATDATA = uintptr
  46617 type IEnumSTATDATAVtbl1 = struct {
  46618 	FQueryInterface uintptr
  46619 	FAddRef         uintptr
  46620 	FRelease        uintptr
  46621 	FNext           uintptr
  46622 	FSkip           uintptr
  46623 	FReset          uintptr
  46624 	FClone          uintptr
  46625 }
  46626 
  46627 type IEnumSTATDATAVtbl = IEnumSTATDATAVtbl1
  46628 
  46629 type LPROOTSTORAGE = uintptr
  46630 type IRootStorageVtbl1 = struct {
  46631 	FQueryInterface uintptr
  46632 	FAddRef         uintptr
  46633 	FRelease        uintptr
  46634 	FSwitchToFile   uintptr
  46635 }
  46636 
  46637 type IRootStorageVtbl = IRootStorageVtbl1
  46638 
  46639 type LPADVISESINK = uintptr
  46640 type TYMED = uint32
  46641 type tagRemSTGMEDIUM = struct {
  46642 	Ftymed          DWORD
  46643 	FdwHandleType   DWORD
  46644 	FpData          ULONG
  46645 	FpUnkForRelease ULONG
  46646 	FcbData         ULONG
  46647 	Fdata           [1]Byte
  46648 	F__ccgo_pad1    [3]byte
  46649 }
  46650 
  46651 type RemSTGMEDIUM = tagRemSTGMEDIUM
  46652 type tagSTGMEDIUM = struct {
  46653 	Ftymed          DWORD
  46654 	F__ccgo_pad1    [4]byte
  46655 	Fu              struct{ FhBitmap HBITMAP }
  46656 	FpUnkForRelease uintptr
  46657 }
  46658 
  46659 type USTGMEDIUM = tagSTGMEDIUM
  46660 type _GDI_OBJECT = struct {
  46661 	FObjectType  DWORD
  46662 	F__ccgo_pad1 [4]byte
  46663 	Fu           struct{ FhBitmap WireHBITMAP }
  46664 }
  46665 
  46666 type GDI_OBJECT = _GDI_OBJECT
  46667 type _userSTGMEDIUM = struct {
  46668 	Fu struct {
  46669 		Ftymed       DWORD
  46670 		F__ccgo_pad1 [4]byte
  46671 		Fu           struct{ FhMetaFilePict WireHMETAFILEPICT }
  46672 	}
  46673 	FpUnkForRelease uintptr
  46674 }
  46675 
  46676 type _STGMEDIUM_UNION = struct {
  46677 	Ftymed       DWORD
  46678 	F__ccgo_pad1 [4]byte
  46679 	Fu           struct{ FhMetaFilePict WireHMETAFILEPICT }
  46680 }
  46681 
  46682 type UserSTGMEDIUM = _userSTGMEDIUM
  46683 type WireSTGMEDIUM = uintptr
  46684 type STGMEDIUM = USTGMEDIUM
  46685 type WireASYNC_STGMEDIUM = uintptr
  46686 type ASYNC_STGMEDIUM = STGMEDIUM
  46687 type LPSTGMEDIUM = uintptr
  46688 type _userFLAG_STGMEDIUM = struct {
  46689 	FContextFlags   LONG
  46690 	FfPassOwnership LONG
  46691 	FStgmed         UserSTGMEDIUM
  46692 }
  46693 
  46694 type UserFLAG_STGMEDIUM = _userFLAG_STGMEDIUM
  46695 type WireFLAG_STGMEDIUM = uintptr
  46696 type _FLAG_STGMEDIUM = struct {
  46697 	FContextFlags   LONG
  46698 	FfPassOwnership LONG
  46699 	FStgmed         STGMEDIUM
  46700 }
  46701 
  46702 type FLAG_STGMEDIUM = _FLAG_STGMEDIUM
  46703 type IAdviseSinkVtbl1 = struct {
  46704 	FQueryInterface uintptr
  46705 	FAddRef         uintptr
  46706 	FRelease        uintptr
  46707 	FOnDataChange   uintptr
  46708 	FOnViewChange   uintptr
  46709 	FOnRename       uintptr
  46710 	FOnSave         uintptr
  46711 	FOnClose        uintptr
  46712 }
  46713 
  46714 type IAdviseSinkVtbl = IAdviseSinkVtbl1
  46715 type AsyncIAdviseSinkVtbl1 = struct {
  46716 	FQueryInterface      uintptr
  46717 	FAddRef              uintptr
  46718 	FRelease             uintptr
  46719 	FBegin_OnDataChange  uintptr
  46720 	FFinish_OnDataChange uintptr
  46721 	FBegin_OnViewChange  uintptr
  46722 	FFinish_OnViewChange uintptr
  46723 	FBegin_OnRename      uintptr
  46724 	FFinish_OnRename     uintptr
  46725 	FBegin_OnSave        uintptr
  46726 	FFinish_OnSave       uintptr
  46727 	FBegin_OnClose       uintptr
  46728 	FFinish_OnClose      uintptr
  46729 }
  46730 
  46731 type AsyncIAdviseSinkVtbl = AsyncIAdviseSinkVtbl1
  46732 
  46733 type LPADVISESINK2 = uintptr
  46734 type IAdviseSink2Vtbl1 = struct {
  46735 	FQueryInterface  uintptr
  46736 	FAddRef          uintptr
  46737 	FRelease         uintptr
  46738 	FOnDataChange    uintptr
  46739 	FOnViewChange    uintptr
  46740 	FOnRename        uintptr
  46741 	FOnSave          uintptr
  46742 	FOnClose         uintptr
  46743 	FOnLinkSrcChange uintptr
  46744 }
  46745 
  46746 type IAdviseSink2Vtbl = IAdviseSink2Vtbl1
  46747 type AsyncIAdviseSink2Vtbl1 = struct {
  46748 	FQueryInterface         uintptr
  46749 	FAddRef                 uintptr
  46750 	FRelease                uintptr
  46751 	FBegin_OnDataChange     uintptr
  46752 	FFinish_OnDataChange    uintptr
  46753 	FBegin_OnViewChange     uintptr
  46754 	FFinish_OnViewChange    uintptr
  46755 	FBegin_OnRename         uintptr
  46756 	FFinish_OnRename        uintptr
  46757 	FBegin_OnSave           uintptr
  46758 	FFinish_OnSave          uintptr
  46759 	FBegin_OnClose          uintptr
  46760 	FFinish_OnClose         uintptr
  46761 	FBegin_OnLinkSrcChange  uintptr
  46762 	FFinish_OnLinkSrcChange uintptr
  46763 }
  46764 
  46765 type AsyncIAdviseSink2Vtbl = AsyncIAdviseSink2Vtbl1
  46766 
  46767 type LPDATAOBJECT = uintptr
  46768 type DATADIR = uint32
  46769 type IDataObjectVtbl1 = struct {
  46770 	FQueryInterface        uintptr
  46771 	FAddRef                uintptr
  46772 	FRelease               uintptr
  46773 	FGetData               uintptr
  46774 	FGetDataHere           uintptr
  46775 	FQueryGetData          uintptr
  46776 	FGetCanonicalFormatEtc uintptr
  46777 	FSetData               uintptr
  46778 	FEnumFormatEtc         uintptr
  46779 	FDAdvise               uintptr
  46780 	FDUnadvise             uintptr
  46781 	FEnumDAdvise           uintptr
  46782 }
  46783 
  46784 type IDataObjectVtbl = IDataObjectVtbl1
  46785 
  46786 type LPDATAADVISEHOLDER = uintptr
  46787 type IDataAdviseHolderVtbl1 = struct {
  46788 	FQueryInterface   uintptr
  46789 	FAddRef           uintptr
  46790 	FRelease          uintptr
  46791 	FAdvise           uintptr
  46792 	FUnadvise         uintptr
  46793 	FEnumAdvise       uintptr
  46794 	FSendOnDataChange uintptr
  46795 }
  46796 
  46797 type IDataAdviseHolderVtbl = IDataAdviseHolderVtbl1
  46798 
  46799 type LPMESSAGEFILTER = uintptr
  46800 type CALLTYPE = uint32
  46801 type SERVERCALL = uint32
  46802 type PENDINGTYPE = uint32
  46803 type PENDINGMSG = uint32
  46804 type tagINTERFACEINFO = struct {
  46805 	FpUnk        uintptr
  46806 	Fiid         IID
  46807 	FwMethod     WORD
  46808 	F__ccgo_pad1 [6]byte
  46809 }
  46810 
  46811 type INTERFACEINFO = tagINTERFACEINFO
  46812 type LPINTERFACEINFO = uintptr
  46813 type IMessageFilterVtbl1 = struct {
  46814 	FQueryInterface     uintptr
  46815 	FAddRef             uintptr
  46816 	FRelease            uintptr
  46817 	FHandleInComingCall uintptr
  46818 	FRetryRejectedCall  uintptr
  46819 	FMessagePending     uintptr
  46820 }
  46821 
  46822 type IMessageFilterVtbl = IMessageFilterVtbl1
  46823 type IClassActivatorVtbl1 = struct {
  46824 	FQueryInterface uintptr
  46825 	FAddRef         uintptr
  46826 	FRelease        uintptr
  46827 	FGetClassObject uintptr
  46828 }
  46829 
  46830 type IClassActivatorVtbl = IClassActivatorVtbl1
  46831 type IFillLockBytesVtbl1 = struct {
  46832 	FQueryInterface uintptr
  46833 	FAddRef         uintptr
  46834 	FRelease        uintptr
  46835 	FFillAppend     uintptr
  46836 	FFillAt         uintptr
  46837 	FSetFillSize    uintptr
  46838 	FTerminate      uintptr
  46839 }
  46840 
  46841 type IFillLockBytesVtbl = IFillLockBytesVtbl1
  46842 type IProgressNotifyVtbl1 = struct {
  46843 	FQueryInterface uintptr
  46844 	FAddRef         uintptr
  46845 	FRelease        uintptr
  46846 	FOnProgress     uintptr
  46847 }
  46848 
  46849 type IProgressNotifyVtbl = IProgressNotifyVtbl1
  46850 
  46851 type tagStorageLayout = struct {
  46852 	FLayoutType      DWORD
  46853 	F__ccgo_pad1     [4]byte
  46854 	FpwcsElementName uintptr
  46855 	FcOffset         LARGE_INTEGER
  46856 	FcBytes          LARGE_INTEGER
  46857 }
  46858 
  46859 type StorageLayout = tagStorageLayout
  46860 type ILayoutStorageVtbl1 = struct {
  46861 	FQueryInterface              uintptr
  46862 	FAddRef                      uintptr
  46863 	FRelease                     uintptr
  46864 	FLayoutScript                uintptr
  46865 	FBeginMonitor                uintptr
  46866 	FEndMonitor                  uintptr
  46867 	FReLayoutDocfile             uintptr
  46868 	FReLayoutDocfileOnILockBytes uintptr
  46869 }
  46870 
  46871 type ILayoutStorageVtbl = ILayoutStorageVtbl1
  46872 type IBlockingLockVtbl1 = struct {
  46873 	FQueryInterface uintptr
  46874 	FAddRef         uintptr
  46875 	FRelease        uintptr
  46876 	FLock           uintptr
  46877 	FUnlock         uintptr
  46878 }
  46879 
  46880 type IBlockingLockVtbl = IBlockingLockVtbl1
  46881 type ITimeAndNoticeControlVtbl1 = struct {
  46882 	FQueryInterface  uintptr
  46883 	FAddRef          uintptr
  46884 	FRelease         uintptr
  46885 	FSuppressChanges uintptr
  46886 }
  46887 
  46888 type ITimeAndNoticeControlVtbl = ITimeAndNoticeControlVtbl1
  46889 type IOplockStorageVtbl1 = struct {
  46890 	FQueryInterface  uintptr
  46891 	FAddRef          uintptr
  46892 	FRelease         uintptr
  46893 	FCreateStorageEx uintptr
  46894 	FOpenStorageEx   uintptr
  46895 }
  46896 
  46897 type IOplockStorageVtbl = IOplockStorageVtbl1
  46898 type IDirectWriterLockVtbl1 = struct {
  46899 	FQueryInterface     uintptr
  46900 	FAddRef             uintptr
  46901 	FRelease            uintptr
  46902 	FWaitForWriteAccess uintptr
  46903 	FReleaseWriteAccess uintptr
  46904 	FHaveWriteAccess    uintptr
  46905 }
  46906 
  46907 type IDirectWriterLockVtbl = IDirectWriterLockVtbl1
  46908 type IUrlMonVtbl1 = struct {
  46909 	FQueryInterface    uintptr
  46910 	FAddRef            uintptr
  46911 	FRelease           uintptr
  46912 	FAsyncGetClassBits uintptr
  46913 }
  46914 
  46915 type IUrlMonVtbl = IUrlMonVtbl1
  46916 type IForegroundTransferVtbl1 = struct {
  46917 	FQueryInterface          uintptr
  46918 	FAddRef                  uintptr
  46919 	FRelease                 uintptr
  46920 	FAllowForegroundTransfer uintptr
  46921 }
  46922 
  46923 type IForegroundTransferVtbl = IForegroundTransferVtbl1
  46924 type IThumbnailExtractorVtbl1 = struct {
  46925 	FQueryInterface   uintptr
  46926 	FAddRef           uintptr
  46927 	FRelease          uintptr
  46928 	FExtractThumbnail uintptr
  46929 	FOnFileUpdated    uintptr
  46930 }
  46931 
  46932 type IThumbnailExtractorVtbl = IThumbnailExtractorVtbl1
  46933 type IDummyHICONIncluderVtbl1 = struct {
  46934 	FQueryInterface uintptr
  46935 	FAddRef         uintptr
  46936 	FRelease        uintptr
  46937 	FDummy          uintptr
  46938 }
  46939 
  46940 type IDummyHICONIncluderVtbl = IDummyHICONIncluderVtbl1
  46941 
  46942 type ApplicationType = uint32
  46943 type ShutdownType = uint32
  46944 type IProcessLockVtbl1 = struct {
  46945 	FQueryInterface      uintptr
  46946 	FAddRef              uintptr
  46947 	FRelease             uintptr
  46948 	FAddRefOnProcess     uintptr
  46949 	FReleaseRefOnProcess uintptr
  46950 }
  46951 
  46952 type IProcessLockVtbl = IProcessLockVtbl1
  46953 type ISurrogateServiceVtbl1 = struct {
  46954 	FQueryInterface    uintptr
  46955 	FAddRef            uintptr
  46956 	FRelease           uintptr
  46957 	FInit              uintptr
  46958 	FApplicationLaunch uintptr
  46959 	FApplicationFree   uintptr
  46960 	FCatalogRefresh    uintptr
  46961 	FProcessShutdown   uintptr
  46962 }
  46963 
  46964 type ISurrogateServiceVtbl = ISurrogateServiceVtbl1
  46965 
  46966 type LPINITIALIZESPY = uintptr
  46967 type IInitializeSpyVtbl1 = struct {
  46968 	FQueryInterface   uintptr
  46969 	FAddRef           uintptr
  46970 	FRelease          uintptr
  46971 	FPreInitialize    uintptr
  46972 	FPostInitialize   uintptr
  46973 	FPreUninitialize  uintptr
  46974 	FPostUninitialize uintptr
  46975 }
  46976 
  46977 type IInitializeSpyVtbl = IInitializeSpyVtbl1
  46978 type IApartmentShutdownVtbl1 = struct {
  46979 	FQueryInterface uintptr
  46980 	FAddRef         uintptr
  46981 	FRelease        uintptr
  46982 	FOnUninitialize uintptr
  46983 }
  46984 
  46985 type IApartmentShutdownVtbl = IApartmentShutdownVtbl1
  46986 
  46987 type COMSD = uint32
  46988 
  46989 type tagSTGOPTIONS = struct {
  46990 	FusVersion        USHORT
  46991 	Freserved         USHORT
  46992 	FulSectorSize     ULONG
  46993 	FpwcsTemplateFile uintptr
  46994 }
  46995 
  46996 type STGOPTIONS = tagSTGOPTIONS
  46997 
  46998 type IPersistMoniker1 = struct{ FlpVtbl uintptr }
  46999 
  47000 type IPersistMoniker = IPersistMoniker1
  47001 
  47002 type IMonikerProp1 = struct{ FlpVtbl uintptr }
  47003 
  47004 type IMonikerProp = IMonikerProp1
  47005 
  47006 type IBindProtocol1 = struct{ FlpVtbl uintptr }
  47007 
  47008 type IBindProtocol = IBindProtocol1
  47009 
  47010 type IBinding1 = struct{ FlpVtbl uintptr }
  47011 
  47012 type IBinding = IBinding1
  47013 
  47014 type IBindStatusCallback1 = struct{ FlpVtbl uintptr }
  47015 
  47016 type IBindStatusCallback = IBindStatusCallback1
  47017 
  47018 type IBindStatusCallbackEx1 = struct{ FlpVtbl uintptr }
  47019 
  47020 type IBindStatusCallbackEx = IBindStatusCallbackEx1
  47021 
  47022 type IAuthenticate1 = struct{ FlpVtbl uintptr }
  47023 
  47024 type IAuthenticate = IAuthenticate1
  47025 
  47026 type IAuthenticateEx1 = struct{ FlpVtbl uintptr }
  47027 
  47028 type IAuthenticateEx = IAuthenticateEx1
  47029 
  47030 type IHttpNegotiate1 = struct{ FlpVtbl uintptr }
  47031 
  47032 type IHttpNegotiate = IHttpNegotiate1
  47033 
  47034 type IHttpNegotiate21 = struct{ FlpVtbl uintptr }
  47035 
  47036 type IHttpNegotiate2 = IHttpNegotiate21
  47037 
  47038 type IHttpNegotiate31 = struct{ FlpVtbl uintptr }
  47039 
  47040 type IHttpNegotiate3 = IHttpNegotiate31
  47041 
  47042 type IWinInetFileStream1 = struct{ FlpVtbl uintptr }
  47043 
  47044 type IWinInetFileStream = IWinInetFileStream1
  47045 
  47046 type IWindowForBindingUI1 = struct{ FlpVtbl uintptr }
  47047 
  47048 type IWindowForBindingUI = IWindowForBindingUI1
  47049 
  47050 type ICodeInstall1 = struct{ FlpVtbl uintptr }
  47051 
  47052 type ICodeInstall = ICodeInstall1
  47053 
  47054 type IWinInetInfo1 = struct{ FlpVtbl uintptr }
  47055 
  47056 type IWinInetInfo = IWinInetInfo1
  47057 
  47058 type IHttpSecurity1 = struct{ FlpVtbl uintptr }
  47059 
  47060 type IHttpSecurity = IHttpSecurity1
  47061 
  47062 type IWinInetHttpInfo1 = struct{ FlpVtbl uintptr }
  47063 
  47064 type IWinInetHttpInfo = IWinInetHttpInfo1
  47065 
  47066 type IWinInetHttpTimeouts1 = struct{ FlpVtbl uintptr }
  47067 
  47068 type IWinInetHttpTimeouts = IWinInetHttpTimeouts1
  47069 
  47070 type IBindHost1 = struct{ FlpVtbl uintptr }
  47071 
  47072 type IBindHost = IBindHost1
  47073 
  47074 type IInternet1 = struct{ FlpVtbl uintptr }
  47075 
  47076 type IInternet = IInternet1
  47077 
  47078 type IInternetBindInfo1 = struct{ FlpVtbl uintptr }
  47079 
  47080 type IInternetBindInfo = IInternetBindInfo1
  47081 
  47082 type IInternetBindInfoEx1 = struct{ FlpVtbl uintptr }
  47083 
  47084 type IInternetBindInfoEx = IInternetBindInfoEx1
  47085 
  47086 type IInternetProtocolRoot1 = struct{ FlpVtbl uintptr }
  47087 
  47088 type IInternetProtocolRoot = IInternetProtocolRoot1
  47089 
  47090 type IInternetProtocol1 = struct{ FlpVtbl uintptr }
  47091 
  47092 type IInternetProtocol = IInternetProtocol1
  47093 
  47094 type IInternetProtocolSink1 = struct{ FlpVtbl uintptr }
  47095 
  47096 type IInternetProtocolSink = IInternetProtocolSink1
  47097 
  47098 type IInternetProtocolSinkStackable1 = struct{ FlpVtbl uintptr }
  47099 
  47100 type IInternetProtocolSinkStackable = IInternetProtocolSinkStackable1
  47101 
  47102 type IInternetSession1 = struct{ FlpVtbl uintptr }
  47103 
  47104 type IInternetSession = IInternetSession1
  47105 
  47106 type IInternetThreadSwitch1 = struct{ FlpVtbl uintptr }
  47107 
  47108 type IInternetThreadSwitch = IInternetThreadSwitch1
  47109 
  47110 type IInternetPriority1 = struct{ FlpVtbl uintptr }
  47111 
  47112 type IInternetPriority = IInternetPriority1
  47113 
  47114 type IInternetProtocolInfo1 = struct{ FlpVtbl uintptr }
  47115 
  47116 type IInternetProtocolInfo = IInternetProtocolInfo1
  47117 
  47118 type IInternetSecurityMgrSite1 = struct{ FlpVtbl uintptr }
  47119 
  47120 type IInternetSecurityMgrSite = IInternetSecurityMgrSite1
  47121 
  47122 type IInternetSecurityManager1 = struct{ FlpVtbl uintptr }
  47123 
  47124 type IInternetSecurityManager = IInternetSecurityManager1
  47125 
  47126 type IInternetHostSecurityManager1 = struct{ FlpVtbl uintptr }
  47127 
  47128 type IInternetHostSecurityManager = IInternetHostSecurityManager1
  47129 
  47130 type IInternetZoneManager1 = struct{ FlpVtbl uintptr }
  47131 
  47132 type IInternetZoneManager = IInternetZoneManager1
  47133 
  47134 type ISoftDistExt1 = struct{ FlpVtbl uintptr }
  47135 
  47136 type ISoftDistExt = ISoftDistExt1
  47137 
  47138 type ICatalogFileInfo1 = struct{ FlpVtbl uintptr }
  47139 
  47140 type ICatalogFileInfo = ICatalogFileInfo1
  47141 
  47142 type IDataFilter1 = struct{ FlpVtbl uintptr }
  47143 
  47144 type IDataFilter = IDataFilter1
  47145 
  47146 type IEncodingFilterFactory1 = struct{ FlpVtbl uintptr }
  47147 
  47148 type IEncodingFilterFactory = IEncodingFilterFactory1
  47149 
  47150 type IWrappedProtocol1 = struct{ FlpVtbl uintptr }
  47151 
  47152 type IWrappedProtocol = IWrappedProtocol1
  47153 
  47154 type IGetBindHandle1 = struct{ FlpVtbl uintptr }
  47155 
  47156 type IGetBindHandle = IGetBindHandle1
  47157 
  47158 type IBindCallbackRedirect1 = struct{ FlpVtbl uintptr }
  47159 
  47160 type IBindCallbackRedirect = IBindCallbackRedirect1
  47161 
  47162 type IOleAdviseHolder1 = struct{ FlpVtbl uintptr }
  47163 
  47164 type IOleAdviseHolder = IOleAdviseHolder1
  47165 
  47166 type IOleCache1 = struct{ FlpVtbl uintptr }
  47167 
  47168 type IOleCache = IOleCache1
  47169 
  47170 type IOleCache21 = struct{ FlpVtbl uintptr }
  47171 
  47172 type IOleCache2 = IOleCache21
  47173 
  47174 type IOleCacheControl1 = struct{ FlpVtbl uintptr }
  47175 
  47176 type IOleCacheControl = IOleCacheControl1
  47177 
  47178 type IParseDisplayName1 = struct{ FlpVtbl uintptr }
  47179 
  47180 type IParseDisplayName = IParseDisplayName1
  47181 
  47182 type IOleContainer1 = struct{ FlpVtbl uintptr }
  47183 
  47184 type IOleContainer = IOleContainer1
  47185 
  47186 type IOleClientSite1 = struct{ FlpVtbl uintptr }
  47187 
  47188 type IOleClientSite = IOleClientSite1
  47189 
  47190 type IOleObject1 = struct{ FlpVtbl uintptr }
  47191 
  47192 type IOleObject = IOleObject1
  47193 
  47194 type IOleWindow1 = struct{ FlpVtbl uintptr }
  47195 
  47196 type IOleWindow = IOleWindow1
  47197 
  47198 type IOleLink1 = struct{ FlpVtbl uintptr }
  47199 
  47200 type IOleLink = IOleLink1
  47201 
  47202 type IOleItemContainer1 = struct{ FlpVtbl uintptr }
  47203 
  47204 type IOleItemContainer = IOleItemContainer1
  47205 
  47206 type IOleInPlaceUIWindow1 = struct{ FlpVtbl uintptr }
  47207 
  47208 type IOleInPlaceUIWindow = IOleInPlaceUIWindow1
  47209 
  47210 type IOleInPlaceActiveObject1 = struct{ FlpVtbl uintptr }
  47211 
  47212 type IOleInPlaceActiveObject = IOleInPlaceActiveObject1
  47213 
  47214 type IOleInPlaceFrame1 = struct{ FlpVtbl uintptr }
  47215 
  47216 type IOleInPlaceFrame = IOleInPlaceFrame1
  47217 
  47218 type IOleInPlaceObject1 = struct{ FlpVtbl uintptr }
  47219 
  47220 type IOleInPlaceObject = IOleInPlaceObject1
  47221 
  47222 type IOleInPlaceSite1 = struct{ FlpVtbl uintptr }
  47223 
  47224 type IOleInPlaceSite = IOleInPlaceSite1
  47225 
  47226 type IContinue1 = struct{ FlpVtbl uintptr }
  47227 
  47228 type IContinue = IContinue1
  47229 
  47230 type IViewObject1 = struct{ FlpVtbl uintptr }
  47231 
  47232 type IViewObject = IViewObject1
  47233 
  47234 type IViewObject21 = struct{ FlpVtbl uintptr }
  47235 
  47236 type IViewObject2 = IViewObject21
  47237 
  47238 type IDropSource1 = struct{ FlpVtbl uintptr }
  47239 
  47240 type IDropSource = IDropSource1
  47241 
  47242 type IDropTarget1 = struct{ FlpVtbl uintptr }
  47243 
  47244 type IDropTarget = IDropTarget1
  47245 
  47246 type IDropSourceNotify1 = struct{ FlpVtbl uintptr }
  47247 
  47248 type IDropSourceNotify = IDropSourceNotify1
  47249 
  47250 type IEnumOLEVERB1 = struct{ FlpVtbl uintptr }
  47251 
  47252 type IEnumOLEVERB = IEnumOLEVERB1
  47253 
  47254 type LPOLEADVISEHOLDER = uintptr
  47255 type IOleAdviseHolderVtbl1 = struct {
  47256 	FQueryInterface uintptr
  47257 	FAddRef         uintptr
  47258 	FRelease        uintptr
  47259 	FAdvise         uintptr
  47260 	FUnadvise       uintptr
  47261 	FEnumAdvise     uintptr
  47262 	FSendOnRename   uintptr
  47263 	FSendOnSave     uintptr
  47264 	FSendOnClose    uintptr
  47265 }
  47266 
  47267 type IOleAdviseHolderVtbl = IOleAdviseHolderVtbl1
  47268 
  47269 type LPOLECACHE = uintptr
  47270 type IOleCacheVtbl1 = struct {
  47271 	FQueryInterface uintptr
  47272 	FAddRef         uintptr
  47273 	FRelease        uintptr
  47274 	FCache          uintptr
  47275 	FUncache        uintptr
  47276 	FEnumCache      uintptr
  47277 	FInitCache      uintptr
  47278 	FSetData        uintptr
  47279 }
  47280 
  47281 type IOleCacheVtbl = IOleCacheVtbl1
  47282 
  47283 type LPOLECACHE2 = uintptr
  47284 
  47285 type DISCARDCACHE = uint32
  47286 type IOleCache2Vtbl1 = struct {
  47287 	FQueryInterface uintptr
  47288 	FAddRef         uintptr
  47289 	FRelease        uintptr
  47290 	FCache          uintptr
  47291 	FUncache        uintptr
  47292 	FEnumCache      uintptr
  47293 	FInitCache      uintptr
  47294 	FSetData        uintptr
  47295 	FUpdateCache    uintptr
  47296 	FDiscardCache   uintptr
  47297 }
  47298 
  47299 type IOleCache2Vtbl = IOleCache2Vtbl1
  47300 
  47301 type LPOLECACHECONTROL = uintptr
  47302 type IOleCacheControlVtbl1 = struct {
  47303 	FQueryInterface uintptr
  47304 	FAddRef         uintptr
  47305 	FRelease        uintptr
  47306 	FOnRun          uintptr
  47307 	FOnStop         uintptr
  47308 }
  47309 
  47310 type IOleCacheControlVtbl = IOleCacheControlVtbl1
  47311 
  47312 type LPPARSEDISPLAYNAME = uintptr
  47313 type IParseDisplayNameVtbl1 = struct {
  47314 	FQueryInterface   uintptr
  47315 	FAddRef           uintptr
  47316 	FRelease          uintptr
  47317 	FParseDisplayName uintptr
  47318 }
  47319 
  47320 type IParseDisplayNameVtbl = IParseDisplayNameVtbl1
  47321 
  47322 type LPOLECONTAINER = uintptr
  47323 type IOleContainerVtbl1 = struct {
  47324 	FQueryInterface   uintptr
  47325 	FAddRef           uintptr
  47326 	FRelease          uintptr
  47327 	FParseDisplayName uintptr
  47328 	FEnumObjects      uintptr
  47329 	FLockContainer    uintptr
  47330 }
  47331 
  47332 type IOleContainerVtbl = IOleContainerVtbl1
  47333 
  47334 type LPOLECLIENTSITE = uintptr
  47335 type IOleClientSiteVtbl1 = struct {
  47336 	FQueryInterface         uintptr
  47337 	FAddRef                 uintptr
  47338 	FRelease                uintptr
  47339 	FSaveObject             uintptr
  47340 	FGetMoniker             uintptr
  47341 	FGetContainer           uintptr
  47342 	FShowObject             uintptr
  47343 	FOnShowWindow           uintptr
  47344 	FRequestNewObjectLayout uintptr
  47345 }
  47346 
  47347 type IOleClientSiteVtbl = IOleClientSiteVtbl1
  47348 
  47349 type LPOLEOBJECT = uintptr
  47350 
  47351 type OLEGETMONIKER = uint32
  47352 
  47353 type OLEWHICHMK = uint32
  47354 
  47355 type USERCLASSTYPE = uint32
  47356 
  47357 type OLEMISC = uint32
  47358 type OLECLOSE = uint32
  47359 type IOleObjectVtbl1 = struct {
  47360 	FQueryInterface   uintptr
  47361 	FAddRef           uintptr
  47362 	FRelease          uintptr
  47363 	FSetClientSite    uintptr
  47364 	FGetClientSite    uintptr
  47365 	FSetHostNames     uintptr
  47366 	FClose            uintptr
  47367 	FSetMoniker       uintptr
  47368 	FGetMoniker       uintptr
  47369 	FInitFromData     uintptr
  47370 	FGetClipboardData uintptr
  47371 	FDoVerb           uintptr
  47372 	FEnumVerbs        uintptr
  47373 	FUpdate           uintptr
  47374 	FIsUpToDate       uintptr
  47375 	FGetUserClassID   uintptr
  47376 	FGetUserType      uintptr
  47377 	FSetExtent        uintptr
  47378 	FGetExtent        uintptr
  47379 	FAdvise           uintptr
  47380 	FUnadvise         uintptr
  47381 	FEnumAdvise       uintptr
  47382 	FGetMiscStatus    uintptr
  47383 	FSetColorScheme   uintptr
  47384 }
  47385 
  47386 type IOleObjectVtbl = IOleObjectVtbl1
  47387 type OLERENDER = uint32
  47388 
  47389 type LPOLERENDER = uintptr
  47390 
  47391 type tagOBJECTDESCRIPTOR = struct {
  47392 	FcbSize             ULONG
  47393 	Fclsid              CLSID
  47394 	FdwDrawAspect       DWORD
  47395 	Fsizel              SIZEL
  47396 	Fpointl             POINTL
  47397 	FdwStatus           DWORD
  47398 	FdwFullUserTypeName DWORD
  47399 	FdwSrcOfCopy        DWORD
  47400 }
  47401 
  47402 type OBJECTDESCRIPTOR = tagOBJECTDESCRIPTOR
  47403 type POBJECTDESCRIPTOR = uintptr
  47404 type LPOBJECTDESCRIPTOR = uintptr
  47405 type LINKSRCDESCRIPTOR = tagOBJECTDESCRIPTOR
  47406 type PLINKSRCDESCRIPTOR = uintptr
  47407 type LPLINKSRCDESCRIPTOR = uintptr
  47408 
  47409 type LPOLEWINDOW = uintptr
  47410 type IOleWindowVtbl1 = struct {
  47411 	FQueryInterface       uintptr
  47412 	FAddRef               uintptr
  47413 	FRelease              uintptr
  47414 	FGetWindow            uintptr
  47415 	FContextSensitiveHelp uintptr
  47416 }
  47417 
  47418 type IOleWindowVtbl = IOleWindowVtbl1
  47419 
  47420 type LPOLELINK = uintptr
  47421 
  47422 type OLEUPDATE = uint32
  47423 
  47424 type LPOLEUPDATE = uintptr
  47425 type POLEUPDATE = uintptr
  47426 
  47427 type OLELINKBIND = uint32
  47428 type IOleLinkVtbl1 = struct {
  47429 	FQueryInterface       uintptr
  47430 	FAddRef               uintptr
  47431 	FRelease              uintptr
  47432 	FSetUpdateOptions     uintptr
  47433 	FGetUpdateOptions     uintptr
  47434 	FSetSourceMoniker     uintptr
  47435 	FGetSourceMoniker     uintptr
  47436 	FSetSourceDisplayName uintptr
  47437 	FGetSourceDisplayName uintptr
  47438 	FBindToSource         uintptr
  47439 	FBindIfRunning        uintptr
  47440 	FGetBoundSource       uintptr
  47441 	FUnbindSource         uintptr
  47442 	FUpdate               uintptr
  47443 }
  47444 
  47445 type IOleLinkVtbl = IOleLinkVtbl1
  47446 
  47447 type LPOLEITEMCONTAINER = uintptr
  47448 
  47449 type BINDSPEED = uint32
  47450 
  47451 type OLECONTF = uint32
  47452 type IOleItemContainerVtbl1 = struct {
  47453 	FQueryInterface   uintptr
  47454 	FAddRef           uintptr
  47455 	FRelease          uintptr
  47456 	FParseDisplayName uintptr
  47457 	FEnumObjects      uintptr
  47458 	FLockContainer    uintptr
  47459 	FGetObjectA       uintptr
  47460 	FGetObjectStorage uintptr
  47461 	FIsRunning        uintptr
  47462 }
  47463 
  47464 type IOleItemContainerVtbl = IOleItemContainerVtbl1
  47465 
  47466 type LPOLEINPLACEUIWINDOW = uintptr
  47467 type BORDERWIDTHS = RECT
  47468 type LPBORDERWIDTHS = LPRECT
  47469 type LPCBORDERWIDTHS = LPCRECT
  47470 type IOleInPlaceUIWindowVtbl1 = struct {
  47471 	FQueryInterface       uintptr
  47472 	FAddRef               uintptr
  47473 	FRelease              uintptr
  47474 	FGetWindow            uintptr
  47475 	FContextSensitiveHelp uintptr
  47476 	FGetBorder            uintptr
  47477 	FRequestBorderSpace   uintptr
  47478 	FSetBorderSpace       uintptr
  47479 	FSetActiveObject      uintptr
  47480 }
  47481 
  47482 type IOleInPlaceUIWindowVtbl = IOleInPlaceUIWindowVtbl1
  47483 
  47484 type LPOLEINPLACEACTIVEOBJECT = uintptr
  47485 type IOleInPlaceActiveObjectVtbl1 = struct {
  47486 	FQueryInterface        uintptr
  47487 	FAddRef                uintptr
  47488 	FRelease               uintptr
  47489 	FGetWindow             uintptr
  47490 	FContextSensitiveHelp  uintptr
  47491 	FTranslateAcceleratorA uintptr
  47492 	FOnFrameWindowActivate uintptr
  47493 	FOnDocWindowActivate   uintptr
  47494 	FResizeBorder          uintptr
  47495 	FEnableModeless        uintptr
  47496 }
  47497 
  47498 type IOleInPlaceActiveObjectVtbl = IOleInPlaceActiveObjectVtbl1
  47499 
  47500 type LPOLEINPLACEFRAME = uintptr
  47501 
  47502 type tagOIFI = struct {
  47503 	Fcb            UINT
  47504 	FfMDIApp       WINBOOL
  47505 	FhwndFrame     HWND
  47506 	Fhaccel        HACCEL
  47507 	FcAccelEntries UINT
  47508 	F__ccgo_pad1   [4]byte
  47509 }
  47510 
  47511 type OLEINPLACEFRAMEINFO = tagOIFI
  47512 type LPOLEINPLACEFRAMEINFO = uintptr
  47513 
  47514 type tagOleMenuGroupWidths = struct{ Fwidth [6]LONG }
  47515 
  47516 type OLEMENUGROUPWIDTHS = tagOleMenuGroupWidths
  47517 type LPOLEMENUGROUPWIDTHS = uintptr
  47518 
  47519 type HOLEMENU = HGLOBAL
  47520 type IOleInPlaceFrameVtbl1 = struct {
  47521 	FQueryInterface        uintptr
  47522 	FAddRef                uintptr
  47523 	FRelease               uintptr
  47524 	FGetWindow             uintptr
  47525 	FContextSensitiveHelp  uintptr
  47526 	FGetBorder             uintptr
  47527 	FRequestBorderSpace    uintptr
  47528 	FSetBorderSpace        uintptr
  47529 	FSetActiveObject       uintptr
  47530 	FInsertMenus           uintptr
  47531 	FSetMenu               uintptr
  47532 	FRemoveMenus           uintptr
  47533 	FSetStatusText         uintptr
  47534 	FEnableModeless        uintptr
  47535 	FTranslateAcceleratorA uintptr
  47536 }
  47537 
  47538 type IOleInPlaceFrameVtbl = IOleInPlaceFrameVtbl1
  47539 
  47540 type LPOLEINPLACEOBJECT = uintptr
  47541 type IOleInPlaceObjectVtbl1 = struct {
  47542 	FQueryInterface       uintptr
  47543 	FAddRef               uintptr
  47544 	FRelease              uintptr
  47545 	FGetWindow            uintptr
  47546 	FContextSensitiveHelp uintptr
  47547 	FInPlaceDeactivate    uintptr
  47548 	FUIDeactivate         uintptr
  47549 	FSetObjectRects       uintptr
  47550 	FReactivateAndUndo    uintptr
  47551 }
  47552 
  47553 type IOleInPlaceObjectVtbl = IOleInPlaceObjectVtbl1
  47554 
  47555 type LPOLEINPLACESITE = uintptr
  47556 type IOleInPlaceSiteVtbl1 = struct {
  47557 	FQueryInterface       uintptr
  47558 	FAddRef               uintptr
  47559 	FRelease              uintptr
  47560 	FGetWindow            uintptr
  47561 	FContextSensitiveHelp uintptr
  47562 	FCanInPlaceActivate   uintptr
  47563 	FOnInPlaceActivate    uintptr
  47564 	FOnUIActivate         uintptr
  47565 	FGetWindowContext     uintptr
  47566 	FScroll               uintptr
  47567 	FOnUIDeactivate       uintptr
  47568 	FOnInPlaceDeactivate  uintptr
  47569 	FDiscardUndoState     uintptr
  47570 	FDeactivateAndUndo    uintptr
  47571 	FOnPosRectChange      uintptr
  47572 }
  47573 
  47574 type IOleInPlaceSiteVtbl = IOleInPlaceSiteVtbl1
  47575 type IContinueVtbl1 = struct {
  47576 	FQueryInterface uintptr
  47577 	FAddRef         uintptr
  47578 	FRelease        uintptr
  47579 	FFContinue      uintptr
  47580 }
  47581 
  47582 type IContinueVtbl = IContinueVtbl1
  47583 
  47584 type LPVIEWOBJECT = uintptr
  47585 type IViewObjectVtbl1 = struct {
  47586 	FQueryInterface uintptr
  47587 	FAddRef         uintptr
  47588 	FRelease        uintptr
  47589 	FDraw           uintptr
  47590 	FGetColorSet    uintptr
  47591 	FFreeze         uintptr
  47592 	FUnfreeze       uintptr
  47593 	FSetAdvise      uintptr
  47594 	FGetAdvise      uintptr
  47595 }
  47596 
  47597 type IViewObjectVtbl = IViewObjectVtbl1
  47598 
  47599 type LPVIEWOBJECT2 = uintptr
  47600 type IViewObject2Vtbl1 = struct {
  47601 	FQueryInterface uintptr
  47602 	FAddRef         uintptr
  47603 	FRelease        uintptr
  47604 	FDraw           uintptr
  47605 	FGetColorSet    uintptr
  47606 	FFreeze         uintptr
  47607 	FUnfreeze       uintptr
  47608 	FSetAdvise      uintptr
  47609 	FGetAdvise      uintptr
  47610 	FGetExtent      uintptr
  47611 }
  47612 
  47613 type IViewObject2Vtbl = IViewObject2Vtbl1
  47614 
  47615 type LPDROPSOURCE = uintptr
  47616 type IDropSourceVtbl1 = struct {
  47617 	FQueryInterface    uintptr
  47618 	FAddRef            uintptr
  47619 	FRelease           uintptr
  47620 	FQueryContinueDrag uintptr
  47621 	FGiveFeedback      uintptr
  47622 }
  47623 
  47624 type IDropSourceVtbl = IDropSourceVtbl1
  47625 
  47626 type LPDROPTARGET = uintptr
  47627 type IDropTargetVtbl1 = struct {
  47628 	FQueryInterface uintptr
  47629 	FAddRef         uintptr
  47630 	FRelease        uintptr
  47631 	FDragEnter      uintptr
  47632 	FDragOver       uintptr
  47633 	FDragLeave      uintptr
  47634 	FDrop           uintptr
  47635 }
  47636 
  47637 type IDropTargetVtbl = IDropTargetVtbl1
  47638 type IDropSourceNotifyVtbl1 = struct {
  47639 	FQueryInterface  uintptr
  47640 	FAddRef          uintptr
  47641 	FRelease         uintptr
  47642 	FDragEnterTarget uintptr
  47643 	FDragLeaveTarget uintptr
  47644 }
  47645 
  47646 type IDropSourceNotifyVtbl = IDropSourceNotifyVtbl1
  47647 
  47648 type LPENUMOLEVERB = uintptr
  47649 
  47650 type tagOLEVERB = struct {
  47651 	FlVerb        LONG
  47652 	F__ccgo_pad1  [4]byte
  47653 	FlpszVerbName LPOLESTR
  47654 	FfuFlags      DWORD
  47655 	FgrfAttribs   DWORD
  47656 }
  47657 
  47658 type OLEVERB = tagOLEVERB
  47659 type LPOLEVERB = uintptr
  47660 
  47661 type OLEVERBATTRIB = uint32
  47662 type IEnumOLEVERBVtbl1 = struct {
  47663 	FQueryInterface uintptr
  47664 	FAddRef         uintptr
  47665 	FRelease        uintptr
  47666 	FNext           uintptr
  47667 	FSkip           uintptr
  47668 	FReset          uintptr
  47669 	FClone          uintptr
  47670 }
  47671 
  47672 type IEnumOLEVERBVtbl = IEnumOLEVERBVtbl1
  47673 
  47674 type IServiceProvider1 = struct{ FlpVtbl uintptr }
  47675 
  47676 type IServiceProvider = IServiceProvider1
  47677 
  47678 type LPSERVICEPROVIDER = uintptr
  47679 type IServiceProviderVtbl1 = struct {
  47680 	FQueryInterface uintptr
  47681 	FAddRef         uintptr
  47682 	FRelease        uintptr
  47683 	FQueryService   uintptr
  47684 }
  47685 
  47686 type IServiceProviderVtbl = IServiceProviderVtbl1
  47687 
  47688 type ICreateTypeInfo1 = struct{ FlpVtbl uintptr }
  47689 
  47690 type ICreateTypeInfo = ICreateTypeInfo1
  47691 
  47692 type ICreateTypeInfo21 = struct{ FlpVtbl uintptr }
  47693 
  47694 type ICreateTypeInfo2 = ICreateTypeInfo21
  47695 
  47696 type ICreateTypeLib1 = struct{ FlpVtbl uintptr }
  47697 
  47698 type ICreateTypeLib = ICreateTypeLib1
  47699 
  47700 type ICreateTypeLib21 = struct{ FlpVtbl uintptr }
  47701 
  47702 type ICreateTypeLib2 = ICreateTypeLib21
  47703 
  47704 type IDispatch1 = struct{ FlpVtbl uintptr }
  47705 
  47706 type IDispatch = IDispatch1
  47707 
  47708 type IEnumVARIANT1 = struct{ FlpVtbl uintptr }
  47709 
  47710 type IEnumVARIANT = IEnumVARIANT1
  47711 
  47712 type ITypeComp1 = struct{ FlpVtbl uintptr }
  47713 
  47714 type ITypeComp = ITypeComp1
  47715 
  47716 type ITypeInfo1 = struct{ FlpVtbl uintptr }
  47717 
  47718 type ITypeInfo = ITypeInfo1
  47719 
  47720 type ITypeInfo21 = struct{ FlpVtbl uintptr }
  47721 
  47722 type ITypeInfo2 = ITypeInfo21
  47723 
  47724 type ITypeLib1 = struct{ FlpVtbl uintptr }
  47725 
  47726 type ITypeLib = ITypeLib1
  47727 
  47728 type ITypeLib21 = struct{ FlpVtbl uintptr }
  47729 
  47730 type ITypeLib2 = ITypeLib21
  47731 
  47732 type ITypeChangeEvents1 = struct{ FlpVtbl uintptr }
  47733 
  47734 type ITypeChangeEvents = ITypeChangeEvents1
  47735 
  47736 type IErrorInfo1 = struct{ FlpVtbl uintptr }
  47737 
  47738 type IErrorInfo = IErrorInfo1
  47739 
  47740 type ICreateErrorInfo1 = struct{ FlpVtbl uintptr }
  47741 
  47742 type ICreateErrorInfo = ICreateErrorInfo1
  47743 
  47744 type ISupportErrorInfo1 = struct{ FlpVtbl uintptr }
  47745 
  47746 type ISupportErrorInfo = ISupportErrorInfo1
  47747 
  47748 type ITypeFactory1 = struct{ FlpVtbl uintptr }
  47749 
  47750 type ITypeFactory = ITypeFactory1
  47751 
  47752 type ITypeMarshal1 = struct{ FlpVtbl uintptr }
  47753 
  47754 type ITypeMarshal = ITypeMarshal1
  47755 
  47756 type IRecordInfo1 = struct{ FlpVtbl uintptr }
  47757 
  47758 type IRecordInfo = IRecordInfo1
  47759 
  47760 type IErrorLog1 = struct{ FlpVtbl uintptr }
  47761 
  47762 type IErrorLog = IErrorLog1
  47763 
  47764 type IPropertyBag1 = struct{ FlpVtbl uintptr }
  47765 
  47766 type IPropertyBag = IPropertyBag1
  47767 type CURRENCY = CY
  47768 type tagSAFEARRAYBOUND = struct {
  47769 	FcElements ULONG
  47770 	FlLbound   LONG
  47771 }
  47772 
  47773 type SAFEARRAYBOUND = tagSAFEARRAYBOUND
  47774 type LPSAFEARRAYBOUND = uintptr
  47775 
  47776 type _wireVARIANT = struct {
  47777 	FclSize      DWORD
  47778 	FrpcReserved DWORD
  47779 	Fvt          USHORT
  47780 	FwReserved1  USHORT
  47781 	FwReserved2  USHORT
  47782 	FwReserved3  USHORT
  47783 	F__16        struct {
  47784 		FllVal       LONGLONG
  47785 		F__ccgo_pad1 [8]byte
  47786 	}
  47787 }
  47788 
  47789 type WireVARIANT = uintptr
  47790 type _wireBRECORD = struct {
  47791 	FfFlags   ULONG
  47792 	FclSize   ULONG
  47793 	FpRecInfo uintptr
  47794 	FpRecord  uintptr
  47795 }
  47796 
  47797 type WireBRECORD = uintptr
  47798 
  47799 type _wireSAFEARR_BSTR = struct {
  47800 	FSize        ULONG
  47801 	F__ccgo_pad1 [4]byte
  47802 	FaBstr       uintptr
  47803 }
  47804 
  47805 type SAFEARR_BSTR = _wireSAFEARR_BSTR
  47806 
  47807 type _wireSAFEARR_UNKNOWN = struct {
  47808 	FSize        ULONG
  47809 	F__ccgo_pad1 [4]byte
  47810 	FapUnknown   uintptr
  47811 }
  47812 
  47813 type SAFEARR_UNKNOWN = _wireSAFEARR_UNKNOWN
  47814 
  47815 type _wireSAFEARR_DISPATCH = struct {
  47816 	FSize        ULONG
  47817 	F__ccgo_pad1 [4]byte
  47818 	FapDispatch  uintptr
  47819 }
  47820 
  47821 type SAFEARR_DISPATCH = _wireSAFEARR_DISPATCH
  47822 
  47823 type _wireSAFEARR_VARIANT = struct {
  47824 	FSize        ULONG
  47825 	F__ccgo_pad1 [4]byte
  47826 	FaVariant    uintptr
  47827 }
  47828 
  47829 type SAFEARR_VARIANT = _wireSAFEARR_VARIANT
  47830 
  47831 type _wireSAFEARR_BRECORD = struct {
  47832 	FSize        ULONG
  47833 	F__ccgo_pad1 [4]byte
  47834 	FaRecord     uintptr
  47835 }
  47836 
  47837 type SAFEARR_BRECORD = _wireSAFEARR_BRECORD
  47838 
  47839 type _wireSAFEARR_HAVEIID = struct {
  47840 	FSize        ULONG
  47841 	F__ccgo_pad1 [4]byte
  47842 	FapUnknown   uintptr
  47843 	Fiid         IID
  47844 }
  47845 
  47846 type SAFEARR_HAVEIID = _wireSAFEARR_HAVEIID
  47847 
  47848 type SF_TYPE = uint32
  47849 
  47850 type _wireSAFEARRAY_UNION = struct {
  47851 	FsfType      ULONG
  47852 	F__ccgo_pad1 [4]byte
  47853 	Fu           struct {
  47854 		FBstrStr     SAFEARR_BSTR
  47855 		F__ccgo_pad1 [16]byte
  47856 	}
  47857 }
  47858 
  47859 type SAFEARRAYUNION = _wireSAFEARRAY_UNION
  47860 
  47861 type _wireSAFEARRAY = struct {
  47862 	FcDims         USHORT
  47863 	FfFeatures     USHORT
  47864 	FcbElements    ULONG
  47865 	FcLocks        ULONG
  47866 	F__ccgo_pad1   [4]byte
  47867 	FuArrayStructs SAFEARRAYUNION
  47868 	Frgsabound     [1]SAFEARRAYBOUND
  47869 }
  47870 
  47871 type WireSAFEARRAY = uintptr
  47872 type WirePSAFEARRAY = uintptr
  47873 
  47874 type tagSAFEARRAY = struct {
  47875 	FcDims       USHORT
  47876 	FfFeatures   USHORT
  47877 	FcbElements  ULONG
  47878 	FcLocks      ULONG
  47879 	F__ccgo_pad1 [4]byte
  47880 	FpvData      PVOID
  47881 	Frgsabound   [1]SAFEARRAYBOUND
  47882 }
  47883 
  47884 type SAFEARRAY = tagSAFEARRAY
  47885 type LPSAFEARRAY = uintptr
  47886 
  47887 type tagVARIANT = struct {
  47888 	Fn1 struct {
  47889 		Fn2 struct {
  47890 			Fvt         VARTYPE
  47891 			FwReserved1 WORD
  47892 			FwReserved2 WORD
  47893 			FwReserved3 WORD
  47894 			Fn3         struct {
  47895 				FllVal       LONGLONG
  47896 				F__ccgo_pad1 [8]byte
  47897 			}
  47898 		}
  47899 	}
  47900 }
  47901 
  47902 type VARIANT = tagVARIANT
  47903 
  47904 type __tagVARIANT = struct {
  47905 	Fvt         VARTYPE
  47906 	FwReserved1 WORD
  47907 	FwReserved2 WORD
  47908 	FwReserved3 WORD
  47909 	Fn3         struct {
  47910 		FllVal       LONGLONG
  47911 		F__ccgo_pad1 [8]byte
  47912 	}
  47913 }
  47914 
  47915 type __tagBRECORD = struct {
  47916 	FpvRecord PVOID
  47917 	FpRecInfo uintptr
  47918 }
  47919 
  47920 type LPVARIANT = uintptr
  47921 type VARIANTARG = VARIANT
  47922 type LPVARIANTARG = uintptr
  47923 
  47924 type DISPID = LONG
  47925 type MEMBERID = DISPID
  47926 type HREFTYPE = DWORD
  47927 type TYPEKIND = uint32
  47928 
  47929 type tagTYPEDESC = struct {
  47930 	F__0         struct{ Flptdesc uintptr }
  47931 	Fvt          VARTYPE
  47932 	F__ccgo_pad1 [6]byte
  47933 }
  47934 
  47935 type tagARRAYDESC = struct {
  47936 	FtdescElem   TYPEDESC
  47937 	FcDims       USHORT
  47938 	F__ccgo_pad1 [2]byte
  47939 	Frgbounds    [1]SAFEARRAYBOUND
  47940 	F__ccgo_pad2 [4]byte
  47941 }
  47942 
  47943 type TYPEDESC = tagTYPEDESC
  47944 
  47945 type ARRAYDESC = tagARRAYDESC
  47946 
  47947 type tagPARAMDESCEX = struct {
  47948 	FcBytes          ULONG
  47949 	F__ccgo_pad1     [4]byte
  47950 	FvarDefaultValue VARIANTARG
  47951 }
  47952 
  47953 type PARAMDESCEX = tagPARAMDESCEX
  47954 type LPPARAMDESCEX = uintptr
  47955 
  47956 type tagPARAMDESC = struct {
  47957 	Fpparamdescex LPPARAMDESCEX
  47958 	FwParamFlags  USHORT
  47959 	F__ccgo_pad1  [6]byte
  47960 }
  47961 
  47962 type PARAMDESC = tagPARAMDESC
  47963 type LPPARAMDESC = uintptr
  47964 
  47965 type tagIDLDESC = struct {
  47966 	FdwReserved  ULONG_PTR
  47967 	FwIDLFlags   USHORT
  47968 	F__ccgo_pad1 [6]byte
  47969 }
  47970 
  47971 type IDLDESC = tagIDLDESC
  47972 type LPIDLDESC = uintptr
  47973 
  47974 type tagELEMDESC = struct {
  47975 	Ftdesc TYPEDESC
  47976 	Fu     struct{ Fidldesc IDLDESC }
  47977 }
  47978 
  47979 type ELEMDESC = tagELEMDESC
  47980 type LPELEMDESC = uintptr
  47981 
  47982 type tagTYPEATTR = struct {
  47983 	Fguid             GUID
  47984 	Flcid             LCID
  47985 	FdwReserved       DWORD
  47986 	FmemidConstructor MEMBERID
  47987 	FmemidDestructor  MEMBERID
  47988 	FlpstrSchema      LPOLESTR
  47989 	FcbSizeInstance   ULONG
  47990 	Ftypekind         TYPEKIND
  47991 	FcFuncs           WORD
  47992 	FcVars            WORD
  47993 	FcImplTypes       WORD
  47994 	FcbSizeVft        WORD
  47995 	FcbAlignment      WORD
  47996 	FwTypeFlags       WORD
  47997 	FwMajorVerNum     WORD
  47998 	FwMinorVerNum     WORD
  47999 	FtdescAlias       TYPEDESC
  48000 	FidldescType      IDLDESC
  48001 }
  48002 
  48003 type TYPEATTR = tagTYPEATTR
  48004 type LPTYPEATTR = uintptr
  48005 
  48006 type tagDISPPARAMS = struct {
  48007 	Frgvarg            uintptr
  48008 	FrgdispidNamedArgs uintptr
  48009 	FcArgs             UINT
  48010 	FcNamedArgs        UINT
  48011 }
  48012 
  48013 type DISPPARAMS = tagDISPPARAMS
  48014 
  48015 type tagEXCEPINFO = struct {
  48016 	FwCode             WORD
  48017 	FwReserved         WORD
  48018 	F__ccgo_pad1       [4]byte
  48019 	FbstrSource        BSTR
  48020 	FbstrDescription   BSTR
  48021 	FbstrHelpFile      BSTR
  48022 	FdwHelpContext     DWORD
  48023 	F__ccgo_pad2       [4]byte
  48024 	FpvReserved        PVOID
  48025 	FpfnDeferredFillIn uintptr
  48026 	Fscode             SCODE
  48027 	F__ccgo_pad3       [4]byte
  48028 }
  48029 
  48030 type EXCEPINFO = tagEXCEPINFO
  48031 type LPEXCEPINFO = uintptr
  48032 
  48033 type CALLCONV = uint32
  48034 
  48035 type FUNCKIND = uint32
  48036 
  48037 type INVOKEKIND = uint32
  48038 
  48039 type tagFUNCDESC = struct {
  48040 	Fmemid             MEMBERID
  48041 	F__ccgo_pad1       [4]byte
  48042 	Flprgscode         uintptr
  48043 	FlprgelemdescParam uintptr
  48044 	Ffunckind          FUNCKIND
  48045 	Finvkind           INVOKEKIND
  48046 	Fcallconv          CALLCONV
  48047 	FcParams           SHORT
  48048 	FcParamsOpt        SHORT
  48049 	FoVft              SHORT
  48050 	FcScodes           SHORT
  48051 	F__ccgo_pad2       [4]byte
  48052 	FelemdescFunc      ELEMDESC
  48053 	FwFuncFlags        WORD
  48054 	F__ccgo_pad3       [6]byte
  48055 }
  48056 
  48057 type FUNCDESC = tagFUNCDESC
  48058 type LPFUNCDESC = uintptr
  48059 
  48060 type VARKIND = uint32
  48061 
  48062 type tagVARDESC = struct {
  48063 	Fmemid       MEMBERID
  48064 	F__ccgo_pad1 [4]byte
  48065 	FlpstrSchema LPOLESTR
  48066 	F__16        struct {
  48067 		F__ccgo_pad1 [0]uint64
  48068 		FoInst       ULONG
  48069 		F__ccgo_pad2 [4]byte
  48070 	}
  48071 	FelemdescVar ELEMDESC
  48072 	FwVarFlags   WORD
  48073 	F__ccgo_pad2 [2]byte
  48074 	Fvarkind     VARKIND
  48075 }
  48076 
  48077 type VARDESC = tagVARDESC
  48078 type LPVARDESC = uintptr
  48079 
  48080 type TYPEFLAGS = uint32
  48081 
  48082 type FUNCFLAGS = uint32
  48083 
  48084 type VARFLAGS = uint32
  48085 
  48086 type tagCLEANLOCALSTORAGE = struct {
  48087 	FpInterface  uintptr
  48088 	FpStorage    PVOID
  48089 	Fflags       DWORD
  48090 	F__ccgo_pad1 [4]byte
  48091 }
  48092 
  48093 type CLEANLOCALSTORAGE = tagCLEANLOCALSTORAGE
  48094 
  48095 type tagCUSTDATAITEM = struct {
  48096 	Fguid     GUID
  48097 	FvarValue VARIANTARG
  48098 }
  48099 
  48100 type CUSTDATAITEM = tagCUSTDATAITEM
  48101 type LPCUSTDATAITEM = uintptr
  48102 
  48103 type tagCUSTDATA = struct {
  48104 	FcCustData   DWORD
  48105 	F__ccgo_pad1 [4]byte
  48106 	FprgCustData LPCUSTDATAITEM
  48107 }
  48108 
  48109 type CUSTDATA = tagCUSTDATA
  48110 type LPCUSTDATA = uintptr
  48111 
  48112 type LPCREATETYPEINFO = uintptr
  48113 type ICreateTypeInfoVtbl1 = struct {
  48114 	FQueryInterface       uintptr
  48115 	FAddRef               uintptr
  48116 	FRelease              uintptr
  48117 	FSetGuid              uintptr
  48118 	FSetTypeFlags         uintptr
  48119 	FSetDocString         uintptr
  48120 	FSetHelpContext       uintptr
  48121 	FSetVersion           uintptr
  48122 	FAddRefTypeInfo       uintptr
  48123 	FAddFuncDesc          uintptr
  48124 	FAddImplType          uintptr
  48125 	FSetImplTypeFlags     uintptr
  48126 	FSetAlignment         uintptr
  48127 	FSetSchema            uintptr
  48128 	FAddVarDesc           uintptr
  48129 	FSetFuncAndParamNames uintptr
  48130 	FSetVarName           uintptr
  48131 	FSetTypeDescAlias     uintptr
  48132 	FDefineFuncAsDllEntry uintptr
  48133 	FSetFuncDocString     uintptr
  48134 	FSetVarDocString      uintptr
  48135 	FSetFuncHelpContext   uintptr
  48136 	FSetVarHelpContext    uintptr
  48137 	FSetMops              uintptr
  48138 	FSetTypeIdldesc       uintptr
  48139 	FLayOut               uintptr
  48140 }
  48141 
  48142 type ICreateTypeInfoVtbl = ICreateTypeInfoVtbl1
  48143 
  48144 type LPCREATETYPEINFO2 = uintptr
  48145 type ICreateTypeInfo2Vtbl1 = struct {
  48146 	FQueryInterface           uintptr
  48147 	FAddRef                   uintptr
  48148 	FRelease                  uintptr
  48149 	FSetGuid                  uintptr
  48150 	FSetTypeFlags             uintptr
  48151 	FSetDocString             uintptr
  48152 	FSetHelpContext           uintptr
  48153 	FSetVersion               uintptr
  48154 	FAddRefTypeInfo           uintptr
  48155 	FAddFuncDesc              uintptr
  48156 	FAddImplType              uintptr
  48157 	FSetImplTypeFlags         uintptr
  48158 	FSetAlignment             uintptr
  48159 	FSetSchema                uintptr
  48160 	FAddVarDesc               uintptr
  48161 	FSetFuncAndParamNames     uintptr
  48162 	FSetVarName               uintptr
  48163 	FSetTypeDescAlias         uintptr
  48164 	FDefineFuncAsDllEntry     uintptr
  48165 	FSetFuncDocString         uintptr
  48166 	FSetVarDocString          uintptr
  48167 	FSetFuncHelpContext       uintptr
  48168 	FSetVarHelpContext        uintptr
  48169 	FSetMops                  uintptr
  48170 	FSetTypeIdldesc           uintptr
  48171 	FLayOut                   uintptr
  48172 	FDeleteFuncDesc           uintptr
  48173 	FDeleteFuncDescByMemId    uintptr
  48174 	FDeleteVarDesc            uintptr
  48175 	FDeleteVarDescByMemId     uintptr
  48176 	FDeleteImplType           uintptr
  48177 	FSetCustData              uintptr
  48178 	FSetFuncCustData          uintptr
  48179 	FSetParamCustData         uintptr
  48180 	FSetVarCustData           uintptr
  48181 	FSetImplTypeCustData      uintptr
  48182 	FSetHelpStringContext     uintptr
  48183 	FSetFuncHelpStringContext uintptr
  48184 	FSetVarHelpStringContext  uintptr
  48185 	FInvalidate               uintptr
  48186 	FSetName                  uintptr
  48187 }
  48188 
  48189 type ICreateTypeInfo2Vtbl = ICreateTypeInfo2Vtbl1
  48190 
  48191 type LPCREATETYPELIB = uintptr
  48192 type ICreateTypeLibVtbl1 = struct {
  48193 	FQueryInterface  uintptr
  48194 	FAddRef          uintptr
  48195 	FRelease         uintptr
  48196 	FCreateTypeInfo  uintptr
  48197 	FSetName         uintptr
  48198 	FSetVersion      uintptr
  48199 	FSetGuid         uintptr
  48200 	FSetDocString    uintptr
  48201 	FSetHelpFileName uintptr
  48202 	FSetHelpContext  uintptr
  48203 	FSetLcid         uintptr
  48204 	FSetLibFlags     uintptr
  48205 	FSaveAllChanges  uintptr
  48206 }
  48207 
  48208 type ICreateTypeLibVtbl = ICreateTypeLibVtbl1
  48209 
  48210 type LPCREATETYPELIB2 = uintptr
  48211 type ICreateTypeLib2Vtbl1 = struct {
  48212 	FQueryInterface       uintptr
  48213 	FAddRef               uintptr
  48214 	FRelease              uintptr
  48215 	FCreateTypeInfo       uintptr
  48216 	FSetName              uintptr
  48217 	FSetVersion           uintptr
  48218 	FSetGuid              uintptr
  48219 	FSetDocString         uintptr
  48220 	FSetHelpFileName      uintptr
  48221 	FSetHelpContext       uintptr
  48222 	FSetLcid              uintptr
  48223 	FSetLibFlags          uintptr
  48224 	FSaveAllChanges       uintptr
  48225 	FDeleteTypeInfo       uintptr
  48226 	FSetCustData          uintptr
  48227 	FSetHelpStringContext uintptr
  48228 	FSetHelpStringDll     uintptr
  48229 }
  48230 
  48231 type ICreateTypeLib2Vtbl = ICreateTypeLib2Vtbl1
  48232 
  48233 type LPDISPATCH = uintptr
  48234 type IDispatchVtbl1 = struct {
  48235 	FQueryInterface   uintptr
  48236 	FAddRef           uintptr
  48237 	FRelease          uintptr
  48238 	FGetTypeInfoCount uintptr
  48239 	FGetTypeInfo      uintptr
  48240 	FGetIDsOfNames    uintptr
  48241 	FInvoke           uintptr
  48242 }
  48243 
  48244 type IDispatchVtbl = IDispatchVtbl1
  48245 
  48246 type LPENUMVARIANT = uintptr
  48247 type IEnumVARIANTVtbl1 = struct {
  48248 	FQueryInterface uintptr
  48249 	FAddRef         uintptr
  48250 	FRelease        uintptr
  48251 	FNext           uintptr
  48252 	FSkip           uintptr
  48253 	FReset          uintptr
  48254 	FClone          uintptr
  48255 }
  48256 
  48257 type IEnumVARIANTVtbl = IEnumVARIANTVtbl1
  48258 
  48259 type LPTYPECOMP = uintptr
  48260 
  48261 type DESCKIND = uint32
  48262 
  48263 type tagBINDPTR = struct{ Flpfuncdesc uintptr }
  48264 
  48265 type BINDPTR = tagBINDPTR
  48266 type LPBINDPTR = uintptr
  48267 type ITypeCompVtbl1 = struct {
  48268 	FQueryInterface uintptr
  48269 	FAddRef         uintptr
  48270 	FRelease        uintptr
  48271 	FBind           uintptr
  48272 	FBindType       uintptr
  48273 }
  48274 
  48275 type ITypeCompVtbl = ITypeCompVtbl1
  48276 
  48277 type LPTYPEINFO = uintptr
  48278 type ITypeInfoVtbl1 = struct {
  48279 	FQueryInterface       uintptr
  48280 	FAddRef               uintptr
  48281 	FRelease              uintptr
  48282 	FGetTypeAttr          uintptr
  48283 	FGetTypeComp          uintptr
  48284 	FGetFuncDesc          uintptr
  48285 	FGetVarDesc           uintptr
  48286 	FGetNames             uintptr
  48287 	FGetRefTypeOfImplType uintptr
  48288 	FGetImplTypeFlags     uintptr
  48289 	FGetIDsOfNames        uintptr
  48290 	FInvoke               uintptr
  48291 	FGetDocumentation     uintptr
  48292 	FGetDllEntry          uintptr
  48293 	FGetRefTypeInfo       uintptr
  48294 	FAddressOfMember      uintptr
  48295 	FCreateInstance       uintptr
  48296 	FGetMops              uintptr
  48297 	FGetContainingTypeLib uintptr
  48298 	FReleaseTypeAttr      uintptr
  48299 	FReleaseFuncDesc      uintptr
  48300 	FReleaseVarDesc       uintptr
  48301 }
  48302 
  48303 type ITypeInfoVtbl = ITypeInfoVtbl1
  48304 
  48305 type LPTYPEINFO2 = uintptr
  48306 type ITypeInfo2Vtbl1 = struct {
  48307 	FQueryInterface         uintptr
  48308 	FAddRef                 uintptr
  48309 	FRelease                uintptr
  48310 	FGetTypeAttr            uintptr
  48311 	FGetTypeComp            uintptr
  48312 	FGetFuncDesc            uintptr
  48313 	FGetVarDesc             uintptr
  48314 	FGetNames               uintptr
  48315 	FGetRefTypeOfImplType   uintptr
  48316 	FGetImplTypeFlags       uintptr
  48317 	FGetIDsOfNames          uintptr
  48318 	FInvoke                 uintptr
  48319 	FGetDocumentation       uintptr
  48320 	FGetDllEntry            uintptr
  48321 	FGetRefTypeInfo         uintptr
  48322 	FAddressOfMember        uintptr
  48323 	FCreateInstance         uintptr
  48324 	FGetMops                uintptr
  48325 	FGetContainingTypeLib   uintptr
  48326 	FReleaseTypeAttr        uintptr
  48327 	FReleaseFuncDesc        uintptr
  48328 	FReleaseVarDesc         uintptr
  48329 	FGetTypeKind            uintptr
  48330 	FGetTypeFlags           uintptr
  48331 	FGetFuncIndexOfMemId    uintptr
  48332 	FGetVarIndexOfMemId     uintptr
  48333 	FGetCustData            uintptr
  48334 	FGetFuncCustData        uintptr
  48335 	FGetParamCustData       uintptr
  48336 	FGetVarCustData         uintptr
  48337 	FGetImplTypeCustData    uintptr
  48338 	FGetDocumentation2      uintptr
  48339 	FGetAllCustData         uintptr
  48340 	FGetAllFuncCustData     uintptr
  48341 	FGetAllParamCustData    uintptr
  48342 	FGetAllVarCustData      uintptr
  48343 	FGetAllImplTypeCustData uintptr
  48344 }
  48345 
  48346 type ITypeInfo2Vtbl = ITypeInfo2Vtbl1
  48347 
  48348 type SYSKIND = uint32
  48349 
  48350 type LIBFLAGS = uint32
  48351 
  48352 type LPTYPELIB = uintptr
  48353 
  48354 type tagTLIBATTR = struct {
  48355 	Fguid         GUID
  48356 	Flcid         LCID
  48357 	Fsyskind      SYSKIND
  48358 	FwMajorVerNum WORD
  48359 	FwMinorVerNum WORD
  48360 	FwLibFlags    WORD
  48361 	F__ccgo_pad1  [2]byte
  48362 }
  48363 
  48364 type TLIBATTR = tagTLIBATTR
  48365 type LPTLIBATTR = uintptr
  48366 type ITypeLibVtbl1 = struct {
  48367 	FQueryInterface    uintptr
  48368 	FAddRef            uintptr
  48369 	FRelease           uintptr
  48370 	FGetTypeInfoCount  uintptr
  48371 	FGetTypeInfo       uintptr
  48372 	FGetTypeInfoType   uintptr
  48373 	FGetTypeInfoOfGuid uintptr
  48374 	FGetLibAttr        uintptr
  48375 	FGetTypeComp       uintptr
  48376 	FGetDocumentation  uintptr
  48377 	FIsName            uintptr
  48378 	FFindName          uintptr
  48379 	FReleaseTLibAttr   uintptr
  48380 }
  48381 
  48382 type ITypeLibVtbl = ITypeLibVtbl1
  48383 
  48384 type LPTYPELIB2 = uintptr
  48385 type ITypeLib2Vtbl1 = struct {
  48386 	FQueryInterface    uintptr
  48387 	FAddRef            uintptr
  48388 	FRelease           uintptr
  48389 	FGetTypeInfoCount  uintptr
  48390 	FGetTypeInfo       uintptr
  48391 	FGetTypeInfoType   uintptr
  48392 	FGetTypeInfoOfGuid uintptr
  48393 	FGetLibAttr        uintptr
  48394 	FGetTypeComp       uintptr
  48395 	FGetDocumentation  uintptr
  48396 	FIsName            uintptr
  48397 	FFindName          uintptr
  48398 	FReleaseTLibAttr   uintptr
  48399 	FGetCustData       uintptr
  48400 	FGetLibStatistics  uintptr
  48401 	FGetDocumentation2 uintptr
  48402 	FGetAllCustData    uintptr
  48403 }
  48404 
  48405 type ITypeLib2Vtbl = ITypeLib2Vtbl1
  48406 
  48407 type LPTYPECHANGEEVENTS = uintptr
  48408 
  48409 type CHANGEKIND = uint32
  48410 type ITypeChangeEventsVtbl1 = struct {
  48411 	FQueryInterface    uintptr
  48412 	FAddRef            uintptr
  48413 	FRelease           uintptr
  48414 	FRequestTypeChange uintptr
  48415 	FAfterTypeChange   uintptr
  48416 }
  48417 
  48418 type ITypeChangeEventsVtbl = ITypeChangeEventsVtbl1
  48419 
  48420 type LPERRORINFO = uintptr
  48421 type IErrorInfoVtbl1 = struct {
  48422 	FQueryInterface uintptr
  48423 	FAddRef         uintptr
  48424 	FRelease        uintptr
  48425 	FGetGUID        uintptr
  48426 	FGetSource      uintptr
  48427 	FGetDescription uintptr
  48428 	FGetHelpFile    uintptr
  48429 	FGetHelpContext uintptr
  48430 }
  48431 
  48432 type IErrorInfoVtbl = IErrorInfoVtbl1
  48433 
  48434 type LPCREATEERRORINFO = uintptr
  48435 type ICreateErrorInfoVtbl1 = struct {
  48436 	FQueryInterface uintptr
  48437 	FAddRef         uintptr
  48438 	FRelease        uintptr
  48439 	FSetGUID        uintptr
  48440 	FSetSource      uintptr
  48441 	FSetDescription uintptr
  48442 	FSetHelpFile    uintptr
  48443 	FSetHelpContext uintptr
  48444 }
  48445 
  48446 type ICreateErrorInfoVtbl = ICreateErrorInfoVtbl1
  48447 
  48448 type LPSUPPORTERRORINFO = uintptr
  48449 type ISupportErrorInfoVtbl1 = struct {
  48450 	FQueryInterface             uintptr
  48451 	FAddRef                     uintptr
  48452 	FRelease                    uintptr
  48453 	FInterfaceSupportsErrorInfo uintptr
  48454 }
  48455 
  48456 type ISupportErrorInfoVtbl = ISupportErrorInfoVtbl1
  48457 type ITypeFactoryVtbl1 = struct {
  48458 	FQueryInterface     uintptr
  48459 	FAddRef             uintptr
  48460 	FRelease            uintptr
  48461 	FCreateFromTypeInfo uintptr
  48462 }
  48463 
  48464 type ITypeFactoryVtbl = ITypeFactoryVtbl1
  48465 type ITypeMarshalVtbl1 = struct {
  48466 	FQueryInterface uintptr
  48467 	FAddRef         uintptr
  48468 	FRelease        uintptr
  48469 	FSize           uintptr
  48470 	FMarshal        uintptr
  48471 	FUnmarshal      uintptr
  48472 	FFree           uintptr
  48473 }
  48474 
  48475 type ITypeMarshalVtbl = ITypeMarshalVtbl1
  48476 
  48477 type LPRECORDINFO = uintptr
  48478 type IRecordInfoVtbl1 = struct {
  48479 	FQueryInterface   uintptr
  48480 	FAddRef           uintptr
  48481 	FRelease          uintptr
  48482 	FRecordInit       uintptr
  48483 	FRecordClear      uintptr
  48484 	FRecordCopy       uintptr
  48485 	FGetGuid          uintptr
  48486 	FGetName          uintptr
  48487 	FGetSize          uintptr
  48488 	FGetTypeInfo      uintptr
  48489 	FGetField         uintptr
  48490 	FGetFieldNoCopy   uintptr
  48491 	FPutField         uintptr
  48492 	FPutFieldNoCopy   uintptr
  48493 	FGetFieldNames    uintptr
  48494 	FIsMatchingType   uintptr
  48495 	FRecordCreate     uintptr
  48496 	FRecordCreateCopy uintptr
  48497 	FRecordDestroy    uintptr
  48498 }
  48499 
  48500 type IRecordInfoVtbl = IRecordInfoVtbl1
  48501 
  48502 type LPERRORLOG = uintptr
  48503 type IErrorLogVtbl1 = struct {
  48504 	FQueryInterface uintptr
  48505 	FAddRef         uintptr
  48506 	FRelease        uintptr
  48507 	FAddError       uintptr
  48508 }
  48509 
  48510 type IErrorLogVtbl = IErrorLogVtbl1
  48511 
  48512 type LPPROPERTYBAG = uintptr
  48513 type IPropertyBagVtbl1 = struct {
  48514 	FQueryInterface uintptr
  48515 	FAddRef         uintptr
  48516 	FRelease        uintptr
  48517 	FRead           uintptr
  48518 	FWrite          uintptr
  48519 }
  48520 
  48521 type IPropertyBagVtbl = IPropertyBagVtbl1
  48522 
  48523 type IXMLDOMImplementation1 = struct{ FlpVtbl uintptr }
  48524 
  48525 type IXMLDOMImplementation = IXMLDOMImplementation1
  48526 
  48527 type IXMLDOMNode1 = struct{ FlpVtbl uintptr }
  48528 
  48529 type IXMLDOMNode = IXMLDOMNode1
  48530 
  48531 type IXMLDOMDocumentFragment1 = struct{ FlpVtbl uintptr }
  48532 
  48533 type IXMLDOMDocumentFragment = IXMLDOMDocumentFragment1
  48534 
  48535 type IXMLDOMDocument1 = struct{ FlpVtbl uintptr }
  48536 
  48537 type IXMLDOMDocument = IXMLDOMDocument1
  48538 
  48539 type IXMLDOMNodeList1 = struct{ FlpVtbl uintptr }
  48540 
  48541 type IXMLDOMNodeList = IXMLDOMNodeList1
  48542 
  48543 type IXMLDOMNamedNodeMap1 = struct{ FlpVtbl uintptr }
  48544 
  48545 type IXMLDOMNamedNodeMap = IXMLDOMNamedNodeMap1
  48546 
  48547 type IXMLDOMCharacterData1 = struct{ FlpVtbl uintptr }
  48548 
  48549 type IXMLDOMCharacterData = IXMLDOMCharacterData1
  48550 
  48551 type IXMLDOMAttribute1 = struct{ FlpVtbl uintptr }
  48552 
  48553 type IXMLDOMAttribute = IXMLDOMAttribute1
  48554 
  48555 type IXMLDOMElement1 = struct{ FlpVtbl uintptr }
  48556 
  48557 type IXMLDOMElement = IXMLDOMElement1
  48558 
  48559 type IXMLDOMText1 = struct{ FlpVtbl uintptr }
  48560 
  48561 type IXMLDOMText = IXMLDOMText1
  48562 
  48563 type IXMLDOMComment1 = struct{ FlpVtbl uintptr }
  48564 
  48565 type IXMLDOMComment = IXMLDOMComment1
  48566 
  48567 type IXMLDOMProcessingInstruction1 = struct{ FlpVtbl uintptr }
  48568 
  48569 type IXMLDOMProcessingInstruction = IXMLDOMProcessingInstruction1
  48570 
  48571 type IXMLDOMCDATASection1 = struct{ FlpVtbl uintptr }
  48572 
  48573 type IXMLDOMCDATASection = IXMLDOMCDATASection1
  48574 
  48575 type IXMLDOMDocumentType1 = struct{ FlpVtbl uintptr }
  48576 
  48577 type IXMLDOMDocumentType = IXMLDOMDocumentType1
  48578 
  48579 type IXMLDOMNotation1 = struct{ FlpVtbl uintptr }
  48580 
  48581 type IXMLDOMNotation = IXMLDOMNotation1
  48582 
  48583 type IXMLDOMEntity1 = struct{ FlpVtbl uintptr }
  48584 
  48585 type IXMLDOMEntity = IXMLDOMEntity1
  48586 
  48587 type IXMLDOMEntityReference1 = struct{ FlpVtbl uintptr }
  48588 
  48589 type IXMLDOMEntityReference = IXMLDOMEntityReference1
  48590 
  48591 type IXMLDOMParseError1 = struct{ FlpVtbl uintptr }
  48592 
  48593 type IXMLDOMParseError = IXMLDOMParseError1
  48594 
  48595 type IXTLRuntime1 = struct{ FlpVtbl uintptr }
  48596 
  48597 type IXTLRuntime = IXTLRuntime1
  48598 
  48599 type XMLDOMDocumentEvents1 = struct{ FlpVtbl uintptr }
  48600 
  48601 type XMLDOMDocumentEvents = XMLDOMDocumentEvents1
  48602 
  48603 type IXMLHttpRequest1 = struct{ FlpVtbl uintptr }
  48604 
  48605 type IXMLHttpRequest = IXMLHttpRequest1
  48606 
  48607 type IXMLDSOControl1 = struct{ FlpVtbl uintptr }
  48608 
  48609 type IXMLDSOControl = IXMLDSOControl1
  48610 
  48611 type IXMLElementCollection1 = struct{ FlpVtbl uintptr }
  48612 
  48613 type IXMLElementCollection = IXMLElementCollection1
  48614 
  48615 type IXMLDocument1 = struct{ FlpVtbl uintptr }
  48616 
  48617 type IXMLDocument = IXMLDocument1
  48618 
  48619 type IXMLDocument21 = struct{ FlpVtbl uintptr }
  48620 
  48621 type IXMLDocument2 = IXMLDocument21
  48622 
  48623 type IXMLElement1 = struct{ FlpVtbl uintptr }
  48624 
  48625 type IXMLElement = IXMLElement1
  48626 
  48627 type IXMLElement21 = struct{ FlpVtbl uintptr }
  48628 
  48629 type IXMLElement2 = IXMLElement21
  48630 
  48631 type IXMLAttribute1 = struct{ FlpVtbl uintptr }
  48632 
  48633 type IXMLAttribute = IXMLAttribute1
  48634 
  48635 type IXMLError1 = struct{ FlpVtbl uintptr }
  48636 
  48637 type IXMLError = IXMLError1
  48638 
  48639 type _xml_error = struct {
  48640 	F_nLine       uint32
  48641 	F__ccgo_pad1  [4]byte
  48642 	F_pchBuf      BSTR
  48643 	F_cchBuf      uint32
  48644 	F_ich         uint32
  48645 	F_pszFound    BSTR
  48646 	F_pszExpected BSTR
  48647 	F_reserved1   DWORD
  48648 	F_reserved2   DWORD
  48649 }
  48650 
  48651 type XML_ERROR = _xml_error
  48652 
  48653 type DOMNodeType = uint32
  48654 
  48655 type XMLELEM_TYPE = uint32
  48656 type IXMLDOMImplementationVtbl1 = struct {
  48657 	FQueryInterface   uintptr
  48658 	FAddRef           uintptr
  48659 	FRelease          uintptr
  48660 	FGetTypeInfoCount uintptr
  48661 	FGetTypeInfo      uintptr
  48662 	FGetIDsOfNames    uintptr
  48663 	FInvoke           uintptr
  48664 	FhasFeature       uintptr
  48665 }
  48666 
  48667 type IXMLDOMImplementationVtbl = IXMLDOMImplementationVtbl1
  48668 type IXMLDOMNodeVtbl1 = struct {
  48669 	FQueryInterface        uintptr
  48670 	FAddRef                uintptr
  48671 	FRelease               uintptr
  48672 	FGetTypeInfoCount      uintptr
  48673 	FGetTypeInfo           uintptr
  48674 	FGetIDsOfNames         uintptr
  48675 	FInvoke                uintptr
  48676 	Fget_nodeName          uintptr
  48677 	Fget_nodeValue         uintptr
  48678 	Fput_nodeValue         uintptr
  48679 	Fget_nodeType          uintptr
  48680 	Fget_parentNode        uintptr
  48681 	Fget_childNodes        uintptr
  48682 	Fget_firstChild        uintptr
  48683 	Fget_lastChild         uintptr
  48684 	Fget_previousSibling   uintptr
  48685 	Fget_nextSibling       uintptr
  48686 	Fget_attributes        uintptr
  48687 	FinsertBefore          uintptr
  48688 	FreplaceChild          uintptr
  48689 	FremoveChild           uintptr
  48690 	FappendChild           uintptr
  48691 	FhasChildNodes         uintptr
  48692 	Fget_ownerDocument     uintptr
  48693 	FcloneNode             uintptr
  48694 	Fget_nodeTypeString    uintptr
  48695 	Fget_text              uintptr
  48696 	Fput_text              uintptr
  48697 	Fget_specified         uintptr
  48698 	Fget_definition        uintptr
  48699 	Fget_nodeTypedValue    uintptr
  48700 	Fput_nodeTypedValue    uintptr
  48701 	Fget_dataType          uintptr
  48702 	Fput_dataType          uintptr
  48703 	Fget_xml               uintptr
  48704 	FtransformNode         uintptr
  48705 	FselectNodes           uintptr
  48706 	FselectSingleNode      uintptr
  48707 	Fget_parsed            uintptr
  48708 	Fget_namespaceURI      uintptr
  48709 	Fget_prefix            uintptr
  48710 	Fget_baseName          uintptr
  48711 	FtransformNodeToObject uintptr
  48712 }
  48713 
  48714 type IXMLDOMNodeVtbl = IXMLDOMNodeVtbl1
  48715 type IXMLDOMDocumentFragmentVtbl1 = struct {
  48716 	FQueryInterface        uintptr
  48717 	FAddRef                uintptr
  48718 	FRelease               uintptr
  48719 	FGetTypeInfoCount      uintptr
  48720 	FGetTypeInfo           uintptr
  48721 	FGetIDsOfNames         uintptr
  48722 	FInvoke                uintptr
  48723 	Fget_nodeName          uintptr
  48724 	Fget_nodeValue         uintptr
  48725 	Fput_nodeValue         uintptr
  48726 	Fget_nodeType          uintptr
  48727 	Fget_parentNode        uintptr
  48728 	Fget_childNodes        uintptr
  48729 	Fget_firstChild        uintptr
  48730 	Fget_lastChild         uintptr
  48731 	Fget_previousSibling   uintptr
  48732 	Fget_nextSibling       uintptr
  48733 	Fget_attributes        uintptr
  48734 	FinsertBefore          uintptr
  48735 	FreplaceChild          uintptr
  48736 	FremoveChild           uintptr
  48737 	FappendChild           uintptr
  48738 	FhasChildNodes         uintptr
  48739 	Fget_ownerDocument     uintptr
  48740 	FcloneNode             uintptr
  48741 	Fget_nodeTypeString    uintptr
  48742 	Fget_text              uintptr
  48743 	Fput_text              uintptr
  48744 	Fget_specified         uintptr
  48745 	Fget_definition        uintptr
  48746 	Fget_nodeTypedValue    uintptr
  48747 	Fput_nodeTypedValue    uintptr
  48748 	Fget_dataType          uintptr
  48749 	Fput_dataType          uintptr
  48750 	Fget_xml               uintptr
  48751 	FtransformNode         uintptr
  48752 	FselectNodes           uintptr
  48753 	FselectSingleNode      uintptr
  48754 	Fget_parsed            uintptr
  48755 	Fget_namespaceURI      uintptr
  48756 	Fget_prefix            uintptr
  48757 	Fget_baseName          uintptr
  48758 	FtransformNodeToObject uintptr
  48759 }
  48760 
  48761 type IXMLDOMDocumentFragmentVtbl = IXMLDOMDocumentFragmentVtbl1
  48762 type IXMLDOMDocumentVtbl1 = struct {
  48763 	FQueryInterface              uintptr
  48764 	FAddRef                      uintptr
  48765 	FRelease                     uintptr
  48766 	FGetTypeInfoCount            uintptr
  48767 	FGetTypeInfo                 uintptr
  48768 	FGetIDsOfNames               uintptr
  48769 	FInvoke                      uintptr
  48770 	Fget_nodeName                uintptr
  48771 	Fget_nodeValue               uintptr
  48772 	Fput_nodeValue               uintptr
  48773 	Fget_nodeType                uintptr
  48774 	Fget_parentNode              uintptr
  48775 	Fget_childNodes              uintptr
  48776 	Fget_firstChild              uintptr
  48777 	Fget_lastChild               uintptr
  48778 	Fget_previousSibling         uintptr
  48779 	Fget_nextSibling             uintptr
  48780 	Fget_attributes              uintptr
  48781 	FinsertBefore                uintptr
  48782 	FreplaceChild                uintptr
  48783 	FremoveChild                 uintptr
  48784 	FappendChild                 uintptr
  48785 	FhasChildNodes               uintptr
  48786 	Fget_ownerDocument           uintptr
  48787 	FcloneNode                   uintptr
  48788 	Fget_nodeTypeString          uintptr
  48789 	Fget_text                    uintptr
  48790 	Fput_text                    uintptr
  48791 	Fget_specified               uintptr
  48792 	Fget_definition              uintptr
  48793 	Fget_nodeTypedValue          uintptr
  48794 	Fput_nodeTypedValue          uintptr
  48795 	Fget_dataType                uintptr
  48796 	Fput_dataType                uintptr
  48797 	Fget_xml                     uintptr
  48798 	FtransformNode               uintptr
  48799 	FselectNodes                 uintptr
  48800 	FselectSingleNode            uintptr
  48801 	Fget_parsed                  uintptr
  48802 	Fget_namespaceURI            uintptr
  48803 	Fget_prefix                  uintptr
  48804 	Fget_baseName                uintptr
  48805 	FtransformNodeToObject       uintptr
  48806 	Fget_doctype                 uintptr
  48807 	Fget_implementation          uintptr
  48808 	Fget_documentElement         uintptr
  48809 	Fputref_documentElement      uintptr
  48810 	FcreateElement               uintptr
  48811 	FcreateDocumentFragment      uintptr
  48812 	FcreateTextNode              uintptr
  48813 	FcreateComment               uintptr
  48814 	FcreateCDATASection          uintptr
  48815 	FcreateProcessingInstruction uintptr
  48816 	FcreateAttribute             uintptr
  48817 	FcreateEntityReference       uintptr
  48818 	FgetElementsByTagName        uintptr
  48819 	FcreateNode                  uintptr
  48820 	FnodeFromID                  uintptr
  48821 	Fload                        uintptr
  48822 	Fget_readyState              uintptr
  48823 	Fget_parseError              uintptr
  48824 	Fget_url                     uintptr
  48825 	Fget_async                   uintptr
  48826 	Fput_async                   uintptr
  48827 	Fabort                       uintptr
  48828 	FloadXML                     uintptr
  48829 	Fsave                        uintptr
  48830 	Fget_validateOnParse         uintptr
  48831 	Fput_validateOnParse         uintptr
  48832 	Fget_resolveExternals        uintptr
  48833 	Fput_resolveExternals        uintptr
  48834 	Fget_preserveWhiteSpace      uintptr
  48835 	Fput_preserveWhiteSpace      uintptr
  48836 	Fput_onreadystatechange      uintptr
  48837 	Fput_ondataavailable         uintptr
  48838 	Fput_ontransformnode         uintptr
  48839 }
  48840 
  48841 type IXMLDOMDocumentVtbl = IXMLDOMDocumentVtbl1
  48842 type IXMLDOMNodeListVtbl1 = struct {
  48843 	FQueryInterface   uintptr
  48844 	FAddRef           uintptr
  48845 	FRelease          uintptr
  48846 	FGetTypeInfoCount uintptr
  48847 	FGetTypeInfo      uintptr
  48848 	FGetIDsOfNames    uintptr
  48849 	FInvoke           uintptr
  48850 	Fget_item         uintptr
  48851 	Fget_length       uintptr
  48852 	FnextNode         uintptr
  48853 	Freset            uintptr
  48854 	Fget__newEnum     uintptr
  48855 }
  48856 
  48857 type IXMLDOMNodeListVtbl = IXMLDOMNodeListVtbl1
  48858 type IXMLDOMNamedNodeMapVtbl1 = struct {
  48859 	FQueryInterface      uintptr
  48860 	FAddRef              uintptr
  48861 	FRelease             uintptr
  48862 	FGetTypeInfoCount    uintptr
  48863 	FGetTypeInfo         uintptr
  48864 	FGetIDsOfNames       uintptr
  48865 	FInvoke              uintptr
  48866 	FgetNamedItem        uintptr
  48867 	FsetNamedItem        uintptr
  48868 	FremoveNamedItem     uintptr
  48869 	Fget_item            uintptr
  48870 	Fget_length          uintptr
  48871 	FgetQualifiedItem    uintptr
  48872 	FremoveQualifiedItem uintptr
  48873 	FnextNode            uintptr
  48874 	Freset               uintptr
  48875 	Fget__newEnum        uintptr
  48876 }
  48877 
  48878 type IXMLDOMNamedNodeMapVtbl = IXMLDOMNamedNodeMapVtbl1
  48879 type IXMLDOMCharacterDataVtbl1 = struct {
  48880 	FQueryInterface        uintptr
  48881 	FAddRef                uintptr
  48882 	FRelease               uintptr
  48883 	FGetTypeInfoCount      uintptr
  48884 	FGetTypeInfo           uintptr
  48885 	FGetIDsOfNames         uintptr
  48886 	FInvoke                uintptr
  48887 	Fget_nodeName          uintptr
  48888 	Fget_nodeValue         uintptr
  48889 	Fput_nodeValue         uintptr
  48890 	Fget_nodeType          uintptr
  48891 	Fget_parentNode        uintptr
  48892 	Fget_childNodes        uintptr
  48893 	Fget_firstChild        uintptr
  48894 	Fget_lastChild         uintptr
  48895 	Fget_previousSibling   uintptr
  48896 	Fget_nextSibling       uintptr
  48897 	Fget_attributes        uintptr
  48898 	FinsertBefore          uintptr
  48899 	FreplaceChild          uintptr
  48900 	FremoveChild           uintptr
  48901 	FappendChild           uintptr
  48902 	FhasChildNodes         uintptr
  48903 	Fget_ownerDocument     uintptr
  48904 	FcloneNode             uintptr
  48905 	Fget_nodeTypeString    uintptr
  48906 	Fget_text              uintptr
  48907 	Fput_text              uintptr
  48908 	Fget_specified         uintptr
  48909 	Fget_definition        uintptr
  48910 	Fget_nodeTypedValue    uintptr
  48911 	Fput_nodeTypedValue    uintptr
  48912 	Fget_dataType          uintptr
  48913 	Fput_dataType          uintptr
  48914 	Fget_xml               uintptr
  48915 	FtransformNode         uintptr
  48916 	FselectNodes           uintptr
  48917 	FselectSingleNode      uintptr
  48918 	Fget_parsed            uintptr
  48919 	Fget_namespaceURI      uintptr
  48920 	Fget_prefix            uintptr
  48921 	Fget_baseName          uintptr
  48922 	FtransformNodeToObject uintptr
  48923 	Fget_data              uintptr
  48924 	Fput_data              uintptr
  48925 	Fget_length            uintptr
  48926 	FsubstringData         uintptr
  48927 	FappendData            uintptr
  48928 	FinsertData            uintptr
  48929 	FdeleteData            uintptr
  48930 	FreplaceData           uintptr
  48931 }
  48932 
  48933 type IXMLDOMCharacterDataVtbl = IXMLDOMCharacterDataVtbl1
  48934 type IXMLDOMAttributeVtbl1 = struct {
  48935 	FQueryInterface        uintptr
  48936 	FAddRef                uintptr
  48937 	FRelease               uintptr
  48938 	FGetTypeInfoCount      uintptr
  48939 	FGetTypeInfo           uintptr
  48940 	FGetIDsOfNames         uintptr
  48941 	FInvoke                uintptr
  48942 	Fget_nodeName          uintptr
  48943 	Fget_nodeValue         uintptr
  48944 	Fput_nodeValue         uintptr
  48945 	Fget_nodeType          uintptr
  48946 	Fget_parentNode        uintptr
  48947 	Fget_childNodes        uintptr
  48948 	Fget_firstChild        uintptr
  48949 	Fget_lastChild         uintptr
  48950 	Fget_previousSibling   uintptr
  48951 	Fget_nextSibling       uintptr
  48952 	Fget_attributes        uintptr
  48953 	FinsertBefore          uintptr
  48954 	FreplaceChild          uintptr
  48955 	FremoveChild           uintptr
  48956 	FappendChild           uintptr
  48957 	FhasChildNodes         uintptr
  48958 	Fget_ownerDocument     uintptr
  48959 	FcloneNode             uintptr
  48960 	Fget_nodeTypeString    uintptr
  48961 	Fget_text              uintptr
  48962 	Fput_text              uintptr
  48963 	Fget_specified         uintptr
  48964 	Fget_definition        uintptr
  48965 	Fget_nodeTypedValue    uintptr
  48966 	Fput_nodeTypedValue    uintptr
  48967 	Fget_dataType          uintptr
  48968 	Fput_dataType          uintptr
  48969 	Fget_xml               uintptr
  48970 	FtransformNode         uintptr
  48971 	FselectNodes           uintptr
  48972 	FselectSingleNode      uintptr
  48973 	Fget_parsed            uintptr
  48974 	Fget_namespaceURI      uintptr
  48975 	Fget_prefix            uintptr
  48976 	Fget_baseName          uintptr
  48977 	FtransformNodeToObject uintptr
  48978 	Fget_name              uintptr
  48979 	Fget_value             uintptr
  48980 	Fput_value             uintptr
  48981 }
  48982 
  48983 type IXMLDOMAttributeVtbl = IXMLDOMAttributeVtbl1
  48984 type IXMLDOMElementVtbl1 = struct {
  48985 	FQueryInterface        uintptr
  48986 	FAddRef                uintptr
  48987 	FRelease               uintptr
  48988 	FGetTypeInfoCount      uintptr
  48989 	FGetTypeInfo           uintptr
  48990 	FGetIDsOfNames         uintptr
  48991 	FInvoke                uintptr
  48992 	Fget_nodeName          uintptr
  48993 	Fget_nodeValue         uintptr
  48994 	Fput_nodeValue         uintptr
  48995 	Fget_nodeType          uintptr
  48996 	Fget_parentNode        uintptr
  48997 	Fget_childNodes        uintptr
  48998 	Fget_firstChild        uintptr
  48999 	Fget_lastChild         uintptr
  49000 	Fget_previousSibling   uintptr
  49001 	Fget_nextSibling       uintptr
  49002 	Fget_attributes        uintptr
  49003 	FinsertBefore          uintptr
  49004 	FreplaceChild          uintptr
  49005 	FremoveChild           uintptr
  49006 	FappendChild           uintptr
  49007 	FhasChildNodes         uintptr
  49008 	Fget_ownerDocument     uintptr
  49009 	FcloneNode             uintptr
  49010 	Fget_nodeTypeString    uintptr
  49011 	Fget_text              uintptr
  49012 	Fput_text              uintptr
  49013 	Fget_specified         uintptr
  49014 	Fget_definition        uintptr
  49015 	Fget_nodeTypedValue    uintptr
  49016 	Fput_nodeTypedValue    uintptr
  49017 	Fget_dataType          uintptr
  49018 	Fput_dataType          uintptr
  49019 	Fget_xml               uintptr
  49020 	FtransformNode         uintptr
  49021 	FselectNodes           uintptr
  49022 	FselectSingleNode      uintptr
  49023 	Fget_parsed            uintptr
  49024 	Fget_namespaceURI      uintptr
  49025 	Fget_prefix            uintptr
  49026 	Fget_baseName          uintptr
  49027 	FtransformNodeToObject uintptr
  49028 	Fget_tagName           uintptr
  49029 	FgetAttribute          uintptr
  49030 	FsetAttribute          uintptr
  49031 	FremoveAttribute       uintptr
  49032 	FgetAttributeNode      uintptr
  49033 	FsetAttributeNode      uintptr
  49034 	FremoveAttributeNode   uintptr
  49035 	FgetElementsByTagName  uintptr
  49036 	Fnormalize             uintptr
  49037 }
  49038 
  49039 type IXMLDOMElementVtbl = IXMLDOMElementVtbl1
  49040 type IXMLDOMTextVtbl1 = struct {
  49041 	FQueryInterface        uintptr
  49042 	FAddRef                uintptr
  49043 	FRelease               uintptr
  49044 	FGetTypeInfoCount      uintptr
  49045 	FGetTypeInfo           uintptr
  49046 	FGetIDsOfNames         uintptr
  49047 	FInvoke                uintptr
  49048 	Fget_nodeName          uintptr
  49049 	Fget_nodeValue         uintptr
  49050 	Fput_nodeValue         uintptr
  49051 	Fget_nodeType          uintptr
  49052 	Fget_parentNode        uintptr
  49053 	Fget_childNodes        uintptr
  49054 	Fget_firstChild        uintptr
  49055 	Fget_lastChild         uintptr
  49056 	Fget_previousSibling   uintptr
  49057 	Fget_nextSibling       uintptr
  49058 	Fget_attributes        uintptr
  49059 	FinsertBefore          uintptr
  49060 	FreplaceChild          uintptr
  49061 	FremoveChild           uintptr
  49062 	FappendChild           uintptr
  49063 	FhasChildNodes         uintptr
  49064 	Fget_ownerDocument     uintptr
  49065 	FcloneNode             uintptr
  49066 	Fget_nodeTypeString    uintptr
  49067 	Fget_text              uintptr
  49068 	Fput_text              uintptr
  49069 	Fget_specified         uintptr
  49070 	Fget_definition        uintptr
  49071 	Fget_nodeTypedValue    uintptr
  49072 	Fput_nodeTypedValue    uintptr
  49073 	Fget_dataType          uintptr
  49074 	Fput_dataType          uintptr
  49075 	Fget_xml               uintptr
  49076 	FtransformNode         uintptr
  49077 	FselectNodes           uintptr
  49078 	FselectSingleNode      uintptr
  49079 	Fget_parsed            uintptr
  49080 	Fget_namespaceURI      uintptr
  49081 	Fget_prefix            uintptr
  49082 	Fget_baseName          uintptr
  49083 	FtransformNodeToObject uintptr
  49084 	Fget_data              uintptr
  49085 	Fput_data              uintptr
  49086 	Fget_length            uintptr
  49087 	FsubstringData         uintptr
  49088 	FappendData            uintptr
  49089 	FinsertData            uintptr
  49090 	FdeleteData            uintptr
  49091 	FreplaceData           uintptr
  49092 	FsplitText             uintptr
  49093 }
  49094 
  49095 type IXMLDOMTextVtbl = IXMLDOMTextVtbl1
  49096 type IXMLDOMCommentVtbl1 = struct {
  49097 	FQueryInterface        uintptr
  49098 	FAddRef                uintptr
  49099 	FRelease               uintptr
  49100 	FGetTypeInfoCount      uintptr
  49101 	FGetTypeInfo           uintptr
  49102 	FGetIDsOfNames         uintptr
  49103 	FInvoke                uintptr
  49104 	Fget_nodeName          uintptr
  49105 	Fget_nodeValue         uintptr
  49106 	Fput_nodeValue         uintptr
  49107 	Fget_nodeType          uintptr
  49108 	Fget_parentNode        uintptr
  49109 	Fget_childNodes        uintptr
  49110 	Fget_firstChild        uintptr
  49111 	Fget_lastChild         uintptr
  49112 	Fget_previousSibling   uintptr
  49113 	Fget_nextSibling       uintptr
  49114 	Fget_attributes        uintptr
  49115 	FinsertBefore          uintptr
  49116 	FreplaceChild          uintptr
  49117 	FremoveChild           uintptr
  49118 	FappendChild           uintptr
  49119 	FhasChildNodes         uintptr
  49120 	Fget_ownerDocument     uintptr
  49121 	FcloneNode             uintptr
  49122 	Fget_nodeTypeString    uintptr
  49123 	Fget_text              uintptr
  49124 	Fput_text              uintptr
  49125 	Fget_specified         uintptr
  49126 	Fget_definition        uintptr
  49127 	Fget_nodeTypedValue    uintptr
  49128 	Fput_nodeTypedValue    uintptr
  49129 	Fget_dataType          uintptr
  49130 	Fput_dataType          uintptr
  49131 	Fget_xml               uintptr
  49132 	FtransformNode         uintptr
  49133 	FselectNodes           uintptr
  49134 	FselectSingleNode      uintptr
  49135 	Fget_parsed            uintptr
  49136 	Fget_namespaceURI      uintptr
  49137 	Fget_prefix            uintptr
  49138 	Fget_baseName          uintptr
  49139 	FtransformNodeToObject uintptr
  49140 	Fget_data              uintptr
  49141 	Fput_data              uintptr
  49142 	Fget_length            uintptr
  49143 	FsubstringData         uintptr
  49144 	FappendData            uintptr
  49145 	FinsertData            uintptr
  49146 	FdeleteData            uintptr
  49147 	FreplaceData           uintptr
  49148 }
  49149 
  49150 type IXMLDOMCommentVtbl = IXMLDOMCommentVtbl1
  49151 type IXMLDOMProcessingInstructionVtbl1 = struct {
  49152 	FQueryInterface        uintptr
  49153 	FAddRef                uintptr
  49154 	FRelease               uintptr
  49155 	FGetTypeInfoCount      uintptr
  49156 	FGetTypeInfo           uintptr
  49157 	FGetIDsOfNames         uintptr
  49158 	FInvoke                uintptr
  49159 	Fget_nodeName          uintptr
  49160 	Fget_nodeValue         uintptr
  49161 	Fput_nodeValue         uintptr
  49162 	Fget_nodeType          uintptr
  49163 	Fget_parentNode        uintptr
  49164 	Fget_childNodes        uintptr
  49165 	Fget_firstChild        uintptr
  49166 	Fget_lastChild         uintptr
  49167 	Fget_previousSibling   uintptr
  49168 	Fget_nextSibling       uintptr
  49169 	Fget_attributes        uintptr
  49170 	FinsertBefore          uintptr
  49171 	FreplaceChild          uintptr
  49172 	FremoveChild           uintptr
  49173 	FappendChild           uintptr
  49174 	FhasChildNodes         uintptr
  49175 	Fget_ownerDocument     uintptr
  49176 	FcloneNode             uintptr
  49177 	Fget_nodeTypeString    uintptr
  49178 	Fget_text              uintptr
  49179 	Fput_text              uintptr
  49180 	Fget_specified         uintptr
  49181 	Fget_definition        uintptr
  49182 	Fget_nodeTypedValue    uintptr
  49183 	Fput_nodeTypedValue    uintptr
  49184 	Fget_dataType          uintptr
  49185 	Fput_dataType          uintptr
  49186 	Fget_xml               uintptr
  49187 	FtransformNode         uintptr
  49188 	FselectNodes           uintptr
  49189 	FselectSingleNode      uintptr
  49190 	Fget_parsed            uintptr
  49191 	Fget_namespaceURI      uintptr
  49192 	Fget_prefix            uintptr
  49193 	Fget_baseName          uintptr
  49194 	FtransformNodeToObject uintptr
  49195 	Fget_target            uintptr
  49196 	Fget_data              uintptr
  49197 	Fput_data              uintptr
  49198 }
  49199 
  49200 type IXMLDOMProcessingInstructionVtbl = IXMLDOMProcessingInstructionVtbl1
  49201 type IXMLDOMCDATASectionVtbl1 = struct {
  49202 	FQueryInterface        uintptr
  49203 	FAddRef                uintptr
  49204 	FRelease               uintptr
  49205 	FGetTypeInfoCount      uintptr
  49206 	FGetTypeInfo           uintptr
  49207 	FGetIDsOfNames         uintptr
  49208 	FInvoke                uintptr
  49209 	Fget_nodeName          uintptr
  49210 	Fget_nodeValue         uintptr
  49211 	Fput_nodeValue         uintptr
  49212 	Fget_nodeType          uintptr
  49213 	Fget_parentNode        uintptr
  49214 	Fget_childNodes        uintptr
  49215 	Fget_firstChild        uintptr
  49216 	Fget_lastChild         uintptr
  49217 	Fget_previousSibling   uintptr
  49218 	Fget_nextSibling       uintptr
  49219 	Fget_attributes        uintptr
  49220 	FinsertBefore          uintptr
  49221 	FreplaceChild          uintptr
  49222 	FremoveChild           uintptr
  49223 	FappendChild           uintptr
  49224 	FhasChildNodes         uintptr
  49225 	Fget_ownerDocument     uintptr
  49226 	FcloneNode             uintptr
  49227 	Fget_nodeTypeString    uintptr
  49228 	Fget_text              uintptr
  49229 	Fput_text              uintptr
  49230 	Fget_specified         uintptr
  49231 	Fget_definition        uintptr
  49232 	Fget_nodeTypedValue    uintptr
  49233 	Fput_nodeTypedValue    uintptr
  49234 	Fget_dataType          uintptr
  49235 	Fput_dataType          uintptr
  49236 	Fget_xml               uintptr
  49237 	FtransformNode         uintptr
  49238 	FselectNodes           uintptr
  49239 	FselectSingleNode      uintptr
  49240 	Fget_parsed            uintptr
  49241 	Fget_namespaceURI      uintptr
  49242 	Fget_prefix            uintptr
  49243 	Fget_baseName          uintptr
  49244 	FtransformNodeToObject uintptr
  49245 	Fget_data              uintptr
  49246 	Fput_data              uintptr
  49247 	Fget_length            uintptr
  49248 	FsubstringData         uintptr
  49249 	FappendData            uintptr
  49250 	FinsertData            uintptr
  49251 	FdeleteData            uintptr
  49252 	FreplaceData           uintptr
  49253 	FsplitText             uintptr
  49254 }
  49255 
  49256 type IXMLDOMCDATASectionVtbl = IXMLDOMCDATASectionVtbl1
  49257 type IXMLDOMDocumentTypeVtbl1 = struct {
  49258 	FQueryInterface        uintptr
  49259 	FAddRef                uintptr
  49260 	FRelease               uintptr
  49261 	FGetTypeInfoCount      uintptr
  49262 	FGetTypeInfo           uintptr
  49263 	FGetIDsOfNames         uintptr
  49264 	FInvoke                uintptr
  49265 	Fget_nodeName          uintptr
  49266 	Fget_nodeValue         uintptr
  49267 	Fput_nodeValue         uintptr
  49268 	Fget_nodeType          uintptr
  49269 	Fget_parentNode        uintptr
  49270 	Fget_childNodes        uintptr
  49271 	Fget_firstChild        uintptr
  49272 	Fget_lastChild         uintptr
  49273 	Fget_previousSibling   uintptr
  49274 	Fget_nextSibling       uintptr
  49275 	Fget_attributes        uintptr
  49276 	FinsertBefore          uintptr
  49277 	FreplaceChild          uintptr
  49278 	FremoveChild           uintptr
  49279 	FappendChild           uintptr
  49280 	FhasChildNodes         uintptr
  49281 	Fget_ownerDocument     uintptr
  49282 	FcloneNode             uintptr
  49283 	Fget_nodeTypeString    uintptr
  49284 	Fget_text              uintptr
  49285 	Fput_text              uintptr
  49286 	Fget_specified         uintptr
  49287 	Fget_definition        uintptr
  49288 	Fget_nodeTypedValue    uintptr
  49289 	Fput_nodeTypedValue    uintptr
  49290 	Fget_dataType          uintptr
  49291 	Fput_dataType          uintptr
  49292 	Fget_xml               uintptr
  49293 	FtransformNode         uintptr
  49294 	FselectNodes           uintptr
  49295 	FselectSingleNode      uintptr
  49296 	Fget_parsed            uintptr
  49297 	Fget_namespaceURI      uintptr
  49298 	Fget_prefix            uintptr
  49299 	Fget_baseName          uintptr
  49300 	FtransformNodeToObject uintptr
  49301 	Fget_name              uintptr
  49302 	Fget_entities          uintptr
  49303 	Fget_notations         uintptr
  49304 }
  49305 
  49306 type IXMLDOMDocumentTypeVtbl = IXMLDOMDocumentTypeVtbl1
  49307 type IXMLDOMNotationVtbl1 = struct {
  49308 	FQueryInterface        uintptr
  49309 	FAddRef                uintptr
  49310 	FRelease               uintptr
  49311 	FGetTypeInfoCount      uintptr
  49312 	FGetTypeInfo           uintptr
  49313 	FGetIDsOfNames         uintptr
  49314 	FInvoke                uintptr
  49315 	Fget_nodeName          uintptr
  49316 	Fget_nodeValue         uintptr
  49317 	Fput_nodeValue         uintptr
  49318 	Fget_nodeType          uintptr
  49319 	Fget_parentNode        uintptr
  49320 	Fget_childNodes        uintptr
  49321 	Fget_firstChild        uintptr
  49322 	Fget_lastChild         uintptr
  49323 	Fget_previousSibling   uintptr
  49324 	Fget_nextSibling       uintptr
  49325 	Fget_attributes        uintptr
  49326 	FinsertBefore          uintptr
  49327 	FreplaceChild          uintptr
  49328 	FremoveChild           uintptr
  49329 	FappendChild           uintptr
  49330 	FhasChildNodes         uintptr
  49331 	Fget_ownerDocument     uintptr
  49332 	FcloneNode             uintptr
  49333 	Fget_nodeTypeString    uintptr
  49334 	Fget_text              uintptr
  49335 	Fput_text              uintptr
  49336 	Fget_specified         uintptr
  49337 	Fget_definition        uintptr
  49338 	Fget_nodeTypedValue    uintptr
  49339 	Fput_nodeTypedValue    uintptr
  49340 	Fget_dataType          uintptr
  49341 	Fput_dataType          uintptr
  49342 	Fget_xml               uintptr
  49343 	FtransformNode         uintptr
  49344 	FselectNodes           uintptr
  49345 	FselectSingleNode      uintptr
  49346 	Fget_parsed            uintptr
  49347 	Fget_namespaceURI      uintptr
  49348 	Fget_prefix            uintptr
  49349 	Fget_baseName          uintptr
  49350 	FtransformNodeToObject uintptr
  49351 	Fget_publicId          uintptr
  49352 	Fget_systemId          uintptr
  49353 }
  49354 
  49355 type IXMLDOMNotationVtbl = IXMLDOMNotationVtbl1
  49356 type IXMLDOMEntityVtbl1 = struct {
  49357 	FQueryInterface        uintptr
  49358 	FAddRef                uintptr
  49359 	FRelease               uintptr
  49360 	FGetTypeInfoCount      uintptr
  49361 	FGetTypeInfo           uintptr
  49362 	FGetIDsOfNames         uintptr
  49363 	FInvoke                uintptr
  49364 	Fget_nodeName          uintptr
  49365 	Fget_nodeValue         uintptr
  49366 	Fput_nodeValue         uintptr
  49367 	Fget_nodeType          uintptr
  49368 	Fget_parentNode        uintptr
  49369 	Fget_childNodes        uintptr
  49370 	Fget_firstChild        uintptr
  49371 	Fget_lastChild         uintptr
  49372 	Fget_previousSibling   uintptr
  49373 	Fget_nextSibling       uintptr
  49374 	Fget_attributes        uintptr
  49375 	FinsertBefore          uintptr
  49376 	FreplaceChild          uintptr
  49377 	FremoveChild           uintptr
  49378 	FappendChild           uintptr
  49379 	FhasChildNodes         uintptr
  49380 	Fget_ownerDocument     uintptr
  49381 	FcloneNode             uintptr
  49382 	Fget_nodeTypeString    uintptr
  49383 	Fget_text              uintptr
  49384 	Fput_text              uintptr
  49385 	Fget_specified         uintptr
  49386 	Fget_definition        uintptr
  49387 	Fget_nodeTypedValue    uintptr
  49388 	Fput_nodeTypedValue    uintptr
  49389 	Fget_dataType          uintptr
  49390 	Fput_dataType          uintptr
  49391 	Fget_xml               uintptr
  49392 	FtransformNode         uintptr
  49393 	FselectNodes           uintptr
  49394 	FselectSingleNode      uintptr
  49395 	Fget_parsed            uintptr
  49396 	Fget_namespaceURI      uintptr
  49397 	Fget_prefix            uintptr
  49398 	Fget_baseName          uintptr
  49399 	FtransformNodeToObject uintptr
  49400 	Fget_publicId          uintptr
  49401 	Fget_systemId          uintptr
  49402 	Fget_notationName      uintptr
  49403 }
  49404 
  49405 type IXMLDOMEntityVtbl = IXMLDOMEntityVtbl1
  49406 type IXMLDOMEntityReferenceVtbl1 = struct {
  49407 	FQueryInterface        uintptr
  49408 	FAddRef                uintptr
  49409 	FRelease               uintptr
  49410 	FGetTypeInfoCount      uintptr
  49411 	FGetTypeInfo           uintptr
  49412 	FGetIDsOfNames         uintptr
  49413 	FInvoke                uintptr
  49414 	Fget_nodeName          uintptr
  49415 	Fget_nodeValue         uintptr
  49416 	Fput_nodeValue         uintptr
  49417 	Fget_nodeType          uintptr
  49418 	Fget_parentNode        uintptr
  49419 	Fget_childNodes        uintptr
  49420 	Fget_firstChild        uintptr
  49421 	Fget_lastChild         uintptr
  49422 	Fget_previousSibling   uintptr
  49423 	Fget_nextSibling       uintptr
  49424 	Fget_attributes        uintptr
  49425 	FinsertBefore          uintptr
  49426 	FreplaceChild          uintptr
  49427 	FremoveChild           uintptr
  49428 	FappendChild           uintptr
  49429 	FhasChildNodes         uintptr
  49430 	Fget_ownerDocument     uintptr
  49431 	FcloneNode             uintptr
  49432 	Fget_nodeTypeString    uintptr
  49433 	Fget_text              uintptr
  49434 	Fput_text              uintptr
  49435 	Fget_specified         uintptr
  49436 	Fget_definition        uintptr
  49437 	Fget_nodeTypedValue    uintptr
  49438 	Fput_nodeTypedValue    uintptr
  49439 	Fget_dataType          uintptr
  49440 	Fput_dataType          uintptr
  49441 	Fget_xml               uintptr
  49442 	FtransformNode         uintptr
  49443 	FselectNodes           uintptr
  49444 	FselectSingleNode      uintptr
  49445 	Fget_parsed            uintptr
  49446 	Fget_namespaceURI      uintptr
  49447 	Fget_prefix            uintptr
  49448 	Fget_baseName          uintptr
  49449 	FtransformNodeToObject uintptr
  49450 }
  49451 
  49452 type IXMLDOMEntityReferenceVtbl = IXMLDOMEntityReferenceVtbl1
  49453 type IXMLDOMParseErrorVtbl1 = struct {
  49454 	FQueryInterface   uintptr
  49455 	FAddRef           uintptr
  49456 	FRelease          uintptr
  49457 	FGetTypeInfoCount uintptr
  49458 	FGetTypeInfo      uintptr
  49459 	FGetIDsOfNames    uintptr
  49460 	FInvoke           uintptr
  49461 	Fget_errorCode    uintptr
  49462 	Fget_url          uintptr
  49463 	Fget_reason       uintptr
  49464 	Fget_srcText      uintptr
  49465 	Fget_line         uintptr
  49466 	Fget_linepos      uintptr
  49467 	Fget_filepos      uintptr
  49468 }
  49469 
  49470 type IXMLDOMParseErrorVtbl = IXMLDOMParseErrorVtbl1
  49471 type IXTLRuntimeVtbl1 = struct {
  49472 	FQueryInterface        uintptr
  49473 	FAddRef                uintptr
  49474 	FRelease               uintptr
  49475 	FGetTypeInfoCount      uintptr
  49476 	FGetTypeInfo           uintptr
  49477 	FGetIDsOfNames         uintptr
  49478 	FInvoke                uintptr
  49479 	Fget_nodeName          uintptr
  49480 	Fget_nodeValue         uintptr
  49481 	Fput_nodeValue         uintptr
  49482 	Fget_nodeType          uintptr
  49483 	Fget_parentNode        uintptr
  49484 	Fget_childNodes        uintptr
  49485 	Fget_firstChild        uintptr
  49486 	Fget_lastChild         uintptr
  49487 	Fget_previousSibling   uintptr
  49488 	Fget_nextSibling       uintptr
  49489 	Fget_attributes        uintptr
  49490 	FinsertBefore          uintptr
  49491 	FreplaceChild          uintptr
  49492 	FremoveChild           uintptr
  49493 	FappendChild           uintptr
  49494 	FhasChildNodes         uintptr
  49495 	Fget_ownerDocument     uintptr
  49496 	FcloneNode             uintptr
  49497 	Fget_nodeTypeString    uintptr
  49498 	Fget_text              uintptr
  49499 	Fput_text              uintptr
  49500 	Fget_specified         uintptr
  49501 	Fget_definition        uintptr
  49502 	Fget_nodeTypedValue    uintptr
  49503 	Fput_nodeTypedValue    uintptr
  49504 	Fget_dataType          uintptr
  49505 	Fput_dataType          uintptr
  49506 	Fget_xml               uintptr
  49507 	FtransformNode         uintptr
  49508 	FselectNodes           uintptr
  49509 	FselectSingleNode      uintptr
  49510 	Fget_parsed            uintptr
  49511 	Fget_namespaceURI      uintptr
  49512 	Fget_prefix            uintptr
  49513 	Fget_baseName          uintptr
  49514 	FtransformNodeToObject uintptr
  49515 	FuniqueID              uintptr
  49516 	Fdepth                 uintptr
  49517 	FchildNumber           uintptr
  49518 	FancestorChildNumber   uintptr
  49519 	FabsoluteChildNumber   uintptr
  49520 	FformatIndex           uintptr
  49521 	FformatNumber          uintptr
  49522 	FformatDate            uintptr
  49523 	FformatTime            uintptr
  49524 }
  49525 
  49526 type IXTLRuntimeVtbl = IXTLRuntimeVtbl1
  49527 type XMLDOMDocumentEventsVtbl1 = struct {
  49528 	FQueryInterface   uintptr
  49529 	FAddRef           uintptr
  49530 	FRelease          uintptr
  49531 	FGetTypeInfoCount uintptr
  49532 	FGetTypeInfo      uintptr
  49533 	FGetIDsOfNames    uintptr
  49534 	FInvoke           uintptr
  49535 }
  49536 
  49537 type XMLDOMDocumentEventsVtbl = XMLDOMDocumentEventsVtbl1
  49538 type IXMLHttpRequestVtbl1 = struct {
  49539 	FQueryInterface         uintptr
  49540 	FAddRef                 uintptr
  49541 	FRelease                uintptr
  49542 	FGetTypeInfoCount       uintptr
  49543 	FGetTypeInfo            uintptr
  49544 	FGetIDsOfNames          uintptr
  49545 	FInvoke                 uintptr
  49546 	Fopen                   uintptr
  49547 	FsetRequestHeader       uintptr
  49548 	FgetResponseHeader      uintptr
  49549 	FgetAllResponseHeaders  uintptr
  49550 	Fsend                   uintptr
  49551 	Fabort                  uintptr
  49552 	Fget_status             uintptr
  49553 	Fget_statusText         uintptr
  49554 	Fget_responseXML        uintptr
  49555 	Fget_responseText       uintptr
  49556 	Fget_responseBody       uintptr
  49557 	Fget_responseStream     uintptr
  49558 	Fget_readyState         uintptr
  49559 	Fput_onreadystatechange uintptr
  49560 }
  49561 
  49562 type IXMLHttpRequestVtbl = IXMLHttpRequestVtbl1
  49563 type IXMLDSOControlVtbl1 = struct {
  49564 	FQueryInterface        uintptr
  49565 	FAddRef                uintptr
  49566 	FRelease               uintptr
  49567 	FGetTypeInfoCount      uintptr
  49568 	FGetTypeInfo           uintptr
  49569 	FGetIDsOfNames         uintptr
  49570 	FInvoke                uintptr
  49571 	Fget_XMLDocument       uintptr
  49572 	Fput_XMLDocument       uintptr
  49573 	Fget_JavaDSOCompatible uintptr
  49574 	Fput_JavaDSOCompatible uintptr
  49575 	Fget_readyState        uintptr
  49576 }
  49577 
  49578 type IXMLDSOControlVtbl = IXMLDSOControlVtbl1
  49579 type IXMLElementCollectionVtbl1 = struct {
  49580 	FQueryInterface   uintptr
  49581 	FAddRef           uintptr
  49582 	FRelease          uintptr
  49583 	FGetTypeInfoCount uintptr
  49584 	FGetTypeInfo      uintptr
  49585 	FGetIDsOfNames    uintptr
  49586 	FInvoke           uintptr
  49587 	Fput_length       uintptr
  49588 	Fget_length       uintptr
  49589 	Fget__newEnum     uintptr
  49590 	Fitem             uintptr
  49591 }
  49592 
  49593 type IXMLElementCollectionVtbl = IXMLElementCollectionVtbl1
  49594 type IXMLDocumentVtbl1 = struct {
  49595 	FQueryInterface       uintptr
  49596 	FAddRef               uintptr
  49597 	FRelease              uintptr
  49598 	FGetTypeInfoCount     uintptr
  49599 	FGetTypeInfo          uintptr
  49600 	FGetIDsOfNames        uintptr
  49601 	FInvoke               uintptr
  49602 	Fget_root             uintptr
  49603 	Fget_fileSize         uintptr
  49604 	Fget_fileModifiedDate uintptr
  49605 	Fget_fileUpdatedDate  uintptr
  49606 	Fget_URL              uintptr
  49607 	Fput_URL              uintptr
  49608 	Fget_mimeType         uintptr
  49609 	Fget_readyState       uintptr
  49610 	Fget_charset          uintptr
  49611 	Fput_charset          uintptr
  49612 	Fget_version          uintptr
  49613 	Fget_doctype          uintptr
  49614 	Fget_dtdURL           uintptr
  49615 	FcreateElement        uintptr
  49616 }
  49617 
  49618 type IXMLDocumentVtbl = IXMLDocumentVtbl1
  49619 type IXMLDocument2Vtbl1 = struct {
  49620 	FQueryInterface       uintptr
  49621 	FAddRef               uintptr
  49622 	FRelease              uintptr
  49623 	FGetTypeInfoCount     uintptr
  49624 	FGetTypeInfo          uintptr
  49625 	FGetIDsOfNames        uintptr
  49626 	FInvoke               uintptr
  49627 	Fget_root             uintptr
  49628 	Fget_fileSize         uintptr
  49629 	Fget_fileModifiedDate uintptr
  49630 	Fget_fileUpdatedDate  uintptr
  49631 	Fget_URL              uintptr
  49632 	Fput_URL              uintptr
  49633 	Fget_mimeType         uintptr
  49634 	Fget_readyState       uintptr
  49635 	Fget_charset          uintptr
  49636 	Fput_charset          uintptr
  49637 	Fget_version          uintptr
  49638 	Fget_doctype          uintptr
  49639 	Fget_dtdURL           uintptr
  49640 	FcreateElement        uintptr
  49641 	Fget_async            uintptr
  49642 	Fput_async            uintptr
  49643 }
  49644 
  49645 type IXMLDocument2Vtbl = IXMLDocument2Vtbl1
  49646 type IXMLElementVtbl1 = struct {
  49647 	FQueryInterface   uintptr
  49648 	FAddRef           uintptr
  49649 	FRelease          uintptr
  49650 	FGetTypeInfoCount uintptr
  49651 	FGetTypeInfo      uintptr
  49652 	FGetIDsOfNames    uintptr
  49653 	FInvoke           uintptr
  49654 	Fget_tagName      uintptr
  49655 	Fput_tagName      uintptr
  49656 	Fget_parent       uintptr
  49657 	FsetAttribute     uintptr
  49658 	FgetAttribute     uintptr
  49659 	FremoveAttribute  uintptr
  49660 	Fget_children     uintptr
  49661 	Fget_type         uintptr
  49662 	Fget_text         uintptr
  49663 	Fput_text         uintptr
  49664 	FaddChild         uintptr
  49665 	FremoveChild      uintptr
  49666 }
  49667 
  49668 type IXMLElementVtbl = IXMLElementVtbl1
  49669 type IXMLElement2Vtbl1 = struct {
  49670 	FQueryInterface   uintptr
  49671 	FAddRef           uintptr
  49672 	FRelease          uintptr
  49673 	FGetTypeInfoCount uintptr
  49674 	FGetTypeInfo      uintptr
  49675 	FGetIDsOfNames    uintptr
  49676 	FInvoke           uintptr
  49677 	Fget_tagName      uintptr
  49678 	Fput_tagName      uintptr
  49679 	Fget_parent       uintptr
  49680 	FsetAttribute     uintptr
  49681 	FgetAttribute     uintptr
  49682 	FremoveAttribute  uintptr
  49683 	Fget_children     uintptr
  49684 	Fget_type         uintptr
  49685 	Fget_text         uintptr
  49686 	Fput_text         uintptr
  49687 	FaddChild         uintptr
  49688 	FremoveChild      uintptr
  49689 	Fget_attributes   uintptr
  49690 }
  49691 
  49692 type IXMLElement2Vtbl = IXMLElement2Vtbl1
  49693 type IXMLAttributeVtbl1 = struct {
  49694 	FQueryInterface   uintptr
  49695 	FAddRef           uintptr
  49696 	FRelease          uintptr
  49697 	FGetTypeInfoCount uintptr
  49698 	FGetTypeInfo      uintptr
  49699 	FGetIDsOfNames    uintptr
  49700 	FInvoke           uintptr
  49701 	Fget_name         uintptr
  49702 	Fget_value        uintptr
  49703 }
  49704 
  49705 type IXMLAttributeVtbl = IXMLAttributeVtbl1
  49706 type IXMLErrorVtbl1 = struct {
  49707 	FQueryInterface uintptr
  49708 	FAddRef         uintptr
  49709 	FRelease        uintptr
  49710 	FGetErrorInfo   uintptr
  49711 }
  49712 
  49713 type IXMLErrorVtbl = IXMLErrorVtbl1
  49714 
  49715 type LPPERSISTMONIKER = uintptr
  49716 type IPersistMonikerVtbl1 = struct {
  49717 	FQueryInterface uintptr
  49718 	FAddRef         uintptr
  49719 	FRelease        uintptr
  49720 	FGetClassID     uintptr
  49721 	FIsDirty        uintptr
  49722 	FLoad           uintptr
  49723 	FSave           uintptr
  49724 	FSaveCompleted  uintptr
  49725 	FGetCurMoniker  uintptr
  49726 }
  49727 
  49728 type IPersistMonikerVtbl = IPersistMonikerVtbl1
  49729 
  49730 type LPMONIKERPROP = uintptr
  49731 
  49732 type MONIKERPROPERTY = uint32
  49733 type IMonikerPropVtbl1 = struct {
  49734 	FQueryInterface uintptr
  49735 	FAddRef         uintptr
  49736 	FRelease        uintptr
  49737 	FPutProperty    uintptr
  49738 }
  49739 
  49740 type IMonikerPropVtbl = IMonikerPropVtbl1
  49741 
  49742 type LPBINDPROTOCOL = uintptr
  49743 type IBindProtocolVtbl1 = struct {
  49744 	FQueryInterface uintptr
  49745 	FAddRef         uintptr
  49746 	FRelease        uintptr
  49747 	FCreateBinding  uintptr
  49748 }
  49749 
  49750 type IBindProtocolVtbl = IBindProtocolVtbl1
  49751 
  49752 type LPBINDING = uintptr
  49753 type IBindingVtbl1 = struct {
  49754 	FQueryInterface uintptr
  49755 	FAddRef         uintptr
  49756 	FRelease        uintptr
  49757 	FAbort          uintptr
  49758 	FSuspend        uintptr
  49759 	FResume         uintptr
  49760 	FSetPriority    uintptr
  49761 	FGetPriority    uintptr
  49762 	FGetBindResult  uintptr
  49763 }
  49764 
  49765 type IBindingVtbl = IBindingVtbl1
  49766 
  49767 type LPBINDSTATUSCALLBACK = uintptr
  49768 
  49769 type BINDVERB = uint32
  49770 
  49771 type BINDINFOF = uint32
  49772 
  49773 type BINDF = uint32
  49774 
  49775 type URL_ENCODING = uint32
  49776 
  49777 type _tagBINDINFO = struct {
  49778 	FcbSize             ULONG
  49779 	F__ccgo_pad1        [4]byte
  49780 	FszExtraInfo        LPWSTR
  49781 	FstgmedData         STGMEDIUM
  49782 	FgrfBindInfoF       DWORD
  49783 	FdwBindVerb         DWORD
  49784 	FszCustomVerb       LPWSTR
  49785 	FcbstgmedData       DWORD
  49786 	FdwOptions          DWORD
  49787 	FdwOptionsFlags     DWORD
  49788 	FdwCodePage         DWORD
  49789 	FsecurityAttributes SECURITY_ATTRIBUTES
  49790 	Fiid                IID
  49791 	FpUnk               uintptr
  49792 	FdwReserved         DWORD
  49793 	F__ccgo_pad2        [4]byte
  49794 }
  49795 
  49796 type BINDINFO = _tagBINDINFO
  49797 
  49798 type _REMSECURITY_ATTRIBUTES = struct {
  49799 	FnLength              DWORD
  49800 	FlpSecurityDescriptor DWORD
  49801 	FbInheritHandle       WINBOOL
  49802 }
  49803 
  49804 type REMSECURITY_ATTRIBUTES = _REMSECURITY_ATTRIBUTES
  49805 type PREMSECURITY_ATTRIBUTES = uintptr
  49806 type LPREMSECURITY_ATTRIBUTES = uintptr
  49807 
  49808 type _tagRemBINDINFO = struct {
  49809 	FcbSize             ULONG
  49810 	F__ccgo_pad1        [4]byte
  49811 	FszExtraInfo        LPWSTR
  49812 	FgrfBindInfoF       DWORD
  49813 	FdwBindVerb         DWORD
  49814 	FszCustomVerb       LPWSTR
  49815 	FcbstgmedData       DWORD
  49816 	FdwOptions          DWORD
  49817 	FdwOptionsFlags     DWORD
  49818 	FdwCodePage         DWORD
  49819 	FsecurityAttributes REMSECURITY_ATTRIBUTES
  49820 	Fiid                IID
  49821 	F__ccgo_pad2        [4]byte
  49822 	FpUnk               uintptr
  49823 	FdwReserved         DWORD
  49824 	F__ccgo_pad3        [4]byte
  49825 }
  49826 
  49827 type RemBINDINFO = _tagRemBINDINFO
  49828 
  49829 type tagRemFORMATETC = struct {
  49830 	FcfFormat DWORD
  49831 	Fptd      DWORD
  49832 	FdwAspect DWORD
  49833 	Flindex   LONG
  49834 	Ftymed    DWORD
  49835 }
  49836 
  49837 type RemFORMATETC = tagRemFORMATETC
  49838 type LPREMFORMATETC = uintptr
  49839 
  49840 type BINDINFO_OPTIONS = int32
  49841 
  49842 type BSCF = uint32
  49843 
  49844 type BINDSTATUS = uint32
  49845 type IBindStatusCallbackVtbl1 = struct {
  49846 	FQueryInterface    uintptr
  49847 	FAddRef            uintptr
  49848 	FRelease           uintptr
  49849 	FOnStartBinding    uintptr
  49850 	FGetPriority       uintptr
  49851 	FOnLowResource     uintptr
  49852 	FOnProgress        uintptr
  49853 	FOnStopBinding     uintptr
  49854 	FGetBindInfo       uintptr
  49855 	FOnDataAvailable   uintptr
  49856 	FOnObjectAvailable uintptr
  49857 }
  49858 
  49859 type IBindStatusCallbackVtbl = IBindStatusCallbackVtbl1
  49860 
  49861 type LPBINDSTATUSCALLBACKEX = uintptr
  49862 
  49863 type BINDF2 = uint32
  49864 type IBindStatusCallbackExVtbl1 = struct {
  49865 	FQueryInterface    uintptr
  49866 	FAddRef            uintptr
  49867 	FRelease           uintptr
  49868 	FOnStartBinding    uintptr
  49869 	FGetPriority       uintptr
  49870 	FOnLowResource     uintptr
  49871 	FOnProgress        uintptr
  49872 	FOnStopBinding     uintptr
  49873 	FGetBindInfo       uintptr
  49874 	FOnDataAvailable   uintptr
  49875 	FOnObjectAvailable uintptr
  49876 	FGetBindInfoEx     uintptr
  49877 }
  49878 
  49879 type IBindStatusCallbackExVtbl = IBindStatusCallbackExVtbl1
  49880 
  49881 type LPAUTHENTICATION = uintptr
  49882 type IAuthenticateVtbl1 = struct {
  49883 	FQueryInterface uintptr
  49884 	FAddRef         uintptr
  49885 	FRelease        uintptr
  49886 	FAuthenticate   uintptr
  49887 }
  49888 
  49889 type IAuthenticateVtbl = IAuthenticateVtbl1
  49890 
  49891 type LPAUTHENTICATIONEX = uintptr
  49892 
  49893 type AUTHENTICATEF = uint32
  49894 
  49895 type _tagAUTHENTICATEINFO = struct {
  49896 	FdwFlags    DWORD
  49897 	FdwReserved DWORD
  49898 }
  49899 
  49900 type AUTHENTICATEINFO = _tagAUTHENTICATEINFO
  49901 type IAuthenticateExVtbl1 = struct {
  49902 	FQueryInterface uintptr
  49903 	FAddRef         uintptr
  49904 	FRelease        uintptr
  49905 	FAuthenticate   uintptr
  49906 	FAuthenticateEx uintptr
  49907 }
  49908 
  49909 type IAuthenticateExVtbl = IAuthenticateExVtbl1
  49910 
  49911 type LPHTTPNEGOTIATE = uintptr
  49912 type IHttpNegotiateVtbl1 = struct {
  49913 	FQueryInterface       uintptr
  49914 	FAddRef               uintptr
  49915 	FRelease              uintptr
  49916 	FBeginningTransaction uintptr
  49917 	FOnResponse           uintptr
  49918 }
  49919 
  49920 type IHttpNegotiateVtbl = IHttpNegotiateVtbl1
  49921 
  49922 type LPHTTPNEGOTIATE2 = uintptr
  49923 type IHttpNegotiate2Vtbl1 = struct {
  49924 	FQueryInterface       uintptr
  49925 	FAddRef               uintptr
  49926 	FRelease              uintptr
  49927 	FBeginningTransaction uintptr
  49928 	FOnResponse           uintptr
  49929 	FGetRootSecurityId    uintptr
  49930 }
  49931 
  49932 type IHttpNegotiate2Vtbl = IHttpNegotiate2Vtbl1
  49933 
  49934 type LPHTTPNEGOTIATE3 = uintptr
  49935 type IHttpNegotiate3Vtbl1 = struct {
  49936 	FQueryInterface                 uintptr
  49937 	FAddRef                         uintptr
  49938 	FRelease                        uintptr
  49939 	FBeginningTransaction           uintptr
  49940 	FOnResponse                     uintptr
  49941 	FGetRootSecurityId              uintptr
  49942 	FGetSerializedClientCertContext uintptr
  49943 }
  49944 
  49945 type IHttpNegotiate3Vtbl = IHttpNegotiate3Vtbl1
  49946 
  49947 type LPWININETFILESTREAM = uintptr
  49948 type IWinInetFileStreamVtbl1 = struct {
  49949 	FQueryInterface     uintptr
  49950 	FAddRef             uintptr
  49951 	FRelease            uintptr
  49952 	FSetHandleForUnlock uintptr
  49953 	FSetDeleteFile      uintptr
  49954 }
  49955 
  49956 type IWinInetFileStreamVtbl = IWinInetFileStreamVtbl1
  49957 
  49958 type LPWINDOWFORBINDINGUI = uintptr
  49959 type IWindowForBindingUIVtbl1 = struct {
  49960 	FQueryInterface uintptr
  49961 	FAddRef         uintptr
  49962 	FRelease        uintptr
  49963 	FGetWindow      uintptr
  49964 }
  49965 
  49966 type IWindowForBindingUIVtbl = IWindowForBindingUIVtbl1
  49967 
  49968 type LPCODEINSTALL = uintptr
  49969 
  49970 type CIP_STATUS = uint32
  49971 type ICodeInstallVtbl1 = struct {
  49972 	FQueryInterface       uintptr
  49973 	FAddRef               uintptr
  49974 	FRelease              uintptr
  49975 	FGetWindow            uintptr
  49976 	FOnCodeInstallProblem uintptr
  49977 }
  49978 
  49979 type ICodeInstallVtbl = ICodeInstallVtbl1
  49980 
  49981 type LPWININETINFO = uintptr
  49982 type IWinInetInfoVtbl1 = struct {
  49983 	FQueryInterface uintptr
  49984 	FAddRef         uintptr
  49985 	FRelease        uintptr
  49986 	FQueryOption    uintptr
  49987 }
  49988 
  49989 type IWinInetInfoVtbl = IWinInetInfoVtbl1
  49990 
  49991 type LPHTTPSECURITY = uintptr
  49992 type IHttpSecurityVtbl1 = struct {
  49993 	FQueryInterface    uintptr
  49994 	FAddRef            uintptr
  49995 	FRelease           uintptr
  49996 	FGetWindow         uintptr
  49997 	FOnSecurityProblem uintptr
  49998 }
  49999 
  50000 type IHttpSecurityVtbl = IHttpSecurityVtbl1
  50001 
  50002 type LPWININETHTTPINFO = uintptr
  50003 type IWinInetHttpInfoVtbl1 = struct {
  50004 	FQueryInterface uintptr
  50005 	FAddRef         uintptr
  50006 	FRelease        uintptr
  50007 	FQueryOption    uintptr
  50008 	FQueryInfo      uintptr
  50009 }
  50010 
  50011 type IWinInetHttpInfoVtbl = IWinInetHttpInfoVtbl1
  50012 type IWinInetHttpTimeoutsVtbl1 = struct {
  50013 	FQueryInterface     uintptr
  50014 	FAddRef             uintptr
  50015 	FRelease            uintptr
  50016 	FGetRequestTimeouts uintptr
  50017 }
  50018 
  50019 type IWinInetHttpTimeoutsVtbl = IWinInetHttpTimeoutsVtbl1
  50020 
  50021 type LPBINDHOST = uintptr
  50022 type IBindHostVtbl1 = struct {
  50023 	FQueryInterface       uintptr
  50024 	FAddRef               uintptr
  50025 	FRelease              uintptr
  50026 	FCreateMoniker        uintptr
  50027 	FMonikerBindToStorage uintptr
  50028 	FMonikerBindToObject  uintptr
  50029 }
  50030 
  50031 type IBindHostVtbl = IBindHostVtbl1
  50032 
  50033 type LPIINTERNET = uintptr
  50034 type IInternetVtbl1 = struct {
  50035 	FQueryInterface uintptr
  50036 	FAddRef         uintptr
  50037 	FRelease        uintptr
  50038 }
  50039 
  50040 type IInternetVtbl = IInternetVtbl1
  50041 
  50042 type LPIINTERNETBINDINFO = uintptr
  50043 
  50044 type BINDSTRING = uint32
  50045 type IInternetBindInfoVtbl1 = struct {
  50046 	FQueryInterface uintptr
  50047 	FAddRef         uintptr
  50048 	FRelease        uintptr
  50049 	FGetBindInfo    uintptr
  50050 	FGetBindString  uintptr
  50051 }
  50052 
  50053 type IInternetBindInfoVtbl = IInternetBindInfoVtbl1
  50054 
  50055 type LPIINTERNETBINDINFOEX = uintptr
  50056 type IInternetBindInfoExVtbl1 = struct {
  50057 	FQueryInterface uintptr
  50058 	FAddRef         uintptr
  50059 	FRelease        uintptr
  50060 	FGetBindInfo    uintptr
  50061 	FGetBindString  uintptr
  50062 	FGetBindInfoEx  uintptr
  50063 }
  50064 
  50065 type IInternetBindInfoExVtbl = IInternetBindInfoExVtbl1
  50066 
  50067 type LPIINTERNETPROTOCOLROOT = uintptr
  50068 
  50069 type PI_FLAGS = uint32
  50070 type _tagPROTOCOLDATA = struct {
  50071 	FgrfFlags    DWORD
  50072 	FdwState     DWORD
  50073 	FpData       LPVOID
  50074 	FcbData      ULONG
  50075 	F__ccgo_pad1 [4]byte
  50076 }
  50077 
  50078 type PROTOCOLDATA = _tagPROTOCOLDATA
  50079 
  50080 type _tagStartParam = struct {
  50081 	Fiid       IID
  50082 	FpIBindCtx uintptr
  50083 	FpItf      uintptr
  50084 }
  50085 
  50086 type StartParam = _tagStartParam
  50087 type IInternetProtocolRootVtbl1 = struct {
  50088 	FQueryInterface uintptr
  50089 	FAddRef         uintptr
  50090 	FRelease        uintptr
  50091 	FStart          uintptr
  50092 	FContinue       uintptr
  50093 	FAbort          uintptr
  50094 	FTerminate      uintptr
  50095 	FSuspend        uintptr
  50096 	FResume         uintptr
  50097 }
  50098 
  50099 type IInternetProtocolRootVtbl = IInternetProtocolRootVtbl1
  50100 
  50101 type LPIINTERNETPROTOCOL = uintptr
  50102 type IInternetProtocolVtbl1 = struct {
  50103 	FQueryInterface uintptr
  50104 	FAddRef         uintptr
  50105 	FRelease        uintptr
  50106 	FStart          uintptr
  50107 	FContinue       uintptr
  50108 	FAbort          uintptr
  50109 	FTerminate      uintptr
  50110 	FSuspend        uintptr
  50111 	FResume         uintptr
  50112 	FRead           uintptr
  50113 	FSeek           uintptr
  50114 	FLockRequest    uintptr
  50115 	FUnlockRequest  uintptr
  50116 }
  50117 
  50118 type IInternetProtocolVtbl = IInternetProtocolVtbl1
  50119 
  50120 type LPIINTERNETPROTOCOLSINK = uintptr
  50121 type IInternetProtocolSinkVtbl1 = struct {
  50122 	FQueryInterface uintptr
  50123 	FAddRef         uintptr
  50124 	FRelease        uintptr
  50125 	FSwitch         uintptr
  50126 	FReportProgress uintptr
  50127 	FReportData     uintptr
  50128 	FReportResult   uintptr
  50129 }
  50130 
  50131 type IInternetProtocolSinkVtbl = IInternetProtocolSinkVtbl1
  50132 
  50133 type LPIINTERNETPROTOCOLSINKStackable = uintptr
  50134 type IInternetProtocolSinkStackableVtbl1 = struct {
  50135 	FQueryInterface uintptr
  50136 	FAddRef         uintptr
  50137 	FRelease        uintptr
  50138 	FSwitchSink     uintptr
  50139 	FCommitSwitch   uintptr
  50140 	FRollbackSwitch uintptr
  50141 }
  50142 
  50143 type IInternetProtocolSinkStackableVtbl = IInternetProtocolSinkStackableVtbl1
  50144 
  50145 type LPIINTERNETSESSION = uintptr
  50146 
  50147 type OIBDG_FLAGS = uint32
  50148 type IInternetSessionVtbl1 = struct {
  50149 	FQueryInterface       uintptr
  50150 	FAddRef               uintptr
  50151 	FRelease              uintptr
  50152 	FRegisterNameSpace    uintptr
  50153 	FUnregisterNameSpace  uintptr
  50154 	FRegisterMimeFilter   uintptr
  50155 	FUnregisterMimeFilter uintptr
  50156 	FCreateBinding        uintptr
  50157 	FSetSessionOption     uintptr
  50158 	FGetSessionOption     uintptr
  50159 }
  50160 
  50161 type IInternetSessionVtbl = IInternetSessionVtbl1
  50162 
  50163 type LPIINTERNETTHREADSWITCH = uintptr
  50164 type IInternetThreadSwitchVtbl1 = struct {
  50165 	FQueryInterface uintptr
  50166 	FAddRef         uintptr
  50167 	FRelease        uintptr
  50168 	FPrepare        uintptr
  50169 	FContinue       uintptr
  50170 }
  50171 
  50172 type IInternetThreadSwitchVtbl = IInternetThreadSwitchVtbl1
  50173 
  50174 type LPIINTERNETPRIORITY = uintptr
  50175 type IInternetPriorityVtbl1 = struct {
  50176 	FQueryInterface uintptr
  50177 	FAddRef         uintptr
  50178 	FRelease        uintptr
  50179 	FSetPriority    uintptr
  50180 	FGetPriority    uintptr
  50181 }
  50182 
  50183 type IInternetPriorityVtbl = IInternetPriorityVtbl1
  50184 
  50185 type LPIINTERNETPROTOCOLINFO = uintptr
  50186 
  50187 type PARSEACTION = uint32
  50188 
  50189 type PSUACTION = uint32
  50190 
  50191 type QUERYOPTION = uint32
  50192 type IInternetProtocolInfoVtbl1 = struct {
  50193 	FQueryInterface uintptr
  50194 	FAddRef         uintptr
  50195 	FRelease        uintptr
  50196 	FParseUrl       uintptr
  50197 	FCombineUrl     uintptr
  50198 	FCompareUrl     uintptr
  50199 	FQueryInfo      uintptr
  50200 }
  50201 
  50202 type IInternetProtocolInfoVtbl = IInternetProtocolInfoVtbl1
  50203 type IInternetSecurityMgrSiteVtbl1 = struct {
  50204 	FQueryInterface uintptr
  50205 	FAddRef         uintptr
  50206 	FRelease        uintptr
  50207 	FGetWindow      uintptr
  50208 	FEnableModeless uintptr
  50209 }
  50210 
  50211 type IInternetSecurityMgrSiteVtbl = IInternetSecurityMgrSiteVtbl1
  50212 
  50213 type PUAF = uint32
  50214 type PUAFOUT = uint32
  50215 
  50216 type SZM_FLAGS = uint32
  50217 type IInternetSecurityManagerVtbl1 = struct {
  50218 	FQueryInterface    uintptr
  50219 	FAddRef            uintptr
  50220 	FRelease           uintptr
  50221 	FSetSecuritySite   uintptr
  50222 	FGetSecuritySite   uintptr
  50223 	FMapUrlToZone      uintptr
  50224 	FGetSecurityId     uintptr
  50225 	FProcessUrlAction  uintptr
  50226 	FQueryCustomPolicy uintptr
  50227 	FSetZoneMapping    uintptr
  50228 	FGetZoneMappings   uintptr
  50229 }
  50230 
  50231 type IInternetSecurityManagerVtbl = IInternetSecurityManagerVtbl1
  50232 type IInternetHostSecurityManagerVtbl1 = struct {
  50233 	FQueryInterface    uintptr
  50234 	FAddRef            uintptr
  50235 	FRelease           uintptr
  50236 	FGetSecurityId     uintptr
  50237 	FProcessUrlAction  uintptr
  50238 	FQueryCustomPolicy uintptr
  50239 }
  50240 
  50241 type IInternetHostSecurityManagerVtbl = IInternetHostSecurityManagerVtbl1
  50242 
  50243 type LPURLZONEMANAGER = uintptr
  50244 
  50245 type URLZONE = int32
  50246 
  50247 type URLTEMPLATE = uint32
  50248 
  50249 type ZAFLAGS = uint32
  50250 
  50251 type _ZONEATTRIBUTES = struct {
  50252 	FcbSize                 ULONG
  50253 	FszDisplayName          [260]WCHAR
  50254 	FszDescription          [200]WCHAR
  50255 	FszIconPath             [260]WCHAR
  50256 	FdwTemplateMinLevel     DWORD
  50257 	FdwTemplateRecommended  DWORD
  50258 	FdwTemplateCurrentLevel DWORD
  50259 	FdwFlags                DWORD
  50260 }
  50261 
  50262 type ZONEATTRIBUTES = _ZONEATTRIBUTES
  50263 type LPZONEATTRIBUTES = uintptr
  50264 
  50265 type URLZONEREG = uint32
  50266 type IInternetZoneManagerVtbl1 = struct {
  50267 	FQueryInterface             uintptr
  50268 	FAddRef                     uintptr
  50269 	FRelease                    uintptr
  50270 	FGetZoneAttributes          uintptr
  50271 	FSetZoneAttributes          uintptr
  50272 	FGetZoneCustomPolicy        uintptr
  50273 	FSetZoneCustomPolicy        uintptr
  50274 	FGetZoneActionPolicy        uintptr
  50275 	FSetZoneActionPolicy        uintptr
  50276 	FPromptAction               uintptr
  50277 	FLogAction                  uintptr
  50278 	FCreateZoneEnumerator       uintptr
  50279 	FGetZoneAt                  uintptr
  50280 	FDestroyZoneEnumerator      uintptr
  50281 	FCopyTemplatePoliciesToZone uintptr
  50282 }
  50283 
  50284 type IInternetZoneManagerVtbl = IInternetZoneManagerVtbl1
  50285 
  50286 type _tagCODEBASEHOLD = struct {
  50287 	FcbSize      ULONG
  50288 	F__ccgo_pad1 [4]byte
  50289 	FszDistUnit  LPWSTR
  50290 	FszCodeBase  LPWSTR
  50291 	FdwVersionMS DWORD
  50292 	FdwVersionLS DWORD
  50293 	FdwStyle     DWORD
  50294 	F__ccgo_pad2 [4]byte
  50295 }
  50296 
  50297 type CODEBASEHOLD = _tagCODEBASEHOLD
  50298 type LPCODEBASEHOLD = uintptr
  50299 
  50300 type _tagSOFTDISTINFO = struct {
  50301 	FcbSize                ULONG
  50302 	FdwFlags               DWORD
  50303 	FdwAdState             DWORD
  50304 	F__ccgo_pad1           [4]byte
  50305 	FszTitle               LPWSTR
  50306 	FszAbstract            LPWSTR
  50307 	FszHREF                LPWSTR
  50308 	FdwInstalledVersionMS  DWORD
  50309 	FdwInstalledVersionLS  DWORD
  50310 	FdwUpdateVersionMS     DWORD
  50311 	FdwUpdateVersionLS     DWORD
  50312 	FdwAdvertisedVersionMS DWORD
  50313 	FdwAdvertisedVersionLS DWORD
  50314 	FdwReserved            DWORD
  50315 	F__ccgo_pad2           [4]byte
  50316 }
  50317 
  50318 type SOFTDISTINFO = _tagSOFTDISTINFO
  50319 type LPSOFTDISTINFO = uintptr
  50320 type ISoftDistExtVtbl1 = struct {
  50321 	FQueryInterface               uintptr
  50322 	FAddRef                       uintptr
  50323 	FRelease                      uintptr
  50324 	FProcessSoftDist              uintptr
  50325 	FGetFirstCodeBase             uintptr
  50326 	FGetNextCodeBase              uintptr
  50327 	FAsyncInstallDistributionUnit uintptr
  50328 }
  50329 
  50330 type ISoftDistExtVtbl = ISoftDistExtVtbl1
  50331 
  50332 type LPCATALOGFILEINFO = uintptr
  50333 type ICatalogFileInfoVtbl1 = struct {
  50334 	FQueryInterface uintptr
  50335 	FAddRef         uintptr
  50336 	FRelease        uintptr
  50337 	FGetCatalogFile uintptr
  50338 	FGetJavaTrust   uintptr
  50339 }
  50340 
  50341 type ICatalogFileInfoVtbl = ICatalogFileInfoVtbl1
  50342 
  50343 type LPDATAFILTER = uintptr
  50344 type IDataFilterVtbl1 = struct {
  50345 	FQueryInterface   uintptr
  50346 	FAddRef           uintptr
  50347 	FRelease          uintptr
  50348 	FDoEncode         uintptr
  50349 	FDoDecode         uintptr
  50350 	FSetEncodingLevel uintptr
  50351 }
  50352 
  50353 type IDataFilterVtbl = IDataFilterVtbl1
  50354 
  50355 type _tagPROTOCOLFILTERDATA = struct {
  50356 	FcbSize        DWORD
  50357 	F__ccgo_pad1   [4]byte
  50358 	FpProtocolSink uintptr
  50359 	FpProtocol     uintptr
  50360 	FpUnk          uintptr
  50361 	FdwFilterFlags DWORD
  50362 	F__ccgo_pad2   [4]byte
  50363 }
  50364 
  50365 type PROTOCOLFILTERDATA = _tagPROTOCOLFILTERDATA
  50366 
  50367 type LPENCODINGFILTERFACTORY = uintptr
  50368 
  50369 type _tagDATAINFO = struct {
  50370 	FulTotalSize      ULONG
  50371 	FulavrPacketSize  ULONG
  50372 	FulConnectSpeed   ULONG
  50373 	FulProcessorSpeed ULONG
  50374 }
  50375 
  50376 type DATAINFO = _tagDATAINFO
  50377 type IEncodingFilterFactoryVtbl1 = struct {
  50378 	FQueryInterface   uintptr
  50379 	FAddRef           uintptr
  50380 	FRelease          uintptr
  50381 	FFindBestFilter   uintptr
  50382 	FGetDefaultFilter uintptr
  50383 }
  50384 
  50385 type IEncodingFilterFactoryVtbl = IEncodingFilterFactoryVtbl1
  50386 
  50387 type _tagHIT_LOGGING_INFO = struct {
  50388 	FdwStructSize      DWORD
  50389 	F__ccgo_pad1       [4]byte
  50390 	FlpszLoggedUrlName LPSTR
  50391 	FStartTime         SYSTEMTIME
  50392 	FEndTime           SYSTEMTIME
  50393 	FlpszExtendedInfo  LPSTR
  50394 }
  50395 
  50396 type HIT_LOGGING_INFO = _tagHIT_LOGGING_INFO
  50397 type LPHIT_LOGGING_INFO = uintptr
  50398 
  50399 type CONFIRMSAFETY = struct {
  50400 	Fclsid       CLSID
  50401 	FpUnk        uintptr
  50402 	FdwFlags     DWORD
  50403 	F__ccgo_pad1 [4]byte
  50404 }
  50405 
  50406 type LPIWRAPPEDPROTOCOL = uintptr
  50407 type IWrappedProtocolVtbl1 = struct {
  50408 	FQueryInterface uintptr
  50409 	FAddRef         uintptr
  50410 	FRelease        uintptr
  50411 	FGetWrapperCode uintptr
  50412 }
  50413 
  50414 type IWrappedProtocolVtbl = IWrappedProtocolVtbl1
  50415 
  50416 type LPGETBINDHANDLE = uintptr
  50417 
  50418 type BINDHANDLETYPES = uint32
  50419 type IGetBindHandleVtbl1 = struct {
  50420 	FQueryInterface uintptr
  50421 	FAddRef         uintptr
  50422 	FRelease        uintptr
  50423 	FGetBindHandle  uintptr
  50424 }
  50425 
  50426 type IGetBindHandleVtbl = IGetBindHandleVtbl1
  50427 
  50428 type _tagPROTOCOL_ARGUMENT = struct {
  50429 	FszMethod    LPCWSTR
  50430 	FszTargetUrl LPCWSTR
  50431 }
  50432 
  50433 type PROTOCOL_ARGUMENT = _tagPROTOCOL_ARGUMENT
  50434 type LPPROTOCOL_ARGUMENT = uintptr
  50435 
  50436 type LPBINDCALLBACKREDIRECT = uintptr
  50437 type IBindCallbackRedirectVtbl1 = struct {
  50438 	FQueryInterface uintptr
  50439 	FAddRef         uintptr
  50440 	FRelease        uintptr
  50441 	FRedirect       uintptr
  50442 }
  50443 
  50444 type IBindCallbackRedirectVtbl = IBindCallbackRedirectVtbl1
  50445 
  50446 type IPropertyStorage1 = struct{ FlpVtbl uintptr }
  50447 
  50448 type IPropertyStorage = IPropertyStorage1
  50449 
  50450 type IPropertySetStorage1 = struct{ FlpVtbl uintptr }
  50451 
  50452 type IPropertySetStorage = IPropertySetStorage1
  50453 
  50454 type IEnumSTATPROPSTG1 = struct{ FlpVtbl uintptr }
  50455 
  50456 type IEnumSTATPROPSTG = IEnumSTATPROPSTG1
  50457 
  50458 type IEnumSTATPROPSETSTG1 = struct{ FlpVtbl uintptr }
  50459 
  50460 type IEnumSTATPROPSETSTG = IEnumSTATPROPSETSTG1
  50461 
  50462 type tagVersionedStream = struct {
  50463 	FguidVersion GUID
  50464 	FpStream     uintptr
  50465 }
  50466 
  50467 type VERSIONEDSTREAM = tagVersionedStream
  50468 type LPVERSIONEDSTREAM = uintptr
  50469 
  50470 type tagCAC = struct {
  50471 	FcElems      ULONG
  50472 	F__ccgo_pad1 [4]byte
  50473 	FpElems      uintptr
  50474 }
  50475 
  50476 type CAC = tagCAC
  50477 type tagCAUB = struct {
  50478 	FcElems      ULONG
  50479 	F__ccgo_pad1 [4]byte
  50480 	FpElems      uintptr
  50481 }
  50482 
  50483 type CAUB = tagCAUB
  50484 type tagCAI = struct {
  50485 	FcElems      ULONG
  50486 	F__ccgo_pad1 [4]byte
  50487 	FpElems      uintptr
  50488 }
  50489 
  50490 type CAI = tagCAI
  50491 type tagCAUI = struct {
  50492 	FcElems      ULONG
  50493 	F__ccgo_pad1 [4]byte
  50494 	FpElems      uintptr
  50495 }
  50496 
  50497 type CAUI = tagCAUI
  50498 type tagCAL = struct {
  50499 	FcElems      ULONG
  50500 	F__ccgo_pad1 [4]byte
  50501 	FpElems      uintptr
  50502 }
  50503 
  50504 type CAL = tagCAL
  50505 type tagCAUL = struct {
  50506 	FcElems      ULONG
  50507 	F__ccgo_pad1 [4]byte
  50508 	FpElems      uintptr
  50509 }
  50510 
  50511 type CAUL = tagCAUL
  50512 type tagCAFLT = struct {
  50513 	FcElems      ULONG
  50514 	F__ccgo_pad1 [4]byte
  50515 	FpElems      uintptr
  50516 }
  50517 
  50518 type CAFLT = tagCAFLT
  50519 type tagCADBL = struct {
  50520 	FcElems      ULONG
  50521 	F__ccgo_pad1 [4]byte
  50522 	FpElems      uintptr
  50523 }
  50524 
  50525 type CADBL = tagCADBL
  50526 type tagCACY = struct {
  50527 	FcElems      ULONG
  50528 	F__ccgo_pad1 [4]byte
  50529 	FpElems      uintptr
  50530 }
  50531 
  50532 type CACY = tagCACY
  50533 type tagCADATE = struct {
  50534 	FcElems      ULONG
  50535 	F__ccgo_pad1 [4]byte
  50536 	FpElems      uintptr
  50537 }
  50538 
  50539 type CADATE = tagCADATE
  50540 type tagCABSTR = struct {
  50541 	FcElems      ULONG
  50542 	F__ccgo_pad1 [4]byte
  50543 	FpElems      uintptr
  50544 }
  50545 
  50546 type CABSTR = tagCABSTR
  50547 type tagCABSTRBLOB = struct {
  50548 	FcElems      ULONG
  50549 	F__ccgo_pad1 [4]byte
  50550 	FpElems      uintptr
  50551 }
  50552 
  50553 type CABSTRBLOB = tagCABSTRBLOB
  50554 type tagCABOOL = struct {
  50555 	FcElems      ULONG
  50556 	F__ccgo_pad1 [4]byte
  50557 	FpElems      uintptr
  50558 }
  50559 
  50560 type CABOOL = tagCABOOL
  50561 type tagCASCODE = struct {
  50562 	FcElems      ULONG
  50563 	F__ccgo_pad1 [4]byte
  50564 	FpElems      uintptr
  50565 }
  50566 
  50567 type CASCODE = tagCASCODE
  50568 type tagCAPROPVARIANT = struct {
  50569 	FcElems      ULONG
  50570 	F__ccgo_pad1 [4]byte
  50571 	FpElems      uintptr
  50572 }
  50573 
  50574 type CAPROPVARIANT = tagCAPROPVARIANT
  50575 type tagCAH = struct {
  50576 	FcElems      ULONG
  50577 	F__ccgo_pad1 [4]byte
  50578 	FpElems      uintptr
  50579 }
  50580 
  50581 type CAH = tagCAH
  50582 type tagCAUH = struct {
  50583 	FcElems      ULONG
  50584 	F__ccgo_pad1 [4]byte
  50585 	FpElems      uintptr
  50586 }
  50587 
  50588 type CAUH = tagCAUH
  50589 type tagCALPSTR = struct {
  50590 	FcElems      ULONG
  50591 	F__ccgo_pad1 [4]byte
  50592 	FpElems      uintptr
  50593 }
  50594 
  50595 type CALPSTR = tagCALPSTR
  50596 type tagCALPWSTR = struct {
  50597 	FcElems      ULONG
  50598 	F__ccgo_pad1 [4]byte
  50599 	FpElems      uintptr
  50600 }
  50601 
  50602 type CALPWSTR = tagCALPWSTR
  50603 type tagCAFILETIME = struct {
  50604 	FcElems      ULONG
  50605 	F__ccgo_pad1 [4]byte
  50606 	FpElems      uintptr
  50607 }
  50608 
  50609 type CAFILETIME = tagCAFILETIME
  50610 type tagCACLIPDATA = struct {
  50611 	FcElems      ULONG
  50612 	F__ccgo_pad1 [4]byte
  50613 	FpElems      uintptr
  50614 }
  50615 
  50616 type CACLIPDATA = tagCACLIPDATA
  50617 type tagCACLSID = struct {
  50618 	FcElems      ULONG
  50619 	F__ccgo_pad1 [4]byte
  50620 	FpElems      uintptr
  50621 }
  50622 
  50623 type CACLSID = tagCACLSID
  50624 
  50625 type PROPVAR_PAD1 = WORD
  50626 type PROPVAR_PAD2 = WORD
  50627 type PROPVAR_PAD3 = WORD
  50628 
  50629 type LPPROPVARIANT = uintptr
  50630 
  50631 type tagPROPSPEC = struct {
  50632 	FulKind      ULONG
  50633 	F__ccgo_pad1 [4]byte
  50634 	Fu           struct {
  50635 		F__ccgo_pad1 [0]uint64
  50636 		Fpropid      PROPID
  50637 		F__ccgo_pad2 [4]byte
  50638 	}
  50639 }
  50640 
  50641 type PROPSPEC = tagPROPSPEC
  50642 
  50643 type tagSTATPROPSTG = struct {
  50644 	FlpwstrName  LPOLESTR
  50645 	Fpropid      PROPID
  50646 	Fvt          VARTYPE
  50647 	F__ccgo_pad1 [2]byte
  50648 }
  50649 
  50650 type STATPROPSTG = tagSTATPROPSTG
  50651 
  50652 type tagSTATPROPSETSTG = struct {
  50653 	Ffmtid       FMTID
  50654 	Fclsid       CLSID
  50655 	FgrfFlags    DWORD
  50656 	Fmtime       FILETIME
  50657 	Fctime       FILETIME
  50658 	Fatime       FILETIME
  50659 	FdwOSVersion DWORD
  50660 }
  50661 
  50662 type STATPROPSETSTG = tagSTATPROPSETSTG
  50663 type IPropertyStorageVtbl1 = struct {
  50664 	FQueryInterface      uintptr
  50665 	FAddRef              uintptr
  50666 	FRelease             uintptr
  50667 	FReadMultiple        uintptr
  50668 	FWriteMultiple       uintptr
  50669 	FDeleteMultiple      uintptr
  50670 	FReadPropertyNames   uintptr
  50671 	FWritePropertyNames  uintptr
  50672 	FDeletePropertyNames uintptr
  50673 	FCommit              uintptr
  50674 	FRevert              uintptr
  50675 	FEnum                uintptr
  50676 	FSetTimes            uintptr
  50677 	FSetClass            uintptr
  50678 	FStat                uintptr
  50679 }
  50680 
  50681 type IPropertyStorageVtbl = IPropertyStorageVtbl1
  50682 
  50683 type LPPROPERTYSETSTORAGE = uintptr
  50684 type IPropertySetStorageVtbl1 = struct {
  50685 	FQueryInterface uintptr
  50686 	FAddRef         uintptr
  50687 	FRelease        uintptr
  50688 	FCreate         uintptr
  50689 	FOpen           uintptr
  50690 	FDelete         uintptr
  50691 	FEnum           uintptr
  50692 }
  50693 
  50694 type IPropertySetStorageVtbl = IPropertySetStorageVtbl1
  50695 
  50696 type LPENUMSTATPROPSTG = uintptr
  50697 type IEnumSTATPROPSTGVtbl1 = struct {
  50698 	FQueryInterface uintptr
  50699 	FAddRef         uintptr
  50700 	FRelease        uintptr
  50701 	FNext           uintptr
  50702 	FSkip           uintptr
  50703 	FReset          uintptr
  50704 	FClone          uintptr
  50705 }
  50706 
  50707 type IEnumSTATPROPSTGVtbl = IEnumSTATPROPSTGVtbl1
  50708 
  50709 type LPENUMSTATPROPSETSTG = uintptr
  50710 type IEnumSTATPROPSETSTGVtbl1 = struct {
  50711 	FQueryInterface uintptr
  50712 	FAddRef         uintptr
  50713 	FRelease        uintptr
  50714 	FNext           uintptr
  50715 	FSkip           uintptr
  50716 	FReset          uintptr
  50717 	FClone          uintptr
  50718 }
  50719 
  50720 type IEnumSTATPROPSETSTGVtbl = IEnumSTATPROPSETSTGVtbl1
  50721 
  50722 type LPPROPERTYSTORAGE = uintptr
  50723 
  50724 type tagSERIALIZEDPROPERTYVALUE = struct {
  50725 	FdwType      DWORD
  50726 	Frgb         [1]BYTE
  50727 	F__ccgo_pad1 [3]byte
  50728 }
  50729 
  50730 type SERIALIZEDPROPERTYVALUE = tagSERIALIZEDPROPERTYVALUE
  50731 
  50732 type NUMPARSE = struct {
  50733 	FcDig       INT
  50734 	FdwInFlags  ULONG
  50735 	FdwOutFlags ULONG
  50736 	FcchUsed    INT
  50737 	FnBaseShift INT
  50738 	FnPwr10     INT
  50739 }
  50740 
  50741 type UDATE = struct {
  50742 	Fst         SYSTEMTIME
  50743 	FwDayOfYear USHORT
  50744 }
  50745 
  50746 type REGKIND = uint32
  50747 
  50748 type tagPARAMDATA = struct {
  50749 	FszName      uintptr
  50750 	Fvt          VARTYPE
  50751 	F__ccgo_pad1 [6]byte
  50752 }
  50753 
  50754 type PARAMDATA = tagPARAMDATA
  50755 type LPPARAMDATA = uintptr
  50756 
  50757 type tagMETHODDATA = struct {
  50758 	FszName      uintptr
  50759 	Fppdata      uintptr
  50760 	Fdispid      DISPID
  50761 	FiMeth       UINT
  50762 	Fcc          CALLCONV
  50763 	FcArgs       UINT
  50764 	FwFlags      WORD
  50765 	FvtReturn    VARTYPE
  50766 	F__ccgo_pad1 [4]byte
  50767 }
  50768 
  50769 type METHODDATA = tagMETHODDATA
  50770 type LPMETHODDATA = uintptr
  50771 
  50772 type tagINTERFACEDATA = struct {
  50773 	Fpmethdata   uintptr
  50774 	FcMembers    UINT
  50775 	F__ccgo_pad1 [4]byte
  50776 }
  50777 
  50778 type INTERFACEDATA = tagINTERFACEDATA
  50779 type LPINTERFACEDATA = uintptr
  50780 
  50781 type _OLESTREAM = struct{ Flpstbl LPOLESTREAMVTBL }
  50782 
  50783 type LPOLESTREAM = uintptr
  50784 
  50785 type _OLESTREAMVTBL = struct {
  50786 	FGet uintptr
  50787 	FPut uintptr
  50788 }
  50789 
  50790 type OLESTREAMVTBL = _OLESTREAMVTBL
  50791 type LPOLESTREAMVTBL = uintptr
  50792 
  50793 type OLESTREAM = _OLESTREAM
  50794 
  50795 type _STORAGE_READ_CAPACITY = struct {
  50796 	FVersion        ULONG
  50797 	FSize           ULONG
  50798 	FBlockLength    ULONG
  50799 	F__ccgo_pad1    [4]byte
  50800 	FNumberOfBlocks LARGE_INTEGER
  50801 	FDiskLength     LARGE_INTEGER
  50802 }
  50803 
  50804 type STORAGE_READ_CAPACITY = _STORAGE_READ_CAPACITY
  50805 type PSTORAGE_READ_CAPACITY = uintptr
  50806 
  50807 type _STORAGE_HOTPLUG_INFO = struct {
  50808 	FSize                     DWORD
  50809 	FMediaRemovable           BOOLEAN
  50810 	FMediaHotplug             BOOLEAN
  50811 	FDeviceHotplug            BOOLEAN
  50812 	FWriteCacheEnableOverride BOOLEAN
  50813 }
  50814 
  50815 type STORAGE_HOTPLUG_INFO = _STORAGE_HOTPLUG_INFO
  50816 type PSTORAGE_HOTPLUG_INFO = uintptr
  50817 
  50818 type _STORAGE_DEVICE_NUMBER = struct {
  50819 	FDeviceType      DWORD
  50820 	FDeviceNumber    DWORD
  50821 	FPartitionNumber DWORD
  50822 }
  50823 
  50824 type STORAGE_DEVICE_NUMBER = _STORAGE_DEVICE_NUMBER
  50825 type PSTORAGE_DEVICE_NUMBER = uintptr
  50826 
  50827 type _STORAGE_BUS_RESET_REQUEST = struct{ FPathId BYTE }
  50828 
  50829 type STORAGE_BUS_RESET_REQUEST = _STORAGE_BUS_RESET_REQUEST
  50830 type PSTORAGE_BUS_RESET_REQUEST = uintptr
  50831 
  50832 type STORAGE_BREAK_RESERVATION_REQUEST1 = struct {
  50833 	FLength   DWORD
  50834 	F_unused  BYTE
  50835 	FPathId   BYTE
  50836 	FTargetId BYTE
  50837 	FLun      BYTE
  50838 }
  50839 
  50840 type STORAGE_BREAK_RESERVATION_REQUEST = STORAGE_BREAK_RESERVATION_REQUEST1
  50841 type PSTORAGE_BREAK_RESERVATION_REQUEST = uintptr
  50842 
  50843 type _PREVENT_MEDIA_REMOVAL = struct{ FPreventMediaRemoval BOOLEAN }
  50844 
  50845 type PREVENT_MEDIA_REMOVAL = _PREVENT_MEDIA_REMOVAL
  50846 type PPREVENT_MEDIA_REMOVAL = uintptr
  50847 
  50848 type _CLASS_MEDIA_CHANGE_CONTEXT = struct {
  50849 	FMediaChangeCount DWORD
  50850 	FNewState         DWORD
  50851 }
  50852 
  50853 type CLASS_MEDIA_CHANGE_CONTEXT = _CLASS_MEDIA_CHANGE_CONTEXT
  50854 type PCLASS_MEDIA_CHANGE_CONTEXT = uintptr
  50855 
  50856 type _TAPE_STATISTICS = struct {
  50857 	FVersion                DWORD
  50858 	FFlags                  DWORD
  50859 	FRecoveredWrites        LARGE_INTEGER
  50860 	FUnrecoveredWrites      LARGE_INTEGER
  50861 	FRecoveredReads         LARGE_INTEGER
  50862 	FUnrecoveredReads       LARGE_INTEGER
  50863 	FCompressionRatioReads  BYTE
  50864 	FCompressionRatioWrites BYTE
  50865 	F__ccgo_pad1            [6]byte
  50866 }
  50867 
  50868 type TAPE_STATISTICS = _TAPE_STATISTICS
  50869 type PTAPE_STATISTICS = uintptr
  50870 
  50871 type _TAPE_GET_STATISTICS = struct{ FOperation DWORD }
  50872 
  50873 type TAPE_GET_STATISTICS = _TAPE_GET_STATISTICS
  50874 type PTAPE_GET_STATISTICS = uintptr
  50875 
  50876 type STORAGE_MEDIA_TYPE = uint32
  50877 type PSTORAGE_MEDIA_TYPE = uintptr
  50878 
  50879 type STORAGE_BUS_TYPE = uint32
  50880 type PSTORAGE_BUS_TYPE = uintptr
  50881 
  50882 type _DEVICE_MEDIA_INFO = struct {
  50883 	FDeviceSpecific struct {
  50884 		FDiskInfo struct {
  50885 			FCylinders            LARGE_INTEGER
  50886 			FMediaType            STORAGE_MEDIA_TYPE
  50887 			FTracksPerCylinder    DWORD
  50888 			FSectorsPerTrack      DWORD
  50889 			FBytesPerSector       DWORD
  50890 			FNumberMediaSides     DWORD
  50891 			FMediaCharacteristics DWORD
  50892 		}
  50893 	}
  50894 }
  50895 
  50896 type DEVICE_MEDIA_INFO = _DEVICE_MEDIA_INFO
  50897 type PDEVICE_MEDIA_INFO = uintptr
  50898 
  50899 type _GET_MEDIA_TYPES = struct {
  50900 	FDeviceType     DWORD
  50901 	FMediaInfoCount DWORD
  50902 	FMediaInfo      [1]DEVICE_MEDIA_INFO
  50903 }
  50904 
  50905 type GET_MEDIA_TYPES = _GET_MEDIA_TYPES
  50906 type PGET_MEDIA_TYPES = uintptr
  50907 
  50908 type _STORAGE_PREDICT_FAILURE = struct {
  50909 	FPredictFailure DWORD
  50910 	FVendorSpecific [512]BYTE
  50911 }
  50912 
  50913 type STORAGE_PREDICT_FAILURE = _STORAGE_PREDICT_FAILURE
  50914 type PSTORAGE_PREDICT_FAILURE = uintptr
  50915 
  50916 type MEDIA_TYPE = uint32
  50917 type PMEDIA_TYPE = uintptr
  50918 
  50919 type _FORMAT_PARAMETERS = struct {
  50920 	FMediaType           MEDIA_TYPE
  50921 	FStartCylinderNumber DWORD
  50922 	FEndCylinderNumber   DWORD
  50923 	FStartHeadNumber     DWORD
  50924 	FEndHeadNumber       DWORD
  50925 }
  50926 
  50927 type FORMAT_PARAMETERS = _FORMAT_PARAMETERS
  50928 type PFORMAT_PARAMETERS = uintptr
  50929 
  50930 type BAD_TRACK_NUMBER = WORD
  50931 type PBAD_TRACK_NUMBER = uintptr
  50932 
  50933 type _FORMAT_EX_PARAMETERS = struct {
  50934 	FMediaType           MEDIA_TYPE
  50935 	FStartCylinderNumber DWORD
  50936 	FEndCylinderNumber   DWORD
  50937 	FStartHeadNumber     DWORD
  50938 	FEndHeadNumber       DWORD
  50939 	FFormatGapLength     WORD
  50940 	FSectorsPerTrack     WORD
  50941 	FSectorNumber        [1]WORD
  50942 	F__ccgo_pad1         [2]byte
  50943 }
  50944 
  50945 type FORMAT_EX_PARAMETERS = _FORMAT_EX_PARAMETERS
  50946 type PFORMAT_EX_PARAMETERS = uintptr
  50947 
  50948 type _DISK_GEOMETRY = struct {
  50949 	FCylinders         LARGE_INTEGER
  50950 	FMediaType         MEDIA_TYPE
  50951 	FTracksPerCylinder DWORD
  50952 	FSectorsPerTrack   DWORD
  50953 	FBytesPerSector    DWORD
  50954 }
  50955 
  50956 type DISK_GEOMETRY = _DISK_GEOMETRY
  50957 type PDISK_GEOMETRY = uintptr
  50958 
  50959 type _PARTITION_INFORMATION = struct {
  50960 	FStartingOffset      LARGE_INTEGER
  50961 	FPartitionLength     LARGE_INTEGER
  50962 	FHiddenSectors       DWORD
  50963 	FPartitionNumber     DWORD
  50964 	FPartitionType       BYTE
  50965 	FBootIndicator       BOOLEAN
  50966 	FRecognizedPartition BOOLEAN
  50967 	FRewritePartition    BOOLEAN
  50968 	F__ccgo_pad1         [4]byte
  50969 }
  50970 
  50971 type PARTITION_INFORMATION = _PARTITION_INFORMATION
  50972 type PPARTITION_INFORMATION = uintptr
  50973 
  50974 type _SET_PARTITION_INFORMATION = struct{ FPartitionType BYTE }
  50975 
  50976 type SET_PARTITION_INFORMATION = _SET_PARTITION_INFORMATION
  50977 type PSET_PARTITION_INFORMATION = uintptr
  50978 
  50979 type _DRIVE_LAYOUT_INFORMATION = struct {
  50980 	FPartitionCount DWORD
  50981 	FSignature      DWORD
  50982 	FPartitionEntry [1]PARTITION_INFORMATION
  50983 }
  50984 
  50985 type DRIVE_LAYOUT_INFORMATION = _DRIVE_LAYOUT_INFORMATION
  50986 type PDRIVE_LAYOUT_INFORMATION = uintptr
  50987 
  50988 type _VERIFY_INFORMATION = struct {
  50989 	FStartingOffset LARGE_INTEGER
  50990 	FLength         DWORD
  50991 	F__ccgo_pad1    [4]byte
  50992 }
  50993 
  50994 type VERIFY_INFORMATION = _VERIFY_INFORMATION
  50995 type PVERIFY_INFORMATION = uintptr
  50996 
  50997 type _REASSIGN_BLOCKS = struct {
  50998 	FReserved    WORD
  50999 	FCount       WORD
  51000 	FBlockNumber [1]DWORD
  51001 }
  51002 
  51003 type REASSIGN_BLOCKS = _REASSIGN_BLOCKS
  51004 type PREASSIGN_BLOCKS = uintptr
  51005 
  51006 type _REASSIGN_BLOCKS_EX = struct {
  51007 	FReserved    WORD
  51008 	FCount       WORD
  51009 	F__ccgo_pad1 [4]byte
  51010 	FBlockNumber [1]LARGE_INTEGER
  51011 }
  51012 
  51013 // *
  51014 // This file has no copyright assigned and is placed in the Public Domain.
  51015 // This file is part of the mingw-w64 runtime package.
  51016 // No warranty is given; refer to the file DISCLAIMER.PD within this package.
  51017 type REASSIGN_BLOCKS_EX = _REASSIGN_BLOCKS_EX
  51018 type PREASSIGN_BLOCKS_EX = uintptr
  51019 
  51020 type PARTITION_STYLE = uint32
  51021 
  51022 type _PARTITION_INFORMATION_GPT = struct {
  51023 	FPartitionType GUID
  51024 	FPartitionId   GUID
  51025 	FAttributes    DWORD64
  51026 	FName          [36]WCHAR
  51027 }
  51028 
  51029 type PARTITION_INFORMATION_GPT = _PARTITION_INFORMATION_GPT
  51030 type PPARTITION_INFORMATION_GPT = uintptr
  51031 
  51032 type _PARTITION_INFORMATION_MBR = struct {
  51033 	FPartitionType       BYTE
  51034 	FBootIndicator       BOOLEAN
  51035 	FRecognizedPartition BOOLEAN
  51036 	F__ccgo_pad1         [1]byte
  51037 	FHiddenSectors       DWORD
  51038 }
  51039 
  51040 type PARTITION_INFORMATION_MBR = _PARTITION_INFORMATION_MBR
  51041 type PPARTITION_INFORMATION_MBR = uintptr
  51042 
  51043 type SET_PARTITION_INFORMATION_MBR = SET_PARTITION_INFORMATION
  51044 type SET_PARTITION_INFORMATION_GPT = PARTITION_INFORMATION_GPT
  51045 
  51046 type _SET_PARTITION_INFORMATION_EX = struct {
  51047 	FPartitionStyle PARTITION_STYLE
  51048 	F__ccgo_pad1    [4]byte
  51049 	Fu              struct {
  51050 		F__ccgo_pad1 [0]uint64
  51051 		FMbr         SET_PARTITION_INFORMATION_MBR
  51052 		F__ccgo_pad2 [111]byte
  51053 	}
  51054 }
  51055 
  51056 type SET_PARTITION_INFORMATION_EX = _SET_PARTITION_INFORMATION_EX
  51057 type PSET_PARTITION_INFORMATION_EX = uintptr
  51058 
  51059 type _CREATE_DISK_GPT = struct {
  51060 	FDiskId            GUID
  51061 	FMaxPartitionCount DWORD
  51062 }
  51063 
  51064 type CREATE_DISK_GPT = _CREATE_DISK_GPT
  51065 type PCREATE_DISK_GPT = uintptr
  51066 
  51067 type _CREATE_DISK_MBR = struct{ FSignature DWORD }
  51068 
  51069 type CREATE_DISK_MBR = _CREATE_DISK_MBR
  51070 type PCREATE_DISK_MBR = uintptr
  51071 
  51072 type _CREATE_DISK = struct {
  51073 	FPartitionStyle PARTITION_STYLE
  51074 	Fu              struct {
  51075 		FMbr         CREATE_DISK_MBR
  51076 		F__ccgo_pad1 [16]byte
  51077 	}
  51078 }
  51079 
  51080 type CREATE_DISK = _CREATE_DISK
  51081 type PCREATE_DISK = uintptr
  51082 
  51083 type _GET_LENGTH_INFORMATION = struct{ FLength LARGE_INTEGER }
  51084 
  51085 type GET_LENGTH_INFORMATION = _GET_LENGTH_INFORMATION
  51086 type PGET_LENGTH_INFORMATION = uintptr
  51087 
  51088 type _PARTITION_INFORMATION_EX = struct {
  51089 	FPartitionStyle   PARTITION_STYLE
  51090 	F__ccgo_pad1      [4]byte
  51091 	FStartingOffset   LARGE_INTEGER
  51092 	FPartitionLength  LARGE_INTEGER
  51093 	FPartitionNumber  DWORD
  51094 	FRewritePartition BOOLEAN
  51095 	F__ccgo_pad2      [3]byte
  51096 	Fu                struct {
  51097 		F__ccgo_pad1 [0]uint64
  51098 		FMbr         PARTITION_INFORMATION_MBR
  51099 		F__ccgo_pad2 [104]byte
  51100 	}
  51101 }
  51102 
  51103 type PARTITION_INFORMATION_EX = _PARTITION_INFORMATION_EX
  51104 type PPARTITION_INFORMATION_EX = uintptr
  51105 
  51106 type _DRIVE_LAYOUT_INFORMATION_GPT = struct {
  51107 	FDiskId               GUID
  51108 	FStartingUsableOffset LARGE_INTEGER
  51109 	FUsableLength         LARGE_INTEGER
  51110 	FMaxPartitionCount    DWORD
  51111 	F__ccgo_pad1          [4]byte
  51112 }
  51113 
  51114 type DRIVE_LAYOUT_INFORMATION_GPT = _DRIVE_LAYOUT_INFORMATION_GPT
  51115 type PDRIVE_LAYOUT_INFORMATION_GPT = uintptr
  51116 
  51117 type _DRIVE_LAYOUT_INFORMATION_MBR = struct{ FSignature DWORD }
  51118 
  51119 type DRIVE_LAYOUT_INFORMATION_MBR = _DRIVE_LAYOUT_INFORMATION_MBR
  51120 type PDRIVE_LAYOUT_INFORMATION_MBR = uintptr
  51121 
  51122 type _DRIVE_LAYOUT_INFORMATION_EX = struct {
  51123 	FPartitionStyle DWORD
  51124 	FPartitionCount DWORD
  51125 	Fu              struct {
  51126 		F__ccgo_pad1 [0]uint64
  51127 		FMbr         DRIVE_LAYOUT_INFORMATION_MBR
  51128 		F__ccgo_pad2 [36]byte
  51129 	}
  51130 	FPartitionEntry [1]PARTITION_INFORMATION_EX
  51131 }
  51132 
  51133 type DRIVE_LAYOUT_INFORMATION_EX = _DRIVE_LAYOUT_INFORMATION_EX
  51134 type PDRIVE_LAYOUT_INFORMATION_EX = uintptr
  51135 
  51136 type DETECTION_TYPE = uint32
  51137 
  51138 type _DISK_INT13_INFO = struct {
  51139 	FDriveSelect     WORD
  51140 	F__ccgo_pad1     [2]byte
  51141 	FMaxCylinders    DWORD
  51142 	FSectorsPerTrack WORD
  51143 	FMaxHeads        WORD
  51144 	FNumberDrives    WORD
  51145 	F__ccgo_pad2     [2]byte
  51146 }
  51147 
  51148 type DISK_INT13_INFO = _DISK_INT13_INFO
  51149 type PDISK_INT13_INFO = uintptr
  51150 
  51151 type _DISK_EX_INT13_INFO = struct {
  51152 	FExBufferSize      WORD
  51153 	FExFlags           WORD
  51154 	FExCylinders       DWORD
  51155 	FExHeads           DWORD
  51156 	FExSectorsPerTrack DWORD
  51157 	FExSectorsPerDrive DWORD64
  51158 	FExSectorSize      WORD
  51159 	FExReserved        WORD
  51160 	F__ccgo_pad1       [4]byte
  51161 }
  51162 
  51163 type DISK_EX_INT13_INFO = _DISK_EX_INT13_INFO
  51164 type PDISK_EX_INT13_INFO = uintptr
  51165 
  51166 type _DISK_DETECTION_INFO = struct {
  51167 	FSizeOfDetectInfo DWORD
  51168 	FDetectionType    DETECTION_TYPE
  51169 	Fu                struct {
  51170 		Fs struct {
  51171 			FInt13   DISK_INT13_INFO
  51172 			FExInt13 DISK_EX_INT13_INFO
  51173 		}
  51174 	}
  51175 }
  51176 
  51177 type DISK_DETECTION_INFO = _DISK_DETECTION_INFO
  51178 type PDISK_DETECTION_INFO = uintptr
  51179 
  51180 type _DISK_PARTITION_INFO = struct {
  51181 	FSizeOfPartitionInfo DWORD
  51182 	FPartitionStyle      PARTITION_STYLE
  51183 	Fu                   struct {
  51184 		FMbr struct {
  51185 			FSignature DWORD
  51186 			FCheckSum  DWORD
  51187 		}
  51188 		F__ccgo_pad1 [8]byte
  51189 	}
  51190 }
  51191 
  51192 type DISK_PARTITION_INFO = _DISK_PARTITION_INFO
  51193 type PDISK_PARTITION_INFO = uintptr
  51194 
  51195 type _DISK_GEOMETRY_EX = struct {
  51196 	FGeometry    DISK_GEOMETRY
  51197 	FDiskSize    LARGE_INTEGER
  51198 	FData        [1]BYTE
  51199 	F__ccgo_pad1 [7]byte
  51200 }
  51201 
  51202 type DISK_GEOMETRY_EX = _DISK_GEOMETRY_EX
  51203 type PDISK_GEOMETRY_EX = uintptr
  51204 
  51205 type _DISK_CONTROLLER_NUMBER = struct {
  51206 	FControllerNumber DWORD
  51207 	FDiskNumber       DWORD
  51208 }
  51209 
  51210 type DISK_CONTROLLER_NUMBER = _DISK_CONTROLLER_NUMBER
  51211 type PDISK_CONTROLLER_NUMBER = uintptr
  51212 
  51213 type DISK_CACHE_RETENTION_PRIORITY = uint32
  51214 
  51215 type _DISK_CACHE_INFORMATION = struct {
  51216 	FParametersSavable             BOOLEAN
  51217 	FReadCacheEnabled              BOOLEAN
  51218 	FWriteCacheEnabled             BOOLEAN
  51219 	F__ccgo_pad1                   [1]byte
  51220 	FReadRetentionPriority         DISK_CACHE_RETENTION_PRIORITY
  51221 	FWriteRetentionPriority        DISK_CACHE_RETENTION_PRIORITY
  51222 	FDisablePrefetchTransferLength WORD
  51223 	FPrefetchScalar                BOOLEAN
  51224 	F__ccgo_pad2                   [1]byte
  51225 	Fu                             struct {
  51226 		FScalarPrefetch struct {
  51227 			FMinimum       WORD
  51228 			FMaximum       WORD
  51229 			FMaximumBlocks WORD
  51230 		}
  51231 	}
  51232 	F__ccgo_pad3 [2]byte
  51233 }
  51234 
  51235 type DISK_CACHE_INFORMATION = _DISK_CACHE_INFORMATION
  51236 type PDISK_CACHE_INFORMATION = uintptr
  51237 
  51238 type _DISK_GROW_PARTITION = struct {
  51239 	FPartitionNumber DWORD
  51240 	F__ccgo_pad1     [4]byte
  51241 	FBytesToGrow     LARGE_INTEGER
  51242 }
  51243 
  51244 type DISK_GROW_PARTITION = _DISK_GROW_PARTITION
  51245 type PDISK_GROW_PARTITION = uintptr
  51246 
  51247 type _HISTOGRAM_BUCKET = struct {
  51248 	FReads  DWORD
  51249 	FWrites DWORD
  51250 }
  51251 
  51252 type HISTOGRAM_BUCKET = _HISTOGRAM_BUCKET
  51253 type PHISTOGRAM_BUCKET = uintptr
  51254 
  51255 type _DISK_HISTOGRAM = struct {
  51256 	FDiskSize     LARGE_INTEGER
  51257 	FStart        LARGE_INTEGER
  51258 	FEnd          LARGE_INTEGER
  51259 	FAverage      LARGE_INTEGER
  51260 	FAverageRead  LARGE_INTEGER
  51261 	FAverageWrite LARGE_INTEGER
  51262 	FGranularity  DWORD
  51263 	FSize         DWORD
  51264 	FReadCount    DWORD
  51265 	FWriteCount   DWORD
  51266 	FHistogram    PHISTOGRAM_BUCKET
  51267 }
  51268 
  51269 type DISK_HISTOGRAM = _DISK_HISTOGRAM
  51270 type PDISK_HISTOGRAM = uintptr
  51271 
  51272 type _DISK_PERFORMANCE = struct {
  51273 	FBytesRead           LARGE_INTEGER
  51274 	FBytesWritten        LARGE_INTEGER
  51275 	FReadTime            LARGE_INTEGER
  51276 	FWriteTime           LARGE_INTEGER
  51277 	FIdleTime            LARGE_INTEGER
  51278 	FReadCount           DWORD
  51279 	FWriteCount          DWORD
  51280 	FQueueDepth          DWORD
  51281 	FSplitCount          DWORD
  51282 	FQueryTime           LARGE_INTEGER
  51283 	FStorageDeviceNumber DWORD
  51284 	FStorageManagerName  [8]WCHAR
  51285 	F__ccgo_pad1         [4]byte
  51286 }
  51287 
  51288 type DISK_PERFORMANCE = _DISK_PERFORMANCE
  51289 type PDISK_PERFORMANCE = uintptr
  51290 
  51291 type _DISK_RECORD = struct {
  51292 	FByteOffset     LARGE_INTEGER
  51293 	FStartTime      LARGE_INTEGER
  51294 	FEndTime        LARGE_INTEGER
  51295 	FVirtualAddress PVOID
  51296 	FNumberOfBytes  DWORD
  51297 	FDeviceNumber   BYTE
  51298 	FReadRequest    BOOLEAN
  51299 	F__ccgo_pad1    [2]byte
  51300 }
  51301 
  51302 type DISK_RECORD = _DISK_RECORD
  51303 type PDISK_RECORD = uintptr
  51304 
  51305 type _DISK_LOGGING = struct {
  51306 	FFunction      BYTE
  51307 	F__ccgo_pad1   [7]byte
  51308 	FBufferAddress PVOID
  51309 	FBufferSize    DWORD
  51310 	F__ccgo_pad2   [4]byte
  51311 }
  51312 
  51313 type DISK_LOGGING = _DISK_LOGGING
  51314 type PDISK_LOGGING = uintptr
  51315 
  51316 type BIN_TYPES = uint32
  51317 
  51318 type _BIN_RANGE = struct {
  51319 	FStartValue LARGE_INTEGER
  51320 	FLength     LARGE_INTEGER
  51321 }
  51322 
  51323 type BIN_RANGE = _BIN_RANGE
  51324 type PBIN_RANGE = uintptr
  51325 
  51326 type _PERF_BIN = struct {
  51327 	FNumberOfBins DWORD
  51328 	FTypeOfBin    DWORD
  51329 	FBinsRanges   [1]BIN_RANGE
  51330 }
  51331 
  51332 type PERF_BIN = _PERF_BIN
  51333 type PPERF_BIN = uintptr
  51334 
  51335 type _BIN_COUNT = struct {
  51336 	FBinRange    BIN_RANGE
  51337 	FBinCount    DWORD
  51338 	F__ccgo_pad1 [4]byte
  51339 }
  51340 
  51341 type BIN_COUNT = _BIN_COUNT
  51342 type PBIN_COUNT = uintptr
  51343 
  51344 type _BIN_RESULTS = struct {
  51345 	FNumberOfBins DWORD
  51346 	F__ccgo_pad1  [4]byte
  51347 	FBinCounts    [1]BIN_COUNT
  51348 }
  51349 
  51350 type BIN_RESULTS = _BIN_RESULTS
  51351 type PBIN_RESULTS = uintptr
  51352 
  51353 type _GETVERSIONINPARAMS = struct {
  51354 	FbVersion      BYTE
  51355 	FbRevision     BYTE
  51356 	FbReserved     BYTE
  51357 	FbIDEDeviceMap BYTE
  51358 	FfCapabilities DWORD
  51359 	FdwReserved    [4]DWORD
  51360 }
  51361 
  51362 // *
  51363 // This file has no copyright assigned and is placed in the Public Domain.
  51364 // This file is part of the mingw-w64 runtime package.
  51365 // No warranty is given; refer to the file DISCLAIMER.PD within this package.
  51366 type GETVERSIONINPARAMS = _GETVERSIONINPARAMS
  51367 type PGETVERSIONINPARAMS = uintptr
  51368 type LPGETVERSIONINPARAMS = uintptr
  51369 
  51370 type _IDEREGS = struct {
  51371 	FbFeaturesReg     BYTE
  51372 	FbSectorCountReg  BYTE
  51373 	FbSectorNumberReg BYTE
  51374 	FbCylLowReg       BYTE
  51375 	FbCylHighReg      BYTE
  51376 	FbDriveHeadReg    BYTE
  51377 	FbCommandReg      BYTE
  51378 	FbReserved        BYTE
  51379 }
  51380 
  51381 // *
  51382 // This file has no copyright assigned and is placed in the Public Domain.
  51383 // This file is part of the mingw-w64 runtime package.
  51384 // No warranty is given; refer to the file DISCLAIMER.PD within this package.
  51385 type IDEREGS = _IDEREGS
  51386 type PIDEREGS = uintptr
  51387 type LPIDEREGS = uintptr
  51388 
  51389 type _SENDCMDINPARAMS = struct {
  51390 	FcBufferSize  DWORD
  51391 	FirDriveRegs  IDEREGS
  51392 	FbDriveNumber BYTE
  51393 	FbReserved    [3]BYTE
  51394 	FdwReserved   [4]DWORD
  51395 	FbBuffer      [1]BYTE
  51396 	F__ccgo_pad1  [3]byte
  51397 }
  51398 
  51399 // *
  51400 // This file has no copyright assigned and is placed in the Public Domain.
  51401 // This file is part of the mingw-w64 runtime package.
  51402 // No warranty is given; refer to the file DISCLAIMER.PD within this package.
  51403 type SENDCMDINPARAMS = _SENDCMDINPARAMS
  51404 type PSENDCMDINPARAMS = uintptr
  51405 type LPSENDCMDINPARAMS = uintptr
  51406 
  51407 type _DRIVERSTATUS = struct {
  51408 	FbDriverError BYTE
  51409 	FbIDEError    BYTE
  51410 	FbReserved    [2]BYTE
  51411 	FdwReserved   [2]DWORD
  51412 }
  51413 
  51414 // *
  51415 // This file has no copyright assigned and is placed in the Public Domain.
  51416 // This file is part of the mingw-w64 runtime package.
  51417 // No warranty is given; refer to the file DISCLAIMER.PD within this package.
  51418 type DRIVERSTATUS = _DRIVERSTATUS
  51419 type PDRIVERSTATUS = uintptr
  51420 type LPDRIVERSTATUS = uintptr
  51421 
  51422 type _SENDCMDOUTPARAMS = struct {
  51423 	FcBufferSize  DWORD
  51424 	FDriverStatus DRIVERSTATUS
  51425 	FbBuffer      [1]BYTE
  51426 	F__ccgo_pad1  [3]byte
  51427 }
  51428 
  51429 // *
  51430 // This file has no copyright assigned and is placed in the Public Domain.
  51431 // This file is part of the mingw-w64 runtime package.
  51432 // No warranty is given; refer to the file DISCLAIMER.PD within this package.
  51433 type SENDCMDOUTPARAMS = _SENDCMDOUTPARAMS
  51434 type PSENDCMDOUTPARAMS = uintptr
  51435 type LPSENDCMDOUTPARAMS = uintptr
  51436 
  51437 type ELEMENT_TYPE = uint32
  51438 type PELEMENT_TYPE = uintptr
  51439 
  51440 type _CHANGER_ELEMENT = struct {
  51441 	FElementType    ELEMENT_TYPE
  51442 	FElementAddress DWORD
  51443 }
  51444 
  51445 type CHANGER_ELEMENT = _CHANGER_ELEMENT
  51446 type PCHANGER_ELEMENT = uintptr
  51447 
  51448 type _CHANGER_ELEMENT_LIST = struct {
  51449 	FElement          CHANGER_ELEMENT
  51450 	FNumberOfElements DWORD
  51451 }
  51452 
  51453 type CHANGER_ELEMENT_LIST = _CHANGER_ELEMENT_LIST
  51454 type PCHANGER_ELEMENT_LIST = uintptr
  51455 
  51456 type _GET_CHANGER_PARAMETERS = struct {
  51457 	FSize                       DWORD
  51458 	FNumberTransportElements    WORD
  51459 	FNumberStorageElements      WORD
  51460 	FNumberCleanerSlots         WORD
  51461 	FNumberIEElements           WORD
  51462 	FNumberDataTransferElements WORD
  51463 	FNumberOfDoors              WORD
  51464 	FFirstSlotNumber            WORD
  51465 	FFirstDriveNumber           WORD
  51466 	FFirstTransportNumber       WORD
  51467 	FFirstIEPortNumber          WORD
  51468 	FFirstCleanerSlotAddress    WORD
  51469 	FMagazineSize               WORD
  51470 	FDriveCleanTimeout          DWORD
  51471 	FFeatures0                  DWORD
  51472 	FFeatures1                  DWORD
  51473 	FMoveFromTransport          BYTE
  51474 	FMoveFromSlot               BYTE
  51475 	FMoveFromIePort             BYTE
  51476 	FMoveFromDrive              BYTE
  51477 	FExchangeFromTransport      BYTE
  51478 	FExchangeFromSlot           BYTE
  51479 	FExchangeFromIePort         BYTE
  51480 	FExchangeFromDrive          BYTE
  51481 	FLockUnlockCapabilities     BYTE
  51482 	FPositionCapabilities       BYTE
  51483 	FReserved1                  [2]BYTE
  51484 	FReserved2                  [2]DWORD
  51485 }
  51486 
  51487 type GET_CHANGER_PARAMETERS = _GET_CHANGER_PARAMETERS
  51488 type PGET_CHANGER_PARAMETERS = uintptr
  51489 
  51490 type _CHANGER_PRODUCT_DATA = struct {
  51491 	FVendorId     [8]BYTE
  51492 	FProductId    [16]BYTE
  51493 	FRevision     [4]BYTE
  51494 	FSerialNumber [32]BYTE
  51495 	FDeviceType   BYTE
  51496 }
  51497 
  51498 type CHANGER_PRODUCT_DATA = _CHANGER_PRODUCT_DATA
  51499 type PCHANGER_PRODUCT_DATA = uintptr
  51500 
  51501 type _CHANGER_SET_ACCESS = struct {
  51502 	FElement CHANGER_ELEMENT
  51503 	FControl DWORD
  51504 }
  51505 
  51506 type CHANGER_SET_ACCESS = _CHANGER_SET_ACCESS
  51507 type PCHANGER_SET_ACCESS = uintptr
  51508 
  51509 type _CHANGER_READ_ELEMENT_STATUS = struct {
  51510 	FElementList   CHANGER_ELEMENT_LIST
  51511 	FVolumeTagInfo BOOLEAN
  51512 	F__ccgo_pad1   [3]byte
  51513 }
  51514 
  51515 type CHANGER_READ_ELEMENT_STATUS = _CHANGER_READ_ELEMENT_STATUS
  51516 type PCHANGER_READ_ELEMENT_STATUS = uintptr
  51517 
  51518 type _CHANGER_ELEMENT_STATUS = struct {
  51519 	FElement           CHANGER_ELEMENT
  51520 	FSrcElementAddress CHANGER_ELEMENT
  51521 	FFlags             DWORD
  51522 	FExceptionCode     DWORD
  51523 	FTargetId          BYTE
  51524 	FLun               BYTE
  51525 	FReserved          WORD
  51526 	FPrimaryVolumeID   [36]BYTE
  51527 	FAlternateVolumeID [36]BYTE
  51528 }
  51529 
  51530 type CHANGER_ELEMENT_STATUS = _CHANGER_ELEMENT_STATUS
  51531 type PCHANGER_ELEMENT_STATUS = uintptr
  51532 
  51533 type _CHANGER_ELEMENT_STATUS_EX = struct {
  51534 	FElement               CHANGER_ELEMENT
  51535 	FSrcElementAddress     CHANGER_ELEMENT
  51536 	FFlags                 DWORD
  51537 	FExceptionCode         DWORD
  51538 	FTargetId              BYTE
  51539 	FLun                   BYTE
  51540 	FReserved              WORD
  51541 	FPrimaryVolumeID       [36]BYTE
  51542 	FAlternateVolumeID     [36]BYTE
  51543 	FVendorIdentification  [8]BYTE
  51544 	FProductIdentification [16]BYTE
  51545 	FSerialNumber          [32]BYTE
  51546 }
  51547 
  51548 type CHANGER_ELEMENT_STATUS_EX = _CHANGER_ELEMENT_STATUS_EX
  51549 type PCHANGER_ELEMENT_STATUS_EX = uintptr
  51550 
  51551 type _CHANGER_INITIALIZE_ELEMENT_STATUS = struct {
  51552 	FElementList CHANGER_ELEMENT_LIST
  51553 	FBarCodeScan BOOLEAN
  51554 	F__ccgo_pad1 [3]byte
  51555 }
  51556 
  51557 type CHANGER_INITIALIZE_ELEMENT_STATUS = _CHANGER_INITIALIZE_ELEMENT_STATUS
  51558 type PCHANGER_INITIALIZE_ELEMENT_STATUS = uintptr
  51559 
  51560 type _CHANGER_SET_POSITION = struct {
  51561 	FTransport   CHANGER_ELEMENT
  51562 	FDestination CHANGER_ELEMENT
  51563 	FFlip        BOOLEAN
  51564 	F__ccgo_pad1 [3]byte
  51565 }
  51566 
  51567 type CHANGER_SET_POSITION = _CHANGER_SET_POSITION
  51568 type PCHANGER_SET_POSITION = uintptr
  51569 
  51570 type _CHANGER_EXCHANGE_MEDIUM = struct {
  51571 	FTransport    CHANGER_ELEMENT
  51572 	FSource       CHANGER_ELEMENT
  51573 	FDestination1 CHANGER_ELEMENT
  51574 	FDestination2 CHANGER_ELEMENT
  51575 	FFlip1        BOOLEAN
  51576 	FFlip2        BOOLEAN
  51577 	F__ccgo_pad1  [2]byte
  51578 }
  51579 
  51580 type CHANGER_EXCHANGE_MEDIUM = _CHANGER_EXCHANGE_MEDIUM
  51581 type PCHANGER_EXCHANGE_MEDIUM = uintptr
  51582 
  51583 type _CHANGER_MOVE_MEDIUM = struct {
  51584 	FTransport   CHANGER_ELEMENT
  51585 	FSource      CHANGER_ELEMENT
  51586 	FDestination CHANGER_ELEMENT
  51587 	FFlip        BOOLEAN
  51588 	F__ccgo_pad1 [3]byte
  51589 }
  51590 
  51591 type CHANGER_MOVE_MEDIUM = _CHANGER_MOVE_MEDIUM
  51592 type PCHANGER_MOVE_MEDIUM = uintptr
  51593 
  51594 type _CHANGER_SEND_VOLUME_TAG_INFORMATION = struct {
  51595 	FStartingElement  CHANGER_ELEMENT
  51596 	FActionCode       DWORD
  51597 	FVolumeIDTemplate [40]BYTE
  51598 }
  51599 
  51600 type CHANGER_SEND_VOLUME_TAG_INFORMATION = _CHANGER_SEND_VOLUME_TAG_INFORMATION
  51601 type PCHANGER_SEND_VOLUME_TAG_INFORMATION = uintptr
  51602 
  51603 type _READ_ELEMENT_ADDRESS_INFO = struct {
  51604 	FNumberOfElements DWORD
  51605 	FElementStatus    [1]CHANGER_ELEMENT_STATUS
  51606 }
  51607 
  51608 type READ_ELEMENT_ADDRESS_INFO = _READ_ELEMENT_ADDRESS_INFO
  51609 type PREAD_ELEMENT_ADDRESS_INFO = uintptr
  51610 
  51611 type CHANGER_DEVICE_PROBLEM_TYPE = uint32
  51612 type PCHANGER_DEVICE_PROBLEM_TYPE = uintptr
  51613 
  51614 type _PATHNAME_BUFFER = struct {
  51615 	FPathNameLength DWORD
  51616 	FName           [1]WCHAR
  51617 	F__ccgo_pad1    [2]byte
  51618 }
  51619 
  51620 type PATHNAME_BUFFER = _PATHNAME_BUFFER
  51621 type PPATHNAME_BUFFER = uintptr
  51622 
  51623 type _FSCTL_QUERY_FAT_BPB_BUFFER = struct{ FFirst0x24BytesOfBootSector [36]BYTE }
  51624 
  51625 type FSCTL_QUERY_FAT_BPB_BUFFER = _FSCTL_QUERY_FAT_BPB_BUFFER
  51626 type PFSCTL_QUERY_FAT_BPB_BUFFER = uintptr
  51627 
  51628 type NTFS_VOLUME_DATA_BUFFER = struct {
  51629 	FVolumeSerialNumber           LARGE_INTEGER
  51630 	FNumberSectors                LARGE_INTEGER
  51631 	FTotalClusters                LARGE_INTEGER
  51632 	FFreeClusters                 LARGE_INTEGER
  51633 	FTotalReserved                LARGE_INTEGER
  51634 	FBytesPerSector               DWORD
  51635 	FBytesPerCluster              DWORD
  51636 	FBytesPerFileRecordSegment    DWORD
  51637 	FClustersPerFileRecordSegment DWORD
  51638 	FMftValidDataLength           LARGE_INTEGER
  51639 	FMftStartLcn                  LARGE_INTEGER
  51640 	FMft2StartLcn                 LARGE_INTEGER
  51641 	FMftZoneStart                 LARGE_INTEGER
  51642 	FMftZoneEnd                   LARGE_INTEGER
  51643 }
  51644 type PNTFS_VOLUME_DATA_BUFFER = uintptr
  51645 
  51646 type NTFS_EXTENDED_VOLUME_DATA = struct {
  51647 	FByteCount    DWORD
  51648 	FMajorVersion WORD
  51649 	FMinorVersion WORD
  51650 }
  51651 type PNTFS_EXTENDED_VOLUME_DATA = uintptr
  51652 
  51653 type STARTING_LCN_INPUT_BUFFER = struct{ FStartingLcn LARGE_INTEGER }
  51654 type PSTARTING_LCN_INPUT_BUFFER = uintptr
  51655 
  51656 type VOLUME_BITMAP_BUFFER = struct {
  51657 	FStartingLcn LARGE_INTEGER
  51658 	FBitmapSize  LARGE_INTEGER
  51659 	FBuffer      [1]BYTE
  51660 	F__ccgo_pad1 [7]byte
  51661 }
  51662 type PVOLUME_BITMAP_BUFFER = uintptr
  51663 
  51664 type STARTING_VCN_INPUT_BUFFER = struct{ FStartingVcn LARGE_INTEGER }
  51665 type PSTARTING_VCN_INPUT_BUFFER = uintptr
  51666 
  51667 type RETRIEVAL_POINTERS_BUFFER1 = struct {
  51668 	FExtentCount DWORD
  51669 	F__ccgo_pad1 [4]byte
  51670 	FStartingVcn LARGE_INTEGER
  51671 	FExtents     [1]struct {
  51672 		FNextVcn LARGE_INTEGER
  51673 		FLcn     LARGE_INTEGER
  51674 	}
  51675 }
  51676 
  51677 type RETRIEVAL_POINTERS_BUFFER = RETRIEVAL_POINTERS_BUFFER1
  51678 type PRETRIEVAL_POINTERS_BUFFER = uintptr
  51679 
  51680 type NTFS_FILE_RECORD_INPUT_BUFFER = struct{ FFileReferenceNumber LARGE_INTEGER }
  51681 type PNTFS_FILE_RECORD_INPUT_BUFFER = uintptr
  51682 
  51683 type NTFS_FILE_RECORD_OUTPUT_BUFFER = struct {
  51684 	FFileReferenceNumber LARGE_INTEGER
  51685 	FFileRecordLength    DWORD
  51686 	FFileRecordBuffer    [1]BYTE
  51687 	F__ccgo_pad1         [3]byte
  51688 }
  51689 type PNTFS_FILE_RECORD_OUTPUT_BUFFER = uintptr
  51690 
  51691 type MOVE_FILE_DATA = struct {
  51692 	FFileHandle   HANDLE
  51693 	FStartingVcn  LARGE_INTEGER
  51694 	FStartingLcn  LARGE_INTEGER
  51695 	FClusterCount DWORD
  51696 	F__ccgo_pad1  [4]byte
  51697 }
  51698 type PMOVE_FILE_DATA = uintptr
  51699 
  51700 type _MOVE_FILE_DATA32 = struct {
  51701 	FFileHandle   UINT32
  51702 	F__ccgo_pad1  [4]byte
  51703 	FStartingVcn  LARGE_INTEGER
  51704 	FStartingLcn  LARGE_INTEGER
  51705 	FClusterCount DWORD
  51706 	F__ccgo_pad2  [4]byte
  51707 }
  51708 
  51709 type MOVE_FILE_DATA32 = _MOVE_FILE_DATA32
  51710 type PMOVE_FILE_DATA32 = uintptr
  51711 
  51712 type FIND_BY_SID_DATA = struct {
  51713 	FRestart DWORD
  51714 	FSid     SID
  51715 }
  51716 type PFIND_BY_SID_DATA = uintptr
  51717 
  51718 type FIND_BY_SID_OUTPUT = struct {
  51719 	FNextEntryOffset DWORD
  51720 	FFileIndex       DWORD
  51721 	FFileNameLength  DWORD
  51722 	FFileName        [1]WCHAR
  51723 	F__ccgo_pad1     [2]byte
  51724 }
  51725 type PFIND_BY_SID_OUTPUT = uintptr
  51726 
  51727 type MFT_ENUM_DATA = struct {
  51728 	FStartFileReferenceNumber DWORDLONG
  51729 	FLowUsn                   USN
  51730 	FHighUsn                  USN
  51731 }
  51732 type PMFT_ENUM_DATA = uintptr
  51733 
  51734 type CREATE_USN_JOURNAL_DATA = struct {
  51735 	FMaximumSize     DWORDLONG
  51736 	FAllocationDelta DWORDLONG
  51737 }
  51738 type PCREATE_USN_JOURNAL_DATA = uintptr
  51739 
  51740 type READ_USN_JOURNAL_DATA = struct {
  51741 	FStartUsn          USN
  51742 	FReasonMask        DWORD
  51743 	FReturnOnlyOnClose DWORD
  51744 	FTimeout           DWORDLONG
  51745 	FBytesToWaitFor    DWORDLONG
  51746 	FUsnJournalID      DWORDLONG
  51747 }
  51748 type PREAD_USN_JOURNAL_DATA = uintptr
  51749 
  51750 type USN_RECORD = struct {
  51751 	FRecordLength              DWORD
  51752 	FMajorVersion              WORD
  51753 	FMinorVersion              WORD
  51754 	FFileReferenceNumber       DWORDLONG
  51755 	FParentFileReferenceNumber DWORDLONG
  51756 	FUsn                       USN
  51757 	FTimeStamp                 LARGE_INTEGER
  51758 	FReason                    DWORD
  51759 	FSourceInfo                DWORD
  51760 	FSecurityId                DWORD
  51761 	FFileAttributes            DWORD
  51762 	FFileNameLength            WORD
  51763 	FFileNameOffset            WORD
  51764 	FFileName                  [1]WCHAR
  51765 	F__ccgo_pad1               [2]byte
  51766 }
  51767 type PUSN_RECORD = uintptr
  51768 
  51769 type USN_JOURNAL_DATA = struct {
  51770 	FUsnJournalID    DWORDLONG
  51771 	FFirstUsn        USN
  51772 	FNextUsn         USN
  51773 	FLowestValidUsn  USN
  51774 	FMaxUsn          USN
  51775 	FMaximumSize     DWORDLONG
  51776 	FAllocationDelta DWORDLONG
  51777 }
  51778 type PUSN_JOURNAL_DATA = uintptr
  51779 
  51780 type DELETE_USN_JOURNAL_DATA = struct {
  51781 	FUsnJournalID DWORDLONG
  51782 	FDeleteFlags  DWORD
  51783 	F__ccgo_pad1  [4]byte
  51784 }
  51785 type PDELETE_USN_JOURNAL_DATA = uintptr
  51786 
  51787 type MARK_HANDLE_INFO = struct {
  51788 	FUsnSourceInfo DWORD
  51789 	F__ccgo_pad1   [4]byte
  51790 	FVolumeHandle  HANDLE
  51791 	FHandleInfo    DWORD
  51792 	F__ccgo_pad2   [4]byte
  51793 }
  51794 type PMARK_HANDLE_INFO = uintptr
  51795 
  51796 type MARK_HANDLE_INFO32 = struct {
  51797 	FUsnSourceInfo DWORD
  51798 	FVolumeHandle  UINT32
  51799 	FHandleInfo    DWORD
  51800 }
  51801 type PMARK_HANDLE_INFO32 = uintptr
  51802 
  51803 type BULK_SECURITY_TEST_DATA = struct {
  51804 	FDesiredAccess ACCESS_MASK
  51805 	FSecurityIds   [1]DWORD
  51806 }
  51807 type PBULK_SECURITY_TEST_DATA = uintptr
  51808 
  51809 type _FILE_PREFETCH = struct {
  51810 	FType     DWORD
  51811 	FCount    DWORD
  51812 	FPrefetch [1]DWORDLONG
  51813 }
  51814 
  51815 type FILE_PREFETCH = _FILE_PREFETCH
  51816 type PFILE_PREFETCH = uintptr
  51817 
  51818 type _FILESYSTEM_STATISTICS = struct {
  51819 	FFileSystemType          WORD
  51820 	FVersion                 WORD
  51821 	FSizeOfCompleteStructure DWORD
  51822 	FUserFileReads           DWORD
  51823 	FUserFileReadBytes       DWORD
  51824 	FUserDiskReads           DWORD
  51825 	FUserFileWrites          DWORD
  51826 	FUserFileWriteBytes      DWORD
  51827 	FUserDiskWrites          DWORD
  51828 	FMetaDataReads           DWORD
  51829 	FMetaDataReadBytes       DWORD
  51830 	FMetaDataDiskReads       DWORD
  51831 	FMetaDataWrites          DWORD
  51832 	FMetaDataWriteBytes      DWORD
  51833 	FMetaDataDiskWrites      DWORD
  51834 }
  51835 
  51836 type FILESYSTEM_STATISTICS = _FILESYSTEM_STATISTICS
  51837 type PFILESYSTEM_STATISTICS = uintptr
  51838 
  51839 type _FAT_STATISTICS = struct {
  51840 	FCreateHits          DWORD
  51841 	FSuccessfulCreates   DWORD
  51842 	FFailedCreates       DWORD
  51843 	FNonCachedReads      DWORD
  51844 	FNonCachedReadBytes  DWORD
  51845 	FNonCachedWrites     DWORD
  51846 	FNonCachedWriteBytes DWORD
  51847 	FNonCachedDiskReads  DWORD
  51848 	FNonCachedDiskWrites DWORD
  51849 }
  51850 
  51851 type FAT_STATISTICS = _FAT_STATISTICS
  51852 type PFAT_STATISTICS = uintptr
  51853 
  51854 type _EXFAT_STATISTICS = struct {
  51855 	FCreateHits          DWORD
  51856 	FSuccessfulCreates   DWORD
  51857 	FFailedCreates       DWORD
  51858 	FNonCachedReads      DWORD
  51859 	FNonCachedReadBytes  DWORD
  51860 	FNonCachedWrites     DWORD
  51861 	FNonCachedWriteBytes DWORD
  51862 	FNonCachedDiskReads  DWORD
  51863 	FNonCachedDiskWrites DWORD
  51864 }
  51865 
  51866 type EXFAT_STATISTICS = _EXFAT_STATISTICS
  51867 type PEXFAT_STATISTICS = uintptr
  51868 
  51869 type _NTFS_STATISTICS = struct {
  51870 	FLogFileFullExceptions DWORD
  51871 	FOtherExceptions       DWORD
  51872 	FMftReads              DWORD
  51873 	FMftReadBytes          DWORD
  51874 	FMftWrites             DWORD
  51875 	FMftWriteBytes         DWORD
  51876 	FMftWritesUserLevel    struct {
  51877 		FWrite   WORD
  51878 		FCreate  WORD
  51879 		FSetInfo WORD
  51880 		FFlush   WORD
  51881 	}
  51882 	FMftWritesFlushForLogFileFull WORD
  51883 	FMftWritesLazyWriter          WORD
  51884 	FMftWritesUserRequest         WORD
  51885 	F__ccgo_pad1                  [2]byte
  51886 	FMft2Writes                   DWORD
  51887 	FMft2WriteBytes               DWORD
  51888 	FMft2WritesUserLevel          struct {
  51889 		FWrite   WORD
  51890 		FCreate  WORD
  51891 		FSetInfo WORD
  51892 		FFlush   WORD
  51893 	}
  51894 	FMft2WritesFlushForLogFileFull   WORD
  51895 	FMft2WritesLazyWriter            WORD
  51896 	FMft2WritesUserRequest           WORD
  51897 	F__ccgo_pad2                     [2]byte
  51898 	FRootIndexReads                  DWORD
  51899 	FRootIndexReadBytes              DWORD
  51900 	FRootIndexWrites                 DWORD
  51901 	FRootIndexWriteBytes             DWORD
  51902 	FBitmapReads                     DWORD
  51903 	FBitmapReadBytes                 DWORD
  51904 	FBitmapWrites                    DWORD
  51905 	FBitmapWriteBytes                DWORD
  51906 	FBitmapWritesFlushForLogFileFull WORD
  51907 	FBitmapWritesLazyWriter          WORD
  51908 	FBitmapWritesUserRequest         WORD
  51909 	FBitmapWritesUserLevel           struct {
  51910 		FWrite   WORD
  51911 		FCreate  WORD
  51912 		FSetInfo WORD
  51913 	}
  51914 	FMftBitmapReads                     DWORD
  51915 	FMftBitmapReadBytes                 DWORD
  51916 	FMftBitmapWrites                    DWORD
  51917 	FMftBitmapWriteBytes                DWORD
  51918 	FMftBitmapWritesFlushForLogFileFull WORD
  51919 	FMftBitmapWritesLazyWriter          WORD
  51920 	FMftBitmapWritesUserRequest         WORD
  51921 	FMftBitmapWritesUserLevel           struct {
  51922 		FWrite   WORD
  51923 		FCreate  WORD
  51924 		FSetInfo WORD
  51925 		FFlush   WORD
  51926 	}
  51927 	F__ccgo_pad3         [2]byte
  51928 	FUserIndexReads      DWORD
  51929 	FUserIndexReadBytes  DWORD
  51930 	FUserIndexWrites     DWORD
  51931 	FUserIndexWriteBytes DWORD
  51932 	FLogFileReads        DWORD
  51933 	FLogFileReadBytes    DWORD
  51934 	FLogFileWrites       DWORD
  51935 	FLogFileWriteBytes   DWORD
  51936 	FAllocate            struct {
  51937 		FCalls             DWORD
  51938 		FClusters          DWORD
  51939 		FHints             DWORD
  51940 		FRunsReturned      DWORD
  51941 		FHintsHonored      DWORD
  51942 		FHintsClusters     DWORD
  51943 		FCache             DWORD
  51944 		FCacheClusters     DWORD
  51945 		FCacheMiss         DWORD
  51946 		FCacheMissClusters DWORD
  51947 	}
  51948 }
  51949 
  51950 type NTFS_STATISTICS = _NTFS_STATISTICS
  51951 type PNTFS_STATISTICS = uintptr
  51952 
  51953 type _FILE_OBJECTID_BUFFER = struct {
  51954 	FObjectId [16]BYTE
  51955 	Fu        struct {
  51956 		Fs struct {
  51957 			FBirthVolumeId [16]BYTE
  51958 			FBirthObjectId [16]BYTE
  51959 			FDomainId      [16]BYTE
  51960 		}
  51961 	}
  51962 }
  51963 
  51964 type FILE_OBJECTID_BUFFER = _FILE_OBJECTID_BUFFER
  51965 type PFILE_OBJECTID_BUFFER = uintptr
  51966 
  51967 type _FILE_SET_SPARSE_BUFFER = struct{ FSetSparse BOOLEAN }
  51968 
  51969 type FILE_SET_SPARSE_BUFFER = _FILE_SET_SPARSE_BUFFER
  51970 type PFILE_SET_SPARSE_BUFFER = uintptr
  51971 
  51972 type _FILE_ZERO_DATA_INFORMATION = struct {
  51973 	FFileOffset      LARGE_INTEGER
  51974 	FBeyondFinalZero LARGE_INTEGER
  51975 }
  51976 
  51977 type FILE_ZERO_DATA_INFORMATION = _FILE_ZERO_DATA_INFORMATION
  51978 type PFILE_ZERO_DATA_INFORMATION = uintptr
  51979 
  51980 type _FILE_ALLOCATED_RANGE_BUFFER = struct {
  51981 	FFileOffset LARGE_INTEGER
  51982 	FLength     LARGE_INTEGER
  51983 }
  51984 
  51985 type FILE_ALLOCATED_RANGE_BUFFER = _FILE_ALLOCATED_RANGE_BUFFER
  51986 type PFILE_ALLOCATED_RANGE_BUFFER = uintptr
  51987 
  51988 type _ENCRYPTION_BUFFER = struct {
  51989 	FEncryptionOperation DWORD
  51990 	FPrivate             [1]BYTE
  51991 	F__ccgo_pad1         [3]byte
  51992 }
  51993 
  51994 type ENCRYPTION_BUFFER = _ENCRYPTION_BUFFER
  51995 type PENCRYPTION_BUFFER = uintptr
  51996 
  51997 type _DECRYPTION_STATUS_BUFFER = struct{ FNoEncryptedStreams BOOLEAN }
  51998 
  51999 type DECRYPTION_STATUS_BUFFER = _DECRYPTION_STATUS_BUFFER
  52000 type PDECRYPTION_STATUS_BUFFER = uintptr
  52001 
  52002 type _REQUEST_RAW_ENCRYPTED_DATA = struct {
  52003 	FFileOffset  LONGLONG
  52004 	FLength      DWORD
  52005 	F__ccgo_pad1 [4]byte
  52006 }
  52007 
  52008 type REQUEST_RAW_ENCRYPTED_DATA = _REQUEST_RAW_ENCRYPTED_DATA
  52009 type PREQUEST_RAW_ENCRYPTED_DATA = uintptr
  52010 
  52011 type _ENCRYPTED_DATA_INFO = struct {
  52012 	FStartingFileOffset         DWORDLONG
  52013 	FOutputBufferOffset         DWORD
  52014 	FBytesWithinFileSize        DWORD
  52015 	FBytesWithinValidDataLength DWORD
  52016 	FCompressionFormat          WORD
  52017 	FDataUnitShift              BYTE
  52018 	FChunkShift                 BYTE
  52019 	FClusterShift               BYTE
  52020 	FEncryptionFormat           BYTE
  52021 	FNumberOfDataBlocks         WORD
  52022 	FDataBlockSize              [1]DWORD
  52023 }
  52024 
  52025 type ENCRYPTED_DATA_INFO = _ENCRYPTED_DATA_INFO
  52026 type PENCRYPTED_DATA_INFO = uintptr
  52027 
  52028 type _PLEX_READ_DATA_REQUEST = struct {
  52029 	FByteOffset LARGE_INTEGER
  52030 	FByteLength DWORD
  52031 	FPlexNumber DWORD
  52032 }
  52033 
  52034 type PLEX_READ_DATA_REQUEST = _PLEX_READ_DATA_REQUEST
  52035 type PPLEX_READ_DATA_REQUEST = uintptr
  52036 
  52037 type _SI_COPYFILE = struct {
  52038 	FSourceFileNameLength      DWORD
  52039 	FDestinationFileNameLength DWORD
  52040 	FFlags                     DWORD
  52041 	FFileNameBuffer            [1]WCHAR
  52042 	F__ccgo_pad1               [2]byte
  52043 }
  52044 
  52045 type SI_COPYFILE = _SI_COPYFILE
  52046 type PSI_COPYFILE = uintptr
  52047 
  52048 type _STORAGE_DESCRIPTOR_HEADER = struct {
  52049 	FVersion DWORD
  52050 	FSize    DWORD
  52051 }
  52052 
  52053 type STORAGE_DESCRIPTOR_HEADER = _STORAGE_DESCRIPTOR_HEADER
  52054 type PSTORAGE_DESCRIPTOR_HEADER = uintptr
  52055 
  52056 type STORAGE_PROPERTY_ID = uint32
  52057 type PSTORAGE_PROPERTY_ID = uintptr
  52058 
  52059 type STORAGE_QUERY_TYPE = uint32
  52060 type PSTORAGE_QUERY_TYPE = uintptr
  52061 
  52062 type _STORAGE_PROPERTY_QUERY = struct {
  52063 	FPropertyId           STORAGE_PROPERTY_ID
  52064 	FQueryType            STORAGE_QUERY_TYPE
  52065 	FAdditionalParameters [1]BYTE
  52066 	F__ccgo_pad1          [3]byte
  52067 }
  52068 
  52069 type STORAGE_PROPERTY_QUERY = _STORAGE_PROPERTY_QUERY
  52070 type PSTORAGE_PROPERTY_QUERY = uintptr
  52071 
  52072 type _STORAGE_DEVICE_DESCRIPTOR = struct {
  52073 	FVersion               DWORD
  52074 	FSize                  DWORD
  52075 	FDeviceType            BYTE
  52076 	FDeviceTypeModifier    BYTE
  52077 	FRemovableMedia        BOOLEAN
  52078 	FCommandQueueing       BOOLEAN
  52079 	FVendorIdOffset        DWORD
  52080 	FProductIdOffset       DWORD
  52081 	FProductRevisionOffset DWORD
  52082 	FSerialNumberOffset    DWORD
  52083 	FBusType               STORAGE_BUS_TYPE
  52084 	FRawPropertiesLength   DWORD
  52085 	FRawDeviceProperties   [1]BYTE
  52086 	F__ccgo_pad1           [3]byte
  52087 }
  52088 
  52089 type STORAGE_DEVICE_DESCRIPTOR = _STORAGE_DEVICE_DESCRIPTOR
  52090 type PSTORAGE_DEVICE_DESCRIPTOR = uintptr
  52091 
  52092 type _STORAGE_ADAPTER_DESCRIPTOR = struct {
  52093 	FVersion               DWORD
  52094 	FSize                  DWORD
  52095 	FMaximumTransferLength DWORD
  52096 	FMaximumPhysicalPages  DWORD
  52097 	FAlignmentMask         DWORD
  52098 	FAdapterUsesPio        BOOLEAN
  52099 	FAdapterScansDown      BOOLEAN
  52100 	FCommandQueueing       BOOLEAN
  52101 	FAcceleratedTransfer   BOOLEAN
  52102 	FBusType               BYTE
  52103 	F__ccgo_pad1           [1]byte
  52104 	FBusMajorVersion       WORD
  52105 	FBusMinorVersion       WORD
  52106 	F__ccgo_pad2           [2]byte
  52107 }
  52108 
  52109 type STORAGE_ADAPTER_DESCRIPTOR = _STORAGE_ADAPTER_DESCRIPTOR
  52110 type PSTORAGE_ADAPTER_DESCRIPTOR = uintptr
  52111 
  52112 type _STORAGE_DEVICE_ID_DESCRIPTOR = struct {
  52113 	FVersion             DWORD
  52114 	FSize                DWORD
  52115 	FNumberOfIdentifiers DWORD
  52116 	FIdentifiers         [1]BYTE
  52117 	F__ccgo_pad1         [3]byte
  52118 }
  52119 
  52120 type STORAGE_DEVICE_ID_DESCRIPTOR = _STORAGE_DEVICE_ID_DESCRIPTOR
  52121 type PSTORAGE_DEVICE_ID_DESCRIPTOR = uintptr
  52122 
  52123 type _VOLUME_GET_GPT_ATTRIBUTES_INFORMATION = struct{ FGptAttributes ULONGLONG }
  52124 
  52125 type VOLUME_GET_GPT_ATTRIBUTES_INFORMATION = _VOLUME_GET_GPT_ATTRIBUTES_INFORMATION
  52126 type PVOLUME_GET_GPT_ATTRIBUTES_INFORMATION = uintptr
  52127 
  52128 type _DISK_EXTENT = struct {
  52129 	FDiskNumber     DWORD
  52130 	F__ccgo_pad1    [4]byte
  52131 	FStartingOffset LARGE_INTEGER
  52132 	FExtentLength   LARGE_INTEGER
  52133 }
  52134 
  52135 type DISK_EXTENT = _DISK_EXTENT
  52136 type PDISK_EXTENT = uintptr
  52137 
  52138 type _VOLUME_DISK_EXTENTS = struct {
  52139 	FNumberOfDiskExtents DWORD
  52140 	F__ccgo_pad1         [4]byte
  52141 	FExtents             [1]DISK_EXTENT
  52142 }
  52143 
  52144 type VOLUME_DISK_EXTENTS = _VOLUME_DISK_EXTENTS
  52145 type PVOLUME_DISK_EXTENTS = uintptr
  52146 
  52147 type UWORD = WORD
  52148 
  52149 type _SCARD_IO_REQUEST = struct {
  52150 	FdwProtocol  DWORD
  52151 	FcbPciLength DWORD
  52152 }
  52153 
  52154 type SCARD_IO_REQUEST = _SCARD_IO_REQUEST
  52155 type PSCARD_IO_REQUEST = uintptr
  52156 type LPSCARD_IO_REQUEST = uintptr
  52157 type LPCSCARD_IO_REQUEST = uintptr
  52158 
  52159 type SCARD_T0_COMMAND = struct {
  52160 	FbCla BYTE
  52161 	FbIns BYTE
  52162 	FbP1  BYTE
  52163 	FbP2  BYTE
  52164 	FbP3  BYTE
  52165 }
  52166 type LPSCARD_T0_COMMAND = uintptr
  52167 
  52168 type SCARD_T0_REQUEST = struct {
  52169 	FioRequest   SCARD_IO_REQUEST
  52170 	FbSw1        BYTE
  52171 	FbSw2        BYTE
  52172 	F__10        struct{ FCmdBytes SCARD_T0_COMMAND }
  52173 	F__ccgo_pad1 [1]byte
  52174 }
  52175 
  52176 type PSCARD_T0_REQUEST = uintptr
  52177 type LPSCARD_T0_REQUEST = uintptr
  52178 
  52179 type SCARD_T1_REQUEST = struct{ FioRequest SCARD_IO_REQUEST }
  52180 type PSCARD_T1_REQUEST = uintptr
  52181 type LPSCARD_T1_REQUEST = uintptr
  52182 
  52183 type LPCBYTE = uintptr
  52184 
  52185 var Xg_rgSCardT0Pci SCARD_IO_REQUEST
  52186 var Xg_rgSCardT1Pci SCARD_IO_REQUEST
  52187 var Xg_rgSCardRawPci SCARD_IO_REQUEST
  52188 
  52189 type SCARDCONTEXT = ULONG_PTR
  52190 type PSCARDCONTEXT = uintptr
  52191 type LPSCARDCONTEXT = uintptr
  52192 
  52193 type SCARDHANDLE = ULONG_PTR
  52194 type PSCARDHANDLE = uintptr
  52195 type LPSCARDHANDLE = uintptr
  52196 
  52197 type SCARD_READERSTATEA = struct {
  52198 	FszReader       LPCSTR
  52199 	FpvUserData     LPVOID
  52200 	FdwCurrentState DWORD
  52201 	FdwEventState   DWORD
  52202 	FcbAtr          DWORD
  52203 	FrgbAtr         [36]BYTE
  52204 }
  52205 type PSCARD_READERSTATEA = uintptr
  52206 type LPSCARD_READERSTATEA = uintptr
  52207 
  52208 type SCARD_READERSTATEW = struct {
  52209 	FszReader       LPCWSTR
  52210 	FpvUserData     LPVOID
  52211 	FdwCurrentState DWORD
  52212 	FdwEventState   DWORD
  52213 	FcbAtr          DWORD
  52214 	FrgbAtr         [36]BYTE
  52215 }
  52216 type PSCARD_READERSTATEW = uintptr
  52217 type LPSCARD_READERSTATEW = uintptr
  52218 
  52219 type SCARD_READERSTATE = SCARD_READERSTATEA
  52220 type PSCARD_READERSTATE = PSCARD_READERSTATEA
  52221 type LPSCARD_READERSTATE = LPSCARD_READERSTATEA
  52222 
  52223 type _SCARD_ATRMASK = struct {
  52224 	FcbAtr   DWORD
  52225 	FrgbAtr  [36]BYTE
  52226 	FrgbMask [36]BYTE
  52227 }
  52228 
  52229 type SCARD_ATRMASK = _SCARD_ATRMASK
  52230 type PSCARD_ATRMASK = uintptr
  52231 type LPSCARD_ATRMASK = uintptr
  52232 
  52233 type LPOCNCONNPROCA = uintptr
  52234 type LPOCNCONNPROCW = uintptr
  52235 type LPOCNCHKPROC = uintptr
  52236 type LPOCNDSCPROC = uintptr
  52237 
  52238 type OPENCARD_SEARCH_CRITERIAA = struct {
  52239 	FdwStructSize         DWORD
  52240 	F__ccgo_pad1          [4]byte
  52241 	FlpstrGroupNames      LPSTR
  52242 	FnMaxGroupNames       DWORD
  52243 	F__ccgo_pad2          [4]byte
  52244 	FrgguidInterfaces     LPCGUID
  52245 	FcguidInterfaces      DWORD
  52246 	F__ccgo_pad3          [4]byte
  52247 	FlpstrCardNames       LPSTR
  52248 	FnMaxCardNames        DWORD
  52249 	F__ccgo_pad4          [4]byte
  52250 	FlpfnCheck            LPOCNCHKPROC
  52251 	FlpfnConnect          LPOCNCONNPROCA
  52252 	FlpfnDisconnect       LPOCNDSCPROC
  52253 	FpvUserData           LPVOID
  52254 	FdwShareMode          DWORD
  52255 	FdwPreferredProtocols DWORD
  52256 }
  52257 type POPENCARD_SEARCH_CRITERIAA = uintptr
  52258 type LPOPENCARD_SEARCH_CRITERIAA = uintptr
  52259 
  52260 type OPENCARD_SEARCH_CRITERIAW = struct {
  52261 	FdwStructSize         DWORD
  52262 	F__ccgo_pad1          [4]byte
  52263 	FlpstrGroupNames      LPWSTR
  52264 	FnMaxGroupNames       DWORD
  52265 	F__ccgo_pad2          [4]byte
  52266 	FrgguidInterfaces     LPCGUID
  52267 	FcguidInterfaces      DWORD
  52268 	F__ccgo_pad3          [4]byte
  52269 	FlpstrCardNames       LPWSTR
  52270 	FnMaxCardNames        DWORD
  52271 	F__ccgo_pad4          [4]byte
  52272 	FlpfnCheck            LPOCNCHKPROC
  52273 	FlpfnConnect          LPOCNCONNPROCW
  52274 	FlpfnDisconnect       LPOCNDSCPROC
  52275 	FpvUserData           LPVOID
  52276 	FdwShareMode          DWORD
  52277 	FdwPreferredProtocols DWORD
  52278 }
  52279 type POPENCARD_SEARCH_CRITERIAW = uintptr
  52280 type LPOPENCARD_SEARCH_CRITERIAW = uintptr
  52281 
  52282 type OPENCARD_SEARCH_CRITERIA = OPENCARD_SEARCH_CRITERIAA
  52283 type POPENCARD_SEARCH_CRITERIA = POPENCARD_SEARCH_CRITERIAA
  52284 type LPOPENCARD_SEARCH_CRITERIA = LPOPENCARD_SEARCH_CRITERIAA
  52285 
  52286 type OPENCARDNAME_EXA = struct {
  52287 	FdwStructSize            DWORD
  52288 	F__ccgo_pad1             [4]byte
  52289 	FhSCardContext           SCARDCONTEXT
  52290 	FhwndOwner               HWND
  52291 	FdwFlags                 DWORD
  52292 	F__ccgo_pad2             [4]byte
  52293 	FlpstrTitle              LPCSTR
  52294 	FlpstrSearchDesc         LPCSTR
  52295 	FhIcon                   HICON
  52296 	FpOpenCardSearchCriteria POPENCARD_SEARCH_CRITERIAA
  52297 	FlpfnConnect             LPOCNCONNPROCA
  52298 	FpvUserData              LPVOID
  52299 	FdwShareMode             DWORD
  52300 	FdwPreferredProtocols    DWORD
  52301 	FlpstrRdr                LPSTR
  52302 	FnMaxRdr                 DWORD
  52303 	F__ccgo_pad3             [4]byte
  52304 	FlpstrCard               LPSTR
  52305 	FnMaxCard                DWORD
  52306 	FdwActiveProtocol        DWORD
  52307 	FhCardHandle             SCARDHANDLE
  52308 }
  52309 type POPENCARDNAME_EXA = uintptr
  52310 type LPOPENCARDNAME_EXA = uintptr
  52311 
  52312 type OPENCARDNAME_EXW = struct {
  52313 	FdwStructSize            DWORD
  52314 	F__ccgo_pad1             [4]byte
  52315 	FhSCardContext           SCARDCONTEXT
  52316 	FhwndOwner               HWND
  52317 	FdwFlags                 DWORD
  52318 	F__ccgo_pad2             [4]byte
  52319 	FlpstrTitle              LPCWSTR
  52320 	FlpstrSearchDesc         LPCWSTR
  52321 	FhIcon                   HICON
  52322 	FpOpenCardSearchCriteria POPENCARD_SEARCH_CRITERIAW
  52323 	FlpfnConnect             LPOCNCONNPROCW
  52324 	FpvUserData              LPVOID
  52325 	FdwShareMode             DWORD
  52326 	FdwPreferredProtocols    DWORD
  52327 	FlpstrRdr                LPWSTR
  52328 	FnMaxRdr                 DWORD
  52329 	F__ccgo_pad3             [4]byte
  52330 	FlpstrCard               LPWSTR
  52331 	FnMaxCard                DWORD
  52332 	FdwActiveProtocol        DWORD
  52333 	FhCardHandle             SCARDHANDLE
  52334 }
  52335 type POPENCARDNAME_EXW = uintptr
  52336 type LPOPENCARDNAME_EXW = uintptr
  52337 
  52338 type OPENCARDNAME_EX = OPENCARDNAME_EXA
  52339 type POPENCARDNAME_EX = POPENCARDNAME_EXA
  52340 type LPOPENCARDNAME_EX = LPOPENCARDNAME_EXA
  52341 
  52342 type OPENCARDNAMEA = struct {
  52343 	FdwStructSize         DWORD
  52344 	F__ccgo_pad1          [4]byte
  52345 	FhwndOwner            HWND
  52346 	FhSCardContext        SCARDCONTEXT
  52347 	FlpstrGroupNames      LPSTR
  52348 	FnMaxGroupNames       DWORD
  52349 	F__ccgo_pad2          [4]byte
  52350 	FlpstrCardNames       LPSTR
  52351 	FnMaxCardNames        DWORD
  52352 	F__ccgo_pad3          [4]byte
  52353 	FrgguidInterfaces     LPCGUID
  52354 	FcguidInterfaces      DWORD
  52355 	F__ccgo_pad4          [4]byte
  52356 	FlpstrRdr             LPSTR
  52357 	FnMaxRdr              DWORD
  52358 	F__ccgo_pad5          [4]byte
  52359 	FlpstrCard            LPSTR
  52360 	FnMaxCard             DWORD
  52361 	F__ccgo_pad6          [4]byte
  52362 	FlpstrTitle           LPCSTR
  52363 	FdwFlags              DWORD
  52364 	F__ccgo_pad7          [4]byte
  52365 	FpvUserData           LPVOID
  52366 	FdwShareMode          DWORD
  52367 	FdwPreferredProtocols DWORD
  52368 	FdwActiveProtocol     DWORD
  52369 	F__ccgo_pad8          [4]byte
  52370 	FlpfnConnect          LPOCNCONNPROCA
  52371 	FlpfnCheck            LPOCNCHKPROC
  52372 	FlpfnDisconnect       LPOCNDSCPROC
  52373 	FhCardHandle          SCARDHANDLE
  52374 }
  52375 type POPENCARDNAMEA = uintptr
  52376 type LPOPENCARDNAMEA = uintptr
  52377 
  52378 type OPENCARDNAMEW = struct {
  52379 	FdwStructSize         DWORD
  52380 	F__ccgo_pad1          [4]byte
  52381 	FhwndOwner            HWND
  52382 	FhSCardContext        SCARDCONTEXT
  52383 	FlpstrGroupNames      LPWSTR
  52384 	FnMaxGroupNames       DWORD
  52385 	F__ccgo_pad2          [4]byte
  52386 	FlpstrCardNames       LPWSTR
  52387 	FnMaxCardNames        DWORD
  52388 	F__ccgo_pad3          [4]byte
  52389 	FrgguidInterfaces     LPCGUID
  52390 	FcguidInterfaces      DWORD
  52391 	F__ccgo_pad4          [4]byte
  52392 	FlpstrRdr             LPWSTR
  52393 	FnMaxRdr              DWORD
  52394 	F__ccgo_pad5          [4]byte
  52395 	FlpstrCard            LPWSTR
  52396 	FnMaxCard             DWORD
  52397 	F__ccgo_pad6          [4]byte
  52398 	FlpstrTitle           LPCWSTR
  52399 	FdwFlags              DWORD
  52400 	F__ccgo_pad7          [4]byte
  52401 	FpvUserData           LPVOID
  52402 	FdwShareMode          DWORD
  52403 	FdwPreferredProtocols DWORD
  52404 	FdwActiveProtocol     DWORD
  52405 	F__ccgo_pad8          [4]byte
  52406 	FlpfnConnect          LPOCNCONNPROCW
  52407 	FlpfnCheck            LPOCNCHKPROC
  52408 	FlpfnDisconnect       LPOCNDSCPROC
  52409 	FhCardHandle          SCARDHANDLE
  52410 }
  52411 type POPENCARDNAMEW = uintptr
  52412 type LPOPENCARDNAMEW = uintptr
  52413 
  52414 type OPENCARDNAME = OPENCARDNAMEA
  52415 type POPENCARDNAME = POPENCARDNAMEA
  52416 type LPOPENCARDNAME = LPOPENCARDNAMEA
  52417 type _PROPSHEETPAGEA = struct {
  52418 	FdwSize            DWORD
  52419 	FdwFlags           DWORD
  52420 	FhInstance         HINSTANCE
  52421 	Fu                 struct{ FpszTemplate LPCSTR }
  52422 	Fu2                struct{ FhIcon HICON }
  52423 	FpszTitle          LPCSTR
  52424 	FpfnDlgProc        DLGPROC
  52425 	FlParam            LPARAM
  52426 	FpfnCallback       LPFNPSPCALLBACKA
  52427 	FpcRefParent       uintptr
  52428 	FpszHeaderTitle    LPCSTR
  52429 	FpszHeaderSubTitle LPCSTR
  52430 	FhActCtx           HANDLE
  52431 }
  52432 
  52433 type _PROPSHEETPAGEW = struct {
  52434 	FdwSize            DWORD
  52435 	FdwFlags           DWORD
  52436 	FhInstance         HINSTANCE
  52437 	Fu                 struct{ FpszTemplate LPCWSTR }
  52438 	Fu2                struct{ FhIcon HICON }
  52439 	FpszTitle          LPCWSTR
  52440 	FpfnDlgProc        DLGPROC
  52441 	FlParam            LPARAM
  52442 	FpfnCallback       LPFNPSPCALLBACKW
  52443 	FpcRefParent       uintptr
  52444 	FpszHeaderTitle    LPCWSTR
  52445 	FpszHeaderSubTitle LPCWSTR
  52446 	FhActCtx           HANDLE
  52447 }
  52448 
  52449 type HPROPSHEETPAGE = uintptr
  52450 type LPFNPSPCALLBACKA = uintptr
  52451 type LPFNPSPCALLBACKW = uintptr
  52452 
  52453 type PROPSHEETPAGE_RESOURCE = LPCDLGTEMPLATE
  52454 
  52455 type _PROPSHEETPAGEA_V1 = struct {
  52456 	FdwSize      DWORD
  52457 	FdwFlags     DWORD
  52458 	FhInstance   HINSTANCE
  52459 	Fu           struct{ FpszTemplate LPCSTR }
  52460 	Fu2          struct{ FhIcon HICON }
  52461 	FpszTitle    LPCSTR
  52462 	FpfnDlgProc  DLGPROC
  52463 	FlParam      LPARAM
  52464 	FpfnCallback LPFNPSPCALLBACKA
  52465 	FpcRefParent uintptr
  52466 }
  52467 
  52468 type PROPSHEETPAGEA_V1 = _PROPSHEETPAGEA_V1
  52469 type LPPROPSHEETPAGEA_V1 = uintptr
  52470 
  52471 type LPCPROPSHEETPAGEA_V1 = uintptr
  52472 
  52473 type _PROPSHEETPAGEA_V2 = struct {
  52474 	FdwSize            DWORD
  52475 	FdwFlags           DWORD
  52476 	FhInstance         HINSTANCE
  52477 	Fu                 struct{ FpszTemplate LPCSTR }
  52478 	Fu2                struct{ FhIcon HICON }
  52479 	FpszTitle          LPCSTR
  52480 	FpfnDlgProc        DLGPROC
  52481 	FlParam            LPARAM
  52482 	FpfnCallback       LPFNPSPCALLBACKA
  52483 	FpcRefParent       uintptr
  52484 	FpszHeaderTitle    LPCSTR
  52485 	FpszHeaderSubTitle LPCSTR
  52486 }
  52487 
  52488 type PROPSHEETPAGEA_V2 = _PROPSHEETPAGEA_V2
  52489 type LPPROPSHEETPAGEA_V2 = uintptr
  52490 
  52491 type LPCPROPSHEETPAGEA_V2 = uintptr
  52492 
  52493 type PROPSHEETPAGEA_V3 = _PROPSHEETPAGEA
  52494 type LPPROPSHEETPAGEA_V3 = uintptr
  52495 
  52496 type LPCPROPSHEETPAGEA_V3 = uintptr
  52497 
  52498 type _PROPSHEETPAGEW_V1 = struct {
  52499 	FdwSize      DWORD
  52500 	FdwFlags     DWORD
  52501 	FhInstance   HINSTANCE
  52502 	Fu           struct{ FpszTemplate LPCWSTR }
  52503 	Fu2          struct{ FhIcon HICON }
  52504 	FpszTitle    LPCWSTR
  52505 	FpfnDlgProc  DLGPROC
  52506 	FlParam      LPARAM
  52507 	FpfnCallback LPFNPSPCALLBACKW
  52508 	FpcRefParent uintptr
  52509 }
  52510 
  52511 type PROPSHEETPAGEW_V1 = _PROPSHEETPAGEW_V1
  52512 type LPPROPSHEETPAGEW_V1 = uintptr
  52513 
  52514 type LPCPROPSHEETPAGEW_V1 = uintptr
  52515 
  52516 type _PROPSHEETPAGEW_V2 = struct {
  52517 	FdwSize            DWORD
  52518 	FdwFlags           DWORD
  52519 	FhInstance         HINSTANCE
  52520 	Fu                 struct{ FpszTemplate LPCWSTR }
  52521 	Fu2                struct{ FhIcon HICON }
  52522 	FpszTitle          LPCWSTR
  52523 	FpfnDlgProc        DLGPROC
  52524 	FlParam            LPARAM
  52525 	FpfnCallback       LPFNPSPCALLBACKW
  52526 	FpcRefParent       uintptr
  52527 	FpszHeaderTitle    LPCWSTR
  52528 	FpszHeaderSubTitle LPCWSTR
  52529 }
  52530 
  52531 type PROPSHEETPAGEW_V2 = _PROPSHEETPAGEW_V2
  52532 type LPPROPSHEETPAGEW_V2 = uintptr
  52533 
  52534 type LPCPROPSHEETPAGEW_V2 = uintptr
  52535 
  52536 type PROPSHEETPAGEW_V3 = _PROPSHEETPAGEW
  52537 type LPPROPSHEETPAGEW_V3 = uintptr
  52538 
  52539 type LPCPROPSHEETPAGEW_V3 = uintptr
  52540 type PROPSHEETPAGEA_LATEST = PROPSHEETPAGEA_V3
  52541 type PROPSHEETPAGEW_LATEST = PROPSHEETPAGEW_V3
  52542 type LPPROPSHEETPAGEA_LATEST = LPPROPSHEETPAGEA_V3
  52543 type LPPROPSHEETPAGEW_LATEST = LPPROPSHEETPAGEW_V3
  52544 type LPCPROPSHEETPAGEA_LATEST = LPCPROPSHEETPAGEA_V3
  52545 type LPCPROPSHEETPAGEW_LATEST = LPCPROPSHEETPAGEW_V3
  52546 
  52547 type PROPSHEETPAGEA = PROPSHEETPAGEA_V3
  52548 type PROPSHEETPAGEW = PROPSHEETPAGEW_V3
  52549 type LPPROPSHEETPAGEA = LPPROPSHEETPAGEA_V3
  52550 type LPPROPSHEETPAGEW = LPPROPSHEETPAGEW_V3
  52551 type LPCPROPSHEETPAGEA = LPCPROPSHEETPAGEA_V3
  52552 type LPCPROPSHEETPAGEW = LPCPROPSHEETPAGEW_V3
  52553 
  52554 type PFNPROPSHEETCALLBACK = uintptr
  52555 
  52556 type _PROPSHEETHEADERA = struct {
  52557 	FdwSize      DWORD
  52558 	FdwFlags     DWORD
  52559 	FhwndParent  HWND
  52560 	FhInstance   HINSTANCE
  52561 	Fu           struct{ FhIcon HICON }
  52562 	FpszCaption  LPCSTR
  52563 	FnPages      UINT
  52564 	F__ccgo_pad1 [4]byte
  52565 	Fu2          struct {
  52566 		F__ccgo_pad1 [0]uint64
  52567 		FnStartPage  UINT
  52568 		F__ccgo_pad2 [4]byte
  52569 	}
  52570 	Fu3           struct{ Fppsp LPCPROPSHEETPAGEA }
  52571 	FpfnCallback  PFNPROPSHEETCALLBACK
  52572 	Fu4           struct{ FhbmWatermark HBITMAP }
  52573 	FhplWatermark HPALETTE
  52574 	Fu5           struct{ FhbmHeader HBITMAP }
  52575 }
  52576 
  52577 type PROPSHEETHEADERA = _PROPSHEETHEADERA
  52578 type LPPROPSHEETHEADERA = uintptr
  52579 
  52580 type LPCPROPSHEETHEADERA = uintptr
  52581 
  52582 type _PROPSHEETHEADERW = struct {
  52583 	FdwSize      DWORD
  52584 	FdwFlags     DWORD
  52585 	FhwndParent  HWND
  52586 	FhInstance   HINSTANCE
  52587 	Fu           struct{ FhIcon HICON }
  52588 	FpszCaption  LPCWSTR
  52589 	FnPages      UINT
  52590 	F__ccgo_pad1 [4]byte
  52591 	Fu2          struct {
  52592 		F__ccgo_pad1 [0]uint64
  52593 		FnStartPage  UINT
  52594 		F__ccgo_pad2 [4]byte
  52595 	}
  52596 	Fu3           struct{ Fppsp LPCPROPSHEETPAGEW }
  52597 	FpfnCallback  PFNPROPSHEETCALLBACK
  52598 	Fu4           struct{ FhbmWatermark HBITMAP }
  52599 	FhplWatermark HPALETTE
  52600 	Fu5           struct{ FhbmHeader HBITMAP }
  52601 }
  52602 
  52603 type PROPSHEETHEADERW = _PROPSHEETHEADERW
  52604 type LPPROPSHEETHEADERW = uintptr
  52605 
  52606 type LPCPROPSHEETHEADERW = uintptr
  52607 
  52608 type LPFNADDPROPSHEETPAGE = uintptr
  52609 type LPFNADDPROPSHEETPAGES = uintptr
  52610 
  52611 type _PSHNOTIFY = struct {
  52612 	Fhdr    NMHDR
  52613 	FlParam LPARAM
  52614 }
  52615 
  52616 type PSHNOTIFY = _PSHNOTIFY
  52617 type LPPSHNOTIFY = uintptr
  52618 
  52619 type _PRINTER_INFO_1A = struct {
  52620 	FFlags        DWORD
  52621 	F__ccgo_pad1  [4]byte
  52622 	FpDescription LPSTR
  52623 	FpName        LPSTR
  52624 	FpComment     LPSTR
  52625 }
  52626 
  52627 type PRINTER_INFO_1A = _PRINTER_INFO_1A
  52628 type PPRINTER_INFO_1A = uintptr
  52629 type LPPRINTER_INFO_1A = uintptr
  52630 
  52631 type _PRINTER_INFO_1W = struct {
  52632 	FFlags        DWORD
  52633 	F__ccgo_pad1  [4]byte
  52634 	FpDescription LPWSTR
  52635 	FpName        LPWSTR
  52636 	FpComment     LPWSTR
  52637 }
  52638 
  52639 type PRINTER_INFO_1W = _PRINTER_INFO_1W
  52640 type PPRINTER_INFO_1W = uintptr
  52641 type LPPRINTER_INFO_1W = uintptr
  52642 
  52643 type PRINTER_INFO_1 = PRINTER_INFO_1A
  52644 type PPRINTER_INFO_1 = PPRINTER_INFO_1A
  52645 type LPPRINTER_INFO_1 = LPPRINTER_INFO_1A
  52646 
  52647 type _PRINTER_INFO_2A = struct {
  52648 	FpServerName         LPSTR
  52649 	FpPrinterName        LPSTR
  52650 	FpShareName          LPSTR
  52651 	FpPortName           LPSTR
  52652 	FpDriverName         LPSTR
  52653 	FpComment            LPSTR
  52654 	FpLocation           LPSTR
  52655 	FpDevMode            LPDEVMODEA
  52656 	FpSepFile            LPSTR
  52657 	FpPrintProcessor     LPSTR
  52658 	FpDatatype           LPSTR
  52659 	FpParameters         LPSTR
  52660 	FpSecurityDescriptor PSECURITY_DESCRIPTOR
  52661 	FAttributes          DWORD
  52662 	FPriority            DWORD
  52663 	FDefaultPriority     DWORD
  52664 	FStartTime           DWORD
  52665 	FUntilTime           DWORD
  52666 	FStatus              DWORD
  52667 	FcJobs               DWORD
  52668 	FAveragePPM          DWORD
  52669 }
  52670 
  52671 type PRINTER_INFO_2A = _PRINTER_INFO_2A
  52672 type PPRINTER_INFO_2A = uintptr
  52673 type LPPRINTER_INFO_2A = uintptr
  52674 
  52675 type _PRINTER_INFO_2W = struct {
  52676 	FpServerName         LPWSTR
  52677 	FpPrinterName        LPWSTR
  52678 	FpShareName          LPWSTR
  52679 	FpPortName           LPWSTR
  52680 	FpDriverName         LPWSTR
  52681 	FpComment            LPWSTR
  52682 	FpLocation           LPWSTR
  52683 	FpDevMode            LPDEVMODEW
  52684 	FpSepFile            LPWSTR
  52685 	FpPrintProcessor     LPWSTR
  52686 	FpDatatype           LPWSTR
  52687 	FpParameters         LPWSTR
  52688 	FpSecurityDescriptor PSECURITY_DESCRIPTOR
  52689 	FAttributes          DWORD
  52690 	FPriority            DWORD
  52691 	FDefaultPriority     DWORD
  52692 	FStartTime           DWORD
  52693 	FUntilTime           DWORD
  52694 	FStatus              DWORD
  52695 	FcJobs               DWORD
  52696 	FAveragePPM          DWORD
  52697 }
  52698 
  52699 type PRINTER_INFO_2W = _PRINTER_INFO_2W
  52700 type PPRINTER_INFO_2W = uintptr
  52701 type LPPRINTER_INFO_2W = uintptr
  52702 
  52703 type PRINTER_INFO_2 = PRINTER_INFO_2A
  52704 type PPRINTER_INFO_2 = PPRINTER_INFO_2A
  52705 type LPPRINTER_INFO_2 = LPPRINTER_INFO_2A
  52706 
  52707 type _PRINTER_INFO_3 = struct{ FpSecurityDescriptor PSECURITY_DESCRIPTOR }
  52708 
  52709 type PRINTER_INFO_3 = _PRINTER_INFO_3
  52710 type PPRINTER_INFO_3 = uintptr
  52711 type LPPRINTER_INFO_3 = uintptr
  52712 
  52713 type _PRINTER_INFO_4A = struct {
  52714 	FpPrinterName LPSTR
  52715 	FpServerName  LPSTR
  52716 	FAttributes   DWORD
  52717 	F__ccgo_pad1  [4]byte
  52718 }
  52719 
  52720 type PRINTER_INFO_4A = _PRINTER_INFO_4A
  52721 type PPRINTER_INFO_4A = uintptr
  52722 type LPPRINTER_INFO_4A = uintptr
  52723 
  52724 type _PRINTER_INFO_4W = struct {
  52725 	FpPrinterName LPWSTR
  52726 	FpServerName  LPWSTR
  52727 	FAttributes   DWORD
  52728 	F__ccgo_pad1  [4]byte
  52729 }
  52730 
  52731 type PRINTER_INFO_4W = _PRINTER_INFO_4W
  52732 type PPRINTER_INFO_4W = uintptr
  52733 type LPPRINTER_INFO_4W = uintptr
  52734 
  52735 type PRINTER_INFO_4 = PRINTER_INFO_4A
  52736 type PPRINTER_INFO_4 = PPRINTER_INFO_4A
  52737 type LPPRINTER_INFO_4 = LPPRINTER_INFO_4A
  52738 
  52739 type _PRINTER_INFO_5A = struct {
  52740 	FpPrinterName             LPSTR
  52741 	FpPortName                LPSTR
  52742 	FAttributes               DWORD
  52743 	FDeviceNotSelectedTimeout DWORD
  52744 	FTransmissionRetryTimeout DWORD
  52745 	F__ccgo_pad1              [4]byte
  52746 }
  52747 
  52748 type PRINTER_INFO_5A = _PRINTER_INFO_5A
  52749 type PPRINTER_INFO_5A = uintptr
  52750 type LPPRINTER_INFO_5A = uintptr
  52751 
  52752 type _PRINTER_INFO_5W = struct {
  52753 	FpPrinterName             LPWSTR
  52754 	FpPortName                LPWSTR
  52755 	FAttributes               DWORD
  52756 	FDeviceNotSelectedTimeout DWORD
  52757 	FTransmissionRetryTimeout DWORD
  52758 	F__ccgo_pad1              [4]byte
  52759 }
  52760 
  52761 type PRINTER_INFO_5W = _PRINTER_INFO_5W
  52762 type PPRINTER_INFO_5W = uintptr
  52763 type LPPRINTER_INFO_5W = uintptr
  52764 
  52765 type PRINTER_INFO_5 = PRINTER_INFO_5A
  52766 type PPRINTER_INFO_5 = PPRINTER_INFO_5A
  52767 type LPPRINTER_INFO_5 = LPPRINTER_INFO_5A
  52768 
  52769 type _PRINTER_INFO_6 = struct{ FdwStatus DWORD }
  52770 
  52771 type PRINTER_INFO_6 = _PRINTER_INFO_6
  52772 type PPRINTER_INFO_6 = uintptr
  52773 type LPPRINTER_INFO_6 = uintptr
  52774 
  52775 type _PRINTER_INFO_7A = struct {
  52776 	FpszObjectGUID LPSTR
  52777 	FdwAction      DWORD
  52778 	F__ccgo_pad1   [4]byte
  52779 }
  52780 
  52781 type PRINTER_INFO_7A = _PRINTER_INFO_7A
  52782 type PPRINTER_INFO_7A = uintptr
  52783 type LPPRINTER_INFO_7A = uintptr
  52784 
  52785 type _PRINTER_INFO_7W = struct {
  52786 	FpszObjectGUID LPWSTR
  52787 	FdwAction      DWORD
  52788 	F__ccgo_pad1   [4]byte
  52789 }
  52790 
  52791 type PRINTER_INFO_7W = _PRINTER_INFO_7W
  52792 type PPRINTER_INFO_7W = uintptr
  52793 type LPPRINTER_INFO_7W = uintptr
  52794 
  52795 type PRINTER_INFO_7 = PRINTER_INFO_7A
  52796 type PPRINTER_INFO_7 = PPRINTER_INFO_7A
  52797 type LPPRINTER_INFO_7 = LPPRINTER_INFO_7A
  52798 
  52799 type _PRINTER_INFO_8A = struct{ FpDevMode LPDEVMODEA }
  52800 
  52801 type PRINTER_INFO_8A = _PRINTER_INFO_8A
  52802 type PPRINTER_INFO_8A = uintptr
  52803 type LPPRINTER_INFO_8A = uintptr
  52804 
  52805 type _PRINTER_INFO_8W = struct{ FpDevMode LPDEVMODEW }
  52806 
  52807 type PRINTER_INFO_8W = _PRINTER_INFO_8W
  52808 type PPRINTER_INFO_8W = uintptr
  52809 type LPPRINTER_INFO_8W = uintptr
  52810 
  52811 type PRINTER_INFO_8 = PRINTER_INFO_8A
  52812 type PPRINTER_INFO_8 = PPRINTER_INFO_8A
  52813 type LPPRINTER_INFO_8 = LPPRINTER_INFO_8A
  52814 
  52815 type _PRINTER_INFO_9A = struct{ FpDevMode LPDEVMODEA }
  52816 
  52817 type PRINTER_INFO_9A = _PRINTER_INFO_9A
  52818 type PPRINTER_INFO_9A = uintptr
  52819 type LPPRINTER_INFO_9A = uintptr
  52820 
  52821 type _PRINTER_INFO_9W = struct{ FpDevMode LPDEVMODEW }
  52822 
  52823 type PRINTER_INFO_9W = _PRINTER_INFO_9W
  52824 type PPRINTER_INFO_9W = uintptr
  52825 type LPPRINTER_INFO_9W = uintptr
  52826 
  52827 type PRINTER_INFO_9 = PRINTER_INFO_9A
  52828 type PPRINTER_INFO_9 = PPRINTER_INFO_9A
  52829 type LPPRINTER_INFO_9 = LPPRINTER_INFO_9A
  52830 
  52831 type _JOB_INFO_1A = struct {
  52832 	FJobId        DWORD
  52833 	F__ccgo_pad1  [4]byte
  52834 	FpPrinterName LPSTR
  52835 	FpMachineName LPSTR
  52836 	FpUserName    LPSTR
  52837 	FpDocument    LPSTR
  52838 	FpDatatype    LPSTR
  52839 	FpStatus      LPSTR
  52840 	FStatus       DWORD
  52841 	FPriority     DWORD
  52842 	FPosition     DWORD
  52843 	FTotalPages   DWORD
  52844 	FPagesPrinted DWORD
  52845 	FSubmitted    SYSTEMTIME
  52846 	F__ccgo_pad2  [4]byte
  52847 }
  52848 
  52849 type JOB_INFO_1A = _JOB_INFO_1A
  52850 type PJOB_INFO_1A = uintptr
  52851 type LPJOB_INFO_1A = uintptr
  52852 
  52853 type _JOB_INFO_1W = struct {
  52854 	FJobId        DWORD
  52855 	F__ccgo_pad1  [4]byte
  52856 	FpPrinterName LPWSTR
  52857 	FpMachineName LPWSTR
  52858 	FpUserName    LPWSTR
  52859 	FpDocument    LPWSTR
  52860 	FpDatatype    LPWSTR
  52861 	FpStatus      LPWSTR
  52862 	FStatus       DWORD
  52863 	FPriority     DWORD
  52864 	FPosition     DWORD
  52865 	FTotalPages   DWORD
  52866 	FPagesPrinted DWORD
  52867 	FSubmitted    SYSTEMTIME
  52868 	F__ccgo_pad2  [4]byte
  52869 }
  52870 
  52871 type JOB_INFO_1W = _JOB_INFO_1W
  52872 type PJOB_INFO_1W = uintptr
  52873 type LPJOB_INFO_1W = uintptr
  52874 
  52875 type JOB_INFO_1 = JOB_INFO_1A
  52876 type PJOB_INFO_1 = PJOB_INFO_1A
  52877 type LPJOB_INFO_1 = LPJOB_INFO_1A
  52878 
  52879 type _JOB_INFO_2A = struct {
  52880 	FJobId               DWORD
  52881 	F__ccgo_pad1         [4]byte
  52882 	FpPrinterName        LPSTR
  52883 	FpMachineName        LPSTR
  52884 	FpUserName           LPSTR
  52885 	FpDocument           LPSTR
  52886 	FpNotifyName         LPSTR
  52887 	FpDatatype           LPSTR
  52888 	FpPrintProcessor     LPSTR
  52889 	FpParameters         LPSTR
  52890 	FpDriverName         LPSTR
  52891 	FpDevMode            LPDEVMODEA
  52892 	FpStatus             LPSTR
  52893 	FpSecurityDescriptor PSECURITY_DESCRIPTOR
  52894 	FStatus              DWORD
  52895 	FPriority            DWORD
  52896 	FPosition            DWORD
  52897 	FStartTime           DWORD
  52898 	FUntilTime           DWORD
  52899 	FTotalPages          DWORD
  52900 	FSize                DWORD
  52901 	FSubmitted           SYSTEMTIME
  52902 	FTime                DWORD
  52903 	FPagesPrinted        DWORD
  52904 	F__ccgo_pad2         [4]byte
  52905 }
  52906 
  52907 type JOB_INFO_2A = _JOB_INFO_2A
  52908 type PJOB_INFO_2A = uintptr
  52909 type LPJOB_INFO_2A = uintptr
  52910 
  52911 type _JOB_INFO_2W = struct {
  52912 	FJobId               DWORD
  52913 	F__ccgo_pad1         [4]byte
  52914 	FpPrinterName        LPWSTR
  52915 	FpMachineName        LPWSTR
  52916 	FpUserName           LPWSTR
  52917 	FpDocument           LPWSTR
  52918 	FpNotifyName         LPWSTR
  52919 	FpDatatype           LPWSTR
  52920 	FpPrintProcessor     LPWSTR
  52921 	FpParameters         LPWSTR
  52922 	FpDriverName         LPWSTR
  52923 	FpDevMode            LPDEVMODEW
  52924 	FpStatus             LPWSTR
  52925 	FpSecurityDescriptor PSECURITY_DESCRIPTOR
  52926 	FStatus              DWORD
  52927 	FPriority            DWORD
  52928 	FPosition            DWORD
  52929 	FStartTime           DWORD
  52930 	FUntilTime           DWORD
  52931 	FTotalPages          DWORD
  52932 	FSize                DWORD
  52933 	FSubmitted           SYSTEMTIME
  52934 	FTime                DWORD
  52935 	FPagesPrinted        DWORD
  52936 	F__ccgo_pad2         [4]byte
  52937 }
  52938 
  52939 type JOB_INFO_2W = _JOB_INFO_2W
  52940 type PJOB_INFO_2W = uintptr
  52941 type LPJOB_INFO_2W = uintptr
  52942 
  52943 type JOB_INFO_2 = JOB_INFO_2A
  52944 type PJOB_INFO_2 = PJOB_INFO_2A
  52945 type LPJOB_INFO_2 = LPJOB_INFO_2A
  52946 
  52947 type _JOB_INFO_3 = struct {
  52948 	FJobId     DWORD
  52949 	FNextJobId DWORD
  52950 	FReserved  DWORD
  52951 }
  52952 
  52953 type JOB_INFO_3 = _JOB_INFO_3
  52954 type PJOB_INFO_3 = uintptr
  52955 type LPJOB_INFO_3 = uintptr
  52956 
  52957 type _ADDJOB_INFO_1A = struct {
  52958 	FPath        LPSTR
  52959 	FJobId       DWORD
  52960 	F__ccgo_pad1 [4]byte
  52961 }
  52962 
  52963 type ADDJOB_INFO_1A = _ADDJOB_INFO_1A
  52964 type PADDJOB_INFO_1A = uintptr
  52965 type LPADDJOB_INFO_1A = uintptr
  52966 
  52967 type _ADDJOB_INFO_1W = struct {
  52968 	FPath        LPWSTR
  52969 	FJobId       DWORD
  52970 	F__ccgo_pad1 [4]byte
  52971 }
  52972 
  52973 type ADDJOB_INFO_1W = _ADDJOB_INFO_1W
  52974 type PADDJOB_INFO_1W = uintptr
  52975 type LPADDJOB_INFO_1W = uintptr
  52976 
  52977 type ADDJOB_INFO_1 = ADDJOB_INFO_1A
  52978 type PADDJOB_INFO_1 = PADDJOB_INFO_1A
  52979 type LPADDJOB_INFO_1 = LPADDJOB_INFO_1A
  52980 
  52981 type _DRIVER_INFO_1A = struct{ FpName LPSTR }
  52982 
  52983 type DRIVER_INFO_1A = _DRIVER_INFO_1A
  52984 type PDRIVER_INFO_1A = uintptr
  52985 type LPDRIVER_INFO_1A = uintptr
  52986 
  52987 type _DRIVER_INFO_1W = struct{ FpName LPWSTR }
  52988 
  52989 type DRIVER_INFO_1W = _DRIVER_INFO_1W
  52990 type PDRIVER_INFO_1W = uintptr
  52991 type LPDRIVER_INFO_1W = uintptr
  52992 
  52993 type DRIVER_INFO_1 = DRIVER_INFO_1A
  52994 type PDRIVER_INFO_1 = PDRIVER_INFO_1A
  52995 type LPDRIVER_INFO_1 = LPDRIVER_INFO_1A
  52996 
  52997 type _DRIVER_INFO_2A = struct {
  52998 	FcVersion     DWORD
  52999 	F__ccgo_pad1  [4]byte
  53000 	FpName        LPSTR
  53001 	FpEnvironment LPSTR
  53002 	FpDriverPath  LPSTR
  53003 	FpDataFile    LPSTR
  53004 	FpConfigFile  LPSTR
  53005 }
  53006 
  53007 type DRIVER_INFO_2A = _DRIVER_INFO_2A
  53008 type PDRIVER_INFO_2A = uintptr
  53009 type LPDRIVER_INFO_2A = uintptr
  53010 
  53011 type _DRIVER_INFO_2W = struct {
  53012 	FcVersion     DWORD
  53013 	F__ccgo_pad1  [4]byte
  53014 	FpName        LPWSTR
  53015 	FpEnvironment LPWSTR
  53016 	FpDriverPath  LPWSTR
  53017 	FpDataFile    LPWSTR
  53018 	FpConfigFile  LPWSTR
  53019 }
  53020 
  53021 type DRIVER_INFO_2W = _DRIVER_INFO_2W
  53022 type PDRIVER_INFO_2W = uintptr
  53023 type LPDRIVER_INFO_2W = uintptr
  53024 
  53025 type DRIVER_INFO_2 = DRIVER_INFO_2A
  53026 type PDRIVER_INFO_2 = PDRIVER_INFO_2A
  53027 type LPDRIVER_INFO_2 = LPDRIVER_INFO_2A
  53028 
  53029 type _DRIVER_INFO_3A = struct {
  53030 	FcVersion         DWORD
  53031 	F__ccgo_pad1      [4]byte
  53032 	FpName            LPSTR
  53033 	FpEnvironment     LPSTR
  53034 	FpDriverPath      LPSTR
  53035 	FpDataFile        LPSTR
  53036 	FpConfigFile      LPSTR
  53037 	FpHelpFile        LPSTR
  53038 	FpDependentFiles  LPSTR
  53039 	FpMonitorName     LPSTR
  53040 	FpDefaultDataType LPSTR
  53041 }
  53042 
  53043 type DRIVER_INFO_3A = _DRIVER_INFO_3A
  53044 type PDRIVER_INFO_3A = uintptr
  53045 type LPDRIVER_INFO_3A = uintptr
  53046 
  53047 type _DRIVER_INFO_3W = struct {
  53048 	FcVersion         DWORD
  53049 	F__ccgo_pad1      [4]byte
  53050 	FpName            LPWSTR
  53051 	FpEnvironment     LPWSTR
  53052 	FpDriverPath      LPWSTR
  53053 	FpDataFile        LPWSTR
  53054 	FpConfigFile      LPWSTR
  53055 	FpHelpFile        LPWSTR
  53056 	FpDependentFiles  LPWSTR
  53057 	FpMonitorName     LPWSTR
  53058 	FpDefaultDataType LPWSTR
  53059 }
  53060 
  53061 type DRIVER_INFO_3W = _DRIVER_INFO_3W
  53062 type PDRIVER_INFO_3W = uintptr
  53063 type LPDRIVER_INFO_3W = uintptr
  53064 
  53065 type DRIVER_INFO_3 = DRIVER_INFO_3A
  53066 type PDRIVER_INFO_3 = PDRIVER_INFO_3A
  53067 type LPDRIVER_INFO_3 = LPDRIVER_INFO_3A
  53068 
  53069 type _DRIVER_INFO_4A = struct {
  53070 	FcVersion          DWORD
  53071 	F__ccgo_pad1       [4]byte
  53072 	FpName             LPSTR
  53073 	FpEnvironment      LPSTR
  53074 	FpDriverPath       LPSTR
  53075 	FpDataFile         LPSTR
  53076 	FpConfigFile       LPSTR
  53077 	FpHelpFile         LPSTR
  53078 	FpDependentFiles   LPSTR
  53079 	FpMonitorName      LPSTR
  53080 	FpDefaultDataType  LPSTR
  53081 	FpszzPreviousNames LPSTR
  53082 }
  53083 
  53084 type DRIVER_INFO_4A = _DRIVER_INFO_4A
  53085 type PDRIVER_INFO_4A = uintptr
  53086 type LPDRIVER_INFO_4A = uintptr
  53087 
  53088 type _DRIVER_INFO_4W = struct {
  53089 	FcVersion          DWORD
  53090 	F__ccgo_pad1       [4]byte
  53091 	FpName             LPWSTR
  53092 	FpEnvironment      LPWSTR
  53093 	FpDriverPath       LPWSTR
  53094 	FpDataFile         LPWSTR
  53095 	FpConfigFile       LPWSTR
  53096 	FpHelpFile         LPWSTR
  53097 	FpDependentFiles   LPWSTR
  53098 	FpMonitorName      LPWSTR
  53099 	FpDefaultDataType  LPWSTR
  53100 	FpszzPreviousNames LPWSTR
  53101 }
  53102 
  53103 type DRIVER_INFO_4W = _DRIVER_INFO_4W
  53104 type PDRIVER_INFO_4W = uintptr
  53105 type LPDRIVER_INFO_4W = uintptr
  53106 
  53107 type DRIVER_INFO_4 = DRIVER_INFO_4A
  53108 type PDRIVER_INFO_4 = PDRIVER_INFO_4A
  53109 type LPDRIVER_INFO_4 = LPDRIVER_INFO_4A
  53110 
  53111 type _DRIVER_INFO_5A = struct {
  53112 	FcVersion           DWORD
  53113 	F__ccgo_pad1        [4]byte
  53114 	FpName              LPSTR
  53115 	FpEnvironment       LPSTR
  53116 	FpDriverPath        LPSTR
  53117 	FpDataFile          LPSTR
  53118 	FpConfigFile        LPSTR
  53119 	FdwDriverAttributes DWORD
  53120 	FdwConfigVersion    DWORD
  53121 	FdwDriverVersion    DWORD
  53122 	F__ccgo_pad2        [4]byte
  53123 }
  53124 
  53125 type DRIVER_INFO_5A = _DRIVER_INFO_5A
  53126 type PDRIVER_INFO_5A = uintptr
  53127 type LPDRIVER_INFO_5A = uintptr
  53128 
  53129 type _DRIVER_INFO_5W = struct {
  53130 	FcVersion           DWORD
  53131 	F__ccgo_pad1        [4]byte
  53132 	FpName              LPWSTR
  53133 	FpEnvironment       LPWSTR
  53134 	FpDriverPath        LPWSTR
  53135 	FpDataFile          LPWSTR
  53136 	FpConfigFile        LPWSTR
  53137 	FdwDriverAttributes DWORD
  53138 	FdwConfigVersion    DWORD
  53139 	FdwDriverVersion    DWORD
  53140 	F__ccgo_pad2        [4]byte
  53141 }
  53142 
  53143 type DRIVER_INFO_5W = _DRIVER_INFO_5W
  53144 type PDRIVER_INFO_5W = uintptr
  53145 type LPDRIVER_INFO_5W = uintptr
  53146 
  53147 type DRIVER_INFO_5 = DRIVER_INFO_5A
  53148 type PDRIVER_INFO_5 = PDRIVER_INFO_5A
  53149 type LPDRIVER_INFO_5 = LPDRIVER_INFO_5A
  53150 
  53151 type _DRIVER_INFO_6A = struct {
  53152 	FcVersion          DWORD
  53153 	F__ccgo_pad1       [4]byte
  53154 	FpName             LPSTR
  53155 	FpEnvironment      LPSTR
  53156 	FpDriverPath       LPSTR
  53157 	FpDataFile         LPSTR
  53158 	FpConfigFile       LPSTR
  53159 	FpHelpFile         LPSTR
  53160 	FpDependentFiles   LPSTR
  53161 	FpMonitorName      LPSTR
  53162 	FpDefaultDataType  LPSTR
  53163 	FpszzPreviousNames LPSTR
  53164 	FftDriverDate      FILETIME
  53165 	FdwlDriverVersion  DWORDLONG
  53166 	FpszMfgName        LPSTR
  53167 	FpszOEMUrl         LPSTR
  53168 	FpszHardwareID     LPSTR
  53169 	FpszProvider       LPSTR
  53170 }
  53171 
  53172 type DRIVER_INFO_6A = _DRIVER_INFO_6A
  53173 type PDRIVER_INFO_6A = uintptr
  53174 type LPDRIVER_INFO_6A = uintptr
  53175 
  53176 type _DRIVER_INFO_6W = struct {
  53177 	FcVersion          DWORD
  53178 	F__ccgo_pad1       [4]byte
  53179 	FpName             LPWSTR
  53180 	FpEnvironment      LPWSTR
  53181 	FpDriverPath       LPWSTR
  53182 	FpDataFile         LPWSTR
  53183 	FpConfigFile       LPWSTR
  53184 	FpHelpFile         LPWSTR
  53185 	FpDependentFiles   LPWSTR
  53186 	FpMonitorName      LPWSTR
  53187 	FpDefaultDataType  LPWSTR
  53188 	FpszzPreviousNames LPWSTR
  53189 	FftDriverDate      FILETIME
  53190 	FdwlDriverVersion  DWORDLONG
  53191 	FpszMfgName        LPWSTR
  53192 	FpszOEMUrl         LPWSTR
  53193 	FpszHardwareID     LPWSTR
  53194 	FpszProvider       LPWSTR
  53195 }
  53196 
  53197 type DRIVER_INFO_6W = _DRIVER_INFO_6W
  53198 type PDRIVER_INFO_6W = uintptr
  53199 type LPDRIVER_INFO_6W = uintptr
  53200 
  53201 type DRIVER_INFO_6 = DRIVER_INFO_6A
  53202 type PDRIVER_INFO_6 = PDRIVER_INFO_6A
  53203 type LPDRIVER_INFO_6 = LPDRIVER_INFO_6A
  53204 
  53205 type _DOC_INFO_1A = struct {
  53206 	FpDocName    LPSTR
  53207 	FpOutputFile LPSTR
  53208 	FpDatatype   LPSTR
  53209 }
  53210 
  53211 type DOC_INFO_1A = _DOC_INFO_1A
  53212 type PDOC_INFO_1A = uintptr
  53213 type LPDOC_INFO_1A = uintptr
  53214 
  53215 type _DOC_INFO_1W = struct {
  53216 	FpDocName    LPWSTR
  53217 	FpOutputFile LPWSTR
  53218 	FpDatatype   LPWSTR
  53219 }
  53220 
  53221 type DOC_INFO_1W = _DOC_INFO_1W
  53222 type PDOC_INFO_1W = uintptr
  53223 type LPDOC_INFO_1W = uintptr
  53224 
  53225 type DOC_INFO_1 = DOC_INFO_1A
  53226 type PDOC_INFO_1 = PDOC_INFO_1A
  53227 type LPDOC_INFO_1 = LPDOC_INFO_1A
  53228 
  53229 type _FORM_INFO_1A = struct {
  53230 	FFlags         DWORD
  53231 	F__ccgo_pad1   [4]byte
  53232 	FpName         LPSTR
  53233 	FSize          SIZEL
  53234 	FImageableArea RECTL
  53235 }
  53236 
  53237 type FORM_INFO_1A = _FORM_INFO_1A
  53238 type PFORM_INFO_1A = uintptr
  53239 type LPFORM_INFO_1A = uintptr
  53240 
  53241 type _FORM_INFO_1W = struct {
  53242 	FFlags         DWORD
  53243 	F__ccgo_pad1   [4]byte
  53244 	FpName         LPWSTR
  53245 	FSize          SIZEL
  53246 	FImageableArea RECTL
  53247 }
  53248 
  53249 type FORM_INFO_1W = _FORM_INFO_1W
  53250 type PFORM_INFO_1W = uintptr
  53251 type LPFORM_INFO_1W = uintptr
  53252 
  53253 type FORM_INFO_1 = FORM_INFO_1A
  53254 type PFORM_INFO_1 = PFORM_INFO_1A
  53255 type LPFORM_INFO_1 = LPFORM_INFO_1A
  53256 
  53257 type _DOC_INFO_2A = struct {
  53258 	FpDocName    LPSTR
  53259 	FpOutputFile LPSTR
  53260 	FpDatatype   LPSTR
  53261 	FdwMode      DWORD
  53262 	FJobId       DWORD
  53263 }
  53264 
  53265 type DOC_INFO_2A = _DOC_INFO_2A
  53266 type PDOC_INFO_2A = uintptr
  53267 type LPDOC_INFO_2A = uintptr
  53268 
  53269 type _DOC_INFO_2W = struct {
  53270 	FpDocName    LPWSTR
  53271 	FpOutputFile LPWSTR
  53272 	FpDatatype   LPWSTR
  53273 	FdwMode      DWORD
  53274 	FJobId       DWORD
  53275 }
  53276 
  53277 type DOC_INFO_2W = _DOC_INFO_2W
  53278 type PDOC_INFO_2W = uintptr
  53279 type LPDOC_INFO_2W = uintptr
  53280 
  53281 type DOC_INFO_2 = DOC_INFO_2A
  53282 type PDOC_INFO_2 = PDOC_INFO_2A
  53283 type LPDOC_INFO_2 = LPDOC_INFO_2A
  53284 
  53285 type _DOC_INFO_3A = struct {
  53286 	FpDocName    LPSTR
  53287 	FpOutputFile LPSTR
  53288 	FpDatatype   LPSTR
  53289 	FdwFlags     DWORD
  53290 	F__ccgo_pad1 [4]byte
  53291 }
  53292 
  53293 type DOC_INFO_3A = _DOC_INFO_3A
  53294 type PDOC_INFO_3A = uintptr
  53295 type LPDOC_INFO_3A = uintptr
  53296 
  53297 type _DOC_INFO_3W = struct {
  53298 	FpDocName    LPWSTR
  53299 	FpOutputFile LPWSTR
  53300 	FpDatatype   LPWSTR
  53301 	FdwFlags     DWORD
  53302 	F__ccgo_pad1 [4]byte
  53303 }
  53304 
  53305 type DOC_INFO_3W = _DOC_INFO_3W
  53306 type PDOC_INFO_3W = uintptr
  53307 type LPDOC_INFO_3W = uintptr
  53308 
  53309 type DOC_INFO_3 = DOC_INFO_3A
  53310 type PDOC_INFO_3 = PDOC_INFO_3A
  53311 type LPDOC_INFO_3 = LPDOC_INFO_3A
  53312 
  53313 type _PRINTPROCESSOR_INFO_1A = struct{ FpName LPSTR }
  53314 
  53315 type PRINTPROCESSOR_INFO_1A = _PRINTPROCESSOR_INFO_1A
  53316 type PPRINTPROCESSOR_INFO_1A = uintptr
  53317 type LPPRINTPROCESSOR_INFO_1A = uintptr
  53318 
  53319 type _PRINTPROCESSOR_INFO_1W = struct{ FpName LPWSTR }
  53320 
  53321 type PRINTPROCESSOR_INFO_1W = _PRINTPROCESSOR_INFO_1W
  53322 type PPRINTPROCESSOR_INFO_1W = uintptr
  53323 type LPPRINTPROCESSOR_INFO_1W = uintptr
  53324 
  53325 type PRINTPROCESSOR_INFO_1 = PRINTPROCESSOR_INFO_1A
  53326 type PPRINTPROCESSOR_INFO_1 = PPRINTPROCESSOR_INFO_1A
  53327 type LPPRINTPROCESSOR_INFO_1 = LPPRINTPROCESSOR_INFO_1A
  53328 
  53329 type _PRINTPROCESSOR_CAPS_1 = struct {
  53330 	FdwLevel          DWORD
  53331 	FdwNupOptions     DWORD
  53332 	FdwPageOrderFlags DWORD
  53333 	FdwNumberOfCopies DWORD
  53334 }
  53335 
  53336 type PRINTPROCESSOR_CAPS_1 = _PRINTPROCESSOR_CAPS_1
  53337 type PPRINTPROCESSOR_CAPS_1 = uintptr
  53338 
  53339 type _PORT_INFO_1A = struct{ FpName LPSTR }
  53340 
  53341 type PORT_INFO_1A = _PORT_INFO_1A
  53342 type PPORT_INFO_1A = uintptr
  53343 type LPPORT_INFO_1A = uintptr
  53344 type _PORT_INFO_1W = struct{ FpName LPWSTR }
  53345 
  53346 type PORT_INFO_1W = _PORT_INFO_1W
  53347 type PPORT_INFO_1W = uintptr
  53348 type LPPORT_INFO_1W = uintptr
  53349 
  53350 type PORT_INFO_1 = PORT_INFO_1A
  53351 type PPORT_INFO_1 = PPORT_INFO_1A
  53352 type LPPORT_INFO_1 = LPPORT_INFO_1A
  53353 
  53354 type _PORT_INFO_2A = struct {
  53355 	FpPortName    LPSTR
  53356 	FpMonitorName LPSTR
  53357 	FpDescription LPSTR
  53358 	FfPortType    DWORD
  53359 	FReserved     DWORD
  53360 }
  53361 
  53362 type PORT_INFO_2A = _PORT_INFO_2A
  53363 type PPORT_INFO_2A = uintptr
  53364 type LPPORT_INFO_2A = uintptr
  53365 
  53366 type _PORT_INFO_2W = struct {
  53367 	FpPortName    LPWSTR
  53368 	FpMonitorName LPWSTR
  53369 	FpDescription LPWSTR
  53370 	FfPortType    DWORD
  53371 	FReserved     DWORD
  53372 }
  53373 
  53374 type PORT_INFO_2W = _PORT_INFO_2W
  53375 type PPORT_INFO_2W = uintptr
  53376 type LPPORT_INFO_2W = uintptr
  53377 
  53378 type PORT_INFO_2 = PORT_INFO_2A
  53379 type PPORT_INFO_2 = PPORT_INFO_2A
  53380 type LPPORT_INFO_2 = LPPORT_INFO_2A
  53381 
  53382 type _PORT_INFO_3A = struct {
  53383 	FdwStatus    DWORD
  53384 	F__ccgo_pad1 [4]byte
  53385 	FpszStatus   LPSTR
  53386 	FdwSeverity  DWORD
  53387 	F__ccgo_pad2 [4]byte
  53388 }
  53389 
  53390 type PORT_INFO_3A = _PORT_INFO_3A
  53391 type PPORT_INFO_3A = uintptr
  53392 type LPPORT_INFO_3A = uintptr
  53393 
  53394 type _PORT_INFO_3W = struct {
  53395 	FdwStatus    DWORD
  53396 	F__ccgo_pad1 [4]byte
  53397 	FpszStatus   LPWSTR
  53398 	FdwSeverity  DWORD
  53399 	F__ccgo_pad2 [4]byte
  53400 }
  53401 
  53402 type PORT_INFO_3W = _PORT_INFO_3W
  53403 type PPORT_INFO_3W = uintptr
  53404 type LPPORT_INFO_3W = uintptr
  53405 
  53406 type PORT_INFO_3 = PORT_INFO_3A
  53407 type PPORT_INFO_3 = PPORT_INFO_3A
  53408 type LPPORT_INFO_3 = LPPORT_INFO_3A
  53409 
  53410 type _MONITOR_INFO_1A = struct{ FpName LPSTR }
  53411 
  53412 type MONITOR_INFO_1A = _MONITOR_INFO_1A
  53413 type PMONITOR_INFO_1A = uintptr
  53414 type LPMONITOR_INFO_1A = uintptr
  53415 
  53416 type _MONITOR_INFO_1W = struct{ FpName LPWSTR }
  53417 
  53418 type MONITOR_INFO_1W = _MONITOR_INFO_1W
  53419 type PMONITOR_INFO_1W = uintptr
  53420 type LPMONITOR_INFO_1W = uintptr
  53421 
  53422 type MONITOR_INFO_1 = MONITOR_INFO_1A
  53423 type PMONITOR_INFO_1 = PMONITOR_INFO_1A
  53424 type LPMONITOR_INFO_1 = LPMONITOR_INFO_1A
  53425 
  53426 type _MONITOR_INFO_2A = struct {
  53427 	FpName        LPSTR
  53428 	FpEnvironment LPSTR
  53429 	FpDLLName     LPSTR
  53430 }
  53431 
  53432 type MONITOR_INFO_2A = _MONITOR_INFO_2A
  53433 type PMONITOR_INFO_2A = uintptr
  53434 type LPMONITOR_INFO_2A = uintptr
  53435 
  53436 type _MONITOR_INFO_2W = struct {
  53437 	FpName        LPWSTR
  53438 	FpEnvironment LPWSTR
  53439 	FpDLLName     LPWSTR
  53440 }
  53441 
  53442 type MONITOR_INFO_2W = _MONITOR_INFO_2W
  53443 type PMONITOR_INFO_2W = uintptr
  53444 type LPMONITOR_INFO_2W = uintptr
  53445 
  53446 type MONITOR_INFO_2 = MONITOR_INFO_2A
  53447 type PMONITOR_INFO_2 = PMONITOR_INFO_2A
  53448 type LPMONITOR_INFO_2 = LPMONITOR_INFO_2A
  53449 
  53450 type _DATATYPES_INFO_1A = struct{ FpName LPSTR }
  53451 
  53452 type DATATYPES_INFO_1A = _DATATYPES_INFO_1A
  53453 type PDATATYPES_INFO_1A = uintptr
  53454 type LPDATATYPES_INFO_1A = uintptr
  53455 
  53456 type _DATATYPES_INFO_1W = struct{ FpName LPWSTR }
  53457 
  53458 type DATATYPES_INFO_1W = _DATATYPES_INFO_1W
  53459 type PDATATYPES_INFO_1W = uintptr
  53460 type LPDATATYPES_INFO_1W = uintptr
  53461 
  53462 type DATATYPES_INFO_1 = DATATYPES_INFO_1A
  53463 type PDATATYPES_INFO_1 = PDATATYPES_INFO_1A
  53464 type LPDATATYPES_INFO_1 = LPDATATYPES_INFO_1A
  53465 
  53466 type _PRINTER_DEFAULTSA = struct {
  53467 	FpDatatype     LPSTR
  53468 	FpDevMode      LPDEVMODEA
  53469 	FDesiredAccess ACCESS_MASK
  53470 	F__ccgo_pad1   [4]byte
  53471 }
  53472 
  53473 type PRINTER_DEFAULTSA = _PRINTER_DEFAULTSA
  53474 type PPRINTER_DEFAULTSA = uintptr
  53475 type LPPRINTER_DEFAULTSA = uintptr
  53476 
  53477 type _PRINTER_DEFAULTSW = struct {
  53478 	FpDatatype     LPWSTR
  53479 	FpDevMode      LPDEVMODEW
  53480 	FDesiredAccess ACCESS_MASK
  53481 	F__ccgo_pad1   [4]byte
  53482 }
  53483 
  53484 type PRINTER_DEFAULTSW = _PRINTER_DEFAULTSW
  53485 type PPRINTER_DEFAULTSW = uintptr
  53486 type LPPRINTER_DEFAULTSW = uintptr
  53487 
  53488 type PRINTER_DEFAULTS = PRINTER_DEFAULTSA
  53489 type PPRINTER_DEFAULTS = PPRINTER_DEFAULTSA
  53490 type LPPRINTER_DEFAULTS = LPPRINTER_DEFAULTSA
  53491 
  53492 type _PRINTER_ENUM_VALUESA = struct {
  53493 	FpValueName  LPSTR
  53494 	FcbValueName DWORD
  53495 	FdwType      DWORD
  53496 	FpData       LPBYTE
  53497 	FcbData      DWORD
  53498 	F__ccgo_pad1 [4]byte
  53499 }
  53500 
  53501 type PRINTER_ENUM_VALUESA = _PRINTER_ENUM_VALUESA
  53502 type PPRINTER_ENUM_VALUESA = uintptr
  53503 type LPPRINTER_ENUM_VALUESA = uintptr
  53504 
  53505 type _PRINTER_ENUM_VALUESW = struct {
  53506 	FpValueName  LPWSTR
  53507 	FcbValueName DWORD
  53508 	FdwType      DWORD
  53509 	FpData       LPBYTE
  53510 	FcbData      DWORD
  53511 	F__ccgo_pad1 [4]byte
  53512 }
  53513 
  53514 type PRINTER_ENUM_VALUESW = _PRINTER_ENUM_VALUESW
  53515 type PPRINTER_ENUM_VALUESW = uintptr
  53516 type LPPRINTER_ENUM_VALUESW = uintptr
  53517 
  53518 type PRINTER_ENUM_VALUES = PRINTER_ENUM_VALUESA
  53519 type PPRINTER_ENUM_VALUES = PPRINTER_ENUM_VALUESA
  53520 type LPPRINTER_ENUM_VALUES = LPPRINTER_ENUM_VALUESA
  53521 
  53522 type _PRINTER_NOTIFY_OPTIONS_TYPE = struct {
  53523 	FType      WORD
  53524 	FReserved0 WORD
  53525 	FReserved1 DWORD
  53526 	FReserved2 DWORD
  53527 	FCount     DWORD
  53528 	FpFields   PWORD
  53529 }
  53530 
  53531 type PRINTER_NOTIFY_OPTIONS_TYPE = _PRINTER_NOTIFY_OPTIONS_TYPE
  53532 type PPRINTER_NOTIFY_OPTIONS_TYPE = uintptr
  53533 type LPPRINTER_NOTIFY_OPTIONS_TYPE = uintptr
  53534 
  53535 type _PRINTER_NOTIFY_OPTIONS = struct {
  53536 	FVersion     DWORD
  53537 	FFlags       DWORD
  53538 	FCount       DWORD
  53539 	F__ccgo_pad1 [4]byte
  53540 	FpTypes      PPRINTER_NOTIFY_OPTIONS_TYPE
  53541 }
  53542 
  53543 type PRINTER_NOTIFY_OPTIONS = _PRINTER_NOTIFY_OPTIONS
  53544 type PPRINTER_NOTIFY_OPTIONS = uintptr
  53545 type LPPRINTER_NOTIFY_OPTIONS = uintptr
  53546 
  53547 type _PRINTER_NOTIFY_INFO_DATA = struct {
  53548 	FType        WORD
  53549 	FField       WORD
  53550 	FReserved    DWORD
  53551 	FId          DWORD
  53552 	F__ccgo_pad1 [4]byte
  53553 	FNotifyData  struct {
  53554 		F__ccgo_pad1 [0]uint64
  53555 		FadwData     [2]DWORD
  53556 		F__ccgo_pad2 [8]byte
  53557 	}
  53558 }
  53559 
  53560 type PRINTER_NOTIFY_INFO_DATA = _PRINTER_NOTIFY_INFO_DATA
  53561 type PPRINTER_NOTIFY_INFO_DATA = uintptr
  53562 type LPPRINTER_NOTIFY_INFO_DATA = uintptr
  53563 
  53564 type _PRINTER_NOTIFY_INFO = struct {
  53565 	FVersion     DWORD
  53566 	FFlags       DWORD
  53567 	FCount       DWORD
  53568 	F__ccgo_pad1 [4]byte
  53569 	FaData       [1]PRINTER_NOTIFY_INFO_DATA
  53570 }
  53571 
  53572 type PRINTER_NOTIFY_INFO = _PRINTER_NOTIFY_INFO
  53573 type PPRINTER_NOTIFY_INFO = uintptr
  53574 type LPPRINTER_NOTIFY_INFO = uintptr
  53575 
  53576 type _BINARY_CONTAINER = struct {
  53577 	FcbBuf       DWORD
  53578 	F__ccgo_pad1 [4]byte
  53579 	FpData       LPBYTE
  53580 }
  53581 
  53582 type BINARY_CONTAINER = _BINARY_CONTAINER
  53583 type PBINARY_CONTAINER = uintptr
  53584 
  53585 type _BIDI_DATA = struct {
  53586 	FdwBidiType  DWORD
  53587 	F__ccgo_pad1 [4]byte
  53588 	Fu           struct {
  53589 		F__ccgo_pad1 [0]uint64
  53590 		FbData       WINBOOL
  53591 		F__ccgo_pad2 [12]byte
  53592 	}
  53593 }
  53594 
  53595 type BIDI_DATA = _BIDI_DATA
  53596 type PBIDI_DATA = uintptr
  53597 type LPBIDI_DATA = uintptr
  53598 
  53599 type _BIDI_REQUEST_DATA = struct {
  53600 	FdwReqNumber DWORD
  53601 	F__ccgo_pad1 [4]byte
  53602 	FpSchema     LPWSTR
  53603 	Fdata        BIDI_DATA
  53604 }
  53605 
  53606 type BIDI_REQUEST_DATA = _BIDI_REQUEST_DATA
  53607 type PBIDI_REQUEST_DATA = uintptr
  53608 type LPBIDI_REQUEST_DATA = uintptr
  53609 
  53610 type _BIDI_REQUEST_CONTAINER = struct {
  53611 	FVersion     DWORD
  53612 	FFlags       DWORD
  53613 	FCount       DWORD
  53614 	F__ccgo_pad1 [4]byte
  53615 	FaData       [1]BIDI_REQUEST_DATA
  53616 }
  53617 
  53618 type BIDI_REQUEST_CONTAINER = _BIDI_REQUEST_CONTAINER
  53619 type PBIDI_REQUEST_CONTAINER = uintptr
  53620 type LPBIDI_REQUEST_CONTAINER = uintptr
  53621 
  53622 type _BIDI_RESPONSE_DATA = struct {
  53623 	FdwResult    DWORD
  53624 	FdwReqNumber DWORD
  53625 	FpSchema     LPWSTR
  53626 	Fdata        BIDI_DATA
  53627 }
  53628 
  53629 type BIDI_RESPONSE_DATA = _BIDI_RESPONSE_DATA
  53630 type PBIDI_RESPONSE_DATA = uintptr
  53631 type LPBIDI_RESPONSE_DATA = uintptr
  53632 
  53633 type _BIDI_RESPONSE_CONTAINER = struct {
  53634 	FVersion     DWORD
  53635 	FFlags       DWORD
  53636 	FCount       DWORD
  53637 	F__ccgo_pad1 [4]byte
  53638 	FaData       [1]BIDI_RESPONSE_DATA
  53639 }
  53640 
  53641 type BIDI_RESPONSE_CONTAINER = _BIDI_RESPONSE_CONTAINER
  53642 type PBIDI_RESPONSE_CONTAINER = uintptr
  53643 type LPBIDI_RESPONSE_CONTAINER = uintptr
  53644 
  53645 type BIDI_TYPE = uint32
  53646 
  53647 type _PROVIDOR_INFO_1A = struct {
  53648 	FpName        LPSTR
  53649 	FpEnvironment LPSTR
  53650 	FpDLLName     LPSTR
  53651 }
  53652 
  53653 type PROVIDOR_INFO_1A = _PROVIDOR_INFO_1A
  53654 type PPROVIDOR_INFO_1A = uintptr
  53655 type LPPROVIDOR_INFO_1A = uintptr
  53656 
  53657 type _PROVIDOR_INFO_1W = struct {
  53658 	FpName        LPWSTR
  53659 	FpEnvironment LPWSTR
  53660 	FpDLLName     LPWSTR
  53661 }
  53662 
  53663 type PROVIDOR_INFO_1W = _PROVIDOR_INFO_1W
  53664 type PPROVIDOR_INFO_1W = uintptr
  53665 type LPPROVIDOR_INFO_1W = uintptr
  53666 
  53667 type PROVIDOR_INFO_1 = PROVIDOR_INFO_1A
  53668 type PPROVIDOR_INFO_1 = PPROVIDOR_INFO_1A
  53669 type LPPROVIDOR_INFO_1 = LPPROVIDOR_INFO_1A
  53670 
  53671 type _PROVIDOR_INFO_2A = struct{ FpOrder LPSTR }
  53672 
  53673 type PROVIDOR_INFO_2A = _PROVIDOR_INFO_2A
  53674 type PPROVIDOR_INFO_2A = uintptr
  53675 type LPPROVIDOR_INFO_2A = uintptr
  53676 
  53677 type _PROVIDOR_INFO_2W = struct{ FpOrder LPWSTR }
  53678 
  53679 type PROVIDOR_INFO_2W = _PROVIDOR_INFO_2W
  53680 type PPROVIDOR_INFO_2W = uintptr
  53681 type LPPROVIDOR_INFO_2W = uintptr
  53682 
  53683 type PROVIDOR_INFO_2 = PROVIDOR_INFO_2A
  53684 type PPROVIDOR_INFO_2 = PPROVIDOR_INFO_2A
  53685 type LPPROVIDOR_INFO_2 = LPPROVIDOR_INFO_2A
  53686 
  53687 type LPOFNHOOKPROC = uintptr
  53688 
  53689 type tagOFN_NT4A = struct {
  53690 	FlStructSize       DWORD
  53691 	F__ccgo_pad1       [4]byte
  53692 	FhwndOwner         HWND
  53693 	FhInstance         HINSTANCE
  53694 	FlpstrFilter       LPCSTR
  53695 	FlpstrCustomFilter LPSTR
  53696 	FnMaxCustFilter    DWORD
  53697 	FnFilterIndex      DWORD
  53698 	FlpstrFile         LPSTR
  53699 	FnMaxFile          DWORD
  53700 	F__ccgo_pad2       [4]byte
  53701 	FlpstrFileTitle    LPSTR
  53702 	FnMaxFileTitle     DWORD
  53703 	F__ccgo_pad3       [4]byte
  53704 	FlpstrInitialDir   LPCSTR
  53705 	FlpstrTitle        LPCSTR
  53706 	FFlags             DWORD
  53707 	FnFileOffset       WORD
  53708 	FnFileExtension    WORD
  53709 	FlpstrDefExt       LPCSTR
  53710 	FlCustData         LPARAM
  53711 	FlpfnHook          LPOFNHOOKPROC
  53712 	FlpTemplateName    LPCSTR
  53713 }
  53714 
  53715 type OPENFILENAME_NT4A = tagOFN_NT4A
  53716 type LPOPENFILENAME_NT4A = uintptr
  53717 type tagOFN_NT4W = struct {
  53718 	FlStructSize       DWORD
  53719 	F__ccgo_pad1       [4]byte
  53720 	FhwndOwner         HWND
  53721 	FhInstance         HINSTANCE
  53722 	FlpstrFilter       LPCWSTR
  53723 	FlpstrCustomFilter LPWSTR
  53724 	FnMaxCustFilter    DWORD
  53725 	FnFilterIndex      DWORD
  53726 	FlpstrFile         LPWSTR
  53727 	FnMaxFile          DWORD
  53728 	F__ccgo_pad2       [4]byte
  53729 	FlpstrFileTitle    LPWSTR
  53730 	FnMaxFileTitle     DWORD
  53731 	F__ccgo_pad3       [4]byte
  53732 	FlpstrInitialDir   LPCWSTR
  53733 	FlpstrTitle        LPCWSTR
  53734 	FFlags             DWORD
  53735 	FnFileOffset       WORD
  53736 	FnFileExtension    WORD
  53737 	FlpstrDefExt       LPCWSTR
  53738 	FlCustData         LPARAM
  53739 	FlpfnHook          LPOFNHOOKPROC
  53740 	FlpTemplateName    LPCWSTR
  53741 }
  53742 
  53743 type OPENFILENAME_NT4W = tagOFN_NT4W
  53744 type LPOPENFILENAME_NT4W = uintptr
  53745 
  53746 type OPENFILENAME_NT4 = OPENFILENAME_NT4A
  53747 type LPOPENFILENAME_NT4 = LPOPENFILENAME_NT4A
  53748 
  53749 type tagOFNA = struct {
  53750 	FlStructSize       DWORD
  53751 	F__ccgo_pad1       [4]byte
  53752 	FhwndOwner         HWND
  53753 	FhInstance         HINSTANCE
  53754 	FlpstrFilter       LPCSTR
  53755 	FlpstrCustomFilter LPSTR
  53756 	FnMaxCustFilter    DWORD
  53757 	FnFilterIndex      DWORD
  53758 	FlpstrFile         LPSTR
  53759 	FnMaxFile          DWORD
  53760 	F__ccgo_pad2       [4]byte
  53761 	FlpstrFileTitle    LPSTR
  53762 	FnMaxFileTitle     DWORD
  53763 	F__ccgo_pad3       [4]byte
  53764 	FlpstrInitialDir   LPCSTR
  53765 	FlpstrTitle        LPCSTR
  53766 	FFlags             DWORD
  53767 	FnFileOffset       WORD
  53768 	FnFileExtension    WORD
  53769 	FlpstrDefExt       LPCSTR
  53770 	FlCustData         LPARAM
  53771 	FlpfnHook          LPOFNHOOKPROC
  53772 	FlpTemplateName    LPCSTR
  53773 	FpvReserved        uintptr
  53774 	FdwReserved        DWORD
  53775 	FFlagsEx           DWORD
  53776 }
  53777 
  53778 type OPENFILENAMEA = tagOFNA
  53779 type LPOPENFILENAMEA = uintptr
  53780 type tagOFNW = struct {
  53781 	FlStructSize       DWORD
  53782 	F__ccgo_pad1       [4]byte
  53783 	FhwndOwner         HWND
  53784 	FhInstance         HINSTANCE
  53785 	FlpstrFilter       LPCWSTR
  53786 	FlpstrCustomFilter LPWSTR
  53787 	FnMaxCustFilter    DWORD
  53788 	FnFilterIndex      DWORD
  53789 	FlpstrFile         LPWSTR
  53790 	FnMaxFile          DWORD
  53791 	F__ccgo_pad2       [4]byte
  53792 	FlpstrFileTitle    LPWSTR
  53793 	FnMaxFileTitle     DWORD
  53794 	F__ccgo_pad3       [4]byte
  53795 	FlpstrInitialDir   LPCWSTR
  53796 	FlpstrTitle        LPCWSTR
  53797 	FFlags             DWORD
  53798 	FnFileOffset       WORD
  53799 	FnFileExtension    WORD
  53800 	FlpstrDefExt       LPCWSTR
  53801 	FlCustData         LPARAM
  53802 	FlpfnHook          LPOFNHOOKPROC
  53803 	FlpTemplateName    LPCWSTR
  53804 	FpvReserved        uintptr
  53805 	FdwReserved        DWORD
  53806 	FFlagsEx           DWORD
  53807 }
  53808 
  53809 type OPENFILENAMEW = tagOFNW
  53810 type LPOPENFILENAMEW = uintptr
  53811 
  53812 type OPENFILENAME = OPENFILENAMEA
  53813 type LPOPENFILENAME = LPOPENFILENAMEA
  53814 
  53815 type LPCCHOOKPROC = uintptr
  53816 
  53817 type _OFNOTIFYA = struct {
  53818 	Fhdr     NMHDR
  53819 	FlpOFN   LPOPENFILENAMEA
  53820 	FpszFile LPSTR
  53821 }
  53822 
  53823 type OFNOTIFYA = _OFNOTIFYA
  53824 type LPOFNOTIFYA = uintptr
  53825 
  53826 type _OFNOTIFYW = struct {
  53827 	Fhdr     NMHDR
  53828 	FlpOFN   LPOPENFILENAMEW
  53829 	FpszFile LPWSTR
  53830 }
  53831 
  53832 type OFNOTIFYW = _OFNOTIFYW
  53833 type LPOFNOTIFYW = uintptr
  53834 
  53835 type OFNOTIFY = OFNOTIFYA
  53836 type LPOFNOTIFY = LPOFNOTIFYA
  53837 
  53838 type _OFNOTIFYEXA = struct {
  53839 	Fhdr   NMHDR
  53840 	FlpOFN LPOPENFILENAMEA
  53841 	Fpsf   LPVOID
  53842 	Fpidl  LPVOID
  53843 }
  53844 
  53845 type OFNOTIFYEXA = _OFNOTIFYEXA
  53846 type LPOFNOTIFYEXA = uintptr
  53847 
  53848 type _OFNOTIFYEXW = struct {
  53849 	Fhdr   NMHDR
  53850 	FlpOFN LPOPENFILENAMEW
  53851 	Fpsf   LPVOID
  53852 	Fpidl  LPVOID
  53853 }
  53854 
  53855 type OFNOTIFYEXW = _OFNOTIFYEXW
  53856 type LPOFNOTIFYEXW = uintptr
  53857 
  53858 type OFNOTIFYEX = OFNOTIFYEXA
  53859 type LPOFNOTIFYEX = LPOFNOTIFYEXA
  53860 
  53861 type tagCHOOSECOLORA = struct {
  53862 	FlStructSize    DWORD
  53863 	F__ccgo_pad1    [4]byte
  53864 	FhwndOwner      HWND
  53865 	FhInstance      HWND
  53866 	FrgbResult      COLORREF
  53867 	F__ccgo_pad2    [4]byte
  53868 	FlpCustColors   uintptr
  53869 	FFlags          DWORD
  53870 	F__ccgo_pad3    [4]byte
  53871 	FlCustData      LPARAM
  53872 	FlpfnHook       LPCCHOOKPROC
  53873 	FlpTemplateName LPCSTR
  53874 }
  53875 
  53876 type CHOOSECOLORA = tagCHOOSECOLORA
  53877 type LPCHOOSECOLORA = uintptr
  53878 type tagCHOOSECOLORW = struct {
  53879 	FlStructSize    DWORD
  53880 	F__ccgo_pad1    [4]byte
  53881 	FhwndOwner      HWND
  53882 	FhInstance      HWND
  53883 	FrgbResult      COLORREF
  53884 	F__ccgo_pad2    [4]byte
  53885 	FlpCustColors   uintptr
  53886 	FFlags          DWORD
  53887 	F__ccgo_pad3    [4]byte
  53888 	FlCustData      LPARAM
  53889 	FlpfnHook       LPCCHOOKPROC
  53890 	FlpTemplateName LPCWSTR
  53891 }
  53892 
  53893 type CHOOSECOLORW = tagCHOOSECOLORW
  53894 type LPCHOOSECOLORW = uintptr
  53895 
  53896 type CHOOSECOLOR = CHOOSECOLORA
  53897 type LPCHOOSECOLOR = LPCHOOSECOLORA
  53898 
  53899 type LPFRHOOKPROC = uintptr
  53900 
  53901 type tagFINDREPLACEA = struct {
  53902 	FlStructSize      DWORD
  53903 	F__ccgo_pad1      [4]byte
  53904 	FhwndOwner        HWND
  53905 	FhInstance        HINSTANCE
  53906 	FFlags            DWORD
  53907 	F__ccgo_pad2      [4]byte
  53908 	FlpstrFindWhat    LPSTR
  53909 	FlpstrReplaceWith LPSTR
  53910 	FwFindWhatLen     WORD
  53911 	FwReplaceWithLen  WORD
  53912 	F__ccgo_pad3      [4]byte
  53913 	FlCustData        LPARAM
  53914 	FlpfnHook         LPFRHOOKPROC
  53915 	FlpTemplateName   LPCSTR
  53916 }
  53917 
  53918 type FINDREPLACEA = tagFINDREPLACEA
  53919 type LPFINDREPLACEA = uintptr
  53920 
  53921 type tagFINDREPLACEW = struct {
  53922 	FlStructSize      DWORD
  53923 	F__ccgo_pad1      [4]byte
  53924 	FhwndOwner        HWND
  53925 	FhInstance        HINSTANCE
  53926 	FFlags            DWORD
  53927 	F__ccgo_pad2      [4]byte
  53928 	FlpstrFindWhat    LPWSTR
  53929 	FlpstrReplaceWith LPWSTR
  53930 	FwFindWhatLen     WORD
  53931 	FwReplaceWithLen  WORD
  53932 	F__ccgo_pad3      [4]byte
  53933 	FlCustData        LPARAM
  53934 	FlpfnHook         LPFRHOOKPROC
  53935 	FlpTemplateName   LPCWSTR
  53936 }
  53937 
  53938 type FINDREPLACEW = tagFINDREPLACEW
  53939 type LPFINDREPLACEW = uintptr
  53940 
  53941 type FINDREPLACE = FINDREPLACEA
  53942 type LPFINDREPLACE = LPFINDREPLACEA
  53943 
  53944 type LPCFHOOKPROC = uintptr
  53945 
  53946 type tagCHOOSEFONTA = struct {
  53947 	FlStructSize            DWORD
  53948 	F__ccgo_pad1            [4]byte
  53949 	FhwndOwner              HWND
  53950 	FhDC                    HDC
  53951 	FlpLogFont              LPLOGFONTA
  53952 	FiPointSize             INT
  53953 	FFlags                  DWORD
  53954 	FrgbColors              COLORREF
  53955 	F__ccgo_pad2            [4]byte
  53956 	FlCustData              LPARAM
  53957 	FlpfnHook               LPCFHOOKPROC
  53958 	FlpTemplateName         LPCSTR
  53959 	FhInstance              HINSTANCE
  53960 	FlpszStyle              LPSTR
  53961 	FnFontType              WORD
  53962 	F___MISSING_ALIGNMENT__ WORD
  53963 	FnSizeMin               INT
  53964 	FnSizeMax               INT
  53965 	F__ccgo_pad3            [4]byte
  53966 }
  53967 
  53968 type CHOOSEFONTA = tagCHOOSEFONTA
  53969 type LPCHOOSEFONTA = uintptr
  53970 
  53971 type tagCHOOSEFONTW = struct {
  53972 	FlStructSize            DWORD
  53973 	F__ccgo_pad1            [4]byte
  53974 	FhwndOwner              HWND
  53975 	FhDC                    HDC
  53976 	FlpLogFont              LPLOGFONTW
  53977 	FiPointSize             INT
  53978 	FFlags                  DWORD
  53979 	FrgbColors              COLORREF
  53980 	F__ccgo_pad2            [4]byte
  53981 	FlCustData              LPARAM
  53982 	FlpfnHook               LPCFHOOKPROC
  53983 	FlpTemplateName         LPCWSTR
  53984 	FhInstance              HINSTANCE
  53985 	FlpszStyle              LPWSTR
  53986 	FnFontType              WORD
  53987 	F___MISSING_ALIGNMENT__ WORD
  53988 	FnSizeMin               INT
  53989 	FnSizeMax               INT
  53990 	F__ccgo_pad3            [4]byte
  53991 }
  53992 
  53993 type CHOOSEFONTW = tagCHOOSEFONTW
  53994 type LPCHOOSEFONTW = uintptr
  53995 
  53996 type CHOOSEFONT = CHOOSEFONTA
  53997 type LPCHOOSEFONT = LPCHOOSEFONTA
  53998 
  53999 type LPPRINTHOOKPROC = uintptr
  54000 type LPSETUPHOOKPROC = uintptr
  54001 
  54002 type tagPDA = struct {
  54003 	FlStructSize         DWORD
  54004 	F__ccgo_pad1         [4]byte
  54005 	FhwndOwner           HWND
  54006 	FhDevMode            HGLOBAL
  54007 	FhDevNames           HGLOBAL
  54008 	FhDC                 HDC
  54009 	FFlags               DWORD
  54010 	FnFromPage           WORD
  54011 	FnToPage             WORD
  54012 	FnMinPage            WORD
  54013 	FnMaxPage            WORD
  54014 	FnCopies             WORD
  54015 	F__ccgo_pad2         [2]byte
  54016 	FhInstance           HINSTANCE
  54017 	FlCustData           LPARAM
  54018 	FlpfnPrintHook       LPPRINTHOOKPROC
  54019 	FlpfnSetupHook       LPSETUPHOOKPROC
  54020 	FlpPrintTemplateName LPCSTR
  54021 	FlpSetupTemplateName LPCSTR
  54022 	FhPrintTemplate      HGLOBAL
  54023 	FhSetupTemplate      HGLOBAL
  54024 }
  54025 
  54026 type PRINTDLGA = tagPDA
  54027 type LPPRINTDLGA = uintptr
  54028 
  54029 type tagPDW = struct {
  54030 	FlStructSize         DWORD
  54031 	F__ccgo_pad1         [4]byte
  54032 	FhwndOwner           HWND
  54033 	FhDevMode            HGLOBAL
  54034 	FhDevNames           HGLOBAL
  54035 	FhDC                 HDC
  54036 	FFlags               DWORD
  54037 	FnFromPage           WORD
  54038 	FnToPage             WORD
  54039 	FnMinPage            WORD
  54040 	FnMaxPage            WORD
  54041 	FnCopies             WORD
  54042 	F__ccgo_pad2         [2]byte
  54043 	FhInstance           HINSTANCE
  54044 	FlCustData           LPARAM
  54045 	FlpfnPrintHook       LPPRINTHOOKPROC
  54046 	FlpfnSetupHook       LPSETUPHOOKPROC
  54047 	FlpPrintTemplateName LPCWSTR
  54048 	FlpSetupTemplateName LPCWSTR
  54049 	FhPrintTemplate      HGLOBAL
  54050 	FhSetupTemplate      HGLOBAL
  54051 }
  54052 
  54053 type PRINTDLGW = tagPDW
  54054 type LPPRINTDLGW = uintptr
  54055 
  54056 type PRINTDLG = PRINTDLGA
  54057 type LPPRINTDLG = LPPRINTDLGA
  54058 
  54059 type IPrintDialogCallback1 = struct{ FlpVtbl uintptr }
  54060 
  54061 type IPrintDialogCallbackVtbl1 = struct {
  54062 	FQueryInterface  uintptr
  54063 	FAddRef          uintptr
  54064 	FRelease         uintptr
  54065 	FInitDone        uintptr
  54066 	FSelectionChange uintptr
  54067 	FHandleMessage   uintptr
  54068 }
  54069 
  54070 type IPrintDialogCallback = IPrintDialogCallback1
  54071 type IPrintDialogCallbackVtbl = IPrintDialogCallbackVtbl1
  54072 
  54073 type IPrintDialogServices1 = struct{ FlpVtbl uintptr }
  54074 
  54075 type IPrintDialogServicesVtbl1 = struct {
  54076 	FQueryInterface        uintptr
  54077 	FAddRef                uintptr
  54078 	FRelease               uintptr
  54079 	FGetCurrentDevMode     uintptr
  54080 	FGetCurrentPrinterName uintptr
  54081 	FGetCurrentPortName    uintptr
  54082 }
  54083 
  54084 type IPrintDialogServices = IPrintDialogServices1
  54085 type IPrintDialogServicesVtbl = IPrintDialogServicesVtbl1
  54086 
  54087 type tagPRINTPAGERANGE = struct {
  54088 	FnFromPage DWORD
  54089 	FnToPage   DWORD
  54090 }
  54091 
  54092 type PRINTPAGERANGE = tagPRINTPAGERANGE
  54093 type LPPRINTPAGERANGE = uintptr
  54094 
  54095 type tagPDEXA = struct {
  54096 	FlStructSize         DWORD
  54097 	F__ccgo_pad1         [4]byte
  54098 	FhwndOwner           HWND
  54099 	FhDevMode            HGLOBAL
  54100 	FhDevNames           HGLOBAL
  54101 	FhDC                 HDC
  54102 	FFlags               DWORD
  54103 	FFlags2              DWORD
  54104 	FExclusionFlags      DWORD
  54105 	FnPageRanges         DWORD
  54106 	FnMaxPageRanges      DWORD
  54107 	F__ccgo_pad2         [4]byte
  54108 	FlpPageRanges        LPPRINTPAGERANGE
  54109 	FnMinPage            DWORD
  54110 	FnMaxPage            DWORD
  54111 	FnCopies             DWORD
  54112 	F__ccgo_pad3         [4]byte
  54113 	FhInstance           HINSTANCE
  54114 	FlpPrintTemplateName LPCSTR
  54115 	FlpCallback          LPUNKNOWN
  54116 	FnPropertyPages      DWORD
  54117 	F__ccgo_pad4         [4]byte
  54118 	FlphPropertyPages    uintptr
  54119 	FnStartPage          DWORD
  54120 	FdwResultAction      DWORD
  54121 }
  54122 
  54123 type PRINTDLGEXA = tagPDEXA
  54124 type LPPRINTDLGEXA = uintptr
  54125 
  54126 type tagPDEXW = struct {
  54127 	FlStructSize         DWORD
  54128 	F__ccgo_pad1         [4]byte
  54129 	FhwndOwner           HWND
  54130 	FhDevMode            HGLOBAL
  54131 	FhDevNames           HGLOBAL
  54132 	FhDC                 HDC
  54133 	FFlags               DWORD
  54134 	FFlags2              DWORD
  54135 	FExclusionFlags      DWORD
  54136 	FnPageRanges         DWORD
  54137 	FnMaxPageRanges      DWORD
  54138 	F__ccgo_pad2         [4]byte
  54139 	FlpPageRanges        LPPRINTPAGERANGE
  54140 	FnMinPage            DWORD
  54141 	FnMaxPage            DWORD
  54142 	FnCopies             DWORD
  54143 	F__ccgo_pad3         [4]byte
  54144 	FhInstance           HINSTANCE
  54145 	FlpPrintTemplateName LPCWSTR
  54146 	FlpCallback          LPUNKNOWN
  54147 	FnPropertyPages      DWORD
  54148 	F__ccgo_pad4         [4]byte
  54149 	FlphPropertyPages    uintptr
  54150 	FnStartPage          DWORD
  54151 	FdwResultAction      DWORD
  54152 }
  54153 
  54154 type PRINTDLGEXW = tagPDEXW
  54155 type LPPRINTDLGEXW = uintptr
  54156 
  54157 type PRINTDLGEX = PRINTDLGEXA
  54158 type LPPRINTDLGEX = LPPRINTDLGEXA
  54159 
  54160 type tagDEVNAMES = struct {
  54161 	FwDriverOffset WORD
  54162 	FwDeviceOffset WORD
  54163 	FwOutputOffset WORD
  54164 	FwDefault      WORD
  54165 }
  54166 
  54167 type DEVNAMES = tagDEVNAMES
  54168 type LPDEVNAMES = uintptr
  54169 
  54170 type LPPAGEPAINTHOOK = uintptr
  54171 type LPPAGESETUPHOOK = uintptr
  54172 
  54173 type tagPSDA = struct {
  54174 	FlStructSize             DWORD
  54175 	F__ccgo_pad1             [4]byte
  54176 	FhwndOwner               HWND
  54177 	FhDevMode                HGLOBAL
  54178 	FhDevNames               HGLOBAL
  54179 	FFlags                   DWORD
  54180 	FptPaperSize             POINT
  54181 	FrtMinMargin             RECT
  54182 	FrtMargin                RECT
  54183 	F__ccgo_pad2             [4]byte
  54184 	FhInstance               HINSTANCE
  54185 	FlCustData               LPARAM
  54186 	FlpfnPageSetupHook       LPPAGESETUPHOOK
  54187 	FlpfnPagePaintHook       LPPAGEPAINTHOOK
  54188 	FlpPageSetupTemplateName LPCSTR
  54189 	FhPageSetupTemplate      HGLOBAL
  54190 }
  54191 
  54192 type PAGESETUPDLGA = tagPSDA
  54193 type LPPAGESETUPDLGA = uintptr
  54194 
  54195 type tagPSDW = struct {
  54196 	FlStructSize             DWORD
  54197 	F__ccgo_pad1             [4]byte
  54198 	FhwndOwner               HWND
  54199 	FhDevMode                HGLOBAL
  54200 	FhDevNames               HGLOBAL
  54201 	FFlags                   DWORD
  54202 	FptPaperSize             POINT
  54203 	FrtMinMargin             RECT
  54204 	FrtMargin                RECT
  54205 	F__ccgo_pad2             [4]byte
  54206 	FhInstance               HINSTANCE
  54207 	FlCustData               LPARAM
  54208 	FlpfnPageSetupHook       LPPAGESETUPHOOK
  54209 	FlpfnPagePaintHook       LPPAGEPAINTHOOK
  54210 	FlpPageSetupTemplateName LPCWSTR
  54211 	FhPageSetupTemplate      HGLOBAL
  54212 }
  54213 
  54214 type PAGESETUPDLGW = tagPSDW
  54215 type LPPAGESETUPDLGW = uintptr
  54216 
  54217 type PAGESETUPDLG = PAGESETUPDLGA
  54218 type LPPAGESETUPDLG = LPPAGESETUPDLGA
  54219 
  54220 type PUWSTR_C = uintptr
  54221 
  54222 type _SERVICE_DESCRIPTIONA = struct{ FlpDescription LPSTR }
  54223 
  54224 type SERVICE_DESCRIPTIONA = _SERVICE_DESCRIPTIONA
  54225 type LPSERVICE_DESCRIPTIONA = uintptr
  54226 
  54227 type _SERVICE_DESCRIPTIONW = struct{ FlpDescription LPWSTR }
  54228 
  54229 type SERVICE_DESCRIPTIONW = _SERVICE_DESCRIPTIONW
  54230 type LPSERVICE_DESCRIPTIONW = uintptr
  54231 
  54232 type SERVICE_DESCRIPTION = SERVICE_DESCRIPTIONA
  54233 type LPSERVICE_DESCRIPTION = LPSERVICE_DESCRIPTIONA
  54234 
  54235 type SC_ACTION_TYPE = uint32
  54236 
  54237 type _SC_ACTION = struct {
  54238 	FType  SC_ACTION_TYPE
  54239 	FDelay DWORD
  54240 }
  54241 
  54242 type SC_ACTION = _SC_ACTION
  54243 type LPSC_ACTION = uintptr
  54244 
  54245 type _SERVICE_FAILURE_ACTIONSA = struct {
  54246 	FdwResetPeriod DWORD
  54247 	F__ccgo_pad1   [4]byte
  54248 	FlpRebootMsg   LPSTR
  54249 	FlpCommand     LPSTR
  54250 	FcActions      DWORD
  54251 	F__ccgo_pad2   [4]byte
  54252 	FlpsaActions   uintptr
  54253 }
  54254 
  54255 type SERVICE_FAILURE_ACTIONSA = _SERVICE_FAILURE_ACTIONSA
  54256 type LPSERVICE_FAILURE_ACTIONSA = uintptr
  54257 
  54258 type _SERVICE_FAILURE_ACTIONSW = struct {
  54259 	FdwResetPeriod DWORD
  54260 	F__ccgo_pad1   [4]byte
  54261 	FlpRebootMsg   LPWSTR
  54262 	FlpCommand     LPWSTR
  54263 	FcActions      DWORD
  54264 	F__ccgo_pad2   [4]byte
  54265 	FlpsaActions   uintptr
  54266 }
  54267 
  54268 type SERVICE_FAILURE_ACTIONSW = _SERVICE_FAILURE_ACTIONSW
  54269 type LPSERVICE_FAILURE_ACTIONSW = uintptr
  54270 
  54271 type SERVICE_FAILURE_ACTIONS = SERVICE_FAILURE_ACTIONSA
  54272 type LPSERVICE_FAILURE_ACTIONS = LPSERVICE_FAILURE_ACTIONSA
  54273 
  54274 type SC_HANDLE__ = struct{ Funused int32 }
  54275 
  54276 type SC_HANDLE = uintptr
  54277 type LPSC_HANDLE = uintptr
  54278 
  54279 type SERVICE_STATUS_HANDLE__ = struct{ Funused int32 }
  54280 
  54281 type SERVICE_STATUS_HANDLE = uintptr
  54282 
  54283 type SC_STATUS_TYPE = uint32
  54284 
  54285 type SC_ENUM_TYPE = uint32
  54286 
  54287 type _SERVICE_STATUS = struct {
  54288 	FdwServiceType             DWORD
  54289 	FdwCurrentState            DWORD
  54290 	FdwControlsAccepted        DWORD
  54291 	FdwWin32ExitCode           DWORD
  54292 	FdwServiceSpecificExitCode DWORD
  54293 	FdwCheckPoint              DWORD
  54294 	FdwWaitHint                DWORD
  54295 }
  54296 
  54297 type SERVICE_STATUS = _SERVICE_STATUS
  54298 type LPSERVICE_STATUS = uintptr
  54299 
  54300 type _SERVICE_STATUS_PROCESS = struct {
  54301 	FdwServiceType             DWORD
  54302 	FdwCurrentState            DWORD
  54303 	FdwControlsAccepted        DWORD
  54304 	FdwWin32ExitCode           DWORD
  54305 	FdwServiceSpecificExitCode DWORD
  54306 	FdwCheckPoint              DWORD
  54307 	FdwWaitHint                DWORD
  54308 	FdwProcessId               DWORD
  54309 	FdwServiceFlags            DWORD
  54310 }
  54311 
  54312 type SERVICE_STATUS_PROCESS = _SERVICE_STATUS_PROCESS
  54313 type LPSERVICE_STATUS_PROCESS = uintptr
  54314 
  54315 type _ENUM_SERVICE_STATUSA = struct {
  54316 	FlpServiceName LPSTR
  54317 	FlpDisplayName LPSTR
  54318 	FServiceStatus SERVICE_STATUS
  54319 	F__ccgo_pad1   [4]byte
  54320 }
  54321 
  54322 type ENUM_SERVICE_STATUSA = _ENUM_SERVICE_STATUSA
  54323 type LPENUM_SERVICE_STATUSA = uintptr
  54324 
  54325 type _ENUM_SERVICE_STATUSW = struct {
  54326 	FlpServiceName LPWSTR
  54327 	FlpDisplayName LPWSTR
  54328 	FServiceStatus SERVICE_STATUS
  54329 	F__ccgo_pad1   [4]byte
  54330 }
  54331 
  54332 type ENUM_SERVICE_STATUSW = _ENUM_SERVICE_STATUSW
  54333 type LPENUM_SERVICE_STATUSW = uintptr
  54334 
  54335 type ENUM_SERVICE_STATUS = ENUM_SERVICE_STATUSA
  54336 type LPENUM_SERVICE_STATUS = LPENUM_SERVICE_STATUSA
  54337 
  54338 type _ENUM_SERVICE_STATUS_PROCESSA = struct {
  54339 	FlpServiceName        LPSTR
  54340 	FlpDisplayName        LPSTR
  54341 	FServiceStatusProcess SERVICE_STATUS_PROCESS
  54342 	F__ccgo_pad1          [4]byte
  54343 }
  54344 
  54345 type ENUM_SERVICE_STATUS_PROCESSA = _ENUM_SERVICE_STATUS_PROCESSA
  54346 type LPENUM_SERVICE_STATUS_PROCESSA = uintptr
  54347 
  54348 type _ENUM_SERVICE_STATUS_PROCESSW = struct {
  54349 	FlpServiceName        LPWSTR
  54350 	FlpDisplayName        LPWSTR
  54351 	FServiceStatusProcess SERVICE_STATUS_PROCESS
  54352 	F__ccgo_pad1          [4]byte
  54353 }
  54354 
  54355 type ENUM_SERVICE_STATUS_PROCESSW = _ENUM_SERVICE_STATUS_PROCESSW
  54356 type LPENUM_SERVICE_STATUS_PROCESSW = uintptr
  54357 
  54358 type ENUM_SERVICE_STATUS_PROCESS = ENUM_SERVICE_STATUS_PROCESSA
  54359 type LPENUM_SERVICE_STATUS_PROCESS = LPENUM_SERVICE_STATUS_PROCESSA
  54360 
  54361 type SC_LOCK = LPVOID
  54362 
  54363 type _QUERY_SERVICE_LOCK_STATUSA = struct {
  54364 	FfIsLocked      DWORD
  54365 	F__ccgo_pad1    [4]byte
  54366 	FlpLockOwner    LPSTR
  54367 	FdwLockDuration DWORD
  54368 	F__ccgo_pad2    [4]byte
  54369 }
  54370 
  54371 type QUERY_SERVICE_LOCK_STATUSA = _QUERY_SERVICE_LOCK_STATUSA
  54372 type LPQUERY_SERVICE_LOCK_STATUSA = uintptr
  54373 
  54374 type _QUERY_SERVICE_LOCK_STATUSW = struct {
  54375 	FfIsLocked      DWORD
  54376 	F__ccgo_pad1    [4]byte
  54377 	FlpLockOwner    LPWSTR
  54378 	FdwLockDuration DWORD
  54379 	F__ccgo_pad2    [4]byte
  54380 }
  54381 
  54382 type QUERY_SERVICE_LOCK_STATUSW = _QUERY_SERVICE_LOCK_STATUSW
  54383 type LPQUERY_SERVICE_LOCK_STATUSW = uintptr
  54384 
  54385 type QUERY_SERVICE_LOCK_STATUS = QUERY_SERVICE_LOCK_STATUSA
  54386 type LPQUERY_SERVICE_LOCK_STATUS = LPQUERY_SERVICE_LOCK_STATUSA
  54387 
  54388 type _QUERY_SERVICE_CONFIGA = struct {
  54389 	FdwServiceType      DWORD
  54390 	FdwStartType        DWORD
  54391 	FdwErrorControl     DWORD
  54392 	F__ccgo_pad1        [4]byte
  54393 	FlpBinaryPathName   LPSTR
  54394 	FlpLoadOrderGroup   LPSTR
  54395 	FdwTagId            DWORD
  54396 	F__ccgo_pad2        [4]byte
  54397 	FlpDependencies     LPSTR
  54398 	FlpServiceStartName LPSTR
  54399 	FlpDisplayName      LPSTR
  54400 }
  54401 
  54402 type QUERY_SERVICE_CONFIGA = _QUERY_SERVICE_CONFIGA
  54403 type LPQUERY_SERVICE_CONFIGA = uintptr
  54404 
  54405 type _QUERY_SERVICE_CONFIGW = struct {
  54406 	FdwServiceType      DWORD
  54407 	FdwStartType        DWORD
  54408 	FdwErrorControl     DWORD
  54409 	F__ccgo_pad1        [4]byte
  54410 	FlpBinaryPathName   LPWSTR
  54411 	FlpLoadOrderGroup   LPWSTR
  54412 	FdwTagId            DWORD
  54413 	F__ccgo_pad2        [4]byte
  54414 	FlpDependencies     LPWSTR
  54415 	FlpServiceStartName LPWSTR
  54416 	FlpDisplayName      LPWSTR
  54417 }
  54418 
  54419 type QUERY_SERVICE_CONFIGW = _QUERY_SERVICE_CONFIGW
  54420 type LPQUERY_SERVICE_CONFIGW = uintptr
  54421 
  54422 type QUERY_SERVICE_CONFIG = QUERY_SERVICE_CONFIGA
  54423 type LPQUERY_SERVICE_CONFIG = LPQUERY_SERVICE_CONFIGA
  54424 
  54425 type LPSERVICE_MAIN_FUNCTIONW = uintptr
  54426 type LPSERVICE_MAIN_FUNCTIONA = uintptr
  54427 
  54428 type _SERVICE_TABLE_ENTRYA = struct {
  54429 	FlpServiceName LPSTR
  54430 	FlpServiceProc LPSERVICE_MAIN_FUNCTIONA
  54431 }
  54432 
  54433 type SERVICE_TABLE_ENTRYA = _SERVICE_TABLE_ENTRYA
  54434 type LPSERVICE_TABLE_ENTRYA = uintptr
  54435 
  54436 type _SERVICE_TABLE_ENTRYW = struct {
  54437 	FlpServiceName LPWSTR
  54438 	FlpServiceProc LPSERVICE_MAIN_FUNCTIONW
  54439 }
  54440 
  54441 type SERVICE_TABLE_ENTRYW = _SERVICE_TABLE_ENTRYW
  54442 type LPSERVICE_TABLE_ENTRYW = uintptr
  54443 
  54444 type SERVICE_TABLE_ENTRY = SERVICE_TABLE_ENTRYA
  54445 type LPSERVICE_TABLE_ENTRY = LPSERVICE_TABLE_ENTRYA
  54446 
  54447 type LPHANDLER_FUNCTION = uintptr
  54448 type LPHANDLER_FUNCTION_EX = uintptr
  54449 
  54450 type _MODEMDEVCAPS = struct {
  54451 	FdwActualSize              DWORD
  54452 	FdwRequiredSize            DWORD
  54453 	FdwDevSpecificOffset       DWORD
  54454 	FdwDevSpecificSize         DWORD
  54455 	FdwModemProviderVersion    DWORD
  54456 	FdwModemManufacturerOffset DWORD
  54457 	FdwModemManufacturerSize   DWORD
  54458 	FdwModemModelOffset        DWORD
  54459 	FdwModemModelSize          DWORD
  54460 	FdwModemVersionOffset      DWORD
  54461 	FdwModemVersionSize        DWORD
  54462 	FdwDialOptions             DWORD
  54463 	FdwCallSetupFailTimer      DWORD
  54464 	FdwInactivityTimeout       DWORD
  54465 	FdwSpeakerVolume           DWORD
  54466 	FdwSpeakerMode             DWORD
  54467 	FdwModemOptions            DWORD
  54468 	FdwMaxDTERate              DWORD
  54469 	FdwMaxDCERate              DWORD
  54470 	FabVariablePortion         [1]BYTE
  54471 	F__ccgo_pad1               [3]byte
  54472 }
  54473 
  54474 type MODEMDEVCAPS = _MODEMDEVCAPS
  54475 type PMODEMDEVCAPS = uintptr
  54476 type LPMODEMDEVCAPS = uintptr
  54477 
  54478 type _MODEMSETTINGS = struct {
  54479 	FdwActualSize             DWORD
  54480 	FdwRequiredSize           DWORD
  54481 	FdwDevSpecificOffset      DWORD
  54482 	FdwDevSpecificSize        DWORD
  54483 	FdwCallSetupFailTimer     DWORD
  54484 	FdwInactivityTimeout      DWORD
  54485 	FdwSpeakerVolume          DWORD
  54486 	FdwSpeakerMode            DWORD
  54487 	FdwPreferredModemOptions  DWORD
  54488 	FdwNegotiatedModemOptions DWORD
  54489 	FdwNegotiatedDCERate      DWORD
  54490 	FabVariablePortion        [1]BYTE
  54491 	F__ccgo_pad1              [3]byte
  54492 }
  54493 
  54494 type MODEMSETTINGS = _MODEMSETTINGS
  54495 type PMODEMSETTINGS = uintptr
  54496 type LPMODEMSETTINGS = uintptr
  54497 
  54498 type HIMC__ = struct{ Funused int32 }
  54499 
  54500 type HIMC = uintptr
  54501 type HIMCC__ = struct{ Funused int32 }
  54502 
  54503 type HIMCC = uintptr
  54504 
  54505 type LPHKL = uintptr
  54506 
  54507 type tagCOMPOSITIONFORM = struct {
  54508 	FdwStyle      DWORD
  54509 	FptCurrentPos POINT
  54510 	FrcArea       RECT
  54511 }
  54512 
  54513 type COMPOSITIONFORM = tagCOMPOSITIONFORM
  54514 type PCOMPOSITIONFORM = uintptr
  54515 type NPCOMPOSITIONFORM = uintptr
  54516 type LPCOMPOSITIONFORM = uintptr
  54517 
  54518 type tagCANDIDATEFORM = struct {
  54519 	FdwIndex      DWORD
  54520 	FdwStyle      DWORD
  54521 	FptCurrentPos POINT
  54522 	FrcArea       RECT
  54523 }
  54524 
  54525 type CANDIDATEFORM = tagCANDIDATEFORM
  54526 type PCANDIDATEFORM = uintptr
  54527 type NPCANDIDATEFORM = uintptr
  54528 type LPCANDIDATEFORM = uintptr
  54529 
  54530 type tagCANDIDATELIST = struct {
  54531 	FdwSize      DWORD
  54532 	FdwStyle     DWORD
  54533 	FdwCount     DWORD
  54534 	FdwSelection DWORD
  54535 	FdwPageStart DWORD
  54536 	FdwPageSize  DWORD
  54537 	FdwOffset    [1]DWORD
  54538 }
  54539 
  54540 type CANDIDATELIST = tagCANDIDATELIST
  54541 type PCANDIDATELIST = uintptr
  54542 type NPCANDIDATELIST = uintptr
  54543 type LPCANDIDATELIST = uintptr
  54544 
  54545 type tagREGISTERWORDA = struct {
  54546 	FlpReading LPSTR
  54547 	FlpWord    LPSTR
  54548 }
  54549 
  54550 type REGISTERWORDA = tagREGISTERWORDA
  54551 type PREGISTERWORDA = uintptr
  54552 type NPREGISTERWORDA = uintptr
  54553 type LPREGISTERWORDA = uintptr
  54554 
  54555 type tagREGISTERWORDW = struct {
  54556 	FlpReading LPWSTR
  54557 	FlpWord    LPWSTR
  54558 }
  54559 
  54560 type REGISTERWORDW = tagREGISTERWORDW
  54561 type PREGISTERWORDW = uintptr
  54562 type NPREGISTERWORDW = uintptr
  54563 type LPREGISTERWORDW = uintptr
  54564 
  54565 type REGISTERWORD = REGISTERWORDA
  54566 type PREGISTERWORD = PREGISTERWORDA
  54567 type NPREGISTERWORD = NPREGISTERWORDA
  54568 type LPREGISTERWORD = LPREGISTERWORDA
  54569 
  54570 type tagRECONVERTSTRING = struct {
  54571 	FdwSize            DWORD
  54572 	FdwVersion         DWORD
  54573 	FdwStrLen          DWORD
  54574 	FdwStrOffset       DWORD
  54575 	FdwCompStrLen      DWORD
  54576 	FdwCompStrOffset   DWORD
  54577 	FdwTargetStrLen    DWORD
  54578 	FdwTargetStrOffset DWORD
  54579 }
  54580 
  54581 type RECONVERTSTRING = tagRECONVERTSTRING
  54582 type PRECONVERTSTRING = uintptr
  54583 type NPRECONVERTSTRING = uintptr
  54584 type LPRECONVERTSTRING = uintptr
  54585 
  54586 type tagSTYLEBUFA = struct {
  54587 	FdwStyle       DWORD
  54588 	FszDescription [32]CHAR
  54589 }
  54590 
  54591 type STYLEBUFA = tagSTYLEBUFA
  54592 type PSTYLEBUFA = uintptr
  54593 type NPSTYLEBUFA = uintptr
  54594 type LPSTYLEBUFA = uintptr
  54595 
  54596 type tagSTYLEBUFW = struct {
  54597 	FdwStyle       DWORD
  54598 	FszDescription [32]WCHAR
  54599 }
  54600 
  54601 type STYLEBUFW = tagSTYLEBUFW
  54602 type PSTYLEBUFW = uintptr
  54603 type NPSTYLEBUFW = uintptr
  54604 type LPSTYLEBUFW = uintptr
  54605 
  54606 type STYLEBUF = STYLEBUFA
  54607 type PSTYLEBUF = PSTYLEBUFA
  54608 type NPSTYLEBUF = NPSTYLEBUFA
  54609 type LPSTYLEBUF = LPSTYLEBUFA
  54610 
  54611 type tagIMEMENUITEMINFOA = struct {
  54612 	FcbSize        UINT
  54613 	FfType         UINT
  54614 	FfState        UINT
  54615 	FwID           UINT
  54616 	FhbmpChecked   HBITMAP
  54617 	FhbmpUnchecked HBITMAP
  54618 	FdwItemData    DWORD
  54619 	FszString      [80]CHAR
  54620 	F__ccgo_pad1   [4]byte
  54621 	FhbmpItem      HBITMAP
  54622 }
  54623 
  54624 type IMEMENUITEMINFOA = tagIMEMENUITEMINFOA
  54625 type PIMEMENUITEMINFOA = uintptr
  54626 type NPIMEMENUITEMINFOA = uintptr
  54627 type LPIMEMENUITEMINFOA = uintptr
  54628 
  54629 type tagIMEMENUITEMINFOW = struct {
  54630 	FcbSize        UINT
  54631 	FfType         UINT
  54632 	FfState        UINT
  54633 	FwID           UINT
  54634 	FhbmpChecked   HBITMAP
  54635 	FhbmpUnchecked HBITMAP
  54636 	FdwItemData    DWORD
  54637 	FszString      [80]WCHAR
  54638 	F__ccgo_pad1   [4]byte
  54639 	FhbmpItem      HBITMAP
  54640 }
  54641 
  54642 type IMEMENUITEMINFOW = tagIMEMENUITEMINFOW
  54643 type PIMEMENUITEMINFOW = uintptr
  54644 type NPIMEMENUITEMINFOW = uintptr
  54645 type LPIMEMENUITEMINFOW = uintptr
  54646 
  54647 type IMEMENUITEMINFO = IMEMENUITEMINFOA
  54648 type PIMEMENUITEMINFO = PIMEMENUITEMINFOA
  54649 type NPIMEMENUITEMINFO = NPIMEMENUITEMINFOA
  54650 type LPIMEMENUITEMINFO = LPIMEMENUITEMINFOA
  54651 
  54652 type tagIMECHARPOSITION = struct {
  54653 	FdwSize      DWORD
  54654 	FdwCharPos   DWORD
  54655 	Fpt          POINT
  54656 	FcLineHeight UINT
  54657 	FrcDocument  RECT
  54658 }
  54659 
  54660 type IMECHARPOSITION = tagIMECHARPOSITION
  54661 type PIMECHARPOSITION = uintptr
  54662 type NPIMECHARPOSITION = uintptr
  54663 type LPIMECHARPOSITION = uintptr
  54664 
  54665 type IMCENUMPROC = uintptr
  54666 
  54667 type REGISTERWORDENUMPROCA = uintptr
  54668 type REGISTERWORDENUMPROCW = uintptr
  54669 
  54670 // Attempt to release up to n bytes of non-essential memory currently
  54671 // held by SQLite. An example of non-essential memory is memory used to
  54672 // cache database pages that are not currently in use.
  54673 func Xsqlite3_release_memory(tls *libc.TLS, n int32) int32 {
  54674 	return Xsqlite3PcacheReleaseMemory(tls, n)
  54675 }
  54676 
  54677 // State information local to the memory allocation subsystem.
  54678 type Mem0Global = struct {
  54679 	Fmutex          uintptr
  54680 	FalarmThreshold Sqlite3_int64
  54681 	FhardLimit      Sqlite3_int64
  54682 	FnearlyFull     int32
  54683 	F__ccgo_pad1    [4]byte
  54684 }
  54685 
  54686 var mem0 = Mem0Global{}
  54687 
  54688 // Return the memory allocator mutex. sqlite3_status() needs it.
  54689 func Xsqlite3MallocMutex(tls *libc.TLS) uintptr {
  54690 	return mem0.Fmutex
  54691 }
  54692 
  54693 // Deprecated external interface.  It used to set an alarm callback
  54694 // that was invoked when memory usage grew too large.  Now it is a
  54695 // no-op.
  54696 func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThreshold Sqlite3_int64) int32 {
  54697 	_ = xCallback
  54698 	_ = pArg
  54699 	_ = iThreshold
  54700 	return SQLITE_OK
  54701 }
  54702 
  54703 // Set the soft heap-size limit for the library.  An argument of
  54704 // zero disables the limit.  A negative argument is a no-op used to
  54705 // obtain the return value.
  54706 //
  54707 // The return value is the value of the heap limit just before this
  54708 // interface was called.
  54709 //
  54710 // If the hard heap limit is enabled, then the soft heap limit cannot
  54711 // be disabled nor raised above the hard heap limit.
  54712 func Xsqlite3_soft_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64 {
  54713 	var priorLimit Sqlite3_int64
  54714 	var excess Sqlite3_int64
  54715 	var nUsed Sqlite3_int64
  54716 	var rc int32 = Xsqlite3_initialize(tls)
  54717 	if rc != 0 {
  54718 		return int64(-1)
  54719 	}
  54720 	Xsqlite3_mutex_enter(tls, mem0.Fmutex)
  54721 	priorLimit = mem0.FalarmThreshold
  54722 	if n < int64(0) {
  54723 		Xsqlite3_mutex_leave(tls, mem0.Fmutex)
  54724 		return priorLimit
  54725 	}
  54726 	if mem0.FhardLimit > int64(0) && (n > mem0.FhardLimit || n == int64(0)) {
  54727 		n = mem0.FhardLimit
  54728 	}
  54729 	mem0.FalarmThreshold = n
  54730 	nUsed = Xsqlite3StatusValue(tls, SQLITE_STATUS_MEMORY_USED)
  54731 	libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&mem0))+24, libc.Bool32(n > int64(0) && n <= nUsed), 0)
  54732 	Xsqlite3_mutex_leave(tls, mem0.Fmutex)
  54733 	excess = Xsqlite3_memory_used(tls) - n
  54734 	if excess > int64(0) {
  54735 		Xsqlite3_release_memory(tls, int32(excess&int64(0x7fffffff)))
  54736 	}
  54737 	return priorLimit
  54738 }
  54739 
  54740 func Xsqlite3_soft_heap_limit(tls *libc.TLS, n int32) {
  54741 	if n < 0 {
  54742 		n = 0
  54743 	}
  54744 	Xsqlite3_soft_heap_limit64(tls, int64(n))
  54745 }
  54746 
  54747 // Set the hard heap-size limit for the library. An argument of zero
  54748 // disables the hard heap limit.  A negative argument is a no-op used
  54749 // to obtain the return value without affecting the hard heap limit.
  54750 //
  54751 // The return value is the value of the hard heap limit just prior to
  54752 // calling this interface.
  54753 //
  54754 // Setting the hard heap limit will also activate the soft heap limit
  54755 // and constrain the soft heap limit to be no more than the hard heap
  54756 // limit.
  54757 func Xsqlite3_hard_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64 {
  54758 	var priorLimit Sqlite3_int64
  54759 	var rc int32 = Xsqlite3_initialize(tls)
  54760 	if rc != 0 {
  54761 		return int64(-1)
  54762 	}
  54763 	Xsqlite3_mutex_enter(tls, mem0.Fmutex)
  54764 	priorLimit = mem0.FhardLimit
  54765 	if n >= int64(0) {
  54766 		mem0.FhardLimit = n
  54767 		if n < mem0.FalarmThreshold || mem0.FalarmThreshold == int64(0) {
  54768 			mem0.FalarmThreshold = n
  54769 		}
  54770 	}
  54771 	Xsqlite3_mutex_leave(tls, mem0.Fmutex)
  54772 	return priorLimit
  54773 }
  54774 
  54775 // Initialize the memory allocation subsystem.
  54776 func Xsqlite3MallocInit(tls *libc.TLS) int32 {
  54777 	var rc int32
  54778 	if Xsqlite3Config.Fm.FxMalloc == uintptr(0) {
  54779 		Xsqlite3MemSetDefault(tls)
  54780 	}
  54781 	mem0.Fmutex = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MEM)
  54782 	if Xsqlite3Config.FpPage == uintptr(0) || Xsqlite3Config.FszPage < 512 ||
  54783 		Xsqlite3Config.FnPage <= 0 {
  54784 		Xsqlite3Config.FpPage = uintptr(0)
  54785 		Xsqlite3Config.FszPage = 0
  54786 	}
  54787 	rc = (*struct {
  54788 		f func(*libc.TLS, uintptr) int32
  54789 	})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fm.FxInit})).f(tls, Xsqlite3Config.Fm.FpAppData)
  54790 	if rc != SQLITE_OK {
  54791 		libc.Xmemset(tls, uintptr(unsafe.Pointer(&mem0)), 0, uint64(unsafe.Sizeof(mem0)))
  54792 	}
  54793 	return rc
  54794 }
  54795 
  54796 // Return true if the heap is currently under memory pressure - in other
  54797 // words if the amount of heap used is close to the limit set by
  54798 // sqlite3_soft_heap_limit().
  54799 func Xsqlite3HeapNearlyFull(tls *libc.TLS) int32 {
  54800 	return libc.AtomicLoadNInt32(uintptr(unsafe.Pointer(&mem0))+24, 0)
  54801 }
  54802 
  54803 // Deinitialize the memory allocation subsystem.
  54804 func Xsqlite3MallocEnd(tls *libc.TLS) {
  54805 	if Xsqlite3Config.Fm.FxShutdown != 0 {
  54806 		(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fm.FxShutdown})).f(tls, Xsqlite3Config.Fm.FpAppData)
  54807 	}
  54808 	libc.Xmemset(tls, uintptr(unsafe.Pointer(&mem0)), 0, uint64(unsafe.Sizeof(mem0)))
  54809 }
  54810 
  54811 // Return the amount of memory currently checked out.
  54812 func Xsqlite3_memory_used(tls *libc.TLS) Sqlite3_int64 {
  54813 	bp := tls.Alloc(16)
  54814 	defer tls.Free(16)
  54815 
  54816 	Xsqlite3_status64(tls, SQLITE_STATUS_MEMORY_USED, bp, bp+8, 0)
  54817 	return *(*Sqlite3_int64)(unsafe.Pointer(bp))
  54818 }
  54819 
  54820 // Return the maximum amount of memory that has ever been
  54821 // checked out since either the beginning of this process
  54822 // or since the most recent reset.
  54823 func Xsqlite3_memory_highwater(tls *libc.TLS, resetFlag int32) Sqlite3_int64 {
  54824 	bp := tls.Alloc(16)
  54825 	defer tls.Free(16)
  54826 
  54827 	Xsqlite3_status64(tls, SQLITE_STATUS_MEMORY_USED, bp, bp+8, resetFlag)
  54828 	return *(*Sqlite3_int64)(unsafe.Pointer(bp + 8))
  54829 }
  54830 
  54831 func sqlite3MallocAlarm(tls *libc.TLS, nByte int32) {
  54832 	if mem0.FalarmThreshold <= int64(0) {
  54833 		return
  54834 	}
  54835 	Xsqlite3_mutex_leave(tls, mem0.Fmutex)
  54836 	Xsqlite3_release_memory(tls, nByte)
  54837 	Xsqlite3_mutex_enter(tls, mem0.Fmutex)
  54838 }
  54839 
  54840 func mallocWithAlarm(tls *libc.TLS, n int32, pp uintptr) {
  54841 	var p uintptr
  54842 	var nFull int32
  54843 
  54844 	nFull = (*struct{ f func(*libc.TLS, int32) int32 })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fm.FxRoundup})).f(tls, n)
  54845 
  54846 	Xsqlite3StatusHighwater(tls, SQLITE_STATUS_MALLOC_SIZE, n)
  54847 	if mem0.FalarmThreshold > int64(0) {
  54848 		var nUsed Sqlite3_int64 = Xsqlite3StatusValue(tls, SQLITE_STATUS_MEMORY_USED)
  54849 		if nUsed >= mem0.FalarmThreshold-Sqlite3_int64(nFull) {
  54850 			libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&mem0))+24, int32(1), 0)
  54851 			sqlite3MallocAlarm(tls, nFull)
  54852 			if mem0.FhardLimit != 0 {
  54853 				nUsed = Xsqlite3StatusValue(tls, SQLITE_STATUS_MEMORY_USED)
  54854 				if nUsed >= mem0.FhardLimit-Sqlite3_int64(nFull) {
  54855 					*(*uintptr)(unsafe.Pointer(pp)) = uintptr(0)
  54856 					return
  54857 				}
  54858 			}
  54859 		} else {
  54860 			libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&mem0))+24, int32(0), 0)
  54861 		}
  54862 	}
  54863 	p = (*struct {
  54864 		f func(*libc.TLS, int32) uintptr
  54865 	})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fm.FxMalloc})).f(tls, nFull)
  54866 	if p == uintptr(0) && mem0.FalarmThreshold > int64(0) {
  54867 		sqlite3MallocAlarm(tls, nFull)
  54868 		p = (*struct {
  54869 			f func(*libc.TLS, int32) uintptr
  54870 		})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fm.FxMalloc})).f(tls, nFull)
  54871 	}
  54872 	if p != 0 {
  54873 		nFull = Xsqlite3MallocSize(tls, p)
  54874 		Xsqlite3StatusUp(tls, SQLITE_STATUS_MEMORY_USED, nFull)
  54875 		Xsqlite3StatusUp(tls, SQLITE_STATUS_MALLOC_COUNT, 1)
  54876 	}
  54877 	*(*uintptr)(unsafe.Pointer(pp)) = p
  54878 }
  54879 
  54880 // Allocate memory.  This routine is like sqlite3_malloc() except that it
  54881 // assumes the memory subsystem has already been initialized.
  54882 func Xsqlite3Malloc(tls *libc.TLS, n U64) uintptr {
  54883 	bp := tls.Alloc(8)
  54884 	defer tls.Free(8)
  54885 
  54886 	if n == uint64(0) || n > uint64(SQLITE_MAX_ALLOCATION_SIZE) {
  54887 		*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
  54888 	} else if Xsqlite3Config.FbMemstat != 0 {
  54889 		Xsqlite3_mutex_enter(tls, mem0.Fmutex)
  54890 		mallocWithAlarm(tls, int32(n), bp)
  54891 		Xsqlite3_mutex_leave(tls, mem0.Fmutex)
  54892 	} else {
  54893 		*(*uintptr)(unsafe.Pointer(bp)) = (*struct {
  54894 			f func(*libc.TLS, int32) uintptr
  54895 		})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fm.FxMalloc})).f(tls, int32(n))
  54896 	}
  54897 
  54898 	return *(*uintptr)(unsafe.Pointer(bp))
  54899 }
  54900 
  54901 // This version of the memory allocation is for use by the application.
  54902 // First make sure the memory subsystem is initialized, then do the
  54903 // allocation.
  54904 func Xsqlite3_malloc(tls *libc.TLS, n int32) uintptr {
  54905 	if Xsqlite3_initialize(tls) != 0 {
  54906 		return uintptr(0)
  54907 	}
  54908 	if n <= 0 {
  54909 		return uintptr(0)
  54910 	}
  54911 	return Xsqlite3Malloc(tls, uint64(n))
  54912 }
  54913 
  54914 func Xsqlite3_malloc64(tls *libc.TLS, n Sqlite3_uint64) uintptr {
  54915 	if Xsqlite3_initialize(tls) != 0 {
  54916 		return uintptr(0)
  54917 	}
  54918 	return Xsqlite3Malloc(tls, n)
  54919 }
  54920 
  54921 func isLookaside(tls *libc.TLS, db uintptr, p uintptr) int32 {
  54922 	return libc.Bool32(Uptr(p) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) && Uptr(p) < Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd))
  54923 }
  54924 
  54925 // Return the size of a memory allocation previously obtained from
  54926 // sqlite3Malloc() or sqlite3_malloc().
  54927 func Xsqlite3MallocSize(tls *libc.TLS, p uintptr) int32 {
  54928 	return (*struct {
  54929 		f func(*libc.TLS, uintptr) int32
  54930 	})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fm.FxSize})).f(tls, p)
  54931 }
  54932 
  54933 func lookasideMallocSize(tls *libc.TLS, db uintptr, p uintptr) int32 {
  54934 	if p < (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle {
  54935 		return int32((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue)
  54936 	}
  54937 	return LOOKASIDE_SMALL
  54938 }
  54939 
  54940 func Xsqlite3DbMallocSize(tls *libc.TLS, db uintptr, p uintptr) int32 {
  54941 	if db != 0 {
  54942 		if Uptr(p) < Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd) {
  54943 			if Uptr(p) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) {
  54944 				return LOOKASIDE_SMALL
  54945 			}
  54946 			if Uptr(p) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) {
  54947 				return int32((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue)
  54948 			}
  54949 		}
  54950 	}
  54951 	return (*struct {
  54952 		f func(*libc.TLS, uintptr) int32
  54953 	})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fm.FxSize})).f(tls, p)
  54954 }
  54955 
  54956 func Xsqlite3_msize(tls *libc.TLS, p uintptr) Sqlite3_uint64 {
  54957 	if p != 0 {
  54958 		return uint64((*struct {
  54959 			f func(*libc.TLS, uintptr) int32
  54960 		})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fm.FxSize})).f(tls, p))
  54961 	}
  54962 	return uint64(0)
  54963 }
  54964 
  54965 // Free memory previously obtained from sqlite3Malloc().
  54966 func Xsqlite3_free(tls *libc.TLS, p uintptr) {
  54967 	if p == uintptr(0) {
  54968 		return
  54969 	}
  54970 
  54971 	if Xsqlite3Config.FbMemstat != 0 {
  54972 		Xsqlite3_mutex_enter(tls, mem0.Fmutex)
  54973 		Xsqlite3StatusDown(tls, SQLITE_STATUS_MEMORY_USED, Xsqlite3MallocSize(tls, p))
  54974 		Xsqlite3StatusDown(tls, SQLITE_STATUS_MALLOC_COUNT, 1)
  54975 		(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fm.FxFree})).f(tls, p)
  54976 		Xsqlite3_mutex_leave(tls, mem0.Fmutex)
  54977 	} else {
  54978 		(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fm.FxFree})).f(tls, p)
  54979 	}
  54980 }
  54981 
  54982 func measureAllocationSize(tls *libc.TLS, db uintptr, p uintptr) {
  54983 	*(*int32)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed)) += Xsqlite3DbMallocSize(tls, db, p)
  54984 }
  54985 
  54986 // Free memory that might be associated with a particular database
  54987 // connection.  Calling sqlite3DbFree(D,X) for X==0 is a harmless no-op.
  54988 // The sqlite3DbFreeNN(D,X) version requires that X be non-NULL.
  54989 func Xsqlite3DbFreeNN(tls *libc.TLS, db uintptr, p uintptr) {
  54990 	if db != 0 {
  54991 		if Uptr(p) < Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd) {
  54992 			if Uptr(p) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) {
  54993 				var pBuf uintptr = p
  54994 
  54995 				(*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext = (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree
  54996 				(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree = pBuf
  54997 				return
  54998 			}
  54999 			if Uptr(p) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) {
  55000 				var pBuf uintptr = p
  55001 
  55002 				(*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext = (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree
  55003 				(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree = pBuf
  55004 				return
  55005 			}
  55006 		}
  55007 		if (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed != 0 {
  55008 			measureAllocationSize(tls, db, p)
  55009 			return
  55010 		}
  55011 	}
  55012 
  55013 	Xsqlite3_free(tls, p)
  55014 }
  55015 
  55016 func Xsqlite3DbNNFreeNN(tls *libc.TLS, db uintptr, p uintptr) {
  55017 	if Uptr(p) < Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd) {
  55018 		if Uptr(p) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) {
  55019 			var pBuf uintptr = p
  55020 
  55021 			(*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext = (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree
  55022 			(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree = pBuf
  55023 			return
  55024 		}
  55025 		if Uptr(p) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) {
  55026 			var pBuf uintptr = p
  55027 
  55028 			(*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext = (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree
  55029 			(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree = pBuf
  55030 			return
  55031 		}
  55032 	}
  55033 	if (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed != 0 {
  55034 		measureAllocationSize(tls, db, p)
  55035 		return
  55036 	}
  55037 
  55038 	Xsqlite3_free(tls, p)
  55039 }
  55040 
  55041 func Xsqlite3DbFree(tls *libc.TLS, db uintptr, p uintptr) {
  55042 	if p != 0 {
  55043 		Xsqlite3DbFreeNN(tls, db, p)
  55044 	}
  55045 }
  55046 
  55047 // Change the size of an existing memory allocation
  55048 func Xsqlite3Realloc(tls *libc.TLS, pOld uintptr, nBytes U64) uintptr {
  55049 	var nOld int32
  55050 	var nNew int32
  55051 	var nDiff int32
  55052 	var pNew uintptr
  55053 
  55054 	if pOld == uintptr(0) {
  55055 		return Xsqlite3Malloc(tls, nBytes)
  55056 	}
  55057 	if nBytes == uint64(0) {
  55058 		Xsqlite3_free(tls, pOld)
  55059 		return uintptr(0)
  55060 	}
  55061 	if nBytes >= uint64(0x7fffff00) {
  55062 		return uintptr(0)
  55063 	}
  55064 	nOld = Xsqlite3MallocSize(tls, pOld)
  55065 
  55066 	nNew = (*struct{ f func(*libc.TLS, int32) int32 })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fm.FxRoundup})).f(tls, int32(nBytes))
  55067 	if nOld == nNew {
  55068 		pNew = pOld
  55069 	} else if Xsqlite3Config.FbMemstat != 0 {
  55070 		var nUsed Sqlite3_int64
  55071 		Xsqlite3_mutex_enter(tls, mem0.Fmutex)
  55072 		Xsqlite3StatusHighwater(tls, SQLITE_STATUS_MALLOC_SIZE, int32(nBytes))
  55073 		nDiff = nNew - nOld
  55074 		if nDiff > 0 && libc.AssignInt64(&nUsed, Xsqlite3StatusValue(tls, SQLITE_STATUS_MEMORY_USED)) >= mem0.FalarmThreshold-Sqlite3_int64(nDiff) {
  55075 			sqlite3MallocAlarm(tls, nDiff)
  55076 			if mem0.FhardLimit > int64(0) && nUsed >= mem0.FhardLimit-Sqlite3_int64(nDiff) {
  55077 				Xsqlite3_mutex_leave(tls, mem0.Fmutex)
  55078 				return uintptr(0)
  55079 			}
  55080 		}
  55081 		pNew = (*struct {
  55082 			f func(*libc.TLS, uintptr, int32) uintptr
  55083 		})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fm.FxRealloc})).f(tls, pOld, nNew)
  55084 		if pNew == uintptr(0) && mem0.FalarmThreshold > int64(0) {
  55085 			sqlite3MallocAlarm(tls, int32(nBytes))
  55086 			pNew = (*struct {
  55087 				f func(*libc.TLS, uintptr, int32) uintptr
  55088 			})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fm.FxRealloc})).f(tls, pOld, nNew)
  55089 		}
  55090 		if pNew != 0 {
  55091 			nNew = Xsqlite3MallocSize(tls, pNew)
  55092 			Xsqlite3StatusUp(tls, SQLITE_STATUS_MEMORY_USED, nNew-nOld)
  55093 		}
  55094 		Xsqlite3_mutex_leave(tls, mem0.Fmutex)
  55095 	} else {
  55096 		pNew = (*struct {
  55097 			f func(*libc.TLS, uintptr, int32) uintptr
  55098 		})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fm.FxRealloc})).f(tls, pOld, nNew)
  55099 	}
  55100 
  55101 	return pNew
  55102 }
  55103 
  55104 // The public interface to sqlite3Realloc.  Make sure that the memory
  55105 // subsystem is initialized prior to invoking sqliteRealloc.
  55106 func Xsqlite3_realloc(tls *libc.TLS, pOld uintptr, n int32) uintptr {
  55107 	if Xsqlite3_initialize(tls) != 0 {
  55108 		return uintptr(0)
  55109 	}
  55110 	if n < 0 {
  55111 		n = 0
  55112 	}
  55113 	return Xsqlite3Realloc(tls, pOld, uint64(n))
  55114 }
  55115 
  55116 func Xsqlite3_realloc64(tls *libc.TLS, pOld uintptr, n Sqlite3_uint64) uintptr {
  55117 	if Xsqlite3_initialize(tls) != 0 {
  55118 		return uintptr(0)
  55119 	}
  55120 	return Xsqlite3Realloc(tls, pOld, n)
  55121 }
  55122 
  55123 // Allocate and zero memory.
  55124 func Xsqlite3MallocZero(tls *libc.TLS, n U64) uintptr {
  55125 	var p uintptr = Xsqlite3Malloc(tls, n)
  55126 	if p != 0 {
  55127 		libc.Xmemset(tls, p, 0, n)
  55128 	}
  55129 	return p
  55130 }
  55131 
  55132 // Allocate and zero memory.  If the allocation fails, make
  55133 // the mallocFailed flag in the connection pointer.
  55134 func Xsqlite3DbMallocZero(tls *libc.TLS, db uintptr, n U64) uintptr {
  55135 	var p uintptr
  55136 
  55137 	p = Xsqlite3DbMallocRaw(tls, db, n)
  55138 	if p != 0 {
  55139 		libc.Xmemset(tls, p, 0, n)
  55140 	}
  55141 	return p
  55142 }
  55143 
  55144 func dbMallocRawFinish(tls *libc.TLS, db uintptr, n U64) uintptr {
  55145 	var p uintptr
  55146 
  55147 	p = Xsqlite3Malloc(tls, n)
  55148 	if !(p != 0) {
  55149 		Xsqlite3OomFault(tls, db)
  55150 	}
  55151 
  55152 	return p
  55153 }
  55154 
  55155 // Allocate memory, either lookaside (if possible) or heap.
  55156 // If the allocation fails, set the mallocFailed flag in
  55157 // the connection pointer.
  55158 //
  55159 // If db!=0 and db->mallocFailed is true (indicating a prior malloc
  55160 // failure on the same database connection) then always return 0.
  55161 // Hence for a particular database connection, once malloc starts
  55162 // failing, it fails consistently until mallocFailed is reset.
  55163 // This is an important assumption.  There are many places in the
  55164 // code that do things like this:
  55165 //
  55166 //	int *a = (int*)sqlite3DbMallocRaw(db, 100);
  55167 //	int *b = (int*)sqlite3DbMallocRaw(db, 200);
  55168 //	if( b ) a[10] = 9;
  55169 //
  55170 // In other words, if a subsequent malloc (ex: "b") worked, it is assumed
  55171 // that all prior mallocs (ex: "a") worked too.
  55172 //
  55173 // The sqlite3MallocRawNN() variant guarantees that the "db" parameter is
  55174 // not a NULL pointer.
  55175 func Xsqlite3DbMallocRaw(tls *libc.TLS, db uintptr, n U64) uintptr {
  55176 	var p uintptr
  55177 	if db != 0 {
  55178 		return Xsqlite3DbMallocRawNN(tls, db, n)
  55179 	}
  55180 	p = Xsqlite3Malloc(tls, n)
  55181 
  55182 	return p
  55183 }
  55184 
  55185 func Xsqlite3DbMallocRawNN(tls *libc.TLS, db uintptr, n U64) uintptr {
  55186 	var pBuf uintptr
  55187 
  55188 	if n > U64((*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz) {
  55189 		if !(int32((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable) != 0) {
  55190 			*(*U32)(unsafe.Pointer(db + 440 + 16 + 1*4))++
  55191 		} else if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
  55192 			return uintptr(0)
  55193 		}
  55194 		return dbMallocRawFinish(tls, db, n)
  55195 	}
  55196 	if n <= uint64(LOOKASIDE_SMALL) {
  55197 		if libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree) != uintptr(0) {
  55198 			(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree = (*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext
  55199 			*(*U32)(unsafe.Pointer(db + 440 + 16))++
  55200 			return pBuf
  55201 		} else if libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit) != uintptr(0) {
  55202 			(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit = (*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext
  55203 			*(*U32)(unsafe.Pointer(db + 440 + 16))++
  55204 			return pBuf
  55205 		}
  55206 	}
  55207 	if libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree) != uintptr(0) {
  55208 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree = (*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext
  55209 		*(*U32)(unsafe.Pointer(db + 440 + 16))++
  55210 		return pBuf
  55211 	} else if libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit) != uintptr(0) {
  55212 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit = (*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext
  55213 		*(*U32)(unsafe.Pointer(db + 440 + 16))++
  55214 		return pBuf
  55215 	} else {
  55216 		*(*U32)(unsafe.Pointer(db + 440 + 16 + 2*4))++
  55217 	}
  55218 	return dbMallocRawFinish(tls, db, n)
  55219 }
  55220 
  55221 // Resize the block of memory pointed to by p to n bytes. If the
  55222 // resize fails, set the mallocFailed flag in the connection object.
  55223 func Xsqlite3DbRealloc(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr {
  55224 	if p == uintptr(0) {
  55225 		return Xsqlite3DbMallocRawNN(tls, db, n)
  55226 	}
  55227 
  55228 	if Uptr(p) < Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd) {
  55229 		if Uptr(p) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) {
  55230 			if n <= uint64(LOOKASIDE_SMALL) {
  55231 				return p
  55232 			}
  55233 		} else if Uptr(p) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) {
  55234 			if n <= U64((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue) {
  55235 				return p
  55236 			}
  55237 		}
  55238 	}
  55239 	return dbReallocFinish(tls, db, p, n)
  55240 }
  55241 
  55242 func dbReallocFinish(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr {
  55243 	var pNew uintptr = uintptr(0)
  55244 
  55245 	if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 {
  55246 		if isLookaside(tls, db, p) != 0 {
  55247 			pNew = Xsqlite3DbMallocRawNN(tls, db, n)
  55248 			if pNew != 0 {
  55249 				libc.Xmemcpy(tls, pNew, p, uint64(lookasideMallocSize(tls, db, p)))
  55250 				Xsqlite3DbFree(tls, db, p)
  55251 			}
  55252 		} else {
  55253 			pNew = Xsqlite3Realloc(tls, p, n)
  55254 			if !(pNew != 0) {
  55255 				Xsqlite3OomFault(tls, db)
  55256 			}
  55257 
  55258 		}
  55259 	}
  55260 	return pNew
  55261 }
  55262 
  55263 // Attempt to reallocate p.  If the reallocation fails, then free p
  55264 // and set the mallocFailed flag in the database connection.
  55265 func Xsqlite3DbReallocOrFree(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr {
  55266 	var pNew uintptr
  55267 	pNew = Xsqlite3DbRealloc(tls, db, p, n)
  55268 	if !(pNew != 0) {
  55269 		Xsqlite3DbFree(tls, db, p)
  55270 	}
  55271 	return pNew
  55272 }
  55273 
  55274 // Make a copy of a string in memory obtained from sqliteMalloc(). These
  55275 // functions call sqlite3MallocRaw() directly instead of sqliteMalloc(). This
  55276 // is because when memory debugging is turned on, these two functions are
  55277 // called via macros that record the current file and line number in the
  55278 // ThreadData structure.
  55279 func Xsqlite3DbStrDup(tls *libc.TLS, db uintptr, z uintptr) uintptr {
  55280 	var zNew uintptr
  55281 	var n Size_t
  55282 	if z == uintptr(0) {
  55283 		return uintptr(0)
  55284 	}
  55285 	n = libc.Xstrlen(tls, z) + uint64(1)
  55286 	zNew = Xsqlite3DbMallocRaw(tls, db, n)
  55287 	if zNew != 0 {
  55288 		libc.Xmemcpy(tls, zNew, z, n)
  55289 	}
  55290 	return zNew
  55291 }
  55292 
  55293 func Xsqlite3DbStrNDup(tls *libc.TLS, db uintptr, z uintptr, n U64) uintptr {
  55294 	var zNew uintptr
  55295 
  55296 	if z != 0 {
  55297 		zNew = Xsqlite3DbMallocRawNN(tls, db, n+uint64(1))
  55298 	} else {
  55299 		zNew = uintptr(0)
  55300 	}
  55301 	if zNew != 0 {
  55302 		libc.Xmemcpy(tls, zNew, z, n)
  55303 		*(*int8)(unsafe.Pointer(zNew + uintptr(n))) = int8(0)
  55304 	}
  55305 	return zNew
  55306 }
  55307 
  55308 // The text between zStart and zEnd represents a phrase within a larger
  55309 // SQL statement.  Make a copy of this phrase in space obtained form
  55310 // sqlite3DbMalloc().  Omit leading and trailing whitespace.
  55311 func Xsqlite3DbSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) uintptr {
  55312 	var n int32
  55313 	for int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zStart)))])&0x01 != 0 {
  55314 		zStart++
  55315 	}
  55316 	n = int32((int64(zEnd) - int64(zStart)) / 1)
  55317 	for int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zStart + uintptr(n-1))))])&0x01 != 0 {
  55318 		n--
  55319 	}
  55320 	return Xsqlite3DbStrNDup(tls, db, zStart, uint64(n))
  55321 }
  55322 
  55323 // Free any prior content in *pz and replace it with a copy of zNew.
  55324 func Xsqlite3SetString(tls *libc.TLS, pz uintptr, db uintptr, zNew uintptr) {
  55325 	var z uintptr = Xsqlite3DbStrDup(tls, db, zNew)
  55326 	Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pz)))
  55327 	*(*uintptr)(unsafe.Pointer(pz)) = z
  55328 }
  55329 
  55330 // Call this routine to record the fact that an OOM (out-of-memory) error
  55331 // has happened.  This routine will set db->mallocFailed, and also
  55332 // temporarily disable the lookaside memory allocator and interrupt
  55333 // any running VDBEs.
  55334 //
  55335 // Always return a NULL pointer so that this routine can be invoked using
  55336 //
  55337 //	return sqlite3OomFault(db);
  55338 //
  55339 // and thereby avoid unnecessary stack frame allocations for the overwhelmingly
  55340 // common case where no OOM occurs.
  55341 func Xsqlite3OomFault(tls *libc.TLS, db uintptr) uintptr {
  55342 	if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 && int32((*Sqlite3)(unsafe.Pointer(db)).FbBenignMalloc) == 0 {
  55343 		(*Sqlite3)(unsafe.Pointer(db)).FmallocFailed = U8(1)
  55344 		if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec > 0 {
  55345 			libc.AtomicStoreNInt32(db+432, int32(1), 0)
  55346 		}
  55347 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++
  55348 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0)
  55349 		if (*Sqlite3)(unsafe.Pointer(db)).FpParse != 0 {
  55350 			var pParse uintptr
  55351 			Xsqlite3ErrorMsg(tls, (*Sqlite3)(unsafe.Pointer(db)).FpParse, ts+1480, 0)
  55352 			(*Parse)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FpParse)).Frc = SQLITE_NOMEM
  55353 			for pParse = (*Parse)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FpParse)).FpOuterParse; pParse != 0; pParse = (*Parse)(unsafe.Pointer(pParse)).FpOuterParse {
  55354 				(*Parse)(unsafe.Pointer(pParse)).FnErr++
  55355 				(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_NOMEM
  55356 			}
  55357 		}
  55358 	}
  55359 	return uintptr(0)
  55360 }
  55361 
  55362 // This routine reactivates the memory allocator and clears the
  55363 // db->mallocFailed flag as necessary.
  55364 //
  55365 // The memory allocator is not restarted if there are running
  55366 // VDBEs.
  55367 func Xsqlite3OomClear(tls *libc.TLS, db uintptr) {
  55368 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 && (*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec == 0 {
  55369 		(*Sqlite3)(unsafe.Pointer(db)).FmallocFailed = U8(0)
  55370 		libc.AtomicStoreNInt32(db+432, int32(0), 0)
  55371 
  55372 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable--
  55373 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = func() uint16 {
  55374 			if (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable != 0 {
  55375 				return uint16(0)
  55376 			}
  55377 			return (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue
  55378 		}()
  55379 	}
  55380 }
  55381 
  55382 func apiHandleError(tls *libc.TLS, db uintptr, rc int32) int32 {
  55383 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 || rc == SQLITE_IOERR|int32(12)<<8 {
  55384 		Xsqlite3OomClear(tls, db)
  55385 		Xsqlite3Error(tls, db, SQLITE_NOMEM)
  55386 		return SQLITE_NOMEM
  55387 	}
  55388 	return rc & (*Sqlite3)(unsafe.Pointer(db)).FerrMask
  55389 }
  55390 
  55391 // This function must be called before exiting any API function (i.e.
  55392 // returning control to the user) that has called sqlite3_malloc or
  55393 // sqlite3_realloc.
  55394 //
  55395 // The returned value is normally a copy of the second argument to this
  55396 // function. However, if a malloc() failure has occurred since the previous
  55397 // invocation SQLITE_NOMEM is returned instead.
  55398 //
  55399 // If an OOM as occurred, then the connection error-code (the value
  55400 // returned by sqlite3_errcode()) is set to SQLITE_NOMEM.
  55401 func Xsqlite3ApiExit(tls *libc.TLS, db uintptr, rc int32) int32 {
  55402 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 || rc != 0 {
  55403 		return apiHandleError(tls, db, rc)
  55404 	}
  55405 	return rc & (*Sqlite3)(unsafe.Pointer(db)).FerrMask
  55406 }
  55407 
  55408 // An "etByte" is an 8-bit unsigned value.
  55409 type EtByte = uint8
  55410 
  55411 type et_info = struct {
  55412 	Ffmttype int8
  55413 	Fbase    EtByte
  55414 	Fflags   EtByte
  55415 	Ftype    EtByte
  55416 	Fcharset EtByte
  55417 	Fprefix  EtByte
  55418 }
  55419 
  55420 // Each builtin conversion character (ex: the 'd' in "%d") is described
  55421 // by an instance of the following structure
  55422 type Et_info = et_info
  55423 
  55424 var aDigits = *(*[33]int8)(unsafe.Pointer(ts + 1494))
  55425 var aPrefix = *(*[7]int8)(unsafe.Pointer(ts + 1527))
  55426 var fmtinfo = [23]Et_info{
  55427 	{Ffmttype: int8('d'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtByte(EtDECIMAL)},
  55428 	{Ffmttype: int8('s'), Fflags: EtByte(4), Ftype: EtByte(EtSTRING)},
  55429 	{Ffmttype: int8('g'), Fflags: EtByte(1), Ftype: EtByte(EtGENERIC), Fcharset: EtByte(30)},
  55430 	{Ffmttype: int8('z'), Fflags: EtByte(4), Ftype: EtByte(EtDYNSTRING)},
  55431 	{Ffmttype: int8('q'), Fflags: EtByte(4), Ftype: EtByte(EtSQLESCAPE)},
  55432 	{Ffmttype: int8('Q'), Fflags: EtByte(4), Ftype: EtByte(EtSQLESCAPE2)},
  55433 	{Ffmttype: int8('w'), Fflags: EtByte(4), Ftype: EtByte(EtSQLESCAPE3)},
  55434 	{Ffmttype: int8('c'), Ftype: EtByte(EtCHARX)},
  55435 	{Ffmttype: int8('o'), Fbase: EtByte(8), Fprefix: EtByte(2)},
  55436 	{Ffmttype: int8('u'), Fbase: EtByte(10), Ftype: EtByte(EtDECIMAL)},
  55437 	{Ffmttype: int8('x'), Fbase: EtByte(16), Fcharset: EtByte(16), Fprefix: EtByte(1)},
  55438 	{Ffmttype: int8('X'), Fbase: EtByte(16), Fprefix: EtByte(4)},
  55439 	{Ffmttype: int8('f'), Fflags: EtByte(1), Ftype: EtByte(EtFLOAT)},
  55440 	{Ffmttype: int8('e'), Fflags: EtByte(1), Ftype: EtByte(EtEXP), Fcharset: EtByte(30)},
  55441 	{Ffmttype: int8('E'), Fflags: EtByte(1), Ftype: EtByte(EtEXP), Fcharset: EtByte(14)},
  55442 	{Ffmttype: int8('G'), Fflags: EtByte(1), Ftype: EtByte(EtGENERIC), Fcharset: EtByte(14)},
  55443 	{Ffmttype: int8('i'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtByte(EtDECIMAL)},
  55444 	{Ffmttype: int8('n'), Ftype: EtByte(EtSIZE)},
  55445 	{Ffmttype: int8('%'), Ftype: EtByte(EtPERCENT)},
  55446 	{Ffmttype: int8('p'), Fbase: EtByte(16), Ftype: EtByte(EtPOINTER), Fprefix: EtByte(1)},
  55447 	{Ffmttype: int8('T'), Ftype: EtByte(EtTOKEN)},
  55448 	{Ffmttype: int8('S'), Ftype: EtByte(EtSRCITEM)},
  55449 	{Ffmttype: int8('r'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtByte(EtORDINAL)},
  55450 }
  55451 
  55452 var arRound = [10]float64{
  55453 	5.0e-01, 5.0e-02, 5.0e-03, 5.0e-04, 5.0e-05,
  55454 	5.0e-06, 5.0e-07, 5.0e-08, 5.0e-09, 5.0e-10,
  55455 }
  55456 
  55457 func et_getdigit(tls *libc.TLS, val uintptr, cnt uintptr) int8 {
  55458 	var digit int32
  55459 	var d float64
  55460 	if *(*int32)(unsafe.Pointer(cnt)) <= 0 {
  55461 		return int8('0')
  55462 	}
  55463 	*(*int32)(unsafe.Pointer(cnt))--
  55464 	digit = int32(*(*float64)(unsafe.Pointer(val)))
  55465 	d = float64(digit)
  55466 	digit = digit + '0'
  55467 	*(*float64)(unsafe.Pointer(val)) = (*(*float64)(unsafe.Pointer(val)) - d) * 10.0
  55468 	return int8(digit)
  55469 }
  55470 
  55471 // Set the StrAccum object to an error mode.
  55472 func Xsqlite3StrAccumSetError(tls *libc.TLS, p uintptr, eError U8) {
  55473 	(*StrAccum)(unsafe.Pointer(p)).FaccError = eError
  55474 	if (*StrAccum)(unsafe.Pointer(p)).FmxAlloc != 0 {
  55475 		Xsqlite3_str_reset(tls, p)
  55476 	}
  55477 	if int32(eError) == SQLITE_TOOBIG {
  55478 		Xsqlite3ErrorToParser(tls, (*StrAccum)(unsafe.Pointer(p)).Fdb, int32(eError))
  55479 	}
  55480 }
  55481 
  55482 func getIntArg(tls *libc.TLS, p uintptr) Sqlite3_int64 {
  55483 	if (*PrintfArguments)(unsafe.Pointer(p)).FnArg <= (*PrintfArguments)(unsafe.Pointer(p)).FnUsed {
  55484 		return int64(0)
  55485 	}
  55486 	return Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer((*PrintfArguments)(unsafe.Pointer(p)).FapArg + uintptr(libc.PostIncInt32(&(*PrintfArguments)(unsafe.Pointer(p)).FnUsed, 1))*8)))
  55487 }
  55488 
  55489 func getDoubleArg(tls *libc.TLS, p uintptr) float64 {
  55490 	if (*PrintfArguments)(unsafe.Pointer(p)).FnArg <= (*PrintfArguments)(unsafe.Pointer(p)).FnUsed {
  55491 		return 0.0
  55492 	}
  55493 	return Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer((*PrintfArguments)(unsafe.Pointer(p)).FapArg + uintptr(libc.PostIncInt32(&(*PrintfArguments)(unsafe.Pointer(p)).FnUsed, 1))*8)))
  55494 }
  55495 
  55496 func getTextArg(tls *libc.TLS, p uintptr) uintptr {
  55497 	if (*PrintfArguments)(unsafe.Pointer(p)).FnArg <= (*PrintfArguments)(unsafe.Pointer(p)).FnUsed {
  55498 		return uintptr(0)
  55499 	}
  55500 	return Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer((*PrintfArguments)(unsafe.Pointer(p)).FapArg + uintptr(libc.PostIncInt32(&(*PrintfArguments)(unsafe.Pointer(p)).FnUsed, 1))*8)))
  55501 }
  55502 
  55503 func printfTempBuf(tls *libc.TLS, pAccum uintptr, n Sqlite3_int64) uintptr {
  55504 	var z uintptr
  55505 	if (*Sqlite3_str)(unsafe.Pointer(pAccum)).FaccError != 0 {
  55506 		return uintptr(0)
  55507 	}
  55508 	if n > Sqlite3_int64((*Sqlite3_str)(unsafe.Pointer(pAccum)).FnAlloc) && n > Sqlite3_int64((*Sqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc) {
  55509 		Xsqlite3StrAccumSetError(tls, pAccum, uint8(SQLITE_TOOBIG))
  55510 		return uintptr(0)
  55511 	}
  55512 	z = Xsqlite3DbMallocRaw(tls, (*Sqlite3_str)(unsafe.Pointer(pAccum)).Fdb, uint64(n))
  55513 	if z == uintptr(0) {
  55514 		Xsqlite3StrAccumSetError(tls, pAccum, uint8(SQLITE_NOMEM))
  55515 	}
  55516 	return z
  55517 }
  55518 
  55519 // Render a string given by "fmt" into the StrAccum object.
  55520 func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Va_list) {
  55521 	bp := tls.Alloc(116)
  55522 	defer tls.Free(116)
  55523 
  55524 	var c int32
  55525 	var bufpt uintptr
  55526 	var precision int32
  55527 	var length int32
  55528 	var idx int32
  55529 	var width int32
  55530 	var flag_leftjustify EtByte
  55531 	var flag_prefix EtByte
  55532 	var flag_alternateform EtByte
  55533 	var flag_altform2 EtByte
  55534 	var flag_zeropad EtByte
  55535 	var flag_long EtByte
  55536 	var done EtByte
  55537 	var cThousand EtByte
  55538 	var xtype EtByte
  55539 	var bArgList U8
  55540 	var prefix int8
  55541 	var longvalue Sqlite_uint64
  55542 
  55543 	var infop uintptr
  55544 	var zOut uintptr
  55545 	var nOut int32
  55546 	var zExtra uintptr
  55547 	var exp int32
  55548 	var e2 int32
  55549 
  55550 	var rounder float64
  55551 	var flag_dp EtByte
  55552 	var flag_rtz EtByte
  55553 	var pArgList uintptr
  55554 
  55555 	var wx uint32
  55556 	var px uint32
  55557 	var v I64
  55558 	var n U64
  55559 	var x int32
  55560 	var cset uintptr
  55561 	var base U8
  55562 	var nn int32
  55563 	var ix int32
  55564 	var pre uintptr
  55565 	var x1 int8
  55566 
  55567 	var ex int32
  55568 	var scale float64
  55569 	var szBufNeeded I64
  55570 	var i int32
  55571 	var nPad int32
  55572 	var ch uint32
  55573 	var nCopyBytes I64
  55574 	var nPrior I64
  55575 
  55576 	var z uintptr
  55577 
  55578 	var ii int32
  55579 	var i1 I64
  55580 	var j I64
  55581 	var k I64
  55582 	var n1 I64
  55583 	var needQuote int32
  55584 	var isnull int32
  55585 	var ch1 int8
  55586 	var q int8
  55587 	var escarg uintptr
  55588 
  55589 	var pExpr uintptr
  55590 
  55591 	var pToken uintptr
  55592 	var pSel uintptr
  55593 	var pItem uintptr
  55594 	xtype = EtByte(EtINVALID)
  55595 	zExtra = uintptr(0)
  55596 	pArgList = uintptr(0)
  55597 
  55598 	bufpt = uintptr(0)
  55599 	if !(int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FprintfFlags)&SQLITE_PRINTF_SQLFUNC != 0) {
  55600 		goto __1
  55601 	}
  55602 	pArgList = libc.VaUintptr(&ap)
  55603 	bArgList = U8(1)
  55604 	goto __2
  55605 __1:
  55606 	bArgList = U8(0)
  55607 __2:
  55608 	;
  55609 __3:
  55610 	if !(libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(fmt)))) != 0) {
  55611 		goto __5
  55612 	}
  55613 	if !(c != '%') {
  55614 		goto __6
  55615 	}
  55616 	bufpt = fmt
  55617 __7:
  55618 	fmt++
  55619 	goto __8
  55620 __8:
  55621 	if *(*int8)(unsafe.Pointer(fmt)) != 0 && int32(*(*int8)(unsafe.Pointer(fmt))) != '%' {
  55622 		goto __7
  55623 	}
  55624 	goto __9
  55625 __9:
  55626 	;
  55627 	Xsqlite3_str_append(tls, pAccum, bufpt, int32((int64(fmt)-int64(bufpt))/1))
  55628 	if !(int32(*(*int8)(unsafe.Pointer(fmt))) == 0) {
  55629 		goto __10
  55630 	}
  55631 	goto __5
  55632 __10:
  55633 	;
  55634 __6:
  55635 	;
  55636 	if !(libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1))))) == 0) {
  55637 		goto __11
  55638 	}
  55639 	Xsqlite3_str_append(tls, pAccum, ts+1534, 1)
  55640 	goto __5
  55641 __11:
  55642 	;
  55643 	flag_leftjustify = libc.AssignUint8(&flag_prefix, libc.AssignUint8(&cThousand, libc.AssignUint8(&flag_alternateform, libc.AssignUint8(&flag_altform2, libc.AssignUint8(&flag_zeropad, EtByte(0))))))
  55644 	done = EtByte(0)
  55645 	width = 0
  55646 	flag_long = EtByte(0)
  55647 	precision = -1
  55648 __12:
  55649 	switch c {
  55650 	case '-':
  55651 		goto __16
  55652 	case '+':
  55653 		goto __17
  55654 	case ' ':
  55655 		goto __18
  55656 	case '#':
  55657 		goto __19
  55658 	case '!':
  55659 		goto __20
  55660 	case '0':
  55661 		goto __21
  55662 	case ',':
  55663 		goto __22
  55664 	default:
  55665 		goto __23
  55666 	case 'l':
  55667 		goto __24
  55668 	case '1':
  55669 		goto __25
  55670 	case '2':
  55671 		goto __26
  55672 	case '3':
  55673 		goto __27
  55674 	case '4':
  55675 		goto __28
  55676 	case '5':
  55677 		goto __29
  55678 	case '6':
  55679 		goto __30
  55680 	case '7':
  55681 		goto __31
  55682 	case '8':
  55683 		goto __32
  55684 	case '9':
  55685 		goto __33
  55686 	case '*':
  55687 		goto __34
  55688 	case '.':
  55689 		goto __35
  55690 	}
  55691 	goto __15
  55692 __16:
  55693 	flag_leftjustify = EtByte(1)
  55694 	goto __15
  55695 __17:
  55696 	flag_prefix = EtByte('+')
  55697 	goto __15
  55698 __18:
  55699 	flag_prefix = EtByte(' ')
  55700 	goto __15
  55701 __19:
  55702 	flag_alternateform = EtByte(1)
  55703 	goto __15
  55704 __20:
  55705 	flag_altform2 = EtByte(1)
  55706 	goto __15
  55707 __21:
  55708 	flag_zeropad = EtByte(1)
  55709 	goto __15
  55710 __22:
  55711 	cThousand = EtByte(',')
  55712 	goto __15
  55713 __23:
  55714 	done = EtByte(1)
  55715 	goto __15
  55716 __24:
  55717 	flag_long = EtByte(1)
  55718 	c = int32(*(*int8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1))))
  55719 	if !(c == 'l') {
  55720 		goto __36
  55721 	}
  55722 	c = int32(*(*int8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1))))
  55723 	flag_long = EtByte(2)
  55724 __36:
  55725 	;
  55726 	done = EtByte(1)
  55727 	goto __15
  55728 
  55729 __25:
  55730 __26:
  55731 __27:
  55732 __28:
  55733 __29:
  55734 __30:
  55735 __31:
  55736 __32:
  55737 __33:
  55738 	wx = uint32(c - '0')
  55739 __37:
  55740 	if !(libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1))))) >= '0' && c <= '9') {
  55741 		goto __38
  55742 	}
  55743 	wx = wx*uint32(10) + uint32(c) - uint32('0')
  55744 	goto __37
  55745 __38:
  55746 	;
  55747 	width = int32(wx & uint32(0x7fffffff))
  55748 	if !(c != '.' && c != 'l') {
  55749 		goto __39
  55750 	}
  55751 	done = EtByte(1)
  55752 	goto __40
  55753 __39:
  55754 	fmt--
  55755 __40:
  55756 	;
  55757 	goto __15
  55758 
  55759 __34:
  55760 	if !(bArgList != 0) {
  55761 		goto __41
  55762 	}
  55763 	width = int32(getIntArg(tls, pArgList))
  55764 	goto __42
  55765 __41:
  55766 	width = libc.VaInt32(&ap)
  55767 __42:
  55768 	;
  55769 	if !(width < 0) {
  55770 		goto __43
  55771 	}
  55772 	flag_leftjustify = EtByte(1)
  55773 	if width >= -2147483647 {
  55774 		width = -width
  55775 	} else {
  55776 		width = 0
  55777 	}
  55778 __43:
  55779 	;
  55780 	if !(libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(fmt + 1)))) != '.' && c != 'l') {
  55781 		goto __44
  55782 	}
  55783 	c = int32(*(*int8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1))))
  55784 	done = EtByte(1)
  55785 __44:
  55786 	;
  55787 	goto __15
  55788 
  55789 __35:
  55790 	c = int32(*(*int8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1))))
  55791 	if !(c == '*') {
  55792 		goto __45
  55793 	}
  55794 	if !(bArgList != 0) {
  55795 		goto __47
  55796 	}
  55797 	precision = int32(getIntArg(tls, pArgList))
  55798 	goto __48
  55799 __47:
  55800 	precision = libc.VaInt32(&ap)
  55801 __48:
  55802 	;
  55803 	if !(precision < 0) {
  55804 		goto __49
  55805 	}
  55806 	if precision >= -2147483647 {
  55807 		precision = -precision
  55808 	} else {
  55809 		precision = -1
  55810 	}
  55811 __49:
  55812 	;
  55813 	c = int32(*(*int8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1))))
  55814 	goto __46
  55815 __45:
  55816 	px = uint32(0)
  55817 __50:
  55818 	if !(c >= '0' && c <= '9') {
  55819 		goto __51
  55820 	}
  55821 	px = px*uint32(10) + uint32(c) - uint32('0')
  55822 	c = int32(*(*int8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1))))
  55823 	goto __50
  55824 __51:
  55825 	;
  55826 	precision = int32(px & uint32(0x7fffffff))
  55827 __46:
  55828 	;
  55829 	if !(c == 'l') {
  55830 		goto __52
  55831 	}
  55832 	fmt--
  55833 	goto __53
  55834 __52:
  55835 	done = EtByte(1)
  55836 __53:
  55837 	;
  55838 	goto __15
  55839 
  55840 __15:
  55841 	;
  55842 	goto __13
  55843 __13:
  55844 	if !(done != 0) && libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1))))) != 0 {
  55845 		goto __12
  55846 	}
  55847 	goto __14
  55848 __14:
  55849 	;
  55850 	infop = uintptr(unsafe.Pointer(&fmtinfo))
  55851 	xtype = EtByte(EtINVALID)
  55852 	idx = 0
  55853 __54:
  55854 	if !(idx < int32(uint64(unsafe.Sizeof(fmtinfo))/uint64(unsafe.Sizeof(Et_info{})))) {
  55855 		goto __56
  55856 	}
  55857 	if !(c == int32(fmtinfo[idx].Ffmttype)) {
  55858 		goto __57
  55859 	}
  55860 	infop = uintptr(unsafe.Pointer(&fmtinfo)) + uintptr(idx)*6
  55861 	xtype = (*Et_info)(unsafe.Pointer(infop)).Ftype
  55862 	goto __56
  55863 __57:
  55864 	;
  55865 	goto __55
  55866 __55:
  55867 	idx++
  55868 	goto __54
  55869 	goto __56
  55870 __56:
  55871 	;
  55872 	switch int32(xtype) {
  55873 	case EtPOINTER:
  55874 		goto __59
  55875 	case EtORDINAL:
  55876 		goto __60
  55877 	case EtRADIX:
  55878 		goto __61
  55879 	case EtDECIMAL:
  55880 		goto __62
  55881 	case EtFLOAT:
  55882 		goto __63
  55883 	case EtEXP:
  55884 		goto __64
  55885 	case EtGENERIC:
  55886 		goto __65
  55887 	case EtSIZE:
  55888 		goto __66
  55889 	case EtPERCENT:
  55890 		goto __67
  55891 	case EtCHARX:
  55892 		goto __68
  55893 	case EtSTRING:
  55894 		goto __69
  55895 	case EtDYNSTRING:
  55896 		goto __70
  55897 	case EtSQLESCAPE:
  55898 		goto __71
  55899 	case EtSQLESCAPE2:
  55900 		goto __72
  55901 	case EtSQLESCAPE3:
  55902 		goto __73
  55903 	case EtTOKEN:
  55904 		goto __74
  55905 	case EtSRCITEM:
  55906 		goto __75
  55907 	default:
  55908 		goto __76
  55909 	}
  55910 	goto __58
  55911 __59:
  55912 	if uint64(unsafe.Sizeof(uintptr(0))) == uint64(unsafe.Sizeof(I64(0))) {
  55913 		flag_long = uint8(2)
  55914 	} else {
  55915 		if uint64(unsafe.Sizeof(uintptr(0))) == uint64(unsafe.Sizeof(int32(0))) {
  55916 			flag_long = uint8(1)
  55917 		} else {
  55918 			flag_long = uint8(0)
  55919 		}
  55920 	}
  55921 __60:
  55922 __61:
  55923 	cThousand = EtByte(0)
  55924 __62:
  55925 	if !(int32((*Et_info)(unsafe.Pointer(infop)).Fflags)&FLAG_SIGNED != 0) {
  55926 		goto __77
  55927 	}
  55928 	if !(bArgList != 0) {
  55929 		goto __79
  55930 	}
  55931 	v = getIntArg(tls, pArgList)
  55932 	goto __80
  55933 __79:
  55934 	if !(flag_long != 0) {
  55935 		goto __81
  55936 	}
  55937 	if !(int32(flag_long) == 2) {
  55938 		goto __83
  55939 	}
  55940 	v = libc.VaInt64(&ap)
  55941 	goto __84
  55942 __83:
  55943 	v = I64(libc.VaInt32(&ap))
  55944 __84:
  55945 	;
  55946 	goto __82
  55947 __81:
  55948 	v = I64(libc.VaInt32(&ap))
  55949 __82:
  55950 	;
  55951 __80:
  55952 	;
  55953 	if !(v < int64(0)) {
  55954 		goto __85
  55955 	}
  55956 
  55957 	longvalue = Sqlite_uint64(^v)
  55958 	longvalue++
  55959 	prefix = int8('-')
  55960 	goto __86
  55961 __85:
  55962 	longvalue = Sqlite_uint64(v)
  55963 	prefix = int8(flag_prefix)
  55964 __86:
  55965 	;
  55966 	goto __78
  55967 __77:
  55968 	if !(bArgList != 0) {
  55969 		goto __87
  55970 	}
  55971 	longvalue = U64(getIntArg(tls, pArgList))
  55972 	goto __88
  55973 __87:
  55974 	if !(flag_long != 0) {
  55975 		goto __89
  55976 	}
  55977 	if !(int32(flag_long) == 2) {
  55978 		goto __91
  55979 	}
  55980 	longvalue = libc.VaUint64(&ap)
  55981 	goto __92
  55982 __91:
  55983 	longvalue = Sqlite_uint64(libc.VaUint32(&ap))
  55984 __92:
  55985 	;
  55986 	goto __90
  55987 __89:
  55988 	longvalue = Sqlite_uint64(libc.VaUint32(&ap))
  55989 __90:
  55990 	;
  55991 __88:
  55992 	;
  55993 	prefix = int8(0)
  55994 __78:
  55995 	;
  55996 	if !(longvalue == uint64(0)) {
  55997 		goto __93
  55998 	}
  55999 	flag_alternateform = EtByte(0)
  56000 __93:
  56001 	;
  56002 	if !(flag_zeropad != 0 && precision < width-libc.Bool32(int32(prefix) != 0)) {
  56003 		goto __94
  56004 	}
  56005 	precision = width - libc.Bool32(int32(prefix) != 0)
  56006 __94:
  56007 	;
  56008 	if !(precision < SQLITE_PRINT_BUF_SIZE-10-SQLITE_PRINT_BUF_SIZE/3) {
  56009 		goto __95
  56010 	}
  56011 	nOut = SQLITE_PRINT_BUF_SIZE
  56012 	zOut = bp + 16
  56013 	goto __96
  56014 __95:
  56015 	n = U64(precision) + uint64(10)
  56016 	if !(cThousand != 0) {
  56017 		goto __97
  56018 	}
  56019 	n = n + U64(precision/3)
  56020 __97:
  56021 	;
  56022 	zOut = libc.AssignUintptr(&zExtra, printfTempBuf(tls, pAccum, int64(n)))
  56023 	if !(zOut == uintptr(0)) {
  56024 		goto __98
  56025 	}
  56026 	return
  56027 __98:
  56028 	;
  56029 	nOut = int32(n)
  56030 __96:
  56031 	;
  56032 	bufpt = zOut + uintptr(nOut-1)
  56033 	if !(int32(xtype) == EtORDINAL) {
  56034 		goto __99
  56035 	}
  56036 	x = int32(longvalue % uint64(10))
  56037 	if !(x >= 4 || longvalue/uint64(10)%uint64(10) == uint64(1)) {
  56038 		goto __100
  56039 	}
  56040 	x = 0
  56041 __100:
  56042 	;
  56043 	*(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = zOrd[x*2+1]
  56044 	*(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = zOrd[x*2]
  56045 __99:
  56046 	;
  56047 	cset = uintptr(unsafe.Pointer(&aDigits)) + uintptr((*Et_info)(unsafe.Pointer(infop)).Fcharset)
  56048 	base = (*Et_info)(unsafe.Pointer(infop)).Fbase
  56049 __101:
  56050 	*(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = *(*int8)(unsafe.Pointer(cset + uintptr(longvalue%Sqlite_uint64(base))))
  56051 	longvalue = longvalue / Sqlite_uint64(base)
  56052 	goto __102
  56053 __102:
  56054 	if longvalue > uint64(0) {
  56055 		goto __101
  56056 	}
  56057 	goto __103
  56058 __103:
  56059 	;
  56060 	length = int32((int64(zOut+uintptr(nOut-1)) - int64(bufpt)) / 1)
  56061 __104:
  56062 	if !(precision > length) {
  56063 		goto __105
  56064 	}
  56065 	*(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = int8('0')
  56066 	length++
  56067 	goto __104
  56068 __105:
  56069 	;
  56070 	if !(cThousand != 0) {
  56071 		goto __106
  56072 	}
  56073 	nn = (length - 1) / 3
  56074 	ix = (length-1)%3 + 1
  56075 	bufpt -= uintptr(nn)
  56076 	idx = 0
  56077 __107:
  56078 	if !(nn > 0) {
  56079 		goto __109
  56080 	}
  56081 	*(*int8)(unsafe.Pointer(bufpt + uintptr(idx))) = *(*int8)(unsafe.Pointer(bufpt + uintptr(idx+nn)))
  56082 	ix--
  56083 	if !(ix == 0) {
  56084 		goto __110
  56085 	}
  56086 	*(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PreIncInt32(&idx, 1)))) = int8(cThousand)
  56087 	nn--
  56088 	ix = 3
  56089 __110:
  56090 	;
  56091 	goto __108
  56092 __108:
  56093 	idx++
  56094 	goto __107
  56095 	goto __109
  56096 __109:
  56097 	;
  56098 __106:
  56099 	;
  56100 	if !(prefix != 0) {
  56101 		goto __111
  56102 	}
  56103 	*(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = prefix
  56104 __111:
  56105 	;
  56106 	if !(flag_alternateform != 0 && (*Et_info)(unsafe.Pointer(infop)).Fprefix != 0) {
  56107 		goto __112
  56108 	}
  56109 	pre = uintptr(unsafe.Pointer(&aPrefix)) + uintptr((*Et_info)(unsafe.Pointer(infop)).Fprefix)
  56110 __113:
  56111 	if !(int32(libc.AssignInt8(&x1, *(*int8)(unsafe.Pointer(pre)))) != 0) {
  56112 		goto __115
  56113 	}
  56114 	*(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = x1
  56115 	goto __114
  56116 __114:
  56117 	pre++
  56118 	goto __113
  56119 	goto __115
  56120 __115:
  56121 	;
  56122 __112:
  56123 	;
  56124 	length = int32((int64(zOut+uintptr(nOut-1)) - int64(bufpt)) / 1)
  56125 	goto __58
  56126 __63:
  56127 __64:
  56128 __65:
  56129 	if !(bArgList != 0) {
  56130 		goto __116
  56131 	}
  56132 	*(*float64)(unsafe.Pointer(bp + 104)) = getDoubleArg(tls, pArgList)
  56133 	goto __117
  56134 __116:
  56135 	*(*float64)(unsafe.Pointer(bp + 104)) = libc.VaFloat64(&ap)
  56136 __117:
  56137 	;
  56138 	if !(precision < 0) {
  56139 		goto __118
  56140 	}
  56141 	precision = 6
  56142 __118:
  56143 	;
  56144 	if !(precision > SQLITE_FP_PRECISION_LIMIT) {
  56145 		goto __119
  56146 	}
  56147 	precision = SQLITE_FP_PRECISION_LIMIT
  56148 __119:
  56149 	;
  56150 	if !(*(*float64)(unsafe.Pointer(bp + 104)) < 0.0) {
  56151 		goto __120
  56152 	}
  56153 	*(*float64)(unsafe.Pointer(bp + 104)) = -*(*float64)(unsafe.Pointer(bp + 104))
  56154 	prefix = int8('-')
  56155 	goto __121
  56156 __120:
  56157 	prefix = int8(flag_prefix)
  56158 __121:
  56159 	;
  56160 	if !(int32(xtype) == EtGENERIC && precision > 0) {
  56161 		goto __122
  56162 	}
  56163 	precision--
  56164 __122:
  56165 	;
  56166 	idx = precision & 0xfff
  56167 	rounder = arRound[idx%10]
  56168 __123:
  56169 	if !(idx >= 10) {
  56170 		goto __124
  56171 	}
  56172 	rounder = rounder * 1.0e-10
  56173 	idx = idx - 10
  56174 	goto __123
  56175 __124:
  56176 	;
  56177 	if !(int32(xtype) == EtFLOAT) {
  56178 		goto __125
  56179 	}
  56180 	*(*float64)(unsafe.Pointer(bp + 96)) = *(*float64)(unsafe.Pointer(bp + 104))
  56181 	libc.Xmemcpy(tls, bp+88, bp+96, uint64(unsafe.Sizeof(Sqlite3_uint64(0))))
  56182 	ex = -1023 + int32(*(*Sqlite3_uint64)(unsafe.Pointer(bp + 88))>>52&uint64(0x7ff))
  56183 	if !(precision+ex/3 < 15) {
  56184 		goto __126
  56185 	}
  56186 	rounder = rounder + *(*float64)(unsafe.Pointer(bp + 104))*3e-16
  56187 __126:
  56188 	;
  56189 	*(*float64)(unsafe.Pointer(bp + 104)) += rounder
  56190 __125:
  56191 	;
  56192 	exp = 0
  56193 	if !(Xsqlite3IsNaN(tls, *(*float64)(unsafe.Pointer(bp + 104))) != 0) {
  56194 		goto __127
  56195 	}
  56196 	bufpt = ts + 1536
  56197 	length = 3
  56198 	goto __58
  56199 __127:
  56200 	;
  56201 	if !(*(*float64)(unsafe.Pointer(bp + 104)) > 0.0) {
  56202 		goto __128
  56203 	}
  56204 	scale = 1.0
  56205 __129:
  56206 	if !(*(*float64)(unsafe.Pointer(bp + 104)) >= 1e100*scale && exp <= 350) {
  56207 		goto __130
  56208 	}
  56209 	scale = scale * 1e100
  56210 	exp = exp + 100
  56211 	goto __129
  56212 __130:
  56213 	;
  56214 __131:
  56215 	if !(*(*float64)(unsafe.Pointer(bp + 104)) >= 1e10*scale && exp <= 350) {
  56216 		goto __132
  56217 	}
  56218 	scale = scale * 1e10
  56219 	exp = exp + 10
  56220 	goto __131
  56221 __132:
  56222 	;
  56223 __133:
  56224 	if !(*(*float64)(unsafe.Pointer(bp + 104)) >= 10.0*scale && exp <= 350) {
  56225 		goto __134
  56226 	}
  56227 	scale = scale * 10.0
  56228 	exp++
  56229 	goto __133
  56230 __134:
  56231 	;
  56232 	*(*float64)(unsafe.Pointer(bp + 104)) /= scale
  56233 __135:
  56234 	if !(*(*float64)(unsafe.Pointer(bp + 104)) < 1e-8) {
  56235 		goto __136
  56236 	}
  56237 	*(*float64)(unsafe.Pointer(bp + 104)) *= 1e8
  56238 	exp = exp - 8
  56239 	goto __135
  56240 __136:
  56241 	;
  56242 __137:
  56243 	if !(*(*float64)(unsafe.Pointer(bp + 104)) < 1.0) {
  56244 		goto __138
  56245 	}
  56246 	*(*float64)(unsafe.Pointer(bp + 104)) *= 10.0
  56247 	exp--
  56248 	goto __137
  56249 __138:
  56250 	;
  56251 	if !(exp > 350) {
  56252 		goto __139
  56253 	}
  56254 	bufpt = bp + 16
  56255 	*(*int8)(unsafe.Pointer(bp + 16)) = prefix
  56256 	libc.Xmemcpy(tls, bp+16+uintptr(libc.Bool32(int32(prefix) != 0)), ts+1540, uint64(4))
  56257 	length = 3 + libc.Bool32(int32(prefix) != 0)
  56258 	goto __58
  56259 __139:
  56260 	;
  56261 __128:
  56262 	;
  56263 	bufpt = bp + 16
  56264 
  56265 	if !(int32(xtype) != EtFLOAT) {
  56266 		goto __140
  56267 	}
  56268 	*(*float64)(unsafe.Pointer(bp + 104)) += rounder
  56269 	if !(*(*float64)(unsafe.Pointer(bp + 104)) >= 10.0) {
  56270 		goto __141
  56271 	}
  56272 	*(*float64)(unsafe.Pointer(bp + 104)) *= 0.1
  56273 	exp++
  56274 __141:
  56275 	;
  56276 __140:
  56277 	;
  56278 	if !(int32(xtype) == EtGENERIC) {
  56279 		goto __142
  56280 	}
  56281 	flag_rtz = libc.BoolUint8(!(flag_alternateform != 0))
  56282 	if !(exp < -4 || exp > precision) {
  56283 		goto __144
  56284 	}
  56285 	xtype = EtByte(EtEXP)
  56286 	goto __145
  56287 __144:
  56288 	precision = precision - exp
  56289 	xtype = EtByte(EtFLOAT)
  56290 __145:
  56291 	;
  56292 	goto __143
  56293 __142:
  56294 	flag_rtz = flag_altform2
  56295 __143:
  56296 	;
  56297 	if !(int32(xtype) == EtEXP) {
  56298 		goto __146
  56299 	}
  56300 	e2 = 0
  56301 	goto __147
  56302 __146:
  56303 	e2 = exp
  56304 __147:
  56305 	;
  56306 	szBufNeeded = func() int64 {
  56307 		if e2 > 0 {
  56308 			return int64(e2)
  56309 		}
  56310 		return int64(0)
  56311 	}() + I64(precision) + I64(width) + int64(15)
  56312 	if !(szBufNeeded > int64(SQLITE_PRINT_BUF_SIZE)) {
  56313 		goto __148
  56314 	}
  56315 	bufpt = libc.AssignUintptr(&zExtra, printfTempBuf(tls, pAccum, szBufNeeded))
  56316 	if !(bufpt == uintptr(0)) {
  56317 		goto __149
  56318 	}
  56319 	return
  56320 __149:
  56321 	;
  56322 __148:
  56323 	;
  56324 	zOut = bufpt
  56325 	*(*int32)(unsafe.Pointer(bp + 112)) = 16 + int32(flag_altform2)*10
  56326 	flag_dp = EtByte(func() int32 {
  56327 		if precision > 0 {
  56328 			return 1
  56329 		}
  56330 		return 0
  56331 	}() | int32(flag_alternateform) | int32(flag_altform2))
  56332 
  56333 	if !(prefix != 0) {
  56334 		goto __150
  56335 	}
  56336 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = prefix
  56337 __150:
  56338 	;
  56339 	if !(e2 < 0) {
  56340 		goto __151
  56341 	}
  56342 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('0')
  56343 	goto __152
  56344 __151:
  56345 	;
  56346 __153:
  56347 	if !(e2 >= 0) {
  56348 		goto __155
  56349 	}
  56350 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = et_getdigit(tls, bp+104, bp+112)
  56351 	goto __154
  56352 __154:
  56353 	e2--
  56354 	goto __153
  56355 	goto __155
  56356 __155:
  56357 	;
  56358 __152:
  56359 	;
  56360 	if !(flag_dp != 0) {
  56361 		goto __156
  56362 	}
  56363 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('.')
  56364 __156:
  56365 	;
  56366 	e2++
  56367 __157:
  56368 	if !(e2 < 0) {
  56369 		goto __159
  56370 	}
  56371 
  56372 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('0')
  56373 	goto __158
  56374 __158:
  56375 	precision--
  56376 	e2++
  56377 	goto __157
  56378 	goto __159
  56379 __159:
  56380 	;
  56381 __160:
  56382 	if !(libc.PostDecInt32(&precision, 1) > 0) {
  56383 		goto __161
  56384 	}
  56385 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = et_getdigit(tls, bp+104, bp+112)
  56386 	goto __160
  56387 __161:
  56388 	;
  56389 	if !(flag_rtz != 0 && flag_dp != 0) {
  56390 		goto __162
  56391 	}
  56392 __163:
  56393 	if !(int32(*(*int8)(unsafe.Pointer(bufpt + libc.UintptrFromInt32(-1)))) == '0') {
  56394 		goto __164
  56395 	}
  56396 	*(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = int8(0)
  56397 	goto __163
  56398 __164:
  56399 	;
  56400 	if !(int32(*(*int8)(unsafe.Pointer(bufpt + libc.UintptrFromInt32(-1)))) == '.') {
  56401 		goto __165
  56402 	}
  56403 	if !(flag_altform2 != 0) {
  56404 		goto __166
  56405 	}
  56406 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('0')
  56407 	goto __167
  56408 __166:
  56409 	*(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = int8(0)
  56410 __167:
  56411 	;
  56412 __165:
  56413 	;
  56414 __162:
  56415 	;
  56416 	if !(int32(xtype) == EtEXP) {
  56417 		goto __168
  56418 	}
  56419 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = aDigits[(*Et_info)(unsafe.Pointer(infop)).Fcharset]
  56420 	if !(exp < 0) {
  56421 		goto __169
  56422 	}
  56423 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('-')
  56424 	exp = -exp
  56425 	goto __170
  56426 __169:
  56427 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('+')
  56428 __170:
  56429 	;
  56430 	if !(exp >= 100) {
  56431 		goto __171
  56432 	}
  56433 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8(exp/100 + '0')
  56434 	exp = exp % 100
  56435 __171:
  56436 	;
  56437 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8(exp/10 + '0')
  56438 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8(exp%10 + '0')
  56439 __168:
  56440 	;
  56441 	*(*int8)(unsafe.Pointer(bufpt)) = int8(0)
  56442 
  56443 	length = int32((int64(bufpt) - int64(zOut)) / 1)
  56444 	bufpt = zOut
  56445 
  56446 	if !(flag_zeropad != 0 && !(flag_leftjustify != 0) && length < width) {
  56447 		goto __172
  56448 	}
  56449 	nPad = width - length
  56450 	i = width
  56451 __173:
  56452 	if !(i >= nPad) {
  56453 		goto __175
  56454 	}
  56455 	*(*int8)(unsafe.Pointer(bufpt + uintptr(i))) = *(*int8)(unsafe.Pointer(bufpt + uintptr(i-nPad)))
  56456 	goto __174
  56457 __174:
  56458 	i--
  56459 	goto __173
  56460 	goto __175
  56461 __175:
  56462 	;
  56463 	i = libc.Bool32(int32(prefix) != 0)
  56464 __176:
  56465 	if !(libc.PostDecInt32(&nPad, 1) != 0) {
  56466 		goto __177
  56467 	}
  56468 	*(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostIncInt32(&i, 1)))) = int8('0')
  56469 	goto __176
  56470 __177:
  56471 	;
  56472 	length = width
  56473 __172:
  56474 	;
  56475 	goto __58
  56476 __66:
  56477 	if !!(bArgList != 0) {
  56478 		goto __178
  56479 	}
  56480 	*(*int32)(unsafe.Pointer(libc.VaUintptr(&ap))) = int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FnChar)
  56481 __178:
  56482 	;
  56483 	length = libc.AssignInt32(&width, 0)
  56484 	goto __58
  56485 __67:
  56486 	*(*int8)(unsafe.Pointer(bp + 16)) = int8('%')
  56487 	bufpt = bp + 16
  56488 	length = 1
  56489 	goto __58
  56490 __68:
  56491 	if !(bArgList != 0) {
  56492 		goto __179
  56493 	}
  56494 	bufpt = getTextArg(tls, pArgList)
  56495 	length = 1
  56496 	if !(bufpt != 0) {
  56497 		goto __181
  56498 	}
  56499 	*(*int8)(unsafe.Pointer(bp + 16)) = int8(libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))))))
  56500 	if !(c&0xc0 == 0xc0) {
  56501 		goto __183
  56502 	}
  56503 __184:
  56504 	if !(length < 4 && int32(*(*int8)(unsafe.Pointer(bufpt)))&0xc0 == 0x80) {
  56505 		goto __185
  56506 	}
  56507 	*(*int8)(unsafe.Pointer(bp + 16 + uintptr(libc.PostIncInt32(&length, 1)))) = *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1)))
  56508 	goto __184
  56509 __185:
  56510 	;
  56511 __183:
  56512 	;
  56513 	goto __182
  56514 __181:
  56515 	*(*int8)(unsafe.Pointer(bp + 16)) = int8(0)
  56516 __182:
  56517 	;
  56518 	goto __180
  56519 __179:
  56520 	ch = libc.VaUint32(&ap)
  56521 	if !(ch < uint32(0x00080)) {
  56522 		goto __186
  56523 	}
  56524 	*(*int8)(unsafe.Pointer(bp + 16)) = int8(ch & uint32(0xff))
  56525 	length = 1
  56526 	goto __187
  56527 __186:
  56528 	if !(ch < uint32(0x00800)) {
  56529 		goto __188
  56530 	}
  56531 	*(*int8)(unsafe.Pointer(bp + 16)) = int8(0xc0 + int32(U8(ch>>6&uint32(0x1f))))
  56532 	*(*int8)(unsafe.Pointer(bp + 16 + 1)) = int8(0x80 + int32(U8(ch&uint32(0x3f))))
  56533 	length = 2
  56534 	goto __189
  56535 __188:
  56536 	if !(ch < uint32(0x10000)) {
  56537 		goto __190
  56538 	}
  56539 	*(*int8)(unsafe.Pointer(bp + 16)) = int8(0xe0 + int32(U8(ch>>12&uint32(0x0f))))
  56540 	*(*int8)(unsafe.Pointer(bp + 16 + 1)) = int8(0x80 + int32(U8(ch>>6&uint32(0x3f))))
  56541 	*(*int8)(unsafe.Pointer(bp + 16 + 2)) = int8(0x80 + int32(U8(ch&uint32(0x3f))))
  56542 	length = 3
  56543 	goto __191
  56544 __190:
  56545 	*(*int8)(unsafe.Pointer(bp + 16)) = int8(0xf0 + int32(U8(ch>>18&uint32(0x07))))
  56546 	*(*int8)(unsafe.Pointer(bp + 16 + 1)) = int8(0x80 + int32(U8(ch>>12&uint32(0x3f))))
  56547 	*(*int8)(unsafe.Pointer(bp + 16 + 2)) = int8(0x80 + int32(U8(ch>>6&uint32(0x3f))))
  56548 	*(*int8)(unsafe.Pointer(bp + 16 + 3)) = int8(0x80 + int32(U8(ch&uint32(0x3f))))
  56549 	length = 4
  56550 __191:
  56551 	;
  56552 __189:
  56553 	;
  56554 __187:
  56555 	;
  56556 __180:
  56557 	;
  56558 	if !(precision > 1) {
  56559 		goto __192
  56560 	}
  56561 	nPrior = int64(1)
  56562 	width = width - (precision - 1)
  56563 	if !(width > 1 && !(flag_leftjustify != 0)) {
  56564 		goto __193
  56565 	}
  56566 	Xsqlite3_str_appendchar(tls, pAccum, width-1, int8(' '))
  56567 	width = 0
  56568 __193:
  56569 	;
  56570 	Xsqlite3_str_append(tls, pAccum, bp+16, length)
  56571 	precision--
  56572 __194:
  56573 	if !(precision > 1) {
  56574 		goto __195
  56575 	}
  56576 	if !(nPrior > I64(precision-1)) {
  56577 		goto __196
  56578 	}
  56579 	nPrior = I64(precision - 1)
  56580 __196:
  56581 	;
  56582 	nCopyBytes = I64(length) * nPrior
  56583 	if !(nCopyBytes+I64((*Sqlite3_str)(unsafe.Pointer(pAccum)).FnChar) >= I64((*Sqlite3_str)(unsafe.Pointer(pAccum)).FnAlloc)) {
  56584 		goto __197
  56585 	}
  56586 	Xsqlite3StrAccumEnlarge(tls, pAccum, nCopyBytes)
  56587 __197:
  56588 	;
  56589 	if !((*Sqlite3_str)(unsafe.Pointer(pAccum)).FaccError != 0) {
  56590 		goto __198
  56591 	}
  56592 	goto __195
  56593 __198:
  56594 	;
  56595 	Xsqlite3_str_append(tls, pAccum,
  56596 		(*Sqlite3_str)(unsafe.Pointer(pAccum)).FzText+uintptr(I64((*Sqlite3_str)(unsafe.Pointer(pAccum)).FnChar)-nCopyBytes), int32(nCopyBytes))
  56597 	precision = int32(I64(precision) - nPrior)
  56598 	nPrior = nPrior * int64(2)
  56599 	goto __194
  56600 __195:
  56601 	;
  56602 __192:
  56603 	;
  56604 	bufpt = bp + 16
  56605 	flag_altform2 = EtByte(1)
  56606 	goto adjust_width_for_utf8
  56607 __69:
  56608 __70:
  56609 	if !(bArgList != 0) {
  56610 		goto __199
  56611 	}
  56612 	bufpt = getTextArg(tls, pArgList)
  56613 	xtype = EtByte(EtSTRING)
  56614 	goto __200
  56615 __199:
  56616 	bufpt = libc.VaUintptr(&ap)
  56617 __200:
  56618 	;
  56619 	if !(bufpt == uintptr(0)) {
  56620 		goto __201
  56621 	}
  56622 	bufpt = ts + 1544
  56623 	goto __202
  56624 __201:
  56625 	if !(int32(xtype) == EtDYNSTRING) {
  56626 		goto __203
  56627 	}
  56628 	if !((*Sqlite3_str)(unsafe.Pointer(pAccum)).FnChar == U32(0) &&
  56629 		(*Sqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc != 0 &&
  56630 		width == 0 &&
  56631 		precision < 0 &&
  56632 		int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FaccError) == 0) {
  56633 		goto __204
  56634 	}
  56635 
  56636 	(*Sqlite3_str)(unsafe.Pointer(pAccum)).FzText = bufpt
  56637 	(*Sqlite3_str)(unsafe.Pointer(pAccum)).FnAlloc = U32(Xsqlite3DbMallocSize(tls, (*Sqlite3_str)(unsafe.Pointer(pAccum)).Fdb, bufpt))
  56638 	(*Sqlite3_str)(unsafe.Pointer(pAccum)).FnChar = U32(0x7fffffff & int32(libc.Xstrlen(tls, bufpt)))
  56639 	*(*U8)(unsafe.Pointer(pAccum + 29)) |= U8(SQLITE_PRINTF_MALLOCED)
  56640 	length = 0
  56641 	goto __58
  56642 __204:
  56643 	;
  56644 	zExtra = bufpt
  56645 __203:
  56646 	;
  56647 __202:
  56648 	;
  56649 	if !(precision >= 0) {
  56650 		goto __205
  56651 	}
  56652 	if !(flag_altform2 != 0) {
  56653 		goto __207
  56654 	}
  56655 
  56656 	z = bufpt
  56657 __209:
  56658 	if !(libc.PostDecInt32(&precision, 1) > 0 && *(*uint8)(unsafe.Pointer(z)) != 0) {
  56659 		goto __210
  56660 	}
  56661 	if !(int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) >= 0xc0) {
  56662 		goto __211
  56663 	}
  56664 __212:
  56665 	if !(int32(*(*uint8)(unsafe.Pointer(z)))&0xc0 == 0x80) {
  56666 		goto __213
  56667 	}
  56668 	z++
  56669 	goto __212
  56670 __213:
  56671 	;
  56672 __211:
  56673 	;
  56674 	goto __209
  56675 __210:
  56676 	;
  56677 	length = int32((int64(z) - int64(bufpt)) / 1)
  56678 	goto __208
  56679 __207:
  56680 	length = 0
  56681 __214:
  56682 	if !(length < precision && *(*int8)(unsafe.Pointer(bufpt + uintptr(length))) != 0) {
  56683 		goto __216
  56684 	}
  56685 	goto __215
  56686 __215:
  56687 	length++
  56688 	goto __214
  56689 	goto __216
  56690 __216:
  56691 	;
  56692 __208:
  56693 	;
  56694 	goto __206
  56695 __205:
  56696 	length = 0x7fffffff & int32(libc.Xstrlen(tls, bufpt))
  56697 __206:
  56698 	;
  56699 adjust_width_for_utf8:
  56700 	if !(flag_altform2 != 0 && width > 0) {
  56701 		goto __217
  56702 	}
  56703 
  56704 	ii = length - 1
  56705 __218:
  56706 	if !(ii >= 0) {
  56707 		goto __219
  56708 	}
  56709 	if !(int32(*(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostDecInt32(&ii, 1)))))&0xc0 == 0x80) {
  56710 		goto __220
  56711 	}
  56712 	width++
  56713 __220:
  56714 	;
  56715 	goto __218
  56716 __219:
  56717 	;
  56718 __217:
  56719 	;
  56720 	goto __58
  56721 __71:
  56722 __72:
  56723 __73:
  56724 	q = func() int8 {
  56725 		if int32(xtype) == EtSQLESCAPE3 {
  56726 			return int8('"')
  56727 		}
  56728 		return int8('\'')
  56729 	}()
  56730 
  56731 	if !(bArgList != 0) {
  56732 		goto __221
  56733 	}
  56734 	escarg = getTextArg(tls, pArgList)
  56735 	goto __222
  56736 __221:
  56737 	escarg = libc.VaUintptr(&ap)
  56738 __222:
  56739 	;
  56740 	isnull = libc.Bool32(escarg == uintptr(0))
  56741 	if !(isnull != 0) {
  56742 		goto __223
  56743 	}
  56744 	escarg = func() uintptr {
  56745 		if int32(xtype) == EtSQLESCAPE2 {
  56746 			return ts + 1545
  56747 		}
  56748 		return ts + 1550
  56749 	}()
  56750 __223:
  56751 	;
  56752 	k = I64(precision)
  56753 	i1 = libc.AssignInt64(&n1, int64(0))
  56754 __224:
  56755 	if !(k != int64(0) && int32(libc.AssignInt8(&ch1, *(*int8)(unsafe.Pointer(escarg + uintptr(i1))))) != 0) {
  56756 		goto __226
  56757 	}
  56758 	if !(int32(ch1) == int32(q)) {
  56759 		goto __227
  56760 	}
  56761 	n1++
  56762 __227:
  56763 	;
  56764 	if !(flag_altform2 != 0 && int32(ch1)&0xc0 == 0xc0) {
  56765 		goto __228
  56766 	}
  56767 __229:
  56768 	if !(int32(*(*int8)(unsafe.Pointer(escarg + uintptr(i1+int64(1)))))&0xc0 == 0x80) {
  56769 		goto __230
  56770 	}
  56771 	i1++
  56772 	goto __229
  56773 __230:
  56774 	;
  56775 __228:
  56776 	;
  56777 	goto __225
  56778 __225:
  56779 	i1++
  56780 	k--
  56781 	goto __224
  56782 	goto __226
  56783 __226:
  56784 	;
  56785 	needQuote = libc.Bool32(!(isnull != 0) && int32(xtype) == EtSQLESCAPE2)
  56786 	n1 = n1 + (i1 + int64(3))
  56787 	if !(n1 > int64(SQLITE_PRINT_BUF_SIZE)) {
  56788 		goto __231
  56789 	}
  56790 	bufpt = libc.AssignUintptr(&zExtra, printfTempBuf(tls, pAccum, n1))
  56791 	if !(bufpt == uintptr(0)) {
  56792 		goto __233
  56793 	}
  56794 	return
  56795 __233:
  56796 	;
  56797 	goto __232
  56798 __231:
  56799 	bufpt = bp + 16
  56800 __232:
  56801 	;
  56802 	j = int64(0)
  56803 	if !(needQuote != 0) {
  56804 		goto __234
  56805 	}
  56806 	*(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostIncInt64(&j, 1)))) = q
  56807 __234:
  56808 	;
  56809 	k = i1
  56810 	i1 = int64(0)
  56811 __235:
  56812 	if !(i1 < k) {
  56813 		goto __237
  56814 	}
  56815 	*(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostIncInt64(&j, 1)))) = libc.AssignInt8(&ch1, *(*int8)(unsafe.Pointer(escarg + uintptr(i1))))
  56816 	if !(int32(ch1) == int32(q)) {
  56817 		goto __238
  56818 	}
  56819 	*(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostIncInt64(&j, 1)))) = ch1
  56820 __238:
  56821 	;
  56822 	goto __236
  56823 __236:
  56824 	i1++
  56825 	goto __235
  56826 	goto __237
  56827 __237:
  56828 	;
  56829 	if !(needQuote != 0) {
  56830 		goto __239
  56831 	}
  56832 	*(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostIncInt64(&j, 1)))) = q
  56833 __239:
  56834 	;
  56835 	*(*int8)(unsafe.Pointer(bufpt + uintptr(j))) = int8(0)
  56836 	length = int32(j)
  56837 	goto adjust_width_for_utf8
  56838 
  56839 __74:
  56840 	if !(int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FprintfFlags)&SQLITE_PRINTF_INTERNAL == 0) {
  56841 		goto __240
  56842 	}
  56843 	return
  56844 __240:
  56845 	;
  56846 	if !(flag_alternateform != 0) {
  56847 		goto __241
  56848 	}
  56849 
  56850 	pExpr = libc.VaUintptr(&ap)
  56851 	if !(pExpr != 0 && !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_IntValue) != U32(0))) {
  56852 		goto __243
  56853 	}
  56854 	Xsqlite3_str_appendall(tls, pAccum, *(*uintptr)(unsafe.Pointer(pExpr + 8)))
  56855 	Xsqlite3RecordErrorOffsetOfExpr(tls, (*Sqlite3_str)(unsafe.Pointer(pAccum)).Fdb, pExpr)
  56856 __243:
  56857 	;
  56858 	goto __242
  56859 __241:
  56860 	pToken = libc.VaUintptr(&ap)
  56861 
  56862 	if !(pToken != 0 && (*Token)(unsafe.Pointer(pToken)).Fn != 0) {
  56863 		goto __244
  56864 	}
  56865 	Xsqlite3_str_append(tls, pAccum, (*Token)(unsafe.Pointer(pToken)).Fz, int32((*Token)(unsafe.Pointer(pToken)).Fn))
  56866 	Xsqlite3RecordErrorByteOffset(tls, (*Sqlite3_str)(unsafe.Pointer(pAccum)).Fdb, (*Token)(unsafe.Pointer(pToken)).Fz)
  56867 __244:
  56868 	;
  56869 __242:
  56870 	;
  56871 	length = libc.AssignInt32(&width, 0)
  56872 	goto __58
  56873 
  56874 __75:
  56875 	if !(int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FprintfFlags)&SQLITE_PRINTF_INTERNAL == 0) {
  56876 		goto __245
  56877 	}
  56878 	return
  56879 __245:
  56880 	;
  56881 	pItem = libc.VaUintptr(&ap)
  56882 
  56883 	if !((*SrcItem)(unsafe.Pointer(pItem)).FzAlias != 0 && !(flag_altform2 != 0)) {
  56884 		goto __246
  56885 	}
  56886 	Xsqlite3_str_appendall(tls, pAccum, (*SrcItem)(unsafe.Pointer(pItem)).FzAlias)
  56887 	goto __247
  56888 __246:
  56889 	if !((*SrcItem)(unsafe.Pointer(pItem)).FzName != 0) {
  56890 		goto __248
  56891 	}
  56892 	if !((*SrcItem)(unsafe.Pointer(pItem)).FzDatabase != 0) {
  56893 		goto __250
  56894 	}
  56895 	Xsqlite3_str_appendall(tls, pAccum, (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase)
  56896 	Xsqlite3_str_append(tls, pAccum, ts+1557, 1)
  56897 __250:
  56898 	;
  56899 	Xsqlite3_str_appendall(tls, pAccum, (*SrcItem)(unsafe.Pointer(pItem)).FzName)
  56900 	goto __249
  56901 __248:
  56902 	if !((*SrcItem)(unsafe.Pointer(pItem)).FzAlias != 0) {
  56903 		goto __251
  56904 	}
  56905 	Xsqlite3_str_appendall(tls, pAccum, (*SrcItem)(unsafe.Pointer(pItem)).FzAlias)
  56906 	goto __252
  56907 __251:
  56908 	pSel = (*SrcItem)(unsafe.Pointer(pItem)).FpSelect
  56909 
  56910 	if !((*Select)(unsafe.Pointer(pSel)).FselFlags&U32(SF_NestedFrom) != 0) {
  56911 		goto __253
  56912 	}
  56913 	Xsqlite3_str_appendf(tls, pAccum, ts+1559, libc.VaList(bp, (*Select)(unsafe.Pointer(pSel)).FselId))
  56914 	goto __254
  56915 __253:
  56916 	Xsqlite3_str_appendf(tls, pAccum, ts+1569, libc.VaList(bp+8, (*Select)(unsafe.Pointer(pSel)).FselId))
  56917 __254:
  56918 	;
  56919 __252:
  56920 	;
  56921 __249:
  56922 	;
  56923 __247:
  56924 	;
  56925 	length = libc.AssignInt32(&width, 0)
  56926 	goto __58
  56927 
  56928 __76:
  56929 	;
  56930 	return
  56931 
  56932 __58:
  56933 	;
  56934 	width = width - length
  56935 	if !(width > 0) {
  56936 		goto __255
  56937 	}
  56938 	if !!(flag_leftjustify != 0) {
  56939 		goto __257
  56940 	}
  56941 	Xsqlite3_str_appendchar(tls, pAccum, width, int8(' '))
  56942 __257:
  56943 	;
  56944 	Xsqlite3_str_append(tls, pAccum, bufpt, length)
  56945 	if !(flag_leftjustify != 0) {
  56946 		goto __258
  56947 	}
  56948 	Xsqlite3_str_appendchar(tls, pAccum, width, int8(' '))
  56949 __258:
  56950 	;
  56951 	goto __256
  56952 __255:
  56953 	Xsqlite3_str_append(tls, pAccum, bufpt, length)
  56954 __256:
  56955 	;
  56956 	if !(zExtra != 0) {
  56957 		goto __259
  56958 	}
  56959 	Xsqlite3DbFree(tls, (*Sqlite3_str)(unsafe.Pointer(pAccum)).Fdb, zExtra)
  56960 	zExtra = uintptr(0)
  56961 __259:
  56962 	;
  56963 	goto __4
  56964 __4:
  56965 	fmt++
  56966 	goto __3
  56967 	goto __5
  56968 __5:
  56969 }
  56970 
  56971 var zOrd = *(*[9]int8)(unsafe.Pointer(ts + 1583))
  56972 
  56973 // The z string points to the first character of a token that is
  56974 // associated with an error.  If db does not already have an error
  56975 // byte offset recorded, try to compute the error byte offset for
  56976 // z and set the error byte offset in db.
  56977 func Xsqlite3RecordErrorByteOffset(tls *libc.TLS, db uintptr, z uintptr) {
  56978 	var pParse uintptr
  56979 	var zText uintptr
  56980 	var zEnd uintptr
  56981 
  56982 	if db == uintptr(0) {
  56983 		return
  56984 	}
  56985 	if (*Sqlite3)(unsafe.Pointer(db)).FerrByteOffset != -2 {
  56986 		return
  56987 	}
  56988 	pParse = (*Sqlite3)(unsafe.Pointer(db)).FpParse
  56989 	if pParse == uintptr(0) {
  56990 		return
  56991 	}
  56992 	zText = (*Parse)(unsafe.Pointer(pParse)).FzTail
  56993 	if zText == uintptr(0) {
  56994 		return
  56995 	}
  56996 	zEnd = zText + uintptr(libc.Xstrlen(tls, zText))
  56997 	if Uptr(z) >= Uptr(zText) && Uptr(z) < Uptr(zEnd) {
  56998 		(*Sqlite3)(unsafe.Pointer(db)).FerrByteOffset = int32((int64(z) - int64(zText)) / 1)
  56999 	}
  57000 }
  57001 
  57002 // If pExpr has a byte offset for the start of a token, record that as
  57003 // as the error offset.
  57004 func Xsqlite3RecordErrorOffsetOfExpr(tls *libc.TLS, db uintptr, pExpr uintptr) {
  57005 	for pExpr != 0 &&
  57006 		((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_OuterON|EP_InnerON) != U32(0) || *(*int32)(unsafe.Pointer(pExpr + 52)) <= 0) {
  57007 		pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
  57008 	}
  57009 	if pExpr == uintptr(0) {
  57010 		return
  57011 	}
  57012 	(*Sqlite3)(unsafe.Pointer(db)).FerrByteOffset = *(*int32)(unsafe.Pointer(pExpr + 52))
  57013 }
  57014 
  57015 // Enlarge the memory allocation on a StrAccum object so that it is
  57016 // able to accept at least N more bytes of text.
  57017 //
  57018 // Return the number of bytes of text that StrAccum is able to accept
  57019 // after the attempted enlargement.  The value returned might be zero.
  57020 func Xsqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N I64) int32 {
  57021 	var zNew uintptr
  57022 
  57023 	if (*StrAccum)(unsafe.Pointer(p)).FaccError != 0 {
  57024 		return 0
  57025 	}
  57026 	if (*StrAccum)(unsafe.Pointer(p)).FmxAlloc == U32(0) {
  57027 		Xsqlite3StrAccumSetError(tls, p, uint8(SQLITE_TOOBIG))
  57028 		return int32((*StrAccum)(unsafe.Pointer(p)).FnAlloc - (*StrAccum)(unsafe.Pointer(p)).FnChar - U32(1))
  57029 	} else {
  57030 		var zOld uintptr
  57031 		if int32((*StrAccum)(unsafe.Pointer(p)).FprintfFlags)&SQLITE_PRINTF_MALLOCED != 0 {
  57032 			zOld = (*StrAccum)(unsafe.Pointer(p)).FzText
  57033 		} else {
  57034 			zOld = uintptr(0)
  57035 		}
  57036 		var szNew I64 = I64((*StrAccum)(unsafe.Pointer(p)).FnChar) + N + int64(1)
  57037 		if szNew+I64((*StrAccum)(unsafe.Pointer(p)).FnChar) <= I64((*StrAccum)(unsafe.Pointer(p)).FmxAlloc) {
  57038 			szNew = szNew + I64((*StrAccum)(unsafe.Pointer(p)).FnChar)
  57039 		}
  57040 		if szNew > I64((*StrAccum)(unsafe.Pointer(p)).FmxAlloc) {
  57041 			Xsqlite3_str_reset(tls, p)
  57042 			Xsqlite3StrAccumSetError(tls, p, uint8(SQLITE_TOOBIG))
  57043 			return 0
  57044 		} else {
  57045 			(*StrAccum)(unsafe.Pointer(p)).FnAlloc = U32(int32(szNew))
  57046 		}
  57047 		if (*StrAccum)(unsafe.Pointer(p)).Fdb != 0 {
  57048 			zNew = Xsqlite3DbRealloc(tls, (*StrAccum)(unsafe.Pointer(p)).Fdb, zOld, uint64((*StrAccum)(unsafe.Pointer(p)).FnAlloc))
  57049 		} else {
  57050 			zNew = Xsqlite3Realloc(tls, zOld, uint64((*StrAccum)(unsafe.Pointer(p)).FnAlloc))
  57051 		}
  57052 		if zNew != 0 {
  57053 			if !(int32((*StrAccum)(unsafe.Pointer(p)).FprintfFlags)&SQLITE_PRINTF_MALLOCED != 0) && (*StrAccum)(unsafe.Pointer(p)).FnChar > U32(0) {
  57054 				libc.Xmemcpy(tls, zNew, (*StrAccum)(unsafe.Pointer(p)).FzText, uint64((*StrAccum)(unsafe.Pointer(p)).FnChar))
  57055 			}
  57056 			(*StrAccum)(unsafe.Pointer(p)).FzText = zNew
  57057 			(*StrAccum)(unsafe.Pointer(p)).FnAlloc = U32(Xsqlite3DbMallocSize(tls, (*StrAccum)(unsafe.Pointer(p)).Fdb, zNew))
  57058 			*(*U8)(unsafe.Pointer(p + 29)) |= U8(SQLITE_PRINTF_MALLOCED)
  57059 		} else {
  57060 			Xsqlite3_str_reset(tls, p)
  57061 			Xsqlite3StrAccumSetError(tls, p, uint8(SQLITE_NOMEM))
  57062 			return 0
  57063 		}
  57064 	}
  57065 
  57066 	return int32(N)
  57067 }
  57068 
  57069 // Append N copies of character c to the given string buffer.
  57070 func Xsqlite3_str_appendchar(tls *libc.TLS, p uintptr, N int32, c int8) {
  57071 	if I64((*Sqlite3_str)(unsafe.Pointer(p)).FnChar)+I64(N) >= I64((*Sqlite3_str)(unsafe.Pointer(p)).FnAlloc) && libc.AssignInt32(&N, Xsqlite3StrAccumEnlarge(tls, p, int64(N))) <= 0 {
  57072 		return
  57073 	}
  57074 	for libc.PostDecInt32(&N, 1) > 0 {
  57075 		*(*int8)(unsafe.Pointer((*Sqlite3_str)(unsafe.Pointer(p)).FzText + uintptr(libc.PostIncUint32(&(*Sqlite3_str)(unsafe.Pointer(p)).FnChar, 1)))) = c
  57076 	}
  57077 }
  57078 
  57079 func enlargeAndAppend(tls *libc.TLS, p uintptr, z uintptr, N int32) {
  57080 	N = Xsqlite3StrAccumEnlarge(tls, p, int64(N))
  57081 	if N > 0 {
  57082 		libc.Xmemcpy(tls, (*StrAccum)(unsafe.Pointer(p)).FzText+uintptr((*StrAccum)(unsafe.Pointer(p)).FnChar), z, uint64(N))
  57083 		*(*U32)(unsafe.Pointer(p + 24)) += U32(N)
  57084 	}
  57085 }
  57086 
  57087 // Append N bytes of text from z to the StrAccum object.  Increase the
  57088 // size of the memory allocation for StrAccum if necessary.
  57089 func Xsqlite3_str_append(tls *libc.TLS, p uintptr, z uintptr, N int32) {
  57090 	if (*Sqlite3_str)(unsafe.Pointer(p)).FnChar+U32(N) >= (*Sqlite3_str)(unsafe.Pointer(p)).FnAlloc {
  57091 		enlargeAndAppend(tls, p, z, N)
  57092 	} else if N != 0 {
  57093 		*(*U32)(unsafe.Pointer(p + 24)) += U32(N)
  57094 		libc.Xmemcpy(tls, (*Sqlite3_str)(unsafe.Pointer(p)).FzText+uintptr((*Sqlite3_str)(unsafe.Pointer(p)).FnChar-U32(N)), z, uint64(N))
  57095 	}
  57096 }
  57097 
  57098 // Append the complete text of zero-terminated string z[] to the p string.
  57099 func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr) {
  57100 	Xsqlite3_str_append(tls, p, z, Xsqlite3Strlen30(tls, z))
  57101 }
  57102 
  57103 func strAccumFinishRealloc(tls *libc.TLS, p uintptr) uintptr {
  57104 	var zText uintptr
  57105 
  57106 	zText = Xsqlite3DbMallocRaw(tls, (*StrAccum)(unsafe.Pointer(p)).Fdb, uint64((*StrAccum)(unsafe.Pointer(p)).FnChar+U32(1)))
  57107 	if zText != 0 {
  57108 		libc.Xmemcpy(tls, zText, (*StrAccum)(unsafe.Pointer(p)).FzText, uint64((*StrAccum)(unsafe.Pointer(p)).FnChar+U32(1)))
  57109 		*(*U8)(unsafe.Pointer(p + 29)) |= U8(SQLITE_PRINTF_MALLOCED)
  57110 	} else {
  57111 		Xsqlite3StrAccumSetError(tls, p, uint8(SQLITE_NOMEM))
  57112 	}
  57113 	(*StrAccum)(unsafe.Pointer(p)).FzText = zText
  57114 	return zText
  57115 }
  57116 
  57117 func Xsqlite3StrAccumFinish(tls *libc.TLS, p uintptr) uintptr {
  57118 	if (*StrAccum)(unsafe.Pointer(p)).FzText != 0 {
  57119 		*(*int8)(unsafe.Pointer((*StrAccum)(unsafe.Pointer(p)).FzText + uintptr((*StrAccum)(unsafe.Pointer(p)).FnChar))) = int8(0)
  57120 		if (*StrAccum)(unsafe.Pointer(p)).FmxAlloc > U32(0) && !(int32((*StrAccum)(unsafe.Pointer(p)).FprintfFlags)&SQLITE_PRINTF_MALLOCED != 0) {
  57121 			return strAccumFinishRealloc(tls, p)
  57122 		}
  57123 	}
  57124 	return (*StrAccum)(unsafe.Pointer(p)).FzText
  57125 }
  57126 
  57127 // Use the content of the StrAccum passed as the second argument
  57128 // as the result of an SQL function.
  57129 func Xsqlite3ResultStrAccum(tls *libc.TLS, pCtx uintptr, p uintptr) {
  57130 	if (*StrAccum)(unsafe.Pointer(p)).FaccError != 0 {
  57131 		Xsqlite3_result_error_code(tls, pCtx, int32((*StrAccum)(unsafe.Pointer(p)).FaccError))
  57132 		Xsqlite3_str_reset(tls, p)
  57133 	} else if int32((*StrAccum)(unsafe.Pointer(p)).FprintfFlags)&SQLITE_PRINTF_MALLOCED != 0 {
  57134 		Xsqlite3_result_text(tls, pCtx, (*StrAccum)(unsafe.Pointer(p)).FzText, int32((*StrAccum)(unsafe.Pointer(p)).FnChar), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomClear})))
  57135 	} else {
  57136 		Xsqlite3_result_text(tls, pCtx, ts+1544, 0, uintptr(0))
  57137 		Xsqlite3_str_reset(tls, p)
  57138 	}
  57139 }
  57140 
  57141 var sqlite3OomStr = Sqlite3_str{FaccError: U8(SQLITE_NOMEM)}
  57142 
  57143 // Finalize a string created using sqlite3_str_new().
  57144 func Xsqlite3_str_finish(tls *libc.TLS, p uintptr) uintptr {
  57145 	var z uintptr
  57146 	if p != uintptr(0) && p != uintptr(unsafe.Pointer(&sqlite3OomStr)) {
  57147 		z = Xsqlite3StrAccumFinish(tls, p)
  57148 		Xsqlite3_free(tls, p)
  57149 	} else {
  57150 		z = uintptr(0)
  57151 	}
  57152 	return z
  57153 }
  57154 
  57155 // Return any error code associated with p
  57156 func Xsqlite3_str_errcode(tls *libc.TLS, p uintptr) int32 {
  57157 	if p != 0 {
  57158 		return int32((*Sqlite3_str)(unsafe.Pointer(p)).FaccError)
  57159 	}
  57160 	return SQLITE_NOMEM
  57161 }
  57162 
  57163 // Return the current length of p in bytes
  57164 func Xsqlite3_str_length(tls *libc.TLS, p uintptr) int32 {
  57165 	if p != 0 {
  57166 		return int32((*Sqlite3_str)(unsafe.Pointer(p)).FnChar)
  57167 	}
  57168 	return 0
  57169 }
  57170 
  57171 // Return the current value for p
  57172 func Xsqlite3_str_value(tls *libc.TLS, p uintptr) uintptr {
  57173 	if p == uintptr(0) || (*Sqlite3_str)(unsafe.Pointer(p)).FnChar == U32(0) {
  57174 		return uintptr(0)
  57175 	}
  57176 	*(*int8)(unsafe.Pointer((*Sqlite3_str)(unsafe.Pointer(p)).FzText + uintptr((*Sqlite3_str)(unsafe.Pointer(p)).FnChar))) = int8(0)
  57177 	return (*Sqlite3_str)(unsafe.Pointer(p)).FzText
  57178 }
  57179 
  57180 // Reset an StrAccum string.  Reclaim all malloced memory.
  57181 func Xsqlite3_str_reset(tls *libc.TLS, p uintptr) {
  57182 	if int32((*StrAccum)(unsafe.Pointer(p)).FprintfFlags)&SQLITE_PRINTF_MALLOCED != 0 {
  57183 		Xsqlite3DbFree(tls, (*StrAccum)(unsafe.Pointer(p)).Fdb, (*StrAccum)(unsafe.Pointer(p)).FzText)
  57184 		*(*U8)(unsafe.Pointer(p + 29)) &= libc.Uint8FromInt32(libc.CplInt32(SQLITE_PRINTF_MALLOCED))
  57185 	}
  57186 	(*StrAccum)(unsafe.Pointer(p)).FnAlloc = U32(0)
  57187 	(*StrAccum)(unsafe.Pointer(p)).FnChar = U32(0)
  57188 	(*StrAccum)(unsafe.Pointer(p)).FzText = uintptr(0)
  57189 }
  57190 
  57191 // Initialize a string accumulator.
  57192 //
  57193 // p:     The accumulator to be initialized.
  57194 // db:    Pointer to a database connection.  May be NULL.  Lookaside
  57195 //
  57196 //	memory is used if not NULL. db->mallocFailed is set appropriately
  57197 //	when not NULL.
  57198 //
  57199 // zBase: An initial buffer.  May be NULL in which case the initial buffer
  57200 //
  57201 //	is malloced.
  57202 //
  57203 // n:     Size of zBase in bytes.  If total space requirements never exceed
  57204 //
  57205 //	n then no memory allocations ever occur.
  57206 //
  57207 // mx:    Maximum number of bytes to accumulate.  If mx==0 then no memory
  57208 //
  57209 //	allocations will ever occur.
  57210 func Xsqlite3StrAccumInit(tls *libc.TLS, p uintptr, db uintptr, zBase uintptr, n int32, mx int32) {
  57211 	(*StrAccum)(unsafe.Pointer(p)).FzText = zBase
  57212 	(*StrAccum)(unsafe.Pointer(p)).Fdb = db
  57213 	(*StrAccum)(unsafe.Pointer(p)).FnAlloc = U32(n)
  57214 	(*StrAccum)(unsafe.Pointer(p)).FmxAlloc = U32(mx)
  57215 	(*StrAccum)(unsafe.Pointer(p)).FnChar = U32(0)
  57216 	(*StrAccum)(unsafe.Pointer(p)).FaccError = U8(0)
  57217 	(*StrAccum)(unsafe.Pointer(p)).FprintfFlags = U8(0)
  57218 }
  57219 
  57220 // Allocate and initialize a new dynamic string object
  57221 func Xsqlite3_str_new(tls *libc.TLS, db uintptr) uintptr {
  57222 	var p uintptr = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(Sqlite3_str{})))
  57223 	if p != 0 {
  57224 		Xsqlite3StrAccumInit(tls, p, uintptr(0), uintptr(0), 0,
  57225 			func() int32 {
  57226 				if db != 0 {
  57227 					return *(*int32)(unsafe.Pointer(db + 136))
  57228 				}
  57229 				return SQLITE_MAX_LENGTH
  57230 			}())
  57231 	} else {
  57232 		p = uintptr(unsafe.Pointer(&sqlite3OomStr))
  57233 	}
  57234 	return p
  57235 }
  57236 
  57237 // Print into memory obtained from sqliteMalloc().  Use the internal
  57238 // %-conversion extensions.
  57239 func Xsqlite3VMPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, ap Va_list) uintptr {
  57240 	bp := tls.Alloc(102)
  57241 	defer tls.Free(102)
  57242 
  57243 	var z uintptr
  57244 
  57245 	Xsqlite3StrAccumInit(tls, bp, db, bp+32, int32(unsafe.Sizeof([70]int8{})),
  57246 		*(*int32)(unsafe.Pointer(db + 136)))
  57247 	(*StrAccum)(unsafe.Pointer(bp)).FprintfFlags = U8(SQLITE_PRINTF_INTERNAL)
  57248 	Xsqlite3_str_vappendf(tls, bp, zFormat, ap)
  57249 	z = Xsqlite3StrAccumFinish(tls, bp)
  57250 	if int32((*StrAccum)(unsafe.Pointer(bp)).FaccError) == SQLITE_NOMEM {
  57251 		Xsqlite3OomFault(tls, db)
  57252 	}
  57253 	return z
  57254 }
  57255 
  57256 // Print into memory obtained from sqliteMalloc().  Use the internal
  57257 // %-conversion extensions.
  57258 func Xsqlite3MPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, va uintptr) uintptr {
  57259 	var ap Va_list
  57260 	_ = ap
  57261 	var z uintptr
  57262 	ap = va
  57263 	z = Xsqlite3VMPrintf(tls, db, zFormat, ap)
  57264 	_ = ap
  57265 	return z
  57266 }
  57267 
  57268 // Print into memory obtained from sqlite3_malloc().  Omit the internal
  57269 // %-conversion extensions.
  57270 func Xsqlite3_vmprintf(tls *libc.TLS, zFormat uintptr, ap Va_list) uintptr {
  57271 	bp := tls.Alloc(102)
  57272 	defer tls.Free(102)
  57273 
  57274 	var z uintptr
  57275 
  57276 	if Xsqlite3_initialize(tls) != 0 {
  57277 		return uintptr(0)
  57278 	}
  57279 	Xsqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(unsafe.Sizeof([70]int8{})), SQLITE_MAX_LENGTH)
  57280 	Xsqlite3_str_vappendf(tls, bp, zFormat, ap)
  57281 	z = Xsqlite3StrAccumFinish(tls, bp)
  57282 	return z
  57283 }
  57284 
  57285 // Print into memory obtained from sqlite3_malloc()().  Omit the internal
  57286 // %-conversion extensions.
  57287 func Xsqlite3_mprintf(tls *libc.TLS, zFormat uintptr, va uintptr) uintptr {
  57288 	var ap Va_list
  57289 	_ = ap
  57290 	var z uintptr
  57291 	if Xsqlite3_initialize(tls) != 0 {
  57292 		return uintptr(0)
  57293 	}
  57294 	ap = va
  57295 	z = Xsqlite3_vmprintf(tls, zFormat, ap)
  57296 	_ = ap
  57297 	return z
  57298 }
  57299 
  57300 // sqlite3_snprintf() works like snprintf() except that it ignores the
  57301 // current locale settings.  This is important for SQLite because we
  57302 // are not able to use a "," as the decimal point in place of "." as
  57303 // specified by some locales.
  57304 //
  57305 // Oops:  The first two arguments of sqlite3_snprintf() are backwards
  57306 // from the snprintf() standard.  Unfortunately, it is too late to change
  57307 // this without breaking compatibility, so we just have to live with the
  57308 // mistake.
  57309 //
  57310 // sqlite3_vsnprintf() is the varargs version.
  57311 func Xsqlite3_vsnprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, ap Va_list) uintptr {
  57312 	bp := tls.Alloc(32)
  57313 	defer tls.Free(32)
  57314 
  57315 	if n <= 0 {
  57316 		return zBuf
  57317 	}
  57318 	Xsqlite3StrAccumInit(tls, bp, uintptr(0), zBuf, n, 0)
  57319 	Xsqlite3_str_vappendf(tls, bp, zFormat, ap)
  57320 	*(*int8)(unsafe.Pointer(zBuf + uintptr((*StrAccum)(unsafe.Pointer(bp)).FnChar))) = int8(0)
  57321 	return zBuf
  57322 }
  57323 
  57324 func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va uintptr) uintptr {
  57325 	var z uintptr
  57326 	var ap Va_list
  57327 	_ = ap
  57328 	ap = va
  57329 	z = Xsqlite3_vsnprintf(tls, n, zBuf, zFormat, ap)
  57330 	_ = ap
  57331 	return z
  57332 }
  57333 
  57334 func renderLogMsg(tls *libc.TLS, iErrCode int32, zFormat uintptr, ap Va_list) {
  57335 	bp := tls.Alloc(242)
  57336 	defer tls.Free(242)
  57337 
  57338 	Xsqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(unsafe.Sizeof([210]int8{})), 0)
  57339 	Xsqlite3_str_vappendf(tls, bp, zFormat, ap)
  57340 	(*struct {
  57341 		f func(*libc.TLS, uintptr, int32, uintptr)
  57342 	})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.FxLog})).f(tls, Xsqlite3Config.FpLogArg, iErrCode,
  57343 		Xsqlite3StrAccumFinish(tls, bp))
  57344 }
  57345 
  57346 // Format and write a message to the log if logging is enabled.
  57347 func Xsqlite3_log(tls *libc.TLS, iErrCode int32, zFormat uintptr, va uintptr) {
  57348 	var ap Va_list
  57349 	_ = ap
  57350 	if Xsqlite3Config.FxLog != 0 {
  57351 		ap = va
  57352 		renderLogMsg(tls, iErrCode, zFormat, ap)
  57353 		_ = ap
  57354 	}
  57355 }
  57356 
  57357 // variable-argument wrapper around sqlite3_str_vappendf(). The bFlags argument
  57358 // can contain the bit SQLITE_PRINTF_INTERNAL enable internal formats.
  57359 func Xsqlite3_str_appendf(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) {
  57360 	var ap Va_list
  57361 	_ = ap
  57362 	ap = va
  57363 	Xsqlite3_str_vappendf(tls, p, zFormat, ap)
  57364 	_ = ap
  57365 }
  57366 
  57367 type sqlite3PrngType = struct {
  57368 	Fs           [16]U32
  57369 	Fout         [64]U8
  57370 	Fn           U8
  57371 	F__ccgo_pad1 [3]byte
  57372 }
  57373 
  57374 var sqlite3Prng sqlite3PrngType
  57375 
  57376 func chacha_block(tls *libc.TLS, out uintptr, in uintptr) {
  57377 	bp := tls.Alloc(64)
  57378 	defer tls.Free(64)
  57379 
  57380 	var i int32
  57381 
  57382 	libc.Xmemcpy(tls, bp, in, uint64(64))
  57383 	for i = 0; i < 10; i++ {
  57384 		*(*U32)(unsafe.Pointer(bp)) += *(*U32)(unsafe.Pointer(bp + 4*4))
  57385 		*(*U32)(unsafe.Pointer(bp + 12*4)) ^= *(*U32)(unsafe.Pointer(bp))
  57386 		*(*U32)(unsafe.Pointer(bp + 12*4)) = *(*U32)(unsafe.Pointer(bp + 12*4))<<16 | *(*U32)(unsafe.Pointer(bp + 12*4))>>(32-16)
  57387 		*(*U32)(unsafe.Pointer(bp + 8*4)) += *(*U32)(unsafe.Pointer(bp + 12*4))
  57388 		*(*U32)(unsafe.Pointer(bp + 4*4)) ^= *(*U32)(unsafe.Pointer(bp + 8*4))
  57389 		*(*U32)(unsafe.Pointer(bp + 4*4)) = *(*U32)(unsafe.Pointer(bp + 4*4))<<12 | *(*U32)(unsafe.Pointer(bp + 4*4))>>(32-12)
  57390 		*(*U32)(unsafe.Pointer(bp)) += *(*U32)(unsafe.Pointer(bp + 4*4))
  57391 		*(*U32)(unsafe.Pointer(bp + 12*4)) ^= *(*U32)(unsafe.Pointer(bp))
  57392 		*(*U32)(unsafe.Pointer(bp + 12*4)) = *(*U32)(unsafe.Pointer(bp + 12*4))<<8 | *(*U32)(unsafe.Pointer(bp + 12*4))>>(32-8)
  57393 		*(*U32)(unsafe.Pointer(bp + 8*4)) += *(*U32)(unsafe.Pointer(bp + 12*4))
  57394 		*(*U32)(unsafe.Pointer(bp + 4*4)) ^= *(*U32)(unsafe.Pointer(bp + 8*4))
  57395 		*(*U32)(unsafe.Pointer(bp + 4*4)) = *(*U32)(unsafe.Pointer(bp + 4*4))<<7 | *(*U32)(unsafe.Pointer(bp + 4*4))>>(32-7)
  57396 		*(*U32)(unsafe.Pointer(bp + 1*4)) += *(*U32)(unsafe.Pointer(bp + 5*4))
  57397 		*(*U32)(unsafe.Pointer(bp + 13*4)) ^= *(*U32)(unsafe.Pointer(bp + 1*4))
  57398 		*(*U32)(unsafe.Pointer(bp + 13*4)) = *(*U32)(unsafe.Pointer(bp + 13*4))<<16 | *(*U32)(unsafe.Pointer(bp + 13*4))>>(32-16)
  57399 		*(*U32)(unsafe.Pointer(bp + 9*4)) += *(*U32)(unsafe.Pointer(bp + 13*4))
  57400 		*(*U32)(unsafe.Pointer(bp + 5*4)) ^= *(*U32)(unsafe.Pointer(bp + 9*4))
  57401 		*(*U32)(unsafe.Pointer(bp + 5*4)) = *(*U32)(unsafe.Pointer(bp + 5*4))<<12 | *(*U32)(unsafe.Pointer(bp + 5*4))>>(32-12)
  57402 		*(*U32)(unsafe.Pointer(bp + 1*4)) += *(*U32)(unsafe.Pointer(bp + 5*4))
  57403 		*(*U32)(unsafe.Pointer(bp + 13*4)) ^= *(*U32)(unsafe.Pointer(bp + 1*4))
  57404 		*(*U32)(unsafe.Pointer(bp + 13*4)) = *(*U32)(unsafe.Pointer(bp + 13*4))<<8 | *(*U32)(unsafe.Pointer(bp + 13*4))>>(32-8)
  57405 		*(*U32)(unsafe.Pointer(bp + 9*4)) += *(*U32)(unsafe.Pointer(bp + 13*4))
  57406 		*(*U32)(unsafe.Pointer(bp + 5*4)) ^= *(*U32)(unsafe.Pointer(bp + 9*4))
  57407 		*(*U32)(unsafe.Pointer(bp + 5*4)) = *(*U32)(unsafe.Pointer(bp + 5*4))<<7 | *(*U32)(unsafe.Pointer(bp + 5*4))>>(32-7)
  57408 		*(*U32)(unsafe.Pointer(bp + 2*4)) += *(*U32)(unsafe.Pointer(bp + 6*4))
  57409 		*(*U32)(unsafe.Pointer(bp + 14*4)) ^= *(*U32)(unsafe.Pointer(bp + 2*4))
  57410 		*(*U32)(unsafe.Pointer(bp + 14*4)) = *(*U32)(unsafe.Pointer(bp + 14*4))<<16 | *(*U32)(unsafe.Pointer(bp + 14*4))>>(32-16)
  57411 		*(*U32)(unsafe.Pointer(bp + 10*4)) += *(*U32)(unsafe.Pointer(bp + 14*4))
  57412 		*(*U32)(unsafe.Pointer(bp + 6*4)) ^= *(*U32)(unsafe.Pointer(bp + 10*4))
  57413 		*(*U32)(unsafe.Pointer(bp + 6*4)) = *(*U32)(unsafe.Pointer(bp + 6*4))<<12 | *(*U32)(unsafe.Pointer(bp + 6*4))>>(32-12)
  57414 		*(*U32)(unsafe.Pointer(bp + 2*4)) += *(*U32)(unsafe.Pointer(bp + 6*4))
  57415 		*(*U32)(unsafe.Pointer(bp + 14*4)) ^= *(*U32)(unsafe.Pointer(bp + 2*4))
  57416 		*(*U32)(unsafe.Pointer(bp + 14*4)) = *(*U32)(unsafe.Pointer(bp + 14*4))<<8 | *(*U32)(unsafe.Pointer(bp + 14*4))>>(32-8)
  57417 		*(*U32)(unsafe.Pointer(bp + 10*4)) += *(*U32)(unsafe.Pointer(bp + 14*4))
  57418 		*(*U32)(unsafe.Pointer(bp + 6*4)) ^= *(*U32)(unsafe.Pointer(bp + 10*4))
  57419 		*(*U32)(unsafe.Pointer(bp + 6*4)) = *(*U32)(unsafe.Pointer(bp + 6*4))<<7 | *(*U32)(unsafe.Pointer(bp + 6*4))>>(32-7)
  57420 		*(*U32)(unsafe.Pointer(bp + 3*4)) += *(*U32)(unsafe.Pointer(bp + 7*4))
  57421 		*(*U32)(unsafe.Pointer(bp + 15*4)) ^= *(*U32)(unsafe.Pointer(bp + 3*4))
  57422 		*(*U32)(unsafe.Pointer(bp + 15*4)) = *(*U32)(unsafe.Pointer(bp + 15*4))<<16 | *(*U32)(unsafe.Pointer(bp + 15*4))>>(32-16)
  57423 		*(*U32)(unsafe.Pointer(bp + 11*4)) += *(*U32)(unsafe.Pointer(bp + 15*4))
  57424 		*(*U32)(unsafe.Pointer(bp + 7*4)) ^= *(*U32)(unsafe.Pointer(bp + 11*4))
  57425 		*(*U32)(unsafe.Pointer(bp + 7*4)) = *(*U32)(unsafe.Pointer(bp + 7*4))<<12 | *(*U32)(unsafe.Pointer(bp + 7*4))>>(32-12)
  57426 		*(*U32)(unsafe.Pointer(bp + 3*4)) += *(*U32)(unsafe.Pointer(bp + 7*4))
  57427 		*(*U32)(unsafe.Pointer(bp + 15*4)) ^= *(*U32)(unsafe.Pointer(bp + 3*4))
  57428 		*(*U32)(unsafe.Pointer(bp + 15*4)) = *(*U32)(unsafe.Pointer(bp + 15*4))<<8 | *(*U32)(unsafe.Pointer(bp + 15*4))>>(32-8)
  57429 		*(*U32)(unsafe.Pointer(bp + 11*4)) += *(*U32)(unsafe.Pointer(bp + 15*4))
  57430 		*(*U32)(unsafe.Pointer(bp + 7*4)) ^= *(*U32)(unsafe.Pointer(bp + 11*4))
  57431 		*(*U32)(unsafe.Pointer(bp + 7*4)) = *(*U32)(unsafe.Pointer(bp + 7*4))<<7 | *(*U32)(unsafe.Pointer(bp + 7*4))>>(32-7)
  57432 		*(*U32)(unsafe.Pointer(bp)) += *(*U32)(unsafe.Pointer(bp + 5*4))
  57433 		*(*U32)(unsafe.Pointer(bp + 15*4)) ^= *(*U32)(unsafe.Pointer(bp))
  57434 		*(*U32)(unsafe.Pointer(bp + 15*4)) = *(*U32)(unsafe.Pointer(bp + 15*4))<<16 | *(*U32)(unsafe.Pointer(bp + 15*4))>>(32-16)
  57435 		*(*U32)(unsafe.Pointer(bp + 10*4)) += *(*U32)(unsafe.Pointer(bp + 15*4))
  57436 		*(*U32)(unsafe.Pointer(bp + 5*4)) ^= *(*U32)(unsafe.Pointer(bp + 10*4))
  57437 		*(*U32)(unsafe.Pointer(bp + 5*4)) = *(*U32)(unsafe.Pointer(bp + 5*4))<<12 | *(*U32)(unsafe.Pointer(bp + 5*4))>>(32-12)
  57438 		*(*U32)(unsafe.Pointer(bp)) += *(*U32)(unsafe.Pointer(bp + 5*4))
  57439 		*(*U32)(unsafe.Pointer(bp + 15*4)) ^= *(*U32)(unsafe.Pointer(bp))
  57440 		*(*U32)(unsafe.Pointer(bp + 15*4)) = *(*U32)(unsafe.Pointer(bp + 15*4))<<8 | *(*U32)(unsafe.Pointer(bp + 15*4))>>(32-8)
  57441 		*(*U32)(unsafe.Pointer(bp + 10*4)) += *(*U32)(unsafe.Pointer(bp + 15*4))
  57442 		*(*U32)(unsafe.Pointer(bp + 5*4)) ^= *(*U32)(unsafe.Pointer(bp + 10*4))
  57443 		*(*U32)(unsafe.Pointer(bp + 5*4)) = *(*U32)(unsafe.Pointer(bp + 5*4))<<7 | *(*U32)(unsafe.Pointer(bp + 5*4))>>(32-7)
  57444 		*(*U32)(unsafe.Pointer(bp + 1*4)) += *(*U32)(unsafe.Pointer(bp + 6*4))
  57445 		*(*U32)(unsafe.Pointer(bp + 12*4)) ^= *(*U32)(unsafe.Pointer(bp + 1*4))
  57446 		*(*U32)(unsafe.Pointer(bp + 12*4)) = *(*U32)(unsafe.Pointer(bp + 12*4))<<16 | *(*U32)(unsafe.Pointer(bp + 12*4))>>(32-16)
  57447 		*(*U32)(unsafe.Pointer(bp + 11*4)) += *(*U32)(unsafe.Pointer(bp + 12*4))
  57448 		*(*U32)(unsafe.Pointer(bp + 6*4)) ^= *(*U32)(unsafe.Pointer(bp + 11*4))
  57449 		*(*U32)(unsafe.Pointer(bp + 6*4)) = *(*U32)(unsafe.Pointer(bp + 6*4))<<12 | *(*U32)(unsafe.Pointer(bp + 6*4))>>(32-12)
  57450 		*(*U32)(unsafe.Pointer(bp + 1*4)) += *(*U32)(unsafe.Pointer(bp + 6*4))
  57451 		*(*U32)(unsafe.Pointer(bp + 12*4)) ^= *(*U32)(unsafe.Pointer(bp + 1*4))
  57452 		*(*U32)(unsafe.Pointer(bp + 12*4)) = *(*U32)(unsafe.Pointer(bp + 12*4))<<8 | *(*U32)(unsafe.Pointer(bp + 12*4))>>(32-8)
  57453 		*(*U32)(unsafe.Pointer(bp + 11*4)) += *(*U32)(unsafe.Pointer(bp + 12*4))
  57454 		*(*U32)(unsafe.Pointer(bp + 6*4)) ^= *(*U32)(unsafe.Pointer(bp + 11*4))
  57455 		*(*U32)(unsafe.Pointer(bp + 6*4)) = *(*U32)(unsafe.Pointer(bp + 6*4))<<7 | *(*U32)(unsafe.Pointer(bp + 6*4))>>(32-7)
  57456 		*(*U32)(unsafe.Pointer(bp + 2*4)) += *(*U32)(unsafe.Pointer(bp + 7*4))
  57457 		*(*U32)(unsafe.Pointer(bp + 13*4)) ^= *(*U32)(unsafe.Pointer(bp + 2*4))
  57458 		*(*U32)(unsafe.Pointer(bp + 13*4)) = *(*U32)(unsafe.Pointer(bp + 13*4))<<16 | *(*U32)(unsafe.Pointer(bp + 13*4))>>(32-16)
  57459 		*(*U32)(unsafe.Pointer(bp + 8*4)) += *(*U32)(unsafe.Pointer(bp + 13*4))
  57460 		*(*U32)(unsafe.Pointer(bp + 7*4)) ^= *(*U32)(unsafe.Pointer(bp + 8*4))
  57461 		*(*U32)(unsafe.Pointer(bp + 7*4)) = *(*U32)(unsafe.Pointer(bp + 7*4))<<12 | *(*U32)(unsafe.Pointer(bp + 7*4))>>(32-12)
  57462 		*(*U32)(unsafe.Pointer(bp + 2*4)) += *(*U32)(unsafe.Pointer(bp + 7*4))
  57463 		*(*U32)(unsafe.Pointer(bp + 13*4)) ^= *(*U32)(unsafe.Pointer(bp + 2*4))
  57464 		*(*U32)(unsafe.Pointer(bp + 13*4)) = *(*U32)(unsafe.Pointer(bp + 13*4))<<8 | *(*U32)(unsafe.Pointer(bp + 13*4))>>(32-8)
  57465 		*(*U32)(unsafe.Pointer(bp + 8*4)) += *(*U32)(unsafe.Pointer(bp + 13*4))
  57466 		*(*U32)(unsafe.Pointer(bp + 7*4)) ^= *(*U32)(unsafe.Pointer(bp + 8*4))
  57467 		*(*U32)(unsafe.Pointer(bp + 7*4)) = *(*U32)(unsafe.Pointer(bp + 7*4))<<7 | *(*U32)(unsafe.Pointer(bp + 7*4))>>(32-7)
  57468 		*(*U32)(unsafe.Pointer(bp + 3*4)) += *(*U32)(unsafe.Pointer(bp + 4*4))
  57469 		*(*U32)(unsafe.Pointer(bp + 14*4)) ^= *(*U32)(unsafe.Pointer(bp + 3*4))
  57470 		*(*U32)(unsafe.Pointer(bp + 14*4)) = *(*U32)(unsafe.Pointer(bp + 14*4))<<16 | *(*U32)(unsafe.Pointer(bp + 14*4))>>(32-16)
  57471 		*(*U32)(unsafe.Pointer(bp + 9*4)) += *(*U32)(unsafe.Pointer(bp + 14*4))
  57472 		*(*U32)(unsafe.Pointer(bp + 4*4)) ^= *(*U32)(unsafe.Pointer(bp + 9*4))
  57473 		*(*U32)(unsafe.Pointer(bp + 4*4)) = *(*U32)(unsafe.Pointer(bp + 4*4))<<12 | *(*U32)(unsafe.Pointer(bp + 4*4))>>(32-12)
  57474 		*(*U32)(unsafe.Pointer(bp + 3*4)) += *(*U32)(unsafe.Pointer(bp + 4*4))
  57475 		*(*U32)(unsafe.Pointer(bp + 14*4)) ^= *(*U32)(unsafe.Pointer(bp + 3*4))
  57476 		*(*U32)(unsafe.Pointer(bp + 14*4)) = *(*U32)(unsafe.Pointer(bp + 14*4))<<8 | *(*U32)(unsafe.Pointer(bp + 14*4))>>(32-8)
  57477 		*(*U32)(unsafe.Pointer(bp + 9*4)) += *(*U32)(unsafe.Pointer(bp + 14*4))
  57478 		*(*U32)(unsafe.Pointer(bp + 4*4)) ^= *(*U32)(unsafe.Pointer(bp + 9*4))
  57479 		*(*U32)(unsafe.Pointer(bp + 4*4)) = *(*U32)(unsafe.Pointer(bp + 4*4))<<7 | *(*U32)(unsafe.Pointer(bp + 4*4))>>(32-7)
  57480 	}
  57481 	for i = 0; i < 16; i++ {
  57482 		*(*U32)(unsafe.Pointer(out + uintptr(i)*4)) = *(*U32)(unsafe.Pointer(bp + uintptr(i)*4)) + *(*U32)(unsafe.Pointer(in + uintptr(i)*4))
  57483 	}
  57484 }
  57485 
  57486 // Return N random bytes.
  57487 func Xsqlite3_randomness(tls *libc.TLS, N int32, pBuf uintptr) {
  57488 	var zBuf uintptr = pBuf
  57489 
  57490 	var mutex uintptr
  57491 
  57492 	if Xsqlite3_initialize(tls) != 0 {
  57493 		return
  57494 	}
  57495 
  57496 	mutex = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_PRNG)
  57497 
  57498 	Xsqlite3_mutex_enter(tls, mutex)
  57499 	if N <= 0 || pBuf == uintptr(0) {
  57500 		*(*U32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)))) = U32(0)
  57501 		Xsqlite3_mutex_leave(tls, mutex)
  57502 		return
  57503 	}
  57504 
  57505 	if *(*U32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)))) == U32(0) {
  57506 		var pVfs uintptr = Xsqlite3_vfs_find(tls, uintptr(0))
  57507 		libc.Xmemcpy(tls, uintptr(unsafe.Pointer(&sqlite3Prng)), uintptr(unsafe.Pointer(&chacha20_init)), uint64(16))
  57508 		if pVfs == uintptr(0) {
  57509 			libc.Xmemset(tls, uintptr(unsafe.Pointer(&sqlite3Prng))+4*4, 0, uint64(44))
  57510 		} else {
  57511 			Xsqlite3OsRandomness(tls, pVfs, 44, uintptr(unsafe.Pointer(&sqlite3Prng))+4*4)
  57512 		}
  57513 		*(*U32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)) + 15*4)) = *(*U32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)) + 12*4))
  57514 		*(*U32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)) + 12*4)) = U32(0)
  57515 		sqlite3Prng.Fn = U8(0)
  57516 	}
  57517 
  57518 	for 1 != 0 {
  57519 		if N <= int32(sqlite3Prng.Fn) {
  57520 			libc.Xmemcpy(tls, zBuf, uintptr(unsafe.Pointer(&sqlite3Prng))+64+uintptr(int32(sqlite3Prng.Fn)-N), uint64(N))
  57521 			*(*U8)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)) + 128)) -= U8(N)
  57522 			break
  57523 		}
  57524 		if int32(sqlite3Prng.Fn) > 0 {
  57525 			libc.Xmemcpy(tls, zBuf, uintptr(unsafe.Pointer(&sqlite3Prng))+64, uint64(sqlite3Prng.Fn))
  57526 			N = N - int32(sqlite3Prng.Fn)
  57527 			zBuf += uintptr(sqlite3Prng.Fn)
  57528 		}
  57529 		*(*U32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)) + 12*4))++
  57530 		chacha_block(tls, uintptr(unsafe.Pointer(&sqlite3Prng))+64, uintptr(unsafe.Pointer(&sqlite3Prng)))
  57531 		sqlite3Prng.Fn = U8(64)
  57532 	}
  57533 	Xsqlite3_mutex_leave(tls, mutex)
  57534 }
  57535 
  57536 var chacha20_init = [4]U32{
  57537 	U32(0x61707865), U32(0x3320646e), U32(0x79622d32), U32(0x6b206574),
  57538 }
  57539 
  57540 var sqlite3SavedPrng sqlite3PrngType
  57541 
  57542 func Xsqlite3PrngSaveState(tls *libc.TLS) {
  57543 	libc.Xmemcpy(tls,
  57544 		uintptr(unsafe.Pointer(&sqlite3SavedPrng)),
  57545 		uintptr(unsafe.Pointer(&sqlite3Prng)),
  57546 		uint64(unsafe.Sizeof(sqlite3Prng)))
  57547 }
  57548 
  57549 func Xsqlite3PrngRestoreState(tls *libc.TLS) {
  57550 	libc.Xmemcpy(tls,
  57551 		uintptr(unsafe.Pointer(&sqlite3Prng)),
  57552 		uintptr(unsafe.Pointer(&sqlite3SavedPrng)),
  57553 		uint64(unsafe.Sizeof(sqlite3Prng)))
  57554 }
  57555 
  57556 type X_PVFV = uintptr
  57557 type X_PIFV = uintptr
  57558 type X_PVFI = uintptr
  57559 
  57560 type _onexit_table_t = struct {
  57561 	F_first uintptr
  57562 	F_last  uintptr
  57563 	F_end   uintptr
  57564 }
  57565 
  57566 type X_onexit_table_t = _onexit_table_t
  57567 
  57568 type X_ino_t = uint16
  57569 type Ino_t = uint16
  57570 
  57571 type X_dev_t = uint32
  57572 type Dev_t = uint32
  57573 
  57574 type X_pid_t = int64
  57575 
  57576 type Pid_t = X_pid_t
  57577 
  57578 type X_mode_t = uint16
  57579 
  57580 type Mode_t = X_mode_t
  57581 
  57582 type Useconds_t = uint32
  57583 
  57584 type X_sigset_t = uint64
  57585 
  57586 type X_beginthread_proc_type = uintptr
  57587 type X_beginthreadex_proc_type = uintptr
  57588 
  57589 type X_tls_callback_type = uintptr
  57590 
  57591 func sqlite3ThreadProc(tls *libc.TLS, pArg uintptr) uint32 {
  57592 	var p uintptr = pArg
  57593 
  57594 	(*SQLiteThread)(unsafe.Pointer(p)).FpResult = (*struct {
  57595 		f func(*libc.TLS, uintptr) uintptr
  57596 	})(unsafe.Pointer(&struct{ uintptr }{(*SQLiteThread)(unsafe.Pointer(p)).FxTask})).f(tls, (*SQLiteThread)(unsafe.Pointer(p)).FpIn)
  57597 
  57598 	libc.X_endthreadex(tls, uint32(0))
  57599 	return uint32(0)
  57600 }
  57601 
  57602 // Create a new thread
  57603 func Xsqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) int32 {
  57604 	var p uintptr
  57605 
  57606 	*(*uintptr)(unsafe.Pointer(ppThread)) = uintptr(0)
  57607 	p = Xsqlite3Malloc(tls, uint64(unsafe.Sizeof(SQLiteThread{})))
  57608 	if p == uintptr(0) {
  57609 		return SQLITE_NOMEM
  57610 	}
  57611 
  57612 	if int32(Xsqlite3Config.FbCoreMutex) == 0 || Xsqlite3FaultSim(tls, 200) != 0 {
  57613 		libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(SQLiteThread{})))
  57614 	} else {
  57615 		(*SQLiteThread)(unsafe.Pointer(p)).FxTask = xTask
  57616 		(*SQLiteThread)(unsafe.Pointer(p)).FpIn = pIn
  57617 		(*SQLiteThread)(unsafe.Pointer(p)).Ftid = uintptr(libc.X_beginthreadex(tls, uintptr(0), uint32(0), *(*uintptr)(unsafe.Pointer(&struct {
  57618 			f func(*libc.TLS, uintptr) uint32
  57619 		}{sqlite3ThreadProc})), p, uint32(0), p+8))
  57620 		if (*SQLiteThread)(unsafe.Pointer(p)).Ftid == uintptr(0) {
  57621 			libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(SQLiteThread{})))
  57622 		}
  57623 	}
  57624 	if (*SQLiteThread)(unsafe.Pointer(p)).FxTask == uintptr(0) {
  57625 		(*SQLiteThread)(unsafe.Pointer(p)).Fid = libc.XGetCurrentThreadId(tls)
  57626 		(*SQLiteThread)(unsafe.Pointer(p)).FpResult = (*struct {
  57627 			f func(*libc.TLS, uintptr) uintptr
  57628 		})(unsafe.Pointer(&struct{ uintptr }{xTask})).f(tls, pIn)
  57629 	}
  57630 	*(*uintptr)(unsafe.Pointer(ppThread)) = p
  57631 	return SQLITE_OK
  57632 }
  57633 
  57634 // Get the results of the thread
  57635 func Xsqlite3ThreadJoin(tls *libc.TLS, p uintptr, ppOut uintptr) int32 {
  57636 	var rc DWORD
  57637 	var bRc WINBOOL
  57638 	_ = bRc
  57639 
  57640 	if p == uintptr(0) {
  57641 		return SQLITE_NOMEM
  57642 	}
  57643 	if (*SQLiteThread)(unsafe.Pointer(p)).FxTask == uintptr(0) {
  57644 		rc = DWORD(0x00000000) + DWORD(0)
  57645 
  57646 	} else {
  57647 		rc = Xsqlite3Win32Wait(tls, (*SQLiteThread)(unsafe.Pointer(p)).Ftid)
  57648 
  57649 		bRc = libc.XCloseHandle(tls, (*SQLiteThread)(unsafe.Pointer(p)).Ftid)
  57650 
  57651 	}
  57652 	if rc == DWORD(0x00000000)+DWORD(0) {
  57653 		*(*uintptr)(unsafe.Pointer(ppOut)) = (*SQLiteThread)(unsafe.Pointer(p)).FpResult
  57654 	}
  57655 	Xsqlite3_free(tls, p)
  57656 	if rc == DWORD(0x00000000)+DWORD(0) {
  57657 		return SQLITE_OK
  57658 	}
  57659 	return SQLITE_ERROR
  57660 }
  57661 
  57662 var sqlite3Utf8Trans1 = [64]uint8{
  57663 	uint8(0x00), uint8(0x01), uint8(0x02), uint8(0x03), uint8(0x04), uint8(0x05), uint8(0x06), uint8(0x07),
  57664 	uint8(0x08), uint8(0x09), uint8(0x0a), uint8(0x0b), uint8(0x0c), uint8(0x0d), uint8(0x0e), uint8(0x0f),
  57665 	uint8(0x10), uint8(0x11), uint8(0x12), uint8(0x13), uint8(0x14), uint8(0x15), uint8(0x16), uint8(0x17),
  57666 	uint8(0x18), uint8(0x19), uint8(0x1a), uint8(0x1b), uint8(0x1c), uint8(0x1d), uint8(0x1e), uint8(0x1f),
  57667 	uint8(0x00), uint8(0x01), uint8(0x02), uint8(0x03), uint8(0x04), uint8(0x05), uint8(0x06), uint8(0x07),
  57668 	uint8(0x08), uint8(0x09), uint8(0x0a), uint8(0x0b), uint8(0x0c), uint8(0x0d), uint8(0x0e), uint8(0x0f),
  57669 	uint8(0x00), uint8(0x01), uint8(0x02), uint8(0x03), uint8(0x04), uint8(0x05), uint8(0x06), uint8(0x07),
  57670 	uint8(0x00), uint8(0x01), uint8(0x02), uint8(0x03), uint8(0x00), uint8(0x01), uint8(0x00), uint8(0x00),
  57671 }
  57672 
  57673 // Translate a single UTF-8 character.  Return the unicode value.
  57674 //
  57675 // During translation, assume that the byte that zTerm points
  57676 // is a 0x00.
  57677 //
  57678 // Write a pointer to the next unread byte back into *pzNext.
  57679 //
  57680 // Notes On Invalid UTF-8:
  57681 //
  57682 //   - This routine never allows a 7-bit character (0x00 through 0x7f) to
  57683 //     be encoded as a multi-byte character.  Any multi-byte character that
  57684 //     attempts to encode a value between 0x00 and 0x7f is rendered as 0xfffd.
  57685 //
  57686 //   - This routine never allows a UTF16 surrogate value to be encoded.
  57687 //     If a multi-byte character attempts to encode a value between
  57688 //     0xd800 and 0xe000 then it is rendered as 0xfffd.
  57689 //
  57690 //   - Bytes in the range of 0x80 through 0xbf which occur as the first
  57691 //     byte of a character are interpreted as single-byte characters
  57692 //     and rendered as themselves even though they are technically
  57693 //     invalid characters.
  57694 //
  57695 //   - This routine accepts over-length UTF8 encodings
  57696 //     for unicode values 0x80 and greater.  It does not change over-length
  57697 //     encodings to 0xfffd as some systems recommend.
  57698 func Xsqlite3Utf8Read(tls *libc.TLS, pz uintptr) U32 {
  57699 	var c uint32
  57700 
  57701 	c = uint32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(pz)), 1))))
  57702 	if c >= uint32(0xc0) {
  57703 		c = uint32(sqlite3Utf8Trans1[c-uint32(0xc0)])
  57704 		for int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pz)))))&0xc0 == 0x80 {
  57705 			c = c<<6 + uint32(0x3f&int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(pz)), 1)))))
  57706 		}
  57707 		if c < uint32(0x80) ||
  57708 			c&0xFFFFF800 == uint32(0xD800) ||
  57709 			c&0xFFFFFFFE == uint32(0xFFFE) {
  57710 			c = uint32(0xFFFD)
  57711 		}
  57712 	}
  57713 	return c
  57714 }
  57715 
  57716 // This routine transforms the internal text encoding used by pMem to
  57717 // desiredEnc. It is an error if the string is already of the desired
  57718 // encoding, or if *pMem does not contain a string value.
  57719 func Xsqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc U8) int32 {
  57720 	var len Sqlite3_int64
  57721 	var zOut uintptr
  57722 	var zIn uintptr
  57723 	var zTerm uintptr
  57724 	var z uintptr
  57725 	var c uint32
  57726 	var temp U8
  57727 	var rc int32
  57728 	var c2 int32
  57729 	var c21 int32
  57730 
  57731 	if !(int32((*Mem)(unsafe.Pointer(pMem)).Fenc) != SQLITE_UTF8 && int32(desiredEnc) != SQLITE_UTF8) {
  57732 		goto __1
  57733 	}
  57734 	rc = Xsqlite3VdbeMemMakeWriteable(tls, pMem)
  57735 	if !(rc != SQLITE_OK) {
  57736 		goto __2
  57737 	}
  57738 
  57739 	return SQLITE_NOMEM
  57740 __2:
  57741 	;
  57742 	zIn = (*Mem)(unsafe.Pointer(pMem)).Fz
  57743 	zTerm = zIn + uintptr((*Mem)(unsafe.Pointer(pMem)).Fn&libc.CplInt32(1))
  57744 __3:
  57745 	if !(zIn < zTerm) {
  57746 		goto __4
  57747 	}
  57748 	temp = *(*uint8)(unsafe.Pointer(zIn))
  57749 	*(*uint8)(unsafe.Pointer(zIn)) = *(*uint8)(unsafe.Pointer(zIn + uintptr(1)))
  57750 	zIn++
  57751 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))) = temp
  57752 	goto __3
  57753 __4:
  57754 	;
  57755 	(*Mem)(unsafe.Pointer(pMem)).Fenc = desiredEnc
  57756 	goto translate_out
  57757 __1:
  57758 	;
  57759 	if !(int32(desiredEnc) == SQLITE_UTF8) {
  57760 		goto __5
  57761 	}
  57762 
  57763 	*(*int32)(unsafe.Pointer(pMem + 16)) &= libc.CplInt32(1)
  57764 	len = int64(2)*Sqlite3_int64((*Mem)(unsafe.Pointer(pMem)).Fn) + int64(1)
  57765 	goto __6
  57766 __5:
  57767 	len = int64(2)*Sqlite3_int64((*Mem)(unsafe.Pointer(pMem)).Fn) + int64(2)
  57768 __6:
  57769 	;
  57770 	zIn = (*Mem)(unsafe.Pointer(pMem)).Fz
  57771 	zTerm = zIn + uintptr((*Mem)(unsafe.Pointer(pMem)).Fn)
  57772 	zOut = Xsqlite3DbMallocRaw(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, uint64(len))
  57773 	if !!(zOut != 0) {
  57774 		goto __7
  57775 	}
  57776 	return SQLITE_NOMEM
  57777 __7:
  57778 	;
  57779 	z = zOut
  57780 
  57781 	if !(int32((*Mem)(unsafe.Pointer(pMem)).Fenc) == SQLITE_UTF8) {
  57782 		goto __8
  57783 	}
  57784 	if !(int32(desiredEnc) == SQLITE_UTF16LE) {
  57785 		goto __10
  57786 	}
  57787 
  57788 __12:
  57789 	if !(zIn < zTerm) {
  57790 		goto __13
  57791 	}
  57792 	c = uint32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))
  57793 	if !(c >= uint32(0xc0)) {
  57794 		goto __14
  57795 	}
  57796 	c = uint32(sqlite3Utf8Trans1[c-uint32(0xc0)])
  57797 __15:
  57798 	if !(zIn != zTerm && int32(*(*uint8)(unsafe.Pointer(zIn)))&0xc0 == 0x80) {
  57799 		goto __16
  57800 	}
  57801 	c = c<<6 + uint32(0x3f&int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))))
  57802 	goto __15
  57803 __16:
  57804 	;
  57805 	if !(c < uint32(0x80) || c&0xFFFFF800 == uint32(0xD800) || c&0xFFFFFFFE == uint32(0xFFFE)) {
  57806 		goto __17
  57807 	}
  57808 	c = uint32(0xFFFD)
  57809 __17:
  57810 	;
  57811 __14:
  57812 	;
  57813 	if !(c <= uint32(0xFFFF)) {
  57814 		goto __18
  57815 	}
  57816 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(c & uint32(0x00FF))
  57817 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(c >> 8 & uint32(0x00FF))
  57818 	goto __19
  57819 __18:
  57820 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(c>>10&uint32(0x003F) + (c-uint32(0x10000))>>10&uint32(0x00C0))
  57821 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(uint32(0x00D8) + (c-uint32(0x10000))>>18&uint32(0x03))
  57822 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(c & uint32(0x00FF))
  57823 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(uint32(0x00DC) + c>>8&uint32(0x03))
  57824 __19:
  57825 	;
  57826 	goto __12
  57827 __13:
  57828 	;
  57829 	goto __11
  57830 __10:
  57831 	;
  57832 __20:
  57833 	if !(zIn < zTerm) {
  57834 		goto __21
  57835 	}
  57836 	c = uint32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))
  57837 	if !(c >= uint32(0xc0)) {
  57838 		goto __22
  57839 	}
  57840 	c = uint32(sqlite3Utf8Trans1[c-uint32(0xc0)])
  57841 __23:
  57842 	if !(zIn != zTerm && int32(*(*uint8)(unsafe.Pointer(zIn)))&0xc0 == 0x80) {
  57843 		goto __24
  57844 	}
  57845 	c = c<<6 + uint32(0x3f&int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))))
  57846 	goto __23
  57847 __24:
  57848 	;
  57849 	if !(c < uint32(0x80) || c&0xFFFFF800 == uint32(0xD800) || c&0xFFFFFFFE == uint32(0xFFFE)) {
  57850 		goto __25
  57851 	}
  57852 	c = uint32(0xFFFD)
  57853 __25:
  57854 	;
  57855 __22:
  57856 	;
  57857 	if !(c <= uint32(0xFFFF)) {
  57858 		goto __26
  57859 	}
  57860 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(c >> 8 & uint32(0x00FF))
  57861 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(c & uint32(0x00FF))
  57862 	goto __27
  57863 __26:
  57864 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(uint32(0x00D8) + (c-uint32(0x10000))>>18&uint32(0x03))
  57865 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(c>>10&uint32(0x003F) + (c-uint32(0x10000))>>10&uint32(0x00C0))
  57866 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(uint32(0x00DC) + c>>8&uint32(0x03))
  57867 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(c & uint32(0x00FF))
  57868 __27:
  57869 	;
  57870 	goto __20
  57871 __21:
  57872 	;
  57873 __11:
  57874 	;
  57875 	(*Mem)(unsafe.Pointer(pMem)).Fn = int32((int64(z) - int64(zOut)) / 1)
  57876 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0)
  57877 	goto __9
  57878 __8:
  57879 	;
  57880 	if !(int32((*Mem)(unsafe.Pointer(pMem)).Fenc) == SQLITE_UTF16LE) {
  57881 		goto __28
  57882 	}
  57883 
  57884 __30:
  57885 	if !(zIn < zTerm) {
  57886 		goto __31
  57887 	}
  57888 	c = uint32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))
  57889 	c = c + uint32(int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))<<8)
  57890 	if !(c >= uint32(0xd800) && c < uint32(0xe000)) {
  57891 		goto __32
  57892 	}
  57893 	if !(zIn < zTerm) {
  57894 		goto __33
  57895 	}
  57896 	c2 = int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))
  57897 	c2 = c2 + int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))<<8
  57898 	c = uint32(c2&0x03FF) + c&uint32(0x003F)<<10 + (c&uint32(0x03C0)+uint32(0x0040))<<10
  57899 __33:
  57900 	;
  57901 __32:
  57902 	;
  57903 	if !(c < uint32(0x00080)) {
  57904 		goto __34
  57905 	}
  57906 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(c & uint32(0xFF))
  57907 	goto __35
  57908 __34:
  57909 	if !(c < uint32(0x00800)) {
  57910 		goto __36
  57911 	}
  57912 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0xC0 + int32(U8(c>>6&uint32(0x1F))))
  57913 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c&uint32(0x3F))))
  57914 	goto __37
  57915 __36:
  57916 	if !(c < uint32(0x10000)) {
  57917 		goto __38
  57918 	}
  57919 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0xE0 + int32(U8(c>>12&uint32(0x0F))))
  57920 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c>>6&uint32(0x3F))))
  57921 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c&uint32(0x3F))))
  57922 	goto __39
  57923 __38:
  57924 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0xF0 + int32(U8(c>>18&uint32(0x07))))
  57925 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c>>12&uint32(0x3F))))
  57926 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c>>6&uint32(0x3F))))
  57927 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c&uint32(0x3F))))
  57928 __39:
  57929 	;
  57930 __37:
  57931 	;
  57932 __35:
  57933 	;
  57934 	goto __30
  57935 __31:
  57936 	;
  57937 	goto __29
  57938 __28:
  57939 __40:
  57940 	if !(zIn < zTerm) {
  57941 		goto __41
  57942 	}
  57943 	c = uint32(int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))) << 8)
  57944 	c = c + uint32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))
  57945 	if !(c >= uint32(0xd800) && c < uint32(0xe000)) {
  57946 		goto __42
  57947 	}
  57948 	if !(zIn < zTerm) {
  57949 		goto __43
  57950 	}
  57951 	c21 = int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))) << 8
  57952 	c21 = c21 + int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))
  57953 	c = uint32(c21&0x03FF) + c&uint32(0x003F)<<10 + (c&uint32(0x03C0)+uint32(0x0040))<<10
  57954 __43:
  57955 	;
  57956 __42:
  57957 	;
  57958 	if !(c < uint32(0x00080)) {
  57959 		goto __44
  57960 	}
  57961 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = U8(c & uint32(0xFF))
  57962 	goto __45
  57963 __44:
  57964 	if !(c < uint32(0x00800)) {
  57965 		goto __46
  57966 	}
  57967 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0xC0 + int32(U8(c>>6&uint32(0x1F))))
  57968 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c&uint32(0x3F))))
  57969 	goto __47
  57970 __46:
  57971 	if !(c < uint32(0x10000)) {
  57972 		goto __48
  57973 	}
  57974 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0xE0 + int32(U8(c>>12&uint32(0x0F))))
  57975 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c>>6&uint32(0x3F))))
  57976 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c&uint32(0x3F))))
  57977 	goto __49
  57978 __48:
  57979 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0xF0 + int32(U8(c>>18&uint32(0x07))))
  57980 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c>>12&uint32(0x3F))))
  57981 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c>>6&uint32(0x3F))))
  57982 	*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0x80 + int32(U8(c&uint32(0x3F))))
  57983 __49:
  57984 	;
  57985 __47:
  57986 	;
  57987 __45:
  57988 	;
  57989 	goto __40
  57990 __41:
  57991 	;
  57992 __29:
  57993 	;
  57994 	(*Mem)(unsafe.Pointer(pMem)).Fn = int32((int64(z) - int64(zOut)) / 1)
  57995 __9:
  57996 	;
  57997 	*(*uint8)(unsafe.Pointer(z)) = uint8(0)
  57998 
  57999 	c = uint32(MEM_Str | MEM_Term | int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_AffMask|MEM_Subtype))
  58000 	Xsqlite3VdbeMemRelease(tls, pMem)
  58001 	(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(c)
  58002 	(*Mem)(unsafe.Pointer(pMem)).Fenc = desiredEnc
  58003 	(*Mem)(unsafe.Pointer(pMem)).Fz = zOut
  58004 	(*Mem)(unsafe.Pointer(pMem)).FzMalloc = (*Mem)(unsafe.Pointer(pMem)).Fz
  58005 	(*Mem)(unsafe.Pointer(pMem)).FszMalloc = Xsqlite3DbMallocSize(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, (*Mem)(unsafe.Pointer(pMem)).Fz)
  58006 
  58007 translate_out:
  58008 	return SQLITE_OK
  58009 }
  58010 
  58011 // This routine checks for a byte-order mark at the beginning of the
  58012 // UTF-16 string stored in *pMem. If one is present, it is removed and
  58013 // the encoding of the Mem adjusted. This routine does not do any
  58014 // byte-swapping, it just sets Mem.enc appropriately.
  58015 //
  58016 // The allocation (static, dynamic etc.) and encoding of the Mem may be
  58017 // changed by this function.
  58018 func Xsqlite3VdbeMemHandleBom(tls *libc.TLS, pMem uintptr) int32 {
  58019 	var rc int32 = SQLITE_OK
  58020 	var bom U8 = U8(0)
  58021 
  58022 	if (*Mem)(unsafe.Pointer(pMem)).Fn > 1 {
  58023 		var b1 U8 = *(*U8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz))
  58024 		var b2 U8 = *(*U8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr(1)))
  58025 		if int32(b1) == 0xFE && int32(b2) == 0xFF {
  58026 			bom = U8(SQLITE_UTF16BE)
  58027 		}
  58028 		if int32(b1) == 0xFF && int32(b2) == 0xFE {
  58029 			bom = U8(SQLITE_UTF16LE)
  58030 		}
  58031 	}
  58032 
  58033 	if bom != 0 {
  58034 		rc = Xsqlite3VdbeMemMakeWriteable(tls, pMem)
  58035 		if rc == SQLITE_OK {
  58036 			*(*int32)(unsafe.Pointer(pMem + 16)) -= 2
  58037 			libc.Xmemmove(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, (*Mem)(unsafe.Pointer(pMem)).Fz+2, uint64((*Mem)(unsafe.Pointer(pMem)).Fn))
  58038 			*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr((*Mem)(unsafe.Pointer(pMem)).Fn))) = int8(0)
  58039 			*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr((*Mem)(unsafe.Pointer(pMem)).Fn+1))) = int8(0)
  58040 			*(*U16)(unsafe.Pointer(pMem + 20)) |= U16(MEM_Term)
  58041 			(*Mem)(unsafe.Pointer(pMem)).Fenc = bom
  58042 		}
  58043 	}
  58044 	return rc
  58045 }
  58046 
  58047 // pZ is a UTF-8 encoded unicode string. If nByte is less than zero,
  58048 // return the number of unicode characters in pZ up to (but not including)
  58049 // the first 0x00 byte. If nByte is not less than zero, return the
  58050 // number of unicode characters in the first nByte of pZ (or up to
  58051 // the first 0x00, whichever comes first).
  58052 func Xsqlite3Utf8CharLen(tls *libc.TLS, zIn uintptr, nByte int32) int32 {
  58053 	var r int32 = 0
  58054 	var z uintptr = zIn
  58055 	var zTerm uintptr
  58056 	if nByte >= 0 {
  58057 		zTerm = z + uintptr(nByte)
  58058 	} else {
  58059 		zTerm = libc.UintptrFromInt32(-1)
  58060 	}
  58061 
  58062 	for int32(*(*U8)(unsafe.Pointer(z))) != 0 && z < zTerm {
  58063 		{
  58064 			if int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) >= 0xc0 {
  58065 				for int32(*(*U8)(unsafe.Pointer(z)))&0xc0 == 0x80 {
  58066 					z++
  58067 				}
  58068 			}
  58069 		}
  58070 
  58071 		r++
  58072 	}
  58073 	return r
  58074 }
  58075 
  58076 // Convert a UTF-16 string in the native encoding into a UTF-8 string.
  58077 // Memory to hold the UTF-8 string is obtained from sqlite3_malloc and must
  58078 // be freed by the calling function.
  58079 //
  58080 // NULL is returned if there is an allocation error.
  58081 func Xsqlite3Utf16to8(tls *libc.TLS, db uintptr, z uintptr, nByte int32, enc U8) uintptr {
  58082 	bp := tls.Alloc(56)
  58083 	defer tls.Free(56)
  58084 
  58085 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Mem{})))
  58086 	(*Mem)(unsafe.Pointer(bp)).Fdb = db
  58087 	Xsqlite3VdbeMemSetStr(tls, bp, z, int64(nByte), enc, uintptr(0))
  58088 	Xsqlite3VdbeChangeEncoding(tls, bp, SQLITE_UTF8)
  58089 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
  58090 		Xsqlite3VdbeMemRelease(tls, bp)
  58091 		(*Mem)(unsafe.Pointer(bp)).Fz = uintptr(0)
  58092 	}
  58093 
  58094 	return (*Mem)(unsafe.Pointer(bp)).Fz
  58095 }
  58096 
  58097 // zIn is a UTF-16 encoded unicode string at least nChar characters long.
  58098 // Return the number of bytes in the first nChar unicode characters
  58099 // in pZ.  nChar must be non-negative.
  58100 func Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 {
  58101 	var c int32
  58102 	var z uintptr = zIn
  58103 	var n int32 = 0
  58104 
  58105 	if SQLITE_UTF16LE == SQLITE_UTF16LE {
  58106 		z++
  58107 	}
  58108 	for n < nChar {
  58109 		c = int32(*(*uint8)(unsafe.Pointer(z)))
  58110 		z += uintptr(2)
  58111 		if c >= 0xd8 && c < 0xdc && int32(*(*uint8)(unsafe.Pointer(z))) >= 0xdc && int32(*(*uint8)(unsafe.Pointer(z))) < 0xe0 {
  58112 			z += uintptr(2)
  58113 		}
  58114 		n++
  58115 	}
  58116 	return int32((int64(z)-int64(zIn))/1) -
  58117 		libc.Bool32(SQLITE_UTF16LE == SQLITE_UTF16LE)
  58118 }
  58119 
  58120 type _exception = struct {
  58121 	Ftype        int32
  58122 	F__ccgo_pad1 [4]byte
  58123 	Fname        uintptr
  58124 	Farg1        float64
  58125 	Farg2        float64
  58126 	Fretval      float64
  58127 }
  58128 
  58129 type __mingw_dbl_type_t = struct{ Fx float64 }
  58130 
  58131 type X__mingw_dbl_type_t = __mingw_dbl_type_t
  58132 
  58133 type __mingw_flt_type_t = struct{ Fx float32 }
  58134 
  58135 type X__mingw_flt_type_t = __mingw_flt_type_t
  58136 
  58137 type __mingw_ldbl_type_t = struct {
  58138 	Fx           float64
  58139 	F__ccgo_pad1 [8]byte
  58140 }
  58141 
  58142 type X__mingw_ldbl_type_t = __mingw_ldbl_type_t
  58143 
  58144 type _complex = struct {
  58145 	Fx float64
  58146 	Fy float64
  58147 }
  58148 
  58149 // Use the compiler's builtin define for FLT_EVAL_METHOD to
  58150 //
  58151 //	set float_t and double_t.
  58152 type Float_t = float32
  58153 type Double_t = float64
  58154 
  58155 // Calls to sqlite3FaultSim() are used to simulate a failure during testing,
  58156 // or to bypass normal error detection during testing in order to let
  58157 // execute proceed futher downstream.
  58158 //
  58159 // In deployment, sqlite3FaultSim() *always* return SQLITE_OK (0).  The
  58160 // sqlite3FaultSim() function only returns non-zero during testing.
  58161 //
  58162 // During testing, if the test harness has set a fault-sim callback using
  58163 // a call to sqlite3_test_control(SQLITE_TESTCTRL_FAULT_INSTALL), then
  58164 // each call to sqlite3FaultSim() is relayed to that application-supplied
  58165 // callback and the integer return value form the application-supplied
  58166 // callback is returned by sqlite3FaultSim().
  58167 //
  58168 // The integer argument to sqlite3FaultSim() is a code to identify which
  58169 // sqlite3FaultSim() instance is being invoked. Each call to sqlite3FaultSim()
  58170 // should have a unique code.  To prevent legacy testing applications from
  58171 // breaking, the codes should not be changed or reused.
  58172 func Xsqlite3FaultSim(tls *libc.TLS, iTest int32) int32 {
  58173 	var xCallback uintptr = Xsqlite3Config.FxTestCallback
  58174 	if xCallback != 0 {
  58175 		return (*struct{ f func(*libc.TLS, int32) int32 })(unsafe.Pointer(&struct{ uintptr }{xCallback})).f(tls, iTest)
  58176 	}
  58177 	return SQLITE_OK
  58178 }
  58179 
  58180 // Return true if the floating point value is Not a Number (NaN).
  58181 //
  58182 // Use the math library isnan() function if compiled with SQLITE_HAVE_ISNAN.
  58183 // Otherwise, we have our own implementation that works on most systems.
  58184 func Xsqlite3IsNaN(tls *libc.TLS, x float64) int32 {
  58185 	bp := tls.Alloc(16)
  58186 	defer tls.Free(16)
  58187 	*(*float64)(unsafe.Pointer(bp + 8)) = x
  58188 
  58189 	var rc int32
  58190 
  58191 	libc.Xmemcpy(tls, bp, bp+8, uint64(unsafe.Sizeof(U64(0))))
  58192 	rc = libc.Bool32(*(*U64)(unsafe.Pointer(bp))&(uint64(0x7ff)<<52) == uint64(0x7ff)<<52 && *(*U64)(unsafe.Pointer(bp))&(uint64(1)<<52-uint64(1)) != uint64(0))
  58193 
  58194 	return rc
  58195 }
  58196 
  58197 // Compute a string length that is limited to what can be stored in
  58198 // lower 30 bits of a 32-bit signed integer.
  58199 //
  58200 // The value returned will never be negative.  Nor will it ever be greater
  58201 // than the actual length of the string.  For very long strings (greater
  58202 // than 1GiB) the value returned might be less than the true string length.
  58203 func Xsqlite3Strlen30(tls *libc.TLS, z uintptr) int32 {
  58204 	if z == uintptr(0) {
  58205 		return 0
  58206 	}
  58207 	return 0x3fffffff & int32(libc.Xstrlen(tls, z))
  58208 }
  58209 
  58210 // Return the declared type of a column.  Or return zDflt if the column
  58211 // has no declared type.
  58212 //
  58213 // The column type is an extra string stored after the zero-terminator on
  58214 // the column name if and only if the COLFLAG_HASTYPE flag is set.
  58215 func Xsqlite3ColumnType(tls *libc.TLS, pCol uintptr, zDflt uintptr) uintptr {
  58216 	if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_HASTYPE != 0 {
  58217 		return (*Column)(unsafe.Pointer(pCol)).FzCnName + uintptr(libc.Xstrlen(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName)) + uintptr(1)
  58218 	} else if uint32(int32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf0>>4)) != 0 {
  58219 		return Xsqlite3StdType[(int32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf0>>4)-1)&0xf<<28>>28]
  58220 	} else {
  58221 		return zDflt
  58222 	}
  58223 	return uintptr(0)
  58224 }
  58225 
  58226 func sqlite3ErrorFinish(tls *libc.TLS, db uintptr, err_code int32) {
  58227 	if (*Sqlite3)(unsafe.Pointer(db)).FpErr != 0 {
  58228 		Xsqlite3ValueSetNull(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr)
  58229 	}
  58230 	Xsqlite3SystemError(tls, db, err_code)
  58231 }
  58232 
  58233 // Set the current error code to err_code and clear any prior error message.
  58234 // Also set iSysErrno (by calling sqlite3System) if the err_code indicates
  58235 // that would be appropriate.
  58236 func Xsqlite3Error(tls *libc.TLS, db uintptr, err_code int32) {
  58237 	(*Sqlite3)(unsafe.Pointer(db)).FerrCode = err_code
  58238 	if err_code != 0 || (*Sqlite3)(unsafe.Pointer(db)).FpErr != 0 {
  58239 		sqlite3ErrorFinish(tls, db, err_code)
  58240 	} else {
  58241 		(*Sqlite3)(unsafe.Pointer(db)).FerrByteOffset = -1
  58242 	}
  58243 }
  58244 
  58245 // The equivalent of sqlite3Error(db, SQLITE_OK).  Clear the error state
  58246 // and error message.
  58247 func Xsqlite3ErrorClear(tls *libc.TLS, db uintptr) {
  58248 	(*Sqlite3)(unsafe.Pointer(db)).FerrCode = SQLITE_OK
  58249 	(*Sqlite3)(unsafe.Pointer(db)).FerrByteOffset = -1
  58250 	if (*Sqlite3)(unsafe.Pointer(db)).FpErr != 0 {
  58251 		Xsqlite3ValueSetNull(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr)
  58252 	}
  58253 }
  58254 
  58255 // Load the sqlite3.iSysErrno field if that is an appropriate thing
  58256 // to do based on the SQLite error code in rc.
  58257 func Xsqlite3SystemError(tls *libc.TLS, db uintptr, rc int32) {
  58258 	if rc == SQLITE_IOERR|int32(12)<<8 {
  58259 		return
  58260 	}
  58261 	rc = rc & 0xff
  58262 	if rc == SQLITE_CANTOPEN || rc == SQLITE_IOERR {
  58263 		(*Sqlite3)(unsafe.Pointer(db)).FiSysErrno = Xsqlite3OsGetLastError(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs)
  58264 	}
  58265 }
  58266 
  58267 // Set the most recent error code and error string for the sqlite
  58268 // handle "db". The error code is set to "err_code".
  58269 //
  58270 // If it is not NULL, string zFormat specifies the format of the
  58271 // error string.  zFormat and any string tokens that follow it are
  58272 // assumed to be encoded in UTF-8.
  58273 //
  58274 // To clear the most recent error for sqlite handle "db", sqlite3Error
  58275 // should be called with err_code set to SQLITE_OK and zFormat set
  58276 // to NULL.
  58277 func Xsqlite3ErrorWithMsg(tls *libc.TLS, db uintptr, err_code int32, zFormat uintptr, va uintptr) {
  58278 	(*Sqlite3)(unsafe.Pointer(db)).FerrCode = err_code
  58279 	Xsqlite3SystemError(tls, db, err_code)
  58280 	if zFormat == uintptr(0) {
  58281 		Xsqlite3Error(tls, db, err_code)
  58282 	} else if (*Sqlite3)(unsafe.Pointer(db)).FpErr != 0 || libc.AssignPtrUintptr(db+424, Xsqlite3ValueNew(tls, db)) != uintptr(0) {
  58283 		var z uintptr
  58284 		var ap Va_list
  58285 		_ = ap
  58286 		ap = va
  58287 		z = Xsqlite3VMPrintf(tls, db, zFormat, ap)
  58288 		_ = ap
  58289 		Xsqlite3ValueSetStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr, -1, z, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomClear})))
  58290 	}
  58291 }
  58292 
  58293 // Check for interrupts and invoke progress callback.
  58294 func Xsqlite3ProgressCheck(tls *libc.TLS, p uintptr) {
  58295 	var db uintptr = (*Parse)(unsafe.Pointer(p)).Fdb
  58296 	if libc.AtomicLoadNInt32(db+432, 0) != 0 {
  58297 		(*Parse)(unsafe.Pointer(p)).FnErr++
  58298 		(*Parse)(unsafe.Pointer(p)).Frc = SQLITE_INTERRUPT
  58299 	}
  58300 	if (*Sqlite3)(unsafe.Pointer(db)).FxProgress != 0 && libc.PreIncUint32(&(*Parse)(unsafe.Pointer(p)).FnProgressSteps, 1) >= (*Sqlite3)(unsafe.Pointer(db)).FnProgressOps {
  58301 		if (*struct {
  58302 			f func(*libc.TLS, uintptr) int32
  58303 		})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxProgress})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProgressArg) != 0 {
  58304 			(*Parse)(unsafe.Pointer(p)).FnErr++
  58305 			(*Parse)(unsafe.Pointer(p)).Frc = SQLITE_INTERRUPT
  58306 		}
  58307 		(*Parse)(unsafe.Pointer(p)).FnProgressSteps = U32(0)
  58308 	}
  58309 }
  58310 
  58311 // Add an error message to pParse->zErrMsg and increment pParse->nErr.
  58312 //
  58313 // This function should be used to report any error that occurs while
  58314 // compiling an SQL statement (i.e. within sqlite3_prepare()). The
  58315 // last thing the sqlite3_prepare() function does is copy the error
  58316 // stored by this function into the database handle using sqlite3Error().
  58317 // Functions sqlite3Error() or sqlite3ErrorWithMsg() should be used
  58318 // during statement execution (sqlite3_step() etc.).
  58319 func Xsqlite3ErrorMsg(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr) {
  58320 	var zMsg uintptr
  58321 	var ap Va_list
  58322 	_ = ap
  58323 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
  58324 
  58325 	(*Sqlite3)(unsafe.Pointer(db)).FerrByteOffset = -2
  58326 	ap = va
  58327 	zMsg = Xsqlite3VMPrintf(tls, db, zFormat, ap)
  58328 	_ = ap
  58329 	if (*Sqlite3)(unsafe.Pointer(db)).FerrByteOffset < -1 {
  58330 		(*Sqlite3)(unsafe.Pointer(db)).FerrByteOffset = -1
  58331 	}
  58332 	if (*Sqlite3)(unsafe.Pointer(db)).FsuppressErr != 0 {
  58333 		Xsqlite3DbFree(tls, db, zMsg)
  58334 		if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
  58335 			(*Parse)(unsafe.Pointer(pParse)).FnErr++
  58336 			(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_NOMEM
  58337 		}
  58338 	} else {
  58339 		(*Parse)(unsafe.Pointer(pParse)).FnErr++
  58340 		Xsqlite3DbFree(tls, db, (*Parse)(unsafe.Pointer(pParse)).FzErrMsg)
  58341 		(*Parse)(unsafe.Pointer(pParse)).FzErrMsg = zMsg
  58342 		(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR
  58343 		(*Parse)(unsafe.Pointer(pParse)).FpWith = uintptr(0)
  58344 	}
  58345 }
  58346 
  58347 // If database connection db is currently parsing SQL, then transfer
  58348 // error code errCode to that parser if the parser has not already
  58349 // encountered some other kind of error.
  58350 func Xsqlite3ErrorToParser(tls *libc.TLS, db uintptr, errCode int32) int32 {
  58351 	var pParse uintptr
  58352 	if db == uintptr(0) || libc.AssignUintptr(&pParse, (*Sqlite3)(unsafe.Pointer(db)).FpParse) == uintptr(0) {
  58353 		return errCode
  58354 	}
  58355 	(*Parse)(unsafe.Pointer(pParse)).Frc = errCode
  58356 	(*Parse)(unsafe.Pointer(pParse)).FnErr++
  58357 	return errCode
  58358 }
  58359 
  58360 // Convert an SQL-style quoted string into a normal string by removing
  58361 // the quote characters.  The conversion is done in-place.  If the
  58362 // input does not begin with a quote character, then this routine
  58363 // is a no-op.
  58364 //
  58365 // The input string must be zero-terminated.  A new zero-terminator
  58366 // is added to the dequoted string.
  58367 //
  58368 // The return value is -1 if no dequoting occurs or the length of the
  58369 // dequoted string, exclusive of the zero terminator, if dequoting does
  58370 // occur.
  58371 //
  58372 // 2002-02-14: This routine is extended to remove MS-Access style
  58373 // brackets from around identifiers.  For example:  "[a-b-c]" becomes
  58374 // "a-b-c".
  58375 func Xsqlite3Dequote(tls *libc.TLS, z uintptr) {
  58376 	var quote int8
  58377 	var i int32
  58378 	var j int32
  58379 	if z == uintptr(0) {
  58380 		return
  58381 	}
  58382 	quote = *(*int8)(unsafe.Pointer(z))
  58383 	if !(int32(Xsqlite3CtypeMap[uint8(quote)])&0x80 != 0) {
  58384 		return
  58385 	}
  58386 	if int32(quote) == '[' {
  58387 		quote = int8(']')
  58388 	}
  58389 	i = 1
  58390 	j = 0
  58391 	for ; ; i++ {
  58392 		if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32(quote) {
  58393 			if int32(*(*int8)(unsafe.Pointer(z + uintptr(i+1)))) == int32(quote) {
  58394 				*(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&j, 1)))) = quote
  58395 				i++
  58396 			} else {
  58397 				break
  58398 			}
  58399 		} else {
  58400 			*(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&j, 1)))) = *(*int8)(unsafe.Pointer(z + uintptr(i)))
  58401 		}
  58402 	}
  58403 	*(*int8)(unsafe.Pointer(z + uintptr(j))) = int8(0)
  58404 }
  58405 
  58406 func Xsqlite3DequoteExpr(tls *libc.TLS, p uintptr) {
  58407 	*(*U32)(unsafe.Pointer(p + 4)) |= func() uint32 {
  58408 		if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 8))))) == '"' {
  58409 			return uint32(EP_Quoted | EP_DblQuoted)
  58410 		}
  58411 		return uint32(EP_Quoted)
  58412 	}()
  58413 	Xsqlite3Dequote(tls, *(*uintptr)(unsafe.Pointer(p + 8)))
  58414 }
  58415 
  58416 // If the input token p is quoted, try to adjust the token to remove
  58417 // the quotes.  This is not always possible:
  58418 //
  58419 //	"abc"     ->   abc
  58420 //	"ab""cd"  ->   (not possible because of the interior "")
  58421 //
  58422 // Remove the quotes if possible.  This is a optimization.  The overall
  58423 // system should still return the correct answer even if this routine
  58424 // is always a no-op.
  58425 func Xsqlite3DequoteToken(tls *libc.TLS, p uintptr) {
  58426 	var i uint32
  58427 	if (*Token)(unsafe.Pointer(p)).Fn < uint32(2) {
  58428 		return
  58429 	}
  58430 	if !(int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(p)).Fz)))])&0x80 != 0) {
  58431 		return
  58432 	}
  58433 	for i = uint32(1); i < (*Token)(unsafe.Pointer(p)).Fn-uint32(1); i++ {
  58434 		if int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(p)).Fz + uintptr(i))))])&0x80 != 0 {
  58435 			return
  58436 		}
  58437 	}
  58438 	*(*uint32)(unsafe.Pointer(p + 8)) -= uint32(2)
  58439 	(*Token)(unsafe.Pointer(p)).Fz++
  58440 }
  58441 
  58442 // Generate a Token object from a string
  58443 func Xsqlite3TokenInit(tls *libc.TLS, p uintptr, z uintptr) {
  58444 	(*Token)(unsafe.Pointer(p)).Fz = z
  58445 	(*Token)(unsafe.Pointer(p)).Fn = uint32(Xsqlite3Strlen30(tls, z))
  58446 }
  58447 
  58448 // Some systems have stricmp().  Others have strcasecmp().  Because
  58449 // there is no consistency, we will define our own.
  58450 //
  58451 // IMPLEMENTATION-OF: R-30243-02494 The sqlite3_stricmp() and
  58452 // sqlite3_strnicmp() APIs allow applications and extensions to compare
  58453 // the contents of two buffers containing UTF-8 strings in a
  58454 // case-independent fashion, using the same definition of "case
  58455 // independence" that SQLite uses internally when comparing identifiers.
  58456 func Xsqlite3_stricmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) int32 {
  58457 	if zLeft == uintptr(0) {
  58458 		if zRight != 0 {
  58459 			return -1
  58460 		}
  58461 		return 0
  58462 	} else if zRight == uintptr(0) {
  58463 		return 1
  58464 	}
  58465 	return Xsqlite3StrICmp(tls, zLeft, zRight)
  58466 }
  58467 
  58468 func Xsqlite3StrICmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) int32 {
  58469 	var a uintptr
  58470 	var b uintptr
  58471 	var c int32
  58472 	var x int32
  58473 	a = zLeft
  58474 	b = zRight
  58475 	for {
  58476 		c = int32(*(*uint8)(unsafe.Pointer(a)))
  58477 		x = int32(*(*uint8)(unsafe.Pointer(b)))
  58478 		if c == x {
  58479 			if c == 0 {
  58480 				break
  58481 			}
  58482 		} else {
  58483 			c = int32(Xsqlite3UpperToLower[c]) - int32(Xsqlite3UpperToLower[x])
  58484 			if c != 0 {
  58485 				break
  58486 			}
  58487 		}
  58488 		a++
  58489 		b++
  58490 	}
  58491 	return c
  58492 }
  58493 
  58494 func Xsqlite3_strnicmp(tls *libc.TLS, zLeft uintptr, zRight uintptr, N int32) int32 {
  58495 	var a uintptr
  58496 	var b uintptr
  58497 	if zLeft == uintptr(0) {
  58498 		if zRight != 0 {
  58499 			return -1
  58500 		}
  58501 		return 0
  58502 	} else if zRight == uintptr(0) {
  58503 		return 1
  58504 	}
  58505 	a = zLeft
  58506 	b = zRight
  58507 	for libc.PostDecInt32(&N, 1) > 0 && int32(*(*uint8)(unsafe.Pointer(a))) != 0 && int32(Xsqlite3UpperToLower[*(*uint8)(unsafe.Pointer(a))]) == int32(Xsqlite3UpperToLower[*(*uint8)(unsafe.Pointer(b))]) {
  58508 		a++
  58509 		b++
  58510 	}
  58511 	if N < 0 {
  58512 		return 0
  58513 	}
  58514 	return int32(Xsqlite3UpperToLower[*(*uint8)(unsafe.Pointer(a))]) - int32(Xsqlite3UpperToLower[*(*uint8)(unsafe.Pointer(b))])
  58515 }
  58516 
  58517 // Compute an 8-bit hash on a string that is insensitive to case differences
  58518 func Xsqlite3StrIHash(tls *libc.TLS, z uintptr) U8 {
  58519 	var h U8 = U8(0)
  58520 	if z == uintptr(0) {
  58521 		return U8(0)
  58522 	}
  58523 	for *(*int8)(unsafe.Pointer(z)) != 0 {
  58524 		h = U8(int32(h) + int32(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(z)))]))
  58525 		z++
  58526 	}
  58527 	return h
  58528 }
  58529 
  58530 func sqlite3Pow10(tls *libc.TLS, E int32) float64 {
  58531 	var r float64 = 1.0
  58532 	var i int32
  58533 
  58534 	i = 0
  58535 __1:
  58536 	if !(E != 0) {
  58537 		goto __3
  58538 	}
  58539 	{
  58540 		if E&1 != 0 {
  58541 			r = r * x[i]
  58542 		}
  58543 
  58544 	}
  58545 	goto __2
  58546 __2:
  58547 	i++
  58548 	E >>= 1
  58549 	goto __1
  58550 	goto __3
  58551 __3:
  58552 	;
  58553 	return r
  58554 }
  58555 
  58556 var x = [9]float64{
  58557 	1.0e+001,
  58558 	1.0e+002,
  58559 	1.0e+004,
  58560 	1.0e+008,
  58561 	1.0e+016,
  58562 	1.0e+032,
  58563 	1.0e+064,
  58564 	1.0e+128,
  58565 	1.0e+256,
  58566 }
  58567 
  58568 // The string z[] is an text representation of a real number.
  58569 // Convert this string to a double and write it into *pResult.
  58570 //
  58571 // The string z[] is length bytes in length (bytes, not characters) and
  58572 // uses the encoding enc.  The string is not necessarily zero-terminated.
  58573 //
  58574 // Return TRUE if the result is a valid real number (or integer) and FALSE
  58575 // if the string is empty or contains extraneous text.  More specifically
  58576 // return
  58577 //
  58578 //	 1          =>  The input string is a pure integer
  58579 //	 2 or more  =>  The input has a decimal point or eNNN clause
  58580 //	 0 or less  =>  The input string is not a valid number
  58581 //	-1          =>  Not a valid number, but has a valid prefix which
  58582 //	                includes a decimal point and/or an eNNN clause
  58583 //
  58584 // Valid numbers are in one of these formats:
  58585 //
  58586 //	[+-]digits[E[+-]digits]
  58587 //	[+-]digits.[digits][E[+-]digits]
  58588 //	[+-].digits[E[+-]digits]
  58589 //
  58590 // Leading and trailing whitespace is ignored for the purpose of determining
  58591 // validity.
  58592 //
  58593 // If some prefix of the input string is a valid number, this routine
  58594 // returns FALSE but it still converts the prefix and writes the result
  58595 // into *pResult.
  58596 func Xsqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc U8) int32 {
  58597 	var incr int32
  58598 	var zEnd uintptr
  58599 
  58600 	var sign int32
  58601 	var s I64
  58602 	var d int32
  58603 	var esign int32
  58604 	var e int32
  58605 	var eValid int32
  58606 	var result float64
  58607 	var nDigit int32
  58608 	var eType int32
  58609 	var i int32
  58610 	var scale float64
  58611 	var scale1 float64
  58612 	sign = 1
  58613 	s = int64(0)
  58614 	d = 0
  58615 	esign = 1
  58616 	e = 0
  58617 	eValid = 1
  58618 	nDigit = 0
  58619 	eType = 1
  58620 
  58621 	*(*float64)(unsafe.Pointer(pResult)) = 0.0
  58622 	if !(length == 0) {
  58623 		goto __1
  58624 	}
  58625 	return 0
  58626 __1:
  58627 	;
  58628 	if !(int32(enc) == SQLITE_UTF8) {
  58629 		goto __2
  58630 	}
  58631 	incr = 1
  58632 	zEnd = z + uintptr(length)
  58633 	goto __3
  58634 __2:
  58635 	incr = 2
  58636 	length = length & libc.CplInt32(1)
  58637 
  58638 	i = 3 - int32(enc)
  58639 __4:
  58640 	if !(i < length && int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == 0) {
  58641 		goto __6
  58642 	}
  58643 	goto __5
  58644 __5:
  58645 	i = i + 2
  58646 	goto __4
  58647 	goto __6
  58648 __6:
  58649 	;
  58650 	if !(i < length) {
  58651 		goto __7
  58652 	}
  58653 	eType = -100
  58654 __7:
  58655 	;
  58656 	zEnd = z + uintptr(i^1)
  58657 	z += uintptr(int32(enc) & 1)
  58658 __3:
  58659 	;
  58660 __8:
  58661 	if !(z < zEnd && int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&0x01 != 0) {
  58662 		goto __9
  58663 	}
  58664 	z += uintptr(incr)
  58665 	goto __8
  58666 __9:
  58667 	;
  58668 	if !(z >= zEnd) {
  58669 		goto __10
  58670 	}
  58671 	return 0
  58672 __10:
  58673 	;
  58674 	if !(int32(*(*int8)(unsafe.Pointer(z))) == '-') {
  58675 		goto __11
  58676 	}
  58677 	sign = -1
  58678 	z += uintptr(incr)
  58679 	goto __12
  58680 __11:
  58681 	if !(int32(*(*int8)(unsafe.Pointer(z))) == '+') {
  58682 		goto __13
  58683 	}
  58684 	z += uintptr(incr)
  58685 __13:
  58686 	;
  58687 __12:
  58688 	;
  58689 __14:
  58690 	if !(z < zEnd && int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&0x04 != 0) {
  58691 		goto __15
  58692 	}
  58693 	s = s*int64(10) + I64(int32(*(*int8)(unsafe.Pointer(z)))-'0')
  58694 	z += uintptr(incr)
  58695 	nDigit++
  58696 	if !(s >= (int64(0xffffffff)|int64(0x7fffffff)<<32-int64(9))/int64(10)) {
  58697 		goto __16
  58698 	}
  58699 
  58700 __17:
  58701 	if !(z < zEnd && int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&0x04 != 0) {
  58702 		goto __18
  58703 	}
  58704 	z += uintptr(incr)
  58705 	d++
  58706 	goto __17
  58707 __18:
  58708 	;
  58709 __16:
  58710 	;
  58711 	goto __14
  58712 __15:
  58713 	;
  58714 	if !(z >= zEnd) {
  58715 		goto __19
  58716 	}
  58717 	goto do_atof_calc
  58718 __19:
  58719 	;
  58720 	if !(int32(*(*int8)(unsafe.Pointer(z))) == '.') {
  58721 		goto __20
  58722 	}
  58723 	z += uintptr(incr)
  58724 	eType++
  58725 
  58726 __21:
  58727 	if !(z < zEnd && int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&0x04 != 0) {
  58728 		goto __22
  58729 	}
  58730 	if !(s < (int64(0xffffffff)|int64(0x7fffffff)<<32-int64(9))/int64(10)) {
  58731 		goto __23
  58732 	}
  58733 	s = s*int64(10) + I64(int32(*(*int8)(unsafe.Pointer(z)))-'0')
  58734 	d--
  58735 	nDigit++
  58736 __23:
  58737 	;
  58738 	z += uintptr(incr)
  58739 	goto __21
  58740 __22:
  58741 	;
  58742 __20:
  58743 	;
  58744 	if !(z >= zEnd) {
  58745 		goto __24
  58746 	}
  58747 	goto do_atof_calc
  58748 __24:
  58749 	;
  58750 	if !(int32(*(*int8)(unsafe.Pointer(z))) == 'e' || int32(*(*int8)(unsafe.Pointer(z))) == 'E') {
  58751 		goto __25
  58752 	}
  58753 	z += uintptr(incr)
  58754 	eValid = 0
  58755 	eType++
  58756 
  58757 	if !(z >= zEnd) {
  58758 		goto __26
  58759 	}
  58760 	goto do_atof_calc
  58761 __26:
  58762 	;
  58763 	if !(int32(*(*int8)(unsafe.Pointer(z))) == '-') {
  58764 		goto __27
  58765 	}
  58766 	esign = -1
  58767 	z += uintptr(incr)
  58768 	goto __28
  58769 __27:
  58770 	if !(int32(*(*int8)(unsafe.Pointer(z))) == '+') {
  58771 		goto __29
  58772 	}
  58773 	z += uintptr(incr)
  58774 __29:
  58775 	;
  58776 __28:
  58777 	;
  58778 __30:
  58779 	if !(z < zEnd && int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&0x04 != 0) {
  58780 		goto __31
  58781 	}
  58782 	if e < 10000 {
  58783 		e = e*10 + (int32(*(*int8)(unsafe.Pointer(z))) - '0')
  58784 	} else {
  58785 		e = 10000
  58786 	}
  58787 	z += uintptr(incr)
  58788 	eValid = 1
  58789 	goto __30
  58790 __31:
  58791 	;
  58792 __25:
  58793 	;
  58794 __32:
  58795 	if !(z < zEnd && int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&0x01 != 0) {
  58796 		goto __33
  58797 	}
  58798 	z += uintptr(incr)
  58799 	goto __32
  58800 __33:
  58801 	;
  58802 do_atof_calc:
  58803 	e = e*esign + d
  58804 	if !(e < 0) {
  58805 		goto __34
  58806 	}
  58807 	esign = -1
  58808 	e = e * -1
  58809 	goto __35
  58810 __34:
  58811 	esign = 1
  58812 __35:
  58813 	;
  58814 	if !(s == int64(0)) {
  58815 		goto __36
  58816 	}
  58817 
  58818 	if sign < 0 {
  58819 		result = -libc.Float64FromFloat64(float64(0))
  58820 	} else {
  58821 		result = float64(0)
  58822 	}
  58823 	goto __37
  58824 __36:
  58825 __38:
  58826 	if !(e > 0) {
  58827 		goto __39
  58828 	}
  58829 	if !(esign > 0) {
  58830 		goto __40
  58831 	}
  58832 	if !(s >= (int64(0xffffffff)|int64(0x7fffffff)<<32)/int64(10)) {
  58833 		goto __42
  58834 	}
  58835 	goto __39
  58836 __42:
  58837 	;
  58838 	s = s * int64(10)
  58839 	goto __41
  58840 __40:
  58841 	if !(s%int64(10) != int64(0)) {
  58842 		goto __43
  58843 	}
  58844 	goto __39
  58845 __43:
  58846 	;
  58847 	s = s / int64(10)
  58848 __41:
  58849 	;
  58850 	e--
  58851 	goto __38
  58852 __39:
  58853 	;
  58854 	if sign < 0 {
  58855 		s = -s
  58856 	} else {
  58857 		s = s
  58858 	}
  58859 
  58860 	if !(e == 0) {
  58861 		goto __44
  58862 	}
  58863 	result = float64(s)
  58864 	goto __45
  58865 __44:
  58866 	if !(e > 307) {
  58867 		goto __46
  58868 	}
  58869 	if !(e < 342) {
  58870 		goto __48
  58871 	}
  58872 	scale = sqlite3Pow10(tls, e-308)
  58873 	if !(esign < 0) {
  58874 		goto __50
  58875 	}
  58876 	result = float64(s) / scale
  58877 	result = result / 1.0e+308
  58878 	goto __51
  58879 __50:
  58880 	result = float64(s) * scale
  58881 	result = result * 1.0e+308
  58882 __51:
  58883 	;
  58884 	goto __49
  58885 __48:
  58886 	;
  58887 	if !(esign < 0) {
  58888 		goto __52
  58889 	}
  58890 	result = 0.0 * float64(s)
  58891 	goto __53
  58892 __52:
  58893 	result = float64(libc.X__builtin_inff(tls) * float32(s))
  58894 __53:
  58895 	;
  58896 __49:
  58897 	;
  58898 	goto __47
  58899 __46:
  58900 	scale1 = sqlite3Pow10(tls, e)
  58901 	if !(esign < 0) {
  58902 		goto __54
  58903 	}
  58904 	result = float64(s) / scale1
  58905 	goto __55
  58906 __54:
  58907 	result = float64(s) * scale1
  58908 __55:
  58909 	;
  58910 __47:
  58911 	;
  58912 __45:
  58913 	;
  58914 __37:
  58915 	;
  58916 	*(*float64)(unsafe.Pointer(pResult)) = result
  58917 
  58918 	if !(z == zEnd && nDigit > 0 && eValid != 0 && eType > 0) {
  58919 		goto __56
  58920 	}
  58921 	return eType
  58922 	goto __57
  58923 __56:
  58924 	if !(eType >= 2 && (eType == 3 || eValid != 0) && nDigit > 0) {
  58925 		goto __58
  58926 	}
  58927 	return -1
  58928 	goto __59
  58929 __58:
  58930 	return 0
  58931 __59:
  58932 	;
  58933 __57:
  58934 	;
  58935 	return int32(0)
  58936 }
  58937 
  58938 // Render an signed 64-bit integer as text.  Store the result in zOut[] and
  58939 // return the length of the string that was stored, in bytes.  The value
  58940 // returned does not include the zero terminator at the end of the output
  58941 // string.
  58942 //
  58943 // The caller must ensure that zOut[] is at least 21 bytes in size.
  58944 func Xsqlite3Int64ToText(tls *libc.TLS, v I64, zOut uintptr) int32 {
  58945 	bp := tls.Alloc(22)
  58946 	defer tls.Free(22)
  58947 
  58948 	var i int32
  58949 	var x U64
  58950 
  58951 	if v < int64(0) {
  58952 		if v == int64(-1)-(int64(0xffffffff)|int64(0x7fffffff)<<32) {
  58953 			x = uint64(1) << 63
  58954 		} else {
  58955 			x = U64(-v)
  58956 		}
  58957 	} else {
  58958 		x = U64(v)
  58959 	}
  58960 	i = int32(uint64(unsafe.Sizeof([22]int8{})) - uint64(2))
  58961 	*(*int8)(unsafe.Pointer(bp + 21)) = int8(0)
  58962 	for __ccgo := true; __ccgo; __ccgo = x != 0 {
  58963 		*(*int8)(unsafe.Pointer(bp + uintptr(libc.PostDecInt32(&i, 1)))) = int8(x%uint64(10) + uint64('0'))
  58964 		x = x / uint64(10)
  58965 	}
  58966 	if v < int64(0) {
  58967 		*(*int8)(unsafe.Pointer(bp + uintptr(libc.PostDecInt32(&i, 1)))) = int8('-')
  58968 	}
  58969 	libc.Xmemcpy(tls, zOut, bp+uintptr(i+1), uint64(unsafe.Sizeof([22]int8{}))-uint64(1)-uint64(i))
  58970 	return int32(uint64(unsafe.Sizeof([22]int8{})) - uint64(2) - uint64(i))
  58971 }
  58972 
  58973 func compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) int32 {
  58974 	var c int32 = 0
  58975 	var i int32
  58976 
  58977 	var pow63 uintptr = ts + 1592
  58978 	for i = 0; c == 0 && i < 18; i++ {
  58979 		c = (int32(*(*int8)(unsafe.Pointer(zNum + uintptr(i*incr)))) - int32(*(*int8)(unsafe.Pointer(pow63 + uintptr(i))))) * 10
  58980 	}
  58981 	if c == 0 {
  58982 		c = int32(*(*int8)(unsafe.Pointer(zNum + uintptr(18*incr)))) - '8'
  58983 
  58984 	}
  58985 	return c
  58986 }
  58987 
  58988 // Convert zNum to a 64-bit signed integer.  zNum must be decimal. This
  58989 // routine does *not* accept hexadecimal notation.
  58990 //
  58991 // Returns:
  58992 //
  58993 //	-1    Not even a prefix of the input text looks like an integer
  58994 //	 0    Successful transformation.  Fits in a 64-bit signed integer.
  58995 //	 1    Excess non-space text after the integer value
  58996 //	 2    Integer too large for a 64-bit signed integer or is malformed
  58997 //	 3    Special case of 9223372036854775808
  58998 //
  58999 // length is the number of bytes in the string (bytes, not characters).
  59000 // The string is not necessarily zero-terminated.  The encoding is
  59001 // given by enc.
  59002 func Xsqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc U8) int32 {
  59003 	var incr int32
  59004 	var u U64 = uint64(0)
  59005 	var neg int32 = 0
  59006 	var i int32
  59007 	var c int32 = 0
  59008 	var nonNum int32 = 0
  59009 	var rc int32
  59010 	var zStart uintptr
  59011 	var zEnd uintptr = zNum + uintptr(length)
  59012 
  59013 	if int32(enc) == SQLITE_UTF8 {
  59014 		incr = 1
  59015 	} else {
  59016 		incr = 2
  59017 		length = length & libc.CplInt32(1)
  59018 
  59019 		for i = 3 - int32(enc); i < length && int32(*(*int8)(unsafe.Pointer(zNum + uintptr(i)))) == 0; i = i + 2 {
  59020 		}
  59021 		nonNum = libc.Bool32(i < length)
  59022 		zEnd = zNum + uintptr(i^1)
  59023 		zNum += uintptr(int32(enc) & 1)
  59024 	}
  59025 	for zNum < zEnd && int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zNum)))])&0x01 != 0 {
  59026 		zNum += uintptr(incr)
  59027 	}
  59028 	if zNum < zEnd {
  59029 		if int32(*(*int8)(unsafe.Pointer(zNum))) == '-' {
  59030 			neg = 1
  59031 			zNum += uintptr(incr)
  59032 		} else if int32(*(*int8)(unsafe.Pointer(zNum))) == '+' {
  59033 			zNum += uintptr(incr)
  59034 		}
  59035 	}
  59036 	zStart = zNum
  59037 	for zNum < zEnd && int32(*(*int8)(unsafe.Pointer(zNum))) == '0' {
  59038 		zNum += uintptr(incr)
  59039 	}
  59040 	for i = 0; zNum+uintptr(i) < zEnd && libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(zNum + uintptr(i))))) >= '0' && c <= '9'; i = i + incr {
  59041 		u = u*uint64(10) + U64(c) - uint64('0')
  59042 	}
  59043 
  59044 	if u > uint64(int64(0xffffffff)|int64(0x7fffffff)<<32) {
  59045 		*(*I64)(unsafe.Pointer(pNum)) = func() int64 {
  59046 			if neg != 0 {
  59047 				return int64(-1) - (int64(0xffffffff) | int64(0x7fffffff)<<32)
  59048 			}
  59049 			return int64(0xffffffff) | int64(0x7fffffff)<<32
  59050 		}()
  59051 	} else if neg != 0 {
  59052 		*(*I64)(unsafe.Pointer(pNum)) = -I64(u)
  59053 	} else {
  59054 		*(*I64)(unsafe.Pointer(pNum)) = I64(u)
  59055 	}
  59056 	rc = 0
  59057 	if i == 0 && zStart == zNum {
  59058 		rc = -1
  59059 	} else if nonNum != 0 {
  59060 		rc = 1
  59061 	} else if zNum+uintptr(i) < zEnd {
  59062 		var jj int32 = i
  59063 		for __ccgo := true; __ccgo; __ccgo = zNum+uintptr(jj) < zEnd {
  59064 			if !(int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zNum + uintptr(jj))))])&0x01 != 0) {
  59065 				rc = 1
  59066 				break
  59067 			}
  59068 			jj = jj + incr
  59069 		}
  59070 	}
  59071 	if i < 19*incr {
  59072 		return rc
  59073 	} else {
  59074 		if i > 19*incr {
  59075 			c = 1
  59076 		} else {
  59077 			c = compare2pow63(tls, zNum, incr)
  59078 		}
  59079 		if c < 0 {
  59080 			return rc
  59081 		} else {
  59082 			*(*I64)(unsafe.Pointer(pNum)) = func() int64 {
  59083 				if neg != 0 {
  59084 					return int64(-1) - (int64(0xffffffff) | int64(0x7fffffff)<<32)
  59085 				}
  59086 				return int64(0xffffffff) | int64(0x7fffffff)<<32
  59087 			}()
  59088 			if c > 0 {
  59089 				return 2
  59090 			} else {
  59091 				if neg != 0 {
  59092 					return rc
  59093 				}
  59094 				return 3
  59095 			}
  59096 		}
  59097 	}
  59098 	return int32(0)
  59099 }
  59100 
  59101 // Transform a UTF-8 integer literal, in either decimal or hexadecimal,
  59102 // into a 64-bit signed integer.  This routine accepts hexadecimal literals,
  59103 // whereas sqlite3Atoi64() does not.
  59104 //
  59105 // Returns:
  59106 //
  59107 //	0    Successful transformation.  Fits in a 64-bit signed integer.
  59108 //	1    Excess text after the integer value
  59109 //	2    Integer too large for a 64-bit signed integer or is malformed
  59110 //	3    Special case of 9223372036854775808
  59111 func Xsqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) int32 {
  59112 	bp := tls.Alloc(8)
  59113 	defer tls.Free(8)
  59114 
  59115 	if int32(*(*int8)(unsafe.Pointer(z))) == '0' &&
  59116 		(int32(*(*int8)(unsafe.Pointer(z + 1))) == 'x' || int32(*(*int8)(unsafe.Pointer(z + 1))) == 'X') {
  59117 		*(*U64)(unsafe.Pointer(bp)) = uint64(0)
  59118 		var i int32
  59119 		var k int32
  59120 		for i = 2; int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == '0'; i++ {
  59121 		}
  59122 		for k = i; int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(k))))])&0x08 != 0; k++ {
  59123 			*(*U64)(unsafe.Pointer(bp)) = *(*U64)(unsafe.Pointer(bp))*uint64(16) + U64(Xsqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + uintptr(k))))))
  59124 		}
  59125 		libc.Xmemcpy(tls, pOut, bp, uint64(8))
  59126 		if int32(*(*int8)(unsafe.Pointer(z + uintptr(k)))) == 0 && k-i <= 16 {
  59127 			return 0
  59128 		}
  59129 		return 2
  59130 	} else {
  59131 		return Xsqlite3Atoi64(tls, z, pOut, Xsqlite3Strlen30(tls, z), uint8(SQLITE_UTF8))
  59132 	}
  59133 	return int32(0)
  59134 }
  59135 
  59136 // If zNum represents an integer that will fit in 32-bits, then set
  59137 // *pValue to that integer and return true.  Otherwise return false.
  59138 //
  59139 // This routine accepts both decimal and hexadecimal notation for integers.
  59140 //
  59141 // Any non-numeric characters that following zNum are ignored.
  59142 // This is different from sqlite3Atoi64() which requires the
  59143 // input number to be zero-terminated.
  59144 func Xsqlite3GetInt32(tls *libc.TLS, zNum uintptr, pValue uintptr) int32 {
  59145 	bp := tls.Alloc(4)
  59146 	defer tls.Free(4)
  59147 
  59148 	var v Sqlite_int64 = int64(0)
  59149 	var i int32
  59150 	var c int32
  59151 	var neg int32 = 0
  59152 	if int32(*(*int8)(unsafe.Pointer(zNum))) == '-' {
  59153 		neg = 1
  59154 		zNum++
  59155 	} else if int32(*(*int8)(unsafe.Pointer(zNum))) == '+' {
  59156 		zNum++
  59157 	} else if int32(*(*int8)(unsafe.Pointer(zNum))) == '0' &&
  59158 		(int32(*(*int8)(unsafe.Pointer(zNum + 1))) == 'x' || int32(*(*int8)(unsafe.Pointer(zNum + 1))) == 'X') &&
  59159 		int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zNum + 2)))])&0x08 != 0 {
  59160 		*(*U32)(unsafe.Pointer(bp)) = U32(0)
  59161 		zNum += uintptr(2)
  59162 		for int32(*(*int8)(unsafe.Pointer(zNum))) == '0' {
  59163 			zNum++
  59164 		}
  59165 		for i = 0; int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zNum + uintptr(i))))])&0x08 != 0 && i < 8; i++ {
  59166 			*(*U32)(unsafe.Pointer(bp)) = *(*U32)(unsafe.Pointer(bp))*U32(16) + U32(Xsqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(zNum + uintptr(i))))))
  59167 		}
  59168 		if *(*U32)(unsafe.Pointer(bp))&0x80000000 == U32(0) && int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zNum + uintptr(i))))])&0x08 == 0 {
  59169 			libc.Xmemcpy(tls, pValue, bp, uint64(4))
  59170 			return 1
  59171 		} else {
  59172 			return 0
  59173 		}
  59174 	}
  59175 	if !(int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zNum)))])&0x04 != 0) {
  59176 		return 0
  59177 	}
  59178 	for int32(*(*int8)(unsafe.Pointer(zNum))) == '0' {
  59179 		zNum++
  59180 	}
  59181 	for i = 0; i < 11 && libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(zNum + uintptr(i))))-'0') >= 0 && c <= 9; i++ {
  59182 		v = v*int64(10) + Sqlite_int64(c)
  59183 	}
  59184 
  59185 	if i > 10 {
  59186 		return 0
  59187 	}
  59188 
  59189 	if v-Sqlite_int64(neg) > int64(2147483647) {
  59190 		return 0
  59191 	}
  59192 	if neg != 0 {
  59193 		v = -v
  59194 	}
  59195 	*(*int32)(unsafe.Pointer(pValue)) = int32(v)
  59196 	return 1
  59197 }
  59198 
  59199 // Return a 32-bit integer value extracted from a string.  If the
  59200 // string is not an integer, just return 0.
  59201 func Xsqlite3Atoi(tls *libc.TLS, z uintptr) int32 {
  59202 	bp := tls.Alloc(4)
  59203 	defer tls.Free(4)
  59204 
  59205 	*(*int32)(unsafe.Pointer(bp)) = 0
  59206 	Xsqlite3GetInt32(tls, z, bp)
  59207 	return *(*int32)(unsafe.Pointer(bp))
  59208 }
  59209 
  59210 // Try to convert z into an unsigned 32-bit integer.  Return true on
  59211 // success and false if there is an error.
  59212 //
  59213 // Only decimal notation is accepted.
  59214 func Xsqlite3GetUInt32(tls *libc.TLS, z uintptr, pI uintptr) int32 {
  59215 	var v U64 = uint64(0)
  59216 	var i int32
  59217 	for i = 0; int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))])&0x04 != 0; i++ {
  59218 		v = v*uint64(10) + U64(*(*int8)(unsafe.Pointer(z + uintptr(i)))) - uint64('0')
  59219 		if v > uint64(4294967296) {
  59220 			*(*U32)(unsafe.Pointer(pI)) = U32(0)
  59221 			return 0
  59222 		}
  59223 	}
  59224 	if i == 0 || int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) != 0 {
  59225 		*(*U32)(unsafe.Pointer(pI)) = U32(0)
  59226 		return 0
  59227 	}
  59228 	*(*U32)(unsafe.Pointer(pI)) = U32(v)
  59229 	return 1
  59230 }
  59231 
  59232 func putVarint64(tls *libc.TLS, p uintptr, v U64) int32 {
  59233 	bp := tls.Alloc(10)
  59234 	defer tls.Free(10)
  59235 
  59236 	var i int32
  59237 	var j int32
  59238 	var n int32
  59239 
  59240 	if v&(uint64(0xff000000)<<32) != 0 {
  59241 		*(*uint8)(unsafe.Pointer(p + 8)) = U8(v)
  59242 		v >>= 8
  59243 		for i = 7; i >= 0; i-- {
  59244 			*(*uint8)(unsafe.Pointer(p + uintptr(i))) = U8(v&uint64(0x7f) | uint64(0x80))
  59245 			v >>= 7
  59246 		}
  59247 		return 9
  59248 	}
  59249 	n = 0
  59250 	for __ccgo := true; __ccgo; __ccgo = v != uint64(0) {
  59251 		*(*U8)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&n, 1)))) = U8(v&uint64(0x7f) | uint64(0x80))
  59252 		v >>= 7
  59253 	}
  59254 	*(*U8)(unsafe.Pointer(bp)) &= U8(0x7f)
  59255 
  59256 	i = 0
  59257 	j = n - 1
  59258 __1:
  59259 	if !(j >= 0) {
  59260 		goto __3
  59261 	}
  59262 	{
  59263 		*(*uint8)(unsafe.Pointer(p + uintptr(i))) = *(*U8)(unsafe.Pointer(bp + uintptr(j)))
  59264 
  59265 	}
  59266 	goto __2
  59267 __2:
  59268 	j--
  59269 	i++
  59270 	goto __1
  59271 	goto __3
  59272 __3:
  59273 	;
  59274 	return n
  59275 }
  59276 
  59277 func Xsqlite3PutVarint(tls *libc.TLS, p uintptr, v U64) int32 {
  59278 	if v <= uint64(0x7f) {
  59279 		*(*uint8)(unsafe.Pointer(p)) = uint8(v & uint64(0x7f))
  59280 		return 1
  59281 	}
  59282 	if v <= uint64(0x3fff) {
  59283 		*(*uint8)(unsafe.Pointer(p)) = uint8(v>>7&uint64(0x7f) | uint64(0x80))
  59284 		*(*uint8)(unsafe.Pointer(p + 1)) = uint8(v & uint64(0x7f))
  59285 		return 2
  59286 	}
  59287 	return putVarint64(tls, p, v)
  59288 }
  59289 
  59290 // Read a 64-bit variable-length integer from memory starting at p[0].
  59291 // Return the number of bytes read.  The value is stored in *v.
  59292 func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 {
  59293 	var a U32
  59294 	var b U32
  59295 	var s U32
  59296 
  59297 	if int32(*(*int8)(unsafe.Pointer(p))) >= 0 {
  59298 		*(*U64)(unsafe.Pointer(v)) = U64(*(*uint8)(unsafe.Pointer(p)))
  59299 		return U8(1)
  59300 	}
  59301 	if int32(*(*int8)(unsafe.Pointer(p + 1))) >= 0 {
  59302 		*(*U64)(unsafe.Pointer(v)) = U64(U32(int32(*(*uint8)(unsafe.Pointer(p)))&0x7f)<<7 | U32(*(*uint8)(unsafe.Pointer(p + 1))))
  59303 		return U8(2)
  59304 	}
  59305 
  59306 	a = U32(*(*uint8)(unsafe.Pointer(p))) << 14
  59307 	b = U32(*(*uint8)(unsafe.Pointer(p + 1)))
  59308 	p += uintptr(2)
  59309 	a = a | U32(*(*uint8)(unsafe.Pointer(p)))
  59310 
  59311 	if !(a&U32(0x80) != 0) {
  59312 		a = a & U32(SLOT_2_0)
  59313 		b = b & U32(0x7f)
  59314 		b = b << 7
  59315 		a = a | b
  59316 		*(*U64)(unsafe.Pointer(v)) = U64(a)
  59317 		return U8(3)
  59318 	}
  59319 
  59320 	a = a & U32(SLOT_2_0)
  59321 	p++
  59322 	b = b << 14
  59323 	b = b | U32(*(*uint8)(unsafe.Pointer(p)))
  59324 
  59325 	if !(b&U32(0x80) != 0) {
  59326 		b = b & U32(SLOT_2_0)
  59327 
  59328 		a = a << 7
  59329 		a = a | b
  59330 		*(*U64)(unsafe.Pointer(v)) = U64(a)
  59331 		return U8(4)
  59332 	}
  59333 
  59334 	b = b & U32(SLOT_2_0)
  59335 	s = a
  59336 
  59337 	p++
  59338 	a = a << 14
  59339 	a = a | U32(*(*uint8)(unsafe.Pointer(p)))
  59340 
  59341 	if !(a&U32(0x80) != 0) {
  59342 		b = b << 7
  59343 		a = a | b
  59344 		s = s >> 18
  59345 		*(*U64)(unsafe.Pointer(v)) = U64(s)<<32 | U64(a)
  59346 		return U8(5)
  59347 	}
  59348 
  59349 	s = s << 7
  59350 	s = s | b
  59351 
  59352 	p++
  59353 	b = b << 14
  59354 	b = b | U32(*(*uint8)(unsafe.Pointer(p)))
  59355 
  59356 	if !(b&U32(0x80) != 0) {
  59357 		a = a & U32(SLOT_2_0)
  59358 		a = a << 7
  59359 		a = a | b
  59360 		s = s >> 18
  59361 		*(*U64)(unsafe.Pointer(v)) = U64(s)<<32 | U64(a)
  59362 		return U8(6)
  59363 	}
  59364 
  59365 	p++
  59366 	a = a << 14
  59367 	a = a | U32(*(*uint8)(unsafe.Pointer(p)))
  59368 
  59369 	if !(a&U32(0x80) != 0) {
  59370 		a = a & SLOT_4_2_0
  59371 		b = b & U32(SLOT_2_0)
  59372 		b = b << 7
  59373 		a = a | b
  59374 		s = s >> 11
  59375 		*(*U64)(unsafe.Pointer(v)) = U64(s)<<32 | U64(a)
  59376 		return U8(7)
  59377 	}
  59378 
  59379 	a = a & U32(SLOT_2_0)
  59380 	p++
  59381 	b = b << 14
  59382 	b = b | U32(*(*uint8)(unsafe.Pointer(p)))
  59383 
  59384 	if !(b&U32(0x80) != 0) {
  59385 		b = b & SLOT_4_2_0
  59386 
  59387 		a = a << 7
  59388 		a = a | b
  59389 		s = s >> 4
  59390 		*(*U64)(unsafe.Pointer(v)) = U64(s)<<32 | U64(a)
  59391 		return U8(8)
  59392 	}
  59393 
  59394 	p++
  59395 	a = a << 15
  59396 	a = a | U32(*(*uint8)(unsafe.Pointer(p)))
  59397 
  59398 	b = b & U32(SLOT_2_0)
  59399 	b = b << 8
  59400 	a = a | b
  59401 
  59402 	s = s << 4
  59403 	b = U32(*(*uint8)(unsafe.Pointer(p + libc.UintptrFromInt32(-4))))
  59404 	b = b & U32(0x7f)
  59405 	b = b >> 3
  59406 	s = s | b
  59407 
  59408 	*(*U64)(unsafe.Pointer(v)) = U64(s)<<32 | U64(a)
  59409 
  59410 	return U8(9)
  59411 }
  59412 
  59413 // Read a 32-bit variable-length integer from memory starting at p[0].
  59414 // Return the number of bytes read.  The value is stored in *v.
  59415 //
  59416 // If the varint stored in p[0] is larger than can fit in a 32-bit unsigned
  59417 // integer, then set *v to 0xffffffff.
  59418 //
  59419 // A MACRO version, getVarint32, is provided which inlines the
  59420 // single-byte case.  All code should use the MACRO version as
  59421 // this function assumes the single-byte case has already been handled.
  59422 func Xsqlite3GetVarint32(tls *libc.TLS, p uintptr, v uintptr) U8 {
  59423 	bp := tls.Alloc(8)
  59424 	defer tls.Free(8)
  59425 
  59426 	var a U32
  59427 	var b U32
  59428 
  59429 	a = U32(*(*uint8)(unsafe.Pointer(p)))
  59430 
  59431 	p++
  59432 	b = U32(*(*uint8)(unsafe.Pointer(p)))
  59433 
  59434 	if !(b&U32(0x80) != 0) {
  59435 		a = a & U32(0x7f)
  59436 		a = a << 7
  59437 		*(*U32)(unsafe.Pointer(v)) = a | b
  59438 		return U8(2)
  59439 	}
  59440 
  59441 	p++
  59442 	a = a << 14
  59443 	a = a | U32(*(*uint8)(unsafe.Pointer(p)))
  59444 
  59445 	if !(a&U32(0x80) != 0) {
  59446 		a = a & U32(int32(0x7f)<<14|0x7f)
  59447 		b = b & U32(0x7f)
  59448 		b = b << 7
  59449 		*(*U32)(unsafe.Pointer(v)) = a | b
  59450 		return U8(3)
  59451 	}
  59452 
  59453 	{
  59454 		var n U8
  59455 
  59456 		n = Xsqlite3GetVarint(tls, p-uintptr(2), bp)
  59457 
  59458 		if *(*U64)(unsafe.Pointer(bp))&(uint64(1)<<32-uint64(1)) != *(*U64)(unsafe.Pointer(bp)) {
  59459 			*(*U32)(unsafe.Pointer(v)) = 0xffffffff
  59460 		} else {
  59461 			*(*U32)(unsafe.Pointer(v)) = U32(*(*U64)(unsafe.Pointer(bp)))
  59462 		}
  59463 		return n
  59464 
  59465 	}
  59466 	return U8(0)
  59467 
  59468 }
  59469 
  59470 // Return the number of bytes that will be needed to store the given
  59471 // 64-bit integer.
  59472 func Xsqlite3VarintLen(tls *libc.TLS, v U64) int32 {
  59473 	var i int32
  59474 	for i = 1; libc.AssignShrUint64(&v, int(uint64(7))) != uint64(0); i++ {
  59475 	}
  59476 	return i
  59477 }
  59478 
  59479 // Read or write a four-byte big-endian integer value.
  59480 func Xsqlite3Get4byte(tls *libc.TLS, p uintptr) U32 {
  59481 	bp := tls.Alloc(4)
  59482 	defer tls.Free(4)
  59483 
  59484 	libc.Xmemcpy(tls, bp, p, uint64(4))
  59485 	return libc.X__builtin_bswap32(tls, *(*U32)(unsafe.Pointer(bp)))
  59486 }
  59487 
  59488 func Xsqlite3Put4byte(tls *libc.TLS, p uintptr, v U32) {
  59489 	bp := tls.Alloc(4)
  59490 	defer tls.Free(4)
  59491 
  59492 	*(*U32)(unsafe.Pointer(bp)) = libc.X__builtin_bswap32(tls, v)
  59493 	libc.Xmemcpy(tls, p, bp, uint64(4))
  59494 }
  59495 
  59496 // Translate a single byte of Hex into an integer.
  59497 // This routine only works if h really is a valid hexadecimal
  59498 // character:  0..9a..fA..F
  59499 func Xsqlite3HexToInt(tls *libc.TLS, h int32) U8 {
  59500 	h = h + 9*(1&(h>>6))
  59501 	return U8(h & 0xf)
  59502 }
  59503 
  59504 // Convert a BLOB literal of the form "x'hhhhhh'" into its binary
  59505 // value.  Return a pointer to its binary value.  Space to hold the
  59506 // binary value has been obtained from malloc and must be freed by
  59507 // the calling routine.
  59508 func Xsqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) uintptr {
  59509 	var zBlob uintptr
  59510 	var i int32
  59511 
  59512 	zBlob = Xsqlite3DbMallocRawNN(tls, db, uint64(n/2+1))
  59513 	n--
  59514 	if zBlob != 0 {
  59515 		for i = 0; i < n; i = i + 2 {
  59516 			*(*int8)(unsafe.Pointer(zBlob + uintptr(i/2))) = int8(int32(Xsqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + uintptr(i))))))<<4 | int32(Xsqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + uintptr(i+1)))))))
  59517 		}
  59518 		*(*int8)(unsafe.Pointer(zBlob + uintptr(i/2))) = int8(0)
  59519 	}
  59520 	return zBlob
  59521 }
  59522 
  59523 func logBadConnection(tls *libc.TLS, zType uintptr) {
  59524 	bp := tls.Alloc(8)
  59525 	defer tls.Free(8)
  59526 
  59527 	Xsqlite3_log(tls, SQLITE_MISUSE,
  59528 		ts+1611,
  59529 		libc.VaList(bp, zType))
  59530 }
  59531 
  59532 // Check to make sure we have a valid db pointer.  This test is not
  59533 // foolproof but it does provide some measure of protection against
  59534 // misuse of the interface such as passing in db pointers that are
  59535 // NULL or which have been previously closed.  If this routine returns
  59536 // 1 it means that the db pointer is valid and 0 if it should not be
  59537 // dereferenced for any reason.  The calling function should invoke
  59538 // SQLITE_MISUSE immediately.
  59539 //
  59540 // sqlite3SafetyCheckOk() requires that the db pointer be valid for
  59541 // use.  sqlite3SafetyCheckSickOrOk() allows a db pointer that failed to
  59542 // open properly and is not fit for general use but which can be
  59543 // used as an argument to sqlite3_errmsg() or sqlite3_close().
  59544 func Xsqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) int32 {
  59545 	var eOpenState U8
  59546 	if db == uintptr(0) {
  59547 		logBadConnection(tls, ts+1545)
  59548 		return 0
  59549 	}
  59550 	eOpenState = (*Sqlite3)(unsafe.Pointer(db)).FeOpenState
  59551 	if int32(eOpenState) != SQLITE_STATE_OPEN {
  59552 		if Xsqlite3SafetyCheckSickOrOk(tls, db) != 0 {
  59553 			logBadConnection(tls, ts+1656)
  59554 		}
  59555 		return 0
  59556 	} else {
  59557 		return 1
  59558 	}
  59559 	return int32(0)
  59560 }
  59561 
  59562 func Xsqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) int32 {
  59563 	var eOpenState U8
  59564 	eOpenState = (*Sqlite3)(unsafe.Pointer(db)).FeOpenState
  59565 	if int32(eOpenState) != SQLITE_STATE_SICK && int32(eOpenState) != SQLITE_STATE_OPEN && int32(eOpenState) != SQLITE_STATE_BUSY {
  59566 		logBadConnection(tls, ts+1665)
  59567 		return 0
  59568 	} else {
  59569 		return 1
  59570 	}
  59571 	return int32(0)
  59572 }
  59573 
  59574 // Attempt to add, substract, or multiply the 64-bit signed value iB against
  59575 // the other 64-bit signed integer at *pA and store the result in *pA.
  59576 // Return 0 on success.  Or if the operation would have resulted in an
  59577 // overflow, leave *pA unchanged and return 1.
  59578 func Xsqlite3AddInt64(tls *libc.TLS, pA uintptr, iB I64) int32 {
  59579 	return libc.X__builtin_add_overflowInt64(tls, *(*I64)(unsafe.Pointer(pA)), iB, pA)
  59580 }
  59581 
  59582 func Xsqlite3SubInt64(tls *libc.TLS, pA uintptr, iB I64) int32 {
  59583 	return libc.X__builtin_sub_overflowInt64(tls, *(*I64)(unsafe.Pointer(pA)), iB, pA)
  59584 }
  59585 
  59586 func Xsqlite3MulInt64(tls *libc.TLS, pA uintptr, iB I64) int32 {
  59587 	return libc.X__builtin_mul_overflowInt64(tls, *(*I64)(unsafe.Pointer(pA)), iB, pA)
  59588 }
  59589 
  59590 // Compute the absolute value of a 32-bit signed integer, of possible.  Or
  59591 // if the integer has a value of -2147483648, return +2147483647
  59592 func Xsqlite3AbsInt32(tls *libc.TLS, x int32) int32 {
  59593 	if x >= 0 {
  59594 		return x
  59595 	}
  59596 	if x == libc.Int32FromUint32(0x80000000) {
  59597 		return 0x7fffffff
  59598 	}
  59599 	return -x
  59600 }
  59601 
  59602 // Find (an approximate) sum of two LogEst values.  This computation is
  59603 // not a simple "+" operator because LogEst is stored as a logarithmic
  59604 // value.
  59605 func Xsqlite3LogEstAdd(tls *libc.TLS, a LogEst, b LogEst) LogEst {
  59606 	if int32(a) >= int32(b) {
  59607 		if int32(a) > int32(b)+49 {
  59608 			return a
  59609 		}
  59610 		if int32(a) > int32(b)+31 {
  59611 			return LogEst(int32(a) + 1)
  59612 		}
  59613 		return LogEst(int32(a) + int32(x1[int32(a)-int32(b)]))
  59614 	} else {
  59615 		if int32(b) > int32(a)+49 {
  59616 			return b
  59617 		}
  59618 		if int32(b) > int32(a)+31 {
  59619 			return LogEst(int32(b) + 1)
  59620 		}
  59621 		return LogEst(int32(b) + int32(x1[int32(b)-int32(a)]))
  59622 	}
  59623 	return LogEst(0)
  59624 }
  59625 
  59626 var x1 = [32]uint8{
  59627 	uint8(10), uint8(10),
  59628 	uint8(9), uint8(9),
  59629 	uint8(8), uint8(8),
  59630 	uint8(7), uint8(7), uint8(7),
  59631 	uint8(6), uint8(6), uint8(6),
  59632 	uint8(5), uint8(5), uint8(5),
  59633 	uint8(4), uint8(4), uint8(4), uint8(4),
  59634 	uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3),
  59635 	uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2),
  59636 }
  59637 
  59638 // Convert an integer into a LogEst.  In other words, compute an
  59639 // approximation for 10*log2(x).
  59640 func Xsqlite3LogEst(tls *libc.TLS, x U64) LogEst {
  59641 	var y LogEst = int16(40)
  59642 	if x < uint64(8) {
  59643 		if x < uint64(2) {
  59644 			return int16(0)
  59645 		}
  59646 		for x < uint64(8) {
  59647 			y = int16(int32(y) - 10)
  59648 			x <<= 1
  59649 		}
  59650 	} else {
  59651 		var i int32 = 60 - libc.X__builtin_clzll(tls, x)
  59652 		y = LogEst(int32(y) + i*10)
  59653 		x >>= i
  59654 	}
  59655 	return LogEst(int32(a[x&uint64(7)]) + int32(y) - 10)
  59656 }
  59657 
  59658 var a = [8]LogEst{int16(0), int16(2), int16(3), int16(5), int16(6), int16(7), int16(8), int16(9)}
  59659 
  59660 // Convert a double into a LogEst
  59661 // In other words, compute an approximation for 10*log2(x).
  59662 func Xsqlite3LogEstFromDouble(tls *libc.TLS, x float64) LogEst {
  59663 	bp := tls.Alloc(16)
  59664 	defer tls.Free(16)
  59665 	*(*float64)(unsafe.Pointer(bp + 8)) = x
  59666 
  59667 	var e LogEst
  59668 
  59669 	if *(*float64)(unsafe.Pointer(bp + 8)) <= float64(1) {
  59670 		return int16(0)
  59671 	}
  59672 	if *(*float64)(unsafe.Pointer(bp + 8)) <= float64(2000000000) {
  59673 		return Xsqlite3LogEst(tls, U64(*(*float64)(unsafe.Pointer(bp + 8))))
  59674 	}
  59675 	libc.Xmemcpy(tls, bp, bp+8, uint64(8))
  59676 	e = LogEst(*(*U64)(unsafe.Pointer(bp))>>52 - uint64(1022))
  59677 	return LogEst(int32(e) * 10)
  59678 }
  59679 
  59680 // Convert a LogEst into an integer.
  59681 func Xsqlite3LogEstToInt(tls *libc.TLS, x LogEst) U64 {
  59682 	var n U64
  59683 	n = U64(int32(x) % 10)
  59684 	x = int16(int32(x) / 10)
  59685 	if n >= uint64(5) {
  59686 		n = n - uint64(2)
  59687 	} else if n >= uint64(1) {
  59688 		n = n - uint64(1)
  59689 	}
  59690 	if int32(x) > 60 {
  59691 		return uint64(int64(0xffffffff) | int64(0x7fffffff)<<32)
  59692 	}
  59693 	if int32(x) >= 3 {
  59694 		return (n + uint64(8)) << (int32(x) - 3)
  59695 	}
  59696 	return (n + uint64(8)) >> (3 - int32(x))
  59697 }
  59698 
  59699 // Add a new name/number pair to a VList.  This might require that the
  59700 // VList object be reallocated, so return the new VList.  If an OOM
  59701 // error occurs, the original VList returned and the
  59702 // db->mallocFailed flag is set.
  59703 //
  59704 // A VList is really just an array of integers.  To destroy a VList,
  59705 // simply pass it to sqlite3DbFree().
  59706 //
  59707 // The first integer is the number of integers allocated for the whole
  59708 // VList.  The second integer is the number of integers actually used.
  59709 // Each name/number pair is encoded by subsequent groups of 3 or more
  59710 // integers.
  59711 //
  59712 // Each name/number pair starts with two integers which are the numeric
  59713 // value for the pair and the size of the name/number pair, respectively.
  59714 // The text name overlays one or more following integers.  The text name
  59715 // is always zero-terminated.
  59716 //
  59717 // Conceptually:
  59718 //
  59719 //	struct VList {
  59720 //	  int nAlloc;   // Number of allocated slots
  59721 //	  int nUsed;    // Number of used slots
  59722 //	  struct VListEntry {
  59723 //	    int iValue;    // Value for this entry
  59724 //	    int nSlot;     // Slots used by this entry
  59725 //	    // ... variable name goes here
  59726 //	  } a[0];
  59727 //	}
  59728 //
  59729 // During code generation, pointers to the variable names within the
  59730 // VList are taken.  When that happens, nAlloc is set to zero as an
  59731 // indication that the VList may never again be enlarged, since the
  59732 // accompanying realloc() would invalidate the pointers.
  59733 func Xsqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nName int32, iVal int32) uintptr {
  59734 	var nInt int32
  59735 	var z uintptr
  59736 	var i int32
  59737 
  59738 	nInt = nName/4 + 3
  59739 
  59740 	if pIn == uintptr(0) || *(*VList)(unsafe.Pointer(pIn + 1*4))+nInt > *(*VList)(unsafe.Pointer(pIn)) {
  59741 		var nAlloc Sqlite3_int64 = func() int64 {
  59742 			if pIn != 0 {
  59743 				return int64(2) * Sqlite3_int64(*(*VList)(unsafe.Pointer(pIn)))
  59744 			}
  59745 			return int64(10)
  59746 		}() + Sqlite3_int64(nInt)
  59747 		var pOut uintptr = Xsqlite3DbRealloc(tls, db, pIn, uint64(nAlloc)*uint64(unsafe.Sizeof(int32(0))))
  59748 		if pOut == uintptr(0) {
  59749 			return pIn
  59750 		}
  59751 		if pIn == uintptr(0) {
  59752 			*(*VList)(unsafe.Pointer(pOut + 1*4)) = 2
  59753 		}
  59754 		pIn = pOut
  59755 		*(*VList)(unsafe.Pointer(pIn)) = VList(nAlloc)
  59756 	}
  59757 	i = *(*VList)(unsafe.Pointer(pIn + 1*4))
  59758 	*(*VList)(unsafe.Pointer(pIn + uintptr(i)*4)) = iVal
  59759 	*(*VList)(unsafe.Pointer(pIn + uintptr(i+1)*4)) = nInt
  59760 	z = pIn + uintptr(i+2)*4
  59761 	*(*VList)(unsafe.Pointer(pIn + 1*4)) = i + nInt
  59762 
  59763 	libc.Xmemcpy(tls, z, zName, uint64(nName))
  59764 	*(*int8)(unsafe.Pointer(z + uintptr(nName))) = int8(0)
  59765 	return pIn
  59766 }
  59767 
  59768 // Return a pointer to the name of a variable in the given VList that
  59769 // has the value iVal.  Or return a NULL if there is no such variable in
  59770 // the list
  59771 func Xsqlite3VListNumToName(tls *libc.TLS, pIn uintptr, iVal int32) uintptr {
  59772 	var i int32
  59773 	var mx int32
  59774 	if pIn == uintptr(0) {
  59775 		return uintptr(0)
  59776 	}
  59777 	mx = *(*VList)(unsafe.Pointer(pIn + 1*4))
  59778 	i = 2
  59779 	for __ccgo := true; __ccgo; __ccgo = i < mx {
  59780 		if *(*VList)(unsafe.Pointer(pIn + uintptr(i)*4)) == iVal {
  59781 			return pIn + uintptr(i+2)*4
  59782 		}
  59783 		i = i + *(*VList)(unsafe.Pointer(pIn + uintptr(i+1)*4))
  59784 	}
  59785 	return uintptr(0)
  59786 }
  59787 
  59788 // Return the number of the variable named zName, if it is in VList.
  59789 // or return 0 if there is no such variable.
  59790 func Xsqlite3VListNameToNum(tls *libc.TLS, pIn uintptr, zName uintptr, nName int32) int32 {
  59791 	var i int32
  59792 	var mx int32
  59793 	if pIn == uintptr(0) {
  59794 		return 0
  59795 	}
  59796 	mx = *(*VList)(unsafe.Pointer(pIn + 1*4))
  59797 	i = 2
  59798 	for __ccgo := true; __ccgo; __ccgo = i < mx {
  59799 		var z uintptr = pIn + uintptr(i+2)*4
  59800 		if libc.Xstrncmp(tls, z, zName, uint64(nName)) == 0 && int32(*(*int8)(unsafe.Pointer(z + uintptr(nName)))) == 0 {
  59801 			return *(*VList)(unsafe.Pointer(pIn + uintptr(i)*4))
  59802 		}
  59803 		i = i + *(*VList)(unsafe.Pointer(pIn + uintptr(i+1)*4))
  59804 	}
  59805 	return 0
  59806 }
  59807 
  59808 // Turn bulk memory into a hash table object by initializing the
  59809 // fields of the Hash structure.
  59810 //
  59811 // "pNew" is a pointer to the hash table that is to be initialized.
  59812 func Xsqlite3HashInit(tls *libc.TLS, pNew uintptr) {
  59813 	(*Hash)(unsafe.Pointer(pNew)).Ffirst = uintptr(0)
  59814 	(*Hash)(unsafe.Pointer(pNew)).Fcount = uint32(0)
  59815 	(*Hash)(unsafe.Pointer(pNew)).Fhtsize = uint32(0)
  59816 	(*Hash)(unsafe.Pointer(pNew)).Fht = uintptr(0)
  59817 }
  59818 
  59819 // Remove all entries from a hash table.  Reclaim all memory.
  59820 // Call this routine to delete a hash table or to reset a hash table
  59821 // to the empty state.
  59822 func Xsqlite3HashClear(tls *libc.TLS, pH uintptr) {
  59823 	var elem uintptr
  59824 
  59825 	elem = (*Hash)(unsafe.Pointer(pH)).Ffirst
  59826 	(*Hash)(unsafe.Pointer(pH)).Ffirst = uintptr(0)
  59827 	Xsqlite3_free(tls, (*Hash)(unsafe.Pointer(pH)).Fht)
  59828 	(*Hash)(unsafe.Pointer(pH)).Fht = uintptr(0)
  59829 	(*Hash)(unsafe.Pointer(pH)).Fhtsize = uint32(0)
  59830 	for elem != 0 {
  59831 		var next_elem uintptr = (*HashElem)(unsafe.Pointer(elem)).Fnext
  59832 		Xsqlite3_free(tls, elem)
  59833 		elem = next_elem
  59834 	}
  59835 	(*Hash)(unsafe.Pointer(pH)).Fcount = uint32(0)
  59836 }
  59837 
  59838 func strHash(tls *libc.TLS, z uintptr) uint32 {
  59839 	var h uint32 = uint32(0)
  59840 	var c uint8
  59841 	for int32(libc.AssignUint8(&c, uint8(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))))) != 0 {
  59842 		h = h + uint32(Xsqlite3UpperToLower[c])
  59843 		h = h * 0x9e3779b1
  59844 	}
  59845 	return h
  59846 }
  59847 
  59848 func insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) {
  59849 	var pHead uintptr
  59850 	if pEntry != 0 {
  59851 		if (*_ht)(unsafe.Pointer(pEntry)).Fcount != 0 {
  59852 			pHead = (*_ht)(unsafe.Pointer(pEntry)).Fchain
  59853 		} else {
  59854 			pHead = uintptr(0)
  59855 		}
  59856 		(*_ht)(unsafe.Pointer(pEntry)).Fcount++
  59857 		(*_ht)(unsafe.Pointer(pEntry)).Fchain = pNew
  59858 	} else {
  59859 		pHead = uintptr(0)
  59860 	}
  59861 	if pHead != 0 {
  59862 		(*HashElem)(unsafe.Pointer(pNew)).Fnext = pHead
  59863 		(*HashElem)(unsafe.Pointer(pNew)).Fprev = (*HashElem)(unsafe.Pointer(pHead)).Fprev
  59864 		if (*HashElem)(unsafe.Pointer(pHead)).Fprev != 0 {
  59865 			(*HashElem)(unsafe.Pointer((*HashElem)(unsafe.Pointer(pHead)).Fprev)).Fnext = pNew
  59866 		} else {
  59867 			(*Hash)(unsafe.Pointer(pH)).Ffirst = pNew
  59868 		}
  59869 		(*HashElem)(unsafe.Pointer(pHead)).Fprev = pNew
  59870 	} else {
  59871 		(*HashElem)(unsafe.Pointer(pNew)).Fnext = (*Hash)(unsafe.Pointer(pH)).Ffirst
  59872 		if (*Hash)(unsafe.Pointer(pH)).Ffirst != 0 {
  59873 			(*HashElem)(unsafe.Pointer((*Hash)(unsafe.Pointer(pH)).Ffirst)).Fprev = pNew
  59874 		}
  59875 		(*HashElem)(unsafe.Pointer(pNew)).Fprev = uintptr(0)
  59876 		(*Hash)(unsafe.Pointer(pH)).Ffirst = pNew
  59877 	}
  59878 }
  59879 
  59880 func rehash(tls *libc.TLS, pH uintptr, new_size uint32) int32 {
  59881 	var new_ht uintptr
  59882 	var elem uintptr
  59883 	var next_elem uintptr
  59884 
  59885 	if uint64(new_size)*uint64(unsafe.Sizeof(_ht{})) > uint64(SQLITE_MALLOC_SOFT_LIMIT) {
  59886 		new_size = uint32(uint64(SQLITE_MALLOC_SOFT_LIMIT) / uint64(unsafe.Sizeof(_ht{})))
  59887 	}
  59888 	if new_size == (*Hash)(unsafe.Pointer(pH)).Fhtsize {
  59889 		return 0
  59890 	}
  59891 
  59892 	Xsqlite3BeginBenignMalloc(tls)
  59893 	new_ht = Xsqlite3Malloc(tls, uint64(new_size)*uint64(unsafe.Sizeof(_ht{})))
  59894 	Xsqlite3EndBenignMalloc(tls)
  59895 
  59896 	if new_ht == uintptr(0) {
  59897 		return 0
  59898 	}
  59899 	Xsqlite3_free(tls, (*Hash)(unsafe.Pointer(pH)).Fht)
  59900 	(*Hash)(unsafe.Pointer(pH)).Fht = new_ht
  59901 	(*Hash)(unsafe.Pointer(pH)).Fhtsize = libc.AssignUint32(&new_size, uint32(uint64(Xsqlite3MallocSize(tls, new_ht))/uint64(unsafe.Sizeof(_ht{}))))
  59902 	libc.Xmemset(tls, new_ht, 0, uint64(new_size)*uint64(unsafe.Sizeof(_ht{})))
  59903 	elem = (*Hash)(unsafe.Pointer(pH)).Ffirst
  59904 	(*Hash)(unsafe.Pointer(pH)).Ffirst = uintptr(0)
  59905 	for ; elem != 0; elem = next_elem {
  59906 		var h uint32 = strHash(tls, (*HashElem)(unsafe.Pointer(elem)).FpKey) % new_size
  59907 		next_elem = (*HashElem)(unsafe.Pointer(elem)).Fnext
  59908 		insertElement(tls, pH, new_ht+uintptr(h)*16, elem)
  59909 	}
  59910 	return 1
  59911 }
  59912 
  59913 func findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr) uintptr {
  59914 	var elem uintptr
  59915 	var count uint32
  59916 	var h uint32
  59917 
  59918 	if (*Hash)(unsafe.Pointer(pH)).Fht != 0 {
  59919 		var pEntry uintptr
  59920 		h = strHash(tls, pKey) % (*Hash)(unsafe.Pointer(pH)).Fhtsize
  59921 		pEntry = (*Hash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16
  59922 		elem = (*_ht)(unsafe.Pointer(pEntry)).Fchain
  59923 		count = (*_ht)(unsafe.Pointer(pEntry)).Fcount
  59924 	} else {
  59925 		h = uint32(0)
  59926 		elem = (*Hash)(unsafe.Pointer(pH)).Ffirst
  59927 		count = (*Hash)(unsafe.Pointer(pH)).Fcount
  59928 	}
  59929 	if pHash != 0 {
  59930 		*(*uint32)(unsafe.Pointer(pHash)) = h
  59931 	}
  59932 	for count != 0 {
  59933 		if Xsqlite3StrICmp(tls, (*HashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 {
  59934 			return elem
  59935 		}
  59936 		elem = (*HashElem)(unsafe.Pointer(elem)).Fnext
  59937 		count--
  59938 	}
  59939 	return uintptr(unsafe.Pointer(&nullElement))
  59940 }
  59941 
  59942 var nullElement = HashElem{}
  59943 
  59944 func removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) {
  59945 	var pEntry uintptr
  59946 	if (*HashElem)(unsafe.Pointer(elem)).Fprev != 0 {
  59947 		(*HashElem)(unsafe.Pointer((*HashElem)(unsafe.Pointer(elem)).Fprev)).Fnext = (*HashElem)(unsafe.Pointer(elem)).Fnext
  59948 	} else {
  59949 		(*Hash)(unsafe.Pointer(pH)).Ffirst = (*HashElem)(unsafe.Pointer(elem)).Fnext
  59950 	}
  59951 	if (*HashElem)(unsafe.Pointer(elem)).Fnext != 0 {
  59952 		(*HashElem)(unsafe.Pointer((*HashElem)(unsafe.Pointer(elem)).Fnext)).Fprev = (*HashElem)(unsafe.Pointer(elem)).Fprev
  59953 	}
  59954 	if (*Hash)(unsafe.Pointer(pH)).Fht != 0 {
  59955 		pEntry = (*Hash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16
  59956 		if (*_ht)(unsafe.Pointer(pEntry)).Fchain == elem {
  59957 			(*_ht)(unsafe.Pointer(pEntry)).Fchain = (*HashElem)(unsafe.Pointer(elem)).Fnext
  59958 		}
  59959 
  59960 		(*_ht)(unsafe.Pointer(pEntry)).Fcount--
  59961 	}
  59962 	Xsqlite3_free(tls, elem)
  59963 	(*Hash)(unsafe.Pointer(pH)).Fcount--
  59964 	if (*Hash)(unsafe.Pointer(pH)).Fcount == uint32(0) {
  59965 		Xsqlite3HashClear(tls, pH)
  59966 	}
  59967 }
  59968 
  59969 // Attempt to locate an element of the hash table pH with a key
  59970 // that matches pKey.  Return the data for this element if it is
  59971 // found, or NULL if there is no match.
  59972 func Xsqlite3HashFind(tls *libc.TLS, pH uintptr, pKey uintptr) uintptr {
  59973 	return (*HashElem)(unsafe.Pointer(findElementWithHash(tls, pH, pKey, uintptr(0)))).Fdata
  59974 }
  59975 
  59976 // Insert an element into the hash table pH.  The key is pKey
  59977 // and the data is "data".
  59978 //
  59979 // If no element exists with a matching key, then a new
  59980 // element is created and NULL is returned.
  59981 //
  59982 // If another element already exists with the same key, then the
  59983 // new data replaces the old data and the old data is returned.
  59984 // The key is not copied in this instance.  If a malloc fails, then
  59985 // the new data is returned and the hash table is unchanged.
  59986 //
  59987 // If the "data" parameter to this function is NULL, then the
  59988 // element corresponding to "key" is removed from the hash table.
  59989 func Xsqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) uintptr {
  59990 	bp := tls.Alloc(4)
  59991 	defer tls.Free(4)
  59992 
  59993 	var elem uintptr
  59994 	var new_elem uintptr
  59995 
  59996 	elem = findElementWithHash(tls, pH, pKey, bp)
  59997 	if (*HashElem)(unsafe.Pointer(elem)).Fdata != 0 {
  59998 		var old_data uintptr = (*HashElem)(unsafe.Pointer(elem)).Fdata
  59999 		if data == uintptr(0) {
  60000 			removeElementGivenHash(tls, pH, elem, *(*uint32)(unsafe.Pointer(bp)))
  60001 		} else {
  60002 			(*HashElem)(unsafe.Pointer(elem)).Fdata = data
  60003 			(*HashElem)(unsafe.Pointer(elem)).FpKey = pKey
  60004 		}
  60005 		return old_data
  60006 	}
  60007 	if data == uintptr(0) {
  60008 		return uintptr(0)
  60009 	}
  60010 	new_elem = Xsqlite3Malloc(tls, uint64(unsafe.Sizeof(HashElem{})))
  60011 	if new_elem == uintptr(0) {
  60012 		return data
  60013 	}
  60014 	(*HashElem)(unsafe.Pointer(new_elem)).FpKey = pKey
  60015 	(*HashElem)(unsafe.Pointer(new_elem)).Fdata = data
  60016 	(*Hash)(unsafe.Pointer(pH)).Fcount++
  60017 	if (*Hash)(unsafe.Pointer(pH)).Fcount >= uint32(10) && (*Hash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*Hash)(unsafe.Pointer(pH)).Fhtsize {
  60018 		if rehash(tls, pH, (*Hash)(unsafe.Pointer(pH)).Fcount*uint32(2)) != 0 {
  60019 			*(*uint32)(unsafe.Pointer(bp)) = strHash(tls, pKey) % (*Hash)(unsafe.Pointer(pH)).Fhtsize
  60020 		}
  60021 	}
  60022 	insertElement(tls, pH, func() uintptr {
  60023 		if (*Hash)(unsafe.Pointer(pH)).Fht != 0 {
  60024 			return (*Hash)(unsafe.Pointer(pH)).Fht + uintptr(*(*uint32)(unsafe.Pointer(bp)))*16
  60025 		}
  60026 		return uintptr(0)
  60027 	}(), new_elem)
  60028 	return uintptr(0)
  60029 }
  60030 
  60031 // ************* End of hash.c ***********************************************
  60032 // ************* Begin file opcodes.c ****************************************
  60033 // Automatically generated.  Do not edit
  60034 // See the tool/mkopcodec.tcl script for details.
  60035 func Xsqlite3OpcodeName(tls *libc.TLS, i int32) uintptr {
  60036 	return azName[i]
  60037 }
  60038 
  60039 var azName = [187]uintptr{
  60040 	ts + 1673,
  60041 	ts + 1683,
  60042 	ts + 1694,
  60043 	ts + 1706,
  60044 	ts + 1717,
  60045 	ts + 1729,
  60046 	ts + 1736,
  60047 	ts + 1744,
  60048 	ts + 1752,
  60049 	ts + 1757,
  60050 	ts + 1762,
  60051 	ts + 1768,
  60052 	ts + 1782,
  60053 	ts + 1788,
  60054 	ts + 1798,
  60055 	ts + 1803,
  60056 	ts + 1808,
  60057 	ts + 1811,
  60058 	ts + 1817,
  60059 	ts + 1824,
  60060 	ts + 1828,
  60061 	ts + 1838,
  60062 	ts + 1845,
  60063 	ts + 1852,
  60064 	ts + 1859,
  60065 	ts + 1866,
  60066 	ts + 1876,
  60067 	ts + 1885,
  60068 	ts + 1896,
  60069 	ts + 1905,
  60070 	ts + 1911,
  60071 	ts + 1921,
  60072 	ts + 1931,
  60073 	ts + 1936,
  60074 	ts + 1946,
  60075 	ts + 1957,
  60076 	ts + 1962,
  60077 	ts + 1969,
  60078 	ts + 1980,
  60079 	ts + 1985,
  60080 	ts + 1990,
  60081 	ts + 1996,
  60082 	ts + 2002,
  60083 	ts + 2008,
  60084 	ts + 2011,
  60085 	ts + 2015,
  60086 	ts + 2021,
  60087 	ts + 2032,
  60088 	ts + 2043,
  60089 	ts + 2051,
  60090 	ts + 2060,
  60091 	ts + 2067,
  60092 	ts + 2075,
  60093 	ts + 2078,
  60094 	ts + 2081,
  60095 	ts + 2084,
  60096 	ts + 2087,
  60097 	ts + 2090,
  60098 	ts + 2093,
  60099 	ts + 2100,
  60100 	ts + 2106,
  60101 	ts + 2116,
  60102 	ts + 2129,
  60103 	ts + 2140,
  60104 	ts + 2146,
  60105 	ts + 2153,
  60106 	ts + 2162,
  60107 	ts + 2171,
  60108 	ts + 2178,
  60109 	ts + 2191,
  60110 	ts + 2202,
  60111 	ts + 2207,
  60112 	ts + 2215,
  60113 	ts + 2221,
  60114 	ts + 2228,
  60115 	ts + 2240,
  60116 	ts + 2245,
  60117 	ts + 2254,
  60118 	ts + 2259,
  60119 	ts + 2268,
  60120 	ts + 2273,
  60121 	ts + 2278,
  60122 	ts + 2284,
  60123 	ts + 2292,
  60124 	ts + 2300,
  60125 	ts + 2310,
  60126 	ts + 2318,
  60127 	ts + 2325,
  60128 	ts + 2338,
  60129 	ts + 2343,
  60130 	ts + 2355,
  60131 	ts + 2363,
  60132 	ts + 2370,
  60133 	ts + 2381,
  60134 	ts + 2388,
  60135 	ts + 2395,
  60136 	ts + 2405,
  60137 	ts + 2414,
  60138 	ts + 2425,
  60139 	ts + 2431,
  60140 	ts + 2442,
  60141 	ts + 2452,
  60142 	ts + 2462,
  60143 	ts + 2469,
  60144 	ts + 2475,
  60145 	ts + 2485,
  60146 	ts + 2496,
  60147 	ts + 2500,
  60148 	ts + 2509,
  60149 	ts + 2518,
  60150 	ts + 2525,
  60151 	ts + 2535,
  60152 	ts + 2542,
  60153 	ts + 2551,
  60154 	ts + 2561,
  60155 	ts + 2568,
  60156 	ts + 2576,
  60157 	ts + 2590,
  60158 	ts + 2598,
  60159 	ts + 2612,
  60160 	ts + 2623,
  60161 	ts + 2636,
  60162 	ts + 2647,
  60163 	ts + 2653,
  60164 	ts + 2665,
  60165 	ts + 2674,
  60166 	ts + 2682,
  60167 	ts + 2691,
  60168 	ts + 2700,
  60169 	ts + 2707,
  60170 	ts + 2715,
  60171 	ts + 2722,
  60172 	ts + 2733,
  60173 	ts + 2747,
  60174 	ts + 2758,
  60175 	ts + 2766,
  60176 	ts + 2772,
  60177 	ts + 2780,
  60178 	ts + 2788,
  60179 	ts + 2798,
  60180 	ts + 2811,
  60181 	ts + 2821,
  60182 	ts + 2834,
  60183 	ts + 2843,
  60184 	ts + 2854,
  60185 	ts + 2862,
  60186 	ts + 2868,
  60187 	ts + 2880,
  60188 	ts + 2892,
  60189 	ts + 2900,
  60190 	ts + 2912,
  60191 	ts + 2925,
  60192 	ts + 2935,
  60193 	ts + 2945,
  60194 	ts + 2950,
  60195 	ts + 2962,
  60196 	ts + 2974,
  60197 	ts + 2984,
  60198 	ts + 2990,
  60199 	ts + 3000,
  60200 	ts + 3007,
  60201 	ts + 3019,
  60202 	ts + 3030,
  60203 	ts + 3038,
  60204 	ts + 3047,
  60205 	ts + 3056,
  60206 	ts + 3065,
  60207 	ts + 3072,
  60208 	ts + 3083,
  60209 	ts + 3096,
  60210 	ts + 3106,
  60211 	ts + 3113,
  60212 	ts + 3121,
  60213 	ts + 3130,
  60214 	ts + 3136,
  60215 	ts + 3144,
  60216 	ts + 3152,
  60217 	ts + 3160,
  60218 	ts + 3170,
  60219 	ts + 3179,
  60220 	ts + 3190,
  60221 	ts + 3200,
  60222 	ts + 3206,
  60223 	ts + 3217,
  60224 	ts + 3228,
  60225 	ts + 3233,
  60226 	ts + 3241,
  60227 }
  60228 
  60229 type winShm = struct {
  60230 	FpShmNode    uintptr
  60231 	FpNext       uintptr
  60232 	FhasMutex    U8
  60233 	F__ccgo_pad1 [1]byte
  60234 	FsharedMask  U16
  60235 	FexclMask    U16
  60236 	F__ccgo_pad2 [2]byte
  60237 }
  60238 
  60239 // Forward references to structures used for WAL
  60240 type WinShm = winShm
  60241 type winShmNode = struct {
  60242 	Fmutex       uintptr
  60243 	FzFilename   uintptr
  60244 	FhFile       WinFile
  60245 	FszRegion    int32
  60246 	FnRegion     int32
  60247 	FisReadonly  U8
  60248 	FisUnlocked  U8
  60249 	F__ccgo_pad1 [6]byte
  60250 	FaRegion     uintptr
  60251 	FlastErrno   DWORD
  60252 	FnRef        int32
  60253 	FpFirst      uintptr
  60254 	FpNext       uintptr
  60255 }
  60256 
  60257 // A connection to shared-memory
  60258 type WinShmNode = winShmNode
  60259 
  60260 type winFile = struct {
  60261 	FpMethod        uintptr
  60262 	FpVfs           uintptr
  60263 	Fh              HANDLE
  60264 	Flocktype       U8
  60265 	F__ccgo_pad1    [1]byte
  60266 	FsharedLockByte int16
  60267 	FctrlFlags      U8
  60268 	F__ccgo_pad2    [3]byte
  60269 	FlastErrno      DWORD
  60270 	F__ccgo_pad3    [4]byte
  60271 	FpShm           uintptr
  60272 	FzPath          uintptr
  60273 	FszChunk        int32
  60274 	FnFetchOut      int32
  60275 	FhMap           HANDLE
  60276 	FpMapRegion     uintptr
  60277 	FmmapSize       Sqlite3_int64
  60278 	FmmapSizeMax    Sqlite3_int64
  60279 }
  60280 
  60281 // The winFile structure is a subclass of sqlite3_file* specific to the win32
  60282 // portability layer.
  60283 type WinFile = winFile
  60284 
  60285 type winVfsAppData = struct {
  60286 	FpMethod     uintptr
  60287 	FpAppData    uintptr
  60288 	FbNoLock     WINBOOL
  60289 	F__ccgo_pad1 [4]byte
  60290 }
  60291 
  60292 // The winVfsAppData structure is used for the pAppData member for all of the
  60293 // Win32 VFS variants.
  60294 type WinVfsAppData = winVfsAppData
  60295 
  60296 var sqlite3_os_type LONG = 0
  60297 
  60298 type win_syscall = struct {
  60299 	FzName    uintptr
  60300 	FpCurrent Sqlite3_syscall_ptr
  60301 	FpDefault Sqlite3_syscall_ptr
  60302 }
  60303 
  60304 var aSyscall = [80]win_syscall{
  60305 	{FzName: ts + 3251, FpCurrent: 0},
  60306 	{FzName: ts + 3267},
  60307 	{FzName: ts + 3278},
  60308 	{FzName: ts + 3289, FpCurrent: 0},
  60309 	{FzName: ts + 3301, FpCurrent: 0},
  60310 	{FzName: ts + 3313, FpCurrent: 0},
  60311 	{FzName: ts + 3325, FpCurrent: 0},
  60312 	{FzName: ts + 3344, FpCurrent: 0},
  60313 	{FzName: ts + 3363, FpCurrent: 0},
  60314 	{FzName: ts + 3376, FpCurrent: 0},
  60315 	{FzName: ts + 3388, FpCurrent: 0},
  60316 	{FzName: ts + 3400},
  60317 	{FzName: ts + 3424},
  60318 	{FzName: ts + 3445, FpCurrent: 0},
  60319 	{FzName: ts + 3462, FpCurrent: 0},
  60320 	{FzName: ts + 3477, FpCurrent: 0},
  60321 	{FzName: ts + 3492, FpCurrent: 0},
  60322 	{FzName: ts + 3504, FpCurrent: 0},
  60323 	{FzName: ts + 3524, FpCurrent: 0},
  60324 	{FzName: ts + 3542, FpCurrent: 0},
  60325 	{FzName: ts + 3560, FpCurrent: 0},
  60326 	{FzName: ts + 3579, FpCurrent: 0},
  60327 	{FzName: ts + 3598, FpCurrent: 0},
  60328 	{FzName: ts + 3619, FpCurrent: 0},
  60329 	{FzName: ts + 3631, FpCurrent: 0},
  60330 	{FzName: ts + 3648, FpCurrent: 0},
  60331 	{FzName: ts + 3665, FpCurrent: 0},
  60332 	{FzName: ts + 3678, FpCurrent: 0},
  60333 	{FzName: ts + 3694, FpCurrent: 0},
  60334 	{FzName: ts + 3708, FpCurrent: 0},
  60335 	{FzName: ts + 3722, FpCurrent: 0},
  60336 	{FzName: ts + 3746, FpCurrent: 0},
  60337 	{FzName: ts + 3759, FpCurrent: 0},
  60338 	{FzName: ts + 3772, FpCurrent: 0},
  60339 	{FzName: ts + 3785, FpCurrent: 0},
  60340 	{FzName: ts + 3799, FpCurrent: 0},
  60341 	{FzName: ts + 3813, FpCurrent: 0},
  60342 	{FzName: ts + 3823, FpCurrent: 0},
  60343 	{FzName: ts + 3834, FpCurrent: 0},
  60344 	{FzName: ts + 3846, FpCurrent: 0},
  60345 	{FzName: ts + 3855, FpCurrent: 0},
  60346 	{FzName: ts + 3867, FpCurrent: 0},
  60347 	{FzName: ts + 3876, FpCurrent: 0},
  60348 	{FzName: ts + 3889, FpCurrent: 0},
  60349 	{FzName: ts + 3901, FpCurrent: 0},
  60350 	{FzName: ts + 3914, FpCurrent: 0},
  60351 	{FzName: ts + 3927, FpCurrent: 0},
  60352 	{FzName: ts + 3937, FpCurrent: 0},
  60353 	{FzName: ts + 3946, FpCurrent: 0},
  60354 	{FzName: ts + 3957, FpCurrent: 0},
  60355 	{FzName: ts + 3971, FpCurrent: 0},
  60356 	{FzName: ts + 3991, FpCurrent: 0},
  60357 	{FzName: ts + 4015, FpCurrent: 0},
  60358 	{FzName: ts + 4024, FpCurrent: 0},
  60359 	{FzName: ts + 4037, FpCurrent: 0},
  60360 	{FzName: ts + 4052, FpCurrent: 0},
  60361 	{FzName: ts + 4058, FpCurrent: 0},
  60362 	{FzName: ts + 4079, FpCurrent: 0},
  60363 	{FzName: ts + 4090, FpCurrent: 0},
  60364 	{FzName: ts + 4103, FpCurrent: 0},
  60365 	{FzName: ts + 4119, FpCurrent: 0},
  60366 	{FzName: ts + 4139, FpCurrent: 0},
  60367 	{FzName: ts + 4149},
  60368 	{FzName: ts + 4164, FpCurrent: 0},
  60369 	{FzName: ts + 4184, FpCurrent: 0},
  60370 	{FzName: ts + 4206},
  60371 	{FzName: ts + 4223},
  60372 	{FzName: ts + 4252},
  60373 	{FzName: ts + 4273},
  60374 	{FzName: ts + 4285},
  60375 	{FzName: ts + 4305},
  60376 	{FzName: ts + 4320},
  60377 	{FzName: ts + 4340, FpCurrent: 0},
  60378 	{FzName: ts + 4359, FpCurrent: 0},
  60379 	{FzName: ts + 4378, FpCurrent: 0},
  60380 	{FzName: ts + 4393},
  60381 	{FzName: ts + 4418},
  60382 	{FzName: ts + 4445},
  60383 	{FzName: ts + 4456},
  60384 	{FzName: ts + 4477, FpCurrent: 0},
  60385 }
  60386 
  60387 func winSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc Sqlite3_syscall_ptr) int32 {
  60388 	var i uint32
  60389 	var rc int32 = SQLITE_NOTFOUND
  60390 
  60391 	_ = pNotUsed
  60392 	if zName == uintptr(0) {
  60393 		rc = SQLITE_OK
  60394 		for i = uint32(0); uint64(i) < uint64(unsafe.Sizeof(aSyscall))/uint64(unsafe.Sizeof(win_syscall{})); i++ {
  60395 			if aSyscall[i].FpDefault != 0 {
  60396 				aSyscall[i].FpCurrent = aSyscall[i].FpDefault
  60397 			}
  60398 		}
  60399 	} else {
  60400 		for i = uint32(0); uint64(i) < uint64(unsafe.Sizeof(aSyscall))/uint64(unsafe.Sizeof(win_syscall{})); i++ {
  60401 			if libc.Xstrcmp(tls, zName, aSyscall[i].FzName) == 0 {
  60402 				if aSyscall[i].FpDefault == uintptr(0) {
  60403 					aSyscall[i].FpDefault = aSyscall[i].FpCurrent
  60404 				}
  60405 				rc = SQLITE_OK
  60406 				if pNewFunc == uintptr(0) {
  60407 					pNewFunc = aSyscall[i].FpDefault
  60408 				}
  60409 				aSyscall[i].FpCurrent = pNewFunc
  60410 				break
  60411 			}
  60412 		}
  60413 	}
  60414 	return rc
  60415 }
  60416 
  60417 func winGetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr) Sqlite3_syscall_ptr {
  60418 	var i uint32
  60419 
  60420 	_ = pNotUsed
  60421 	for i = uint32(0); uint64(i) < uint64(unsafe.Sizeof(aSyscall))/uint64(unsafe.Sizeof(win_syscall{})); i++ {
  60422 		if libc.Xstrcmp(tls, zName, aSyscall[i].FzName) == 0 {
  60423 			return aSyscall[i].FpCurrent
  60424 		}
  60425 	}
  60426 	return uintptr(0)
  60427 }
  60428 
  60429 func winNextSystemCall(tls *libc.TLS, p uintptr, zName uintptr) uintptr {
  60430 	var i int32 = -1
  60431 
  60432 	_ = p
  60433 	if zName != 0 {
  60434 		for i = 0; i < int32(uint64(unsafe.Sizeof(aSyscall))/uint64(unsafe.Sizeof(win_syscall{})))-1; i++ {
  60435 			if libc.Xstrcmp(tls, zName, aSyscall[i].FzName) == 0 {
  60436 				break
  60437 			}
  60438 		}
  60439 	}
  60440 	for i++; i < int32(uint64(unsafe.Sizeof(aSyscall))/uint64(unsafe.Sizeof(win_syscall{}))); i++ {
  60441 		if aSyscall[i].FpCurrent != uintptr(0) {
  60442 			return aSyscall[i].FzName
  60443 		}
  60444 	}
  60445 	return uintptr(0)
  60446 }
  60447 
  60448 func Xsqlite3_win32_write_debug(tls *libc.TLS, zBuf uintptr, nBuf int32) {
  60449 	bp := tls.Alloc(4092)
  60450 	defer tls.Free(4092)
  60451 
  60452 	var nMin int32 = func() int32 {
  60453 		if nBuf < int32(uint64(4096)-uint64(unsafe.Sizeof(DWORD(0))))-1 {
  60454 			return nBuf
  60455 		}
  60456 		return int32(uint64(4096)-uint64(unsafe.Sizeof(DWORD(0)))) - 1
  60457 	}()
  60458 	if nMin < -1 {
  60459 		nMin = -1
  60460 	}
  60461 
  60462 	if nMin > 0 {
  60463 		libc.Xmemset(tls, bp, 0, uint64(int32(uint64(4096)-uint64(unsafe.Sizeof(DWORD(0))))))
  60464 		libc.Xmemcpy(tls, bp, zBuf, uint64(nMin))
  60465 		(*(*func(*libc.TLS, LPCSTR))(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 72*24 + 8)))(tls, bp)
  60466 	} else {
  60467 		(*(*func(*libc.TLS, LPCSTR))(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 72*24 + 8)))(tls, zBuf)
  60468 	}
  60469 }
  60470 
  60471 func Xsqlite3_win32_sleep(tls *libc.TLS, milliseconds DWORD) {
  60472 	(*(*func(*libc.TLS, DWORD))(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 55*24 + 8)))(tls, milliseconds)
  60473 }
  60474 
  60475 func Xsqlite3Win32Wait(tls *libc.TLS, hObject HANDLE) DWORD {
  60476 	var rc DWORD
  60477 	for libc.AssignUint32(&rc, (*(*func(*libc.TLS, HANDLE, DWORD, WINBOOL) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 64*24 + 8)))(tls, hObject, INFINITE,
  60478 		TRUE)) == DWORD(0x000000C0) {
  60479 	}
  60480 	return rc
  60481 }
  60482 
  60483 // This function determines if the machine is running a version of Windows
  60484 // based on the NT kernel.
  60485 func Xsqlite3_win32_is_nt(tls *libc.TLS) int32 {
  60486 	bp := tls.Alloc(148)
  60487 	defer tls.Free(148)
  60488 
  60489 	if libc.X_InterlockedCompareExchange(tls, uintptr(unsafe.Pointer(&sqlite3_os_type)), 0, 0) == 0 {
  60490 		(*OSVERSIONINFOA)(unsafe.Pointer(bp)).FdwOSVersionInfoSize = DWORD(unsafe.Sizeof(OSVERSIONINFOA{}))
  60491 		(*(*func(*libc.TLS, LPOSVERSIONINFOA) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 34*24 + 8)))(tls, bp)
  60492 		libc.X_InterlockedCompareExchange(tls, uintptr(unsafe.Pointer(&sqlite3_os_type)),
  60493 			func() int32 {
  60494 				if (*OSVERSIONINFOA)(unsafe.Pointer(bp)).FdwPlatformId == DWORD(VER_PLATFORM_WIN32_NT) {
  60495 					return 2
  60496 				}
  60497 				return 1
  60498 			}(), 0)
  60499 	}
  60500 	return libc.Bool32(libc.X_InterlockedCompareExchange(tls, uintptr(unsafe.Pointer(&sqlite3_os_type)), 2, 2) == 2)
  60501 }
  60502 
  60503 func winUtf8ToUnicode(tls *libc.TLS, zText uintptr) LPWSTR {
  60504 	var nChar int32
  60505 	var zWideText LPWSTR
  60506 
  60507 	nChar = (*(*func(*libc.TLS, UINT, DWORD, LPCSTR, int32, LPWSTR, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 50*24 + 8)))(tls, uint32(CP_UTF8), uint32(0), zText, -1, uintptr(0), 0)
  60508 	if nChar == 0 {
  60509 		return uintptr(0)
  60510 	}
  60511 	zWideText = Xsqlite3MallocZero(tls, uint64(nChar)*uint64(unsafe.Sizeof(WCHAR(0))))
  60512 	if zWideText == uintptr(0) {
  60513 		return uintptr(0)
  60514 	}
  60515 	nChar = (*(*func(*libc.TLS, UINT, DWORD, LPCSTR, int32, LPWSTR, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 50*24 + 8)))(tls, uint32(CP_UTF8), uint32(0), zText, -1, zWideText,
  60516 		nChar)
  60517 	if nChar == 0 {
  60518 		Xsqlite3_free(tls, zWideText)
  60519 		zWideText = uintptr(0)
  60520 	}
  60521 	return zWideText
  60522 }
  60523 
  60524 func winUnicodeToUtf8(tls *libc.TLS, zWideText LPCWSTR) uintptr {
  60525 	var nByte int32
  60526 	var zText uintptr
  60527 
  60528 	nByte = (*(*func(*libc.TLS, UINT, DWORD, LPCWSTR, int32, LPSTR, int32, LPCSTR, LPBOOL) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 60*24 + 8)))(tls, uint32(CP_UTF8), uint32(0), zWideText, -1, uintptr(0), 0, uintptr(0), uintptr(0))
  60529 	if nByte == 0 {
  60530 		return uintptr(0)
  60531 	}
  60532 	zText = Xsqlite3MallocZero(tls, uint64(nByte))
  60533 	if zText == uintptr(0) {
  60534 		return uintptr(0)
  60535 	}
  60536 	nByte = (*(*func(*libc.TLS, UINT, DWORD, LPCWSTR, int32, LPSTR, int32, LPCSTR, LPBOOL) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 60*24 + 8)))(tls, uint32(CP_UTF8), uint32(0), zWideText, -1, zText, nByte,
  60537 		uintptr(0), uintptr(0))
  60538 	if nByte == 0 {
  60539 		Xsqlite3_free(tls, zText)
  60540 		zText = uintptr(0)
  60541 	}
  60542 	return zText
  60543 }
  60544 
  60545 func winMbcsToUnicode(tls *libc.TLS, zText uintptr, useAnsi int32) LPWSTR {
  60546 	var nByte int32
  60547 	var zMbcsText LPWSTR
  60548 	var codepage int32
  60549 	if useAnsi != 0 {
  60550 		codepage = CP_ACP
  60551 	} else {
  60552 		codepage = CP_OEMCP
  60553 	}
  60554 
  60555 	nByte = int32(uint64((*(*func(*libc.TLS, UINT, DWORD, LPCSTR, int32, LPWSTR, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 50*24 + 8)))(tls, uint32(codepage), uint32(0), zText, -1, uintptr(0),
  60556 		0)) * uint64(unsafe.Sizeof(WCHAR(0))))
  60557 	if nByte == 0 {
  60558 		return uintptr(0)
  60559 	}
  60560 	zMbcsText = Xsqlite3MallocZero(tls, uint64(nByte)*uint64(unsafe.Sizeof(WCHAR(0))))
  60561 	if zMbcsText == uintptr(0) {
  60562 		return uintptr(0)
  60563 	}
  60564 	nByte = (*(*func(*libc.TLS, UINT, DWORD, LPCSTR, int32, LPWSTR, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 50*24 + 8)))(tls, uint32(codepage), uint32(0), zText, -1, zMbcsText,
  60565 		nByte)
  60566 	if nByte == 0 {
  60567 		Xsqlite3_free(tls, zMbcsText)
  60568 		zMbcsText = uintptr(0)
  60569 	}
  60570 	return zMbcsText
  60571 }
  60572 
  60573 func winUnicodeToMbcs(tls *libc.TLS, zWideText LPCWSTR, useAnsi int32) uintptr {
  60574 	var nByte int32
  60575 	var zText uintptr
  60576 	var codepage int32
  60577 	if useAnsi != 0 {
  60578 		codepage = CP_ACP
  60579 	} else {
  60580 		codepage = CP_OEMCP
  60581 	}
  60582 
  60583 	nByte = (*(*func(*libc.TLS, UINT, DWORD, LPCWSTR, int32, LPSTR, int32, LPCSTR, LPBOOL) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 60*24 + 8)))(tls, uint32(codepage), uint32(0), zWideText, -1, uintptr(0), 0, uintptr(0), uintptr(0))
  60584 	if nByte == 0 {
  60585 		return uintptr(0)
  60586 	}
  60587 	zText = Xsqlite3MallocZero(tls, uint64(nByte))
  60588 	if zText == uintptr(0) {
  60589 		return uintptr(0)
  60590 	}
  60591 	nByte = (*(*func(*libc.TLS, UINT, DWORD, LPCWSTR, int32, LPSTR, int32, LPCSTR, LPBOOL) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 60*24 + 8)))(tls, uint32(codepage), uint32(0), zWideText, -1, zText,
  60592 		nByte, uintptr(0), uintptr(0))
  60593 	if nByte == 0 {
  60594 		Xsqlite3_free(tls, zText)
  60595 		zText = uintptr(0)
  60596 	}
  60597 	return zText
  60598 }
  60599 
  60600 func winMbcsToUtf8(tls *libc.TLS, zText uintptr, useAnsi int32) uintptr {
  60601 	var zTextUtf8 uintptr
  60602 	var zTmpWide LPWSTR
  60603 
  60604 	zTmpWide = winMbcsToUnicode(tls, zText, useAnsi)
  60605 	if zTmpWide == uintptr(0) {
  60606 		return uintptr(0)
  60607 	}
  60608 	zTextUtf8 = winUnicodeToUtf8(tls, zTmpWide)
  60609 	Xsqlite3_free(tls, zTmpWide)
  60610 	return zTextUtf8
  60611 }
  60612 
  60613 func winUtf8ToMbcs(tls *libc.TLS, zText uintptr, useAnsi int32) uintptr {
  60614 	var zTextMbcs uintptr
  60615 	var zTmpWide LPWSTR
  60616 
  60617 	zTmpWide = winUtf8ToUnicode(tls, zText)
  60618 	if zTmpWide == uintptr(0) {
  60619 		return uintptr(0)
  60620 	}
  60621 	zTextMbcs = winUnicodeToMbcs(tls, zTmpWide, useAnsi)
  60622 	Xsqlite3_free(tls, zTmpWide)
  60623 	return zTextMbcs
  60624 }
  60625 
  60626 // This is a public wrapper for the winUtf8ToUnicode() function.
  60627 func Xsqlite3_win32_utf8_to_unicode(tls *libc.TLS, zText uintptr) LPWSTR {
  60628 	if Xsqlite3_initialize(tls) != 0 {
  60629 		return uintptr(0)
  60630 	}
  60631 	return winUtf8ToUnicode(tls, zText)
  60632 }
  60633 
  60634 // This is a public wrapper for the winUnicodeToUtf8() function.
  60635 func Xsqlite3_win32_unicode_to_utf8(tls *libc.TLS, zWideText LPCWSTR) uintptr {
  60636 	if Xsqlite3_initialize(tls) != 0 {
  60637 		return uintptr(0)
  60638 	}
  60639 	return winUnicodeToUtf8(tls, zWideText)
  60640 }
  60641 
  60642 // This is a public wrapper for the winMbcsToUtf8() function.
  60643 func Xsqlite3_win32_mbcs_to_utf8(tls *libc.TLS, zText uintptr) uintptr {
  60644 	if Xsqlite3_initialize(tls) != 0 {
  60645 		return uintptr(0)
  60646 	}
  60647 	return winMbcsToUtf8(tls, zText, (*(*func(*libc.TLS) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 8)))(tls))
  60648 }
  60649 
  60650 // This is a public wrapper for the winMbcsToUtf8() function.
  60651 func Xsqlite3_win32_mbcs_to_utf8_v2(tls *libc.TLS, zText uintptr, useAnsi int32) uintptr {
  60652 	if Xsqlite3_initialize(tls) != 0 {
  60653 		return uintptr(0)
  60654 	}
  60655 	return winMbcsToUtf8(tls, zText, useAnsi)
  60656 }
  60657 
  60658 // This is a public wrapper for the winUtf8ToMbcs() function.
  60659 func Xsqlite3_win32_utf8_to_mbcs(tls *libc.TLS, zText uintptr) uintptr {
  60660 	if Xsqlite3_initialize(tls) != 0 {
  60661 		return uintptr(0)
  60662 	}
  60663 	return winUtf8ToMbcs(tls, zText, (*(*func(*libc.TLS) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 8)))(tls))
  60664 }
  60665 
  60666 // This is a public wrapper for the winUtf8ToMbcs() function.
  60667 func Xsqlite3_win32_utf8_to_mbcs_v2(tls *libc.TLS, zText uintptr, useAnsi int32) uintptr {
  60668 	if Xsqlite3_initialize(tls) != 0 {
  60669 		return uintptr(0)
  60670 	}
  60671 	return winUtf8ToMbcs(tls, zText, useAnsi)
  60672 }
  60673 
  60674 // This function is the same as sqlite3_win32_set_directory (below); however,
  60675 // it accepts a UTF-8 string.
  60676 func Xsqlite3_win32_set_directory8(tls *libc.TLS, type1 uint32, zValue uintptr) int32 {
  60677 	bp := tls.Alloc(8)
  60678 	defer tls.Free(8)
  60679 
  60680 	var ppDirectory uintptr
  60681 	var rc int32
  60682 	var zCopy uintptr
  60683 	ppDirectory = uintptr(0)
  60684 	rc = Xsqlite3_initialize(tls)
  60685 	if !(rc != 0) {
  60686 		goto __1
  60687 	}
  60688 	return rc
  60689 __1:
  60690 	;
  60691 	Xsqlite3_mutex_enter(tls, Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_VFS1))
  60692 	if !(type1 == uint32(SQLITE_WIN32_DATA_DIRECTORY_TYPE)) {
  60693 		goto __2
  60694 	}
  60695 	ppDirectory = uintptr(unsafe.Pointer(&Xsqlite3_data_directory))
  60696 	goto __3
  60697 __2:
  60698 	if !(type1 == uint32(SQLITE_WIN32_TEMP_DIRECTORY_TYPE)) {
  60699 		goto __4
  60700 	}
  60701 	ppDirectory = uintptr(unsafe.Pointer(&Xsqlite3_temp_directory))
  60702 __4:
  60703 	;
  60704 __3:
  60705 	;
  60706 	if !(ppDirectory != 0) {
  60707 		goto __5
  60708 	}
  60709 	zCopy = uintptr(0)
  60710 	if !(zValue != 0 && *(*int8)(unsafe.Pointer(zValue)) != 0) {
  60711 		goto __7
  60712 	}
  60713 	zCopy = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp, zValue))
  60714 	if !(zCopy == uintptr(0)) {
  60715 		goto __8
  60716 	}
  60717 	rc = SQLITE_NOMEM
  60718 	goto set_directory8_done
  60719 __8:
  60720 	;
  60721 __7:
  60722 	;
  60723 	Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(ppDirectory)))
  60724 	*(*uintptr)(unsafe.Pointer(ppDirectory)) = zCopy
  60725 	rc = SQLITE_OK
  60726 	goto __6
  60727 __5:
  60728 	rc = SQLITE_ERROR
  60729 __6:
  60730 	;
  60731 set_directory8_done:
  60732 	Xsqlite3_mutex_leave(tls, Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_VFS1))
  60733 	return rc
  60734 }
  60735 
  60736 // This function is the same as sqlite3_win32_set_directory (below); however,
  60737 // it accepts a UTF-16 string.
  60738 func Xsqlite3_win32_set_directory16(tls *libc.TLS, type1 uint32, zValue uintptr) int32 {
  60739 	var rc int32
  60740 	var zUtf8 uintptr = uintptr(0)
  60741 	if zValue != 0 {
  60742 		zUtf8 = Xsqlite3_win32_unicode_to_utf8(tls, zValue)
  60743 		if zUtf8 == uintptr(0) {
  60744 			return SQLITE_NOMEM
  60745 		}
  60746 	}
  60747 	rc = Xsqlite3_win32_set_directory8(tls, type1, zUtf8)
  60748 	if zUtf8 != 0 {
  60749 		Xsqlite3_free(tls, zUtf8)
  60750 	}
  60751 	return rc
  60752 }
  60753 
  60754 // This function sets the data directory or the temporary directory based on
  60755 // the provided arguments.  The type argument must be 1 in order to set the
  60756 // data directory or 2 in order to set the temporary directory.  The zValue
  60757 // argument is the name of the directory to use.  The return value will be
  60758 // SQLITE_OK if successful.
  60759 func Xsqlite3_win32_set_directory(tls *libc.TLS, type1 uint32, zValue uintptr) int32 {
  60760 	return Xsqlite3_win32_set_directory16(tls, type1, zValue)
  60761 }
  60762 
  60763 func winGetLastErrorMsg(tls *libc.TLS, lastErrno DWORD, nBuf int32, zBuf uintptr) int32 {
  60764 	bp := tls.Alloc(40)
  60765 	defer tls.Free(40)
  60766 
  60767 	var dwLen DWORD = DWORD(0)
  60768 	var zOut uintptr = uintptr(0)
  60769 
  60770 	if sqlite3_os_type == 2 || Xsqlite3_win32_is_nt(tls) != 0 {
  60771 		*(*LPWSTR)(unsafe.Pointer(bp + 24)) = uintptr(0)
  60772 		dwLen = (*(*func(*libc.TLS, DWORD, LPCVOID, DWORD, DWORD, LPWSTR, DWORD, uintptr) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 15*24 + 8)))(tls, uint32(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS),
  60773 			uintptr(0),
  60774 			lastErrno,
  60775 			uint32(0),
  60776 			bp+24,
  60777 			uint32(0),
  60778 			uintptr(0))
  60779 		if dwLen > DWORD(0) {
  60780 			Xsqlite3BeginBenignMalloc(tls)
  60781 			zOut = winUnicodeToUtf8(tls, *(*LPWSTR)(unsafe.Pointer(bp + 24)))
  60782 			Xsqlite3EndBenignMalloc(tls)
  60783 
  60784 			(*(*func(*libc.TLS, HLOCAL) HLOCAL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 46*24 + 8)))(tls, *(*LPWSTR)(unsafe.Pointer(bp + 24)))
  60785 		}
  60786 	} else {
  60787 		*(*uintptr)(unsafe.Pointer(bp + 32)) = uintptr(0)
  60788 		dwLen = (*(*func(*libc.TLS, DWORD, LPCVOID, DWORD, DWORD, LPSTR, DWORD, uintptr) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 14*24 + 8)))(tls, uint32(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS),
  60789 			uintptr(0),
  60790 			lastErrno,
  60791 			uint32(0),
  60792 			bp+32,
  60793 			uint32(0),
  60794 			uintptr(0))
  60795 		if dwLen > DWORD(0) {
  60796 			Xsqlite3BeginBenignMalloc(tls)
  60797 			zOut = winMbcsToUtf8(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), (*(*func(*libc.TLS) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 8)))(tls))
  60798 			Xsqlite3EndBenignMalloc(tls)
  60799 
  60800 			(*(*func(*libc.TLS, HLOCAL) HLOCAL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 46*24 + 8)))(tls, *(*uintptr)(unsafe.Pointer(bp + 32)))
  60801 		}
  60802 	}
  60803 	if DWORD(0) == dwLen {
  60804 		Xsqlite3_snprintf(tls, nBuf, zBuf, ts+4496, libc.VaList(bp, lastErrno, lastErrno))
  60805 	} else {
  60806 		Xsqlite3_snprintf(tls, nBuf, zBuf, ts+4493, libc.VaList(bp+16, zOut))
  60807 
  60808 		Xsqlite3_free(tls, zOut)
  60809 	}
  60810 	return 0
  60811 }
  60812 
  60813 func winLogErrorAtLine(tls *libc.TLS, errcode int32, lastErrno DWORD, zFunc uintptr, zPath uintptr, iLine int32) int32 {
  60814 	bp := tls.Alloc(540)
  60815 	defer tls.Free(540)
  60816 
  60817 	var i int32
  60818 
  60819 	*(*int8)(unsafe.Pointer(bp + 40)) = int8(0)
  60820 	winGetLastErrorMsg(tls, lastErrno, int32(unsafe.Sizeof([500]int8{})), bp+40)
  60821 
  60822 	if zPath == uintptr(0) {
  60823 		zPath = ts + 1544
  60824 	}
  60825 	for i = 0; *(*int8)(unsafe.Pointer(bp + 40 + uintptr(i))) != 0 && int32(*(*int8)(unsafe.Pointer(bp + 40 + uintptr(i)))) != '\r' && int32(*(*int8)(unsafe.Pointer(bp + 40 + uintptr(i)))) != '\n'; i++ {
  60826 	}
  60827 	*(*int8)(unsafe.Pointer(bp + 40 + uintptr(i))) = int8(0)
  60828 	Xsqlite3_log(tls, errcode,
  60829 		ts+4516,
  60830 		libc.VaList(bp, iLine, lastErrno, zFunc, zPath, bp+40))
  60831 
  60832 	return errcode
  60833 }
  60834 
  60835 var winIoerrRetry int32 = SQLITE_WIN32_IOERR_RETRY
  60836 var winIoerrRetryDelay int32 = SQLITE_WIN32_IOERR_RETRY_DELAY
  60837 
  60838 func winRetryIoerr(tls *libc.TLS, pnRetry uintptr, pError uintptr) int32 {
  60839 	var e DWORD = (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls)
  60840 	if *(*int32)(unsafe.Pointer(pnRetry)) >= winIoerrRetry {
  60841 		if pError != 0 {
  60842 			*(*DWORD)(unsafe.Pointer(pError)) = e
  60843 		}
  60844 		return 0
  60845 	}
  60846 	if e == DWORD(5) || e == DWORD(32) || e == DWORD(33) || e == DWORD(55) || e == DWORD(64) || e == DWORD(121) || e == DWORD(1231) {
  60847 		Xsqlite3_win32_sleep(tls, uint32(winIoerrRetryDelay*(1+*(*int32)(unsafe.Pointer(pnRetry)))))
  60848 		*(*int32)(unsafe.Pointer(pnRetry))++
  60849 		return 1
  60850 	}
  60851 	if pError != 0 {
  60852 		*(*DWORD)(unsafe.Pointer(pError)) = e
  60853 	}
  60854 	return 0
  60855 }
  60856 
  60857 func winLogIoerr(tls *libc.TLS, nRetry int32, lineno int32) {
  60858 	bp := tls.Alloc(16)
  60859 	defer tls.Free(16)
  60860 
  60861 	if nRetry != 0 {
  60862 		Xsqlite3_log(tls, SQLITE_NOTICE,
  60863 			ts+4547,
  60864 			libc.VaList(bp, winIoerrRetryDelay*nRetry*(nRetry+1)/2, lineno))
  60865 	}
  60866 }
  60867 
  60868 func winLockFile(tls *libc.TLS, phFile LPHANDLE, flags DWORD, offsetLow DWORD, offsetHigh DWORD, numBytesLow DWORD, numBytesHigh DWORD) WINBOOL {
  60869 	bp := tls.Alloc(32)
  60870 	defer tls.Free(32)
  60871 
  60872 	if sqlite3_os_type == 2 || Xsqlite3_win32_is_nt(tls) != 0 {
  60873 		libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(OVERLAPPED{})))
  60874 		*(*DWORD)(unsafe.Pointer(bp + 16)) = offsetLow
  60875 		*(*DWORD)(unsafe.Pointer(bp + 20)) = offsetHigh
  60876 		return (*(*func(*libc.TLS, HANDLE, DWORD, DWORD, DWORD, DWORD, LPOVERLAPPED) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 48*24 + 8)))(tls, *(*HANDLE)(unsafe.Pointer(phFile)), flags, uint32(0), numBytesLow, numBytesHigh, bp)
  60877 	} else {
  60878 		return (*(*func(*libc.TLS, HANDLE, DWORD, DWORD, DWORD, DWORD) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 47*24 + 8)))(tls, *(*HANDLE)(unsafe.Pointer(phFile)), offsetLow, offsetHigh, numBytesLow,
  60879 			numBytesHigh)
  60880 	}
  60881 	return WINBOOL(0)
  60882 }
  60883 
  60884 func winUnlockFile(tls *libc.TLS, phFile LPHANDLE, offsetLow DWORD, offsetHigh DWORD, numBytesLow DWORD, numBytesHigh DWORD) WINBOOL {
  60885 	bp := tls.Alloc(32)
  60886 	defer tls.Free(32)
  60887 
  60888 	if sqlite3_os_type == 2 || Xsqlite3_win32_is_nt(tls) != 0 {
  60889 		libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(OVERLAPPED{})))
  60890 		*(*DWORD)(unsafe.Pointer(bp + 16)) = offsetLow
  60891 		*(*DWORD)(unsafe.Pointer(bp + 20)) = offsetHigh
  60892 		return (*(*func(*libc.TLS, HANDLE, DWORD, DWORD, DWORD, LPOVERLAPPED) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 58*24 + 8)))(tls, *(*HANDLE)(unsafe.Pointer(phFile)), uint32(0), numBytesLow, numBytesHigh, bp)
  60893 	} else {
  60894 		return (*(*func(*libc.TLS, HANDLE, DWORD, DWORD, DWORD, DWORD) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 57*24 + 8)))(tls, *(*HANDLE)(unsafe.Pointer(phFile)), offsetLow, offsetHigh, numBytesLow,
  60895 			numBytesHigh)
  60896 	}
  60897 	return WINBOOL(0)
  60898 }
  60899 
  60900 func winSeekFile(tls *libc.TLS, pFile uintptr, iOffset Sqlite3_int64) int32 {
  60901 	bp := tls.Alloc(4)
  60902 	defer tls.Free(4)
  60903 
  60904 	var lowerBits LONG
  60905 	var dwRet DWORD
  60906 	var lastErrno DWORD
  60907 
  60908 	*(*LONG)(unsafe.Pointer(bp)) = LONG(iOffset >> 32 & int64(0x7fffffff))
  60909 	lowerBits = LONG(iOffset & int64(0xffffffff))
  60910 
  60911 	dwRet = (*(*func(*libc.TLS, HANDLE, LONG, PLONG, DWORD) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 54*24 + 8)))(tls, (*WinFile)(unsafe.Pointer(pFile)).Fh, lowerBits, bp, uint32(FILE_BEGIN))
  60912 
  60913 	if dwRet == libc.Uint32(libc.Uint32FromInt32(-1)) &&
  60914 		libc.AssignUint32(&lastErrno, (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls)) != DWORD(0) {
  60915 		(*WinFile)(unsafe.Pointer(pFile)).FlastErrno = lastErrno
  60916 		winLogErrorAtLine(tls, SQLITE_IOERR|int32(22)<<8, (*WinFile)(unsafe.Pointer(pFile)).FlastErrno, ts+4597, (*WinFile)(unsafe.Pointer(pFile)).FzPath, 47688)
  60917 
  60918 		return 1
  60919 	}
  60920 
  60921 	return 0
  60922 }
  60923 
  60924 func winClose(tls *libc.TLS, id uintptr) int32 {
  60925 	var rc int32
  60926 	var cnt int32 = 0
  60927 	var pFile uintptr = id
  60928 
  60929 	winUnmapfile(tls, pFile)
  60930 
  60931 	for __ccgo := true; __ccgo; __ccgo = rc == 0 && libc.PreIncInt32(&cnt, 1) < MX_CLOSE_ATTEMPT && func() bool { Xsqlite3_win32_sleep(tls, uint32(100)); return 1 != 0 }() {
  60932 		rc = (*(*func(*libc.TLS, HANDLE) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 3*24 + 8)))(tls, (*WinFile)(unsafe.Pointer(pFile)).Fh)
  60933 
  60934 	}
  60935 	if rc != 0 {
  60936 		(*WinFile)(unsafe.Pointer(pFile)).Fh = uintptr(0)
  60937 	}
  60938 
  60939 	if rc != 0 {
  60940 		return SQLITE_OK
  60941 	}
  60942 	return winLogErrorAtLine(tls, SQLITE_IOERR|int32(16)<<8, (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls), ts+4609, (*WinFile)(unsafe.Pointer(pFile)).FzPath, 47784)
  60943 }
  60944 
  60945 func winRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3_int64) int32 {
  60946 	bp := tls.Alloc(44)
  60947 	defer tls.Free(44)
  60948 
  60949 	var pFile uintptr = id
  60950 
  60951 	*(*int32)(unsafe.Pointer(bp + 36)) = 0
  60952 
  60953 	if offset < (*WinFile)(unsafe.Pointer(pFile)).FmmapSize {
  60954 		if offset+Sqlite3_int64(amt) <= (*WinFile)(unsafe.Pointer(pFile)).FmmapSize {
  60955 			libc.Xmemcpy(tls, pBuf, (*WinFile)(unsafe.Pointer(pFile)).FpMapRegion+uintptr(offset), uint64(amt))
  60956 
  60957 			return SQLITE_OK
  60958 		} else {
  60959 			var nCopy int32 = int32((*WinFile)(unsafe.Pointer(pFile)).FmmapSize - offset)
  60960 			libc.Xmemcpy(tls, pBuf, (*WinFile)(unsafe.Pointer(pFile)).FpMapRegion+uintptr(offset), uint64(nCopy))
  60961 			pBuf = pBuf + uintptr(nCopy)
  60962 			amt = amt - nCopy
  60963 			offset = offset + Sqlite3_int64(nCopy)
  60964 		}
  60965 	}
  60966 
  60967 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(OVERLAPPED{})))
  60968 	*(*DWORD)(unsafe.Pointer(bp + 16)) = DWORD(LONG(offset & int64(0xffffffff)))
  60969 	*(*DWORD)(unsafe.Pointer(bp + 20)) = DWORD(LONG(offset >> 32 & int64(0x7fffffff)))
  60970 	for !((*(*func(*libc.TLS, HANDLE, LPVOID, DWORD, LPDWORD, LPOVERLAPPED) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 52*24 + 8)))(tls, (*WinFile)(unsafe.Pointer(pFile)).Fh, pBuf, uint32(amt), bp+32, bp) != 0) && (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls) != DWORD(38) {
  60971 		if winRetryIoerr(tls, bp+36, bp+40) != 0 {
  60972 			continue
  60973 		}
  60974 		(*WinFile)(unsafe.Pointer(pFile)).FlastErrno = *(*DWORD)(unsafe.Pointer(bp + 40))
  60975 
  60976 		return winLogErrorAtLine(tls, SQLITE_IOERR|int32(1)<<8, (*WinFile)(unsafe.Pointer(pFile)).FlastErrno, ts+4618, (*WinFile)(unsafe.Pointer(pFile)).FzPath, 47852)
  60977 	}
  60978 	winLogIoerr(tls, *(*int32)(unsafe.Pointer(bp + 36)), 47855)
  60979 	if *(*DWORD)(unsafe.Pointer(bp + 32)) < DWORD(amt) {
  60980 		libc.Xmemset(tls, pBuf+uintptr(*(*DWORD)(unsafe.Pointer(bp + 32))), 0, uint64(DWORD(amt)-*(*DWORD)(unsafe.Pointer(bp + 32))))
  60981 
  60982 		return SQLITE_IOERR | int32(2)<<8
  60983 	}
  60984 
  60985 	return SQLITE_OK
  60986 }
  60987 
  60988 func winWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3_int64) int32 {
  60989 	bp := tls.Alloc(44)
  60990 	defer tls.Free(44)
  60991 
  60992 	var rc int32 = 0
  60993 	var pFile uintptr = id
  60994 	*(*int32)(unsafe.Pointer(bp + 36)) = 0
  60995 
  60996 	{
  60997 		var aRem uintptr = pBuf
  60998 		var nRem int32 = amt
  60999 
  61000 		*(*DWORD)(unsafe.Pointer(bp + 40)) = DWORD(0)
  61001 
  61002 		libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(OVERLAPPED{})))
  61003 		*(*DWORD)(unsafe.Pointer(bp + 16)) = DWORD(LONG(offset & int64(0xffffffff)))
  61004 		*(*DWORD)(unsafe.Pointer(bp + 20)) = DWORD(LONG(offset >> 32 & int64(0x7fffffff)))
  61005 
  61006 		for nRem > 0 {
  61007 			if !((*(*func(*libc.TLS, HANDLE, LPCVOID, DWORD, LPDWORD, LPOVERLAPPED) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 61*24 + 8)))(tls, (*WinFile)(unsafe.Pointer(pFile)).Fh, aRem, uint32(nRem), bp+32, bp) != 0) {
  61008 				if winRetryIoerr(tls, bp+36, bp+40) != 0 {
  61009 					continue
  61010 				}
  61011 				break
  61012 			}
  61013 
  61014 			if *(*DWORD)(unsafe.Pointer(bp + 32)) == DWORD(0) || *(*DWORD)(unsafe.Pointer(bp + 32)) > DWORD(nRem) {
  61015 				*(*DWORD)(unsafe.Pointer(bp + 40)) = (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls)
  61016 				break
  61017 			}
  61018 			offset = offset + Sqlite3_int64(*(*DWORD)(unsafe.Pointer(bp + 32)))
  61019 			*(*DWORD)(unsafe.Pointer(bp + 16)) = DWORD(LONG(offset & int64(0xffffffff)))
  61020 			*(*DWORD)(unsafe.Pointer(bp + 20)) = DWORD(LONG(offset >> 32 & int64(0x7fffffff)))
  61021 			aRem += uintptr(*(*DWORD)(unsafe.Pointer(bp + 32)))
  61022 			nRem = int32(DWORD(nRem) - *(*DWORD)(unsafe.Pointer(bp + 32)))
  61023 		}
  61024 		if nRem > 0 {
  61025 			(*WinFile)(unsafe.Pointer(pFile)).FlastErrno = *(*DWORD)(unsafe.Pointer(bp + 40))
  61026 			rc = 1
  61027 		}
  61028 
  61029 	}
  61030 
  61031 	if rc != 0 {
  61032 		if (*WinFile)(unsafe.Pointer(pFile)).FlastErrno == DWORD(39) ||
  61033 			(*WinFile)(unsafe.Pointer(pFile)).FlastErrno == DWORD(112) {
  61034 			return winLogErrorAtLine(tls, SQLITE_FULL, (*WinFile)(unsafe.Pointer(pFile)).FlastErrno, ts+4626, (*WinFile)(unsafe.Pointer(pFile)).FzPath, 47964)
  61035 		}
  61036 
  61037 		return winLogErrorAtLine(tls, SQLITE_IOERR|int32(3)<<8, (*WinFile)(unsafe.Pointer(pFile)).FlastErrno, ts+4636, (*WinFile)(unsafe.Pointer(pFile)).FzPath, 47969)
  61038 	} else {
  61039 		winLogIoerr(tls, *(*int32)(unsafe.Pointer(bp + 36)), 47972)
  61040 	}
  61041 
  61042 	return SQLITE_OK
  61043 }
  61044 
  61045 func winTruncate(tls *libc.TLS, id uintptr, nByte Sqlite3_int64) int32 {
  61046 	var pFile uintptr = id
  61047 	var rc int32 = SQLITE_OK
  61048 	var lastErrno DWORD
  61049 	var oldMmapSize Sqlite3_int64
  61050 	if (*WinFile)(unsafe.Pointer(pFile)).FnFetchOut > 0 {
  61051 		return SQLITE_OK
  61052 	}
  61053 
  61054 	if (*WinFile)(unsafe.Pointer(pFile)).FszChunk > 0 {
  61055 		nByte = (nByte + Sqlite3_int64((*WinFile)(unsafe.Pointer(pFile)).FszChunk) - int64(1)) / Sqlite3_int64((*WinFile)(unsafe.Pointer(pFile)).FszChunk) * Sqlite3_int64((*WinFile)(unsafe.Pointer(pFile)).FszChunk)
  61056 	}
  61057 
  61058 	if (*WinFile)(unsafe.Pointer(pFile)).FpMapRegion != 0 {
  61059 		oldMmapSize = (*WinFile)(unsafe.Pointer(pFile)).FmmapSize
  61060 	} else {
  61061 		oldMmapSize = int64(0)
  61062 	}
  61063 	winUnmapfile(tls, pFile)
  61064 
  61065 	if winSeekFile(tls, pFile, nByte) != 0 {
  61066 		rc = winLogErrorAtLine(tls, SQLITE_IOERR|int32(6)<<8, (*WinFile)(unsafe.Pointer(pFile)).FlastErrno, ts+4646, (*WinFile)(unsafe.Pointer(pFile)).FzPath, 48035)
  61067 	} else if 0 == (*(*func(*libc.TLS, HANDLE) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 53*24 + 8)))(tls, (*WinFile)(unsafe.Pointer(pFile)).Fh) && libc.AssignUint32(&lastErrno, (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls)) != DWORD(1224) {
  61068 		(*WinFile)(unsafe.Pointer(pFile)).FlastErrno = lastErrno
  61069 		rc = winLogErrorAtLine(tls, SQLITE_IOERR|int32(6)<<8, (*WinFile)(unsafe.Pointer(pFile)).FlastErrno, ts+4659, (*WinFile)(unsafe.Pointer(pFile)).FzPath, 48040)
  61070 	}
  61071 
  61072 	if rc == SQLITE_OK && oldMmapSize > int64(0) {
  61073 		if oldMmapSize > nByte {
  61074 			winMapfile(tls, pFile, int64(-1))
  61075 		} else {
  61076 			winMapfile(tls, pFile, oldMmapSize)
  61077 		}
  61078 	}
  61079 
  61080 	return rc
  61081 }
  61082 
  61083 func winSync(tls *libc.TLS, id uintptr, flags int32) int32 {
  61084 	var rc WINBOOL
  61085 
  61086 	var pFile uintptr = id
  61087 
  61088 	_ = flags
  61089 
  61090 	if (*WinFile)(unsafe.Pointer(pFile)).FpMapRegion != 0 {
  61091 		if (*(*func(*libc.TLS, LPCVOID, SIZE_T) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 79*24 + 8)))(tls, (*WinFile)(unsafe.Pointer(pFile)).FpMapRegion, uint64(0)) != 0 {
  61092 		} else {
  61093 			(*WinFile)(unsafe.Pointer(pFile)).FlastErrno = (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls)
  61094 
  61095 			return winLogErrorAtLine(tls, SQLITE_IOERR|int32(24)<<8, (*WinFile)(unsafe.Pointer(pFile)).FlastErrno, ts+4672, (*WinFile)(unsafe.Pointer(pFile)).FzPath, 48132)
  61096 		}
  61097 	}
  61098 	rc = (*(*func(*libc.TLS, HANDLE) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 13*24 + 8)))(tls, (*WinFile)(unsafe.Pointer(pFile)).Fh)
  61099 
  61100 	if rc != 0 {
  61101 		return SQLITE_OK
  61102 	} else {
  61103 		(*WinFile)(unsafe.Pointer(pFile)).FlastErrno = (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls)
  61104 
  61105 		return winLogErrorAtLine(tls, SQLITE_IOERR|int32(4)<<8, (*WinFile)(unsafe.Pointer(pFile)).FlastErrno, ts+4681, (*WinFile)(unsafe.Pointer(pFile)).FzPath, 48147)
  61106 	}
  61107 	return int32(0)
  61108 }
  61109 
  61110 func winFileSize(tls *libc.TLS, id uintptr, pSize uintptr) int32 {
  61111 	bp := tls.Alloc(4)
  61112 	defer tls.Free(4)
  61113 
  61114 	var pFile uintptr = id
  61115 	var rc int32 = SQLITE_OK
  61116 
  61117 	{
  61118 		var lowerBits DWORD
  61119 		var lastErrno DWORD
  61120 
  61121 		lowerBits = (*(*func(*libc.TLS, HANDLE, LPDWORD) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 23*24 + 8)))(tls, (*WinFile)(unsafe.Pointer(pFile)).Fh, bp)
  61122 		*(*Sqlite3_int64)(unsafe.Pointer(pSize)) = Sqlite3_int64(*(*DWORD)(unsafe.Pointer(bp)))<<32 + Sqlite3_int64(lowerBits)
  61123 		if lowerBits == 0xffffffff &&
  61124 			libc.AssignUint32(&lastErrno, (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls)) != DWORD(0) {
  61125 			(*WinFile)(unsafe.Pointer(pFile)).FlastErrno = lastErrno
  61126 			rc = winLogErrorAtLine(tls, SQLITE_IOERR|int32(7)<<8, (*WinFile)(unsafe.Pointer(pFile)).FlastErrno, ts+4690, (*WinFile)(unsafe.Pointer(pFile)).FzPath, 48188)
  61127 		}
  61128 
  61129 	}
  61130 
  61131 	return rc
  61132 }
  61133 
  61134 func winGetReadLock(tls *libc.TLS, pFile uintptr) int32 {
  61135 	bp := tls.Alloc(4)
  61136 	defer tls.Free(4)
  61137 
  61138 	var res int32
  61139 
  61140 	if sqlite3_os_type == 2 || Xsqlite3_win32_is_nt(tls) != 0 {
  61141 		res = winLockFile(tls, pFile+16, uint32(LOCKFILE_FAIL_IMMEDIATELY), uint32(Xsqlite3PendingByte+2), uint32(0),
  61142 			uint32(SHARED_SIZE), uint32(0))
  61143 	} else {
  61144 		Xsqlite3_randomness(tls, int32(unsafe.Sizeof(int32(0))), bp)
  61145 		(*WinFile)(unsafe.Pointer(pFile)).FsharedLockByte = int16(*(*int32)(unsafe.Pointer(bp)) & 0x7fffffff % (SHARED_SIZE - 1))
  61146 		res = winLockFile(tls, pFile+16, uint32(LOCKFILE_FAIL_IMMEDIATELY|LOCKFILE_EXCLUSIVE_LOCK),
  61147 			uint32(Xsqlite3PendingByte+2+int32((*WinFile)(unsafe.Pointer(pFile)).FsharedLockByte)), uint32(0), uint32(1), uint32(0))
  61148 	}
  61149 	if res == 0 {
  61150 		(*WinFile)(unsafe.Pointer(pFile)).FlastErrno = (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls)
  61151 
  61152 	}
  61153 
  61154 	return res
  61155 }
  61156 
  61157 func winUnlockReadLock(tls *libc.TLS, pFile uintptr) int32 {
  61158 	var res int32
  61159 	var lastErrno DWORD
  61160 
  61161 	if sqlite3_os_type == 2 || Xsqlite3_win32_is_nt(tls) != 0 {
  61162 		res = winUnlockFile(tls, pFile+16, uint32(Xsqlite3PendingByte+2), uint32(0), uint32(SHARED_SIZE), uint32(0))
  61163 	} else {
  61164 		res = winUnlockFile(tls, pFile+16, uint32(Xsqlite3PendingByte+2+int32((*WinFile)(unsafe.Pointer(pFile)).FsharedLockByte)), uint32(0), uint32(1), uint32(0))
  61165 	}
  61166 	if res == 0 && libc.AssignUint32(&lastErrno, (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls)) != DWORD(158) {
  61167 		(*WinFile)(unsafe.Pointer(pFile)).FlastErrno = lastErrno
  61168 		winLogErrorAtLine(tls, SQLITE_IOERR|int32(8)<<8, (*WinFile)(unsafe.Pointer(pFile)).FlastErrno, ts+4702, (*WinFile)(unsafe.Pointer(pFile)).FzPath, 48283)
  61169 	}
  61170 
  61171 	return res
  61172 }
  61173 
  61174 func winLock(tls *libc.TLS, id uintptr, locktype int32) int32 {
  61175 	var rc int32 = SQLITE_OK
  61176 	var res int32 = 1
  61177 	var newLocktype int32
  61178 	var gotPendingLock int32 = 0
  61179 	var pFile uintptr = id
  61180 	var lastErrno DWORD = DWORD(0)
  61181 
  61182 	if int32((*WinFile)(unsafe.Pointer(pFile)).Flocktype) >= locktype {
  61183 		return SQLITE_OK
  61184 	}
  61185 
  61186 	if int32((*WinFile)(unsafe.Pointer(pFile)).FctrlFlags)&WINFILE_RDONLY != 0 && locktype >= RESERVED_LOCK {
  61187 		return SQLITE_IOERR | int32(15)<<8
  61188 	}
  61189 
  61190 	newLocktype = int32((*WinFile)(unsafe.Pointer(pFile)).Flocktype)
  61191 	if int32((*WinFile)(unsafe.Pointer(pFile)).Flocktype) == NO_LOCK ||
  61192 		locktype == EXCLUSIVE_LOCK && int32((*WinFile)(unsafe.Pointer(pFile)).Flocktype) <= RESERVED_LOCK {
  61193 		var cnt int32 = 3
  61194 		for libc.PostDecInt32(&cnt, 1) > 0 && libc.AssignInt32(&res, winLockFile(tls, pFile+16, uint32(LOCKFILE_FAIL_IMMEDIATELY|LOCKFILE_EXCLUSIVE_LOCK),
  61195 			uint32(Xsqlite3PendingByte), uint32(0), uint32(1), uint32(0))) == 0 {
  61196 			lastErrno = (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls)
  61197 
  61198 			if lastErrno == DWORD(6) {
  61199 				(*WinFile)(unsafe.Pointer(pFile)).FlastErrno = lastErrno
  61200 				rc = SQLITE_IOERR | int32(15)<<8
  61201 
  61202 				return rc
  61203 			}
  61204 			if cnt != 0 {
  61205 				Xsqlite3_win32_sleep(tls, uint32(1))
  61206 			}
  61207 		}
  61208 		gotPendingLock = res
  61209 		if !(res != 0) {
  61210 			lastErrno = (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls)
  61211 		}
  61212 	}
  61213 
  61214 	if locktype == SHARED_LOCK && res != 0 {
  61215 		res = winGetReadLock(tls, pFile)
  61216 		if res != 0 {
  61217 			newLocktype = SHARED_LOCK
  61218 		} else {
  61219 			lastErrno = (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls)
  61220 		}
  61221 	}
  61222 
  61223 	if locktype == RESERVED_LOCK && res != 0 {
  61224 		res = winLockFile(tls, pFile+16, uint32(LOCKFILE_FAIL_IMMEDIATELY|LOCKFILE_EXCLUSIVE_LOCK), uint32(Xsqlite3PendingByte+1), uint32(0), uint32(1), uint32(0))
  61225 		if res != 0 {
  61226 			newLocktype = RESERVED_LOCK
  61227 		} else {
  61228 			lastErrno = (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls)
  61229 		}
  61230 	}
  61231 
  61232 	if locktype == EXCLUSIVE_LOCK && res != 0 {
  61233 		newLocktype = PENDING_LOCK
  61234 		gotPendingLock = 0
  61235 	}
  61236 
  61237 	if locktype == EXCLUSIVE_LOCK && res != 0 {
  61238 		res = winUnlockReadLock(tls, pFile)
  61239 		res = winLockFile(tls, pFile+16, uint32(LOCKFILE_FAIL_IMMEDIATELY|LOCKFILE_EXCLUSIVE_LOCK), uint32(Xsqlite3PendingByte+2), uint32(0),
  61240 			uint32(SHARED_SIZE), uint32(0))
  61241 		if res != 0 {
  61242 			newLocktype = EXCLUSIVE_LOCK
  61243 		} else {
  61244 			lastErrno = (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls)
  61245 			winGetReadLock(tls, pFile)
  61246 		}
  61247 	}
  61248 
  61249 	if gotPendingLock != 0 && locktype == SHARED_LOCK {
  61250 		winUnlockFile(tls, pFile+16, uint32(Xsqlite3PendingByte), uint32(0), uint32(1), uint32(0))
  61251 	}
  61252 
  61253 	if res != 0 {
  61254 		rc = SQLITE_OK
  61255 	} else {
  61256 		(*WinFile)(unsafe.Pointer(pFile)).FlastErrno = lastErrno
  61257 		rc = SQLITE_BUSY
  61258 
  61259 	}
  61260 	(*WinFile)(unsafe.Pointer(pFile)).Flocktype = U8(newLocktype)
  61261 
  61262 	return rc
  61263 }
  61264 
  61265 func winCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 {
  61266 	var res int32
  61267 	var pFile uintptr = id
  61268 
  61269 	if int32((*WinFile)(unsafe.Pointer(pFile)).Flocktype) >= RESERVED_LOCK {
  61270 		res = 1
  61271 
  61272 	} else {
  61273 		res = winLockFile(tls, pFile+16, uint32(LOCKFILE_FAIL_IMMEDIATELY), uint32(Xsqlite3PendingByte+1), uint32(0), uint32(1), uint32(0))
  61274 		if res != 0 {
  61275 			winUnlockFile(tls, pFile+16, uint32(Xsqlite3PendingByte+1), uint32(0), uint32(1), uint32(0))
  61276 		}
  61277 		res = libc.BoolInt32(!(res != 0))
  61278 
  61279 	}
  61280 	*(*int32)(unsafe.Pointer(pResOut)) = res
  61281 
  61282 	return SQLITE_OK
  61283 }
  61284 
  61285 func winUnlock(tls *libc.TLS, id uintptr, locktype int32) int32 {
  61286 	var type1 int32
  61287 	var pFile uintptr = id
  61288 	var rc int32 = SQLITE_OK
  61289 
  61290 	type1 = int32((*WinFile)(unsafe.Pointer(pFile)).Flocktype)
  61291 	if type1 >= EXCLUSIVE_LOCK {
  61292 		winUnlockFile(tls, pFile+16, uint32(Xsqlite3PendingByte+2), uint32(0), uint32(SHARED_SIZE), uint32(0))
  61293 		if locktype == SHARED_LOCK && !(winGetReadLock(tls, pFile) != 0) {
  61294 			rc = winLogErrorAtLine(tls, SQLITE_IOERR|int32(8)<<8, (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls), ts+4720, (*WinFile)(unsafe.Pointer(pFile)).FzPath, 48509)
  61295 		}
  61296 	}
  61297 	if type1 >= RESERVED_LOCK {
  61298 		winUnlockFile(tls, pFile+16, uint32(Xsqlite3PendingByte+1), uint32(0), uint32(1), uint32(0))
  61299 	}
  61300 	if locktype == NO_LOCK && type1 >= SHARED_LOCK {
  61301 		winUnlockReadLock(tls, pFile)
  61302 	}
  61303 	if type1 >= PENDING_LOCK {
  61304 		winUnlockFile(tls, pFile+16, uint32(Xsqlite3PendingByte), uint32(0), uint32(1), uint32(0))
  61305 	}
  61306 	(*WinFile)(unsafe.Pointer(pFile)).Flocktype = U8(locktype)
  61307 
  61308 	return rc
  61309 }
  61310 
  61311 func winNolockLock(tls *libc.TLS, id uintptr, locktype int32) int32 {
  61312 	_ = id
  61313 	_ = locktype
  61314 	return SQLITE_OK
  61315 }
  61316 
  61317 func winNolockCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 {
  61318 	_ = id
  61319 	_ = pResOut
  61320 	return SQLITE_OK
  61321 }
  61322 
  61323 func winNolockUnlock(tls *libc.TLS, id uintptr, locktype int32) int32 {
  61324 	_ = id
  61325 	_ = locktype
  61326 	return SQLITE_OK
  61327 }
  61328 
  61329 func winModeBit(tls *libc.TLS, pFile uintptr, mask uint8, pArg uintptr) {
  61330 	if *(*int32)(unsafe.Pointer(pArg)) < 0 {
  61331 		*(*int32)(unsafe.Pointer(pArg)) = libc.Bool32(int32((*WinFile)(unsafe.Pointer(pFile)).FctrlFlags)&int32(mask) != 0)
  61332 	} else if *(*int32)(unsafe.Pointer(pArg)) == 0 {
  61333 		*(*U8)(unsafe.Pointer(pFile + 28)) &= U8(^int32(mask))
  61334 	} else {
  61335 		*(*U8)(unsafe.Pointer(pFile + 28)) |= U8(int32(mask))
  61336 	}
  61337 }
  61338 
  61339 func winFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 {
  61340 	bp := tls.Alloc(24)
  61341 	defer tls.Free(24)
  61342 
  61343 	var pFile uintptr = id
  61344 
  61345 	switch op {
  61346 	case SQLITE_FCNTL_LOCKSTATE:
  61347 		{
  61348 			*(*int32)(unsafe.Pointer(pArg)) = int32((*WinFile)(unsafe.Pointer(pFile)).Flocktype)
  61349 
  61350 			return SQLITE_OK
  61351 
  61352 		}
  61353 	case SQLITE_FCNTL_LAST_ERRNO:
  61354 		{
  61355 			*(*int32)(unsafe.Pointer(pArg)) = int32((*WinFile)(unsafe.Pointer(pFile)).FlastErrno)
  61356 
  61357 			return SQLITE_OK
  61358 
  61359 		}
  61360 	case SQLITE_FCNTL_CHUNK_SIZE:
  61361 		{
  61362 			(*WinFile)(unsafe.Pointer(pFile)).FszChunk = *(*int32)(unsafe.Pointer(pArg))
  61363 
  61364 			return SQLITE_OK
  61365 
  61366 		}
  61367 	case SQLITE_FCNTL_SIZE_HINT:
  61368 		{
  61369 			if (*WinFile)(unsafe.Pointer(pFile)).FszChunk > 0 {
  61370 				var rc int32 = winFileSize(tls, id, bp+8)
  61371 				if rc == SQLITE_OK {
  61372 					var newSz Sqlite3_int64 = *(*Sqlite3_int64)(unsafe.Pointer(pArg))
  61373 					if newSz > *(*Sqlite3_int64)(unsafe.Pointer(bp + 8)) {
  61374 						rc = winTruncate(tls, id, newSz)
  61375 
  61376 					}
  61377 				}
  61378 
  61379 				return rc
  61380 			}
  61381 
  61382 			return SQLITE_OK
  61383 
  61384 		}
  61385 	case SQLITE_FCNTL_PERSIST_WAL:
  61386 		{
  61387 			winModeBit(tls, pFile, uint8(WINFILE_PERSIST_WAL), pArg)
  61388 
  61389 			return SQLITE_OK
  61390 
  61391 		}
  61392 	case SQLITE_FCNTL_POWERSAFE_OVERWRITE:
  61393 		{
  61394 			winModeBit(tls, pFile, uint8(WINFILE_PSOW), pArg)
  61395 
  61396 			return SQLITE_OK
  61397 
  61398 		}
  61399 	case SQLITE_FCNTL_VFSNAME:
  61400 		{
  61401 			*(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp, (*Sqlite3_vfs)(unsafe.Pointer((*WinFile)(unsafe.Pointer(pFile)).FpVfs)).FzName))
  61402 
  61403 			return SQLITE_OK
  61404 
  61405 		}
  61406 	case SQLITE_FCNTL_WIN32_AV_RETRY:
  61407 		{
  61408 			var a uintptr = pArg
  61409 			if *(*int32)(unsafe.Pointer(a)) > 0 {
  61410 				winIoerrRetry = *(*int32)(unsafe.Pointer(a))
  61411 			} else {
  61412 				*(*int32)(unsafe.Pointer(a)) = winIoerrRetry
  61413 			}
  61414 			if *(*int32)(unsafe.Pointer(a + 1*4)) > 0 {
  61415 				winIoerrRetryDelay = *(*int32)(unsafe.Pointer(a + 1*4))
  61416 			} else {
  61417 				*(*int32)(unsafe.Pointer(a + 1*4)) = winIoerrRetryDelay
  61418 			}
  61419 
  61420 			return SQLITE_OK
  61421 
  61422 		}
  61423 	case SQLITE_FCNTL_WIN32_GET_HANDLE:
  61424 		{
  61425 			var phFile LPHANDLE = pArg
  61426 			*(*HANDLE)(unsafe.Pointer(phFile)) = (*WinFile)(unsafe.Pointer(pFile)).Fh
  61427 
  61428 			return SQLITE_OK
  61429 
  61430 		}
  61431 	case SQLITE_FCNTL_TEMPFILENAME:
  61432 		{
  61433 			*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
  61434 			var rc int32 = winGetTempname(tls, (*WinFile)(unsafe.Pointer(pFile)).FpVfs, bp+16)
  61435 			if rc == SQLITE_OK {
  61436 				*(*uintptr)(unsafe.Pointer(pArg)) = *(*uintptr)(unsafe.Pointer(bp + 16))
  61437 			}
  61438 
  61439 			return rc
  61440 
  61441 		}
  61442 	case SQLITE_FCNTL_MMAP_SIZE:
  61443 		{
  61444 			var newLimit I64 = *(*I64)(unsafe.Pointer(pArg))
  61445 			var rc int32 = SQLITE_OK
  61446 			if newLimit > Xsqlite3Config.FmxMmap {
  61447 				newLimit = Xsqlite3Config.FmxMmap
  61448 			}
  61449 
  61450 			if newLimit > int64(0) && uint64(unsafe.Sizeof(SIZE_T(0))) < uint64(8) {
  61451 				newLimit = newLimit & int64(0x7FFFFFFF)
  61452 			}
  61453 
  61454 			*(*I64)(unsafe.Pointer(pArg)) = (*WinFile)(unsafe.Pointer(pFile)).FmmapSizeMax
  61455 			if newLimit >= int64(0) && newLimit != (*WinFile)(unsafe.Pointer(pFile)).FmmapSizeMax && (*WinFile)(unsafe.Pointer(pFile)).FnFetchOut == 0 {
  61456 				(*WinFile)(unsafe.Pointer(pFile)).FmmapSizeMax = newLimit
  61457 				if (*WinFile)(unsafe.Pointer(pFile)).FmmapSize > int64(0) {
  61458 					winUnmapfile(tls, pFile)
  61459 					rc = winMapfile(tls, pFile, int64(-1))
  61460 				}
  61461 			}
  61462 
  61463 			return rc
  61464 
  61465 		}
  61466 	}
  61467 
  61468 	return SQLITE_NOTFOUND
  61469 }
  61470 
  61471 func winSectorSize(tls *libc.TLS, id uintptr) int32 {
  61472 	_ = id
  61473 	return SQLITE_DEFAULT_SECTOR_SIZE
  61474 }
  61475 
  61476 func winDeviceCharacteristics(tls *libc.TLS, id uintptr) int32 {
  61477 	var p uintptr = id
  61478 	return SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN | func() int32 {
  61479 		if int32((*WinFile)(unsafe.Pointer(p)).FctrlFlags)&WINFILE_PSOW != 0 {
  61480 			return SQLITE_IOCAP_POWERSAFE_OVERWRITE
  61481 		}
  61482 		return 0
  61483 	}()
  61484 }
  61485 
  61486 var winSysInfo SYSTEM_INFO
  61487 
  61488 var winBigLock uintptr = uintptr(0)
  61489 
  61490 func winShmEnterMutex(tls *libc.TLS) {
  61491 	Xsqlite3_mutex_enter(tls, winBigLock)
  61492 }
  61493 
  61494 func winShmLeaveMutex(tls *libc.TLS) {
  61495 	Xsqlite3_mutex_leave(tls, winBigLock)
  61496 }
  61497 
  61498 // Object used to represent a single file opened and mmapped to provide
  61499 // shared memory.  When multiple threads all reference the same
  61500 // log-summary, each thread has its own winFile object, but they all
  61501 // point to a single instance of this object.  In other words, each
  61502 // log-summary is opened only once per process.
  61503 //
  61504 // winShmMutexHeld() must be true when creating or destroying
  61505 // this object or while reading or writing the following fields:
  61506 //
  61507 //	nRef
  61508 //	pNext
  61509 //
  61510 // The following fields are read-only after the object is created:
  61511 //
  61512 //	fid
  61513 //	zFilename
  61514 //
  61515 // Either winShmNode.mutex must be held or winShmNode.nRef==0 and
  61516 // winShmMutexHeld() is true when reading or writing any other field
  61517 // in this structure.
  61518 type ShmRegion = struct {
  61519 	FhMap HANDLE
  61520 	FpMap uintptr
  61521 }
  61522 
  61523 var winShmNodeList uintptr = uintptr(0)
  61524 
  61525 func winShmSystemLock(tls *libc.TLS, pFile uintptr, lockType int32, ofst int32, nByte int32) int32 {
  61526 	var rc int32 = 0
  61527 
  61528 	if lockType == WINSHM_UNLCK {
  61529 		rc = winUnlockFile(tls, pFile+16+16, uint32(ofst), uint32(0), uint32(nByte), uint32(0))
  61530 	} else {
  61531 		var dwFlags DWORD = DWORD(LOCKFILE_FAIL_IMMEDIATELY)
  61532 		if lockType == WINSHM_WRLCK {
  61533 			dwFlags = dwFlags | DWORD(LOCKFILE_EXCLUSIVE_LOCK)
  61534 		}
  61535 		rc = winLockFile(tls, pFile+16+16, dwFlags, uint32(ofst), uint32(0), uint32(nByte), uint32(0))
  61536 	}
  61537 
  61538 	if rc != 0 {
  61539 		rc = SQLITE_OK
  61540 	} else {
  61541 		(*WinShmNode)(unsafe.Pointer(pFile)).FlastErrno = (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls)
  61542 		rc = SQLITE_BUSY
  61543 	}
  61544 
  61545 	return rc
  61546 }
  61547 
  61548 func winShmPurge(tls *libc.TLS, pVfs uintptr, deleteFlag int32) {
  61549 	var pp uintptr
  61550 	var p uintptr
  61551 
  61552 	pp = uintptr(unsafe.Pointer(&winShmNodeList))
  61553 	for libc.AssignUintptr(&p, *(*uintptr)(unsafe.Pointer(pp))) != uintptr(0) {
  61554 		if (*WinShmNode)(unsafe.Pointer(p)).FnRef == 0 {
  61555 			var i int32
  61556 			if (*WinShmNode)(unsafe.Pointer(p)).Fmutex != 0 {
  61557 				Xsqlite3_mutex_free(tls, (*WinShmNode)(unsafe.Pointer(p)).Fmutex)
  61558 			}
  61559 			for i = 0; i < (*WinShmNode)(unsafe.Pointer(p)).FnRegion; i++ {
  61560 				var bRc WINBOOL = (*(*func(*libc.TLS, LPCVOID) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 59*24 + 8)))(tls, (*ShmRegion)(unsafe.Pointer((*WinShmNode)(unsafe.Pointer(p)).FaRegion+uintptr(i)*16)).FpMap)
  61561 				_ = bRc
  61562 
  61563 				_ = bRc
  61564 				bRc = (*(*func(*libc.TLS, HANDLE) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 3*24 + 8)))(tls, (*ShmRegion)(unsafe.Pointer((*WinShmNode)(unsafe.Pointer(p)).FaRegion+uintptr(i)*16)).FhMap)
  61565 
  61566 				_ = bRc
  61567 			}
  61568 			if (*WinShmNode)(unsafe.Pointer(p)).FhFile.Fh != uintptr(0) && (*WinShmNode)(unsafe.Pointer(p)).FhFile.Fh != libc.UintptrFromInt64(int64(-1)) {
  61569 				winClose(tls, p+16)
  61570 
  61571 			}
  61572 			if deleteFlag != 0 {
  61573 				Xsqlite3BeginBenignMalloc(tls)
  61574 				winDelete(tls, pVfs, (*WinShmNode)(unsafe.Pointer(p)).FzFilename, 0)
  61575 				Xsqlite3EndBenignMalloc(tls)
  61576 
  61577 			}
  61578 			*(*uintptr)(unsafe.Pointer(pp)) = (*WinShmNode)(unsafe.Pointer(p)).FpNext
  61579 			Xsqlite3_free(tls, (*WinShmNode)(unsafe.Pointer(p)).FaRegion)
  61580 			Xsqlite3_free(tls, p)
  61581 		} else {
  61582 			pp = p + 152
  61583 		}
  61584 	}
  61585 }
  61586 
  61587 func winLockSharedMemory(tls *libc.TLS, pShmNode uintptr) int32 {
  61588 	var rc int32 = winShmSystemLock(tls, pShmNode, WINSHM_WRLCK, (22+SQLITE_SHM_NLOCK)*4+SQLITE_SHM_NLOCK, 1)
  61589 
  61590 	if rc == SQLITE_OK {
  61591 		if (*WinShmNode)(unsafe.Pointer(pShmNode)).FisReadonly != 0 {
  61592 			(*WinShmNode)(unsafe.Pointer(pShmNode)).FisUnlocked = U8(1)
  61593 			winShmSystemLock(tls, pShmNode, WINSHM_UNLCK, (22+SQLITE_SHM_NLOCK)*4+SQLITE_SHM_NLOCK, 1)
  61594 			return SQLITE_READONLY | int32(5)<<8
  61595 		} else if winTruncate(tls, pShmNode+16, int64(0)) != 0 {
  61596 			winShmSystemLock(tls, pShmNode, WINSHM_UNLCK, (22+SQLITE_SHM_NLOCK)*4+SQLITE_SHM_NLOCK, 1)
  61597 			return winLogErrorAtLine(tls, SQLITE_IOERR|int32(18)<<8, (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls), ts+4730, (*WinShmNode)(unsafe.Pointer(pShmNode)).FzFilename, 48975)
  61598 		}
  61599 	}
  61600 
  61601 	if rc == SQLITE_OK {
  61602 		winShmSystemLock(tls, pShmNode, WINSHM_UNLCK, (22+SQLITE_SHM_NLOCK)*4+SQLITE_SHM_NLOCK, 1)
  61603 	}
  61604 
  61605 	return winShmSystemLock(tls, pShmNode, WINSHM_RDLCK, (22+SQLITE_SHM_NLOCK)*4+SQLITE_SHM_NLOCK, 1)
  61606 }
  61607 
  61608 func winOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) int32 {
  61609 	bp := tls.Alloc(12)
  61610 	defer tls.Free(12)
  61611 
  61612 	var p uintptr
  61613 	var pShmNode uintptr
  61614 	var rc int32
  61615 	var pNew uintptr
  61616 	var nName int32
  61617 	var inFlags int32
  61618 
  61619 	pShmNode = uintptr(0)
  61620 	rc = SQLITE_OK
  61621 
  61622 	p = Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(winShm{})))
  61623 	if !(p == uintptr(0)) {
  61624 		goto __1
  61625 	}
  61626 	return SQLITE_IOERR | int32(12)<<8
  61627 __1:
  61628 	;
  61629 	nName = Xsqlite3Strlen30(tls, (*WinFile)(unsafe.Pointer(pDbFd)).FzPath)
  61630 	pNew = Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(WinShmNode{}))+uint64(nName)+uint64(17))
  61631 	if !(pNew == uintptr(0)) {
  61632 		goto __2
  61633 	}
  61634 	Xsqlite3_free(tls, p)
  61635 	return SQLITE_IOERR | int32(12)<<8
  61636 __2:
  61637 	;
  61638 	(*WinShmNode)(unsafe.Pointer(pNew)).FzFilename = pNew + 1*160
  61639 	Xsqlite3_snprintf(tls, nName+15, (*WinShmNode)(unsafe.Pointer(pNew)).FzFilename, ts+4750, libc.VaList(bp, (*WinFile)(unsafe.Pointer(pDbFd)).FzPath))
  61640 
  61641 	winShmEnterMutex(tls)
  61642 	pShmNode = winShmNodeList
  61643 __3:
  61644 	if !(pShmNode != 0) {
  61645 		goto __5
  61646 	}
  61647 
  61648 	if !(Xsqlite3StrICmp(tls, (*WinShmNode)(unsafe.Pointer(pShmNode)).FzFilename, (*WinShmNode)(unsafe.Pointer(pNew)).FzFilename) == 0) {
  61649 		goto __6
  61650 	}
  61651 	goto __5
  61652 __6:
  61653 	;
  61654 	goto __4
  61655 __4:
  61656 	pShmNode = (*WinShmNode)(unsafe.Pointer(pShmNode)).FpNext
  61657 	goto __3
  61658 	goto __5
  61659 __5:
  61660 	;
  61661 	if !(pShmNode != 0) {
  61662 		goto __7
  61663 	}
  61664 	Xsqlite3_free(tls, pNew)
  61665 	goto __8
  61666 __7:
  61667 	inFlags = SQLITE_OPEN_WAL
  61668 	*(*int32)(unsafe.Pointer(bp + 8)) = 0
  61669 
  61670 	pShmNode = pNew
  61671 	pNew = uintptr(0)
  61672 	(*WinFile)(unsafe.Pointer(pShmNode + 16)).Fh = libc.UintptrFromInt64(int64(-1))
  61673 	(*WinShmNode)(unsafe.Pointer(pShmNode)).FpNext = winShmNodeList
  61674 	winShmNodeList = pShmNode
  61675 
  61676 	if !(Xsqlite3Config.FbCoreMutex != 0) {
  61677 		goto __9
  61678 	}
  61679 	(*WinShmNode)(unsafe.Pointer(pShmNode)).Fmutex = Xsqlite3_mutex_alloc(tls, SQLITE_MUTEX_FAST)
  61680 	if !((*WinShmNode)(unsafe.Pointer(pShmNode)).Fmutex == uintptr(0)) {
  61681 		goto __10
  61682 	}
  61683 	rc = SQLITE_IOERR | int32(12)<<8
  61684 	goto shm_open_err
  61685 __10:
  61686 	;
  61687 __9:
  61688 	;
  61689 	if !(0 == Xsqlite3_uri_boolean(tls, (*WinFile)(unsafe.Pointer(pDbFd)).FzPath, ts+4757, 0)) {
  61690 		goto __11
  61691 	}
  61692 	inFlags = inFlags | (SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)
  61693 	goto __12
  61694 __11:
  61695 	inFlags = inFlags | SQLITE_OPEN_READONLY
  61696 __12:
  61697 	;
  61698 	rc = winOpen(tls, (*WinFile)(unsafe.Pointer(pDbFd)).FpVfs, (*WinShmNode)(unsafe.Pointer(pShmNode)).FzFilename,
  61699 		pShmNode+16,
  61700 		inFlags, bp+8)
  61701 	if !(rc != SQLITE_OK) {
  61702 		goto __13
  61703 	}
  61704 	rc = winLogErrorAtLine(tls, rc, (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls), ts+4770, (*WinShmNode)(unsafe.Pointer(pShmNode)).FzFilename, 49057)
  61705 	goto shm_open_err
  61706 __13:
  61707 	;
  61708 	if !(*(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OPEN_READONLY) {
  61709 		goto __14
  61710 	}
  61711 	(*WinShmNode)(unsafe.Pointer(pShmNode)).FisReadonly = U8(1)
  61712 __14:
  61713 	;
  61714 	rc = winLockSharedMemory(tls, pShmNode)
  61715 	if !(rc != SQLITE_OK && rc != SQLITE_READONLY|int32(5)<<8) {
  61716 		goto __15
  61717 	}
  61718 	goto shm_open_err
  61719 __15:
  61720 	;
  61721 __8:
  61722 	;
  61723 	(*winShm)(unsafe.Pointer(p)).FpShmNode = pShmNode
  61724 	(*WinShmNode)(unsafe.Pointer(pShmNode)).FnRef++
  61725 	(*WinFile)(unsafe.Pointer(pDbFd)).FpShm = p
  61726 	winShmLeaveMutex(tls)
  61727 
  61728 	Xsqlite3_mutex_enter(tls, (*WinShmNode)(unsafe.Pointer(pShmNode)).Fmutex)
  61729 	(*winShm)(unsafe.Pointer(p)).FpNext = (*WinShmNode)(unsafe.Pointer(pShmNode)).FpFirst
  61730 	(*WinShmNode)(unsafe.Pointer(pShmNode)).FpFirst = p
  61731 	Xsqlite3_mutex_leave(tls, (*WinShmNode)(unsafe.Pointer(pShmNode)).Fmutex)
  61732 	return rc
  61733 
  61734 shm_open_err:
  61735 	winShmSystemLock(tls, pShmNode, WINSHM_UNLCK, (22+SQLITE_SHM_NLOCK)*4+SQLITE_SHM_NLOCK, 1)
  61736 	winShmPurge(tls, (*WinFile)(unsafe.Pointer(pDbFd)).FpVfs, 0)
  61737 	Xsqlite3_free(tls, p)
  61738 	Xsqlite3_free(tls, pNew)
  61739 	winShmLeaveMutex(tls)
  61740 	return rc
  61741 }
  61742 
  61743 func winShmUnmap(tls *libc.TLS, fd uintptr, deleteFlag int32) int32 {
  61744 	var pDbFd uintptr
  61745 	var p uintptr
  61746 	var pShmNode uintptr
  61747 	var pp uintptr
  61748 
  61749 	pDbFd = fd
  61750 	p = (*WinFile)(unsafe.Pointer(pDbFd)).FpShm
  61751 	if p == uintptr(0) {
  61752 		return SQLITE_OK
  61753 	}
  61754 	pShmNode = (*WinShm)(unsafe.Pointer(p)).FpShmNode
  61755 
  61756 	Xsqlite3_mutex_enter(tls, (*WinShmNode)(unsafe.Pointer(pShmNode)).Fmutex)
  61757 	for pp = pShmNode + 144; *(*uintptr)(unsafe.Pointer(pp)) != p; pp = *(*uintptr)(unsafe.Pointer(pp)) + 8 {
  61758 	}
  61759 	*(*uintptr)(unsafe.Pointer(pp)) = (*WinShm)(unsafe.Pointer(p)).FpNext
  61760 
  61761 	Xsqlite3_free(tls, p)
  61762 	(*WinFile)(unsafe.Pointer(pDbFd)).FpShm = uintptr(0)
  61763 	Xsqlite3_mutex_leave(tls, (*WinShmNode)(unsafe.Pointer(pShmNode)).Fmutex)
  61764 
  61765 	winShmEnterMutex(tls)
  61766 
  61767 	(*WinShmNode)(unsafe.Pointer(pShmNode)).FnRef--
  61768 	if (*WinShmNode)(unsafe.Pointer(pShmNode)).FnRef == 0 {
  61769 		winShmPurge(tls, (*WinFile)(unsafe.Pointer(pDbFd)).FpVfs, deleteFlag)
  61770 	}
  61771 	winShmLeaveMutex(tls)
  61772 
  61773 	return SQLITE_OK
  61774 }
  61775 
  61776 func winShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) int32 {
  61777 	var pDbFd uintptr = fd
  61778 	var p uintptr = (*WinFile)(unsafe.Pointer(pDbFd)).FpShm
  61779 	var pX uintptr
  61780 	var pShmNode uintptr
  61781 	var rc int32 = SQLITE_OK
  61782 	var mask U16
  61783 
  61784 	if p == uintptr(0) {
  61785 		return SQLITE_IOERR | int32(20)<<8
  61786 	}
  61787 	pShmNode = (*WinShm)(unsafe.Pointer(p)).FpShmNode
  61788 	if pShmNode == uintptr(0) {
  61789 		return SQLITE_IOERR | int32(20)<<8
  61790 	}
  61791 
  61792 	mask = U16(uint32(1)<<(ofst+n) - uint32(1)<<ofst)
  61793 
  61794 	Xsqlite3_mutex_enter(tls, (*WinShmNode)(unsafe.Pointer(pShmNode)).Fmutex)
  61795 	if flags&SQLITE_SHM_UNLOCK != 0 {
  61796 		var allMask U16 = U16(0)
  61797 
  61798 		for pX = (*WinShmNode)(unsafe.Pointer(pShmNode)).FpFirst; pX != 0; pX = (*WinShm)(unsafe.Pointer(pX)).FpNext {
  61799 			if pX == p {
  61800 				continue
  61801 			}
  61802 
  61803 			allMask = U16(int32(allMask) | int32((*WinShm)(unsafe.Pointer(pX)).FsharedMask))
  61804 		}
  61805 
  61806 		if int32(mask)&int32(allMask) == 0 {
  61807 			rc = winShmSystemLock(tls, pShmNode, WINSHM_UNLCK, ofst+(22+SQLITE_SHM_NLOCK)*4, n)
  61808 		} else {
  61809 			rc = SQLITE_OK
  61810 		}
  61811 
  61812 		if rc == SQLITE_OK {
  61813 			*(*U16)(unsafe.Pointer(p + 20)) &= U16(^int32(mask))
  61814 			*(*U16)(unsafe.Pointer(p + 18)) &= U16(^int32(mask))
  61815 		}
  61816 	} else if flags&SQLITE_SHM_SHARED != 0 {
  61817 		var allShared U16 = U16(0)
  61818 
  61819 		for pX = (*WinShmNode)(unsafe.Pointer(pShmNode)).FpFirst; pX != 0; pX = (*WinShm)(unsafe.Pointer(pX)).FpNext {
  61820 			if int32((*WinShm)(unsafe.Pointer(pX)).FexclMask)&int32(mask) != 0 {
  61821 				rc = SQLITE_BUSY
  61822 				break
  61823 			}
  61824 			allShared = U16(int32(allShared) | int32((*WinShm)(unsafe.Pointer(pX)).FsharedMask))
  61825 		}
  61826 
  61827 		if rc == SQLITE_OK {
  61828 			if int32(allShared)&int32(mask) == 0 {
  61829 				rc = winShmSystemLock(tls, pShmNode, WINSHM_RDLCK, ofst+(22+SQLITE_SHM_NLOCK)*4, n)
  61830 			} else {
  61831 				rc = SQLITE_OK
  61832 			}
  61833 		}
  61834 
  61835 		if rc == SQLITE_OK {
  61836 			*(*U16)(unsafe.Pointer(p + 18)) |= U16(int32(mask))
  61837 		}
  61838 	} else {
  61839 		for pX = (*WinShmNode)(unsafe.Pointer(pShmNode)).FpFirst; pX != 0; pX = (*WinShm)(unsafe.Pointer(pX)).FpNext {
  61840 			if int32((*WinShm)(unsafe.Pointer(pX)).FexclMask)&int32(mask) != 0 || int32((*WinShm)(unsafe.Pointer(pX)).FsharedMask)&int32(mask) != 0 {
  61841 				rc = SQLITE_BUSY
  61842 				break
  61843 			}
  61844 		}
  61845 
  61846 		if rc == SQLITE_OK {
  61847 			rc = winShmSystemLock(tls, pShmNode, WINSHM_WRLCK, ofst+(22+SQLITE_SHM_NLOCK)*4, n)
  61848 			if rc == SQLITE_OK {
  61849 				*(*U16)(unsafe.Pointer(p + 20)) |= U16(int32(mask))
  61850 			}
  61851 		}
  61852 	}
  61853 	Xsqlite3_mutex_leave(tls, (*WinShmNode)(unsafe.Pointer(pShmNode)).Fmutex)
  61854 
  61855 	return rc
  61856 }
  61857 
  61858 func winShmBarrier(tls *libc.TLS, fd uintptr) {
  61859 	_ = fd
  61860 
  61861 	winShmEnterMutex(tls)
  61862 	winShmLeaveMutex(tls)
  61863 }
  61864 
  61865 func winShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, isWrite int32, pp uintptr) int32 {
  61866 	bp := tls.Alloc(8)
  61867 	defer tls.Free(8)
  61868 
  61869 	var pDbFd uintptr
  61870 	var pShm uintptr
  61871 	var pShmNode uintptr
  61872 	var protect DWORD
  61873 	var flags DWORD
  61874 	var rc int32
  61875 	var iOffset int32
  61876 	var iOffsetShift int32
  61877 	var hMap HANDLE
  61878 	var pMap uintptr
  61879 	var apNew uintptr
  61880 	var nByte int32
  61881 
  61882 	var iOffset1 int32
  61883 	var iOffsetShift1 int32
  61884 	var p uintptr
  61885 	pDbFd = fd
  61886 	pShm = (*WinFile)(unsafe.Pointer(pDbFd)).FpShm
  61887 	protect = DWORD(PAGE_READWRITE)
  61888 	flags = DWORD(SECTION_MAP_WRITE | SECTION_MAP_READ)
  61889 	rc = SQLITE_OK
  61890 
  61891 	if !!(pShm != 0) {
  61892 		goto __1
  61893 	}
  61894 	rc = winOpenSharedMemory(tls, pDbFd)
  61895 	if !(rc != SQLITE_OK) {
  61896 		goto __2
  61897 	}
  61898 	return rc
  61899 __2:
  61900 	;
  61901 	pShm = (*WinFile)(unsafe.Pointer(pDbFd)).FpShm
  61902 
  61903 __1:
  61904 	;
  61905 	pShmNode = (*WinShm)(unsafe.Pointer(pShm)).FpShmNode
  61906 
  61907 	Xsqlite3_mutex_enter(tls, (*WinShmNode)(unsafe.Pointer(pShmNode)).Fmutex)
  61908 	if !((*WinShmNode)(unsafe.Pointer(pShmNode)).FisUnlocked != 0) {
  61909 		goto __3
  61910 	}
  61911 	rc = winLockSharedMemory(tls, pShmNode)
  61912 	if !(rc != SQLITE_OK) {
  61913 		goto __4
  61914 	}
  61915 	goto shmpage_out
  61916 __4:
  61917 	;
  61918 	(*WinShmNode)(unsafe.Pointer(pShmNode)).FisUnlocked = U8(0)
  61919 __3:
  61920 	;
  61921 	if !((*WinShmNode)(unsafe.Pointer(pShmNode)).FnRegion <= iRegion) {
  61922 		goto __5
  61923 	}
  61924 	nByte = (iRegion + 1) * szRegion
  61925 
  61926 	(*WinShmNode)(unsafe.Pointer(pShmNode)).FszRegion = szRegion
  61927 
  61928 	rc = winFileSize(tls, pShmNode+16, bp)
  61929 	if !(rc != SQLITE_OK) {
  61930 		goto __6
  61931 	}
  61932 	rc = winLogErrorAtLine(tls, SQLITE_IOERR|int32(19)<<8, (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls), ts+4781, (*WinFile)(unsafe.Pointer(pDbFd)).FzPath, 49328)
  61933 	goto shmpage_out
  61934 __6:
  61935 	;
  61936 	if !(*(*Sqlite3_int64)(unsafe.Pointer(bp)) < Sqlite3_int64(nByte)) {
  61937 		goto __7
  61938 	}
  61939 
  61940 	if !!(isWrite != 0) {
  61941 		goto __8
  61942 	}
  61943 	goto shmpage_out
  61944 __8:
  61945 	;
  61946 	rc = winTruncate(tls, pShmNode+16, int64(nByte))
  61947 	if !(rc != SQLITE_OK) {
  61948 		goto __9
  61949 	}
  61950 	rc = winLogErrorAtLine(tls, SQLITE_IOERR|int32(19)<<8, (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls), ts+4792, (*WinFile)(unsafe.Pointer(pDbFd)).FzPath, 49343)
  61951 	goto shmpage_out
  61952 __9:
  61953 	;
  61954 __7:
  61955 	;
  61956 	apNew = Xsqlite3_realloc64(tls,
  61957 		(*WinShmNode)(unsafe.Pointer(pShmNode)).FaRegion, uint64(iRegion+1)*uint64(unsafe.Sizeof(ShmRegion{})))
  61958 	if !!(apNew != 0) {
  61959 		goto __10
  61960 	}
  61961 	rc = SQLITE_IOERR | int32(12)<<8
  61962 	goto shmpage_out
  61963 __10:
  61964 	;
  61965 	(*WinShmNode)(unsafe.Pointer(pShmNode)).FaRegion = apNew
  61966 
  61967 	if !((*WinShmNode)(unsafe.Pointer(pShmNode)).FisReadonly != 0) {
  61968 		goto __11
  61969 	}
  61970 	protect = DWORD(PAGE_READONLY)
  61971 	flags = DWORD(SECTION_MAP_READ)
  61972 __11:
  61973 	;
  61974 __12:
  61975 	if !((*WinShmNode)(unsafe.Pointer(pShmNode)).FnRegion <= iRegion) {
  61976 		goto __13
  61977 	}
  61978 	hMap = uintptr(0)
  61979 	pMap = uintptr(0)
  61980 
  61981 	hMap = (*(*func(*libc.TLS, HANDLE, LPSECURITY_ATTRIBUTES, DWORD, DWORD, DWORD, LPCWSTR) HANDLE)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 7*24 + 8)))(tls, (*WinShmNode)(unsafe.Pointer(pShmNode)).FhFile.Fh,
  61982 		uintptr(0), protect, uint32(0), uint32(nByte), uintptr(0))
  61983 
  61984 	if !(hMap != 0) {
  61985 		goto __14
  61986 	}
  61987 	iOffset = (*WinShmNode)(unsafe.Pointer(pShmNode)).FnRegion * szRegion
  61988 	iOffsetShift = int32(DWORD(iOffset) % winSysInfo.FdwAllocationGranularity)
  61989 	pMap = (*(*func(*libc.TLS, HANDLE, DWORD, DWORD, DWORD, SIZE_T) LPVOID)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 49*24 + 8)))(tls, hMap, flags,
  61990 		uint32(0), uint32(iOffset-iOffsetShift), uint64(szRegion+iOffsetShift))
  61991 
  61992 __14:
  61993 	;
  61994 	if !!(pMap != 0) {
  61995 		goto __15
  61996 	}
  61997 	(*WinShmNode)(unsafe.Pointer(pShmNode)).FlastErrno = (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls)
  61998 	rc = winLogErrorAtLine(tls, SQLITE_IOERR|int32(21)<<8, (*WinShmNode)(unsafe.Pointer(pShmNode)).FlastErrno, ts+4803, (*WinFile)(unsafe.Pointer(pDbFd)).FzPath, 49402)
  61999 	if !(hMap != 0) {
  62000 		goto __16
  62001 	}
  62002 	(*(*func(*libc.TLS, HANDLE) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 3*24 + 8)))(tls, hMap)
  62003 __16:
  62004 	;
  62005 	goto shmpage_out
  62006 __15:
  62007 	;
  62008 	(*ShmRegion)(unsafe.Pointer((*WinShmNode)(unsafe.Pointer(pShmNode)).FaRegion + uintptr((*WinShmNode)(unsafe.Pointer(pShmNode)).FnRegion)*16)).FpMap = pMap
  62009 	(*ShmRegion)(unsafe.Pointer((*WinShmNode)(unsafe.Pointer(pShmNode)).FaRegion + uintptr((*WinShmNode)(unsafe.Pointer(pShmNode)).FnRegion)*16)).FhMap = hMap
  62010 	(*WinShmNode)(unsafe.Pointer(pShmNode)).FnRegion++
  62011 	goto __12
  62012 __13:
  62013 	;
  62014 __5:
  62015 	;
  62016 shmpage_out:
  62017 	if !((*WinShmNode)(unsafe.Pointer(pShmNode)).FnRegion > iRegion) {
  62018 		goto __17
  62019 	}
  62020 	iOffset1 = iRegion * szRegion
  62021 	iOffsetShift1 = int32(DWORD(iOffset1) % winSysInfo.FdwAllocationGranularity)
  62022 	p = (*ShmRegion)(unsafe.Pointer((*WinShmNode)(unsafe.Pointer(pShmNode)).FaRegion + uintptr(iRegion)*16)).FpMap
  62023 	*(*uintptr)(unsafe.Pointer(pp)) = p + uintptr(iOffsetShift1)
  62024 	goto __18
  62025 __17:
  62026 	*(*uintptr)(unsafe.Pointer(pp)) = uintptr(0)
  62027 __18:
  62028 	;
  62029 	if !((*WinShmNode)(unsafe.Pointer(pShmNode)).FisReadonly != 0 && rc == SQLITE_OK) {
  62030 		goto __19
  62031 	}
  62032 	rc = SQLITE_READONLY
  62033 __19:
  62034 	;
  62035 	Xsqlite3_mutex_leave(tls, (*WinShmNode)(unsafe.Pointer(pShmNode)).Fmutex)
  62036 	return rc
  62037 }
  62038 
  62039 func winUnmapfile(tls *libc.TLS, pFile uintptr) int32 {
  62040 	if (*WinFile)(unsafe.Pointer(pFile)).FpMapRegion != 0 {
  62041 		if !((*(*func(*libc.TLS, LPCVOID) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 59*24 + 8)))(tls, (*WinFile)(unsafe.Pointer(pFile)).FpMapRegion) != 0) {
  62042 			(*WinFile)(unsafe.Pointer(pFile)).FlastErrno = (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls)
  62043 
  62044 			return winLogErrorAtLine(tls, SQLITE_IOERR|int32(24)<<8, (*WinFile)(unsafe.Pointer(pFile)).FlastErrno, ts+4814, (*WinFile)(unsafe.Pointer(pFile)).FzPath, 49451)
  62045 		}
  62046 		(*WinFile)(unsafe.Pointer(pFile)).FpMapRegion = uintptr(0)
  62047 		(*WinFile)(unsafe.Pointer(pFile)).FmmapSize = int64(0)
  62048 	}
  62049 	if (*WinFile)(unsafe.Pointer(pFile)).FhMap != uintptr(0) {
  62050 		if !((*(*func(*libc.TLS, HANDLE) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 3*24 + 8)))(tls, (*WinFile)(unsafe.Pointer(pFile)).FhMap) != 0) {
  62051 			(*WinFile)(unsafe.Pointer(pFile)).FlastErrno = (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls)
  62052 
  62053 			return winLogErrorAtLine(tls, SQLITE_IOERR|int32(24)<<8, (*WinFile)(unsafe.Pointer(pFile)).FlastErrno, ts+4828, (*WinFile)(unsafe.Pointer(pFile)).FzPath, 49462)
  62054 		}
  62055 		(*WinFile)(unsafe.Pointer(pFile)).FhMap = uintptr(0)
  62056 	}
  62057 
  62058 	return SQLITE_OK
  62059 }
  62060 
  62061 func winMapfile(tls *libc.TLS, pFd uintptr, nByte Sqlite3_int64) int32 {
  62062 	bp := tls.Alloc(8)
  62063 	defer tls.Free(8)
  62064 
  62065 	*(*Sqlite3_int64)(unsafe.Pointer(bp)) = nByte
  62066 	var rc int32
  62067 
  62068 	if (*WinFile)(unsafe.Pointer(pFd)).FnFetchOut > 0 {
  62069 		return SQLITE_OK
  62070 	}
  62071 
  62072 	if *(*Sqlite3_int64)(unsafe.Pointer(bp)) < int64(0) {
  62073 		rc = winFileSize(tls, pFd, bp)
  62074 		if rc != 0 {
  62075 			return SQLITE_IOERR | int32(7)<<8
  62076 		}
  62077 	}
  62078 	if *(*Sqlite3_int64)(unsafe.Pointer(bp)) > (*WinFile)(unsafe.Pointer(pFd)).FmmapSizeMax {
  62079 		*(*Sqlite3_int64)(unsafe.Pointer(bp)) = (*WinFile)(unsafe.Pointer(pFd)).FmmapSizeMax
  62080 	}
  62081 	*(*Sqlite3_int64)(unsafe.Pointer(bp)) &= ^Sqlite3_int64(winSysInfo.FdwPageSize - DWORD(1))
  62082 
  62083 	if *(*Sqlite3_int64)(unsafe.Pointer(bp)) == int64(0) && (*WinFile)(unsafe.Pointer(pFd)).FmmapSize > int64(0) {
  62084 		winUnmapfile(tls, pFd)
  62085 	}
  62086 	if *(*Sqlite3_int64)(unsafe.Pointer(bp)) != (*WinFile)(unsafe.Pointer(pFd)).FmmapSize {
  62087 		var pNew uintptr = uintptr(0)
  62088 		var protect DWORD = DWORD(PAGE_READONLY)
  62089 		var flags DWORD = DWORD(SECTION_MAP_READ)
  62090 
  62091 		winUnmapfile(tls, pFd)
  62092 		(*WinFile)(unsafe.Pointer(pFd)).FhMap = (*(*func(*libc.TLS, HANDLE, LPSECURITY_ATTRIBUTES, DWORD, DWORD, DWORD, LPCWSTR) HANDLE)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 7*24 + 8)))(tls, (*WinFile)(unsafe.Pointer(pFd)).Fh, uintptr(0), protect,
  62093 			DWORD(*(*Sqlite3_int64)(unsafe.Pointer(bp))>>32&int64(0xffffffff)),
  62094 			DWORD(*(*Sqlite3_int64)(unsafe.Pointer(bp))&int64(0xffffffff)), uintptr(0))
  62095 		if (*WinFile)(unsafe.Pointer(pFd)).FhMap == uintptr(0) {
  62096 			(*WinFile)(unsafe.Pointer(pFd)).FlastErrno = (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls)
  62097 			rc = winLogErrorAtLine(tls, SQLITE_IOERR|int32(24)<<8, (*WinFile)(unsafe.Pointer(pFd)).FlastErrno, ts+4842, (*WinFile)(unsafe.Pointer(pFd)).FzPath, 49539)
  62098 
  62099 			return SQLITE_OK
  62100 		}
  62101 
  62102 		pNew = (*(*func(*libc.TLS, HANDLE, DWORD, DWORD, DWORD, SIZE_T) LPVOID)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 49*24 + 8)))(tls, (*WinFile)(unsafe.Pointer(pFd)).FhMap, flags, uint32(0), uint32(0), SIZE_T(*(*Sqlite3_int64)(unsafe.Pointer(bp))))
  62103 		if pNew == uintptr(0) {
  62104 			(*(*func(*libc.TLS, HANDLE) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 3*24 + 8)))(tls, (*WinFile)(unsafe.Pointer(pFd)).FhMap)
  62105 			(*WinFile)(unsafe.Pointer(pFd)).FhMap = uintptr(0)
  62106 			(*WinFile)(unsafe.Pointer(pFd)).FlastErrno = (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls)
  62107 			rc = winLogErrorAtLine(tls, SQLITE_IOERR|int32(24)<<8, (*WinFile)(unsafe.Pointer(pFd)).FlastErrno, ts+4854, (*WinFile)(unsafe.Pointer(pFd)).FzPath, 49557)
  62108 
  62109 			return SQLITE_OK
  62110 		}
  62111 		(*WinFile)(unsafe.Pointer(pFd)).FpMapRegion = pNew
  62112 		(*WinFile)(unsafe.Pointer(pFd)).FmmapSize = *(*Sqlite3_int64)(unsafe.Pointer(bp))
  62113 	}
  62114 
  62115 	return SQLITE_OK
  62116 }
  62117 
  62118 func winFetch(tls *libc.TLS, fd uintptr, iOff I64, nAmt int32, pp uintptr) int32 {
  62119 	var pFd uintptr = fd
  62120 	*(*uintptr)(unsafe.Pointer(pp)) = uintptr(0)
  62121 
  62122 	if (*WinFile)(unsafe.Pointer(pFd)).FmmapSizeMax > int64(0) {
  62123 		if (*WinFile)(unsafe.Pointer(pFd)).FpMapRegion == uintptr(0) {
  62124 			var rc int32 = winMapfile(tls, pFd, int64(-1))
  62125 			if rc != SQLITE_OK {
  62126 				return rc
  62127 			}
  62128 		}
  62129 		if (*WinFile)(unsafe.Pointer(pFd)).FmmapSize >= iOff+I64(nAmt) {
  62130 			*(*uintptr)(unsafe.Pointer(pp)) = (*WinFile)(unsafe.Pointer(pFd)).FpMapRegion + uintptr(iOff)
  62131 			(*WinFile)(unsafe.Pointer(pFd)).FnFetchOut++
  62132 		}
  62133 	}
  62134 
  62135 	return SQLITE_OK
  62136 }
  62137 
  62138 func winUnfetch(tls *libc.TLS, fd uintptr, iOff I64, p uintptr) int32 {
  62139 	var pFd uintptr = fd
  62140 
  62141 	if p != 0 {
  62142 		(*WinFile)(unsafe.Pointer(pFd)).FnFetchOut--
  62143 	} else {
  62144 		winUnmapfile(tls, pFd)
  62145 	}
  62146 
  62147 	return SQLITE_OK
  62148 }
  62149 
  62150 var winIoMethod = Sqlite3_io_methods{
  62151 	FiVersion:               3,
  62152 	FxClose:                 0,
  62153 	FxRead:                  0,
  62154 	FxWrite:                 0,
  62155 	FxTruncate:              0,
  62156 	FxSync:                  0,
  62157 	FxFileSize:              0,
  62158 	FxLock:                  0,
  62159 	FxUnlock:                0,
  62160 	FxCheckReservedLock:     0,
  62161 	FxFileControl:           0,
  62162 	FxSectorSize:            0,
  62163 	FxDeviceCharacteristics: 0,
  62164 	FxShmMap:                0,
  62165 	FxShmLock:               0,
  62166 	FxShmBarrier:            0,
  62167 	FxShmUnmap:              0,
  62168 	FxFetch:                 0,
  62169 	FxUnfetch:               0,
  62170 }
  62171 
  62172 var winIoNolockMethod = Sqlite3_io_methods{
  62173 	FiVersion:               3,
  62174 	FxClose:                 0,
  62175 	FxRead:                  0,
  62176 	FxWrite:                 0,
  62177 	FxTruncate:              0,
  62178 	FxSync:                  0,
  62179 	FxFileSize:              0,
  62180 	FxLock:                  0,
  62181 	FxUnlock:                0,
  62182 	FxCheckReservedLock:     0,
  62183 	FxFileControl:           0,
  62184 	FxSectorSize:            0,
  62185 	FxDeviceCharacteristics: 0,
  62186 	FxShmMap:                0,
  62187 	FxShmLock:               0,
  62188 	FxShmBarrier:            0,
  62189 	FxShmUnmap:              0,
  62190 	FxFetch:                 0,
  62191 	FxUnfetch:               0,
  62192 }
  62193 
  62194 var winAppData = WinVfsAppData{
  62195 	FpMethod: 0,
  62196 }
  62197 
  62198 var winNolockAppData = WinVfsAppData{
  62199 	FpMethod: 0,
  62200 	FbNoLock: 1,
  62201 }
  62202 
  62203 func winConvertFromUtf8Filename(tls *libc.TLS, zFilename uintptr) uintptr {
  62204 	var zConverted uintptr = uintptr(0)
  62205 	if sqlite3_os_type == 2 || Xsqlite3_win32_is_nt(tls) != 0 {
  62206 		zConverted = winUtf8ToUnicode(tls, zFilename)
  62207 	} else {
  62208 		zConverted = winUtf8ToMbcs(tls, zFilename, (*(*func(*libc.TLS) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 8)))(tls))
  62209 	}
  62210 
  62211 	return zConverted
  62212 }
  62213 
  62214 func winMakeEndInDirSep(tls *libc.TLS, nBuf int32, zBuf uintptr) int32 {
  62215 	if zBuf != 0 {
  62216 		var nLen int32 = Xsqlite3Strlen30(tls, zBuf)
  62217 		if nLen > 0 {
  62218 			if int32(*(*int8)(unsafe.Pointer(zBuf + uintptr(nLen-1)))) == '/' || int32(*(*int8)(unsafe.Pointer(zBuf + uintptr(nLen-1)))) == '\\' {
  62219 				return 1
  62220 			} else if nLen+1 < nBuf {
  62221 				*(*int8)(unsafe.Pointer(zBuf + uintptr(nLen))) = int8('\\')
  62222 				*(*int8)(unsafe.Pointer(zBuf + uintptr(nLen+1))) = int8(0)
  62223 				return 1
  62224 			}
  62225 		}
  62226 	}
  62227 	return 0
  62228 }
  62229 
  62230 func winTempDirDefined(tls *libc.TLS) int32 {
  62231 	Xsqlite3_mutex_enter(tls, Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_VFS1))
  62232 	if Xsqlite3_temp_directory != uintptr(0) {
  62233 		return 1
  62234 	}
  62235 	Xsqlite3_mutex_leave(tls, Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_VFS1))
  62236 	return 0
  62237 }
  62238 
  62239 func winGetTempname(tls *libc.TLS, pVfs uintptr, pzBuf uintptr) int32 {
  62240 	bp := tls.Alloc(24)
  62241 	defer tls.Free(24)
  62242 
  62243 	var i Size_t
  62244 	var j Size_t
  62245 	var nPre int32 = Xsqlite3Strlen30(tls, ts+4866)
  62246 	var nMax int32
  62247 	var nBuf int32
  62248 	var nDir int32
  62249 	var nLen int32
  62250 	var zBuf uintptr
  62251 
  62252 	nMax = (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname
  62253 	nBuf = nMax + 2
  62254 	zBuf = Xsqlite3MallocZero(tls, uint64(nBuf))
  62255 	if !(zBuf != 0) {
  62256 		return SQLITE_IOERR | int32(12)<<8
  62257 	}
  62258 
  62259 	nDir = nMax - (nPre + 15)
  62260 
  62261 	if winTempDirDefined(tls) != 0 {
  62262 		var nDirLen int32 = Xsqlite3Strlen30(tls, Xsqlite3_temp_directory)
  62263 		if nDirLen > 0 {
  62264 			if !(int32(*(*int8)(unsafe.Pointer(Xsqlite3_temp_directory + uintptr(nDirLen-1)))) == '/' || int32(*(*int8)(unsafe.Pointer(Xsqlite3_temp_directory + uintptr(nDirLen-1)))) == '\\') {
  62265 				nDirLen++
  62266 			}
  62267 			if nDirLen > nDir {
  62268 				Xsqlite3_mutex_leave(tls, Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_VFS1))
  62269 				Xsqlite3_free(tls, zBuf)
  62270 
  62271 				return winLogErrorAtLine(tls, SQLITE_ERROR, uint32(0), ts+4874, uintptr(0), 49859)
  62272 			}
  62273 			Xsqlite3_snprintf(tls, nMax, zBuf, ts+4493, libc.VaList(bp, Xsqlite3_temp_directory))
  62274 		}
  62275 		Xsqlite3_mutex_leave(tls, Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_VFS1))
  62276 	} else if sqlite3_os_type == 2 || Xsqlite3_win32_is_nt(tls) != 0 {
  62277 		var zMulti uintptr
  62278 		var zWidePath LPWSTR = Xsqlite3MallocZero(tls, uint64(nMax)*uint64(unsafe.Sizeof(WCHAR(0))))
  62279 		if !(zWidePath != 0) {
  62280 			Xsqlite3_free(tls, zBuf)
  62281 
  62282 			return SQLITE_IOERR | int32(12)<<8
  62283 		}
  62284 		if (*(*func(*libc.TLS, DWORD, LPWSTR) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 32*24 + 8)))(tls, uint32(nMax), zWidePath) == DWORD(0) {
  62285 			Xsqlite3_free(tls, zWidePath)
  62286 			Xsqlite3_free(tls, zBuf)
  62287 
  62288 			return winLogErrorAtLine(tls, SQLITE_IOERR|int32(25)<<8, (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls), ts+4890, uintptr(0), 49959)
  62289 		}
  62290 		zMulti = winUnicodeToUtf8(tls, zWidePath)
  62291 		if zMulti != 0 {
  62292 			Xsqlite3_snprintf(tls, nMax, zBuf, ts+4493, libc.VaList(bp+8, zMulti))
  62293 			Xsqlite3_free(tls, zMulti)
  62294 			Xsqlite3_free(tls, zWidePath)
  62295 		} else {
  62296 			Xsqlite3_free(tls, zWidePath)
  62297 			Xsqlite3_free(tls, zBuf)
  62298 
  62299 			return SQLITE_IOERR | int32(12)<<8
  62300 		}
  62301 	} else {
  62302 		var zUtf8 uintptr
  62303 		var zMbcsPath uintptr = Xsqlite3MallocZero(tls, uint64(nMax))
  62304 		if !(zMbcsPath != 0) {
  62305 			Xsqlite3_free(tls, zBuf)
  62306 
  62307 			return SQLITE_IOERR | int32(12)<<8
  62308 		}
  62309 		if (*(*func(*libc.TLS, DWORD, LPSTR) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 31*24 + 8)))(tls, uint32(nMax), zMbcsPath) == DWORD(0) {
  62310 			Xsqlite3_free(tls, zBuf)
  62311 
  62312 			return winLogErrorAtLine(tls, SQLITE_IOERR|int32(25)<<8, (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls), ts+4906, uintptr(0), 49986)
  62313 		}
  62314 		zUtf8 = winMbcsToUtf8(tls, zMbcsPath, (*(*func(*libc.TLS) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 8)))(tls))
  62315 		if zUtf8 != 0 {
  62316 			Xsqlite3_snprintf(tls, nMax, zBuf, ts+4493, libc.VaList(bp+16, zUtf8))
  62317 			Xsqlite3_free(tls, zUtf8)
  62318 		} else {
  62319 			Xsqlite3_free(tls, zBuf)
  62320 
  62321 			return SQLITE_IOERR | int32(12)<<8
  62322 		}
  62323 	}
  62324 
  62325 	if !(winMakeEndInDirSep(tls, nDir+1, zBuf) != 0) {
  62326 		Xsqlite3_free(tls, zBuf)
  62327 
  62328 		return winLogErrorAtLine(tls, SQLITE_ERROR, uint32(0), ts+4922, uintptr(0), 50010)
  62329 	}
  62330 
  62331 	nLen = Xsqlite3Strlen30(tls, zBuf)
  62332 	if nLen+nPre+17 > nBuf {
  62333 		Xsqlite3_free(tls, zBuf)
  62334 
  62335 		return winLogErrorAtLine(tls, SQLITE_ERROR, uint32(0), ts+4938, uintptr(0), 50028)
  62336 	}
  62337 
  62338 	Xsqlite3_snprintf(tls, nBuf-16-nLen, zBuf+uintptr(nLen), ts+4866, 0)
  62339 
  62340 	j = Size_t(Xsqlite3Strlen30(tls, zBuf))
  62341 	Xsqlite3_randomness(tls, 15, zBuf+uintptr(j))
  62342 	i = uint64(0)
  62343 __1:
  62344 	if !(i < uint64(15)) {
  62345 		goto __3
  62346 	}
  62347 	{
  62348 		*(*int8)(unsafe.Pointer(zBuf + uintptr(j))) = zChars[uint64(uint8(*(*int8)(unsafe.Pointer(zBuf + uintptr(j)))))%(uint64(unsafe.Sizeof(zChars))-uint64(1))]
  62349 
  62350 	}
  62351 	goto __2
  62352 __2:
  62353 	i++
  62354 	j++
  62355 	goto __1
  62356 	goto __3
  62357 __3:
  62358 	;
  62359 	*(*int8)(unsafe.Pointer(zBuf + uintptr(j))) = int8(0)
  62360 	*(*int8)(unsafe.Pointer(zBuf + uintptr(j+uint64(1)))) = int8(0)
  62361 	*(*uintptr)(unsafe.Pointer(pzBuf)) = zBuf
  62362 
  62363 	return SQLITE_OK
  62364 }
  62365 
  62366 var zChars = *(*[63]int8)(unsafe.Pointer(ts + 4954))
  62367 
  62368 func winIsDir(tls *libc.TLS, zConverted uintptr) int32 {
  62369 	bp := tls.Alloc(44)
  62370 	defer tls.Free(44)
  62371 
  62372 	var attr DWORD
  62373 	var rc int32 = 0
  62374 
  62375 	if sqlite3_os_type == 2 || Xsqlite3_win32_is_nt(tls) != 0 {
  62376 		*(*int32)(unsafe.Pointer(bp + 36)) = 0
  62377 
  62378 		libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(WIN32_FILE_ATTRIBUTE_DATA{})))
  62379 		for !(libc.AssignInt32(&rc, (*(*func(*libc.TLS, LPCWSTR, GET_FILEEX_INFO_LEVELS, LPVOID) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 22*24 + 8)))(tls, zConverted,
  62380 			GetFileExInfoStandard,
  62381 			bp)) != 0) && winRetryIoerr(tls, bp+36, bp+40) != 0 {
  62382 		}
  62383 		if !(rc != 0) {
  62384 			return 0
  62385 		}
  62386 		attr = (*WIN32_FILE_ATTRIBUTE_DATA)(unsafe.Pointer(bp)).FdwFileAttributes
  62387 	} else {
  62388 		attr = (*(*func(*libc.TLS, LPCSTR) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 20*24 + 8)))(tls, zConverted)
  62389 	}
  62390 	return libc.Bool32(attr != libc.Uint32(libc.Uint32FromInt32(-1)) && attr&DWORD(FILE_ATTRIBUTE_DIRECTORY) != 0)
  62391 }
  62392 
  62393 func winOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, id uintptr, flags int32, pOutFlags uintptr) int32 {
  62394 	bp := tls.Alloc(24)
  62395 	defer tls.Free(24)
  62396 
  62397 	var h HANDLE
  62398 	*(*DWORD)(unsafe.Pointer(bp + 12)) = DWORD(0)
  62399 	var dwDesiredAccess DWORD
  62400 	var dwShareMode DWORD
  62401 	var dwCreationDisposition DWORD
  62402 	var dwFlagsAndAttributes DWORD = DWORD(0)
  62403 	var pAppData uintptr
  62404 	var pFile uintptr = id
  62405 	var zConverted uintptr
  62406 	var zUtf8Name uintptr = zName
  62407 	*(*int32)(unsafe.Pointer(bp + 8)) = 0
  62408 
  62409 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
  62410 
  62411 	var rc int32 = SQLITE_OK
  62412 
  62413 	var isExclusive int32 = flags & SQLITE_OPEN_EXCLUSIVE
  62414 	var isDelete int32 = flags & SQLITE_OPEN_DELETEONCLOSE
  62415 	var isCreate int32 = flags & SQLITE_OPEN_CREATE
  62416 	var isReadonly int32 = flags & SQLITE_OPEN_READONLY
  62417 	var isReadWrite int32 = flags & SQLITE_OPEN_READWRITE
  62418 
  62419 	libc.Xmemset(tls, pFile, 0, uint64(unsafe.Sizeof(WinFile{})))
  62420 	(*WinFile)(unsafe.Pointer(pFile)).Fh = libc.UintptrFromInt64(int64(-1))
  62421 
  62422 	if !(zUtf8Name != 0) {
  62423 		rc = winGetTempname(tls, pVfs, bp)
  62424 		if rc != SQLITE_OK {
  62425 			return rc
  62426 		}
  62427 		zUtf8Name = *(*uintptr)(unsafe.Pointer(bp))
  62428 	}
  62429 
  62430 	zConverted = winConvertFromUtf8Filename(tls, zUtf8Name)
  62431 	if zConverted == uintptr(0) {
  62432 		Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp)))
  62433 
  62434 		return SQLITE_IOERR | int32(12)<<8
  62435 	}
  62436 
  62437 	if winIsDir(tls, zConverted) != 0 {
  62438 		Xsqlite3_free(tls, zConverted)
  62439 		Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp)))
  62440 
  62441 		return SQLITE_CANTOPEN | int32(2)<<8
  62442 	}
  62443 
  62444 	if isReadWrite != 0 {
  62445 		dwDesiredAccess = 0x80000000 | uint32(0x40000000)
  62446 	} else {
  62447 		dwDesiredAccess = 0x80000000
  62448 	}
  62449 
  62450 	if isExclusive != 0 {
  62451 		dwCreationDisposition = DWORD(CREATE_NEW)
  62452 	} else if isCreate != 0 {
  62453 		dwCreationDisposition = DWORD(OPEN_ALWAYS)
  62454 	} else {
  62455 		dwCreationDisposition = DWORD(OPEN_EXISTING)
  62456 	}
  62457 
  62458 	if 0 == Xsqlite3_uri_boolean(tls, zName, ts+5017, 0) {
  62459 		dwShareMode = DWORD(FILE_SHARE_READ | FILE_SHARE_WRITE)
  62460 	} else {
  62461 		dwShareMode = DWORD(0)
  62462 	}
  62463 
  62464 	if isDelete != 0 {
  62465 		dwFlagsAndAttributes = DWORD(FILE_ATTRIBUTE_TEMPORARY |
  62466 			FILE_ATTRIBUTE_HIDDEN |
  62467 			FILE_FLAG_DELETE_ON_CLOSE)
  62468 	} else {
  62469 		dwFlagsAndAttributes = DWORD(FILE_ATTRIBUTE_NORMAL)
  62470 	}
  62471 
  62472 	if sqlite3_os_type == 2 || Xsqlite3_win32_is_nt(tls) != 0 {
  62473 		for __ccgo := true; __ccgo; __ccgo = winRetryIoerr(tls, bp+8, bp+12) != 0 {
  62474 			h = (*(*func(*libc.TLS, LPCWSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES, DWORD, DWORD, HANDLE) HANDLE)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 5*24 + 8)))(tls, zConverted,
  62475 				dwDesiredAccess,
  62476 				dwShareMode, uintptr(0),
  62477 				dwCreationDisposition,
  62478 				dwFlagsAndAttributes,
  62479 				uintptr(0))
  62480 			if h != libc.UintptrFromInt64(int64(-1)) {
  62481 				break
  62482 			}
  62483 			if isReadWrite != 0 {
  62484 				var rc2 int32
  62485 				*(*int32)(unsafe.Pointer(bp + 16)) = 0
  62486 				Xsqlite3BeginBenignMalloc(tls)
  62487 				rc2 = winAccess(tls, pVfs, zName, SQLITE_ACCESS_READ, bp+16)
  62488 				Xsqlite3EndBenignMalloc(tls)
  62489 				if rc2 == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 16)) != 0 {
  62490 					break
  62491 				}
  62492 			}
  62493 		}
  62494 	} else {
  62495 		for __ccgo1 := true; __ccgo1; __ccgo1 = winRetryIoerr(tls, bp+8, bp+12) != 0 {
  62496 			h = (*(*func(*libc.TLS, LPCSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES, DWORD, DWORD, HANDLE) HANDLE)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 4*24 + 8)))(tls, zConverted,
  62497 				dwDesiredAccess,
  62498 				dwShareMode, uintptr(0),
  62499 				dwCreationDisposition,
  62500 				dwFlagsAndAttributes,
  62501 				uintptr(0))
  62502 			if h != libc.UintptrFromInt64(int64(-1)) {
  62503 				break
  62504 			}
  62505 			if isReadWrite != 0 {
  62506 				var rc2 int32
  62507 				*(*int32)(unsafe.Pointer(bp + 20)) = 0
  62508 				Xsqlite3BeginBenignMalloc(tls)
  62509 				rc2 = winAccess(tls, pVfs, zName, SQLITE_ACCESS_READ, bp+20)
  62510 				Xsqlite3EndBenignMalloc(tls)
  62511 				if rc2 == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 20)) != 0 {
  62512 					break
  62513 				}
  62514 			}
  62515 		}
  62516 	}
  62517 	winLogIoerr(tls, *(*int32)(unsafe.Pointer(bp + 8)), 50317)
  62518 
  62519 	if h == libc.UintptrFromInt64(int64(-1)) {
  62520 		Xsqlite3_free(tls, zConverted)
  62521 		Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp)))
  62522 		if isReadWrite != 0 && !(isExclusive != 0) {
  62523 			return winOpen(tls, pVfs, zName, id,
  62524 				(flags|SQLITE_OPEN_READONLY)&libc.CplInt32(SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE),
  62525 				pOutFlags)
  62526 		} else {
  62527 			(*WinFile)(unsafe.Pointer(pFile)).FlastErrno = *(*DWORD)(unsafe.Pointer(bp + 12))
  62528 			winLogErrorAtLine(tls, SQLITE_CANTOPEN, (*WinFile)(unsafe.Pointer(pFile)).FlastErrno, ts+5027, zUtf8Name, 50332)
  62529 			return Xsqlite3CantopenError(tls, 50333)
  62530 		}
  62531 	}
  62532 
  62533 	if pOutFlags != 0 {
  62534 		if isReadWrite != 0 {
  62535 			*(*int32)(unsafe.Pointer(pOutFlags)) = SQLITE_OPEN_READWRITE
  62536 		} else {
  62537 			*(*int32)(unsafe.Pointer(pOutFlags)) = SQLITE_OPEN_READONLY
  62538 		}
  62539 	}
  62540 
  62541 	pAppData = (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData
  62542 
  62543 	{
  62544 		Xsqlite3_free(tls, zConverted)
  62545 
  62546 	}
  62547 
  62548 	Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp)))
  62549 	(*Sqlite3_file)(unsafe.Pointer(id)).FpMethods = func() uintptr {
  62550 		if pAppData != 0 {
  62551 			return (*WinVfsAppData)(unsafe.Pointer(pAppData)).FpMethod
  62552 		}
  62553 		return uintptr(unsafe.Pointer(&winIoMethod))
  62554 	}()
  62555 	(*WinFile)(unsafe.Pointer(pFile)).FpVfs = pVfs
  62556 	(*WinFile)(unsafe.Pointer(pFile)).Fh = h
  62557 	if isReadonly != 0 {
  62558 		*(*U8)(unsafe.Pointer(pFile + 28)) |= U8(WINFILE_RDONLY)
  62559 	}
  62560 	if flags&SQLITE_OPEN_MAIN_DB != 0 &&
  62561 		Xsqlite3_uri_boolean(tls, zName, ts+5035, SQLITE_POWERSAFE_OVERWRITE) != 0 {
  62562 		*(*U8)(unsafe.Pointer(pFile + 28)) |= U8(WINFILE_PSOW)
  62563 	}
  62564 	(*WinFile)(unsafe.Pointer(pFile)).FlastErrno = DWORD(0)
  62565 	(*WinFile)(unsafe.Pointer(pFile)).FzPath = zName
  62566 	(*WinFile)(unsafe.Pointer(pFile)).FhMap = uintptr(0)
  62567 	(*WinFile)(unsafe.Pointer(pFile)).FpMapRegion = uintptr(0)
  62568 	(*WinFile)(unsafe.Pointer(pFile)).FmmapSize = int64(0)
  62569 	(*WinFile)(unsafe.Pointer(pFile)).FmmapSizeMax = Xsqlite3Config.FszMmap
  62570 
  62571 	return rc
  62572 }
  62573 
  62574 func winDelete(tls *libc.TLS, pVfs uintptr, zFilename uintptr, syncDir int32) int32 {
  62575 	bp := tls.Alloc(8)
  62576 	defer tls.Free(8)
  62577 
  62578 	*(*int32)(unsafe.Pointer(bp)) = 0
  62579 	var rc int32
  62580 	var attr DWORD
  62581 	*(*DWORD)(unsafe.Pointer(bp + 4)) = DWORD(0)
  62582 	var zConverted uintptr
  62583 	_ = pVfs
  62584 	_ = syncDir
  62585 
  62586 	zConverted = winConvertFromUtf8Filename(tls, zFilename)
  62587 	if zConverted == uintptr(0) {
  62588 		return SQLITE_IOERR | int32(12)<<8
  62589 	}
  62590 	if sqlite3_os_type == 2 || Xsqlite3_win32_is_nt(tls) != 0 {
  62591 		for __ccgo := true; __ccgo; __ccgo = 1 != 0 {
  62592 			attr = (*(*func(*libc.TLS, LPCWSTR) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 21*24 + 8)))(tls, zConverted)
  62593 			if attr == libc.Uint32(libc.Uint32FromInt32(-1)) {
  62594 				*(*DWORD)(unsafe.Pointer(bp + 4)) = (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls)
  62595 				if *(*DWORD)(unsafe.Pointer(bp + 4)) == DWORD(2) ||
  62596 					*(*DWORD)(unsafe.Pointer(bp + 4)) == DWORD(3) {
  62597 					rc = SQLITE_IOERR | int32(23)<<8
  62598 				} else {
  62599 					rc = SQLITE_ERROR
  62600 				}
  62601 				break
  62602 			}
  62603 			if attr&DWORD(FILE_ATTRIBUTE_DIRECTORY) != 0 {
  62604 				rc = SQLITE_ERROR
  62605 				break
  62606 			}
  62607 			if (*(*func(*libc.TLS, LPCWSTR) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 10*24 + 8)))(tls, zConverted) != 0 {
  62608 				rc = SQLITE_OK
  62609 				break
  62610 			}
  62611 			if !(winRetryIoerr(tls, bp, bp+4) != 0) {
  62612 				rc = SQLITE_ERROR
  62613 				break
  62614 			}
  62615 		}
  62616 	} else {
  62617 		for __ccgo1 := true; __ccgo1; __ccgo1 = 1 != 0 {
  62618 			attr = (*(*func(*libc.TLS, LPCSTR) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 20*24 + 8)))(tls, zConverted)
  62619 			if attr == libc.Uint32(libc.Uint32FromInt32(-1)) {
  62620 				*(*DWORD)(unsafe.Pointer(bp + 4)) = (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls)
  62621 				if *(*DWORD)(unsafe.Pointer(bp + 4)) == DWORD(2) ||
  62622 					*(*DWORD)(unsafe.Pointer(bp + 4)) == DWORD(3) {
  62623 					rc = SQLITE_IOERR | int32(23)<<8
  62624 				} else {
  62625 					rc = SQLITE_ERROR
  62626 				}
  62627 				break
  62628 			}
  62629 			if attr&DWORD(FILE_ATTRIBUTE_DIRECTORY) != 0 {
  62630 				rc = SQLITE_ERROR
  62631 				break
  62632 			}
  62633 			if (*(*func(*libc.TLS, LPCSTR) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 9*24 + 8)))(tls, zConverted) != 0 {
  62634 				rc = SQLITE_OK
  62635 				break
  62636 			}
  62637 			if !(winRetryIoerr(tls, bp, bp+4) != 0) {
  62638 				rc = SQLITE_ERROR
  62639 				break
  62640 			}
  62641 		}
  62642 	}
  62643 	if rc != 0 && rc != SQLITE_IOERR|int32(23)<<8 {
  62644 		rc = winLogErrorAtLine(tls, SQLITE_IOERR|int32(10)<<8, *(*DWORD)(unsafe.Pointer(bp + 4)), ts+5040, zFilename, 50505)
  62645 	} else {
  62646 		winLogIoerr(tls, *(*int32)(unsafe.Pointer(bp)), 50507)
  62647 	}
  62648 	Xsqlite3_free(tls, zConverted)
  62649 
  62650 	return rc
  62651 }
  62652 
  62653 func winAccess(tls *libc.TLS, pVfs uintptr, zFilename uintptr, flags int32, pResOut uintptr) int32 {
  62654 	bp := tls.Alloc(44)
  62655 	defer tls.Free(44)
  62656 
  62657 	var attr DWORD
  62658 	var rc int32 = 0
  62659 	*(*DWORD)(unsafe.Pointer(bp + 40)) = DWORD(0)
  62660 	var zConverted uintptr
  62661 	_ = pVfs
  62662 
  62663 	zConverted = winConvertFromUtf8Filename(tls, zFilename)
  62664 	if zConverted == uintptr(0) {
  62665 		return SQLITE_IOERR | int32(12)<<8
  62666 	}
  62667 	if sqlite3_os_type == 2 || Xsqlite3_win32_is_nt(tls) != 0 {
  62668 		*(*int32)(unsafe.Pointer(bp + 36)) = 0
  62669 
  62670 		libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(WIN32_FILE_ATTRIBUTE_DATA{})))
  62671 		for !(libc.AssignInt32(&rc, (*(*func(*libc.TLS, LPCWSTR, GET_FILEEX_INFO_LEVELS, LPVOID) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 22*24 + 8)))(tls, zConverted,
  62672 			GetFileExInfoStandard,
  62673 			bp)) != 0) && winRetryIoerr(tls, bp+36, bp+40) != 0 {
  62674 		}
  62675 		if rc != 0 {
  62676 			if flags == SQLITE_ACCESS_EXISTS &&
  62677 				(*WIN32_FILE_ATTRIBUTE_DATA)(unsafe.Pointer(bp)).FnFileSizeHigh == DWORD(0) &&
  62678 				(*WIN32_FILE_ATTRIBUTE_DATA)(unsafe.Pointer(bp)).FnFileSizeLow == DWORD(0) {
  62679 				attr = libc.Uint32(libc.Uint32FromInt32(-1))
  62680 			} else {
  62681 				attr = (*WIN32_FILE_ATTRIBUTE_DATA)(unsafe.Pointer(bp)).FdwFileAttributes
  62682 			}
  62683 		} else {
  62684 			winLogIoerr(tls, *(*int32)(unsafe.Pointer(bp + 36)), 50557)
  62685 			if *(*DWORD)(unsafe.Pointer(bp + 40)) != DWORD(2) && *(*DWORD)(unsafe.Pointer(bp + 40)) != DWORD(3) {
  62686 				Xsqlite3_free(tls, zConverted)
  62687 				return winLogErrorAtLine(tls, SQLITE_IOERR|int32(13)<<8, *(*DWORD)(unsafe.Pointer(bp + 40)), ts+5050, zFilename, 50560)
  62688 			} else {
  62689 				attr = libc.Uint32(libc.Uint32FromInt32(-1))
  62690 			}
  62691 		}
  62692 	} else {
  62693 		attr = (*(*func(*libc.TLS, LPCSTR) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 20*24 + 8)))(tls, zConverted)
  62694 	}
  62695 	Xsqlite3_free(tls, zConverted)
  62696 	switch flags {
  62697 	case SQLITE_ACCESS_READ:
  62698 		fallthrough
  62699 	case SQLITE_ACCESS_EXISTS:
  62700 		rc = libc.Bool32(attr != libc.Uint32(libc.Uint32FromInt32(-1)))
  62701 		break
  62702 	case SQLITE_ACCESS_READWRITE:
  62703 		rc = libc.Bool32(attr != libc.Uint32(libc.Uint32FromInt32(-1)) && attr&DWORD(FILE_ATTRIBUTE_READONLY) == DWORD(0))
  62704 		break
  62705 	default:
  62706 	}
  62707 	*(*int32)(unsafe.Pointer(pResOut)) = rc
  62708 
  62709 	return SQLITE_OK
  62710 }
  62711 
  62712 func winIsLongPathPrefix(tls *libc.TLS, zPathname uintptr) WINBOOL {
  62713 	return libc.Bool32(int32(*(*int8)(unsafe.Pointer(zPathname))) == '\\' && int32(*(*int8)(unsafe.Pointer(zPathname + 1))) == '\\' &&
  62714 		int32(*(*int8)(unsafe.Pointer(zPathname + 2))) == '?' && int32(*(*int8)(unsafe.Pointer(zPathname + 3))) == '\\')
  62715 }
  62716 
  62717 func winIsDriveLetterAndColon(tls *libc.TLS, zPathname uintptr) WINBOOL {
  62718 	return libc.Bool32(int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zPathname)))])&0x02 != 0 && int32(*(*int8)(unsafe.Pointer(zPathname + 1))) == ':')
  62719 }
  62720 
  62721 func winIsVerbatimPathname(tls *libc.TLS, zPathname uintptr) WINBOOL {
  62722 	if int32(*(*int8)(unsafe.Pointer(zPathname))) == '/' || int32(*(*int8)(unsafe.Pointer(zPathname))) == '\\' {
  62723 		return TRUE
  62724 	}
  62725 
  62726 	if winIsDriveLetterAndColon(tls, zPathname) != 0 {
  62727 		return TRUE
  62728 	}
  62729 
  62730 	return FALSE
  62731 }
  62732 
  62733 func winFullPathnameNoMutex(tls *libc.TLS, pVfs uintptr, zRelative uintptr, nFull int32, zFull uintptr) int32 {
  62734 	bp := tls.Alloc(32)
  62735 	defer tls.Free(32)
  62736 
  62737 	var nByte DWORD
  62738 	var zConverted uintptr
  62739 	var zOut uintptr
  62740 
  62741 	if int32(*(*int8)(unsafe.Pointer(zRelative))) == '/' && (winIsDriveLetterAndColon(tls, zRelative+uintptr(1)) != 0 ||
  62742 		winIsLongPathPrefix(tls, zRelative+uintptr(1)) != 0) {
  62743 		zRelative++
  62744 	}
  62745 
  62746 	if Xsqlite3_data_directory != 0 && !(winIsVerbatimPathname(tls, zRelative) != 0) {
  62747 		Xsqlite3_snprintf(tls, func() int32 {
  62748 			if nFull < (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname {
  62749 				return nFull
  62750 			}
  62751 			return (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname
  62752 		}(), zFull, ts+5060,
  62753 			libc.VaList(bp, Xsqlite3_data_directory, '\\', zRelative))
  62754 		return SQLITE_OK
  62755 	}
  62756 	zConverted = winConvertFromUtf8Filename(tls, zRelative)
  62757 	if zConverted == uintptr(0) {
  62758 		return SQLITE_IOERR | int32(12)<<8
  62759 	}
  62760 	if sqlite3_os_type == 2 || Xsqlite3_win32_is_nt(tls) != 0 {
  62761 		var zTemp LPWSTR
  62762 		nByte = (*(*func(*libc.TLS, LPCWSTR, DWORD, LPWSTR, uintptr) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 25*24 + 8)))(tls, zConverted, uint32(0), uintptr(0), uintptr(0))
  62763 		if nByte == DWORD(0) {
  62764 			Xsqlite3_free(tls, zConverted)
  62765 			return winLogErrorAtLine(tls, SQLITE_CANTOPEN|int32(3)<<8, (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls), ts+5067, zRelative, 50777)
  62766 		}
  62767 		nByte = nByte + DWORD(3)
  62768 		zTemp = Xsqlite3MallocZero(tls, uint64(nByte)*uint64(unsafe.Sizeof(WCHAR(0))))
  62769 		if zTemp == uintptr(0) {
  62770 			Xsqlite3_free(tls, zConverted)
  62771 			return SQLITE_IOERR | int32(12)<<8
  62772 		}
  62773 		nByte = (*(*func(*libc.TLS, LPCWSTR, DWORD, LPWSTR, uintptr) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 25*24 + 8)))(tls, zConverted, nByte, zTemp, uintptr(0))
  62774 		if nByte == DWORD(0) {
  62775 			Xsqlite3_free(tls, zConverted)
  62776 			Xsqlite3_free(tls, zTemp)
  62777 			return winLogErrorAtLine(tls, SQLITE_CANTOPEN|int32(3)<<8, (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls), ts+5084, zRelative, 50790)
  62778 		}
  62779 		Xsqlite3_free(tls, zConverted)
  62780 		zOut = winUnicodeToUtf8(tls, zTemp)
  62781 		Xsqlite3_free(tls, zTemp)
  62782 	} else {
  62783 		var zTemp uintptr
  62784 		nByte = (*(*func(*libc.TLS, LPCSTR, DWORD, LPSTR, uintptr) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 24*24 + 8)))(tls, zConverted, uint32(0), uintptr(0), uintptr(0))
  62785 		if nByte == DWORD(0) {
  62786 			Xsqlite3_free(tls, zConverted)
  62787 			return winLogErrorAtLine(tls, SQLITE_CANTOPEN|int32(3)<<8, (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls), ts+5101, zRelative, 50803)
  62788 		}
  62789 		nByte = nByte + DWORD(3)
  62790 		zTemp = Xsqlite3MallocZero(tls, uint64(nByte)*uint64(unsafe.Sizeof(int8(0))))
  62791 		if zTemp == uintptr(0) {
  62792 			Xsqlite3_free(tls, zConverted)
  62793 			return SQLITE_IOERR | int32(12)<<8
  62794 		}
  62795 		nByte = (*(*func(*libc.TLS, LPCSTR, DWORD, LPSTR, uintptr) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 24*24 + 8)))(tls, zConverted, nByte, zTemp, uintptr(0))
  62796 		if nByte == DWORD(0) {
  62797 			Xsqlite3_free(tls, zConverted)
  62798 			Xsqlite3_free(tls, zTemp)
  62799 			return winLogErrorAtLine(tls, SQLITE_CANTOPEN|int32(3)<<8, (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls), ts+5118, zRelative, 50816)
  62800 		}
  62801 		Xsqlite3_free(tls, zConverted)
  62802 		zOut = winMbcsToUtf8(tls, zTemp, (*(*func(*libc.TLS) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 8)))(tls))
  62803 		Xsqlite3_free(tls, zTemp)
  62804 	}
  62805 	if zOut != 0 {
  62806 		Xsqlite3_snprintf(tls, func() int32 {
  62807 			if nFull < (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname {
  62808 				return nFull
  62809 			}
  62810 			return (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname
  62811 		}(), zFull, ts+4493, libc.VaList(bp+24, zOut))
  62812 		Xsqlite3_free(tls, zOut)
  62813 		return SQLITE_OK
  62814 	} else {
  62815 		return SQLITE_IOERR | int32(12)<<8
  62816 	}
  62817 	return int32(0)
  62818 }
  62819 
  62820 func winFullPathname(tls *libc.TLS, pVfs uintptr, zRelative uintptr, nFull int32, zFull uintptr) int32 {
  62821 	var rc int32
  62822 	var pMutex uintptr
  62823 	pMutex = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_VFS1)
  62824 	Xsqlite3_mutex_enter(tls, pMutex)
  62825 	rc = winFullPathnameNoMutex(tls, pVfs, zRelative, nFull, zFull)
  62826 	Xsqlite3_mutex_leave(tls, pMutex)
  62827 	return rc
  62828 }
  62829 
  62830 func winDlOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr) uintptr {
  62831 	var h HANDLE
  62832 	var zConverted uintptr = winConvertFromUtf8Filename(tls, zFilename)
  62833 	_ = pVfs
  62834 	if zConverted == uintptr(0) {
  62835 		return uintptr(0)
  62836 	}
  62837 	if sqlite3_os_type == 2 || Xsqlite3_win32_is_nt(tls) != 0 {
  62838 		h = (*(*func(*libc.TLS, LPCWSTR) HMODULE)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 45*24 + 8)))(tls, zConverted)
  62839 	} else {
  62840 		h = (*(*func(*libc.TLS, LPCSTR) HMODULE)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 44*24 + 8)))(tls, zConverted)
  62841 	}
  62842 
  62843 	Xsqlite3_free(tls, zConverted)
  62844 	return h
  62845 }
  62846 
  62847 func winDlError(tls *libc.TLS, pVfs uintptr, nBuf int32, zBufOut uintptr) {
  62848 	_ = pVfs
  62849 	winGetLastErrorMsg(tls, (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls), nBuf, zBufOut)
  62850 }
  62851 
  62852 func winDlSym(tls *libc.TLS, pVfs uintptr, pH uintptr, zSym uintptr) uintptr {
  62853 	var proc FARPROC
  62854 	_ = pVfs
  62855 	proc = (*(*func(*libc.TLS, HMODULE, LPCSTR) FARPROC)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 27*24 + 8)))(tls, pH, zSym)
  62856 
  62857 	return proc
  62858 }
  62859 
  62860 func winDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) {
  62861 	_ = pVfs
  62862 	(*(*func(*libc.TLS, HMODULE) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 16*24 + 8)))(tls, pHandle)
  62863 
  62864 }
  62865 
  62866 // State information for the randomness gatherer.
  62867 type EntropyGatherer1 = struct {
  62868 	Fa           uintptr
  62869 	Fna          int32
  62870 	Fi           int32
  62871 	FnXor        int32
  62872 	F__ccgo_pad1 [4]byte
  62873 }
  62874 
  62875 // State information for the randomness gatherer.
  62876 type EntropyGatherer = EntropyGatherer1
  62877 
  62878 func xorMemory(tls *libc.TLS, p uintptr, x uintptr, sz int32) {
  62879 	var j int32
  62880 	var k int32
  62881 	j = 0
  62882 	k = (*EntropyGatherer)(unsafe.Pointer(p)).Fi
  62883 	for ; j < sz; j++ {
  62884 		*(*uint8)(unsafe.Pointer((*EntropyGatherer)(unsafe.Pointer(p)).Fa + uintptr(libc.PostIncInt32(&k, 1)))) ^= uint8(int32(*(*uint8)(unsafe.Pointer(x + uintptr(j)))))
  62885 		if k >= (*EntropyGatherer)(unsafe.Pointer(p)).Fna {
  62886 			k = 0
  62887 		}
  62888 	}
  62889 	(*EntropyGatherer)(unsafe.Pointer(p)).Fi = k
  62890 	*(*int32)(unsafe.Pointer(p + 16)) += sz
  62891 }
  62892 
  62893 func winRandomness(tls *libc.TLS, pVfs uintptr, nBuf int32, zBuf uintptr) int32 {
  62894 	bp := tls.Alloc(56)
  62895 	defer tls.Free(56)
  62896 
  62897 	_ = pVfs
  62898 	libc.Xmemset(tls, zBuf, 0, uint64(nBuf))
  62899 	(*EntropyGatherer)(unsafe.Pointer(bp + 16)).Fa = zBuf
  62900 	(*EntropyGatherer)(unsafe.Pointer(bp + 16)).Fna = nBuf
  62901 	(*EntropyGatherer)(unsafe.Pointer(bp + 16)).FnXor = 0
  62902 	(*EntropyGatherer)(unsafe.Pointer(bp + 16)).Fi = 0
  62903 	{
  62904 		(*(*func(*libc.TLS, LPSYSTEMTIME))(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 29*24 + 8)))(tls, bp)
  62905 		xorMemory(tls, bp+16, bp, int32(unsafe.Sizeof(SYSTEMTIME{})))
  62906 
  62907 	}
  62908 	{
  62909 		*(*DWORD)(unsafe.Pointer(bp + 40)) = (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 17*24 + 8)))(tls)
  62910 		xorMemory(tls, bp+16, bp+40, int32(unsafe.Sizeof(DWORD(0))))
  62911 
  62912 	}
  62913 	{
  62914 		*(*DWORD)(unsafe.Pointer(bp + 44)) = (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 33*24 + 8)))(tls)
  62915 		xorMemory(tls, bp+16, bp+44, int32(unsafe.Sizeof(DWORD(0))))
  62916 
  62917 	}
  62918 	{
  62919 		(*(*func(*libc.TLS, uintptr) WINBOOL)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 51*24 + 8)))(tls, bp+48)
  62920 		xorMemory(tls, bp+16, bp+48, int32(unsafe.Sizeof(LARGE_INTEGER{})))
  62921 
  62922 	}
  62923 	if (*EntropyGatherer)(unsafe.Pointer(bp+16)).FnXor > nBuf {
  62924 		return nBuf
  62925 	}
  62926 	return (*EntropyGatherer)(unsafe.Pointer(bp + 16)).FnXor
  62927 }
  62928 
  62929 func winSleep(tls *libc.TLS, pVfs uintptr, microsec int32) int32 {
  62930 	Xsqlite3_win32_sleep(tls, uint32((microsec+999)/1000))
  62931 	_ = pVfs
  62932 	return (microsec + 999) / 1000 * 1000
  62933 }
  62934 
  62935 func winCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, piNow uintptr) int32 {
  62936 	bp := tls.Alloc(8)
  62937 	defer tls.Free(8)
  62938 
  62939 	(*(*func(*libc.TLS, LPFILETIME))(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 30*24 + 8)))(tls, bp)
  62940 
  62941 	*(*Sqlite3_int64)(unsafe.Pointer(piNow)) = winFiletimeEpoch + (Sqlite3_int64((*FILETIME)(unsafe.Pointer(bp)).FdwHighDateTime)*max32BitValue+Sqlite3_int64((*FILETIME)(unsafe.Pointer(bp)).FdwLowDateTime))/int64(10000)
  62942 
  62943 	_ = pVfs
  62944 	return SQLITE_OK
  62945 }
  62946 
  62947 var winFiletimeEpoch Sqlite3_int64 = int64(23058135) * int64(8640000)
  62948 var max32BitValue Sqlite3_int64 = int64(2000000000) + int64(2000000000) + int64(294967296)
  62949 
  62950 func winCurrentTime(tls *libc.TLS, pVfs uintptr, prNow uintptr) int32 {
  62951 	bp := tls.Alloc(8)
  62952 	defer tls.Free(8)
  62953 
  62954 	var rc int32
  62955 
  62956 	rc = winCurrentTimeInt64(tls, pVfs, bp)
  62957 	if !(rc != 0) {
  62958 		*(*float64)(unsafe.Pointer(prNow)) = float64(*(*Sqlite3_int64)(unsafe.Pointer(bp))) / 86400000.0
  62959 	}
  62960 	return rc
  62961 }
  62962 
  62963 func winGetLastError(tls *libc.TLS, pVfs uintptr, nBuf int32, zBuf uintptr) int32 {
  62964 	var e DWORD = (*(*func(*libc.TLS) DWORD)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8)))(tls)
  62965 	_ = pVfs
  62966 	if nBuf > 0 {
  62967 		winGetLastErrorMsg(tls, e, nBuf, zBuf)
  62968 	}
  62969 	return int32(e)
  62970 }
  62971 
  62972 // Initialize and deinitialize the operating system interface.
  62973 func Xsqlite3_os_init(tls *libc.TLS) int32 {
  62974 	libc.Xmemset(tls, uintptr(unsafe.Pointer(&winSysInfo)), 0, uint64(unsafe.Sizeof(SYSTEM_INFO{})))
  62975 	(*(*func(*libc.TLS, LPSYSTEM_INFO))(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 28*24 + 8)))(tls, uintptr(unsafe.Pointer(&winSysInfo)))
  62976 
  62977 	Xsqlite3_vfs_register(tls, uintptr(unsafe.Pointer(&winVfs)), 1)
  62978 
  62979 	Xsqlite3_vfs_register(tls, uintptr(unsafe.Pointer(&winLongPathVfs)), 0)
  62980 
  62981 	Xsqlite3_vfs_register(tls, uintptr(unsafe.Pointer(&winNolockVfs)), 0)
  62982 
  62983 	Xsqlite3_vfs_register(tls, uintptr(unsafe.Pointer(&winLongPathNolockVfs)), 0)
  62984 
  62985 	winBigLock = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_VFS1)
  62986 
  62987 	return SQLITE_OK
  62988 }
  62989 
  62990 var winVfs = Sqlite3_vfs{
  62991 	FiVersion:          3,
  62992 	FszOsFile:          int32(unsafe.Sizeof(WinFile{})),
  62993 	FmxPathname:        MAX_PATH * 4,
  62994 	FzName:             ts + 5135,
  62995 	FpAppData:          0,
  62996 	FxOpen:             0,
  62997 	FxDelete:           0,
  62998 	FxAccess:           0,
  62999 	FxFullPathname:     0,
  63000 	FxDlOpen:           0,
  63001 	FxDlError:          0,
  63002 	FxDlSym:            0,
  63003 	FxDlClose:          0,
  63004 	FxRandomness:       0,
  63005 	FxSleep:            0,
  63006 	FxCurrentTime:      0,
  63007 	FxGetLastError:     0,
  63008 	FxCurrentTimeInt64: 0,
  63009 	FxSetSystemCall:    0,
  63010 	FxGetSystemCall:    0,
  63011 	FxNextSystemCall:   0,
  63012 }
  63013 var winLongPathVfs = Sqlite3_vfs{
  63014 	FiVersion:          3,
  63015 	FszOsFile:          int32(unsafe.Sizeof(WinFile{})),
  63016 	FmxPathname:        int32(uint64(unsafe.Sizeof(WCHAR(0))) * uint64(32767)),
  63017 	FzName:             ts + 5141,
  63018 	FpAppData:          0,
  63019 	FxOpen:             0,
  63020 	FxDelete:           0,
  63021 	FxAccess:           0,
  63022 	FxFullPathname:     0,
  63023 	FxDlOpen:           0,
  63024 	FxDlError:          0,
  63025 	FxDlSym:            0,
  63026 	FxDlClose:          0,
  63027 	FxRandomness:       0,
  63028 	FxSleep:            0,
  63029 	FxCurrentTime:      0,
  63030 	FxGetLastError:     0,
  63031 	FxCurrentTimeInt64: 0,
  63032 	FxSetSystemCall:    0,
  63033 	FxGetSystemCall:    0,
  63034 	FxNextSystemCall:   0,
  63035 }
  63036 var winNolockVfs = Sqlite3_vfs{
  63037 	FiVersion:          3,
  63038 	FszOsFile:          int32(unsafe.Sizeof(WinFile{})),
  63039 	FmxPathname:        MAX_PATH * 4,
  63040 	FzName:             ts + 5156,
  63041 	FpAppData:          0,
  63042 	FxOpen:             0,
  63043 	FxDelete:           0,
  63044 	FxAccess:           0,
  63045 	FxFullPathname:     0,
  63046 	FxDlOpen:           0,
  63047 	FxDlError:          0,
  63048 	FxDlSym:            0,
  63049 	FxDlClose:          0,
  63050 	FxRandomness:       0,
  63051 	FxSleep:            0,
  63052 	FxCurrentTime:      0,
  63053 	FxGetLastError:     0,
  63054 	FxCurrentTimeInt64: 0,
  63055 	FxSetSystemCall:    0,
  63056 	FxGetSystemCall:    0,
  63057 	FxNextSystemCall:   0,
  63058 }
  63059 var winLongPathNolockVfs = Sqlite3_vfs{
  63060 	FiVersion:          3,
  63061 	FszOsFile:          int32(unsafe.Sizeof(WinFile{})),
  63062 	FmxPathname:        int32(uint64(unsafe.Sizeof(WCHAR(0))) * uint64(32767)),
  63063 	FzName:             ts + 5167,
  63064 	FpAppData:          0,
  63065 	FxOpen:             0,
  63066 	FxDelete:           0,
  63067 	FxAccess:           0,
  63068 	FxFullPathname:     0,
  63069 	FxDlOpen:           0,
  63070 	FxDlError:          0,
  63071 	FxDlSym:            0,
  63072 	FxDlClose:          0,
  63073 	FxRandomness:       0,
  63074 	FxSleep:            0,
  63075 	FxCurrentTime:      0,
  63076 	FxGetLastError:     0,
  63077 	FxCurrentTimeInt64: 0,
  63078 	FxSetSystemCall:    0,
  63079 	FxGetSystemCall:    0,
  63080 	FxNextSystemCall:   0,
  63081 }
  63082 
  63083 func Xsqlite3_os_end(tls *libc.TLS) int32 {
  63084 	winBigLock = uintptr(0)
  63085 
  63086 	return SQLITE_OK
  63087 }
  63088 
  63089 // Forward declaration of objects used by this utility
  63090 type MemVfs = sqlite3_vfs
  63091 type MemFile1 = struct {
  63092 	Fbase        Sqlite3_file
  63093 	FpStore      uintptr
  63094 	FeLock       int32
  63095 	F__ccgo_pad1 [4]byte
  63096 }
  63097 
  63098 type MemFile = MemFile1
  63099 type MemStore1 = struct {
  63100 	Fsz          Sqlite3_int64
  63101 	FszAlloc     Sqlite3_int64
  63102 	FszMax       Sqlite3_int64
  63103 	FaData       uintptr
  63104 	FpMutex      uintptr
  63105 	FnMmap       int32
  63106 	FmFlags      uint32
  63107 	FnRdLock     int32
  63108 	FnWrLock     int32
  63109 	FnRef        int32
  63110 	F__ccgo_pad1 [4]byte
  63111 	FzFName      uintptr
  63112 }
  63113 
  63114 type MemStore = MemStore1
  63115 
  63116 // File-scope variables for holding the memdb files that are accessible
  63117 // to multiple database connections in separate threads.
  63118 //
  63119 // Must hold SQLITE_MUTEX_STATIC_VFS1 to access any part of this object.
  63120 type MemFS = struct {
  63121 	FnMemStore   int32
  63122 	F__ccgo_pad1 [4]byte
  63123 	FapMemStore  uintptr
  63124 }
  63125 
  63126 var memdb_g MemFS
  63127 
  63128 var memdb_vfs = Sqlite3_vfs{
  63129 	FiVersion:          2,
  63130 	FmxPathname:        1024,
  63131 	FzName:             ts + 5187,
  63132 	FxOpen:             0,
  63133 	FxAccess:           0,
  63134 	FxFullPathname:     0,
  63135 	FxDlOpen:           0,
  63136 	FxDlError:          0,
  63137 	FxDlSym:            0,
  63138 	FxDlClose:          0,
  63139 	FxRandomness:       0,
  63140 	FxSleep:            0,
  63141 	FxGetLastError:     0,
  63142 	FxCurrentTimeInt64: 0,
  63143 }
  63144 
  63145 var memdb_io_methods = Sqlite3_io_methods{
  63146 	FiVersion:               3,
  63147 	FxClose:                 0,
  63148 	FxRead:                  0,
  63149 	FxWrite:                 0,
  63150 	FxTruncate:              0,
  63151 	FxSync:                  0,
  63152 	FxFileSize:              0,
  63153 	FxLock:                  0,
  63154 	FxUnlock:                0,
  63155 	FxFileControl:           0,
  63156 	FxDeviceCharacteristics: 0,
  63157 	FxFetch:                 0,
  63158 	FxUnfetch:               0,
  63159 }
  63160 
  63161 func memdbEnter(tls *libc.TLS, p uintptr) {
  63162 	Xsqlite3_mutex_enter(tls, (*MemStore)(unsafe.Pointer(p)).FpMutex)
  63163 }
  63164 
  63165 func memdbLeave(tls *libc.TLS, p uintptr) {
  63166 	Xsqlite3_mutex_leave(tls, (*MemStore)(unsafe.Pointer(p)).FpMutex)
  63167 }
  63168 
  63169 func memdbClose(tls *libc.TLS, pFile uintptr) int32 {
  63170 	var p uintptr = (*MemFile)(unsafe.Pointer(pFile)).FpStore
  63171 	if (*MemStore)(unsafe.Pointer(p)).FzFName != 0 {
  63172 		var i int32
  63173 		var pVfsMutex uintptr = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_VFS1)
  63174 		Xsqlite3_mutex_enter(tls, pVfsMutex)
  63175 		for i = 0; i < memdb_g.FnMemStore; i++ {
  63176 			if *(*uintptr)(unsafe.Pointer(memdb_g.FapMemStore + uintptr(i)*8)) == p {
  63177 				memdbEnter(tls, p)
  63178 				if (*MemStore)(unsafe.Pointer(p)).FnRef == 1 {
  63179 					*(*uintptr)(unsafe.Pointer(memdb_g.FapMemStore + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(memdb_g.FapMemStore + uintptr(libc.PreDecInt32(&memdb_g.FnMemStore, 1))*8))
  63180 					if memdb_g.FnMemStore == 0 {
  63181 						Xsqlite3_free(tls, memdb_g.FapMemStore)
  63182 						memdb_g.FapMemStore = uintptr(0)
  63183 					}
  63184 				}
  63185 				break
  63186 			}
  63187 		}
  63188 		Xsqlite3_mutex_leave(tls, pVfsMutex)
  63189 	} else {
  63190 		memdbEnter(tls, p)
  63191 	}
  63192 	(*MemStore)(unsafe.Pointer(p)).FnRef--
  63193 	if (*MemStore)(unsafe.Pointer(p)).FnRef <= 0 {
  63194 		if (*MemStore)(unsafe.Pointer(p)).FmFlags&uint32(SQLITE_DESERIALIZE_FREEONCLOSE) != 0 {
  63195 			Xsqlite3_free(tls, (*MemStore)(unsafe.Pointer(p)).FaData)
  63196 		}
  63197 		memdbLeave(tls, p)
  63198 		Xsqlite3_mutex_free(tls, (*MemStore)(unsafe.Pointer(p)).FpMutex)
  63199 		Xsqlite3_free(tls, p)
  63200 	} else {
  63201 		memdbLeave(tls, p)
  63202 	}
  63203 	return SQLITE_OK
  63204 }
  63205 
  63206 func memdbRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 {
  63207 	var p uintptr = (*MemFile)(unsafe.Pointer(pFile)).FpStore
  63208 	memdbEnter(tls, p)
  63209 	if iOfst+Sqlite_int64(iAmt) > (*MemStore)(unsafe.Pointer(p)).Fsz {
  63210 		libc.Xmemset(tls, zBuf, 0, uint64(iAmt))
  63211 		if iOfst < (*MemStore)(unsafe.Pointer(p)).Fsz {
  63212 			libc.Xmemcpy(tls, zBuf, (*MemStore)(unsafe.Pointer(p)).FaData+uintptr(iOfst), uint64((*MemStore)(unsafe.Pointer(p)).Fsz-iOfst))
  63213 		}
  63214 		memdbLeave(tls, p)
  63215 		return SQLITE_IOERR | int32(2)<<8
  63216 	}
  63217 	libc.Xmemcpy(tls, zBuf, (*MemStore)(unsafe.Pointer(p)).FaData+uintptr(iOfst), uint64(iAmt))
  63218 	memdbLeave(tls, p)
  63219 	return SQLITE_OK
  63220 }
  63221 
  63222 func memdbEnlarge(tls *libc.TLS, p uintptr, newSz Sqlite3_int64) int32 {
  63223 	var pNew uintptr
  63224 	if (*MemStore)(unsafe.Pointer(p)).FmFlags&uint32(SQLITE_DESERIALIZE_RESIZEABLE) == uint32(0) || (*MemStore)(unsafe.Pointer(p)).FnMmap > 0 {
  63225 		return SQLITE_FULL
  63226 	}
  63227 	if newSz > (*MemStore)(unsafe.Pointer(p)).FszMax {
  63228 		return SQLITE_FULL
  63229 	}
  63230 	newSz = newSz * int64(2)
  63231 	if newSz > (*MemStore)(unsafe.Pointer(p)).FszMax {
  63232 		newSz = (*MemStore)(unsafe.Pointer(p)).FszMax
  63233 	}
  63234 	pNew = Xsqlite3Realloc(tls, (*MemStore)(unsafe.Pointer(p)).FaData, uint64(newSz))
  63235 	if pNew == uintptr(0) {
  63236 		return SQLITE_IOERR | int32(12)<<8
  63237 	}
  63238 	(*MemStore)(unsafe.Pointer(p)).FaData = pNew
  63239 	(*MemStore)(unsafe.Pointer(p)).FszAlloc = newSz
  63240 	return SQLITE_OK
  63241 }
  63242 
  63243 func memdbWrite(tls *libc.TLS, pFile uintptr, z uintptr, iAmt int32, iOfst Sqlite_int64) int32 {
  63244 	var p uintptr = (*MemFile)(unsafe.Pointer(pFile)).FpStore
  63245 	memdbEnter(tls, p)
  63246 	if (*MemStore)(unsafe.Pointer(p)).FmFlags&uint32(SQLITE_DESERIALIZE_READONLY) != 0 {
  63247 		memdbLeave(tls, p)
  63248 		return SQLITE_IOERR | int32(3)<<8
  63249 	}
  63250 	if iOfst+Sqlite_int64(iAmt) > (*MemStore)(unsafe.Pointer(p)).Fsz {
  63251 		var rc int32
  63252 		if iOfst+Sqlite_int64(iAmt) > (*MemStore)(unsafe.Pointer(p)).FszAlloc &&
  63253 			libc.AssignInt32(&rc, memdbEnlarge(tls, p, iOfst+Sqlite_int64(iAmt))) != SQLITE_OK {
  63254 			memdbLeave(tls, p)
  63255 			return rc
  63256 		}
  63257 		if iOfst > (*MemStore)(unsafe.Pointer(p)).Fsz {
  63258 			libc.Xmemset(tls, (*MemStore)(unsafe.Pointer(p)).FaData+uintptr((*MemStore)(unsafe.Pointer(p)).Fsz), 0, uint64(iOfst-(*MemStore)(unsafe.Pointer(p)).Fsz))
  63259 		}
  63260 		(*MemStore)(unsafe.Pointer(p)).Fsz = iOfst + Sqlite_int64(iAmt)
  63261 	}
  63262 	libc.Xmemcpy(tls, (*MemStore)(unsafe.Pointer(p)).FaData+uintptr(iOfst), z, uint64(iAmt))
  63263 	memdbLeave(tls, p)
  63264 	return SQLITE_OK
  63265 }
  63266 
  63267 func memdbTruncate(tls *libc.TLS, pFile uintptr, size Sqlite_int64) int32 {
  63268 	var p uintptr = (*MemFile)(unsafe.Pointer(pFile)).FpStore
  63269 	var rc int32 = SQLITE_OK
  63270 	memdbEnter(tls, p)
  63271 	if size > (*MemStore)(unsafe.Pointer(p)).Fsz {
  63272 		rc = SQLITE_CORRUPT
  63273 	} else {
  63274 		(*MemStore)(unsafe.Pointer(p)).Fsz = size
  63275 	}
  63276 	memdbLeave(tls, p)
  63277 	return rc
  63278 }
  63279 
  63280 func memdbSync(tls *libc.TLS, pFile uintptr, flags int32) int32 {
  63281 	_ = pFile
  63282 	_ = flags
  63283 	return SQLITE_OK
  63284 }
  63285 
  63286 func memdbFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 {
  63287 	var p uintptr = (*MemFile)(unsafe.Pointer(pFile)).FpStore
  63288 	memdbEnter(tls, p)
  63289 	*(*Sqlite_int64)(unsafe.Pointer(pSize)) = (*MemStore)(unsafe.Pointer(p)).Fsz
  63290 	memdbLeave(tls, p)
  63291 	return SQLITE_OK
  63292 }
  63293 
  63294 func memdbLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 {
  63295 	var pThis uintptr = pFile
  63296 	var p uintptr = (*MemFile)(unsafe.Pointer(pThis)).FpStore
  63297 	var rc int32 = SQLITE_OK
  63298 	if eLock <= (*MemFile)(unsafe.Pointer(pThis)).FeLock {
  63299 		return SQLITE_OK
  63300 	}
  63301 	memdbEnter(tls, p)
  63302 
  63303 	if eLock > SQLITE_LOCK_SHARED && (*MemStore)(unsafe.Pointer(p)).FmFlags&uint32(SQLITE_DESERIALIZE_READONLY) != 0 {
  63304 		rc = SQLITE_READONLY
  63305 	} else {
  63306 		switch eLock {
  63307 		case SQLITE_LOCK_SHARED:
  63308 			{
  63309 				if (*MemStore)(unsafe.Pointer(p)).FnWrLock > 0 {
  63310 					rc = SQLITE_BUSY
  63311 				} else {
  63312 					(*MemStore)(unsafe.Pointer(p)).FnRdLock++
  63313 				}
  63314 				break
  63315 
  63316 			}
  63317 
  63318 			fallthrough
  63319 
  63320 		case SQLITE_LOCK_RESERVED:
  63321 			fallthrough
  63322 		case SQLITE_LOCK_PENDING:
  63323 			{
  63324 				if (*MemFile)(unsafe.Pointer(pThis)).FeLock == SQLITE_LOCK_SHARED {
  63325 					if (*MemStore)(unsafe.Pointer(p)).FnWrLock > 0 {
  63326 						rc = SQLITE_BUSY
  63327 					} else {
  63328 						(*MemStore)(unsafe.Pointer(p)).FnWrLock = 1
  63329 					}
  63330 				}
  63331 				break
  63332 
  63333 			}
  63334 			fallthrough
  63335 
  63336 		default:
  63337 			{
  63338 				if (*MemStore)(unsafe.Pointer(p)).FnRdLock > 1 {
  63339 					rc = SQLITE_BUSY
  63340 				} else if (*MemFile)(unsafe.Pointer(pThis)).FeLock == SQLITE_LOCK_SHARED {
  63341 					(*MemStore)(unsafe.Pointer(p)).FnWrLock = 1
  63342 				}
  63343 				break
  63344 
  63345 			}
  63346 		}
  63347 	}
  63348 	if rc == SQLITE_OK {
  63349 		(*MemFile)(unsafe.Pointer(pThis)).FeLock = eLock
  63350 	}
  63351 	memdbLeave(tls, p)
  63352 	return rc
  63353 }
  63354 
  63355 func memdbUnlock(tls *libc.TLS, pFile uintptr, eLock int32) int32 {
  63356 	var pThis uintptr = pFile
  63357 	var p uintptr = (*MemFile)(unsafe.Pointer(pThis)).FpStore
  63358 	if eLock >= (*MemFile)(unsafe.Pointer(pThis)).FeLock {
  63359 		return SQLITE_OK
  63360 	}
  63361 	memdbEnter(tls, p)
  63362 
  63363 	if eLock == SQLITE_LOCK_SHARED {
  63364 		if (*MemFile)(unsafe.Pointer(pThis)).FeLock > SQLITE_LOCK_SHARED {
  63365 			(*MemStore)(unsafe.Pointer(p)).FnWrLock--
  63366 		}
  63367 	} else {
  63368 		if (*MemFile)(unsafe.Pointer(pThis)).FeLock > SQLITE_LOCK_SHARED {
  63369 			(*MemStore)(unsafe.Pointer(p)).FnWrLock--
  63370 		}
  63371 		(*MemStore)(unsafe.Pointer(p)).FnRdLock--
  63372 	}
  63373 
  63374 	(*MemFile)(unsafe.Pointer(pThis)).FeLock = eLock
  63375 	memdbLeave(tls, p)
  63376 	return SQLITE_OK
  63377 }
  63378 
  63379 func memdbFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 {
  63380 	bp := tls.Alloc(16)
  63381 	defer tls.Free(16)
  63382 
  63383 	var p uintptr = (*MemFile)(unsafe.Pointer(pFile)).FpStore
  63384 	var rc int32 = SQLITE_NOTFOUND
  63385 	memdbEnter(tls, p)
  63386 	if op == SQLITE_FCNTL_VFSNAME {
  63387 		*(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, ts+5193, libc.VaList(bp, (*MemStore)(unsafe.Pointer(p)).FaData, (*MemStore)(unsafe.Pointer(p)).Fsz))
  63388 		rc = SQLITE_OK
  63389 	}
  63390 	if op == SQLITE_FCNTL_SIZE_LIMIT {
  63391 		var iLimit Sqlite3_int64 = *(*Sqlite3_int64)(unsafe.Pointer(pArg))
  63392 		if iLimit < (*MemStore)(unsafe.Pointer(p)).Fsz {
  63393 			if iLimit < int64(0) {
  63394 				iLimit = (*MemStore)(unsafe.Pointer(p)).FszMax
  63395 			} else {
  63396 				iLimit = (*MemStore)(unsafe.Pointer(p)).Fsz
  63397 			}
  63398 		}
  63399 		(*MemStore)(unsafe.Pointer(p)).FszMax = iLimit
  63400 		*(*Sqlite3_int64)(unsafe.Pointer(pArg)) = iLimit
  63401 		rc = SQLITE_OK
  63402 	}
  63403 	memdbLeave(tls, p)
  63404 	return rc
  63405 }
  63406 
  63407 func memdbDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 {
  63408 	_ = pFile
  63409 	return SQLITE_IOCAP_ATOMIC | SQLITE_IOCAP_POWERSAFE_OVERWRITE | SQLITE_IOCAP_SAFE_APPEND | SQLITE_IOCAP_SEQUENTIAL
  63410 }
  63411 
  63412 func memdbFetch(tls *libc.TLS, pFile uintptr, iOfst Sqlite3_int64, iAmt int32, pp uintptr) int32 {
  63413 	var p uintptr = (*MemFile)(unsafe.Pointer(pFile)).FpStore
  63414 	memdbEnter(tls, p)
  63415 	if iOfst+Sqlite3_int64(iAmt) > (*MemStore)(unsafe.Pointer(p)).Fsz || (*MemStore)(unsafe.Pointer(p)).FmFlags&uint32(SQLITE_DESERIALIZE_RESIZEABLE) != uint32(0) {
  63416 		*(*uintptr)(unsafe.Pointer(pp)) = uintptr(0)
  63417 	} else {
  63418 		(*MemStore)(unsafe.Pointer(p)).FnMmap++
  63419 		*(*uintptr)(unsafe.Pointer(pp)) = (*MemStore)(unsafe.Pointer(p)).FaData + uintptr(iOfst)
  63420 	}
  63421 	memdbLeave(tls, p)
  63422 	return SQLITE_OK
  63423 }
  63424 
  63425 func memdbUnfetch(tls *libc.TLS, pFile uintptr, iOfst Sqlite3_int64, pPage uintptr) int32 {
  63426 	var p uintptr = (*MemFile)(unsafe.Pointer(pFile)).FpStore
  63427 	_ = iOfst
  63428 	_ = pPage
  63429 	memdbEnter(tls, p)
  63430 	(*MemStore)(unsafe.Pointer(p)).FnMmap--
  63431 	memdbLeave(tls, p)
  63432 	return SQLITE_OK
  63433 }
  63434 
  63435 func memdbOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFd uintptr, flags int32, pOutFlags uintptr) int32 {
  63436 	var pFile uintptr = pFd
  63437 	var p uintptr = uintptr(0)
  63438 	var szName int32
  63439 	_ = pVfs
  63440 
  63441 	libc.Xmemset(tls, pFile, 0, uint64(unsafe.Sizeof(MemFile{})))
  63442 	szName = Xsqlite3Strlen30(tls, zName)
  63443 	if szName > 1 && (int32(*(*int8)(unsafe.Pointer(zName))) == '/' || int32(*(*int8)(unsafe.Pointer(zName))) == '\\') {
  63444 		var i int32
  63445 		var pVfsMutex uintptr = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_VFS1)
  63446 		Xsqlite3_mutex_enter(tls, pVfsMutex)
  63447 		for i = 0; i < memdb_g.FnMemStore; i++ {
  63448 			if libc.Xstrcmp(tls, (*MemStore)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(memdb_g.FapMemStore + uintptr(i)*8)))).FzFName, zName) == 0 {
  63449 				p = *(*uintptr)(unsafe.Pointer(memdb_g.FapMemStore + uintptr(i)*8))
  63450 				break
  63451 			}
  63452 		}
  63453 		if p == uintptr(0) {
  63454 			var apNew uintptr
  63455 			p = Xsqlite3Malloc(tls, uint64(unsafe.Sizeof(MemStore{}))+uint64(szName)+uint64(3))
  63456 			if p == uintptr(0) {
  63457 				Xsqlite3_mutex_leave(tls, pVfsMutex)
  63458 				return SQLITE_NOMEM
  63459 			}
  63460 			apNew = Xsqlite3Realloc(tls, memdb_g.FapMemStore,
  63461 				uint64(unsafe.Sizeof(uintptr(0)))*uint64(memdb_g.FnMemStore+1))
  63462 			if apNew == uintptr(0) {
  63463 				Xsqlite3_free(tls, p)
  63464 				Xsqlite3_mutex_leave(tls, pVfsMutex)
  63465 				return SQLITE_NOMEM
  63466 			}
  63467 			*(*uintptr)(unsafe.Pointer(apNew + uintptr(libc.PostIncInt32(&memdb_g.FnMemStore, 1))*8)) = p
  63468 			memdb_g.FapMemStore = apNew
  63469 			libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(MemStore{})))
  63470 			(*MemStore)(unsafe.Pointer(p)).FmFlags = uint32(SQLITE_DESERIALIZE_RESIZEABLE | SQLITE_DESERIALIZE_FREEONCLOSE)
  63471 			(*MemStore)(unsafe.Pointer(p)).FszMax = Xsqlite3Config.FmxMemdbSize
  63472 			(*MemStore)(unsafe.Pointer(p)).FzFName = p + 1*72
  63473 			libc.Xmemcpy(tls, (*MemStore)(unsafe.Pointer(p)).FzFName, zName, uint64(szName+1))
  63474 			(*MemStore)(unsafe.Pointer(p)).FpMutex = Xsqlite3_mutex_alloc(tls, SQLITE_MUTEX_FAST)
  63475 			if (*MemStore)(unsafe.Pointer(p)).FpMutex == uintptr(0) {
  63476 				memdb_g.FnMemStore--
  63477 				Xsqlite3_free(tls, p)
  63478 				Xsqlite3_mutex_leave(tls, pVfsMutex)
  63479 				return SQLITE_NOMEM
  63480 			}
  63481 			(*MemStore)(unsafe.Pointer(p)).FnRef = 1
  63482 			memdbEnter(tls, p)
  63483 		} else {
  63484 			memdbEnter(tls, p)
  63485 			(*MemStore)(unsafe.Pointer(p)).FnRef++
  63486 		}
  63487 		Xsqlite3_mutex_leave(tls, pVfsMutex)
  63488 	} else {
  63489 		p = Xsqlite3Malloc(tls, uint64(unsafe.Sizeof(MemStore{})))
  63490 		if p == uintptr(0) {
  63491 			return SQLITE_NOMEM
  63492 		}
  63493 		libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(MemStore{})))
  63494 		(*MemStore)(unsafe.Pointer(p)).FmFlags = uint32(SQLITE_DESERIALIZE_RESIZEABLE | SQLITE_DESERIALIZE_FREEONCLOSE)
  63495 		(*MemStore)(unsafe.Pointer(p)).FszMax = Xsqlite3Config.FmxMemdbSize
  63496 	}
  63497 	(*MemFile)(unsafe.Pointer(pFile)).FpStore = p
  63498 	if pOutFlags != uintptr(0) {
  63499 		*(*int32)(unsafe.Pointer(pOutFlags)) = flags | SQLITE_OPEN_MEMORY
  63500 	}
  63501 	(*Sqlite3_file)(unsafe.Pointer(pFd)).FpMethods = uintptr(unsafe.Pointer(&memdb_io_methods))
  63502 	memdbLeave(tls, p)
  63503 	return SQLITE_OK
  63504 }
  63505 
  63506 func memdbAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 {
  63507 	_ = pVfs
  63508 	_ = zPath
  63509 	_ = flags
  63510 	*(*int32)(unsafe.Pointer(pResOut)) = 0
  63511 	return SQLITE_OK
  63512 }
  63513 
  63514 func memdbFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 {
  63515 	bp := tls.Alloc(8)
  63516 	defer tls.Free(8)
  63517 
  63518 	_ = pVfs
  63519 	Xsqlite3_snprintf(tls, nOut, zOut, ts+4493, libc.VaList(bp, zPath))
  63520 	return SQLITE_OK
  63521 }
  63522 
  63523 func memdbDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr {
  63524 	return (*struct {
  63525 		f func(*libc.TLS, uintptr, uintptr) uintptr
  63526 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FxDlOpen})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zPath)
  63527 }
  63528 
  63529 func memdbDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) {
  63530 	(*struct {
  63531 		f func(*libc.TLS, uintptr, int32, uintptr)
  63532 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FxDlError})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nByte, zErrMsg)
  63533 }
  63534 
  63535 func memdbDlSym(tls *libc.TLS, pVfs uintptr, p uintptr, zSym uintptr) uintptr {
  63536 	return (*struct {
  63537 		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
  63538 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FxDlSym})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, p, zSym)
  63539 }
  63540 
  63541 func memdbDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) {
  63542 	(*struct {
  63543 		f func(*libc.TLS, uintptr, uintptr)
  63544 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FxDlClose})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, pHandle)
  63545 }
  63546 
  63547 func memdbRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 {
  63548 	return (*struct {
  63549 		f func(*libc.TLS, uintptr, int32, uintptr) int32
  63550 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FxRandomness})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nByte, zBufOut)
  63551 }
  63552 
  63553 func memdbSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 {
  63554 	return (*struct {
  63555 		f func(*libc.TLS, uintptr, int32) int32
  63556 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FxSleep})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nMicro)
  63557 }
  63558 
  63559 func memdbGetLastError(tls *libc.TLS, pVfs uintptr, a int32, b uintptr) int32 {
  63560 	return (*struct {
  63561 		f func(*libc.TLS, uintptr, int32, uintptr) int32
  63562 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FxGetLastError})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, a, b)
  63563 }
  63564 
  63565 func memdbCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, p uintptr) int32 {
  63566 	return (*struct {
  63567 		f func(*libc.TLS, uintptr, uintptr) int32
  63568 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FxCurrentTimeInt64})).f(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, p)
  63569 }
  63570 
  63571 func memdbFromDbSchema(tls *libc.TLS, db uintptr, zSchema uintptr) uintptr {
  63572 	bp := tls.Alloc(8)
  63573 	defer tls.Free(8)
  63574 
  63575 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
  63576 	var pStore uintptr
  63577 	var rc int32 = Xsqlite3_file_control(tls, db, zSchema, SQLITE_FCNTL_FILE_POINTER, bp)
  63578 	if rc != 0 {
  63579 		return uintptr(0)
  63580 	}
  63581 	if (*MemFile)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FpMethods != uintptr(unsafe.Pointer(&memdb_io_methods)) {
  63582 		return uintptr(0)
  63583 	}
  63584 	pStore = (*MemFile)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpStore
  63585 	memdbEnter(tls, pStore)
  63586 	if (*MemStore)(unsafe.Pointer(pStore)).FzFName != uintptr(0) {
  63587 		*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
  63588 	}
  63589 	memdbLeave(tls, pStore)
  63590 	return *(*uintptr)(unsafe.Pointer(bp))
  63591 }
  63592 
  63593 // Return the serialization of a database
  63594 func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintptr, mFlags uint32) uintptr {
  63595 	bp := tls.Alloc(24)
  63596 	defer tls.Free(24)
  63597 
  63598 	var p uintptr
  63599 	var iDb int32
  63600 	var pBt uintptr
  63601 	var sz Sqlite3_int64
  63602 	var szPage int32 = 0
  63603 	*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
  63604 	var pOut uintptr
  63605 	var zSql uintptr
  63606 	var rc int32
  63607 
  63608 	if zSchema == uintptr(0) {
  63609 		zSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FzDbSName
  63610 	}
  63611 	p = memdbFromDbSchema(tls, db, zSchema)
  63612 	iDb = Xsqlite3FindDbName(tls, db, zSchema)
  63613 	if piSize != 0 {
  63614 		*(*Sqlite3_int64)(unsafe.Pointer(piSize)) = int64(-1)
  63615 	}
  63616 	if iDb < 0 {
  63617 		return uintptr(0)
  63618 	}
  63619 	if p != 0 {
  63620 		var pStore uintptr = (*MemFile)(unsafe.Pointer(p)).FpStore
  63621 
  63622 		if piSize != 0 {
  63623 			*(*Sqlite3_int64)(unsafe.Pointer(piSize)) = (*MemStore)(unsafe.Pointer(pStore)).Fsz
  63624 		}
  63625 		if mFlags&uint32(SQLITE_SERIALIZE_NOCOPY) != 0 {
  63626 			pOut = (*MemStore)(unsafe.Pointer(pStore)).FaData
  63627 		} else {
  63628 			pOut = Xsqlite3_malloc64(tls, uint64((*MemStore)(unsafe.Pointer(pStore)).Fsz))
  63629 			if pOut != 0 {
  63630 				libc.Xmemcpy(tls, pOut, (*MemStore)(unsafe.Pointer(pStore)).FaData, uint64((*MemStore)(unsafe.Pointer(pStore)).Fsz))
  63631 			}
  63632 		}
  63633 		return pOut
  63634 	}
  63635 	pBt = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpBt
  63636 	if pBt == uintptr(0) {
  63637 		return uintptr(0)
  63638 	}
  63639 	szPage = Xsqlite3BtreeGetPageSize(tls, pBt)
  63640 	zSql = Xsqlite3_mprintf(tls, ts+5208, libc.VaList(bp, zSchema))
  63641 	if zSql != 0 {
  63642 		rc = Xsqlite3_prepare_v2(tls, db, zSql, -1, bp+8, uintptr(0))
  63643 	} else {
  63644 		rc = SQLITE_NOMEM
  63645 	}
  63646 	Xsqlite3_free(tls, zSql)
  63647 	if rc != 0 {
  63648 		return uintptr(0)
  63649 	}
  63650 	rc = Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
  63651 	if rc != SQLITE_ROW {
  63652 		pOut = uintptr(0)
  63653 	} else {
  63654 		sz = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), 0) * Sqlite_int64(szPage)
  63655 		if piSize != 0 {
  63656 			*(*Sqlite3_int64)(unsafe.Pointer(piSize)) = sz
  63657 		}
  63658 		if mFlags&uint32(SQLITE_SERIALIZE_NOCOPY) != 0 {
  63659 			pOut = uintptr(0)
  63660 		} else {
  63661 			pOut = Xsqlite3_malloc64(tls, uint64(sz))
  63662 			if pOut != 0 {
  63663 				var nPage int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), 0)
  63664 				var pPager uintptr = Xsqlite3BtreePager(tls, pBt)
  63665 				var pgno int32
  63666 				for pgno = 1; pgno <= nPage; pgno++ {
  63667 					*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
  63668 					var pTo uintptr = pOut + uintptr(Sqlite3_int64(szPage)*Sqlite3_int64(pgno-1))
  63669 					rc = Xsqlite3PagerGet(tls, pPager, uint32(pgno), bp+16, 0)
  63670 					if rc == SQLITE_OK {
  63671 						libc.Xmemcpy(tls, pTo, Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp + 16))), uint64(szPage))
  63672 					} else {
  63673 						libc.Xmemset(tls, pTo, 0, uint64(szPage))
  63674 					}
  63675 					Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
  63676 				}
  63677 			}
  63678 		}
  63679 	}
  63680 	Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
  63681 	return pOut
  63682 }
  63683 
  63684 // Convert zSchema to a MemDB and initialize its content.
  63685 func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uintptr, szDb Sqlite3_int64, szBuf Sqlite3_int64, mFlags uint32) int32 {
  63686 	bp := tls.Alloc(16)
  63687 	defer tls.Free(16)
  63688 
  63689 	var p uintptr
  63690 	var zSql uintptr
  63691 
  63692 	var rc int32
  63693 	var iDb int32
  63694 	var pStore uintptr
  63695 	*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
  63696 
  63697 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
  63698 	if !(zSchema == uintptr(0)) {
  63699 		goto __1
  63700 	}
  63701 	zSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FzDbSName
  63702 __1:
  63703 	;
  63704 	iDb = Xsqlite3FindDbName(tls, db, zSchema)
  63705 
  63706 	if !(iDb < 2 && iDb != 0) {
  63707 		goto __2
  63708 	}
  63709 	rc = SQLITE_ERROR
  63710 	goto end_deserialize
  63711 __2:
  63712 	;
  63713 	zSql = Xsqlite3_mprintf(tls, ts+5231, libc.VaList(bp, zSchema))
  63714 	if !(zSql == uintptr(0)) {
  63715 		goto __3
  63716 	}
  63717 	rc = SQLITE_NOMEM
  63718 	goto __4
  63719 __3:
  63720 	rc = Xsqlite3_prepare_v2(tls, db, zSql, -1, bp+8, uintptr(0))
  63721 	Xsqlite3_free(tls, zSql)
  63722 __4:
  63723 	;
  63724 	if !(rc != 0) {
  63725 		goto __5
  63726 	}
  63727 	goto end_deserialize
  63728 __5:
  63729 	;
  63730 	(*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(iDb)
  63731 	libc.SetBitFieldPtr8Uint32(db+192+8, uint32(1), 2, 0x4)
  63732 	rc = Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
  63733 	libc.SetBitFieldPtr8Uint32(db+192+8, uint32(0), 2, 0x4)
  63734 	if !(rc != SQLITE_DONE) {
  63735 		goto __6
  63736 	}
  63737 	rc = SQLITE_ERROR
  63738 	goto end_deserialize
  63739 __6:
  63740 	;
  63741 	p = memdbFromDbSchema(tls, db, zSchema)
  63742 	if !(p == uintptr(0)) {
  63743 		goto __7
  63744 	}
  63745 	rc = SQLITE_ERROR
  63746 	goto __8
  63747 __7:
  63748 	pStore = (*MemFile)(unsafe.Pointer(p)).FpStore
  63749 	(*MemStore)(unsafe.Pointer(pStore)).FaData = pData
  63750 	pData = uintptr(0)
  63751 	(*MemStore)(unsafe.Pointer(pStore)).Fsz = szDb
  63752 	(*MemStore)(unsafe.Pointer(pStore)).FszAlloc = szBuf
  63753 	(*MemStore)(unsafe.Pointer(pStore)).FszMax = szBuf
  63754 	if !((*MemStore)(unsafe.Pointer(pStore)).FszMax < Xsqlite3Config.FmxMemdbSize) {
  63755 		goto __9
  63756 	}
  63757 	(*MemStore)(unsafe.Pointer(pStore)).FszMax = Xsqlite3Config.FmxMemdbSize
  63758 __9:
  63759 	;
  63760 	(*MemStore)(unsafe.Pointer(pStore)).FmFlags = mFlags
  63761 	rc = SQLITE_OK
  63762 __8:
  63763 	;
  63764 end_deserialize:
  63765 	Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
  63766 	if !(pData != 0 && mFlags&uint32(SQLITE_DESERIALIZE_FREEONCLOSE) != uint32(0)) {
  63767 		goto __10
  63768 	}
  63769 	Xsqlite3_free(tls, pData)
  63770 __10:
  63771 	;
  63772 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
  63773 	return rc
  63774 }
  63775 
  63776 // Return true if the VFS is the memvfs.
  63777 func Xsqlite3IsMemdb(tls *libc.TLS, pVfs uintptr) int32 {
  63778 	return libc.Bool32(pVfs == uintptr(unsafe.Pointer(&memdb_vfs)))
  63779 }
  63780 
  63781 // This routine is called when the extension is loaded.
  63782 // Register the new VFS.
  63783 func Xsqlite3MemdbInit(tls *libc.TLS) int32 {
  63784 	var pLower uintptr = Xsqlite3_vfs_find(tls, uintptr(0))
  63785 	var sz uint32
  63786 	if pLower == uintptr(0) {
  63787 		return SQLITE_ERROR
  63788 	}
  63789 	sz = uint32((*Sqlite3_vfs)(unsafe.Pointer(pLower)).FszOsFile)
  63790 	memdb_vfs.FpAppData = pLower
  63791 
  63792 	if uint64(sz) < uint64(unsafe.Sizeof(MemFile{})) {
  63793 		sz = uint32(unsafe.Sizeof(MemFile{}))
  63794 	}
  63795 	memdb_vfs.FszOsFile = int32(sz)
  63796 	return Xsqlite3_vfs_register(tls, uintptr(unsafe.Pointer(&memdb_vfs)), 0)
  63797 }
  63798 
  63799 // Create a new bitmap object able to handle bits between 0 and iSize,
  63800 // inclusive.  Return a pointer to the new object.  Return NULL if
  63801 // malloc fails.
  63802 func Xsqlite3BitvecCreate(tls *libc.TLS, iSize U32) uintptr {
  63803 	var p uintptr
  63804 
  63805 	p = Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(Bitvec{})))
  63806 	if p != 0 {
  63807 		(*Bitvec)(unsafe.Pointer(p)).FiSize = iSize
  63808 	}
  63809 	return p
  63810 }
  63811 
  63812 // Check to see if the i-th bit is set.  Return true or false.
  63813 // If p is NULL (if the bitmap has not been created) or if
  63814 // i is out of range, then return false.
  63815 func Xsqlite3BitvecTestNotNull(tls *libc.TLS, p uintptr, i U32) int32 {
  63816 	i--
  63817 	if i >= (*Bitvec)(unsafe.Pointer(p)).FiSize {
  63818 		return 0
  63819 	}
  63820 	for (*Bitvec)(unsafe.Pointer(p)).FiDivisor != 0 {
  63821 		var bin U32 = i / (*Bitvec)(unsafe.Pointer(p)).FiDivisor
  63822 		i = i % (*Bitvec)(unsafe.Pointer(p)).FiDivisor
  63823 		p = *(*uintptr)(unsafe.Pointer(p + 16 + uintptr(bin)*8))
  63824 		if !(p != 0) {
  63825 			return 0
  63826 		}
  63827 	}
  63828 	if uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (uint64(BITVEC_SZ)-uint64(3)*uint64(unsafe.Sizeof(U32(0))))/uint64(unsafe.Sizeof(uintptr(0)))*uint64(unsafe.Sizeof(uintptr(0)))/uint64(unsafe.Sizeof(U8(0)))*uint64(BITVEC_SZELEM) {
  63829 		return libc.Bool32(int32(*(*U8)(unsafe.Pointer(p + 16 + uintptr(i/U32(BITVEC_SZELEM)))))&(int32(1)<<(i&U32(BITVEC_SZELEM-1))) != 0)
  63830 	} else {
  63831 		var h U32 = U32(uint64(libc.PostIncUint32(&i, 1)*U32(1)) % ((uint64(BITVEC_SZ) - uint64(3)*uint64(unsafe.Sizeof(U32(0)))) / uint64(unsafe.Sizeof(uintptr(0))) * uint64(unsafe.Sizeof(uintptr(0))) / uint64(unsafe.Sizeof(U32(0)))))
  63832 		for *(*U32)(unsafe.Pointer(p + 16 + uintptr(h)*4)) != 0 {
  63833 			if *(*U32)(unsafe.Pointer(p + 16 + uintptr(h)*4)) == i {
  63834 				return 1
  63835 			}
  63836 			h = U32(uint64(h+U32(1)) % ((uint64(BITVEC_SZ) - uint64(3)*uint64(unsafe.Sizeof(U32(0)))) / uint64(unsafe.Sizeof(uintptr(0))) * uint64(unsafe.Sizeof(uintptr(0))) / uint64(unsafe.Sizeof(U32(0)))))
  63837 		}
  63838 		return 0
  63839 	}
  63840 	return int32(0)
  63841 }
  63842 
  63843 func Xsqlite3BitvecTest(tls *libc.TLS, p uintptr, i U32) int32 {
  63844 	return libc.Bool32(p != uintptr(0) && Xsqlite3BitvecTestNotNull(tls, p, i) != 0)
  63845 }
  63846 
  63847 // Set the i-th bit.  Return 0 on success and an error code if
  63848 // anything goes wrong.
  63849 //
  63850 // This routine might cause sub-bitmaps to be allocated.  Failing
  63851 // to get the memory needed to hold the sub-bitmap is the only
  63852 // that can go wrong with an insert, assuming p and i are valid.
  63853 //
  63854 // The calling function must ensure that p is a valid Bitvec object
  63855 // and that the value for "i" is within range of the Bitvec object.
  63856 // Otherwise the behavior is undefined.
  63857 func Xsqlite3BitvecSet(tls *libc.TLS, p uintptr, i U32) int32 {
  63858 	var h U32
  63859 	var bin U32
  63860 	var j uint32
  63861 	var rc int32
  63862 	var aiValues uintptr
  63863 	if !(p == uintptr(0)) {
  63864 		goto __1
  63865 	}
  63866 	return SQLITE_OK
  63867 __1:
  63868 	;
  63869 	i--
  63870 __2:
  63871 	if !(uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) > (uint64(BITVEC_SZ)-uint64(3)*uint64(unsafe.Sizeof(U32(0))))/uint64(unsafe.Sizeof(uintptr(0)))*uint64(unsafe.Sizeof(uintptr(0)))/uint64(unsafe.Sizeof(U8(0)))*uint64(BITVEC_SZELEM) && (*Bitvec)(unsafe.Pointer(p)).FiDivisor != 0) {
  63872 		goto __3
  63873 	}
  63874 	bin = i / (*Bitvec)(unsafe.Pointer(p)).FiDivisor
  63875 	i = i % (*Bitvec)(unsafe.Pointer(p)).FiDivisor
  63876 	if !(*(*uintptr)(unsafe.Pointer(p + 16 + uintptr(bin)*8)) == uintptr(0)) {
  63877 		goto __4
  63878 	}
  63879 	*(*uintptr)(unsafe.Pointer(p + 16 + uintptr(bin)*8)) = Xsqlite3BitvecCreate(tls, (*Bitvec)(unsafe.Pointer(p)).FiDivisor)
  63880 	if !(*(*uintptr)(unsafe.Pointer(p + 16 + uintptr(bin)*8)) == uintptr(0)) {
  63881 		goto __5
  63882 	}
  63883 	return SQLITE_NOMEM
  63884 __5:
  63885 	;
  63886 __4:
  63887 	;
  63888 	p = *(*uintptr)(unsafe.Pointer(p + 16 + uintptr(bin)*8))
  63889 	goto __2
  63890 __3:
  63891 	;
  63892 	if !(uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (uint64(BITVEC_SZ)-uint64(3)*uint64(unsafe.Sizeof(U32(0))))/uint64(unsafe.Sizeof(uintptr(0)))*uint64(unsafe.Sizeof(uintptr(0)))/uint64(unsafe.Sizeof(U8(0)))*uint64(BITVEC_SZELEM)) {
  63893 		goto __6
  63894 	}
  63895 	*(*U8)(unsafe.Pointer(p + 16 + uintptr(i/U32(BITVEC_SZELEM)))) |= U8(int32(1) << (i & U32(BITVEC_SZELEM-1)))
  63896 	return SQLITE_OK
  63897 __6:
  63898 	;
  63899 	h = U32(uint64(libc.PostIncUint32(&i, 1)*U32(1)) % ((uint64(BITVEC_SZ) - uint64(3)*uint64(unsafe.Sizeof(U32(0)))) / uint64(unsafe.Sizeof(uintptr(0))) * uint64(unsafe.Sizeof(uintptr(0))) / uint64(unsafe.Sizeof(U32(0)))))
  63900 
  63901 	if !!(int32(*(*U32)(unsafe.Pointer(p + 16 + uintptr(h)*4))) != 0) {
  63902 		goto __7
  63903 	}
  63904 	if !(uint64((*Bitvec)(unsafe.Pointer(p)).FnSet) < (uint64(BITVEC_SZ)-uint64(3)*uint64(unsafe.Sizeof(U32(0))))/uint64(unsafe.Sizeof(uintptr(0)))*uint64(unsafe.Sizeof(uintptr(0)))/uint64(unsafe.Sizeof(U32(0)))-uint64(1)) {
  63905 		goto __8
  63906 	}
  63907 	goto bitvec_set_end
  63908 	goto __9
  63909 __8:
  63910 	goto bitvec_set_rehash
  63911 __9:
  63912 	;
  63913 __7:
  63914 	;
  63915 __10:
  63916 	if !(*(*U32)(unsafe.Pointer(p + 16 + uintptr(h)*4)) == i) {
  63917 		goto __13
  63918 	}
  63919 	return SQLITE_OK
  63920 __13:
  63921 	;
  63922 	h++
  63923 	if !(uint64(h) >= (uint64(BITVEC_SZ)-uint64(3)*uint64(unsafe.Sizeof(U32(0))))/uint64(unsafe.Sizeof(uintptr(0)))*uint64(unsafe.Sizeof(uintptr(0)))/uint64(unsafe.Sizeof(U32(0)))) {
  63924 		goto __14
  63925 	}
  63926 	h = U32(0)
  63927 __14:
  63928 	;
  63929 	goto __11
  63930 __11:
  63931 	if *(*U32)(unsafe.Pointer(p + 16 + uintptr(h)*4)) != 0 {
  63932 		goto __10
  63933 	}
  63934 	goto __12
  63935 __12:
  63936 	;
  63937 bitvec_set_rehash:
  63938 	if !(uint64((*Bitvec)(unsafe.Pointer(p)).FnSet) >= (uint64(BITVEC_SZ)-uint64(3)*uint64(unsafe.Sizeof(U32(0))))/uint64(unsafe.Sizeof(uintptr(0)))*uint64(unsafe.Sizeof(uintptr(0)))/uint64(unsafe.Sizeof(U32(0)))/uint64(2)) {
  63939 		goto __15
  63940 	}
  63941 	aiValues = Xsqlite3DbMallocRaw(tls, uintptr(0), uint64(unsafe.Sizeof([124]U32{})))
  63942 	if !(aiValues == uintptr(0)) {
  63943 		goto __16
  63944 	}
  63945 	return SQLITE_NOMEM
  63946 	goto __17
  63947 __16:
  63948 	libc.Xmemcpy(tls, aiValues, p+16, uint64(unsafe.Sizeof([124]U32{})))
  63949 	libc.Xmemset(tls, p+16, 0, uint64(unsafe.Sizeof([62]uintptr{})))
  63950 	(*Bitvec)(unsafe.Pointer(p)).FiDivisor = U32((uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) + (uint64(BITVEC_SZ)-uint64(3)*uint64(unsafe.Sizeof(U32(0))))/uint64(unsafe.Sizeof(uintptr(0)))*uint64(unsafe.Sizeof(uintptr(0)))/uint64(unsafe.Sizeof(uintptr(0))) - uint64(1)) / ((uint64(BITVEC_SZ) - uint64(3)*uint64(unsafe.Sizeof(U32(0)))) / uint64(unsafe.Sizeof(uintptr(0))) * uint64(unsafe.Sizeof(uintptr(0))) / uint64(unsafe.Sizeof(uintptr(0)))))
  63951 	rc = Xsqlite3BitvecSet(tls, p, i)
  63952 	j = uint32(0)
  63953 __18:
  63954 	if !(uint64(j) < (uint64(BITVEC_SZ)-uint64(3)*uint64(unsafe.Sizeof(U32(0))))/uint64(unsafe.Sizeof(uintptr(0)))*uint64(unsafe.Sizeof(uintptr(0)))/uint64(unsafe.Sizeof(U32(0)))) {
  63955 		goto __20
  63956 	}
  63957 	if !(*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != 0) {
  63958 		goto __21
  63959 	}
  63960 	rc = rc | Xsqlite3BitvecSet(tls, p, *(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)))
  63961 __21:
  63962 	;
  63963 	goto __19
  63964 __19:
  63965 	j++
  63966 	goto __18
  63967 	goto __20
  63968 __20:
  63969 	;
  63970 	Xsqlite3DbFree(tls, uintptr(0), aiValues)
  63971 	return rc
  63972 __17:
  63973 	;
  63974 __15:
  63975 	;
  63976 bitvec_set_end:
  63977 	(*Bitvec)(unsafe.Pointer(p)).FnSet++
  63978 	*(*U32)(unsafe.Pointer(p + 16 + uintptr(h)*4)) = i
  63979 	return SQLITE_OK
  63980 }
  63981 
  63982 // Clear the i-th bit.
  63983 //
  63984 // pBuf must be a pointer to at least BITVEC_SZ bytes of temporary storage
  63985 // that BitvecClear can use to rebuilt its hash table.
  63986 func Xsqlite3BitvecClear(tls *libc.TLS, p uintptr, i U32, pBuf uintptr) {
  63987 	if p == uintptr(0) {
  63988 		return
  63989 	}
  63990 
  63991 	i--
  63992 	for (*Bitvec)(unsafe.Pointer(p)).FiDivisor != 0 {
  63993 		var bin U32 = i / (*Bitvec)(unsafe.Pointer(p)).FiDivisor
  63994 		i = i % (*Bitvec)(unsafe.Pointer(p)).FiDivisor
  63995 		p = *(*uintptr)(unsafe.Pointer(p + 16 + uintptr(bin)*8))
  63996 		if !(p != 0) {
  63997 			return
  63998 		}
  63999 	}
  64000 	if uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (uint64(BITVEC_SZ)-uint64(3)*uint64(unsafe.Sizeof(U32(0))))/uint64(unsafe.Sizeof(uintptr(0)))*uint64(unsafe.Sizeof(uintptr(0)))/uint64(unsafe.Sizeof(U8(0)))*uint64(BITVEC_SZELEM) {
  64001 		*(*U8)(unsafe.Pointer(p + 16 + uintptr(i/U32(BITVEC_SZELEM)))) &= U8(^(int32(1) << (i & U32(BITVEC_SZELEM-1))))
  64002 	} else {
  64003 		var j uint32
  64004 		var aiValues uintptr = pBuf
  64005 		libc.Xmemcpy(tls, aiValues, p+16, uint64(unsafe.Sizeof([124]U32{})))
  64006 		libc.Xmemset(tls, p+16, 0, uint64(unsafe.Sizeof([124]U32{})))
  64007 		(*Bitvec)(unsafe.Pointer(p)).FnSet = U32(0)
  64008 		for j = uint32(0); uint64(j) < (uint64(BITVEC_SZ)-uint64(3)*uint64(unsafe.Sizeof(U32(0))))/uint64(unsafe.Sizeof(uintptr(0)))*uint64(unsafe.Sizeof(uintptr(0)))/uint64(unsafe.Sizeof(U32(0))); j++ {
  64009 			if *(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != 0 && *(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != i+U32(1) {
  64010 				var h U32 = U32(uint64((*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4))-U32(1))*U32(1)) % ((uint64(BITVEC_SZ) - uint64(3)*uint64(unsafe.Sizeof(U32(0)))) / uint64(unsafe.Sizeof(uintptr(0))) * uint64(unsafe.Sizeof(uintptr(0))) / uint64(unsafe.Sizeof(U32(0)))))
  64011 				(*Bitvec)(unsafe.Pointer(p)).FnSet++
  64012 				for *(*U32)(unsafe.Pointer(p + 16 + uintptr(h)*4)) != 0 {
  64013 					h++
  64014 					if uint64(h) >= (uint64(BITVEC_SZ)-uint64(3)*uint64(unsafe.Sizeof(U32(0))))/uint64(unsafe.Sizeof(uintptr(0)))*uint64(unsafe.Sizeof(uintptr(0)))/uint64(unsafe.Sizeof(U32(0))) {
  64015 						h = U32(0)
  64016 					}
  64017 				}
  64018 				*(*U32)(unsafe.Pointer(p + 16 + uintptr(h)*4)) = *(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4))
  64019 			}
  64020 		}
  64021 	}
  64022 }
  64023 
  64024 // Destroy a bitmap object.  Reclaim all memory used.
  64025 func Xsqlite3BitvecDestroy(tls *libc.TLS, p uintptr) {
  64026 	if p == uintptr(0) {
  64027 		return
  64028 	}
  64029 	if (*Bitvec)(unsafe.Pointer(p)).FiDivisor != 0 {
  64030 		var i uint32
  64031 		for i = uint32(0); uint64(i) < (uint64(BITVEC_SZ)-uint64(3)*uint64(unsafe.Sizeof(U32(0))))/uint64(unsafe.Sizeof(uintptr(0)))*uint64(unsafe.Sizeof(uintptr(0)))/uint64(unsafe.Sizeof(uintptr(0))); i++ {
  64032 			Xsqlite3BitvecDestroy(tls, *(*uintptr)(unsafe.Pointer(p + 16 + uintptr(i)*8)))
  64033 		}
  64034 	}
  64035 	Xsqlite3_free(tls, p)
  64036 }
  64037 
  64038 // Return the value of the iSize parameter specified when Bitvec *p
  64039 // was created.
  64040 func Xsqlite3BitvecSize(tls *libc.TLS, p uintptr) U32 {
  64041 	return (*Bitvec)(unsafe.Pointer(p)).FiSize
  64042 }
  64043 
  64044 // This routine runs an extensive test of the Bitvec code.
  64045 //
  64046 // The input is an array of integers that acts as a program
  64047 // to test the Bitvec.  The integers are opcodes followed
  64048 // by 0, 1, or 3 operands, depending on the opcode.  Another
  64049 // opcode follows immediately after the last operand.
  64050 //
  64051 // There are 6 opcodes numbered from 0 through 5.  0 is the
  64052 // "halt" opcode and causes the test to end.
  64053 //
  64054 //	0          Halt and return the number of errors
  64055 //	1 N S X    Set N bits beginning with S and incrementing by X
  64056 //	2 N S X    Clear N bits beginning with S and incrementing by X
  64057 //	3 N        Set N randomly chosen bits
  64058 //	4 N        Clear N randomly chosen bits
  64059 //	5 N S X    Set N bits from S increment X in array only, not in bitvec
  64060 //
  64061 // The opcodes 1 through 4 perform set and clear operations are performed
  64062 // on both a Bitvec object and on a linear array of bits obtained from malloc.
  64063 // Opcode 5 works on the linear array only, not on the Bitvec.
  64064 // Opcode 5 is used to deliberately induce a fault in order to
  64065 // confirm that error detection works.
  64066 //
  64067 // At the conclusion of the test the linear array is compared
  64068 // against the Bitvec object.  If there are any differences,
  64069 // an error is returned.  If they are the same, zero is returned.
  64070 //
  64071 // If a memory allocation error occurs, return -1.
  64072 func Xsqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) int32 {
  64073 	bp := tls.Alloc(4)
  64074 	defer tls.Free(4)
  64075 
  64076 	var pBitvec uintptr
  64077 	var pV uintptr
  64078 	var rc int32
  64079 
  64080 	var nx int32
  64081 	var pc int32
  64082 	var op int32
  64083 	var pTmpSpace uintptr
  64084 	pBitvec = uintptr(0)
  64085 	pV = uintptr(0)
  64086 	rc = -1
  64087 
  64088 	pBitvec = Xsqlite3BitvecCreate(tls, uint32(sz))
  64089 	pV = Xsqlite3MallocZero(tls, uint64((sz+7)/8+1))
  64090 	pTmpSpace = Xsqlite3_malloc64(tls, uint64(BITVEC_SZ))
  64091 	if !(pBitvec == uintptr(0) || pV == uintptr(0) || pTmpSpace == uintptr(0)) {
  64092 		goto __1
  64093 	}
  64094 	goto bitvec_end
  64095 __1:
  64096 	;
  64097 	Xsqlite3BitvecSet(tls, uintptr(0), uint32(1))
  64098 	Xsqlite3BitvecClear(tls, uintptr(0), uint32(1), pTmpSpace)
  64099 
  64100 	pc = libc.AssignPtrInt32(bp, 0)
  64101 __2:
  64102 	if !(libc.AssignInt32(&op, *(*int32)(unsafe.Pointer(aOp + uintptr(pc)*4))) != 0) {
  64103 		goto __3
  64104 	}
  64105 	switch op {
  64106 	case 1:
  64107 		goto __5
  64108 	case 2:
  64109 		goto __6
  64110 	case 5:
  64111 		goto __7
  64112 	case 3:
  64113 		goto __8
  64114 	case 4:
  64115 		goto __9
  64116 	default:
  64117 		goto __10
  64118 	}
  64119 	goto __4
  64120 __5:
  64121 __6:
  64122 __7:
  64123 	nx = 4
  64124 	*(*int32)(unsafe.Pointer(bp)) = *(*int32)(unsafe.Pointer(aOp + uintptr(pc+2)*4)) - 1
  64125 	*(*int32)(unsafe.Pointer(aOp + uintptr(pc+2)*4)) += *(*int32)(unsafe.Pointer(aOp + uintptr(pc+3)*4))
  64126 	goto __4
  64127 
  64128 __8:
  64129 __9:
  64130 __10:
  64131 	nx = 2
  64132 	Xsqlite3_randomness(tls, int32(unsafe.Sizeof(int32(0))), bp)
  64133 	goto __4
  64134 
  64135 __4:
  64136 	;
  64137 	if !(libc.PreDecInt32(&*(*int32)(unsafe.Pointer(aOp + uintptr(pc+1)*4)), 1) > 0) {
  64138 		goto __11
  64139 	}
  64140 	nx = 0
  64141 __11:
  64142 	;
  64143 	pc = pc + nx
  64144 	*(*int32)(unsafe.Pointer(bp)) = *(*int32)(unsafe.Pointer(bp)) & 0x7fffffff % sz
  64145 	if !(op&1 != 0) {
  64146 		goto __12
  64147 	}
  64148 	*(*uint8)(unsafe.Pointer(pV + uintptr((*(*int32)(unsafe.Pointer(bp))+1)>>3))) |= uint8(int32(1) << ((*(*int32)(unsafe.Pointer(bp)) + 1) & 7))
  64149 	if !(op != 5) {
  64150 		goto __14
  64151 	}
  64152 	if !(Xsqlite3BitvecSet(tls, pBitvec, uint32(*(*int32)(unsafe.Pointer(bp))+1)) != 0) {
  64153 		goto __15
  64154 	}
  64155 	goto bitvec_end
  64156 __15:
  64157 	;
  64158 __14:
  64159 	;
  64160 	goto __13
  64161 __12:
  64162 	*(*uint8)(unsafe.Pointer(pV + uintptr((*(*int32)(unsafe.Pointer(bp))+1)>>3))) &= uint8(^(int32(1) << ((*(*int32)(unsafe.Pointer(bp)) + 1) & 7)))
  64163 	Xsqlite3BitvecClear(tls, pBitvec, uint32(*(*int32)(unsafe.Pointer(bp))+1), pTmpSpace)
  64164 __13:
  64165 	;
  64166 	goto __2
  64167 __3:
  64168 	;
  64169 	rc = int32(U32(Xsqlite3BitvecTest(tls, uintptr(0), uint32(0))+Xsqlite3BitvecTest(tls, pBitvec, uint32(sz+1))+
  64170 		Xsqlite3BitvecTest(tls, pBitvec, uint32(0))) +
  64171 		(Xsqlite3BitvecSize(tls, pBitvec) - U32(sz)))
  64172 	*(*int32)(unsafe.Pointer(bp)) = 1
  64173 __16:
  64174 	if !(*(*int32)(unsafe.Pointer(bp)) <= sz) {
  64175 		goto __18
  64176 	}
  64177 	if !(libc.Bool32(int32(*(*uint8)(unsafe.Pointer(pV + uintptr(*(*int32)(unsafe.Pointer(bp))>>3))))&(int32(1)<<(*(*int32)(unsafe.Pointer(bp))&7)) != 0) != Xsqlite3BitvecTest(tls, pBitvec, uint32(*(*int32)(unsafe.Pointer(bp))))) {
  64178 		goto __19
  64179 	}
  64180 	rc = *(*int32)(unsafe.Pointer(bp))
  64181 	goto __18
  64182 __19:
  64183 	;
  64184 	goto __17
  64185 __17:
  64186 	*(*int32)(unsafe.Pointer(bp))++
  64187 	goto __16
  64188 	goto __18
  64189 __18:
  64190 	;
  64191 bitvec_end:
  64192 	Xsqlite3_free(tls, pTmpSpace)
  64193 	Xsqlite3_free(tls, pV)
  64194 	Xsqlite3BitvecDestroy(tls, pBitvec)
  64195 	return rc
  64196 }
  64197 
  64198 func pcacheManageDirtyList(tls *libc.TLS, pPage uintptr, addRemove U8) {
  64199 	var p uintptr = (*PgHdr)(unsafe.Pointer(pPage)).FpCache
  64200 
  64201 	if int32(addRemove)&PCACHE_DIRTYLIST_REMOVE != 0 {
  64202 		if (*PCache)(unsafe.Pointer(p)).FpSynced == pPage {
  64203 			(*PCache)(unsafe.Pointer(p)).FpSynced = (*PgHdr)(unsafe.Pointer(pPage)).FpDirtyPrev
  64204 		}
  64205 
  64206 		if (*PgHdr)(unsafe.Pointer(pPage)).FpDirtyNext != 0 {
  64207 			(*PgHdr)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(pPage)).FpDirtyNext)).FpDirtyPrev = (*PgHdr)(unsafe.Pointer(pPage)).FpDirtyPrev
  64208 		} else {
  64209 			(*PCache)(unsafe.Pointer(p)).FpDirtyTail = (*PgHdr)(unsafe.Pointer(pPage)).FpDirtyPrev
  64210 		}
  64211 		if (*PgHdr)(unsafe.Pointer(pPage)).FpDirtyPrev != 0 {
  64212 			(*PgHdr)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(pPage)).FpDirtyPrev)).FpDirtyNext = (*PgHdr)(unsafe.Pointer(pPage)).FpDirtyNext
  64213 		} else {
  64214 			(*PCache)(unsafe.Pointer(p)).FpDirty = (*PgHdr)(unsafe.Pointer(pPage)).FpDirtyNext
  64215 
  64216 			if (*PCache)(unsafe.Pointer(p)).FpDirty == uintptr(0) {
  64217 				(*PCache)(unsafe.Pointer(p)).FeCreate = U8(2)
  64218 			}
  64219 		}
  64220 	}
  64221 	if int32(addRemove)&PCACHE_DIRTYLIST_ADD != 0 {
  64222 		(*PgHdr)(unsafe.Pointer(pPage)).FpDirtyPrev = uintptr(0)
  64223 		(*PgHdr)(unsafe.Pointer(pPage)).FpDirtyNext = (*PCache)(unsafe.Pointer(p)).FpDirty
  64224 		if (*PgHdr)(unsafe.Pointer(pPage)).FpDirtyNext != 0 {
  64225 			(*PgHdr)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(pPage)).FpDirtyNext)).FpDirtyPrev = pPage
  64226 		} else {
  64227 			(*PCache)(unsafe.Pointer(p)).FpDirtyTail = pPage
  64228 			if (*PCache)(unsafe.Pointer(p)).FbPurgeable != 0 {
  64229 				(*PCache)(unsafe.Pointer(p)).FeCreate = U8(1)
  64230 			}
  64231 		}
  64232 		(*PCache)(unsafe.Pointer(p)).FpDirty = pPage
  64233 
  64234 		if !(int32((*PCache)(unsafe.Pointer(p)).FpSynced) != 0) &&
  64235 			0 == int32((*PgHdr)(unsafe.Pointer(pPage)).Fflags)&PGHDR_NEED_SYNC {
  64236 			(*PCache)(unsafe.Pointer(p)).FpSynced = pPage
  64237 		}
  64238 	}
  64239 
  64240 }
  64241 
  64242 func pcacheUnpin(tls *libc.TLS, p uintptr) {
  64243 	if (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FbPurgeable != 0 {
  64244 		(*struct {
  64245 			f func(*libc.TLS, uintptr, uintptr, int32)
  64246 		})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxUnpin})).f(tls, (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FpCache, (*PgHdr)(unsafe.Pointer(p)).FpPage, 0)
  64247 
  64248 	}
  64249 }
  64250 
  64251 func numberOfCachePages(tls *libc.TLS, p uintptr) int32 {
  64252 	if (*PCache)(unsafe.Pointer(p)).FszCache >= 0 {
  64253 		return (*PCache)(unsafe.Pointer(p)).FszCache
  64254 	} else {
  64255 		var n I64
  64256 
  64257 		n = int64(-1024) * I64((*PCache)(unsafe.Pointer(p)).FszCache) / I64((*PCache)(unsafe.Pointer(p)).FszPage+(*PCache)(unsafe.Pointer(p)).FszExtra)
  64258 		if n > int64(1000000000) {
  64259 			n = int64(1000000000)
  64260 		}
  64261 		return int32(n)
  64262 	}
  64263 	return int32(0)
  64264 }
  64265 
  64266 // ************************************************** General Interfaces ******
  64267 //
  64268 // Initialize and shutdown the page cache subsystem. Neither of these
  64269 // functions are threadsafe.
  64270 func Xsqlite3PcacheInitialize(tls *libc.TLS) int32 {
  64271 	if Xsqlite3Config.Fpcache2.FxInit == uintptr(0) {
  64272 		Xsqlite3PCacheSetDefault(tls)
  64273 
  64274 	}
  64275 	return (*struct {
  64276 		f func(*libc.TLS, uintptr) int32
  64277 	})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxInit})).f(tls, Xsqlite3Config.Fpcache2.FpArg)
  64278 }
  64279 
  64280 func Xsqlite3PcacheShutdown(tls *libc.TLS) {
  64281 	if Xsqlite3Config.Fpcache2.FxShutdown != 0 {
  64282 		(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxShutdown})).f(tls, Xsqlite3Config.Fpcache2.FpArg)
  64283 	}
  64284 }
  64285 
  64286 // Return the size in bytes of a PCache object.
  64287 func Xsqlite3PcacheSize(tls *libc.TLS) int32 {
  64288 	return int32(unsafe.Sizeof(PCache{}))
  64289 }
  64290 
  64291 // Create a new PCache object. Storage space to hold the object
  64292 // has already been allocated and is passed in as the p pointer.
  64293 // The caller discovers how much space needs to be allocated by
  64294 // calling sqlite3PcacheSize().
  64295 //
  64296 // szExtra is some extra space allocated for each page.  The first
  64297 // 8 bytes of the extra space will be zeroed as the page is allocated,
  64298 // but remaining content will be uninitialized.  Though it is opaque
  64299 // to this module, the extra space really ends up being the MemPage
  64300 // structure in the pager.
  64301 func Xsqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) int32 {
  64302 	libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(PCache{})))
  64303 	(*PCache)(unsafe.Pointer(p)).FszPage = 1
  64304 	(*PCache)(unsafe.Pointer(p)).FszExtra = szExtra
  64305 
  64306 	(*PCache)(unsafe.Pointer(p)).FbPurgeable = U8(bPurgeable)
  64307 	(*PCache)(unsafe.Pointer(p)).FeCreate = U8(2)
  64308 	(*PCache)(unsafe.Pointer(p)).FxStress = xStress
  64309 	(*PCache)(unsafe.Pointer(p)).FpStress = pStress
  64310 	(*PCache)(unsafe.Pointer(p)).FszCache = 100
  64311 	(*PCache)(unsafe.Pointer(p)).FszSpill = 1
  64312 
  64313 	return Xsqlite3PcacheSetPageSize(tls, p, szPage)
  64314 }
  64315 
  64316 // Change the page size for PCache object. The caller must ensure that there
  64317 // are no outstanding page references when this function is called.
  64318 func Xsqlite3PcacheSetPageSize(tls *libc.TLS, pCache uintptr, szPage int32) int32 {
  64319 	if (*PCache)(unsafe.Pointer(pCache)).FszPage != 0 {
  64320 		var pNew uintptr
  64321 		pNew = (*struct {
  64322 			f func(*libc.TLS, int32, int32, int32) uintptr
  64323 		})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxCreate})).f(tls,
  64324 			szPage, int32(uint64((*PCache)(unsafe.Pointer(pCache)).FszExtra)+(uint64(unsafe.Sizeof(PgHdr{}))+uint64(7))&libc.Uint64FromInt32(libc.CplInt32(7))),
  64325 			int32((*PCache)(unsafe.Pointer(pCache)).FbPurgeable))
  64326 		if pNew == uintptr(0) {
  64327 			return SQLITE_NOMEM
  64328 		}
  64329 		(*struct {
  64330 			f func(*libc.TLS, uintptr, int32)
  64331 		})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxCachesize})).f(tls, pNew, numberOfCachePages(tls, pCache))
  64332 		if (*PCache)(unsafe.Pointer(pCache)).FpCache != 0 {
  64333 			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxDestroy})).f(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache)
  64334 		}
  64335 		(*PCache)(unsafe.Pointer(pCache)).FpCache = pNew
  64336 		(*PCache)(unsafe.Pointer(pCache)).FszPage = szPage
  64337 
  64338 	}
  64339 	return SQLITE_OK
  64340 }
  64341 
  64342 // Try to obtain a page from the cache.
  64343 //
  64344 // This routine returns a pointer to an sqlite3_pcache_page object if
  64345 // such an object is already in cache, or if a new one is created.
  64346 // This routine returns a NULL pointer if the object was not in cache
  64347 // and could not be created.
  64348 //
  64349 // The createFlags should be 0 to check for existing pages and should
  64350 // be 3 (not 1, but 3) to try to create a new page.
  64351 //
  64352 // If the createFlag is 0, then NULL is always returned if the page
  64353 // is not already in the cache.  If createFlag is 1, then a new page
  64354 // is created only if that can be done without spilling dirty pages
  64355 // and without exceeding the cache size limit.
  64356 //
  64357 // The caller needs to invoke sqlite3PcacheFetchFinish() to properly
  64358 // initialize the sqlite3_pcache_page object and convert it into a
  64359 // PgHdr object.  The sqlite3PcacheFetch() and sqlite3PcacheFetchFinish()
  64360 // routines are split this way for performance reasons. When separated
  64361 // they can both (usually) operate without having to push values to
  64362 // the stack on entry and pop them back off on exit, which saves a
  64363 // lot of pushing and popping.
  64364 func Xsqlite3PcacheFetch(tls *libc.TLS, pCache uintptr, pgno Pgno, createFlag int32) uintptr {
  64365 	var eCreate int32
  64366 	var pRes uintptr
  64367 
  64368 	eCreate = createFlag & int32((*PCache)(unsafe.Pointer(pCache)).FeCreate)
  64369 
  64370 	pRes = (*struct {
  64371 		f func(*libc.TLS, uintptr, uint32, int32) uintptr
  64372 	})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxFetch})).f(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, pgno, eCreate)
  64373 
  64374 	return pRes
  64375 }
  64376 
  64377 // If the sqlite3PcacheFetch() routine is unable to allocate a new
  64378 // page because no clean pages are available for reuse and the cache
  64379 // size limit has been reached, then this routine can be invoked to
  64380 // try harder to allocate a page.  This routine might invoke the stress
  64381 // callback to spill dirty pages to the journal.  It will then try to
  64382 // allocate the new page and will only fail to allocate a new page on
  64383 // an OOM error.
  64384 //
  64385 // This routine should be invoked only after sqlite3PcacheFetch() fails.
  64386 func Xsqlite3PcacheFetchStress(tls *libc.TLS, pCache uintptr, pgno Pgno, ppPage uintptr) int32 {
  64387 	var pPg uintptr
  64388 	if int32((*PCache)(unsafe.Pointer(pCache)).FeCreate) == 2 {
  64389 		return 0
  64390 	}
  64391 
  64392 	if Xsqlite3PcachePagecount(tls, pCache) > (*PCache)(unsafe.Pointer(pCache)).FszSpill {
  64393 		for pPg = (*PCache)(unsafe.Pointer(pCache)).FpSynced; pPg != 0 && ((*PgHdr)(unsafe.Pointer(pPg)).FnRef != 0 || int32((*PgHdr)(unsafe.Pointer(pPg)).Fflags)&PGHDR_NEED_SYNC != 0); pPg = (*PgHdr)(unsafe.Pointer(pPg)).FpDirtyPrev {
  64394 		}
  64395 		(*PCache)(unsafe.Pointer(pCache)).FpSynced = pPg
  64396 		if !(pPg != 0) {
  64397 			for pPg = (*PCache)(unsafe.Pointer(pCache)).FpDirtyTail; pPg != 0 && (*PgHdr)(unsafe.Pointer(pPg)).FnRef != 0; pPg = (*PgHdr)(unsafe.Pointer(pPg)).FpDirtyPrev {
  64398 			}
  64399 		}
  64400 		if pPg != 0 {
  64401 			var rc int32
  64402 
  64403 			rc = (*struct {
  64404 				f func(*libc.TLS, uintptr, uintptr) int32
  64405 			})(unsafe.Pointer(&struct{ uintptr }{(*PCache)(unsafe.Pointer(pCache)).FxStress})).f(tls, (*PCache)(unsafe.Pointer(pCache)).FpStress, pPg)
  64406 
  64407 			if rc != SQLITE_OK && rc != SQLITE_BUSY {
  64408 				return rc
  64409 			}
  64410 		}
  64411 	}
  64412 	*(*uintptr)(unsafe.Pointer(ppPage)) = (*struct {
  64413 		f func(*libc.TLS, uintptr, uint32, int32) uintptr
  64414 	})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxFetch})).f(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, pgno, 2)
  64415 	if *(*uintptr)(unsafe.Pointer(ppPage)) == uintptr(0) {
  64416 		return SQLITE_NOMEM
  64417 	}
  64418 	return SQLITE_OK
  64419 }
  64420 
  64421 func pcacheFetchFinishWithInit(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage uintptr) uintptr {
  64422 	var pPgHdr uintptr
  64423 
  64424 	pPgHdr = (*Sqlite3_pcache_page)(unsafe.Pointer(pPage)).FpExtra
  64425 
  64426 	libc.Xmemset(tls, pPgHdr+32, 0, uint64(unsafe.Sizeof(PgHdr{}))-uint64(uintptr(0)+32))
  64427 	(*PgHdr)(unsafe.Pointer(pPgHdr)).FpPage = pPage
  64428 	(*PgHdr)(unsafe.Pointer(pPgHdr)).FpData = (*Sqlite3_pcache_page)(unsafe.Pointer(pPage)).FpBuf
  64429 	(*PgHdr)(unsafe.Pointer(pPgHdr)).FpExtra = pPgHdr + 1*80
  64430 	libc.Xmemset(tls, (*PgHdr)(unsafe.Pointer(pPgHdr)).FpExtra, 0, uint64(8))
  64431 	(*PgHdr)(unsafe.Pointer(pPgHdr)).FpCache = pCache
  64432 	(*PgHdr)(unsafe.Pointer(pPgHdr)).Fpgno = pgno
  64433 	(*PgHdr)(unsafe.Pointer(pPgHdr)).Fflags = U16(PGHDR_CLEAN)
  64434 	return Xsqlite3PcacheFetchFinish(tls, pCache, pgno, pPage)
  64435 }
  64436 
  64437 // This routine converts the sqlite3_pcache_page object returned by
  64438 // sqlite3PcacheFetch() into an initialized PgHdr object.  This routine
  64439 // must be called after sqlite3PcacheFetch() in order to get a usable
  64440 // result.
  64441 func Xsqlite3PcacheFetchFinish(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage uintptr) uintptr {
  64442 	var pPgHdr uintptr
  64443 
  64444 	pPgHdr = (*Sqlite3_pcache_page)(unsafe.Pointer(pPage)).FpExtra
  64445 
  64446 	if !(int32((*PgHdr)(unsafe.Pointer(pPgHdr)).FpPage) != 0) {
  64447 		return pcacheFetchFinishWithInit(tls, pCache, pgno, pPage)
  64448 	}
  64449 	(*PCache)(unsafe.Pointer(pCache)).FnRefSum++
  64450 	(*PgHdr)(unsafe.Pointer(pPgHdr)).FnRef++
  64451 
  64452 	return pPgHdr
  64453 }
  64454 
  64455 // Decrement the reference count on a page. If the page is clean and the
  64456 // reference count drops to 0, then it is made eligible for recycling.
  64457 func Xsqlite3PcacheRelease(tls *libc.TLS, p uintptr) {
  64458 	(*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FnRefSum--
  64459 	if libc.PreDecInt64(&(*PgHdr)(unsafe.Pointer(p)).FnRef, 1) == int64(0) {
  64460 		if int32((*PgHdr)(unsafe.Pointer(p)).Fflags)&PGHDR_CLEAN != 0 {
  64461 			pcacheUnpin(tls, p)
  64462 		} else {
  64463 			pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_FRONT))
  64464 
  64465 		}
  64466 	}
  64467 }
  64468 
  64469 // Increase the reference count of a supplied page by 1.
  64470 func Xsqlite3PcacheRef(tls *libc.TLS, p uintptr) {
  64471 	(*PgHdr)(unsafe.Pointer(p)).FnRef++
  64472 	(*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FnRefSum++
  64473 }
  64474 
  64475 // Drop a page from the cache. There must be exactly one reference to the
  64476 // page. This function deletes that reference, so after it returns the
  64477 // page pointed to by p is invalid.
  64478 func Xsqlite3PcacheDrop(tls *libc.TLS, p uintptr) {
  64479 	if int32((*PgHdr)(unsafe.Pointer(p)).Fflags)&PGHDR_DIRTY != 0 {
  64480 		pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_REMOVE))
  64481 	}
  64482 	(*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FnRefSum--
  64483 	(*struct {
  64484 		f func(*libc.TLS, uintptr, uintptr, int32)
  64485 	})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxUnpin})).f(tls, (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FpCache, (*PgHdr)(unsafe.Pointer(p)).FpPage, 1)
  64486 }
  64487 
  64488 // Make sure the page is marked as dirty. If it isn't dirty already,
  64489 // make it so.
  64490 func Xsqlite3PcacheMakeDirty(tls *libc.TLS, p uintptr) {
  64491 	if int32((*PgHdr)(unsafe.Pointer(p)).Fflags)&(PGHDR_CLEAN|PGHDR_DONT_WRITE) != 0 {
  64492 		*(*U16)(unsafe.Pointer(p + 52)) &= libc.Uint16FromInt32(libc.CplInt32(PGHDR_DONT_WRITE))
  64493 		if int32((*PgHdr)(unsafe.Pointer(p)).Fflags)&PGHDR_CLEAN != 0 {
  64494 			*(*U16)(unsafe.Pointer(p + 52)) ^= U16(PGHDR_DIRTY | PGHDR_CLEAN)
  64495 
  64496 			pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_ADD))
  64497 
  64498 		}
  64499 
  64500 	}
  64501 }
  64502 
  64503 // Make sure the page is marked as clean. If it isn't clean already,
  64504 // make it so.
  64505 func Xsqlite3PcacheMakeClean(tls *libc.TLS, p uintptr) {
  64506 	pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_REMOVE))
  64507 	*(*U16)(unsafe.Pointer(p + 52)) &= libc.Uint16FromInt32(libc.CplInt32(PGHDR_DIRTY | PGHDR_NEED_SYNC | PGHDR_WRITEABLE))
  64508 	*(*U16)(unsafe.Pointer(p + 52)) |= U16(PGHDR_CLEAN)
  64509 
  64510 	if (*PgHdr)(unsafe.Pointer(p)).FnRef == int64(0) {
  64511 		pcacheUnpin(tls, p)
  64512 	}
  64513 }
  64514 
  64515 // Make every page in the cache clean.
  64516 func Xsqlite3PcacheCleanAll(tls *libc.TLS, pCache uintptr) {
  64517 	var p uintptr
  64518 
  64519 	for libc.AssignUintptr(&p, (*PCache)(unsafe.Pointer(pCache)).FpDirty) != uintptr(0) {
  64520 		Xsqlite3PcacheMakeClean(tls, p)
  64521 	}
  64522 }
  64523 
  64524 // Clear the PGHDR_NEED_SYNC and PGHDR_WRITEABLE flag from all dirty pages.
  64525 func Xsqlite3PcacheClearWritable(tls *libc.TLS, pCache uintptr) {
  64526 	var p uintptr
  64527 
  64528 	for p = (*PCache)(unsafe.Pointer(pCache)).FpDirty; p != 0; p = (*PgHdr)(unsafe.Pointer(p)).FpDirtyNext {
  64529 		*(*U16)(unsafe.Pointer(p + 52)) &= libc.Uint16FromInt32(libc.CplInt32(PGHDR_NEED_SYNC | PGHDR_WRITEABLE))
  64530 	}
  64531 	(*PCache)(unsafe.Pointer(pCache)).FpSynced = (*PCache)(unsafe.Pointer(pCache)).FpDirtyTail
  64532 }
  64533 
  64534 // Clear the PGHDR_NEED_SYNC flag from all dirty pages.
  64535 func Xsqlite3PcacheClearSyncFlags(tls *libc.TLS, pCache uintptr) {
  64536 	var p uintptr
  64537 	for p = (*PCache)(unsafe.Pointer(pCache)).FpDirty; p != 0; p = (*PgHdr)(unsafe.Pointer(p)).FpDirtyNext {
  64538 		*(*U16)(unsafe.Pointer(p + 52)) &= libc.Uint16FromInt32(libc.CplInt32(PGHDR_NEED_SYNC))
  64539 	}
  64540 	(*PCache)(unsafe.Pointer(pCache)).FpSynced = (*PCache)(unsafe.Pointer(pCache)).FpDirtyTail
  64541 }
  64542 
  64543 // Change the page number of page p to newPgno.
  64544 func Xsqlite3PcacheMove(tls *libc.TLS, p uintptr, newPgno Pgno) {
  64545 	var pCache uintptr = (*PgHdr)(unsafe.Pointer(p)).FpCache
  64546 	var pOther uintptr
  64547 
  64548 	pOther = (*struct {
  64549 		f func(*libc.TLS, uintptr, uint32, int32) uintptr
  64550 	})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxFetch})).f(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, newPgno, 0)
  64551 	if pOther != 0 {
  64552 		var pXPage uintptr = (*Sqlite3_pcache_page)(unsafe.Pointer(pOther)).FpExtra
  64553 
  64554 		(*PgHdr)(unsafe.Pointer(pXPage)).FnRef++
  64555 		(*PCache)(unsafe.Pointer(pCache)).FnRefSum++
  64556 		Xsqlite3PcacheDrop(tls, pXPage)
  64557 	}
  64558 	(*struct {
  64559 		f func(*libc.TLS, uintptr, uintptr, uint32, uint32)
  64560 	})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxRekey})).f(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, (*PgHdr)(unsafe.Pointer(p)).FpPage, (*PgHdr)(unsafe.Pointer(p)).Fpgno, newPgno)
  64561 	(*PgHdr)(unsafe.Pointer(p)).Fpgno = newPgno
  64562 	if int32((*PgHdr)(unsafe.Pointer(p)).Fflags)&PGHDR_DIRTY != 0 && int32((*PgHdr)(unsafe.Pointer(p)).Fflags)&PGHDR_NEED_SYNC != 0 {
  64563 		pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_FRONT))
  64564 
  64565 	}
  64566 }
  64567 
  64568 // Drop every cache entry whose page number is greater than "pgno". The
  64569 // caller must ensure that there are no outstanding references to any pages
  64570 // other than page 1 with a page number greater than pgno.
  64571 //
  64572 // If there is a reference to page 1 and the pgno parameter passed to this
  64573 // function is 0, then the data area associated with page 1 is zeroed, but
  64574 // the page object is not dropped.
  64575 func Xsqlite3PcacheTruncate(tls *libc.TLS, pCache uintptr, pgno Pgno) {
  64576 	if (*PCache)(unsafe.Pointer(pCache)).FpCache != 0 {
  64577 		var p uintptr
  64578 		var pNext uintptr
  64579 
  64580 		for p = (*PCache)(unsafe.Pointer(pCache)).FpDirty; p != 0; p = pNext {
  64581 			pNext = (*PgHdr)(unsafe.Pointer(p)).FpDirtyNext
  64582 
  64583 			if (*PgHdr)(unsafe.Pointer(p)).Fpgno > pgno {
  64584 				Xsqlite3PcacheMakeClean(tls, p)
  64585 			}
  64586 		}
  64587 		if pgno == Pgno(0) && (*PCache)(unsafe.Pointer(pCache)).FnRefSum != 0 {
  64588 			var pPage1 uintptr
  64589 			pPage1 = (*struct {
  64590 				f func(*libc.TLS, uintptr, uint32, int32) uintptr
  64591 			})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxFetch})).f(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, uint32(1), 0)
  64592 			if pPage1 != 0 {
  64593 				libc.Xmemset(tls, (*Sqlite3_pcache_page)(unsafe.Pointer(pPage1)).FpBuf, 0, uint64((*PCache)(unsafe.Pointer(pCache)).FszPage))
  64594 				pgno = Pgno(1)
  64595 			}
  64596 		}
  64597 		(*struct {
  64598 			f func(*libc.TLS, uintptr, uint32)
  64599 		})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxTruncate})).f(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, pgno+Pgno(1))
  64600 	}
  64601 }
  64602 
  64603 // Close a cache.
  64604 func Xsqlite3PcacheClose(tls *libc.TLS, pCache uintptr) {
  64605 	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxDestroy})).f(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache)
  64606 }
  64607 
  64608 // Discard the contents of the cache.
  64609 func Xsqlite3PcacheClear(tls *libc.TLS, pCache uintptr) {
  64610 	Xsqlite3PcacheTruncate(tls, pCache, uint32(0))
  64611 }
  64612 
  64613 func pcacheMergeDirtyList(tls *libc.TLS, pA uintptr, pB uintptr) uintptr {
  64614 	bp := tls.Alloc(80)
  64615 	defer tls.Free(80)
  64616 
  64617 	var pTail uintptr
  64618 	pTail = bp
  64619 
  64620 	for {
  64621 		if (*PgHdr)(unsafe.Pointer(pA)).Fpgno < (*PgHdr)(unsafe.Pointer(pB)).Fpgno {
  64622 			(*PgHdr)(unsafe.Pointer(pTail)).FpDirty = pA
  64623 			pTail = pA
  64624 			pA = (*PgHdr)(unsafe.Pointer(pA)).FpDirty
  64625 			if pA == uintptr(0) {
  64626 				(*PgHdr)(unsafe.Pointer(pTail)).FpDirty = pB
  64627 				break
  64628 			}
  64629 		} else {
  64630 			(*PgHdr)(unsafe.Pointer(pTail)).FpDirty = pB
  64631 			pTail = pB
  64632 			pB = (*PgHdr)(unsafe.Pointer(pB)).FpDirty
  64633 			if pB == uintptr(0) {
  64634 				(*PgHdr)(unsafe.Pointer(pTail)).FpDirty = pA
  64635 				break
  64636 			}
  64637 		}
  64638 	}
  64639 	return (*PgHdr)(unsafe.Pointer(bp)).FpDirty
  64640 }
  64641 
  64642 func pcacheSortDirtyList(tls *libc.TLS, pIn uintptr) uintptr {
  64643 	bp := tls.Alloc(256)
  64644 	defer tls.Free(256)
  64645 
  64646 	var p uintptr
  64647 	var i int32
  64648 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof([32]uintptr{})))
  64649 	for pIn != 0 {
  64650 		p = pIn
  64651 		pIn = (*PgHdr)(unsafe.Pointer(p)).FpDirty
  64652 		(*PgHdr)(unsafe.Pointer(p)).FpDirty = uintptr(0)
  64653 		for i = 0; i < N_SORT_BUCKET-1; i++ {
  64654 			if *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)) == uintptr(0) {
  64655 				*(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)) = p
  64656 				break
  64657 			} else {
  64658 				p = pcacheMergeDirtyList(tls, *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)), p)
  64659 				*(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)) = uintptr(0)
  64660 			}
  64661 		}
  64662 		if i == N_SORT_BUCKET-1 {
  64663 			*(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)) = pcacheMergeDirtyList(tls, *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)), p)
  64664 		}
  64665 	}
  64666 	p = *(*uintptr)(unsafe.Pointer(bp))
  64667 	for i = 1; i < N_SORT_BUCKET; i++ {
  64668 		if *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)) == uintptr(0) {
  64669 			continue
  64670 		}
  64671 		if p != 0 {
  64672 			p = pcacheMergeDirtyList(tls, p, *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)))
  64673 		} else {
  64674 			p = *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8))
  64675 		}
  64676 	}
  64677 	return p
  64678 }
  64679 
  64680 // Return a list of all dirty pages in the cache, sorted by page number.
  64681 func Xsqlite3PcacheDirtyList(tls *libc.TLS, pCache uintptr) uintptr {
  64682 	var p uintptr
  64683 	for p = (*PCache)(unsafe.Pointer(pCache)).FpDirty; p != 0; p = (*PgHdr)(unsafe.Pointer(p)).FpDirtyNext {
  64684 		(*PgHdr)(unsafe.Pointer(p)).FpDirty = (*PgHdr)(unsafe.Pointer(p)).FpDirtyNext
  64685 	}
  64686 	return pcacheSortDirtyList(tls, (*PCache)(unsafe.Pointer(pCache)).FpDirty)
  64687 }
  64688 
  64689 // Return the total number of references to all pages held by the cache.
  64690 //
  64691 // This is not the total number of pages referenced, but the sum of the
  64692 // reference count for all pages.
  64693 func Xsqlite3PcacheRefCount(tls *libc.TLS, pCache uintptr) I64 {
  64694 	return (*PCache)(unsafe.Pointer(pCache)).FnRefSum
  64695 }
  64696 
  64697 // Return the number of references to the page supplied as an argument.
  64698 func Xsqlite3PcachePageRefcount(tls *libc.TLS, p uintptr) I64 {
  64699 	return (*PgHdr)(unsafe.Pointer(p)).FnRef
  64700 }
  64701 
  64702 // Return the total number of pages in the cache.
  64703 func Xsqlite3PcachePagecount(tls *libc.TLS, pCache uintptr) int32 {
  64704 	return (*struct {
  64705 		f func(*libc.TLS, uintptr) int32
  64706 	})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxPagecount})).f(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache)
  64707 }
  64708 
  64709 // Set the suggested cache-size value.
  64710 func Xsqlite3PcacheSetCachesize(tls *libc.TLS, pCache uintptr, mxPage int32) {
  64711 	(*PCache)(unsafe.Pointer(pCache)).FszCache = mxPage
  64712 	(*struct {
  64713 		f func(*libc.TLS, uintptr, int32)
  64714 	})(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxCachesize})).f(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache,
  64715 		numberOfCachePages(tls, pCache))
  64716 }
  64717 
  64718 // Set the suggested cache-spill value.  Make no changes if if the
  64719 // argument is zero.  Return the effective cache-spill size, which will
  64720 // be the larger of the szSpill and szCache.
  64721 func Xsqlite3PcacheSetSpillsize(tls *libc.TLS, p uintptr, mxPage int32) int32 {
  64722 	var res int32
  64723 
  64724 	if mxPage != 0 {
  64725 		if mxPage < 0 {
  64726 			mxPage = int32(int64(-1024) * I64(mxPage) / I64((*PCache)(unsafe.Pointer(p)).FszPage+(*PCache)(unsafe.Pointer(p)).FszExtra))
  64727 		}
  64728 		(*PCache)(unsafe.Pointer(p)).FszSpill = mxPage
  64729 	}
  64730 	res = numberOfCachePages(tls, p)
  64731 	if res < (*PCache)(unsafe.Pointer(p)).FszSpill {
  64732 		res = (*PCache)(unsafe.Pointer(p)).FszSpill
  64733 	}
  64734 	return res
  64735 }
  64736 
  64737 // Free up as much memory as possible from the page cache.
  64738 func Xsqlite3PcacheShrink(tls *libc.TLS, pCache uintptr) {
  64739 	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{Xsqlite3Config.Fpcache2.FxShrink})).f(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache)
  64740 }
  64741 
  64742 // Return the size of the header added by this middleware layer
  64743 // in the page-cache hierarchy.
  64744 func Xsqlite3HeaderSizePcache(tls *libc.TLS) int32 {
  64745 	return int32((uint64(unsafe.Sizeof(PgHdr{})) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7)))
  64746 }
  64747 
  64748 // Return the number of dirty pages currently in the cache, as a percentage
  64749 // of the configured cache size.
  64750 func Xsqlite3PCachePercentDirty(tls *libc.TLS, pCache uintptr) int32 {
  64751 	var pDirty uintptr
  64752 	var nDirty int32 = 0
  64753 	var nCache int32 = numberOfCachePages(tls, pCache)
  64754 	for pDirty = (*PCache)(unsafe.Pointer(pCache)).FpDirty; pDirty != 0; pDirty = (*PgHdr)(unsafe.Pointer(pDirty)).FpDirtyNext {
  64755 		nDirty++
  64756 	}
  64757 	if nCache != 0 {
  64758 		return int32(I64(nDirty) * int64(100) / I64(nCache))
  64759 	}
  64760 	return 0
  64761 }
  64762 
  64763 type PCache11 = struct {
  64764 	FpGroup          uintptr
  64765 	FpnPurgeable     uintptr
  64766 	FszPage          int32
  64767 	FszExtra         int32
  64768 	FszAlloc         int32
  64769 	FbPurgeable      int32
  64770 	FnMin            uint32
  64771 	FnMax            uint32
  64772 	Fn90pct          uint32
  64773 	FiMaxKey         uint32
  64774 	FnPurgeableDummy uint32
  64775 	FnRecyclable     uint32
  64776 	FnPage           uint32
  64777 	FnHash           uint32
  64778 	FapHash          uintptr
  64779 	FpFree           uintptr
  64780 	FpBulk           uintptr
  64781 }
  64782 
  64783 type PCache1 = PCache11
  64784 type PgHdr11 = struct {
  64785 	Fpage        Sqlite3_pcache_page
  64786 	FiKey        uint32
  64787 	FisBulkLocal U16
  64788 	FisAnchor    U16
  64789 	FpNext       uintptr
  64790 	FpCache      uintptr
  64791 	FpLruNext    uintptr
  64792 	FpLruPrev    uintptr
  64793 }
  64794 
  64795 type PgHdr1 = PgHdr11
  64796 type PgFreeslot1 = struct{ FpNext uintptr }
  64797 
  64798 type PgFreeslot = PgFreeslot1
  64799 type PGroup1 = struct {
  64800 	Fmutex      uintptr
  64801 	FnMaxPage   uint32
  64802 	FnMinPage   uint32
  64803 	FmxPinned   uint32
  64804 	FnPurgeable uint32
  64805 	Flru        PgHdr1
  64806 }
  64807 
  64808 type PGroup = PGroup1
  64809 
  64810 // Global data used by this cache.
  64811 type PCacheGlobal = struct {
  64812 	Fgrp            PGroup
  64813 	FisInit         int32
  64814 	FseparateCache  int32
  64815 	FnInitPage      int32
  64816 	FszSlot         int32
  64817 	FnSlot          int32
  64818 	FnReserve       int32
  64819 	FpStart         uintptr
  64820 	FpEnd           uintptr
  64821 	Fmutex          uintptr
  64822 	FpFree          uintptr
  64823 	FnFreeSlot      int32
  64824 	FbUnderPressure int32
  64825 }
  64826 
  64827 var pcache1_g PCacheGlobal
  64828 
  64829 // This function is called during initialization if a static buffer is
  64830 // supplied to use for the page-cache by passing the SQLITE_CONFIG_PAGECACHE
  64831 // verb to sqlite3_config(). Parameter pBuf points to an allocation large
  64832 // enough to contain 'n' buffers of 'sz' bytes each.
  64833 //
  64834 // This routine is called from sqlite3_initialize() and so it is guaranteed
  64835 // to be serialized already.  There is no need for further mutexing.
  64836 func Xsqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) {
  64837 	if pcache1_g.FisInit != 0 {
  64838 		var p uintptr
  64839 		if pBuf == uintptr(0) {
  64840 			sz = libc.AssignInt32(&n, 0)
  64841 		}
  64842 		if n == 0 {
  64843 			sz = 0
  64844 		}
  64845 		sz = sz & libc.CplInt32(7)
  64846 		pcache1_g.FszSlot = sz
  64847 		pcache1_g.FnSlot = libc.AssignPtrInt32(uintptr(unsafe.Pointer(&pcache1_g))+136, n)
  64848 		pcache1_g.FnReserve = func() int32 {
  64849 			if n > 90 {
  64850 				return 10
  64851 			}
  64852 			return n/10 + 1
  64853 		}()
  64854 		pcache1_g.FpStart = pBuf
  64855 		pcache1_g.FpFree = uintptr(0)
  64856 		pcache1_g.FbUnderPressure = 0
  64857 		for libc.PostDecInt32(&n, 1) != 0 {
  64858 			p = pBuf
  64859 			(*PgFreeslot)(unsafe.Pointer(p)).FpNext = pcache1_g.FpFree
  64860 			pcache1_g.FpFree = p
  64861 			pBuf = pBuf + uintptr(sz)
  64862 		}
  64863 		pcache1_g.FpEnd = pBuf
  64864 	}
  64865 }
  64866 
  64867 func pcache1InitBulk(tls *libc.TLS, pCache uintptr) int32 {
  64868 	var szBulk I64
  64869 	var zBulk uintptr
  64870 	if pcache1_g.FnInitPage == 0 {
  64871 		return 0
  64872 	}
  64873 
  64874 	if (*PCache1)(unsafe.Pointer(pCache)).FnMax < uint32(3) {
  64875 		return 0
  64876 	}
  64877 	Xsqlite3BeginBenignMalloc(tls)
  64878 	if pcache1_g.FnInitPage > 0 {
  64879 		szBulk = I64((*PCache1)(unsafe.Pointer(pCache)).FszAlloc) * I64(pcache1_g.FnInitPage)
  64880 	} else {
  64881 		szBulk = int64(-1024) * I64(pcache1_g.FnInitPage)
  64882 	}
  64883 	if szBulk > I64((*PCache1)(unsafe.Pointer(pCache)).FszAlloc)*I64((*PCache1)(unsafe.Pointer(pCache)).FnMax) {
  64884 		szBulk = I64((*PCache1)(unsafe.Pointer(pCache)).FszAlloc) * I64((*PCache1)(unsafe.Pointer(pCache)).FnMax)
  64885 	}
  64886 	zBulk = libc.AssignPtrUintptr(pCache+80, Xsqlite3Malloc(tls, uint64(szBulk)))
  64887 	Xsqlite3EndBenignMalloc(tls)
  64888 	if zBulk != 0 {
  64889 		var nBulk int32 = Xsqlite3MallocSize(tls, zBulk) / (*PCache1)(unsafe.Pointer(pCache)).FszAlloc
  64890 		for __ccgo := true; __ccgo; __ccgo = libc.PreDecInt32(&nBulk, 1) != 0 {
  64891 			var pX uintptr = zBulk + uintptr((*PCache1)(unsafe.Pointer(pCache)).FszPage)
  64892 			(*PgHdr1)(unsafe.Pointer(pX)).Fpage.FpBuf = zBulk
  64893 			(*PgHdr1)(unsafe.Pointer(pX)).Fpage.FpExtra = pX + 1*56
  64894 			(*PgHdr1)(unsafe.Pointer(pX)).FisBulkLocal = U16(1)
  64895 			(*PgHdr1)(unsafe.Pointer(pX)).FisAnchor = U16(0)
  64896 			(*PgHdr1)(unsafe.Pointer(pX)).FpNext = (*PCache1)(unsafe.Pointer(pCache)).FpFree
  64897 			(*PgHdr1)(unsafe.Pointer(pX)).FpLruPrev = uintptr(0)
  64898 			(*PCache1)(unsafe.Pointer(pCache)).FpFree = pX
  64899 			zBulk += uintptr((*PCache1)(unsafe.Pointer(pCache)).FszAlloc)
  64900 		}
  64901 	}
  64902 	return libc.Bool32((*PCache1)(unsafe.Pointer(pCache)).FpFree != uintptr(0))
  64903 }
  64904 
  64905 func pcache1Alloc(tls *libc.TLS, nByte int32) uintptr {
  64906 	var p uintptr = uintptr(0)
  64907 
  64908 	if nByte <= pcache1_g.FszSlot {
  64909 		Xsqlite3_mutex_enter(tls, pcache1_g.Fmutex)
  64910 		p = pcache1_g.FpFree
  64911 		if p != 0 {
  64912 			pcache1_g.FpFree = (*PgFreeslot)(unsafe.Pointer(pcache1_g.FpFree)).FpNext
  64913 			pcache1_g.FnFreeSlot--
  64914 			pcache1_g.FbUnderPressure = libc.Bool32(pcache1_g.FnFreeSlot < pcache1_g.FnReserve)
  64915 
  64916 			Xsqlite3StatusHighwater(tls, SQLITE_STATUS_PAGECACHE_SIZE, nByte)
  64917 			Xsqlite3StatusUp(tls, SQLITE_STATUS_PAGECACHE_USED, 1)
  64918 		}
  64919 		Xsqlite3_mutex_leave(tls, pcache1_g.Fmutex)
  64920 	}
  64921 	if p == uintptr(0) {
  64922 		p = Xsqlite3Malloc(tls, uint64(nByte))
  64923 		if p != 0 {
  64924 			var sz int32 = Xsqlite3MallocSize(tls, p)
  64925 			Xsqlite3_mutex_enter(tls, pcache1_g.Fmutex)
  64926 			Xsqlite3StatusHighwater(tls, SQLITE_STATUS_PAGECACHE_SIZE, nByte)
  64927 			Xsqlite3StatusUp(tls, SQLITE_STATUS_PAGECACHE_OVERFLOW, sz)
  64928 			Xsqlite3_mutex_leave(tls, pcache1_g.Fmutex)
  64929 		}
  64930 
  64931 	}
  64932 	return p
  64933 }
  64934 
  64935 func pcache1Free(tls *libc.TLS, p uintptr) {
  64936 	if p == uintptr(0) {
  64937 		return
  64938 	}
  64939 	if Uptr(p) >= Uptr(pcache1_g.FpStart) && Uptr(p) < Uptr(pcache1_g.FpEnd) {
  64940 		var pSlot uintptr
  64941 		Xsqlite3_mutex_enter(tls, pcache1_g.Fmutex)
  64942 		Xsqlite3StatusDown(tls, SQLITE_STATUS_PAGECACHE_USED, 1)
  64943 		pSlot = p
  64944 		(*PgFreeslot)(unsafe.Pointer(pSlot)).FpNext = pcache1_g.FpFree
  64945 		pcache1_g.FpFree = pSlot
  64946 		pcache1_g.FnFreeSlot++
  64947 		pcache1_g.FbUnderPressure = libc.Bool32(pcache1_g.FnFreeSlot < pcache1_g.FnReserve)
  64948 
  64949 		Xsqlite3_mutex_leave(tls, pcache1_g.Fmutex)
  64950 	} else {
  64951 		{
  64952 			var nFreed int32 = 0
  64953 			nFreed = Xsqlite3MallocSize(tls, p)
  64954 			Xsqlite3_mutex_enter(tls, pcache1_g.Fmutex)
  64955 			Xsqlite3StatusDown(tls, SQLITE_STATUS_PAGECACHE_OVERFLOW, nFreed)
  64956 			Xsqlite3_mutex_leave(tls, pcache1_g.Fmutex)
  64957 
  64958 		}
  64959 		Xsqlite3_free(tls, p)
  64960 	}
  64961 }
  64962 
  64963 func pcache1MemSize(tls *libc.TLS, p uintptr) int32 {
  64964 	if p >= pcache1_g.FpStart && p < pcache1_g.FpEnd {
  64965 		return pcache1_g.FszSlot
  64966 	} else {
  64967 		var iSize int32
  64968 
  64969 		iSize = Xsqlite3MallocSize(tls, p)
  64970 
  64971 		return iSize
  64972 	}
  64973 	return int32(0)
  64974 }
  64975 
  64976 func pcache1AllocPage(tls *libc.TLS, pCache uintptr, benignMalloc int32) uintptr {
  64977 	var p uintptr = uintptr(0)
  64978 	var pPg uintptr
  64979 
  64980 	if (*PCache1)(unsafe.Pointer(pCache)).FpFree != 0 || (*PCache1)(unsafe.Pointer(pCache)).FnPage == uint32(0) && pcache1InitBulk(tls, pCache) != 0 {
  64981 		p = (*PCache1)(unsafe.Pointer(pCache)).FpFree
  64982 		(*PCache1)(unsafe.Pointer(pCache)).FpFree = (*PgHdr1)(unsafe.Pointer(p)).FpNext
  64983 		(*PgHdr1)(unsafe.Pointer(p)).FpNext = uintptr(0)
  64984 	} else {
  64985 		Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
  64986 		if benignMalloc != 0 {
  64987 			Xsqlite3BeginBenignMalloc(tls)
  64988 		}
  64989 		pPg = pcache1Alloc(tls, (*PCache1)(unsafe.Pointer(pCache)).FszAlloc)
  64990 		if benignMalloc != 0 {
  64991 			Xsqlite3EndBenignMalloc(tls)
  64992 		}
  64993 		Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
  64994 		if pPg == uintptr(0) {
  64995 			return uintptr(0)
  64996 		}
  64997 		p = pPg + uintptr((*PCache1)(unsafe.Pointer(pCache)).FszPage)
  64998 		(*PgHdr1)(unsafe.Pointer(p)).Fpage.FpBuf = pPg
  64999 		(*PgHdr1)(unsafe.Pointer(p)).Fpage.FpExtra = p + 1*56
  65000 		(*PgHdr1)(unsafe.Pointer(p)).FisBulkLocal = U16(0)
  65001 		(*PgHdr1)(unsafe.Pointer(p)).FisAnchor = U16(0)
  65002 		(*PgHdr1)(unsafe.Pointer(p)).FpLruPrev = uintptr(0)
  65003 	}
  65004 	*(*uint32)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpnPurgeable))++
  65005 	return p
  65006 }
  65007 
  65008 func pcache1FreePage(tls *libc.TLS, p uintptr) {
  65009 	var pCache uintptr
  65010 
  65011 	pCache = (*PgHdr1)(unsafe.Pointer(p)).FpCache
  65012 
  65013 	if (*PgHdr1)(unsafe.Pointer(p)).FisBulkLocal != 0 {
  65014 		(*PgHdr1)(unsafe.Pointer(p)).FpNext = (*PCache1)(unsafe.Pointer(pCache)).FpFree
  65015 		(*PCache1)(unsafe.Pointer(pCache)).FpFree = p
  65016 	} else {
  65017 		pcache1Free(tls, (*PgHdr1)(unsafe.Pointer(p)).Fpage.FpBuf)
  65018 	}
  65019 	*(*uint32)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpnPurgeable))--
  65020 }
  65021 
  65022 // Malloc function used by SQLite to obtain space from the buffer configured
  65023 // using sqlite3_config(SQLITE_CONFIG_PAGECACHE) option. If no such buffer
  65024 // exists, this function falls back to sqlite3Malloc().
  65025 func Xsqlite3PageMalloc(tls *libc.TLS, sz int32) uintptr {
  65026 	return pcache1Alloc(tls, sz)
  65027 }
  65028 
  65029 // Free an allocated buffer obtained from sqlite3PageMalloc().
  65030 func Xsqlite3PageFree(tls *libc.TLS, p uintptr) {
  65031 	pcache1Free(tls, p)
  65032 }
  65033 
  65034 func pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) int32 {
  65035 	if pcache1_g.FnSlot != 0 && (*PCache1)(unsafe.Pointer(pCache)).FszPage+(*PCache1)(unsafe.Pointer(pCache)).FszExtra <= pcache1_g.FszSlot {
  65036 		return pcache1_g.FbUnderPressure
  65037 	} else {
  65038 		return Xsqlite3HeapNearlyFull(tls)
  65039 	}
  65040 	return int32(0)
  65041 }
  65042 
  65043 func pcache1ResizeHash(tls *libc.TLS, p uintptr) {
  65044 	var apNew uintptr
  65045 	var nNew uint32
  65046 	var i uint32
  65047 
  65048 	nNew = (*PCache1)(unsafe.Pointer(p)).FnHash * uint32(2)
  65049 	if nNew < uint32(256) {
  65050 		nNew = uint32(256)
  65051 	}
  65052 
  65053 	Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(p)).FpGroup)).Fmutex)
  65054 	if (*PCache1)(unsafe.Pointer(p)).FnHash != 0 {
  65055 		Xsqlite3BeginBenignMalloc(tls)
  65056 	}
  65057 	apNew = Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(uintptr(0)))*uint64(nNew))
  65058 	if (*PCache1)(unsafe.Pointer(p)).FnHash != 0 {
  65059 		Xsqlite3EndBenignMalloc(tls)
  65060 	}
  65061 	Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(p)).FpGroup)).Fmutex)
  65062 	if apNew != 0 {
  65063 		for i = uint32(0); i < (*PCache1)(unsafe.Pointer(p)).FnHash; i++ {
  65064 			var pPage uintptr
  65065 			var pNext uintptr = *(*uintptr)(unsafe.Pointer((*PCache1)(unsafe.Pointer(p)).FapHash + uintptr(i)*8))
  65066 			for libc.AssignUintptr(&pPage, pNext) != uintptr(0) {
  65067 				var h uint32 = (*PgHdr1)(unsafe.Pointer(pPage)).FiKey % nNew
  65068 				pNext = (*PgHdr1)(unsafe.Pointer(pPage)).FpNext
  65069 				(*PgHdr1)(unsafe.Pointer(pPage)).FpNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8))
  65070 				*(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8)) = pPage
  65071 			}
  65072 		}
  65073 		Xsqlite3_free(tls, (*PCache1)(unsafe.Pointer(p)).FapHash)
  65074 		(*PCache1)(unsafe.Pointer(p)).FapHash = apNew
  65075 		(*PCache1)(unsafe.Pointer(p)).FnHash = nNew
  65076 	}
  65077 }
  65078 
  65079 func pcache1PinPage(tls *libc.TLS, pPage uintptr) uintptr {
  65080 	(*PgHdr1)(unsafe.Pointer((*PgHdr1)(unsafe.Pointer(pPage)).FpLruPrev)).FpLruNext = (*PgHdr1)(unsafe.Pointer(pPage)).FpLruNext
  65081 	(*PgHdr1)(unsafe.Pointer((*PgHdr1)(unsafe.Pointer(pPage)).FpLruNext)).FpLruPrev = (*PgHdr1)(unsafe.Pointer(pPage)).FpLruPrev
  65082 	(*PgHdr1)(unsafe.Pointer(pPage)).FpLruNext = uintptr(0)
  65083 
  65084 	(*PCache1)(unsafe.Pointer((*PgHdr1)(unsafe.Pointer(pPage)).FpCache)).FnRecyclable--
  65085 	return pPage
  65086 }
  65087 
  65088 func pcache1RemoveFromHash(tls *libc.TLS, pPage uintptr, freeFlag int32) {
  65089 	var h uint32
  65090 	var pCache uintptr = (*PgHdr1)(unsafe.Pointer(pPage)).FpCache
  65091 	var pp uintptr
  65092 
  65093 	h = (*PgHdr1)(unsafe.Pointer(pPage)).FiKey % (*PCache1)(unsafe.Pointer(pCache)).FnHash
  65094 	for pp = (*PCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(h)*8; *(*uintptr)(unsafe.Pointer(pp)) != pPage; pp = *(*uintptr)(unsafe.Pointer(pp)) + 24 {
  65095 	}
  65096 	*(*uintptr)(unsafe.Pointer(pp)) = (*PgHdr1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FpNext
  65097 
  65098 	(*PCache1)(unsafe.Pointer(pCache)).FnPage--
  65099 	if freeFlag != 0 {
  65100 		pcache1FreePage(tls, pPage)
  65101 	}
  65102 }
  65103 
  65104 func pcache1EnforceMaxPage(tls *libc.TLS, pCache uintptr) {
  65105 	var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup
  65106 	var p uintptr
  65107 
  65108 	for (*PGroup)(unsafe.Pointer(pGroup)).FnPurgeable > (*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage &&
  65109 		int32((*PgHdr1)(unsafe.Pointer(libc.AssignUintptr(&p, (*PGroup)(unsafe.Pointer(pGroup)).Flru.FpLruPrev))).FisAnchor) == 0 {
  65110 		pcache1PinPage(tls, p)
  65111 		pcache1RemoveFromHash(tls, p, 1)
  65112 	}
  65113 	if (*PCache1)(unsafe.Pointer(pCache)).FnPage == uint32(0) && (*PCache1)(unsafe.Pointer(pCache)).FpBulk != 0 {
  65114 		Xsqlite3_free(tls, (*PCache1)(unsafe.Pointer(pCache)).FpBulk)
  65115 		(*PCache1)(unsafe.Pointer(pCache)).FpBulk = libc.AssignPtrUintptr(pCache+72, uintptr(0))
  65116 	}
  65117 }
  65118 
  65119 func pcache1TruncateUnsafe(tls *libc.TLS, pCache uintptr, iLimit uint32) {
  65120 	var h uint32
  65121 	var iStop uint32
  65122 
  65123 	if (*PCache1)(unsafe.Pointer(pCache)).FiMaxKey-iLimit < (*PCache1)(unsafe.Pointer(pCache)).FnHash {
  65124 		h = iLimit % (*PCache1)(unsafe.Pointer(pCache)).FnHash
  65125 		iStop = (*PCache1)(unsafe.Pointer(pCache)).FiMaxKey % (*PCache1)(unsafe.Pointer(pCache)).FnHash
  65126 
  65127 	} else {
  65128 		h = (*PCache1)(unsafe.Pointer(pCache)).FnHash / uint32(2)
  65129 		iStop = h - uint32(1)
  65130 	}
  65131 	for {
  65132 		var pp uintptr
  65133 		var pPage uintptr
  65134 
  65135 		pp = (*PCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(h)*8
  65136 		for libc.AssignUintptr(&pPage, *(*uintptr)(unsafe.Pointer(pp))) != uintptr(0) {
  65137 			if (*PgHdr1)(unsafe.Pointer(pPage)).FiKey >= iLimit {
  65138 				(*PCache1)(unsafe.Pointer(pCache)).FnPage--
  65139 				*(*uintptr)(unsafe.Pointer(pp)) = (*PgHdr1)(unsafe.Pointer(pPage)).FpNext
  65140 				if (*PgHdr1)(unsafe.Pointer(pPage)).FpLruNext != uintptr(0) {
  65141 					pcache1PinPage(tls, pPage)
  65142 				}
  65143 				pcache1FreePage(tls, pPage)
  65144 			} else {
  65145 				pp = pPage + 24
  65146 
  65147 			}
  65148 		}
  65149 		if h == iStop {
  65150 			break
  65151 		}
  65152 		h = (h + uint32(1)) % (*PCache1)(unsafe.Pointer(pCache)).FnHash
  65153 	}
  65154 
  65155 }
  65156 
  65157 func pcache1Init(tls *libc.TLS, NotUsed uintptr) int32 {
  65158 	_ = NotUsed
  65159 
  65160 	libc.Xmemset(tls, uintptr(unsafe.Pointer(&pcache1_g)), 0, uint64(unsafe.Sizeof(pcache1_g)))
  65161 
  65162 	pcache1_g.FseparateCache = 0
  65163 
  65164 	if Xsqlite3Config.FbCoreMutex != 0 {
  65165 		pcache1_g.Fgrp.Fmutex = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_LRU)
  65166 		pcache1_g.Fmutex = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_PMEM)
  65167 	}
  65168 	if pcache1_g.FseparateCache != 0 &&
  65169 		Xsqlite3Config.FnPage != 0 &&
  65170 		Xsqlite3Config.FpPage == uintptr(0) {
  65171 		pcache1_g.FnInitPage = Xsqlite3Config.FnPage
  65172 	} else {
  65173 		pcache1_g.FnInitPage = 0
  65174 	}
  65175 	pcache1_g.Fgrp.FmxPinned = uint32(10)
  65176 	pcache1_g.FisInit = 1
  65177 	return SQLITE_OK
  65178 }
  65179 
  65180 func pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) {
  65181 	_ = NotUsed
  65182 
  65183 	libc.Xmemset(tls, uintptr(unsafe.Pointer(&pcache1_g)), 0, uint64(unsafe.Sizeof(pcache1_g)))
  65184 }
  65185 
  65186 func pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) uintptr {
  65187 	var pCache uintptr
  65188 	var pGroup uintptr
  65189 	var sz int32
  65190 
  65191 	sz = int32(uint64(unsafe.Sizeof(PCache1{})) + uint64(unsafe.Sizeof(PGroup{}))*uint64(pcache1_g.FseparateCache))
  65192 	pCache = Xsqlite3MallocZero(tls, uint64(sz))
  65193 	if pCache != 0 {
  65194 		if pcache1_g.FseparateCache != 0 {
  65195 			pGroup = pCache + 1*88
  65196 			(*PGroup)(unsafe.Pointer(pGroup)).FmxPinned = uint32(10)
  65197 		} else {
  65198 			pGroup = uintptr(unsafe.Pointer(&pcache1_g))
  65199 		}
  65200 		Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
  65201 		if int32((*PGroup)(unsafe.Pointer(pGroup)).Flru.FisAnchor) == 0 {
  65202 			(*PGroup)(unsafe.Pointer(pGroup)).Flru.FisAnchor = U16(1)
  65203 			(*PGroup)(unsafe.Pointer(pGroup)).Flru.FpLruPrev = libc.AssignPtrUintptr(pGroup+24+40, pGroup+24)
  65204 		}
  65205 		(*PCache1)(unsafe.Pointer(pCache)).FpGroup = pGroup
  65206 		(*PCache1)(unsafe.Pointer(pCache)).FszPage = szPage
  65207 		(*PCache1)(unsafe.Pointer(pCache)).FszExtra = szExtra
  65208 		(*PCache1)(unsafe.Pointer(pCache)).FszAlloc = int32(uint64(szPage+szExtra) + (uint64(unsafe.Sizeof(PgHdr1{}))+uint64(7))&libc.Uint64FromInt32(libc.CplInt32(7)))
  65209 		(*PCache1)(unsafe.Pointer(pCache)).FbPurgeable = func() int32 {
  65210 			if bPurgeable != 0 {
  65211 				return 1
  65212 			}
  65213 			return 0
  65214 		}()
  65215 		pcache1ResizeHash(tls, pCache)
  65216 		if bPurgeable != 0 {
  65217 			(*PCache1)(unsafe.Pointer(pCache)).FnMin = uint32(10)
  65218 			*(*uint32)(unsafe.Pointer(pGroup + 12)) += (*PCache1)(unsafe.Pointer(pCache)).FnMin
  65219 			(*PGroup)(unsafe.Pointer(pGroup)).FmxPinned = (*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage + uint32(10) - (*PGroup)(unsafe.Pointer(pGroup)).FnMinPage
  65220 			(*PCache1)(unsafe.Pointer(pCache)).FpnPurgeable = pGroup + 20
  65221 		} else {
  65222 			(*PCache1)(unsafe.Pointer(pCache)).FpnPurgeable = pCache + 48
  65223 		}
  65224 		Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
  65225 		if (*PCache1)(unsafe.Pointer(pCache)).FnHash == uint32(0) {
  65226 			pcache1Destroy(tls, pCache)
  65227 			pCache = uintptr(0)
  65228 		}
  65229 	}
  65230 	return pCache
  65231 }
  65232 
  65233 func pcache1Cachesize(tls *libc.TLS, p uintptr, nMax int32) {
  65234 	var pCache uintptr = p
  65235 	var n U32
  65236 
  65237 	if (*PCache1)(unsafe.Pointer(pCache)).FbPurgeable != 0 {
  65238 		var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup
  65239 		Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
  65240 		n = U32(nMax)
  65241 		if n > uint32(0x7fff0000)-(*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage+(*PCache1)(unsafe.Pointer(pCache)).FnMax {
  65242 			n = uint32(0x7fff0000) - (*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage + (*PCache1)(unsafe.Pointer(pCache)).FnMax
  65243 		}
  65244 		*(*uint32)(unsafe.Pointer(pGroup + 8)) += n - (*PCache1)(unsafe.Pointer(pCache)).FnMax
  65245 		(*PGroup)(unsafe.Pointer(pGroup)).FmxPinned = (*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage + uint32(10) - (*PGroup)(unsafe.Pointer(pGroup)).FnMinPage
  65246 		(*PCache1)(unsafe.Pointer(pCache)).FnMax = n
  65247 		(*PCache1)(unsafe.Pointer(pCache)).Fn90pct = (*PCache1)(unsafe.Pointer(pCache)).FnMax * uint32(9) / uint32(10)
  65248 		pcache1EnforceMaxPage(tls, pCache)
  65249 		Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
  65250 	}
  65251 }
  65252 
  65253 func pcache1Shrink(tls *libc.TLS, p uintptr) {
  65254 	var pCache uintptr = p
  65255 	if (*PCache1)(unsafe.Pointer(pCache)).FbPurgeable != 0 {
  65256 		var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup
  65257 		var savedMaxPage uint32
  65258 		Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
  65259 		savedMaxPage = (*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage
  65260 		(*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage = uint32(0)
  65261 		pcache1EnforceMaxPage(tls, pCache)
  65262 		(*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage = savedMaxPage
  65263 		Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
  65264 	}
  65265 }
  65266 
  65267 func pcache1Pagecount(tls *libc.TLS, p uintptr) int32 {
  65268 	var n int32
  65269 	var pCache uintptr = p
  65270 	Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
  65271 	n = int32((*PCache1)(unsafe.Pointer(pCache)).FnPage)
  65272 	Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
  65273 	return n
  65274 }
  65275 
  65276 func pcache1FetchStage2(tls *libc.TLS, pCache uintptr, iKey uint32, createFlag int32) uintptr {
  65277 	var nPinned uint32
  65278 	var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup
  65279 	var pPage uintptr = uintptr(0)
  65280 
  65281 	nPinned = (*PCache1)(unsafe.Pointer(pCache)).FnPage - (*PCache1)(unsafe.Pointer(pCache)).FnRecyclable
  65282 
  65283 	if createFlag == 1 && (nPinned >= (*PGroup)(unsafe.Pointer(pGroup)).FmxPinned ||
  65284 		nPinned >= (*PCache1)(unsafe.Pointer(pCache)).Fn90pct ||
  65285 		pcache1UnderMemoryPressure(tls, pCache) != 0 && (*PCache1)(unsafe.Pointer(pCache)).FnRecyclable < nPinned) {
  65286 		return uintptr(0)
  65287 	}
  65288 
  65289 	if (*PCache1)(unsafe.Pointer(pCache)).FnPage >= (*PCache1)(unsafe.Pointer(pCache)).FnHash {
  65290 		pcache1ResizeHash(tls, pCache)
  65291 	}
  65292 
  65293 	if (*PCache1)(unsafe.Pointer(pCache)).FbPurgeable != 0 &&
  65294 		!(int32((*PgHdr1)(unsafe.Pointer((*PGroup)(unsafe.Pointer(pGroup)).Flru.FpLruPrev)).FisAnchor) != 0) &&
  65295 		((*PCache1)(unsafe.Pointer(pCache)).FnPage+uint32(1) >= (*PCache1)(unsafe.Pointer(pCache)).FnMax || pcache1UnderMemoryPressure(tls, pCache) != 0) {
  65296 		var pOther uintptr
  65297 		pPage = (*PGroup)(unsafe.Pointer(pGroup)).Flru.FpLruPrev
  65298 
  65299 		pcache1RemoveFromHash(tls, pPage, 0)
  65300 		pcache1PinPage(tls, pPage)
  65301 		pOther = (*PgHdr1)(unsafe.Pointer(pPage)).FpCache
  65302 		if (*PCache1)(unsafe.Pointer(pOther)).FszAlloc != (*PCache1)(unsafe.Pointer(pCache)).FszAlloc {
  65303 			pcache1FreePage(tls, pPage)
  65304 			pPage = uintptr(0)
  65305 		} else {
  65306 			*(*uint32)(unsafe.Pointer(pGroup + 20)) -= uint32((*PCache1)(unsafe.Pointer(pOther)).FbPurgeable - (*PCache1)(unsafe.Pointer(pCache)).FbPurgeable)
  65307 		}
  65308 	}
  65309 
  65310 	if !(pPage != 0) {
  65311 		pPage = pcache1AllocPage(tls, pCache, libc.Bool32(createFlag == 1))
  65312 	}
  65313 
  65314 	if pPage != 0 {
  65315 		var h uint32 = iKey % (*PCache1)(unsafe.Pointer(pCache)).FnHash
  65316 		(*PCache1)(unsafe.Pointer(pCache)).FnPage++
  65317 		(*PgHdr1)(unsafe.Pointer(pPage)).FiKey = iKey
  65318 		(*PgHdr1)(unsafe.Pointer(pPage)).FpNext = *(*uintptr)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(h)*8))
  65319 		(*PgHdr1)(unsafe.Pointer(pPage)).FpCache = pCache
  65320 		(*PgHdr1)(unsafe.Pointer(pPage)).FpLruNext = uintptr(0)
  65321 
  65322 		*(*uintptr)(unsafe.Pointer((*PgHdr1)(unsafe.Pointer(pPage)).Fpage.FpExtra)) = uintptr(0)
  65323 		*(*uintptr)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(h)*8)) = pPage
  65324 		if iKey > (*PCache1)(unsafe.Pointer(pCache)).FiMaxKey {
  65325 			(*PCache1)(unsafe.Pointer(pCache)).FiMaxKey = iKey
  65326 		}
  65327 	}
  65328 	return pPage
  65329 }
  65330 
  65331 func pcache1FetchNoMutex(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr {
  65332 	var pCache uintptr = p
  65333 	var pPage uintptr = uintptr(0)
  65334 
  65335 	pPage = *(*uintptr)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(iKey%(*PCache1)(unsafe.Pointer(pCache)).FnHash)*8))
  65336 	for pPage != 0 && (*PgHdr1)(unsafe.Pointer(pPage)).FiKey != iKey {
  65337 		pPage = (*PgHdr1)(unsafe.Pointer(pPage)).FpNext
  65338 	}
  65339 
  65340 	if pPage != 0 {
  65341 		if (*PgHdr1)(unsafe.Pointer(pPage)).FpLruNext != uintptr(0) {
  65342 			return pcache1PinPage(tls, pPage)
  65343 		} else {
  65344 			return pPage
  65345 		}
  65346 	} else if createFlag != 0 {
  65347 		return pcache1FetchStage2(tls, pCache, iKey, createFlag)
  65348 	} else {
  65349 		return uintptr(0)
  65350 	}
  65351 	return uintptr(0)
  65352 }
  65353 
  65354 func pcache1FetchWithMutex(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr {
  65355 	var pCache uintptr = p
  65356 	var pPage uintptr
  65357 
  65358 	Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
  65359 	pPage = pcache1FetchNoMutex(tls, p, iKey, createFlag)
  65360 
  65361 	Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
  65362 	return pPage
  65363 }
  65364 
  65365 func pcache1Fetch(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr {
  65366 	var pCache uintptr = p
  65367 
  65368 	if (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex != 0 {
  65369 		return pcache1FetchWithMutex(tls, p, iKey, createFlag)
  65370 	} else {
  65371 		return pcache1FetchNoMutex(tls, p, iKey, createFlag)
  65372 	}
  65373 	return uintptr(0)
  65374 }
  65375 
  65376 func pcache1Unpin(tls *libc.TLS, p uintptr, pPg uintptr, reuseUnlikely int32) {
  65377 	var pCache uintptr = p
  65378 	var pPage uintptr = pPg
  65379 	var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup
  65380 
  65381 	Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
  65382 
  65383 	if reuseUnlikely != 0 || (*PGroup)(unsafe.Pointer(pGroup)).FnPurgeable > (*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage {
  65384 		pcache1RemoveFromHash(tls, pPage, 1)
  65385 	} else {
  65386 		var ppFirst uintptr = pGroup + 24 + 40
  65387 		(*PgHdr1)(unsafe.Pointer(pPage)).FpLruPrev = pGroup + 24
  65388 		(*PgHdr1)(unsafe.Pointer(libc.AssignPtrUintptr(pPage+40, *(*uintptr)(unsafe.Pointer(ppFirst))))).FpLruPrev = pPage
  65389 		*(*uintptr)(unsafe.Pointer(ppFirst)) = pPage
  65390 		(*PCache1)(unsafe.Pointer(pCache)).FnRecyclable++
  65391 	}
  65392 
  65393 	Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
  65394 }
  65395 
  65396 func pcache1Rekey(tls *libc.TLS, p uintptr, pPg uintptr, iOld uint32, iNew uint32) {
  65397 	var pCache uintptr = p
  65398 	var pPage uintptr = pPg
  65399 	var pp uintptr
  65400 	var hOld uint32
  65401 	var hNew uint32
  65402 
  65403 	Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
  65404 
  65405 	hOld = iOld % (*PCache1)(unsafe.Pointer(pCache)).FnHash
  65406 	pp = (*PCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(hOld)*8
  65407 	for *(*uintptr)(unsafe.Pointer(pp)) != pPage {
  65408 		pp = *(*uintptr)(unsafe.Pointer(pp)) + 24
  65409 	}
  65410 	*(*uintptr)(unsafe.Pointer(pp)) = (*PgHdr1)(unsafe.Pointer(pPage)).FpNext
  65411 
  65412 	hNew = iNew % (*PCache1)(unsafe.Pointer(pCache)).FnHash
  65413 	(*PgHdr1)(unsafe.Pointer(pPage)).FiKey = iNew
  65414 	(*PgHdr1)(unsafe.Pointer(pPage)).FpNext = *(*uintptr)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(hNew)*8))
  65415 	*(*uintptr)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(hNew)*8)) = pPage
  65416 	if iNew > (*PCache1)(unsafe.Pointer(pCache)).FiMaxKey {
  65417 		(*PCache1)(unsafe.Pointer(pCache)).FiMaxKey = iNew
  65418 	}
  65419 
  65420 	Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
  65421 }
  65422 
  65423 func pcache1Truncate(tls *libc.TLS, p uintptr, iLimit uint32) {
  65424 	var pCache uintptr = p
  65425 	Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
  65426 	if iLimit <= (*PCache1)(unsafe.Pointer(pCache)).FiMaxKey {
  65427 		pcache1TruncateUnsafe(tls, pCache, iLimit)
  65428 		(*PCache1)(unsafe.Pointer(pCache)).FiMaxKey = iLimit - uint32(1)
  65429 	}
  65430 	Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
  65431 }
  65432 
  65433 func pcache1Destroy(tls *libc.TLS, p uintptr) {
  65434 	var pCache uintptr = p
  65435 	var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup
  65436 
  65437 	Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
  65438 	if (*PCache1)(unsafe.Pointer(pCache)).FnPage != 0 {
  65439 		pcache1TruncateUnsafe(tls, pCache, uint32(0))
  65440 	}
  65441 
  65442 	*(*uint32)(unsafe.Pointer(pGroup + 8)) -= (*PCache1)(unsafe.Pointer(pCache)).FnMax
  65443 
  65444 	*(*uint32)(unsafe.Pointer(pGroup + 12)) -= (*PCache1)(unsafe.Pointer(pCache)).FnMin
  65445 	(*PGroup)(unsafe.Pointer(pGroup)).FmxPinned = (*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage + uint32(10) - (*PGroup)(unsafe.Pointer(pGroup)).FnMinPage
  65446 	pcache1EnforceMaxPage(tls, pCache)
  65447 	Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
  65448 	Xsqlite3_free(tls, (*PCache1)(unsafe.Pointer(pCache)).FpBulk)
  65449 	Xsqlite3_free(tls, (*PCache1)(unsafe.Pointer(pCache)).FapHash)
  65450 	Xsqlite3_free(tls, pCache)
  65451 }
  65452 
  65453 // This function is called during initialization (sqlite3_initialize()) to
  65454 // install the default pluggable cache module, assuming the user has not
  65455 // already provided an alternative.
  65456 func Xsqlite3PCacheSetDefault(tls *libc.TLS) {
  65457 	bp := tls.Alloc(8)
  65458 	defer tls.Free(8)
  65459 
  65460 	Xsqlite3_config(tls, SQLITE_CONFIG_PCACHE2, libc.VaList(bp, uintptr(unsafe.Pointer(&defaultMethods1))))
  65461 }
  65462 
  65463 var defaultMethods1 = Sqlite3_pcache_methods2{
  65464 	FiVersion:   1,
  65465 	FxInit:      0,
  65466 	FxShutdown:  0,
  65467 	FxCreate:    0,
  65468 	FxCachesize: 0,
  65469 	FxPagecount: 0,
  65470 	FxFetch:     0,
  65471 	FxUnpin:     0,
  65472 	FxRekey:     0,
  65473 	FxTruncate:  0,
  65474 	FxDestroy:   0,
  65475 	FxShrink:    0,
  65476 }
  65477 
  65478 // Return the size of the header on each page of this PCACHE implementation.
  65479 func Xsqlite3HeaderSizePcache1(tls *libc.TLS) int32 {
  65480 	return int32((uint64(unsafe.Sizeof(PgHdr1{})) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7)))
  65481 }
  65482 
  65483 // Return the global mutex used by this PCACHE implementation.  The
  65484 // sqlite3_status() routine needs access to this mutex.
  65485 func Xsqlite3Pcache1Mutex(tls *libc.TLS) uintptr {
  65486 	return pcache1_g.Fmutex
  65487 }
  65488 
  65489 // This function is called to free superfluous dynamically allocated memory
  65490 // held by the pager system. Memory in use by any SQLite pager allocated
  65491 // by the current thread may be sqlite3_free()ed.
  65492 //
  65493 // nReq is the number of bytes of memory required. Once this much has
  65494 // been released, the function returns. The return value is the total number
  65495 // of bytes of memory released.
  65496 func Xsqlite3PcacheReleaseMemory(tls *libc.TLS, nReq int32) int32 {
  65497 	var nFree int32 = 0
  65498 
  65499 	if Xsqlite3Config.FpPage == uintptr(0) {
  65500 		var p uintptr
  65501 		Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer(uintptr(unsafe.Pointer(&pcache1_g)))).Fmutex)
  65502 		for (nReq < 0 || nFree < nReq) &&
  65503 			libc.AssignUintptr(&p, pcache1_g.Fgrp.Flru.FpLruPrev) != uintptr(0) &&
  65504 			int32((*PgHdr1)(unsafe.Pointer(p)).FisAnchor) == 0 {
  65505 			nFree = nFree + pcache1MemSize(tls, (*PgHdr1)(unsafe.Pointer(p)).Fpage.FpBuf)
  65506 
  65507 			pcache1PinPage(tls, p)
  65508 			pcache1RemoveFromHash(tls, p, 1)
  65509 		}
  65510 		Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer(uintptr(unsafe.Pointer(&pcache1_g)))).Fmutex)
  65511 	}
  65512 	return nFree
  65513 }
  65514 
  65515 // Each entry in a RowSet is an instance of the following object.
  65516 //
  65517 // This same object is reused to store a linked list of trees of RowSetEntry
  65518 // objects.  In that alternative use, pRight points to the next entry
  65519 // in the list, pLeft points to the tree, and v is unused.  The
  65520 // RowSet.pForest value points to the head of this forest list.
  65521 type RowSetEntry = struct {
  65522 	Fv      I64
  65523 	FpRight uintptr
  65524 	FpLeft  uintptr
  65525 }
  65526 
  65527 // RowSetEntry objects are allocated in large chunks (instances of the
  65528 // following structure) to reduce memory allocation overhead.  The
  65529 // chunks are kept on a linked list so that they can be deallocated
  65530 // when the RowSet is destroyed.
  65531 type RowSetChunk = struct {
  65532 	FpNextChunk uintptr
  65533 	FaEntry     [42]struct {
  65534 		Fv      I64
  65535 		FpRight uintptr
  65536 		FpLeft  uintptr
  65537 	}
  65538 }
  65539 
  65540 // Allocate a RowSet object.  Return NULL if a memory allocation
  65541 // error occurs.
  65542 func Xsqlite3RowSetInit(tls *libc.TLS, db uintptr) uintptr {
  65543 	var p uintptr = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(RowSet{})))
  65544 	if p != 0 {
  65545 		var N int32 = Xsqlite3DbMallocSize(tls, db, p)
  65546 		(*RowSet)(unsafe.Pointer(p)).FpChunk = uintptr(0)
  65547 		(*RowSet)(unsafe.Pointer(p)).Fdb = db
  65548 		(*RowSet)(unsafe.Pointer(p)).FpEntry = uintptr(0)
  65549 		(*RowSet)(unsafe.Pointer(p)).FpLast = uintptr(0)
  65550 		(*RowSet)(unsafe.Pointer(p)).FpForest = uintptr(0)
  65551 		(*RowSet)(unsafe.Pointer(p)).FpFresh = uintptr((uint64(unsafe.Sizeof(RowSet{}))+uint64(7))&libc.Uint64FromInt32(libc.CplInt32(7))) + p
  65552 		(*RowSet)(unsafe.Pointer(p)).FnFresh = U16((uint64(N) - (uint64(unsafe.Sizeof(RowSet{}))+uint64(7))&libc.Uint64FromInt32(libc.CplInt32(7))) / uint64(unsafe.Sizeof(RowSetEntry{})))
  65553 		(*RowSet)(unsafe.Pointer(p)).FrsFlags = U16(ROWSET_SORTED)
  65554 		(*RowSet)(unsafe.Pointer(p)).FiBatch = 0
  65555 	}
  65556 	return p
  65557 }
  65558 
  65559 // Deallocate all chunks from a RowSet.  This frees all memory that
  65560 // the RowSet has allocated over its lifetime.  This routine is
  65561 // the destructor for the RowSet.
  65562 func Xsqlite3RowSetClear(tls *libc.TLS, pArg uintptr) {
  65563 	var p uintptr = pArg
  65564 	var pChunk uintptr
  65565 	var pNextChunk uintptr
  65566 	for pChunk = (*RowSet)(unsafe.Pointer(p)).FpChunk; pChunk != 0; pChunk = pNextChunk {
  65567 		pNextChunk = (*RowSetChunk)(unsafe.Pointer(pChunk)).FpNextChunk
  65568 		Xsqlite3DbFree(tls, (*RowSet)(unsafe.Pointer(p)).Fdb, pChunk)
  65569 	}
  65570 	(*RowSet)(unsafe.Pointer(p)).FpChunk = uintptr(0)
  65571 	(*RowSet)(unsafe.Pointer(p)).FnFresh = U16(0)
  65572 	(*RowSet)(unsafe.Pointer(p)).FpEntry = uintptr(0)
  65573 	(*RowSet)(unsafe.Pointer(p)).FpLast = uintptr(0)
  65574 	(*RowSet)(unsafe.Pointer(p)).FpForest = uintptr(0)
  65575 	(*RowSet)(unsafe.Pointer(p)).FrsFlags = U16(ROWSET_SORTED)
  65576 }
  65577 
  65578 // Deallocate all chunks from a RowSet.  This frees all memory that
  65579 // the RowSet has allocated over its lifetime.  This routine is
  65580 // the destructor for the RowSet.
  65581 func Xsqlite3RowSetDelete(tls *libc.TLS, pArg uintptr) {
  65582 	Xsqlite3RowSetClear(tls, pArg)
  65583 	Xsqlite3DbFree(tls, (*RowSet)(unsafe.Pointer(pArg)).Fdb, pArg)
  65584 }
  65585 
  65586 func rowSetEntryAlloc(tls *libc.TLS, p uintptr) uintptr {
  65587 	if int32((*RowSet)(unsafe.Pointer(p)).FnFresh) == 0 {
  65588 		var pNew uintptr
  65589 		pNew = Xsqlite3DbMallocRawNN(tls, (*RowSet)(unsafe.Pointer(p)).Fdb, uint64(unsafe.Sizeof(RowSetChunk{})))
  65590 		if pNew == uintptr(0) {
  65591 			return uintptr(0)
  65592 		}
  65593 		(*RowSetChunk)(unsafe.Pointer(pNew)).FpNextChunk = (*RowSet)(unsafe.Pointer(p)).FpChunk
  65594 		(*RowSet)(unsafe.Pointer(p)).FpChunk = pNew
  65595 		(*RowSet)(unsafe.Pointer(p)).FpFresh = pNew + 8
  65596 		(*RowSet)(unsafe.Pointer(p)).FnFresh = uint16(uint64(ROWSET_ALLOCATION_SIZE-8) / uint64(unsafe.Sizeof(RowSetEntry{})))
  65597 	}
  65598 	(*RowSet)(unsafe.Pointer(p)).FnFresh--
  65599 	return libc.PostIncUintptr(&(*RowSet)(unsafe.Pointer(p)).FpFresh, 24)
  65600 }
  65601 
  65602 // Insert a new value into a RowSet.
  65603 //
  65604 // The mallocFailed flag of the database connection is set if a
  65605 // memory allocation fails.
  65606 func Xsqlite3RowSetInsert(tls *libc.TLS, p uintptr, rowid I64) {
  65607 	var pEntry uintptr
  65608 	var pLast uintptr
  65609 
  65610 	pEntry = rowSetEntryAlloc(tls, p)
  65611 	if pEntry == uintptr(0) {
  65612 		return
  65613 	}
  65614 	(*RowSetEntry)(unsafe.Pointer(pEntry)).Fv = rowid
  65615 	(*RowSetEntry)(unsafe.Pointer(pEntry)).FpRight = uintptr(0)
  65616 	pLast = (*RowSet)(unsafe.Pointer(p)).FpLast
  65617 	if pLast != 0 {
  65618 		if rowid <= (*RowSetEntry)(unsafe.Pointer(pLast)).Fv {
  65619 			*(*U16)(unsafe.Pointer(p + 50)) &= libc.Uint16FromInt32(libc.CplInt32(ROWSET_SORTED))
  65620 		}
  65621 		(*RowSetEntry)(unsafe.Pointer(pLast)).FpRight = pEntry
  65622 	} else {
  65623 		(*RowSet)(unsafe.Pointer(p)).FpEntry = pEntry
  65624 	}
  65625 	(*RowSet)(unsafe.Pointer(p)).FpLast = pEntry
  65626 }
  65627 
  65628 func rowSetEntryMerge(tls *libc.TLS, pA uintptr, pB uintptr) uintptr {
  65629 	bp := tls.Alloc(24)
  65630 	defer tls.Free(24)
  65631 
  65632 	var pTail uintptr
  65633 
  65634 	pTail = bp
  65635 
  65636 	for {
  65637 		if (*RowSetEntry)(unsafe.Pointer(pA)).Fv <= (*RowSetEntry)(unsafe.Pointer(pB)).Fv {
  65638 			if (*RowSetEntry)(unsafe.Pointer(pA)).Fv < (*RowSetEntry)(unsafe.Pointer(pB)).Fv {
  65639 				pTail = libc.AssignPtrUintptr(pTail+8, pA)
  65640 			}
  65641 			pA = (*RowSetEntry)(unsafe.Pointer(pA)).FpRight
  65642 			if pA == uintptr(0) {
  65643 				(*RowSetEntry)(unsafe.Pointer(pTail)).FpRight = pB
  65644 				break
  65645 			}
  65646 		} else {
  65647 			pTail = libc.AssignPtrUintptr(pTail+8, pB)
  65648 			pB = (*RowSetEntry)(unsafe.Pointer(pB)).FpRight
  65649 			if pB == uintptr(0) {
  65650 				(*RowSetEntry)(unsafe.Pointer(pTail)).FpRight = pA
  65651 				break
  65652 			}
  65653 		}
  65654 	}
  65655 	return (*RowSetEntry)(unsafe.Pointer(bp)).FpRight
  65656 }
  65657 
  65658 func rowSetEntrySort(tls *libc.TLS, pIn uintptr) uintptr {
  65659 	bp := tls.Alloc(320)
  65660 	defer tls.Free(320)
  65661 
  65662 	var i uint32
  65663 	var pNext uintptr
  65664 
  65665 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof([40]uintptr{})))
  65666 	for pIn != 0 {
  65667 		pNext = (*RowSetEntry)(unsafe.Pointer(pIn)).FpRight
  65668 		(*RowSetEntry)(unsafe.Pointer(pIn)).FpRight = uintptr(0)
  65669 		for i = uint32(0); *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)) != 0; i++ {
  65670 			pIn = rowSetEntryMerge(tls, *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)), pIn)
  65671 			*(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)) = uintptr(0)
  65672 		}
  65673 		*(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)) = pIn
  65674 		pIn = pNext
  65675 	}
  65676 	pIn = *(*uintptr)(unsafe.Pointer(bp))
  65677 	for i = uint32(1); uint64(i) < uint64(unsafe.Sizeof([40]uintptr{}))/uint64(unsafe.Sizeof(uintptr(0))); i++ {
  65678 		if *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)) == uintptr(0) {
  65679 			continue
  65680 		}
  65681 		if pIn != 0 {
  65682 			pIn = rowSetEntryMerge(tls, pIn, *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)))
  65683 		} else {
  65684 			pIn = *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8))
  65685 		}
  65686 	}
  65687 	return pIn
  65688 }
  65689 
  65690 func rowSetTreeToList(tls *libc.TLS, pIn uintptr, ppFirst uintptr, ppLast uintptr) {
  65691 	bp := tls.Alloc(8)
  65692 	defer tls.Free(8)
  65693 
  65694 	if (*RowSetEntry)(unsafe.Pointer(pIn)).FpLeft != 0 {
  65695 		rowSetTreeToList(tls, (*RowSetEntry)(unsafe.Pointer(pIn)).FpLeft, ppFirst, bp)
  65696 		(*RowSetEntry)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpRight = pIn
  65697 	} else {
  65698 		*(*uintptr)(unsafe.Pointer(ppFirst)) = pIn
  65699 	}
  65700 	if (*RowSetEntry)(unsafe.Pointer(pIn)).FpRight != 0 {
  65701 		rowSetTreeToList(tls, (*RowSetEntry)(unsafe.Pointer(pIn)).FpRight, pIn+8, ppLast)
  65702 	} else {
  65703 		*(*uintptr)(unsafe.Pointer(ppLast)) = pIn
  65704 	}
  65705 
  65706 }
  65707 
  65708 func rowSetNDeepTree(tls *libc.TLS, ppList uintptr, iDepth int32) uintptr {
  65709 	var p uintptr
  65710 	var pLeft uintptr
  65711 	if *(*uintptr)(unsafe.Pointer(ppList)) == uintptr(0) {
  65712 		return uintptr(0)
  65713 	}
  65714 	if iDepth > 1 {
  65715 		pLeft = rowSetNDeepTree(tls, ppList, iDepth-1)
  65716 		p = *(*uintptr)(unsafe.Pointer(ppList))
  65717 		if p == uintptr(0) {
  65718 			return pLeft
  65719 		}
  65720 		(*RowSetEntry)(unsafe.Pointer(p)).FpLeft = pLeft
  65721 		*(*uintptr)(unsafe.Pointer(ppList)) = (*RowSetEntry)(unsafe.Pointer(p)).FpRight
  65722 		(*RowSetEntry)(unsafe.Pointer(p)).FpRight = rowSetNDeepTree(tls, ppList, iDepth-1)
  65723 	} else {
  65724 		p = *(*uintptr)(unsafe.Pointer(ppList))
  65725 		*(*uintptr)(unsafe.Pointer(ppList)) = (*RowSetEntry)(unsafe.Pointer(p)).FpRight
  65726 		(*RowSetEntry)(unsafe.Pointer(p)).FpLeft = libc.AssignPtrUintptr(p+8, uintptr(0))
  65727 	}
  65728 	return p
  65729 }
  65730 
  65731 func rowSetListToTree(tls *libc.TLS, pList uintptr) uintptr {
  65732 	bp := tls.Alloc(8)
  65733 	defer tls.Free(8)
  65734 	*(*uintptr)(unsafe.Pointer(bp)) = pList
  65735 
  65736 	var iDepth int32
  65737 	var p uintptr
  65738 	var pLeft uintptr
  65739 
  65740 	p = *(*uintptr)(unsafe.Pointer(bp))
  65741 	*(*uintptr)(unsafe.Pointer(bp)) = (*RowSetEntry)(unsafe.Pointer(p)).FpRight
  65742 	(*RowSetEntry)(unsafe.Pointer(p)).FpLeft = libc.AssignPtrUintptr(p+8, uintptr(0))
  65743 	for iDepth = 1; *(*uintptr)(unsafe.Pointer(bp)) != 0; iDepth++ {
  65744 		pLeft = p
  65745 		p = *(*uintptr)(unsafe.Pointer(bp))
  65746 		*(*uintptr)(unsafe.Pointer(bp)) = (*RowSetEntry)(unsafe.Pointer(p)).FpRight
  65747 		(*RowSetEntry)(unsafe.Pointer(p)).FpLeft = pLeft
  65748 		(*RowSetEntry)(unsafe.Pointer(p)).FpRight = rowSetNDeepTree(tls, bp, iDepth)
  65749 	}
  65750 	return p
  65751 }
  65752 
  65753 // Extract the smallest element from the RowSet.
  65754 // Write the element into *pRowid.  Return 1 on success.  Return
  65755 // 0 if the RowSet is already empty.
  65756 //
  65757 // After this routine has been called, the sqlite3RowSetInsert()
  65758 // routine may not be called again.
  65759 //
  65760 // This routine may not be called after sqlite3RowSetTest() has
  65761 // been used.  Older versions of RowSet allowed that, but as the
  65762 // capability was not used by the code generator, it was removed
  65763 // for code economy.
  65764 func Xsqlite3RowSetNext(tls *libc.TLS, p uintptr, pRowid uintptr) int32 {
  65765 	if int32((*RowSet)(unsafe.Pointer(p)).FrsFlags)&ROWSET_NEXT == 0 {
  65766 		if int32((*RowSet)(unsafe.Pointer(p)).FrsFlags)&ROWSET_SORTED == 0 {
  65767 			(*RowSet)(unsafe.Pointer(p)).FpEntry = rowSetEntrySort(tls, (*RowSet)(unsafe.Pointer(p)).FpEntry)
  65768 		}
  65769 		*(*U16)(unsafe.Pointer(p + 50)) |= U16(ROWSET_SORTED | ROWSET_NEXT)
  65770 	}
  65771 
  65772 	if (*RowSet)(unsafe.Pointer(p)).FpEntry != 0 {
  65773 		*(*I64)(unsafe.Pointer(pRowid)) = (*RowSetEntry)(unsafe.Pointer((*RowSet)(unsafe.Pointer(p)).FpEntry)).Fv
  65774 		(*RowSet)(unsafe.Pointer(p)).FpEntry = (*RowSetEntry)(unsafe.Pointer((*RowSet)(unsafe.Pointer(p)).FpEntry)).FpRight
  65775 		if (*RowSet)(unsafe.Pointer(p)).FpEntry == uintptr(0) {
  65776 			Xsqlite3RowSetClear(tls, p)
  65777 		}
  65778 		return 1
  65779 	} else {
  65780 		return 0
  65781 	}
  65782 	return int32(0)
  65783 }
  65784 
  65785 // Check to see if element iRowid was inserted into the rowset as
  65786 // part of any insert batch prior to iBatch.  Return 1 or 0.
  65787 //
  65788 // If this is the first test of a new batch and if there exist entries
  65789 // on pRowSet->pEntry, then sort those entries into the forest at
  65790 // pRowSet->pForest so that they can be tested.
  65791 func Xsqlite3RowSetTest(tls *libc.TLS, pRowSet uintptr, iBatch int32, iRowid Sqlite3_int64) int32 {
  65792 	bp := tls.Alloc(16)
  65793 	defer tls.Free(16)
  65794 
  65795 	var p uintptr
  65796 	var pTree uintptr
  65797 
  65798 	if iBatch != (*RowSet)(unsafe.Pointer(pRowSet)).FiBatch {
  65799 		p = (*RowSet)(unsafe.Pointer(pRowSet)).FpEntry
  65800 		if p != 0 {
  65801 			var ppPrevTree uintptr = pRowSet + 40
  65802 			if int32((*RowSet)(unsafe.Pointer(pRowSet)).FrsFlags)&ROWSET_SORTED == 0 {
  65803 				p = rowSetEntrySort(tls, p)
  65804 			}
  65805 			for pTree = (*RowSet)(unsafe.Pointer(pRowSet)).FpForest; pTree != 0; pTree = (*RowSetEntry)(unsafe.Pointer(pTree)).FpRight {
  65806 				ppPrevTree = pTree + 8
  65807 				if (*RowSetEntry)(unsafe.Pointer(pTree)).FpLeft == uintptr(0) {
  65808 					(*RowSetEntry)(unsafe.Pointer(pTree)).FpLeft = rowSetListToTree(tls, p)
  65809 					break
  65810 				} else {
  65811 					rowSetTreeToList(tls, (*RowSetEntry)(unsafe.Pointer(pTree)).FpLeft, bp, bp+8)
  65812 					(*RowSetEntry)(unsafe.Pointer(pTree)).FpLeft = uintptr(0)
  65813 					p = rowSetEntryMerge(tls, *(*uintptr)(unsafe.Pointer(bp)), p)
  65814 				}
  65815 			}
  65816 			if pTree == uintptr(0) {
  65817 				*(*uintptr)(unsafe.Pointer(ppPrevTree)) = libc.AssignUintptr(&pTree, rowSetEntryAlloc(tls, pRowSet))
  65818 				if pTree != 0 {
  65819 					(*RowSetEntry)(unsafe.Pointer(pTree)).Fv = int64(0)
  65820 					(*RowSetEntry)(unsafe.Pointer(pTree)).FpRight = uintptr(0)
  65821 					(*RowSetEntry)(unsafe.Pointer(pTree)).FpLeft = rowSetListToTree(tls, p)
  65822 				}
  65823 			}
  65824 			(*RowSet)(unsafe.Pointer(pRowSet)).FpEntry = uintptr(0)
  65825 			(*RowSet)(unsafe.Pointer(pRowSet)).FpLast = uintptr(0)
  65826 			*(*U16)(unsafe.Pointer(pRowSet + 50)) |= U16(ROWSET_SORTED)
  65827 		}
  65828 		(*RowSet)(unsafe.Pointer(pRowSet)).FiBatch = iBatch
  65829 	}
  65830 
  65831 	for pTree = (*RowSet)(unsafe.Pointer(pRowSet)).FpForest; pTree != 0; pTree = (*RowSetEntry)(unsafe.Pointer(pTree)).FpRight {
  65832 		p = (*RowSetEntry)(unsafe.Pointer(pTree)).FpLeft
  65833 		for p != 0 {
  65834 			if (*RowSetEntry)(unsafe.Pointer(p)).Fv < iRowid {
  65835 				p = (*RowSetEntry)(unsafe.Pointer(p)).FpRight
  65836 			} else if (*RowSetEntry)(unsafe.Pointer(p)).Fv > iRowid {
  65837 				p = (*RowSetEntry)(unsafe.Pointer(p)).FpLeft
  65838 			} else {
  65839 				return 1
  65840 			}
  65841 		}
  65842 	}
  65843 	return 0
  65844 }
  65845 
  65846 // Connection to a write-ahead log (WAL) file.
  65847 // There is one object of this type for each pager.
  65848 type Wal1 = struct {
  65849 	FpVfs                uintptr
  65850 	FpDbFd               uintptr
  65851 	FpWalFd              uintptr
  65852 	FiCallback           U32
  65853 	F__ccgo_pad1         [4]byte
  65854 	FmxWalSize           I64
  65855 	FnWiData             int32
  65856 	FszFirstBlock        int32
  65857 	FapWiData            uintptr
  65858 	FszPage              U32
  65859 	FreadLock            I16
  65860 	FsyncFlags           U8
  65861 	FexclusiveMode       U8
  65862 	FwriteLock           U8
  65863 	FckptLock            U8
  65864 	FreadOnly            U8
  65865 	FtruncateOnCommit    U8
  65866 	FsyncHeader          U8
  65867 	FpadToSectorBoundary U8
  65868 	FbShmUnreliable      U8
  65869 	F__ccgo_pad2         [1]byte
  65870 	Fhdr                 WalIndexHdr
  65871 	FminFrame            U32
  65872 	FiReCksum            U32
  65873 	FzWalName            uintptr
  65874 	FnCkpt               U32
  65875 	F__ccgo_pad3         [4]byte
  65876 	FpSnapshot           uintptr
  65877 }
  65878 
  65879 // Connection to a write-ahead log (WAL) file.
  65880 // There is one object of this type for each pager.
  65881 type Wal = Wal1
  65882 
  65883 // An instance of the following structure is allocated for each active
  65884 // savepoint and statement transaction in the system. All such structures
  65885 // are stored in the Pager.aSavepoint[] array, which is allocated and
  65886 // resized using sqlite3Realloc().
  65887 //
  65888 // When a savepoint is created, the PagerSavepoint.iHdrOffset field is
  65889 // set to 0. If a journal-header is written into the main journal while
  65890 // the savepoint is active, then iHdrOffset is set to the byte offset
  65891 // immediately following the last journal record written into the main
  65892 // journal before the journal-header. This is required during savepoint
  65893 // rollback (see pagerPlaybackSavepoint()).
  65894 type PagerSavepoint1 = struct {
  65895 	FiOffset            I64
  65896 	FiHdrOffset         I64
  65897 	FpInSavepoint       uintptr
  65898 	FnOrig              Pgno
  65899 	FiSubRec            Pgno
  65900 	FbTruncateOnRelease int32
  65901 	FaWalData           [4]U32
  65902 	F__ccgo_pad1        [4]byte
  65903 }
  65904 
  65905 // An instance of the following structure is allocated for each active
  65906 // savepoint and statement transaction in the system. All such structures
  65907 // are stored in the Pager.aSavepoint[] array, which is allocated and
  65908 // resized using sqlite3Realloc().
  65909 //
  65910 // When a savepoint is created, the PagerSavepoint.iHdrOffset field is
  65911 // set to 0. If a journal-header is written into the main journal while
  65912 // the savepoint is active, then iHdrOffset is set to the byte offset
  65913 // immediately following the last journal record written into the main
  65914 // journal before the journal-header. This is required during savepoint
  65915 // rollback (see pagerPlaybackSavepoint()).
  65916 type PagerSavepoint = PagerSavepoint1
  65917 
  65918 var aJournalMagic = [8]uint8{
  65919 	uint8(0xd9), uint8(0xd5), uint8(0x05), uint8(0xf9), uint8(0x20), uint8(0xa1), uint8(0x63), uint8(0xd7),
  65920 }
  65921 
  65922 func setGetterMethod(tls *libc.TLS, pPager uintptr) {
  65923 	if (*Pager)(unsafe.Pointer(pPager)).FerrCode != 0 {
  65924 		(*Pager)(unsafe.Pointer(pPager)).FxGet = *(*uintptr)(unsafe.Pointer(&struct {
  65925 			f func(*libc.TLS, uintptr, Pgno, uintptr, int32) int32
  65926 		}{getPageError}))
  65927 	} else if (*Pager)(unsafe.Pointer(pPager)).FbUseFetch != 0 {
  65928 		(*Pager)(unsafe.Pointer(pPager)).FxGet = *(*uintptr)(unsafe.Pointer(&struct {
  65929 			f func(*libc.TLS, uintptr, Pgno, uintptr, int32) int32
  65930 		}{getPageMMap}))
  65931 	} else {
  65932 		(*Pager)(unsafe.Pointer(pPager)).FxGet = *(*uintptr)(unsafe.Pointer(&struct {
  65933 			f func(*libc.TLS, uintptr, Pgno, uintptr, int32) int32
  65934 		}{getPageNormal}))
  65935 	}
  65936 }
  65937 
  65938 func subjRequiresPage(tls *libc.TLS, pPg uintptr) int32 {
  65939 	var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager
  65940 	var p uintptr
  65941 	var pgno Pgno = (*PgHdr)(unsafe.Pointer(pPg)).Fpgno
  65942 	var i int32
  65943 	for i = 0; i < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; i++ {
  65944 		p = (*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(i)*56
  65945 		if (*PagerSavepoint)(unsafe.Pointer(p)).FnOrig >= pgno && 0 == Xsqlite3BitvecTestNotNull(tls, (*PagerSavepoint)(unsafe.Pointer(p)).FpInSavepoint, pgno) {
  65946 			for i = i + 1; i < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; i++ {
  65947 				(*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(i)*56)).FbTruncateOnRelease = 0
  65948 			}
  65949 			return 1
  65950 		}
  65951 	}
  65952 	return 0
  65953 }
  65954 
  65955 func read32bits(tls *libc.TLS, fd uintptr, offset I64, pRes uintptr) int32 {
  65956 	bp := tls.Alloc(4)
  65957 	defer tls.Free(4)
  65958 
  65959 	var rc int32 = Xsqlite3OsRead(tls, fd, bp, int32(unsafe.Sizeof([4]uint8{})), offset)
  65960 	if rc == SQLITE_OK {
  65961 		*(*U32)(unsafe.Pointer(pRes)) = Xsqlite3Get4byte(tls, bp)
  65962 	}
  65963 	return rc
  65964 }
  65965 
  65966 func write32bits(tls *libc.TLS, fd uintptr, offset I64, val U32) int32 {
  65967 	bp := tls.Alloc(4)
  65968 	defer tls.Free(4)
  65969 
  65970 	Xsqlite3Put4byte(tls, bp, val)
  65971 	return Xsqlite3OsWrite(tls, fd, bp, 4, offset)
  65972 }
  65973 
  65974 func pagerUnlockDb(tls *libc.TLS, pPager uintptr, eLock int32) int32 {
  65975 	var rc int32 = SQLITE_OK
  65976 
  65977 	if (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0) {
  65978 		if (*Pager)(unsafe.Pointer(pPager)).FnoLock != 0 {
  65979 			rc = SQLITE_OK
  65980 		} else {
  65981 			rc = Xsqlite3OsUnlock(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, eLock)
  65982 		}
  65983 		if int32((*Pager)(unsafe.Pointer(pPager)).FeLock) != EXCLUSIVE_LOCK+1 {
  65984 			(*Pager)(unsafe.Pointer(pPager)).FeLock = U8(eLock)
  65985 		}
  65986 
  65987 	}
  65988 	(*Pager)(unsafe.Pointer(pPager)).FchangeCountDone = (*Pager)(unsafe.Pointer(pPager)).FtempFile
  65989 	return rc
  65990 }
  65991 
  65992 func pagerLockDb(tls *libc.TLS, pPager uintptr, eLock int32) int32 {
  65993 	var rc int32 = SQLITE_OK
  65994 
  65995 	if int32((*Pager)(unsafe.Pointer(pPager)).FeLock) < eLock || int32((*Pager)(unsafe.Pointer(pPager)).FeLock) == EXCLUSIVE_LOCK+1 {
  65996 		if (*Pager)(unsafe.Pointer(pPager)).FnoLock != 0 {
  65997 			rc = SQLITE_OK
  65998 		} else {
  65999 			rc = Xsqlite3OsLock(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, eLock)
  66000 		}
  66001 		if rc == SQLITE_OK && (int32((*Pager)(unsafe.Pointer(pPager)).FeLock) != EXCLUSIVE_LOCK+1 || eLock == EXCLUSIVE_LOCK) {
  66002 			(*Pager)(unsafe.Pointer(pPager)).FeLock = U8(eLock)
  66003 
  66004 		}
  66005 	}
  66006 	return rc
  66007 }
  66008 
  66009 func jrnlBufferSize(tls *libc.TLS, pPager uintptr) int32 {
  66010 	_ = pPager
  66011 
  66012 	return 0
  66013 }
  66014 
  66015 func readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper U32) int32 {
  66016 	bp := tls.Alloc(24)
  66017 	defer tls.Free(24)
  66018 
  66019 	var rc int32
  66020 
  66021 	var u U32
  66022 
  66023 	*(*int8)(unsafe.Pointer(zSuper)) = int8(0)
  66024 
  66025 	if SQLITE_OK != libc.AssignInt32(&rc, Xsqlite3OsFileSize(tls, pJrnl, bp)) ||
  66026 		*(*I64)(unsafe.Pointer(bp)) < int64(16) ||
  66027 		SQLITE_OK != libc.AssignInt32(&rc, read32bits(tls, pJrnl, *(*I64)(unsafe.Pointer(bp))-int64(16), bp+8)) ||
  66028 		*(*U32)(unsafe.Pointer(bp + 8)) >= nSuper ||
  66029 		I64(*(*U32)(unsafe.Pointer(bp + 8))) > *(*I64)(unsafe.Pointer(bp))-int64(16) ||
  66030 		*(*U32)(unsafe.Pointer(bp + 8)) == U32(0) ||
  66031 		SQLITE_OK != libc.AssignInt32(&rc, read32bits(tls, pJrnl, *(*I64)(unsafe.Pointer(bp))-int64(12), bp+12)) ||
  66032 		SQLITE_OK != libc.AssignInt32(&rc, Xsqlite3OsRead(tls, pJrnl, bp+16, 8, *(*I64)(unsafe.Pointer(bp))-int64(8))) ||
  66033 		libc.Xmemcmp(tls, bp+16, uintptr(unsafe.Pointer(&aJournalMagic)), uint64(8)) != 0 ||
  66034 		SQLITE_OK != libc.AssignInt32(&rc, Xsqlite3OsRead(tls, pJrnl, zSuper, int32(*(*U32)(unsafe.Pointer(bp + 8))), *(*I64)(unsafe.Pointer(bp))-int64(16)-I64(*(*U32)(unsafe.Pointer(bp + 8))))) {
  66035 		return rc
  66036 	}
  66037 
  66038 	for u = U32(0); u < *(*U32)(unsafe.Pointer(bp + 8)); u++ {
  66039 		*(*U32)(unsafe.Pointer(bp + 12)) -= U32(*(*int8)(unsafe.Pointer(zSuper + uintptr(u))))
  66040 	}
  66041 	if *(*U32)(unsafe.Pointer(bp + 12)) != 0 {
  66042 		*(*U32)(unsafe.Pointer(bp + 8)) = U32(0)
  66043 	}
  66044 	*(*int8)(unsafe.Pointer(zSuper + uintptr(*(*U32)(unsafe.Pointer(bp + 8))))) = int8(0)
  66045 	*(*int8)(unsafe.Pointer(zSuper + uintptr(*(*U32)(unsafe.Pointer(bp + 8))+U32(1)))) = int8(0)
  66046 
  66047 	return SQLITE_OK
  66048 }
  66049 
  66050 func journalHdrOffset(tls *libc.TLS, pPager uintptr) I64 {
  66051 	var offset I64 = int64(0)
  66052 	var c I64 = (*Pager)(unsafe.Pointer(pPager)).FjournalOff
  66053 	if c != 0 {
  66054 		offset = ((c-int64(1))/I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize) + int64(1)) * I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize)
  66055 	}
  66056 
  66057 	return offset
  66058 }
  66059 
  66060 func zeroJournalHdr(tls *libc.TLS, pPager uintptr, doTruncate int32) int32 {
  66061 	bp := tls.Alloc(8)
  66062 	defer tls.Free(8)
  66063 
  66064 	var rc int32 = SQLITE_OK
  66065 
  66066 	if (*Pager)(unsafe.Pointer(pPager)).FjournalOff != 0 {
  66067 		var iLimit I64 = (*Pager)(unsafe.Pointer(pPager)).FjournalSizeLimit
  66068 
  66069 		if doTruncate != 0 || iLimit == int64(0) {
  66070 			rc = Xsqlite3OsTruncate(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, int64(0))
  66071 		} else {
  66072 			rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, uintptr(unsafe.Pointer(&zeroHdr)), int32(unsafe.Sizeof(zeroHdr)), int64(0))
  66073 		}
  66074 		if rc == SQLITE_OK && !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) {
  66075 			rc = Xsqlite3OsSync(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, SQLITE_SYNC_DATAONLY|int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags))
  66076 		}
  66077 
  66078 		if rc == SQLITE_OK && iLimit > int64(0) {
  66079 			rc = Xsqlite3OsFileSize(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, bp)
  66080 			if rc == SQLITE_OK && *(*I64)(unsafe.Pointer(bp)) > iLimit {
  66081 				rc = Xsqlite3OsTruncate(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iLimit)
  66082 			}
  66083 		}
  66084 	}
  66085 	return rc
  66086 }
  66087 
  66088 var zeroHdr = [28]int8{0: int8(0)}
  66089 
  66090 func writeJournalHdr(tls *libc.TLS, pPager uintptr) int32 {
  66091 	var rc int32 = SQLITE_OK
  66092 	var zHeader uintptr = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace
  66093 	var nHeader U32 = U32((*Pager)(unsafe.Pointer(pPager)).FpageSize)
  66094 	var nWrite U32
  66095 	var ii int32
  66096 
  66097 	if nHeader > (*Pager)(unsafe.Pointer(pPager)).FsectorSize {
  66098 		nHeader = (*Pager)(unsafe.Pointer(pPager)).FsectorSize
  66099 	}
  66100 
  66101 	for ii = 0; ii < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; ii++ {
  66102 		if (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint+uintptr(ii)*56)).FiHdrOffset == int64(0) {
  66103 			(*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(ii)*56)).FiHdrOffset = (*Pager)(unsafe.Pointer(pPager)).FjournalOff
  66104 		}
  66105 	}
  66106 
  66107 	(*Pager)(unsafe.Pointer(pPager)).FjournalHdr = libc.AssignPtrInt64(pPager+96, journalHdrOffset(tls, pPager))
  66108 
  66109 	if (*Pager)(unsafe.Pointer(pPager)).FnoSync != 0 || int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_MEMORY ||
  66110 		Xsqlite3OsDeviceCharacteristics(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd)&SQLITE_IOCAP_SAFE_APPEND != 0 {
  66111 		libc.Xmemcpy(tls, zHeader, uintptr(unsafe.Pointer(&aJournalMagic)), uint64(unsafe.Sizeof(aJournalMagic)))
  66112 		Xsqlite3Put4byte(tls, zHeader+8, 0xffffffff)
  66113 	} else {
  66114 		libc.Xmemset(tls, zHeader, 0, uint64(unsafe.Sizeof(aJournalMagic))+uint64(4))
  66115 	}
  66116 
  66117 	Xsqlite3_randomness(tls, int32(unsafe.Sizeof(U32(0))), pPager+56)
  66118 	Xsqlite3Put4byte(tls, zHeader+12, (*Pager)(unsafe.Pointer(pPager)).FcksumInit)
  66119 
  66120 	Xsqlite3Put4byte(tls, zHeader+16, (*Pager)(unsafe.Pointer(pPager)).FdbOrigSize)
  66121 
  66122 	Xsqlite3Put4byte(tls, zHeader+20, (*Pager)(unsafe.Pointer(pPager)).FsectorSize)
  66123 
  66124 	Xsqlite3Put4byte(tls, zHeader+24, uint32((*Pager)(unsafe.Pointer(pPager)).FpageSize))
  66125 
  66126 	libc.Xmemset(tls, zHeader+28, 0,
  66127 		uint64(nHeader)-(uint64(unsafe.Sizeof(aJournalMagic))+uint64(20)))
  66128 
  66129 	for nWrite = U32(0); rc == SQLITE_OK && nWrite < (*Pager)(unsafe.Pointer(pPager)).FsectorSize; nWrite = nWrite + nHeader {
  66130 		rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, zHeader, int32(nHeader), (*Pager)(unsafe.Pointer(pPager)).FjournalOff)
  66131 
  66132 		*(*I64)(unsafe.Pointer(pPager + 96)) += I64(nHeader)
  66133 	}
  66134 
  66135 	return rc
  66136 }
  66137 
  66138 func readJournalHdr(tls *libc.TLS, pPager uintptr, isHot int32, journalSize I64, pNRec uintptr, pDbSize uintptr) int32 {
  66139 	bp := tls.Alloc(16)
  66140 	defer tls.Free(16)
  66141 
  66142 	var rc int32
  66143 
  66144 	var iHdrOff I64
  66145 
  66146 	(*Pager)(unsafe.Pointer(pPager)).FjournalOff = journalHdrOffset(tls, pPager)
  66147 	if (*Pager)(unsafe.Pointer(pPager)).FjournalOff+I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize) > journalSize {
  66148 		return SQLITE_DONE
  66149 	}
  66150 	iHdrOff = (*Pager)(unsafe.Pointer(pPager)).FjournalOff
  66151 
  66152 	if isHot != 0 || iHdrOff != (*Pager)(unsafe.Pointer(pPager)).FjournalHdr {
  66153 		rc = Xsqlite3OsRead(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, bp, int32(unsafe.Sizeof([8]uint8{})), iHdrOff)
  66154 		if rc != 0 {
  66155 			return rc
  66156 		}
  66157 		if libc.Xmemcmp(tls, bp, uintptr(unsafe.Pointer(&aJournalMagic)), uint64(unsafe.Sizeof([8]uint8{}))) != 0 {
  66158 			return SQLITE_DONE
  66159 		}
  66160 	}
  66161 
  66162 	if SQLITE_OK != libc.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff+int64(8), pNRec)) ||
  66163 		SQLITE_OK != libc.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff+int64(12), pPager+56)) ||
  66164 		SQLITE_OK != libc.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff+int64(16), pDbSize)) {
  66165 		return rc
  66166 	}
  66167 
  66168 	if (*Pager)(unsafe.Pointer(pPager)).FjournalOff == int64(0) {
  66169 		if SQLITE_OK != libc.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff+int64(20), bp+8)) ||
  66170 			SQLITE_OK != libc.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff+int64(24), bp+12)) {
  66171 			return rc
  66172 		}
  66173 
  66174 		if *(*U32)(unsafe.Pointer(bp + 12)) == U32(0) {
  66175 			*(*U32)(unsafe.Pointer(bp + 12)) = U32((*Pager)(unsafe.Pointer(pPager)).FpageSize)
  66176 		}
  66177 
  66178 		if *(*U32)(unsafe.Pointer(bp + 12)) < U32(512) || *(*U32)(unsafe.Pointer(bp + 8)) < U32(32) ||
  66179 			*(*U32)(unsafe.Pointer(bp + 12)) > U32(SQLITE_MAX_PAGE_SIZE) || *(*U32)(unsafe.Pointer(bp + 8)) > U32(MAX_SECTOR_SIZE) ||
  66180 			(*(*U32)(unsafe.Pointer(bp + 12))-U32(1))&*(*U32)(unsafe.Pointer(bp + 12)) != U32(0) || (*(*U32)(unsafe.Pointer(bp + 8))-U32(1))&*(*U32)(unsafe.Pointer(bp + 8)) != U32(0) {
  66181 			return SQLITE_DONE
  66182 		}
  66183 
  66184 		rc = Xsqlite3PagerSetPagesize(tls, pPager, bp+12, -1)
  66185 
  66186 		(*Pager)(unsafe.Pointer(pPager)).FsectorSize = *(*U32)(unsafe.Pointer(bp + 8))
  66187 	}
  66188 
  66189 	*(*I64)(unsafe.Pointer(pPager + 96)) += I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize)
  66190 	return rc
  66191 }
  66192 
  66193 func writeSuperJournal(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 {
  66194 	bp := tls.Alloc(8)
  66195 	defer tls.Free(8)
  66196 
  66197 	var rc int32
  66198 	var nSuper int32
  66199 	var iHdrOff I64
  66200 
  66201 	var cksum U32 = U32(0)
  66202 
  66203 	if !(zSuper != 0) ||
  66204 		int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_MEMORY ||
  66205 		!((*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0)) {
  66206 		return SQLITE_OK
  66207 	}
  66208 	(*Pager)(unsafe.Pointer(pPager)).FsetSuper = U8(1)
  66209 
  66210 	for nSuper = 0; *(*int8)(unsafe.Pointer(zSuper + uintptr(nSuper))) != 0; nSuper++ {
  66211 		cksum = cksum + U32(*(*int8)(unsafe.Pointer(zSuper + uintptr(nSuper))))
  66212 	}
  66213 
  66214 	if (*Pager)(unsafe.Pointer(pPager)).FfullSync != 0 {
  66215 		(*Pager)(unsafe.Pointer(pPager)).FjournalOff = journalHdrOffset(tls, pPager)
  66216 	}
  66217 	iHdrOff = (*Pager)(unsafe.Pointer(pPager)).FjournalOff
  66218 
  66219 	if 0 != libc.AssignInt32(&rc, write32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff, (*Pager)(unsafe.Pointer(pPager)).FlckPgno)) ||
  66220 		0 != libc.AssignInt32(&rc, Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, zSuper, nSuper, iHdrOff+int64(4))) ||
  66221 		0 != libc.AssignInt32(&rc, write32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff+int64(4)+I64(nSuper), uint32(nSuper))) ||
  66222 		0 != libc.AssignInt32(&rc, write32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff+int64(4)+I64(nSuper)+int64(4), cksum)) ||
  66223 		0 != libc.AssignInt32(&rc, Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, uintptr(unsafe.Pointer(&aJournalMagic)), 8,
  66224 			iHdrOff+int64(4)+I64(nSuper)+int64(8))) {
  66225 		return rc
  66226 	}
  66227 	*(*I64)(unsafe.Pointer(pPager + 96)) += I64(nSuper + 20)
  66228 
  66229 	if SQLITE_OK == libc.AssignInt32(&rc, Xsqlite3OsFileSize(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, bp)) &&
  66230 		*(*I64)(unsafe.Pointer(bp)) > (*Pager)(unsafe.Pointer(pPager)).FjournalOff {
  66231 		rc = Xsqlite3OsTruncate(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (*Pager)(unsafe.Pointer(pPager)).FjournalOff)
  66232 	}
  66233 	return rc
  66234 }
  66235 
  66236 func pager_reset(tls *libc.TLS, pPager uintptr) {
  66237 	(*Pager)(unsafe.Pointer(pPager)).FiDataVersion++
  66238 	Xsqlite3BackupRestart(tls, (*Pager)(unsafe.Pointer(pPager)).FpBackup)
  66239 	Xsqlite3PcacheClear(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
  66240 }
  66241 
  66242 // Return the pPager->iDataVersion value
  66243 func Xsqlite3PagerDataVersion(tls *libc.TLS, pPager uintptr) U32 {
  66244 	return (*Pager)(unsafe.Pointer(pPager)).FiDataVersion
  66245 }
  66246 
  66247 func releaseAllSavepoints(tls *libc.TLS, pPager uintptr) {
  66248 	var ii int32
  66249 	for ii = 0; ii < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; ii++ {
  66250 		Xsqlite3BitvecDestroy(tls, (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint+uintptr(ii)*56)).FpInSavepoint)
  66251 	}
  66252 	if !(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0) || Xsqlite3JournalIsInMemory(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd) != 0 {
  66253 		Xsqlite3OsClose(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd)
  66254 	}
  66255 	Xsqlite3_free(tls, (*Pager)(unsafe.Pointer(pPager)).FaSavepoint)
  66256 	(*Pager)(unsafe.Pointer(pPager)).FaSavepoint = uintptr(0)
  66257 	(*Pager)(unsafe.Pointer(pPager)).FnSavepoint = 0
  66258 	(*Pager)(unsafe.Pointer(pPager)).FnSubRec = U32(0)
  66259 }
  66260 
  66261 func addToSavepointBitvecs(tls *libc.TLS, pPager uintptr, pgno Pgno) int32 {
  66262 	var ii int32
  66263 	var rc int32 = SQLITE_OK
  66264 
  66265 	for ii = 0; ii < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; ii++ {
  66266 		var p uintptr = (*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(ii)*56
  66267 		if pgno <= (*PagerSavepoint)(unsafe.Pointer(p)).FnOrig {
  66268 			rc = rc | Xsqlite3BitvecSet(tls, (*PagerSavepoint)(unsafe.Pointer(p)).FpInSavepoint, pgno)
  66269 
  66270 		}
  66271 	}
  66272 	return rc
  66273 }
  66274 
  66275 func pager_unlock(tls *libc.TLS, pPager uintptr) {
  66276 	Xsqlite3BitvecDestroy(tls, (*Pager)(unsafe.Pointer(pPager)).FpInJournal)
  66277 	(*Pager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0)
  66278 	releaseAllSavepoints(tls, pPager)
  66279 
  66280 	if (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) {
  66281 		Xsqlite3WalEndReadTransaction(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal)
  66282 		(*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN)
  66283 	} else if !(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0) {
  66284 		var rc int32
  66285 		var iDc int32
  66286 		if (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0) {
  66287 			iDc = Xsqlite3OsDeviceCharacteristics(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd)
  66288 		} else {
  66289 			iDc = 0
  66290 		}
  66291 
  66292 		if 0 == iDc&SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN ||
  66293 			1 != int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode)&5 {
  66294 			Xsqlite3OsClose(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd)
  66295 		}
  66296 
  66297 		rc = pagerUnlockDb(tls, pPager, NO_LOCK)
  66298 		if rc != SQLITE_OK && int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_ERROR {
  66299 			(*Pager)(unsafe.Pointer(pPager)).FeLock = U8(EXCLUSIVE_LOCK + 1)
  66300 		}
  66301 
  66302 		(*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN)
  66303 	}
  66304 
  66305 	if (*Pager)(unsafe.Pointer(pPager)).FerrCode != 0 {
  66306 		if int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) == 0 {
  66307 			pager_reset(tls, pPager)
  66308 			(*Pager)(unsafe.Pointer(pPager)).FchangeCountDone = U8(0)
  66309 			(*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN)
  66310 		} else {
  66311 			(*Pager)(unsafe.Pointer(pPager)).FeState = func() uint8 {
  66312 				if (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0) {
  66313 					return uint8(PAGER_OPEN)
  66314 				}
  66315 				return uint8(PAGER_READER)
  66316 			}()
  66317 		}
  66318 		if (*Pager)(unsafe.Pointer(pPager)).FbUseFetch != 0 {
  66319 			Xsqlite3OsUnfetch(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, int64(0), uintptr(0))
  66320 		}
  66321 		(*Pager)(unsafe.Pointer(pPager)).FerrCode = SQLITE_OK
  66322 		setGetterMethod(tls, pPager)
  66323 	}
  66324 
  66325 	(*Pager)(unsafe.Pointer(pPager)).FjournalOff = int64(0)
  66326 	(*Pager)(unsafe.Pointer(pPager)).FjournalHdr = int64(0)
  66327 	(*Pager)(unsafe.Pointer(pPager)).FsetSuper = U8(0)
  66328 }
  66329 
  66330 func pager_error(tls *libc.TLS, pPager uintptr, rc int32) int32 {
  66331 	var rc2 int32 = rc & 0xff
  66332 
  66333 	if rc2 == SQLITE_FULL || rc2 == SQLITE_IOERR {
  66334 		(*Pager)(unsafe.Pointer(pPager)).FerrCode = rc
  66335 		(*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_ERROR)
  66336 		setGetterMethod(tls, pPager)
  66337 	}
  66338 	return rc
  66339 }
  66340 
  66341 func pagerFlushOnCommit(tls *libc.TLS, pPager uintptr, bCommit int32) int32 {
  66342 	if int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) == 0 {
  66343 		return 1
  66344 	}
  66345 	if !(bCommit != 0) {
  66346 		return 0
  66347 	}
  66348 	if !((*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0)) {
  66349 		return 0
  66350 	}
  66351 	return libc.Bool32(Xsqlite3PCachePercentDirty(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) >= 25)
  66352 }
  66353 
  66354 func pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bCommit int32) int32 {
  66355 	var rc int32 = SQLITE_OK
  66356 	var rc2 int32 = SQLITE_OK
  66357 
  66358 	if int32((*Pager)(unsafe.Pointer(pPager)).FeState) < PAGER_WRITER_LOCKED && int32((*Pager)(unsafe.Pointer(pPager)).FeLock) < RESERVED_LOCK {
  66359 		return SQLITE_OK
  66360 	}
  66361 
  66362 	releaseAllSavepoints(tls, pPager)
  66363 
  66364 	if (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0) {
  66365 		if Xsqlite3JournalIsInMemory(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd) != 0 {
  66366 			Xsqlite3OsClose(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd)
  66367 		} else if int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_TRUNCATE {
  66368 			if (*Pager)(unsafe.Pointer(pPager)).FjournalOff == int64(0) {
  66369 				rc = SQLITE_OK
  66370 			} else {
  66371 				rc = Xsqlite3OsTruncate(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, int64(0))
  66372 				if rc == SQLITE_OK && (*Pager)(unsafe.Pointer(pPager)).FfullSync != 0 {
  66373 					rc = Xsqlite3OsSync(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags))
  66374 				}
  66375 			}
  66376 			(*Pager)(unsafe.Pointer(pPager)).FjournalOff = int64(0)
  66377 		} else if int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_PERSIST ||
  66378 			(*Pager)(unsafe.Pointer(pPager)).FexclusiveMode != 0 && int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) != PAGER_JOURNALMODE_WAL {
  66379 			rc = zeroJournalHdr(tls, pPager, libc.Bool32(hasSuper != 0 || (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0))
  66380 			(*Pager)(unsafe.Pointer(pPager)).FjournalOff = int64(0)
  66381 		} else {
  66382 			var bDelete int32 = libc.BoolInt32(!((*Pager)(unsafe.Pointer(pPager)).FtempFile != 0))
  66383 
  66384 			Xsqlite3OsClose(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd)
  66385 			if bDelete != 0 {
  66386 				rc = Xsqlite3OsDelete(tls, (*Pager)(unsafe.Pointer(pPager)).FpVfs, (*Pager)(unsafe.Pointer(pPager)).FzJournal, int32((*Pager)(unsafe.Pointer(pPager)).FextraSync))
  66387 			}
  66388 		}
  66389 	}
  66390 
  66391 	Xsqlite3BitvecDestroy(tls, (*Pager)(unsafe.Pointer(pPager)).FpInJournal)
  66392 	(*Pager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0)
  66393 	(*Pager)(unsafe.Pointer(pPager)).FnRec = 0
  66394 	if rc == SQLITE_OK {
  66395 		if (*Pager)(unsafe.Pointer(pPager)).FmemDb != 0 || pagerFlushOnCommit(tls, pPager, bCommit) != 0 {
  66396 			Xsqlite3PcacheCleanAll(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
  66397 		} else {
  66398 			Xsqlite3PcacheClearWritable(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
  66399 		}
  66400 		Xsqlite3PcacheTruncate(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, (*Pager)(unsafe.Pointer(pPager)).FdbSize)
  66401 	}
  66402 
  66403 	if (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) {
  66404 		rc2 = Xsqlite3WalEndWriteTransaction(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal)
  66405 
  66406 	} else if rc == SQLITE_OK && bCommit != 0 && (*Pager)(unsafe.Pointer(pPager)).FdbFileSize > (*Pager)(unsafe.Pointer(pPager)).FdbSize {
  66407 		rc = pager_truncate(tls, pPager, (*Pager)(unsafe.Pointer(pPager)).FdbSize)
  66408 	}
  66409 
  66410 	if rc == SQLITE_OK && bCommit != 0 {
  66411 		rc = Xsqlite3OsFileControl(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, SQLITE_FCNTL_COMMIT_PHASETWO, uintptr(0))
  66412 		if rc == SQLITE_NOTFOUND {
  66413 			rc = SQLITE_OK
  66414 		}
  66415 	}
  66416 
  66417 	if !(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0) &&
  66418 		(!((*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0)) || Xsqlite3WalExclusiveMode(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, 0) != 0) {
  66419 		rc2 = pagerUnlockDb(tls, pPager, SHARED_LOCK)
  66420 	}
  66421 	(*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_READER)
  66422 	(*Pager)(unsafe.Pointer(pPager)).FsetSuper = U8(0)
  66423 
  66424 	return func() int32 {
  66425 		if rc == SQLITE_OK {
  66426 			return rc2
  66427 		}
  66428 		return rc
  66429 	}()
  66430 }
  66431 
  66432 func pagerUnlockAndRollback(tls *libc.TLS, pPager uintptr) {
  66433 	if int32((*Pager)(unsafe.Pointer(pPager)).FeState) != PAGER_ERROR && int32((*Pager)(unsafe.Pointer(pPager)).FeState) != PAGER_OPEN {
  66434 		if int32((*Pager)(unsafe.Pointer(pPager)).FeState) >= PAGER_WRITER_LOCKED {
  66435 			Xsqlite3BeginBenignMalloc(tls)
  66436 			Xsqlite3PagerRollback(tls, pPager)
  66437 			Xsqlite3EndBenignMalloc(tls)
  66438 		} else if !(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0) {
  66439 			pager_end_transaction(tls, pPager, 0, 0)
  66440 		}
  66441 	}
  66442 	pager_unlock(tls, pPager)
  66443 }
  66444 
  66445 func pager_cksum(tls *libc.TLS, pPager uintptr, aData uintptr) U32 {
  66446 	var cksum U32 = (*Pager)(unsafe.Pointer(pPager)).FcksumInit
  66447 	var i int32 = int32((*Pager)(unsafe.Pointer(pPager)).FpageSize - int64(200))
  66448 	for i > 0 {
  66449 		cksum = cksum + U32(*(*U8)(unsafe.Pointer(aData + uintptr(i))))
  66450 		i = i - 200
  66451 	}
  66452 	return cksum
  66453 }
  66454 
  66455 func pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pDone uintptr, isMainJrnl int32, isSavepnt int32) int32 {
  66456 	bp := tls.Alloc(16)
  66457 	defer tls.Free(16)
  66458 
  66459 	var rc int32
  66460 
  66461 	var aData uintptr
  66462 	var jfd uintptr
  66463 	var isSynced int32
  66464 
  66465 	aData = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace
  66466 
  66467 	if isMainJrnl != 0 {
  66468 		jfd = (*Pager)(unsafe.Pointer(pPager)).Fjfd
  66469 	} else {
  66470 		jfd = (*Pager)(unsafe.Pointer(pPager)).Fsjfd
  66471 	}
  66472 	rc = read32bits(tls, jfd, *(*I64)(unsafe.Pointer(pOffset)), bp)
  66473 	if rc != SQLITE_OK {
  66474 		return rc
  66475 	}
  66476 	rc = Xsqlite3OsRead(tls, jfd, aData, int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), *(*I64)(unsafe.Pointer(pOffset))+int64(4))
  66477 	if rc != SQLITE_OK {
  66478 		return rc
  66479 	}
  66480 	*(*I64)(unsafe.Pointer(pOffset)) += (*Pager)(unsafe.Pointer(pPager)).FpageSize + int64(4) + I64(isMainJrnl*4)
  66481 
  66482 	if *(*Pgno)(unsafe.Pointer(bp)) == Pgno(0) || *(*Pgno)(unsafe.Pointer(bp)) == (*Pager)(unsafe.Pointer(pPager)).FlckPgno {
  66483 		return SQLITE_DONE
  66484 	}
  66485 	if *(*Pgno)(unsafe.Pointer(bp)) > (*Pager)(unsafe.Pointer(pPager)).FdbSize || Xsqlite3BitvecTest(tls, pDone, *(*Pgno)(unsafe.Pointer(bp))) != 0 {
  66486 		return SQLITE_OK
  66487 	}
  66488 	if isMainJrnl != 0 {
  66489 		rc = read32bits(tls, jfd, *(*I64)(unsafe.Pointer(pOffset))-int64(4), bp+4)
  66490 		if rc != 0 {
  66491 			return rc
  66492 		}
  66493 		if !(isSavepnt != 0) && pager_cksum(tls, pPager, aData) != *(*U32)(unsafe.Pointer(bp + 4)) {
  66494 			return SQLITE_DONE
  66495 		}
  66496 	}
  66497 
  66498 	if pDone != 0 && libc.AssignInt32(&rc, Xsqlite3BitvecSet(tls, pDone, *(*Pgno)(unsafe.Pointer(bp)))) != SQLITE_OK {
  66499 		return rc
  66500 	}
  66501 
  66502 	if *(*Pgno)(unsafe.Pointer(bp)) == Pgno(1) && int32((*Pager)(unsafe.Pointer(pPager)).FnReserve) != int32(*(*U8)(unsafe.Pointer(aData + 20))) {
  66503 		(*Pager)(unsafe.Pointer(pPager)).FnReserve = I16(*(*U8)(unsafe.Pointer(aData + 20)))
  66504 	}
  66505 
  66506 	if (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) {
  66507 		*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
  66508 	} else {
  66509 		*(*uintptr)(unsafe.Pointer(bp + 8)) = Xsqlite3PagerLookup(tls, pPager, *(*Pgno)(unsafe.Pointer(bp)))
  66510 	}
  66511 
  66512 	if isMainJrnl != 0 {
  66513 		isSynced = libc.Bool32((*Pager)(unsafe.Pointer(pPager)).FnoSync != 0 || *(*I64)(unsafe.Pointer(pOffset)) <= (*Pager)(unsafe.Pointer(pPager)).FjournalHdr)
  66514 	} else {
  66515 		isSynced = libc.Bool32(*(*uintptr)(unsafe.Pointer(bp + 8)) == uintptr(0) || 0 == int32((*PgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fflags)&PGHDR_NEED_SYNC)
  66516 	}
  66517 	if (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0) &&
  66518 		(int32((*Pager)(unsafe.Pointer(pPager)).FeState) >= PAGER_WRITER_DBMOD || int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) &&
  66519 		isSynced != 0 {
  66520 		var ofst I64 = I64(*(*Pgno)(unsafe.Pointer(bp))-Pgno(1)) * (*Pager)(unsafe.Pointer(pPager)).FpageSize
  66521 
  66522 		rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, aData, int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), ofst)
  66523 
  66524 		if *(*Pgno)(unsafe.Pointer(bp)) > (*Pager)(unsafe.Pointer(pPager)).FdbFileSize {
  66525 			(*Pager)(unsafe.Pointer(pPager)).FdbFileSize = *(*Pgno)(unsafe.Pointer(bp))
  66526 		}
  66527 		if (*Pager)(unsafe.Pointer(pPager)).FpBackup != 0 {
  66528 			Xsqlite3BackupUpdate(tls, (*Pager)(unsafe.Pointer(pPager)).FpBackup, *(*Pgno)(unsafe.Pointer(bp)), aData)
  66529 		}
  66530 	} else if !(isMainJrnl != 0) && *(*uintptr)(unsafe.Pointer(bp + 8)) == uintptr(0) {
  66531 		*(*U8)(unsafe.Pointer(pPager + 25)) |= U8(SPILLFLAG_ROLLBACK)
  66532 		rc = Xsqlite3PagerGet(tls, pPager, *(*Pgno)(unsafe.Pointer(bp)), bp+8, 1)
  66533 
  66534 		*(*U8)(unsafe.Pointer(pPager + 25)) &= libc.Uint8FromInt32(libc.CplInt32(SPILLFLAG_ROLLBACK))
  66535 		if rc != SQLITE_OK {
  66536 			return rc
  66537 		}
  66538 		Xsqlite3PcacheMakeDirty(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
  66539 	}
  66540 	if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 {
  66541 		var pData uintptr
  66542 		pData = (*PgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FpData
  66543 		libc.Xmemcpy(tls, pData, aData, uint64((*Pager)(unsafe.Pointer(pPager)).FpageSize))
  66544 		(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Pager)(unsafe.Pointer(pPager)).FxReiniter})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
  66545 
  66546 		if *(*Pgno)(unsafe.Pointer(bp)) == Pgno(1) {
  66547 			libc.Xmemcpy(tls, pPager+136, pData+24, uint64(unsafe.Sizeof([16]int8{})))
  66548 		}
  66549 		Xsqlite3PcacheRelease(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
  66550 	}
  66551 	return rc
  66552 }
  66553 
  66554 func pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 {
  66555 	bp := tls.Alloc(12)
  66556 	defer tls.Free(12)
  66557 
  66558 	var pVfs uintptr
  66559 	var rc int32
  66560 	var pSuper uintptr
  66561 	var pJournal uintptr
  66562 	var zSuperJournal uintptr
  66563 
  66564 	var zJournal uintptr
  66565 	var zSuperPtr uintptr
  66566 	var zFree uintptr
  66567 	var nSuperPtr int32
  66568 	var flags int32
  66569 
  66570 	var c int32
  66571 	var flags1 int32
  66572 
  66573 	pVfs = (*Pager)(unsafe.Pointer(pPager)).FpVfs
  66574 	zSuperJournal = uintptr(0)
  66575 	zFree = uintptr(0)
  66576 
  66577 	pSuper = Xsqlite3MallocZero(tls, uint64((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile*2))
  66578 	if !!(pSuper != 0) {
  66579 		goto __1
  66580 	}
  66581 	rc = SQLITE_NOMEM
  66582 	pJournal = uintptr(0)
  66583 	goto __2
  66584 __1:
  66585 	flags = SQLITE_OPEN_READONLY | SQLITE_OPEN_SUPER_JOURNAL
  66586 	rc = Xsqlite3OsOpen(tls, pVfs, zSuper, pSuper, flags, uintptr(0))
  66587 	pJournal = pSuper + uintptr((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile)
  66588 __2:
  66589 	;
  66590 	if !(rc != SQLITE_OK) {
  66591 		goto __3
  66592 	}
  66593 	goto delsuper_out
  66594 __3:
  66595 	;
  66596 	rc = Xsqlite3OsFileSize(tls, pSuper, bp)
  66597 	if !(rc != SQLITE_OK) {
  66598 		goto __4
  66599 	}
  66600 	goto delsuper_out
  66601 __4:
  66602 	;
  66603 	nSuperPtr = (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + 1
  66604 	zFree = Xsqlite3Malloc(tls, uint64(int64(4)+*(*I64)(unsafe.Pointer(bp))+I64(nSuperPtr)+int64(2)))
  66605 	if !!(zFree != 0) {
  66606 		goto __5
  66607 	}
  66608 	rc = SQLITE_NOMEM
  66609 	goto delsuper_out
  66610 __5:
  66611 	;
  66612 	*(*int8)(unsafe.Pointer(zFree)) = libc.AssignPtrInt8(zFree+1, libc.AssignPtrInt8(zFree+2, libc.AssignPtrInt8(zFree+3, int8(0))))
  66613 	zSuperJournal = zFree + 4
  66614 	zSuperPtr = zSuperJournal + uintptr(*(*I64)(unsafe.Pointer(bp))+int64(2))
  66615 	rc = Xsqlite3OsRead(tls, pSuper, zSuperJournal, int32(*(*I64)(unsafe.Pointer(bp))), int64(0))
  66616 	if !(rc != SQLITE_OK) {
  66617 		goto __6
  66618 	}
  66619 	goto delsuper_out
  66620 __6:
  66621 	;
  66622 	*(*int8)(unsafe.Pointer(zSuperJournal + uintptr(*(*I64)(unsafe.Pointer(bp))))) = int8(0)
  66623 	*(*int8)(unsafe.Pointer(zSuperJournal + uintptr(*(*I64)(unsafe.Pointer(bp))+int64(1)))) = int8(0)
  66624 
  66625 	zJournal = zSuperJournal
  66626 __7:
  66627 	if !((int64(zJournal)-int64(zSuperJournal))/1 < *(*I64)(unsafe.Pointer(bp))) {
  66628 		goto __8
  66629 	}
  66630 	rc = Xsqlite3OsAccess(tls, pVfs, zJournal, SQLITE_ACCESS_EXISTS, bp+8)
  66631 	if !(rc != SQLITE_OK) {
  66632 		goto __9
  66633 	}
  66634 	goto delsuper_out
  66635 __9:
  66636 	;
  66637 	if !(*(*int32)(unsafe.Pointer(bp + 8)) != 0) {
  66638 		goto __10
  66639 	}
  66640 	flags1 = SQLITE_OPEN_READONLY | SQLITE_OPEN_SUPER_JOURNAL
  66641 	rc = Xsqlite3OsOpen(tls, pVfs, zJournal, pJournal, flags1, uintptr(0))
  66642 	if !(rc != SQLITE_OK) {
  66643 		goto __11
  66644 	}
  66645 	goto delsuper_out
  66646 __11:
  66647 	;
  66648 	rc = readSuperJournal(tls, pJournal, zSuperPtr, uint32(nSuperPtr))
  66649 	Xsqlite3OsClose(tls, pJournal)
  66650 	if !(rc != SQLITE_OK) {
  66651 		goto __12
  66652 	}
  66653 	goto delsuper_out
  66654 __12:
  66655 	;
  66656 	c = libc.Bool32(int32(*(*int8)(unsafe.Pointer(zSuperPtr))) != 0 && libc.Xstrcmp(tls, zSuperPtr, zSuper) == 0)
  66657 	if !(c != 0) {
  66658 		goto __13
  66659 	}
  66660 
  66661 	goto delsuper_out
  66662 __13:
  66663 	;
  66664 __10:
  66665 	;
  66666 	zJournal += uintptr(Xsqlite3Strlen30(tls, zJournal) + 1)
  66667 	goto __7
  66668 __8:
  66669 	;
  66670 	Xsqlite3OsClose(tls, pSuper)
  66671 	rc = Xsqlite3OsDelete(tls, pVfs, zSuper, 0)
  66672 
  66673 delsuper_out:
  66674 	Xsqlite3_free(tls, zFree)
  66675 	if !(pSuper != 0) {
  66676 		goto __14
  66677 	}
  66678 	Xsqlite3OsClose(tls, pSuper)
  66679 
  66680 	Xsqlite3_free(tls, pSuper)
  66681 __14:
  66682 	;
  66683 	return rc
  66684 }
  66685 
  66686 func pager_truncate(tls *libc.TLS, pPager uintptr, nPage Pgno) int32 {
  66687 	bp := tls.Alloc(16)
  66688 	defer tls.Free(16)
  66689 
  66690 	var rc int32 = SQLITE_OK
  66691 
  66692 	if (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0) &&
  66693 		(int32((*Pager)(unsafe.Pointer(pPager)).FeState) >= PAGER_WRITER_DBMOD || int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) {
  66694 		var szPage int32 = int32((*Pager)(unsafe.Pointer(pPager)).FpageSize)
  66695 
  66696 		rc = Xsqlite3OsFileSize(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, bp)
  66697 		*(*I64)(unsafe.Pointer(bp + 8)) = I64(szPage) * I64(nPage)
  66698 		if rc == SQLITE_OK && *(*I64)(unsafe.Pointer(bp)) != *(*I64)(unsafe.Pointer(bp + 8)) {
  66699 			if *(*I64)(unsafe.Pointer(bp)) > *(*I64)(unsafe.Pointer(bp + 8)) {
  66700 				rc = Xsqlite3OsTruncate(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, *(*I64)(unsafe.Pointer(bp + 8)))
  66701 			} else if *(*I64)(unsafe.Pointer(bp))+I64(szPage) <= *(*I64)(unsafe.Pointer(bp + 8)) {
  66702 				var pTmp uintptr = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace
  66703 				libc.Xmemset(tls, pTmp, 0, uint64(szPage))
  66704 
  66705 				Xsqlite3OsFileControlHint(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, SQLITE_FCNTL_SIZE_HINT, bp+8)
  66706 				rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, pTmp, szPage, *(*I64)(unsafe.Pointer(bp + 8))-I64(szPage))
  66707 			}
  66708 			if rc == SQLITE_OK {
  66709 				(*Pager)(unsafe.Pointer(pPager)).FdbFileSize = nPage
  66710 			}
  66711 		}
  66712 	}
  66713 	return rc
  66714 }
  66715 
  66716 // Return a sanitized version of the sector-size of OS file pFile. The
  66717 // return value is guaranteed to lie between 32 and MAX_SECTOR_SIZE.
  66718 func Xsqlite3SectorSize(tls *libc.TLS, pFile uintptr) int32 {
  66719 	var iRet int32 = Xsqlite3OsSectorSize(tls, pFile)
  66720 	if iRet < 32 {
  66721 		iRet = 512
  66722 	} else if iRet > MAX_SECTOR_SIZE {
  66723 		iRet = MAX_SECTOR_SIZE
  66724 	}
  66725 	return iRet
  66726 }
  66727 
  66728 func setSectorSize(tls *libc.TLS, pPager uintptr) {
  66729 	if (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 ||
  66730 		Xsqlite3OsDeviceCharacteristics(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd)&SQLITE_IOCAP_POWERSAFE_OVERWRITE != 0 {
  66731 		(*Pager)(unsafe.Pointer(pPager)).FsectorSize = U32(512)
  66732 	} else {
  66733 		(*Pager)(unsafe.Pointer(pPager)).FsectorSize = U32(Xsqlite3SectorSize(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd))
  66734 	}
  66735 }
  66736 
  66737 func pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) int32 {
  66738 	bp := tls.Alloc(40)
  66739 	defer tls.Free(40)
  66740 
  66741 	var pVfs uintptr
  66742 
  66743 	var u U32
  66744 
  66745 	var rc int32
  66746 
  66747 	var zSuper uintptr
  66748 	var needPagerReset int32
  66749 	var nPlayback int32
  66750 
  66751 	pVfs = (*Pager)(unsafe.Pointer(pPager)).FpVfs
  66752 	*(*Pgno)(unsafe.Pointer(bp + 32)) = Pgno(0)
  66753 	*(*int32)(unsafe.Pointer(bp + 24)) = 1
  66754 	zSuper = uintptr(0)
  66755 	nPlayback = 0
  66756 	*(*U32)(unsafe.Pointer(bp + 36)) = U32((*Pager)(unsafe.Pointer(pPager)).FpageSize)
  66757 
  66758 	rc = Xsqlite3OsFileSize(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, bp+16)
  66759 	if !(rc != SQLITE_OK) {
  66760 		goto __1
  66761 	}
  66762 	goto end_playback
  66763 __1:
  66764 	;
  66765 	zSuper = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace
  66766 	rc = readSuperJournal(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, zSuper, uint32((*Sqlite3_vfs)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+1))
  66767 	if !(rc == SQLITE_OK && *(*int8)(unsafe.Pointer(zSuper)) != 0) {
  66768 		goto __2
  66769 	}
  66770 	rc = Xsqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+24)
  66771 __2:
  66772 	;
  66773 	zSuper = uintptr(0)
  66774 	if !(rc != SQLITE_OK || !(*(*int32)(unsafe.Pointer(bp + 24)) != 0)) {
  66775 		goto __3
  66776 	}
  66777 	goto end_playback
  66778 __3:
  66779 	;
  66780 	(*Pager)(unsafe.Pointer(pPager)).FjournalOff = int64(0)
  66781 	needPagerReset = isHot
  66782 
  66783 __4:
  66784 	if !(1 != 0) {
  66785 		goto __5
  66786 	}
  66787 
  66788 	rc = readJournalHdr(tls, pPager, isHot, *(*I64)(unsafe.Pointer(bp + 16)), bp+28, bp+32)
  66789 	if !(rc != SQLITE_OK) {
  66790 		goto __6
  66791 	}
  66792 	if !(rc == SQLITE_DONE) {
  66793 		goto __7
  66794 	}
  66795 	rc = SQLITE_OK
  66796 __7:
  66797 	;
  66798 	goto end_playback
  66799 __6:
  66800 	;
  66801 	if !(*(*U32)(unsafe.Pointer(bp + 28)) == 0xffffffff) {
  66802 		goto __8
  66803 	}
  66804 
  66805 	*(*U32)(unsafe.Pointer(bp + 28)) = U32(int32((*(*I64)(unsafe.Pointer(bp + 16)) - I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize)) / ((*Pager)(unsafe.Pointer(pPager)).FpageSize + int64(8))))
  66806 __8:
  66807 	;
  66808 	if !(*(*U32)(unsafe.Pointer(bp + 28)) == U32(0) && !(isHot != 0) && (*Pager)(unsafe.Pointer(pPager)).FjournalHdr+I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize) == (*Pager)(unsafe.Pointer(pPager)).FjournalOff) {
  66809 		goto __9
  66810 	}
  66811 	*(*U32)(unsafe.Pointer(bp + 28)) = U32(int32((*(*I64)(unsafe.Pointer(bp + 16)) - (*Pager)(unsafe.Pointer(pPager)).FjournalOff) / ((*Pager)(unsafe.Pointer(pPager)).FpageSize + int64(8))))
  66812 __9:
  66813 	;
  66814 	if !((*Pager)(unsafe.Pointer(pPager)).FjournalOff == I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize)) {
  66815 		goto __10
  66816 	}
  66817 	rc = pager_truncate(tls, pPager, *(*Pgno)(unsafe.Pointer(bp + 32)))
  66818 	if !(rc != SQLITE_OK) {
  66819 		goto __11
  66820 	}
  66821 	goto end_playback
  66822 __11:
  66823 	;
  66824 	(*Pager)(unsafe.Pointer(pPager)).FdbSize = *(*Pgno)(unsafe.Pointer(bp + 32))
  66825 	if !((*Pager)(unsafe.Pointer(pPager)).FmxPgno < *(*Pgno)(unsafe.Pointer(bp + 32))) {
  66826 		goto __12
  66827 	}
  66828 	(*Pager)(unsafe.Pointer(pPager)).FmxPgno = *(*Pgno)(unsafe.Pointer(bp + 32))
  66829 __12:
  66830 	;
  66831 __10:
  66832 	;
  66833 	u = U32(0)
  66834 __13:
  66835 	if !(u < *(*U32)(unsafe.Pointer(bp + 28))) {
  66836 		goto __15
  66837 	}
  66838 	if !(needPagerReset != 0) {
  66839 		goto __16
  66840 	}
  66841 	pager_reset(tls, pPager)
  66842 	needPagerReset = 0
  66843 __16:
  66844 	;
  66845 	rc = pager_playback_one_page(tls, pPager, pPager+96, uintptr(0), 1, 0)
  66846 	if !(rc == SQLITE_OK) {
  66847 		goto __17
  66848 	}
  66849 	nPlayback++
  66850 	goto __18
  66851 __17:
  66852 	if !(rc == SQLITE_DONE) {
  66853 		goto __19
  66854 	}
  66855 	(*Pager)(unsafe.Pointer(pPager)).FjournalOff = *(*I64)(unsafe.Pointer(bp + 16))
  66856 	goto __15
  66857 	goto __20
  66858 __19:
  66859 	if !(rc == SQLITE_IOERR|int32(2)<<8) {
  66860 		goto __21
  66861 	}
  66862 
  66863 	rc = SQLITE_OK
  66864 	goto end_playback
  66865 	goto __22
  66866 __21:
  66867 	goto end_playback
  66868 __22:
  66869 	;
  66870 __20:
  66871 	;
  66872 __18:
  66873 	;
  66874 	goto __14
  66875 __14:
  66876 	u++
  66877 	goto __13
  66878 	goto __15
  66879 __15:
  66880 	;
  66881 	goto __4
  66882 __5:
  66883 	;
  66884 end_playback:
  66885 	if !(rc == SQLITE_OK) {
  66886 		goto __23
  66887 	}
  66888 	rc = Xsqlite3PagerSetPagesize(tls, pPager, bp+36, -1)
  66889 __23:
  66890 	;
  66891 	(*Pager)(unsafe.Pointer(pPager)).FchangeCountDone = (*Pager)(unsafe.Pointer(pPager)).FtempFile
  66892 
  66893 	if !(rc == SQLITE_OK) {
  66894 		goto __24
  66895 	}
  66896 
  66897 	zSuper = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace + 4
  66898 	rc = readSuperJournal(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, zSuper, uint32((*Sqlite3_vfs)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+1))
  66899 
  66900 __24:
  66901 	;
  66902 	if !(rc == SQLITE_OK &&
  66903 		(int32((*Pager)(unsafe.Pointer(pPager)).FeState) >= PAGER_WRITER_DBMOD || int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN)) {
  66904 		goto __25
  66905 	}
  66906 	rc = Xsqlite3PagerSync(tls, pPager, uintptr(0))
  66907 __25:
  66908 	;
  66909 	if !(rc == SQLITE_OK) {
  66910 		goto __26
  66911 	}
  66912 	rc = pager_end_transaction(tls, pPager, libc.Bool32(int32(*(*int8)(unsafe.Pointer(zSuper))) != 0), 0)
  66913 
  66914 __26:
  66915 	;
  66916 	if !(rc == SQLITE_OK && *(*int8)(unsafe.Pointer(zSuper)) != 0 && *(*int32)(unsafe.Pointer(bp + 24)) != 0) {
  66917 		goto __27
  66918 	}
  66919 
  66920 	libc.Xmemset(tls, (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace, 0, uint64(4))
  66921 	rc = pager_delsuper(tls, pPager, zSuper)
  66922 
  66923 __27:
  66924 	;
  66925 	if !(isHot != 0 && nPlayback != 0) {
  66926 		goto __28
  66927 	}
  66928 	Xsqlite3_log(tls, SQLITE_NOTICE|int32(2)<<8, ts+5246,
  66929 		libc.VaList(bp, nPlayback, (*Pager)(unsafe.Pointer(pPager)).FzJournal))
  66930 __28:
  66931 	;
  66932 	setSectorSize(tls, pPager)
  66933 	return rc
  66934 }
  66935 
  66936 func readDbPage(tls *libc.TLS, pPg uintptr) int32 {
  66937 	bp := tls.Alloc(4)
  66938 	defer tls.Free(4)
  66939 
  66940 	var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager
  66941 	var rc int32 = SQLITE_OK
  66942 
  66943 	*(*U32)(unsafe.Pointer(bp)) = U32(0)
  66944 
  66945 	if (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) {
  66946 		rc = Xsqlite3WalFindFrame(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, (*PgHdr)(unsafe.Pointer(pPg)).Fpgno, bp)
  66947 		if rc != 0 {
  66948 			return rc
  66949 		}
  66950 	}
  66951 	if *(*U32)(unsafe.Pointer(bp)) != 0 {
  66952 		rc = Xsqlite3WalReadFrame(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, *(*U32)(unsafe.Pointer(bp)), int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), (*PgHdr)(unsafe.Pointer(pPg)).FpData)
  66953 	} else {
  66954 		var iOffset I64 = I64((*PgHdr)(unsafe.Pointer(pPg)).Fpgno-Pgno(1)) * (*Pager)(unsafe.Pointer(pPager)).FpageSize
  66955 		rc = Xsqlite3OsRead(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, (*PgHdr)(unsafe.Pointer(pPg)).FpData, int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), iOffset)
  66956 		if rc == SQLITE_IOERR|int32(2)<<8 {
  66957 			rc = SQLITE_OK
  66958 		}
  66959 	}
  66960 
  66961 	if (*PgHdr)(unsafe.Pointer(pPg)).Fpgno == Pgno(1) {
  66962 		if rc != 0 {
  66963 			libc.Xmemset(tls, pPager+136, 0xff, uint64(unsafe.Sizeof([16]int8{})))
  66964 		} else {
  66965 			var dbFileVers uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpData + 24
  66966 			libc.Xmemcpy(tls, pPager+136, dbFileVers, uint64(unsafe.Sizeof([16]int8{})))
  66967 		}
  66968 	}
  66969 
  66970 	return rc
  66971 }
  66972 
  66973 func pager_write_changecounter(tls *libc.TLS, pPg uintptr) {
  66974 	var change_counter U32
  66975 	if pPg == uintptr(0) {
  66976 		return
  66977 	}
  66978 
  66979 	change_counter = Xsqlite3Get4byte(tls, (*PgHdr)(unsafe.Pointer(pPg)).FpPager+136) + U32(1)
  66980 	Xsqlite3Put4byte(tls, (*PgHdr)(unsafe.Pointer(pPg)).FpData+uintptr(24), change_counter)
  66981 
  66982 	Xsqlite3Put4byte(tls, (*PgHdr)(unsafe.Pointer(pPg)).FpData+uintptr(92), change_counter)
  66983 	Xsqlite3Put4byte(tls, (*PgHdr)(unsafe.Pointer(pPg)).FpData+uintptr(96), uint32(SQLITE_VERSION_NUMBER))
  66984 }
  66985 
  66986 func pagerUndoCallback(tls *libc.TLS, pCtx uintptr, iPg Pgno) int32 {
  66987 	var rc int32 = SQLITE_OK
  66988 	var pPager uintptr = pCtx
  66989 	var pPg uintptr
  66990 
  66991 	pPg = Xsqlite3PagerLookup(tls, pPager, iPg)
  66992 	if pPg != 0 {
  66993 		if Xsqlite3PcachePageRefcount(tls, pPg) == int64(1) {
  66994 			Xsqlite3PcacheDrop(tls, pPg)
  66995 		} else {
  66996 			rc = readDbPage(tls, pPg)
  66997 			if rc == SQLITE_OK {
  66998 				(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Pager)(unsafe.Pointer(pPager)).FxReiniter})).f(tls, pPg)
  66999 			}
  67000 			Xsqlite3PagerUnrefNotNull(tls, pPg)
  67001 		}
  67002 	}
  67003 
  67004 	Xsqlite3BackupRestart(tls, (*Pager)(unsafe.Pointer(pPager)).FpBackup)
  67005 
  67006 	return rc
  67007 }
  67008 
  67009 func pagerRollbackWal(tls *libc.TLS, pPager uintptr) int32 {
  67010 	var rc int32
  67011 	var pList uintptr
  67012 
  67013 	(*Pager)(unsafe.Pointer(pPager)).FdbSize = (*Pager)(unsafe.Pointer(pPager)).FdbOrigSize
  67014 	rc = Xsqlite3WalUndo(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, *(*uintptr)(unsafe.Pointer(&struct {
  67015 		f func(*libc.TLS, uintptr, Pgno) int32
  67016 	}{pagerUndoCallback})), pPager)
  67017 	pList = Xsqlite3PcacheDirtyList(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
  67018 	for pList != 0 && rc == SQLITE_OK {
  67019 		var pNext uintptr = (*PgHdr)(unsafe.Pointer(pList)).FpDirty
  67020 		rc = pagerUndoCallback(tls, pPager, (*PgHdr)(unsafe.Pointer(pList)).Fpgno)
  67021 		pList = pNext
  67022 	}
  67023 
  67024 	return rc
  67025 }
  67026 
  67027 func pagerWalFrames(tls *libc.TLS, pPager uintptr, pList uintptr, nTruncate Pgno, isCommit int32) int32 {
  67028 	bp := tls.Alloc(8)
  67029 	defer tls.Free(8)
  67030 	*(*uintptr)(unsafe.Pointer(bp)) = pList
  67031 
  67032 	var rc int32
  67033 	var nList int32
  67034 	var p uintptr
  67035 
  67036 	if isCommit != 0 {
  67037 		var ppNext uintptr = bp
  67038 		nList = 0
  67039 		for p = *(*uintptr)(unsafe.Pointer(bp)); libc.AssignPtrUintptr(ppNext, p) != uintptr(0); p = (*PgHdr)(unsafe.Pointer(p)).FpDirty {
  67040 			if (*PgHdr)(unsafe.Pointer(p)).Fpgno <= nTruncate {
  67041 				ppNext = p + 32
  67042 				nList++
  67043 			}
  67044 		}
  67045 
  67046 	} else {
  67047 		nList = 1
  67048 	}
  67049 	*(*int32)(unsafe.Pointer(pPager + 248 + 2*4)) += nList
  67050 
  67051 	if (*PgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fpgno == Pgno(1) {
  67052 		pager_write_changecounter(tls, *(*uintptr)(unsafe.Pointer(bp)))
  67053 	}
  67054 	rc = Xsqlite3WalFrames(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal,
  67055 		int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), *(*uintptr)(unsafe.Pointer(bp)), nTruncate, isCommit, int32((*Pager)(unsafe.Pointer(pPager)).FwalSyncFlags))
  67056 	if rc == SQLITE_OK && (*Pager)(unsafe.Pointer(pPager)).FpBackup != 0 {
  67057 		for p = *(*uintptr)(unsafe.Pointer(bp)); p != 0; p = (*PgHdr)(unsafe.Pointer(p)).FpDirty {
  67058 			Xsqlite3BackupUpdate(tls, (*Pager)(unsafe.Pointer(pPager)).FpBackup, (*PgHdr)(unsafe.Pointer(p)).Fpgno, (*PgHdr)(unsafe.Pointer(p)).FpData)
  67059 		}
  67060 	}
  67061 
  67062 	return rc
  67063 }
  67064 
  67065 func pagerBeginReadTransaction(tls *libc.TLS, pPager uintptr) int32 {
  67066 	bp := tls.Alloc(4)
  67067 	defer tls.Free(4)
  67068 
  67069 	var rc int32
  67070 	*(*int32)(unsafe.Pointer(bp)) = 0
  67071 
  67072 	Xsqlite3WalEndReadTransaction(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal)
  67073 
  67074 	rc = Xsqlite3WalBeginReadTransaction(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, bp)
  67075 	if rc != SQLITE_OK || *(*int32)(unsafe.Pointer(bp)) != 0 {
  67076 		pager_reset(tls, pPager)
  67077 		if (*Pager)(unsafe.Pointer(pPager)).FbUseFetch != 0 {
  67078 			Xsqlite3OsUnfetch(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, int64(0), uintptr(0))
  67079 		}
  67080 	}
  67081 
  67082 	return rc
  67083 }
  67084 
  67085 func pagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) int32 {
  67086 	bp := tls.Alloc(8)
  67087 	defer tls.Free(8)
  67088 
  67089 	var nPage Pgno
  67090 
  67091 	nPage = Xsqlite3WalDbsize(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal)
  67092 
  67093 	if nPage == Pgno(0) && (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0) {
  67094 		*(*I64)(unsafe.Pointer(bp)) = int64(0)
  67095 		var rc int32 = Xsqlite3OsFileSize(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, bp)
  67096 		if rc != SQLITE_OK {
  67097 			return rc
  67098 		}
  67099 		nPage = Pgno((*(*I64)(unsafe.Pointer(bp)) + (*Pager)(unsafe.Pointer(pPager)).FpageSize - int64(1)) / (*Pager)(unsafe.Pointer(pPager)).FpageSize)
  67100 	}
  67101 
  67102 	if nPage > (*Pager)(unsafe.Pointer(pPager)).FmxPgno {
  67103 		(*Pager)(unsafe.Pointer(pPager)).FmxPgno = nPage
  67104 	}
  67105 
  67106 	*(*Pgno)(unsafe.Pointer(pnPage)) = nPage
  67107 	return SQLITE_OK
  67108 }
  67109 
  67110 func pagerOpenWalIfPresent(tls *libc.TLS, pPager uintptr) int32 {
  67111 	bp := tls.Alloc(8)
  67112 	defer tls.Free(8)
  67113 
  67114 	var rc int32 = SQLITE_OK
  67115 
  67116 	if !(int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) != 0) {
  67117 		rc = Xsqlite3OsAccess(tls,
  67118 			(*Pager)(unsafe.Pointer(pPager)).FpVfs, (*Pager)(unsafe.Pointer(pPager)).FzWal, SQLITE_ACCESS_EXISTS, bp)
  67119 		if rc == SQLITE_OK {
  67120 			if *(*int32)(unsafe.Pointer(bp)) != 0 {
  67121 				rc = pagerPagecount(tls, pPager, bp+4)
  67122 				if rc != 0 {
  67123 					return rc
  67124 				}
  67125 				if *(*Pgno)(unsafe.Pointer(bp + 4)) == Pgno(0) {
  67126 					rc = Xsqlite3OsDelete(tls, (*Pager)(unsafe.Pointer(pPager)).FpVfs, (*Pager)(unsafe.Pointer(pPager)).FzWal, 0)
  67127 				} else {
  67128 					rc = Xsqlite3PagerOpenWal(tls, pPager, uintptr(0))
  67129 				}
  67130 			} else if int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_WAL {
  67131 				(*Pager)(unsafe.Pointer(pPager)).FjournalMode = U8(PAGER_JOURNALMODE_DELETE)
  67132 			}
  67133 		}
  67134 	}
  67135 	return rc
  67136 }
  67137 
  67138 func pagerPlaybackSavepoint(tls *libc.TLS, pPager uintptr, pSavepoint uintptr) int32 {
  67139 	bp := tls.Alloc(16)
  67140 	defer tls.Free(16)
  67141 
  67142 	var szJ I64
  67143 	var iHdrOff I64
  67144 	var rc int32 = SQLITE_OK
  67145 	var pDone uintptr = uintptr(0)
  67146 
  67147 	if pSavepoint != 0 {
  67148 		pDone = Xsqlite3BitvecCreate(tls, (*PagerSavepoint)(unsafe.Pointer(pSavepoint)).FnOrig)
  67149 		if !(pDone != 0) {
  67150 			return SQLITE_NOMEM
  67151 		}
  67152 	}
  67153 
  67154 	(*Pager)(unsafe.Pointer(pPager)).FdbSize = func() uint32 {
  67155 		if pSavepoint != 0 {
  67156 			return (*PagerSavepoint)(unsafe.Pointer(pSavepoint)).FnOrig
  67157 		}
  67158 		return (*Pager)(unsafe.Pointer(pPager)).FdbOrigSize
  67159 	}()
  67160 	(*Pager)(unsafe.Pointer(pPager)).FchangeCountDone = (*Pager)(unsafe.Pointer(pPager)).FtempFile
  67161 
  67162 	if !(pSavepoint != 0) && (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) {
  67163 		return pagerRollbackWal(tls, pPager)
  67164 	}
  67165 
  67166 	szJ = (*Pager)(unsafe.Pointer(pPager)).FjournalOff
  67167 
  67168 	if pSavepoint != 0 && !((*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0)) {
  67169 		if (*PagerSavepoint)(unsafe.Pointer(pSavepoint)).FiHdrOffset != 0 {
  67170 			iHdrOff = (*PagerSavepoint)(unsafe.Pointer(pSavepoint)).FiHdrOffset
  67171 		} else {
  67172 			iHdrOff = szJ
  67173 		}
  67174 		(*Pager)(unsafe.Pointer(pPager)).FjournalOff = (*PagerSavepoint)(unsafe.Pointer(pSavepoint)).FiOffset
  67175 		for rc == SQLITE_OK && (*Pager)(unsafe.Pointer(pPager)).FjournalOff < iHdrOff {
  67176 			rc = pager_playback_one_page(tls, pPager, pPager+96, pDone, 1, 1)
  67177 		}
  67178 
  67179 	} else {
  67180 		(*Pager)(unsafe.Pointer(pPager)).FjournalOff = int64(0)
  67181 	}
  67182 
  67183 	for rc == SQLITE_OK && (*Pager)(unsafe.Pointer(pPager)).FjournalOff < szJ {
  67184 		var ii U32
  67185 		*(*U32)(unsafe.Pointer(bp)) = U32(0)
  67186 
  67187 		rc = readJournalHdr(tls, pPager, 0, szJ, bp, bp+4)
  67188 
  67189 		if *(*U32)(unsafe.Pointer(bp)) == U32(0) &&
  67190 			(*Pager)(unsafe.Pointer(pPager)).FjournalHdr+I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize) == (*Pager)(unsafe.Pointer(pPager)).FjournalOff {
  67191 			*(*U32)(unsafe.Pointer(bp)) = U32((szJ - (*Pager)(unsafe.Pointer(pPager)).FjournalOff) / ((*Pager)(unsafe.Pointer(pPager)).FpageSize + int64(8)))
  67192 		}
  67193 		for ii = U32(0); rc == SQLITE_OK && ii < *(*U32)(unsafe.Pointer(bp)) && (*Pager)(unsafe.Pointer(pPager)).FjournalOff < szJ; ii++ {
  67194 			rc = pager_playback_one_page(tls, pPager, pPager+96, pDone, 1, 1)
  67195 		}
  67196 
  67197 	}
  67198 
  67199 	if pSavepoint != 0 {
  67200 		var ii U32
  67201 		*(*I64)(unsafe.Pointer(bp + 8)) = I64((*PagerSavepoint)(unsafe.Pointer(pSavepoint)).FiSubRec) * (int64(4) + (*Pager)(unsafe.Pointer(pPager)).FpageSize)
  67202 
  67203 		if (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) {
  67204 			rc = Xsqlite3WalSavepointUndo(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, pSavepoint+36)
  67205 		}
  67206 		for ii = (*PagerSavepoint)(unsafe.Pointer(pSavepoint)).FiSubRec; rc == SQLITE_OK && ii < (*Pager)(unsafe.Pointer(pPager)).FnSubRec; ii++ {
  67207 			rc = pager_playback_one_page(tls, pPager, bp+8, pDone, 0, 1)
  67208 		}
  67209 
  67210 	}
  67211 
  67212 	Xsqlite3BitvecDestroy(tls, pDone)
  67213 	if rc == SQLITE_OK {
  67214 		(*Pager)(unsafe.Pointer(pPager)).FjournalOff = szJ
  67215 	}
  67216 
  67217 	return rc
  67218 }
  67219 
  67220 // Change the maximum number of in-memory pages that are allowed
  67221 // before attempting to recycle clean and unused pages.
  67222 func Xsqlite3PagerSetCachesize(tls *libc.TLS, pPager uintptr, mxPage int32) {
  67223 	Xsqlite3PcacheSetCachesize(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, mxPage)
  67224 }
  67225 
  67226 // Change the maximum number of in-memory pages that are allowed
  67227 // before attempting to spill pages to journal.
  67228 func Xsqlite3PagerSetSpillsize(tls *libc.TLS, pPager uintptr, mxPage int32) int32 {
  67229 	return Xsqlite3PcacheSetSpillsize(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, mxPage)
  67230 }
  67231 
  67232 func pagerFixMaplimit(tls *libc.TLS, pPager uintptr) {
  67233 	bp := tls.Alloc(8)
  67234 	defer tls.Free(8)
  67235 
  67236 	var fd uintptr = (*Pager)(unsafe.Pointer(pPager)).Ffd
  67237 	if (*Sqlite3_file)(unsafe.Pointer(fd)).FpMethods != uintptr(0) && (*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(fd)).FpMethods)).FiVersion >= 3 {
  67238 		*(*Sqlite3_int64)(unsafe.Pointer(bp)) = (*Pager)(unsafe.Pointer(pPager)).FszMmap
  67239 		(*Pager)(unsafe.Pointer(pPager)).FbUseFetch = U8(libc.Bool32(*(*Sqlite3_int64)(unsafe.Pointer(bp)) > int64(0)))
  67240 		setGetterMethod(tls, pPager)
  67241 		Xsqlite3OsFileControlHint(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, SQLITE_FCNTL_MMAP_SIZE, bp)
  67242 	}
  67243 }
  67244 
  67245 // Change the maximum size of any memory mapping made of the database file.
  67246 func Xsqlite3PagerSetMmapLimit(tls *libc.TLS, pPager uintptr, szMmap Sqlite3_int64) {
  67247 	(*Pager)(unsafe.Pointer(pPager)).FszMmap = szMmap
  67248 	pagerFixMaplimit(tls, pPager)
  67249 }
  67250 
  67251 // Free as much memory as possible from the pager.
  67252 func Xsqlite3PagerShrink(tls *libc.TLS, pPager uintptr) {
  67253 	Xsqlite3PcacheShrink(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
  67254 }
  67255 
  67256 // Adjust settings of the pager to those specified in the pgFlags parameter.
  67257 //
  67258 // The "level" in pgFlags & PAGER_SYNCHRONOUS_MASK sets the robustness
  67259 // of the database to damage due to OS crashes or power failures by
  67260 // changing the number of syncs()s when writing the journals.
  67261 // There are four levels:
  67262 //
  67263 //	OFF       sqlite3OsSync() is never called.  This is the default
  67264 //	          for temporary and transient files.
  67265 //
  67266 //	NORMAL    The journal is synced once before writes begin on the
  67267 //	          database.  This is normally adequate protection, but
  67268 //	          it is theoretically possible, though very unlikely,
  67269 //	          that an inopertune power failure could leave the journal
  67270 //	          in a state which would cause damage to the database
  67271 //	          when it is rolled back.
  67272 //
  67273 //	FULL      The journal is synced twice before writes begin on the
  67274 //	          database (with some additional information - the nRec field
  67275 //	          of the journal header - being written in between the two
  67276 //	          syncs).  If we assume that writing a
  67277 //	          single disk sector is atomic, then this mode provides
  67278 //	          assurance that the journal will not be corrupted to the
  67279 //	          point of causing damage to the database during rollback.
  67280 //
  67281 //	EXTRA     This is like FULL except that is also syncs the directory
  67282 //	          that contains the rollback journal after the rollback
  67283 //	          journal is unlinked.
  67284 //
  67285 // The above is for a rollback-journal mode.  For WAL mode, OFF continues
  67286 // to mean that no syncs ever occur.  NORMAL means that the WAL is synced
  67287 // prior to the start of checkpoint and that the database file is synced
  67288 // at the conclusion of the checkpoint if the entire content of the WAL
  67289 // was written back into the database.  But no sync operations occur for
  67290 // an ordinary commit in NORMAL mode with WAL.  FULL means that the WAL
  67291 // file is synced following each commit operation, in addition to the
  67292 // syncs associated with NORMAL.  There is no difference between FULL
  67293 // and EXTRA for WAL mode.
  67294 //
  67295 // Do not confuse synchronous=FULL with SQLITE_SYNC_FULL.  The
  67296 // SQLITE_SYNC_FULL macro means to use the MacOSX-style full-fsync
  67297 // using fcntl(F_FULLFSYNC).  SQLITE_SYNC_NORMAL means to do an
  67298 // ordinary fsync() call.  There is no difference between SQLITE_SYNC_FULL
  67299 // and SQLITE_SYNC_NORMAL on platforms other than MacOSX.  But the
  67300 // synchronous=FULL versus synchronous=NORMAL setting determines when
  67301 // the xSync primitive is called and is relevant to all platforms.
  67302 //
  67303 // Numeric values associated with these states are OFF==1, NORMAL=2,
  67304 // and FULL=3.
  67305 func Xsqlite3PagerSetFlags(tls *libc.TLS, pPager uintptr, pgFlags uint32) {
  67306 	var level uint32 = pgFlags & uint32(PAGER_SYNCHRONOUS_MASK)
  67307 	if (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 {
  67308 		(*Pager)(unsafe.Pointer(pPager)).FnoSync = U8(1)
  67309 		(*Pager)(unsafe.Pointer(pPager)).FfullSync = U8(0)
  67310 		(*Pager)(unsafe.Pointer(pPager)).FextraSync = U8(0)
  67311 	} else {
  67312 		(*Pager)(unsafe.Pointer(pPager)).FnoSync = func() uint8 {
  67313 			if level == uint32(PAGER_SYNCHRONOUS_OFF) {
  67314 				return uint8(1)
  67315 			}
  67316 			return uint8(0)
  67317 		}()
  67318 		(*Pager)(unsafe.Pointer(pPager)).FfullSync = func() uint8 {
  67319 			if level >= uint32(PAGER_SYNCHRONOUS_FULL) {
  67320 				return uint8(1)
  67321 			}
  67322 			return uint8(0)
  67323 		}()
  67324 		(*Pager)(unsafe.Pointer(pPager)).FextraSync = func() uint8 {
  67325 			if level == uint32(PAGER_SYNCHRONOUS_EXTRA) {
  67326 				return uint8(1)
  67327 			}
  67328 			return uint8(0)
  67329 		}()
  67330 	}
  67331 	if (*Pager)(unsafe.Pointer(pPager)).FnoSync != 0 {
  67332 		(*Pager)(unsafe.Pointer(pPager)).FsyncFlags = U8(0)
  67333 	} else if pgFlags&uint32(PAGER_FULLFSYNC) != 0 {
  67334 		(*Pager)(unsafe.Pointer(pPager)).FsyncFlags = U8(SQLITE_SYNC_FULL)
  67335 	} else {
  67336 		(*Pager)(unsafe.Pointer(pPager)).FsyncFlags = U8(SQLITE_SYNC_NORMAL)
  67337 	}
  67338 	(*Pager)(unsafe.Pointer(pPager)).FwalSyncFlags = U8(int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags) << 2)
  67339 	if (*Pager)(unsafe.Pointer(pPager)).FfullSync != 0 {
  67340 		*(*U8)(unsafe.Pointer(pPager + 15)) |= U8(int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags))
  67341 	}
  67342 	if pgFlags&uint32(PAGER_CKPT_FULLFSYNC) != 0 && !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) {
  67343 		*(*U8)(unsafe.Pointer(pPager + 15)) |= U8(int32(SQLITE_SYNC_FULL) << 2)
  67344 	}
  67345 	if pgFlags&uint32(PAGER_CACHESPILL) != 0 {
  67346 		*(*U8)(unsafe.Pointer(pPager + 25)) &= libc.Uint8FromInt32(libc.CplInt32(SPILLFLAG_OFF))
  67347 	} else {
  67348 		*(*U8)(unsafe.Pointer(pPager + 25)) |= U8(SPILLFLAG_OFF)
  67349 	}
  67350 }
  67351 
  67352 func pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32) int32 {
  67353 	var rc int32
  67354 
  67355 	vfsFlags = vfsFlags | (SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_DELETEONCLOSE)
  67356 	rc = Xsqlite3OsOpen(tls, (*Pager)(unsafe.Pointer(pPager)).FpVfs, uintptr(0), pFile, vfsFlags, uintptr(0))
  67357 
  67358 	return rc
  67359 }
  67360 
  67361 // Set the busy handler function.
  67362 //
  67363 // The pager invokes the busy-handler if sqlite3OsLock() returns
  67364 // SQLITE_BUSY when trying to upgrade from no-lock to a SHARED lock,
  67365 // or when trying to upgrade from a RESERVED lock to an EXCLUSIVE
  67366 // lock. It does *not* invoke the busy handler when upgrading from
  67367 // SHARED to RESERVED, or when upgrading from SHARED to EXCLUSIVE
  67368 // (which occurs during hot-journal rollback). Summary:
  67369 //
  67370 //	Transition                        | Invokes xBusyHandler
  67371 //	--------------------------------------------------------
  67372 //	NO_LOCK       -> SHARED_LOCK      | Yes
  67373 //	SHARED_LOCK   -> RESERVED_LOCK    | No
  67374 //	SHARED_LOCK   -> EXCLUSIVE_LOCK   | No
  67375 //	RESERVED_LOCK -> EXCLUSIVE_LOCK   | Yes
  67376 //
  67377 // If the busy-handler callback returns non-zero, the lock is
  67378 // retried. If it returns zero, then the SQLITE_BUSY error is
  67379 // returned to the caller of the pager API function.
  67380 func Xsqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr) {
  67381 	var ap uintptr
  67382 	(*Pager)(unsafe.Pointer(pPager)).FxBusyHandler = xBusyHandler
  67383 	(*Pager)(unsafe.Pointer(pPager)).FpBusyHandlerArg = pBusyHandlerArg
  67384 	ap = pPager + 232
  67385 
  67386 	Xsqlite3OsFileControlHint(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, SQLITE_FCNTL_BUSYHANDLER, ap)
  67387 }
  67388 
  67389 // Change the page size used by the Pager object. The new page size
  67390 // is passed in *pPageSize.
  67391 //
  67392 // If the pager is in the error state when this function is called, it
  67393 // is a no-op. The value returned is the error state error code (i.e.
  67394 // one of SQLITE_IOERR, an SQLITE_IOERR_xxx sub-code or SQLITE_FULL).
  67395 //
  67396 // Otherwise, if all of the following are true:
  67397 //
  67398 //   - the new page size (value of *pPageSize) is valid (a power
  67399 //     of two between 512 and SQLITE_MAX_PAGE_SIZE, inclusive), and
  67400 //
  67401 //   - there are no outstanding page references, and
  67402 //
  67403 //   - the database is either not an in-memory database or it is
  67404 //     an in-memory database that currently consists of zero pages.
  67405 //
  67406 // then the pager object page size is set to *pPageSize.
  67407 //
  67408 // If the page size is changed, then this function uses sqlite3PagerMalloc()
  67409 // to obtain a new Pager.pTmpSpace buffer. If this allocation attempt
  67410 // fails, SQLITE_NOMEM is returned and the page size remains unchanged.
  67411 // In all other cases, SQLITE_OK is returned.
  67412 //
  67413 // If the page size is not changed, either because one of the enumerated
  67414 // conditions above is not true, the pager was in error state when this
  67415 // function was called, or because the memory allocation attempt failed,
  67416 // then *pPageSize is set to the old, retained page size before returning.
  67417 func Xsqlite3PagerSetPagesize(tls *libc.TLS, pPager uintptr, pPageSize uintptr, nReserve int32) int32 {
  67418 	bp := tls.Alloc(8)
  67419 	defer tls.Free(8)
  67420 
  67421 	var rc int32 = SQLITE_OK
  67422 
  67423 	var pageSize U32 = *(*U32)(unsafe.Pointer(pPageSize))
  67424 
  67425 	if (int32((*Pager)(unsafe.Pointer(pPager)).FmemDb) == 0 || (*Pager)(unsafe.Pointer(pPager)).FdbSize == Pgno(0)) &&
  67426 		Xsqlite3PcacheRefCount(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) == int64(0) &&
  67427 		pageSize != 0 && pageSize != U32((*Pager)(unsafe.Pointer(pPager)).FpageSize) {
  67428 		var pNew uintptr = uintptr(0)
  67429 		*(*I64)(unsafe.Pointer(bp)) = int64(0)
  67430 
  67431 		if int32((*Pager)(unsafe.Pointer(pPager)).FeState) > PAGER_OPEN && (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0) {
  67432 			rc = Xsqlite3OsFileSize(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, bp)
  67433 		}
  67434 		if rc == SQLITE_OK {
  67435 			pNew = Xsqlite3PageMalloc(tls, int32(pageSize+U32(8)))
  67436 			if !(pNew != 0) {
  67437 				rc = SQLITE_NOMEM
  67438 			} else {
  67439 				libc.Xmemset(tls, pNew+uintptr(pageSize), 0, uint64(8))
  67440 			}
  67441 		}
  67442 
  67443 		if rc == SQLITE_OK {
  67444 			pager_reset(tls, pPager)
  67445 			rc = Xsqlite3PcacheSetPageSize(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, int32(pageSize))
  67446 		}
  67447 		if rc == SQLITE_OK {
  67448 			Xsqlite3PageFree(tls, (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace)
  67449 			(*Pager)(unsafe.Pointer(pPager)).FpTmpSpace = pNew
  67450 			(*Pager)(unsafe.Pointer(pPager)).FdbSize = Pgno((*(*I64)(unsafe.Pointer(bp)) + I64(pageSize) - int64(1)) / I64(pageSize))
  67451 			(*Pager)(unsafe.Pointer(pPager)).FpageSize = I64(pageSize)
  67452 			(*Pager)(unsafe.Pointer(pPager)).FlckPgno = U32(Xsqlite3PendingByte)/pageSize + Pgno(1)
  67453 		} else {
  67454 			Xsqlite3PageFree(tls, pNew)
  67455 		}
  67456 	}
  67457 
  67458 	*(*U32)(unsafe.Pointer(pPageSize)) = U32((*Pager)(unsafe.Pointer(pPager)).FpageSize)
  67459 	if rc == SQLITE_OK {
  67460 		if nReserve < 0 {
  67461 			nReserve = int32((*Pager)(unsafe.Pointer(pPager)).FnReserve)
  67462 		}
  67463 
  67464 		(*Pager)(unsafe.Pointer(pPager)).FnReserve = I16(nReserve)
  67465 		pagerFixMaplimit(tls, pPager)
  67466 	}
  67467 	return rc
  67468 }
  67469 
  67470 // Return a pointer to the "temporary page" buffer held internally
  67471 // by the pager.  This is a buffer that is big enough to hold the
  67472 // entire content of a database page.  This buffer is used internally
  67473 // during rollback and will be overwritten whenever a rollback
  67474 // occurs.  But other modules are free to use it too, as long as
  67475 // no rollbacks are happening.
  67476 func Xsqlite3PagerTempSpace(tls *libc.TLS, pPager uintptr) uintptr {
  67477 	return (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace
  67478 }
  67479 
  67480 // Attempt to set the maximum database page count if mxPage is positive.
  67481 // Make no changes if mxPage is zero or negative.  And never reduce the
  67482 // maximum page count below the current size of the database.
  67483 //
  67484 // Regardless of mxPage, return the current maximum page count.
  67485 func Xsqlite3PagerMaxPageCount(tls *libc.TLS, pPager uintptr, mxPage Pgno) Pgno {
  67486 	if mxPage > Pgno(0) {
  67487 		(*Pager)(unsafe.Pointer(pPager)).FmxPgno = mxPage
  67488 	}
  67489 
  67490 	return (*Pager)(unsafe.Pointer(pPager)).FmxPgno
  67491 }
  67492 
  67493 // Read the first N bytes from the beginning of the file into memory
  67494 // that pDest points to.
  67495 //
  67496 // If the pager was opened on a transient file (zFilename==""), or
  67497 // opened on a file less than N bytes in size, the output buffer is
  67498 // zeroed and SQLITE_OK returned. The rationale for this is that this
  67499 // function is used to read database headers, and a new transient or
  67500 // zero sized database has a header than consists entirely of zeroes.
  67501 //
  67502 // If any IO error apart from SQLITE_IOERR_SHORT_READ is encountered,
  67503 // the error code is returned to the caller and the contents of the
  67504 // output buffer undefined.
  67505 func Xsqlite3PagerReadFileheader(tls *libc.TLS, pPager uintptr, N int32, pDest uintptr) int32 {
  67506 	var rc int32 = SQLITE_OK
  67507 	libc.Xmemset(tls, pDest, 0, uint64(N))
  67508 
  67509 	if (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0) {
  67510 		rc = Xsqlite3OsRead(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, pDest, N, int64(0))
  67511 		if rc == SQLITE_IOERR|int32(2)<<8 {
  67512 			rc = SQLITE_OK
  67513 		}
  67514 	}
  67515 	return rc
  67516 }
  67517 
  67518 // This function may only be called when a read-transaction is open on
  67519 // the pager. It returns the total number of pages in the database.
  67520 //
  67521 // However, if the file is between 1 and <page-size> bytes in size, then
  67522 // this is considered a 1 page file.
  67523 func Xsqlite3PagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) {
  67524 	*(*int32)(unsafe.Pointer(pnPage)) = int32((*Pager)(unsafe.Pointer(pPager)).FdbSize)
  67525 }
  67526 
  67527 func pager_wait_on_lock(tls *libc.TLS, pPager uintptr, locktype int32) int32 {
  67528 	var rc int32
  67529 
  67530 	for __ccgo := true; __ccgo; __ccgo = rc == SQLITE_BUSY && (*struct {
  67531 		f func(*libc.TLS, uintptr) int32
  67532 	})(unsafe.Pointer(&struct{ uintptr }{(*Pager)(unsafe.Pointer(pPager)).FxBusyHandler})).f(tls, (*Pager)(unsafe.Pointer(pPager)).FpBusyHandlerArg) != 0 {
  67533 		rc = pagerLockDb(tls, pPager, locktype)
  67534 	}
  67535 	return rc
  67536 }
  67537 
  67538 // Truncate the in-memory database file image to nPage pages. This
  67539 // function does not actually modify the database file on disk. It
  67540 // just sets the internal state of the pager object so that the
  67541 // truncation will be done when the current transaction is committed.
  67542 //
  67543 // This function is only called right before committing a transaction.
  67544 // Once this function has been called, the transaction must either be
  67545 // rolled back or committed. It is not safe to call this function and
  67546 // then continue writing to the database.
  67547 func Xsqlite3PagerTruncateImage(tls *libc.TLS, pPager uintptr, nPage Pgno) {
  67548 	(*Pager)(unsafe.Pointer(pPager)).FdbSize = nPage
  67549 
  67550 }
  67551 
  67552 func pagerSyncHotJournal(tls *libc.TLS, pPager uintptr) int32 {
  67553 	var rc int32 = SQLITE_OK
  67554 	if !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) {
  67555 		rc = Xsqlite3OsSync(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, SQLITE_SYNC_NORMAL)
  67556 	}
  67557 	if rc == SQLITE_OK {
  67558 		rc = Xsqlite3OsFileSize(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, pPager+104)
  67559 	}
  67560 	return rc
  67561 }
  67562 
  67563 func pagerAcquireMapPage(tls *libc.TLS, pPager uintptr, pgno Pgno, pData uintptr, ppPage uintptr) int32 {
  67564 	var p uintptr
  67565 
  67566 	if (*Pager)(unsafe.Pointer(pPager)).FpMmapFreelist != 0 {
  67567 		*(*uintptr)(unsafe.Pointer(ppPage)) = libc.AssignUintptr(&p, (*Pager)(unsafe.Pointer(pPager)).FpMmapFreelist)
  67568 		(*Pager)(unsafe.Pointer(pPager)).FpMmapFreelist = (*PgHdr)(unsafe.Pointer(p)).FpDirty
  67569 		(*PgHdr)(unsafe.Pointer(p)).FpDirty = uintptr(0)
  67570 
  67571 		libc.Xmemset(tls, (*PgHdr)(unsafe.Pointer(p)).FpExtra, 0, uint64(8))
  67572 	} else {
  67573 		*(*uintptr)(unsafe.Pointer(ppPage)) = libc.AssignUintptr(&p, Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(PgHdr{}))+uint64((*Pager)(unsafe.Pointer(pPager)).FnExtra)))
  67574 		if p == uintptr(0) {
  67575 			Xsqlite3OsUnfetch(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, I64(pgno-Pgno(1))*(*Pager)(unsafe.Pointer(pPager)).FpageSize, pData)
  67576 			return SQLITE_NOMEM
  67577 		}
  67578 		(*PgHdr)(unsafe.Pointer(p)).FpExtra = p + 1*80
  67579 		(*PgHdr)(unsafe.Pointer(p)).Fflags = U16(PGHDR_MMAP)
  67580 		(*PgHdr)(unsafe.Pointer(p)).FnRef = int64(1)
  67581 		(*PgHdr)(unsafe.Pointer(p)).FpPager = pPager
  67582 	}
  67583 
  67584 	(*PgHdr)(unsafe.Pointer(p)).Fpgno = pgno
  67585 	(*PgHdr)(unsafe.Pointer(p)).FpData = pData
  67586 	(*Pager)(unsafe.Pointer(pPager)).FnMmapOut++
  67587 
  67588 	return SQLITE_OK
  67589 }
  67590 
  67591 func pagerReleaseMapPage(tls *libc.TLS, pPg uintptr) {
  67592 	var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager
  67593 	(*Pager)(unsafe.Pointer(pPager)).FnMmapOut--
  67594 	(*PgHdr)(unsafe.Pointer(pPg)).FpDirty = (*Pager)(unsafe.Pointer(pPager)).FpMmapFreelist
  67595 	(*Pager)(unsafe.Pointer(pPager)).FpMmapFreelist = pPg
  67596 
  67597 	Xsqlite3OsUnfetch(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, I64((*PgHdr)(unsafe.Pointer(pPg)).Fpgno-Pgno(1))*(*Pager)(unsafe.Pointer(pPager)).FpageSize, (*PgHdr)(unsafe.Pointer(pPg)).FpData)
  67598 }
  67599 
  67600 func pagerFreeMapHdrs(tls *libc.TLS, pPager uintptr) {
  67601 	var p uintptr
  67602 	var pNext uintptr
  67603 	for p = (*Pager)(unsafe.Pointer(pPager)).FpMmapFreelist; p != 0; p = pNext {
  67604 		pNext = (*PgHdr)(unsafe.Pointer(p)).FpDirty
  67605 		Xsqlite3_free(tls, p)
  67606 	}
  67607 }
  67608 
  67609 func databaseIsUnmoved(tls *libc.TLS, pPager uintptr) int32 {
  67610 	bp := tls.Alloc(4)
  67611 	defer tls.Free(4)
  67612 
  67613 	*(*int32)(unsafe.Pointer(bp)) = 0
  67614 	var rc int32
  67615 
  67616 	if (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 {
  67617 		return SQLITE_OK
  67618 	}
  67619 	if (*Pager)(unsafe.Pointer(pPager)).FdbSize == Pgno(0) {
  67620 		return SQLITE_OK
  67621 	}
  67622 
  67623 	rc = Xsqlite3OsFileControl(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, SQLITE_FCNTL_HAS_MOVED, bp)
  67624 	if rc == SQLITE_NOTFOUND {
  67625 		rc = SQLITE_OK
  67626 	} else if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp)) != 0 {
  67627 		rc = SQLITE_READONLY | int32(4)<<8
  67628 	}
  67629 	return rc
  67630 }
  67631 
  67632 // Shutdown the page cache.  Free all memory and close all files.
  67633 //
  67634 // If a transaction was in progress when this routine is called, that
  67635 // transaction is rolled back.  All outstanding pages are invalidated
  67636 // and their memory is freed.  Any attempt to use a page associated
  67637 // with this page cache after this function returns will likely
  67638 // result in a coredump.
  67639 //
  67640 // This function always succeeds. If a transaction is active an attempt
  67641 // is made to roll it back. If an error occurs during the rollback
  67642 // a hot journal may be left in the filesystem but no error is returned
  67643 // to the caller.
  67644 func Xsqlite3PagerClose(tls *libc.TLS, pPager uintptr, db uintptr) int32 {
  67645 	var pTmp uintptr = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace
  67646 
  67647 	Xsqlite3BeginBenignMalloc(tls)
  67648 	pagerFreeMapHdrs(tls, pPager)
  67649 
  67650 	(*Pager)(unsafe.Pointer(pPager)).FexclusiveMode = U8(0)
  67651 	{
  67652 		var a uintptr = uintptr(0)
  67653 
  67654 		if db != 0 && uint64(0) == (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_NoCkptOnClose) &&
  67655 			SQLITE_OK == databaseIsUnmoved(tls, pPager) {
  67656 			a = pTmp
  67657 		}
  67658 		Xsqlite3WalClose(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, db, int32((*Pager)(unsafe.Pointer(pPager)).FwalSyncFlags), int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), a)
  67659 		(*Pager)(unsafe.Pointer(pPager)).FpWal = uintptr(0)
  67660 
  67661 	}
  67662 	pager_reset(tls, pPager)
  67663 	if (*Pager)(unsafe.Pointer(pPager)).FmemDb != 0 {
  67664 		pager_unlock(tls, pPager)
  67665 	} else {
  67666 		if (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0) {
  67667 			pager_error(tls, pPager, pagerSyncHotJournal(tls, pPager))
  67668 		}
  67669 		pagerUnlockAndRollback(tls, pPager)
  67670 	}
  67671 	Xsqlite3EndBenignMalloc(tls)
  67672 
  67673 	Xsqlite3OsClose(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd)
  67674 	Xsqlite3OsClose(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd)
  67675 	Xsqlite3PageFree(tls, pTmp)
  67676 	Xsqlite3PcacheClose(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
  67677 
  67678 	Xsqlite3_free(tls, pPager)
  67679 	return SQLITE_OK
  67680 }
  67681 
  67682 // Increment the reference count for page pPg.
  67683 func Xsqlite3PagerRef(tls *libc.TLS, pPg uintptr) {
  67684 	Xsqlite3PcacheRef(tls, pPg)
  67685 }
  67686 
  67687 func syncJournal(tls *libc.TLS, pPager uintptr, newHdr int32) int32 {
  67688 	bp := tls.Alloc(20)
  67689 	defer tls.Free(20)
  67690 
  67691 	var rc int32
  67692 
  67693 	rc = Xsqlite3PagerExclusiveLock(tls, pPager)
  67694 	if rc != SQLITE_OK {
  67695 		return rc
  67696 	}
  67697 
  67698 	if !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) {
  67699 		if (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0) && int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) != PAGER_JOURNALMODE_MEMORY {
  67700 			var iDc int32 = Xsqlite3OsDeviceCharacteristics(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd)
  67701 
  67702 			if 0 == iDc&SQLITE_IOCAP_SAFE_APPEND {
  67703 				var iNextHdrOffset I64
  67704 
  67705 				libc.Xmemcpy(tls, bp, uintptr(unsafe.Pointer(&aJournalMagic)), uint64(unsafe.Sizeof(aJournalMagic)))
  67706 				Xsqlite3Put4byte(tls, bp+8, uint32((*Pager)(unsafe.Pointer(pPager)).FnRec))
  67707 
  67708 				iNextHdrOffset = journalHdrOffset(tls, pPager)
  67709 				rc = Xsqlite3OsRead(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, bp+12, 8, iNextHdrOffset)
  67710 				if rc == SQLITE_OK && 0 == libc.Xmemcmp(tls, bp+12, uintptr(unsafe.Pointer(&aJournalMagic)), uint64(8)) {
  67711 					rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, uintptr(unsafe.Pointer(&zerobyte)), 1, iNextHdrOffset)
  67712 				}
  67713 				if rc != SQLITE_OK && rc != SQLITE_IOERR|int32(2)<<8 {
  67714 					return rc
  67715 				}
  67716 
  67717 				if (*Pager)(unsafe.Pointer(pPager)).FfullSync != 0 && 0 == iDc&SQLITE_IOCAP_SEQUENTIAL {
  67718 					rc = Xsqlite3OsSync(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags))
  67719 					if rc != SQLITE_OK {
  67720 						return rc
  67721 					}
  67722 				}
  67723 
  67724 				rc = Xsqlite3OsWrite(tls,
  67725 					(*Pager)(unsafe.Pointer(pPager)).Fjfd, bp, int32(unsafe.Sizeof([12]U8{})), (*Pager)(unsafe.Pointer(pPager)).FjournalHdr)
  67726 				if rc != SQLITE_OK {
  67727 					return rc
  67728 				}
  67729 			}
  67730 			if 0 == iDc&SQLITE_IOCAP_SEQUENTIAL {
  67731 				rc = Xsqlite3OsSync(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags)|func() int32 {
  67732 					if int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags) == SQLITE_SYNC_FULL {
  67733 						return SQLITE_SYNC_DATAONLY
  67734 					}
  67735 					return 0
  67736 				}())
  67737 				if rc != SQLITE_OK {
  67738 					return rc
  67739 				}
  67740 			}
  67741 
  67742 			(*Pager)(unsafe.Pointer(pPager)).FjournalHdr = (*Pager)(unsafe.Pointer(pPager)).FjournalOff
  67743 			if newHdr != 0 && 0 == iDc&SQLITE_IOCAP_SAFE_APPEND {
  67744 				(*Pager)(unsafe.Pointer(pPager)).FnRec = 0
  67745 				rc = writeJournalHdr(tls, pPager)
  67746 				if rc != SQLITE_OK {
  67747 					return rc
  67748 				}
  67749 			}
  67750 		} else {
  67751 			(*Pager)(unsafe.Pointer(pPager)).FjournalHdr = (*Pager)(unsafe.Pointer(pPager)).FjournalOff
  67752 		}
  67753 	}
  67754 
  67755 	Xsqlite3PcacheClearSyncFlags(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
  67756 	(*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_WRITER_DBMOD)
  67757 
  67758 	return SQLITE_OK
  67759 }
  67760 
  67761 var zerobyte U8 = U8(0)
  67762 
  67763 func pager_write_pagelist(tls *libc.TLS, pPager uintptr, pList uintptr) int32 {
  67764 	bp := tls.Alloc(8)
  67765 	defer tls.Free(8)
  67766 
  67767 	var rc int32 = SQLITE_OK
  67768 
  67769 	if !((*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0)) {
  67770 		rc = pagerOpentemp(tls, pPager, (*Pager)(unsafe.Pointer(pPager)).Ffd, int32((*Pager)(unsafe.Pointer(pPager)).FvfsFlags))
  67771 	}
  67772 
  67773 	if rc == SQLITE_OK &&
  67774 		(*Pager)(unsafe.Pointer(pPager)).FdbHintSize < (*Pager)(unsafe.Pointer(pPager)).FdbSize &&
  67775 		((*PgHdr)(unsafe.Pointer(pList)).FpDirty != 0 || (*PgHdr)(unsafe.Pointer(pList)).Fpgno > (*Pager)(unsafe.Pointer(pPager)).FdbHintSize) {
  67776 		*(*Sqlite3_int64)(unsafe.Pointer(bp)) = (*Pager)(unsafe.Pointer(pPager)).FpageSize * Sqlite3_int64((*Pager)(unsafe.Pointer(pPager)).FdbSize)
  67777 		Xsqlite3OsFileControlHint(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, SQLITE_FCNTL_SIZE_HINT, bp)
  67778 		(*Pager)(unsafe.Pointer(pPager)).FdbHintSize = (*Pager)(unsafe.Pointer(pPager)).FdbSize
  67779 	}
  67780 
  67781 	for rc == SQLITE_OK && pList != 0 {
  67782 		var pgno Pgno = (*PgHdr)(unsafe.Pointer(pList)).Fpgno
  67783 
  67784 		if pgno <= (*Pager)(unsafe.Pointer(pPager)).FdbSize && 0 == int32((*PgHdr)(unsafe.Pointer(pList)).Fflags)&PGHDR_DONT_WRITE {
  67785 			var offset I64 = I64(pgno-Pgno(1)) * (*Pager)(unsafe.Pointer(pPager)).FpageSize
  67786 			var pData uintptr
  67787 
  67788 			if (*PgHdr)(unsafe.Pointer(pList)).Fpgno == Pgno(1) {
  67789 				pager_write_changecounter(tls, pList)
  67790 			}
  67791 
  67792 			pData = (*PgHdr)(unsafe.Pointer(pList)).FpData
  67793 
  67794 			rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, pData, int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), offset)
  67795 
  67796 			if pgno == Pgno(1) {
  67797 				libc.Xmemcpy(tls, pPager+136, pData+24, uint64(unsafe.Sizeof([16]int8{})))
  67798 			}
  67799 			if pgno > (*Pager)(unsafe.Pointer(pPager)).FdbFileSize {
  67800 				(*Pager)(unsafe.Pointer(pPager)).FdbFileSize = pgno
  67801 			}
  67802 			*(*int32)(unsafe.Pointer(pPager + 248 + 2*4))++
  67803 
  67804 			Xsqlite3BackupUpdate(tls, (*Pager)(unsafe.Pointer(pPager)).FpBackup, pgno, (*PgHdr)(unsafe.Pointer(pList)).FpData)
  67805 
  67806 		} else {
  67807 		}
  67808 
  67809 		pList = (*PgHdr)(unsafe.Pointer(pList)).FpDirty
  67810 	}
  67811 
  67812 	return rc
  67813 }
  67814 
  67815 func openSubJournal(tls *libc.TLS, pPager uintptr) int32 {
  67816 	var rc int32 = SQLITE_OK
  67817 	if !((*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fsjfd)).FpMethods != uintptr(0)) {
  67818 		var flags int32 = SQLITE_OPEN_SUBJOURNAL | SQLITE_OPEN_READWRITE |
  67819 			SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE |
  67820 			SQLITE_OPEN_DELETEONCLOSE
  67821 		var nStmtSpill int32 = Xsqlite3Config.FnStmtSpill
  67822 		if int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_MEMORY || (*Pager)(unsafe.Pointer(pPager)).FsubjInMemory != 0 {
  67823 			nStmtSpill = -1
  67824 		}
  67825 		rc = Xsqlite3JournalOpen(tls, (*Pager)(unsafe.Pointer(pPager)).FpVfs, uintptr(0), (*Pager)(unsafe.Pointer(pPager)).Fsjfd, flags, nStmtSpill)
  67826 	}
  67827 	return rc
  67828 }
  67829 
  67830 func subjournalPage(tls *libc.TLS, pPg uintptr) int32 {
  67831 	var rc int32 = SQLITE_OK
  67832 	var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager
  67833 	if int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) != PAGER_JOURNALMODE_OFF {
  67834 		rc = openSubJournal(tls, pPager)
  67835 
  67836 		if rc == SQLITE_OK {
  67837 			var pData uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpData
  67838 			var offset I64 = I64((*Pager)(unsafe.Pointer(pPager)).FnSubRec) * (int64(4) + (*Pager)(unsafe.Pointer(pPager)).FpageSize)
  67839 			var pData2 uintptr
  67840 			pData2 = pData
  67841 
  67842 			rc = write32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd, offset, (*PgHdr)(unsafe.Pointer(pPg)).Fpgno)
  67843 			if rc == SQLITE_OK {
  67844 				rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd, pData2, int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), offset+int64(4))
  67845 			}
  67846 		}
  67847 	}
  67848 	if rc == SQLITE_OK {
  67849 		(*Pager)(unsafe.Pointer(pPager)).FnSubRec++
  67850 
  67851 		rc = addToSavepointBitvecs(tls, pPager, (*PgHdr)(unsafe.Pointer(pPg)).Fpgno)
  67852 	}
  67853 	return rc
  67854 }
  67855 
  67856 func subjournalPageIfRequired(tls *libc.TLS, pPg uintptr) int32 {
  67857 	if subjRequiresPage(tls, pPg) != 0 {
  67858 		return subjournalPage(tls, pPg)
  67859 	} else {
  67860 		return SQLITE_OK
  67861 	}
  67862 	return int32(0)
  67863 }
  67864 
  67865 func pagerStress(tls *libc.TLS, p uintptr, pPg uintptr) int32 {
  67866 	var pPager uintptr = p
  67867 	var rc int32 = SQLITE_OK
  67868 
  67869 	if (*Pager)(unsafe.Pointer(pPager)).FerrCode != 0 {
  67870 		return SQLITE_OK
  67871 	}
  67872 
  67873 	if (*Pager)(unsafe.Pointer(pPager)).FdoNotSpill != 0 &&
  67874 		(int32((*Pager)(unsafe.Pointer(pPager)).FdoNotSpill)&(SPILLFLAG_ROLLBACK|SPILLFLAG_OFF) != 0 ||
  67875 			int32((*PgHdr)(unsafe.Pointer(pPg)).Fflags)&PGHDR_NEED_SYNC != 0) {
  67876 		return SQLITE_OK
  67877 	}
  67878 
  67879 	*(*int32)(unsafe.Pointer(pPager + 248 + 3*4))++
  67880 	(*PgHdr)(unsafe.Pointer(pPg)).FpDirty = uintptr(0)
  67881 	if (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) {
  67882 		rc = subjournalPageIfRequired(tls, pPg)
  67883 		if rc == SQLITE_OK {
  67884 			rc = pagerWalFrames(tls, pPager, pPg, uint32(0), 0)
  67885 		}
  67886 	} else {
  67887 		if int32((*PgHdr)(unsafe.Pointer(pPg)).Fflags)&PGHDR_NEED_SYNC != 0 ||
  67888 			int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_WRITER_CACHEMOD {
  67889 			rc = syncJournal(tls, pPager, 1)
  67890 		}
  67891 
  67892 		if rc == SQLITE_OK {
  67893 			rc = pager_write_pagelist(tls, pPager, pPg)
  67894 		}
  67895 	}
  67896 
  67897 	if rc == SQLITE_OK {
  67898 		Xsqlite3PcacheMakeClean(tls, pPg)
  67899 	}
  67900 
  67901 	return pager_error(tls, pPager, rc)
  67902 }
  67903 
  67904 // Flush all unreferenced dirty pages to disk.
  67905 func Xsqlite3PagerFlush(tls *libc.TLS, pPager uintptr) int32 {
  67906 	var rc int32 = (*Pager)(unsafe.Pointer(pPager)).FerrCode
  67907 	if !(int32((*Pager)(unsafe.Pointer(pPager)).FmemDb) != 0) {
  67908 		var pList uintptr = Xsqlite3PcacheDirtyList(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
  67909 
  67910 		for rc == SQLITE_OK && pList != 0 {
  67911 			var pNext uintptr = (*PgHdr)(unsafe.Pointer(pList)).FpDirty
  67912 			if (*PgHdr)(unsafe.Pointer(pList)).FnRef == int64(0) {
  67913 				rc = pagerStress(tls, pPager, pList)
  67914 			}
  67915 			pList = pNext
  67916 		}
  67917 	}
  67918 
  67919 	return rc
  67920 }
  67921 
  67922 // Allocate and initialize a new Pager object and put a pointer to it
  67923 // in *ppPager. The pager should eventually be freed by passing it
  67924 // to sqlite3PagerClose().
  67925 //
  67926 // The zFilename argument is the path to the database file to open.
  67927 // If zFilename is NULL then a randomly-named temporary file is created
  67928 // and used as the file to be cached. Temporary files are be deleted
  67929 // automatically when they are closed. If zFilename is ":memory:" then
  67930 // all information is held in cache. It is never written to disk.
  67931 // This can be used to implement an in-memory database.
  67932 //
  67933 // The nExtra parameter specifies the number of bytes of space allocated
  67934 // along with each page reference. This space is available to the user
  67935 // via the sqlite3PagerGetExtra() API.  When a new page is allocated, the
  67936 // first 8 bytes of this space are zeroed but the remainder is uninitialized.
  67937 // (The extra space is used by btree as the MemPage object.)
  67938 //
  67939 // The flags argument is used to specify properties that affect the
  67940 // operation of the pager. It should be passed some bitwise combination
  67941 // of the PAGER_* flags.
  67942 //
  67943 // The vfsFlags parameter is a bitmask to pass to the flags parameter
  67944 // of the xOpen() method of the supplied VFS when opening files.
  67945 //
  67946 // If the pager object is allocated and the specified file opened
  67947 // successfully, SQLITE_OK is returned and *ppPager set to point to
  67948 // the new pager object. If an error occurs, *ppPager is set to NULL
  67949 // and error code returned. This function may return SQLITE_NOMEM
  67950 // (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or
  67951 // various SQLITE_IO_XXX errors.
  67952 func Xsqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) int32 {
  67953 	bp := tls.Alloc(16)
  67954 	defer tls.Free(16)
  67955 
  67956 	var pPtr uintptr
  67957 	_ = pPtr
  67958 
  67959 	var rc int32
  67960 	var tempFile int32
  67961 	var memDb int32
  67962 	var memJM int32
  67963 	var readOnly int32
  67964 	var journalFileSize int32
  67965 	var zPathname uintptr
  67966 	var nPathname int32
  67967 	var useJournal int32
  67968 	var pcacheSize int32
  67969 
  67970 	var zUri uintptr
  67971 	var nUriByte int32
  67972 	var z uintptr
  67973 	var iDc int32
  67974 
  67975 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
  67976 	rc = SQLITE_OK
  67977 	tempFile = 0
  67978 	memDb = 0
  67979 	memJM = 0
  67980 	readOnly = 0
  67981 	zPathname = uintptr(0)
  67982 	nPathname = 0
  67983 	useJournal = libc.Bool32(flags&PAGER_OMIT_JOURNAL == 0)
  67984 	pcacheSize = Xsqlite3PcacheSize(tls)
  67985 	*(*U32)(unsafe.Pointer(bp + 12)) = U32(SQLITE_DEFAULT_PAGE_SIZE)
  67986 	zUri = uintptr(0)
  67987 	nUriByte = 1
  67988 
  67989 	journalFileSize = (Xsqlite3JournalSize(tls, pVfs) + 7) & libc.CplInt32(7)
  67990 
  67991 	*(*uintptr)(unsafe.Pointer(ppPager)) = uintptr(0)
  67992 
  67993 	if !(flags&PAGER_MEMORY != 0) {
  67994 		goto __1
  67995 	}
  67996 	memDb = 1
  67997 	if !(zFilename != 0 && *(*int8)(unsafe.Pointer(zFilename)) != 0) {
  67998 		goto __2
  67999 	}
  68000 	zPathname = Xsqlite3DbStrDup(tls, uintptr(0), zFilename)
  68001 	if !(zPathname == uintptr(0)) {
  68002 		goto __3
  68003 	}
  68004 	return SQLITE_NOMEM
  68005 __3:
  68006 	;
  68007 	nPathname = Xsqlite3Strlen30(tls, zPathname)
  68008 	zFilename = uintptr(0)
  68009 __2:
  68010 	;
  68011 __1:
  68012 	;
  68013 	if !(zFilename != 0 && *(*int8)(unsafe.Pointer(zFilename)) != 0) {
  68014 		goto __4
  68015 	}
  68016 	nPathname = (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + 1
  68017 	zPathname = Xsqlite3DbMallocRaw(tls, uintptr(0), uint64(nPathname*2))
  68018 	if !(zPathname == uintptr(0)) {
  68019 		goto __5
  68020 	}
  68021 	return SQLITE_NOMEM
  68022 __5:
  68023 	;
  68024 	*(*int8)(unsafe.Pointer(zPathname)) = int8(0)
  68025 	rc = Xsqlite3OsFullPathname(tls, pVfs, zFilename, nPathname, zPathname)
  68026 	if !(rc != SQLITE_OK) {
  68027 		goto __6
  68028 	}
  68029 	if !(rc == SQLITE_OK|int32(2)<<8) {
  68030 		goto __7
  68031 	}
  68032 	if !(vfsFlags&SQLITE_OPEN_NOFOLLOW != 0) {
  68033 		goto __8
  68034 	}
  68035 	rc = SQLITE_CANTOPEN | int32(6)<<8
  68036 	goto __9
  68037 __8:
  68038 	rc = SQLITE_OK
  68039 __9:
  68040 	;
  68041 __7:
  68042 	;
  68043 __6:
  68044 	;
  68045 	nPathname = Xsqlite3Strlen30(tls, zPathname)
  68046 	z = libc.AssignUintptr(&zUri, zFilename+uintptr(Xsqlite3Strlen30(tls, zFilename)+1))
  68047 __10:
  68048 	if !(*(*int8)(unsafe.Pointer(z)) != 0) {
  68049 		goto __11
  68050 	}
  68051 	z += uintptr(libc.Xstrlen(tls, z) + uint64(1))
  68052 	z += uintptr(libc.Xstrlen(tls, z) + uint64(1))
  68053 	goto __10
  68054 __11:
  68055 	;
  68056 	nUriByte = int32((int64(z+1) - int64(zUri)) / 1)
  68057 
  68058 	if !(rc == SQLITE_OK && nPathname+8 > (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname) {
  68059 		goto __12
  68060 	}
  68061 
  68062 	rc = Xsqlite3CantopenError(tls, 60239)
  68063 __12:
  68064 	;
  68065 	if !(rc != SQLITE_OK) {
  68066 		goto __13
  68067 	}
  68068 	Xsqlite3DbFree(tls, uintptr(0), zPathname)
  68069 	return rc
  68070 __13:
  68071 	;
  68072 __4:
  68073 	;
  68074 	pPtr = Xsqlite3MallocZero(tls,
  68075 		(uint64(unsafe.Sizeof(Pager{}))+uint64(7))&libc.Uint64FromInt32(libc.CplInt32(7))+uint64((pcacheSize+7)&libc.CplInt32(7))+uint64(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+7)&libc.CplInt32(7))+uint64(journalFileSize*2)+uint64(unsafe.Sizeof(uintptr(0)))+uint64(4)+uint64(nPathname)+uint64(1)+uint64(nUriByte)+uint64(nPathname)+uint64(8)+uint64(1)+uint64(nPathname)+uint64(4)+uint64(1)+uint64(3))
  68076 
  68077 	if !!(pPtr != 0) {
  68078 		goto __14
  68079 	}
  68080 	Xsqlite3DbFree(tls, uintptr(0), zPathname)
  68081 	return SQLITE_NOMEM
  68082 __14:
  68083 	;
  68084 	*(*uintptr)(unsafe.Pointer(bp)) = pPtr
  68085 	pPtr += uintptr((uint64(unsafe.Sizeof(Pager{})) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7)))
  68086 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpPCache = pPtr
  68087 	pPtr += uintptr((pcacheSize + 7) & libc.CplInt32(7))
  68088 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Ffd = pPtr
  68089 	pPtr += uintptr(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile + 7) & libc.CplInt32(7))
  68090 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fsjfd = pPtr
  68091 	pPtr += uintptr(journalFileSize)
  68092 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fjfd = pPtr
  68093 	pPtr += uintptr(journalFileSize)
  68094 
  68095 	libc.Xmemcpy(tls, pPtr, bp, uint64(unsafe.Sizeof(uintptr(0))))
  68096 	pPtr += unsafe.Sizeof(uintptr(0))
  68097 
  68098 	pPtr += uintptr(4)
  68099 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename = pPtr
  68100 	if !(nPathname > 0) {
  68101 		goto __15
  68102 	}
  68103 	libc.Xmemcpy(tls, pPtr, zPathname, uint64(nPathname))
  68104 	pPtr += uintptr(nPathname + 1)
  68105 	if !(zUri != 0) {
  68106 		goto __16
  68107 	}
  68108 	libc.Xmemcpy(tls, pPtr, zUri, uint64(nUriByte))
  68109 	pPtr += uintptr(nUriByte)
  68110 	goto __17
  68111 __16:
  68112 	pPtr++
  68113 __17:
  68114 	;
  68115 __15:
  68116 	;
  68117 	if !(nPathname > 0) {
  68118 		goto __18
  68119 	}
  68120 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = pPtr
  68121 	libc.Xmemcpy(tls, pPtr, zPathname, uint64(nPathname))
  68122 	pPtr += uintptr(nPathname)
  68123 	libc.Xmemcpy(tls, pPtr, ts+5273, uint64(8))
  68124 	pPtr += uintptr(8 + 1)
  68125 	goto __19
  68126 __18:
  68127 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = uintptr(0)
  68128 __19:
  68129 	;
  68130 	if !(nPathname > 0) {
  68131 		goto __20
  68132 	}
  68133 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = pPtr
  68134 	libc.Xmemcpy(tls, pPtr, zPathname, uint64(nPathname))
  68135 	pPtr += uintptr(nPathname)
  68136 	libc.Xmemcpy(tls, pPtr, ts+5282, uint64(4))
  68137 	pPtr += uintptr(4 + 1)
  68138 	goto __21
  68139 __20:
  68140 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = uintptr(0)
  68141 __21:
  68142 	;
  68143 	_ = pPtr
  68144 
  68145 	if !(nPathname != 0) {
  68146 		goto __22
  68147 	}
  68148 	Xsqlite3DbFree(tls, uintptr(0), zPathname)
  68149 __22:
  68150 	;
  68151 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpVfs = pVfs
  68152 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FvfsFlags = U32(vfsFlags)
  68153 
  68154 	if !(zFilename != 0 && *(*int8)(unsafe.Pointer(zFilename)) != 0) {
  68155 		goto __23
  68156 	}
  68157 	*(*int32)(unsafe.Pointer(bp + 8)) = 0
  68158 	rc = Xsqlite3OsOpen(tls, pVfs, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Ffd, vfsFlags, bp+8)
  68159 
  68160 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FmemVfs = U8(libc.AssignInt32(&memJM, libc.Bool32(*(*int32)(unsafe.Pointer(bp + 8))&SQLITE_OPEN_MEMORY != 0)))
  68161 	readOnly = libc.Bool32(*(*int32)(unsafe.Pointer(bp + 8))&SQLITE_OPEN_READONLY != 0)
  68162 
  68163 	if !(rc == SQLITE_OK) {
  68164 		goto __25
  68165 	}
  68166 	iDc = Xsqlite3OsDeviceCharacteristics(tls, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Ffd)
  68167 	if !!(readOnly != 0) {
  68168 		goto __26
  68169 	}
  68170 	setSectorSize(tls, *(*uintptr)(unsafe.Pointer(bp)))
  68171 
  68172 	if !(*(*U32)(unsafe.Pointer(bp + 12)) < (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FsectorSize) {
  68173 		goto __27
  68174 	}
  68175 	if !((*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FsectorSize > U32(SQLITE_MAX_DEFAULT_PAGE_SIZE)) {
  68176 		goto __28
  68177 	}
  68178 	*(*U32)(unsafe.Pointer(bp + 12)) = U32(SQLITE_MAX_DEFAULT_PAGE_SIZE)
  68179 	goto __29
  68180 __28:
  68181 	*(*U32)(unsafe.Pointer(bp + 12)) = (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FsectorSize
  68182 __29:
  68183 	;
  68184 __27:
  68185 	;
  68186 __26:
  68187 	;
  68188 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = U8(Xsqlite3_uri_boolean(tls, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, ts+5287, 0))
  68189 	if !(iDc&SQLITE_IOCAP_IMMUTABLE != 0 ||
  68190 		Xsqlite3_uri_boolean(tls, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, ts+5294, 0) != 0) {
  68191 		goto __30
  68192 	}
  68193 	vfsFlags = vfsFlags | SQLITE_OPEN_READONLY
  68194 	goto act_like_temp_file
  68195 __30:
  68196 	;
  68197 __25:
  68198 	;
  68199 	goto __24
  68200 __23:
  68201 act_like_temp_file:
  68202 	tempFile = 1
  68203 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FeState = U8(PAGER_READER)
  68204 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FeLock = U8(EXCLUSIVE_LOCK)
  68205 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = U8(1)
  68206 	readOnly = vfsFlags & SQLITE_OPEN_READONLY
  68207 __24:
  68208 	;
  68209 	if !(rc == SQLITE_OK) {
  68210 		goto __31
  68211 	}
  68212 
  68213 	rc = Xsqlite3PagerSetPagesize(tls, *(*uintptr)(unsafe.Pointer(bp)), bp+12, -1)
  68214 
  68215 __31:
  68216 	;
  68217 	if !(rc == SQLITE_OK) {
  68218 		goto __32
  68219 	}
  68220 	nExtra = (nExtra + 7) & libc.CplInt32(7)
  68221 
  68222 	rc = Xsqlite3PcacheOpen(tls, int32(*(*U32)(unsafe.Pointer(bp + 12))), nExtra, libc.BoolInt32(!(memDb != 0)),
  68223 		func() uintptr {
  68224 			if !(memDb != 0) {
  68225 				return *(*uintptr)(unsafe.Pointer(&struct {
  68226 					f func(*libc.TLS, uintptr, uintptr) int32
  68227 				}{pagerStress}))
  68228 			}
  68229 			return uintptr(0)
  68230 		}(), *(*uintptr)(unsafe.Pointer(bp)), (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpPCache)
  68231 __32:
  68232 	;
  68233 	if !(rc != SQLITE_OK) {
  68234 		goto __33
  68235 	}
  68236 	Xsqlite3OsClose(tls, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Ffd)
  68237 	Xsqlite3PageFree(tls, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpTmpSpace)
  68238 	Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp)))
  68239 	return rc
  68240 __33:
  68241 	;
  68242 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FuseJournal = U8(useJournal)
  68243 
  68244 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FmxPgno = Pgno(SQLITE_MAX_PAGE_COUNT)
  68245 
  68246 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtempFile = U8(tempFile)
  68247 
  68248 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FexclusiveMode = U8(tempFile)
  68249 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FchangeCountDone = (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtempFile
  68250 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FmemDb = U8(memDb)
  68251 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FreadOnly = U8(readOnly)
  68252 
  68253 	Xsqlite3PagerSetFlags(tls, *(*uintptr)(unsafe.Pointer(bp)), uint32(SQLITE_DEFAULT_SYNCHRONOUS+1|PAGER_CACHESPILL))
  68254 
  68255 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnExtra = U16(nExtra)
  68256 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FjournalSizeLimit = int64(-1)
  68257 
  68258 	setSectorSize(tls, *(*uintptr)(unsafe.Pointer(bp)))
  68259 	if !!(useJournal != 0) {
  68260 		goto __34
  68261 	}
  68262 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FjournalMode = U8(PAGER_JOURNALMODE_OFF)
  68263 	goto __35
  68264 __34:
  68265 	if !(memDb != 0 || memJM != 0) {
  68266 		goto __36
  68267 	}
  68268 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FjournalMode = U8(PAGER_JOURNALMODE_MEMORY)
  68269 __36:
  68270 	;
  68271 __35:
  68272 	;
  68273 	(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = xReinit
  68274 	setGetterMethod(tls, *(*uintptr)(unsafe.Pointer(bp)))
  68275 
  68276 	*(*uintptr)(unsafe.Pointer(ppPager)) = *(*uintptr)(unsafe.Pointer(bp))
  68277 	return SQLITE_OK
  68278 }
  68279 
  68280 // Return the sqlite3_file for the main database given the name
  68281 // of the corresonding WAL or Journal name as passed into
  68282 // xOpen.
  68283 func Xsqlite3_database_file_object(tls *libc.TLS, zName uintptr) uintptr {
  68284 	var pPager uintptr
  68285 	for int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-1)))) != 0 || int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-2)))) != 0 || int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-3)))) != 0 || int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-4)))) != 0 {
  68286 		zName--
  68287 	}
  68288 	pPager = *(*uintptr)(unsafe.Pointer(zName - uintptr(4) - uintptr(uint64(unsafe.Sizeof(uintptr(0))))))
  68289 	return (*Pager)(unsafe.Pointer(pPager)).Ffd
  68290 }
  68291 
  68292 func hasHotJournal(tls *libc.TLS, pPager uintptr, pExists uintptr) int32 {
  68293 	bp := tls.Alloc(17)
  68294 	defer tls.Free(17)
  68295 
  68296 	var pVfs uintptr = (*Pager)(unsafe.Pointer(pPager)).FpVfs
  68297 	var rc int32 = SQLITE_OK
  68298 	*(*int32)(unsafe.Pointer(bp)) = 1
  68299 	var jrnlOpen int32 = libc.BoolInt32(!!((*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0)))
  68300 
  68301 	*(*int32)(unsafe.Pointer(pExists)) = 0
  68302 	if !(jrnlOpen != 0) {
  68303 		rc = Xsqlite3OsAccess(tls, pVfs, (*Pager)(unsafe.Pointer(pPager)).FzJournal, SQLITE_ACCESS_EXISTS, bp)
  68304 	}
  68305 	if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp)) != 0 {
  68306 		*(*int32)(unsafe.Pointer(bp + 4)) = 0
  68307 
  68308 		rc = Xsqlite3OsCheckReservedLock(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, bp+4)
  68309 		if rc == SQLITE_OK && !(*(*int32)(unsafe.Pointer(bp + 4)) != 0) {
  68310 			rc = pagerPagecount(tls, pPager, bp+8)
  68311 			if rc == SQLITE_OK {
  68312 				if *(*Pgno)(unsafe.Pointer(bp + 8)) == Pgno(0) && !(jrnlOpen != 0) {
  68313 					Xsqlite3BeginBenignMalloc(tls)
  68314 					if pagerLockDb(tls, pPager, RESERVED_LOCK) == SQLITE_OK {
  68315 						Xsqlite3OsDelete(tls, pVfs, (*Pager)(unsafe.Pointer(pPager)).FzJournal, 0)
  68316 						if !(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0) {
  68317 							pagerUnlockDb(tls, pPager, SHARED_LOCK)
  68318 						}
  68319 					}
  68320 					Xsqlite3EndBenignMalloc(tls)
  68321 				} else {
  68322 					if !(jrnlOpen != 0) {
  68323 						*(*int32)(unsafe.Pointer(bp + 12)) = SQLITE_OPEN_READONLY | SQLITE_OPEN_MAIN_JOURNAL
  68324 						rc = Xsqlite3OsOpen(tls, pVfs, (*Pager)(unsafe.Pointer(pPager)).FzJournal, (*Pager)(unsafe.Pointer(pPager)).Fjfd, *(*int32)(unsafe.Pointer(bp + 12)), bp+12)
  68325 					}
  68326 					if rc == SQLITE_OK {
  68327 						*(*U8)(unsafe.Pointer(bp + 16)) = U8(0)
  68328 						rc = Xsqlite3OsRead(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, bp+16, 1, int64(0))
  68329 						if rc == SQLITE_IOERR|int32(2)<<8 {
  68330 							rc = SQLITE_OK
  68331 						}
  68332 						if !(jrnlOpen != 0) {
  68333 							Xsqlite3OsClose(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd)
  68334 						}
  68335 						*(*int32)(unsafe.Pointer(pExists)) = libc.Bool32(int32(*(*U8)(unsafe.Pointer(bp + 16))) != 0)
  68336 					} else if rc == SQLITE_CANTOPEN {
  68337 						*(*int32)(unsafe.Pointer(pExists)) = 1
  68338 						rc = SQLITE_OK
  68339 					}
  68340 				}
  68341 			}
  68342 		}
  68343 	}
  68344 
  68345 	return rc
  68346 }
  68347 
  68348 // This function is called to obtain a shared lock on the database file.
  68349 // It is illegal to call sqlite3PagerGet() until after this function
  68350 // has been successfully called. If a shared-lock is already held when
  68351 // this function is called, it is a no-op.
  68352 //
  68353 // The following operations are also performed by this function.
  68354 //
  68355 //  1. If the pager is currently in PAGER_OPEN state (no lock held
  68356 //     on the database file), then an attempt is made to obtain a
  68357 //     SHARED lock on the database file. Immediately after obtaining
  68358 //     the SHARED lock, the file-system is checked for a hot-journal,
  68359 //     which is played back if present. Following any hot-journal
  68360 //     rollback, the contents of the cache are validated by checking
  68361 //     the 'change-counter' field of the database file header and
  68362 //     discarded if they are found to be invalid.
  68363 //
  68364 //  2. If the pager is running in exclusive-mode, and there are currently
  68365 //     no outstanding references to any pages, and is in the error state,
  68366 //     then an attempt is made to clear the error state by discarding
  68367 //     the contents of the page cache and rolling back any open journal
  68368 //     file.
  68369 //
  68370 // If everything is successful, SQLITE_OK is returned. If an IO error
  68371 // occurs while locking the database, checking for a hot-journal file or
  68372 // rolling back a journal file, the IO error code is returned.
  68373 func Xsqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) int32 {
  68374 	bp := tls.Alloc(28)
  68375 	defer tls.Free(28)
  68376 
  68377 	var rc int32
  68378 
  68379 	var f int32
  68380 	var pVfs uintptr
  68381 
  68382 	rc = SQLITE_OK
  68383 
  68384 	if !(!((*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0)) && int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) {
  68385 		goto __1
  68386 	}
  68387 	*(*int32)(unsafe.Pointer(bp)) = 1
  68388 
  68389 	rc = pager_wait_on_lock(tls, pPager, SHARED_LOCK)
  68390 	if !(rc != SQLITE_OK) {
  68391 		goto __2
  68392 	}
  68393 
  68394 	goto failed
  68395 __2:
  68396 	;
  68397 	if !(int32((*Pager)(unsafe.Pointer(pPager)).FeLock) <= SHARED_LOCK) {
  68398 		goto __3
  68399 	}
  68400 	rc = hasHotJournal(tls, pPager, bp)
  68401 __3:
  68402 	;
  68403 	if !(rc != SQLITE_OK) {
  68404 		goto __4
  68405 	}
  68406 	goto failed
  68407 __4:
  68408 	;
  68409 	if !(*(*int32)(unsafe.Pointer(bp)) != 0) {
  68410 		goto __5
  68411 	}
  68412 	if !((*Pager)(unsafe.Pointer(pPager)).FreadOnly != 0) {
  68413 		goto __6
  68414 	}
  68415 	rc = SQLITE_READONLY | int32(3)<<8
  68416 	goto failed
  68417 __6:
  68418 	;
  68419 	rc = pagerLockDb(tls, pPager, EXCLUSIVE_LOCK)
  68420 	if !(rc != SQLITE_OK) {
  68421 		goto __7
  68422 	}
  68423 	goto failed
  68424 __7:
  68425 	;
  68426 	if !(!((*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0)) && int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) != PAGER_JOURNALMODE_OFF) {
  68427 		goto __8
  68428 	}
  68429 	pVfs = (*Pager)(unsafe.Pointer(pPager)).FpVfs
  68430 	rc = Xsqlite3OsAccess(tls,
  68431 		pVfs, (*Pager)(unsafe.Pointer(pPager)).FzJournal, SQLITE_ACCESS_EXISTS, bp+4)
  68432 	if !(rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 4)) != 0) {
  68433 		goto __9
  68434 	}
  68435 	*(*int32)(unsafe.Pointer(bp + 8)) = 0
  68436 	f = SQLITE_OPEN_READWRITE | SQLITE_OPEN_MAIN_JOURNAL
  68437 
  68438 	rc = Xsqlite3OsOpen(tls, pVfs, (*Pager)(unsafe.Pointer(pPager)).FzJournal, (*Pager)(unsafe.Pointer(pPager)).Fjfd, f, bp+8)
  68439 
  68440 	if !(rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8))&SQLITE_OPEN_READONLY != 0) {
  68441 		goto __10
  68442 	}
  68443 	rc = Xsqlite3CantopenError(tls, 60758)
  68444 	Xsqlite3OsClose(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd)
  68445 __10:
  68446 	;
  68447 __9:
  68448 	;
  68449 __8:
  68450 	;
  68451 	if !((*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0)) {
  68452 		goto __11
  68453 	}
  68454 
  68455 	rc = pagerSyncHotJournal(tls, pPager)
  68456 	if !(rc == SQLITE_OK) {
  68457 		goto __13
  68458 	}
  68459 	rc = pager_playback(tls, pPager, libc.BoolInt32(!((*Pager)(unsafe.Pointer(pPager)).FtempFile != 0)))
  68460 	(*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN)
  68461 __13:
  68462 	;
  68463 	goto __12
  68464 __11:
  68465 	if !!(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0) {
  68466 		goto __14
  68467 	}
  68468 	pagerUnlockDb(tls, pPager, SHARED_LOCK)
  68469 __14:
  68470 	;
  68471 __12:
  68472 	;
  68473 	if !(rc != SQLITE_OK) {
  68474 		goto __15
  68475 	}
  68476 
  68477 	pager_error(tls, pPager, rc)
  68478 	goto failed
  68479 __15:
  68480 	;
  68481 __5:
  68482 	;
  68483 	if !(!(int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) != 0) && (*Pager)(unsafe.Pointer(pPager)).FhasHeldSharedLock != 0) {
  68484 		goto __16
  68485 	}
  68486 
  68487 	rc = Xsqlite3OsRead(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, bp+12, int32(unsafe.Sizeof([16]int8{})), int64(24))
  68488 	if !(rc != SQLITE_OK) {
  68489 		goto __17
  68490 	}
  68491 	if !(rc != SQLITE_IOERR|int32(2)<<8) {
  68492 		goto __18
  68493 	}
  68494 	goto failed
  68495 __18:
  68496 	;
  68497 	libc.Xmemset(tls, bp+12, 0, uint64(unsafe.Sizeof([16]int8{})))
  68498 __17:
  68499 	;
  68500 	if !(libc.Xmemcmp(tls, pPager+136, bp+12, uint64(unsafe.Sizeof([16]int8{}))) != 0) {
  68501 		goto __19
  68502 	}
  68503 	pager_reset(tls, pPager)
  68504 
  68505 	if !((*Pager)(unsafe.Pointer(pPager)).FbUseFetch != 0) {
  68506 		goto __20
  68507 	}
  68508 	Xsqlite3OsUnfetch(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, int64(0), uintptr(0))
  68509 __20:
  68510 	;
  68511 __19:
  68512 	;
  68513 __16:
  68514 	;
  68515 	rc = pagerOpenWalIfPresent(tls, pPager)
  68516 
  68517 __1:
  68518 	;
  68519 	if !((*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0)) {
  68520 		goto __21
  68521 	}
  68522 
  68523 	rc = pagerBeginReadTransaction(tls, pPager)
  68524 __21:
  68525 	;
  68526 	if !(int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) == 0 && int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN && rc == SQLITE_OK) {
  68527 		goto __22
  68528 	}
  68529 	rc = pagerPagecount(tls, pPager, pPager+32)
  68530 __22:
  68531 	;
  68532 failed:
  68533 	if !(rc != SQLITE_OK) {
  68534 		goto __23
  68535 	}
  68536 
  68537 	pager_unlock(tls, pPager)
  68538 
  68539 	goto __24
  68540 __23:
  68541 	(*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_READER)
  68542 	(*Pager)(unsafe.Pointer(pPager)).FhasHeldSharedLock = U8(1)
  68543 __24:
  68544 	;
  68545 	return rc
  68546 }
  68547 
  68548 func pagerUnlockIfUnused(tls *libc.TLS, pPager uintptr) {
  68549 	if Xsqlite3PcacheRefCount(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) == int64(0) {
  68550 		pagerUnlockAndRollback(tls, pPager)
  68551 	}
  68552 }
  68553 
  68554 func getPageNormal(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 {
  68555 	bp := tls.Alloc(8)
  68556 	defer tls.Free(8)
  68557 
  68558 	var rc int32
  68559 	var pPg uintptr
  68560 	var noContent U8
  68561 
  68562 	rc = SQLITE_OK
  68563 
  68564 	if !(pgno == Pgno(0)) {
  68565 		goto __1
  68566 	}
  68567 	return Xsqlite3CorruptError(tls, 60971)
  68568 __1:
  68569 	;
  68570 	*(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3PcacheFetch(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, pgno, 3)
  68571 	if !(*(*uintptr)(unsafe.Pointer(bp)) == uintptr(0)) {
  68572 		goto __2
  68573 	}
  68574 	pPg = uintptr(0)
  68575 	rc = Xsqlite3PcacheFetchStress(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, pgno, bp)
  68576 	if !(rc != SQLITE_OK) {
  68577 		goto __3
  68578 	}
  68579 	goto pager_acquire_err
  68580 __3:
  68581 	;
  68582 	if !(*(*uintptr)(unsafe.Pointer(bp)) == uintptr(0)) {
  68583 		goto __4
  68584 	}
  68585 	rc = SQLITE_NOMEM
  68586 	goto pager_acquire_err
  68587 __4:
  68588 	;
  68589 __2:
  68590 	;
  68591 	pPg = libc.AssignPtrUintptr(ppPage, Xsqlite3PcacheFetchFinish(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, pgno, *(*uintptr)(unsafe.Pointer(bp))))
  68592 
  68593 	noContent = U8(libc.Bool32(flags&PAGER_GET_NOCONTENT != 0))
  68594 	if !((*PgHdr)(unsafe.Pointer(pPg)).FpPager != 0 && !(noContent != 0)) {
  68595 		goto __5
  68596 	}
  68597 
  68598 	*(*int32)(unsafe.Pointer(pPager + 248))++
  68599 	return SQLITE_OK
  68600 
  68601 	goto __6
  68602 __5:
  68603 	if !(pgno == (*Pager)(unsafe.Pointer(pPager)).FlckPgno) {
  68604 		goto __7
  68605 	}
  68606 	rc = Xsqlite3CorruptError(tls, 61003)
  68607 	goto pager_acquire_err
  68608 __7:
  68609 	;
  68610 	(*PgHdr)(unsafe.Pointer(pPg)).FpPager = pPager
  68611 
  68612 	if !(!((*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0)) || (*Pager)(unsafe.Pointer(pPager)).FdbSize < pgno || noContent != 0) {
  68613 		goto __8
  68614 	}
  68615 	if !(pgno > (*Pager)(unsafe.Pointer(pPager)).FmxPgno) {
  68616 		goto __10
  68617 	}
  68618 	rc = SQLITE_FULL
  68619 	goto pager_acquire_err
  68620 __10:
  68621 	;
  68622 	if !(noContent != 0) {
  68623 		goto __11
  68624 	}
  68625 
  68626 	Xsqlite3BeginBenignMalloc(tls)
  68627 	if !(pgno <= (*Pager)(unsafe.Pointer(pPager)).FdbOrigSize) {
  68628 		goto __12
  68629 	}
  68630 	Xsqlite3BitvecSet(tls, (*Pager)(unsafe.Pointer(pPager)).FpInJournal, pgno)
  68631 
  68632 __12:
  68633 	;
  68634 	addToSavepointBitvecs(tls, pPager, pgno)
  68635 
  68636 	Xsqlite3EndBenignMalloc(tls)
  68637 __11:
  68638 	;
  68639 	libc.Xmemset(tls, (*PgHdr)(unsafe.Pointer(pPg)).FpData, 0, uint64((*Pager)(unsafe.Pointer(pPager)).FpageSize))
  68640 
  68641 	goto __9
  68642 __8:
  68643 	;
  68644 	*(*int32)(unsafe.Pointer(pPager + 248 + 1*4))++
  68645 	rc = readDbPage(tls, pPg)
  68646 	if !(rc != SQLITE_OK) {
  68647 		goto __13
  68648 	}
  68649 	goto pager_acquire_err
  68650 __13:
  68651 	;
  68652 __9:
  68653 	;
  68654 __6:
  68655 	;
  68656 	return SQLITE_OK
  68657 
  68658 pager_acquire_err:
  68659 	;
  68660 	if !(pPg != 0) {
  68661 		goto __14
  68662 	}
  68663 	Xsqlite3PcacheDrop(tls, pPg)
  68664 __14:
  68665 	;
  68666 	pagerUnlockIfUnused(tls, pPager)
  68667 	*(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0)
  68668 	return rc
  68669 }
  68670 
  68671 func getPageMMap(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 {
  68672 	bp := tls.Alloc(24)
  68673 	defer tls.Free(24)
  68674 
  68675 	var rc int32 = SQLITE_OK
  68676 	*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
  68677 	*(*U32)(unsafe.Pointer(bp)) = U32(0)
  68678 
  68679 	var bMmapOk int32 = libc.Bool32(pgno > Pgno(1) &&
  68680 		(int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_READER || flags&PAGER_GET_READONLY != 0))
  68681 
  68682 	if pgno <= Pgno(1) && pgno == Pgno(0) {
  68683 		return Xsqlite3CorruptError(tls, 61082)
  68684 	}
  68685 
  68686 	if bMmapOk != 0 && (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) {
  68687 		rc = Xsqlite3WalFindFrame(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, pgno, bp)
  68688 		if rc != SQLITE_OK {
  68689 			*(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0)
  68690 			return rc
  68691 		}
  68692 	}
  68693 	if bMmapOk != 0 && *(*U32)(unsafe.Pointer(bp)) == U32(0) {
  68694 		*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
  68695 		rc = Xsqlite3OsFetch(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd,
  68696 			I64(pgno-Pgno(1))*(*Pager)(unsafe.Pointer(pPager)).FpageSize, int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), bp+8)
  68697 		if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 {
  68698 			if int32((*Pager)(unsafe.Pointer(pPager)).FeState) > PAGER_READER || (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 {
  68699 				*(*uintptr)(unsafe.Pointer(bp + 16)) = Xsqlite3PagerLookup(tls, pPager, pgno)
  68700 			}
  68701 			if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) {
  68702 				rc = pagerAcquireMapPage(tls, pPager, pgno, *(*uintptr)(unsafe.Pointer(bp + 8)), bp+16)
  68703 			} else {
  68704 				Xsqlite3OsUnfetch(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, I64(pgno-Pgno(1))*(*Pager)(unsafe.Pointer(pPager)).FpageSize, *(*uintptr)(unsafe.Pointer(bp + 8)))
  68705 			}
  68706 			if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 {
  68707 				*(*uintptr)(unsafe.Pointer(ppPage)) = *(*uintptr)(unsafe.Pointer(bp + 16))
  68708 				return SQLITE_OK
  68709 			}
  68710 		}
  68711 		if rc != SQLITE_OK {
  68712 			*(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0)
  68713 			return rc
  68714 		}
  68715 	}
  68716 	return getPageNormal(tls, pPager, pgno, ppPage, flags)
  68717 }
  68718 
  68719 func getPageError(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 {
  68720 	_ = pgno
  68721 	_ = flags
  68722 
  68723 	*(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0)
  68724 	return (*Pager)(unsafe.Pointer(pPager)).FerrCode
  68725 }
  68726 
  68727 // Dispatch all page fetch requests to the appropriate getter method.
  68728 func Xsqlite3PagerGet(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 {
  68729 	return (*struct {
  68730 		f func(*libc.TLS, uintptr, Pgno, uintptr, int32) int32
  68731 	})(unsafe.Pointer(&struct{ uintptr }{(*Pager)(unsafe.Pointer(pPager)).FxGet})).f(tls, pPager, pgno, ppPage, flags)
  68732 }
  68733 
  68734 // Acquire a page if it is already in the in-memory cache.  Do
  68735 // not read the page from disk.  Return a pointer to the page,
  68736 // or 0 if the page is not in cache.
  68737 //
  68738 // See also sqlite3PagerGet().  The difference between this routine
  68739 // and sqlite3PagerGet() is that _get() will go to the disk and read
  68740 // in the page if the page is not already in cache.  This routine
  68741 // returns NULL if the page is not in cache or if a disk I/O error
  68742 // has ever happened.
  68743 func Xsqlite3PagerLookup(tls *libc.TLS, pPager uintptr, pgno Pgno) uintptr {
  68744 	var pPage uintptr
  68745 
  68746 	pPage = Xsqlite3PcacheFetch(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, pgno, 0)
  68747 
  68748 	if pPage == uintptr(0) {
  68749 		return uintptr(0)
  68750 	}
  68751 	return Xsqlite3PcacheFetchFinish(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, pgno, pPage)
  68752 }
  68753 
  68754 // Release a page reference.
  68755 //
  68756 // The sqlite3PagerUnref() and sqlite3PagerUnrefNotNull() may only be
  68757 // used if we know that the page being released is not the last page.
  68758 // The btree layer always holds page1 open until the end, so these first
  68759 // to routines can be used to release any page other than BtShared.pPage1.
  68760 //
  68761 // Use sqlite3PagerUnrefPageOne() to release page1.  This latter routine
  68762 // checks the total number of outstanding pages and if the number of
  68763 // pages reaches zero it drops the database lock.
  68764 func Xsqlite3PagerUnrefNotNull(tls *libc.TLS, pPg uintptr) {
  68765 	if int32((*DbPage)(unsafe.Pointer(pPg)).Fflags)&PGHDR_MMAP != 0 {
  68766 		pagerReleaseMapPage(tls, pPg)
  68767 	} else {
  68768 		Xsqlite3PcacheRelease(tls, pPg)
  68769 	}
  68770 
  68771 }
  68772 
  68773 func Xsqlite3PagerUnref(tls *libc.TLS, pPg uintptr) {
  68774 	if pPg != 0 {
  68775 		Xsqlite3PagerUnrefNotNull(tls, pPg)
  68776 	}
  68777 }
  68778 
  68779 func Xsqlite3PagerUnrefPageOne(tls *libc.TLS, pPg uintptr) {
  68780 	var pPager uintptr
  68781 
  68782 	pPager = (*DbPage)(unsafe.Pointer(pPg)).FpPager
  68783 	Xsqlite3PcacheRelease(tls, pPg)
  68784 	pagerUnlockIfUnused(tls, pPager)
  68785 }
  68786 
  68787 func pager_open_journal(tls *libc.TLS, pPager uintptr) int32 {
  68788 	var rc int32 = SQLITE_OK
  68789 	var pVfs uintptr = (*Pager)(unsafe.Pointer(pPager)).FpVfs
  68790 
  68791 	if (*Pager)(unsafe.Pointer(pPager)).FerrCode != 0 {
  68792 		return (*Pager)(unsafe.Pointer(pPager)).FerrCode
  68793 	}
  68794 
  68795 	if !((*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0)) && int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) != PAGER_JOURNALMODE_OFF {
  68796 		(*Pager)(unsafe.Pointer(pPager)).FpInJournal = Xsqlite3BitvecCreate(tls, (*Pager)(unsafe.Pointer(pPager)).FdbSize)
  68797 		if (*Pager)(unsafe.Pointer(pPager)).FpInJournal == uintptr(0) {
  68798 			return SQLITE_NOMEM
  68799 		}
  68800 
  68801 		if !((*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0)) {
  68802 			if int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_MEMORY {
  68803 				Xsqlite3MemJournalOpen(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd)
  68804 			} else {
  68805 				var flags int32 = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE
  68806 				var nSpill int32
  68807 
  68808 				if (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 {
  68809 					flags = flags | (SQLITE_OPEN_DELETEONCLOSE | SQLITE_OPEN_TEMP_JOURNAL)
  68810 					flags = flags | SQLITE_OPEN_EXCLUSIVE
  68811 					nSpill = Xsqlite3Config.FnStmtSpill
  68812 				} else {
  68813 					flags = flags | SQLITE_OPEN_MAIN_JOURNAL
  68814 					nSpill = jrnlBufferSize(tls, pPager)
  68815 				}
  68816 
  68817 				rc = databaseIsUnmoved(tls, pPager)
  68818 				if rc == SQLITE_OK {
  68819 					rc = Xsqlite3JournalOpen(tls,
  68820 						pVfs, (*Pager)(unsafe.Pointer(pPager)).FzJournal, (*Pager)(unsafe.Pointer(pPager)).Fjfd, flags, nSpill)
  68821 				}
  68822 			}
  68823 
  68824 		}
  68825 
  68826 		if rc == SQLITE_OK {
  68827 			(*Pager)(unsafe.Pointer(pPager)).FnRec = 0
  68828 			(*Pager)(unsafe.Pointer(pPager)).FjournalOff = int64(0)
  68829 			(*Pager)(unsafe.Pointer(pPager)).FsetSuper = U8(0)
  68830 			(*Pager)(unsafe.Pointer(pPager)).FjournalHdr = int64(0)
  68831 			rc = writeJournalHdr(tls, pPager)
  68832 		}
  68833 	}
  68834 
  68835 	if rc != SQLITE_OK {
  68836 		Xsqlite3BitvecDestroy(tls, (*Pager)(unsafe.Pointer(pPager)).FpInJournal)
  68837 		(*Pager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0)
  68838 		(*Pager)(unsafe.Pointer(pPager)).FjournalOff = int64(0)
  68839 	} else {
  68840 		(*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_WRITER_CACHEMOD)
  68841 	}
  68842 
  68843 	return rc
  68844 }
  68845 
  68846 // Begin a write-transaction on the specified pager object. If a
  68847 // write-transaction has already been opened, this function is a no-op.
  68848 //
  68849 // If the exFlag argument is false, then acquire at least a RESERVED
  68850 // lock on the database file. If exFlag is true, then acquire at least
  68851 // an EXCLUSIVE lock. If such a lock is already held, no locking
  68852 // functions need be called.
  68853 //
  68854 // If the subjInMemory argument is non-zero, then any sub-journal opened
  68855 // within this transaction will be opened as an in-memory file. This
  68856 // has no effect if the sub-journal is already opened (as it may be when
  68857 // running in exclusive mode) or if the transaction does not require a
  68858 // sub-journal. If the subjInMemory argument is zero, then any required
  68859 // sub-journal is implemented in-memory if pPager is an in-memory database,
  68860 // or using a temporary file otherwise.
  68861 func Xsqlite3PagerBegin(tls *libc.TLS, pPager uintptr, exFlag int32, subjInMemory int32) int32 {
  68862 	var rc int32 = SQLITE_OK
  68863 
  68864 	if (*Pager)(unsafe.Pointer(pPager)).FerrCode != 0 {
  68865 		return (*Pager)(unsafe.Pointer(pPager)).FerrCode
  68866 	}
  68867 
  68868 	(*Pager)(unsafe.Pointer(pPager)).FsubjInMemory = U8(subjInMemory)
  68869 
  68870 	if int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_READER {
  68871 		if (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) {
  68872 			if (*Pager)(unsafe.Pointer(pPager)).FexclusiveMode != 0 && Xsqlite3WalExclusiveMode(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, -1) != 0 {
  68873 				rc = pagerLockDb(tls, pPager, EXCLUSIVE_LOCK)
  68874 				if rc != SQLITE_OK {
  68875 					return rc
  68876 				}
  68877 				Xsqlite3WalExclusiveMode(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, 1)
  68878 			}
  68879 
  68880 			rc = Xsqlite3WalBeginWriteTransaction(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal)
  68881 		} else {
  68882 			rc = pagerLockDb(tls, pPager, RESERVED_LOCK)
  68883 			if rc == SQLITE_OK && exFlag != 0 {
  68884 				rc = pager_wait_on_lock(tls, pPager, EXCLUSIVE_LOCK)
  68885 			}
  68886 		}
  68887 
  68888 		if rc == SQLITE_OK {
  68889 			(*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_WRITER_LOCKED)
  68890 			(*Pager)(unsafe.Pointer(pPager)).FdbHintSize = (*Pager)(unsafe.Pointer(pPager)).FdbSize
  68891 			(*Pager)(unsafe.Pointer(pPager)).FdbFileSize = (*Pager)(unsafe.Pointer(pPager)).FdbSize
  68892 			(*Pager)(unsafe.Pointer(pPager)).FdbOrigSize = (*Pager)(unsafe.Pointer(pPager)).FdbSize
  68893 			(*Pager)(unsafe.Pointer(pPager)).FjournalOff = int64(0)
  68894 		}
  68895 
  68896 	}
  68897 
  68898 	return rc
  68899 }
  68900 
  68901 func pagerAddPageToRollbackJournal(tls *libc.TLS, pPg uintptr) int32 {
  68902 	var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager
  68903 	var rc int32
  68904 	var cksum U32
  68905 	var pData2 uintptr
  68906 	var iOff I64 = (*Pager)(unsafe.Pointer(pPager)).FjournalOff
  68907 
  68908 	pData2 = (*PgHdr)(unsafe.Pointer(pPg)).FpData
  68909 	cksum = pager_cksum(tls, pPager, pData2)
  68910 
  68911 	*(*U16)(unsafe.Pointer(pPg + 52)) |= U16(PGHDR_NEED_SYNC)
  68912 
  68913 	rc = write32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iOff, (*PgHdr)(unsafe.Pointer(pPg)).Fpgno)
  68914 	if rc != SQLITE_OK {
  68915 		return rc
  68916 	}
  68917 	rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, pData2, int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), iOff+int64(4))
  68918 	if rc != SQLITE_OK {
  68919 		return rc
  68920 	}
  68921 	rc = write32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iOff+(*Pager)(unsafe.Pointer(pPager)).FpageSize+int64(4), cksum)
  68922 	if rc != SQLITE_OK {
  68923 		return rc
  68924 	}
  68925 
  68926 	*(*I64)(unsafe.Pointer(pPager + 96)) += int64(8) + (*Pager)(unsafe.Pointer(pPager)).FpageSize
  68927 	(*Pager)(unsafe.Pointer(pPager)).FnRec++
  68928 
  68929 	rc = Xsqlite3BitvecSet(tls, (*Pager)(unsafe.Pointer(pPager)).FpInJournal, (*PgHdr)(unsafe.Pointer(pPg)).Fpgno)
  68930 
  68931 	rc = rc | addToSavepointBitvecs(tls, pPager, (*PgHdr)(unsafe.Pointer(pPg)).Fpgno)
  68932 
  68933 	return rc
  68934 }
  68935 
  68936 func pager_write(tls *libc.TLS, pPg uintptr) int32 {
  68937 	var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager
  68938 	var rc int32 = SQLITE_OK
  68939 
  68940 	if int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_WRITER_LOCKED {
  68941 		rc = pager_open_journal(tls, pPager)
  68942 		if rc != SQLITE_OK {
  68943 			return rc
  68944 		}
  68945 	}
  68946 
  68947 	Xsqlite3PcacheMakeDirty(tls, pPg)
  68948 
  68949 	if (*Pager)(unsafe.Pointer(pPager)).FpInJournal != uintptr(0) &&
  68950 		Xsqlite3BitvecTestNotNull(tls, (*Pager)(unsafe.Pointer(pPager)).FpInJournal, (*PgHdr)(unsafe.Pointer(pPg)).Fpgno) == 0 {
  68951 		if (*PgHdr)(unsafe.Pointer(pPg)).Fpgno <= (*Pager)(unsafe.Pointer(pPager)).FdbOrigSize {
  68952 			rc = pagerAddPageToRollbackJournal(tls, pPg)
  68953 			if rc != SQLITE_OK {
  68954 				return rc
  68955 			}
  68956 		} else {
  68957 			if int32((*Pager)(unsafe.Pointer(pPager)).FeState) != PAGER_WRITER_DBMOD {
  68958 				*(*U16)(unsafe.Pointer(pPg + 52)) |= U16(PGHDR_NEED_SYNC)
  68959 			}
  68960 
  68961 		}
  68962 	}
  68963 
  68964 	*(*U16)(unsafe.Pointer(pPg + 52)) |= U16(PGHDR_WRITEABLE)
  68965 
  68966 	if (*Pager)(unsafe.Pointer(pPager)).FnSavepoint > 0 {
  68967 		rc = subjournalPageIfRequired(tls, pPg)
  68968 	}
  68969 
  68970 	if (*Pager)(unsafe.Pointer(pPager)).FdbSize < (*PgHdr)(unsafe.Pointer(pPg)).Fpgno {
  68971 		(*Pager)(unsafe.Pointer(pPager)).FdbSize = (*PgHdr)(unsafe.Pointer(pPg)).Fpgno
  68972 	}
  68973 	return rc
  68974 }
  68975 
  68976 func pagerWriteLargeSector(tls *libc.TLS, pPg uintptr) int32 {
  68977 	bp := tls.Alloc(8)
  68978 	defer tls.Free(8)
  68979 
  68980 	var rc int32 = SQLITE_OK
  68981 	var nPageCount Pgno
  68982 	var pg1 Pgno
  68983 	var nPage int32 = 0
  68984 	var ii int32
  68985 	var needSync int32 = 0
  68986 	var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager
  68987 	var nPagePerSector Pgno = Pgno(I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize) / (*Pager)(unsafe.Pointer(pPager)).FpageSize)
  68988 
  68989 	*(*U8)(unsafe.Pointer(pPager + 25)) |= U8(SPILLFLAG_NOSYNC)
  68990 
  68991 	pg1 = ((*PgHdr)(unsafe.Pointer(pPg)).Fpgno-Pgno(1)) & ^(nPagePerSector-Pgno(1)) + Pgno(1)
  68992 
  68993 	nPageCount = (*Pager)(unsafe.Pointer(pPager)).FdbSize
  68994 	if (*PgHdr)(unsafe.Pointer(pPg)).Fpgno > nPageCount {
  68995 		nPage = int32((*PgHdr)(unsafe.Pointer(pPg)).Fpgno - pg1 + Pgno(1))
  68996 	} else if pg1+nPagePerSector-Pgno(1) > nPageCount {
  68997 		nPage = int32(nPageCount + Pgno(1) - pg1)
  68998 	} else {
  68999 		nPage = int32(nPagePerSector)
  69000 	}
  69001 
  69002 	for ii = 0; ii < nPage && rc == SQLITE_OK; ii++ {
  69003 		var pg Pgno = pg1 + Pgno(ii)
  69004 
  69005 		if pg == (*PgHdr)(unsafe.Pointer(pPg)).Fpgno || !(Xsqlite3BitvecTest(tls, (*Pager)(unsafe.Pointer(pPager)).FpInJournal, pg) != 0) {
  69006 			if pg != (*Pager)(unsafe.Pointer(pPager)).FlckPgno {
  69007 				rc = Xsqlite3PagerGet(tls, pPager, pg, bp, 0)
  69008 				if rc == SQLITE_OK {
  69009 					rc = pager_write(tls, *(*uintptr)(unsafe.Pointer(bp)))
  69010 					if int32((*PgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags)&PGHDR_NEED_SYNC != 0 {
  69011 						needSync = 1
  69012 					}
  69013 					Xsqlite3PagerUnrefNotNull(tls, *(*uintptr)(unsafe.Pointer(bp)))
  69014 				}
  69015 			}
  69016 		} else if libc.AssignPtrUintptr(bp, Xsqlite3PagerLookup(tls, pPager, pg)) != uintptr(0) {
  69017 			if int32((*PgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags)&PGHDR_NEED_SYNC != 0 {
  69018 				needSync = 1
  69019 			}
  69020 			Xsqlite3PagerUnrefNotNull(tls, *(*uintptr)(unsafe.Pointer(bp)))
  69021 		}
  69022 	}
  69023 
  69024 	if rc == SQLITE_OK && needSync != 0 {
  69025 		for ii = 0; ii < nPage; ii++ {
  69026 			var pPage uintptr = Xsqlite3PagerLookup(tls, pPager, pg1+Pgno(ii))
  69027 			if pPage != 0 {
  69028 				*(*U16)(unsafe.Pointer(pPage + 52)) |= U16(PGHDR_NEED_SYNC)
  69029 				Xsqlite3PagerUnrefNotNull(tls, pPage)
  69030 			}
  69031 		}
  69032 	}
  69033 
  69034 	*(*U8)(unsafe.Pointer(pPager + 25)) &= libc.Uint8FromInt32(libc.CplInt32(SPILLFLAG_NOSYNC))
  69035 	return rc
  69036 }
  69037 
  69038 // Mark a data page as writeable. This routine must be called before
  69039 // making changes to a page. The caller must check the return value
  69040 // of this function and be careful not to change any page data unless
  69041 // this routine returns SQLITE_OK.
  69042 //
  69043 // The difference between this function and pager_write() is that this
  69044 // function also deals with the special case where 2 or more pages
  69045 // fit on a single disk sector. In this case all co-resident pages
  69046 // must have been written to the journal file before returning.
  69047 //
  69048 // If an error occurs, SQLITE_NOMEM or an IO error code is returned
  69049 // as appropriate. Otherwise, SQLITE_OK.
  69050 func Xsqlite3PagerWrite(tls *libc.TLS, pPg uintptr) int32 {
  69051 	var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager
  69052 
  69053 	if int32((*PgHdr)(unsafe.Pointer(pPg)).Fflags)&PGHDR_WRITEABLE != 0 && (*Pager)(unsafe.Pointer(pPager)).FdbSize >= (*PgHdr)(unsafe.Pointer(pPg)).Fpgno {
  69054 		if (*Pager)(unsafe.Pointer(pPager)).FnSavepoint != 0 {
  69055 			return subjournalPageIfRequired(tls, pPg)
  69056 		}
  69057 		return SQLITE_OK
  69058 	} else if (*Pager)(unsafe.Pointer(pPager)).FerrCode != 0 {
  69059 		return (*Pager)(unsafe.Pointer(pPager)).FerrCode
  69060 	} else if (*Pager)(unsafe.Pointer(pPager)).FsectorSize > U32((*Pager)(unsafe.Pointer(pPager)).FpageSize) {
  69061 		return pagerWriteLargeSector(tls, pPg)
  69062 	} else {
  69063 		return pager_write(tls, pPg)
  69064 	}
  69065 	return int32(0)
  69066 }
  69067 
  69068 // A call to this routine tells the pager that it is not necessary to
  69069 // write the information on page pPg back to the disk, even though
  69070 // that page might be marked as dirty.  This happens, for example, when
  69071 // the page has been added as a leaf of the freelist and so its
  69072 // content no longer matters.
  69073 //
  69074 // The overlying software layer calls this routine when all of the data
  69075 // on the given page is unused. The pager marks the page as clean so
  69076 // that it does not get written to disk.
  69077 //
  69078 // Tests show that this optimization can quadruple the speed of large
  69079 // DELETE operations.
  69080 //
  69081 // This optimization cannot be used with a temp-file, as the page may
  69082 // have been dirty at the start of the transaction. In that case, if
  69083 // memory pressure forces page pPg out of the cache, the data does need
  69084 // to be written out to disk so that it may be read back in if the
  69085 // current transaction is rolled back.
  69086 func Xsqlite3PagerDontWrite(tls *libc.TLS, pPg uintptr) {
  69087 	var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager
  69088 	if !(int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) != 0) && int32((*PgHdr)(unsafe.Pointer(pPg)).Fflags)&PGHDR_DIRTY != 0 && (*Pager)(unsafe.Pointer(pPager)).FnSavepoint == 0 {
  69089 		*(*U16)(unsafe.Pointer(pPg + 52)) |= U16(PGHDR_DONT_WRITE)
  69090 		*(*U16)(unsafe.Pointer(pPg + 52)) &= libc.Uint16FromInt32(libc.CplInt32(PGHDR_WRITEABLE))
  69091 
  69092 	}
  69093 }
  69094 
  69095 func pager_incr_changecounter(tls *libc.TLS, pPager uintptr, isDirectMode int32) int32 {
  69096 	bp := tls.Alloc(8)
  69097 	defer tls.Free(8)
  69098 
  69099 	var rc int32 = SQLITE_OK
  69100 
  69101 	_ = isDirectMode
  69102 
  69103 	if !(int32((*Pager)(unsafe.Pointer(pPager)).FchangeCountDone) != 0) && (*Pager)(unsafe.Pointer(pPager)).FdbSize > Pgno(0) {
  69104 		rc = Xsqlite3PagerGet(tls, pPager, uint32(1), bp, 0)
  69105 
  69106 		if !(0 != 0) && rc == SQLITE_OK {
  69107 			rc = Xsqlite3PagerWrite(tls, *(*uintptr)(unsafe.Pointer(bp)))
  69108 		}
  69109 
  69110 		if rc == SQLITE_OK {
  69111 			pager_write_changecounter(tls, *(*uintptr)(unsafe.Pointer(bp)))
  69112 
  69113 			if 0 != 0 {
  69114 				var zBuf uintptr
  69115 
  69116 				zBuf = (*PgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpData
  69117 				if rc == SQLITE_OK {
  69118 					rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, zBuf, int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), int64(0))
  69119 					*(*int32)(unsafe.Pointer(pPager + 248 + 2*4))++
  69120 				}
  69121 				if rc == SQLITE_OK {
  69122 					var pCopy uintptr = zBuf + 24
  69123 					libc.Xmemcpy(tls, pPager+136, pCopy, uint64(unsafe.Sizeof([16]int8{})))
  69124 					(*Pager)(unsafe.Pointer(pPager)).FchangeCountDone = U8(1)
  69125 				}
  69126 			} else {
  69127 				(*Pager)(unsafe.Pointer(pPager)).FchangeCountDone = U8(1)
  69128 			}
  69129 		}
  69130 
  69131 		Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp)))
  69132 	}
  69133 	return rc
  69134 }
  69135 
  69136 // Sync the database file to disk. This is a no-op for in-memory databases
  69137 // or pages with the Pager.noSync flag set.
  69138 //
  69139 // If successful, or if called on a pager for which it is a no-op, this
  69140 // function returns SQLITE_OK. Otherwise, an IO error code is returned.
  69141 func Xsqlite3PagerSync(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 {
  69142 	var rc int32 = SQLITE_OK
  69143 	var pArg uintptr = zSuper
  69144 	rc = Xsqlite3OsFileControl(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, SQLITE_FCNTL_SYNC, pArg)
  69145 	if rc == SQLITE_NOTFOUND {
  69146 		rc = SQLITE_OK
  69147 	}
  69148 	if rc == SQLITE_OK && !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) {
  69149 		rc = Xsqlite3OsSync(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags))
  69150 	}
  69151 	return rc
  69152 }
  69153 
  69154 // This function may only be called while a write-transaction is active in
  69155 // rollback. If the connection is in WAL mode, this call is a no-op.
  69156 // Otherwise, if the connection does not already have an EXCLUSIVE lock on
  69157 // the database file, an attempt is made to obtain one.
  69158 //
  69159 // If the EXCLUSIVE lock is already held or the attempt to obtain it is
  69160 // successful, or the connection is in WAL mode, SQLITE_OK is returned.
  69161 // Otherwise, either SQLITE_BUSY or an SQLITE_IOERR_XXX error code is
  69162 // returned.
  69163 func Xsqlite3PagerExclusiveLock(tls *libc.TLS, pPager uintptr) int32 {
  69164 	var rc int32 = (*Pager)(unsafe.Pointer(pPager)).FerrCode
  69165 
  69166 	if rc == SQLITE_OK {
  69167 		if 0 == libc.Bool32((*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0)) {
  69168 			rc = pager_wait_on_lock(tls, pPager, EXCLUSIVE_LOCK)
  69169 		}
  69170 	}
  69171 	return rc
  69172 }
  69173 
  69174 // Sync the database file for the pager pPager. zSuper points to the name
  69175 // of a super-journal file that should be written into the individual
  69176 // journal file. zSuper may be NULL, which is interpreted as no
  69177 // super-journal (a single database transaction).
  69178 //
  69179 // This routine ensures that:
  69180 //
  69181 //   - The database file change-counter is updated,
  69182 //   - the journal is synced (unless the atomic-write optimization is used),
  69183 //   - all dirty pages are written to the database file,
  69184 //   - the database file is truncated (if required), and
  69185 //   - the database file synced.
  69186 //
  69187 // The only thing that remains to commit the transaction is to finalize
  69188 // (delete, truncate or zero the first part of) the journal file (or
  69189 // delete the super-journal file if specified).
  69190 //
  69191 // Note that if zSuper==NULL, this does not overwrite a previous value
  69192 // passed to an sqlite3PagerCommitPhaseOne() call.
  69193 //
  69194 // If the final parameter - noSync - is true, then the database file itself
  69195 // is not synced. The caller must call sqlite3PagerSync() directly to
  69196 // sync the database file before calling CommitPhaseTwo() to delete the
  69197 // journal file in this case.
  69198 func Xsqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, noSync int32) int32 {
  69199 	bp := tls.Alloc(8)
  69200 	defer tls.Free(8)
  69201 
  69202 	var rc int32
  69203 
  69204 	var nNew Pgno
  69205 	var pList uintptr
  69206 	rc = SQLITE_OK
  69207 
  69208 	if !((*Pager)(unsafe.Pointer(pPager)).FerrCode != 0) {
  69209 		goto __1
  69210 	}
  69211 	return (*Pager)(unsafe.Pointer(pPager)).FerrCode
  69212 __1:
  69213 	;
  69214 	if !(Xsqlite3FaultSim(tls, 400) != 0) {
  69215 		goto __2
  69216 	}
  69217 	return SQLITE_IOERR
  69218 __2:
  69219 	;
  69220 	if !(int32((*Pager)(unsafe.Pointer(pPager)).FeState) < PAGER_WRITER_CACHEMOD) {
  69221 		goto __3
  69222 	}
  69223 	return SQLITE_OK
  69224 __3:
  69225 	;
  69226 	if !(0 == pagerFlushOnCommit(tls, pPager, 1)) {
  69227 		goto __4
  69228 	}
  69229 
  69230 	Xsqlite3BackupRestart(tls, (*Pager)(unsafe.Pointer(pPager)).FpBackup)
  69231 	goto __5
  69232 __4:
  69233 	if !((*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0)) {
  69234 		goto __6
  69235 	}
  69236 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
  69237 	pList = Xsqlite3PcacheDirtyList(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
  69238 	if !(pList == uintptr(0)) {
  69239 		goto __8
  69240 	}
  69241 
  69242 	rc = Xsqlite3PagerGet(tls, pPager, uint32(1), bp, 0)
  69243 	pList = *(*uintptr)(unsafe.Pointer(bp))
  69244 	(*PgHdr)(unsafe.Pointer(pList)).FpDirty = uintptr(0)
  69245 __8:
  69246 	;
  69247 	if !(pList != 0) {
  69248 		goto __9
  69249 	}
  69250 	rc = pagerWalFrames(tls, pPager, pList, (*Pager)(unsafe.Pointer(pPager)).FdbSize, 1)
  69251 __9:
  69252 	;
  69253 	Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp)))
  69254 	if !(rc == SQLITE_OK) {
  69255 		goto __10
  69256 	}
  69257 	Xsqlite3PcacheCleanAll(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
  69258 __10:
  69259 	;
  69260 	goto __7
  69261 __6:
  69262 	rc = pager_incr_changecounter(tls, pPager, 0)
  69263 	if !(rc != SQLITE_OK) {
  69264 		goto __11
  69265 	}
  69266 	goto commit_phase_one_exit
  69267 __11:
  69268 	;
  69269 	rc = writeSuperJournal(tls, pPager, zSuper)
  69270 	if !(rc != SQLITE_OK) {
  69271 		goto __12
  69272 	}
  69273 	goto commit_phase_one_exit
  69274 __12:
  69275 	;
  69276 	rc = syncJournal(tls, pPager, 0)
  69277 	if !(rc != SQLITE_OK) {
  69278 		goto __13
  69279 	}
  69280 	goto commit_phase_one_exit
  69281 __13:
  69282 	;
  69283 	pList = Xsqlite3PcacheDirtyList(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
  69284 
  69285 	if !(BBatch == 0) {
  69286 		goto __14
  69287 	}
  69288 	rc = pager_write_pagelist(tls, pPager, pList)
  69289 __14:
  69290 	;
  69291 	if !(rc != SQLITE_OK) {
  69292 		goto __15
  69293 	}
  69294 
  69295 	goto commit_phase_one_exit
  69296 __15:
  69297 	;
  69298 	Xsqlite3PcacheCleanAll(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
  69299 
  69300 	if !((*Pager)(unsafe.Pointer(pPager)).FdbSize > (*Pager)(unsafe.Pointer(pPager)).FdbFileSize) {
  69301 		goto __16
  69302 	}
  69303 	nNew = (*Pager)(unsafe.Pointer(pPager)).FdbSize - Pgno(libc.Bool32((*Pager)(unsafe.Pointer(pPager)).FdbSize == (*Pager)(unsafe.Pointer(pPager)).FlckPgno))
  69304 
  69305 	rc = pager_truncate(tls, pPager, nNew)
  69306 	if !(rc != SQLITE_OK) {
  69307 		goto __17
  69308 	}
  69309 	goto commit_phase_one_exit
  69310 __17:
  69311 	;
  69312 __16:
  69313 	;
  69314 	if !!(noSync != 0) {
  69315 		goto __18
  69316 	}
  69317 	rc = Xsqlite3PagerSync(tls, pPager, zSuper)
  69318 __18:
  69319 	;
  69320 __7:
  69321 	;
  69322 __5:
  69323 	;
  69324 commit_phase_one_exit:
  69325 	if !(rc == SQLITE_OK && !((*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0))) {
  69326 		goto __19
  69327 	}
  69328 	(*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_WRITER_FINISHED)
  69329 __19:
  69330 	;
  69331 	return rc
  69332 }
  69333 
  69334 // When this function is called, the database file has been completely
  69335 // updated to reflect the changes made by the current transaction and
  69336 // synced to disk. The journal file still exists in the file-system
  69337 // though, and if a failure occurs at this point it will eventually
  69338 // be used as a hot-journal and the current transaction rolled back.
  69339 //
  69340 // This function finalizes the journal file, either by deleting,
  69341 // truncating or partially zeroing it, so that it cannot be used
  69342 // for hot-journal rollback. Once this is done the transaction is
  69343 // irrevocably committed.
  69344 //
  69345 // If an error occurs, an IO error code is returned and the pager
  69346 // moves into the error state. Otherwise, SQLITE_OK is returned.
  69347 func Xsqlite3PagerCommitPhaseTwo(tls *libc.TLS, pPager uintptr) int32 {
  69348 	var rc int32 = SQLITE_OK
  69349 
  69350 	if (*Pager)(unsafe.Pointer(pPager)).FerrCode != 0 {
  69351 		return (*Pager)(unsafe.Pointer(pPager)).FerrCode
  69352 	}
  69353 	(*Pager)(unsafe.Pointer(pPager)).FiDataVersion++
  69354 
  69355 	if int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_WRITER_LOCKED &&
  69356 		(*Pager)(unsafe.Pointer(pPager)).FexclusiveMode != 0 &&
  69357 		int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_PERSIST {
  69358 		(*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_READER)
  69359 		return SQLITE_OK
  69360 	}
  69361 
  69362 	rc = pager_end_transaction(tls, pPager, int32((*Pager)(unsafe.Pointer(pPager)).FsetSuper), 1)
  69363 	return pager_error(tls, pPager, rc)
  69364 }
  69365 
  69366 // If a write transaction is open, then all changes made within the
  69367 // transaction are reverted and the current write-transaction is closed.
  69368 // The pager falls back to PAGER_READER state if successful, or PAGER_ERROR
  69369 // state if an error occurs.
  69370 //
  69371 // If the pager is already in PAGER_ERROR state when this function is called,
  69372 // it returns Pager.errCode immediately. No work is performed in this case.
  69373 //
  69374 // Otherwise, in rollback mode, this function performs two functions:
  69375 //
  69376 //  1. It rolls back the journal file, restoring all database file and
  69377 //     in-memory cache pages to the state they were in when the transaction
  69378 //     was opened, and
  69379 //
  69380 //  2. It finalizes the journal file, so that it is not used for hot
  69381 //     rollback at any point in the future.
  69382 //
  69383 // Finalization of the journal file (task 2) is only performed if the
  69384 // rollback is successful.
  69385 //
  69386 // In WAL mode, all cache-entries containing data modified within the
  69387 // current transaction are either expelled from the cache or reverted to
  69388 // their pre-transaction state by re-reading data from the database or
  69389 // WAL files. The WAL transaction is then closed.
  69390 func Xsqlite3PagerRollback(tls *libc.TLS, pPager uintptr) int32 {
  69391 	var rc int32 = SQLITE_OK
  69392 
  69393 	if int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_ERROR {
  69394 		return (*Pager)(unsafe.Pointer(pPager)).FerrCode
  69395 	}
  69396 	if int32((*Pager)(unsafe.Pointer(pPager)).FeState) <= PAGER_READER {
  69397 		return SQLITE_OK
  69398 	}
  69399 
  69400 	if (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) {
  69401 		var rc2 int32
  69402 		rc = Xsqlite3PagerSavepoint(tls, pPager, SAVEPOINT_ROLLBACK, -1)
  69403 		rc2 = pager_end_transaction(tls, pPager, int32((*Pager)(unsafe.Pointer(pPager)).FsetSuper), 0)
  69404 		if rc == SQLITE_OK {
  69405 			rc = rc2
  69406 		}
  69407 	} else if !((*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0)) || int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_WRITER_LOCKED {
  69408 		var eState int32 = int32((*Pager)(unsafe.Pointer(pPager)).FeState)
  69409 		rc = pager_end_transaction(tls, pPager, 0, 0)
  69410 		if !(int32((*Pager)(unsafe.Pointer(pPager)).FmemDb) != 0) && eState > PAGER_WRITER_LOCKED {
  69411 			(*Pager)(unsafe.Pointer(pPager)).FerrCode = SQLITE_ABORT
  69412 			(*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_ERROR)
  69413 			setGetterMethod(tls, pPager)
  69414 			return rc
  69415 		}
  69416 	} else {
  69417 		rc = pager_playback(tls, pPager, 0)
  69418 	}
  69419 
  69420 	return pager_error(tls, pPager, rc)
  69421 }
  69422 
  69423 // Return TRUE if the database file is opened read-only.  Return FALSE
  69424 // if the database is (in theory) writable.
  69425 func Xsqlite3PagerIsreadonly(tls *libc.TLS, pPager uintptr) U8 {
  69426 	return (*Pager)(unsafe.Pointer(pPager)).FreadOnly
  69427 }
  69428 
  69429 // Return the approximate number of bytes of memory currently
  69430 // used by the pager and its associated cache.
  69431 func Xsqlite3PagerMemUsed(tls *libc.TLS, pPager uintptr) int32 {
  69432 	var perPageSize int32 = int32((*Pager)(unsafe.Pointer(pPager)).FpageSize + I64((*Pager)(unsafe.Pointer(pPager)).FnExtra) +
  69433 		I64(int32(uint64(unsafe.Sizeof(PgHdr{}))+uint64(5)*uint64(unsafe.Sizeof(uintptr(0))))))
  69434 	return int32(I64(perPageSize*Xsqlite3PcachePagecount(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)+
  69435 		Xsqlite3MallocSize(tls, pPager)) +
  69436 		(*Pager)(unsafe.Pointer(pPager)).FpageSize)
  69437 }
  69438 
  69439 // Return the number of references to the specified page.
  69440 func Xsqlite3PagerPageRefcount(tls *libc.TLS, pPage uintptr) int32 {
  69441 	return int32(Xsqlite3PcachePageRefcount(tls, pPage))
  69442 }
  69443 
  69444 // Parameter eStat must be one of SQLITE_DBSTATUS_CACHE_HIT, _MISS, _WRITE,
  69445 // or _WRITE+1.  The SQLITE_DBSTATUS_CACHE_WRITE+1 case is a translation
  69446 // of SQLITE_DBSTATUS_CACHE_SPILL.  The _SPILL case is not contiguous because
  69447 // it was added later.
  69448 //
  69449 // Before returning, *pnVal is incremented by the
  69450 // current cache hit or miss count, according to the value of eStat. If the
  69451 // reset parameter is non-zero, the cache hit or miss count is zeroed before
  69452 // returning.
  69453 func Xsqlite3PagerCacheStat(tls *libc.TLS, pPager uintptr, eStat int32, reset int32, pnVal uintptr) {
  69454 	eStat = eStat - SQLITE_DBSTATUS_CACHE_HIT
  69455 	*(*int32)(unsafe.Pointer(pnVal)) += *(*int32)(unsafe.Pointer(pPager + 248 + uintptr(eStat)*4))
  69456 	if reset != 0 {
  69457 		*(*int32)(unsafe.Pointer(pPager + 248 + uintptr(eStat)*4)) = 0
  69458 	}
  69459 }
  69460 
  69461 // Return true if this is an in-memory or temp-file backed pager.
  69462 func Xsqlite3PagerIsMemdb(tls *libc.TLS, pPager uintptr) int32 {
  69463 	return libc.Bool32((*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 || (*Pager)(unsafe.Pointer(pPager)).FmemVfs != 0)
  69464 }
  69465 
  69466 func pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) int32 {
  69467 	var rc int32 = SQLITE_OK
  69468 	var nCurrent int32 = (*Pager)(unsafe.Pointer(pPager)).FnSavepoint
  69469 	var ii int32
  69470 	var aNew uintptr
  69471 
  69472 	aNew = Xsqlite3Realloc(tls,
  69473 		(*Pager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(unsafe.Sizeof(PagerSavepoint{}))*uint64(nSavepoint))
  69474 	if !(aNew != 0) {
  69475 		return SQLITE_NOMEM
  69476 	}
  69477 	libc.Xmemset(tls, aNew+uintptr(nCurrent)*56, 0, uint64(nSavepoint-nCurrent)*uint64(unsafe.Sizeof(PagerSavepoint{})))
  69478 	(*Pager)(unsafe.Pointer(pPager)).FaSavepoint = aNew
  69479 
  69480 	for ii = nCurrent; ii < nSavepoint; ii++ {
  69481 		(*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*56)).FnOrig = (*Pager)(unsafe.Pointer(pPager)).FdbSize
  69482 		if (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0) && (*Pager)(unsafe.Pointer(pPager)).FjournalOff > int64(0) {
  69483 			(*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*56)).FiOffset = (*Pager)(unsafe.Pointer(pPager)).FjournalOff
  69484 		} else {
  69485 			(*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*56)).FiOffset = I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize)
  69486 		}
  69487 		(*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*56)).FiSubRec = (*Pager)(unsafe.Pointer(pPager)).FnSubRec
  69488 		(*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*56)).FpInSavepoint = Xsqlite3BitvecCreate(tls, (*Pager)(unsafe.Pointer(pPager)).FdbSize)
  69489 		(*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*56)).FbTruncateOnRelease = 1
  69490 		if !(int32((*PagerSavepoint)(unsafe.Pointer(aNew+uintptr(ii)*56)).FpInSavepoint) != 0) {
  69491 			return SQLITE_NOMEM
  69492 		}
  69493 		if (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) {
  69494 			Xsqlite3WalSavepoint(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, aNew+uintptr(ii)*56+36)
  69495 		}
  69496 		(*Pager)(unsafe.Pointer(pPager)).FnSavepoint = ii + 1
  69497 	}
  69498 
  69499 	return rc
  69500 }
  69501 
  69502 func Xsqlite3PagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) int32 {
  69503 	if nSavepoint > (*Pager)(unsafe.Pointer(pPager)).FnSavepoint && (*Pager)(unsafe.Pointer(pPager)).FuseJournal != 0 {
  69504 		return pagerOpenSavepoint(tls, pPager, nSavepoint)
  69505 	} else {
  69506 		return SQLITE_OK
  69507 	}
  69508 	return int32(0)
  69509 }
  69510 
  69511 // This function is called to rollback or release (commit) a savepoint.
  69512 // The savepoint to release or rollback need not be the most recently
  69513 // created savepoint.
  69514 //
  69515 // Parameter op is always either SAVEPOINT_ROLLBACK or SAVEPOINT_RELEASE.
  69516 // If it is SAVEPOINT_RELEASE, then release and destroy the savepoint with
  69517 // index iSavepoint. If it is SAVEPOINT_ROLLBACK, then rollback all changes
  69518 // that have occurred since the specified savepoint was created.
  69519 //
  69520 // The savepoint to rollback or release is identified by parameter
  69521 // iSavepoint. A value of 0 means to operate on the outermost savepoint
  69522 // (the first created). A value of (Pager.nSavepoint-1) means operate
  69523 // on the most recently created savepoint. If iSavepoint is greater than
  69524 // (Pager.nSavepoint-1), then this function is a no-op.
  69525 //
  69526 // If a negative value is passed to this function, then the current
  69527 // transaction is rolled back. This is different to calling
  69528 // sqlite3PagerRollback() because this function does not terminate
  69529 // the transaction or unlock the database, it just restores the
  69530 // contents of the database to its original state.
  69531 //
  69532 // In any case, all savepoints with an index greater than iSavepoint
  69533 // are destroyed. If this is a release operation (op==SAVEPOINT_RELEASE),
  69534 // then savepoint iSavepoint is also destroyed.
  69535 //
  69536 // This function may return SQLITE_NOMEM if a memory allocation fails,
  69537 // or an IO error code if an IO error occurs while rolling back a
  69538 // savepoint. If no errors occur, SQLITE_OK is returned.
  69539 func Xsqlite3PagerSavepoint(tls *libc.TLS, pPager uintptr, op int32, iSavepoint int32) int32 {
  69540 	var rc int32 = (*Pager)(unsafe.Pointer(pPager)).FerrCode
  69541 
  69542 	if rc == SQLITE_OK && iSavepoint < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint {
  69543 		var ii int32
  69544 		var nNew int32
  69545 
  69546 		nNew = iSavepoint + func() int32 {
  69547 			if op == SAVEPOINT_RELEASE {
  69548 				return 0
  69549 			}
  69550 			return 1
  69551 		}()
  69552 		for ii = nNew; ii < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; ii++ {
  69553 			Xsqlite3BitvecDestroy(tls, (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint+uintptr(ii)*56)).FpInSavepoint)
  69554 		}
  69555 		(*Pager)(unsafe.Pointer(pPager)).FnSavepoint = nNew
  69556 
  69557 		if op == SAVEPOINT_RELEASE {
  69558 			var pRel uintptr = (*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(nNew)*56
  69559 			if (*PagerSavepoint)(unsafe.Pointer(pRel)).FbTruncateOnRelease != 0 && (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fsjfd)).FpMethods != uintptr(0) {
  69560 				if Xsqlite3JournalIsInMemory(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd) != 0 {
  69561 					var sz I64 = ((*Pager)(unsafe.Pointer(pPager)).FpageSize + int64(4)) * I64((*PagerSavepoint)(unsafe.Pointer(pRel)).FiSubRec)
  69562 					rc = Xsqlite3OsTruncate(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd, sz)
  69563 
  69564 				}
  69565 				(*Pager)(unsafe.Pointer(pPager)).FnSubRec = (*PagerSavepoint)(unsafe.Pointer(pRel)).FiSubRec
  69566 			}
  69567 		} else if (*Pager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) || (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0) {
  69568 			var pSavepoint uintptr
  69569 			if nNew == 0 {
  69570 				pSavepoint = uintptr(0)
  69571 			} else {
  69572 				pSavepoint = (*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(nNew-1)*56
  69573 			}
  69574 			rc = pagerPlaybackSavepoint(tls, pPager, pSavepoint)
  69575 
  69576 		}
  69577 
  69578 	}
  69579 
  69580 	return rc
  69581 }
  69582 
  69583 // Return the full pathname of the database file.
  69584 //
  69585 // Except, if the pager is in-memory only, then return an empty string if
  69586 // nullIfMemDb is true.  This routine is called with nullIfMemDb==1 when
  69587 // used to report the filename to the user, for compatibility with legacy
  69588 // behavior.  But when the Btree needs to know the filename for matching to
  69589 // shared cache, it uses nullIfMemDb==0 so that in-memory databases can
  69590 // participate in shared-cache.
  69591 //
  69592 // The return value to this routine is always safe to use with
  69593 // sqlite3_uri_parameter() and sqlite3_filename_database() and friends.
  69594 func Xsqlite3PagerFilename(tls *libc.TLS, pPager uintptr, nullIfMemDb int32) uintptr {
  69595 	if nullIfMemDb != 0 && ((*Pager)(unsafe.Pointer(pPager)).FmemDb != 0 || Xsqlite3IsMemdb(tls, (*Pager)(unsafe.Pointer(pPager)).FpVfs) != 0) {
  69596 		return uintptr(unsafe.Pointer(&zFake)) + 4
  69597 	} else {
  69598 		return (*Pager)(unsafe.Pointer(pPager)).FzFilename
  69599 	}
  69600 	return uintptr(0)
  69601 }
  69602 
  69603 var zFake = [8]int8{int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0)}
  69604 
  69605 // Return the VFS structure for the pager.
  69606 func Xsqlite3PagerVfs(tls *libc.TLS, pPager uintptr) uintptr {
  69607 	return (*Pager)(unsafe.Pointer(pPager)).FpVfs
  69608 }
  69609 
  69610 // Return the file handle for the database file associated
  69611 // with the pager.  This might return NULL if the file has
  69612 // not yet been opened.
  69613 func Xsqlite3PagerFile(tls *libc.TLS, pPager uintptr) uintptr {
  69614 	return (*Pager)(unsafe.Pointer(pPager)).Ffd
  69615 }
  69616 
  69617 // Return the file handle for the journal file (if it exists).
  69618 // This will be either the rollback journal or the WAL file.
  69619 func Xsqlite3PagerJrnlFile(tls *libc.TLS, pPager uintptr) uintptr {
  69620 	if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 {
  69621 		return Xsqlite3WalFile(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal)
  69622 	}
  69623 	return (*Pager)(unsafe.Pointer(pPager)).Fjfd
  69624 }
  69625 
  69626 // Return the full pathname of the journal file.
  69627 func Xsqlite3PagerJournalname(tls *libc.TLS, pPager uintptr) uintptr {
  69628 	return (*Pager)(unsafe.Pointer(pPager)).FzJournal
  69629 }
  69630 
  69631 // Move the page pPg to location pgno in the file.
  69632 //
  69633 // There must be no references to the page previously located at
  69634 // pgno (which we call pPgOld) though that page is allowed to be
  69635 // in cache.  If the page previously located at pgno is not already
  69636 // in the rollback journal, it is not put there by by this routine.
  69637 //
  69638 // References to the page pPg remain valid. Updating any
  69639 // meta-data associated with pPg (i.e. data stored in the nExtra bytes
  69640 // allocated along with the page) is the responsibility of the caller.
  69641 //
  69642 // A transaction must be active when this routine is called. It used to be
  69643 // required that a statement transaction was not active, but this restriction
  69644 // has been removed (CREATE INDEX needs to move a page when a statement
  69645 // transaction is active).
  69646 //
  69647 // If the fourth argument, isCommit, is non-zero, then this page is being
  69648 // moved as part of a database reorganization just before the transaction
  69649 // is being committed. In this case, it is guaranteed that the database page
  69650 // pPg refers to will not be written to again within this transaction.
  69651 //
  69652 // This function may return SQLITE_NOMEM or an IO error code if an error
  69653 // occurs. Otherwise, it returns SQLITE_OK.
  69654 func Xsqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno Pgno, isCommit int32) int32 {
  69655 	bp := tls.Alloc(8)
  69656 	defer tls.Free(8)
  69657 
  69658 	var pPgOld uintptr
  69659 	var needSyncPgno Pgno = Pgno(0)
  69660 	var rc int32
  69661 	var origPgno Pgno
  69662 
  69663 	if (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 {
  69664 		rc = Xsqlite3PagerWrite(tls, pPg)
  69665 		if rc != 0 {
  69666 			return rc
  69667 		}
  69668 	}
  69669 
  69670 	if int32((*DbPage)(unsafe.Pointer(pPg)).Fflags)&PGHDR_DIRTY != 0 &&
  69671 		SQLITE_OK != libc.AssignInt32(&rc, subjournalPageIfRequired(tls, pPg)) {
  69672 		return rc
  69673 	}
  69674 
  69675 	if int32((*DbPage)(unsafe.Pointer(pPg)).Fflags)&PGHDR_NEED_SYNC != 0 && !(isCommit != 0) {
  69676 		needSyncPgno = (*DbPage)(unsafe.Pointer(pPg)).Fpgno
  69677 
  69678 	}
  69679 
  69680 	*(*U16)(unsafe.Pointer(pPg + 52)) &= libc.Uint16FromInt32(libc.CplInt32(PGHDR_NEED_SYNC))
  69681 	pPgOld = Xsqlite3PagerLookup(tls, pPager, pgno)
  69682 
  69683 	if pPgOld != 0 {
  69684 		if (*PgHdr)(unsafe.Pointer(pPgOld)).FnRef > int64(1) {
  69685 			Xsqlite3PagerUnrefNotNull(tls, pPgOld)
  69686 			return Xsqlite3CorruptError(tls, 62627)
  69687 		}
  69688 		*(*U16)(unsafe.Pointer(pPg + 52)) |= U16(int32((*PgHdr)(unsafe.Pointer(pPgOld)).Fflags) & PGHDR_NEED_SYNC)
  69689 		if (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 {
  69690 			Xsqlite3PcacheMove(tls, pPgOld, (*Pager)(unsafe.Pointer(pPager)).FdbSize+Pgno(1))
  69691 		} else {
  69692 			Xsqlite3PcacheDrop(tls, pPgOld)
  69693 		}
  69694 	}
  69695 
  69696 	origPgno = (*DbPage)(unsafe.Pointer(pPg)).Fpgno
  69697 	Xsqlite3PcacheMove(tls, pPg, pgno)
  69698 	Xsqlite3PcacheMakeDirty(tls, pPg)
  69699 
  69700 	if (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 && pPgOld != 0 {
  69701 		Xsqlite3PcacheMove(tls, pPgOld, origPgno)
  69702 		Xsqlite3PagerUnrefNotNull(tls, pPgOld)
  69703 	}
  69704 
  69705 	if needSyncPgno != 0 {
  69706 		rc = Xsqlite3PagerGet(tls, pPager, needSyncPgno, bp, 0)
  69707 		if rc != SQLITE_OK {
  69708 			if needSyncPgno <= (*Pager)(unsafe.Pointer(pPager)).FdbOrigSize {
  69709 				Xsqlite3BitvecClear(tls, (*Pager)(unsafe.Pointer(pPager)).FpInJournal, needSyncPgno, (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace)
  69710 			}
  69711 			return rc
  69712 		}
  69713 		*(*U16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 52)) |= U16(PGHDR_NEED_SYNC)
  69714 		Xsqlite3PcacheMakeDirty(tls, *(*uintptr)(unsafe.Pointer(bp)))
  69715 		Xsqlite3PagerUnrefNotNull(tls, *(*uintptr)(unsafe.Pointer(bp)))
  69716 	}
  69717 
  69718 	return SQLITE_OK
  69719 }
  69720 
  69721 // The page handle passed as the first argument refers to a dirty page
  69722 // with a page number other than iNew. This function changes the page's
  69723 // page number to iNew and sets the value of the PgHdr.flags field to
  69724 // the value passed as the third parameter.
  69725 func Xsqlite3PagerRekey(tls *libc.TLS, pPg uintptr, iNew Pgno, flags U16) {
  69726 	(*DbPage)(unsafe.Pointer(pPg)).Fflags = flags
  69727 	Xsqlite3PcacheMove(tls, pPg, iNew)
  69728 }
  69729 
  69730 // Return a pointer to the data for the specified page.
  69731 func Xsqlite3PagerGetData(tls *libc.TLS, pPg uintptr) uintptr {
  69732 	return (*DbPage)(unsafe.Pointer(pPg)).FpData
  69733 }
  69734 
  69735 // Return a pointer to the Pager.nExtra bytes of "extra" space
  69736 // allocated along with the specified page.
  69737 func Xsqlite3PagerGetExtra(tls *libc.TLS, pPg uintptr) uintptr {
  69738 	return (*DbPage)(unsafe.Pointer(pPg)).FpExtra
  69739 }
  69740 
  69741 // Get/set the locking-mode for this pager. Parameter eMode must be one
  69742 // of PAGER_LOCKINGMODE_QUERY, PAGER_LOCKINGMODE_NORMAL or
  69743 // PAGER_LOCKINGMODE_EXCLUSIVE. If the parameter is not _QUERY, then
  69744 // the locking-mode is set to the value specified.
  69745 //
  69746 // The returned value is either PAGER_LOCKINGMODE_NORMAL or
  69747 // PAGER_LOCKINGMODE_EXCLUSIVE, indicating the current (possibly updated)
  69748 // locking-mode.
  69749 func Xsqlite3PagerLockingMode(tls *libc.TLS, pPager uintptr, eMode int32) int32 {
  69750 	if eMode >= 0 && !(int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) != 0) && !(Xsqlite3WalHeapMemory(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal) != 0) {
  69751 		(*Pager)(unsafe.Pointer(pPager)).FexclusiveMode = U8(eMode)
  69752 	}
  69753 	return int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode)
  69754 }
  69755 
  69756 // Set the journal-mode for this pager. Parameter eMode must be one of:
  69757 //
  69758 //	PAGER_JOURNALMODE_DELETE
  69759 //	PAGER_JOURNALMODE_TRUNCATE
  69760 //	PAGER_JOURNALMODE_PERSIST
  69761 //	PAGER_JOURNALMODE_OFF
  69762 //	PAGER_JOURNALMODE_MEMORY
  69763 //	PAGER_JOURNALMODE_WAL
  69764 //
  69765 // The journalmode is set to the value specified if the change is allowed.
  69766 // The change may be disallowed for the following reasons:
  69767 //
  69768 //   - An in-memory database can only have its journal_mode set to _OFF
  69769 //     or _MEMORY.
  69770 //
  69771 //   - Temporary databases cannot have _WAL journalmode.
  69772 //
  69773 // The returned indicate the current (possibly updated) journal-mode.
  69774 func Xsqlite3PagerSetJournalMode(tls *libc.TLS, pPager uintptr, eMode int32) int32 {
  69775 	var eOld U8 = (*Pager)(unsafe.Pointer(pPager)).FjournalMode
  69776 
  69777 	if (*Pager)(unsafe.Pointer(pPager)).FmemDb != 0 {
  69778 		if eMode != PAGER_JOURNALMODE_MEMORY && eMode != PAGER_JOURNALMODE_OFF {
  69779 			eMode = int32(eOld)
  69780 		}
  69781 	}
  69782 
  69783 	if eMode != int32(eOld) {
  69784 		(*Pager)(unsafe.Pointer(pPager)).FjournalMode = U8(eMode)
  69785 
  69786 		if !(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0) && int32(eOld)&5 == 1 && eMode&1 == 0 {
  69787 			Xsqlite3OsClose(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd)
  69788 			if int32((*Pager)(unsafe.Pointer(pPager)).FeLock) >= RESERVED_LOCK {
  69789 				Xsqlite3OsDelete(tls, (*Pager)(unsafe.Pointer(pPager)).FpVfs, (*Pager)(unsafe.Pointer(pPager)).FzJournal, 0)
  69790 			} else {
  69791 				var rc int32 = SQLITE_OK
  69792 				var state int32 = int32((*Pager)(unsafe.Pointer(pPager)).FeState)
  69793 
  69794 				if state == PAGER_OPEN {
  69795 					rc = Xsqlite3PagerSharedLock(tls, pPager)
  69796 				}
  69797 				if int32((*Pager)(unsafe.Pointer(pPager)).FeState) == PAGER_READER {
  69798 					rc = pagerLockDb(tls, pPager, RESERVED_LOCK)
  69799 				}
  69800 				if rc == SQLITE_OK {
  69801 					Xsqlite3OsDelete(tls, (*Pager)(unsafe.Pointer(pPager)).FpVfs, (*Pager)(unsafe.Pointer(pPager)).FzJournal, 0)
  69802 				}
  69803 				if rc == SQLITE_OK && state == PAGER_READER {
  69804 					pagerUnlockDb(tls, pPager, SHARED_LOCK)
  69805 				} else if state == PAGER_OPEN {
  69806 					pager_unlock(tls, pPager)
  69807 				}
  69808 
  69809 			}
  69810 		} else if eMode == PAGER_JOURNALMODE_OFF {
  69811 			Xsqlite3OsClose(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd)
  69812 		}
  69813 	}
  69814 
  69815 	return int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode)
  69816 }
  69817 
  69818 // Return the current journal mode.
  69819 func Xsqlite3PagerGetJournalMode(tls *libc.TLS, pPager uintptr) int32 {
  69820 	return int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode)
  69821 }
  69822 
  69823 // Return TRUE if the pager is in a state where it is OK to change the
  69824 // journalmode.  Journalmode changes can only happen when the database
  69825 // is unmodified.
  69826 func Xsqlite3PagerOkToChangeJournalMode(tls *libc.TLS, pPager uintptr) int32 {
  69827 	if int32((*Pager)(unsafe.Pointer(pPager)).FeState) >= PAGER_WRITER_CACHEMOD {
  69828 		return 0
  69829 	}
  69830 	if (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Fjfd)).FpMethods != uintptr(0) && (*Pager)(unsafe.Pointer(pPager)).FjournalOff > int64(0) {
  69831 		return 0
  69832 	}
  69833 	return 1
  69834 }
  69835 
  69836 // Get/set the size-limit used for persistent journal files.
  69837 //
  69838 // Setting the size limit to -1 means no limit is enforced.
  69839 // An attempt to set a limit smaller than -1 is a no-op.
  69840 func Xsqlite3PagerJournalSizeLimit(tls *libc.TLS, pPager uintptr, iLimit I64) I64 {
  69841 	if iLimit >= int64(-1) {
  69842 		(*Pager)(unsafe.Pointer(pPager)).FjournalSizeLimit = iLimit
  69843 		Xsqlite3WalLimit(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, iLimit)
  69844 	}
  69845 	return (*Pager)(unsafe.Pointer(pPager)).FjournalSizeLimit
  69846 }
  69847 
  69848 // Return a pointer to the pPager->pBackup variable. The backup module
  69849 // in backup.c maintains the content of this variable. This module
  69850 // uses it opaquely as an argument to sqlite3BackupRestart() and
  69851 // sqlite3BackupUpdate() only.
  69852 func Xsqlite3PagerBackupPtr(tls *libc.TLS, pPager uintptr) uintptr {
  69853 	return pPager + 112
  69854 }
  69855 
  69856 // Unless this is an in-memory or temporary database, clear the pager cache.
  69857 func Xsqlite3PagerClearCache(tls *libc.TLS, pPager uintptr) {
  69858 	if int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) == 0 {
  69859 		pager_reset(tls, pPager)
  69860 	}
  69861 }
  69862 
  69863 // This function is called when the user invokes "PRAGMA wal_checkpoint",
  69864 // "PRAGMA wal_blocking_checkpoint" or calls the sqlite3_wal_checkpoint()
  69865 // or wal_blocking_checkpoint() API functions.
  69866 //
  69867 // Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART.
  69868 func Xsqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 {
  69869 	var rc int32 = SQLITE_OK
  69870 	if (*Pager)(unsafe.Pointer(pPager)).FpWal == uintptr(0) && int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_WAL {
  69871 		Xsqlite3_exec(tls, db, ts+5304, uintptr(0), uintptr(0), uintptr(0))
  69872 	}
  69873 	if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 {
  69874 		rc = Xsqlite3WalCheckpoint(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, db, eMode,
  69875 			func() uintptr {
  69876 				if eMode == SQLITE_CHECKPOINT_PASSIVE {
  69877 					return uintptr(0)
  69878 				}
  69879 				return (*Pager)(unsafe.Pointer(pPager)).FxBusyHandler
  69880 			}(),
  69881 			(*Pager)(unsafe.Pointer(pPager)).FpBusyHandlerArg,
  69882 			int32((*Pager)(unsafe.Pointer(pPager)).FwalSyncFlags), int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace,
  69883 			pnLog, pnCkpt)
  69884 	}
  69885 	return rc
  69886 }
  69887 
  69888 func Xsqlite3PagerWalCallback(tls *libc.TLS, pPager uintptr) int32 {
  69889 	return Xsqlite3WalCallback(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal)
  69890 }
  69891 
  69892 // Return true if the underlying VFS for the given pager supports the
  69893 // primitives necessary for write-ahead logging.
  69894 func Xsqlite3PagerWalSupported(tls *libc.TLS, pPager uintptr) int32 {
  69895 	var pMethods uintptr = (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods
  69896 	if (*Pager)(unsafe.Pointer(pPager)).FnoLock != 0 {
  69897 		return 0
  69898 	}
  69899 	return libc.Bool32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode != 0 || (*Sqlite3_io_methods)(unsafe.Pointer(pMethods)).FiVersion >= 2 && (*Sqlite3_io_methods)(unsafe.Pointer(pMethods)).FxShmMap != 0)
  69900 }
  69901 
  69902 func pagerExclusiveLock(tls *libc.TLS, pPager uintptr) int32 {
  69903 	var rc int32
  69904 
  69905 	rc = pagerLockDb(tls, pPager, EXCLUSIVE_LOCK)
  69906 	if rc != SQLITE_OK {
  69907 		pagerUnlockDb(tls, pPager, SHARED_LOCK)
  69908 	}
  69909 
  69910 	return rc
  69911 }
  69912 
  69913 func pagerOpenWal(tls *libc.TLS, pPager uintptr) int32 {
  69914 	var rc int32 = SQLITE_OK
  69915 
  69916 	if (*Pager)(unsafe.Pointer(pPager)).FexclusiveMode != 0 {
  69917 		rc = pagerExclusiveLock(tls, pPager)
  69918 	}
  69919 
  69920 	if rc == SQLITE_OK {
  69921 		rc = Xsqlite3WalOpen(tls, (*Pager)(unsafe.Pointer(pPager)).FpVfs,
  69922 			(*Pager)(unsafe.Pointer(pPager)).Ffd, (*Pager)(unsafe.Pointer(pPager)).FzWal, int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode),
  69923 			(*Pager)(unsafe.Pointer(pPager)).FjournalSizeLimit, pPager+296)
  69924 	}
  69925 	pagerFixMaplimit(tls, pPager)
  69926 
  69927 	return rc
  69928 }
  69929 
  69930 // The caller must be holding a SHARED lock on the database file to call
  69931 // this function.
  69932 //
  69933 // If the pager passed as the first argument is open on a real database
  69934 // file (not a temp file or an in-memory database), and the WAL file
  69935 // is not already open, make an attempt to open it now. If successful,
  69936 // return SQLITE_OK. If an error occurs or the VFS used by the pager does
  69937 // not support the xShmXXX() methods, return an error code. *pbOpen is
  69938 // not modified in either case.
  69939 //
  69940 // If the pager is open on a temp-file (or in-memory database), or if
  69941 // the WAL file is already open, set *pbOpen to 1 and return SQLITE_OK
  69942 // without doing anything.
  69943 func Xsqlite3PagerOpenWal(tls *libc.TLS, pPager uintptr, pbOpen uintptr) int32 {
  69944 	var rc int32 = SQLITE_OK
  69945 
  69946 	if !(int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) != 0) && !(int32((*Pager)(unsafe.Pointer(pPager)).FpWal) != 0) {
  69947 		if !(Xsqlite3PagerWalSupported(tls, pPager) != 0) {
  69948 			return SQLITE_CANTOPEN
  69949 		}
  69950 
  69951 		Xsqlite3OsClose(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd)
  69952 
  69953 		rc = pagerOpenWal(tls, pPager)
  69954 		if rc == SQLITE_OK {
  69955 			(*Pager)(unsafe.Pointer(pPager)).FjournalMode = U8(PAGER_JOURNALMODE_WAL)
  69956 			(*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN)
  69957 		}
  69958 	} else {
  69959 		*(*int32)(unsafe.Pointer(pbOpen)) = 1
  69960 	}
  69961 
  69962 	return rc
  69963 }
  69964 
  69965 // This function is called to close the connection to the log file prior
  69966 // to switching from WAL to rollback mode.
  69967 //
  69968 // Before closing the log file, this function attempts to take an
  69969 // EXCLUSIVE lock on the database file. If this cannot be obtained, an
  69970 // error (SQLITE_BUSY) is returned and the log connection is not closed.
  69971 // If successful, the EXCLUSIVE lock is not released before returning.
  69972 func Xsqlite3PagerCloseWal(tls *libc.TLS, pPager uintptr, db uintptr) int32 {
  69973 	bp := tls.Alloc(4)
  69974 	defer tls.Free(4)
  69975 
  69976 	var rc int32 = SQLITE_OK
  69977 
  69978 	if !(int32((*Pager)(unsafe.Pointer(pPager)).FpWal) != 0) {
  69979 		*(*int32)(unsafe.Pointer(bp)) = 0
  69980 		rc = pagerLockDb(tls, pPager, SHARED_LOCK)
  69981 		if rc == SQLITE_OK {
  69982 			rc = Xsqlite3OsAccess(tls,
  69983 				(*Pager)(unsafe.Pointer(pPager)).FpVfs, (*Pager)(unsafe.Pointer(pPager)).FzWal, SQLITE_ACCESS_EXISTS, bp)
  69984 		}
  69985 		if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp)) != 0 {
  69986 			rc = pagerOpenWal(tls, pPager)
  69987 		}
  69988 	}
  69989 
  69990 	if rc == SQLITE_OK && (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 {
  69991 		rc = pagerExclusiveLock(tls, pPager)
  69992 		if rc == SQLITE_OK {
  69993 			rc = Xsqlite3WalClose(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, db, int32((*Pager)(unsafe.Pointer(pPager)).FwalSyncFlags),
  69994 				int32((*Pager)(unsafe.Pointer(pPager)).FpageSize), (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace)
  69995 			(*Pager)(unsafe.Pointer(pPager)).FpWal = uintptr(0)
  69996 			pagerFixMaplimit(tls, pPager)
  69997 			if rc != 0 && !(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0) {
  69998 				pagerUnlockDb(tls, pPager, SHARED_LOCK)
  69999 			}
  70000 		}
  70001 	}
  70002 	return rc
  70003 }
  70004 
  70005 // If this is a WAL database, obtain a snapshot handle for the snapshot
  70006 // currently open. Otherwise, return an error.
  70007 func Xsqlite3PagerSnapshotGet(tls *libc.TLS, pPager uintptr, ppSnapshot uintptr) int32 {
  70008 	var rc int32 = SQLITE_ERROR
  70009 	if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 {
  70010 		rc = Xsqlite3WalSnapshotGet(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, ppSnapshot)
  70011 	}
  70012 	return rc
  70013 }
  70014 
  70015 // If this is a WAL database, store a pointer to pSnapshot. Next time a
  70016 // read transaction is opened, attempt to read from the snapshot it
  70017 // identifies. If this is not a WAL database, return an error.
  70018 func Xsqlite3PagerSnapshotOpen(tls *libc.TLS, pPager uintptr, pSnapshot uintptr) int32 {
  70019 	var rc int32 = SQLITE_OK
  70020 	if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 {
  70021 		Xsqlite3WalSnapshotOpen(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, pSnapshot)
  70022 	} else {
  70023 		rc = SQLITE_ERROR
  70024 	}
  70025 	return rc
  70026 }
  70027 
  70028 // If this is a WAL database, call sqlite3WalSnapshotRecover(). If this
  70029 // is not a WAL database, return an error.
  70030 func Xsqlite3PagerSnapshotRecover(tls *libc.TLS, pPager uintptr) int32 {
  70031 	var rc int32
  70032 	if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 {
  70033 		rc = Xsqlite3WalSnapshotRecover(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal)
  70034 	} else {
  70035 		rc = SQLITE_ERROR
  70036 	}
  70037 	return rc
  70038 }
  70039 
  70040 // The caller currently has a read transaction open on the database.
  70041 // If this is not a WAL database, SQLITE_ERROR is returned. Otherwise,
  70042 // this function takes a SHARED lock on the CHECKPOINTER slot and then
  70043 // checks if the snapshot passed as the second argument is still
  70044 // available. If so, SQLITE_OK is returned.
  70045 //
  70046 // If the snapshot is not available, SQLITE_ERROR is returned. Or, if
  70047 // the CHECKPOINTER lock cannot be obtained, SQLITE_BUSY. If any error
  70048 // occurs (any value other than SQLITE_OK is returned), the CHECKPOINTER
  70049 // lock is released before returning.
  70050 func Xsqlite3PagerSnapshotCheck(tls *libc.TLS, pPager uintptr, pSnapshot uintptr) int32 {
  70051 	var rc int32
  70052 	if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 {
  70053 		rc = Xsqlite3WalSnapshotCheck(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, pSnapshot)
  70054 	} else {
  70055 		rc = SQLITE_ERROR
  70056 	}
  70057 	return rc
  70058 }
  70059 
  70060 // Release a lock obtained by an earlier successful call to
  70061 // sqlite3PagerSnapshotCheck().
  70062 func Xsqlite3PagerSnapshotUnlock(tls *libc.TLS, pPager uintptr) {
  70063 	Xsqlite3WalSnapshotUnlock(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal)
  70064 }
  70065 
  70066 // Object declarations
  70067 type WalIndexHdr1 = struct {
  70068 	FiVersion    U32
  70069 	Funused      U32
  70070 	FiChange     U32
  70071 	FisInit      U8
  70072 	FbigEndCksum U8
  70073 	FszPage      U16
  70074 	FmxFrame     U32
  70075 	FnPage       U32
  70076 	FaFrameCksum [2]U32
  70077 	FaSalt       [2]U32
  70078 	FaCksum      [2]U32
  70079 }
  70080 
  70081 // Object declarations
  70082 type WalIndexHdr = WalIndexHdr1
  70083 type WalIterator1 = struct {
  70084 	FiPrior   U32
  70085 	FnSegment int32
  70086 	FaSegment [1]struct {
  70087 		FiNext       int32
  70088 		F__ccgo_pad1 [4]byte
  70089 		FaIndex      uintptr
  70090 		FaPgno       uintptr
  70091 		FnEntry      int32
  70092 		FiZero       int32
  70093 	}
  70094 }
  70095 
  70096 type WalIterator = WalIterator1
  70097 type WalCkptInfo1 = struct {
  70098 	FnBackfill          U32
  70099 	FaReadMark          [5]U32
  70100 	FaLock              [8]U8
  70101 	FnBackfillAttempted U32
  70102 	FnotUsed0           U32
  70103 }
  70104 
  70105 type WalCkptInfo = WalCkptInfo1
  70106 
  70107 // Each page of the wal-index mapping contains a hash-table made up of
  70108 // an array of HASHTABLE_NSLOT elements of the following type.
  70109 type Ht_slot = U16
  70110 
  70111 // This structure is used to implement an iterator that loops through
  70112 // all frames in the WAL in database page order. Where two or more frames
  70113 // correspond to the same database page, the iterator visits only the
  70114 // frame most recently written to the WAL (in other words, the frame with
  70115 // the largest index).
  70116 //
  70117 // The internals of this structure are only accessed by:
  70118 //
  70119 //	walIteratorInit() - Create a new iterator,
  70120 //	walIteratorNext() - Step an iterator,
  70121 //	walIteratorFree() - Free an iterator.
  70122 //
  70123 // This functionality is used by the checkpoint code (see walCheckpoint()).
  70124 type WalSegment = struct {
  70125 	FiNext       int32
  70126 	F__ccgo_pad1 [4]byte
  70127 	FaIndex      uintptr
  70128 	FaPgno       uintptr
  70129 	FnEntry      int32
  70130 	FiZero       int32
  70131 }
  70132 
  70133 func walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintptr) int32 {
  70134 	var rc int32 = SQLITE_OK
  70135 
  70136 	if (*Wal)(unsafe.Pointer(pWal)).FnWiData <= iPage {
  70137 		var nByte Sqlite3_int64 = Sqlite3_int64(uint64(unsafe.Sizeof(uintptr(0))) * uint64(iPage+1))
  70138 		var apNew uintptr
  70139 		libc.AtomicStoreUintptr(&apNew, Xsqlite3Realloc(tls, (*Wal)(unsafe.Pointer(pWal)).FapWiData, uint64(nByte)))
  70140 		if !(apNew != 0) {
  70141 			*(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0)
  70142 			return SQLITE_NOMEM
  70143 		}
  70144 		libc.Xmemset(tls, apNew+uintptr((*Wal)(unsafe.Pointer(pWal)).FnWiData)*8, 0,
  70145 			uint64(unsafe.Sizeof(uintptr(0)))*uint64(iPage+1-(*Wal)(unsafe.Pointer(pWal)).FnWiData))
  70146 		(*Wal)(unsafe.Pointer(pWal)).FapWiData = apNew
  70147 		(*Wal)(unsafe.Pointer(pWal)).FnWiData = iPage + 1
  70148 	}
  70149 
  70150 	if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_HEAPMEMORY_MODE {
  70151 		*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(Ht_slot(0)))*uint64(HASHTABLE_NPAGE*2)+uint64(HASHTABLE_NPAGE)*uint64(unsafe.Sizeof(U32(0))))
  70152 		if !(int32(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8))) != 0) {
  70153 			rc = SQLITE_NOMEM
  70154 		}
  70155 	} else {
  70156 		rc = Xsqlite3OsShmMap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, iPage, int32(uint64(unsafe.Sizeof(Ht_slot(0)))*uint64(HASHTABLE_NPAGE*2)+uint64(HASHTABLE_NPAGE)*uint64(unsafe.Sizeof(U32(0)))),
  70157 			int32((*Wal)(unsafe.Pointer(pWal)).FwriteLock), (*Wal)(unsafe.Pointer(pWal)).FapWiData+uintptr(iPage)*8)
  70158 
  70159 		if rc == SQLITE_OK {
  70160 			if iPage > 0 && Xsqlite3FaultSim(tls, 600) != 0 {
  70161 				rc = SQLITE_NOMEM
  70162 			}
  70163 		} else if rc&0xff == SQLITE_READONLY {
  70164 			*(*U8)(unsafe.Pointer(pWal + 66)) |= U8(WAL_SHM_RDONLY)
  70165 			if rc == SQLITE_READONLY {
  70166 				rc = SQLITE_OK
  70167 			}
  70168 		}
  70169 	}
  70170 
  70171 	*(*uintptr)(unsafe.Pointer(ppPage)) = *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8))
  70172 
  70173 	return rc
  70174 }
  70175 
  70176 func walIndexPage(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintptr) int32 {
  70177 	if (*Wal)(unsafe.Pointer(pWal)).FnWiData <= iPage || libc.AssignPtrUintptr(ppPage, *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8))) == uintptr(0) {
  70178 		return walIndexPageRealloc(tls, pWal, iPage, ppPage)
  70179 	}
  70180 	return SQLITE_OK
  70181 }
  70182 
  70183 func walCkptInfo(tls *libc.TLS, pWal uintptr) uintptr {
  70184 	return *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData)) + 24*4
  70185 }
  70186 
  70187 func walIndexHdr(tls *libc.TLS, pWal uintptr) uintptr {
  70188 	return *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData))
  70189 }
  70190 
  70191 func walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, aIn uintptr, aOut uintptr) {
  70192 	var s1 U32
  70193 	var s2 U32
  70194 	var aData uintptr = a
  70195 	var aEnd uintptr = a + uintptr(nByte)
  70196 
  70197 	if aIn != 0 {
  70198 		s1 = *(*U32)(unsafe.Pointer(aIn))
  70199 		s2 = *(*U32)(unsafe.Pointer(aIn + 1*4))
  70200 	} else {
  70201 		s1 = libc.AssignUint32(&s2, U32(0))
  70202 	}
  70203 
  70204 	if nativeCksum != 0 {
  70205 		for __ccgo := true; __ccgo; __ccgo = aData < aEnd {
  70206 			s1 = s1 + (*(*U32)(unsafe.Pointer(libc.PostIncUintptr(&aData, 4))) + s2)
  70207 			s2 = s2 + (*(*U32)(unsafe.Pointer(libc.PostIncUintptr(&aData, 4))) + s1)
  70208 		}
  70209 	} else {
  70210 		for __ccgo1 := true; __ccgo1; __ccgo1 = aData < aEnd {
  70211 			s1 = s1 + (*(*U32)(unsafe.Pointer(aData))&U32(0x000000FF)<<24 + *(*U32)(unsafe.Pointer(aData))&U32(0x0000FF00)<<8 + *(*U32)(unsafe.Pointer(aData))&U32(0x00FF0000)>>8 + *(*U32)(unsafe.Pointer(aData))&0xFF000000>>24 + s2)
  70212 			s2 = s2 + (*(*U32)(unsafe.Pointer(aData + 1*4))&U32(0x000000FF)<<24 + *(*U32)(unsafe.Pointer(aData + 1*4))&U32(0x0000FF00)<<8 + *(*U32)(unsafe.Pointer(aData + 1*4))&U32(0x00FF0000)>>8 + *(*U32)(unsafe.Pointer(aData + 1*4))&0xFF000000>>24 + s1)
  70213 			aData += 4 * uintptr(2)
  70214 		}
  70215 	}
  70216 
  70217 	*(*U32)(unsafe.Pointer(aOut)) = s1
  70218 	*(*U32)(unsafe.Pointer(aOut + 1*4)) = s2
  70219 }
  70220 
  70221 func walShmBarrier(tls *libc.TLS, pWal uintptr) {
  70222 	if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) != WAL_HEAPMEMORY_MODE {
  70223 		Xsqlite3OsShmBarrier(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd)
  70224 	}
  70225 }
  70226 
  70227 func walIndexWriteHdr(tls *libc.TLS, pWal uintptr) {
  70228 	var aHdr uintptr = walIndexHdr(tls, pWal)
  70229 	var nCksum int32 = int32(uintptr(0) + 40)
  70230 
  70231 	(*Wal)(unsafe.Pointer(pWal)).Fhdr.FisInit = U8(1)
  70232 	(*Wal)(unsafe.Pointer(pWal)).Fhdr.FiVersion = U32(WALINDEX_MAX_VERSION)
  70233 	walChecksumBytes(tls, 1, pWal+72, nCksum, uintptr(0), pWal+72+40)
  70234 
  70235 	libc.Xmemcpy(tls, aHdr+1*48, pWal+72, uint64(unsafe.Sizeof(WalIndexHdr{})))
  70236 	walShmBarrier(tls, pWal)
  70237 	libc.Xmemcpy(tls, aHdr, pWal+72, uint64(unsafe.Sizeof(WalIndexHdr{})))
  70238 }
  70239 
  70240 func walEncodeFrame(tls *libc.TLS, pWal uintptr, iPage U32, nTruncate U32, aData uintptr, aFrame uintptr) {
  70241 	var nativeCksum int32
  70242 	var aCksum uintptr = pWal + 72 + 24
  70243 
  70244 	Xsqlite3Put4byte(tls, aFrame, iPage)
  70245 	Xsqlite3Put4byte(tls, aFrame+4, nTruncate)
  70246 	if (*Wal)(unsafe.Pointer(pWal)).FiReCksum == U32(0) {
  70247 		libc.Xmemcpy(tls, aFrame+8, pWal+72+32, uint64(8))
  70248 
  70249 		nativeCksum = libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum) == SQLITE_BIGENDIAN)
  70250 		walChecksumBytes(tls, nativeCksum, aFrame, 8, aCksum, aCksum)
  70251 		walChecksumBytes(tls, nativeCksum, aData, int32((*Wal)(unsafe.Pointer(pWal)).FszPage), aCksum, aCksum)
  70252 
  70253 		Xsqlite3Put4byte(tls, aFrame+16, *(*U32)(unsafe.Pointer(aCksum)))
  70254 		Xsqlite3Put4byte(tls, aFrame+20, *(*U32)(unsafe.Pointer(aCksum + 1*4)))
  70255 	} else {
  70256 		libc.Xmemset(tls, aFrame+8, 0, uint64(16))
  70257 	}
  70258 }
  70259 
  70260 func walDecodeFrame(tls *libc.TLS, pWal uintptr, piPage uintptr, pnTruncate uintptr, aData uintptr, aFrame uintptr) int32 {
  70261 	var nativeCksum int32
  70262 	var aCksum uintptr = pWal + 72 + 24
  70263 	var pgno U32
  70264 
  70265 	if libc.Xmemcmp(tls, pWal+72+32, aFrame+8, uint64(8)) != 0 {
  70266 		return 0
  70267 	}
  70268 
  70269 	pgno = Xsqlite3Get4byte(tls, aFrame)
  70270 	if pgno == U32(0) {
  70271 		return 0
  70272 	}
  70273 
  70274 	nativeCksum = libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum) == SQLITE_BIGENDIAN)
  70275 	walChecksumBytes(tls, nativeCksum, aFrame, 8, aCksum, aCksum)
  70276 	walChecksumBytes(tls, nativeCksum, aData, int32((*Wal)(unsafe.Pointer(pWal)).FszPage), aCksum, aCksum)
  70277 	if *(*U32)(unsafe.Pointer(aCksum)) != Xsqlite3Get4byte(tls, aFrame+16) ||
  70278 		*(*U32)(unsafe.Pointer(aCksum + 1*4)) != Xsqlite3Get4byte(tls, aFrame+20) {
  70279 		return 0
  70280 	}
  70281 
  70282 	*(*U32)(unsafe.Pointer(piPage)) = pgno
  70283 	*(*U32)(unsafe.Pointer(pnTruncate)) = Xsqlite3Get4byte(tls, aFrame+4)
  70284 	return 1
  70285 }
  70286 
  70287 func walLockShared(tls *libc.TLS, pWal uintptr, lockIdx int32) int32 {
  70288 	var rc int32
  70289 	if (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode != 0 {
  70290 		return SQLITE_OK
  70291 	}
  70292 	rc = Xsqlite3OsShmLock(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, lockIdx, 1,
  70293 		SQLITE_SHM_LOCK|SQLITE_SHM_SHARED)
  70294 
  70295 	return rc
  70296 }
  70297 
  70298 func walUnlockShared(tls *libc.TLS, pWal uintptr, lockIdx int32) {
  70299 	if (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode != 0 {
  70300 		return
  70301 	}
  70302 	Xsqlite3OsShmLock(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, lockIdx, 1,
  70303 		SQLITE_SHM_UNLOCK|SQLITE_SHM_SHARED)
  70304 
  70305 }
  70306 
  70307 func walLockExclusive(tls *libc.TLS, pWal uintptr, lockIdx int32, n int32) int32 {
  70308 	var rc int32
  70309 	if (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode != 0 {
  70310 		return SQLITE_OK
  70311 	}
  70312 	rc = Xsqlite3OsShmLock(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, lockIdx, n,
  70313 		SQLITE_SHM_LOCK|SQLITE_SHM_EXCLUSIVE)
  70314 
  70315 	return rc
  70316 }
  70317 
  70318 func walUnlockExclusive(tls *libc.TLS, pWal uintptr, lockIdx int32, n int32) {
  70319 	if (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode != 0 {
  70320 		return
  70321 	}
  70322 	Xsqlite3OsShmLock(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, lockIdx, n,
  70323 		SQLITE_SHM_UNLOCK|SQLITE_SHM_EXCLUSIVE)
  70324 
  70325 }
  70326 
  70327 func walHash(tls *libc.TLS, iPage U32) int32 {
  70328 	return int32(iPage * U32(HASHTABLE_HASH_1) & U32(HASHTABLE_NPAGE*2-1))
  70329 }
  70330 
  70331 func walNextHash(tls *libc.TLS, iPriorHash int32) int32 {
  70332 	return (iPriorHash + 1) & (HASHTABLE_NPAGE*2 - 1)
  70333 }
  70334 
  70335 // An instance of the WalHashLoc object is used to describe the location
  70336 // of a page hash table in the wal-index.  This becomes the return value
  70337 // from walHashGet().
  70338 type WalHashLoc1 = struct {
  70339 	FaHash       uintptr
  70340 	FaPgno       uintptr
  70341 	FiZero       U32
  70342 	F__ccgo_pad1 [4]byte
  70343 }
  70344 
  70345 // An instance of the WalHashLoc object is used to describe the location
  70346 // of a page hash table in the wal-index.  This becomes the return value
  70347 // from walHashGet().
  70348 type WalHashLoc = WalHashLoc1
  70349 
  70350 func walHashGet(tls *libc.TLS, pWal uintptr, iHash int32, pLoc uintptr) int32 {
  70351 	var rc int32
  70352 
  70353 	rc = walIndexPage(tls, pWal, iHash, pLoc+8)
  70354 
  70355 	if (*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno != 0 {
  70356 		(*WalHashLoc)(unsafe.Pointer(pLoc)).FaHash = (*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno + 4096*4
  70357 		if iHash == 0 {
  70358 			(*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno = (*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno + 34*4
  70359 			(*WalHashLoc)(unsafe.Pointer(pLoc)).FiZero = U32(0)
  70360 		} else {
  70361 			(*WalHashLoc)(unsafe.Pointer(pLoc)).FiZero = U32(uint64(HASHTABLE_NPAGE) - (uint64(unsafe.Sizeof(WalIndexHdr{}))*uint64(2)+uint64(unsafe.Sizeof(WalCkptInfo{})))/uint64(unsafe.Sizeof(U32(0))) + uint64((iHash-1)*HASHTABLE_NPAGE))
  70362 		}
  70363 	} else if rc == SQLITE_OK {
  70364 		rc = SQLITE_ERROR
  70365 	}
  70366 	return rc
  70367 }
  70368 
  70369 func walFramePage(tls *libc.TLS, iFrame U32) int32 {
  70370 	var iHash int32 = int32((uint64(iFrame+U32(HASHTABLE_NPAGE)) - (uint64(HASHTABLE_NPAGE) - (uint64(unsafe.Sizeof(WalIndexHdr{}))*uint64(2)+uint64(unsafe.Sizeof(WalCkptInfo{})))/uint64(unsafe.Sizeof(U32(0)))) - uint64(1)) / uint64(HASHTABLE_NPAGE))
  70371 
  70372 	return iHash
  70373 }
  70374 
  70375 func walFramePgno(tls *libc.TLS, pWal uintptr, iFrame U32) U32 {
  70376 	var iHash int32 = walFramePage(tls, iFrame)
  70377 	if iHash == 0 {
  70378 		return *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData)) + uintptr((uint64(unsafe.Sizeof(WalIndexHdr{}))*uint64(2)+uint64(unsafe.Sizeof(WalCkptInfo{})))/uint64(unsafe.Sizeof(U32(0)))+uint64(iFrame)-uint64(1))*4))
  70379 	}
  70380 	return *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iHash)*8)) + uintptr((uint64(iFrame-U32(1))-(uint64(HASHTABLE_NPAGE)-(uint64(unsafe.Sizeof(WalIndexHdr{}))*uint64(2)+uint64(unsafe.Sizeof(WalCkptInfo{})))/uint64(unsafe.Sizeof(U32(0)))))%uint64(HASHTABLE_NPAGE))*4))
  70381 }
  70382 
  70383 func walCleanupHash(tls *libc.TLS, pWal uintptr) {
  70384 	bp := tls.Alloc(24)
  70385 	defer tls.Free(24)
  70386 
  70387 	var iLimit int32 = 0
  70388 	var nByte int32
  70389 	var i int32
  70390 
  70391 	if (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame == U32(0) {
  70392 		return
  70393 	}
  70394 
  70395 	i = walHashGet(tls, pWal, walFramePage(tls, (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame), bp)
  70396 	if i != 0 {
  70397 		return
  70398 	}
  70399 
  70400 	iLimit = int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame - (*WalHashLoc)(unsafe.Pointer(bp)).FiZero)
  70401 
  70402 	for i = 0; i < HASHTABLE_NPAGE*2; i++ {
  70403 		if int32(*(*Ht_slot)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp)).FaHash + uintptr(i)*2))) > iLimit {
  70404 			*(*Ht_slot)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp)).FaHash + uintptr(i)*2)) = Ht_slot(0)
  70405 		}
  70406 	}
  70407 
  70408 	nByte = int32((int64((*WalHashLoc)(unsafe.Pointer(bp)).FaHash) - int64((*WalHashLoc)(unsafe.Pointer(bp)).FaPgno+uintptr(iLimit)*4)) / 1)
  70409 
  70410 	libc.Xmemset(tls, (*WalHashLoc)(unsafe.Pointer(bp)).FaPgno+uintptr(iLimit)*4, 0, uint64(nByte))
  70411 
  70412 }
  70413 
  70414 func walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame U32, iPage U32) int32 {
  70415 	bp := tls.Alloc(24)
  70416 	defer tls.Free(24)
  70417 
  70418 	var rc int32
  70419 
  70420 	rc = walHashGet(tls, pWal, walFramePage(tls, iFrame), bp)
  70421 
  70422 	if rc == SQLITE_OK {
  70423 		var iKey int32
  70424 		var idx int32
  70425 		var nCollide int32
  70426 
  70427 		idx = int32(iFrame - (*WalHashLoc)(unsafe.Pointer(bp)).FiZero)
  70428 
  70429 		if idx == 1 {
  70430 			var nByte int32 = int32((int64((*WalHashLoc)(unsafe.Pointer(bp)).FaHash+8192*2) - int64((*WalHashLoc)(unsafe.Pointer(bp)).FaPgno)) / 1)
  70431 
  70432 			libc.Xmemset(tls, (*WalHashLoc)(unsafe.Pointer(bp)).FaPgno, 0, uint64(nByte))
  70433 		}
  70434 
  70435 		if *(*U32)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp)).FaPgno + uintptr(idx-1)*4)) != 0 {
  70436 			walCleanupHash(tls, pWal)
  70437 
  70438 		}
  70439 
  70440 		nCollide = idx
  70441 		for iKey = walHash(tls, iPage); *(*Ht_slot)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp)).FaHash + uintptr(iKey)*2)) != 0; iKey = walNextHash(tls, iKey) {
  70442 			if libc.PostDecInt32(&nCollide, 1) == 0 {
  70443 				return Xsqlite3CorruptError(tls, 64391)
  70444 			}
  70445 		}
  70446 		*(*U32)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp)).FaPgno + uintptr(idx-1)*4)) = iPage
  70447 		libc.AtomicStoreNUint16((*WalHashLoc)(unsafe.Pointer(bp)).FaHash+uintptr(iKey)*2, Ht_slot(idx), 0)
  70448 
  70449 	}
  70450 
  70451 	return rc
  70452 }
  70453 
  70454 func walIndexRecover(tls *libc.TLS, pWal uintptr) int32 {
  70455 	bp := tls.Alloc(80)
  70456 	defer tls.Free(80)
  70457 
  70458 	var rc int32
  70459 
  70460 	var iLock int32
  70461 	var iOffset I64
  70462 
  70463 	var iFrame U32
  70464 	var iLast U32
  70465 	var iFirst U32
  70466 	var nHdr U32
  70467 	var nHdr32 U32
  70468 
  70469 	var aPrivate uintptr
  70470 	var aFrame uintptr
  70471 	var szFrame int32
  70472 	var aData uintptr
  70473 	var szPage int32
  70474 	var magic U32
  70475 	var version U32
  70476 	var isValid int32
  70477 	var iPg U32
  70478 	var iLastFrame U32
  70479 	var pInfo uintptr
  70480 	var i int32
  70481 	*(*[2]U32)(unsafe.Pointer(bp + 72)) = [2]U32{U32(0), U32(0)}
  70482 
  70483 	iLock = WAL_ALL_BUT_WRITE + int32((*Wal)(unsafe.Pointer(pWal)).FckptLock)
  70484 	rc = walLockExclusive(tls, pWal, iLock, 3+0-iLock)
  70485 	if !(rc != 0) {
  70486 		goto __1
  70487 	}
  70488 	return rc
  70489 __1:
  70490 	;
  70491 	libc.Xmemset(tls, pWal+72, 0, uint64(unsafe.Sizeof(WalIndexHdr{})))
  70492 
  70493 	rc = Xsqlite3OsFileSize(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, bp+16)
  70494 	if !(rc != SQLITE_OK) {
  70495 		goto __2
  70496 	}
  70497 	goto recovery_error
  70498 __2:
  70499 	;
  70500 	if !(*(*I64)(unsafe.Pointer(bp + 16)) > int64(WAL_HDRSIZE)) {
  70501 		goto __3
  70502 	}
  70503 	aPrivate = uintptr(0)
  70504 	aFrame = uintptr(0)
  70505 
  70506 	rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, bp+24, WAL_HDRSIZE, int64(0))
  70507 	if !(rc != SQLITE_OK) {
  70508 		goto __4
  70509 	}
  70510 	goto recovery_error
  70511 __4:
  70512 	;
  70513 	magic = Xsqlite3Get4byte(tls, bp+24)
  70514 	szPage = int32(Xsqlite3Get4byte(tls, bp+24+8))
  70515 	if !(magic&0xFFFFFFFE != U32(WAL_MAGIC) ||
  70516 		szPage&(szPage-1) != 0 ||
  70517 		szPage > SQLITE_MAX_PAGE_SIZE ||
  70518 		szPage < 512) {
  70519 		goto __5
  70520 	}
  70521 	goto finished
  70522 __5:
  70523 	;
  70524 	(*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum = U8(magic & U32(0x00000001))
  70525 	(*Wal)(unsafe.Pointer(pWal)).FszPage = U32(szPage)
  70526 	(*Wal)(unsafe.Pointer(pWal)).FnCkpt = Xsqlite3Get4byte(tls, bp+24+12)
  70527 	libc.Xmemcpy(tls, pWal+72+32, bp+24+16, uint64(8))
  70528 
  70529 	walChecksumBytes(tls, libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum) == SQLITE_BIGENDIAN),
  70530 		bp+24, WAL_HDRSIZE-2*4, uintptr(0), pWal+72+24)
  70531 	if !(*(*U32)(unsafe.Pointer(pWal + 72 + 24)) != Xsqlite3Get4byte(tls, bp+24+24) ||
  70532 		*(*U32)(unsafe.Pointer(pWal + 72 + 24 + 1*4)) != Xsqlite3Get4byte(tls, bp+24+28)) {
  70533 		goto __6
  70534 	}
  70535 	goto finished
  70536 __6:
  70537 	;
  70538 	version = Xsqlite3Get4byte(tls, bp+24+4)
  70539 	if !(version != U32(WAL_MAX_VERSION)) {
  70540 		goto __7
  70541 	}
  70542 	rc = Xsqlite3CantopenError(tls, 64523)
  70543 	goto finished
  70544 __7:
  70545 	;
  70546 	szFrame = szPage + WAL_FRAME_HDRSIZE
  70547 	aFrame = Xsqlite3_malloc64(tls, uint64(szFrame)+(uint64(unsafe.Sizeof(Ht_slot(0)))*uint64(HASHTABLE_NPAGE*2)+uint64(HASHTABLE_NPAGE)*uint64(unsafe.Sizeof(U32(0)))))
  70548 	if !!(aFrame != 0) {
  70549 		goto __8
  70550 	}
  70551 	rc = SQLITE_NOMEM
  70552 	goto recovery_error
  70553 __8:
  70554 	;
  70555 	aData = aFrame + 24
  70556 	aPrivate = aData + uintptr(szPage)
  70557 
  70558 	iLastFrame = U32((*(*I64)(unsafe.Pointer(bp + 16)) - int64(WAL_HDRSIZE)) / I64(szFrame))
  70559 	iPg = U32(0)
  70560 __9:
  70561 	if !(iPg <= U32(walFramePage(tls, iLastFrame))) {
  70562 		goto __11
  70563 	}
  70564 	iLast = func() uint32 {
  70565 		if uint64(iLastFrame) < uint64(HASHTABLE_NPAGE)-(uint64(unsafe.Sizeof(WalIndexHdr{}))*uint64(2)+uint64(unsafe.Sizeof(WalCkptInfo{})))/uint64(unsafe.Sizeof(U32(0)))+uint64(iPg*U32(HASHTABLE_NPAGE)) {
  70566 			return iLastFrame
  70567 		}
  70568 		return uint32(uint64(HASHTABLE_NPAGE) - (uint64(unsafe.Sizeof(WalIndexHdr{}))*uint64(2)+uint64(unsafe.Sizeof(WalCkptInfo{})))/uint64(unsafe.Sizeof(U32(0))) + uint64(iPg*U32(HASHTABLE_NPAGE)))
  70569 	}()
  70570 	iFirst = U32(uint64(1) + func() uint64 {
  70571 		if iPg == U32(0) {
  70572 			return uint64(0)
  70573 		}
  70574 		return uint64(HASHTABLE_NPAGE) - (uint64(unsafe.Sizeof(WalIndexHdr{}))*uint64(2)+uint64(unsafe.Sizeof(WalCkptInfo{})))/uint64(unsafe.Sizeof(U32(0))) + uint64((iPg-U32(1))*U32(HASHTABLE_NPAGE))
  70575 	}())
  70576 	rc = walIndexPage(tls, pWal, int32(iPg), bp+56)
  70577 
  70578 	if !(*(*uintptr)(unsafe.Pointer(bp + 56)) == uintptr(0)) {
  70579 		goto __12
  70580 	}
  70581 	goto __11
  70582 __12:
  70583 	;
  70584 	*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPg)*8)) = aPrivate
  70585 
  70586 	iFrame = iFirst
  70587 __13:
  70588 	if !(iFrame <= iLast) {
  70589 		goto __15
  70590 	}
  70591 	iOffset = int64(WAL_HDRSIZE) + I64(iFrame-U32(1))*I64(szPage+WAL_FRAME_HDRSIZE)
  70592 
  70593 	rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, aFrame, szFrame, iOffset)
  70594 	if !(rc != SQLITE_OK) {
  70595 		goto __16
  70596 	}
  70597 	goto __15
  70598 __16:
  70599 	;
  70600 	isValid = walDecodeFrame(tls, pWal, bp+64, bp+68, aData, aFrame)
  70601 	if !!(isValid != 0) {
  70602 		goto __17
  70603 	}
  70604 	goto __15
  70605 __17:
  70606 	;
  70607 	rc = walIndexAppend(tls, pWal, iFrame, *(*U32)(unsafe.Pointer(bp + 64)))
  70608 	if !(rc != SQLITE_OK) {
  70609 		goto __18
  70610 	}
  70611 	goto __15
  70612 __18:
  70613 	;
  70614 	if !(*(*U32)(unsafe.Pointer(bp + 68)) != 0) {
  70615 		goto __19
  70616 	}
  70617 	(*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame = iFrame
  70618 	(*Wal)(unsafe.Pointer(pWal)).Fhdr.FnPage = *(*U32)(unsafe.Pointer(bp + 68))
  70619 	(*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage = U16(szPage&0xff00 | szPage>>16)
  70620 
  70621 	*(*U32)(unsafe.Pointer(bp + 72)) = *(*U32)(unsafe.Pointer(pWal + 72 + 24))
  70622 	*(*U32)(unsafe.Pointer(bp + 72 + 1*4)) = *(*U32)(unsafe.Pointer(pWal + 72 + 24 + 1*4))
  70623 __19:
  70624 	;
  70625 	goto __14
  70626 __14:
  70627 	iFrame++
  70628 	goto __13
  70629 	goto __15
  70630 __15:
  70631 	;
  70632 	*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPg)*8)) = *(*uintptr)(unsafe.Pointer(bp + 56))
  70633 	nHdr = func() uint32 {
  70634 		if iPg == U32(0) {
  70635 			return uint32(uint64(unsafe.Sizeof(WalIndexHdr{}))*uint64(2) + uint64(unsafe.Sizeof(WalCkptInfo{})))
  70636 		}
  70637 		return uint32(0)
  70638 	}()
  70639 	nHdr32 = U32(uint64(nHdr) / uint64(unsafe.Sizeof(U32(0))))
  70640 
  70641 	libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 56))+uintptr(nHdr32)*4, aPrivate+uintptr(nHdr32)*4, uint64(unsafe.Sizeof(Ht_slot(0)))*uint64(HASHTABLE_NPAGE*2)+uint64(HASHTABLE_NPAGE)*uint64(unsafe.Sizeof(U32(0)))-uint64(nHdr))
  70642 	if !(iFrame <= iLast) {
  70643 		goto __20
  70644 	}
  70645 	goto __11
  70646 __20:
  70647 	;
  70648 	goto __10
  70649 __10:
  70650 	iPg++
  70651 	goto __9
  70652 	goto __11
  70653 __11:
  70654 	;
  70655 	Xsqlite3_free(tls, aFrame)
  70656 __3:
  70657 	;
  70658 finished:
  70659 	if !(rc == SQLITE_OK) {
  70660 		goto __21
  70661 	}
  70662 	*(*U32)(unsafe.Pointer(pWal + 72 + 24)) = *(*U32)(unsafe.Pointer(bp + 72))
  70663 	*(*U32)(unsafe.Pointer(pWal + 72 + 24 + 1*4)) = *(*U32)(unsafe.Pointer(bp + 72 + 1*4))
  70664 	walIndexWriteHdr(tls, pWal)
  70665 
  70666 	libc.AtomicStoreUintptr(&pInfo, walCkptInfo(tls, pWal))
  70667 	(*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill = U32(0)
  70668 	(*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
  70669 	*(*U32)(unsafe.Pointer(pInfo + 4)) = U32(0)
  70670 	i = 1
  70671 __22:
  70672 	if !(i < SQLITE_SHM_NLOCK-3) {
  70673 		goto __24
  70674 	}
  70675 	rc = walLockExclusive(tls, pWal, 3+i, 1)
  70676 	if !(rc == SQLITE_OK) {
  70677 		goto __25
  70678 	}
  70679 	if !(i == 1 && (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0) {
  70680 		goto __27
  70681 	}
  70682 	*(*U32)(unsafe.Pointer(pInfo + 4 + uintptr(i)*4)) = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
  70683 	goto __28
  70684 __27:
  70685 	*(*U32)(unsafe.Pointer(pInfo + 4 + uintptr(i)*4)) = READMARK_NOT_USED
  70686 __28:
  70687 	;
  70688 	walUnlockExclusive(tls, pWal, 3+i, 1)
  70689 	goto __26
  70690 __25:
  70691 	if !(rc != SQLITE_BUSY) {
  70692 		goto __29
  70693 	}
  70694 	goto recovery_error
  70695 __29:
  70696 	;
  70697 __26:
  70698 	;
  70699 	goto __23
  70700 __23:
  70701 	i++
  70702 	goto __22
  70703 	goto __24
  70704 __24:
  70705 	;
  70706 	if !((*Wal)(unsafe.Pointer(pWal)).Fhdr.FnPage != 0) {
  70707 		goto __30
  70708 	}
  70709 	Xsqlite3_log(tls, SQLITE_NOTICE|int32(1)<<8,
  70710 		ts+5322,
  70711 		libc.VaList(bp, (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame, (*Wal)(unsafe.Pointer(pWal)).FzWalName))
  70712 __30:
  70713 	;
  70714 __21:
  70715 	;
  70716 recovery_error:
  70717 	;
  70718 	walUnlockExclusive(tls, pWal, iLock, 3+0-iLock)
  70719 	return rc
  70720 }
  70721 
  70722 func walIndexClose(tls *libc.TLS, pWal uintptr, isDelete int32) {
  70723 	if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_HEAPMEMORY_MODE || (*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 {
  70724 		var i int32
  70725 		for i = 0; i < (*Wal)(unsafe.Pointer(pWal)).FnWiData; i++ {
  70726 			Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(i)*8)))
  70727 			*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(i)*8)) = uintptr(0)
  70728 		}
  70729 	}
  70730 	if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) != WAL_HEAPMEMORY_MODE {
  70731 		Xsqlite3OsShmUnmap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, isDelete)
  70732 	}
  70733 }
  70734 
  70735 // Open a connection to the WAL file zWalName. The database file must
  70736 // already be opened on connection pDbFd. The buffer that zWalName points
  70737 // to must remain valid for the lifetime of the returned Wal* handle.
  70738 //
  70739 // A SHARED lock should be held on the database file when this function
  70740 // is called. The purpose of this SHARED lock is to prevent any other
  70741 // client from unlinking the WAL or wal-index file. If another process
  70742 // were to do this just after this client opened one of these files, the
  70743 // system would be badly broken.
  70744 //
  70745 // If the log file is successfully opened, SQLITE_OK is returned and
  70746 // *ppWal is set to point to a new WAL handle. If an error occurs,
  70747 // an SQLite error code is returned and *ppWal is left unmodified.
  70748 func Xsqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintptr, bNoShm int32, mxWalSize I64, ppWal uintptr) int32 {
  70749 	bp := tls.Alloc(4)
  70750 	defer tls.Free(4)
  70751 
  70752 	var rc int32
  70753 	var pRet uintptr
  70754 
  70755 	*(*uintptr)(unsafe.Pointer(ppWal)) = uintptr(0)
  70756 	pRet = Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(Wal{}))+uint64((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))
  70757 	if !(pRet != 0) {
  70758 		return SQLITE_NOMEM
  70759 	}
  70760 
  70761 	(*Wal)(unsafe.Pointer(pRet)).FpVfs = pVfs
  70762 	(*Wal)(unsafe.Pointer(pRet)).FpWalFd = pRet + 1*152
  70763 	(*Wal)(unsafe.Pointer(pRet)).FpDbFd = pDbFd
  70764 	(*Wal)(unsafe.Pointer(pRet)).FreadLock = int16(-1)
  70765 	(*Wal)(unsafe.Pointer(pRet)).FmxWalSize = mxWalSize
  70766 	(*Wal)(unsafe.Pointer(pRet)).FzWalName = zWalName
  70767 	(*Wal)(unsafe.Pointer(pRet)).FsyncHeader = U8(1)
  70768 	(*Wal)(unsafe.Pointer(pRet)).FpadToSectorBoundary = U8(1)
  70769 	(*Wal)(unsafe.Pointer(pRet)).FexclusiveMode = func() uint8 {
  70770 		if bNoShm != 0 {
  70771 			return uint8(WAL_HEAPMEMORY_MODE)
  70772 		}
  70773 		return uint8(WAL_NORMAL_MODE)
  70774 	}()
  70775 
  70776 	*(*int32)(unsafe.Pointer(bp)) = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_WAL
  70777 	rc = Xsqlite3OsOpen(tls, pVfs, zWalName, (*Wal)(unsafe.Pointer(pRet)).FpWalFd, *(*int32)(unsafe.Pointer(bp)), bp)
  70778 	if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp))&SQLITE_OPEN_READONLY != 0 {
  70779 		(*Wal)(unsafe.Pointer(pRet)).FreadOnly = U8(WAL_RDONLY)
  70780 	}
  70781 
  70782 	if rc != SQLITE_OK {
  70783 		walIndexClose(tls, pRet, 0)
  70784 		Xsqlite3OsClose(tls, (*Wal)(unsafe.Pointer(pRet)).FpWalFd)
  70785 		Xsqlite3_free(tls, pRet)
  70786 	} else {
  70787 		var iDC int32 = Xsqlite3OsDeviceCharacteristics(tls, pDbFd)
  70788 		if iDC&SQLITE_IOCAP_SEQUENTIAL != 0 {
  70789 			(*Wal)(unsafe.Pointer(pRet)).FsyncHeader = U8(0)
  70790 		}
  70791 		if iDC&SQLITE_IOCAP_POWERSAFE_OVERWRITE != 0 {
  70792 			(*Wal)(unsafe.Pointer(pRet)).FpadToSectorBoundary = U8(0)
  70793 		}
  70794 		*(*uintptr)(unsafe.Pointer(ppWal)) = pRet
  70795 
  70796 	}
  70797 	return rc
  70798 }
  70799 
  70800 // Change the size to which the WAL file is trucated on each reset.
  70801 func Xsqlite3WalLimit(tls *libc.TLS, pWal uintptr, iLimit I64) {
  70802 	if pWal != 0 {
  70803 		(*Wal)(unsafe.Pointer(pWal)).FmxWalSize = iLimit
  70804 	}
  70805 }
  70806 
  70807 func walIteratorNext(tls *libc.TLS, p uintptr, piPage uintptr, piFrame uintptr) int32 {
  70808 	var iMin U32
  70809 	var iRet U32 = 0xFFFFFFFF
  70810 	var i int32
  70811 
  70812 	iMin = (*WalIterator)(unsafe.Pointer(p)).FiPrior
  70813 
  70814 	for i = (*WalIterator)(unsafe.Pointer(p)).FnSegment - 1; i >= 0; i-- {
  70815 		var pSegment uintptr = p + 8 + uintptr(i)*32
  70816 		for (*WalSegment)(unsafe.Pointer(pSegment)).FiNext < (*WalSegment)(unsafe.Pointer(pSegment)).FnEntry {
  70817 			var iPg U32 = *(*U32)(unsafe.Pointer((*WalSegment)(unsafe.Pointer(pSegment)).FaPgno + uintptr(*(*Ht_slot)(unsafe.Pointer((*WalSegment)(unsafe.Pointer(pSegment)).FaIndex + uintptr((*WalSegment)(unsafe.Pointer(pSegment)).FiNext)*2)))*4))
  70818 			if iPg > iMin {
  70819 				if iPg < iRet {
  70820 					iRet = iPg
  70821 					*(*U32)(unsafe.Pointer(piFrame)) = U32((*WalSegment)(unsafe.Pointer(pSegment)).FiZero + int32(*(*Ht_slot)(unsafe.Pointer((*WalSegment)(unsafe.Pointer(pSegment)).FaIndex + uintptr((*WalSegment)(unsafe.Pointer(pSegment)).FiNext)*2))))
  70822 				}
  70823 				break
  70824 			}
  70825 			(*WalSegment)(unsafe.Pointer(pSegment)).FiNext++
  70826 		}
  70827 	}
  70828 
  70829 	*(*U32)(unsafe.Pointer(piPage)) = libc.AssignPtrUint32(p, iRet)
  70830 	return libc.Bool32(iRet == 0xFFFFFFFF)
  70831 }
  70832 
  70833 func walMerge(tls *libc.TLS, aContent uintptr, aLeft uintptr, nLeft int32, paRight uintptr, pnRight uintptr, aTmp uintptr) {
  70834 	var iLeft int32 = 0
  70835 	var iRight int32 = 0
  70836 	var iOut int32 = 0
  70837 	var nRight int32 = *(*int32)(unsafe.Pointer(pnRight))
  70838 	var aRight uintptr = *(*uintptr)(unsafe.Pointer(paRight))
  70839 
  70840 	for iRight < nRight || iLeft < nLeft {
  70841 		var logpage Ht_slot
  70842 		var dbpage Pgno
  70843 
  70844 		if iLeft < nLeft &&
  70845 			(iRight >= nRight || *(*U32)(unsafe.Pointer(aContent + uintptr(*(*Ht_slot)(unsafe.Pointer(aLeft + uintptr(iLeft)*2)))*4)) < *(*U32)(unsafe.Pointer(aContent + uintptr(*(*Ht_slot)(unsafe.Pointer(aRight + uintptr(iRight)*2)))*4))) {
  70846 			logpage = *(*Ht_slot)(unsafe.Pointer(aLeft + uintptr(libc.PostIncInt32(&iLeft, 1))*2))
  70847 		} else {
  70848 			logpage = *(*Ht_slot)(unsafe.Pointer(aRight + uintptr(libc.PostIncInt32(&iRight, 1))*2))
  70849 		}
  70850 		dbpage = *(*U32)(unsafe.Pointer(aContent + uintptr(logpage)*4))
  70851 
  70852 		*(*Ht_slot)(unsafe.Pointer(aTmp + uintptr(libc.PostIncInt32(&iOut, 1))*2)) = logpage
  70853 		if iLeft < nLeft && *(*U32)(unsafe.Pointer(aContent + uintptr(*(*Ht_slot)(unsafe.Pointer(aLeft + uintptr(iLeft)*2)))*4)) == dbpage {
  70854 			iLeft++
  70855 		}
  70856 
  70857 	}
  70858 
  70859 	*(*uintptr)(unsafe.Pointer(paRight)) = aLeft
  70860 	*(*int32)(unsafe.Pointer(pnRight)) = iOut
  70861 	libc.Xmemcpy(tls, aLeft, aTmp, uint64(unsafe.Sizeof(Ht_slot(0)))*uint64(iOut))
  70862 }
  70863 
  70864 func walMergesort(tls *libc.TLS, aContent uintptr, aBuffer uintptr, aList uintptr, pnList uintptr) {
  70865 	bp := tls.Alloc(220)
  70866 	defer tls.Free(220)
  70867 
  70868 	var nList int32 = *(*int32)(unsafe.Pointer(pnList))
  70869 	*(*int32)(unsafe.Pointer(bp + 216)) = 0
  70870 	*(*uintptr)(unsafe.Pointer(bp + 208)) = uintptr(0)
  70871 	var iList int32
  70872 	var iSub U32 = U32(0)
  70873 
  70874 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof([13]Sublist{})))
  70875 
  70876 	for iList = 0; iList < nList; iList++ {
  70877 		*(*int32)(unsafe.Pointer(bp + 216)) = 1
  70878 		*(*uintptr)(unsafe.Pointer(bp + 208)) = aList + uintptr(iList)*2
  70879 		for iSub = U32(0); iList&(int32(1)<<iSub) != 0; iSub++ {
  70880 			var p uintptr
  70881 
  70882 			p = bp + uintptr(iSub)*16
  70883 
  70884 			walMerge(tls, aContent, (*Sublist)(unsafe.Pointer(p)).FaList, (*Sublist)(unsafe.Pointer(p)).FnList, bp+208, bp+216, aBuffer)
  70885 		}
  70886 		(*Sublist)(unsafe.Pointer(bp + uintptr(iSub)*16)).FaList = *(*uintptr)(unsafe.Pointer(bp + 208))
  70887 		(*Sublist)(unsafe.Pointer(bp + uintptr(iSub)*16)).FnList = *(*int32)(unsafe.Pointer(bp + 216))
  70888 	}
  70889 
  70890 	for iSub++; iSub < U32(int32(uint64(unsafe.Sizeof([13]Sublist{}))/uint64(unsafe.Sizeof(Sublist{})))); iSub++ {
  70891 		if nList&(int32(1)<<iSub) != 0 {
  70892 			var p uintptr
  70893 
  70894 			p = bp + uintptr(iSub)*16
  70895 
  70896 			walMerge(tls, aContent, (*Sublist)(unsafe.Pointer(p)).FaList, (*Sublist)(unsafe.Pointer(p)).FnList, bp+208, bp+216, aBuffer)
  70897 		}
  70898 	}
  70899 
  70900 	*(*int32)(unsafe.Pointer(pnList)) = *(*int32)(unsafe.Pointer(bp + 216))
  70901 
  70902 }
  70903 
  70904 type Sublist = struct {
  70905 	FnList       int32
  70906 	F__ccgo_pad1 [4]byte
  70907 	FaList       uintptr
  70908 }
  70909 
  70910 func walIteratorFree(tls *libc.TLS, p uintptr) {
  70911 	Xsqlite3_free(tls, p)
  70912 }
  70913 
  70914 func walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill U32, pp uintptr) int32 {
  70915 	bp := tls.Alloc(28)
  70916 	defer tls.Free(28)
  70917 
  70918 	var p uintptr
  70919 	var nSegment int32
  70920 	var iLast U32
  70921 	var nByte Sqlite3_int64
  70922 	var i int32
  70923 	var aTmp uintptr
  70924 	var rc int32 = SQLITE_OK
  70925 
  70926 	iLast = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
  70927 
  70928 	nSegment = walFramePage(tls, iLast) + 1
  70929 	nByte = Sqlite3_int64(uint64(unsafe.Sizeof(WalIterator{})) +
  70930 		uint64(nSegment-1)*uint64(unsafe.Sizeof(WalSegment{})) +
  70931 		uint64(iLast)*uint64(unsafe.Sizeof(Ht_slot(0))))
  70932 	p = Xsqlite3_malloc64(tls, uint64(nByte))
  70933 	if !(p != 0) {
  70934 		return SQLITE_NOMEM
  70935 	}
  70936 	libc.Xmemset(tls, p, 0, uint64(nByte))
  70937 	(*WalIterator)(unsafe.Pointer(p)).FnSegment = nSegment
  70938 
  70939 	aTmp = Xsqlite3_malloc64(tls,
  70940 		uint64(unsafe.Sizeof(Ht_slot(0)))*func() uint64 {
  70941 			if iLast > U32(HASHTABLE_NPAGE) {
  70942 				return uint64(HASHTABLE_NPAGE)
  70943 			}
  70944 			return uint64(iLast)
  70945 		}())
  70946 	if !(aTmp != 0) {
  70947 		rc = SQLITE_NOMEM
  70948 	}
  70949 
  70950 	for i = walFramePage(tls, nBackfill+U32(1)); rc == SQLITE_OK && i < nSegment; i++ {
  70951 		rc = walHashGet(tls, pWal, i, bp)
  70952 		if rc == SQLITE_OK {
  70953 			var j int32
  70954 
  70955 			var aIndex uintptr
  70956 
  70957 			if i+1 == nSegment {
  70958 				*(*int32)(unsafe.Pointer(bp + 24)) = int32(iLast - (*WalHashLoc)(unsafe.Pointer(bp)).FiZero)
  70959 			} else {
  70960 				*(*int32)(unsafe.Pointer(bp + 24)) = int32((int64((*WalHashLoc)(unsafe.Pointer(bp)).FaHash) - int64((*WalHashLoc)(unsafe.Pointer(bp)).FaPgno)) / 4)
  70961 			}
  70962 			aIndex = p + 8 + uintptr((*WalIterator)(unsafe.Pointer(p)).FnSegment)*32 + uintptr((*WalHashLoc)(unsafe.Pointer(bp)).FiZero)*2
  70963 			(*WalHashLoc)(unsafe.Pointer(bp)).FiZero++
  70964 
  70965 			for j = 0; j < *(*int32)(unsafe.Pointer(bp + 24)); j++ {
  70966 				*(*Ht_slot)(unsafe.Pointer(aIndex + uintptr(j)*2)) = Ht_slot(j)
  70967 			}
  70968 			walMergesort(tls, (*WalHashLoc)(unsafe.Pointer(bp)).FaPgno, aTmp, aIndex, bp+24)
  70969 			(*WalSegment)(unsafe.Pointer(p + 8 + uintptr(i)*32)).FiZero = int32((*WalHashLoc)(unsafe.Pointer(bp)).FiZero)
  70970 			(*WalSegment)(unsafe.Pointer(p + 8 + uintptr(i)*32)).FnEntry = *(*int32)(unsafe.Pointer(bp + 24))
  70971 			(*WalSegment)(unsafe.Pointer(p + 8 + uintptr(i)*32)).FaIndex = aIndex
  70972 			(*WalSegment)(unsafe.Pointer(p + 8 + uintptr(i)*32)).FaPgno = (*WalHashLoc)(unsafe.Pointer(bp)).FaPgno
  70973 		}
  70974 	}
  70975 	Xsqlite3_free(tls, aTmp)
  70976 
  70977 	if rc != SQLITE_OK {
  70978 		walIteratorFree(tls, p)
  70979 		p = uintptr(0)
  70980 	}
  70981 	*(*uintptr)(unsafe.Pointer(pp)) = p
  70982 	return rc
  70983 }
  70984 
  70985 func walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) int32 {
  70986 	var rc int32
  70987 	for __ccgo := true; __ccgo; __ccgo = xBusy != 0 && rc == SQLITE_BUSY && (*struct {
  70988 		f func(*libc.TLS, uintptr) int32
  70989 	})(unsafe.Pointer(&struct{ uintptr }{xBusy})).f(tls, pBusyArg) != 0 {
  70990 		rc = walLockExclusive(tls, pWal, lockIdx, n)
  70991 	}
  70992 	return rc
  70993 }
  70994 
  70995 func walPagesize(tls *libc.TLS, pWal uintptr) int32 {
  70996 	return int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)&0xfe00 + int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)&0x0001<<16
  70997 }
  70998 
  70999 func walRestartHdr(tls *libc.TLS, pWal uintptr, salt1 U32) {
  71000 	bp := tls.Alloc(4)
  71001 	defer tls.Free(4)
  71002 	*(*U32)(unsafe.Pointer(bp)) = salt1
  71003 
  71004 	var pInfo uintptr = walCkptInfo(tls, pWal)
  71005 	var i int32
  71006 	var aSalt uintptr = pWal + 72 + 32
  71007 	(*Wal)(unsafe.Pointer(pWal)).FnCkpt++
  71008 	(*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame = U32(0)
  71009 	Xsqlite3Put4byte(tls, aSalt, U32(1)+Xsqlite3Get4byte(tls, aSalt))
  71010 	libc.Xmemcpy(tls, pWal+72+32+1*4, bp, uint64(4))
  71011 	walIndexWriteHdr(tls, pWal)
  71012 	libc.AtomicStoreNInt32(pInfo, int32(0), 0)
  71013 	(*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted = U32(0)
  71014 	*(*U32)(unsafe.Pointer(pInfo + 4 + 1*4)) = U32(0)
  71015 	for i = 2; i < SQLITE_SHM_NLOCK-3; i++ {
  71016 		*(*U32)(unsafe.Pointer(pInfo + 4 + uintptr(i)*4)) = READMARK_NOT_USED
  71017 	}
  71018 
  71019 }
  71020 
  71021 func walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) int32 {
  71022 	bp := tls.Alloc(36)
  71023 	defer tls.Free(36)
  71024 
  71025 	var rc int32
  71026 	var szPage int32
  71027 
  71028 	var mxSafeFrame U32
  71029 	var mxPage U32
  71030 	var i int32
  71031 	var pInfo uintptr
  71032 	var iMark U32
  71033 	var y U32
  71034 
  71035 	var iOffset I64
  71036 	var szDb I64
  71037 	var nBackfill U32
  71038 
  71039 	rc = SQLITE_OK
  71040 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
  71041 	*(*U32)(unsafe.Pointer(bp + 24)) = U32(0)
  71042 	*(*U32)(unsafe.Pointer(bp + 28)) = U32(0)
  71043 
  71044 	szPage = walPagesize(tls, pWal)
  71045 
  71046 	libc.AtomicStoreUintptr(&pInfo, walCkptInfo(tls, pWal))
  71047 	if !((*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill < (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame) {
  71048 		goto __1
  71049 	}
  71050 
  71051 	mxSafeFrame = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
  71052 	mxPage = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FnPage
  71053 	i = 1
  71054 __2:
  71055 	if !(i < SQLITE_SHM_NLOCK-3) {
  71056 		goto __4
  71057 	}
  71058 	y = libc.AtomicLoadNUint32(pInfo+4+uintptr(i)*4, 0)
  71059 	if !(mxSafeFrame > y) {
  71060 		goto __5
  71061 	}
  71062 
  71063 	rc = walBusyLock(tls, pWal, xBusy, pBusyArg, 3+i, 1)
  71064 	if !(rc == SQLITE_OK) {
  71065 		goto __6
  71066 	}
  71067 	iMark = func() uint32 {
  71068 		if i == 1 {
  71069 			return mxSafeFrame
  71070 		}
  71071 		return READMARK_NOT_USED
  71072 	}()
  71073 	libc.AtomicStoreNUint32(pInfo+4+uintptr(i)*4, iMark, 0)
  71074 	walUnlockExclusive(tls, pWal, 3+i, 1)
  71075 	goto __7
  71076 __6:
  71077 	if !(rc == SQLITE_BUSY) {
  71078 		goto __8
  71079 	}
  71080 	mxSafeFrame = y
  71081 	xBusy = uintptr(0)
  71082 	goto __9
  71083 __8:
  71084 	goto walcheckpoint_out
  71085 __9:
  71086 	;
  71087 __7:
  71088 	;
  71089 __5:
  71090 	;
  71091 	goto __3
  71092 __3:
  71093 	i++
  71094 	goto __2
  71095 	goto __4
  71096 __4:
  71097 	;
  71098 	if !((*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill < mxSafeFrame) {
  71099 		goto __10
  71100 	}
  71101 	rc = walIteratorInit(tls, pWal, (*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill, bp)
  71102 
  71103 __10:
  71104 	;
  71105 	if !(*(*uintptr)(unsafe.Pointer(bp)) != 0 &&
  71106 		libc.AssignInt32(&rc, walBusyLock(tls, pWal, xBusy, pBusyArg, 3+0, 1)) == SQLITE_OK) {
  71107 		goto __11
  71108 	}
  71109 	nBackfill = (*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill
  71110 
  71111 	(*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted = mxSafeFrame
  71112 
  71113 	rc = Xsqlite3OsSync(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, sync_flags>>2&0x03)
  71114 
  71115 	if !(rc == SQLITE_OK) {
  71116 		goto __12
  71117 	}
  71118 	*(*I64)(unsafe.Pointer(bp + 16)) = I64(mxPage) * I64(szPage)
  71119 	Xsqlite3OsFileControl(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, SQLITE_FCNTL_CKPT_START, uintptr(0))
  71120 	rc = Xsqlite3OsFileSize(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, bp+8)
  71121 	if !(rc == SQLITE_OK && *(*I64)(unsafe.Pointer(bp + 8)) < *(*I64)(unsafe.Pointer(bp + 16))) {
  71122 		goto __13
  71123 	}
  71124 	if !(*(*I64)(unsafe.Pointer(bp + 8))+int64(65536)+I64((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame)*I64(szPage) < *(*I64)(unsafe.Pointer(bp + 16))) {
  71125 		goto __14
  71126 	}
  71127 
  71128 	rc = Xsqlite3CorruptError(tls, 65337)
  71129 	goto __15
  71130 __14:
  71131 	Xsqlite3OsFileControlHint(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, SQLITE_FCNTL_SIZE_HINT, bp+16)
  71132 __15:
  71133 	;
  71134 __13:
  71135 	;
  71136 __12:
  71137 	;
  71138 __16:
  71139 	if !(rc == SQLITE_OK && 0 == walIteratorNext(tls, *(*uintptr)(unsafe.Pointer(bp)), bp+24, bp+28)) {
  71140 		goto __17
  71141 	}
  71142 
  71143 	if !(libc.AtomicLoadNInt32(db+432, 0) != 0) {
  71144 		goto __18
  71145 	}
  71146 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
  71147 		rc = SQLITE_NOMEM
  71148 	} else {
  71149 		rc = SQLITE_INTERRUPT
  71150 	}
  71151 	goto __17
  71152 __18:
  71153 	;
  71154 	if !(*(*U32)(unsafe.Pointer(bp + 28)) <= nBackfill || *(*U32)(unsafe.Pointer(bp + 28)) > mxSafeFrame || *(*U32)(unsafe.Pointer(bp + 24)) > mxPage) {
  71155 		goto __19
  71156 	}
  71157 	goto __16
  71158 __19:
  71159 	;
  71160 	iOffset = int64(WAL_HDRSIZE) + I64(*(*U32)(unsafe.Pointer(bp + 28))-U32(1))*I64(szPage+WAL_FRAME_HDRSIZE) + int64(WAL_FRAME_HDRSIZE)
  71161 
  71162 	rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, zBuf, szPage, iOffset)
  71163 	if !(rc != SQLITE_OK) {
  71164 		goto __20
  71165 	}
  71166 	goto __17
  71167 __20:
  71168 	;
  71169 	iOffset = I64(*(*U32)(unsafe.Pointer(bp + 24))-U32(1)) * I64(szPage)
  71170 
  71171 	rc = Xsqlite3OsWrite(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, zBuf, szPage, iOffset)
  71172 	if !(rc != SQLITE_OK) {
  71173 		goto __21
  71174 	}
  71175 	goto __17
  71176 __21:
  71177 	;
  71178 	goto __16
  71179 __17:
  71180 	;
  71181 	Xsqlite3OsFileControl(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, SQLITE_FCNTL_CKPT_DONE, uintptr(0))
  71182 
  71183 	if !(rc == SQLITE_OK) {
  71184 		goto __22
  71185 	}
  71186 	if !(mxSafeFrame == (*WalIndexHdr)(unsafe.Pointer(walIndexHdr(tls, pWal))).FmxFrame) {
  71187 		goto __23
  71188 	}
  71189 	szDb = I64((*Wal)(unsafe.Pointer(pWal)).Fhdr.FnPage) * I64(szPage)
  71190 
  71191 	rc = Xsqlite3OsTruncate(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, szDb)
  71192 	if !(rc == SQLITE_OK) {
  71193 		goto __24
  71194 	}
  71195 	rc = Xsqlite3OsSync(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, sync_flags>>2&0x03)
  71196 __24:
  71197 	;
  71198 __23:
  71199 	;
  71200 	if !(rc == SQLITE_OK) {
  71201 		goto __25
  71202 	}
  71203 	libc.AtomicStoreNUint32(pInfo, mxSafeFrame, 0)
  71204 __25:
  71205 	;
  71206 __22:
  71207 	;
  71208 	walUnlockExclusive(tls, pWal, 3+0, 1)
  71209 __11:
  71210 	;
  71211 	if !(rc == SQLITE_BUSY) {
  71212 		goto __26
  71213 	}
  71214 
  71215 	rc = SQLITE_OK
  71216 __26:
  71217 	;
  71218 __1:
  71219 	;
  71220 	if !(rc == SQLITE_OK && eMode != SQLITE_CHECKPOINT_PASSIVE) {
  71221 		goto __27
  71222 	}
  71223 
  71224 	if !((*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill < (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame) {
  71225 		goto __28
  71226 	}
  71227 	rc = SQLITE_BUSY
  71228 	goto __29
  71229 __28:
  71230 	if !(eMode >= SQLITE_CHECKPOINT_RESTART) {
  71231 		goto __30
  71232 	}
  71233 	Xsqlite3_randomness(tls, 4, bp+32)
  71234 
  71235 	rc = walBusyLock(tls, pWal, xBusy, pBusyArg, 3+1, SQLITE_SHM_NLOCK-3-1)
  71236 	if !(rc == SQLITE_OK) {
  71237 		goto __31
  71238 	}
  71239 	if !(eMode == SQLITE_CHECKPOINT_TRUNCATE) {
  71240 		goto __32
  71241 	}
  71242 
  71243 	walRestartHdr(tls, pWal, *(*U32)(unsafe.Pointer(bp + 32)))
  71244 	rc = Xsqlite3OsTruncate(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, int64(0))
  71245 __32:
  71246 	;
  71247 	walUnlockExclusive(tls, pWal, 3+1, SQLITE_SHM_NLOCK-3-1)
  71248 __31:
  71249 	;
  71250 __30:
  71251 	;
  71252 __29:
  71253 	;
  71254 __27:
  71255 	;
  71256 walcheckpoint_out:
  71257 	walIteratorFree(tls, *(*uintptr)(unsafe.Pointer(bp)))
  71258 	return rc
  71259 }
  71260 
  71261 func walLimitSize(tls *libc.TLS, pWal uintptr, nMax I64) {
  71262 	bp := tls.Alloc(16)
  71263 	defer tls.Free(16)
  71264 
  71265 	var rx int32
  71266 	Xsqlite3BeginBenignMalloc(tls)
  71267 	rx = Xsqlite3OsFileSize(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, bp+8)
  71268 	if rx == SQLITE_OK && *(*I64)(unsafe.Pointer(bp + 8)) > nMax {
  71269 		rx = Xsqlite3OsTruncate(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, nMax)
  71270 	}
  71271 	Xsqlite3EndBenignMalloc(tls)
  71272 	if rx != 0 {
  71273 		Xsqlite3_log(tls, rx, ts+5359, libc.VaList(bp, (*Wal)(unsafe.Pointer(pWal)).FzWalName))
  71274 	}
  71275 }
  71276 
  71277 // Close a connection to a log file.
  71278 func Xsqlite3WalClose(tls *libc.TLS, pWal uintptr, db uintptr, sync_flags int32, nBuf int32, zBuf uintptr) int32 {
  71279 	bp := tls.Alloc(4)
  71280 	defer tls.Free(4)
  71281 
  71282 	var rc int32 = SQLITE_OK
  71283 	if pWal != 0 {
  71284 		var isDelete int32 = 0
  71285 
  71286 		if zBuf != uintptr(0) &&
  71287 			SQLITE_OK == libc.AssignInt32(&rc, Xsqlite3OsLock(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, SQLITE_LOCK_EXCLUSIVE)) {
  71288 			if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE {
  71289 				(*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_EXCLUSIVE_MODE)
  71290 			}
  71291 			rc = Xsqlite3WalCheckpoint(tls, pWal, db,
  71292 				SQLITE_CHECKPOINT_PASSIVE, uintptr(0), uintptr(0), sync_flags, nBuf, zBuf, uintptr(0), uintptr(0))
  71293 			if rc == SQLITE_OK {
  71294 				*(*int32)(unsafe.Pointer(bp)) = -1
  71295 				Xsqlite3OsFileControlHint(tls,
  71296 					(*Wal)(unsafe.Pointer(pWal)).FpDbFd, SQLITE_FCNTL_PERSIST_WAL, bp)
  71297 				if *(*int32)(unsafe.Pointer(bp)) != 1 {
  71298 					isDelete = 1
  71299 				} else if (*Wal)(unsafe.Pointer(pWal)).FmxWalSize >= int64(0) {
  71300 					walLimitSize(tls, pWal, int64(0))
  71301 				}
  71302 			}
  71303 		}
  71304 
  71305 		walIndexClose(tls, pWal, isDelete)
  71306 		Xsqlite3OsClose(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd)
  71307 		if isDelete != 0 {
  71308 			Xsqlite3BeginBenignMalloc(tls)
  71309 			Xsqlite3OsDelete(tls, (*Wal)(unsafe.Pointer(pWal)).FpVfs, (*Wal)(unsafe.Pointer(pWal)).FzWalName, 0)
  71310 			Xsqlite3EndBenignMalloc(tls)
  71311 		}
  71312 
  71313 		Xsqlite3_free(tls, (*Wal)(unsafe.Pointer(pWal)).FapWiData)
  71314 		Xsqlite3_free(tls, pWal)
  71315 	}
  71316 	return rc
  71317 }
  71318 
  71319 func walIndexTryHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 {
  71320 	bp := tls.Alloc(104)
  71321 	defer tls.Free(104)
  71322 
  71323 	var aHdr uintptr
  71324 
  71325 	libc.AtomicStoreUintptr(&aHdr, walIndexHdr(tls, pWal))
  71326 	libc.Xmemcpy(tls, bp, aHdr, uint64(unsafe.Sizeof(WalIndexHdr{})))
  71327 	walShmBarrier(tls, pWal)
  71328 	libc.Xmemcpy(tls, bp+48, aHdr+1*48, uint64(unsafe.Sizeof(WalIndexHdr{})))
  71329 
  71330 	if libc.Xmemcmp(tls, bp, bp+48, uint64(unsafe.Sizeof(WalIndexHdr{}))) != 0 {
  71331 		return 1
  71332 	}
  71333 	if int32((*WalIndexHdr)(unsafe.Pointer(bp)).FisInit) == 0 {
  71334 		return 1
  71335 	}
  71336 	walChecksumBytes(tls, 1, bp, int32(uint64(unsafe.Sizeof(WalIndexHdr{}))-uint64(unsafe.Sizeof([2]U32{}))), uintptr(0), bp+96)
  71337 	if *(*U32)(unsafe.Pointer(bp + 96)) != *(*U32)(unsafe.Pointer(bp + 40)) || *(*U32)(unsafe.Pointer(bp + 96 + 1*4)) != *(*U32)(unsafe.Pointer(bp + 40 + 1*4)) {
  71338 		return 1
  71339 	}
  71340 
  71341 	if libc.Xmemcmp(tls, pWal+72, bp, uint64(unsafe.Sizeof(WalIndexHdr{}))) != 0 {
  71342 		*(*int32)(unsafe.Pointer(pChanged)) = 1
  71343 		libc.Xmemcpy(tls, pWal+72, bp, uint64(unsafe.Sizeof(WalIndexHdr{})))
  71344 		(*Wal)(unsafe.Pointer(pWal)).FszPage = U32(int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)&0xfe00 + int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)&0x0001<<16)
  71345 
  71346 	}
  71347 
  71348 	return 0
  71349 }
  71350 
  71351 func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 {
  71352 	bp := tls.Alloc(8)
  71353 	defer tls.Free(8)
  71354 
  71355 	var rc int32
  71356 	var badHdr int32
  71357 
  71358 	rc = walIndexPage(tls, pWal, 0, bp)
  71359 	if rc != SQLITE_OK {
  71360 		if rc == SQLITE_READONLY|int32(5)<<8 {
  71361 			(*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable = U8(1)
  71362 			(*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_HEAPMEMORY_MODE)
  71363 			*(*int32)(unsafe.Pointer(pChanged)) = 1
  71364 		} else {
  71365 			return rc
  71366 		}
  71367 	} else {
  71368 	}
  71369 
  71370 	badHdr = func() int32 {
  71371 		if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
  71372 			return walIndexTryHdr(tls, pWal, pChanged)
  71373 		}
  71374 		return 1
  71375 	}()
  71376 
  71377 	if badHdr != 0 {
  71378 		if int32((*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable) == 0 && int32((*Wal)(unsafe.Pointer(pWal)).FreadOnly)&WAL_SHM_RDONLY != 0 {
  71379 			if SQLITE_OK == libc.AssignInt32(&rc, walLockShared(tls, pWal, WAL_WRITE_LOCK)) {
  71380 				walUnlockShared(tls, pWal, WAL_WRITE_LOCK)
  71381 				rc = SQLITE_READONLY | int32(1)<<8
  71382 			}
  71383 		} else {
  71384 			var bWriteLock int32 = int32((*Wal)(unsafe.Pointer(pWal)).FwriteLock)
  71385 			if bWriteLock != 0 || SQLITE_OK == libc.AssignInt32(&rc, walLockExclusive(tls, pWal, WAL_WRITE_LOCK, 1)) {
  71386 				(*Wal)(unsafe.Pointer(pWal)).FwriteLock = U8(1)
  71387 				if SQLITE_OK == libc.AssignInt32(&rc, walIndexPage(tls, pWal, 0, bp)) {
  71388 					badHdr = walIndexTryHdr(tls, pWal, pChanged)
  71389 					if badHdr != 0 {
  71390 						rc = walIndexRecover(tls, pWal)
  71391 						*(*int32)(unsafe.Pointer(pChanged)) = 1
  71392 					}
  71393 				}
  71394 				if bWriteLock == 0 {
  71395 					(*Wal)(unsafe.Pointer(pWal)).FwriteLock = U8(0)
  71396 					walUnlockExclusive(tls, pWal, WAL_WRITE_LOCK, 1)
  71397 				}
  71398 			}
  71399 		}
  71400 	}
  71401 
  71402 	if badHdr == 0 && (*Wal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != U32(WALINDEX_MAX_VERSION) {
  71403 		rc = Xsqlite3CantopenError(tls, 65686)
  71404 	}
  71405 	if (*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 {
  71406 		if rc != SQLITE_OK {
  71407 			walIndexClose(tls, pWal, 0)
  71408 			(*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable = U8(0)
  71409 
  71410 			if rc == SQLITE_IOERR|int32(2)<<8 {
  71411 				rc = -1
  71412 			}
  71413 		}
  71414 		(*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_NORMAL_MODE)
  71415 	}
  71416 
  71417 	return rc
  71418 }
  71419 
  71420 func walBeginShmUnreliable(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 {
  71421 	bp := tls.Alloc(64)
  71422 	defer tls.Free(64)
  71423 
  71424 	var iOffset I64
  71425 
  71426 	var aFrame uintptr
  71427 	var szFrame int32
  71428 	var aData uintptr
  71429 
  71430 	var rc int32
  71431 
  71432 	var i int32
  71433 	aFrame = uintptr(0)
  71434 
  71435 	rc = walLockShared(tls, pWal, 3+0)
  71436 	if !(rc != SQLITE_OK) {
  71437 		goto __1
  71438 	}
  71439 	if !(rc == SQLITE_BUSY) {
  71440 		goto __2
  71441 	}
  71442 	rc = -1
  71443 __2:
  71444 	;
  71445 	goto begin_unreliable_shm_out
  71446 __1:
  71447 	;
  71448 	(*Wal)(unsafe.Pointer(pWal)).FreadLock = int16(0)
  71449 
  71450 	rc = Xsqlite3OsShmMap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, 0, int32(uint64(unsafe.Sizeof(Ht_slot(0)))*uint64(HASHTABLE_NPAGE*2)+uint64(HASHTABLE_NPAGE)*uint64(unsafe.Sizeof(U32(0)))), 0, bp)
  71451 
  71452 	if !(rc != SQLITE_READONLY|int32(5)<<8) {
  71453 		goto __3
  71454 	}
  71455 	rc = func() int32 {
  71456 		if rc == SQLITE_READONLY {
  71457 			return -1
  71458 		}
  71459 		return rc
  71460 	}()
  71461 	goto begin_unreliable_shm_out
  71462 __3:
  71463 	;
  71464 	libc.Xmemcpy(tls, pWal+72, walIndexHdr(tls, pWal), uint64(unsafe.Sizeof(WalIndexHdr{})))
  71465 
  71466 	rc = Xsqlite3OsFileSize(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, bp+8)
  71467 	if !(rc != SQLITE_OK) {
  71468 		goto __4
  71469 	}
  71470 	goto begin_unreliable_shm_out
  71471 __4:
  71472 	;
  71473 	if !(*(*I64)(unsafe.Pointer(bp + 8)) < int64(WAL_HDRSIZE)) {
  71474 		goto __5
  71475 	}
  71476 
  71477 	*(*int32)(unsafe.Pointer(pChanged)) = 1
  71478 	rc = func() int32 {
  71479 		if (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame == U32(0) {
  71480 			return SQLITE_OK
  71481 		}
  71482 		return -1
  71483 	}()
  71484 	goto begin_unreliable_shm_out
  71485 __5:
  71486 	;
  71487 	rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, bp+16, WAL_HDRSIZE, int64(0))
  71488 	if !(rc != SQLITE_OK) {
  71489 		goto __6
  71490 	}
  71491 	goto begin_unreliable_shm_out
  71492 __6:
  71493 	;
  71494 	if !(libc.Xmemcmp(tls, pWal+72+32, bp+16+16, uint64(8)) != 0) {
  71495 		goto __7
  71496 	}
  71497 
  71498 	rc = -1
  71499 	goto begin_unreliable_shm_out
  71500 __7:
  71501 	;
  71502 	szFrame = int32((*Wal)(unsafe.Pointer(pWal)).FszPage + U32(WAL_FRAME_HDRSIZE))
  71503 	aFrame = Xsqlite3_malloc64(tls, uint64(szFrame))
  71504 	if !(aFrame == uintptr(0)) {
  71505 		goto __8
  71506 	}
  71507 	rc = SQLITE_NOMEM
  71508 	goto begin_unreliable_shm_out
  71509 __8:
  71510 	;
  71511 	aData = aFrame + 24
  71512 
  71513 	*(*U32)(unsafe.Pointer(bp + 48)) = *(*U32)(unsafe.Pointer(pWal + 72 + 24))
  71514 	*(*U32)(unsafe.Pointer(bp + 48 + 1*4)) = *(*U32)(unsafe.Pointer(pWal + 72 + 24 + 1*4))
  71515 	iOffset = int64(WAL_HDRSIZE) + I64((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame+U32(1)-U32(1))*I64((*Wal)(unsafe.Pointer(pWal)).FszPage+U32(WAL_FRAME_HDRSIZE))
  71516 __9:
  71517 	if !(iOffset+I64(szFrame) <= *(*I64)(unsafe.Pointer(bp + 8))) {
  71518 		goto __11
  71519 	}
  71520 
  71521 	rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, aFrame, szFrame, iOffset)
  71522 	if !(rc != SQLITE_OK) {
  71523 		goto __12
  71524 	}
  71525 	goto __11
  71526 __12:
  71527 	;
  71528 	if !!(walDecodeFrame(tls, pWal, bp+56, bp+60, aData, aFrame) != 0) {
  71529 		goto __13
  71530 	}
  71531 	goto __11
  71532 __13:
  71533 	;
  71534 	if !(*(*U32)(unsafe.Pointer(bp + 60)) != 0) {
  71535 		goto __14
  71536 	}
  71537 	rc = -1
  71538 	goto __11
  71539 __14:
  71540 	;
  71541 	goto __10
  71542 __10:
  71543 	iOffset = iOffset + I64(szFrame)
  71544 	goto __9
  71545 	goto __11
  71546 __11:
  71547 	;
  71548 	*(*U32)(unsafe.Pointer(pWal + 72 + 24)) = *(*U32)(unsafe.Pointer(bp + 48))
  71549 	*(*U32)(unsafe.Pointer(pWal + 72 + 24 + 1*4)) = *(*U32)(unsafe.Pointer(bp + 48 + 1*4))
  71550 
  71551 begin_unreliable_shm_out:
  71552 	Xsqlite3_free(tls, aFrame)
  71553 	if !(rc != SQLITE_OK) {
  71554 		goto __15
  71555 	}
  71556 	i = 0
  71557 __16:
  71558 	if !(i < (*Wal)(unsafe.Pointer(pWal)).FnWiData) {
  71559 		goto __18
  71560 	}
  71561 	Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(i)*8)))
  71562 	*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(i)*8)) = uintptr(0)
  71563 	goto __17
  71564 __17:
  71565 	i++
  71566 	goto __16
  71567 	goto __18
  71568 __18:
  71569 	;
  71570 	(*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable = U8(0)
  71571 	Xsqlite3WalEndReadTransaction(tls, pWal)
  71572 	*(*int32)(unsafe.Pointer(pChanged)) = 1
  71573 __15:
  71574 	;
  71575 	return rc
  71576 }
  71577 
  71578 func walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int32, cnt int32) int32 {
  71579 	var pInfo uintptr
  71580 	var mxReadMark U32
  71581 	var mxI int32
  71582 	var i int32
  71583 	var rc int32 = SQLITE_OK
  71584 	var mxFrame U32
  71585 
  71586 	if cnt > 5 {
  71587 		var nDelay int32 = 1
  71588 		if cnt > 100 {
  71589 			return SQLITE_PROTOCOL
  71590 		}
  71591 		if cnt >= 10 {
  71592 			nDelay = (cnt - 9) * (cnt - 9) * 39
  71593 		}
  71594 		Xsqlite3OsSleep(tls, (*Wal)(unsafe.Pointer(pWal)).FpVfs, nDelay)
  71595 	}
  71596 
  71597 	if !(useWal != 0) {
  71598 		if int32((*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable) == 0 {
  71599 			rc = walIndexReadHdr(tls, pWal, pChanged)
  71600 		}
  71601 		if rc == SQLITE_BUSY {
  71602 			if *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData)) == uintptr(0) {
  71603 				rc = -1
  71604 			} else if SQLITE_OK == libc.AssignInt32(&rc, walLockShared(tls, pWal, WAL_RECOVER_LOCK)) {
  71605 				walUnlockShared(tls, pWal, WAL_RECOVER_LOCK)
  71606 				rc = -1
  71607 			} else if rc == SQLITE_BUSY {
  71608 				rc = SQLITE_BUSY | int32(1)<<8
  71609 			}
  71610 		}
  71611 		if rc != SQLITE_OK {
  71612 			return rc
  71613 		} else if (*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 {
  71614 			return walBeginShmUnreliable(tls, pWal, pChanged)
  71615 		}
  71616 	}
  71617 
  71618 	libc.AtomicStoreUintptr(&pInfo, walCkptInfo(tls, pWal))
  71619 	if !(useWal != 0) && libc.AtomicLoadNUint32(pInfo, 0) == (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame &&
  71620 		((*Wal)(unsafe.Pointer(pWal)).FpSnapshot == uintptr(0) || (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame == U32(0)) {
  71621 		rc = walLockShared(tls, pWal, 3+0)
  71622 		walShmBarrier(tls, pWal)
  71623 		if rc == SQLITE_OK {
  71624 			if libc.Xmemcmp(tls, walIndexHdr(tls, pWal), pWal+72, uint64(unsafe.Sizeof(WalIndexHdr{}))) != 0 {
  71625 				walUnlockShared(tls, pWal, 3+0)
  71626 				return -1
  71627 			}
  71628 			(*Wal)(unsafe.Pointer(pWal)).FreadLock = int16(0)
  71629 			return SQLITE_OK
  71630 		} else if rc != SQLITE_BUSY {
  71631 			return rc
  71632 		}
  71633 	}
  71634 
  71635 	mxReadMark = U32(0)
  71636 	mxI = 0
  71637 	mxFrame = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
  71638 	if (*Wal)(unsafe.Pointer(pWal)).FpSnapshot != 0 && (*WalIndexHdr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FpSnapshot)).FmxFrame < mxFrame {
  71639 		mxFrame = (*WalIndexHdr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FpSnapshot)).FmxFrame
  71640 	}
  71641 	for i = 1; i < SQLITE_SHM_NLOCK-3; i++ {
  71642 		var thisMark U32 = libc.AtomicLoadNUint32(pInfo+4+uintptr(i)*4, 0)
  71643 		if mxReadMark <= thisMark && thisMark <= mxFrame {
  71644 			mxReadMark = thisMark
  71645 			mxI = i
  71646 		}
  71647 	}
  71648 	if int32((*Wal)(unsafe.Pointer(pWal)).FreadOnly)&WAL_SHM_RDONLY == 0 &&
  71649 		(mxReadMark < mxFrame || mxI == 0) {
  71650 		for i = 1; i < SQLITE_SHM_NLOCK-3; i++ {
  71651 			rc = walLockExclusive(tls, pWal, 3+i, 1)
  71652 			if rc == SQLITE_OK {
  71653 				libc.AtomicStoreNUint32(pInfo+4+uintptr(i)*4, mxFrame, 0)
  71654 				mxReadMark = mxFrame
  71655 				mxI = i
  71656 				walUnlockExclusive(tls, pWal, 3+i, 1)
  71657 				break
  71658 			} else if rc != SQLITE_BUSY {
  71659 				return rc
  71660 			}
  71661 		}
  71662 	}
  71663 	if mxI == 0 {
  71664 		if rc == SQLITE_BUSY {
  71665 			return -1
  71666 		}
  71667 		return SQLITE_READONLY | int32(5)<<8
  71668 	}
  71669 
  71670 	rc = walLockShared(tls, pWal, 3+mxI)
  71671 	if rc != 0 {
  71672 		if rc == SQLITE_BUSY {
  71673 			return -1
  71674 		}
  71675 		return rc
  71676 	}
  71677 
  71678 	(*Wal)(unsafe.Pointer(pWal)).FminFrame = libc.AtomicLoadNUint32(pInfo, 0) + 1
  71679 	walShmBarrier(tls, pWal)
  71680 	if libc.AtomicLoadNUint32(pInfo+4+uintptr(mxI)*4, 0) != mxReadMark ||
  71681 		libc.Xmemcmp(tls, walIndexHdr(tls, pWal), pWal+72, uint64(unsafe.Sizeof(WalIndexHdr{}))) != 0 {
  71682 		walUnlockShared(tls, pWal, 3+mxI)
  71683 		return -1
  71684 	} else {
  71685 		(*Wal)(unsafe.Pointer(pWal)).FreadLock = I16(mxI)
  71686 	}
  71687 	return rc
  71688 }
  71689 
  71690 // Attempt to reduce the value of the WalCkptInfo.nBackfillAttempted
  71691 // variable so that older snapshots can be accessed. To do this, loop
  71692 // through all wal frames from nBackfillAttempted to (nBackfill+1),
  71693 // comparing their content to the corresponding page with the database
  71694 // file, if any. Set nBackfillAttempted to the frame number of the
  71695 // first frame for which the wal file content matches the db file.
  71696 //
  71697 // This is only really safe if the file-system is such that any page
  71698 // writes made by earlier checkpointers were atomic operations, which
  71699 // is not always true. It is also possible that nBackfillAttempted
  71700 // may be left set to a value larger than expected, if a wal frame
  71701 // contains content that duplicate of an earlier version of the same
  71702 // page.
  71703 //
  71704 // SQLITE_OK is returned if successful, or an SQLite error code if an
  71705 // error occurs. It is not an error if nBackfillAttempted cannot be
  71706 // decreased at all.
  71707 func Xsqlite3WalSnapshotRecover(tls *libc.TLS, pWal uintptr) int32 {
  71708 	bp := tls.Alloc(32)
  71709 	defer tls.Free(32)
  71710 
  71711 	var rc int32
  71712 
  71713 	rc = walLockExclusive(tls, pWal, WAL_CKPT_LOCK, 1)
  71714 	if rc == SQLITE_OK {
  71715 		var pInfo uintptr = walCkptInfo(tls, pWal)
  71716 		var szPage int32 = int32((*Wal)(unsafe.Pointer(pWal)).FszPage)
  71717 
  71718 		rc = Xsqlite3OsFileSize(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, bp)
  71719 		if rc == SQLITE_OK {
  71720 			var pBuf1 uintptr = Xsqlite3_malloc(tls, szPage)
  71721 			var pBuf2 uintptr = Xsqlite3_malloc(tls, szPage)
  71722 			if pBuf1 == uintptr(0) || pBuf2 == uintptr(0) {
  71723 				rc = SQLITE_NOMEM
  71724 			} else {
  71725 				var i U32 = (*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted
  71726 				for i = (*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted; i > libc.AtomicLoadNUint32(pInfo, 0); i-- {
  71727 					var pgno U32
  71728 					var iDbOff I64
  71729 					var iWalOff I64
  71730 
  71731 					rc = walHashGet(tls, pWal, walFramePage(tls, i), bp+8)
  71732 					if rc != SQLITE_OK {
  71733 						break
  71734 					}
  71735 
  71736 					pgno = *(*U32)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp+8)).FaPgno + uintptr(i-(*WalHashLoc)(unsafe.Pointer(bp+8)).FiZero-U32(1))*4))
  71737 					iDbOff = I64(pgno-U32(1)) * I64(szPage)
  71738 
  71739 					if iDbOff+I64(szPage) <= *(*I64)(unsafe.Pointer(bp)) {
  71740 						iWalOff = int64(WAL_HDRSIZE) + I64(i-U32(1))*I64(szPage+WAL_FRAME_HDRSIZE) + int64(WAL_FRAME_HDRSIZE)
  71741 						rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, pBuf1, szPage, iWalOff)
  71742 
  71743 						if rc == SQLITE_OK {
  71744 							rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, pBuf2, szPage, iDbOff)
  71745 						}
  71746 
  71747 						if rc != SQLITE_OK || 0 == libc.Xmemcmp(tls, pBuf1, pBuf2, uint64(szPage)) {
  71748 							break
  71749 						}
  71750 					}
  71751 
  71752 					(*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted = i - U32(1)
  71753 				}
  71754 			}
  71755 
  71756 			Xsqlite3_free(tls, pBuf1)
  71757 			Xsqlite3_free(tls, pBuf2)
  71758 		}
  71759 		walUnlockExclusive(tls, pWal, WAL_CKPT_LOCK, 1)
  71760 	}
  71761 
  71762 	return rc
  71763 }
  71764 
  71765 // Begin a read transaction on the database.
  71766 //
  71767 // This routine used to be called sqlite3OpenSnapshot() and with good reason:
  71768 // it takes a snapshot of the state of the WAL and wal-index for the current
  71769 // instant in time.  The current thread will continue to use this snapshot.
  71770 // Other threads might append new content to the WAL and wal-index but
  71771 // that extra content is ignored by the current thread.
  71772 //
  71773 // If the database contents have changes since the previous read
  71774 // transaction, then *pChanged is set to 1 before returning.  The
  71775 // Pager layer will use this to know that its cache is stale and
  71776 // needs to be flushed.
  71777 func Xsqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 {
  71778 	var rc int32
  71779 	var cnt int32 = 0
  71780 	var bChanged int32 = 0
  71781 	var pSnapshot uintptr = (*Wal)(unsafe.Pointer(pWal)).FpSnapshot
  71782 
  71783 	if pSnapshot != 0 {
  71784 		if libc.Xmemcmp(tls, pSnapshot, pWal+72, uint64(unsafe.Sizeof(WalIndexHdr{}))) != 0 {
  71785 			bChanged = 1
  71786 		}
  71787 
  71788 		rc = walLockShared(tls, pWal, WAL_CKPT_LOCK)
  71789 
  71790 		if rc != SQLITE_OK {
  71791 			return rc
  71792 		}
  71793 		(*Wal)(unsafe.Pointer(pWal)).FckptLock = U8(1)
  71794 	}
  71795 
  71796 	for __ccgo := true; __ccgo; __ccgo = rc == -1 {
  71797 		rc = walTryBeginRead(tls, pWal, pChanged, 0, libc.PreIncInt32(&cnt, 1))
  71798 	}
  71799 
  71800 	if rc == SQLITE_OK {
  71801 		if pSnapshot != 0 && libc.Xmemcmp(tls, pSnapshot, pWal+72, uint64(unsafe.Sizeof(WalIndexHdr{}))) != 0 {
  71802 			var pInfo uintptr = walCkptInfo(tls, pWal)
  71803 
  71804 			if !(libc.Xmemcmp(tls, pSnapshot+32, pWal+72+32, uint64(unsafe.Sizeof([2]U32{}))) != 0) &&
  71805 				(*WalIndexHdr)(unsafe.Pointer(pSnapshot)).FmxFrame >= (*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted {
  71806 				libc.Xmemcpy(tls, pWal+72, pSnapshot, uint64(unsafe.Sizeof(WalIndexHdr{})))
  71807 				*(*int32)(unsafe.Pointer(pChanged)) = bChanged
  71808 			} else {
  71809 				rc = SQLITE_ERROR | int32(3)<<8
  71810 			}
  71811 
  71812 			(*Wal)(unsafe.Pointer(pWal)).FminFrame = U32(1)
  71813 
  71814 			if rc != SQLITE_OK {
  71815 				Xsqlite3WalEndReadTransaction(tls, pWal)
  71816 			}
  71817 		}
  71818 	}
  71819 
  71820 	if (*Wal)(unsafe.Pointer(pWal)).FckptLock != 0 {
  71821 		walUnlockShared(tls, pWal, WAL_CKPT_LOCK)
  71822 		(*Wal)(unsafe.Pointer(pWal)).FckptLock = U8(0)
  71823 	}
  71824 	return rc
  71825 }
  71826 
  71827 // Finish with a read transaction.  All this does is release the
  71828 // read-lock.
  71829 func Xsqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) {
  71830 	Xsqlite3WalEndWriteTransaction(tls, pWal)
  71831 	if int32((*Wal)(unsafe.Pointer(pWal)).FreadLock) >= 0 {
  71832 		walUnlockShared(tls, pWal, 3+int32((*Wal)(unsafe.Pointer(pWal)).FreadLock))
  71833 		(*Wal)(unsafe.Pointer(pWal)).FreadLock = int16(-1)
  71834 	}
  71835 }
  71836 
  71837 // Search the wal file for page pgno. If found, set *piRead to the frame that
  71838 // contains the page. Otherwise, if pgno is not in the wal file, set *piRead
  71839 // to zero.
  71840 //
  71841 // Return SQLITE_OK if successful, or an error code if an error occurs. If an
  71842 // error does occur, the final value of *piRead is undefined.
  71843 func Xsqlite3WalFindFrame(tls *libc.TLS, pWal uintptr, pgno Pgno, piRead uintptr) int32 {
  71844 	bp := tls.Alloc(24)
  71845 	defer tls.Free(24)
  71846 
  71847 	var iRead U32 = U32(0)
  71848 	var iLast U32 = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
  71849 	var iHash int32
  71850 	var iMinHash int32
  71851 
  71852 	if iLast == U32(0) || int32((*Wal)(unsafe.Pointer(pWal)).FreadLock) == 0 && int32((*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable) == 0 {
  71853 		*(*U32)(unsafe.Pointer(piRead)) = U32(0)
  71854 		return SQLITE_OK
  71855 	}
  71856 
  71857 	iMinHash = walFramePage(tls, (*Wal)(unsafe.Pointer(pWal)).FminFrame)
  71858 	for iHash = walFramePage(tls, iLast); iHash >= iMinHash; iHash-- {
  71859 		var iKey int32
  71860 		var nCollide int32
  71861 		var rc int32
  71862 		var iH U32
  71863 
  71864 		rc = walHashGet(tls, pWal, iHash, bp)
  71865 		if rc != SQLITE_OK {
  71866 			return rc
  71867 		}
  71868 		nCollide = HASHTABLE_NPAGE * 2
  71869 		iKey = walHash(tls, pgno)
  71870 		for libc.AssignUint32(&iH, U32(libc.AtomicLoadNUint16((*WalHashLoc)(unsafe.Pointer(bp)).FaHash+uintptr(iKey)*2, 0))) != U32(0) {
  71871 			var iFrame U32 = iH + (*WalHashLoc)(unsafe.Pointer(bp)).FiZero
  71872 			if iFrame <= iLast && iFrame >= (*Wal)(unsafe.Pointer(pWal)).FminFrame && *(*U32)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp)).FaPgno + uintptr(iH-U32(1))*4)) == pgno {
  71873 				iRead = iFrame
  71874 			}
  71875 			if libc.PostDecInt32(&nCollide, 1) == 0 {
  71876 				return Xsqlite3CorruptError(tls, 66423)
  71877 			}
  71878 			iKey = walNextHash(tls, iKey)
  71879 		}
  71880 		if iRead != 0 {
  71881 			break
  71882 		}
  71883 	}
  71884 
  71885 	*(*U32)(unsafe.Pointer(piRead)) = iRead
  71886 	return SQLITE_OK
  71887 }
  71888 
  71889 // Read the contents of frame iRead from the wal file into buffer pOut
  71890 // (which is nOut bytes in size). Return SQLITE_OK if successful, or an
  71891 // error code otherwise.
  71892 func Xsqlite3WalReadFrame(tls *libc.TLS, pWal uintptr, iRead U32, nOut int32, pOut uintptr) int32 {
  71893 	var sz int32
  71894 	var iOffset I64
  71895 	sz = int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)
  71896 	sz = sz&0xfe00 + sz&0x0001<<16
  71897 
  71898 	iOffset = int64(WAL_HDRSIZE) + I64(iRead-U32(1))*I64(sz+WAL_FRAME_HDRSIZE) + int64(WAL_FRAME_HDRSIZE)
  71899 
  71900 	return Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, pOut, func() int32 {
  71901 		if nOut > sz {
  71902 			return sz
  71903 		}
  71904 		return nOut
  71905 	}(), iOffset)
  71906 }
  71907 
  71908 // Return the size of the database in pages (or zero, if unknown).
  71909 func Xsqlite3WalDbsize(tls *libc.TLS, pWal uintptr) Pgno {
  71910 	if pWal != 0 && int32((*Wal)(unsafe.Pointer(pWal)).FreadLock) >= 0 {
  71911 		return (*Wal)(unsafe.Pointer(pWal)).Fhdr.FnPage
  71912 	}
  71913 	return Pgno(0)
  71914 }
  71915 
  71916 // This function starts a write transaction on the WAL.
  71917 //
  71918 // A read transaction must have already been started by a prior call
  71919 // to sqlite3WalBeginReadTransaction().
  71920 //
  71921 // If another thread or process has written into the database since
  71922 // the read transaction was started, then it is not possible for this
  71923 // thread to write as doing so would cause a fork.  So this routine
  71924 // returns SQLITE_BUSY in that case and no write transaction is started.
  71925 //
  71926 // There can only be a single writer active at a time.
  71927 func Xsqlite3WalBeginWriteTransaction(tls *libc.TLS, pWal uintptr) int32 {
  71928 	var rc int32
  71929 
  71930 	if (*Wal)(unsafe.Pointer(pWal)).FreadOnly != 0 {
  71931 		return SQLITE_READONLY
  71932 	}
  71933 
  71934 	rc = walLockExclusive(tls, pWal, WAL_WRITE_LOCK, 1)
  71935 	if rc != 0 {
  71936 		return rc
  71937 	}
  71938 	(*Wal)(unsafe.Pointer(pWal)).FwriteLock = U8(1)
  71939 
  71940 	if libc.Xmemcmp(tls, pWal+72, walIndexHdr(tls, pWal), uint64(unsafe.Sizeof(WalIndexHdr{}))) != 0 {
  71941 		walUnlockExclusive(tls, pWal, WAL_WRITE_LOCK, 1)
  71942 		(*Wal)(unsafe.Pointer(pWal)).FwriteLock = U8(0)
  71943 		rc = SQLITE_BUSY | int32(2)<<8
  71944 	}
  71945 
  71946 	return rc
  71947 }
  71948 
  71949 // End a write transaction.  The commit has already been done.  This
  71950 // routine merely releases the lock.
  71951 func Xsqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) int32 {
  71952 	if (*Wal)(unsafe.Pointer(pWal)).FwriteLock != 0 {
  71953 		walUnlockExclusive(tls, pWal, WAL_WRITE_LOCK, 1)
  71954 		(*Wal)(unsafe.Pointer(pWal)).FwriteLock = U8(0)
  71955 		(*Wal)(unsafe.Pointer(pWal)).FiReCksum = U32(0)
  71956 		(*Wal)(unsafe.Pointer(pWal)).FtruncateOnCommit = U8(0)
  71957 	}
  71958 	return SQLITE_OK
  71959 }
  71960 
  71961 // If any data has been written (but not committed) to the log file, this
  71962 // function moves the write-pointer back to the start of the transaction.
  71963 //
  71964 // Additionally, the callback function is invoked for each frame written
  71965 // to the WAL since the start of the transaction. If the callback returns
  71966 // other than SQLITE_OK, it is not invoked again and the error code is
  71967 // returned to the caller.
  71968 //
  71969 // Otherwise, if the callback function does not return an error, this
  71970 // function returns SQLITE_OK.
  71971 func Xsqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) int32 {
  71972 	var rc int32 = SQLITE_OK
  71973 	if (*Wal)(unsafe.Pointer(pWal)).FwriteLock != 0 {
  71974 		var iMax Pgno = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
  71975 		var iFrame Pgno
  71976 
  71977 		libc.Xmemcpy(tls, pWal+72, walIndexHdr(tls, pWal), uint64(unsafe.Sizeof(WalIndexHdr{})))
  71978 
  71979 		for iFrame = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame + U32(1); rc == SQLITE_OK && iFrame <= iMax; iFrame++ {
  71980 			rc = (*struct {
  71981 				f func(*libc.TLS, uintptr, Pgno) int32
  71982 			})(unsafe.Pointer(&struct{ uintptr }{xUndo})).f(tls, pUndoCtx, walFramePgno(tls, pWal, iFrame))
  71983 		}
  71984 		if iMax != (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame {
  71985 			walCleanupHash(tls, pWal)
  71986 		}
  71987 	}
  71988 	return rc
  71989 }
  71990 
  71991 // Argument aWalData must point to an array of WAL_SAVEPOINT_NDATA u32
  71992 // values. This function populates the array with values required to
  71993 // "rollback" the write position of the WAL handle back to the current
  71994 // point in the event of a savepoint rollback (via WalSavepointUndo()).
  71995 func Xsqlite3WalSavepoint(tls *libc.TLS, pWal uintptr, aWalData uintptr) {
  71996 	*(*U32)(unsafe.Pointer(aWalData)) = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
  71997 	*(*U32)(unsafe.Pointer(aWalData + 1*4)) = *(*U32)(unsafe.Pointer(pWal + 72 + 24))
  71998 	*(*U32)(unsafe.Pointer(aWalData + 2*4)) = *(*U32)(unsafe.Pointer(pWal + 72 + 24 + 1*4))
  71999 	*(*U32)(unsafe.Pointer(aWalData + 3*4)) = (*Wal)(unsafe.Pointer(pWal)).FnCkpt
  72000 }
  72001 
  72002 // Move the write position of the WAL back to the point identified by
  72003 // the values in the aWalData[] array. aWalData must point to an array
  72004 // of WAL_SAVEPOINT_NDATA u32 values that has been previously populated
  72005 // by a call to WalSavepoint().
  72006 func Xsqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) int32 {
  72007 	var rc int32 = SQLITE_OK
  72008 
  72009 	if *(*U32)(unsafe.Pointer(aWalData + 3*4)) != (*Wal)(unsafe.Pointer(pWal)).FnCkpt {
  72010 		*(*U32)(unsafe.Pointer(aWalData)) = U32(0)
  72011 		*(*U32)(unsafe.Pointer(aWalData + 3*4)) = (*Wal)(unsafe.Pointer(pWal)).FnCkpt
  72012 	}
  72013 
  72014 	if *(*U32)(unsafe.Pointer(aWalData)) < (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame {
  72015 		(*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame = *(*U32)(unsafe.Pointer(aWalData))
  72016 		*(*U32)(unsafe.Pointer(pWal + 72 + 24)) = *(*U32)(unsafe.Pointer(aWalData + 1*4))
  72017 		*(*U32)(unsafe.Pointer(pWal + 72 + 24 + 1*4)) = *(*U32)(unsafe.Pointer(aWalData + 2*4))
  72018 		walCleanupHash(tls, pWal)
  72019 	}
  72020 
  72021 	return rc
  72022 }
  72023 
  72024 func walRestartLog(tls *libc.TLS, pWal uintptr) int32 {
  72025 	bp := tls.Alloc(8)
  72026 	defer tls.Free(8)
  72027 
  72028 	var rc int32 = SQLITE_OK
  72029 	var cnt int32
  72030 
  72031 	if int32((*Wal)(unsafe.Pointer(pWal)).FreadLock) == 0 {
  72032 		var pInfo uintptr = walCkptInfo(tls, pWal)
  72033 
  72034 		if (*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill > U32(0) {
  72035 			Xsqlite3_randomness(tls, 4, bp)
  72036 			rc = walLockExclusive(tls, pWal, 3+1, SQLITE_SHM_NLOCK-3-1)
  72037 			if rc == SQLITE_OK {
  72038 				walRestartHdr(tls, pWal, *(*U32)(unsafe.Pointer(bp)))
  72039 				walUnlockExclusive(tls, pWal, 3+1, SQLITE_SHM_NLOCK-3-1)
  72040 			} else if rc != SQLITE_BUSY {
  72041 				return rc
  72042 			}
  72043 		}
  72044 		walUnlockShared(tls, pWal, 3+0)
  72045 		(*Wal)(unsafe.Pointer(pWal)).FreadLock = int16(-1)
  72046 		cnt = 0
  72047 		for __ccgo := true; __ccgo; __ccgo = rc == -1 {
  72048 			rc = walTryBeginRead(tls, pWal, bp+4, 1, libc.PreIncInt32(&cnt, 1))
  72049 		}
  72050 
  72051 	}
  72052 	return rc
  72053 }
  72054 
  72055 // Information about the current state of the WAL file and where
  72056 // the next fsync should occur - passed from sqlite3WalFrames() into
  72057 // walWriteToLog().
  72058 type WalWriter1 = struct {
  72059 	FpWal       uintptr
  72060 	FpFd        uintptr
  72061 	FiSyncPoint Sqlite3_int64
  72062 	FsyncFlags  int32
  72063 	FszPage     int32
  72064 }
  72065 
  72066 // Information about the current state of the WAL file and where
  72067 // the next fsync should occur - passed from sqlite3WalFrames() into
  72068 // walWriteToLog().
  72069 type WalWriter = WalWriter1
  72070 
  72071 func walWriteToLog(tls *libc.TLS, p uintptr, pContent uintptr, iAmt int32, iOffset Sqlite3_int64) int32 {
  72072 	var rc int32
  72073 	if iOffset < (*WalWriter)(unsafe.Pointer(p)).FiSyncPoint && iOffset+Sqlite3_int64(iAmt) >= (*WalWriter)(unsafe.Pointer(p)).FiSyncPoint {
  72074 		var iFirstAmt int32 = int32((*WalWriter)(unsafe.Pointer(p)).FiSyncPoint - iOffset)
  72075 		rc = Xsqlite3OsWrite(tls, (*WalWriter)(unsafe.Pointer(p)).FpFd, pContent, iFirstAmt, iOffset)
  72076 		if rc != 0 {
  72077 			return rc
  72078 		}
  72079 		iOffset = iOffset + Sqlite3_int64(iFirstAmt)
  72080 		iAmt = iAmt - iFirstAmt
  72081 		pContent = uintptr(iFirstAmt) + pContent
  72082 
  72083 		rc = Xsqlite3OsSync(tls, (*WalWriter)(unsafe.Pointer(p)).FpFd, (*WalWriter)(unsafe.Pointer(p)).FsyncFlags&0x03)
  72084 		if iAmt == 0 || rc != 0 {
  72085 			return rc
  72086 		}
  72087 	}
  72088 	rc = Xsqlite3OsWrite(tls, (*WalWriter)(unsafe.Pointer(p)).FpFd, pContent, iAmt, iOffset)
  72089 	return rc
  72090 }
  72091 
  72092 func walWriteOneFrame(tls *libc.TLS, p uintptr, pPage uintptr, nTruncate int32, iOffset Sqlite3_int64) int32 {
  72093 	bp := tls.Alloc(24)
  72094 	defer tls.Free(24)
  72095 
  72096 	var rc int32
  72097 	var pData uintptr
  72098 
  72099 	pData = (*PgHdr)(unsafe.Pointer(pPage)).FpData
  72100 	walEncodeFrame(tls, (*WalWriter)(unsafe.Pointer(p)).FpWal, (*PgHdr)(unsafe.Pointer(pPage)).Fpgno, uint32(nTruncate), pData, bp)
  72101 	rc = walWriteToLog(tls, p, bp, int32(unsafe.Sizeof([24]U8{})), iOffset)
  72102 	if rc != 0 {
  72103 		return rc
  72104 	}
  72105 
  72106 	rc = walWriteToLog(tls, p, pData, (*WalWriter)(unsafe.Pointer(p)).FszPage, int64(uint64(iOffset)+uint64(unsafe.Sizeof([24]U8{}))))
  72107 	return rc
  72108 }
  72109 
  72110 func walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast U32) int32 {
  72111 	bp := tls.Alloc(24)
  72112 	defer tls.Free(24)
  72113 
  72114 	var szPage int32 = int32((*Wal)(unsafe.Pointer(pWal)).FszPage)
  72115 	var rc int32 = SQLITE_OK
  72116 	var aBuf uintptr
  72117 
  72118 	var iRead U32
  72119 	var iCksumOff I64
  72120 
  72121 	aBuf = Xsqlite3_malloc(tls, szPage+WAL_FRAME_HDRSIZE)
  72122 	if aBuf == uintptr(0) {
  72123 		return SQLITE_NOMEM
  72124 	}
  72125 
  72126 	if (*Wal)(unsafe.Pointer(pWal)).FiReCksum == U32(1) {
  72127 		iCksumOff = int64(24)
  72128 	} else {
  72129 		iCksumOff = int64(WAL_HDRSIZE) + I64((*Wal)(unsafe.Pointer(pWal)).FiReCksum-U32(1)-U32(1))*I64(szPage+WAL_FRAME_HDRSIZE) + int64(16)
  72130 	}
  72131 	rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, aBuf, int32(uint64(unsafe.Sizeof(U32(0)))*uint64(2)), iCksumOff)
  72132 	*(*U32)(unsafe.Pointer(pWal + 72 + 24)) = Xsqlite3Get4byte(tls, aBuf)
  72133 	*(*U32)(unsafe.Pointer(pWal + 72 + 24 + 1*4)) = Xsqlite3Get4byte(tls, aBuf+4)
  72134 
  72135 	iRead = (*Wal)(unsafe.Pointer(pWal)).FiReCksum
  72136 	(*Wal)(unsafe.Pointer(pWal)).FiReCksum = U32(0)
  72137 	for ; rc == SQLITE_OK && iRead <= iLast; iRead++ {
  72138 		var iOff I64 = int64(WAL_HDRSIZE) + I64(iRead-U32(1))*I64(szPage+WAL_FRAME_HDRSIZE)
  72139 		rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, aBuf, szPage+WAL_FRAME_HDRSIZE, iOff)
  72140 		if rc == SQLITE_OK {
  72141 			var iPgno U32
  72142 			var nDbSize U32
  72143 			iPgno = Xsqlite3Get4byte(tls, aBuf)
  72144 			nDbSize = Xsqlite3Get4byte(tls, aBuf+4)
  72145 
  72146 			walEncodeFrame(tls, pWal, iPgno, nDbSize, aBuf+24, bp)
  72147 			rc = Xsqlite3OsWrite(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, bp, int32(unsafe.Sizeof([24]U8{})), iOff)
  72148 		}
  72149 	}
  72150 
  72151 	Xsqlite3_free(tls, aBuf)
  72152 	return rc
  72153 }
  72154 
  72155 // Write a set of frames to the log. The caller must hold the write-lock
  72156 // on the log file (obtained using sqlite3WalBeginWriteTransaction()).
  72157 func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTruncate Pgno, isCommit int32, sync_flags int32) int32 {
  72158 	bp := tls.Alloc(80)
  72159 	defer tls.Free(80)
  72160 
  72161 	var rc int32
  72162 	var iFrame U32
  72163 	var p uintptr
  72164 	var pLast uintptr = uintptr(0)
  72165 	var nExtra int32 = 0
  72166 	var szFrame int32
  72167 	var iOffset I64
  72168 
  72169 	var iFirst U32 = U32(0)
  72170 	var pLive uintptr
  72171 
  72172 	pLive = walIndexHdr(tls, pWal)
  72173 	if libc.Xmemcmp(tls, pWal+72, pLive, uint64(unsafe.Sizeof(WalIndexHdr{}))) != 0 {
  72174 		iFirst = (*WalIndexHdr)(unsafe.Pointer(pLive)).FmxFrame + U32(1)
  72175 	}
  72176 
  72177 	if SQLITE_OK != libc.AssignInt32(&rc, walRestartLog(tls, pWal)) {
  72178 		return rc
  72179 	}
  72180 
  72181 	iFrame = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
  72182 	if iFrame == U32(0) {
  72183 		Xsqlite3Put4byte(tls, bp, uint32(WAL_MAGIC|SQLITE_BIGENDIAN))
  72184 		Xsqlite3Put4byte(tls, bp+4, uint32(WAL_MAX_VERSION))
  72185 		Xsqlite3Put4byte(tls, bp+8, uint32(szPage))
  72186 		Xsqlite3Put4byte(tls, bp+12, (*Wal)(unsafe.Pointer(pWal)).FnCkpt)
  72187 		if (*Wal)(unsafe.Pointer(pWal)).FnCkpt == U32(0) {
  72188 			Xsqlite3_randomness(tls, 8, pWal+72+32)
  72189 		}
  72190 		libc.Xmemcpy(tls, bp+16, pWal+72+32, uint64(8))
  72191 		walChecksumBytes(tls, 1, bp, WAL_HDRSIZE-2*4, uintptr(0), bp+32)
  72192 		Xsqlite3Put4byte(tls, bp+24, *(*U32)(unsafe.Pointer(bp + 32)))
  72193 		Xsqlite3Put4byte(tls, bp+28, *(*U32)(unsafe.Pointer(bp + 32 + 1*4)))
  72194 
  72195 		(*Wal)(unsafe.Pointer(pWal)).FszPage = U32(szPage)
  72196 		(*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum = U8(SQLITE_BIGENDIAN)
  72197 		*(*U32)(unsafe.Pointer(pWal + 72 + 24)) = *(*U32)(unsafe.Pointer(bp + 32))
  72198 		*(*U32)(unsafe.Pointer(pWal + 72 + 24 + 1*4)) = *(*U32)(unsafe.Pointer(bp + 32 + 1*4))
  72199 		(*Wal)(unsafe.Pointer(pWal)).FtruncateOnCommit = U8(1)
  72200 
  72201 		rc = Xsqlite3OsWrite(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, bp, int32(unsafe.Sizeof([32]U8{})), int64(0))
  72202 
  72203 		if rc != SQLITE_OK {
  72204 			return rc
  72205 		}
  72206 
  72207 		if (*Wal)(unsafe.Pointer(pWal)).FsyncHeader != 0 {
  72208 			rc = Xsqlite3OsSync(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, sync_flags>>2&0x03)
  72209 			if rc != 0 {
  72210 				return rc
  72211 			}
  72212 		}
  72213 	}
  72214 
  72215 	(*WalWriter)(unsafe.Pointer(bp + 48)).FpWal = pWal
  72216 	(*WalWriter)(unsafe.Pointer(bp + 48)).FpFd = (*Wal)(unsafe.Pointer(pWal)).FpWalFd
  72217 	(*WalWriter)(unsafe.Pointer(bp + 48)).FiSyncPoint = int64(0)
  72218 	(*WalWriter)(unsafe.Pointer(bp + 48)).FsyncFlags = sync_flags
  72219 	(*WalWriter)(unsafe.Pointer(bp + 48)).FszPage = szPage
  72220 	iOffset = int64(WAL_HDRSIZE) + I64(iFrame+U32(1)-U32(1))*I64(szPage+WAL_FRAME_HDRSIZE)
  72221 	szFrame = szPage + WAL_FRAME_HDRSIZE
  72222 
  72223 	for p = pList; p != 0; p = (*PgHdr)(unsafe.Pointer(p)).FpDirty {
  72224 		var nDbSize int32
  72225 
  72226 		if iFirst != 0 && ((*PgHdr)(unsafe.Pointer(p)).FpDirty != 0 || isCommit == 0) {
  72227 			*(*U32)(unsafe.Pointer(bp + 40)) = U32(0)
  72228 			Xsqlite3WalFindFrame(tls, pWal, (*PgHdr)(unsafe.Pointer(p)).Fpgno, bp+40)
  72229 
  72230 			if *(*U32)(unsafe.Pointer(bp + 40)) >= iFirst {
  72231 				var iOff I64 = int64(WAL_HDRSIZE) + I64(*(*U32)(unsafe.Pointer(bp + 40))-U32(1))*I64(szPage+WAL_FRAME_HDRSIZE) + int64(WAL_FRAME_HDRSIZE)
  72232 				var pData uintptr
  72233 				if (*Wal)(unsafe.Pointer(pWal)).FiReCksum == U32(0) || *(*U32)(unsafe.Pointer(bp + 40)) < (*Wal)(unsafe.Pointer(pWal)).FiReCksum {
  72234 					(*Wal)(unsafe.Pointer(pWal)).FiReCksum = *(*U32)(unsafe.Pointer(bp + 40))
  72235 				}
  72236 				pData = (*PgHdr)(unsafe.Pointer(p)).FpData
  72237 				rc = Xsqlite3OsWrite(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, pData, szPage, iOff)
  72238 				if rc != 0 {
  72239 					return rc
  72240 				}
  72241 				*(*U16)(unsafe.Pointer(p + 52)) &= libc.Uint16FromInt32(libc.CplInt32(PGHDR_WAL_APPEND))
  72242 				continue
  72243 			}
  72244 		}
  72245 
  72246 		iFrame++
  72247 
  72248 		if isCommit != 0 && (*PgHdr)(unsafe.Pointer(p)).FpDirty == uintptr(0) {
  72249 			nDbSize = int32(nTruncate)
  72250 		} else {
  72251 			nDbSize = 0
  72252 		}
  72253 		rc = walWriteOneFrame(tls, bp+48, p, nDbSize, iOffset)
  72254 		if rc != 0 {
  72255 			return rc
  72256 		}
  72257 		pLast = p
  72258 		iOffset = iOffset + I64(szFrame)
  72259 		*(*U16)(unsafe.Pointer(p + 52)) |= U16(PGHDR_WAL_APPEND)
  72260 	}
  72261 
  72262 	if isCommit != 0 && (*Wal)(unsafe.Pointer(pWal)).FiReCksum != 0 {
  72263 		rc = walRewriteChecksums(tls, pWal, iFrame)
  72264 		if rc != 0 {
  72265 			return rc
  72266 		}
  72267 	}
  72268 
  72269 	if isCommit != 0 && sync_flags&0x03 != 0 {
  72270 		var bSync int32 = 1
  72271 		if (*Wal)(unsafe.Pointer(pWal)).FpadToSectorBoundary != 0 {
  72272 			var sectorSize int32 = Xsqlite3SectorSize(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd)
  72273 			(*WalWriter)(unsafe.Pointer(bp + 48)).FiSyncPoint = (iOffset + I64(sectorSize) - int64(1)) / I64(sectorSize) * I64(sectorSize)
  72274 			bSync = libc.Bool32((*WalWriter)(unsafe.Pointer(bp+48)).FiSyncPoint == iOffset)
  72275 
  72276 			for iOffset < (*WalWriter)(unsafe.Pointer(bp+48)).FiSyncPoint {
  72277 				rc = walWriteOneFrame(tls, bp+48, pLast, int32(nTruncate), iOffset)
  72278 				if rc != 0 {
  72279 					return rc
  72280 				}
  72281 				iOffset = iOffset + I64(szFrame)
  72282 				nExtra++
  72283 
  72284 			}
  72285 		}
  72286 		if bSync != 0 {
  72287 			rc = Xsqlite3OsSync(tls, (*WalWriter)(unsafe.Pointer(bp+48)).FpFd, sync_flags&0x03)
  72288 		}
  72289 	}
  72290 
  72291 	if isCommit != 0 && (*Wal)(unsafe.Pointer(pWal)).FtruncateOnCommit != 0 && (*Wal)(unsafe.Pointer(pWal)).FmxWalSize >= int64(0) {
  72292 		var sz I64 = (*Wal)(unsafe.Pointer(pWal)).FmxWalSize
  72293 		if int64(WAL_HDRSIZE)+I64(iFrame+U32(nExtra)+U32(1)-U32(1))*I64(szPage+WAL_FRAME_HDRSIZE) > (*Wal)(unsafe.Pointer(pWal)).FmxWalSize {
  72294 			sz = int64(WAL_HDRSIZE) + I64(iFrame+U32(nExtra)+U32(1)-U32(1))*I64(szPage+WAL_FRAME_HDRSIZE)
  72295 		}
  72296 		walLimitSize(tls, pWal, sz)
  72297 		(*Wal)(unsafe.Pointer(pWal)).FtruncateOnCommit = U8(0)
  72298 	}
  72299 
  72300 	iFrame = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
  72301 	for p = pList; p != 0 && rc == SQLITE_OK; p = (*PgHdr)(unsafe.Pointer(p)).FpDirty {
  72302 		if int32((*PgHdr)(unsafe.Pointer(p)).Fflags)&PGHDR_WAL_APPEND == 0 {
  72303 			continue
  72304 		}
  72305 		iFrame++
  72306 		rc = walIndexAppend(tls, pWal, iFrame, (*PgHdr)(unsafe.Pointer(p)).Fpgno)
  72307 	}
  72308 
  72309 	for rc == SQLITE_OK && nExtra > 0 {
  72310 		iFrame++
  72311 		nExtra--
  72312 		rc = walIndexAppend(tls, pWal, iFrame, (*PgHdr)(unsafe.Pointer(pLast)).Fpgno)
  72313 	}
  72314 
  72315 	if rc == SQLITE_OK {
  72316 		(*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage = U16(szPage&0xff00 | szPage>>16)
  72317 
  72318 		(*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame = iFrame
  72319 		if isCommit != 0 {
  72320 			(*Wal)(unsafe.Pointer(pWal)).Fhdr.FiChange++
  72321 			(*Wal)(unsafe.Pointer(pWal)).Fhdr.FnPage = nTruncate
  72322 		}
  72323 
  72324 		if isCommit != 0 {
  72325 			walIndexWriteHdr(tls, pWal)
  72326 			(*Wal)(unsafe.Pointer(pWal)).FiCallback = iFrame
  72327 		}
  72328 	}
  72329 
  72330 	return rc
  72331 }
  72332 
  72333 // This routine is called to implement sqlite3_wal_checkpoint() and
  72334 // related interfaces.
  72335 //
  72336 // Obtain a CHECKPOINT lock and then backfill as much information as
  72337 // we can from WAL into the database.
  72338 //
  72339 // If parameter xBusy is not NULL, it is a pointer to a busy-handler
  72340 // callback. In this case this function runs a blocking checkpoint.
  72341 func Xsqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) int32 {
  72342 	bp := tls.Alloc(4)
  72343 	defer tls.Free(4)
  72344 
  72345 	var rc int32
  72346 	*(*int32)(unsafe.Pointer(bp)) = 0
  72347 	var eMode2 int32 = eMode
  72348 	var xBusy2 uintptr = xBusy
  72349 
  72350 	if (*Wal)(unsafe.Pointer(pWal)).FreadOnly != 0 {
  72351 		return SQLITE_READONLY
  72352 	}
  72353 
  72354 	rc = walLockExclusive(tls, pWal, WAL_CKPT_LOCK, 1)
  72355 
  72356 	if rc == SQLITE_OK {
  72357 		(*Wal)(unsafe.Pointer(pWal)).FckptLock = U8(1)
  72358 
  72359 		if eMode != SQLITE_CHECKPOINT_PASSIVE {
  72360 			rc = walBusyLock(tls, pWal, xBusy2, pBusyArg, WAL_WRITE_LOCK, 1)
  72361 			if rc == SQLITE_OK {
  72362 				(*Wal)(unsafe.Pointer(pWal)).FwriteLock = U8(1)
  72363 			} else if rc == SQLITE_BUSY {
  72364 				eMode2 = SQLITE_CHECKPOINT_PASSIVE
  72365 				xBusy2 = uintptr(0)
  72366 				rc = SQLITE_OK
  72367 			}
  72368 		}
  72369 	}
  72370 
  72371 	if rc == SQLITE_OK {
  72372 		rc = walIndexReadHdr(tls, pWal, bp)
  72373 
  72374 		if *(*int32)(unsafe.Pointer(bp)) != 0 && (*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= 3 {
  72375 			Xsqlite3OsUnfetch(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, int64(0), uintptr(0))
  72376 		}
  72377 	}
  72378 
  72379 	if rc == SQLITE_OK {
  72380 		if (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0 && walPagesize(tls, pWal) != nBuf {
  72381 			rc = Xsqlite3CorruptError(tls, 67142)
  72382 		} else {
  72383 			rc = walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf)
  72384 		}
  72385 
  72386 		if rc == SQLITE_OK || rc == SQLITE_BUSY {
  72387 			if pnLog != 0 {
  72388 				*(*int32)(unsafe.Pointer(pnLog)) = int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame)
  72389 			}
  72390 			if pnCkpt != 0 {
  72391 				*(*int32)(unsafe.Pointer(pnCkpt)) = int32((*WalCkptInfo)(unsafe.Pointer(walCkptInfo(tls, pWal))).FnBackfill)
  72392 			}
  72393 		}
  72394 	}
  72395 
  72396 	if *(*int32)(unsafe.Pointer(bp)) != 0 {
  72397 		libc.Xmemset(tls, pWal+72, 0, uint64(unsafe.Sizeof(WalIndexHdr{})))
  72398 	}
  72399 
  72400 	Xsqlite3WalEndWriteTransaction(tls, pWal)
  72401 	if (*Wal)(unsafe.Pointer(pWal)).FckptLock != 0 {
  72402 		walUnlockExclusive(tls, pWal, WAL_CKPT_LOCK, 1)
  72403 		(*Wal)(unsafe.Pointer(pWal)).FckptLock = U8(0)
  72404 	}
  72405 
  72406 	return func() int32 {
  72407 		if rc == SQLITE_OK && eMode != eMode2 {
  72408 			return SQLITE_BUSY
  72409 		}
  72410 		return rc
  72411 	}()
  72412 }
  72413 
  72414 // Return the value to pass to a sqlite3_wal_hook callback, the
  72415 // number of frames in the WAL at the point of the last commit since
  72416 // sqlite3WalCallback() was called.  If no commits have occurred since
  72417 // the last call, then return 0.
  72418 func Xsqlite3WalCallback(tls *libc.TLS, pWal uintptr) int32 {
  72419 	var ret U32 = U32(0)
  72420 	if pWal != 0 {
  72421 		ret = (*Wal)(unsafe.Pointer(pWal)).FiCallback
  72422 		(*Wal)(unsafe.Pointer(pWal)).FiCallback = U32(0)
  72423 	}
  72424 	return int32(ret)
  72425 }
  72426 
  72427 // This function is called to change the WAL subsystem into or out
  72428 // of locking_mode=EXCLUSIVE.
  72429 //
  72430 // If op is zero, then attempt to change from locking_mode=EXCLUSIVE
  72431 // into locking_mode=NORMAL.  This means that we must acquire a lock
  72432 // on the pWal->readLock byte.  If the WAL is already in locking_mode=NORMAL
  72433 // or if the acquisition of the lock fails, then return 0.  If the
  72434 // transition out of exclusive-mode is successful, return 1.  This
  72435 // operation must occur while the pager is still holding the exclusive
  72436 // lock on the main database file.
  72437 //
  72438 // If op is one, then change from locking_mode=NORMAL into
  72439 // locking_mode=EXCLUSIVE.  This means that the pWal->readLock must
  72440 // be released.  Return 1 if the transition is made and 0 if the
  72441 // WAL is already in exclusive-locking mode - meaning that this
  72442 // routine is a no-op.  The pager must already hold the exclusive lock
  72443 // on the main database file before invoking this operation.
  72444 //
  72445 // If op is negative, then do a dry-run of the op==1 case but do
  72446 // not actually change anything. The pager uses this to see if it
  72447 // should acquire the database exclusive lock prior to invoking
  72448 // the op==1 case.
  72449 func Xsqlite3WalExclusiveMode(tls *libc.TLS, pWal uintptr, op int32) int32 {
  72450 	var rc int32
  72451 
  72452 	if op == 0 {
  72453 		if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) != WAL_NORMAL_MODE {
  72454 			(*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_NORMAL_MODE)
  72455 			if walLockShared(tls, pWal, 3+int32((*Wal)(unsafe.Pointer(pWal)).FreadLock)) != SQLITE_OK {
  72456 				(*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_EXCLUSIVE_MODE)
  72457 			}
  72458 			rc = libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE)
  72459 		} else {
  72460 			rc = 0
  72461 		}
  72462 	} else if op > 0 {
  72463 		walUnlockShared(tls, pWal, 3+int32((*Wal)(unsafe.Pointer(pWal)).FreadLock))
  72464 		(*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_EXCLUSIVE_MODE)
  72465 		rc = 1
  72466 	} else {
  72467 		rc = libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE)
  72468 	}
  72469 	return rc
  72470 }
  72471 
  72472 // Return true if the argument is non-NULL and the WAL module is using
  72473 // heap-memory for the wal-index. Otherwise, if the argument is NULL or the
  72474 // WAL module is using shared-memory, return false.
  72475 func Xsqlite3WalHeapMemory(tls *libc.TLS, pWal uintptr) int32 {
  72476 	return libc.Bool32(pWal != 0 && int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_HEAPMEMORY_MODE)
  72477 }
  72478 
  72479 // Create a snapshot object.  The content of a snapshot is opaque to
  72480 // every other subsystem, so the WAL module can put whatever it needs
  72481 // in the object.
  72482 func Xsqlite3WalSnapshotGet(tls *libc.TLS, pWal uintptr, ppSnapshot uintptr) int32 {
  72483 	var rc int32 = SQLITE_OK
  72484 	var pRet uintptr
  72485 
  72486 	if libc.Xmemcmp(tls, pWal+72+24, uintptr(unsafe.Pointer(&aZero)), uint64(16)) == 0 {
  72487 		*(*uintptr)(unsafe.Pointer(ppSnapshot)) = uintptr(0)
  72488 		return SQLITE_ERROR
  72489 	}
  72490 	pRet = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(WalIndexHdr{})))
  72491 	if pRet == uintptr(0) {
  72492 		rc = SQLITE_NOMEM
  72493 	} else {
  72494 		libc.Xmemcpy(tls, pRet, pWal+72, uint64(unsafe.Sizeof(WalIndexHdr{})))
  72495 		*(*uintptr)(unsafe.Pointer(ppSnapshot)) = pRet
  72496 	}
  72497 
  72498 	return rc
  72499 }
  72500 
  72501 var aZero = [4]U32{U32(0), U32(0), U32(0), U32(0)}
  72502 
  72503 // Try to open on pSnapshot when the next read-transaction starts
  72504 func Xsqlite3WalSnapshotOpen(tls *libc.TLS, pWal uintptr, pSnapshot uintptr) {
  72505 	(*Wal)(unsafe.Pointer(pWal)).FpSnapshot = pSnapshot
  72506 }
  72507 
  72508 // Return a +ve value if snapshot p1 is newer than p2. A -ve value if
  72509 // p1 is older than p2 and zero if p1 and p2 are the same snapshot.
  72510 func Xsqlite3_snapshot_cmp(tls *libc.TLS, p1 uintptr, p2 uintptr) int32 {
  72511 	var pHdr1 uintptr = p1
  72512 	var pHdr2 uintptr = p2
  72513 
  72514 	if *(*U32)(unsafe.Pointer(pHdr1 + 32)) < *(*U32)(unsafe.Pointer(pHdr2 + 32)) {
  72515 		return -1
  72516 	}
  72517 	if *(*U32)(unsafe.Pointer(pHdr1 + 32)) > *(*U32)(unsafe.Pointer(pHdr2 + 32)) {
  72518 		return +1
  72519 	}
  72520 	if (*WalIndexHdr)(unsafe.Pointer(pHdr1)).FmxFrame < (*WalIndexHdr)(unsafe.Pointer(pHdr2)).FmxFrame {
  72521 		return -1
  72522 	}
  72523 	if (*WalIndexHdr)(unsafe.Pointer(pHdr1)).FmxFrame > (*WalIndexHdr)(unsafe.Pointer(pHdr2)).FmxFrame {
  72524 		return +1
  72525 	}
  72526 	return 0
  72527 }
  72528 
  72529 // The caller currently has a read transaction open on the database.
  72530 // This function takes a SHARED lock on the CHECKPOINTER slot and then
  72531 // checks if the snapshot passed as the second argument is still
  72532 // available. If so, SQLITE_OK is returned.
  72533 //
  72534 // If the snapshot is not available, SQLITE_ERROR is returned. Or, if
  72535 // the CHECKPOINTER lock cannot be obtained, SQLITE_BUSY. If any error
  72536 // occurs (any value other than SQLITE_OK is returned), the CHECKPOINTER
  72537 // lock is released before returning.
  72538 func Xsqlite3WalSnapshotCheck(tls *libc.TLS, pWal uintptr, pSnapshot uintptr) int32 {
  72539 	var rc int32
  72540 	rc = walLockShared(tls, pWal, WAL_CKPT_LOCK)
  72541 	if rc == SQLITE_OK {
  72542 		var pNew uintptr = pSnapshot
  72543 		if libc.Xmemcmp(tls, pNew+32, pWal+72+32, uint64(unsafe.Sizeof([2]U32{}))) != 0 ||
  72544 			(*WalIndexHdr)(unsafe.Pointer(pNew)).FmxFrame < (*WalCkptInfo)(unsafe.Pointer(walCkptInfo(tls, pWal))).FnBackfillAttempted {
  72545 			rc = SQLITE_ERROR | int32(3)<<8
  72546 			walUnlockShared(tls, pWal, WAL_CKPT_LOCK)
  72547 		}
  72548 	}
  72549 	return rc
  72550 }
  72551 
  72552 // Release a lock obtained by an earlier successful call to
  72553 // sqlite3WalSnapshotCheck().
  72554 func Xsqlite3WalSnapshotUnlock(tls *libc.TLS, pWal uintptr) {
  72555 	walUnlockShared(tls, pWal, WAL_CKPT_LOCK)
  72556 }
  72557 
  72558 // Return the sqlite3_file object for the WAL file
  72559 func Xsqlite3WalFile(tls *libc.TLS, pWal uintptr) uintptr {
  72560 	return (*Wal)(unsafe.Pointer(pWal)).FpWalFd
  72561 }
  72562 
  72563 // Forward declarations
  72564 type MemPage1 = struct {
  72565 	FisInit          U8
  72566 	FintKey          U8
  72567 	FintKeyLeaf      U8
  72568 	F__ccgo_pad1     [1]byte
  72569 	Fpgno            Pgno
  72570 	Fleaf            U8
  72571 	FhdrOffset       U8
  72572 	FchildPtrSize    U8
  72573 	Fmax1bytePayload U8
  72574 	FnOverflow       U8
  72575 	F__ccgo_pad2     [1]byte
  72576 	FmaxLocal        U16
  72577 	FminLocal        U16
  72578 	FcellOffset      U16
  72579 	FnFree           int32
  72580 	FnCell           U16
  72581 	FmaskPage        U16
  72582 	FaiOvfl          [4]U16
  72583 	F__ccgo_pad3     [4]byte
  72584 	FapOvfl          [4]uintptr
  72585 	FpBt             uintptr
  72586 	FaData           uintptr
  72587 	FaDataEnd        uintptr
  72588 	FaCellIdx        uintptr
  72589 	FaDataOfst       uintptr
  72590 	FpDbPage         uintptr
  72591 	FxCellSize       uintptr
  72592 	FxParseCell      uintptr
  72593 }
  72594 
  72595 // Forward declarations
  72596 type MemPage = MemPage1
  72597 type BtLock1 = struct {
  72598 	FpBtree      uintptr
  72599 	FiTable      Pgno
  72600 	FeLock       U8
  72601 	F__ccgo_pad1 [3]byte
  72602 	FpNext       uintptr
  72603 }
  72604 
  72605 type BtLock = BtLock1
  72606 type CellInfo1 = struct {
  72607 	FnKey     I64
  72608 	FpPayload uintptr
  72609 	FnPayload U32
  72610 	FnLocal   U16
  72611 	FnSize    U16
  72612 }
  72613 
  72614 type CellInfo = CellInfo1
  72615 
  72616 // This structure is passed around through all the PRAGMA integrity_check
  72617 // checking routines in order to keep track of some global state information.
  72618 //
  72619 // The aRef[] array is allocated so that there is 1 bit for each page in
  72620 // the database. As the integrity-check proceeds, for each page used in
  72621 // the database the corresponding bit is set. This allows integrity-check to
  72622 // detect pages that are used twice and orphaned pages (both of which
  72623 // indicate corruption).
  72624 type IntegrityCk1 = struct {
  72625 	FpBt         uintptr
  72626 	FpPager      uintptr
  72627 	FaPgRef      uintptr
  72628 	FnPage       Pgno
  72629 	FmxErr       int32
  72630 	FnErr        int32
  72631 	Frc          int32
  72632 	FnStep       U32
  72633 	F__ccgo_pad1 [4]byte
  72634 	FzPfx        uintptr
  72635 	Fv1          Pgno
  72636 	Fv2          int32
  72637 	FerrMsg      StrAccum
  72638 	Fheap        uintptr
  72639 	Fdb          uintptr
  72640 }
  72641 
  72642 // This structure is passed around through all the PRAGMA integrity_check
  72643 // checking routines in order to keep track of some global state information.
  72644 //
  72645 // The aRef[] array is allocated so that there is 1 bit for each page in
  72646 // the database. As the integrity-check proceeds, for each page used in
  72647 // the database the corresponding bit is set. This allows integrity-check to
  72648 // detect pages that are used twice and orphaned pages (both of which
  72649 // indicate corruption).
  72650 type IntegrityCk = IntegrityCk1
  72651 
  72652 func lockBtreeMutex(tls *libc.TLS, p uintptr) {
  72653 	Xsqlite3_mutex_enter(tls, (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).Fmutex)
  72654 	(*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).Fdb = (*Btree)(unsafe.Pointer(p)).Fdb
  72655 	(*Btree)(unsafe.Pointer(p)).Flocked = U8(1)
  72656 }
  72657 
  72658 func unlockBtreeMutex(tls *libc.TLS, p uintptr) {
  72659 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  72660 
  72661 	Xsqlite3_mutex_leave(tls, (*BtShared)(unsafe.Pointer(pBt)).Fmutex)
  72662 	(*Btree)(unsafe.Pointer(p)).Flocked = U8(0)
  72663 }
  72664 
  72665 // Enter a mutex on the given BTree object.
  72666 //
  72667 // If the object is not sharable, then no mutex is ever required
  72668 // and this routine is a no-op.  The underlying mutex is non-recursive.
  72669 // But we keep a reference count in Btree.wantToLock so the behavior
  72670 // of this interface is recursive.
  72671 //
  72672 // To avoid deadlocks, multiple Btrees are locked in the same order
  72673 // by all database connections.  The p->pNext is a list of other
  72674 // Btrees belonging to the same database connection as the p Btree
  72675 // which need to be locked after p.  If we cannot get a lock on
  72676 // p, then first unlock all of the others on p->pNext, then wait
  72677 // for the lock to become available on p, then relock all of the
  72678 // subsequent Btrees that desire a lock.
  72679 func Xsqlite3BtreeEnter(tls *libc.TLS, p uintptr) {
  72680 	if !(int32((*Btree)(unsafe.Pointer(p)).Fsharable) != 0) {
  72681 		return
  72682 	}
  72683 	(*Btree)(unsafe.Pointer(p)).FwantToLock++
  72684 	if (*Btree)(unsafe.Pointer(p)).Flocked != 0 {
  72685 		return
  72686 	}
  72687 	btreeLockCarefully(tls, p)
  72688 }
  72689 
  72690 func btreeLockCarefully(tls *libc.TLS, p uintptr) {
  72691 	var pLater uintptr
  72692 
  72693 	if Xsqlite3_mutex_try(tls, (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).Fmutex) == SQLITE_OK {
  72694 		(*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).Fdb = (*Btree)(unsafe.Pointer(p)).Fdb
  72695 		(*Btree)(unsafe.Pointer(p)).Flocked = U8(1)
  72696 		return
  72697 	}
  72698 
  72699 	for pLater = (*Btree)(unsafe.Pointer(p)).FpNext; pLater != 0; pLater = (*Btree)(unsafe.Pointer(pLater)).FpNext {
  72700 		if (*Btree)(unsafe.Pointer(pLater)).Flocked != 0 {
  72701 			unlockBtreeMutex(tls, pLater)
  72702 		}
  72703 	}
  72704 	lockBtreeMutex(tls, p)
  72705 	for pLater = (*Btree)(unsafe.Pointer(p)).FpNext; pLater != 0; pLater = (*Btree)(unsafe.Pointer(pLater)).FpNext {
  72706 		if (*Btree)(unsafe.Pointer(pLater)).FwantToLock != 0 {
  72707 			lockBtreeMutex(tls, pLater)
  72708 		}
  72709 	}
  72710 }
  72711 
  72712 // Exit the recursive mutex on a Btree.
  72713 func Xsqlite3BtreeLeave(tls *libc.TLS, p uintptr) {
  72714 	if (*Btree)(unsafe.Pointer(p)).Fsharable != 0 {
  72715 		(*Btree)(unsafe.Pointer(p)).FwantToLock--
  72716 		if (*Btree)(unsafe.Pointer(p)).FwantToLock == 0 {
  72717 			unlockBtreeMutex(tls, p)
  72718 		}
  72719 	}
  72720 }
  72721 
  72722 func btreeEnterAll(tls *libc.TLS, db uintptr) {
  72723 	var i int32
  72724 	var skipOk int32 = 1
  72725 	var p uintptr
  72726 
  72727 	for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
  72728 		p = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt
  72729 		if p != 0 && (*Btree)(unsafe.Pointer(p)).Fsharable != 0 {
  72730 			Xsqlite3BtreeEnter(tls, p)
  72731 			skipOk = 0
  72732 		}
  72733 	}
  72734 	(*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache = U8(skipOk)
  72735 }
  72736 
  72737 func Xsqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) {
  72738 	if int32((*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache) == 0 {
  72739 		btreeEnterAll(tls, db)
  72740 	}
  72741 }
  72742 
  72743 func btreeLeaveAll(tls *libc.TLS, db uintptr) {
  72744 	var i int32
  72745 	var p uintptr
  72746 
  72747 	for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
  72748 		p = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt
  72749 		if p != 0 {
  72750 			Xsqlite3BtreeLeave(tls, p)
  72751 		}
  72752 	}
  72753 }
  72754 
  72755 func Xsqlite3BtreeLeaveAll(tls *libc.TLS, db uintptr) {
  72756 	if int32((*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache) == 0 {
  72757 		btreeLeaveAll(tls, db)
  72758 	}
  72759 }
  72760 
  72761 // Enter a mutex on a Btree given a cursor owned by that Btree.
  72762 //
  72763 // These entry points are used by incremental I/O only. Enter() is required
  72764 // any time OMIT_SHARED_CACHE is not defined, regardless of whether or not
  72765 // the build is threadsafe. Leave() is only required by threadsafe builds.
  72766 func Xsqlite3BtreeEnterCursor(tls *libc.TLS, pCur uintptr) {
  72767 	Xsqlite3BtreeEnter(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree)
  72768 }
  72769 
  72770 func Xsqlite3BtreeLeaveCursor(tls *libc.TLS, pCur uintptr) {
  72771 	Xsqlite3BtreeLeave(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree)
  72772 }
  72773 
  72774 var zMagicHeader = *(*[16]int8)(unsafe.Pointer(ts + 5385))
  72775 
  72776 var sqlite3SharedCacheList uintptr = uintptr(0)
  72777 
  72778 // Enable or disable the shared pager and schema features.
  72779 //
  72780 // This routine has no effect on existing database connections.
  72781 // The shared cache setting effects only future calls to
  72782 // sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().
  72783 func Xsqlite3_enable_shared_cache(tls *libc.TLS, enable int32) int32 {
  72784 	Xsqlite3Config.FsharedCacheEnabled = enable
  72785 	return SQLITE_OK
  72786 }
  72787 
  72788 func querySharedCacheTableLock(tls *libc.TLS, p uintptr, iTab Pgno, eLock U8) int32 {
  72789 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  72790 	var pIter uintptr
  72791 
  72792 	if !(int32((*Btree)(unsafe.Pointer(p)).Fsharable) != 0) {
  72793 		return SQLITE_OK
  72794 	}
  72795 
  72796 	if (*BtShared)(unsafe.Pointer(pBt)).FpWriter != p && int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_EXCLUSIVE != 0 {
  72797 		Xsqlite3ConnectionBlocked(tls, (*Btree)(unsafe.Pointer(p)).Fdb, (*Btree)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpWriter)).Fdb)
  72798 		return SQLITE_LOCKED | int32(1)<<8
  72799 	}
  72800 
  72801 	for pIter = (*BtShared)(unsafe.Pointer(pBt)).FpLock; pIter != 0; pIter = (*BtLock)(unsafe.Pointer(pIter)).FpNext {
  72802 		if (*BtLock)(unsafe.Pointer(pIter)).FpBtree != p && (*BtLock)(unsafe.Pointer(pIter)).FiTable == iTab && int32((*BtLock)(unsafe.Pointer(pIter)).FeLock) != int32(eLock) {
  72803 			Xsqlite3ConnectionBlocked(tls, (*Btree)(unsafe.Pointer(p)).Fdb, (*Btree)(unsafe.Pointer((*BtLock)(unsafe.Pointer(pIter)).FpBtree)).Fdb)
  72804 			if int32(eLock) == WRITE_LOCK {
  72805 				*(*U16)(unsafe.Pointer(pBt + 40)) |= U16(BTS_PENDING)
  72806 			}
  72807 			return SQLITE_LOCKED | int32(1)<<8
  72808 		}
  72809 	}
  72810 	return SQLITE_OK
  72811 }
  72812 
  72813 func setSharedCacheTableLock(tls *libc.TLS, p uintptr, iTable Pgno, eLock U8) int32 {
  72814 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  72815 	var pLock uintptr = uintptr(0)
  72816 	var pIter uintptr
  72817 
  72818 	for pIter = (*BtShared)(unsafe.Pointer(pBt)).FpLock; pIter != 0; pIter = (*BtLock)(unsafe.Pointer(pIter)).FpNext {
  72819 		if (*BtLock)(unsafe.Pointer(pIter)).FiTable == iTable && (*BtLock)(unsafe.Pointer(pIter)).FpBtree == p {
  72820 			pLock = pIter
  72821 			break
  72822 		}
  72823 	}
  72824 
  72825 	if !(pLock != 0) {
  72826 		pLock = Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(BtLock{})))
  72827 		if !(pLock != 0) {
  72828 			return SQLITE_NOMEM
  72829 		}
  72830 		(*BtLock)(unsafe.Pointer(pLock)).FiTable = iTable
  72831 		(*BtLock)(unsafe.Pointer(pLock)).FpBtree = p
  72832 		(*BtLock)(unsafe.Pointer(pLock)).FpNext = (*BtShared)(unsafe.Pointer(pBt)).FpLock
  72833 		(*BtShared)(unsafe.Pointer(pBt)).FpLock = pLock
  72834 	}
  72835 
  72836 	if int32(eLock) > int32((*BtLock)(unsafe.Pointer(pLock)).FeLock) {
  72837 		(*BtLock)(unsafe.Pointer(pLock)).FeLock = eLock
  72838 	}
  72839 
  72840 	return SQLITE_OK
  72841 }
  72842 
  72843 func clearAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) {
  72844 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  72845 	var ppIter uintptr = pBt + 120
  72846 
  72847 	for *(*uintptr)(unsafe.Pointer(ppIter)) != 0 {
  72848 		var pLock uintptr = *(*uintptr)(unsafe.Pointer(ppIter))
  72849 
  72850 		if (*BtLock)(unsafe.Pointer(pLock)).FpBtree == p {
  72851 			*(*uintptr)(unsafe.Pointer(ppIter)) = (*BtLock)(unsafe.Pointer(pLock)).FpNext
  72852 
  72853 			if (*BtLock)(unsafe.Pointer(pLock)).FiTable != Pgno(1) {
  72854 				Xsqlite3_free(tls, pLock)
  72855 			}
  72856 		} else {
  72857 			ppIter = pLock + 16
  72858 		}
  72859 	}
  72860 
  72861 	if (*BtShared)(unsafe.Pointer(pBt)).FpWriter == p {
  72862 		(*BtShared)(unsafe.Pointer(pBt)).FpWriter = uintptr(0)
  72863 		*(*U16)(unsafe.Pointer(pBt + 40)) &= libc.Uint16FromInt32(libc.CplInt32(BTS_EXCLUSIVE | BTS_PENDING))
  72864 	} else if (*BtShared)(unsafe.Pointer(pBt)).FnTransaction == 2 {
  72865 		*(*U16)(unsafe.Pointer(pBt + 40)) &= libc.Uint16FromInt32(libc.CplInt32(BTS_PENDING))
  72866 	}
  72867 }
  72868 
  72869 func downgradeAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) {
  72870 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  72871 	if (*BtShared)(unsafe.Pointer(pBt)).FpWriter == p {
  72872 		var pLock uintptr
  72873 		(*BtShared)(unsafe.Pointer(pBt)).FpWriter = uintptr(0)
  72874 		*(*U16)(unsafe.Pointer(pBt + 40)) &= libc.Uint16FromInt32(libc.CplInt32(BTS_EXCLUSIVE | BTS_PENDING))
  72875 		for pLock = (*BtShared)(unsafe.Pointer(pBt)).FpLock; pLock != 0; pLock = (*BtLock)(unsafe.Pointer(pLock)).FpNext {
  72876 			(*BtLock)(unsafe.Pointer(pLock)).FeLock = U8(READ_LOCK)
  72877 		}
  72878 	}
  72879 }
  72880 
  72881 func invalidateAllOverflowCache(tls *libc.TLS, pBt uintptr) {
  72882 	var p uintptr
  72883 
  72884 	for p = (*BtShared)(unsafe.Pointer(pBt)).FpCursor; p != 0; p = (*BtCursor)(unsafe.Pointer(p)).FpNext {
  72885 		*(*U8)(unsafe.Pointer(p + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_ValidOvfl))
  72886 	}
  72887 }
  72888 
  72889 func invalidateIncrblobCursors(tls *libc.TLS, pBtree uintptr, pgnoRoot Pgno, iRow I64, isClearTable int32) {
  72890 	var p uintptr
  72891 
  72892 	(*Btree)(unsafe.Pointer(pBtree)).FhasIncrblobCur = U8(0)
  72893 	for p = (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(pBtree)).FpBt)).FpCursor; p != 0; p = (*BtCursor)(unsafe.Pointer(p)).FpNext {
  72894 		if int32((*BtCursor)(unsafe.Pointer(p)).FcurFlags)&BTCF_Incrblob != 0 {
  72895 			(*Btree)(unsafe.Pointer(pBtree)).FhasIncrblobCur = U8(1)
  72896 			if (*BtCursor)(unsafe.Pointer(p)).FpgnoRoot == pgnoRoot && (isClearTable != 0 || (*BtCursor)(unsafe.Pointer(p)).Finfo.FnKey == iRow) {
  72897 				(*BtCursor)(unsafe.Pointer(p)).FeState = U8(CURSOR_INVALID)
  72898 			}
  72899 		}
  72900 	}
  72901 }
  72902 
  72903 func btreeSetHasContent(tls *libc.TLS, pBt uintptr, pgno Pgno) int32 {
  72904 	var rc int32 = SQLITE_OK
  72905 	if !(int32((*BtShared)(unsafe.Pointer(pBt)).FpHasContent) != 0) {
  72906 		(*BtShared)(unsafe.Pointer(pBt)).FpHasContent = Xsqlite3BitvecCreate(tls, (*BtShared)(unsafe.Pointer(pBt)).FnPage)
  72907 		if !(int32((*BtShared)(unsafe.Pointer(pBt)).FpHasContent) != 0) {
  72908 			rc = SQLITE_NOMEM
  72909 		}
  72910 	}
  72911 	if rc == SQLITE_OK && pgno <= Xsqlite3BitvecSize(tls, (*BtShared)(unsafe.Pointer(pBt)).FpHasContent) {
  72912 		rc = Xsqlite3BitvecSet(tls, (*BtShared)(unsafe.Pointer(pBt)).FpHasContent, pgno)
  72913 	}
  72914 	return rc
  72915 }
  72916 
  72917 func btreeGetHasContent(tls *libc.TLS, pBt uintptr, pgno Pgno) int32 {
  72918 	var p uintptr = (*BtShared)(unsafe.Pointer(pBt)).FpHasContent
  72919 	return libc.Bool32(p != 0 && (pgno > Xsqlite3BitvecSize(tls, p) || Xsqlite3BitvecTestNotNull(tls, p, pgno) != 0))
  72920 }
  72921 
  72922 func btreeClearHasContent(tls *libc.TLS, pBt uintptr) {
  72923 	Xsqlite3BitvecDestroy(tls, (*BtShared)(unsafe.Pointer(pBt)).FpHasContent)
  72924 	(*BtShared)(unsafe.Pointer(pBt)).FpHasContent = uintptr(0)
  72925 }
  72926 
  72927 func btreeReleaseAllCursorPages(tls *libc.TLS, pCur uintptr) {
  72928 	var i int32
  72929 	if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) >= 0 {
  72930 		for i = 0; i < int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage); i++ {
  72931 			releasePageNotNull(tls, *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr(i)*8)))
  72932 		}
  72933 		releasePageNotNull(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpPage)
  72934 		(*BtCursor)(unsafe.Pointer(pCur)).FiPage = int8(-1)
  72935 	}
  72936 }
  72937 
  72938 func saveCursorKey(tls *libc.TLS, pCur uintptr) int32 {
  72939 	var rc int32 = SQLITE_OK
  72940 
  72941 	if (*BtCursor)(unsafe.Pointer(pCur)).FcurIntKey != 0 {
  72942 		(*BtCursor)(unsafe.Pointer(pCur)).FnKey = Xsqlite3BtreeIntegerKey(tls, pCur)
  72943 	} else {
  72944 		var pKey uintptr
  72945 		(*BtCursor)(unsafe.Pointer(pCur)).FnKey = I64(Xsqlite3BtreePayloadSize(tls, pCur))
  72946 		pKey = Xsqlite3Malloc(tls, uint64((*BtCursor)(unsafe.Pointer(pCur)).FnKey+int64(9)+int64(8)))
  72947 		if pKey != 0 {
  72948 			rc = Xsqlite3BtreePayload(tls, pCur, uint32(0), uint32(int32((*BtCursor)(unsafe.Pointer(pCur)).FnKey)), pKey)
  72949 			if rc == SQLITE_OK {
  72950 				libc.Xmemset(tls, pKey+uintptr((*BtCursor)(unsafe.Pointer(pCur)).FnKey), 0, uint64(9+8))
  72951 				(*BtCursor)(unsafe.Pointer(pCur)).FpKey = pKey
  72952 			} else {
  72953 				Xsqlite3_free(tls, pKey)
  72954 			}
  72955 		} else {
  72956 			rc = SQLITE_NOMEM
  72957 		}
  72958 	}
  72959 
  72960 	return rc
  72961 }
  72962 
  72963 func saveCursorPosition(tls *libc.TLS, pCur uintptr) int32 {
  72964 	var rc int32
  72965 
  72966 	if int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags)&BTCF_Pinned != 0 {
  72967 		return SQLITE_CONSTRAINT | int32(11)<<8
  72968 	}
  72969 	if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_SKIPNEXT {
  72970 		(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID)
  72971 	} else {
  72972 		(*BtCursor)(unsafe.Pointer(pCur)).FskipNext = 0
  72973 	}
  72974 
  72975 	rc = saveCursorKey(tls, pCur)
  72976 	if rc == SQLITE_OK {
  72977 		btreeReleaseAllCursorPages(tls, pCur)
  72978 		(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_REQUIRESEEK)
  72979 	}
  72980 
  72981 	*(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_ValidNKey | BTCF_ValidOvfl | BTCF_AtLast))
  72982 	return rc
  72983 }
  72984 
  72985 func saveAllCursors(tls *libc.TLS, pBt uintptr, iRoot Pgno, pExcept uintptr) int32 {
  72986 	var p uintptr
  72987 
  72988 	for p = (*BtShared)(unsafe.Pointer(pBt)).FpCursor; p != 0; p = (*BtCursor)(unsafe.Pointer(p)).FpNext {
  72989 		if p != pExcept && (Pgno(0) == iRoot || (*BtCursor)(unsafe.Pointer(p)).FpgnoRoot == iRoot) {
  72990 			break
  72991 		}
  72992 	}
  72993 	if p != 0 {
  72994 		return saveCursorsOnList(tls, p, iRoot, pExcept)
  72995 	}
  72996 	if pExcept != 0 {
  72997 		*(*U8)(unsafe.Pointer(pExcept + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_Multiple))
  72998 	}
  72999 	return SQLITE_OK
  73000 }
  73001 
  73002 func saveCursorsOnList(tls *libc.TLS, p uintptr, iRoot Pgno, pExcept uintptr) int32 {
  73003 	for __ccgo := true; __ccgo; __ccgo = p != 0 {
  73004 		if p != pExcept && (Pgno(0) == iRoot || (*BtCursor)(unsafe.Pointer(p)).FpgnoRoot == iRoot) {
  73005 			if int32((*BtCursor)(unsafe.Pointer(p)).FeState) == CURSOR_VALID || int32((*BtCursor)(unsafe.Pointer(p)).FeState) == CURSOR_SKIPNEXT {
  73006 				var rc int32 = saveCursorPosition(tls, p)
  73007 				if SQLITE_OK != rc {
  73008 					return rc
  73009 				}
  73010 			} else {
  73011 				btreeReleaseAllCursorPages(tls, p)
  73012 			}
  73013 		}
  73014 		p = (*BtCursor)(unsafe.Pointer(p)).FpNext
  73015 	}
  73016 	return SQLITE_OK
  73017 }
  73018 
  73019 // Clear the current cursor position.
  73020 func Xsqlite3BtreeClearCursor(tls *libc.TLS, pCur uintptr) {
  73021 	Xsqlite3_free(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpKey)
  73022 	(*BtCursor)(unsafe.Pointer(pCur)).FpKey = uintptr(0)
  73023 	(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID)
  73024 }
  73025 
  73026 func btreeMoveto(tls *libc.TLS, pCur uintptr, pKey uintptr, nKey I64, bias int32, pRes uintptr) int32 {
  73027 	var rc int32
  73028 	var pIdxKey uintptr
  73029 
  73030 	if pKey != 0 {
  73031 		var pKeyInfo uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo
  73032 
  73033 		pIdxKey = Xsqlite3VdbeAllocUnpackedRecord(tls, pKeyInfo)
  73034 		if pIdxKey == uintptr(0) {
  73035 			return SQLITE_NOMEM
  73036 		}
  73037 		Xsqlite3VdbeRecordUnpack(tls, pKeyInfo, int32(nKey), pKey, pIdxKey)
  73038 		if int32((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0 || int32((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) {
  73039 			rc = Xsqlite3CorruptError(tls, 69253)
  73040 		} else {
  73041 			rc = Xsqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes)
  73042 		}
  73043 		Xsqlite3DbFree(tls, (*KeyInfo1)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey)
  73044 	} else {
  73045 		pIdxKey = uintptr(0)
  73046 		rc = Xsqlite3BtreeTableMoveto(tls, pCur, nKey, bias, pRes)
  73047 	}
  73048 	return rc
  73049 }
  73050 
  73051 func btreeRestoreCursorPosition(tls *libc.TLS, pCur uintptr) int32 {
  73052 	bp := tls.Alloc(4)
  73053 	defer tls.Free(4)
  73054 
  73055 	var rc int32
  73056 	*(*int32)(unsafe.Pointer(bp)) = 0
  73057 
  73058 	if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_FAULT {
  73059 		return (*BtCursor)(unsafe.Pointer(pCur)).FskipNext
  73060 	}
  73061 	(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID)
  73062 	if Xsqlite3FaultSim(tls, 410) != 0 {
  73063 		rc = SQLITE_IOERR
  73064 	} else {
  73065 		rc = btreeMoveto(tls, pCur, (*BtCursor)(unsafe.Pointer(pCur)).FpKey, (*BtCursor)(unsafe.Pointer(pCur)).FnKey, 0, bp)
  73066 	}
  73067 	if rc == SQLITE_OK {
  73068 		Xsqlite3_free(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpKey)
  73069 		(*BtCursor)(unsafe.Pointer(pCur)).FpKey = uintptr(0)
  73070 
  73071 		if *(*int32)(unsafe.Pointer(bp)) != 0 {
  73072 			(*BtCursor)(unsafe.Pointer(pCur)).FskipNext = *(*int32)(unsafe.Pointer(bp))
  73073 		}
  73074 		if (*BtCursor)(unsafe.Pointer(pCur)).FskipNext != 0 && int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID {
  73075 			(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_SKIPNEXT)
  73076 		}
  73077 	}
  73078 	return rc
  73079 }
  73080 
  73081 // Determine whether or not a cursor has moved from the position where
  73082 // it was last placed, or has been invalidated for any other reason.
  73083 // Cursors can move when the row they are pointing at is deleted out
  73084 // from under them, for example.  Cursor might also move if a btree
  73085 // is rebalanced.
  73086 //
  73087 // Calling this routine with a NULL cursor pointer returns false.
  73088 //
  73089 // Use the separate sqlite3BtreeCursorRestore() routine to restore a cursor
  73090 // back to where it ought to be if this routine returns true.
  73091 func Xsqlite3BtreeCursorHasMoved(tls *libc.TLS, pCur uintptr) int32 {
  73092 	return libc.Bool32(CURSOR_VALID != int32(*(*U8)(unsafe.Pointer(pCur))))
  73093 }
  73094 
  73095 // Return a pointer to a fake BtCursor object that will always answer
  73096 // false to the sqlite3BtreeCursorHasMoved() routine above.  The fake
  73097 // cursor returned must not be used with any other Btree interface.
  73098 func Xsqlite3BtreeFakeValidCursor(tls *libc.TLS) uintptr {
  73099 	return uintptr(unsafe.Pointer(&fakeCursor))
  73100 }
  73101 
  73102 var fakeCursor U8 = U8(CURSOR_VALID)
  73103 
  73104 // This routine restores a cursor back to its original position after it
  73105 // has been moved by some outside activity (such as a btree rebalance or
  73106 // a row having been deleted out from under the cursor).
  73107 //
  73108 // On success, the *pDifferentRow parameter is false if the cursor is left
  73109 // pointing at exactly the same row.  *pDifferntRow is the row the cursor
  73110 // was pointing to has been deleted, forcing the cursor to point to some
  73111 // nearby row.
  73112 //
  73113 // This routine should only be called for a cursor that just returned
  73114 // TRUE from sqlite3BtreeCursorHasMoved().
  73115 func Xsqlite3BtreeCursorRestore(tls *libc.TLS, pCur uintptr, pDifferentRow uintptr) int32 {
  73116 	var rc int32
  73117 
  73118 	rc = func() int32 {
  73119 		if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) >= CURSOR_REQUIRESEEK {
  73120 			return btreeRestoreCursorPosition(tls, pCur)
  73121 		}
  73122 		return SQLITE_OK
  73123 	}()
  73124 	if rc != 0 {
  73125 		*(*int32)(unsafe.Pointer(pDifferentRow)) = 1
  73126 		return rc
  73127 	}
  73128 	if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID {
  73129 		*(*int32)(unsafe.Pointer(pDifferentRow)) = 1
  73130 	} else {
  73131 		*(*int32)(unsafe.Pointer(pDifferentRow)) = 0
  73132 	}
  73133 	return SQLITE_OK
  73134 }
  73135 
  73136 // Provide flag hints to the cursor.
  73137 func Xsqlite3BtreeCursorHintFlags(tls *libc.TLS, pCur uintptr, x uint32) {
  73138 	(*BtCursor)(unsafe.Pointer(pCur)).Fhints = U8(x)
  73139 }
  73140 
  73141 func ptrmapPageno(tls *libc.TLS, pBt uintptr, pgno Pgno) Pgno {
  73142 	var nPagesPerMapPage int32
  73143 	var iPtrMap Pgno
  73144 	var ret Pgno
  73145 
  73146 	if pgno < Pgno(2) {
  73147 		return Pgno(0)
  73148 	}
  73149 	nPagesPerMapPage = int32((*BtShared)(unsafe.Pointer(pBt)).FusableSize/U32(5) + U32(1))
  73150 	iPtrMap = (pgno - Pgno(2)) / Pgno(nPagesPerMapPage)
  73151 	ret = iPtrMap*Pgno(nPagesPerMapPage) + Pgno(2)
  73152 	if ret == U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1) {
  73153 		ret++
  73154 	}
  73155 	return ret
  73156 }
  73157 
  73158 func ptrmapPut(tls *libc.TLS, pBt uintptr, key Pgno, eType U8, parent Pgno, pRC uintptr) {
  73159 	bp := tls.Alloc(8)
  73160 	defer tls.Free(8)
  73161 
  73162 	var pPtrmap uintptr
  73163 	var iPtrmap Pgno
  73164 	var offset int32
  73165 	var rc int32
  73166 
  73167 	if !(*(*int32)(unsafe.Pointer(pRC)) != 0) {
  73168 		goto __1
  73169 	}
  73170 	return
  73171 __1:
  73172 	;
  73173 	if !(key == Pgno(0)) {
  73174 		goto __2
  73175 	}
  73176 	*(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 69434)
  73177 	return
  73178 __2:
  73179 	;
  73180 	iPtrmap = ptrmapPageno(tls, pBt, key)
  73181 	rc = Xsqlite3PagerGet(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, iPtrmap, bp, 0)
  73182 	if !(rc != SQLITE_OK) {
  73183 		goto __3
  73184 	}
  73185 	*(*int32)(unsafe.Pointer(pRC)) = rc
  73186 	return
  73187 __3:
  73188 	;
  73189 	if !(int32(*(*int8)(unsafe.Pointer(Xsqlite3PagerGetExtra(tls, *(*uintptr)(unsafe.Pointer(bp)))))) != 0) {
  73190 		goto __4
  73191 	}
  73192 
  73193 	*(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 69447)
  73194 	goto ptrmap_exit
  73195 __4:
  73196 	;
  73197 	offset = int32(Pgno(5) * (key - iPtrmap - Pgno(1)))
  73198 	if !(offset < 0) {
  73199 		goto __5
  73200 	}
  73201 	*(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 69452)
  73202 	goto ptrmap_exit
  73203 __5:
  73204 	;
  73205 	pPtrmap = Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp)))
  73206 
  73207 	if !(int32(eType) != int32(*(*U8)(unsafe.Pointer(pPtrmap + uintptr(offset)))) || Xsqlite3Get4byte(tls, pPtrmap+uintptr(offset+1)) != parent) {
  73208 		goto __6
  73209 	}
  73210 
  73211 	*(*int32)(unsafe.Pointer(pRC)) = libc.AssignInt32(&rc, Xsqlite3PagerWrite(tls, *(*uintptr)(unsafe.Pointer(bp))))
  73212 	if !(rc == SQLITE_OK) {
  73213 		goto __7
  73214 	}
  73215 	*(*U8)(unsafe.Pointer(pPtrmap + uintptr(offset))) = eType
  73216 	Xsqlite3Put4byte(tls, pPtrmap+uintptr(offset+1), parent)
  73217 __7:
  73218 	;
  73219 __6:
  73220 	;
  73221 ptrmap_exit:
  73222 	Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp)))
  73223 }
  73224 
  73225 func ptrmapGet(tls *libc.TLS, pBt uintptr, key Pgno, pEType uintptr, pPgno uintptr) int32 {
  73226 	bp := tls.Alloc(8)
  73227 	defer tls.Free(8)
  73228 
  73229 	var iPtrmap int32
  73230 	var pPtrmap uintptr
  73231 	var offset int32
  73232 	var rc int32
  73233 
  73234 	iPtrmap = int32(ptrmapPageno(tls, pBt, key))
  73235 	rc = Xsqlite3PagerGet(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, uint32(iPtrmap), bp, 0)
  73236 	if rc != 0 {
  73237 		return rc
  73238 	}
  73239 	pPtrmap = Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp)))
  73240 
  73241 	offset = int32(Pgno(5) * (key - Pgno(iPtrmap) - Pgno(1)))
  73242 	if offset < 0 {
  73243 		Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp)))
  73244 		return Xsqlite3CorruptError(tls, 69497)
  73245 	}
  73246 
  73247 	*(*U8)(unsafe.Pointer(pEType)) = *(*U8)(unsafe.Pointer(pPtrmap + uintptr(offset)))
  73248 	if pPgno != 0 {
  73249 		*(*Pgno)(unsafe.Pointer(pPgno)) = Xsqlite3Get4byte(tls, pPtrmap+uintptr(offset+1))
  73250 	}
  73251 
  73252 	Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp)))
  73253 	if int32(*(*U8)(unsafe.Pointer(pEType))) < 1 || int32(*(*U8)(unsafe.Pointer(pEType))) > 5 {
  73254 		return Xsqlite3CorruptError(tls, 69505)
  73255 	}
  73256 	return SQLITE_OK
  73257 }
  73258 
  73259 func btreeParseCellAdjustSizeForOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) {
  73260 	var minLocal int32
  73261 	var maxLocal int32
  73262 	var surplus int32
  73263 
  73264 	minLocal = int32((*MemPage)(unsafe.Pointer(pPage)).FminLocal)
  73265 	maxLocal = int32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal)
  73266 	surplus = int32(U32(minLocal) + ((*CellInfo)(unsafe.Pointer(pInfo)).FnPayload-U32(minLocal))%((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-U32(4)))
  73267 
  73268 	if surplus <= maxLocal {
  73269 		(*CellInfo)(unsafe.Pointer(pInfo)).FnLocal = U16(surplus)
  73270 	} else {
  73271 		(*CellInfo)(unsafe.Pointer(pInfo)).FnLocal = U16(minLocal)
  73272 	}
  73273 	(*CellInfo)(unsafe.Pointer(pInfo)).FnSize = U16(int32(U16((int64((*CellInfo)(unsafe.Pointer(pInfo)).FpPayload+uintptr((*CellInfo)(unsafe.Pointer(pInfo)).FnLocal))-int64(pCell))/1)) + 4)
  73274 }
  73275 
  73276 func btreePayloadToLocal(tls *libc.TLS, pPage uintptr, nPayload I64) int32 {
  73277 	var maxLocal int32
  73278 	maxLocal = int32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal)
  73279 	if nPayload <= I64(maxLocal) {
  73280 		return int32(nPayload)
  73281 	} else {
  73282 		var minLocal int32
  73283 		var surplus int32
  73284 		minLocal = int32((*MemPage)(unsafe.Pointer(pPage)).FminLocal)
  73285 		surplus = int32(I64(minLocal) + (nPayload-I64(minLocal))%I64((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-U32(4)))
  73286 		if surplus <= maxLocal {
  73287 			return surplus
  73288 		}
  73289 		return minLocal
  73290 	}
  73291 	return int32(0)
  73292 }
  73293 
  73294 func btreeParseCellPtrNoPayload(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) {
  73295 	_ = pPage
  73296 	(*CellInfo)(unsafe.Pointer(pInfo)).FnSize = U16(4 + int32(Xsqlite3GetVarint(tls, pCell+4, pInfo)))
  73297 	(*CellInfo)(unsafe.Pointer(pInfo)).FnPayload = U32(0)
  73298 	(*CellInfo)(unsafe.Pointer(pInfo)).FnLocal = U16(0)
  73299 	(*CellInfo)(unsafe.Pointer(pInfo)).FpPayload = uintptr(0)
  73300 	return
  73301 }
  73302 
  73303 func btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) {
  73304 	bp := tls.Alloc(8)
  73305 	defer tls.Free(8)
  73306 
  73307 	var pIter uintptr
  73308 	var nPayload U32
  73309 
  73310 	pIter = pCell
  73311 
  73312 	nPayload = U32(*(*U8)(unsafe.Pointer(pIter)))
  73313 	if nPayload >= U32(0x80) {
  73314 		var pEnd uintptr = pIter + 8
  73315 		nPayload = nPayload & U32(0x7f)
  73316 		for __ccgo := true; __ccgo; __ccgo = int32(*(*U8)(unsafe.Pointer(pIter))) >= 0x80 && pIter < pEnd {
  73317 			nPayload = nPayload<<7 | U32(int32(*(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1))))&0x7f)
  73318 		}
  73319 	}
  73320 	pIter++
  73321 
  73322 	*(*U64)(unsafe.Pointer(bp)) = U64(*(*U8)(unsafe.Pointer(pIter)))
  73323 	if *(*U64)(unsafe.Pointer(bp)) >= uint64(0x80) {
  73324 		var x U8
  73325 		*(*U64)(unsafe.Pointer(bp)) = *(*U64)(unsafe.Pointer(bp))&uint64(0x7f)<<7 | U64(int32(libc.AssignUint8(&x, *(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1)))))&0x7f)
  73326 		if int32(x) >= 0x80 {
  73327 			*(*U64)(unsafe.Pointer(bp)) = *(*U64)(unsafe.Pointer(bp))<<7 | U64(int32(libc.AssignUint8(&x, *(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1)))))&0x7f)
  73328 			if int32(x) >= 0x80 {
  73329 				*(*U64)(unsafe.Pointer(bp)) = *(*U64)(unsafe.Pointer(bp))<<7 | U64(int32(libc.AssignUint8(&x, *(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1)))))&0x7f)
  73330 				if int32(x) >= 0x80 {
  73331 					*(*U64)(unsafe.Pointer(bp)) = *(*U64)(unsafe.Pointer(bp))<<7 | U64(int32(libc.AssignUint8(&x, *(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1)))))&0x7f)
  73332 					if int32(x) >= 0x80 {
  73333 						*(*U64)(unsafe.Pointer(bp)) = *(*U64)(unsafe.Pointer(bp))<<7 | U64(int32(libc.AssignUint8(&x, *(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1)))))&0x7f)
  73334 						if int32(x) >= 0x80 {
  73335 							*(*U64)(unsafe.Pointer(bp)) = *(*U64)(unsafe.Pointer(bp))<<7 | U64(int32(libc.AssignUint8(&x, *(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1)))))&0x7f)
  73336 							if int32(x) >= 0x80 {
  73337 								*(*U64)(unsafe.Pointer(bp)) = *(*U64)(unsafe.Pointer(bp))<<7 | U64(int32(libc.AssignUint8(&x, *(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1)))))&0x7f)
  73338 								if int32(x) >= 0x80 {
  73339 									*(*U64)(unsafe.Pointer(bp)) = *(*U64)(unsafe.Pointer(bp))<<8 | U64(*(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1))))
  73340 								}
  73341 							}
  73342 						}
  73343 					}
  73344 				}
  73345 			}
  73346 		}
  73347 	}
  73348 	pIter++
  73349 
  73350 	(*CellInfo)(unsafe.Pointer(pInfo)).FnKey = *(*I64)(unsafe.Pointer(bp))
  73351 	(*CellInfo)(unsafe.Pointer(pInfo)).FnPayload = nPayload
  73352 	(*CellInfo)(unsafe.Pointer(pInfo)).FpPayload = pIter
  73353 
  73354 	if nPayload <= U32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal) {
  73355 		(*CellInfo)(unsafe.Pointer(pInfo)).FnSize = U16(nPayload + U32(U16((int64(pIter)-int64(pCell))/1)))
  73356 		if int32((*CellInfo)(unsafe.Pointer(pInfo)).FnSize) < 4 {
  73357 			(*CellInfo)(unsafe.Pointer(pInfo)).FnSize = U16(4)
  73358 		}
  73359 		(*CellInfo)(unsafe.Pointer(pInfo)).FnLocal = U16(nPayload)
  73360 	} else {
  73361 		btreeParseCellAdjustSizeForOverflow(tls, pPage, pCell, pInfo)
  73362 	}
  73363 }
  73364 
  73365 func btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) {
  73366 	var pIter uintptr
  73367 	var nPayload U32
  73368 
  73369 	pIter = pCell + uintptr((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize)
  73370 	nPayload = U32(*(*U8)(unsafe.Pointer(pIter)))
  73371 	if nPayload >= U32(0x80) {
  73372 		var pEnd uintptr = pIter + 8
  73373 		nPayload = nPayload & U32(0x7f)
  73374 		for __ccgo := true; __ccgo; __ccgo = int32(*(*U8)(unsafe.Pointer(pIter))) >= 0x80 && pIter < pEnd {
  73375 			nPayload = nPayload<<7 | U32(int32(*(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1))))&0x7f)
  73376 		}
  73377 	}
  73378 	pIter++
  73379 	(*CellInfo)(unsafe.Pointer(pInfo)).FnKey = I64(nPayload)
  73380 	(*CellInfo)(unsafe.Pointer(pInfo)).FnPayload = nPayload
  73381 	(*CellInfo)(unsafe.Pointer(pInfo)).FpPayload = pIter
  73382 
  73383 	if nPayload <= U32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal) {
  73384 		(*CellInfo)(unsafe.Pointer(pInfo)).FnSize = U16(nPayload + U32(U16((int64(pIter)-int64(pCell))/1)))
  73385 		if int32((*CellInfo)(unsafe.Pointer(pInfo)).FnSize) < 4 {
  73386 			(*CellInfo)(unsafe.Pointer(pInfo)).FnSize = U16(4)
  73387 		}
  73388 		(*CellInfo)(unsafe.Pointer(pInfo)).FnLocal = U16(nPayload)
  73389 	} else {
  73390 		btreeParseCellAdjustSizeForOverflow(tls, pPage, pCell, pInfo)
  73391 	}
  73392 }
  73393 
  73394 func btreeParseCell(tls *libc.TLS, pPage uintptr, iCell int32, pInfo uintptr) {
  73395 	(*struct {
  73396 		f func(*libc.TLS, uintptr, uintptr, uintptr)
  73397 	})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxParseCell})).f(tls, pPage, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*iCell)))))), pInfo)
  73398 }
  73399 
  73400 func cellSizePtr(tls *libc.TLS, pPage uintptr, pCell uintptr) U16 {
  73401 	var pIter uintptr = pCell + uintptr((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize)
  73402 	var pEnd uintptr
  73403 	var nSize U32
  73404 
  73405 	nSize = U32(*(*U8)(unsafe.Pointer(pIter)))
  73406 	if nSize >= U32(0x80) {
  73407 		pEnd = pIter + 8
  73408 		nSize = nSize & U32(0x7f)
  73409 		for __ccgo := true; __ccgo; __ccgo = int32(*(*U8)(unsafe.Pointer(pIter))) >= 0x80 && pIter < pEnd {
  73410 			nSize = nSize<<7 | U32(int32(*(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1))))&0x7f)
  73411 		}
  73412 	}
  73413 	pIter++
  73414 
  73415 	if nSize <= U32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal) {
  73416 		nSize = nSize + U32((int64(pIter)-int64(pCell))/1)
  73417 		if nSize < U32(4) {
  73418 			nSize = U32(4)
  73419 		}
  73420 	} else {
  73421 		var minLocal int32 = int32((*MemPage)(unsafe.Pointer(pPage)).FminLocal)
  73422 		nSize = U32(minLocal) + (nSize-U32(minLocal))%((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-U32(4))
  73423 
  73424 		if nSize > U32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal) {
  73425 			nSize = U32(minLocal)
  73426 		}
  73427 		nSize = nSize + U32(4+int32(U16((int64(pIter)-int64(pCell))/1)))
  73428 	}
  73429 
  73430 	return U16(nSize)
  73431 }
  73432 
  73433 func cellSizePtrNoPayload(tls *libc.TLS, pPage uintptr, pCell uintptr) U16 {
  73434 	var pIter uintptr = pCell + uintptr(4)
  73435 	var pEnd uintptr
  73436 
  73437 	_ = pPage
  73438 
  73439 	pEnd = pIter + uintptr(9)
  73440 	for int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pIter, 1))))&0x80 != 0 && pIter < pEnd {
  73441 	}
  73442 
  73443 	return U16((int64(pIter) - int64(pCell)) / 1)
  73444 }
  73445 
  73446 func cellSizePtrTableLeaf(tls *libc.TLS, pPage uintptr, pCell uintptr) U16 {
  73447 	var pIter uintptr = pCell
  73448 	var pEnd uintptr
  73449 	var nSize U32
  73450 
  73451 	nSize = U32(*(*U8)(unsafe.Pointer(pIter)))
  73452 	if nSize >= U32(0x80) {
  73453 		pEnd = pIter + 8
  73454 		nSize = nSize & U32(0x7f)
  73455 		for __ccgo := true; __ccgo; __ccgo = int32(*(*U8)(unsafe.Pointer(pIter))) >= 0x80 && pIter < pEnd {
  73456 			nSize = nSize<<7 | U32(int32(*(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1))))&0x7f)
  73457 		}
  73458 	}
  73459 	pIter++
  73460 
  73461 	if int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pIter, 1))))&0x80 != 0 &&
  73462 		int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pIter, 1))))&0x80 != 0 &&
  73463 		int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pIter, 1))))&0x80 != 0 &&
  73464 		int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pIter, 1))))&0x80 != 0 &&
  73465 		int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pIter, 1))))&0x80 != 0 &&
  73466 		int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pIter, 1))))&0x80 != 0 &&
  73467 		int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pIter, 1))))&0x80 != 0 &&
  73468 		int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pIter, 1))))&0x80 != 0 {
  73469 		pIter++
  73470 	}
  73471 
  73472 	if nSize <= U32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal) {
  73473 		nSize = nSize + U32((int64(pIter)-int64(pCell))/1)
  73474 		if nSize < U32(4) {
  73475 			nSize = U32(4)
  73476 		}
  73477 	} else {
  73478 		var minLocal int32 = int32((*MemPage)(unsafe.Pointer(pPage)).FminLocal)
  73479 		nSize = U32(minLocal) + (nSize-U32(minLocal))%((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-U32(4))
  73480 
  73481 		if nSize > U32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal) {
  73482 			nSize = U32(minLocal)
  73483 		}
  73484 		nSize = nSize + U32(4+int32(U16((int64(pIter)-int64(pCell))/1)))
  73485 	}
  73486 
  73487 	return U16(nSize)
  73488 }
  73489 
  73490 func ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr, pRC uintptr) {
  73491 	bp := tls.Alloc(24)
  73492 	defer tls.Free(24)
  73493 
  73494 	if *(*int32)(unsafe.Pointer(pRC)) != 0 {
  73495 		return
  73496 	}
  73497 
  73498 	(*struct {
  73499 		f func(*libc.TLS, uintptr, uintptr, uintptr)
  73500 	})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxParseCell})).f(tls, pPage, pCell, bp)
  73501 	if U32((*CellInfo)(unsafe.Pointer(bp)).FnLocal) < (*CellInfo)(unsafe.Pointer(bp)).FnPayload {
  73502 		var ovfl Pgno
  73503 		if Uptr((*MemPage)(unsafe.Pointer(pSrc)).FaDataEnd) >= Uptr(pCell) && Uptr((*MemPage)(unsafe.Pointer(pSrc)).FaDataEnd) < Uptr(pCell+uintptr((*CellInfo)(unsafe.Pointer(bp)).FnLocal)) {
  73504 			*(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 69897)
  73505 			return
  73506 		}
  73507 		ovfl = Xsqlite3Get4byte(tls, pCell+uintptr(int32((*CellInfo)(unsafe.Pointer(bp)).FnSize)-4))
  73508 		ptrmapPut(tls, (*MemPage)(unsafe.Pointer(pPage)).FpBt, ovfl, uint8(PTRMAP_OVERFLOW1), (*MemPage)(unsafe.Pointer(pPage)).Fpgno, pRC)
  73509 	}
  73510 }
  73511 
  73512 func defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) int32 {
  73513 	var i int32
  73514 	var pc int32
  73515 	var hdr int32
  73516 	var size int32
  73517 	var usableSize int32
  73518 	var cellOffset int32
  73519 	var cbrk int32
  73520 	var nCell int32
  73521 	var data uintptr
  73522 	var temp uintptr
  73523 	var src uintptr
  73524 	var iCellFirst int32
  73525 	var iCellLast int32
  73526 	var iCellStart int32
  73527 	var pEnd uintptr
  73528 	var pAddr uintptr
  73529 	var sz2 int32
  73530 	var sz int32
  73531 	var top int32
  73532 	var iFree2 int32
  73533 	var iFree int32
  73534 	var pAddr1 uintptr
  73535 
  73536 	data = (*MemPage)(unsafe.Pointer(pPage)).FaData
  73537 	hdr = int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)
  73538 	cellOffset = int32((*MemPage)(unsafe.Pointer(pPage)).FcellOffset)
  73539 	nCell = int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)
  73540 
  73541 	iCellFirst = cellOffset + 2*nCell
  73542 	usableSize = int32((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)
  73543 
  73544 	if !(int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+7)))) <= nMaxFrag) {
  73545 		goto __1
  73546 	}
  73547 	iFree = int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+1))))<<8 | int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+1) + 1)))
  73548 	if !(iFree > usableSize-4) {
  73549 		goto __2
  73550 	}
  73551 	return Xsqlite3CorruptError(tls, 69955)
  73552 __2:
  73553 	;
  73554 	if !(iFree != 0) {
  73555 		goto __3
  73556 	}
  73557 	iFree2 = int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))<<8 | int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree) + 1)))
  73558 	if !(iFree2 > usableSize-4) {
  73559 		goto __4
  73560 	}
  73561 	return Xsqlite3CorruptError(tls, 69958)
  73562 __4:
  73563 	;
  73564 	if !(0 == iFree2 || int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2)))) == 0 && int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+1)))) == 0) {
  73565 		goto __5
  73566 	}
  73567 	pEnd = data + uintptr(cellOffset+nCell*2)
  73568 	sz2 = 0
  73569 	sz = int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+2))))<<8 | int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+2) + 1)))
  73570 	top = int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+5))))<<8 | int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+5) + 1)))
  73571 	if !(top >= iFree) {
  73572 		goto __6
  73573 	}
  73574 	return Xsqlite3CorruptError(tls, 69966)
  73575 __6:
  73576 	;
  73577 	if !(iFree2 != 0) {
  73578 		goto __7
  73579 	}
  73580 	if !(iFree+sz > iFree2) {
  73581 		goto __9
  73582 	}
  73583 	return Xsqlite3CorruptError(tls, 69969)
  73584 __9:
  73585 	;
  73586 	sz2 = int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+2))))<<8 | int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+2) + 1)))
  73587 	if !(iFree2+sz2 > usableSize) {
  73588 		goto __10
  73589 	}
  73590 	return Xsqlite3CorruptError(tls, 69971)
  73591 __10:
  73592 	;
  73593 	libc.Xmemmove(tls, data+uintptr(iFree+sz+sz2), data+uintptr(iFree+sz), uint64(iFree2-(iFree+sz)))
  73594 	sz = sz + sz2
  73595 	goto __8
  73596 __7:
  73597 	if !(iFree+sz > usableSize) {
  73598 		goto __11
  73599 	}
  73600 	return Xsqlite3CorruptError(tls, 69975)
  73601 __11:
  73602 	;
  73603 __8:
  73604 	;
  73605 	cbrk = top + sz
  73606 
  73607 	libc.Xmemmove(tls, data+uintptr(cbrk), data+uintptr(top), uint64(iFree-top))
  73608 	pAddr = data + uintptr(cellOffset)
  73609 __12:
  73610 	if !(pAddr < pEnd) {
  73611 		goto __14
  73612 	}
  73613 	pc = int32(*(*U8)(unsafe.Pointer(pAddr)))<<8 | int32(*(*U8)(unsafe.Pointer(pAddr + 1)))
  73614 	if !(pc < iFree) {
  73615 		goto __15
  73616 	}
  73617 	*(*U8)(unsafe.Pointer(pAddr)) = U8((pc + sz) >> 8)
  73618 	*(*U8)(unsafe.Pointer(pAddr + 1)) = U8(pc + sz)
  73619 	goto __16
  73620 __15:
  73621 	if !(pc < iFree2) {
  73622 		goto __17
  73623 	}
  73624 	*(*U8)(unsafe.Pointer(pAddr)) = U8((pc + sz2) >> 8)
  73625 	*(*U8)(unsafe.Pointer(pAddr + 1)) = U8(pc + sz2)
  73626 __17:
  73627 	;
  73628 __16:
  73629 	;
  73630 	goto __13
  73631 __13:
  73632 	pAddr += uintptr(2)
  73633 	goto __12
  73634 	goto __14
  73635 __14:
  73636 	;
  73637 	goto defragment_out
  73638 __5:
  73639 	;
  73640 __3:
  73641 	;
  73642 __1:
  73643 	;
  73644 	cbrk = usableSize
  73645 	iCellLast = usableSize - 4
  73646 	iCellStart = int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+5))))<<8 | int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+5) + 1)))
  73647 	if !(nCell > 0) {
  73648 		goto __18
  73649 	}
  73650 	temp = Xsqlite3PagerTempSpace(tls, (*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FpPager)
  73651 	libc.Xmemcpy(tls, temp+uintptr(iCellStart), data+uintptr(iCellStart), uint64(usableSize-iCellStart))
  73652 	src = temp
  73653 	i = 0
  73654 __19:
  73655 	if !(i < nCell) {
  73656 		goto __21
  73657 	}
  73658 	pAddr1 = data + uintptr(cellOffset+i*2)
  73659 	pc = int32(*(*U8)(unsafe.Pointer(pAddr1)))<<8 | int32(*(*U8)(unsafe.Pointer(pAddr1 + 1)))
  73660 
  73661 	if !(pc < iCellStart || pc > iCellLast) {
  73662 		goto __22
  73663 	}
  73664 	return Xsqlite3CorruptError(tls, 70008)
  73665 __22:
  73666 	;
  73667 	size = int32((*struct {
  73668 		f func(*libc.TLS, uintptr, uintptr) U16
  73669 	})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxCellSize})).f(tls, pPage, src+uintptr(pc)))
  73670 	cbrk = cbrk - size
  73671 	if !(cbrk < iCellStart || pc+size > usableSize) {
  73672 		goto __23
  73673 	}
  73674 	return Xsqlite3CorruptError(tls, 70014)
  73675 __23:
  73676 	;
  73677 	*(*U8)(unsafe.Pointer(pAddr1)) = U8(cbrk >> 8)
  73678 	*(*U8)(unsafe.Pointer(pAddr1 + 1)) = U8(cbrk)
  73679 	libc.Xmemcpy(tls, data+uintptr(cbrk), src+uintptr(pc), uint64(size))
  73680 	goto __20
  73681 __20:
  73682 	i++
  73683 	goto __19
  73684 	goto __21
  73685 __21:
  73686 	;
  73687 __18:
  73688 	;
  73689 	*(*uint8)(unsafe.Pointer(data + uintptr(hdr+7))) = uint8(0)
  73690 
  73691 defragment_out:
  73692 	;
  73693 	if !(int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+7))))+cbrk-iCellFirst != (*MemPage)(unsafe.Pointer(pPage)).FnFree) {
  73694 		goto __24
  73695 	}
  73696 	return Xsqlite3CorruptError(tls, 70028)
  73697 __24:
  73698 	;
  73699 	*(*uint8)(unsafe.Pointer(data + uintptr(hdr+5))) = U8(cbrk >> 8)
  73700 	*(*uint8)(unsafe.Pointer(data + uintptr(hdr+5) + 1)) = U8(cbrk)
  73701 	*(*uint8)(unsafe.Pointer(data + uintptr(hdr+1))) = uint8(0)
  73702 	*(*uint8)(unsafe.Pointer(data + uintptr(hdr+2))) = uint8(0)
  73703 	libc.Xmemset(tls, data+uintptr(iCellFirst), 0, uint64(cbrk-iCellFirst))
  73704 
  73705 	return SQLITE_OK
  73706 }
  73707 
  73708 func pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) uintptr {
  73709 	var hdr int32 = int32((*MemPage)(unsafe.Pointer(pPg)).FhdrOffset)
  73710 	var aData uintptr = (*MemPage)(unsafe.Pointer(pPg)).FaData
  73711 	var iAddr int32 = hdr + 1
  73712 	var pTmp uintptr = aData + uintptr(iAddr)
  73713 	var pc int32 = int32(*(*U8)(unsafe.Pointer(pTmp)))<<8 | int32(*(*U8)(unsafe.Pointer(pTmp + 1)))
  73714 	var x int32
  73715 	var maxPC int32 = int32((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPg)).FpBt)).FusableSize - U32(nByte))
  73716 	var size int32
  73717 
  73718 	for pc <= maxPC {
  73719 		pTmp = aData + uintptr(pc+2)
  73720 		size = int32(*(*U8)(unsafe.Pointer(pTmp)))<<8 | int32(*(*U8)(unsafe.Pointer(pTmp + 1)))
  73721 		if libc.AssignInt32(&x, size-nByte) >= 0 {
  73722 			if x < 4 {
  73723 				if int32(*(*U8)(unsafe.Pointer(aData + uintptr(hdr+7)))) > 57 {
  73724 					return uintptr(0)
  73725 				}
  73726 
  73727 				libc.Xmemcpy(tls, aData+uintptr(iAddr), aData+uintptr(pc), uint64(2))
  73728 				*(*U8)(unsafe.Pointer(aData + uintptr(hdr+7))) += U8(int32(U8(x)))
  73729 				return aData + uintptr(pc)
  73730 			} else if x+pc > maxPC {
  73731 				*(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 70085)
  73732 				return uintptr(0)
  73733 			} else {
  73734 				*(*U8)(unsafe.Pointer(aData + uintptr(pc+2))) = U8(x >> 8)
  73735 				*(*U8)(unsafe.Pointer(aData + uintptr(pc+2) + 1)) = U8(x)
  73736 			}
  73737 			return aData + uintptr(pc+x)
  73738 		}
  73739 		iAddr = pc
  73740 		pTmp = aData + uintptr(pc)
  73741 		pc = int32(*(*U8)(unsafe.Pointer(pTmp)))<<8 | int32(*(*U8)(unsafe.Pointer(pTmp + 1)))
  73742 		if pc <= iAddr {
  73743 			if pc != 0 {
  73744 				*(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 70100)
  73745 			}
  73746 			return uintptr(0)
  73747 		}
  73748 	}
  73749 	if pc > maxPC+nByte-4 {
  73750 		*(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 70107)
  73751 	}
  73752 	return uintptr(0)
  73753 }
  73754 
  73755 func allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) int32 {
  73756 	bp := tls.Alloc(4)
  73757 	defer tls.Free(4)
  73758 
  73759 	var hdr int32 = int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)
  73760 	var data uintptr = (*MemPage)(unsafe.Pointer(pPage)).FaData
  73761 	var top int32
  73762 	*(*int32)(unsafe.Pointer(bp)) = SQLITE_OK
  73763 	var pTmp uintptr
  73764 	var gap int32
  73765 
  73766 	gap = int32((*MemPage)(unsafe.Pointer(pPage)).FcellOffset) + 2*int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)
  73767 
  73768 	pTmp = data + uintptr(hdr+5)
  73769 	top = int32(*(*U8)(unsafe.Pointer(pTmp)))<<8 | int32(*(*U8)(unsafe.Pointer(pTmp + 1)))
  73770 
  73771 	if gap > top {
  73772 		if top == 0 && (*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize == U32(65536) {
  73773 			top = 65536
  73774 		} else {
  73775 			return Xsqlite3CorruptError(tls, 70156)
  73776 		}
  73777 	}
  73778 
  73779 	if (*(*U8)(unsafe.Pointer(data + uintptr(hdr+2))) != 0 || *(*U8)(unsafe.Pointer(data + uintptr(hdr+1))) != 0) && gap+2 <= top {
  73780 		var pSpace uintptr = pageFindSlot(tls, pPage, nByte, bp)
  73781 		if pSpace != 0 {
  73782 			var g2 int32
  73783 
  73784 			*(*int32)(unsafe.Pointer(pIdx)) = libc.AssignInt32(&g2, int32((int64(pSpace)-int64(data))/1))
  73785 			if g2 <= gap {
  73786 				return Xsqlite3CorruptError(tls, 70174)
  73787 			} else {
  73788 				return SQLITE_OK
  73789 			}
  73790 		} else if *(*int32)(unsafe.Pointer(bp)) != 0 {
  73791 			return *(*int32)(unsafe.Pointer(bp))
  73792 		}
  73793 	}
  73794 
  73795 	if gap+2+nByte > top {
  73796 		*(*int32)(unsafe.Pointer(bp)) = defragmentPage(tls, pPage, func() int32 {
  73797 			if 4 < (*MemPage)(unsafe.Pointer(pPage)).FnFree-(2+nByte) {
  73798 				return 4
  73799 			}
  73800 			return (*MemPage)(unsafe.Pointer(pPage)).FnFree - (2 + nByte)
  73801 		}())
  73802 		if *(*int32)(unsafe.Pointer(bp)) != 0 {
  73803 			return *(*int32)(unsafe.Pointer(bp))
  73804 		}
  73805 		top = (int32(*(*U8)(unsafe.Pointer(data + uintptr(hdr+5))))<<8|int32(*(*U8)(unsafe.Pointer(data + uintptr(hdr+5) + 1)))-1)&0xffff + 1
  73806 
  73807 	}
  73808 
  73809 	top = top - nByte
  73810 	*(*U8)(unsafe.Pointer(data + uintptr(hdr+5))) = U8(top >> 8)
  73811 	*(*U8)(unsafe.Pointer(data + uintptr(hdr+5) + 1)) = U8(top)
  73812 
  73813 	*(*int32)(unsafe.Pointer(pIdx)) = top
  73814 	return SQLITE_OK
  73815 }
  73816 
  73817 func freeSpace(tls *libc.TLS, pPage uintptr, iStart U16, iSize U16) int32 {
  73818 	var iPtr U16
  73819 	var iFreeBlk U16
  73820 	var hdr U8
  73821 	var nFrag U8 = U8(0)
  73822 	var iOrigSize U16 = iSize
  73823 	var x U16
  73824 	var iEnd U32 = U32(int32(iStart) + int32(iSize))
  73825 	var data uintptr = (*MemPage)(unsafe.Pointer(pPage)).FaData
  73826 	var pTmp uintptr
  73827 
  73828 	hdr = (*MemPage)(unsafe.Pointer(pPage)).FhdrOffset
  73829 	iPtr = U16(int32(hdr) + 1)
  73830 	if int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iPtr)+1)))) == 0 && int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 {
  73831 		iFreeBlk = U16(0)
  73832 	} else {
  73833 		for int32(libc.AssignUint16(&iFreeBlk, U16(int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr))))<<8|int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)))))) < int32(iStart) {
  73834 			if int32(iFreeBlk) <= int32(iPtr) {
  73835 				if int32(iFreeBlk) == 0 {
  73836 					break
  73837 				}
  73838 				return Xsqlite3CorruptError(tls, 70253)
  73839 			}
  73840 			iPtr = iFreeBlk
  73841 		}
  73842 		if U32(iFreeBlk) > (*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-U32(4) {
  73843 			return Xsqlite3CorruptError(tls, 70258)
  73844 		}
  73845 
  73846 		if iFreeBlk != 0 && iEnd+U32(3) >= U32(iFreeBlk) {
  73847 			nFrag = U8(U32(iFreeBlk) - iEnd)
  73848 			if iEnd > U32(iFreeBlk) {
  73849 				return Xsqlite3CorruptError(tls, 70270)
  73850 			}
  73851 			iEnd = U32(int32(iFreeBlk) + (int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iFreeBlk)+2))))<<8 | int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iFreeBlk)+2) + 1)))))
  73852 			if iEnd > (*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize {
  73853 				return Xsqlite3CorruptError(tls, 70273)
  73854 			}
  73855 			iSize = U16(iEnd - U32(iStart))
  73856 			iFreeBlk = U16(int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk))))<<8 | int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk) + 1))))
  73857 		}
  73858 
  73859 		if int32(iPtr) > int32(hdr)+1 {
  73860 			var iPtrEnd int32 = int32(iPtr) + (int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iPtr)+2))))<<8 | int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iPtr)+2) + 1))))
  73861 			if iPtrEnd+3 >= int32(iStart) {
  73862 				if iPtrEnd > int32(iStart) {
  73863 					return Xsqlite3CorruptError(tls, 70286)
  73864 				}
  73865 				nFrag = U8(int32(nFrag) + (int32(iStart) - iPtrEnd))
  73866 				iSize = U16(iEnd - U32(iPtr))
  73867 				iStart = iPtr
  73868 			}
  73869 		}
  73870 		if int32(nFrag) > int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+7)))) {
  73871 			return Xsqlite3CorruptError(tls, 70292)
  73872 		}
  73873 		*(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+7))) -= uint8(int32(nFrag))
  73874 	}
  73875 	pTmp = data + uintptr(int32(hdr)+5)
  73876 	x = U16(int32(*(*U8)(unsafe.Pointer(pTmp)))<<8 | int32(*(*U8)(unsafe.Pointer(pTmp + 1))))
  73877 	if int32(iStart) <= int32(x) {
  73878 		if int32(iStart) < int32(x) {
  73879 			return Xsqlite3CorruptError(tls, 70301)
  73880 		}
  73881 		if int32(iPtr) != int32(hdr)+1 {
  73882 			return Xsqlite3CorruptError(tls, 70302)
  73883 		}
  73884 		*(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+1))) = U8(int32(iFreeBlk) >> 8)
  73885 		*(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+1) + 1)) = U8(iFreeBlk)
  73886 		*(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+5))) = U8(iEnd >> 8)
  73887 		*(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+5) + 1)) = U8(iEnd)
  73888 	} else {
  73889 		*(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = U8(int32(iStart) >> 8)
  73890 		*(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = U8(iStart)
  73891 	}
  73892 	if int32((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FbtsFlags)&BTS_FAST_SECURE != 0 {
  73893 		libc.Xmemset(tls, data+uintptr(iStart), 0, uint64(iSize))
  73894 	}
  73895 	*(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = U8(int32(iFreeBlk) >> 8)
  73896 	*(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = U8(iFreeBlk)
  73897 	*(*uint8)(unsafe.Pointer(data + uintptr(int32(iStart)+2))) = U8(int32(iSize) >> 8)
  73898 	*(*uint8)(unsafe.Pointer(data + uintptr(int32(iStart)+2) + 1)) = U8(iSize)
  73899 	*(*int32)(unsafe.Pointer(pPage + 20)) += int32(iOrigSize)
  73900 	return SQLITE_OK
  73901 }
  73902 
  73903 func decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) int32 {
  73904 	var pBt uintptr
  73905 
  73906 	pBt = (*MemPage)(unsafe.Pointer(pPage)).FpBt
  73907 	(*MemPage)(unsafe.Pointer(pPage)).Fmax1bytePayload = (*BtShared)(unsafe.Pointer(pBt)).Fmax1bytePayload
  73908 	if flagByte >= PTF_ZERODATA|PTF_LEAF {
  73909 		(*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize = U8(0)
  73910 		(*MemPage)(unsafe.Pointer(pPage)).Fleaf = U8(1)
  73911 		if flagByte == PTF_LEAFDATA|PTF_INTKEY|PTF_LEAF {
  73912 			(*MemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = U8(1)
  73913 			(*MemPage)(unsafe.Pointer(pPage)).FxCellSize = *(*uintptr)(unsafe.Pointer(&struct {
  73914 				f func(*libc.TLS, uintptr, uintptr) U16
  73915 			}{cellSizePtrTableLeaf}))
  73916 			(*MemPage)(unsafe.Pointer(pPage)).FxParseCell = *(*uintptr)(unsafe.Pointer(&struct {
  73917 				f func(*libc.TLS, uintptr, uintptr, uintptr)
  73918 			}{btreeParseCellPtr}))
  73919 			(*MemPage)(unsafe.Pointer(pPage)).FintKey = U8(1)
  73920 			(*MemPage)(unsafe.Pointer(pPage)).FmaxLocal = (*BtShared)(unsafe.Pointer(pBt)).FmaxLeaf
  73921 			(*MemPage)(unsafe.Pointer(pPage)).FminLocal = (*BtShared)(unsafe.Pointer(pBt)).FminLeaf
  73922 		} else if flagByte == PTF_ZERODATA|PTF_LEAF {
  73923 			(*MemPage)(unsafe.Pointer(pPage)).FintKey = U8(0)
  73924 			(*MemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = U8(0)
  73925 			(*MemPage)(unsafe.Pointer(pPage)).FxCellSize = *(*uintptr)(unsafe.Pointer(&struct {
  73926 				f func(*libc.TLS, uintptr, uintptr) U16
  73927 			}{cellSizePtr}))
  73928 			(*MemPage)(unsafe.Pointer(pPage)).FxParseCell = *(*uintptr)(unsafe.Pointer(&struct {
  73929 				f func(*libc.TLS, uintptr, uintptr, uintptr)
  73930 			}{btreeParseCellPtrIndex}))
  73931 			(*MemPage)(unsafe.Pointer(pPage)).FmaxLocal = (*BtShared)(unsafe.Pointer(pBt)).FmaxLocal
  73932 			(*MemPage)(unsafe.Pointer(pPage)).FminLocal = (*BtShared)(unsafe.Pointer(pBt)).FminLocal
  73933 		} else {
  73934 			(*MemPage)(unsafe.Pointer(pPage)).FintKey = U8(0)
  73935 			(*MemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = U8(0)
  73936 			(*MemPage)(unsafe.Pointer(pPage)).FxCellSize = *(*uintptr)(unsafe.Pointer(&struct {
  73937 				f func(*libc.TLS, uintptr, uintptr) U16
  73938 			}{cellSizePtr}))
  73939 			(*MemPage)(unsafe.Pointer(pPage)).FxParseCell = *(*uintptr)(unsafe.Pointer(&struct {
  73940 				f func(*libc.TLS, uintptr, uintptr, uintptr)
  73941 			}{btreeParseCellPtrIndex}))
  73942 			return Xsqlite3CorruptError(tls, 70361)
  73943 		}
  73944 	} else {
  73945 		(*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize = U8(4)
  73946 		(*MemPage)(unsafe.Pointer(pPage)).Fleaf = U8(0)
  73947 		if flagByte == PTF_ZERODATA {
  73948 			(*MemPage)(unsafe.Pointer(pPage)).FintKey = U8(0)
  73949 			(*MemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = U8(0)
  73950 			(*MemPage)(unsafe.Pointer(pPage)).FxCellSize = *(*uintptr)(unsafe.Pointer(&struct {
  73951 				f func(*libc.TLS, uintptr, uintptr) U16
  73952 			}{cellSizePtr}))
  73953 			(*MemPage)(unsafe.Pointer(pPage)).FxParseCell = *(*uintptr)(unsafe.Pointer(&struct {
  73954 				f func(*libc.TLS, uintptr, uintptr, uintptr)
  73955 			}{btreeParseCellPtrIndex}))
  73956 			(*MemPage)(unsafe.Pointer(pPage)).FmaxLocal = (*BtShared)(unsafe.Pointer(pBt)).FmaxLocal
  73957 			(*MemPage)(unsafe.Pointer(pPage)).FminLocal = (*BtShared)(unsafe.Pointer(pBt)).FminLocal
  73958 		} else if flagByte == PTF_LEAFDATA|PTF_INTKEY {
  73959 			(*MemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = U8(0)
  73960 			(*MemPage)(unsafe.Pointer(pPage)).FxCellSize = *(*uintptr)(unsafe.Pointer(&struct {
  73961 				f func(*libc.TLS, uintptr, uintptr) U16
  73962 			}{cellSizePtrNoPayload}))
  73963 			(*MemPage)(unsafe.Pointer(pPage)).FxParseCell = *(*uintptr)(unsafe.Pointer(&struct {
  73964 				f func(*libc.TLS, uintptr, uintptr, uintptr)
  73965 			}{btreeParseCellPtrNoPayload}))
  73966 			(*MemPage)(unsafe.Pointer(pPage)).FintKey = U8(1)
  73967 			(*MemPage)(unsafe.Pointer(pPage)).FmaxLocal = (*BtShared)(unsafe.Pointer(pBt)).FmaxLeaf
  73968 			(*MemPage)(unsafe.Pointer(pPage)).FminLocal = (*BtShared)(unsafe.Pointer(pBt)).FminLeaf
  73969 		} else {
  73970 			(*MemPage)(unsafe.Pointer(pPage)).FintKey = U8(0)
  73971 			(*MemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = U8(0)
  73972 			(*MemPage)(unsafe.Pointer(pPage)).FxCellSize = *(*uintptr)(unsafe.Pointer(&struct {
  73973 				f func(*libc.TLS, uintptr, uintptr) U16
  73974 			}{cellSizePtr}))
  73975 			(*MemPage)(unsafe.Pointer(pPage)).FxParseCell = *(*uintptr)(unsafe.Pointer(&struct {
  73976 				f func(*libc.TLS, uintptr, uintptr, uintptr)
  73977 			}{btreeParseCellPtrIndex}))
  73978 			return Xsqlite3CorruptError(tls, 70385)
  73979 		}
  73980 	}
  73981 	return SQLITE_OK
  73982 }
  73983 
  73984 func btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) int32 {
  73985 	var pc int32
  73986 	var hdr U8
  73987 	var data uintptr
  73988 	var usableSize int32
  73989 	var nFree int32
  73990 	var top int32
  73991 	var iCellFirst int32
  73992 	var iCellLast int32
  73993 
  73994 	usableSize = int32((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)
  73995 	hdr = (*MemPage)(unsafe.Pointer(pPage)).FhdrOffset
  73996 	data = (*MemPage)(unsafe.Pointer(pPage)).FaData
  73997 
  73998 	top = (int32(*(*U8)(unsafe.Pointer(data + uintptr(int32(hdr)+5))))<<8|int32(*(*U8)(unsafe.Pointer(data + uintptr(int32(hdr)+5) + 1)))-1)&0xffff + 1
  73999 	iCellFirst = int32(hdr) + 8 + int32((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize) + 2*int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)
  74000 	iCellLast = usableSize - 4
  74001 
  74002 	pc = int32(*(*U8)(unsafe.Pointer(data + uintptr(int32(hdr)+1))))<<8 | int32(*(*U8)(unsafe.Pointer(data + uintptr(int32(hdr)+1) + 1)))
  74003 	nFree = int32(*(*U8)(unsafe.Pointer(data + uintptr(int32(hdr)+7)))) + top
  74004 	if pc > 0 {
  74005 		var next U32
  74006 		var size U32
  74007 		if pc < top {
  74008 			return Xsqlite3CorruptError(tls, 70436)
  74009 		}
  74010 		for 1 != 0 {
  74011 			if pc > iCellLast {
  74012 				return Xsqlite3CorruptError(tls, 70441)
  74013 			}
  74014 			next = U32(int32(*(*U8)(unsafe.Pointer(data + uintptr(pc))))<<8 | int32(*(*U8)(unsafe.Pointer(data + uintptr(pc) + 1))))
  74015 			size = U32(int32(*(*U8)(unsafe.Pointer(data + uintptr(pc+2))))<<8 | int32(*(*U8)(unsafe.Pointer(data + uintptr(pc+2) + 1))))
  74016 			nFree = int32(U32(nFree) + size)
  74017 			if next <= U32(pc)+size+U32(3) {
  74018 				break
  74019 			}
  74020 			pc = int32(next)
  74021 		}
  74022 		if next > U32(0) {
  74023 			return Xsqlite3CorruptError(tls, 70451)
  74024 		}
  74025 		if U32(pc)+size > uint32(usableSize) {
  74026 			return Xsqlite3CorruptError(tls, 70455)
  74027 		}
  74028 	}
  74029 
  74030 	if nFree > usableSize || nFree < iCellFirst {
  74031 		return Xsqlite3CorruptError(tls, 70467)
  74032 	}
  74033 	(*MemPage)(unsafe.Pointer(pPage)).FnFree = int32(U16(nFree - iCellFirst))
  74034 	return SQLITE_OK
  74035 }
  74036 
  74037 func btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) int32 {
  74038 	var iCellFirst int32
  74039 	var iCellLast int32
  74040 	var i int32
  74041 	var sz int32
  74042 	var pc int32
  74043 	var data uintptr
  74044 	var usableSize int32
  74045 	var cellOffset int32
  74046 
  74047 	iCellFirst = int32((*MemPage)(unsafe.Pointer(pPage)).FcellOffset) + 2*int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)
  74048 	usableSize = int32((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)
  74049 	iCellLast = usableSize - 4
  74050 	data = (*MemPage)(unsafe.Pointer(pPage)).FaData
  74051 	cellOffset = int32((*MemPage)(unsafe.Pointer(pPage)).FcellOffset)
  74052 	if !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) {
  74053 		iCellLast--
  74054 	}
  74055 	for i = 0; i < int32((*MemPage)(unsafe.Pointer(pPage)).FnCell); i++ {
  74056 		pc = int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(data + uintptr(cellOffset+i*2)))))
  74057 
  74058 		if pc < iCellFirst || pc > iCellLast {
  74059 			return Xsqlite3CorruptError(tls, 70498)
  74060 		}
  74061 		sz = int32((*struct {
  74062 			f func(*libc.TLS, uintptr, uintptr) U16
  74063 		})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxCellSize})).f(tls, pPage, data+uintptr(pc)))
  74064 
  74065 		if pc+sz > usableSize {
  74066 			return Xsqlite3CorruptError(tls, 70503)
  74067 		}
  74068 	}
  74069 	return SQLITE_OK
  74070 }
  74071 
  74072 func btreeInitPage(tls *libc.TLS, pPage uintptr) int32 {
  74073 	var data uintptr
  74074 	var pBt uintptr
  74075 
  74076 	pBt = (*MemPage)(unsafe.Pointer(pPage)).FpBt
  74077 	data = (*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)
  74078 
  74079 	if decodeFlags(tls, pPage, int32(*(*U8)(unsafe.Pointer(data)))) != 0 {
  74080 		return Xsqlite3CorruptError(tls, 70535)
  74081 	}
  74082 
  74083 	(*MemPage)(unsafe.Pointer(pPage)).FmaskPage = U16((*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(1))
  74084 	(*MemPage)(unsafe.Pointer(pPage)).FnOverflow = U8(0)
  74085 	(*MemPage)(unsafe.Pointer(pPage)).FcellOffset = U16(int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) + 8 + int32((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize))
  74086 	(*MemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize) + uintptr(8)
  74087 	(*MemPage)(unsafe.Pointer(pPage)).FaDataEnd = (*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*BtShared)(unsafe.Pointer(pBt)).FpageSize)
  74088 	(*MemPage)(unsafe.Pointer(pPage)).FaDataOfst = (*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize)
  74089 
  74090 	(*MemPage)(unsafe.Pointer(pPage)).FnCell = U16(int32(*(*U8)(unsafe.Pointer(data + 3)))<<8 | int32(*(*U8)(unsafe.Pointer(data + 3 + 1))))
  74091 	if U32((*MemPage)(unsafe.Pointer(pPage)).FnCell) > ((*BtShared)(unsafe.Pointer(pBt)).FpageSize-U32(8))/U32(6) {
  74092 		return Xsqlite3CorruptError(tls, 70549)
  74093 	}
  74094 
  74095 	(*MemPage)(unsafe.Pointer(pPage)).FnFree = -1
  74096 	(*MemPage)(unsafe.Pointer(pPage)).FisInit = U8(1)
  74097 	if (*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags&uint64(SQLITE_CellSizeCk) != 0 {
  74098 		return btreeCellSizeCheck(tls, pPage)
  74099 	}
  74100 	return SQLITE_OK
  74101 }
  74102 
  74103 func zeroPage(tls *libc.TLS, pPage uintptr, flags int32) {
  74104 	var data uintptr = (*MemPage)(unsafe.Pointer(pPage)).FaData
  74105 	var pBt uintptr = (*MemPage)(unsafe.Pointer(pPage)).FpBt
  74106 	var hdr U8 = (*MemPage)(unsafe.Pointer(pPage)).FhdrOffset
  74107 	var first U16
  74108 
  74109 	if int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_FAST_SECURE != 0 {
  74110 		libc.Xmemset(tls, data+uintptr(hdr), 0, uint64((*BtShared)(unsafe.Pointer(pBt)).FusableSize-U32(hdr)))
  74111 	}
  74112 	*(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = uint8(int8(flags))
  74113 	first = U16(int32(hdr) + func() int32 {
  74114 		if flags&PTF_LEAF == 0 {
  74115 			return 12
  74116 		}
  74117 		return 8
  74118 	}())
  74119 	libc.Xmemset(tls, data+uintptr(int32(hdr)+1), 0, uint64(4))
  74120 	*(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+7))) = uint8(0)
  74121 	*(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+5))) = U8((*BtShared)(unsafe.Pointer(pBt)).FusableSize >> 8)
  74122 	*(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+5) + 1)) = U8((*BtShared)(unsafe.Pointer(pBt)).FusableSize)
  74123 	(*MemPage)(unsafe.Pointer(pPage)).FnFree = int32(U16((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(first)))
  74124 	decodeFlags(tls, pPage, flags)
  74125 	(*MemPage)(unsafe.Pointer(pPage)).FcellOffset = first
  74126 	(*MemPage)(unsafe.Pointer(pPage)).FaDataEnd = data + uintptr((*BtShared)(unsafe.Pointer(pBt)).FpageSize)
  74127 	(*MemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr(first)
  74128 	(*MemPage)(unsafe.Pointer(pPage)).FaDataOfst = data + uintptr((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize)
  74129 	(*MemPage)(unsafe.Pointer(pPage)).FnOverflow = U8(0)
  74130 
  74131 	(*MemPage)(unsafe.Pointer(pPage)).FmaskPage = U16((*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(1))
  74132 	(*MemPage)(unsafe.Pointer(pPage)).FnCell = U16(0)
  74133 	(*MemPage)(unsafe.Pointer(pPage)).FisInit = U8(1)
  74134 }
  74135 
  74136 func btreePageFromDbPage(tls *libc.TLS, pDbPage uintptr, pgno Pgno, pBt uintptr) uintptr {
  74137 	var pPage uintptr = Xsqlite3PagerGetExtra(tls, pDbPage)
  74138 	if pgno != (*MemPage)(unsafe.Pointer(pPage)).Fpgno {
  74139 		(*MemPage)(unsafe.Pointer(pPage)).FaData = Xsqlite3PagerGetData(tls, pDbPage)
  74140 		(*MemPage)(unsafe.Pointer(pPage)).FpDbPage = pDbPage
  74141 		(*MemPage)(unsafe.Pointer(pPage)).FpBt = pBt
  74142 		(*MemPage)(unsafe.Pointer(pPage)).Fpgno = pgno
  74143 		(*MemPage)(unsafe.Pointer(pPage)).FhdrOffset = func() uint8 {
  74144 			if pgno == Pgno(1) {
  74145 				return uint8(100)
  74146 			}
  74147 			return uint8(0)
  74148 		}()
  74149 	}
  74150 
  74151 	return pPage
  74152 }
  74153 
  74154 func btreeGetPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 {
  74155 	bp := tls.Alloc(8)
  74156 	defer tls.Free(8)
  74157 
  74158 	var rc int32
  74159 
  74160 	rc = Xsqlite3PagerGet(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, flags)
  74161 	if rc != 0 {
  74162 		return rc
  74163 	}
  74164 	*(*uintptr)(unsafe.Pointer(ppPage)) = btreePageFromDbPage(tls, *(*uintptr)(unsafe.Pointer(bp)), pgno, pBt)
  74165 	return SQLITE_OK
  74166 }
  74167 
  74168 func btreePageLookup(tls *libc.TLS, pBt uintptr, pgno Pgno) uintptr {
  74169 	var pDbPage uintptr
  74170 
  74171 	pDbPage = Xsqlite3PagerLookup(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, pgno)
  74172 	if pDbPage != 0 {
  74173 		return btreePageFromDbPage(tls, pDbPage, pgno, pBt)
  74174 	}
  74175 	return uintptr(0)
  74176 }
  74177 
  74178 func btreePagecount(tls *libc.TLS, pBt uintptr) Pgno {
  74179 	return (*BtShared)(unsafe.Pointer(pBt)).FnPage
  74180 }
  74181 
  74182 func Xsqlite3BtreeLastPage(tls *libc.TLS, p uintptr) Pgno {
  74183 	return btreePagecount(tls, (*Btree)(unsafe.Pointer(p)).FpBt)
  74184 }
  74185 
  74186 func getAndInitPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, pCur uintptr, bReadOnly int32) int32 {
  74187 	bp := tls.Alloc(8)
  74188 	defer tls.Free(8)
  74189 
  74190 	var rc int32
  74191 
  74192 	if !(pgno > btreePagecount(tls, pBt)) {
  74193 		goto __1
  74194 	}
  74195 	rc = Xsqlite3CorruptError(tls, 70704)
  74196 	goto getAndInitPage_error1
  74197 __1:
  74198 	;
  74199 	rc = Xsqlite3PagerGet(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly)
  74200 	if !(rc != 0) {
  74201 		goto __2
  74202 	}
  74203 	goto getAndInitPage_error1
  74204 __2:
  74205 	;
  74206 	*(*uintptr)(unsafe.Pointer(ppPage)) = Xsqlite3PagerGetExtra(tls, *(*uintptr)(unsafe.Pointer(bp)))
  74207 	if !(int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit) == 0) {
  74208 		goto __3
  74209 	}
  74210 	btreePageFromDbPage(tls, *(*uintptr)(unsafe.Pointer(bp)), pgno, pBt)
  74211 	rc = btreeInitPage(tls, *(*uintptr)(unsafe.Pointer(ppPage)))
  74212 	if !(rc != SQLITE_OK) {
  74213 		goto __4
  74214 	}
  74215 	goto getAndInitPage_error2
  74216 __4:
  74217 	;
  74218 __3:
  74219 	;
  74220 	if !(pCur != 0 && (int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FnCell) < 1 || int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FintKey) != int32((*BtCursor)(unsafe.Pointer(pCur)).FcurIntKey))) {
  74221 		goto __5
  74222 	}
  74223 	rc = Xsqlite3CorruptError(tls, 70725)
  74224 	goto getAndInitPage_error2
  74225 __5:
  74226 	;
  74227 	return SQLITE_OK
  74228 
  74229 getAndInitPage_error2:
  74230 	releasePage(tls, *(*uintptr)(unsafe.Pointer(ppPage)))
  74231 getAndInitPage_error1:
  74232 	if !(pCur != 0) {
  74233 		goto __6
  74234 	}
  74235 	(*BtCursor)(unsafe.Pointer(pCur)).FiPage--
  74236 	(*BtCursor)(unsafe.Pointer(pCur)).FpPage = *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FiPage)*8))
  74237 __6:
  74238 	;
  74239 	return rc
  74240 }
  74241 
  74242 func releasePageNotNull(tls *libc.TLS, pPage uintptr) {
  74243 	Xsqlite3PagerUnrefNotNull(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage)
  74244 }
  74245 
  74246 func releasePage(tls *libc.TLS, pPage uintptr) {
  74247 	if pPage != 0 {
  74248 		releasePageNotNull(tls, pPage)
  74249 	}
  74250 }
  74251 
  74252 func releasePageOne(tls *libc.TLS, pPage uintptr) {
  74253 	Xsqlite3PagerUnrefPageOne(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage)
  74254 }
  74255 
  74256 func btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 {
  74257 	var rc int32 = btreeGetPage(tls, pBt, pgno, ppPage, flags)
  74258 	if rc == SQLITE_OK {
  74259 		if Xsqlite3PagerPageRefcount(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FpDbPage) > 1 {
  74260 			releasePage(tls, *(*uintptr)(unsafe.Pointer(ppPage)))
  74261 			*(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0)
  74262 			return Xsqlite3CorruptError(tls, 70791)
  74263 		}
  74264 		(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = U8(0)
  74265 	} else {
  74266 		*(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0)
  74267 	}
  74268 	return rc
  74269 }
  74270 
  74271 func pageReinit(tls *libc.TLS, pData uintptr) {
  74272 	var pPage uintptr
  74273 	pPage = Xsqlite3PagerGetExtra(tls, pData)
  74274 
  74275 	if (*MemPage)(unsafe.Pointer(pPage)).FisInit != 0 {
  74276 		(*MemPage)(unsafe.Pointer(pPage)).FisInit = U8(0)
  74277 		if Xsqlite3PagerPageRefcount(tls, pData) > 1 {
  74278 			btreeInitPage(tls, pPage)
  74279 		}
  74280 	}
  74281 }
  74282 
  74283 func btreeInvokeBusyHandler(tls *libc.TLS, pArg uintptr) int32 {
  74284 	var pBt uintptr = pArg
  74285 
  74286 	return Xsqlite3InvokeBusyHandler(tls, (*BtShared)(unsafe.Pointer(pBt)).Fdb+672)
  74287 }
  74288 
  74289 // Open a database file.
  74290 //
  74291 // zFilename is the name of the database file.  If zFilename is NULL
  74292 // then an ephemeral database is created.  The ephemeral database might
  74293 // be exclusively in memory, or it might use a disk-based memory cache.
  74294 // Either way, the ephemeral database will be automatically deleted
  74295 // when sqlite3BtreeClose() is called.
  74296 //
  74297 // If zFilename is ":memory:" then an in-memory database is created
  74298 // that is automatically destroyed when it is closed.
  74299 //
  74300 // The "flags" parameter is a bitmask that might contain bits like
  74301 // BTREE_OMIT_JOURNAL and/or BTREE_MEMORY.
  74302 //
  74303 // If the database is already opened in the same database connection
  74304 // and we are in shared cache mode, then the open will fail with an
  74305 // SQLITE_CONSTRAINT error.  We cannot allow two or more BtShared
  74306 // objects in the same database connection since doing so will lead
  74307 // to problems with locking.
  74308 func Xsqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintptr, ppBtree uintptr, flags int32, vfsFlags int32) int32 {
  74309 	bp := tls.Alloc(100)
  74310 	defer tls.Free(100)
  74311 
  74312 	var pBt uintptr
  74313 	var p uintptr
  74314 	var mutexOpen uintptr
  74315 	var rc int32
  74316 	var nReserve U8
  74317 
  74318 	var isTempDb int32
  74319 
  74320 	var isMemdb int32
  74321 	var pExisting uintptr
  74322 	var iDb int32
  74323 	var nFilename int32
  74324 	var nFullPathname int32
  74325 	var zFullPathname uintptr
  74326 	var mutexShared uintptr
  74327 	var mutexShared1 uintptr
  74328 	var i int32
  74329 	var pSib uintptr
  74330 	var pFile uintptr
  74331 	pBt = uintptr(0)
  74332 	mutexOpen = uintptr(0)
  74333 	rc = SQLITE_OK
  74334 	isTempDb = libc.Bool32(zFilename == uintptr(0) || int32(*(*int8)(unsafe.Pointer(zFilename))) == 0)
  74335 	isMemdb = libc.Bool32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, ts+5401) == 0 ||
  74336 		isTempDb != 0 && Xsqlite3TempInMemory(tls, db) != 0 ||
  74337 		vfsFlags&SQLITE_OPEN_MEMORY != 0)
  74338 
  74339 	if !(isMemdb != 0) {
  74340 		goto __1
  74341 	}
  74342 	flags = flags | BTREE_MEMORY
  74343 __1:
  74344 	;
  74345 	if !(vfsFlags&SQLITE_OPEN_MAIN_DB != 0 && (isMemdb != 0 || isTempDb != 0)) {
  74346 		goto __2
  74347 	}
  74348 	vfsFlags = vfsFlags&libc.CplInt32(SQLITE_OPEN_MAIN_DB) | SQLITE_OPEN_TEMP_DB
  74349 __2:
  74350 	;
  74351 	p = Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(Btree{})))
  74352 	if !!(p != 0) {
  74353 		goto __3
  74354 	}
  74355 	return SQLITE_NOMEM
  74356 __3:
  74357 	;
  74358 	(*Btree)(unsafe.Pointer(p)).FinTrans = U8(TRANS_NONE)
  74359 	(*Btree)(unsafe.Pointer(p)).Fdb = db
  74360 	(*Btree)(unsafe.Pointer(p)).Flock.FpBtree = p
  74361 	(*Btree)(unsafe.Pointer(p)).Flock.FiTable = Pgno(1)
  74362 
  74363 	if !(isTempDb == 0 && (isMemdb == 0 || vfsFlags&SQLITE_OPEN_URI != 0)) {
  74364 		goto __4
  74365 	}
  74366 	if !(vfsFlags&SQLITE_OPEN_SHAREDCACHE != 0) {
  74367 		goto __5
  74368 	}
  74369 	nFilename = Xsqlite3Strlen30(tls, zFilename) + 1
  74370 	nFullPathname = (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + 1
  74371 	zFullPathname = Xsqlite3Malloc(tls, func() uint64 {
  74372 		if nFullPathname > nFilename {
  74373 			return uint64(nFullPathname)
  74374 		}
  74375 		return uint64(nFilename)
  74376 	}())
  74377 
  74378 	(*Btree)(unsafe.Pointer(p)).Fsharable = U8(1)
  74379 	if !!(zFullPathname != 0) {
  74380 		goto __6
  74381 	}
  74382 	Xsqlite3_free(tls, p)
  74383 	return SQLITE_NOMEM
  74384 __6:
  74385 	;
  74386 	if !(isMemdb != 0) {
  74387 		goto __7
  74388 	}
  74389 	libc.Xmemcpy(tls, zFullPathname, zFilename, uint64(nFilename))
  74390 	goto __8
  74391 __7:
  74392 	rc = Xsqlite3OsFullPathname(tls, pVfs, zFilename,
  74393 		nFullPathname, zFullPathname)
  74394 	if !(rc != 0) {
  74395 		goto __9
  74396 	}
  74397 	if !(rc == SQLITE_OK|int32(2)<<8) {
  74398 		goto __10
  74399 	}
  74400 	rc = SQLITE_OK
  74401 	goto __11
  74402 __10:
  74403 	Xsqlite3_free(tls, zFullPathname)
  74404 	Xsqlite3_free(tls, p)
  74405 	return rc
  74406 __11:
  74407 	;
  74408 __9:
  74409 	;
  74410 __8:
  74411 	;
  74412 	mutexOpen = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_OPEN)
  74413 	Xsqlite3_mutex_enter(tls, mutexOpen)
  74414 	mutexShared = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN)
  74415 	Xsqlite3_mutex_enter(tls, mutexShared)
  74416 	pBt = sqlite3SharedCacheList
  74417 __12:
  74418 	if !(pBt != 0) {
  74419 		goto __14
  74420 	}
  74421 
  74422 	if !(0 == libc.Xstrcmp(tls, zFullPathname, Xsqlite3PagerFilename(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, 0)) &&
  74423 		Xsqlite3PagerVfs(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager) == pVfs) {
  74424 		goto __15
  74425 	}
  74426 	iDb = (*Sqlite3)(unsafe.Pointer(db)).FnDb - 1
  74427 __16:
  74428 	if !(iDb >= 0) {
  74429 		goto __18
  74430 	}
  74431 	pExisting = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpBt
  74432 	if !(pExisting != 0 && (*Btree)(unsafe.Pointer(pExisting)).FpBt == pBt) {
  74433 		goto __19
  74434 	}
  74435 	Xsqlite3_mutex_leave(tls, mutexShared)
  74436 	Xsqlite3_mutex_leave(tls, mutexOpen)
  74437 	Xsqlite3_free(tls, zFullPathname)
  74438 	Xsqlite3_free(tls, p)
  74439 	return SQLITE_CONSTRAINT
  74440 __19:
  74441 	;
  74442 	goto __17
  74443 __17:
  74444 	iDb--
  74445 	goto __16
  74446 	goto __18
  74447 __18:
  74448 	;
  74449 	(*Btree)(unsafe.Pointer(p)).FpBt = pBt
  74450 	(*BtShared)(unsafe.Pointer(pBt)).FnRef++
  74451 	goto __14
  74452 __15:
  74453 	;
  74454 	goto __13
  74455 __13:
  74456 	pBt = (*BtShared)(unsafe.Pointer(pBt)).FpNext
  74457 	goto __12
  74458 	goto __14
  74459 __14:
  74460 	;
  74461 	Xsqlite3_mutex_leave(tls, mutexShared)
  74462 	Xsqlite3_free(tls, zFullPathname)
  74463 __5:
  74464 	;
  74465 __4:
  74466 	;
  74467 	if !(pBt == uintptr(0)) {
  74468 		goto __20
  74469 	}
  74470 
  74471 	pBt = Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(BtShared{})))
  74472 	if !(pBt == uintptr(0)) {
  74473 		goto __21
  74474 	}
  74475 	rc = SQLITE_NOMEM
  74476 	goto btree_open_out
  74477 __21:
  74478 	;
  74479 	rc = Xsqlite3PagerOpen(tls, pVfs, pBt, zFilename,
  74480 		int32(unsafe.Sizeof(MemPage{})), flags, vfsFlags, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{pageReinit})))
  74481 	if !(rc == SQLITE_OK) {
  74482 		goto __22
  74483 	}
  74484 	Xsqlite3PagerSetMmapLimit(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, (*Sqlite3)(unsafe.Pointer(db)).FszMmap)
  74485 	rc = Xsqlite3PagerReadFileheader(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, int32(unsafe.Sizeof([100]uint8{})), bp)
  74486 __22:
  74487 	;
  74488 	if !(rc != SQLITE_OK) {
  74489 		goto __23
  74490 	}
  74491 	goto btree_open_out
  74492 __23:
  74493 	;
  74494 	(*BtShared)(unsafe.Pointer(pBt)).FopenFlags = U8(flags)
  74495 	(*BtShared)(unsafe.Pointer(pBt)).Fdb = db
  74496 	Xsqlite3PagerSetBusyHandler(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, *(*uintptr)(unsafe.Pointer(&struct {
  74497 		f func(*libc.TLS, uintptr) int32
  74498 	}{btreeInvokeBusyHandler})), pBt)
  74499 	(*Btree)(unsafe.Pointer(p)).FpBt = pBt
  74500 
  74501 	(*BtShared)(unsafe.Pointer(pBt)).FpCursor = uintptr(0)
  74502 	(*BtShared)(unsafe.Pointer(pBt)).FpPage1 = uintptr(0)
  74503 	if !(Xsqlite3PagerIsreadonly(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager) != 0) {
  74504 		goto __24
  74505 	}
  74506 	*(*U16)(unsafe.Pointer(pBt + 40)) |= U16(BTS_READ_ONLY)
  74507 __24:
  74508 	;
  74509 	(*BtShared)(unsafe.Pointer(pBt)).FpageSize = U32(int32(*(*uint8)(unsafe.Pointer(bp + 16)))<<8 | int32(*(*uint8)(unsafe.Pointer(bp + 17)))<<16)
  74510 	if !((*BtShared)(unsafe.Pointer(pBt)).FpageSize < U32(512) || (*BtShared)(unsafe.Pointer(pBt)).FpageSize > U32(SQLITE_MAX_PAGE_SIZE) ||
  74511 		((*BtShared)(unsafe.Pointer(pBt)).FpageSize-U32(1))&(*BtShared)(unsafe.Pointer(pBt)).FpageSize != U32(0)) {
  74512 		goto __25
  74513 	}
  74514 	(*BtShared)(unsafe.Pointer(pBt)).FpageSize = U32(0)
  74515 
  74516 	if !(zFilename != 0 && !(isMemdb != 0)) {
  74517 		goto __27
  74518 	}
  74519 	(*BtShared)(unsafe.Pointer(pBt)).FautoVacuum = func() uint8 {
  74520 		if 0 != 0 {
  74521 			return uint8(1)
  74522 		}
  74523 		return uint8(0)
  74524 	}()
  74525 	(*BtShared)(unsafe.Pointer(pBt)).FincrVacuum = func() uint8 {
  74526 		if SQLITE_DEFAULT_AUTOVACUUM == 2 {
  74527 			return uint8(1)
  74528 		}
  74529 		return uint8(0)
  74530 	}()
  74531 __27:
  74532 	;
  74533 	nReserve = U8(0)
  74534 	goto __26
  74535 __25:
  74536 	nReserve = *(*uint8)(unsafe.Pointer(bp + 20))
  74537 	*(*U16)(unsafe.Pointer(pBt + 40)) |= U16(BTS_PAGESIZE_FIXED)
  74538 	(*BtShared)(unsafe.Pointer(pBt)).FautoVacuum = func() uint8 {
  74539 		if Xsqlite3Get4byte(tls, bp+52) != 0 {
  74540 			return uint8(1)
  74541 		}
  74542 		return uint8(0)
  74543 	}()
  74544 	(*BtShared)(unsafe.Pointer(pBt)).FincrVacuum = func() uint8 {
  74545 		if Xsqlite3Get4byte(tls, bp+64) != 0 {
  74546 			return uint8(1)
  74547 		}
  74548 		return uint8(0)
  74549 	}()
  74550 __26:
  74551 	;
  74552 	rc = Xsqlite3PagerSetPagesize(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, pBt+52, int32(nReserve))
  74553 	if !(rc != 0) {
  74554 		goto __28
  74555 	}
  74556 	goto btree_open_out
  74557 __28:
  74558 	;
  74559 	(*BtShared)(unsafe.Pointer(pBt)).FusableSize = (*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(nReserve)
  74560 
  74561 	(*BtShared)(unsafe.Pointer(pBt)).FnRef = 1
  74562 	if !((*Btree)(unsafe.Pointer(p)).Fsharable != 0) {
  74563 		goto __29
  74564 	}
  74565 	mutexShared1 = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN)
  74566 	if !(1 != 0 && Xsqlite3Config.FbCoreMutex != 0) {
  74567 		goto __30
  74568 	}
  74569 	(*BtShared)(unsafe.Pointer(pBt)).Fmutex = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_FAST)
  74570 	if !((*BtShared)(unsafe.Pointer(pBt)).Fmutex == uintptr(0)) {
  74571 		goto __31
  74572 	}
  74573 	rc = SQLITE_NOMEM
  74574 	goto btree_open_out
  74575 __31:
  74576 	;
  74577 __30:
  74578 	;
  74579 	Xsqlite3_mutex_enter(tls, mutexShared1)
  74580 	(*BtShared)(unsafe.Pointer(pBt)).FpNext = sqlite3SharedCacheList
  74581 	sqlite3SharedCacheList = pBt
  74582 	Xsqlite3_mutex_leave(tls, mutexShared1)
  74583 __29:
  74584 	;
  74585 __20:
  74586 	;
  74587 	if !((*Btree)(unsafe.Pointer(p)).Fsharable != 0) {
  74588 		goto __32
  74589 	}
  74590 	i = 0
  74591 __33:
  74592 	if !(i < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
  74593 		goto __35
  74594 	}
  74595 	if !(libc.AssignUintptr(&pSib, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FpBt) != uintptr(0) && (*Btree)(unsafe.Pointer(pSib)).Fsharable != 0) {
  74596 		goto __36
  74597 	}
  74598 __37:
  74599 	if !((*Btree)(unsafe.Pointer(pSib)).FpPrev != 0) {
  74600 		goto __38
  74601 	}
  74602 	pSib = (*Btree)(unsafe.Pointer(pSib)).FpPrev
  74603 	goto __37
  74604 __38:
  74605 	;
  74606 	if !(Uptr((*Btree)(unsafe.Pointer(p)).FpBt) < Uptr((*Btree)(unsafe.Pointer(pSib)).FpBt)) {
  74607 		goto __39
  74608 	}
  74609 	(*Btree)(unsafe.Pointer(p)).FpNext = pSib
  74610 	(*Btree)(unsafe.Pointer(p)).FpPrev = uintptr(0)
  74611 	(*Btree)(unsafe.Pointer(pSib)).FpPrev = p
  74612 	goto __40
  74613 __39:
  74614 __41:
  74615 	if !((*Btree)(unsafe.Pointer(pSib)).FpNext != 0 && Uptr((*Btree)(unsafe.Pointer((*Btree)(unsafe.Pointer(pSib)).FpNext)).FpBt) < Uptr((*Btree)(unsafe.Pointer(p)).FpBt)) {
  74616 		goto __42
  74617 	}
  74618 	pSib = (*Btree)(unsafe.Pointer(pSib)).FpNext
  74619 	goto __41
  74620 __42:
  74621 	;
  74622 	(*Btree)(unsafe.Pointer(p)).FpNext = (*Btree)(unsafe.Pointer(pSib)).FpNext
  74623 	(*Btree)(unsafe.Pointer(p)).FpPrev = pSib
  74624 	if !((*Btree)(unsafe.Pointer(p)).FpNext != 0) {
  74625 		goto __43
  74626 	}
  74627 	(*Btree)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpNext)).FpPrev = p
  74628 __43:
  74629 	;
  74630 	(*Btree)(unsafe.Pointer(pSib)).FpNext = p
  74631 __40:
  74632 	;
  74633 	goto __35
  74634 __36:
  74635 	;
  74636 	goto __34
  74637 __34:
  74638 	i++
  74639 	goto __33
  74640 	goto __35
  74641 __35:
  74642 	;
  74643 __32:
  74644 	;
  74645 	*(*uintptr)(unsafe.Pointer(ppBtree)) = p
  74646 
  74647 btree_open_out:
  74648 	if !(rc != SQLITE_OK) {
  74649 		goto __44
  74650 	}
  74651 	if !(pBt != 0 && (*BtShared)(unsafe.Pointer(pBt)).FpPager != 0) {
  74652 		goto __46
  74653 	}
  74654 	Xsqlite3PagerClose(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, uintptr(0))
  74655 __46:
  74656 	;
  74657 	Xsqlite3_free(tls, pBt)
  74658 	Xsqlite3_free(tls, p)
  74659 	*(*uintptr)(unsafe.Pointer(ppBtree)) = uintptr(0)
  74660 	goto __45
  74661 __44:
  74662 	if !(Xsqlite3BtreeSchema(tls, p, 0, uintptr(0)) == uintptr(0)) {
  74663 		goto __47
  74664 	}
  74665 	Xsqlite3BtreeSetCacheSize(tls, p, -2000)
  74666 __47:
  74667 	;
  74668 	pFile = Xsqlite3PagerFile(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager)
  74669 	if !((*Sqlite3_file)(unsafe.Pointer(pFile)).FpMethods != 0) {
  74670 		goto __48
  74671 	}
  74672 	Xsqlite3OsFileControlHint(tls, pFile, SQLITE_FCNTL_PDB, pBt+8)
  74673 __48:
  74674 	;
  74675 __45:
  74676 	;
  74677 	if !(mutexOpen != 0) {
  74678 		goto __49
  74679 	}
  74680 
  74681 	Xsqlite3_mutex_leave(tls, mutexOpen)
  74682 __49:
  74683 	;
  74684 	return rc
  74685 }
  74686 
  74687 func removeFromSharingList(tls *libc.TLS, pBt uintptr) int32 {
  74688 	var pMainMtx uintptr
  74689 	var pList uintptr
  74690 	var removed int32 = 0
  74691 
  74692 	pMainMtx = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN)
  74693 	Xsqlite3_mutex_enter(tls, pMainMtx)
  74694 	(*BtShared)(unsafe.Pointer(pBt)).FnRef--
  74695 	if (*BtShared)(unsafe.Pointer(pBt)).FnRef <= 0 {
  74696 		if sqlite3SharedCacheList == pBt {
  74697 			sqlite3SharedCacheList = (*BtShared)(unsafe.Pointer(pBt)).FpNext
  74698 		} else {
  74699 			pList = sqlite3SharedCacheList
  74700 			for pList != 0 && (*BtShared)(unsafe.Pointer(pList)).FpNext != pBt {
  74701 				pList = (*BtShared)(unsafe.Pointer(pList)).FpNext
  74702 			}
  74703 			if pList != 0 {
  74704 				(*BtShared)(unsafe.Pointer(pList)).FpNext = (*BtShared)(unsafe.Pointer(pBt)).FpNext
  74705 			}
  74706 		}
  74707 		if 1 != 0 {
  74708 			Xsqlite3_mutex_free(tls, (*BtShared)(unsafe.Pointer(pBt)).Fmutex)
  74709 		}
  74710 		removed = 1
  74711 	}
  74712 	Xsqlite3_mutex_leave(tls, pMainMtx)
  74713 	return removed
  74714 }
  74715 
  74716 func allocateTempSpace(tls *libc.TLS, pBt uintptr) int32 {
  74717 	(*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace = Xsqlite3PageMalloc(tls, int32((*BtShared)(unsafe.Pointer(pBt)).FpageSize))
  74718 	if (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace == uintptr(0) {
  74719 		var pCur uintptr = (*BtShared)(unsafe.Pointer(pBt)).FpCursor
  74720 		(*BtShared)(unsafe.Pointer(pBt)).FpCursor = (*BtCursor)(unsafe.Pointer(pCur)).FpNext
  74721 		libc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(BtCursor{})))
  74722 		return SQLITE_NOMEM
  74723 	}
  74724 
  74725 	libc.Xmemset(tls, (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace, 0, uint64(8))
  74726 	*(*uintptr)(unsafe.Pointer(pBt + 136)) += uintptr(4)
  74727 	return SQLITE_OK
  74728 }
  74729 
  74730 func freeTempSpace(tls *libc.TLS, pBt uintptr) {
  74731 	if (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace != 0 {
  74732 		*(*uintptr)(unsafe.Pointer(pBt + 136)) -= uintptr(4)
  74733 		Xsqlite3PageFree(tls, (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace)
  74734 		(*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace = uintptr(0)
  74735 	}
  74736 }
  74737 
  74738 // Close an open database and invalidate all cursors.
  74739 func Xsqlite3BtreeClose(tls *libc.TLS, p uintptr) int32 {
  74740 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  74741 
  74742 	Xsqlite3BtreeEnter(tls, p)
  74743 
  74744 	Xsqlite3BtreeRollback(tls, p, SQLITE_OK, 0)
  74745 	Xsqlite3BtreeLeave(tls, p)
  74746 
  74747 	if !(int32((*Btree)(unsafe.Pointer(p)).Fsharable) != 0) || removeFromSharingList(tls, pBt) != 0 {
  74748 		Xsqlite3PagerClose(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, (*Btree)(unsafe.Pointer(p)).Fdb)
  74749 		if (*BtShared)(unsafe.Pointer(pBt)).FxFreeSchema != 0 && (*BtShared)(unsafe.Pointer(pBt)).FpSchema != 0 {
  74750 			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*BtShared)(unsafe.Pointer(pBt)).FxFreeSchema})).f(tls, (*BtShared)(unsafe.Pointer(pBt)).FpSchema)
  74751 		}
  74752 		Xsqlite3DbFree(tls, uintptr(0), (*BtShared)(unsafe.Pointer(pBt)).FpSchema)
  74753 		freeTempSpace(tls, pBt)
  74754 		Xsqlite3_free(tls, pBt)
  74755 	}
  74756 
  74757 	if (*Btree)(unsafe.Pointer(p)).FpPrev != 0 {
  74758 		(*Btree)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpPrev)).FpNext = (*Btree)(unsafe.Pointer(p)).FpNext
  74759 	}
  74760 	if (*Btree)(unsafe.Pointer(p)).FpNext != 0 {
  74761 		(*Btree)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpNext)).FpPrev = (*Btree)(unsafe.Pointer(p)).FpPrev
  74762 	}
  74763 
  74764 	Xsqlite3_free(tls, p)
  74765 	return SQLITE_OK
  74766 }
  74767 
  74768 // Change the "soft" limit on the number of pages in the cache.
  74769 // Unused and unmodified pages will be recycled when the number of
  74770 // pages in the cache exceeds this soft limit.  But the size of the
  74771 // cache is allowed to grow larger than this limit if it contains
  74772 // dirty pages or pages still in active use.
  74773 func Xsqlite3BtreeSetCacheSize(tls *libc.TLS, p uintptr, mxPage int32) int32 {
  74774 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  74775 
  74776 	Xsqlite3BtreeEnter(tls, p)
  74777 	Xsqlite3PagerSetCachesize(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, mxPage)
  74778 	Xsqlite3BtreeLeave(tls, p)
  74779 	return SQLITE_OK
  74780 }
  74781 
  74782 // Change the "spill" limit on the number of pages in the cache.
  74783 // If the number of pages exceeds this limit during a write transaction,
  74784 // the pager might attempt to "spill" pages to the journal early in
  74785 // order to free up memory.
  74786 //
  74787 // The value returned is the current spill size.  If zero is passed
  74788 // as an argument, no changes are made to the spill size setting, so
  74789 // using mxPage of 0 is a way to query the current spill size.
  74790 func Xsqlite3BtreeSetSpillSize(tls *libc.TLS, p uintptr, mxPage int32) int32 {
  74791 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  74792 	var res int32
  74793 
  74794 	Xsqlite3BtreeEnter(tls, p)
  74795 	res = Xsqlite3PagerSetSpillsize(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, mxPage)
  74796 	Xsqlite3BtreeLeave(tls, p)
  74797 	return res
  74798 }
  74799 
  74800 // Change the limit on the amount of the database file that may be
  74801 // memory mapped.
  74802 func Xsqlite3BtreeSetMmapLimit(tls *libc.TLS, p uintptr, szMmap Sqlite3_int64) int32 {
  74803 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  74804 
  74805 	Xsqlite3BtreeEnter(tls, p)
  74806 	Xsqlite3PagerSetMmapLimit(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, szMmap)
  74807 	Xsqlite3BtreeLeave(tls, p)
  74808 	return SQLITE_OK
  74809 }
  74810 
  74811 // Change the way data is synced to disk in order to increase or decrease
  74812 // how well the database resists damage due to OS crashes and power
  74813 // failures.  Level 1 is the same as asynchronous (no syncs() occur and
  74814 // there is a high probability of damage)  Level 2 is the default.  There
  74815 // is a very low but non-zero probability of damage.  Level 3 reduces the
  74816 // probability of damage to near zero but with a write performance reduction.
  74817 func Xsqlite3BtreeSetPagerFlags(tls *libc.TLS, p uintptr, pgFlags uint32) int32 {
  74818 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  74819 
  74820 	Xsqlite3BtreeEnter(tls, p)
  74821 	Xsqlite3PagerSetFlags(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, pgFlags)
  74822 	Xsqlite3BtreeLeave(tls, p)
  74823 	return SQLITE_OK
  74824 }
  74825 
  74826 // Change the default pages size and the number of reserved bytes per page.
  74827 // Or, if the page size has already been fixed, return SQLITE_READONLY
  74828 // without changing anything.
  74829 //
  74830 // The page size must be a power of 2 between 512 and 65536.  If the page
  74831 // size supplied does not meet this constraint then the page size is not
  74832 // changed.
  74833 //
  74834 // Page sizes are constrained to be a power of two so that the region
  74835 // of the database file used for locking (beginning at PENDING_BYTE,
  74836 // the first byte past the 1GB boundary, 0x40000000) needs to occur
  74837 // at the beginning of a page.
  74838 //
  74839 // If parameter nReserve is less than zero, then the number of reserved
  74840 // bytes per page is left unchanged.
  74841 //
  74842 // If the iFix!=0 then the BTS_PAGESIZE_FIXED flag is set so that the page size
  74843 // and autovacuum mode can no longer be changed.
  74844 func Xsqlite3BtreeSetPageSize(tls *libc.TLS, p uintptr, pageSize int32, nReserve int32, iFix int32) int32 {
  74845 	var rc int32 = SQLITE_OK
  74846 	var x int32
  74847 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  74848 
  74849 	Xsqlite3BtreeEnter(tls, p)
  74850 	(*BtShared)(unsafe.Pointer(pBt)).FnReserveWanted = U8(nReserve)
  74851 	x = int32((*BtShared)(unsafe.Pointer(pBt)).FpageSize - (*BtShared)(unsafe.Pointer(pBt)).FusableSize)
  74852 	if nReserve < x {
  74853 		nReserve = x
  74854 	}
  74855 	if int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_PAGESIZE_FIXED != 0 {
  74856 		Xsqlite3BtreeLeave(tls, p)
  74857 		return SQLITE_READONLY
  74858 	}
  74859 
  74860 	if pageSize >= 512 && pageSize <= SQLITE_MAX_PAGE_SIZE && (pageSize-1)&pageSize == 0 {
  74861 		if nReserve > 32 && pageSize == 512 {
  74862 			pageSize = 1024
  74863 		}
  74864 		(*BtShared)(unsafe.Pointer(pBt)).FpageSize = U32(pageSize)
  74865 		freeTempSpace(tls, pBt)
  74866 	}
  74867 	rc = Xsqlite3PagerSetPagesize(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, pBt+52, nReserve)
  74868 	(*BtShared)(unsafe.Pointer(pBt)).FusableSize = (*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(U16(nReserve))
  74869 	if iFix != 0 {
  74870 		*(*U16)(unsafe.Pointer(pBt + 40)) |= U16(BTS_PAGESIZE_FIXED)
  74871 	}
  74872 	Xsqlite3BtreeLeave(tls, p)
  74873 	return rc
  74874 }
  74875 
  74876 // Return the currently defined page size
  74877 func Xsqlite3BtreeGetPageSize(tls *libc.TLS, p uintptr) int32 {
  74878 	return int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpageSize)
  74879 }
  74880 
  74881 // This function is similar to sqlite3BtreeGetReserve(), except that it
  74882 // may only be called if it is guaranteed that the b-tree mutex is already
  74883 // held.
  74884 //
  74885 // This is useful in one special case in the backup API code where it is
  74886 // known that the shared b-tree mutex is held, but the mutex on the
  74887 // database handle that owns *p is not. In this case if sqlite3BtreeEnter()
  74888 // were to be called, it might collide with some other operation on the
  74889 // database handle that owns *p, causing undefined behavior.
  74890 func Xsqlite3BtreeGetReserveNoMutex(tls *libc.TLS, p uintptr) int32 {
  74891 	var n int32
  74892 
  74893 	n = int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpageSize - (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FusableSize)
  74894 	return n
  74895 }
  74896 
  74897 // Return the number of bytes of space at the end of every page that
  74898 // are intentually left unused.  This is the "reserved" space that is
  74899 // sometimes used by extensions.
  74900 //
  74901 // The value returned is the larger of the current reserve size and
  74902 // the latest reserve size requested by SQLITE_FILECTRL_RESERVE_BYTES.
  74903 // The amount of reserve can only grow - never shrink.
  74904 func Xsqlite3BtreeGetRequestedReserve(tls *libc.TLS, p uintptr) int32 {
  74905 	var n1 int32
  74906 	var n2 int32
  74907 	Xsqlite3BtreeEnter(tls, p)
  74908 	n1 = int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FnReserveWanted)
  74909 	n2 = Xsqlite3BtreeGetReserveNoMutex(tls, p)
  74910 	Xsqlite3BtreeLeave(tls, p)
  74911 	if n1 > n2 {
  74912 		return n1
  74913 	}
  74914 	return n2
  74915 }
  74916 
  74917 // Set the maximum page count for a database if mxPage is positive.
  74918 // No changes are made if mxPage is 0 or negative.
  74919 // Regardless of the value of mxPage, return the maximum page count.
  74920 func Xsqlite3BtreeMaxPageCount(tls *libc.TLS, p uintptr, mxPage Pgno) Pgno {
  74921 	var n Pgno
  74922 	Xsqlite3BtreeEnter(tls, p)
  74923 	n = Xsqlite3PagerMaxPageCount(tls, (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpPager, mxPage)
  74924 	Xsqlite3BtreeLeave(tls, p)
  74925 	return n
  74926 }
  74927 
  74928 // Change the values for the BTS_SECURE_DELETE and BTS_OVERWRITE flags:
  74929 //
  74930 //	newFlag==0       Both BTS_SECURE_DELETE and BTS_OVERWRITE are cleared
  74931 //	newFlag==1       BTS_SECURE_DELETE set and BTS_OVERWRITE is cleared
  74932 //	newFlag==2       BTS_SECURE_DELETE cleared and BTS_OVERWRITE is set
  74933 //	newFlag==(-1)    No changes
  74934 //
  74935 // # This routine acts as a query if newFlag is less than zero
  74936 //
  74937 // With BTS_OVERWRITE set, deleted content is overwritten by zeros, but
  74938 // freelist leaf pages are not written back to the database.  Thus in-page
  74939 // deleted content is cleared, but freelist deleted content is not.
  74940 //
  74941 // With BTS_SECURE_DELETE, operation is like BTS_OVERWRITE with the addition
  74942 // that freelist leaf pages are written back into the database, increasing
  74943 // the amount of disk I/O.
  74944 func Xsqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) int32 {
  74945 	var b int32
  74946 	if p == uintptr(0) {
  74947 		return 0
  74948 	}
  74949 	Xsqlite3BtreeEnter(tls, p)
  74950 
  74951 	if newFlag >= 0 {
  74952 		*(*U16)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt + 40)) &= libc.Uint16FromInt32(libc.CplInt32(BTS_FAST_SECURE))
  74953 		*(*U16)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt + 40)) |= U16(BTS_SECURE_DELETE * newFlag)
  74954 	}
  74955 	b = int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & BTS_FAST_SECURE / BTS_SECURE_DELETE
  74956 	Xsqlite3BtreeLeave(tls, p)
  74957 	return b
  74958 }
  74959 
  74960 // Change the 'auto-vacuum' property of the database. If the 'autoVacuum'
  74961 // parameter is non-zero, then auto-vacuum mode is enabled. If zero, it
  74962 // is disabled. The default value for the auto-vacuum property is
  74963 // determined by the SQLITE_DEFAULT_AUTOVACUUM macro.
  74964 func Xsqlite3BtreeSetAutoVacuum(tls *libc.TLS, p uintptr, autoVacuum int32) int32 {
  74965 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  74966 	var rc int32 = SQLITE_OK
  74967 	var av U8 = U8(autoVacuum)
  74968 
  74969 	Xsqlite3BtreeEnter(tls, p)
  74970 	if int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_PAGESIZE_FIXED != 0 && func() int32 {
  74971 		if av != 0 {
  74972 			return 1
  74973 		}
  74974 		return 0
  74975 	}() != int32((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum) {
  74976 		rc = SQLITE_READONLY
  74977 	} else {
  74978 		(*BtShared)(unsafe.Pointer(pBt)).FautoVacuum = func() uint8 {
  74979 			if av != 0 {
  74980 				return uint8(1)
  74981 			}
  74982 			return uint8(0)
  74983 		}()
  74984 		(*BtShared)(unsafe.Pointer(pBt)).FincrVacuum = func() uint8 {
  74985 			if int32(av) == 2 {
  74986 				return uint8(1)
  74987 			}
  74988 			return uint8(0)
  74989 		}()
  74990 	}
  74991 	Xsqlite3BtreeLeave(tls, p)
  74992 	return rc
  74993 }
  74994 
  74995 // Return the value of the 'auto-vacuum' property. If auto-vacuum is
  74996 // enabled 1 is returned. Otherwise 0.
  74997 func Xsqlite3BtreeGetAutoVacuum(tls *libc.TLS, p uintptr) int32 {
  74998 	var rc int32
  74999 	Xsqlite3BtreeEnter(tls, p)
  75000 	rc = func() int32 {
  75001 		if !(int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FautoVacuum) != 0) {
  75002 			return BTREE_AUTOVACUUM_NONE
  75003 		}
  75004 		return func() int32 {
  75005 			if !(int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FincrVacuum) != 0) {
  75006 				return BTREE_AUTOVACUUM_FULL
  75007 			}
  75008 			return BTREE_AUTOVACUUM_INCR
  75009 		}()
  75010 	}()
  75011 	Xsqlite3BtreeLeave(tls, p)
  75012 	return rc
  75013 }
  75014 
  75015 func lockBtree(tls *libc.TLS, pBt uintptr) int32 {
  75016 	bp := tls.Alloc(16)
  75017 	defer tls.Free(16)
  75018 
  75019 	var rc int32
  75020 
  75021 	var nPage U32
  75022 
  75023 	var pageSize U32
  75024 	var usableSize U32
  75025 	var page1 uintptr
  75026 	*(*U32)(unsafe.Pointer(bp + 8)) = U32(0)
  75027 
  75028 	rc = Xsqlite3PagerSharedLock(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager)
  75029 	if !(rc != SQLITE_OK) {
  75030 		goto __1
  75031 	}
  75032 	return rc
  75033 __1:
  75034 	;
  75035 	rc = btreeGetPage(tls, pBt, uint32(1), bp, 0)
  75036 	if !(rc != SQLITE_OK) {
  75037 		goto __2
  75038 	}
  75039 	return rc
  75040 __2:
  75041 	;
  75042 	nPage = Xsqlite3Get4byte(tls, uintptr(28)+(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData)
  75043 	Xsqlite3PagerPagecount(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, bp+8)
  75044 	if !(nPage == U32(0) || libc.Xmemcmp(tls, uintptr(24)+(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData, uintptr(92)+(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData, uint64(4)) != 0) {
  75045 		goto __3
  75046 	}
  75047 	nPage = *(*U32)(unsafe.Pointer(bp + 8))
  75048 __3:
  75049 	;
  75050 	if !((*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags&uint64(SQLITE_ResetDatabase) != uint64(0)) {
  75051 		goto __4
  75052 	}
  75053 	nPage = U32(0)
  75054 __4:
  75055 	;
  75056 	if !(nPage > U32(0)) {
  75057 		goto __5
  75058 	}
  75059 	page1 = (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData
  75060 	rc = SQLITE_NOTADB
  75061 
  75062 	if !(libc.Xmemcmp(tls, page1, uintptr(unsafe.Pointer(&zMagicHeader)), uint64(16)) != 0) {
  75063 		goto __6
  75064 	}
  75065 	goto page1_init_failed
  75066 __6:
  75067 	;
  75068 	if !(int32(*(*U8)(unsafe.Pointer(page1 + 18))) > 2) {
  75069 		goto __7
  75070 	}
  75071 	*(*U16)(unsafe.Pointer(pBt + 40)) |= U16(BTS_READ_ONLY)
  75072 __7:
  75073 	;
  75074 	if !(int32(*(*U8)(unsafe.Pointer(page1 + 19))) > 2) {
  75075 		goto __8
  75076 	}
  75077 	goto page1_init_failed
  75078 __8:
  75079 	;
  75080 	if !(int32(*(*U8)(unsafe.Pointer(page1 + 19))) == 2 && int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_NO_WAL == 0) {
  75081 		goto __9
  75082 	}
  75083 	*(*int32)(unsafe.Pointer(bp + 12)) = 0
  75084 	rc = Xsqlite3PagerOpenWal(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, bp+12)
  75085 	if !(rc != SQLITE_OK) {
  75086 		goto __11
  75087 	}
  75088 	goto page1_init_failed
  75089 	goto __12
  75090 __11:
  75091 	;
  75092 	if !(*(*int32)(unsafe.Pointer(bp + 12)) == 0) {
  75093 		goto __13
  75094 	}
  75095 	releasePageOne(tls, *(*uintptr)(unsafe.Pointer(bp)))
  75096 	return SQLITE_OK
  75097 __13:
  75098 	;
  75099 __12:
  75100 	;
  75101 	rc = SQLITE_NOTADB
  75102 	goto __10
  75103 __9:
  75104 	;
  75105 __10:
  75106 	;
  75107 	if !(libc.Xmemcmp(tls, page1+21, ts+5410, uint64(3)) != 0) {
  75108 		goto __14
  75109 	}
  75110 	goto page1_init_failed
  75111 __14:
  75112 	;
  75113 	pageSize = U32(int32(*(*U8)(unsafe.Pointer(page1 + 16)))<<8 | int32(*(*U8)(unsafe.Pointer(page1 + 17)))<<16)
  75114 
  75115 	if !((pageSize-U32(1))&pageSize != U32(0) ||
  75116 		pageSize > U32(SQLITE_MAX_PAGE_SIZE) ||
  75117 		pageSize <= U32(256)) {
  75118 		goto __15
  75119 	}
  75120 	goto page1_init_failed
  75121 __15:
  75122 	;
  75123 	*(*U16)(unsafe.Pointer(pBt + 40)) |= U16(BTS_PAGESIZE_FIXED)
  75124 
  75125 	usableSize = pageSize - U32(*(*U8)(unsafe.Pointer(page1 + 20)))
  75126 	if !(pageSize != (*BtShared)(unsafe.Pointer(pBt)).FpageSize) {
  75127 		goto __16
  75128 	}
  75129 
  75130 	releasePageOne(tls, *(*uintptr)(unsafe.Pointer(bp)))
  75131 	(*BtShared)(unsafe.Pointer(pBt)).FusableSize = usableSize
  75132 	(*BtShared)(unsafe.Pointer(pBt)).FpageSize = pageSize
  75133 	freeTempSpace(tls, pBt)
  75134 	rc = Xsqlite3PagerSetPagesize(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, pBt+52,
  75135 		int32(pageSize-usableSize))
  75136 	return rc
  75137 __16:
  75138 	;
  75139 	if !(nPage > *(*U32)(unsafe.Pointer(bp + 8))) {
  75140 		goto __17
  75141 	}
  75142 	if !(Xsqlite3WritableSchema(tls, (*BtShared)(unsafe.Pointer(pBt)).Fdb) == 0) {
  75143 		goto __18
  75144 	}
  75145 	rc = Xsqlite3CorruptError(tls, 71726)
  75146 	goto page1_init_failed
  75147 	goto __19
  75148 __18:
  75149 	nPage = *(*U32)(unsafe.Pointer(bp + 8))
  75150 __19:
  75151 	;
  75152 __17:
  75153 	;
  75154 	if !(usableSize < U32(480)) {
  75155 		goto __20
  75156 	}
  75157 	goto page1_init_failed
  75158 __20:
  75159 	;
  75160 	(*BtShared)(unsafe.Pointer(pBt)).FpageSize = pageSize
  75161 	(*BtShared)(unsafe.Pointer(pBt)).FusableSize = usableSize
  75162 	(*BtShared)(unsafe.Pointer(pBt)).FautoVacuum = func() uint8 {
  75163 		if Xsqlite3Get4byte(tls, page1+52) != 0 {
  75164 			return uint8(1)
  75165 		}
  75166 		return uint8(0)
  75167 	}()
  75168 	(*BtShared)(unsafe.Pointer(pBt)).FincrVacuum = func() uint8 {
  75169 		if Xsqlite3Get4byte(tls, page1+64) != 0 {
  75170 			return uint8(1)
  75171 		}
  75172 		return uint8(0)
  75173 	}()
  75174 __5:
  75175 	;
  75176 	(*BtShared)(unsafe.Pointer(pBt)).FmaxLocal = U16(((*BtShared)(unsafe.Pointer(pBt)).FusableSize-U32(12))*U32(64)/U32(255) - U32(23))
  75177 	(*BtShared)(unsafe.Pointer(pBt)).FminLocal = U16(((*BtShared)(unsafe.Pointer(pBt)).FusableSize-U32(12))*U32(32)/U32(255) - U32(23))
  75178 	(*BtShared)(unsafe.Pointer(pBt)).FmaxLeaf = U16((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(35))
  75179 	(*BtShared)(unsafe.Pointer(pBt)).FminLeaf = U16(((*BtShared)(unsafe.Pointer(pBt)).FusableSize-U32(12))*U32(32)/U32(255) - U32(23))
  75180 	if !(int32((*BtShared)(unsafe.Pointer(pBt)).FmaxLocal) > 127) {
  75181 		goto __21
  75182 	}
  75183 	(*BtShared)(unsafe.Pointer(pBt)).Fmax1bytePayload = U8(127)
  75184 	goto __22
  75185 __21:
  75186 	(*BtShared)(unsafe.Pointer(pBt)).Fmax1bytePayload = U8((*BtShared)(unsafe.Pointer(pBt)).FmaxLocal)
  75187 __22:
  75188 	;
  75189 	(*BtShared)(unsafe.Pointer(pBt)).FpPage1 = *(*uintptr)(unsafe.Pointer(bp))
  75190 	(*BtShared)(unsafe.Pointer(pBt)).FnPage = nPage
  75191 	return SQLITE_OK
  75192 
  75193 page1_init_failed:
  75194 	releasePageOne(tls, *(*uintptr)(unsafe.Pointer(bp)))
  75195 	(*BtShared)(unsafe.Pointer(pBt)).FpPage1 = uintptr(0)
  75196 	return rc
  75197 }
  75198 
  75199 func unlockBtreeIfUnused(tls *libc.TLS, pBt uintptr) {
  75200 	if int32((*BtShared)(unsafe.Pointer(pBt)).FinTransaction) == TRANS_NONE && (*BtShared)(unsafe.Pointer(pBt)).FpPage1 != uintptr(0) {
  75201 		var pPage1 uintptr = (*BtShared)(unsafe.Pointer(pBt)).FpPage1
  75202 
  75203 		(*BtShared)(unsafe.Pointer(pBt)).FpPage1 = uintptr(0)
  75204 		releasePageOne(tls, pPage1)
  75205 	}
  75206 }
  75207 
  75208 func newDatabase(tls *libc.TLS, pBt uintptr) int32 {
  75209 	var pP1 uintptr
  75210 	var data uintptr
  75211 	var rc int32
  75212 
  75213 	if (*BtShared)(unsafe.Pointer(pBt)).FnPage > U32(0) {
  75214 		return SQLITE_OK
  75215 	}
  75216 	pP1 = (*BtShared)(unsafe.Pointer(pBt)).FpPage1
  75217 
  75218 	data = (*MemPage)(unsafe.Pointer(pP1)).FaData
  75219 	rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pP1)).FpDbPage)
  75220 	if rc != 0 {
  75221 		return rc
  75222 	}
  75223 	libc.Xmemcpy(tls, data, uintptr(unsafe.Pointer(&zMagicHeader)), uint64(unsafe.Sizeof(zMagicHeader)))
  75224 
  75225 	*(*uint8)(unsafe.Pointer(data + 16)) = U8((*BtShared)(unsafe.Pointer(pBt)).FpageSize >> 8 & U32(0xff))
  75226 	*(*uint8)(unsafe.Pointer(data + 17)) = U8((*BtShared)(unsafe.Pointer(pBt)).FpageSize >> 16 & U32(0xff))
  75227 	*(*uint8)(unsafe.Pointer(data + 18)) = uint8(1)
  75228 	*(*uint8)(unsafe.Pointer(data + 19)) = uint8(1)
  75229 
  75230 	*(*uint8)(unsafe.Pointer(data + 20)) = U8((*BtShared)(unsafe.Pointer(pBt)).FpageSize - (*BtShared)(unsafe.Pointer(pBt)).FusableSize)
  75231 	*(*uint8)(unsafe.Pointer(data + 21)) = uint8(64)
  75232 	*(*uint8)(unsafe.Pointer(data + 22)) = uint8(32)
  75233 	*(*uint8)(unsafe.Pointer(data + 23)) = uint8(32)
  75234 	libc.Xmemset(tls, data+24, 0, uint64(100-24))
  75235 	zeroPage(tls, pP1, PTF_INTKEY|PTF_LEAF|PTF_LEAFDATA)
  75236 	*(*U16)(unsafe.Pointer(pBt + 40)) |= U16(BTS_PAGESIZE_FIXED)
  75237 
  75238 	Xsqlite3Put4byte(tls, data+52, uint32((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum))
  75239 	Xsqlite3Put4byte(tls, data+64, uint32((*BtShared)(unsafe.Pointer(pBt)).FincrVacuum))
  75240 	(*BtShared)(unsafe.Pointer(pBt)).FnPage = U32(1)
  75241 	*(*uint8)(unsafe.Pointer(data + 31)) = uint8(1)
  75242 	return SQLITE_OK
  75243 }
  75244 
  75245 // Initialize the first page of the database file (creating a database
  75246 // consisting of a single page and no schema objects). Return SQLITE_OK
  75247 // if successful, or an SQLite error code otherwise.
  75248 func Xsqlite3BtreeNewDb(tls *libc.TLS, p uintptr) int32 {
  75249 	var rc int32
  75250 	Xsqlite3BtreeEnter(tls, p)
  75251 	(*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FnPage = U32(0)
  75252 	rc = newDatabase(tls, (*Btree)(unsafe.Pointer(p)).FpBt)
  75253 	Xsqlite3BtreeLeave(tls, p)
  75254 	return rc
  75255 }
  75256 
  75257 // Attempt to start a new transaction. A write-transaction
  75258 // is started if the second argument is nonzero, otherwise a read-
  75259 // transaction.  If the second argument is 2 or more and exclusive
  75260 // transaction is started, meaning that no other process is allowed
  75261 // to access the database.  A preexisting transaction may not be
  75262 // upgraded to exclusive by calling this routine a second time - the
  75263 // exclusivity flag only works for a new transaction.
  75264 //
  75265 // A write-transaction must be started before attempting any
  75266 // changes to the database.  None of the following routines
  75267 // will work unless a transaction is started first:
  75268 //
  75269 //	sqlite3BtreeCreateTable()
  75270 //	sqlite3BtreeCreateIndex()
  75271 //	sqlite3BtreeClearTable()
  75272 //	sqlite3BtreeDropTable()
  75273 //	sqlite3BtreeInsert()
  75274 //	sqlite3BtreeDelete()
  75275 //	sqlite3BtreeUpdateMeta()
  75276 //
  75277 // If an initial attempt to acquire the lock fails because of lock contention
  75278 // and the database was previously unlocked, then invoke the busy handler
  75279 // if there is one.  But if there was previously a read-lock, do not
  75280 // invoke the busy handler - just return SQLITE_BUSY.  SQLITE_BUSY is
  75281 // returned when there is already a read-lock in order to avoid a deadlock.
  75282 //
  75283 // Suppose there are two processes A and B.  A has a read lock and B has
  75284 // a reserved lock.  B tries to promote to exclusive but is blocked because
  75285 // of A's read lock.  A tries to promote to reserved but is blocked by B.
  75286 // One or the other of the two processes must give way or there can be
  75287 // no progress.  By returning SQLITE_BUSY and not invoking the busy callback
  75288 // when A already has a read lock, we encourage A to give up and let B
  75289 // proceed.
  75290 func Xsqlite3BtreeBeginTrans(tls *libc.TLS, p uintptr, wrflag int32, pSchemaVersion uintptr) int32 {
  75291 	var pBt uintptr
  75292 	var pPager uintptr
  75293 	var rc int32
  75294 	var pIter uintptr
  75295 	var pBlock uintptr
  75296 	var pPage1 uintptr
  75297 	pBt = (*Btree)(unsafe.Pointer(p)).FpBt
  75298 	pPager = (*BtShared)(unsafe.Pointer(pBt)).FpPager
  75299 	rc = SQLITE_OK
  75300 
  75301 	Xsqlite3BtreeEnter(tls, p)
  75302 
  75303 	if !(int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_WRITE || int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_READ && !(wrflag != 0)) {
  75304 		goto __1
  75305 	}
  75306 	goto trans_begun
  75307 __1:
  75308 	;
  75309 	if !((*Sqlite3)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).Fdb)).Fflags&uint64(SQLITE_ResetDatabase) != 0 &&
  75310 		int32(Xsqlite3PagerIsreadonly(tls, pPager)) == 0) {
  75311 		goto __2
  75312 	}
  75313 	*(*U16)(unsafe.Pointer(pBt + 40)) &= libc.Uint16FromInt32(libc.CplInt32(BTS_READ_ONLY))
  75314 __2:
  75315 	;
  75316 	if !(int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_READ_ONLY != 0 && wrflag != 0) {
  75317 		goto __3
  75318 	}
  75319 	rc = SQLITE_READONLY
  75320 	goto trans_begun
  75321 __3:
  75322 	;
  75323 	pBlock = uintptr(0)
  75324 
  75325 	if !(wrflag != 0 && int32((*BtShared)(unsafe.Pointer(pBt)).FinTransaction) == TRANS_WRITE ||
  75326 		int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_PENDING != 0) {
  75327 		goto __4
  75328 	}
  75329 	pBlock = (*Btree)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpWriter)).Fdb
  75330 	goto __5
  75331 __4:
  75332 	if !(wrflag > 1) {
  75333 		goto __6
  75334 	}
  75335 	pIter = (*BtShared)(unsafe.Pointer(pBt)).FpLock
  75336 __7:
  75337 	if !(pIter != 0) {
  75338 		goto __9
  75339 	}
  75340 	if !((*BtLock)(unsafe.Pointer(pIter)).FpBtree != p) {
  75341 		goto __10
  75342 	}
  75343 	pBlock = (*Btree)(unsafe.Pointer((*BtLock)(unsafe.Pointer(pIter)).FpBtree)).Fdb
  75344 	goto __9
  75345 __10:
  75346 	;
  75347 	goto __8
  75348 __8:
  75349 	pIter = (*BtLock)(unsafe.Pointer(pIter)).FpNext
  75350 	goto __7
  75351 	goto __9
  75352 __9:
  75353 	;
  75354 __6:
  75355 	;
  75356 __5:
  75357 	;
  75358 	if !(pBlock != 0) {
  75359 		goto __11
  75360 	}
  75361 	Xsqlite3ConnectionBlocked(tls, (*Btree)(unsafe.Pointer(p)).Fdb, pBlock)
  75362 	rc = SQLITE_LOCKED | int32(1)<<8
  75363 	goto trans_begun
  75364 __11:
  75365 	;
  75366 	rc = querySharedCacheTableLock(tls, p, uint32(SCHEMA_ROOT), uint8(READ_LOCK))
  75367 	if !(SQLITE_OK != rc) {
  75368 		goto __12
  75369 	}
  75370 	goto trans_begun
  75371 __12:
  75372 	;
  75373 	*(*U16)(unsafe.Pointer(pBt + 40)) &= libc.Uint16FromInt32(libc.CplInt32(BTS_INITIALLY_EMPTY))
  75374 	if !((*BtShared)(unsafe.Pointer(pBt)).FnPage == U32(0)) {
  75375 		goto __13
  75376 	}
  75377 	*(*U16)(unsafe.Pointer(pBt + 40)) |= U16(BTS_INITIALLY_EMPTY)
  75378 __13:
  75379 	;
  75380 __14:
  75381 	;
  75382 __17:
  75383 	if !((*BtShared)(unsafe.Pointer(pBt)).FpPage1 == uintptr(0) && SQLITE_OK == libc.AssignInt32(&rc, lockBtree(tls, pBt))) {
  75384 		goto __18
  75385 	}
  75386 	goto __17
  75387 __18:
  75388 	;
  75389 	if !(rc == SQLITE_OK && wrflag != 0) {
  75390 		goto __19
  75391 	}
  75392 	if !(int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_READ_ONLY != 0) {
  75393 		goto __20
  75394 	}
  75395 	rc = SQLITE_READONLY
  75396 	goto __21
  75397 __20:
  75398 	rc = Xsqlite3PagerBegin(tls, pPager, libc.Bool32(wrflag > 1), Xsqlite3TempInMemory(tls, (*Btree)(unsafe.Pointer(p)).Fdb))
  75399 	if !(rc == SQLITE_OK) {
  75400 		goto __22
  75401 	}
  75402 	rc = newDatabase(tls, pBt)
  75403 	goto __23
  75404 __22:
  75405 	if !(rc == SQLITE_BUSY|int32(2)<<8 && int32((*BtShared)(unsafe.Pointer(pBt)).FinTransaction) == TRANS_NONE) {
  75406 		goto __24
  75407 	}
  75408 
  75409 	rc = SQLITE_BUSY
  75410 __24:
  75411 	;
  75412 __23:
  75413 	;
  75414 __21:
  75415 	;
  75416 __19:
  75417 	;
  75418 	if !(rc != SQLITE_OK) {
  75419 		goto __25
  75420 	}
  75421 
  75422 	unlockBtreeIfUnused(tls, pBt)
  75423 __25:
  75424 	;
  75425 	goto __15
  75426 __15:
  75427 	if rc&0xFF == SQLITE_BUSY && int32((*BtShared)(unsafe.Pointer(pBt)).FinTransaction) == TRANS_NONE && btreeInvokeBusyHandler(tls, pBt) != 0 {
  75428 		goto __14
  75429 	}
  75430 	goto __16
  75431 __16:
  75432 	;
  75433 	if !(rc == SQLITE_OK) {
  75434 		goto __26
  75435 	}
  75436 	if !(int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_NONE) {
  75437 		goto __27
  75438 	}
  75439 	(*BtShared)(unsafe.Pointer(pBt)).FnTransaction++
  75440 	if !((*Btree)(unsafe.Pointer(p)).Fsharable != 0) {
  75441 		goto __28
  75442 	}
  75443 
  75444 	(*Btree)(unsafe.Pointer(p)).Flock.FeLock = U8(READ_LOCK)
  75445 	(*Btree)(unsafe.Pointer(p)).Flock.FpNext = (*BtShared)(unsafe.Pointer(pBt)).FpLock
  75446 	(*BtShared)(unsafe.Pointer(pBt)).FpLock = p + 48
  75447 __28:
  75448 	;
  75449 __27:
  75450 	;
  75451 	(*Btree)(unsafe.Pointer(p)).FinTrans = func() uint8 {
  75452 		if wrflag != 0 {
  75453 			return uint8(TRANS_WRITE)
  75454 		}
  75455 		return uint8(TRANS_READ)
  75456 	}()
  75457 	if !(int32((*Btree)(unsafe.Pointer(p)).FinTrans) > int32((*BtShared)(unsafe.Pointer(pBt)).FinTransaction)) {
  75458 		goto __29
  75459 	}
  75460 	(*BtShared)(unsafe.Pointer(pBt)).FinTransaction = (*Btree)(unsafe.Pointer(p)).FinTrans
  75461 __29:
  75462 	;
  75463 	if !(wrflag != 0) {
  75464 		goto __30
  75465 	}
  75466 	pPage1 = (*BtShared)(unsafe.Pointer(pBt)).FpPage1
  75467 
  75468 	(*BtShared)(unsafe.Pointer(pBt)).FpWriter = p
  75469 	*(*U16)(unsafe.Pointer(pBt + 40)) &= libc.Uint16FromInt32(libc.CplInt32(BTS_EXCLUSIVE))
  75470 	if !(wrflag > 1) {
  75471 		goto __31
  75472 	}
  75473 	*(*U16)(unsafe.Pointer(pBt + 40)) |= U16(BTS_EXCLUSIVE)
  75474 __31:
  75475 	;
  75476 	if !((*BtShared)(unsafe.Pointer(pBt)).FnPage != Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+28)) {
  75477 		goto __32
  75478 	}
  75479 	rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPage1)).FpDbPage)
  75480 	if !(rc == SQLITE_OK) {
  75481 		goto __33
  75482 	}
  75483 	Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+28, (*BtShared)(unsafe.Pointer(pBt)).FnPage)
  75484 __33:
  75485 	;
  75486 __32:
  75487 	;
  75488 __30:
  75489 	;
  75490 __26:
  75491 	;
  75492 trans_begun:
  75493 	if !(rc == SQLITE_OK) {
  75494 		goto __34
  75495 	}
  75496 	if !(pSchemaVersion != 0) {
  75497 		goto __35
  75498 	}
  75499 	*(*int32)(unsafe.Pointer(pSchemaVersion)) = int32(Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+40))
  75500 __35:
  75501 	;
  75502 	if !(wrflag != 0) {
  75503 		goto __36
  75504 	}
  75505 
  75506 	rc = Xsqlite3PagerOpenSavepoint(tls, pPager, (*Sqlite3)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).Fdb)).FnSavepoint)
  75507 __36:
  75508 	;
  75509 __34:
  75510 	;
  75511 	Xsqlite3BtreeLeave(tls, p)
  75512 	return rc
  75513 }
  75514 
  75515 func setChildPtrmaps(tls *libc.TLS, pPage uintptr) int32 {
  75516 	bp := tls.Alloc(4)
  75517 	defer tls.Free(4)
  75518 
  75519 	var i int32
  75520 	var nCell int32
  75521 
  75522 	var pBt uintptr = (*MemPage)(unsafe.Pointer(pPage)).FpBt
  75523 	var pgno Pgno = (*MemPage)(unsafe.Pointer(pPage)).Fpgno
  75524 
  75525 	if (*MemPage)(unsafe.Pointer(pPage)).FisInit != 0 {
  75526 		*(*int32)(unsafe.Pointer(bp)) = SQLITE_OK
  75527 	} else {
  75528 		*(*int32)(unsafe.Pointer(bp)) = btreeInitPage(tls, pPage)
  75529 	}
  75530 	if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK {
  75531 		return *(*int32)(unsafe.Pointer(bp))
  75532 	}
  75533 	nCell = int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)
  75534 
  75535 	for i = 0; i < nCell; i++ {
  75536 		var pCell uintptr = (*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*i))))))
  75537 
  75538 		ptrmapPutOvflPtr(tls, pPage, pPage, pCell, bp)
  75539 
  75540 		if !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) {
  75541 			var childPgno Pgno = Xsqlite3Get4byte(tls, pCell)
  75542 			ptrmapPut(tls, pBt, childPgno, uint8(PTRMAP_BTREE), pgno, bp)
  75543 		}
  75544 	}
  75545 
  75546 	if !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) {
  75547 		var childPgno Pgno = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+8))
  75548 		ptrmapPut(tls, pBt, childPgno, uint8(PTRMAP_BTREE), pgno, bp)
  75549 	}
  75550 
  75551 	return *(*int32)(unsafe.Pointer(bp))
  75552 }
  75553 
  75554 func modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom Pgno, iTo Pgno, eType U8) int32 {
  75555 	bp := tls.Alloc(24)
  75556 	defer tls.Free(24)
  75557 
  75558 	if int32(eType) == PTRMAP_OVERFLOW2 {
  75559 		if Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData) != iFrom {
  75560 			return Xsqlite3CorruptError(tls, 72147)
  75561 		}
  75562 		Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData, iTo)
  75563 	} else {
  75564 		var i int32
  75565 		var nCell int32
  75566 		var rc int32
  75567 
  75568 		if (*MemPage)(unsafe.Pointer(pPage)).FisInit != 0 {
  75569 			rc = SQLITE_OK
  75570 		} else {
  75571 			rc = btreeInitPage(tls, pPage)
  75572 		}
  75573 		if rc != 0 {
  75574 			return rc
  75575 		}
  75576 		nCell = int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)
  75577 
  75578 		for i = 0; i < nCell; i++ {
  75579 			var pCell uintptr = (*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*i))))))
  75580 			if int32(eType) == PTRMAP_OVERFLOW1 {
  75581 				(*struct {
  75582 					f func(*libc.TLS, uintptr, uintptr, uintptr)
  75583 				})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxParseCell})).f(tls, pPage, pCell, bp)
  75584 				if U32((*CellInfo)(unsafe.Pointer(bp)).FnLocal) < (*CellInfo)(unsafe.Pointer(bp)).FnPayload {
  75585 					if pCell+uintptr((*CellInfo)(unsafe.Pointer(bp)).FnSize) > (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) {
  75586 						return Xsqlite3CorruptError(tls, 72166)
  75587 					}
  75588 					if iFrom == Xsqlite3Get4byte(tls, pCell+uintptr((*CellInfo)(unsafe.Pointer(bp)).FnSize)-uintptr(4)) {
  75589 						Xsqlite3Put4byte(tls, pCell+uintptr((*CellInfo)(unsafe.Pointer(bp)).FnSize)-uintptr(4), iTo)
  75590 						break
  75591 					}
  75592 				}
  75593 			} else {
  75594 				if pCell+uintptr(4) > (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) {
  75595 					return Xsqlite3CorruptError(tls, 72175)
  75596 				}
  75597 				if Xsqlite3Get4byte(tls, pCell) == iFrom {
  75598 					Xsqlite3Put4byte(tls, pCell, iTo)
  75599 					break
  75600 				}
  75601 			}
  75602 		}
  75603 
  75604 		if i == nCell {
  75605 			if int32(eType) != PTRMAP_BTREE || Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+8)) != iFrom {
  75606 				return Xsqlite3CorruptError(tls, 72187)
  75607 			}
  75608 			Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+8), iTo)
  75609 		}
  75610 	}
  75611 	return SQLITE_OK
  75612 }
  75613 
  75614 func relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType U8, iPtrPage Pgno, iFreePage Pgno, isCommit int32) int32 {
  75615 	bp := tls.Alloc(16)
  75616 	defer tls.Free(16)
  75617 
  75618 	var iDbPage Pgno = (*MemPage)(unsafe.Pointer(pDbPage)).Fpgno
  75619 	var pPager uintptr = (*BtShared)(unsafe.Pointer(pBt)).FpPager
  75620 
  75621 	if iDbPage < Pgno(3) {
  75622 		return Xsqlite3CorruptError(tls, 72222)
  75623 	}
  75624 
  75625 	*(*int32)(unsafe.Pointer(bp)) = Xsqlite3PagerMovepage(tls, pPager, (*MemPage)(unsafe.Pointer(pDbPage)).FpDbPage, iFreePage, isCommit)
  75626 	if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK {
  75627 		return *(*int32)(unsafe.Pointer(bp))
  75628 	}
  75629 	(*MemPage)(unsafe.Pointer(pDbPage)).Fpgno = iFreePage
  75630 
  75631 	if int32(eType) == PTRMAP_BTREE || int32(eType) == PTRMAP_ROOTPAGE {
  75632 		*(*int32)(unsafe.Pointer(bp)) = setChildPtrmaps(tls, pDbPage)
  75633 		if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK {
  75634 			return *(*int32)(unsafe.Pointer(bp))
  75635 		}
  75636 	} else {
  75637 		var nextOvfl Pgno = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pDbPage)).FaData)
  75638 		if nextOvfl != Pgno(0) {
  75639 			ptrmapPut(tls, pBt, nextOvfl, uint8(PTRMAP_OVERFLOW2), iFreePage, bp)
  75640 			if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK {
  75641 				return *(*int32)(unsafe.Pointer(bp))
  75642 			}
  75643 		}
  75644 	}
  75645 
  75646 	if int32(eType) != PTRMAP_ROOTPAGE {
  75647 		*(*int32)(unsafe.Pointer(bp)) = btreeGetPage(tls, pBt, iPtrPage, bp+8, 0)
  75648 		if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK {
  75649 			return *(*int32)(unsafe.Pointer(bp))
  75650 		}
  75651 		*(*int32)(unsafe.Pointer(bp)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FpDbPage)
  75652 		if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK {
  75653 			releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
  75654 			return *(*int32)(unsafe.Pointer(bp))
  75655 		}
  75656 		*(*int32)(unsafe.Pointer(bp)) = modifyPagePointer(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), iDbPage, iFreePage, eType)
  75657 		releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
  75658 		if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
  75659 			ptrmapPut(tls, pBt, iFreePage, eType, iPtrPage, bp)
  75660 		}
  75661 	}
  75662 	return *(*int32)(unsafe.Pointer(bp))
  75663 }
  75664 
  75665 func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit int32) int32 {
  75666 	bp := tls.Alloc(44)
  75667 	defer tls.Free(44)
  75668 
  75669 	var nFreeList Pgno
  75670 	var rc int32
  75671 
  75672 	if !(ptrmapPageno(tls, pBt, iLastPg) == iLastPg) && iLastPg != U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1) {
  75673 		nFreeList = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36)
  75674 		if nFreeList == Pgno(0) {
  75675 			return SQLITE_DONE
  75676 		}
  75677 
  75678 		rc = ptrmapGet(tls, pBt, iLastPg, bp, bp+4)
  75679 		if rc != SQLITE_OK {
  75680 			return rc
  75681 		}
  75682 		if int32(*(*U8)(unsafe.Pointer(bp))) == PTRMAP_ROOTPAGE {
  75683 			return Xsqlite3CorruptError(tls, 72320)
  75684 		}
  75685 
  75686 		if int32(*(*U8)(unsafe.Pointer(bp))) == PTRMAP_FREEPAGE {
  75687 			if bCommit == 0 {
  75688 				rc = allocateBtreePage(tls, pBt, bp+8, bp+16, iLastPg, uint8(BTALLOC_EXACT))
  75689 				if rc != SQLITE_OK {
  75690 					return rc
  75691 				}
  75692 
  75693 				releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
  75694 			}
  75695 		} else {
  75696 			var eMode U8 = U8(BTALLOC_ANY)
  75697 			var iNear Pgno = Pgno(0)
  75698 
  75699 			rc = btreeGetPage(tls, pBt, iLastPg, bp+24, 0)
  75700 			if rc != SQLITE_OK {
  75701 				return rc
  75702 			}
  75703 
  75704 			if bCommit == 0 {
  75705 				eMode = U8(BTALLOC_LE)
  75706 				iNear = nFin
  75707 			}
  75708 			for __ccgo := true; __ccgo; __ccgo = bCommit != 0 && *(*Pgno)(unsafe.Pointer(bp + 40)) > nFin {
  75709 				var dbSize Pgno = btreePagecount(tls, pBt)
  75710 				rc = allocateBtreePage(tls, pBt, bp+32, bp+40, iNear, eMode)
  75711 				if rc != SQLITE_OK {
  75712 					releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 24)))
  75713 					return rc
  75714 				}
  75715 				releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 32)))
  75716 				if *(*Pgno)(unsafe.Pointer(bp + 40)) > dbSize {
  75717 					releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 24)))
  75718 					return Xsqlite3CorruptError(tls, 72372)
  75719 				}
  75720 			}
  75721 
  75722 			rc = relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 24)), *(*U8)(unsafe.Pointer(bp)), *(*Pgno)(unsafe.Pointer(bp + 4)), *(*Pgno)(unsafe.Pointer(bp + 40)), bCommit)
  75723 			releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 24)))
  75724 			if rc != SQLITE_OK {
  75725 				return rc
  75726 			}
  75727 		}
  75728 	}
  75729 
  75730 	if bCommit == 0 {
  75731 		for __ccgo1 := true; __ccgo1; __ccgo1 = iLastPg == U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1) || ptrmapPageno(tls, pBt, iLastPg) == iLastPg {
  75732 			iLastPg--
  75733 		}
  75734 		(*BtShared)(unsafe.Pointer(pBt)).FbDoTruncate = U8(1)
  75735 		(*BtShared)(unsafe.Pointer(pBt)).FnPage = iLastPg
  75736 	}
  75737 	return SQLITE_OK
  75738 }
  75739 
  75740 func finalDbSize(tls *libc.TLS, pBt uintptr, nOrig Pgno, nFree Pgno) Pgno {
  75741 	var nEntry int32
  75742 	var nPtrmap Pgno
  75743 	var nFin Pgno
  75744 
  75745 	nEntry = int32((*BtShared)(unsafe.Pointer(pBt)).FusableSize / U32(5))
  75746 	nPtrmap = (nFree - nOrig + ptrmapPageno(tls, pBt, nOrig) + Pgno(nEntry)) / Pgno(nEntry)
  75747 	nFin = nOrig - nFree - nPtrmap
  75748 	if nOrig > U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1) && nFin < U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1) {
  75749 		nFin--
  75750 	}
  75751 	for ptrmapPageno(tls, pBt, nFin) == nFin || nFin == U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1) {
  75752 		nFin--
  75753 	}
  75754 
  75755 	return nFin
  75756 }
  75757 
  75758 // A write-transaction must be opened before calling this function.
  75759 // It performs a single unit of work towards an incremental vacuum.
  75760 //
  75761 // If the incremental vacuum is finished after this function has run,
  75762 // SQLITE_DONE is returned. If it is not finished, but no error occurred,
  75763 // SQLITE_OK is returned. Otherwise an SQLite error code.
  75764 func Xsqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) int32 {
  75765 	var rc int32
  75766 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  75767 
  75768 	Xsqlite3BtreeEnter(tls, p)
  75769 
  75770 	if !(int32((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum) != 0) {
  75771 		rc = SQLITE_DONE
  75772 	} else {
  75773 		var nOrig Pgno = btreePagecount(tls, pBt)
  75774 		var nFree Pgno = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36)
  75775 		var nFin Pgno = finalDbSize(tls, pBt, nOrig, nFree)
  75776 
  75777 		if nOrig < nFin || nFree >= nOrig {
  75778 			rc = Xsqlite3CorruptError(tls, 72440)
  75779 		} else if nFree > Pgno(0) {
  75780 			rc = saveAllCursors(tls, pBt, uint32(0), uintptr(0))
  75781 			if rc == SQLITE_OK {
  75782 				invalidateAllOverflowCache(tls, pBt)
  75783 				rc = incrVacuumStep(tls, pBt, nFin, nOrig, 0)
  75784 			}
  75785 			if rc == SQLITE_OK {
  75786 				rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FpDbPage)
  75787 				Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+28, (*BtShared)(unsafe.Pointer(pBt)).FnPage)
  75788 			}
  75789 		} else {
  75790 			rc = SQLITE_DONE
  75791 		}
  75792 	}
  75793 	Xsqlite3BtreeLeave(tls, p)
  75794 	return rc
  75795 }
  75796 
  75797 func autoVacuumCommit(tls *libc.TLS, p uintptr) int32 {
  75798 	var rc int32 = SQLITE_OK
  75799 	var pPager uintptr
  75800 	var pBt uintptr
  75801 	var db uintptr
  75802 
  75803 	pBt = (*Btree)(unsafe.Pointer(p)).FpBt
  75804 	pPager = (*BtShared)(unsafe.Pointer(pBt)).FpPager
  75805 
  75806 	invalidateAllOverflowCache(tls, pBt)
  75807 
  75808 	if !(int32((*BtShared)(unsafe.Pointer(pBt)).FincrVacuum) != 0) {
  75809 		var nFin Pgno
  75810 		var nFree Pgno
  75811 		var nVac Pgno
  75812 		var iFree Pgno
  75813 		var nOrig Pgno
  75814 
  75815 		nOrig = btreePagecount(tls, pBt)
  75816 		if ptrmapPageno(tls, pBt, nOrig) == nOrig || nOrig == U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1) {
  75817 			return Xsqlite3CorruptError(tls, 72491)
  75818 		}
  75819 
  75820 		nFree = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36)
  75821 		db = (*Btree)(unsafe.Pointer(p)).Fdb
  75822 		if (*Sqlite3)(unsafe.Pointer(db)).FxAutovacPages != 0 {
  75823 			var iDb int32
  75824 			for iDb = 0; iDb < (*Sqlite3)(unsafe.Pointer(db)).FnDb; iDb++ {
  75825 				if (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpBt == p {
  75826 					break
  75827 				}
  75828 			}
  75829 			nVac = (*struct {
  75830 				f func(*libc.TLS, uintptr, uintptr, U32, U32, U32) uint32
  75831 			})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxAutovacPages})).f(tls,
  75832 				(*Sqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg,
  75833 				(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName,
  75834 				nOrig,
  75835 				nFree,
  75836 				(*BtShared)(unsafe.Pointer(pBt)).FpageSize)
  75837 			if nVac > nFree {
  75838 				nVac = nFree
  75839 			}
  75840 			if nVac == Pgno(0) {
  75841 				return SQLITE_OK
  75842 			}
  75843 		} else {
  75844 			nVac = nFree
  75845 		}
  75846 		nFin = finalDbSize(tls, pBt, nOrig, nVac)
  75847 		if nFin > nOrig {
  75848 			return Xsqlite3CorruptError(tls, 72518)
  75849 		}
  75850 		if nFin < nOrig {
  75851 			rc = saveAllCursors(tls, pBt, uint32(0), uintptr(0))
  75852 		}
  75853 		for iFree = nOrig; iFree > nFin && rc == SQLITE_OK; iFree-- {
  75854 			rc = incrVacuumStep(tls, pBt, nFin, iFree, libc.Bool32(nVac == nFree))
  75855 		}
  75856 		if (rc == SQLITE_DONE || rc == SQLITE_OK) && nFree > Pgno(0) {
  75857 			rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FpDbPage)
  75858 			if nVac == nFree {
  75859 				Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+32, uint32(0))
  75860 				Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36, uint32(0))
  75861 			}
  75862 			Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+28, nFin)
  75863 			(*BtShared)(unsafe.Pointer(pBt)).FbDoTruncate = U8(1)
  75864 			(*BtShared)(unsafe.Pointer(pBt)).FnPage = nFin
  75865 		}
  75866 		if rc != SQLITE_OK {
  75867 			Xsqlite3PagerRollback(tls, pPager)
  75868 		}
  75869 	}
  75870 
  75871 	return rc
  75872 }
  75873 
  75874 // This routine does the first phase of a two-phase commit.  This routine
  75875 // causes a rollback journal to be created (if it does not already exist)
  75876 // and populated with enough information so that if a power loss occurs
  75877 // the database can be restored to its original state by playing back
  75878 // the journal.  Then the contents of the journal are flushed out to
  75879 // the disk.  After the journal is safely on oxide, the changes to the
  75880 // database are written into the database file and flushed to oxide.
  75881 // At the end of this call, the rollback journal still exists on the
  75882 // disk and we are still holding all locks, so the transaction has not
  75883 // committed.  See sqlite3BtreeCommitPhaseTwo() for the second phase of the
  75884 // commit process.
  75885 //
  75886 // This call is a no-op if no write-transaction is currently active on pBt.
  75887 //
  75888 // Otherwise, sync the database file for the btree pBt. zSuperJrnl points to
  75889 // the name of a super-journal file that should be written into the
  75890 // individual journal file, or is NULL, indicating no super-journal file
  75891 // (single database transaction).
  75892 //
  75893 // When this is called, the super-journal should already have been
  75894 // created, populated with this journal pointer and synced to disk.
  75895 //
  75896 // Once this is routine has returned, the only thing required to commit
  75897 // the write-transaction for this database file is to delete the journal.
  75898 func Xsqlite3BtreeCommitPhaseOne(tls *libc.TLS, p uintptr, zSuperJrnl uintptr) int32 {
  75899 	var rc int32 = SQLITE_OK
  75900 	if int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_WRITE {
  75901 		var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  75902 		Xsqlite3BtreeEnter(tls, p)
  75903 		if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 {
  75904 			rc = autoVacuumCommit(tls, p)
  75905 			if rc != SQLITE_OK {
  75906 				Xsqlite3BtreeLeave(tls, p)
  75907 				return rc
  75908 			}
  75909 		}
  75910 		if (*BtShared)(unsafe.Pointer(pBt)).FbDoTruncate != 0 {
  75911 			Xsqlite3PagerTruncateImage(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, (*BtShared)(unsafe.Pointer(pBt)).FnPage)
  75912 		}
  75913 		rc = Xsqlite3PagerCommitPhaseOne(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, zSuperJrnl, 0)
  75914 		Xsqlite3BtreeLeave(tls, p)
  75915 	}
  75916 	return rc
  75917 }
  75918 
  75919 func btreeEndTransaction(tls *libc.TLS, p uintptr) {
  75920 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  75921 	var db uintptr = (*Btree)(unsafe.Pointer(p)).Fdb
  75922 
  75923 	(*BtShared)(unsafe.Pointer(pBt)).FbDoTruncate = U8(0)
  75924 	if int32((*Btree)(unsafe.Pointer(p)).FinTrans) > TRANS_NONE && (*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead > 1 {
  75925 		downgradeAllSharedCacheTableLocks(tls, p)
  75926 		(*Btree)(unsafe.Pointer(p)).FinTrans = U8(TRANS_READ)
  75927 	} else {
  75928 		if int32((*Btree)(unsafe.Pointer(p)).FinTrans) != TRANS_NONE {
  75929 			clearAllSharedCacheTableLocks(tls, p)
  75930 			(*BtShared)(unsafe.Pointer(pBt)).FnTransaction--
  75931 			if 0 == (*BtShared)(unsafe.Pointer(pBt)).FnTransaction {
  75932 				(*BtShared)(unsafe.Pointer(pBt)).FinTransaction = U8(TRANS_NONE)
  75933 			}
  75934 		}
  75935 
  75936 		(*Btree)(unsafe.Pointer(p)).FinTrans = U8(TRANS_NONE)
  75937 		unlockBtreeIfUnused(tls, pBt)
  75938 	}
  75939 
  75940 }
  75941 
  75942 // Commit the transaction currently in progress.
  75943 //
  75944 // This routine implements the second phase of a 2-phase commit.  The
  75945 // sqlite3BtreeCommitPhaseOne() routine does the first phase and should
  75946 // be invoked prior to calling this routine.  The sqlite3BtreeCommitPhaseOne()
  75947 // routine did all the work of writing information out to disk and flushing the
  75948 // contents so that they are written onto the disk platter.  All this
  75949 // routine has to do is delete or truncate or zero the header in the
  75950 // the rollback journal (which causes the transaction to commit) and
  75951 // drop locks.
  75952 //
  75953 // Normally, if an error occurs while the pager layer is attempting to
  75954 // finalize the underlying journal file, this function returns an error and
  75955 // the upper layer will attempt a rollback. However, if the second argument
  75956 // is non-zero then this b-tree transaction is part of a multi-file
  75957 // transaction. In this case, the transaction has already been committed
  75958 // (by deleting a super-journal file) and the caller will ignore this
  75959 // functions return code. So, even if an error occurs in the pager layer,
  75960 // reset the b-tree objects internal state to indicate that the write
  75961 // transaction has been closed. This is quite safe, as the pager will have
  75962 // transitioned to the error state.
  75963 //
  75964 // This will release the write lock on the database file.  If there
  75965 // are no active cursors, it also releases the read lock.
  75966 func Xsqlite3BtreeCommitPhaseTwo(tls *libc.TLS, p uintptr, bCleanup int32) int32 {
  75967 	if int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_NONE {
  75968 		return SQLITE_OK
  75969 	}
  75970 	Xsqlite3BtreeEnter(tls, p)
  75971 
  75972 	if int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_WRITE {
  75973 		var rc int32
  75974 		var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  75975 
  75976 		rc = Xsqlite3PagerCommitPhaseTwo(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager)
  75977 		if rc != SQLITE_OK && bCleanup == 0 {
  75978 			Xsqlite3BtreeLeave(tls, p)
  75979 			return rc
  75980 		}
  75981 		(*Btree)(unsafe.Pointer(p)).FiBDataVersion--
  75982 		(*BtShared)(unsafe.Pointer(pBt)).FinTransaction = U8(TRANS_READ)
  75983 		btreeClearHasContent(tls, pBt)
  75984 	}
  75985 
  75986 	btreeEndTransaction(tls, p)
  75987 	Xsqlite3BtreeLeave(tls, p)
  75988 	return SQLITE_OK
  75989 }
  75990 
  75991 // Do both phases of a commit.
  75992 func Xsqlite3BtreeCommit(tls *libc.TLS, p uintptr) int32 {
  75993 	var rc int32
  75994 	Xsqlite3BtreeEnter(tls, p)
  75995 	rc = Xsqlite3BtreeCommitPhaseOne(tls, p, uintptr(0))
  75996 	if rc == SQLITE_OK {
  75997 		rc = Xsqlite3BtreeCommitPhaseTwo(tls, p, 0)
  75998 	}
  75999 	Xsqlite3BtreeLeave(tls, p)
  76000 	return rc
  76001 }
  76002 
  76003 // This routine sets the state to CURSOR_FAULT and the error
  76004 // code to errCode for every cursor on any BtShared that pBtree
  76005 // references.  Or if the writeOnly flag is set to 1, then only
  76006 // trip write cursors and leave read cursors unchanged.
  76007 //
  76008 // Every cursor is a candidate to be tripped, including cursors
  76009 // that belong to other database connections that happen to be
  76010 // sharing the cache with pBtree.
  76011 //
  76012 // This routine gets called when a rollback occurs. If the writeOnly
  76013 // flag is true, then only write-cursors need be tripped - read-only
  76014 // cursors save their current positions so that they may continue
  76015 // following the rollback. Or, if writeOnly is false, all cursors are
  76016 // tripped. In general, writeOnly is false if the transaction being
  76017 // rolled back modified the database schema. In this case b-tree root
  76018 // pages may be moved or deleted from the database altogether, making
  76019 // it unsafe for read cursors to continue.
  76020 //
  76021 // If the writeOnly flag is true and an error is encountered while
  76022 // saving the current position of a read-only cursor, all cursors,
  76023 // including all read-cursors are tripped.
  76024 //
  76025 // SQLITE_OK is returned if successful, or if an error occurs while
  76026 // saving a cursor position, an SQLite error code.
  76027 func Xsqlite3BtreeTripAllCursors(tls *libc.TLS, pBtree uintptr, errCode int32, writeOnly int32) int32 {
  76028 	var p uintptr
  76029 	var rc int32 = SQLITE_OK
  76030 
  76031 	if pBtree != 0 {
  76032 		Xsqlite3BtreeEnter(tls, pBtree)
  76033 		for p = (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(pBtree)).FpBt)).FpCursor; p != 0; p = (*BtCursor)(unsafe.Pointer(p)).FpNext {
  76034 			if writeOnly != 0 && int32((*BtCursor)(unsafe.Pointer(p)).FcurFlags)&BTCF_WriteFlag == 0 {
  76035 				if int32((*BtCursor)(unsafe.Pointer(p)).FeState) == CURSOR_VALID || int32((*BtCursor)(unsafe.Pointer(p)).FeState) == CURSOR_SKIPNEXT {
  76036 					rc = saveCursorPosition(tls, p)
  76037 					if rc != SQLITE_OK {
  76038 						Xsqlite3BtreeTripAllCursors(tls, pBtree, rc, 0)
  76039 						break
  76040 					}
  76041 				}
  76042 			} else {
  76043 				Xsqlite3BtreeClearCursor(tls, p)
  76044 				(*BtCursor)(unsafe.Pointer(p)).FeState = U8(CURSOR_FAULT)
  76045 				(*BtCursor)(unsafe.Pointer(p)).FskipNext = errCode
  76046 			}
  76047 			btreeReleaseAllCursorPages(tls, p)
  76048 		}
  76049 		Xsqlite3BtreeLeave(tls, pBtree)
  76050 	}
  76051 	return rc
  76052 }
  76053 
  76054 func btreeSetNPage(tls *libc.TLS, pBt uintptr, pPage1 uintptr) {
  76055 	bp := tls.Alloc(4)
  76056 	defer tls.Free(4)
  76057 
  76058 	*(*int32)(unsafe.Pointer(bp)) = int32(Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+28))
  76059 
  76060 	if *(*int32)(unsafe.Pointer(bp)) == 0 {
  76061 		Xsqlite3PagerPagecount(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, bp)
  76062 	}
  76063 
  76064 	(*BtShared)(unsafe.Pointer(pBt)).FnPage = U32(*(*int32)(unsafe.Pointer(bp)))
  76065 }
  76066 
  76067 // Rollback the transaction in progress.
  76068 //
  76069 // If tripCode is not SQLITE_OK then cursors will be invalidated (tripped).
  76070 // Only write cursors are tripped if writeOnly is true but all cursors are
  76071 // tripped if writeOnly is false.  Any attempt to use
  76072 // a tripped cursor will result in an error.
  76073 //
  76074 // This will release the write lock on the database file.  If there
  76075 // are no active cursors, it also releases the read lock.
  76076 func Xsqlite3BtreeRollback(tls *libc.TLS, p uintptr, tripCode int32, writeOnly int32) int32 {
  76077 	bp := tls.Alloc(8)
  76078 	defer tls.Free(8)
  76079 
  76080 	var rc int32
  76081 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  76082 
  76083 	Xsqlite3BtreeEnter(tls, p)
  76084 	if tripCode == SQLITE_OK {
  76085 		rc = libc.AssignInt32(&tripCode, saveAllCursors(tls, pBt, uint32(0), uintptr(0)))
  76086 		if rc != 0 {
  76087 			writeOnly = 0
  76088 		}
  76089 	} else {
  76090 		rc = SQLITE_OK
  76091 	}
  76092 	if tripCode != 0 {
  76093 		var rc2 int32 = Xsqlite3BtreeTripAllCursors(tls, p, tripCode, writeOnly)
  76094 
  76095 		if rc2 != SQLITE_OK {
  76096 			rc = rc2
  76097 		}
  76098 	}
  76099 
  76100 	if int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_WRITE {
  76101 		var rc2 int32
  76102 
  76103 		rc2 = Xsqlite3PagerRollback(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager)
  76104 		if rc2 != SQLITE_OK {
  76105 			rc = rc2
  76106 		}
  76107 
  76108 		if btreeGetPage(tls, pBt, uint32(1), bp, 0) == SQLITE_OK {
  76109 			btreeSetNPage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp)))
  76110 			releasePageOne(tls, *(*uintptr)(unsafe.Pointer(bp)))
  76111 		}
  76112 
  76113 		(*BtShared)(unsafe.Pointer(pBt)).FinTransaction = U8(TRANS_READ)
  76114 		btreeClearHasContent(tls, pBt)
  76115 	}
  76116 
  76117 	btreeEndTransaction(tls, p)
  76118 	Xsqlite3BtreeLeave(tls, p)
  76119 	return rc
  76120 }
  76121 
  76122 // Start a statement subtransaction. The subtransaction can be rolled
  76123 // back independently of the main transaction. You must start a transaction
  76124 // before starting a subtransaction. The subtransaction is ended automatically
  76125 // if the main transaction commits or rolls back.
  76126 //
  76127 // Statement subtransactions are used around individual SQL statements
  76128 // that are contained within a BEGIN...COMMIT block.  If a constraint
  76129 // error occurs within the statement, the effect of that one statement
  76130 // can be rolled back without having to rollback the entire transaction.
  76131 //
  76132 // A statement sub-transaction is implemented as an anonymous savepoint. The
  76133 // value passed as the second parameter is the total number of savepoints,
  76134 // including the new anonymous savepoint, open on the B-Tree. i.e. if there
  76135 // are no active savepoints and no other statement-transactions open,
  76136 // iStatement is 1. This anonymous savepoint can be released or rolled back
  76137 // using the sqlite3BtreeSavepoint() function.
  76138 func Xsqlite3BtreeBeginStmt(tls *libc.TLS, p uintptr, iStatement int32) int32 {
  76139 	var rc int32
  76140 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  76141 	Xsqlite3BtreeEnter(tls, p)
  76142 
  76143 	rc = Xsqlite3PagerOpenSavepoint(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, iStatement)
  76144 	Xsqlite3BtreeLeave(tls, p)
  76145 	return rc
  76146 }
  76147 
  76148 // The second argument to this function, op, is always SAVEPOINT_ROLLBACK
  76149 // or SAVEPOINT_RELEASE. This function either releases or rolls back the
  76150 // savepoint identified by parameter iSavepoint, depending on the value
  76151 // of op.
  76152 //
  76153 // Normally, iSavepoint is greater than or equal to zero. However, if op is
  76154 // SAVEPOINT_ROLLBACK, then iSavepoint may also be -1. In this case the
  76155 // contents of the entire transaction are rolled back. This is different
  76156 // from a normal transaction rollback, as no locks are released and the
  76157 // transaction remains open.
  76158 func Xsqlite3BtreeSavepoint(tls *libc.TLS, p uintptr, op int32, iSavepoint int32) int32 {
  76159 	var rc int32 = SQLITE_OK
  76160 	if p != 0 && int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_WRITE {
  76161 		var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  76162 
  76163 		Xsqlite3BtreeEnter(tls, p)
  76164 		if op == SAVEPOINT_ROLLBACK {
  76165 			rc = saveAllCursors(tls, pBt, uint32(0), uintptr(0))
  76166 		}
  76167 		if rc == SQLITE_OK {
  76168 			rc = Xsqlite3PagerSavepoint(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, op, iSavepoint)
  76169 		}
  76170 		if rc == SQLITE_OK {
  76171 			if iSavepoint < 0 && int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_INITIALLY_EMPTY != 0 {
  76172 				(*BtShared)(unsafe.Pointer(pBt)).FnPage = U32(0)
  76173 			}
  76174 			rc = newDatabase(tls, pBt)
  76175 			btreeSetNPage(tls, pBt, (*BtShared)(unsafe.Pointer(pBt)).FpPage1)
  76176 
  76177 		}
  76178 		Xsqlite3BtreeLeave(tls, p)
  76179 	}
  76180 	return rc
  76181 }
  76182 
  76183 func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 {
  76184 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  76185 	var pX uintptr
  76186 
  76187 	if iTable <= Pgno(1) {
  76188 		if iTable < Pgno(1) {
  76189 			return Xsqlite3CorruptError(tls, 72982)
  76190 		} else if btreePagecount(tls, pBt) == Pgno(0) {
  76191 			iTable = Pgno(0)
  76192 		}
  76193 	}
  76194 
  76195 	(*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot = iTable
  76196 	(*BtCursor)(unsafe.Pointer(pCur)).FiPage = int8(-1)
  76197 	(*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo = pKeyInfo
  76198 	(*BtCursor)(unsafe.Pointer(pCur)).FpBtree = p
  76199 	(*BtCursor)(unsafe.Pointer(pCur)).FpBt = pBt
  76200 	(*BtCursor)(unsafe.Pointer(pCur)).FcurFlags = U8(0)
  76201 
  76202 	for pX = (*BtShared)(unsafe.Pointer(pBt)).FpCursor; pX != 0; pX = (*BtCursor)(unsafe.Pointer(pX)).FpNext {
  76203 		if (*BtCursor)(unsafe.Pointer(pX)).FpgnoRoot == iTable {
  76204 			*(*U8)(unsafe.Pointer(pX + 1)) |= U8(BTCF_Multiple)
  76205 			(*BtCursor)(unsafe.Pointer(pCur)).FcurFlags = U8(BTCF_Multiple)
  76206 		}
  76207 	}
  76208 	(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID)
  76209 	(*BtCursor)(unsafe.Pointer(pCur)).FpNext = (*BtShared)(unsafe.Pointer(pBt)).FpCursor
  76210 	(*BtShared)(unsafe.Pointer(pBt)).FpCursor = pCur
  76211 	if wrFlag != 0 {
  76212 		*(*U8)(unsafe.Pointer(pCur + 1)) |= U8(BTCF_WriteFlag)
  76213 		(*BtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags = U8(0)
  76214 		if (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace == uintptr(0) {
  76215 			return allocateTempSpace(tls, pBt)
  76216 		}
  76217 	} else {
  76218 		(*BtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags = U8(PAGER_GET_READONLY)
  76219 	}
  76220 	return SQLITE_OK
  76221 }
  76222 
  76223 func btreeCursorWithLock(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 {
  76224 	var rc int32
  76225 	Xsqlite3BtreeEnter(tls, p)
  76226 	rc = btreeCursor(tls, p, iTable, wrFlag, pKeyInfo, pCur)
  76227 	Xsqlite3BtreeLeave(tls, p)
  76228 	return rc
  76229 }
  76230 
  76231 func Xsqlite3BtreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 {
  76232 	if (*Btree)(unsafe.Pointer(p)).Fsharable != 0 {
  76233 		return btreeCursorWithLock(tls, p, iTable, wrFlag, pKeyInfo, pCur)
  76234 	} else {
  76235 		return btreeCursor(tls, p, iTable, wrFlag, pKeyInfo, pCur)
  76236 	}
  76237 	return int32(0)
  76238 }
  76239 
  76240 // Return the size of a BtCursor object in bytes.
  76241 //
  76242 // This interfaces is needed so that users of cursors can preallocate
  76243 // sufficient storage to hold a cursor.  The BtCursor object is opaque
  76244 // to users so they cannot do the sizeof() themselves - they must call
  76245 // this routine.
  76246 func Xsqlite3BtreeCursorSize(tls *libc.TLS) int32 {
  76247 	return int32((uint64(unsafe.Sizeof(BtCursor{})) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7)))
  76248 }
  76249 
  76250 // Initialize memory that will be converted into a BtCursor object.
  76251 //
  76252 // The simple approach here would be to memset() the entire object
  76253 // to zero.  But it turns out that the apPage[] and aiIdx[] arrays
  76254 // do not need to be zeroed and they are large, so we can save a lot
  76255 // of run-time by skipping the initialization of those elements.
  76256 func Xsqlite3BtreeCursorZero(tls *libc.TLS, p uintptr) {
  76257 	libc.Xmemset(tls, p, 0, uint64(uintptr(0)+32))
  76258 }
  76259 
  76260 // Close a cursor.  The read lock on the database file is released
  76261 // when the last cursor is closed.
  76262 func Xsqlite3BtreeCloseCursor(tls *libc.TLS, pCur uintptr) int32 {
  76263 	var pBtree uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpBtree
  76264 	if pBtree != 0 {
  76265 		var pBt uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpBt
  76266 		Xsqlite3BtreeEnter(tls, pBtree)
  76267 
  76268 		if (*BtShared)(unsafe.Pointer(pBt)).FpCursor == pCur {
  76269 			(*BtShared)(unsafe.Pointer(pBt)).FpCursor = (*BtCursor)(unsafe.Pointer(pCur)).FpNext
  76270 		} else {
  76271 			var pPrev uintptr = (*BtShared)(unsafe.Pointer(pBt)).FpCursor
  76272 			for __ccgo := true; __ccgo; __ccgo = pPrev != 0 {
  76273 				if (*BtCursor)(unsafe.Pointer(pPrev)).FpNext == pCur {
  76274 					(*BtCursor)(unsafe.Pointer(pPrev)).FpNext = (*BtCursor)(unsafe.Pointer(pCur)).FpNext
  76275 					break
  76276 				}
  76277 				pPrev = (*BtCursor)(unsafe.Pointer(pPrev)).FpNext
  76278 			}
  76279 		}
  76280 		btreeReleaseAllCursorPages(tls, pCur)
  76281 		unlockBtreeIfUnused(tls, pBt)
  76282 		Xsqlite3_free(tls, (*BtCursor)(unsafe.Pointer(pCur)).FaOverflow)
  76283 		Xsqlite3_free(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpKey)
  76284 		if int32((*BtShared)(unsafe.Pointer(pBt)).FopenFlags)&BTREE_SINGLE != 0 && (*BtShared)(unsafe.Pointer(pBt)).FpCursor == uintptr(0) {
  76285 			Xsqlite3BtreeClose(tls, pBtree)
  76286 		} else {
  76287 			Xsqlite3BtreeLeave(tls, pBtree)
  76288 		}
  76289 		(*BtCursor)(unsafe.Pointer(pCur)).FpBtree = uintptr(0)
  76290 	}
  76291 	return SQLITE_OK
  76292 }
  76293 
  76294 func getCellInfo(tls *libc.TLS, pCur uintptr) {
  76295 	if int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize) == 0 {
  76296 		*(*U8)(unsafe.Pointer(pCur + 1)) |= U8(BTCF_ValidNKey)
  76297 		btreeParseCell(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpPage, int32((*BtCursor)(unsafe.Pointer(pCur)).Fix), pCur+48)
  76298 	} else {
  76299 	}
  76300 }
  76301 
  76302 func Xsqlite3BtreeCursorIsValidNN(tls *libc.TLS, pCur uintptr) int32 {
  76303 	return libc.Bool32(int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID)
  76304 }
  76305 
  76306 // Return the value of the integer key or "rowid" for a table btree.
  76307 // This routine is only valid for a cursor that is pointing into a
  76308 // ordinary table btree.  If the cursor points to an index btree or
  76309 // is invalid, the result of this routine is undefined.
  76310 func Xsqlite3BtreeIntegerKey(tls *libc.TLS, pCur uintptr) I64 {
  76311 	getCellInfo(tls, pCur)
  76312 	return (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey
  76313 }
  76314 
  76315 // Pin or unpin a cursor.
  76316 func Xsqlite3BtreeCursorPin(tls *libc.TLS, pCur uintptr) {
  76317 	*(*U8)(unsafe.Pointer(pCur + 1)) |= U8(BTCF_Pinned)
  76318 }
  76319 
  76320 func Xsqlite3BtreeCursorUnpin(tls *libc.TLS, pCur uintptr) {
  76321 	*(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_Pinned))
  76322 }
  76323 
  76324 // Return the offset into the database file for the start of the
  76325 // payload to which the cursor is pointing.
  76326 func Xsqlite3BtreeOffset(tls *libc.TLS, pCur uintptr) I64 {
  76327 	getCellInfo(tls, pCur)
  76328 	return I64((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FpageSize)*(I64((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).Fpgno)-int64(1)) + (int64((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload)-int64((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FaData))/1
  76329 }
  76330 
  76331 // Return the number of bytes of payload for the entry that pCur is
  76332 // currently pointing to.  For table btrees, this will be the amount
  76333 // of data.  For index btrees, this will be the size of the key.
  76334 //
  76335 // The caller must guarantee that the cursor is pointing to a non-NULL
  76336 // valid entry.  In other words, the calling procedure must guarantee
  76337 // that the cursor has Cursor.eState==CURSOR_VALID.
  76338 func Xsqlite3BtreePayloadSize(tls *libc.TLS, pCur uintptr) U32 {
  76339 	getCellInfo(tls, pCur)
  76340 	return (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnPayload
  76341 }
  76342 
  76343 // Return an upper bound on the size of any record for the table
  76344 // that the cursor is pointing into.
  76345 //
  76346 // This is an optimization.  Everything will still work if this
  76347 // routine always returns 2147483647 (which is the largest record
  76348 // that SQLite can handle) or more.  But returning a smaller value might
  76349 // prevent large memory allocations when trying to interpret a
  76350 // corrupt datrabase.
  76351 //
  76352 // The current implementation merely returns the size of the underlying
  76353 // database file.
  76354 func Xsqlite3BtreeMaxRecordSize(tls *libc.TLS, pCur uintptr) Sqlite3_int64 {
  76355 	return Sqlite3_int64((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FpageSize) * Sqlite3_int64((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage)
  76356 }
  76357 
  76358 func getOverflowPage(tls *libc.TLS, pBt uintptr, ovfl Pgno, ppPage uintptr, pPgnoNext uintptr) int32 {
  76359 	bp := tls.Alloc(16)
  76360 	defer tls.Free(16)
  76361 
  76362 	var next Pgno = Pgno(0)
  76363 	*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
  76364 	var rc int32 = SQLITE_OK
  76365 
  76366 	if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 {
  76367 		var iGuess Pgno = ovfl + Pgno(1)
  76368 
  76369 		for ptrmapPageno(tls, pBt, iGuess) == iGuess || iGuess == U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1) {
  76370 			iGuess++
  76371 		}
  76372 
  76373 		if iGuess <= btreePagecount(tls, pBt) {
  76374 			rc = ptrmapGet(tls, pBt, iGuess, bp, bp+4)
  76375 			if rc == SQLITE_OK && int32(*(*U8)(unsafe.Pointer(bp))) == PTRMAP_OVERFLOW2 && *(*Pgno)(unsafe.Pointer(bp + 4)) == ovfl {
  76376 				next = iGuess
  76377 				rc = SQLITE_DONE
  76378 			}
  76379 		}
  76380 	}
  76381 
  76382 	if rc == SQLITE_OK {
  76383 		rc = btreeGetPage(tls, pBt, ovfl, bp+8, func() int32 {
  76384 			if ppPage == uintptr(0) {
  76385 				return PAGER_GET_READONLY
  76386 			}
  76387 			return 0
  76388 		}())
  76389 
  76390 		if rc == SQLITE_OK {
  76391 			next = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData)
  76392 		}
  76393 	}
  76394 
  76395 	*(*Pgno)(unsafe.Pointer(pPgnoNext)) = next
  76396 	if ppPage != 0 {
  76397 		*(*uintptr)(unsafe.Pointer(ppPage)) = *(*uintptr)(unsafe.Pointer(bp + 8))
  76398 	} else {
  76399 		releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
  76400 	}
  76401 	return func() int32 {
  76402 		if rc == SQLITE_DONE {
  76403 			return SQLITE_OK
  76404 		}
  76405 		return rc
  76406 	}()
  76407 }
  76408 
  76409 func copyPayload(tls *libc.TLS, pPayload uintptr, pBuf uintptr, nByte int32, eOp int32, pDbPage uintptr) int32 {
  76410 	if eOp != 0 {
  76411 		var rc int32 = Xsqlite3PagerWrite(tls, pDbPage)
  76412 		if rc != SQLITE_OK {
  76413 			return rc
  76414 		}
  76415 		libc.Xmemcpy(tls, pPayload, pBuf, uint64(nByte))
  76416 	} else {
  76417 		libc.Xmemcpy(tls, pBuf, pPayload, uint64(nByte))
  76418 	}
  76419 	return SQLITE_OK
  76420 }
  76421 
  76422 func accessPayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr, eOp int32) int32 {
  76423 	bp := tls.Alloc(16)
  76424 	defer tls.Free(16)
  76425 
  76426 	var aPayload uintptr
  76427 	var rc int32 = SQLITE_OK
  76428 	var iIdx int32 = 0
  76429 	var pPage uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
  76430 	var pBt uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpBt
  76431 
  76432 	if int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) {
  76433 		return Xsqlite3CorruptError(tls, 73389)
  76434 	}
  76435 
  76436 	getCellInfo(tls, pCur)
  76437 	aPayload = (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload
  76438 
  76439 	if Uptr((int64(aPayload)-int64((*MemPage)(unsafe.Pointer(pPage)).FaData))/1) > Uptr((*BtShared)(unsafe.Pointer(pBt)).FusableSize-U32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal)) {
  76440 		return Xsqlite3CorruptError(tls, 73404)
  76441 	}
  76442 
  76443 	if offset < U32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) {
  76444 		var a int32 = int32(amt)
  76445 		if U32(a)+offset > U32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) {
  76446 			a = int32(U32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) - offset)
  76447 		}
  76448 		rc = copyPayload(tls, aPayload+uintptr(offset), pBuf, a, eOp, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage)
  76449 		offset = U32(0)
  76450 		pBuf += uintptr(a)
  76451 		amt = amt - U32(a)
  76452 	} else {
  76453 		offset = offset - U32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal)
  76454 	}
  76455 
  76456 	if rc == SQLITE_OK && amt > U32(0) {
  76457 		var ovflSize U32 = (*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(4)
  76458 
  76459 		*(*Pgno)(unsafe.Pointer(bp)) = Xsqlite3Get4byte(tls, aPayload+uintptr((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal))
  76460 
  76461 		if int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags)&BTCF_ValidOvfl == 0 {
  76462 			var nOvfl int32 = int32(((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnPayload - U32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) + ovflSize - U32(1)) / ovflSize)
  76463 			if (*BtCursor)(unsafe.Pointer(pCur)).FaOverflow == uintptr(0) ||
  76464 				nOvfl*int32(unsafe.Sizeof(Pgno(0))) > Xsqlite3MallocSize(tls, (*BtCursor)(unsafe.Pointer(pCur)).FaOverflow) {
  76465 				var aNew uintptr = Xsqlite3Realloc(tls,
  76466 					(*BtCursor)(unsafe.Pointer(pCur)).FaOverflow, uint64(nOvfl*2)*uint64(unsafe.Sizeof(Pgno(0))))
  76467 				if aNew == uintptr(0) {
  76468 					return SQLITE_NOMEM
  76469 				} else {
  76470 					(*BtCursor)(unsafe.Pointer(pCur)).FaOverflow = aNew
  76471 				}
  76472 			}
  76473 			libc.Xmemset(tls, (*BtCursor)(unsafe.Pointer(pCur)).FaOverflow, 0, uint64(nOvfl)*uint64(unsafe.Sizeof(Pgno(0))))
  76474 			*(*U8)(unsafe.Pointer(pCur + 1)) |= U8(BTCF_ValidOvfl)
  76475 		} else {
  76476 			if *(*Pgno)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(offset/ovflSize)*4)) != 0 {
  76477 				iIdx = int32(offset / ovflSize)
  76478 				*(*Pgno)(unsafe.Pointer(bp)) = *(*Pgno)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4))
  76479 				offset = offset % ovflSize
  76480 			}
  76481 		}
  76482 
  76483 		for *(*Pgno)(unsafe.Pointer(bp)) != 0 {
  76484 			if *(*Pgno)(unsafe.Pointer(bp)) > (*BtShared)(unsafe.Pointer(pBt)).FnPage {
  76485 				return Xsqlite3CorruptError(tls, 73466)
  76486 			}
  76487 
  76488 			*(*Pgno)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*Pgno)(unsafe.Pointer(bp))
  76489 
  76490 			if offset >= ovflSize {
  76491 				if *(*Pgno)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx+1)*4)) != 0 {
  76492 					*(*Pgno)(unsafe.Pointer(bp)) = *(*Pgno)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx+1)*4))
  76493 				} else {
  76494 					rc = getOverflowPage(tls, pBt, *(*Pgno)(unsafe.Pointer(bp)), uintptr(0), bp)
  76495 				}
  76496 				offset = offset - ovflSize
  76497 			} else {
  76498 				var a int32 = int32(amt)
  76499 				if U32(a)+offset > ovflSize {
  76500 					a = int32(ovflSize - offset)
  76501 				}
  76502 
  76503 				{
  76504 					rc = Xsqlite3PagerGet(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, *(*Pgno)(unsafe.Pointer(bp)), bp+8,
  76505 						func() int32 {
  76506 							if eOp == 0 {
  76507 								return PAGER_GET_READONLY
  76508 							}
  76509 							return 0
  76510 						}())
  76511 					if rc == SQLITE_OK {
  76512 						aPayload = Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
  76513 						*(*Pgno)(unsafe.Pointer(bp)) = Xsqlite3Get4byte(tls, aPayload)
  76514 						rc = copyPayload(tls, aPayload+uintptr(offset+U32(4)), pBuf, a, eOp, *(*uintptr)(unsafe.Pointer(bp + 8)))
  76515 						Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
  76516 						offset = U32(0)
  76517 					}
  76518 
  76519 				}
  76520 				amt = amt - U32(a)
  76521 				if amt == U32(0) {
  76522 					return rc
  76523 				}
  76524 				pBuf += uintptr(a)
  76525 			}
  76526 			if rc != 0 {
  76527 				break
  76528 			}
  76529 			iIdx++
  76530 		}
  76531 	}
  76532 
  76533 	if rc == SQLITE_OK && amt > U32(0) {
  76534 		return Xsqlite3CorruptError(tls, 73551)
  76535 	}
  76536 	return rc
  76537 }
  76538 
  76539 // Read part of the payload for the row at which that cursor pCur is currently
  76540 // pointing.  "amt" bytes will be transferred into pBuf[].  The transfer
  76541 // begins at "offset".
  76542 //
  76543 // pCur can be pointing to either a table or an index b-tree.
  76544 // If pointing to a table btree, then the content section is read.  If
  76545 // pCur is pointing to an index b-tree then the key section is read.
  76546 //
  76547 // For sqlite3BtreePayload(), the caller must ensure that pCur is pointing
  76548 // to a valid row in the table.  For sqlite3BtreePayloadChecked(), the
  76549 // cursor might be invalid or might need to be restored before being read.
  76550 //
  76551 // Return SQLITE_OK on success or an error code if anything goes
  76552 // wrong.  An error is returned if "offset+amt" is larger than
  76553 // the available payload.
  76554 func Xsqlite3BtreePayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 {
  76555 	return accessPayload(tls, pCur, offset, amt, pBuf, 0)
  76556 }
  76557 
  76558 func accessPayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 {
  76559 	var rc int32
  76560 	if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_INVALID {
  76561 		return SQLITE_ABORT
  76562 	}
  76563 
  76564 	rc = btreeRestoreCursorPosition(tls, pCur)
  76565 	if rc != 0 {
  76566 		return rc
  76567 	}
  76568 	return accessPayload(tls, pCur, offset, amt, pBuf, 0)
  76569 }
  76570 
  76571 func Xsqlite3BtreePayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 {
  76572 	if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID {
  76573 		return accessPayload(tls, pCur, offset, amt, pBuf, 0)
  76574 	} else {
  76575 		return accessPayloadChecked(tls, pCur, offset, amt, pBuf)
  76576 	}
  76577 	return int32(0)
  76578 }
  76579 
  76580 func fetchPayload(tls *libc.TLS, pCur uintptr, pAmt uintptr) uintptr {
  76581 	var amt int32
  76582 
  76583 	amt = int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal)
  76584 	if amt > int32((int64((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FaDataEnd)-int64((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload))/1) {
  76585 		amt = func() int32 {
  76586 			if 0 > int32((int64((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FaDataEnd)-int64((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload))/1) {
  76587 				return 0
  76588 			}
  76589 			return int32((int64((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FaDataEnd) - int64((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload)) / 1)
  76590 		}()
  76591 	}
  76592 	*(*U32)(unsafe.Pointer(pAmt)) = U32(amt)
  76593 	return (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload
  76594 }
  76595 
  76596 // For the entry that cursor pCur is point to, return as
  76597 // many bytes of the key or data as are available on the local
  76598 // b-tree page.  Write the number of available bytes into *pAmt.
  76599 //
  76600 // The pointer returned is ephemeral.  The key/data may move
  76601 // or be destroyed on the next call to any Btree routine,
  76602 // including calls from other threads against the same cache.
  76603 // Hence, a mutex on the BtShared should be held prior to calling
  76604 // this routine.
  76605 //
  76606 // These routines is used to get quick access to key and data
  76607 // in the common case where no overflow pages are used.
  76608 func Xsqlite3BtreePayloadFetch(tls *libc.TLS, pCur uintptr, pAmt uintptr) uintptr {
  76609 	return fetchPayload(tls, pCur, pAmt)
  76610 }
  76611 
  76612 func moveToChild(tls *libc.TLS, pCur uintptr, newPgno U32) int32 {
  76613 	if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) >= BTCURSOR_MAX_DEPTH-1 {
  76614 		return Xsqlite3CorruptError(tls, 73688)
  76615 	}
  76616 	(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
  76617 	*(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_ValidNKey | BTCF_ValidOvfl))
  76618 	*(*U16)(unsafe.Pointer(pCur + 88 + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FiPage)*2)) = (*BtCursor)(unsafe.Pointer(pCur)).Fix
  76619 	*(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FiPage)*8)) = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
  76620 	(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(0)
  76621 	(*BtCursor)(unsafe.Pointer(pCur)).FiPage++
  76622 	return getAndInitPage(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBt, newPgno, pCur+136, pCur,
  76623 		int32((*BtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags))
  76624 }
  76625 
  76626 func moveToParent(tls *libc.TLS, pCur uintptr) {
  76627 	var pLeaf uintptr
  76628 
  76629 	(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
  76630 	*(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_ValidNKey | BTCF_ValidOvfl))
  76631 	(*BtCursor)(unsafe.Pointer(pCur)).Fix = *(*U16)(unsafe.Pointer(pCur + 88 + uintptr(int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage)-1)*2))
  76632 	pLeaf = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
  76633 	(*BtCursor)(unsafe.Pointer(pCur)).FpPage = *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr(libc.PreDecInt8(&(*BtCursor)(unsafe.Pointer(pCur)).FiPage, 1))*8))
  76634 	releasePageNotNull(tls, pLeaf)
  76635 }
  76636 
  76637 func moveToRoot(tls *libc.TLS, pCur uintptr) int32 {
  76638 	var pRoot uintptr
  76639 	var rc int32
  76640 	var subpage Pgno
  76641 	rc = SQLITE_OK
  76642 
  76643 	if !(int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) >= 0) {
  76644 		goto __1
  76645 	}
  76646 	if !((*BtCursor)(unsafe.Pointer(pCur)).FiPage != 0) {
  76647 		goto __3
  76648 	}
  76649 	releasePageNotNull(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpPage)
  76650 __4:
  76651 	if !(libc.PreDecInt8(&(*BtCursor)(unsafe.Pointer(pCur)).FiPage, 1) != 0) {
  76652 		goto __5
  76653 	}
  76654 	releasePageNotNull(tls, *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FiPage)*8)))
  76655 	goto __4
  76656 __5:
  76657 	;
  76658 	pRoot = libc.AssignPtrUintptr(pCur+136, *(*uintptr)(unsafe.Pointer(pCur + 144)))
  76659 	goto skip_init
  76660 __3:
  76661 	;
  76662 	goto __2
  76663 __1:
  76664 	if !((*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot == Pgno(0)) {
  76665 		goto __6
  76666 	}
  76667 	(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID)
  76668 	return SQLITE_EMPTY
  76669 	goto __7
  76670 __6:
  76671 	;
  76672 	if !(int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) >= CURSOR_REQUIRESEEK) {
  76673 		goto __8
  76674 	}
  76675 	if !(int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_FAULT) {
  76676 		goto __9
  76677 	}
  76678 
  76679 	return (*BtCursor)(unsafe.Pointer(pCur)).FskipNext
  76680 __9:
  76681 	;
  76682 	Xsqlite3BtreeClearCursor(tls, pCur)
  76683 __8:
  76684 	;
  76685 	rc = getAndInitPage(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBt, (*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot, pCur+136,
  76686 		uintptr(0), int32((*BtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags))
  76687 	if !(rc != SQLITE_OK) {
  76688 		goto __10
  76689 	}
  76690 	(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID)
  76691 	return rc
  76692 __10:
  76693 	;
  76694 	(*BtCursor)(unsafe.Pointer(pCur)).FiPage = int8(0)
  76695 	(*BtCursor)(unsafe.Pointer(pCur)).FcurIntKey = (*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey
  76696 __7:
  76697 	;
  76698 __2:
  76699 	;
  76700 	pRoot = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
  76701 
  76702 	if !(int32((*MemPage)(unsafe.Pointer(pRoot)).FisInit) == 0 || libc.Bool32((*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0)) != int32((*MemPage)(unsafe.Pointer(pRoot)).FintKey)) {
  76703 		goto __11
  76704 	}
  76705 	return Xsqlite3CorruptError(tls, 73827)
  76706 __11:
  76707 	;
  76708 skip_init:
  76709 	(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(0)
  76710 	(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
  76711 	*(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_AtLast | BTCF_ValidNKey | BTCF_ValidOvfl))
  76712 
  76713 	if !(int32((*MemPage)(unsafe.Pointer(pRoot)).FnCell) > 0) {
  76714 		goto __12
  76715 	}
  76716 	(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID)
  76717 	goto __13
  76718 __12:
  76719 	if !!(int32((*MemPage)(unsafe.Pointer(pRoot)).Fleaf) != 0) {
  76720 		goto __14
  76721 	}
  76722 	if !((*MemPage)(unsafe.Pointer(pRoot)).Fpgno != Pgno(1)) {
  76723 		goto __16
  76724 	}
  76725 	return Xsqlite3CorruptError(tls, 73839)
  76726 __16:
  76727 	;
  76728 	subpage = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pRoot)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pRoot)).FhdrOffset)+8))
  76729 	(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID)
  76730 	rc = moveToChild(tls, pCur, subpage)
  76731 	goto __15
  76732 __14:
  76733 	(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID)
  76734 	rc = SQLITE_EMPTY
  76735 __15:
  76736 	;
  76737 __13:
  76738 	;
  76739 	return rc
  76740 }
  76741 
  76742 func moveToLeftmost(tls *libc.TLS, pCur uintptr) int32 {
  76743 	var pgno Pgno
  76744 	var rc int32 = SQLITE_OK
  76745 	var pPage uintptr
  76746 
  76747 	for rc == SQLITE_OK && !(int32((*MemPage)(unsafe.Pointer(libc.AssignUintptr(&pPage, (*BtCursor)(unsafe.Pointer(pCur)).FpPage))).Fleaf) != 0) {
  76748 		pgno = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*int32((*BtCursor)(unsafe.Pointer(pCur)).Fix))))))))
  76749 		rc = moveToChild(tls, pCur, pgno)
  76750 	}
  76751 	return rc
  76752 }
  76753 
  76754 func moveToRightmost(tls *libc.TLS, pCur uintptr) int32 {
  76755 	var pgno Pgno
  76756 	var rc int32 = SQLITE_OK
  76757 	var pPage uintptr = uintptr(0)
  76758 
  76759 	for !(int32((*MemPage)(unsafe.Pointer(libc.AssignUintptr(&pPage, (*BtCursor)(unsafe.Pointer(pCur)).FpPage))).Fleaf) != 0) {
  76760 		pgno = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+8))
  76761 		(*BtCursor)(unsafe.Pointer(pCur)).Fix = (*MemPage)(unsafe.Pointer(pPage)).FnCell
  76762 		rc = moveToChild(tls, pCur, pgno)
  76763 		if rc != 0 {
  76764 			return rc
  76765 		}
  76766 	}
  76767 	(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - 1)
  76768 
  76769 	return SQLITE_OK
  76770 }
  76771 
  76772 // Move the cursor to the first entry in the table.  Return SQLITE_OK
  76773 // on success.  Set *pRes to 0 if the cursor actually points to something
  76774 // or set *pRes to 1 if the table is empty.
  76775 func Xsqlite3BtreeFirst(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 {
  76776 	var rc int32
  76777 
  76778 	rc = moveToRoot(tls, pCur)
  76779 	if rc == SQLITE_OK {
  76780 		*(*int32)(unsafe.Pointer(pRes)) = 0
  76781 		rc = moveToLeftmost(tls, pCur)
  76782 	} else if rc == SQLITE_EMPTY {
  76783 		*(*int32)(unsafe.Pointer(pRes)) = 1
  76784 		rc = SQLITE_OK
  76785 	}
  76786 	return rc
  76787 }
  76788 
  76789 func btreeLast(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 {
  76790 	var rc int32 = moveToRoot(tls, pCur)
  76791 	if rc == SQLITE_OK {
  76792 		*(*int32)(unsafe.Pointer(pRes)) = 0
  76793 		rc = moveToRightmost(tls, pCur)
  76794 		if rc == SQLITE_OK {
  76795 			*(*U8)(unsafe.Pointer(pCur + 1)) |= U8(BTCF_AtLast)
  76796 		} else {
  76797 			*(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_AtLast))
  76798 		}
  76799 	} else if rc == SQLITE_EMPTY {
  76800 		*(*int32)(unsafe.Pointer(pRes)) = 1
  76801 		rc = SQLITE_OK
  76802 	}
  76803 	return rc
  76804 }
  76805 
  76806 func Xsqlite3BtreeLast(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 {
  76807 	if CURSOR_VALID == int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) && int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags)&BTCF_AtLast != 0 {
  76808 		*(*int32)(unsafe.Pointer(pRes)) = 0
  76809 		return SQLITE_OK
  76810 	}
  76811 	return btreeLast(tls, pCur, pRes)
  76812 }
  76813 
  76814 // Move the cursor so that it points to an entry in a table (a.k.a INTKEY)
  76815 // table near the key intKey.   Return a success code.
  76816 //
  76817 // If an exact match is not found, then the cursor is always
  76818 // left pointing at a leaf page which would hold the entry if it
  76819 // were present.  The cursor might point to an entry that comes
  76820 // before or after the key.
  76821 //
  76822 // An integer is written into *pRes which is the result of
  76823 // comparing the key with the entry to which the cursor is
  76824 // pointing.  The meaning of the integer written into
  76825 // *pRes is as follows:
  76826 //
  76827 //	*pRes<0      The cursor is left pointing at an entry that
  76828 //	             is smaller than intKey or if the table is empty
  76829 //	             and the cursor is therefore left point to nothing.
  76830 //
  76831 //	*pRes==0     The cursor is left pointing at an entry that
  76832 //	             exactly matches intKey.
  76833 //
  76834 //	*pRes>0      The cursor is left pointing at an entry that
  76835 //	             is larger than intKey.
  76836 func Xsqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey I64, biasRight int32, pRes uintptr) int32 {
  76837 	bp := tls.Alloc(8)
  76838 	defer tls.Free(8)
  76839 
  76840 	var rc int32
  76841 
  76842 	var lwr int32
  76843 	var upr int32
  76844 	var idx int32
  76845 	var c int32
  76846 	var chldPg Pgno
  76847 	var pPage uintptr
  76848 	var pCell uintptr
  76849 
  76850 	if !(int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID && int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags)&BTCF_ValidNKey != 0) {
  76851 		goto __1
  76852 	}
  76853 	if !((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey == intKey) {
  76854 		goto __2
  76855 	}
  76856 	*(*int32)(unsafe.Pointer(pRes)) = 0
  76857 	return SQLITE_OK
  76858 __2:
  76859 	;
  76860 	if !((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey < intKey) {
  76861 		goto __3
  76862 	}
  76863 	if !(int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags)&BTCF_AtLast != 0) {
  76864 		goto __4
  76865 	}
  76866 	*(*int32)(unsafe.Pointer(pRes)) = -1
  76867 	return SQLITE_OK
  76868 __4:
  76869 	;
  76870 	if !((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey+int64(1) == intKey) {
  76871 		goto __5
  76872 	}
  76873 	*(*int32)(unsafe.Pointer(pRes)) = 0
  76874 	rc = Xsqlite3BtreeNext(tls, pCur, 0)
  76875 	if !(rc == SQLITE_OK) {
  76876 		goto __6
  76877 	}
  76878 	getCellInfo(tls, pCur)
  76879 	if !((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey == intKey) {
  76880 		goto __8
  76881 	}
  76882 	return SQLITE_OK
  76883 __8:
  76884 	;
  76885 	goto __7
  76886 __6:
  76887 	if !(rc != SQLITE_DONE) {
  76888 		goto __9
  76889 	}
  76890 	return rc
  76891 __9:
  76892 	;
  76893 __7:
  76894 	;
  76895 __5:
  76896 	;
  76897 __3:
  76898 	;
  76899 __1:
  76900 	;
  76901 	rc = moveToRoot(tls, pCur)
  76902 	if !(rc != 0) {
  76903 		goto __10
  76904 	}
  76905 	if !(rc == SQLITE_EMPTY) {
  76906 		goto __11
  76907 	}
  76908 
  76909 	*(*int32)(unsafe.Pointer(pRes)) = -1
  76910 	return SQLITE_OK
  76911 __11:
  76912 	;
  76913 	return rc
  76914 __10:
  76915 	;
  76916 __12:
  76917 	pPage = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
  76918 
  76919 	lwr = 0
  76920 	upr = int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - 1
  76921 
  76922 	idx = upr >> (1 - biasRight)
  76923 __15:
  76924 	pCell = (*MemPage)(unsafe.Pointer(pPage)).FaDataOfst + uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*idx))))))
  76925 	if !((*MemPage)(unsafe.Pointer(pPage)).FintKeyLeaf != 0) {
  76926 		goto __18
  76927 	}
  76928 __19:
  76929 	if !(0x80 <= int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pCell, 1))))) {
  76930 		goto __20
  76931 	}
  76932 	if !(pCell >= (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd) {
  76933 		goto __21
  76934 	}
  76935 	return Xsqlite3CorruptError(tls, 74081)
  76936 __21:
  76937 	;
  76938 	goto __19
  76939 __20:
  76940 	;
  76941 __18:
  76942 	;
  76943 	Xsqlite3GetVarint(tls, pCell, bp)
  76944 	if !(*(*I64)(unsafe.Pointer(bp)) < intKey) {
  76945 		goto __22
  76946 	}
  76947 	lwr = idx + 1
  76948 	if !(lwr > upr) {
  76949 		goto __24
  76950 	}
  76951 	c = -1
  76952 	goto __17
  76953 __24:
  76954 	;
  76955 	goto __23
  76956 __22:
  76957 	if !(*(*I64)(unsafe.Pointer(bp)) > intKey) {
  76958 		goto __25
  76959 	}
  76960 	upr = idx - 1
  76961 	if !(lwr > upr) {
  76962 		goto __27
  76963 	}
  76964 	c = +1
  76965 	goto __17
  76966 __27:
  76967 	;
  76968 	goto __26
  76969 __25:
  76970 	;
  76971 	(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(idx)
  76972 	if !!(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) {
  76973 		goto __28
  76974 	}
  76975 	lwr = idx
  76976 	goto moveto_table_next_layer
  76977 	goto __29
  76978 __28:
  76979 	*(*U8)(unsafe.Pointer(pCur + 1)) |= U8(BTCF_ValidNKey)
  76980 	(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey = *(*I64)(unsafe.Pointer(bp))
  76981 	(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
  76982 	*(*int32)(unsafe.Pointer(pRes)) = 0
  76983 	return SQLITE_OK
  76984 __29:
  76985 	;
  76986 __26:
  76987 	;
  76988 __23:
  76989 	;
  76990 	idx = (lwr + upr) >> 1
  76991 	goto __16
  76992 __16:
  76993 	goto __15
  76994 	goto __17
  76995 __17:
  76996 	;
  76997 	if !((*MemPage)(unsafe.Pointer(pPage)).Fleaf != 0) {
  76998 		goto __30
  76999 	}
  77000 
  77001 	(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(idx)
  77002 	*(*int32)(unsafe.Pointer(pRes)) = c
  77003 	rc = SQLITE_OK
  77004 	goto moveto_table_finish
  77005 __30:
  77006 	;
  77007 moveto_table_next_layer:
  77008 	if !(lwr >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)) {
  77009 		goto __31
  77010 	}
  77011 	chldPg = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+8))
  77012 	goto __32
  77013 __31:
  77014 	chldPg = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*lwr)))))))
  77015 __32:
  77016 	;
  77017 	(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(lwr)
  77018 	rc = moveToChild(tls, pCur, chldPg)
  77019 	if !(rc != 0) {
  77020 		goto __33
  77021 	}
  77022 	goto __14
  77023 __33:
  77024 	;
  77025 	goto __13
  77026 __13:
  77027 	goto __12
  77028 	goto __14
  77029 __14:
  77030 	;
  77031 moveto_table_finish:
  77032 	(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
  77033 
  77034 	return rc
  77035 }
  77036 
  77037 func indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, xRecordCompare RecordCompare) int32 {
  77038 	var pPage uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
  77039 	var c int32
  77040 	var nCell int32
  77041 	var pCell uintptr = (*MemPage)(unsafe.Pointer(pPage)).FaDataOfst + uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*idx))))))
  77042 
  77043 	nCell = int32(*(*U8)(unsafe.Pointer(pCell)))
  77044 	if nCell <= int32((*MemPage)(unsafe.Pointer(pPage)).Fmax1bytePayload) {
  77045 		c = (*struct {
  77046 			f func(*libc.TLS, int32, uintptr, uintptr) int32
  77047 		})(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})).f(tls, nCell, pCell+1, pIdxKey)
  77048 	} else if !(int32(*(*U8)(unsafe.Pointer(pCell + 1)))&0x80 != 0) &&
  77049 		libc.AssignInt32(&nCell, nCell&0x7f<<7+int32(*(*U8)(unsafe.Pointer(pCell + 1)))) <= int32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal) {
  77050 		c = (*struct {
  77051 			f func(*libc.TLS, int32, uintptr, uintptr) int32
  77052 		})(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})).f(tls, nCell, pCell+2, pIdxKey)
  77053 	} else {
  77054 		c = 99
  77055 	}
  77056 	return c
  77057 }
  77058 
  77059 func cursorOnLastPage(tls *libc.TLS, pCur uintptr) int32 {
  77060 	var i int32
  77061 
  77062 	for i = 0; i < int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage); i++ {
  77063 		var pPage uintptr = *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr(i)*8))
  77064 		if int32(*(*U16)(unsafe.Pointer(pCur + 88 + uintptr(i)*2))) < int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) {
  77065 			return 0
  77066 		}
  77067 	}
  77068 	return 1
  77069 }
  77070 
  77071 // Move the cursor so that it points to an entry in an index table
  77072 // near the key pIdxKey.   Return a success code.
  77073 //
  77074 // If an exact match is not found, then the cursor is always
  77075 // left pointing at a leaf page which would hold the entry if it
  77076 // were present.  The cursor might point to an entry that comes
  77077 // before or after the key.
  77078 //
  77079 // An integer is written into *pRes which is the result of
  77080 // comparing the key with the entry to which the cursor is
  77081 // pointing.  The meaning of the integer written into
  77082 // *pRes is as follows:
  77083 //
  77084 //	*pRes<0      The cursor is left pointing at an entry that
  77085 //	             is smaller than pIdxKey or if the table is empty
  77086 //	             and the cursor is therefore left point to nothing.
  77087 //
  77088 //	*pRes==0     The cursor is left pointing at an entry that
  77089 //	             exactly matches pIdxKey.
  77090 //
  77091 //	*pRes>0      The cursor is left pointing at an entry that
  77092 //	             is larger than pIdxKey.
  77093 //
  77094 // The pIdxKey->eqSeen field is set to 1 if there
  77095 // exists an entry in the table that exactly matches pIdxKey.
  77096 func Xsqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes uintptr) int32 {
  77097 	var rc int32
  77098 	var xRecordCompare RecordCompare
  77099 	var c int32
  77100 
  77101 	var pCellKey uintptr
  77102 	var pCellBody uintptr
  77103 	var nOverrun int32
  77104 	var nCell int32
  77105 	var lwr int32
  77106 	var upr int32
  77107 	var idx int32
  77108 	var c1 int32
  77109 	var chldPg Pgno
  77110 	var pPage uintptr
  77111 	var pCell uintptr
  77112 
  77113 	xRecordCompare = Xsqlite3VdbeFindCompare(tls, pIdxKey)
  77114 	(*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode = U8(0)
  77115 
  77116 	if !(int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID &&
  77117 		(*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).Fleaf != 0 &&
  77118 		cursorOnLastPage(tls, pCur) != 0) {
  77119 		goto __1
  77120 	}
  77121 	if !(int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) == int32((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell)-1 &&
  77122 		libc.AssignInt32(&c, indexCellCompare(tls, pCur, int32((*BtCursor)(unsafe.Pointer(pCur)).Fix), pIdxKey, xRecordCompare)) <= 0 &&
  77123 		int32((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode) == SQLITE_OK) {
  77124 		goto __2
  77125 	}
  77126 	*(*int32)(unsafe.Pointer(pRes)) = c
  77127 	return SQLITE_OK
  77128 __2:
  77129 	;
  77130 	if !(int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) > 0 &&
  77131 		indexCellCompare(tls, pCur, 0, pIdxKey, xRecordCompare) <= 0 &&
  77132 		int32((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode) == SQLITE_OK) {
  77133 		goto __3
  77134 	}
  77135 	*(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_ValidOvfl))
  77136 	if !!(int32((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FisInit) != 0) {
  77137 		goto __4
  77138 	}
  77139 	return Xsqlite3CorruptError(tls, 74277)
  77140 __4:
  77141 	;
  77142 	goto bypass_moveto_root
  77143 __3:
  77144 	;
  77145 	(*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode = U8(SQLITE_OK)
  77146 __1:
  77147 	;
  77148 	rc = moveToRoot(tls, pCur)
  77149 	if !(rc != 0) {
  77150 		goto __5
  77151 	}
  77152 	if !(rc == SQLITE_EMPTY) {
  77153 		goto __6
  77154 	}
  77155 
  77156 	*(*int32)(unsafe.Pointer(pRes)) = -1
  77157 	return SQLITE_OK
  77158 __6:
  77159 	;
  77160 	return rc
  77161 __5:
  77162 	;
  77163 bypass_moveto_root:
  77164 	;
  77165 __7:
  77166 	pPage = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
  77167 
  77168 	lwr = 0
  77169 	upr = int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - 1
  77170 	idx = upr >> 1
  77171 __10:
  77172 	pCell = (*MemPage)(unsafe.Pointer(pPage)).FaDataOfst + uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*idx))))))
  77173 
  77174 	nCell = int32(*(*U8)(unsafe.Pointer(pCell)))
  77175 	if !(nCell <= int32((*MemPage)(unsafe.Pointer(pPage)).Fmax1bytePayload)) {
  77176 		goto __13
  77177 	}
  77178 
  77179 	c1 = (*struct {
  77180 		f func(*libc.TLS, int32, uintptr, uintptr) int32
  77181 	})(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})).f(tls, nCell, pCell+1, pIdxKey)
  77182 	goto __14
  77183 __13:
  77184 	if !(!(int32(*(*U8)(unsafe.Pointer(pCell + 1)))&0x80 != 0) &&
  77185 		libc.AssignInt32(&nCell, nCell&0x7f<<7+int32(*(*U8)(unsafe.Pointer(pCell + 1)))) <= int32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal)) {
  77186 		goto __15
  77187 	}
  77188 
  77189 	c1 = (*struct {
  77190 		f func(*libc.TLS, int32, uintptr, uintptr) int32
  77191 	})(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})).f(tls, nCell, pCell+2, pIdxKey)
  77192 	goto __16
  77193 __15:
  77194 	pCellBody = pCell - uintptr((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize)
  77195 	nOverrun = 18
  77196 	(*struct {
  77197 		f func(*libc.TLS, uintptr, uintptr, uintptr)
  77198 	})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxParseCell})).f(tls, pPage, pCellBody, pCur+48)
  77199 	nCell = int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey)
  77200 
  77201 	if !(nCell < 2 || U32(nCell)/(*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize > (*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage) {
  77202 		goto __17
  77203 	}
  77204 	rc = Xsqlite3CorruptError(tls, 74364)
  77205 	goto moveto_index_finish
  77206 __17:
  77207 	;
  77208 	pCellKey = Xsqlite3Malloc(tls, uint64(nCell+nOverrun))
  77209 	if !(pCellKey == uintptr(0)) {
  77210 		goto __18
  77211 	}
  77212 	rc = SQLITE_NOMEM
  77213 	goto moveto_index_finish
  77214 __18:
  77215 	;
  77216 	(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(idx)
  77217 	rc = accessPayload(tls, pCur, uint32(0), uint32(nCell), pCellKey, 0)
  77218 	libc.Xmemset(tls, pCellKey+uintptr(nCell), 0, uint64(nOverrun))
  77219 	*(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_ValidOvfl))
  77220 	if !(rc != 0) {
  77221 		goto __19
  77222 	}
  77223 	Xsqlite3_free(tls, pCellKey)
  77224 	goto moveto_index_finish
  77225 __19:
  77226 	;
  77227 	c1 = Xsqlite3VdbeRecordCompare(tls, nCell, pCellKey, pIdxKey)
  77228 	Xsqlite3_free(tls, pCellKey)
  77229 __16:
  77230 	;
  77231 __14:
  77232 	;
  77233 	if !(c1 < 0) {
  77234 		goto __20
  77235 	}
  77236 	lwr = idx + 1
  77237 	goto __21
  77238 __20:
  77239 	if !(c1 > 0) {
  77240 		goto __22
  77241 	}
  77242 	upr = idx - 1
  77243 	goto __23
  77244 __22:
  77245 	;
  77246 	*(*int32)(unsafe.Pointer(pRes)) = 0
  77247 	rc = SQLITE_OK
  77248 	(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(idx)
  77249 	if !((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode != 0) {
  77250 		goto __24
  77251 	}
  77252 	rc = Xsqlite3CorruptError(tls, 74396)
  77253 __24:
  77254 	;
  77255 	goto moveto_index_finish
  77256 __23:
  77257 	;
  77258 __21:
  77259 	;
  77260 	if !(lwr > upr) {
  77261 		goto __25
  77262 	}
  77263 	goto __12
  77264 __25:
  77265 	;
  77266 	idx = (lwr + upr) >> 1
  77267 	goto __11
  77268 __11:
  77269 	goto __10
  77270 	goto __12
  77271 __12:
  77272 	;
  77273 	if !((*MemPage)(unsafe.Pointer(pPage)).Fleaf != 0) {
  77274 		goto __26
  77275 	}
  77276 
  77277 	(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(idx)
  77278 	*(*int32)(unsafe.Pointer(pRes)) = c1
  77279 	rc = SQLITE_OK
  77280 	goto moveto_index_finish
  77281 __26:
  77282 	;
  77283 	if !(lwr >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)) {
  77284 		goto __27
  77285 	}
  77286 	chldPg = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+8))
  77287 	goto __28
  77288 __27:
  77289 	chldPg = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*lwr)))))))
  77290 __28:
  77291 	;
  77292 	(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(lwr)
  77293 	rc = moveToChild(tls, pCur, chldPg)
  77294 	if !(rc != 0) {
  77295 		goto __29
  77296 	}
  77297 	goto __9
  77298 __29:
  77299 	;
  77300 	goto __8
  77301 __8:
  77302 	goto __7
  77303 	goto __9
  77304 __9:
  77305 	;
  77306 moveto_index_finish:
  77307 	(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
  77308 
  77309 	return rc
  77310 }
  77311 
  77312 // Return TRUE if the cursor is not pointing at an entry of the table.
  77313 //
  77314 // TRUE will be returned after a call to sqlite3BtreeNext() moves
  77315 // past the last entry in the table or sqlite3BtreePrev() moves past
  77316 // the first entry.  TRUE is also returned if the table is empty.
  77317 func Xsqlite3BtreeEof(tls *libc.TLS, pCur uintptr) int32 {
  77318 	return libc.Bool32(CURSOR_VALID != int32((*BtCursor)(unsafe.Pointer(pCur)).FeState))
  77319 }
  77320 
  77321 // Return an estimate for the number of rows in the table that pCur is
  77322 // pointing to.  Return a negative number if no estimate is currently
  77323 // available.
  77324 func Xsqlite3BtreeRowCountEst(tls *libc.TLS, pCur uintptr) I64 {
  77325 	var n I64
  77326 	var i U8
  77327 
  77328 	if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID {
  77329 		return int64(-1)
  77330 	}
  77331 	if int32((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).Fleaf) == 0 {
  77332 		return int64(-1)
  77333 	}
  77334 
  77335 	n = I64((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell)
  77336 	for i = U8(0); int32(i) < int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage); i++ {
  77337 		n = n * I64((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr(i)*8)))).FnCell)
  77338 	}
  77339 	return n
  77340 }
  77341 
  77342 func btreeNext(tls *libc.TLS, pCur uintptr) int32 {
  77343 	var rc int32
  77344 	var idx int32
  77345 	var pPage uintptr
  77346 
  77347 	if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID {
  77348 		rc = func() int32 {
  77349 			if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) >= CURSOR_REQUIRESEEK {
  77350 				return btreeRestoreCursorPosition(tls, pCur)
  77351 			}
  77352 			return SQLITE_OK
  77353 		}()
  77354 		if rc != SQLITE_OK {
  77355 			return rc
  77356 		}
  77357 		if CURSOR_INVALID == int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) {
  77358 			return SQLITE_DONE
  77359 		}
  77360 		if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_SKIPNEXT {
  77361 			(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID)
  77362 			if (*BtCursor)(unsafe.Pointer(pCur)).FskipNext > 0 {
  77363 				return SQLITE_OK
  77364 			}
  77365 		}
  77366 	}
  77367 
  77368 	pPage = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
  77369 	idx = int32(libc.PreIncUint16(&(*BtCursor)(unsafe.Pointer(pCur)).Fix, 1))
  77370 	if !(int32((*MemPage)(unsafe.Pointer(pPage)).FisInit) != 0) || Xsqlite3FaultSim(tls, 412) != 0 {
  77371 		return Xsqlite3CorruptError(tls, 74512)
  77372 	}
  77373 
  77374 	if idx >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) {
  77375 		if !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) {
  77376 			rc = moveToChild(tls, pCur, Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+8)))
  77377 			if rc != 0 {
  77378 				return rc
  77379 			}
  77380 			return moveToLeftmost(tls, pCur)
  77381 		}
  77382 		for __ccgo := true; __ccgo; __ccgo = int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) {
  77383 			if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) == 0 {
  77384 				(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID)
  77385 				return SQLITE_DONE
  77386 			}
  77387 			moveToParent(tls, pCur)
  77388 			pPage = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
  77389 		}
  77390 		if (*MemPage)(unsafe.Pointer(pPage)).FintKey != 0 {
  77391 			return Xsqlite3BtreeNext(tls, pCur, 0)
  77392 		} else {
  77393 			return SQLITE_OK
  77394 		}
  77395 	}
  77396 	if (*MemPage)(unsafe.Pointer(pPage)).Fleaf != 0 {
  77397 		return SQLITE_OK
  77398 	} else {
  77399 		return moveToLeftmost(tls, pCur)
  77400 	}
  77401 	return int32(0)
  77402 }
  77403 
  77404 func Xsqlite3BtreeNext(tls *libc.TLS, pCur uintptr, flags int32) int32 {
  77405 	var pPage uintptr
  77406 	_ = flags
  77407 
  77408 	(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
  77409 	*(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_ValidNKey | BTCF_ValidOvfl))
  77410 	if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID {
  77411 		return btreeNext(tls, pCur)
  77412 	}
  77413 	pPage = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
  77414 	if int32(libc.PreIncUint16(&(*BtCursor)(unsafe.Pointer(pCur)).Fix, 1)) >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) {
  77415 		(*BtCursor)(unsafe.Pointer(pCur)).Fix--
  77416 		return btreeNext(tls, pCur)
  77417 	}
  77418 	if (*MemPage)(unsafe.Pointer(pPage)).Fleaf != 0 {
  77419 		return SQLITE_OK
  77420 	} else {
  77421 		return moveToLeftmost(tls, pCur)
  77422 	}
  77423 	return int32(0)
  77424 }
  77425 
  77426 func btreePrevious(tls *libc.TLS, pCur uintptr) int32 {
  77427 	var rc int32
  77428 	var pPage uintptr
  77429 
  77430 	if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID {
  77431 		rc = func() int32 {
  77432 			if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) >= CURSOR_REQUIRESEEK {
  77433 				return btreeRestoreCursorPosition(tls, pCur)
  77434 			}
  77435 			return SQLITE_OK
  77436 		}()
  77437 		if rc != SQLITE_OK {
  77438 			return rc
  77439 		}
  77440 		if CURSOR_INVALID == int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) {
  77441 			return SQLITE_DONE
  77442 		}
  77443 		if CURSOR_SKIPNEXT == int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) {
  77444 			(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID)
  77445 			if (*BtCursor)(unsafe.Pointer(pCur)).FskipNext < 0 {
  77446 				return SQLITE_OK
  77447 			}
  77448 		}
  77449 	}
  77450 
  77451 	pPage = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
  77452 
  77453 	if !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) {
  77454 		var idx int32 = int32((*BtCursor)(unsafe.Pointer(pCur)).Fix)
  77455 		rc = moveToChild(tls, pCur, Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*idx))))))))
  77456 		if rc != 0 {
  77457 			return rc
  77458 		}
  77459 		rc = moveToRightmost(tls, pCur)
  77460 	} else {
  77461 		for int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) == 0 {
  77462 			if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) == 0 {
  77463 				(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID)
  77464 				return SQLITE_DONE
  77465 			}
  77466 			moveToParent(tls, pCur)
  77467 		}
  77468 
  77469 		(*BtCursor)(unsafe.Pointer(pCur)).Fix--
  77470 		pPage = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
  77471 		if (*MemPage)(unsafe.Pointer(pPage)).FintKey != 0 && !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) {
  77472 			rc = Xsqlite3BtreePrevious(tls, pCur, 0)
  77473 		} else {
  77474 			rc = SQLITE_OK
  77475 		}
  77476 	}
  77477 	return rc
  77478 }
  77479 
  77480 func Xsqlite3BtreePrevious(tls *libc.TLS, pCur uintptr, flags int32) int32 {
  77481 	_ = flags
  77482 	*(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_AtLast | BTCF_ValidOvfl | BTCF_ValidNKey))
  77483 	(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
  77484 	if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID ||
  77485 		int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) == 0 ||
  77486 		int32((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).Fleaf) == 0 {
  77487 		return btreePrevious(tls, pCur)
  77488 	}
  77489 	(*BtCursor)(unsafe.Pointer(pCur)).Fix--
  77490 	return SQLITE_OK
  77491 }
  77492 
  77493 func allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintptr, nearby Pgno, eMode U8) int32 {
  77494 	bp := tls.Alloc(32)
  77495 	defer tls.Free(32)
  77496 
  77497 	var pPage1 uintptr
  77498 	var rc int32
  77499 	var n U32
  77500 	var k U32
  77501 
  77502 	var pPrevTrunk uintptr
  77503 	var mxPage Pgno
  77504 
  77505 	var iNewTrunk Pgno
  77506 	var d2 int32
  77507 	var dist int32
  77508 	var i U32
  77509 	var noContent int32
  77510 
  77511 	var closest U32
  77512 	var iPage Pgno
  77513 	var aData uintptr
  77514 
  77515 	var iTrunk Pgno
  77516 	var searchList U8
  77517 	var nSearch U32
  77518 
  77519 	var bNoContent int32
  77520 	*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
  77521 	pPrevTrunk = uintptr(0)
  77522 
  77523 	pPage1 = (*BtShared)(unsafe.Pointer(pBt)).FpPage1
  77524 	mxPage = btreePagecount(tls, pBt)
  77525 
  77526 	n = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+36)
  77527 
  77528 	if !(n >= mxPage) {
  77529 		goto __1
  77530 	}
  77531 	return Xsqlite3CorruptError(tls, 74692)
  77532 __1:
  77533 	;
  77534 	if !(n > U32(0)) {
  77535 		goto __2
  77536 	}
  77537 	searchList = U8(0)
  77538 	nSearch = U32(0)
  77539 
  77540 	if !(int32(eMode) == BTALLOC_EXACT) {
  77541 		goto __4
  77542 	}
  77543 	if !(nearby <= mxPage) {
  77544 		goto __6
  77545 	}
  77546 
  77547 	rc = ptrmapGet(tls, pBt, nearby, bp, uintptr(0))
  77548 	if !(rc != 0) {
  77549 		goto __7
  77550 	}
  77551 	return rc
  77552 __7:
  77553 	;
  77554 	if !(int32(*(*U8)(unsafe.Pointer(bp))) == PTRMAP_FREEPAGE) {
  77555 		goto __8
  77556 	}
  77557 	searchList = U8(1)
  77558 __8:
  77559 	;
  77560 __6:
  77561 	;
  77562 	goto __5
  77563 __4:
  77564 	if !(int32(eMode) == BTALLOC_LE) {
  77565 		goto __9
  77566 	}
  77567 	searchList = U8(1)
  77568 __9:
  77569 	;
  77570 __5:
  77571 	;
  77572 	rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPage1)).FpDbPage)
  77573 	if !(rc != 0) {
  77574 		goto __10
  77575 	}
  77576 	return rc
  77577 __10:
  77578 	;
  77579 	Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+36, n-U32(1))
  77580 
  77581 __11:
  77582 	pPrevTrunk = *(*uintptr)(unsafe.Pointer(bp + 8))
  77583 	if !(pPrevTrunk != 0) {
  77584 		goto __14
  77585 	}
  77586 
  77587 	iTrunk = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPrevTrunk)).FaData)
  77588 	goto __15
  77589 __14:
  77590 	iTrunk = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+32)
  77591 __15:
  77592 	;
  77593 	if !(iTrunk > mxPage || libc.PostIncUint32(&nSearch, 1) > n) {
  77594 		goto __16
  77595 	}
  77596 	rc = Xsqlite3CorruptError(tls, 74748)
  77597 	goto __17
  77598 __16:
  77599 	rc = btreeGetUnusedPage(tls, pBt, iTrunk, bp+8, 0)
  77600 __17:
  77601 	;
  77602 	if !(rc != 0) {
  77603 		goto __18
  77604 	}
  77605 	*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
  77606 	goto end_allocate_page
  77607 __18:
  77608 	;
  77609 	k = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData+4)
  77610 	if !(k == U32(0) && !(searchList != 0)) {
  77611 		goto __19
  77612 	}
  77613 
  77614 	rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FpDbPage)
  77615 	if !(rc != 0) {
  77616 		goto __21
  77617 	}
  77618 	goto end_allocate_page
  77619 __21:
  77620 	;
  77621 	*(*Pgno)(unsafe.Pointer(pPgno)) = iTrunk
  77622 	libc.Xmemcpy(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+32, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData, uint64(4))
  77623 	*(*uintptr)(unsafe.Pointer(ppPage)) = *(*uintptr)(unsafe.Pointer(bp + 8))
  77624 	*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
  77625 
  77626 	goto __20
  77627 __19:
  77628 	if !(k > (*BtShared)(unsafe.Pointer(pBt)).FusableSize/U32(4)-U32(2)) {
  77629 		goto __22
  77630 	}
  77631 
  77632 	rc = Xsqlite3CorruptError(tls, 74777)
  77633 	goto end_allocate_page
  77634 	goto __23
  77635 __22:
  77636 	if !(searchList != 0 &&
  77637 		(nearby == iTrunk || iTrunk < nearby && int32(eMode) == BTALLOC_LE)) {
  77638 		goto __24
  77639 	}
  77640 
  77641 	*(*Pgno)(unsafe.Pointer(pPgno)) = iTrunk
  77642 	*(*uintptr)(unsafe.Pointer(ppPage)) = *(*uintptr)(unsafe.Pointer(bp + 8))
  77643 	searchList = U8(0)
  77644 	rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FpDbPage)
  77645 	if !(rc != 0) {
  77646 		goto __26
  77647 	}
  77648 	goto end_allocate_page
  77649 __26:
  77650 	;
  77651 	if !(k == U32(0)) {
  77652 		goto __27
  77653 	}
  77654 	if !!(pPrevTrunk != 0) {
  77655 		goto __29
  77656 	}
  77657 	libc.Xmemcpy(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+32, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData, uint64(4))
  77658 	goto __30
  77659 __29:
  77660 	rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPrevTrunk)).FpDbPage)
  77661 	if !(rc != SQLITE_OK) {
  77662 		goto __31
  77663 	}
  77664 	goto end_allocate_page
  77665 __31:
  77666 	;
  77667 	libc.Xmemcpy(tls, (*MemPage)(unsafe.Pointer(pPrevTrunk)).FaData, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData, uint64(4))
  77668 __30:
  77669 	;
  77670 	goto __28
  77671 __27:
  77672 	iNewTrunk = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData+8)
  77673 	if !(iNewTrunk > mxPage) {
  77674 		goto __32
  77675 	}
  77676 	rc = Xsqlite3CorruptError(tls, 74811)
  77677 	goto end_allocate_page
  77678 __32:
  77679 	;
  77680 	rc = btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0)
  77681 	if !(rc != SQLITE_OK) {
  77682 		goto __33
  77683 	}
  77684 	goto end_allocate_page
  77685 __33:
  77686 	;
  77687 	rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FpDbPage)
  77688 	if !(rc != SQLITE_OK) {
  77689 		goto __34
  77690 	}
  77691 	releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
  77692 	goto end_allocate_page
  77693 __34:
  77694 	;
  77695 	libc.Xmemcpy(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FaData, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData, uint64(4))
  77696 	Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FaData+4, k-U32(1))
  77697 	libc.Xmemcpy(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FaData+8, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData+12, uint64((k-U32(1))*U32(4)))
  77698 	releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
  77699 	if !!(pPrevTrunk != 0) {
  77700 		goto __35
  77701 	}
  77702 
  77703 	Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+32, iNewTrunk)
  77704 	goto __36
  77705 __35:
  77706 	rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPrevTrunk)).FpDbPage)
  77707 	if !(rc != 0) {
  77708 		goto __37
  77709 	}
  77710 	goto end_allocate_page
  77711 __37:
  77712 	;
  77713 	Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(pPrevTrunk)).FaData, iNewTrunk)
  77714 __36:
  77715 	;
  77716 __28:
  77717 	;
  77718 	*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
  77719 
  77720 	goto __25
  77721 __24:
  77722 	if !(k > U32(0)) {
  77723 		goto __38
  77724 	}
  77725 	aData = (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData
  77726 	if !(nearby > Pgno(0)) {
  77727 		goto __39
  77728 	}
  77729 	closest = U32(0)
  77730 	if !(int32(eMode) == BTALLOC_LE) {
  77731 		goto __41
  77732 	}
  77733 	i = U32(0)
  77734 __43:
  77735 	if !(i < k) {
  77736 		goto __45
  77737 	}
  77738 	iPage = Xsqlite3Get4byte(tls, aData+uintptr(U32(8)+i*U32(4)))
  77739 	if !(iPage <= nearby) {
  77740 		goto __46
  77741 	}
  77742 	closest = i
  77743 	goto __45
  77744 __46:
  77745 	;
  77746 	goto __44
  77747 __44:
  77748 	i++
  77749 	goto __43
  77750 	goto __45
  77751 __45:
  77752 	;
  77753 	goto __42
  77754 __41:
  77755 	dist = Xsqlite3AbsInt32(tls, int32(Xsqlite3Get4byte(tls, aData+8)-nearby))
  77756 	i = U32(1)
  77757 __47:
  77758 	if !(i < k) {
  77759 		goto __49
  77760 	}
  77761 	d2 = Xsqlite3AbsInt32(tls, int32(Xsqlite3Get4byte(tls, aData+uintptr(U32(8)+i*U32(4)))-nearby))
  77762 	if !(d2 < dist) {
  77763 		goto __50
  77764 	}
  77765 	closest = i
  77766 	dist = d2
  77767 __50:
  77768 	;
  77769 	goto __48
  77770 __48:
  77771 	i++
  77772 	goto __47
  77773 	goto __49
  77774 __49:
  77775 	;
  77776 __42:
  77777 	;
  77778 	goto __40
  77779 __39:
  77780 	closest = U32(0)
  77781 __40:
  77782 	;
  77783 	iPage = Xsqlite3Get4byte(tls, aData+uintptr(U32(8)+closest*U32(4)))
  77784 
  77785 	if !(iPage > mxPage || iPage < Pgno(2)) {
  77786 		goto __51
  77787 	}
  77788 	rc = Xsqlite3CorruptError(tls, 74876)
  77789 	goto end_allocate_page
  77790 __51:
  77791 	;
  77792 	if !(!(searchList != 0) ||
  77793 		(iPage == nearby || iPage < nearby && int32(eMode) == BTALLOC_LE)) {
  77794 		goto __52
  77795 	}
  77796 	*(*Pgno)(unsafe.Pointer(pPgno)) = iPage
  77797 
  77798 	rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FpDbPage)
  77799 	if !(rc != 0) {
  77800 		goto __53
  77801 	}
  77802 	goto end_allocate_page
  77803 __53:
  77804 	;
  77805 	if !(closest < k-U32(1)) {
  77806 		goto __54
  77807 	}
  77808 	libc.Xmemcpy(tls, aData+uintptr(U32(8)+closest*U32(4)), aData+uintptr(U32(4)+k*U32(4)), uint64(4))
  77809 __54:
  77810 	;
  77811 	Xsqlite3Put4byte(tls, aData+4, k-U32(1))
  77812 	if !(btreeGetHasContent(tls, pBt, *(*Pgno)(unsafe.Pointer(pPgno))) != 0) {
  77813 		noContent = PAGER_GET_NOCONTENT
  77814 	} else {
  77815 		noContent = 0
  77816 	}
  77817 	rc = btreeGetUnusedPage(tls, pBt, *(*Pgno)(unsafe.Pointer(pPgno)), ppPage, noContent)
  77818 	if !(rc == SQLITE_OK) {
  77819 		goto __55
  77820 	}
  77821 	rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FpDbPage)
  77822 	if !(rc != SQLITE_OK) {
  77823 		goto __56
  77824 	}
  77825 	releasePage(tls, *(*uintptr)(unsafe.Pointer(ppPage)))
  77826 	*(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0)
  77827 __56:
  77828 	;
  77829 __55:
  77830 	;
  77831 	searchList = U8(0)
  77832 __52:
  77833 	;
  77834 __38:
  77835 	;
  77836 __25:
  77837 	;
  77838 __23:
  77839 	;
  77840 __20:
  77841 	;
  77842 	releasePage(tls, pPrevTrunk)
  77843 	pPrevTrunk = uintptr(0)
  77844 	goto __12
  77845 __12:
  77846 	if searchList != 0 {
  77847 		goto __11
  77848 	}
  77849 	goto __13
  77850 __13:
  77851 	;
  77852 	goto __3
  77853 __2:
  77854 	if 0 == int32((*BtShared)(unsafe.Pointer(pBt)).FbDoTruncate) {
  77855 		bNoContent = PAGER_GET_NOCONTENT
  77856 	} else {
  77857 		bNoContent = 0
  77858 	}
  77859 
  77860 	rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FpDbPage)
  77861 	if !(rc != 0) {
  77862 		goto __57
  77863 	}
  77864 	return rc
  77865 __57:
  77866 	;
  77867 	(*BtShared)(unsafe.Pointer(pBt)).FnPage++
  77868 	if !((*BtShared)(unsafe.Pointer(pBt)).FnPage == U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1)) {
  77869 		goto __58
  77870 	}
  77871 	(*BtShared)(unsafe.Pointer(pBt)).FnPage++
  77872 __58:
  77873 	;
  77874 	if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 && ptrmapPageno(tls, pBt, (*BtShared)(unsafe.Pointer(pBt)).FnPage) == (*BtShared)(unsafe.Pointer(pBt)).FnPage) {
  77875 		goto __59
  77876 	}
  77877 
  77878 	*(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0)
  77879 
  77880 	rc = btreeGetUnusedPage(tls, pBt, (*BtShared)(unsafe.Pointer(pBt)).FnPage, bp+24, bNoContent)
  77881 	if !(rc == SQLITE_OK) {
  77882 		goto __60
  77883 	}
  77884 	rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FpDbPage)
  77885 	releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 24)))
  77886 __60:
  77887 	;
  77888 	if !(rc != 0) {
  77889 		goto __61
  77890 	}
  77891 	return rc
  77892 __61:
  77893 	;
  77894 	(*BtShared)(unsafe.Pointer(pBt)).FnPage++
  77895 	if !((*BtShared)(unsafe.Pointer(pBt)).FnPage == U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1)) {
  77896 		goto __62
  77897 	}
  77898 	(*BtShared)(unsafe.Pointer(pBt)).FnPage++
  77899 __62:
  77900 	;
  77901 __59:
  77902 	;
  77903 	Xsqlite3Put4byte(tls, uintptr(28)+(*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData, (*BtShared)(unsafe.Pointer(pBt)).FnPage)
  77904 	*(*Pgno)(unsafe.Pointer(pPgno)) = (*BtShared)(unsafe.Pointer(pBt)).FnPage
  77905 
  77906 	rc = btreeGetUnusedPage(tls, pBt, *(*Pgno)(unsafe.Pointer(pPgno)), ppPage, bNoContent)
  77907 	if !(rc != 0) {
  77908 		goto __63
  77909 	}
  77910 	return rc
  77911 __63:
  77912 	;
  77913 	rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FpDbPage)
  77914 	if !(rc != SQLITE_OK) {
  77915 		goto __64
  77916 	}
  77917 	releasePage(tls, *(*uintptr)(unsafe.Pointer(ppPage)))
  77918 	*(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0)
  77919 __64:
  77920 	;
  77921 __3:
  77922 	;
  77923 end_allocate_page:
  77924 	releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
  77925 	releasePage(tls, pPrevTrunk)
  77926 
  77927 	return rc
  77928 }
  77929 
  77930 func freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage Pgno) int32 {
  77931 	bp := tls.Alloc(24)
  77932 	defer tls.Free(24)
  77933 
  77934 	var iTrunk Pgno
  77935 	var pPage1 uintptr
  77936 
  77937 	var nFree U32
  77938 	var nLeaf U32
  77939 	*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
  77940 	iTrunk = Pgno(0)
  77941 	pPage1 = (*BtShared)(unsafe.Pointer(pBt)).FpPage1
  77942 
  77943 	if !(iPage < Pgno(2) || iPage > (*BtShared)(unsafe.Pointer(pBt)).FnPage) {
  77944 		goto __1
  77945 	}
  77946 	return Xsqlite3CorruptError(tls, 75003)
  77947 __1:
  77948 	;
  77949 	if !(pMemPage != 0) {
  77950 		goto __2
  77951 	}
  77952 	*(*uintptr)(unsafe.Pointer(bp)) = pMemPage
  77953 	Xsqlite3PagerRef(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage)
  77954 	goto __3
  77955 __2:
  77956 	*(*uintptr)(unsafe.Pointer(bp)) = btreePageLookup(tls, pBt, iPage)
  77957 __3:
  77958 	;
  77959 	*(*int32)(unsafe.Pointer(bp + 8)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPage1)).FpDbPage)
  77960 	if !(*(*int32)(unsafe.Pointer(bp + 8)) != 0) {
  77961 		goto __4
  77962 	}
  77963 	goto freepage_out
  77964 __4:
  77965 	;
  77966 	nFree = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+36)
  77967 	Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+36, nFree+U32(1))
  77968 
  77969 	if !(int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_SECURE_DELETE != 0) {
  77970 		goto __5
  77971 	}
  77972 
  77973 	if !(!(*(*uintptr)(unsafe.Pointer(bp)) != 0) && libc.AssignPtrInt32(bp+8, btreeGetPage(tls, pBt, iPage, bp, 0)) != 0 ||
  77974 		libc.AssignPtrInt32(bp+8, Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage)) != 0) {
  77975 		goto __6
  77976 	}
  77977 	goto freepage_out
  77978 __6:
  77979 	;
  77980 	libc.Xmemset(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData, 0, uint64((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpBt)).FpageSize))
  77981 __5:
  77982 	;
  77983 	if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) {
  77984 		goto __7
  77985 	}
  77986 	ptrmapPut(tls, pBt, iPage, uint8(PTRMAP_FREEPAGE), uint32(0), bp+8)
  77987 	if !(*(*int32)(unsafe.Pointer(bp + 8)) != 0) {
  77988 		goto __8
  77989 	}
  77990 	goto freepage_out
  77991 __8:
  77992 	;
  77993 __7:
  77994 	;
  77995 	if !(nFree != U32(0)) {
  77996 		goto __9
  77997 	}
  77998 
  77999 	iTrunk = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+32)
  78000 	if !(iTrunk > btreePagecount(tls, pBt)) {
  78001 		goto __10
  78002 	}
  78003 	*(*int32)(unsafe.Pointer(bp + 8)) = Xsqlite3CorruptError(tls, 75050)
  78004 	goto freepage_out
  78005 __10:
  78006 	;
  78007 	*(*int32)(unsafe.Pointer(bp + 8)) = btreeGetPage(tls, pBt, iTrunk, bp+16, 0)
  78008 	if !(*(*int32)(unsafe.Pointer(bp + 8)) != SQLITE_OK) {
  78009 		goto __11
  78010 	}
  78011 	goto freepage_out
  78012 __11:
  78013 	;
  78014 	nLeaf = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FaData+4)
  78015 
  78016 	if !(nLeaf > (*BtShared)(unsafe.Pointer(pBt)).FusableSize/U32(4)-U32(2)) {
  78017 		goto __12
  78018 	}
  78019 	*(*int32)(unsafe.Pointer(bp + 8)) = Xsqlite3CorruptError(tls, 75061)
  78020 	goto freepage_out
  78021 __12:
  78022 	;
  78023 	if !(nLeaf < (*BtShared)(unsafe.Pointer(pBt)).FusableSize/U32(4)-U32(8)) {
  78024 		goto __13
  78025 	}
  78026 
  78027 	*(*int32)(unsafe.Pointer(bp + 8)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FpDbPage)
  78028 	if !(*(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK) {
  78029 		goto __14
  78030 	}
  78031 	Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FaData+4, nLeaf+U32(1))
  78032 	Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FaData+uintptr(U32(8)+nLeaf*U32(4)), iPage)
  78033 	if !(*(*uintptr)(unsafe.Pointer(bp)) != 0 && int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_SECURE_DELETE == 0) {
  78034 		goto __15
  78035 	}
  78036 	Xsqlite3PagerDontWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage)
  78037 __15:
  78038 	;
  78039 	*(*int32)(unsafe.Pointer(bp + 8)) = btreeSetHasContent(tls, pBt, iPage)
  78040 __14:
  78041 	;
  78042 	goto freepage_out
  78043 __13:
  78044 	;
  78045 __9:
  78046 	;
  78047 	if !(*(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) && SQLITE_OK != libc.AssignPtrInt32(bp+8, btreeGetPage(tls, pBt, iPage, bp, 0))) {
  78048 		goto __16
  78049 	}
  78050 	goto freepage_out
  78051 __16:
  78052 	;
  78053 	*(*int32)(unsafe.Pointer(bp + 8)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage)
  78054 	if !(*(*int32)(unsafe.Pointer(bp + 8)) != SQLITE_OK) {
  78055 		goto __17
  78056 	}
  78057 	goto freepage_out
  78058 __17:
  78059 	;
  78060 	Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData, iTrunk)
  78061 	Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+4, uint32(0))
  78062 	Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(pPage1)).FaData+32, iPage)
  78063 
  78064 freepage_out:
  78065 	if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) {
  78066 		goto __18
  78067 	}
  78068 	(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FisInit = U8(0)
  78069 __18:
  78070 	;
  78071 	releasePage(tls, *(*uintptr)(unsafe.Pointer(bp)))
  78072 	releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
  78073 	return *(*int32)(unsafe.Pointer(bp + 8))
  78074 }
  78075 
  78076 func freePage(tls *libc.TLS, pPage uintptr, pRC uintptr) {
  78077 	if *(*int32)(unsafe.Pointer(pRC)) == SQLITE_OK {
  78078 		*(*int32)(unsafe.Pointer(pRC)) = freePage2(tls, (*MemPage)(unsafe.Pointer(pPage)).FpBt, pPage, (*MemPage)(unsafe.Pointer(pPage)).Fpgno)
  78079 	}
  78080 }
  78081 
  78082 func clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) int32 {
  78083 	bp := tls.Alloc(12)
  78084 	defer tls.Free(12)
  78085 
  78086 	var pBt uintptr
  78087 	var ovflPgno Pgno
  78088 	var rc int32
  78089 	var nOvfl int32
  78090 	var ovflPageSize U32
  78091 
  78092 	if pCell+uintptr((*CellInfo)(unsafe.Pointer(pInfo)).FnSize) > (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd {
  78093 		return Xsqlite3CorruptError(tls, 75150)
  78094 	}
  78095 	ovflPgno = Xsqlite3Get4byte(tls, pCell+uintptr((*CellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4))
  78096 	pBt = (*MemPage)(unsafe.Pointer(pPage)).FpBt
  78097 
  78098 	ovflPageSize = (*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(4)
  78099 	nOvfl = int32(((*CellInfo)(unsafe.Pointer(pInfo)).FnPayload - U32((*CellInfo)(unsafe.Pointer(pInfo)).FnLocal) + ovflPageSize - U32(1)) / ovflPageSize)
  78100 
  78101 	for libc.PostDecInt32(&nOvfl, 1) != 0 {
  78102 		*(*Pgno)(unsafe.Pointer(bp + 8)) = Pgno(0)
  78103 		*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
  78104 		if ovflPgno < Pgno(2) || ovflPgno > btreePagecount(tls, pBt) {
  78105 			return Xsqlite3CorruptError(tls, 75167)
  78106 		}
  78107 		if nOvfl != 0 {
  78108 			rc = getOverflowPage(tls, pBt, ovflPgno, bp, bp+8)
  78109 			if rc != 0 {
  78110 				return rc
  78111 			}
  78112 		}
  78113 
  78114 		if (*(*uintptr)(unsafe.Pointer(bp)) != 0 || libc.AssignPtrUintptr(bp, btreePageLookup(tls, pBt, ovflPgno)) != uintptr(0)) &&
  78115 			Xsqlite3PagerPageRefcount(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != 1 {
  78116 			rc = Xsqlite3CorruptError(tls, 75187)
  78117 		} else {
  78118 			rc = freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp)), ovflPgno)
  78119 		}
  78120 
  78121 		if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
  78122 			Xsqlite3PagerUnref(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage)
  78123 		}
  78124 		if rc != 0 {
  78125 			return rc
  78126 		}
  78127 		ovflPgno = *(*Pgno)(unsafe.Pointer(bp + 8))
  78128 	}
  78129 	return SQLITE_OK
  78130 }
  78131 
  78132 func fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize uintptr) int32 {
  78133 	bp := tls.Alloc(16)
  78134 	defer tls.Free(16)
  78135 
  78136 	var nPayload int32
  78137 	var pSrc uintptr
  78138 	var nSrc int32
  78139 	var n int32
  78140 
  78141 	var mn int32
  78142 	var spaceLeft int32
  78143 	var pToRelease uintptr
  78144 	var pPrior uintptr
  78145 	var pPayload uintptr
  78146 	var pBt uintptr
  78147 
  78148 	var nHeader int32
  78149 
  78150 	nHeader = int32((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize)
  78151 	if (*MemPage)(unsafe.Pointer(pPage)).FintKey != 0 {
  78152 		nPayload = (*BtreePayload)(unsafe.Pointer(pX)).FnData + (*BtreePayload)(unsafe.Pointer(pX)).FnZero
  78153 		pSrc = (*BtreePayload)(unsafe.Pointer(pX)).FpData
  78154 		nSrc = (*BtreePayload)(unsafe.Pointer(pX)).FnData
  78155 
  78156 		nHeader = nHeader + int32(func() uint8 {
  78157 			if U32(nPayload) < U32(0x80) {
  78158 				return uint8(func() int32 { *(*uint8)(unsafe.Pointer(pCell + uintptr(nHeader))) = uint8(nPayload); return 1 }())
  78159 			}
  78160 			return uint8(Xsqlite3PutVarint(tls, pCell+uintptr(nHeader), uint64(nPayload)))
  78161 		}())
  78162 		nHeader = nHeader + Xsqlite3PutVarint(tls, pCell+uintptr(nHeader), *(*U64)(unsafe.Pointer(pX + 8)))
  78163 	} else {
  78164 		nSrc = libc.AssignInt32(&nPayload, int32((*BtreePayload)(unsafe.Pointer(pX)).FnKey))
  78165 		pSrc = (*BtreePayload)(unsafe.Pointer(pX)).FpKey
  78166 		nHeader = nHeader + int32(func() uint8 {
  78167 			if U32(nPayload) < U32(0x80) {
  78168 				return uint8(func() int32 { *(*uint8)(unsafe.Pointer(pCell + uintptr(nHeader))) = uint8(nPayload); return 1 }())
  78169 			}
  78170 			return uint8(Xsqlite3PutVarint(tls, pCell+uintptr(nHeader), uint64(nPayload)))
  78171 		}())
  78172 	}
  78173 
  78174 	pPayload = pCell + uintptr(nHeader)
  78175 	if nPayload <= int32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal) {
  78176 		n = nHeader + nPayload
  78177 
  78178 		if n < 4 {
  78179 			n = 4
  78180 		}
  78181 		*(*int32)(unsafe.Pointer(pnSize)) = n
  78182 
  78183 		libc.Xmemcpy(tls, pPayload, pSrc, uint64(nSrc))
  78184 		libc.Xmemset(tls, pPayload+uintptr(nSrc), 0, uint64(nPayload-nSrc))
  78185 		return SQLITE_OK
  78186 	}
  78187 
  78188 	mn = int32((*MemPage)(unsafe.Pointer(pPage)).FminLocal)
  78189 	n = int32(U32(mn) + U32(nPayload-mn)%((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-U32(4)))
  78190 
  78191 	if n > int32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal) {
  78192 		n = mn
  78193 	}
  78194 	spaceLeft = n
  78195 	*(*int32)(unsafe.Pointer(pnSize)) = n + nHeader + 4
  78196 	pPrior = pCell + uintptr(nHeader+n)
  78197 	pToRelease = uintptr(0)
  78198 	*(*Pgno)(unsafe.Pointer(bp + 8)) = Pgno(0)
  78199 	pBt = (*MemPage)(unsafe.Pointer(pPage)).FpBt
  78200 
  78201 	for 1 != 0 {
  78202 		n = nPayload
  78203 		if n > spaceLeft {
  78204 			n = spaceLeft
  78205 		}
  78206 
  78207 		if nSrc >= n {
  78208 			libc.Xmemcpy(tls, pPayload, pSrc, uint64(n))
  78209 		} else if nSrc > 0 {
  78210 			n = nSrc
  78211 			libc.Xmemcpy(tls, pPayload, pSrc, uint64(n))
  78212 		} else {
  78213 			libc.Xmemset(tls, pPayload, 0, uint64(n))
  78214 		}
  78215 		nPayload = nPayload - n
  78216 		if nPayload <= 0 {
  78217 			break
  78218 		}
  78219 		pPayload += uintptr(n)
  78220 		pSrc += uintptr(n)
  78221 		nSrc = nSrc - n
  78222 		spaceLeft = spaceLeft - n
  78223 		if spaceLeft == 0 {
  78224 			*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
  78225 			var pgnoPtrmap Pgno = *(*Pgno)(unsafe.Pointer(bp + 8))
  78226 			if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 {
  78227 				for __ccgo := true; __ccgo; __ccgo = ptrmapPageno(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8))) == *(*Pgno)(unsafe.Pointer(bp + 8)) || *(*Pgno)(unsafe.Pointer(bp + 8)) == U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1) {
  78228 					*(*Pgno)(unsafe.Pointer(bp + 8))++
  78229 				}
  78230 			}
  78231 			*(*int32)(unsafe.Pointer(bp + 12)) = allocateBtreePage(tls, pBt, bp, bp+8, *(*Pgno)(unsafe.Pointer(bp + 8)), uint8(0))
  78232 
  78233 			if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 && *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK {
  78234 				var eType U8 = func() uint8 {
  78235 					if pgnoPtrmap != 0 {
  78236 						return uint8(PTRMAP_OVERFLOW2)
  78237 					}
  78238 					return uint8(PTRMAP_OVERFLOW1)
  78239 				}()
  78240 				ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8)), eType, pgnoPtrmap, bp+12)
  78241 				if *(*int32)(unsafe.Pointer(bp + 12)) != 0 {
  78242 					releasePage(tls, *(*uintptr)(unsafe.Pointer(bp)))
  78243 				}
  78244 			}
  78245 			if *(*int32)(unsafe.Pointer(bp + 12)) != 0 {
  78246 				releasePage(tls, pToRelease)
  78247 				return *(*int32)(unsafe.Pointer(bp + 12))
  78248 			}
  78249 
  78250 			Xsqlite3Put4byte(tls, pPrior, *(*Pgno)(unsafe.Pointer(bp + 8)))
  78251 			releasePage(tls, pToRelease)
  78252 			pToRelease = *(*uintptr)(unsafe.Pointer(bp))
  78253 			pPrior = (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData
  78254 			Xsqlite3Put4byte(tls, pPrior, uint32(0))
  78255 			pPayload = (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + 4
  78256 			spaceLeft = int32((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(4))
  78257 		}
  78258 	}
  78259 	releasePage(tls, pToRelease)
  78260 	return SQLITE_OK
  78261 }
  78262 
  78263 func dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) {
  78264 	var pc U32
  78265 	var data uintptr
  78266 	var ptr uintptr
  78267 	var rc int32
  78268 	var hdr int32
  78269 
  78270 	if *(*int32)(unsafe.Pointer(pRC)) != 0 {
  78271 		return
  78272 	}
  78273 
  78274 	data = (*MemPage)(unsafe.Pointer(pPage)).FaData
  78275 	ptr = (*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*idx)
  78276 
  78277 	pc = U32(int32(*(*U8)(unsafe.Pointer(ptr)))<<8 | int32(*(*U8)(unsafe.Pointer(ptr + 1))))
  78278 	hdr = int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)
  78279 
  78280 	if pc+U32(sz) > (*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize {
  78281 		*(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 75440)
  78282 		return
  78283 	}
  78284 	rc = freeSpace(tls, pPage, uint16(pc), uint16(sz))
  78285 	if rc != 0 {
  78286 		*(*int32)(unsafe.Pointer(pRC)) = rc
  78287 		return
  78288 	}
  78289 	(*MemPage)(unsafe.Pointer(pPage)).FnCell--
  78290 	if int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) == 0 {
  78291 		libc.Xmemset(tls, data+uintptr(hdr+1), 0, uint64(4))
  78292 		*(*U8)(unsafe.Pointer(data + uintptr(hdr+7))) = U8(0)
  78293 		*(*U8)(unsafe.Pointer(data + uintptr(hdr+5))) = U8((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize >> 8)
  78294 		*(*U8)(unsafe.Pointer(data + uintptr(hdr+5) + 1)) = U8((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)
  78295 		(*MemPage)(unsafe.Pointer(pPage)).FnFree = int32((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize - U32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) -
  78296 			U32((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize) - U32(8))
  78297 	} else {
  78298 		libc.Xmemmove(tls, ptr, ptr+uintptr(2), uint64(2*(int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)-idx)))
  78299 		*(*U8)(unsafe.Pointer(data + uintptr(hdr+3))) = U8(int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) >> 8)
  78300 		*(*U8)(unsafe.Pointer(data + uintptr(hdr+3) + 1)) = U8((*MemPage)(unsafe.Pointer(pPage)).FnCell)
  78301 		*(*int32)(unsafe.Pointer(pPage + 20)) += 2
  78302 	}
  78303 }
  78304 
  78305 func insertCell(tls *libc.TLS, pPage uintptr, i int32, pCell uintptr, sz int32, pTemp uintptr, iChild Pgno) int32 {
  78306 	bp := tls.Alloc(8)
  78307 	defer tls.Free(8)
  78308 
  78309 	*(*int32)(unsafe.Pointer(bp)) = 0
  78310 	var j int32
  78311 	var data uintptr
  78312 	var pIns uintptr
  78313 
  78314 	if (*MemPage)(unsafe.Pointer(pPage)).FnOverflow != 0 || sz+2 > (*MemPage)(unsafe.Pointer(pPage)).FnFree {
  78315 		if pTemp != 0 {
  78316 			libc.Xmemcpy(tls, pTemp, pCell, uint64(sz))
  78317 			pCell = pTemp
  78318 		}
  78319 		if iChild != 0 {
  78320 			Xsqlite3Put4byte(tls, pCell, iChild)
  78321 		}
  78322 		j = int32(libc.PostIncUint8(&(*MemPage)(unsafe.Pointer(pPage)).FnOverflow, 1))
  78323 
  78324 		*(*uintptr)(unsafe.Pointer(pPage + 40 + uintptr(j)*8)) = pCell
  78325 		*(*U16)(unsafe.Pointer(pPage + 28 + uintptr(j)*2)) = U16(i)
  78326 
  78327 	} else {
  78328 		var rc int32 = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage)
  78329 		if rc != SQLITE_OK {
  78330 			return rc
  78331 		}
  78332 
  78333 		data = (*MemPage)(unsafe.Pointer(pPage)).FaData
  78334 
  78335 		rc = allocateSpace(tls, pPage, sz, bp)
  78336 		if rc != 0 {
  78337 			return rc
  78338 		}
  78339 
  78340 		*(*int32)(unsafe.Pointer(pPage + 20)) -= int32(U16(2 + sz))
  78341 		if iChild != 0 {
  78342 			libc.Xmemcpy(tls, data+uintptr(*(*int32)(unsafe.Pointer(bp))+4), pCell+uintptr(4), uint64(sz-4))
  78343 			Xsqlite3Put4byte(tls, data+uintptr(*(*int32)(unsafe.Pointer(bp))), iChild)
  78344 		} else {
  78345 			libc.Xmemcpy(tls, data+uintptr(*(*int32)(unsafe.Pointer(bp))), pCell, uint64(sz))
  78346 		}
  78347 		pIns = (*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(i*2)
  78348 		libc.Xmemmove(tls, pIns+uintptr(2), pIns, uint64(2*(int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)-i)))
  78349 		*(*U8)(unsafe.Pointer(pIns)) = U8(*(*int32)(unsafe.Pointer(bp)) >> 8)
  78350 		*(*U8)(unsafe.Pointer(pIns + 1)) = U8(*(*int32)(unsafe.Pointer(bp)))
  78351 		(*MemPage)(unsafe.Pointer(pPage)).FnCell++
  78352 
  78353 		if int32(libc.PreIncUint8(&*(*U8)(unsafe.Pointer(data + uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+4))), 1)) == 0 {
  78354 			*(*U8)(unsafe.Pointer(data + uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+3)))++
  78355 		}
  78356 
  78357 		if (*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FautoVacuum != 0 {
  78358 			*(*int32)(unsafe.Pointer(bp + 4)) = SQLITE_OK
  78359 
  78360 			ptrmapPutOvflPtr(tls, pPage, pPage, pCell, bp+4)
  78361 			if *(*int32)(unsafe.Pointer(bp + 4)) != 0 {
  78362 				return *(*int32)(unsafe.Pointer(bp + 4))
  78363 			}
  78364 		}
  78365 	}
  78366 	return SQLITE_OK
  78367 }
  78368 
  78369 // A CellArray object contains a cache of pointers and sizes for a
  78370 // consecutive sequence of cells that might be held on multiple pages.
  78371 //
  78372 // The cells in this array are the divider cell or cells from the pParent
  78373 // page plus up to three child pages.  There are a total of nCell cells.
  78374 //
  78375 // pRef is a pointer to one of the pages that contributes cells.  This is
  78376 // used to access information such as MemPage.intKey and MemPage.pBt->pageSize
  78377 // which should be common to all pages that contribute cells to this array.
  78378 //
  78379 // apCell[] and szCell[] hold, respectively, pointers to the start of each
  78380 // cell and the size of each cell.  Some of the apCell[] pointers might refer
  78381 // to overflow cells.  In other words, some apCel[] pointers might not point
  78382 // to content area of the pages.
  78383 //
  78384 // A szCell[] of zero means the size of that cell has not yet been computed.
  78385 //
  78386 // The cells come from as many as four different pages:
  78387 //
  78388 //	           -----------
  78389 //	           | Parent  |
  78390 //	           -----------
  78391 //	          /     |     **           /      |      **  ---------   ---------   ---------
  78392 //	|Child-1|   |Child-2|   |Child-3|
  78393 //	---------   ---------   ---------
  78394 //
  78395 // The order of cells is in the array is for an index btree is:
  78396 //
  78397 //  1. All cells from Child-1 in order
  78398 //  2. The first divider cell from Parent
  78399 //  3. All cells from Child-2 in order
  78400 //  4. The second divider cell from Parent
  78401 //  5. All cells from Child-3 in order
  78402 //
  78403 // For a table-btree (with rowids) the items 2 and 4 are empty because
  78404 // content exists only in leaves and there are no divider cells.
  78405 //
  78406 // For an index btree, the apEnd[] array holds pointer to the end of page
  78407 // for Child-1, the Parent, Child-2, the Parent (again), and Child-3,
  78408 // respectively. The ixNx[] array holds the number of cells contained in
  78409 // each of these 5 stages, and all stages to the left.  Hence:
  78410 //
  78411 //	ixNx[0] = Number of cells in Child-1.
  78412 //	ixNx[1] = Number of cells in Child-1 plus 1 for first divider.
  78413 //	ixNx[2] = Number of cells in Child-1 and Child-2 + 1 for 1st divider.
  78414 //	ixNx[3] = Number of cells in Child-1 and Child-2 + both divider cells
  78415 //	ixNx[4] = Total number of cells.
  78416 //
  78417 // For a table-btree, the concept is similar, except only apEnd[0]..apEnd[2]
  78418 // are used and they point to the leaf pages only, and the ixNx value are:
  78419 //
  78420 //	ixNx[0] = Number of cells in Child-1.
  78421 //	ixNx[1] = Number of cells in Child-1 and Child-2.
  78422 //	ixNx[2] = Total number of cells.
  78423 //
  78424 // Sometimes when deleting, a child page can have zero cells.  In those
  78425 // cases, ixNx[] entries with higher indexes, and the corresponding apEnd[]
  78426 // entries, shift down.  The end result is that each ixNx[] entry should
  78427 // be larger than the previous
  78428 type CellArray1 = struct {
  78429 	FnCell       int32
  78430 	F__ccgo_pad1 [4]byte
  78431 	FpRef        uintptr
  78432 	FapCell      uintptr
  78433 	FszCell      uintptr
  78434 	FapEnd       [6]uintptr
  78435 	FixNx        [6]int32
  78436 }
  78437 
  78438 // A CellArray object contains a cache of pointers and sizes for a
  78439 // consecutive sequence of cells that might be held on multiple pages.
  78440 //
  78441 // The cells in this array are the divider cell or cells from the pParent
  78442 // page plus up to three child pages.  There are a total of nCell cells.
  78443 //
  78444 // pRef is a pointer to one of the pages that contributes cells.  This is
  78445 // used to access information such as MemPage.intKey and MemPage.pBt->pageSize
  78446 // which should be common to all pages that contribute cells to this array.
  78447 //
  78448 // apCell[] and szCell[] hold, respectively, pointers to the start of each
  78449 // cell and the size of each cell.  Some of the apCell[] pointers might refer
  78450 // to overflow cells.  In other words, some apCel[] pointers might not point
  78451 // to content area of the pages.
  78452 //
  78453 // A szCell[] of zero means the size of that cell has not yet been computed.
  78454 //
  78455 // The cells come from as many as four different pages:
  78456 //
  78457 //	           -----------
  78458 //	           | Parent  |
  78459 //	           -----------
  78460 //	          /     |     **           /      |      **  ---------   ---------   ---------
  78461 //	|Child-1|   |Child-2|   |Child-3|
  78462 //	---------   ---------   ---------
  78463 //
  78464 // The order of cells is in the array is for an index btree is:
  78465 //
  78466 //  1. All cells from Child-1 in order
  78467 //  2. The first divider cell from Parent
  78468 //  3. All cells from Child-2 in order
  78469 //  4. The second divider cell from Parent
  78470 //  5. All cells from Child-3 in order
  78471 //
  78472 // For a table-btree (with rowids) the items 2 and 4 are empty because
  78473 // content exists only in leaves and there are no divider cells.
  78474 //
  78475 // For an index btree, the apEnd[] array holds pointer to the end of page
  78476 // for Child-1, the Parent, Child-2, the Parent (again), and Child-3,
  78477 // respectively. The ixNx[] array holds the number of cells contained in
  78478 // each of these 5 stages, and all stages to the left.  Hence:
  78479 //
  78480 //	ixNx[0] = Number of cells in Child-1.
  78481 //	ixNx[1] = Number of cells in Child-1 plus 1 for first divider.
  78482 //	ixNx[2] = Number of cells in Child-1 and Child-2 + 1 for 1st divider.
  78483 //	ixNx[3] = Number of cells in Child-1 and Child-2 + both divider cells
  78484 //	ixNx[4] = Total number of cells.
  78485 //
  78486 // For a table-btree, the concept is similar, except only apEnd[0]..apEnd[2]
  78487 // are used and they point to the leaf pages only, and the ixNx value are:
  78488 //
  78489 //	ixNx[0] = Number of cells in Child-1.
  78490 //	ixNx[1] = Number of cells in Child-1 and Child-2.
  78491 //	ixNx[2] = Total number of cells.
  78492 //
  78493 // Sometimes when deleting, a child page can have zero cells.  In those
  78494 // cases, ixNx[] entries with higher indexes, and the corresponding apEnd[]
  78495 // entries, shift down.  The end result is that each ixNx[] entry should
  78496 // be larger than the previous
  78497 type CellArray = CellArray1
  78498 
  78499 func populateCellCache(tls *libc.TLS, p uintptr, idx int32, N int32) {
  78500 	var pRef uintptr = (*CellArray)(unsafe.Pointer(p)).FpRef
  78501 	var szCell uintptr = (*CellArray)(unsafe.Pointer(p)).FszCell
  78502 
  78503 	for N > 0 {
  78504 		if int32(*(*U16)(unsafe.Pointer(szCell + uintptr(idx)*2))) == 0 {
  78505 			*(*U16)(unsafe.Pointer(szCell + uintptr(idx)*2)) = (*struct {
  78506 				f func(*libc.TLS, uintptr, uintptr) U16
  78507 			})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pRef)).FxCellSize})).f(tls, pRef, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FapCell + uintptr(idx)*8)))
  78508 		} else {
  78509 		}
  78510 		idx++
  78511 		N--
  78512 	}
  78513 }
  78514 
  78515 func computeCellSize(tls *libc.TLS, p uintptr, N int32) U16 {
  78516 	*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2)) = (*struct {
  78517 		f func(*libc.TLS, uintptr, uintptr) U16
  78518 	})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FpRef)).FxCellSize})).f(tls, (*CellArray)(unsafe.Pointer(p)).FpRef, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FapCell + uintptr(N)*8)))
  78519 	return *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2))
  78520 }
  78521 
  78522 func cachedCellSize(tls *libc.TLS, p uintptr, N int32) U16 {
  78523 	if *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2)) != 0 {
  78524 		return *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2))
  78525 	}
  78526 	return computeCellSize(tls, p, N)
  78527 }
  78528 
  78529 func rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg uintptr) int32 {
  78530 	var hdr int32 = int32((*MemPage)(unsafe.Pointer(pPg)).FhdrOffset)
  78531 	var aData uintptr = (*MemPage)(unsafe.Pointer(pPg)).FaData
  78532 	var usableSize int32 = int32((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPg)).FpBt)).FusableSize)
  78533 	var pEnd uintptr = aData + uintptr(usableSize)
  78534 	var i int32 = iFirst
  78535 	var j U32
  78536 	var iEnd int32 = i + nCell
  78537 	var pCellptr uintptr = (*MemPage)(unsafe.Pointer(pPg)).FaCellIdx
  78538 	var pTmp uintptr = Xsqlite3PagerTempSpace(tls, (*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPg)).FpBt)).FpPager)
  78539 	var pData uintptr
  78540 	var k int32
  78541 	var pSrcEnd uintptr
  78542 
  78543 	j = U32(int32(*(*U8)(unsafe.Pointer(aData + uintptr(hdr+5))))<<8 | int32(*(*U8)(unsafe.Pointer(aData + uintptr(hdr+5) + 1))))
  78544 	if j > U32(usableSize) {
  78545 		j = U32(0)
  78546 	}
  78547 	libc.Xmemcpy(tls, pTmp+uintptr(j), aData+uintptr(j), uint64(U32(usableSize)-j))
  78548 
  78549 	for k = 0; *(*int32)(unsafe.Pointer(pCArray + 80 + uintptr(k)*4)) <= i && k < NB*2; k++ {
  78550 	}
  78551 	pSrcEnd = *(*uintptr)(unsafe.Pointer(pCArray + 32 + uintptr(k)*8))
  78552 
  78553 	pData = pEnd
  78554 	for 1 != 0 {
  78555 		var pCell uintptr = *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))
  78556 		var sz U16 = *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2))
  78557 
  78558 		if Uptr(pCell) >= Uptr(aData+uintptr(j)) && Uptr(pCell) < Uptr(pEnd) {
  78559 			if Uptr(pCell+uintptr(sz)) > Uptr(pEnd) {
  78560 				return Xsqlite3CorruptError(tls, 75741)
  78561 			}
  78562 			pCell = pTmp + uintptr((int64(pCell)-int64(aData))/1)
  78563 		} else if Uptr(pCell+uintptr(sz)) > Uptr(pSrcEnd) &&
  78564 			Uptr(pCell) < Uptr(pSrcEnd) {
  78565 			return Xsqlite3CorruptError(tls, 75746)
  78566 		}
  78567 
  78568 		pData -= uintptr(sz)
  78569 		*(*U8)(unsafe.Pointer(pCellptr)) = U8((int64(pData) - int64(aData)) / 1 >> 8)
  78570 		*(*U8)(unsafe.Pointer(pCellptr + 1)) = U8((int64(pData) - int64(aData)) / 1)
  78571 		pCellptr += uintptr(2)
  78572 		if pData < pCellptr {
  78573 			return Xsqlite3CorruptError(tls, 75752)
  78574 		}
  78575 		libc.Xmemmove(tls, pData, pCell, uint64(sz))
  78576 
  78577 		i++
  78578 		if i >= iEnd {
  78579 			break
  78580 		}
  78581 		if *(*int32)(unsafe.Pointer(pCArray + 80 + uintptr(k)*4)) <= i {
  78582 			k++
  78583 			pSrcEnd = *(*uintptr)(unsafe.Pointer(pCArray + 32 + uintptr(k)*8))
  78584 		}
  78585 	}
  78586 
  78587 	(*MemPage)(unsafe.Pointer(pPg)).FnCell = U16(nCell)
  78588 	(*MemPage)(unsafe.Pointer(pPg)).FnOverflow = U8(0)
  78589 
  78590 	*(*U8)(unsafe.Pointer(aData + uintptr(hdr+1))) = U8(int32(0) >> 8)
  78591 	*(*U8)(unsafe.Pointer(aData + uintptr(hdr+1) + 1)) = U8(0)
  78592 	*(*U8)(unsafe.Pointer(aData + uintptr(hdr+3))) = U8(int32((*MemPage)(unsafe.Pointer(pPg)).FnCell) >> 8)
  78593 	*(*U8)(unsafe.Pointer(aData + uintptr(hdr+3) + 1)) = U8((*MemPage)(unsafe.Pointer(pPg)).FnCell)
  78594 	*(*U8)(unsafe.Pointer(aData + uintptr(hdr+5))) = U8((int64(pData) - int64(aData)) / 1 >> 8)
  78595 	*(*U8)(unsafe.Pointer(aData + uintptr(hdr+5) + 1)) = U8((int64(pData) - int64(aData)) / 1)
  78596 	*(*U8)(unsafe.Pointer(aData + uintptr(hdr+7))) = U8(0x00)
  78597 	return SQLITE_OK
  78598 }
  78599 
  78600 func pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr, pCellptr uintptr, iFirst int32, nCell int32, pCArray uintptr) int32 {
  78601 	bp := tls.Alloc(4)
  78602 	defer tls.Free(4)
  78603 
  78604 	var i int32 = iFirst
  78605 	var aData uintptr = (*MemPage)(unsafe.Pointer(pPg)).FaData
  78606 	var pData uintptr = *(*uintptr)(unsafe.Pointer(ppData))
  78607 	var iEnd int32 = iFirst + nCell
  78608 	var k int32
  78609 	var pEnd uintptr
  78610 
  78611 	if iEnd <= iFirst {
  78612 		return 0
  78613 	}
  78614 	for k = 0; *(*int32)(unsafe.Pointer(pCArray + 80 + uintptr(k)*4)) <= i && k < NB*2; k++ {
  78615 	}
  78616 	pEnd = *(*uintptr)(unsafe.Pointer(pCArray + 32 + uintptr(k)*8))
  78617 	for 1 != 0 {
  78618 		var sz int32
  78619 
  78620 		var pSlot uintptr
  78621 
  78622 		sz = int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2)))
  78623 		if int32(*(*U8)(unsafe.Pointer(aData + 1))) == 0 && int32(*(*U8)(unsafe.Pointer(aData + 2))) == 0 || libc.AssignUintptr(&pSlot, pageFindSlot(tls, pPg, sz, bp)) == uintptr(0) {
  78624 			if (int64(pData)-int64(pBegin))/1 < int64(sz) {
  78625 				return 1
  78626 			}
  78627 			pData -= uintptr(sz)
  78628 			pSlot = pData
  78629 		}
  78630 
  78631 		if Uptr(*(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))+uintptr(sz)) > Uptr(pEnd) &&
  78632 			Uptr(*(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))) < Uptr(pEnd) {
  78633 			Xsqlite3CorruptError(tls, 75837)
  78634 			return 1
  78635 		}
  78636 		libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), uint64(sz))
  78637 		*(*U8)(unsafe.Pointer(pCellptr)) = U8((int64(pSlot) - int64(aData)) / 1 >> 8)
  78638 		*(*U8)(unsafe.Pointer(pCellptr + 1)) = U8((int64(pSlot) - int64(aData)) / 1)
  78639 		pCellptr += uintptr(2)
  78640 		i++
  78641 		if i >= iEnd {
  78642 			break
  78643 		}
  78644 		if *(*int32)(unsafe.Pointer(pCArray + 80 + uintptr(k)*4)) <= i {
  78645 			k++
  78646 			pEnd = *(*uintptr)(unsafe.Pointer(pCArray + 32 + uintptr(k)*8))
  78647 		}
  78648 	}
  78649 	*(*uintptr)(unsafe.Pointer(ppData)) = pData
  78650 	return 0
  78651 }
  78652 
  78653 func pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArray uintptr) int32 {
  78654 	var aData uintptr = (*MemPage)(unsafe.Pointer(pPg)).FaData
  78655 	var pEnd uintptr = aData + uintptr((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPg)).FpBt)).FusableSize)
  78656 	var pStart uintptr = aData + uintptr(int32((*MemPage)(unsafe.Pointer(pPg)).FhdrOffset)+8+int32((*MemPage)(unsafe.Pointer(pPg)).FchildPtrSize))
  78657 	var nRet int32 = 0
  78658 	var i int32
  78659 	var iEnd int32 = iFirst + nCell
  78660 	var pFree uintptr = uintptr(0)
  78661 	var szFree int32 = 0
  78662 
  78663 	for i = iFirst; i < iEnd; i++ {
  78664 		var pCell uintptr = *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))
  78665 		if Uptr(pCell) >= Uptr(pStart) && Uptr(pCell) < Uptr(pEnd) {
  78666 			var sz int32
  78667 
  78668 			sz = int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2)))
  78669 			if pFree != pCell+uintptr(sz) {
  78670 				if pFree != 0 {
  78671 					freeSpace(tls, pPg, U16((int64(pFree)-int64(aData))/1), uint16(szFree))
  78672 				}
  78673 				pFree = pCell
  78674 				szFree = sz
  78675 				if pFree+uintptr(sz) > pEnd {
  78676 					return 0
  78677 				}
  78678 			} else {
  78679 				pFree = pCell
  78680 				szFree = szFree + sz
  78681 			}
  78682 			nRet++
  78683 		}
  78684 	}
  78685 	if pFree != 0 {
  78686 		freeSpace(tls, pPg, U16((int64(pFree)-int64(aData))/1), uint16(szFree))
  78687 	}
  78688 	return nRet
  78689 }
  78690 
  78691 func editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, pCArray uintptr) int32 {
  78692 	bp := tls.Alloc(8)
  78693 	defer tls.Free(8)
  78694 
  78695 	var aData uintptr
  78696 	var hdr int32
  78697 	var pBegin uintptr
  78698 	var nCell int32
  78699 
  78700 	var pCellptr uintptr
  78701 	var i int32
  78702 	var iOldEnd int32
  78703 	var iNewEnd int32
  78704 	var nShift int32
  78705 	var nTail int32
  78706 	var nAdd int32
  78707 	var iCell int32
  78708 	aData = (*MemPage)(unsafe.Pointer(pPg)).FaData
  78709 	hdr = int32((*MemPage)(unsafe.Pointer(pPg)).FhdrOffset)
  78710 	pBegin = (*MemPage)(unsafe.Pointer(pPg)).FaCellIdx + uintptr(nNew*2)
  78711 	nCell = int32((*MemPage)(unsafe.Pointer(pPg)).FnCell)
  78712 	iOldEnd = iOld + int32((*MemPage)(unsafe.Pointer(pPg)).FnCell) + int32((*MemPage)(unsafe.Pointer(pPg)).FnOverflow)
  78713 	iNewEnd = iNew + nNew
  78714 
  78715 	if !(iOld < iNew) {
  78716 		goto __1
  78717 	}
  78718 	nShift = pageFreeArray(tls, pPg, iOld, iNew-iOld, pCArray)
  78719 	if !(nShift > nCell) {
  78720 		goto __2
  78721 	}
  78722 	return Xsqlite3CorruptError(tls, 75951)
  78723 __2:
  78724 	;
  78725 	libc.Xmemmove(tls, (*MemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*MemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*2), uint64(nCell*2))
  78726 	nCell = nCell - nShift
  78727 __1:
  78728 	;
  78729 	if !(iNewEnd < iOldEnd) {
  78730 		goto __3
  78731 	}
  78732 	nTail = pageFreeArray(tls, pPg, iNewEnd, iOldEnd-iNewEnd, pCArray)
  78733 
  78734 	nCell = nCell - nTail
  78735 __3:
  78736 	;
  78737 	*(*uintptr)(unsafe.Pointer(bp)) = aData + uintptr((int32(*(*U8)(unsafe.Pointer(aData + uintptr(hdr+5))))<<8|int32(*(*U8)(unsafe.Pointer(aData + uintptr(hdr+5) + 1)))-1)&0xffff+1)
  78738 	if !(*(*uintptr)(unsafe.Pointer(bp)) < pBegin) {
  78739 		goto __4
  78740 	}
  78741 	goto editpage_fail
  78742 __4:
  78743 	;
  78744 	if !(*(*uintptr)(unsafe.Pointer(bp)) > (*MemPage)(unsafe.Pointer(pPg)).FaDataEnd) {
  78745 		goto __5
  78746 	}
  78747 	goto editpage_fail
  78748 __5:
  78749 	;
  78750 	if !(iNew < iOld) {
  78751 		goto __6
  78752 	}
  78753 	nAdd = func() int32 {
  78754 		if nNew < iOld-iNew {
  78755 			return nNew
  78756 		}
  78757 		return iOld - iNew
  78758 	}()
  78759 
  78760 	pCellptr = (*MemPage)(unsafe.Pointer(pPg)).FaCellIdx
  78761 	libc.Xmemmove(tls, pCellptr+uintptr(nAdd*2), pCellptr, uint64(nCell*2))
  78762 	if !(pageInsertArray(tls,
  78763 		pPg, pBegin, bp, pCellptr,
  78764 		iNew, nAdd, pCArray) != 0) {
  78765 		goto __7
  78766 	}
  78767 	goto editpage_fail
  78768 __7:
  78769 	;
  78770 	nCell = nCell + nAdd
  78771 __6:
  78772 	;
  78773 	i = 0
  78774 __8:
  78775 	if !(i < int32((*MemPage)(unsafe.Pointer(pPg)).FnOverflow)) {
  78776 		goto __10
  78777 	}
  78778 	iCell = iOld + int32(*(*U16)(unsafe.Pointer(pPg + 28 + uintptr(i)*2))) - iNew
  78779 	if !(iCell >= 0 && iCell < nNew) {
  78780 		goto __11
  78781 	}
  78782 	pCellptr = (*MemPage)(unsafe.Pointer(pPg)).FaCellIdx + uintptr(iCell*2)
  78783 	if !(nCell > iCell) {
  78784 		goto __12
  78785 	}
  78786 	libc.Xmemmove(tls, pCellptr+2, pCellptr, uint64((nCell-iCell)*2))
  78787 __12:
  78788 	;
  78789 	nCell++
  78790 	cachedCellSize(tls, pCArray, iCell+iNew)
  78791 	if !(pageInsertArray(tls,
  78792 		pPg, pBegin, bp, pCellptr,
  78793 		iCell+iNew, 1, pCArray) != 0) {
  78794 		goto __13
  78795 	}
  78796 	goto editpage_fail
  78797 __13:
  78798 	;
  78799 __11:
  78800 	;
  78801 	goto __9
  78802 __9:
  78803 	i++
  78804 	goto __8
  78805 	goto __10
  78806 __10:
  78807 	;
  78808 	pCellptr = (*MemPage)(unsafe.Pointer(pPg)).FaCellIdx + uintptr(nCell*2)
  78809 	if !(pageInsertArray(tls,
  78810 		pPg, pBegin, bp, pCellptr,
  78811 		iNew+nCell, nNew-nCell, pCArray) != 0) {
  78812 		goto __14
  78813 	}
  78814 	goto editpage_fail
  78815 __14:
  78816 	;
  78817 	(*MemPage)(unsafe.Pointer(pPg)).FnCell = U16(nNew)
  78818 	(*MemPage)(unsafe.Pointer(pPg)).FnOverflow = U8(0)
  78819 
  78820 	*(*U8)(unsafe.Pointer(aData + uintptr(hdr+3))) = U8(int32((*MemPage)(unsafe.Pointer(pPg)).FnCell) >> 8)
  78821 	*(*U8)(unsafe.Pointer(aData + uintptr(hdr+3) + 1)) = U8((*MemPage)(unsafe.Pointer(pPg)).FnCell)
  78822 	*(*U8)(unsafe.Pointer(aData + uintptr(hdr+5))) = U8((int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(aData)) / 1 >> 8)
  78823 	*(*U8)(unsafe.Pointer(aData + uintptr(hdr+5) + 1)) = U8((int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(aData)) / 1)
  78824 
  78825 	return SQLITE_OK
  78826 editpage_fail:
  78827 	populateCellCache(tls, pCArray, iNew, nNew)
  78828 	return rebuildPage(tls, pCArray, iNew, nNew, pPg)
  78829 }
  78830 
  78831 func balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintptr) int32 {
  78832 	bp := tls.Alloc(140)
  78833 	defer tls.Free(140)
  78834 
  78835 	var pBt uintptr = (*MemPage)(unsafe.Pointer(pPage)).FpBt
  78836 
  78837 	if int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) == 0 {
  78838 		return Xsqlite3CorruptError(tls, 76064)
  78839 	}
  78840 
  78841 	*(*int32)(unsafe.Pointer(bp + 136)) = allocateBtreePage(tls, pBt, bp, bp+8, uint32(0), uint8(0))
  78842 
  78843 	if *(*int32)(unsafe.Pointer(bp + 136)) == SQLITE_OK {
  78844 		var pOut uintptr = pSpace + 4
  78845 		*(*uintptr)(unsafe.Pointer(bp + 16)) = *(*uintptr)(unsafe.Pointer(pPage + 40))
  78846 		*(*U16)(unsafe.Pointer(bp + 24)) = (*struct {
  78847 			f func(*libc.TLS, uintptr, uintptr) U16
  78848 		})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxCellSize})).f(tls, pPage, *(*uintptr)(unsafe.Pointer(bp + 16)))
  78849 		var pStop uintptr
  78850 
  78851 		zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp)), PTF_INTKEY|PTF_LEAFDATA|PTF_LEAF)
  78852 		(*CellArray)(unsafe.Pointer(bp + 32)).FnCell = 1
  78853 		(*CellArray)(unsafe.Pointer(bp + 32)).FpRef = pPage
  78854 		(*CellArray)(unsafe.Pointer(bp + 32)).FapCell = bp + 16
  78855 		(*CellArray)(unsafe.Pointer(bp + 32)).FszCell = bp + 24
  78856 		*(*uintptr)(unsafe.Pointer(bp + 32 + 32)) = (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd
  78857 		*(*int32)(unsafe.Pointer(bp + 32 + 80)) = 2
  78858 		*(*int32)(unsafe.Pointer(bp + 136)) = rebuildPage(tls, bp+32, 0, 1, *(*uintptr)(unsafe.Pointer(bp)))
  78859 		if *(*int32)(unsafe.Pointer(bp + 136)) != 0 {
  78860 			releasePage(tls, *(*uintptr)(unsafe.Pointer(bp)))
  78861 			return *(*int32)(unsafe.Pointer(bp + 136))
  78862 		}
  78863 		(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnFree = int32((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FcellOffset) - U32(2) - U32(*(*U16)(unsafe.Pointer(bp + 24))))
  78864 
  78865 		if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 {
  78866 			ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8)), uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pParent)).Fpgno, bp+136)
  78867 			if int32(*(*U16)(unsafe.Pointer(bp + 24))) > int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FminLocal) {
  78868 				ptrmapPutOvflPtr(tls, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 16)), bp+136)
  78869 			}
  78870 		}
  78871 
  78872 		*(*uintptr)(unsafe.Pointer(bp + 16)) = (*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*(int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)-1)))))))
  78873 		pStop = *(*uintptr)(unsafe.Pointer(bp + 16)) + 9
  78874 		for int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 16)), 1))))&0x80 != 0 && *(*uintptr)(unsafe.Pointer(bp + 16)) < pStop {
  78875 		}
  78876 		pStop = *(*uintptr)(unsafe.Pointer(bp + 16)) + 9
  78877 		for int32(libc.AssignPtrUint8(libc.PostIncUintptr(&pOut, 1), *(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 16)), 1)))))&0x80 != 0 && *(*uintptr)(unsafe.Pointer(bp + 16)) < pStop {
  78878 		}
  78879 
  78880 		if *(*int32)(unsafe.Pointer(bp + 136)) == SQLITE_OK {
  78881 			*(*int32)(unsafe.Pointer(bp + 136)) = insertCell(tls, pParent, int32((*MemPage)(unsafe.Pointer(pParent)).FnCell), pSpace, int32((int64(pOut)-int64(pSpace))/1),
  78882 				uintptr(0), (*MemPage)(unsafe.Pointer(pPage)).Fpgno)
  78883 		}
  78884 
  78885 		Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(pParent)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pParent)).FhdrOffset)+8), *(*Pgno)(unsafe.Pointer(bp + 8)))
  78886 
  78887 		releasePage(tls, *(*uintptr)(unsafe.Pointer(bp)))
  78888 	}
  78889 
  78890 	return *(*int32)(unsafe.Pointer(bp + 136))
  78891 }
  78892 
  78893 func copyNodeContent(tls *libc.TLS, pFrom uintptr, pTo uintptr, pRC uintptr) {
  78894 	if *(*int32)(unsafe.Pointer(pRC)) == SQLITE_OK {
  78895 		var pBt uintptr = (*MemPage)(unsafe.Pointer(pFrom)).FpBt
  78896 		var aFrom uintptr = (*MemPage)(unsafe.Pointer(pFrom)).FaData
  78897 		var aTo uintptr = (*MemPage)(unsafe.Pointer(pTo)).FaData
  78898 		var iFromHdr int32 = int32((*MemPage)(unsafe.Pointer(pFrom)).FhdrOffset)
  78899 		var iToHdr int32 = func() int32 {
  78900 			if (*MemPage)(unsafe.Pointer(pTo)).Fpgno == Pgno(1) {
  78901 				return 100
  78902 			}
  78903 			return 0
  78904 		}()
  78905 		var rc int32
  78906 		var iData int32
  78907 
  78908 		iData = int32(*(*U8)(unsafe.Pointer(aFrom + uintptr(iFromHdr+5))))<<8 | int32(*(*U8)(unsafe.Pointer(aFrom + uintptr(iFromHdr+5) + 1)))
  78909 		libc.Xmemcpy(tls, aTo+uintptr(iData), aFrom+uintptr(iData), uint64((*BtShared)(unsafe.Pointer(pBt)).FusableSize-U32(iData)))
  78910 		libc.Xmemcpy(tls, aTo+uintptr(iToHdr), aFrom+uintptr(iFromHdr), uint64(int32((*MemPage)(unsafe.Pointer(pFrom)).FcellOffset)+2*int32((*MemPage)(unsafe.Pointer(pFrom)).FnCell)))
  78911 
  78912 		(*MemPage)(unsafe.Pointer(pTo)).FisInit = U8(0)
  78913 		rc = btreeInitPage(tls, pTo)
  78914 		if rc == SQLITE_OK {
  78915 			rc = btreeComputeFreeSpace(tls, pTo)
  78916 		}
  78917 		if rc != SQLITE_OK {
  78918 			*(*int32)(unsafe.Pointer(pRC)) = rc
  78919 			return
  78920 		}
  78921 
  78922 		if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 {
  78923 			*(*int32)(unsafe.Pointer(pRC)) = setChildPtrmaps(tls, pTo)
  78924 		}
  78925 	}
  78926 }
  78927 
  78928 func balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpace uintptr, isRoot int32, bBulk int32) int32 {
  78929 	bp := tls.Alloc(312)
  78930 	defer tls.Free(312)
  78931 
  78932 	var pBt uintptr
  78933 	var nMaxCells int32
  78934 	var nNew int32
  78935 	var nOld int32
  78936 	var i int32
  78937 	var j int32
  78938 	var k int32
  78939 	var nxDiv int32
  78940 
  78941 	var leafCorrection U16
  78942 	var leafData int32
  78943 	var usableSpace int32
  78944 	var pageFlags int32
  78945 	var iSpace1 int32
  78946 	var iOvflSpace int32
  78947 	var szScratch int32
  78948 
  78949 	var pRight uintptr
  78950 
  78951 	var aSpace1 uintptr
  78952 
  78953 	var iOff int32
  78954 	var sz U16
  78955 	var pTemp uintptr
  78956 	var pOld uintptr
  78957 	var limit int32
  78958 	var aData uintptr
  78959 	var maskPage U16
  78960 	var piCell uintptr
  78961 	var piEnd uintptr
  78962 	var p uintptr
  78963 	var sz1 int32
  78964 	var szR int32
  78965 	var szD int32
  78966 	var szRight int32
  78967 	var szLeft int32
  78968 	var r int32
  78969 	var d int32
  78970 
  78971 	var pgnoA Pgno
  78972 	var pgnoB Pgno
  78973 	var pgnoTemp Pgno
  78974 	var fgA U16
  78975 	var fgB U16
  78976 	var iB int32
  78977 	var pOld1 uintptr
  78978 	var pCell uintptr
  78979 	var pOld2 uintptr
  78980 	var pNew1 uintptr
  78981 	var cntOldNext int32
  78982 	var iNew int32
  78983 	var iOld int32
  78984 
  78985 	var pCell1 uintptr
  78986 	var pTemp1 uintptr
  78987 	var sz2 int32
  78988 	var pSrcEnd uintptr
  78989 	var pNew2 uintptr
  78990 	var iNew1 int32
  78991 	var iOld1 int32
  78992 	var nNewCell int32
  78993 	var iPg int32
  78994 	var key U32
  78995 	nMaxCells = 0
  78996 	nNew = 0
  78997 	*(*int32)(unsafe.Pointer(bp + 172)) = SQLITE_OK
  78998 	iSpace1 = 0
  78999 	iOvflSpace = 0
  79000 
  79001 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof([5]U8{})))
  79002 	libc.Xmemset(tls, bp+8, 0, uint64(unsafe.Sizeof(CellArray{})))
  79003 	pBt = (*MemPage)(unsafe.Pointer(pParent)).FpBt
  79004 
  79005 	if !!(aOvflSpace != 0) {
  79006 		goto __1
  79007 	}
  79008 	return SQLITE_NOMEM
  79009 __1:
  79010 	;
  79011 	i = int32((*MemPage)(unsafe.Pointer(pParent)).FnOverflow) + int32((*MemPage)(unsafe.Pointer(pParent)).FnCell)
  79012 	if !(i < 2) {
  79013 		goto __2
  79014 	}
  79015 	nxDiv = 0
  79016 	goto __3
  79017 __2:
  79018 	;
  79019 	if !(iParentIdx == 0) {
  79020 		goto __4
  79021 	}
  79022 	nxDiv = 0
  79023 	goto __5
  79024 __4:
  79025 	if !(iParentIdx == i) {
  79026 		goto __6
  79027 	}
  79028 	nxDiv = i - 2 + bBulk
  79029 	goto __7
  79030 __6:
  79031 	nxDiv = iParentIdx - 1
  79032 __7:
  79033 	;
  79034 __5:
  79035 	;
  79036 	i = 2 - bBulk
  79037 __3:
  79038 	;
  79039 	nOld = i + 1
  79040 	if !(i+nxDiv-int32((*MemPage)(unsafe.Pointer(pParent)).FnOverflow) == int32((*MemPage)(unsafe.Pointer(pParent)).FnCell)) {
  79041 		goto __8
  79042 	}
  79043 	pRight = (*MemPage)(unsafe.Pointer(pParent)).FaData + uintptr(int32((*MemPage)(unsafe.Pointer(pParent)).FhdrOffset)+8)
  79044 	goto __9
  79045 __8:
  79046 	pRight = (*MemPage)(unsafe.Pointer(pParent)).FaData + uintptr(int32((*MemPage)(unsafe.Pointer(pParent)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pParent)).FaCellIdx + uintptr(2*(i+nxDiv-int32((*MemPage)(unsafe.Pointer(pParent)).FnOverflow))))))))
  79047 __9:
  79048 	;
  79049 	*(*Pgno)(unsafe.Pointer(bp + 264)) = Xsqlite3Get4byte(tls, pRight)
  79050 __10:
  79051 	if !(1 != 0) {
  79052 		goto __11
  79053 	}
  79054 	if !(*(*int32)(unsafe.Pointer(bp + 172)) == SQLITE_OK) {
  79055 		goto __12
  79056 	}
  79057 	*(*int32)(unsafe.Pointer(bp + 172)) = getAndInitPage(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 264)), bp+112+uintptr(i)*8, uintptr(0), 0)
  79058 __12:
  79059 	;
  79060 	if !(*(*int32)(unsafe.Pointer(bp + 172)) != 0) {
  79061 		goto __13
  79062 	}
  79063 	libc.Xmemset(tls, bp+112, 0, uint64(i+1)*uint64(unsafe.Sizeof(uintptr(0))))
  79064 	goto balance_cleanup
  79065 __13:
  79066 	;
  79067 	if !((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 112 + uintptr(i)*8)))).FnFree < 0) {
  79068 		goto __14
  79069 	}
  79070 	*(*int32)(unsafe.Pointer(bp + 172)) = btreeComputeFreeSpace(tls, *(*uintptr)(unsafe.Pointer(bp + 112 + uintptr(i)*8)))
  79071 	if !(*(*int32)(unsafe.Pointer(bp + 172)) != 0) {
  79072 		goto __15
  79073 	}
  79074 	libc.Xmemset(tls, bp+112, 0, uint64(i)*uint64(unsafe.Sizeof(uintptr(0))))
  79075 	goto balance_cleanup
  79076 __15:
  79077 	;
  79078 __14:
  79079 	;
  79080 	nMaxCells = nMaxCells + (int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 112 + uintptr(i)*8)))).FnCell) + int32(uint64(unsafe.Sizeof([4]uintptr{}))/uint64(unsafe.Sizeof(uintptr(0)))))
  79081 	if !(libc.PostDecInt32(&i, 1) == 0) {
  79082 		goto __16
  79083 	}
  79084 	goto __11
  79085 __16:
  79086 	;
  79087 	if !((*MemPage)(unsafe.Pointer(pParent)).FnOverflow != 0 && i+nxDiv == int32(*(*U16)(unsafe.Pointer(pParent + 28)))) {
  79088 		goto __17
  79089 	}
  79090 	*(*uintptr)(unsafe.Pointer(bp + 136 + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(pParent + 40))
  79091 	*(*Pgno)(unsafe.Pointer(bp + 264)) = Xsqlite3Get4byte(tls, *(*uintptr)(unsafe.Pointer(bp + 136 + uintptr(i)*8)))
  79092 	*(*int32)(unsafe.Pointer(bp + 152 + uintptr(i)*4)) = int32((*struct {
  79093 		f func(*libc.TLS, uintptr, uintptr) U16
  79094 	})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pParent)).FxCellSize})).f(tls, pParent, *(*uintptr)(unsafe.Pointer(bp + 136 + uintptr(i)*8))))
  79095 	(*MemPage)(unsafe.Pointer(pParent)).FnOverflow = U8(0)
  79096 	goto __18
  79097 __17:
  79098 	*(*uintptr)(unsafe.Pointer(bp + 136 + uintptr(i)*8)) = (*MemPage)(unsafe.Pointer(pParent)).FaData + uintptr(int32((*MemPage)(unsafe.Pointer(pParent)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pParent)).FaCellIdx + uintptr(2*(i+nxDiv-int32((*MemPage)(unsafe.Pointer(pParent)).FnOverflow))))))))
  79099 	*(*Pgno)(unsafe.Pointer(bp + 264)) = Xsqlite3Get4byte(tls, *(*uintptr)(unsafe.Pointer(bp + 136 + uintptr(i)*8)))
  79100 	*(*int32)(unsafe.Pointer(bp + 152 + uintptr(i)*4)) = int32((*struct {
  79101 		f func(*libc.TLS, uintptr, uintptr) U16
  79102 	})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pParent)).FxCellSize})).f(tls, pParent, *(*uintptr)(unsafe.Pointer(bp + 136 + uintptr(i)*8))))
  79103 
  79104 	if !(int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags)&BTS_FAST_SECURE != 0) {
  79105 		goto __19
  79106 	}
  79107 
  79108 	iOff = int32(*(*uintptr)(unsafe.Pointer(bp + 136 + uintptr(i)*8))) - int32((*MemPage)(unsafe.Pointer(pParent)).FaData)
  79109 	if !(iOff+*(*int32)(unsafe.Pointer(bp + 152 + uintptr(i)*4)) <= int32((*BtShared)(unsafe.Pointer(pBt)).FusableSize)) {
  79110 		goto __20
  79111 	}
  79112 	libc.Xmemcpy(tls, aOvflSpace+uintptr(iOff), *(*uintptr)(unsafe.Pointer(bp + 136 + uintptr(i)*8)), uint64(*(*int32)(unsafe.Pointer(bp + 152 + uintptr(i)*4))))
  79113 	*(*uintptr)(unsafe.Pointer(bp + 136 + uintptr(i)*8)) = aOvflSpace + uintptr((int64(*(*uintptr)(unsafe.Pointer(bp + 136 + uintptr(i)*8)))-int64((*MemPage)(unsafe.Pointer(pParent)).FaData))/1)
  79114 __20:
  79115 	;
  79116 __19:
  79117 	;
  79118 	dropCell(tls, pParent, i+nxDiv-int32((*MemPage)(unsafe.Pointer(pParent)).FnOverflow), *(*int32)(unsafe.Pointer(bp + 152 + uintptr(i)*4)), bp+172)
  79119 __18:
  79120 	;
  79121 	goto __10
  79122 __11:
  79123 	;
  79124 	nMaxCells = (nMaxCells + 3) & libc.CplInt32(3)
  79125 
  79126 	szScratch = int32(uint64(nMaxCells)*uint64(unsafe.Sizeof(uintptr(0))) +
  79127 		uint64(nMaxCells)*uint64(unsafe.Sizeof(U16(0))) +
  79128 		uint64((*BtShared)(unsafe.Pointer(pBt)).FpageSize))
  79129 
  79130 	(*CellArray)(unsafe.Pointer(bp + 8)).FapCell = Xsqlite3DbMallocRaw(tls, uintptr(0), uint64(szScratch))
  79131 	if !((*CellArray)(unsafe.Pointer(bp+8)).FapCell == uintptr(0)) {
  79132 		goto __21
  79133 	}
  79134 	*(*int32)(unsafe.Pointer(bp + 172)) = SQLITE_NOMEM
  79135 	goto balance_cleanup
  79136 __21:
  79137 	;
  79138 	(*CellArray)(unsafe.Pointer(bp + 8)).FszCell = (*CellArray)(unsafe.Pointer(bp+8)).FapCell + uintptr(nMaxCells)*8
  79139 	aSpace1 = (*CellArray)(unsafe.Pointer(bp+8)).FszCell + uintptr(nMaxCells)*2
  79140 
  79141 	(*CellArray)(unsafe.Pointer(bp + 8)).FpRef = *(*uintptr)(unsafe.Pointer(bp + 112))
  79142 	leafCorrection = U16(int32((*MemPage)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FpRef)).Fleaf) * 4)
  79143 	leafData = int32((*MemPage)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp + 8)).FpRef)).FintKeyLeaf)
  79144 	i = 0
  79145 __22:
  79146 	if !(i < nOld) {
  79147 		goto __24
  79148 	}
  79149 	pOld = *(*uintptr)(unsafe.Pointer(bp + 112 + uintptr(i)*8))
  79150 	limit = int32((*MemPage)(unsafe.Pointer(pOld)).FnCell)
  79151 	aData = (*MemPage)(unsafe.Pointer(pOld)).FaData
  79152 	maskPage = (*MemPage)(unsafe.Pointer(pOld)).FmaskPage
  79153 	piCell = aData + uintptr((*MemPage)(unsafe.Pointer(pOld)).FcellOffset)
  79154 
  79155 	if !(int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pOld)).FaData))) != int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 112)))).FaData)))) {
  79156 		goto __25
  79157 	}
  79158 	*(*int32)(unsafe.Pointer(bp + 172)) = Xsqlite3CorruptError(tls, 76485)
  79159 	goto balance_cleanup
  79160 __25:
  79161 	;
  79162 	libc.Xmemset(tls, (*CellArray)(unsafe.Pointer(bp+8)).FszCell+uintptr((*CellArray)(unsafe.Pointer(bp+8)).FnCell)*2, 0, uint64(unsafe.Sizeof(U16(0)))*uint64(limit+int32((*MemPage)(unsafe.Pointer(pOld)).FnOverflow)))
  79163 	if !(int32((*MemPage)(unsafe.Pointer(pOld)).FnOverflow) > 0) {
  79164 		goto __26
  79165 	}
  79166 	if !(limit < int32(*(*U16)(unsafe.Pointer(pOld + 28)))) {
  79167 		goto __27
  79168 	}
  79169 	*(*int32)(unsafe.Pointer(bp + 172)) = Xsqlite3CorruptError(tls, 76509)
  79170 	goto balance_cleanup
  79171 __27:
  79172 	;
  79173 	limit = int32(*(*U16)(unsafe.Pointer(pOld + 28)))
  79174 	j = 0
  79175 __28:
  79176 	if !(j < limit) {
  79177 		goto __30
  79178 	}
  79179 	*(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FapCell + uintptr((*CellArray)(unsafe.Pointer(bp+8)).FnCell)*8)) = aData + uintptr(int32(maskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(piCell)))))
  79180 	piCell += uintptr(2)
  79181 	(*CellArray)(unsafe.Pointer(bp+8)).FnCell++
  79182 	goto __29
  79183 __29:
  79184 	j++
  79185 	goto __28
  79186 	goto __30
  79187 __30:
  79188 	;
  79189 	k = 0
  79190 __31:
  79191 	if !(k < int32((*MemPage)(unsafe.Pointer(pOld)).FnOverflow)) {
  79192 		goto __33
  79193 	}
  79194 
  79195 	*(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FapCell + uintptr((*CellArray)(unsafe.Pointer(bp+8)).FnCell)*8)) = *(*uintptr)(unsafe.Pointer(pOld + 40 + uintptr(k)*8))
  79196 	(*CellArray)(unsafe.Pointer(bp+8)).FnCell++
  79197 	goto __32
  79198 __32:
  79199 	k++
  79200 	goto __31
  79201 	goto __33
  79202 __33:
  79203 	;
  79204 __26:
  79205 	;
  79206 	piEnd = aData + uintptr((*MemPage)(unsafe.Pointer(pOld)).FcellOffset) + uintptr(2*int32((*MemPage)(unsafe.Pointer(pOld)).FnCell))
  79207 __34:
  79208 	if !(piCell < piEnd) {
  79209 		goto __35
  79210 	}
  79211 
  79212 	*(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FapCell + uintptr((*CellArray)(unsafe.Pointer(bp+8)).FnCell)*8)) = aData + uintptr(int32(maskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(piCell)))))
  79213 	piCell += uintptr(2)
  79214 	(*CellArray)(unsafe.Pointer(bp+8)).FnCell++
  79215 	goto __34
  79216 __35:
  79217 	;
  79218 	*(*int32)(unsafe.Pointer(bp + 176 + uintptr(i)*4)) = (*CellArray)(unsafe.Pointer(bp + 8)).FnCell
  79219 	if !(i < nOld-1 && !(leafData != 0)) {
  79220 		goto __36
  79221 	}
  79222 	sz = U16(*(*int32)(unsafe.Pointer(bp + 152 + uintptr(i)*4)))
  79223 
  79224 	*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FszCell + uintptr((*CellArray)(unsafe.Pointer(bp+8)).FnCell)*2)) = sz
  79225 	pTemp = aSpace1 + uintptr(iSpace1)
  79226 	iSpace1 = iSpace1 + int32(sz)
  79227 
  79228 	libc.Xmemcpy(tls, pTemp, *(*uintptr)(unsafe.Pointer(bp + 136 + uintptr(i)*8)), uint64(sz))
  79229 	*(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FapCell + uintptr((*CellArray)(unsafe.Pointer(bp+8)).FnCell)*8)) = pTemp + uintptr(leafCorrection)
  79230 
  79231 	*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FszCell + uintptr((*CellArray)(unsafe.Pointer(bp+8)).FnCell)*2)) = U16(int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FszCell + uintptr((*CellArray)(unsafe.Pointer(bp+8)).FnCell)*2))) - int32(leafCorrection))
  79232 	if !!(int32((*MemPage)(unsafe.Pointer(pOld)).Fleaf) != 0) {
  79233 		goto __37
  79234 	}
  79235 
  79236 	libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FapCell + uintptr((*CellArray)(unsafe.Pointer(bp+8)).FnCell)*8)), (*MemPage)(unsafe.Pointer(pOld)).FaData+8, uint64(4))
  79237 	goto __38
  79238 __37:
  79239 	;
  79240 __39:
  79241 	if !(int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FszCell + uintptr((*CellArray)(unsafe.Pointer(bp+8)).FnCell)*2))) < 4) {
  79242 		goto __40
  79243 	}
  79244 
  79245 	*(*U8)(unsafe.Pointer(aSpace1 + uintptr(libc.PostIncInt32(&iSpace1, 1)))) = U8(0x00)
  79246 	*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FszCell + uintptr((*CellArray)(unsafe.Pointer(bp+8)).FnCell)*2))++
  79247 	goto __39
  79248 __40:
  79249 	;
  79250 __38:
  79251 	;
  79252 	(*CellArray)(unsafe.Pointer(bp+8)).FnCell++
  79253 __36:
  79254 	;
  79255 	goto __23
  79256 __23:
  79257 	i++
  79258 	goto __22
  79259 	goto __24
  79260 __24:
  79261 	;
  79262 	usableSpace = int32((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(12) + U32(leafCorrection))
  79263 	i = libc.AssignInt32(&k, 0)
  79264 __41:
  79265 	if !(i < nOld) {
  79266 		goto __43
  79267 	}
  79268 	p = *(*uintptr)(unsafe.Pointer(bp + 112 + uintptr(i)*8))
  79269 	*(*uintptr)(unsafe.Pointer(bp + 8 + 32 + uintptr(k)*8)) = (*MemPage)(unsafe.Pointer(p)).FaDataEnd
  79270 	*(*int32)(unsafe.Pointer(bp + 8 + 80 + uintptr(k)*4)) = *(*int32)(unsafe.Pointer(bp + 176 + uintptr(i)*4))
  79271 	if !(k != 0 && *(*int32)(unsafe.Pointer(bp + 8 + 80 + uintptr(k)*4)) == *(*int32)(unsafe.Pointer(bp + 8 + 80 + uintptr(k-1)*4))) {
  79272 		goto __44
  79273 	}
  79274 	k--
  79275 __44:
  79276 	;
  79277 	if !!(leafData != 0) {
  79278 		goto __45
  79279 	}
  79280 	k++
  79281 	*(*uintptr)(unsafe.Pointer(bp + 8 + 32 + uintptr(k)*8)) = (*MemPage)(unsafe.Pointer(pParent)).FaDataEnd
  79282 	*(*int32)(unsafe.Pointer(bp + 8 + 80 + uintptr(k)*4)) = *(*int32)(unsafe.Pointer(bp + 176 + uintptr(i)*4)) + 1
  79283 __45:
  79284 	;
  79285 	*(*int32)(unsafe.Pointer(bp + 152 + uintptr(i)*4)) = usableSpace - (*MemPage)(unsafe.Pointer(p)).FnFree
  79286 	j = 0
  79287 __46:
  79288 	if !(j < int32((*MemPage)(unsafe.Pointer(p)).FnOverflow)) {
  79289 		goto __48
  79290 	}
  79291 	*(*int32)(unsafe.Pointer(bp + 152 + uintptr(i)*4)) += 2 + int32((*struct {
  79292 		f func(*libc.TLS, uintptr, uintptr) U16
  79293 	})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(p)).FxCellSize})).f(tls, p, *(*uintptr)(unsafe.Pointer(p + 40 + uintptr(j)*8))))
  79294 	goto __47
  79295 __47:
  79296 	j++
  79297 	goto __46
  79298 	goto __48
  79299 __48:
  79300 	;
  79301 	*(*int32)(unsafe.Pointer(bp + 196 + uintptr(i)*4)) = *(*int32)(unsafe.Pointer(bp + 176 + uintptr(i)*4))
  79302 	goto __42
  79303 __42:
  79304 	i++
  79305 	k++
  79306 	goto __41
  79307 	goto __43
  79308 __43:
  79309 	;
  79310 	k = nOld
  79311 	i = 0
  79312 __49:
  79313 	if !(i < k) {
  79314 		goto __51
  79315 	}
  79316 __52:
  79317 	if !(*(*int32)(unsafe.Pointer(bp + 152 + uintptr(i)*4)) > usableSpace) {
  79318 		goto __53
  79319 	}
  79320 	if !(i+1 >= k) {
  79321 		goto __54
  79322 	}
  79323 	k = i + 2
  79324 	if !(k > NB+2) {
  79325 		goto __55
  79326 	}
  79327 	*(*int32)(unsafe.Pointer(bp + 172)) = Xsqlite3CorruptError(tls, 76610)
  79328 	goto balance_cleanup
  79329 __55:
  79330 	;
  79331 	*(*int32)(unsafe.Pointer(bp + 152 + uintptr(k-1)*4)) = 0
  79332 	*(*int32)(unsafe.Pointer(bp + 196 + uintptr(k-1)*4)) = (*CellArray)(unsafe.Pointer(bp + 8)).FnCell
  79333 __54:
  79334 	;
  79335 	sz1 = 2 + int32(cachedCellSize(tls, bp+8, *(*int32)(unsafe.Pointer(bp + 196 + uintptr(i)*4))-1))
  79336 	*(*int32)(unsafe.Pointer(bp + 152 + uintptr(i)*4)) -= sz1
  79337 	if !!(leafData != 0) {
  79338 		goto __56
  79339 	}
  79340 	if !(*(*int32)(unsafe.Pointer(bp + 196 + uintptr(i)*4)) < (*CellArray)(unsafe.Pointer(bp+8)).FnCell) {
  79341 		goto __57
  79342 	}
  79343 	sz1 = 2 + int32(cachedCellSize(tls, bp+8, *(*int32)(unsafe.Pointer(bp + 196 + uintptr(i)*4))))
  79344 	goto __58
  79345 __57:
  79346 	sz1 = 0
  79347 __58:
  79348 	;
  79349 __56:
  79350 	;
  79351 	*(*int32)(unsafe.Pointer(bp + 152 + uintptr(i+1)*4)) += sz1
  79352 	*(*int32)(unsafe.Pointer(bp + 196 + uintptr(i)*4))--
  79353 	goto __52
  79354 __53:
  79355 	;
  79356 __59:
  79357 	if !(*(*int32)(unsafe.Pointer(bp + 196 + uintptr(i)*4)) < (*CellArray)(unsafe.Pointer(bp+8)).FnCell) {
  79358 		goto __60
  79359 	}
  79360 	sz1 = 2 + int32(cachedCellSize(tls, bp+8, *(*int32)(unsafe.Pointer(bp + 196 + uintptr(i)*4))))
  79361 	if !(*(*int32)(unsafe.Pointer(bp + 152 + uintptr(i)*4))+sz1 > usableSpace) {
  79362 		goto __61
  79363 	}
  79364 	goto __60
  79365 __61:
  79366 	;
  79367 	*(*int32)(unsafe.Pointer(bp + 152 + uintptr(i)*4)) += sz1
  79368 	*(*int32)(unsafe.Pointer(bp + 196 + uintptr(i)*4))++
  79369 	if !!(leafData != 0) {
  79370 		goto __62
  79371 	}
  79372 	if !(*(*int32)(unsafe.Pointer(bp + 196 + uintptr(i)*4)) < (*CellArray)(unsafe.Pointer(bp+8)).FnCell) {
  79373 		goto __63
  79374 	}
  79375 	sz1 = 2 + int32(cachedCellSize(tls, bp+8, *(*int32)(unsafe.Pointer(bp + 196 + uintptr(i)*4))))
  79376 	goto __64
  79377 __63:
  79378 	sz1 = 0
  79379 __64:
  79380 	;
  79381 __62:
  79382 	;
  79383 	*(*int32)(unsafe.Pointer(bp + 152 + uintptr(i+1)*4)) -= sz1
  79384 	goto __59
  79385 __60:
  79386 	;
  79387 	if !(*(*int32)(unsafe.Pointer(bp + 196 + uintptr(i)*4)) >= (*CellArray)(unsafe.Pointer(bp+8)).FnCell) {
  79388 		goto __65
  79389 	}
  79390 	k = i + 1
  79391 	goto __66
  79392 __65:
  79393 	if !(*(*int32)(unsafe.Pointer(bp + 196 + uintptr(i)*4)) <= func() int32 {
  79394 		if i > 0 {
  79395 			return *(*int32)(unsafe.Pointer(bp + 196 + uintptr(i-1)*4))
  79396 		}
  79397 		return 0
  79398 	}()) {
  79399 		goto __67
  79400 	}
  79401 	*(*int32)(unsafe.Pointer(bp + 172)) = Xsqlite3CorruptError(tls, 76643)
  79402 	goto balance_cleanup
  79403 __67:
  79404 	;
  79405 __66:
  79406 	;
  79407 	goto __50
  79408 __50:
  79409 	i++
  79410 	goto __49
  79411 	goto __51
  79412 __51:
  79413 	;
  79414 	i = k - 1
  79415 __68:
  79416 	if !(i > 0) {
  79417 		goto __70
  79418 	}
  79419 	szRight = *(*int32)(unsafe.Pointer(bp + 152 + uintptr(i)*4))
  79420 	szLeft = *(*int32)(unsafe.Pointer(bp + 152 + uintptr(i-1)*4))
  79421 
  79422 	r = *(*int32)(unsafe.Pointer(bp + 196 + uintptr(i-1)*4)) - 1
  79423 	d = r + 1 - leafData
  79424 	cachedCellSize(tls, bp+8, d)
  79425 __71:
  79426 	;
  79427 	szR = int32(cachedCellSize(tls, bp+8, r))
  79428 	szD = int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FszCell + uintptr(d)*2)))
  79429 	if !(szRight != 0 &&
  79430 		(bBulk != 0 || szRight+szD+2 > szLeft-(szR+func() int32 {
  79431 			if i == k-1 {
  79432 				return 0
  79433 			}
  79434 			return 2
  79435 		}()))) {
  79436 		goto __74
  79437 	}
  79438 	goto __73
  79439 __74:
  79440 	;
  79441 	szRight = szRight + (szD + 2)
  79442 	szLeft = szLeft - (szR + 2)
  79443 	*(*int32)(unsafe.Pointer(bp + 196 + uintptr(i-1)*4)) = r
  79444 	r--
  79445 	d--
  79446 	goto __72
  79447 __72:
  79448 	if r >= 0 {
  79449 		goto __71
  79450 	}
  79451 	goto __73
  79452 __73:
  79453 	;
  79454 	*(*int32)(unsafe.Pointer(bp + 152 + uintptr(i)*4)) = szRight
  79455 	*(*int32)(unsafe.Pointer(bp + 152 + uintptr(i-1)*4)) = szLeft
  79456 	if !(*(*int32)(unsafe.Pointer(bp + 196 + uintptr(i-1)*4)) <= func() int32 {
  79457 		if i > 1 {
  79458 			return *(*int32)(unsafe.Pointer(bp + 196 + uintptr(i-2)*4))
  79459 		}
  79460 		return 0
  79461 	}()) {
  79462 		goto __75
  79463 	}
  79464 	*(*int32)(unsafe.Pointer(bp + 172)) = Xsqlite3CorruptError(tls, 76687)
  79465 	goto balance_cleanup
  79466 __75:
  79467 	;
  79468 	goto __69
  79469 __69:
  79470 	i--
  79471 	goto __68
  79472 	goto __70
  79473 __70:
  79474 	;
  79475 	pageFlags = int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 112)))).FaData)))
  79476 	i = 0
  79477 __76:
  79478 	if !(i < k) {
  79479 		goto __78
  79480 	}
  79481 	if !(i < nOld) {
  79482 		goto __79
  79483 	}
  79484 	*(*uintptr)(unsafe.Pointer(bp + 256)) = libc.AssignPtrUintptr(bp+216+uintptr(i)*8, *(*uintptr)(unsafe.Pointer(bp + 112 + uintptr(i)*8)))
  79485 	*(*uintptr)(unsafe.Pointer(bp + 112 + uintptr(i)*8)) = uintptr(0)
  79486 	*(*int32)(unsafe.Pointer(bp + 172)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 256)))).FpDbPage)
  79487 	nNew++
  79488 	if !(Xsqlite3PagerPageRefcount(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 256)))).FpDbPage) != 1+libc.Bool32(i == iParentIdx-nxDiv) &&
  79489 		*(*int32)(unsafe.Pointer(bp + 172)) == SQLITE_OK) {
  79490 		goto __81
  79491 	}
  79492 	*(*int32)(unsafe.Pointer(bp + 172)) = Xsqlite3CorruptError(tls, 76720)
  79493 __81:
  79494 	;
  79495 	if !(*(*int32)(unsafe.Pointer(bp + 172)) != 0) {
  79496 		goto __82
  79497 	}
  79498 	goto balance_cleanup
  79499 __82:
  79500 	;
  79501 	goto __80
  79502 __79:
  79503 	;
  79504 	*(*int32)(unsafe.Pointer(bp + 172)) = allocateBtreePage(tls, pBt, bp+256, bp+264, func() uint32 {
  79505 		if bBulk != 0 {
  79506 			return uint32(1)
  79507 		}
  79508 		return *(*Pgno)(unsafe.Pointer(bp + 264))
  79509 	}(), uint8(0))
  79510 	if !(*(*int32)(unsafe.Pointer(bp + 172)) != 0) {
  79511 		goto __83
  79512 	}
  79513 	goto balance_cleanup
  79514 __83:
  79515 	;
  79516 	zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp + 256)), pageFlags)
  79517 	*(*uintptr)(unsafe.Pointer(bp + 216 + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(bp + 256))
  79518 	nNew++
  79519 	*(*int32)(unsafe.Pointer(bp + 176 + uintptr(i)*4)) = (*CellArray)(unsafe.Pointer(bp + 8)).FnCell
  79520 
  79521 	if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) {
  79522 		goto __84
  79523 	}
  79524 	ptrmapPut(tls, pBt, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 256)))).Fpgno, uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pParent)).Fpgno, bp+172)
  79525 	if !(*(*int32)(unsafe.Pointer(bp + 172)) != SQLITE_OK) {
  79526 		goto __85
  79527 	}
  79528 	goto balance_cleanup
  79529 __85:
  79530 	;
  79531 __84:
  79532 	;
  79533 __80:
  79534 	;
  79535 	goto __77
  79536 __77:
  79537 	i++
  79538 	goto __76
  79539 	goto __78
  79540 __78:
  79541 	;
  79542 	i = 0
  79543 __86:
  79544 	if !(i < nNew) {
  79545 		goto __88
  79546 	}
  79547 	*(*Pgno)(unsafe.Pointer(bp + 268 + uintptr(i)*4)) = (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216 + uintptr(i)*8)))).Fpgno
  79548 
  79549 	goto __87
  79550 __87:
  79551 	i++
  79552 	goto __86
  79553 	goto __88
  79554 __88:
  79555 	;
  79556 	i = 0
  79557 __89:
  79558 	if !(i < nNew-1) {
  79559 		goto __91
  79560 	}
  79561 	iB = i
  79562 	j = i + 1
  79563 __92:
  79564 	if !(j < nNew) {
  79565 		goto __94
  79566 	}
  79567 	if !((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216 + uintptr(j)*8)))).Fpgno < (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216 + uintptr(iB)*8)))).Fpgno) {
  79568 		goto __95
  79569 	}
  79570 	iB = j
  79571 __95:
  79572 	;
  79573 	goto __93
  79574 __93:
  79575 	j++
  79576 	goto __92
  79577 	goto __94
  79578 __94:
  79579 	;
  79580 	if !(iB != i) {
  79581 		goto __96
  79582 	}
  79583 	pgnoA = (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216 + uintptr(i)*8)))).Fpgno
  79584 	pgnoB = (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216 + uintptr(iB)*8)))).Fpgno
  79585 	pgnoTemp = U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize + U32(1)
  79586 	fgA = (*DbPage)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216 + uintptr(i)*8)))).FpDbPage)).Fflags
  79587 	fgB = (*DbPage)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216 + uintptr(iB)*8)))).FpDbPage)).Fflags
  79588 	Xsqlite3PagerRekey(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216 + uintptr(i)*8)))).FpDbPage, pgnoTemp, fgB)
  79589 	Xsqlite3PagerRekey(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216 + uintptr(iB)*8)))).FpDbPage, pgnoA, fgA)
  79590 	Xsqlite3PagerRekey(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216 + uintptr(i)*8)))).FpDbPage, pgnoB, fgB)
  79591 	(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216 + uintptr(i)*8)))).Fpgno = pgnoB
  79592 	(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216 + uintptr(iB)*8)))).Fpgno = pgnoA
  79593 __96:
  79594 	;
  79595 	goto __90
  79596 __90:
  79597 	i++
  79598 	goto __89
  79599 	goto __91
  79600 __91:
  79601 	;
  79602 	Xsqlite3Put4byte(tls, pRight, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216 + uintptr(nNew-1)*8)))).Fpgno)
  79603 
  79604 	if !(pageFlags&PTF_LEAF == 0 && nOld != nNew) {
  79605 		goto __97
  79606 	}
  79607 	pOld1 = *(*uintptr)(unsafe.Pointer(func() uintptr {
  79608 		if nNew > nOld {
  79609 			return bp + 216
  79610 		}
  79611 		return bp + 112
  79612 	}() + uintptr(nOld-1)*8))
  79613 	libc.Xmemcpy(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216 + uintptr(nNew-1)*8)))).FaData+8, (*MemPage)(unsafe.Pointer(pOld1)).FaData+8, uint64(4))
  79614 __97:
  79615 	;
  79616 	if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) {
  79617 		goto __98
  79618 	}
  79619 	pNew1 = libc.AssignUintptr(&pOld2, *(*uintptr)(unsafe.Pointer(bp + 216)))
  79620 	cntOldNext = int32((*MemPage)(unsafe.Pointer(pNew1)).FnCell) + int32((*MemPage)(unsafe.Pointer(pNew1)).FnOverflow)
  79621 	iNew = 0
  79622 	iOld = 0
  79623 
  79624 	i = 0
  79625 __99:
  79626 	if !(i < (*CellArray)(unsafe.Pointer(bp+8)).FnCell) {
  79627 		goto __101
  79628 	}
  79629 	pCell = *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FapCell + uintptr(i)*8))
  79630 __102:
  79631 	if !(i == cntOldNext) {
  79632 		goto __103
  79633 	}
  79634 	iOld++
  79635 
  79636 	if iOld < nNew {
  79637 		pOld2 = *(*uintptr)(unsafe.Pointer(bp + 216 + uintptr(iOld)*8))
  79638 	} else {
  79639 		pOld2 = *(*uintptr)(unsafe.Pointer(bp + 112 + uintptr(iOld)*8))
  79640 	}
  79641 	cntOldNext = cntOldNext + (int32((*MemPage)(unsafe.Pointer(pOld2)).FnCell) + int32((*MemPage)(unsafe.Pointer(pOld2)).FnOverflow) + libc.BoolInt32(!(leafData != 0)))
  79642 	goto __102
  79643 __103:
  79644 	;
  79645 	if !(i == *(*int32)(unsafe.Pointer(bp + 196 + uintptr(iNew)*4))) {
  79646 		goto __104
  79647 	}
  79648 	pNew1 = *(*uintptr)(unsafe.Pointer(bp + 216 + uintptr(libc.PreIncInt32(&iNew, 1))*8))
  79649 	if !!(leafData != 0) {
  79650 		goto __105
  79651 	}
  79652 	goto __100
  79653 __105:
  79654 	;
  79655 __104:
  79656 	;
  79657 	if !(iOld >= nNew ||
  79658 		(*MemPage)(unsafe.Pointer(pNew1)).Fpgno != *(*Pgno)(unsafe.Pointer(bp + 268 + uintptr(iOld)*4)) ||
  79659 		!(Uptr(pCell) >= Uptr((*MemPage)(unsafe.Pointer(pOld2)).FaData) && Uptr(pCell) < Uptr((*MemPage)(unsafe.Pointer(pOld2)).FaDataEnd))) {
  79660 		goto __106
  79661 	}
  79662 	if !!(leafCorrection != 0) {
  79663 		goto __107
  79664 	}
  79665 	ptrmapPut(tls, pBt, Xsqlite3Get4byte(tls, pCell), uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pNew1)).Fpgno, bp+172)
  79666 __107:
  79667 	;
  79668 	if !(int32(cachedCellSize(tls, bp+8, i)) > int32((*MemPage)(unsafe.Pointer(pNew1)).FminLocal)) {
  79669 		goto __108
  79670 	}
  79671 	ptrmapPutOvflPtr(tls, pNew1, pOld2, pCell, bp+172)
  79672 __108:
  79673 	;
  79674 	if !(*(*int32)(unsafe.Pointer(bp + 172)) != 0) {
  79675 		goto __109
  79676 	}
  79677 	goto balance_cleanup
  79678 __109:
  79679 	;
  79680 __106:
  79681 	;
  79682 	goto __100
  79683 __100:
  79684 	i++
  79685 	goto __99
  79686 	goto __101
  79687 __101:
  79688 	;
  79689 __98:
  79690 	;
  79691 	i = 0
  79692 __110:
  79693 	if !(i < nNew-1) {
  79694 		goto __112
  79695 	}
  79696 	pNew2 = *(*uintptr)(unsafe.Pointer(bp + 216 + uintptr(i)*8))
  79697 	j = *(*int32)(unsafe.Pointer(bp + 196 + uintptr(i)*4))
  79698 
  79699 	pCell1 = *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FapCell + uintptr(j)*8))
  79700 	sz2 = int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FszCell + uintptr(j)*2))) + int32(leafCorrection)
  79701 	pTemp1 = aOvflSpace + uintptr(iOvflSpace)
  79702 	if !!(int32((*MemPage)(unsafe.Pointer(pNew2)).Fleaf) != 0) {
  79703 		goto __113
  79704 	}
  79705 	libc.Xmemcpy(tls, (*MemPage)(unsafe.Pointer(pNew2)).FaData+8, pCell1, uint64(4))
  79706 	goto __114
  79707 __113:
  79708 	if !(leafData != 0) {
  79709 		goto __115
  79710 	}
  79711 	j--
  79712 	(*struct {
  79713 		f func(*libc.TLS, uintptr, uintptr, uintptr)
  79714 	})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pNew2)).FxParseCell})).f(tls, pNew2, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FapCell + uintptr(j)*8)), bp+288)
  79715 	pCell1 = pTemp1
  79716 	sz2 = 4 + Xsqlite3PutVarint(tls, pCell1+4, uint64((*CellInfo)(unsafe.Pointer(bp+288)).FnKey))
  79717 	pTemp1 = uintptr(0)
  79718 	goto __116
  79719 __115:
  79720 	pCell1 -= uintptr(4)
  79721 
  79722 	if !(int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+8)).FszCell + uintptr(j)*2))) == 4) {
  79723 		goto __117
  79724 	}
  79725 
  79726 	sz2 = int32((*struct {
  79727 		f func(*libc.TLS, uintptr, uintptr) U16
  79728 	})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pParent)).FxCellSize})).f(tls, pParent, pCell1))
  79729 __117:
  79730 	;
  79731 __116:
  79732 	;
  79733 __114:
  79734 	;
  79735 	iOvflSpace = iOvflSpace + sz2
  79736 
  79737 	k = 0
  79738 __118:
  79739 	if !(*(*int32)(unsafe.Pointer(bp + 8 + 80 + uintptr(k)*4)) <= j && k < NB*2) {
  79740 		goto __120
  79741 	}
  79742 	goto __119
  79743 __119:
  79744 	k++
  79745 	goto __118
  79746 	goto __120
  79747 __120:
  79748 	;
  79749 	pSrcEnd = *(*uintptr)(unsafe.Pointer(bp + 8 + 32 + uintptr(k)*8))
  79750 	if !(Uptr(pSrcEnd) >= Uptr(pCell1) && Uptr(pSrcEnd) < Uptr(pCell1+uintptr(sz2))) {
  79751 		goto __121
  79752 	}
  79753 	*(*int32)(unsafe.Pointer(bp + 172)) = Xsqlite3CorruptError(tls, 76920)
  79754 	goto balance_cleanup
  79755 __121:
  79756 	;
  79757 	*(*int32)(unsafe.Pointer(bp + 172)) = insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*MemPage)(unsafe.Pointer(pNew2)).Fpgno)
  79758 	if !(*(*int32)(unsafe.Pointer(bp + 172)) != SQLITE_OK) {
  79759 		goto __122
  79760 	}
  79761 	goto balance_cleanup
  79762 __122:
  79763 	;
  79764 	goto __111
  79765 __111:
  79766 	i++
  79767 	goto __110
  79768 	goto __112
  79769 __112:
  79770 	;
  79771 	i = 1 - nNew
  79772 __123:
  79773 	if !(i < nNew) {
  79774 		goto __125
  79775 	}
  79776 	if i < 0 {
  79777 		iPg = -i
  79778 	} else {
  79779 		iPg = i
  79780 	}
  79781 
  79782 	if !(*(*U8)(unsafe.Pointer(bp + uintptr(iPg))) != 0) {
  79783 		goto __126
  79784 	}
  79785 	goto __124
  79786 __126:
  79787 	;
  79788 	if !(i >= 0 ||
  79789 		*(*int32)(unsafe.Pointer(bp + 176 + uintptr(iPg-1)*4)) >= *(*int32)(unsafe.Pointer(bp + 196 + uintptr(iPg-1)*4))) {
  79790 		goto __127
  79791 	}
  79792 
  79793 	if !(iPg == 0) {
  79794 		goto __128
  79795 	}
  79796 	iNew1 = libc.AssignInt32(&iOld1, 0)
  79797 	nNewCell = *(*int32)(unsafe.Pointer(bp + 196))
  79798 	goto __129
  79799 __128:
  79800 	if iPg < nOld {
  79801 		iOld1 = *(*int32)(unsafe.Pointer(bp + 176 + uintptr(iPg-1)*4)) + libc.BoolInt32(!(leafData != 0))
  79802 	} else {
  79803 		iOld1 = (*CellArray)(unsafe.Pointer(bp + 8)).FnCell
  79804 	}
  79805 	iNew1 = *(*int32)(unsafe.Pointer(bp + 196 + uintptr(iPg-1)*4)) + libc.BoolInt32(!(leafData != 0))
  79806 	nNewCell = *(*int32)(unsafe.Pointer(bp + 196 + uintptr(iPg)*4)) - iNew1
  79807 __129:
  79808 	;
  79809 	*(*int32)(unsafe.Pointer(bp + 172)) = editPage(tls, *(*uintptr)(unsafe.Pointer(bp + 216 + uintptr(iPg)*8)), iOld1, iNew1, nNewCell, bp+8)
  79810 	if !(*(*int32)(unsafe.Pointer(bp + 172)) != 0) {
  79811 		goto __130
  79812 	}
  79813 	goto balance_cleanup
  79814 __130:
  79815 	;
  79816 	*(*U8)(unsafe.Pointer(bp + uintptr(iPg)))++
  79817 	(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216 + uintptr(iPg)*8)))).FnFree = usableSpace - *(*int32)(unsafe.Pointer(bp + 152 + uintptr(iPg)*4))
  79818 
  79819 __127:
  79820 	;
  79821 	goto __124
  79822 __124:
  79823 	i++
  79824 	goto __123
  79825 	goto __125
  79826 __125:
  79827 	;
  79828 	if !(isRoot != 0 && int32((*MemPage)(unsafe.Pointer(pParent)).FnCell) == 0 && int32((*MemPage)(unsafe.Pointer(pParent)).FhdrOffset) <= (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FnFree) {
  79829 		goto __131
  79830 	}
  79831 
  79832 	*(*int32)(unsafe.Pointer(bp + 172)) = defragmentPage(tls, *(*uintptr)(unsafe.Pointer(bp + 216)), -1)
  79833 
  79834 	copyNodeContent(tls, *(*uintptr)(unsafe.Pointer(bp + 216)), pParent, bp+172)
  79835 	freePage(tls, *(*uintptr)(unsafe.Pointer(bp + 216)), bp+172)
  79836 	goto __132
  79837 __131:
  79838 	if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 && !(leafCorrection != 0)) {
  79839 		goto __133
  79840 	}
  79841 
  79842 	i = 0
  79843 __134:
  79844 	if !(i < nNew) {
  79845 		goto __136
  79846 	}
  79847 	key = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216 + uintptr(i)*8)))).FaData+8)
  79848 	ptrmapPut(tls, pBt, key, uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216 + uintptr(i)*8)))).Fpgno, bp+172)
  79849 	goto __135
  79850 __135:
  79851 	i++
  79852 	goto __134
  79853 	goto __136
  79854 __136:
  79855 	;
  79856 __133:
  79857 	;
  79858 __132:
  79859 	;
  79860 	i = nNew
  79861 __137:
  79862 	if !(i < nOld) {
  79863 		goto __139
  79864 	}
  79865 	freePage(tls, *(*uintptr)(unsafe.Pointer(bp + 112 + uintptr(i)*8)), bp+172)
  79866 	goto __138
  79867 __138:
  79868 	i++
  79869 	goto __137
  79870 	goto __139
  79871 __139:
  79872 	;
  79873 balance_cleanup:
  79874 	Xsqlite3DbFree(tls, uintptr(0), (*CellArray)(unsafe.Pointer(bp+8)).FapCell)
  79875 	i = 0
  79876 __140:
  79877 	if !(i < nOld) {
  79878 		goto __142
  79879 	}
  79880 	releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 112 + uintptr(i)*8)))
  79881 	goto __141
  79882 __141:
  79883 	i++
  79884 	goto __140
  79885 	goto __142
  79886 __142:
  79887 	;
  79888 	i = 0
  79889 __143:
  79890 	if !(i < nNew) {
  79891 		goto __145
  79892 	}
  79893 	releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 216 + uintptr(i)*8)))
  79894 	goto __144
  79895 __144:
  79896 	i++
  79897 	goto __143
  79898 	goto __145
  79899 __145:
  79900 	;
  79901 	return *(*int32)(unsafe.Pointer(bp + 172))
  79902 }
  79903 
  79904 func balance_deeper(tls *libc.TLS, pRoot uintptr, ppChild uintptr) int32 {
  79905 	bp := tls.Alloc(16)
  79906 	defer tls.Free(16)
  79907 
  79908 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
  79909 	*(*Pgno)(unsafe.Pointer(bp + 8)) = Pgno(0)
  79910 	var pBt uintptr = (*MemPage)(unsafe.Pointer(pRoot)).FpBt
  79911 
  79912 	*(*int32)(unsafe.Pointer(bp + 12)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pRoot)).FpDbPage)
  79913 	if *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK {
  79914 		*(*int32)(unsafe.Pointer(bp + 12)) = allocateBtreePage(tls, pBt, bp, bp+8, (*MemPage)(unsafe.Pointer(pRoot)).Fpgno, uint8(0))
  79915 		copyNodeContent(tls, pRoot, *(*uintptr)(unsafe.Pointer(bp)), bp+12)
  79916 		if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 {
  79917 			ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8)), uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pRoot)).Fpgno, bp+12)
  79918 		}
  79919 	}
  79920 	if *(*int32)(unsafe.Pointer(bp + 12)) != 0 {
  79921 		*(*uintptr)(unsafe.Pointer(ppChild)) = uintptr(0)
  79922 		releasePage(tls, *(*uintptr)(unsafe.Pointer(bp)))
  79923 		return *(*int32)(unsafe.Pointer(bp + 12))
  79924 	}
  79925 
  79926 	libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp))+28, pRoot+28,
  79927 		uint64((*MemPage)(unsafe.Pointer(pRoot)).FnOverflow)*uint64(unsafe.Sizeof(U16(0))))
  79928 	libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp))+40, pRoot+40,
  79929 		uint64((*MemPage)(unsafe.Pointer(pRoot)).FnOverflow)*uint64(unsafe.Sizeof(uintptr(0))))
  79930 	(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnOverflow = (*MemPage)(unsafe.Pointer(pRoot)).FnOverflow
  79931 
  79932 	zeroPage(tls, pRoot, int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData)))&libc.CplInt32(PTF_LEAF))
  79933 	Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(pRoot)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pRoot)).FhdrOffset)+8), *(*Pgno)(unsafe.Pointer(bp + 8)))
  79934 
  79935 	*(*uintptr)(unsafe.Pointer(ppChild)) = *(*uintptr)(unsafe.Pointer(bp))
  79936 	return SQLITE_OK
  79937 }
  79938 
  79939 func anotherValidCursor(tls *libc.TLS, pCur uintptr) int32 {
  79940 	var pOther uintptr
  79941 	for pOther = (*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FpCursor; pOther != 0; pOther = (*BtCursor)(unsafe.Pointer(pOther)).FpNext {
  79942 		if pOther != pCur &&
  79943 			int32((*BtCursor)(unsafe.Pointer(pOther)).FeState) == CURSOR_VALID &&
  79944 			(*BtCursor)(unsafe.Pointer(pOther)).FpPage == (*BtCursor)(unsafe.Pointer(pCur)).FpPage {
  79945 			return Xsqlite3CorruptError(tls, 77150)
  79946 		}
  79947 	}
  79948 	return SQLITE_OK
  79949 }
  79950 
  79951 func balance(tls *libc.TLS, pCur uintptr) int32 {
  79952 	bp := tls.Alloc(13)
  79953 	defer tls.Free(13)
  79954 
  79955 	var rc int32 = SQLITE_OK
  79956 
  79957 	var pFree uintptr = uintptr(0)
  79958 
  79959 	for __ccgo := true; __ccgo; __ccgo = rc == SQLITE_OK {
  79960 		var iPage int32
  79961 		var pPage uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
  79962 
  79963 		if (*MemPage)(unsafe.Pointer(pPage)).FnFree < 0 && btreeComputeFreeSpace(tls, pPage) != 0 {
  79964 			break
  79965 		}
  79966 		if int32((*MemPage)(unsafe.Pointer(pPage)).FnOverflow) == 0 && (*MemPage)(unsafe.Pointer(pPage)).FnFree*3 <= int32((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize)*2 {
  79967 			break
  79968 		} else if libc.AssignInt32(&iPage, int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage)) == 0 {
  79969 			if (*MemPage)(unsafe.Pointer(pPage)).FnOverflow != 0 && libc.AssignInt32(&rc, anotherValidCursor(tls, pCur)) == SQLITE_OK {
  79970 				rc = balance_deeper(tls, pPage, pCur+144+1*8)
  79971 				if rc == SQLITE_OK {
  79972 					(*BtCursor)(unsafe.Pointer(pCur)).FiPage = int8(1)
  79973 					(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(0)
  79974 					*(*U16)(unsafe.Pointer(pCur + 88)) = U16(0)
  79975 					*(*uintptr)(unsafe.Pointer(pCur + 144)) = pPage
  79976 					(*BtCursor)(unsafe.Pointer(pCur)).FpPage = *(*uintptr)(unsafe.Pointer(pCur + 144 + 1*8))
  79977 
  79978 				}
  79979 			} else {
  79980 				break
  79981 			}
  79982 		} else if Xsqlite3PagerPageRefcount(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage) > 1 {
  79983 			rc = Xsqlite3CorruptError(tls, 77210)
  79984 		} else {
  79985 			var pParent uintptr = *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr(iPage-1)*8))
  79986 			var iIdx int32 = int32(*(*U16)(unsafe.Pointer(pCur + 88 + uintptr(iPage-1)*2)))
  79987 
  79988 			rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pParent)).FpDbPage)
  79989 			if rc == SQLITE_OK && (*MemPage)(unsafe.Pointer(pParent)).FnFree < 0 {
  79990 				rc = btreeComputeFreeSpace(tls, pParent)
  79991 			}
  79992 			if rc == SQLITE_OK {
  79993 				if (*MemPage)(unsafe.Pointer(pPage)).FintKeyLeaf != 0 &&
  79994 					int32((*MemPage)(unsafe.Pointer(pPage)).FnOverflow) == 1 &&
  79995 					int32(*(*U16)(unsafe.Pointer(pPage + 28))) == int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) &&
  79996 					(*MemPage)(unsafe.Pointer(pParent)).Fpgno != Pgno(1) &&
  79997 					int32((*MemPage)(unsafe.Pointer(pParent)).FnCell) == iIdx {
  79998 					rc = balance_quick(tls, pParent, pPage, bp)
  79999 				} else {
  80000 					var pSpace uintptr = Xsqlite3PageMalloc(tls, int32((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FpageSize))
  80001 					rc = balance_nonroot(tls, pParent, iIdx, pSpace, libc.Bool32(iPage == 1),
  80002 						int32((*BtCursor)(unsafe.Pointer(pCur)).Fhints)&BTREE_BULKLOAD)
  80003 					if pFree != 0 {
  80004 						Xsqlite3PageFree(tls, pFree)
  80005 					}
  80006 
  80007 					pFree = pSpace
  80008 				}
  80009 			}
  80010 
  80011 			(*MemPage)(unsafe.Pointer(pPage)).FnOverflow = U8(0)
  80012 
  80013 			releasePage(tls, pPage)
  80014 			(*BtCursor)(unsafe.Pointer(pCur)).FiPage--
  80015 
  80016 			(*BtCursor)(unsafe.Pointer(pCur)).FpPage = *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FiPage)*8))
  80017 		}
  80018 	}
  80019 
  80020 	if pFree != 0 {
  80021 		Xsqlite3PageFree(tls, pFree)
  80022 	}
  80023 	return rc
  80024 }
  80025 
  80026 func btreeOverwriteContent(tls *libc.TLS, pPage uintptr, pDest uintptr, pX uintptr, iOffset int32, iAmt int32) int32 {
  80027 	var nData int32 = (*BtreePayload)(unsafe.Pointer(pX)).FnData - iOffset
  80028 	if nData <= 0 {
  80029 		var i int32
  80030 		for i = 0; i < iAmt && int32(*(*U8)(unsafe.Pointer(pDest + uintptr(i)))) == 0; i++ {
  80031 		}
  80032 		if i < iAmt {
  80033 			var rc int32 = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage)
  80034 			if rc != 0 {
  80035 				return rc
  80036 			}
  80037 			libc.Xmemset(tls, pDest+uintptr(i), 0, uint64(iAmt-i))
  80038 		}
  80039 	} else {
  80040 		if nData < iAmt {
  80041 			var rc int32 = btreeOverwriteContent(tls, pPage, pDest+uintptr(nData), pX, iOffset+nData,
  80042 				iAmt-nData)
  80043 			if rc != 0 {
  80044 				return rc
  80045 			}
  80046 			iAmt = nData
  80047 		}
  80048 		if libc.Xmemcmp(tls, pDest, (*BtreePayload)(unsafe.Pointer(pX)).FpData+uintptr(iOffset), uint64(iAmt)) != 0 {
  80049 			var rc int32 = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage)
  80050 			if rc != 0 {
  80051 				return rc
  80052 			}
  80053 
  80054 			libc.Xmemmove(tls, pDest, (*BtreePayload)(unsafe.Pointer(pX)).FpData+uintptr(iOffset), uint64(iAmt))
  80055 		}
  80056 	}
  80057 	return SQLITE_OK
  80058 }
  80059 
  80060 func btreeOverwriteOverflowCell(tls *libc.TLS, pCur uintptr, pX uintptr) int32 {
  80061 	bp := tls.Alloc(8)
  80062 	defer tls.Free(8)
  80063 
  80064 	var iOffset int32
  80065 	var nTotal int32 = (*BtreePayload)(unsafe.Pointer(pX)).FnData + (*BtreePayload)(unsafe.Pointer(pX)).FnZero
  80066 	var rc int32
  80067 	*(*uintptr)(unsafe.Pointer(bp)) = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
  80068 	var pBt uintptr
  80069 	var ovflPgno Pgno
  80070 	var ovflPageSize U32
  80071 
  80072 	rc = btreeOverwriteContent(tls, *(*uintptr)(unsafe.Pointer(bp)), (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload, pX,
  80073 		0, int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal))
  80074 	if rc != 0 {
  80075 		return rc
  80076 	}
  80077 
  80078 	iOffset = int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal)
  80079 
  80080 	ovflPgno = Xsqlite3Get4byte(tls, (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload+uintptr(iOffset))
  80081 	pBt = (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpBt
  80082 	ovflPageSize = (*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(4)
  80083 	for __ccgo := true; __ccgo; __ccgo = iOffset < nTotal {
  80084 		rc = btreeGetPage(tls, pBt, ovflPgno, bp, 0)
  80085 		if rc != 0 {
  80086 			return rc
  80087 		}
  80088 		if Xsqlite3PagerPageRefcount(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != 1 || (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FisInit != 0 {
  80089 			rc = Xsqlite3CorruptError(tls, 77374)
  80090 		} else {
  80091 			if U32(iOffset)+ovflPageSize < U32(nTotal) {
  80092 				ovflPgno = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData)
  80093 			} else {
  80094 				ovflPageSize = U32(nTotal - iOffset)
  80095 			}
  80096 			rc = btreeOverwriteContent(tls, *(*uintptr)(unsafe.Pointer(bp)), (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+uintptr(4), pX,
  80097 				iOffset, int32(ovflPageSize))
  80098 		}
  80099 		Xsqlite3PagerUnref(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage)
  80100 		if rc != 0 {
  80101 			return rc
  80102 		}
  80103 		iOffset = int32(U32(iOffset) + ovflPageSize)
  80104 	}
  80105 	return SQLITE_OK
  80106 }
  80107 
  80108 func btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) int32 {
  80109 	var nTotal int32 = (*BtreePayload)(unsafe.Pointer(pX)).FnData + (*BtreePayload)(unsafe.Pointer(pX)).FnZero
  80110 	var pPage uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
  80111 
  80112 	if (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload+uintptr((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) > (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd ||
  80113 		(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload < (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*MemPage)(unsafe.Pointer(pPage)).FcellOffset) {
  80114 		return Xsqlite3CorruptError(tls, 77402)
  80115 	}
  80116 	if int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal {
  80117 		return btreeOverwriteContent(tls, pPage, (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload, pX,
  80118 			0, int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal))
  80119 	} else {
  80120 		return btreeOverwriteOverflowCell(tls, pCur, pX)
  80121 	}
  80122 	return int32(0)
  80123 }
  80124 
  80125 // Insert a new record into the BTree.  The content of the new record
  80126 // is described by the pX object.  The pCur cursor is used only to
  80127 // define what table the record should be inserted into, and is left
  80128 // pointing at a random location.
  80129 //
  80130 // For a table btree (used for rowid tables), only the pX.nKey value of
  80131 // the key is used. The pX.pKey value must be NULL.  The pX.nKey is the
  80132 // rowid or INTEGER PRIMARY KEY of the row.  The pX.nData,pData,nZero fields
  80133 // hold the content of the row.
  80134 //
  80135 // For an index btree (used for indexes and WITHOUT ROWID tables), the
  80136 // key is an arbitrary byte sequence stored in pX.pKey,nKey.  The
  80137 // pX.pData,nData,nZero fields must be zero.
  80138 //
  80139 // If the seekResult parameter is non-zero, then a successful call to
  80140 // sqlite3BtreeIndexMoveto() to seek cursor pCur to (pKey,nKey) has already
  80141 // been performed.  In other words, if seekResult!=0 then the cursor
  80142 // is currently pointing to a cell that will be adjacent to the cell
  80143 // to be inserted.  If seekResult<0 then pCur points to a cell that is
  80144 // smaller then (pKey,nKey).  If seekResult>0 then pCur points to a cell
  80145 // that is larger than (pKey,nKey).
  80146 //
  80147 // If seekResult==0, that means pCur is pointing at some unknown location.
  80148 // In that case, this routine must seek the cursor to the correct insertion
  80149 // point for (pKey,nKey) before doing the insertion.  For index btrees,
  80150 // if pX->nMem is non-zero, then pX->aMem contains pointers to the unpacked
  80151 // key values and pX->aMem can be used instead of pX->pKey to avoid having
  80152 // to decode the key.
  80153 func Xsqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, seekResult int32) int32 {
  80154 	bp := tls.Alloc(152)
  80155 	defer tls.Free(152)
  80156 
  80157 	var idx int32
  80158 	var pPage uintptr
  80159 	var p uintptr
  80160 	var oldCell uintptr
  80161 	var newCell uintptr
  80162 
  80163 	var ovfl Pgno
  80164 
  80165 	*(*int32)(unsafe.Pointer(bp)) = seekResult
  80166 	*(*int32)(unsafe.Pointer(bp + 124)) = 0
  80167 	p = (*BtCursor)(unsafe.Pointer(pCur)).FpBtree
  80168 	newCell = uintptr(0)
  80169 
  80170 	if !(int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags)&BTCF_Multiple != 0) {
  80171 		goto __1
  80172 	}
  80173 	*(*int32)(unsafe.Pointer(bp + 120)) = saveAllCursors(tls, (*Btree)(unsafe.Pointer(p)).FpBt, (*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot, pCur)
  80174 	if !(*(*int32)(unsafe.Pointer(bp + 120)) != 0) {
  80175 		goto __2
  80176 	}
  80177 	return *(*int32)(unsafe.Pointer(bp + 120))
  80178 __2:
  80179 	;
  80180 	if !(*(*int32)(unsafe.Pointer(bp)) != 0 && int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) < 0) {
  80181 		goto __3
  80182 	}
  80183 
  80184 	return Xsqlite3CorruptError(tls, 77483)
  80185 __3:
  80186 	;
  80187 __1:
  80188 	;
  80189 	if !(int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) >= CURSOR_REQUIRESEEK) {
  80190 		goto __4
  80191 	}
  80192 
  80193 	*(*int32)(unsafe.Pointer(bp + 120)) = moveToRoot(tls, pCur)
  80194 	if !(*(*int32)(unsafe.Pointer(bp + 120)) != 0 && *(*int32)(unsafe.Pointer(bp + 120)) != SQLITE_EMPTY) {
  80195 		goto __5
  80196 	}
  80197 	return *(*int32)(unsafe.Pointer(bp + 120))
  80198 __5:
  80199 	;
  80200 __4:
  80201 	;
  80202 	if !((*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0)) {
  80203 		goto __6
  80204 	}
  80205 
  80206 	if !((*Btree)(unsafe.Pointer(p)).FhasIncrblobCur != 0) {
  80207 		goto __8
  80208 	}
  80209 	invalidateIncrblobCursors(tls, p, (*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot, (*BtreePayload)(unsafe.Pointer(pX)).FnKey, 0)
  80210 __8:
  80211 	;
  80212 	if !(int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags)&BTCF_ValidNKey != 0 && (*BtreePayload)(unsafe.Pointer(pX)).FnKey == (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey) {
  80213 		goto __9
  80214 	}
  80215 
  80216 	if !(int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize) != 0 &&
  80217 		(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnPayload == U32((*BtreePayload)(unsafe.Pointer(pX)).FnData)+U32((*BtreePayload)(unsafe.Pointer(pX)).FnZero)) {
  80218 		goto __11
  80219 	}
  80220 
  80221 	return btreeOverwriteCell(tls, pCur, pX)
  80222 __11:
  80223 	;
  80224 	goto __10
  80225 __9:
  80226 	if !(*(*int32)(unsafe.Pointer(bp)) == 0) {
  80227 		goto __12
  80228 	}
  80229 
  80230 	*(*int32)(unsafe.Pointer(bp + 120)) = Xsqlite3BtreeTableMoveto(tls, pCur, (*BtreePayload)(unsafe.Pointer(pX)).FnKey,
  80231 		libc.Bool32(flags&BTREE_APPEND != 0), bp)
  80232 	if !(*(*int32)(unsafe.Pointer(bp + 120)) != 0) {
  80233 		goto __13
  80234 	}
  80235 	return *(*int32)(unsafe.Pointer(bp + 120))
  80236 __13:
  80237 	;
  80238 __12:
  80239 	;
  80240 __10:
  80241 	;
  80242 	goto __7
  80243 __6:
  80244 	;
  80245 	if !(*(*int32)(unsafe.Pointer(bp)) == 0 && flags&BTREE_SAVEPOSITION == 0) {
  80246 		goto __14
  80247 	}
  80248 	if !((*BtreePayload)(unsafe.Pointer(pX)).FnMem != 0) {
  80249 		goto __15
  80250 	}
  80251 	(*UnpackedRecord)(unsafe.Pointer(bp + 8)).FpKeyInfo = (*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo
  80252 	(*UnpackedRecord)(unsafe.Pointer(bp + 8)).FaMem = (*BtreePayload)(unsafe.Pointer(pX)).FaMem
  80253 	(*UnpackedRecord)(unsafe.Pointer(bp + 8)).FnField = (*BtreePayload)(unsafe.Pointer(pX)).FnMem
  80254 	(*UnpackedRecord)(unsafe.Pointer(bp + 8)).Fdefault_rc = int8(0)
  80255 	(*UnpackedRecord)(unsafe.Pointer(bp + 8)).FeqSeen = U8(0)
  80256 	*(*int32)(unsafe.Pointer(bp + 120)) = Xsqlite3BtreeIndexMoveto(tls, pCur, bp+8, bp)
  80257 	goto __16
  80258 __15:
  80259 	*(*int32)(unsafe.Pointer(bp + 120)) = btreeMoveto(tls, pCur, (*BtreePayload)(unsafe.Pointer(pX)).FpKey, (*BtreePayload)(unsafe.Pointer(pX)).FnKey,
  80260 		libc.Bool32(flags&BTREE_APPEND != 0), bp)
  80261 __16:
  80262 	;
  80263 	if !(*(*int32)(unsafe.Pointer(bp + 120)) != 0) {
  80264 		goto __17
  80265 	}
  80266 	return *(*int32)(unsafe.Pointer(bp + 120))
  80267 __17:
  80268 	;
  80269 __14:
  80270 	;
  80271 	if !(*(*int32)(unsafe.Pointer(bp)) == 0) {
  80272 		goto __18
  80273 	}
  80274 	getCellInfo(tls, pCur)
  80275 	if !((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey == (*BtreePayload)(unsafe.Pointer(pX)).FnKey) {
  80276 		goto __19
  80277 	}
  80278 	(*BtreePayload)(unsafe.Pointer(bp + 48)).FpData = (*BtreePayload)(unsafe.Pointer(pX)).FpKey
  80279 	(*BtreePayload)(unsafe.Pointer(bp + 48)).FnData = int32((*BtreePayload)(unsafe.Pointer(pX)).FnKey)
  80280 	(*BtreePayload)(unsafe.Pointer(bp + 48)).FnZero = 0
  80281 	return btreeOverwriteCell(tls, pCur, bp+48)
  80282 __19:
  80283 	;
  80284 __18:
  80285 	;
  80286 __7:
  80287 	;
  80288 	pPage = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
  80289 
  80290 	if !((*MemPage)(unsafe.Pointer(pPage)).FnFree < 0) {
  80291 		goto __20
  80292 	}
  80293 	if !(int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) > CURSOR_INVALID) {
  80294 		goto __21
  80295 	}
  80296 
  80297 	*(*int32)(unsafe.Pointer(bp + 120)) = Xsqlite3CorruptError(tls, 77606)
  80298 	goto __22
  80299 __21:
  80300 	*(*int32)(unsafe.Pointer(bp + 120)) = btreeComputeFreeSpace(tls, pPage)
  80301 __22:
  80302 	;
  80303 	if !(*(*int32)(unsafe.Pointer(bp + 120)) != 0) {
  80304 		goto __23
  80305 	}
  80306 	return *(*int32)(unsafe.Pointer(bp + 120))
  80307 __23:
  80308 	;
  80309 __20:
  80310 	;
  80311 	newCell = (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpTmpSpace
  80312 
  80313 	if !(flags&BTREE_PREFORMAT != 0) {
  80314 		goto __24
  80315 	}
  80316 	*(*int32)(unsafe.Pointer(bp + 120)) = SQLITE_OK
  80317 	*(*int32)(unsafe.Pointer(bp + 124)) = (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FnPreformatSize
  80318 	if !(*(*int32)(unsafe.Pointer(bp + 124)) < 4) {
  80319 		goto __26
  80320 	}
  80321 	*(*int32)(unsafe.Pointer(bp + 124)) = 4
  80322 __26:
  80323 	;
  80324 	if !((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FautoVacuum != 0 && *(*int32)(unsafe.Pointer(bp + 124)) > int32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal)) {
  80325 		goto __27
  80326 	}
  80327 	(*struct {
  80328 		f func(*libc.TLS, uintptr, uintptr, uintptr)
  80329 	})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxParseCell})).f(tls, pPage, newCell, bp+96)
  80330 	if !((*CellInfo)(unsafe.Pointer(bp+96)).FnPayload != U32((*CellInfo)(unsafe.Pointer(bp+96)).FnLocal)) {
  80331 		goto __28
  80332 	}
  80333 	ovfl = Xsqlite3Get4byte(tls, newCell+uintptr(*(*int32)(unsafe.Pointer(bp + 124))-4))
  80334 	ptrmapPut(tls, (*Btree)(unsafe.Pointer(p)).FpBt, ovfl, uint8(PTRMAP_OVERFLOW1), (*MemPage)(unsafe.Pointer(pPage)).Fpgno, bp+120)
  80335 	if !(*(*int32)(unsafe.Pointer(bp + 120)) != 0) {
  80336 		goto __29
  80337 	}
  80338 	goto end_insert
  80339 __29:
  80340 	;
  80341 __28:
  80342 	;
  80343 __27:
  80344 	;
  80345 	goto __25
  80346 __24:
  80347 	*(*int32)(unsafe.Pointer(bp + 120)) = fillInCell(tls, pPage, newCell, pX, bp+124)
  80348 	if !(*(*int32)(unsafe.Pointer(bp + 120)) != 0) {
  80349 		goto __30
  80350 	}
  80351 	goto end_insert
  80352 __30:
  80353 	;
  80354 __25:
  80355 	;
  80356 	idx = int32((*BtCursor)(unsafe.Pointer(pCur)).Fix)
  80357 	(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
  80358 	if !(*(*int32)(unsafe.Pointer(bp)) == 0) {
  80359 		goto __31
  80360 	}
  80361 
  80362 	if !(idx >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)) {
  80363 		goto __33
  80364 	}
  80365 	return Xsqlite3CorruptError(tls, 77645)
  80366 __33:
  80367 	;
  80368 	*(*int32)(unsafe.Pointer(bp + 120)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage)
  80369 	if !(*(*int32)(unsafe.Pointer(bp + 120)) != 0) {
  80370 		goto __34
  80371 	}
  80372 	goto end_insert
  80373 __34:
  80374 	;
  80375 	oldCell = (*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*idx))))))
  80376 	if !!(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) {
  80377 		goto __35
  80378 	}
  80379 	libc.Xmemcpy(tls, newCell, oldCell, uint64(4))
  80380 __35:
  80381 	;
  80382 	(*struct {
  80383 		f func(*libc.TLS, uintptr, uintptr, uintptr)
  80384 	})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxParseCell})).f(tls, pPage, oldCell, bp+128)
  80385 	if !(U32((*CellInfo)(unsafe.Pointer(bp+128)).FnLocal) != (*CellInfo)(unsafe.Pointer(bp+128)).FnPayload) {
  80386 		goto __36
  80387 	}
  80388 	*(*int32)(unsafe.Pointer(bp + 120)) = clearCellOverflow(tls, pPage, oldCell, bp+128)
  80389 	goto __37
  80390 __36:
  80391 	*(*int32)(unsafe.Pointer(bp + 120)) = SQLITE_OK
  80392 __37:
  80393 	;
  80394 	*(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_ValidOvfl))
  80395 	if !(int32((*CellInfo)(unsafe.Pointer(bp+128)).FnSize) == *(*int32)(unsafe.Pointer(bp + 124)) && U32((*CellInfo)(unsafe.Pointer(bp+128)).FnLocal) == (*CellInfo)(unsafe.Pointer(bp+128)).FnPayload &&
  80396 		(!(int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FautoVacuum) != 0) || *(*int32)(unsafe.Pointer(bp + 124)) < int32((*MemPage)(unsafe.Pointer(pPage)).FminLocal))) {
  80397 		goto __38
  80398 	}
  80399 
  80400 	if !(oldCell < (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+uintptr(10)) {
  80401 		goto __39
  80402 	}
  80403 	return Xsqlite3CorruptError(tls, 77672)
  80404 __39:
  80405 	;
  80406 	if !(oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 124))) > (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd) {
  80407 		goto __40
  80408 	}
  80409 	return Xsqlite3CorruptError(tls, 77675)
  80410 __40:
  80411 	;
  80412 	libc.Xmemcpy(tls, oldCell, newCell, uint64(*(*int32)(unsafe.Pointer(bp + 124))))
  80413 	return SQLITE_OK
  80414 __38:
  80415 	;
  80416 	dropCell(tls, pPage, idx, int32((*CellInfo)(unsafe.Pointer(bp+128)).FnSize), bp+120)
  80417 	if !(*(*int32)(unsafe.Pointer(bp + 120)) != 0) {
  80418 		goto __41
  80419 	}
  80420 	goto end_insert
  80421 __41:
  80422 	;
  80423 	goto __32
  80424 __31:
  80425 	if !(*(*int32)(unsafe.Pointer(bp)) < 0 && int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) > 0) {
  80426 		goto __42
  80427 	}
  80428 
  80429 	idx = int32(libc.PreIncUint16(&(*BtCursor)(unsafe.Pointer(pCur)).Fix, 1))
  80430 	*(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_ValidNKey))
  80431 	goto __43
  80432 __42:
  80433 	;
  80434 __43:
  80435 	;
  80436 __32:
  80437 	;
  80438 	*(*int32)(unsafe.Pointer(bp + 120)) = insertCell(tls, pPage, idx, newCell, *(*int32)(unsafe.Pointer(bp + 124)), uintptr(0), uint32(0))
  80439 
  80440 	if !((*MemPage)(unsafe.Pointer(pPage)).FnOverflow != 0) {
  80441 		goto __44
  80442 	}
  80443 
  80444 	*(*U8)(unsafe.Pointer(pCur + 1)) &= libc.Uint8FromInt32(libc.CplInt32(BTCF_ValidNKey))
  80445 	*(*int32)(unsafe.Pointer(bp + 120)) = balance(tls, pCur)
  80446 
  80447 	(*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FnOverflow = U8(0)
  80448 	(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID)
  80449 	if !(flags&BTREE_SAVEPOSITION != 0 && *(*int32)(unsafe.Pointer(bp + 120)) == SQLITE_OK) {
  80450 		goto __45
  80451 	}
  80452 	btreeReleaseAllCursorPages(tls, pCur)
  80453 	if !((*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo != 0) {
  80454 		goto __46
  80455 	}
  80456 
  80457 	(*BtCursor)(unsafe.Pointer(pCur)).FpKey = Xsqlite3Malloc(tls, uint64((*BtreePayload)(unsafe.Pointer(pX)).FnKey))
  80458 	if !((*BtCursor)(unsafe.Pointer(pCur)).FpKey == uintptr(0)) {
  80459 		goto __47
  80460 	}
  80461 	*(*int32)(unsafe.Pointer(bp + 120)) = SQLITE_NOMEM
  80462 	goto __48
  80463 __47:
  80464 	libc.Xmemcpy(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpKey, (*BtreePayload)(unsafe.Pointer(pX)).FpKey, uint64((*BtreePayload)(unsafe.Pointer(pX)).FnKey))
  80465 __48:
  80466 	;
  80467 __46:
  80468 	;
  80469 	(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_REQUIRESEEK)
  80470 	(*BtCursor)(unsafe.Pointer(pCur)).FnKey = (*BtreePayload)(unsafe.Pointer(pX)).FnKey
  80471 __45:
  80472 	;
  80473 __44:
  80474 	;
  80475 end_insert:
  80476 	return *(*int32)(unsafe.Pointer(bp + 120))
  80477 }
  80478 
  80479 // This function is used as part of copying the current row from cursor
  80480 // pSrc into cursor pDest. If the cursors are open on intkey tables, then
  80481 // parameter iKey is used as the rowid value when the record is copied
  80482 // into pDest. Otherwise, the record is copied verbatim.
  80483 //
  80484 // This function does not actually write the new value to cursor pDest.
  80485 // Instead, it creates and populates any required overflow pages and
  80486 // writes the data for the new cell into the BtShared.pTmpSpace buffer
  80487 // for the destination database. The size of the cell, in bytes, is left
  80488 // in BtShared.nPreformatSize. The caller completes the insertion by
  80489 // calling sqlite3BtreeInsert() with the BTREE_PREFORMAT flag specified.
  80490 //
  80491 // SQLITE_OK is returned if successful, or an SQLite error code otherwise.
  80492 func Xsqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey I64) int32 {
  80493 	bp := tls.Alloc(24)
  80494 	defer tls.Free(24)
  80495 
  80496 	var pBt uintptr = (*BtCursor)(unsafe.Pointer(pDest)).FpBt
  80497 	var aOut uintptr = (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace
  80498 	var aIn uintptr
  80499 	var nIn U32
  80500 	var nRem U32
  80501 
  80502 	getCellInfo(tls, pSrc)
  80503 	if (*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload < U32(0x80) {
  80504 		*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&aOut, 1))) = U8((*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload)
  80505 	} else {
  80506 		aOut += uintptr(Xsqlite3PutVarint(tls, aOut, uint64((*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload)))
  80507 	}
  80508 	if (*BtCursor)(unsafe.Pointer(pDest)).FpKeyInfo == uintptr(0) {
  80509 		aOut += uintptr(Xsqlite3PutVarint(tls, aOut, uint64(iKey)))
  80510 	}
  80511 	nIn = U32((*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnLocal)
  80512 	aIn = (*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload
  80513 	if aIn+uintptr(nIn) > (*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd {
  80514 		return Xsqlite3CorruptError(tls, 77777)
  80515 	}
  80516 	nRem = (*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload
  80517 	if nIn == nRem && nIn < U32((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal) {
  80518 		libc.Xmemcpy(tls, aOut, aIn, uint64(nIn))
  80519 		(*BtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(int64(nIn) + (int64(aOut)-int64((*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace))/1)
  80520 		return SQLITE_OK
  80521 	} else {
  80522 		*(*int32)(unsafe.Pointer(bp + 20)) = SQLITE_OK
  80523 		var pSrcPager uintptr = (*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pSrc)).FpBt)).FpPager
  80524 		var pPgnoOut uintptr = uintptr(0)
  80525 		var ovflIn Pgno = Pgno(0)
  80526 		*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
  80527 		var pPageOut uintptr = uintptr(0)
  80528 		var nOut U32
  80529 
  80530 		nOut = U32(btreePayloadToLocal(tls, (*BtCursor)(unsafe.Pointer(pDest)).FpPage, int64((*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload)))
  80531 		(*BtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(int64(nOut) + (int64(aOut)-int64((*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace))/1)
  80532 		if nOut < (*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload {
  80533 			pPgnoOut = aOut + uintptr(nOut)
  80534 			*(*int32)(unsafe.Pointer(pBt + 144)) += 4
  80535 		}
  80536 
  80537 		if nRem > nIn {
  80538 			if aIn+uintptr(nIn)+uintptr(4) > (*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd {
  80539 				return Xsqlite3CorruptError(tls, 77802)
  80540 			}
  80541 			ovflIn = Xsqlite3Get4byte(tls, (*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn))
  80542 		}
  80543 
  80544 		for __ccgo := true; __ccgo; __ccgo = nRem > U32(0) && *(*int32)(unsafe.Pointer(bp + 20)) == SQLITE_OK {
  80545 			nRem = nRem - nOut
  80546 			for __ccgo1 := true; __ccgo1; __ccgo1 = *(*int32)(unsafe.Pointer(bp + 20)) == SQLITE_OK && nOut > U32(0) {
  80547 				if nIn > U32(0) {
  80548 					var nCopy int32 = func() int32 {
  80549 						if nOut < nIn {
  80550 							return int32(nOut)
  80551 						}
  80552 						return int32(nIn)
  80553 					}()
  80554 					libc.Xmemcpy(tls, aOut, aIn, uint64(nCopy))
  80555 					nOut = nOut - U32(nCopy)
  80556 					nIn = nIn - U32(nCopy)
  80557 					aOut += uintptr(nCopy)
  80558 					aIn += uintptr(nCopy)
  80559 				}
  80560 				if nOut > U32(0) {
  80561 					Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp)))
  80562 					*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
  80563 					*(*int32)(unsafe.Pointer(bp + 20)) = Xsqlite3PagerGet(tls, pSrcPager, ovflIn, bp, PAGER_GET_READONLY)
  80564 					if *(*int32)(unsafe.Pointer(bp + 20)) == SQLITE_OK {
  80565 						aIn = Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp)))
  80566 						ovflIn = Xsqlite3Get4byte(tls, aIn)
  80567 						aIn += uintptr(4)
  80568 						nIn = (*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pSrc)).FpBt)).FusableSize - U32(4)
  80569 					}
  80570 				}
  80571 			}
  80572 
  80573 			if *(*int32)(unsafe.Pointer(bp + 20)) == SQLITE_OK && nRem > U32(0) && pPgnoOut != 0 {
  80574 				*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
  80575 				*(*int32)(unsafe.Pointer(bp + 20)) = allocateBtreePage(tls, pBt, bp+8, bp+16, uint32(0), uint8(0))
  80576 				Xsqlite3Put4byte(tls, pPgnoOut, *(*Pgno)(unsafe.Pointer(bp + 16)))
  80577 				if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 && pPageOut != 0 {
  80578 					ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 16)), uint8(PTRMAP_OVERFLOW2), (*MemPage)(unsafe.Pointer(pPageOut)).Fpgno, bp+20)
  80579 				}
  80580 				releasePage(tls, pPageOut)
  80581 				pPageOut = *(*uintptr)(unsafe.Pointer(bp + 8))
  80582 				if pPageOut != 0 {
  80583 					pPgnoOut = (*MemPage)(unsafe.Pointer(pPageOut)).FaData
  80584 					Xsqlite3Put4byte(tls, pPgnoOut, uint32(0))
  80585 					aOut = pPgnoOut + 4
  80586 					nOut = func() uint32 {
  80587 						if (*BtShared)(unsafe.Pointer(pBt)).FusableSize-U32(4) < nRem {
  80588 							return (*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(4)
  80589 						}
  80590 						return nRem
  80591 					}()
  80592 				}
  80593 			}
  80594 		}
  80595 
  80596 		releasePage(tls, pPageOut)
  80597 		Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp)))
  80598 		return *(*int32)(unsafe.Pointer(bp + 20))
  80599 	}
  80600 	return int32(0)
  80601 }
  80602 
  80603 // Delete the entry that the cursor is pointing to.
  80604 //
  80605 // If the BTREE_SAVEPOSITION bit of the flags parameter is zero, then
  80606 // the cursor is left pointing at an arbitrary location after the delete.
  80607 // But if that bit is set, then the cursor is left in a state such that
  80608 // the next call to BtreeNext() or BtreePrev() moves it to the same row
  80609 // as it would have been on if the call to BtreeDelete() had been omitted.
  80610 //
  80611 // The BTREE_AUXDELETE bit of flags indicates that is one of several deletes
  80612 // associated with a single table entry and its indexes.  Only one of those
  80613 // deletes is considered the "primary" delete.  The primary delete occurs
  80614 // on a cursor that is not a BTREE_FORDELETE cursor.  All but one delete
  80615 // operation on non-FORDELETE cursors is tagged with the AUXDELETE flag.
  80616 // The BTREE_AUXDELETE bit is a hint that is not used by this implementation,
  80617 // but which might be used by alternative storage engines.
  80618 func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 {
  80619 	bp := tls.Alloc(28)
  80620 	defer tls.Free(28)
  80621 
  80622 	var p uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpBtree
  80623 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  80624 
  80625 	var pPage uintptr
  80626 	var pCell uintptr
  80627 	var iCellIdx int32
  80628 	var iCellDepth int32
  80629 
  80630 	var bPreserve U8
  80631 
  80632 	if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID {
  80633 		if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) >= CURSOR_REQUIRESEEK {
  80634 			*(*int32)(unsafe.Pointer(bp + 24)) = btreeRestoreCursorPosition(tls, pCur)
  80635 
  80636 			if *(*int32)(unsafe.Pointer(bp + 24)) != 0 || int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) != CURSOR_VALID {
  80637 				return *(*int32)(unsafe.Pointer(bp + 24))
  80638 			}
  80639 		} else {
  80640 			return Xsqlite3CorruptError(tls, 77898)
  80641 		}
  80642 	}
  80643 
  80644 	iCellDepth = int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage)
  80645 	iCellIdx = int32((*BtCursor)(unsafe.Pointer(pCur)).Fix)
  80646 	pPage = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
  80647 	if int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) <= iCellIdx {
  80648 		return Xsqlite3CorruptError(tls, 77907)
  80649 	}
  80650 	pCell = (*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*iCellIdx))))))
  80651 	if (*MemPage)(unsafe.Pointer(pPage)).FnFree < 0 && btreeComputeFreeSpace(tls, pPage) != 0 {
  80652 		return Xsqlite3CorruptError(tls, 77911)
  80653 	}
  80654 
  80655 	bPreserve = U8(libc.Bool32(int32(flags)&BTREE_SAVEPOSITION != 0))
  80656 	if bPreserve != 0 {
  80657 		if !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) ||
  80658 			(*MemPage)(unsafe.Pointer(pPage)).FnFree+int32((*struct {
  80659 				f func(*libc.TLS, uintptr, uintptr) U16
  80660 			})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxCellSize})).f(tls, pPage, pCell))+2 > int32((*BtShared)(unsafe.Pointer(pBt)).FusableSize*U32(2)/U32(3)) ||
  80661 			int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) == 1 {
  80662 			*(*int32)(unsafe.Pointer(bp + 24)) = saveCursorKey(tls, pCur)
  80663 			if *(*int32)(unsafe.Pointer(bp + 24)) != 0 {
  80664 				return *(*int32)(unsafe.Pointer(bp + 24))
  80665 			}
  80666 		} else {
  80667 			bPreserve = U8(2)
  80668 		}
  80669 	}
  80670 
  80671 	if !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) {
  80672 		*(*int32)(unsafe.Pointer(bp + 24)) = Xsqlite3BtreePrevious(tls, pCur, 0)
  80673 
  80674 		if *(*int32)(unsafe.Pointer(bp + 24)) != 0 {
  80675 			return *(*int32)(unsafe.Pointer(bp + 24))
  80676 		}
  80677 	}
  80678 
  80679 	if int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags)&BTCF_Multiple != 0 {
  80680 		*(*int32)(unsafe.Pointer(bp + 24)) = saveAllCursors(tls, pBt, (*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot, pCur)
  80681 		if *(*int32)(unsafe.Pointer(bp + 24)) != 0 {
  80682 			return *(*int32)(unsafe.Pointer(bp + 24))
  80683 		}
  80684 	}
  80685 
  80686 	if (*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0) && (*Btree)(unsafe.Pointer(p)).FhasIncrblobCur != 0 {
  80687 		invalidateIncrblobCursors(tls, p, (*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot, (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey, 0)
  80688 	}
  80689 
  80690 	*(*int32)(unsafe.Pointer(bp + 24)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage)
  80691 	if *(*int32)(unsafe.Pointer(bp + 24)) != 0 {
  80692 		return *(*int32)(unsafe.Pointer(bp + 24))
  80693 	}
  80694 	(*struct {
  80695 		f func(*libc.TLS, uintptr, uintptr, uintptr)
  80696 	})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pPage)).FxParseCell})).f(tls, pPage, pCell, bp)
  80697 	if U32((*CellInfo)(unsafe.Pointer(bp)).FnLocal) != (*CellInfo)(unsafe.Pointer(bp)).FnPayload {
  80698 		*(*int32)(unsafe.Pointer(bp + 24)) = clearCellOverflow(tls, pPage, pCell, bp)
  80699 	} else {
  80700 		*(*int32)(unsafe.Pointer(bp + 24)) = SQLITE_OK
  80701 	}
  80702 
  80703 	dropCell(tls, pPage, iCellIdx, int32((*CellInfo)(unsafe.Pointer(bp)).FnSize), bp+24)
  80704 	if *(*int32)(unsafe.Pointer(bp + 24)) != 0 {
  80705 		return *(*int32)(unsafe.Pointer(bp + 24))
  80706 	}
  80707 
  80708 	if !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) {
  80709 		var pLeaf uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
  80710 		var nCell int32
  80711 		var n Pgno
  80712 		var pTmp uintptr
  80713 
  80714 		if (*MemPage)(unsafe.Pointer(pLeaf)).FnFree < 0 {
  80715 			*(*int32)(unsafe.Pointer(bp + 24)) = btreeComputeFreeSpace(tls, pLeaf)
  80716 			if *(*int32)(unsafe.Pointer(bp + 24)) != 0 {
  80717 				return *(*int32)(unsafe.Pointer(bp + 24))
  80718 			}
  80719 		}
  80720 		if iCellDepth < int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage)-1 {
  80721 			n = (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr(iCellDepth+1)*8)))).Fpgno
  80722 		} else {
  80723 			n = (*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).Fpgno
  80724 		}
  80725 		pCell = (*MemPage)(unsafe.Pointer(pLeaf)).FaData + uintptr(int32((*MemPage)(unsafe.Pointer(pLeaf)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pLeaf)).FaCellIdx + uintptr(2*(int32((*MemPage)(unsafe.Pointer(pLeaf)).FnCell)-1)))))))
  80726 		if pCell < (*MemPage)(unsafe.Pointer(pLeaf)).FaData+4 {
  80727 			return Xsqlite3CorruptError(tls, 78002)
  80728 		}
  80729 		nCell = int32((*struct {
  80730 			f func(*libc.TLS, uintptr, uintptr) U16
  80731 		})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(pLeaf)).FxCellSize})).f(tls, pLeaf, pCell))
  80732 
  80733 		pTmp = (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace
  80734 
  80735 		*(*int32)(unsafe.Pointer(bp + 24)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pLeaf)).FpDbPage)
  80736 		if *(*int32)(unsafe.Pointer(bp + 24)) == SQLITE_OK {
  80737 			*(*int32)(unsafe.Pointer(bp + 24)) = insertCell(tls, pPage, iCellIdx, pCell-uintptr(4), nCell+4, pTmp, n)
  80738 		}
  80739 		dropCell(tls, pLeaf, int32((*MemPage)(unsafe.Pointer(pLeaf)).FnCell)-1, nCell, bp+24)
  80740 		if *(*int32)(unsafe.Pointer(bp + 24)) != 0 {
  80741 			return *(*int32)(unsafe.Pointer(bp + 24))
  80742 		}
  80743 	}
  80744 
  80745 	if (*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FnFree*3 <= int32((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize)*2 {
  80746 		*(*int32)(unsafe.Pointer(bp + 24)) = SQLITE_OK
  80747 	} else {
  80748 		*(*int32)(unsafe.Pointer(bp + 24)) = balance(tls, pCur)
  80749 	}
  80750 	if *(*int32)(unsafe.Pointer(bp + 24)) == SQLITE_OK && int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) > iCellDepth {
  80751 		releasePageNotNull(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpPage)
  80752 		(*BtCursor)(unsafe.Pointer(pCur)).FiPage--
  80753 		for int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) > iCellDepth {
  80754 			releasePage(tls, *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr(libc.PostDecInt8(&(*BtCursor)(unsafe.Pointer(pCur)).FiPage, 1))*8)))
  80755 		}
  80756 		(*BtCursor)(unsafe.Pointer(pCur)).FpPage = *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FiPage)*8))
  80757 		*(*int32)(unsafe.Pointer(bp + 24)) = balance(tls, pCur)
  80758 	}
  80759 
  80760 	if *(*int32)(unsafe.Pointer(bp + 24)) == SQLITE_OK {
  80761 		if int32(bPreserve) > 1 {
  80762 			(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_SKIPNEXT)
  80763 			if iCellIdx >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) {
  80764 				(*BtCursor)(unsafe.Pointer(pCur)).FskipNext = -1
  80765 				(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - 1)
  80766 			} else {
  80767 				(*BtCursor)(unsafe.Pointer(pCur)).FskipNext = 1
  80768 			}
  80769 		} else {
  80770 			*(*int32)(unsafe.Pointer(bp + 24)) = moveToRoot(tls, pCur)
  80771 			if bPreserve != 0 {
  80772 				btreeReleaseAllCursorPages(tls, pCur)
  80773 				(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_REQUIRESEEK)
  80774 			}
  80775 			if *(*int32)(unsafe.Pointer(bp + 24)) == SQLITE_EMPTY {
  80776 				*(*int32)(unsafe.Pointer(bp + 24)) = SQLITE_OK
  80777 			}
  80778 		}
  80779 	}
  80780 	return *(*int32)(unsafe.Pointer(bp + 24))
  80781 }
  80782 
  80783 func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags int32) int32 {
  80784 	bp := tls.Alloc(44)
  80785 	defer tls.Free(44)
  80786 
  80787 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  80788 
  80789 	var ptfFlags int32
  80790 
  80791 	if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 {
  80792 		invalidateAllOverflowCache(tls, pBt)
  80793 
  80794 		Xsqlite3BtreeGetMeta(tls, p, BTREE_LARGEST_ROOT_PAGE, bp)
  80795 		if *(*Pgno)(unsafe.Pointer(bp)) > btreePagecount(tls, pBt) {
  80796 			return Xsqlite3CorruptError(tls, 78118)
  80797 		}
  80798 		*(*Pgno)(unsafe.Pointer(bp))++
  80799 
  80800 		for *(*Pgno)(unsafe.Pointer(bp)) == ptrmapPageno(tls, pBt, *(*Pgno)(unsafe.Pointer(bp))) || *(*Pgno)(unsafe.Pointer(bp)) == U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1) {
  80801 			*(*Pgno)(unsafe.Pointer(bp))++
  80802 		}
  80803 
  80804 		*(*int32)(unsafe.Pointer(bp + 40)) = allocateBtreePage(tls, pBt, bp+8, bp+16, *(*Pgno)(unsafe.Pointer(bp)), uint8(BTALLOC_EXACT))
  80805 		if *(*int32)(unsafe.Pointer(bp + 40)) != SQLITE_OK {
  80806 			return *(*int32)(unsafe.Pointer(bp + 40))
  80807 		}
  80808 
  80809 		if *(*Pgno)(unsafe.Pointer(bp + 16)) != *(*Pgno)(unsafe.Pointer(bp)) {
  80810 			*(*U8)(unsafe.Pointer(bp + 32)) = U8(0)
  80811 			*(*Pgno)(unsafe.Pointer(bp + 36)) = Pgno(0)
  80812 
  80813 			*(*int32)(unsafe.Pointer(bp + 40)) = saveAllCursors(tls, pBt, uint32(0), uintptr(0))
  80814 			releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
  80815 			if *(*int32)(unsafe.Pointer(bp + 40)) != SQLITE_OK {
  80816 				return *(*int32)(unsafe.Pointer(bp + 40))
  80817 			}
  80818 
  80819 			*(*int32)(unsafe.Pointer(bp + 40)) = btreeGetPage(tls, pBt, *(*Pgno)(unsafe.Pointer(bp)), bp+24, 0)
  80820 			if *(*int32)(unsafe.Pointer(bp + 40)) != SQLITE_OK {
  80821 				return *(*int32)(unsafe.Pointer(bp + 40))
  80822 			}
  80823 			*(*int32)(unsafe.Pointer(bp + 40)) = ptrmapGet(tls, pBt, *(*Pgno)(unsafe.Pointer(bp)), bp+32, bp+36)
  80824 			if int32(*(*U8)(unsafe.Pointer(bp + 32))) == PTRMAP_ROOTPAGE || int32(*(*U8)(unsafe.Pointer(bp + 32))) == PTRMAP_FREEPAGE {
  80825 				*(*int32)(unsafe.Pointer(bp + 40)) = Xsqlite3CorruptError(tls, 78166)
  80826 			}
  80827 			if *(*int32)(unsafe.Pointer(bp + 40)) != SQLITE_OK {
  80828 				releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 24)))
  80829 				return *(*int32)(unsafe.Pointer(bp + 40))
  80830 			}
  80831 
  80832 			*(*int32)(unsafe.Pointer(bp + 40)) = relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 24)), *(*U8)(unsafe.Pointer(bp + 32)), *(*Pgno)(unsafe.Pointer(bp + 36)), *(*Pgno)(unsafe.Pointer(bp + 16)), 0)
  80833 			releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 24)))
  80834 
  80835 			if *(*int32)(unsafe.Pointer(bp + 40)) != SQLITE_OK {
  80836 				return *(*int32)(unsafe.Pointer(bp + 40))
  80837 			}
  80838 			*(*int32)(unsafe.Pointer(bp + 40)) = btreeGetPage(tls, pBt, *(*Pgno)(unsafe.Pointer(bp)), bp+24, 0)
  80839 			if *(*int32)(unsafe.Pointer(bp + 40)) != SQLITE_OK {
  80840 				return *(*int32)(unsafe.Pointer(bp + 40))
  80841 			}
  80842 			*(*int32)(unsafe.Pointer(bp + 40)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FpDbPage)
  80843 			if *(*int32)(unsafe.Pointer(bp + 40)) != SQLITE_OK {
  80844 				releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 24)))
  80845 				return *(*int32)(unsafe.Pointer(bp + 40))
  80846 			}
  80847 		} else {
  80848 			*(*uintptr)(unsafe.Pointer(bp + 24)) = *(*uintptr)(unsafe.Pointer(bp + 8))
  80849 		}
  80850 
  80851 		ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp)), uint8(PTRMAP_ROOTPAGE), uint32(0), bp+40)
  80852 		if *(*int32)(unsafe.Pointer(bp + 40)) != 0 {
  80853 			releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 24)))
  80854 			return *(*int32)(unsafe.Pointer(bp + 40))
  80855 		}
  80856 
  80857 		*(*int32)(unsafe.Pointer(bp + 40)) = Xsqlite3BtreeUpdateMeta(tls, p, 4, *(*Pgno)(unsafe.Pointer(bp)))
  80858 		if *(*int32)(unsafe.Pointer(bp + 40)) != 0 {
  80859 			releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 24)))
  80860 			return *(*int32)(unsafe.Pointer(bp + 40))
  80861 		}
  80862 
  80863 	} else {
  80864 		*(*int32)(unsafe.Pointer(bp + 40)) = allocateBtreePage(tls, pBt, bp+24, bp, uint32(1), uint8(0))
  80865 		if *(*int32)(unsafe.Pointer(bp + 40)) != 0 {
  80866 			return *(*int32)(unsafe.Pointer(bp + 40))
  80867 		}
  80868 	}
  80869 
  80870 	if createTabFlags&BTREE_INTKEY != 0 {
  80871 		ptfFlags = PTF_INTKEY | PTF_LEAFDATA | PTF_LEAF
  80872 	} else {
  80873 		ptfFlags = PTF_ZERODATA | PTF_LEAF
  80874 	}
  80875 	zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp + 24)), ptfFlags)
  80876 	Xsqlite3PagerUnref(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FpDbPage)
  80877 
  80878 	*(*Pgno)(unsafe.Pointer(piTable)) = *(*Pgno)(unsafe.Pointer(bp))
  80879 	return SQLITE_OK
  80880 }
  80881 
  80882 func Xsqlite3BtreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, flags int32) int32 {
  80883 	var rc int32
  80884 	Xsqlite3BtreeEnter(tls, p)
  80885 	rc = btreeCreateTable(tls, p, piTable, flags)
  80886 	Xsqlite3BtreeLeave(tls, p)
  80887 	return rc
  80888 }
  80889 
  80890 func clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno Pgno, freePageFlag int32, pnChange uintptr) int32 {
  80891 	bp := tls.Alloc(36)
  80892 	defer tls.Free(36)
  80893 
  80894 	var pCell uintptr
  80895 	var i int32
  80896 	var hdr int32
  80897 
  80898 	if !(pgno > btreePagecount(tls, pBt)) {
  80899 		goto __1
  80900 	}
  80901 	return Xsqlite3CorruptError(tls, 78256)
  80902 __1:
  80903 	;
  80904 	*(*int32)(unsafe.Pointer(bp + 32)) = getAndInitPage(tls, pBt, pgno, bp, uintptr(0), 0)
  80905 	if !(*(*int32)(unsafe.Pointer(bp + 32)) != 0) {
  80906 		goto __2
  80907 	}
  80908 	return *(*int32)(unsafe.Pointer(bp + 32))
  80909 __2:
  80910 	;
  80911 	if !(int32((*BtShared)(unsafe.Pointer(pBt)).FopenFlags)&BTREE_SINGLE == 0 &&
  80912 		Xsqlite3PagerPageRefcount(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != 1+libc.Bool32(pgno == Pgno(1))) {
  80913 		goto __3
  80914 	}
  80915 	*(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3CorruptError(tls, 78263)
  80916 	goto cleardatabasepage_out
  80917 __3:
  80918 	;
  80919 	hdr = int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset)
  80920 	i = 0
  80921 __4:
  80922 	if !(i < int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnCell)) {
  80923 		goto __6
  80924 	}
  80925 	pCell = (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + uintptr(int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaCellIdx + uintptr(2*i))))))
  80926 	if !!(int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fleaf) != 0) {
  80927 		goto __7
  80928 	}
  80929 	*(*int32)(unsafe.Pointer(bp + 32)) = clearDatabasePage(tls, pBt, Xsqlite3Get4byte(tls, pCell), 1, pnChange)
  80930 	if !(*(*int32)(unsafe.Pointer(bp + 32)) != 0) {
  80931 		goto __8
  80932 	}
  80933 	goto cleardatabasepage_out
  80934 __8:
  80935 	;
  80936 __7:
  80937 	;
  80938 	(*struct {
  80939 		f func(*libc.TLS, uintptr, uintptr, uintptr)
  80940 	})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxParseCell})).f(tls, *(*uintptr)(unsafe.Pointer(bp)), pCell, bp+8)
  80941 	if !(U32((*CellInfo)(unsafe.Pointer(bp+8)).FnLocal) != (*CellInfo)(unsafe.Pointer(bp+8)).FnPayload) {
  80942 		goto __9
  80943 	}
  80944 	*(*int32)(unsafe.Pointer(bp + 32)) = clearCellOverflow(tls, *(*uintptr)(unsafe.Pointer(bp)), pCell, bp+8)
  80945 	goto __10
  80946 __9:
  80947 	*(*int32)(unsafe.Pointer(bp + 32)) = SQLITE_OK
  80948 __10:
  80949 	;
  80950 	if !(*(*int32)(unsafe.Pointer(bp + 32)) != 0) {
  80951 		goto __11
  80952 	}
  80953 	goto cleardatabasepage_out
  80954 __11:
  80955 	;
  80956 	goto __5
  80957 __5:
  80958 	i++
  80959 	goto __4
  80960 	goto __6
  80961 __6:
  80962 	;
  80963 	if !!(int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fleaf) != 0) {
  80964 		goto __12
  80965 	}
  80966 	*(*int32)(unsafe.Pointer(bp + 32)) = clearDatabasePage(tls, pBt, Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+uintptr(hdr+8)), 1, pnChange)
  80967 	if !(*(*int32)(unsafe.Pointer(bp + 32)) != 0) {
  80968 		goto __13
  80969 	}
  80970 	goto cleardatabasepage_out
  80971 __13:
  80972 	;
  80973 	if !((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FintKey != 0) {
  80974 		goto __14
  80975 	}
  80976 	pnChange = uintptr(0)
  80977 __14:
  80978 	;
  80979 __12:
  80980 	;
  80981 	if !(pnChange != 0) {
  80982 		goto __15
  80983 	}
  80984 
  80985 	*(*I64)(unsafe.Pointer(pnChange)) += I64((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnCell)
  80986 __15:
  80987 	;
  80988 	if !(freePageFlag != 0) {
  80989 		goto __16
  80990 	}
  80991 	freePage(tls, *(*uintptr)(unsafe.Pointer(bp)), bp+32)
  80992 	goto __17
  80993 __16:
  80994 	if !(libc.AssignPtrInt32(bp+32, Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage)) == 0) {
  80995 		goto __18
  80996 	}
  80997 	zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + uintptr(hdr))))|PTF_LEAF)
  80998 __18:
  80999 	;
  81000 __17:
  81001 	;
  81002 cleardatabasepage_out:
  81003 	releasePage(tls, *(*uintptr)(unsafe.Pointer(bp)))
  81004 	return *(*int32)(unsafe.Pointer(bp + 32))
  81005 }
  81006 
  81007 // Delete all information from a single table in the database.  iTable is
  81008 // the page number of the root of the table.  After this routine returns,
  81009 // the root page is empty, but still exists.
  81010 //
  81011 // This routine will fail with SQLITE_LOCKED if there are any open
  81012 // read cursors on the table.  Open write cursors are moved to the
  81013 // root of the table.
  81014 //
  81015 // If pnChange is not NULL, then the integer value pointed to by pnChange
  81016 // is incremented by the number of entries in the table.
  81017 func Xsqlite3BtreeClearTable(tls *libc.TLS, p uintptr, iTable int32, pnChange uintptr) int32 {
  81018 	var rc int32
  81019 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  81020 	Xsqlite3BtreeEnter(tls, p)
  81021 
  81022 	rc = saveAllCursors(tls, pBt, Pgno(iTable), uintptr(0))
  81023 
  81024 	if SQLITE_OK == rc {
  81025 		if (*Btree)(unsafe.Pointer(p)).FhasIncrblobCur != 0 {
  81026 			invalidateIncrblobCursors(tls, p, Pgno(iTable), int64(0), 1)
  81027 		}
  81028 		rc = clearDatabasePage(tls, pBt, Pgno(iTable), 0, pnChange)
  81029 	}
  81030 	Xsqlite3BtreeLeave(tls, p)
  81031 	return rc
  81032 }
  81033 
  81034 // Delete all information from the single table that pCur is open on.
  81035 //
  81036 // This routine only work for pCur on an ephemeral table.
  81037 func Xsqlite3BtreeClearTableOfCursor(tls *libc.TLS, pCur uintptr) int32 {
  81038 	return Xsqlite3BtreeClearTable(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree, int32((*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot), uintptr(0))
  81039 }
  81040 
  81041 func btreeDropTable(tls *libc.TLS, p uintptr, iTable Pgno, piMoved uintptr) int32 {
  81042 	bp := tls.Alloc(24)
  81043 	defer tls.Free(24)
  81044 
  81045 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
  81046 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  81047 
  81048 	if iTable > btreePagecount(tls, pBt) {
  81049 		return Xsqlite3CorruptError(tls, 78367)
  81050 	}
  81051 
  81052 	*(*int32)(unsafe.Pointer(bp + 12)) = Xsqlite3BtreeClearTable(tls, p, int32(iTable), uintptr(0))
  81053 	if *(*int32)(unsafe.Pointer(bp + 12)) != 0 {
  81054 		return *(*int32)(unsafe.Pointer(bp + 12))
  81055 	}
  81056 	*(*int32)(unsafe.Pointer(bp + 12)) = btreeGetPage(tls, pBt, iTable, bp, 0)
  81057 	if *(*int32)(unsafe.Pointer(bp + 12)) != 0 {
  81058 		releasePage(tls, *(*uintptr)(unsafe.Pointer(bp)))
  81059 		return *(*int32)(unsafe.Pointer(bp + 12))
  81060 	}
  81061 
  81062 	*(*int32)(unsafe.Pointer(piMoved)) = 0
  81063 
  81064 	if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 {
  81065 		Xsqlite3BtreeGetMeta(tls, p, BTREE_LARGEST_ROOT_PAGE, bp+8)
  81066 
  81067 		if iTable == *(*Pgno)(unsafe.Pointer(bp + 8)) {
  81068 			freePage(tls, *(*uintptr)(unsafe.Pointer(bp)), bp+12)
  81069 			releasePage(tls, *(*uintptr)(unsafe.Pointer(bp)))
  81070 			if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK {
  81071 				return *(*int32)(unsafe.Pointer(bp + 12))
  81072 			}
  81073 		} else {
  81074 			releasePage(tls, *(*uintptr)(unsafe.Pointer(bp)))
  81075 			*(*int32)(unsafe.Pointer(bp + 12)) = btreeGetPage(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8)), bp+16, 0)
  81076 			if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK {
  81077 				return *(*int32)(unsafe.Pointer(bp + 12))
  81078 			}
  81079 			*(*int32)(unsafe.Pointer(bp + 12)) = relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 16)), uint8(PTRMAP_ROOTPAGE), uint32(0), iTable, 0)
  81080 			releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
  81081 			if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK {
  81082 				return *(*int32)(unsafe.Pointer(bp + 12))
  81083 			}
  81084 			*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
  81085 			*(*int32)(unsafe.Pointer(bp + 12)) = btreeGetPage(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8)), bp+16, 0)
  81086 			freePage(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), bp+12)
  81087 			releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
  81088 			if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK {
  81089 				return *(*int32)(unsafe.Pointer(bp + 12))
  81090 			}
  81091 			*(*int32)(unsafe.Pointer(piMoved)) = int32(*(*Pgno)(unsafe.Pointer(bp + 8)))
  81092 		}
  81093 
  81094 		*(*Pgno)(unsafe.Pointer(bp + 8))--
  81095 		for *(*Pgno)(unsafe.Pointer(bp + 8)) == U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize+U32(1) ||
  81096 			ptrmapPageno(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8))) == *(*Pgno)(unsafe.Pointer(bp + 8)) {
  81097 			*(*Pgno)(unsafe.Pointer(bp + 8))--
  81098 		}
  81099 
  81100 		*(*int32)(unsafe.Pointer(bp + 12)) = Xsqlite3BtreeUpdateMeta(tls, p, 4, *(*Pgno)(unsafe.Pointer(bp + 8)))
  81101 	} else {
  81102 		freePage(tls, *(*uintptr)(unsafe.Pointer(bp)), bp+12)
  81103 		releasePage(tls, *(*uintptr)(unsafe.Pointer(bp)))
  81104 	}
  81105 	return *(*int32)(unsafe.Pointer(bp + 12))
  81106 }
  81107 
  81108 func Xsqlite3BtreeDropTable(tls *libc.TLS, p uintptr, iTable int32, piMoved uintptr) int32 {
  81109 	var rc int32
  81110 	Xsqlite3BtreeEnter(tls, p)
  81111 	rc = btreeDropTable(tls, p, uint32(iTable), piMoved)
  81112 	Xsqlite3BtreeLeave(tls, p)
  81113 	return rc
  81114 }
  81115 
  81116 // This function may only be called if the b-tree connection already
  81117 // has a read or write transaction open on the database.
  81118 //
  81119 // Read the meta-information out of a database file.  Meta[0]
  81120 // is the number of free pages currently in the database.  Meta[1]
  81121 // through meta[15] are available for use by higher layers.  Meta[0]
  81122 // is read-only, the others are read/write.
  81123 //
  81124 // The schema layer numbers meta values differently.  At the schema
  81125 // layer (and the SetCookie and ReadCookie opcodes) the number of
  81126 // free pages is not visible.  So Cookie[0] is the same as Meta[1].
  81127 //
  81128 // This routine treats Meta[BTREE_DATA_VERSION] as a special case.  Instead
  81129 // of reading the value out of the header, it instead loads the "DataVersion"
  81130 // from the pager.  The BTREE_DATA_VERSION value is not actually stored in the
  81131 // database file.  It is a number computed by the pager.  But its access
  81132 // pattern is the same as header meta values, and so it is convenient to
  81133 // read it from this routine.
  81134 func Xsqlite3BtreeGetMeta(tls *libc.TLS, p uintptr, idx int32, pMeta uintptr) {
  81135 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  81136 
  81137 	Xsqlite3BtreeEnter(tls, p)
  81138 
  81139 	if idx == BTREE_DATA_VERSION {
  81140 		*(*U32)(unsafe.Pointer(pMeta)) = Xsqlite3PagerDataVersion(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager) + (*Btree)(unsafe.Pointer(p)).FiBDataVersion
  81141 	} else {
  81142 		*(*U32)(unsafe.Pointer(pMeta)) = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+uintptr(36+idx*4))
  81143 	}
  81144 
  81145 	Xsqlite3BtreeLeave(tls, p)
  81146 }
  81147 
  81148 // Write meta-information back into the database.  Meta[0] is
  81149 // read-only and may not be written.
  81150 func Xsqlite3BtreeUpdateMeta(tls *libc.TLS, p uintptr, idx int32, iMeta U32) int32 {
  81151 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  81152 	var pP1 uintptr
  81153 	var rc int32
  81154 
  81155 	Xsqlite3BtreeEnter(tls, p)
  81156 
  81157 	pP1 = (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData
  81158 	rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FpDbPage)
  81159 	if rc == SQLITE_OK {
  81160 		Xsqlite3Put4byte(tls, pP1+uintptr(36+idx*4), iMeta)
  81161 		if idx == BTREE_INCR_VACUUM {
  81162 			(*BtShared)(unsafe.Pointer(pBt)).FincrVacuum = U8(iMeta)
  81163 		}
  81164 	}
  81165 	Xsqlite3BtreeLeave(tls, p)
  81166 	return rc
  81167 }
  81168 
  81169 // The first argument, pCur, is a cursor opened on some b-tree. Count the
  81170 // number of entries in the b-tree and write the result to *pnEntry.
  81171 //
  81172 // SQLITE_OK is returned if the operation is successfully executed.
  81173 // Otherwise, if an error is encountered (i.e. an IO error or database
  81174 // corruption) an SQLite error code is returned.
  81175 func Xsqlite3BtreeCount(tls *libc.TLS, db uintptr, pCur uintptr, pnEntry uintptr) int32 {
  81176 	var nEntry I64 = int64(0)
  81177 	var rc int32
  81178 
  81179 	rc = moveToRoot(tls, pCur)
  81180 	if rc == SQLITE_EMPTY {
  81181 		*(*I64)(unsafe.Pointer(pnEntry)) = int64(0)
  81182 		return SQLITE_OK
  81183 	}
  81184 
  81185 	for rc == SQLITE_OK && !(libc.AtomicLoadNInt32(db+432, 0) != 0) {
  81186 		var iIdx int32
  81187 		var pPage uintptr
  81188 
  81189 		pPage = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
  81190 		if (*MemPage)(unsafe.Pointer(pPage)).Fleaf != 0 || !(int32((*MemPage)(unsafe.Pointer(pPage)).FintKey) != 0) {
  81191 			nEntry = nEntry + I64((*MemPage)(unsafe.Pointer(pPage)).FnCell)
  81192 		}
  81193 
  81194 		if (*MemPage)(unsafe.Pointer(pPage)).Fleaf != 0 {
  81195 			for __ccgo := true; __ccgo; __ccgo = int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) >= int32((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) {
  81196 				if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) == 0 {
  81197 					*(*I64)(unsafe.Pointer(pnEntry)) = nEntry
  81198 					return moveToRoot(tls, pCur)
  81199 				}
  81200 				moveToParent(tls, pCur)
  81201 			}
  81202 
  81203 			(*BtCursor)(unsafe.Pointer(pCur)).Fix++
  81204 			pPage = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
  81205 		}
  81206 
  81207 		iIdx = int32((*BtCursor)(unsafe.Pointer(pCur)).Fix)
  81208 		if iIdx == int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) {
  81209 			rc = moveToChild(tls, pCur, Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+8)))
  81210 		} else {
  81211 			rc = moveToChild(tls, pCur, Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*MemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(2*iIdx))))))))
  81212 		}
  81213 	}
  81214 
  81215 	return rc
  81216 }
  81217 
  81218 // Return the pager associated with a BTree.  This routine is used for
  81219 // testing and debugging only.
  81220 func Xsqlite3BtreePager(tls *libc.TLS, p uintptr) uintptr {
  81221 	return (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpPager
  81222 }
  81223 
  81224 func checkOom(tls *libc.TLS, pCheck uintptr) {
  81225 	(*IntegrityCk)(unsafe.Pointer(pCheck)).Frc = SQLITE_NOMEM
  81226 	(*IntegrityCk)(unsafe.Pointer(pCheck)).FmxErr = 0
  81227 	if (*IntegrityCk)(unsafe.Pointer(pCheck)).FnErr == 0 {
  81228 		(*IntegrityCk)(unsafe.Pointer(pCheck)).FnErr++
  81229 	}
  81230 }
  81231 
  81232 func checkProgress(tls *libc.TLS, pCheck uintptr) {
  81233 	var db uintptr = (*IntegrityCk)(unsafe.Pointer(pCheck)).Fdb
  81234 	if libc.AtomicLoadNInt32(db+432, 0) != 0 {
  81235 		(*IntegrityCk)(unsafe.Pointer(pCheck)).Frc = SQLITE_INTERRUPT
  81236 		(*IntegrityCk)(unsafe.Pointer(pCheck)).FnErr++
  81237 		(*IntegrityCk)(unsafe.Pointer(pCheck)).FmxErr = 0
  81238 	}
  81239 	if (*Sqlite3)(unsafe.Pointer(db)).FxProgress != 0 {
  81240 		(*IntegrityCk)(unsafe.Pointer(pCheck)).FnStep++
  81241 		if (*IntegrityCk)(unsafe.Pointer(pCheck)).FnStep%(*Sqlite3)(unsafe.Pointer(db)).FnProgressOps == U32(0) &&
  81242 			(*struct {
  81243 				f func(*libc.TLS, uintptr) int32
  81244 			})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxProgress})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProgressArg) != 0 {
  81245 			(*IntegrityCk)(unsafe.Pointer(pCheck)).Frc = SQLITE_INTERRUPT
  81246 			(*IntegrityCk)(unsafe.Pointer(pCheck)).FnErr++
  81247 			(*IntegrityCk)(unsafe.Pointer(pCheck)).FmxErr = 0
  81248 		}
  81249 	}
  81250 }
  81251 
  81252 func checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) {
  81253 	bp := tls.Alloc(16)
  81254 	defer tls.Free(16)
  81255 
  81256 	var ap Va_list
  81257 	_ = ap
  81258 	checkProgress(tls, pCheck)
  81259 	if !((*IntegrityCk)(unsafe.Pointer(pCheck)).FmxErr != 0) {
  81260 		return
  81261 	}
  81262 	(*IntegrityCk)(unsafe.Pointer(pCheck)).FmxErr--
  81263 	(*IntegrityCk)(unsafe.Pointer(pCheck)).FnErr++
  81264 	ap = va
  81265 	if (*IntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FnChar != 0 {
  81266 		Xsqlite3_str_append(tls, pCheck+64, ts+5414, 1)
  81267 	}
  81268 	if (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx != 0 {
  81269 		Xsqlite3_str_appendf(tls, pCheck+64, (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx, libc.VaList(bp, (*IntegrityCk)(unsafe.Pointer(pCheck)).Fv1, (*IntegrityCk)(unsafe.Pointer(pCheck)).Fv2))
  81270 	}
  81271 	Xsqlite3_str_vappendf(tls, pCheck+64, zFormat, ap)
  81272 	_ = ap
  81273 	if int32((*IntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FaccError) == SQLITE_NOMEM {
  81274 		checkOom(tls, pCheck)
  81275 	}
  81276 }
  81277 
  81278 func getPageReferenced(tls *libc.TLS, pCheck uintptr, iPg Pgno) int32 {
  81279 	return int32(*(*U8)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FaPgRef + uintptr(iPg/Pgno(8))))) & (int32(1) << (iPg & Pgno(0x07)))
  81280 }
  81281 
  81282 func setPageReferenced(tls *libc.TLS, pCheck uintptr, iPg Pgno) {
  81283 	*(*U8)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FaPgRef + uintptr(iPg/Pgno(8)))) |= U8(int32(1) << (iPg & Pgno(0x07)))
  81284 }
  81285 
  81286 func checkRef(tls *libc.TLS, pCheck uintptr, iPage Pgno) int32 {
  81287 	bp := tls.Alloc(16)
  81288 	defer tls.Free(16)
  81289 
  81290 	if iPage > (*IntegrityCk)(unsafe.Pointer(pCheck)).FnPage || iPage == Pgno(0) {
  81291 		checkAppendMsg(tls, pCheck, ts+5416, libc.VaList(bp, iPage))
  81292 		return 1
  81293 	}
  81294 	if getPageReferenced(tls, pCheck, iPage) != 0 {
  81295 		checkAppendMsg(tls, pCheck, ts+5439, libc.VaList(bp+8, iPage))
  81296 		return 1
  81297 	}
  81298 	setPageReferenced(tls, pCheck, iPage)
  81299 	return 0
  81300 }
  81301 
  81302 func checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild Pgno, eType U8, iParent Pgno) {
  81303 	bp := tls.Alloc(56)
  81304 	defer tls.Free(56)
  81305 
  81306 	var rc int32
  81307 
  81308 	rc = ptrmapGet(tls, (*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt, iChild, bp+48, bp+52)
  81309 	if rc != SQLITE_OK {
  81310 		if rc == SQLITE_NOMEM || rc == SQLITE_IOERR|int32(12)<<8 {
  81311 			checkOom(tls, pCheck)
  81312 		}
  81313 		checkAppendMsg(tls, pCheck, ts+5464, libc.VaList(bp, iChild))
  81314 		return
  81315 	}
  81316 
  81317 	if int32(*(*U8)(unsafe.Pointer(bp + 48))) != int32(eType) || *(*Pgno)(unsafe.Pointer(bp + 52)) != iParent {
  81318 		checkAppendMsg(tls, pCheck,
  81319 			ts+5493,
  81320 			libc.VaList(bp+8, iChild, int32(eType), iParent, int32(*(*U8)(unsafe.Pointer(bp + 48))), *(*Pgno)(unsafe.Pointer(bp + 52))))
  81321 	}
  81322 }
  81323 
  81324 func checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U32) {
  81325 	bp := tls.Alloc(48)
  81326 	defer tls.Free(48)
  81327 
  81328 	var i int32
  81329 	var expected U32 = N
  81330 	var nErrAtStart int32 = (*IntegrityCk)(unsafe.Pointer(pCheck)).FnErr
  81331 	for iPage != Pgno(0) && (*IntegrityCk)(unsafe.Pointer(pCheck)).FmxErr != 0 {
  81332 		var pOvflData uintptr
  81333 		if checkRef(tls, pCheck, iPage) != 0 {
  81334 			break
  81335 		}
  81336 		N--
  81337 		if Xsqlite3PagerGet(tls, (*IntegrityCk)(unsafe.Pointer(pCheck)).FpPager, iPage, bp+40, 0) != 0 {
  81338 			checkAppendMsg(tls, pCheck, ts+5547, libc.VaList(bp, iPage))
  81339 			break
  81340 		}
  81341 		pOvflData = Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp + 40)))
  81342 		if isFreeList != 0 {
  81343 			var n U32 = Xsqlite3Get4byte(tls, pOvflData+4)
  81344 			if (*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FautoVacuum != 0 {
  81345 				checkPtrmap(tls, pCheck, iPage, uint8(PTRMAP_FREEPAGE), uint32(0))
  81346 			}
  81347 			if n > (*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FusableSize/U32(4)-U32(2) {
  81348 				checkAppendMsg(tls, pCheck,
  81349 					ts+5569, libc.VaList(bp+8, iPage))
  81350 				N--
  81351 			} else {
  81352 				for i = 0; i < int32(n); i++ {
  81353 					var iFreePage Pgno = Xsqlite3Get4byte(tls, pOvflData+uintptr(8+i*4))
  81354 					if (*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FautoVacuum != 0 {
  81355 						checkPtrmap(tls, pCheck, iFreePage, uint8(PTRMAP_FREEPAGE), uint32(0))
  81356 					}
  81357 					checkRef(tls, pCheck, iFreePage)
  81358 				}
  81359 				N = N - n
  81360 			}
  81361 		} else {
  81362 			if (*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FautoVacuum != 0 && N > U32(0) {
  81363 				i = int32(Xsqlite3Get4byte(tls, pOvflData))
  81364 				checkPtrmap(tls, pCheck, uint32(i), uint8(PTRMAP_OVERFLOW2), iPage)
  81365 			}
  81366 		}
  81367 		iPage = Xsqlite3Get4byte(tls, pOvflData)
  81368 		Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp + 40)))
  81369 	}
  81370 	if N != 0 && nErrAtStart == (*IntegrityCk)(unsafe.Pointer(pCheck)).FnErr {
  81371 		checkAppendMsg(tls, pCheck,
  81372 			ts+5608,
  81373 			libc.VaList(bp+16, func() uintptr {
  81374 				if isFreeList != 0 {
  81375 					return ts + 5634
  81376 				}
  81377 				return ts + 5639
  81378 			}(),
  81379 				expected-N, expected))
  81380 	}
  81381 }
  81382 
  81383 func btreeHeapInsert(tls *libc.TLS, aHeap uintptr, x U32) {
  81384 	var j U32
  81385 	var i U32
  81386 
  81387 	i = libc.PreIncUint32(&*(*U32)(unsafe.Pointer(aHeap)), 1)
  81388 	*(*U32)(unsafe.Pointer(aHeap + uintptr(i)*4)) = x
  81389 	for libc.AssignUint32(&j, i/U32(2)) > U32(0) && *(*U32)(unsafe.Pointer(aHeap + uintptr(j)*4)) > *(*U32)(unsafe.Pointer(aHeap + uintptr(i)*4)) {
  81390 		x = *(*U32)(unsafe.Pointer(aHeap + uintptr(j)*4))
  81391 		*(*U32)(unsafe.Pointer(aHeap + uintptr(j)*4)) = *(*U32)(unsafe.Pointer(aHeap + uintptr(i)*4))
  81392 		*(*U32)(unsafe.Pointer(aHeap + uintptr(i)*4)) = x
  81393 		i = j
  81394 	}
  81395 }
  81396 
  81397 func btreeHeapPull(tls *libc.TLS, aHeap uintptr, pOut uintptr) int32 {
  81398 	var j U32
  81399 	var i U32
  81400 	var x U32
  81401 	if libc.AssignUint32(&x, *(*U32)(unsafe.Pointer(aHeap))) == U32(0) {
  81402 		return 0
  81403 	}
  81404 	*(*U32)(unsafe.Pointer(pOut)) = *(*U32)(unsafe.Pointer(aHeap + 1*4))
  81405 	*(*U32)(unsafe.Pointer(aHeap + 1*4)) = *(*U32)(unsafe.Pointer(aHeap + uintptr(x)*4))
  81406 	*(*U32)(unsafe.Pointer(aHeap + uintptr(x)*4)) = 0xffffffff
  81407 	*(*U32)(unsafe.Pointer(aHeap))--
  81408 	i = U32(1)
  81409 	for libc.AssignUint32(&j, i*U32(2)) <= *(*U32)(unsafe.Pointer(aHeap)) {
  81410 		if *(*U32)(unsafe.Pointer(aHeap + uintptr(j)*4)) > *(*U32)(unsafe.Pointer(aHeap + uintptr(j+U32(1))*4)) {
  81411 			j++
  81412 		}
  81413 		if *(*U32)(unsafe.Pointer(aHeap + uintptr(i)*4)) < *(*U32)(unsafe.Pointer(aHeap + uintptr(j)*4)) {
  81414 			break
  81415 		}
  81416 		x = *(*U32)(unsafe.Pointer(aHeap + uintptr(i)*4))
  81417 		*(*U32)(unsafe.Pointer(aHeap + uintptr(i)*4)) = *(*U32)(unsafe.Pointer(aHeap + uintptr(j)*4))
  81418 		*(*U32)(unsafe.Pointer(aHeap + uintptr(j)*4)) = x
  81419 		i = j
  81420 	}
  81421 	return 1
  81422 }
  81423 
  81424 func checkTreePage(tls *libc.TLS, pCheck uintptr, iPage Pgno, piMinKey uintptr, maxKey I64) int32 {
  81425 	bp := tls.Alloc(140)
  81426 	defer tls.Free(140)
  81427 	*(*I64)(unsafe.Pointer(bp + 104)) = maxKey
  81428 
  81429 	var i int32
  81430 	var rc int32
  81431 	var depth int32
  81432 	var d2 int32
  81433 	var pgno int32
  81434 	var nFrag int32
  81435 	var hdr int32
  81436 	var cellStart int32
  81437 	var nCell int32
  81438 	var doCoverageCheck int32
  81439 	var keyCanBeEqual int32
  81440 
  81441 	var data uintptr
  81442 	var pCell uintptr
  81443 	var pCellIdx uintptr
  81444 	var pBt uintptr
  81445 	var pc U32
  81446 	var usableSize U32
  81447 	var contentOffset U32
  81448 	var heap uintptr
  81449 
  81450 	var prev U32
  81451 	var saved_zPfx uintptr
  81452 	var saved_v1 int32
  81453 	var saved_v2 int32
  81454 	var savedIsInit U8
  81455 	var nPage U32
  81456 	var pgnoOvfl Pgno
  81457 
  81458 	var size U32
  81459 	var size1 int32
  81460 	var j int32
  81461 	*(*uintptr)(unsafe.Pointer(bp + 96)) = uintptr(0)
  81462 	depth = -1
  81463 	doCoverageCheck = 1
  81464 	keyCanBeEqual = 1
  81465 	heap = uintptr(0)
  81466 	prev = U32(0)
  81467 	saved_zPfx = (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx
  81468 	saved_v1 = int32((*IntegrityCk)(unsafe.Pointer(pCheck)).Fv1)
  81469 	saved_v2 = (*IntegrityCk)(unsafe.Pointer(pCheck)).Fv2
  81470 	savedIsInit = U8(0)
  81471 
  81472 	checkProgress(tls, pCheck)
  81473 	if !((*IntegrityCk)(unsafe.Pointer(pCheck)).FmxErr == 0) {
  81474 		goto __1
  81475 	}
  81476 	goto end_of_check
  81477 __1:
  81478 	;
  81479 	pBt = (*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt
  81480 	usableSize = (*BtShared)(unsafe.Pointer(pBt)).FusableSize
  81481 	if !(iPage == Pgno(0)) {
  81482 		goto __2
  81483 	}
  81484 	return 0
  81485 __2:
  81486 	;
  81487 	if !(checkRef(tls, pCheck, iPage) != 0) {
  81488 		goto __3
  81489 	}
  81490 	return 0
  81491 __3:
  81492 	;
  81493 	(*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 5660
  81494 	(*IntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = iPage
  81495 	if !(libc.AssignInt32(&rc, btreeGetPage(tls, pBt, iPage, bp+96, 0)) != 0) {
  81496 		goto __4
  81497 	}
  81498 	checkAppendMsg(tls, pCheck,
  81499 		ts+5670, libc.VaList(bp, rc))
  81500 	goto end_of_check
  81501 __4:
  81502 	;
  81503 	savedIsInit = (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).FisInit
  81504 	(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).FisInit = U8(0)
  81505 	if !(libc.AssignInt32(&rc, btreeInitPage(tls, *(*uintptr)(unsafe.Pointer(bp + 96)))) != 0) {
  81506 		goto __5
  81507 	}
  81508 
  81509 	checkAppendMsg(tls, pCheck,
  81510 		ts+5708, libc.VaList(bp+8, rc))
  81511 	goto end_of_check
  81512 __5:
  81513 	;
  81514 	if !(libc.AssignInt32(&rc, btreeComputeFreeSpace(tls, *(*uintptr)(unsafe.Pointer(bp + 96)))) != 0) {
  81515 		goto __6
  81516 	}
  81517 
  81518 	checkAppendMsg(tls, pCheck, ts+5746, libc.VaList(bp+16, rc))
  81519 	goto end_of_check
  81520 __6:
  81521 	;
  81522 	data = (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).FaData
  81523 	hdr = int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).FhdrOffset)
  81524 
  81525 	(*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 5768
  81526 	contentOffset = U32((int32(*(*U8)(unsafe.Pointer(data + uintptr(hdr+5))))<<8|int32(*(*U8)(unsafe.Pointer(data + uintptr(hdr+5) + 1)))-1)&0xffff + 1)
  81527 
  81528 	nCell = int32(*(*U8)(unsafe.Pointer(data + uintptr(hdr+3))))<<8 | int32(*(*U8)(unsafe.Pointer(data + uintptr(hdr+3) + 1)))
  81529 
  81530 	cellStart = hdr + 12 - 4*int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fleaf)
  81531 
  81532 	pCellIdx = data + uintptr(cellStart+2*(nCell-1))
  81533 
  81534 	if !!(int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fleaf) != 0) {
  81535 		goto __7
  81536 	}
  81537 
  81538 	pgno = int32(Xsqlite3Get4byte(tls, data+uintptr(hdr+8)))
  81539 	if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) {
  81540 		goto __9
  81541 	}
  81542 	(*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 5794
  81543 	checkPtrmap(tls, pCheck, uint32(pgno), uint8(PTRMAP_BTREE), iPage)
  81544 __9:
  81545 	;
  81546 	depth = checkTreePage(tls, pCheck, uint32(pgno), bp+104, *(*I64)(unsafe.Pointer(bp + 104)))
  81547 	keyCanBeEqual = 0
  81548 	goto __8
  81549 __7:
  81550 	heap = (*IntegrityCk)(unsafe.Pointer(pCheck)).Fheap
  81551 	*(*U32)(unsafe.Pointer(heap)) = U32(0)
  81552 __8:
  81553 	;
  81554 	i = nCell - 1
  81555 __10:
  81556 	if !(i >= 0 && (*IntegrityCk)(unsafe.Pointer(pCheck)).FmxErr != 0) {
  81557 		goto __12
  81558 	}
  81559 
  81560 	(*IntegrityCk)(unsafe.Pointer(pCheck)).Fv2 = i
  81561 
  81562 	pc = U32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(pCellIdx))))
  81563 	pCellIdx -= uintptr(2)
  81564 	if !(pc < contentOffset || pc > usableSize-U32(4)) {
  81565 		goto __13
  81566 	}
  81567 	checkAppendMsg(tls, pCheck, ts+5822,
  81568 		libc.VaList(bp+24, pc, contentOffset, usableSize-U32(4)))
  81569 	doCoverageCheck = 0
  81570 	goto __11
  81571 __13:
  81572 	;
  81573 	pCell = data + uintptr(pc)
  81574 	(*struct {
  81575 		f func(*libc.TLS, uintptr, uintptr, uintptr)
  81576 	})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).FxParseCell})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 96)), pCell, bp+112)
  81577 	if !(pc+U32((*CellInfo)(unsafe.Pointer(bp+112)).FnSize) > usableSize) {
  81578 		goto __14
  81579 	}
  81580 	checkAppendMsg(tls, pCheck, ts+5852, 0)
  81581 	doCoverageCheck = 0
  81582 	goto __11
  81583 __14:
  81584 	;
  81585 	if !((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).FintKey != 0) {
  81586 		goto __15
  81587 	}
  81588 	if !(func() int32 {
  81589 		if keyCanBeEqual != 0 {
  81590 			return libc.Bool32((*CellInfo)(unsafe.Pointer(bp+112)).FnKey > *(*I64)(unsafe.Pointer(bp + 104)))
  81591 		}
  81592 		return libc.Bool32((*CellInfo)(unsafe.Pointer(bp+112)).FnKey >= *(*I64)(unsafe.Pointer(bp + 104)))
  81593 	}() != 0) {
  81594 		goto __16
  81595 	}
  81596 	checkAppendMsg(tls, pCheck, ts+5876, libc.VaList(bp+48, (*CellInfo)(unsafe.Pointer(bp+112)).FnKey))
  81597 __16:
  81598 	;
  81599 	*(*I64)(unsafe.Pointer(bp + 104)) = (*CellInfo)(unsafe.Pointer(bp + 112)).FnKey
  81600 	keyCanBeEqual = 0
  81601 __15:
  81602 	;
  81603 	if !((*CellInfo)(unsafe.Pointer(bp+112)).FnPayload > U32((*CellInfo)(unsafe.Pointer(bp+112)).FnLocal)) {
  81604 		goto __17
  81605 	}
  81606 
  81607 	nPage = ((*CellInfo)(unsafe.Pointer(bp+112)).FnPayload - U32((*CellInfo)(unsafe.Pointer(bp+112)).FnLocal) + usableSize - U32(5)) / (usableSize - U32(4))
  81608 	pgnoOvfl = Xsqlite3Get4byte(tls, pCell+uintptr(int32((*CellInfo)(unsafe.Pointer(bp+112)).FnSize)-4))
  81609 	if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) {
  81610 		goto __18
  81611 	}
  81612 	checkPtrmap(tls, pCheck, pgnoOvfl, uint8(PTRMAP_OVERFLOW1), iPage)
  81613 __18:
  81614 	;
  81615 	checkList(tls, pCheck, 0, pgnoOvfl, nPage)
  81616 __17:
  81617 	;
  81618 	if !!(int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fleaf) != 0) {
  81619 		goto __19
  81620 	}
  81621 
  81622 	pgno = int32(Xsqlite3Get4byte(tls, pCell))
  81623 	if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) {
  81624 		goto __21
  81625 	}
  81626 	checkPtrmap(tls, pCheck, uint32(pgno), uint8(PTRMAP_BTREE), iPage)
  81627 __21:
  81628 	;
  81629 	d2 = checkTreePage(tls, pCheck, uint32(pgno), bp+104, *(*I64)(unsafe.Pointer(bp + 104)))
  81630 	keyCanBeEqual = 0
  81631 	if !(d2 != depth) {
  81632 		goto __22
  81633 	}
  81634 	checkAppendMsg(tls, pCheck, ts+5900, 0)
  81635 	depth = d2
  81636 __22:
  81637 	;
  81638 	goto __20
  81639 __19:
  81640 	btreeHeapInsert(tls, heap, pc<<16|(pc+U32((*CellInfo)(unsafe.Pointer(bp+112)).FnSize)-U32(1)))
  81641 __20:
  81642 	;
  81643 	goto __11
  81644 __11:
  81645 	i--
  81646 	goto __10
  81647 	goto __12
  81648 __12:
  81649 	;
  81650 	*(*I64)(unsafe.Pointer(piMinKey)) = *(*I64)(unsafe.Pointer(bp + 104))
  81651 
  81652 	(*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = uintptr(0)
  81653 	if !(doCoverageCheck != 0 && (*IntegrityCk)(unsafe.Pointer(pCheck)).FmxErr > 0) {
  81654 		goto __23
  81655 	}
  81656 
  81657 	if !!(int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fleaf) != 0) {
  81658 		goto __24
  81659 	}
  81660 	heap = (*IntegrityCk)(unsafe.Pointer(pCheck)).Fheap
  81661 	*(*U32)(unsafe.Pointer(heap)) = U32(0)
  81662 	i = nCell - 1
  81663 __25:
  81664 	if !(i >= 0) {
  81665 		goto __27
  81666 	}
  81667 	pc = U32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(data + uintptr(cellStart+i*2)))))
  81668 	size = U32((*struct {
  81669 		f func(*libc.TLS, uintptr, uintptr) U16
  81670 	})(unsafe.Pointer(&struct{ uintptr }{(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).FxCellSize})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 96)), data+uintptr(pc)))
  81671 	btreeHeapInsert(tls, heap, pc<<16|(pc+size-U32(1)))
  81672 	goto __26
  81673 __26:
  81674 	i--
  81675 	goto __25
  81676 	goto __27
  81677 __27:
  81678 	;
  81679 __24:
  81680 	;
  81681 	i = int32(*(*U8)(unsafe.Pointer(data + uintptr(hdr+1))))<<8 | int32(*(*U8)(unsafe.Pointer(data + uintptr(hdr+1) + 1)))
  81682 __28:
  81683 	if !(i > 0) {
  81684 		goto __29
  81685 	}
  81686 
  81687 	size1 = int32(*(*U8)(unsafe.Pointer(data + uintptr(i+2))))<<8 | int32(*(*U8)(unsafe.Pointer(data + uintptr(i+2) + 1)))
  81688 
  81689 	btreeHeapInsert(tls, heap, U32(i)<<16|U32(i+size1-1))
  81690 
  81691 	j = int32(*(*U8)(unsafe.Pointer(data + uintptr(i))))<<8 | int32(*(*U8)(unsafe.Pointer(data + uintptr(i) + 1)))
  81692 
  81693 	i = j
  81694 	goto __28
  81695 __29:
  81696 	;
  81697 	nFrag = 0
  81698 	prev = contentOffset - U32(1)
  81699 __30:
  81700 	if !(btreeHeapPull(tls, heap, bp+136) != 0) {
  81701 		goto __31
  81702 	}
  81703 	if !(prev&U32(0xffff) >= *(*U32)(unsafe.Pointer(bp + 136))>>16) {
  81704 		goto __32
  81705 	}
  81706 	checkAppendMsg(tls, pCheck,
  81707 		ts+5925, libc.VaList(bp+56, *(*U32)(unsafe.Pointer(bp + 136))>>16, iPage))
  81708 	goto __31
  81709 	goto __33
  81710 __32:
  81711 	nFrag = int32(U32(nFrag) + (*(*U32)(unsafe.Pointer(bp + 136))>>16 - prev&U32(0xffff) - U32(1)))
  81712 	prev = *(*U32)(unsafe.Pointer(bp + 136))
  81713 __33:
  81714 	;
  81715 	goto __30
  81716 __31:
  81717 	;
  81718 	nFrag = int32(U32(nFrag) + (usableSize - prev&U32(0xffff) - U32(1)))
  81719 
  81720 	if !(*(*U32)(unsafe.Pointer(heap)) == U32(0) && nFrag != int32(*(*U8)(unsafe.Pointer(data + uintptr(hdr+7))))) {
  81721 		goto __34
  81722 	}
  81723 	checkAppendMsg(tls, pCheck,
  81724 		ts+5962,
  81725 		libc.VaList(bp+72, nFrag, int32(*(*U8)(unsafe.Pointer(data + uintptr(hdr+7)))), iPage))
  81726 __34:
  81727 	;
  81728 __23:
  81729 	;
  81730 end_of_check:
  81731 	if !!(doCoverageCheck != 0) {
  81732 		goto __35
  81733 	}
  81734 	(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).FisInit = savedIsInit
  81735 __35:
  81736 	;
  81737 	releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 96)))
  81738 	(*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = saved_zPfx
  81739 	(*IntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = Pgno(saved_v1)
  81740 	(*IntegrityCk)(unsafe.Pointer(pCheck)).Fv2 = saved_v2
  81741 	return depth + 1
  81742 }
  81743 
  81744 // This routine does a complete check of the given BTree file.  aRoot[] is
  81745 // an array of pages numbers were each page number is the root page of
  81746 // a table.  nRoot is the number of entries in aRoot.
  81747 //
  81748 // A read-only or read-write transaction must be opened before calling
  81749 // this function.
  81750 //
  81751 // Write the number of error seen in *pnErr.  Except for some memory
  81752 // allocation errors,  an error message held in memory obtained from
  81753 // malloc is returned if *pnErr is non-zero.  If *pnErr==0 then NULL is
  81754 // returned.  If a memory allocation error occurs, NULL is returned.
  81755 //
  81756 // If the first entry in aRoot[] is 0, that indicates that the list of
  81757 // root pages is incomplete.  This is a "partial integrity-check".  This
  81758 // happens when performing an integrity check on a single table.  The
  81759 // zero is skipped, of course.  But in addition, the freelist checks
  81760 // and the checks to make sure every page is referenced are also skipped,
  81761 // since obviously it is not possible to know which pages are covered by
  81762 // the unverified btrees.  Except, if aRoot[1] is 1, then the freelist
  81763 // checks are still performed.
  81764 func Xsqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uintptr, nRoot int32, mxErr int32, pnErr uintptr, pzOut uintptr) int32 {
  81765 	bp := tls.Alloc(256)
  81766 	defer tls.Free(256)
  81767 
  81768 	var i Pgno
  81769 
  81770 	var pBt uintptr
  81771 	var savedDbFlags U64
  81772 
  81773 	var bPartial int32
  81774 	var bCkFreelist int32
  81775 	var mx Pgno
  81776 	var mxInHdr Pgno
  81777 
  81778 	pBt = (*Btree)(unsafe.Pointer(p)).FpBt
  81779 	savedDbFlags = (*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags
  81780 	bPartial = 0
  81781 	bCkFreelist = 1
  81782 
  81783 	if !(*(*Pgno)(unsafe.Pointer(aRoot)) == Pgno(0)) {
  81784 		goto __1
  81785 	}
  81786 
  81787 	bPartial = 1
  81788 	if !(*(*Pgno)(unsafe.Pointer(aRoot + 1*4)) != Pgno(1)) {
  81789 		goto __2
  81790 	}
  81791 	bCkFreelist = 0
  81792 __2:
  81793 	;
  81794 __1:
  81795 	;
  81796 	Xsqlite3BtreeEnter(tls, p)
  81797 
  81798 	libc.Xmemset(tls, bp+32, 0, uint64(unsafe.Sizeof(IntegrityCk{})))
  81799 	(*IntegrityCk)(unsafe.Pointer(bp + 32)).Fdb = db
  81800 	(*IntegrityCk)(unsafe.Pointer(bp + 32)).FpBt = pBt
  81801 	(*IntegrityCk)(unsafe.Pointer(bp + 32)).FpPager = (*BtShared)(unsafe.Pointer(pBt)).FpPager
  81802 	(*IntegrityCk)(unsafe.Pointer(bp + 32)).FnPage = btreePagecount(tls, (*IntegrityCk)(unsafe.Pointer(bp+32)).FpBt)
  81803 	(*IntegrityCk)(unsafe.Pointer(bp + 32)).FmxErr = mxErr
  81804 	Xsqlite3StrAccumInit(tls, bp+32+64, uintptr(0), bp+144, int32(unsafe.Sizeof([100]int8{})), SQLITE_MAX_LENGTH)
  81805 	(*IntegrityCk)(unsafe.Pointer(bp + 32)).FerrMsg.FprintfFlags = U8(SQLITE_PRINTF_INTERNAL)
  81806 	if !((*IntegrityCk)(unsafe.Pointer(bp+32)).FnPage == Pgno(0)) {
  81807 		goto __3
  81808 	}
  81809 	goto integrity_ck_cleanup
  81810 __3:
  81811 	;
  81812 	(*IntegrityCk)(unsafe.Pointer(bp + 32)).FaPgRef = Xsqlite3MallocZero(tls, uint64((*IntegrityCk)(unsafe.Pointer(bp+32)).FnPage/Pgno(8)+Pgno(1)))
  81813 	if !!(int32((*IntegrityCk)(unsafe.Pointer(bp+32)).FaPgRef) != 0) {
  81814 		goto __4
  81815 	}
  81816 	checkOom(tls, bp+32)
  81817 	goto integrity_ck_cleanup
  81818 __4:
  81819 	;
  81820 	(*IntegrityCk)(unsafe.Pointer(bp + 32)).Fheap = Xsqlite3PageMalloc(tls, int32((*BtShared)(unsafe.Pointer(pBt)).FpageSize))
  81821 	if !((*IntegrityCk)(unsafe.Pointer(bp+32)).Fheap == uintptr(0)) {
  81822 		goto __5
  81823 	}
  81824 	checkOom(tls, bp+32)
  81825 	goto integrity_ck_cleanup
  81826 __5:
  81827 	;
  81828 	i = U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer(pBt)).FpageSize + U32(1)
  81829 	if !(i <= (*IntegrityCk)(unsafe.Pointer(bp+32)).FnPage) {
  81830 		goto __6
  81831 	}
  81832 	setPageReferenced(tls, bp+32, i)
  81833 __6:
  81834 	;
  81835 	if !(bCkFreelist != 0) {
  81836 		goto __7
  81837 	}
  81838 	(*IntegrityCk)(unsafe.Pointer(bp + 32)).FzPfx = ts + 6014
  81839 	checkList(tls, bp+32, 1, Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+32),
  81840 		Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36))
  81841 	(*IntegrityCk)(unsafe.Pointer(bp + 32)).FzPfx = uintptr(0)
  81842 __7:
  81843 	;
  81844 	if !!(bPartial != 0) {
  81845 		goto __8
  81846 	}
  81847 	if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) {
  81848 		goto __9
  81849 	}
  81850 	mx = Pgno(0)
  81851 	i = Pgno(0)
  81852 __11:
  81853 	if !(int32(i) < nRoot) {
  81854 		goto __13
  81855 	}
  81856 	if !(mx < *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4))) {
  81857 		goto __14
  81858 	}
  81859 	mx = *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4))
  81860 __14:
  81861 	;
  81862 	goto __12
  81863 __12:
  81864 	i++
  81865 	goto __11
  81866 	goto __13
  81867 __13:
  81868 	;
  81869 	mxInHdr = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+52)
  81870 	if !(mx != mxInHdr) {
  81871 		goto __15
  81872 	}
  81873 	checkAppendMsg(tls, bp+32,
  81874 		ts+6030,
  81875 		libc.VaList(bp, mx, mxInHdr))
  81876 __15:
  81877 	;
  81878 	goto __10
  81879 __9:
  81880 	if !(Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+64) != U32(0)) {
  81881 		goto __16
  81882 	}
  81883 	checkAppendMsg(tls, bp+32,
  81884 		ts+6075, 0)
  81885 __16:
  81886 	;
  81887 __10:
  81888 	;
  81889 __8:
  81890 	;
  81891 	*(*U64)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb + 48)) &= libc.CplUint64(uint64(SQLITE_CellSizeCk))
  81892 	i = Pgno(0)
  81893 __17:
  81894 	if !(int32(i) < nRoot && (*IntegrityCk)(unsafe.Pointer(bp+32)).FmxErr != 0) {
  81895 		goto __19
  81896 	}
  81897 	if !(*(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)) == Pgno(0)) {
  81898 		goto __20
  81899 	}
  81900 	goto __18
  81901 __20:
  81902 	;
  81903 	if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 && *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)) > Pgno(1) && !(bPartial != 0)) {
  81904 		goto __21
  81905 	}
  81906 	checkPtrmap(tls, bp+32, *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)), uint8(PTRMAP_ROOTPAGE), uint32(0))
  81907 __21:
  81908 	;
  81909 	checkTreePage(tls, bp+32, *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)), bp+248, int64(0xffffffff)|int64(0x7fffffff)<<32)
  81910 	goto __18
  81911 __18:
  81912 	i++
  81913 	goto __17
  81914 	goto __19
  81915 __19:
  81916 	;
  81917 	(*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags = savedDbFlags
  81918 
  81919 	if !!(bPartial != 0) {
  81920 		goto __22
  81921 	}
  81922 	i = Pgno(1)
  81923 __23:
  81924 	if !(i <= (*IntegrityCk)(unsafe.Pointer(bp+32)).FnPage && (*IntegrityCk)(unsafe.Pointer(bp+32)).FmxErr != 0) {
  81925 		goto __25
  81926 	}
  81927 
  81928 	if !(getPageReferenced(tls, bp+32, i) == 0 && (ptrmapPageno(tls, pBt, i) != i || !(int32((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum) != 0))) {
  81929 		goto __26
  81930 	}
  81931 	checkAppendMsg(tls, bp+32, ts+6130, libc.VaList(bp+16, i))
  81932 __26:
  81933 	;
  81934 	if !(getPageReferenced(tls, bp+32, i) != 0 && (ptrmapPageno(tls, pBt, i) == i && (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0)) {
  81935 		goto __27
  81936 	}
  81937 	checkAppendMsg(tls, bp+32, ts+6152, libc.VaList(bp+24, i))
  81938 __27:
  81939 	;
  81940 	goto __24
  81941 __24:
  81942 	i++
  81943 	goto __23
  81944 	goto __25
  81945 __25:
  81946 	;
  81947 __22:
  81948 	;
  81949 integrity_ck_cleanup:
  81950 	Xsqlite3PageFree(tls, (*IntegrityCk)(unsafe.Pointer(bp+32)).Fheap)
  81951 	Xsqlite3_free(tls, (*IntegrityCk)(unsafe.Pointer(bp+32)).FaPgRef)
  81952 	*(*int32)(unsafe.Pointer(pnErr)) = (*IntegrityCk)(unsafe.Pointer(bp + 32)).FnErr
  81953 	if !((*IntegrityCk)(unsafe.Pointer(bp+32)).FnErr == 0) {
  81954 		goto __28
  81955 	}
  81956 	Xsqlite3_str_reset(tls, bp+32+64)
  81957 	*(*uintptr)(unsafe.Pointer(pzOut)) = uintptr(0)
  81958 	goto __29
  81959 __28:
  81960 	*(*uintptr)(unsafe.Pointer(pzOut)) = Xsqlite3StrAccumFinish(tls, bp+32+64)
  81961 __29:
  81962 	;
  81963 	Xsqlite3BtreeLeave(tls, p)
  81964 	return (*IntegrityCk)(unsafe.Pointer(bp + 32)).Frc
  81965 }
  81966 
  81967 // Return the full pathname of the underlying database file.  Return
  81968 // an empty string if the database is in-memory or a TEMP database.
  81969 //
  81970 // The pager filename is invariant as long as the pager is
  81971 // open so it is safe to access without the BtShared mutex.
  81972 func Xsqlite3BtreeGetFilename(tls *libc.TLS, p uintptr) uintptr {
  81973 	return Xsqlite3PagerFilename(tls, (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpPager, 1)
  81974 }
  81975 
  81976 // Return the pathname of the journal file for this database. The return
  81977 // value of this routine is the same regardless of whether the journal file
  81978 // has been created or not.
  81979 //
  81980 // The pager journal filename is invariant as long as the pager is
  81981 // open so it is safe to access without the BtShared mutex.
  81982 func Xsqlite3BtreeGetJournalname(tls *libc.TLS, p uintptr) uintptr {
  81983 	return Xsqlite3PagerJournalname(tls, (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpPager)
  81984 }
  81985 
  81986 // Return one of SQLITE_TXN_NONE, SQLITE_TXN_READ, or SQLITE_TXN_WRITE
  81987 // to describe the current transaction state of Btree p.
  81988 func Xsqlite3BtreeTxnState(tls *libc.TLS, p uintptr) int32 {
  81989 	if p != 0 {
  81990 		return int32((*Btree)(unsafe.Pointer(p)).FinTrans)
  81991 	}
  81992 	return 0
  81993 }
  81994 
  81995 // Run a checkpoint on the Btree passed as the first argument.
  81996 //
  81997 // Return SQLITE_LOCKED if this or any other connection has an open
  81998 // transaction on the shared-cache the argument Btree is connected to.
  81999 //
  82000 // Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART.
  82001 func Xsqlite3BtreeCheckpoint(tls *libc.TLS, p uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 {
  82002 	var rc int32 = SQLITE_OK
  82003 	if p != 0 {
  82004 		var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  82005 		Xsqlite3BtreeEnter(tls, p)
  82006 		if int32((*BtShared)(unsafe.Pointer(pBt)).FinTransaction) != TRANS_NONE {
  82007 			rc = SQLITE_LOCKED
  82008 		} else {
  82009 			rc = Xsqlite3PagerCheckpoint(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, (*Btree)(unsafe.Pointer(p)).Fdb, eMode, pnLog, pnCkpt)
  82010 		}
  82011 		Xsqlite3BtreeLeave(tls, p)
  82012 	}
  82013 	return rc
  82014 }
  82015 
  82016 // Return true if there is currently a backup running on Btree p.
  82017 func Xsqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) int32 {
  82018 	return libc.Bool32((*Btree)(unsafe.Pointer(p)).FnBackup != 0)
  82019 }
  82020 
  82021 // This function returns a pointer to a blob of memory associated with
  82022 // a single shared-btree. The memory is used by client code for its own
  82023 // purposes (for example, to store a high-level schema associated with
  82024 // the shared-btree). The btree layer manages reference counting issues.
  82025 //
  82026 // The first time this is called on a shared-btree, nBytes bytes of memory
  82027 // are allocated, zeroed, and returned to the caller. For each subsequent
  82028 // call the nBytes parameter is ignored and a pointer to the same blob
  82029 // of memory returned.
  82030 //
  82031 // If the nBytes parameter is 0 and the blob of memory has not yet been
  82032 // allocated, a null pointer is returned. If the blob has already been
  82033 // allocated, it is returned as normal.
  82034 //
  82035 // Just before the shared-btree is closed, the function passed as the
  82036 // xFree argument when the memory allocation was made is invoked on the
  82037 // blob of allocated memory. The xFree function should not call sqlite3_free()
  82038 // on the memory, the btree layer does that.
  82039 func Xsqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) uintptr {
  82040 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  82041 	Xsqlite3BtreeEnter(tls, p)
  82042 	if !(int32((*BtShared)(unsafe.Pointer(pBt)).FpSchema) != 0) && nBytes != 0 {
  82043 		(*BtShared)(unsafe.Pointer(pBt)).FpSchema = Xsqlite3DbMallocZero(tls, uintptr(0), uint64(nBytes))
  82044 		(*BtShared)(unsafe.Pointer(pBt)).FxFreeSchema = xFree
  82045 	}
  82046 	Xsqlite3BtreeLeave(tls, p)
  82047 	return (*BtShared)(unsafe.Pointer(pBt)).FpSchema
  82048 }
  82049 
  82050 // Return SQLITE_LOCKED_SHAREDCACHE if another user of the same shared
  82051 // btree as the argument handle holds an exclusive lock on the
  82052 // sqlite_schema table. Otherwise SQLITE_OK.
  82053 func Xsqlite3BtreeSchemaLocked(tls *libc.TLS, p uintptr) int32 {
  82054 	var rc int32
  82055 
  82056 	Xsqlite3BtreeEnter(tls, p)
  82057 	rc = querySharedCacheTableLock(tls, p, uint32(SCHEMA_ROOT), uint8(READ_LOCK))
  82058 
  82059 	Xsqlite3BtreeLeave(tls, p)
  82060 	return rc
  82061 }
  82062 
  82063 // Obtain a lock on the table whose root page is iTab.  The
  82064 // lock is a write lock if isWritelock is true or a read lock
  82065 // if it is false.
  82066 func Xsqlite3BtreeLockTable(tls *libc.TLS, p uintptr, iTab int32, isWriteLock U8) int32 {
  82067 	var rc int32 = SQLITE_OK
  82068 
  82069 	if (*Btree)(unsafe.Pointer(p)).Fsharable != 0 {
  82070 		var lockType U8 = U8(READ_LOCK + int32(isWriteLock))
  82071 
  82072 		Xsqlite3BtreeEnter(tls, p)
  82073 		rc = querySharedCacheTableLock(tls, p, uint32(iTab), lockType)
  82074 		if rc == SQLITE_OK {
  82075 			rc = setSharedCacheTableLock(tls, p, uint32(iTab), lockType)
  82076 		}
  82077 		Xsqlite3BtreeLeave(tls, p)
  82078 	}
  82079 	return rc
  82080 }
  82081 
  82082 // Argument pCsr must be a cursor opened for writing on an
  82083 // INTKEY table currently pointing at a valid table entry.
  82084 // This function modifies the data stored as part of that entry.
  82085 //
  82086 // Only the data content may only be modified, it is not possible to
  82087 // change the length of the data stored. If this function is called with
  82088 // parameters that attempt to write past the end of the existing data,
  82089 // no modifications are made and SQLITE_CORRUPT is returned.
  82090 func Xsqlite3BtreePutData(tls *libc.TLS, pCsr uintptr, offset U32, amt U32, z uintptr) int32 {
  82091 	var rc int32
  82092 
  82093 	rc = func() int32 {
  82094 		if int32((*BtCursor)(unsafe.Pointer(pCsr)).FeState) >= CURSOR_REQUIRESEEK {
  82095 			return btreeRestoreCursorPosition(tls, pCsr)
  82096 		}
  82097 		return SQLITE_OK
  82098 	}()
  82099 	if rc != SQLITE_OK {
  82100 		return rc
  82101 	}
  82102 
  82103 	if int32((*BtCursor)(unsafe.Pointer(pCsr)).FeState) != CURSOR_VALID {
  82104 		return SQLITE_ABORT
  82105 	}
  82106 
  82107 	saveAllCursors(tls, (*BtCursor)(unsafe.Pointer(pCsr)).FpBt, (*BtCursor)(unsafe.Pointer(pCsr)).FpgnoRoot, pCsr)
  82108 
  82109 	if int32((*BtCursor)(unsafe.Pointer(pCsr)).FcurFlags)&BTCF_WriteFlag == 0 {
  82110 		return SQLITE_READONLY
  82111 	}
  82112 
  82113 	return accessPayload(tls, pCsr, offset, amt, z, 1)
  82114 }
  82115 
  82116 // Mark this cursor as an incremental blob cursor.
  82117 func Xsqlite3BtreeIncrblobCursor(tls *libc.TLS, pCur uintptr) {
  82118 	*(*U8)(unsafe.Pointer(pCur + 1)) |= U8(BTCF_Incrblob)
  82119 	(*Btree)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBtree)).FhasIncrblobCur = U8(1)
  82120 }
  82121 
  82122 // Set both the "read version" (single byte at byte offset 18) and
  82123 // "write version" (single byte at byte offset 19) fields in the database
  82124 // header to iVersion.
  82125 func Xsqlite3BtreeSetVersion(tls *libc.TLS, pBtree uintptr, iVersion int32) int32 {
  82126 	var pBt uintptr = (*Btree)(unsafe.Pointer(pBtree)).FpBt
  82127 	var rc int32
  82128 
  82129 	*(*U16)(unsafe.Pointer(pBt + 40)) &= libc.Uint16FromInt32(libc.CplInt32(BTS_NO_WAL))
  82130 	if iVersion == 1 {
  82131 		*(*U16)(unsafe.Pointer(pBt + 40)) |= U16(BTS_NO_WAL)
  82132 	}
  82133 
  82134 	rc = Xsqlite3BtreeBeginTrans(tls, pBtree, 0, uintptr(0))
  82135 	if rc == SQLITE_OK {
  82136 		var aData uintptr = (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData
  82137 		if int32(*(*U8)(unsafe.Pointer(aData + 18))) != int32(U8(iVersion)) || int32(*(*U8)(unsafe.Pointer(aData + 19))) != int32(U8(iVersion)) {
  82138 			rc = Xsqlite3BtreeBeginTrans(tls, pBtree, 2, uintptr(0))
  82139 			if rc == SQLITE_OK {
  82140 				rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FpDbPage)
  82141 				if rc == SQLITE_OK {
  82142 					*(*U8)(unsafe.Pointer(aData + 18)) = U8(iVersion)
  82143 					*(*U8)(unsafe.Pointer(aData + 19)) = U8(iVersion)
  82144 				}
  82145 			}
  82146 		}
  82147 	}
  82148 
  82149 	*(*U16)(unsafe.Pointer(pBt + 40)) &= libc.Uint16FromInt32(libc.CplInt32(BTS_NO_WAL))
  82150 	return rc
  82151 }
  82152 
  82153 // Return true if the cursor has a hint specified.  This routine is
  82154 // only used from within assert() statements
  82155 func Xsqlite3BtreeCursorHasHint(tls *libc.TLS, pCsr uintptr, mask uint32) int32 {
  82156 	return libc.Bool32(uint32((*BtCursor)(unsafe.Pointer(pCsr)).Fhints)&mask != uint32(0))
  82157 }
  82158 
  82159 // Return true if the given Btree is read-only.
  82160 func Xsqlite3BtreeIsReadonly(tls *libc.TLS, p uintptr) int32 {
  82161 	return libc.Bool32(int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FbtsFlags)&BTS_READ_ONLY != 0)
  82162 }
  82163 
  82164 // Return the size of the header added to each page by this module.
  82165 func Xsqlite3HeaderSizeBtree(tls *libc.TLS) int32 {
  82166 	return int32((uint64(unsafe.Sizeof(MemPage{})) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7)))
  82167 }
  82168 
  82169 // If no transaction is active and the database is not a temp-db, clear
  82170 // the in-memory pager cache.
  82171 func Xsqlite3BtreeClearCache(tls *libc.TLS, p uintptr) {
  82172 	var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
  82173 	if int32((*BtShared)(unsafe.Pointer(pBt)).FinTransaction) == TRANS_NONE {
  82174 		Xsqlite3PagerClearCache(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager)
  82175 	}
  82176 }
  82177 
  82178 // Return true if the Btree passed as the only argument is sharable.
  82179 func Xsqlite3BtreeSharable(tls *libc.TLS, p uintptr) int32 {
  82180 	return int32((*Btree)(unsafe.Pointer(p)).Fsharable)
  82181 }
  82182 
  82183 // Return the number of connections to the BtShared object accessed by
  82184 // the Btree handle passed as the only argument. For private caches
  82185 // this is always 1. For shared caches it may be 1 or greater.
  82186 func Xsqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) int32 {
  82187 	return (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FnRef
  82188 }
  82189 
  82190 func findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) uintptr {
  82191 	bp := tls.Alloc(440)
  82192 	defer tls.Free(440)
  82193 
  82194 	var i int32 = Xsqlite3FindDbName(tls, pDb, zDb)
  82195 
  82196 	if i == 1 {
  82197 		var rc int32 = 0
  82198 		Xsqlite3ParseObjectInit(tls, bp+16, pDb)
  82199 		if Xsqlite3OpenTempDatabase(tls, bp+16) != 0 {
  82200 			Xsqlite3ErrorWithMsg(tls, pErrorDb, (*Parse)(unsafe.Pointer(bp+16)).Frc, ts+4493, libc.VaList(bp, (*Parse)(unsafe.Pointer(bp+16)).FzErrMsg))
  82201 			rc = SQLITE_ERROR
  82202 		}
  82203 		Xsqlite3DbFree(tls, pErrorDb, (*Parse)(unsafe.Pointer(bp+16)).FzErrMsg)
  82204 		Xsqlite3ParseObjectReset(tls, bp+16)
  82205 		if rc != 0 {
  82206 			return uintptr(0)
  82207 		}
  82208 	}
  82209 
  82210 	if i < 0 {
  82211 		Xsqlite3ErrorWithMsg(tls, pErrorDb, SQLITE_ERROR, ts+6186, libc.VaList(bp+8, zDb))
  82212 		return uintptr(0)
  82213 	}
  82214 
  82215 	return (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(pDb)).FaDb + uintptr(i)*32)).FpBt
  82216 }
  82217 
  82218 func setDestPgsz(tls *libc.TLS, p uintptr) int32 {
  82219 	var rc int32
  82220 	rc = Xsqlite3BtreeSetPageSize(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest, Xsqlite3BtreeGetPageSize(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc), 0, 0)
  82221 	return rc
  82222 }
  82223 
  82224 func checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) int32 {
  82225 	if Xsqlite3BtreeTxnState(tls, p) != SQLITE_TXN_NONE {
  82226 		Xsqlite3ErrorWithMsg(tls, db, SQLITE_ERROR, ts+6206, 0)
  82227 		return SQLITE_ERROR
  82228 	}
  82229 	return SQLITE_OK
  82230 }
  82231 
  82232 // Create an sqlite3_backup process to copy the contents of zSrcDb from
  82233 // connection handle pSrcDb to zDestDb in pDestDb. If successful, return
  82234 // a pointer to the new sqlite3_backup object.
  82235 //
  82236 // If an error occurs, NULL is returned and an error code and error message
  82237 // stored in database handle pDestDb.
  82238 func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcDb uintptr, zSrcDb uintptr) uintptr {
  82239 	var p uintptr
  82240 
  82241 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(pSrcDb)).Fmutex)
  82242 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(pDestDb)).Fmutex)
  82243 
  82244 	if pSrcDb == pDestDb {
  82245 		Xsqlite3ErrorWithMsg(tls,
  82246 			pDestDb, SQLITE_ERROR, ts+6237, 0)
  82247 		p = uintptr(0)
  82248 	} else {
  82249 		p = Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(Sqlite3_backup{})))
  82250 		if !(p != 0) {
  82251 			Xsqlite3Error(tls, pDestDb, SQLITE_NOMEM)
  82252 		}
  82253 	}
  82254 
  82255 	if p != 0 {
  82256 		(*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc = findBtree(tls, pDestDb, pSrcDb, zSrcDb)
  82257 		(*Sqlite3_backup)(unsafe.Pointer(p)).FpDest = findBtree(tls, pDestDb, pDestDb, zDestDb)
  82258 		(*Sqlite3_backup)(unsafe.Pointer(p)).FpDestDb = pDestDb
  82259 		(*Sqlite3_backup)(unsafe.Pointer(p)).FpSrcDb = pSrcDb
  82260 		(*Sqlite3_backup)(unsafe.Pointer(p)).FiNext = Pgno(1)
  82261 		(*Sqlite3_backup)(unsafe.Pointer(p)).FisAttached = 0
  82262 
  82263 		if uintptr(0) == (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc || uintptr(0) == (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest ||
  82264 			checkReadTransaction(tls, pDestDb, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest) != SQLITE_OK {
  82265 			Xsqlite3_free(tls, p)
  82266 			p = uintptr(0)
  82267 		}
  82268 	}
  82269 	if p != 0 {
  82270 		(*Btree)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)).FnBackup++
  82271 	}
  82272 
  82273 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(pDestDb)).Fmutex)
  82274 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(pSrcDb)).Fmutex)
  82275 	return p
  82276 }
  82277 
  82278 func isFatalError(tls *libc.TLS, rc int32) int32 {
  82279 	return libc.Bool32(rc != SQLITE_OK && rc != SQLITE_BUSY && rc != SQLITE_LOCKED)
  82280 }
  82281 
  82282 func backupOnePage(tls *libc.TLS, p uintptr, iSrcPg Pgno, zSrcData uintptr, bUpdate int32) int32 {
  82283 	bp := tls.Alloc(8)
  82284 	defer tls.Free(8)
  82285 
  82286 	var pDestPager uintptr = Xsqlite3BtreePager(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest)
  82287 	var nSrcPgsz int32 = Xsqlite3BtreeGetPageSize(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)
  82288 	var nDestPgsz int32 = Xsqlite3BtreeGetPageSize(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest)
  82289 	var nCopy int32 = func() int32 {
  82290 		if nSrcPgsz < nDestPgsz {
  82291 			return nSrcPgsz
  82292 		}
  82293 		return nDestPgsz
  82294 	}()
  82295 	var iEnd I64 = I64(iSrcPg) * I64(nSrcPgsz)
  82296 	var rc int32 = SQLITE_OK
  82297 	var iOff I64
  82298 
  82299 	if nSrcPgsz != nDestPgsz && Xsqlite3PagerIsMemdb(tls, pDestPager) != 0 {
  82300 		rc = SQLITE_READONLY
  82301 	}
  82302 
  82303 	for iOff = iEnd - I64(nSrcPgsz); rc == SQLITE_OK && iOff < iEnd; iOff = iOff + I64(nDestPgsz) {
  82304 		*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
  82305 		var iDest Pgno = Pgno(iOff/I64(nDestPgsz)) + Pgno(1)
  82306 		if iDest == U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpDest)).FpBt)).FpageSize+U32(1) {
  82307 			continue
  82308 		}
  82309 		if SQLITE_OK == libc.AssignInt32(&rc, Xsqlite3PagerGet(tls, pDestPager, iDest, bp, 0)) &&
  82310 			SQLITE_OK == libc.AssignInt32(&rc, Xsqlite3PagerWrite(tls, *(*uintptr)(unsafe.Pointer(bp)))) {
  82311 			var zIn uintptr = zSrcData + uintptr(iOff%I64(nSrcPgsz))
  82312 			var zDestData uintptr = Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp)))
  82313 			var zOut uintptr = zDestData + uintptr(iOff%I64(nDestPgsz))
  82314 
  82315 			libc.Xmemcpy(tls, zOut, zIn, uint64(nCopy))
  82316 			*(*U8)(unsafe.Pointer(Xsqlite3PagerGetExtra(tls, *(*uintptr)(unsafe.Pointer(bp))))) = U8(0)
  82317 			if iOff == int64(0) && bUpdate == 0 {
  82318 				Xsqlite3Put4byte(tls, zOut+28, Xsqlite3BtreeLastPage(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc))
  82319 			}
  82320 		}
  82321 		Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp)))
  82322 	}
  82323 
  82324 	return rc
  82325 }
  82326 
  82327 func backupTruncateFile(tls *libc.TLS, pFile uintptr, iSize I64) int32 {
  82328 	bp := tls.Alloc(8)
  82329 	defer tls.Free(8)
  82330 
  82331 	var rc int32 = Xsqlite3OsFileSize(tls, pFile, bp)
  82332 	if rc == SQLITE_OK && *(*I64)(unsafe.Pointer(bp)) > iSize {
  82333 		rc = Xsqlite3OsTruncate(tls, pFile, iSize)
  82334 	}
  82335 	return rc
  82336 }
  82337 
  82338 func attachBackupObject(tls *libc.TLS, p uintptr) {
  82339 	var pp uintptr
  82340 
  82341 	pp = Xsqlite3PagerBackupPtr(tls, Xsqlite3BtreePager(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc))
  82342 	(*Sqlite3_backup)(unsafe.Pointer(p)).FpNext = *(*uintptr)(unsafe.Pointer(pp))
  82343 	*(*uintptr)(unsafe.Pointer(pp)) = p
  82344 	(*Sqlite3_backup)(unsafe.Pointer(p)).FisAttached = 1
  82345 }
  82346 
  82347 // Copy nPage pages from the source b-tree to the destination.
  82348 func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 {
  82349 	bp := tls.Alloc(32)
  82350 	defer tls.Free(32)
  82351 
  82352 	var rc int32
  82353 	var destMode int32
  82354 	var pgszSrc int32 = 0
  82355 	var pgszDest int32 = 0
  82356 
  82357 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpSrcDb)).Fmutex)
  82358 	Xsqlite3BtreeEnter(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)
  82359 	if (*Sqlite3_backup)(unsafe.Pointer(p)).FpDestDb != 0 {
  82360 		Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpDestDb)).Fmutex)
  82361 	}
  82362 
  82363 	rc = (*Sqlite3_backup)(unsafe.Pointer(p)).Frc
  82364 	if !(isFatalError(tls, rc) != 0) {
  82365 		var pSrcPager uintptr = Xsqlite3BtreePager(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)
  82366 		var pDestPager uintptr = Xsqlite3BtreePager(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest)
  82367 		var ii int32
  82368 		var nSrcPage int32 = -1
  82369 		var bCloseTrans int32 = 0
  82370 
  82371 		if (*Sqlite3_backup)(unsafe.Pointer(p)).FpDestDb != 0 && int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)).FpBt)).FinTransaction) == TRANS_WRITE {
  82372 			rc = SQLITE_BUSY
  82373 		} else {
  82374 			rc = SQLITE_OK
  82375 		}
  82376 
  82377 		if rc == SQLITE_OK && SQLITE_TXN_NONE == Xsqlite3BtreeTxnState(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc) {
  82378 			rc = Xsqlite3BtreeBeginTrans(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc, 0, uintptr(0))
  82379 			bCloseTrans = 1
  82380 		}
  82381 
  82382 		if (*Sqlite3_backup)(unsafe.Pointer(p)).FbDestLocked == 0 && rc == SQLITE_OK && setDestPgsz(tls, p) == SQLITE_NOMEM {
  82383 			rc = SQLITE_NOMEM
  82384 		}
  82385 
  82386 		if SQLITE_OK == rc && (*Sqlite3_backup)(unsafe.Pointer(p)).FbDestLocked == 0 &&
  82387 			SQLITE_OK == libc.AssignInt32(&rc, Xsqlite3BtreeBeginTrans(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest, 2,
  82388 				p+16)) {
  82389 			(*Sqlite3_backup)(unsafe.Pointer(p)).FbDestLocked = 1
  82390 		}
  82391 
  82392 		pgszSrc = Xsqlite3BtreeGetPageSize(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)
  82393 		pgszDest = Xsqlite3BtreeGetPageSize(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest)
  82394 		destMode = Xsqlite3PagerGetJournalMode(tls, Xsqlite3BtreePager(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest))
  82395 		if SQLITE_OK == rc && destMode == PAGER_JOURNALMODE_WAL && pgszSrc != pgszDest {
  82396 			rc = SQLITE_READONLY
  82397 		}
  82398 
  82399 		nSrcPage = int32(Xsqlite3BtreeLastPage(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc))
  82400 
  82401 		for ii = 0; (nPage < 0 || ii < nPage) && (*Sqlite3_backup)(unsafe.Pointer(p)).FiNext <= Pgno(nSrcPage) && !(rc != 0); ii++ {
  82402 			var iSrcPg Pgno = (*Sqlite3_backup)(unsafe.Pointer(p)).FiNext
  82403 			if iSrcPg != U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)).FpBt)).FpageSize+U32(1) {
  82404 				rc = Xsqlite3PagerGet(tls, pSrcPager, iSrcPg, bp, PAGER_GET_READONLY)
  82405 				if rc == SQLITE_OK {
  82406 					rc = backupOnePage(tls, p, iSrcPg, Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))), 0)
  82407 					Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp)))
  82408 				}
  82409 			}
  82410 			(*Sqlite3_backup)(unsafe.Pointer(p)).FiNext++
  82411 		}
  82412 		if rc == SQLITE_OK {
  82413 			(*Sqlite3_backup)(unsafe.Pointer(p)).FnPagecount = Pgno(nSrcPage)
  82414 			(*Sqlite3_backup)(unsafe.Pointer(p)).FnRemaining = Pgno(nSrcPage+1) - (*Sqlite3_backup)(unsafe.Pointer(p)).FiNext
  82415 			if (*Sqlite3_backup)(unsafe.Pointer(p)).FiNext > Pgno(nSrcPage) {
  82416 				rc = SQLITE_DONE
  82417 			} else if !((*Sqlite3_backup)(unsafe.Pointer(p)).FisAttached != 0) {
  82418 				attachBackupObject(tls, p)
  82419 			}
  82420 		}
  82421 
  82422 		if rc == SQLITE_DONE {
  82423 			if nSrcPage == 0 {
  82424 				rc = Xsqlite3BtreeNewDb(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest)
  82425 				nSrcPage = 1
  82426 			}
  82427 			if rc == SQLITE_OK || rc == SQLITE_DONE {
  82428 				rc = Xsqlite3BtreeUpdateMeta(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest, 1, (*Sqlite3_backup)(unsafe.Pointer(p)).FiDestSchema+U32(1))
  82429 			}
  82430 			if rc == SQLITE_OK {
  82431 				if (*Sqlite3_backup)(unsafe.Pointer(p)).FpDestDb != 0 {
  82432 					Xsqlite3ResetAllSchemasOfConnection(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDestDb)
  82433 				}
  82434 				if destMode == PAGER_JOURNALMODE_WAL {
  82435 					rc = Xsqlite3BtreeSetVersion(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest, 2)
  82436 				}
  82437 			}
  82438 			if rc == SQLITE_OK {
  82439 				var nDestTruncate int32
  82440 
  82441 				if pgszSrc < pgszDest {
  82442 					var ratio int32 = pgszDest / pgszSrc
  82443 					nDestTruncate = (nSrcPage + ratio - 1) / ratio
  82444 					if nDestTruncate == int32(U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpDest)).FpBt)).FpageSize+U32(1)) {
  82445 						nDestTruncate--
  82446 					}
  82447 				} else {
  82448 					nDestTruncate = nSrcPage * (pgszSrc / pgszDest)
  82449 				}
  82450 
  82451 				if pgszSrc < pgszDest {
  82452 					var iSize I64 = I64(pgszSrc) * I64(nSrcPage)
  82453 					var pFile uintptr = Xsqlite3PagerFile(tls, pDestPager)
  82454 					var iPg Pgno
  82455 
  82456 					var iOff I64
  82457 					var iEnd I64
  82458 
  82459 					Xsqlite3PagerPagecount(tls, pDestPager, bp+8)
  82460 					for iPg = Pgno(nDestTruncate); rc == SQLITE_OK && iPg <= Pgno(*(*int32)(unsafe.Pointer(bp + 8))); iPg++ {
  82461 						if iPg != U32(Xsqlite3PendingByte)/(*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpDest)).FpBt)).FpageSize+U32(1) {
  82462 							rc = Xsqlite3PagerGet(tls, pDestPager, iPg, bp+16, 0)
  82463 							if rc == SQLITE_OK {
  82464 								rc = Xsqlite3PagerWrite(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
  82465 								Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
  82466 							}
  82467 						}
  82468 					}
  82469 					if rc == SQLITE_OK {
  82470 						rc = Xsqlite3PagerCommitPhaseOne(tls, pDestPager, uintptr(0), 1)
  82471 					}
  82472 
  82473 					iEnd = func() int64 {
  82474 						if I64(Xsqlite3PendingByte+pgszDest) < iSize {
  82475 							return int64(Xsqlite3PendingByte + pgszDest)
  82476 						}
  82477 						return iSize
  82478 					}()
  82479 					for iOff = I64(Xsqlite3PendingByte + pgszSrc); rc == SQLITE_OK && iOff < iEnd; iOff = iOff + I64(pgszSrc) {
  82480 						*(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0)
  82481 						var iSrcPg Pgno = Pgno(iOff/I64(pgszSrc) + int64(1))
  82482 						rc = Xsqlite3PagerGet(tls, pSrcPager, iSrcPg, bp+24, 0)
  82483 						if rc == SQLITE_OK {
  82484 							var zData uintptr = Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp + 24)))
  82485 							rc = Xsqlite3OsWrite(tls, pFile, zData, pgszSrc, iOff)
  82486 						}
  82487 						Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp + 24)))
  82488 					}
  82489 					if rc == SQLITE_OK {
  82490 						rc = backupTruncateFile(tls, pFile, iSize)
  82491 					}
  82492 
  82493 					if rc == SQLITE_OK {
  82494 						rc = Xsqlite3PagerSync(tls, pDestPager, uintptr(0))
  82495 					}
  82496 				} else {
  82497 					Xsqlite3PagerTruncateImage(tls, pDestPager, uint32(nDestTruncate))
  82498 					rc = Xsqlite3PagerCommitPhaseOne(tls, pDestPager, uintptr(0), 0)
  82499 				}
  82500 
  82501 				if SQLITE_OK == rc &&
  82502 					SQLITE_OK == libc.AssignInt32(&rc, Xsqlite3BtreeCommitPhaseTwo(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest, 0)) {
  82503 					rc = SQLITE_DONE
  82504 				}
  82505 			}
  82506 		}
  82507 
  82508 		if bCloseTrans != 0 {
  82509 			Xsqlite3BtreeCommitPhaseOne(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc, uintptr(0))
  82510 			Xsqlite3BtreeCommitPhaseTwo(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc, 0)
  82511 
  82512 		}
  82513 
  82514 		if rc == SQLITE_IOERR|int32(12)<<8 {
  82515 			rc = SQLITE_NOMEM
  82516 		}
  82517 		(*Sqlite3_backup)(unsafe.Pointer(p)).Frc = rc
  82518 	}
  82519 	if (*Sqlite3_backup)(unsafe.Pointer(p)).FpDestDb != 0 {
  82520 		Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpDestDb)).Fmutex)
  82521 	}
  82522 	Xsqlite3BtreeLeave(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)
  82523 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpSrcDb)).Fmutex)
  82524 	return rc
  82525 }
  82526 
  82527 // Release all resources associated with an sqlite3_backup* handle.
  82528 func Xsqlite3_backup_finish(tls *libc.TLS, p uintptr) int32 {
  82529 	var pp uintptr
  82530 	var pSrcDb uintptr
  82531 	var rc int32
  82532 
  82533 	if p == uintptr(0) {
  82534 		return SQLITE_OK
  82535 	}
  82536 	pSrcDb = (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrcDb
  82537 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(pSrcDb)).Fmutex)
  82538 	Xsqlite3BtreeEnter(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)
  82539 	if (*Sqlite3_backup)(unsafe.Pointer(p)).FpDestDb != 0 {
  82540 		Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpDestDb)).Fmutex)
  82541 	}
  82542 
  82543 	if (*Sqlite3_backup)(unsafe.Pointer(p)).FpDestDb != 0 {
  82544 		(*Btree)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)).FnBackup--
  82545 	}
  82546 	if (*Sqlite3_backup)(unsafe.Pointer(p)).FisAttached != 0 {
  82547 		pp = Xsqlite3PagerBackupPtr(tls, Xsqlite3BtreePager(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc))
  82548 
  82549 		for *(*uintptr)(unsafe.Pointer(pp)) != p {
  82550 			pp = *(*uintptr)(unsafe.Pointer(pp)) + 64
  82551 
  82552 		}
  82553 		*(*uintptr)(unsafe.Pointer(pp)) = (*Sqlite3_backup)(unsafe.Pointer(p)).FpNext
  82554 	}
  82555 
  82556 	Xsqlite3BtreeRollback(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest, SQLITE_OK, 0)
  82557 
  82558 	if (*Sqlite3_backup)(unsafe.Pointer(p)).Frc == SQLITE_DONE {
  82559 		rc = SQLITE_OK
  82560 	} else {
  82561 		rc = (*Sqlite3_backup)(unsafe.Pointer(p)).Frc
  82562 	}
  82563 	if (*Sqlite3_backup)(unsafe.Pointer(p)).FpDestDb != 0 {
  82564 		Xsqlite3Error(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDestDb, rc)
  82565 
  82566 		Xsqlite3LeaveMutexAndCloseZombie(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDestDb)
  82567 	}
  82568 	Xsqlite3BtreeLeave(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)
  82569 	if (*Sqlite3_backup)(unsafe.Pointer(p)).FpDestDb != 0 {
  82570 		Xsqlite3_free(tls, p)
  82571 	}
  82572 	Xsqlite3LeaveMutexAndCloseZombie(tls, pSrcDb)
  82573 	return rc
  82574 }
  82575 
  82576 // Return the number of pages still to be backed up as of the most recent
  82577 // call to sqlite3_backup_step().
  82578 func Xsqlite3_backup_remaining(tls *libc.TLS, p uintptr) int32 {
  82579 	return int32((*Sqlite3_backup)(unsafe.Pointer(p)).FnRemaining)
  82580 }
  82581 
  82582 // Return the total number of pages in the source database as of the most
  82583 // recent call to sqlite3_backup_step().
  82584 func Xsqlite3_backup_pagecount(tls *libc.TLS, p uintptr) int32 {
  82585 	return int32((*Sqlite3_backup)(unsafe.Pointer(p)).FnPagecount)
  82586 }
  82587 
  82588 func backupUpdate(tls *libc.TLS, p uintptr, iPage Pgno, aData uintptr) {
  82589 	for __ccgo := true; __ccgo; __ccgo = libc.AssignUintptr(&p, (*Sqlite3_backup)(unsafe.Pointer(p)).FpNext) != uintptr(0) {
  82590 		if !(isFatalError(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).Frc) != 0) && iPage < (*Sqlite3_backup)(unsafe.Pointer(p)).FiNext {
  82591 			var rc int32
  82592 
  82593 			Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpDestDb)).Fmutex)
  82594 			rc = backupOnePage(tls, p, iPage, aData, 1)
  82595 			Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpDestDb)).Fmutex)
  82596 
  82597 			if rc != SQLITE_OK {
  82598 				(*Sqlite3_backup)(unsafe.Pointer(p)).Frc = rc
  82599 			}
  82600 		}
  82601 	}
  82602 }
  82603 
  82604 func Xsqlite3BackupUpdate(tls *libc.TLS, pBackup uintptr, iPage Pgno, aData uintptr) {
  82605 	if pBackup != 0 {
  82606 		backupUpdate(tls, pBackup, iPage, aData)
  82607 	}
  82608 }
  82609 
  82610 // Restart the backup process. This is called when the pager layer
  82611 // detects that the database has been modified by an external database
  82612 // connection. In this case there is no way of knowing which of the
  82613 // pages that have been copied into the destination database are still
  82614 // valid and which are not, so the entire process needs to be restarted.
  82615 //
  82616 // It is assumed that the mutex associated with the BtShared object
  82617 // corresponding to the source database is held when this function is
  82618 // called.
  82619 func Xsqlite3BackupRestart(tls *libc.TLS, pBackup uintptr) {
  82620 	var p uintptr
  82621 	for p = pBackup; p != 0; p = (*Sqlite3_backup)(unsafe.Pointer(p)).FpNext {
  82622 		(*Sqlite3_backup)(unsafe.Pointer(p)).FiNext = Pgno(1)
  82623 	}
  82624 }
  82625 
  82626 // Copy the complete content of pBtFrom into pBtTo.  A transaction
  82627 // must be active for both files.
  82628 //
  82629 // The size of file pTo may be reduced by this operation. If anything
  82630 // goes wrong, the transaction on pTo is rolled back. If successful, the
  82631 // transaction is committed before returning.
  82632 func Xsqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) int32 {
  82633 	bp := tls.Alloc(80)
  82634 	defer tls.Free(80)
  82635 
  82636 	var rc int32
  82637 	var pFd uintptr
  82638 
  82639 	Xsqlite3BtreeEnter(tls, pTo)
  82640 	Xsqlite3BtreeEnter(tls, pFrom)
  82641 
  82642 	pFd = Xsqlite3PagerFile(tls, Xsqlite3BtreePager(tls, pTo))
  82643 	if !((*Sqlite3_file)(unsafe.Pointer(pFd)).FpMethods != 0) {
  82644 		goto __1
  82645 	}
  82646 	*(*I64)(unsafe.Pointer(bp)) = I64(Xsqlite3BtreeGetPageSize(tls, pFrom)) * I64(Xsqlite3BtreeLastPage(tls, pFrom))
  82647 	rc = Xsqlite3OsFileControl(tls, pFd, SQLITE_FCNTL_OVERWRITE, bp)
  82648 	if !(rc == SQLITE_NOTFOUND) {
  82649 		goto __2
  82650 	}
  82651 	rc = SQLITE_OK
  82652 __2:
  82653 	;
  82654 	if !(rc != 0) {
  82655 		goto __3
  82656 	}
  82657 	goto copy_finished
  82658 __3:
  82659 	;
  82660 __1:
  82661 	;
  82662 	libc.Xmemset(tls, bp+8, 0, uint64(unsafe.Sizeof(Sqlite3_backup{})))
  82663 	(*Sqlite3_backup)(unsafe.Pointer(bp + 8)).FpSrcDb = (*Btree)(unsafe.Pointer(pFrom)).Fdb
  82664 	(*Sqlite3_backup)(unsafe.Pointer(bp + 8)).FpSrc = pFrom
  82665 	(*Sqlite3_backup)(unsafe.Pointer(bp + 8)).FpDest = pTo
  82666 	(*Sqlite3_backup)(unsafe.Pointer(bp + 8)).FiNext = Pgno(1)
  82667 
  82668 	Xsqlite3_backup_step(tls, bp+8, 0x7FFFFFFF)
  82669 
  82670 	rc = Xsqlite3_backup_finish(tls, bp+8)
  82671 	if !(rc == SQLITE_OK) {
  82672 		goto __4
  82673 	}
  82674 	*(*U16)(unsafe.Pointer((*Btree)(unsafe.Pointer(pTo)).FpBt + 40)) &= libc.Uint16FromInt32(libc.CplInt32(BTS_PAGESIZE_FIXED))
  82675 	goto __5
  82676 __4:
  82677 	Xsqlite3PagerClearCache(tls, Xsqlite3BtreePager(tls, (*Sqlite3_backup)(unsafe.Pointer(bp+8)).FpDest))
  82678 __5:
  82679 	;
  82680 copy_finished:
  82681 	Xsqlite3BtreeLeave(tls, pFrom)
  82682 	Xsqlite3BtreeLeave(tls, pTo)
  82683 	return rc
  82684 }
  82685 
  82686 func vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) {
  82687 	bp := tls.Alloc(48)
  82688 	defer tls.Free(48)
  82689 
  82690 	if int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_Int != 0 {
  82691 		libc.Xmemcpy(tls, bp+8, p, uint64(int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_Int*2))
  82692 		(*Mem)(unsafe.Pointer(p)).Fn = Xsqlite3Int64ToText(tls, *(*I64)(unsafe.Pointer(bp + 8)), zBuf)
  82693 	} else {
  82694 		Xsqlite3StrAccumInit(tls, bp+16, uintptr(0), zBuf, sz, 0)
  82695 		Xsqlite3_str_appendf(tls, bp+16, ts+6277,
  82696 			libc.VaList(bp, func() float64 {
  82697 				if int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_IntReal != 0 {
  82698 					return float64(*(*I64)(unsafe.Pointer(p)))
  82699 				}
  82700 				return *(*float64)(unsafe.Pointer(p))
  82701 			}()))
  82702 
  82703 		*(*int8)(unsafe.Pointer(zBuf + uintptr((*StrAccum)(unsafe.Pointer(bp+16)).FnChar))) = int8(0)
  82704 		(*Mem)(unsafe.Pointer(p)).Fn = int32((*StrAccum)(unsafe.Pointer(bp + 16)).FnChar)
  82705 	}
  82706 }
  82707 
  82708 // If pMem is an object with a valid string representation, this routine
  82709 // ensures the internal encoding for the string representation is
  82710 // 'desiredEnc', one of SQLITE_UTF8, SQLITE_UTF16LE or SQLITE_UTF16BE.
  82711 //
  82712 // If pMem is not a string object, or the encoding of the string
  82713 // representation is already stored using the requested encoding, then this
  82714 // routine is a no-op.
  82715 //
  82716 // SQLITE_OK is returned if the conversion is successful (or not required).
  82717 // SQLITE_NOMEM may be returned if a malloc() fails during conversion
  82718 // between formats.
  82719 func Xsqlite3VdbeChangeEncoding(tls *libc.TLS, pMem uintptr, desiredEnc int32) int32 {
  82720 	var rc int32
  82721 
  82722 	if !(int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Str != 0) {
  82723 		(*Mem)(unsafe.Pointer(pMem)).Fenc = U8(desiredEnc)
  82724 		return SQLITE_OK
  82725 	}
  82726 	if int32((*Mem)(unsafe.Pointer(pMem)).Fenc) == desiredEnc {
  82727 		return SQLITE_OK
  82728 	}
  82729 
  82730 	rc = Xsqlite3VdbeMemTranslate(tls, pMem, U8(desiredEnc))
  82731 
  82732 	return rc
  82733 }
  82734 
  82735 // Make sure pMem->z points to a writable allocation of at least n bytes.
  82736 //
  82737 // If the bPreserve argument is true, then copy of the content of
  82738 // pMem->z into the new allocation.  pMem must be either a string or
  82739 // blob if bPreserve is true.  If bPreserve is false, any prior content
  82740 // in pMem->z is discarded.
  82741 func Xsqlite3VdbeMemGrow(tls *libc.TLS, pMem uintptr, n int32, bPreserve int32) int32 {
  82742 	if (*Mem)(unsafe.Pointer(pMem)).FszMalloc > 0 && bPreserve != 0 && (*Mem)(unsafe.Pointer(pMem)).Fz == (*Mem)(unsafe.Pointer(pMem)).FzMalloc {
  82743 		if (*Mem)(unsafe.Pointer(pMem)).Fdb != 0 {
  82744 			(*Mem)(unsafe.Pointer(pMem)).Fz = libc.AssignPtrUintptr(pMem+40, Xsqlite3DbReallocOrFree(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, (*Mem)(unsafe.Pointer(pMem)).Fz, uint64(n)))
  82745 		} else {
  82746 			(*Mem)(unsafe.Pointer(pMem)).FzMalloc = Xsqlite3Realloc(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, uint64(n))
  82747 			if (*Mem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) {
  82748 				Xsqlite3_free(tls, (*Mem)(unsafe.Pointer(pMem)).Fz)
  82749 			}
  82750 			(*Mem)(unsafe.Pointer(pMem)).Fz = (*Mem)(unsafe.Pointer(pMem)).FzMalloc
  82751 		}
  82752 		bPreserve = 0
  82753 	} else {
  82754 		if (*Mem)(unsafe.Pointer(pMem)).FszMalloc > 0 {
  82755 			Xsqlite3DbFreeNN(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, (*Mem)(unsafe.Pointer(pMem)).FzMalloc)
  82756 		}
  82757 		(*Mem)(unsafe.Pointer(pMem)).FzMalloc = Xsqlite3DbMallocRaw(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, uint64(n))
  82758 	}
  82759 	if (*Mem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) {
  82760 		Xsqlite3VdbeMemSetNull(tls, pMem)
  82761 		(*Mem)(unsafe.Pointer(pMem)).Fz = uintptr(0)
  82762 		(*Mem)(unsafe.Pointer(pMem)).FszMalloc = 0
  82763 		return SQLITE_NOMEM
  82764 	} else {
  82765 		(*Mem)(unsafe.Pointer(pMem)).FszMalloc = Xsqlite3DbMallocSize(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, (*Mem)(unsafe.Pointer(pMem)).FzMalloc)
  82766 	}
  82767 
  82768 	if bPreserve != 0 && (*Mem)(unsafe.Pointer(pMem)).Fz != 0 {
  82769 		libc.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pMem)).FzMalloc, (*Mem)(unsafe.Pointer(pMem)).Fz, uint64((*Mem)(unsafe.Pointer(pMem)).Fn))
  82770 	}
  82771 	if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Dyn != 0 {
  82772 		(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Mem)(unsafe.Pointer(pMem)).FxDel})).f(tls, (*Mem)(unsafe.Pointer(pMem)).Fz)
  82773 	}
  82774 
  82775 	(*Mem)(unsafe.Pointer(pMem)).Fz = (*Mem)(unsafe.Pointer(pMem)).FzMalloc
  82776 	*(*U16)(unsafe.Pointer(pMem + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Dyn | MEM_Ephem | MEM_Static))
  82777 	return SQLITE_OK
  82778 }
  82779 
  82780 // Change the pMem->zMalloc allocation to be at least szNew bytes.
  82781 // If pMem->zMalloc already meets or exceeds the requested size, this
  82782 // routine is a no-op.
  82783 //
  82784 // Any prior string or blob content in the pMem object may be discarded.
  82785 // The pMem->xDel destructor is called, if it exists.  Though MEM_Str
  82786 // and MEM_Blob values may be discarded, MEM_Int, MEM_Real, MEM_IntReal,
  82787 // and MEM_Null values are preserved.
  82788 //
  82789 // Return SQLITE_OK on success or an error code (probably SQLITE_NOMEM)
  82790 // if unable to complete the resizing.
  82791 func Xsqlite3VdbeMemClearAndResize(tls *libc.TLS, pMem uintptr, szNew int32) int32 {
  82792 	if (*Mem)(unsafe.Pointer(pMem)).FszMalloc < szNew {
  82793 		return Xsqlite3VdbeMemGrow(tls, pMem, szNew, 0)
  82794 	}
  82795 
  82796 	(*Mem)(unsafe.Pointer(pMem)).Fz = (*Mem)(unsafe.Pointer(pMem)).FzMalloc
  82797 	*(*U16)(unsafe.Pointer(pMem + 20)) &= U16(MEM_Null | MEM_Int | MEM_Real | MEM_IntReal)
  82798 	return SQLITE_OK
  82799 }
  82800 
  82801 func vdbeMemAddTerminator(tls *libc.TLS, pMem uintptr) int32 {
  82802 	if Xsqlite3VdbeMemGrow(tls, pMem, (*Mem)(unsafe.Pointer(pMem)).Fn+3, 1) != 0 {
  82803 		return SQLITE_NOMEM
  82804 	}
  82805 	*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr((*Mem)(unsafe.Pointer(pMem)).Fn))) = int8(0)
  82806 	*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr((*Mem)(unsafe.Pointer(pMem)).Fn+1))) = int8(0)
  82807 	*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr((*Mem)(unsafe.Pointer(pMem)).Fn+2))) = int8(0)
  82808 	*(*U16)(unsafe.Pointer(pMem + 20)) |= U16(MEM_Term)
  82809 	return SQLITE_OK
  82810 }
  82811 
  82812 // Change pMem so that its MEM_Str or MEM_Blob value is stored in
  82813 // MEM.zMalloc, where it can be safely written.
  82814 //
  82815 // Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails.
  82816 func Xsqlite3VdbeMemMakeWriteable(tls *libc.TLS, pMem uintptr) int32 {
  82817 	if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_Str|MEM_Blob) != 0 {
  82818 		if func() int32 {
  82819 			if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Zero != 0 {
  82820 				return Xsqlite3VdbeMemExpandBlob(tls, pMem)
  82821 			}
  82822 			return 0
  82823 		}() != 0 {
  82824 			return SQLITE_NOMEM
  82825 		}
  82826 		if (*Mem)(unsafe.Pointer(pMem)).FszMalloc == 0 || (*Mem)(unsafe.Pointer(pMem)).Fz != (*Mem)(unsafe.Pointer(pMem)).FzMalloc {
  82827 			var rc int32 = vdbeMemAddTerminator(tls, pMem)
  82828 			if rc != 0 {
  82829 				return rc
  82830 			}
  82831 		}
  82832 	}
  82833 	*(*U16)(unsafe.Pointer(pMem + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Ephem))
  82834 
  82835 	return SQLITE_OK
  82836 }
  82837 
  82838 // If the given Mem* has a zero-filled tail, turn it into an ordinary
  82839 // blob stored in dynamically allocated space.
  82840 func Xsqlite3VdbeMemExpandBlob(tls *libc.TLS, pMem uintptr) int32 {
  82841 	var nByte int32
  82842 
  82843 	nByte = (*Mem)(unsafe.Pointer(pMem)).Fn + *(*int32)(unsafe.Pointer(pMem))
  82844 	if nByte <= 0 {
  82845 		if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Blob == 0 {
  82846 			return SQLITE_OK
  82847 		}
  82848 		nByte = 1
  82849 	}
  82850 	if Xsqlite3VdbeMemGrow(tls, pMem, nByte, 1) != 0 {
  82851 		return SQLITE_NOMEM
  82852 	}
  82853 
  82854 	libc.Xmemset(tls, (*Mem)(unsafe.Pointer(pMem)).Fz+uintptr((*Mem)(unsafe.Pointer(pMem)).Fn), 0, uint64(*(*int32)(unsafe.Pointer(pMem))))
  82855 	*(*int32)(unsafe.Pointer(pMem + 16)) += *(*int32)(unsafe.Pointer(pMem))
  82856 	*(*U16)(unsafe.Pointer(pMem + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Zero | MEM_Term))
  82857 	return SQLITE_OK
  82858 }
  82859 
  82860 // Make sure the given Mem is \u0000 terminated.
  82861 func Xsqlite3VdbeMemNulTerminate(tls *libc.TLS, pMem uintptr) int32 {
  82862 	if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_Term|MEM_Str) != MEM_Str {
  82863 		return SQLITE_OK
  82864 	} else {
  82865 		return vdbeMemAddTerminator(tls, pMem)
  82866 	}
  82867 	return int32(0)
  82868 }
  82869 
  82870 // Add MEM_Str to the set of representations for the given Mem.  This
  82871 // routine is only called if pMem is a number of some kind, not a NULL
  82872 // or a BLOB.
  82873 //
  82874 // Existing representations MEM_Int, MEM_Real, or MEM_IntReal are invalidated
  82875 // if bForce is true but are retained if bForce is false.
  82876 //
  82877 // A MEM_Null value will never be passed to this function. This function is
  82878 // used for converting values to text for returning to the user (i.e. via
  82879 // sqlite3_value_text()), or for ensuring that values to be used as btree
  82880 // keys are strings. In the former case a NULL pointer is returned the
  82881 // user and the latter is an internal programming error.
  82882 func Xsqlite3VdbeMemStringify(tls *libc.TLS, pMem uintptr, enc U8, bForce U8) int32 {
  82883 	var nByte int32 = 32
  82884 
  82885 	if Xsqlite3VdbeMemClearAndResize(tls, pMem, nByte) != 0 {
  82886 		(*Mem)(unsafe.Pointer(pMem)).Fenc = U8(0)
  82887 		return SQLITE_NOMEM
  82888 	}
  82889 
  82890 	vdbeMemRenderNum(tls, nByte, (*Mem)(unsafe.Pointer(pMem)).Fz, pMem)
  82891 
  82892 	(*Mem)(unsafe.Pointer(pMem)).Fenc = U8(SQLITE_UTF8)
  82893 	*(*U16)(unsafe.Pointer(pMem + 20)) |= U16(MEM_Str | MEM_Term)
  82894 	if bForce != 0 {
  82895 		*(*U16)(unsafe.Pointer(pMem + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Int | MEM_Real | MEM_IntReal))
  82896 	}
  82897 	Xsqlite3VdbeChangeEncoding(tls, pMem, int32(enc))
  82898 	return SQLITE_OK
  82899 }
  82900 
  82901 // Memory cell pMem contains the context of an aggregate function.
  82902 // This routine calls the finalize method for that function.  The
  82903 // result of the aggregate is stored back into pMem.
  82904 //
  82905 // Return SQLITE_ERROR if the finalizer reports an error.  SQLITE_OK
  82906 // otherwise.
  82907 func Xsqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) int32 {
  82908 	bp := tls.Alloc(112)
  82909 	defer tls.Free(112)
  82910 
  82911 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Sqlite3_context{})))
  82912 	libc.Xmemset(tls, bp+56, 0, uint64(unsafe.Sizeof(Mem{})))
  82913 	(*Mem)(unsafe.Pointer(bp + 56)).Fflags = U16(MEM_Null)
  82914 	(*Mem)(unsafe.Pointer(bp + 56)).Fdb = (*Mem)(unsafe.Pointer(pMem)).Fdb
  82915 	(*Sqlite3_context)(unsafe.Pointer(bp)).FpOut = bp + 56
  82916 	(*Sqlite3_context)(unsafe.Pointer(bp)).FpMem = pMem
  82917 	(*Sqlite3_context)(unsafe.Pointer(bp)).FpFunc = pFunc
  82918 	(*Sqlite3_context)(unsafe.Pointer(bp)).Fenc = (*Sqlite3)(unsafe.Pointer((*Mem)(unsafe.Pointer(bp + 56)).Fdb)).Fenc
  82919 	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*FuncDef)(unsafe.Pointer(pFunc)).FxFinalize})).f(tls, bp)
  82920 
  82921 	if (*Mem)(unsafe.Pointer(pMem)).FszMalloc > 0 {
  82922 		Xsqlite3DbFreeNN(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, (*Mem)(unsafe.Pointer(pMem)).FzMalloc)
  82923 	}
  82924 	libc.Xmemcpy(tls, pMem, bp+56, uint64(unsafe.Sizeof(Mem{})))
  82925 	return (*Sqlite3_context)(unsafe.Pointer(bp)).FisError
  82926 }
  82927 
  82928 // Memory cell pAccum contains the context of an aggregate function.
  82929 // This routine calls the xValue method for that function and stores
  82930 // the results in memory cell pMem.
  82931 //
  82932 // SQLITE_ERROR is returned if xValue() reports an error. SQLITE_OK
  82933 // otherwise.
  82934 func Xsqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc uintptr) int32 {
  82935 	bp := tls.Alloc(56)
  82936 	defer tls.Free(56)
  82937 
  82938 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Sqlite3_context{})))
  82939 	Xsqlite3VdbeMemSetNull(tls, pOut)
  82940 	(*Sqlite3_context)(unsafe.Pointer(bp)).FpOut = pOut
  82941 	(*Sqlite3_context)(unsafe.Pointer(bp)).FpMem = pAccum
  82942 	(*Sqlite3_context)(unsafe.Pointer(bp)).FpFunc = pFunc
  82943 	(*Sqlite3_context)(unsafe.Pointer(bp)).Fenc = (*Sqlite3)(unsafe.Pointer((*Mem)(unsafe.Pointer(pAccum)).Fdb)).Fenc
  82944 	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*FuncDef)(unsafe.Pointer(pFunc)).FxValue})).f(tls, bp)
  82945 	return (*Sqlite3_context)(unsafe.Pointer(bp)).FisError
  82946 }
  82947 
  82948 func vdbeMemClearExternAndSetNull(tls *libc.TLS, p uintptr) {
  82949 	if int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_Agg != 0 {
  82950 		Xsqlite3VdbeMemFinalize(tls, p, *(*uintptr)(unsafe.Pointer(p)))
  82951 
  82952 	}
  82953 	if int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_Dyn != 0 {
  82954 		(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Mem)(unsafe.Pointer(p)).FxDel})).f(tls, (*Mem)(unsafe.Pointer(p)).Fz)
  82955 	}
  82956 	(*Mem)(unsafe.Pointer(p)).Fflags = U16(MEM_Null)
  82957 }
  82958 
  82959 func vdbeMemClear(tls *libc.TLS, p uintptr) {
  82960 	if int32((*Mem)(unsafe.Pointer(p)).Fflags)&(MEM_Agg|MEM_Dyn) != 0 {
  82961 		vdbeMemClearExternAndSetNull(tls, p)
  82962 	}
  82963 	if (*Mem)(unsafe.Pointer(p)).FszMalloc != 0 {
  82964 		Xsqlite3DbFreeNN(tls, (*Mem)(unsafe.Pointer(p)).Fdb, (*Mem)(unsafe.Pointer(p)).FzMalloc)
  82965 		(*Mem)(unsafe.Pointer(p)).FszMalloc = 0
  82966 	}
  82967 	(*Mem)(unsafe.Pointer(p)).Fz = uintptr(0)
  82968 }
  82969 
  82970 // Release any memory resources held by the Mem.  Both the memory that is
  82971 // free by Mem.xDel and the Mem.zMalloc allocation are freed.
  82972 //
  82973 // Use this routine prior to clean up prior to abandoning a Mem, or to
  82974 // reset a Mem back to its minimum memory utilization.
  82975 //
  82976 // Use sqlite3VdbeMemSetNull() to release just the Mem.xDel space
  82977 // prior to inserting new content into the Mem.
  82978 func Xsqlite3VdbeMemRelease(tls *libc.TLS, p uintptr) {
  82979 	if int32((*Mem)(unsafe.Pointer(p)).Fflags)&(MEM_Agg|MEM_Dyn) != 0 || (*Mem)(unsafe.Pointer(p)).FszMalloc != 0 {
  82980 		vdbeMemClear(tls, p)
  82981 	}
  82982 }
  82983 
  82984 // Like sqlite3VdbeMemRelease() but faster for cases where we
  82985 // know in advance that the Mem is not MEM_Dyn or MEM_Agg.
  82986 func Xsqlite3VdbeMemReleaseMalloc(tls *libc.TLS, p uintptr) {
  82987 	if (*Mem)(unsafe.Pointer(p)).FszMalloc != 0 {
  82988 		vdbeMemClear(tls, p)
  82989 	}
  82990 }
  82991 
  82992 func doubleToInt64(tls *libc.TLS, r float64) I64 {
  82993 	if r <= float64(minInt) {
  82994 		return minInt
  82995 	} else if r >= float64(maxInt) {
  82996 		return maxInt
  82997 	} else {
  82998 		return I64(r)
  82999 	}
  83000 	return I64(0)
  83001 }
  83002 
  83003 var maxInt I64 = int64(0xffffffff) | int64(0x7fffffff)<<32
  83004 var minInt I64 = int64(-1) - (int64(0xffffffff) | int64(0x7fffffff)<<32)
  83005 
  83006 func memIntValue(tls *libc.TLS, pMem uintptr) I64 {
  83007 	bp := tls.Alloc(8)
  83008 	defer tls.Free(8)
  83009 
  83010 	*(*I64)(unsafe.Pointer(bp)) = int64(0)
  83011 	Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, bp, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc)
  83012 	return *(*I64)(unsafe.Pointer(bp))
  83013 }
  83014 
  83015 func Xsqlite3VdbeIntValue(tls *libc.TLS, pMem uintptr) I64 {
  83016 	var flags int32
  83017 
  83018 	flags = int32((*Mem)(unsafe.Pointer(pMem)).Fflags)
  83019 	if flags&(MEM_Int|MEM_IntReal) != 0 {
  83020 		return *(*I64)(unsafe.Pointer(pMem))
  83021 	} else if flags&MEM_Real != 0 {
  83022 		return doubleToInt64(tls, *(*float64)(unsafe.Pointer(pMem)))
  83023 	} else if flags&(MEM_Str|MEM_Blob) != 0 && (*Mem)(unsafe.Pointer(pMem)).Fz != uintptr(0) {
  83024 		return memIntValue(tls, pMem)
  83025 	} else {
  83026 		return int64(0)
  83027 	}
  83028 	return I64(0)
  83029 }
  83030 
  83031 func memRealValue(tls *libc.TLS, pMem uintptr) float64 {
  83032 	bp := tls.Alloc(8)
  83033 	defer tls.Free(8)
  83034 
  83035 	*(*float64)(unsafe.Pointer(bp)) = float64(0)
  83036 	Xsqlite3AtoF(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, bp, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc)
  83037 	return *(*float64)(unsafe.Pointer(bp))
  83038 }
  83039 
  83040 func Xsqlite3VdbeRealValue(tls *libc.TLS, pMem uintptr) float64 {
  83041 	if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Real != 0 {
  83042 		return *(*float64)(unsafe.Pointer(pMem))
  83043 	} else if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_Int|MEM_IntReal) != 0 {
  83044 		return float64(*(*I64)(unsafe.Pointer(pMem)))
  83045 	} else if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_Str|MEM_Blob) != 0 {
  83046 		return memRealValue(tls, pMem)
  83047 	} else {
  83048 		return float64(0)
  83049 	}
  83050 	return float64(0)
  83051 }
  83052 
  83053 // Return 1 if pMem represents true, and return 0 if pMem represents false.
  83054 // Return the value ifNull if pMem is NULL.
  83055 func Xsqlite3VdbeBooleanValue(tls *libc.TLS, pMem uintptr, ifNull int32) int32 {
  83056 	if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_Int|MEM_IntReal) != 0 {
  83057 		return libc.Bool32(*(*I64)(unsafe.Pointer(pMem)) != int64(0))
  83058 	}
  83059 	if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Null != 0 {
  83060 		return ifNull
  83061 	}
  83062 	return libc.Bool32(Xsqlite3VdbeRealValue(tls, pMem) != 0.0)
  83063 }
  83064 
  83065 // The MEM structure is already a MEM_Real or MEM_IntReal. Try to
  83066 // make it a MEM_Int if we can.
  83067 func Xsqlite3VdbeIntegerAffinity(tls *libc.TLS, pMem uintptr) {
  83068 	if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_IntReal != 0 {
  83069 		(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Int)
  83070 	} else {
  83071 		var ix I64 = doubleToInt64(tls, *(*float64)(unsafe.Pointer(pMem)))
  83072 
  83073 		if *(*float64)(unsafe.Pointer(pMem)) == float64(ix) && ix > int64(-1)-(int64(0xffffffff)|int64(0x7fffffff)<<32) && ix < int64(0xffffffff)|int64(0x7fffffff)<<32 {
  83074 			*(*I64)(unsafe.Pointer(pMem)) = ix
  83075 			(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Int)
  83076 		}
  83077 	}
  83078 }
  83079 
  83080 // Convert pMem to type integer.  Invalidate any prior representations.
  83081 func Xsqlite3VdbeMemIntegerify(tls *libc.TLS, pMem uintptr) int32 {
  83082 	*(*I64)(unsafe.Pointer(pMem)) = Xsqlite3VdbeIntValue(tls, pMem)
  83083 	(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Int)
  83084 	return SQLITE_OK
  83085 }
  83086 
  83087 // Convert pMem so that it is of type MEM_Real.
  83088 // Invalidate any prior representations.
  83089 func Xsqlite3VdbeMemRealify(tls *libc.TLS, pMem uintptr) int32 {
  83090 	*(*float64)(unsafe.Pointer(pMem)) = Xsqlite3VdbeRealValue(tls, pMem)
  83091 	(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Real)
  83092 	return SQLITE_OK
  83093 }
  83094 
  83095 // Compare a floating point value to an integer.  Return true if the two
  83096 // values are the same within the precision of the floating point value.
  83097 //
  83098 // This function assumes that i was obtained by assignment from r1.
  83099 //
  83100 // For some versions of GCC on 32-bit machines, if you do the more obvious
  83101 // comparison of "r1==(double)i" you sometimes get an answer of false even
  83102 // though the r1 and (double)i values are bit-for-bit the same.
  83103 func Xsqlite3RealSameAsInt(tls *libc.TLS, r1 float64, i Sqlite3_int64) int32 {
  83104 	bp := tls.Alloc(16)
  83105 	defer tls.Free(16)
  83106 	*(*float64)(unsafe.Pointer(bp)) = r1
  83107 
  83108 	*(*float64)(unsafe.Pointer(bp + 8)) = float64(i)
  83109 	return libc.Bool32(*(*float64)(unsafe.Pointer(bp)) == 0.0 ||
  83110 		libc.Xmemcmp(tls, bp, bp+8, uint64(unsafe.Sizeof(float64(0)))) == 0 &&
  83111 			i >= -2251799813685248 && i < 2251799813685248)
  83112 }
  83113 
  83114 // Convert a floating point value to its closest integer.  Do so in
  83115 // a way that avoids 'outside the range of representable values' warnings
  83116 // from UBSAN.
  83117 func Xsqlite3RealToI64(tls *libc.TLS, r float64) I64 {
  83118 	if r <= float64(int64(-1)-(int64(0xffffffff)|int64(0x7fffffff)<<32)) {
  83119 		return int64(-1) - (int64(0xffffffff) | int64(0x7fffffff)<<32)
  83120 	}
  83121 	if r >= float64(int64(0xffffffff)|int64(0x7fffffff)<<32) {
  83122 		return int64(0xffffffff) | int64(0x7fffffff)<<32
  83123 	}
  83124 	return I64(r)
  83125 }
  83126 
  83127 // Convert pMem so that it has type MEM_Real or MEM_Int.
  83128 // Invalidate any prior representations.
  83129 //
  83130 // Every effort is made to force the conversion, even if the input
  83131 // is a string that does not look completely like a number.  Convert
  83132 // as much of the string as we can and ignore the rest.
  83133 func Xsqlite3VdbeMemNumerify(tls *libc.TLS, pMem uintptr) int32 {
  83134 	bp := tls.Alloc(8)
  83135 	defer tls.Free(8)
  83136 
  83137 	if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_Int|MEM_Real|MEM_IntReal|MEM_Null) == 0 {
  83138 		var rc int32
  83139 
  83140 		rc = Xsqlite3AtoF(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, pMem, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc)
  83141 		if (rc == 0 || rc == 1) && Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, bp, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc) <= 1 ||
  83142 			Xsqlite3RealSameAsInt(tls, *(*float64)(unsafe.Pointer(pMem)), libc.AssignPtrInt64(bp, Xsqlite3RealToI64(tls, *(*float64)(unsafe.Pointer(pMem))))) != 0 {
  83143 			*(*I64)(unsafe.Pointer(pMem)) = *(*Sqlite3_int64)(unsafe.Pointer(bp))
  83144 			(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Int)
  83145 		} else {
  83146 			(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Real)
  83147 		}
  83148 	}
  83149 
  83150 	*(*U16)(unsafe.Pointer(pMem + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Str | MEM_Blob | MEM_Zero))
  83151 	return SQLITE_OK
  83152 }
  83153 
  83154 // Cast the datatype of the value in pMem according to the affinity
  83155 // "aff".  Casting is different from applying affinity in that a cast
  83156 // is forced.  In other words, the value is converted into the desired
  83157 // affinity even if that results in loss of data.  This routine is
  83158 // used (for example) to implement the SQL "cast()" operator.
  83159 func Xsqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff U8, encoding U8) int32 {
  83160 	if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Null != 0 {
  83161 		return SQLITE_OK
  83162 	}
  83163 	switch int32(aff) {
  83164 	case SQLITE_AFF_BLOB:
  83165 		{
  83166 			if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Blob == 0 {
  83167 				Xsqlite3ValueApplyAffinity(tls, pMem, uint8(SQLITE_AFF_TEXT), encoding)
  83168 
  83169 				if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Str != 0 {
  83170 					(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Blob)
  83171 				}
  83172 			} else {
  83173 				*(*U16)(unsafe.Pointer(pMem + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_TypeMask & libc.CplInt32(MEM_Blob)))
  83174 			}
  83175 			break
  83176 
  83177 		}
  83178 	case SQLITE_AFF_NUMERIC:
  83179 		{
  83180 			Xsqlite3VdbeMemNumerify(tls, pMem)
  83181 			break
  83182 
  83183 		}
  83184 	case SQLITE_AFF_INTEGER:
  83185 		{
  83186 			Xsqlite3VdbeMemIntegerify(tls, pMem)
  83187 			break
  83188 
  83189 		}
  83190 	case SQLITE_AFF_REAL:
  83191 		{
  83192 			Xsqlite3VdbeMemRealify(tls, pMem)
  83193 			break
  83194 
  83195 		}
  83196 	default:
  83197 		{
  83198 			*(*U16)(unsafe.Pointer(pMem + 20)) |= U16(int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Blob >> 3)
  83199 			Xsqlite3ValueApplyAffinity(tls, pMem, uint8(SQLITE_AFF_TEXT), encoding)
  83200 
  83201 			*(*U16)(unsafe.Pointer(pMem + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Int | MEM_Real | MEM_IntReal | MEM_Blob | MEM_Zero))
  83202 			if int32(encoding) != SQLITE_UTF8 {
  83203 				*(*int32)(unsafe.Pointer(pMem + 16)) &= libc.CplInt32(1)
  83204 			}
  83205 			return Xsqlite3VdbeChangeEncoding(tls, pMem, int32(encoding))
  83206 
  83207 		}
  83208 	}
  83209 	return SQLITE_OK
  83210 }
  83211 
  83212 // Initialize bulk memory to be a consistent Mem object.
  83213 //
  83214 // The minimum amount of initialization feasible is performed.
  83215 func Xsqlite3VdbeMemInit(tls *libc.TLS, pMem uintptr, db uintptr, flags U16) {
  83216 	(*Mem)(unsafe.Pointer(pMem)).Fflags = flags
  83217 	(*Mem)(unsafe.Pointer(pMem)).Fdb = db
  83218 	(*Mem)(unsafe.Pointer(pMem)).FszMalloc = 0
  83219 }
  83220 
  83221 // Delete any previous value and set the value stored in *pMem to NULL.
  83222 //
  83223 // This routine calls the Mem.xDel destructor to dispose of values that
  83224 // require the destructor.  But it preserves the Mem.zMalloc memory allocation.
  83225 // To free all resources, use sqlite3VdbeMemRelease(), which both calls this
  83226 // routine to invoke the destructor and deallocates Mem.zMalloc.
  83227 //
  83228 // Use this routine to reset the Mem prior to insert a new value.
  83229 //
  83230 // Use sqlite3VdbeMemRelease() to complete erase the Mem prior to abandoning it.
  83231 func Xsqlite3VdbeMemSetNull(tls *libc.TLS, pMem uintptr) {
  83232 	if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_Agg|MEM_Dyn) != 0 {
  83233 		vdbeMemClearExternAndSetNull(tls, pMem)
  83234 	} else {
  83235 		(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Null)
  83236 	}
  83237 }
  83238 
  83239 func Xsqlite3ValueSetNull(tls *libc.TLS, p uintptr) {
  83240 	Xsqlite3VdbeMemSetNull(tls, p)
  83241 }
  83242 
  83243 // Delete any previous value and set the value to be a BLOB of length
  83244 // n containing all zeros.
  83245 func Xsqlite3VdbeMemSetZeroBlob(tls *libc.TLS, pMem uintptr, n int32) {
  83246 	Xsqlite3VdbeMemRelease(tls, pMem)
  83247 	(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Blob | MEM_Zero)
  83248 	(*Mem)(unsafe.Pointer(pMem)).Fn = 0
  83249 	if n < 0 {
  83250 		n = 0
  83251 	}
  83252 	*(*int32)(unsafe.Pointer(pMem)) = n
  83253 	(*Mem)(unsafe.Pointer(pMem)).Fenc = U8(SQLITE_UTF8)
  83254 	(*Mem)(unsafe.Pointer(pMem)).Fz = uintptr(0)
  83255 }
  83256 
  83257 func vdbeReleaseAndSetInt64(tls *libc.TLS, pMem uintptr, val I64) {
  83258 	Xsqlite3VdbeMemSetNull(tls, pMem)
  83259 	*(*I64)(unsafe.Pointer(pMem)) = val
  83260 	(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int)
  83261 }
  83262 
  83263 // Delete any previous value and set the value stored in *pMem to val,
  83264 // manifest type INTEGER.
  83265 func Xsqlite3VdbeMemSetInt64(tls *libc.TLS, pMem uintptr, val I64) {
  83266 	if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_Agg|MEM_Dyn) != 0 {
  83267 		vdbeReleaseAndSetInt64(tls, pMem, val)
  83268 	} else {
  83269 		*(*I64)(unsafe.Pointer(pMem)) = val
  83270 		(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int)
  83271 	}
  83272 }
  83273 
  83274 // A no-op destructor
  83275 func Xsqlite3NoopDestructor(tls *libc.TLS, p uintptr) {
  83276 	_ = p
  83277 }
  83278 
  83279 // Set the value stored in *pMem should already be a NULL.
  83280 // Also store a pointer to go with it.
  83281 func Xsqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) {
  83282 	vdbeMemClear(tls, pMem)
  83283 	*(*uintptr)(unsafe.Pointer(pMem)) = func() uintptr {
  83284 		if zPType != 0 {
  83285 			return zPType
  83286 		}
  83287 		return ts + 1544
  83288 	}()
  83289 	(*Mem)(unsafe.Pointer(pMem)).Fz = pPtr
  83290 	(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Null | MEM_Dyn | MEM_Subtype | MEM_Term)
  83291 	(*Mem)(unsafe.Pointer(pMem)).FeSubtype = U8('p')
  83292 	(*Mem)(unsafe.Pointer(pMem)).FxDel = func() uintptr {
  83293 		if xDestructor != 0 {
  83294 			return xDestructor
  83295 		}
  83296 		return *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3NoopDestructor}))
  83297 	}()
  83298 }
  83299 
  83300 // Delete any previous value and set the value stored in *pMem to val,
  83301 // manifest type REAL.
  83302 func Xsqlite3VdbeMemSetDouble(tls *libc.TLS, pMem uintptr, val float64) {
  83303 	Xsqlite3VdbeMemSetNull(tls, pMem)
  83304 	if !(Xsqlite3IsNaN(tls, val) != 0) {
  83305 		*(*float64)(unsafe.Pointer(pMem)) = val
  83306 		(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Real)
  83307 	}
  83308 }
  83309 
  83310 // Delete any previous value and set the value of pMem to be an
  83311 // empty boolean index.
  83312 //
  83313 // Return SQLITE_OK on success and SQLITE_NOMEM if a memory allocation
  83314 // error occurs.
  83315 func Xsqlite3VdbeMemSetRowSet(tls *libc.TLS, pMem uintptr) int32 {
  83316 	var db uintptr = (*Mem)(unsafe.Pointer(pMem)).Fdb
  83317 	var p uintptr
  83318 
  83319 	Xsqlite3VdbeMemRelease(tls, pMem)
  83320 	p = Xsqlite3RowSetInit(tls, db)
  83321 	if p == uintptr(0) {
  83322 		return SQLITE_NOMEM
  83323 	}
  83324 	(*Mem)(unsafe.Pointer(pMem)).Fz = p
  83325 	(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Blob | MEM_Dyn)
  83326 	(*Mem)(unsafe.Pointer(pMem)).FxDel = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3RowSetDelete}))
  83327 	return SQLITE_OK
  83328 }
  83329 
  83330 // Return true if the Mem object contains a TEXT or BLOB that is
  83331 // too large - whose size exceeds SQLITE_MAX_LENGTH.
  83332 func Xsqlite3VdbeMemTooBig(tls *libc.TLS, p uintptr) int32 {
  83333 	if int32((*Mem)(unsafe.Pointer(p)).Fflags)&(MEM_Str|MEM_Blob) != 0 {
  83334 		var n int32 = (*Mem)(unsafe.Pointer(p)).Fn
  83335 		if int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_Zero != 0 {
  83336 			n = n + *(*int32)(unsafe.Pointer(p))
  83337 		}
  83338 		return libc.Bool32(n > *(*int32)(unsafe.Pointer((*Mem)(unsafe.Pointer(p)).Fdb + 136)))
  83339 	}
  83340 	return 0
  83341 }
  83342 
  83343 func vdbeClrCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr, eType int32) {
  83344 	vdbeMemClearExternAndSetNull(tls, pTo)
  83345 
  83346 	Xsqlite3VdbeMemShallowCopy(tls, pTo, pFrom, eType)
  83347 }
  83348 
  83349 func Xsqlite3VdbeMemShallowCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr, srcType int32) {
  83350 	if int32((*Mem)(unsafe.Pointer(pTo)).Fflags)&(MEM_Agg|MEM_Dyn) != 0 {
  83351 		vdbeClrCopy(tls, pTo, pFrom, srcType)
  83352 		return
  83353 	}
  83354 	libc.Xmemcpy(tls, pTo, pFrom, uint64(uintptr(0)+24))
  83355 	if int32((*Mem)(unsafe.Pointer(pFrom)).Fflags)&MEM_Static == 0 {
  83356 		*(*U16)(unsafe.Pointer(pTo + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Dyn | MEM_Static | MEM_Ephem))
  83357 
  83358 		*(*U16)(unsafe.Pointer(pTo + 20)) |= U16(srcType)
  83359 	}
  83360 }
  83361 
  83362 // Make a full copy of pFrom into pTo.  Prior contents of pTo are
  83363 // freed before the copy is made.
  83364 func Xsqlite3VdbeMemCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr) int32 {
  83365 	var rc int32 = SQLITE_OK
  83366 
  83367 	if int32((*Mem)(unsafe.Pointer(pTo)).Fflags)&(MEM_Agg|MEM_Dyn) != 0 {
  83368 		vdbeMemClearExternAndSetNull(tls, pTo)
  83369 	}
  83370 	libc.Xmemcpy(tls, pTo, pFrom, uint64(uintptr(0)+24))
  83371 	*(*U16)(unsafe.Pointer(pTo + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Dyn))
  83372 	if int32((*Mem)(unsafe.Pointer(pTo)).Fflags)&(MEM_Str|MEM_Blob) != 0 {
  83373 		if 0 == int32((*Mem)(unsafe.Pointer(pFrom)).Fflags)&MEM_Static {
  83374 			*(*U16)(unsafe.Pointer(pTo + 20)) |= U16(MEM_Ephem)
  83375 			rc = Xsqlite3VdbeMemMakeWriteable(tls, pTo)
  83376 		}
  83377 	}
  83378 
  83379 	return rc
  83380 }
  83381 
  83382 // Transfer the contents of pFrom to pTo. Any existing value in pTo is
  83383 // freed. If pFrom contains ephemeral data, a copy is made.
  83384 //
  83385 // pFrom contains an SQL NULL when this routine returns.
  83386 func Xsqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) {
  83387 	Xsqlite3VdbeMemRelease(tls, pTo)
  83388 	libc.Xmemcpy(tls, pTo, pFrom, uint64(unsafe.Sizeof(Mem{})))
  83389 	(*Mem)(unsafe.Pointer(pFrom)).Fflags = U16(MEM_Null)
  83390 	(*Mem)(unsafe.Pointer(pFrom)).FszMalloc = 0
  83391 }
  83392 
  83393 // Change the value of a Mem to be a string or a BLOB.
  83394 //
  83395 // The memory management strategy depends on the value of the xDel
  83396 // parameter. If the value passed is SQLITE_TRANSIENT, then the
  83397 // string is copied into a (possibly existing) buffer managed by the
  83398 // Mem structure. Otherwise, any existing buffer is freed and the
  83399 // pointer copied.
  83400 //
  83401 // If the string is too large (if it exceeds the SQLITE_LIMIT_LENGTH
  83402 // size limit) then no memory allocation occurs.  If the string can be
  83403 // stored without allocating memory, then it is.  If a memory allocation
  83404 // is required to store the string, then value of pMem is unchanged.  In
  83405 // either case, SQLITE_TOOBIG is returned.
  83406 //
  83407 // The "enc" parameter is the text encoding for the string, or zero
  83408 // to store a blob.
  83409 //
  83410 // If n is negative, then the string consists of all bytes up to but
  83411 // excluding the first zero character.  The n parameter must be
  83412 // non-negative for blobs.
  83413 func Xsqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n I64, enc U8, xDel uintptr) int32 {
  83414 	var nByte I64 = n
  83415 	var iLimit int32
  83416 	var flags U16
  83417 
  83418 	if !(z != 0) {
  83419 		Xsqlite3VdbeMemSetNull(tls, pMem)
  83420 		return SQLITE_OK
  83421 	}
  83422 
  83423 	if (*Mem)(unsafe.Pointer(pMem)).Fdb != 0 {
  83424 		iLimit = *(*int32)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fdb + 136))
  83425 	} else {
  83426 		iLimit = SQLITE_MAX_LENGTH
  83427 	}
  83428 	if nByte < int64(0) {
  83429 		if int32(enc) == SQLITE_UTF8 {
  83430 			nByte = I64(libc.Xstrlen(tls, z))
  83431 		} else {
  83432 			for nByte = int64(0); nByte <= I64(iLimit) && int32(*(*int8)(unsafe.Pointer(z + uintptr(nByte))))|int32(*(*int8)(unsafe.Pointer(z + uintptr(nByte+int64(1))))) != 0; nByte = nByte + int64(2) {
  83433 			}
  83434 		}
  83435 		flags = U16(MEM_Str | MEM_Term)
  83436 	} else if int32(enc) == 0 {
  83437 		flags = U16(MEM_Blob)
  83438 		enc = U8(SQLITE_UTF8)
  83439 	} else {
  83440 		flags = U16(MEM_Str)
  83441 	}
  83442 	if nByte > I64(iLimit) {
  83443 		if xDel != 0 && xDel != libc.UintptrFromInt32(-1) {
  83444 			if xDel == *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomClear})) {
  83445 				Xsqlite3DbFree(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, z)
  83446 			} else {
  83447 				(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{xDel})).f(tls, z)
  83448 			}
  83449 		}
  83450 		Xsqlite3VdbeMemSetNull(tls, pMem)
  83451 		return Xsqlite3ErrorToParser(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, SQLITE_TOOBIG)
  83452 	}
  83453 
  83454 	if xDel == libc.UintptrFromInt32(-1) {
  83455 		var nAlloc I64 = nByte
  83456 		if int32(flags)&MEM_Term != 0 {
  83457 			nAlloc = nAlloc + func() int64 {
  83458 				if int32(enc) == SQLITE_UTF8 {
  83459 					return int64(1)
  83460 				}
  83461 				return int64(2)
  83462 			}()
  83463 		}
  83464 
  83465 		if Xsqlite3VdbeMemClearAndResize(tls, pMem, func() int32 {
  83466 			if nAlloc > int64(32) {
  83467 				return int32(nAlloc)
  83468 			}
  83469 			return 32
  83470 		}()) != 0 {
  83471 			return SQLITE_NOMEM
  83472 		}
  83473 		libc.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, z, uint64(nAlloc))
  83474 	} else {
  83475 		Xsqlite3VdbeMemRelease(tls, pMem)
  83476 		(*Mem)(unsafe.Pointer(pMem)).Fz = z
  83477 		if xDel == *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomClear})) {
  83478 			(*Mem)(unsafe.Pointer(pMem)).FzMalloc = (*Mem)(unsafe.Pointer(pMem)).Fz
  83479 			(*Mem)(unsafe.Pointer(pMem)).FszMalloc = Xsqlite3DbMallocSize(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, (*Mem)(unsafe.Pointer(pMem)).FzMalloc)
  83480 		} else {
  83481 			(*Mem)(unsafe.Pointer(pMem)).FxDel = xDel
  83482 			flags = U16(int32(flags) | func() int32 {
  83483 				if xDel == uintptr(0) {
  83484 					return MEM_Static
  83485 				}
  83486 				return MEM_Dyn
  83487 			}())
  83488 		}
  83489 	}
  83490 
  83491 	(*Mem)(unsafe.Pointer(pMem)).Fn = int32(nByte & int64(0x7fffffff))
  83492 	(*Mem)(unsafe.Pointer(pMem)).Fflags = flags
  83493 	(*Mem)(unsafe.Pointer(pMem)).Fenc = enc
  83494 
  83495 	if int32(enc) > SQLITE_UTF8 && Xsqlite3VdbeMemHandleBom(tls, pMem) != 0 {
  83496 		return SQLITE_NOMEM
  83497 	}
  83498 
  83499 	return SQLITE_OK
  83500 }
  83501 
  83502 // Move data out of a btree key or data field and into a Mem structure.
  83503 // The data is payload from the entry that pCur is currently pointing
  83504 // to.  offset and amt determine what portion of the data or key to retrieve.
  83505 // The result is written into the pMem element.
  83506 //
  83507 // The pMem object must have been initialized.  This routine will use
  83508 // pMem->zMalloc to hold the content from the btree, if possible.  New
  83509 // pMem->zMalloc space will be allocated if necessary.  The calling routine
  83510 // is responsible for making sure that the pMem object is eventually
  83511 // destroyed.
  83512 //
  83513 // If this routine fails for any reason (malloc returns NULL or unable
  83514 // to read from the disk) then the pMem is left in an inconsistent state.
  83515 func Xsqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pMem uintptr) int32 {
  83516 	var rc int32
  83517 	(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Null)
  83518 	if Xsqlite3BtreeMaxRecordSize(tls, pCur) < Sqlite3_int64(offset+amt) {
  83519 		return Xsqlite3CorruptError(tls, 81634)
  83520 	}
  83521 	if SQLITE_OK == libc.AssignInt32(&rc, Xsqlite3VdbeMemClearAndResize(tls, pMem, int32(amt+U32(1)))) {
  83522 		rc = Xsqlite3BtreePayload(tls, pCur, offset, amt, (*Mem)(unsafe.Pointer(pMem)).Fz)
  83523 		if rc == SQLITE_OK {
  83524 			*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr(amt))) = int8(0)
  83525 			(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Blob)
  83526 			(*Mem)(unsafe.Pointer(pMem)).Fn = int32(amt)
  83527 		} else {
  83528 			Xsqlite3VdbeMemRelease(tls, pMem)
  83529 		}
  83530 	}
  83531 	return rc
  83532 }
  83533 
  83534 func Xsqlite3VdbeMemFromBtreeZeroOffset(tls *libc.TLS, pCur uintptr, amt U32, pMem uintptr) int32 {
  83535 	bp := tls.Alloc(4)
  83536 	defer tls.Free(4)
  83537 
  83538 	*(*U32)(unsafe.Pointer(bp)) = U32(0)
  83539 	var rc int32 = SQLITE_OK
  83540 
  83541 	(*Mem)(unsafe.Pointer(pMem)).Fz = Xsqlite3BtreePayloadFetch(tls, pCur, bp)
  83542 
  83543 	if amt <= *(*U32)(unsafe.Pointer(bp)) {
  83544 		(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Blob | MEM_Ephem)
  83545 		(*Mem)(unsafe.Pointer(pMem)).Fn = int32(amt)
  83546 	} else {
  83547 		rc = Xsqlite3VdbeMemFromBtree(tls, pCur, uint32(0), amt, pMem)
  83548 	}
  83549 
  83550 	return rc
  83551 }
  83552 
  83553 func valueToText(tls *libc.TLS, pVal uintptr, enc U8) uintptr {
  83554 	if int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(MEM_Blob|MEM_Str) != 0 {
  83555 		if func() int32 {
  83556 			if int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags)&MEM_Zero != 0 {
  83557 				return Xsqlite3VdbeMemExpandBlob(tls, pVal)
  83558 			}
  83559 			return 0
  83560 		}() != 0 {
  83561 			return uintptr(0)
  83562 		}
  83563 		*(*U16)(unsafe.Pointer(pVal + 20)) |= U16(MEM_Str)
  83564 		if int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fenc) != int32(enc)&libc.CplInt32(SQLITE_UTF16_ALIGNED) {
  83565 			Xsqlite3VdbeChangeEncoding(tls, pVal, int32(enc)&libc.CplInt32(SQLITE_UTF16_ALIGNED))
  83566 		}
  83567 		if int32(enc)&SQLITE_UTF16_ALIGNED != 0 && 1 == 1&int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fz) {
  83568 			if Xsqlite3VdbeMemMakeWriteable(tls, pVal) != SQLITE_OK {
  83569 				return uintptr(0)
  83570 			}
  83571 		}
  83572 		Xsqlite3VdbeMemNulTerminate(tls, pVal)
  83573 	} else {
  83574 		Xsqlite3VdbeMemStringify(tls, pVal, enc, uint8(0))
  83575 
  83576 	}
  83577 
  83578 	if int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fenc) == int32(enc)&libc.CplInt32(SQLITE_UTF16_ALIGNED) {
  83579 		return (*Sqlite3_value)(unsafe.Pointer(pVal)).Fz
  83580 	} else {
  83581 		return uintptr(0)
  83582 	}
  83583 	return uintptr(0)
  83584 }
  83585 
  83586 // This function is only available internally, it is not part of the
  83587 // external API. It works in a similar way to sqlite3_value_text(),
  83588 // except the data returned is in the encoding specified by the second
  83589 // parameter, which must be one of SQLITE_UTF16BE, SQLITE_UTF16LE or
  83590 // SQLITE_UTF8.
  83591 //
  83592 // (2006-02-16:)  The enc value can be or-ed with SQLITE_UTF16_ALIGNED.
  83593 // If that is the case, then the result must be aligned on an even byte
  83594 // boundary.
  83595 func Xsqlite3ValueText(tls *libc.TLS, pVal uintptr, enc U8) uintptr {
  83596 	if !(pVal != 0) {
  83597 		return uintptr(0)
  83598 	}
  83599 
  83600 	if int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(MEM_Str|MEM_Term) == MEM_Str|MEM_Term && int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fenc) == int32(enc) {
  83601 		return (*Sqlite3_value)(unsafe.Pointer(pVal)).Fz
  83602 	}
  83603 	if int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags)&MEM_Null != 0 {
  83604 		return uintptr(0)
  83605 	}
  83606 	return valueToText(tls, pVal, enc)
  83607 }
  83608 
  83609 // Create a new sqlite3_value object.
  83610 func Xsqlite3ValueNew(tls *libc.TLS, db uintptr) uintptr {
  83611 	var p uintptr = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Mem{})))
  83612 	if p != 0 {
  83613 		(*Mem)(unsafe.Pointer(p)).Fflags = U16(MEM_Null)
  83614 		(*Mem)(unsafe.Pointer(p)).Fdb = db
  83615 	}
  83616 	return p
  83617 }
  83618 
  83619 // Context object passed by sqlite3Stat4ProbeSetValue() through to
  83620 // valueNew(). See comments above valueNew() for details.
  83621 type ValueNewStat4Ctx = struct {
  83622 	FpParse      uintptr
  83623 	FpIdx        uintptr
  83624 	FppRec       uintptr
  83625 	FiVal        int32
  83626 	F__ccgo_pad1 [4]byte
  83627 }
  83628 
  83629 func valueNew(tls *libc.TLS, db uintptr, p uintptr) uintptr {
  83630 	if p != 0 {
  83631 		var pRec uintptr = *(*uintptr)(unsafe.Pointer((*ValueNewStat4Ctx)(unsafe.Pointer(p)).FppRec))
  83632 
  83633 		if pRec == uintptr(0) {
  83634 			var pIdx uintptr = (*ValueNewStat4Ctx)(unsafe.Pointer(p)).FpIdx
  83635 			var nByte int32
  83636 			var i int32
  83637 			var nCol int32 = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
  83638 
  83639 			nByte = int32(uint64(unsafe.Sizeof(Mem{}))*uint64(nCol) + (uint64(unsafe.Sizeof(UnpackedRecord{}))+uint64(7))&libc.Uint64FromInt32(libc.CplInt32(7)))
  83640 			pRec = Xsqlite3DbMallocZero(tls, db, uint64(nByte))
  83641 			if pRec != 0 {
  83642 				(*UnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo = Xsqlite3KeyInfoOfIndex(tls, (*ValueNewStat4Ctx)(unsafe.Pointer(p)).FpParse, pIdx)
  83643 				if (*UnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo != 0 {
  83644 					(*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem = pRec + uintptr((uint64(unsafe.Sizeof(UnpackedRecord{}))+uint64(7))&libc.Uint64FromInt32(libc.CplInt32(7)))
  83645 					for i = 0; i < nCol; i++ {
  83646 						(*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem + uintptr(i)*56)).Fflags = U16(MEM_Null)
  83647 						(*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem + uintptr(i)*56)).Fdb = db
  83648 					}
  83649 				} else {
  83650 					Xsqlite3DbFreeNN(tls, db, pRec)
  83651 					pRec = uintptr(0)
  83652 				}
  83653 			}
  83654 			if pRec == uintptr(0) {
  83655 				return uintptr(0)
  83656 			}
  83657 			*(*uintptr)(unsafe.Pointer((*ValueNewStat4Ctx)(unsafe.Pointer(p)).FppRec)) = pRec
  83658 		}
  83659 
  83660 		(*UnpackedRecord)(unsafe.Pointer(pRec)).FnField = U16((*ValueNewStat4Ctx)(unsafe.Pointer(p)).FiVal + 1)
  83661 		return (*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem + uintptr((*ValueNewStat4Ctx)(unsafe.Pointer(p)).FiVal)*56
  83662 	}
  83663 	return Xsqlite3ValueNew(tls, db)
  83664 }
  83665 
  83666 func valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc U8, aff U8, ppVal uintptr, pCtx uintptr) int32 {
  83667 	bp := tls.Alloc(64)
  83668 	defer tls.Free(64)
  83669 
  83670 	var apVal uintptr
  83671 	var nVal int32
  83672 	var pFunc uintptr
  83673 	var pVal uintptr
  83674 	var rc int32
  83675 	var pList uintptr
  83676 	var i int32
  83677 	apVal = uintptr(0)
  83678 	nVal = 0
  83679 	pFunc = uintptr(0)
  83680 	pVal = uintptr(0)
  83681 	rc = SQLITE_OK
  83682 	pList = uintptr(0)
  83683 
  83684 	pList = *(*uintptr)(unsafe.Pointer(p + 32))
  83685 	if !(pList != 0) {
  83686 		goto __1
  83687 	}
  83688 	nVal = (*ExprList)(unsafe.Pointer(pList)).FnExpr
  83689 __1:
  83690 	;
  83691 	pFunc = Xsqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(p + 8)), nVal, enc, uint8(0))
  83692 
  83693 	if !((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&U32(SQLITE_FUNC_CONSTANT|SQLITE_FUNC_SLOCHNG) == U32(0) ||
  83694 		(*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&U32(SQLITE_FUNC_NEEDCOLL) != 0) {
  83695 		goto __2
  83696 	}
  83697 	return SQLITE_OK
  83698 __2:
  83699 	;
  83700 	if !(pList != 0) {
  83701 		goto __3
  83702 	}
  83703 	apVal = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(uintptr(0)))*uint64(nVal))
  83704 	if !(apVal == uintptr(0)) {
  83705 		goto __4
  83706 	}
  83707 	rc = SQLITE_NOMEM
  83708 	goto value_from_function_out
  83709 __4:
  83710 	;
  83711 	i = 0
  83712 __5:
  83713 	if !(i < nVal) {
  83714 		goto __7
  83715 	}
  83716 	rc = Xsqlite3ValueFromExpr(tls, db, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*32)).FpExpr, enc, aff, apVal+uintptr(i)*8)
  83717 	if !(*(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8)) == uintptr(0) || rc != SQLITE_OK) {
  83718 		goto __8
  83719 	}
  83720 	goto value_from_function_out
  83721 __8:
  83722 	;
  83723 	goto __6
  83724 __6:
  83725 	i++
  83726 	goto __5
  83727 	goto __7
  83728 __7:
  83729 	;
  83730 __3:
  83731 	;
  83732 	pVal = valueNew(tls, db, pCtx)
  83733 	if !(pVal == uintptr(0)) {
  83734 		goto __9
  83735 	}
  83736 	rc = SQLITE_NOMEM
  83737 	goto value_from_function_out
  83738 __9:
  83739 	;
  83740 	libc.Xmemset(tls, bp+8, 0, uint64(unsafe.Sizeof(Sqlite3_context{})))
  83741 	(*Sqlite3_context)(unsafe.Pointer(bp + 8)).FpOut = pVal
  83742 	(*Sqlite3_context)(unsafe.Pointer(bp + 8)).FpFunc = pFunc
  83743 	(*Sqlite3_context)(unsafe.Pointer(bp + 8)).Fenc = (*Sqlite3)(unsafe.Pointer(db)).Fenc
  83744 	(*struct {
  83745 		f func(*libc.TLS, uintptr, int32, uintptr)
  83746 	})(unsafe.Pointer(&struct{ uintptr }{(*FuncDef)(unsafe.Pointer(pFunc)).FxSFunc})).f(tls, bp+8, nVal, apVal)
  83747 	if !((*Sqlite3_context)(unsafe.Pointer(bp+8)).FisError != 0) {
  83748 		goto __10
  83749 	}
  83750 	rc = (*Sqlite3_context)(unsafe.Pointer(bp + 8)).FisError
  83751 	Xsqlite3ErrorMsg(tls, (*ValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, ts+4493, libc.VaList(bp, Xsqlite3_value_text(tls, pVal)))
  83752 	goto __11
  83753 __10:
  83754 	Xsqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8))
  83755 
  83756 __11:
  83757 	;
  83758 value_from_function_out:
  83759 	if !(rc != SQLITE_OK) {
  83760 		goto __12
  83761 	}
  83762 	pVal = uintptr(0)
  83763 	(*Parse)(unsafe.Pointer((*ValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).Frc = rc
  83764 __12:
  83765 	;
  83766 	if !(apVal != 0) {
  83767 		goto __13
  83768 	}
  83769 	i = 0
  83770 __14:
  83771 	if !(i < nVal) {
  83772 		goto __16
  83773 	}
  83774 	Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8)))
  83775 	goto __15
  83776 __15:
  83777 	i++
  83778 	goto __14
  83779 	goto __16
  83780 __16:
  83781 	;
  83782 	Xsqlite3DbFreeNN(tls, db, apVal)
  83783 __13:
  83784 	;
  83785 	*(*uintptr)(unsafe.Pointer(ppVal)) = pVal
  83786 	return rc
  83787 }
  83788 
  83789 func valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc U8, affinity U8, ppVal uintptr, pCtx uintptr) int32 {
  83790 	bp := tls.Alloc(24)
  83791 	defer tls.Free(24)
  83792 
  83793 	var op int32
  83794 	var zVal uintptr
  83795 
  83796 	var negInt int32
  83797 	var zNeg uintptr
  83798 	var rc int32
  83799 	var aff U8
  83800 	var nVal int32
  83801 	zVal = uintptr(0)
  83802 	*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
  83803 	negInt = 1
  83804 	zNeg = ts + 1544
  83805 	rc = SQLITE_OK
  83806 
  83807 __1:
  83808 	if !(libc.AssignInt32(&op, int32((*Expr)(unsafe.Pointer(pExpr)).Fop)) == TK_UPLUS || op == TK_SPAN) {
  83809 		goto __2
  83810 	}
  83811 	pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
  83812 	goto __1
  83813 __2:
  83814 	;
  83815 	if !(op == TK_REGISTER) {
  83816 		goto __3
  83817 	}
  83818 	op = int32((*Expr)(unsafe.Pointer(pExpr)).Fop2)
  83819 __3:
  83820 	;
  83821 	if !(op == TK_CAST) {
  83822 		goto __4
  83823 	}
  83824 
  83825 	aff = U8(Xsqlite3AffinityType(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), uintptr(0)))
  83826 	rc = valueFromExpr(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, enc, aff, ppVal, pCtx)
  83827 
  83828 	if !(*(*uintptr)(unsafe.Pointer(ppVal)) != 0) {
  83829 		goto __5
  83830 	}
  83831 	Xsqlite3VdbeMemCast(tls, *(*uintptr)(unsafe.Pointer(ppVal)), aff, enc)
  83832 	Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(ppVal)), affinity, enc)
  83833 __5:
  83834 	;
  83835 	return rc
  83836 __4:
  83837 	;
  83838 	if !(op == TK_UMINUS &&
  83839 		(int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_INTEGER || int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_FLOAT)) {
  83840 		goto __6
  83841 	}
  83842 	pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
  83843 	op = int32((*Expr)(unsafe.Pointer(pExpr)).Fop)
  83844 	negInt = -1
  83845 	zNeg = ts + 6284
  83846 __6:
  83847 	;
  83848 	if !(op == TK_STRING || op == TK_FLOAT || op == TK_INTEGER) {
  83849 		goto __7
  83850 	}
  83851 	*(*uintptr)(unsafe.Pointer(bp + 16)) = valueNew(tls, db, pCtx)
  83852 	if !(*(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0)) {
  83853 		goto __9
  83854 	}
  83855 	goto no_mem
  83856 __9:
  83857 	;
  83858 	if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_IntValue) != U32(0)) {
  83859 		goto __10
  83860 	}
  83861 	Xsqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), I64(*(*int32)(unsafe.Pointer(pExpr + 8)))*I64(negInt))
  83862 	goto __11
  83863 __10:
  83864 	zVal = Xsqlite3MPrintf(tls, db, ts+6286, libc.VaList(bp, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8))))
  83865 	if !(zVal == uintptr(0)) {
  83866 		goto __12
  83867 	}
  83868 	goto no_mem
  83869 __12:
  83870 	;
  83871 	Xsqlite3ValueSetStr(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), -1, zVal, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomClear})))
  83872 __11:
  83873 	;
  83874 	if !((op == TK_INTEGER || op == TK_FLOAT) && int32(affinity) == SQLITE_AFF_BLOB) {
  83875 		goto __13
  83876 	}
  83877 	Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), uint8(SQLITE_AFF_NUMERIC), uint8(SQLITE_UTF8))
  83878 	goto __14
  83879 __13:
  83880 	Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), affinity, uint8(SQLITE_UTF8))
  83881 __14:
  83882 	;
  83883 	if !(int32((*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fflags)&(MEM_Int|MEM_IntReal|MEM_Real) != 0) {
  83884 		goto __15
  83885 	}
  83886 
  83887 	*(*U16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Str))
  83888 __15:
  83889 	;
  83890 	if !(int32(enc) != SQLITE_UTF8) {
  83891 		goto __16
  83892 	}
  83893 	rc = Xsqlite3VdbeChangeEncoding(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), int32(enc))
  83894 __16:
  83895 	;
  83896 	goto __8
  83897 __7:
  83898 	if !(op == TK_UMINUS) {
  83899 		goto __17
  83900 	}
  83901 
  83902 	if !(SQLITE_OK == valueFromExpr(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, enc, affinity, bp+16, pCtx) &&
  83903 		*(*uintptr)(unsafe.Pointer(bp + 16)) != uintptr(0)) {
  83904 		goto __19
  83905 	}
  83906 	Xsqlite3VdbeMemNumerify(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
  83907 	if !(int32((*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fflags)&MEM_Real != 0) {
  83908 		goto __20
  83909 	}
  83910 	*(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))) = -*(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16))))
  83911 	goto __21
  83912 __20:
  83913 	if !(*(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))) == int64(-1)-(int64(0xffffffff)|int64(0x7fffffff)<<32)) {
  83914 		goto __22
  83915 	}
  83916 	*(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))) = -float64(int64(-1) - (int64(0xffffffff) | int64(0x7fffffff)<<32))
  83917 	(*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fflags = U16(int32((*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Real)
  83918 	goto __23
  83919 __22:
  83920 	*(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))) = -*(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16))))
  83921 __23:
  83922 	;
  83923 __21:
  83924 	;
  83925 	Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), affinity, enc)
  83926 __19:
  83927 	;
  83928 	goto __18
  83929 __17:
  83930 	if !(op == TK_NULL) {
  83931 		goto __24
  83932 	}
  83933 	*(*uintptr)(unsafe.Pointer(bp + 16)) = valueNew(tls, db, pCtx)
  83934 	if !(*(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0)) {
  83935 		goto __26
  83936 	}
  83937 	goto no_mem
  83938 __26:
  83939 	;
  83940 	Xsqlite3VdbeMemSetNull(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
  83941 	goto __25
  83942 __24:
  83943 	if !(op == TK_BLOB) {
  83944 		goto __27
  83945 	}
  83946 
  83947 	*(*uintptr)(unsafe.Pointer(bp + 16)) = valueNew(tls, db, pCtx)
  83948 	if !!(*(*uintptr)(unsafe.Pointer(bp + 16)) != 0) {
  83949 		goto __29
  83950 	}
  83951 	goto no_mem
  83952 __29:
  83953 	;
  83954 	zVal = *(*uintptr)(unsafe.Pointer(pExpr + 8)) + 2
  83955 	nVal = Xsqlite3Strlen30(tls, zVal) - 1
  83956 
  83957 	Xsqlite3VdbeMemSetStr(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), Xsqlite3HexToBlob(tls, db, zVal, nVal), int64(nVal/2),
  83958 		uint8(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomClear})))
  83959 	goto __28
  83960 __27:
  83961 	if !(op == TK_FUNCTION && pCtx != uintptr(0)) {
  83962 		goto __30
  83963 	}
  83964 	rc = valueFromFunction(tls, db, pExpr, enc, affinity, bp+16, pCtx)
  83965 	goto __31
  83966 __30:
  83967 	if !(op == TK_TRUEFALSE) {
  83968 		goto __32
  83969 	}
  83970 
  83971 	*(*uintptr)(unsafe.Pointer(bp + 16)) = valueNew(tls, db, pCtx)
  83972 	if !(*(*uintptr)(unsafe.Pointer(bp + 16)) != 0) {
  83973 		goto __33
  83974 	}
  83975 	(*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fflags = U16(MEM_Int)
  83976 	*(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))) = I64(libc.Bool32(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 8)) + 4))) == 0))
  83977 __33:
  83978 	;
  83979 __32:
  83980 	;
  83981 __31:
  83982 	;
  83983 __28:
  83984 	;
  83985 __25:
  83986 	;
  83987 __18:
  83988 	;
  83989 __8:
  83990 	;
  83991 	*(*uintptr)(unsafe.Pointer(ppVal)) = *(*uintptr)(unsafe.Pointer(bp + 16))
  83992 	return rc
  83993 
  83994 no_mem:
  83995 	if !(pCtx == uintptr(0) || (*Parse)(unsafe.Pointer((*ValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr == 0) {
  83996 		goto __34
  83997 	}
  83998 	Xsqlite3OomFault(tls, db)
  83999 __34:
  84000 	;
  84001 	Xsqlite3DbFree(tls, db, zVal)
  84002 
  84003 	if !(pCtx == uintptr(0)) {
  84004 		goto __35
  84005 	}
  84006 	Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
  84007 __35:
  84008 	;
  84009 	return SQLITE_NOMEM
  84010 }
  84011 
  84012 // Create a new sqlite3_value object, containing the value of pExpr.
  84013 //
  84014 // This only works for very simple expressions that consist of one constant
  84015 // token (i.e. "5", "5.1", "'a string'"). If the expression can
  84016 // be converted directly into a value, then the value is allocated and
  84017 // a pointer written to *ppVal. The caller is responsible for deallocating
  84018 // the value by passing it to sqlite3ValueFree() later on. If the expression
  84019 // cannot be converted to a value, then *ppVal is set to NULL.
  84020 func Xsqlite3ValueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc U8, affinity U8, ppVal uintptr) int32 {
  84021 	if pExpr != 0 {
  84022 		return valueFromExpr(tls, db, pExpr, enc, affinity, ppVal, uintptr(0))
  84023 	}
  84024 	return 0
  84025 }
  84026 
  84027 func stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U8, pAlloc uintptr, ppVal uintptr) int32 {
  84028 	bp := tls.Alloc(8)
  84029 	defer tls.Free(8)
  84030 
  84031 	var rc int32 = SQLITE_OK
  84032 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
  84033 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
  84034 
  84035 	pExpr = Xsqlite3ExprSkipCollate(tls, pExpr)
  84036 
  84037 	if !(pExpr != 0) {
  84038 		*(*uintptr)(unsafe.Pointer(bp)) = valueNew(tls, db, pAlloc)
  84039 		if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
  84040 			Xsqlite3VdbeMemSetNull(tls, *(*uintptr)(unsafe.Pointer(bp)))
  84041 		}
  84042 	} else if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VARIABLE && (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableQPSG) == uint64(0) {
  84043 		var v uintptr
  84044 		var iBindVar int32 = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)
  84045 		Xsqlite3VdbeSetVarmask(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iBindVar)
  84046 		if libc.AssignUintptr(&v, (*Parse)(unsafe.Pointer(pParse)).FpReprepare) != uintptr(0) {
  84047 			*(*uintptr)(unsafe.Pointer(bp)) = valueNew(tls, db, pAlloc)
  84048 			if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
  84049 				rc = Xsqlite3VdbeMemCopy(tls, *(*uintptr)(unsafe.Pointer(bp)), (*Vdbe)(unsafe.Pointer(v)).FaVar+uintptr(iBindVar-1)*56)
  84050 				Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp)), affinity, (*Sqlite3)(unsafe.Pointer(db)).Fenc)
  84051 				(*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fdb = (*Parse)(unsafe.Pointer(pParse)).Fdb
  84052 			}
  84053 		}
  84054 	} else {
  84055 		rc = valueFromExpr(tls, db, pExpr, (*Sqlite3)(unsafe.Pointer(db)).Fenc, affinity, bp, pAlloc)
  84056 	}
  84057 
  84058 	*(*uintptr)(unsafe.Pointer(ppVal)) = *(*uintptr)(unsafe.Pointer(bp))
  84059 	return rc
  84060 }
  84061 
  84062 // This function is used to allocate and populate UnpackedRecord
  84063 // structures intended to be compared against sample index keys stored
  84064 // in the sqlite_stat4 table.
  84065 //
  84066 // A single call to this function populates zero or more fields of the
  84067 // record starting with field iVal (fields are numbered from left to
  84068 // right starting with 0). A single field is populated if:
  84069 //
  84070 //   - (pExpr==0). In this case the value is assumed to be an SQL NULL,
  84071 //
  84072 //   - The expression is a bound variable, and this is a reprepare, or
  84073 //
  84074 //   - The sqlite3ValueFromExpr() function is able to extract a value
  84075 //     from the expression (i.e. the expression is a literal value).
  84076 //
  84077 // Or, if pExpr is a TK_VECTOR, one field is populated for each of the
  84078 // vector components that match either of the two latter criteria listed
  84079 // above.
  84080 //
  84081 // Before any value is appended to the record, the affinity of the
  84082 // corresponding column within index pIdx is applied to it. Before
  84083 // this function returns, output parameter *pnExtract is set to the
  84084 // number of values appended to the record.
  84085 //
  84086 // When this function is called, *ppRec must either point to an object
  84087 // allocated by an earlier call to this function, or must be NULL. If it
  84088 // is NULL and a value can be successfully extracted, a new UnpackedRecord
  84089 // is allocated (and *ppRec set to point to it) before returning.
  84090 //
  84091 // Unless an error is encountered, SQLITE_OK is returned. It is not an
  84092 // error if a value cannot be extracted from pExpr. If an error does
  84093 // occur, an SQLite error code is returned.
  84094 func Xsqlite3Stat4ProbeSetValue(tls *libc.TLS, pParse uintptr, pIdx uintptr, ppRec uintptr, pExpr uintptr, nElem int32, iVal int32, pnExtract uintptr) int32 {
  84095 	bp := tls.Alloc(40)
  84096 	defer tls.Free(40)
  84097 
  84098 	var rc int32 = SQLITE_OK
  84099 	var nExtract int32 = 0
  84100 
  84101 	if pExpr == uintptr(0) || int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_SELECT {
  84102 		var i int32
  84103 
  84104 		(*ValueNewStat4Ctx)(unsafe.Pointer(bp)).FpParse = pParse
  84105 		(*ValueNewStat4Ctx)(unsafe.Pointer(bp)).FpIdx = pIdx
  84106 		(*ValueNewStat4Ctx)(unsafe.Pointer(bp)).FppRec = ppRec
  84107 
  84108 		for i = 0; i < nElem; i++ {
  84109 			*(*uintptr)(unsafe.Pointer(bp + 32)) = uintptr(0)
  84110 			var pElem uintptr = func() uintptr {
  84111 				if pExpr != 0 {
  84112 					return Xsqlite3VectorFieldSubexpr(tls, pExpr, i)
  84113 				}
  84114 				return uintptr(0)
  84115 			}()
  84116 			var aff U8 = U8(Xsqlite3IndexColumnAffinity(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pIdx, iVal+i))
  84117 			(*ValueNewStat4Ctx)(unsafe.Pointer(bp)).FiVal = iVal + i
  84118 			rc = stat4ValueFromExpr(tls, pParse, pElem, aff, bp, bp+32)
  84119 			if !(*(*uintptr)(unsafe.Pointer(bp + 32)) != 0) {
  84120 				break
  84121 			}
  84122 			nExtract++
  84123 		}
  84124 	}
  84125 
  84126 	*(*int32)(unsafe.Pointer(pnExtract)) = nExtract
  84127 	return rc
  84128 }
  84129 
  84130 // Attempt to extract a value from expression pExpr using the methods
  84131 // as described for sqlite3Stat4ProbeSetValue() above.
  84132 //
  84133 // If successful, set *ppVal to point to a new value object and return
  84134 // SQLITE_OK. If no value can be extracted, but no other error occurs
  84135 // (e.g. OOM), return SQLITE_OK and set *ppVal to NULL. Or, if an error
  84136 // does occur, return an SQLite error code. The final value of *ppVal
  84137 // is undefined in this case.
  84138 func Xsqlite3Stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U8, ppVal uintptr) int32 {
  84139 	return stat4ValueFromExpr(tls, pParse, pExpr, affinity, uintptr(0), ppVal)
  84140 }
  84141 
  84142 // Extract the iCol-th column from the nRec-byte record in pRec.  Write
  84143 // the column value into *ppVal.  If *ppVal is initially NULL then a new
  84144 // sqlite3_value object is allocated.
  84145 //
  84146 // If *ppVal is initially NULL then the caller is responsible for
  84147 // ensuring that the value written into *ppVal is eventually freed.
  84148 func Xsqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iCol int32, ppVal uintptr) int32 {
  84149 	bp := tls.Alloc(8)
  84150 	defer tls.Free(8)
  84151 
  84152 	*(*U32)(unsafe.Pointer(bp + 4)) = U32(0)
  84153 
  84154 	var iHdr int32
  84155 	var iField int32
  84156 	var szField int32 = 0
  84157 	var i int32
  84158 	var a uintptr = pRec
  84159 	var pMem uintptr = *(*uintptr)(unsafe.Pointer(ppVal))
  84160 
  84161 	iHdr = int32(func() uint8 {
  84162 		if int32(*(*U8)(unsafe.Pointer(a))) < int32(U8(0x80)) {
  84163 			return uint8(func() int32 { *(*int32)(unsafe.Pointer(bp)) = int32(U32(*(*U8)(unsafe.Pointer(a)))); return 1 }())
  84164 		}
  84165 		return Xsqlite3GetVarint32(tls, a, bp)
  84166 	}())
  84167 	if *(*int32)(unsafe.Pointer(bp)) > nRec || iHdr >= *(*int32)(unsafe.Pointer(bp)) {
  84168 		return Xsqlite3CorruptError(tls, 82274)
  84169 	}
  84170 	iField = *(*int32)(unsafe.Pointer(bp))
  84171 	for i = 0; i <= iCol; i++ {
  84172 		iHdr = iHdr + int32(func() uint8 {
  84173 			if int32(*(*U8)(unsafe.Pointer(a + uintptr(iHdr)))) < int32(U8(0x80)) {
  84174 				return uint8(func() int32 {
  84175 					*(*U32)(unsafe.Pointer(bp + 4)) = U32(*(*U8)(unsafe.Pointer(a + uintptr(iHdr))))
  84176 					return 1
  84177 				}())
  84178 			}
  84179 			return Xsqlite3GetVarint32(tls, a+uintptr(iHdr), bp+4)
  84180 		}())
  84181 
  84182 		if iHdr > *(*int32)(unsafe.Pointer(bp)) {
  84183 			return Xsqlite3CorruptError(tls, 82280)
  84184 		}
  84185 		szField = int32(Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp + 4))))
  84186 		iField = iField + szField
  84187 	}
  84188 
  84189 	if iField > nRec {
  84190 		return Xsqlite3CorruptError(tls, 82286)
  84191 	}
  84192 	if pMem == uintptr(0) {
  84193 		pMem = libc.AssignPtrUintptr(ppVal, Xsqlite3ValueNew(tls, db))
  84194 		if pMem == uintptr(0) {
  84195 			return SQLITE_NOMEM
  84196 		}
  84197 	}
  84198 	Xsqlite3VdbeSerialGet(tls, a+uintptr(iField-szField), *(*U32)(unsafe.Pointer(bp + 4)), pMem)
  84199 	(*Mem)(unsafe.Pointer(pMem)).Fenc = (*Sqlite3)(unsafe.Pointer(db)).Fenc
  84200 	return SQLITE_OK
  84201 }
  84202 
  84203 // Unless it is NULL, the argument must be an UnpackedRecord object returned
  84204 // by an earlier call to sqlite3Stat4ProbeSetValue(). This call deletes
  84205 // the object.
  84206 func Xsqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) {
  84207 	if pRec != 0 {
  84208 		var i int32
  84209 		var nCol int32 = int32((*KeyInfo)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo)).FnAllField)
  84210 		var aMem uintptr = (*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem
  84211 		var db uintptr = (*Mem)(unsafe.Pointer(aMem)).Fdb
  84212 		for i = 0; i < nCol; i++ {
  84213 			Xsqlite3VdbeMemRelease(tls, aMem+uintptr(i)*56)
  84214 		}
  84215 		Xsqlite3KeyInfoUnref(tls, (*UnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo)
  84216 		Xsqlite3DbFreeNN(tls, db, pRec)
  84217 	}
  84218 }
  84219 
  84220 // Change the string value of an sqlite3_value object
  84221 func Xsqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc U8, xDel uintptr) {
  84222 	if v != 0 {
  84223 		Xsqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, xDel)
  84224 	}
  84225 }
  84226 
  84227 // Free an sqlite3_value object
  84228 func Xsqlite3ValueFree(tls *libc.TLS, v uintptr) {
  84229 	if !(v != 0) {
  84230 		return
  84231 	}
  84232 	Xsqlite3VdbeMemRelease(tls, v)
  84233 	Xsqlite3DbFreeNN(tls, (*Mem)(unsafe.Pointer(v)).Fdb, v)
  84234 }
  84235 
  84236 func valueBytes(tls *libc.TLS, pVal uintptr, enc U8) int32 {
  84237 	if valueToText(tls, pVal, enc) != uintptr(0) {
  84238 		return (*Sqlite3_value)(unsafe.Pointer(pVal)).Fn
  84239 	}
  84240 	return 0
  84241 }
  84242 
  84243 func Xsqlite3ValueBytes(tls *libc.TLS, pVal uintptr, enc U8) int32 {
  84244 	var p uintptr = pVal
  84245 
  84246 	if int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_Str != 0 && int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fenc) == int32(enc) {
  84247 		return (*Mem)(unsafe.Pointer(p)).Fn
  84248 	}
  84249 	if int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_Str != 0 && int32(enc) != SQLITE_UTF8 && int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fenc) != SQLITE_UTF8 {
  84250 		return (*Mem)(unsafe.Pointer(p)).Fn
  84251 	}
  84252 	if int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_Blob != 0 {
  84253 		if int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_Zero != 0 {
  84254 			return (*Mem)(unsafe.Pointer(p)).Fn + *(*int32)(unsafe.Pointer(p))
  84255 		} else {
  84256 			return (*Mem)(unsafe.Pointer(p)).Fn
  84257 		}
  84258 	}
  84259 	if int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_Null != 0 {
  84260 		return 0
  84261 	}
  84262 	return valueBytes(tls, pVal, enc)
  84263 }
  84264 
  84265 // Create a new virtual database engine.
  84266 func Xsqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) uintptr {
  84267 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
  84268 	var p uintptr
  84269 	p = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(Vdbe{})))
  84270 	if p == uintptr(0) {
  84271 		return uintptr(0)
  84272 	}
  84273 	libc.Xmemset(tls, p+136, 0, uint64(unsafe.Sizeof(Vdbe{}))-uint64(uintptr(0)+136))
  84274 	(*Vdbe)(unsafe.Pointer(p)).Fdb = db
  84275 	if (*Sqlite3)(unsafe.Pointer(db)).FpVdbe != 0 {
  84276 		(*Vdbe1)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 16
  84277 	}
  84278 	(*Vdbe)(unsafe.Pointer(p)).FpVNext = (*Sqlite3)(unsafe.Pointer(db)).FpVdbe
  84279 	(*Vdbe)(unsafe.Pointer(p)).FppVPrev = db + 8
  84280 	(*Sqlite3)(unsafe.Pointer(db)).FpVdbe = p
  84281 
  84282 	(*Vdbe)(unsafe.Pointer(p)).FpParse = pParse
  84283 	(*Parse)(unsafe.Pointer(pParse)).FpVdbe = p
  84284 
  84285 	Xsqlite3VdbeAddOp2(tls, p, OP_Init, 0, 1)
  84286 	return p
  84287 }
  84288 
  84289 // Return the Parse object that owns a Vdbe object.
  84290 func Xsqlite3VdbeParser(tls *libc.TLS, p uintptr) uintptr {
  84291 	return (*Vdbe)(unsafe.Pointer(p)).FpParse
  84292 }
  84293 
  84294 // Change the error string stored in Vdbe.zErrMsg
  84295 func Xsqlite3VdbeError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) {
  84296 	var ap Va_list
  84297 	_ = ap
  84298 	Xsqlite3DbFree(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg)
  84299 	ap = va
  84300 	(*Vdbe)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3VMPrintf(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, zFormat, ap)
  84301 	_ = ap
  84302 }
  84303 
  84304 // Remember the SQL string for a prepared statement.
  84305 func Xsqlite3VdbeSetSql(tls *libc.TLS, p uintptr, z uintptr, n int32, prepFlags U8) {
  84306 	if p == uintptr(0) {
  84307 		return
  84308 	}
  84309 	(*Vdbe)(unsafe.Pointer(p)).FprepFlags = prepFlags
  84310 	if int32(prepFlags)&SQLITE_PREPARE_SAVESQL == 0 {
  84311 		(*Vdbe)(unsafe.Pointer(p)).Fexpmask = U32(0)
  84312 	}
  84313 
  84314 	(*Vdbe)(unsafe.Pointer(p)).FzSql = Xsqlite3DbStrNDup(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, z, uint64(n))
  84315 }
  84316 
  84317 // Swap byte-code between two VDBE structures.
  84318 //
  84319 // This happens after pB was previously run and returned
  84320 // SQLITE_SCHEMA.  The statement was then reprepared in pA.
  84321 // This routine transfers the new bytecode in pA over to pB
  84322 // so that pB can be run again.  The old pB byte code is
  84323 // moved back to pA so that it will be cleaned up when pA is
  84324 // finalized.
  84325 func Xsqlite3VdbeSwap(tls *libc.TLS, pA uintptr, pB uintptr) {
  84326 	var tmp Vdbe
  84327 	var pTmp uintptr
  84328 	var ppTmp uintptr
  84329 	var zTmp uintptr
  84330 
  84331 	tmp = *(*Vdbe)(unsafe.Pointer(pA))
  84332 	*(*Vdbe)(unsafe.Pointer(pA)) = *(*Vdbe)(unsafe.Pointer(pB))
  84333 	*(*Vdbe)(unsafe.Pointer(pB)) = tmp
  84334 	pTmp = (*Vdbe)(unsafe.Pointer(pA)).FpVNext
  84335 	(*Vdbe)(unsafe.Pointer(pA)).FpVNext = (*Vdbe)(unsafe.Pointer(pB)).FpVNext
  84336 	(*Vdbe)(unsafe.Pointer(pB)).FpVNext = pTmp
  84337 	ppTmp = (*Vdbe)(unsafe.Pointer(pA)).FppVPrev
  84338 	(*Vdbe)(unsafe.Pointer(pA)).FppVPrev = (*Vdbe)(unsafe.Pointer(pB)).FppVPrev
  84339 	(*Vdbe)(unsafe.Pointer(pB)).FppVPrev = ppTmp
  84340 	zTmp = (*Vdbe)(unsafe.Pointer(pA)).FzSql
  84341 	(*Vdbe)(unsafe.Pointer(pA)).FzSql = (*Vdbe)(unsafe.Pointer(pB)).FzSql
  84342 	(*Vdbe)(unsafe.Pointer(pB)).FzSql = zTmp
  84343 	(*Vdbe)(unsafe.Pointer(pB)).Fexpmask = (*Vdbe)(unsafe.Pointer(pA)).Fexpmask
  84344 	(*Vdbe)(unsafe.Pointer(pB)).FprepFlags = (*Vdbe)(unsafe.Pointer(pA)).FprepFlags
  84345 	libc.Xmemcpy(tls, pB+212, pA+212, uint64(unsafe.Sizeof([9]U32{})))
  84346 	*(*U32)(unsafe.Pointer(pB + 212 + 5*4))++
  84347 }
  84348 
  84349 func growOpArray(tls *libc.TLS, v uintptr, nOp int32) int32 {
  84350 	var pNew uintptr
  84351 	var p uintptr = (*Vdbe)(unsafe.Pointer(v)).FpParse
  84352 
  84353 	var nNew Sqlite3_int64 = func() int64 {
  84354 		if (*Vdbe)(unsafe.Pointer(v)).FnOpAlloc != 0 {
  84355 			return int64(2) * Sqlite3_int64((*Vdbe)(unsafe.Pointer(v)).FnOpAlloc)
  84356 		}
  84357 		return int64(uint64(1024) / uint64(unsafe.Sizeof(Op{})))
  84358 	}()
  84359 	_ = nOp
  84360 
  84361 	if nNew > Sqlite3_int64(*(*int32)(unsafe.Pointer((*Parse)(unsafe.Pointer(p)).Fdb + 136 + 5*4))) {
  84362 		Xsqlite3OomFault(tls, (*Parse)(unsafe.Pointer(p)).Fdb)
  84363 		return SQLITE_NOMEM
  84364 	}
  84365 
  84366 	pNew = Xsqlite3DbRealloc(tls, (*Parse)(unsafe.Pointer(p)).Fdb, (*Vdbe)(unsafe.Pointer(v)).FaOp, uint64(nNew)*uint64(unsafe.Sizeof(Op{})))
  84367 	if pNew != 0 {
  84368 		(*Parse)(unsafe.Pointer(p)).FszOpAlloc = Xsqlite3DbMallocSize(tls, (*Parse)(unsafe.Pointer(p)).Fdb, pNew)
  84369 		(*Vdbe)(unsafe.Pointer(v)).FnOpAlloc = int32(uint64((*Parse)(unsafe.Pointer(p)).FszOpAlloc) / uint64(unsafe.Sizeof(Op{})))
  84370 		(*Vdbe)(unsafe.Pointer(v)).FaOp = pNew
  84371 	}
  84372 	return func() int32 {
  84373 		if pNew != 0 {
  84374 			return SQLITE_OK
  84375 		}
  84376 		return SQLITE_NOMEM
  84377 	}()
  84378 }
  84379 
  84380 func growOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) int32 {
  84381 	if growOpArray(tls, p, 1) != 0 {
  84382 		return 1
  84383 	}
  84384 
  84385 	return Xsqlite3VdbeAddOp3(tls, p, op, p1, p2, p3)
  84386 }
  84387 
  84388 func Xsqlite3VdbeAddOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) int32 {
  84389 	var i int32
  84390 	var pOp uintptr
  84391 
  84392 	i = (*Vdbe)(unsafe.Pointer(p)).FnOp
  84393 
  84394 	if (*Vdbe)(unsafe.Pointer(p)).FnOpAlloc <= i {
  84395 		return growOp3(tls, p, op, p1, p2, p3)
  84396 	}
  84397 
  84398 	(*Vdbe)(unsafe.Pointer(p)).FnOp++
  84399 	pOp = (*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(i)*24
  84400 
  84401 	(*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(op)
  84402 	(*VdbeOp)(unsafe.Pointer(pOp)).Fp5 = U16(0)
  84403 	(*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = p1
  84404 	(*VdbeOp)(unsafe.Pointer(pOp)).Fp2 = p2
  84405 	(*VdbeOp)(unsafe.Pointer(pOp)).Fp3 = p3
  84406 	*(*uintptr)(unsafe.Pointer(pOp + 16)) = uintptr(0)
  84407 	(*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(P4_NOTUSED)
  84408 	return i
  84409 }
  84410 
  84411 func Xsqlite3VdbeAddOp0(tls *libc.TLS, p uintptr, op int32) int32 {
  84412 	return Xsqlite3VdbeAddOp3(tls, p, op, 0, 0, 0)
  84413 }
  84414 
  84415 func Xsqlite3VdbeAddOp1(tls *libc.TLS, p uintptr, op int32, p1 int32) int32 {
  84416 	return Xsqlite3VdbeAddOp3(tls, p, op, p1, 0, 0)
  84417 }
  84418 
  84419 func Xsqlite3VdbeAddOp2(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32) int32 {
  84420 	return Xsqlite3VdbeAddOp3(tls, p, op, p1, p2, 0)
  84421 }
  84422 
  84423 // Generate code for an unconditional jump to instruction iDest
  84424 func Xsqlite3VdbeGoto(tls *libc.TLS, p uintptr, iDest int32) int32 {
  84425 	return Xsqlite3VdbeAddOp3(tls, p, OP_Goto, 0, iDest, 0)
  84426 }
  84427 
  84428 // Generate code to cause the string zStr to be loaded into
  84429 // register iDest
  84430 func Xsqlite3VdbeLoadString(tls *libc.TLS, p uintptr, iDest int32, zStr uintptr) int32 {
  84431 	return Xsqlite3VdbeAddOp4(tls, p, OP_String8, 0, iDest, 0, zStr, 0)
  84432 }
  84433 
  84434 // Generate code that initializes multiple registers to string or integer
  84435 // constants.  The registers begin with iDest and increase consecutively.
  84436 // One register is initialized for each characgter in zTypes[].  For each
  84437 // "s" character in zTypes[], the register is a string if the argument is
  84438 // not NULL, or OP_Null if the value is a null pointer.  For each "i" character
  84439 // in zTypes[], the register is initialized to an integer.
  84440 //
  84441 // If the input string does not end with "X" then an OP_ResultRow instruction
  84442 // is generated for the values inserted.
  84443 func Xsqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr, va uintptr) {
  84444 	var ap Va_list
  84445 	_ = ap
  84446 	var i int32
  84447 	var c int8
  84448 	var z uintptr
  84449 	ap = va
  84450 	i = 0
  84451 __1:
  84452 	if !(int32(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer(zTypes + uintptr(i))))) != 0) {
  84453 		goto __3
  84454 	}
  84455 	if !(int32(c) == 's') {
  84456 		goto __4
  84457 	}
  84458 	z = libc.VaUintptr(&ap)
  84459 	Xsqlite3VdbeAddOp4(tls, p, func() int32 {
  84460 		if z == uintptr(0) {
  84461 			return OP_Null
  84462 		}
  84463 		return OP_String8
  84464 	}(), 0, iDest+i, 0, z, 0)
  84465 	goto __5
  84466 __4:
  84467 	if !(int32(c) == 'i') {
  84468 		goto __6
  84469 	}
  84470 	Xsqlite3VdbeAddOp2(tls, p, OP_Integer, libc.VaInt32(&ap), iDest+i)
  84471 	goto __7
  84472 __6:
  84473 	goto skip_op_resultrow
  84474 __7:
  84475 	;
  84476 __5:
  84477 	;
  84478 	goto __2
  84479 __2:
  84480 	i++
  84481 	goto __1
  84482 	goto __3
  84483 __3:
  84484 	;
  84485 	Xsqlite3VdbeAddOp2(tls, p, OP_ResultRow, iDest, i)
  84486 skip_op_resultrow:
  84487 	_ = ap
  84488 }
  84489 
  84490 // Add an opcode that includes the p4 value as a pointer.
  84491 func Xsqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, zP4 uintptr, p4type int32) int32 {
  84492 	var addr int32 = Xsqlite3VdbeAddOp3(tls, p, op, p1, p2, p3)
  84493 	Xsqlite3VdbeChangeP4(tls, p, addr, zP4, p4type)
  84494 	return addr
  84495 }
  84496 
  84497 // Add an OP_Function or OP_PureFunc opcode.
  84498 //
  84499 // The eCallCtx argument is information (typically taken from Expr.op2)
  84500 // that describes the calling context of the function.  0 means a general
  84501 // function call.  NC_IsCheck means called by a check constraint,
  84502 // NC_IdxExpr means called as part of an index expression.  NC_PartIdx
  84503 // means in the WHERE clause of a partial index.  NC_GenCol means called
  84504 // while computing a generated column value.  0 is the usual case.
  84505 func Xsqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) int32 {
  84506 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
  84507 	var nByte int32
  84508 	var addr int32
  84509 	var pCtx uintptr
  84510 
  84511 	nByte = int32(uint64(unsafe.Sizeof(Sqlite3_context{})) + uint64(nArg-1)*uint64(unsafe.Sizeof(uintptr(0))))
  84512 	pCtx = Xsqlite3DbMallocRawNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(nByte))
  84513 	if pCtx == uintptr(0) {
  84514 		freeEphemeralFunction(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pFunc)
  84515 		return 0
  84516 	}
  84517 	(*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut = uintptr(0)
  84518 	(*Sqlite3_context)(unsafe.Pointer(pCtx)).FpFunc = pFunc
  84519 	(*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe = uintptr(0)
  84520 	(*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = 0
  84521 	(*Sqlite3_context)(unsafe.Pointer(pCtx)).Fargc = U8(nArg)
  84522 	(*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp = Xsqlite3VdbeCurrentAddr(tls, v)
  84523 	addr = Xsqlite3VdbeAddOp4(tls, v, func() int32 {
  84524 		if eCallCtx != 0 {
  84525 			return OP_PureFunc
  84526 		}
  84527 		return OP_Function
  84528 	}(),
  84529 		p1, p2, p3, pCtx, -15)
  84530 	Xsqlite3VdbeChangeP5(tls, v, uint16(eCallCtx&NC_SelfRef))
  84531 	Xsqlite3MayAbort(tls, pParse)
  84532 	return addr
  84533 }
  84534 
  84535 // Add an opcode that includes the p4 value with a P4_INT64 or
  84536 // P4_REAL type.
  84537 func Xsqlite3VdbeAddOp4Dup8(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, zP4 uintptr, p4type int32) int32 {
  84538 	var p4copy uintptr = Xsqlite3DbMallocRawNN(tls, Xsqlite3VdbeDb(tls, p), uint64(8))
  84539 	if p4copy != 0 {
  84540 		libc.Xmemcpy(tls, p4copy, zP4, uint64(8))
  84541 	}
  84542 	return Xsqlite3VdbeAddOp4(tls, p, op, p1, p2, p3, p4copy, p4type)
  84543 }
  84544 
  84545 // Return the address of the current EXPLAIN QUERY PLAN baseline.
  84546 // 0 means "none".
  84547 func Xsqlite3VdbeExplainParent(tls *libc.TLS, pParse uintptr) int32 {
  84548 	var pOp uintptr
  84549 	if (*Parse)(unsafe.Pointer(pParse)).FaddrExplain == 0 {
  84550 		return 0
  84551 	}
  84552 	pOp = Xsqlite3VdbeGetOp(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, (*Parse)(unsafe.Pointer(pParse)).FaddrExplain)
  84553 	return (*VdbeOp)(unsafe.Pointer(pOp)).Fp2
  84554 }
  84555 
  84556 // Add a new OP_Explain opcode.
  84557 //
  84558 // If the bPush flag is true, then make this opcode the parent for
  84559 // subsequent Explains until sqlite3VdbeExplainPop() is called.
  84560 func Xsqlite3VdbeExplain(tls *libc.TLS, pParse uintptr, bPush U8, zFmt uintptr, va uintptr) int32 {
  84561 	var addr int32 = 0
  84562 
  84563 	if int32((*Parse)(unsafe.Pointer(pParse)).Fexplain) == 2 {
  84564 		var zMsg uintptr
  84565 		var v uintptr
  84566 		var ap Va_list
  84567 		_ = ap
  84568 		var iThis int32
  84569 		ap = va
  84570 		zMsg = Xsqlite3VMPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, zFmt, ap)
  84571 		_ = ap
  84572 		v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
  84573 		iThis = (*Vdbe)(unsafe.Pointer(v)).FnOp
  84574 		addr = Xsqlite3VdbeAddOp4(tls, v, OP_Explain, iThis, (*Parse)(unsafe.Pointer(pParse)).FaddrExplain, 0,
  84575 			zMsg, -6)
  84576 
  84577 		if bPush != 0 {
  84578 			(*Parse)(unsafe.Pointer(pParse)).FaddrExplain = iThis
  84579 		}
  84580 
  84581 	}
  84582 	return addr
  84583 }
  84584 
  84585 // Pop the EXPLAIN QUERY PLAN stack one level.
  84586 func Xsqlite3VdbeExplainPop(tls *libc.TLS, pParse uintptr) {
  84587 	(*Parse)(unsafe.Pointer(pParse)).FaddrExplain = Xsqlite3VdbeExplainParent(tls, pParse)
  84588 }
  84589 
  84590 // Add an OP_ParseSchema opcode.  This routine is broken out from
  84591 // sqlite3VdbeAddOp4() since it needs to also needs to mark all btrees
  84592 // as having been used.
  84593 //
  84594 // The zWhere string must have been obtained from sqlite3_malloc().
  84595 // This routine will take ownership of the allocated memory.
  84596 func Xsqlite3VdbeAddParseSchemaOp(tls *libc.TLS, p uintptr, iDb int32, zWhere uintptr, p5 U16) {
  84597 	var j int32
  84598 	Xsqlite3VdbeAddOp4(tls, p, OP_ParseSchema, iDb, 0, 0, zWhere, -6)
  84599 	Xsqlite3VdbeChangeP5(tls, p, p5)
  84600 	for j = 0; j < (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FnDb; j++ {
  84601 		Xsqlite3VdbeUsesBtree(tls, p, j)
  84602 	}
  84603 	Xsqlite3MayAbort(tls, (*Vdbe)(unsafe.Pointer(p)).FpParse)
  84604 }
  84605 
  84606 // Add an opcode that includes the p4 value as an integer.
  84607 func Xsqlite3VdbeAddOp4Int(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, p4 int32) int32 {
  84608 	var addr int32 = Xsqlite3VdbeAddOp3(tls, p, op, p1, p2, p3)
  84609 	if int32((*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed) == 0 {
  84610 		var pOp uintptr = (*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*24
  84611 		(*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-3)
  84612 		*(*int32)(unsafe.Pointer(pOp + 16)) = p4
  84613 	}
  84614 	return addr
  84615 }
  84616 
  84617 // Insert the end of a co-routine
  84618 func Xsqlite3VdbeEndCoroutine(tls *libc.TLS, v uintptr, regYield int32) {
  84619 	Xsqlite3VdbeAddOp1(tls, v, OP_EndCoroutine, regYield)
  84620 
  84621 	(*Parse)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FpParse)).FnTempReg = U8(0)
  84622 	(*Parse)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FpParse)).FnRangeReg = 0
  84623 }
  84624 
  84625 // Create a new symbolic label for an instruction that has yet to be
  84626 // coded.  The symbolic label is really just a negative number.  The
  84627 // label can be used as the P2 value of an operation.  Later, when
  84628 // the label is resolved to a specific address, the VDBE will scan
  84629 // through its operation list and change all values of P2 which match
  84630 // the label into the resolved address.
  84631 //
  84632 // The VDBE knows that a P2 value is a label because labels are
  84633 // always negative and P2 values are suppose to be non-negative.
  84634 // Hence, a negative P2 value is a label that has yet to be resolved.
  84635 // (Later:) This is only true for opcodes that have the OPFLG_JUMP
  84636 // property.
  84637 //
  84638 // Variable usage notes:
  84639 //
  84640 //	Parse.aLabel[x]     Stores the address that the x-th label resolves
  84641 //	                    into.  For testing (SQLITE_DEBUG), unresolved
  84642 //	                    labels stores -1, but that is not required.
  84643 //	Parse.nLabelAlloc   Number of slots allocated to Parse.aLabel[]
  84644 //	Parse.nLabel        The *negative* of the number of labels that have
  84645 //	                    been issued.  The negative is stored because
  84646 //	                    that gives a performance improvement over storing
  84647 //	                    the equivalent positive value.
  84648 func Xsqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) int32 {
  84649 	return libc.PreDecInt32(&(*Parse)(unsafe.Pointer(pParse)).FnLabel, 1)
  84650 }
  84651 
  84652 func resizeResolveLabel(tls *libc.TLS, p uintptr, v uintptr, j int32) {
  84653 	var nNewSize int32 = 10 - (*Parse)(unsafe.Pointer(p)).FnLabel
  84654 	(*Parse)(unsafe.Pointer(p)).FaLabel = Xsqlite3DbReallocOrFree(tls, (*Parse)(unsafe.Pointer(p)).Fdb, (*Parse)(unsafe.Pointer(p)).FaLabel,
  84655 		uint64(nNewSize)*uint64(unsafe.Sizeof(int32(0))))
  84656 	if (*Parse)(unsafe.Pointer(p)).FaLabel == uintptr(0) {
  84657 		(*Parse)(unsafe.Pointer(p)).FnLabelAlloc = 0
  84658 	} else {
  84659 		if nNewSize >= 100 && nNewSize/100 > (*Parse)(unsafe.Pointer(p)).FnLabelAlloc/100 {
  84660 			Xsqlite3ProgressCheck(tls, p)
  84661 		}
  84662 		(*Parse)(unsafe.Pointer(p)).FnLabelAlloc = nNewSize
  84663 		*(*int32)(unsafe.Pointer((*Parse)(unsafe.Pointer(p)).FaLabel + uintptr(j)*4)) = (*Vdbe)(unsafe.Pointer(v)).FnOp
  84664 	}
  84665 }
  84666 
  84667 func Xsqlite3VdbeResolveLabel(tls *libc.TLS, v uintptr, x int32) {
  84668 	var p uintptr = (*Vdbe)(unsafe.Pointer(v)).FpParse
  84669 	var j int32 = ^x
  84670 
  84671 	if (*Parse)(unsafe.Pointer(p)).FnLabelAlloc+(*Parse)(unsafe.Pointer(p)).FnLabel < 0 {
  84672 		resizeResolveLabel(tls, p, v, j)
  84673 	} else {
  84674 		*(*int32)(unsafe.Pointer((*Parse)(unsafe.Pointer(p)).FaLabel + uintptr(j)*4)) = (*Vdbe)(unsafe.Pointer(v)).FnOp
  84675 	}
  84676 }
  84677 
  84678 // Mark the VDBE as one that can only be run one time.
  84679 func Xsqlite3VdbeRunOnlyOnce(tls *libc.TLS, p uintptr) {
  84680 	Xsqlite3VdbeAddOp2(tls, p, OP_Expire, 1, 1)
  84681 }
  84682 
  84683 // Mark the VDBE as one that can be run multiple times.
  84684 func Xsqlite3VdbeReusable(tls *libc.TLS, p uintptr) {
  84685 	var i int32
  84686 	for i = 1; i < (*Vdbe)(unsafe.Pointer(p)).FnOp; i++ {
  84687 		if int32((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr(i)*24)).Fopcode) == OP_Expire {
  84688 			(*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp + 1*24)).Fopcode = U8(OP_Noop)
  84689 			break
  84690 		}
  84691 	}
  84692 }
  84693 
  84694 func resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) {
  84695 	var nMaxArgs int32
  84696 	var pOp uintptr
  84697 	var pParse uintptr
  84698 	var aLabel uintptr
  84699 	var n int32
  84700 	nMaxArgs = *(*int32)(unsafe.Pointer(pMaxFuncArgs))
  84701 	pParse = (*Vdbe)(unsafe.Pointer(p)).FpParse
  84702 	aLabel = (*Parse)(unsafe.Pointer(pParse)).FaLabel
  84703 	libc.SetBitFieldPtr8Uint32(p+200, Bft(1), 6, 0x40)
  84704 	libc.SetBitFieldPtr8Uint32(p+200, Bft(0), 7, 0x80)
  84705 	pOp = (*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr((*Vdbe)(unsafe.Pointer(p)).FnOp-1)*24
  84706 
  84707 __1:
  84708 	if !(1 != 0) {
  84709 		goto __2
  84710 	}
  84711 
  84712 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) <= SQLITE_MX_JUMP_OPCODE) {
  84713 		goto __3
  84714 	}
  84715 
  84716 	switch int32((*Op)(unsafe.Pointer(pOp)).Fopcode) {
  84717 	case OP_Transaction:
  84718 		goto __5
  84719 	case OP_AutoCommit:
  84720 		goto __6
  84721 	case OP_Savepoint:
  84722 		goto __7
  84723 	case OP_Checkpoint:
  84724 		goto __8
  84725 	case OP_Vacuum:
  84726 		goto __9
  84727 	case OP_JournalMode:
  84728 		goto __10
  84729 	case OP_Init:
  84730 		goto __11
  84731 	case OP_VUpdate:
  84732 		goto __12
  84733 	case OP_VFilter:
  84734 		goto __13
  84735 	default:
  84736 		goto __14
  84737 	}
  84738 	goto __4
  84739 __5:
  84740 	if !((*Op)(unsafe.Pointer(pOp)).Fp2 != 0) {
  84741 		goto __15
  84742 	}
  84743 	libc.SetBitFieldPtr8Uint32(p+200, Bft(0), 6, 0x40)
  84744 __15:
  84745 	;
  84746 __6:
  84747 __7:
  84748 	libc.SetBitFieldPtr8Uint32(p+200, Bft(1), 7, 0x80)
  84749 	goto __4
  84750 
  84751 __8:
  84752 __9:
  84753 __10:
  84754 	libc.SetBitFieldPtr8Uint32(p+200, Bft(0), 6, 0x40)
  84755 	libc.SetBitFieldPtr8Uint32(p+200, Bft(1), 7, 0x80)
  84756 	goto __4
  84757 
  84758 __11:
  84759 	;
  84760 	goto resolve_p2_values_loop_exit
  84761 
  84762 __12:
  84763 	if !((*Op)(unsafe.Pointer(pOp)).Fp2 > nMaxArgs) {
  84764 		goto __16
  84765 	}
  84766 	nMaxArgs = (*Op)(unsafe.Pointer(pOp)).Fp2
  84767 __16:
  84768 	;
  84769 	goto __4
  84770 
  84771 __13:
  84772 	;
  84773 	n = (*Op)(unsafe.Pointer(pOp + libc.UintptrFromInt32(-1)*24)).Fp1
  84774 	if !(n > nMaxArgs) {
  84775 		goto __17
  84776 	}
  84777 	nMaxArgs = n
  84778 __17:
  84779 	;
  84780 __14:
  84781 	if !((*Op)(unsafe.Pointer(pOp)).Fp2 < 0) {
  84782 		goto __18
  84783 	}
  84784 
  84785 	(*Op)(unsafe.Pointer(pOp)).Fp2 = *(*int32)(unsafe.Pointer(aLabel + uintptr(^(*Op)(unsafe.Pointer(pOp)).Fp2)*4))
  84786 __18:
  84787 	;
  84788 	goto __4
  84789 
  84790 __4:
  84791 	;
  84792 __3:
  84793 	;
  84794 	pOp -= 24
  84795 	goto __1
  84796 __2:
  84797 	;
  84798 resolve_p2_values_loop_exit:
  84799 	if !(aLabel != 0) {
  84800 		goto __19
  84801 	}
  84802 	Xsqlite3DbNNFreeNN(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, (*Parse)(unsafe.Pointer(pParse)).FaLabel)
  84803 	(*Parse)(unsafe.Pointer(pParse)).FaLabel = uintptr(0)
  84804 __19:
  84805 	;
  84806 	(*Parse)(unsafe.Pointer(pParse)).FnLabel = 0
  84807 	*(*int32)(unsafe.Pointer(pMaxFuncArgs)) = nMaxArgs
  84808 
  84809 }
  84810 
  84811 // Return the address of the next instruction to be inserted.
  84812 func Xsqlite3VdbeCurrentAddr(tls *libc.TLS, p uintptr) int32 {
  84813 	return (*Vdbe)(unsafe.Pointer(p)).FnOp
  84814 }
  84815 
  84816 // This function returns a pointer to the array of opcodes associated with
  84817 // the Vdbe passed as the first argument. It is the callers responsibility
  84818 // to arrange for the returned array to be eventually freed using the
  84819 // vdbeFreeOpArray() function.
  84820 //
  84821 // Before returning, *pnOp is set to the number of entries in the returned
  84822 // array. Also, *pnMaxArg is set to the larger of its current value and
  84823 // the number of entries in the Vdbe.apArg[] array required to execute the
  84824 // returned program.
  84825 func Xsqlite3VdbeTakeOpArray(tls *libc.TLS, p uintptr, pnOp uintptr, pnMaxArg uintptr) uintptr {
  84826 	var aOp uintptr = (*Vdbe)(unsafe.Pointer(p)).FaOp
  84827 
  84828 	resolveP2Values(tls, p, pnMaxArg)
  84829 	*(*int32)(unsafe.Pointer(pnOp)) = (*Vdbe)(unsafe.Pointer(p)).FnOp
  84830 	(*Vdbe)(unsafe.Pointer(p)).FaOp = uintptr(0)
  84831 	return aOp
  84832 }
  84833 
  84834 // Add a whole list of operations to the operation stack.  Return a
  84835 // pointer to the first operation inserted.
  84836 //
  84837 // Non-zero P2 arguments to jump instructions are automatically adjusted
  84838 // so that the jump target is relative to the first operation inserted.
  84839 func Xsqlite3VdbeAddOpList(tls *libc.TLS, p uintptr, nOp int32, aOp uintptr, iLineno int32) uintptr {
  84840 	var i int32
  84841 	var pOut uintptr
  84842 	var pFirst uintptr
  84843 
  84844 	if (*Vdbe)(unsafe.Pointer(p)).FnOp+nOp > (*Vdbe)(unsafe.Pointer(p)).FnOpAlloc && growOpArray(tls, p, nOp) != 0 {
  84845 		return uintptr(0)
  84846 	}
  84847 	pFirst = libc.AssignUintptr(&pOut, (*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr((*Vdbe)(unsafe.Pointer(p)).FnOp)*24)
  84848 	i = 0
  84849 __1:
  84850 	if !(i < nOp) {
  84851 		goto __3
  84852 	}
  84853 	{
  84854 		(*VdbeOp)(unsafe.Pointer(pOut)).Fopcode = (*VdbeOpList)(unsafe.Pointer(aOp)).Fopcode
  84855 		(*VdbeOp)(unsafe.Pointer(pOut)).Fp1 = int32((*VdbeOpList)(unsafe.Pointer(aOp)).Fp1)
  84856 		(*VdbeOp)(unsafe.Pointer(pOut)).Fp2 = int32((*VdbeOpList)(unsafe.Pointer(aOp)).Fp2)
  84857 
  84858 		if int32(Xsqlite3OpcodeProperty[(*VdbeOpList)(unsafe.Pointer(aOp)).Fopcode])&OPFLG_JUMP != 0 && int32((*VdbeOpList)(unsafe.Pointer(aOp)).Fp2) > 0 {
  84859 			*(*int32)(unsafe.Pointer(pOut + 8)) += (*Vdbe)(unsafe.Pointer(p)).FnOp
  84860 		}
  84861 		(*VdbeOp)(unsafe.Pointer(pOut)).Fp3 = int32((*VdbeOpList)(unsafe.Pointer(aOp)).Fp3)
  84862 		(*VdbeOp)(unsafe.Pointer(pOut)).Fp4type = int8(P4_NOTUSED)
  84863 		*(*uintptr)(unsafe.Pointer(pOut + 16)) = uintptr(0)
  84864 		(*VdbeOp)(unsafe.Pointer(pOut)).Fp5 = U16(0)
  84865 		_ = iLineno
  84866 
  84867 	}
  84868 	goto __2
  84869 __2:
  84870 	i++
  84871 	aOp += 4
  84872 	pOut += 24
  84873 	goto __1
  84874 	goto __3
  84875 __3:
  84876 	;
  84877 	*(*int32)(unsafe.Pointer(p + 144)) += nOp
  84878 	return pFirst
  84879 }
  84880 
  84881 // Change the value of the opcode, or P1, P2, P3, or P5 operands
  84882 // for a specific instruction.
  84883 func Xsqlite3VdbeChangeOpcode(tls *libc.TLS, p uintptr, addr int32, iNewOpcode U8) {
  84884 	(*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, p, addr))).Fopcode = iNewOpcode
  84885 }
  84886 
  84887 func Xsqlite3VdbeChangeP1(tls *libc.TLS, p uintptr, addr int32, val int32) {
  84888 	(*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, p, addr))).Fp1 = val
  84889 }
  84890 
  84891 func Xsqlite3VdbeChangeP2(tls *libc.TLS, p uintptr, addr int32, val int32) {
  84892 	(*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, p, addr))).Fp2 = val
  84893 }
  84894 
  84895 func Xsqlite3VdbeChangeP3(tls *libc.TLS, p uintptr, addr int32, val int32) {
  84896 	(*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, p, addr))).Fp3 = val
  84897 }
  84898 
  84899 func Xsqlite3VdbeChangeP5(tls *libc.TLS, p uintptr, p5 U16) {
  84900 	if (*Vdbe)(unsafe.Pointer(p)).FnOp > 0 {
  84901 		(*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr((*Vdbe)(unsafe.Pointer(p)).FnOp-1)*24)).Fp5 = p5
  84902 	}
  84903 }
  84904 
  84905 // If the previous opcode is an OP_Column that delivers results
  84906 // into register iDest, then add the OPFLAG_TYPEOFARG flag to that
  84907 // opcode.
  84908 func Xsqlite3VdbeTypeofColumn(tls *libc.TLS, p uintptr, iDest int32) {
  84909 	var pOp uintptr = Xsqlite3VdbeGetLastOp(tls, p)
  84910 	if (*VdbeOp)(unsafe.Pointer(pOp)).Fp3 == iDest && int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Column {
  84911 		*(*U16)(unsafe.Pointer(pOp + 2)) |= U16(OPFLAG_TYPEOFARG)
  84912 	}
  84913 }
  84914 
  84915 // Change the P2 operand of instruction addr so that it points to
  84916 // the address of the next instruction to be coded.
  84917 func Xsqlite3VdbeJumpHere(tls *libc.TLS, p uintptr, addr int32) {
  84918 	Xsqlite3VdbeChangeP2(tls, p, addr, (*Vdbe)(unsafe.Pointer(p)).FnOp)
  84919 }
  84920 
  84921 // Change the P2 operand of the jump instruction at addr so that
  84922 // the jump lands on the next opcode.  Or if the jump instruction was
  84923 // the previous opcode (and is thus a no-op) then simply back up
  84924 // the next instruction counter by one slot so that the jump is
  84925 // overwritten by the next inserted opcode.
  84926 //
  84927 // This routine is an optimization of sqlite3VdbeJumpHere() that
  84928 // strives to omit useless byte-code like this:
  84929 //
  84930 //	7   Once 0 8 0
  84931 //	8   ...
  84932 func Xsqlite3VdbeJumpHereOrPopInst(tls *libc.TLS, p uintptr, addr int32) {
  84933 	if addr == (*Vdbe)(unsafe.Pointer(p)).FnOp-1 {
  84934 		(*Vdbe)(unsafe.Pointer(p)).FnOp--
  84935 	} else {
  84936 		Xsqlite3VdbeChangeP2(tls, p, addr, (*Vdbe)(unsafe.Pointer(p)).FnOp)
  84937 	}
  84938 }
  84939 
  84940 func freeEphemeralFunction(tls *libc.TLS, db uintptr, pDef uintptr) {
  84941 	if (*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_EPHEM) != U32(0) {
  84942 		Xsqlite3DbNNFreeNN(tls, db, pDef)
  84943 	}
  84944 }
  84945 
  84946 func freeP4Mem(tls *libc.TLS, db uintptr, p uintptr) {
  84947 	if (*Mem)(unsafe.Pointer(p)).FszMalloc != 0 {
  84948 		Xsqlite3DbFree(tls, db, (*Mem)(unsafe.Pointer(p)).FzMalloc)
  84949 	}
  84950 	Xsqlite3DbNNFreeNN(tls, db, p)
  84951 }
  84952 
  84953 func freeP4FuncCtx(tls *libc.TLS, db uintptr, p uintptr) {
  84954 	freeEphemeralFunction(tls, db, (*Sqlite3_context)(unsafe.Pointer(p)).FpFunc)
  84955 	Xsqlite3DbNNFreeNN(tls, db, p)
  84956 }
  84957 
  84958 func freeP4(tls *libc.TLS, db uintptr, p4type int32, p4 uintptr) {
  84959 	switch p4type {
  84960 	case -15:
  84961 		{
  84962 			freeP4FuncCtx(tls, db, p4)
  84963 			break
  84964 
  84965 		}
  84966 	case -12:
  84967 		fallthrough
  84968 	case -13:
  84969 		fallthrough
  84970 	case -6:
  84971 		fallthrough
  84972 	case -14:
  84973 		{
  84974 			if p4 != 0 {
  84975 				Xsqlite3DbNNFreeNN(tls, db, p4)
  84976 			}
  84977 			break
  84978 
  84979 		}
  84980 	case -8:
  84981 		{
  84982 			if (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0) {
  84983 				Xsqlite3KeyInfoUnref(tls, p4)
  84984 			}
  84985 			break
  84986 
  84987 		}
  84988 	case -7:
  84989 		{
  84990 			freeEphemeralFunction(tls, db, p4)
  84991 			break
  84992 
  84993 		}
  84994 	case -10:
  84995 		{
  84996 			if (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0) {
  84997 				Xsqlite3ValueFree(tls, p4)
  84998 			} else {
  84999 				freeP4Mem(tls, db, p4)
  85000 			}
  85001 			break
  85002 
  85003 		}
  85004 	case -11:
  85005 		{
  85006 			if (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0) {
  85007 				Xsqlite3VtabUnlock(tls, p4)
  85008 			}
  85009 			break
  85010 
  85011 		}
  85012 	}
  85013 }
  85014 
  85015 func vdbeFreeOpArray(tls *libc.TLS, db uintptr, aOp uintptr, nOp int32) {
  85016 	if aOp != 0 {
  85017 		var pOp uintptr = aOp + uintptr(nOp-1)*24
  85018 		for 1 != 0 {
  85019 			if int32((*Op)(unsafe.Pointer(pOp)).Fp4type) <= -6 {
  85020 				freeP4(tls, db, int32((*Op)(unsafe.Pointer(pOp)).Fp4type), *(*uintptr)(unsafe.Pointer(pOp + 16)))
  85021 			}
  85022 			if pOp == aOp {
  85023 				break
  85024 			}
  85025 			pOp -= 24
  85026 		}
  85027 		Xsqlite3DbNNFreeNN(tls, db, aOp)
  85028 	}
  85029 }
  85030 
  85031 // Link the SubProgram object passed as the second argument into the linked
  85032 // list at Vdbe.pSubProgram. This list is used to delete all sub-program
  85033 // objects when the VM is no longer required.
  85034 func Xsqlite3VdbeLinkSubProgram(tls *libc.TLS, pVdbe uintptr, p uintptr) {
  85035 	(*SubProgram)(unsafe.Pointer(p)).FpNext = (*Vdbe)(unsafe.Pointer(pVdbe)).FpProgram
  85036 	(*Vdbe)(unsafe.Pointer(pVdbe)).FpProgram = p
  85037 }
  85038 
  85039 // Return true if the given Vdbe has any SubPrograms.
  85040 func Xsqlite3VdbeHasSubProgram(tls *libc.TLS, pVdbe uintptr) int32 {
  85041 	return libc.Bool32((*Vdbe)(unsafe.Pointer(pVdbe)).FpProgram != uintptr(0))
  85042 }
  85043 
  85044 // Change the opcode at addr into OP_Noop
  85045 func Xsqlite3VdbeChangeToNoop(tls *libc.TLS, p uintptr, addr int32) int32 {
  85046 	var pOp uintptr
  85047 	if (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed != 0 {
  85048 		return 0
  85049 	}
  85050 
  85051 	pOp = (*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*24
  85052 	freeP4(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp4type), *(*uintptr)(unsafe.Pointer(pOp + 16)))
  85053 	(*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(P4_NOTUSED)
  85054 	*(*uintptr)(unsafe.Pointer(pOp + 16)) = uintptr(0)
  85055 	(*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Noop)
  85056 	return 1
  85057 }
  85058 
  85059 // If the last opcode is "op" and it is not a jump destination,
  85060 // then remove it.  Return true if and only if an opcode was removed.
  85061 func Xsqlite3VdbeDeletePriorOpcode(tls *libc.TLS, p uintptr, op U8) int32 {
  85062 	if (*Vdbe)(unsafe.Pointer(p)).FnOp > 0 && int32((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr((*Vdbe)(unsafe.Pointer(p)).FnOp-1)*24)).Fopcode) == int32(op) {
  85063 		return Xsqlite3VdbeChangeToNoop(tls, p, (*Vdbe)(unsafe.Pointer(p)).FnOp-1)
  85064 	} else {
  85065 		return 0
  85066 	}
  85067 	return int32(0)
  85068 }
  85069 
  85070 func vdbeChangeP4Full(tls *libc.TLS, p uintptr, pOp uintptr, zP4 uintptr, n int32) {
  85071 	if (*Op)(unsafe.Pointer(pOp)).Fp4type != 0 {
  85072 		freeP4(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, int32((*Op)(unsafe.Pointer(pOp)).Fp4type), *(*uintptr)(unsafe.Pointer(pOp + 16)))
  85073 		(*Op)(unsafe.Pointer(pOp)).Fp4type = int8(0)
  85074 		*(*uintptr)(unsafe.Pointer(pOp + 16)) = uintptr(0)
  85075 	}
  85076 	if n < 0 {
  85077 		Xsqlite3VdbeChangeP4(tls, p, int32((int64(pOp)-int64((*Vdbe)(unsafe.Pointer(p)).FaOp))/24), zP4, n)
  85078 	} else {
  85079 		if n == 0 {
  85080 			n = Xsqlite3Strlen30(tls, zP4)
  85081 		}
  85082 		*(*uintptr)(unsafe.Pointer(pOp + 16)) = Xsqlite3DbStrNDup(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, zP4, uint64(n))
  85083 		(*Op)(unsafe.Pointer(pOp)).Fp4type = int8(-6)
  85084 	}
  85085 }
  85086 
  85087 func Xsqlite3VdbeChangeP4(tls *libc.TLS, p uintptr, addr int32, zP4 uintptr, n int32) {
  85088 	bp := tls.Alloc(8)
  85089 	defer tls.Free(8)
  85090 	*(*uintptr)(unsafe.Pointer(bp)) = zP4
  85091 
  85092 	var pOp uintptr
  85093 	var db uintptr
  85094 
  85095 	db = (*Vdbe)(unsafe.Pointer(p)).Fdb
  85096 
  85097 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
  85098 		if n != -11 {
  85099 			freeP4(tls, db, n, *(*uintptr)(unsafe.Pointer(bp)))
  85100 		}
  85101 		return
  85102 	}
  85103 
  85104 	if addr < 0 {
  85105 		addr = (*Vdbe)(unsafe.Pointer(p)).FnOp - 1
  85106 	}
  85107 	pOp = (*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*24
  85108 	if n >= 0 || (*Op)(unsafe.Pointer(pOp)).Fp4type != 0 {
  85109 		vdbeChangeP4Full(tls, p, pOp, *(*uintptr)(unsafe.Pointer(bp)), n)
  85110 		return
  85111 	}
  85112 	if n == -3 {
  85113 		*(*int32)(unsafe.Pointer(pOp + 16)) = int32(*(*uintptr)(unsafe.Pointer(bp)))
  85114 		(*Op)(unsafe.Pointer(pOp)).Fp4type = int8(-3)
  85115 	} else if *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
  85116 		*(*uintptr)(unsafe.Pointer(pOp + 16)) = *(*uintptr)(unsafe.Pointer(bp))
  85117 		(*Op)(unsafe.Pointer(pOp)).Fp4type = int8(n)
  85118 		if n == -11 {
  85119 			Xsqlite3VtabLock(tls, *(*uintptr)(unsafe.Pointer(bp)))
  85120 		}
  85121 	}
  85122 }
  85123 
  85124 // Change the P4 operand of the most recently coded instruction
  85125 // to the value defined by the arguments.  This is a high-speed
  85126 // version of sqlite3VdbeChangeP4().
  85127 //
  85128 // The P4 operand must not have been previously defined.  And the new
  85129 // P4 must not be P4_INT32.  Use sqlite3VdbeChangeP4() in either of
  85130 // those cases.
  85131 func Xsqlite3VdbeAppendP4(tls *libc.TLS, p uintptr, pP4 uintptr, n int32) {
  85132 	var pOp uintptr
  85133 
  85134 	if (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed != 0 {
  85135 		freeP4(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, n, pP4)
  85136 	} else {
  85137 		pOp = (*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr((*Vdbe)(unsafe.Pointer(p)).FnOp-1)*24
  85138 
  85139 		(*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(n)
  85140 		*(*uintptr)(unsafe.Pointer(pOp + 16)) = pP4
  85141 	}
  85142 }
  85143 
  85144 // Set the P4 on the most recently added opcode to the KeyInfo for the
  85145 // index given.
  85146 func Xsqlite3VdbeSetP4KeyInfo(tls *libc.TLS, pParse uintptr, pIdx uintptr) {
  85147 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
  85148 	var pKeyInfo uintptr
  85149 
  85150 	pKeyInfo = Xsqlite3KeyInfoOfIndex(tls, pParse, pIdx)
  85151 	if pKeyInfo != 0 {
  85152 		Xsqlite3VdbeAppendP4(tls, v, pKeyInfo, -8)
  85153 	}
  85154 }
  85155 
  85156 // Return the opcode for a given address.  The address must be non-negative.
  85157 // See sqlite3VdbeGetLastOp() to get the most recently added opcode.
  85158 //
  85159 // If a memory allocation error has occurred prior to the calling of this
  85160 // routine, then a pointer to a dummy VdbeOp will be returned.  That opcode
  85161 // is readable but not writable, though it is cast to a writable value.
  85162 // The return of a dummy opcode allows the call to continue functioning
  85163 // after an OOM fault without having to check to see if the return from
  85164 // this routine is a valid pointer.  But because the dummy.opcode is 0,
  85165 // dummy will never be written to.  This is verified by code inspection and
  85166 // by running with Valgrind.
  85167 func Xsqlite3VdbeGetOp(tls *libc.TLS, p uintptr, addr int32) uintptr {
  85168 	if (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed != 0 {
  85169 		return uintptr(unsafe.Pointer(&dummy))
  85170 	} else {
  85171 		return (*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*24
  85172 	}
  85173 	return uintptr(0)
  85174 }
  85175 
  85176 var dummy VdbeOp
  85177 
  85178 // Return the most recently added opcode
  85179 func Xsqlite3VdbeGetLastOp(tls *libc.TLS, p uintptr) uintptr {
  85180 	return Xsqlite3VdbeGetOp(tls, p, (*Vdbe)(unsafe.Pointer(p)).FnOp-1)
  85181 }
  85182 
  85183 // Compute a string that describes the P4 parameter for an opcode.
  85184 // Use zTemp for any required temporary buffer space.
  85185 func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr {
  85186 	bp := tls.Alloc(176)
  85187 	defer tls.Free(176)
  85188 
  85189 	var zP4 uintptr = uintptr(0)
  85190 
  85191 	Xsqlite3StrAccumInit(tls, bp+144, uintptr(0), uintptr(0), 0, SQLITE_MAX_LENGTH)
  85192 	switch int32((*Op)(unsafe.Pointer(pOp)).Fp4type) {
  85193 	case -8:
  85194 		{
  85195 			var j int32
  85196 			var pKeyInfo uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16))
  85197 
  85198 			Xsqlite3_str_appendf(tls, bp+144, ts+6291, libc.VaList(bp, int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)))
  85199 			for j = 0; j < int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField); j++ {
  85200 				var pColl uintptr = *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(j)*8))
  85201 				var zColl uintptr
  85202 				if pColl != 0 {
  85203 					zColl = (*CollSeq)(unsafe.Pointer(pColl)).FzName
  85204 				} else {
  85205 					zColl = ts + 1544
  85206 				}
  85207 				if libc.Xstrcmp(tls, zColl, ts+1089) == 0 {
  85208 					zColl = ts + 6296
  85209 				}
  85210 				Xsqlite3_str_appendf(tls, bp+144, ts+6298,
  85211 					libc.VaList(bp+8, func() uintptr {
  85212 						if int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&KEYINFO_ORDER_DESC != 0 {
  85213 							return ts + 6284
  85214 						}
  85215 						return ts + 1544
  85216 					}(),
  85217 						func() uintptr {
  85218 							if int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&KEYINFO_ORDER_BIGNULL != 0 {
  85219 								return ts + 6306
  85220 							}
  85221 							return ts + 1544
  85222 						}(),
  85223 						zColl))
  85224 			}
  85225 			Xsqlite3_str_append(tls, bp+144, ts+6309, 1)
  85226 			break
  85227 
  85228 		}
  85229 	case -2:
  85230 		{
  85231 			var pColl uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16))
  85232 
  85233 			Xsqlite3_str_appendf(tls, bp+144, ts+6311, libc.VaList(bp+32, (*CollSeq)(unsafe.Pointer(pColl)).FzName,
  85234 				encnames[(*CollSeq)(unsafe.Pointer(pColl)).Fenc]))
  85235 			break
  85236 
  85237 		}
  85238 	case -7:
  85239 		{
  85240 			var pDef uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16))
  85241 			Xsqlite3_str_appendf(tls, bp+144, ts+6320, libc.VaList(bp+48, (*FuncDef)(unsafe.Pointer(pDef)).FzName, int32((*FuncDef)(unsafe.Pointer(pDef)).FnArg)))
  85242 			break
  85243 
  85244 		}
  85245 	case -15:
  85246 		{
  85247 			var pDef uintptr = (*Sqlite3_context)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpFunc
  85248 			Xsqlite3_str_appendf(tls, bp+144, ts+6320, libc.VaList(bp+64, (*FuncDef)(unsafe.Pointer(pDef)).FzName, int32((*FuncDef)(unsafe.Pointer(pDef)).FnArg)))
  85249 			break
  85250 
  85251 		}
  85252 	case -13:
  85253 		{
  85254 			Xsqlite3_str_appendf(tls, bp+144, ts+1324, libc.VaList(bp+80, *(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16))))))
  85255 			break
  85256 
  85257 		}
  85258 	case -3:
  85259 		{
  85260 			Xsqlite3_str_appendf(tls, bp+144, ts+6327, libc.VaList(bp+88, *(*int32)(unsafe.Pointer(pOp + 16))))
  85261 			break
  85262 
  85263 		}
  85264 	case -12:
  85265 		{
  85266 			Xsqlite3_str_appendf(tls, bp+144, ts+1318, libc.VaList(bp+96, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16))))))
  85267 			break
  85268 
  85269 		}
  85270 	case -10:
  85271 		{
  85272 			var pMem uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16))
  85273 			if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Str != 0 {
  85274 				zP4 = (*Mem)(unsafe.Pointer(pMem)).Fz
  85275 			} else if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_Int|MEM_IntReal) != 0 {
  85276 				Xsqlite3_str_appendf(tls, bp+144, ts+1324, libc.VaList(bp+104, *(*I64)(unsafe.Pointer(pMem))))
  85277 			} else if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Real != 0 {
  85278 				Xsqlite3_str_appendf(tls, bp+144, ts+1318, libc.VaList(bp+112, *(*float64)(unsafe.Pointer(pMem))))
  85279 			} else if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Null != 0 {
  85280 				zP4 = ts + 1545
  85281 			} else {
  85282 				zP4 = ts + 6330
  85283 			}
  85284 			break
  85285 
  85286 		}
  85287 	case -11:
  85288 		{
  85289 			var pVtab uintptr = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab
  85290 			Xsqlite3_str_appendf(tls, bp+144, ts+6337, libc.VaList(bp+120, pVtab))
  85291 			break
  85292 
  85293 		}
  85294 	case -14:
  85295 		{
  85296 			var i U32
  85297 			var ai uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16))
  85298 			var n U32 = *(*U32)(unsafe.Pointer(ai))
  85299 
  85300 			for i = U32(1); i <= n; i++ {
  85301 				Xsqlite3_str_appendf(tls, bp+144, ts+6345, libc.VaList(bp+128, func() int32 {
  85302 					if i == U32(1) {
  85303 						return '['
  85304 					}
  85305 					return ','
  85306 				}(), *(*U32)(unsafe.Pointer(ai + uintptr(i)*4))))
  85307 			}
  85308 			Xsqlite3_str_append(tls, bp+144, ts+6350, 1)
  85309 			break
  85310 
  85311 		}
  85312 	case -4:
  85313 		{
  85314 			zP4 = ts + 6352
  85315 			break
  85316 
  85317 		}
  85318 	case -5:
  85319 		{
  85320 			zP4 = (*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FzName
  85321 			break
  85322 
  85323 		}
  85324 	default:
  85325 		{
  85326 			zP4 = *(*uintptr)(unsafe.Pointer(pOp + 16))
  85327 
  85328 		}
  85329 	}
  85330 	if zP4 != 0 {
  85331 		Xsqlite3_str_appendall(tls, bp+144, zP4)
  85332 	}
  85333 	if int32((*StrAccum)(unsafe.Pointer(bp+144)).FaccError)&SQLITE_NOMEM != 0 {
  85334 		Xsqlite3OomFault(tls, db)
  85335 	}
  85336 	return Xsqlite3StrAccumFinish(tls, bp+144)
  85337 }
  85338 
  85339 var encnames = [4]uintptr{ts + 6360, ts + 6362, ts + 6364, ts + 6369}
  85340 
  85341 // Declare to the Vdbe that the BTree object at db->aDb[i] is used.
  85342 //
  85343 // The prepared statements need to know in advance the complete set of
  85344 // attached databases that will be use.  A mask of these databases
  85345 // is maintained in p->btreeMask.  The p->lockMask value is the subset of
  85346 // p->btreeMask of databases that will require a lock.
  85347 func Xsqlite3VdbeUsesBtree(tls *libc.TLS, p uintptr, i int32) {
  85348 	*(*YDbMask)(unsafe.Pointer(p + 204)) |= YDbMask(1) << i
  85349 	if i != 1 && Xsqlite3BtreeSharable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FaDb+uintptr(i)*32)).FpBt) != 0 {
  85350 		*(*YDbMask)(unsafe.Pointer(p + 208)) |= YDbMask(1) << i
  85351 	}
  85352 }
  85353 
  85354 // If SQLite is compiled to support shared-cache mode and to be threadsafe,
  85355 // this routine obtains the mutex associated with each BtShared structure
  85356 // that may be accessed by the VM passed as an argument. In doing so it also
  85357 // sets the BtShared.db member of each of the BtShared structures, ensuring
  85358 // that the correct busy-handler callback is invoked if required.
  85359 //
  85360 // If SQLite is not threadsafe but does support shared-cache mode, then
  85361 // sqlite3BtreeEnter() is invoked to set the BtShared.db variables
  85362 // of all of BtShared structures accessible via the database handle
  85363 // associated with the VM.
  85364 //
  85365 // If SQLite is not threadsafe and does not support shared-cache mode, this
  85366 // function is a no-op.
  85367 //
  85368 // The p->btreeMask field is a bitmask of all btrees that the prepared
  85369 // statement p will ever use.  Let N be the number of bits in p->btreeMask
  85370 // corresponding to btrees that use shared cache.  Then the runtime of
  85371 // this routine is N*N.  But as N is rarely more than 1, this should not
  85372 // be a problem.
  85373 func Xsqlite3VdbeEnter(tls *libc.TLS, p uintptr) {
  85374 	var i int32
  85375 	var db uintptr
  85376 	var aDb uintptr
  85377 	var nDb int32
  85378 	if (*Vdbe)(unsafe.Pointer(p)).FlockMask == YDbMask(0) {
  85379 		return
  85380 	}
  85381 	db = (*Vdbe)(unsafe.Pointer(p)).Fdb
  85382 	aDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb
  85383 	nDb = (*Sqlite3)(unsafe.Pointer(db)).FnDb
  85384 	for i = 0; i < nDb; i++ {
  85385 		if i != 1 && (*Vdbe)(unsafe.Pointer(p)).FlockMask&(YDbMask(1)<<i) != YDbMask(0) && (*Db)(unsafe.Pointer(aDb+uintptr(i)*32)).FpBt != uintptr(0) {
  85386 			Xsqlite3BtreeEnter(tls, (*Db)(unsafe.Pointer(aDb+uintptr(i)*32)).FpBt)
  85387 		}
  85388 	}
  85389 }
  85390 
  85391 func vdbeLeave(tls *libc.TLS, p uintptr) {
  85392 	var i int32
  85393 	var db uintptr
  85394 	var aDb uintptr
  85395 	var nDb int32
  85396 	db = (*Vdbe)(unsafe.Pointer(p)).Fdb
  85397 	aDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb
  85398 	nDb = (*Sqlite3)(unsafe.Pointer(db)).FnDb
  85399 	for i = 0; i < nDb; i++ {
  85400 		if i != 1 && (*Vdbe)(unsafe.Pointer(p)).FlockMask&(YDbMask(1)<<i) != YDbMask(0) && (*Db)(unsafe.Pointer(aDb+uintptr(i)*32)).FpBt != uintptr(0) {
  85401 			Xsqlite3BtreeLeave(tls, (*Db)(unsafe.Pointer(aDb+uintptr(i)*32)).FpBt)
  85402 		}
  85403 	}
  85404 }
  85405 
  85406 func Xsqlite3VdbeLeave(tls *libc.TLS, p uintptr) {
  85407 	if (*Vdbe)(unsafe.Pointer(p)).FlockMask == YDbMask(0) {
  85408 		return
  85409 	}
  85410 	vdbeLeave(tls, p)
  85411 }
  85412 
  85413 func initMemArray(tls *libc.TLS, p uintptr, N int32, db uintptr, flags U16) {
  85414 	if N > 0 {
  85415 		for __ccgo := true; __ccgo; __ccgo = libc.PreDecInt32(&N, 1) > 0 {
  85416 			(*Mem)(unsafe.Pointer(p)).Fflags = flags
  85417 			(*Mem)(unsafe.Pointer(p)).Fdb = db
  85418 			(*Mem)(unsafe.Pointer(p)).FszMalloc = 0
  85419 			p += 56
  85420 		}
  85421 	}
  85422 }
  85423 
  85424 func releaseMemArray(tls *libc.TLS, p uintptr, N int32) {
  85425 	if p != 0 && N != 0 {
  85426 		var pEnd uintptr = p + uintptr(N)*56
  85427 		var db uintptr = (*Mem)(unsafe.Pointer(p)).Fdb
  85428 		if (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed != 0 {
  85429 			for __ccgo := true; __ccgo; __ccgo = libc.PreIncUintptr(&p, 56) < pEnd {
  85430 				if (*Mem)(unsafe.Pointer(p)).FszMalloc != 0 {
  85431 					Xsqlite3DbFree(tls, db, (*Mem)(unsafe.Pointer(p)).FzMalloc)
  85432 				}
  85433 			}
  85434 			return
  85435 		}
  85436 		for __ccgo1 := true; __ccgo1; __ccgo1 = libc.PreIncUintptr(&p, 56) < pEnd {
  85437 			if int32((*Mem)(unsafe.Pointer(p)).Fflags)&(MEM_Agg|MEM_Dyn) != 0 {
  85438 				Xsqlite3VdbeMemRelease(tls, p)
  85439 				(*Mem)(unsafe.Pointer(p)).Fflags = U16(MEM_Undefined)
  85440 			} else if (*Mem)(unsafe.Pointer(p)).FszMalloc != 0 {
  85441 				Xsqlite3DbNNFreeNN(tls, db, (*Mem)(unsafe.Pointer(p)).FzMalloc)
  85442 				(*Mem)(unsafe.Pointer(p)).FszMalloc = 0
  85443 				(*Mem)(unsafe.Pointer(p)).Fflags = U16(MEM_Undefined)
  85444 			}
  85445 		}
  85446 	}
  85447 }
  85448 
  85449 // This is a destructor on a Mem object (which is really an sqlite3_value)
  85450 // that deletes the Frame object that is attached to it as a blob.
  85451 //
  85452 // This routine does not delete the Frame right away.  It merely adds the
  85453 // frame to a list of frames to be deleted when the Vdbe halts.
  85454 func Xsqlite3VdbeFrameMemDel(tls *libc.TLS, pArg uintptr) {
  85455 	var pFrame uintptr = pArg
  85456 
  85457 	(*VdbeFrame)(unsafe.Pointer(pFrame)).FpParent = (*Vdbe)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer(pFrame)).Fv)).FpDelFrame
  85458 	(*Vdbe)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer(pFrame)).Fv)).FpDelFrame = pFrame
  85459 }
  85460 
  85461 // Locate the next opcode to be displayed in EXPLAIN or EXPLAIN
  85462 // QUERY PLAN output.
  85463 //
  85464 // Return SQLITE_ROW on success.  Return SQLITE_DONE if there are no
  85465 // more opcodes to be displayed.
  85466 func Xsqlite3VdbeNextOpcode(tls *libc.TLS, p uintptr, pSub uintptr, eMode int32, piPc uintptr, piAddr uintptr, paOp uintptr) int32 {
  85467 	var nRow int32
  85468 	var nSub int32 = 0
  85469 	var apSub uintptr = uintptr(0)
  85470 	var i int32
  85471 	var rc int32 = SQLITE_OK
  85472 	var aOp uintptr = uintptr(0)
  85473 	var iPc int32
  85474 
  85475 	nRow = (*Vdbe)(unsafe.Pointer(p)).FnOp
  85476 	if pSub != uintptr(0) {
  85477 		if int32((*Mem)(unsafe.Pointer(pSub)).Fflags)&MEM_Blob != 0 {
  85478 			nSub = int32(uint64((*Mem)(unsafe.Pointer(pSub)).Fn) / uint64(unsafe.Sizeof(uintptr(0))))
  85479 			apSub = (*Mem)(unsafe.Pointer(pSub)).Fz
  85480 		}
  85481 		for i = 0; i < nSub; i++ {
  85482 			nRow = nRow + (*SubProgram)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(apSub + uintptr(i)*8)))).FnOp
  85483 		}
  85484 	}
  85485 	iPc = *(*int32)(unsafe.Pointer(piPc))
  85486 	for 1 != 0 {
  85487 		i = libc.PostIncInt32(&iPc, 1)
  85488 		if i >= nRow {
  85489 			(*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_OK
  85490 			rc = SQLITE_DONE
  85491 			break
  85492 		}
  85493 		if i < (*Vdbe)(unsafe.Pointer(p)).FnOp {
  85494 			aOp = (*Vdbe)(unsafe.Pointer(p)).FaOp
  85495 		} else {
  85496 			var j int32
  85497 			i = i - (*Vdbe)(unsafe.Pointer(p)).FnOp
  85498 
  85499 			for j = 0; i >= (*SubProgram)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(apSub + uintptr(j)*8)))).FnOp; j++ {
  85500 				i = i - (*SubProgram)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(apSub + uintptr(j)*8)))).FnOp
  85501 
  85502 			}
  85503 			aOp = (*SubProgram)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(apSub + uintptr(j)*8)))).FaOp
  85504 		}
  85505 
  85506 		if pSub != uintptr(0) && int32((*Op)(unsafe.Pointer(aOp+uintptr(i)*24)).Fp4type) == -4 {
  85507 			var nByte int32 = int32(uint64(nSub+1) * uint64(unsafe.Sizeof(uintptr(0))))
  85508 			var j int32
  85509 			for j = 0; j < nSub; j++ {
  85510 				if *(*uintptr)(unsafe.Pointer(apSub + uintptr(j)*8)) == *(*uintptr)(unsafe.Pointer(aOp + uintptr(i)*24 + 16)) {
  85511 					break
  85512 				}
  85513 			}
  85514 			if j == nSub {
  85515 				(*Vdbe)(unsafe.Pointer(p)).Frc = Xsqlite3VdbeMemGrow(tls, pSub, nByte, libc.Bool32(nSub != 0))
  85516 				if (*Vdbe)(unsafe.Pointer(p)).Frc != SQLITE_OK {
  85517 					rc = SQLITE_ERROR
  85518 					break
  85519 				}
  85520 				apSub = (*Mem)(unsafe.Pointer(pSub)).Fz
  85521 				*(*uintptr)(unsafe.Pointer(apSub + uintptr(libc.PostIncInt32(&nSub, 1))*8)) = *(*uintptr)(unsafe.Pointer(aOp + uintptr(i)*24 + 16))
  85522 				(*Mem)(unsafe.Pointer(pSub)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pSub)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Blob)
  85523 				(*Mem)(unsafe.Pointer(pSub)).Fn = int32(uint64(nSub) * uint64(unsafe.Sizeof(uintptr(0))))
  85524 				nRow = nRow + (*SubProgram)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aOp + uintptr(i)*24 + 16)))).FnOp
  85525 			}
  85526 		}
  85527 		if eMode == 0 {
  85528 			break
  85529 		}
  85530 		{
  85531 			if int32((*Op)(unsafe.Pointer(aOp+uintptr(i)*24)).Fopcode) == OP_Explain {
  85532 				break
  85533 			}
  85534 			if int32((*Op)(unsafe.Pointer(aOp+uintptr(i)*24)).Fopcode) == OP_Init && iPc > 1 {
  85535 				break
  85536 			}
  85537 
  85538 		}
  85539 	}
  85540 	*(*int32)(unsafe.Pointer(piPc)) = iPc
  85541 	*(*int32)(unsafe.Pointer(piAddr)) = i
  85542 	*(*uintptr)(unsafe.Pointer(paOp)) = aOp
  85543 	return rc
  85544 }
  85545 
  85546 // Delete a VdbeFrame object and its contents. VdbeFrame objects are
  85547 // allocated by the OP_Program opcode in sqlite3VdbeExec().
  85548 func Xsqlite3VdbeFrameDelete(tls *libc.TLS, p uintptr) {
  85549 	var i int32
  85550 	var aMem uintptr = p + 112
  85551 	var apCsr uintptr = aMem + uintptr((*VdbeFrame)(unsafe.Pointer(p)).FnChildMem)*56
  85552 
  85553 	for i = 0; i < (*VdbeFrame)(unsafe.Pointer(p)).FnChildCsr; i++ {
  85554 		if *(*uintptr)(unsafe.Pointer(apCsr + uintptr(i)*8)) != 0 {
  85555 			Xsqlite3VdbeFreeCursorNN(tls, (*VdbeFrame)(unsafe.Pointer(p)).Fv, *(*uintptr)(unsafe.Pointer(apCsr + uintptr(i)*8)))
  85556 		}
  85557 	}
  85558 	releaseMemArray(tls, aMem, (*VdbeFrame)(unsafe.Pointer(p)).FnChildMem)
  85559 	Xsqlite3VdbeDeleteAuxData(tls, (*Vdbe)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer(p)).Fv)).Fdb, p+64, -1, 0)
  85560 	Xsqlite3DbFree(tls, (*Vdbe)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer(p)).Fv)).Fdb, p)
  85561 }
  85562 
  85563 // Give a listing of the program in the virtual machine.
  85564 //
  85565 // The interface is the same as sqlite3VdbeExec().  But instead of
  85566 // running the code, it invokes the callback once for each instruction.
  85567 // This feature is used to implement "EXPLAIN".
  85568 //
  85569 // When p->explain==1, each instruction is listed.  When
  85570 // p->explain==2, only OP_Explain instructions are listed and these
  85571 // are shown in a different format.  p->explain==2 is used to implement
  85572 // EXPLAIN QUERY PLAN.
  85573 // 2018-04-24:  In p->explain==2 mode, the OP_Init opcodes of triggers
  85574 // are also shown, so that the boundaries between the main program and
  85575 // each trigger are clear.
  85576 //
  85577 // When p->explain==1, first the main program is listed, then each of
  85578 // the trigger subprograms are listed one by one.
  85579 func Xsqlite3VdbeList(tls *libc.TLS, p uintptr) int32 {
  85580 	bp := tls.Alloc(16)
  85581 	defer tls.Free(16)
  85582 
  85583 	var pSub uintptr = uintptr(0)
  85584 	var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb
  85585 
  85586 	var rc int32 = SQLITE_OK
  85587 	var pMem uintptr = (*Vdbe)(unsafe.Pointer(p)).FaMem + 1*56
  85588 	var bListSubprogs int32 = libc.Bool32(int32(*(*uint8)(unsafe.Pointer(p + 200))&0xc>>2) == 1 || (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_TriggerEQP) != uint64(0))
  85589 
  85590 	var pOp uintptr
  85591 
  85592 	releaseMemArray(tls, pMem, 8)
  85593 
  85594 	if (*Vdbe)(unsafe.Pointer(p)).Frc == SQLITE_NOMEM {
  85595 		Xsqlite3OomFault(tls, db)
  85596 		return SQLITE_ERROR
  85597 	}
  85598 
  85599 	if bListSubprogs != 0 {
  85600 		pSub = (*Vdbe)(unsafe.Pointer(p)).FaMem + 9*56
  85601 	} else {
  85602 		pSub = uintptr(0)
  85603 	}
  85604 
  85605 	rc = Xsqlite3VdbeNextOpcode(tls, p, pSub, libc.Bool32(int32(*(*uint8)(unsafe.Pointer(p + 200))&0xc>>2) == 2), p+48, bp, bp+8)
  85606 
  85607 	if rc == SQLITE_OK {
  85608 		pOp = *(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(*(*int32)(unsafe.Pointer(bp)))*24
  85609 		if libc.AtomicLoadNInt32(db+432, 0) != 0 {
  85610 			(*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_INTERRUPT
  85611 			rc = SQLITE_ERROR
  85612 			Xsqlite3VdbeError(tls, p, Xsqlite3ErrStr(tls, (*Vdbe)(unsafe.Pointer(p)).Frc), 0)
  85613 		} else {
  85614 			var zP4 uintptr = Xsqlite3VdbeDisplayP4(tls, db, pOp)
  85615 			if int32(*(*uint8)(unsafe.Pointer(p + 200))&0xc>>2) == 2 {
  85616 				Xsqlite3VdbeMemSetInt64(tls, pMem, int64((*Op)(unsafe.Pointer(pOp)).Fp1))
  85617 				Xsqlite3VdbeMemSetInt64(tls, pMem+uintptr(1)*56, int64((*Op)(unsafe.Pointer(pOp)).Fp2))
  85618 				Xsqlite3VdbeMemSetInt64(tls, pMem+uintptr(2)*56, int64((*Op)(unsafe.Pointer(pOp)).Fp3))
  85619 				Xsqlite3VdbeMemSetStr(tls, pMem+uintptr(3)*56, zP4, int64(-1), uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
  85620 				(*Vdbe)(unsafe.Pointer(p)).FnResColumn = U16(4)
  85621 			} else {
  85622 				Xsqlite3VdbeMemSetInt64(tls, pMem+uintptr(0)*56, int64(*(*int32)(unsafe.Pointer(bp))))
  85623 				Xsqlite3VdbeMemSetStr(tls, pMem+uintptr(1)*56, Xsqlite3OpcodeName(tls, int32((*Op)(unsafe.Pointer(pOp)).Fopcode)),
  85624 					int64(-1), uint8(SQLITE_UTF8), uintptr(0))
  85625 				Xsqlite3VdbeMemSetInt64(tls, pMem+uintptr(2)*56, int64((*Op)(unsafe.Pointer(pOp)).Fp1))
  85626 				Xsqlite3VdbeMemSetInt64(tls, pMem+uintptr(3)*56, int64((*Op)(unsafe.Pointer(pOp)).Fp2))
  85627 				Xsqlite3VdbeMemSetInt64(tls, pMem+uintptr(4)*56, int64((*Op)(unsafe.Pointer(pOp)).Fp3))
  85628 
  85629 				Xsqlite3VdbeMemSetInt64(tls, pMem+uintptr(6)*56, int64((*Op)(unsafe.Pointer(pOp)).Fp5))
  85630 				Xsqlite3VdbeMemSetNull(tls, pMem+uintptr(7)*56)
  85631 				Xsqlite3VdbeMemSetStr(tls, pMem+uintptr(5)*56, zP4, int64(-1), uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
  85632 				(*Vdbe)(unsafe.Pointer(p)).FnResColumn = U16(8)
  85633 			}
  85634 			(*Vdbe)(unsafe.Pointer(p)).FpResultRow = pMem
  85635 			if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
  85636 				(*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
  85637 				rc = SQLITE_ERROR
  85638 			} else {
  85639 				(*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_OK
  85640 				rc = SQLITE_ROW
  85641 			}
  85642 		}
  85643 	}
  85644 	return rc
  85645 }
  85646 
  85647 // An instance of this object describes bulk memory available for use
  85648 // by subcomponents of a prepared statement.  Space is allocated out
  85649 // of a ReusableSpace object by the allocSpace() routine below.
  85650 type ReusableSpace = struct {
  85651 	FpSpace  uintptr
  85652 	FnFree   Sqlite3_int64
  85653 	FnNeeded Sqlite3_int64
  85654 }
  85655 
  85656 func allocSpace(tls *libc.TLS, p uintptr, pBuf uintptr, nByte Sqlite3_int64) uintptr {
  85657 	if pBuf == uintptr(0) {
  85658 		nByte = nByte
  85659 		if nByte <= (*ReusableSpace)(unsafe.Pointer(p)).FnFree {
  85660 			*(*Sqlite3_int64)(unsafe.Pointer(p + 8)) -= nByte
  85661 			pBuf = (*ReusableSpace)(unsafe.Pointer(p)).FpSpace + uintptr((*ReusableSpace)(unsafe.Pointer(p)).FnFree)
  85662 		} else {
  85663 			*(*Sqlite3_int64)(unsafe.Pointer(p + 16)) += nByte
  85664 		}
  85665 	}
  85666 
  85667 	return pBuf
  85668 }
  85669 
  85670 // Rewind the VDBE back to the beginning in preparation for
  85671 // running it.
  85672 func Xsqlite3VdbeRewind(tls *libc.TLS, p uintptr) {
  85673 	(*Vdbe)(unsafe.Pointer(p)).FeVdbeState = U8(VDBE_READY_STATE)
  85674 
  85675 	(*Vdbe)(unsafe.Pointer(p)).Fpc = -1
  85676 	(*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_OK
  85677 	(*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8(OE_Abort)
  85678 	(*Vdbe)(unsafe.Pointer(p)).FnChange = int64(0)
  85679 	(*Vdbe)(unsafe.Pointer(p)).FcacheCtr = U32(1)
  85680 	(*Vdbe)(unsafe.Pointer(p)).FminWriteFileFormat = U8(255)
  85681 	(*Vdbe)(unsafe.Pointer(p)).FiStatement = 0
  85682 	(*Vdbe)(unsafe.Pointer(p)).FnFkConstraint = int64(0)
  85683 }
  85684 
  85685 // Prepare a virtual machine for execution for the first time after
  85686 // creating the virtual machine.  This involves things such
  85687 // as allocating registers and initializing the program counter.
  85688 // After the VDBE has be prepped, it can be executed by one or more
  85689 // calls to sqlite3VdbeExec().
  85690 //
  85691 // This function may be called exactly once on each virtual machine.
  85692 // After this routine is called the VM has been "packaged" and is ready
  85693 // to run.  After this routine is called, further calls to
  85694 // sqlite3VdbeAddOp() functions are prohibited.  This routine disconnects
  85695 // the Vdbe from the Parse object that helped generate it so that the
  85696 // the Vdbe becomes an independent entity and the Parse object can be
  85697 // destroyed.
  85698 //
  85699 // Use the sqlite3VdbeRewind() procedure to restore a virtual machine back
  85700 // to its initial state after it has been run.
  85701 func Xsqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) {
  85702 	bp := tls.Alloc(32)
  85703 	defer tls.Free(32)
  85704 
  85705 	var db uintptr
  85706 	var nVar int32
  85707 	var nMem int32
  85708 	var nCursor int32
  85709 
  85710 	var n int32
  85711 
  85712 	(*Vdbe)(unsafe.Pointer(p)).FpVList = (*Parse)(unsafe.Pointer(pParse)).FpVList
  85713 	(*Parse)(unsafe.Pointer(pParse)).FpVList = uintptr(0)
  85714 	db = (*Vdbe)(unsafe.Pointer(p)).Fdb
  85715 
  85716 	nVar = int32((*Parse)(unsafe.Pointer(pParse)).FnVar)
  85717 	nMem = (*Parse)(unsafe.Pointer(pParse)).FnMem
  85718 	nCursor = (*Parse)(unsafe.Pointer(pParse)).FnTab
  85719 	*(*int32)(unsafe.Pointer(bp)) = (*Parse)(unsafe.Pointer(pParse)).FnMaxArg
  85720 
  85721 	nMem = nMem + nCursor
  85722 	if nCursor == 0 && nMem > 0 {
  85723 		nMem++
  85724 	}
  85725 
  85726 	n = int32(uint64(unsafe.Sizeof(Op{})) * uint64((*Vdbe)(unsafe.Pointer(p)).FnOp))
  85727 	(*ReusableSpace)(unsafe.Pointer(bp + 8)).FpSpace = (*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(n)
  85728 
  85729 	(*ReusableSpace)(unsafe.Pointer(bp + 8)).FnFree = Sqlite3_int64(((*Parse)(unsafe.Pointer(pParse)).FszOpAlloc - n) & libc.CplInt32(7))
  85730 
  85731 	resolveP2Values(tls, p, bp)
  85732 	libc.SetBitFieldPtr8Uint32(p+200, Bft(U8(libc.Bool32((*Parse)(unsafe.Pointer(pParse)).FisMultiWrite != 0 && (*Parse)(unsafe.Pointer(pParse)).FmayAbort != 0))), 5, 0x20)
  85733 	if (*Parse)(unsafe.Pointer(pParse)).Fexplain != 0 {
  85734 		var iFirst int32
  85735 		var mx int32
  85736 		var i int32
  85737 		if nMem < 10 {
  85738 			nMem = 10
  85739 		}
  85740 		libc.SetBitFieldPtr8Uint32(p+200, Bft((*Parse)(unsafe.Pointer(pParse)).Fexplain), 2, 0xc)
  85741 		if int32((*Parse)(unsafe.Pointer(pParse)).Fexplain) == 2 {
  85742 			Xsqlite3VdbeSetNumCols(tls, p, 4)
  85743 			iFirst = 8
  85744 			mx = 12
  85745 		} else {
  85746 			Xsqlite3VdbeSetNumCols(tls, p, 8)
  85747 			iFirst = 0
  85748 			mx = 8
  85749 		}
  85750 		for i = iFirst; i < mx; i++ {
  85751 			Xsqlite3VdbeSetColName(tls, p, i-iFirst, COLNAME_NAME,
  85752 				azColName[i], uintptr(0))
  85753 		}
  85754 	}
  85755 	libc.SetBitFieldPtr8Uint32(p+200, Bft(0), 0, 0x3)
  85756 
  85757 	(*ReusableSpace)(unsafe.Pointer(bp + 8)).FnNeeded = int64(0)
  85758 	(*Vdbe)(unsafe.Pointer(p)).FaMem = allocSpace(tls, bp+8, uintptr(0), int64(uint64(nMem)*uint64(unsafe.Sizeof(Mem{}))))
  85759 	(*Vdbe)(unsafe.Pointer(p)).FaVar = allocSpace(tls, bp+8, uintptr(0), int64(uint64(nVar)*uint64(unsafe.Sizeof(Mem{}))))
  85760 	(*Vdbe)(unsafe.Pointer(p)).FapArg = allocSpace(tls, bp+8, uintptr(0), int64(uint64(*(*int32)(unsafe.Pointer(bp)))*uint64(unsafe.Sizeof(uintptr(0)))))
  85761 	(*Vdbe)(unsafe.Pointer(p)).FapCsr = allocSpace(tls, bp+8, uintptr(0), int64(uint64(nCursor)*uint64(unsafe.Sizeof(uintptr(0)))))
  85762 	if (*ReusableSpace)(unsafe.Pointer(bp+8)).FnNeeded != 0 {
  85763 		(*ReusableSpace)(unsafe.Pointer(bp + 8)).FpSpace = libc.AssignPtrUintptr(p+256, Xsqlite3DbMallocRawNN(tls, db, uint64((*ReusableSpace)(unsafe.Pointer(bp+8)).FnNeeded)))
  85764 		(*ReusableSpace)(unsafe.Pointer(bp + 8)).FnFree = (*ReusableSpace)(unsafe.Pointer(bp + 8)).FnNeeded
  85765 		if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
  85766 			(*Vdbe)(unsafe.Pointer(p)).FaMem = allocSpace(tls, bp+8, (*Vdbe)(unsafe.Pointer(p)).FaMem, int64(uint64(nMem)*uint64(unsafe.Sizeof(Mem{}))))
  85767 			(*Vdbe)(unsafe.Pointer(p)).FaVar = allocSpace(tls, bp+8, (*Vdbe)(unsafe.Pointer(p)).FaVar, int64(uint64(nVar)*uint64(unsafe.Sizeof(Mem{}))))
  85768 			(*Vdbe)(unsafe.Pointer(p)).FapArg = allocSpace(tls, bp+8, (*Vdbe)(unsafe.Pointer(p)).FapArg, int64(uint64(*(*int32)(unsafe.Pointer(bp)))*uint64(unsafe.Sizeof(uintptr(0)))))
  85769 			(*Vdbe)(unsafe.Pointer(p)).FapCsr = allocSpace(tls, bp+8, (*Vdbe)(unsafe.Pointer(p)).FapCsr, int64(uint64(nCursor)*uint64(unsafe.Sizeof(uintptr(0)))))
  85770 		}
  85771 	}
  85772 
  85773 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
  85774 		(*Vdbe)(unsafe.Pointer(p)).FnVar = int16(0)
  85775 		(*Vdbe)(unsafe.Pointer(p)).FnCursor = 0
  85776 		(*Vdbe)(unsafe.Pointer(p)).FnMem = 0
  85777 	} else {
  85778 		(*Vdbe)(unsafe.Pointer(p)).FnCursor = nCursor
  85779 		(*Vdbe)(unsafe.Pointer(p)).FnVar = YnVar(nVar)
  85780 		initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar, nVar, db, uint16(MEM_Null))
  85781 		(*Vdbe)(unsafe.Pointer(p)).FnMem = nMem
  85782 		initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaMem, nMem, db, uint16(MEM_Undefined))
  85783 		libc.Xmemset(tls, (*Vdbe)(unsafe.Pointer(p)).FapCsr, 0, uint64(nCursor)*uint64(unsafe.Sizeof(uintptr(0))))
  85784 	}
  85785 	Xsqlite3VdbeRewind(tls, p)
  85786 }
  85787 
  85788 var azColName = [12]uintptr{
  85789 	ts + 6374, ts + 6379, ts + 6386, ts + 6389, ts + 6392, ts + 6395, ts + 6398, ts + 6401,
  85790 	ts + 6409, ts + 6412, ts + 6419, ts + 6427,
  85791 }
  85792 
  85793 // Close a VDBE cursor and release all the resources that cursor
  85794 // happens to hold.
  85795 func Xsqlite3VdbeFreeCursor(tls *libc.TLS, p uintptr, pCx uintptr) {
  85796 	if pCx != 0 {
  85797 		Xsqlite3VdbeFreeCursorNN(tls, p, pCx)
  85798 	}
  85799 }
  85800 
  85801 func Xsqlite3VdbeFreeCursorNN(tls *libc.TLS, p uintptr, pCx uintptr) {
  85802 	switch int32((*VdbeCursor)(unsafe.Pointer(pCx)).FeCurType) {
  85803 	case CURTYPE_SORTER:
  85804 		{
  85805 			Xsqlite3VdbeSorterClose(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, pCx)
  85806 			break
  85807 
  85808 		}
  85809 	case CURTYPE_BTREE:
  85810 		{
  85811 			Xsqlite3BtreeCloseCursor(tls, *(*uintptr)(unsafe.Pointer(pCx + 48)))
  85812 			break
  85813 
  85814 		}
  85815 	case CURTYPE_VTAB:
  85816 		{
  85817 			var pVCur uintptr = *(*uintptr)(unsafe.Pointer(pCx + 48))
  85818 			var pModule uintptr = (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(pVCur)).FpVtab)).FpModule
  85819 
  85820 			(*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(pVCur)).FpVtab)).FnRef--
  85821 			(*struct {
  85822 				f func(*libc.TLS, uintptr) int32
  85823 			})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule)).FxClose})).f(tls, pVCur)
  85824 			break
  85825 
  85826 		}
  85827 	}
  85828 }
  85829 
  85830 func closeCursorsInFrame(tls *libc.TLS, p uintptr) {
  85831 	var i int32
  85832 	for i = 0; i < (*Vdbe)(unsafe.Pointer(p)).FnCursor; i++ {
  85833 		var pC uintptr = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr(i)*8))
  85834 		if pC != 0 {
  85835 			Xsqlite3VdbeFreeCursorNN(tls, p, pC)
  85836 			*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr(i)*8)) = uintptr(0)
  85837 		}
  85838 	}
  85839 }
  85840 
  85841 // Copy the values stored in the VdbeFrame structure to its Vdbe. This
  85842 // is used, for example, when a trigger sub-program is halted to restore
  85843 // control to the main program.
  85844 func Xsqlite3VdbeFrameRestore(tls *libc.TLS, pFrame uintptr) int32 {
  85845 	var v uintptr = (*VdbeFrame)(unsafe.Pointer(pFrame)).Fv
  85846 	closeCursorsInFrame(tls, v)
  85847 	(*Vdbe)(unsafe.Pointer(v)).FaOp = (*VdbeFrame)(unsafe.Pointer(pFrame)).FaOp
  85848 	(*Vdbe)(unsafe.Pointer(v)).FnOp = (*VdbeFrame)(unsafe.Pointer(pFrame)).FnOp
  85849 	(*Vdbe)(unsafe.Pointer(v)).FaMem = (*VdbeFrame)(unsafe.Pointer(pFrame)).FaMem
  85850 	(*Vdbe)(unsafe.Pointer(v)).FnMem = (*VdbeFrame)(unsafe.Pointer(pFrame)).FnMem
  85851 	(*Vdbe)(unsafe.Pointer(v)).FapCsr = (*VdbeFrame)(unsafe.Pointer(pFrame)).FapCsr
  85852 	(*Vdbe)(unsafe.Pointer(v)).FnCursor = (*VdbeFrame)(unsafe.Pointer(pFrame)).FnCursor
  85853 	(*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).Fdb)).FlastRowid = (*VdbeFrame)(unsafe.Pointer(pFrame)).FlastRowid
  85854 	(*Vdbe)(unsafe.Pointer(v)).FnChange = (*VdbeFrame)(unsafe.Pointer(pFrame)).FnChange
  85855 	(*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).Fdb)).FnChange = (*VdbeFrame)(unsafe.Pointer(pFrame)).FnDbChange
  85856 	Xsqlite3VdbeDeleteAuxData(tls, (*Vdbe)(unsafe.Pointer(v)).Fdb, v+296, -1, 0)
  85857 	(*Vdbe)(unsafe.Pointer(v)).FpAuxData = (*VdbeFrame)(unsafe.Pointer(pFrame)).FpAuxData
  85858 	(*VdbeFrame)(unsafe.Pointer(pFrame)).FpAuxData = uintptr(0)
  85859 	return (*VdbeFrame)(unsafe.Pointer(pFrame)).Fpc
  85860 }
  85861 
  85862 func closeAllCursors(tls *libc.TLS, p uintptr) {
  85863 	if (*Vdbe)(unsafe.Pointer(p)).FpFrame != 0 {
  85864 		var pFrame uintptr
  85865 		for pFrame = (*Vdbe)(unsafe.Pointer(p)).FpFrame; (*VdbeFrame)(unsafe.Pointer(pFrame)).FpParent != 0; pFrame = (*VdbeFrame)(unsafe.Pointer(pFrame)).FpParent {
  85866 		}
  85867 		Xsqlite3VdbeFrameRestore(tls, pFrame)
  85868 		(*Vdbe)(unsafe.Pointer(p)).FpFrame = uintptr(0)
  85869 		(*Vdbe)(unsafe.Pointer(p)).FnFrame = 0
  85870 	}
  85871 
  85872 	closeCursorsInFrame(tls, p)
  85873 	releaseMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaMem, (*Vdbe)(unsafe.Pointer(p)).FnMem)
  85874 	for (*Vdbe)(unsafe.Pointer(p)).FpDelFrame != 0 {
  85875 		var pDel uintptr = (*Vdbe)(unsafe.Pointer(p)).FpDelFrame
  85876 		(*Vdbe)(unsafe.Pointer(p)).FpDelFrame = (*VdbeFrame)(unsafe.Pointer(pDel)).FpParent
  85877 		Xsqlite3VdbeFrameDelete(tls, pDel)
  85878 	}
  85879 
  85880 	if (*Vdbe)(unsafe.Pointer(p)).FpAuxData != 0 {
  85881 		Xsqlite3VdbeDeleteAuxData(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, p+296, -1, 0)
  85882 	}
  85883 
  85884 }
  85885 
  85886 // Set the number of result columns that will be returned by this SQL
  85887 // statement. This is now set at compile time, rather than during
  85888 // execution of the vdbe program so that sqlite3_column_count() can
  85889 // be called on an SQL statement before sqlite3_step().
  85890 func Xsqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) {
  85891 	var n int32
  85892 	var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb
  85893 
  85894 	if (*Vdbe)(unsafe.Pointer(p)).FnResColumn != 0 {
  85895 		releaseMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaColName, int32((*Vdbe)(unsafe.Pointer(p)).FnResColumn)*COLNAME_N)
  85896 		Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FaColName)
  85897 	}
  85898 	n = nResColumn * COLNAME_N
  85899 	(*Vdbe)(unsafe.Pointer(p)).FnResColumn = U16(nResColumn)
  85900 	(*Vdbe)(unsafe.Pointer(p)).FaColName = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(Mem{}))*uint64(n))
  85901 	if (*Vdbe)(unsafe.Pointer(p)).FaColName == uintptr(0) {
  85902 		return
  85903 	}
  85904 	initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaColName, n, db, uint16(MEM_Null))
  85905 }
  85906 
  85907 // Set the name of the idx'th column to be returned by the SQL statement.
  85908 // zName must be a pointer to a nul terminated string.
  85909 //
  85910 // This call must be made after a call to sqlite3VdbeSetNumCols().
  85911 //
  85912 // The final parameter, xDel, must be one of SQLITE_DYNAMIC, SQLITE_STATIC
  85913 // or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed
  85914 // to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed.
  85915 func Xsqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) int32 {
  85916 	var rc int32
  85917 	var pColName uintptr
  85918 
  85919 	if (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed != 0 {
  85920 		return SQLITE_NOMEM
  85921 	}
  85922 
  85923 	pColName = (*Vdbe)(unsafe.Pointer(p)).FaColName + uintptr(idx+var1*int32((*Vdbe)(unsafe.Pointer(p)).FnResColumn))*56
  85924 	rc = Xsqlite3VdbeMemSetStr(tls, pColName, zName, int64(-1), uint8(SQLITE_UTF8), xDel)
  85925 
  85926 	return rc
  85927 }
  85928 
  85929 func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 {
  85930 	bp := tls.Alloc(72)
  85931 	defer tls.Free(72)
  85932 
  85933 	var i int32
  85934 	var nTrans int32 = 0
  85935 
  85936 	var rc int32 = SQLITE_OK
  85937 	var needXcommit int32 = 0
  85938 
  85939 	rc = Xsqlite3VtabSync(tls, db, p)
  85940 
  85941 	for i = 0; rc == SQLITE_OK && i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
  85942 		var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt
  85943 		if Xsqlite3BtreeTxnState(tls, pBt) == SQLITE_TXN_WRITE {
  85944 			var pPager uintptr
  85945 			needXcommit = 1
  85946 			Xsqlite3BtreeEnter(tls, pBt)
  85947 			pPager = Xsqlite3BtreePager(tls, pBt)
  85948 			if int32((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).Fsafety_level) != PAGER_SYNCHRONOUS_OFF &&
  85949 				aMJNeeded[Xsqlite3PagerGetJournalMode(tls, pPager)] != 0 &&
  85950 				Xsqlite3PagerIsMemdb(tls, pPager) == 0 {
  85951 				nTrans++
  85952 			}
  85953 			rc = Xsqlite3PagerExclusiveLock(tls, pPager)
  85954 			Xsqlite3BtreeLeave(tls, pBt)
  85955 		}
  85956 	}
  85957 	if rc != SQLITE_OK {
  85958 		return rc
  85959 	}
  85960 
  85961 	if needXcommit != 0 && (*Sqlite3)(unsafe.Pointer(db)).FxCommitCallback != 0 {
  85962 		rc = (*struct {
  85963 			f func(*libc.TLS, uintptr) int32
  85964 		})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxCommitCallback})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCommitArg)
  85965 		if rc != 0 {
  85966 			return SQLITE_CONSTRAINT | int32(2)<<8
  85967 		}
  85968 	}
  85969 
  85970 	if 0 == Xsqlite3Strlen30(tls, Xsqlite3BtreeGetFilename(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpBt)) ||
  85971 		nTrans <= 1 {
  85972 		for i = 0; rc == SQLITE_OK && i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
  85973 			var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt
  85974 			if pBt != 0 {
  85975 				rc = Xsqlite3BtreeCommitPhaseOne(tls, pBt, uintptr(0))
  85976 			}
  85977 		}
  85978 
  85979 		for i = 0; rc == SQLITE_OK && i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
  85980 			var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt
  85981 			if pBt != 0 {
  85982 				rc = Xsqlite3BtreeCommitPhaseTwo(tls, pBt, 0)
  85983 			}
  85984 		}
  85985 		if rc == SQLITE_OK {
  85986 			Xsqlite3VtabCommit(tls, db)
  85987 		}
  85988 	} else {
  85989 		var pVfs uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpVfs
  85990 		var zSuper uintptr = uintptr(0)
  85991 		var zMainFile uintptr = Xsqlite3BtreeGetFilename(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpBt)
  85992 		*(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0)
  85993 		var offset I64 = int64(0)
  85994 
  85995 		var retryCount int32 = 0
  85996 		var nMainFile int32
  85997 
  85998 		nMainFile = Xsqlite3Strlen30(tls, zMainFile)
  85999 		zSuper = Xsqlite3MPrintf(tls, db, ts+6434, libc.VaList(bp, 0, zMainFile, 0))
  86000 		if zSuper == uintptr(0) {
  86001 			return SQLITE_NOMEM
  86002 		}
  86003 		zSuper += uintptr(4)
  86004 		for __ccgo := true; __ccgo; __ccgo = rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 60)) != 0 {
  86005 			if retryCount != 0 {
  86006 				if retryCount > 100 {
  86007 					Xsqlite3_log(tls, SQLITE_FULL, ts+6446, libc.VaList(bp+24, zSuper))
  86008 					Xsqlite3OsDelete(tls, pVfs, zSuper, 0)
  86009 					break
  86010 				} else if retryCount == 1 {
  86011 					Xsqlite3_log(tls, SQLITE_FULL, ts+6460, libc.VaList(bp+32, zSuper))
  86012 				}
  86013 			}
  86014 			retryCount++
  86015 			Xsqlite3_randomness(tls, int32(unsafe.Sizeof(U32(0))), bp+56)
  86016 			Xsqlite3_snprintf(tls, 13, zSuper+uintptr(nMainFile), ts+6475,
  86017 				libc.VaList(bp+40, *(*U32)(unsafe.Pointer(bp + 56))>>8&U32(0xffffff), *(*U32)(unsafe.Pointer(bp + 56))&U32(0xff)))
  86018 
  86019 			rc = Xsqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+60)
  86020 		}
  86021 		if rc == SQLITE_OK {
  86022 			rc = Xsqlite3OsOpenMalloc(tls, pVfs, zSuper, bp+64,
  86023 				SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|SQLITE_OPEN_EXCLUSIVE|SQLITE_OPEN_SUPER_JOURNAL, uintptr(0))
  86024 		}
  86025 		if rc != SQLITE_OK {
  86026 			Xsqlite3DbFree(tls, db, zSuper-uintptr(4))
  86027 			return rc
  86028 		}
  86029 
  86030 		for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
  86031 			var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt
  86032 			if Xsqlite3BtreeTxnState(tls, pBt) == SQLITE_TXN_WRITE {
  86033 				var zFile uintptr = Xsqlite3BtreeGetJournalname(tls, pBt)
  86034 				if zFile == uintptr(0) {
  86035 					continue
  86036 				}
  86037 
  86038 				rc = Xsqlite3OsWrite(tls, *(*uintptr)(unsafe.Pointer(bp + 64)), zFile, Xsqlite3Strlen30(tls, zFile)+1, offset)
  86039 				offset = offset + I64(Xsqlite3Strlen30(tls, zFile)+1)
  86040 				if rc != SQLITE_OK {
  86041 					Xsqlite3OsCloseFree(tls, *(*uintptr)(unsafe.Pointer(bp + 64)))
  86042 					Xsqlite3OsDelete(tls, pVfs, zSuper, 0)
  86043 					Xsqlite3DbFree(tls, db, zSuper-uintptr(4))
  86044 					return rc
  86045 				}
  86046 			}
  86047 		}
  86048 
  86049 		if 0 == Xsqlite3OsDeviceCharacteristics(tls, *(*uintptr)(unsafe.Pointer(bp + 64)))&SQLITE_IOCAP_SEQUENTIAL &&
  86050 			SQLITE_OK != libc.AssignInt32(&rc, Xsqlite3OsSync(tls, *(*uintptr)(unsafe.Pointer(bp + 64)), SQLITE_SYNC_NORMAL)) {
  86051 			Xsqlite3OsCloseFree(tls, *(*uintptr)(unsafe.Pointer(bp + 64)))
  86052 			Xsqlite3OsDelete(tls, pVfs, zSuper, 0)
  86053 			Xsqlite3DbFree(tls, db, zSuper-uintptr(4))
  86054 			return rc
  86055 		}
  86056 
  86057 		for i = 0; rc == SQLITE_OK && i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
  86058 			var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt
  86059 			if pBt != 0 {
  86060 				rc = Xsqlite3BtreeCommitPhaseOne(tls, pBt, zSuper)
  86061 			}
  86062 		}
  86063 		Xsqlite3OsCloseFree(tls, *(*uintptr)(unsafe.Pointer(bp + 64)))
  86064 
  86065 		if rc != SQLITE_OK {
  86066 			Xsqlite3DbFree(tls, db, zSuper-uintptr(4))
  86067 			return rc
  86068 		}
  86069 
  86070 		rc = Xsqlite3OsDelete(tls, pVfs, zSuper, 1)
  86071 		Xsqlite3DbFree(tls, db, zSuper-uintptr(4))
  86072 		zSuper = uintptr(0)
  86073 		if rc != 0 {
  86074 			return rc
  86075 		}
  86076 
  86077 		Xsqlite3BeginBenignMalloc(tls)
  86078 		for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
  86079 			var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt
  86080 			if pBt != 0 {
  86081 				Xsqlite3BtreeCommitPhaseTwo(tls, pBt, 1)
  86082 			}
  86083 		}
  86084 		Xsqlite3EndBenignMalloc(tls)
  86085 
  86086 		Xsqlite3VtabCommit(tls, db)
  86087 	}
  86088 
  86089 	return rc
  86090 }
  86091 
  86092 var aMJNeeded = [6]U8{
  86093 	U8(1),
  86094 	U8(1),
  86095 	U8(0),
  86096 	U8(1),
  86097 	U8(0),
  86098 	U8(0),
  86099 }
  86100 
  86101 func vdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) int32 {
  86102 	var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb
  86103 	var rc int32 = SQLITE_OK
  86104 	var i int32
  86105 	var iSavepoint int32 = (*Vdbe)(unsafe.Pointer(p)).FiStatement - 1
  86106 
  86107 	for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
  86108 		var rc2 int32 = SQLITE_OK
  86109 		var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt
  86110 		if pBt != 0 {
  86111 			if eOp == SAVEPOINT_ROLLBACK {
  86112 				rc2 = Xsqlite3BtreeSavepoint(tls, pBt, SAVEPOINT_ROLLBACK, iSavepoint)
  86113 			}
  86114 			if rc2 == SQLITE_OK {
  86115 				rc2 = Xsqlite3BtreeSavepoint(tls, pBt, SAVEPOINT_RELEASE, iSavepoint)
  86116 			}
  86117 			if rc == SQLITE_OK {
  86118 				rc = rc2
  86119 			}
  86120 		}
  86121 	}
  86122 	(*Sqlite3)(unsafe.Pointer(db)).FnStatement--
  86123 	(*Vdbe)(unsafe.Pointer(p)).FiStatement = 0
  86124 
  86125 	if rc == SQLITE_OK {
  86126 		if eOp == SAVEPOINT_ROLLBACK {
  86127 			rc = Xsqlite3VtabSavepoint(tls, db, SAVEPOINT_ROLLBACK, iSavepoint)
  86128 		}
  86129 		if rc == SQLITE_OK {
  86130 			rc = Xsqlite3VtabSavepoint(tls, db, SAVEPOINT_RELEASE, iSavepoint)
  86131 		}
  86132 	}
  86133 
  86134 	if eOp == SAVEPOINT_ROLLBACK {
  86135 		(*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons = (*Vdbe)(unsafe.Pointer(p)).FnStmtDefCons
  86136 		(*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = (*Vdbe)(unsafe.Pointer(p)).FnStmtDefImmCons
  86137 	}
  86138 	return rc
  86139 }
  86140 
  86141 func Xsqlite3VdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) int32 {
  86142 	if (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FnStatement != 0 && (*Vdbe)(unsafe.Pointer(p)).FiStatement != 0 {
  86143 		return vdbeCloseStatement(tls, p, eOp)
  86144 	}
  86145 	return SQLITE_OK
  86146 }
  86147 
  86148 // This function is called when a transaction opened by the database
  86149 // handle associated with the VM passed as an argument is about to be
  86150 // committed. If there are outstanding deferred foreign key constraint
  86151 // violations, return SQLITE_ERROR. Otherwise, SQLITE_OK.
  86152 //
  86153 // If there are outstanding FK violations and this function returns
  86154 // SQLITE_ERROR, set the result of the VM to SQLITE_CONSTRAINT_FOREIGNKEY
  86155 // and write an error message to it. Then return SQLITE_ERROR.
  86156 func Xsqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) int32 {
  86157 	var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb
  86158 	if deferred != 0 && (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons+(*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons > int64(0) ||
  86159 		!(deferred != 0) && (*Vdbe)(unsafe.Pointer(p)).FnFkConstraint > int64(0) {
  86160 		(*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_CONSTRAINT | int32(3)<<8
  86161 		(*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8(OE_Abort)
  86162 		Xsqlite3VdbeError(tls, p, ts+6488, 0)
  86163 		if int32((*Vdbe)(unsafe.Pointer(p)).FprepFlags)&SQLITE_PREPARE_SAVESQL == 0 {
  86164 			return SQLITE_ERROR
  86165 		}
  86166 		return SQLITE_CONSTRAINT | int32(3)<<8
  86167 	}
  86168 	return SQLITE_OK
  86169 }
  86170 
  86171 // This routine is called the when a VDBE tries to halt.  If the VDBE
  86172 // has made changes and is in autocommit mode, then commit those
  86173 // changes.  If a rollback is needed, then do the rollback.
  86174 //
  86175 // This routine is the only way to move the sqlite3eOpenState of a VM from
  86176 // SQLITE_STATE_RUN to SQLITE_STATE_HALT.  It is harmless to
  86177 // call this on a VM that is in the SQLITE_STATE_HALT state.
  86178 //
  86179 // Return an error code.  If the commit could not complete because of
  86180 // lock contention, return SQLITE_BUSY.  If SQLITE_BUSY is returned, it
  86181 // means the close did not happen and needs to be repeated.
  86182 func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 {
  86183 	var rc int32
  86184 	var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb
  86185 
  86186 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
  86187 		(*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
  86188 	}
  86189 	closeAllCursors(tls, p)
  86190 
  86191 	if Bft(int32(*(*uint8)(unsafe.Pointer(p + 200))&0x80>>7)) != 0 {
  86192 		var mrc int32
  86193 		var eStatementOp int32 = 0
  86194 		var isSpecialError int32
  86195 
  86196 		Xsqlite3VdbeEnter(tls, p)
  86197 
  86198 		if (*Vdbe)(unsafe.Pointer(p)).Frc != 0 {
  86199 			mrc = (*Vdbe)(unsafe.Pointer(p)).Frc & 0xff
  86200 			isSpecialError = libc.Bool32(mrc == SQLITE_NOMEM ||
  86201 				mrc == SQLITE_IOERR ||
  86202 				mrc == SQLITE_INTERRUPT ||
  86203 				mrc == SQLITE_FULL)
  86204 		} else {
  86205 			mrc = libc.AssignInt32(&isSpecialError, 0)
  86206 		}
  86207 		if isSpecialError != 0 {
  86208 			if !(int32(*(*uint8)(unsafe.Pointer(p + 200))&0x40>>6) != 0) || mrc != SQLITE_INTERRUPT {
  86209 				if (mrc == SQLITE_NOMEM || mrc == SQLITE_FULL) && Bft(int32(*(*uint8)(unsafe.Pointer(p + 200))&0x20>>5)) != 0 {
  86210 					eStatementOp = SAVEPOINT_ROLLBACK
  86211 				} else {
  86212 					Xsqlite3RollbackAll(tls, db, SQLITE_ABORT|int32(2)<<8)
  86213 					Xsqlite3CloseSavepoints(tls, db)
  86214 					(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1)
  86215 					(*Vdbe)(unsafe.Pointer(p)).FnChange = int64(0)
  86216 				}
  86217 			}
  86218 		}
  86219 
  86220 		if (*Vdbe)(unsafe.Pointer(p)).Frc == SQLITE_OK || int32((*Vdbe)(unsafe.Pointer(p)).FerrorAction) == OE_Fail && !(isSpecialError != 0) {
  86221 			Xsqlite3VdbeCheckFk(tls, p, 0)
  86222 		}
  86223 
  86224 		if !((*Sqlite3)(unsafe.Pointer(db)).FnVTrans > 0 && (*Sqlite3)(unsafe.Pointer(db)).FaVTrans == uintptr(0)) &&
  86225 			(*Sqlite3)(unsafe.Pointer(db)).FautoCommit != 0 &&
  86226 			(*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite == libc.Bool32(int32(*(*uint8)(unsafe.Pointer(p + 200))&0x40>>6) == 0) {
  86227 			if (*Vdbe)(unsafe.Pointer(p)).Frc == SQLITE_OK || int32((*Vdbe)(unsafe.Pointer(p)).FerrorAction) == OE_Fail && !(isSpecialError != 0) {
  86228 				rc = Xsqlite3VdbeCheckFk(tls, p, 1)
  86229 				if rc != SQLITE_OK {
  86230 					if Bft(int32(*(*uint8)(unsafe.Pointer(p + 200))&0x40>>6)) != 0 {
  86231 						Xsqlite3VdbeLeave(tls, p)
  86232 						return SQLITE_ERROR
  86233 					}
  86234 					rc = SQLITE_CONSTRAINT | int32(3)<<8
  86235 				} else if (*Sqlite3)(unsafe.Pointer(db)).Fflags&(uint64(0x00002)<<32) != 0 {
  86236 					rc = SQLITE_CORRUPT
  86237 					*(*U64)(unsafe.Pointer(db + 48)) &= libc.CplUint64(uint64(0x00002) << 32)
  86238 				} else {
  86239 					rc = vdbeCommit(tls, db, p)
  86240 				}
  86241 				if rc == SQLITE_BUSY && Bft(int32(*(*uint8)(unsafe.Pointer(p + 200))&0x40>>6)) != 0 {
  86242 					Xsqlite3VdbeLeave(tls, p)
  86243 					return SQLITE_BUSY
  86244 				} else if rc != SQLITE_OK {
  86245 					(*Vdbe)(unsafe.Pointer(p)).Frc = rc
  86246 					Xsqlite3RollbackAll(tls, db, SQLITE_OK)
  86247 					(*Vdbe)(unsafe.Pointer(p)).FnChange = int64(0)
  86248 				} else {
  86249 					(*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons = int64(0)
  86250 					(*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = int64(0)
  86251 					*(*U64)(unsafe.Pointer(db + 48)) &= libc.CplUint64(uint64(SQLITE_DeferFKs))
  86252 					Xsqlite3CommitInternalChanges(tls, db)
  86253 				}
  86254 			} else {
  86255 				Xsqlite3RollbackAll(tls, db, SQLITE_OK)
  86256 				(*Vdbe)(unsafe.Pointer(p)).FnChange = int64(0)
  86257 			}
  86258 			(*Sqlite3)(unsafe.Pointer(db)).FnStatement = 0
  86259 		} else if eStatementOp == 0 {
  86260 			if (*Vdbe)(unsafe.Pointer(p)).Frc == SQLITE_OK || int32((*Vdbe)(unsafe.Pointer(p)).FerrorAction) == OE_Fail {
  86261 				eStatementOp = SAVEPOINT_RELEASE
  86262 			} else if int32((*Vdbe)(unsafe.Pointer(p)).FerrorAction) == OE_Abort {
  86263 				eStatementOp = SAVEPOINT_ROLLBACK
  86264 			} else {
  86265 				Xsqlite3RollbackAll(tls, db, SQLITE_ABORT|int32(2)<<8)
  86266 				Xsqlite3CloseSavepoints(tls, db)
  86267 				(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1)
  86268 				(*Vdbe)(unsafe.Pointer(p)).FnChange = int64(0)
  86269 			}
  86270 		}
  86271 
  86272 		if eStatementOp != 0 {
  86273 			rc = Xsqlite3VdbeCloseStatement(tls, p, eStatementOp)
  86274 			if rc != 0 {
  86275 				if (*Vdbe)(unsafe.Pointer(p)).Frc == SQLITE_OK || (*Vdbe)(unsafe.Pointer(p)).Frc&0xff == SQLITE_CONSTRAINT {
  86276 					(*Vdbe)(unsafe.Pointer(p)).Frc = rc
  86277 					Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg)
  86278 					(*Vdbe)(unsafe.Pointer(p)).FzErrMsg = uintptr(0)
  86279 				}
  86280 				Xsqlite3RollbackAll(tls, db, SQLITE_ABORT|int32(2)<<8)
  86281 				Xsqlite3CloseSavepoints(tls, db)
  86282 				(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1)
  86283 				(*Vdbe)(unsafe.Pointer(p)).FnChange = int64(0)
  86284 			}
  86285 		}
  86286 
  86287 		if Bft(int32(*(*uint8)(unsafe.Pointer(p + 200))&0x10>>4)) != 0 {
  86288 			if eStatementOp != SAVEPOINT_ROLLBACK {
  86289 				Xsqlite3VdbeSetChanges(tls, db, (*Vdbe)(unsafe.Pointer(p)).FnChange)
  86290 			} else {
  86291 				Xsqlite3VdbeSetChanges(tls, db, int64(0))
  86292 			}
  86293 			(*Vdbe)(unsafe.Pointer(p)).FnChange = int64(0)
  86294 		}
  86295 
  86296 		Xsqlite3VdbeLeave(tls, p)
  86297 	}
  86298 
  86299 	(*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive--
  86300 	if !(int32(*(*uint8)(unsafe.Pointer(p + 200))&0x40>>6) != 0) {
  86301 		(*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite--
  86302 	}
  86303 	if Bft(int32(*(*uint8)(unsafe.Pointer(p + 200))&0x80>>7)) != 0 {
  86304 		(*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead--
  86305 	}
  86306 
  86307 	(*Vdbe)(unsafe.Pointer(p)).FeVdbeState = U8(VDBE_HALT_STATE)
  86308 
  86309 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
  86310 		(*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
  86311 	}
  86312 
  86313 	if (*Sqlite3)(unsafe.Pointer(db)).FautoCommit != 0 {
  86314 		Xsqlite3ConnectionUnlocked(tls, db)
  86315 	}
  86316 
  86317 	return func() int32 {
  86318 		if (*Vdbe)(unsafe.Pointer(p)).Frc == SQLITE_BUSY {
  86319 			return SQLITE_BUSY
  86320 		}
  86321 		return SQLITE_OK
  86322 	}()
  86323 }
  86324 
  86325 // Each VDBE holds the result of the most recent sqlite3_step() call
  86326 // in p->rc.  This routine sets that result back to SQLITE_OK.
  86327 func Xsqlite3VdbeResetStepResult(tls *libc.TLS, p uintptr) {
  86328 	(*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_OK
  86329 }
  86330 
  86331 // Copy the error code and error message belonging to the VDBE passed
  86332 // as the first argument to its database handle (so that they will be
  86333 // returned by calls to sqlite3_errcode() and sqlite3_errmsg()).
  86334 //
  86335 // This function does not clear the VDBE error code or message, just
  86336 // copies them to the database handle.
  86337 func Xsqlite3VdbeTransferError(tls *libc.TLS, p uintptr) int32 {
  86338 	var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb
  86339 	var rc int32 = (*Vdbe)(unsafe.Pointer(p)).Frc
  86340 	if (*Vdbe)(unsafe.Pointer(p)).FzErrMsg != 0 {
  86341 		(*Sqlite3)(unsafe.Pointer(db)).FbBenignMalloc++
  86342 		Xsqlite3BeginBenignMalloc(tls)
  86343 		if (*Sqlite3)(unsafe.Pointer(db)).FpErr == uintptr(0) {
  86344 			(*Sqlite3)(unsafe.Pointer(db)).FpErr = Xsqlite3ValueNew(tls, db)
  86345 		}
  86346 		Xsqlite3ValueSetStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr, -1, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg, uint8(SQLITE_UTF8), libc.UintptrFromInt32(-1))
  86347 		Xsqlite3EndBenignMalloc(tls)
  86348 		(*Sqlite3)(unsafe.Pointer(db)).FbBenignMalloc--
  86349 	} else if (*Sqlite3)(unsafe.Pointer(db)).FpErr != 0 {
  86350 		Xsqlite3ValueSetNull(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr)
  86351 	}
  86352 	(*Sqlite3)(unsafe.Pointer(db)).FerrCode = rc
  86353 	(*Sqlite3)(unsafe.Pointer(db)).FerrByteOffset = -1
  86354 	return rc
  86355 }
  86356 
  86357 // Clean up a VDBE after execution but do not delete the VDBE just yet.
  86358 // Write any error messages into *pzErrMsg.  Return the result code.
  86359 //
  86360 // After this routine is run, the VDBE should be ready to be executed
  86361 // again.
  86362 //
  86363 // To look at it another way, this routine resets the state of the
  86364 // virtual machine from VDBE_RUN_STATE or VDBE_HALT_STATE back to
  86365 // VDBE_READY_STATE.
  86366 func Xsqlite3VdbeReset(tls *libc.TLS, p uintptr) int32 {
  86367 	var db uintptr
  86368 	db = (*Vdbe)(unsafe.Pointer(p)).Fdb
  86369 
  86370 	if int32((*Vdbe)(unsafe.Pointer(p)).FeVdbeState) == VDBE_RUN_STATE {
  86371 		Xsqlite3VdbeHalt(tls, p)
  86372 	}
  86373 
  86374 	if (*Vdbe)(unsafe.Pointer(p)).Fpc >= 0 {
  86375 		if (*Sqlite3)(unsafe.Pointer(db)).FpErr != 0 || (*Vdbe)(unsafe.Pointer(p)).FzErrMsg != 0 {
  86376 			Xsqlite3VdbeTransferError(tls, p)
  86377 		} else {
  86378 			(*Sqlite3)(unsafe.Pointer(db)).FerrCode = (*Vdbe)(unsafe.Pointer(p)).Frc
  86379 		}
  86380 	}
  86381 
  86382 	if (*Vdbe)(unsafe.Pointer(p)).FzErrMsg != 0 {
  86383 		Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg)
  86384 		(*Vdbe)(unsafe.Pointer(p)).FzErrMsg = uintptr(0)
  86385 	}
  86386 	(*Vdbe)(unsafe.Pointer(p)).FpResultRow = uintptr(0)
  86387 
  86388 	return (*Vdbe)(unsafe.Pointer(p)).Frc & (*Sqlite3)(unsafe.Pointer(db)).FerrMask
  86389 }
  86390 
  86391 // Clean up and delete a VDBE after execution.  Return an integer which is
  86392 // the result code.  Write any error message text into *pzErrMsg.
  86393 func Xsqlite3VdbeFinalize(tls *libc.TLS, p uintptr) int32 {
  86394 	var rc int32 = SQLITE_OK
  86395 
  86396 	if int32((*Vdbe)(unsafe.Pointer(p)).FeVdbeState) >= VDBE_READY_STATE {
  86397 		rc = Xsqlite3VdbeReset(tls, p)
  86398 
  86399 	}
  86400 	Xsqlite3VdbeDelete(tls, p)
  86401 	return rc
  86402 }
  86403 
  86404 // If parameter iOp is less than zero, then invoke the destructor for
  86405 // all auxiliary data pointers currently cached by the VM passed as
  86406 // the first argument.
  86407 //
  86408 // Or, if iOp is greater than or equal to zero, then the destructor is
  86409 // only invoked for those auxiliary data pointers created by the user
  86410 // function invoked by the OP_Function opcode at instruction iOp of
  86411 // VM pVdbe, and only then if:
  86412 //
  86413 //   - the associated function parameter is the 32nd or later (counting
  86414 //     from left to right), or
  86415 //
  86416 //   - the corresponding bit in argument mask is clear (where the first
  86417 //     function parameter corresponds to bit 0 etc.).
  86418 func Xsqlite3VdbeDeleteAuxData(tls *libc.TLS, db uintptr, pp uintptr, iOp int32, mask int32) {
  86419 	for *(*uintptr)(unsafe.Pointer(pp)) != 0 {
  86420 		var pAux uintptr = *(*uintptr)(unsafe.Pointer(pp))
  86421 		if iOp < 0 ||
  86422 			(*AuxData)(unsafe.Pointer(pAux)).FiAuxOp == iOp &&
  86423 				(*AuxData)(unsafe.Pointer(pAux)).FiAuxArg >= 0 &&
  86424 				((*AuxData)(unsafe.Pointer(pAux)).FiAuxArg > 31 || !(uint32(mask)&(uint32(1)<<(*AuxData)(unsafe.Pointer(pAux)).FiAuxArg) != 0)) {
  86425 			if (*AuxData)(unsafe.Pointer(pAux)).FxDeleteAux != 0 {
  86426 				(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*AuxData)(unsafe.Pointer(pAux)).FxDeleteAux})).f(tls, (*AuxData)(unsafe.Pointer(pAux)).FpAux)
  86427 			}
  86428 			*(*uintptr)(unsafe.Pointer(pp)) = (*AuxData)(unsafe.Pointer(pAux)).FpNextAux
  86429 			Xsqlite3DbFree(tls, db, pAux)
  86430 		} else {
  86431 			pp = pAux + 24
  86432 		}
  86433 	}
  86434 }
  86435 
  86436 func sqlite3VdbeClearObject(tls *libc.TLS, db uintptr, p uintptr) {
  86437 	var pSub uintptr
  86438 	var pNext uintptr
  86439 
  86440 	if (*Vdbe)(unsafe.Pointer(p)).FaColName != 0 {
  86441 		releaseMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaColName, int32((*Vdbe)(unsafe.Pointer(p)).FnResColumn)*COLNAME_N)
  86442 		Xsqlite3DbNNFreeNN(tls, db, (*Vdbe)(unsafe.Pointer(p)).FaColName)
  86443 	}
  86444 	for pSub = (*Vdbe)(unsafe.Pointer(p)).FpProgram; pSub != 0; pSub = pNext {
  86445 		pNext = (*SubProgram)(unsafe.Pointer(pSub)).FpNext
  86446 		vdbeFreeOpArray(tls, db, (*SubProgram)(unsafe.Pointer(pSub)).FaOp, (*SubProgram)(unsafe.Pointer(pSub)).FnOp)
  86447 		Xsqlite3DbFree(tls, db, pSub)
  86448 	}
  86449 	if int32((*Vdbe)(unsafe.Pointer(p)).FeVdbeState) != VDBE_INIT_STATE {
  86450 		releaseMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar, int32((*Vdbe)(unsafe.Pointer(p)).FnVar))
  86451 		if (*Vdbe)(unsafe.Pointer(p)).FpVList != 0 {
  86452 			Xsqlite3DbNNFreeNN(tls, db, (*Vdbe)(unsafe.Pointer(p)).FpVList)
  86453 		}
  86454 		if (*Vdbe)(unsafe.Pointer(p)).FpFree != 0 {
  86455 			Xsqlite3DbNNFreeNN(tls, db, (*Vdbe)(unsafe.Pointer(p)).FpFree)
  86456 		}
  86457 	}
  86458 	vdbeFreeOpArray(tls, db, (*Vdbe)(unsafe.Pointer(p)).FaOp, (*Vdbe)(unsafe.Pointer(p)).FnOp)
  86459 	if (*Vdbe)(unsafe.Pointer(p)).FzSql != 0 {
  86460 		Xsqlite3DbNNFreeNN(tls, db, (*Vdbe)(unsafe.Pointer(p)).FzSql)
  86461 	}
  86462 }
  86463 
  86464 // Delete an entire VDBE.
  86465 func Xsqlite3VdbeDelete(tls *libc.TLS, p uintptr) {
  86466 	var db uintptr
  86467 
  86468 	db = (*Vdbe)(unsafe.Pointer(p)).Fdb
  86469 
  86470 	sqlite3VdbeClearObject(tls, db, p)
  86471 	if (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0) {
  86472 		*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FppVPrev)) = (*Vdbe)(unsafe.Pointer(p)).FpVNext
  86473 		if (*Vdbe)(unsafe.Pointer(p)).FpVNext != 0 {
  86474 			(*Vdbe)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FpVNext)).FppVPrev = (*Vdbe)(unsafe.Pointer(p)).FppVPrev
  86475 		}
  86476 	}
  86477 	Xsqlite3DbNNFreeNN(tls, db, p)
  86478 }
  86479 
  86480 // The cursor "p" has a pending seek operation that has not yet been
  86481 // carried out.  Seek the cursor now.  If an error occurs, return
  86482 // the appropriate error code.
  86483 func Xsqlite3VdbeFinishMoveto(tls *libc.TLS, p uintptr) int32 {
  86484 	bp := tls.Alloc(4)
  86485 	defer tls.Free(4)
  86486 
  86487 	var rc int32
  86488 
  86489 	rc = Xsqlite3BtreeTableMoveto(tls, *(*uintptr)(unsafe.Pointer(p + 48)), (*VdbeCursor)(unsafe.Pointer(p)).FmovetoTarget, 0, bp)
  86490 	if rc != 0 {
  86491 		return rc
  86492 	}
  86493 	if *(*int32)(unsafe.Pointer(bp)) != 0 {
  86494 		return Xsqlite3CorruptError(tls, 86062)
  86495 	}
  86496 	(*VdbeCursor)(unsafe.Pointer(p)).FdeferredMoveto = U8(0)
  86497 	(*VdbeCursor)(unsafe.Pointer(p)).FcacheStatus = U32(CACHE_STALE)
  86498 	return SQLITE_OK
  86499 }
  86500 
  86501 // Something has moved cursor "p" out of place.  Maybe the row it was
  86502 // pointed to was deleted out from under it.  Or maybe the btree was
  86503 // rebalanced.  Whatever the cause, try to restore "p" to the place it
  86504 // is supposed to be pointing.  If the row was deleted out from under the
  86505 // cursor, set the cursor to point to a NULL row.
  86506 func Xsqlite3VdbeHandleMovedCursor(tls *libc.TLS, p uintptr) int32 {
  86507 	bp := tls.Alloc(4)
  86508 	defer tls.Free(4)
  86509 
  86510 	var rc int32
  86511 
  86512 	rc = Xsqlite3BtreeCursorRestore(tls, *(*uintptr)(unsafe.Pointer(p + 48)), bp)
  86513 	(*VdbeCursor)(unsafe.Pointer(p)).FcacheStatus = U32(CACHE_STALE)
  86514 	if *(*int32)(unsafe.Pointer(bp)) != 0 {
  86515 		(*VdbeCursor)(unsafe.Pointer(p)).FnullRow = U8(1)
  86516 	}
  86517 	return rc
  86518 }
  86519 
  86520 // Check to ensure that the cursor is valid.  Restore the cursor
  86521 // if need be.  Return any I/O error from the restore operation.
  86522 func Xsqlite3VdbeCursorRestore(tls *libc.TLS, p uintptr) int32 {
  86523 	if Xsqlite3BtreeCursorHasMoved(tls, *(*uintptr)(unsafe.Pointer(p + 48))) != 0 {
  86524 		return Xsqlite3VdbeHandleMovedCursor(tls, p)
  86525 	}
  86526 	return SQLITE_OK
  86527 }
  86528 
  86529 // The sizes for serial types less than 128
  86530 var Xsqlite3SmallTypeSizes = [128]U8{
  86531 	U8(0), U8(1), U8(2), U8(3), U8(4), U8(6), U8(8), U8(8), U8(0), U8(0),
  86532 	U8(0), U8(0), U8(0), U8(0), U8(1), U8(1), U8(2), U8(2), U8(3), U8(3),
  86533 	U8(4), U8(4), U8(5), U8(5), U8(6), U8(6), U8(7), U8(7), U8(8), U8(8),
  86534 	U8(9), U8(9), U8(10), U8(10), U8(11), U8(11), U8(12), U8(12), U8(13), U8(13),
  86535 	U8(14), U8(14), U8(15), U8(15), U8(16), U8(16), U8(17), U8(17), U8(18), U8(18),
  86536 	U8(19), U8(19), U8(20), U8(20), U8(21), U8(21), U8(22), U8(22), U8(23), U8(23),
  86537 	U8(24), U8(24), U8(25), U8(25), U8(26), U8(26), U8(27), U8(27), U8(28), U8(28),
  86538 	U8(29), U8(29), U8(30), U8(30), U8(31), U8(31), U8(32), U8(32), U8(33), U8(33),
  86539 	U8(34), U8(34), U8(35), U8(35), U8(36), U8(36), U8(37), U8(37), U8(38), U8(38),
  86540 	U8(39), U8(39), U8(40), U8(40), U8(41), U8(41), U8(42), U8(42), U8(43), U8(43),
  86541 	U8(44), U8(44), U8(45), U8(45), U8(46), U8(46), U8(47), U8(47), U8(48), U8(48),
  86542 	U8(49), U8(49), U8(50), U8(50), U8(51), U8(51), U8(52), U8(52), U8(53), U8(53),
  86543 	U8(54), U8(54), U8(55), U8(55), U8(56), U8(56), U8(57), U8(57),
  86544 }
  86545 
  86546 // Return the length of the data corresponding to the supplied serial-type.
  86547 func Xsqlite3VdbeSerialTypeLen(tls *libc.TLS, serial_type U32) U32 {
  86548 	if serial_type >= U32(128) {
  86549 		return (serial_type - U32(12)) / U32(2)
  86550 	} else {
  86551 		return U32(Xsqlite3SmallTypeSizes[serial_type])
  86552 	}
  86553 	return U32(0)
  86554 }
  86555 
  86556 func Xsqlite3VdbeOneByteSerialTypeLen(tls *libc.TLS, serial_type U8) U8 {
  86557 	return Xsqlite3SmallTypeSizes[serial_type]
  86558 }
  86559 
  86560 func serialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) {
  86561 	bp := tls.Alloc(8)
  86562 	defer tls.Free(8)
  86563 
  86564 	*(*U64)(unsafe.Pointer(bp)) = U64(U32(*(*uint8)(unsafe.Pointer(buf)))<<24 | U32(int32(*(*uint8)(unsafe.Pointer(buf + 1)))<<16) | U32(int32(*(*uint8)(unsafe.Pointer(buf + 2)))<<8) | U32(*(*uint8)(unsafe.Pointer(buf + 3))))
  86565 	var y U32 = U32(*(*uint8)(unsafe.Pointer(buf + uintptr(4))))<<24 | U32(int32(*(*uint8)(unsafe.Pointer(buf + uintptr(4) + 1)))<<16) | U32(int32(*(*uint8)(unsafe.Pointer(buf + uintptr(4) + 2)))<<8) | U32(*(*uint8)(unsafe.Pointer(buf + uintptr(4) + 3)))
  86566 	*(*U64)(unsafe.Pointer(bp)) = *(*U64)(unsafe.Pointer(bp))<<32 + U64(y)
  86567 	if serial_type == U32(6) {
  86568 		*(*I64)(unsafe.Pointer(pMem)) = *(*I64)(unsafe.Pointer(bp))
  86569 		(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int)
  86570 
  86571 	} else {
  86572 		libc.Xmemcpy(tls, pMem, bp, uint64(unsafe.Sizeof(U64(0))))
  86573 		(*Mem)(unsafe.Pointer(pMem)).Fflags = func() uint16 {
  86574 			if *(*U64)(unsafe.Pointer(bp))&(uint64(0x7ff)<<52) == uint64(0x7ff)<<52 && *(*U64)(unsafe.Pointer(bp))&(uint64(1)<<52-uint64(1)) != uint64(0) {
  86575 				return uint16(MEM_Null)
  86576 			}
  86577 			return uint16(MEM_Real)
  86578 		}()
  86579 	}
  86580 }
  86581 
  86582 func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) {
  86583 	switch serial_type {
  86584 	case U32(10):
  86585 		{
  86586 			(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Null | MEM_Zero)
  86587 			(*Mem)(unsafe.Pointer(pMem)).Fn = 0
  86588 			*(*int32)(unsafe.Pointer(pMem)) = 0
  86589 			return
  86590 
  86591 		}
  86592 	case U32(11):
  86593 		fallthrough
  86594 	case U32(0):
  86595 		{
  86596 			(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Null)
  86597 			return
  86598 
  86599 		}
  86600 	case U32(1):
  86601 		{
  86602 			*(*I64)(unsafe.Pointer(pMem)) = I64(I8(*(*uint8)(unsafe.Pointer(buf))))
  86603 			(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int)
  86604 
  86605 			return
  86606 
  86607 		}
  86608 	case U32(2):
  86609 		{
  86610 			*(*I64)(unsafe.Pointer(pMem)) = I64(256*int32(I8(*(*uint8)(unsafe.Pointer(buf)))) | int32(*(*uint8)(unsafe.Pointer(buf + 1))))
  86611 			(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int)
  86612 
  86613 			return
  86614 
  86615 		}
  86616 	case U32(3):
  86617 		{
  86618 			*(*I64)(unsafe.Pointer(pMem)) = I64(65536*int32(I8(*(*uint8)(unsafe.Pointer(buf)))) | int32(*(*uint8)(unsafe.Pointer(buf + 1)))<<8 | int32(*(*uint8)(unsafe.Pointer(buf + 2))))
  86619 			(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int)
  86620 
  86621 			return
  86622 
  86623 		}
  86624 	case U32(4):
  86625 		{
  86626 			*(*I64)(unsafe.Pointer(pMem)) = I64(16777216*int32(I8(*(*uint8)(unsafe.Pointer(buf)))) | int32(*(*uint8)(unsafe.Pointer(buf + 1)))<<16 | int32(*(*uint8)(unsafe.Pointer(buf + 2)))<<8 | int32(*(*uint8)(unsafe.Pointer(buf + 3))))
  86627 			(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int)
  86628 
  86629 			return
  86630 
  86631 		}
  86632 	case U32(5):
  86633 		{
  86634 			*(*I64)(unsafe.Pointer(pMem)) = I64(U32(*(*uint8)(unsafe.Pointer(buf + uintptr(2))))<<24|U32(int32(*(*uint8)(unsafe.Pointer(buf + uintptr(2) + 1)))<<16)|U32(int32(*(*uint8)(unsafe.Pointer(buf + uintptr(2) + 2)))<<8)|U32(*(*uint8)(unsafe.Pointer(buf + uintptr(2) + 3)))) + int64(1)<<32*I64(256*int32(I8(*(*uint8)(unsafe.Pointer(buf))))|int32(*(*uint8)(unsafe.Pointer(buf + 1))))
  86635 			(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int)
  86636 
  86637 			return
  86638 
  86639 		}
  86640 	case U32(6):
  86641 		fallthrough
  86642 	case U32(7):
  86643 		{
  86644 			serialGet(tls, buf, serial_type, pMem)
  86645 			return
  86646 
  86647 		}
  86648 	case U32(8):
  86649 		fallthrough
  86650 	case U32(9):
  86651 		{
  86652 			*(*I64)(unsafe.Pointer(pMem)) = I64(serial_type - U32(8))
  86653 			(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int)
  86654 			return
  86655 
  86656 		}
  86657 	default:
  86658 		{
  86659 			(*Mem)(unsafe.Pointer(pMem)).Fz = buf
  86660 			(*Mem)(unsafe.Pointer(pMem)).Fn = int32((serial_type - U32(12)) / U32(2))
  86661 			(*Mem)(unsafe.Pointer(pMem)).Fflags = aFlag[serial_type&U32(1)]
  86662 			return
  86663 
  86664 		}
  86665 	}
  86666 	return
  86667 }
  86668 
  86669 var aFlag = [2]U16{U16(MEM_Blob | MEM_Ephem), U16(MEM_Str | MEM_Ephem)}
  86670 
  86671 // This routine is used to allocate sufficient space for an UnpackedRecord
  86672 // structure large enough to be used with sqlite3VdbeRecordUnpack() if
  86673 // the first argument is a pointer to KeyInfo structure pKeyInfo.
  86674 //
  86675 // The space is either allocated using sqlite3DbMallocRaw() or from within
  86676 // the unaligned buffer passed via the second and third arguments (presumably
  86677 // stack space). If the former, then *ppFree is set to a pointer that should
  86678 // be eventually freed by the caller using sqlite3DbFree(). Or, if the
  86679 // allocation comes from the pSpace/szSpace buffer, *ppFree is set to NULL
  86680 // before returning.
  86681 //
  86682 // If an OOM error occurs, NULL is returned.
  86683 func Xsqlite3VdbeAllocUnpackedRecord(tls *libc.TLS, pKeyInfo uintptr) uintptr {
  86684 	var p uintptr
  86685 	var nByte int32
  86686 	nByte = int32(uint64(unsafe.Sizeof(UnpackedRecord{})) + uint64(unsafe.Sizeof(Mem{}))*uint64(int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)+1))
  86687 	p = Xsqlite3DbMallocRaw(tls, (*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fdb, uint64(nByte))
  86688 	if !(p != 0) {
  86689 		return uintptr(0)
  86690 	}
  86691 	(*UnpackedRecord)(unsafe.Pointer(p)).FaMem = p + 40
  86692 
  86693 	(*UnpackedRecord)(unsafe.Pointer(p)).FpKeyInfo = pKeyInfo
  86694 	(*UnpackedRecord)(unsafe.Pointer(p)).FnField = U16(int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField) + 1)
  86695 	return p
  86696 }
  86697 
  86698 // Given the nKey-byte encoding of a record in pKey[], populate the
  86699 // UnpackedRecord structure indicated by the fourth argument with the
  86700 // contents of the decoded record.
  86701 func Xsqlite3VdbeRecordUnpack(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey uintptr, p uintptr) {
  86702 	bp := tls.Alloc(8)
  86703 	defer tls.Free(8)
  86704 
  86705 	var aKey uintptr = pKey
  86706 	var d U32
  86707 	var idx U32
  86708 	var u U16
  86709 
  86710 	var pMem uintptr = (*UnpackedRecord)(unsafe.Pointer(p)).FaMem
  86711 
  86712 	(*UnpackedRecord)(unsafe.Pointer(p)).Fdefault_rc = int8(0)
  86713 
  86714 	idx = U32(func() uint8 {
  86715 		if int32(*(*uint8)(unsafe.Pointer(aKey))) < int32(U8(0x80)) {
  86716 			return uint8(func() int32 { *(*U32)(unsafe.Pointer(bp)) = U32(*(*uint8)(unsafe.Pointer(aKey))); return 1 }())
  86717 		}
  86718 		return Xsqlite3GetVarint32(tls, aKey, bp)
  86719 	}())
  86720 	d = *(*U32)(unsafe.Pointer(bp))
  86721 	u = U16(0)
  86722 	for idx < *(*U32)(unsafe.Pointer(bp)) && d <= U32(nKey) {
  86723 		idx = idx + U32(func() uint8 {
  86724 			if int32(*(*uint8)(unsafe.Pointer(aKey + uintptr(idx)))) < int32(U8(0x80)) {
  86725 				return uint8(func() int32 {
  86726 					*(*U32)(unsafe.Pointer(bp + 4)) = U32(*(*uint8)(unsafe.Pointer(aKey + uintptr(idx))))
  86727 					return 1
  86728 				}())
  86729 			}
  86730 			return Xsqlite3GetVarint32(tls, aKey+uintptr(idx), bp+4)
  86731 		}())
  86732 		(*Mem)(unsafe.Pointer(pMem)).Fenc = (*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fenc
  86733 		(*Mem)(unsafe.Pointer(pMem)).Fdb = (*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fdb
  86734 
  86735 		(*Mem)(unsafe.Pointer(pMem)).FszMalloc = 0
  86736 		(*Mem)(unsafe.Pointer(pMem)).Fz = uintptr(0)
  86737 		Xsqlite3VdbeSerialGet(tls, aKey+uintptr(d), *(*U32)(unsafe.Pointer(bp + 4)), pMem)
  86738 		d = d + Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp + 4)))
  86739 		pMem += 56
  86740 		if int32(libc.PreIncUint16(&u, 1)) >= int32((*UnpackedRecord)(unsafe.Pointer(p)).FnField) {
  86741 			break
  86742 		}
  86743 	}
  86744 	if d > U32(nKey) && u != 0 {
  86745 		Xsqlite3VdbeMemSetNull(tls, pMem-uintptr(1)*56)
  86746 	}
  86747 
  86748 	(*UnpackedRecord)(unsafe.Pointer(p)).FnField = u
  86749 }
  86750 
  86751 func vdbeCompareMemString(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintptr, prcErr uintptr) int32 {
  86752 	bp := tls.Alloc(112)
  86753 	defer tls.Free(112)
  86754 
  86755 	if int32((*Mem)(unsafe.Pointer(pMem1)).Fenc) == int32((*CollSeq)(unsafe.Pointer(pColl)).Fenc) {
  86756 		return (*struct {
  86757 			f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
  86758 		})(unsafe.Pointer(&struct{ uintptr }{(*CollSeq)(unsafe.Pointer(pColl)).FxCmp})).f(tls, (*CollSeq)(unsafe.Pointer(pColl)).FpUser, (*Mem)(unsafe.Pointer(pMem1)).Fn, (*Mem)(unsafe.Pointer(pMem1)).Fz, (*Mem)(unsafe.Pointer(pMem2)).Fn, (*Mem)(unsafe.Pointer(pMem2)).Fz)
  86759 	} else {
  86760 		var rc int32
  86761 		var v1 uintptr
  86762 		var v2 uintptr
  86763 
  86764 		Xsqlite3VdbeMemInit(tls, bp, (*Mem)(unsafe.Pointer(pMem1)).Fdb, uint16(MEM_Null))
  86765 		Xsqlite3VdbeMemInit(tls, bp+56, (*Mem)(unsafe.Pointer(pMem1)).Fdb, uint16(MEM_Null))
  86766 		Xsqlite3VdbeMemShallowCopy(tls, bp, pMem1, MEM_Ephem)
  86767 		Xsqlite3VdbeMemShallowCopy(tls, bp+56, pMem2, MEM_Ephem)
  86768 		v1 = Xsqlite3ValueText(tls, bp, (*CollSeq)(unsafe.Pointer(pColl)).Fenc)
  86769 		v2 = Xsqlite3ValueText(tls, bp+56, (*CollSeq)(unsafe.Pointer(pColl)).Fenc)
  86770 		if v1 == uintptr(0) || v2 == uintptr(0) {
  86771 			if prcErr != 0 {
  86772 				*(*U8)(unsafe.Pointer(prcErr)) = U8(SQLITE_NOMEM)
  86773 			}
  86774 			rc = 0
  86775 		} else {
  86776 			rc = (*struct {
  86777 				f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
  86778 			})(unsafe.Pointer(&struct{ uintptr }{(*CollSeq)(unsafe.Pointer(pColl)).FxCmp})).f(tls, (*CollSeq)(unsafe.Pointer(pColl)).FpUser, (*Mem)(unsafe.Pointer(bp)).Fn, v1, (*Mem)(unsafe.Pointer(bp+56)).Fn, v2)
  86779 		}
  86780 		Xsqlite3VdbeMemReleaseMalloc(tls, bp)
  86781 		Xsqlite3VdbeMemReleaseMalloc(tls, bp+56)
  86782 		return rc
  86783 	}
  86784 	return int32(0)
  86785 }
  86786 
  86787 func isAllZero(tls *libc.TLS, z uintptr, n int32) int32 {
  86788 	var i int32
  86789 	for i = 0; i < n; i++ {
  86790 		if *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0 {
  86791 			return 0
  86792 		}
  86793 	}
  86794 	return 1
  86795 }
  86796 
  86797 // Compare two blobs.  Return negative, zero, or positive if the first
  86798 // is less than, equal to, or greater than the second, respectively.
  86799 // If one blob is a prefix of the other, then the shorter is the lessor.
  86800 func Xsqlite3BlobCompare(tls *libc.TLS, pB1 uintptr, pB2 uintptr) int32 {
  86801 	var c int32
  86802 	var n1 int32 = (*Mem)(unsafe.Pointer(pB1)).Fn
  86803 	var n2 int32 = (*Mem)(unsafe.Pointer(pB2)).Fn
  86804 
  86805 	if (int32((*Mem)(unsafe.Pointer(pB1)).Fflags)|int32((*Mem)(unsafe.Pointer(pB2)).Fflags))&MEM_Zero != 0 {
  86806 		if int32((*Mem)(unsafe.Pointer(pB1)).Fflags)&int32((*Mem)(unsafe.Pointer(pB2)).Fflags)&MEM_Zero != 0 {
  86807 			return *(*int32)(unsafe.Pointer(pB1)) - *(*int32)(unsafe.Pointer(pB2))
  86808 		} else if int32((*Mem)(unsafe.Pointer(pB1)).Fflags)&MEM_Zero != 0 {
  86809 			if !(isAllZero(tls, (*Mem)(unsafe.Pointer(pB2)).Fz, (*Mem)(unsafe.Pointer(pB2)).Fn) != 0) {
  86810 				return -1
  86811 			}
  86812 			return *(*int32)(unsafe.Pointer(pB1)) - n2
  86813 		} else {
  86814 			if !(isAllZero(tls, (*Mem)(unsafe.Pointer(pB1)).Fz, (*Mem)(unsafe.Pointer(pB1)).Fn) != 0) {
  86815 				return +1
  86816 			}
  86817 			return n1 - *(*int32)(unsafe.Pointer(pB2))
  86818 		}
  86819 	}
  86820 	c = libc.Xmemcmp(tls, (*Mem)(unsafe.Pointer(pB1)).Fz, (*Mem)(unsafe.Pointer(pB2)).Fz, func() uint64 {
  86821 		if n1 > n2 {
  86822 			return uint64(n2)
  86823 		}
  86824 		return uint64(n1)
  86825 	}())
  86826 	if c != 0 {
  86827 		return c
  86828 	}
  86829 	return n1 - n2
  86830 }
  86831 
  86832 // Do a comparison between a 64-bit signed integer and a 64-bit floating-point
  86833 // number.  Return negative, zero, or positive if the first (i64) is less than,
  86834 // equal to, or greater than the second (double).
  86835 func Xsqlite3IntFloatCompare(tls *libc.TLS, i I64, r float64) int32 {
  86836 	if uint64(unsafe.Sizeof(float64(0))) > uint64(8) {
  86837 		var x float64 = float64(i)
  86838 
  86839 		if x < r {
  86840 			return -1
  86841 		}
  86842 		if x > r {
  86843 			return +1
  86844 		}
  86845 		return 0
  86846 	} else {
  86847 		var y I64
  86848 		var s float64
  86849 		if r < -9223372036854775808.0 {
  86850 			return +1
  86851 		}
  86852 		if r >= 9223372036854775808.0 {
  86853 			return -1
  86854 		}
  86855 		y = I64(r)
  86856 		if i < y {
  86857 			return -1
  86858 		}
  86859 		if i > y {
  86860 			return +1
  86861 		}
  86862 		s = float64(i)
  86863 		if s < r {
  86864 			return -1
  86865 		}
  86866 		if s > r {
  86867 			return +1
  86868 		}
  86869 		return 0
  86870 	}
  86871 	return int32(0)
  86872 }
  86873 
  86874 // Compare the values contained by the two memory cells, returning
  86875 // negative, zero or positive if pMem1 is less than, equal to, or greater
  86876 // than pMem2. Sorting order is NULL's first, followed by numbers (integers
  86877 // and reals) sorted numerically, followed by text ordered by the collating
  86878 // sequence pColl and finally blob's ordered by memcmp().
  86879 //
  86880 // Two NULL values are considered equal by this function.
  86881 func Xsqlite3MemCompare(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintptr) int32 {
  86882 	var f1 int32
  86883 	var f2 int32
  86884 	var combined_flags int32
  86885 
  86886 	f1 = int32((*Mem)(unsafe.Pointer(pMem1)).Fflags)
  86887 	f2 = int32((*Mem)(unsafe.Pointer(pMem2)).Fflags)
  86888 	combined_flags = f1 | f2
  86889 
  86890 	if combined_flags&MEM_Null != 0 {
  86891 		return f2&MEM_Null - f1&MEM_Null
  86892 	}
  86893 
  86894 	if combined_flags&(MEM_Int|MEM_Real|MEM_IntReal) != 0 {
  86895 		if f1&f2&(MEM_Int|MEM_IntReal) != 0 {
  86896 			if *(*I64)(unsafe.Pointer(pMem1)) < *(*I64)(unsafe.Pointer(pMem2)) {
  86897 				return -1
  86898 			}
  86899 			if *(*I64)(unsafe.Pointer(pMem1)) > *(*I64)(unsafe.Pointer(pMem2)) {
  86900 				return +1
  86901 			}
  86902 			return 0
  86903 		}
  86904 		if f1&f2&MEM_Real != 0 {
  86905 			if *(*float64)(unsafe.Pointer(pMem1)) < *(*float64)(unsafe.Pointer(pMem2)) {
  86906 				return -1
  86907 			}
  86908 			if *(*float64)(unsafe.Pointer(pMem1)) > *(*float64)(unsafe.Pointer(pMem2)) {
  86909 				return +1
  86910 			}
  86911 			return 0
  86912 		}
  86913 		if f1&(MEM_Int|MEM_IntReal) != 0 {
  86914 			if f2&MEM_Real != 0 {
  86915 				return Xsqlite3IntFloatCompare(tls, *(*I64)(unsafe.Pointer(pMem1)), *(*float64)(unsafe.Pointer(pMem2)))
  86916 			} else if f2&(MEM_Int|MEM_IntReal) != 0 {
  86917 				if *(*I64)(unsafe.Pointer(pMem1)) < *(*I64)(unsafe.Pointer(pMem2)) {
  86918 					return -1
  86919 				}
  86920 				if *(*I64)(unsafe.Pointer(pMem1)) > *(*I64)(unsafe.Pointer(pMem2)) {
  86921 					return +1
  86922 				}
  86923 				return 0
  86924 			} else {
  86925 				return -1
  86926 			}
  86927 		}
  86928 		if f1&MEM_Real != 0 {
  86929 			if f2&(MEM_Int|MEM_IntReal) != 0 {
  86930 				return -Xsqlite3IntFloatCompare(tls, *(*I64)(unsafe.Pointer(pMem2)), *(*float64)(unsafe.Pointer(pMem1)))
  86931 			} else {
  86932 				return -1
  86933 			}
  86934 		}
  86935 		return +1
  86936 	}
  86937 
  86938 	if combined_flags&MEM_Str != 0 {
  86939 		if f1&MEM_Str == 0 {
  86940 			return 1
  86941 		}
  86942 		if f2&MEM_Str == 0 {
  86943 			return -1
  86944 		}
  86945 
  86946 		if pColl != 0 {
  86947 			return vdbeCompareMemString(tls, pMem1, pMem2, pColl, uintptr(0))
  86948 		}
  86949 
  86950 	}
  86951 
  86952 	return Xsqlite3BlobCompare(tls, pMem1, pMem2)
  86953 }
  86954 
  86955 func vdbeRecordDecodeInt(tls *libc.TLS, serial_type U32, aKey uintptr) I64 {
  86956 	bp := tls.Alloc(16)
  86957 	defer tls.Free(16)
  86958 
  86959 	switch serial_type {
  86960 	case U32(0):
  86961 		fallthrough
  86962 	case U32(1):
  86963 		return I64(I8(*(*U8)(unsafe.Pointer(aKey))))
  86964 	case U32(2):
  86965 		return I64(256*int32(I8(*(*U8)(unsafe.Pointer(aKey)))) | int32(*(*U8)(unsafe.Pointer(aKey + 1))))
  86966 	case U32(3):
  86967 		return I64(65536*int32(I8(*(*U8)(unsafe.Pointer(aKey)))) | int32(*(*U8)(unsafe.Pointer(aKey + 1)))<<8 | int32(*(*U8)(unsafe.Pointer(aKey + 2))))
  86968 	case U32(4):
  86969 		{
  86970 			*(*U32)(unsafe.Pointer(bp)) = U32(*(*U8)(unsafe.Pointer(aKey)))<<24 | U32(int32(*(*U8)(unsafe.Pointer(aKey + 1)))<<16) | U32(int32(*(*U8)(unsafe.Pointer(aKey + 2)))<<8) | U32(*(*U8)(unsafe.Pointer(aKey + 3)))
  86971 			return I64(*(*int32)(unsafe.Pointer(bp)))
  86972 
  86973 		}
  86974 	case U32(5):
  86975 		{
  86976 			return I64(U32(*(*U8)(unsafe.Pointer(aKey + uintptr(2))))<<24|U32(int32(*(*U8)(unsafe.Pointer(aKey + uintptr(2) + 1)))<<16)|U32(int32(*(*U8)(unsafe.Pointer(aKey + uintptr(2) + 2)))<<8)|U32(*(*U8)(unsafe.Pointer(aKey + uintptr(2) + 3)))) + int64(1)<<32*I64(256*int32(I8(*(*U8)(unsafe.Pointer(aKey))))|int32(*(*U8)(unsafe.Pointer(aKey + 1))))
  86977 
  86978 		}
  86979 	case U32(6):
  86980 		{
  86981 			*(*U64)(unsafe.Pointer(bp + 8)) = U64(U32(*(*U8)(unsafe.Pointer(aKey)))<<24 | U32(int32(*(*U8)(unsafe.Pointer(aKey + 1)))<<16) | U32(int32(*(*U8)(unsafe.Pointer(aKey + 2)))<<8) | U32(*(*U8)(unsafe.Pointer(aKey + 3))))
  86982 
  86983 			*(*U64)(unsafe.Pointer(bp + 8)) = *(*U64)(unsafe.Pointer(bp + 8))<<32 | U64(U32(*(*U8)(unsafe.Pointer(aKey + uintptr(4))))<<24|U32(int32(*(*U8)(unsafe.Pointer(aKey + uintptr(4) + 1)))<<16)|U32(int32(*(*U8)(unsafe.Pointer(aKey + uintptr(4) + 2)))<<8)|U32(*(*U8)(unsafe.Pointer(aKey + uintptr(4) + 3))))
  86984 			return *(*I64)(unsafe.Pointer(bp + 8))
  86985 
  86986 		}
  86987 	}
  86988 
  86989 	return I64(serial_type - U32(8))
  86990 }
  86991 
  86992 // This function compares the two table rows or index records
  86993 // specified by {nKey1, pKey1} and pPKey2.  It returns a negative, zero
  86994 // or positive integer if key1 is less than, equal to or
  86995 // greater than key2.  The {nKey1, pKey1} key must be a blob
  86996 // created by the OP_MakeRecord opcode of the VDBE.  The pPKey2
  86997 // key must be a parsed key such as obtained from
  86998 // sqlite3VdbeParseRecord.
  86999 //
  87000 // If argument bSkip is non-zero, it is assumed that the caller has already
  87001 // determined that the first fields of the keys are equal.
  87002 //
  87003 // Key1 and Key2 do not have to contain the same number of fields. If all
  87004 // fields that appear in both keys are equal, then pPKey2->default_rc is
  87005 // returned.
  87006 //
  87007 // If database corruption is discovered, set pPKey2->errCode to
  87008 // SQLITE_CORRUPT and return 0. If an OOM error is encountered,
  87009 // pPKey2->errCode is set to SQLITE_NOMEM and, if it is not NULL, the
  87010 // malloc-failed flag set on database handle (pPKey2->pKeyInfo->db).
  87011 func Xsqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr, bSkip int32) int32 {
  87012 	bp := tls.Alloc(68)
  87013 	defer tls.Free(68)
  87014 
  87015 	var d1 U32
  87016 	var i int32
  87017 
  87018 	var idx1 U32
  87019 	var rc int32 = 0
  87020 	var pRhs uintptr = (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FaMem
  87021 	var pKeyInfo uintptr
  87022 	var aKey1 uintptr = pKey1
  87023 
  87024 	if bSkip != 0 {
  87025 		*(*U32)(unsafe.Pointer(bp)) = U32(*(*uint8)(unsafe.Pointer(aKey1 + 1)))
  87026 		if *(*U32)(unsafe.Pointer(bp)) < U32(0x80) {
  87027 			idx1 = U32(2)
  87028 		} else {
  87029 			idx1 = U32(1 + int32(Xsqlite3GetVarint32(tls, aKey1+1, bp)))
  87030 		}
  87031 		*(*U32)(unsafe.Pointer(bp + 4)) = U32(*(*uint8)(unsafe.Pointer(aKey1)))
  87032 		d1 = *(*U32)(unsafe.Pointer(bp + 4)) + Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp)))
  87033 		i = 1
  87034 		pRhs += 56
  87035 	} else {
  87036 		if libc.AssignPtrUint32(bp+4, U32(*(*uint8)(unsafe.Pointer(aKey1)))) < U32(0x80) {
  87037 			idx1 = U32(1)
  87038 		} else {
  87039 			idx1 = U32(Xsqlite3GetVarint32(tls, aKey1, bp+4))
  87040 		}
  87041 		d1 = *(*U32)(unsafe.Pointer(bp + 4))
  87042 		i = 0
  87043 	}
  87044 	if d1 > uint32(nKey1) {
  87045 		(*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 86989))
  87046 		return 0
  87047 	}
  87048 
  87049 	for 1 != 0 {
  87050 		if int32((*Mem)(unsafe.Pointer(pRhs)).Fflags)&(MEM_Int|MEM_IntReal) != 0 {
  87051 			*(*U32)(unsafe.Pointer(bp + 64)) = U32(*(*uint8)(unsafe.Pointer(aKey1 + uintptr(idx1))))
  87052 
  87053 			if *(*U32)(unsafe.Pointer(bp + 64)) >= U32(10) {
  87054 				if *(*U32)(unsafe.Pointer(bp + 64)) == U32(10) {
  87055 					rc = -1
  87056 				} else {
  87057 					rc = +1
  87058 				}
  87059 			} else if *(*U32)(unsafe.Pointer(bp + 64)) == U32(0) {
  87060 				rc = -1
  87061 			} else if *(*U32)(unsafe.Pointer(bp + 64)) == U32(7) {
  87062 				Xsqlite3VdbeSerialGet(tls, aKey1+uintptr(d1), *(*U32)(unsafe.Pointer(bp + 64)), bp+8)
  87063 				rc = -Xsqlite3IntFloatCompare(tls, *(*I64)(unsafe.Pointer(pRhs)), *(*float64)(unsafe.Pointer(bp + 8)))
  87064 			} else {
  87065 				var lhs I64 = vdbeRecordDecodeInt(tls, *(*U32)(unsafe.Pointer(bp + 64)), aKey1+uintptr(d1))
  87066 				var rhs I64 = *(*I64)(unsafe.Pointer(pRhs))
  87067 				if lhs < rhs {
  87068 					rc = -1
  87069 				} else if lhs > rhs {
  87070 					rc = +1
  87071 				}
  87072 			}
  87073 		} else if int32((*Mem)(unsafe.Pointer(pRhs)).Fflags)&MEM_Real != 0 {
  87074 			*(*U32)(unsafe.Pointer(bp + 64)) = U32(*(*uint8)(unsafe.Pointer(aKey1 + uintptr(idx1))))
  87075 			if *(*U32)(unsafe.Pointer(bp + 64)) >= U32(10) {
  87076 				if *(*U32)(unsafe.Pointer(bp + 64)) == U32(10) {
  87077 					rc = -1
  87078 				} else {
  87079 					rc = +1
  87080 				}
  87081 			} else if *(*U32)(unsafe.Pointer(bp + 64)) == U32(0) {
  87082 				rc = -1
  87083 			} else {
  87084 				Xsqlite3VdbeSerialGet(tls, aKey1+uintptr(d1), *(*U32)(unsafe.Pointer(bp + 64)), bp+8)
  87085 				if *(*U32)(unsafe.Pointer(bp + 64)) == U32(7) {
  87086 					if *(*float64)(unsafe.Pointer(bp + 8)) < *(*float64)(unsafe.Pointer(pRhs)) {
  87087 						rc = -1
  87088 					} else if *(*float64)(unsafe.Pointer(bp + 8)) > *(*float64)(unsafe.Pointer(pRhs)) {
  87089 						rc = +1
  87090 					}
  87091 				} else {
  87092 					rc = Xsqlite3IntFloatCompare(tls, *(*I64)(unsafe.Pointer(bp + 8)), *(*float64)(unsafe.Pointer(pRhs)))
  87093 				}
  87094 			}
  87095 		} else if int32((*Mem)(unsafe.Pointer(pRhs)).Fflags)&MEM_Str != 0 {
  87096 			*(*U32)(unsafe.Pointer(bp + 64)) = U32(*(*uint8)(unsafe.Pointer(aKey1 + uintptr(idx1))))
  87097 			if *(*U32)(unsafe.Pointer(bp + 64)) >= U32(0x80) {
  87098 				Xsqlite3GetVarint32(tls, aKey1+uintptr(idx1), bp+64)
  87099 			}
  87100 
  87101 			if *(*U32)(unsafe.Pointer(bp + 64)) < U32(12) {
  87102 				rc = -1
  87103 			} else if !(*(*U32)(unsafe.Pointer(bp + 64))&U32(0x01) != 0) {
  87104 				rc = +1
  87105 			} else {
  87106 				(*Mem)(unsafe.Pointer(bp + 8)).Fn = int32((*(*U32)(unsafe.Pointer(bp + 64)) - U32(12)) / U32(2))
  87107 
  87108 				if d1+U32((*Mem)(unsafe.Pointer(bp+8)).Fn) > uint32(nKey1) ||
  87109 					int32((*KeyInfo)(unsafe.Pointer(libc.AssignUintptr(&pKeyInfo, (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FpKeyInfo))).FnAllField) <= i {
  87110 					(*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 87066))
  87111 					return 0
  87112 				} else if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 {
  87113 					(*Mem)(unsafe.Pointer(bp + 8)).Fenc = (*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fenc
  87114 					(*Mem)(unsafe.Pointer(bp + 8)).Fdb = (*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fdb
  87115 					(*Mem)(unsafe.Pointer(bp + 8)).Fflags = U16(MEM_Str)
  87116 					(*Mem)(unsafe.Pointer(bp + 8)).Fz = aKey1 + uintptr(d1)
  87117 					rc = vdbeCompareMemString(tls,
  87118 						bp+8, pRhs, *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)), pPKey2+31)
  87119 				} else {
  87120 					var nCmp int32 = func() int32 {
  87121 						if (*Mem)(unsafe.Pointer(bp+8)).Fn < (*Mem)(unsafe.Pointer(pRhs)).Fn {
  87122 							return (*Mem)(unsafe.Pointer(bp + 8)).Fn
  87123 						}
  87124 						return (*Mem)(unsafe.Pointer(pRhs)).Fn
  87125 					}()
  87126 					rc = libc.Xmemcmp(tls, aKey1+uintptr(d1), (*Mem)(unsafe.Pointer(pRhs)).Fz, uint64(nCmp))
  87127 					if rc == 0 {
  87128 						rc = (*Mem)(unsafe.Pointer(bp+8)).Fn - (*Mem)(unsafe.Pointer(pRhs)).Fn
  87129 					}
  87130 				}
  87131 			}
  87132 		} else if int32((*Mem)(unsafe.Pointer(pRhs)).Fflags)&MEM_Blob != 0 {
  87133 			*(*U32)(unsafe.Pointer(bp + 64)) = U32(*(*uint8)(unsafe.Pointer(aKey1 + uintptr(idx1))))
  87134 			if *(*U32)(unsafe.Pointer(bp + 64)) >= U32(0x80) {
  87135 				Xsqlite3GetVarint32(tls, aKey1+uintptr(idx1), bp+64)
  87136 			}
  87137 
  87138 			if *(*U32)(unsafe.Pointer(bp + 64)) < U32(12) || *(*U32)(unsafe.Pointer(bp + 64))&U32(0x01) != 0 {
  87139 				rc = -1
  87140 			} else {
  87141 				var nStr int32 = int32((*(*U32)(unsafe.Pointer(bp + 64)) - U32(12)) / U32(2))
  87142 
  87143 				if d1+U32(nStr) > uint32(nKey1) {
  87144 					(*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 87096))
  87145 					return 0
  87146 				} else if int32((*Mem)(unsafe.Pointer(pRhs)).Fflags)&MEM_Zero != 0 {
  87147 					if !(isAllZero(tls, aKey1+uintptr(d1), nStr) != 0) {
  87148 						rc = 1
  87149 					} else {
  87150 						rc = nStr - *(*int32)(unsafe.Pointer(pRhs))
  87151 					}
  87152 				} else {
  87153 					var nCmp int32 = func() int32 {
  87154 						if nStr < (*Mem)(unsafe.Pointer(pRhs)).Fn {
  87155 							return nStr
  87156 						}
  87157 						return (*Mem)(unsafe.Pointer(pRhs)).Fn
  87158 					}()
  87159 					rc = libc.Xmemcmp(tls, aKey1+uintptr(d1), (*Mem)(unsafe.Pointer(pRhs)).Fz, uint64(nCmp))
  87160 					if rc == 0 {
  87161 						rc = nStr - (*Mem)(unsafe.Pointer(pRhs)).Fn
  87162 					}
  87163 				}
  87164 			}
  87165 		} else {
  87166 			*(*U32)(unsafe.Pointer(bp + 64)) = U32(*(*uint8)(unsafe.Pointer(aKey1 + uintptr(idx1))))
  87167 			rc = libc.Bool32(*(*U32)(unsafe.Pointer(bp + 64)) != U32(0) && *(*U32)(unsafe.Pointer(bp + 64)) != U32(10))
  87168 		}
  87169 
  87170 		if rc != 0 {
  87171 			var sortFlags int32 = int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pPKey2)).FpKeyInfo)).FaSortFlags + uintptr(i))))
  87172 			if sortFlags != 0 {
  87173 				if sortFlags&KEYINFO_ORDER_BIGNULL == 0 ||
  87174 					sortFlags&KEYINFO_ORDER_DESC !=
  87175 						libc.Bool32(*(*U32)(unsafe.Pointer(bp + 64)) == U32(0) || int32((*Mem)(unsafe.Pointer(pRhs)).Fflags)&MEM_Null != 0) {
  87176 					rc = -rc
  87177 				}
  87178 			}
  87179 
  87180 			return rc
  87181 		}
  87182 
  87183 		i++
  87184 		if i == int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).FnField) {
  87185 			break
  87186 		}
  87187 		pRhs += 56
  87188 		d1 = d1 + Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp + 64)))
  87189 		if d1 > uint32(nKey1) {
  87190 			break
  87191 		}
  87192 		idx1 = idx1 + U32(Xsqlite3VarintLen(tls, uint64(*(*U32)(unsafe.Pointer(bp + 64)))))
  87193 		if idx1 >= *(*U32)(unsafe.Pointer(bp + 4)) {
  87194 			(*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 87140))
  87195 			return 0
  87196 		}
  87197 	}
  87198 
  87199 	(*UnpackedRecord)(unsafe.Pointer(pPKey2)).FeqSeen = U8(1)
  87200 	return int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fdefault_rc)
  87201 }
  87202 
  87203 func Xsqlite3VdbeRecordCompare(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 {
  87204 	return Xsqlite3VdbeRecordCompareWithSkip(tls, nKey1, pKey1, pPKey2, 0)
  87205 }
  87206 
  87207 func vdbeRecordCompareInt(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 {
  87208 	bp := tls.Alloc(16)
  87209 	defer tls.Free(16)
  87210 
  87211 	var aKey uintptr = pKey1 + uintptr(int32(*(*U8)(unsafe.Pointer(pKey1)))&0x3F)
  87212 	var serial_type int32 = int32(*(*U8)(unsafe.Pointer(pKey1 + 1)))
  87213 	var res int32
  87214 
  87215 	var v I64
  87216 	var lhs I64
  87217 
  87218 	switch serial_type {
  87219 	case 1:
  87220 		{
  87221 			lhs = I64(I8(*(*U8)(unsafe.Pointer(aKey))))
  87222 
  87223 			break
  87224 
  87225 		}
  87226 	case 2:
  87227 		{
  87228 			lhs = I64(256*int32(I8(*(*U8)(unsafe.Pointer(aKey)))) | int32(*(*U8)(unsafe.Pointer(aKey + 1))))
  87229 
  87230 			break
  87231 
  87232 		}
  87233 	case 3:
  87234 		{
  87235 			lhs = I64(65536*int32(I8(*(*U8)(unsafe.Pointer(aKey)))) | int32(*(*U8)(unsafe.Pointer(aKey + 1)))<<8 | int32(*(*U8)(unsafe.Pointer(aKey + 2))))
  87236 
  87237 			break
  87238 
  87239 		}
  87240 	case 4:
  87241 		{
  87242 			*(*U32)(unsafe.Pointer(bp)) = U32(*(*U8)(unsafe.Pointer(aKey)))<<24 | U32(int32(*(*U8)(unsafe.Pointer(aKey + 1)))<<16) | U32(int32(*(*U8)(unsafe.Pointer(aKey + 2)))<<8) | U32(*(*U8)(unsafe.Pointer(aKey + 3)))
  87243 			lhs = I64(*(*int32)(unsafe.Pointer(bp)))
  87244 
  87245 			break
  87246 
  87247 		}
  87248 	case 5:
  87249 		{
  87250 			lhs = I64(U32(*(*U8)(unsafe.Pointer(aKey + uintptr(2))))<<24|U32(int32(*(*U8)(unsafe.Pointer(aKey + uintptr(2) + 1)))<<16)|U32(int32(*(*U8)(unsafe.Pointer(aKey + uintptr(2) + 2)))<<8)|U32(*(*U8)(unsafe.Pointer(aKey + uintptr(2) + 3)))) + int64(1)<<32*I64(256*int32(I8(*(*U8)(unsafe.Pointer(aKey))))|int32(*(*U8)(unsafe.Pointer(aKey + 1))))
  87251 
  87252 			break
  87253 
  87254 		}
  87255 	case 6:
  87256 		{
  87257 			*(*U64)(unsafe.Pointer(bp + 8)) = U64(U32(*(*U8)(unsafe.Pointer(aKey)))<<24 | U32(int32(*(*U8)(unsafe.Pointer(aKey + 1)))<<16) | U32(int32(*(*U8)(unsafe.Pointer(aKey + 2)))<<8) | U32(*(*U8)(unsafe.Pointer(aKey + 3))))
  87258 			*(*U64)(unsafe.Pointer(bp + 8)) = *(*U64)(unsafe.Pointer(bp + 8))<<32 | U64(U32(*(*U8)(unsafe.Pointer(aKey + uintptr(4))))<<24|U32(int32(*(*U8)(unsafe.Pointer(aKey + uintptr(4) + 1)))<<16)|U32(int32(*(*U8)(unsafe.Pointer(aKey + uintptr(4) + 2)))<<8)|U32(*(*U8)(unsafe.Pointer(aKey + uintptr(4) + 3))))
  87259 			lhs = *(*I64)(unsafe.Pointer(bp + 8))
  87260 
  87261 			break
  87262 
  87263 		}
  87264 	case 8:
  87265 		lhs = int64(0)
  87266 		break
  87267 	case 9:
  87268 		lhs = int64(1)
  87269 		break
  87270 
  87271 	case 0:
  87272 		fallthrough
  87273 	case 7:
  87274 		return Xsqlite3VdbeRecordCompare(tls, nKey1, pKey1, pPKey2)
  87275 
  87276 	default:
  87277 		return Xsqlite3VdbeRecordCompare(tls, nKey1, pKey1, pPKey2)
  87278 	}
  87279 
  87280 	v = *(*I64)(unsafe.Pointer(pPKey2 + 16))
  87281 	if v > lhs {
  87282 		res = int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fr1)
  87283 	} else if v < lhs {
  87284 		res = int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fr2)
  87285 	} else if int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).FnField) > 1 {
  87286 		res = Xsqlite3VdbeRecordCompareWithSkip(tls, nKey1, pKey1, pPKey2, 1)
  87287 	} else {
  87288 		res = int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fdefault_rc)
  87289 		(*UnpackedRecord)(unsafe.Pointer(pPKey2)).FeqSeen = U8(1)
  87290 	}
  87291 
  87292 	return res
  87293 }
  87294 
  87295 func vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 {
  87296 	bp := tls.Alloc(4)
  87297 	defer tls.Free(4)
  87298 
  87299 	var aKey1 uintptr
  87300 
  87301 	var res int32
  87302 	var nCmp int32
  87303 	var nStr int32
  87304 	var szHdr int32
  87305 	aKey1 = pKey1
  87306 
  87307 	*(*int32)(unsafe.Pointer(bp)) = int32(int8(*(*U8)(unsafe.Pointer(aKey1 + 1))))
  87308 
  87309 vrcs_restart:
  87310 	if !(*(*int32)(unsafe.Pointer(bp)) < 12) {
  87311 		goto __1
  87312 	}
  87313 	if !(*(*int32)(unsafe.Pointer(bp)) < 0) {
  87314 		goto __3
  87315 	}
  87316 	Xsqlite3GetVarint32(tls, aKey1+1, bp)
  87317 	if !(*(*int32)(unsafe.Pointer(bp)) >= 12) {
  87318 		goto __4
  87319 	}
  87320 	goto vrcs_restart
  87321 __4:
  87322 	;
  87323 __3:
  87324 	;
  87325 	res = int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fr1)
  87326 	goto __2
  87327 __1:
  87328 	if !!(*(*int32)(unsafe.Pointer(bp))&0x01 != 0) {
  87329 		goto __5
  87330 	}
  87331 	res = int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fr2)
  87332 	goto __6
  87333 __5:
  87334 	szHdr = int32(*(*U8)(unsafe.Pointer(aKey1)))
  87335 
  87336 	nStr = (*(*int32)(unsafe.Pointer(bp)) - 12) / 2
  87337 	if !(szHdr+nStr > nKey1) {
  87338 		goto __7
  87339 	}
  87340 	(*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 87303))
  87341 	return 0
  87342 __7:
  87343 	;
  87344 	nCmp = func() int32 {
  87345 		if (*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr {
  87346 			return (*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fn
  87347 		}
  87348 		return nStr
  87349 	}()
  87350 	res = libc.Xmemcmp(tls, aKey1+uintptr(szHdr), *(*uintptr)(unsafe.Pointer(pPKey2 + 16)), uint64(nCmp))
  87351 
  87352 	if !(res > 0) {
  87353 		goto __8
  87354 	}
  87355 	res = int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fr2)
  87356 	goto __9
  87357 __8:
  87358 	if !(res < 0) {
  87359 		goto __10
  87360 	}
  87361 	res = int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fr1)
  87362 	goto __11
  87363 __10:
  87364 	res = nStr - (*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fn
  87365 	if !(res == 0) {
  87366 		goto __12
  87367 	}
  87368 	if !(int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).FnField) > 1) {
  87369 		goto __14
  87370 	}
  87371 	res = Xsqlite3VdbeRecordCompareWithSkip(tls, nKey1, pKey1, pPKey2, 1)
  87372 	goto __15
  87373 __14:
  87374 	res = int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fdefault_rc)
  87375 	(*UnpackedRecord)(unsafe.Pointer(pPKey2)).FeqSeen = U8(1)
  87376 __15:
  87377 	;
  87378 	goto __13
  87379 __12:
  87380 	if !(res > 0) {
  87381 		goto __16
  87382 	}
  87383 	res = int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fr2)
  87384 	goto __17
  87385 __16:
  87386 	res = int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fr1)
  87387 __17:
  87388 	;
  87389 __13:
  87390 	;
  87391 __11:
  87392 	;
  87393 __9:
  87394 	;
  87395 __6:
  87396 	;
  87397 __2:
  87398 	;
  87399 	return res
  87400 }
  87401 
  87402 // Return a pointer to an sqlite3VdbeRecordCompare() compatible function
  87403 // suitable for comparing serialized records to the unpacked record passed
  87404 // as the only argument.
  87405 func Xsqlite3VdbeFindCompare(tls *libc.TLS, p uintptr) RecordCompare {
  87406 	if int32((*KeyInfo)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(p)).FpKeyInfo)).FnAllField) <= 13 {
  87407 		var flags int32 = int32((*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(p)).FaMem)).Fflags)
  87408 		if *(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(p)).FpKeyInfo)).FaSortFlags)) != 0 {
  87409 			if int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(p)).FpKeyInfo)).FaSortFlags)))&KEYINFO_ORDER_BIGNULL != 0 {
  87410 				return *(*uintptr)(unsafe.Pointer(&struct {
  87411 					f func(*libc.TLS, int32, uintptr, uintptr) int32
  87412 				}{Xsqlite3VdbeRecordCompare}))
  87413 			}
  87414 			(*UnpackedRecord)(unsafe.Pointer(p)).Fr1 = int8(1)
  87415 			(*UnpackedRecord)(unsafe.Pointer(p)).Fr2 = int8(-1)
  87416 		} else {
  87417 			(*UnpackedRecord)(unsafe.Pointer(p)).Fr1 = int8(-1)
  87418 			(*UnpackedRecord)(unsafe.Pointer(p)).Fr2 = int8(1)
  87419 		}
  87420 		if flags&MEM_Int != 0 {
  87421 			*(*I64)(unsafe.Pointer(p + 16)) = *(*I64)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(p)).FaMem))
  87422 			return *(*uintptr)(unsafe.Pointer(&struct {
  87423 				f func(*libc.TLS, int32, uintptr, uintptr) int32
  87424 			}{vdbeRecordCompareInt}))
  87425 		}
  87426 
  87427 		if flags&(MEM_Real|MEM_IntReal|MEM_Null|MEM_Blob) == 0 &&
  87428 			*(*uintptr)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(p)).FpKeyInfo + 32)) == uintptr(0) {
  87429 			*(*uintptr)(unsafe.Pointer(p + 16)) = (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(p)).FaMem)).Fz
  87430 			(*UnpackedRecord)(unsafe.Pointer(p)).Fn = (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(p)).FaMem)).Fn
  87431 			return *(*uintptr)(unsafe.Pointer(&struct {
  87432 				f func(*libc.TLS, int32, uintptr, uintptr) int32
  87433 			}{vdbeRecordCompareString}))
  87434 		}
  87435 	}
  87436 
  87437 	return *(*uintptr)(unsafe.Pointer(&struct {
  87438 		f func(*libc.TLS, int32, uintptr, uintptr) int32
  87439 	}{Xsqlite3VdbeRecordCompare}))
  87440 }
  87441 
  87442 // pCur points at an index entry created using the OP_MakeRecord opcode.
  87443 // Read the rowid (the last field in the record) and store it in *rowid.
  87444 // Return SQLITE_OK if everything works, or an error code otherwise.
  87445 //
  87446 // pCur might be pointing to text obtained from a corrupt database file.
  87447 // So the content cannot be trusted.  Do appropriate checks on the content.
  87448 func Xsqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr) int32 {
  87449 	bp := tls.Alloc(120)
  87450 	defer tls.Free(120)
  87451 
  87452 	var nCellKey I64
  87453 	var rc int32
  87454 
  87455 	var lenRowid U32
  87456 
  87457 	nCellKey = int64(0)
  87458 
  87459 	nCellKey = I64(Xsqlite3BtreePayloadSize(tls, pCur))
  87460 
  87461 	Xsqlite3VdbeMemInit(tls, bp, db, uint16(0))
  87462 	rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, U32(nCellKey), bp)
  87463 	if !(rc != 0) {
  87464 		goto __1
  87465 	}
  87466 	return rc
  87467 __1:
  87468 	;
  87469 	*(*U32)(unsafe.Pointer(bp + 56)) = U32(*(*U8)(unsafe.Pointer((*Mem)(unsafe.Pointer(bp)).Fz)))
  87470 	if !(*(*U32)(unsafe.Pointer(bp + 56)) >= U32(0x80)) {
  87471 		goto __2
  87472 	}
  87473 	Xsqlite3GetVarint32(tls, (*Mem)(unsafe.Pointer(bp)).Fz, bp+56)
  87474 __2:
  87475 	;
  87476 	if !(*(*U32)(unsafe.Pointer(bp + 56)) < U32(3) || *(*U32)(unsafe.Pointer(bp + 56)) > uint32((*Mem)(unsafe.Pointer(bp)).Fn)) {
  87477 		goto __3
  87478 	}
  87479 	goto idx_rowid_corruption
  87480 __3:
  87481 	;
  87482 	*(*U32)(unsafe.Pointer(bp + 60)) = U32(*(*U8)(unsafe.Pointer((*Mem)(unsafe.Pointer(bp)).Fz + uintptr(*(*U32)(unsafe.Pointer(bp + 56))-U32(1)))))
  87483 	if !(*(*U32)(unsafe.Pointer(bp + 60)) >= U32(0x80)) {
  87484 		goto __4
  87485 	}
  87486 	Xsqlite3GetVarint32(tls, (*Mem)(unsafe.Pointer(bp)).Fz+uintptr(*(*U32)(unsafe.Pointer(bp + 56))-U32(1)), bp+60)
  87487 __4:
  87488 	;
  87489 	if !(*(*U32)(unsafe.Pointer(bp + 60)) < U32(1) || *(*U32)(unsafe.Pointer(bp + 60)) > U32(9) || *(*U32)(unsafe.Pointer(bp + 60)) == U32(7)) {
  87490 		goto __5
  87491 	}
  87492 	goto idx_rowid_corruption
  87493 __5:
  87494 	;
  87495 	lenRowid = U32(Xsqlite3SmallTypeSizes[*(*U32)(unsafe.Pointer(bp + 60))])
  87496 
  87497 	if !(U32((*Mem)(unsafe.Pointer(bp)).Fn) < *(*U32)(unsafe.Pointer(bp + 56))+lenRowid) {
  87498 		goto __6
  87499 	}
  87500 	goto idx_rowid_corruption
  87501 __6:
  87502 	;
  87503 	Xsqlite3VdbeSerialGet(tls, (*Mem)(unsafe.Pointer(bp)).Fz+uintptr(U32((*Mem)(unsafe.Pointer(bp)).Fn)-lenRowid), *(*U32)(unsafe.Pointer(bp + 60)), bp+64)
  87504 	*(*I64)(unsafe.Pointer(rowid)) = *(*I64)(unsafe.Pointer(bp + 64))
  87505 	Xsqlite3VdbeMemReleaseMalloc(tls, bp)
  87506 	return SQLITE_OK
  87507 
  87508 idx_rowid_corruption:
  87509 	;
  87510 	Xsqlite3VdbeMemReleaseMalloc(tls, bp)
  87511 	return Xsqlite3CorruptError(tls, 87461)
  87512 }
  87513 
  87514 // Compare the key of the index entry that cursor pC is pointing to against
  87515 // the key string in pUnpacked.  Write into *pRes a number
  87516 // that is negative, zero, or positive if pC is less than, equal to,
  87517 // or greater than pUnpacked.  Return SQLITE_OK on success.
  87518 //
  87519 // pUnpacked is either created without a rowid or is truncated so that it
  87520 // omits the rowid at the end.  The rowid at the end of the index entry
  87521 // is ignored as well.  Hence, this routine only compares the prefixes
  87522 // of the keys prior to the final rowid, not the entire key.
  87523 func Xsqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked uintptr, res uintptr) int32 {
  87524 	bp := tls.Alloc(56)
  87525 	defer tls.Free(56)
  87526 
  87527 	var nCellKey I64 = int64(0)
  87528 	var rc int32
  87529 	var pCur uintptr
  87530 
  87531 	pCur = *(*uintptr)(unsafe.Pointer(pC + 48))
  87532 
  87533 	nCellKey = I64(Xsqlite3BtreePayloadSize(tls, pCur))
  87534 
  87535 	if nCellKey <= int64(0) || nCellKey > int64(0x7fffffff) {
  87536 		*(*int32)(unsafe.Pointer(res)) = 0
  87537 		return Xsqlite3CorruptError(tls, 87494)
  87538 	}
  87539 	Xsqlite3VdbeMemInit(tls, bp, db, uint16(0))
  87540 	rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, U32(nCellKey), bp)
  87541 	if rc != 0 {
  87542 		return rc
  87543 	}
  87544 	*(*int32)(unsafe.Pointer(res)) = Xsqlite3VdbeRecordCompareWithSkip(tls, (*Mem)(unsafe.Pointer(bp)).Fn, (*Mem)(unsafe.Pointer(bp)).Fz, pUnpacked, 0)
  87545 	Xsqlite3VdbeMemReleaseMalloc(tls, bp)
  87546 	return SQLITE_OK
  87547 }
  87548 
  87549 // This routine sets the value to be returned by subsequent calls to
  87550 // sqlite3_changes() on the database handle 'db'.
  87551 func Xsqlite3VdbeSetChanges(tls *libc.TLS, db uintptr, nChange I64) {
  87552 	(*Sqlite3)(unsafe.Pointer(db)).FnChange = nChange
  87553 	*(*I64)(unsafe.Pointer(db + 128)) += nChange
  87554 }
  87555 
  87556 // Set a flag in the vdbe to update the change counter when it is finalised
  87557 // or reset.
  87558 func Xsqlite3VdbeCountChanges(tls *libc.TLS, v uintptr) {
  87559 	libc.SetBitFieldPtr8Uint32(v+200, Bft(1), 4, 0x10)
  87560 }
  87561 
  87562 // Mark every prepared statement associated with a database connection
  87563 // as expired.
  87564 //
  87565 // An expired statement means that recompilation of the statement is
  87566 // recommend.  Statements expire when things happen that make their
  87567 // programs obsolete.  Removing user-defined functions or collating
  87568 // sequences, or changing an authorization function are the types of
  87569 // things that make prepared statements obsolete.
  87570 //
  87571 // If iCode is 1, then expiration is advisory.  The statement should
  87572 // be reprepared before being restarted, but if it is already running
  87573 // it is allowed to run to completion.
  87574 //
  87575 // Internally, this function just sets the Vdbe.expired flag on all
  87576 // prepared statements.  The flag is set to 1 for an immediate expiration
  87577 // and set to 2 for an advisory expiration.
  87578 func Xsqlite3ExpirePreparedStatements(tls *libc.TLS, db uintptr, iCode int32) {
  87579 	var p uintptr
  87580 	for p = (*Sqlite3)(unsafe.Pointer(db)).FpVdbe; p != 0; p = (*Vdbe)(unsafe.Pointer(p)).FpVNext {
  87581 		libc.SetBitFieldPtr8Uint32(p+200, Bft(iCode+1), 0, 0x3)
  87582 	}
  87583 }
  87584 
  87585 // Return the database associated with the Vdbe.
  87586 func Xsqlite3VdbeDb(tls *libc.TLS, v uintptr) uintptr {
  87587 	return (*Vdbe)(unsafe.Pointer(v)).Fdb
  87588 }
  87589 
  87590 // Return the SQLITE_PREPARE flags for a Vdbe.
  87591 func Xsqlite3VdbePrepareFlags(tls *libc.TLS, v uintptr) U8 {
  87592 	return (*Vdbe)(unsafe.Pointer(v)).FprepFlags
  87593 }
  87594 
  87595 // Return a pointer to an sqlite3_value structure containing the value bound
  87596 // parameter iVar of VM v. Except, if the value is an SQL NULL, return
  87597 // 0 instead. Unless it is NULL, apply affinity aff (one of the SQLITE_AFF_*
  87598 // constants) to the value before returning it.
  87599 //
  87600 // The returned value must be freed by the caller using sqlite3ValueFree().
  87601 func Xsqlite3VdbeGetBoundValue(tls *libc.TLS, v uintptr, iVar int32, aff U8) uintptr {
  87602 	if v != 0 {
  87603 		var pMem uintptr = (*Vdbe)(unsafe.Pointer(v)).FaVar + uintptr(iVar-1)*56
  87604 
  87605 		if 0 == int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Null {
  87606 			var pRet uintptr = Xsqlite3ValueNew(tls, (*Vdbe)(unsafe.Pointer(v)).Fdb)
  87607 			if pRet != 0 {
  87608 				Xsqlite3VdbeMemCopy(tls, pRet, pMem)
  87609 				Xsqlite3ValueApplyAffinity(tls, pRet, aff, uint8(SQLITE_UTF8))
  87610 			}
  87611 			return pRet
  87612 		}
  87613 	}
  87614 	return uintptr(0)
  87615 }
  87616 
  87617 // Configure SQL variable iVar so that binding a new value to it signals
  87618 // to sqlite3_reoptimize() that re-preparing the statement may result
  87619 // in a better query plan.
  87620 func Xsqlite3VdbeSetVarmask(tls *libc.TLS, v uintptr, iVar int32) {
  87621 	if iVar >= 32 {
  87622 		*(*U32)(unsafe.Pointer(v + 284)) |= 0x80000000
  87623 	} else {
  87624 		*(*U32)(unsafe.Pointer(v + 284)) |= U32(1) << (iVar - 1)
  87625 	}
  87626 }
  87627 
  87628 // Cause a function to throw an error if it was call from OP_PureFunc
  87629 // rather than OP_Function.
  87630 //
  87631 // OP_PureFunc means that the function must be deterministic, and should
  87632 // throw an error if it is given inputs that would make it non-deterministic.
  87633 // This routine is invoked by date/time functions that use non-deterministic
  87634 // features such as 'now'.
  87635 func Xsqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) int32 {
  87636 	bp := tls.Alloc(16)
  87637 	defer tls.Free(16)
  87638 
  87639 	var pOp uintptr
  87640 	if (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe == uintptr(0) {
  87641 		return 1
  87642 	}
  87643 	pOp = (*Vdbe)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FaOp + uintptr((*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp)*24
  87644 	if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_PureFunc {
  87645 		var zContext uintptr
  87646 		var zMsg uintptr
  87647 		if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp5)&NC_IsCheck != 0 {
  87648 			zContext = ts + 6518
  87649 		} else if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp5)&NC_GenCol != 0 {
  87650 			zContext = ts + 6537
  87651 		} else {
  87652 			zContext = ts + 6556
  87653 		}
  87654 		zMsg = Xsqlite3_mprintf(tls, ts+6565,
  87655 			libc.VaList(bp, (*FuncDef)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext))
  87656 		Xsqlite3_result_error(tls, pCtx, zMsg, -1)
  87657 		Xsqlite3_free(tls, zMsg)
  87658 		return 0
  87659 	}
  87660 	return 1
  87661 }
  87662 
  87663 // Transfer error message text from an sqlite3_vtab.zErrMsg (text stored
  87664 // in memory obtained from sqlite3_malloc) into a Vdbe.zErrMsg (text stored
  87665 // in memory obtained from sqlite3DbMalloc).
  87666 func Xsqlite3VtabImportErrmsg(tls *libc.TLS, p uintptr, pVtab uintptr) {
  87667 	if (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg != 0 {
  87668 		var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb
  87669 		Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg)
  87670 		(*Vdbe)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3DbStrDup(tls, db, (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg)
  87671 		Xsqlite3_free(tls, (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg)
  87672 		(*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = uintptr(0)
  87673 	}
  87674 }
  87675 
  87676 func vdbeFreeUnpacked(tls *libc.TLS, db uintptr, nField int32, p uintptr) {
  87677 	if p != 0 {
  87678 		var i int32
  87679 		for i = 0; i < nField; i++ {
  87680 			var pMem uintptr = (*UnpackedRecord)(unsafe.Pointer(p)).FaMem + uintptr(i)*56
  87681 			if (*Mem)(unsafe.Pointer(pMem)).FzMalloc != 0 {
  87682 				Xsqlite3VdbeMemReleaseMalloc(tls, pMem)
  87683 			}
  87684 		}
  87685 		Xsqlite3DbNNFreeNN(tls, db, p)
  87686 	}
  87687 }
  87688 
  87689 // Invoke the pre-update hook. If this is an UPDATE or DELETE pre-update call,
  87690 // then cursor passed as the second argument should point to the row about
  87691 // to be update or deleted. If the application calls sqlite3_preupdate_old(),
  87692 // the required value will be read from the row the cursor points to.
  87693 func Xsqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, zDb uintptr, pTab uintptr, iKey1 I64, iReg int32, iBlobWrite int32) {
  87694 	bp := tls.Alloc(136)
  87695 	defer tls.Free(136)
  87696 
  87697 	var db uintptr = (*Vdbe)(unsafe.Pointer(v)).Fdb
  87698 	var iKey2 I64
  87699 
  87700 	var zTbl uintptr = (*Table)(unsafe.Pointer(pTab)).FzName
  87701 
  87702 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(PreUpdate{})))
  87703 	if libc.Bool32((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) == 0 {
  87704 		iKey1 = libc.AssignInt64(&iKey2, int64(0))
  87705 		(*PreUpdate)(unsafe.Pointer(bp)).FpPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
  87706 	} else {
  87707 		if op == SQLITE_UPDATE {
  87708 			iKey2 = *(*I64)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FaMem + uintptr(iReg)*56))
  87709 		} else {
  87710 			iKey2 = iKey1
  87711 		}
  87712 	}
  87713 
  87714 	(*PreUpdate)(unsafe.Pointer(bp)).Fv = v
  87715 	(*PreUpdate)(unsafe.Pointer(bp)).FpCsr = pCsr
  87716 	(*PreUpdate)(unsafe.Pointer(bp)).Fop = op
  87717 	(*PreUpdate)(unsafe.Pointer(bp)).FiNewReg = iReg
  87718 	(*PreUpdate)(unsafe.Pointer(bp)).Fkeyinfo.Fdb = db
  87719 	(*PreUpdate)(unsafe.Pointer(bp)).Fkeyinfo.Fenc = (*Sqlite3)(unsafe.Pointer(db)).Fenc
  87720 	(*PreUpdate)(unsafe.Pointer(bp)).Fkeyinfo.FnKeyField = U16((*Table)(unsafe.Pointer(pTab)).FnCol)
  87721 	(*PreUpdate)(unsafe.Pointer(bp)).Fkeyinfo.FaSortFlags = uintptr(unsafe.Pointer(&fakeSortOrder))
  87722 	(*PreUpdate)(unsafe.Pointer(bp)).FiKey1 = iKey1
  87723 	(*PreUpdate)(unsafe.Pointer(bp)).FiKey2 = iKey2
  87724 	(*PreUpdate)(unsafe.Pointer(bp)).FpTab = pTab
  87725 	(*PreUpdate)(unsafe.Pointer(bp)).FiBlobWrite = iBlobWrite
  87726 
  87727 	(*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate = bp
  87728 	(*struct {
  87729 		f func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Sqlite3_int64, Sqlite3_int64)
  87730 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2)
  87731 	(*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate = uintptr(0)
  87732 	Xsqlite3DbFree(tls, db, (*PreUpdate)(unsafe.Pointer(bp)).FaRecord)
  87733 	vdbeFreeUnpacked(tls, db, int32((*PreUpdate)(unsafe.Pointer(bp)).Fkeyinfo.FnKeyField)+1, (*PreUpdate)(unsafe.Pointer(bp)).FpUnpacked)
  87734 	vdbeFreeUnpacked(tls, db, int32((*PreUpdate)(unsafe.Pointer(bp)).Fkeyinfo.FnKeyField)+1, (*PreUpdate)(unsafe.Pointer(bp)).FpNewUnpacked)
  87735 	if (*PreUpdate)(unsafe.Pointer(bp)).FaNew != 0 {
  87736 		var i int32
  87737 		for i = 0; i < int32((*VdbeCursor)(unsafe.Pointer(pCsr)).FnField); i++ {
  87738 			Xsqlite3VdbeMemRelease(tls, (*PreUpdate)(unsafe.Pointer(bp)).FaNew+uintptr(i)*56)
  87739 		}
  87740 		Xsqlite3DbNNFreeNN(tls, db, (*PreUpdate)(unsafe.Pointer(bp)).FaNew)
  87741 	}
  87742 }
  87743 
  87744 var fakeSortOrder U8 = U8(0)
  87745 
  87746 // Return TRUE (non-zero) of the statement supplied as an argument needs
  87747 // to be recompiled.  A statement needs to be recompiled whenever the
  87748 // execution environment changes in a way that would alter the program
  87749 // that sqlite3_prepare() generates.  For example, if new functions or
  87750 // collating sequences are registered or if an authorizer function is
  87751 // added or changed.
  87752 func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) int32 {
  87753 	var p uintptr = pStmt
  87754 	return libc.Bool32(p == uintptr(0) || Bft(int32(*(*uint8)(unsafe.Pointer(p + 200))&0x3>>0)) != 0)
  87755 }
  87756 
  87757 func vdbeSafety(tls *libc.TLS, p uintptr) int32 {
  87758 	if (*Vdbe)(unsafe.Pointer(p)).Fdb == uintptr(0) {
  87759 		Xsqlite3_log(tls, SQLITE_MISUSE, ts+6601, 0)
  87760 		return 1
  87761 	} else {
  87762 		return 0
  87763 	}
  87764 	return int32(0)
  87765 }
  87766 
  87767 func vdbeSafetyNotNull(tls *libc.TLS, p uintptr) int32 {
  87768 	if p == uintptr(0) {
  87769 		Xsqlite3_log(tls, SQLITE_MISUSE, ts+6646, 0)
  87770 		return 1
  87771 	} else {
  87772 		return vdbeSafety(tls, p)
  87773 	}
  87774 	return int32(0)
  87775 }
  87776 
  87777 func invokeProfileCallback(tls *libc.TLS, db uintptr, p uintptr) {
  87778 	bp := tls.Alloc(16)
  87779 	defer tls.Free(16)
  87780 
  87781 	Xsqlite3OsCurrentTimeInt64(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, bp)
  87782 	*(*Sqlite3_int64)(unsafe.Pointer(bp + 8)) = (*(*Sqlite3_int64)(unsafe.Pointer(bp)) - (*Vdbe)(unsafe.Pointer(p)).FstartTime) * int64(1000000)
  87783 	if (*Sqlite3)(unsafe.Pointer(db)).FxProfile != 0 {
  87784 		(*struct {
  87785 			f func(*libc.TLS, uintptr, uintptr, U64)
  87786 		})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxProfile})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProfileArg, (*Vdbe)(unsafe.Pointer(p)).FzSql, uint64(*(*Sqlite3_int64)(unsafe.Pointer(bp + 8))))
  87787 	}
  87788 	if int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace)&SQLITE_TRACE_PROFILE != 0 {
  87789 		(*struct {
  87790 			f func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32
  87791 		})(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(db + 248))})).f(tls, uint32(SQLITE_TRACE_PROFILE), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, bp+8)
  87792 	}
  87793 	(*Vdbe)(unsafe.Pointer(p)).FstartTime = int64(0)
  87794 }
  87795 
  87796 // The following routine destroys a virtual machine that is created by
  87797 // the sqlite3_compile() routine. The integer returned is an SQLITE_
  87798 // success/failure code that describes the result of executing the virtual
  87799 // machine.
  87800 //
  87801 // This routine sets the error code and string returned by
  87802 // sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
  87803 func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) int32 {
  87804 	var rc int32
  87805 	if pStmt == uintptr(0) {
  87806 		rc = SQLITE_OK
  87807 	} else {
  87808 		var v uintptr = pStmt
  87809 		var db uintptr = (*Vdbe)(unsafe.Pointer(v)).Fdb
  87810 		if vdbeSafety(tls, v) != 0 {
  87811 			return Xsqlite3MisuseError(tls, 87858)
  87812 		}
  87813 		Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
  87814 		if (*Vdbe)(unsafe.Pointer(v)).FstartTime > int64(0) {
  87815 			invokeProfileCallback(tls, db, v)
  87816 		}
  87817 
  87818 		rc = Xsqlite3VdbeReset(tls, v)
  87819 		Xsqlite3VdbeDelete(tls, v)
  87820 		rc = Xsqlite3ApiExit(tls, db, rc)
  87821 		Xsqlite3LeaveMutexAndCloseZombie(tls, db)
  87822 	}
  87823 	return rc
  87824 }
  87825 
  87826 // Terminate the current execution of an SQL statement and reset it
  87827 // back to its starting state so that it can be reused. A success code from
  87828 // the prior execution is returned.
  87829 //
  87830 // This routine sets the error code and string returned by
  87831 // sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
  87832 func Xsqlite3_reset(tls *libc.TLS, pStmt uintptr) int32 {
  87833 	var rc int32
  87834 	if pStmt == uintptr(0) {
  87835 		rc = SQLITE_OK
  87836 	} else {
  87837 		var v uintptr = pStmt
  87838 		var db uintptr = (*Vdbe)(unsafe.Pointer(v)).Fdb
  87839 		Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
  87840 		if (*Vdbe)(unsafe.Pointer(v)).FstartTime > int64(0) {
  87841 			invokeProfileCallback(tls, db, v)
  87842 		}
  87843 
  87844 		rc = Xsqlite3VdbeReset(tls, v)
  87845 		Xsqlite3VdbeRewind(tls, v)
  87846 
  87847 		rc = Xsqlite3ApiExit(tls, db, rc)
  87848 		Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
  87849 	}
  87850 	return rc
  87851 }
  87852 
  87853 // Set all the parameters in the compiled SQL statement to NULL.
  87854 func Xsqlite3_clear_bindings(tls *libc.TLS, pStmt uintptr) int32 {
  87855 	var i int32
  87856 	var rc int32 = SQLITE_OK
  87857 	var p uintptr = pStmt
  87858 	var mutex uintptr = (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(pStmt)).Fdb)).Fmutex
  87859 	Xsqlite3_mutex_enter(tls, mutex)
  87860 	for i = 0; i < int32((*Vdbe)(unsafe.Pointer(p)).FnVar); i++ {
  87861 		Xsqlite3VdbeMemRelease(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar+uintptr(i)*56)
  87862 		(*Mem)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i)*56)).Fflags = U16(MEM_Null)
  87863 	}
  87864 
  87865 	if (*Vdbe)(unsafe.Pointer(p)).Fexpmask != 0 {
  87866 		libc.SetBitFieldPtr8Uint32(p+200, Bft(1), 0, 0x3)
  87867 	}
  87868 	Xsqlite3_mutex_leave(tls, mutex)
  87869 	return rc
  87870 }
  87871 
  87872 // *************************** sqlite3_value_  *******************************
  87873 //
  87874 // The following routines extract information from a Mem or sqlite3_value
  87875 // structure.
  87876 func Xsqlite3_value_blob(tls *libc.TLS, pVal uintptr) uintptr {
  87877 	var p uintptr = pVal
  87878 	if int32((*Mem)(unsafe.Pointer(p)).Fflags)&(MEM_Blob|MEM_Str) != 0 {
  87879 		if func() int32 {
  87880 			if int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_Zero != 0 {
  87881 				return Xsqlite3VdbeMemExpandBlob(tls, p)
  87882 			}
  87883 			return 0
  87884 		}() != SQLITE_OK {
  87885 			return uintptr(0)
  87886 		}
  87887 		*(*U16)(unsafe.Pointer(p + 20)) |= U16(MEM_Blob)
  87888 		if (*Mem)(unsafe.Pointer(p)).Fn != 0 {
  87889 			return (*Mem)(unsafe.Pointer(p)).Fz
  87890 		}
  87891 		return uintptr(0)
  87892 	} else {
  87893 		return Xsqlite3_value_text(tls, pVal)
  87894 	}
  87895 	return uintptr(0)
  87896 }
  87897 
  87898 func Xsqlite3_value_bytes(tls *libc.TLS, pVal uintptr) int32 {
  87899 	return Xsqlite3ValueBytes(tls, pVal, uint8(SQLITE_UTF8))
  87900 }
  87901 
  87902 func Xsqlite3_value_bytes16(tls *libc.TLS, pVal uintptr) int32 {
  87903 	return Xsqlite3ValueBytes(tls, pVal, uint8(SQLITE_UTF16LE))
  87904 }
  87905 
  87906 func Xsqlite3_value_double(tls *libc.TLS, pVal uintptr) float64 {
  87907 	return Xsqlite3VdbeRealValue(tls, pVal)
  87908 }
  87909 
  87910 func Xsqlite3_value_int(tls *libc.TLS, pVal uintptr) int32 {
  87911 	return int32(Xsqlite3VdbeIntValue(tls, pVal))
  87912 }
  87913 
  87914 func Xsqlite3_value_int64(tls *libc.TLS, pVal uintptr) Sqlite_int64 {
  87915 	return Xsqlite3VdbeIntValue(tls, pVal)
  87916 }
  87917 
  87918 func Xsqlite3_value_subtype(tls *libc.TLS, pVal uintptr) uint32 {
  87919 	var pMem uintptr = pVal
  87920 	return func() uint32 {
  87921 		if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Subtype != 0 {
  87922 			return uint32((*Mem)(unsafe.Pointer(pMem)).FeSubtype)
  87923 		}
  87924 		return uint32(0)
  87925 	}()
  87926 }
  87927 
  87928 func Xsqlite3_value_pointer(tls *libc.TLS, pVal uintptr, zPType uintptr) uintptr {
  87929 	var p uintptr = pVal
  87930 	if int32((*Mem)(unsafe.Pointer(p)).Fflags)&(MEM_TypeMask|MEM_Term|MEM_Subtype) == MEM_Null|MEM_Term|MEM_Subtype &&
  87931 		zPType != uintptr(0) &&
  87932 		int32((*Mem)(unsafe.Pointer(p)).FeSubtype) == 'p' &&
  87933 		libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(p)), zPType) == 0 {
  87934 		return (*Mem)(unsafe.Pointer(p)).Fz
  87935 	} else {
  87936 		return uintptr(0)
  87937 	}
  87938 	return uintptr(0)
  87939 }
  87940 
  87941 func Xsqlite3_value_text(tls *libc.TLS, pVal uintptr) uintptr {
  87942 	return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF8))
  87943 }
  87944 
  87945 func Xsqlite3_value_text16(tls *libc.TLS, pVal uintptr) uintptr {
  87946 	return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF16LE))
  87947 }
  87948 
  87949 func Xsqlite3_value_text16be(tls *libc.TLS, pVal uintptr) uintptr {
  87950 	return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF16BE))
  87951 }
  87952 
  87953 func Xsqlite3_value_text16le(tls *libc.TLS, pVal uintptr) uintptr {
  87954 	return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF16LE))
  87955 }
  87956 
  87957 // EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five
  87958 // fundamental datatypes: 64-bit signed integer 64-bit IEEE floating
  87959 // point number string BLOB NULL
  87960 func Xsqlite3_value_type(tls *libc.TLS, pVal uintptr) int32 {
  87961 	return int32(aType[int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags)&MEM_AffMask])
  87962 }
  87963 
  87964 var aType = [64]U8{
  87965 	U8(SQLITE_BLOB),
  87966 	U8(SQLITE_NULL),
  87967 	U8(SQLITE_TEXT),
  87968 	U8(SQLITE_NULL),
  87969 	U8(SQLITE_INTEGER),
  87970 	U8(SQLITE_NULL),
  87971 	U8(SQLITE_INTEGER),
  87972 	U8(SQLITE_NULL),
  87973 	U8(SQLITE_FLOAT),
  87974 	U8(SQLITE_NULL),
  87975 	U8(SQLITE_FLOAT),
  87976 	U8(SQLITE_NULL),
  87977 	U8(SQLITE_INTEGER),
  87978 	U8(SQLITE_NULL),
  87979 	U8(SQLITE_INTEGER),
  87980 	U8(SQLITE_NULL),
  87981 	U8(SQLITE_BLOB),
  87982 	U8(SQLITE_NULL),
  87983 	U8(SQLITE_TEXT),
  87984 	U8(SQLITE_NULL),
  87985 	U8(SQLITE_INTEGER),
  87986 	U8(SQLITE_NULL),
  87987 	U8(SQLITE_INTEGER),
  87988 	U8(SQLITE_NULL),
  87989 	U8(SQLITE_FLOAT),
  87990 	U8(SQLITE_NULL),
  87991 	U8(SQLITE_FLOAT),
  87992 	U8(SQLITE_NULL),
  87993 	U8(SQLITE_INTEGER),
  87994 	U8(SQLITE_NULL),
  87995 	U8(SQLITE_INTEGER),
  87996 	U8(SQLITE_NULL),
  87997 	U8(SQLITE_FLOAT),
  87998 	U8(SQLITE_NULL),
  87999 	U8(SQLITE_TEXT),
  88000 	U8(SQLITE_NULL),
  88001 	U8(SQLITE_FLOAT),
  88002 	U8(SQLITE_NULL),
  88003 	U8(SQLITE_FLOAT),
  88004 	U8(SQLITE_NULL),
  88005 	U8(SQLITE_FLOAT),
  88006 	U8(SQLITE_NULL),
  88007 	U8(SQLITE_FLOAT),
  88008 	U8(SQLITE_NULL),
  88009 	U8(SQLITE_FLOAT),
  88010 	U8(SQLITE_NULL),
  88011 	U8(SQLITE_FLOAT),
  88012 	U8(SQLITE_NULL),
  88013 	U8(SQLITE_BLOB),
  88014 	U8(SQLITE_NULL),
  88015 	U8(SQLITE_TEXT),
  88016 	U8(SQLITE_NULL),
  88017 	U8(SQLITE_FLOAT),
  88018 	U8(SQLITE_NULL),
  88019 	U8(SQLITE_FLOAT),
  88020 	U8(SQLITE_NULL),
  88021 	U8(SQLITE_FLOAT),
  88022 	U8(SQLITE_NULL),
  88023 	U8(SQLITE_FLOAT),
  88024 	U8(SQLITE_NULL),
  88025 	U8(SQLITE_FLOAT),
  88026 	U8(SQLITE_NULL),
  88027 	U8(SQLITE_FLOAT),
  88028 	U8(SQLITE_NULL),
  88029 }
  88030 
  88031 func Xsqlite3_value_encoding(tls *libc.TLS, pVal uintptr) int32 {
  88032 	return int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fenc)
  88033 }
  88034 
  88035 // Return true if a parameter to xUpdate represents an unchanged column
  88036 func Xsqlite3_value_nochange(tls *libc.TLS, pVal uintptr) int32 {
  88037 	return libc.Bool32(int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(MEM_Null|MEM_Zero) == MEM_Null|MEM_Zero)
  88038 }
  88039 
  88040 // Return true if a parameter value originated from an sqlite3_bind()
  88041 func Xsqlite3_value_frombind(tls *libc.TLS, pVal uintptr) int32 {
  88042 	return libc.Bool32(int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags)&MEM_FromBind != 0)
  88043 }
  88044 
  88045 // Make a copy of an sqlite3_value object
  88046 func Xsqlite3_value_dup(tls *libc.TLS, pOrig uintptr) uintptr {
  88047 	var pNew uintptr
  88048 	if pOrig == uintptr(0) {
  88049 		return uintptr(0)
  88050 	}
  88051 	pNew = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Sqlite3_value{})))
  88052 	if pNew == uintptr(0) {
  88053 		return uintptr(0)
  88054 	}
  88055 	libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(Sqlite3_value{})))
  88056 	libc.Xmemcpy(tls, pNew, pOrig, uint64(uintptr(0)+24))
  88057 	*(*U16)(unsafe.Pointer(pNew + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Dyn))
  88058 	(*Sqlite3_value)(unsafe.Pointer(pNew)).Fdb = uintptr(0)
  88059 	if int32((*Sqlite3_value)(unsafe.Pointer(pNew)).Fflags)&(MEM_Str|MEM_Blob) != 0 {
  88060 		*(*U16)(unsafe.Pointer(pNew + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Static | MEM_Dyn))
  88061 		*(*U16)(unsafe.Pointer(pNew + 20)) |= U16(MEM_Ephem)
  88062 		if Xsqlite3VdbeMemMakeWriteable(tls, pNew) != SQLITE_OK {
  88063 			Xsqlite3ValueFree(tls, pNew)
  88064 			pNew = uintptr(0)
  88065 		}
  88066 	} else if int32((*Sqlite3_value)(unsafe.Pointer(pNew)).Fflags)&MEM_Null != 0 {
  88067 		*(*U16)(unsafe.Pointer(pNew + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Term | MEM_Subtype))
  88068 	}
  88069 	return pNew
  88070 }
  88071 
  88072 // Destroy an sqlite3_value object previously obtained from
  88073 // sqlite3_value_dup().
  88074 func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) {
  88075 	Xsqlite3ValueFree(tls, pOld)
  88076 }
  88077 
  88078 func setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc U8, xDel uintptr) {
  88079 	var pOut uintptr = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut
  88080 	var rc int32 = Xsqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, xDel)
  88081 	if rc != 0 {
  88082 		if rc == SQLITE_TOOBIG {
  88083 			Xsqlite3_result_error_toobig(tls, pCtx)
  88084 		} else {
  88085 			Xsqlite3_result_error_nomem(tls, pCtx)
  88086 		}
  88087 		return
  88088 	}
  88089 	Xsqlite3VdbeChangeEncoding(tls, pOut, int32((*Sqlite3_context)(unsafe.Pointer(pCtx)).Fenc))
  88090 	if Xsqlite3VdbeMemTooBig(tls, pOut) != 0 {
  88091 		Xsqlite3_result_error_toobig(tls, pCtx)
  88092 	}
  88093 }
  88094 
  88095 func invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) int32 {
  88096 	if xDel == uintptr(0) {
  88097 	} else if xDel == libc.UintptrFromInt32(-1) {
  88098 	} else {
  88099 		(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{xDel})).f(tls, p)
  88100 	}
  88101 	Xsqlite3_result_error_toobig(tls, pCtx)
  88102 	return SQLITE_TOOBIG
  88103 }
  88104 
  88105 func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) {
  88106 	setResultStrOrError(tls, pCtx, z, n, uint8(0), xDel)
  88107 }
  88108 
  88109 func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_uint64, xDel uintptr) {
  88110 	if n > uint64(0x7fffffff) {
  88111 		invokeValueDestructor(tls, z, xDel, pCtx)
  88112 	} else {
  88113 		setResultStrOrError(tls, pCtx, z, int32(n), uint8(0), xDel)
  88114 	}
  88115 }
  88116 
  88117 func Xsqlite3_result_double(tls *libc.TLS, pCtx uintptr, rVal float64) {
  88118 	Xsqlite3VdbeMemSetDouble(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, rVal)
  88119 }
  88120 
  88121 func Xsqlite3_result_error(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) {
  88122 	(*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = SQLITE_ERROR
  88123 	Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, int64(n), uint8(SQLITE_UTF8), libc.UintptrFromInt32(-1))
  88124 }
  88125 
  88126 func Xsqlite3_result_error16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) {
  88127 	(*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = SQLITE_ERROR
  88128 	Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, int64(n), uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(-1))
  88129 }
  88130 
  88131 func Xsqlite3_result_int(tls *libc.TLS, pCtx uintptr, iVal int32) {
  88132 	Xsqlite3VdbeMemSetInt64(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, I64(iVal))
  88133 }
  88134 
  88135 func Xsqlite3_result_int64(tls *libc.TLS, pCtx uintptr, iVal I64) {
  88136 	Xsqlite3VdbeMemSetInt64(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, iVal)
  88137 }
  88138 
  88139 func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr) {
  88140 	Xsqlite3VdbeMemSetNull(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut)
  88141 }
  88142 
  88143 func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) {
  88144 	var pOut uintptr = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut
  88145 
  88146 	Xsqlite3VdbeMemRelease(tls, pOut)
  88147 	(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null)
  88148 	Xsqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, xDestructor)
  88149 }
  88150 
  88151 func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) {
  88152 	var pOut uintptr = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut
  88153 
  88154 	(*Mem)(unsafe.Pointer(pOut)).FeSubtype = U8(eSubtype & uint32(0xff))
  88155 	*(*U16)(unsafe.Pointer(pOut + 20)) |= U16(MEM_Subtype)
  88156 }
  88157 
  88158 func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) {
  88159 	setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), xDel)
  88160 }
  88161 
  88162 func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_uint64, xDel uintptr, enc uint8) {
  88163 	if int32(enc) != SQLITE_UTF8 {
  88164 		if int32(enc) == SQLITE_UTF16 {
  88165 			enc = uint8(SQLITE_UTF16LE)
  88166 		}
  88167 		n = n & libc.CplUint64(uint64(1))
  88168 	}
  88169 	if n > uint64(0x7fffffff) {
  88170 		invokeValueDestructor(tls, z, xDel, pCtx)
  88171 	} else {
  88172 		setResultStrOrError(tls, pCtx, z, int32(n), enc, xDel)
  88173 	}
  88174 }
  88175 
  88176 func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) {
  88177 	setResultStrOrError(tls, pCtx, z, int32(U64(n)&libc.CplUint64(uint64(1))), uint8(SQLITE_UTF16LE), xDel)
  88178 }
  88179 
  88180 func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) {
  88181 	setResultStrOrError(tls, pCtx, z, int32(U64(n)&libc.CplUint64(uint64(1))), uint8(SQLITE_UTF16BE), xDel)
  88182 }
  88183 
  88184 func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) {
  88185 	setResultStrOrError(tls, pCtx, z, int32(U64(n)&libc.CplUint64(uint64(1))), uint8(SQLITE_UTF16LE), xDel)
  88186 }
  88187 
  88188 func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) {
  88189 	var pOut uintptr = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut
  88190 
  88191 	Xsqlite3VdbeMemCopy(tls, pOut, pValue)
  88192 	Xsqlite3VdbeChangeEncoding(tls, pOut, int32((*Sqlite3_context)(unsafe.Pointer(pCtx)).Fenc))
  88193 	if Xsqlite3VdbeMemTooBig(tls, pOut) != 0 {
  88194 		Xsqlite3_result_error_toobig(tls, pCtx)
  88195 	}
  88196 }
  88197 
  88198 func Xsqlite3_result_zeroblob(tls *libc.TLS, pCtx uintptr, n int32) {
  88199 	Xsqlite3_result_zeroblob64(tls, pCtx, func() uint64 {
  88200 		if n > 0 {
  88201 			return uint64(n)
  88202 		}
  88203 		return uint64(0)
  88204 	}())
  88205 }
  88206 
  88207 func Xsqlite3_result_zeroblob64(tls *libc.TLS, pCtx uintptr, n U64) int32 {
  88208 	var pOut uintptr = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut
  88209 
  88210 	if n > U64(*(*int32)(unsafe.Pointer((*Mem)(unsafe.Pointer(pOut)).Fdb + 136))) {
  88211 		Xsqlite3_result_error_toobig(tls, pCtx)
  88212 		return SQLITE_TOOBIG
  88213 	}
  88214 	Xsqlite3VdbeMemSetZeroBlob(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, int32(n))
  88215 	return SQLITE_OK
  88216 }
  88217 
  88218 func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) {
  88219 	(*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = func() int32 {
  88220 		if errCode != 0 {
  88221 			return errCode
  88222 		}
  88223 		return -1
  88224 	}()
  88225 	if int32((*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut)).Fflags)&MEM_Null != 0 {
  88226 		setResultStrOrError(tls, pCtx, Xsqlite3ErrStr(tls, errCode), -1, uint8(SQLITE_UTF8),
  88227 			uintptr(0))
  88228 	}
  88229 }
  88230 
  88231 // Force an SQLITE_TOOBIG error.
  88232 func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) {
  88233 	(*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = SQLITE_TOOBIG
  88234 	Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, ts+6686, int64(-1),
  88235 		uint8(SQLITE_UTF8), uintptr(0))
  88236 }
  88237 
  88238 // An SQLITE_NOMEM error.
  88239 func Xsqlite3_result_error_nomem(tls *libc.TLS, pCtx uintptr) {
  88240 	Xsqlite3VdbeMemSetNull(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut)
  88241 	(*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = SQLITE_NOMEM
  88242 	Xsqlite3OomFault(tls, (*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut)).Fdb)
  88243 }
  88244 
  88245 // Force the INT64 value currently stored as the result to be
  88246 // a MEM_IntReal value.  See the SQLITE_TESTCTRL_RESULT_INTREAL
  88247 // test-control.
  88248 func Xsqlite3ResultIntReal(tls *libc.TLS, pCtx uintptr) {
  88249 	if int32((*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut)).Fflags)&MEM_Int != 0 {
  88250 		*(*U16)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Int))
  88251 		*(*U16)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut + 20)) |= U16(MEM_IntReal)
  88252 	}
  88253 }
  88254 
  88255 func doWalCallbacks(tls *libc.TLS, db uintptr) int32 {
  88256 	var rc int32 = SQLITE_OK
  88257 	var i int32
  88258 	for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
  88259 		var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt
  88260 		if pBt != 0 {
  88261 			var nEntry int32
  88262 			Xsqlite3BtreeEnter(tls, pBt)
  88263 			nEntry = Xsqlite3PagerWalCallback(tls, Xsqlite3BtreePager(tls, pBt))
  88264 			Xsqlite3BtreeLeave(tls, pBt)
  88265 			if nEntry > 0 && (*Sqlite3)(unsafe.Pointer(db)).FxWalCallback != 0 && rc == SQLITE_OK {
  88266 				rc = (*struct {
  88267 					f func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32
  88268 				})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxWalCallback})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpWalArg, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FzDbSName, nEntry)
  88269 			}
  88270 		}
  88271 	}
  88272 	return rc
  88273 }
  88274 
  88275 func sqlite3Step(tls *libc.TLS, p uintptr) int32 {
  88276 	var db uintptr
  88277 	var rc int32
  88278 
  88279 	db = (*Vdbe)(unsafe.Pointer(p)).Fdb
  88280 	if !(int32((*Vdbe)(unsafe.Pointer(p)).FeVdbeState) != VDBE_RUN_STATE) {
  88281 		goto __1
  88282 	}
  88283 restart_step:
  88284 	if !(int32((*Vdbe)(unsafe.Pointer(p)).FeVdbeState) == VDBE_READY_STATE) {
  88285 		goto __2
  88286 	}
  88287 	if !(Bft(int32(*(*uint8)(unsafe.Pointer(p + 200))&0x3>>0)) != 0) {
  88288 		goto __4
  88289 	}
  88290 	(*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_SCHEMA
  88291 	rc = SQLITE_ERROR
  88292 	if !(int32((*Vdbe)(unsafe.Pointer(p)).FprepFlags)&SQLITE_PREPARE_SAVESQL != 0) {
  88293 		goto __5
  88294 	}
  88295 
  88296 	rc = Xsqlite3VdbeTransferError(tls, p)
  88297 __5:
  88298 	;
  88299 	goto end_of_step
  88300 __4:
  88301 	;
  88302 	if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive == 0) {
  88303 		goto __6
  88304 	}
  88305 	libc.AtomicStoreNInt32(db+432, int32(0), 0)
  88306 __6:
  88307 	;
  88308 	if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace)&(SQLITE_TRACE_PROFILE|SQLITE_TRACE_XPROFILE) != 0 &&
  88309 		!(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0) && (*Vdbe)(unsafe.Pointer(p)).FzSql != 0) {
  88310 		goto __7
  88311 	}
  88312 	Xsqlite3OsCurrentTimeInt64(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, p+184)
  88313 	goto __8
  88314 __7:
  88315 	;
  88316 __8:
  88317 	;
  88318 	(*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive++
  88319 	if !(int32(*(*uint8)(unsafe.Pointer(p + 200))&0x40>>6) == 0) {
  88320 		goto __9
  88321 	}
  88322 	(*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite++
  88323 __9:
  88324 	;
  88325 	if !(Bft(int32(*(*uint8)(unsafe.Pointer(p + 200))&0x80>>7)) != 0) {
  88326 		goto __10
  88327 	}
  88328 	(*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead++
  88329 __10:
  88330 	;
  88331 	(*Vdbe)(unsafe.Pointer(p)).Fpc = 0
  88332 	(*Vdbe)(unsafe.Pointer(p)).FeVdbeState = U8(VDBE_RUN_STATE)
  88333 	goto __3
  88334 __2:
  88335 	if !(int32((*Vdbe)(unsafe.Pointer(p)).FeVdbeState) == VDBE_HALT_STATE) {
  88336 		goto __11
  88337 	}
  88338 
  88339 	Xsqlite3_reset(tls, p)
  88340 
  88341 	goto restart_step
  88342 __11:
  88343 	;
  88344 __3:
  88345 	;
  88346 __1:
  88347 	;
  88348 	if !(Bft(int32(*(*uint8)(unsafe.Pointer(p + 200))&0xc>>2)) != 0) {
  88349 		goto __12
  88350 	}
  88351 	rc = Xsqlite3VdbeList(tls, p)
  88352 	goto __13
  88353 __12:
  88354 	(*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec++
  88355 	rc = Xsqlite3VdbeExec(tls, p)
  88356 	(*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec--
  88357 __13:
  88358 	;
  88359 	if !(rc == SQLITE_ROW) {
  88360 		goto __14
  88361 	}
  88362 
  88363 	(*Sqlite3)(unsafe.Pointer(db)).FerrCode = SQLITE_ROW
  88364 	return SQLITE_ROW
  88365 	goto __15
  88366 __14:
  88367 	if !((*Vdbe)(unsafe.Pointer(p)).FstartTime > int64(0)) {
  88368 		goto __16
  88369 	}
  88370 	invokeProfileCallback(tls, db, p)
  88371 __16:
  88372 	;
  88373 	(*Vdbe)(unsafe.Pointer(p)).FpResultRow = uintptr(0)
  88374 	if !(rc == SQLITE_DONE && (*Sqlite3)(unsafe.Pointer(db)).FautoCommit != 0) {
  88375 		goto __17
  88376 	}
  88377 
  88378 	(*Vdbe)(unsafe.Pointer(p)).Frc = doWalCallbacks(tls, db)
  88379 	if !((*Vdbe)(unsafe.Pointer(p)).Frc != SQLITE_OK) {
  88380 		goto __19
  88381 	}
  88382 	rc = SQLITE_ERROR
  88383 __19:
  88384 	;
  88385 	goto __18
  88386 __17:
  88387 	if !(rc != SQLITE_DONE && int32((*Vdbe)(unsafe.Pointer(p)).FprepFlags)&SQLITE_PREPARE_SAVESQL != 0) {
  88388 		goto __20
  88389 	}
  88390 
  88391 	rc = Xsqlite3VdbeTransferError(tls, p)
  88392 __20:
  88393 	;
  88394 __18:
  88395 	;
  88396 __15:
  88397 	;
  88398 	(*Sqlite3)(unsafe.Pointer(db)).FerrCode = rc
  88399 	if !(SQLITE_NOMEM == Xsqlite3ApiExit(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, (*Vdbe)(unsafe.Pointer(p)).Frc)) {
  88400 		goto __21
  88401 	}
  88402 	(*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
  88403 	if !(int32((*Vdbe)(unsafe.Pointer(p)).FprepFlags)&SQLITE_PREPARE_SAVESQL != 0) {
  88404 		goto __22
  88405 	}
  88406 	rc = (*Vdbe)(unsafe.Pointer(p)).Frc
  88407 __22:
  88408 	;
  88409 __21:
  88410 	;
  88411 end_of_step:
  88412 	;
  88413 	return rc & (*Sqlite3)(unsafe.Pointer(db)).FerrMask
  88414 }
  88415 
  88416 // This is the top-level implementation of sqlite3_step().  Call
  88417 // sqlite3Step() to do most of the work.  If a schema error occurs,
  88418 // call sqlite3Reprepare() and try again.
  88419 func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) int32 {
  88420 	var rc int32 = SQLITE_OK
  88421 	var v uintptr = pStmt
  88422 	var cnt int32 = 0
  88423 	var db uintptr
  88424 
  88425 	if vdbeSafetyNotNull(tls, v) != 0 {
  88426 		return Xsqlite3MisuseError(tls, 88548)
  88427 	}
  88428 	db = (*Vdbe)(unsafe.Pointer(v)).Fdb
  88429 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
  88430 	for libc.AssignInt32(&rc, sqlite3Step(tls, v)) == SQLITE_SCHEMA &&
  88431 		libc.PostIncInt32(&cnt, 1) < SQLITE_MAX_SCHEMA_RETRY {
  88432 		var savedPc int32 = (*Vdbe)(unsafe.Pointer(v)).Fpc
  88433 		rc = Xsqlite3Reprepare(tls, v)
  88434 		if rc != SQLITE_OK {
  88435 			var zErr uintptr = Xsqlite3_value_text(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr)
  88436 			Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(v)).FzErrMsg)
  88437 			if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
  88438 				(*Vdbe)(unsafe.Pointer(v)).FzErrMsg = Xsqlite3DbStrDup(tls, db, zErr)
  88439 				(*Vdbe)(unsafe.Pointer(v)).Frc = libc.AssignInt32(&rc, Xsqlite3ApiExit(tls, db, rc))
  88440 			} else {
  88441 				(*Vdbe)(unsafe.Pointer(v)).FzErrMsg = uintptr(0)
  88442 				(*Vdbe)(unsafe.Pointer(v)).Frc = libc.AssignInt32(&rc, SQLITE_NOMEM)
  88443 			}
  88444 			break
  88445 		}
  88446 		Xsqlite3_reset(tls, pStmt)
  88447 		if savedPc >= 0 {
  88448 			(*Vdbe)(unsafe.Pointer(v)).FminWriteFileFormat = U8(254)
  88449 		}
  88450 
  88451 	}
  88452 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
  88453 	return rc
  88454 }
  88455 
  88456 // Extract the user data from a sqlite3_context structure and return a
  88457 // pointer to it.
  88458 func Xsqlite3_user_data(tls *libc.TLS, p uintptr) uintptr {
  88459 	return (*FuncDef)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpFunc)).FpUserData
  88460 }
  88461 
  88462 // Extract the user data from a sqlite3_context structure and return a
  88463 // pointer to it.
  88464 //
  88465 // IMPLEMENTATION-OF: R-46798-50301 The sqlite3_context_db_handle() interface
  88466 // returns a copy of the pointer to the database connection (the 1st
  88467 // parameter) of the sqlite3_create_function() and
  88468 // sqlite3_create_function16() routines that originally registered the
  88469 // application defined function.
  88470 func Xsqlite3_context_db_handle(tls *libc.TLS, p uintptr) uintptr {
  88471 	return (*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpOut)).Fdb
  88472 }
  88473 
  88474 // If this routine is invoked from within an xColumn method of a virtual
  88475 // table, then it returns true if and only if the the call is during an
  88476 // UPDATE operation and the value of the column will not be modified
  88477 // by the UPDATE.
  88478 //
  88479 // If this routine is called from any context other than within the
  88480 // xColumn method of a virtual table, then the return value is meaningless
  88481 // and arbitrary.
  88482 //
  88483 // Virtual table implements might use this routine to optimize their
  88484 // performance by substituting a NULL result, or some other light-weight
  88485 // value, as a signal to the xUpdate routine that the column is unchanged.
  88486 func Xsqlite3_vtab_nochange(tls *libc.TLS, p uintptr) int32 {
  88487 	return Xsqlite3_value_nochange(tls, (*Sqlite3_context)(unsafe.Pointer(p)).FpOut)
  88488 }
  88489 
  88490 // The destructor function for a ValueList object.  This needs to be
  88491 // a separate function, unknowable to the application, to ensure that
  88492 // calls to sqlite3_vtab_in_first()/sqlite3_vtab_in_next() that are not
  88493 // preceeded by activation of IN processing via sqlite3_vtab_int() do not
  88494 // try to access a fake ValueList object inserted by a hostile extension.
  88495 func Xsqlite3VdbeValueListFree(tls *libc.TLS, pToDelete uintptr) {
  88496 	Xsqlite3_free(tls, pToDelete)
  88497 }
  88498 
  88499 func valueFromValueList(tls *libc.TLS, pVal uintptr, ppOut uintptr, bNext int32) int32 {
  88500 	bp := tls.Alloc(68)
  88501 	defer tls.Free(68)
  88502 
  88503 	var rc int32
  88504 	var pRhs uintptr
  88505 
  88506 	*(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0)
  88507 	if pVal == uintptr(0) {
  88508 		return SQLITE_MISUSE
  88509 	}
  88510 	if int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags)&MEM_Dyn == 0 || (*Sqlite3_value)(unsafe.Pointer(pVal)).FxDel != *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3VdbeValueListFree})) {
  88511 		return SQLITE_ERROR
  88512 	} else {
  88513 		pRhs = (*Sqlite3_value)(unsafe.Pointer(pVal)).Fz
  88514 	}
  88515 	if bNext != 0 {
  88516 		rc = Xsqlite3BtreeNext(tls, (*ValueList)(unsafe.Pointer(pRhs)).FpCsr, 0)
  88517 	} else {
  88518 		*(*int32)(unsafe.Pointer(bp)) = 0
  88519 		rc = Xsqlite3BtreeFirst(tls, (*ValueList)(unsafe.Pointer(pRhs)).FpCsr, bp)
  88520 
  88521 		if Xsqlite3BtreeEof(tls, (*ValueList)(unsafe.Pointer(pRhs)).FpCsr) != 0 {
  88522 			rc = SQLITE_DONE
  88523 		}
  88524 	}
  88525 	if rc == SQLITE_OK {
  88526 		var sz U32
  88527 
  88528 		libc.Xmemset(tls, bp+8, 0, uint64(unsafe.Sizeof(Mem{})))
  88529 		sz = Xsqlite3BtreePayloadSize(tls, (*ValueList)(unsafe.Pointer(pRhs)).FpCsr)
  88530 		rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, (*ValueList)(unsafe.Pointer(pRhs)).FpCsr, uint32(int32(sz)), bp+8)
  88531 		if rc == SQLITE_OK {
  88532 			var zBuf uintptr = (*Mem)(unsafe.Pointer(bp + 8)).Fz
  88533 
  88534 			var pOut uintptr = (*ValueList)(unsafe.Pointer(pRhs)).FpOut
  88535 			var iOff int32 = 1 + int32(func() uint8 {
  88536 				if int32(*(*U8)(unsafe.Pointer(zBuf + 1))) < int32(U8(0x80)) {
  88537 					return uint8(func() int32 { *(*U32)(unsafe.Pointer(bp + 64)) = U32(*(*U8)(unsafe.Pointer(zBuf + 1))); return 1 }())
  88538 				}
  88539 				return Xsqlite3GetVarint32(tls, zBuf+1, bp+64)
  88540 			}())
  88541 			Xsqlite3VdbeSerialGet(tls, zBuf+uintptr(iOff), *(*U32)(unsafe.Pointer(bp + 64)), pOut)
  88542 			(*Sqlite3_value)(unsafe.Pointer(pOut)).Fenc = (*Sqlite3)(unsafe.Pointer((*Sqlite3_value)(unsafe.Pointer(pOut)).Fdb)).Fenc
  88543 			if int32((*Sqlite3_value)(unsafe.Pointer(pOut)).Fflags)&MEM_Ephem != 0 && Xsqlite3VdbeMemMakeWriteable(tls, pOut) != 0 {
  88544 				rc = SQLITE_NOMEM
  88545 			} else {
  88546 				*(*uintptr)(unsafe.Pointer(ppOut)) = pOut
  88547 			}
  88548 		}
  88549 		Xsqlite3VdbeMemRelease(tls, bp+8)
  88550 	}
  88551 	return rc
  88552 }
  88553 
  88554 // Set the iterator value pVal to point to the first value in the set.
  88555 // Set (*ppOut) to point to this value before returning.
  88556 func Xsqlite3_vtab_in_first(tls *libc.TLS, pVal uintptr, ppOut uintptr) int32 {
  88557 	return valueFromValueList(tls, pVal, ppOut, 0)
  88558 }
  88559 
  88560 // Set the iterator value pVal to point to the next value in the set.
  88561 // Set (*ppOut) to point to this value before returning.
  88562 func Xsqlite3_vtab_in_next(tls *libc.TLS, pVal uintptr, ppOut uintptr) int32 {
  88563 	return valueFromValueList(tls, pVal, ppOut, 1)
  88564 }
  88565 
  88566 // Return the current time for a statement.  If the current time
  88567 // is requested more than once within the same run of a single prepared
  88568 // statement, the exact same time is returned for each invocation regardless
  88569 // of the amount of time that elapses between invocations.  In other words,
  88570 // the time returned is always the time of the first call.
  88571 func Xsqlite3StmtCurrentTime(tls *libc.TLS, p uintptr) Sqlite3_int64 {
  88572 	bp := tls.Alloc(8)
  88573 	defer tls.Free(8)
  88574 
  88575 	var rc int32
  88576 	*(*Sqlite3_int64)(unsafe.Pointer(bp)) = int64(0)
  88577 	var piTime uintptr
  88578 	if (*Sqlite3_context)(unsafe.Pointer(p)).FpVdbe != uintptr(0) {
  88579 		piTime = (*Sqlite3_context)(unsafe.Pointer(p)).FpVdbe + 72
  88580 	} else {
  88581 		piTime = bp
  88582 	}
  88583 	if *(*Sqlite3_int64)(unsafe.Pointer(piTime)) == int64(0) {
  88584 		rc = Xsqlite3OsCurrentTimeInt64(tls, (*Sqlite3)(unsafe.Pointer((*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpOut)).Fdb)).FpVfs, piTime)
  88585 		if rc != 0 {
  88586 			*(*Sqlite3_int64)(unsafe.Pointer(piTime)) = int64(0)
  88587 		}
  88588 	}
  88589 	return *(*Sqlite3_int64)(unsafe.Pointer(piTime))
  88590 }
  88591 
  88592 func createAggContext(tls *libc.TLS, p uintptr, nByte int32) uintptr {
  88593 	var pMem uintptr = (*Sqlite3_context)(unsafe.Pointer(p)).FpMem
  88594 
  88595 	if nByte <= 0 {
  88596 		Xsqlite3VdbeMemSetNull(tls, pMem)
  88597 		(*Mem)(unsafe.Pointer(pMem)).Fz = uintptr(0)
  88598 	} else {
  88599 		Xsqlite3VdbeMemClearAndResize(tls, pMem, nByte)
  88600 		(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Agg)
  88601 		*(*uintptr)(unsafe.Pointer(pMem)) = (*Sqlite3_context)(unsafe.Pointer(p)).FpFunc
  88602 		if (*Mem)(unsafe.Pointer(pMem)).Fz != 0 {
  88603 			libc.Xmemset(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, 0, uint64(nByte))
  88604 		}
  88605 	}
  88606 	return (*Mem)(unsafe.Pointer(pMem)).Fz
  88607 }
  88608 
  88609 // Allocate or return the aggregate context for a user function.  A new
  88610 // context is allocated on the first call.  Subsequent calls return the
  88611 // same context that was returned on prior calls.
  88612 func Xsqlite3_aggregate_context(tls *libc.TLS, p uintptr, nByte int32) uintptr {
  88613 	if int32((*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpMem)).Fflags)&MEM_Agg == 0 {
  88614 		return createAggContext(tls, p, nByte)
  88615 	} else {
  88616 		return (*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpMem)).Fz
  88617 	}
  88618 	return uintptr(0)
  88619 }
  88620 
  88621 // Return the auxiliary data pointer, if any, for the iArg'th argument to
  88622 // the user-function defined by pCtx.
  88623 //
  88624 // The left-most argument is 0.
  88625 //
  88626 // Undocumented behavior:  If iArg is negative then access a cache of
  88627 // auxiliary data pointers that is available to all functions within a
  88628 // single prepared statement.  The iArg values must match.
  88629 func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) uintptr {
  88630 	var pAuxData uintptr
  88631 
  88632 	if (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe == uintptr(0) {
  88633 		return uintptr(0)
  88634 	}
  88635 	for pAuxData = (*Vdbe)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FpAuxData; pAuxData != 0; pAuxData = (*AuxData)(unsafe.Pointer(pAuxData)).FpNextAux {
  88636 		if (*AuxData)(unsafe.Pointer(pAuxData)).FiAuxArg == iArg && ((*AuxData)(unsafe.Pointer(pAuxData)).FiAuxOp == (*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp || iArg < 0) {
  88637 			return (*AuxData)(unsafe.Pointer(pAuxData)).FpAux
  88638 		}
  88639 	}
  88640 	return uintptr(0)
  88641 }
  88642 
  88643 // Set the auxiliary data pointer and delete function, for the iArg'th
  88644 // argument to the user-function defined by pCtx. Any previous value is
  88645 // deleted by calling the delete function specified when it was set.
  88646 //
  88647 // The left-most argument is 0.
  88648 //
  88649 // Undocumented behavior:  If iArg is negative then make the data available
  88650 // to all functions within the current prepared statement using iArg as an
  88651 // access code.
  88652 func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr) {
  88653 	var pAuxData uintptr
  88654 	var pVdbe uintptr
  88655 	pVdbe = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe
  88656 
  88657 	if !(pVdbe == uintptr(0)) {
  88658 		goto __1
  88659 	}
  88660 	goto failed
  88661 __1:
  88662 	;
  88663 	pAuxData = (*Vdbe)(unsafe.Pointer(pVdbe)).FpAuxData
  88664 __2:
  88665 	if !(pAuxData != 0) {
  88666 		goto __4
  88667 	}
  88668 	if !((*AuxData)(unsafe.Pointer(pAuxData)).FiAuxArg == iArg && ((*AuxData)(unsafe.Pointer(pAuxData)).FiAuxOp == (*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp || iArg < 0)) {
  88669 		goto __5
  88670 	}
  88671 	goto __4
  88672 __5:
  88673 	;
  88674 	goto __3
  88675 __3:
  88676 	pAuxData = (*AuxData)(unsafe.Pointer(pAuxData)).FpNextAux
  88677 	goto __2
  88678 	goto __4
  88679 __4:
  88680 	;
  88681 	if !(pAuxData == uintptr(0)) {
  88682 		goto __6
  88683 	}
  88684 	pAuxData = Xsqlite3DbMallocZero(tls, (*Vdbe)(unsafe.Pointer(pVdbe)).Fdb, uint64(unsafe.Sizeof(AuxData{})))
  88685 	if !!(pAuxData != 0) {
  88686 		goto __8
  88687 	}
  88688 	goto failed
  88689 __8:
  88690 	;
  88691 	(*AuxData)(unsafe.Pointer(pAuxData)).FiAuxOp = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp
  88692 	(*AuxData)(unsafe.Pointer(pAuxData)).FiAuxArg = iArg
  88693 	(*AuxData)(unsafe.Pointer(pAuxData)).FpNextAux = (*Vdbe)(unsafe.Pointer(pVdbe)).FpAuxData
  88694 	(*Vdbe)(unsafe.Pointer(pVdbe)).FpAuxData = pAuxData
  88695 	if !((*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError == 0) {
  88696 		goto __9
  88697 	}
  88698 	(*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = -1
  88699 __9:
  88700 	;
  88701 	goto __7
  88702 __6:
  88703 	if !((*AuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux != 0) {
  88704 		goto __10
  88705 	}
  88706 	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*AuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux})).f(tls, (*AuxData)(unsafe.Pointer(pAuxData)).FpAux)
  88707 __10:
  88708 	;
  88709 __7:
  88710 	;
  88711 	(*AuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux
  88712 	(*AuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete
  88713 	return
  88714 
  88715 failed:
  88716 	if !(xDelete != 0) {
  88717 		goto __11
  88718 	}
  88719 	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{xDelete})).f(tls, pAux)
  88720 __11:
  88721 }
  88722 
  88723 // Return the number of times the Step function of an aggregate has been
  88724 // called.
  88725 //
  88726 // This function is deprecated.  Do not use it for new code.  It is
  88727 // provide only to avoid breaking legacy code.  New aggregate function
  88728 // implementations should keep their own counts within their aggregate
  88729 // context.
  88730 func Xsqlite3_aggregate_count(tls *libc.TLS, p uintptr) int32 {
  88731 	return (*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpMem)).Fn
  88732 }
  88733 
  88734 // Return the number of columns in the result set for the statement pStmt.
  88735 func Xsqlite3_column_count(tls *libc.TLS, pStmt uintptr) int32 {
  88736 	var pVm uintptr = pStmt
  88737 	if pVm != 0 {
  88738 		return int32((*Vdbe)(unsafe.Pointer(pVm)).FnResColumn)
  88739 	}
  88740 	return 0
  88741 }
  88742 
  88743 // Return the number of values available from the current row of the
  88744 // currently executing statement pStmt.
  88745 func Xsqlite3_data_count(tls *libc.TLS, pStmt uintptr) int32 {
  88746 	var pVm uintptr = pStmt
  88747 	if pVm == uintptr(0) || (*Vdbe)(unsafe.Pointer(pVm)).FpResultRow == uintptr(0) {
  88748 		return 0
  88749 	}
  88750 	return int32((*Vdbe)(unsafe.Pointer(pVm)).FnResColumn)
  88751 }
  88752 
  88753 func columnNullValue(tls *libc.TLS) uintptr {
  88754 	return uintptr(unsafe.Pointer(&nullMem))
  88755 }
  88756 
  88757 var nullMem = Mem{
  88758 	Fflags: U16(MEM_Null),
  88759 }
  88760 
  88761 func columnMem(tls *libc.TLS, pStmt uintptr, i int32) uintptr {
  88762 	var pVm uintptr
  88763 	var pOut uintptr
  88764 
  88765 	pVm = pStmt
  88766 	if pVm == uintptr(0) {
  88767 		return columnNullValue(tls)
  88768 	}
  88769 
  88770 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(pVm)).Fdb)).Fmutex)
  88771 	if (*Vdbe)(unsafe.Pointer(pVm)).FpResultRow != uintptr(0) && i < int32((*Vdbe)(unsafe.Pointer(pVm)).FnResColumn) && i >= 0 {
  88772 		pOut = (*Vdbe)(unsafe.Pointer(pVm)).FpResultRow + uintptr(i)*56
  88773 	} else {
  88774 		Xsqlite3Error(tls, (*Vdbe)(unsafe.Pointer(pVm)).Fdb, SQLITE_RANGE)
  88775 		pOut = columnNullValue(tls)
  88776 	}
  88777 	return pOut
  88778 }
  88779 
  88780 func columnMallocFailure(tls *libc.TLS, pStmt uintptr) {
  88781 	var p uintptr = pStmt
  88782 	if p != 0 {
  88783 		(*Vdbe)(unsafe.Pointer(p)).Frc = Xsqlite3ApiExit(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, (*Vdbe)(unsafe.Pointer(p)).Frc)
  88784 		Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
  88785 	}
  88786 }
  88787 
  88788 // *************************** sqlite3_column_  *******************************
  88789 //
  88790 // The following routines are used to access elements of the current row
  88791 // in the result set.
  88792 func Xsqlite3_column_blob(tls *libc.TLS, pStmt uintptr, i int32) uintptr {
  88793 	var val uintptr
  88794 	val = Xsqlite3_value_blob(tls, columnMem(tls, pStmt, i))
  88795 
  88796 	columnMallocFailure(tls, pStmt)
  88797 	return val
  88798 }
  88799 
  88800 func Xsqlite3_column_bytes(tls *libc.TLS, pStmt uintptr, i int32) int32 {
  88801 	var val int32 = Xsqlite3_value_bytes(tls, columnMem(tls, pStmt, i))
  88802 	columnMallocFailure(tls, pStmt)
  88803 	return val
  88804 }
  88805 
  88806 func Xsqlite3_column_bytes16(tls *libc.TLS, pStmt uintptr, i int32) int32 {
  88807 	var val int32 = Xsqlite3_value_bytes16(tls, columnMem(tls, pStmt, i))
  88808 	columnMallocFailure(tls, pStmt)
  88809 	return val
  88810 }
  88811 
  88812 func Xsqlite3_column_double(tls *libc.TLS, pStmt uintptr, i int32) float64 {
  88813 	var val float64 = Xsqlite3_value_double(tls, columnMem(tls, pStmt, i))
  88814 	columnMallocFailure(tls, pStmt)
  88815 	return val
  88816 }
  88817 
  88818 func Xsqlite3_column_int(tls *libc.TLS, pStmt uintptr, i int32) int32 {
  88819 	var val int32 = Xsqlite3_value_int(tls, columnMem(tls, pStmt, i))
  88820 	columnMallocFailure(tls, pStmt)
  88821 	return val
  88822 }
  88823 
  88824 func Xsqlite3_column_int64(tls *libc.TLS, pStmt uintptr, i int32) Sqlite_int64 {
  88825 	var val Sqlite_int64 = Xsqlite3_value_int64(tls, columnMem(tls, pStmt, i))
  88826 	columnMallocFailure(tls, pStmt)
  88827 	return val
  88828 }
  88829 
  88830 func Xsqlite3_column_text(tls *libc.TLS, pStmt uintptr, i int32) uintptr {
  88831 	var val uintptr = Xsqlite3_value_text(tls, columnMem(tls, pStmt, i))
  88832 	columnMallocFailure(tls, pStmt)
  88833 	return val
  88834 }
  88835 
  88836 func Xsqlite3_column_value(tls *libc.TLS, pStmt uintptr, i int32) uintptr {
  88837 	var pOut uintptr = columnMem(tls, pStmt, i)
  88838 	if int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&MEM_Static != 0 {
  88839 		*(*U16)(unsafe.Pointer(pOut + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Static))
  88840 		*(*U16)(unsafe.Pointer(pOut + 20)) |= U16(MEM_Ephem)
  88841 	}
  88842 	columnMallocFailure(tls, pStmt)
  88843 	return pOut
  88844 }
  88845 
  88846 func Xsqlite3_column_text16(tls *libc.TLS, pStmt uintptr, i int32) uintptr {
  88847 	var val uintptr = Xsqlite3_value_text16(tls, columnMem(tls, pStmt, i))
  88848 	columnMallocFailure(tls, pStmt)
  88849 	return val
  88850 }
  88851 
  88852 func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) int32 {
  88853 	var iType int32 = Xsqlite3_value_type(tls, columnMem(tls, pStmt, i))
  88854 	columnMallocFailure(tls, pStmt)
  88855 	return iType
  88856 }
  88857 
  88858 func columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType int32) uintptr {
  88859 	var ret uintptr
  88860 	var p uintptr
  88861 	var n int32
  88862 	var db uintptr
  88863 	ret = uintptr(0)
  88864 	p = pStmt
  88865 	db = (*Vdbe)(unsafe.Pointer(p)).Fdb
  88866 
  88867 	n = Xsqlite3_column_count(tls, pStmt)
  88868 	if N < n && N >= 0 {
  88869 		N = N + useType*n
  88870 		Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
  88871 
  88872 		if useUtf16 != 0 {
  88873 			ret = Xsqlite3_value_text16(tls, (*Vdbe)(unsafe.Pointer(p)).FaColName+uintptr(N)*56)
  88874 		} else {
  88875 			ret = Xsqlite3_value_text(tls, (*Vdbe)(unsafe.Pointer(p)).FaColName+uintptr(N)*56)
  88876 		}
  88877 
  88878 		if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
  88879 			Xsqlite3OomClear(tls, db)
  88880 			ret = uintptr(0)
  88881 		}
  88882 		Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
  88883 	}
  88884 	return ret
  88885 }
  88886 
  88887 // Return the name of the Nth column of the result set returned by SQL
  88888 // statement pStmt.
  88889 func Xsqlite3_column_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr {
  88890 	return columnName(tls, pStmt, N, 0, COLNAME_NAME)
  88891 }
  88892 
  88893 func Xsqlite3_column_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr {
  88894 	return columnName(tls, pStmt, N, 1, COLNAME_NAME)
  88895 }
  88896 
  88897 // Return the column declaration type (if applicable) of the 'i'th column
  88898 // of the result set of SQL statement pStmt.
  88899 func Xsqlite3_column_decltype(tls *libc.TLS, pStmt uintptr, N int32) uintptr {
  88900 	return columnName(tls, pStmt, N, 0, COLNAME_DECLTYPE)
  88901 }
  88902 
  88903 func Xsqlite3_column_decltype16(tls *libc.TLS, pStmt uintptr, N int32) uintptr {
  88904 	return columnName(tls, pStmt, N, 1, COLNAME_DECLTYPE)
  88905 }
  88906 
  88907 // Return the name of the database from which a result column derives.
  88908 // NULL is returned if the result column is an expression or constant or
  88909 // anything else which is not an unambiguous reference to a database column.
  88910 func Xsqlite3_column_database_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr {
  88911 	return columnName(tls, pStmt, N, 0, COLNAME_DATABASE)
  88912 }
  88913 
  88914 func Xsqlite3_column_database_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr {
  88915 	return columnName(tls, pStmt, N, 1, COLNAME_DATABASE)
  88916 }
  88917 
  88918 // Return the name of the table from which a result column derives.
  88919 // NULL is returned if the result column is an expression or constant or
  88920 // anything else which is not an unambiguous reference to a database column.
  88921 func Xsqlite3_column_table_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr {
  88922 	return columnName(tls, pStmt, N, 0, COLNAME_TABLE)
  88923 }
  88924 
  88925 func Xsqlite3_column_table_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr {
  88926 	return columnName(tls, pStmt, N, 1, COLNAME_TABLE)
  88927 }
  88928 
  88929 // Return the name of the table column from which a result column derives.
  88930 // NULL is returned if the result column is an expression or constant or
  88931 // anything else which is not an unambiguous reference to a database column.
  88932 func Xsqlite3_column_origin_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr {
  88933 	return columnName(tls, pStmt, N, 0, COLNAME_COLUMN)
  88934 }
  88935 
  88936 func Xsqlite3_column_origin_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr {
  88937 	return columnName(tls, pStmt, N, 1, COLNAME_COLUMN)
  88938 }
  88939 
  88940 func vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) int32 {
  88941 	bp := tls.Alloc(8)
  88942 	defer tls.Free(8)
  88943 
  88944 	var pVar uintptr
  88945 	if vdbeSafetyNotNull(tls, p) != 0 {
  88946 		return Xsqlite3MisuseError(tls, 89212)
  88947 	}
  88948 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
  88949 	if int32((*Vdbe)(unsafe.Pointer(p)).FeVdbeState) != VDBE_READY_STATE {
  88950 		Xsqlite3Error(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, SQLITE_MISUSE)
  88951 		Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
  88952 		Xsqlite3_log(tls, SQLITE_MISUSE,
  88953 			ts+6709, libc.VaList(bp, (*Vdbe)(unsafe.Pointer(p)).FzSql))
  88954 		return Xsqlite3MisuseError(tls, 89220)
  88955 	}
  88956 	if i >= uint32((*Vdbe)(unsafe.Pointer(p)).FnVar) {
  88957 		Xsqlite3Error(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, SQLITE_RANGE)
  88958 		Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
  88959 		return SQLITE_RANGE
  88960 	}
  88961 	pVar = (*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i)*56
  88962 	Xsqlite3VdbeMemRelease(tls, pVar)
  88963 	(*Mem)(unsafe.Pointer(pVar)).Fflags = U16(MEM_Null)
  88964 	(*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FerrCode = SQLITE_OK
  88965 
  88966 	if (*Vdbe)(unsafe.Pointer(p)).Fexpmask != U32(0) && (*Vdbe)(unsafe.Pointer(p)).Fexpmask&func() uint32 {
  88967 		if i >= uint32(31) {
  88968 			return 0x80000000
  88969 		}
  88970 		return U32(1) << i
  88971 	}() != U32(0) {
  88972 		libc.SetBitFieldPtr8Uint32(p+200, Bft(1), 0, 0x3)
  88973 	}
  88974 	return SQLITE_OK
  88975 }
  88976 
  88977 func bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData I64, xDel uintptr, encoding U8) int32 {
  88978 	var p uintptr = pStmt
  88979 	var pVar uintptr
  88980 	var rc int32
  88981 
  88982 	rc = vdbeUnbind(tls, p, U32(i-1))
  88983 	if rc == SQLITE_OK {
  88984 		if zData != uintptr(0) {
  88985 			pVar = (*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i-1)*56
  88986 			rc = Xsqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, xDel)
  88987 			if rc == SQLITE_OK && int32(encoding) != 0 {
  88988 				rc = Xsqlite3VdbeChangeEncoding(tls, pVar, int32((*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fenc))
  88989 			}
  88990 			if rc != 0 {
  88991 				Xsqlite3Error(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, rc)
  88992 				rc = Xsqlite3ApiExit(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, rc)
  88993 			}
  88994 		}
  88995 		Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
  88996 	} else if xDel != uintptr(0) && xDel != libc.UintptrFromInt32(-1) {
  88997 		(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{xDel})).f(tls, zData)
  88998 	}
  88999 	return rc
  89000 }
  89001 
  89002 // Bind a blob value to an SQL statement variable.
  89003 func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 {
  89004 	return bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(0))
  89005 }
  89006 
  89007 func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Sqlite3_uint64, xDel uintptr) int32 {
  89008 	return bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(0))
  89009 }
  89010 
  89011 func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) int32 {
  89012 	var rc int32
  89013 	var p uintptr = pStmt
  89014 	rc = vdbeUnbind(tls, p, U32(i-1))
  89015 	if rc == SQLITE_OK {
  89016 		Xsqlite3VdbeMemSetDouble(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-1)*56, rValue)
  89017 		Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
  89018 	}
  89019 	return rc
  89020 }
  89021 
  89022 func Xsqlite3_bind_int(tls *libc.TLS, p uintptr, i int32, iValue int32) int32 {
  89023 	return Xsqlite3_bind_int64(tls, p, i, I64(iValue))
  89024 }
  89025 
  89026 func Xsqlite3_bind_int64(tls *libc.TLS, pStmt uintptr, i int32, iValue Sqlite_int64) int32 {
  89027 	var rc int32
  89028 	var p uintptr = pStmt
  89029 	rc = vdbeUnbind(tls, p, U32(i-1))
  89030 	if rc == SQLITE_OK {
  89031 		Xsqlite3VdbeMemSetInt64(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-1)*56, iValue)
  89032 		Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
  89033 	}
  89034 	return rc
  89035 }
  89036 
  89037 func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) int32 {
  89038 	var rc int32
  89039 	var p uintptr = pStmt
  89040 	rc = vdbeUnbind(tls, p, U32(i-1))
  89041 	if rc == SQLITE_OK {
  89042 		Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
  89043 	}
  89044 	return rc
  89045 }
  89046 
  89047 func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) int32 {
  89048 	var rc int32
  89049 	var p uintptr = pStmt
  89050 	rc = vdbeUnbind(tls, p, U32(i-1))
  89051 	if rc == SQLITE_OK {
  89052 		Xsqlite3VdbeMemSetPointer(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-1)*56, pPtr, zPTtype, xDestructor)
  89053 		Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
  89054 	} else if xDestructor != 0 {
  89055 		(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{xDestructor})).f(tls, pPtr)
  89056 	}
  89057 	return rc
  89058 }
  89059 
  89060 func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 {
  89061 	return bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(SQLITE_UTF8))
  89062 }
  89063 
  89064 func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Sqlite3_uint64, xDel uintptr, enc uint8) int32 {
  89065 	if int32(enc) != SQLITE_UTF8 {
  89066 		if int32(enc) == SQLITE_UTF16 {
  89067 			enc = uint8(SQLITE_UTF16LE)
  89068 		}
  89069 		nData = nData & libc.Uint64FromInt32(libc.CplInt32(int32(U16(1))))
  89070 	}
  89071 	return bindText(tls, pStmt, i, zData, int64(nData), xDel, enc)
  89072 }
  89073 
  89074 func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, xDel uintptr) int32 {
  89075 	return bindText(tls, pStmt, i, zData, int64(U64(n)&libc.CplUint64(uint64(1))), xDel, uint8(SQLITE_UTF16LE))
  89076 }
  89077 
  89078 func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) int32 {
  89079 	var rc int32
  89080 	switch Xsqlite3_value_type(tls, pValue) {
  89081 	case SQLITE_INTEGER:
  89082 		{
  89083 			rc = Xsqlite3_bind_int64(tls, pStmt, i, *(*I64)(unsafe.Pointer(pValue)))
  89084 			break
  89085 
  89086 		}
  89087 	case SQLITE_FLOAT:
  89088 		{
  89089 			rc = Xsqlite3_bind_double(tls, pStmt, i,
  89090 				func() float64 {
  89091 					if int32((*Sqlite3_value)(unsafe.Pointer(pValue)).Fflags)&MEM_Real != 0 {
  89092 						return *(*float64)(unsafe.Pointer(pValue))
  89093 					}
  89094 					return float64(*(*I64)(unsafe.Pointer(pValue)))
  89095 				}())
  89096 			break
  89097 
  89098 		}
  89099 	case SQLITE_BLOB:
  89100 		{
  89101 			if int32((*Sqlite3_value)(unsafe.Pointer(pValue)).Fflags)&MEM_Zero != 0 {
  89102 				rc = Xsqlite3_bind_zeroblob(tls, pStmt, i, *(*int32)(unsafe.Pointer(pValue)))
  89103 			} else {
  89104 				rc = Xsqlite3_bind_blob(tls, pStmt, i, (*Sqlite3_value)(unsafe.Pointer(pValue)).Fz, (*Sqlite3_value)(unsafe.Pointer(pValue)).Fn, libc.UintptrFromInt32(-1))
  89105 			}
  89106 			break
  89107 
  89108 		}
  89109 	case SQLITE_TEXT:
  89110 		{
  89111 			rc = bindText(tls, pStmt, i, (*Sqlite3_value)(unsafe.Pointer(pValue)).Fz, int64((*Sqlite3_value)(unsafe.Pointer(pValue)).Fn), libc.UintptrFromInt32(-1),
  89112 				(*Sqlite3_value)(unsafe.Pointer(pValue)).Fenc)
  89113 			break
  89114 
  89115 		}
  89116 	default:
  89117 		{
  89118 			rc = Xsqlite3_bind_null(tls, pStmt, i)
  89119 			break
  89120 
  89121 		}
  89122 	}
  89123 	return rc
  89124 }
  89125 
  89126 func Xsqlite3_bind_zeroblob(tls *libc.TLS, pStmt uintptr, i int32, n int32) int32 {
  89127 	var rc int32
  89128 	var p uintptr = pStmt
  89129 	rc = vdbeUnbind(tls, p, U32(i-1))
  89130 	if rc == SQLITE_OK {
  89131 		Xsqlite3VdbeMemSetZeroBlob(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-1)*56, n)
  89132 		Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
  89133 	}
  89134 	return rc
  89135 }
  89136 
  89137 func Xsqlite3_bind_zeroblob64(tls *libc.TLS, pStmt uintptr, i int32, n Sqlite3_uint64) int32 {
  89138 	var rc int32
  89139 	var p uintptr = pStmt
  89140 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
  89141 	if n > U64(*(*int32)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb + 136))) {
  89142 		rc = SQLITE_TOOBIG
  89143 	} else {
  89144 		rc = Xsqlite3_bind_zeroblob(tls, pStmt, i, int32(n))
  89145 	}
  89146 	rc = Xsqlite3ApiExit(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, rc)
  89147 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
  89148 	return rc
  89149 }
  89150 
  89151 // Return the number of wildcards that can be potentially bound to.
  89152 // This routine is added to support DBD::SQLite.
  89153 func Xsqlite3_bind_parameter_count(tls *libc.TLS, pStmt uintptr) int32 {
  89154 	var p uintptr = pStmt
  89155 	if p != 0 {
  89156 		return int32((*Vdbe)(unsafe.Pointer(p)).FnVar)
  89157 	}
  89158 	return 0
  89159 }
  89160 
  89161 // Return the name of a wildcard parameter.  Return NULL if the index
  89162 // is out of range or if the wildcard is unnamed.
  89163 //
  89164 // The result is always UTF-8.
  89165 func Xsqlite3_bind_parameter_name(tls *libc.TLS, pStmt uintptr, i int32) uintptr {
  89166 	var p uintptr = pStmt
  89167 	if p == uintptr(0) {
  89168 		return uintptr(0)
  89169 	}
  89170 	return Xsqlite3VListNumToName(tls, (*Vdbe)(unsafe.Pointer(p)).FpVList, i)
  89171 }
  89172 
  89173 // Given a wildcard parameter name, return the index of the variable
  89174 // with that name.  If there is no variable with the given name,
  89175 // return 0.
  89176 func Xsqlite3VdbeParameterIndex(tls *libc.TLS, p uintptr, zName uintptr, nName int32) int32 {
  89177 	if p == uintptr(0) || zName == uintptr(0) {
  89178 		return 0
  89179 	}
  89180 	return Xsqlite3VListNameToNum(tls, (*Vdbe)(unsafe.Pointer(p)).FpVList, zName, nName)
  89181 }
  89182 
  89183 func Xsqlite3_bind_parameter_index(tls *libc.TLS, pStmt uintptr, zName uintptr) int32 {
  89184 	return Xsqlite3VdbeParameterIndex(tls, pStmt, zName, Xsqlite3Strlen30(tls, zName))
  89185 }
  89186 
  89187 // Transfer all bindings from the first statement over to the second.
  89188 func Xsqlite3TransferBindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintptr) int32 {
  89189 	var pFrom uintptr = pFromStmt
  89190 	var pTo uintptr = pToStmt
  89191 	var i int32
  89192 
  89193 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(pTo)).Fdb)).Fmutex)
  89194 	for i = 0; i < int32((*Vdbe)(unsafe.Pointer(pFrom)).FnVar); i++ {
  89195 		Xsqlite3VdbeMemMove(tls, (*Vdbe)(unsafe.Pointer(pTo)).FaVar+uintptr(i)*56, (*Vdbe)(unsafe.Pointer(pFrom)).FaVar+uintptr(i)*56)
  89196 	}
  89197 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(pTo)).Fdb)).Fmutex)
  89198 	return SQLITE_OK
  89199 }
  89200 
  89201 // Deprecated external interface.  Internal/core SQLite code
  89202 // should call sqlite3TransferBindings.
  89203 //
  89204 // It is misuse to call this routine with statements from different
  89205 // database connections.  But as this is a deprecated interface, we
  89206 // will not bother to check for that condition.
  89207 //
  89208 // If the two statements contain a different number of bindings, then
  89209 // an SQLITE_ERROR is returned.  Nothing else can go wrong, so otherwise
  89210 // SQLITE_OK is returned.
  89211 func Xsqlite3_transfer_bindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintptr) int32 {
  89212 	var pFrom uintptr = pFromStmt
  89213 	var pTo uintptr = pToStmt
  89214 	if int32((*Vdbe)(unsafe.Pointer(pFrom)).FnVar) != int32((*Vdbe)(unsafe.Pointer(pTo)).FnVar) {
  89215 		return SQLITE_ERROR
  89216 	}
  89217 
  89218 	if (*Vdbe)(unsafe.Pointer(pTo)).Fexpmask != 0 {
  89219 		libc.SetBitFieldPtr8Uint32(pTo+200, Bft(1), 0, 0x3)
  89220 	}
  89221 
  89222 	if (*Vdbe)(unsafe.Pointer(pFrom)).Fexpmask != 0 {
  89223 		libc.SetBitFieldPtr8Uint32(pFrom+200, Bft(1), 0, 0x3)
  89224 	}
  89225 	return Xsqlite3TransferBindings(tls, pFromStmt, pToStmt)
  89226 }
  89227 
  89228 // Return the sqlite3* database handle to which the prepared statement given
  89229 // in the argument belongs.  This is the same database handle that was
  89230 // the first argument to the sqlite3_prepare() that was used to create
  89231 // the statement in the first place.
  89232 func Xsqlite3_db_handle(tls *libc.TLS, pStmt uintptr) uintptr {
  89233 	if pStmt != 0 {
  89234 		return (*Vdbe)(unsafe.Pointer(pStmt)).Fdb
  89235 	}
  89236 	return uintptr(0)
  89237 }
  89238 
  89239 // Return true if the prepared statement is guaranteed to not modify the
  89240 // database.
  89241 func Xsqlite3_stmt_readonly(tls *libc.TLS, pStmt uintptr) int32 {
  89242 	if pStmt != 0 {
  89243 		return int32(*(*uint8)(unsafe.Pointer(pStmt + 200)) & 0x40 >> 6)
  89244 	}
  89245 	return 1
  89246 }
  89247 
  89248 // Return 1 if the statement is an EXPLAIN and return 2 if the
  89249 // statement is an EXPLAIN QUERY PLAN
  89250 func Xsqlite3_stmt_isexplain(tls *libc.TLS, pStmt uintptr) int32 {
  89251 	if pStmt != 0 {
  89252 		return int32(*(*uint8)(unsafe.Pointer(pStmt + 200)) & 0xc >> 2)
  89253 	}
  89254 	return 0
  89255 }
  89256 
  89257 // Return true if the prepared statement is in need of being reset.
  89258 func Xsqlite3_stmt_busy(tls *libc.TLS, pStmt uintptr) int32 {
  89259 	var v uintptr = pStmt
  89260 	return libc.Bool32(v != uintptr(0) && int32((*Vdbe)(unsafe.Pointer(v)).FeVdbeState) == VDBE_RUN_STATE)
  89261 }
  89262 
  89263 // Return a pointer to the next prepared statement after pStmt associated
  89264 // with database connection pDb.  If pStmt is NULL, return the first
  89265 // prepared statement for the database connection.  Return NULL if there
  89266 // are no more.
  89267 func Xsqlite3_next_stmt(tls *libc.TLS, pDb uintptr, pStmt uintptr) uintptr {
  89268 	var pNext uintptr
  89269 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(pDb)).Fmutex)
  89270 	if pStmt == uintptr(0) {
  89271 		pNext = (*Sqlite3)(unsafe.Pointer(pDb)).FpVdbe
  89272 	} else {
  89273 		pNext = (*Vdbe)(unsafe.Pointer(pStmt)).FpVNext
  89274 	}
  89275 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(pDb)).Fmutex)
  89276 	return pNext
  89277 }
  89278 
  89279 // Return the value of a status counter for a prepared statement
  89280 func Xsqlite3_stmt_status(tls *libc.TLS, pStmt uintptr, op int32, resetFlag int32) int32 {
  89281 	bp := tls.Alloc(4)
  89282 	defer tls.Free(4)
  89283 
  89284 	var pVdbe uintptr = pStmt
  89285 
  89286 	if op == SQLITE_STMTSTATUS_MEMUSED {
  89287 		var db uintptr = (*Vdbe)(unsafe.Pointer(pVdbe)).Fdb
  89288 		Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
  89289 		*(*U32)(unsafe.Pointer(bp)) = U32(0)
  89290 		(*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed = bp
  89291 
  89292 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart
  89293 		Xsqlite3VdbeDelete(tls, pVdbe)
  89294 		(*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed = uintptr(0)
  89295 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd
  89296 		Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
  89297 	} else {
  89298 		*(*U32)(unsafe.Pointer(bp)) = *(*U32)(unsafe.Pointer(pVdbe + 212 + uintptr(op)*4))
  89299 		if resetFlag != 0 {
  89300 			*(*U32)(unsafe.Pointer(pVdbe + 212 + uintptr(op)*4)) = U32(0)
  89301 		}
  89302 	}
  89303 	return int32(*(*U32)(unsafe.Pointer(bp)))
  89304 }
  89305 
  89306 // Return the SQL associated with a prepared statement
  89307 func Xsqlite3_sql(tls *libc.TLS, pStmt uintptr) uintptr {
  89308 	var p uintptr = pStmt
  89309 	if p != 0 {
  89310 		return (*Vdbe)(unsafe.Pointer(p)).FzSql
  89311 	}
  89312 	return uintptr(0)
  89313 }
  89314 
  89315 // Return the SQL associated with a prepared statement with
  89316 // bound parameters expanded.  Space to hold the returned string is
  89317 // obtained from sqlite3_malloc().  The caller is responsible for
  89318 // freeing the returned string by passing it to sqlite3_free().
  89319 //
  89320 // The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of
  89321 // expanded bound parameters.
  89322 func Xsqlite3_expanded_sql(tls *libc.TLS, pStmt uintptr) uintptr {
  89323 	var z uintptr = uintptr(0)
  89324 	var zSql uintptr = Xsqlite3_sql(tls, pStmt)
  89325 	if zSql != 0 {
  89326 		var p uintptr = pStmt
  89327 		Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
  89328 		z = Xsqlite3VdbeExpandSql(tls, p, zSql)
  89329 		Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
  89330 	}
  89331 	return z
  89332 }
  89333 
  89334 func vdbeUnpackRecord(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey uintptr) uintptr {
  89335 	var pRet uintptr
  89336 
  89337 	pRet = Xsqlite3VdbeAllocUnpackedRecord(tls, pKeyInfo)
  89338 	if pRet != 0 {
  89339 		libc.Xmemset(tls, (*UnpackedRecord)(unsafe.Pointer(pRet)).FaMem, 0, uint64(unsafe.Sizeof(Mem{}))*uint64(int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)+1))
  89340 		Xsqlite3VdbeRecordUnpack(tls, pKeyInfo, nKey, pKey, pRet)
  89341 	}
  89342 	return pRet
  89343 }
  89344 
  89345 // This function is called from within a pre-update callback to retrieve
  89346 // a field of the row currently being updated or deleted.
  89347 func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintptr) int32 {
  89348 	var p uintptr
  89349 	var pMem uintptr
  89350 	var rc int32
  89351 	var nRec U32
  89352 	var aRec uintptr
  89353 	p = (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate
  89354 	rc = SQLITE_OK
  89355 
  89356 	if !(!(p != 0) || (*PreUpdate)(unsafe.Pointer(p)).Fop == SQLITE_INSERT) {
  89357 		goto __1
  89358 	}
  89359 	rc = Xsqlite3MisuseError(tls, 89711)
  89360 	goto preupdate_old_out
  89361 __1:
  89362 	;
  89363 	if !((*PreUpdate)(unsafe.Pointer(p)).FpPk != 0) {
  89364 		goto __2
  89365 	}
  89366 	iIdx = int32(Xsqlite3TableColumnToIndex(tls, (*PreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx)))
  89367 __2:
  89368 	;
  89369 	if !(iIdx >= int32((*VdbeCursor)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField) || iIdx < 0) {
  89370 		goto __3
  89371 	}
  89372 	rc = SQLITE_RANGE
  89373 	goto preupdate_old_out
  89374 __3:
  89375 	;
  89376 	if !((*PreUpdate)(unsafe.Pointer(p)).FpUnpacked == uintptr(0)) {
  89377 		goto __4
  89378 	}
  89379 
  89380 	nRec = Xsqlite3BtreePayloadSize(tls, *(*uintptr)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpCsr + 48)))
  89381 	aRec = Xsqlite3DbMallocRaw(tls, db, uint64(nRec))
  89382 	if !!(aRec != 0) {
  89383 		goto __5
  89384 	}
  89385 	goto preupdate_old_out
  89386 __5:
  89387 	;
  89388 	rc = Xsqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpCsr + 48)), uint32(0), nRec, aRec)
  89389 	if !(rc == SQLITE_OK) {
  89390 		goto __6
  89391 	}
  89392 	(*PreUpdate)(unsafe.Pointer(p)).FpUnpacked = vdbeUnpackRecord(tls, p+32, int32(nRec), aRec)
  89393 	if !!(int32((*PreUpdate)(unsafe.Pointer(p)).FpUnpacked) != 0) {
  89394 		goto __7
  89395 	}
  89396 	rc = SQLITE_NOMEM
  89397 __7:
  89398 	;
  89399 __6:
  89400 	;
  89401 	if !(rc != SQLITE_OK) {
  89402 		goto __8
  89403 	}
  89404 	Xsqlite3DbFree(tls, db, aRec)
  89405 	goto preupdate_old_out
  89406 __8:
  89407 	;
  89408 	(*PreUpdate)(unsafe.Pointer(p)).FaRecord = aRec
  89409 __4:
  89410 	;
  89411 	pMem = libc.AssignPtrUintptr(ppValue, (*UnpackedRecord)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpUnpacked)).FaMem+uintptr(iIdx)*56)
  89412 	if !(iIdx == int32((*Table)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey)) {
  89413 		goto __9
  89414 	}
  89415 	Xsqlite3VdbeMemSetInt64(tls, pMem, (*PreUpdate)(unsafe.Pointer(p)).FiKey1)
  89416 	goto __10
  89417 __9:
  89418 	if !(iIdx >= int32((*UnpackedRecord)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpUnpacked)).FnField)) {
  89419 		goto __11
  89420 	}
  89421 	*(*uintptr)(unsafe.Pointer(ppValue)) = columnNullValue(tls)
  89422 	goto __12
  89423 __11:
  89424 	if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpTab)).FaCol+uintptr(iIdx)*24)).Faffinity) == SQLITE_AFF_REAL) {
  89425 		goto __13
  89426 	}
  89427 	if !(int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_Int|MEM_IntReal) != 0) {
  89428 		goto __14
  89429 	}
  89430 
  89431 	Xsqlite3VdbeMemRealify(tls, pMem)
  89432 __14:
  89433 	;
  89434 __13:
  89435 	;
  89436 __12:
  89437 	;
  89438 __10:
  89439 	;
  89440 preupdate_old_out:
  89441 	Xsqlite3Error(tls, db, rc)
  89442 	return Xsqlite3ApiExit(tls, db, rc)
  89443 }
  89444 
  89445 // This function is called from within a pre-update callback to retrieve
  89446 // the number of columns in the row being updated, deleted or inserted.
  89447 func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) int32 {
  89448 	var p uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate
  89449 	return func() int32 {
  89450 		if p != 0 {
  89451 			return int32((*PreUpdate)(unsafe.Pointer(p)).Fkeyinfo.FnKeyField)
  89452 		}
  89453 		return 0
  89454 	}()
  89455 }
  89456 
  89457 // This function is designed to be called from within a pre-update callback
  89458 // only. It returns zero if the change that caused the callback was made
  89459 // immediately by a user SQL statement. Or, if the change was made by a
  89460 // trigger program, it returns the number of trigger programs currently
  89461 // on the stack (1 for a top-level trigger, 2 for a trigger fired by a
  89462 // top-level trigger etc.).
  89463 //
  89464 // For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL
  89465 // or SET DEFAULT action is considered a trigger.
  89466 func Xsqlite3_preupdate_depth(tls *libc.TLS, db uintptr) int32 {
  89467 	var p uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate
  89468 	return func() int32 {
  89469 		if p != 0 {
  89470 			return (*Vdbe)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).Fv)).FnFrame
  89471 		}
  89472 		return 0
  89473 	}()
  89474 }
  89475 
  89476 // This function is designed to be called from within a pre-update callback
  89477 // only.
  89478 func Xsqlite3_preupdate_blobwrite(tls *libc.TLS, db uintptr) int32 {
  89479 	var p uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate
  89480 	return func() int32 {
  89481 		if p != 0 {
  89482 			return (*PreUpdate)(unsafe.Pointer(p)).FiBlobWrite
  89483 		}
  89484 		return -1
  89485 	}()
  89486 }
  89487 
  89488 // This function is called from within a pre-update callback to retrieve
  89489 // a field of the row currently being updated or inserted.
  89490 func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintptr) int32 {
  89491 	var p uintptr
  89492 	var rc int32
  89493 	var pMem uintptr
  89494 	var pData uintptr
  89495 
  89496 	var pUnpack uintptr
  89497 	p = (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate
  89498 	rc = SQLITE_OK
  89499 
  89500 	if !(!(p != 0) || (*PreUpdate)(unsafe.Pointer(p)).Fop == SQLITE_DELETE) {
  89501 		goto __1
  89502 	}
  89503 	rc = Xsqlite3MisuseError(tls, 89813)
  89504 	goto preupdate_new_out
  89505 __1:
  89506 	;
  89507 	if !((*PreUpdate)(unsafe.Pointer(p)).FpPk != 0 && (*PreUpdate)(unsafe.Pointer(p)).Fop != SQLITE_UPDATE) {
  89508 		goto __2
  89509 	}
  89510 	iIdx = int32(Xsqlite3TableColumnToIndex(tls, (*PreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx)))
  89511 __2:
  89512 	;
  89513 	if !(iIdx >= int32((*VdbeCursor)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField) || iIdx < 0) {
  89514 		goto __3
  89515 	}
  89516 	rc = SQLITE_RANGE
  89517 	goto preupdate_new_out
  89518 __3:
  89519 	;
  89520 	if !((*PreUpdate)(unsafe.Pointer(p)).Fop == SQLITE_INSERT) {
  89521 		goto __4
  89522 	}
  89523 
  89524 	pUnpack = (*PreUpdate)(unsafe.Pointer(p)).FpNewUnpacked
  89525 	if !!(pUnpack != 0) {
  89526 		goto __6
  89527 	}
  89528 	pData = (*Vdbe)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).Fv)).FaMem + uintptr((*PreUpdate)(unsafe.Pointer(p)).FiNewReg)*56
  89529 	rc = func() int32 {
  89530 		if int32((*Mem)(unsafe.Pointer(pData)).Fflags)&MEM_Zero != 0 {
  89531 			return Xsqlite3VdbeMemExpandBlob(tls, pData)
  89532 		}
  89533 		return 0
  89534 	}()
  89535 	if !(rc != SQLITE_OK) {
  89536 		goto __7
  89537 	}
  89538 	goto preupdate_new_out
  89539 __7:
  89540 	;
  89541 	pUnpack = vdbeUnpackRecord(tls, p+32, (*Mem)(unsafe.Pointer(pData)).Fn, (*Mem)(unsafe.Pointer(pData)).Fz)
  89542 	if !!(pUnpack != 0) {
  89543 		goto __8
  89544 	}
  89545 	rc = SQLITE_NOMEM
  89546 	goto preupdate_new_out
  89547 __8:
  89548 	;
  89549 	(*PreUpdate)(unsafe.Pointer(p)).FpNewUnpacked = pUnpack
  89550 __6:
  89551 	;
  89552 	pMem = (*UnpackedRecord)(unsafe.Pointer(pUnpack)).FaMem + uintptr(iIdx)*56
  89553 	if !(iIdx == int32((*Table)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey)) {
  89554 		goto __9
  89555 	}
  89556 	Xsqlite3VdbeMemSetInt64(tls, pMem, (*PreUpdate)(unsafe.Pointer(p)).FiKey2)
  89557 	goto __10
  89558 __9:
  89559 	if !(iIdx >= int32((*UnpackedRecord)(unsafe.Pointer(pUnpack)).FnField)) {
  89560 		goto __11
  89561 	}
  89562 	pMem = columnNullValue(tls)
  89563 __11:
  89564 	;
  89565 __10:
  89566 	;
  89567 	goto __5
  89568 __4:
  89569 	;
  89570 	if !!(int32((*PreUpdate)(unsafe.Pointer(p)).FaNew) != 0) {
  89571 		goto __12
  89572 	}
  89573 	(*PreUpdate)(unsafe.Pointer(p)).FaNew = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Mem{}))*uint64((*VdbeCursor)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField))
  89574 	if !!(int32((*PreUpdate)(unsafe.Pointer(p)).FaNew) != 0) {
  89575 		goto __13
  89576 	}
  89577 	rc = SQLITE_NOMEM
  89578 	goto preupdate_new_out
  89579 __13:
  89580 	;
  89581 __12:
  89582 	;
  89583 	pMem = (*PreUpdate)(unsafe.Pointer(p)).FaNew + uintptr(iIdx)*56
  89584 	if !(int32((*Mem)(unsafe.Pointer(pMem)).Fflags) == 0) {
  89585 		goto __14
  89586 	}
  89587 	if !(iIdx == int32((*Table)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey)) {
  89588 		goto __15
  89589 	}
  89590 	Xsqlite3VdbeMemSetInt64(tls, pMem, (*PreUpdate)(unsafe.Pointer(p)).FiKey2)
  89591 	goto __16
  89592 __15:
  89593 	rc = Xsqlite3VdbeMemCopy(tls, pMem, (*Vdbe)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).Fv)).FaMem+uintptr((*PreUpdate)(unsafe.Pointer(p)).FiNewReg+1+iIdx)*56)
  89594 	if !(rc != SQLITE_OK) {
  89595 		goto __17
  89596 	}
  89597 	goto preupdate_new_out
  89598 __17:
  89599 	;
  89600 __16:
  89601 	;
  89602 __14:
  89603 	;
  89604 __5:
  89605 	;
  89606 	*(*uintptr)(unsafe.Pointer(ppValue)) = pMem
  89607 
  89608 preupdate_new_out:
  89609 	Xsqlite3Error(tls, db, rc)
  89610 	return Xsqlite3ApiExit(tls, db, rc)
  89611 }
  89612 
  89613 func findNextHostParameter(tls *libc.TLS, zSql uintptr, pnToken uintptr) int32 {
  89614 	bp := tls.Alloc(4)
  89615 	defer tls.Free(4)
  89616 
  89617 	var nTotal int32 = 0
  89618 	var n int32
  89619 
  89620 	*(*int32)(unsafe.Pointer(pnToken)) = 0
  89621 	for *(*int8)(unsafe.Pointer(zSql)) != 0 {
  89622 		n = Xsqlite3GetToken(tls, zSql, bp)
  89623 
  89624 		if *(*int32)(unsafe.Pointer(bp)) == TK_VARIABLE {
  89625 			*(*int32)(unsafe.Pointer(pnToken)) = n
  89626 			break
  89627 		}
  89628 		nTotal = nTotal + n
  89629 		zSql += uintptr(n)
  89630 	}
  89631 	return nTotal
  89632 }
  89633 
  89634 // This function returns a pointer to a nul-terminated string in memory
  89635 // obtained from sqlite3DbMalloc(). If sqlite3.nVdbeExec is 1, then the
  89636 // string contains a copy of zRawSql but with host parameters expanded to
  89637 // their current bindings. Or, if sqlite3.nVdbeExec is greater than 1,
  89638 // then the returned string holds a copy of zRawSql with "-- " prepended
  89639 // to each line of text.
  89640 //
  89641 // If the SQLITE_TRACE_SIZE_LIMIT macro is defined to an integer, then
  89642 // then long strings and blobs are truncated to that many bytes.  This
  89643 // can be used to prevent unreasonably large trace strings when dealing
  89644 // with large (multi-megabyte) strings and blobs.
  89645 //
  89646 // The calling function is responsible for making sure the memory returned
  89647 // is eventually freed.
  89648 //
  89649 // ALGORITHM:  Scan the input string looking for host parameters in any of
  89650 // these forms:  ?, ?N, $A, @A, :A.  Take care to avoid text within
  89651 // string literals, quoted identifier names, and comments.  For text forms,
  89652 // the host parameter index is found by scanning the prepared
  89653 // statement for the corresponding OP_Variable opcode.  Once the host
  89654 // parameter index is known, locate the value in p->aVar[].  Then render
  89655 // the value as a literal in place of the host parameter name.
  89656 func Xsqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) uintptr {
  89657 	bp := tls.Alloc(144)
  89658 	defer tls.Free(144)
  89659 
  89660 	var db uintptr
  89661 	*(*int32)(unsafe.Pointer(bp + 84)) = 0
  89662 	var nextIndex int32 = 1
  89663 	var n int32
  89664 
  89665 	var i int32
  89666 	var pVar uintptr
  89667 
  89668 	db = (*Vdbe)(unsafe.Pointer(p)).Fdb
  89669 	Xsqlite3StrAccumInit(tls, bp+48, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer(db + 136)))
  89670 	if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec > 1 {
  89671 		for *(*int8)(unsafe.Pointer(zRawSql)) != 0 {
  89672 			var zStart uintptr = zRawSql
  89673 			for int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zRawSql, 1)))) != '\n' && *(*int8)(unsafe.Pointer(zRawSql)) != 0 {
  89674 			}
  89675 			Xsqlite3_str_append(tls, bp+48, ts+6749, 3)
  89676 
  89677 			Xsqlite3_str_append(tls, bp+48, zStart, int32((int64(zRawSql)-int64(zStart))/1))
  89678 		}
  89679 	} else if int32((*Vdbe)(unsafe.Pointer(p)).FnVar) == 0 {
  89680 		Xsqlite3_str_append(tls, bp+48, zRawSql, Xsqlite3Strlen30(tls, zRawSql))
  89681 	} else {
  89682 		for *(*int8)(unsafe.Pointer(zRawSql)) != 0 {
  89683 			n = findNextHostParameter(tls, zRawSql, bp+80)
  89684 
  89685 			Xsqlite3_str_append(tls, bp+48, zRawSql, n)
  89686 			zRawSql += uintptr(n)
  89687 
  89688 			if *(*int32)(unsafe.Pointer(bp + 80)) == 0 {
  89689 				break
  89690 			}
  89691 			if int32(*(*int8)(unsafe.Pointer(zRawSql))) == '?' {
  89692 				if *(*int32)(unsafe.Pointer(bp + 80)) > 1 {
  89693 					Xsqlite3GetInt32(tls, zRawSql+1, bp+84)
  89694 				} else {
  89695 					*(*int32)(unsafe.Pointer(bp + 84)) = nextIndex
  89696 				}
  89697 			} else {
  89698 				*(*int32)(unsafe.Pointer(bp + 84)) = Xsqlite3VdbeParameterIndex(tls, p, zRawSql, *(*int32)(unsafe.Pointer(bp + 80)))
  89699 
  89700 			}
  89701 			zRawSql += uintptr(*(*int32)(unsafe.Pointer(bp + 80)))
  89702 			nextIndex = func() int32 {
  89703 				if *(*int32)(unsafe.Pointer(bp + 84))+1 > nextIndex {
  89704 					return *(*int32)(unsafe.Pointer(bp + 84)) + 1
  89705 				}
  89706 				return nextIndex
  89707 			}()
  89708 
  89709 			pVar = (*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(*(*int32)(unsafe.Pointer(bp + 84))-1)*56
  89710 			if int32((*Mem)(unsafe.Pointer(pVar)).Fflags)&MEM_Null != 0 {
  89711 				Xsqlite3_str_append(tls, bp+48, ts+1545, 4)
  89712 			} else if int32((*Mem)(unsafe.Pointer(pVar)).Fflags)&(MEM_Int|MEM_IntReal) != 0 {
  89713 				Xsqlite3_str_appendf(tls, bp+48, ts+1324, libc.VaList(bp, *(*I64)(unsafe.Pointer(pVar))))
  89714 			} else if int32((*Mem)(unsafe.Pointer(pVar)).Fflags)&MEM_Real != 0 {
  89715 				Xsqlite3_str_appendf(tls, bp+48, ts+6277, libc.VaList(bp+8, *(*float64)(unsafe.Pointer(pVar))))
  89716 			} else if int32((*Mem)(unsafe.Pointer(pVar)).Fflags)&MEM_Str != 0 {
  89717 				var nOut int32
  89718 				var enc U8 = (*Sqlite3)(unsafe.Pointer(db)).Fenc
  89719 				if int32(enc) != SQLITE_UTF8 {
  89720 					libc.Xmemset(tls, bp+88, 0, uint64(unsafe.Sizeof(Mem{})))
  89721 					(*Mem)(unsafe.Pointer(bp + 88)).Fdb = db
  89722 					Xsqlite3VdbeMemSetStr(tls, bp+88, (*Mem)(unsafe.Pointer(pVar)).Fz, int64((*Mem)(unsafe.Pointer(pVar)).Fn), enc, uintptr(0))
  89723 					if SQLITE_NOMEM == Xsqlite3VdbeChangeEncoding(tls, bp+88, SQLITE_UTF8) {
  89724 						(*StrAccum)(unsafe.Pointer(bp + 48)).FaccError = U8(SQLITE_NOMEM)
  89725 						(*StrAccum)(unsafe.Pointer(bp + 48)).FnAlloc = U32(0)
  89726 					}
  89727 					pVar = bp + 88
  89728 				}
  89729 				nOut = (*Mem)(unsafe.Pointer(pVar)).Fn
  89730 				Xsqlite3_str_appendf(tls, bp+48, ts+6753, libc.VaList(bp+16, nOut, (*Mem)(unsafe.Pointer(pVar)).Fz))
  89731 				if int32(enc) != SQLITE_UTF8 {
  89732 					Xsqlite3VdbeMemRelease(tls, bp+88)
  89733 				}
  89734 			} else if int32((*Mem)(unsafe.Pointer(pVar)).Fflags)&MEM_Zero != 0 {
  89735 				Xsqlite3_str_appendf(tls, bp+48, ts+6760, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(pVar))))
  89736 			} else {
  89737 				var nOut int32
  89738 
  89739 				Xsqlite3_str_append(tls, bp+48, ts+6773, 2)
  89740 				nOut = (*Mem)(unsafe.Pointer(pVar)).Fn
  89741 				for i = 0; i < nOut; i++ {
  89742 					Xsqlite3_str_appendf(tls, bp+48, ts+6776, libc.VaList(bp+40, int32(*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&0xff))
  89743 				}
  89744 				Xsqlite3_str_append(tls, bp+48, ts+6781, 1)
  89745 			}
  89746 		}
  89747 	}
  89748 	if (*StrAccum)(unsafe.Pointer(bp+48)).FaccError != 0 {
  89749 		Xsqlite3_str_reset(tls, bp+48)
  89750 	}
  89751 	return Xsqlite3StrAccumFinish(tls, bp+48)
  89752 }
  89753 
  89754 func allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurType U8) uintptr {
  89755 	var pMem uintptr
  89756 	if iCur > 0 {
  89757 		pMem = (*Vdbe)(unsafe.Pointer(p)).FaMem + uintptr((*Vdbe)(unsafe.Pointer(p)).FnMem-iCur)*56
  89758 	} else {
  89759 		pMem = (*Vdbe)(unsafe.Pointer(p)).FaMem
  89760 	}
  89761 	var nByte int32
  89762 	var pCx uintptr = uintptr(0)
  89763 	nByte = int32(uint64(unsafe.Sizeof(VdbeCursor{})) + uint64(2)*uint64(unsafe.Sizeof(U32(0)))*uint64(nField) + func() uint64 {
  89764 		if int32(eCurType) == CURTYPE_BTREE {
  89765 			return uint64(Xsqlite3BtreeCursorSize(tls))
  89766 		}
  89767 		return uint64(0)
  89768 	}())
  89769 
  89770 	if *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) != 0 {
  89771 		Xsqlite3VdbeFreeCursorNN(tls, p, *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)))
  89772 		*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = uintptr(0)
  89773 	}
  89774 
  89775 	if (*Mem)(unsafe.Pointer(pMem)).FszMalloc < nByte {
  89776 		if (*Mem)(unsafe.Pointer(pMem)).FszMalloc > 0 {
  89777 			Xsqlite3DbFreeNN(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, (*Mem)(unsafe.Pointer(pMem)).FzMalloc)
  89778 		}
  89779 		(*Mem)(unsafe.Pointer(pMem)).Fz = libc.AssignPtrUintptr(pMem+40, Xsqlite3DbMallocRaw(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, uint64(nByte)))
  89780 		if (*Mem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) {
  89781 			(*Mem)(unsafe.Pointer(pMem)).FszMalloc = 0
  89782 			return uintptr(0)
  89783 		}
  89784 		(*Mem)(unsafe.Pointer(pMem)).FszMalloc = nByte
  89785 	}
  89786 
  89787 	*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = libc.AssignUintptr(&pCx, (*Mem)(unsafe.Pointer(pMem)).FzMalloc)
  89788 	libc.Xmemset(tls, pCx, 0, uint64(uintptr(0)+40))
  89789 	(*VdbeCursor)(unsafe.Pointer(pCx)).FeCurType = eCurType
  89790 	(*VdbeCursor)(unsafe.Pointer(pCx)).FnField = I16(nField)
  89791 	(*VdbeCursor)(unsafe.Pointer(pCx)).FaOffset = pCx + 112 + uintptr(nField)*4
  89792 	if int32(eCurType) == CURTYPE_BTREE {
  89793 		*(*uintptr)(unsafe.Pointer(pCx + 48)) = (*Mem)(unsafe.Pointer(pMem)).Fz + uintptr(uint64(unsafe.Sizeof(VdbeCursor{}))+uint64(2)*uint64(unsafe.Sizeof(U32(0)))*uint64(nField))
  89794 		Xsqlite3BtreeCursorZero(tls, *(*uintptr)(unsafe.Pointer(pCx + 48)))
  89795 	}
  89796 	return pCx
  89797 }
  89798 
  89799 func alsoAnInt(tls *libc.TLS, pRec uintptr, rValue float64, piValue uintptr) int32 {
  89800 	var iValue I64
  89801 	iValue = Xsqlite3RealToI64(tls, rValue)
  89802 	if Xsqlite3RealSameAsInt(tls, rValue, iValue) != 0 {
  89803 		*(*I64)(unsafe.Pointer(piValue)) = iValue
  89804 		return 1
  89805 	}
  89806 	return libc.Bool32(0 == Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pRec)).Fz, piValue, (*Mem)(unsafe.Pointer(pRec)).Fn, (*Mem)(unsafe.Pointer(pRec)).Fenc))
  89807 }
  89808 
  89809 func applyNumericAffinity(tls *libc.TLS, pRec uintptr, bTryForInt int32) {
  89810 	bp := tls.Alloc(8)
  89811 	defer tls.Free(8)
  89812 
  89813 	var enc U8 = (*Mem)(unsafe.Pointer(pRec)).Fenc
  89814 	var rc int32
  89815 
  89816 	rc = Xsqlite3AtoF(tls, (*Mem)(unsafe.Pointer(pRec)).Fz, bp, (*Mem)(unsafe.Pointer(pRec)).Fn, enc)
  89817 	if rc <= 0 {
  89818 		return
  89819 	}
  89820 	if rc == 1 && alsoAnInt(tls, pRec, *(*float64)(unsafe.Pointer(bp)), pRec) != 0 {
  89821 		*(*U16)(unsafe.Pointer(pRec + 20)) |= U16(MEM_Int)
  89822 	} else {
  89823 		*(*float64)(unsafe.Pointer(pRec)) = *(*float64)(unsafe.Pointer(bp))
  89824 		*(*U16)(unsafe.Pointer(pRec + 20)) |= U16(MEM_Real)
  89825 		if bTryForInt != 0 {
  89826 			Xsqlite3VdbeIntegerAffinity(tls, pRec)
  89827 		}
  89828 	}
  89829 
  89830 	*(*U16)(unsafe.Pointer(pRec + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Str))
  89831 }
  89832 
  89833 func applyAffinity(tls *libc.TLS, pRec uintptr, affinity int8, enc U8) {
  89834 	if int32(affinity) >= SQLITE_AFF_NUMERIC {
  89835 		if int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&MEM_Int == 0 {
  89836 			if int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&(MEM_Real|MEM_IntReal) == 0 {
  89837 				if int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&MEM_Str != 0 {
  89838 					applyNumericAffinity(tls, pRec, 1)
  89839 				}
  89840 			} else if int32(affinity) <= SQLITE_AFF_REAL {
  89841 				Xsqlite3VdbeIntegerAffinity(tls, pRec)
  89842 			}
  89843 		}
  89844 	} else if int32(affinity) == SQLITE_AFF_TEXT {
  89845 		if 0 == int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&MEM_Str {
  89846 			if int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&(MEM_Real|MEM_Int|MEM_IntReal) != 0 {
  89847 				Xsqlite3VdbeMemStringify(tls, pRec, enc, uint8(1))
  89848 			}
  89849 		}
  89850 		*(*U16)(unsafe.Pointer(pRec + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Real | MEM_Int | MEM_IntReal))
  89851 	}
  89852 }
  89853 
  89854 // Try to convert the type of a function argument or a result column
  89855 // into a numeric representation.  Use either INTEGER or REAL whichever
  89856 // is appropriate.  But only do the conversion if it is possible without
  89857 // loss of information and return the revised type of the argument.
  89858 func Xsqlite3_value_numeric_type(tls *libc.TLS, pVal uintptr) int32 {
  89859 	var eType int32 = Xsqlite3_value_type(tls, pVal)
  89860 	if eType == SQLITE_TEXT {
  89861 		var pMem uintptr = pVal
  89862 		applyNumericAffinity(tls, pMem, 0)
  89863 		eType = Xsqlite3_value_type(tls, pVal)
  89864 	}
  89865 	return eType
  89866 }
  89867 
  89868 // Exported version of applyAffinity(). This one works on sqlite3_value*,
  89869 // not the internal Mem* type.
  89870 func Xsqlite3ValueApplyAffinity(tls *libc.TLS, pVal uintptr, affinity U8, enc U8) {
  89871 	applyAffinity(tls, pVal, int8(affinity), enc)
  89872 }
  89873 
  89874 func computeNumericType(tls *libc.TLS, pMem uintptr) U16 {
  89875 	bp := tls.Alloc(8)
  89876 	defer tls.Free(8)
  89877 
  89878 	var rc int32
  89879 
  89880 	if func() int32 {
  89881 		if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&MEM_Zero != 0 {
  89882 			return Xsqlite3VdbeMemExpandBlob(tls, pMem)
  89883 		}
  89884 		return 0
  89885 	}() != 0 {
  89886 		*(*I64)(unsafe.Pointer(pMem)) = int64(0)
  89887 		return U16(MEM_Int)
  89888 	}
  89889 	rc = Xsqlite3AtoF(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, pMem, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc)
  89890 	if rc <= 0 {
  89891 		if rc == 0 && Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, bp, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc) <= 1 {
  89892 			*(*I64)(unsafe.Pointer(pMem)) = *(*Sqlite3_int64)(unsafe.Pointer(bp))
  89893 			return U16(MEM_Int)
  89894 		} else {
  89895 			return U16(MEM_Real)
  89896 		}
  89897 	} else if rc == 1 && Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, bp, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc) == 0 {
  89898 		*(*I64)(unsafe.Pointer(pMem)) = *(*Sqlite3_int64)(unsafe.Pointer(bp))
  89899 		return U16(MEM_Int)
  89900 	}
  89901 	return U16(MEM_Real)
  89902 }
  89903 
  89904 func numericType(tls *libc.TLS, pMem uintptr) U16 {
  89905 	if int32((*Mem)(unsafe.Pointer(pMem)).Fflags)&(MEM_Int|MEM_Real|MEM_IntReal|MEM_Null) != 0 {
  89906 		return U16(int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (MEM_Int | MEM_Real | MEM_IntReal | MEM_Null))
  89907 	}
  89908 
  89909 	return computeNumericType(tls, pMem)
  89910 	return U16(0)
  89911 }
  89912 
  89913 func out2PrereleaseWithClear(tls *libc.TLS, pOut uintptr) uintptr {
  89914 	Xsqlite3VdbeMemSetNull(tls, pOut)
  89915 	(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int)
  89916 	return pOut
  89917 }
  89918 
  89919 func out2Prerelease(tls *libc.TLS, p uintptr, pOp uintptr) uintptr {
  89920 	var pOut uintptr
  89921 
  89922 	pOut = (*Vdbe)(unsafe.Pointer(p)).FaMem + uintptr((*VdbeOp)(unsafe.Pointer(pOp)).Fp2)*56
  89923 
  89924 	if int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&(MEM_Agg|MEM_Dyn) != 0 {
  89925 		return out2PrereleaseWithClear(tls, pOut)
  89926 	} else {
  89927 		(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int)
  89928 		return pOut
  89929 	}
  89930 	return uintptr(0)
  89931 }
  89932 
  89933 func filterHash(tls *libc.TLS, aMem uintptr, pOp uintptr) U64 {
  89934 	var i int32
  89935 	var mx int32
  89936 	var h U64 = uint64(0)
  89937 
  89938 	i = (*Op)(unsafe.Pointer(pOp)).Fp3
  89939 	mx = i + *(*int32)(unsafe.Pointer(pOp + 16))
  89940 	for ; i < mx; i++ {
  89941 		var p uintptr = aMem + uintptr(i)*56
  89942 		if int32((*Mem)(unsafe.Pointer(p)).Fflags)&(MEM_Int|MEM_IntReal) != 0 {
  89943 			h = h + U64(*(*I64)(unsafe.Pointer(p)))
  89944 		} else if int32((*Mem)(unsafe.Pointer(p)).Fflags)&MEM_Real != 0 {
  89945 			h = h + U64(Xsqlite3VdbeIntValue(tls, p))
  89946 		} else if int32((*Mem)(unsafe.Pointer(p)).Fflags)&(MEM_Str|MEM_Blob) != 0 {
  89947 		}
  89948 	}
  89949 	return h
  89950 }
  89951 
  89952 func vdbeMemTypeName(tls *libc.TLS, pMem uintptr) uintptr {
  89953 	return azTypes[Xsqlite3_value_type(tls, pMem)-1]
  89954 }
  89955 
  89956 var azTypes = [5]uintptr{
  89957 	ts + 1105,
  89958 	ts + 1117,
  89959 	ts + 1122,
  89960 	ts + 1100,
  89961 	ts + 1545,
  89962 }
  89963 
  89964 // Execute as much of a VDBE program as we can.
  89965 // This is the core of sqlite3_step().
  89966 func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 {
  89967 	bp := tls.Alloc(1048)
  89968 	defer tls.Free(1048)
  89969 
  89970 	var aOp uintptr
  89971 	var pOp uintptr
  89972 	var rc int32
  89973 	var db uintptr
  89974 	var resetSchemaOnFault U8
  89975 	var encoding U8
  89976 	var iCompare int32
  89977 	var nVmStep U64
  89978 	var nProgressLimit U64
  89979 	var aMem uintptr
  89980 	var pIn1 uintptr
  89981 	var pIn2 uintptr
  89982 	var pIn3 uintptr
  89983 	var pOut uintptr
  89984 	var iPrior U32
  89985 	var pCaller uintptr
  89986 	var pcDest int32
  89987 	var pFrame uintptr
  89988 	var pcx int32
  89989 	var cnt int32
  89990 	var nullFlag U16
  89991 	var pVar uintptr
  89992 	var n int32
  89993 	var p1 int32
  89994 	var p2 int32
  89995 	var n1 int32
  89996 	var nByte I64
  89997 	var flags1 U16
  89998 	var flags2 U16
  89999 	var type1 U16
  90000 	var type2 U16
  90001 	var iA I64
  90002 
  90003 	var rA float64
  90004 	var rB float64
  90005 
  90006 	var iB1 I64
  90007 	var op U8
  90008 	var res int32
  90009 	var res2 int32
  90010 	var affinity int8
  90011 	var flags11 U16
  90012 	var flags3 U16
  90013 	var n2 int32
  90014 	var i int32
  90015 	var p11 int32
  90016 	var p21 int32
  90017 	var pKeyInfo uintptr
  90018 	var idx U32
  90019 	var pColl uintptr
  90020 	var bRev int32
  90021 	var aPermute uintptr
  90022 	var v1 int32
  90023 	var v2 int32
  90024 	var iAddr U32
  90025 	var c int32
  90026 	var c1 int32
  90027 	var pC uintptr
  90028 	var typeMask U16
  90029 	var serialType U32
  90030 	var pC1 uintptr
  90031 	var pC2 uintptr
  90032 	var iMap U32
  90033 	var p22 U32
  90034 	var pC3 uintptr
  90035 	var pCrsr uintptr
  90036 	var aOffset uintptr
  90037 	var len int32
  90038 	var i1 int32
  90039 	var pDest uintptr
  90040 
  90041 	var zData uintptr
  90042 	var zHdr uintptr
  90043 	var zEndHdr uintptr
  90044 	var offset64 U64
  90045 
  90046 	var pReg uintptr
  90047 	var pTab uintptr
  90048 	var aCol uintptr
  90049 	var i2 int32
  90050 	var zAffinity uintptr
  90051 
  90052 	var i3 I64
  90053 	var uu U64
  90054 
  90055 	var i4 U32
  90056 	var pRec uintptr
  90057 	var nData U64
  90058 	var nHdr int32
  90059 	var nByte1 I64
  90060 	var nZero I64
  90061 	var nVarint int32
  90062 	var serial_type U32
  90063 	var pData0 uintptr
  90064 	var pLast uintptr
  90065 	var nField int32
  90066 	var zAffinity1 uintptr
  90067 	var len1 U32
  90068 	var zHdr1 uintptr
  90069 	var zPayload uintptr
  90070 
  90071 	var pCrsr1 uintptr
  90072 	var isSchemaChange int32
  90073 
  90074 	var isTransaction int32
  90075 	var p12 int32
  90076 	var zName uintptr
  90077 	var nName int32
  90078 	var pNew uintptr
  90079 	var pSavepoint uintptr
  90080 	var pTmp uintptr
  90081 	var iSavepoint int32
  90082 	var ii int32
  90083 	var desiredAutoCommit int32
  90084 	var iRollback int32
  90085 	var pBt uintptr
  90086 	var pDb uintptr
  90087 
  90088 	var iDb int32
  90089 	var iCookie int32
  90090 	var pDb1 uintptr
  90091 	var nField1 int32
  90092 	var pKeyInfo1 uintptr
  90093 	var p23 U32
  90094 	var iDb1 int32
  90095 	var wrFlag int32
  90096 	var pX uintptr
  90097 	var pCur uintptr
  90098 	var pDb2 uintptr
  90099 	var pOrig uintptr
  90100 	var pCx uintptr
  90101 	var pCx1 uintptr
  90102 	var pKeyInfo2 uintptr
  90103 	var pCx2 uintptr
  90104 	var pC4 uintptr
  90105 	var pCx3 uintptr
  90106 	var c2 int32
  90107 	var flags31 U16
  90108 	var newType U16
  90109 
  90110 	var oc int32
  90111 	var pC5 uintptr
  90112 
  90113 	var nField2 int32
  90114 	var iKey I64
  90115 	var eqOnly int32
  90116 	var pC6 uintptr
  90117 
  90118 	var nStep int32
  90119 
  90120 	var pC7 uintptr
  90121 	var pCur1 uintptr
  90122 	var pC8 uintptr
  90123 	var alreadyExists int32
  90124 	var ii1 int32
  90125 	var pC9 uintptr
  90126 	var pIdxKey uintptr
  90127 
  90128 	var pC10 uintptr
  90129 	var pCrsr2 uintptr
  90130 
  90131 	var iKey1 U64
  90132 
  90133 	var pC11 uintptr
  90134 
  90135 	var cnt1 int32
  90136 	var pMem uintptr
  90137 	var pFrame1 uintptr
  90138 	var pData uintptr
  90139 	var pKey uintptr
  90140 	var pC12 uintptr
  90141 	var seekResult int32
  90142 	var zDb uintptr
  90143 	var pTab1 uintptr
  90144 
  90145 	var pDest1 uintptr
  90146 	var pSrc uintptr
  90147 	var iKey2 I64
  90148 	var pC13 uintptr
  90149 	var zDb1 uintptr
  90150 	var pTab2 uintptr
  90151 	var opflags int32
  90152 	var pC14 uintptr
  90153 
  90154 	var nKeyCol int32
  90155 	var pC15 uintptr
  90156 	var pC16 uintptr
  90157 	var pCrsr3 uintptr
  90158 	var n3 U32
  90159 	var pC17 uintptr
  90160 
  90161 	var pVtab uintptr
  90162 	var pModule uintptr
  90163 	var pC18 uintptr
  90164 	var pC19 uintptr
  90165 	var pCrsr4 uintptr
  90166 
  90167 	var pC20 uintptr
  90168 	var pCrsr5 uintptr
  90169 
  90170 	var sz I64
  90171 	var pC21 uintptr
  90172 	var pCrsr6 uintptr
  90173 
  90174 	var pC22 uintptr
  90175 	var pC23 uintptr
  90176 
  90177 	var pC24 uintptr
  90178 	var pC25 uintptr
  90179 	var pCrsr7 uintptr
  90180 
  90181 	var pC26 uintptr
  90182 	var pTabCur uintptr
  90183 
  90184 	var pC27 uintptr
  90185 	var nCellKey I64
  90186 	var pCur2 uintptr
  90187 
  90188 	var pC28 uintptr
  90189 	var res11 int32
  90190 
  90191 	var iDb2 int32
  90192 
  90193 	var pC29 uintptr
  90194 
  90195 	var pDb3 uintptr
  90196 	var iDb3 int32
  90197 	var zSchema uintptr
  90198 	var zSql uintptr
  90199 
  90200 	var nRoot int32
  90201 	var aRoot uintptr
  90202 
  90203 	var pnErr uintptr
  90204 
  90205 	var iSet int32
  90206 	var exists int32
  90207 	var nMem int32
  90208 	var nByte2 int32
  90209 	var pRt uintptr
  90210 	var pMem1 uintptr
  90211 	var pEnd uintptr
  90212 	var pFrame2 uintptr
  90213 	var pProgram uintptr
  90214 	var t1 uintptr
  90215 	var pFrame3 uintptr
  90216 	var pIn uintptr
  90217 	var pFrame4 uintptr
  90218 
  90219 	var n4 int32
  90220 	var pCtx uintptr
  90221 	var i5 int32
  90222 	var pCtx1 uintptr
  90223 	var pMem2 uintptr
  90224 	var pMem3 uintptr
  90225 	var i6 int32
  90226 
  90227 	var pMem4 uintptr
  90228 	var pBt1 uintptr
  90229 	var pPager uintptr
  90230 	var eNew int32
  90231 	var eOld int32
  90232 	var zFilename uintptr
  90233 	var pBt2 uintptr
  90234 	var pC30 uintptr
  90235 	var pC31 uintptr
  90236 	var z1 uintptr
  90237 	var p13 int32
  90238 	var isWriteLock U8
  90239 	var pVTab uintptr
  90240 
  90241 	var zTab uintptr
  90242 	var pCur3 uintptr
  90243 
  90244 	var pVtab1 uintptr
  90245 	var pModule1 uintptr
  90246 	var pC32 uintptr
  90247 	var pRhs uintptr
  90248 	var nArg int32
  90249 	var iQuery int32
  90250 	var pModule2 uintptr
  90251 	var pQuery uintptr
  90252 	var pArgc uintptr
  90253 	var pVCur1 uintptr
  90254 	var pVtab2 uintptr
  90255 	var pCur4 uintptr
  90256 	var res12 int32
  90257 	var i7 int32
  90258 	var apArg uintptr
  90259 	var pVtab3 uintptr
  90260 	var pModule3 uintptr
  90261 	var pDest2 uintptr
  90262 
  90263 	var pCur5 uintptr
  90264 	var pVtab4 uintptr
  90265 	var pModule4 uintptr
  90266 	var res13 int32
  90267 	var pCur6 uintptr
  90268 	var pVtab5 uintptr
  90269 	var pName uintptr
  90270 	var isLegacy int32
  90271 	var vtabOnConflict U8
  90272 	var pVtab6 uintptr
  90273 	var pModule5 uintptr
  90274 	var nArg1 int32
  90275 	var i8 int32
  90276 
  90277 	var apArg1 uintptr
  90278 	var pX1 uintptr
  90279 	var newMax uint32
  90280 	var pBt3 uintptr
  90281 	var i9 int32
  90282 	var pCtx2 uintptr
  90283 	var h U64
  90284 	var h1 U64
  90285 	var z2 uintptr
  90286 	var z3 uintptr
  90287 	var i10 int32
  90288 	var zTrace uintptr
  90289 	aOp = (*Vdbe)(unsafe.Pointer(p)).FaOp
  90290 	pOp = aOp
  90291 	rc = SQLITE_OK
  90292 	db = (*Vdbe)(unsafe.Pointer(p)).Fdb
  90293 	resetSchemaOnFault = U8(0)
  90294 	encoding = (*Sqlite3)(unsafe.Pointer(db)).Fenc
  90295 	iCompare = 0
  90296 	nVmStep = uint64(0)
  90297 	aMem = (*Vdbe)(unsafe.Pointer(p)).FaMem
  90298 	pIn1 = uintptr(0)
  90299 	pIn2 = uintptr(0)
  90300 	pIn3 = uintptr(0)
  90301 	pOut = uintptr(0)
  90302 
  90303 	if !((*Vdbe)(unsafe.Pointer(p)).FlockMask != YDbMask(0)) {
  90304 		goto __1
  90305 	}
  90306 	Xsqlite3VdbeEnter(tls, p)
  90307 __1:
  90308 	;
  90309 	if !((*Sqlite3)(unsafe.Pointer(db)).FxProgress != 0) {
  90310 		goto __2
  90311 	}
  90312 	iPrior = *(*U32)(unsafe.Pointer(p + 212 + 4*4))
  90313 
  90314 	nProgressLimit = U64((*Sqlite3)(unsafe.Pointer(db)).FnProgressOps - iPrior%(*Sqlite3)(unsafe.Pointer(db)).FnProgressOps)
  90315 	goto __3
  90316 __2:
  90317 	nProgressLimit = uint64(0xffffffff) | uint64(0xffffffff)<<32
  90318 __3:
  90319 	;
  90320 	if !((*Vdbe)(unsafe.Pointer(p)).Frc == SQLITE_NOMEM) {
  90321 		goto __4
  90322 	}
  90323 
  90324 	goto no_mem
  90325 __4:
  90326 	;
  90327 	(*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_OK
  90328 
  90329 	(*Vdbe)(unsafe.Pointer(p)).FiCurrentTime = int64(0)
  90330 
  90331 	(*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0
  90332 	if !(libc.AtomicLoadNInt32(db+432, 0) != 0) {
  90333 		goto __5
  90334 	}
  90335 	goto abort_due_to_interrupt
  90336 __5:
  90337 	;
  90338 	pOp = aOp + uintptr((*Vdbe)(unsafe.Pointer(p)).Fpc)*24
  90339 __6:
  90340 	if !(1 != 0) {
  90341 		goto __8
  90342 	}
  90343 
  90344 	nVmStep++
  90345 
  90346 	switch int32((*Op)(unsafe.Pointer(pOp)).Fopcode) {
  90347 	case OP_Goto:
  90348 		goto __10
  90349 
  90350 	case OP_Gosub:
  90351 		goto __11
  90352 
  90353 	case OP_Return:
  90354 		goto __12
  90355 
  90356 	case OP_InitCoroutine:
  90357 		goto __13
  90358 
  90359 	case OP_EndCoroutine:
  90360 		goto __14
  90361 
  90362 	case OP_Yield:
  90363 		goto __15
  90364 
  90365 	case OP_HaltIfNull:
  90366 		goto __16
  90367 
  90368 	case OP_Halt:
  90369 		goto __17
  90370 
  90371 	case OP_Integer:
  90372 		goto __18
  90373 
  90374 	case OP_Int64:
  90375 		goto __19
  90376 
  90377 	case OP_Real:
  90378 		goto __20
  90379 
  90380 	case OP_String8:
  90381 		goto __21
  90382 
  90383 	case OP_String:
  90384 		goto __22
  90385 
  90386 	case OP_BeginSubrtn:
  90387 		goto __23
  90388 	case OP_Null:
  90389 		goto __24
  90390 
  90391 	case OP_SoftNull:
  90392 		goto __25
  90393 
  90394 	case OP_Blob:
  90395 		goto __26
  90396 
  90397 	case OP_Variable:
  90398 		goto __27
  90399 
  90400 	case OP_Move:
  90401 		goto __28
  90402 
  90403 	case OP_Copy:
  90404 		goto __29
  90405 
  90406 	case OP_SCopy:
  90407 		goto __30
  90408 
  90409 	case OP_IntCopy:
  90410 		goto __31
  90411 
  90412 	case OP_FkCheck:
  90413 		goto __32
  90414 
  90415 	case OP_ResultRow:
  90416 		goto __33
  90417 
  90418 	case OP_Concat:
  90419 		goto __34
  90420 
  90421 	case OP_Add:
  90422 		goto __35
  90423 	case OP_Subtract:
  90424 		goto __36
  90425 	case OP_Multiply:
  90426 		goto __37
  90427 	case OP_Divide:
  90428 		goto __38
  90429 	case OP_Remainder:
  90430 		goto __39
  90431 
  90432 	case OP_CollSeq:
  90433 		goto __40
  90434 
  90435 	case OP_BitAnd:
  90436 		goto __41
  90437 	case OP_BitOr:
  90438 		goto __42
  90439 	case OP_ShiftLeft:
  90440 		goto __43
  90441 	case OP_ShiftRight:
  90442 		goto __44
  90443 
  90444 	case OP_AddImm:
  90445 		goto __45
  90446 
  90447 	case OP_MustBeInt:
  90448 		goto __46
  90449 
  90450 	case OP_RealAffinity:
  90451 		goto __47
  90452 
  90453 	case OP_Cast:
  90454 		goto __48
  90455 
  90456 	case OP_Eq:
  90457 		goto __49
  90458 	case OP_Ne:
  90459 		goto __50
  90460 	case OP_Lt:
  90461 		goto __51
  90462 	case OP_Le:
  90463 		goto __52
  90464 	case OP_Gt:
  90465 		goto __53
  90466 	case OP_Ge:
  90467 		goto __54
  90468 
  90469 	case OP_ElseEq:
  90470 		goto __55
  90471 
  90472 	case OP_Permutation:
  90473 		goto __56
  90474 
  90475 	case OP_Compare:
  90476 		goto __57
  90477 
  90478 	case OP_Jump:
  90479 		goto __58
  90480 
  90481 	case OP_And:
  90482 		goto __59
  90483 	case OP_Or:
  90484 		goto __60
  90485 
  90486 	case OP_IsTrue:
  90487 		goto __61
  90488 
  90489 	case OP_Not:
  90490 		goto __62
  90491 
  90492 	case OP_BitNot:
  90493 		goto __63
  90494 
  90495 	case OP_Once:
  90496 		goto __64
  90497 
  90498 	case OP_If:
  90499 		goto __65
  90500 
  90501 	case OP_IfNot:
  90502 		goto __66
  90503 
  90504 	case OP_IsNull:
  90505 		goto __67
  90506 
  90507 	case OP_IsType:
  90508 		goto __68
  90509 
  90510 	case OP_ZeroOrNull:
  90511 		goto __69
  90512 
  90513 	case OP_NotNull:
  90514 		goto __70
  90515 
  90516 	case OP_IfNullRow:
  90517 		goto __71
  90518 
  90519 	case OP_Offset:
  90520 		goto __72
  90521 
  90522 	case OP_Column:
  90523 		goto __73
  90524 
  90525 	case OP_TypeCheck:
  90526 		goto __74
  90527 
  90528 	case OP_Affinity:
  90529 		goto __75
  90530 
  90531 	case OP_MakeRecord:
  90532 		goto __76
  90533 
  90534 	case OP_Count:
  90535 		goto __77
  90536 
  90537 	case OP_Savepoint:
  90538 		goto __78
  90539 
  90540 	case OP_AutoCommit:
  90541 		goto __79
  90542 
  90543 	case OP_Transaction:
  90544 		goto __80
  90545 
  90546 	case OP_ReadCookie:
  90547 		goto __81
  90548 
  90549 	case OP_SetCookie:
  90550 		goto __82
  90551 
  90552 	case OP_ReopenIdx:
  90553 		goto __83
  90554 
  90555 	case OP_OpenRead:
  90556 		goto __84
  90557 	case OP_OpenWrite:
  90558 		goto __85
  90559 
  90560 	case OP_OpenDup:
  90561 		goto __86
  90562 
  90563 	case OP_OpenAutoindex:
  90564 		goto __87
  90565 	case OP_OpenEphemeral:
  90566 		goto __88
  90567 
  90568 	case OP_SorterOpen:
  90569 		goto __89
  90570 
  90571 	case OP_SequenceTest:
  90572 		goto __90
  90573 
  90574 	case OP_OpenPseudo:
  90575 		goto __91
  90576 
  90577 	case OP_Close:
  90578 		goto __92
  90579 
  90580 	case OP_SeekLT:
  90581 		goto __93
  90582 	case OP_SeekLE:
  90583 		goto __94
  90584 	case OP_SeekGE:
  90585 		goto __95
  90586 	case OP_SeekGT:
  90587 		goto __96
  90588 
  90589 	case OP_SeekScan:
  90590 		goto __97
  90591 
  90592 	case OP_SeekHit:
  90593 		goto __98
  90594 
  90595 	case OP_IfNotOpen:
  90596 		goto __99
  90597 
  90598 	case OP_IfNoHope:
  90599 		goto __100
  90600 	case OP_NoConflict:
  90601 		goto __101
  90602 	case OP_NotFound:
  90603 		goto __102
  90604 	case OP_Found:
  90605 		goto __103
  90606 
  90607 	case OP_SeekRowid:
  90608 		goto __104
  90609 	case OP_NotExists:
  90610 		goto __105
  90611 
  90612 	case OP_Sequence:
  90613 		goto __106
  90614 
  90615 	case OP_NewRowid:
  90616 		goto __107
  90617 
  90618 	case OP_Insert:
  90619 		goto __108
  90620 
  90621 	case OP_RowCell:
  90622 		goto __109
  90623 
  90624 	case OP_Delete:
  90625 		goto __110
  90626 
  90627 	case OP_ResetCount:
  90628 		goto __111
  90629 
  90630 	case OP_SorterCompare:
  90631 		goto __112
  90632 
  90633 	case OP_SorterData:
  90634 		goto __113
  90635 
  90636 	case OP_RowData:
  90637 		goto __114
  90638 
  90639 	case OP_Rowid:
  90640 		goto __115
  90641 
  90642 	case OP_NullRow:
  90643 		goto __116
  90644 
  90645 	case OP_SeekEnd:
  90646 		goto __117
  90647 	case OP_Last:
  90648 		goto __118
  90649 
  90650 	case OP_IfSmaller:
  90651 		goto __119
  90652 
  90653 	case OP_SorterSort:
  90654 		goto __120
  90655 	case OP_Sort:
  90656 		goto __121
  90657 
  90658 	case OP_Rewind:
  90659 		goto __122
  90660 
  90661 	case OP_SorterNext:
  90662 		goto __123
  90663 
  90664 	case OP_Prev:
  90665 		goto __124
  90666 
  90667 	case OP_Next:
  90668 		goto __125
  90669 
  90670 	case OP_IdxInsert:
  90671 		goto __126
  90672 
  90673 	case OP_SorterInsert:
  90674 		goto __127
  90675 
  90676 	case OP_IdxDelete:
  90677 		goto __128
  90678 
  90679 	case OP_DeferredSeek:
  90680 		goto __129
  90681 	case OP_IdxRowid:
  90682 		goto __130
  90683 
  90684 	case OP_FinishSeek:
  90685 		goto __131
  90686 
  90687 	case OP_IdxLE:
  90688 		goto __132
  90689 	case OP_IdxGT:
  90690 		goto __133
  90691 	case OP_IdxLT:
  90692 		goto __134
  90693 	case OP_IdxGE:
  90694 		goto __135
  90695 
  90696 	case OP_Destroy:
  90697 		goto __136
  90698 
  90699 	case OP_Clear:
  90700 		goto __137
  90701 
  90702 	case OP_ResetSorter:
  90703 		goto __138
  90704 
  90705 	case OP_CreateBtree:
  90706 		goto __139
  90707 
  90708 	case OP_SqlExec:
  90709 		goto __140
  90710 
  90711 	case OP_ParseSchema:
  90712 		goto __141
  90713 
  90714 	case OP_LoadAnalysis:
  90715 		goto __142
  90716 
  90717 	case OP_DropTable:
  90718 		goto __143
  90719 
  90720 	case OP_DropIndex:
  90721 		goto __144
  90722 
  90723 	case OP_DropTrigger:
  90724 		goto __145
  90725 
  90726 	case OP_IntegrityCk:
  90727 		goto __146
  90728 
  90729 	case OP_RowSetAdd:
  90730 		goto __147
  90731 
  90732 	case OP_RowSetRead:
  90733 		goto __148
  90734 
  90735 	case OP_RowSetTest:
  90736 		goto __149
  90737 
  90738 	case OP_Program:
  90739 		goto __150
  90740 
  90741 	case OP_Param:
  90742 		goto __151
  90743 
  90744 	case OP_FkCounter:
  90745 		goto __152
  90746 
  90747 	case OP_FkIfZero:
  90748 		goto __153
  90749 
  90750 	case OP_MemMax:
  90751 		goto __154
  90752 
  90753 	case OP_IfPos:
  90754 		goto __155
  90755 
  90756 	case OP_OffsetLimit:
  90757 		goto __156
  90758 
  90759 	case OP_IfNotZero:
  90760 		goto __157
  90761 
  90762 	case OP_DecrJumpZero:
  90763 		goto __158
  90764 
  90765 	case OP_AggInverse:
  90766 		goto __159
  90767 	case OP_AggStep:
  90768 		goto __160
  90769 	case OP_AggStep1:
  90770 		goto __161
  90771 
  90772 	case OP_AggValue:
  90773 		goto __162
  90774 	case OP_AggFinal:
  90775 		goto __163
  90776 
  90777 	case OP_Checkpoint:
  90778 		goto __164
  90779 
  90780 	case OP_JournalMode:
  90781 		goto __165
  90782 
  90783 	case OP_Vacuum:
  90784 		goto __166
  90785 
  90786 	case OP_IncrVacuum:
  90787 		goto __167
  90788 
  90789 	case OP_Expire:
  90790 		goto __168
  90791 
  90792 	case OP_CursorLock:
  90793 		goto __169
  90794 
  90795 	case OP_CursorUnlock:
  90796 		goto __170
  90797 
  90798 	case OP_TableLock:
  90799 		goto __171
  90800 
  90801 	case OP_VBegin:
  90802 		goto __172
  90803 
  90804 	case OP_VCreate:
  90805 		goto __173
  90806 
  90807 	case OP_VDestroy:
  90808 		goto __174
  90809 
  90810 	case OP_VOpen:
  90811 		goto __175
  90812 
  90813 	case OP_VInitIn:
  90814 		goto __176
  90815 
  90816 	case OP_VFilter:
  90817 		goto __177
  90818 
  90819 	case OP_VColumn:
  90820 		goto __178
  90821 
  90822 	case OP_VNext:
  90823 		goto __179
  90824 
  90825 	case OP_VRename:
  90826 		goto __180
  90827 
  90828 	case OP_VUpdate:
  90829 		goto __181
  90830 
  90831 	case OP_Pagecount:
  90832 		goto __182
  90833 
  90834 	case OP_MaxPgcnt:
  90835 		goto __183
  90836 
  90837 	case OP_PureFunc:
  90838 		goto __184
  90839 	case OP_Function:
  90840 		goto __185
  90841 
  90842 	case OP_ClrSubtype:
  90843 		goto __186
  90844 
  90845 	case OP_FilterAdd:
  90846 		goto __187
  90847 
  90848 	case OP_Filter:
  90849 		goto __188
  90850 
  90851 	case OP_Trace:
  90852 		goto __189
  90853 	case OP_Init:
  90854 		goto __190
  90855 
  90856 	default:
  90857 		goto __191
  90858 	}
  90859 	goto __9
  90860 
  90861 __10:
  90862 jump_to_p2_and_check_for_interrupt:
  90863 	pOp = aOp + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2-1)*24
  90864 
  90865 check_for_interrupt:
  90866 	if !(libc.AtomicLoadNInt32(db+432, 0) != 0) {
  90867 		goto __192
  90868 	}
  90869 	goto abort_due_to_interrupt
  90870 __192:
  90871 	;
  90872 __193:
  90873 	if !(nVmStep >= nProgressLimit && (*Sqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0)) {
  90874 		goto __194
  90875 	}
  90876 
  90877 	nProgressLimit = nProgressLimit + U64((*Sqlite3)(unsafe.Pointer(db)).FnProgressOps)
  90878 	if !((*struct {
  90879 		f func(*libc.TLS, uintptr) int32
  90880 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxProgress})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProgressArg) != 0) {
  90881 		goto __195
  90882 	}
  90883 	nProgressLimit = uint64(0xffffffff) | uint64(0xffffffff)<<32
  90884 	rc = SQLITE_INTERRUPT
  90885 	goto abort_due_to_error
  90886 __195:
  90887 	;
  90888 	goto __193
  90889 __194:
  90890 	;
  90891 	goto __9
  90892 
  90893 __11:
  90894 	;
  90895 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  90896 
  90897 	(*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(MEM_Int)
  90898 	*(*I64)(unsafe.Pointer(pIn1)) = I64(int32((int64(pOp) - int64(aOp)) / 24))
  90899 
  90900 	goto jump_to_p2_and_check_for_interrupt
  90901 
  90902 __12:
  90903 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  90904 	if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Int != 0) {
  90905 		goto __196
  90906 	}
  90907 	if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) {
  90908 		goto __198
  90909 	}
  90910 __198:
  90911 	;
  90912 	pOp = aOp + uintptr(*(*I64)(unsafe.Pointer(pIn1)))*24
  90913 	goto __197
  90914 __196:
  90915 	if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) {
  90916 		goto __199
  90917 	}
  90918 
  90919 __199:
  90920 	;
  90921 __197:
  90922 	;
  90923 	goto __9
  90924 
  90925 __13:
  90926 	;
  90927 	pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  90928 
  90929 	*(*I64)(unsafe.Pointer(pOut)) = I64((*Op)(unsafe.Pointer(pOp)).Fp3 - 1)
  90930 	(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int)
  90931 	if !((*Op)(unsafe.Pointer(pOp)).Fp2 == 0) {
  90932 		goto __200
  90933 	}
  90934 	goto __9
  90935 __200:
  90936 	;
  90937 jump_to_p2:
  90938 	;
  90939 	pOp = aOp + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2-1)*24
  90940 	goto __9
  90941 
  90942 __14:
  90943 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  90944 
  90945 	pCaller = aOp + uintptr(*(*I64)(unsafe.Pointer(pIn1)))*24
  90946 
  90947 	pOp = aOp + uintptr((*VdbeOp)(unsafe.Pointer(pCaller)).Fp2-1)*24
  90948 	(*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(MEM_Undefined)
  90949 	goto __9
  90950 
  90951 __15:
  90952 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  90953 
  90954 	(*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(MEM_Int)
  90955 	pcDest = int32(*(*I64)(unsafe.Pointer(pIn1)))
  90956 	*(*I64)(unsafe.Pointer(pIn1)) = I64(int32((int64(pOp) - int64(aOp)) / 24))
  90957 
  90958 	pOp = aOp + uintptr(pcDest)*24
  90959 	goto __9
  90960 
  90961 __16:
  90962 	pIn3 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  90963 	if !(int32((*Mem)(unsafe.Pointer(pIn3)).Fflags)&MEM_Null == 0) {
  90964 		goto __201
  90965 	}
  90966 	goto __9
  90967 __201:
  90968 	;
  90969 __17:
  90970 	;
  90971 	if !((*Vdbe)(unsafe.Pointer(p)).FpFrame != 0 && (*Op)(unsafe.Pointer(pOp)).Fp1 == SQLITE_OK) {
  90972 		goto __202
  90973 	}
  90974 
  90975 	pFrame = (*Vdbe)(unsafe.Pointer(p)).FpFrame
  90976 	(*Vdbe)(unsafe.Pointer(p)).FpFrame = (*VdbeFrame)(unsafe.Pointer(pFrame)).FpParent
  90977 	(*Vdbe)(unsafe.Pointer(p)).FnFrame--
  90978 	Xsqlite3VdbeSetChanges(tls, db, (*Vdbe)(unsafe.Pointer(p)).FnChange)
  90979 	pcx = Xsqlite3VdbeFrameRestore(tls, pFrame)
  90980 	if !((*Op)(unsafe.Pointer(pOp)).Fp2 == OE_Ignore) {
  90981 		goto __203
  90982 	}
  90983 
  90984 	pcx = (*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr(pcx)*24)).Fp2 - 1
  90985 __203:
  90986 	;
  90987 	aOp = (*Vdbe)(unsafe.Pointer(p)).FaOp
  90988 	aMem = (*Vdbe)(unsafe.Pointer(p)).FaMem
  90989 	pOp = aOp + uintptr(pcx)*24
  90990 	goto __9
  90991 __202:
  90992 	;
  90993 	(*Vdbe)(unsafe.Pointer(p)).Frc = (*Op)(unsafe.Pointer(pOp)).Fp1
  90994 	(*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8((*Op)(unsafe.Pointer(pOp)).Fp2)
  90995 
  90996 	if !((*Vdbe)(unsafe.Pointer(p)).Frc != 0) {
  90997 		goto __204
  90998 	}
  90999 	if !((*Op)(unsafe.Pointer(pOp)).Fp5 != 0) {
  91000 		goto __205
  91001 	}
  91002 
  91003 	Xsqlite3VdbeError(tls, p, ts+6783, libc.VaList(bp, azType[int32((*Op)(unsafe.Pointer(pOp)).Fp5)-1]))
  91004 	if !(*(*uintptr)(unsafe.Pointer(pOp + 16)) != 0) {
  91005 		goto __207
  91006 	}
  91007 	(*Vdbe)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3MPrintf(tls, db, ts+6804, libc.VaList(bp+8, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16))))
  91008 __207:
  91009 	;
  91010 	goto __206
  91011 __205:
  91012 	Xsqlite3VdbeError(tls, p, ts+4493, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(pOp + 16))))
  91013 __206:
  91014 	;
  91015 	pcx = int32((int64(pOp) - int64(aOp)) / 24)
  91016 	Xsqlite3_log(tls, (*Op)(unsafe.Pointer(pOp)).Fp1, ts+6811, libc.VaList(bp+32, pcx, (*Vdbe)(unsafe.Pointer(p)).FzSql, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg))
  91017 __204:
  91018 	;
  91019 	rc = Xsqlite3VdbeHalt(tls, p)
  91020 
  91021 	if !(rc == SQLITE_BUSY) {
  91022 		goto __208
  91023 	}
  91024 	(*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_BUSY
  91025 	goto __209
  91026 __208:
  91027 	;
  91028 	if (*Vdbe)(unsafe.Pointer(p)).Frc != 0 {
  91029 		rc = SQLITE_ERROR
  91030 	} else {
  91031 		rc = SQLITE_DONE
  91032 	}
  91033 __209:
  91034 	;
  91035 	goto vdbe_return
  91036 
  91037 __18:
  91038 	pOut = out2Prerelease(tls, p, pOp)
  91039 	*(*I64)(unsafe.Pointer(pOut)) = I64((*Op)(unsafe.Pointer(pOp)).Fp1)
  91040 	goto __9
  91041 
  91042 __19:
  91043 	pOut = out2Prerelease(tls, p, pOp)
  91044 
  91045 	*(*I64)(unsafe.Pointer(pOut)) = *(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16))))
  91046 	goto __9
  91047 
  91048 __20:
  91049 	pOut = out2Prerelease(tls, p, pOp)
  91050 	(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Real)
  91051 
  91052 	*(*float64)(unsafe.Pointer(pOut)) = *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16))))
  91053 	goto __9
  91054 
  91055 __21:
  91056 	;
  91057 	pOut = out2Prerelease(tls, p, pOp)
  91058 	(*Op)(unsafe.Pointer(pOp)).Fp1 = Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(pOp + 16)))
  91059 
  91060 	if !(int32(encoding) != SQLITE_UTF8) {
  91061 		goto __210
  91062 	}
  91063 	rc = Xsqlite3VdbeMemSetStr(tls, pOut, *(*uintptr)(unsafe.Pointer(pOp + 16)), int64(-1), uint8(SQLITE_UTF8), uintptr(0))
  91064 
  91065 	if !(rc != 0) {
  91066 		goto __211
  91067 	}
  91068 	goto too_big
  91069 __211:
  91070 	;
  91071 	if !(SQLITE_OK != Xsqlite3VdbeChangeEncoding(tls, pOut, int32(encoding))) {
  91072 		goto __212
  91073 	}
  91074 	goto no_mem
  91075 __212:
  91076 	;
  91077 	(*Mem)(unsafe.Pointer(pOut)).FszMalloc = 0
  91078 	*(*U16)(unsafe.Pointer(pOut + 20)) |= U16(MEM_Static)
  91079 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == -6) {
  91080 		goto __213
  91081 	}
  91082 	Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16)))
  91083 __213:
  91084 	;
  91085 	(*Op)(unsafe.Pointer(pOp)).Fp4type = int8(-6)
  91086 	*(*uintptr)(unsafe.Pointer(pOp + 16)) = (*Mem)(unsafe.Pointer(pOut)).Fz
  91087 	(*Op)(unsafe.Pointer(pOp)).Fp1 = (*Mem)(unsafe.Pointer(pOut)).Fn
  91088 __210:
  91089 	;
  91090 	if !((*Op)(unsafe.Pointer(pOp)).Fp1 > *(*int32)(unsafe.Pointer(db + 136))) {
  91091 		goto __214
  91092 	}
  91093 	goto too_big
  91094 __214:
  91095 	;
  91096 	(*Op)(unsafe.Pointer(pOp)).Fopcode = U8(OP_String)
  91097 
  91098 __22:
  91099 	;
  91100 	pOut = out2Prerelease(tls, p, pOp)
  91101 	(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Str | MEM_Static | MEM_Term)
  91102 	(*Mem)(unsafe.Pointer(pOut)).Fz = *(*uintptr)(unsafe.Pointer(pOp + 16))
  91103 	(*Mem)(unsafe.Pointer(pOut)).Fn = (*Op)(unsafe.Pointer(pOp)).Fp1
  91104 	(*Mem)(unsafe.Pointer(pOut)).Fenc = encoding
  91105 
  91106 	goto __9
  91107 
  91108 __23:
  91109 __24:
  91110 	pOut = out2Prerelease(tls, p, pOp)
  91111 	cnt = (*Op)(unsafe.Pointer(pOp)).Fp3 - (*Op)(unsafe.Pointer(pOp)).Fp2
  91112 
  91113 	(*Mem)(unsafe.Pointer(pOut)).Fflags = libc.AssignUint16(&nullFlag, func() uint16 {
  91114 		if (*Op)(unsafe.Pointer(pOp)).Fp1 != 0 {
  91115 			return uint16(MEM_Null | MEM_Cleared)
  91116 		}
  91117 		return uint16(MEM_Null)
  91118 	}())
  91119 	(*Mem)(unsafe.Pointer(pOut)).Fn = 0
  91120 __215:
  91121 	if !(cnt > 0) {
  91122 		goto __216
  91123 	}
  91124 	pOut += 56
  91125 
  91126 	Xsqlite3VdbeMemSetNull(tls, pOut)
  91127 	(*Mem)(unsafe.Pointer(pOut)).Fflags = nullFlag
  91128 	(*Mem)(unsafe.Pointer(pOut)).Fn = 0
  91129 	cnt--
  91130 	goto __215
  91131 __216:
  91132 	;
  91133 	goto __9
  91134 
  91135 __25:
  91136 	;
  91137 	pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  91138 	(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&libc.CplInt32(MEM_Undefined|MEM_AffMask) | MEM_Null)
  91139 	goto __9
  91140 
  91141 __26:
  91142 	;
  91143 	pOut = out2Prerelease(tls, p, pOp)
  91144 	if !(*(*uintptr)(unsafe.Pointer(pOp + 16)) == uintptr(0)) {
  91145 		goto __217
  91146 	}
  91147 	Xsqlite3VdbeMemSetZeroBlob(tls, pOut, (*Op)(unsafe.Pointer(pOp)).Fp1)
  91148 	if !(Xsqlite3VdbeMemExpandBlob(tls, pOut) != 0) {
  91149 		goto __219
  91150 	}
  91151 	goto no_mem
  91152 __219:
  91153 	;
  91154 	goto __218
  91155 __217:
  91156 	Xsqlite3VdbeMemSetStr(tls, pOut, *(*uintptr)(unsafe.Pointer(pOp + 16)), int64((*Op)(unsafe.Pointer(pOp)).Fp1), uint8(0), uintptr(0))
  91157 __218:
  91158 	;
  91159 	(*Mem)(unsafe.Pointer(pOut)).Fenc = encoding
  91160 
  91161 	goto __9
  91162 
  91163 __27:
  91164 	;
  91165 	pVar = (*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1-1)*56
  91166 	if !(Xsqlite3VdbeMemTooBig(tls, pVar) != 0) {
  91167 		goto __220
  91168 	}
  91169 	goto too_big
  91170 __220:
  91171 	;
  91172 	pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56
  91173 	if !(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&(MEM_Agg|MEM_Dyn) != 0) {
  91174 		goto __221
  91175 	}
  91176 	Xsqlite3VdbeMemSetNull(tls, pOut)
  91177 __221:
  91178 	;
  91179 	libc.Xmemcpy(tls, pOut, pVar, uint64(uintptr(0)+24))
  91180 	*(*U16)(unsafe.Pointer(pOut + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Dyn | MEM_Ephem))
  91181 	*(*U16)(unsafe.Pointer(pOut + 20)) |= U16(MEM_Static | MEM_FromBind)
  91182 
  91183 	goto __9
  91184 
  91185 __28:
  91186 	n = (*Op)(unsafe.Pointer(pOp)).Fp3
  91187 	p1 = (*Op)(unsafe.Pointer(pOp)).Fp1
  91188 	p2 = (*Op)(unsafe.Pointer(pOp)).Fp2
  91189 
  91190 	pIn1 = aMem + uintptr(p1)*56
  91191 	pOut = aMem + uintptr(p2)*56
  91192 __222:
  91193 	;
  91194 	Xsqlite3VdbeMemMove(tls, pOut, pIn1)
  91195 	if !(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&MEM_Ephem != 0 && Xsqlite3VdbeMemMakeWriteable(tls, pOut) != 0) {
  91196 		goto __225
  91197 	}
  91198 	goto no_mem
  91199 __225:
  91200 	;
  91201 	pIn1 += 56
  91202 	pOut += 56
  91203 	goto __223
  91204 __223:
  91205 	if libc.PreDecInt32(&n, 1) != 0 {
  91206 		goto __222
  91207 	}
  91208 	goto __224
  91209 __224:
  91210 	;
  91211 	goto __9
  91212 
  91213 __29:
  91214 	n1 = (*Op)(unsafe.Pointer(pOp)).Fp3
  91215 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  91216 	pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56
  91217 
  91218 __226:
  91219 	if !(1 != 0) {
  91220 		goto __227
  91221 	}
  91222 
  91223 	Xsqlite3VdbeMemShallowCopy(tls, pOut, pIn1, MEM_Ephem)
  91224 	if !(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&MEM_Ephem != 0 && Xsqlite3VdbeMemMakeWriteable(tls, pOut) != 0) {
  91225 		goto __228
  91226 	}
  91227 	goto no_mem
  91228 __228:
  91229 	;
  91230 	if !(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&MEM_Subtype != 0 && int32((*Op)(unsafe.Pointer(pOp)).Fp5)&0x0002 != 0) {
  91231 		goto __229
  91232 	}
  91233 	*(*U16)(unsafe.Pointer(pOut + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Subtype))
  91234 __229:
  91235 	;
  91236 	if !(libc.PostDecInt32(&n1, 1) == 0) {
  91237 		goto __230
  91238 	}
  91239 	goto __227
  91240 __230:
  91241 	;
  91242 	pOut += 56
  91243 	pIn1 += 56
  91244 	goto __226
  91245 __227:
  91246 	;
  91247 	goto __9
  91248 
  91249 __30:
  91250 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  91251 	pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56
  91252 
  91253 	Xsqlite3VdbeMemShallowCopy(tls, pOut, pIn1, MEM_Ephem)
  91254 	goto __9
  91255 
  91256 __31:
  91257 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  91258 
  91259 	pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56
  91260 	Xsqlite3VdbeMemSetInt64(tls, pOut, *(*I64)(unsafe.Pointer(pIn1)))
  91261 	goto __9
  91262 
  91263 __32:
  91264 	if !(libc.AssignInt32(&rc, Xsqlite3VdbeCheckFk(tls, p, 0)) != SQLITE_OK) {
  91265 		goto __231
  91266 	}
  91267 	goto abort_due_to_error
  91268 __231:
  91269 	;
  91270 	goto __9
  91271 
  91272 __33:
  91273 	;
  91274 	(*Vdbe)(unsafe.Pointer(p)).FcacheCtr = (*Vdbe)(unsafe.Pointer(p)).FcacheCtr + U32(2) | U32(1)
  91275 	(*Vdbe)(unsafe.Pointer(p)).FpResultRow = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  91276 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
  91277 		goto __232
  91278 	}
  91279 	goto no_mem
  91280 __232:
  91281 	;
  91282 	if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace)&SQLITE_TRACE_ROW != 0) {
  91283 		goto __233
  91284 	}
  91285 	(*struct {
  91286 		f func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32
  91287 	})(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(db + 248))})).f(tls, uint32(SQLITE_TRACE_ROW), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, uintptr(0))
  91288 __233:
  91289 	;
  91290 	(*Vdbe)(unsafe.Pointer(p)).Fpc = int32((int64(pOp)-int64(aOp))/24) + 1
  91291 	rc = SQLITE_ROW
  91292 	goto vdbe_return
  91293 
  91294 __34:
  91295 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  91296 	pIn2 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56
  91297 	pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  91298 
  91299 	flags1 = (*Mem)(unsafe.Pointer(pIn1)).Fflags
  91300 
  91301 	if !((int32(flags1)|int32((*Mem)(unsafe.Pointer(pIn2)).Fflags))&MEM_Null != 0) {
  91302 		goto __234
  91303 	}
  91304 	Xsqlite3VdbeMemSetNull(tls, pOut)
  91305 	goto __9
  91306 __234:
  91307 	;
  91308 	if !(int32(flags1)&(MEM_Str|MEM_Blob) == 0) {
  91309 		goto __235
  91310 	}
  91311 	if !(Xsqlite3VdbeMemStringify(tls, pIn1, encoding, uint8(0)) != 0) {
  91312 		goto __237
  91313 	}
  91314 	goto no_mem
  91315 __237:
  91316 	;
  91317 	flags1 = U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & libc.CplInt32(MEM_Str))
  91318 	goto __236
  91319 __235:
  91320 	if !(int32(flags1)&MEM_Zero != 0) {
  91321 		goto __238
  91322 	}
  91323 	if !(Xsqlite3VdbeMemExpandBlob(tls, pIn1) != 0) {
  91324 		goto __239
  91325 	}
  91326 	goto no_mem
  91327 __239:
  91328 	;
  91329 	flags1 = U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & libc.CplInt32(MEM_Str))
  91330 __238:
  91331 	;
  91332 __236:
  91333 	;
  91334 	flags2 = (*Mem)(unsafe.Pointer(pIn2)).Fflags
  91335 	if !(int32(flags2)&(MEM_Str|MEM_Blob) == 0) {
  91336 		goto __240
  91337 	}
  91338 	if !(Xsqlite3VdbeMemStringify(tls, pIn2, encoding, uint8(0)) != 0) {
  91339 		goto __242
  91340 	}
  91341 	goto no_mem
  91342 __242:
  91343 	;
  91344 	flags2 = U16(int32((*Mem)(unsafe.Pointer(pIn2)).Fflags) & libc.CplInt32(MEM_Str))
  91345 	goto __241
  91346 __240:
  91347 	if !(int32(flags2)&MEM_Zero != 0) {
  91348 		goto __243
  91349 	}
  91350 	if !(Xsqlite3VdbeMemExpandBlob(tls, pIn2) != 0) {
  91351 		goto __244
  91352 	}
  91353 	goto no_mem
  91354 __244:
  91355 	;
  91356 	flags2 = U16(int32((*Mem)(unsafe.Pointer(pIn2)).Fflags) & libc.CplInt32(MEM_Str))
  91357 __243:
  91358 	;
  91359 __241:
  91360 	;
  91361 	nByte = I64((*Mem)(unsafe.Pointer(pIn1)).Fn + (*Mem)(unsafe.Pointer(pIn2)).Fn)
  91362 	if !(nByte > I64(*(*int32)(unsafe.Pointer(db + 136)))) {
  91363 		goto __245
  91364 	}
  91365 	goto too_big
  91366 __245:
  91367 	;
  91368 	if !(Xsqlite3VdbeMemGrow(tls, pOut, int32(nByte)+2, libc.Bool32(pOut == pIn2)) != 0) {
  91369 		goto __246
  91370 	}
  91371 	goto no_mem
  91372 __246:
  91373 	;
  91374 	(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Str)
  91375 	if !(pOut != pIn2) {
  91376 		goto __247
  91377 	}
  91378 	libc.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pOut)).Fz, (*Mem)(unsafe.Pointer(pIn2)).Fz, uint64((*Mem)(unsafe.Pointer(pIn2)).Fn))
  91379 
  91380 	(*Mem)(unsafe.Pointer(pIn2)).Fflags = flags2
  91381 __247:
  91382 	;
  91383 	libc.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pOut)).Fz+uintptr((*Mem)(unsafe.Pointer(pIn2)).Fn), (*Mem)(unsafe.Pointer(pIn1)).Fz, uint64((*Mem)(unsafe.Pointer(pIn1)).Fn))
  91384 
  91385 	(*Mem)(unsafe.Pointer(pIn1)).Fflags = flags1
  91386 	if !(int32(encoding) > SQLITE_UTF8) {
  91387 		goto __248
  91388 	}
  91389 	nByte = nByte & int64(libc.CplInt32(1))
  91390 __248:
  91391 	;
  91392 	*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pOut)).Fz + uintptr(nByte))) = int8(0)
  91393 	*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pOut)).Fz + uintptr(nByte+int64(1)))) = int8(0)
  91394 	*(*U16)(unsafe.Pointer(pOut + 20)) |= U16(MEM_Term)
  91395 	(*Mem)(unsafe.Pointer(pOut)).Fn = int32(nByte)
  91396 	(*Mem)(unsafe.Pointer(pOut)).Fenc = encoding
  91397 
  91398 	goto __9
  91399 
  91400 __35:
  91401 __36:
  91402 __37:
  91403 __38:
  91404 __39:
  91405 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  91406 	type1 = (*Mem)(unsafe.Pointer(pIn1)).Fflags
  91407 	pIn2 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56
  91408 	type2 = (*Mem)(unsafe.Pointer(pIn2)).Fflags
  91409 	pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  91410 	if !(int32(type1)&int32(type2)&MEM_Int != 0) {
  91411 		goto __249
  91412 	}
  91413 int_math:
  91414 	iA = *(*I64)(unsafe.Pointer(pIn1))
  91415 	*(*I64)(unsafe.Pointer(bp + 208)) = *(*I64)(unsafe.Pointer(pIn2))
  91416 	switch int32((*Op)(unsafe.Pointer(pOp)).Fopcode) {
  91417 	case OP_Add:
  91418 		goto __252
  91419 	case OP_Subtract:
  91420 		goto __253
  91421 	case OP_Multiply:
  91422 		goto __254
  91423 	case OP_Divide:
  91424 		goto __255
  91425 	default:
  91426 		goto __256
  91427 	}
  91428 	goto __251
  91429 __252:
  91430 	if !(Xsqlite3AddInt64(tls, bp+208, iA) != 0) {
  91431 		goto __257
  91432 	}
  91433 	goto fp_math
  91434 __257:
  91435 	;
  91436 	goto __251
  91437 __253:
  91438 	if !(Xsqlite3SubInt64(tls, bp+208, iA) != 0) {
  91439 		goto __258
  91440 	}
  91441 	goto fp_math
  91442 __258:
  91443 	;
  91444 	goto __251
  91445 __254:
  91446 	if !(Xsqlite3MulInt64(tls, bp+208, iA) != 0) {
  91447 		goto __259
  91448 	}
  91449 	goto fp_math
  91450 __259:
  91451 	;
  91452 	goto __251
  91453 __255:
  91454 	if !(iA == int64(0)) {
  91455 		goto __260
  91456 	}
  91457 	goto arithmetic_result_is_null
  91458 __260:
  91459 	;
  91460 	if !(iA == int64(-1) && *(*I64)(unsafe.Pointer(bp + 208)) == int64(-1)-(int64(0xffffffff)|int64(0x7fffffff)<<32)) {
  91461 		goto __261
  91462 	}
  91463 	goto fp_math
  91464 __261:
  91465 	;
  91466 	*(*I64)(unsafe.Pointer(bp + 208)) /= iA
  91467 	goto __251
  91468 
  91469 __256:
  91470 	if !(iA == int64(0)) {
  91471 		goto __262
  91472 	}
  91473 	goto arithmetic_result_is_null
  91474 __262:
  91475 	;
  91476 	if !(iA == int64(-1)) {
  91477 		goto __263
  91478 	}
  91479 	iA = int64(1)
  91480 __263:
  91481 	;
  91482 	*(*I64)(unsafe.Pointer(bp + 208)) %= iA
  91483 	goto __251
  91484 
  91485 __251:
  91486 	;
  91487 	*(*I64)(unsafe.Pointer(pOut)) = *(*I64)(unsafe.Pointer(bp + 208))
  91488 	(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Int)
  91489 	goto __250
  91490 __249:
  91491 	if !((int32(type1)|int32(type2))&MEM_Null != 0) {
  91492 		goto __264
  91493 	}
  91494 	goto arithmetic_result_is_null
  91495 	goto __265
  91496 __264:
  91497 	type1 = numericType(tls, pIn1)
  91498 	type2 = numericType(tls, pIn2)
  91499 	if !(int32(type1)&int32(type2)&MEM_Int != 0) {
  91500 		goto __266
  91501 	}
  91502 	goto int_math
  91503 __266:
  91504 	;
  91505 fp_math:
  91506 	rA = Xsqlite3VdbeRealValue(tls, pIn1)
  91507 	rB = Xsqlite3VdbeRealValue(tls, pIn2)
  91508 	switch int32((*Op)(unsafe.Pointer(pOp)).Fopcode) {
  91509 	case OP_Add:
  91510 		goto __268
  91511 	case OP_Subtract:
  91512 		goto __269
  91513 	case OP_Multiply:
  91514 		goto __270
  91515 	case OP_Divide:
  91516 		goto __271
  91517 	default:
  91518 		goto __272
  91519 	}
  91520 	goto __267
  91521 __268:
  91522 	rB = rB + rA
  91523 	goto __267
  91524 __269:
  91525 	rB = rB - rA
  91526 	goto __267
  91527 __270:
  91528 	rB = rB * rA
  91529 	goto __267
  91530 __271:
  91531 	if !(rA == float64(0)) {
  91532 		goto __273
  91533 	}
  91534 	goto arithmetic_result_is_null
  91535 __273:
  91536 	;
  91537 	rB = rB / rA
  91538 	goto __267
  91539 
  91540 __272:
  91541 	iA = Xsqlite3VdbeIntValue(tls, pIn1)
  91542 	*(*I64)(unsafe.Pointer(bp + 208)) = Xsqlite3VdbeIntValue(tls, pIn2)
  91543 	if !(iA == int64(0)) {
  91544 		goto __274
  91545 	}
  91546 	goto arithmetic_result_is_null
  91547 __274:
  91548 	;
  91549 	if !(iA == int64(-1)) {
  91550 		goto __275
  91551 	}
  91552 	iA = int64(1)
  91553 __275:
  91554 	;
  91555 	rB = float64(*(*I64)(unsafe.Pointer(bp + 208)) % iA)
  91556 	goto __267
  91557 
  91558 __267:
  91559 	;
  91560 	if !(Xsqlite3IsNaN(tls, rB) != 0) {
  91561 		goto __276
  91562 	}
  91563 	goto arithmetic_result_is_null
  91564 __276:
  91565 	;
  91566 	*(*float64)(unsafe.Pointer(pOut)) = rB
  91567 	(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Real)
  91568 __265:
  91569 	;
  91570 __250:
  91571 	;
  91572 	goto __9
  91573 
  91574 arithmetic_result_is_null:
  91575 	Xsqlite3VdbeMemSetNull(tls, pOut)
  91576 	goto __9
  91577 
  91578 __40:
  91579 	;
  91580 	if !((*Op)(unsafe.Pointer(pOp)).Fp1 != 0) {
  91581 		goto __277
  91582 	}
  91583 	Xsqlite3VdbeMemSetInt64(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56, int64(0))
  91584 __277:
  91585 	;
  91586 	goto __9
  91587 
  91588 __41:
  91589 __42:
  91590 __43:
  91591 __44:
  91592 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  91593 	pIn2 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56
  91594 	pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  91595 	if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)|int32((*Mem)(unsafe.Pointer(pIn2)).Fflags))&MEM_Null != 0) {
  91596 		goto __278
  91597 	}
  91598 	Xsqlite3VdbeMemSetNull(tls, pOut)
  91599 	goto __9
  91600 __278:
  91601 	;
  91602 	*(*I64)(unsafe.Pointer(bp + 224)) = Xsqlite3VdbeIntValue(tls, pIn2)
  91603 	iB1 = Xsqlite3VdbeIntValue(tls, pIn1)
  91604 	op = (*Op)(unsafe.Pointer(pOp)).Fopcode
  91605 	if !(int32(op) == OP_BitAnd) {
  91606 		goto __279
  91607 	}
  91608 	*(*I64)(unsafe.Pointer(bp + 224)) &= iB1
  91609 	goto __280
  91610 __279:
  91611 	if !(int32(op) == OP_BitOr) {
  91612 		goto __281
  91613 	}
  91614 	*(*I64)(unsafe.Pointer(bp + 224)) |= iB1
  91615 	goto __282
  91616 __281:
  91617 	if !(iB1 != int64(0)) {
  91618 		goto __283
  91619 	}
  91620 
  91621 	if !(iB1 < int64(0)) {
  91622 		goto __284
  91623 	}
  91624 
  91625 	op = U8(2*OP_ShiftLeft + 1 - int32(op))
  91626 	if iB1 > int64(-64) {
  91627 		iB1 = -iB1
  91628 	} else {
  91629 		iB1 = int64(64)
  91630 	}
  91631 __284:
  91632 	;
  91633 	if !(iB1 >= int64(64)) {
  91634 		goto __285
  91635 	}
  91636 	if *(*I64)(unsafe.Pointer(bp + 224)) >= int64(0) || int32(op) == OP_ShiftLeft {
  91637 		*(*I64)(unsafe.Pointer(bp + 224)) = int64(0)
  91638 	} else {
  91639 		*(*I64)(unsafe.Pointer(bp + 224)) = int64(-1)
  91640 	}
  91641 	goto __286
  91642 __285:
  91643 	libc.Xmemcpy(tls, bp+216, bp+224, uint64(unsafe.Sizeof(U64(0))))
  91644 	if !(int32(op) == OP_ShiftLeft) {
  91645 		goto __287
  91646 	}
  91647 	*(*U64)(unsafe.Pointer(bp + 216)) <<= iB1
  91648 	goto __288
  91649 __287:
  91650 	*(*U64)(unsafe.Pointer(bp + 216)) >>= iB1
  91651 
  91652 	if !(*(*I64)(unsafe.Pointer(bp + 224)) < int64(0)) {
  91653 		goto __289
  91654 	}
  91655 	*(*U64)(unsafe.Pointer(bp + 216)) |= (uint64(0xffffffff)<<32 | uint64(0xffffffff)) << (int64(64) - iB1)
  91656 __289:
  91657 	;
  91658 __288:
  91659 	;
  91660 	libc.Xmemcpy(tls, bp+224, bp+216, uint64(unsafe.Sizeof(I64(0))))
  91661 __286:
  91662 	;
  91663 __283:
  91664 	;
  91665 __282:
  91666 	;
  91667 __280:
  91668 	;
  91669 	*(*I64)(unsafe.Pointer(pOut)) = *(*I64)(unsafe.Pointer(bp + 224))
  91670 	(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Int)
  91671 	goto __9
  91672 
  91673 __45:
  91674 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  91675 
  91676 	Xsqlite3VdbeMemIntegerify(tls, pIn1)
  91677 	*(*I64)(unsafe.Pointer(pIn1)) += I64((*Op)(unsafe.Pointer(pOp)).Fp2)
  91678 	goto __9
  91679 
  91680 __46:
  91681 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  91682 	if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Int == 0) {
  91683 		goto __290
  91684 	}
  91685 	applyAffinity(tls, pIn1, int8(SQLITE_AFF_NUMERIC), encoding)
  91686 	if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Int == 0) {
  91687 		goto __291
  91688 	}
  91689 
  91690 	if !((*Op)(unsafe.Pointer(pOp)).Fp2 == 0) {
  91691 		goto __292
  91692 	}
  91693 	rc = SQLITE_MISMATCH
  91694 	goto abort_due_to_error
  91695 	goto __293
  91696 __292:
  91697 	goto jump_to_p2
  91698 __293:
  91699 	;
  91700 __291:
  91701 	;
  91702 __290:
  91703 	;
  91704 	(*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Int)
  91705 	goto __9
  91706 
  91707 __47:
  91708 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  91709 	if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&(MEM_Int|MEM_IntReal) != 0) {
  91710 		goto __294
  91711 	}
  91712 
  91713 	Xsqlite3VdbeMemRealify(tls, pIn1)
  91714 
  91715 __294:
  91716 	;
  91717 	goto __9
  91718 
  91719 __48:
  91720 	;
  91721 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  91722 
  91723 	rc = func() int32 {
  91724 		if int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Zero != 0 {
  91725 			return Xsqlite3VdbeMemExpandBlob(tls, pIn1)
  91726 		}
  91727 		return 0
  91728 	}()
  91729 	if !(rc != 0) {
  91730 		goto __295
  91731 	}
  91732 	goto abort_due_to_error
  91733 __295:
  91734 	;
  91735 	rc = Xsqlite3VdbeMemCast(tls, pIn1, uint8((*Op)(unsafe.Pointer(pOp)).Fp2), encoding)
  91736 	if !(rc != 0) {
  91737 		goto __296
  91738 	}
  91739 	goto abort_due_to_error
  91740 __296:
  91741 	;
  91742 	goto __9
  91743 
  91744 __49:
  91745 __50:
  91746 __51:
  91747 __52:
  91748 __53:
  91749 __54:
  91750 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  91751 	pIn3 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  91752 	flags11 = (*Mem)(unsafe.Pointer(pIn1)).Fflags
  91753 	flags3 = (*Mem)(unsafe.Pointer(pIn3)).Fflags
  91754 	if !(int32(flags11)&int32(flags3)&MEM_Int != 0) {
  91755 		goto __297
  91756 	}
  91757 
  91758 	if !(*(*I64)(unsafe.Pointer(pIn3)) > *(*I64)(unsafe.Pointer(pIn1))) {
  91759 		goto __298
  91760 	}
  91761 	if !(*(*uint8)(unsafe.Pointer(Xsqlite3aGTb + uintptr((*Op)(unsafe.Pointer(pOp)).Fopcode))) != 0) {
  91762 		goto __300
  91763 	}
  91764 
  91765 	goto jump_to_p2
  91766 __300:
  91767 	;
  91768 	iCompare = +1
  91769 
  91770 	goto __299
  91771 __298:
  91772 	if !(*(*I64)(unsafe.Pointer(pIn3)) < *(*I64)(unsafe.Pointer(pIn1))) {
  91773 		goto __301
  91774 	}
  91775 	if !(*(*uint8)(unsafe.Pointer(Xsqlite3aLTb + uintptr((*Op)(unsafe.Pointer(pOp)).Fopcode))) != 0) {
  91776 		goto __303
  91777 	}
  91778 
  91779 	goto jump_to_p2
  91780 __303:
  91781 	;
  91782 	iCompare = -1
  91783 
  91784 	goto __302
  91785 __301:
  91786 	if !(*(*uint8)(unsafe.Pointer(Xsqlite3aEQb + uintptr((*Op)(unsafe.Pointer(pOp)).Fopcode))) != 0) {
  91787 		goto __304
  91788 	}
  91789 
  91790 	goto jump_to_p2
  91791 __304:
  91792 	;
  91793 	iCompare = 0
  91794 
  91795 __302:
  91796 	;
  91797 __299:
  91798 	;
  91799 	goto __9
  91800 __297:
  91801 	;
  91802 	if !((int32(flags11)|int32(flags3))&MEM_Null != 0) {
  91803 		goto __305
  91804 	}
  91805 
  91806 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&SQLITE_NULLEQ != 0) {
  91807 		goto __307
  91808 	}
  91809 
  91810 	if !(int32(flags11)&int32(flags3)&MEM_Null != 0 &&
  91811 		int32(flags3)&MEM_Cleared == 0) {
  91812 		goto __309
  91813 	}
  91814 	res = 0
  91815 	goto __310
  91816 __309:
  91817 	res = func() int32 {
  91818 		if int32(flags3)&MEM_Null != 0 {
  91819 			return -1
  91820 		}
  91821 		return +1
  91822 	}()
  91823 __310:
  91824 	;
  91825 	goto __308
  91826 __307:
  91827 	;
  91828 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&SQLITE_JUMPIFNULL != 0) {
  91829 		goto __311
  91830 	}
  91831 	goto jump_to_p2
  91832 __311:
  91833 	;
  91834 	iCompare = 1
  91835 
  91836 	goto __9
  91837 __308:
  91838 	;
  91839 	goto __306
  91840 __305:
  91841 	affinity = int8(int32((*Op)(unsafe.Pointer(pOp)).Fp5) & SQLITE_AFF_MASK)
  91842 	if !(int32(affinity) >= SQLITE_AFF_NUMERIC) {
  91843 		goto __312
  91844 	}
  91845 	if !((int32(flags11)|int32(flags3))&MEM_Str != 0) {
  91846 		goto __314
  91847 	}
  91848 	if !(int32(flags11)&(MEM_Int|MEM_IntReal|MEM_Real|MEM_Str) == MEM_Str) {
  91849 		goto __315
  91850 	}
  91851 	applyNumericAffinity(tls, pIn1, 0)
  91852 
  91853 	flags3 = (*Mem)(unsafe.Pointer(pIn3)).Fflags
  91854 __315:
  91855 	;
  91856 	if !(int32(flags3)&(MEM_Int|MEM_IntReal|MEM_Real|MEM_Str) == MEM_Str) {
  91857 		goto __316
  91858 	}
  91859 	applyNumericAffinity(tls, pIn3, 0)
  91860 __316:
  91861 	;
  91862 __314:
  91863 	;
  91864 	goto __313
  91865 __312:
  91866 	if !(int32(affinity) == SQLITE_AFF_TEXT && (int32(flags11)|int32(flags3))&MEM_Str != 0) {
  91867 		goto __317
  91868 	}
  91869 	if !(int32(flags11)&MEM_Str == 0 && int32(flags11)&(MEM_Int|MEM_Real|MEM_IntReal) != 0) {
  91870 		goto __318
  91871 	}
  91872 
  91873 	Xsqlite3VdbeMemStringify(tls, pIn1, encoding, uint8(1))
  91874 
  91875 	flags11 = U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&libc.CplInt32(MEM_TypeMask) | int32(flags11)&MEM_TypeMask)
  91876 	if !(pIn1 == pIn3) {
  91877 		goto __319
  91878 	}
  91879 	flags3 = U16(int32(flags11) | MEM_Str)
  91880 __319:
  91881 	;
  91882 __318:
  91883 	;
  91884 	if !(int32(flags3)&MEM_Str == 0 && int32(flags3)&(MEM_Int|MEM_Real|MEM_IntReal) != 0) {
  91885 		goto __320
  91886 	}
  91887 
  91888 	Xsqlite3VdbeMemStringify(tls, pIn3, encoding, uint8(1))
  91889 
  91890 	flags3 = U16(int32((*Mem)(unsafe.Pointer(pIn3)).Fflags)&libc.CplInt32(MEM_TypeMask) | int32(flags3)&MEM_TypeMask)
  91891 __320:
  91892 	;
  91893 __317:
  91894 	;
  91895 __313:
  91896 	;
  91897 	res = Xsqlite3MemCompare(tls, pIn3, pIn1, *(*uintptr)(unsafe.Pointer(pOp + 16)))
  91898 __306:
  91899 	;
  91900 	if !(res < 0) {
  91901 		goto __321
  91902 	}
  91903 	res2 = int32(*(*uint8)(unsafe.Pointer(Xsqlite3aLTb + uintptr((*Op)(unsafe.Pointer(pOp)).Fopcode))))
  91904 	goto __322
  91905 __321:
  91906 	if !(res == 0) {
  91907 		goto __323
  91908 	}
  91909 	res2 = int32(*(*uint8)(unsafe.Pointer(Xsqlite3aEQb + uintptr((*Op)(unsafe.Pointer(pOp)).Fopcode))))
  91910 	goto __324
  91911 __323:
  91912 	res2 = int32(*(*uint8)(unsafe.Pointer(Xsqlite3aGTb + uintptr((*Op)(unsafe.Pointer(pOp)).Fopcode))))
  91913 __324:
  91914 	;
  91915 __322:
  91916 	;
  91917 	iCompare = res
  91918 
  91919 	(*Mem)(unsafe.Pointer(pIn3)).Fflags = flags3
  91920 
  91921 	(*Mem)(unsafe.Pointer(pIn1)).Fflags = flags11
  91922 
  91923 	if !(res2 != 0) {
  91924 		goto __325
  91925 	}
  91926 	goto jump_to_p2
  91927 __325:
  91928 	;
  91929 	goto __9
  91930 
  91931 __55:
  91932 	;
  91933 	if !(iCompare == 0) {
  91934 		goto __326
  91935 	}
  91936 	goto jump_to_p2
  91937 __326:
  91938 	;
  91939 	goto __9
  91940 
  91941 __56:
  91942 	;
  91943 	goto __9
  91944 
  91945 __57:
  91946 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_PERMUTE == 0) {
  91947 		goto __327
  91948 	}
  91949 	aPermute = uintptr(0)
  91950 	goto __328
  91951 __327:
  91952 	;
  91953 	aPermute = *(*uintptr)(unsafe.Pointer(pOp + libc.UintptrFromInt32(-1)*24 + 16)) + uintptr(1)*4
  91954 
  91955 __328:
  91956 	;
  91957 	n2 = (*Op)(unsafe.Pointer(pOp)).Fp3
  91958 	pKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16))
  91959 
  91960 	p11 = (*Op)(unsafe.Pointer(pOp)).Fp1
  91961 	p21 = (*Op)(unsafe.Pointer(pOp)).Fp2
  91962 	i = 0
  91963 __329:
  91964 	if !(i < n2) {
  91965 		goto __331
  91966 	}
  91967 	if aPermute != 0 {
  91968 		idx = *(*U32)(unsafe.Pointer(aPermute + uintptr(i)*4))
  91969 	} else {
  91970 		idx = U32(i)
  91971 	}
  91972 
  91973 	pColl = *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8))
  91974 	bRev = int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(i)))) & KEYINFO_ORDER_DESC
  91975 	iCompare = Xsqlite3MemCompare(tls, aMem+uintptr(U32(p11)+idx)*56, aMem+uintptr(U32(p21)+idx)*56, pColl)
  91976 
  91977 	if !(iCompare != 0) {
  91978 		goto __332
  91979 	}
  91980 	if !(int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(i))))&KEYINFO_ORDER_BIGNULL != 0 &&
  91981 		(int32((*Mem)(unsafe.Pointer(aMem+uintptr(U32(p11)+idx)*56)).Fflags)&MEM_Null != 0 || int32((*Mem)(unsafe.Pointer(aMem+uintptr(U32(p21)+idx)*56)).Fflags)&MEM_Null != 0)) {
  91982 		goto __333
  91983 	}
  91984 	iCompare = -iCompare
  91985 __333:
  91986 	;
  91987 	if !(bRev != 0) {
  91988 		goto __334
  91989 	}
  91990 	iCompare = -iCompare
  91991 __334:
  91992 	;
  91993 	goto __331
  91994 __332:
  91995 	;
  91996 	goto __330
  91997 __330:
  91998 	i++
  91999 	goto __329
  92000 	goto __331
  92001 __331:
  92002 	;
  92003 	goto __9
  92004 
  92005 __58:
  92006 	;
  92007 	if !(iCompare < 0) {
  92008 		goto __335
  92009 	}
  92010 	pOp = aOp + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1-1)*24
  92011 	goto __336
  92012 __335:
  92013 	if !(iCompare == 0) {
  92014 		goto __337
  92015 	}
  92016 	pOp = aOp + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2-1)*24
  92017 	goto __338
  92018 __337:
  92019 	;
  92020 	pOp = aOp + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3-1)*24
  92021 __338:
  92022 	;
  92023 __336:
  92024 	;
  92025 	goto __9
  92026 
  92027 __59:
  92028 __60:
  92029 	v1 = Xsqlite3VdbeBooleanValue(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56, 2)
  92030 	v2 = Xsqlite3VdbeBooleanValue(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56, 2)
  92031 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_And) {
  92032 		goto __339
  92033 	}
  92034 	v1 = int32(and_logic[v1*3+v2])
  92035 	goto __340
  92036 __339:
  92037 	v1 = int32(or_logic[v1*3+v2])
  92038 __340:
  92039 	;
  92040 	pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  92041 	if !(v1 == 2) {
  92042 		goto __341
  92043 	}
  92044 	(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Null)
  92045 	goto __342
  92046 __341:
  92047 	*(*I64)(unsafe.Pointer(pOut)) = I64(v1)
  92048 	(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Int)
  92049 __342:
  92050 	;
  92051 	goto __9
  92052 
  92053 __61:
  92054 	;
  92055 	Xsqlite3VdbeMemSetInt64(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56,
  92056 		int64(Xsqlite3VdbeBooleanValue(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56, (*Op)(unsafe.Pointer(pOp)).Fp3)^*(*int32)(unsafe.Pointer(pOp + 16))))
  92057 	goto __9
  92058 
  92059 __62:
  92060 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  92061 	pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56
  92062 	if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Null == 0) {
  92063 		goto __343
  92064 	}
  92065 	Xsqlite3VdbeMemSetInt64(tls, pOut, libc.BoolInt64(!(Xsqlite3VdbeBooleanValue(tls, pIn1, 0) != 0)))
  92066 	goto __344
  92067 __343:
  92068 	Xsqlite3VdbeMemSetNull(tls, pOut)
  92069 __344:
  92070 	;
  92071 	goto __9
  92072 
  92073 __63:
  92074 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  92075 	pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56
  92076 	Xsqlite3VdbeMemSetNull(tls, pOut)
  92077 	if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Null == 0) {
  92078 		goto __345
  92079 	}
  92080 	(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int)
  92081 	*(*I64)(unsafe.Pointer(pOut)) = ^Xsqlite3VdbeIntValue(tls, pIn1)
  92082 __345:
  92083 	;
  92084 	goto __9
  92085 
  92086 __64:
  92087 	;
  92088 	if !((*Vdbe)(unsafe.Pointer(p)).FpFrame != 0) {
  92089 		goto __346
  92090 	}
  92091 	iAddr = U32(int32((int64(pOp) - int64((*Vdbe)(unsafe.Pointer(p)).FaOp)) / 24))
  92092 	if !(int32(*(*U8)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FpFrame)).FaOnce + uintptr(iAddr/U32(8)))))&(int32(1)<<(iAddr&U32(7))) != 0) {
  92093 		goto __348
  92094 	}
  92095 
  92096 	goto jump_to_p2
  92097 __348:
  92098 	;
  92099 	*(*U8)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FpFrame)).FaOnce + uintptr(iAddr/U32(8)))) |= U8(int32(1) << (iAddr & U32(7)))
  92100 	goto __347
  92101 __346:
  92102 	if !((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp)).Fp1 == (*Op)(unsafe.Pointer(pOp)).Fp1) {
  92103 		goto __349
  92104 	}
  92105 
  92106 	goto jump_to_p2
  92107 __349:
  92108 	;
  92109 __347:
  92110 	;
  92111 	(*Op)(unsafe.Pointer(pOp)).Fp1 = (*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp)).Fp1
  92112 	goto __9
  92113 
  92114 __65:
  92115 	c = Xsqlite3VdbeBooleanValue(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56, (*Op)(unsafe.Pointer(pOp)).Fp3)
  92116 
  92117 	if !(c != 0) {
  92118 		goto __350
  92119 	}
  92120 	goto jump_to_p2
  92121 __350:
  92122 	;
  92123 	goto __9
  92124 
  92125 __66:
  92126 	c1 = libc.BoolInt32(!(Xsqlite3VdbeBooleanValue(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56, libc.BoolInt32(!((*Op)(unsafe.Pointer(pOp)).Fp3 != 0))) != 0))
  92127 
  92128 	if !(c1 != 0) {
  92129 		goto __351
  92130 	}
  92131 	goto jump_to_p2
  92132 __351:
  92133 	;
  92134 	goto __9
  92135 
  92136 __67:
  92137 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  92138 
  92139 	if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Null != 0) {
  92140 		goto __352
  92141 	}
  92142 	goto jump_to_p2
  92143 __352:
  92144 	;
  92145 	goto __9
  92146 
  92147 __68:
  92148 	;
  92149 	if !((*Op)(unsafe.Pointer(pOp)).Fp1 >= 0) {
  92150 		goto __353
  92151 	}
  92152 	pC = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  92153 
  92154 	if !((*Op)(unsafe.Pointer(pOp)).Fp3 < int32((*VdbeCursor)(unsafe.Pointer(pC)).FnHdrParsed)) {
  92155 		goto __355
  92156 	}
  92157 	serialType = *(*U32)(unsafe.Pointer(pC + 112 + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*4))
  92158 	if !(serialType >= U32(12)) {
  92159 		goto __357
  92160 	}
  92161 	if !(serialType&U32(1) != 0) {
  92162 		goto __359
  92163 	}
  92164 	typeMask = U16(0x04)
  92165 	goto __360
  92166 __359:
  92167 	typeMask = U16(0x08)
  92168 __360:
  92169 	;
  92170 	goto __358
  92171 __357:
  92172 	;
  92173 	typeMask = U16(aMask[serialType])
  92174 __358:
  92175 	;
  92176 	goto __356
  92177 __355:
  92178 	typeMask = U16(int32(1) << (*(*int32)(unsafe.Pointer(pOp + 16)) - 1))
  92179 
  92180 __356:
  92181 	;
  92182 	goto __354
  92183 __353:
  92184 	;
  92185 	typeMask = U16(int32(1) << (Xsqlite3_value_type(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) - 1))
  92186 
  92187 __354:
  92188 	;
  92189 	if !(int32(typeMask)&int32((*Op)(unsafe.Pointer(pOp)).Fp5) != 0) {
  92190 		goto __361
  92191 	}
  92192 	goto jump_to_p2
  92193 __361:
  92194 	;
  92195 	goto __9
  92196 
  92197 __69:
  92198 	if !(int32((*Mem)(unsafe.Pointer(aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)).Fflags)&MEM_Null != 0 ||
  92199 		int32((*Mem)(unsafe.Pointer(aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)).Fflags)&MEM_Null != 0) {
  92200 		goto __362
  92201 	}
  92202 	Xsqlite3VdbeMemSetNull(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)
  92203 	goto __363
  92204 __362:
  92205 	Xsqlite3VdbeMemSetInt64(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56, int64(0))
  92206 __363:
  92207 	;
  92208 	goto __9
  92209 
  92210 __70:
  92211 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  92212 
  92213 	if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Null == 0) {
  92214 		goto __364
  92215 	}
  92216 	goto jump_to_p2
  92217 __364:
  92218 	;
  92219 	goto __9
  92220 
  92221 __71:
  92222 	;
  92223 	pC1 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  92224 	if !(pC1 != 0 && (*VdbeCursor)(unsafe.Pointer(pC1)).FnullRow != 0) {
  92225 		goto __365
  92226 	}
  92227 	Xsqlite3VdbeMemSetNull(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
  92228 	goto jump_to_p2
  92229 __365:
  92230 	;
  92231 	goto __9
  92232 
  92233 __72:
  92234 	;
  92235 	pC2 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  92236 	pOut = (*Vdbe)(unsafe.Pointer(p)).FaMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  92237 	if !(pC2 == uintptr(0) || int32((*VdbeCursor)(unsafe.Pointer(pC2)).FeCurType) != CURTYPE_BTREE) {
  92238 		goto __366
  92239 	}
  92240 	Xsqlite3VdbeMemSetNull(tls, pOut)
  92241 	goto __367
  92242 __366:
  92243 	if !((*VdbeCursor)(unsafe.Pointer(pC2)).FdeferredMoveto != 0) {
  92244 		goto __368
  92245 	}
  92246 	rc = Xsqlite3VdbeFinishMoveto(tls, pC2)
  92247 	if !(rc != 0) {
  92248 		goto __369
  92249 	}
  92250 	goto abort_due_to_error
  92251 __369:
  92252 	;
  92253 __368:
  92254 	;
  92255 	if !(Xsqlite3BtreeEof(tls, *(*uintptr)(unsafe.Pointer(pC2 + 48))) != 0) {
  92256 		goto __370
  92257 	}
  92258 	Xsqlite3VdbeMemSetNull(tls, pOut)
  92259 	goto __371
  92260 __370:
  92261 	Xsqlite3VdbeMemSetInt64(tls, pOut, Xsqlite3BtreeOffset(tls, *(*uintptr)(unsafe.Pointer(pC2 + 48))))
  92262 __371:
  92263 	;
  92264 __367:
  92265 	;
  92266 	goto __9
  92267 
  92268 __73:
  92269 	;
  92270 	pC3 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  92271 	p22 = U32((*Op)(unsafe.Pointer(pOp)).Fp2)
  92272 
  92273 op_column_restart:
  92274 	;
  92275 	aOffset = (*VdbeCursor)(unsafe.Pointer(pC3)).FaOffset
  92276 
  92277 	if !((*VdbeCursor)(unsafe.Pointer(pC3)).FcacheStatus != (*Vdbe)(unsafe.Pointer(p)).FcacheCtr) {
  92278 		goto __372
  92279 	}
  92280 	if !((*VdbeCursor)(unsafe.Pointer(pC3)).FnullRow != 0) {
  92281 		goto __374
  92282 	}
  92283 	if !(int32((*VdbeCursor)(unsafe.Pointer(pC3)).FeCurType) == CURTYPE_PSEUDO && (*VdbeCursor)(unsafe.Pointer(pC3)).FseekResult > 0) {
  92284 		goto __376
  92285 	}
  92286 
  92287 	pReg = aMem + uintptr((*VdbeCursor)(unsafe.Pointer(pC3)).FseekResult)*56
  92288 
  92289 	(*VdbeCursor)(unsafe.Pointer(pC3)).FpayloadSize = libc.AssignPtrUint32(pC3+108, U32((*Mem)(unsafe.Pointer(pReg)).Fn))
  92290 	(*VdbeCursor)(unsafe.Pointer(pC3)).FaRow = (*Mem)(unsafe.Pointer(pReg)).Fz
  92291 	goto __377
  92292 __376:
  92293 	pDest = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  92294 
  92295 	Xsqlite3VdbeMemSetNull(tls, pDest)
  92296 	goto op_column_out
  92297 __377:
  92298 	;
  92299 	goto __375
  92300 __374:
  92301 	pCrsr = *(*uintptr)(unsafe.Pointer(pC3 + 48))
  92302 	if !((*VdbeCursor)(unsafe.Pointer(pC3)).FdeferredMoveto != 0) {
  92303 		goto __378
  92304 	}
  92305 
  92306 	if !(*(*uintptr)(unsafe.Pointer(pC3 + 16)) != 0 && libc.AssignUint32(&iMap, *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pC3 + 16)) + uintptr(U32(1)+p22)*4))) > U32(0)) {
  92307 		goto __380
  92308 	}
  92309 	pC3 = (*VdbeCursor)(unsafe.Pointer(pC3)).FpAltCursor
  92310 	p22 = iMap - U32(1)
  92311 	goto op_column_restart
  92312 __380:
  92313 	;
  92314 	rc = Xsqlite3VdbeFinishMoveto(tls, pC3)
  92315 	if !(rc != 0) {
  92316 		goto __381
  92317 	}
  92318 	goto abort_due_to_error
  92319 __381:
  92320 	;
  92321 	goto __379
  92322 __378:
  92323 	if !(Xsqlite3BtreeCursorHasMoved(tls, pCrsr) != 0) {
  92324 		goto __382
  92325 	}
  92326 	rc = Xsqlite3VdbeHandleMovedCursor(tls, pC3)
  92327 	if !(rc != 0) {
  92328 		goto __383
  92329 	}
  92330 	goto abort_due_to_error
  92331 __383:
  92332 	;
  92333 	goto op_column_restart
  92334 __382:
  92335 	;
  92336 __379:
  92337 	;
  92338 	(*VdbeCursor)(unsafe.Pointer(pC3)).FpayloadSize = Xsqlite3BtreePayloadSize(tls, pCrsr)
  92339 	(*VdbeCursor)(unsafe.Pointer(pC3)).FaRow = Xsqlite3BtreePayloadFetch(tls, pCrsr, pC3+108)
  92340 
  92341 __375:
  92342 	;
  92343 	(*VdbeCursor)(unsafe.Pointer(pC3)).FcacheStatus = (*Vdbe)(unsafe.Pointer(p)).FcacheCtr
  92344 	if !(libc.AssignPtrUint32(aOffset, U32(*(*U8)(unsafe.Pointer((*VdbeCursor)(unsafe.Pointer(pC3)).FaRow)))) < U32(0x80)) {
  92345 		goto __384
  92346 	}
  92347 	(*VdbeCursor)(unsafe.Pointer(pC3)).FiHdrOffset = U32(1)
  92348 	goto __385
  92349 __384:
  92350 	(*VdbeCursor)(unsafe.Pointer(pC3)).FiHdrOffset = U32(Xsqlite3GetVarint32(tls, (*VdbeCursor)(unsafe.Pointer(pC3)).FaRow, aOffset))
  92351 __385:
  92352 	;
  92353 	(*VdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed = U16(0)
  92354 
  92355 	if !((*VdbeCursor)(unsafe.Pointer(pC3)).FszRow < *(*U32)(unsafe.Pointer(aOffset))) {
  92356 		goto __386
  92357 	}
  92358 
  92359 	(*VdbeCursor)(unsafe.Pointer(pC3)).FaRow = uintptr(0)
  92360 	(*VdbeCursor)(unsafe.Pointer(pC3)).FszRow = U32(0)
  92361 
  92362 	if !(*(*U32)(unsafe.Pointer(aOffset)) > U32(98307) || *(*U32)(unsafe.Pointer(aOffset)) > (*VdbeCursor)(unsafe.Pointer(pC3)).FpayloadSize) {
  92363 		goto __388
  92364 	}
  92365 	goto op_column_corrupt
  92366 __388:
  92367 	;
  92368 	goto __387
  92369 __386:
  92370 	zData = (*VdbeCursor)(unsafe.Pointer(pC3)).FaRow
  92371 
  92372 	goto op_column_read_header
  92373 __387:
  92374 	;
  92375 	goto __373
  92376 __372:
  92377 	if !(Xsqlite3BtreeCursorHasMoved(tls, *(*uintptr)(unsafe.Pointer(pC3 + 48))) != 0) {
  92378 		goto __389
  92379 	}
  92380 	rc = Xsqlite3VdbeHandleMovedCursor(tls, pC3)
  92381 	if !(rc != 0) {
  92382 		goto __390
  92383 	}
  92384 	goto abort_due_to_error
  92385 __390:
  92386 	;
  92387 	goto op_column_restart
  92388 __389:
  92389 	;
  92390 __373:
  92391 	;
  92392 	if !(U32((*VdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed) <= p22) {
  92393 		goto __391
  92394 	}
  92395 
  92396 	if !((*VdbeCursor)(unsafe.Pointer(pC3)).FiHdrOffset < *(*U32)(unsafe.Pointer(aOffset))) {
  92397 		goto __393
  92398 	}
  92399 
  92400 	if !((*VdbeCursor)(unsafe.Pointer(pC3)).FaRow == uintptr(0)) {
  92401 		goto __395
  92402 	}
  92403 	libc.Xmemset(tls, bp+232, 0, uint64(unsafe.Sizeof(Mem{})))
  92404 	rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, *(*uintptr)(unsafe.Pointer(pC3 + 48)), *(*U32)(unsafe.Pointer(aOffset)), bp+232)
  92405 	if !(rc != SQLITE_OK) {
  92406 		goto __397
  92407 	}
  92408 	goto abort_due_to_error
  92409 __397:
  92410 	;
  92411 	zData = (*Mem)(unsafe.Pointer(bp + 232)).Fz
  92412 	goto __396
  92413 __395:
  92414 	zData = (*VdbeCursor)(unsafe.Pointer(pC3)).FaRow
  92415 __396:
  92416 	;
  92417 op_column_read_header:
  92418 	i1 = int32((*VdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed)
  92419 	offset64 = U64(*(*U32)(unsafe.Pointer(aOffset + uintptr(i1)*4)))
  92420 	zHdr = zData + uintptr((*VdbeCursor)(unsafe.Pointer(pC3)).FiHdrOffset)
  92421 	zEndHdr = zData + uintptr(*(*U32)(unsafe.Pointer(aOffset)))
  92422 
  92423 __398:
  92424 	if !(libc.AssignPtrUint32(pC3+112+uintptr(i1)*4, libc.AssignPtrUint32(bp+288, U32(*(*U8)(unsafe.Pointer(zHdr))))) < U32(0x80)) {
  92425 		goto __401
  92426 	}
  92427 	zHdr++
  92428 	offset64 = offset64 + U64(Xsqlite3VdbeOneByteSerialTypeLen(tls, uint8(*(*U32)(unsafe.Pointer(bp + 288)))))
  92429 	goto __402
  92430 __401:
  92431 	zHdr += uintptr(Xsqlite3GetVarint32(tls, zHdr, bp+288))
  92432 	*(*U32)(unsafe.Pointer(pC3 + 112 + uintptr(i1)*4)) = *(*U32)(unsafe.Pointer(bp + 288))
  92433 	offset64 = offset64 + U64(Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp + 288))))
  92434 __402:
  92435 	;
  92436 	*(*U32)(unsafe.Pointer(aOffset + uintptr(libc.PreIncInt32(&i1, 1))*4)) = U32(offset64 & uint64(0xffffffff))
  92437 	goto __399
  92438 __399:
  92439 	if U32(i1) <= p22 && zHdr < zEndHdr {
  92440 		goto __398
  92441 	}
  92442 	goto __400
  92443 __400:
  92444 	;
  92445 	if !(zHdr >= zEndHdr && (zHdr > zEndHdr || offset64 != U64((*VdbeCursor)(unsafe.Pointer(pC3)).FpayloadSize)) ||
  92446 		offset64 > U64((*VdbeCursor)(unsafe.Pointer(pC3)).FpayloadSize)) {
  92447 		goto __403
  92448 	}
  92449 	if !(*(*U32)(unsafe.Pointer(aOffset)) == U32(0)) {
  92450 		goto __404
  92451 	}
  92452 	i1 = 0
  92453 	zHdr = zEndHdr
  92454 	goto __405
  92455 __404:
  92456 	if !((*VdbeCursor)(unsafe.Pointer(pC3)).FaRow == uintptr(0)) {
  92457 		goto __406
  92458 	}
  92459 	Xsqlite3VdbeMemRelease(tls, bp+232)
  92460 __406:
  92461 	;
  92462 	goto op_column_corrupt
  92463 __405:
  92464 	;
  92465 __403:
  92466 	;
  92467 	(*VdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed = U16(i1)
  92468 	(*VdbeCursor)(unsafe.Pointer(pC3)).FiHdrOffset = U32((int64(zHdr) - int64(zData)) / 1)
  92469 	if !((*VdbeCursor)(unsafe.Pointer(pC3)).FaRow == uintptr(0)) {
  92470 		goto __407
  92471 	}
  92472 	Xsqlite3VdbeMemRelease(tls, bp+232)
  92473 __407:
  92474 	;
  92475 	goto __394
  92476 __393:
  92477 	*(*U32)(unsafe.Pointer(bp + 288)) = U32(0)
  92478 __394:
  92479 	;
  92480 	if !(U32((*VdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed) <= p22) {
  92481 		goto __408
  92482 	}
  92483 	pDest = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  92484 
  92485 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == -10) {
  92486 		goto __409
  92487 	}
  92488 	Xsqlite3VdbeMemShallowCopy(tls, pDest, *(*uintptr)(unsafe.Pointer(pOp + 16)), MEM_Static)
  92489 	goto __410
  92490 __409:
  92491 	Xsqlite3VdbeMemSetNull(tls, pDest)
  92492 __410:
  92493 	;
  92494 	goto op_column_out
  92495 __408:
  92496 	;
  92497 	goto __392
  92498 __391:
  92499 	*(*U32)(unsafe.Pointer(bp + 288)) = *(*U32)(unsafe.Pointer(pC3 + 112 + uintptr(p22)*4))
  92500 __392:
  92501 	;
  92502 	pDest = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  92503 
  92504 	if !(int32((*Mem)(unsafe.Pointer(pDest)).Fflags)&(MEM_Agg|MEM_Dyn) != 0) {
  92505 		goto __411
  92506 	}
  92507 	Xsqlite3VdbeMemSetNull(tls, pDest)
  92508 __411:
  92509 	;
  92510 	if !((*VdbeCursor)(unsafe.Pointer(pC3)).FszRow >= *(*U32)(unsafe.Pointer(aOffset + uintptr(p22+U32(1))*4))) {
  92511 		goto __412
  92512 	}
  92513 
  92514 	zData = (*VdbeCursor)(unsafe.Pointer(pC3)).FaRow + uintptr(*(*U32)(unsafe.Pointer(aOffset + uintptr(p22)*4)))
  92515 	if !(*(*U32)(unsafe.Pointer(bp + 288)) < U32(12)) {
  92516 		goto __414
  92517 	}
  92518 	Xsqlite3VdbeSerialGet(tls, zData, *(*U32)(unsafe.Pointer(bp + 288)), pDest)
  92519 	goto __415
  92520 __414:
  92521 	(*Mem)(unsafe.Pointer(pDest)).Fn = libc.AssignInt32(&len, int32((*(*U32)(unsafe.Pointer(bp + 288))-U32(12))/U32(2)))
  92522 	(*Mem)(unsafe.Pointer(pDest)).Fenc = encoding
  92523 	if !((*Mem)(unsafe.Pointer(pDest)).FszMalloc < len+2) {
  92524 		goto __416
  92525 	}
  92526 	if !(len > *(*int32)(unsafe.Pointer(db + 136))) {
  92527 		goto __418
  92528 	}
  92529 	goto too_big
  92530 __418:
  92531 	;
  92532 	(*Mem)(unsafe.Pointer(pDest)).Fflags = U16(MEM_Null)
  92533 	if !(Xsqlite3VdbeMemGrow(tls, pDest, len+2, 0) != 0) {
  92534 		goto __419
  92535 	}
  92536 	goto no_mem
  92537 __419:
  92538 	;
  92539 	goto __417
  92540 __416:
  92541 	(*Mem)(unsafe.Pointer(pDest)).Fz = (*Mem)(unsafe.Pointer(pDest)).FzMalloc
  92542 __417:
  92543 	;
  92544 	libc.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pDest)).Fz, zData, uint64(len))
  92545 	*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pDest)).Fz + uintptr(len))) = int8(0)
  92546 	*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pDest)).Fz + uintptr(len+1))) = int8(0)
  92547 	(*Mem)(unsafe.Pointer(pDest)).Fflags = aFlag1[*(*U32)(unsafe.Pointer(bp + 288))&U32(1)]
  92548 __415:
  92549 	;
  92550 	goto __413
  92551 __412:
  92552 	(*Mem)(unsafe.Pointer(pDest)).Fenc = encoding
  92553 
  92554 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&(OPFLAG_LENGTHARG|OPFLAG_TYPEOFARG) != 0 &&
  92555 		(*(*U32)(unsafe.Pointer(bp + 288)) >= U32(12) && *(*U32)(unsafe.Pointer(bp + 288))&U32(1) == U32(0) || int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_TYPEOFARG != 0) ||
  92556 		libc.AssignInt32(&len, int32(Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp + 288))))) == 0) {
  92557 		goto __420
  92558 	}
  92559 
  92560 	Xsqlite3VdbeSerialGet(tls, uintptr(unsafe.Pointer(&Xsqlite3CtypeMap)), *(*U32)(unsafe.Pointer(bp + 288)), pDest)
  92561 	goto __421
  92562 __420:
  92563 	if !(len > *(*int32)(unsafe.Pointer(db + 136))) {
  92564 		goto __422
  92565 	}
  92566 	goto too_big
  92567 __422:
  92568 	;
  92569 	rc = Xsqlite3VdbeMemFromBtree(tls, *(*uintptr)(unsafe.Pointer(pC3 + 48)), *(*U32)(unsafe.Pointer(aOffset + uintptr(p22)*4)), uint32(len), pDest)
  92570 	if !(rc != SQLITE_OK) {
  92571 		goto __423
  92572 	}
  92573 	goto abort_due_to_error
  92574 __423:
  92575 	;
  92576 	Xsqlite3VdbeSerialGet(tls, (*Mem)(unsafe.Pointer(pDest)).Fz, *(*U32)(unsafe.Pointer(bp + 288)), pDest)
  92577 	*(*U16)(unsafe.Pointer(pDest + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Ephem))
  92578 __421:
  92579 	;
  92580 __413:
  92581 	;
  92582 op_column_out:
  92583 	;
  92584 	goto __9
  92585 
  92586 op_column_corrupt:
  92587 	if !((*Op)(unsafe.Pointer(aOp)).Fp3 > 0) {
  92588 		goto __424
  92589 	}
  92590 	pOp = aOp + uintptr((*Op)(unsafe.Pointer(aOp)).Fp3-1)*24
  92591 	goto __9
  92592 	goto __425
  92593 __424:
  92594 	rc = Xsqlite3CorruptError(tls, 93320)
  92595 	goto abort_due_to_error
  92596 __425:
  92597 	;
  92598 __74:
  92599 	;
  92600 	pTab = *(*uintptr)(unsafe.Pointer(pOp + 16))
  92601 
  92602 	aCol = (*Table)(unsafe.Pointer(pTab)).FaCol
  92603 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  92604 	i2 = 0
  92605 __426:
  92606 	if !(i2 < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
  92607 		goto __428
  92608 	}
  92609 	if !(int32((*Column)(unsafe.Pointer(aCol+uintptr(i2)*24)).FcolFlags)&COLFLAG_GENERATED != 0) {
  92610 		goto __429
  92611 	}
  92612 	if !(int32((*Column)(unsafe.Pointer(aCol+uintptr(i2)*24)).FcolFlags)&COLFLAG_VIRTUAL != 0) {
  92613 		goto __430
  92614 	}
  92615 	goto __427
  92616 __430:
  92617 	;
  92618 	if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) {
  92619 		goto __431
  92620 	}
  92621 	pIn1 += 56
  92622 	goto __427
  92623 __431:
  92624 	;
  92625 __429:
  92626 	;
  92627 	applyAffinity(tls, pIn1, (*Column)(unsafe.Pointer(aCol+uintptr(i2)*24)).Faffinity, encoding)
  92628 	if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Null == 0) {
  92629 		goto __432
  92630 	}
  92631 	switch int32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*24 + 8)) & 0xf0 >> 4) {
  92632 	case COLTYPE_BLOB:
  92633 		goto __434
  92634 	case COLTYPE_INTEGER:
  92635 		goto __435
  92636 	case COLTYPE_INT:
  92637 		goto __436
  92638 	case COLTYPE_TEXT:
  92639 		goto __437
  92640 	case COLTYPE_REAL:
  92641 		goto __438
  92642 	default:
  92643 		goto __439
  92644 	}
  92645 	goto __433
  92646 __434:
  92647 	if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Blob == 0) {
  92648 		goto __440
  92649 	}
  92650 	goto vdbe_type_error
  92651 __440:
  92652 	;
  92653 	goto __433
  92654 
  92655 __435:
  92656 __436:
  92657 	if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Int == 0) {
  92658 		goto __441
  92659 	}
  92660 	goto vdbe_type_error
  92661 __441:
  92662 	;
  92663 	goto __433
  92664 
  92665 __437:
  92666 	if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Str == 0) {
  92667 		goto __442
  92668 	}
  92669 	goto vdbe_type_error
  92670 __442:
  92671 	;
  92672 	goto __433
  92673 
  92674 __438:
  92675 	;
  92676 	if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Int != 0) {
  92677 		goto __443
  92678 	}
  92679 
  92680 	if !(*(*I64)(unsafe.Pointer(pIn1)) <= 140737488355327 && *(*I64)(unsafe.Pointer(pIn1)) >= -140737488355328) {
  92681 		goto __445
  92682 	}
  92683 	*(*U16)(unsafe.Pointer(pIn1 + 20)) |= U16(MEM_IntReal)
  92684 	*(*U16)(unsafe.Pointer(pIn1 + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Int))
  92685 	goto __446
  92686 __445:
  92687 	*(*float64)(unsafe.Pointer(pIn1)) = float64(*(*I64)(unsafe.Pointer(pIn1)))
  92688 	*(*U16)(unsafe.Pointer(pIn1 + 20)) |= U16(MEM_Real)
  92689 	*(*U16)(unsafe.Pointer(pIn1 + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Int))
  92690 __446:
  92691 	;
  92692 	goto __444
  92693 __443:
  92694 	if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&(MEM_Real|MEM_IntReal) == 0) {
  92695 		goto __447
  92696 	}
  92697 	goto vdbe_type_error
  92698 __447:
  92699 	;
  92700 __444:
  92701 	;
  92702 	goto __433
  92703 
  92704 __439:
  92705 	goto __433
  92706 
  92707 __433:
  92708 	;
  92709 __432:
  92710 	;
  92711 	pIn1 += 56
  92712 	goto __427
  92713 __427:
  92714 	i2++
  92715 	goto __426
  92716 	goto __428
  92717 __428:
  92718 	;
  92719 	goto __9
  92720 
  92721 vdbe_type_error:
  92722 	Xsqlite3VdbeError(tls, p, ts+6835,
  92723 		libc.VaList(bp+56, vdbeMemTypeName(tls, pIn1), Xsqlite3StdType[(int32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*24 + 8))&0xf0>>4)-1)&0xf<<28>>28],
  92724 			(*Table)(unsafe.Pointer(pTab)).FzName, (*Column)(unsafe.Pointer(aCol+uintptr(i2)*24)).FzCnName))
  92725 	rc = SQLITE_CONSTRAINT | int32(12)<<8
  92726 	goto abort_due_to_error
  92727 
  92728 __75:
  92729 	zAffinity = *(*uintptr)(unsafe.Pointer(pOp + 16))
  92730 
  92731 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  92732 __448:
  92733 	if !(1 != 0) {
  92734 		goto __449
  92735 	}
  92736 
  92737 	applyAffinity(tls, pIn1, *(*int8)(unsafe.Pointer(zAffinity)), encoding)
  92738 	if !(int32(*(*int8)(unsafe.Pointer(zAffinity))) == SQLITE_AFF_REAL && int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Int != 0) {
  92739 		goto __450
  92740 	}
  92741 
  92742 	if !(*(*I64)(unsafe.Pointer(pIn1)) <= 140737488355327 && *(*I64)(unsafe.Pointer(pIn1)) >= -140737488355328) {
  92743 		goto __451
  92744 	}
  92745 	*(*U16)(unsafe.Pointer(pIn1 + 20)) |= U16(MEM_IntReal)
  92746 	*(*U16)(unsafe.Pointer(pIn1 + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Int))
  92747 	goto __452
  92748 __451:
  92749 	*(*float64)(unsafe.Pointer(pIn1)) = float64(*(*I64)(unsafe.Pointer(pIn1)))
  92750 	*(*U16)(unsafe.Pointer(pIn1 + 20)) |= U16(MEM_Real)
  92751 	*(*U16)(unsafe.Pointer(pIn1 + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Int))
  92752 __452:
  92753 	;
  92754 __450:
  92755 	;
  92756 	zAffinity++
  92757 	if !(int32(*(*int8)(unsafe.Pointer(zAffinity))) == 0) {
  92758 		goto __453
  92759 	}
  92760 	goto __449
  92761 __453:
  92762 	;
  92763 	pIn1 += 56
  92764 	goto __448
  92765 __449:
  92766 	;
  92767 	goto __9
  92768 
  92769 __76:
  92770 	nData = uint64(0)
  92771 	nHdr = 0
  92772 	nZero = int64(0)
  92773 	nField = (*Op)(unsafe.Pointer(pOp)).Fp1
  92774 	zAffinity1 = *(*uintptr)(unsafe.Pointer(pOp + 16))
  92775 
  92776 	pData0 = aMem + uintptr(nField)*56
  92777 	nField = (*Op)(unsafe.Pointer(pOp)).Fp2
  92778 	pLast = pData0 + uintptr(nField-1)*56
  92779 
  92780 	pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  92781 
  92782 	if !(zAffinity1 != 0) {
  92783 		goto __454
  92784 	}
  92785 	pRec = pData0
  92786 __455:
  92787 	applyAffinity(tls, pRec, *(*int8)(unsafe.Pointer(zAffinity1)), encoding)
  92788 	if !(int32(*(*int8)(unsafe.Pointer(zAffinity1))) == SQLITE_AFF_REAL && int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&MEM_Int != 0) {
  92789 		goto __458
  92790 	}
  92791 	*(*U16)(unsafe.Pointer(pRec + 20)) |= U16(MEM_IntReal)
  92792 	*(*U16)(unsafe.Pointer(pRec + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Int))
  92793 __458:
  92794 	;
  92795 	zAffinity1++
  92796 	pRec += 56
  92797 
  92798 	goto __456
  92799 __456:
  92800 	if *(*int8)(unsafe.Pointer(zAffinity1)) != 0 {
  92801 		goto __455
  92802 	}
  92803 	goto __457
  92804 __457:
  92805 	;
  92806 __454:
  92807 	;
  92808 	pRec = pLast
  92809 __459:
  92810 	;
  92811 	if !(int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&MEM_Null != 0) {
  92812 		goto __462
  92813 	}
  92814 	if !(int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&MEM_Zero != 0) {
  92815 		goto __464
  92816 	}
  92817 
  92818 	(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(10)
  92819 	goto __465
  92820 __464:
  92821 	(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(0)
  92822 __465:
  92823 	;
  92824 	nHdr++
  92825 	goto __463
  92826 __462:
  92827 	if !(int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&(MEM_Int|MEM_IntReal) != 0) {
  92828 		goto __466
  92829 	}
  92830 
  92831 	i3 = *(*I64)(unsafe.Pointer(pRec))
  92832 
  92833 	if !(i3 < int64(0)) {
  92834 		goto __468
  92835 	}
  92836 	uu = U64(^i3)
  92837 	goto __469
  92838 __468:
  92839 	uu = U64(i3)
  92840 __469:
  92841 	;
  92842 	nHdr++
  92843 
  92844 	if !(uu <= uint64(127)) {
  92845 		goto __470
  92846 	}
  92847 	if !(i3&int64(1) == i3 && int32((*Vdbe)(unsafe.Pointer(p)).FminWriteFileFormat) >= 4) {
  92848 		goto __472
  92849 	}
  92850 	(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(8) + U32(uu)
  92851 	goto __473
  92852 __472:
  92853 	nData++
  92854 	(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(1)
  92855 __473:
  92856 	;
  92857 	goto __471
  92858 __470:
  92859 	if !(uu <= uint64(32767)) {
  92860 		goto __474
  92861 	}
  92862 	nData = nData + uint64(2)
  92863 	(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(2)
  92864 	goto __475
  92865 __474:
  92866 	if !(uu <= uint64(8388607)) {
  92867 		goto __476
  92868 	}
  92869 	nData = nData + uint64(3)
  92870 	(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(3)
  92871 	goto __477
  92872 __476:
  92873 	if !(uu <= uint64(2147483647)) {
  92874 		goto __478
  92875 	}
  92876 	nData = nData + uint64(4)
  92877 	(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(4)
  92878 	goto __479
  92879 __478:
  92880 	if !(uu <= uint64(140737488355327)) {
  92881 		goto __480
  92882 	}
  92883 	nData = nData + uint64(6)
  92884 	(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(5)
  92885 	goto __481
  92886 __480:
  92887 	nData = nData + uint64(8)
  92888 	if !(int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&MEM_IntReal != 0) {
  92889 		goto __482
  92890 	}
  92891 
  92892 	*(*float64)(unsafe.Pointer(pRec)) = float64(*(*I64)(unsafe.Pointer(pRec)))
  92893 	*(*U16)(unsafe.Pointer(pRec + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_IntReal))
  92894 	*(*U16)(unsafe.Pointer(pRec + 20)) |= U16(MEM_Real)
  92895 	(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(7)
  92896 	goto __483
  92897 __482:
  92898 	(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(6)
  92899 __483:
  92900 	;
  92901 __481:
  92902 	;
  92903 __479:
  92904 	;
  92905 __477:
  92906 	;
  92907 __475:
  92908 	;
  92909 __471:
  92910 	;
  92911 	goto __467
  92912 __466:
  92913 	if !(int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&MEM_Real != 0) {
  92914 		goto __484
  92915 	}
  92916 	nHdr++
  92917 	nData = nData + uint64(8)
  92918 	(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(7)
  92919 	goto __485
  92920 __484:
  92921 	;
  92922 	len1 = U32((*Mem)(unsafe.Pointer(pRec)).Fn)
  92923 	serial_type = len1*U32(2) + U32(12) + U32(libc.Bool32(int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&MEM_Str != 0))
  92924 	if !(int32((*Mem)(unsafe.Pointer(pRec)).Fflags)&MEM_Zero != 0) {
  92925 		goto __486
  92926 	}
  92927 	serial_type = serial_type + U32(*(*int32)(unsafe.Pointer(pRec))*2)
  92928 	if !(nData != 0) {
  92929 		goto __487
  92930 	}
  92931 	if !(Xsqlite3VdbeMemExpandBlob(tls, pRec) != 0) {
  92932 		goto __489
  92933 	}
  92934 	goto no_mem
  92935 __489:
  92936 	;
  92937 	len1 = len1 + U32(*(*int32)(unsafe.Pointer(pRec)))
  92938 	goto __488
  92939 __487:
  92940 	nZero = nZero + I64(*(*int32)(unsafe.Pointer(pRec)))
  92941 __488:
  92942 	;
  92943 __486:
  92944 	;
  92945 	nData = nData + U64(len1)
  92946 	nHdr = nHdr + Xsqlite3VarintLen(tls, uint64(serial_type))
  92947 	(*Mem)(unsafe.Pointer(pRec)).FuTemp = serial_type
  92948 __485:
  92949 	;
  92950 __467:
  92951 	;
  92952 __463:
  92953 	;
  92954 	if !(pRec == pData0) {
  92955 		goto __490
  92956 	}
  92957 	goto __461
  92958 __490:
  92959 	;
  92960 	pRec -= 56
  92961 	goto __460
  92962 __460:
  92963 	if 1 != 0 {
  92964 		goto __459
  92965 	}
  92966 	goto __461
  92967 __461:
  92968 	;
  92969 	if !(nHdr <= 126) {
  92970 		goto __491
  92971 	}
  92972 
  92973 	nHdr = nHdr + 1
  92974 	goto __492
  92975 __491:
  92976 	nVarint = Xsqlite3VarintLen(tls, uint64(nHdr))
  92977 	nHdr = nHdr + nVarint
  92978 	if !(nVarint < Xsqlite3VarintLen(tls, uint64(nHdr))) {
  92979 		goto __493
  92980 	}
  92981 	nHdr++
  92982 __493:
  92983 	;
  92984 __492:
  92985 	;
  92986 	nByte1 = I64(U64(nHdr) + nData)
  92987 
  92988 	if !(nByte1+nZero <= I64((*Mem)(unsafe.Pointer(pOut)).FszMalloc)) {
  92989 		goto __494
  92990 	}
  92991 
  92992 	(*Mem)(unsafe.Pointer(pOut)).Fz = (*Mem)(unsafe.Pointer(pOut)).FzMalloc
  92993 	goto __495
  92994 __494:
  92995 	if !(nByte1+nZero > I64(*(*int32)(unsafe.Pointer(db + 136)))) {
  92996 		goto __496
  92997 	}
  92998 	goto too_big
  92999 __496:
  93000 	;
  93001 	if !(Xsqlite3VdbeMemClearAndResize(tls, pOut, int32(nByte1)) != 0) {
  93002 		goto __497
  93003 	}
  93004 	goto no_mem
  93005 __497:
  93006 	;
  93007 __495:
  93008 	;
  93009 	(*Mem)(unsafe.Pointer(pOut)).Fn = int32(nByte1)
  93010 	(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Blob)
  93011 	if !(nZero != 0) {
  93012 		goto __498
  93013 	}
  93014 	*(*int32)(unsafe.Pointer(pOut)) = int32(nZero)
  93015 	*(*U16)(unsafe.Pointer(pOut + 20)) |= U16(MEM_Zero)
  93016 __498:
  93017 	;
  93018 	zHdr1 = (*Mem)(unsafe.Pointer(pOut)).Fz
  93019 	zPayload = zHdr1 + uintptr(nHdr)
  93020 
  93021 	if !(nHdr < 0x80) {
  93022 		goto __499
  93023 	}
  93024 	*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&zHdr1, 1))) = U8(nHdr)
  93025 	goto __500
  93026 __499:
  93027 	zHdr1 += uintptr(Xsqlite3PutVarint(tls, zHdr1, uint64(nHdr)))
  93028 __500:
  93029 	;
  93030 	pRec = pData0
  93031 __501:
  93032 	if !(1 != 0) {
  93033 		goto __502
  93034 	}
  93035 	serial_type = (*Mem)(unsafe.Pointer(pRec)).FuTemp
  93036 
  93037 	if !(serial_type <= U32(7)) {
  93038 		goto __503
  93039 	}
  93040 	*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&zHdr1, 1))) = U8(serial_type)
  93041 	if !(serial_type == U32(0)) {
  93042 		goto __505
  93043 	}
  93044 
  93045 	goto __506
  93046 __505:
  93047 	if !(serial_type == U32(7)) {
  93048 		goto __507
  93049 	}
  93050 
  93051 	libc.Xmemcpy(tls, bp+296, pRec, uint64(unsafe.Sizeof(U64(0))))
  93052 
  93053 	goto __508
  93054 __507:
  93055 	*(*U64)(unsafe.Pointer(bp + 296)) = U64(*(*I64)(unsafe.Pointer(pRec)))
  93056 __508:
  93057 	;
  93058 	len1 = libc.AssignUint32(&i4, U32(Xsqlite3SmallTypeSizes[serial_type]))
  93059 
  93060 __509:
  93061 	if !(1 != 0) {
  93062 		goto __510
  93063 	}
  93064 	*(*U8)(unsafe.Pointer(zPayload + uintptr(libc.PreDecUint32(&i4, 1)))) = U8(*(*U64)(unsafe.Pointer(bp + 296)) & uint64(0xFF))
  93065 	if !(i4 == U32(0)) {
  93066 		goto __511
  93067 	}
  93068 	goto __510
  93069 __511:
  93070 	;
  93071 	*(*U64)(unsafe.Pointer(bp + 296)) >>= 8
  93072 	goto __509
  93073 __510:
  93074 	;
  93075 	zPayload += uintptr(len1)
  93076 __506:
  93077 	;
  93078 	goto __504
  93079 __503:
  93080 	if !(serial_type < U32(0x80)) {
  93081 		goto __512
  93082 	}
  93083 	*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&zHdr1, 1))) = U8(serial_type)
  93084 	if !(serial_type >= U32(14) && (*Mem)(unsafe.Pointer(pRec)).Fn > 0) {
  93085 		goto __514
  93086 	}
  93087 
  93088 	libc.Xmemcpy(tls, zPayload, (*Mem)(unsafe.Pointer(pRec)).Fz, uint64((*Mem)(unsafe.Pointer(pRec)).Fn))
  93089 	zPayload += uintptr((*Mem)(unsafe.Pointer(pRec)).Fn)
  93090 __514:
  93091 	;
  93092 	goto __513
  93093 __512:
  93094 	zHdr1 += uintptr(Xsqlite3PutVarint(tls, zHdr1, uint64(serial_type)))
  93095 	if !((*Mem)(unsafe.Pointer(pRec)).Fn != 0) {
  93096 		goto __515
  93097 	}
  93098 
  93099 	libc.Xmemcpy(tls, zPayload, (*Mem)(unsafe.Pointer(pRec)).Fz, uint64((*Mem)(unsafe.Pointer(pRec)).Fn))
  93100 	zPayload += uintptr((*Mem)(unsafe.Pointer(pRec)).Fn)
  93101 __515:
  93102 	;
  93103 __513:
  93104 	;
  93105 __504:
  93106 	;
  93107 	if !(pRec == pLast) {
  93108 		goto __516
  93109 	}
  93110 	goto __502
  93111 __516:
  93112 	;
  93113 	pRec += 56
  93114 	goto __501
  93115 __502:
  93116 	;
  93117 	goto __9
  93118 
  93119 __77:
  93120 	;
  93121 	pCrsr1 = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + 48))
  93122 
  93123 	if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) {
  93124 		goto __517
  93125 	}
  93126 	*(*I64)(unsafe.Pointer(bp + 304)) = Xsqlite3BtreeRowCountEst(tls, pCrsr1)
  93127 	goto __518
  93128 __517:
  93129 	*(*I64)(unsafe.Pointer(bp + 304)) = int64(0)
  93130 	rc = Xsqlite3BtreeCount(tls, db, pCrsr1, bp+304)
  93131 	if !(rc != 0) {
  93132 		goto __519
  93133 	}
  93134 	goto abort_due_to_error
  93135 __519:
  93136 	;
  93137 __518:
  93138 	;
  93139 	pOut = out2Prerelease(tls, p, pOp)
  93140 	*(*I64)(unsafe.Pointer(pOut)) = *(*I64)(unsafe.Pointer(bp + 304))
  93141 	goto check_for_interrupt
  93142 
  93143 __78:
  93144 	p12 = (*Op)(unsafe.Pointer(pOp)).Fp1
  93145 	zName = *(*uintptr)(unsafe.Pointer(pOp + 16))
  93146 
  93147 	if !(p12 == SAVEPOINT_BEGIN) {
  93148 		goto __520
  93149 	}
  93150 	if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite > 0) {
  93151 		goto __522
  93152 	}
  93153 
  93154 	Xsqlite3VdbeError(tls, p, ts+6876, 0)
  93155 	rc = SQLITE_BUSY
  93156 	goto __523
  93157 __522:
  93158 	nName = Xsqlite3Strlen30(tls, zName)
  93159 
  93160 	rc = Xsqlite3VtabSavepoint(tls, db, SAVEPOINT_BEGIN,
  93161 		(*Sqlite3)(unsafe.Pointer(db)).FnStatement+(*Sqlite3)(unsafe.Pointer(db)).FnSavepoint)
  93162 	if !(rc != SQLITE_OK) {
  93163 		goto __524
  93164 	}
  93165 	goto abort_due_to_error
  93166 __524:
  93167 	;
  93168 	pNew = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(Savepoint{}))+uint64(nName)+uint64(1))
  93169 	if !(pNew != 0) {
  93170 		goto __525
  93171 	}
  93172 	(*Savepoint)(unsafe.Pointer(pNew)).FzName = pNew + 1*32
  93173 	libc.Xmemcpy(tls, (*Savepoint)(unsafe.Pointer(pNew)).FzName, zName, uint64(nName+1))
  93174 
  93175 	if !((*Sqlite3)(unsafe.Pointer(db)).FautoCommit != 0) {
  93176 		goto __526
  93177 	}
  93178 	(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(0)
  93179 	(*Sqlite3)(unsafe.Pointer(db)).FisTransactionSavepoint = U8(1)
  93180 	goto __527
  93181 __526:
  93182 	(*Sqlite3)(unsafe.Pointer(db)).FnSavepoint++
  93183 __527:
  93184 	;
  93185 	(*Savepoint)(unsafe.Pointer(pNew)).FpNext = (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint
  93186 	(*Sqlite3)(unsafe.Pointer(db)).FpSavepoint = pNew
  93187 	(*Savepoint)(unsafe.Pointer(pNew)).FnDeferredCons = (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons
  93188 	(*Savepoint)(unsafe.Pointer(pNew)).FnDeferredImmCons = (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons
  93189 __525:
  93190 	;
  93191 __523:
  93192 	;
  93193 	goto __521
  93194 __520:
  93195 	;
  93196 	iSavepoint = 0
  93197 
  93198 	pSavepoint = (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint
  93199 __528:
  93200 	if !(pSavepoint != 0 && Xsqlite3StrICmp(tls, (*Savepoint)(unsafe.Pointer(pSavepoint)).FzName, zName) != 0) {
  93201 		goto __530
  93202 	}
  93203 	iSavepoint++
  93204 	goto __529
  93205 __529:
  93206 	pSavepoint = (*Savepoint)(unsafe.Pointer(pSavepoint)).FpNext
  93207 	goto __528
  93208 	goto __530
  93209 __530:
  93210 	;
  93211 	if !!(pSavepoint != 0) {
  93212 		goto __531
  93213 	}
  93214 	Xsqlite3VdbeError(tls, p, ts+6927, libc.VaList(bp+88, zName))
  93215 	rc = SQLITE_ERROR
  93216 	goto __532
  93217 __531:
  93218 	if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite > 0 && p12 == SAVEPOINT_RELEASE) {
  93219 		goto __533
  93220 	}
  93221 
  93222 	Xsqlite3VdbeError(tls, p,
  93223 		ts+6949, 0)
  93224 	rc = SQLITE_BUSY
  93225 	goto __534
  93226 __533:
  93227 	isTransaction = libc.Bool32((*Savepoint)(unsafe.Pointer(pSavepoint)).FpNext == uintptr(0) && (*Sqlite3)(unsafe.Pointer(db)).FisTransactionSavepoint != 0)
  93228 	if !(isTransaction != 0 && p12 == SAVEPOINT_RELEASE) {
  93229 		goto __535
  93230 	}
  93231 	if !(libc.AssignInt32(&rc, Xsqlite3VdbeCheckFk(tls, p, 1)) != SQLITE_OK) {
  93232 		goto __537
  93233 	}
  93234 	goto vdbe_return
  93235 __537:
  93236 	;
  93237 	(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1)
  93238 	if !(Xsqlite3VdbeHalt(tls, p) == SQLITE_BUSY) {
  93239 		goto __538
  93240 	}
  93241 	(*Vdbe)(unsafe.Pointer(p)).Fpc = int32((int64(pOp) - int64(aOp)) / 24)
  93242 	(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(0)
  93243 	(*Vdbe)(unsafe.Pointer(p)).Frc = libc.AssignInt32(&rc, SQLITE_BUSY)
  93244 	goto vdbe_return
  93245 __538:
  93246 	;
  93247 	rc = (*Vdbe)(unsafe.Pointer(p)).Frc
  93248 	if !(rc != 0) {
  93249 		goto __539
  93250 	}
  93251 	(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(0)
  93252 	goto __540
  93253 __539:
  93254 	(*Sqlite3)(unsafe.Pointer(db)).FisTransactionSavepoint = U8(0)
  93255 __540:
  93256 	;
  93257 	goto __536
  93258 __535:
  93259 	iSavepoint = (*Sqlite3)(unsafe.Pointer(db)).FnSavepoint - iSavepoint - 1
  93260 	if !(p12 == SAVEPOINT_ROLLBACK) {
  93261 		goto __541
  93262 	}
  93263 	isSchemaChange = libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_SchemaChange) != U32(0))
  93264 	ii = 0
  93265 __543:
  93266 	if !(ii < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
  93267 		goto __545
  93268 	}
  93269 	rc = Xsqlite3BtreeTripAllCursors(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii)*32)).FpBt,
  93270 		SQLITE_ABORT|int32(2)<<8,
  93271 		libc.Bool32(isSchemaChange == 0))
  93272 	if !(rc != SQLITE_OK) {
  93273 		goto __546
  93274 	}
  93275 	goto abort_due_to_error
  93276 __546:
  93277 	;
  93278 	goto __544
  93279 __544:
  93280 	ii++
  93281 	goto __543
  93282 	goto __545
  93283 __545:
  93284 	;
  93285 	goto __542
  93286 __541:
  93287 	;
  93288 	isSchemaChange = 0
  93289 __542:
  93290 	;
  93291 	ii = 0
  93292 __547:
  93293 	if !(ii < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
  93294 		goto __549
  93295 	}
  93296 	rc = Xsqlite3BtreeSavepoint(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii)*32)).FpBt, p12, iSavepoint)
  93297 	if !(rc != SQLITE_OK) {
  93298 		goto __550
  93299 	}
  93300 	goto abort_due_to_error
  93301 __550:
  93302 	;
  93303 	goto __548
  93304 __548:
  93305 	ii++
  93306 	goto __547
  93307 	goto __549
  93308 __549:
  93309 	;
  93310 	if !(isSchemaChange != 0) {
  93311 		goto __551
  93312 	}
  93313 	Xsqlite3ExpirePreparedStatements(tls, db, 0)
  93314 	Xsqlite3ResetAllSchemasOfConnection(tls, db)
  93315 	*(*U32)(unsafe.Pointer(db + 44)) |= U32(DBFLAG_SchemaChange)
  93316 __551:
  93317 	;
  93318 __536:
  93319 	;
  93320 	if !(rc != 0) {
  93321 		goto __552
  93322 	}
  93323 	goto abort_due_to_error
  93324 __552:
  93325 	;
  93326 __553:
  93327 	if !((*Sqlite3)(unsafe.Pointer(db)).FpSavepoint != pSavepoint) {
  93328 		goto __554
  93329 	}
  93330 	pTmp = (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint
  93331 	(*Sqlite3)(unsafe.Pointer(db)).FpSavepoint = (*Savepoint)(unsafe.Pointer(pTmp)).FpNext
  93332 	Xsqlite3DbFree(tls, db, pTmp)
  93333 	(*Sqlite3)(unsafe.Pointer(db)).FnSavepoint--
  93334 	goto __553
  93335 __554:
  93336 	;
  93337 	if !(p12 == SAVEPOINT_RELEASE) {
  93338 		goto __555
  93339 	}
  93340 
  93341 	(*Sqlite3)(unsafe.Pointer(db)).FpSavepoint = (*Savepoint)(unsafe.Pointer(pSavepoint)).FpNext
  93342 	Xsqlite3DbFree(tls, db, pSavepoint)
  93343 	if !!(isTransaction != 0) {
  93344 		goto __557
  93345 	}
  93346 	(*Sqlite3)(unsafe.Pointer(db)).FnSavepoint--
  93347 __557:
  93348 	;
  93349 	goto __556
  93350 __555:
  93351 	;
  93352 	(*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons = (*Savepoint)(unsafe.Pointer(pSavepoint)).FnDeferredCons
  93353 	(*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = (*Savepoint)(unsafe.Pointer(pSavepoint)).FnDeferredImmCons
  93354 __556:
  93355 	;
  93356 	if !(!(isTransaction != 0) || p12 == SAVEPOINT_ROLLBACK) {
  93357 		goto __558
  93358 	}
  93359 	rc = Xsqlite3VtabSavepoint(tls, db, p12, iSavepoint)
  93360 	if !(rc != SQLITE_OK) {
  93361 		goto __559
  93362 	}
  93363 	goto abort_due_to_error
  93364 __559:
  93365 	;
  93366 __558:
  93367 	;
  93368 __534:
  93369 	;
  93370 __532:
  93371 	;
  93372 __521:
  93373 	;
  93374 	if !(rc != 0) {
  93375 		goto __560
  93376 	}
  93377 	goto abort_due_to_error
  93378 __560:
  93379 	;
  93380 	if !(int32((*Vdbe)(unsafe.Pointer(p)).FeVdbeState) == VDBE_HALT_STATE) {
  93381 		goto __561
  93382 	}
  93383 	rc = SQLITE_DONE
  93384 	goto vdbe_return
  93385 __561:
  93386 	;
  93387 	goto __9
  93388 
  93389 __79:
  93390 	desiredAutoCommit = (*Op)(unsafe.Pointer(pOp)).Fp1
  93391 	iRollback = (*Op)(unsafe.Pointer(pOp)).Fp2
  93392 
  93393 	if !(desiredAutoCommit != int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit)) {
  93394 		goto __562
  93395 	}
  93396 	if !(iRollback != 0) {
  93397 		goto __564
  93398 	}
  93399 
  93400 	Xsqlite3RollbackAll(tls, db, SQLITE_ABORT|int32(2)<<8)
  93401 	(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1)
  93402 	goto __565
  93403 __564:
  93404 	if !(desiredAutoCommit != 0 && (*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite > 0) {
  93405 		goto __566
  93406 	}
  93407 
  93408 	Xsqlite3VdbeError(tls, p,
  93409 		ts+7003, 0)
  93410 	rc = SQLITE_BUSY
  93411 	goto abort_due_to_error
  93412 	goto __567
  93413 __566:
  93414 	if !(libc.AssignInt32(&rc, Xsqlite3VdbeCheckFk(tls, p, 1)) != SQLITE_OK) {
  93415 		goto __568
  93416 	}
  93417 	goto vdbe_return
  93418 	goto __569
  93419 __568:
  93420 	(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(desiredAutoCommit)
  93421 __569:
  93422 	;
  93423 __567:
  93424 	;
  93425 __565:
  93426 	;
  93427 	if !(Xsqlite3VdbeHalt(tls, p) == SQLITE_BUSY) {
  93428 		goto __570
  93429 	}
  93430 	(*Vdbe)(unsafe.Pointer(p)).Fpc = int32((int64(pOp) - int64(aOp)) / 24)
  93431 	(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1 - desiredAutoCommit)
  93432 	(*Vdbe)(unsafe.Pointer(p)).Frc = libc.AssignInt32(&rc, SQLITE_BUSY)
  93433 	goto vdbe_return
  93434 __570:
  93435 	;
  93436 	Xsqlite3CloseSavepoints(tls, db)
  93437 	if !((*Vdbe)(unsafe.Pointer(p)).Frc == SQLITE_OK) {
  93438 		goto __571
  93439 	}
  93440 	rc = SQLITE_DONE
  93441 	goto __572
  93442 __571:
  93443 	rc = SQLITE_ERROR
  93444 __572:
  93445 	;
  93446 	goto vdbe_return
  93447 	goto __563
  93448 __562:
  93449 	Xsqlite3VdbeError(tls, p,
  93450 		func() uintptr {
  93451 			if !(desiredAutoCommit != 0) {
  93452 				return ts + 7058
  93453 			}
  93454 			return func() uintptr {
  93455 				if iRollback != 0 {
  93456 					return ts + 7106
  93457 				}
  93458 				return ts + 7149
  93459 			}()
  93460 		}(), 0)
  93461 
  93462 	rc = SQLITE_ERROR
  93463 	goto abort_due_to_error
  93464 __563:
  93465 	;
  93466 __80:
  93467 	*(*int32)(unsafe.Pointer(bp + 312)) = 0
  93468 
  93469 	if !((*Op)(unsafe.Pointer(pOp)).Fp2 != 0 && (*Sqlite3)(unsafe.Pointer(db)).Fflags&(uint64(SQLITE_QueryOnly)|uint64(0x00002)<<32) != uint64(0)) {
  93470 		goto __573
  93471 	}
  93472 	if !((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_QueryOnly) != 0) {
  93473 		goto __574
  93474 	}
  93475 
  93476 	rc = SQLITE_READONLY
  93477 	goto __575
  93478 __574:
  93479 	rc = SQLITE_CORRUPT
  93480 __575:
  93481 	;
  93482 	goto abort_due_to_error
  93483 __573:
  93484 	;
  93485 	pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32
  93486 	pBt = (*Db)(unsafe.Pointer(pDb)).FpBt
  93487 
  93488 	if !(pBt != 0) {
  93489 		goto __576
  93490 	}
  93491 	rc = Xsqlite3BtreeBeginTrans(tls, pBt, (*Op)(unsafe.Pointer(pOp)).Fp2, bp+312)
  93492 
  93493 	if !(rc != SQLITE_OK) {
  93494 		goto __577
  93495 	}
  93496 	if !(rc&0xff == SQLITE_BUSY) {
  93497 		goto __578
  93498 	}
  93499 	(*Vdbe)(unsafe.Pointer(p)).Fpc = int32((int64(pOp) - int64(aOp)) / 24)
  93500 	(*Vdbe)(unsafe.Pointer(p)).Frc = rc
  93501 	goto vdbe_return
  93502 __578:
  93503 	;
  93504 	goto abort_due_to_error
  93505 __577:
  93506 	;
  93507 	if !(Bft(int32(*(*uint8)(unsafe.Pointer(p + 200))&0x20>>5)) != 0 &&
  93508 		(*Op)(unsafe.Pointer(pOp)).Fp2 != 0 &&
  93509 		(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) == 0 || (*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead > 1)) {
  93510 		goto __579
  93511 	}
  93512 
  93513 	if !((*Vdbe)(unsafe.Pointer(p)).FiStatement == 0) {
  93514 		goto __580
  93515 	}
  93516 
  93517 	(*Sqlite3)(unsafe.Pointer(db)).FnStatement++
  93518 	(*Vdbe)(unsafe.Pointer(p)).FiStatement = (*Sqlite3)(unsafe.Pointer(db)).FnSavepoint + (*Sqlite3)(unsafe.Pointer(db)).FnStatement
  93519 __580:
  93520 	;
  93521 	rc = Xsqlite3VtabSavepoint(tls, db, SAVEPOINT_BEGIN, (*Vdbe)(unsafe.Pointer(p)).FiStatement-1)
  93522 	if !(rc == SQLITE_OK) {
  93523 		goto __581
  93524 	}
  93525 	rc = Xsqlite3BtreeBeginStmt(tls, pBt, (*Vdbe)(unsafe.Pointer(p)).FiStatement)
  93526 __581:
  93527 	;
  93528 	(*Vdbe)(unsafe.Pointer(p)).FnStmtDefCons = (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons
  93529 	(*Vdbe)(unsafe.Pointer(p)).FnStmtDefImmCons = (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons
  93530 __579:
  93531 	;
  93532 __576:
  93533 	;
  93534 	if !(rc == SQLITE_OK &&
  93535 		(*Op)(unsafe.Pointer(pOp)).Fp5 != 0 &&
  93536 		(*(*int32)(unsafe.Pointer(bp + 312)) != (*Op)(unsafe.Pointer(pOp)).Fp3 || (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).FiGeneration != *(*int32)(unsafe.Pointer(pOp + 16)))) {
  93537 		goto __582
  93538 	}
  93539 
  93540 	Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg)
  93541 	(*Vdbe)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3DbStrDup(tls, db, ts+7190)
  93542 
  93543 	if !((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpSchema)).Fschema_cookie != *(*int32)(unsafe.Pointer(bp + 312))) {
  93544 		goto __583
  93545 	}
  93546 	Xsqlite3ResetOneSchema(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1)
  93547 __583:
  93548 	;
  93549 	libc.SetBitFieldPtr8Uint32(p+200, Bft(1), 0, 0x3)
  93550 	rc = SQLITE_SCHEMA
  93551 
  93552 	libc.SetBitFieldPtr8Uint32(p+200, Bft(0), 4, 0x10)
  93553 __582:
  93554 	;
  93555 	if !(rc != 0) {
  93556 		goto __584
  93557 	}
  93558 	goto abort_due_to_error
  93559 __584:
  93560 	;
  93561 	goto __9
  93562 
  93563 __81:
  93564 	;
  93565 	iDb = (*Op)(unsafe.Pointer(pOp)).Fp1
  93566 	iCookie = (*Op)(unsafe.Pointer(pOp)).Fp3
  93567 
  93568 	Xsqlite3BtreeGetMeta(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpBt, iCookie, bp+316)
  93569 	pOut = out2Prerelease(tls, p, pOp)
  93570 	*(*I64)(unsafe.Pointer(pOut)) = I64(*(*int32)(unsafe.Pointer(bp + 316)))
  93571 	goto __9
  93572 
  93573 __82:
  93574 	;
  93575 	pDb1 = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32
  93576 
  93577 	rc = Xsqlite3BtreeUpdateMeta(tls, (*Db)(unsafe.Pointer(pDb1)).FpBt, (*Op)(unsafe.Pointer(pOp)).Fp2, uint32((*Op)(unsafe.Pointer(pOp)).Fp3))
  93578 	if !((*Op)(unsafe.Pointer(pOp)).Fp2 == BTREE_SCHEMA_VERSION) {
  93579 		goto __585
  93580 	}
  93581 
  93582 	*(*U32)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb1)).FpSchema)) = *(*U32)(unsafe.Pointer(pOp + 12)) - U32((*Op)(unsafe.Pointer(pOp)).Fp5)
  93583 	*(*U32)(unsafe.Pointer(db + 44)) |= U32(DBFLAG_SchemaChange)
  93584 	Xsqlite3FkClearTriggerCache(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1)
  93585 	goto __586
  93586 __585:
  93587 	if !((*Op)(unsafe.Pointer(pOp)).Fp2 == BTREE_FILE_FORMAT) {
  93588 		goto __587
  93589 	}
  93590 
  93591 	(*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb1)).FpSchema)).Ffile_format = U8((*Op)(unsafe.Pointer(pOp)).Fp3)
  93592 __587:
  93593 	;
  93594 __586:
  93595 	;
  93596 	if !((*Op)(unsafe.Pointer(pOp)).Fp1 == 1) {
  93597 		goto __588
  93598 	}
  93599 
  93600 	Xsqlite3ExpirePreparedStatements(tls, db, 0)
  93601 	libc.SetBitFieldPtr8Uint32(p+200, Bft(0), 0, 0x3)
  93602 __588:
  93603 	;
  93604 	if !(rc != 0) {
  93605 		goto __589
  93606 	}
  93607 	goto abort_due_to_error
  93608 __589:
  93609 	;
  93610 	goto __9
  93611 
  93612 __83:
  93613 	;
  93614 	pCur = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  93615 	if !(pCur != 0 && (*VdbeCursor)(unsafe.Pointer(pCur)).FpgnoRoot == U32((*Op)(unsafe.Pointer(pOp)).Fp2)) {
  93616 		goto __590
  93617 	}
  93618 
  93619 	Xsqlite3BtreeClearCursor(tls, *(*uintptr)(unsafe.Pointer(pCur + 48)))
  93620 	goto open_cursor_set_hints
  93621 __590:
  93622 	;
  93623 __84:
  93624 __85:
  93625 	;
  93626 	if !(int32(*(*uint8)(unsafe.Pointer(p + 200))&0x3>>0) == 1) {
  93627 		goto __591
  93628 	}
  93629 	rc = SQLITE_ABORT | int32(2)<<8
  93630 	goto abort_due_to_error
  93631 __591:
  93632 	;
  93633 	nField1 = 0
  93634 	pKeyInfo1 = uintptr(0)
  93635 	p23 = U32((*Op)(unsafe.Pointer(pOp)).Fp2)
  93636 	iDb1 = (*Op)(unsafe.Pointer(pOp)).Fp3
  93637 
  93638 	pDb2 = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb1)*32
  93639 	pX = (*Db)(unsafe.Pointer(pDb2)).FpBt
  93640 
  93641 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_OpenWrite) {
  93642 		goto __592
  93643 	}
  93644 
  93645 	wrFlag = BTREE_WRCSR | int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_FORDELETE
  93646 
  93647 	if !(int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb2)).FpSchema)).Ffile_format) < int32((*Vdbe)(unsafe.Pointer(p)).FminWriteFileFormat)) {
  93648 		goto __594
  93649 	}
  93650 	(*Vdbe)(unsafe.Pointer(p)).FminWriteFileFormat = (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb2)).FpSchema)).Ffile_format
  93651 __594:
  93652 	;
  93653 	goto __593
  93654 __592:
  93655 	wrFlag = 0
  93656 __593:
  93657 	;
  93658 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_P2ISREG != 0) {
  93659 		goto __595
  93660 	}
  93661 
  93662 	pIn2 = aMem + uintptr(p23)*56
  93663 
  93664 	Xsqlite3VdbeMemIntegerify(tls, pIn2)
  93665 	p23 = U32(int32(*(*I64)(unsafe.Pointer(pIn2))))
  93666 
  93667 __595:
  93668 	;
  93669 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == -8) {
  93670 		goto __596
  93671 	}
  93672 	pKeyInfo1 = *(*uintptr)(unsafe.Pointer(pOp + 16))
  93673 
  93674 	nField1 = int32((*KeyInfo)(unsafe.Pointer(pKeyInfo1)).FnAllField)
  93675 	goto __597
  93676 __596:
  93677 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == -3) {
  93678 		goto __598
  93679 	}
  93680 	nField1 = *(*int32)(unsafe.Pointer(pOp + 16))
  93681 __598:
  93682 	;
  93683 __597:
  93684 	;
  93685 	pCur = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, nField1, uint8(CURTYPE_BTREE))
  93686 	if !(pCur == uintptr(0)) {
  93687 		goto __599
  93688 	}
  93689 	goto no_mem
  93690 __599:
  93691 	;
  93692 	(*VdbeCursor)(unsafe.Pointer(pCur)).FiDb = I8(iDb1)
  93693 	(*VdbeCursor)(unsafe.Pointer(pCur)).FnullRow = U8(1)
  93694 	libc.SetBitFieldPtr8Uint32(pCur+8, Bool(1), 2, 0x4)
  93695 	(*VdbeCursor)(unsafe.Pointer(pCur)).FpgnoRoot = p23
  93696 	rc = Xsqlite3BtreeCursor(tls, pX, p23, wrFlag, pKeyInfo1, *(*uintptr)(unsafe.Pointer(pCur + 48)))
  93697 	(*VdbeCursor)(unsafe.Pointer(pCur)).FpKeyInfo = pKeyInfo1
  93698 
  93699 	(*VdbeCursor)(unsafe.Pointer(pCur)).FisTable = U8(libc.Bool32(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) != -8))
  93700 
  93701 open_cursor_set_hints:
  93702 	;
  93703 	Xsqlite3BtreeCursorHintFlags(tls, *(*uintptr)(unsafe.Pointer(pCur + 48)),
  93704 		uint32(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&(OPFLAG_BULKCSR|OPFLAG_SEEKEQ)))
  93705 	if !(rc != 0) {
  93706 		goto __600
  93707 	}
  93708 	goto abort_due_to_error
  93709 __600:
  93710 	;
  93711 	goto __9
  93712 
  93713 __86:
  93714 	pOrig = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*8))
  93715 
  93716 	pCx = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, int32((*VdbeCursor)(unsafe.Pointer(pOrig)).FnField), uint8(CURTYPE_BTREE))
  93717 	if !(pCx == uintptr(0)) {
  93718 		goto __601
  93719 	}
  93720 	goto no_mem
  93721 __601:
  93722 	;
  93723 	(*VdbeCursor)(unsafe.Pointer(pCx)).FnullRow = U8(1)
  93724 	libc.SetBitFieldPtr8Uint32(pCx+8, Bool(1), 0, 0x1)
  93725 	(*VdbeCursor)(unsafe.Pointer(pCx)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pOrig)).FpKeyInfo
  93726 	(*VdbeCursor)(unsafe.Pointer(pCx)).FisTable = (*VdbeCursor)(unsafe.Pointer(pOrig)).FisTable
  93727 	(*VdbeCursor)(unsafe.Pointer(pCx)).FpgnoRoot = (*VdbeCursor)(unsafe.Pointer(pOrig)).FpgnoRoot
  93728 	libc.SetBitFieldPtr8Uint32(pCx+8, Bool(int32(*(*uint8)(unsafe.Pointer(pOrig + 8))&0x4>>2)), 2, 0x4)
  93729 	*(*uintptr)(unsafe.Pointer(pCx + 16)) = *(*uintptr)(unsafe.Pointer(pOrig + 16))
  93730 	libc.SetBitFieldPtr8Uint32(pCx+8, Bool(1), 3, 0x8)
  93731 	libc.SetBitFieldPtr8Uint32(pOrig+8, Bool(1), 3, 0x8)
  93732 	rc = Xsqlite3BtreeCursor(tls, *(*uintptr)(unsafe.Pointer(pCx + 16)), (*VdbeCursor)(unsafe.Pointer(pCx)).FpgnoRoot, BTREE_WRCSR,
  93733 		(*VdbeCursor)(unsafe.Pointer(pCx)).FpKeyInfo, *(*uintptr)(unsafe.Pointer(pCx + 48)))
  93734 
  93735 	goto __9
  93736 
  93737 __87:
  93738 __88:
  93739 	;
  93740 	if !((*Op)(unsafe.Pointer(pOp)).Fp3 > 0) {
  93741 		goto __602
  93742 	}
  93743 
  93744 	(*Mem)(unsafe.Pointer(aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)).Fn = 0
  93745 	(*Mem)(unsafe.Pointer(aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)).Fz = ts + 1544
  93746 __602:
  93747 	;
  93748 	pCx1 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  93749 	if !(pCx1 != 0 && !(int32(*(*uint8)(unsafe.Pointer(pCx1 + 8))&0x8>>3) != 0) && (*Op)(unsafe.Pointer(pOp)).Fp2 <= int32((*VdbeCursor)(unsafe.Pointer(pCx1)).FnField)) {
  93750 		goto __603
  93751 	}
  93752 
  93753 	(*VdbeCursor)(unsafe.Pointer(pCx1)).FseqCount = int64(0)
  93754 	(*VdbeCursor)(unsafe.Pointer(pCx1)).FcacheStatus = U32(CACHE_STALE)
  93755 	rc = Xsqlite3BtreeClearTable(tls, *(*uintptr)(unsafe.Pointer(pCx1 + 16)), int32((*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot), uintptr(0))
  93756 	goto __604
  93757 __603:
  93758 	pCx1 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, uint8(CURTYPE_BTREE))
  93759 	if !(pCx1 == uintptr(0)) {
  93760 		goto __605
  93761 	}
  93762 	goto no_mem
  93763 __605:
  93764 	;
  93765 	libc.SetBitFieldPtr8Uint32(pCx1+8, Bool(1), 0, 0x1)
  93766 	rc = Xsqlite3BtreeOpen(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, pCx1+16,
  93767 		BTREE_OMIT_JOURNAL|BTREE_SINGLE|int32((*Op)(unsafe.Pointer(pOp)).Fp5),
  93768 		vfsFlags)
  93769 	if !(rc == SQLITE_OK) {
  93770 		goto __606
  93771 	}
  93772 	rc = Xsqlite3BtreeBeginTrans(tls, *(*uintptr)(unsafe.Pointer(pCx1 + 16)), 1, uintptr(0))
  93773 	if !(rc == SQLITE_OK) {
  93774 		goto __607
  93775 	}
  93776 
  93777 	if !(libc.AssignPtrUintptr(pCx1+56, libc.AssignUintptr(&pKeyInfo2, *(*uintptr)(unsafe.Pointer(pOp + 16)))) != uintptr(0)) {
  93778 		goto __608
  93779 	}
  93780 
  93781 	rc = Xsqlite3BtreeCreateTable(tls, *(*uintptr)(unsafe.Pointer(pCx1 + 16)), pCx1+68,
  93782 		BTREE_BLOBKEY|int32((*Op)(unsafe.Pointer(pOp)).Fp5))
  93783 	if !(rc == SQLITE_OK) {
  93784 		goto __610
  93785 	}
  93786 
  93787 	rc = Xsqlite3BtreeCursor(tls, *(*uintptr)(unsafe.Pointer(pCx1 + 16)), (*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot, BTREE_WRCSR,
  93788 		pKeyInfo2, *(*uintptr)(unsafe.Pointer(pCx1 + 48)))
  93789 __610:
  93790 	;
  93791 	(*VdbeCursor)(unsafe.Pointer(pCx1)).FisTable = U8(0)
  93792 	goto __609
  93793 __608:
  93794 	(*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot = Pgno(SCHEMA_ROOT)
  93795 	rc = Xsqlite3BtreeCursor(tls, *(*uintptr)(unsafe.Pointer(pCx1 + 16)), uint32(SCHEMA_ROOT), BTREE_WRCSR,
  93796 		uintptr(0), *(*uintptr)(unsafe.Pointer(pCx1 + 48)))
  93797 	(*VdbeCursor)(unsafe.Pointer(pCx1)).FisTable = U8(1)
  93798 __609:
  93799 	;
  93800 __607:
  93801 	;
  93802 	libc.SetBitFieldPtr8Uint32(pCx1+8, Bool(libc.Bool32(int32((*Op)(unsafe.Pointer(pOp)).Fp5) != BTREE_UNORDERED)), 2, 0x4)
  93803 	if !(rc != 0) {
  93804 		goto __611
  93805 	}
  93806 	Xsqlite3BtreeClose(tls, *(*uintptr)(unsafe.Pointer(pCx1 + 16)))
  93807 __611:
  93808 	;
  93809 __606:
  93810 	;
  93811 __604:
  93812 	;
  93813 	if !(rc != 0) {
  93814 		goto __612
  93815 	}
  93816 	goto abort_due_to_error
  93817 __612:
  93818 	;
  93819 	(*VdbeCursor)(unsafe.Pointer(pCx1)).FnullRow = U8(1)
  93820 	goto __9
  93821 
  93822 __89:
  93823 	;
  93824 	pCx2 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, uint8(CURTYPE_SORTER))
  93825 	if !(pCx2 == uintptr(0)) {
  93826 		goto __613
  93827 	}
  93828 	goto no_mem
  93829 __613:
  93830 	;
  93831 	(*VdbeCursor)(unsafe.Pointer(pCx2)).FpKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16))
  93832 
  93833 	rc = Xsqlite3VdbeSorterInit(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp3, pCx2)
  93834 	if !(rc != 0) {
  93835 		goto __614
  93836 	}
  93837 	goto abort_due_to_error
  93838 __614:
  93839 	;
  93840 	goto __9
  93841 
  93842 __90:
  93843 	;
  93844 	pC4 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  93845 
  93846 	if !(libc.PostIncInt64(&(*VdbeCursor)(unsafe.Pointer(pC4)).FseqCount, 1) == int64(0)) {
  93847 		goto __615
  93848 	}
  93849 	goto jump_to_p2
  93850 __615:
  93851 	;
  93852 	goto __9
  93853 
  93854 __91:
  93855 	;
  93856 	pCx3 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp3, uint8(CURTYPE_PSEUDO))
  93857 	if !(pCx3 == uintptr(0)) {
  93858 		goto __616
  93859 	}
  93860 	goto no_mem
  93861 __616:
  93862 	;
  93863 	(*VdbeCursor)(unsafe.Pointer(pCx3)).FnullRow = U8(1)
  93864 	(*VdbeCursor)(unsafe.Pointer(pCx3)).FseekResult = (*Op)(unsafe.Pointer(pOp)).Fp2
  93865 	(*VdbeCursor)(unsafe.Pointer(pCx3)).FisTable = U8(1)
  93866 
  93867 	*(*uintptr)(unsafe.Pointer(pCx3 + 48)) = Xsqlite3BtreeFakeValidCursor(tls)
  93868 
  93869 	goto __9
  93870 
  93871 __92:
  93872 	;
  93873 	Xsqlite3VdbeFreeCursor(tls, p, *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)))
  93874 	*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) = uintptr(0)
  93875 	goto __9
  93876 
  93877 __93:
  93878 __94:
  93879 __95:
  93880 __96:
  93881 	;
  93882 	pC5 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  93883 
  93884 	oc = int32((*Op)(unsafe.Pointer(pOp)).Fopcode)
  93885 	eqOnly = 0
  93886 	(*VdbeCursor)(unsafe.Pointer(pC5)).FnullRow = U8(0)
  93887 
  93888 	(*VdbeCursor)(unsafe.Pointer(pC5)).FdeferredMoveto = U8(0)
  93889 	(*VdbeCursor)(unsafe.Pointer(pC5)).FcacheStatus = U32(CACHE_STALE)
  93890 	if !((*VdbeCursor)(unsafe.Pointer(pC5)).FisTable != 0) {
  93891 		goto __617
  93892 	}
  93893 
  93894 	pIn3 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  93895 	flags31 = (*Mem)(unsafe.Pointer(pIn3)).Fflags
  93896 	if !(int32(flags31)&(MEM_Int|MEM_Real|MEM_IntReal|MEM_Str) == MEM_Str) {
  93897 		goto __619
  93898 	}
  93899 	applyNumericAffinity(tls, pIn3, 0)
  93900 __619:
  93901 	;
  93902 	iKey = Xsqlite3VdbeIntValue(tls, pIn3)
  93903 	newType = (*Mem)(unsafe.Pointer(pIn3)).Fflags
  93904 	(*Mem)(unsafe.Pointer(pIn3)).Fflags = flags31
  93905 
  93906 	if !(int32(newType)&(MEM_Int|MEM_IntReal) == 0) {
  93907 		goto __620
  93908 	}
  93909 	if !(int32(newType)&MEM_Real == 0) {
  93910 		goto __621
  93911 	}
  93912 	if !(int32(newType)&MEM_Null != 0 || oc >= OP_SeekGE) {
  93913 		goto __622
  93914 	}
  93915 
  93916 	goto jump_to_p2
  93917 	goto __623
  93918 __622:
  93919 	rc = Xsqlite3BtreeLast(tls, *(*uintptr)(unsafe.Pointer(pC5 + 48)), bp+320)
  93920 	if !(rc != SQLITE_OK) {
  93921 		goto __624
  93922 	}
  93923 	goto abort_due_to_error
  93924 __624:
  93925 	;
  93926 	goto seek_not_found
  93927 __623:
  93928 	;
  93929 __621:
  93930 	;
  93931 	c2 = Xsqlite3IntFloatCompare(tls, iKey, *(*float64)(unsafe.Pointer(pIn3)))
  93932 
  93933 	if !(c2 > 0) {
  93934 		goto __625
  93935 	}
  93936 
  93937 	if !(oc&0x0001 == OP_SeekGT&0x0001) {
  93938 		goto __627
  93939 	}
  93940 	oc--
  93941 __627:
  93942 	;
  93943 	goto __626
  93944 __625:
  93945 	if !(c2 < 0) {
  93946 		goto __628
  93947 	}
  93948 
  93949 	if !(oc&0x0001 == OP_SeekLT&0x0001) {
  93950 		goto __629
  93951 	}
  93952 	oc++
  93953 __629:
  93954 	;
  93955 __628:
  93956 	;
  93957 __626:
  93958 	;
  93959 __620:
  93960 	;
  93961 	rc = Xsqlite3BtreeTableMoveto(tls, *(*uintptr)(unsafe.Pointer(pC5 + 48)), int64(U64(iKey)), 0, bp+320)
  93962 	(*VdbeCursor)(unsafe.Pointer(pC5)).FmovetoTarget = iKey
  93963 	if !(rc != SQLITE_OK) {
  93964 		goto __630
  93965 	}
  93966 	goto abort_due_to_error
  93967 __630:
  93968 	;
  93969 	goto __618
  93970 __617:
  93971 	if !(Xsqlite3BtreeCursorHasHint(tls, *(*uintptr)(unsafe.Pointer(pC5 + 48)), uint32(BTREE_SEEK_EQ)) != 0) {
  93972 		goto __631
  93973 	}
  93974 	eqOnly = 1
  93975 
  93976 __631:
  93977 	;
  93978 	nField2 = *(*int32)(unsafe.Pointer(pOp + 16))
  93979 
  93980 	(*UnpackedRecord)(unsafe.Pointer(bp + 328)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC5)).FpKeyInfo
  93981 	(*UnpackedRecord)(unsafe.Pointer(bp + 328)).FnField = U16(nField2)
  93982 
  93983 	(*UnpackedRecord)(unsafe.Pointer(bp + 328)).Fdefault_rc = func() int8 {
  93984 		if 1&(oc-OP_SeekLT) != 0 {
  93985 			return int8(-1)
  93986 		}
  93987 		return +int8(1)
  93988 	}()
  93989 
  93990 	(*UnpackedRecord)(unsafe.Pointer(bp + 328)).FaMem = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  93991 	(*UnpackedRecord)(unsafe.Pointer(bp + 328)).FeqSeen = U8(0)
  93992 	rc = Xsqlite3BtreeIndexMoveto(tls, *(*uintptr)(unsafe.Pointer(pC5 + 48)), bp+328, bp+320)
  93993 	if !(rc != SQLITE_OK) {
  93994 		goto __632
  93995 	}
  93996 	goto abort_due_to_error
  93997 __632:
  93998 	;
  93999 	if !(eqOnly != 0 && int32((*UnpackedRecord)(unsafe.Pointer(bp+328)).FeqSeen) == 0) {
  94000 		goto __633
  94001 	}
  94002 
  94003 	goto seek_not_found
  94004 __633:
  94005 	;
  94006 __618:
  94007 	;
  94008 	if !(oc >= OP_SeekGE) {
  94009 		goto __634
  94010 	}
  94011 	if !(*(*int32)(unsafe.Pointer(bp + 320)) < 0 || *(*int32)(unsafe.Pointer(bp + 320)) == 0 && oc == OP_SeekGT) {
  94012 		goto __636
  94013 	}
  94014 	*(*int32)(unsafe.Pointer(bp + 320)) = 0
  94015 	rc = Xsqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC5 + 48)), 0)
  94016 	if !(rc != SQLITE_OK) {
  94017 		goto __638
  94018 	}
  94019 	if !(rc == SQLITE_DONE) {
  94020 		goto __639
  94021 	}
  94022 	rc = SQLITE_OK
  94023 	*(*int32)(unsafe.Pointer(bp + 320)) = 1
  94024 	goto __640
  94025 __639:
  94026 	goto abort_due_to_error
  94027 __640:
  94028 	;
  94029 __638:
  94030 	;
  94031 	goto __637
  94032 __636:
  94033 	*(*int32)(unsafe.Pointer(bp + 320)) = 0
  94034 __637:
  94035 	;
  94036 	goto __635
  94037 __634:
  94038 	;
  94039 	if !(*(*int32)(unsafe.Pointer(bp + 320)) > 0 || *(*int32)(unsafe.Pointer(bp + 320)) == 0 && oc == OP_SeekLT) {
  94040 		goto __641
  94041 	}
  94042 	*(*int32)(unsafe.Pointer(bp + 320)) = 0
  94043 	rc = Xsqlite3BtreePrevious(tls, *(*uintptr)(unsafe.Pointer(pC5 + 48)), 0)
  94044 	if !(rc != SQLITE_OK) {
  94045 		goto __643
  94046 	}
  94047 	if !(rc == SQLITE_DONE) {
  94048 		goto __644
  94049 	}
  94050 	rc = SQLITE_OK
  94051 	*(*int32)(unsafe.Pointer(bp + 320)) = 1
  94052 	goto __645
  94053 __644:
  94054 	goto abort_due_to_error
  94055 __645:
  94056 	;
  94057 __643:
  94058 	;
  94059 	goto __642
  94060 __641:
  94061 	*(*int32)(unsafe.Pointer(bp + 320)) = Xsqlite3BtreeEof(tls, *(*uintptr)(unsafe.Pointer(pC5 + 48)))
  94062 __642:
  94063 	;
  94064 __635:
  94065 	;
  94066 seek_not_found:
  94067 	;
  94068 	if !(*(*int32)(unsafe.Pointer(bp + 320)) != 0) {
  94069 		goto __646
  94070 	}
  94071 	goto jump_to_p2
  94072 	goto __647
  94073 __646:
  94074 	if !(eqOnly != 0) {
  94075 		goto __648
  94076 	}
  94077 
  94078 	pOp += 24
  94079 __648:
  94080 	;
  94081 __647:
  94082 	;
  94083 	goto __9
  94084 
  94085 __97:
  94086 	;
  94087 	pC6 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp+1*24)).Fp1)*8))
  94088 
  94089 	if !!(Xsqlite3BtreeCursorIsValidNN(tls, *(*uintptr)(unsafe.Pointer(pC6 + 48))) != 0) {
  94090 		goto __649
  94091 	}
  94092 	goto __9
  94093 __649:
  94094 	;
  94095 	nStep = (*Op)(unsafe.Pointer(pOp)).Fp1
  94096 
  94097 	(*UnpackedRecord)(unsafe.Pointer(bp + 368)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC6)).FpKeyInfo
  94098 	(*UnpackedRecord)(unsafe.Pointer(bp + 368)).FnField = U16(*(*int32)(unsafe.Pointer(pOp + 1*24 + 16)))
  94099 	(*UnpackedRecord)(unsafe.Pointer(bp + 368)).Fdefault_rc = int8(0)
  94100 	(*UnpackedRecord)(unsafe.Pointer(bp + 368)).FaMem = aMem + uintptr((*Op)(unsafe.Pointer(pOp+1*24)).Fp3)*56
  94101 	*(*int32)(unsafe.Pointer(bp + 408)) = 0
  94102 __650:
  94103 	if !(1 != 0) {
  94104 		goto __651
  94105 	}
  94106 	rc = Xsqlite3VdbeIdxKeyCompare(tls, db, pC6, bp+368, bp+408)
  94107 	if !(rc != 0) {
  94108 		goto __652
  94109 	}
  94110 	goto abort_due_to_error
  94111 __652:
  94112 	;
  94113 	if !(*(*int32)(unsafe.Pointer(bp + 408)) > 0 && int32((*Op)(unsafe.Pointer(pOp)).Fp5) == 0) {
  94114 		goto __653
  94115 	}
  94116 seekscan_search_fail:
  94117 	;
  94118 	pOp += 24
  94119 	goto jump_to_p2
  94120 __653:
  94121 	;
  94122 	if !(*(*int32)(unsafe.Pointer(bp + 408)) >= 0) {
  94123 		goto __654
  94124 	}
  94125 
  94126 	goto jump_to_p2
  94127 	goto __651
  94128 __654:
  94129 	;
  94130 	if !(nStep <= 0) {
  94131 		goto __655
  94132 	}
  94133 
  94134 	goto __651
  94135 __655:
  94136 	;
  94137 	nStep--
  94138 	rc = Xsqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC6 + 48)), 0)
  94139 	if !(rc != 0) {
  94140 		goto __656
  94141 	}
  94142 	if !(rc == SQLITE_DONE) {
  94143 		goto __657
  94144 	}
  94145 	rc = SQLITE_OK
  94146 	goto seekscan_search_fail
  94147 	goto __658
  94148 __657:
  94149 	goto abort_due_to_error
  94150 __658:
  94151 	;
  94152 __656:
  94153 	;
  94154 	goto __650
  94155 __651:
  94156 	;
  94157 	goto __9
  94158 
  94159 __98:
  94160 	;
  94161 	pC7 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  94162 
  94163 	if !(int32((*VdbeCursor)(unsafe.Pointer(pC7)).FseekHit) < (*Op)(unsafe.Pointer(pOp)).Fp2) {
  94164 		goto __659
  94165 	}
  94166 	(*VdbeCursor)(unsafe.Pointer(pC7)).FseekHit = U16((*Op)(unsafe.Pointer(pOp)).Fp2)
  94167 	goto __660
  94168 __659:
  94169 	if !(int32((*VdbeCursor)(unsafe.Pointer(pC7)).FseekHit) > (*Op)(unsafe.Pointer(pOp)).Fp3) {
  94170 		goto __661
  94171 	}
  94172 	(*VdbeCursor)(unsafe.Pointer(pC7)).FseekHit = U16((*Op)(unsafe.Pointer(pOp)).Fp3)
  94173 __661:
  94174 	;
  94175 __660:
  94176 	;
  94177 	goto __9
  94178 
  94179 __99:
  94180 	;
  94181 	pCur1 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  94182 
  94183 	if !(pCur1 == uintptr(0) || (*VdbeCursor)(unsafe.Pointer(pCur1)).FnullRow != 0) {
  94184 		goto __662
  94185 	}
  94186 	goto jump_to_p2_and_check_for_interrupt
  94187 __662:
  94188 	;
  94189 	goto __9
  94190 
  94191 __100:
  94192 	;
  94193 	pC8 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  94194 
  94195 	if !(int32((*VdbeCursor)(unsafe.Pointer(pC8)).FseekHit) >= *(*int32)(unsafe.Pointer(pOp + 16))) {
  94196 		goto __663
  94197 	}
  94198 	goto __9
  94199 __663:
  94200 	;
  94201 __101:
  94202 __102:
  94203 __103:
  94204 	;
  94205 	pC9 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  94206 
  94207 	(*UnpackedRecord)(unsafe.Pointer(bp + 416)).FaMem = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  94208 
  94209 	(*UnpackedRecord)(unsafe.Pointer(bp + 416)).FnField = U16(*(*int32)(unsafe.Pointer(pOp + 16)))
  94210 	if !(int32((*UnpackedRecord)(unsafe.Pointer(bp+416)).FnField) > 0) {
  94211 		goto __664
  94212 	}
  94213 
  94214 	(*UnpackedRecord)(unsafe.Pointer(bp + 416)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC9)).FpKeyInfo
  94215 	(*UnpackedRecord)(unsafe.Pointer(bp + 416)).Fdefault_rc = int8(0)
  94216 	rc = Xsqlite3BtreeIndexMoveto(tls, *(*uintptr)(unsafe.Pointer(pC9 + 48)), bp+416, pC9+36)
  94217 	goto __665
  94218 __664:
  94219 	;
  94220 	rc = func() int32 {
  94221 		if int32((*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(bp+416)).FaMem)).Fflags)&MEM_Zero != 0 {
  94222 			return Xsqlite3VdbeMemExpandBlob(tls, (*UnpackedRecord)(unsafe.Pointer(bp+416)).FaMem)
  94223 		}
  94224 		return 0
  94225 	}()
  94226 
  94227 	if !(rc != 0) {
  94228 		goto __666
  94229 	}
  94230 	goto no_mem
  94231 __666:
  94232 	;
  94233 	pIdxKey = Xsqlite3VdbeAllocUnpackedRecord(tls, (*VdbeCursor)(unsafe.Pointer(pC9)).FpKeyInfo)
  94234 	if !(pIdxKey == uintptr(0)) {
  94235 		goto __667
  94236 	}
  94237 	goto no_mem
  94238 __667:
  94239 	;
  94240 	Xsqlite3VdbeRecordUnpack(tls, (*VdbeCursor)(unsafe.Pointer(pC9)).FpKeyInfo, (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(bp+416)).FaMem)).Fn, (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(bp+416)).FaMem)).Fz, pIdxKey)
  94241 	(*UnpackedRecord)(unsafe.Pointer(pIdxKey)).Fdefault_rc = int8(0)
  94242 	rc = Xsqlite3BtreeIndexMoveto(tls, *(*uintptr)(unsafe.Pointer(pC9 + 48)), pIdxKey, pC9+36)
  94243 	Xsqlite3DbFreeNN(tls, db, pIdxKey)
  94244 __665:
  94245 	;
  94246 	if !(rc != SQLITE_OK) {
  94247 		goto __668
  94248 	}
  94249 	goto abort_due_to_error
  94250 __668:
  94251 	;
  94252 	alreadyExists = libc.Bool32((*VdbeCursor)(unsafe.Pointer(pC9)).FseekResult == 0)
  94253 	(*VdbeCursor)(unsafe.Pointer(pC9)).FnullRow = U8(1 - alreadyExists)
  94254 	(*VdbeCursor)(unsafe.Pointer(pC9)).FdeferredMoveto = U8(0)
  94255 	(*VdbeCursor)(unsafe.Pointer(pC9)).FcacheStatus = U32(CACHE_STALE)
  94256 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_Found) {
  94257 		goto __669
  94258 	}
  94259 
  94260 	if !(alreadyExists != 0) {
  94261 		goto __671
  94262 	}
  94263 	goto jump_to_p2
  94264 __671:
  94265 	;
  94266 	goto __670
  94267 __669:
  94268 	if !!(alreadyExists != 0) {
  94269 		goto __672
  94270 	}
  94271 
  94272 	goto jump_to_p2
  94273 __672:
  94274 	;
  94275 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_NoConflict) {
  94276 		goto __673
  94277 	}
  94278 
  94279 	ii1 = 0
  94280 __674:
  94281 	if !(ii1 < int32((*UnpackedRecord)(unsafe.Pointer(bp+416)).FnField)) {
  94282 		goto __676
  94283 	}
  94284 	if !(int32((*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(bp+416)).FaMem+uintptr(ii1)*56)).Fflags)&MEM_Null != 0) {
  94285 		goto __677
  94286 	}
  94287 
  94288 	goto jump_to_p2
  94289 __677:
  94290 	;
  94291 	goto __675
  94292 __675:
  94293 	ii1++
  94294 	goto __674
  94295 	goto __676
  94296 __676:
  94297 	;
  94298 __673:
  94299 	;
  94300 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_IfNoHope) {
  94301 		goto __678
  94302 	}
  94303 	(*VdbeCursor)(unsafe.Pointer(pC9)).FseekHit = U16(*(*int32)(unsafe.Pointer(pOp + 16)))
  94304 __678:
  94305 	;
  94306 __670:
  94307 	;
  94308 	goto __9
  94309 
  94310 __104:
  94311 	pIn3 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  94312 
  94313 	if !(int32((*Mem)(unsafe.Pointer(pIn3)).Fflags)&(MEM_Int|MEM_IntReal) == 0) {
  94314 		goto __679
  94315 	}
  94316 
  94317 	*(*Mem)(unsafe.Pointer(bp + 456)) = *(*Mem)(unsafe.Pointer(pIn3))
  94318 	applyAffinity(tls, bp+456, int8(SQLITE_AFF_NUMERIC), encoding)
  94319 	if !(int32((*Mem)(unsafe.Pointer(bp+456)).Fflags)&MEM_Int == 0) {
  94320 		goto __680
  94321 	}
  94322 	goto jump_to_p2
  94323 __680:
  94324 	;
  94325 	iKey1 = U64(*(*I64)(unsafe.Pointer(bp + 456)))
  94326 	goto notExistsWithKey
  94327 __679:
  94328 	;
  94329 __105:
  94330 	pIn3 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  94331 
  94332 	iKey1 = U64(*(*I64)(unsafe.Pointer(pIn3)))
  94333 notExistsWithKey:
  94334 	pC10 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  94335 
  94336 	pCrsr2 = *(*uintptr)(unsafe.Pointer(pC10 + 48))
  94337 
  94338 	*(*int32)(unsafe.Pointer(bp + 512)) = 0
  94339 	rc = Xsqlite3BtreeTableMoveto(tls, pCrsr2, int64(iKey1), 0, bp+512)
  94340 
  94341 	(*VdbeCursor)(unsafe.Pointer(pC10)).FmovetoTarget = I64(iKey1)
  94342 	(*VdbeCursor)(unsafe.Pointer(pC10)).FnullRow = U8(0)
  94343 	(*VdbeCursor)(unsafe.Pointer(pC10)).FcacheStatus = U32(CACHE_STALE)
  94344 	(*VdbeCursor)(unsafe.Pointer(pC10)).FdeferredMoveto = U8(0)
  94345 
  94346 	(*VdbeCursor)(unsafe.Pointer(pC10)).FseekResult = *(*int32)(unsafe.Pointer(bp + 512))
  94347 	if !(*(*int32)(unsafe.Pointer(bp + 512)) != 0) {
  94348 		goto __681
  94349 	}
  94350 
  94351 	if !((*Op)(unsafe.Pointer(pOp)).Fp2 == 0) {
  94352 		goto __682
  94353 	}
  94354 	rc = Xsqlite3CorruptError(tls, 95563)
  94355 	goto __683
  94356 __682:
  94357 	goto jump_to_p2
  94358 __683:
  94359 	;
  94360 __681:
  94361 	;
  94362 	if !(rc != 0) {
  94363 		goto __684
  94364 	}
  94365 	goto abort_due_to_error
  94366 __684:
  94367 	;
  94368 	goto __9
  94369 
  94370 __106:
  94371 	;
  94372 	pOut = out2Prerelease(tls, p, pOp)
  94373 	*(*I64)(unsafe.Pointer(pOut)) = libc.PostIncInt64(&(*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)))).FseqCount, 1)
  94374 	goto __9
  94375 
  94376 __107:
  94377 	*(*I64)(unsafe.Pointer(bp + 520)) = int64(0)
  94378 	*(*int32)(unsafe.Pointer(bp + 516)) = 0
  94379 	pOut = out2Prerelease(tls, p, pOp)
  94380 
  94381 	pC11 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  94382 
  94383 	if !!(int32(*(*uint8)(unsafe.Pointer(pC11 + 8))&0x2>>1) != 0) {
  94384 		goto __685
  94385 	}
  94386 	rc = Xsqlite3BtreeLast(tls, *(*uintptr)(unsafe.Pointer(pC11 + 48)), bp+516)
  94387 	if !(rc != SQLITE_OK) {
  94388 		goto __686
  94389 	}
  94390 	goto abort_due_to_error
  94391 __686:
  94392 	;
  94393 	if !(*(*int32)(unsafe.Pointer(bp + 516)) != 0) {
  94394 		goto __687
  94395 	}
  94396 	*(*I64)(unsafe.Pointer(bp + 520)) = int64(1)
  94397 	goto __688
  94398 __687:
  94399 	;
  94400 	*(*I64)(unsafe.Pointer(bp + 520)) = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC11 + 48)))
  94401 	if !(*(*I64)(unsafe.Pointer(bp + 520)) >= int64(uint64(0x7fffffff)<<32|uint64(0xffffffff))) {
  94402 		goto __689
  94403 	}
  94404 	libc.SetBitFieldPtr8Uint32(pC11+8, Bool(1), 1, 0x2)
  94405 	goto __690
  94406 __689:
  94407 	*(*I64)(unsafe.Pointer(bp + 520))++
  94408 __690:
  94409 	;
  94410 __688:
  94411 	;
  94412 __685:
  94413 	;
  94414 	if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) {
  94415 		goto __691
  94416 	}
  94417 
  94418 	if !((*Vdbe)(unsafe.Pointer(p)).FpFrame != 0) {
  94419 		goto __692
  94420 	}
  94421 	pFrame1 = (*Vdbe)(unsafe.Pointer(p)).FpFrame
  94422 __694:
  94423 	if !((*VdbeFrame)(unsafe.Pointer(pFrame1)).FpParent != 0) {
  94424 		goto __696
  94425 	}
  94426 	goto __695
  94427 __695:
  94428 	pFrame1 = (*VdbeFrame)(unsafe.Pointer(pFrame1)).FpParent
  94429 	goto __694
  94430 	goto __696
  94431 __696:
  94432 	;
  94433 	pMem = (*VdbeFrame)(unsafe.Pointer(pFrame1)).FaMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  94434 	goto __693
  94435 __692:
  94436 	;
  94437 	pMem = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  94438 
  94439 __693:
  94440 	;
  94441 	Xsqlite3VdbeMemIntegerify(tls, pMem)
  94442 
  94443 	if !(*(*I64)(unsafe.Pointer(pMem)) == int64(uint64(0x7fffffff)<<32|uint64(0xffffffff)) || Bool(int32(*(*uint8)(unsafe.Pointer(pC11 + 8))&0x2>>1)) != 0) {
  94444 		goto __697
  94445 	}
  94446 	rc = SQLITE_FULL
  94447 	goto abort_due_to_error
  94448 __697:
  94449 	;
  94450 	if !(*(*I64)(unsafe.Pointer(bp + 520)) < *(*I64)(unsafe.Pointer(pMem))+int64(1)) {
  94451 		goto __698
  94452 	}
  94453 	*(*I64)(unsafe.Pointer(bp + 520)) = *(*I64)(unsafe.Pointer(pMem)) + int64(1)
  94454 __698:
  94455 	;
  94456 	*(*I64)(unsafe.Pointer(pMem)) = *(*I64)(unsafe.Pointer(bp + 520))
  94457 __691:
  94458 	;
  94459 	if !(Bool(int32(*(*uint8)(unsafe.Pointer(pC11 + 8))&0x2>>1)) != 0) {
  94460 		goto __699
  94461 	}
  94462 
  94463 	cnt1 = 0
  94464 __700:
  94465 	Xsqlite3_randomness(tls, int32(unsafe.Sizeof(I64(0))), bp+520)
  94466 	*(*I64)(unsafe.Pointer(bp + 520)) &= int64(uint64(0x7fffffff)<<32|uint64(0xffffffff)) >> 1
  94467 	*(*I64)(unsafe.Pointer(bp + 520))++
  94468 	goto __701
  94469 __701:
  94470 	if libc.AssignInt32(&rc, Xsqlite3BtreeTableMoveto(tls, *(*uintptr)(unsafe.Pointer(pC11 + 48)), int64(U64(*(*I64)(unsafe.Pointer(bp + 520)))),
  94471 		0, bp+516)) == SQLITE_OK &&
  94472 		*(*int32)(unsafe.Pointer(bp + 516)) == 0 &&
  94473 		libc.PreIncInt32(&cnt1, 1) < 100 {
  94474 		goto __700
  94475 	}
  94476 	goto __702
  94477 __702:
  94478 	;
  94479 	if !(rc != 0) {
  94480 		goto __703
  94481 	}
  94482 	goto abort_due_to_error
  94483 __703:
  94484 	;
  94485 	if !(*(*int32)(unsafe.Pointer(bp + 516)) == 0) {
  94486 		goto __704
  94487 	}
  94488 	rc = SQLITE_FULL
  94489 	goto abort_due_to_error
  94490 __704:
  94491 	;
  94492 __699:
  94493 	;
  94494 	(*VdbeCursor)(unsafe.Pointer(pC11)).FdeferredMoveto = U8(0)
  94495 	(*VdbeCursor)(unsafe.Pointer(pC11)).FcacheStatus = U32(CACHE_STALE)
  94496 
  94497 	*(*I64)(unsafe.Pointer(pOut)) = *(*I64)(unsafe.Pointer(bp + 520))
  94498 	goto __9
  94499 
  94500 __108:
  94501 	pData = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56
  94502 
  94503 	pC12 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  94504 
  94505 	pKey = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  94506 
  94507 	(*BtreePayload)(unsafe.Pointer(bp + 528)).FnKey = *(*I64)(unsafe.Pointer(pKey))
  94508 
  94509 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == -5 && ((*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 || (*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback != 0)) {
  94510 		goto __705
  94511 	}
  94512 
  94513 	zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*VdbeCursor)(unsafe.Pointer(pC12)).FiDb)*32)).FzDbSName
  94514 	pTab1 = *(*uintptr)(unsafe.Pointer(pOp + 16))
  94515 
  94516 	goto __706
  94517 __705:
  94518 	pTab1 = uintptr(0)
  94519 	zDb = uintptr(0)
  94520 __706:
  94521 	;
  94522 	if !(pTab1 != 0) {
  94523 		goto __707
  94524 	}
  94525 	if !((*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 && !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_ISUPDATE != 0)) {
  94526 		goto __708
  94527 	}
  94528 	Xsqlite3VdbePreUpdateHook(tls, p, pC12, SQLITE_INSERT, zDb, pTab1, (*BtreePayload)(unsafe.Pointer(bp+528)).FnKey, (*Op)(unsafe.Pointer(pOp)).Fp2, -1)
  94529 __708:
  94530 	;
  94531 	if !((*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback == uintptr(0) || (*Table)(unsafe.Pointer(pTab1)).FaCol == uintptr(0)) {
  94532 		goto __709
  94533 	}
  94534 
  94535 	pTab1 = uintptr(0)
  94536 __709:
  94537 	;
  94538 __707:
  94539 	;
  94540 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_ISNOOP != 0) {
  94541 		goto __710
  94542 	}
  94543 	goto __9
  94544 __710:
  94545 	;
  94546 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_NCHANGE != 0) {
  94547 		goto __711
  94548 	}
  94549 	(*Vdbe)(unsafe.Pointer(p)).FnChange++
  94550 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_LASTROWID != 0) {
  94551 		goto __712
  94552 	}
  94553 	(*Sqlite3)(unsafe.Pointer(db)).FlastRowid = (*BtreePayload)(unsafe.Pointer(bp + 528)).FnKey
  94554 __712:
  94555 	;
  94556 __711:
  94557 	;
  94558 	(*BtreePayload)(unsafe.Pointer(bp + 528)).FpData = (*Mem)(unsafe.Pointer(pData)).Fz
  94559 	(*BtreePayload)(unsafe.Pointer(bp + 528)).FnData = (*Mem)(unsafe.Pointer(pData)).Fn
  94560 	seekResult = func() int32 {
  94561 		if int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_USESEEKRESULT != 0 {
  94562 			return (*VdbeCursor)(unsafe.Pointer(pC12)).FseekResult
  94563 		}
  94564 		return 0
  94565 	}()
  94566 	if !(int32((*Mem)(unsafe.Pointer(pData)).Fflags)&MEM_Zero != 0) {
  94567 		goto __713
  94568 	}
  94569 	(*BtreePayload)(unsafe.Pointer(bp + 528)).FnZero = *(*int32)(unsafe.Pointer(pData))
  94570 	goto __714
  94571 __713:
  94572 	(*BtreePayload)(unsafe.Pointer(bp + 528)).FnZero = 0
  94573 __714:
  94574 	;
  94575 	(*BtreePayload)(unsafe.Pointer(bp + 528)).FpKey = uintptr(0)
  94576 
  94577 	rc = Xsqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC12 + 48)), bp+528,
  94578 		int32((*Op)(unsafe.Pointer(pOp)).Fp5)&(OPFLAG_APPEND|OPFLAG_SAVEPOSITION|OPFLAG_PREFORMAT),
  94579 		seekResult)
  94580 	(*VdbeCursor)(unsafe.Pointer(pC12)).FdeferredMoveto = U8(0)
  94581 	(*VdbeCursor)(unsafe.Pointer(pC12)).FcacheStatus = U32(CACHE_STALE)
  94582 
  94583 	if !(rc != 0) {
  94584 		goto __715
  94585 	}
  94586 	goto abort_due_to_error
  94587 __715:
  94588 	;
  94589 	if !(pTab1 != 0) {
  94590 		goto __716
  94591 	}
  94592 
  94593 	(*struct {
  94594 		f func(*libc.TLS, uintptr, int32, uintptr, uintptr, Sqlite_int64)
  94595 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpUpdateArg,
  94596 		func() int32 {
  94597 			if int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_ISUPDATE != 0 {
  94598 				return SQLITE_UPDATE
  94599 			}
  94600 			return SQLITE_INSERT
  94601 		}(),
  94602 		zDb, (*Table)(unsafe.Pointer(pTab1)).FzName, (*BtreePayload)(unsafe.Pointer(bp+528)).FnKey)
  94603 __716:
  94604 	;
  94605 	goto __9
  94606 
  94607 __109:
  94608 	;
  94609 	pDest1 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  94610 	pSrc = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*8))
  94611 	if (*Op)(unsafe.Pointer(pOp)).Fp3 != 0 {
  94612 		iKey2 = *(*I64)(unsafe.Pointer(aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56))
  94613 	} else {
  94614 		iKey2 = int64(0)
  94615 	}
  94616 	rc = Xsqlite3BtreeTransferRow(tls, *(*uintptr)(unsafe.Pointer(pDest1 + 48)), *(*uintptr)(unsafe.Pointer(pSrc + 48)), iKey2)
  94617 	if !(rc != SQLITE_OK) {
  94618 		goto __717
  94619 	}
  94620 	goto abort_due_to_error
  94621 __717:
  94622 	;
  94623 	goto __9
  94624 
  94625 __110:
  94626 	opflags = (*Op)(unsafe.Pointer(pOp)).Fp2
  94627 
  94628 	pC13 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  94629 
  94630 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == -5 && ((*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 || (*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback != 0)) {
  94631 		goto __718
  94632 	}
  94633 
  94634 	zDb1 = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*VdbeCursor)(unsafe.Pointer(pC13)).FiDb)*32)).FzDbSName
  94635 	pTab2 = *(*uintptr)(unsafe.Pointer(pOp + 16))
  94636 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_SAVEPOSITION != 0 && (*VdbeCursor)(unsafe.Pointer(pC13)).FisTable != 0) {
  94637 		goto __720
  94638 	}
  94639 	(*VdbeCursor)(unsafe.Pointer(pC13)).FmovetoTarget = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC13 + 48)))
  94640 __720:
  94641 	;
  94642 	goto __719
  94643 __718:
  94644 	zDb1 = uintptr(0)
  94645 	pTab2 = uintptr(0)
  94646 __719:
  94647 	;
  94648 	if !((*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 && pTab2 != 0) {
  94649 		goto __721
  94650 	}
  94651 
  94652 	Xsqlite3VdbePreUpdateHook(tls, p, pC13,
  94653 		func() int32 {
  94654 			if opflags&OPFLAG_ISUPDATE != 0 {
  94655 				return SQLITE_UPDATE
  94656 			}
  94657 			return SQLITE_DELETE
  94658 		}(),
  94659 		zDb1, pTab2, (*VdbeCursor)(unsafe.Pointer(pC13)).FmovetoTarget,
  94660 		(*Op)(unsafe.Pointer(pOp)).Fp3, -1)
  94661 __721:
  94662 	;
  94663 	if !(opflags&OPFLAG_ISNOOP != 0) {
  94664 		goto __722
  94665 	}
  94666 	goto __9
  94667 __722:
  94668 	;
  94669 	rc = Xsqlite3BtreeDelete(tls, *(*uintptr)(unsafe.Pointer(pC13 + 48)), uint8((*Op)(unsafe.Pointer(pOp)).Fp5))
  94670 	(*VdbeCursor)(unsafe.Pointer(pC13)).FcacheStatus = U32(CACHE_STALE)
  94671 	(*VdbeCursor)(unsafe.Pointer(pC13)).FseekResult = 0
  94672 	if !(rc != 0) {
  94673 		goto __723
  94674 	}
  94675 	goto abort_due_to_error
  94676 __723:
  94677 	;
  94678 	if !(opflags&OPFLAG_NCHANGE != 0) {
  94679 		goto __724
  94680 	}
  94681 	(*Vdbe)(unsafe.Pointer(p)).FnChange++
  94682 	if !((*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback != 0 && pTab2 != uintptr(0) && (*Table)(unsafe.Pointer(pTab2)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
  94683 		goto __725
  94684 	}
  94685 	(*struct {
  94686 		f func(*libc.TLS, uintptr, int32, uintptr, uintptr, Sqlite_int64)
  94687 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpUpdateArg, SQLITE_DELETE, zDb1, (*Table)(unsafe.Pointer(pTab2)).FzName,
  94688 		(*VdbeCursor)(unsafe.Pointer(pC13)).FmovetoTarget)
  94689 
  94690 __725:
  94691 	;
  94692 __724:
  94693 	;
  94694 	goto __9
  94695 
  94696 __111:
  94697 	Xsqlite3VdbeSetChanges(tls, db, (*Vdbe)(unsafe.Pointer(p)).FnChange)
  94698 	(*Vdbe)(unsafe.Pointer(p)).FnChange = int64(0)
  94699 	goto __9
  94700 
  94701 __112:
  94702 	pC14 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  94703 
  94704 	pIn3 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  94705 	nKeyCol = *(*int32)(unsafe.Pointer(pOp + 16))
  94706 	*(*int32)(unsafe.Pointer(bp + 576)) = 0
  94707 	rc = Xsqlite3VdbeSorterCompare(tls, pC14, pIn3, nKeyCol, bp+576)
  94708 
  94709 	if !(rc != 0) {
  94710 		goto __726
  94711 	}
  94712 	goto abort_due_to_error
  94713 __726:
  94714 	;
  94715 	if !(*(*int32)(unsafe.Pointer(bp + 576)) != 0) {
  94716 		goto __727
  94717 	}
  94718 	goto jump_to_p2
  94719 __727:
  94720 	;
  94721 	goto __9
  94722 
  94723 __113:
  94724 	pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56
  94725 	pC15 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  94726 
  94727 	rc = Xsqlite3VdbeSorterRowkey(tls, pC15, pOut)
  94728 
  94729 	if !(rc != 0) {
  94730 		goto __728
  94731 	}
  94732 	goto abort_due_to_error
  94733 __728:
  94734 	;
  94735 	(*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*8)))).FcacheStatus = U32(CACHE_STALE)
  94736 	goto __9
  94737 
  94738 __114:
  94739 	pOut = out2Prerelease(tls, p, pOp)
  94740 
  94741 	pC16 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  94742 
  94743 	pCrsr3 = *(*uintptr)(unsafe.Pointer(pC16 + 48))
  94744 
  94745 	n3 = Xsqlite3BtreePayloadSize(tls, pCrsr3)
  94746 	if !(n3 > U32(*(*int32)(unsafe.Pointer(db + 136)))) {
  94747 		goto __729
  94748 	}
  94749 	goto too_big
  94750 __729:
  94751 	;
  94752 	rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, pCrsr3, n3, pOut)
  94753 	if !(rc != 0) {
  94754 		goto __730
  94755 	}
  94756 	goto abort_due_to_error
  94757 __730:
  94758 	;
  94759 	if !!((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) {
  94760 		goto __731
  94761 	}
  94762 	if !(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&MEM_Ephem != 0 && Xsqlite3VdbeMemMakeWriteable(tls, pOut) != 0) {
  94763 		goto __732
  94764 	}
  94765 	goto no_mem
  94766 __732:
  94767 	;
  94768 __731:
  94769 	;
  94770 	goto __9
  94771 
  94772 __115:
  94773 	pOut = out2Prerelease(tls, p, pOp)
  94774 
  94775 	pC17 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  94776 
  94777 	if !((*VdbeCursor)(unsafe.Pointer(pC17)).FnullRow != 0) {
  94778 		goto __733
  94779 	}
  94780 	(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null)
  94781 	goto __9
  94782 	goto __734
  94783 __733:
  94784 	if !((*VdbeCursor)(unsafe.Pointer(pC17)).FdeferredMoveto != 0) {
  94785 		goto __735
  94786 	}
  94787 	*(*I64)(unsafe.Pointer(bp + 584)) = (*VdbeCursor)(unsafe.Pointer(pC17)).FmovetoTarget
  94788 	goto __736
  94789 __735:
  94790 	if !(int32((*VdbeCursor)(unsafe.Pointer(pC17)).FeCurType) == CURTYPE_VTAB) {
  94791 		goto __737
  94792 	}
  94793 
  94794 	pVtab = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pC17 + 48)))).FpVtab
  94795 	pModule = (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FpModule
  94796 
  94797 	rc = (*struct {
  94798 		f func(*libc.TLS, uintptr, uintptr) int32
  94799 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule)).FxRowid})).f(tls, *(*uintptr)(unsafe.Pointer(pC17 + 48)), bp+584)
  94800 	Xsqlite3VtabImportErrmsg(tls, p, pVtab)
  94801 	if !(rc != 0) {
  94802 		goto __739
  94803 	}
  94804 	goto abort_due_to_error
  94805 __739:
  94806 	;
  94807 	goto __738
  94808 __737:
  94809 	;
  94810 	rc = Xsqlite3VdbeCursorRestore(tls, pC17)
  94811 	if !(rc != 0) {
  94812 		goto __740
  94813 	}
  94814 	goto abort_due_to_error
  94815 __740:
  94816 	;
  94817 	if !((*VdbeCursor)(unsafe.Pointer(pC17)).FnullRow != 0) {
  94818 		goto __741
  94819 	}
  94820 	(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null)
  94821 	goto __9
  94822 __741:
  94823 	;
  94824 	*(*I64)(unsafe.Pointer(bp + 584)) = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC17 + 48)))
  94825 __738:
  94826 	;
  94827 __736:
  94828 	;
  94829 __734:
  94830 	;
  94831 	*(*I64)(unsafe.Pointer(pOut)) = *(*I64)(unsafe.Pointer(bp + 584))
  94832 	goto __9
  94833 
  94834 __116:
  94835 	;
  94836 	pC18 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  94837 	if !(pC18 == uintptr(0)) {
  94838 		goto __742
  94839 	}
  94840 
  94841 	pC18 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, 1, uint8(CURTYPE_PSEUDO))
  94842 	if !(pC18 == uintptr(0)) {
  94843 		goto __743
  94844 	}
  94845 	goto no_mem
  94846 __743:
  94847 	;
  94848 	(*VdbeCursor)(unsafe.Pointer(pC18)).FseekResult = 0
  94849 	(*VdbeCursor)(unsafe.Pointer(pC18)).FisTable = U8(1)
  94850 	libc.SetBitFieldPtr8Uint32(pC18+8, Bool(1), 3, 0x8)
  94851 	*(*uintptr)(unsafe.Pointer(pC18 + 48)) = Xsqlite3BtreeFakeValidCursor(tls)
  94852 __742:
  94853 	;
  94854 	(*VdbeCursor)(unsafe.Pointer(pC18)).FnullRow = U8(1)
  94855 	(*VdbeCursor)(unsafe.Pointer(pC18)).FcacheStatus = U32(CACHE_STALE)
  94856 	if !(int32((*VdbeCursor)(unsafe.Pointer(pC18)).FeCurType) == CURTYPE_BTREE) {
  94857 		goto __744
  94858 	}
  94859 
  94860 	Xsqlite3BtreeClearCursor(tls, *(*uintptr)(unsafe.Pointer(pC18 + 48)))
  94861 __744:
  94862 	;
  94863 	goto __9
  94864 
  94865 __117:
  94866 __118:
  94867 	;
  94868 	pC19 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  94869 
  94870 	pCrsr4 = *(*uintptr)(unsafe.Pointer(pC19 + 48))
  94871 	*(*int32)(unsafe.Pointer(bp + 592)) = 0
  94872 
  94873 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_SeekEnd) {
  94874 		goto __745
  94875 	}
  94876 
  94877 	(*VdbeCursor)(unsafe.Pointer(pC19)).FseekResult = -1
  94878 	if !(Xsqlite3BtreeCursorIsValidNN(tls, pCrsr4) != 0) {
  94879 		goto __746
  94880 	}
  94881 	goto __9
  94882 __746:
  94883 	;
  94884 __745:
  94885 	;
  94886 	rc = Xsqlite3BtreeLast(tls, pCrsr4, bp+592)
  94887 	(*VdbeCursor)(unsafe.Pointer(pC19)).FnullRow = U8(*(*int32)(unsafe.Pointer(bp + 592)))
  94888 	(*VdbeCursor)(unsafe.Pointer(pC19)).FdeferredMoveto = U8(0)
  94889 	(*VdbeCursor)(unsafe.Pointer(pC19)).FcacheStatus = U32(CACHE_STALE)
  94890 	if !(rc != 0) {
  94891 		goto __747
  94892 	}
  94893 	goto abort_due_to_error
  94894 __747:
  94895 	;
  94896 	if !((*Op)(unsafe.Pointer(pOp)).Fp2 > 0) {
  94897 		goto __748
  94898 	}
  94899 
  94900 	if !(*(*int32)(unsafe.Pointer(bp + 592)) != 0) {
  94901 		goto __749
  94902 	}
  94903 	goto jump_to_p2
  94904 __749:
  94905 	;
  94906 __748:
  94907 	;
  94908 	goto __9
  94909 
  94910 __119:
  94911 	;
  94912 	pC20 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  94913 
  94914 	pCrsr5 = *(*uintptr)(unsafe.Pointer(pC20 + 48))
  94915 
  94916 	rc = Xsqlite3BtreeFirst(tls, pCrsr5, bp+596)
  94917 	if !(rc != 0) {
  94918 		goto __750
  94919 	}
  94920 	goto abort_due_to_error
  94921 __750:
  94922 	;
  94923 	if !(*(*int32)(unsafe.Pointer(bp + 596)) == 0) {
  94924 		goto __751
  94925 	}
  94926 	sz = Xsqlite3BtreeRowCountEst(tls, pCrsr5)
  94927 	if !(sz >= int64(0) && int32(Xsqlite3LogEst(tls, U64(sz))) < (*Op)(unsafe.Pointer(pOp)).Fp3) {
  94928 		goto __752
  94929 	}
  94930 	*(*int32)(unsafe.Pointer(bp + 596)) = 1
  94931 __752:
  94932 	;
  94933 __751:
  94934 	;
  94935 	if !(*(*int32)(unsafe.Pointer(bp + 596)) != 0) {
  94936 		goto __753
  94937 	}
  94938 	goto jump_to_p2
  94939 __753:
  94940 	;
  94941 	goto __9
  94942 
  94943 __120:
  94944 __121:
  94945 	*(*U32)(unsafe.Pointer(p + 212 + 2*4))++
  94946 
  94947 __122:
  94948 	;
  94949 	pC21 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  94950 
  94951 	*(*int32)(unsafe.Pointer(bp + 600)) = 1
  94952 	if !(int32((*VdbeCursor)(unsafe.Pointer(pC21)).FeCurType) == CURTYPE_SORTER) {
  94953 		goto __754
  94954 	}
  94955 	rc = Xsqlite3VdbeSorterRewind(tls, pC21, bp+600)
  94956 	goto __755
  94957 __754:
  94958 	;
  94959 	pCrsr6 = *(*uintptr)(unsafe.Pointer(pC21 + 48))
  94960 
  94961 	rc = Xsqlite3BtreeFirst(tls, pCrsr6, bp+600)
  94962 	(*VdbeCursor)(unsafe.Pointer(pC21)).FdeferredMoveto = U8(0)
  94963 	(*VdbeCursor)(unsafe.Pointer(pC21)).FcacheStatus = U32(CACHE_STALE)
  94964 __755:
  94965 	;
  94966 	if !(rc != 0) {
  94967 		goto __756
  94968 	}
  94969 	goto abort_due_to_error
  94970 __756:
  94971 	;
  94972 	(*VdbeCursor)(unsafe.Pointer(pC21)).FnullRow = U8(*(*int32)(unsafe.Pointer(bp + 600)))
  94973 	if !((*Op)(unsafe.Pointer(pOp)).Fp2 > 0) {
  94974 		goto __757
  94975 	}
  94976 
  94977 	if !(*(*int32)(unsafe.Pointer(bp + 600)) != 0) {
  94978 		goto __758
  94979 	}
  94980 	goto jump_to_p2
  94981 __758:
  94982 	;
  94983 __757:
  94984 	;
  94985 	goto __9
  94986 
  94987 __123:
  94988 	pC22 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  94989 
  94990 	rc = Xsqlite3VdbeSorterNext(tls, db, pC22)
  94991 	goto next_tail
  94992 
  94993 __124:
  94994 	;
  94995 	pC22 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  94996 
  94997 	rc = Xsqlite3BtreePrevious(tls, *(*uintptr)(unsafe.Pointer(pC22 + 48)), (*Op)(unsafe.Pointer(pOp)).Fp3)
  94998 	goto next_tail
  94999 
  95000 __125:
  95001 	;
  95002 	pC22 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  95003 
  95004 	rc = Xsqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC22 + 48)), (*Op)(unsafe.Pointer(pOp)).Fp3)
  95005 
  95006 next_tail:
  95007 	(*VdbeCursor)(unsafe.Pointer(pC22)).FcacheStatus = U32(CACHE_STALE)
  95008 
  95009 	if !(rc == SQLITE_OK) {
  95010 		goto __759
  95011 	}
  95012 	(*VdbeCursor)(unsafe.Pointer(pC22)).FnullRow = U8(0)
  95013 	*(*U32)(unsafe.Pointer(p + 212 + uintptr((*Op)(unsafe.Pointer(pOp)).Fp5)*4))++
  95014 	goto jump_to_p2_and_check_for_interrupt
  95015 __759:
  95016 	;
  95017 	if !(rc != SQLITE_DONE) {
  95018 		goto __760
  95019 	}
  95020 	goto abort_due_to_error
  95021 __760:
  95022 	;
  95023 	rc = SQLITE_OK
  95024 	(*VdbeCursor)(unsafe.Pointer(pC22)).FnullRow = U8(1)
  95025 	goto check_for_interrupt
  95026 
  95027 __126:
  95028 	;
  95029 	pC23 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  95030 
  95031 	pIn2 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56
  95032 
  95033 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_NCHANGE != 0) {
  95034 		goto __761
  95035 	}
  95036 	(*Vdbe)(unsafe.Pointer(p)).FnChange++
  95037 __761:
  95038 	;
  95039 	rc = func() int32 {
  95040 		if int32((*Mem)(unsafe.Pointer(pIn2)).Fflags)&MEM_Zero != 0 {
  95041 			return Xsqlite3VdbeMemExpandBlob(tls, pIn2)
  95042 		}
  95043 		return 0
  95044 	}()
  95045 	if !(rc != 0) {
  95046 		goto __762
  95047 	}
  95048 	goto abort_due_to_error
  95049 __762:
  95050 	;
  95051 	(*BtreePayload)(unsafe.Pointer(bp + 608)).FnKey = Sqlite3_int64((*Mem)(unsafe.Pointer(pIn2)).Fn)
  95052 	(*BtreePayload)(unsafe.Pointer(bp + 608)).FpKey = (*Mem)(unsafe.Pointer(pIn2)).Fz
  95053 	(*BtreePayload)(unsafe.Pointer(bp + 608)).FaMem = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  95054 	(*BtreePayload)(unsafe.Pointer(bp + 608)).FnMem = U16(*(*int32)(unsafe.Pointer(pOp + 16)))
  95055 	rc = Xsqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC23 + 48)), bp+608,
  95056 		int32((*Op)(unsafe.Pointer(pOp)).Fp5)&(OPFLAG_APPEND|OPFLAG_SAVEPOSITION|OPFLAG_PREFORMAT),
  95057 		func() int32 {
  95058 			if int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_USESEEKRESULT != 0 {
  95059 				return (*VdbeCursor)(unsafe.Pointer(pC23)).FseekResult
  95060 			}
  95061 			return 0
  95062 		}())
  95063 
  95064 	(*VdbeCursor)(unsafe.Pointer(pC23)).FcacheStatus = U32(CACHE_STALE)
  95065 	if !(rc != 0) {
  95066 		goto __763
  95067 	}
  95068 	goto abort_due_to_error
  95069 __763:
  95070 	;
  95071 	goto __9
  95072 
  95073 __127:
  95074 	;
  95075 	pC24 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  95076 
  95077 	pIn2 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56
  95078 
  95079 	rc = func() int32 {
  95080 		if int32((*Mem)(unsafe.Pointer(pIn2)).Fflags)&MEM_Zero != 0 {
  95081 			return Xsqlite3VdbeMemExpandBlob(tls, pIn2)
  95082 		}
  95083 		return 0
  95084 	}()
  95085 	if !(rc != 0) {
  95086 		goto __764
  95087 	}
  95088 	goto abort_due_to_error
  95089 __764:
  95090 	;
  95091 	rc = Xsqlite3VdbeSorterWrite(tls, pC24, pIn2)
  95092 	if !(rc != 0) {
  95093 		goto __765
  95094 	}
  95095 	goto abort_due_to_error
  95096 __765:
  95097 	;
  95098 	goto __9
  95099 
  95100 __128:
  95101 	;
  95102 	pC25 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  95103 
  95104 	pCrsr7 = *(*uintptr)(unsafe.Pointer(pC25 + 48))
  95105 
  95106 	(*UnpackedRecord)(unsafe.Pointer(bp + 656)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC25)).FpKeyInfo
  95107 	(*UnpackedRecord)(unsafe.Pointer(bp + 656)).FnField = U16((*Op)(unsafe.Pointer(pOp)).Fp3)
  95108 	(*UnpackedRecord)(unsafe.Pointer(bp + 656)).Fdefault_rc = int8(0)
  95109 	(*UnpackedRecord)(unsafe.Pointer(bp + 656)).FaMem = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56
  95110 	rc = Xsqlite3BtreeIndexMoveto(tls, pCrsr7, bp+656, bp+696)
  95111 	if !(rc != 0) {
  95112 		goto __766
  95113 	}
  95114 	goto abort_due_to_error
  95115 __766:
  95116 	;
  95117 	if !(*(*int32)(unsafe.Pointer(bp + 696)) == 0) {
  95118 		goto __767
  95119 	}
  95120 	rc = Xsqlite3BtreeDelete(tls, pCrsr7, uint8(BTREE_AUXDELETE))
  95121 	if !(rc != 0) {
  95122 		goto __769
  95123 	}
  95124 	goto abort_due_to_error
  95125 __769:
  95126 	;
  95127 	goto __768
  95128 __767:
  95129 	if !((*Op)(unsafe.Pointer(pOp)).Fp5 != 0 && !(Xsqlite3WritableSchema(tls, db) != 0)) {
  95130 		goto __770
  95131 	}
  95132 	rc = Xsqlite3ReportError(tls, SQLITE_CORRUPT|int32(3)<<8, 96638, ts+7218)
  95133 	goto abort_due_to_error
  95134 __770:
  95135 	;
  95136 __768:
  95137 	;
  95138 	(*VdbeCursor)(unsafe.Pointer(pC25)).FcacheStatus = U32(CACHE_STALE)
  95139 	(*VdbeCursor)(unsafe.Pointer(pC25)).FseekResult = 0
  95140 	goto __9
  95141 
  95142 __129:
  95143 __130:
  95144 	;
  95145 	pC26 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  95146 
  95147 	rc = Xsqlite3VdbeCursorRestore(tls, pC26)
  95148 
  95149 	if !(rc != SQLITE_OK) {
  95150 		goto __771
  95151 	}
  95152 	goto abort_due_to_error
  95153 __771:
  95154 	;
  95155 	if !!(int32((*VdbeCursor)(unsafe.Pointer(pC26)).FnullRow) != 0) {
  95156 		goto __772
  95157 	}
  95158 	*(*I64)(unsafe.Pointer(bp + 704)) = int64(0)
  95159 	rc = Xsqlite3VdbeIdxRowid(tls, db, *(*uintptr)(unsafe.Pointer(pC26 + 48)), bp+704)
  95160 	if !(rc != SQLITE_OK) {
  95161 		goto __774
  95162 	}
  95163 	goto abort_due_to_error
  95164 __774:
  95165 	;
  95166 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_DeferredSeek) {
  95167 		goto __775
  95168 	}
  95169 
  95170 	pTabCur = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*8))
  95171 
  95172 	(*VdbeCursor)(unsafe.Pointer(pTabCur)).FnullRow = U8(0)
  95173 	(*VdbeCursor)(unsafe.Pointer(pTabCur)).FmovetoTarget = *(*I64)(unsafe.Pointer(bp + 704))
  95174 	(*VdbeCursor)(unsafe.Pointer(pTabCur)).FdeferredMoveto = U8(1)
  95175 	(*VdbeCursor)(unsafe.Pointer(pTabCur)).FcacheStatus = U32(CACHE_STALE)
  95176 
  95177 	*(*uintptr)(unsafe.Pointer(pTabCur + 16)) = *(*uintptr)(unsafe.Pointer(pOp + 16))
  95178 
  95179 	(*VdbeCursor)(unsafe.Pointer(pTabCur)).FpAltCursor = pC26
  95180 	goto __776
  95181 __775:
  95182 	pOut = out2Prerelease(tls, p, pOp)
  95183 	*(*I64)(unsafe.Pointer(pOut)) = *(*I64)(unsafe.Pointer(bp + 704))
  95184 __776:
  95185 	;
  95186 	goto __773
  95187 __772:
  95188 	;
  95189 	Xsqlite3VdbeMemSetNull(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)
  95190 __773:
  95191 	;
  95192 	goto __9
  95193 
  95194 __131:
  95195 	;
  95196 	pC27 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  95197 	if !((*VdbeCursor)(unsafe.Pointer(pC27)).FdeferredMoveto != 0) {
  95198 		goto __777
  95199 	}
  95200 	rc = Xsqlite3VdbeFinishMoveto(tls, pC27)
  95201 	if !(rc != 0) {
  95202 		goto __778
  95203 	}
  95204 	goto abort_due_to_error
  95205 __778:
  95206 	;
  95207 __777:
  95208 	;
  95209 	goto __9
  95210 
  95211 __132:
  95212 __133:
  95213 __134:
  95214 __135:
  95215 	;
  95216 	pC28 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  95217 
  95218 	(*UnpackedRecord)(unsafe.Pointer(bp + 768)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC28)).FpKeyInfo
  95219 	(*UnpackedRecord)(unsafe.Pointer(bp + 768)).FnField = U16(*(*int32)(unsafe.Pointer(pOp + 16)))
  95220 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) < OP_IdxLT) {
  95221 		goto __779
  95222 	}
  95223 
  95224 	(*UnpackedRecord)(unsafe.Pointer(bp + 768)).Fdefault_rc = int8(-1)
  95225 	goto __780
  95226 __779:
  95227 	;
  95228 	(*UnpackedRecord)(unsafe.Pointer(bp + 768)).Fdefault_rc = int8(0)
  95229 __780:
  95230 	;
  95231 	(*UnpackedRecord)(unsafe.Pointer(bp + 768)).FaMem = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  95232 
  95233 	nCellKey = int64(0)
  95234 
  95235 	pCur2 = *(*uintptr)(unsafe.Pointer(pC28 + 48))
  95236 
  95237 	nCellKey = I64(Xsqlite3BtreePayloadSize(tls, pCur2))
  95238 
  95239 	if !(nCellKey <= int64(0) || nCellKey > int64(0x7fffffff)) {
  95240 		goto __781
  95241 	}
  95242 	rc = Xsqlite3CorruptError(tls, 96843)
  95243 	goto abort_due_to_error
  95244 __781:
  95245 	;
  95246 	Xsqlite3VdbeMemInit(tls, bp+712, db, uint16(0))
  95247 	rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, pCur2, U32(nCellKey), bp+712)
  95248 	if !(rc != 0) {
  95249 		goto __782
  95250 	}
  95251 	goto abort_due_to_error
  95252 __782:
  95253 	;
  95254 	res11 = Xsqlite3VdbeRecordCompareWithSkip(tls, (*Mem)(unsafe.Pointer(bp+712)).Fn, (*Mem)(unsafe.Pointer(bp+712)).Fz, bp+768, 0)
  95255 	Xsqlite3VdbeMemReleaseMalloc(tls, bp+712)
  95256 
  95257 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode)&1 == OP_IdxLT&1) {
  95258 		goto __783
  95259 	}
  95260 
  95261 	res11 = -res11
  95262 	goto __784
  95263 __783:
  95264 	;
  95265 	res11++
  95266 __784:
  95267 	;
  95268 	if !(res11 > 0) {
  95269 		goto __785
  95270 	}
  95271 	goto jump_to_p2
  95272 __785:
  95273 	;
  95274 	goto __9
  95275 
  95276 __136:
  95277 	;
  95278 	pOut = out2Prerelease(tls, p, pOp)
  95279 	(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null)
  95280 	if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead > (*Sqlite3)(unsafe.Pointer(db)).FnVDestroy+1) {
  95281 		goto __786
  95282 	}
  95283 	rc = SQLITE_LOCKED
  95284 	(*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8(OE_Abort)
  95285 	goto abort_due_to_error
  95286 	goto __787
  95287 __786:
  95288 	iDb2 = (*Op)(unsafe.Pointer(pOp)).Fp3
  95289 
  95290 	*(*int32)(unsafe.Pointer(bp + 808)) = 0
  95291 	rc = Xsqlite3BtreeDropTable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb2)*32)).FpBt, (*Op)(unsafe.Pointer(pOp)).Fp1, bp+808)
  95292 	(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int)
  95293 	*(*I64)(unsafe.Pointer(pOut)) = I64(*(*int32)(unsafe.Pointer(bp + 808)))
  95294 	if !(rc != 0) {
  95295 		goto __788
  95296 	}
  95297 	goto abort_due_to_error
  95298 __788:
  95299 	;
  95300 	if !(*(*int32)(unsafe.Pointer(bp + 808)) != 0) {
  95301 		goto __789
  95302 	}
  95303 	Xsqlite3RootPageMoved(tls, db, iDb2, uint32(*(*int32)(unsafe.Pointer(bp + 808))), uint32((*Op)(unsafe.Pointer(pOp)).Fp1))
  95304 
  95305 	resetSchemaOnFault = U8(iDb2 + 1)
  95306 __789:
  95307 	;
  95308 __787:
  95309 	;
  95310 	goto __9
  95311 
  95312 __137:
  95313 	;
  95314 	*(*I64)(unsafe.Pointer(bp + 816)) = int64(0)
  95315 
  95316 	rc = Xsqlite3BtreeClearTable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*32)).FpBt, int32(U32((*Op)(unsafe.Pointer(pOp)).Fp1)), bp+816)
  95317 	if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) {
  95318 		goto __790
  95319 	}
  95320 	*(*I64)(unsafe.Pointer(p + 56)) += *(*I64)(unsafe.Pointer(bp + 816))
  95321 	if !((*Op)(unsafe.Pointer(pOp)).Fp3 > 0) {
  95322 		goto __791
  95323 	}
  95324 
  95325 	*(*I64)(unsafe.Pointer(aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)) += *(*I64)(unsafe.Pointer(bp + 816))
  95326 __791:
  95327 	;
  95328 __790:
  95329 	;
  95330 	if !(rc != 0) {
  95331 		goto __792
  95332 	}
  95333 	goto abort_due_to_error
  95334 __792:
  95335 	;
  95336 	goto __9
  95337 
  95338 __138:
  95339 	;
  95340 	pC29 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  95341 
  95342 	if !(int32((*VdbeCursor)(unsafe.Pointer(pC29)).FeCurType) == CURTYPE_SORTER) {
  95343 		goto __793
  95344 	}
  95345 	Xsqlite3VdbeSorterReset(tls, db, *(*uintptr)(unsafe.Pointer(pC29 + 48)))
  95346 	goto __794
  95347 __793:
  95348 	;
  95349 	rc = Xsqlite3BtreeClearTableOfCursor(tls, *(*uintptr)(unsafe.Pointer(pC29 + 48)))
  95350 	if !(rc != 0) {
  95351 		goto __795
  95352 	}
  95353 	goto abort_due_to_error
  95354 __795:
  95355 	;
  95356 __794:
  95357 	;
  95358 	goto __9
  95359 
  95360 __139:
  95361 	;
  95362 	pOut = out2Prerelease(tls, p, pOp)
  95363 	*(*Pgno)(unsafe.Pointer(bp + 824)) = Pgno(0)
  95364 
  95365 	pDb3 = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32
  95366 
  95367 	rc = Xsqlite3BtreeCreateTable(tls, (*Db)(unsafe.Pointer(pDb3)).FpBt, bp+824, (*Op)(unsafe.Pointer(pOp)).Fp3)
  95368 	if !(rc != 0) {
  95369 		goto __796
  95370 	}
  95371 	goto abort_due_to_error
  95372 __796:
  95373 	;
  95374 	*(*I64)(unsafe.Pointer(pOut)) = I64(*(*Pgno)(unsafe.Pointer(bp + 824)))
  95375 	goto __9
  95376 
  95377 __140:
  95378 	;
  95379 	(*Sqlite3)(unsafe.Pointer(db)).FnSqlExec++
  95380 	rc = Xsqlite3_exec(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16)), uintptr(0), uintptr(0), uintptr(0))
  95381 	(*Sqlite3)(unsafe.Pointer(db)).FnSqlExec--
  95382 	if !(rc != 0) {
  95383 		goto __797
  95384 	}
  95385 	goto abort_due_to_error
  95386 __797:
  95387 	;
  95388 	goto __9
  95389 
  95390 __141:
  95391 	iDb3 = (*Op)(unsafe.Pointer(pOp)).Fp1
  95392 
  95393 	if !(*(*uintptr)(unsafe.Pointer(pOp + 16)) == uintptr(0)) {
  95394 		goto __798
  95395 	}
  95396 	Xsqlite3SchemaClear(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb3)*32)).FpSchema)
  95397 	*(*U32)(unsafe.Pointer(db + 44)) &= libc.Uint32FromInt32(libc.CplInt32(DBFLAG_SchemaKnownOk))
  95398 	rc = Xsqlite3InitOne(tls, db, iDb3, p+168, uint32((*Op)(unsafe.Pointer(pOp)).Fp5))
  95399 	*(*U32)(unsafe.Pointer(db + 44)) |= U32(DBFLAG_SchemaChange)
  95400 	libc.SetBitFieldPtr8Uint32(p+200, Bft(0), 0, 0x3)
  95401 	goto __799
  95402 __798:
  95403 	zSchema = ts + 7235
  95404 	(*InitData)(unsafe.Pointer(bp + 832)).Fdb = db
  95405 	(*InitData)(unsafe.Pointer(bp + 832)).FiDb = iDb3
  95406 	(*InitData)(unsafe.Pointer(bp + 832)).FpzErrMsg = p + 168
  95407 	(*InitData)(unsafe.Pointer(bp + 832)).FmInitFlags = U32(0)
  95408 	(*InitData)(unsafe.Pointer(bp + 832)).FmxPage = Xsqlite3BtreeLastPage(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb3)*32)).FpBt)
  95409 	zSql = Xsqlite3MPrintf(tls, db,
  95410 		ts+7249,
  95411 		libc.VaList(bp+96, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb3)*32)).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16))))
  95412 	if !(zSql == uintptr(0)) {
  95413 		goto __800
  95414 	}
  95415 	rc = SQLITE_NOMEM
  95416 	goto __801
  95417 __800:
  95418 	;
  95419 	(*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(1)
  95420 	(*InitData)(unsafe.Pointer(bp + 832)).Frc = SQLITE_OK
  95421 	(*InitData)(unsafe.Pointer(bp + 832)).FnInitRow = U32(0)
  95422 
  95423 	rc = Xsqlite3_exec(tls, db, zSql, *(*uintptr)(unsafe.Pointer(&struct {
  95424 		f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
  95425 	}{Xsqlite3InitCallback})), bp+832, uintptr(0))
  95426 	if !(rc == SQLITE_OK) {
  95427 		goto __802
  95428 	}
  95429 	rc = (*InitData)(unsafe.Pointer(bp + 832)).Frc
  95430 __802:
  95431 	;
  95432 	if !(rc == SQLITE_OK && (*InitData)(unsafe.Pointer(bp+832)).FnInitRow == U32(0)) {
  95433 		goto __803
  95434 	}
  95435 
  95436 	rc = Xsqlite3CorruptError(tls, 97095)
  95437 __803:
  95438 	;
  95439 	Xsqlite3DbFreeNN(tls, db, zSql)
  95440 	(*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(0)
  95441 __801:
  95442 	;
  95443 __799:
  95444 	;
  95445 	if !(rc != 0) {
  95446 		goto __804
  95447 	}
  95448 	Xsqlite3ResetAllSchemasOfConnection(tls, db)
  95449 	if !(rc == SQLITE_NOMEM) {
  95450 		goto __805
  95451 	}
  95452 	goto no_mem
  95453 __805:
  95454 	;
  95455 	goto abort_due_to_error
  95456 __804:
  95457 	;
  95458 	goto __9
  95459 
  95460 __142:
  95461 	;
  95462 	rc = Xsqlite3AnalysisLoad(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1)
  95463 	if !(rc != 0) {
  95464 		goto __806
  95465 	}
  95466 	goto abort_due_to_error
  95467 __806:
  95468 	;
  95469 	goto __9
  95470 
  95471 __143:
  95472 	;
  95473 	Xsqlite3UnlinkAndDeleteTable(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16)))
  95474 	goto __9
  95475 
  95476 __144:
  95477 	;
  95478 	Xsqlite3UnlinkAndDeleteIndex(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16)))
  95479 	goto __9
  95480 
  95481 __145:
  95482 	;
  95483 	Xsqlite3UnlinkAndDeleteTrigger(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16)))
  95484 	goto __9
  95485 
  95486 __146:
  95487 	;
  95488 	nRoot = (*Op)(unsafe.Pointer(pOp)).Fp2
  95489 	aRoot = *(*uintptr)(unsafe.Pointer(pOp + 16))
  95490 
  95491 	pnErr = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  95492 
  95493 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  95494 
  95495 	rc = Xsqlite3BtreeIntegrityCheck(tls, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp5)*32)).FpBt, aRoot+1*4, nRoot,
  95496 		int32(*(*I64)(unsafe.Pointer(pnErr)))+1, bp+872, bp+880)
  95497 	Xsqlite3VdbeMemSetNull(tls, pIn1)
  95498 	if !(*(*int32)(unsafe.Pointer(bp + 872)) == 0) {
  95499 		goto __807
  95500 	}
  95501 
  95502 	goto __808
  95503 __807:
  95504 	if !(rc != 0) {
  95505 		goto __809
  95506 	}
  95507 	Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 880)))
  95508 	goto abort_due_to_error
  95509 	goto __810
  95510 __809:
  95511 	*(*I64)(unsafe.Pointer(pnErr)) -= I64(*(*int32)(unsafe.Pointer(bp + 872)) - 1)
  95512 	Xsqlite3VdbeMemSetStr(tls, pIn1, *(*uintptr)(unsafe.Pointer(bp + 880)), int64(-1), uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
  95513 __810:
  95514 	;
  95515 __808:
  95516 	;
  95517 	Xsqlite3VdbeChangeEncoding(tls, pIn1, int32(encoding))
  95518 	goto check_for_interrupt
  95519 
  95520 __147:
  95521 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  95522 	pIn2 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56
  95523 
  95524 	if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Blob == 0) {
  95525 		goto __811
  95526 	}
  95527 	if !(Xsqlite3VdbeMemSetRowSet(tls, pIn1) != 0) {
  95528 		goto __812
  95529 	}
  95530 	goto no_mem
  95531 __812:
  95532 	;
  95533 __811:
  95534 	;
  95535 	Xsqlite3RowSetInsert(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, *(*I64)(unsafe.Pointer(pIn2)))
  95536 	goto __9
  95537 
  95538 __148:
  95539 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  95540 
  95541 	if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Blob == 0 ||
  95542 		Xsqlite3RowSetNext(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, bp+888) == 0) {
  95543 		goto __813
  95544 	}
  95545 
  95546 	Xsqlite3VdbeMemSetNull(tls, pIn1)
  95547 
  95548 	goto jump_to_p2_and_check_for_interrupt
  95549 	goto __814
  95550 __813:
  95551 	;
  95552 	Xsqlite3VdbeMemSetInt64(tls, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56, *(*I64)(unsafe.Pointer(bp + 888)))
  95553 __814:
  95554 	;
  95555 	goto check_for_interrupt
  95556 
  95557 __149:
  95558 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  95559 	pIn3 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  95560 	iSet = *(*int32)(unsafe.Pointer(pOp + 16))
  95561 
  95562 	if !(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags)&MEM_Blob == 0) {
  95563 		goto __815
  95564 	}
  95565 	if !(Xsqlite3VdbeMemSetRowSet(tls, pIn1) != 0) {
  95566 		goto __816
  95567 	}
  95568 	goto no_mem
  95569 __816:
  95570 	;
  95571 __815:
  95572 	;
  95573 	if !(iSet != 0) {
  95574 		goto __817
  95575 	}
  95576 	exists = Xsqlite3RowSetTest(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, iSet, *(*I64)(unsafe.Pointer(pIn3)))
  95577 
  95578 	if !(exists != 0) {
  95579 		goto __818
  95580 	}
  95581 	goto jump_to_p2
  95582 __818:
  95583 	;
  95584 __817:
  95585 	;
  95586 	if !(iSet >= 0) {
  95587 		goto __819
  95588 	}
  95589 	Xsqlite3RowSetInsert(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, *(*I64)(unsafe.Pointer(pIn3)))
  95590 __819:
  95591 	;
  95592 	goto __9
  95593 
  95594 __150:
  95595 	pProgram = *(*uintptr)(unsafe.Pointer(pOp + 16))
  95596 	pRt = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  95597 
  95598 	if !((*Op)(unsafe.Pointer(pOp)).Fp5 != 0) {
  95599 		goto __820
  95600 	}
  95601 	t1 = (*SubProgram)(unsafe.Pointer(pProgram)).Ftoken
  95602 	pFrame2 = (*Vdbe)(unsafe.Pointer(p)).FpFrame
  95603 __821:
  95604 	if !(pFrame2 != 0 && (*VdbeFrame)(unsafe.Pointer(pFrame2)).Ftoken != t1) {
  95605 		goto __823
  95606 	}
  95607 	goto __822
  95608 __822:
  95609 	pFrame2 = (*VdbeFrame)(unsafe.Pointer(pFrame2)).FpParent
  95610 	goto __821
  95611 	goto __823
  95612 __823:
  95613 	;
  95614 	if !(pFrame2 != 0) {
  95615 		goto __824
  95616 	}
  95617 	goto __9
  95618 __824:
  95619 	;
  95620 __820:
  95621 	;
  95622 	if !((*Vdbe)(unsafe.Pointer(p)).FnFrame >= *(*int32)(unsafe.Pointer(db + 136 + 10*4))) {
  95623 		goto __825
  95624 	}
  95625 	rc = SQLITE_ERROR
  95626 	Xsqlite3VdbeError(tls, p, ts+7292, 0)
  95627 	goto abort_due_to_error
  95628 __825:
  95629 	;
  95630 	if !(int32((*Mem)(unsafe.Pointer(pRt)).Fflags)&MEM_Blob == 0) {
  95631 		goto __826
  95632 	}
  95633 
  95634 	nMem = (*SubProgram)(unsafe.Pointer(pProgram)).FnMem + (*SubProgram)(unsafe.Pointer(pProgram)).FnCsr
  95635 
  95636 	if !((*SubProgram)(unsafe.Pointer(pProgram)).FnCsr == 0) {
  95637 		goto __828
  95638 	}
  95639 	nMem++
  95640 __828:
  95641 	;
  95642 	nByte2 = int32((uint64(unsafe.Sizeof(VdbeFrame{}))+uint64(7))&libc.Uint64FromInt32(libc.CplInt32(7)) +
  95643 		uint64(nMem)*uint64(unsafe.Sizeof(Mem{})) +
  95644 		uint64((*SubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(unsafe.Sizeof(uintptr(0))) +
  95645 		uint64(((*SubProgram)(unsafe.Pointer(pProgram)).FnOp+7)/8))
  95646 	pFrame2 = Xsqlite3DbMallocZero(tls, db, uint64(nByte2))
  95647 	if !!(pFrame2 != 0) {
  95648 		goto __829
  95649 	}
  95650 	goto no_mem
  95651 __829:
  95652 	;
  95653 	Xsqlite3VdbeMemRelease(tls, pRt)
  95654 	(*Mem)(unsafe.Pointer(pRt)).Fflags = U16(MEM_Blob | MEM_Dyn)
  95655 	(*Mem)(unsafe.Pointer(pRt)).Fz = pFrame2
  95656 	(*Mem)(unsafe.Pointer(pRt)).Fn = nByte2
  95657 	(*Mem)(unsafe.Pointer(pRt)).FxDel = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3VdbeFrameMemDel}))
  95658 
  95659 	(*VdbeFrame)(unsafe.Pointer(pFrame2)).Fv = p
  95660 	(*VdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem = nMem
  95661 	(*VdbeFrame)(unsafe.Pointer(pFrame2)).FnChildCsr = (*SubProgram)(unsafe.Pointer(pProgram)).FnCsr
  95662 	(*VdbeFrame)(unsafe.Pointer(pFrame2)).Fpc = int32((int64(pOp) - int64(aOp)) / 24)
  95663 	(*VdbeFrame)(unsafe.Pointer(pFrame2)).FaMem = (*Vdbe)(unsafe.Pointer(p)).FaMem
  95664 	(*VdbeFrame)(unsafe.Pointer(pFrame2)).FnMem = (*Vdbe)(unsafe.Pointer(p)).FnMem
  95665 	(*VdbeFrame)(unsafe.Pointer(pFrame2)).FapCsr = (*Vdbe)(unsafe.Pointer(p)).FapCsr
  95666 	(*VdbeFrame)(unsafe.Pointer(pFrame2)).FnCursor = (*Vdbe)(unsafe.Pointer(p)).FnCursor
  95667 	(*VdbeFrame)(unsafe.Pointer(pFrame2)).FaOp = (*Vdbe)(unsafe.Pointer(p)).FaOp
  95668 	(*VdbeFrame)(unsafe.Pointer(pFrame2)).FnOp = (*Vdbe)(unsafe.Pointer(p)).FnOp
  95669 	(*VdbeFrame)(unsafe.Pointer(pFrame2)).Ftoken = (*SubProgram)(unsafe.Pointer(pProgram)).Ftoken
  95670 
  95671 	pEnd = pFrame2 + 112 + uintptr((*VdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem)*56
  95672 	pMem1 = pFrame2 + 112
  95673 __830:
  95674 	if !(pMem1 != pEnd) {
  95675 		goto __832
  95676 	}
  95677 	(*Mem)(unsafe.Pointer(pMem1)).Fflags = U16(MEM_Undefined)
  95678 	(*Mem)(unsafe.Pointer(pMem1)).Fdb = db
  95679 	goto __831
  95680 __831:
  95681 	pMem1 += 56
  95682 	goto __830
  95683 	goto __832
  95684 __832:
  95685 	;
  95686 	goto __827
  95687 __826:
  95688 	pFrame2 = (*Mem)(unsafe.Pointer(pRt)).Fz
  95689 
  95690 __827:
  95691 	;
  95692 	(*Vdbe)(unsafe.Pointer(p)).FnFrame++
  95693 	(*VdbeFrame)(unsafe.Pointer(pFrame2)).FpParent = (*Vdbe)(unsafe.Pointer(p)).FpFrame
  95694 	(*VdbeFrame)(unsafe.Pointer(pFrame2)).FlastRowid = (*Sqlite3)(unsafe.Pointer(db)).FlastRowid
  95695 	(*VdbeFrame)(unsafe.Pointer(pFrame2)).FnChange = (*Vdbe)(unsafe.Pointer(p)).FnChange
  95696 	(*VdbeFrame)(unsafe.Pointer(pFrame2)).FnDbChange = (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FnChange
  95697 
  95698 	(*VdbeFrame)(unsafe.Pointer(pFrame2)).FpAuxData = (*Vdbe)(unsafe.Pointer(p)).FpAuxData
  95699 	(*Vdbe)(unsafe.Pointer(p)).FpAuxData = uintptr(0)
  95700 	(*Vdbe)(unsafe.Pointer(p)).FnChange = int64(0)
  95701 	(*Vdbe)(unsafe.Pointer(p)).FpFrame = pFrame2
  95702 	(*Vdbe)(unsafe.Pointer(p)).FaMem = libc.AssignUintptr(&aMem, pFrame2+112)
  95703 	(*Vdbe)(unsafe.Pointer(p)).FnMem = (*VdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem
  95704 	(*Vdbe)(unsafe.Pointer(p)).FnCursor = int32(U16((*VdbeFrame)(unsafe.Pointer(pFrame2)).FnChildCsr))
  95705 	(*Vdbe)(unsafe.Pointer(p)).FapCsr = aMem + uintptr((*Vdbe)(unsafe.Pointer(p)).FnMem)*56
  95706 	(*VdbeFrame)(unsafe.Pointer(pFrame2)).FaOnce = (*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*SubProgram)(unsafe.Pointer(pProgram)).FnCsr)*8
  95707 	libc.Xmemset(tls, (*VdbeFrame)(unsafe.Pointer(pFrame2)).FaOnce, 0, uint64(((*SubProgram)(unsafe.Pointer(pProgram)).FnOp+7)/8))
  95708 	(*Vdbe)(unsafe.Pointer(p)).FaOp = libc.AssignUintptr(&aOp, (*SubProgram)(unsafe.Pointer(pProgram)).FaOp)
  95709 	(*Vdbe)(unsafe.Pointer(p)).FnOp = (*SubProgram)(unsafe.Pointer(pProgram)).FnOp
  95710 	pOp = aOp + libc.UintptrFromInt32(-1)*24
  95711 	goto check_for_interrupt
  95712 
  95713 __151:
  95714 	pOut = out2Prerelease(tls, p, pOp)
  95715 	pFrame3 = (*Vdbe)(unsafe.Pointer(p)).FpFrame
  95716 	pIn = (*VdbeFrame)(unsafe.Pointer(pFrame3)).FaMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1+(*Op)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer(pFrame3)).FaOp+uintptr((*VdbeFrame)(unsafe.Pointer(pFrame3)).Fpc)*24)).Fp1)*56
  95717 	Xsqlite3VdbeMemShallowCopy(tls, pOut, pIn, MEM_Ephem)
  95718 	goto __9
  95719 
  95720 __152:
  95721 	if !((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0) {
  95722 		goto __833
  95723 	}
  95724 	*(*I64)(unsafe.Pointer(db + 792)) += I64((*Op)(unsafe.Pointer(pOp)).Fp2)
  95725 	goto __834
  95726 __833:
  95727 	if !((*Op)(unsafe.Pointer(pOp)).Fp1 != 0) {
  95728 		goto __835
  95729 	}
  95730 	*(*I64)(unsafe.Pointer(db + 784)) += I64((*Op)(unsafe.Pointer(pOp)).Fp2)
  95731 	goto __836
  95732 __835:
  95733 	*(*I64)(unsafe.Pointer(p + 80)) += I64((*Op)(unsafe.Pointer(pOp)).Fp2)
  95734 __836:
  95735 	;
  95736 __834:
  95737 	;
  95738 	goto __9
  95739 
  95740 __153:
  95741 	if !((*Op)(unsafe.Pointer(pOp)).Fp1 != 0) {
  95742 		goto __837
  95743 	}
  95744 
  95745 	if !((*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons == int64(0) && (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons == int64(0)) {
  95746 		goto __839
  95747 	}
  95748 	goto jump_to_p2
  95749 __839:
  95750 	;
  95751 	goto __838
  95752 __837:
  95753 	;
  95754 	if !((*Vdbe)(unsafe.Pointer(p)).FnFkConstraint == int64(0) && (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons == int64(0)) {
  95755 		goto __840
  95756 	}
  95757 	goto jump_to_p2
  95758 __840:
  95759 	;
  95760 __838:
  95761 	;
  95762 	goto __9
  95763 
  95764 __154:
  95765 	if !((*Vdbe)(unsafe.Pointer(p)).FpFrame != 0) {
  95766 		goto __841
  95767 	}
  95768 	pFrame4 = (*Vdbe)(unsafe.Pointer(p)).FpFrame
  95769 __843:
  95770 	if !((*VdbeFrame)(unsafe.Pointer(pFrame4)).FpParent != 0) {
  95771 		goto __845
  95772 	}
  95773 	goto __844
  95774 __844:
  95775 	pFrame4 = (*VdbeFrame)(unsafe.Pointer(pFrame4)).FpParent
  95776 	goto __843
  95777 	goto __845
  95778 __845:
  95779 	;
  95780 	pIn1 = (*VdbeFrame)(unsafe.Pointer(pFrame4)).FaMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  95781 	goto __842
  95782 __841:
  95783 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  95784 __842:
  95785 	;
  95786 	Xsqlite3VdbeMemIntegerify(tls, pIn1)
  95787 	pIn2 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56
  95788 	Xsqlite3VdbeMemIntegerify(tls, pIn2)
  95789 	if !(*(*I64)(unsafe.Pointer(pIn1)) < *(*I64)(unsafe.Pointer(pIn2))) {
  95790 		goto __846
  95791 	}
  95792 	*(*I64)(unsafe.Pointer(pIn1)) = *(*I64)(unsafe.Pointer(pIn2))
  95793 __846:
  95794 	;
  95795 	goto __9
  95796 
  95797 __155:
  95798 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  95799 
  95800 	if !(*(*I64)(unsafe.Pointer(pIn1)) > int64(0)) {
  95801 		goto __847
  95802 	}
  95803 	*(*I64)(unsafe.Pointer(pIn1)) -= I64((*Op)(unsafe.Pointer(pOp)).Fp3)
  95804 	goto jump_to_p2
  95805 __847:
  95806 	;
  95807 	goto __9
  95808 
  95809 __156:
  95810 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  95811 	pIn3 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  95812 	pOut = out2Prerelease(tls, p, pOp)
  95813 
  95814 	*(*I64)(unsafe.Pointer(bp + 896)) = *(*I64)(unsafe.Pointer(pIn1))
  95815 	if !(*(*I64)(unsafe.Pointer(bp + 896)) <= int64(0) || Xsqlite3AddInt64(tls, bp+896, func() int64 {
  95816 		if *(*I64)(unsafe.Pointer(pIn3)) > int64(0) {
  95817 			return *(*I64)(unsafe.Pointer(pIn3))
  95818 		}
  95819 		return int64(0)
  95820 	}()) != 0) {
  95821 		goto __848
  95822 	}
  95823 
  95824 	*(*I64)(unsafe.Pointer(pOut)) = int64(-1)
  95825 	goto __849
  95826 __848:
  95827 	*(*I64)(unsafe.Pointer(pOut)) = *(*I64)(unsafe.Pointer(bp + 896))
  95828 __849:
  95829 	;
  95830 	goto __9
  95831 
  95832 __157:
  95833 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  95834 
  95835 	if !(*(*I64)(unsafe.Pointer(pIn1)) != 0) {
  95836 		goto __850
  95837 	}
  95838 	if !(*(*I64)(unsafe.Pointer(pIn1)) > int64(0)) {
  95839 		goto __851
  95840 	}
  95841 	*(*I64)(unsafe.Pointer(pIn1))--
  95842 __851:
  95843 	;
  95844 	goto jump_to_p2
  95845 __850:
  95846 	;
  95847 	goto __9
  95848 
  95849 __158:
  95850 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  95851 
  95852 	if !(*(*I64)(unsafe.Pointer(pIn1)) > int64(-1)-(int64(0xffffffff)|int64(0x7fffffff)<<32)) {
  95853 		goto __852
  95854 	}
  95855 	*(*I64)(unsafe.Pointer(pIn1))--
  95856 __852:
  95857 	;
  95858 	if !(*(*I64)(unsafe.Pointer(pIn1)) == int64(0)) {
  95859 		goto __853
  95860 	}
  95861 	goto jump_to_p2
  95862 __853:
  95863 	;
  95864 	goto __9
  95865 
  95866 __159:
  95867 __160:
  95868 	;
  95869 	n4 = int32((*Op)(unsafe.Pointer(pOp)).Fp5)
  95870 
  95871 	pCtx = Xsqlite3DbMallocRawNN(tls, db, uint64(n4)*uint64(unsafe.Sizeof(uintptr(0)))+(uint64(unsafe.Sizeof(Sqlite3_context{}))+uint64(unsafe.Sizeof(Mem{}))-uint64(unsafe.Sizeof(uintptr(0)))))
  95872 	if !(pCtx == uintptr(0)) {
  95873 		goto __854
  95874 	}
  95875 	goto no_mem
  95876 __854:
  95877 	;
  95878 	(*Sqlite3_context)(unsafe.Pointer(pCtx)).FpMem = uintptr(0)
  95879 	(*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut = pCtx + 48 + uintptr(n4)*8
  95880 	Xsqlite3VdbeMemInit(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, db, uint16(MEM_Null))
  95881 	(*Sqlite3_context)(unsafe.Pointer(pCtx)).FpFunc = *(*uintptr)(unsafe.Pointer(pOp + 16))
  95882 	(*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp = int32((int64(pOp) - int64(aOp)) / 24)
  95883 	(*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe = p
  95884 	(*Sqlite3_context)(unsafe.Pointer(pCtx)).FskipFlag = U8(0)
  95885 	(*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = 0
  95886 	(*Sqlite3_context)(unsafe.Pointer(pCtx)).Fenc = encoding
  95887 	(*Sqlite3_context)(unsafe.Pointer(pCtx)).Fargc = U8(n4)
  95888 	(*Op)(unsafe.Pointer(pOp)).Fp4type = int8(-15)
  95889 	*(*uintptr)(unsafe.Pointer(pOp + 16)) = pCtx
  95890 
  95891 	(*Op)(unsafe.Pointer(pOp)).Fopcode = U8(OP_AggStep1)
  95892 
  95893 __161:
  95894 	;
  95895 	pCtx1 = *(*uintptr)(unsafe.Pointer(pOp + 16))
  95896 	pMem2 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  95897 
  95898 	if !((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpMem != pMem2) {
  95899 		goto __855
  95900 	}
  95901 	(*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpMem = pMem2
  95902 	i5 = int32((*Sqlite3_context)(unsafe.Pointer(pCtx1)).Fargc) - 1
  95903 __856:
  95904 	if !(i5 >= 0) {
  95905 		goto __858
  95906 	}
  95907 	*(*uintptr)(unsafe.Pointer(pCtx1 + 48 + uintptr(i5)*8)) = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2+i5)*56
  95908 	goto __857
  95909 __857:
  95910 	i5--
  95911 	goto __856
  95912 	goto __858
  95913 __858:
  95914 	;
  95915 __855:
  95916 	;
  95917 	(*Mem)(unsafe.Pointer(pMem2)).Fn++
  95918 
  95919 	if !((*Op)(unsafe.Pointer(pOp)).Fp1 != 0) {
  95920 		goto __859
  95921 	}
  95922 	(*struct {
  95923 		f func(*libc.TLS, uintptr, int32, uintptr)
  95924 	})(unsafe.Pointer(&struct{ uintptr }{(*FuncDef)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpFunc)).FxInverse})).f(tls, pCtx1, int32((*Sqlite3_context)(unsafe.Pointer(pCtx1)).Fargc), pCtx1+48)
  95925 	goto __860
  95926 __859:
  95927 	(*struct {
  95928 		f func(*libc.TLS, uintptr, int32, uintptr)
  95929 	})(unsafe.Pointer(&struct{ uintptr }{(*FuncDef)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpFunc)).FxSFunc})).f(tls, pCtx1, int32((*Sqlite3_context)(unsafe.Pointer(pCtx1)).Fargc), pCtx1+48)
  95930 __860:
  95931 	;
  95932 	if !((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FisError != 0) {
  95933 		goto __861
  95934 	}
  95935 	if !((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FisError > 0) {
  95936 		goto __862
  95937 	}
  95938 	Xsqlite3VdbeError(tls, p, ts+4493, libc.VaList(bp+120, Xsqlite3_value_text(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut)))
  95939 	rc = (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FisError
  95940 __862:
  95941 	;
  95942 	if !((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag != 0) {
  95943 		goto __863
  95944 	}
  95945 
  95946 	i5 = (*Op)(unsafe.Pointer(pOp + libc.UintptrFromInt32(-1)*24)).Fp1
  95947 	if !(i5 != 0) {
  95948 		goto __864
  95949 	}
  95950 	Xsqlite3VdbeMemSetInt64(tls, aMem+uintptr(i5)*56, int64(1))
  95951 __864:
  95952 	;
  95953 	(*Sqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag = U8(0)
  95954 __863:
  95955 	;
  95956 	Xsqlite3VdbeMemRelease(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut)
  95957 	(*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut)).Fflags = U16(MEM_Null)
  95958 	(*Sqlite3_context)(unsafe.Pointer(pCtx1)).FisError = 0
  95959 	if !(rc != 0) {
  95960 		goto __865
  95961 	}
  95962 	goto abort_due_to_error
  95963 __865:
  95964 	;
  95965 __861:
  95966 	;
  95967 	goto __9
  95968 
  95969 __162:
  95970 __163:
  95971 	;
  95972 	pMem3 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  95973 
  95974 	if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) {
  95975 		goto __866
  95976 	}
  95977 
  95978 	rc = Xsqlite3VdbeMemAggValue(tls, pMem3, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56, *(*uintptr)(unsafe.Pointer(pOp + 16)))
  95979 	pMem3 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  95980 	goto __867
  95981 __866:
  95982 	rc = Xsqlite3VdbeMemFinalize(tls, pMem3, *(*uintptr)(unsafe.Pointer(pOp + 16)))
  95983 __867:
  95984 	;
  95985 	if !(rc != 0) {
  95986 		goto __868
  95987 	}
  95988 	Xsqlite3VdbeError(tls, p, ts+4493, libc.VaList(bp+128, Xsqlite3_value_text(tls, pMem3)))
  95989 	goto abort_due_to_error
  95990 __868:
  95991 	;
  95992 	Xsqlite3VdbeChangeEncoding(tls, pMem3, int32(encoding))
  95993 
  95994 	goto __9
  95995 
  95996 __164:
  95997 	;
  95998 	*(*int32)(unsafe.Pointer(bp + 904)) = 0
  95999 	*(*int32)(unsafe.Pointer(bp + 904 + 1*4)) = libc.AssignPtrInt32(bp+904+2*4, -1)
  96000 
  96001 	rc = Xsqlite3Checkpoint(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, bp+904+1*4, bp+904+2*4)
  96002 	if !(rc != 0) {
  96003 		goto __869
  96004 	}
  96005 	if !(rc != SQLITE_BUSY) {
  96006 		goto __870
  96007 	}
  96008 	goto abort_due_to_error
  96009 __870:
  96010 	;
  96011 	rc = SQLITE_OK
  96012 	*(*int32)(unsafe.Pointer(bp + 904)) = 1
  96013 __869:
  96014 	;
  96015 	i6 = 0
  96016 	pMem4 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  96017 __871:
  96018 	if !(i6 < 3) {
  96019 		goto __873
  96020 	}
  96021 	Xsqlite3VdbeMemSetInt64(tls, pMem4, I64(*(*int32)(unsafe.Pointer(bp + 904 + uintptr(i6)*4))))
  96022 	goto __872
  96023 __872:
  96024 	i6++
  96025 	pMem4 += 56
  96026 	goto __871
  96027 	goto __873
  96028 __873:
  96029 	;
  96030 	goto __9
  96031 
  96032 __165:
  96033 	pOut = out2Prerelease(tls, p, pOp)
  96034 	eNew = (*Op)(unsafe.Pointer(pOp)).Fp3
  96035 
  96036 	pBt1 = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpBt
  96037 	pPager = Xsqlite3BtreePager(tls, pBt1)
  96038 	eOld = Xsqlite3PagerGetJournalMode(tls, pPager)
  96039 	if !(eNew == -1) {
  96040 		goto __874
  96041 	}
  96042 	eNew = eOld
  96043 __874:
  96044 	;
  96045 	if !!(Xsqlite3PagerOkToChangeJournalMode(tls, pPager) != 0) {
  96046 		goto __875
  96047 	}
  96048 	eNew = eOld
  96049 __875:
  96050 	;
  96051 	zFilename = Xsqlite3PagerFilename(tls, pPager, 1)
  96052 
  96053 	if !(eNew == PAGER_JOURNALMODE_WAL &&
  96054 		(Xsqlite3Strlen30(tls, zFilename) == 0 ||
  96055 			!(Xsqlite3PagerWalSupported(tls, pPager) != 0))) {
  96056 		goto __876
  96057 	}
  96058 	eNew = eOld
  96059 __876:
  96060 	;
  96061 	if !(eNew != eOld &&
  96062 		(eOld == PAGER_JOURNALMODE_WAL || eNew == PAGER_JOURNALMODE_WAL)) {
  96063 		goto __877
  96064 	}
  96065 	if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0) || (*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead > 1) {
  96066 		goto __878
  96067 	}
  96068 	rc = SQLITE_ERROR
  96069 	Xsqlite3VdbeError(tls, p,
  96070 		ts+7329,
  96071 		libc.VaList(bp+136, func() uintptr {
  96072 			if eNew == PAGER_JOURNALMODE_WAL {
  96073 				return ts + 7381
  96074 			}
  96075 			return ts + 7386
  96076 		}()))
  96077 	goto abort_due_to_error
  96078 	goto __879
  96079 __878:
  96080 	if !(eOld == PAGER_JOURNALMODE_WAL) {
  96081 		goto __880
  96082 	}
  96083 
  96084 	rc = Xsqlite3PagerCloseWal(tls, pPager, db)
  96085 	if !(rc == SQLITE_OK) {
  96086 		goto __882
  96087 	}
  96088 	Xsqlite3PagerSetJournalMode(tls, pPager, eNew)
  96089 __882:
  96090 	;
  96091 	goto __881
  96092 __880:
  96093 	if !(eOld == PAGER_JOURNALMODE_MEMORY) {
  96094 		goto __883
  96095 	}
  96096 
  96097 	Xsqlite3PagerSetJournalMode(tls, pPager, PAGER_JOURNALMODE_OFF)
  96098 __883:
  96099 	;
  96100 __881:
  96101 	;
  96102 	if !(rc == SQLITE_OK) {
  96103 		goto __884
  96104 	}
  96105 	rc = Xsqlite3BtreeSetVersion(tls, pBt1, func() int32 {
  96106 		if eNew == PAGER_JOURNALMODE_WAL {
  96107 			return 2
  96108 		}
  96109 		return 1
  96110 	}())
  96111 __884:
  96112 	;
  96113 __879:
  96114 	;
  96115 __877:
  96116 	;
  96117 	if !(rc != 0) {
  96118 		goto __885
  96119 	}
  96120 	eNew = eOld
  96121 __885:
  96122 	;
  96123 	eNew = Xsqlite3PagerSetJournalMode(tls, pPager, eNew)
  96124 
  96125 	(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Str | MEM_Static | MEM_Term)
  96126 	(*Mem)(unsafe.Pointer(pOut)).Fz = Xsqlite3JournalModename(tls, eNew)
  96127 	(*Mem)(unsafe.Pointer(pOut)).Fn = Xsqlite3Strlen30(tls, (*Mem)(unsafe.Pointer(pOut)).Fz)
  96128 	(*Mem)(unsafe.Pointer(pOut)).Fenc = U8(SQLITE_UTF8)
  96129 	Xsqlite3VdbeChangeEncoding(tls, pOut, int32(encoding))
  96130 	if !(rc != 0) {
  96131 		goto __886
  96132 	}
  96133 	goto abort_due_to_error
  96134 __886:
  96135 	;
  96136 	goto __9
  96137 
  96138 __166:
  96139 	;
  96140 	rc = Xsqlite3RunVacuum(tls, p+168, db, (*Op)(unsafe.Pointer(pOp)).Fp1,
  96141 		func() uintptr {
  96142 			if (*Op)(unsafe.Pointer(pOp)).Fp2 != 0 {
  96143 				return aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56
  96144 			}
  96145 			return uintptr(0)
  96146 		}())
  96147 	if !(rc != 0) {
  96148 		goto __887
  96149 	}
  96150 	goto abort_due_to_error
  96151 __887:
  96152 	;
  96153 	goto __9
  96154 
  96155 __167:
  96156 	;
  96157 	pBt2 = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpBt
  96158 	rc = Xsqlite3BtreeIncrVacuum(tls, pBt2)
  96159 
  96160 	if !(rc != 0) {
  96161 		goto __888
  96162 	}
  96163 	if !(rc != SQLITE_DONE) {
  96164 		goto __889
  96165 	}
  96166 	goto abort_due_to_error
  96167 __889:
  96168 	;
  96169 	rc = SQLITE_OK
  96170 	goto jump_to_p2
  96171 __888:
  96172 	;
  96173 	goto __9
  96174 
  96175 __168:
  96176 	;
  96177 	if !!((*Op)(unsafe.Pointer(pOp)).Fp1 != 0) {
  96178 		goto __890
  96179 	}
  96180 	Xsqlite3ExpirePreparedStatements(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp2)
  96181 	goto __891
  96182 __890:
  96183 	libc.SetBitFieldPtr8Uint32(p+200, Bft((*Op)(unsafe.Pointer(pOp)).Fp2+1), 0, 0x3)
  96184 __891:
  96185 	;
  96186 	goto __9
  96187 
  96188 __169:
  96189 	;
  96190 	pC30 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  96191 
  96192 	Xsqlite3BtreeCursorPin(tls, *(*uintptr)(unsafe.Pointer(pC30 + 48)))
  96193 	goto __9
  96194 
  96195 __170:
  96196 	;
  96197 	pC31 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  96198 
  96199 	Xsqlite3BtreeCursorUnpin(tls, *(*uintptr)(unsafe.Pointer(pC31 + 48)))
  96200 	goto __9
  96201 
  96202 __171:
  96203 	isWriteLock = U8((*Op)(unsafe.Pointer(pOp)).Fp3)
  96204 	if !(isWriteLock != 0 || uint64(0) == (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ReadUncommit)) {
  96205 		goto __892
  96206 	}
  96207 	p13 = (*Op)(unsafe.Pointer(pOp)).Fp1
  96208 
  96209 	rc = Xsqlite3BtreeLockTable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(p13)*32)).FpBt, (*Op)(unsafe.Pointer(pOp)).Fp2, isWriteLock)
  96210 	if !(rc != 0) {
  96211 		goto __893
  96212 	}
  96213 	if !(rc&0xFF == SQLITE_LOCKED) {
  96214 		goto __894
  96215 	}
  96216 	z1 = *(*uintptr)(unsafe.Pointer(pOp + 16))
  96217 	Xsqlite3VdbeError(tls, p, ts+7393, libc.VaList(bp+144, z1))
  96218 __894:
  96219 	;
  96220 	goto abort_due_to_error
  96221 __893:
  96222 	;
  96223 __892:
  96224 	;
  96225 	goto __9
  96226 
  96227 __172:
  96228 	pVTab = *(*uintptr)(unsafe.Pointer(pOp + 16))
  96229 	rc = Xsqlite3VtabBegin(tls, db, pVTab)
  96230 	if !(pVTab != 0) {
  96231 		goto __895
  96232 	}
  96233 	Xsqlite3VtabImportErrmsg(tls, p, (*VTable)(unsafe.Pointer(pVTab)).FpVtab)
  96234 __895:
  96235 	;
  96236 	if !(rc != 0) {
  96237 		goto __896
  96238 	}
  96239 	goto abort_due_to_error
  96240 __896:
  96241 	;
  96242 	goto __9
  96243 
  96244 __173:
  96245 	libc.Xmemset(tls, bp+920, 0, uint64(unsafe.Sizeof(Mem{})))
  96246 	(*Mem)(unsafe.Pointer(bp + 920)).Fdb = db
  96247 
  96248 	rc = Xsqlite3VdbeMemCopy(tls, bp+920, aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)
  96249 
  96250 	zTab = Xsqlite3_value_text(tls, bp+920)
  96251 
  96252 	if !(zTab != 0) {
  96253 		goto __897
  96254 	}
  96255 	rc = Xsqlite3VtabCallCreate(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, zTab, p+168)
  96256 __897:
  96257 	;
  96258 	Xsqlite3VdbeMemRelease(tls, bp+920)
  96259 	if !(rc != 0) {
  96260 		goto __898
  96261 	}
  96262 	goto abort_due_to_error
  96263 __898:
  96264 	;
  96265 	goto __9
  96266 
  96267 __174:
  96268 	(*Sqlite3)(unsafe.Pointer(db)).FnVDestroy++
  96269 	rc = Xsqlite3VtabCallDestroy(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16)))
  96270 	(*Sqlite3)(unsafe.Pointer(db)).FnVDestroy--
  96271 
  96272 	if !(rc != 0) {
  96273 		goto __899
  96274 	}
  96275 	goto abort_due_to_error
  96276 __899:
  96277 	;
  96278 	goto __9
  96279 
  96280 __175:
  96281 	;
  96282 	pCur3 = uintptr(0)
  96283 	*(*uintptr)(unsafe.Pointer(bp + 976)) = uintptr(0)
  96284 	pVtab1 = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab
  96285 	if !(pVtab1 == uintptr(0) || (*Sqlite3_vtab)(unsafe.Pointer(pVtab1)).FpModule == uintptr(0)) {
  96286 		goto __900
  96287 	}
  96288 	rc = SQLITE_LOCKED
  96289 	goto abort_due_to_error
  96290 __900:
  96291 	;
  96292 	pModule1 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab1)).FpModule
  96293 	rc = (*struct {
  96294 		f func(*libc.TLS, uintptr, uintptr) int32
  96295 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule1)).FxOpen})).f(tls, pVtab1, bp+976)
  96296 	Xsqlite3VtabImportErrmsg(tls, p, pVtab1)
  96297 	if !(rc != 0) {
  96298 		goto __901
  96299 	}
  96300 	goto abort_due_to_error
  96301 __901:
  96302 	;
  96303 	(*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 976)))).FpVtab = pVtab1
  96304 
  96305 	pCur3 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, 0, uint8(CURTYPE_VTAB))
  96306 	if !(pCur3 != 0) {
  96307 		goto __902
  96308 	}
  96309 	*(*uintptr)(unsafe.Pointer(pCur3 + 48)) = *(*uintptr)(unsafe.Pointer(bp + 976))
  96310 	(*Sqlite3_vtab)(unsafe.Pointer(pVtab1)).FnRef++
  96311 	goto __903
  96312 __902:
  96313 	;
  96314 	(*struct {
  96315 		f func(*libc.TLS, uintptr) int32
  96316 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule1)).FxClose})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 976)))
  96317 	goto no_mem
  96318 __903:
  96319 	;
  96320 	goto __9
  96321 
  96322 __176:
  96323 	pC32 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  96324 	pRhs = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(ValueList{})))
  96325 	if !(pRhs == uintptr(0)) {
  96326 		goto __904
  96327 	}
  96328 	goto no_mem
  96329 __904:
  96330 	;
  96331 	(*ValueList)(unsafe.Pointer(pRhs)).FpCsr = *(*uintptr)(unsafe.Pointer(pC32 + 48))
  96332 	(*ValueList)(unsafe.Pointer(pRhs)).FpOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  96333 	pOut = out2Prerelease(tls, p, pOp)
  96334 	(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null)
  96335 	Xsqlite3VdbeMemSetPointer(tls, pOut, pRhs, ts+7422, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3VdbeValueListFree})))
  96336 	goto __9
  96337 
  96338 __177:
  96339 	pQuery = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  96340 	pArgc = pQuery + 1*56
  96341 	pCur4 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  96342 
  96343 	pVCur1 = *(*uintptr)(unsafe.Pointer(pCur4 + 48))
  96344 	pVtab2 = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pVCur1)).FpVtab
  96345 	pModule2 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab2)).FpModule
  96346 
  96347 	nArg = int32(*(*I64)(unsafe.Pointer(pArgc)))
  96348 	iQuery = int32(*(*I64)(unsafe.Pointer(pQuery)))
  96349 
  96350 	apArg = (*Vdbe)(unsafe.Pointer(p)).FapArg
  96351 	i7 = 0
  96352 __905:
  96353 	if !(i7 < nArg) {
  96354 		goto __907
  96355 	}
  96356 	*(*uintptr)(unsafe.Pointer(apArg + uintptr(i7)*8)) = pArgc + uintptr(i7+1)*56
  96357 	goto __906
  96358 __906:
  96359 	i7++
  96360 	goto __905
  96361 	goto __907
  96362 __907:
  96363 	;
  96364 	rc = (*struct {
  96365 		f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
  96366 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule2)).FxFilter})).f(tls, pVCur1, iQuery, *(*uintptr)(unsafe.Pointer(pOp + 16)), nArg, apArg)
  96367 	Xsqlite3VtabImportErrmsg(tls, p, pVtab2)
  96368 	if !(rc != 0) {
  96369 		goto __908
  96370 	}
  96371 	goto abort_due_to_error
  96372 __908:
  96373 	;
  96374 	res12 = (*struct {
  96375 		f func(*libc.TLS, uintptr) int32
  96376 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule2)).FxEof})).f(tls, pVCur1)
  96377 	(*VdbeCursor)(unsafe.Pointer(pCur4)).FnullRow = U8(0)
  96378 
  96379 	if !(res12 != 0) {
  96380 		goto __909
  96381 	}
  96382 	goto jump_to_p2
  96383 __909:
  96384 	;
  96385 	goto __9
  96386 
  96387 __178:
  96388 	pCur5 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  96389 
  96390 	pDest2 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  96391 
  96392 	if !((*VdbeCursor)(unsafe.Pointer(pCur5)).FnullRow != 0) {
  96393 		goto __910
  96394 	}
  96395 	Xsqlite3VdbeMemSetNull(tls, pDest2)
  96396 	goto __9
  96397 __910:
  96398 	;
  96399 	pVtab3 = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur5 + 48)))).FpVtab
  96400 	pModule3 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab3)).FpModule
  96401 
  96402 	libc.Xmemset(tls, bp+984, 0, uint64(unsafe.Sizeof(Sqlite3_context{})))
  96403 	(*Sqlite3_context)(unsafe.Pointer(bp + 984)).FpOut = pDest2
  96404 	(*Sqlite3_context)(unsafe.Pointer(bp + 984)).Fenc = encoding
  96405 
  96406 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5)&OPFLAG_NOCHNG != 0) {
  96407 		goto __911
  96408 	}
  96409 	Xsqlite3VdbeMemSetNull(tls, pDest2)
  96410 	(*Mem)(unsafe.Pointer(pDest2)).Fflags = U16(MEM_Null | MEM_Zero)
  96411 	*(*int32)(unsafe.Pointer(pDest2)) = 0
  96412 	goto __912
  96413 __911:
  96414 	(*Mem)(unsafe.Pointer(pDest2)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pDest2)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Null)
  96415 __912:
  96416 	;
  96417 	rc = (*struct {
  96418 		f func(*libc.TLS, uintptr, uintptr, int32) int32
  96419 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule3)).FxColumn})).f(tls, *(*uintptr)(unsafe.Pointer(pCur5 + 48)), bp+984, (*Op)(unsafe.Pointer(pOp)).Fp2)
  96420 	Xsqlite3VtabImportErrmsg(tls, p, pVtab3)
  96421 	if !((*Sqlite3_context)(unsafe.Pointer(bp+984)).FisError > 0) {
  96422 		goto __913
  96423 	}
  96424 	Xsqlite3VdbeError(tls, p, ts+4493, libc.VaList(bp+152, Xsqlite3_value_text(tls, pDest2)))
  96425 	rc = (*Sqlite3_context)(unsafe.Pointer(bp + 984)).FisError
  96426 __913:
  96427 	;
  96428 	Xsqlite3VdbeChangeEncoding(tls, pDest2, int32(encoding))
  96429 
  96430 	if !(rc != 0) {
  96431 		goto __914
  96432 	}
  96433 	goto abort_due_to_error
  96434 __914:
  96435 	;
  96436 	goto __9
  96437 
  96438 __179:
  96439 	pCur6 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
  96440 
  96441 	if !((*VdbeCursor)(unsafe.Pointer(pCur6)).FnullRow != 0) {
  96442 		goto __915
  96443 	}
  96444 	goto __9
  96445 __915:
  96446 	;
  96447 	pVtab4 = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur6 + 48)))).FpVtab
  96448 	pModule4 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab4)).FpModule
  96449 
  96450 	rc = (*struct {
  96451 		f func(*libc.TLS, uintptr) int32
  96452 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule4)).FxNext})).f(tls, *(*uintptr)(unsafe.Pointer(pCur6 + 48)))
  96453 	Xsqlite3VtabImportErrmsg(tls, p, pVtab4)
  96454 	if !(rc != 0) {
  96455 		goto __916
  96456 	}
  96457 	goto abort_due_to_error
  96458 __916:
  96459 	;
  96460 	res13 = (*struct {
  96461 		f func(*libc.TLS, uintptr) int32
  96462 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule4)).FxEof})).f(tls, *(*uintptr)(unsafe.Pointer(pCur6 + 48)))
  96463 
  96464 	if !!(res13 != 0) {
  96465 		goto __917
  96466 	}
  96467 
  96468 	goto jump_to_p2_and_check_for_interrupt
  96469 __917:
  96470 	;
  96471 	goto check_for_interrupt
  96472 
  96473 __180:
  96474 	isLegacy = int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyAlter))
  96475 	*(*U64)(unsafe.Pointer(db + 48)) |= uint64(SQLITE_LegacyAlter)
  96476 	pVtab5 = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab
  96477 	pName = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  96478 
  96479 	rc = Xsqlite3VdbeChangeEncoding(tls, pName, SQLITE_UTF8)
  96480 	if !(rc != 0) {
  96481 		goto __918
  96482 	}
  96483 	goto abort_due_to_error
  96484 __918:
  96485 	;
  96486 	rc = (*struct {
  96487 		f func(*libc.TLS, uintptr, uintptr) int32
  96488 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer((*Sqlite3_vtab)(unsafe.Pointer(pVtab5)).FpModule)).FxRename})).f(tls, pVtab5, (*Mem)(unsafe.Pointer(pName)).Fz)
  96489 	if !(isLegacy == 0) {
  96490 		goto __919
  96491 	}
  96492 	*(*U64)(unsafe.Pointer(db + 48)) &= libc.CplUint64(uint64(SQLITE_LegacyAlter))
  96493 __919:
  96494 	;
  96495 	Xsqlite3VtabImportErrmsg(tls, p, pVtab5)
  96496 	libc.SetBitFieldPtr8Uint32(p+200, Bft(0), 0, 0x3)
  96497 	if !(rc != 0) {
  96498 		goto __920
  96499 	}
  96500 	goto abort_due_to_error
  96501 __920:
  96502 	;
  96503 	goto __9
  96504 
  96505 __181:
  96506 	*(*Sqlite_int64)(unsafe.Pointer(bp + 1040)) = int64(0)
  96507 
  96508 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
  96509 		goto __921
  96510 	}
  96511 	goto no_mem
  96512 __921:
  96513 	;
  96514 	pVtab6 = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab
  96515 	if !(pVtab6 == uintptr(0) || (*Sqlite3_vtab)(unsafe.Pointer(pVtab6)).FpModule == uintptr(0)) {
  96516 		goto __922
  96517 	}
  96518 	rc = SQLITE_LOCKED
  96519 	goto abort_due_to_error
  96520 __922:
  96521 	;
  96522 	pModule5 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab6)).FpModule
  96523 	nArg1 = (*Op)(unsafe.Pointer(pOp)).Fp2
  96524 
  96525 	if !((*Sqlite3_module)(unsafe.Pointer(pModule5)).FxUpdate != 0) {
  96526 		goto __923
  96527 	}
  96528 	vtabOnConflict = (*Sqlite3)(unsafe.Pointer(db)).FvtabOnConflict
  96529 	apArg1 = (*Vdbe)(unsafe.Pointer(p)).FapArg
  96530 	pX1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  96531 	i8 = 0
  96532 __924:
  96533 	if !(i8 < nArg1) {
  96534 		goto __926
  96535 	}
  96536 
  96537 	*(*uintptr)(unsafe.Pointer(apArg1 + uintptr(i8)*8)) = pX1
  96538 	pX1 += 56
  96539 	goto __925
  96540 __925:
  96541 	i8++
  96542 	goto __924
  96543 	goto __926
  96544 __926:
  96545 	;
  96546 	(*Sqlite3)(unsafe.Pointer(db)).FvtabOnConflict = U8((*Op)(unsafe.Pointer(pOp)).Fp5)
  96547 	rc = (*struct {
  96548 		f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
  96549 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule5)).FxUpdate})).f(tls, pVtab6, nArg1, apArg1, bp+1040)
  96550 	(*Sqlite3)(unsafe.Pointer(db)).FvtabOnConflict = vtabOnConflict
  96551 	Xsqlite3VtabImportErrmsg(tls, p, pVtab6)
  96552 	if !(rc == SQLITE_OK && (*Op)(unsafe.Pointer(pOp)).Fp1 != 0) {
  96553 		goto __927
  96554 	}
  96555 
  96556 	(*Sqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Sqlite_int64)(unsafe.Pointer(bp + 1040))
  96557 __927:
  96558 	;
  96559 	if !(rc&0xff == SQLITE_CONSTRAINT && (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FbConstraint != 0) {
  96560 		goto __928
  96561 	}
  96562 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5) == OE_Ignore) {
  96563 		goto __930
  96564 	}
  96565 	rc = SQLITE_OK
  96566 	goto __931
  96567 __930:
  96568 	(*Vdbe)(unsafe.Pointer(p)).FerrorAction = func() uint8 {
  96569 		if int32((*Op)(unsafe.Pointer(pOp)).Fp5) == OE_Replace {
  96570 			return uint8(OE_Abort)
  96571 		}
  96572 		return uint8((*Op)(unsafe.Pointer(pOp)).Fp5)
  96573 	}()
  96574 __931:
  96575 	;
  96576 	goto __929
  96577 __928:
  96578 	(*Vdbe)(unsafe.Pointer(p)).FnChange++
  96579 __929:
  96580 	;
  96581 	if !(rc != 0) {
  96582 		goto __932
  96583 	}
  96584 	goto abort_due_to_error
  96585 __932:
  96586 	;
  96587 __923:
  96588 	;
  96589 	goto __9
  96590 
  96591 __182:
  96592 	pOut = out2Prerelease(tls, p, pOp)
  96593 	*(*I64)(unsafe.Pointer(pOut)) = I64(Xsqlite3BtreeLastPage(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpBt))
  96594 	goto __9
  96595 
  96596 __183:
  96597 	pOut = out2Prerelease(tls, p, pOp)
  96598 	pBt3 = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpBt
  96599 	newMax = uint32(0)
  96600 	if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) {
  96601 		goto __933
  96602 	}
  96603 	newMax = Xsqlite3BtreeLastPage(tls, pBt3)
  96604 	if !(newMax < uint32((*Op)(unsafe.Pointer(pOp)).Fp3)) {
  96605 		goto __934
  96606 	}
  96607 	newMax = uint32((*Op)(unsafe.Pointer(pOp)).Fp3)
  96608 __934:
  96609 	;
  96610 __933:
  96611 	;
  96612 	*(*I64)(unsafe.Pointer(pOut)) = I64(Xsqlite3BtreeMaxPageCount(tls, pBt3, newMax))
  96613 	goto __9
  96614 
  96615 __184:
  96616 __185:
  96617 	;
  96618 	pCtx2 = *(*uintptr)(unsafe.Pointer(pOp + 16))
  96619 
  96620 	pOut = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56
  96621 	if !((*Sqlite3_context)(unsafe.Pointer(pCtx2)).FpOut != pOut) {
  96622 		goto __935
  96623 	}
  96624 	(*Sqlite3_context)(unsafe.Pointer(pCtx2)).FpVdbe = p
  96625 	(*Sqlite3_context)(unsafe.Pointer(pCtx2)).FpOut = pOut
  96626 	(*Sqlite3_context)(unsafe.Pointer(pCtx2)).Fenc = encoding
  96627 	i9 = int32((*Sqlite3_context)(unsafe.Pointer(pCtx2)).Fargc) - 1
  96628 __936:
  96629 	if !(i9 >= 0) {
  96630 		goto __938
  96631 	}
  96632 	*(*uintptr)(unsafe.Pointer(pCtx2 + 48 + uintptr(i9)*8)) = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2+i9)*56
  96633 	goto __937
  96634 __937:
  96635 	i9--
  96636 	goto __936
  96637 	goto __938
  96638 __938:
  96639 	;
  96640 __935:
  96641 	;
  96642 	(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Null)
  96643 
  96644 	(*struct {
  96645 		f func(*libc.TLS, uintptr, int32, uintptr)
  96646 	})(unsafe.Pointer(&struct{ uintptr }{(*FuncDef)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx2)).FpFunc)).FxSFunc})).f(tls, pCtx2, int32((*Sqlite3_context)(unsafe.Pointer(pCtx2)).Fargc), pCtx2+48)
  96647 
  96648 	if !((*Sqlite3_context)(unsafe.Pointer(pCtx2)).FisError != 0) {
  96649 		goto __939
  96650 	}
  96651 	if !((*Sqlite3_context)(unsafe.Pointer(pCtx2)).FisError > 0) {
  96652 		goto __940
  96653 	}
  96654 	Xsqlite3VdbeError(tls, p, ts+4493, libc.VaList(bp+160, Xsqlite3_value_text(tls, pOut)))
  96655 	rc = (*Sqlite3_context)(unsafe.Pointer(pCtx2)).FisError
  96656 __940:
  96657 	;
  96658 	Xsqlite3VdbeDeleteAuxData(tls, db, p+296, (*Sqlite3_context)(unsafe.Pointer(pCtx2)).FiOp, (*Op)(unsafe.Pointer(pOp)).Fp1)
  96659 	(*Sqlite3_context)(unsafe.Pointer(pCtx2)).FisError = 0
  96660 	if !(rc != 0) {
  96661 		goto __941
  96662 	}
  96663 	goto abort_due_to_error
  96664 __941:
  96665 	;
  96666 __939:
  96667 	;
  96668 	goto __9
  96669 
  96670 __186:
  96671 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  96672 	*(*U16)(unsafe.Pointer(pIn1 + 20)) &= libc.Uint16FromInt32(libc.CplInt32(MEM_Subtype))
  96673 	goto __9
  96674 
  96675 __187:
  96676 	;
  96677 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  96678 
  96679 	h = filterHash(tls, aMem, pOp)
  96680 	h = h % U64((*Mem)(unsafe.Pointer(pIn1)).Fn)
  96681 	*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pIn1)).Fz + uintptr(h/uint64(8)))) |= int8(int32(1) << (h & uint64(7)))
  96682 	goto __9
  96683 
  96684 __188:
  96685 	;
  96686 	pIn1 = aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56
  96687 
  96688 	h1 = filterHash(tls, aMem, pOp)
  96689 	h1 = h1 % U64((*Mem)(unsafe.Pointer(pIn1)).Fn)
  96690 	if !(int32(*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pIn1)).Fz + uintptr(h1/uint64(8)))))&(int32(1)<<(h1&uint64(7))) == 0) {
  96691 		goto __942
  96692 	}
  96693 
  96694 	*(*U32)(unsafe.Pointer(p + 212 + 8*4))++
  96695 	goto jump_to_p2
  96696 	goto __943
  96697 __942:
  96698 	*(*U32)(unsafe.Pointer(p + 212 + 7*4))++
  96699 
  96700 __943:
  96701 	;
  96702 	goto __9
  96703 
  96704 __189:
  96705 __190:
  96706 	;
  96707 	if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace)&(SQLITE_TRACE_STMT|SQLITE_TRACE_LEGACY) != 0 &&
  96708 		int32((*Vdbe)(unsafe.Pointer(p)).FminWriteFileFormat) != 254 &&
  96709 		libc.AssignUintptr(&zTrace, func() uintptr {
  96710 			if *(*uintptr)(unsafe.Pointer(pOp + 16)) != 0 {
  96711 				return *(*uintptr)(unsafe.Pointer(pOp + 16))
  96712 			}
  96713 			return (*Vdbe)(unsafe.Pointer(p)).FzSql
  96714 		}()) != uintptr(0)) {
  96715 		goto __944
  96716 	}
  96717 	if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace)&SQLITE_TRACE_LEGACY != 0) {
  96718 		goto __945
  96719 	}
  96720 	z2 = Xsqlite3VdbeExpandSql(tls, p, zTrace)
  96721 	(*struct {
  96722 		f func(*libc.TLS, uintptr, uintptr)
  96723 	})(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(db + 248))})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, z2)
  96724 	Xsqlite3_free(tls, z2)
  96725 	goto __946
  96726 __945:
  96727 	if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec > 1) {
  96728 		goto __947
  96729 	}
  96730 	z3 = Xsqlite3MPrintf(tls, db, ts+7432, libc.VaList(bp+168, zTrace))
  96731 	(*struct {
  96732 		f func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32
  96733 	})(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(db + 248))})).f(tls, uint32(SQLITE_TRACE_STMT), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3)
  96734 	Xsqlite3DbFree(tls, db, z3)
  96735 	goto __948
  96736 __947:
  96737 	(*struct {
  96738 		f func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32
  96739 	})(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(db + 248))})).f(tls, uint32(SQLITE_TRACE_STMT), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, zTrace)
  96740 __948:
  96741 	;
  96742 __946:
  96743 	;
  96744 __944:
  96745 	;
  96746 	if !((*Op)(unsafe.Pointer(pOp)).Fp1 >= Xsqlite3Config.FiOnceResetThreshold) {
  96747 		goto __949
  96748 	}
  96749 	if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_Trace) {
  96750 		goto __950
  96751 	}
  96752 	goto __9
  96753 __950:
  96754 	;
  96755 	i10 = 1
  96756 __951:
  96757 	if !(i10 < (*Vdbe)(unsafe.Pointer(p)).FnOp) {
  96758 		goto __953
  96759 	}
  96760 	if !(int32((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr(i10)*24)).Fopcode) == OP_Once) {
  96761 		goto __954
  96762 	}
  96763 	(*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(i10)*24)).Fp1 = 0
  96764 __954:
  96765 	;
  96766 	goto __952
  96767 __952:
  96768 	i10++
  96769 	goto __951
  96770 	goto __953
  96771 __953:
  96772 	;
  96773 	(*Op)(unsafe.Pointer(pOp)).Fp1 = 0
  96774 __949:
  96775 	;
  96776 	(*Op)(unsafe.Pointer(pOp)).Fp1++
  96777 	*(*U32)(unsafe.Pointer(p + 212 + 6*4))++
  96778 	goto jump_to_p2
  96779 
  96780 __191:
  96781 	;
  96782 	goto __9
  96783 
  96784 __9:
  96785 	;
  96786 	goto __7
  96787 __7:
  96788 	pOp += 24
  96789 	goto __6
  96790 	goto __8
  96791 __8:
  96792 	;
  96793 abort_due_to_error:
  96794 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
  96795 		goto __955
  96796 	}
  96797 	rc = SQLITE_NOMEM
  96798 	goto __956
  96799 __955:
  96800 	if !(rc == SQLITE_IOERR|int32(33)<<8) {
  96801 		goto __957
  96802 	}
  96803 	rc = Xsqlite3CorruptError(tls, 99034)
  96804 __957:
  96805 	;
  96806 __956:
  96807 	;
  96808 	if !((*Vdbe)(unsafe.Pointer(p)).FzErrMsg == uintptr(0) && rc != SQLITE_IOERR|int32(12)<<8) {
  96809 		goto __958
  96810 	}
  96811 	Xsqlite3VdbeError(tls, p, ts+4493, libc.VaList(bp+176, Xsqlite3ErrStr(tls, rc)))
  96812 __958:
  96813 	;
  96814 	(*Vdbe)(unsafe.Pointer(p)).Frc = rc
  96815 	Xsqlite3SystemError(tls, db, rc)
  96816 
  96817 	Xsqlite3_log(tls, rc, ts+7438,
  96818 		libc.VaList(bp+184, int32((int64(pOp)-int64(aOp))/24), (*Vdbe)(unsafe.Pointer(p)).FzSql, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg))
  96819 	if !(int32((*Vdbe)(unsafe.Pointer(p)).FeVdbeState) == VDBE_RUN_STATE) {
  96820 		goto __959
  96821 	}
  96822 	Xsqlite3VdbeHalt(tls, p)
  96823 __959:
  96824 	;
  96825 	if !(rc == SQLITE_IOERR|int32(12)<<8) {
  96826 		goto __960
  96827 	}
  96828 	Xsqlite3OomFault(tls, db)
  96829 __960:
  96830 	;
  96831 	if !(rc == SQLITE_CORRUPT && int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) == 0) {
  96832 		goto __961
  96833 	}
  96834 	*(*U64)(unsafe.Pointer(db + 48)) |= uint64(0x00002) << 32
  96835 __961:
  96836 	;
  96837 	rc = SQLITE_ERROR
  96838 	if !(int32(resetSchemaOnFault) > 0) {
  96839 		goto __962
  96840 	}
  96841 	Xsqlite3ResetOneSchema(tls, db, int32(resetSchemaOnFault)-1)
  96842 __962:
  96843 	;
  96844 vdbe_return:
  96845 __963:
  96846 	if !(nVmStep >= nProgressLimit && (*Sqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0)) {
  96847 		goto __964
  96848 	}
  96849 	nProgressLimit = nProgressLimit + U64((*Sqlite3)(unsafe.Pointer(db)).FnProgressOps)
  96850 	if !((*struct {
  96851 		f func(*libc.TLS, uintptr) int32
  96852 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxProgress})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProgressArg) != 0) {
  96853 		goto __965
  96854 	}
  96855 	nProgressLimit = uint64(0xffffffff) | uint64(0xffffffff)<<32
  96856 	rc = SQLITE_INTERRUPT
  96857 	goto abort_due_to_error
  96858 __965:
  96859 	;
  96860 	goto __963
  96861 __964:
  96862 	;
  96863 	*(*U32)(unsafe.Pointer(p + 212 + 4*4)) += U32(int32(nVmStep))
  96864 	if !((*Vdbe)(unsafe.Pointer(p)).FlockMask != YDbMask(0)) {
  96865 		goto __966
  96866 	}
  96867 	Xsqlite3VdbeLeave(tls, p)
  96868 __966:
  96869 	;
  96870 	return rc
  96871 
  96872 too_big:
  96873 	Xsqlite3VdbeError(tls, p, ts+6686, 0)
  96874 	rc = SQLITE_TOOBIG
  96875 	goto abort_due_to_error
  96876 
  96877 no_mem:
  96878 	Xsqlite3OomFault(tls, db)
  96879 	Xsqlite3VdbeError(tls, p, ts+1480, 0)
  96880 	rc = SQLITE_NOMEM
  96881 	goto abort_due_to_error
  96882 
  96883 abort_due_to_interrupt:
  96884 	;
  96885 	rc = SQLITE_INTERRUPT
  96886 	goto abort_due_to_error
  96887 	return int32(0)
  96888 }
  96889 
  96890 var azType = [4]uintptr{ts + 7470, ts + 7479, ts + 7486,
  96891 	ts + 7492}
  96892 var and_logic = [9]uint8{uint8(0), uint8(0), uint8(0), uint8(0), uint8(1), uint8(2), uint8(0), uint8(2), uint8(2)}
  96893 var or_logic = [9]uint8{uint8(0), uint8(1), uint8(2), uint8(1), uint8(1), uint8(1), uint8(2), uint8(1), uint8(2)}
  96894 var aMask = [12]uint8{
  96895 	uint8(0x10), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x2),
  96896 	uint8(0x01), uint8(0x01), uint8(0x10), uint8(0x10),
  96897 }
  96898 var aFlag1 = [2]U16{U16(MEM_Blob), U16(MEM_Str | MEM_Term)}
  96899 var vfsFlags int32 = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_DELETEONCLOSE | SQLITE_OPEN_TRANSIENT_DB
  96900 
  96901 // Valid sqlite3_blob* handles point to Incrblob structures.
  96902 type Incrblob1 = struct {
  96903 	FnByte       int32
  96904 	FiOffset     int32
  96905 	FiCol        U16
  96906 	F__ccgo_pad1 [6]byte
  96907 	FpCsr        uintptr
  96908 	FpStmt       uintptr
  96909 	Fdb          uintptr
  96910 	FzDb         uintptr
  96911 	FpTab        uintptr
  96912 }
  96913 
  96914 // Valid sqlite3_blob* handles point to Incrblob structures.
  96915 type Incrblob = Incrblob1
  96916 
  96917 func blobSeekToRow(tls *libc.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr) int32 {
  96918 	bp := tls.Alloc(24)
  96919 	defer tls.Free(24)
  96920 
  96921 	var rc int32
  96922 	var zErr uintptr = uintptr(0)
  96923 	var v uintptr = (*Incrblob)(unsafe.Pointer(p)).FpStmt
  96924 
  96925 	(*Mem)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FaMem + 1*56)).Fflags = U16(MEM_Int)
  96926 	*(*I64)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FaMem + 1*56)) = iRow
  96927 
  96928 	if (*Vdbe)(unsafe.Pointer(v)).Fpc > 4 {
  96929 		(*Vdbe)(unsafe.Pointer(v)).Fpc = 4
  96930 
  96931 		rc = Xsqlite3VdbeExec(tls, v)
  96932 	} else {
  96933 		rc = Xsqlite3_step(tls, (*Incrblob)(unsafe.Pointer(p)).FpStmt)
  96934 	}
  96935 	if rc == SQLITE_ROW {
  96936 		var pC uintptr = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FapCsr))
  96937 		var type1 U32
  96938 
  96939 		if int32((*VdbeCursor)(unsafe.Pointer(pC)).FnHdrParsed) > int32((*Incrblob)(unsafe.Pointer(p)).FiCol) {
  96940 			type1 = *(*U32)(unsafe.Pointer(pC + 112 + uintptr((*Incrblob)(unsafe.Pointer(p)).FiCol)*4))
  96941 		} else {
  96942 			type1 = uint32(0)
  96943 		}
  96944 
  96945 		if type1 < U32(12) {
  96946 			zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+7504,
  96947 				libc.VaList(bp, func() uintptr {
  96948 					if type1 == U32(0) {
  96949 						return ts + 7533
  96950 					}
  96951 					return func() uintptr {
  96952 						if type1 == U32(7) {
  96953 							return ts + 7538
  96954 						}
  96955 						return ts + 7543
  96956 					}()
  96957 				}()))
  96958 			rc = SQLITE_ERROR
  96959 			Xsqlite3_finalize(tls, (*Incrblob)(unsafe.Pointer(p)).FpStmt)
  96960 			(*Incrblob)(unsafe.Pointer(p)).FpStmt = uintptr(0)
  96961 		} else {
  96962 			(*Incrblob)(unsafe.Pointer(p)).FiOffset = int32(*(*U32)(unsafe.Pointer(pC + 112 + uintptr(int32((*Incrblob)(unsafe.Pointer(p)).FiCol)+int32((*VdbeCursor)(unsafe.Pointer(pC)).FnField))*4)))
  96963 			(*Incrblob)(unsafe.Pointer(p)).FnByte = int32(Xsqlite3VdbeSerialTypeLen(tls, type1))
  96964 			(*Incrblob)(unsafe.Pointer(p)).FpCsr = *(*uintptr)(unsafe.Pointer(pC + 48))
  96965 			Xsqlite3BtreeIncrblobCursor(tls, (*Incrblob)(unsafe.Pointer(p)).FpCsr)
  96966 		}
  96967 	}
  96968 
  96969 	if rc == SQLITE_ROW {
  96970 		rc = SQLITE_OK
  96971 	} else if (*Incrblob)(unsafe.Pointer(p)).FpStmt != 0 {
  96972 		rc = Xsqlite3_finalize(tls, (*Incrblob)(unsafe.Pointer(p)).FpStmt)
  96973 		(*Incrblob)(unsafe.Pointer(p)).FpStmt = uintptr(0)
  96974 		if rc == SQLITE_OK {
  96975 			zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+7551, libc.VaList(bp+8, iRow))
  96976 			rc = SQLITE_ERROR
  96977 		} else {
  96978 			zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+4493, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb)))
  96979 		}
  96980 	}
  96981 
  96982 	*(*uintptr)(unsafe.Pointer(pzErr)) = zErr
  96983 	return rc
  96984 }
  96985 
  96986 // Open a blob handle.
  96987 func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, zColumn uintptr, iRow Sqlite_int64, wrFlag int32, ppBlob uintptr) int32 {
  96988 	bp := tls.Alloc(480)
  96989 	defer tls.Free(480)
  96990 
  96991 	var nAttempt int32
  96992 	var iCol int32
  96993 	var rc int32
  96994 
  96995 	var pTab uintptr
  96996 	var pBlob uintptr
  96997 
  96998 	var j int32
  96999 
  97000 	var pFKey uintptr
  97001 	var j1 int32
  97002 	var zFault uintptr
  97003 	var pIdx uintptr
  97004 	var v uintptr
  97005 	var iDb int32
  97006 	var aOp uintptr
  97007 	nAttempt = 0
  97008 	rc = SQLITE_OK
  97009 	*(*uintptr)(unsafe.Pointer(bp + 472)) = uintptr(0)
  97010 	pBlob = uintptr(0)
  97011 
  97012 	*(*uintptr)(unsafe.Pointer(ppBlob)) = uintptr(0)
  97013 	wrFlag = libc.BoolInt32(!!(wrFlag != 0))
  97014 
  97015 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
  97016 
  97017 	pBlob = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Incrblob{})))
  97018 __1:
  97019 	if !(1 != 0) {
  97020 		goto __2
  97021 	}
  97022 	Xsqlite3ParseObjectInit(tls, bp+48, db)
  97023 	if !!(pBlob != 0) {
  97024 		goto __3
  97025 	}
  97026 	goto blob_open_out
  97027 __3:
  97028 	;
  97029 	Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 472)))
  97030 	*(*uintptr)(unsafe.Pointer(bp + 472)) = uintptr(0)
  97031 
  97032 	Xsqlite3BtreeEnterAll(tls, db)
  97033 	pTab = Xsqlite3LocateTable(tls, bp+48, uint32(0), zTable, zDb)
  97034 	if !(pTab != 0 && int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
  97035 		goto __4
  97036 	}
  97037 	pTab = uintptr(0)
  97038 	Xsqlite3ErrorMsg(tls, bp+48, ts+7571, libc.VaList(bp, zTable))
  97039 __4:
  97040 	;
  97041 	if !(pTab != 0 && !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0))) {
  97042 		goto __5
  97043 	}
  97044 	pTab = uintptr(0)
  97045 	Xsqlite3ErrorMsg(tls, bp+48, ts+7601, libc.VaList(bp+8, zTable))
  97046 __5:
  97047 	;
  97048 	if !(pTab != 0 && int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW) {
  97049 		goto __6
  97050 	}
  97051 	pTab = uintptr(0)
  97052 	Xsqlite3ErrorMsg(tls, bp+48, ts+7637, libc.VaList(bp+16, zTable))
  97053 __6:
  97054 	;
  97055 	if !!(pTab != 0) {
  97056 		goto __7
  97057 	}
  97058 	if !((*Parse)(unsafe.Pointer(bp+48)).FzErrMsg != 0) {
  97059 		goto __8
  97060 	}
  97061 	Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 472)))
  97062 	*(*uintptr)(unsafe.Pointer(bp + 472)) = (*Parse)(unsafe.Pointer(bp + 48)).FzErrMsg
  97063 	(*Parse)(unsafe.Pointer(bp + 48)).FzErrMsg = uintptr(0)
  97064 __8:
  97065 	;
  97066 	rc = SQLITE_ERROR
  97067 	Xsqlite3BtreeLeaveAll(tls, db)
  97068 	goto blob_open_out
  97069 __7:
  97070 	;
  97071 	(*Incrblob)(unsafe.Pointer(pBlob)).FpTab = pTab
  97072 	(*Incrblob)(unsafe.Pointer(pBlob)).FzDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema))*32)).FzDbSName
  97073 
  97074 	iCol = 0
  97075 __9:
  97076 	if !(iCol < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
  97077 		goto __11
  97078 	}
  97079 	if !(Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*24)).FzCnName, zColumn) == 0) {
  97080 		goto __12
  97081 	}
  97082 	goto __11
  97083 __12:
  97084 	;
  97085 	goto __10
  97086 __10:
  97087 	iCol++
  97088 	goto __9
  97089 	goto __11
  97090 __11:
  97091 	;
  97092 	if !(iCol == int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
  97093 		goto __13
  97094 	}
  97095 	Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 472)))
  97096 	*(*uintptr)(unsafe.Pointer(bp + 472)) = Xsqlite3MPrintf(tls, db, ts+7658, libc.VaList(bp+24, zColumn))
  97097 	rc = SQLITE_ERROR
  97098 	Xsqlite3BtreeLeaveAll(tls, db)
  97099 	goto blob_open_out
  97100 __13:
  97101 	;
  97102 	if !(wrFlag != 0) {
  97103 		goto __14
  97104 	}
  97105 	zFault = uintptr(0)
  97106 	if !((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ForeignKeys) != 0) {
  97107 		goto __15
  97108 	}
  97109 
  97110 	pFKey = *(*uintptr)(unsafe.Pointer(pTab + 64 + 8))
  97111 __16:
  97112 	if !(pFKey != 0) {
  97113 		goto __18
  97114 	}
  97115 	j = 0
  97116 __19:
  97117 	if !(j < (*FKey)(unsafe.Pointer(pFKey)).FnCol) {
  97118 		goto __21
  97119 	}
  97120 	if !((*sColMap)(unsafe.Pointer(pFKey+64+uintptr(j)*16)).FiFrom == iCol) {
  97121 		goto __22
  97122 	}
  97123 	zFault = ts + 7679
  97124 __22:
  97125 	;
  97126 	goto __20
  97127 __20:
  97128 	j++
  97129 	goto __19
  97130 	goto __21
  97131 __21:
  97132 	;
  97133 	goto __17
  97134 __17:
  97135 	pFKey = (*FKey)(unsafe.Pointer(pFKey)).FpNextFrom
  97136 	goto __16
  97137 	goto __18
  97138 __18:
  97139 	;
  97140 __15:
  97141 	;
  97142 	pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex
  97143 __23:
  97144 	if !(pIdx != 0) {
  97145 		goto __25
  97146 	}
  97147 	j1 = 0
  97148 __26:
  97149 	if !(j1 < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)) {
  97150 		goto __28
  97151 	}
  97152 
  97153 	if !(int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j1)*2))) == iCol || int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j1)*2))) == -2) {
  97154 		goto __29
  97155 	}
  97156 	zFault = ts + 7691
  97157 __29:
  97158 	;
  97159 	goto __27
  97160 __27:
  97161 	j1++
  97162 	goto __26
  97163 	goto __28
  97164 __28:
  97165 	;
  97166 	goto __24
  97167 __24:
  97168 	pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
  97169 	goto __23
  97170 	goto __25
  97171 __25:
  97172 	;
  97173 	if !(zFault != 0) {
  97174 		goto __30
  97175 	}
  97176 	Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 472)))
  97177 	*(*uintptr)(unsafe.Pointer(bp + 472)) = Xsqlite3MPrintf(tls, db, ts+7699, libc.VaList(bp+32, zFault))
  97178 	rc = SQLITE_ERROR
  97179 	Xsqlite3BtreeLeaveAll(tls, db)
  97180 	goto blob_open_out
  97181 __30:
  97182 	;
  97183 __14:
  97184 	;
  97185 	(*Incrblob)(unsafe.Pointer(pBlob)).FpStmt = Xsqlite3VdbeCreate(tls, bp+48)
  97186 
  97187 	if !((*Incrblob)(unsafe.Pointer(pBlob)).FpStmt != 0) {
  97188 		goto __31
  97189 	}
  97190 	v = (*Incrblob)(unsafe.Pointer(pBlob)).FpStmt
  97191 	iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
  97192 
  97193 	Xsqlite3VdbeAddOp4Int(tls, v, OP_Transaction, iDb, wrFlag,
  97194 		(*Schema)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FpSchema)).Fschema_cookie,
  97195 		(*Schema)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FpSchema)).FiGeneration)
  97196 	Xsqlite3VdbeChangeP5(tls, v, uint16(1))
  97197 
  97198 	aOp = Xsqlite3VdbeAddOpList(tls, v, int32(uint64(unsafe.Sizeof(openBlob))/uint64(unsafe.Sizeof(VdbeOpList{}))), uintptr(unsafe.Pointer(&openBlob)), iLn)
  97199 
  97200 	Xsqlite3VdbeUsesBtree(tls, v, iDb)
  97201 
  97202 	if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) {
  97203 		goto __32
  97204 	}
  97205 
  97206 	(*VdbeOp)(unsafe.Pointer(aOp)).Fp1 = iDb
  97207 	(*VdbeOp)(unsafe.Pointer(aOp)).Fp2 = int32((*Table)(unsafe.Pointer(pTab)).Ftnum)
  97208 	(*VdbeOp)(unsafe.Pointer(aOp)).Fp3 = wrFlag
  97209 	Xsqlite3VdbeChangeP4(tls, v, 2, (*Table)(unsafe.Pointer(pTab)).FzName, P4_TRANSIENT)
  97210 __32:
  97211 	;
  97212 	if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) {
  97213 		goto __33
  97214 	}
  97215 
  97216 	if !(wrFlag != 0) {
  97217 		goto __34
  97218 	}
  97219 	(*VdbeOp)(unsafe.Pointer(aOp + 1*24)).Fopcode = U8(OP_OpenWrite)
  97220 __34:
  97221 	;
  97222 	(*VdbeOp)(unsafe.Pointer(aOp + 1*24)).Fp2 = int32((*Table)(unsafe.Pointer(pTab)).Ftnum)
  97223 	(*VdbeOp)(unsafe.Pointer(aOp + 1*24)).Fp3 = iDb
  97224 
  97225 	(*VdbeOp)(unsafe.Pointer(aOp + 1*24)).Fp4type = int8(-3)
  97226 	*(*int32)(unsafe.Pointer(aOp + 1*24 + 16)) = int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 1
  97227 	(*VdbeOp)(unsafe.Pointer(aOp + 3*24)).Fp2 = int32((*Table)(unsafe.Pointer(pTab)).FnCol)
  97228 
  97229 	(*Parse)(unsafe.Pointer(bp + 48)).FnVar = int16(0)
  97230 	(*Parse)(unsafe.Pointer(bp + 48)).FnMem = 1
  97231 	(*Parse)(unsafe.Pointer(bp + 48)).FnTab = 1
  97232 	Xsqlite3VdbeMakeReady(tls, v, bp+48)
  97233 __33:
  97234 	;
  97235 __31:
  97236 	;
  97237 	(*Incrblob)(unsafe.Pointer(pBlob)).FiCol = U16(iCol)
  97238 	(*Incrblob)(unsafe.Pointer(pBlob)).Fdb = db
  97239 	Xsqlite3BtreeLeaveAll(tls, db)
  97240 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
  97241 		goto __35
  97242 	}
  97243 	goto blob_open_out
  97244 __35:
  97245 	;
  97246 	rc = blobSeekToRow(tls, pBlob, iRow, bp+472)
  97247 	if !(libc.PreIncInt32(&nAttempt, 1) >= SQLITE_MAX_SCHEMA_RETRY || rc != SQLITE_SCHEMA) {
  97248 		goto __36
  97249 	}
  97250 	goto __2
  97251 __36:
  97252 	;
  97253 	Xsqlite3ParseObjectReset(tls, bp+48)
  97254 	goto __1
  97255 __2:
  97256 	;
  97257 blob_open_out:
  97258 	if !(rc == SQLITE_OK && int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) {
  97259 		goto __37
  97260 	}
  97261 	*(*uintptr)(unsafe.Pointer(ppBlob)) = pBlob
  97262 	goto __38
  97263 __37:
  97264 	if !(pBlob != 0 && (*Incrblob)(unsafe.Pointer(pBlob)).FpStmt != 0) {
  97265 		goto __39
  97266 	}
  97267 	Xsqlite3VdbeFinalize(tls, (*Incrblob)(unsafe.Pointer(pBlob)).FpStmt)
  97268 __39:
  97269 	;
  97270 	Xsqlite3DbFree(tls, db, pBlob)
  97271 __38:
  97272 	;
  97273 	Xsqlite3ErrorWithMsg(tls, db, rc, func() uintptr {
  97274 		if *(*uintptr)(unsafe.Pointer(bp + 472)) != 0 {
  97275 			return ts + 4493
  97276 		}
  97277 		return uintptr(0)
  97278 	}(), libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(bp + 472))))
  97279 	Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 472)))
  97280 	Xsqlite3ParseObjectReset(tls, bp+48)
  97281 	rc = Xsqlite3ApiExit(tls, db, rc)
  97282 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
  97283 	return rc
  97284 }
  97285 
  97286 var iLn int32 = 0
  97287 var openBlob = [6]VdbeOpList{
  97288 	{Fopcode: U8(OP_TableLock)},
  97289 	{Fopcode: U8(OP_OpenRead)},
  97290 	{Fopcode: U8(OP_NotExists), Fp2: int8(5), Fp3: int8(1)},
  97291 	{Fopcode: U8(OP_Column), Fp3: int8(1)},
  97292 	{Fopcode: U8(OP_ResultRow), Fp1: int8(1)},
  97293 	{Fopcode: U8(OP_Halt)},
  97294 }
  97295 
  97296 // Close a blob handle that was previously created using
  97297 // sqlite3_blob_open().
  97298 func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) int32 {
  97299 	var p uintptr = pBlob
  97300 	var rc int32
  97301 	var db uintptr
  97302 
  97303 	if p != 0 {
  97304 		var pStmt uintptr = (*Incrblob)(unsafe.Pointer(p)).FpStmt
  97305 		db = (*Incrblob)(unsafe.Pointer(p)).Fdb
  97306 		Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
  97307 		Xsqlite3DbFree(tls, db, p)
  97308 		Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
  97309 		rc = Xsqlite3_finalize(tls, pStmt)
  97310 	} else {
  97311 		rc = SQLITE_OK
  97312 	}
  97313 	return rc
  97314 }
  97315 
  97316 func blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, xCall uintptr) int32 {
  97317 	var rc int32
  97318 	var p uintptr = pBlob
  97319 	var v uintptr
  97320 	var db uintptr
  97321 
  97322 	if p == uintptr(0) {
  97323 		return Xsqlite3MisuseError(tls, 99519)
  97324 	}
  97325 	db = (*Incrblob)(unsafe.Pointer(p)).Fdb
  97326 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
  97327 	v = (*Incrblob)(unsafe.Pointer(p)).FpStmt
  97328 
  97329 	if n < 0 || iOffset < 0 || Sqlite3_int64(iOffset)+Sqlite3_int64(n) > Sqlite3_int64((*Incrblob)(unsafe.Pointer(p)).FnByte) {
  97330 		rc = SQLITE_ERROR
  97331 	} else if v == uintptr(0) {
  97332 		rc = SQLITE_ABORT
  97333 	} else {
  97334 		Xsqlite3BtreeEnterCursor(tls, (*Incrblob)(unsafe.Pointer(p)).FpCsr)
  97335 
  97336 		if xCall == *(*uintptr)(unsafe.Pointer(&struct {
  97337 			f func(*libc.TLS, uintptr, U32, U32, uintptr) int32
  97338 		}{Xsqlite3BtreePutData})) && (*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 {
  97339 			var iKey Sqlite3_int64
  97340 			iKey = Xsqlite3BtreeIntegerKey(tls, (*Incrblob)(unsafe.Pointer(p)).FpCsr)
  97341 
  97342 			Xsqlite3VdbePreUpdateHook(tls,
  97343 				v, *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FapCsr)), SQLITE_DELETE, (*Incrblob)(unsafe.Pointer(p)).FzDb, (*Incrblob)(unsafe.Pointer(p)).FpTab, iKey, -1, int32((*Incrblob)(unsafe.Pointer(p)).FiCol))
  97344 		}
  97345 
  97346 		rc = (*struct {
  97347 			f func(*libc.TLS, uintptr, U32, U32, uintptr) int32
  97348 		})(unsafe.Pointer(&struct{ uintptr }{xCall})).f(tls, (*Incrblob)(unsafe.Pointer(p)).FpCsr, uint32(iOffset+(*Incrblob)(unsafe.Pointer(p)).FiOffset), uint32(n), z)
  97349 		Xsqlite3BtreeLeaveCursor(tls, (*Incrblob)(unsafe.Pointer(p)).FpCsr)
  97350 		if rc == SQLITE_ABORT {
  97351 			Xsqlite3VdbeFinalize(tls, v)
  97352 			(*Incrblob)(unsafe.Pointer(p)).FpStmt = uintptr(0)
  97353 		} else {
  97354 			(*Vdbe)(unsafe.Pointer(v)).Frc = rc
  97355 		}
  97356 	}
  97357 	Xsqlite3Error(tls, db, rc)
  97358 	rc = Xsqlite3ApiExit(tls, db, rc)
  97359 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
  97360 	return rc
  97361 }
  97362 
  97363 // Read data from a blob handle.
  97364 func Xsqlite3_blob_read(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32) int32 {
  97365 	return blobReadWrite(tls, pBlob, z, n, iOffset, *(*uintptr)(unsafe.Pointer(&struct {
  97366 		f func(*libc.TLS, uintptr, U32, U32, uintptr) int32
  97367 	}{Xsqlite3BtreePayloadChecked})))
  97368 }
  97369 
  97370 // Write data to a blob handle.
  97371 func Xsqlite3_blob_write(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32) int32 {
  97372 	return blobReadWrite(tls, pBlob, z, n, iOffset, *(*uintptr)(unsafe.Pointer(&struct {
  97373 		f func(*libc.TLS, uintptr, U32, U32, uintptr) int32
  97374 	}{Xsqlite3BtreePutData})))
  97375 }
  97376 
  97377 // Query a blob handle for the size of the data.
  97378 //
  97379 // The Incrblob.nByte field is fixed for the lifetime of the Incrblob
  97380 // so no mutex is required for access.
  97381 func Xsqlite3_blob_bytes(tls *libc.TLS, pBlob uintptr) int32 {
  97382 	var p uintptr = pBlob
  97383 	if p != 0 && (*Incrblob)(unsafe.Pointer(p)).FpStmt != 0 {
  97384 		return (*Incrblob)(unsafe.Pointer(p)).FnByte
  97385 	}
  97386 	return 0
  97387 }
  97388 
  97389 // Move an existing blob handle to point to a different row of the same
  97390 // database table.
  97391 //
  97392 // If an error occurs, or if the specified row does not exist or does not
  97393 // contain a blob or text value, then an error code is returned and the
  97394 // database handle error code and message set. If this happens, then all
  97395 // subsequent calls to sqlite3_blob_xxx() functions (except blob_close())
  97396 // immediately return SQLITE_ABORT.
  97397 func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Sqlite3_int64) int32 {
  97398 	bp := tls.Alloc(16)
  97399 	defer tls.Free(16)
  97400 
  97401 	var rc int32
  97402 	var p uintptr = pBlob
  97403 	var db uintptr
  97404 
  97405 	if p == uintptr(0) {
  97406 		return Xsqlite3MisuseError(tls, 99619)
  97407 	}
  97408 	db = (*Incrblob)(unsafe.Pointer(p)).Fdb
  97409 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
  97410 
  97411 	if (*Incrblob)(unsafe.Pointer(p)).FpStmt == uintptr(0) {
  97412 		rc = SQLITE_ABORT
  97413 	} else {
  97414 		(*Vdbe)(unsafe.Pointer((*Incrblob)(unsafe.Pointer(p)).FpStmt)).Frc = SQLITE_OK
  97415 		rc = blobSeekToRow(tls, p, iRow, bp+8)
  97416 		if rc != SQLITE_OK {
  97417 			Xsqlite3ErrorWithMsg(tls, db, rc, func() uintptr {
  97418 				if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 {
  97419 					return ts + 4493
  97420 				}
  97421 				return uintptr(0)
  97422 			}(), libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 8))))
  97423 			Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)))
  97424 		}
  97425 
  97426 	}
  97427 
  97428 	rc = Xsqlite3ApiExit(tls, db, rc)
  97429 
  97430 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
  97431 	return rc
  97432 }
  97433 
  97434 // Private objects used by the sorter
  97435 type MergeEngine1 = struct {
  97436 	FnTree       int32
  97437 	F__ccgo_pad1 [4]byte
  97438 	FpTask       uintptr
  97439 	FaTree       uintptr
  97440 	FaReadr      uintptr
  97441 }
  97442 
  97443 // Private objects used by the sorter
  97444 type MergeEngine = MergeEngine1
  97445 type PmaReader1 = struct {
  97446 	FiReadOff    I64
  97447 	FiEof        I64
  97448 	FnAlloc      int32
  97449 	FnKey        int32
  97450 	FpFd         uintptr
  97451 	FaAlloc      uintptr
  97452 	FaKey        uintptr
  97453 	FaBuffer     uintptr
  97454 	FnBuffer     int32
  97455 	F__ccgo_pad1 [4]byte
  97456 	FaMap        uintptr
  97457 	FpIncr       uintptr
  97458 }
  97459 
  97460 // Merge PMAs together
  97461 type PmaReader = PmaReader1
  97462 type PmaWriter1 = struct {
  97463 	FeFWErr      int32
  97464 	F__ccgo_pad1 [4]byte
  97465 	FaBuffer     uintptr
  97466 	FnBuffer     int32
  97467 	FiBufStart   int32
  97468 	FiBufEnd     int32
  97469 	F__ccgo_pad2 [4]byte
  97470 	FiWriteOff   I64
  97471 	FpFd         uintptr
  97472 }
  97473 
  97474 // Incrementally read one PMA
  97475 type PmaWriter = PmaWriter1
  97476 type SorterRecord1 = struct {
  97477 	FnVal        int32
  97478 	F__ccgo_pad1 [4]byte
  97479 	Fu           struct{ FpNext uintptr }
  97480 }
  97481 
  97482 // Incrementally write one PMA
  97483 type SorterRecord = SorterRecord1
  97484 type SortSubtask1 = struct {
  97485 	FpThread     uintptr
  97486 	FbDone       int32
  97487 	F__ccgo_pad1 [4]byte
  97488 	FpSorter     uintptr
  97489 	FpUnpacked   uintptr
  97490 	Flist        SorterList
  97491 	FnPMA        int32
  97492 	F__ccgo_pad2 [4]byte
  97493 	FxCompare    SorterCompare
  97494 	Ffile        SorterFile
  97495 	Ffile2       SorterFile
  97496 }
  97497 
  97498 // A record being sorted
  97499 type SortSubtask = SortSubtask1
  97500 type SorterFile1 = struct {
  97501 	FpFd  uintptr
  97502 	FiEof I64
  97503 }
  97504 
  97505 // A sub-task in the sort process
  97506 type SorterFile = SorterFile1
  97507 type SorterList1 = struct {
  97508 	FpList       uintptr
  97509 	FaMemory     uintptr
  97510 	FszPMA       int32
  97511 	F__ccgo_pad1 [4]byte
  97512 }
  97513 
  97514 // Temporary file object wrapper
  97515 type SorterList = SorterList1
  97516 type IncrMerger1 = struct {
  97517 	FpTask       uintptr
  97518 	FpMerger     uintptr
  97519 	FiStartOff   I64
  97520 	FmxSz        int32
  97521 	FbEof        int32
  97522 	FbUseThread  int32
  97523 	F__ccgo_pad1 [4]byte
  97524 	FaFile       [2]SorterFile
  97525 }
  97526 
  97527 // In-memory list of records
  97528 type IncrMerger = IncrMerger1
  97529 
  97530 // This object represents a single thread of control in a sort operation.
  97531 // Exactly VdbeSorter.nTask instances of this object are allocated
  97532 // as part of each VdbeSorter object. Instances are never allocated any
  97533 // other way. VdbeSorter.nTask is set to the number of worker threads allowed
  97534 // (see SQLITE_CONFIG_WORKER_THREADS) plus one (the main thread).  Thus for
  97535 // single-threaded operation, there is exactly one instance of this object
  97536 // and for multi-threaded operation there are two or more instances.
  97537 //
  97538 // Essentially, this structure contains all those fields of the VdbeSorter
  97539 // structure for which each thread requires a separate instance. For example,
  97540 // each thread requries its own UnpackedRecord object to unpack records in
  97541 // as part of comparison operations.
  97542 //
  97543 // Before a background thread is launched, variable bDone is set to 0. Then,
  97544 // right before it exits, the thread itself sets bDone to 1. This is used for
  97545 // two purposes:
  97546 //
  97547 //  1. When flushing the contents of memory to a level-0 PMA on disk, to
  97548 //     attempt to select a SortSubtask for which there is not already an
  97549 //     active background thread (since doing so causes the main thread
  97550 //     to block until it finishes).
  97551 //
  97552 //  2. If SQLITE_DEBUG_SORTER_THREADS is defined, to determine if a call
  97553 //     to sqlite3ThreadJoin() is likely to block. Cases that are likely to
  97554 //     block provoke debugging output.
  97555 //
  97556 // In both cases, the effects of the main thread seeing (bDone==0) even
  97557 // after the thread has finished are not dire. So we don't worry about
  97558 // memory barriers and such here.
  97559 type SorterCompare = uintptr
  97560 
  97561 func vdbePmaReaderClear(tls *libc.TLS, pReadr uintptr) {
  97562 	Xsqlite3_free(tls, (*PmaReader)(unsafe.Pointer(pReadr)).FaAlloc)
  97563 	Xsqlite3_free(tls, (*PmaReader)(unsafe.Pointer(pReadr)).FaBuffer)
  97564 	if (*PmaReader)(unsafe.Pointer(pReadr)).FaMap != 0 {
  97565 		Xsqlite3OsUnfetch(tls, (*PmaReader)(unsafe.Pointer(pReadr)).FpFd, int64(0), (*PmaReader)(unsafe.Pointer(pReadr)).FaMap)
  97566 	}
  97567 	vdbeIncrFree(tls, (*PmaReader)(unsafe.Pointer(pReadr)).FpIncr)
  97568 	libc.Xmemset(tls, pReadr, 0, uint64(unsafe.Sizeof(PmaReader{})))
  97569 }
  97570 
  97571 func vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) int32 {
  97572 	bp := tls.Alloc(8)
  97573 	defer tls.Free(8)
  97574 
  97575 	var iBuf int32
  97576 	var nAvail int32
  97577 
  97578 	if (*PmaReader)(unsafe.Pointer(p)).FaMap != 0 {
  97579 		*(*uintptr)(unsafe.Pointer(ppOut)) = (*PmaReader)(unsafe.Pointer(p)).FaMap + uintptr((*PmaReader)(unsafe.Pointer(p)).FiReadOff)
  97580 		*(*I64)(unsafe.Pointer(p)) += I64(nByte)
  97581 		return SQLITE_OK
  97582 	}
  97583 
  97584 	iBuf = int32((*PmaReader)(unsafe.Pointer(p)).FiReadOff % I64((*PmaReader)(unsafe.Pointer(p)).FnBuffer))
  97585 	if iBuf == 0 {
  97586 		var nRead int32
  97587 		var rc int32
  97588 
  97589 		if (*PmaReader)(unsafe.Pointer(p)).FiEof-(*PmaReader)(unsafe.Pointer(p)).FiReadOff > I64((*PmaReader)(unsafe.Pointer(p)).FnBuffer) {
  97590 			nRead = (*PmaReader)(unsafe.Pointer(p)).FnBuffer
  97591 		} else {
  97592 			nRead = int32((*PmaReader)(unsafe.Pointer(p)).FiEof - (*PmaReader)(unsafe.Pointer(p)).FiReadOff)
  97593 		}
  97594 
  97595 		rc = Xsqlite3OsRead(tls, (*PmaReader)(unsafe.Pointer(p)).FpFd, (*PmaReader)(unsafe.Pointer(p)).FaBuffer, nRead, (*PmaReader)(unsafe.Pointer(p)).FiReadOff)
  97596 
  97597 		if rc != SQLITE_OK {
  97598 			return rc
  97599 		}
  97600 	}
  97601 	nAvail = (*PmaReader)(unsafe.Pointer(p)).FnBuffer - iBuf
  97602 
  97603 	if nByte <= nAvail {
  97604 		*(*uintptr)(unsafe.Pointer(ppOut)) = (*PmaReader)(unsafe.Pointer(p)).FaBuffer + uintptr(iBuf)
  97605 		*(*I64)(unsafe.Pointer(p)) += I64(nByte)
  97606 	} else {
  97607 		var nRem int32
  97608 
  97609 		if (*PmaReader)(unsafe.Pointer(p)).FnAlloc < nByte {
  97610 			var aNew uintptr
  97611 			var nNew Sqlite3_int64 = func() int64 {
  97612 				if int64(128) > int64(2)*Sqlite3_int64((*PmaReader)(unsafe.Pointer(p)).FnAlloc) {
  97613 					return int64(128)
  97614 				}
  97615 				return int64(2) * Sqlite3_int64((*PmaReader)(unsafe.Pointer(p)).FnAlloc)
  97616 			}()
  97617 			for Sqlite3_int64(nByte) > nNew {
  97618 				nNew = nNew * int64(2)
  97619 			}
  97620 			aNew = Xsqlite3Realloc(tls, (*PmaReader)(unsafe.Pointer(p)).FaAlloc, uint64(nNew))
  97621 			if !(aNew != 0) {
  97622 				return SQLITE_NOMEM
  97623 			}
  97624 			(*PmaReader)(unsafe.Pointer(p)).FnAlloc = int32(nNew)
  97625 			(*PmaReader)(unsafe.Pointer(p)).FaAlloc = aNew
  97626 		}
  97627 
  97628 		libc.Xmemcpy(tls, (*PmaReader)(unsafe.Pointer(p)).FaAlloc, (*PmaReader)(unsafe.Pointer(p)).FaBuffer+uintptr(iBuf), uint64(nAvail))
  97629 		*(*I64)(unsafe.Pointer(p)) += I64(nAvail)
  97630 		nRem = nByte - nAvail
  97631 
  97632 		for nRem > 0 {
  97633 			var rc int32
  97634 			var nCopy int32
  97635 
  97636 			nCopy = nRem
  97637 			if nRem > (*PmaReader)(unsafe.Pointer(p)).FnBuffer {
  97638 				nCopy = (*PmaReader)(unsafe.Pointer(p)).FnBuffer
  97639 			}
  97640 			rc = vdbePmaReadBlob(tls, p, nCopy, bp)
  97641 			if rc != SQLITE_OK {
  97642 				return rc
  97643 			}
  97644 
  97645 			libc.Xmemcpy(tls, (*PmaReader)(unsafe.Pointer(p)).FaAlloc+uintptr(nByte-nRem), *(*uintptr)(unsafe.Pointer(bp)), uint64(nCopy))
  97646 			nRem = nRem - nCopy
  97647 		}
  97648 
  97649 		*(*uintptr)(unsafe.Pointer(ppOut)) = (*PmaReader)(unsafe.Pointer(p)).FaAlloc
  97650 	}
  97651 
  97652 	return SQLITE_OK
  97653 }
  97654 
  97655 func vdbePmaReadVarint(tls *libc.TLS, p uintptr, pnOut uintptr) int32 {
  97656 	bp := tls.Alloc(24)
  97657 	defer tls.Free(24)
  97658 
  97659 	var iBuf int32
  97660 
  97661 	if (*PmaReader)(unsafe.Pointer(p)).FaMap != 0 {
  97662 		*(*I64)(unsafe.Pointer(p)) += I64(Xsqlite3GetVarint(tls, (*PmaReader)(unsafe.Pointer(p)).FaMap+uintptr((*PmaReader)(unsafe.Pointer(p)).FiReadOff), pnOut))
  97663 	} else {
  97664 		iBuf = int32((*PmaReader)(unsafe.Pointer(p)).FiReadOff % I64((*PmaReader)(unsafe.Pointer(p)).FnBuffer))
  97665 		if iBuf != 0 && (*PmaReader)(unsafe.Pointer(p)).FnBuffer-iBuf >= 9 {
  97666 			*(*I64)(unsafe.Pointer(p)) += I64(Xsqlite3GetVarint(tls, (*PmaReader)(unsafe.Pointer(p)).FaBuffer+uintptr(iBuf), pnOut))
  97667 		} else {
  97668 			var i int32 = 0
  97669 			var rc int32
  97670 			for __ccgo := true; __ccgo; __ccgo = int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))&0x80 != 0 {
  97671 				rc = vdbePmaReadBlob(tls, p, 1, bp)
  97672 				if rc != 0 {
  97673 					return rc
  97674 				}
  97675 				*(*U8)(unsafe.Pointer(bp + 8 + uintptr(libc.PostIncInt32(&i, 1)&0xf))) = *(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))
  97676 			}
  97677 			Xsqlite3GetVarint(tls, bp+8, pnOut)
  97678 		}
  97679 	}
  97680 
  97681 	return SQLITE_OK
  97682 }
  97683 
  97684 func vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) int32 {
  97685 	var rc int32 = SQLITE_OK
  97686 	if (*SorterFile)(unsafe.Pointer(pFile)).FiEof <= I64((*Sqlite3)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb)).FnMaxSorterMmap) {
  97687 		var pFd uintptr = (*SorterFile)(unsafe.Pointer(pFile)).FpFd
  97688 		if (*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= 3 {
  97689 			rc = Xsqlite3OsFetch(tls, pFd, int64(0), int32((*SorterFile)(unsafe.Pointer(pFile)).FiEof), pp)
  97690 
  97691 		}
  97692 	}
  97693 	return rc
  97694 }
  97695 
  97696 func vdbePmaReaderSeek(tls *libc.TLS, pTask uintptr, pReadr uintptr, pFile uintptr, iOff I64) int32 {
  97697 	var rc int32 = SQLITE_OK
  97698 
  97699 	if Xsqlite3FaultSim(tls, 201) != 0 {
  97700 		return SQLITE_IOERR | int32(1)<<8
  97701 	}
  97702 	if (*PmaReader)(unsafe.Pointer(pReadr)).FaMap != 0 {
  97703 		Xsqlite3OsUnfetch(tls, (*PmaReader)(unsafe.Pointer(pReadr)).FpFd, int64(0), (*PmaReader)(unsafe.Pointer(pReadr)).FaMap)
  97704 		(*PmaReader)(unsafe.Pointer(pReadr)).FaMap = uintptr(0)
  97705 	}
  97706 	(*PmaReader)(unsafe.Pointer(pReadr)).FiReadOff = iOff
  97707 	(*PmaReader)(unsafe.Pointer(pReadr)).FiEof = (*SorterFile)(unsafe.Pointer(pFile)).FiEof
  97708 	(*PmaReader)(unsafe.Pointer(pReadr)).FpFd = (*SorterFile)(unsafe.Pointer(pFile)).FpFd
  97709 
  97710 	rc = vdbeSorterMapFile(tls, pTask, pFile, pReadr+64)
  97711 	if rc == SQLITE_OK && (*PmaReader)(unsafe.Pointer(pReadr)).FaMap == uintptr(0) {
  97712 		var pgsz int32 = (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fpgsz
  97713 		var iBuf int32 = int32((*PmaReader)(unsafe.Pointer(pReadr)).FiReadOff % I64(pgsz))
  97714 		if (*PmaReader)(unsafe.Pointer(pReadr)).FaBuffer == uintptr(0) {
  97715 			(*PmaReader)(unsafe.Pointer(pReadr)).FaBuffer = Xsqlite3Malloc(tls, uint64(pgsz))
  97716 			if (*PmaReader)(unsafe.Pointer(pReadr)).FaBuffer == uintptr(0) {
  97717 				rc = SQLITE_NOMEM
  97718 			}
  97719 			(*PmaReader)(unsafe.Pointer(pReadr)).FnBuffer = pgsz
  97720 		}
  97721 		if rc == SQLITE_OK && iBuf != 0 {
  97722 			var nRead int32 = pgsz - iBuf
  97723 			if (*PmaReader)(unsafe.Pointer(pReadr)).FiReadOff+I64(nRead) > (*PmaReader)(unsafe.Pointer(pReadr)).FiEof {
  97724 				nRead = int32((*PmaReader)(unsafe.Pointer(pReadr)).FiEof - (*PmaReader)(unsafe.Pointer(pReadr)).FiReadOff)
  97725 			}
  97726 			rc = Xsqlite3OsRead(tls,
  97727 				(*PmaReader)(unsafe.Pointer(pReadr)).FpFd, (*PmaReader)(unsafe.Pointer(pReadr)).FaBuffer+uintptr(iBuf), nRead, (*PmaReader)(unsafe.Pointer(pReadr)).FiReadOff)
  97728 
  97729 		}
  97730 	}
  97731 
  97732 	return rc
  97733 }
  97734 
  97735 func vdbePmaReaderNext(tls *libc.TLS, pReadr uintptr) int32 {
  97736 	bp := tls.Alloc(8)
  97737 	defer tls.Free(8)
  97738 
  97739 	var rc int32 = SQLITE_OK
  97740 	*(*U64)(unsafe.Pointer(bp)) = uint64(0)
  97741 
  97742 	if (*PmaReader)(unsafe.Pointer(pReadr)).FiReadOff >= (*PmaReader)(unsafe.Pointer(pReadr)).FiEof {
  97743 		var pIncr uintptr = (*PmaReader)(unsafe.Pointer(pReadr)).FpIncr
  97744 		var bEof int32 = 1
  97745 		if pIncr != 0 {
  97746 			rc = vdbeIncrSwap(tls, pIncr)
  97747 			if rc == SQLITE_OK && (*IncrMerger)(unsafe.Pointer(pIncr)).FbEof == 0 {
  97748 				rc = vdbePmaReaderSeek(tls,
  97749 					(*IncrMerger)(unsafe.Pointer(pIncr)).FpTask, pReadr, pIncr+40, (*IncrMerger)(unsafe.Pointer(pIncr)).FiStartOff)
  97750 				bEof = 0
  97751 			}
  97752 		}
  97753 
  97754 		if bEof != 0 {
  97755 			vdbePmaReaderClear(tls, pReadr)
  97756 
  97757 			return rc
  97758 		}
  97759 	}
  97760 
  97761 	if rc == SQLITE_OK {
  97762 		rc = vdbePmaReadVarint(tls, pReadr, bp)
  97763 	}
  97764 	if rc == SQLITE_OK {
  97765 		(*PmaReader)(unsafe.Pointer(pReadr)).FnKey = int32(*(*U64)(unsafe.Pointer(bp)))
  97766 		rc = vdbePmaReadBlob(tls, pReadr, int32(*(*U64)(unsafe.Pointer(bp))), pReadr+40)
  97767 
  97768 	}
  97769 
  97770 	return rc
  97771 }
  97772 
  97773 func vdbePmaReaderInit(tls *libc.TLS, pTask uintptr, pFile uintptr, iStart I64, pReadr uintptr, pnByte uintptr) int32 {
  97774 	bp := tls.Alloc(8)
  97775 	defer tls.Free(8)
  97776 
  97777 	var rc int32
  97778 
  97779 	rc = vdbePmaReaderSeek(tls, pTask, pReadr, pFile, iStart)
  97780 	if rc == SQLITE_OK {
  97781 		*(*U64)(unsafe.Pointer(bp)) = uint64(0)
  97782 		rc = vdbePmaReadVarint(tls, pReadr, bp)
  97783 		(*PmaReader)(unsafe.Pointer(pReadr)).FiEof = I64(U64((*PmaReader)(unsafe.Pointer(pReadr)).FiReadOff) + *(*U64)(unsafe.Pointer(bp)))
  97784 		*(*I64)(unsafe.Pointer(pnByte)) += I64(*(*U64)(unsafe.Pointer(bp)))
  97785 	}
  97786 
  97787 	if rc == SQLITE_OK {
  97788 		rc = vdbePmaReaderNext(tls, pReadr)
  97789 	}
  97790 	return rc
  97791 }
  97792 
  97793 func vdbeSorterCompareTail(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 {
  97794 	var r2 uintptr = (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked
  97795 	if *(*int32)(unsafe.Pointer(pbKey2Cached)) == 0 {
  97796 		Xsqlite3VdbeRecordUnpack(tls, (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo, nKey2, pKey2, r2)
  97797 		*(*int32)(unsafe.Pointer(pbKey2Cached)) = 1
  97798 	}
  97799 	return Xsqlite3VdbeRecordCompareWithSkip(tls, nKey1, pKey1, r2, 1)
  97800 }
  97801 
  97802 func vdbeSorterCompare(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 {
  97803 	var r2 uintptr = (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked
  97804 	if !(*(*int32)(unsafe.Pointer(pbKey2Cached)) != 0) {
  97805 		Xsqlite3VdbeRecordUnpack(tls, (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo, nKey2, pKey2, r2)
  97806 		*(*int32)(unsafe.Pointer(pbKey2Cached)) = 1
  97807 	}
  97808 	return Xsqlite3VdbeRecordCompare(tls, nKey1, pKey1, r2)
  97809 }
  97810 
  97811 func vdbeSorterCompareText(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 {
  97812 	bp := tls.Alloc(8)
  97813 	defer tls.Free(8)
  97814 
  97815 	var p1 uintptr = pKey1
  97816 	var p2 uintptr = pKey2
  97817 	var v1 uintptr = p1 + uintptr(*(*U8)(unsafe.Pointer(p1)))
  97818 	var v2 uintptr = p2 + uintptr(*(*U8)(unsafe.Pointer(p2)))
  97819 
  97820 	var res int32
  97821 
  97822 	*(*int32)(unsafe.Pointer(bp)) = int32(U32(*(*U8)(unsafe.Pointer(p1 + 1))))
  97823 	if *(*int32)(unsafe.Pointer(bp)) >= 0x80 {
  97824 		Xsqlite3GetVarint32(tls, p1+1, bp)
  97825 	}
  97826 	*(*int32)(unsafe.Pointer(bp + 4)) = int32(U32(*(*U8)(unsafe.Pointer(p2 + 1))))
  97827 	if *(*int32)(unsafe.Pointer(bp + 4)) >= 0x80 {
  97828 		Xsqlite3GetVarint32(tls, p2+1, bp+4)
  97829 	}
  97830 	res = libc.Xmemcmp(tls, v1, v2, uint64((func() int32 {
  97831 		if *(*int32)(unsafe.Pointer(bp)) < *(*int32)(unsafe.Pointer(bp + 4)) {
  97832 			return *(*int32)(unsafe.Pointer(bp))
  97833 		}
  97834 		return *(*int32)(unsafe.Pointer(bp + 4))
  97835 	}()-13)/2))
  97836 	if res == 0 {
  97837 		res = *(*int32)(unsafe.Pointer(bp)) - *(*int32)(unsafe.Pointer(bp + 4))
  97838 	}
  97839 
  97840 	if res == 0 {
  97841 		if int32((*KeyInfo)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo)).FnKeyField) > 1 {
  97842 			res = vdbeSorterCompareTail(tls,
  97843 				pTask, pbKey2Cached, pKey1, nKey1, pKey2, nKey2)
  97844 		}
  97845 	} else {
  97846 		if *(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo)).FaSortFlags)) != 0 {
  97847 			res = res * -1
  97848 		}
  97849 	}
  97850 
  97851 	return res
  97852 }
  97853 
  97854 func vdbeSorterCompareInt(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 {
  97855 	var p1 uintptr = pKey1
  97856 	var p2 uintptr = pKey2
  97857 	var s1 int32 = int32(*(*U8)(unsafe.Pointer(p1 + 1)))
  97858 	var s2 int32 = int32(*(*U8)(unsafe.Pointer(p2 + 1)))
  97859 	var v1 uintptr = p1 + uintptr(*(*U8)(unsafe.Pointer(p1)))
  97860 	var v2 uintptr = p2 + uintptr(*(*U8)(unsafe.Pointer(p2)))
  97861 	var res int32
  97862 
  97863 	if s1 == s2 {
  97864 		var n U8 = aLen[s1]
  97865 		var i int32
  97866 		res = 0
  97867 		for i = 0; i < int32(n); i++ {
  97868 			if libc.AssignInt32(&res, int32(*(*U8)(unsafe.Pointer(v1 + uintptr(i))))-int32(*(*U8)(unsafe.Pointer(v2 + uintptr(i))))) != 0 {
  97869 				if (int32(*(*U8)(unsafe.Pointer(v1)))^int32(*(*U8)(unsafe.Pointer(v2))))&0x80 != 0 {
  97870 					if int32(*(*U8)(unsafe.Pointer(v1)))&0x80 != 0 {
  97871 						res = -1
  97872 					} else {
  97873 						res = +1
  97874 					}
  97875 				}
  97876 				break
  97877 			}
  97878 		}
  97879 	} else if s1 > 7 && s2 > 7 {
  97880 		res = s1 - s2
  97881 	} else {
  97882 		if s2 > 7 {
  97883 			res = +1
  97884 		} else if s1 > 7 {
  97885 			res = -1
  97886 		} else {
  97887 			res = s1 - s2
  97888 		}
  97889 
  97890 		if res > 0 {
  97891 			if int32(*(*U8)(unsafe.Pointer(v1)))&0x80 != 0 {
  97892 				res = -1
  97893 			}
  97894 		} else {
  97895 			if int32(*(*U8)(unsafe.Pointer(v2)))&0x80 != 0 {
  97896 				res = +1
  97897 			}
  97898 		}
  97899 	}
  97900 
  97901 	if res == 0 {
  97902 		if int32((*KeyInfo)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo)).FnKeyField) > 1 {
  97903 			res = vdbeSorterCompareTail(tls,
  97904 				pTask, pbKey2Cached, pKey1, nKey1, pKey2, nKey2)
  97905 		}
  97906 	} else if *(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo)).FaSortFlags)) != 0 {
  97907 		res = res * -1
  97908 	}
  97909 
  97910 	return res
  97911 }
  97912 
  97913 var aLen = [10]U8{U8(0), U8(1), U8(2), U8(3), U8(4), U8(6), U8(8), U8(0), U8(0), U8(0)}
  97914 
  97915 // Initialize the temporary index cursor just opened as a sorter cursor.
  97916 //
  97917 // Usually, the sorter module uses the value of (pCsr->pKeyInfo->nKeyField)
  97918 // to determine the number of fields that should be compared from the
  97919 // records being sorted. However, if the value passed as argument nField
  97920 // is non-zero and the sorter is able to guarantee a stable sort, nField
  97921 // is used instead. This is used when sorting records for a CREATE INDEX
  97922 // statement. In this case, keys are always delivered to the sorter in
  97923 // order of the primary key, which happens to be make up the final part
  97924 // of the records being sorted. So if the sort is stable, there is never
  97925 // any reason to compare PK fields and they can be ignored for a small
  97926 // performance boost.
  97927 //
  97928 // The sorter can guarantee a stable sort when running in single-threaded
  97929 // mode, but not in multi-threaded mode.
  97930 //
  97931 // SQLITE_OK is returned if successful, or an SQLite error code otherwise.
  97932 func Xsqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintptr) int32 {
  97933 	var pgsz int32
  97934 	var i int32
  97935 	var pSorter uintptr
  97936 	var pKeyInfo uintptr
  97937 	var szKeyInfo int32
  97938 	var sz int32
  97939 	var rc int32 = SQLITE_OK
  97940 	var nWorker int32
  97941 
  97942 	if Xsqlite3TempInMemory(tls, db) != 0 || int32(Xsqlite3Config.FbCoreMutex) == 0 {
  97943 		nWorker = 0
  97944 	} else {
  97945 		nWorker = *(*int32)(unsafe.Pointer(db + 136 + 11*4))
  97946 	}
  97947 
  97948 	szKeyInfo = int32(uint64(unsafe.Sizeof(KeyInfo{})) + uint64(int32((*KeyInfo)(unsafe.Pointer((*VdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)-1)*uint64(unsafe.Sizeof(uintptr(0))))
  97949 	sz = int32(uint64(unsafe.Sizeof(VdbeSorter{})) + uint64(nWorker)*uint64(unsafe.Sizeof(SortSubtask{})))
  97950 
  97951 	pSorter = Xsqlite3DbMallocZero(tls, db, uint64(sz+szKeyInfo))
  97952 	*(*uintptr)(unsafe.Pointer(pCsr + 48)) = pSorter
  97953 	if pSorter == uintptr(0) {
  97954 		rc = SQLITE_NOMEM
  97955 	} else {
  97956 		var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpBt
  97957 		(*VdbeSorter)(unsafe.Pointer(pSorter)).FpKeyInfo = libc.AssignUintptr(&pKeyInfo, pSorter+uintptr(sz))
  97958 		libc.Xmemcpy(tls, pKeyInfo, (*VdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo, uint64(szKeyInfo))
  97959 		(*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fdb = uintptr(0)
  97960 		if nField != 0 && nWorker == 0 {
  97961 			(*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField = U16(nField)
  97962 		}
  97963 		Xsqlite3BtreeEnter(tls, pBt)
  97964 		(*VdbeSorter)(unsafe.Pointer(pSorter)).Fpgsz = libc.AssignInt32(&pgsz, Xsqlite3BtreeGetPageSize(tls, pBt))
  97965 		Xsqlite3BtreeLeave(tls, pBt)
  97966 		(*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask = U8(nWorker + 1)
  97967 		(*VdbeSorter)(unsafe.Pointer(pSorter)).FiPrev = U8(nWorker - 1)
  97968 		(*VdbeSorter)(unsafe.Pointer(pSorter)).FbUseThreads = U8(libc.Bool32(int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask) > 1))
  97969 		(*VdbeSorter)(unsafe.Pointer(pSorter)).Fdb = db
  97970 		for i = 0; i < int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask); i++ {
  97971 			var pTask uintptr = pSorter + 96 + uintptr(i)*104
  97972 			(*SortSubtask)(unsafe.Pointer(pTask)).FpSorter = pSorter
  97973 		}
  97974 
  97975 		if !(Xsqlite3TempInMemory(tls, db) != 0) {
  97976 			var mxCache I64
  97977 			var szPma U32 = Xsqlite3Config.FszPma
  97978 			(*VdbeSorter)(unsafe.Pointer(pSorter)).FmnPmaSize = int32(szPma * U32(pgsz))
  97979 
  97980 			mxCache = I64((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema)).Fcache_size)
  97981 			if mxCache < int64(0) {
  97982 				mxCache = mxCache * int64(-1024)
  97983 			} else {
  97984 				mxCache = mxCache * I64(pgsz)
  97985 			}
  97986 			mxCache = func() int64 {
  97987 				if mxCache < int64(int32(1)<<29) {
  97988 					return mxCache
  97989 				}
  97990 				return int64(int32(1) << 29)
  97991 			}()
  97992 			(*VdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize = func() int32 {
  97993 				if (*VdbeSorter)(unsafe.Pointer(pSorter)).FmnPmaSize > int32(mxCache) {
  97994 					return (*VdbeSorter)(unsafe.Pointer(pSorter)).FmnPmaSize
  97995 				}
  97996 				return int32(mxCache)
  97997 			}()
  97998 
  97999 			if int32(Xsqlite3Config.FbSmallMalloc) == 0 {
  98000 				(*VdbeSorter)(unsafe.Pointer(pSorter)).FnMemory = pgsz
  98001 				(*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory = Xsqlite3Malloc(tls, uint64(pgsz))
  98002 				if !(int32((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory) != 0) {
  98003 					rc = SQLITE_NOMEM
  98004 				}
  98005 			}
  98006 		}
  98007 
  98008 		if int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) < 13 &&
  98009 			(*(*uintptr)(unsafe.Pointer(pKeyInfo + 32)) == uintptr(0) || *(*uintptr)(unsafe.Pointer(pKeyInfo + 32)) == (*Sqlite3)(unsafe.Pointer(db)).FpDfltColl) &&
  98010 			int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)))&KEYINFO_ORDER_BIGNULL == 0 {
  98011 			(*VdbeSorter)(unsafe.Pointer(pSorter)).FtypeMask = U8(SORTER_TYPE_INTEGER | SORTER_TYPE_TEXT)
  98012 		}
  98013 	}
  98014 
  98015 	return rc
  98016 }
  98017 
  98018 func vdbeSorterRecordFree(tls *libc.TLS, db uintptr, pRecord uintptr) {
  98019 	var p uintptr
  98020 	var pNext uintptr
  98021 	for p = pRecord; p != 0; p = pNext {
  98022 		pNext = *(*uintptr)(unsafe.Pointer(p + 8))
  98023 		Xsqlite3DbFree(tls, db, p)
  98024 	}
  98025 }
  98026 
  98027 func vdbeSortSubtaskCleanup(tls *libc.TLS, db uintptr, pTask uintptr) {
  98028 	Xsqlite3DbFree(tls, db, (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked)
  98029 
  98030 	if (*SortSubtask)(unsafe.Pointer(pTask)).Flist.FaMemory != 0 {
  98031 		Xsqlite3_free(tls, (*SortSubtask)(unsafe.Pointer(pTask)).Flist.FaMemory)
  98032 	} else {
  98033 		vdbeSorterRecordFree(tls, uintptr(0), (*SortSubtask)(unsafe.Pointer(pTask)).Flist.FpList)
  98034 	}
  98035 	if (*SortSubtask)(unsafe.Pointer(pTask)).Ffile.FpFd != 0 {
  98036 		Xsqlite3OsCloseFree(tls, (*SortSubtask)(unsafe.Pointer(pTask)).Ffile.FpFd)
  98037 	}
  98038 	if (*SortSubtask)(unsafe.Pointer(pTask)).Ffile2.FpFd != 0 {
  98039 		Xsqlite3OsCloseFree(tls, (*SortSubtask)(unsafe.Pointer(pTask)).Ffile2.FpFd)
  98040 	}
  98041 	libc.Xmemset(tls, pTask, 0, uint64(unsafe.Sizeof(SortSubtask{})))
  98042 }
  98043 
  98044 func vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) int32 {
  98045 	bp := tls.Alloc(8)
  98046 	defer tls.Free(8)
  98047 
  98048 	var rc int32 = SQLITE_OK
  98049 	if (*SortSubtask)(unsafe.Pointer(pTask)).FpThread != 0 {
  98050 		*(*uintptr)(unsafe.Pointer(bp)) = uintptr(int64(SQLITE_ERROR))
  98051 
  98052 		Xsqlite3ThreadJoin(tls, (*SortSubtask)(unsafe.Pointer(pTask)).FpThread, bp)
  98053 
  98054 		rc = int32(*(*uintptr)(unsafe.Pointer(bp)))
  98055 
  98056 		(*SortSubtask)(unsafe.Pointer(pTask)).FbDone = 0
  98057 		(*SortSubtask)(unsafe.Pointer(pTask)).FpThread = uintptr(0)
  98058 	}
  98059 	return rc
  98060 }
  98061 
  98062 func vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, xTask uintptr, pIn uintptr) int32 {
  98063 	return Xsqlite3ThreadCreate(tls, pTask, xTask, pIn)
  98064 }
  98065 
  98066 func vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) int32 {
  98067 	var rc int32 = rcin
  98068 	var i int32
  98069 
  98070 	for i = int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask) - 1; i >= 0; i-- {
  98071 		var pTask uintptr = pSorter + 96 + uintptr(i)*104
  98072 		var rc2 int32 = vdbeSorterJoinThread(tls, pTask)
  98073 		if rc == SQLITE_OK {
  98074 			rc = rc2
  98075 		}
  98076 	}
  98077 	return rc
  98078 }
  98079 
  98080 func vdbeMergeEngineNew(tls *libc.TLS, nReader int32) uintptr {
  98081 	var N int32 = 2
  98082 	var nByte int32
  98083 	var pNew uintptr
  98084 
  98085 	for N < nReader {
  98086 		N = N + N
  98087 	}
  98088 	nByte = int32(uint64(unsafe.Sizeof(MergeEngine{})) + uint64(N)*(uint64(unsafe.Sizeof(int32(0)))+uint64(unsafe.Sizeof(PmaReader{}))))
  98089 
  98090 	if Xsqlite3FaultSim(tls, 100) != 0 {
  98091 		pNew = uintptr(0)
  98092 	} else {
  98093 		pNew = Xsqlite3MallocZero(tls, uint64(nByte))
  98094 	}
  98095 	if pNew != 0 {
  98096 		(*MergeEngine)(unsafe.Pointer(pNew)).FnTree = N
  98097 		(*MergeEngine)(unsafe.Pointer(pNew)).FpTask = uintptr(0)
  98098 		(*MergeEngine)(unsafe.Pointer(pNew)).FaReadr = pNew + 1*32
  98099 		(*MergeEngine)(unsafe.Pointer(pNew)).FaTree = (*MergeEngine)(unsafe.Pointer(pNew)).FaReadr + uintptr(N)*80
  98100 	}
  98101 	return pNew
  98102 }
  98103 
  98104 func vdbeMergeEngineFree(tls *libc.TLS, pMerger uintptr) {
  98105 	var i int32
  98106 	if pMerger != 0 {
  98107 		for i = 0; i < (*MergeEngine)(unsafe.Pointer(pMerger)).FnTree; i++ {
  98108 			vdbePmaReaderClear(tls, (*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr+uintptr(i)*80)
  98109 		}
  98110 	}
  98111 	Xsqlite3_free(tls, pMerger)
  98112 }
  98113 
  98114 func vdbeIncrFree(tls *libc.TLS, pIncr uintptr) {
  98115 	if pIncr != 0 {
  98116 		if (*IncrMerger)(unsafe.Pointer(pIncr)).FbUseThread != 0 {
  98117 			vdbeSorterJoinThread(tls, (*IncrMerger)(unsafe.Pointer(pIncr)).FpTask)
  98118 			if (*SorterFile)(unsafe.Pointer(pIncr+40)).FpFd != 0 {
  98119 				Xsqlite3OsCloseFree(tls, (*SorterFile)(unsafe.Pointer(pIncr+40)).FpFd)
  98120 			}
  98121 			if (*SorterFile)(unsafe.Pointer(pIncr+40+1*16)).FpFd != 0 {
  98122 				Xsqlite3OsCloseFree(tls, (*SorterFile)(unsafe.Pointer(pIncr+40+1*16)).FpFd)
  98123 			}
  98124 		}
  98125 		vdbeMergeEngineFree(tls, (*IncrMerger)(unsafe.Pointer(pIncr)).FpMerger)
  98126 		Xsqlite3_free(tls, pIncr)
  98127 	}
  98128 }
  98129 
  98130 // Reset a sorting cursor back to its original empty state.
  98131 func Xsqlite3VdbeSorterReset(tls *libc.TLS, db uintptr, pSorter uintptr) {
  98132 	var i int32
  98133 	vdbeSorterJoinAll(tls, pSorter, SQLITE_OK)
  98134 
  98135 	if (*VdbeSorter)(unsafe.Pointer(pSorter)).FpReader != 0 {
  98136 		vdbePmaReaderClear(tls, (*VdbeSorter)(unsafe.Pointer(pSorter)).FpReader)
  98137 		Xsqlite3DbFree(tls, db, (*VdbeSorter)(unsafe.Pointer(pSorter)).FpReader)
  98138 		(*VdbeSorter)(unsafe.Pointer(pSorter)).FpReader = uintptr(0)
  98139 	}
  98140 	vdbeMergeEngineFree(tls, (*VdbeSorter)(unsafe.Pointer(pSorter)).FpMerger)
  98141 	(*VdbeSorter)(unsafe.Pointer(pSorter)).FpMerger = uintptr(0)
  98142 	for i = 0; i < int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask); i++ {
  98143 		var pTask uintptr = pSorter + 96 + uintptr(i)*104
  98144 		vdbeSortSubtaskCleanup(tls, db, pTask)
  98145 		(*SortSubtask)(unsafe.Pointer(pTask)).FpSorter = pSorter
  98146 	}
  98147 	if (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory == uintptr(0) {
  98148 		vdbeSorterRecordFree(tls, uintptr(0), (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList)
  98149 	}
  98150 	(*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList = uintptr(0)
  98151 	(*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FszPMA = 0
  98152 	(*VdbeSorter)(unsafe.Pointer(pSorter)).FbUsePMA = U8(0)
  98153 	(*VdbeSorter)(unsafe.Pointer(pSorter)).FiMemory = 0
  98154 	(*VdbeSorter)(unsafe.Pointer(pSorter)).FmxKeysize = 0
  98155 	Xsqlite3DbFree(tls, db, (*VdbeSorter)(unsafe.Pointer(pSorter)).FpUnpacked)
  98156 	(*VdbeSorter)(unsafe.Pointer(pSorter)).FpUnpacked = uintptr(0)
  98157 }
  98158 
  98159 // Free any cursor components allocated by sqlite3VdbeSorterXXX routines.
  98160 func Xsqlite3VdbeSorterClose(tls *libc.TLS, db uintptr, pCsr uintptr) {
  98161 	var pSorter uintptr
  98162 
  98163 	pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 48))
  98164 	if pSorter != 0 {
  98165 		Xsqlite3VdbeSorterReset(tls, db, pSorter)
  98166 		Xsqlite3_free(tls, (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory)
  98167 		Xsqlite3DbFree(tls, db, pSorter)
  98168 		*(*uintptr)(unsafe.Pointer(pCsr + 48)) = uintptr(0)
  98169 	}
  98170 }
  98171 
  98172 func vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, nByte I64) {
  98173 	bp := tls.Alloc(24)
  98174 	defer tls.Free(24)
  98175 	*(*I64)(unsafe.Pointer(bp + 8)) = nByte
  98176 
  98177 	if *(*I64)(unsafe.Pointer(bp + 8)) <= I64((*Sqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= 3 {
  98178 		*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
  98179 		*(*int32)(unsafe.Pointer(bp)) = 4 * 1024
  98180 		Xsqlite3OsFileControlHint(tls, pFd, SQLITE_FCNTL_CHUNK_SIZE, bp)
  98181 		Xsqlite3OsFileControlHint(tls, pFd, SQLITE_FCNTL_SIZE_HINT, bp+8)
  98182 		Xsqlite3OsFetch(tls, pFd, int64(0), int32(*(*I64)(unsafe.Pointer(bp + 8))), bp+16)
  98183 		if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 {
  98184 			Xsqlite3OsUnfetch(tls, pFd, int64(0), *(*uintptr)(unsafe.Pointer(bp + 16)))
  98185 		}
  98186 	}
  98187 }
  98188 
  98189 func vdbeSorterOpenTempFile(tls *libc.TLS, db uintptr, nExtend I64, ppFd uintptr) int32 {
  98190 	bp := tls.Alloc(16)
  98191 	defer tls.Free(16)
  98192 
  98193 	if Xsqlite3FaultSim(tls, 202) != 0 {
  98194 		return SQLITE_IOERR | int32(13)<<8
  98195 	}
  98196 	*(*int32)(unsafe.Pointer(bp)) = Xsqlite3OsOpenMalloc(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), ppFd,
  98197 		SQLITE_OPEN_TEMP_JOURNAL|SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|SQLITE_OPEN_EXCLUSIVE|SQLITE_OPEN_DELETEONCLOSE, bp)
  98198 	if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
  98199 		*(*I64)(unsafe.Pointer(bp + 8)) = int64(SQLITE_MAX_MMAP_SIZE)
  98200 		Xsqlite3OsFileControlHint(tls, *(*uintptr)(unsafe.Pointer(ppFd)), SQLITE_FCNTL_MMAP_SIZE, bp+8)
  98201 		if nExtend > int64(0) {
  98202 			vdbeSorterExtendFile(tls, db, *(*uintptr)(unsafe.Pointer(ppFd)), nExtend)
  98203 		}
  98204 	}
  98205 	return *(*int32)(unsafe.Pointer(bp))
  98206 }
  98207 
  98208 func vdbeSortAllocUnpacked(tls *libc.TLS, pTask uintptr) int32 {
  98209 	if (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked == uintptr(0) {
  98210 		(*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked = Xsqlite3VdbeAllocUnpackedRecord(tls, (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo)
  98211 		if (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked == uintptr(0) {
  98212 			return SQLITE_NOMEM
  98213 		}
  98214 		(*UnpackedRecord)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked)).FnField = (*KeyInfo)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo)).FnKeyField
  98215 		(*UnpackedRecord)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked)).FerrCode = U8(0)
  98216 	}
  98217 	return SQLITE_OK
  98218 }
  98219 
  98220 func vdbeSorterMerge(tls *libc.TLS, pTask uintptr, p1 uintptr, p2 uintptr) uintptr {
  98221 	bp := tls.Alloc(12)
  98222 	defer tls.Free(12)
  98223 
  98224 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
  98225 	var pp uintptr = bp
  98226 	*(*int32)(unsafe.Pointer(bp + 8)) = 0
  98227 
  98228 	for {
  98229 		var res int32
  98230 		res = (*struct {
  98231 			f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32
  98232 		})(unsafe.Pointer(&struct{ uintptr }{(*SortSubtask)(unsafe.Pointer(pTask)).FxCompare})).f(tls,
  98233 			pTask, bp+8, p1+uintptr(1)*16, (*SorterRecord)(unsafe.Pointer(p1)).FnVal, p2+uintptr(1)*16, (*SorterRecord)(unsafe.Pointer(p2)).FnVal)
  98234 
  98235 		if res <= 0 {
  98236 			*(*uintptr)(unsafe.Pointer(pp)) = p1
  98237 			pp = p1 + 8
  98238 			p1 = *(*uintptr)(unsafe.Pointer(p1 + 8))
  98239 			if p1 == uintptr(0) {
  98240 				*(*uintptr)(unsafe.Pointer(pp)) = p2
  98241 				break
  98242 			}
  98243 		} else {
  98244 			*(*uintptr)(unsafe.Pointer(pp)) = p2
  98245 			pp = p2 + 8
  98246 			p2 = *(*uintptr)(unsafe.Pointer(p2 + 8))
  98247 			*(*int32)(unsafe.Pointer(bp + 8)) = 0
  98248 			if p2 == uintptr(0) {
  98249 				*(*uintptr)(unsafe.Pointer(pp)) = p1
  98250 				break
  98251 			}
  98252 		}
  98253 	}
  98254 	return *(*uintptr)(unsafe.Pointer(bp))
  98255 }
  98256 
  98257 func vdbeSorterGetCompare(tls *libc.TLS, p uintptr) SorterCompare {
  98258 	if int32((*VdbeSorter)(unsafe.Pointer(p)).FtypeMask) == SORTER_TYPE_INTEGER {
  98259 		return *(*uintptr)(unsafe.Pointer(&struct {
  98260 			f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32
  98261 		}{vdbeSorterCompareInt}))
  98262 	} else if int32((*VdbeSorter)(unsafe.Pointer(p)).FtypeMask) == SORTER_TYPE_TEXT {
  98263 		return *(*uintptr)(unsafe.Pointer(&struct {
  98264 			f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32
  98265 		}{vdbeSorterCompareText}))
  98266 	}
  98267 	return *(*uintptr)(unsafe.Pointer(&struct {
  98268 		f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32
  98269 	}{vdbeSorterCompare}))
  98270 }
  98271 
  98272 func vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) int32 {
  98273 	bp := tls.Alloc(512)
  98274 	defer tls.Free(512)
  98275 
  98276 	var i int32
  98277 	var p uintptr
  98278 	var rc int32
  98279 
  98280 	rc = vdbeSortAllocUnpacked(tls, pTask)
  98281 	if rc != SQLITE_OK {
  98282 		return rc
  98283 	}
  98284 
  98285 	p = (*SorterList)(unsafe.Pointer(pList)).FpList
  98286 	(*SortSubtask)(unsafe.Pointer(pTask)).FxCompare = vdbeSorterGetCompare(tls, (*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)
  98287 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof([64]uintptr{})))
  98288 
  98289 	for p != 0 {
  98290 		var pNext uintptr
  98291 		if (*SorterList)(unsafe.Pointer(pList)).FaMemory != 0 {
  98292 			if p == (*SorterList)(unsafe.Pointer(pList)).FaMemory {
  98293 				pNext = uintptr(0)
  98294 			} else {
  98295 				pNext = (*SorterList)(unsafe.Pointer(pList)).FaMemory + uintptr(*(*int32)(unsafe.Pointer(p + 8)))
  98296 			}
  98297 		} else {
  98298 			pNext = *(*uintptr)(unsafe.Pointer(p + 8))
  98299 		}
  98300 
  98301 		*(*uintptr)(unsafe.Pointer(p + 8)) = uintptr(0)
  98302 		for i = 0; *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)) != 0; i++ {
  98303 			p = vdbeSorterMerge(tls, pTask, p, *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)))
  98304 			*(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)) = uintptr(0)
  98305 		}
  98306 		*(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)) = p
  98307 		p = pNext
  98308 	}
  98309 
  98310 	p = uintptr(0)
  98311 	for i = 0; i < int32(uint64(unsafe.Sizeof([64]uintptr{}))/uint64(unsafe.Sizeof(uintptr(0)))); i++ {
  98312 		if *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)) == uintptr(0) {
  98313 			continue
  98314 		}
  98315 		if p != 0 {
  98316 			p = vdbeSorterMerge(tls, pTask, p, *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)))
  98317 		} else {
  98318 			p = *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8))
  98319 		}
  98320 	}
  98321 	(*SorterList)(unsafe.Pointer(pList)).FpList = p
  98322 
  98323 	return int32((*UnpackedRecord)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked)).FerrCode)
  98324 }
  98325 
  98326 func vdbePmaWriterInit(tls *libc.TLS, pFd uintptr, p uintptr, nBuf int32, iStart I64) {
  98327 	libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(PmaWriter{})))
  98328 	(*PmaWriter)(unsafe.Pointer(p)).FaBuffer = Xsqlite3Malloc(tls, uint64(nBuf))
  98329 	if !(int32((*PmaWriter)(unsafe.Pointer(p)).FaBuffer) != 0) {
  98330 		(*PmaWriter)(unsafe.Pointer(p)).FeFWErr = SQLITE_NOMEM
  98331 	} else {
  98332 		(*PmaWriter)(unsafe.Pointer(p)).FiBufEnd = libc.AssignPtrInt32(p+20, int32(iStart%I64(nBuf)))
  98333 		(*PmaWriter)(unsafe.Pointer(p)).FiWriteOff = iStart - I64((*PmaWriter)(unsafe.Pointer(p)).FiBufStart)
  98334 		(*PmaWriter)(unsafe.Pointer(p)).FnBuffer = nBuf
  98335 		(*PmaWriter)(unsafe.Pointer(p)).FpFd = pFd
  98336 	}
  98337 }
  98338 
  98339 func vdbePmaWriteBlob(tls *libc.TLS, p uintptr, pData uintptr, nData int32) {
  98340 	var nRem int32 = nData
  98341 	for nRem > 0 && (*PmaWriter)(unsafe.Pointer(p)).FeFWErr == 0 {
  98342 		var nCopy int32 = nRem
  98343 		if nCopy > (*PmaWriter)(unsafe.Pointer(p)).FnBuffer-(*PmaWriter)(unsafe.Pointer(p)).FiBufEnd {
  98344 			nCopy = (*PmaWriter)(unsafe.Pointer(p)).FnBuffer - (*PmaWriter)(unsafe.Pointer(p)).FiBufEnd
  98345 		}
  98346 
  98347 		libc.Xmemcpy(tls, (*PmaWriter)(unsafe.Pointer(p)).FaBuffer+uintptr((*PmaWriter)(unsafe.Pointer(p)).FiBufEnd), pData+uintptr(nData-nRem), uint64(nCopy))
  98348 		*(*int32)(unsafe.Pointer(p + 24)) += nCopy
  98349 		if (*PmaWriter)(unsafe.Pointer(p)).FiBufEnd == (*PmaWriter)(unsafe.Pointer(p)).FnBuffer {
  98350 			(*PmaWriter)(unsafe.Pointer(p)).FeFWErr = Xsqlite3OsWrite(tls, (*PmaWriter)(unsafe.Pointer(p)).FpFd,
  98351 				(*PmaWriter)(unsafe.Pointer(p)).FaBuffer+uintptr((*PmaWriter)(unsafe.Pointer(p)).FiBufStart), (*PmaWriter)(unsafe.Pointer(p)).FiBufEnd-(*PmaWriter)(unsafe.Pointer(p)).FiBufStart,
  98352 				(*PmaWriter)(unsafe.Pointer(p)).FiWriteOff+I64((*PmaWriter)(unsafe.Pointer(p)).FiBufStart))
  98353 			(*PmaWriter)(unsafe.Pointer(p)).FiBufStart = libc.AssignPtrInt32(p+24, 0)
  98354 			*(*I64)(unsafe.Pointer(p + 32)) += I64((*PmaWriter)(unsafe.Pointer(p)).FnBuffer)
  98355 		}
  98356 
  98357 		nRem = nRem - nCopy
  98358 	}
  98359 }
  98360 
  98361 func vdbePmaWriterFinish(tls *libc.TLS, p uintptr, piEof uintptr) int32 {
  98362 	var rc int32
  98363 	if (*PmaWriter)(unsafe.Pointer(p)).FeFWErr == 0 && (*PmaWriter)(unsafe.Pointer(p)).FaBuffer != 0 && (*PmaWriter)(unsafe.Pointer(p)).FiBufEnd > (*PmaWriter)(unsafe.Pointer(p)).FiBufStart {
  98364 		(*PmaWriter)(unsafe.Pointer(p)).FeFWErr = Xsqlite3OsWrite(tls, (*PmaWriter)(unsafe.Pointer(p)).FpFd,
  98365 			(*PmaWriter)(unsafe.Pointer(p)).FaBuffer+uintptr((*PmaWriter)(unsafe.Pointer(p)).FiBufStart), (*PmaWriter)(unsafe.Pointer(p)).FiBufEnd-(*PmaWriter)(unsafe.Pointer(p)).FiBufStart,
  98366 			(*PmaWriter)(unsafe.Pointer(p)).FiWriteOff+I64((*PmaWriter)(unsafe.Pointer(p)).FiBufStart))
  98367 	}
  98368 	*(*I64)(unsafe.Pointer(piEof)) = (*PmaWriter)(unsafe.Pointer(p)).FiWriteOff + I64((*PmaWriter)(unsafe.Pointer(p)).FiBufEnd)
  98369 	Xsqlite3_free(tls, (*PmaWriter)(unsafe.Pointer(p)).FaBuffer)
  98370 	rc = (*PmaWriter)(unsafe.Pointer(p)).FeFWErr
  98371 	libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(PmaWriter{})))
  98372 	return rc
  98373 }
  98374 
  98375 func vdbePmaWriteVarint(tls *libc.TLS, p uintptr, iVal U64) {
  98376 	bp := tls.Alloc(10)
  98377 	defer tls.Free(10)
  98378 
  98379 	var nByte int32
  98380 
  98381 	nByte = Xsqlite3PutVarint(tls, bp, iVal)
  98382 	vdbePmaWriteBlob(tls, p, bp, nByte)
  98383 }
  98384 
  98385 func vdbeSorterListToPMA(tls *libc.TLS, pTask uintptr, pList uintptr) int32 {
  98386 	bp := tls.Alloc(48)
  98387 	defer tls.Free(48)
  98388 
  98389 	var db uintptr = (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb
  98390 	var rc int32 = SQLITE_OK
  98391 
  98392 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(PmaWriter{})))
  98393 
  98394 	if (*SortSubtask)(unsafe.Pointer(pTask)).Ffile.FpFd == uintptr(0) {
  98395 		rc = vdbeSorterOpenTempFile(tls, db, int64(0), pTask+72)
  98396 
  98397 	}
  98398 
  98399 	if rc == SQLITE_OK {
  98400 		vdbeSorterExtendFile(tls, db, (*SortSubtask)(unsafe.Pointer(pTask)).Ffile.FpFd, (*SortSubtask)(unsafe.Pointer(pTask)).Ffile.FiEof+I64((*SorterList)(unsafe.Pointer(pList)).FszPMA)+int64(9))
  98401 	}
  98402 
  98403 	if rc == SQLITE_OK {
  98404 		rc = vdbeSorterSort(tls, pTask, pList)
  98405 	}
  98406 
  98407 	if rc == SQLITE_OK {
  98408 		var p uintptr
  98409 		var pNext uintptr = uintptr(0)
  98410 
  98411 		vdbePmaWriterInit(tls, (*SortSubtask)(unsafe.Pointer(pTask)).Ffile.FpFd, bp, (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fpgsz,
  98412 			(*SortSubtask)(unsafe.Pointer(pTask)).Ffile.FiEof)
  98413 		(*SortSubtask)(unsafe.Pointer(pTask)).FnPMA++
  98414 		vdbePmaWriteVarint(tls, bp, uint64((*SorterList)(unsafe.Pointer(pList)).FszPMA))
  98415 		for p = (*SorterList)(unsafe.Pointer(pList)).FpList; p != 0; p = pNext {
  98416 			pNext = *(*uintptr)(unsafe.Pointer(p + 8))
  98417 			vdbePmaWriteVarint(tls, bp, uint64((*SorterRecord)(unsafe.Pointer(p)).FnVal))
  98418 			vdbePmaWriteBlob(tls, bp, p+uintptr(1)*16, (*SorterRecord)(unsafe.Pointer(p)).FnVal)
  98419 			if (*SorterList)(unsafe.Pointer(pList)).FaMemory == uintptr(0) {
  98420 				Xsqlite3_free(tls, p)
  98421 			}
  98422 		}
  98423 		(*SorterList)(unsafe.Pointer(pList)).FpList = p
  98424 		rc = vdbePmaWriterFinish(tls, bp, pTask+72+8)
  98425 	}
  98426 
  98427 	return rc
  98428 }
  98429 
  98430 func vdbeMergeEngineStep(tls *libc.TLS, pMerger uintptr, pbEof uintptr) int32 {
  98431 	bp := tls.Alloc(4)
  98432 	defer tls.Free(4)
  98433 
  98434 	var rc int32
  98435 	var iPrev int32 = *(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + 1*4))
  98436 	var pTask uintptr = (*MergeEngine)(unsafe.Pointer(pMerger)).FpTask
  98437 
  98438 	rc = vdbePmaReaderNext(tls, (*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr+uintptr(iPrev)*80)
  98439 
  98440 	if rc == SQLITE_OK {
  98441 		var i int32
  98442 		var pReadr1 uintptr
  98443 		var pReadr2 uintptr
  98444 		*(*int32)(unsafe.Pointer(bp)) = 0
  98445 
  98446 		pReadr1 = (*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(iPrev&0xFFFE)*80
  98447 		pReadr2 = (*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(iPrev|0x0001)*80
  98448 
  98449 		for i = ((*MergeEngine)(unsafe.Pointer(pMerger)).FnTree + iPrev) / 2; i > 0; i = i / 2 {
  98450 			var iRes int32
  98451 			if (*PmaReader)(unsafe.Pointer(pReadr1)).FpFd == uintptr(0) {
  98452 				iRes = +1
  98453 			} else if (*PmaReader)(unsafe.Pointer(pReadr2)).FpFd == uintptr(0) {
  98454 				iRes = -1
  98455 			} else {
  98456 				iRes = (*struct {
  98457 					f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32
  98458 				})(unsafe.Pointer(&struct{ uintptr }{(*SortSubtask)(unsafe.Pointer(pTask)).FxCompare})).f(tls, pTask, bp,
  98459 					(*PmaReader)(unsafe.Pointer(pReadr1)).FaKey, (*PmaReader)(unsafe.Pointer(pReadr1)).FnKey, (*PmaReader)(unsafe.Pointer(pReadr2)).FaKey, (*PmaReader)(unsafe.Pointer(pReadr2)).FnKey)
  98460 			}
  98461 
  98462 			if iRes < 0 || iRes == 0 && pReadr1 < pReadr2 {
  98463 				*(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + uintptr(i)*4)) = int32((int64(pReadr1) - int64((*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr)) / 80)
  98464 				pReadr2 = (*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(*(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + uintptr(i^0x0001)*4)))*80
  98465 				*(*int32)(unsafe.Pointer(bp)) = 0
  98466 			} else {
  98467 				if (*PmaReader)(unsafe.Pointer(pReadr1)).FpFd != 0 {
  98468 					*(*int32)(unsafe.Pointer(bp)) = 0
  98469 				}
  98470 				*(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + uintptr(i)*4)) = int32((int64(pReadr2) - int64((*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr)) / 80)
  98471 				pReadr1 = (*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(*(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + uintptr(i^0x0001)*4)))*80
  98472 			}
  98473 		}
  98474 		*(*int32)(unsafe.Pointer(pbEof)) = libc.Bool32((*PmaReader)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr+uintptr(*(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + 1*4)))*80)).FpFd == uintptr(0))
  98475 	}
  98476 
  98477 	return func() int32 {
  98478 		if rc == SQLITE_OK {
  98479 			return int32((*UnpackedRecord)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked)).FerrCode)
  98480 		}
  98481 		return rc
  98482 	}()
  98483 }
  98484 
  98485 func vdbeSorterFlushThread(tls *libc.TLS, pCtx uintptr) uintptr {
  98486 	var pTask uintptr = pCtx
  98487 	var rc int32
  98488 
  98489 	rc = vdbeSorterListToPMA(tls, pTask, pTask+32)
  98490 	(*SortSubtask)(unsafe.Pointer(pTask)).FbDone = 1
  98491 	return uintptr(int64(rc))
  98492 }
  98493 
  98494 func vdbeSorterFlushPMA(tls *libc.TLS, pSorter uintptr) int32 {
  98495 	var rc int32 = SQLITE_OK
  98496 	var i int32
  98497 	var pTask uintptr = uintptr(0)
  98498 	var nWorker int32 = int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask) - 1
  98499 
  98500 	(*VdbeSorter)(unsafe.Pointer(pSorter)).FbUsePMA = U8(1)
  98501 
  98502 	for i = 0; i < nWorker; i++ {
  98503 		var iTest int32 = (int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FiPrev) + i + 1) % nWorker
  98504 		pTask = pSorter + 96 + uintptr(iTest)*104
  98505 		if (*SortSubtask)(unsafe.Pointer(pTask)).FbDone != 0 {
  98506 			rc = vdbeSorterJoinThread(tls, pTask)
  98507 		}
  98508 		if rc != SQLITE_OK || (*SortSubtask)(unsafe.Pointer(pTask)).FpThread == uintptr(0) {
  98509 			break
  98510 		}
  98511 	}
  98512 
  98513 	if rc == SQLITE_OK {
  98514 		if i == nWorker {
  98515 			rc = vdbeSorterListToPMA(tls, pSorter+96+uintptr(nWorker)*104, pSorter+56)
  98516 		} else {
  98517 			var aMem uintptr
  98518 			var pCtx uintptr
  98519 
  98520 			aMem = (*SortSubtask)(unsafe.Pointer(pTask)).Flist.FaMemory
  98521 			pCtx = pTask
  98522 			(*VdbeSorter)(unsafe.Pointer(pSorter)).FiPrev = U8(int64((pTask - (pSorter + 96)) / 104))
  98523 			(*SortSubtask)(unsafe.Pointer(pTask)).Flist = (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist
  98524 			(*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList = uintptr(0)
  98525 			(*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FszPMA = 0
  98526 			if aMem != 0 {
  98527 				(*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory = aMem
  98528 				(*VdbeSorter)(unsafe.Pointer(pSorter)).FnMemory = Xsqlite3MallocSize(tls, aMem)
  98529 			} else if (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory != 0 {
  98530 				(*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory = Xsqlite3Malloc(tls, uint64((*VdbeSorter)(unsafe.Pointer(pSorter)).FnMemory))
  98531 				if !(int32((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory) != 0) {
  98532 					return SQLITE_NOMEM
  98533 				}
  98534 			}
  98535 
  98536 			rc = vdbeSorterCreateThread(tls, pTask, *(*uintptr)(unsafe.Pointer(&struct {
  98537 				f func(*libc.TLS, uintptr) uintptr
  98538 			}{vdbeSorterFlushThread})), pCtx)
  98539 		}
  98540 	}
  98541 
  98542 	return rc
  98543 }
  98544 
  98545 // Add a record to the sorter.
  98546 func Xsqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) int32 {
  98547 	bp := tls.Alloc(4)
  98548 	defer tls.Free(4)
  98549 
  98550 	var pSorter uintptr
  98551 	var rc int32 = SQLITE_OK
  98552 	var pNew uintptr
  98553 	var bFlush int32
  98554 	var nReq int32
  98555 	var nPMA int32
  98556 
  98557 	pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 48))
  98558 	*(*int32)(unsafe.Pointer(bp)) = int32(U32(*(*U8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pVal)).Fz + 1))))
  98559 	if *(*int32)(unsafe.Pointer(bp)) >= 0x80 {
  98560 		Xsqlite3GetVarint32(tls, (*Mem)(unsafe.Pointer(pVal)).Fz+1, bp)
  98561 	}
  98562 	if *(*int32)(unsafe.Pointer(bp)) > 0 && *(*int32)(unsafe.Pointer(bp)) < 10 && *(*int32)(unsafe.Pointer(bp)) != 7 {
  98563 		*(*U8)(unsafe.Pointer(pSorter + 92)) &= U8(SORTER_TYPE_INTEGER)
  98564 	} else if *(*int32)(unsafe.Pointer(bp)) > 10 && *(*int32)(unsafe.Pointer(bp))&0x01 != 0 {
  98565 		*(*U8)(unsafe.Pointer(pSorter + 92)) &= U8(SORTER_TYPE_TEXT)
  98566 	} else {
  98567 		(*VdbeSorter)(unsafe.Pointer(pSorter)).FtypeMask = U8(0)
  98568 	}
  98569 
  98570 	nReq = int32(uint64((*Mem)(unsafe.Pointer(pVal)).Fn) + uint64(unsafe.Sizeof(SorterRecord{})))
  98571 	nPMA = (*Mem)(unsafe.Pointer(pVal)).Fn + Xsqlite3VarintLen(tls, uint64((*Mem)(unsafe.Pointer(pVal)).Fn))
  98572 	if (*VdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize != 0 {
  98573 		if (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory != 0 {
  98574 			bFlush = libc.Bool32((*VdbeSorter)(unsafe.Pointer(pSorter)).FiMemory != 0 && (*VdbeSorter)(unsafe.Pointer(pSorter)).FiMemory+nReq > (*VdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize)
  98575 		} else {
  98576 			bFlush = libc.Bool32((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FszPMA > (*VdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize ||
  98577 				(*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FszPMA > (*VdbeSorter)(unsafe.Pointer(pSorter)).FmnPmaSize && Xsqlite3HeapNearlyFull(tls) != 0)
  98578 		}
  98579 		if bFlush != 0 {
  98580 			rc = vdbeSorterFlushPMA(tls, pSorter)
  98581 			(*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FszPMA = 0
  98582 			(*VdbeSorter)(unsafe.Pointer(pSorter)).FiMemory = 0
  98583 
  98584 		}
  98585 	}
  98586 
  98587 	*(*int32)(unsafe.Pointer(pSorter + 56 + 16)) += nPMA
  98588 	if nPMA > (*VdbeSorter)(unsafe.Pointer(pSorter)).FmxKeysize {
  98589 		(*VdbeSorter)(unsafe.Pointer(pSorter)).FmxKeysize = nPMA
  98590 	}
  98591 
  98592 	if (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory != 0 {
  98593 		var nMin int32 = (*VdbeSorter)(unsafe.Pointer(pSorter)).FiMemory + nReq
  98594 
  98595 		if nMin > (*VdbeSorter)(unsafe.Pointer(pSorter)).FnMemory {
  98596 			var aNew uintptr
  98597 			var nNew Sqlite3_int64 = int64(2) * Sqlite3_int64((*VdbeSorter)(unsafe.Pointer(pSorter)).FnMemory)
  98598 			var iListOff int32 = -1
  98599 			if (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList != 0 {
  98600 				iListOff = int32((int64((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList) - int64((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory)) / 1)
  98601 			}
  98602 			for nNew < Sqlite3_int64(nMin) {
  98603 				nNew = nNew * int64(2)
  98604 			}
  98605 			if nNew > Sqlite3_int64((*VdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize) {
  98606 				nNew = Sqlite3_int64((*VdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize)
  98607 			}
  98608 			if nNew < Sqlite3_int64(nMin) {
  98609 				nNew = Sqlite3_int64(nMin)
  98610 			}
  98611 			aNew = Xsqlite3Realloc(tls, (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory, uint64(nNew))
  98612 			if !(aNew != 0) {
  98613 				return SQLITE_NOMEM
  98614 			}
  98615 			if iListOff >= 0 {
  98616 				(*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList = aNew + uintptr(iListOff)
  98617 			}
  98618 			(*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory = aNew
  98619 			(*VdbeSorter)(unsafe.Pointer(pSorter)).FnMemory = int32(nNew)
  98620 		}
  98621 
  98622 		pNew = (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory + uintptr((*VdbeSorter)(unsafe.Pointer(pSorter)).FiMemory)
  98623 		*(*int32)(unsafe.Pointer(pSorter + 80)) += (nReq + 7) & libc.CplInt32(7)
  98624 		if (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList != 0 {
  98625 			*(*int32)(unsafe.Pointer(pNew + 8)) = int32((int64((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList) - int64((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory)) / 1)
  98626 		}
  98627 	} else {
  98628 		pNew = Xsqlite3Malloc(tls, uint64(nReq))
  98629 		if pNew == uintptr(0) {
  98630 			return SQLITE_NOMEM
  98631 		}
  98632 		*(*uintptr)(unsafe.Pointer(pNew + 8)) = (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList
  98633 	}
  98634 
  98635 	libc.Xmemcpy(tls, pNew+uintptr(1)*16, (*Mem)(unsafe.Pointer(pVal)).Fz, uint64((*Mem)(unsafe.Pointer(pVal)).Fn))
  98636 	(*SorterRecord)(unsafe.Pointer(pNew)).FnVal = (*Mem)(unsafe.Pointer(pVal)).Fn
  98637 	(*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList = pNew
  98638 
  98639 	return rc
  98640 }
  98641 
  98642 func vdbeIncrPopulate(tls *libc.TLS, pIncr uintptr) int32 {
  98643 	bp := tls.Alloc(52)
  98644 	defer tls.Free(52)
  98645 
  98646 	var rc int32 = SQLITE_OK
  98647 	var rc2 int32
  98648 	var iStart I64 = (*IncrMerger)(unsafe.Pointer(pIncr)).FiStartOff
  98649 	var pOut uintptr = pIncr + 40 + 1*16
  98650 	var pTask uintptr = (*IncrMerger)(unsafe.Pointer(pIncr)).FpTask
  98651 	var pMerger uintptr = (*IncrMerger)(unsafe.Pointer(pIncr)).FpMerger
  98652 
  98653 	vdbePmaWriterInit(tls, (*SorterFile)(unsafe.Pointer(pOut)).FpFd, bp, (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fpgsz, iStart)
  98654 	for rc == SQLITE_OK {
  98655 		var pReader uintptr = (*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(*(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + 1*4)))*80
  98656 		var nKey int32 = (*PmaReader)(unsafe.Pointer(pReader)).FnKey
  98657 		var iEof I64 = (*PmaWriter)(unsafe.Pointer(bp)).FiWriteOff + I64((*PmaWriter)(unsafe.Pointer(bp)).FiBufEnd)
  98658 
  98659 		if (*PmaReader)(unsafe.Pointer(pReader)).FpFd == uintptr(0) {
  98660 			break
  98661 		}
  98662 		if iEof+I64(nKey)+I64(Xsqlite3VarintLen(tls, uint64(nKey))) > iStart+I64((*IncrMerger)(unsafe.Pointer(pIncr)).FmxSz) {
  98663 			break
  98664 		}
  98665 
  98666 		vdbePmaWriteVarint(tls, bp, uint64(nKey))
  98667 		vdbePmaWriteBlob(tls, bp, (*PmaReader)(unsafe.Pointer(pReader)).FaKey, nKey)
  98668 
  98669 		rc = vdbeMergeEngineStep(tls, (*IncrMerger)(unsafe.Pointer(pIncr)).FpMerger, bp+48)
  98670 	}
  98671 
  98672 	rc2 = vdbePmaWriterFinish(tls, bp, pOut+8)
  98673 	if rc == SQLITE_OK {
  98674 		rc = rc2
  98675 	}
  98676 
  98677 	return rc
  98678 }
  98679 
  98680 func vdbeIncrPopulateThread(tls *libc.TLS, pCtx uintptr) uintptr {
  98681 	var pIncr uintptr = pCtx
  98682 	var pRet uintptr = uintptr(int64(vdbeIncrPopulate(tls, pIncr)))
  98683 	(*SortSubtask)(unsafe.Pointer((*IncrMerger)(unsafe.Pointer(pIncr)).FpTask)).FbDone = 1
  98684 	return pRet
  98685 }
  98686 
  98687 func vdbeIncrBgPopulate(tls *libc.TLS, pIncr uintptr) int32 {
  98688 	var p uintptr = pIncr
  98689 
  98690 	return vdbeSorterCreateThread(tls, (*IncrMerger)(unsafe.Pointer(pIncr)).FpTask, *(*uintptr)(unsafe.Pointer(&struct {
  98691 		f func(*libc.TLS, uintptr) uintptr
  98692 	}{vdbeIncrPopulateThread})), p)
  98693 }
  98694 
  98695 func vdbeIncrSwap(tls *libc.TLS, pIncr uintptr) int32 {
  98696 	var rc int32 = SQLITE_OK
  98697 
  98698 	if (*IncrMerger)(unsafe.Pointer(pIncr)).FbUseThread != 0 {
  98699 		rc = vdbeSorterJoinThread(tls, (*IncrMerger)(unsafe.Pointer(pIncr)).FpTask)
  98700 
  98701 		if rc == SQLITE_OK {
  98702 			var f0 = *(*SorterFile)(unsafe.Pointer(pIncr + 40))
  98703 			*(*SorterFile)(unsafe.Pointer(pIncr + 40)) = *(*SorterFile)(unsafe.Pointer(pIncr + 40 + 1*16))
  98704 			*(*SorterFile)(unsafe.Pointer(pIncr + 40 + 1*16)) = f0
  98705 		}
  98706 
  98707 		if rc == SQLITE_OK {
  98708 			if (*SorterFile)(unsafe.Pointer(pIncr+40)).FiEof == (*IncrMerger)(unsafe.Pointer(pIncr)).FiStartOff {
  98709 				(*IncrMerger)(unsafe.Pointer(pIncr)).FbEof = 1
  98710 			} else {
  98711 				rc = vdbeIncrBgPopulate(tls, pIncr)
  98712 			}
  98713 		}
  98714 	} else {
  98715 		rc = vdbeIncrPopulate(tls, pIncr)
  98716 		*(*SorterFile)(unsafe.Pointer(pIncr + 40)) = *(*SorterFile)(unsafe.Pointer(pIncr + 40 + 1*16))
  98717 		if (*SorterFile)(unsafe.Pointer(pIncr+40)).FiEof == (*IncrMerger)(unsafe.Pointer(pIncr)).FiStartOff {
  98718 			(*IncrMerger)(unsafe.Pointer(pIncr)).FbEof = 1
  98719 		}
  98720 	}
  98721 
  98722 	return rc
  98723 }
  98724 
  98725 func vdbeIncrMergerNew(tls *libc.TLS, pTask uintptr, pMerger uintptr, ppOut uintptr) int32 {
  98726 	var rc int32 = SQLITE_OK
  98727 	var pIncr uintptr = libc.AssignPtrUintptr(ppOut, func() uintptr {
  98728 		if Xsqlite3FaultSim(tls, 100) != 0 {
  98729 			return uintptr(0)
  98730 		}
  98731 		return Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(IncrMerger{})))
  98732 	}())
  98733 	if pIncr != 0 {
  98734 		(*IncrMerger)(unsafe.Pointer(pIncr)).FpMerger = pMerger
  98735 		(*IncrMerger)(unsafe.Pointer(pIncr)).FpTask = pTask
  98736 		(*IncrMerger)(unsafe.Pointer(pIncr)).FmxSz = func() int32 {
  98737 			if (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FmxKeysize+9 > (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FmxPmaSize/2 {
  98738 				return (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FmxKeysize + 9
  98739 			}
  98740 			return (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FmxPmaSize / 2
  98741 		}()
  98742 		*(*I64)(unsafe.Pointer(pTask + 88 + 8)) += I64((*IncrMerger)(unsafe.Pointer(pIncr)).FmxSz)
  98743 	} else {
  98744 		vdbeMergeEngineFree(tls, pMerger)
  98745 		rc = SQLITE_NOMEM
  98746 	}
  98747 
  98748 	return rc
  98749 }
  98750 
  98751 func vdbeIncrMergerSetThreads(tls *libc.TLS, pIncr uintptr) {
  98752 	(*IncrMerger)(unsafe.Pointer(pIncr)).FbUseThread = 1
  98753 	*(*I64)(unsafe.Pointer((*IncrMerger)(unsafe.Pointer(pIncr)).FpTask + 88 + 8)) -= I64((*IncrMerger)(unsafe.Pointer(pIncr)).FmxSz)
  98754 }
  98755 
  98756 func vdbeMergeEngineCompare(tls *libc.TLS, pMerger uintptr, iOut int32) {
  98757 	bp := tls.Alloc(4)
  98758 	defer tls.Free(4)
  98759 
  98760 	var i1 int32
  98761 	var i2 int32
  98762 	var iRes int32
  98763 	var p1 uintptr
  98764 	var p2 uintptr
  98765 
  98766 	if iOut >= (*MergeEngine)(unsafe.Pointer(pMerger)).FnTree/2 {
  98767 		i1 = (iOut - (*MergeEngine)(unsafe.Pointer(pMerger)).FnTree/2) * 2
  98768 		i2 = i1 + 1
  98769 	} else {
  98770 		i1 = *(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + uintptr(iOut*2)*4))
  98771 		i2 = *(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + uintptr(iOut*2+1)*4))
  98772 	}
  98773 
  98774 	p1 = (*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(i1)*80
  98775 	p2 = (*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(i2)*80
  98776 
  98777 	if (*PmaReader)(unsafe.Pointer(p1)).FpFd == uintptr(0) {
  98778 		iRes = i2
  98779 	} else if (*PmaReader)(unsafe.Pointer(p2)).FpFd == uintptr(0) {
  98780 		iRes = i1
  98781 	} else {
  98782 		var pTask uintptr = (*MergeEngine)(unsafe.Pointer(pMerger)).FpTask
  98783 		*(*int32)(unsafe.Pointer(bp)) = 0
  98784 		var res int32
  98785 
  98786 		res = (*struct {
  98787 			f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32
  98788 		})(unsafe.Pointer(&struct{ uintptr }{(*SortSubtask)(unsafe.Pointer(pTask)).FxCompare})).f(tls,
  98789 			pTask, bp, (*PmaReader)(unsafe.Pointer(p1)).FaKey, (*PmaReader)(unsafe.Pointer(p1)).FnKey, (*PmaReader)(unsafe.Pointer(p2)).FaKey, (*PmaReader)(unsafe.Pointer(p2)).FnKey)
  98790 		if res <= 0 {
  98791 			iRes = i1
  98792 		} else {
  98793 			iRes = i2
  98794 		}
  98795 	}
  98796 
  98797 	*(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + uintptr(iOut)*4)) = iRes
  98798 }
  98799 
  98800 func vdbeMergeEngineInit(tls *libc.TLS, pTask uintptr, pMerger uintptr, eMode int32) int32 {
  98801 	var rc int32 = SQLITE_OK
  98802 	var i int32
  98803 	var nTree int32
  98804 
  98805 	(*MergeEngine)(unsafe.Pointer(pMerger)).FpTask = pTask
  98806 
  98807 	nTree = (*MergeEngine)(unsafe.Pointer(pMerger)).FnTree
  98808 	for i = 0; i < nTree; i++ {
  98809 		if SQLITE_MAX_WORKER_THREADS > 0 && eMode == INCRINIT_ROOT {
  98810 			rc = vdbePmaReaderNext(tls, (*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr+uintptr(nTree-i-1)*80)
  98811 		} else {
  98812 			rc = vdbePmaReaderIncrInit(tls, (*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr+uintptr(i)*80, INCRINIT_NORMAL)
  98813 		}
  98814 		if rc != SQLITE_OK {
  98815 			return rc
  98816 		}
  98817 	}
  98818 
  98819 	for i = (*MergeEngine)(unsafe.Pointer(pMerger)).FnTree - 1; i > 0; i-- {
  98820 		vdbeMergeEngineCompare(tls, pMerger, i)
  98821 	}
  98822 	return int32((*UnpackedRecord)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked)).FerrCode)
  98823 }
  98824 
  98825 func vdbePmaReaderIncrMergeInit(tls *libc.TLS, pReadr uintptr, eMode int32) int32 {
  98826 	var rc int32 = SQLITE_OK
  98827 	var pIncr uintptr = (*PmaReader)(unsafe.Pointer(pReadr)).FpIncr
  98828 	var pTask uintptr = (*IncrMerger)(unsafe.Pointer(pIncr)).FpTask
  98829 	var db uintptr = (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb
  98830 
  98831 	rc = vdbeMergeEngineInit(tls, pTask, (*IncrMerger)(unsafe.Pointer(pIncr)).FpMerger, eMode)
  98832 
  98833 	if rc == SQLITE_OK {
  98834 		var mxSz int32 = (*IncrMerger)(unsafe.Pointer(pIncr)).FmxSz
  98835 		if (*IncrMerger)(unsafe.Pointer(pIncr)).FbUseThread != 0 {
  98836 			rc = vdbeSorterOpenTempFile(tls, db, int64(mxSz), pIncr+40)
  98837 			if rc == SQLITE_OK {
  98838 				rc = vdbeSorterOpenTempFile(tls, db, int64(mxSz), pIncr+40+1*16)
  98839 			}
  98840 		} else {
  98841 			if (*SortSubtask)(unsafe.Pointer(pTask)).Ffile2.FpFd == uintptr(0) {
  98842 				rc = vdbeSorterOpenTempFile(tls, db, (*SortSubtask)(unsafe.Pointer(pTask)).Ffile2.FiEof, pTask+88)
  98843 				(*SortSubtask)(unsafe.Pointer(pTask)).Ffile2.FiEof = int64(0)
  98844 			}
  98845 			if rc == SQLITE_OK {
  98846 				(*SorterFile)(unsafe.Pointer(pIncr + 40 + 1*16)).FpFd = (*SortSubtask)(unsafe.Pointer(pTask)).Ffile2.FpFd
  98847 				(*IncrMerger)(unsafe.Pointer(pIncr)).FiStartOff = (*SortSubtask)(unsafe.Pointer(pTask)).Ffile2.FiEof
  98848 				*(*I64)(unsafe.Pointer(pTask + 88 + 8)) += I64(mxSz)
  98849 			}
  98850 		}
  98851 	}
  98852 
  98853 	if rc == SQLITE_OK && (*IncrMerger)(unsafe.Pointer(pIncr)).FbUseThread != 0 {
  98854 		rc = vdbeIncrPopulate(tls, pIncr)
  98855 	}
  98856 
  98857 	if rc == SQLITE_OK && (SQLITE_MAX_WORKER_THREADS == 0 || eMode != INCRINIT_TASK) {
  98858 		rc = vdbePmaReaderNext(tls, pReadr)
  98859 	}
  98860 
  98861 	return rc
  98862 }
  98863 
  98864 func vdbePmaReaderBgIncrInit(tls *libc.TLS, pCtx uintptr) uintptr {
  98865 	var pReader uintptr = pCtx
  98866 	var pRet uintptr = uintptr(int64(vdbePmaReaderIncrMergeInit(tls, pReader, INCRINIT_TASK)))
  98867 	(*SortSubtask)(unsafe.Pointer((*IncrMerger)(unsafe.Pointer((*PmaReader)(unsafe.Pointer(pReader)).FpIncr)).FpTask)).FbDone = 1
  98868 	return pRet
  98869 }
  98870 
  98871 func vdbePmaReaderIncrInit(tls *libc.TLS, pReadr uintptr, eMode int32) int32 {
  98872 	var pIncr uintptr = (*PmaReader)(unsafe.Pointer(pReadr)).FpIncr
  98873 	var rc int32 = SQLITE_OK
  98874 	if pIncr != 0 {
  98875 		if (*IncrMerger)(unsafe.Pointer(pIncr)).FbUseThread != 0 {
  98876 			var pCtx uintptr = pReadr
  98877 			rc = vdbeSorterCreateThread(tls, (*IncrMerger)(unsafe.Pointer(pIncr)).FpTask, *(*uintptr)(unsafe.Pointer(&struct {
  98878 				f func(*libc.TLS, uintptr) uintptr
  98879 			}{vdbePmaReaderBgIncrInit})), pCtx)
  98880 		} else {
  98881 			rc = vdbePmaReaderIncrMergeInit(tls, pReadr, eMode)
  98882 		}
  98883 	}
  98884 	return rc
  98885 }
  98886 
  98887 func vdbeMergeEngineLevel0(tls *libc.TLS, pTask uintptr, nPMA int32, piOffset uintptr, ppOut uintptr) int32 {
  98888 	bp := tls.Alloc(8)
  98889 	defer tls.Free(8)
  98890 
  98891 	var pNew uintptr
  98892 	var iOff I64 = *(*I64)(unsafe.Pointer(piOffset))
  98893 	var i int32
  98894 	var rc int32 = SQLITE_OK
  98895 
  98896 	*(*uintptr)(unsafe.Pointer(ppOut)) = libc.AssignUintptr(&pNew, vdbeMergeEngineNew(tls, nPMA))
  98897 	if pNew == uintptr(0) {
  98898 		rc = SQLITE_NOMEM
  98899 	}
  98900 
  98901 	for i = 0; i < nPMA && rc == SQLITE_OK; i++ {
  98902 		*(*I64)(unsafe.Pointer(bp)) = int64(0)
  98903 		var pReadr uintptr = (*MergeEngine)(unsafe.Pointer(pNew)).FaReadr + uintptr(i)*80
  98904 		rc = vdbePmaReaderInit(tls, pTask, pTask+72, iOff, pReadr, bp)
  98905 		iOff = (*PmaReader)(unsafe.Pointer(pReadr)).FiEof
  98906 	}
  98907 
  98908 	if rc != SQLITE_OK {
  98909 		vdbeMergeEngineFree(tls, pNew)
  98910 		*(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0)
  98911 	}
  98912 	*(*I64)(unsafe.Pointer(piOffset)) = iOff
  98913 	return rc
  98914 }
  98915 
  98916 func vdbeSorterTreeDepth(tls *libc.TLS, nPMA int32) int32 {
  98917 	var nDepth int32 = 0
  98918 	var nDiv I64 = int64(SORTER_MAX_MERGE_COUNT)
  98919 	for nDiv < I64(nPMA) {
  98920 		nDiv = nDiv * int64(SORTER_MAX_MERGE_COUNT)
  98921 		nDepth++
  98922 	}
  98923 	return nDepth
  98924 }
  98925 
  98926 func vdbeSorterAddToTree(tls *libc.TLS, pTask uintptr, nDepth int32, iSeq int32, pRoot uintptr, pLeaf uintptr) int32 {
  98927 	bp := tls.Alloc(8)
  98928 	defer tls.Free(8)
  98929 
  98930 	var rc int32 = SQLITE_OK
  98931 	var nDiv int32 = 1
  98932 	var i int32
  98933 	var p uintptr = pRoot
  98934 
  98935 	rc = vdbeIncrMergerNew(tls, pTask, pLeaf, bp)
  98936 
  98937 	for i = 1; i < nDepth; i++ {
  98938 		nDiv = nDiv * SORTER_MAX_MERGE_COUNT
  98939 	}
  98940 
  98941 	for i = 1; i < nDepth && rc == SQLITE_OK; i++ {
  98942 		var iIter int32 = iSeq / nDiv % SORTER_MAX_MERGE_COUNT
  98943 		var pReadr uintptr = (*MergeEngine)(unsafe.Pointer(p)).FaReadr + uintptr(iIter)*80
  98944 
  98945 		if (*PmaReader)(unsafe.Pointer(pReadr)).FpIncr == uintptr(0) {
  98946 			var pNew uintptr = vdbeMergeEngineNew(tls, SORTER_MAX_MERGE_COUNT)
  98947 			if pNew == uintptr(0) {
  98948 				rc = SQLITE_NOMEM
  98949 			} else {
  98950 				rc = vdbeIncrMergerNew(tls, pTask, pNew, pReadr+72)
  98951 			}
  98952 		}
  98953 		if rc == SQLITE_OK {
  98954 			p = (*IncrMerger)(unsafe.Pointer((*PmaReader)(unsafe.Pointer(pReadr)).FpIncr)).FpMerger
  98955 			nDiv = nDiv / SORTER_MAX_MERGE_COUNT
  98956 		}
  98957 	}
  98958 
  98959 	if rc == SQLITE_OK {
  98960 		(*PmaReader)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(p)).FaReadr + uintptr(iSeq%SORTER_MAX_MERGE_COUNT)*80)).FpIncr = *(*uintptr)(unsafe.Pointer(bp))
  98961 	} else {
  98962 		vdbeIncrFree(tls, *(*uintptr)(unsafe.Pointer(bp)))
  98963 	}
  98964 	return rc
  98965 }
  98966 
  98967 func vdbeSorterMergeTreeBuild(tls *libc.TLS, pSorter uintptr, ppOut uintptr) int32 {
  98968 	bp := tls.Alloc(24)
  98969 	defer tls.Free(24)
  98970 
  98971 	var pMain uintptr = uintptr(0)
  98972 	var rc int32 = SQLITE_OK
  98973 	var iTask int32
  98974 
  98975 	if int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask) > 1 {
  98976 		pMain = vdbeMergeEngineNew(tls, int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask))
  98977 		if pMain == uintptr(0) {
  98978 			rc = SQLITE_NOMEM
  98979 		}
  98980 	}
  98981 
  98982 	for iTask = 0; rc == SQLITE_OK && iTask < int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask); iTask++ {
  98983 		var pTask uintptr = pSorter + 96 + uintptr(iTask)*104
  98984 
  98985 		if SQLITE_MAX_WORKER_THREADS == 0 || (*SortSubtask)(unsafe.Pointer(pTask)).FnPMA != 0 {
  98986 			*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
  98987 			var nDepth int32 = vdbeSorterTreeDepth(tls, (*SortSubtask)(unsafe.Pointer(pTask)).FnPMA)
  98988 			*(*I64)(unsafe.Pointer(bp)) = int64(0)
  98989 
  98990 			if (*SortSubtask)(unsafe.Pointer(pTask)).FnPMA <= SORTER_MAX_MERGE_COUNT {
  98991 				rc = vdbeMergeEngineLevel0(tls, pTask, (*SortSubtask)(unsafe.Pointer(pTask)).FnPMA, bp, bp+8)
  98992 			} else {
  98993 				var i int32
  98994 				var iSeq int32 = 0
  98995 				*(*uintptr)(unsafe.Pointer(bp + 8)) = vdbeMergeEngineNew(tls, SORTER_MAX_MERGE_COUNT)
  98996 				if *(*uintptr)(unsafe.Pointer(bp + 8)) == uintptr(0) {
  98997 					rc = SQLITE_NOMEM
  98998 				}
  98999 				for i = 0; i < (*SortSubtask)(unsafe.Pointer(pTask)).FnPMA && rc == SQLITE_OK; i = i + SORTER_MAX_MERGE_COUNT {
  99000 					*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
  99001 					var nReader int32
  99002 
  99003 					nReader = func() int32 {
  99004 						if (*SortSubtask)(unsafe.Pointer(pTask)).FnPMA-i < SORTER_MAX_MERGE_COUNT {
  99005 							return (*SortSubtask)(unsafe.Pointer(pTask)).FnPMA - i
  99006 						}
  99007 						return SORTER_MAX_MERGE_COUNT
  99008 					}()
  99009 					rc = vdbeMergeEngineLevel0(tls, pTask, nReader, bp, bp+16)
  99010 					if rc == SQLITE_OK {
  99011 						rc = vdbeSorterAddToTree(tls, pTask, nDepth, libc.PostIncInt32(&iSeq, 1), *(*uintptr)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 16)))
  99012 					}
  99013 				}
  99014 			}
  99015 
  99016 			if rc == SQLITE_OK {
  99017 				if pMain != uintptr(0) {
  99018 					rc = vdbeIncrMergerNew(tls, pTask, *(*uintptr)(unsafe.Pointer(bp + 8)), (*MergeEngine)(unsafe.Pointer(pMain)).FaReadr+uintptr(iTask)*80+72)
  99019 				} else {
  99020 					pMain = *(*uintptr)(unsafe.Pointer(bp + 8))
  99021 				}
  99022 			} else {
  99023 				vdbeMergeEngineFree(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
  99024 			}
  99025 		}
  99026 	}
  99027 
  99028 	if rc != SQLITE_OK {
  99029 		vdbeMergeEngineFree(tls, pMain)
  99030 		pMain = uintptr(0)
  99031 	}
  99032 	*(*uintptr)(unsafe.Pointer(ppOut)) = pMain
  99033 	return rc
  99034 }
  99035 
  99036 func vdbeSorterSetupMerge(tls *libc.TLS, pSorter uintptr) int32 {
  99037 	bp := tls.Alloc(8)
  99038 	defer tls.Free(8)
  99039 
  99040 	var rc int32
  99041 	var pTask0 uintptr = pSorter + 96
  99042 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
  99043 	var db uintptr = (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask0)).FpSorter)).Fdb
  99044 	var i int32
  99045 	var xCompare SorterCompare = vdbeSorterGetCompare(tls, pSorter)
  99046 	for i = 0; i < int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask); i++ {
  99047 		(*SortSubtask)(unsafe.Pointer(pSorter + 96 + uintptr(i)*104)).FxCompare = xCompare
  99048 	}
  99049 
  99050 	rc = vdbeSorterMergeTreeBuild(tls, pSorter, bp)
  99051 	if rc == SQLITE_OK {
  99052 		if (*VdbeSorter)(unsafe.Pointer(pSorter)).FbUseThreads != 0 {
  99053 			var iTask int32
  99054 			var pReadr uintptr = uintptr(0)
  99055 			var pLast uintptr = pSorter + 96 + uintptr(int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask)-1)*104
  99056 			rc = vdbeSortAllocUnpacked(tls, pLast)
  99057 			if rc == SQLITE_OK {
  99058 				pReadr = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(PmaReader{})))
  99059 				(*VdbeSorter)(unsafe.Pointer(pSorter)).FpReader = pReadr
  99060 				if pReadr == uintptr(0) {
  99061 					rc = SQLITE_NOMEM
  99062 				}
  99063 			}
  99064 			if rc == SQLITE_OK {
  99065 				rc = vdbeIncrMergerNew(tls, pLast, *(*uintptr)(unsafe.Pointer(bp)), pReadr+72)
  99066 				if rc == SQLITE_OK {
  99067 					vdbeIncrMergerSetThreads(tls, (*PmaReader)(unsafe.Pointer(pReadr)).FpIncr)
  99068 					for iTask = 0; iTask < int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask)-1; iTask++ {
  99069 						var pIncr uintptr
  99070 						if libc.AssignUintptr(&pIncr, (*PmaReader)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaReadr+uintptr(iTask)*80)).FpIncr) != 0 {
  99071 							vdbeIncrMergerSetThreads(tls, pIncr)
  99072 
  99073 						}
  99074 					}
  99075 					for iTask = 0; rc == SQLITE_OK && iTask < int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask); iTask++ {
  99076 						var p uintptr = (*MergeEngine)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaReadr + uintptr(iTask)*80
  99077 
  99078 						rc = vdbePmaReaderIncrInit(tls, p, INCRINIT_TASK)
  99079 					}
  99080 				}
  99081 				*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
  99082 			}
  99083 			if rc == SQLITE_OK {
  99084 				rc = vdbePmaReaderIncrMergeInit(tls, pReadr, INCRINIT_ROOT)
  99085 			}
  99086 		} else {
  99087 			rc = vdbeMergeEngineInit(tls, pTask0, *(*uintptr)(unsafe.Pointer(bp)), INCRINIT_NORMAL)
  99088 			(*VdbeSorter)(unsafe.Pointer(pSorter)).FpMerger = *(*uintptr)(unsafe.Pointer(bp))
  99089 			*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
  99090 		}
  99091 	}
  99092 
  99093 	if rc != SQLITE_OK {
  99094 		vdbeMergeEngineFree(tls, *(*uintptr)(unsafe.Pointer(bp)))
  99095 	}
  99096 	return rc
  99097 }
  99098 
  99099 // Once the sorter has been populated by calls to sqlite3VdbeSorterWrite,
  99100 // this function is called to prepare for iterating through the records
  99101 // in sorted order.
  99102 func Xsqlite3VdbeSorterRewind(tls *libc.TLS, pCsr uintptr, pbEof uintptr) int32 {
  99103 	var pSorter uintptr
  99104 	var rc int32 = SQLITE_OK
  99105 
  99106 	pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 48))
  99107 
  99108 	if int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FbUsePMA) == 0 {
  99109 		if (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList != 0 {
  99110 			*(*int32)(unsafe.Pointer(pbEof)) = 0
  99111 			rc = vdbeSorterSort(tls, pSorter+96, pSorter+56)
  99112 		} else {
  99113 			*(*int32)(unsafe.Pointer(pbEof)) = 1
  99114 		}
  99115 		return rc
  99116 	}
  99117 
  99118 	rc = vdbeSorterFlushPMA(tls, pSorter)
  99119 
  99120 	rc = vdbeSorterJoinAll(tls, pSorter, rc)
  99121 
  99122 	if rc == SQLITE_OK {
  99123 		rc = vdbeSorterSetupMerge(tls, pSorter)
  99124 		*(*int32)(unsafe.Pointer(pbEof)) = 0
  99125 	}
  99126 
  99127 	return rc
  99128 }
  99129 
  99130 // Advance to the next element in the sorter.  Return value:
  99131 //
  99132 //	SQLITE_OK     success
  99133 //	SQLITE_DONE   end of data
  99134 //	otherwise     some kind of error.
  99135 func Xsqlite3VdbeSorterNext(tls *libc.TLS, db uintptr, pCsr uintptr) int32 {
  99136 	bp := tls.Alloc(4)
  99137 	defer tls.Free(4)
  99138 
  99139 	var pSorter uintptr
  99140 	var rc int32
  99141 
  99142 	pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 48))
  99143 
  99144 	if (*VdbeSorter)(unsafe.Pointer(pSorter)).FbUsePMA != 0 {
  99145 		if (*VdbeSorter)(unsafe.Pointer(pSorter)).FbUseThreads != 0 {
  99146 			rc = vdbePmaReaderNext(tls, (*VdbeSorter)(unsafe.Pointer(pSorter)).FpReader)
  99147 			if rc == SQLITE_OK && (*PmaReader)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer(pSorter)).FpReader)).FpFd == uintptr(0) {
  99148 				rc = SQLITE_DONE
  99149 			}
  99150 		} else {
  99151 			*(*int32)(unsafe.Pointer(bp)) = 0
  99152 
  99153 			rc = vdbeMergeEngineStep(tls, (*VdbeSorter)(unsafe.Pointer(pSorter)).FpMerger, bp)
  99154 			if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp)) != 0 {
  99155 				rc = SQLITE_DONE
  99156 			}
  99157 		}
  99158 	} else {
  99159 		var pFree uintptr = (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList
  99160 		(*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList = *(*uintptr)(unsafe.Pointer(pFree + 8))
  99161 		*(*uintptr)(unsafe.Pointer(pFree + 8)) = uintptr(0)
  99162 		if (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory == uintptr(0) {
  99163 			vdbeSorterRecordFree(tls, db, pFree)
  99164 		}
  99165 		if (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList != 0 {
  99166 			rc = SQLITE_OK
  99167 		} else {
  99168 			rc = SQLITE_DONE
  99169 		}
  99170 	}
  99171 	return rc
  99172 }
  99173 
  99174 func vdbeSorterRowkey(tls *libc.TLS, pSorter uintptr, pnKey uintptr) uintptr {
  99175 	var pKey uintptr
  99176 	if (*VdbeSorter)(unsafe.Pointer(pSorter)).FbUsePMA != 0 {
  99177 		var pReader uintptr
  99178 		if (*VdbeSorter)(unsafe.Pointer(pSorter)).FbUseThreads != 0 {
  99179 			pReader = (*VdbeSorter)(unsafe.Pointer(pSorter)).FpReader
  99180 		} else {
  99181 			pReader = (*MergeEngine)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer(pSorter)).FpMerger)).FaReadr + uintptr(*(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer(pSorter)).FpMerger)).FaTree + 1*4)))*80
  99182 		}
  99183 		*(*int32)(unsafe.Pointer(pnKey)) = (*PmaReader)(unsafe.Pointer(pReader)).FnKey
  99184 		pKey = (*PmaReader)(unsafe.Pointer(pReader)).FaKey
  99185 	} else {
  99186 		*(*int32)(unsafe.Pointer(pnKey)) = (*SorterRecord)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList)).FnVal
  99187 		pKey = (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList + uintptr(1)*16
  99188 	}
  99189 	return pKey
  99190 }
  99191 
  99192 // Copy the current sorter key into the memory cell pOut.
  99193 func Xsqlite3VdbeSorterRowkey(tls *libc.TLS, pCsr uintptr, pOut uintptr) int32 {
  99194 	bp := tls.Alloc(4)
  99195 	defer tls.Free(4)
  99196 
  99197 	var pSorter uintptr
  99198 	var pKey uintptr
  99199 
  99200 	pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 48))
  99201 	pKey = vdbeSorterRowkey(tls, pSorter, bp)
  99202 	if Xsqlite3VdbeMemClearAndResize(tls, pOut, *(*int32)(unsafe.Pointer(bp))) != 0 {
  99203 		return SQLITE_NOMEM
  99204 	}
  99205 	(*Mem)(unsafe.Pointer(pOut)).Fn = *(*int32)(unsafe.Pointer(bp))
  99206 	(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(int32((*Mem)(unsafe.Pointer(pOut)).Fflags)&libc.CplInt32(MEM_TypeMask|MEM_Zero) | MEM_Blob)
  99207 	libc.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pOut)).Fz, pKey, uint64(*(*int32)(unsafe.Pointer(bp))))
  99208 
  99209 	return SQLITE_OK
  99210 }
  99211 
  99212 // Compare the key in memory cell pVal with the key that the sorter cursor
  99213 // passed as the first argument currently points to. For the purposes of
  99214 // the comparison, ignore the rowid field at the end of each record.
  99215 //
  99216 // If the sorter cursor key contains any NULL values, consider it to be
  99217 // less than pVal. Even if pVal also contains NULL values.
  99218 //
  99219 // If an error occurs, return an SQLite error code (i.e. SQLITE_NOMEM).
  99220 // Otherwise, set *pRes to a negative, zero or positive value if the
  99221 // key in pVal is smaller than, equal to or larger than the current sorter
  99222 // key.
  99223 //
  99224 // This routine forms the core of the OP_SorterCompare opcode, which in
  99225 // turn is used to verify uniqueness when constructing a UNIQUE INDEX.
  99226 func Xsqlite3VdbeSorterCompare(tls *libc.TLS, pCsr uintptr, pVal uintptr, nKeyCol int32, pRes uintptr) int32 {
  99227 	bp := tls.Alloc(4)
  99228 	defer tls.Free(4)
  99229 
  99230 	var pSorter uintptr
  99231 	var r2 uintptr
  99232 	var pKeyInfo uintptr
  99233 	var i int32
  99234 	var pKey uintptr
  99235 
  99236 	pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 48))
  99237 	r2 = (*VdbeSorter)(unsafe.Pointer(pSorter)).FpUnpacked
  99238 	pKeyInfo = (*VdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo
  99239 	if r2 == uintptr(0) {
  99240 		r2 = libc.AssignPtrUintptr(pSorter+48, Xsqlite3VdbeAllocUnpackedRecord(tls, pKeyInfo))
  99241 		if r2 == uintptr(0) {
  99242 			return SQLITE_NOMEM
  99243 		}
  99244 		(*UnpackedRecord)(unsafe.Pointer(r2)).FnField = U16(nKeyCol)
  99245 	}
  99246 
  99247 	pKey = vdbeSorterRowkey(tls, pSorter, bp)
  99248 	Xsqlite3VdbeRecordUnpack(tls, pKeyInfo, *(*int32)(unsafe.Pointer(bp)), pKey, r2)
  99249 	for i = 0; i < nKeyCol; i++ {
  99250 		if int32((*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(r2)).FaMem+uintptr(i)*56)).Fflags)&MEM_Null != 0 {
  99251 			*(*int32)(unsafe.Pointer(pRes)) = -1
  99252 			return SQLITE_OK
  99253 		}
  99254 	}
  99255 
  99256 	*(*int32)(unsafe.Pointer(pRes)) = Xsqlite3VdbeRecordCompare(tls, (*Mem)(unsafe.Pointer(pVal)).Fn, (*Mem)(unsafe.Pointer(pVal)).Fz, r2)
  99257 	return SQLITE_OK
  99258 }
  99259 
  99260 // Forward references to internal structures
  99261 type MemJournal1 = struct {
  99262 	FpMethod     uintptr
  99263 	FnChunkSize  int32
  99264 	FnSpill      int32
  99265 	FpFirst      uintptr
  99266 	Fendpoint    FilePoint
  99267 	Freadpoint   FilePoint
  99268 	Fflags       int32
  99269 	F__ccgo_pad1 [4]byte
  99270 	FpVfs        uintptr
  99271 	FzJournal    uintptr
  99272 }
  99273 
  99274 // Forward references to internal structures
  99275 type MemJournal = MemJournal1
  99276 type FilePoint1 = struct {
  99277 	FiOffset Sqlite3_int64
  99278 	FpChunk  uintptr
  99279 }
  99280 
  99281 type FilePoint = FilePoint1
  99282 type FileChunk1 = struct {
  99283 	FpNext  uintptr
  99284 	FzChunk [8]U8
  99285 }
  99286 
  99287 type FileChunk = FileChunk1
  99288 
  99289 func memjrnlRead(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 {
  99290 	var p uintptr = pJfd
  99291 	var zOut uintptr = zBuf
  99292 	var nRead int32 = iAmt
  99293 	var iChunkOffset int32
  99294 	var pChunk uintptr
  99295 
  99296 	if Sqlite_int64(iAmt)+iOfst > (*MemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset {
  99297 		return SQLITE_IOERR | int32(2)<<8
  99298 	}
  99299 
  99300 	if (*MemJournal)(unsafe.Pointer(p)).Freadpoint.FiOffset != iOfst || iOfst == int64(0) {
  99301 		var iOff Sqlite3_int64 = int64(0)
  99302 		for pChunk = (*MemJournal)(unsafe.Pointer(p)).FpFirst; pChunk != 0 && iOff+Sqlite3_int64((*MemJournal)(unsafe.Pointer(p)).FnChunkSize) <= iOfst; pChunk = (*FileChunk)(unsafe.Pointer(pChunk)).FpNext {
  99303 			iOff = iOff + Sqlite3_int64((*MemJournal)(unsafe.Pointer(p)).FnChunkSize)
  99304 		}
  99305 	} else {
  99306 		pChunk = (*MemJournal)(unsafe.Pointer(p)).Freadpoint.FpChunk
  99307 
  99308 	}
  99309 
  99310 	iChunkOffset = int32(iOfst % Sqlite_int64((*MemJournal)(unsafe.Pointer(p)).FnChunkSize))
  99311 	for __ccgo := true; __ccgo; __ccgo = nRead >= 0 && libc.AssignUintptr(&pChunk, (*FileChunk)(unsafe.Pointer(pChunk)).FpNext) != uintptr(0) && nRead > 0 {
  99312 		var iSpace int32 = (*MemJournal)(unsafe.Pointer(p)).FnChunkSize - iChunkOffset
  99313 		var nCopy int32 = func() int32 {
  99314 			if nRead < (*MemJournal)(unsafe.Pointer(p)).FnChunkSize-iChunkOffset {
  99315 				return nRead
  99316 			}
  99317 			return (*MemJournal)(unsafe.Pointer(p)).FnChunkSize - iChunkOffset
  99318 		}()
  99319 		libc.Xmemcpy(tls, zOut, pChunk+8+uintptr(iChunkOffset), uint64(nCopy))
  99320 		zOut += uintptr(nCopy)
  99321 		nRead = nRead - iSpace
  99322 		iChunkOffset = 0
  99323 	}
  99324 	(*MemJournal)(unsafe.Pointer(p)).Freadpoint.FiOffset = func() int64 {
  99325 		if pChunk != 0 {
  99326 			return iOfst + Sqlite_int64(iAmt)
  99327 		}
  99328 		return int64(0)
  99329 	}()
  99330 	(*MemJournal)(unsafe.Pointer(p)).Freadpoint.FpChunk = pChunk
  99331 
  99332 	return SQLITE_OK
  99333 }
  99334 
  99335 func memjrnlFreeChunks(tls *libc.TLS, pFirst uintptr) {
  99336 	var pIter uintptr
  99337 	var pNext uintptr
  99338 	for pIter = pFirst; pIter != 0; pIter = pNext {
  99339 		pNext = (*FileChunk)(unsafe.Pointer(pIter)).FpNext
  99340 		Xsqlite3_free(tls, pIter)
  99341 	}
  99342 }
  99343 
  99344 func memjrnlCreateFile(tls *libc.TLS, p uintptr) int32 {
  99345 	var rc int32
  99346 	var pReal uintptr = p
  99347 	var copy = *(*MemJournal)(unsafe.Pointer(p))
  99348 
  99349 	libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(MemJournal{})))
  99350 	rc = Xsqlite3OsOpen(tls, copy.FpVfs, copy.FzJournal, pReal, copy.Fflags, uintptr(0))
  99351 	if rc == SQLITE_OK {
  99352 		var nChunk int32 = copy.FnChunkSize
  99353 		var iOff I64 = int64(0)
  99354 		var pIter uintptr
  99355 		for pIter = copy.FpFirst; pIter != 0; pIter = (*FileChunk)(unsafe.Pointer(pIter)).FpNext {
  99356 			if iOff+I64(nChunk) > copy.Fendpoint.FiOffset {
  99357 				nChunk = int32(copy.Fendpoint.FiOffset - iOff)
  99358 			}
  99359 			rc = Xsqlite3OsWrite(tls, pReal, pIter+8, nChunk, iOff)
  99360 			if rc != 0 {
  99361 				break
  99362 			}
  99363 			iOff = iOff + I64(nChunk)
  99364 		}
  99365 		if rc == SQLITE_OK {
  99366 			memjrnlFreeChunks(tls, copy.FpFirst)
  99367 		}
  99368 	}
  99369 	if rc != SQLITE_OK {
  99370 		Xsqlite3OsClose(tls, pReal)
  99371 		*(*MemJournal)(unsafe.Pointer(p)) = copy
  99372 	}
  99373 	return rc
  99374 }
  99375 
  99376 func memjrnlWrite(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 {
  99377 	var p uintptr = pJfd
  99378 	var nWrite int32 = iAmt
  99379 	var zWrite uintptr = zBuf
  99380 
  99381 	if (*MemJournal)(unsafe.Pointer(p)).FnSpill > 0 && Sqlite_int64(iAmt)+iOfst > Sqlite_int64((*MemJournal)(unsafe.Pointer(p)).FnSpill) {
  99382 		var rc int32 = memjrnlCreateFile(tls, p)
  99383 		if rc == SQLITE_OK {
  99384 			rc = Xsqlite3OsWrite(tls, pJfd, zBuf, iAmt, iOfst)
  99385 		}
  99386 		return rc
  99387 	} else {
  99388 		if iOfst > int64(0) && iOfst != (*MemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset {
  99389 			memjrnlTruncate(tls, pJfd, iOfst)
  99390 		}
  99391 		if iOfst == int64(0) && (*MemJournal)(unsafe.Pointer(p)).FpFirst != 0 {
  99392 			libc.Xmemcpy(tls, (*MemJournal)(unsafe.Pointer(p)).FpFirst+8, zBuf, uint64(iAmt))
  99393 		} else {
  99394 			for nWrite > 0 {
  99395 				var pChunk uintptr = (*MemJournal)(unsafe.Pointer(p)).Fendpoint.FpChunk
  99396 				var iChunkOffset int32 = int32((*MemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset % Sqlite3_int64((*MemJournal)(unsafe.Pointer(p)).FnChunkSize))
  99397 				var iSpace int32 = func() int32 {
  99398 					if nWrite < (*MemJournal)(unsafe.Pointer(p)).FnChunkSize-iChunkOffset {
  99399 						return nWrite
  99400 					}
  99401 					return (*MemJournal)(unsafe.Pointer(p)).FnChunkSize - iChunkOffset
  99402 				}()
  99403 
  99404 				if iChunkOffset == 0 {
  99405 					var pNew uintptr = Xsqlite3_malloc(tls, int32(uint64(unsafe.Sizeof(FileChunk{}))+uint64((*MemJournal)(unsafe.Pointer(p)).FnChunkSize-8)))
  99406 					if !(pNew != 0) {
  99407 						return SQLITE_IOERR | int32(12)<<8
  99408 					}
  99409 					(*FileChunk)(unsafe.Pointer(pNew)).FpNext = uintptr(0)
  99410 					if pChunk != 0 {
  99411 						(*FileChunk)(unsafe.Pointer(pChunk)).FpNext = pNew
  99412 					} else {
  99413 						(*MemJournal)(unsafe.Pointer(p)).FpFirst = pNew
  99414 					}
  99415 					pChunk = libc.AssignPtrUintptr(p+24+8, pNew)
  99416 				}
  99417 
  99418 				libc.Xmemcpy(tls, pChunk+8+uintptr(iChunkOffset), zWrite, uint64(iSpace))
  99419 				zWrite += uintptr(iSpace)
  99420 				nWrite = nWrite - iSpace
  99421 				*(*Sqlite3_int64)(unsafe.Pointer(p + 24)) += Sqlite3_int64(iSpace)
  99422 			}
  99423 		}
  99424 	}
  99425 
  99426 	return SQLITE_OK
  99427 }
  99428 
  99429 func memjrnlTruncate(tls *libc.TLS, pJfd uintptr, size Sqlite_int64) int32 {
  99430 	var p uintptr = pJfd
  99431 
  99432 	if size < (*MemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset {
  99433 		var pIter uintptr = uintptr(0)
  99434 		if size == int64(0) {
  99435 			memjrnlFreeChunks(tls, (*MemJournal)(unsafe.Pointer(p)).FpFirst)
  99436 			(*MemJournal)(unsafe.Pointer(p)).FpFirst = uintptr(0)
  99437 		} else {
  99438 			var iOff I64 = I64((*MemJournal)(unsafe.Pointer(p)).FnChunkSize)
  99439 			for pIter = (*MemJournal)(unsafe.Pointer(p)).FpFirst; pIter != 0 && iOff < size; pIter = (*FileChunk)(unsafe.Pointer(pIter)).FpNext {
  99440 				iOff = iOff + I64((*MemJournal)(unsafe.Pointer(p)).FnChunkSize)
  99441 			}
  99442 			if pIter != 0 {
  99443 				memjrnlFreeChunks(tls, (*FileChunk)(unsafe.Pointer(pIter)).FpNext)
  99444 				(*FileChunk)(unsafe.Pointer(pIter)).FpNext = uintptr(0)
  99445 			}
  99446 		}
  99447 
  99448 		(*MemJournal)(unsafe.Pointer(p)).Fendpoint.FpChunk = pIter
  99449 		(*MemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset = size
  99450 		(*MemJournal)(unsafe.Pointer(p)).Freadpoint.FpChunk = uintptr(0)
  99451 		(*MemJournal)(unsafe.Pointer(p)).Freadpoint.FiOffset = int64(0)
  99452 	}
  99453 	return SQLITE_OK
  99454 }
  99455 
  99456 func memjrnlClose(tls *libc.TLS, pJfd uintptr) int32 {
  99457 	var p uintptr = pJfd
  99458 	memjrnlFreeChunks(tls, (*MemJournal)(unsafe.Pointer(p)).FpFirst)
  99459 	return SQLITE_OK
  99460 }
  99461 
  99462 func memjrnlSync(tls *libc.TLS, pJfd uintptr, flags int32) int32 {
  99463 	_ = pJfd
  99464 	_ = flags
  99465 	return SQLITE_OK
  99466 }
  99467 
  99468 func memjrnlFileSize(tls *libc.TLS, pJfd uintptr, pSize uintptr) int32 {
  99469 	var p uintptr = pJfd
  99470 	*(*Sqlite_int64)(unsafe.Pointer(pSize)) = (*MemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset
  99471 	return SQLITE_OK
  99472 }
  99473 
  99474 var sMemJournalMethods = sqlite3_io_methods{
  99475 	FiVersion:  1,
  99476 	FxClose:    0,
  99477 	FxRead:     0,
  99478 	FxWrite:    0,
  99479 	FxTruncate: 0,
  99480 	FxSync:     0,
  99481 	FxFileSize: 0,
  99482 }
  99483 
  99484 // Open a journal file.
  99485 //
  99486 // The behaviour of the journal file depends on the value of parameter
  99487 // nSpill. If nSpill is 0, then the journal file is always create and
  99488 // accessed using the underlying VFS. If nSpill is less than zero, then
  99489 // all content is always stored in main-memory. Finally, if nSpill is a
  99490 // positive value, then the journal file is initially created in-memory
  99491 // but may be flushed to disk later on. In this case the journal file is
  99492 // flushed to disk either when it grows larger than nSpill bytes in size,
  99493 // or when sqlite3JournalCreate() is called.
  99494 func Xsqlite3JournalOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pJfd uintptr, flags int32, nSpill int32) int32 {
  99495 	var p uintptr = pJfd
  99496 
  99497 	libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(MemJournal{})))
  99498 	if nSpill == 0 {
  99499 		return Xsqlite3OsOpen(tls, pVfs, zName, pJfd, flags, uintptr(0))
  99500 	}
  99501 
  99502 	if nSpill > 0 {
  99503 		(*MemJournal)(unsafe.Pointer(p)).FnChunkSize = nSpill
  99504 	} else {
  99505 		(*MemJournal)(unsafe.Pointer(p)).FnChunkSize = int32(uint64(8+MEMJOURNAL_DFLT_FILECHUNKSIZE) - uint64(unsafe.Sizeof(FileChunk{})))
  99506 
  99507 	}
  99508 
  99509 	(*Sqlite3_file)(unsafe.Pointer(pJfd)).FpMethods = uintptr(unsafe.Pointer(&sMemJournalMethods))
  99510 	(*MemJournal)(unsafe.Pointer(p)).FnSpill = nSpill
  99511 	(*MemJournal)(unsafe.Pointer(p)).Fflags = flags
  99512 	(*MemJournal)(unsafe.Pointer(p)).FzJournal = zName
  99513 	(*MemJournal)(unsafe.Pointer(p)).FpVfs = pVfs
  99514 	return SQLITE_OK
  99515 }
  99516 
  99517 // Open an in-memory journal file.
  99518 func Xsqlite3MemJournalOpen(tls *libc.TLS, pJfd uintptr) {
  99519 	Xsqlite3JournalOpen(tls, uintptr(0), uintptr(0), pJfd, 0, -1)
  99520 }
  99521 
  99522 // The file-handle passed as the only argument is open on a journal file.
  99523 // Return true if this "journal file" is currently stored in heap memory,
  99524 // or false otherwise.
  99525 func Xsqlite3JournalIsInMemory(tls *libc.TLS, p uintptr) int32 {
  99526 	return libc.Bool32((*Sqlite3_file)(unsafe.Pointer(p)).FpMethods == uintptr(unsafe.Pointer(&sMemJournalMethods)))
  99527 }
  99528 
  99529 // Return the number of bytes required to store a JournalFile that uses vfs
  99530 // pVfs to create the underlying on-disk files.
  99531 func Xsqlite3JournalSize(tls *libc.TLS, pVfs uintptr) int32 {
  99532 	return func() int32 {
  99533 		if (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile > int32(unsafe.Sizeof(MemJournal{})) {
  99534 			return (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile
  99535 		}
  99536 		return int32(unsafe.Sizeof(MemJournal{}))
  99537 	}()
  99538 }
  99539 
  99540 func walkWindowList(tls *libc.TLS, pWalker uintptr, pList uintptr, bOneOnly int32) int32 {
  99541 	var pWin uintptr
  99542 	for pWin = pList; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin {
  99543 		var rc int32
  99544 		rc = Xsqlite3WalkExprList(tls, pWalker, (*Window)(unsafe.Pointer(pWin)).FpOrderBy)
  99545 		if rc != 0 {
  99546 			return WRC_Abort
  99547 		}
  99548 		rc = Xsqlite3WalkExprList(tls, pWalker, (*Window)(unsafe.Pointer(pWin)).FpPartition)
  99549 		if rc != 0 {
  99550 			return WRC_Abort
  99551 		}
  99552 		rc = Xsqlite3WalkExpr(tls, pWalker, (*Window)(unsafe.Pointer(pWin)).FpFilter)
  99553 		if rc != 0 {
  99554 			return WRC_Abort
  99555 		}
  99556 		rc = Xsqlite3WalkExpr(tls, pWalker, (*Window)(unsafe.Pointer(pWin)).FpStart)
  99557 		if rc != 0 {
  99558 			return WRC_Abort
  99559 		}
  99560 		rc = Xsqlite3WalkExpr(tls, pWalker, (*Window)(unsafe.Pointer(pWin)).FpEnd)
  99561 		if rc != 0 {
  99562 			return WRC_Abort
  99563 		}
  99564 		if bOneOnly != 0 {
  99565 			break
  99566 		}
  99567 	}
  99568 	return WRC_Continue
  99569 }
  99570 
  99571 func walkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
  99572 	var rc int32
  99573 
  99574 	for 1 != 0 {
  99575 		rc = (*struct {
  99576 			f func(*libc.TLS, uintptr, uintptr) int32
  99577 		})(unsafe.Pointer(&struct{ uintptr }{(*Walker)(unsafe.Pointer(pWalker)).FxExprCallback})).f(tls, pWalker, pExpr)
  99578 		if rc != 0 {
  99579 			return rc & WRC_Abort
  99580 		}
  99581 		if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_TokenOnly|EP_Leaf) != U32(0)) {
  99582 			if (*Expr)(unsafe.Pointer(pExpr)).FpLeft != 0 && walkExpr(tls, pWalker, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) != 0 {
  99583 				return WRC_Abort
  99584 			}
  99585 			if (*Expr)(unsafe.Pointer(pExpr)).FpRight != 0 {
  99586 				pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpRight
  99587 				continue
  99588 			} else if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) {
  99589 				if Xsqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32))) != 0 {
  99590 					return WRC_Abort
  99591 				}
  99592 			} else {
  99593 				if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 {
  99594 					if Xsqlite3WalkExprList(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32))) != 0 {
  99595 						return WRC_Abort
  99596 					}
  99597 				}
  99598 				if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0) {
  99599 					if walkWindowList(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 64)), 1) != 0 {
  99600 						return WRC_Abort
  99601 					}
  99602 				}
  99603 			}
  99604 		}
  99605 		break
  99606 	}
  99607 	return WRC_Continue
  99608 }
  99609 
  99610 func Xsqlite3WalkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
  99611 	if pExpr != 0 {
  99612 		return walkExpr(tls, pWalker, pExpr)
  99613 	}
  99614 	return WRC_Continue
  99615 }
  99616 
  99617 // Call sqlite3WalkExpr() for every expression in list p or until
  99618 // an abort request is seen.
  99619 func Xsqlite3WalkExprList(tls *libc.TLS, pWalker uintptr, p uintptr) int32 {
  99620 	var i int32
  99621 	var pItem uintptr
  99622 	if p != 0 {
  99623 		i = (*ExprList)(unsafe.Pointer(p)).FnExpr
  99624 		pItem = p + 8
  99625 	__1:
  99626 		if !(i > 0) {
  99627 			goto __3
  99628 		}
  99629 		{
  99630 			if Xsqlite3WalkExpr(tls, pWalker, (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr) != 0 {
  99631 				return WRC_Abort
  99632 			}
  99633 
  99634 		}
  99635 		goto __2
  99636 	__2:
  99637 		i--
  99638 		pItem += 32
  99639 		goto __1
  99640 		goto __3
  99641 	__3:
  99642 	}
  99643 	return WRC_Continue
  99644 }
  99645 
  99646 // This is a no-op callback for Walker->xSelectCallback2.  If this
  99647 // callback is set, then the Select->pWinDefn list is traversed.
  99648 func Xsqlite3WalkWinDefnDummyCallback(tls *libc.TLS, pWalker uintptr, p uintptr) {
  99649 	_ = pWalker
  99650 	_ = p
  99651 
  99652 }
  99653 
  99654 // Walk all expressions associated with SELECT statement p.  Do
  99655 // not invoke the SELECT callback on p, but do (of course) invoke
  99656 // any expr callbacks and SELECT callbacks that come from subqueries.
  99657 // Return WRC_Abort or WRC_Continue.
  99658 func Xsqlite3WalkSelectExpr(tls *libc.TLS, pWalker uintptr, p uintptr) int32 {
  99659 	if Xsqlite3WalkExprList(tls, pWalker, (*Select)(unsafe.Pointer(p)).FpEList) != 0 {
  99660 		return WRC_Abort
  99661 	}
  99662 	if Xsqlite3WalkExpr(tls, pWalker, (*Select)(unsafe.Pointer(p)).FpWhere) != 0 {
  99663 		return WRC_Abort
  99664 	}
  99665 	if Xsqlite3WalkExprList(tls, pWalker, (*Select)(unsafe.Pointer(p)).FpGroupBy) != 0 {
  99666 		return WRC_Abort
  99667 	}
  99668 	if Xsqlite3WalkExpr(tls, pWalker, (*Select)(unsafe.Pointer(p)).FpHaving) != 0 {
  99669 		return WRC_Abort
  99670 	}
  99671 	if Xsqlite3WalkExprList(tls, pWalker, (*Select)(unsafe.Pointer(p)).FpOrderBy) != 0 {
  99672 		return WRC_Abort
  99673 	}
  99674 	if Xsqlite3WalkExpr(tls, pWalker, (*Select)(unsafe.Pointer(p)).FpLimit) != 0 {
  99675 		return WRC_Abort
  99676 	}
  99677 	if (*Select)(unsafe.Pointer(p)).FpWinDefn != 0 {
  99678 		var pParse uintptr
  99679 		if (*Walker)(unsafe.Pointer(pWalker)).FxSelectCallback2 == *(*uintptr)(unsafe.Pointer(&struct {
  99680 			f func(*libc.TLS, uintptr, uintptr)
  99681 		}{Xsqlite3WalkWinDefnDummyCallback})) ||
  99682 			libc.AssignUintptr(&pParse, (*Walker)(unsafe.Pointer(pWalker)).FpParse) != uintptr(0) && int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME ||
  99683 			(*Walker)(unsafe.Pointer(pWalker)).FxSelectCallback2 == *(*uintptr)(unsafe.Pointer(&struct {
  99684 				f func(*libc.TLS, uintptr, uintptr)
  99685 			}{Xsqlite3SelectPopWith})) {
  99686 			var rc int32 = walkWindowList(tls, pWalker, (*Select)(unsafe.Pointer(p)).FpWinDefn, 0)
  99687 			return rc
  99688 		}
  99689 	}
  99690 	return WRC_Continue
  99691 }
  99692 
  99693 // Walk the parse trees associated with all subqueries in the
  99694 // FROM clause of SELECT statement p.  Do not invoke the select
  99695 // callback on p, but do invoke it on each FROM clause subquery
  99696 // and on any subqueries further down in the tree.  Return
  99697 // WRC_Abort or WRC_Continue;
  99698 func Xsqlite3WalkSelectFrom(tls *libc.TLS, pWalker uintptr, p uintptr) int32 {
  99699 	var pSrc uintptr
  99700 	var i int32
  99701 	var pItem uintptr
  99702 
  99703 	pSrc = (*Select)(unsafe.Pointer(p)).FpSrc
  99704 	if pSrc != 0 {
  99705 		i = (*SrcList)(unsafe.Pointer(pSrc)).FnSrc
  99706 		pItem = pSrc + 8
  99707 	__1:
  99708 		if !(i > 0) {
  99709 			goto __3
  99710 		}
  99711 		{
  99712 			if (*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0 && Xsqlite3WalkSelect(tls, pWalker, (*SrcItem)(unsafe.Pointer(pItem)).FpSelect) != 0 {
  99713 				return WRC_Abort
  99714 			}
  99715 			if uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x4>>2)) != 0 &&
  99716 				Xsqlite3WalkExprList(tls, pWalker, *(*uintptr)(unsafe.Pointer(pItem + 88))) != 0 {
  99717 				return WRC_Abort
  99718 			}
  99719 
  99720 		}
  99721 		goto __2
  99722 	__2:
  99723 		i--
  99724 		pItem += 104
  99725 		goto __1
  99726 		goto __3
  99727 	__3:
  99728 	}
  99729 	return WRC_Continue
  99730 }
  99731 
  99732 // Call sqlite3WalkExpr() for every expression in Select statement p.
  99733 // Invoke sqlite3WalkSelect() for subqueries in the FROM clause and
  99734 // on the compound select chain, p->pPrior.
  99735 //
  99736 // If it is not NULL, the xSelectCallback() callback is invoked before
  99737 // the walk of the expressions and FROM clause. The xSelectCallback2()
  99738 // method is invoked following the walk of the expressions and FROM clause,
  99739 // but only if both xSelectCallback and xSelectCallback2 are both non-NULL
  99740 // and if the expressions and FROM clause both return WRC_Continue;
  99741 //
  99742 // Return WRC_Continue under normal conditions.  Return WRC_Abort if
  99743 // there is an abort request.
  99744 //
  99745 // If the Walker does not have an xSelectCallback() then this routine
  99746 // is a no-op returning WRC_Continue.
  99747 func Xsqlite3WalkSelect(tls *libc.TLS, pWalker uintptr, p uintptr) int32 {
  99748 	var rc int32
  99749 	if p == uintptr(0) {
  99750 		return WRC_Continue
  99751 	}
  99752 	if (*Walker)(unsafe.Pointer(pWalker)).FxSelectCallback == uintptr(0) {
  99753 		return WRC_Continue
  99754 	}
  99755 	for __ccgo := true; __ccgo; __ccgo = p != uintptr(0) {
  99756 		rc = (*struct {
  99757 			f func(*libc.TLS, uintptr, uintptr) int32
  99758 		})(unsafe.Pointer(&struct{ uintptr }{(*Walker)(unsafe.Pointer(pWalker)).FxSelectCallback})).f(tls, pWalker, p)
  99759 		if rc != 0 {
  99760 			return rc & WRC_Abort
  99761 		}
  99762 		if Xsqlite3WalkSelectExpr(tls, pWalker, p) != 0 ||
  99763 			Xsqlite3WalkSelectFrom(tls, pWalker, p) != 0 {
  99764 			return WRC_Abort
  99765 		}
  99766 		if (*Walker)(unsafe.Pointer(pWalker)).FxSelectCallback2 != 0 {
  99767 			(*struct {
  99768 				f func(*libc.TLS, uintptr, uintptr)
  99769 			})(unsafe.Pointer(&struct{ uintptr }{(*Walker)(unsafe.Pointer(pWalker)).FxSelectCallback2})).f(tls, pWalker, p)
  99770 		}
  99771 		p = (*Select)(unsafe.Pointer(p)).FpPrior
  99772 	}
  99773 	return WRC_Continue
  99774 }
  99775 
  99776 // Increase the walkerDepth when entering a subquery, and
  99777 // descrease when leaving the subquery.
  99778 func Xsqlite3WalkerDepthIncrease(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 {
  99779 	_ = pSelect
  99780 	(*Walker)(unsafe.Pointer(pWalker)).FwalkerDepth++
  99781 	return WRC_Continue
  99782 }
  99783 
  99784 func Xsqlite3WalkerDepthDecrease(tls *libc.TLS, pWalker uintptr, pSelect uintptr) {
  99785 	_ = pSelect
  99786 	(*Walker)(unsafe.Pointer(pWalker)).FwalkerDepth--
  99787 }
  99788 
  99789 // No-op routine for the parse-tree walker.
  99790 //
  99791 // When this routine is the Walker.xExprCallback then expression trees
  99792 // are walked without any actions being taken at each node.  Presumably,
  99793 // when this routine is used for Walker.xExprCallback then
  99794 // Walker.xSelectCallback is set to do something useful for every
  99795 // subquery in the parser tree.
  99796 func Xsqlite3ExprWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) int32 {
  99797 	_ = NotUsed
  99798 	_ = NotUsed2
  99799 	return WRC_Continue
  99800 }
  99801 
  99802 // No-op routine for the parse-tree walker for SELECT statements.
  99803 // subquery in the parser tree.
  99804 func Xsqlite3SelectWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) int32 {
  99805 	_ = NotUsed
  99806 	_ = NotUsed2
  99807 	return WRC_Continue
  99808 }
  99809 
  99810 func incrAggDepth(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
  99811 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AGG_FUNCTION {
  99812 		*(*U8)(unsafe.Pointer(pExpr + 2)) += U8(*(*int32)(unsafe.Pointer(pWalker + 40)))
  99813 	}
  99814 	return WRC_Continue
  99815 }
  99816 
  99817 func incrAggFunctionDepth(tls *libc.TLS, pExpr uintptr, N int32) {
  99818 	bp := tls.Alloc(48)
  99819 	defer tls.Free(48)
  99820 
  99821 	if N > 0 {
  99822 		libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Walker{})))
  99823 		(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
  99824 			f func(*libc.TLS, uintptr, uintptr) int32
  99825 		}{incrAggDepth}))
  99826 		*(*int32)(unsafe.Pointer(bp + 40)) = N
  99827 		Xsqlite3WalkExpr(tls, bp, pExpr)
  99828 	}
  99829 }
  99830 
  99831 func resolveAlias(tls *libc.TLS, pParse uintptr, pEList uintptr, iCol int32, pExpr uintptr, nSubquery int32) {
  99832 	bp := tls.Alloc(72)
  99833 	defer tls.Free(72)
  99834 
  99835 	var pOrig uintptr
  99836 	var pDup uintptr
  99837 	var db uintptr
  99838 
  99839 	pOrig = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(iCol)*32)).FpExpr
  99840 
  99841 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
  99842 	pDup = Xsqlite3ExprDup(tls, db, pOrig, 0)
  99843 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
  99844 		Xsqlite3ExprDelete(tls, db, pDup)
  99845 		pDup = uintptr(0)
  99846 	} else {
  99847 		incrAggFunctionDepth(tls, pDup, nSubquery)
  99848 		if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLLATE {
  99849 			pDup = Xsqlite3ExprAddCollateString(tls, pParse, pDup, *(*uintptr)(unsafe.Pointer(pExpr + 8)))
  99850 		}
  99851 		libc.Xmemcpy(tls, bp, pDup, uint64(unsafe.Sizeof(Expr{})))
  99852 		libc.Xmemcpy(tls, pDup, pExpr, uint64(unsafe.Sizeof(Expr{})))
  99853 		libc.Xmemcpy(tls, pExpr, bp, uint64(unsafe.Sizeof(Expr{})))
  99854 		if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0) {
  99855 			if *(*uintptr)(unsafe.Pointer(pExpr + 64)) != uintptr(0) {
  99856 				(*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64)))).FpOwner = pExpr
  99857 			}
  99858 		}
  99859 		Xsqlite3ExprDeferredDelete(tls, pParse, pDup)
  99860 	}
  99861 }
  99862 
  99863 // Subqueries stores the original database, table and column names for their
  99864 // result sets in ExprList.a[].zSpan, in the form "DATABASE.TABLE.COLUMN".
  99865 // Check to see if the zSpan given to this routine matches the zDb, zTab,
  99866 // and zCol.  If any of zDb, zTab, and zCol are NULL then those fields will
  99867 // match anything.
  99868 func Xsqlite3MatchEName(tls *libc.TLS, pItem uintptr, zCol uintptr, zTab uintptr, zDb uintptr) int32 {
  99869 	var n int32
  99870 	var zSpan uintptr
  99871 	if int32(*(*uint16)(unsafe.Pointer(pItem + 16 + 4))&0x3>>0) != ENAME_TAB {
  99872 		return 0
  99873 	}
  99874 	zSpan = (*ExprList_item)(unsafe.Pointer(pItem)).FzEName
  99875 	for n = 0; *(*int8)(unsafe.Pointer(zSpan + uintptr(n))) != 0 && int32(*(*int8)(unsafe.Pointer(zSpan + uintptr(n)))) != '.'; n++ {
  99876 	}
  99877 	if zDb != 0 && (Xsqlite3_strnicmp(tls, zSpan, zDb, n) != 0 || int32(*(*int8)(unsafe.Pointer(zDb + uintptr(n)))) != 0) {
  99878 		return 0
  99879 	}
  99880 	zSpan += uintptr(n + 1)
  99881 	for n = 0; *(*int8)(unsafe.Pointer(zSpan + uintptr(n))) != 0 && int32(*(*int8)(unsafe.Pointer(zSpan + uintptr(n)))) != '.'; n++ {
  99882 	}
  99883 	if zTab != 0 && (Xsqlite3_strnicmp(tls, zSpan, zTab, n) != 0 || int32(*(*int8)(unsafe.Pointer(zTab + uintptr(n)))) != 0) {
  99884 		return 0
  99885 	}
  99886 	zSpan += uintptr(n + 1)
  99887 	if zCol != 0 && Xsqlite3StrICmp(tls, zSpan, zCol) != 0 {
  99888 		return 0
  99889 	}
  99890 	return 1
  99891 }
  99892 
  99893 func areDoubleQuotedStringsEnabled(tls *libc.TLS, db uintptr, pTopNC uintptr) int32 {
  99894 	if (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 {
  99895 		return 1
  99896 	}
  99897 	if (*NameContext)(unsafe.Pointer(pTopNC)).FncFlags&NC_IsDDL != 0 {
  99898 		if Xsqlite3WritableSchema(tls, db) != 0 && (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DqsDML) != uint64(0) {
  99899 			return 1
  99900 		}
  99901 		return libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DqsDDL) != uint64(0))
  99902 	} else {
  99903 		return libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DqsDML) != uint64(0))
  99904 	}
  99905 	return int32(0)
  99906 }
  99907 
  99908 // The argument is guaranteed to be a non-NULL Expr node of type TK_COLUMN.
  99909 // return the appropriate colUsed mask.
  99910 func Xsqlite3ExprColUsed(tls *libc.TLS, pExpr uintptr) Bitmask {
  99911 	var n int32
  99912 	var pExTab uintptr
  99913 
  99914 	n = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)
  99915 
  99916 	pExTab = *(*uintptr)(unsafe.Pointer(pExpr + 64))
  99917 
  99918 	if (*Table)(unsafe.Pointer(pExTab)).FtabFlags&U32(TF_HasGenerated) != U32(0) &&
  99919 		int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pExTab)).FaCol+uintptr(n)*24)).FcolFlags)&COLFLAG_GENERATED != 0 {
  99920 		if int32((*Table)(unsafe.Pointer(pExTab)).FnCol) >= int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8)) {
  99921 			return libc.Uint64(libc.Uint64FromInt32(-1))
  99922 		}
  99923 		return uint64(1)<<int32((*Table)(unsafe.Pointer(pExTab)).FnCol) - uint64(1)
  99924 	} else {
  99925 		if n >= int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8)) {
  99926 			n = int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8)) - 1
  99927 		}
  99928 		return uint64(1) << n
  99929 	}
  99930 	return Bitmask(0)
  99931 }
  99932 
  99933 func extendFJMatch(tls *libc.TLS, pParse uintptr, ppList uintptr, pMatch uintptr, iColumn I16) {
  99934 	var pNew uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_COLUMN, uintptr(0), 0)
  99935 	if pNew != 0 {
  99936 		(*Expr)(unsafe.Pointer(pNew)).FiTable = (*SrcItem)(unsafe.Pointer(pMatch)).FiCursor
  99937 		(*Expr)(unsafe.Pointer(pNew)).FiColumn = iColumn
  99938 		*(*uintptr)(unsafe.Pointer(pNew + 64)) = (*SrcItem)(unsafe.Pointer(pMatch)).FpTab
  99939 
  99940 		*(*U32)(unsafe.Pointer(pNew + 4)) |= U32(EP_CanBeNull)
  99941 		*(*uintptr)(unsafe.Pointer(ppList)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(ppList)), pNew)
  99942 	}
  99943 }
  99944 
  99945 func isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, pSchema uintptr) int32 {
  99946 	var zLegacy uintptr
  99947 
  99948 	if Xsqlite3_strnicmp(tls, zTab, ts+7733, 7) != 0 {
  99949 		return 0
  99950 	}
  99951 	zLegacy = (*Table)(unsafe.Pointer(pTab)).FzName
  99952 	if libc.Xstrcmp(tls, zLegacy+uintptr(7), ts+7741+7) == 0 {
  99953 		if Xsqlite3StrICmp(tls, zTab+uintptr(7), ts+7760+7) == 0 {
  99954 			return 1
  99955 		}
  99956 		if pSchema == uintptr(0) {
  99957 			return 0
  99958 		}
  99959 		if Xsqlite3StrICmp(tls, zTab+uintptr(7), ts+7235+7) == 0 {
  99960 			return 1
  99961 		}
  99962 		if Xsqlite3StrICmp(tls, zTab+uintptr(7), ts+7779+7) == 0 {
  99963 			return 1
  99964 		}
  99965 	} else {
  99966 		if Xsqlite3StrICmp(tls, zTab+uintptr(7), ts+7779+7) == 0 {
  99967 			return 1
  99968 		}
  99969 	}
  99970 	return 0
  99971 }
  99972 
  99973 func lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol uintptr, pNC uintptr, pExpr uintptr) int32 {
  99974 	bp := tls.Alloc(104)
  99975 	defer tls.Free(104)
  99976 
  99977 	var i int32
  99978 	var j int32
  99979 	var cnt int32
  99980 	var cntTab int32
  99981 	var nSubquery int32
  99982 	var db uintptr
  99983 	var pItem uintptr
  99984 	var pMatch uintptr
  99985 	var pTopNC uintptr
  99986 	var pSchema uintptr
  99987 	var eNewExprOp int32
  99988 	var pTab uintptr
  99989 	var pCol uintptr
  99990 
  99991 	var hit int32
  99992 	var hCol U8
  99993 	var op int32
  99994 	var pUpsert uintptr
  99995 	var iCol int32
  99996 	var hCol1 U8
  99997 	var pOrig uintptr
  99998 	var zAs uintptr
  99999 	var pEList uintptr
 100000 	var pSrcList uintptr
 100001 	var zErr uintptr
 100002 	cnt = 0
 100003 	cntTab = 0
 100004 	nSubquery = 0
 100005 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 100006 	pMatch = uintptr(0)
 100007 	pTopNC = pNC
 100008 	pSchema = uintptr(0)
 100009 	eNewExprOp = TK_COLUMN
 100010 	pTab = uintptr(0)
 100011 	*(*uintptr)(unsafe.Pointer(bp + 96)) = uintptr(0)
 100012 
 100013 	(*Expr)(unsafe.Pointer(pExpr)).FiTable = -1
 100014 
 100015 	if !(zDb != 0) {
 100016 		goto __1
 100017 	}
 100018 
 100019 	if !((*NameContext)(unsafe.Pointer(pNC)).FncFlags&(NC_PartIdx|NC_IsCheck) != 0) {
 100020 		goto __2
 100021 	}
 100022 
 100023 	zDb = uintptr(0)
 100024 	goto __3
 100025 __2:
 100026 	i = 0
 100027 __4:
 100028 	if !(i < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
 100029 		goto __6
 100030 	}
 100031 
 100032 	if !(Xsqlite3StrICmp(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FzDbSName, zDb) == 0) {
 100033 		goto __7
 100034 	}
 100035 	pSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpSchema
 100036 	goto __6
 100037 __7:
 100038 	;
 100039 	goto __5
 100040 __5:
 100041 	i++
 100042 	goto __4
 100043 	goto __6
 100044 __6:
 100045 	;
 100046 	if !(i == (*Sqlite3)(unsafe.Pointer(db)).FnDb && Xsqlite3StrICmp(tls, ts+7793, zDb) == 0) {
 100047 		goto __8
 100048 	}
 100049 
 100050 	pSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema
 100051 	zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FzDbSName
 100052 __8:
 100053 	;
 100054 __3:
 100055 	;
 100056 __1:
 100057 	;
 100058 __9:
 100059 	pSrcList = (*NameContext)(unsafe.Pointer(pNC)).FpSrcList
 100060 
 100061 	if !(pSrcList != 0) {
 100062 		goto __12
 100063 	}
 100064 	i = 0
 100065 	pItem = pSrcList + 8
 100066 __13:
 100067 	if !(i < (*SrcList)(unsafe.Pointer(pSrcList)).FnSrc) {
 100068 		goto __15
 100069 	}
 100070 	pTab = (*SrcItem)(unsafe.Pointer(pItem)).FpTab
 100071 
 100072 	if !(uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x2000>>13)) != 0) {
 100073 		goto __16
 100074 	}
 100075 
 100076 	hit = 0
 100077 
 100078 	pEList = (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FpEList
 100079 
 100080 	j = 0
 100081 __17:
 100082 	if !(j < (*ExprList)(unsafe.Pointer(pEList)).FnExpr) {
 100083 		goto __19
 100084 	}
 100085 	if !!(Xsqlite3MatchEName(tls, pEList+8+uintptr(j)*32, zCol, zTab, zDb) != 0) {
 100086 		goto __20
 100087 	}
 100088 	goto __18
 100089 __20:
 100090 	;
 100091 	if !(cnt > 0) {
 100092 		goto __21
 100093 	}
 100094 	if !(int32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x400>>10) == 0 ||
 100095 		Xsqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 72)), zCol) < 0) {
 100096 		goto __22
 100097 	}
 100098 
 100099 	Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp + 96)))
 100100 	*(*uintptr)(unsafe.Pointer(bp + 96)) = uintptr(0)
 100101 	goto __23
 100102 __22:
 100103 	if !(int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&JT_RIGHT == 0) {
 100104 		goto __24
 100105 	}
 100106 
 100107 	goto __18
 100108 	goto __25
 100109 __24:
 100110 	if !(int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&JT_LEFT == 0) {
 100111 		goto __26
 100112 	}
 100113 
 100114 	cnt = 0
 100115 	Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp + 96)))
 100116 	*(*uintptr)(unsafe.Pointer(bp + 96)) = uintptr(0)
 100117 	goto __27
 100118 __26:
 100119 	extendFJMatch(tls, pParse, bp+96, pMatch, (*Expr)(unsafe.Pointer(pExpr)).FiColumn)
 100120 __27:
 100121 	;
 100122 __25:
 100123 	;
 100124 __23:
 100125 	;
 100126 __21:
 100127 	;
 100128 	cnt++
 100129 	cntTab = 2
 100130 	pMatch = pItem
 100131 	(*Expr)(unsafe.Pointer(pExpr)).FiColumn = YnVar(j)
 100132 	libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(j)*32+16+4, uint32(1), 6, 0x40)
 100133 	hit = 1
 100134 	if !(uint32(int32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(j)*32 + 16 + 4))&0x80>>7)) != 0) {
 100135 		goto __28
 100136 	}
 100137 	goto __19
 100138 __28:
 100139 	;
 100140 	goto __18
 100141 __18:
 100142 	j++
 100143 	goto __17
 100144 	goto __19
 100145 __19:
 100146 	;
 100147 	if !(hit != 0 || zTab == uintptr(0)) {
 100148 		goto __29
 100149 	}
 100150 	goto __14
 100151 __29:
 100152 	;
 100153 __16:
 100154 	;
 100155 	if !(zTab != 0) {
 100156 		goto __30
 100157 	}
 100158 	if !(zDb != 0) {
 100159 		goto __31
 100160 	}
 100161 	if !((*Table)(unsafe.Pointer(pTab)).FpSchema != pSchema) {
 100162 		goto __32
 100163 	}
 100164 	goto __14
 100165 __32:
 100166 	;
 100167 	if !(pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, ts+7798) != 0) {
 100168 		goto __33
 100169 	}
 100170 	goto __14
 100171 __33:
 100172 	;
 100173 __31:
 100174 	;
 100175 	if !((*SrcItem)(unsafe.Pointer(pItem)).FzAlias != uintptr(0)) {
 100176 		goto __34
 100177 	}
 100178 	if !(Xsqlite3StrICmp(tls, zTab, (*SrcItem)(unsafe.Pointer(pItem)).FzAlias) != 0) {
 100179 		goto __36
 100180 	}
 100181 	goto __14
 100182 __36:
 100183 	;
 100184 	goto __35
 100185 __34:
 100186 	if !(Xsqlite3StrICmp(tls, zTab, (*Table)(unsafe.Pointer(pTab)).FzName) != 0) {
 100187 		goto __37
 100188 	}
 100189 	if !((*Table)(unsafe.Pointer(pTab)).Ftnum != Pgno(1)) {
 100190 		goto __38
 100191 	}
 100192 	goto __14
 100193 __38:
 100194 	;
 100195 	if !!(isValidSchemaTableName(tls, zTab, pTab, pSchema) != 0) {
 100196 		goto __39
 100197 	}
 100198 	goto __14
 100199 __39:
 100200 	;
 100201 __37:
 100202 	;
 100203 __35:
 100204 	;
 100205 	if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME && (*SrcItem)(unsafe.Pointer(pItem)).FzAlias != 0) {
 100206 		goto __40
 100207 	}
 100208 	Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr+64)
 100209 __40:
 100210 	;
 100211 __30:
 100212 	;
 100213 	hCol = Xsqlite3StrIHash(tls, zCol)
 100214 	j = 0
 100215 	pCol = (*Table)(unsafe.Pointer(pTab)).FaCol
 100216 __41:
 100217 	if !(j < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 100218 		goto __43
 100219 	}
 100220 	if !(int32((*Column)(unsafe.Pointer(pCol)).FhName) == int32(hCol) &&
 100221 		Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0) {
 100222 		goto __44
 100223 	}
 100224 	if !(cnt > 0) {
 100225 		goto __45
 100226 	}
 100227 	if !(int32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x400>>10) == 0 ||
 100228 		Xsqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 72)), zCol) < 0) {
 100229 		goto __46
 100230 	}
 100231 
 100232 	Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp + 96)))
 100233 	*(*uintptr)(unsafe.Pointer(bp + 96)) = uintptr(0)
 100234 	goto __47
 100235 __46:
 100236 	if !(int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&JT_RIGHT == 0) {
 100237 		goto __48
 100238 	}
 100239 
 100240 	goto __42
 100241 	goto __49
 100242 __48:
 100243 	if !(int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&JT_LEFT == 0) {
 100244 		goto __50
 100245 	}
 100246 
 100247 	cnt = 0
 100248 	Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp + 96)))
 100249 	*(*uintptr)(unsafe.Pointer(bp + 96)) = uintptr(0)
 100250 	goto __51
 100251 __50:
 100252 	extendFJMatch(tls, pParse, bp+96, pMatch, (*Expr)(unsafe.Pointer(pExpr)).FiColumn)
 100253 __51:
 100254 	;
 100255 __49:
 100256 	;
 100257 __47:
 100258 	;
 100259 __45:
 100260 	;
 100261 	cnt++
 100262 	pMatch = pItem
 100263 
 100264 	(*Expr)(unsafe.Pointer(pExpr)).FiColumn = func() int16 {
 100265 		if j == int32((*Table)(unsafe.Pointer(pTab)).FiPKey) {
 100266 			return int16(-1)
 100267 		}
 100268 		return I16(j)
 100269 	}()
 100270 	if !(uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x2000>>13)) != 0) {
 100271 		goto __52
 100272 	}
 100273 	Xsqlite3SrcItemColumnUsed(tls, pItem, j)
 100274 __52:
 100275 	;
 100276 	goto __43
 100277 __44:
 100278 	;
 100279 	goto __42
 100280 __42:
 100281 	j++
 100282 	pCol += 24
 100283 	goto __41
 100284 	goto __43
 100285 __43:
 100286 	;
 100287 	if !(0 == cnt && (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_NoVisibleRowid) == U32(0)) {
 100288 		goto __53
 100289 	}
 100290 	cntTab++
 100291 	pMatch = pItem
 100292 __53:
 100293 	;
 100294 	goto __14
 100295 __14:
 100296 	i++
 100297 	pItem += 104
 100298 	goto __13
 100299 	goto __15
 100300 __15:
 100301 	;
 100302 	if !(pMatch != 0) {
 100303 		goto __54
 100304 	}
 100305 	(*Expr)(unsafe.Pointer(pExpr)).FiTable = (*SrcItem)(unsafe.Pointer(pMatch)).FiCursor
 100306 
 100307 	*(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*SrcItem)(unsafe.Pointer(pMatch)).FpTab
 100308 	if !(int32((*SrcItem)(unsafe.Pointer(pMatch)).Ffg.Fjointype)&(JT_LEFT|JT_LTORJ) != 0) {
 100309 		goto __55
 100310 	}
 100311 	*(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_CanBeNull)
 100312 __55:
 100313 	;
 100314 	pSchema = (*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64)))).FpSchema
 100315 __54:
 100316 	;
 100317 __12:
 100318 	;
 100319 	if !(cnt == 0 && zDb == uintptr(0)) {
 100320 		goto __56
 100321 	}
 100322 	pTab = uintptr(0)
 100323 	if !((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab != uintptr(0)) {
 100324 		goto __57
 100325 	}
 100326 	op = int32((*Parse)(unsafe.Pointer(pParse)).FeTriggerOp)
 100327 
 100328 	if !((*Parse)(unsafe.Pointer(pParse)).FbReturning != 0) {
 100329 		goto __58
 100330 	}
 100331 	if !((*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_UBaseReg != 0 &&
 100332 		(zTab == uintptr(0) || Xsqlite3StrICmp(tls, zTab, (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab)).FzName) == 0)) {
 100333 		goto __60
 100334 	}
 100335 	(*Expr)(unsafe.Pointer(pExpr)).FiTable = libc.Bool32(op != TK_DELETE)
 100336 	pTab = (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab
 100337 __60:
 100338 	;
 100339 	goto __59
 100340 __58:
 100341 	if !(op != TK_DELETE && zTab != 0 && Xsqlite3StrICmp(tls, ts+7800, zTab) == 0) {
 100342 		goto __61
 100343 	}
 100344 	(*Expr)(unsafe.Pointer(pExpr)).FiTable = 1
 100345 	pTab = (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab
 100346 	goto __62
 100347 __61:
 100348 	if !(op != TK_INSERT && zTab != 0 && Xsqlite3StrICmp(tls, ts+7804, zTab) == 0) {
 100349 		goto __63
 100350 	}
 100351 	(*Expr)(unsafe.Pointer(pExpr)).FiTable = 0
 100352 	pTab = (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab
 100353 __63:
 100354 	;
 100355 __62:
 100356 	;
 100357 __59:
 100358 	;
 100359 __57:
 100360 	;
 100361 	if !((*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_UUpsert != 0 && zTab != uintptr(0)) {
 100362 		goto __64
 100363 	}
 100364 	pUpsert = *(*uintptr)(unsafe.Pointer(pNC + 16))
 100365 	if !(pUpsert != 0 && Xsqlite3StrICmp(tls, ts+7808, zTab) == 0) {
 100366 		goto __65
 100367 	}
 100368 	pTab = (*SrcItem)(unsafe.Pointer((*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8)).FpTab
 100369 	(*Expr)(unsafe.Pointer(pExpr)).FiTable = EXCLUDED_TABLE_NUMBER
 100370 __65:
 100371 	;
 100372 __64:
 100373 	;
 100374 	if !(pTab != 0) {
 100375 		goto __66
 100376 	}
 100377 	hCol1 = Xsqlite3StrIHash(tls, zCol)
 100378 	pSchema = (*Table)(unsafe.Pointer(pTab)).FpSchema
 100379 	cntTab++
 100380 	iCol = 0
 100381 	pCol = (*Table)(unsafe.Pointer(pTab)).FaCol
 100382 __67:
 100383 	if !(iCol < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 100384 		goto __69
 100385 	}
 100386 	if !(int32((*Column)(unsafe.Pointer(pCol)).FhName) == int32(hCol1) &&
 100387 		Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0) {
 100388 		goto __70
 100389 	}
 100390 	if !(iCol == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) {
 100391 		goto __71
 100392 	}
 100393 	iCol = -1
 100394 __71:
 100395 	;
 100396 	goto __69
 100397 __70:
 100398 	;
 100399 	goto __68
 100400 __68:
 100401 	iCol++
 100402 	pCol += 24
 100403 	goto __67
 100404 	goto __69
 100405 __69:
 100406 	;
 100407 	if !(iCol >= int32((*Table)(unsafe.Pointer(pTab)).FnCol) && Xsqlite3IsRowid(tls, zCol) != 0 && (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_NoVisibleRowid) == U32(0)) {
 100408 		goto __72
 100409 	}
 100410 
 100411 	iCol = -1
 100412 __72:
 100413 	;
 100414 	if !(iCol < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 100415 		goto __73
 100416 	}
 100417 	cnt++
 100418 	pMatch = uintptr(0)
 100419 	if !((*Expr)(unsafe.Pointer(pExpr)).FiTable == EXCLUDED_TABLE_NUMBER) {
 100420 		goto __74
 100421 	}
 100422 
 100423 	if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 100424 		goto __76
 100425 	}
 100426 	(*Expr)(unsafe.Pointer(pExpr)).FiColumn = YnVar(iCol)
 100427 	*(*uintptr)(unsafe.Pointer(pExpr + 64)) = pTab
 100428 	eNewExprOp = TK_COLUMN
 100429 	goto __77
 100430 __76:
 100431 	(*Expr)(unsafe.Pointer(pExpr)).FiTable = (*Upsert)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNC + 16)))).FregData + int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(iCol)))
 100432 	eNewExprOp = TK_REGISTER
 100433 __77:
 100434 	;
 100435 	goto __75
 100436 __74:
 100437 	;
 100438 	*(*uintptr)(unsafe.Pointer(pExpr + 64)) = pTab
 100439 	if !((*Parse)(unsafe.Pointer(pParse)).FbReturning != 0) {
 100440 		goto __78
 100441 	}
 100442 	eNewExprOp = TK_REGISTER
 100443 	(*Expr)(unsafe.Pointer(pExpr)).Fop2 = U8(TK_COLUMN)
 100444 	(*Expr)(unsafe.Pointer(pExpr)).FiColumn = YnVar(iCol)
 100445 	(*Expr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(pNC + 16)) + (int32((*Table)(unsafe.Pointer(pTab)).FnCol)+1)*(*Expr)(unsafe.Pointer(pExpr)).FiTable + int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(iCol))) + 1
 100446 	goto __79
 100447 __78:
 100448 	(*Expr)(unsafe.Pointer(pExpr)).FiColumn = I16(iCol)
 100449 	eNewExprOp = TK_TRIGGER
 100450 	if !(iCol < 0) {
 100451 		goto __80
 100452 	}
 100453 	(*Expr)(unsafe.Pointer(pExpr)).FaffExpr = int8(SQLITE_AFF_INTEGER)
 100454 	goto __81
 100455 __80:
 100456 	if !((*Expr)(unsafe.Pointer(pExpr)).FiTable == 0) {
 100457 		goto __82
 100458 	}
 100459 
 100460 	*(*U32)(unsafe.Pointer(pParse + 212)) |= func() uint32 {
 100461 		if iCol >= 32 {
 100462 			return 0xffffffff
 100463 		}
 100464 		return U32(1) << iCol
 100465 	}()
 100466 	goto __83
 100467 __82:
 100468 	;
 100469 	*(*U32)(unsafe.Pointer(pParse + 216)) |= func() uint32 {
 100470 		if iCol >= 32 {
 100471 			return 0xffffffff
 100472 		}
 100473 		return U32(1) << iCol
 100474 	}()
 100475 __83:
 100476 	;
 100477 __81:
 100478 	;
 100479 __79:
 100480 	;
 100481 __75:
 100482 	;
 100483 __73:
 100484 	;
 100485 __66:
 100486 	;
 100487 __56:
 100488 	;
 100489 	if !(cnt == 0 &&
 100490 		cntTab == 1 &&
 100491 		pMatch != 0 &&
 100492 		(*NameContext)(unsafe.Pointer(pNC)).FncFlags&(NC_IdxExpr|NC_GenCol) == 0 &&
 100493 		Xsqlite3IsRowid(tls, zCol) != 0 &&
 100494 		(*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pMatch)).FpTab)).FtabFlags&U32(TF_NoVisibleRowid) == U32(0)) {
 100495 		goto __84
 100496 	}
 100497 	cnt = 1
 100498 	(*Expr)(unsafe.Pointer(pExpr)).FiColumn = int16(-1)
 100499 	(*Expr)(unsafe.Pointer(pExpr)).FaffExpr = int8(SQLITE_AFF_INTEGER)
 100500 __84:
 100501 	;
 100502 	if !(cnt == 0 &&
 100503 		(*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_UEList != 0 &&
 100504 		zTab == uintptr(0)) {
 100505 		goto __85
 100506 	}
 100507 	pEList = *(*uintptr)(unsafe.Pointer(pNC + 16))
 100508 
 100509 	j = 0
 100510 __86:
 100511 	if !(j < (*ExprList)(unsafe.Pointer(pEList)).FnExpr) {
 100512 		goto __88
 100513 	}
 100514 	zAs = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(j)*32)).FzEName
 100515 	if !(int32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(j)*32 + 16 + 4))&0x3>>0) == ENAME_NAME &&
 100516 		Xsqlite3_stricmp(tls, zAs, zCol) == 0) {
 100517 		goto __89
 100518 	}
 100519 
 100520 	pOrig = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(j)*32)).FpExpr
 100521 	if !((*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_AllowAgg == 0 && (*Expr)(unsafe.Pointer(pOrig)).Fflags&U32(EP_Agg) != U32(0)) {
 100522 		goto __90
 100523 	}
 100524 	Xsqlite3ErrorMsg(tls, pParse, ts+7817, libc.VaList(bp, zAs))
 100525 	return WRC_Abort
 100526 __90:
 100527 	;
 100528 	if !((*Expr)(unsafe.Pointer(pOrig)).Fflags&U32(EP_Win) != U32(0) &&
 100529 		((*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_AllowWin == 0 || pNC != pTopNC)) {
 100530 		goto __91
 100531 	}
 100532 	Xsqlite3ErrorMsg(tls, pParse, ts+7848, libc.VaList(bp+8, zAs))
 100533 	return WRC_Abort
 100534 __91:
 100535 	;
 100536 	if !(Xsqlite3ExprVectorSize(tls, pOrig) != 1) {
 100537 		goto __92
 100538 	}
 100539 	Xsqlite3ErrorMsg(tls, pParse, ts+7885, 0)
 100540 	return WRC_Abort
 100541 __92:
 100542 	;
 100543 	resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery)
 100544 	cnt = 1
 100545 	pMatch = uintptr(0)
 100546 
 100547 	if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 100548 		goto __93
 100549 	}
 100550 	Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr)
 100551 __93:
 100552 	;
 100553 	goto lookupname_end
 100554 __89:
 100555 	;
 100556 	goto __87
 100557 __87:
 100558 	j++
 100559 	goto __86
 100560 	goto __88
 100561 __88:
 100562 	;
 100563 __85:
 100564 	;
 100565 	if !(cnt != 0) {
 100566 		goto __94
 100567 	}
 100568 	goto __11
 100569 __94:
 100570 	;
 100571 	pNC = (*NameContext)(unsafe.Pointer(pNC)).FpNext
 100572 	nSubquery++
 100573 	goto __10
 100574 __10:
 100575 	if pNC != 0 {
 100576 		goto __9
 100577 	}
 100578 	goto __11
 100579 __11:
 100580 	;
 100581 	if !(cnt == 0 && zTab == uintptr(0)) {
 100582 		goto __95
 100583 	}
 100584 
 100585 	if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_DblQuoted) != U32(0) &&
 100586 		areDoubleQuotedStringsEnabled(tls, db, pTopNC) != 0) {
 100587 		goto __96
 100588 	}
 100589 
 100590 	Xsqlite3_log(tls, SQLITE_WARNING,
 100591 		ts+7903, libc.VaList(bp+16, zCol))
 100592 	(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_STRING)
 100593 	libc.Xmemset(tls, pExpr+64, 0, uint64(unsafe.Sizeof(struct{ FpTab uintptr }{})))
 100594 	return WRC_Prune
 100595 __96:
 100596 	;
 100597 	if !(Xsqlite3ExprIdToTrueFalse(tls, pExpr) != 0) {
 100598 		goto __97
 100599 	}
 100600 	return WRC_Prune
 100601 __97:
 100602 	;
 100603 __95:
 100604 	;
 100605 	if !(cnt != 1) {
 100606 		goto __98
 100607 	}
 100608 	if !(*(*uintptr)(unsafe.Pointer(bp + 96)) != 0) {
 100609 		goto __99
 100610 	}
 100611 	if !((*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).FnExpr == cnt-1) {
 100612 		goto __100
 100613 	}
 100614 	if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Leaf) != U32(0)) {
 100615 		goto __102
 100616 	}
 100617 	*(*U32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(libc.CplInt32(EP_Leaf))
 100618 	goto __103
 100619 __102:
 100620 	Xsqlite3ExprDelete(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
 100621 	(*Expr)(unsafe.Pointer(pExpr)).FpLeft = uintptr(0)
 100622 	Xsqlite3ExprDelete(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
 100623 	(*Expr)(unsafe.Pointer(pExpr)).FpRight = uintptr(0)
 100624 __103:
 100625 	;
 100626 	extendFJMatch(tls, pParse, bp+96, pMatch, (*Expr)(unsafe.Pointer(pExpr)).FiColumn)
 100627 	(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_FUNCTION)
 100628 	*(*uintptr)(unsafe.Pointer(pExpr + 8)) = ts + 7938
 100629 	*(*uintptr)(unsafe.Pointer(pExpr + 32)) = *(*uintptr)(unsafe.Pointer(bp + 96))
 100630 	cnt = 1
 100631 	goto lookupname_end
 100632 	goto __101
 100633 __100:
 100634 	Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp + 96)))
 100635 	*(*uintptr)(unsafe.Pointer(bp + 96)) = uintptr(0)
 100636 __101:
 100637 	;
 100638 __99:
 100639 	;
 100640 	if cnt == 0 {
 100641 		zErr = ts + 7947
 100642 	} else {
 100643 		zErr = ts + 7962
 100644 	}
 100645 	if !(zDb != 0) {
 100646 		goto __104
 100647 	}
 100648 	Xsqlite3ErrorMsg(tls, pParse, ts+7984, libc.VaList(bp+24, zErr, zDb, zTab, zCol))
 100649 	goto __105
 100650 __104:
 100651 	if !(zTab != 0) {
 100652 		goto __106
 100653 	}
 100654 	Xsqlite3ErrorMsg(tls, pParse, ts+7997, libc.VaList(bp+56, zErr, zTab, zCol))
 100655 	goto __107
 100656 __106:
 100657 	Xsqlite3ErrorMsg(tls, pParse, ts+8007, libc.VaList(bp+80, zErr, zCol))
 100658 __107:
 100659 	;
 100660 __105:
 100661 	;
 100662 	Xsqlite3RecordErrorOffsetOfExpr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr)
 100663 	(*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1)
 100664 	(*NameContext)(unsafe.Pointer(pTopNC)).FnNcErr++
 100665 __98:
 100666 	;
 100667 	if !!((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_TokenOnly|EP_Leaf) != U32(0)) {
 100668 		goto __108
 100669 	}
 100670 	Xsqlite3ExprDelete(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
 100671 	(*Expr)(unsafe.Pointer(pExpr)).FpLeft = uintptr(0)
 100672 	Xsqlite3ExprDelete(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
 100673 	(*Expr)(unsafe.Pointer(pExpr)).FpRight = uintptr(0)
 100674 	*(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_Leaf)
 100675 __108:
 100676 	;
 100677 	if !(int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 && pMatch != uintptr(0)) {
 100678 		goto __109
 100679 	}
 100680 	*(*Bitmask)(unsafe.Pointer(pMatch + 80)) |= Xsqlite3ExprColUsed(tls, pExpr)
 100681 __109:
 100682 	;
 100683 	(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(eNewExprOp)
 100684 lookupname_end:
 100685 	if !(cnt == 1) {
 100686 		goto __110
 100687 	}
 100688 
 100689 	if !((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FxAuth != 0 &&
 100690 		(int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN || int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_TRIGGER)) {
 100691 		goto __112
 100692 	}
 100693 	Xsqlite3AuthRead(tls, pParse, pExpr, pSchema, (*NameContext)(unsafe.Pointer(pNC)).FpSrcList)
 100694 __112:
 100695 	;
 100696 __113:
 100697 	;
 100698 	(*NameContext)(unsafe.Pointer(pTopNC)).FnRef++
 100699 	if !(pTopNC == pNC) {
 100700 		goto __116
 100701 	}
 100702 	goto __115
 100703 __116:
 100704 	;
 100705 	pTopNC = (*NameContext)(unsafe.Pointer(pTopNC)).FpNext
 100706 	goto __114
 100707 __114:
 100708 	goto __113
 100709 	goto __115
 100710 __115:
 100711 	;
 100712 	return WRC_Prune
 100713 	goto __111
 100714 __110:
 100715 	return WRC_Abort
 100716 __111:
 100717 	;
 100718 	return int32(0)
 100719 }
 100720 
 100721 // Allocate and return a pointer to an expression to load the column iCol
 100722 // from datasource iSrc in SrcList pSrc.
 100723 func Xsqlite3CreateColumnExpr(tls *libc.TLS, db uintptr, pSrc uintptr, iSrc int32, iCol int32) uintptr {
 100724 	var p uintptr = Xsqlite3ExprAlloc(tls, db, TK_COLUMN, uintptr(0), 0)
 100725 	if p != 0 {
 100726 		var pItem uintptr = pSrc + 8 + uintptr(iSrc)*104
 100727 		var pTab uintptr
 100728 
 100729 		pTab = libc.AssignPtrUintptr(p+64, (*SrcItem)(unsafe.Pointer(pItem)).FpTab)
 100730 		(*Expr)(unsafe.Pointer(p)).FiTable = (*SrcItem)(unsafe.Pointer(pItem)).FiCursor
 100731 		if int32((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 64)))).FiPKey) == iCol {
 100732 			(*Expr)(unsafe.Pointer(p)).FiColumn = int16(-1)
 100733 		} else {
 100734 			(*Expr)(unsafe.Pointer(p)).FiColumn = YnVar(iCol)
 100735 			if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasGenerated) != U32(0) &&
 100736 				int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*24)).FcolFlags)&COLFLAG_GENERATED != 0 {
 100737 				(*SrcItem)(unsafe.Pointer(pItem)).FcolUsed = func() uint64 {
 100738 					if int32((*Table)(unsafe.Pointer(pTab)).FnCol) >= 64 {
 100739 						return libc.Uint64(libc.Uint64FromInt32(-1))
 100740 					}
 100741 					return uint64(1)<<int32((*Table)(unsafe.Pointer(pTab)).FnCol) - uint64(1)
 100742 				}()
 100743 			} else {
 100744 				*(*Bitmask)(unsafe.Pointer(pItem + 80)) |= uint64(1) << func() int32 {
 100745 					if iCol >= int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8)) {
 100746 						return int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8)) - 1
 100747 					}
 100748 					return iCol
 100749 				}()
 100750 			}
 100751 		}
 100752 	}
 100753 	return p
 100754 }
 100755 
 100756 func notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pExpr uintptr, pError uintptr) {
 100757 	bp := tls.Alloc(16)
 100758 	defer tls.Free(16)
 100759 
 100760 	var zIn uintptr = ts + 8014
 100761 	if (*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_IdxExpr != 0 {
 100762 		zIn = ts + 8042
 100763 	} else if (*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_IsCheck != 0 {
 100764 		zIn = ts + 8060
 100765 	} else if (*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_GenCol != 0 {
 100766 		zIn = ts + 8078
 100767 	}
 100768 	Xsqlite3ErrorMsg(tls, pParse, ts+8096, libc.VaList(bp, zMsg, zIn))
 100769 	if pExpr != 0 {
 100770 		(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL)
 100771 	}
 100772 	Xsqlite3RecordErrorOffsetOfExpr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pError)
 100773 }
 100774 
 100775 func exprProbability(tls *libc.TLS, p uintptr) int32 {
 100776 	bp := tls.Alloc(8)
 100777 	defer tls.Free(8)
 100778 
 100779 	*(*float64)(unsafe.Pointer(bp)) = -1.0
 100780 	if int32((*Expr)(unsafe.Pointer(p)).Fop) != TK_FLOAT {
 100781 		return -1
 100782 	}
 100783 
 100784 	Xsqlite3AtoF(tls, *(*uintptr)(unsafe.Pointer(p + 8)), bp, Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(p + 8))), uint8(SQLITE_UTF8))
 100785 
 100786 	if *(*float64)(unsafe.Pointer(bp)) > 1.0 {
 100787 		return -1
 100788 	}
 100789 	return libc.Int32FromFloat64(*(*float64)(unsafe.Pointer(bp)) * 134217728.0)
 100790 }
 100791 
 100792 func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 100793 	bp := tls.Alloc(96)
 100794 	defer tls.Free(96)
 100795 
 100796 	var pNC uintptr
 100797 	var pParse uintptr
 100798 
 100799 	pNC = *(*uintptr)(unsafe.Pointer(pWalker + 40))
 100800 
 100801 	pParse = (*NameContext)(unsafe.Pointer(pNC)).FpParse
 100802 
 100803 	switch int32((*Expr)(unsafe.Pointer(pExpr)).Fop) {
 100804 	case TK_ROW:
 100805 		{
 100806 			var pSrcList uintptr = (*NameContext)(unsafe.Pointer(pNC)).FpSrcList
 100807 			var pItem uintptr
 100808 
 100809 			pItem = pSrcList + 8
 100810 			(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_COLUMN)
 100811 
 100812 			*(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*SrcItem)(unsafe.Pointer(pItem)).FpTab
 100813 			(*Expr)(unsafe.Pointer(pExpr)).FiTable = (*SrcItem)(unsafe.Pointer(pItem)).FiCursor
 100814 			(*Expr)(unsafe.Pointer(pExpr)).FiColumn--
 100815 			(*Expr)(unsafe.Pointer(pExpr)).FaffExpr = int8(SQLITE_AFF_INTEGER)
 100816 			break
 100817 
 100818 		}
 100819 
 100820 	case TK_NOTNULL:
 100821 		fallthrough
 100822 	case TK_ISNULL:
 100823 		{
 100824 			var p uintptr
 100825 			var i int32
 100826 			i = 0
 100827 			p = pNC
 100828 		__1:
 100829 			if !(p != 0 && i < int32(uint64(unsafe.Sizeof([8]int32{}))/uint64(unsafe.Sizeof(int32(0))))) {
 100830 				goto __3
 100831 			}
 100832 			{
 100833 				*(*int32)(unsafe.Pointer(bp + 64 + uintptr(i)*4)) = (*NameContext)(unsafe.Pointer(p)).FnRef
 100834 
 100835 			}
 100836 			goto __2
 100837 		__2:
 100838 			p = (*NameContext)(unsafe.Pointer(p)).FpNext
 100839 			i++
 100840 			goto __1
 100841 			goto __3
 100842 		__3:
 100843 			;
 100844 			Xsqlite3WalkExpr(tls, pWalker, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
 100845 			if 0 == Xsqlite3ExprCanBeNull(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 100846 				*(*int32)(unsafe.Pointer(pExpr + 8)) = libc.Bool32(int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NOTNULL)
 100847 				*(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_IntValue)
 100848 				(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_INTEGER)
 100849 
 100850 				i = 0
 100851 				p = pNC
 100852 			__4:
 100853 				if !(p != 0 && i < int32(uint64(unsafe.Sizeof([8]int32{}))/uint64(unsafe.Sizeof(int32(0))))) {
 100854 					goto __6
 100855 				}
 100856 				{
 100857 					(*NameContext)(unsafe.Pointer(p)).FnRef = *(*int32)(unsafe.Pointer(bp + 64 + uintptr(i)*4))
 100858 
 100859 				}
 100860 				goto __5
 100861 			__5:
 100862 				p = (*NameContext)(unsafe.Pointer(p)).FpNext
 100863 				i++
 100864 				goto __4
 100865 				goto __6
 100866 			__6:
 100867 				;
 100868 				Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
 100869 				(*Expr)(unsafe.Pointer(pExpr)).FpLeft = uintptr(0)
 100870 			}
 100871 			return WRC_Prune
 100872 
 100873 		}
 100874 
 100875 	case TK_ID:
 100876 		fallthrough
 100877 	case TK_DOT:
 100878 		{
 100879 			var zColumn uintptr
 100880 			var zTable uintptr
 100881 			var zDb uintptr
 100882 			var pRight uintptr
 100883 
 100884 			if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_ID {
 100885 				zDb = uintptr(0)
 100886 				zTable = uintptr(0)
 100887 
 100888 				zColumn = *(*uintptr)(unsafe.Pointer(pExpr + 8))
 100889 			} else {
 100890 				var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
 100891 
 100892 				if (*NameContext)(unsafe.Pointer(pNC)).FncFlags&(NC_IdxExpr|NC_GenCol) != 0 {
 100893 					notValidImpl(tls, pParse, pNC, ts+8116, uintptr(0), pExpr)
 100894 				}
 100895 
 100896 				pRight = (*Expr)(unsafe.Pointer(pExpr)).FpRight
 100897 				if int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_ID {
 100898 					zDb = uintptr(0)
 100899 				} else {
 100900 					zDb = *(*uintptr)(unsafe.Pointer(pLeft + 8))
 100901 					pLeft = (*Expr)(unsafe.Pointer(pRight)).FpLeft
 100902 					pRight = (*Expr)(unsafe.Pointer(pRight)).FpRight
 100903 				}
 100904 
 100905 				zTable = *(*uintptr)(unsafe.Pointer(pLeft + 8))
 100906 				zColumn = *(*uintptr)(unsafe.Pointer(pRight + 8))
 100907 
 100908 				if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
 100909 					Xsqlite3RenameTokenRemap(tls, pParse, pExpr, pRight)
 100910 					Xsqlite3RenameTokenRemap(tls, pParse, pExpr+64, pLeft)
 100911 				}
 100912 			}
 100913 			return lookupName(tls, pParse, zDb, zTable, zColumn, pNC, pExpr)
 100914 
 100915 		}
 100916 
 100917 	case TK_FUNCTION:
 100918 		{
 100919 			var pList uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 32))
 100920 			var n int32
 100921 			if pList != 0 {
 100922 				n = (*ExprList)(unsafe.Pointer(pList)).FnExpr
 100923 			} else {
 100924 				n = 0
 100925 			}
 100926 			var no_such_func int32 = 0
 100927 			var wrong_num_args int32 = 0
 100928 			var is_agg int32 = 0
 100929 			var zId uintptr
 100930 			var pDef uintptr
 100931 			var enc U8 = (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fenc
 100932 			var savedAllowFlags int32 = (*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_AllowAgg | NC_AllowWin)
 100933 			var pWin uintptr = func() uintptr {
 100934 				if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0) && int32((*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64)))).FeFrmType) != TK_FILTER {
 100935 					return *(*uintptr)(unsafe.Pointer(pExpr + 64))
 100936 				}
 100937 				return uintptr(0)
 100938 			}()
 100939 
 100940 			zId = *(*uintptr)(unsafe.Pointer(pExpr + 8))
 100941 			pDef = Xsqlite3FindFunction(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, zId, n, enc, uint8(0))
 100942 			if pDef == uintptr(0) {
 100943 				pDef = Xsqlite3FindFunction(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, zId, -2, enc, uint8(0))
 100944 				if pDef == uintptr(0) {
 100945 					no_such_func = 1
 100946 				} else {
 100947 					wrong_num_args = 1
 100948 				}
 100949 			} else {
 100950 				is_agg = libc.Bool32((*FuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0))
 100951 				if (*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_UNLIKELY) != 0 {
 100952 					*(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_Unlikely)
 100953 					if n == 2 {
 100954 						(*Expr)(unsafe.Pointer(pExpr)).FiTable = exprProbability(tls, (*ExprList_item)(unsafe.Pointer(pList+8+1*32)).FpExpr)
 100955 						if (*Expr)(unsafe.Pointer(pExpr)).FiTable < 0 {
 100956 							Xsqlite3ErrorMsg(tls, pParse,
 100957 								ts+8133, libc.VaList(bp, pExpr))
 100958 							(*NameContext)(unsafe.Pointer(pNC)).FnNcErr++
 100959 						}
 100960 					} else {
 100961 						(*Expr)(unsafe.Pointer(pExpr)).FiTable = func() int32 {
 100962 							if int32(*(*int8)(unsafe.Pointer((*FuncDef)(unsafe.Pointer(pDef)).FzName))) == 'u' {
 100963 								return 8388608
 100964 							}
 100965 							return 125829120
 100966 						}()
 100967 					}
 100968 				}
 100969 				{
 100970 					var auth int32 = Xsqlite3AuthCheck(tls, pParse, SQLITE_FUNCTION, uintptr(0), (*FuncDef)(unsafe.Pointer(pDef)).FzName, uintptr(0))
 100971 					if auth != SQLITE_OK {
 100972 						if auth == SQLITE_DENY {
 100973 							Xsqlite3ErrorMsg(tls, pParse, ts+8197,
 100974 								libc.VaList(bp+8, pExpr))
 100975 							(*NameContext)(unsafe.Pointer(pNC)).FnNcErr++
 100976 						}
 100977 						(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL)
 100978 						return WRC_Prune
 100979 					}
 100980 
 100981 				}
 100982 				if (*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_CONSTANT|SQLITE_FUNC_SLOCHNG) != 0 {
 100983 					*(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_ConstFunc)
 100984 				}
 100985 				if (*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_CONSTANT) == U32(0) {
 100986 					if (*NameContext)(unsafe.Pointer(pNC)).FncFlags&(NC_IdxExpr|NC_PartIdx|NC_GenCol) != 0 {
 100987 						notValidImpl(tls, pParse, pNC, ts+8233, uintptr(0), pExpr)
 100988 					}
 100989 
 100990 				} else {
 100991 					(*Expr)(unsafe.Pointer(pExpr)).Fop2 = U8((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_SelfRef)
 100992 					if (*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_FromDDL != 0 {
 100993 						*(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_FromDDL)
 100994 					}
 100995 				}
 100996 				if (*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_INTERNAL) != U32(0) &&
 100997 					int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0 &&
 100998 					(*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags&U32(DBFLAG_InternalFunc) == U32(0) {
 100999 					no_such_func = 1
 101000 					pDef = uintptr(0)
 101001 				} else if (*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_DIRECT|SQLITE_FUNC_UNSAFE) != U32(0) &&
 101002 					!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 101003 					Xsqlite3ExprFunctionUsable(tls, pParse, pExpr, pDef)
 101004 				}
 101005 			}
 101006 
 101007 			if 0 == libc.Bool32(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 101008 				if pDef != 0 && (*FuncDef)(unsafe.Pointer(pDef)).FxValue == uintptr(0) && pWin != 0 {
 101009 					Xsqlite3ErrorMsg(tls, pParse,
 101010 						ts+8261, libc.VaList(bp+16, pExpr))
 101011 					(*NameContext)(unsafe.Pointer(pNC)).FnNcErr++
 101012 				} else if is_agg != 0 && (*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_AllowAgg == 0 ||
 101013 					is_agg != 0 && (*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_WINDOW) != 0 && !(pWin != 0) ||
 101014 					is_agg != 0 && pWin != 0 && (*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_AllowWin == 0 {
 101015 					var zType uintptr
 101016 					if (*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_WINDOW) != 0 || pWin != 0 {
 101017 						zType = ts + 8304
 101018 					} else {
 101019 						zType = ts + 8311
 101020 					}
 101021 					Xsqlite3ErrorMsg(tls, pParse, ts+8321, libc.VaList(bp+24, zType, pExpr))
 101022 					(*NameContext)(unsafe.Pointer(pNC)).FnNcErr++
 101023 					is_agg = 0
 101024 				} else if no_such_func != 0 && int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Finit.Fbusy) == 0 {
 101025 					Xsqlite3ErrorMsg(tls, pParse, ts+8349, libc.VaList(bp+40, pExpr))
 101026 					(*NameContext)(unsafe.Pointer(pNC)).FnNcErr++
 101027 				} else if wrong_num_args != 0 {
 101028 					Xsqlite3ErrorMsg(tls, pParse, ts+8371,
 101029 						libc.VaList(bp+48, pExpr))
 101030 					(*NameContext)(unsafe.Pointer(pNC)).FnNcErr++
 101031 				} else if is_agg == 0 && (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0) {
 101032 					Xsqlite3ErrorMsg(tls, pParse,
 101033 						ts+8415,
 101034 						libc.VaList(bp+56, pExpr))
 101035 					(*NameContext)(unsafe.Pointer(pNC)).FnNcErr++
 101036 				}
 101037 				if is_agg != 0 {
 101038 					*(*int32)(unsafe.Pointer(pNC + 40)) &= ^(NC_AllowWin | func() int32 {
 101039 						if !(pWin != 0) {
 101040 							return NC_AllowAgg
 101041 						}
 101042 						return 0
 101043 					}())
 101044 				}
 101045 			} else if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0) {
 101046 				is_agg = 1
 101047 			}
 101048 			Xsqlite3WalkExprList(tls, pWalker, pList)
 101049 			if is_agg != 0 {
 101050 				if pWin != 0 {
 101051 					var pSel uintptr = (*NameContext)(unsafe.Pointer(pNC)).FpWinSelect
 101052 
 101053 					if libc.Bool32(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) == 0 {
 101054 						Xsqlite3WindowUpdate(tls, pParse, func() uintptr {
 101055 							if pSel != 0 {
 101056 								return (*Select)(unsafe.Pointer(pSel)).FpWinDefn
 101057 							}
 101058 							return uintptr(0)
 101059 						}(), pWin, pDef)
 101060 						if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 {
 101061 							break
 101062 						}
 101063 					}
 101064 					Xsqlite3WalkExprList(tls, pWalker, (*Window)(unsafe.Pointer(pWin)).FpPartition)
 101065 					Xsqlite3WalkExprList(tls, pWalker, (*Window)(unsafe.Pointer(pWin)).FpOrderBy)
 101066 					Xsqlite3WalkExpr(tls, pWalker, (*Window)(unsafe.Pointer(pWin)).FpFilter)
 101067 					Xsqlite3WindowLink(tls, pSel, pWin)
 101068 					*(*int32)(unsafe.Pointer(pNC + 40)) |= NC_HasWin
 101069 				} else {
 101070 					var pNC2 uintptr
 101071 					(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_AGG_FUNCTION)
 101072 					(*Expr)(unsafe.Pointer(pExpr)).Fop2 = U8(0)
 101073 					if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0) {
 101074 						Xsqlite3WalkExpr(tls, pWalker, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64)))).FpFilter)
 101075 					}
 101076 					pNC2 = pNC
 101077 					for pNC2 != 0 &&
 101078 						Xsqlite3ReferencesSrcList(tls, pParse, pExpr, (*NameContext)(unsafe.Pointer(pNC2)).FpSrcList) == 0 {
 101079 						(*Expr)(unsafe.Pointer(pExpr)).Fop2++
 101080 						pNC2 = (*NameContext)(unsafe.Pointer(pNC2)).FpNext
 101081 					}
 101082 
 101083 					if pNC2 != 0 && pDef != 0 {
 101084 						*(*int32)(unsafe.Pointer(pNC2 + 40)) |= int32(U32(NC_HasAgg) |
 101085 							((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags^U32(SQLITE_FUNC_ANYORDER))&
 101086 								U32(SQLITE_FUNC_MINMAX|SQLITE_FUNC_ANYORDER))
 101087 					}
 101088 				}
 101089 				*(*int32)(unsafe.Pointer(pNC + 40)) |= savedAllowFlags
 101090 			}
 101091 
 101092 			return WRC_Prune
 101093 
 101094 		}
 101095 	case TK_SELECT:
 101096 		fallthrough
 101097 	case TK_EXISTS:
 101098 		fallthrough
 101099 	case TK_IN:
 101100 		{
 101101 			if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) {
 101102 				var nRef int32 = (*NameContext)(unsafe.Pointer(pNC)).FnRef
 101103 
 101104 				if (*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_SelfRef != 0 {
 101105 					notValidImpl(tls, pParse, pNC, ts+8463, pExpr, pExpr)
 101106 				} else {
 101107 					Xsqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32)))
 101108 				}
 101109 
 101110 				if nRef != (*NameContext)(unsafe.Pointer(pNC)).FnRef {
 101111 					*(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_VarSelect)
 101112 				}
 101113 				*(*int32)(unsafe.Pointer(pNC + 40)) |= NC_Subquery
 101114 			}
 101115 			break
 101116 
 101117 		}
 101118 	case TK_VARIABLE:
 101119 		{
 101120 			if (*NameContext)(unsafe.Pointer(pNC)).FncFlags&(NC_IsCheck|NC_PartIdx|NC_IdxExpr|NC_GenCol) != 0 {
 101121 				notValidImpl(tls, pParse, pNC, ts+8474, pExpr, pExpr)
 101122 			}
 101123 
 101124 			break
 101125 
 101126 		}
 101127 	case TK_IS:
 101128 		fallthrough
 101129 	case TK_ISNOT:
 101130 		{
 101131 			var pRight uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
 101132 
 101133 			if pRight != 0 && (int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_ID || int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_TRUEFALSE) {
 101134 				var rc int32 = resolveExprStep(tls, pWalker, pRight)
 101135 				if rc == WRC_Abort {
 101136 					return WRC_Abort
 101137 				}
 101138 				if int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_TRUEFALSE {
 101139 					(*Expr)(unsafe.Pointer(pExpr)).Fop2 = (*Expr)(unsafe.Pointer(pExpr)).Fop
 101140 					(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_TRUTH)
 101141 					return WRC_Continue
 101142 				}
 101143 			}
 101144 
 101145 		}
 101146 		fallthrough
 101147 	case TK_BETWEEN:
 101148 		fallthrough
 101149 	case TK_EQ:
 101150 		fallthrough
 101151 	case TK_NE:
 101152 		fallthrough
 101153 	case TK_LT:
 101154 		fallthrough
 101155 	case TK_LE:
 101156 		fallthrough
 101157 	case TK_GT:
 101158 		fallthrough
 101159 	case TK_GE:
 101160 		{
 101161 			var nLeft int32
 101162 			var nRight int32
 101163 			if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 {
 101164 				break
 101165 			}
 101166 
 101167 			nLeft = Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
 101168 			if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_BETWEEN {
 101169 				nRight = Xsqlite3ExprVectorSize(tls, (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32))+8)).FpExpr)
 101170 				if nRight == nLeft {
 101171 					nRight = Xsqlite3ExprVectorSize(tls, (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32))+8+1*32)).FpExpr)
 101172 				}
 101173 			} else {
 101174 				nRight = Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
 101175 			}
 101176 			if nLeft != nRight {
 101177 				Xsqlite3ErrorMsg(tls, pParse, ts+7885, 0)
 101178 				Xsqlite3RecordErrorOffsetOfExpr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr)
 101179 			}
 101180 			break
 101181 
 101182 		}
 101183 	}
 101184 
 101185 	if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 101186 		return WRC_Abort
 101187 	}
 101188 	return WRC_Continue
 101189 }
 101190 
 101191 func resolveAsName(tls *libc.TLS, pParse uintptr, pEList uintptr, pE uintptr) int32 {
 101192 	var i int32
 101193 
 101194 	_ = pParse
 101195 
 101196 	if int32((*Expr)(unsafe.Pointer(pE)).Fop) == TK_ID {
 101197 		var zCol uintptr
 101198 
 101199 		zCol = *(*uintptr)(unsafe.Pointer(pE + 8))
 101200 		for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ {
 101201 			if int32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(i)*32 + 16 + 4))&0x3>>0) == ENAME_NAME &&
 101202 				Xsqlite3_stricmp(tls, (*ExprList_item)(unsafe.Pointer(pEList+8+uintptr(i)*32)).FzEName, zCol) == 0 {
 101203 				return i + 1
 101204 			}
 101205 		}
 101206 	}
 101207 	return 0
 101208 }
 101209 
 101210 func resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintptr, pE uintptr) int32 {
 101211 	bp := tls.Alloc(56)
 101212 	defer tls.Free(56)
 101213 
 101214 	var i int32
 101215 	var pEList uintptr
 101216 
 101217 	var db uintptr
 101218 	var rc int32
 101219 	var savedSuppErr U8
 101220 
 101221 	pEList = (*Select)(unsafe.Pointer(pSelect)).FpEList
 101222 
 101223 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(NameContext{})))
 101224 	(*NameContext)(unsafe.Pointer(bp)).FpParse = pParse
 101225 	(*NameContext)(unsafe.Pointer(bp)).FpSrcList = (*Select)(unsafe.Pointer(pSelect)).FpSrc
 101226 	*(*uintptr)(unsafe.Pointer(bp + 16)) = pEList
 101227 	(*NameContext)(unsafe.Pointer(bp)).FncFlags = NC_AllowAgg | NC_UEList | NC_NoSelect
 101228 	(*NameContext)(unsafe.Pointer(bp)).FnNcErr = 0
 101229 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 101230 	savedSuppErr = (*Sqlite3)(unsafe.Pointer(db)).FsuppressErr
 101231 	(*Sqlite3)(unsafe.Pointer(db)).FsuppressErr = U8(1)
 101232 	rc = Xsqlite3ResolveExprNames(tls, bp, pE)
 101233 	(*Sqlite3)(unsafe.Pointer(db)).FsuppressErr = savedSuppErr
 101234 	if rc != 0 {
 101235 		return 0
 101236 	}
 101237 
 101238 	for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ {
 101239 		if Xsqlite3ExprCompare(tls, uintptr(0), (*ExprList_item)(unsafe.Pointer(pEList+8+uintptr(i)*32)).FpExpr, pE, -1) < 2 {
 101240 			return i + 1
 101241 		}
 101242 	}
 101243 
 101244 	return 0
 101245 }
 101246 
 101247 func resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int32, mx int32, pError uintptr) {
 101248 	bp := tls.Alloc(24)
 101249 	defer tls.Free(24)
 101250 
 101251 	Xsqlite3ErrorMsg(tls, pParse,
 101252 		ts+8485, libc.VaList(bp, i, zType, mx))
 101253 	Xsqlite3RecordErrorOffsetOfExpr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pError)
 101254 }
 101255 
 101256 func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int32 {
 101257 	bp := tls.Alloc(12)
 101258 	defer tls.Free(12)
 101259 
 101260 	var i int32
 101261 	var pOrderBy uintptr
 101262 	var pEList uintptr
 101263 	var db uintptr
 101264 	var moreToDo int32 = 1
 101265 
 101266 	pOrderBy = (*Select)(unsafe.Pointer(pSelect)).FpOrderBy
 101267 	if pOrderBy == uintptr(0) {
 101268 		return 0
 101269 	}
 101270 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 101271 	if (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) {
 101272 		Xsqlite3ErrorMsg(tls, pParse, ts+8541, 0)
 101273 		return 1
 101274 	}
 101275 	for i = 0; i < (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr; i++ {
 101276 		libc.SetBitFieldPtr16Uint32(pOrderBy+8+uintptr(i)*32+16+4, uint32(0), 2, 0x4)
 101277 	}
 101278 	(*Select)(unsafe.Pointer(pSelect)).FpNext = uintptr(0)
 101279 	for (*Select)(unsafe.Pointer(pSelect)).FpPrior != 0 {
 101280 		(*Select)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpPrior)).FpNext = pSelect
 101281 		pSelect = (*Select)(unsafe.Pointer(pSelect)).FpPrior
 101282 	}
 101283 	for pSelect != 0 && moreToDo != 0 {
 101284 		var pItem uintptr
 101285 		moreToDo = 0
 101286 		pEList = (*Select)(unsafe.Pointer(pSelect)).FpEList
 101287 
 101288 		i = 0
 101289 		pItem = pOrderBy + 8
 101290 	__1:
 101291 		if !(i < (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr) {
 101292 			goto __3
 101293 		}
 101294 		{
 101295 			*(*int32)(unsafe.Pointer(bp + 8)) = -1
 101296 			var pE uintptr
 101297 			var pDup uintptr
 101298 			if uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 16 + 4))&0x4>>2)) != 0 {
 101299 				goto __2
 101300 			}
 101301 			pE = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr)
 101302 			if pE == uintptr(0) {
 101303 				goto __2
 101304 			}
 101305 			if Xsqlite3ExprIsInteger(tls, pE, bp+8) != 0 {
 101306 				if *(*int32)(unsafe.Pointer(bp + 8)) <= 0 || *(*int32)(unsafe.Pointer(bp + 8)) > (*ExprList)(unsafe.Pointer(pEList)).FnExpr {
 101307 					resolveOutOfRangeError(tls, pParse, ts+8575, i+1, (*ExprList)(unsafe.Pointer(pEList)).FnExpr, pE)
 101308 					return 1
 101309 				}
 101310 			} else {
 101311 				*(*int32)(unsafe.Pointer(bp + 8)) = resolveAsName(tls, pParse, pEList, pE)
 101312 				if *(*int32)(unsafe.Pointer(bp + 8)) == 0 {
 101313 					pDup = Xsqlite3ExprDup(tls, db, pE, 0)
 101314 					if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
 101315 						*(*int32)(unsafe.Pointer(bp + 8)) = resolveOrderByTermToExprList(tls, pParse, pSelect, pDup)
 101316 						if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME && *(*int32)(unsafe.Pointer(bp + 8)) > 0 {
 101317 							resolveOrderByTermToExprList(tls, pParse, pSelect, pE)
 101318 						}
 101319 					}
 101320 					Xsqlite3ExprDelete(tls, db, pDup)
 101321 				}
 101322 			}
 101323 			if *(*int32)(unsafe.Pointer(bp + 8)) > 0 {
 101324 				if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 101325 					var pNew uintptr = Xsqlite3Expr(tls, db, TK_INTEGER, uintptr(0))
 101326 					if pNew == uintptr(0) {
 101327 						return 1
 101328 					}
 101329 					*(*U32)(unsafe.Pointer(pNew + 4)) |= U32(EP_IntValue)
 101330 					*(*int32)(unsafe.Pointer(pNew + 8)) = *(*int32)(unsafe.Pointer(bp + 8))
 101331 					if (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr == pE {
 101332 						(*ExprList_item)(unsafe.Pointer(pItem)).FpExpr = pNew
 101333 					} else {
 101334 						var pParent uintptr = (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr
 101335 
 101336 						for int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pParent)).FpLeft)).Fop) == TK_COLLATE {
 101337 							pParent = (*Expr)(unsafe.Pointer(pParent)).FpLeft
 101338 						}
 101339 
 101340 						(*Expr)(unsafe.Pointer(pParent)).FpLeft = pNew
 101341 					}
 101342 					Xsqlite3ExprDelete(tls, db, pE)
 101343 					*(*U16)(unsafe.Pointer(pItem + 24)) = U16(*(*int32)(unsafe.Pointer(bp + 8)))
 101344 				}
 101345 				libc.SetBitFieldPtr16Uint32(pItem+16+4, uint32(1), 2, 0x4)
 101346 			} else {
 101347 				moreToDo = 1
 101348 			}
 101349 
 101350 		}
 101351 		goto __2
 101352 	__2:
 101353 		i++
 101354 		pItem += 32
 101355 		goto __1
 101356 		goto __3
 101357 	__3:
 101358 		;
 101359 		pSelect = (*Select)(unsafe.Pointer(pSelect)).FpNext
 101360 	}
 101361 	for i = 0; i < (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr; i++ {
 101362 		if int32(*(*uint16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32 + 16 + 4))&0x4>>2) == 0 {
 101363 			Xsqlite3ErrorMsg(tls, pParse,
 101364 				ts+8581, libc.VaList(bp, i+1))
 101365 			return 1
 101366 		}
 101367 	}
 101368 	return 0
 101369 }
 101370 
 101371 // Check every term in the ORDER BY or GROUP BY clause pOrderBy of
 101372 // the SELECT statement pSelect.  If any term is reference to a
 101373 // result set expression (as determined by the ExprList.a.u.x.iOrderByCol
 101374 // field) then convert that term into a copy of the corresponding result set
 101375 // column.
 101376 //
 101377 // If any errors are detected, add an error message to pParse and
 101378 // return non-zero.  Return zero if no errors are seen.
 101379 func Xsqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, pOrderBy uintptr, zType uintptr) int32 {
 101380 	bp := tls.Alloc(8)
 101381 	defer tls.Free(8)
 101382 
 101383 	var i int32
 101384 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 101385 	var pEList uintptr
 101386 	var pItem uintptr
 101387 
 101388 	if pOrderBy == uintptr(0) || (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 || int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
 101389 		return 0
 101390 	}
 101391 	if (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) {
 101392 		Xsqlite3ErrorMsg(tls, pParse, ts+8642, libc.VaList(bp, zType))
 101393 		return 1
 101394 	}
 101395 	pEList = (*Select)(unsafe.Pointer(pSelect)).FpEList
 101396 
 101397 	i = 0
 101398 	pItem = pOrderBy + 8
 101399 __1:
 101400 	if !(i < (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr) {
 101401 		goto __3
 101402 	}
 101403 	{
 101404 		if *(*U16)(unsafe.Pointer(pItem + 24)) != 0 {
 101405 			if int32(*(*U16)(unsafe.Pointer(pItem + 24))) > (*ExprList)(unsafe.Pointer(pEList)).FnExpr {
 101406 				resolveOutOfRangeError(tls, pParse, zType, i+1, (*ExprList)(unsafe.Pointer(pEList)).FnExpr, uintptr(0))
 101407 				return 1
 101408 			}
 101409 			resolveAlias(tls, pParse, pEList, int32(*(*U16)(unsafe.Pointer(pItem + 24)))-1, (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr, 0)
 101410 		}
 101411 
 101412 	}
 101413 	goto __2
 101414 __2:
 101415 	i++
 101416 	pItem += 32
 101417 	goto __1
 101418 	goto __3
 101419 __3:
 101420 	;
 101421 	return 0
 101422 }
 101423 
 101424 func resolveRemoveWindowsCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 101425 	_ = pWalker
 101426 	if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0) {
 101427 		var pWin uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 64))
 101428 		Xsqlite3WindowUnlinkFromSelect(tls, pWin)
 101429 	}
 101430 	return WRC_Continue
 101431 }
 101432 
 101433 func windowRemoveExprFromSelect(tls *libc.TLS, pSelect uintptr, pExpr uintptr) {
 101434 	bp := tls.Alloc(48)
 101435 	defer tls.Free(48)
 101436 
 101437 	if (*Select)(unsafe.Pointer(pSelect)).FpWin != 0 {
 101438 		libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Walker{})))
 101439 		(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 101440 			f func(*libc.TLS, uintptr, uintptr) int32
 101441 		}{resolveRemoveWindowsCb}))
 101442 		*(*uintptr)(unsafe.Pointer(bp + 40)) = pSelect
 101443 		Xsqlite3WalkExpr(tls, bp, pExpr)
 101444 	}
 101445 }
 101446 
 101447 func resolveOrderGroupBy(tls *libc.TLS, pNC uintptr, pSelect uintptr, pOrderBy uintptr, zType uintptr) int32 {
 101448 	bp := tls.Alloc(4)
 101449 	defer tls.Free(4)
 101450 
 101451 	var i int32
 101452 	var j int32
 101453 
 101454 	var pItem uintptr
 101455 	var pParse uintptr
 101456 	var nResult int32
 101457 
 101458 	nResult = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpEList)).FnExpr
 101459 	pParse = (*NameContext)(unsafe.Pointer(pNC)).FpParse
 101460 	i = 0
 101461 	pItem = pOrderBy + 8
 101462 __1:
 101463 	if !(i < (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr) {
 101464 		goto __3
 101465 	}
 101466 	{
 101467 		var pE uintptr = (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr
 101468 		var pE2 uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, pE)
 101469 		if pE2 == uintptr(0) {
 101470 			goto __2
 101471 		}
 101472 		if int32(*(*int8)(unsafe.Pointer(zType))) != 'G' {
 101473 			*(*int32)(unsafe.Pointer(bp)) = resolveAsName(tls, pParse, (*Select)(unsafe.Pointer(pSelect)).FpEList, pE2)
 101474 			if *(*int32)(unsafe.Pointer(bp)) > 0 {
 101475 				*(*U16)(unsafe.Pointer(pItem + 24)) = U16(*(*int32)(unsafe.Pointer(bp)))
 101476 				goto __2
 101477 			}
 101478 		}
 101479 		if Xsqlite3ExprIsInteger(tls, pE2, bp) != 0 {
 101480 			if *(*int32)(unsafe.Pointer(bp)) < 1 || *(*int32)(unsafe.Pointer(bp)) > 0xffff {
 101481 				resolveOutOfRangeError(tls, pParse, zType, i+1, nResult, pE2)
 101482 				return 1
 101483 			}
 101484 			*(*U16)(unsafe.Pointer(pItem + 24)) = U16(*(*int32)(unsafe.Pointer(bp)))
 101485 			goto __2
 101486 		}
 101487 
 101488 		*(*U16)(unsafe.Pointer(pItem + 24)) = U16(0)
 101489 		if Xsqlite3ResolveExprNames(tls, pNC, pE) != 0 {
 101490 			return 1
 101491 		}
 101492 		for j = 0; j < (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpEList)).FnExpr; j++ {
 101493 			if Xsqlite3ExprCompare(tls, uintptr(0), pE, (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpEList+8+uintptr(j)*32)).FpExpr, -1) == 0 {
 101494 				windowRemoveExprFromSelect(tls, pSelect, pE)
 101495 				*(*U16)(unsafe.Pointer(pItem + 24)) = U16(j + 1)
 101496 			}
 101497 		}
 101498 
 101499 	}
 101500 	goto __2
 101501 __2:
 101502 	i++
 101503 	pItem += 32
 101504 	goto __1
 101505 	goto __3
 101506 __3:
 101507 	;
 101508 	return Xsqlite3ResolveOrderGroupBy(tls, pParse, pSelect, pOrderBy, zType)
 101509 }
 101510 
 101511 func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 {
 101512 	bp := tls.Alloc(56)
 101513 	defer tls.Free(56)
 101514 
 101515 	var pOuterNC uintptr
 101516 
 101517 	var isCompound int32
 101518 	var nCompound int32
 101519 	var pParse uintptr
 101520 	var i int32
 101521 	var pGroupBy uintptr
 101522 	var pLeftmost uintptr
 101523 	var db uintptr
 101524 
 101525 	if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Resolved) != 0 {
 101526 		return WRC_Prune
 101527 	}
 101528 	pOuterNC = *(*uintptr)(unsafe.Pointer(pWalker + 40))
 101529 	pParse = (*Walker)(unsafe.Pointer(pWalker)).FpParse
 101530 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 101531 
 101532 	if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Expanded) == U32(0) {
 101533 		Xsqlite3SelectPrep(tls, pParse, p, pOuterNC)
 101534 		if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 101535 			return WRC_Abort
 101536 		}
 101537 		return WRC_Prune
 101538 	}
 101539 
 101540 	isCompound = libc.Bool32((*Select)(unsafe.Pointer(p)).FpPrior != uintptr(0))
 101541 	nCompound = 0
 101542 	pLeftmost = p
 101543 	for p != 0 {
 101544 		*(*U32)(unsafe.Pointer(p + 4)) |= U32(SF_Resolved)
 101545 
 101546 		libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(NameContext{})))
 101547 		(*NameContext)(unsafe.Pointer(bp)).FpParse = pParse
 101548 		(*NameContext)(unsafe.Pointer(bp)).FpWinSelect = p
 101549 		if Xsqlite3ResolveExprNames(tls, bp, (*Select)(unsafe.Pointer(p)).FpLimit) != 0 {
 101550 			return WRC_Abort
 101551 		}
 101552 
 101553 		if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Converted) != 0 {
 101554 			var pSub uintptr = (*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc + 8)).FpSelect
 101555 
 101556 			(*Select)(unsafe.Pointer(pSub)).FpOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy
 101557 			(*Select)(unsafe.Pointer(p)).FpOrderBy = uintptr(0)
 101558 		}
 101559 
 101560 		for i = 0; i < (*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc)).FnSrc; i++ {
 101561 			var pItem uintptr = (*Select)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*104
 101562 			if (*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0 && (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FselFlags&U32(SF_Resolved) == U32(0) {
 101563 				var nRef int32
 101564 				if pOuterNC != 0 {
 101565 					nRef = (*NameContext)(unsafe.Pointer(pOuterNC)).FnRef
 101566 				} else {
 101567 					nRef = 0
 101568 				}
 101569 				var zSavedContext uintptr = (*Parse)(unsafe.Pointer(pParse)).FzAuthContext
 101570 
 101571 				if (*SrcItem)(unsafe.Pointer(pItem)).FzName != 0 {
 101572 					(*Parse)(unsafe.Pointer(pParse)).FzAuthContext = (*SrcItem)(unsafe.Pointer(pItem)).FzName
 101573 				}
 101574 				Xsqlite3ResolveSelectNames(tls, pParse, (*SrcItem)(unsafe.Pointer(pItem)).FpSelect, pOuterNC)
 101575 				(*Parse)(unsafe.Pointer(pParse)).FzAuthContext = zSavedContext
 101576 				if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 101577 					return WRC_Abort
 101578 				}
 101579 
 101580 				if pOuterNC != 0 {
 101581 					libc.SetBitFieldPtr16Uint32(pItem+60+4, uint32(libc.Bool32((*NameContext)(unsafe.Pointer(pOuterNC)).FnRef > nRef)), 3, 0x8)
 101582 				}
 101583 			}
 101584 		}
 101585 
 101586 		(*NameContext)(unsafe.Pointer(bp)).FncFlags = NC_AllowAgg | NC_AllowWin
 101587 		(*NameContext)(unsafe.Pointer(bp)).FpSrcList = (*Select)(unsafe.Pointer(p)).FpSrc
 101588 		(*NameContext)(unsafe.Pointer(bp)).FpNext = pOuterNC
 101589 
 101590 		if Xsqlite3ResolveExprListNames(tls, bp, (*Select)(unsafe.Pointer(p)).FpEList) != 0 {
 101591 			return WRC_Abort
 101592 		}
 101593 		*(*int32)(unsafe.Pointer(bp + 40)) &= libc.CplInt32(NC_AllowWin)
 101594 
 101595 		pGroupBy = (*Select)(unsafe.Pointer(p)).FpGroupBy
 101596 		if pGroupBy != 0 || (*NameContext)(unsafe.Pointer(bp)).FncFlags&NC_HasAgg != 0 {
 101597 			*(*U32)(unsafe.Pointer(p + 4)) |= U32(SF_Aggregate | (*NameContext)(unsafe.Pointer(bp)).FncFlags&(NC_MinMaxAgg|NC_OrderAgg))
 101598 		} else {
 101599 			*(*int32)(unsafe.Pointer(bp + 40)) &= libc.CplInt32(NC_AllowAgg)
 101600 		}
 101601 
 101602 		*(*uintptr)(unsafe.Pointer(bp + 16)) = (*Select)(unsafe.Pointer(p)).FpEList
 101603 		*(*int32)(unsafe.Pointer(bp + 40)) |= NC_UEList
 101604 		if (*Select)(unsafe.Pointer(p)).FpHaving != 0 {
 101605 			if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Aggregate) == U32(0) {
 101606 				Xsqlite3ErrorMsg(tls, pParse, ts+8673, 0)
 101607 				return WRC_Abort
 101608 			}
 101609 			if Xsqlite3ResolveExprNames(tls, bp, (*Select)(unsafe.Pointer(p)).FpHaving) != 0 {
 101610 				return WRC_Abort
 101611 			}
 101612 		}
 101613 		if Xsqlite3ResolveExprNames(tls, bp, (*Select)(unsafe.Pointer(p)).FpWhere) != 0 {
 101614 			return WRC_Abort
 101615 		}
 101616 
 101617 		for i = 0; i < (*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc)).FnSrc; i++ {
 101618 			var pItem uintptr = (*Select)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*104
 101619 			if uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x4>>2)) != 0 &&
 101620 				Xsqlite3ResolveExprListNames(tls, bp, *(*uintptr)(unsafe.Pointer(pItem + 88))) != 0 {
 101621 				return WRC_Abort
 101622 			}
 101623 		}
 101624 
 101625 		if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
 101626 			var pWin uintptr
 101627 			for pWin = (*Select)(unsafe.Pointer(p)).FpWinDefn; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin {
 101628 				if Xsqlite3ResolveExprListNames(tls, bp, (*Window)(unsafe.Pointer(pWin)).FpOrderBy) != 0 ||
 101629 					Xsqlite3ResolveExprListNames(tls, bp, (*Window)(unsafe.Pointer(pWin)).FpPartition) != 0 {
 101630 					return WRC_Abort
 101631 				}
 101632 			}
 101633 		}
 101634 
 101635 		(*NameContext)(unsafe.Pointer(bp)).FpNext = uintptr(0)
 101636 		*(*int32)(unsafe.Pointer(bp + 40)) |= NC_AllowAgg | NC_AllowWin
 101637 
 101638 		if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Converted) != 0 {
 101639 			var pSub uintptr = (*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc + 8)).FpSelect
 101640 			(*Select)(unsafe.Pointer(p)).FpOrderBy = (*Select)(unsafe.Pointer(pSub)).FpOrderBy
 101641 			(*Select)(unsafe.Pointer(pSub)).FpOrderBy = uintptr(0)
 101642 		}
 101643 
 101644 		if (*Select)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) &&
 101645 			isCompound <= nCompound &&
 101646 			resolveOrderGroupBy(tls, bp, p, (*Select)(unsafe.Pointer(p)).FpOrderBy, ts+8575) != 0 {
 101647 			return WRC_Abort
 101648 		}
 101649 		if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 101650 			return WRC_Abort
 101651 		}
 101652 		*(*int32)(unsafe.Pointer(bp + 40)) &= libc.CplInt32(NC_AllowWin)
 101653 
 101654 		if pGroupBy != 0 {
 101655 			var pItem uintptr
 101656 
 101657 			if resolveOrderGroupBy(tls, bp, p, pGroupBy, ts+8712) != 0 || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 101658 				return WRC_Abort
 101659 			}
 101660 			i = 0
 101661 			pItem = pGroupBy + 8
 101662 		__1:
 101663 			if !(i < (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr) {
 101664 				goto __3
 101665 			}
 101666 			{
 101667 				if (*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(pItem)).FpExpr)).Fflags&U32(EP_Agg) != U32(0) {
 101668 					Xsqlite3ErrorMsg(tls, pParse,
 101669 						ts+8718, 0)
 101670 					return WRC_Abort
 101671 				}
 101672 
 101673 			}
 101674 			goto __2
 101675 		__2:
 101676 			i++
 101677 			pItem += 32
 101678 			goto __1
 101679 			goto __3
 101680 		__3:
 101681 		}
 101682 
 101683 		if (*Select)(unsafe.Pointer(p)).FpNext != 0 && (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr != (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpNext)).FpEList)).FnExpr {
 101684 			Xsqlite3SelectWrongNumTermsError(tls, pParse, (*Select)(unsafe.Pointer(p)).FpNext)
 101685 			return WRC_Abort
 101686 		}
 101687 
 101688 		p = (*Select)(unsafe.Pointer(p)).FpPrior
 101689 		nCompound++
 101690 	}
 101691 
 101692 	if isCompound != 0 && resolveCompoundOrderBy(tls, pParse, pLeftmost) != 0 {
 101693 		return WRC_Abort
 101694 	}
 101695 
 101696 	return WRC_Prune
 101697 }
 101698 
 101699 // This routine walks an expression tree and resolves references to
 101700 // table columns and result-set columns.  At the same time, do error
 101701 // checking on function usage and set a flag if any aggregate functions
 101702 // are seen.
 101703 //
 101704 // To resolve table columns references we look for nodes (or subtrees) of the
 101705 // form X.Y.Z or Y.Z or just Z where
 101706 //
 101707 //	X:   The name of a database.  Ex:  "main" or "temp" or
 101708 //	     the symbolic name assigned to an ATTACH-ed database.
 101709 //
 101710 //	Y:   The name of a table in a FROM clause.  Or in a trigger
 101711 //	     one of the special names "old" or "new".
 101712 //
 101713 //	Z:   The name of a column in table Y.
 101714 //
 101715 // The node at the root of the subtree is modified as follows:
 101716 //
 101717 //	Expr.op        Changed to TK_COLUMN
 101718 //	Expr.pTab      Points to the Table object for X.Y
 101719 //	Expr.iColumn   The column index in X.Y.  -1 for the rowid.
 101720 //	Expr.iTable    The VDBE cursor number for X.Y
 101721 //
 101722 // To resolve result-set references, look for expression nodes of the
 101723 // form Z (with no X and Y prefix) where the Z matches the right-hand
 101724 // size of an AS clause in the result-set of a SELECT.  The Z expression
 101725 // is replaced by a copy of the left-hand side of the result-set expression.
 101726 // Table-name and function resolution occurs on the substituted expression
 101727 // tree.  For example, in:
 101728 //
 101729 //	SELECT a+b AS x, c+d AS y FROM t1 ORDER BY x;
 101730 //
 101731 // The "x" term of the order by is replaced by "a+b" to render:
 101732 //
 101733 //	SELECT a+b AS x, c+d AS y FROM t1 ORDER BY a+b;
 101734 //
 101735 // Function calls are checked to make sure that the function is
 101736 // defined and that the correct number of arguments are specified.
 101737 // If the function is an aggregate function, then the NC_HasAgg flag is
 101738 // set and the opcode is changed from TK_FUNCTION to TK_AGG_FUNCTION.
 101739 // If an expression contains aggregate functions then the EP_Agg
 101740 // property on the expression is set.
 101741 //
 101742 // An error message is left in pParse if anything is amiss.  The number
 101743 // if errors is returned.
 101744 func Xsqlite3ResolveExprNames(tls *libc.TLS, pNC uintptr, pExpr uintptr) int32 {
 101745 	bp := tls.Alloc(48)
 101746 	defer tls.Free(48)
 101747 
 101748 	var savedHasAgg int32
 101749 
 101750 	if pExpr == uintptr(0) {
 101751 		return SQLITE_OK
 101752 	}
 101753 	savedHasAgg = (*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_HasAgg | NC_MinMaxAgg | NC_HasWin | NC_OrderAgg)
 101754 	*(*int32)(unsafe.Pointer(pNC + 40)) &= libc.CplInt32(NC_HasAgg | NC_MinMaxAgg | NC_HasWin | NC_OrderAgg)
 101755 	(*Walker)(unsafe.Pointer(bp)).FpParse = (*NameContext)(unsafe.Pointer(pNC)).FpParse
 101756 	(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 101757 		f func(*libc.TLS, uintptr, uintptr) int32
 101758 	}{resolveExprStep}))
 101759 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback = func() uintptr {
 101760 		if (*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_NoSelect != 0 {
 101761 			return uintptr(0)
 101762 		}
 101763 		return *(*uintptr)(unsafe.Pointer(&struct {
 101764 			f func(*libc.TLS, uintptr, uintptr) int32
 101765 		}{resolveSelectStep}))
 101766 	}()
 101767 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback2 = uintptr(0)
 101768 	*(*uintptr)(unsafe.Pointer(bp + 40)) = pNC
 101769 	*(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp)).FpParse + 316)) += (*Expr)(unsafe.Pointer(pExpr)).FnHeight
 101770 	if Xsqlite3ExprCheckHeight(tls, (*Walker)(unsafe.Pointer(bp)).FpParse, (*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp)).FpParse)).FnHeight) != 0 {
 101771 		return SQLITE_ERROR
 101772 	}
 101773 	Xsqlite3WalkExpr(tls, bp, pExpr)
 101774 	*(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp)).FpParse + 316)) -= (*Expr)(unsafe.Pointer(pExpr)).FnHeight
 101775 
 101776 	*(*U32)(unsafe.Pointer(pExpr + 4)) |= U32((*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_HasAgg | NC_HasWin))
 101777 	*(*int32)(unsafe.Pointer(pNC + 40)) |= savedHasAgg
 101778 	return libc.Bool32((*NameContext)(unsafe.Pointer(pNC)).FnNcErr > 0 || (*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp)).FpParse)).FnErr > 0)
 101779 }
 101780 
 101781 // Resolve all names for all expression in an expression list.  This is
 101782 // just like sqlite3ResolveExprNames() except that it works for an expression
 101783 // list rather than a single expression.
 101784 func Xsqlite3ResolveExprListNames(tls *libc.TLS, pNC uintptr, pList uintptr) int32 {
 101785 	bp := tls.Alloc(48)
 101786 	defer tls.Free(48)
 101787 
 101788 	var i int32
 101789 	var savedHasAgg int32 = 0
 101790 
 101791 	if pList == uintptr(0) {
 101792 		return WRC_Continue
 101793 	}
 101794 	(*Walker)(unsafe.Pointer(bp)).FpParse = (*NameContext)(unsafe.Pointer(pNC)).FpParse
 101795 	(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 101796 		f func(*libc.TLS, uintptr, uintptr) int32
 101797 	}{resolveExprStep}))
 101798 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
 101799 		f func(*libc.TLS, uintptr, uintptr) int32
 101800 	}{resolveSelectStep}))
 101801 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback2 = uintptr(0)
 101802 	*(*uintptr)(unsafe.Pointer(bp + 40)) = pNC
 101803 	savedHasAgg = (*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_HasAgg | NC_MinMaxAgg | NC_HasWin | NC_OrderAgg)
 101804 	*(*int32)(unsafe.Pointer(pNC + 40)) &= libc.CplInt32(NC_HasAgg | NC_MinMaxAgg | NC_HasWin | NC_OrderAgg)
 101805 	for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ {
 101806 		var pExpr uintptr = (*ExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32)).FpExpr
 101807 		if pExpr == uintptr(0) {
 101808 			continue
 101809 		}
 101810 		*(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp)).FpParse + 316)) += (*Expr)(unsafe.Pointer(pExpr)).FnHeight
 101811 		if Xsqlite3ExprCheckHeight(tls, (*Walker)(unsafe.Pointer(bp)).FpParse, (*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp)).FpParse)).FnHeight) != 0 {
 101812 			return WRC_Abort
 101813 		}
 101814 		Xsqlite3WalkExpr(tls, bp, pExpr)
 101815 		*(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp)).FpParse + 316)) -= (*Expr)(unsafe.Pointer(pExpr)).FnHeight
 101816 
 101817 		if (*NameContext)(unsafe.Pointer(pNC)).FncFlags&(NC_HasAgg|NC_MinMaxAgg|NC_HasWin|NC_OrderAgg) != 0 {
 101818 			*(*U32)(unsafe.Pointer(pExpr + 4)) |= U32((*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_HasAgg | NC_HasWin))
 101819 			savedHasAgg = savedHasAgg | (*NameContext)(unsafe.Pointer(pNC)).FncFlags&(NC_HasAgg|NC_MinMaxAgg|NC_HasWin|NC_OrderAgg)
 101820 			*(*int32)(unsafe.Pointer(pNC + 40)) &= libc.CplInt32(NC_HasAgg | NC_MinMaxAgg | NC_HasWin | NC_OrderAgg)
 101821 		}
 101822 		if (*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp)).FpParse)).FnErr > 0 {
 101823 			return WRC_Abort
 101824 		}
 101825 	}
 101826 	*(*int32)(unsafe.Pointer(pNC + 40)) |= savedHasAgg
 101827 	return WRC_Continue
 101828 }
 101829 
 101830 // Resolve all names in all expressions of a SELECT and in all
 101831 // decendents of the SELECT, including compounds off of p->pPrior,
 101832 // subqueries in expressions, and subqueries used as FROM clause
 101833 // terms.
 101834 //
 101835 // See sqlite3ResolveExprNames() for a description of the kinds of
 101836 // transformations that occur.
 101837 //
 101838 // All SELECT statements should have been expanded using
 101839 // sqlite3SelectExpand() prior to invoking this routine.
 101840 func Xsqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintptr) {
 101841 	bp := tls.Alloc(48)
 101842 	defer tls.Free(48)
 101843 
 101844 	(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 101845 		f func(*libc.TLS, uintptr, uintptr) int32
 101846 	}{resolveExprStep}))
 101847 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
 101848 		f func(*libc.TLS, uintptr, uintptr) int32
 101849 	}{resolveSelectStep}))
 101850 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback2 = uintptr(0)
 101851 	(*Walker)(unsafe.Pointer(bp)).FpParse = pParse
 101852 	*(*uintptr)(unsafe.Pointer(bp + 40)) = pOuterNC
 101853 	Xsqlite3WalkSelect(tls, bp, p)
 101854 }
 101855 
 101856 // Resolve names in expressions that can only reference a single table
 101857 // or which cannot reference any tables at all.  Examples:
 101858 //
 101859 //	                                                "type" flag
 101860 //	                                                ------------
 101861 //	(1)   CHECK constraints                         NC_IsCheck
 101862 //	(2)   WHERE clauses on partial indices          NC_PartIdx
 101863 //	(3)   Expressions in indexes on expressions     NC_IdxExpr
 101864 //	(4)   Expression arguments to VACUUM INTO.      0
 101865 //	(5)   GENERATED ALWAYS as expressions           NC_GenCol
 101866 //
 101867 // In all cases except (4), the Expr.iTable value for Expr.op==TK_COLUMN
 101868 // nodes of the expression is set to -1 and the Expr.iColumn value is
 101869 // set to the column number.  In case (4), TK_COLUMN nodes cause an error.
 101870 //
 101871 // Any errors cause an error message to be set in pParse.
 101872 func Xsqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) int32 {
 101873 	bp := tls.Alloc(168)
 101874 	defer tls.Free(168)
 101875 
 101876 	var rc int32
 101877 
 101878 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(NameContext{})))
 101879 	libc.Xmemset(tls, bp+56, 0, uint64(unsafe.Sizeof(SrcList{})))
 101880 	if pTab != 0 {
 101881 		(*SrcList)(unsafe.Pointer(bp + 56)).FnSrc = 1
 101882 		(*SrcItem)(unsafe.Pointer(bp + 56 + 8)).FzName = (*Table)(unsafe.Pointer(pTab)).FzName
 101883 		(*SrcItem)(unsafe.Pointer(bp + 56 + 8)).FpTab = pTab
 101884 		(*SrcItem)(unsafe.Pointer(bp + 56 + 8)).FiCursor = -1
 101885 		if (*Table)(unsafe.Pointer(pTab)).FpSchema != (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb+1*32)).FpSchema {
 101886 			type1 = type1 | NC_FromDDL
 101887 		}
 101888 	}
 101889 	(*NameContext)(unsafe.Pointer(bp)).FpParse = pParse
 101890 	(*NameContext)(unsafe.Pointer(bp)).FpSrcList = bp + 56
 101891 	(*NameContext)(unsafe.Pointer(bp)).FncFlags = type1 | NC_IsDDL
 101892 	if libc.AssignInt32(&rc, Xsqlite3ResolveExprNames(tls, bp, pExpr)) != SQLITE_OK {
 101893 		return rc
 101894 	}
 101895 	if pList != 0 {
 101896 		rc = Xsqlite3ResolveExprListNames(tls, bp, pList)
 101897 	}
 101898 	return rc
 101899 }
 101900 
 101901 // Return the affinity character for a single column of a table.
 101902 func Xsqlite3TableColumnAffinity(tls *libc.TLS, pTab uintptr, iCol int32) int8 {
 101903 	if iCol < 0 || iCol >= int32((*Table)(unsafe.Pointer(pTab)).FnCol) {
 101904 		return int8(SQLITE_AFF_INTEGER)
 101905 	}
 101906 	return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*24)).Faffinity
 101907 }
 101908 
 101909 // Return the 'affinity' of the expression pExpr if any.
 101910 //
 101911 // If pExpr is a column, a reference to a column via an 'AS' alias,
 101912 // or a sub-select with a column as the return value, then the
 101913 // affinity of that column is returned. Otherwise, 0x00 is returned,
 101914 // indicating no affinity for the expression.
 101915 //
 101916 // i.e. the WHERE clause expressions in the following statements all
 101917 // have an affinity:
 101918 //
 101919 // CREATE TABLE t1(a);
 101920 // SELECT * FROM t1 WHERE a;
 101921 // SELECT a AS b FROM t1 WHERE b;
 101922 // SELECT * FROM t1 WHERE (select a from t1);
 101923 func Xsqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) int8 {
 101924 	var op int32
 101925 	op = int32((*Expr)(unsafe.Pointer(pExpr)).Fop)
 101926 	for 1 != 0 {
 101927 		if op == TK_COLUMN || op == TK_AGG_COLUMN && *(*uintptr)(unsafe.Pointer(pExpr + 64)) != uintptr(0) {
 101928 			return Xsqlite3TableColumnAffinity(tls, *(*uintptr)(unsafe.Pointer(pExpr + 64)), int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn))
 101929 		}
 101930 		if op == TK_SELECT {
 101931 			return Xsqlite3ExprAffinity(tls, (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FpEList+8)).FpExpr)
 101932 		}
 101933 		if op == TK_CAST {
 101934 			return Xsqlite3AffinityType(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), uintptr(0))
 101935 		}
 101936 		if op == TK_SELECT_COLUMN {
 101937 			return Xsqlite3ExprAffinity(tls,
 101938 				(*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft + 32)))).FpEList+8+uintptr((*Expr)(unsafe.Pointer(pExpr)).FiColumn)*32)).FpExpr)
 101939 		}
 101940 		if op == TK_VECTOR {
 101941 			return Xsqlite3ExprAffinity(tls, (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32))+8)).FpExpr)
 101942 		}
 101943 		if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Skip|EP_IfNullRow) != U32(0) {
 101944 			pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
 101945 			op = int32((*Expr)(unsafe.Pointer(pExpr)).Fop)
 101946 			continue
 101947 		}
 101948 		if op != TK_REGISTER || libc.AssignInt32(&op, int32((*Expr)(unsafe.Pointer(pExpr)).Fop2)) == TK_REGISTER {
 101949 			break
 101950 		}
 101951 	}
 101952 	return (*Expr)(unsafe.Pointer(pExpr)).FaffExpr
 101953 }
 101954 
 101955 // Make a guess at all the possible datatypes of the result that could
 101956 // be returned by an expression.  Return a bitmask indicating the answer:
 101957 //
 101958 //	0x01         Numeric
 101959 //	0x02         Text
 101960 //	0x04         Blob
 101961 //
 101962 // If the expression must return NULL, then 0x00 is returned.
 101963 func Xsqlite3ExprDataType(tls *libc.TLS, pExpr uintptr) int32 {
 101964 	for pExpr != 0 {
 101965 		switch int32((*Expr)(unsafe.Pointer(pExpr)).Fop) {
 101966 		case TK_COLLATE:
 101967 			fallthrough
 101968 		case TK_IF_NULL_ROW:
 101969 			fallthrough
 101970 		case TK_UPLUS:
 101971 			{
 101972 				pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
 101973 				break
 101974 
 101975 			}
 101976 		case TK_NULL:
 101977 			{
 101978 				pExpr = uintptr(0)
 101979 				break
 101980 
 101981 			}
 101982 		case TK_STRING:
 101983 			{
 101984 				return 0x02
 101985 
 101986 			}
 101987 		case TK_BLOB:
 101988 			{
 101989 				return 0x04
 101990 
 101991 			}
 101992 		case TK_CONCAT:
 101993 			{
 101994 				return 0x06
 101995 
 101996 			}
 101997 		case TK_VARIABLE:
 101998 			fallthrough
 101999 		case TK_AGG_FUNCTION:
 102000 			fallthrough
 102001 		case TK_FUNCTION:
 102002 			{
 102003 				return 0x07
 102004 
 102005 			}
 102006 		case TK_COLUMN:
 102007 			fallthrough
 102008 		case TK_AGG_COLUMN:
 102009 			fallthrough
 102010 		case TK_SELECT:
 102011 			fallthrough
 102012 		case TK_CAST:
 102013 			fallthrough
 102014 		case TK_SELECT_COLUMN:
 102015 			fallthrough
 102016 		case TK_VECTOR:
 102017 			{
 102018 				var aff int32 = int32(Xsqlite3ExprAffinity(tls, pExpr))
 102019 				if aff >= SQLITE_AFF_NUMERIC {
 102020 					return 0x05
 102021 				}
 102022 				if aff == SQLITE_AFF_TEXT {
 102023 					return 0x06
 102024 				}
 102025 				return 0x07
 102026 
 102027 			}
 102028 		case TK_CASE:
 102029 			{
 102030 				var res int32 = 0
 102031 				var ii int32
 102032 				var pList uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 32))
 102033 
 102034 				for ii = 1; ii < (*ExprList)(unsafe.Pointer(pList)).FnExpr; ii = ii + 2 {
 102035 					res = res | Xsqlite3ExprDataType(tls, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(ii)*32)).FpExpr)
 102036 				}
 102037 				if (*ExprList)(unsafe.Pointer(pList)).FnExpr%2 != 0 {
 102038 					res = res | Xsqlite3ExprDataType(tls, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr((*ExprList)(unsafe.Pointer(pList)).FnExpr-1)*32)).FpExpr)
 102039 				}
 102040 				return res
 102041 
 102042 			}
 102043 		default:
 102044 			{
 102045 				return 0x01
 102046 
 102047 			}
 102048 		}
 102049 	}
 102050 	return 0x00
 102051 }
 102052 
 102053 // Set the collating sequence for expression pExpr to be the collating
 102054 // sequence named by pToken.   Return a pointer to a new Expr node that
 102055 // implements the COLLATE operator.
 102056 //
 102057 // If a memory allocation error occurs, that fact is recorded in pParse->db
 102058 // and the pExpr parameter is returned unchanged.
 102059 func Xsqlite3ExprAddCollateToken(tls *libc.TLS, pParse uintptr, pExpr uintptr, pCollName uintptr, dequote int32) uintptr {
 102060 	if (*Token)(unsafe.Pointer(pCollName)).Fn > uint32(0) {
 102061 		var pNew uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_COLLATE, pCollName, dequote)
 102062 		if pNew != 0 {
 102063 			(*Expr)(unsafe.Pointer(pNew)).FpLeft = pExpr
 102064 			*(*U32)(unsafe.Pointer(pNew + 4)) |= U32(EP_Collate | EP_Skip)
 102065 			pExpr = pNew
 102066 		}
 102067 	}
 102068 	return pExpr
 102069 }
 102070 
 102071 func Xsqlite3ExprAddCollateString(tls *libc.TLS, pParse uintptr, pExpr uintptr, zC uintptr) uintptr {
 102072 	bp := tls.Alloc(16)
 102073 	defer tls.Free(16)
 102074 
 102075 	Xsqlite3TokenInit(tls, bp, zC)
 102076 	return Xsqlite3ExprAddCollateToken(tls, pParse, pExpr, bp, 0)
 102077 }
 102078 
 102079 // Skip over any TK_COLLATE operators.
 102080 func Xsqlite3ExprSkipCollate(tls *libc.TLS, pExpr uintptr) uintptr {
 102081 	for pExpr != 0 && (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Skip) != U32(0) {
 102082 		pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
 102083 	}
 102084 	return pExpr
 102085 }
 102086 
 102087 // Skip over any TK_COLLATE operators and/or any unlikely()
 102088 // or likelihood() or likely() functions at the root of an
 102089 // expression.
 102090 func Xsqlite3ExprSkipCollateAndLikely(tls *libc.TLS, pExpr uintptr) uintptr {
 102091 	for pExpr != 0 && (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Skip|EP_Unlikely) != U32(0) {
 102092 		if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Unlikely) != U32(0) {
 102093 			pExpr = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8)).FpExpr
 102094 		} else {
 102095 			pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
 102096 		}
 102097 	}
 102098 	return pExpr
 102099 }
 102100 
 102101 // Return the collation sequence for the expression pExpr. If
 102102 // there is no defined collating sequence, return NULL.
 102103 //
 102104 // See also: sqlite3ExprNNCollSeq()
 102105 //
 102106 // The sqlite3ExprNNCollSeq() works the same exact that it returns the
 102107 // default collation if pExpr has no defined collation.
 102108 //
 102109 // The collating sequence might be determined by a COLLATE operator
 102110 // or by the presence of a column with a defined collating sequence.
 102111 // COLLATE operators take first precedence.  Left operands take
 102112 // precedence over right operands.
 102113 func Xsqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr {
 102114 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 102115 	var pColl uintptr = uintptr(0)
 102116 	var p uintptr = pExpr
 102117 	for p != 0 {
 102118 		var op int32 = int32((*Expr)(unsafe.Pointer(p)).Fop)
 102119 		if op == TK_REGISTER {
 102120 			op = int32((*Expr)(unsafe.Pointer(p)).Fop2)
 102121 		}
 102122 		if op == TK_AGG_COLUMN && *(*uintptr)(unsafe.Pointer(p + 64)) != uintptr(0) ||
 102123 			op == TK_COLUMN || op == TK_TRIGGER {
 102124 			var j int32
 102125 
 102126 			if libc.AssignInt32(&j, int32((*Expr)(unsafe.Pointer(p)).FiColumn)) >= 0 {
 102127 				var zColl uintptr = Xsqlite3ColumnColl(tls, (*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 64)))).FaCol+uintptr(j)*24)
 102128 				pColl = Xsqlite3FindCollSeq(tls, db, (*Sqlite3)(unsafe.Pointer(db)).Fenc, zColl, 0)
 102129 			}
 102130 			break
 102131 		}
 102132 		if op == TK_CAST || op == TK_UPLUS {
 102133 			p = (*Expr)(unsafe.Pointer(p)).FpLeft
 102134 			continue
 102135 		}
 102136 		if op == TK_VECTOR {
 102137 			p = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32)) + 8)).FpExpr
 102138 			continue
 102139 		}
 102140 		if op == TK_COLLATE {
 102141 			pColl = Xsqlite3GetCollSeq(tls, pParse, (*Sqlite3)(unsafe.Pointer(db)).Fenc, uintptr(0), *(*uintptr)(unsafe.Pointer(p + 8)))
 102142 			break
 102143 		}
 102144 		if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_Collate) != 0 {
 102145 			if (*Expr)(unsafe.Pointer(p)).FpLeft != 0 && (*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fflags&U32(EP_Collate) != U32(0) {
 102146 				p = (*Expr)(unsafe.Pointer(p)).FpLeft
 102147 			} else {
 102148 				var pNext uintptr = (*Expr)(unsafe.Pointer(p)).FpRight
 102149 
 102150 				if *(*uintptr)(unsafe.Pointer(p + 32)) != uintptr(0) && !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
 102151 					var i int32
 102152 					for i = 0; i < (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32)))).FnExpr; i++ {
 102153 						if (*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32))+8+uintptr(i)*32)).FpExpr)).Fflags&U32(EP_Collate) != U32(0) {
 102154 							pNext = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32)) + 8 + uintptr(i)*32)).FpExpr
 102155 							break
 102156 						}
 102157 					}
 102158 				}
 102159 				p = pNext
 102160 			}
 102161 		} else {
 102162 			break
 102163 		}
 102164 	}
 102165 	if Xsqlite3CheckCollSeq(tls, pParse, pColl) != 0 {
 102166 		pColl = uintptr(0)
 102167 	}
 102168 	return pColl
 102169 }
 102170 
 102171 // Return the collation sequence for the expression pExpr. If
 102172 // there is no defined collating sequence, return a pointer to the
 102173 // defautl collation sequence.
 102174 //
 102175 // See also: sqlite3ExprCollSeq()
 102176 //
 102177 // The sqlite3ExprCollSeq() routine works the same except that it
 102178 // returns NULL if there is no defined collation.
 102179 func Xsqlite3ExprNNCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr {
 102180 	var p uintptr = Xsqlite3ExprCollSeq(tls, pParse, pExpr)
 102181 	if p == uintptr(0) {
 102182 		p = (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl
 102183 	}
 102184 
 102185 	return p
 102186 }
 102187 
 102188 // Return TRUE if the two expressions have equivalent collating sequences.
 102189 func Xsqlite3ExprCollSeqMatch(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uintptr) int32 {
 102190 	var pColl1 uintptr = Xsqlite3ExprNNCollSeq(tls, pParse, pE1)
 102191 	var pColl2 uintptr = Xsqlite3ExprNNCollSeq(tls, pParse, pE2)
 102192 	return libc.Bool32(Xsqlite3StrICmp(tls, (*CollSeq)(unsafe.Pointer(pColl1)).FzName, (*CollSeq)(unsafe.Pointer(pColl2)).FzName) == 0)
 102193 }
 102194 
 102195 // pExpr is an operand of a comparison operator.  aff2 is the
 102196 // type affinity of the other operand.  This routine returns the
 102197 // type affinity that should be used for the comparison operator.
 102198 func Xsqlite3CompareAffinity(tls *libc.TLS, pExpr uintptr, aff2 int8) int8 {
 102199 	var aff1 int8 = Xsqlite3ExprAffinity(tls, pExpr)
 102200 	if int32(aff1) > SQLITE_AFF_NONE && int32(aff2) > SQLITE_AFF_NONE {
 102201 		if int32(aff1) >= SQLITE_AFF_NUMERIC || int32(aff2) >= SQLITE_AFF_NUMERIC {
 102202 			return int8(SQLITE_AFF_NUMERIC)
 102203 		} else {
 102204 			return int8(SQLITE_AFF_BLOB)
 102205 		}
 102206 	} else {
 102207 		return int8(func() int32 {
 102208 			if int32(aff1) <= SQLITE_AFF_NONE {
 102209 				return int32(aff2)
 102210 			}
 102211 			return int32(aff1)
 102212 		}() | SQLITE_AFF_NONE)
 102213 	}
 102214 	return int8(0)
 102215 }
 102216 
 102217 func comparisonAffinity(tls *libc.TLS, pExpr uintptr) int8 {
 102218 	var aff int8
 102219 
 102220 	aff = Xsqlite3ExprAffinity(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
 102221 	if (*Expr)(unsafe.Pointer(pExpr)).FpRight != 0 {
 102222 		aff = Xsqlite3CompareAffinity(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight, aff)
 102223 	} else if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) {
 102224 		aff = Xsqlite3CompareAffinity(tls, (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FpEList+8)).FpExpr, aff)
 102225 	} else if int32(aff) == 0 {
 102226 		aff = int8(SQLITE_AFF_BLOB)
 102227 	}
 102228 	return aff
 102229 }
 102230 
 102231 // pExpr is a comparison expression, eg. '=', '<', IN(...) etc.
 102232 // idx_affinity is the affinity of an indexed column. Return true
 102233 // if the index with affinity idx_affinity may be used to implement
 102234 // the comparison in pExpr.
 102235 func Xsqlite3IndexAffinityOk(tls *libc.TLS, pExpr uintptr, idx_affinity int8) int32 {
 102236 	var aff int8 = comparisonAffinity(tls, pExpr)
 102237 	if int32(aff) < SQLITE_AFF_TEXT {
 102238 		return 1
 102239 	}
 102240 	if int32(aff) == SQLITE_AFF_TEXT {
 102241 		return libc.Bool32(int32(idx_affinity) == SQLITE_AFF_TEXT)
 102242 	}
 102243 	return libc.Bool32(int32(idx_affinity) >= SQLITE_AFF_NUMERIC)
 102244 }
 102245 
 102246 func binaryCompareP5(tls *libc.TLS, pExpr1 uintptr, pExpr2 uintptr, jumpIfNull int32) U8 {
 102247 	var aff U8 = U8(Xsqlite3ExprAffinity(tls, pExpr2))
 102248 	aff = U8(int32(U8(Xsqlite3CompareAffinity(tls, pExpr1, int8(aff)))) | int32(U8(jumpIfNull)))
 102249 	return aff
 102250 }
 102251 
 102252 // Return a pointer to the collation sequence that should be used by
 102253 // a binary comparison operator comparing pLeft and pRight.
 102254 //
 102255 // If the left hand expression has a collating sequence type, then it is
 102256 // used. Otherwise the collation sequence for the right hand expression
 102257 // is used, or the default (BINARY) if neither expression has a collating
 102258 // type.
 102259 //
 102260 // Argument pRight (but not pLeft) may be a null pointer. In this case,
 102261 // it is not considered.
 102262 func Xsqlite3BinaryCompareCollSeq(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr {
 102263 	var pColl uintptr
 102264 
 102265 	if (*Expr)(unsafe.Pointer(pLeft)).Fflags&U32(EP_Collate) != 0 {
 102266 		pColl = Xsqlite3ExprCollSeq(tls, pParse, pLeft)
 102267 	} else if pRight != 0 && (*Expr)(unsafe.Pointer(pRight)).Fflags&U32(EP_Collate) != U32(0) {
 102268 		pColl = Xsqlite3ExprCollSeq(tls, pParse, pRight)
 102269 	} else {
 102270 		pColl = Xsqlite3ExprCollSeq(tls, pParse, pLeft)
 102271 		if !(pColl != 0) {
 102272 			pColl = Xsqlite3ExprCollSeq(tls, pParse, pRight)
 102273 		}
 102274 	}
 102275 	return pColl
 102276 }
 102277 
 102278 // Expresssion p is a comparison operator.  Return a collation sequence
 102279 // appropriate for the comparison operator.
 102280 //
 102281 // This is normally just a wrapper around sqlite3BinaryCompareCollSeq().
 102282 // However, if the OP_Commuted flag is set, then the order of the operands
 102283 // is reversed in the sqlite3BinaryCompareCollSeq() call so that the
 102284 // correct collating sequence is found.
 102285 func Xsqlite3ExprCompareCollSeq(tls *libc.TLS, pParse uintptr, p uintptr) uintptr {
 102286 	if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_Commuted) != U32(0) {
 102287 		return Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(p)).FpRight, (*Expr)(unsafe.Pointer(p)).FpLeft)
 102288 	} else {
 102289 		return Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(p)).FpLeft, (*Expr)(unsafe.Pointer(p)).FpRight)
 102290 	}
 102291 	return uintptr(0)
 102292 }
 102293 
 102294 func codeCompare(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr, opcode int32, in1 int32, in2 int32, dest int32, jumpIfNull int32, isCommuted int32) int32 {
 102295 	var p5 int32
 102296 	var addr int32
 102297 	var p4 uintptr
 102298 
 102299 	if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 102300 		return 0
 102301 	}
 102302 	if isCommuted != 0 {
 102303 		p4 = Xsqlite3BinaryCompareCollSeq(tls, pParse, pRight, pLeft)
 102304 	} else {
 102305 		p4 = Xsqlite3BinaryCompareCollSeq(tls, pParse, pLeft, pRight)
 102306 	}
 102307 	p5 = int32(binaryCompareP5(tls, pLeft, pRight, jumpIfNull))
 102308 	addr = Xsqlite3VdbeAddOp4(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, opcode, in2, dest, in1,
 102309 		p4, -2)
 102310 	Xsqlite3VdbeChangeP5(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, uint16(U8(p5)))
 102311 	return addr
 102312 }
 102313 
 102314 // Return true if expression pExpr is a vector, or false otherwise.
 102315 //
 102316 // A vector is defined as any expression that results in two or more
 102317 // columns of result.  Every TK_VECTOR node is an vector because the
 102318 // parser will not generate a TK_VECTOR with fewer than two entries.
 102319 // But a TK_SELECT might be either a vector or a scalar. It is only
 102320 // considered a vector if it has two or more result columns.
 102321 func Xsqlite3ExprIsVector(tls *libc.TLS, pExpr uintptr) int32 {
 102322 	return libc.Bool32(Xsqlite3ExprVectorSize(tls, pExpr) > 1)
 102323 }
 102324 
 102325 // If the expression passed as the only argument is of type TK_VECTOR
 102326 // return the number of expressions in the vector. Or, if the expression
 102327 // is a sub-select, return the number of columns in the sub-select. For
 102328 // any other type of expression, return 1.
 102329 func Xsqlite3ExprVectorSize(tls *libc.TLS, pExpr uintptr) int32 {
 102330 	var op U8 = (*Expr)(unsafe.Pointer(pExpr)).Fop
 102331 	if int32(op) == TK_REGISTER {
 102332 		op = (*Expr)(unsafe.Pointer(pExpr)).Fop2
 102333 	}
 102334 	if int32(op) == TK_VECTOR {
 102335 		return (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr
 102336 	} else if int32(op) == TK_SELECT {
 102337 		return (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FpEList)).FnExpr
 102338 	} else {
 102339 		return 1
 102340 	}
 102341 	return int32(0)
 102342 }
 102343 
 102344 // Return a pointer to a subexpression of pVector that is the i-th
 102345 // column of the vector (numbered starting with 0).  The caller must
 102346 // ensure that i is within range.
 102347 //
 102348 // If pVector is really a scalar (and "scalar" here includes subqueries
 102349 // that return a single column!) then return pVector unmodified.
 102350 //
 102351 // pVector retains ownership of the returned subexpression.
 102352 //
 102353 // If the vector is a (SELECT ...) then the expression returned is
 102354 // just the expression for the i-th term of the result set, and may
 102355 // not be ready for evaluation because the table cursor has not yet
 102356 // been positioned.
 102357 func Xsqlite3VectorFieldSubexpr(tls *libc.TLS, pVector uintptr, i int32) uintptr {
 102358 	if Xsqlite3ExprIsVector(tls, pVector) != 0 {
 102359 		if int32((*Expr)(unsafe.Pointer(pVector)).Fop) == TK_SELECT || int32((*Expr)(unsafe.Pointer(pVector)).Fop2) == TK_SELECT {
 102360 			return (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pVector + 32)))).FpEList + 8 + uintptr(i)*32)).FpExpr
 102361 		} else {
 102362 			return (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pVector + 32)) + 8 + uintptr(i)*32)).FpExpr
 102363 		}
 102364 	}
 102365 	return pVector
 102366 }
 102367 
 102368 // Compute and return a new Expr object which when passed to
 102369 // sqlite3ExprCode() will generate all necessary code to compute
 102370 // the iField-th column of the vector expression pVector.
 102371 //
 102372 // It is ok for pVector to be a scalar (as long as iField==0).
 102373 // In that case, this routine works like sqlite3ExprDup().
 102374 //
 102375 // The caller owns the returned Expr object and is responsible for
 102376 // ensuring that the returned value eventually gets freed.
 102377 //
 102378 // The caller retains ownership of pVector.  If pVector is a TK_SELECT,
 102379 // then the returned object will reference pVector and so pVector must remain
 102380 // valid for the life of the returned object.  If pVector is a TK_VECTOR
 102381 // or a scalar expression, then it can be deleted as soon as this routine
 102382 // returns.
 102383 //
 102384 // A trick to cause a TK_SELECT pVector to be deleted together with
 102385 // the returned Expr object is to attach the pVector to the pRight field
 102386 // of the returned TK_SELECT_COLUMN Expr object.
 102387 func Xsqlite3ExprForVectorField(tls *libc.TLS, pParse uintptr, pVector uintptr, iField int32, nField int32) uintptr {
 102388 	var pRet uintptr
 102389 	if int32((*Expr)(unsafe.Pointer(pVector)).Fop) == TK_SELECT {
 102390 		pRet = Xsqlite3PExpr(tls, pParse, TK_SELECT_COLUMN, uintptr(0), uintptr(0))
 102391 		if pRet != 0 {
 102392 			(*Expr)(unsafe.Pointer(pRet)).FiTable = nField
 102393 			(*Expr)(unsafe.Pointer(pRet)).FiColumn = YnVar(iField)
 102394 			(*Expr)(unsafe.Pointer(pRet)).FpLeft = pVector
 102395 		}
 102396 	} else {
 102397 		if int32((*Expr)(unsafe.Pointer(pVector)).Fop) == TK_VECTOR {
 102398 			var ppVector uintptr
 102399 
 102400 			ppVector = *(*uintptr)(unsafe.Pointer(pVector + 32)) + 8 + uintptr(iField)*32
 102401 			pVector = *(*uintptr)(unsafe.Pointer(ppVector))
 102402 			if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
 102403 				*(*uintptr)(unsafe.Pointer(ppVector)) = uintptr(0)
 102404 				return pVector
 102405 			}
 102406 		}
 102407 		pRet = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pVector, 0)
 102408 	}
 102409 	return pRet
 102410 }
 102411 
 102412 func exprCodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 {
 102413 	var reg int32 = 0
 102414 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_SELECT {
 102415 		reg = Xsqlite3CodeSubselect(tls, pParse, pExpr)
 102416 	}
 102417 	return reg
 102418 }
 102419 
 102420 func exprVectorRegister(tls *libc.TLS, pParse uintptr, pVector uintptr, iField int32, regSelect int32, ppExpr uintptr, pRegFree uintptr) int32 {
 102421 	var op U8 = (*Expr)(unsafe.Pointer(pVector)).Fop
 102422 
 102423 	if int32(op) == TK_REGISTER {
 102424 		*(*uintptr)(unsafe.Pointer(ppExpr)) = Xsqlite3VectorFieldSubexpr(tls, pVector, iField)
 102425 		return (*Expr)(unsafe.Pointer(pVector)).FiTable + iField
 102426 	}
 102427 	if int32(op) == TK_SELECT {
 102428 		*(*uintptr)(unsafe.Pointer(ppExpr)) = (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pVector + 32)))).FpEList + 8 + uintptr(iField)*32)).FpExpr
 102429 		return regSelect + iField
 102430 	}
 102431 	if int32(op) == TK_VECTOR {
 102432 		*(*uintptr)(unsafe.Pointer(ppExpr)) = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pVector + 32)) + 8 + uintptr(iField)*32)).FpExpr
 102433 		return Xsqlite3ExprCodeTemp(tls, pParse, *(*uintptr)(unsafe.Pointer(ppExpr)), pRegFree)
 102434 	}
 102435 	return 0
 102436 }
 102437 
 102438 func codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, op U8, p5 U8) {
 102439 	bp := tls.Alloc(28)
 102440 	defer tls.Free(28)
 102441 
 102442 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 102443 	var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
 102444 	var pRight uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpRight
 102445 	var nLeft int32 = Xsqlite3ExprVectorSize(tls, pLeft)
 102446 	var i int32
 102447 	var regLeft int32 = 0
 102448 	var regRight int32 = 0
 102449 	var opx U8 = op
 102450 	var addrCmp int32 = 0
 102451 	var addrDone int32 = Xsqlite3VdbeMakeLabel(tls, pParse)
 102452 	var isCommuted int32 = libc.Bool32((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Commuted) != U32(0))
 102453 
 102454 	if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 102455 		return
 102456 	}
 102457 	if nLeft != Xsqlite3ExprVectorSize(tls, pRight) {
 102458 		Xsqlite3ErrorMsg(tls, pParse, ts+7885, 0)
 102459 		return
 102460 	}
 102461 
 102462 	if int32(op) == TK_LE {
 102463 		opx = U8(TK_LT)
 102464 	}
 102465 	if int32(op) == TK_GE {
 102466 		opx = U8(TK_GT)
 102467 	}
 102468 	if int32(op) == TK_NE {
 102469 		opx = U8(TK_EQ)
 102470 	}
 102471 
 102472 	regLeft = exprCodeSubselect(tls, pParse, pLeft)
 102473 	regRight = exprCodeSubselect(tls, pParse, pRight)
 102474 
 102475 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, dest)
 102476 	for i = 0; 1 != 0; i++ {
 102477 		*(*int32)(unsafe.Pointer(bp + 8)) = 0
 102478 		*(*int32)(unsafe.Pointer(bp + 24)) = 0
 102479 		*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 102480 		*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
 102481 		var r1 int32
 102482 		var r2 int32
 102483 
 102484 		if addrCmp != 0 {
 102485 			Xsqlite3VdbeJumpHere(tls, v, addrCmp)
 102486 		}
 102487 		r1 = exprVectorRegister(tls, pParse, pLeft, i, regLeft, bp, bp+8)
 102488 		r2 = exprVectorRegister(tls, pParse, pRight, i, regRight, bp+16, bp+24)
 102489 		addrCmp = Xsqlite3VdbeCurrentAddr(tls, v)
 102490 		codeCompare(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 16)), int32(opx), r1, r2, addrDone, int32(p5), isCommuted)
 102491 
 102492 		Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 8)))
 102493 		Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 24)))
 102494 		if (int32(opx) == TK_LT || int32(opx) == TK_GT) && i < nLeft-1 {
 102495 			addrCmp = Xsqlite3VdbeAddOp0(tls, v, OP_ElseEq)
 102496 
 102497 		}
 102498 		if int32(p5) == SQLITE_NULLEQ {
 102499 			Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, dest)
 102500 		} else {
 102501 			Xsqlite3VdbeAddOp3(tls, v, OP_ZeroOrNull, r1, dest, r2)
 102502 		}
 102503 		if i == nLeft-1 {
 102504 			break
 102505 		}
 102506 		if int32(opx) == TK_EQ {
 102507 			Xsqlite3VdbeAddOp2(tls, v, OP_NotNull, dest, addrDone)
 102508 		} else {
 102509 			Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, addrDone)
 102510 			if i == nLeft-2 {
 102511 				opx = op
 102512 			}
 102513 		}
 102514 	}
 102515 	Xsqlite3VdbeJumpHere(tls, v, addrCmp)
 102516 	Xsqlite3VdbeResolveLabel(tls, v, addrDone)
 102517 	if int32(op) == TK_NE {
 102518 		Xsqlite3VdbeAddOp2(tls, v, OP_Not, dest, dest)
 102519 	}
 102520 }
 102521 
 102522 // Check that argument nHeight is less than or equal to the maximum
 102523 // expression depth allowed. If it is not, leave an error message in
 102524 // pParse.
 102525 func Xsqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) int32 {
 102526 	bp := tls.Alloc(8)
 102527 	defer tls.Free(8)
 102528 
 102529 	var rc int32 = SQLITE_OK
 102530 	var mxHeight int32 = *(*int32)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb + 136 + 3*4))
 102531 	if nHeight > mxHeight {
 102532 		Xsqlite3ErrorMsg(tls, pParse,
 102533 			ts+8777, libc.VaList(bp, mxHeight))
 102534 		rc = SQLITE_ERROR
 102535 	}
 102536 	return rc
 102537 }
 102538 
 102539 func heightOfExpr(tls *libc.TLS, p uintptr, pnHeight uintptr) {
 102540 	if p != 0 {
 102541 		if (*Expr)(unsafe.Pointer(p)).FnHeight > *(*int32)(unsafe.Pointer(pnHeight)) {
 102542 			*(*int32)(unsafe.Pointer(pnHeight)) = (*Expr)(unsafe.Pointer(p)).FnHeight
 102543 		}
 102544 	}
 102545 }
 102546 
 102547 func heightOfExprList(tls *libc.TLS, p uintptr, pnHeight uintptr) {
 102548 	if p != 0 {
 102549 		var i int32
 102550 		for i = 0; i < (*ExprList)(unsafe.Pointer(p)).FnExpr; i++ {
 102551 			heightOfExpr(tls, (*ExprList_item)(unsafe.Pointer(p+8+uintptr(i)*32)).FpExpr, pnHeight)
 102552 		}
 102553 	}
 102554 }
 102555 
 102556 func heightOfSelect(tls *libc.TLS, pSelect uintptr, pnHeight uintptr) {
 102557 	var p uintptr
 102558 	for p = pSelect; p != 0; p = (*Select)(unsafe.Pointer(p)).FpPrior {
 102559 		heightOfExpr(tls, (*Select)(unsafe.Pointer(p)).FpWhere, pnHeight)
 102560 		heightOfExpr(tls, (*Select)(unsafe.Pointer(p)).FpHaving, pnHeight)
 102561 		heightOfExpr(tls, (*Select)(unsafe.Pointer(p)).FpLimit, pnHeight)
 102562 		heightOfExprList(tls, (*Select)(unsafe.Pointer(p)).FpEList, pnHeight)
 102563 		heightOfExprList(tls, (*Select)(unsafe.Pointer(p)).FpGroupBy, pnHeight)
 102564 		heightOfExprList(tls, (*Select)(unsafe.Pointer(p)).FpOrderBy, pnHeight)
 102565 	}
 102566 }
 102567 
 102568 func exprSetHeight(tls *libc.TLS, p uintptr) {
 102569 	bp := tls.Alloc(4)
 102570 	defer tls.Free(4)
 102571 
 102572 	if (*Expr)(unsafe.Pointer(p)).FpLeft != 0 {
 102573 		*(*int32)(unsafe.Pointer(bp)) = (*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).FnHeight
 102574 	} else {
 102575 		*(*int32)(unsafe.Pointer(bp)) = 0
 102576 	}
 102577 	if (*Expr)(unsafe.Pointer(p)).FpRight != 0 && (*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpRight)).FnHeight > *(*int32)(unsafe.Pointer(bp)) {
 102578 		*(*int32)(unsafe.Pointer(bp)) = (*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpRight)).FnHeight
 102579 	}
 102580 	if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_xIsSelect) != U32(0) {
 102581 		heightOfSelect(tls, *(*uintptr)(unsafe.Pointer(p + 32)), bp)
 102582 	} else if *(*uintptr)(unsafe.Pointer(p + 32)) != 0 {
 102583 		heightOfExprList(tls, *(*uintptr)(unsafe.Pointer(p + 32)), bp)
 102584 		*(*U32)(unsafe.Pointer(p + 4)) |= U32(EP_Collate|EP_Subquery|EP_HasFunc) & Xsqlite3ExprListFlags(tls, *(*uintptr)(unsafe.Pointer(p + 32)))
 102585 	}
 102586 	(*Expr)(unsafe.Pointer(p)).FnHeight = *(*int32)(unsafe.Pointer(bp)) + 1
 102587 }
 102588 
 102589 // Set the Expr.nHeight variable using the exprSetHeight() function. If
 102590 // the height is greater than the maximum allowed expression depth,
 102591 // leave an error in pParse.
 102592 //
 102593 // Also propagate all EP_Propagate flags from the Expr.x.pList into
 102594 // Expr.flags.
 102595 func Xsqlite3ExprSetHeightAndFlags(tls *libc.TLS, pParse uintptr, p uintptr) {
 102596 	if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 102597 		return
 102598 	}
 102599 	exprSetHeight(tls, p)
 102600 	Xsqlite3ExprCheckHeight(tls, pParse, (*Expr)(unsafe.Pointer(p)).FnHeight)
 102601 }
 102602 
 102603 // Return the maximum height of any expression tree referenced
 102604 // by the select statement passed as an argument.
 102605 func Xsqlite3SelectExprHeight(tls *libc.TLS, p uintptr) int32 {
 102606 	bp := tls.Alloc(4)
 102607 	defer tls.Free(4)
 102608 
 102609 	*(*int32)(unsafe.Pointer(bp)) = 0
 102610 	heightOfSelect(tls, p, bp)
 102611 	return *(*int32)(unsafe.Pointer(bp))
 102612 }
 102613 
 102614 // This routine is the core allocator for Expr nodes.
 102615 //
 102616 // Construct a new expression node and return a pointer to it.  Memory
 102617 // for this node and for the pToken argument is a single allocation
 102618 // obtained from sqlite3DbMalloc().  The calling function
 102619 // is responsible for making sure the node eventually gets freed.
 102620 //
 102621 // If dequote is true, then the token (if it exists) is dequoted.
 102622 // If dequote is false, no dequoting is performed.  The deQuote
 102623 // parameter is ignored if pToken is NULL or if the token does not
 102624 // appear to be quoted.  If the quotes were of the form "..." (double-quotes)
 102625 // then the EP_DblQuoted flag is set on the expression node.
 102626 //
 102627 // Special case:  If op==TK_INTEGER and pToken points to a string that
 102628 // can be translated into a 32-bit integer, then the token is not
 102629 // stored in u.zToken.  Instead, the integer values is written
 102630 // into u.iValue and the EP_IntValue flag is set.  No extra storage
 102631 // is allocated to hold the integer text and the dequote flag is ignored.
 102632 func Xsqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequote int32) uintptr {
 102633 	bp := tls.Alloc(4)
 102634 	defer tls.Free(4)
 102635 
 102636 	var pNew uintptr
 102637 	var nExtra int32 = 0
 102638 	*(*int32)(unsafe.Pointer(bp)) = 0
 102639 
 102640 	if pToken != 0 {
 102641 		if op != TK_INTEGER || (*Token)(unsafe.Pointer(pToken)).Fz == uintptr(0) ||
 102642 			Xsqlite3GetInt32(tls, (*Token)(unsafe.Pointer(pToken)).Fz, bp) == 0 {
 102643 			nExtra = int32((*Token)(unsafe.Pointer(pToken)).Fn + uint32(1))
 102644 
 102645 		}
 102646 	}
 102647 	pNew = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(Expr{}))+uint64(nExtra))
 102648 	if pNew != 0 {
 102649 		libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(Expr{})))
 102650 		(*Expr)(unsafe.Pointer(pNew)).Fop = U8(op)
 102651 		(*Expr)(unsafe.Pointer(pNew)).FiAgg = int16(-1)
 102652 		if pToken != 0 {
 102653 			if nExtra == 0 {
 102654 				*(*U32)(unsafe.Pointer(pNew + 4)) |= U32(EP_IntValue | EP_Leaf | func() int32 {
 102655 					if *(*int32)(unsafe.Pointer(bp)) != 0 {
 102656 						return EP_IsTrue
 102657 					}
 102658 					return EP_IsFalse
 102659 				}())
 102660 				*(*int32)(unsafe.Pointer(pNew + 8)) = *(*int32)(unsafe.Pointer(bp))
 102661 			} else {
 102662 				*(*uintptr)(unsafe.Pointer(pNew + 8)) = pNew + 1*72
 102663 
 102664 				if (*Token)(unsafe.Pointer(pToken)).Fn != 0 {
 102665 					libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(pNew + 8)), (*Token)(unsafe.Pointer(pToken)).Fz, uint64((*Token)(unsafe.Pointer(pToken)).Fn))
 102666 				}
 102667 				*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNew + 8)) + uintptr((*Token)(unsafe.Pointer(pToken)).Fn))) = int8(0)
 102668 				if dequote != 0 && int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNew + 8)))))])&0x80 != 0 {
 102669 					Xsqlite3DequoteExpr(tls, pNew)
 102670 				}
 102671 			}
 102672 		}
 102673 		(*Expr)(unsafe.Pointer(pNew)).FnHeight = 1
 102674 	}
 102675 	return pNew
 102676 }
 102677 
 102678 // Allocate a new expression node from a zero-terminated token that has
 102679 // already been dequoted.
 102680 func Xsqlite3Expr(tls *libc.TLS, db uintptr, op int32, zToken uintptr) uintptr {
 102681 	bp := tls.Alloc(16)
 102682 	defer tls.Free(16)
 102683 
 102684 	(*Token)(unsafe.Pointer(bp)).Fz = zToken
 102685 	(*Token)(unsafe.Pointer(bp)).Fn = uint32(Xsqlite3Strlen30(tls, zToken))
 102686 	return Xsqlite3ExprAlloc(tls, db, op, bp, 0)
 102687 }
 102688 
 102689 // Attach subtrees pLeft and pRight to the Expr node pRoot.
 102690 //
 102691 // If pRoot==NULL that means that a memory allocation error has occurred.
 102692 // In that case, delete the subtrees pLeft and pRight.
 102693 func Xsqlite3ExprAttachSubtrees(tls *libc.TLS, db uintptr, pRoot uintptr, pLeft uintptr, pRight uintptr) {
 102694 	if pRoot == uintptr(0) {
 102695 		Xsqlite3ExprDelete(tls, db, pLeft)
 102696 		Xsqlite3ExprDelete(tls, db, pRight)
 102697 	} else {
 102698 		if pRight != 0 {
 102699 			(*Expr)(unsafe.Pointer(pRoot)).FpRight = pRight
 102700 			*(*U32)(unsafe.Pointer(pRoot + 4)) |= U32(EP_Collate|EP_Subquery|EP_HasFunc) & (*Expr)(unsafe.Pointer(pRight)).Fflags
 102701 			(*Expr)(unsafe.Pointer(pRoot)).FnHeight = (*Expr)(unsafe.Pointer(pRight)).FnHeight + 1
 102702 		} else {
 102703 			(*Expr)(unsafe.Pointer(pRoot)).FnHeight = 1
 102704 		}
 102705 		if pLeft != 0 {
 102706 			(*Expr)(unsafe.Pointer(pRoot)).FpLeft = pLeft
 102707 			*(*U32)(unsafe.Pointer(pRoot + 4)) |= U32(EP_Collate|EP_Subquery|EP_HasFunc) & (*Expr)(unsafe.Pointer(pLeft)).Fflags
 102708 			if (*Expr)(unsafe.Pointer(pLeft)).FnHeight >= (*Expr)(unsafe.Pointer(pRoot)).FnHeight {
 102709 				(*Expr)(unsafe.Pointer(pRoot)).FnHeight = (*Expr)(unsafe.Pointer(pLeft)).FnHeight + 1
 102710 			}
 102711 		}
 102712 	}
 102713 }
 102714 
 102715 // Allocate an Expr node which joins as many as two subtrees.
 102716 //
 102717 // One or both of the subtrees can be NULL.  Return a pointer to the new
 102718 // Expr node.  Or, if an OOM error occurs, set pParse->db->mallocFailed,
 102719 // free the subtrees and return NULL.
 102720 func Xsqlite3PExpr(tls *libc.TLS, pParse uintptr, op int32, pLeft uintptr, pRight uintptr) uintptr {
 102721 	var p uintptr
 102722 	p = Xsqlite3DbMallocRawNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Expr{})))
 102723 	if p != 0 {
 102724 		libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Expr{})))
 102725 		(*Expr)(unsafe.Pointer(p)).Fop = U8(op & 0xff)
 102726 		(*Expr)(unsafe.Pointer(p)).FiAgg = int16(-1)
 102727 		Xsqlite3ExprAttachSubtrees(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, p, pLeft, pRight)
 102728 		Xsqlite3ExprCheckHeight(tls, pParse, (*Expr)(unsafe.Pointer(p)).FnHeight)
 102729 	} else {
 102730 		Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pLeft)
 102731 		Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pRight)
 102732 	}
 102733 	return p
 102734 }
 102735 
 102736 // Add pSelect to the Expr.x.pSelect field.  Or, if pExpr is NULL (due
 102737 // do a memory allocation failure) then delete the pSelect object.
 102738 func Xsqlite3PExprAddSelect(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSelect uintptr) {
 102739 	if pExpr != 0 {
 102740 		*(*uintptr)(unsafe.Pointer(pExpr + 32)) = pSelect
 102741 		*(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_xIsSelect | EP_Subquery)
 102742 		Xsqlite3ExprSetHeightAndFlags(tls, pParse, pExpr)
 102743 	} else {
 102744 		Xsqlite3SelectDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pSelect)
 102745 	}
 102746 }
 102747 
 102748 // Expression list pEList is a list of vector values. This function
 102749 // converts the contents of pEList to a VALUES(...) Select statement
 102750 // returning 1 row for each element of the list. For example, the
 102751 // expression list:
 102752 //
 102753 //	( (1,2), (3,4) (5,6) )
 102754 //
 102755 // is translated to the equivalent of:
 102756 //
 102757 //	VALUES(1,2), (3,4), (5,6)
 102758 //
 102759 // Each of the vector values in pEList must contain exactly nElem terms.
 102760 // If a list element that is not a vector or does not contain nElem terms,
 102761 // an error message is left in pParse.
 102762 //
 102763 // This is used as part of processing IN(...) expressions with a list
 102764 // of vectors on the RHS. e.g. "... IN ((1,2), (3,4), (5,6))".
 102765 func Xsqlite3ExprListToValues(tls *libc.TLS, pParse uintptr, nElem int32, pEList uintptr) uintptr {
 102766 	bp := tls.Alloc(24)
 102767 	defer tls.Free(24)
 102768 
 102769 	var ii int32
 102770 	var pRet uintptr = uintptr(0)
 102771 
 102772 	for ii = 0; ii < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; ii++ {
 102773 		var pSel uintptr
 102774 		var pExpr uintptr = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(ii)*32)).FpExpr
 102775 		var nExprElem int32
 102776 		if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VECTOR {
 102777 			nExprElem = (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr
 102778 		} else {
 102779 			nExprElem = 1
 102780 		}
 102781 		if nExprElem != nElem {
 102782 			Xsqlite3ErrorMsg(tls, pParse, ts+8825,
 102783 				libc.VaList(bp, nExprElem, func() uintptr {
 102784 					if nExprElem > 1 {
 102785 						return ts + 8869
 102786 					}
 102787 					return ts + 1544
 102788 				}(), nElem))
 102789 			break
 102790 		}
 102791 
 102792 		pSel = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(pExpr + 32)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0))
 102793 		*(*uintptr)(unsafe.Pointer(pExpr + 32)) = uintptr(0)
 102794 		if pSel != 0 {
 102795 			if pRet != 0 {
 102796 				(*Select)(unsafe.Pointer(pSel)).Fop = U8(TK_ALL)
 102797 				(*Select)(unsafe.Pointer(pSel)).FpPrior = pRet
 102798 			}
 102799 			pRet = pSel
 102800 		}
 102801 	}
 102802 
 102803 	if pRet != 0 && (*Select)(unsafe.Pointer(pRet)).FpPrior != 0 {
 102804 		*(*U32)(unsafe.Pointer(pRet + 4)) |= U32(SF_MultiValue)
 102805 	}
 102806 	Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pEList)
 102807 	return pRet
 102808 }
 102809 
 102810 // Join two expressions using an AND operator.  If either expression is
 102811 // NULL, then just return the other expression.
 102812 //
 102813 // If one side or the other of the AND is known to be false, then instead
 102814 // of returning an AND expression, just return a constant expression with
 102815 // a value of false.
 102816 func Xsqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr {
 102817 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 102818 	if pLeft == uintptr(0) {
 102819 		return pRight
 102820 	} else if pRight == uintptr(0) {
 102821 		return pLeft
 102822 	} else if ((*Expr)(unsafe.Pointer(pLeft)).Fflags&U32(EP_OuterON|EP_IsFalse) == U32(EP_IsFalse) || (*Expr)(unsafe.Pointer(pRight)).Fflags&U32(EP_OuterON|EP_IsFalse) == U32(EP_IsFalse)) &&
 102823 		!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 102824 		Xsqlite3ExprDeferredDelete(tls, pParse, pLeft)
 102825 		Xsqlite3ExprDeferredDelete(tls, pParse, pRight)
 102826 		return Xsqlite3Expr(tls, db, TK_INTEGER, ts+8871)
 102827 	} else {
 102828 		return Xsqlite3PExpr(tls, pParse, TK_AND, pLeft, pRight)
 102829 	}
 102830 	return uintptr(0)
 102831 }
 102832 
 102833 // Construct a new expression node for a function with multiple
 102834 // arguments.
 102835 func Xsqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken uintptr, eDistinct int32) uintptr {
 102836 	bp := tls.Alloc(8)
 102837 	defer tls.Free(8)
 102838 
 102839 	var pNew uintptr
 102840 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 102841 
 102842 	pNew = Xsqlite3ExprAlloc(tls, db, TK_FUNCTION, pToken, 1)
 102843 	if pNew == uintptr(0) {
 102844 		Xsqlite3ExprListDelete(tls, db, pList)
 102845 		return uintptr(0)
 102846 	}
 102847 
 102848 	*(*int32)(unsafe.Pointer(pNew + 52)) = int32((int64((*Token)(unsafe.Pointer(pToken)).Fz) - int64((*Parse)(unsafe.Pointer(pParse)).FzTail)) / 1)
 102849 	if pList != 0 &&
 102850 		(*ExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb + 136 + 6*4)) &&
 102851 		!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) {
 102852 		Xsqlite3ErrorMsg(tls, pParse, ts+8873, libc.VaList(bp, pToken))
 102853 	}
 102854 	*(*uintptr)(unsafe.Pointer(pNew + 32)) = pList
 102855 	*(*U32)(unsafe.Pointer(pNew + 4)) |= U32(EP_HasFunc)
 102856 
 102857 	Xsqlite3ExprSetHeightAndFlags(tls, pParse, pNew)
 102858 	if eDistinct == SF_Distinct {
 102859 		*(*U32)(unsafe.Pointer(pNew + 4)) |= U32(EP_Distinct)
 102860 	}
 102861 	return pNew
 102862 }
 102863 
 102864 // Check to see if a function is usable according to current access
 102865 // rules:
 102866 //
 102867 //	SQLITE_FUNC_DIRECT    -     Only usable from top-level SQL
 102868 //
 102869 //	SQLITE_FUNC_UNSAFE    -     Usable if TRUSTED_SCHEMA or from
 102870 //	                            top-level SQL
 102871 //
 102872 // If the function is not usable, create an error.
 102873 func Xsqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pDef uintptr) {
 102874 	bp := tls.Alloc(8)
 102875 	defer tls.Free(8)
 102876 
 102877 	if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FromDDL) != U32(0) {
 102878 		if (*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_DIRECT) != U32(0) ||
 102879 			(*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_TrustedSchema) == uint64(0) {
 102880 			Xsqlite3ErrorMsg(tls, pParse, ts+8907, libc.VaList(bp, pExpr))
 102881 		}
 102882 	}
 102883 }
 102884 
 102885 // Assign a variable number to an expression that encodes a wildcard
 102886 // in the original SQL statement.
 102887 //
 102888 // Wildcards consisting of a single "?" are assigned the next sequential
 102889 // variable number.
 102890 //
 102891 // Wildcards of the form "?nnn" are assigned the number "nnn".  We make
 102892 // sure "nnn" is not too big to avoid a denial of service attack when
 102893 // the SQL statement comes from an external source.
 102894 //
 102895 // Wildcards of the form ":aaa", "@aaa", or "$aaa" are assigned the same number
 102896 // as the previous instance of the same wildcard.  Or if this is the first
 102897 // instance of the wildcard, the next sequential variable number is
 102898 // assigned.
 102899 func Xsqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n U32) {
 102900 	bp := tls.Alloc(16)
 102901 	defer tls.Free(16)
 102902 
 102903 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 102904 	var z uintptr
 102905 	var x YnVar
 102906 
 102907 	if pExpr == uintptr(0) {
 102908 		return
 102909 	}
 102910 
 102911 	z = *(*uintptr)(unsafe.Pointer(pExpr + 8))
 102912 
 102913 	if int32(*(*int8)(unsafe.Pointer(z + 1))) == 0 {
 102914 		x = libc.PreIncInt16(&(*Parse)(unsafe.Pointer(pParse)).FnVar, 1)
 102915 	} else {
 102916 		var doAdd int32 = 0
 102917 		if int32(*(*int8)(unsafe.Pointer(z))) == '?' {
 102918 			var bOk int32
 102919 			if n == U32(2) {
 102920 				*(*I64)(unsafe.Pointer(bp + 8)) = I64(int32(*(*int8)(unsafe.Pointer(z + 1))) - '0')
 102921 				bOk = 1
 102922 			} else {
 102923 				bOk = libc.Bool32(0 == Xsqlite3Atoi64(tls, z+1, bp+8, int32(n-U32(1)), uint8(SQLITE_UTF8)))
 102924 			}
 102925 
 102926 			if bOk == 0 || *(*I64)(unsafe.Pointer(bp + 8)) < int64(1) || *(*I64)(unsafe.Pointer(bp + 8)) > I64(*(*int32)(unsafe.Pointer(db + 136 + 9*4))) {
 102927 				Xsqlite3ErrorMsg(tls, pParse, ts+8927,
 102928 					libc.VaList(bp, *(*int32)(unsafe.Pointer(db + 136 + 9*4))))
 102929 				Xsqlite3RecordErrorOffsetOfExpr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr)
 102930 				return
 102931 			}
 102932 			x = YnVar(*(*I64)(unsafe.Pointer(bp + 8)))
 102933 			if int32(x) > int32((*Parse)(unsafe.Pointer(pParse)).FnVar) {
 102934 				(*Parse)(unsafe.Pointer(pParse)).FnVar = YnVar(int32(x))
 102935 				doAdd = 1
 102936 			} else if Xsqlite3VListNumToName(tls, (*Parse)(unsafe.Pointer(pParse)).FpVList, int32(x)) == uintptr(0) {
 102937 				doAdd = 1
 102938 			}
 102939 		} else {
 102940 			x = YnVar(Xsqlite3VListNameToNum(tls, (*Parse)(unsafe.Pointer(pParse)).FpVList, z, int32(n)))
 102941 			if int32(x) == 0 {
 102942 				x = libc.PreIncInt16(&(*Parse)(unsafe.Pointer(pParse)).FnVar, 1)
 102943 				doAdd = 1
 102944 			}
 102945 		}
 102946 		if doAdd != 0 {
 102947 			(*Parse)(unsafe.Pointer(pParse)).FpVList = Xsqlite3VListAdd(tls, db, (*Parse)(unsafe.Pointer(pParse)).FpVList, z, int32(n), int32(x))
 102948 		}
 102949 	}
 102950 	(*Expr)(unsafe.Pointer(pExpr)).FiColumn = x
 102951 	if int32(x) > *(*int32)(unsafe.Pointer(db + 136 + 9*4)) {
 102952 		Xsqlite3ErrorMsg(tls, pParse, ts+8970, 0)
 102953 		Xsqlite3RecordErrorOffsetOfExpr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr)
 102954 	}
 102955 }
 102956 
 102957 func sqlite3ExprDeleteNN(tls *libc.TLS, db uintptr, p uintptr) {
 102958 	if !((*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_TokenOnly|EP_Leaf) != U32(0)) {
 102959 		if (*Expr)(unsafe.Pointer(p)).FpLeft != 0 && int32((*Expr)(unsafe.Pointer(p)).Fop) != TK_SELECT_COLUMN {
 102960 			sqlite3ExprDeleteNN(tls, db, (*Expr)(unsafe.Pointer(p)).FpLeft)
 102961 		}
 102962 		if (*Expr)(unsafe.Pointer(p)).FpRight != 0 {
 102963 			sqlite3ExprDeleteNN(tls, db, (*Expr)(unsafe.Pointer(p)).FpRight)
 102964 		} else if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_xIsSelect) != U32(0) {
 102965 			Xsqlite3SelectDelete(tls, db, *(*uintptr)(unsafe.Pointer(p + 32)))
 102966 		} else {
 102967 			Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(p + 32)))
 102968 			if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_WinFunc) != U32(0) {
 102969 				Xsqlite3WindowDelete(tls, db, *(*uintptr)(unsafe.Pointer(p + 64)))
 102970 			}
 102971 		}
 102972 	}
 102973 	if !((*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_Static) != U32(0)) {
 102974 		Xsqlite3DbNNFreeNN(tls, db, p)
 102975 	}
 102976 }
 102977 
 102978 func Xsqlite3ExprDelete(tls *libc.TLS, db uintptr, p uintptr) {
 102979 	if p != 0 {
 102980 		sqlite3ExprDeleteNN(tls, db, p)
 102981 	}
 102982 }
 102983 
 102984 // Clear both elements of an OnOrUsing object
 102985 func Xsqlite3ClearOnOrUsing(tls *libc.TLS, db uintptr, p uintptr) {
 102986 	if p == uintptr(0) {
 102987 	} else if (*OnOrUsing)(unsafe.Pointer(p)).FpOn != 0 {
 102988 		sqlite3ExprDeleteNN(tls, db, (*OnOrUsing)(unsafe.Pointer(p)).FpOn)
 102989 	} else if (*OnOrUsing)(unsafe.Pointer(p)).FpUsing != 0 {
 102990 		Xsqlite3IdListDelete(tls, db, (*OnOrUsing)(unsafe.Pointer(p)).FpUsing)
 102991 	}
 102992 }
 102993 
 102994 // Arrange to cause pExpr to be deleted when the pParse is deleted.
 102995 // This is similar to sqlite3ExprDelete() except that the delete is
 102996 // deferred untilthe pParse is deleted.
 102997 //
 102998 // The pExpr might be deleted immediately on an OOM error.
 102999 //
 103000 // The deferred delete is (currently) implemented by adding the
 103001 // pExpr to the pParse->pConstExpr list with a register number of 0.
 103002 func Xsqlite3ExprDeferredDelete(tls *libc.TLS, pParse uintptr, pExpr uintptr) {
 103003 	Xsqlite3ParserAddCleanup(tls, pParse,
 103004 		*(*uintptr)(unsafe.Pointer(&struct {
 103005 			f func(*libc.TLS, uintptr, uintptr)
 103006 		}{Xsqlite3ExprDelete})),
 103007 		pExpr)
 103008 }
 103009 
 103010 // Invoke sqlite3RenameExprUnmap() and sqlite3ExprDelete() on the
 103011 // expression.
 103012 func Xsqlite3ExprUnmapAndDelete(tls *libc.TLS, pParse uintptr, p uintptr) {
 103013 	if p != 0 {
 103014 		if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
 103015 			Xsqlite3RenameExprUnmap(tls, pParse, p)
 103016 		}
 103017 		sqlite3ExprDeleteNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, p)
 103018 	}
 103019 }
 103020 
 103021 func exprStructSize(tls *libc.TLS, p uintptr) int32 {
 103022 	if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_TokenOnly) != U32(0) {
 103023 		return int32(uintptr(0) + 16)
 103024 	}
 103025 	if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_Reduced) != U32(0) {
 103026 		return int32(uintptr(0) + 44)
 103027 	}
 103028 	return int32(unsafe.Sizeof(Expr{}))
 103029 }
 103030 
 103031 func dupedExprStructSize(tls *libc.TLS, p uintptr, flags int32) int32 {
 103032 	var nSize int32
 103033 
 103034 	if 0 == flags || int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_SELECT_COLUMN ||
 103035 		(*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_WinFunc) != U32(0) {
 103036 		nSize = int32(unsafe.Sizeof(Expr{}))
 103037 	} else {
 103038 		if (*Expr)(unsafe.Pointer(p)).FpLeft != 0 || *(*uintptr)(unsafe.Pointer(p + 32)) != 0 {
 103039 			nSize = int32(uint64(uintptr(0)+44) | uint64(EP_Reduced))
 103040 		} else {
 103041 			nSize = int32(uint64(uintptr(0)+16) | uint64(EP_TokenOnly))
 103042 		}
 103043 	}
 103044 	return nSize
 103045 }
 103046 
 103047 func dupedExprNodeSize(tls *libc.TLS, p uintptr, flags int32) int32 {
 103048 	var nByte int32 = dupedExprStructSize(tls, p, flags) & 0xfff
 103049 	if !((*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_IntValue) != U32(0)) && *(*uintptr)(unsafe.Pointer(p + 8)) != 0 {
 103050 		nByte = int32(Size_t(nByte) + (libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(p + 8)))&uint64(0x3fffffff) + uint64(1)))
 103051 	}
 103052 	return (nByte + 7) & libc.CplInt32(7)
 103053 }
 103054 
 103055 func dupedExprSize(tls *libc.TLS, p uintptr, flags int32) int32 {
 103056 	var nByte int32 = 0
 103057 	if p != 0 {
 103058 		nByte = dupedExprNodeSize(tls, p, flags)
 103059 		if flags&EXPRDUP_REDUCE != 0 {
 103060 			nByte = nByte + (dupedExprSize(tls, (*Expr)(unsafe.Pointer(p)).FpLeft, flags) + dupedExprSize(tls, (*Expr)(unsafe.Pointer(p)).FpRight, flags))
 103061 		}
 103062 	}
 103063 	return nByte
 103064 }
 103065 
 103066 func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uintptr) uintptr {
 103067 	bp := tls.Alloc(8)
 103068 	defer tls.Free(8)
 103069 
 103070 	var pNew uintptr
 103071 
 103072 	var staticFlag U32
 103073 
 103074 	if pzBuffer != 0 {
 103075 		*(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(pzBuffer))
 103076 		staticFlag = U32(EP_Static)
 103077 
 103078 	} else {
 103079 		*(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3DbMallocRawNN(tls, db, uint64(dupedExprSize(tls, p, dupFlags)))
 103080 		staticFlag = U32(0)
 103081 	}
 103082 	pNew = *(*uintptr)(unsafe.Pointer(bp))
 103083 
 103084 	if pNew != 0 {
 103085 		var nStructSize uint32 = uint32(dupedExprStructSize(tls, p, dupFlags))
 103086 		var nNewSize int32 = int32(nStructSize & uint32(0xfff))
 103087 		var nToken int32
 103088 		if !((*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_IntValue) != U32(0)) && *(*uintptr)(unsafe.Pointer(p + 8)) != 0 {
 103089 			nToken = Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(p + 8))) + 1
 103090 		} else {
 103091 			nToken = 0
 103092 		}
 103093 		if dupFlags != 0 {
 103094 			libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp)), p, uint64(nNewSize))
 103095 		} else {
 103096 			var nSize U32 = U32(exprStructSize(tls, p))
 103097 			libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp)), p, uint64(nSize))
 103098 			if uint64(nSize) < uint64(unsafe.Sizeof(Expr{})) {
 103099 				libc.Xmemset(tls, *(*uintptr)(unsafe.Pointer(bp))+uintptr(nSize), 0, uint64(unsafe.Sizeof(Expr{}))-uint64(nSize))
 103100 			}
 103101 		}
 103102 
 103103 		*(*U32)(unsafe.Pointer(pNew + 4)) &= libc.Uint32FromInt32(libc.CplInt32(EP_Reduced | EP_TokenOnly | EP_Static))
 103104 		*(*U32)(unsafe.Pointer(pNew + 4)) |= nStructSize & uint32(EP_Reduced|EP_TokenOnly)
 103105 		*(*U32)(unsafe.Pointer(pNew + 4)) |= staticFlag
 103106 
 103107 		if dupFlags != 0 {
 103108 		}
 103109 
 103110 		if nToken != 0 {
 103111 			var zToken uintptr = libc.AssignPtrUintptr(pNew+8, *(*uintptr)(unsafe.Pointer(bp))+uintptr(nNewSize))
 103112 			libc.Xmemcpy(tls, zToken, *(*uintptr)(unsafe.Pointer(p + 8)), uint64(nToken))
 103113 		}
 103114 
 103115 		if U32(0) == ((*Expr)(unsafe.Pointer(p)).Fflags|(*Expr)(unsafe.Pointer(pNew)).Fflags)&U32(EP_TokenOnly|EP_Leaf) {
 103116 			if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_xIsSelect) != U32(0) {
 103117 				*(*uintptr)(unsafe.Pointer(pNew + 32)) = Xsqlite3SelectDup(tls, db, *(*uintptr)(unsafe.Pointer(p + 32)), dupFlags)
 103118 			} else {
 103119 				*(*uintptr)(unsafe.Pointer(pNew + 32)) = Xsqlite3ExprListDup(tls, db, *(*uintptr)(unsafe.Pointer(p + 32)), dupFlags)
 103120 			}
 103121 		}
 103122 
 103123 		if (*Expr)(unsafe.Pointer(pNew)).Fflags&U32(EP_Reduced|EP_TokenOnly|EP_WinFunc) != U32(0) {
 103124 			*(*uintptr)(unsafe.Pointer(bp)) += uintptr(dupedExprNodeSize(tls, p, dupFlags))
 103125 			if !((*Expr)(unsafe.Pointer(pNew)).Fflags&U32(EP_TokenOnly|EP_Leaf) != U32(0)) {
 103126 				(*Expr)(unsafe.Pointer(pNew)).FpLeft = func() uintptr {
 103127 					if (*Expr)(unsafe.Pointer(p)).FpLeft != 0 {
 103128 						return exprDup(tls, db, (*Expr)(unsafe.Pointer(p)).FpLeft, EXPRDUP_REDUCE, bp)
 103129 					}
 103130 					return uintptr(0)
 103131 				}()
 103132 				(*Expr)(unsafe.Pointer(pNew)).FpRight = func() uintptr {
 103133 					if (*Expr)(unsafe.Pointer(p)).FpRight != 0 {
 103134 						return exprDup(tls, db, (*Expr)(unsafe.Pointer(p)).FpRight, EXPRDUP_REDUCE, bp)
 103135 					}
 103136 					return uintptr(0)
 103137 				}()
 103138 			}
 103139 			if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_WinFunc) != U32(0) {
 103140 				*(*uintptr)(unsafe.Pointer(pNew + 64)) = Xsqlite3WindowDup(tls, db, pNew, *(*uintptr)(unsafe.Pointer(p + 64)))
 103141 
 103142 			}
 103143 			if pzBuffer != 0 {
 103144 				*(*uintptr)(unsafe.Pointer(pzBuffer)) = *(*uintptr)(unsafe.Pointer(bp))
 103145 			}
 103146 		} else {
 103147 			if !((*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_TokenOnly|EP_Leaf) != U32(0)) {
 103148 				if int32((*Expr)(unsafe.Pointer(pNew)).Fop) == TK_SELECT_COLUMN {
 103149 					(*Expr)(unsafe.Pointer(pNew)).FpLeft = (*Expr)(unsafe.Pointer(p)).FpLeft
 103150 
 103151 				} else {
 103152 					(*Expr)(unsafe.Pointer(pNew)).FpLeft = Xsqlite3ExprDup(tls, db, (*Expr)(unsafe.Pointer(p)).FpLeft, 0)
 103153 				}
 103154 				(*Expr)(unsafe.Pointer(pNew)).FpRight = Xsqlite3ExprDup(tls, db, (*Expr)(unsafe.Pointer(p)).FpRight, 0)
 103155 			}
 103156 		}
 103157 	}
 103158 	return pNew
 103159 }
 103160 
 103161 // Create and return a deep copy of the object passed as the second
 103162 // argument. If an OOM condition is encountered, NULL is returned
 103163 // and the db->mallocFailed flag set.
 103164 func Xsqlite3WithDup(tls *libc.TLS, db uintptr, p uintptr) uintptr {
 103165 	var pRet uintptr = uintptr(0)
 103166 	if p != 0 {
 103167 		var nByte Sqlite3_int64 = Sqlite3_int64(uint64(unsafe.Sizeof(With{})) + uint64(unsafe.Sizeof(Cte{}))*uint64((*With)(unsafe.Pointer(p)).FnCte-1))
 103168 		pRet = Xsqlite3DbMallocZero(tls, db, uint64(nByte))
 103169 		if pRet != 0 {
 103170 			var i int32
 103171 			(*With)(unsafe.Pointer(pRet)).FnCte = (*With)(unsafe.Pointer(p)).FnCte
 103172 			for i = 0; i < (*With)(unsafe.Pointer(p)).FnCte; i++ {
 103173 				(*Cte)(unsafe.Pointer(pRet + 16 + uintptr(i)*48)).FpSelect = Xsqlite3SelectDup(tls, db, (*Cte)(unsafe.Pointer(p+16+uintptr(i)*48)).FpSelect, 0)
 103174 				(*Cte)(unsafe.Pointer(pRet + 16 + uintptr(i)*48)).FpCols = Xsqlite3ExprListDup(tls, db, (*Cte)(unsafe.Pointer(p+16+uintptr(i)*48)).FpCols, 0)
 103175 				(*Cte)(unsafe.Pointer(pRet + 16 + uintptr(i)*48)).FzName = Xsqlite3DbStrDup(tls, db, (*Cte)(unsafe.Pointer(p+16+uintptr(i)*48)).FzName)
 103176 				(*Cte)(unsafe.Pointer(pRet + 16 + uintptr(i)*48)).FeM10d = (*Cte)(unsafe.Pointer(p + 16 + uintptr(i)*48)).FeM10d
 103177 			}
 103178 		}
 103179 	}
 103180 	return pRet
 103181 }
 103182 
 103183 func gatherSelectWindowsCallback(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 103184 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION && (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0) {
 103185 		var pSelect uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40))
 103186 		var pWin uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 64))
 103187 
 103188 		Xsqlite3WindowLink(tls, pSelect, pWin)
 103189 	}
 103190 	return WRC_Continue
 103191 }
 103192 
 103193 func gatherSelectWindowsSelectCallback(tls *libc.TLS, pWalker uintptr, p uintptr) int32 {
 103194 	if p == *(*uintptr)(unsafe.Pointer(pWalker + 40)) {
 103195 		return WRC_Continue
 103196 	}
 103197 	return WRC_Prune
 103198 }
 103199 
 103200 func gatherSelectWindows(tls *libc.TLS, p uintptr) {
 103201 	bp := tls.Alloc(48)
 103202 	defer tls.Free(48)
 103203 
 103204 	(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 103205 		f func(*libc.TLS, uintptr, uintptr) int32
 103206 	}{gatherSelectWindowsCallback}))
 103207 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
 103208 		f func(*libc.TLS, uintptr, uintptr) int32
 103209 	}{gatherSelectWindowsSelectCallback}))
 103210 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback2 = uintptr(0)
 103211 	(*Walker)(unsafe.Pointer(bp)).FpParse = uintptr(0)
 103212 	*(*uintptr)(unsafe.Pointer(bp + 40)) = p
 103213 	Xsqlite3WalkSelect(tls, bp, p)
 103214 }
 103215 
 103216 // The following group of routines make deep copies of expressions,
 103217 // expression lists, ID lists, and select statements.  The copies can
 103218 // be deleted (by being passed to their respective ...Delete() routines)
 103219 // without effecting the originals.
 103220 //
 103221 // The expression list, ID, and source lists return by sqlite3ExprListDup(),
 103222 // sqlite3IdListDup(), and sqlite3SrcListDup() can not be further expanded
 103223 // by subsequent calls to sqlite*ListAppend() routines.
 103224 //
 103225 // Any tables that the SrcList might point to are not duplicated.
 103226 //
 103227 // The flags parameter contains a combination of the EXPRDUP_XXX flags.
 103228 // If the EXPRDUP_REDUCE flag is set, then the structure returned is a
 103229 // truncated version of the usual Expr structure that will be stored as
 103230 // part of the in-memory representation of the database schema.
 103231 func Xsqlite3ExprDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr {
 103232 	if p != 0 {
 103233 		return exprDup(tls, db, p, flags, uintptr(0))
 103234 	}
 103235 	return uintptr(0)
 103236 }
 103237 
 103238 func Xsqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr {
 103239 	var pNew uintptr
 103240 	var pItem uintptr
 103241 	var pOldItem uintptr
 103242 	var i int32
 103243 	var pPriorSelectColOld uintptr = uintptr(0)
 103244 	var pPriorSelectColNew uintptr = uintptr(0)
 103245 
 103246 	if p == uintptr(0) {
 103247 		return uintptr(0)
 103248 	}
 103249 	pNew = Xsqlite3DbMallocRawNN(tls, db, uint64(Xsqlite3DbMallocSize(tls, db, p)))
 103250 	if pNew == uintptr(0) {
 103251 		return uintptr(0)
 103252 	}
 103253 	(*ExprList)(unsafe.Pointer(pNew)).FnExpr = (*ExprList)(unsafe.Pointer(p)).FnExpr
 103254 	(*ExprList)(unsafe.Pointer(pNew)).FnAlloc = (*ExprList)(unsafe.Pointer(p)).FnAlloc
 103255 	pItem = pNew + 8
 103256 	pOldItem = p + 8
 103257 	i = 0
 103258 __1:
 103259 	if !(i < (*ExprList)(unsafe.Pointer(p)).FnExpr) {
 103260 		goto __3
 103261 	}
 103262 	{
 103263 		var pOldExpr uintptr = (*ExprList_item)(unsafe.Pointer(pOldItem)).FpExpr
 103264 		var pNewExpr uintptr
 103265 		(*ExprList_item)(unsafe.Pointer(pItem)).FpExpr = Xsqlite3ExprDup(tls, db, pOldExpr, flags)
 103266 		if pOldExpr != 0 &&
 103267 			int32((*Expr)(unsafe.Pointer(pOldExpr)).Fop) == TK_SELECT_COLUMN &&
 103268 			libc.AssignUintptr(&pNewExpr, (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr) != uintptr(0) {
 103269 			if (*Expr)(unsafe.Pointer(pNewExpr)).FpRight != 0 {
 103270 				pPriorSelectColOld = (*Expr)(unsafe.Pointer(pOldExpr)).FpRight
 103271 				pPriorSelectColNew = (*Expr)(unsafe.Pointer(pNewExpr)).FpRight
 103272 				(*Expr)(unsafe.Pointer(pNewExpr)).FpLeft = (*Expr)(unsafe.Pointer(pNewExpr)).FpRight
 103273 			} else {
 103274 				if (*Expr)(unsafe.Pointer(pOldExpr)).FpLeft != pPriorSelectColOld {
 103275 					pPriorSelectColOld = (*Expr)(unsafe.Pointer(pOldExpr)).FpLeft
 103276 					pPriorSelectColNew = Xsqlite3ExprDup(tls, db, pPriorSelectColOld, flags)
 103277 					(*Expr)(unsafe.Pointer(pNewExpr)).FpRight = pPriorSelectColNew
 103278 				}
 103279 				(*Expr)(unsafe.Pointer(pNewExpr)).FpLeft = pPriorSelectColNew
 103280 			}
 103281 		}
 103282 		(*ExprList_item)(unsafe.Pointer(pItem)).FzEName = Xsqlite3DbStrDup(tls, db, (*ExprList_item)(unsafe.Pointer(pOldItem)).FzEName)
 103283 		(*ExprList_item)(unsafe.Pointer(pItem)).Ffg = (*ExprList_item)(unsafe.Pointer(pOldItem)).Ffg
 103284 		libc.SetBitFieldPtr16Uint32(pItem+16+4, uint32(0), 2, 0x4)
 103285 		(*ExprList_item)(unsafe.Pointer(pItem)).Fu = (*ExprList_item)(unsafe.Pointer(pOldItem)).Fu
 103286 
 103287 	}
 103288 	goto __2
 103289 __2:
 103290 	i++
 103291 	pItem += 32
 103292 	pOldItem += 32
 103293 	goto __1
 103294 	goto __3
 103295 __3:
 103296 	;
 103297 	return pNew
 103298 }
 103299 
 103300 // If cursors, triggers, views and subqueries are all omitted from
 103301 // the build, then none of the following routines, except for
 103302 // sqlite3SelectDup(), can be called. sqlite3SelectDup() is sometimes
 103303 // called with a NULL argument.
 103304 func Xsqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr {
 103305 	var pNew uintptr
 103306 	var i int32
 103307 	var nByte int32
 103308 
 103309 	if p == uintptr(0) {
 103310 		return uintptr(0)
 103311 	}
 103312 	nByte = int32(uint64(unsafe.Sizeof(SrcList{})) + func() uint64 {
 103313 		if (*SrcList)(unsafe.Pointer(p)).FnSrc > 0 {
 103314 			return uint64(unsafe.Sizeof(SrcItem{})) * uint64((*SrcList)(unsafe.Pointer(p)).FnSrc-1)
 103315 		}
 103316 		return uint64(0)
 103317 	}())
 103318 	pNew = Xsqlite3DbMallocRawNN(tls, db, uint64(nByte))
 103319 	if pNew == uintptr(0) {
 103320 		return uintptr(0)
 103321 	}
 103322 	(*SrcList)(unsafe.Pointer(pNew)).FnSrc = int32(libc.AssignPtrUint32(pNew+4, U32((*SrcList)(unsafe.Pointer(p)).FnSrc)))
 103323 	for i = 0; i < (*SrcList)(unsafe.Pointer(p)).FnSrc; i++ {
 103324 		var pNewItem uintptr = pNew + 8 + uintptr(i)*104
 103325 		var pOldItem uintptr = p + 8 + uintptr(i)*104
 103326 		var pTab uintptr
 103327 		(*SrcItem)(unsafe.Pointer(pNewItem)).FpSchema = (*SrcItem)(unsafe.Pointer(pOldItem)).FpSchema
 103328 		(*SrcItem)(unsafe.Pointer(pNewItem)).FzDatabase = Xsqlite3DbStrDup(tls, db, (*SrcItem)(unsafe.Pointer(pOldItem)).FzDatabase)
 103329 		(*SrcItem)(unsafe.Pointer(pNewItem)).FzName = Xsqlite3DbStrDup(tls, db, (*SrcItem)(unsafe.Pointer(pOldItem)).FzName)
 103330 		(*SrcItem)(unsafe.Pointer(pNewItem)).FzAlias = Xsqlite3DbStrDup(tls, db, (*SrcItem)(unsafe.Pointer(pOldItem)).FzAlias)
 103331 		(*SrcItem)(unsafe.Pointer(pNewItem)).Ffg = (*SrcItem)(unsafe.Pointer(pOldItem)).Ffg
 103332 		(*SrcItem)(unsafe.Pointer(pNewItem)).FiCursor = (*SrcItem)(unsafe.Pointer(pOldItem)).FiCursor
 103333 		(*SrcItem)(unsafe.Pointer(pNewItem)).FaddrFillSub = (*SrcItem)(unsafe.Pointer(pOldItem)).FaddrFillSub
 103334 		(*SrcItem)(unsafe.Pointer(pNewItem)).FregReturn = (*SrcItem)(unsafe.Pointer(pOldItem)).FregReturn
 103335 		if uint32(int32(*(*uint16)(unsafe.Pointer(pNewItem + 60 + 4))&0x2>>1)) != 0 {
 103336 			*(*uintptr)(unsafe.Pointer(pNewItem + 88)) = Xsqlite3DbStrDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 88)))
 103337 		}
 103338 		(*SrcItem)(unsafe.Pointer(pNewItem)).Fu2 = (*SrcItem)(unsafe.Pointer(pOldItem)).Fu2
 103339 		if uint32(int32(*(*uint16)(unsafe.Pointer(pNewItem + 60 + 4))&0x100>>8)) != 0 {
 103340 			(*CteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNewItem + 96)))).FnUse++
 103341 		}
 103342 		if uint32(int32(*(*uint16)(unsafe.Pointer(pNewItem + 60 + 4))&0x4>>2)) != 0 {
 103343 			*(*uintptr)(unsafe.Pointer(pNewItem + 88)) = Xsqlite3ExprListDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 88)), flags)
 103344 		}
 103345 		pTab = libc.AssignPtrUintptr(pNewItem+32, (*SrcItem)(unsafe.Pointer(pOldItem)).FpTab)
 103346 		if pTab != 0 {
 103347 			(*Table)(unsafe.Pointer(pTab)).FnTabRef++
 103348 		}
 103349 		(*SrcItem)(unsafe.Pointer(pNewItem)).FpSelect = Xsqlite3SelectDup(tls, db, (*SrcItem)(unsafe.Pointer(pOldItem)).FpSelect, flags)
 103350 		if uint32(int32(*(*uint16)(unsafe.Pointer(pOldItem + 60 + 4))&0x400>>10)) != 0 {
 103351 			*(*uintptr)(unsafe.Pointer(pNewItem + 72)) = Xsqlite3IdListDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 72)))
 103352 		} else {
 103353 			*(*uintptr)(unsafe.Pointer(pNewItem + 72)) = Xsqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 72)), flags)
 103354 		}
 103355 		(*SrcItem)(unsafe.Pointer(pNewItem)).FcolUsed = (*SrcItem)(unsafe.Pointer(pOldItem)).FcolUsed
 103356 	}
 103357 	return pNew
 103358 }
 103359 
 103360 func Xsqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr {
 103361 	var pNew uintptr
 103362 	var i int32
 103363 
 103364 	if p == uintptr(0) {
 103365 		return uintptr(0)
 103366 	}
 103367 
 103368 	pNew = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(IdList{}))+uint64((*IdList)(unsafe.Pointer(p)).FnId-1)*uint64(unsafe.Sizeof(IdList_item{})))
 103369 	if pNew == uintptr(0) {
 103370 		return uintptr(0)
 103371 	}
 103372 	(*IdList)(unsafe.Pointer(pNew)).FnId = (*IdList)(unsafe.Pointer(p)).FnId
 103373 	(*IdList)(unsafe.Pointer(pNew)).FeU4 = (*IdList)(unsafe.Pointer(p)).FeU4
 103374 	for i = 0; i < (*IdList)(unsafe.Pointer(p)).FnId; i++ {
 103375 		var pNewItem uintptr = pNew + 8 + uintptr(i)*16
 103376 		var pOldItem uintptr = p + 8 + uintptr(i)*16
 103377 		(*IdList_item)(unsafe.Pointer(pNewItem)).FzName = Xsqlite3DbStrDup(tls, db, (*IdList_item)(unsafe.Pointer(pOldItem)).FzName)
 103378 		(*IdList_item)(unsafe.Pointer(pNewItem)).Fu4 = (*IdList_item)(unsafe.Pointer(pOldItem)).Fu4
 103379 	}
 103380 	return pNew
 103381 }
 103382 
 103383 func Xsqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) uintptr {
 103384 	bp := tls.Alloc(8)
 103385 	defer tls.Free(8)
 103386 
 103387 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 103388 	var pNext uintptr = uintptr(0)
 103389 	var pp uintptr = bp
 103390 	var p uintptr
 103391 
 103392 	for p = pDup; p != 0; p = (*Select)(unsafe.Pointer(p)).FpPrior {
 103393 		var pNew uintptr = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(Select{})))
 103394 		if pNew == uintptr(0) {
 103395 			break
 103396 		}
 103397 		(*Select)(unsafe.Pointer(pNew)).FpEList = Xsqlite3ExprListDup(tls, db, (*Select)(unsafe.Pointer(p)).FpEList, flags)
 103398 		(*Select)(unsafe.Pointer(pNew)).FpSrc = Xsqlite3SrcListDup(tls, db, (*Select)(unsafe.Pointer(p)).FpSrc, flags)
 103399 		(*Select)(unsafe.Pointer(pNew)).FpWhere = Xsqlite3ExprDup(tls, db, (*Select)(unsafe.Pointer(p)).FpWhere, flags)
 103400 		(*Select)(unsafe.Pointer(pNew)).FpGroupBy = Xsqlite3ExprListDup(tls, db, (*Select)(unsafe.Pointer(p)).FpGroupBy, flags)
 103401 		(*Select)(unsafe.Pointer(pNew)).FpHaving = Xsqlite3ExprDup(tls, db, (*Select)(unsafe.Pointer(p)).FpHaving, flags)
 103402 		(*Select)(unsafe.Pointer(pNew)).FpOrderBy = Xsqlite3ExprListDup(tls, db, (*Select)(unsafe.Pointer(p)).FpOrderBy, flags)
 103403 		(*Select)(unsafe.Pointer(pNew)).Fop = (*Select)(unsafe.Pointer(p)).Fop
 103404 		(*Select)(unsafe.Pointer(pNew)).FpNext = pNext
 103405 		(*Select)(unsafe.Pointer(pNew)).FpPrior = uintptr(0)
 103406 		(*Select)(unsafe.Pointer(pNew)).FpLimit = Xsqlite3ExprDup(tls, db, (*Select)(unsafe.Pointer(p)).FpLimit, flags)
 103407 		(*Select)(unsafe.Pointer(pNew)).FiLimit = 0
 103408 		(*Select)(unsafe.Pointer(pNew)).FiOffset = 0
 103409 		(*Select)(unsafe.Pointer(pNew)).FselFlags = (*Select)(unsafe.Pointer(p)).FselFlags & libc.Uint32FromInt32(libc.CplInt32(SF_UsesEphemeral))
 103410 		*(*int32)(unsafe.Pointer(pNew + 20)) = -1
 103411 		*(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -1
 103412 		(*Select)(unsafe.Pointer(pNew)).FnSelectRow = (*Select)(unsafe.Pointer(p)).FnSelectRow
 103413 		(*Select)(unsafe.Pointer(pNew)).FpWith = Xsqlite3WithDup(tls, db, (*Select)(unsafe.Pointer(p)).FpWith)
 103414 		(*Select)(unsafe.Pointer(pNew)).FpWin = uintptr(0)
 103415 		(*Select)(unsafe.Pointer(pNew)).FpWinDefn = Xsqlite3WindowListDup(tls, db, (*Select)(unsafe.Pointer(p)).FpWinDefn)
 103416 		if (*Select)(unsafe.Pointer(p)).FpWin != 0 && int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 {
 103417 			gatherSelectWindows(tls, pNew)
 103418 		}
 103419 		(*Select)(unsafe.Pointer(pNew)).FselId = (*Select)(unsafe.Pointer(p)).FselId
 103420 		if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 103421 			(*Select)(unsafe.Pointer(pNew)).FpNext = uintptr(0)
 103422 			Xsqlite3SelectDelete(tls, db, pNew)
 103423 			break
 103424 		}
 103425 		*(*uintptr)(unsafe.Pointer(pp)) = pNew
 103426 		pp = pNew + 80
 103427 		pNext = pNew
 103428 	}
 103429 
 103430 	return *(*uintptr)(unsafe.Pointer(bp))
 103431 }
 103432 
 103433 var zeroItem = ExprList_item{}
 103434 
 103435 func Xsqlite3ExprListAppendNew(tls *libc.TLS, db uintptr, pExpr uintptr) uintptr {
 103436 	var pItem uintptr
 103437 	var pList uintptr
 103438 
 103439 	pList = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(ExprList{}))+uint64(unsafe.Sizeof(ExprList_item{}))*uint64(4))
 103440 	if pList == uintptr(0) {
 103441 		Xsqlite3ExprDelete(tls, db, pExpr)
 103442 		return uintptr(0)
 103443 	}
 103444 	(*ExprList)(unsafe.Pointer(pList)).FnAlloc = 4
 103445 	(*ExprList)(unsafe.Pointer(pList)).FnExpr = 1
 103446 	pItem = pList + 8
 103447 	*(*ExprList_item)(unsafe.Pointer(pItem)) = zeroItem
 103448 	(*ExprList_item)(unsafe.Pointer(pItem)).FpExpr = pExpr
 103449 	return pList
 103450 }
 103451 
 103452 func Xsqlite3ExprListAppendGrow(tls *libc.TLS, db uintptr, pList uintptr, pExpr uintptr) uintptr {
 103453 	var pItem uintptr
 103454 	var pNew uintptr
 103455 	*(*int32)(unsafe.Pointer(pList + 4)) *= 2
 103456 	pNew = Xsqlite3DbRealloc(tls, db, pList,
 103457 		uint64(unsafe.Sizeof(ExprList{}))+uint64((*ExprList)(unsafe.Pointer(pList)).FnAlloc-1)*uint64(unsafe.Sizeof(ExprList_item{})))
 103458 	if pNew == uintptr(0) {
 103459 		Xsqlite3ExprListDelete(tls, db, pList)
 103460 		Xsqlite3ExprDelete(tls, db, pExpr)
 103461 		return uintptr(0)
 103462 	} else {
 103463 		pList = pNew
 103464 	}
 103465 	pItem = pList + 8 + uintptr(libc.PostIncInt32(&(*ExprList)(unsafe.Pointer(pList)).FnExpr, 1))*32
 103466 	*(*ExprList_item)(unsafe.Pointer(pItem)) = zeroItem
 103467 	(*ExprList_item)(unsafe.Pointer(pItem)).FpExpr = pExpr
 103468 	return pList
 103469 }
 103470 
 103471 func Xsqlite3ExprListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pExpr uintptr) uintptr {
 103472 	var pItem uintptr
 103473 	if pList == uintptr(0) {
 103474 		return Xsqlite3ExprListAppendNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr)
 103475 	}
 103476 	if (*ExprList)(unsafe.Pointer(pList)).FnAlloc < (*ExprList)(unsafe.Pointer(pList)).FnExpr+1 {
 103477 		return Xsqlite3ExprListAppendGrow(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pList, pExpr)
 103478 	}
 103479 	pItem = pList + 8 + uintptr(libc.PostIncInt32(&(*ExprList)(unsafe.Pointer(pList)).FnExpr, 1))*32
 103480 	*(*ExprList_item)(unsafe.Pointer(pItem)) = zeroItem
 103481 	(*ExprList_item)(unsafe.Pointer(pItem)).FpExpr = pExpr
 103482 	return pList
 103483 }
 103484 
 103485 // pColumns and pExpr form a vector assignment which is part of the SET
 103486 // clause of an UPDATE statement.  Like this:
 103487 //
 103488 //	(a,b,c) = (expr1,expr2,expr3)
 103489 //
 103490 // Or:    (a,b,c) = (SELECT x,y,z FROM ....)
 103491 //
 103492 // For each term of the vector assignment, append new entries to the
 103493 // expression list pList.  In the case of a subquery on the RHS, append
 103494 // TK_SELECT_COLUMN expressions.
 103495 func Xsqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, pColumns uintptr, pExpr uintptr) uintptr {
 103496 	bp := tls.Alloc(16)
 103497 	defer tls.Free(16)
 103498 
 103499 	var db uintptr
 103500 	var n int32
 103501 	var i int32
 103502 	var iFirst int32
 103503 	var pSubExpr uintptr
 103504 	var pFirst uintptr
 103505 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 103506 	if pList != 0 {
 103507 		iFirst = (*ExprList)(unsafe.Pointer(pList)).FnExpr
 103508 	} else {
 103509 		iFirst = 0
 103510 	}
 103511 
 103512 	if !(pColumns == uintptr(0)) {
 103513 		goto __1
 103514 	}
 103515 	goto vector_append_error
 103516 __1:
 103517 	;
 103518 	if !(pExpr == uintptr(0)) {
 103519 		goto __2
 103520 	}
 103521 	goto vector_append_error
 103522 __2:
 103523 	;
 103524 	if !(int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_SELECT && (*IdList)(unsafe.Pointer(pColumns)).FnId != libc.AssignInt32(&n, Xsqlite3ExprVectorSize(tls, pExpr))) {
 103525 		goto __3
 103526 	}
 103527 	Xsqlite3ErrorMsg(tls, pParse, ts+8993,
 103528 		libc.VaList(bp, (*IdList)(unsafe.Pointer(pColumns)).FnId, n))
 103529 	goto vector_append_error
 103530 __3:
 103531 	;
 103532 	i = 0
 103533 __4:
 103534 	if !(i < (*IdList)(unsafe.Pointer(pColumns)).FnId) {
 103535 		goto __6
 103536 	}
 103537 	pSubExpr = Xsqlite3ExprForVectorField(tls, pParse, pExpr, i, (*IdList)(unsafe.Pointer(pColumns)).FnId)
 103538 
 103539 	if !(pSubExpr == uintptr(0)) {
 103540 		goto __7
 103541 	}
 103542 	goto __5
 103543 __7:
 103544 	;
 103545 	pList = Xsqlite3ExprListAppend(tls, pParse, pList, pSubExpr)
 103546 	if !(pList != 0) {
 103547 		goto __8
 103548 	}
 103549 
 103550 	(*ExprList_item)(unsafe.Pointer(pList + 8 + uintptr((*ExprList)(unsafe.Pointer(pList)).FnExpr-1)*32)).FzEName = (*IdList_item)(unsafe.Pointer(pColumns + 8 + uintptr(i)*16)).FzName
 103551 	(*IdList_item)(unsafe.Pointer(pColumns + 8 + uintptr(i)*16)).FzName = uintptr(0)
 103552 __8:
 103553 	;
 103554 	goto __5
 103555 __5:
 103556 	i++
 103557 	goto __4
 103558 	goto __6
 103559 __6:
 103560 	;
 103561 	if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) && int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_SELECT && pList != uintptr(0)) {
 103562 		goto __9
 103563 	}
 103564 	pFirst = (*ExprList_item)(unsafe.Pointer(pList + 8 + uintptr(iFirst)*32)).FpExpr
 103565 
 103566 	(*Expr)(unsafe.Pointer(pFirst)).FpRight = pExpr
 103567 	pExpr = uintptr(0)
 103568 
 103569 	(*Expr)(unsafe.Pointer(pFirst)).FiTable = (*IdList)(unsafe.Pointer(pColumns)).FnId
 103570 __9:
 103571 	;
 103572 vector_append_error:
 103573 	Xsqlite3ExprUnmapAndDelete(tls, pParse, pExpr)
 103574 	Xsqlite3IdListDelete(tls, db, pColumns)
 103575 	return pList
 103576 }
 103577 
 103578 // Set the sort order for the last element on the given ExprList.
 103579 func Xsqlite3ExprListSetSortOrder(tls *libc.TLS, p uintptr, iSortOrder int32, eNulls int32) {
 103580 	var pItem uintptr
 103581 	if p == uintptr(0) {
 103582 		return
 103583 	}
 103584 
 103585 	pItem = p + 8 + uintptr((*ExprList)(unsafe.Pointer(p)).FnExpr-1)*32
 103586 
 103587 	if iSortOrder == -1 {
 103588 		iSortOrder = SQLITE_SO_ASC
 103589 	}
 103590 	(*ExprList_item)(unsafe.Pointer(pItem)).Ffg.FsortFlags = U8(iSortOrder)
 103591 
 103592 	if eNulls != -1 {
 103593 		libc.SetBitFieldPtr16Uint32(pItem+16+4, uint32(1), 5, 0x20)
 103594 		if iSortOrder != eNulls {
 103595 			*(*U8)(unsafe.Pointer(pItem + 16)) |= U8(KEYINFO_ORDER_BIGNULL)
 103596 		}
 103597 	}
 103598 }
 103599 
 103600 // Set the ExprList.a[].zEName element of the most recently added item
 103601 // on the expression list.
 103602 //
 103603 // pList might be NULL following an OOM error.  But pName should never be
 103604 // NULL.  If a memory allocation fails, the pParse->db->mallocFailed flag
 103605 // is set.
 103606 func Xsqlite3ExprListSetName(tls *libc.TLS, pParse uintptr, pList uintptr, pName uintptr, dequote int32) {
 103607 	if pList != 0 {
 103608 		var pItem uintptr
 103609 
 103610 		pItem = pList + 8 + uintptr((*ExprList)(unsafe.Pointer(pList)).FnExpr-1)*32
 103611 
 103612 		(*ExprList_item)(unsafe.Pointer(pItem)).FzEName = Xsqlite3DbStrNDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Token)(unsafe.Pointer(pName)).Fz, uint64((*Token)(unsafe.Pointer(pName)).Fn))
 103613 		if dequote != 0 {
 103614 			Xsqlite3Dequote(tls, (*ExprList_item)(unsafe.Pointer(pItem)).FzEName)
 103615 			if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
 103616 				Xsqlite3RenameTokenMap(tls, pParse, (*ExprList_item)(unsafe.Pointer(pItem)).FzEName, pName)
 103617 			}
 103618 		}
 103619 	}
 103620 }
 103621 
 103622 // Set the ExprList.a[].zSpan element of the most recently added item
 103623 // on the expression list.
 103624 //
 103625 // pList might be NULL following an OOM error.  But pSpan should never be
 103626 // NULL.  If a memory allocation fails, the pParse->db->mallocFailed flag
 103627 // is set.
 103628 func Xsqlite3ExprListSetSpan(tls *libc.TLS, pParse uintptr, pList uintptr, zStart uintptr, zEnd uintptr) {
 103629 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 103630 
 103631 	if pList != 0 {
 103632 		var pItem uintptr = pList + 8 + uintptr((*ExprList)(unsafe.Pointer(pList)).FnExpr-1)*32
 103633 
 103634 		if (*ExprList_item)(unsafe.Pointer(pItem)).FzEName == uintptr(0) {
 103635 			(*ExprList_item)(unsafe.Pointer(pItem)).FzEName = Xsqlite3DbSpanDup(tls, db, zStart, zEnd)
 103636 			libc.SetBitFieldPtr16Uint32(pItem+16+4, uint32(ENAME_SPAN), 0, 0x3)
 103637 		}
 103638 	}
 103639 }
 103640 
 103641 // If the expression list pEList contains more than iLimit elements,
 103642 // leave an error message in pParse.
 103643 func Xsqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, zObject uintptr) {
 103644 	bp := tls.Alloc(8)
 103645 	defer tls.Free(8)
 103646 
 103647 	var mx int32 = *(*int32)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4))
 103648 
 103649 	if pEList != 0 && (*ExprList)(unsafe.Pointer(pEList)).FnExpr > mx {
 103650 		Xsqlite3ErrorMsg(tls, pParse, ts+9023, libc.VaList(bp, zObject))
 103651 	}
 103652 }
 103653 
 103654 func exprListDeleteNN(tls *libc.TLS, db uintptr, pList uintptr) {
 103655 	var i int32 = (*ExprList)(unsafe.Pointer(pList)).FnExpr
 103656 	var pItem uintptr = pList + 8
 103657 
 103658 	for __ccgo := true; __ccgo; __ccgo = libc.PreDecInt32(&i, 1) > 0 {
 103659 		Xsqlite3ExprDelete(tls, db, (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr)
 103660 		if (*ExprList_item)(unsafe.Pointer(pItem)).FzEName != 0 {
 103661 			Xsqlite3DbNNFreeNN(tls, db, (*ExprList_item)(unsafe.Pointer(pItem)).FzEName)
 103662 		}
 103663 		pItem += 32
 103664 	}
 103665 	Xsqlite3DbNNFreeNN(tls, db, pList)
 103666 }
 103667 
 103668 func Xsqlite3ExprListDelete(tls *libc.TLS, db uintptr, pList uintptr) {
 103669 	if pList != 0 {
 103670 		exprListDeleteNN(tls, db, pList)
 103671 	}
 103672 }
 103673 
 103674 // Return the bitwise-OR of all Expr.flags fields in the given
 103675 // ExprList.
 103676 func Xsqlite3ExprListFlags(tls *libc.TLS, pList uintptr) U32 {
 103677 	var i int32
 103678 	var m U32 = U32(0)
 103679 
 103680 	for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ {
 103681 		var pExpr uintptr = (*ExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32)).FpExpr
 103682 
 103683 		m = m | (*Expr)(unsafe.Pointer(pExpr)).Fflags
 103684 	}
 103685 	return m
 103686 }
 103687 
 103688 // This is a SELECT-node callback for the expression walker that
 103689 // always "fails".  By "fail" in this case, we mean set
 103690 // pWalker->eCode to zero and abort.
 103691 //
 103692 // This callback is used by multiple expression walkers.
 103693 func Xsqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) int32 {
 103694 	_ = NotUsed
 103695 	(*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0)
 103696 	return WRC_Abort
 103697 }
 103698 
 103699 // Check the input string to see if it is "true" or "false" (in any case).
 103700 //
 103701 //	If the string is....           Return
 103702 //	  "true"                         EP_IsTrue
 103703 //	  "false"                        EP_IsFalse
 103704 //	  anything else                  0
 103705 func Xsqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) U32 {
 103706 	if Xsqlite3StrICmp(tls, zIn, ts+9046) == 0 {
 103707 		return U32(EP_IsTrue)
 103708 	}
 103709 	if Xsqlite3StrICmp(tls, zIn, ts+9051) == 0 {
 103710 		return U32(EP_IsFalse)
 103711 	}
 103712 	return U32(0)
 103713 }
 103714 
 103715 // If the input expression is an ID with the name "true" or "false"
 103716 // then convert it into an TK_TRUEFALSE term.  Return non-zero if
 103717 // the conversion happened, and zero if the expression is unaltered.
 103718 func Xsqlite3ExprIdToTrueFalse(tls *libc.TLS, pExpr uintptr) int32 {
 103719 	var v U32
 103720 
 103721 	if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Quoted|EP_IntValue) != U32(0)) &&
 103722 		libc.AssignUint32(&v, Xsqlite3IsTrueOrFalse(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) != U32(0) {
 103723 		(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_TRUEFALSE)
 103724 		*(*U32)(unsafe.Pointer(pExpr + 4)) |= v
 103725 		return 1
 103726 	}
 103727 	return 0
 103728 }
 103729 
 103730 // The argument must be a TK_TRUEFALSE Expr node.  Return 1 if it is TRUE
 103731 // and 0 if it is FALSE.
 103732 func Xsqlite3ExprTruthValue(tls *libc.TLS, pExpr uintptr) int32 {
 103733 	pExpr = Xsqlite3ExprSkipCollate(tls, pExpr)
 103734 
 103735 	return libc.Bool32(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 8)) + 4))) == 0)
 103736 }
 103737 
 103738 // If pExpr is an AND or OR expression, try to simplify it by eliminating
 103739 // terms that are always true or false.  Return the simplified expression.
 103740 // Or return the original expression if no simplification is possible.
 103741 //
 103742 // Examples:
 103743 //
 103744 //	(x<10) AND true                =>   (x<10)
 103745 //	(x<10) AND false               =>   false
 103746 //	(x<10) AND (y=22 OR false)     =>   (x<10) AND (y=22)
 103747 //	(x<10) AND (y=22 OR true)      =>   (x<10)
 103748 //	(y=22) OR true                 =>   true
 103749 func Xsqlite3ExprSimplifiedAndOr(tls *libc.TLS, pExpr uintptr) uintptr {
 103750 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND || int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_OR {
 103751 		var pRight uintptr = Xsqlite3ExprSimplifiedAndOr(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
 103752 		var pLeft uintptr = Xsqlite3ExprSimplifiedAndOr(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
 103753 		if (*Expr)(unsafe.Pointer(pLeft)).Fflags&U32(EP_OuterON|EP_IsTrue) == U32(EP_IsTrue) || (*Expr)(unsafe.Pointer(pRight)).Fflags&U32(EP_OuterON|EP_IsFalse) == U32(EP_IsFalse) {
 103754 			if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND {
 103755 				pExpr = pRight
 103756 			} else {
 103757 				pExpr = pLeft
 103758 			}
 103759 		} else if (*Expr)(unsafe.Pointer(pRight)).Fflags&U32(EP_OuterON|EP_IsTrue) == U32(EP_IsTrue) || (*Expr)(unsafe.Pointer(pLeft)).Fflags&U32(EP_OuterON|EP_IsFalse) == U32(EP_IsFalse) {
 103760 			if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND {
 103761 				pExpr = pLeft
 103762 			} else {
 103763 				pExpr = pRight
 103764 			}
 103765 		}
 103766 	}
 103767 	return pExpr
 103768 }
 103769 
 103770 func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 103771 	if int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 2 && (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_OuterON) != U32(0) {
 103772 		(*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0)
 103773 		return WRC_Abort
 103774 	}
 103775 
 103776 	{
 103777 		switch int32((*Expr)(unsafe.Pointer(pExpr)).Fop) {
 103778 		case TK_FUNCTION:
 103779 			if (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) >= 4 || (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_ConstFunc) != U32(0)) &&
 103780 				!((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0)) {
 103781 				if int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 5 {
 103782 					*(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_FromDDL)
 103783 				}
 103784 				return WRC_Continue
 103785 			} else {
 103786 				(*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0)
 103787 				return WRC_Abort
 103788 			}
 103789 			fallthrough
 103790 		case TK_ID:
 103791 			if Xsqlite3ExprIdToTrueFalse(tls, pExpr) != 0 {
 103792 				return WRC_Prune
 103793 			}
 103794 			fallthrough
 103795 		case TK_COLUMN:
 103796 			fallthrough
 103797 		case TK_AGG_FUNCTION:
 103798 			fallthrough
 103799 		case TK_AGG_COLUMN:
 103800 			if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FixedCol) != U32(0) && int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) != 2 {
 103801 				return WRC_Continue
 103802 			}
 103803 			if int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 3 && (*Expr)(unsafe.Pointer(pExpr)).FiTable == *(*int32)(unsafe.Pointer(pWalker + 40)) {
 103804 				return WRC_Continue
 103805 			}
 103806 			fallthrough
 103807 		case TK_IF_NULL_ROW:
 103808 			fallthrough
 103809 		case TK_REGISTER:
 103810 			fallthrough
 103811 		case TK_DOT:
 103812 			(*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0)
 103813 			return WRC_Abort
 103814 		case TK_VARIABLE:
 103815 			if int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 5 {
 103816 				(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL)
 103817 			} else if int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 4 {
 103818 				(*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0)
 103819 				return WRC_Abort
 103820 			}
 103821 			fallthrough
 103822 		default:
 103823 			return WRC_Continue
 103824 		}
 103825 	}
 103826 	return int32(0)
 103827 }
 103828 
 103829 func exprIsConst(tls *libc.TLS, p uintptr, initFlag int32, iCur int32) int32 {
 103830 	bp := tls.Alloc(48)
 103831 	defer tls.Free(48)
 103832 
 103833 	(*Walker)(unsafe.Pointer(bp)).FeCode = U16(initFlag)
 103834 	(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 103835 		f func(*libc.TLS, uintptr, uintptr) int32
 103836 	}{exprNodeIsConstant}))
 103837 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
 103838 		f func(*libc.TLS, uintptr, uintptr) int32
 103839 	}{Xsqlite3SelectWalkFail}))
 103840 	*(*int32)(unsafe.Pointer(bp + 40)) = iCur
 103841 	Xsqlite3WalkExpr(tls, bp, p)
 103842 	return int32((*Walker)(unsafe.Pointer(bp)).FeCode)
 103843 }
 103844 
 103845 // Walk an expression tree.  Return non-zero if the expression is constant
 103846 // and 0 if it involves variables or function calls.
 103847 //
 103848 // For the purposes of this function, a double-quoted string (ex: "abc")
 103849 // is considered a variable but a single-quoted string (ex: 'abc') is
 103850 // a constant.
 103851 func Xsqlite3ExprIsConstant(tls *libc.TLS, p uintptr) int32 {
 103852 	return exprIsConst(tls, p, 1, 0)
 103853 }
 103854 
 103855 // Walk an expression tree.  Return non-zero if
 103856 //
 103857 //	(1) the expression is constant, and
 103858 //	(2) the expression does originate in the ON or USING clause
 103859 //	    of a LEFT JOIN, and
 103860 //	(3) the expression does not contain any EP_FixedCol TK_COLUMN
 103861 //	    operands created by the constant propagation optimization.
 103862 //
 103863 // When this routine returns true, it indicates that the expression
 103864 // can be added to the pParse->pConstExpr list and evaluated once when
 103865 // the prepared statement starts up.  See sqlite3ExprCodeRunJustOnce().
 103866 func Xsqlite3ExprIsConstantNotJoin(tls *libc.TLS, p uintptr) int32 {
 103867 	return exprIsConst(tls, p, 2, 0)
 103868 }
 103869 
 103870 // Walk an expression tree.  Return non-zero if the expression is constant
 103871 // for any single row of the table with cursor iCur.  In other words, the
 103872 // expression must not refer to any non-deterministic function nor any
 103873 // table other than iCur.
 103874 func Xsqlite3ExprIsTableConstant(tls *libc.TLS, p uintptr, iCur int32) int32 {
 103875 	return exprIsConst(tls, p, 3, iCur)
 103876 }
 103877 
 103878 //	Check pExpr to see if it is an invariant constraint on data source pSrc.
 103879 //	This is an optimization.  False negatives will perhaps cause slower
 103880 //	queries, but false positives will yield incorrect answers.  So when in
 103881 //	doubt, return 0.
 103882 //
 103883 //	To be an invariant constraint, the following must be true:
 103884 //
 103885 //	  (1)  pExpr cannot refer to any table other than pSrc->iCursor.
 103886 //
 103887 //	  (2)  pExpr cannot use subqueries or non-deterministic functions.
 103888 //
 103889 //	  (3)  pSrc cannot be part of the left operand for a RIGHT JOIN.
 103890 //	       (Is there some way to relax this constraint?)
 103891 //
 103892 //	  (4)  If pSrc is the right operand of a LEFT JOIN, then...
 103893 //	        (4a)  pExpr must come from an ON clause..
 103894 //	          (4b)  and specifically the ON clause associated with the LEFT JOIN.
 103895 //
 103896 // **
 103897 // **   (5)  If pSrc is not the right operand of a LEFT JOIN or the left
 103898 // **        operand of a RIGHT JOIN, then pExpr must be from the WHERE
 103899 // **        clause, not an ON clause.
 103900 func Xsqlite3ExprIsTableConstraint(tls *libc.TLS, pExpr uintptr, pSrc uintptr) int32 {
 103901 	if int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&JT_LTORJ != 0 {
 103902 		return 0
 103903 	}
 103904 	if int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&JT_LEFT != 0 {
 103905 		if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_OuterON) != U32(0)) {
 103906 			return 0
 103907 		}
 103908 		if *(*int32)(unsafe.Pointer(pExpr + 52)) != (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor {
 103909 			return 0
 103910 		}
 103911 	} else {
 103912 		if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_OuterON) != U32(0) {
 103913 			return 0
 103914 		}
 103915 	}
 103916 	return Xsqlite3ExprIsTableConstant(tls, pExpr, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor)
 103917 }
 103918 
 103919 func exprNodeIsConstantOrGroupBy(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 103920 	var pGroupBy uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40))
 103921 	var i int32
 103922 
 103923 	for i = 0; i < (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr; i++ {
 103924 		var p uintptr = (*ExprList_item)(unsafe.Pointer(pGroupBy + 8 + uintptr(i)*32)).FpExpr
 103925 		if Xsqlite3ExprCompare(tls, uintptr(0), pExpr, p, -1) < 2 {
 103926 			var pColl uintptr = Xsqlite3ExprNNCollSeq(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, p)
 103927 			if Xsqlite3IsBinary(tls, pColl) != 0 {
 103928 				return WRC_Prune
 103929 			}
 103930 		}
 103931 	}
 103932 
 103933 	if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) {
 103934 		(*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0)
 103935 		return WRC_Abort
 103936 	}
 103937 
 103938 	return exprNodeIsConstant(tls, pWalker, pExpr)
 103939 }
 103940 
 103941 // Walk the expression tree passed as the first argument. Return non-zero
 103942 // if the expression consists entirely of constants or copies of terms
 103943 // in pGroupBy that sort with the BINARY collation sequence.
 103944 //
 103945 // This routine is used to determine if a term of the HAVING clause can
 103946 // be promoted into the WHERE clause.  In order for such a promotion to work,
 103947 // the value of the HAVING clause term must be the same for all members of
 103948 // a "group".  The requirement that the GROUP BY term must be BINARY
 103949 // assumes that no other collating sequence will have a finer-grained
 103950 // grouping than binary.  In other words (A=B COLLATE binary) implies
 103951 // A=B in every other collating sequence.  The requirement that the
 103952 // GROUP BY be BINARY is stricter than necessary.  It would also work
 103953 // to promote HAVING clauses that use the same alternative collating
 103954 // sequence as the GROUP BY term, but that is much harder to check,
 103955 // alternative collating sequences are uncommon, and this is only an
 103956 // optimization, so we take the easy way out and simply require the
 103957 // GROUP BY to use the BINARY collating sequence.
 103958 func Xsqlite3ExprIsConstantOrGroupBy(tls *libc.TLS, pParse uintptr, p uintptr, pGroupBy uintptr) int32 {
 103959 	bp := tls.Alloc(48)
 103960 	defer tls.Free(48)
 103961 
 103962 	(*Walker)(unsafe.Pointer(bp)).FeCode = U16(1)
 103963 	(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 103964 		f func(*libc.TLS, uintptr, uintptr) int32
 103965 	}{exprNodeIsConstantOrGroupBy}))
 103966 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback = uintptr(0)
 103967 	*(*uintptr)(unsafe.Pointer(bp + 40)) = pGroupBy
 103968 	(*Walker)(unsafe.Pointer(bp)).FpParse = pParse
 103969 	Xsqlite3WalkExpr(tls, bp, p)
 103970 	return int32((*Walker)(unsafe.Pointer(bp)).FeCode)
 103971 }
 103972 
 103973 // Walk an expression tree for the DEFAULT field of a column definition
 103974 // in a CREATE TABLE statement.  Return non-zero if the expression is
 103975 // acceptable for use as a DEFAULT.  That is to say, return non-zero if
 103976 // the expression is constant or a function call with constant arguments.
 103977 // Return and 0 if there are any variables.
 103978 //
 103979 // isInit is true when parsing from sqlite_schema.  isInit is false when
 103980 // processing a new CREATE TABLE statement.  When isInit is true, parameters
 103981 // (such as ? or $abc) in the expression are converted into NULL.  When
 103982 // isInit is false, parameters raise an error.  Parameters should not be
 103983 // allowed in a CREATE TABLE statement, but some legacy versions of SQLite
 103984 // allowed it, so we need to support it when reading sqlite_schema for
 103985 // backwards compatibility.
 103986 //
 103987 // If isInit is true, set EP_FromDDL on every TK_FUNCTION node.
 103988 //
 103989 // For the purposes of this function, a double-quoted string (ex: "abc")
 103990 // is considered a variable but a single-quoted string (ex: 'abc') is
 103991 // a constant.
 103992 func Xsqlite3ExprIsConstantOrFunction(tls *libc.TLS, p uintptr, isInit U8) int32 {
 103993 	return exprIsConst(tls, p, 4+int32(isInit), 0)
 103994 }
 103995 
 103996 // If the expression p codes a constant integer that is small enough
 103997 // to fit in a 32-bit integer, return 1 and put the value of the integer
 103998 // in *pValue.  If the expression is not an integer or if it is too big
 103999 // to fit in a signed 32-bit integer, return 0 and leave *pValue unchanged.
 104000 func Xsqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr) int32 {
 104001 	bp := tls.Alloc(4)
 104002 	defer tls.Free(4)
 104003 
 104004 	var rc int32 = 0
 104005 	if p == uintptr(0) {
 104006 		return 0
 104007 	}
 104008 
 104009 	if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_IntValue) != 0 {
 104010 		*(*int32)(unsafe.Pointer(pValue)) = *(*int32)(unsafe.Pointer(p + 8))
 104011 		return 1
 104012 	}
 104013 	switch int32((*Expr)(unsafe.Pointer(p)).Fop) {
 104014 	case TK_UPLUS:
 104015 		{
 104016 			rc = Xsqlite3ExprIsInteger(tls, (*Expr)(unsafe.Pointer(p)).FpLeft, pValue)
 104017 			break
 104018 
 104019 		}
 104020 	case TK_UMINUS:
 104021 		{
 104022 			*(*int32)(unsafe.Pointer(bp)) = 0
 104023 			if Xsqlite3ExprIsInteger(tls, (*Expr)(unsafe.Pointer(p)).FpLeft, bp) != 0 {
 104024 				*(*int32)(unsafe.Pointer(pValue)) = -*(*int32)(unsafe.Pointer(bp))
 104025 				rc = 1
 104026 			}
 104027 			break
 104028 
 104029 		}
 104030 	default:
 104031 		break
 104032 	}
 104033 	return rc
 104034 }
 104035 
 104036 // Return FALSE if there is no chance that the expression can be NULL.
 104037 //
 104038 // If the expression might be NULL or if the expression is too complex
 104039 // to tell return TRUE.
 104040 //
 104041 // This routine is used as an optimization, to skip OP_IsNull opcodes
 104042 // when we know that a value cannot be NULL.  Hence, a false positive
 104043 // (returning TRUE when in fact the expression can never be NULL) might
 104044 // be a small performance hit but is otherwise harmless.  On the other
 104045 // hand, a false negative (returning FALSE when the result could be NULL)
 104046 // will likely result in an incorrect answer.  So when in doubt, return
 104047 // TRUE.
 104048 func Xsqlite3ExprCanBeNull(tls *libc.TLS, p uintptr) int32 {
 104049 	var op U8
 104050 
 104051 	for int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_UPLUS || int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_UMINUS {
 104052 		p = (*Expr)(unsafe.Pointer(p)).FpLeft
 104053 
 104054 	}
 104055 	op = (*Expr)(unsafe.Pointer(p)).Fop
 104056 	if int32(op) == TK_REGISTER {
 104057 		op = (*Expr)(unsafe.Pointer(p)).Fop2
 104058 	}
 104059 	switch int32(op) {
 104060 	case TK_INTEGER:
 104061 		fallthrough
 104062 	case TK_STRING:
 104063 		fallthrough
 104064 	case TK_FLOAT:
 104065 		fallthrough
 104066 	case TK_BLOB:
 104067 		return 0
 104068 	case TK_COLUMN:
 104069 		return libc.Bool32((*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_CanBeNull) != U32(0) || *(*uintptr)(unsafe.Pointer(p + 64)) == uintptr(0) || int32((*Expr)(unsafe.Pointer(p)).FiColumn) >= 0 &&
 104070 			(*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 64)))).FaCol != uintptr(0) &&
 104071 			int32(*(*uint8)(unsafe.Pointer((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 64)))).FaCol + uintptr((*Expr)(unsafe.Pointer(p)).FiColumn)*24 + 8))&0xf>>0) == 0)
 104072 	default:
 104073 		return 1
 104074 	}
 104075 	return int32(0)
 104076 }
 104077 
 104078 // Return TRUE if the given expression is a constant which would be
 104079 // unchanged by OP_Affinity with the affinity given in the second
 104080 // argument.
 104081 //
 104082 // This routine is used to determine if the OP_Affinity operation
 104083 // can be omitted.  When in doubt return FALSE.  A false negative
 104084 // is harmless.  A false positive, however, can result in the wrong
 104085 // answer.
 104086 func Xsqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff int8) int32 {
 104087 	var op U8
 104088 	var unaryMinus int32 = 0
 104089 	if int32(aff) == SQLITE_AFF_BLOB {
 104090 		return 1
 104091 	}
 104092 	for int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_UPLUS || int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_UMINUS {
 104093 		if int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_UMINUS {
 104094 			unaryMinus = 1
 104095 		}
 104096 		p = (*Expr)(unsafe.Pointer(p)).FpLeft
 104097 	}
 104098 	op = (*Expr)(unsafe.Pointer(p)).Fop
 104099 	if int32(op) == TK_REGISTER {
 104100 		op = (*Expr)(unsafe.Pointer(p)).Fop2
 104101 	}
 104102 	switch int32(op) {
 104103 	case TK_INTEGER:
 104104 		{
 104105 			return libc.Bool32(int32(aff) >= SQLITE_AFF_NUMERIC)
 104106 
 104107 		}
 104108 	case TK_FLOAT:
 104109 		{
 104110 			return libc.Bool32(int32(aff) >= SQLITE_AFF_NUMERIC)
 104111 
 104112 		}
 104113 	case TK_STRING:
 104114 		{
 104115 			return libc.Bool32(!(unaryMinus != 0) && int32(aff) == SQLITE_AFF_TEXT)
 104116 
 104117 		}
 104118 	case TK_BLOB:
 104119 		{
 104120 			return libc.BoolInt32(!(unaryMinus != 0))
 104121 
 104122 		}
 104123 	case TK_COLUMN:
 104124 		{
 104125 			return libc.Bool32(int32(aff) >= SQLITE_AFF_NUMERIC && int32((*Expr)(unsafe.Pointer(p)).FiColumn) < 0)
 104126 
 104127 		}
 104128 	default:
 104129 		{
 104130 			return 0
 104131 
 104132 		}
 104133 	}
 104134 	return int32(0)
 104135 }
 104136 
 104137 // Return TRUE if the given string is a row-id column name.
 104138 func Xsqlite3IsRowid(tls *libc.TLS, z uintptr) int32 {
 104139 	if Xsqlite3StrICmp(tls, z, ts+9057) == 0 {
 104140 		return 1
 104141 	}
 104142 	if Xsqlite3StrICmp(tls, z, ts+9065) == 0 {
 104143 		return 1
 104144 	}
 104145 	if Xsqlite3StrICmp(tls, z, ts+9071) == 0 {
 104146 		return 1
 104147 	}
 104148 	return 0
 104149 }
 104150 
 104151 func isCandidateForInOpt(tls *libc.TLS, pX uintptr) uintptr {
 104152 	var p uintptr
 104153 	var pSrc uintptr
 104154 	var pEList uintptr
 104155 	var pTab uintptr
 104156 	var i int32
 104157 	if !((*Expr)(unsafe.Pointer(pX)).Fflags&U32(EP_xIsSelect) != U32(0)) {
 104158 		return uintptr(0)
 104159 	}
 104160 	if (*Expr)(unsafe.Pointer(pX)).Fflags&U32(EP_VarSelect) != U32(0) {
 104161 		return uintptr(0)
 104162 	}
 104163 	p = *(*uintptr)(unsafe.Pointer(pX + 32))
 104164 	if (*Select)(unsafe.Pointer(p)).FpPrior != 0 {
 104165 		return uintptr(0)
 104166 	}
 104167 	if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Distinct|SF_Aggregate) != 0 {
 104168 		return uintptr(0)
 104169 	}
 104170 
 104171 	if (*Select)(unsafe.Pointer(p)).FpLimit != 0 {
 104172 		return uintptr(0)
 104173 	}
 104174 	if (*Select)(unsafe.Pointer(p)).FpWhere != 0 {
 104175 		return uintptr(0)
 104176 	}
 104177 	pSrc = (*Select)(unsafe.Pointer(p)).FpSrc
 104178 
 104179 	if (*SrcList)(unsafe.Pointer(pSrc)).FnSrc != 1 {
 104180 		return uintptr(0)
 104181 	}
 104182 	if (*SrcItem)(unsafe.Pointer(pSrc+8)).FpSelect != 0 {
 104183 		return uintptr(0)
 104184 	}
 104185 	pTab = (*SrcItem)(unsafe.Pointer(pSrc + 8)).FpTab
 104186 
 104187 	if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
 104188 		return uintptr(0)
 104189 	}
 104190 	pEList = (*Select)(unsafe.Pointer(p)).FpEList
 104191 
 104192 	for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ {
 104193 		var pRes uintptr = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*32)).FpExpr
 104194 		if int32((*Expr)(unsafe.Pointer(pRes)).Fop) != TK_COLUMN {
 104195 			return uintptr(0)
 104196 		}
 104197 
 104198 	}
 104199 	return p
 104200 }
 104201 
 104202 func sqlite3SetHasNullFlag(tls *libc.TLS, v uintptr, iCur int32, regHasNull int32) {
 104203 	var addr1 int32
 104204 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regHasNull)
 104205 	addr1 = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, iCur)
 104206 	Xsqlite3VdbeAddOp3(tls, v, OP_Column, iCur, 0, regHasNull)
 104207 	Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_TYPEOFARG))
 104208 
 104209 	Xsqlite3VdbeJumpHere(tls, v, addr1)
 104210 }
 104211 
 104212 func sqlite3InRhsIsConstant(tls *libc.TLS, pIn uintptr) int32 {
 104213 	var pLHS uintptr
 104214 	var res int32
 104215 
 104216 	pLHS = (*Expr)(unsafe.Pointer(pIn)).FpLeft
 104217 	(*Expr)(unsafe.Pointer(pIn)).FpLeft = uintptr(0)
 104218 	res = Xsqlite3ExprIsConstant(tls, pIn)
 104219 	(*Expr)(unsafe.Pointer(pIn)).FpLeft = pLHS
 104220 	return res
 104221 }
 104222 
 104223 // This function is used by the implementation of the IN (...) operator.
 104224 // The pX parameter is the expression on the RHS of the IN operator, which
 104225 // might be either a list of expressions or a subquery.
 104226 //
 104227 // The job of this routine is to find or create a b-tree object that can
 104228 // be used either to test for membership in the RHS set or to iterate through
 104229 // all members of the RHS set, skipping duplicates.
 104230 //
 104231 // A cursor is opened on the b-tree object that is the RHS of the IN operator
 104232 // and the *piTab parameter is set to the index of that cursor.
 104233 //
 104234 // The returned value of this function indicates the b-tree type, as follows:
 104235 //
 104236 //	IN_INDEX_ROWID      - The cursor was opened on a database table.
 104237 //	IN_INDEX_INDEX_ASC  - The cursor was opened on an ascending index.
 104238 //	IN_INDEX_INDEX_DESC - The cursor was opened on a descending index.
 104239 //	IN_INDEX_EPH        - The cursor was opened on a specially created and
 104240 //	                      populated epheremal table.
 104241 //	IN_INDEX_NOOP       - No cursor was allocated.  The IN operator must be
 104242 //	                      implemented as a sequence of comparisons.
 104243 //
 104244 // An existing b-tree might be used if the RHS expression pX is a simple
 104245 // subquery such as:
 104246 //
 104247 //	SELECT <column1>, <column2>... FROM <table>
 104248 //
 104249 // If the RHS of the IN operator is a list or a more complex subquery, then
 104250 // an ephemeral table might need to be generated from the RHS and then
 104251 // pX->iTable made to point to the ephemeral table instead of an
 104252 // existing table.  In this case, the creation and initialization of the
 104253 // ephmeral table might be put inside of a subroutine, the EP_Subrtn flag
 104254 // will be set on pX and the pX->y.sub fields will be set to show where
 104255 // the subroutine is coded.
 104256 //
 104257 // The inFlags parameter must contain, at a minimum, one of the bits
 104258 // IN_INDEX_MEMBERSHIP or IN_INDEX_LOOP but not both.  If inFlags contains
 104259 // IN_INDEX_MEMBERSHIP, then the generated table will be used for a fast
 104260 // membership test.  When the IN_INDEX_LOOP bit is set, the IN index will
 104261 // be used to loop over all values of the RHS of the IN operator.
 104262 //
 104263 // When IN_INDEX_LOOP is used (and the b-tree will be used to iterate
 104264 // through the set members) then the b-tree must not contain duplicates.
 104265 // An epheremal table will be created unless the selected columns are guaranteed
 104266 // to be unique - either because it is an INTEGER PRIMARY KEY or due to
 104267 // a UNIQUE constraint or index.
 104268 //
 104269 // When IN_INDEX_MEMBERSHIP is used (and the b-tree will be used
 104270 // for fast set membership tests) then an epheremal table must
 104271 // be used unless <columns> is a single INTEGER PRIMARY KEY column or an
 104272 // index can be found with the specified <columns> as its left-most.
 104273 //
 104274 // If the IN_INDEX_NOOP_OK and IN_INDEX_MEMBERSHIP are both set and
 104275 // if the RHS of the IN operator is a list (not a subquery) then this
 104276 // routine might decide that creating an ephemeral b-tree for membership
 104277 // testing is too expensive and return IN_INDEX_NOOP.  In that case, the
 104278 // calling routine should implement the IN operator using a sequence
 104279 // of Eq or Ne comparison operations.
 104280 //
 104281 // When the b-tree is being used for membership tests, the calling function
 104282 // might need to know whether or not the RHS side of the IN operator
 104283 // contains a NULL.  If prRhsHasNull is not a NULL pointer and
 104284 // if there is any chance that the (...) might contain a NULL value at
 104285 // runtime, then a register is allocated and the register number written
 104286 // to *prRhsHasNull. If there is no chance that the (...) contains a
 104287 // NULL value, then *prRhsHasNull is left unchanged.
 104288 //
 104289 // If a register is allocated and its location stored in *prRhsHasNull, then
 104290 // the value in that register will be NULL if the b-tree contains one or more
 104291 // NULL values, and it will be some non-NULL value if the b-tree contains no
 104292 // NULL values.
 104293 //
 104294 // If the aiMap parameter is not NULL, it must point to an array containing
 104295 // one element for each column returned by the SELECT statement on the RHS
 104296 // of the IN(...) operator. The i'th entry of the array is populated with the
 104297 // offset of the index column that matches the i'th column returned by the
 104298 // SELECT. For example, if the expression and selected index are:
 104299 //
 104300 //	(?,?,?) IN (SELECT a, b, c FROM t1)
 104301 //	CREATE INDEX i1 ON t1(b, c, a);
 104302 //
 104303 // then aiMap[] is populated with {2, 0, 1}.
 104304 func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, prRhsHasNull uintptr, aiMap uintptr, piTab uintptr) int32 {
 104305 	bp := tls.Alloc(16)
 104306 	defer tls.Free(16)
 104307 
 104308 	var p uintptr
 104309 	var eType int32 = 0
 104310 	var iTab int32
 104311 	var mustBeUnique int32
 104312 	var v uintptr = Xsqlite3GetVdbe(tls, pParse)
 104313 
 104314 	mustBeUnique = libc.Bool32(inFlags&U32(IN_INDEX_LOOP) != U32(0))
 104315 	iTab = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 104316 
 104317 	if prRhsHasNull != 0 && (*Expr)(unsafe.Pointer(pX)).Fflags&U32(EP_xIsSelect) != U32(0) {
 104318 		var i int32
 104319 		var pEList uintptr = (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32)))).FpEList
 104320 		for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ {
 104321 			if Xsqlite3ExprCanBeNull(tls, (*ExprList_item)(unsafe.Pointer(pEList+8+uintptr(i)*32)).FpExpr) != 0 {
 104322 				break
 104323 			}
 104324 		}
 104325 		if i == (*ExprList)(unsafe.Pointer(pEList)).FnExpr {
 104326 			prRhsHasNull = uintptr(0)
 104327 		}
 104328 	}
 104329 
 104330 	if (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 && libc.AssignUintptr(&p, isCandidateForInOpt(tls, pX)) != uintptr(0) {
 104331 		var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 104332 		var pTab uintptr
 104333 		var iDb int32
 104334 		var pEList uintptr = (*Select)(unsafe.Pointer(p)).FpEList
 104335 		var nExpr int32 = (*ExprList)(unsafe.Pointer(pEList)).FnExpr
 104336 
 104337 		pTab = (*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc + 8)).FpTab
 104338 
 104339 		iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
 104340 
 104341 		Xsqlite3CodeVerifySchema(tls, pParse, iDb)
 104342 		Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, uint8(0), (*Table)(unsafe.Pointer(pTab)).FzName)
 104343 
 104344 		if nExpr == 1 && int32((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(pEList+8)).FpExpr)).FiColumn) < 0 {
 104345 			var iAddr int32 = Xsqlite3VdbeAddOp0(tls, v, OP_Once)
 104346 
 104347 			Xsqlite3OpenTable(tls, pParse, iTab, iDb, pTab, OP_OpenRead)
 104348 			eType = IN_INDEX_ROWID
 104349 			Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+9075, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
 104350 			Xsqlite3VdbeJumpHere(tls, v, iAddr)
 104351 		} else {
 104352 			var pIdx uintptr
 104353 			var affinity_ok int32 = 1
 104354 			var i int32
 104355 
 104356 			for i = 0; i < nExpr && affinity_ok != 0; i++ {
 104357 				var pLhs uintptr = Xsqlite3VectorFieldSubexpr(tls, (*Expr)(unsafe.Pointer(pX)).FpLeft, i)
 104358 				var iCol int32 = int32((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*32)).FpExpr)).FiColumn)
 104359 				var idxaff int8 = Xsqlite3TableColumnAffinity(tls, pTab, iCol)
 104360 				var cmpaff int8 = Xsqlite3CompareAffinity(tls, pLhs, idxaff)
 104361 
 104362 				switch int32(cmpaff) {
 104363 				case SQLITE_AFF_BLOB:
 104364 					break
 104365 					fallthrough
 104366 				case SQLITE_AFF_TEXT:
 104367 					break
 104368 					fallthrough
 104369 				default:
 104370 					affinity_ok = libc.Bool32(int32(idxaff) >= SQLITE_AFF_NUMERIC)
 104371 				}
 104372 			}
 104373 
 104374 			if affinity_ok != 0 {
 104375 				for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; pIdx != 0 && eType == 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
 104376 					var colUsed Bitmask
 104377 					var mCol Bitmask
 104378 					if int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) < nExpr {
 104379 						continue
 104380 					}
 104381 					if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != uintptr(0) {
 104382 						continue
 104383 					}
 104384 
 104385 					if int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) >= int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8))-1 {
 104386 						continue
 104387 					}
 104388 					if mustBeUnique != 0 {
 104389 						if int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) > nExpr ||
 104390 							int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) > nExpr && !(int32((*Index)(unsafe.Pointer(pIdx)).FonError) != OE_None) {
 104391 							continue
 104392 						}
 104393 					}
 104394 
 104395 					colUsed = uint64(0)
 104396 					for i = 0; i < nExpr; i++ {
 104397 						var pLhs uintptr = Xsqlite3VectorFieldSubexpr(tls, (*Expr)(unsafe.Pointer(pX)).FpLeft, i)
 104398 						var pRhs uintptr = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*32)).FpExpr
 104399 						var pReq uintptr = Xsqlite3BinaryCompareCollSeq(tls, pParse, pLhs, pRhs)
 104400 						var j int32
 104401 
 104402 						for j = 0; j < nExpr; j++ {
 104403 							if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2))) != int32((*Expr)(unsafe.Pointer(pRhs)).FiColumn) {
 104404 								continue
 104405 							}
 104406 
 104407 							if pReq != uintptr(0) && Xsqlite3StrICmp(tls, (*CollSeq)(unsafe.Pointer(pReq)).FzName, *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*8))) != 0 {
 104408 								continue
 104409 							}
 104410 							break
 104411 						}
 104412 						if j == nExpr {
 104413 							break
 104414 						}
 104415 						mCol = uint64(1) << j
 104416 						if mCol&colUsed != 0 {
 104417 							break
 104418 						}
 104419 						colUsed = colUsed | mCol
 104420 						if aiMap != 0 {
 104421 							*(*int32)(unsafe.Pointer(aiMap + uintptr(i)*4)) = j
 104422 						}
 104423 					}
 104424 
 104425 					if colUsed == uint64(1)<<nExpr-uint64(1) {
 104426 						var iAddr int32 = Xsqlite3VdbeAddOp0(tls, v, OP_Once)
 104427 						Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+9122, libc.VaList(bp+8, (*Index)(unsafe.Pointer(pIdx)).FzName))
 104428 						Xsqlite3VdbeAddOp3(tls, v, OP_OpenRead, iTab, int32((*Index)(unsafe.Pointer(pIdx)).Ftnum), iDb)
 104429 						Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx)
 104430 
 104431 						eType = IN_INDEX_INDEX_ASC + int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSortOrder)))
 104432 
 104433 						if prRhsHasNull != 0 {
 104434 							*(*int32)(unsafe.Pointer(prRhsHasNull)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 104435 							if nExpr == 1 {
 104436 								sqlite3SetHasNullFlag(tls, v, iTab, *(*int32)(unsafe.Pointer(prRhsHasNull)))
 104437 							}
 104438 						}
 104439 						Xsqlite3VdbeJumpHere(tls, v, iAddr)
 104440 					}
 104441 				}
 104442 			}
 104443 		}
 104444 	}
 104445 
 104446 	if eType == 0 &&
 104447 		inFlags&U32(IN_INDEX_NOOP_OK) != 0 &&
 104448 		(*Expr)(unsafe.Pointer(pX)).Fflags&U32(EP_xIsSelect) == U32(0) &&
 104449 		(!(sqlite3InRhsIsConstant(tls, pX) != 0) || (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32)))).FnExpr <= 2) {
 104450 		(*Parse)(unsafe.Pointer(pParse)).FnTab--
 104451 		iTab = -1
 104452 		eType = IN_INDEX_NOOP
 104453 	}
 104454 
 104455 	if eType == 0 {
 104456 		var savedNQueryLoop U32 = (*Parse)(unsafe.Pointer(pParse)).FnQueryLoop
 104457 		var rMayHaveNull int32 = 0
 104458 		eType = IN_INDEX_EPH
 104459 		if inFlags&U32(IN_INDEX_LOOP) != 0 {
 104460 			(*Parse)(unsafe.Pointer(pParse)).FnQueryLoop = U32(0)
 104461 		} else if prRhsHasNull != 0 {
 104462 			*(*int32)(unsafe.Pointer(prRhsHasNull)) = libc.AssignInt32(&rMayHaveNull, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
 104463 		}
 104464 
 104465 		Xsqlite3CodeRhsOfIN(tls, pParse, pX, iTab)
 104466 		if rMayHaveNull != 0 {
 104467 			sqlite3SetHasNullFlag(tls, v, iTab, rMayHaveNull)
 104468 		}
 104469 		(*Parse)(unsafe.Pointer(pParse)).FnQueryLoop = savedNQueryLoop
 104470 	}
 104471 
 104472 	if aiMap != 0 && eType != IN_INDEX_INDEX_ASC && eType != IN_INDEX_INDEX_DESC {
 104473 		var i int32
 104474 		var n int32
 104475 		n = Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pX)).FpLeft)
 104476 		for i = 0; i < n; i++ {
 104477 			*(*int32)(unsafe.Pointer(aiMap + uintptr(i)*4)) = i
 104478 		}
 104479 	}
 104480 	*(*int32)(unsafe.Pointer(piTab)) = iTab
 104481 	return eType
 104482 }
 104483 
 104484 func exprINAffinity(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr {
 104485 	var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
 104486 	var nVal int32 = Xsqlite3ExprVectorSize(tls, pLeft)
 104487 	var pSelect uintptr
 104488 	if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) {
 104489 		pSelect = *(*uintptr)(unsafe.Pointer(pExpr + 32))
 104490 	} else {
 104491 		pSelect = uintptr(0)
 104492 	}
 104493 	var zRet uintptr
 104494 
 104495 	zRet = Xsqlite3DbMallocRaw(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(nVal+1))
 104496 	if zRet != 0 {
 104497 		var i int32
 104498 		for i = 0; i < nVal; i++ {
 104499 			var pA uintptr = Xsqlite3VectorFieldSubexpr(tls, pLeft, i)
 104500 			var a int8 = Xsqlite3ExprAffinity(tls, pA)
 104501 			if pSelect != 0 {
 104502 				*(*int8)(unsafe.Pointer(zRet + uintptr(i))) = Xsqlite3CompareAffinity(tls, (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpEList+8+uintptr(i)*32)).FpExpr, a)
 104503 			} else {
 104504 				*(*int8)(unsafe.Pointer(zRet + uintptr(i))) = a
 104505 			}
 104506 		}
 104507 		*(*int8)(unsafe.Pointer(zRet + uintptr(nVal))) = int8(0)
 104508 	}
 104509 	return zRet
 104510 }
 104511 
 104512 // Load the Parse object passed as the first argument with an error
 104513 // message of the form:
 104514 //
 104515 //	"sub-select returns N columns - expected M"
 104516 func Xsqlite3SubselectError(tls *libc.TLS, pParse uintptr, nActual int32, nExpect int32) {
 104517 	bp := tls.Alloc(16)
 104518 	defer tls.Free(16)
 104519 
 104520 	if (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 {
 104521 		var zFmt uintptr = ts + 9153
 104522 		Xsqlite3ErrorMsg(tls, pParse, zFmt, libc.VaList(bp, nActual, nExpect))
 104523 	}
 104524 }
 104525 
 104526 // Expression pExpr is a vector that has been used in a context where
 104527 // it is not permitted. If pExpr is a sub-select vector, this routine
 104528 // loads the Parse object with a message of the form:
 104529 //
 104530 //	"sub-select returns N columns - expected 1"
 104531 //
 104532 // Or, if it is a regular scalar vector:
 104533 //
 104534 //	"row value misused"
 104535 func Xsqlite3VectorErrorMsg(tls *libc.TLS, pParse uintptr, pExpr uintptr) {
 104536 	if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) {
 104537 		Xsqlite3SubselectError(tls, pParse, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FpEList)).FnExpr, 1)
 104538 	} else {
 104539 		Xsqlite3ErrorMsg(tls, pParse, ts+7885, 0)
 104540 	}
 104541 }
 104542 
 104543 // Generate code that will construct an ephemeral table containing all terms
 104544 // in the RHS of an IN operator.  The IN operator can be in either of two
 104545 // forms:
 104546 //
 104547 //	x IN (4,5,11)              -- IN operator with list on right-hand side
 104548 //	x IN (SELECT a FROM b)     -- IN operator with subquery on the right
 104549 //
 104550 // The pExpr parameter is the IN operator.  The cursor number for the
 104551 // constructed ephermeral table is returned.  The first time the ephemeral
 104552 // table is computed, the cursor number is also stored in pExpr->iTable,
 104553 // however the cursor number returned might not be the same, as it might
 104554 // have been duplicated using OP_OpenDup.
 104555 //
 104556 // If the LHS expression ("x" in the examples) is a column value, or
 104557 // the SELECT statement returns a column value, then the affinity of that
 104558 // column is used to build the index keys. If both 'x' and the
 104559 // SELECT... statement are columns, then numeric affinity is used
 104560 // if either column has NUMERIC or INTEGER affinity. If neither
 104561 // 'x' nor the SELECT... statement are columns, then numeric affinity
 104562 // is used.
 104563 func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int32) {
 104564 	bp := tls.Alloc(65)
 104565 	defer tls.Free(65)
 104566 
 104567 	var addrOnce int32 = 0
 104568 	var addr int32
 104569 	var pLeft uintptr
 104570 	var pKeyInfo uintptr = uintptr(0)
 104571 	var nVal int32
 104572 	var v uintptr
 104573 
 104574 	v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 104575 
 104576 	if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_VarSelect) != U32(0)) && (*Parse)(unsafe.Pointer(pParse)).FiSelfTab == 0 {
 104577 		if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Subrtn) != U32(0) {
 104578 			addrOnce = Xsqlite3VdbeAddOp0(tls, v, OP_Once)
 104579 			if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) {
 104580 				Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+9197, libc.VaList(bp, (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FselId))
 104581 			}
 104582 
 104583 			Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, *(*int32)(unsafe.Pointer(pExpr + 64 + 4)),
 104584 				*(*int32)(unsafe.Pointer(pExpr + 64)))
 104585 
 104586 			Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, iTab, (*Expr)(unsafe.Pointer(pExpr)).FiTable)
 104587 			Xsqlite3VdbeJumpHere(tls, v, addrOnce)
 104588 			return
 104589 		}
 104590 
 104591 		*(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_Subrtn)
 104592 
 104593 		*(*int32)(unsafe.Pointer(pExpr + 64 + 4)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 104594 		*(*int32)(unsafe.Pointer(pExpr + 64)) = Xsqlite3VdbeAddOp2(tls, v, OP_BeginSubrtn, 0, *(*int32)(unsafe.Pointer(pExpr + 64 + 4))) + 1
 104595 
 104596 		addrOnce = Xsqlite3VdbeAddOp0(tls, v, OP_Once)
 104597 	}
 104598 
 104599 	pLeft = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
 104600 	nVal = Xsqlite3ExprVectorSize(tls, pLeft)
 104601 
 104602 	(*Expr)(unsafe.Pointer(pExpr)).FiTable = iTab
 104603 	addr = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*Expr)(unsafe.Pointer(pExpr)).FiTable, nVal)
 104604 	pKeyInfo = Xsqlite3KeyInfoAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, nVal, 1)
 104605 
 104606 	if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) {
 104607 		var pSelect uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 32))
 104608 		var pEList uintptr = (*Select)(unsafe.Pointer(pSelect)).FpEList
 104609 
 104610 		Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+9220, libc.VaList(bp+8, func() uintptr {
 104611 			if addrOnce != 0 {
 104612 				return ts + 1544
 104613 			}
 104614 			return ts + 9239
 104615 		}(), (*Select)(unsafe.Pointer(pSelect)).FselId))
 104616 
 104617 		if (*ExprList)(unsafe.Pointer(pEList)).FnExpr == nVal {
 104618 			var pCopy uintptr
 104619 
 104620 			var i int32
 104621 			var rc int32
 104622 			Xsqlite3SelectDestInit(tls, bp+24, SRT_Set, iTab)
 104623 			(*SelectDest)(unsafe.Pointer(bp + 24)).FzAffSdst = exprINAffinity(tls, pParse, pExpr)
 104624 			(*Select)(unsafe.Pointer(pSelect)).FiLimit = 0
 104625 
 104626 			pCopy = Xsqlite3SelectDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pSelect, 0)
 104627 			if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 {
 104628 				rc = 1
 104629 			} else {
 104630 				rc = Xsqlite3Select(tls, pParse, pCopy, bp+24)
 104631 			}
 104632 			Xsqlite3SelectDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pCopy)
 104633 			Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*SelectDest)(unsafe.Pointer(bp+24)).FzAffSdst)
 104634 			if rc != 0 {
 104635 				Xsqlite3KeyInfoUnref(tls, pKeyInfo)
 104636 				return
 104637 			}
 104638 
 104639 			for i = 0; i < nVal; i++ {
 104640 				var p uintptr = Xsqlite3VectorFieldSubexpr(tls, pLeft, i)
 104641 				*(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) = Xsqlite3BinaryCompareCollSeq(tls,
 104642 					pParse, p, (*ExprList_item)(unsafe.Pointer(pEList+8+uintptr(i)*32)).FpExpr)
 104643 			}
 104644 		}
 104645 	} else if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) {
 104646 		var i int32
 104647 		var pList uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 32))
 104648 		var pItem uintptr
 104649 		var r1 int32
 104650 		var r2 int32
 104651 		*(*int8)(unsafe.Pointer(bp + 64)) = Xsqlite3ExprAffinity(tls, pLeft)
 104652 		if int32(*(*int8)(unsafe.Pointer(bp + 64))) <= SQLITE_AFF_NONE {
 104653 			*(*int8)(unsafe.Pointer(bp + 64)) = int8(SQLITE_AFF_BLOB)
 104654 		} else if int32(*(*int8)(unsafe.Pointer(bp + 64))) == SQLITE_AFF_REAL {
 104655 			*(*int8)(unsafe.Pointer(bp + 64)) = int8(SQLITE_AFF_NUMERIC)
 104656 		}
 104657 		if pKeyInfo != 0 {
 104658 			*(*uintptr)(unsafe.Pointer(pKeyInfo + 32)) = Xsqlite3ExprCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
 104659 		}
 104660 
 104661 		r1 = Xsqlite3GetTempReg(tls, pParse)
 104662 		r2 = Xsqlite3GetTempReg(tls, pParse)
 104663 		i = (*ExprList)(unsafe.Pointer(pList)).FnExpr
 104664 		pItem = pList + 8
 104665 	__1:
 104666 		if !(i > 0) {
 104667 			goto __3
 104668 		}
 104669 		{
 104670 			var pE2 uintptr = (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr
 104671 
 104672 			if addrOnce != 0 && !(Xsqlite3ExprIsConstant(tls, pE2) != 0) {
 104673 				Xsqlite3VdbeChangeToNoop(tls, v, addrOnce-1)
 104674 				Xsqlite3VdbeChangeToNoop(tls, v, addrOnce)
 104675 				*(*U32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(libc.CplInt32(EP_Subrtn))
 104676 				addrOnce = 0
 104677 			}
 104678 
 104679 			Xsqlite3ExprCode(tls, pParse, pE2, r1)
 104680 			Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, r1, 1, r2, bp+64, 1)
 104681 			Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iTab, r2, r1, 1)
 104682 
 104683 		}
 104684 		goto __2
 104685 	__2:
 104686 		i--
 104687 		pItem += 32
 104688 		goto __1
 104689 		goto __3
 104690 	__3:
 104691 		;
 104692 		Xsqlite3ReleaseTempReg(tls, pParse, r1)
 104693 		Xsqlite3ReleaseTempReg(tls, pParse, r2)
 104694 	}
 104695 	if pKeyInfo != 0 {
 104696 		Xsqlite3VdbeChangeP4(tls, v, addr, pKeyInfo, -8)
 104697 	}
 104698 	if addrOnce != 0 {
 104699 		Xsqlite3VdbeAddOp1(tls, v, OP_NullRow, iTab)
 104700 		Xsqlite3VdbeJumpHere(tls, v, addrOnce)
 104701 
 104702 		Xsqlite3VdbeAddOp3(tls, v, OP_Return, *(*int32)(unsafe.Pointer(pExpr + 64 + 4)),
 104703 			*(*int32)(unsafe.Pointer(pExpr + 64)), 1)
 104704 
 104705 		Xsqlite3ClearTempRegCache(tls, pParse)
 104706 	}
 104707 }
 104708 
 104709 // Generate code for scalar subqueries used as a subquery expression
 104710 // or EXISTS operator:
 104711 //
 104712 //	(SELECT a FROM b)          -- subquery
 104713 //	EXISTS (SELECT a FROM b)   -- EXISTS subquery
 104714 //
 104715 // The pExpr parameter is the SELECT or EXISTS operator to be coded.
 104716 //
 104717 // Return the register that holds the result.  For a multi-column SELECT,
 104718 // the result is stored in a contiguous array of registers and the
 104719 // return value is the register of the left-most result column.
 104720 // Return 0 if an error occurs.
 104721 func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 {
 104722 	bp := tls.Alloc(64)
 104723 	defer tls.Free(64)
 104724 
 104725 	var addrOnce int32 = 0
 104726 	var rReg int32 = 0
 104727 	var pSel uintptr
 104728 
 104729 	var nReg int32
 104730 	var pLimit uintptr
 104731 
 104732 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 104733 
 104734 	if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 104735 		return 0
 104736 	}
 104737 
 104738 	pSel = *(*uintptr)(unsafe.Pointer(pExpr + 32))
 104739 
 104740 	if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Subrtn) != U32(0) {
 104741 		Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+9251, libc.VaList(bp, (*Select)(unsafe.Pointer(pSel)).FselId))
 104742 
 104743 		Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, *(*int32)(unsafe.Pointer(pExpr + 64 + 4)),
 104744 			*(*int32)(unsafe.Pointer(pExpr + 64)))
 104745 		return (*Expr)(unsafe.Pointer(pExpr)).FiTable
 104746 	}
 104747 
 104748 	*(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_Subrtn)
 104749 	*(*int32)(unsafe.Pointer(pExpr + 64 + 4)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 104750 	*(*int32)(unsafe.Pointer(pExpr + 64)) = Xsqlite3VdbeAddOp2(tls, v, OP_BeginSubrtn, 0, *(*int32)(unsafe.Pointer(pExpr + 64 + 4))) + 1
 104751 
 104752 	if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_VarSelect) != U32(0)) {
 104753 		addrOnce = Xsqlite3VdbeAddOp0(tls, v, OP_Once)
 104754 	}
 104755 
 104756 	Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+9269, libc.VaList(bp+8, func() uintptr {
 104757 		if addrOnce != 0 {
 104758 			return ts + 1544
 104759 		}
 104760 		return ts + 9239
 104761 	}(), (*Select)(unsafe.Pointer(pSel)).FselId))
 104762 
 104763 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_SELECT {
 104764 		nReg = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpEList)).FnExpr
 104765 	} else {
 104766 		nReg = 1
 104767 	}
 104768 	Xsqlite3SelectDestInit(tls, bp+24, 0, (*Parse)(unsafe.Pointer(pParse)).FnMem+1)
 104769 	*(*int32)(unsafe.Pointer(pParse + 56)) += nReg
 104770 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_SELECT {
 104771 		(*SelectDest)(unsafe.Pointer(bp + 24)).FeDest = U8(SRT_Mem)
 104772 		(*SelectDest)(unsafe.Pointer(bp + 24)).FiSdst = (*SelectDest)(unsafe.Pointer(bp + 24)).FiSDParm
 104773 		(*SelectDest)(unsafe.Pointer(bp + 24)).FnSdst = nReg
 104774 		Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, (*SelectDest)(unsafe.Pointer(bp+24)).FiSDParm, (*SelectDest)(unsafe.Pointer(bp+24)).FiSDParm+nReg-1)
 104775 
 104776 	} else {
 104777 		(*SelectDest)(unsafe.Pointer(bp + 24)).FeDest = U8(SRT_Exists)
 104778 		Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*SelectDest)(unsafe.Pointer(bp+24)).FiSDParm)
 104779 
 104780 	}
 104781 	if (*Select)(unsafe.Pointer(pSel)).FpLimit != 0 {
 104782 		var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 104783 		pLimit = Xsqlite3Expr(tls, db, TK_INTEGER, ts+8871)
 104784 		if pLimit != 0 {
 104785 			(*Expr)(unsafe.Pointer(pLimit)).FaffExpr = int8(SQLITE_AFF_NUMERIC)
 104786 			pLimit = Xsqlite3PExpr(tls, pParse, TK_NE,
 104787 				Xsqlite3ExprDup(tls, db, (*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpLimit)).FpLeft, 0), pLimit)
 104788 		}
 104789 		Xsqlite3ExprDeferredDelete(tls, pParse, (*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpLimit)).FpLeft)
 104790 		(*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpLimit)).FpLeft = pLimit
 104791 	} else {
 104792 		pLimit = Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_INTEGER, ts+9290)
 104793 		(*Select)(unsafe.Pointer(pSel)).FpLimit = Xsqlite3PExpr(tls, pParse, TK_LIMIT, pLimit, uintptr(0))
 104794 	}
 104795 	(*Select)(unsafe.Pointer(pSel)).FiLimit = 0
 104796 	if Xsqlite3Select(tls, pParse, pSel, bp+24) != 0 {
 104797 		(*Expr)(unsafe.Pointer(pExpr)).Fop2 = (*Expr)(unsafe.Pointer(pExpr)).Fop
 104798 		(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_ERROR)
 104799 		return 0
 104800 	}
 104801 	(*Expr)(unsafe.Pointer(pExpr)).FiTable = libc.AssignInt32(&rReg, (*SelectDest)(unsafe.Pointer(bp+24)).FiSDParm)
 104802 
 104803 	if addrOnce != 0 {
 104804 		Xsqlite3VdbeJumpHere(tls, v, addrOnce)
 104805 	}
 104806 
 104807 	Xsqlite3VdbeAddOp3(tls, v, OP_Return, *(*int32)(unsafe.Pointer(pExpr + 64 + 4)),
 104808 		*(*int32)(unsafe.Pointer(pExpr + 64)), 1)
 104809 
 104810 	Xsqlite3ClearTempRegCache(tls, pParse)
 104811 	return rReg
 104812 }
 104813 
 104814 // Expr pIn is an IN(...) expression. This function checks that the
 104815 // sub-select on the RHS of the IN() operator has the same number of
 104816 // columns as the vector on the LHS. Or, if the RHS of the IN() is not
 104817 // a sub-query, that the LHS is a vector of size 1.
 104818 func Xsqlite3ExprCheckIN(tls *libc.TLS, pParse uintptr, pIn uintptr) int32 {
 104819 	var nVector int32 = Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pIn)).FpLeft)
 104820 	if (*Expr)(unsafe.Pointer(pIn)).Fflags&U32(EP_xIsSelect) != U32(0) && !(int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed) != 0) {
 104821 		if nVector != (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIn + 32)))).FpEList)).FnExpr {
 104822 			Xsqlite3SubselectError(tls, pParse, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIn + 32)))).FpEList)).FnExpr, nVector)
 104823 			return 1
 104824 		}
 104825 	} else if nVector != 1 {
 104826 		Xsqlite3VectorErrorMsg(tls, pParse, (*Expr)(unsafe.Pointer(pIn)).FpLeft)
 104827 		return 1
 104828 	}
 104829 	return 0
 104830 }
 104831 
 104832 func sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFalse int32, destIfNull int32) {
 104833 	bp := tls.Alloc(16)
 104834 	defer tls.Free(16)
 104835 
 104836 	var eType int32
 104837 	var rLhs int32
 104838 	var rLhsOrig int32
 104839 	var v uintptr
 104840 	var aiMap uintptr
 104841 	var zAff uintptr
 104842 	var nVector int32
 104843 
 104844 	var pLeft uintptr
 104845 	var i int32
 104846 	var destStep2 int32
 104847 	var destStep6 int32
 104848 	var addrTruthOp int32
 104849 	var destNotNull int32
 104850 	var addrTop int32
 104851 
 104852 	var okConstFactor U8
 104853 	var op int32
 104854 	var op1 int32
 104855 	var pList uintptr
 104856 	var pColl uintptr
 104857 	var labelOk int32
 104858 	var r2 int32
 104859 
 104860 	var regCkNull int32
 104861 	var ii int32
 104862 	var p uintptr
 104863 	var p1 uintptr
 104864 	var pColl1 uintptr
 104865 	var r3 int32
 104866 	*(*int32)(unsafe.Pointer(bp)) = 0
 104867 	aiMap = uintptr(0)
 104868 	zAff = uintptr(0)
 104869 	destStep6 = 0
 104870 	*(*int32)(unsafe.Pointer(bp + 4)) = 0
 104871 	okConstFactor = (*Parse)(unsafe.Pointer(pParse)).FokConstFactor
 104872 
 104873 	pLeft = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
 104874 	if !(Xsqlite3ExprCheckIN(tls, pParse, pExpr) != 0) {
 104875 		goto __1
 104876 	}
 104877 	return
 104878 __1:
 104879 	;
 104880 	zAff = exprINAffinity(tls, pParse, pExpr)
 104881 	nVector = Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
 104882 	aiMap = Xsqlite3DbMallocZero(tls,
 104883 		(*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(nVector)*(uint64(unsafe.Sizeof(int32(0)))+uint64(unsafe.Sizeof(int8(0))))+uint64(1))
 104884 	if !((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) {
 104885 		goto __2
 104886 	}
 104887 	goto sqlite3ExprCodeIN_oom_error
 104888 __2:
 104889 	;
 104890 	v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 104891 
 104892 	eType = Xsqlite3FindInIndex(tls, pParse, pExpr,
 104893 		uint32(IN_INDEX_MEMBERSHIP|IN_INDEX_NOOP_OK),
 104894 		func() uintptr {
 104895 			if destIfFalse == destIfNull {
 104896 				return uintptr(0)
 104897 			}
 104898 			return bp
 104899 		}(),
 104900 		aiMap, bp+4)
 104901 
 104902 	(*Parse)(unsafe.Pointer(pParse)).FokConstFactor = U8(0)
 104903 	rLhsOrig = exprCodeVector(tls, pParse, pLeft, bp+8)
 104904 	(*Parse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor
 104905 	i = 0
 104906 __3:
 104907 	if !(i < nVector && *(*int32)(unsafe.Pointer(aiMap + uintptr(i)*4)) == i) {
 104908 		goto __5
 104909 	}
 104910 	goto __4
 104911 __4:
 104912 	i++
 104913 	goto __3
 104914 	goto __5
 104915 __5:
 104916 	;
 104917 	if !(i == nVector) {
 104918 		goto __6
 104919 	}
 104920 
 104921 	rLhs = rLhsOrig
 104922 	goto __7
 104923 __6:
 104924 	rLhs = Xsqlite3GetTempRange(tls, pParse, nVector)
 104925 	i = 0
 104926 __8:
 104927 	if !(i < nVector) {
 104928 		goto __10
 104929 	}
 104930 	Xsqlite3VdbeAddOp3(tls, v, OP_Copy, rLhsOrig+i, rLhs+*(*int32)(unsafe.Pointer(aiMap + uintptr(i)*4)), 0)
 104931 	goto __9
 104932 __9:
 104933 	i++
 104934 	goto __8
 104935 	goto __10
 104936 __10:
 104937 	;
 104938 __7:
 104939 	;
 104940 	if !(eType == IN_INDEX_NOOP) {
 104941 		goto __11
 104942 	}
 104943 	labelOk = Xsqlite3VdbeMakeLabel(tls, pParse)
 104944 	regCkNull = 0
 104945 
 104946 	pList = *(*uintptr)(unsafe.Pointer(pExpr + 32))
 104947 	pColl = Xsqlite3ExprCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
 104948 	if !(destIfNull != destIfFalse) {
 104949 		goto __12
 104950 	}
 104951 	regCkNull = Xsqlite3GetTempReg(tls, pParse)
 104952 	Xsqlite3VdbeAddOp3(tls, v, OP_BitAnd, rLhs, rLhs, regCkNull)
 104953 __12:
 104954 	;
 104955 	ii = 0
 104956 __13:
 104957 	if !(ii < (*ExprList)(unsafe.Pointer(pList)).FnExpr) {
 104958 		goto __15
 104959 	}
 104960 	r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(ii)*32)).FpExpr, bp+12)
 104961 	if !(regCkNull != 0 && Xsqlite3ExprCanBeNull(tls, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(ii)*32)).FpExpr) != 0) {
 104962 		goto __16
 104963 	}
 104964 	Xsqlite3VdbeAddOp3(tls, v, OP_BitAnd, regCkNull, r2, regCkNull)
 104965 __16:
 104966 	;
 104967 	Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 12)))
 104968 	if !(ii < (*ExprList)(unsafe.Pointer(pList)).FnExpr-1 || destIfNull != destIfFalse) {
 104969 		goto __17
 104970 	}
 104971 	if rLhs != r2 {
 104972 		op = OP_Eq
 104973 	} else {
 104974 		op = OP_NotNull
 104975 	}
 104976 	Xsqlite3VdbeAddOp4(tls, v, op, rLhs, labelOk, r2,
 104977 		pColl, -2)
 104978 
 104979 	Xsqlite3VdbeChangeP5(tls, v, uint16(*(*int8)(unsafe.Pointer(zAff))))
 104980 	goto __18
 104981 __17:
 104982 	if rLhs != r2 {
 104983 		op1 = OP_Ne
 104984 	} else {
 104985 		op1 = OP_IsNull
 104986 	}
 104987 
 104988 	Xsqlite3VdbeAddOp4(tls, v, op1, rLhs, destIfFalse, r2,
 104989 		pColl, -2)
 104990 
 104991 	Xsqlite3VdbeChangeP5(tls, v, uint16(int32(*(*int8)(unsafe.Pointer(zAff)))|SQLITE_JUMPIFNULL))
 104992 __18:
 104993 	;
 104994 	goto __14
 104995 __14:
 104996 	ii++
 104997 	goto __13
 104998 	goto __15
 104999 __15:
 105000 	;
 105001 	if !(regCkNull != 0) {
 105002 		goto __19
 105003 	}
 105004 	Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, regCkNull, destIfNull)
 105005 	Xsqlite3VdbeGoto(tls, v, destIfFalse)
 105006 __19:
 105007 	;
 105008 	Xsqlite3VdbeResolveLabel(tls, v, labelOk)
 105009 	Xsqlite3ReleaseTempReg(tls, pParse, regCkNull)
 105010 	goto sqlite3ExprCodeIN_finished
 105011 __11:
 105012 	;
 105013 	if !(destIfNull == destIfFalse) {
 105014 		goto __20
 105015 	}
 105016 	destStep2 = destIfFalse
 105017 	goto __21
 105018 __20:
 105019 	destStep2 = libc.AssignInt32(&destStep6, Xsqlite3VdbeMakeLabel(tls, pParse))
 105020 __21:
 105021 	;
 105022 	i = 0
 105023 __22:
 105024 	if !(i < nVector) {
 105025 		goto __24
 105026 	}
 105027 	p = Xsqlite3VectorFieldSubexpr(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, i)
 105028 	if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
 105029 		goto __25
 105030 	}
 105031 	goto sqlite3ExprCodeIN_oom_error
 105032 __25:
 105033 	;
 105034 	if !(Xsqlite3ExprCanBeNull(tls, p) != 0) {
 105035 		goto __26
 105036 	}
 105037 	Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, rLhs+i, destStep2)
 105038 
 105039 __26:
 105040 	;
 105041 	goto __23
 105042 __23:
 105043 	i++
 105044 	goto __22
 105045 	goto __24
 105046 __24:
 105047 	;
 105048 	if !(eType == IN_INDEX_ROWID) {
 105049 		goto __27
 105050 	}
 105051 
 105052 	Xsqlite3VdbeAddOp3(tls, v, OP_SeekRowid, *(*int32)(unsafe.Pointer(bp + 4)), destIfFalse, rLhs)
 105053 
 105054 	addrTruthOp = Xsqlite3VdbeAddOp0(tls, v, OP_Goto)
 105055 	goto __28
 105056 __27:
 105057 	Xsqlite3VdbeAddOp4(tls, v, OP_Affinity, rLhs, nVector, 0, zAff, nVector)
 105058 	if !(destIfFalse == destIfNull) {
 105059 		goto __29
 105060 	}
 105061 
 105062 	Xsqlite3VdbeAddOp4Int(tls, v, OP_NotFound, *(*int32)(unsafe.Pointer(bp + 4)), destIfFalse,
 105063 		rLhs, nVector)
 105064 	goto sqlite3ExprCodeIN_finished
 105065 __29:
 105066 	;
 105067 	addrTruthOp = Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, *(*int32)(unsafe.Pointer(bp + 4)), 0,
 105068 		rLhs, nVector)
 105069 __28:
 105070 	;
 105071 	if !(*(*int32)(unsafe.Pointer(bp)) != 0 && nVector == 1) {
 105072 		goto __30
 105073 	}
 105074 	Xsqlite3VdbeAddOp2(tls, v, OP_NotNull, *(*int32)(unsafe.Pointer(bp)), destIfFalse)
 105075 
 105076 __30:
 105077 	;
 105078 	if !(destIfFalse == destIfNull) {
 105079 		goto __31
 105080 	}
 105081 	Xsqlite3VdbeGoto(tls, v, destIfFalse)
 105082 __31:
 105083 	;
 105084 	if !(destStep6 != 0) {
 105085 		goto __32
 105086 	}
 105087 	Xsqlite3VdbeResolveLabel(tls, v, destStep6)
 105088 __32:
 105089 	;
 105090 	addrTop = Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, *(*int32)(unsafe.Pointer(bp + 4)), destIfFalse)
 105091 
 105092 	if !(nVector > 1) {
 105093 		goto __33
 105094 	}
 105095 	destNotNull = Xsqlite3VdbeMakeLabel(tls, pParse)
 105096 	goto __34
 105097 __33:
 105098 	destNotNull = destIfFalse
 105099 __34:
 105100 	;
 105101 	i = 0
 105102 __35:
 105103 	if !(i < nVector) {
 105104 		goto __37
 105105 	}
 105106 	r3 = Xsqlite3GetTempReg(tls, pParse)
 105107 	p1 = Xsqlite3VectorFieldSubexpr(tls, pLeft, i)
 105108 	pColl1 = Xsqlite3ExprCollSeq(tls, pParse, p1)
 105109 	Xsqlite3VdbeAddOp3(tls, v, OP_Column, *(*int32)(unsafe.Pointer(bp + 4)), i, r3)
 105110 	Xsqlite3VdbeAddOp4(tls, v, OP_Ne, rLhs+i, destNotNull, r3,
 105111 		pColl1, -2)
 105112 
 105113 	Xsqlite3ReleaseTempReg(tls, pParse, r3)
 105114 	goto __36
 105115 __36:
 105116 	i++
 105117 	goto __35
 105118 	goto __37
 105119 __37:
 105120 	;
 105121 	Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, destIfNull)
 105122 	if !(nVector > 1) {
 105123 		goto __38
 105124 	}
 105125 	Xsqlite3VdbeResolveLabel(tls, v, destNotNull)
 105126 	Xsqlite3VdbeAddOp2(tls, v, OP_Next, *(*int32)(unsafe.Pointer(bp + 4)), addrTop+1)
 105127 
 105128 	Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, destIfFalse)
 105129 __38:
 105130 	;
 105131 	Xsqlite3VdbeJumpHere(tls, v, addrTruthOp)
 105132 
 105133 sqlite3ExprCodeIN_finished:
 105134 	if !(rLhs != rLhsOrig) {
 105135 		goto __39
 105136 	}
 105137 	Xsqlite3ReleaseTempReg(tls, pParse, rLhs)
 105138 __39:
 105139 	;
 105140 sqlite3ExprCodeIN_oom_error:
 105141 	Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, aiMap)
 105142 	Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, zAff)
 105143 }
 105144 
 105145 func codeReal(tls *libc.TLS, v uintptr, z uintptr, negateFlag int32, iMem int32) {
 105146 	bp := tls.Alloc(8)
 105147 	defer tls.Free(8)
 105148 
 105149 	if z != uintptr(0) {
 105150 		Xsqlite3AtoF(tls, z, bp, Xsqlite3Strlen30(tls, z), uint8(SQLITE_UTF8))
 105151 
 105152 		if negateFlag != 0 {
 105153 			*(*float64)(unsafe.Pointer(bp)) = -*(*float64)(unsafe.Pointer(bp))
 105154 		}
 105155 		Xsqlite3VdbeAddOp4Dup8(tls, v, OP_Real, 0, iMem, 0, bp, -12)
 105156 	}
 105157 }
 105158 
 105159 func codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, iMem int32) {
 105160 	bp := tls.Alloc(24)
 105161 	defer tls.Free(24)
 105162 
 105163 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 105164 	if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_IntValue) != 0 {
 105165 		var i int32 = *(*int32)(unsafe.Pointer(pExpr + 8))
 105166 
 105167 		if negFlag != 0 {
 105168 			i = -i
 105169 		}
 105170 		Xsqlite3VdbeAddOp2(tls, v, OP_Integer, i, iMem)
 105171 	} else {
 105172 		var c int32
 105173 
 105174 		var z uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 8))
 105175 
 105176 		c = Xsqlite3DecOrHexToI64(tls, z, bp+16)
 105177 		if c == 3 && !(negFlag != 0) || c == 2 || negFlag != 0 && *(*I64)(unsafe.Pointer(bp + 16)) == int64(-1)-(int64(0xffffffff)|int64(0x7fffffff)<<32) {
 105178 			if Xsqlite3_strnicmp(tls, z, ts+9292, 2) == 0 {
 105179 				Xsqlite3ErrorMsg(tls, pParse, ts+9295,
 105180 					libc.VaList(bp, func() uintptr {
 105181 						if negFlag != 0 {
 105182 							return ts + 6284
 105183 						}
 105184 						return ts + 1544
 105185 					}(), pExpr))
 105186 			} else {
 105187 				codeReal(tls, v, z, negFlag, iMem)
 105188 			}
 105189 		} else {
 105190 			if negFlag != 0 {
 105191 				if c == 3 {
 105192 					*(*I64)(unsafe.Pointer(bp + 16)) = int64(-1) - (int64(0xffffffff) | int64(0x7fffffff)<<32)
 105193 				} else {
 105194 					*(*I64)(unsafe.Pointer(bp + 16)) = -*(*I64)(unsafe.Pointer(bp + 16))
 105195 				}
 105196 			}
 105197 			Xsqlite3VdbeAddOp4Dup8(tls, v, OP_Int64, 0, iMem, 0, bp+16, -13)
 105198 		}
 105199 	}
 105200 }
 105201 
 105202 // Generate code that will load into register regOut a value that is
 105203 // appropriate for the iIdxCol-th column of index pIdx.
 105204 func Xsqlite3ExprCodeLoadIndexColumn(tls *libc.TLS, pParse uintptr, pIdx uintptr, iTabCur int32, iIdxCol int32, regOut int32) {
 105205 	var iTabCol I16 = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iIdxCol)*2))
 105206 	if int32(iTabCol) == -2 {
 105207 		(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = iTabCur + 1
 105208 		Xsqlite3ExprCodeCopy(tls, pParse, (*ExprList_item)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaColExpr+8+uintptr(iIdxCol)*32)).FpExpr, regOut)
 105209 		(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = 0
 105210 	} else {
 105211 		Xsqlite3ExprCodeGetColumnOfTable(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, (*Index)(unsafe.Pointer(pIdx)).FpTable, iTabCur,
 105212 			int32(iTabCol), regOut)
 105213 	}
 105214 }
 105215 
 105216 // Generate code that will compute the value of generated column pCol
 105217 // and store the result in register regOut
 105218 func Xsqlite3ExprCodeGeneratedColumn(tls *libc.TLS, pParse uintptr, pTab uintptr, pCol uintptr, regOut int32) {
 105219 	var iAddr int32
 105220 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 105221 	var nErr int32 = (*Parse)(unsafe.Pointer(pParse)).FnErr
 105222 
 105223 	if (*Parse)(unsafe.Pointer(pParse)).FiSelfTab > 0 {
 105224 		iAddr = Xsqlite3VdbeAddOp3(tls, v, OP_IfNullRow, (*Parse)(unsafe.Pointer(pParse)).FiSelfTab-1, 0, regOut)
 105225 	} else {
 105226 		iAddr = 0
 105227 	}
 105228 	Xsqlite3ExprCodeCopy(tls, pParse, Xsqlite3ColumnExpr(tls, pTab, pCol), regOut)
 105229 	if int32((*Column)(unsafe.Pointer(pCol)).Faffinity) >= SQLITE_AFF_TEXT {
 105230 		Xsqlite3VdbeAddOp4(tls, v, OP_Affinity, regOut, 1, 0, pCol+10, 1)
 105231 	}
 105232 	if iAddr != 0 {
 105233 		Xsqlite3VdbeJumpHere(tls, v, iAddr)
 105234 	}
 105235 	if (*Parse)(unsafe.Pointer(pParse)).FnErr > nErr {
 105236 		(*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FerrByteOffset = -1
 105237 	}
 105238 }
 105239 
 105240 // Generate code to extract the value of the iCol-th column of a table.
 105241 func Xsqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iTabCur int32, iCol int32, regOut int32) {
 105242 	bp := tls.Alloc(8)
 105243 	defer tls.Free(8)
 105244 
 105245 	var pCol uintptr
 105246 
 105247 	if iCol < 0 || iCol == int32((*Table)(unsafe.Pointer(pTab)).FiPKey) {
 105248 		Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iTabCur, regOut)
 105249 
 105250 	} else {
 105251 		var op int32
 105252 		var x int32
 105253 		if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
 105254 			op = OP_VColumn
 105255 			x = iCol
 105256 		} else if int32((*Column)(unsafe.Pointer(libc.AssignUintptr(&pCol, (*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*24))).FcolFlags)&COLFLAG_VIRTUAL != 0 {
 105257 			var pParse uintptr = Xsqlite3VdbeParser(tls, v)
 105258 			if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_BUSY != 0 {
 105259 				Xsqlite3ErrorMsg(tls, pParse, ts+9322,
 105260 					libc.VaList(bp, (*Column)(unsafe.Pointer(pCol)).FzCnName))
 105261 			} else {
 105262 				var savedSelfTab int32 = (*Parse)(unsafe.Pointer(pParse)).FiSelfTab
 105263 				*(*U16)(unsafe.Pointer(pCol + 16)) |= U16(COLFLAG_BUSY)
 105264 				(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = iTabCur + 1
 105265 				Xsqlite3ExprCodeGeneratedColumn(tls, pParse, pTab, pCol, regOut)
 105266 				(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = savedSelfTab
 105267 				*(*U16)(unsafe.Pointer(pCol + 16)) &= libc.Uint16FromInt32(libc.CplInt32(COLFLAG_BUSY))
 105268 			}
 105269 			return
 105270 		} else if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 105271 			x = int32(Xsqlite3TableColumnToIndex(tls, Xsqlite3PrimaryKeyIndex(tls, pTab), int16(iCol)))
 105272 			op = OP_Column
 105273 		} else {
 105274 			x = int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(iCol)))
 105275 
 105276 			op = OP_Column
 105277 		}
 105278 		Xsqlite3VdbeAddOp3(tls, v, op, iTabCur, x, regOut)
 105279 		Xsqlite3ColumnDefault(tls, v, pTab, iCol, regOut)
 105280 	}
 105281 }
 105282 
 105283 // Generate code that will extract the iColumn-th column from
 105284 // table pTab and store the column value in register iReg.
 105285 //
 105286 // There must be an open cursor to pTab in iTable when this routine
 105287 // is called.  If iColumn<0 then code is generated that extracts the rowid.
 105288 func Xsqlite3ExprCodeGetColumn(tls *libc.TLS, pParse uintptr, pTab uintptr, iColumn int32, iTable int32, iReg int32, p5 U8) int32 {
 105289 	Xsqlite3ExprCodeGetColumnOfTable(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, pTab, iTable, iColumn, iReg)
 105290 	if p5 != 0 {
 105291 		var pOp uintptr = Xsqlite3VdbeGetLastOp(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe)
 105292 		if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Column {
 105293 			(*VdbeOp)(unsafe.Pointer(pOp)).Fp5 = U16(p5)
 105294 		}
 105295 	}
 105296 	return iReg
 105297 }
 105298 
 105299 // Generate code to move content from registers iFrom...iFrom+nReg-1
 105300 // over to iTo..iTo+nReg-1.
 105301 func Xsqlite3ExprCodeMove(tls *libc.TLS, pParse uintptr, iFrom int32, iTo int32, nReg int32) {
 105302 	Xsqlite3VdbeAddOp3(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, OP_Move, iFrom, iTo, nReg)
 105303 }
 105304 
 105305 func exprToRegister(tls *libc.TLS, pExpr uintptr, iReg int32) {
 105306 	var p uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, pExpr)
 105307 	if p == uintptr(0) {
 105308 		return
 105309 	}
 105310 	(*Expr)(unsafe.Pointer(p)).Fop2 = (*Expr)(unsafe.Pointer(p)).Fop
 105311 	(*Expr)(unsafe.Pointer(p)).Fop = U8(TK_REGISTER)
 105312 	(*Expr)(unsafe.Pointer(p)).FiTable = iReg
 105313 	*(*U32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(libc.CplInt32(EP_Skip))
 105314 }
 105315 
 105316 func exprCodeVector(tls *libc.TLS, pParse uintptr, p uintptr, piFreeable uintptr) int32 {
 105317 	var iResult int32
 105318 	var nResult int32 = Xsqlite3ExprVectorSize(tls, p)
 105319 	if nResult == 1 {
 105320 		iResult = Xsqlite3ExprCodeTemp(tls, pParse, p, piFreeable)
 105321 	} else {
 105322 		*(*int32)(unsafe.Pointer(piFreeable)) = 0
 105323 		if int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_SELECT {
 105324 			iResult = Xsqlite3CodeSubselect(tls, pParse, p)
 105325 		} else {
 105326 			var i int32
 105327 			iResult = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 105328 			*(*int32)(unsafe.Pointer(pParse + 56)) += nResult
 105329 
 105330 			for i = 0; i < nResult; i++ {
 105331 				Xsqlite3ExprCodeFactorable(tls, pParse, (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32))+8+uintptr(i)*32)).FpExpr, i+iResult)
 105332 			}
 105333 		}
 105334 	}
 105335 	return iResult
 105336 }
 105337 
 105338 func setDoNotMergeFlagOnCopy(tls *libc.TLS, v uintptr) {
 105339 	if int32((*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetLastOp(tls, v))).Fopcode) == OP_Copy {
 105340 		Xsqlite3VdbeChangeP5(tls, v, uint16(1))
 105341 	}
 105342 }
 105343 
 105344 func exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFuncId int32, target int32) int32 {
 105345 	bp := tls.Alloc(120)
 105346 	defer tls.Free(120)
 105347 
 105348 	var nFarg int32
 105349 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 105350 
 105351 	nFarg = (*ExprList)(unsafe.Pointer(pFarg)).FnExpr
 105352 
 105353 	switch iFuncId {
 105354 	case INLINEFUNC_coalesce:
 105355 		{
 105356 			var endCoalesce int32 = Xsqlite3VdbeMakeLabel(tls, pParse)
 105357 			var i int32
 105358 
 105359 			Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(pFarg+8)).FpExpr, target)
 105360 			for i = 1; i < nFarg; i++ {
 105361 				Xsqlite3VdbeAddOp2(tls, v, OP_NotNull, target, endCoalesce)
 105362 
 105363 				Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(pFarg+8+uintptr(i)*32)).FpExpr, target)
 105364 			}
 105365 			setDoNotMergeFlagOnCopy(tls, v)
 105366 			Xsqlite3VdbeResolveLabel(tls, v, endCoalesce)
 105367 			break
 105368 
 105369 		}
 105370 	case INLINEFUNC_iif:
 105371 		{
 105372 			libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Expr{})))
 105373 			(*Expr)(unsafe.Pointer(bp)).Fop = U8(TK_CASE)
 105374 			*(*uintptr)(unsafe.Pointer(bp + 32)) = pFarg
 105375 			return Xsqlite3ExprCodeTarget(tls, pParse, bp, target)
 105376 
 105377 		}
 105378 	case INLINEFUNC_sqlite_offset:
 105379 		{
 105380 			var pArg uintptr = (*ExprList_item)(unsafe.Pointer(pFarg + 8)).FpExpr
 105381 			if int32((*Expr)(unsafe.Pointer(pArg)).Fop) == TK_COLUMN && (*Expr)(unsafe.Pointer(pArg)).FiTable >= 0 {
 105382 				Xsqlite3VdbeAddOp3(tls, v, OP_Offset, (*Expr)(unsafe.Pointer(pArg)).FiTable, int32((*Expr)(unsafe.Pointer(pArg)).FiColumn), target)
 105383 			} else {
 105384 				Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, target)
 105385 			}
 105386 			break
 105387 
 105388 		}
 105389 	default:
 105390 		{
 105391 			target = Xsqlite3ExprCodeTarget(tls, pParse, (*ExprList_item)(unsafe.Pointer(pFarg+8)).FpExpr, target)
 105392 			break
 105393 
 105394 		}
 105395 
 105396 	case INLINEFUNC_expr_compare:
 105397 		{
 105398 			Xsqlite3VdbeAddOp2(tls, v, OP_Integer,
 105399 				Xsqlite3ExprCompare(tls, uintptr(0), (*ExprList_item)(unsafe.Pointer(pFarg+8)).FpExpr, (*ExprList_item)(unsafe.Pointer(pFarg+8+1*32)).FpExpr, -1),
 105400 				target)
 105401 			break
 105402 
 105403 		}
 105404 
 105405 	case INLINEFUNC_expr_implies_expr:
 105406 		{
 105407 			Xsqlite3VdbeAddOp2(tls, v, OP_Integer,
 105408 				Xsqlite3ExprImpliesExpr(tls, pParse, (*ExprList_item)(unsafe.Pointer(pFarg+8)).FpExpr, (*ExprList_item)(unsafe.Pointer(pFarg+8+1*32)).FpExpr, -1),
 105409 				target)
 105410 			break
 105411 
 105412 		}
 105413 
 105414 	case INLINEFUNC_implies_nonnull_row:
 105415 		{
 105416 			var pA1 uintptr
 105417 
 105418 			pA1 = (*ExprList_item)(unsafe.Pointer(pFarg + 8 + 1*32)).FpExpr
 105419 			if int32((*Expr)(unsafe.Pointer(pA1)).Fop) == TK_COLUMN {
 105420 				Xsqlite3VdbeAddOp2(tls, v, OP_Integer,
 105421 					Xsqlite3ExprImpliesNonNullRow(tls, (*ExprList_item)(unsafe.Pointer(pFarg+8)).FpExpr, (*Expr)(unsafe.Pointer(pA1)).FiTable),
 105422 					target)
 105423 			} else {
 105424 				Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, target)
 105425 			}
 105426 			break
 105427 
 105428 		}
 105429 
 105430 	case INLINEFUNC_affinity:
 105431 		{
 105432 			*(*[6]uintptr)(unsafe.Pointer(bp + 72)) = [6]uintptr{ts + 9352, ts + 9357, ts + 9362, ts + 7543,
 105433 				ts + 7538, ts + 9370}
 105434 			var aff int8
 105435 
 105436 			aff = Xsqlite3ExprAffinity(tls, (*ExprList_item)(unsafe.Pointer(pFarg+8)).FpExpr)
 105437 
 105438 			Xsqlite3VdbeLoadString(tls, v, target,
 105439 				func() uintptr {
 105440 					if int32(aff) <= SQLITE_AFF_NONE {
 105441 						return ts + 9378
 105442 					}
 105443 					return *(*uintptr)(unsafe.Pointer(bp + 72 + uintptr(int32(aff)-SQLITE_AFF_BLOB)*8))
 105444 				}())
 105445 			break
 105446 
 105447 		}
 105448 	}
 105449 	return target
 105450 }
 105451 
 105452 func sqlite3IndexedExprLookup(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) int32 {
 105453 	var p uintptr
 105454 	var v uintptr
 105455 	for p = (*Parse)(unsafe.Pointer(pParse)).FpIdxEpr; p != 0; p = (*IndexedExpr)(unsafe.Pointer(p)).FpIENext {
 105456 		var exprAff U8
 105457 		var iDataCur int32 = (*IndexedExpr)(unsafe.Pointer(p)).FiDataCur
 105458 		if iDataCur < 0 {
 105459 			continue
 105460 		}
 105461 		if (*Parse)(unsafe.Pointer(pParse)).FiSelfTab != 0 {
 105462 			if (*IndexedExpr)(unsafe.Pointer(p)).FiDataCur != (*Parse)(unsafe.Pointer(pParse)).FiSelfTab-1 {
 105463 				continue
 105464 			}
 105465 			iDataCur = -1
 105466 		}
 105467 		if Xsqlite3ExprCompare(tls, uintptr(0), pExpr, (*IndexedExpr)(unsafe.Pointer(p)).FpExpr, iDataCur) != 0 {
 105468 			continue
 105469 		}
 105470 
 105471 		exprAff = U8(Xsqlite3ExprAffinity(tls, pExpr))
 105472 		if int32(exprAff) <= SQLITE_AFF_BLOB && int32((*IndexedExpr)(unsafe.Pointer(p)).Faff) != SQLITE_AFF_BLOB ||
 105473 			int32(exprAff) == SQLITE_AFF_TEXT && int32((*IndexedExpr)(unsafe.Pointer(p)).Faff) != SQLITE_AFF_TEXT ||
 105474 			int32(exprAff) >= SQLITE_AFF_NUMERIC && int32((*IndexedExpr)(unsafe.Pointer(p)).Faff) != SQLITE_AFF_NUMERIC {
 105475 			continue
 105476 		}
 105477 
 105478 		v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 105479 
 105480 		if (*IndexedExpr)(unsafe.Pointer(p)).FbMaybeNullRow != 0 {
 105481 			var addr int32 = Xsqlite3VdbeCurrentAddr(tls, v)
 105482 			Xsqlite3VdbeAddOp3(tls, v, OP_IfNullRow, (*IndexedExpr)(unsafe.Pointer(p)).FiIdxCur, addr+3, target)
 105483 
 105484 			Xsqlite3VdbeAddOp3(tls, v, OP_Column, (*IndexedExpr)(unsafe.Pointer(p)).FiIdxCur, (*IndexedExpr)(unsafe.Pointer(p)).FiIdxCol, target)
 105485 
 105486 			Xsqlite3VdbeGoto(tls, v, 0)
 105487 			p = (*Parse)(unsafe.Pointer(pParse)).FpIdxEpr
 105488 			(*Parse)(unsafe.Pointer(pParse)).FpIdxEpr = uintptr(0)
 105489 			Xsqlite3ExprCode(tls, pParse, pExpr, target)
 105490 			(*Parse)(unsafe.Pointer(pParse)).FpIdxEpr = p
 105491 			Xsqlite3VdbeJumpHere(tls, v, addr+2)
 105492 		} else {
 105493 			Xsqlite3VdbeAddOp3(tls, v, OP_Column, (*IndexedExpr)(unsafe.Pointer(p)).FiIdxCur, (*IndexedExpr)(unsafe.Pointer(p)).FiIdxCol, target)
 105494 
 105495 		}
 105496 		return target
 105497 	}
 105498 	return -1
 105499 }
 105500 
 105501 // Generate code into the current Vdbe to evaluate the given
 105502 // expression.  Attempt to store the results in register "target".
 105503 // Return the register where results are stored.
 105504 //
 105505 // With this routine, there is no guarantee that results will
 105506 // be stored in target.  The result might be stored in some other
 105507 // register if it is convenient to do so.  The calling function
 105508 // must check the return code and move the results to the desired
 105509 // register.
 105510 func Xsqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) int32 {
 105511 	bp := tls.Alloc(192)
 105512 	defer tls.Free(192)
 105513 
 105514 	var v uintptr
 105515 	var op int32
 105516 	var inReg int32
 105517 
 105518 	var r1 int32
 105519 	var r2 int32
 105520 
 105521 	var p5 int32
 105522 	var pTab uintptr
 105523 	var pAggInfo uintptr
 105524 	var pCol uintptr
 105525 
 105526 	var aff int32
 105527 
 105528 	var pCol1 uintptr
 105529 	var pTab1 uintptr
 105530 	var iSrc int32
 105531 	var iCol int32
 105532 	var iTab int32
 105533 	var iReg int32
 105534 	var n int32
 105535 	var z uintptr
 105536 	var zBlob uintptr
 105537 	var z1 uintptr
 105538 	var pLeft uintptr
 105539 	var pLeft1 uintptr
 105540 	var isTrue int32
 105541 	var bNormal int32
 105542 	var addr int32
 105543 	var pInfo uintptr
 105544 	var exprOp U8
 105545 	var pFarg uintptr
 105546 	var nFarg int32
 105547 	var pDef uintptr
 105548 	var zId uintptr
 105549 	var constMask U32
 105550 	var i int32
 105551 	var db uintptr
 105552 	var enc U8
 105553 	var pColl uintptr
 105554 	var nCol int32
 105555 	var n1 int32
 105556 	var pLeft2 uintptr
 105557 	var destIfFalse int32
 105558 	var destIfNull int32
 105559 
 105560 	var pTab2 uintptr
 105561 	var iCol1 int32
 105562 	var p1 int32
 105563 	var addrINR int32
 105564 	var okConstFactor U8
 105565 	var pAggInfo1 uintptr
 105566 	var endLabel int32
 105567 	var nextCase int32
 105568 	var nExpr int32
 105569 	var i1 int32
 105570 	var pEList uintptr
 105571 	var aListelem uintptr
 105572 
 105573 	var pX uintptr
 105574 	var pTest uintptr
 105575 	var pDel uintptr
 105576 	var db1 uintptr
 105577 	v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 105578 	inReg = target
 105579 	*(*int32)(unsafe.Pointer(bp + 40)) = 0
 105580 	*(*int32)(unsafe.Pointer(bp + 44)) = 0
 105581 	p5 = 0
 105582 
 105583 expr_code_doover:
 105584 	if !(pExpr == uintptr(0)) {
 105585 		goto __1
 105586 	}
 105587 	op = TK_NULL
 105588 	goto __2
 105589 __1:
 105590 	if !((*Parse)(unsafe.Pointer(pParse)).FpIdxEpr != uintptr(0) &&
 105591 		!((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Leaf) != U32(0)) &&
 105592 		libc.AssignInt32(&r1, sqlite3IndexedExprLookup(tls, pParse, pExpr, target)) >= 0) {
 105593 		goto __3
 105594 	}
 105595 	return r1
 105596 	goto __4
 105597 __3:
 105598 	;
 105599 	op = int32((*Expr)(unsafe.Pointer(pExpr)).Fop)
 105600 __4:
 105601 	;
 105602 __2:
 105603 	;
 105604 	switch op {
 105605 	case TK_AGG_COLUMN:
 105606 		goto __6
 105607 	case TK_COLUMN:
 105608 		goto __7
 105609 	case TK_INTEGER:
 105610 		goto __8
 105611 	case TK_TRUEFALSE:
 105612 		goto __9
 105613 	case TK_FLOAT:
 105614 		goto __10
 105615 	case TK_STRING:
 105616 		goto __11
 105617 	default:
 105618 		goto __12
 105619 	case TK_BLOB:
 105620 		goto __13
 105621 	case TK_VARIABLE:
 105622 		goto __14
 105623 	case TK_REGISTER:
 105624 		goto __15
 105625 	case TK_CAST:
 105626 		goto __16
 105627 	case TK_IS:
 105628 		goto __17
 105629 	case TK_ISNOT:
 105630 		goto __18
 105631 
 105632 	case TK_LT:
 105633 		goto __19
 105634 	case TK_LE:
 105635 		goto __20
 105636 	case TK_GT:
 105637 		goto __21
 105638 	case TK_GE:
 105639 		goto __22
 105640 	case TK_NE:
 105641 		goto __23
 105642 	case TK_EQ:
 105643 		goto __24
 105644 	case TK_AND:
 105645 		goto __25
 105646 	case TK_OR:
 105647 		goto __26
 105648 	case TK_PLUS:
 105649 		goto __27
 105650 	case TK_STAR:
 105651 		goto __28
 105652 	case TK_MINUS:
 105653 		goto __29
 105654 	case TK_REM:
 105655 		goto __30
 105656 	case TK_BITAND:
 105657 		goto __31
 105658 	case TK_BITOR:
 105659 		goto __32
 105660 	case TK_SLASH:
 105661 		goto __33
 105662 	case TK_LSHIFT:
 105663 		goto __34
 105664 	case TK_RSHIFT:
 105665 		goto __35
 105666 	case TK_CONCAT:
 105667 		goto __36
 105668 	case TK_UMINUS:
 105669 		goto __37
 105670 	case TK_BITNOT:
 105671 		goto __38
 105672 	case TK_NOT:
 105673 		goto __39
 105674 	case TK_TRUTH:
 105675 		goto __40
 105676 	case TK_ISNULL:
 105677 		goto __41
 105678 	case TK_NOTNULL:
 105679 		goto __42
 105680 	case TK_AGG_FUNCTION:
 105681 		goto __43
 105682 	case TK_FUNCTION:
 105683 		goto __44
 105684 	case TK_EXISTS:
 105685 		goto __45
 105686 	case TK_SELECT:
 105687 		goto __46
 105688 	case TK_SELECT_COLUMN:
 105689 		goto __47
 105690 	case TK_IN:
 105691 		goto __48
 105692 
 105693 	case TK_BETWEEN:
 105694 		goto __49
 105695 	case TK_COLLATE:
 105696 		goto __50
 105697 	case TK_SPAN:
 105698 		goto __51
 105699 	case TK_UPLUS:
 105700 		goto __52
 105701 
 105702 	case TK_TRIGGER:
 105703 		goto __53
 105704 
 105705 	case TK_VECTOR:
 105706 		goto __54
 105707 
 105708 	case TK_IF_NULL_ROW:
 105709 		goto __55
 105710 
 105711 	case TK_CASE:
 105712 		goto __56
 105713 	case TK_RAISE:
 105714 		goto __57
 105715 	}
 105716 	goto __5
 105717 __6:
 105718 	pAggInfo = (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo
 105719 
 105720 	pCol = (*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiAgg)*24
 105721 	if !!(int32((*AggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode) != 0) {
 105722 		goto __58
 105723 	}
 105724 	return func() int32 {
 105725 		return (*AggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg + int32((*Expr)(unsafe.Pointer(pExpr)).FiAgg)
 105726 	}()
 105727 	goto __59
 105728 __58:
 105729 	if !((*AggInfo)(unsafe.Pointer(pAggInfo)).FuseSortingIdx != 0) {
 105730 		goto __60
 105731 	}
 105732 	pTab = (*AggInfo_col)(unsafe.Pointer(pCol)).FpTab
 105733 	Xsqlite3VdbeAddOp3(tls, v, OP_Column, (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab,
 105734 		int32((*AggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn), target)
 105735 	if !(pTab == uintptr(0)) {
 105736 		goto __62
 105737 	}
 105738 
 105739 	goto __63
 105740 __62:
 105741 	if !(int32((*AggInfo_col)(unsafe.Pointer(pCol)).FiColumn) < 0) {
 105742 		goto __64
 105743 	}
 105744 
 105745 	goto __65
 105746 __64:
 105747 	;
 105748 	if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr((*AggInfo_col)(unsafe.Pointer(pCol)).FiColumn)*24)).Faffinity) == SQLITE_AFF_REAL) {
 105749 		goto __66
 105750 	}
 105751 	Xsqlite3VdbeAddOp1(tls, v, OP_RealAffinity, target)
 105752 __66:
 105753 	;
 105754 __65:
 105755 	;
 105756 __63:
 105757 	;
 105758 	return target
 105759 	goto __61
 105760 __60:
 105761 	if !(*(*uintptr)(unsafe.Pointer(pExpr + 64)) == uintptr(0)) {
 105762 		goto __67
 105763 	}
 105764 
 105765 	Xsqlite3VdbeAddOp3(tls, v, OP_Column, (*Expr)(unsafe.Pointer(pExpr)).FiTable, int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn), target)
 105766 	return target
 105767 __67:
 105768 	;
 105769 __61:
 105770 	;
 105771 __59:
 105772 	;
 105773 __7:
 105774 	iTab = (*Expr)(unsafe.Pointer(pExpr)).FiTable
 105775 	if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FixedCol) != U32(0)) {
 105776 		goto __68
 105777 	}
 105778 	iReg = Xsqlite3ExprCodeTarget(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, target)
 105779 
 105780 	aff = int32(Xsqlite3TableColumnAffinity(tls, *(*uintptr)(unsafe.Pointer(pExpr + 64)), int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)))
 105781 	if !(aff > SQLITE_AFF_BLOB) {
 105782 		goto __69
 105783 	}
 105784 
 105785 	Xsqlite3VdbeAddOp4(tls, v, OP_Affinity, iReg, 1, 0,
 105786 		uintptr(unsafe.Pointer(&zAff))+uintptr((aff-'B')*2), -1)
 105787 __69:
 105788 	;
 105789 	return iReg
 105790 __68:
 105791 	;
 105792 	if !(iTab < 0) {
 105793 		goto __70
 105794 	}
 105795 	if !((*Parse)(unsafe.Pointer(pParse)).FiSelfTab < 0) {
 105796 		goto __71
 105797 	}
 105798 	iCol = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)
 105799 
 105800 	pTab1 = *(*uintptr)(unsafe.Pointer(pExpr + 64))
 105801 
 105802 	if !(iCol < 0) {
 105803 		goto __73
 105804 	}
 105805 	return -1 - (*Parse)(unsafe.Pointer(pParse)).FiSelfTab
 105806 __73:
 105807 	;
 105808 	pCol1 = (*Table)(unsafe.Pointer(pTab1)).FaCol + uintptr(iCol)*24
 105809 
 105810 	iSrc = int32(Xsqlite3TableColumnToStorage(tls, pTab1, int16(iCol))) - (*Parse)(unsafe.Pointer(pParse)).FiSelfTab
 105811 	if !(int32((*Column)(unsafe.Pointer(pCol1)).FcolFlags)&COLFLAG_GENERATED != 0) {
 105812 		goto __74
 105813 	}
 105814 	if !(int32((*Column)(unsafe.Pointer(pCol1)).FcolFlags)&COLFLAG_BUSY != 0) {
 105815 		goto __76
 105816 	}
 105817 	Xsqlite3ErrorMsg(tls, pParse, ts+9322,
 105818 		libc.VaList(bp, (*Column)(unsafe.Pointer(pCol1)).FzCnName))
 105819 	return 0
 105820 __76:
 105821 	;
 105822 	*(*U16)(unsafe.Pointer(pCol1 + 16)) |= U16(COLFLAG_BUSY)
 105823 	if !(int32((*Column)(unsafe.Pointer(pCol1)).FcolFlags)&COLFLAG_NOTAVAIL != 0) {
 105824 		goto __77
 105825 	}
 105826 	Xsqlite3ExprCodeGeneratedColumn(tls, pParse, pTab1, pCol1, iSrc)
 105827 __77:
 105828 	;
 105829 	*(*U16)(unsafe.Pointer(pCol1 + 16)) &= libc.Uint16FromInt32(libc.CplInt32(COLFLAG_BUSY | COLFLAG_NOTAVAIL))
 105830 	return iSrc
 105831 	goto __75
 105832 __74:
 105833 	if !(int32((*Column)(unsafe.Pointer(pCol1)).Faffinity) == SQLITE_AFF_REAL) {
 105834 		goto __78
 105835 	}
 105836 	Xsqlite3VdbeAddOp2(tls, v, OP_SCopy, iSrc, target)
 105837 	Xsqlite3VdbeAddOp1(tls, v, OP_RealAffinity, target)
 105838 	return target
 105839 	goto __79
 105840 __78:
 105841 	return iSrc
 105842 __79:
 105843 	;
 105844 __75:
 105845 	;
 105846 	goto __72
 105847 __71:
 105848 	iTab = (*Parse)(unsafe.Pointer(pParse)).FiSelfTab - 1
 105849 __72:
 105850 	;
 105851 __70:
 105852 	;
 105853 	iReg = Xsqlite3ExprCodeGetColumn(tls, pParse, *(*uintptr)(unsafe.Pointer(pExpr + 64)),
 105854 		int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn), iTab, target,
 105855 		(*Expr)(unsafe.Pointer(pExpr)).Fop2)
 105856 	return iReg
 105857 
 105858 __8:
 105859 	codeInteger(tls, pParse, pExpr, 0, target)
 105860 	return target
 105861 
 105862 __9:
 105863 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, Xsqlite3ExprTruthValue(tls, pExpr), target)
 105864 	return target
 105865 
 105866 __10:
 105867 	;
 105868 	codeReal(tls, v, *(*uintptr)(unsafe.Pointer(pExpr + 8)), 0, target)
 105869 	return target
 105870 
 105871 __11:
 105872 	;
 105873 	Xsqlite3VdbeLoadString(tls, v, target, *(*uintptr)(unsafe.Pointer(pExpr + 8)))
 105874 	return target
 105875 
 105876 __12:
 105877 	;
 105878 	Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, target)
 105879 	return target
 105880 
 105881 __13:
 105882 	;
 105883 	z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) + 2
 105884 	n = Xsqlite3Strlen30(tls, z) - 1
 105885 
 105886 	zBlob = Xsqlite3HexToBlob(tls, Xsqlite3VdbeDb(tls, v), z, n)
 105887 	Xsqlite3VdbeAddOp4(tls, v, OP_Blob, n/2, target, 0, zBlob, -6)
 105888 	return target
 105889 
 105890 __14:
 105891 	;
 105892 	Xsqlite3VdbeAddOp2(tls, v, OP_Variable, int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn), target)
 105893 	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 8)) + 1))) != 0) {
 105894 		goto __80
 105895 	}
 105896 	z1 = Xsqlite3VListNumToName(tls, (*Parse)(unsafe.Pointer(pParse)).FpVList, int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn))
 105897 
 105898 	*(*VList)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).FpVList)) = 0
 105899 	Xsqlite3VdbeAppendP4(tls, v, z1, -1)
 105900 __80:
 105901 	;
 105902 	return target
 105903 
 105904 __15:
 105905 	return (*Expr)(unsafe.Pointer(pExpr)).FiTable
 105906 
 105907 __16:
 105908 	inReg = Xsqlite3ExprCodeTarget(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, target)
 105909 	if !(inReg != target) {
 105910 		goto __81
 105911 	}
 105912 	Xsqlite3VdbeAddOp2(tls, v, OP_SCopy, inReg, target)
 105913 	inReg = target
 105914 __81:
 105915 	;
 105916 	Xsqlite3VdbeAddOp2(tls, v, OP_Cast, target,
 105917 		int32(Xsqlite3AffinityType(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), uintptr(0))))
 105918 	return inReg
 105919 
 105920 __17:
 105921 __18:
 105922 	if op == TK_IS {
 105923 		op = TK_EQ
 105924 	} else {
 105925 		op = TK_NE
 105926 	}
 105927 	p5 = SQLITE_NULLEQ
 105928 
 105929 __19:
 105930 __20:
 105931 __21:
 105932 __22:
 105933 __23:
 105934 __24:
 105935 	pLeft = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
 105936 	if !(Xsqlite3ExprIsVector(tls, pLeft) != 0) {
 105937 		goto __82
 105938 	}
 105939 	codeVectorCompare(tls, pParse, pExpr, target, uint8(op), uint8(p5))
 105940 	goto __83
 105941 __82:
 105942 	r1 = Xsqlite3ExprCodeTemp(tls, pParse, pLeft, bp+40)
 105943 	r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+44)
 105944 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, inReg)
 105945 	codeCompare(tls, pParse, pLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight, op, r1, r2,
 105946 		Xsqlite3VdbeCurrentAddr(tls, v)+2, p5,
 105947 		libc.Bool32((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Commuted) != U32(0)))
 105948 
 105949 	if !(p5 == SQLITE_NULLEQ) {
 105950 		goto __84
 105951 	}
 105952 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, inReg)
 105953 	goto __85
 105954 __84:
 105955 	Xsqlite3VdbeAddOp3(tls, v, OP_ZeroOrNull, r1, inReg, r2)
 105956 __85:
 105957 	;
 105958 __83:
 105959 	;
 105960 	goto __5
 105961 
 105962 __25:
 105963 __26:
 105964 __27:
 105965 __28:
 105966 __29:
 105967 __30:
 105968 __31:
 105969 __32:
 105970 __33:
 105971 __34:
 105972 __35:
 105973 __36:
 105974 	;
 105975 	r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp+40)
 105976 	r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+44)
 105977 	Xsqlite3VdbeAddOp3(tls, v, op, r2, r1, target)
 105978 
 105979 	goto __5
 105980 
 105981 __37:
 105982 	pLeft1 = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
 105983 
 105984 	if !(int32((*Expr)(unsafe.Pointer(pLeft1)).Fop) == TK_INTEGER) {
 105985 		goto __86
 105986 	}
 105987 	codeInteger(tls, pParse, pLeft1, 1, target)
 105988 	return target
 105989 	goto __87
 105990 __86:
 105991 	if !(int32((*Expr)(unsafe.Pointer(pLeft1)).Fop) == TK_FLOAT) {
 105992 		goto __88
 105993 	}
 105994 
 105995 	codeReal(tls, v, *(*uintptr)(unsafe.Pointer(pLeft1 + 8)), 1, target)
 105996 	return target
 105997 	goto __89
 105998 __88:
 105999 	(*Expr)(unsafe.Pointer(bp + 48)).Fop = U8(TK_INTEGER)
 106000 	(*Expr)(unsafe.Pointer(bp + 48)).Fflags = U32(EP_IntValue | EP_TokenOnly)
 106001 	*(*int32)(unsafe.Pointer(bp + 48 + 8)) = 0
 106002 
 106003 	r1 = Xsqlite3ExprCodeTemp(tls, pParse, bp+48, bp+40)
 106004 	r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp+44)
 106005 	Xsqlite3VdbeAddOp3(tls, v, OP_Subtract, r2, r1, target)
 106006 
 106007 __89:
 106008 	;
 106009 __87:
 106010 	;
 106011 	goto __5
 106012 
 106013 __38:
 106014 __39:
 106015 	;
 106016 	r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp+40)
 106017 
 106018 	Xsqlite3VdbeAddOp2(tls, v, op, r1, inReg)
 106019 	goto __5
 106020 
 106021 __40:
 106022 	r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp+40)
 106023 
 106024 	isTrue = Xsqlite3ExprTruthValue(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
 106025 	bNormal = libc.Bool32(int32((*Expr)(unsafe.Pointer(pExpr)).Fop2) == TK_IS)
 106026 
 106027 	Xsqlite3VdbeAddOp4Int(tls, v, OP_IsTrue, r1, inReg, libc.BoolInt32(!(isTrue != 0)), isTrue^bNormal)
 106028 	goto __5
 106029 
 106030 __41:
 106031 __42:
 106032 	;
 106033 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, target)
 106034 	r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp+40)
 106035 
 106036 	addr = Xsqlite3VdbeAddOp1(tls, v, op, r1)
 106037 
 106038 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, target)
 106039 	Xsqlite3VdbeJumpHere(tls, v, addr)
 106040 	goto __5
 106041 
 106042 __43:
 106043 	pInfo = (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo
 106044 	if !(pInfo == uintptr(0) ||
 106045 		int32((*Expr)(unsafe.Pointer(pExpr)).FiAgg) < 0 ||
 106046 		int32((*Expr)(unsafe.Pointer(pExpr)).FiAgg) >= (*AggInfo)(unsafe.Pointer(pInfo)).FnFunc) {
 106047 		goto __90
 106048 	}
 106049 
 106050 	Xsqlite3ErrorMsg(tls, pParse, ts+9383, libc.VaList(bp+8, pExpr))
 106051 	goto __91
 106052 __90:
 106053 	return func() int32 {
 106054 		return (*AggInfo)(unsafe.Pointer(pInfo)).FiFirstReg + (*AggInfo)(unsafe.Pointer(pInfo)).FnColumn + int32((*Expr)(unsafe.Pointer(pExpr)).FiAgg)
 106055 	}()
 106056 __91:
 106057 	;
 106058 	goto __5
 106059 
 106060 __44:
 106061 	constMask = U32(0)
 106062 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 106063 	enc = (*Sqlite3)(unsafe.Pointer(db)).Fenc
 106064 	pColl = uintptr(0)
 106065 
 106066 	if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0)) {
 106067 		goto __92
 106068 	}
 106069 	return (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64)))).FregResult
 106070 __92:
 106071 	;
 106072 	if !((*Parse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && Xsqlite3ExprIsConstantNotJoin(tls, pExpr) != 0) {
 106073 		goto __93
 106074 	}
 106075 
 106076 	return Xsqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -1)
 106077 __93:
 106078 	;
 106079 	pFarg = *(*uintptr)(unsafe.Pointer(pExpr + 32))
 106080 	if pFarg != 0 {
 106081 		nFarg = (*ExprList)(unsafe.Pointer(pFarg)).FnExpr
 106082 	} else {
 106083 		nFarg = 0
 106084 	}
 106085 
 106086 	zId = *(*uintptr)(unsafe.Pointer(pExpr + 8))
 106087 	pDef = Xsqlite3FindFunction(tls, db, zId, nFarg, enc, uint8(0))
 106088 	if !(pDef == uintptr(0) || (*FuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0)) {
 106089 		goto __94
 106090 	}
 106091 	Xsqlite3ErrorMsg(tls, pParse, ts+9410, libc.VaList(bp+16, pExpr))
 106092 	goto __5
 106093 __94:
 106094 	;
 106095 	if !((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_INLINE) != 0) {
 106096 		goto __95
 106097 	}
 106098 
 106099 	return exprCodeInlineFunction(tls, pParse, pFarg,
 106100 		int32((*FuncDef)(unsafe.Pointer(pDef)).FpUserData), target)
 106101 	goto __96
 106102 __95:
 106103 	if !((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_DIRECT|SQLITE_FUNC_UNSAFE) != 0) {
 106104 		goto __97
 106105 	}
 106106 	Xsqlite3ExprFunctionUsable(tls, pParse, pExpr, pDef)
 106107 __97:
 106108 	;
 106109 __96:
 106110 	;
 106111 	i = 0
 106112 __98:
 106113 	if !(i < nFarg) {
 106114 		goto __100
 106115 	}
 106116 	if !(i < 32 && Xsqlite3ExprIsConstant(tls, (*ExprList_item)(unsafe.Pointer(pFarg+8+uintptr(i)*32)).FpExpr) != 0) {
 106117 		goto __101
 106118 	}
 106119 
 106120 	constMask = constMask | uint32(1)<<i
 106121 __101:
 106122 	;
 106123 	if !((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_NEEDCOLL) != U32(0) && !(pColl != 0)) {
 106124 		goto __102
 106125 	}
 106126 	pColl = Xsqlite3ExprCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer(pFarg+8+uintptr(i)*32)).FpExpr)
 106127 __102:
 106128 	;
 106129 	goto __99
 106130 __99:
 106131 	i++
 106132 	goto __98
 106133 	goto __100
 106134 __100:
 106135 	;
 106136 	if !(pFarg != 0) {
 106137 		goto __103
 106138 	}
 106139 	if !(constMask != 0) {
 106140 		goto __105
 106141 	}
 106142 	r1 = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 106143 	*(*int32)(unsafe.Pointer(pParse + 56)) += nFarg
 106144 	goto __106
 106145 __105:
 106146 	r1 = Xsqlite3GetTempRange(tls, pParse, nFarg)
 106147 __106:
 106148 	;
 106149 	if !((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_LENGTH|SQLITE_FUNC_TYPEOF) != U32(0)) {
 106150 		goto __107
 106151 	}
 106152 
 106153 	exprOp = (*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(pFarg + 8)).FpExpr)).Fop
 106154 	if !(int32(exprOp) == TK_COLUMN || int32(exprOp) == TK_AGG_COLUMN) {
 106155 		goto __108
 106156 	}
 106157 
 106158 	(*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(pFarg + 8)).FpExpr)).Fop2 = U8((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(OPFLAG_LENGTHARG|OPFLAG_TYPEOFARG))
 106159 __108:
 106160 	;
 106161 __107:
 106162 	;
 106163 	Xsqlite3ExprCodeExprList(tls, pParse, pFarg, r1, 0,
 106164 		uint8(SQLITE_ECEL_DUP|SQLITE_ECEL_FACTOR))
 106165 	goto __104
 106166 __103:
 106167 	r1 = 0
 106168 __104:
 106169 	;
 106170 	if !(nFarg >= 2 && (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_InfixFunc) != U32(0)) {
 106171 		goto __109
 106172 	}
 106173 	pDef = Xsqlite3VtabOverloadFunction(tls, db, pDef, nFarg, (*ExprList_item)(unsafe.Pointer(pFarg+8+1*32)).FpExpr)
 106174 	goto __110
 106175 __109:
 106176 	if !(nFarg > 0) {
 106177 		goto __111
 106178 	}
 106179 	pDef = Xsqlite3VtabOverloadFunction(tls, db, pDef, nFarg, (*ExprList_item)(unsafe.Pointer(pFarg+8)).FpExpr)
 106180 __111:
 106181 	;
 106182 __110:
 106183 	;
 106184 	if !((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_NEEDCOLL) != 0) {
 106185 		goto __112
 106186 	}
 106187 	if !!(pColl != 0) {
 106188 		goto __113
 106189 	}
 106190 	pColl = (*Sqlite3)(unsafe.Pointer(db)).FpDfltColl
 106191 __113:
 106192 	;
 106193 	Xsqlite3VdbeAddOp4(tls, v, OP_CollSeq, 0, 0, 0, pColl, -2)
 106194 __112:
 106195 	;
 106196 	Xsqlite3VdbeAddFunctionCall(tls, pParse, int32(constMask), r1, target, nFarg,
 106197 		pDef, int32((*Expr)(unsafe.Pointer(pExpr)).Fop2))
 106198 	if !(nFarg != 0) {
 106199 		goto __114
 106200 	}
 106201 	if !(constMask == U32(0)) {
 106202 		goto __115
 106203 	}
 106204 	Xsqlite3ReleaseTempRange(tls, pParse, r1, nFarg)
 106205 	goto __116
 106206 __115:
 106207 	;
 106208 __116:
 106209 	;
 106210 __114:
 106211 	;
 106212 	return target
 106213 
 106214 __45:
 106215 __46:
 106216 	;
 106217 	if !((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) {
 106218 		goto __117
 106219 	}
 106220 	return 0
 106221 	goto __118
 106222 __117:
 106223 	if !(op == TK_SELECT &&
 106224 		(*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) &&
 106225 		libc.AssignInt32(&nCol, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FpEList)).FnExpr) != 1) {
 106226 		goto __119
 106227 	}
 106228 	Xsqlite3SubselectError(tls, pParse, nCol, 1)
 106229 	goto __120
 106230 __119:
 106231 	return Xsqlite3CodeSubselect(tls, pParse, pExpr)
 106232 __120:
 106233 	;
 106234 __118:
 106235 	;
 106236 	goto __5
 106237 
 106238 __47:
 106239 	pLeft2 = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
 106240 	if !((*Expr)(unsafe.Pointer(pLeft2)).FiTable == 0 || int32((*Parse)(unsafe.Pointer(pParse)).FwithinRJSubrtn) > int32((*Expr)(unsafe.Pointer(pLeft2)).Fop2)) {
 106241 		goto __121
 106242 	}
 106243 	(*Expr)(unsafe.Pointer(pLeft2)).FiTable = Xsqlite3CodeSubselect(tls, pParse, pLeft2)
 106244 	(*Expr)(unsafe.Pointer(pLeft2)).Fop2 = (*Parse)(unsafe.Pointer(pParse)).FwithinRJSubrtn
 106245 __121:
 106246 	;
 106247 	n1 = Xsqlite3ExprVectorSize(tls, pLeft2)
 106248 	if !((*Expr)(unsafe.Pointer(pExpr)).FiTable != n1) {
 106249 		goto __122
 106250 	}
 106251 	Xsqlite3ErrorMsg(tls, pParse, ts+8993,
 106252 		libc.VaList(bp+24, (*Expr)(unsafe.Pointer(pExpr)).FiTable, n1))
 106253 __122:
 106254 	;
 106255 	return (*Expr)(unsafe.Pointer(pLeft2)).FiTable + int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)
 106256 
 106257 __48:
 106258 	destIfFalse = Xsqlite3VdbeMakeLabel(tls, pParse)
 106259 	destIfNull = Xsqlite3VdbeMakeLabel(tls, pParse)
 106260 	Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, target)
 106261 	sqlite3ExprCodeIN(tls, pParse, pExpr, destIfFalse, destIfNull)
 106262 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, target)
 106263 	Xsqlite3VdbeResolveLabel(tls, v, destIfFalse)
 106264 	Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, target, 0)
 106265 	Xsqlite3VdbeResolveLabel(tls, v, destIfNull)
 106266 	return target
 106267 
 106268 __49:
 106269 	exprCodeBetween(tls, pParse, pExpr, target, uintptr(0), 0)
 106270 	return target
 106271 
 106272 __50:
 106273 	if !!((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Collate) != U32(0)) {
 106274 		goto __123
 106275 	}
 106276 
 106277 	inReg = Xsqlite3ExprCodeTarget(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, target)
 106278 	if !(inReg != target) {
 106279 		goto __125
 106280 	}
 106281 	Xsqlite3VdbeAddOp2(tls, v, OP_SCopy, inReg, target)
 106282 	inReg = target
 106283 __125:
 106284 	;
 106285 	Xsqlite3VdbeAddOp1(tls, v, OP_ClrSubtype, inReg)
 106286 	return inReg
 106287 	goto __124
 106288 __123:
 106289 	pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
 106290 	goto expr_code_doover
 106291 __124:
 106292 	;
 106293 __51:
 106294 __52:
 106295 	pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
 106296 	goto expr_code_doover
 106297 
 106298 __53:
 106299 	;
 106300 	pTab2 = *(*uintptr)(unsafe.Pointer(pExpr + 64))
 106301 	iCol1 = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)
 106302 	p1 = (*Expr)(unsafe.Pointer(pExpr)).FiTable*(int32((*Table)(unsafe.Pointer(pTab2)).FnCol)+1) + 1 +
 106303 		int32(Xsqlite3TableColumnToStorage(tls, pTab2, int16(iCol1)))
 106304 
 106305 	Xsqlite3VdbeAddOp2(tls, v, OP_Param, p1, target)
 106306 
 106307 	if !(iCol1 >= 0 && int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab2)).FaCol+uintptr(iCol1)*24)).Faffinity) == SQLITE_AFF_REAL) {
 106308 		goto __126
 106309 	}
 106310 	Xsqlite3VdbeAddOp1(tls, v, OP_RealAffinity, target)
 106311 __126:
 106312 	;
 106313 	goto __5
 106314 
 106315 __54:
 106316 	Xsqlite3ErrorMsg(tls, pParse, ts+7885, 0)
 106317 	goto __5
 106318 
 106319 __55:
 106320 	okConstFactor = (*Parse)(unsafe.Pointer(pParse)).FokConstFactor
 106321 	pAggInfo1 = (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo
 106322 	if !(pAggInfo1 != 0) {
 106323 		goto __127
 106324 	}
 106325 
 106326 	if !!(int32((*AggInfo)(unsafe.Pointer(pAggInfo1)).FdirectMode) != 0) {
 106327 		goto __128
 106328 	}
 106329 	inReg = func() int32 {
 106330 		return (*AggInfo)(unsafe.Pointer(pAggInfo1)).FiFirstReg + int32((*Expr)(unsafe.Pointer(pExpr)).FiAgg)
 106331 	}()
 106332 	goto __5
 106333 __128:
 106334 	;
 106335 	if !((*AggInfo)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpAggInfo)).FuseSortingIdx != 0) {
 106336 		goto __129
 106337 	}
 106338 	Xsqlite3VdbeAddOp3(tls, v, OP_Column, (*AggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab,
 106339 		int32((*AggInfo_col)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo1)).FaCol+uintptr((*Expr)(unsafe.Pointer(pExpr)).FiAgg)*24)).FiSorterColumn),
 106340 		target)
 106341 	inReg = target
 106342 	goto __5
 106343 __129:
 106344 	;
 106345 __127:
 106346 	;
 106347 	addrINR = Xsqlite3VdbeAddOp3(tls, v, OP_IfNullRow, (*Expr)(unsafe.Pointer(pExpr)).FiTable, 0, target)
 106348 
 106349 	(*Parse)(unsafe.Pointer(pParse)).FokConstFactor = U8(0)
 106350 	inReg = Xsqlite3ExprCodeTarget(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, target)
 106351 	(*Parse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor
 106352 	if !(inReg != target) {
 106353 		goto __130
 106354 	}
 106355 	Xsqlite3VdbeAddOp2(tls, v, OP_SCopy, inReg, target)
 106356 	inReg = target
 106357 __130:
 106358 	;
 106359 	Xsqlite3VdbeJumpHere(tls, v, addrINR)
 106360 	goto __5
 106361 
 106362 __56:
 106363 	pTest = uintptr(0)
 106364 	pDel = uintptr(0)
 106365 	db1 = (*Parse)(unsafe.Pointer(pParse)).Fdb
 106366 
 106367 	pEList = *(*uintptr)(unsafe.Pointer(pExpr + 32))
 106368 	aListelem = pEList + 8
 106369 	nExpr = (*ExprList)(unsafe.Pointer(pEList)).FnExpr
 106370 	endLabel = Xsqlite3VdbeMakeLabel(tls, pParse)
 106371 	if !(libc.AssignUintptr(&pX, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) != uintptr(0)) {
 106372 		goto __131
 106373 	}
 106374 	pDel = Xsqlite3ExprDup(tls, db1, pX, 0)
 106375 	if !((*Sqlite3)(unsafe.Pointer(db1)).FmallocFailed != 0) {
 106376 		goto __132
 106377 	}
 106378 	Xsqlite3ExprDelete(tls, db1, pDel)
 106379 	goto __5
 106380 __132:
 106381 	;
 106382 	exprToRegister(tls, pDel, exprCodeVector(tls, pParse, pDel, bp+40))
 106383 
 106384 	libc.Xmemset(tls, bp+120, 0, uint64(unsafe.Sizeof(Expr{})))
 106385 	(*Expr)(unsafe.Pointer(bp + 120)).Fop = U8(TK_EQ)
 106386 	(*Expr)(unsafe.Pointer(bp + 120)).FpLeft = pDel
 106387 	pTest = bp + 120
 106388 
 106389 	*(*int32)(unsafe.Pointer(bp + 40)) = 0
 106390 __131:
 106391 	;
 106392 	i1 = 0
 106393 __133:
 106394 	if !(i1 < nExpr-1) {
 106395 		goto __135
 106396 	}
 106397 	if !(pX != 0) {
 106398 		goto __136
 106399 	}
 106400 
 106401 	(*Expr)(unsafe.Pointer(bp + 120)).FpRight = (*ExprList_item)(unsafe.Pointer(aListelem + uintptr(i1)*32)).FpExpr
 106402 	goto __137
 106403 __136:
 106404 	pTest = (*ExprList_item)(unsafe.Pointer(aListelem + uintptr(i1)*32)).FpExpr
 106405 __137:
 106406 	;
 106407 	nextCase = Xsqlite3VdbeMakeLabel(tls, pParse)
 106408 
 106409 	Xsqlite3ExprIfFalse(tls, pParse, pTest, nextCase, SQLITE_JUMPIFNULL)
 106410 
 106411 	Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(aListelem+uintptr(i1+1)*32)).FpExpr, target)
 106412 	Xsqlite3VdbeGoto(tls, v, endLabel)
 106413 	Xsqlite3VdbeResolveLabel(tls, v, nextCase)
 106414 	goto __134
 106415 __134:
 106416 	i1 = i1 + 2
 106417 	goto __133
 106418 	goto __135
 106419 __135:
 106420 	;
 106421 	if !(nExpr&1 != 0) {
 106422 		goto __138
 106423 	}
 106424 	Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(pEList+8+uintptr(nExpr-1)*32)).FpExpr, target)
 106425 	goto __139
 106426 __138:
 106427 	Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, target)
 106428 __139:
 106429 	;
 106430 	Xsqlite3ExprDelete(tls, db1, pDel)
 106431 	setDoNotMergeFlagOnCopy(tls, v)
 106432 	Xsqlite3VdbeResolveLabel(tls, v, endLabel)
 106433 	goto __5
 106434 
 106435 __57:
 106436 	;
 106437 	if !(!(int32((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0) && !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0)) {
 106438 		goto __140
 106439 	}
 106440 	Xsqlite3ErrorMsg(tls, pParse,
 106441 		ts+9434, 0)
 106442 	return 0
 106443 __140:
 106444 	;
 106445 	if !(int32((*Expr)(unsafe.Pointer(pExpr)).FaffExpr) == OE_Abort) {
 106446 		goto __141
 106447 	}
 106448 	Xsqlite3MayAbort(tls, pParse)
 106449 __141:
 106450 	;
 106451 	if !(int32((*Expr)(unsafe.Pointer(pExpr)).FaffExpr) == OE_Ignore) {
 106452 		goto __142
 106453 	}
 106454 	Xsqlite3VdbeAddOp4(tls,
 106455 		v, OP_Halt, SQLITE_OK, OE_Ignore, 0, *(*uintptr)(unsafe.Pointer(pExpr + 8)), 0)
 106456 
 106457 	goto __143
 106458 __142:
 106459 	Xsqlite3HaltConstraint(tls, pParse,
 106460 		func() int32 {
 106461 			if (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab != 0 {
 106462 				return SQLITE_CONSTRAINT | int32(7)<<8
 106463 			}
 106464 			return SQLITE_ERROR
 106465 		}(),
 106466 		int32((*Expr)(unsafe.Pointer(pExpr)).FaffExpr), *(*uintptr)(unsafe.Pointer(pExpr + 8)), int8(0), uint8(0))
 106467 __143:
 106468 	;
 106469 	goto __5
 106470 
 106471 __5:
 106472 	;
 106473 	Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 40)))
 106474 	Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 44)))
 106475 	return inReg
 106476 }
 106477 
 106478 var zAff = *(*[10]int8)(unsafe.Pointer(ts + 9484))
 106479 
 106480 // Generate code that will evaluate expression pExpr just one time
 106481 // per prepared statement execution.
 106482 //
 106483 // If the expression uses functions (that might throw an exception) then
 106484 // guard them with an OP_Once opcode to ensure that the code is only executed
 106485 // once. If no functions are involved, then factor the code out and put it at
 106486 // the end of the prepared statement in the initialization section.
 106487 //
 106488 // If regDest>=0 then the result is always stored in that register and the
 106489 // result is not reusable.  If regDest<0 then this routine is free to
 106490 // store the value whereever it wants.  The register where the expression
 106491 // is stored is returned.  When regDest<0, two identical expressions might
 106492 // code to the same register, if they do not contain function calls and hence
 106493 // are factored out into the initialization section at the end of the
 106494 // prepared statement.
 106495 func Xsqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, regDest int32) int32 {
 106496 	var p uintptr
 106497 
 106498 	p = (*Parse)(unsafe.Pointer(pParse)).FpConstExpr
 106499 	if regDest < 0 && p != 0 {
 106500 		var pItem uintptr
 106501 		var i int32
 106502 		pItem = p + 8
 106503 		i = (*ExprList)(unsafe.Pointer(p)).FnExpr
 106504 	__1:
 106505 		if !(i > 0) {
 106506 			goto __3
 106507 		}
 106508 		{
 106509 			if uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 16 + 4))&0x8>>3)) != 0 &&
 106510 				Xsqlite3ExprCompare(tls, uintptr(0), (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr, pExpr, -1) == 0 {
 106511 				return *(*int32)(unsafe.Pointer(pItem + 24))
 106512 			}
 106513 
 106514 		}
 106515 		goto __2
 106516 	__2:
 106517 		pItem += 32
 106518 		i--
 106519 		goto __1
 106520 		goto __3
 106521 	__3:
 106522 	}
 106523 	pExpr = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, 0)
 106524 	if pExpr != uintptr(0) && (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_HasFunc) != U32(0) {
 106525 		var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 106526 		var addr int32
 106527 
 106528 		addr = Xsqlite3VdbeAddOp0(tls, v, OP_Once)
 106529 		(*Parse)(unsafe.Pointer(pParse)).FokConstFactor = U8(0)
 106530 		if !(int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed) != 0) {
 106531 			if regDest < 0 {
 106532 				regDest = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 106533 			}
 106534 			Xsqlite3ExprCode(tls, pParse, pExpr, regDest)
 106535 		}
 106536 		(*Parse)(unsafe.Pointer(pParse)).FokConstFactor = U8(1)
 106537 		Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr)
 106538 		Xsqlite3VdbeJumpHere(tls, v, addr)
 106539 	} else {
 106540 		p = Xsqlite3ExprListAppend(tls, pParse, p, pExpr)
 106541 		if p != 0 {
 106542 			var pItem uintptr = p + 8 + uintptr((*ExprList)(unsafe.Pointer(p)).FnExpr-1)*32
 106543 			libc.SetBitFieldPtr16Uint32(pItem+16+4, uint32(libc.Bool32(regDest < 0)), 3, 0x8)
 106544 			if regDest < 0 {
 106545 				regDest = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 106546 			}
 106547 			*(*int32)(unsafe.Pointer(pItem + 24)) = regDest
 106548 		}
 106549 		(*Parse)(unsafe.Pointer(pParse)).FpConstExpr = p
 106550 	}
 106551 	return regDest
 106552 }
 106553 
 106554 // Generate code to evaluate an expression and store the results
 106555 // into a register.  Return the register number where the results
 106556 // are stored.
 106557 //
 106558 // If the register is a temporary register that can be deallocated,
 106559 // then write its number into *pReg.  If the result register is not
 106560 // a temporary, then set *pReg to zero.
 106561 //
 106562 // If pExpr is a constant, then this routine might generate this
 106563 // code to fill the register in the initialization section of the
 106564 // VDBE program, in order to factor it out of the evaluation loop.
 106565 func Xsqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uintptr) int32 {
 106566 	var r2 int32
 106567 	pExpr = Xsqlite3ExprSkipCollateAndLikely(tls, pExpr)
 106568 	if (*Parse)(unsafe.Pointer(pParse)).FokConstFactor != 0 &&
 106569 		pExpr != uintptr(0) &&
 106570 		int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_REGISTER &&
 106571 		Xsqlite3ExprIsConstantNotJoin(tls, pExpr) != 0 {
 106572 		*(*int32)(unsafe.Pointer(pReg)) = 0
 106573 		r2 = Xsqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -1)
 106574 	} else {
 106575 		var r1 int32 = Xsqlite3GetTempReg(tls, pParse)
 106576 		r2 = Xsqlite3ExprCodeTarget(tls, pParse, pExpr, r1)
 106577 		if r2 == r1 {
 106578 			*(*int32)(unsafe.Pointer(pReg)) = r1
 106579 		} else {
 106580 			Xsqlite3ReleaseTempReg(tls, pParse, r1)
 106581 			*(*int32)(unsafe.Pointer(pReg)) = 0
 106582 		}
 106583 	}
 106584 	return r2
 106585 }
 106586 
 106587 // Generate code that will evaluate expression pExpr and store the
 106588 // results in register target.  The results are guaranteed to appear
 106589 // in register target.
 106590 func Xsqlite3ExprCode(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) {
 106591 	var inReg int32
 106592 
 106593 	if (*Parse)(unsafe.Pointer(pParse)).FpVdbe == uintptr(0) {
 106594 		return
 106595 	}
 106596 	inReg = Xsqlite3ExprCodeTarget(tls, pParse, pExpr, target)
 106597 	if inReg != target {
 106598 		var op U8
 106599 		if pExpr != 0 && (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Subquery) != U32(0) {
 106600 			op = U8(OP_Copy)
 106601 		} else {
 106602 			op = U8(OP_SCopy)
 106603 		}
 106604 		Xsqlite3VdbeAddOp2(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, int32(op), inReg, target)
 106605 	}
 106606 }
 106607 
 106608 // Make a transient copy of expression pExpr and then code it using
 106609 // sqlite3ExprCode().  This routine works just like sqlite3ExprCode()
 106610 // except that the input expression is guaranteed to be unchanged.
 106611 func Xsqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) {
 106612 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 106613 	pExpr = Xsqlite3ExprDup(tls, db, pExpr, 0)
 106614 	if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
 106615 		Xsqlite3ExprCode(tls, pParse, pExpr, target)
 106616 	}
 106617 	Xsqlite3ExprDelete(tls, db, pExpr)
 106618 }
 106619 
 106620 // Generate code that will evaluate expression pExpr and store the
 106621 // results in register target.  The results are guaranteed to appear
 106622 // in register target.  If the expression is constant, then this routine
 106623 // might choose to code the expression at initialization time.
 106624 func Xsqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) {
 106625 	if (*Parse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && Xsqlite3ExprIsConstantNotJoin(tls, pExpr) != 0 {
 106626 		Xsqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, target)
 106627 	} else {
 106628 		Xsqlite3ExprCodeCopy(tls, pParse, pExpr, target)
 106629 	}
 106630 }
 106631 
 106632 // Generate code that pushes the value of every element of the given
 106633 // expression list into a sequence of registers beginning at target.
 106634 //
 106635 // Return the number of elements evaluated.  The number returned will
 106636 // usually be pList->nExpr but might be reduced if SQLITE_ECEL_OMITREF
 106637 // is defined.
 106638 //
 106639 // The SQLITE_ECEL_DUP flag prevents the arguments from being
 106640 // filled using OP_SCopy.  OP_Copy must be used instead.
 106641 //
 106642 // The SQLITE_ECEL_FACTOR argument allows constant arguments to be
 106643 // factored out into initialization code.
 106644 //
 106645 // The SQLITE_ECEL_REF flag means that expressions in the list with
 106646 // ExprList.a[].u.x.iOrderByCol>0 have already been evaluated and stored
 106647 // in registers at srcReg, and so the value can be copied from there.
 106648 // If SQLITE_ECEL_OMITREF is also set, then the values with u.x.iOrderByCol>0
 106649 // are simply omitted rather than being copied from srcReg.
 106650 func Xsqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, target int32, srcReg int32, flags U8) int32 {
 106651 	var pItem uintptr
 106652 	var i int32
 106653 	var j int32
 106654 	var n int32
 106655 	var copyOp U8
 106656 	if int32(flags)&SQLITE_ECEL_DUP != 0 {
 106657 		copyOp = uint8(OP_Copy)
 106658 	} else {
 106659 		copyOp = uint8(OP_SCopy)
 106660 	}
 106661 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 106662 
 106663 	n = (*ExprList)(unsafe.Pointer(pList)).FnExpr
 106664 	if !(int32((*Parse)(unsafe.Pointer(pParse)).FokConstFactor) != 0) {
 106665 		flags = libc.Uint8FromInt32(int32(flags) & libc.CplInt32(SQLITE_ECEL_FACTOR))
 106666 	}
 106667 	pItem = pList + 8
 106668 	i = 0
 106669 __1:
 106670 	if !(i < n) {
 106671 		goto __3
 106672 	}
 106673 	{
 106674 		var pExpr uintptr = (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr
 106675 		if int32(flags)&SQLITE_ECEL_REF != 0 && libc.AssignInt32(&j, int32(*(*U16)(unsafe.Pointer(pItem + 24)))) > 0 {
 106676 			if int32(flags)&SQLITE_ECEL_OMITREF != 0 {
 106677 				i--
 106678 				n--
 106679 			} else {
 106680 				Xsqlite3VdbeAddOp2(tls, v, int32(copyOp), j+srcReg-1, target+i)
 106681 			}
 106682 		} else if int32(flags)&SQLITE_ECEL_FACTOR != 0 &&
 106683 			Xsqlite3ExprIsConstantNotJoin(tls, pExpr) != 0 {
 106684 			Xsqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, target+i)
 106685 		} else {
 106686 			var inReg int32 = Xsqlite3ExprCodeTarget(tls, pParse, pExpr, target+i)
 106687 			if inReg != target+i {
 106688 				var pOp uintptr
 106689 				if int32(copyOp) == OP_Copy &&
 106690 					int32((*VdbeOp)(unsafe.Pointer(libc.AssignUintptr(&pOp, Xsqlite3VdbeGetLastOp(tls, v)))).Fopcode) == OP_Copy &&
 106691 					(*VdbeOp)(unsafe.Pointer(pOp)).Fp1+(*VdbeOp)(unsafe.Pointer(pOp)).Fp3+1 == inReg &&
 106692 					(*VdbeOp)(unsafe.Pointer(pOp)).Fp2+(*VdbeOp)(unsafe.Pointer(pOp)).Fp3+1 == target+i &&
 106693 					int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp5) == 0 {
 106694 					(*VdbeOp)(unsafe.Pointer(pOp)).Fp3++
 106695 				} else {
 106696 					Xsqlite3VdbeAddOp2(tls, v, int32(copyOp), inReg, target+i)
 106697 				}
 106698 			}
 106699 		}
 106700 
 106701 	}
 106702 	goto __2
 106703 __2:
 106704 	i++
 106705 	pItem += 32
 106706 	goto __1
 106707 	goto __3
 106708 __3:
 106709 	;
 106710 	return n
 106711 }
 106712 
 106713 func exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, xJump uintptr, jumpIfNull int32) {
 106714 	bp := tls.Alloc(220)
 106715 	defer tls.Free(220)
 106716 
 106717 	*(*int32)(unsafe.Pointer(bp + 216)) = 0
 106718 	var pDel uintptr = uintptr(0)
 106719 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 106720 
 106721 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Expr{})))
 106722 	libc.Xmemset(tls, bp+72, 0, uint64(unsafe.Sizeof(Expr{})))
 106723 	libc.Xmemset(tls, bp+144, 0, uint64(unsafe.Sizeof(Expr{})))
 106724 
 106725 	pDel = Xsqlite3ExprDup(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, 0)
 106726 	if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 {
 106727 		(*Expr)(unsafe.Pointer(bp + 144)).Fop = U8(TK_AND)
 106728 		(*Expr)(unsafe.Pointer(bp + 144)).FpLeft = bp
 106729 		(*Expr)(unsafe.Pointer(bp + 144)).FpRight = bp + 72
 106730 		(*Expr)(unsafe.Pointer(bp)).Fop = U8(TK_GE)
 106731 		(*Expr)(unsafe.Pointer(bp)).FpLeft = pDel
 106732 		(*Expr)(unsafe.Pointer(bp)).FpRight = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8)).FpExpr
 106733 		(*Expr)(unsafe.Pointer(bp + 72)).Fop = U8(TK_LE)
 106734 		(*Expr)(unsafe.Pointer(bp + 72)).FpLeft = pDel
 106735 		(*Expr)(unsafe.Pointer(bp + 72)).FpRight = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8 + 1*32)).FpExpr
 106736 		exprToRegister(tls, pDel, exprCodeVector(tls, pParse, pDel, bp+216))
 106737 		if xJump != 0 {
 106738 			(*struct {
 106739 				f func(*libc.TLS, uintptr, uintptr, int32, int32)
 106740 			})(unsafe.Pointer(&struct{ uintptr }{xJump})).f(tls, pParse, bp+144, dest, jumpIfNull)
 106741 		} else {
 106742 			*(*U32)(unsafe.Pointer(pDel + 4)) |= U32(EP_OuterON)
 106743 			Xsqlite3ExprCodeTarget(tls, pParse, bp+144, dest)
 106744 		}
 106745 		Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 216)))
 106746 	}
 106747 	Xsqlite3ExprDelete(tls, db, pDel)
 106748 
 106749 }
 106750 
 106751 // Generate code for a boolean expression such that a jump is made
 106752 // to the label "dest" if the expression is true but execution
 106753 // continues straight thru if the expression is false.
 106754 //
 106755 // If the expression evaluates to NULL (neither true nor false), then
 106756 // take the jump if the jumpIfNull flag is SQLITE_JUMPIFNULL.
 106757 //
 106758 // This code depends on the fact that certain token values (ex: TK_EQ)
 106759 // are the same as opcode values (ex: OP_Eq) that implement the corresponding
 106760 // operation.  Special comments in vdbe.c and the mkopcodeh.awk script in
 106761 // the make process cause these values to align.  Assert()s in the code
 106762 // below verify that the numbers are aligned correctly.
 106763 func Xsqlite3ExprIfTrue(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) {
 106764 	bp := tls.Alloc(8)
 106765 	defer tls.Free(8)
 106766 
 106767 	var v uintptr
 106768 	var op int32
 106769 
 106770 	var r1 int32
 106771 	var r2 int32
 106772 	var d2 int32
 106773 	var pAlt uintptr
 106774 	var isNot int32
 106775 	var isTrue int32
 106776 	var destIfFalse int32
 106777 	var destIfNull int32
 106778 	v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 106779 	op = 0
 106780 	*(*int32)(unsafe.Pointer(bp)) = 0
 106781 	*(*int32)(unsafe.Pointer(bp + 4)) = 0
 106782 
 106783 	if !(v == uintptr(0)) {
 106784 		goto __1
 106785 	}
 106786 	return
 106787 __1:
 106788 	;
 106789 	if !(pExpr == uintptr(0)) {
 106790 		goto __2
 106791 	}
 106792 	return
 106793 __2:
 106794 	;
 106795 	op = int32((*Expr)(unsafe.Pointer(pExpr)).Fop)
 106796 	switch op {
 106797 	case TK_AND:
 106798 		goto __4
 106799 	case TK_OR:
 106800 		goto __5
 106801 	case TK_NOT:
 106802 		goto __6
 106803 	case TK_TRUTH:
 106804 		goto __7
 106805 	case TK_IS:
 106806 		goto __8
 106807 	case TK_ISNOT:
 106808 		goto __9
 106809 	case TK_LT:
 106810 		goto __10
 106811 	case TK_LE:
 106812 		goto __11
 106813 	case TK_GT:
 106814 		goto __12
 106815 	case TK_GE:
 106816 		goto __13
 106817 	case TK_NE:
 106818 		goto __14
 106819 	case TK_EQ:
 106820 		goto __15
 106821 	case TK_ISNULL:
 106822 		goto __16
 106823 	case TK_NOTNULL:
 106824 		goto __17
 106825 	case TK_BETWEEN:
 106826 		goto __18
 106827 	case TK_IN:
 106828 		goto __19
 106829 	default:
 106830 		goto __20
 106831 	}
 106832 	goto __3
 106833 __4:
 106834 __5:
 106835 	pAlt = Xsqlite3ExprSimplifiedAndOr(tls, pExpr)
 106836 	if !(pAlt != pExpr) {
 106837 		goto __21
 106838 	}
 106839 	Xsqlite3ExprIfTrue(tls, pParse, pAlt, dest, jumpIfNull)
 106840 	goto __22
 106841 __21:
 106842 	if !(op == TK_AND) {
 106843 		goto __23
 106844 	}
 106845 	d2 = Xsqlite3VdbeMakeLabel(tls, pParse)
 106846 
 106847 	Xsqlite3ExprIfFalse(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, d2,
 106848 		jumpIfNull^SQLITE_JUMPIFNULL)
 106849 	Xsqlite3ExprIfTrue(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, dest, jumpIfNull)
 106850 	Xsqlite3VdbeResolveLabel(tls, v, d2)
 106851 	goto __24
 106852 __23:
 106853 	;
 106854 	Xsqlite3ExprIfTrue(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, dest, jumpIfNull)
 106855 	Xsqlite3ExprIfTrue(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, dest, jumpIfNull)
 106856 __24:
 106857 	;
 106858 __22:
 106859 	;
 106860 	goto __3
 106861 
 106862 __6:
 106863 	;
 106864 	Xsqlite3ExprIfFalse(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, dest, jumpIfNull)
 106865 	goto __3
 106866 
 106867 __7:
 106868 	;
 106869 	isNot = libc.Bool32(int32((*Expr)(unsafe.Pointer(pExpr)).Fop2) == TK_ISNOT)
 106870 	isTrue = Xsqlite3ExprTruthValue(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
 106871 
 106872 	if !(isTrue^isNot != 0) {
 106873 		goto __25
 106874 	}
 106875 	Xsqlite3ExprIfTrue(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, dest,
 106876 		func() int32 {
 106877 			if isNot != 0 {
 106878 				return SQLITE_JUMPIFNULL
 106879 			}
 106880 			return 0
 106881 		}())
 106882 	goto __26
 106883 __25:
 106884 	Xsqlite3ExprIfFalse(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, dest,
 106885 		func() int32 {
 106886 			if isNot != 0 {
 106887 				return SQLITE_JUMPIFNULL
 106888 			}
 106889 			return 0
 106890 		}())
 106891 __26:
 106892 	;
 106893 	goto __3
 106894 
 106895 __8:
 106896 __9:
 106897 	;
 106898 	if op == TK_IS {
 106899 		op = TK_EQ
 106900 	} else {
 106901 		op = TK_NE
 106902 	}
 106903 	jumpIfNull = SQLITE_NULLEQ
 106904 __10:
 106905 __11:
 106906 __12:
 106907 __13:
 106908 __14:
 106909 __15:
 106910 	if !(Xsqlite3ExprIsVector(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) != 0) {
 106911 		goto __27
 106912 	}
 106913 	goto default_expr
 106914 __27:
 106915 	;
 106916 	r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp)
 106917 	r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+4)
 106918 	codeCompare(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight, op,
 106919 		r1, r2, dest, jumpIfNull, libc.Bool32((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Commuted) != U32(0)))
 106920 
 106921 	goto __3
 106922 
 106923 __16:
 106924 __17:
 106925 	;
 106926 	r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp)
 106927 	Xsqlite3VdbeTypeofColumn(tls, v, r1)
 106928 	Xsqlite3VdbeAddOp2(tls, v, op, r1, dest)
 106929 
 106930 	goto __3
 106931 
 106932 __18:
 106933 	;
 106934 	exprCodeBetween(tls, pParse, pExpr, dest, *(*uintptr)(unsafe.Pointer(&struct {
 106935 		f func(*libc.TLS, uintptr, uintptr, int32, int32)
 106936 	}{Xsqlite3ExprIfTrue})), jumpIfNull)
 106937 	goto __3
 106938 
 106939 __19:
 106940 	destIfFalse = Xsqlite3VdbeMakeLabel(tls, pParse)
 106941 	if jumpIfNull != 0 {
 106942 		destIfNull = dest
 106943 	} else {
 106944 		destIfNull = destIfFalse
 106945 	}
 106946 	sqlite3ExprCodeIN(tls, pParse, pExpr, destIfFalse, destIfNull)
 106947 	Xsqlite3VdbeGoto(tls, v, dest)
 106948 	Xsqlite3VdbeResolveLabel(tls, v, destIfFalse)
 106949 	goto __3
 106950 
 106951 __20:
 106952 default_expr:
 106953 	if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_OuterON|EP_IsTrue) == U32(EP_IsTrue)) {
 106954 		goto __28
 106955 	}
 106956 	Xsqlite3VdbeGoto(tls, v, dest)
 106957 	goto __29
 106958 __28:
 106959 	if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_OuterON|EP_IsFalse) == U32(EP_IsFalse)) {
 106960 		goto __30
 106961 	}
 106962 
 106963 	goto __31
 106964 __30:
 106965 	r1 = Xsqlite3ExprCodeTemp(tls, pParse, pExpr, bp)
 106966 	Xsqlite3VdbeAddOp3(tls, v, OP_If, r1, dest, libc.Bool32(jumpIfNull != 0))
 106967 
 106968 __31:
 106969 	;
 106970 __29:
 106971 	;
 106972 	goto __3
 106973 
 106974 __3:
 106975 	;
 106976 	Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp)))
 106977 	Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 4)))
 106978 }
 106979 
 106980 // Generate code for a boolean expression such that a jump is made
 106981 // to the label "dest" if the expression is false but execution
 106982 // continues straight thru if the expression is true.
 106983 //
 106984 // If the expression evaluates to NULL (neither true nor false) then
 106985 // jump if jumpIfNull is SQLITE_JUMPIFNULL or fall through if jumpIfNull
 106986 // is 0.
 106987 func Xsqlite3ExprIfFalse(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) {
 106988 	bp := tls.Alloc(8)
 106989 	defer tls.Free(8)
 106990 
 106991 	var v uintptr
 106992 	var op int32
 106993 
 106994 	var r1 int32
 106995 	var r2 int32
 106996 	var d2 int32
 106997 	var pAlt uintptr
 106998 	var isNot int32
 106999 	var isTrue int32
 107000 	var destIfNull int32
 107001 	v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 107002 	op = 0
 107003 	*(*int32)(unsafe.Pointer(bp)) = 0
 107004 	*(*int32)(unsafe.Pointer(bp + 4)) = 0
 107005 
 107006 	if !(v == uintptr(0)) {
 107007 		goto __1
 107008 	}
 107009 	return
 107010 __1:
 107011 	;
 107012 	if !(pExpr == uintptr(0)) {
 107013 		goto __2
 107014 	}
 107015 	return
 107016 __2:
 107017 	;
 107018 	op = int32((*Expr)(unsafe.Pointer(pExpr)).Fop) + TK_ISNULL&1 ^ 1 - TK_ISNULL&1
 107019 
 107020 	switch int32((*Expr)(unsafe.Pointer(pExpr)).Fop) {
 107021 	case TK_AND:
 107022 		goto __4
 107023 	case TK_OR:
 107024 		goto __5
 107025 	case TK_NOT:
 107026 		goto __6
 107027 	case TK_TRUTH:
 107028 		goto __7
 107029 	case TK_IS:
 107030 		goto __8
 107031 	case TK_ISNOT:
 107032 		goto __9
 107033 	case TK_LT:
 107034 		goto __10
 107035 	case TK_LE:
 107036 		goto __11
 107037 	case TK_GT:
 107038 		goto __12
 107039 	case TK_GE:
 107040 		goto __13
 107041 	case TK_NE:
 107042 		goto __14
 107043 	case TK_EQ:
 107044 		goto __15
 107045 	case TK_ISNULL:
 107046 		goto __16
 107047 	case TK_NOTNULL:
 107048 		goto __17
 107049 	case TK_BETWEEN:
 107050 		goto __18
 107051 	case TK_IN:
 107052 		goto __19
 107053 	default:
 107054 		goto __20
 107055 	}
 107056 	goto __3
 107057 __4:
 107058 __5:
 107059 	pAlt = Xsqlite3ExprSimplifiedAndOr(tls, pExpr)
 107060 	if !(pAlt != pExpr) {
 107061 		goto __21
 107062 	}
 107063 	Xsqlite3ExprIfFalse(tls, pParse, pAlt, dest, jumpIfNull)
 107064 	goto __22
 107065 __21:
 107066 	if !(int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND) {
 107067 		goto __23
 107068 	}
 107069 
 107070 	Xsqlite3ExprIfFalse(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, dest, jumpIfNull)
 107071 	Xsqlite3ExprIfFalse(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, dest, jumpIfNull)
 107072 	goto __24
 107073 __23:
 107074 	d2 = Xsqlite3VdbeMakeLabel(tls, pParse)
 107075 
 107076 	Xsqlite3ExprIfTrue(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, d2,
 107077 		jumpIfNull^SQLITE_JUMPIFNULL)
 107078 	Xsqlite3ExprIfFalse(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, dest, jumpIfNull)
 107079 	Xsqlite3VdbeResolveLabel(tls, v, d2)
 107080 __24:
 107081 	;
 107082 __22:
 107083 	;
 107084 	goto __3
 107085 
 107086 __6:
 107087 	;
 107088 	Xsqlite3ExprIfTrue(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, dest, jumpIfNull)
 107089 	goto __3
 107090 
 107091 __7:
 107092 	;
 107093 	isNot = libc.Bool32(int32((*Expr)(unsafe.Pointer(pExpr)).Fop2) == TK_ISNOT)
 107094 	isTrue = Xsqlite3ExprTruthValue(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
 107095 
 107096 	if !(isTrue^isNot != 0) {
 107097 		goto __25
 107098 	}
 107099 
 107100 	Xsqlite3ExprIfFalse(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, dest,
 107101 		func() int32 {
 107102 			if isNot != 0 {
 107103 				return 0
 107104 			}
 107105 			return SQLITE_JUMPIFNULL
 107106 		}())
 107107 
 107108 	goto __26
 107109 __25:
 107110 	Xsqlite3ExprIfTrue(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, dest,
 107111 		func() int32 {
 107112 			if isNot != 0 {
 107113 				return 0
 107114 			}
 107115 			return SQLITE_JUMPIFNULL
 107116 		}())
 107117 __26:
 107118 	;
 107119 	goto __3
 107120 
 107121 __8:
 107122 __9:
 107123 	;
 107124 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IS {
 107125 		op = TK_NE
 107126 	} else {
 107127 		op = TK_EQ
 107128 	}
 107129 	jumpIfNull = SQLITE_NULLEQ
 107130 __10:
 107131 __11:
 107132 __12:
 107133 __13:
 107134 __14:
 107135 __15:
 107136 	if !(Xsqlite3ExprIsVector(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) != 0) {
 107137 		goto __27
 107138 	}
 107139 	goto default_expr
 107140 __27:
 107141 	;
 107142 	r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp)
 107143 	r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+4)
 107144 	codeCompare(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight, op,
 107145 		r1, r2, dest, jumpIfNull, libc.Bool32((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Commuted) != U32(0)))
 107146 
 107147 	goto __3
 107148 
 107149 __16:
 107150 __17:
 107151 	r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp)
 107152 	Xsqlite3VdbeTypeofColumn(tls, v, r1)
 107153 	Xsqlite3VdbeAddOp2(tls, v, op, r1, dest)
 107154 
 107155 	goto __3
 107156 
 107157 __18:
 107158 	;
 107159 	exprCodeBetween(tls, pParse, pExpr, dest, *(*uintptr)(unsafe.Pointer(&struct {
 107160 		f func(*libc.TLS, uintptr, uintptr, int32, int32)
 107161 	}{Xsqlite3ExprIfFalse})), jumpIfNull)
 107162 	goto __3
 107163 
 107164 __19:
 107165 	if !(jumpIfNull != 0) {
 107166 		goto __28
 107167 	}
 107168 	sqlite3ExprCodeIN(tls, pParse, pExpr, dest, dest)
 107169 	goto __29
 107170 __28:
 107171 	destIfNull = Xsqlite3VdbeMakeLabel(tls, pParse)
 107172 	sqlite3ExprCodeIN(tls, pParse, pExpr, dest, destIfNull)
 107173 	Xsqlite3VdbeResolveLabel(tls, v, destIfNull)
 107174 __29:
 107175 	;
 107176 	goto __3
 107177 
 107178 __20:
 107179 default_expr:
 107180 	if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_OuterON|EP_IsFalse) == U32(EP_IsFalse)) {
 107181 		goto __30
 107182 	}
 107183 	Xsqlite3VdbeGoto(tls, v, dest)
 107184 	goto __31
 107185 __30:
 107186 	if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_OuterON|EP_IsTrue) == U32(EP_IsTrue)) {
 107187 		goto __32
 107188 	}
 107189 
 107190 	goto __33
 107191 __32:
 107192 	r1 = Xsqlite3ExprCodeTemp(tls, pParse, pExpr, bp)
 107193 	Xsqlite3VdbeAddOp3(tls, v, OP_IfNot, r1, dest, libc.Bool32(jumpIfNull != 0))
 107194 
 107195 __33:
 107196 	;
 107197 __31:
 107198 	;
 107199 	goto __3
 107200 
 107201 __3:
 107202 	;
 107203 	Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp)))
 107204 	Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 4)))
 107205 }
 107206 
 107207 // Like sqlite3ExprIfFalse() except that a copy is made of pExpr before
 107208 // code generation, and that copy is deleted after code generation. This
 107209 // ensures that the original pExpr is unchanged.
 107210 func Xsqlite3ExprIfFalseDup(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) {
 107211 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 107212 	var pCopy uintptr = Xsqlite3ExprDup(tls, db, pExpr, 0)
 107213 	if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 {
 107214 		Xsqlite3ExprIfFalse(tls, pParse, pCopy, dest, jumpIfNull)
 107215 	}
 107216 	Xsqlite3ExprDelete(tls, db, pCopy)
 107217 }
 107218 
 107219 func exprCompareVariable(tls *libc.TLS, pParse uintptr, pVar uintptr, pExpr uintptr) int32 {
 107220 	bp := tls.Alloc(8)
 107221 	defer tls.Free(8)
 107222 
 107223 	var res int32 = 0
 107224 	var iVar int32
 107225 	var pL uintptr
 107226 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 107227 
 107228 	Xsqlite3ValueFromExpr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, uint8(SQLITE_UTF8), uint8(SQLITE_AFF_BLOB), bp)
 107229 	if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
 107230 		iVar = int32((*Expr)(unsafe.Pointer(pVar)).FiColumn)
 107231 		Xsqlite3VdbeSetVarmask(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iVar)
 107232 		pL = Xsqlite3VdbeGetBoundValue(tls, (*Parse)(unsafe.Pointer(pParse)).FpReprepare, iVar, uint8(SQLITE_AFF_BLOB))
 107233 		if pL != 0 {
 107234 			if Xsqlite3_value_type(tls, pL) == SQLITE_TEXT {
 107235 				Xsqlite3_value_text(tls, pL)
 107236 			}
 107237 			res = libc.Bool32(0 == Xsqlite3MemCompare(tls, pL, *(*uintptr)(unsafe.Pointer(bp)), uintptr(0)))
 107238 		}
 107239 		Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp)))
 107240 		Xsqlite3ValueFree(tls, pL)
 107241 	}
 107242 
 107243 	return res
 107244 }
 107245 
 107246 // Do a deep comparison of two expression trees.  Return 0 if the two
 107247 // expressions are completely identical.  Return 1 if they differ only
 107248 // by a COLLATE operator at the top level.  Return 2 if there are differences
 107249 // other than the top-level COLLATE operator.
 107250 //
 107251 // If any subelement of pB has Expr.iTable==(-1) then it is allowed
 107252 // to compare equal to an equivalent element in pA with Expr.iTable==iTab.
 107253 //
 107254 // The pA side might be using TK_REGISTER.  If that is the case and pB is
 107255 // not using TK_REGISTER but is otherwise equivalent, then still return 0.
 107256 //
 107257 // Sometimes this routine will return 2 even if the two expressions
 107258 // really are equivalent.  If we cannot prove that the expressions are
 107259 // identical, we return 2 just to be safe.  So if this routine
 107260 // returns 2, then you do not really know for certain if the two
 107261 // expressions are the same.  But if you get a 0 or 1 return, then you
 107262 // can be sure the expressions are the same.  In the places where
 107263 // this routine is used, it does not hurt to get an extra 2 - that
 107264 // just might result in some slightly slower code.  But returning
 107265 // an incorrect 0 or 1 could lead to a malfunction.
 107266 //
 107267 // If pParse is not NULL then TK_VARIABLE terms in pA with bindings in
 107268 // pParse->pReprepare can be matched against literals in pB.  The
 107269 // pParse->pVdbe->expmask bitmask is updated for each variable referenced.
 107270 // If pParse is NULL (the normal case) then any TK_VARIABLE term in
 107271 // Argument pParse should normally be NULL. If it is not NULL and pA or
 107272 // pB causes a return value of 2.
 107273 func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, iTab int32) int32 {
 107274 	var combinedFlags U32
 107275 	if pA == uintptr(0) || pB == uintptr(0) {
 107276 		if pB == pA {
 107277 			return 0
 107278 		}
 107279 		return 2
 107280 	}
 107281 	if pParse != 0 && int32((*Expr)(unsafe.Pointer(pA)).Fop) == TK_VARIABLE && exprCompareVariable(tls, pParse, pA, pB) != 0 {
 107282 		return 0
 107283 	}
 107284 	combinedFlags = (*Expr)(unsafe.Pointer(pA)).Fflags | (*Expr)(unsafe.Pointer(pB)).Fflags
 107285 	if combinedFlags&U32(EP_IntValue) != 0 {
 107286 		if (*Expr)(unsafe.Pointer(pA)).Fflags&(*Expr)(unsafe.Pointer(pB)).Fflags&U32(EP_IntValue) != U32(0) && *(*int32)(unsafe.Pointer(pA + 8)) == *(*int32)(unsafe.Pointer(pB + 8)) {
 107287 			return 0
 107288 		}
 107289 		return 2
 107290 	}
 107291 	if int32((*Expr)(unsafe.Pointer(pA)).Fop) != int32((*Expr)(unsafe.Pointer(pB)).Fop) || int32((*Expr)(unsafe.Pointer(pA)).Fop) == TK_RAISE {
 107292 		if int32((*Expr)(unsafe.Pointer(pA)).Fop) == TK_COLLATE && Xsqlite3ExprCompare(tls, pParse, (*Expr)(unsafe.Pointer(pA)).FpLeft, pB, iTab) < 2 {
 107293 			return 1
 107294 		}
 107295 		if int32((*Expr)(unsafe.Pointer(pB)).Fop) == TK_COLLATE && Xsqlite3ExprCompare(tls, pParse, pA, (*Expr)(unsafe.Pointer(pB)).FpLeft, iTab) < 2 {
 107296 			return 1
 107297 		}
 107298 		if int32((*Expr)(unsafe.Pointer(pA)).Fop) == TK_AGG_COLUMN && int32((*Expr)(unsafe.Pointer(pB)).Fop) == TK_COLUMN &&
 107299 			(*Expr)(unsafe.Pointer(pB)).FiTable < 0 && (*Expr)(unsafe.Pointer(pA)).FiTable == iTab {
 107300 		} else {
 107301 			return 2
 107302 		}
 107303 	}
 107304 
 107305 	if *(*uintptr)(unsafe.Pointer(pA + 8)) != 0 {
 107306 		if int32((*Expr)(unsafe.Pointer(pA)).Fop) == TK_FUNCTION || int32((*Expr)(unsafe.Pointer(pA)).Fop) == TK_AGG_FUNCTION {
 107307 			if Xsqlite3StrICmp(tls, *(*uintptr)(unsafe.Pointer(pA + 8)), *(*uintptr)(unsafe.Pointer(pB + 8))) != 0 {
 107308 				return 2
 107309 			}
 107310 
 107311 			if libc.Bool32((*Expr)(unsafe.Pointer(pA)).Fflags&U32(EP_WinFunc) != U32(0)) != libc.Bool32((*Expr)(unsafe.Pointer(pB)).Fflags&U32(EP_WinFunc) != U32(0)) {
 107312 				return 2
 107313 			}
 107314 			if (*Expr)(unsafe.Pointer(pA)).Fflags&U32(EP_WinFunc) != U32(0) {
 107315 				if Xsqlite3WindowCompare(tls, pParse, *(*uintptr)(unsafe.Pointer(pA + 64)), *(*uintptr)(unsafe.Pointer(pB + 64)), 1) != 0 {
 107316 					return 2
 107317 				}
 107318 			}
 107319 		} else if int32((*Expr)(unsafe.Pointer(pA)).Fop) == TK_NULL {
 107320 			return 0
 107321 		} else if int32((*Expr)(unsafe.Pointer(pA)).Fop) == TK_COLLATE {
 107322 			if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pA + 8)), *(*uintptr)(unsafe.Pointer(pB + 8))) != 0 {
 107323 				return 2
 107324 			}
 107325 		} else if *(*uintptr)(unsafe.Pointer(pB + 8)) != uintptr(0) &&
 107326 			int32((*Expr)(unsafe.Pointer(pA)).Fop) != TK_COLUMN &&
 107327 			int32((*Expr)(unsafe.Pointer(pA)).Fop) != TK_AGG_COLUMN &&
 107328 			libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(pA + 8)), *(*uintptr)(unsafe.Pointer(pB + 8))) != 0 {
 107329 			return 2
 107330 		}
 107331 	}
 107332 	if (*Expr)(unsafe.Pointer(pA)).Fflags&U32(EP_Distinct|EP_Commuted) !=
 107333 		(*Expr)(unsafe.Pointer(pB)).Fflags&U32(EP_Distinct|EP_Commuted) {
 107334 		return 2
 107335 	}
 107336 	if combinedFlags&U32(EP_TokenOnly) == U32(0) {
 107337 		if combinedFlags&U32(EP_xIsSelect) != 0 {
 107338 			return 2
 107339 		}
 107340 		if combinedFlags&U32(EP_FixedCol) == U32(0) &&
 107341 			Xsqlite3ExprCompare(tls, pParse, (*Expr)(unsafe.Pointer(pA)).FpLeft, (*Expr)(unsafe.Pointer(pB)).FpLeft, iTab) != 0 {
 107342 			return 2
 107343 		}
 107344 		if Xsqlite3ExprCompare(tls, pParse, (*Expr)(unsafe.Pointer(pA)).FpRight, (*Expr)(unsafe.Pointer(pB)).FpRight, iTab) != 0 {
 107345 			return 2
 107346 		}
 107347 		if Xsqlite3ExprListCompare(tls, *(*uintptr)(unsafe.Pointer(pA + 32)), *(*uintptr)(unsafe.Pointer(pB + 32)), iTab) != 0 {
 107348 			return 2
 107349 		}
 107350 		if int32((*Expr)(unsafe.Pointer(pA)).Fop) != TK_STRING &&
 107351 			int32((*Expr)(unsafe.Pointer(pA)).Fop) != TK_TRUEFALSE &&
 107352 			combinedFlags&U32(EP_Reduced) == U32(0) {
 107353 			if int32((*Expr)(unsafe.Pointer(pA)).FiColumn) != int32((*Expr)(unsafe.Pointer(pB)).FiColumn) {
 107354 				return 2
 107355 			}
 107356 			if int32((*Expr)(unsafe.Pointer(pA)).Fop2) != int32((*Expr)(unsafe.Pointer(pB)).Fop2) && int32((*Expr)(unsafe.Pointer(pA)).Fop) == TK_TRUTH {
 107357 				return 2
 107358 			}
 107359 			if int32((*Expr)(unsafe.Pointer(pA)).Fop) != TK_IN && (*Expr)(unsafe.Pointer(pA)).FiTable != (*Expr)(unsafe.Pointer(pB)).FiTable && (*Expr)(unsafe.Pointer(pA)).FiTable != iTab {
 107360 				return 2
 107361 			}
 107362 		}
 107363 	}
 107364 	return 0
 107365 }
 107366 
 107367 // Compare two ExprList objects.  Return 0 if they are identical, 1
 107368 // if they are certainly different, or 2 if it is not possible to
 107369 // determine if they are identical or not.
 107370 //
 107371 // If any subelement of pB has Expr.iTable==(-1) then it is allowed
 107372 // to compare equal to an equivalent element in pA with Expr.iTable==iTab.
 107373 //
 107374 // This routine might return non-zero for equivalent ExprLists.  The
 107375 // only consequence will be disabled optimizations.  But this routine
 107376 // must never return 0 if the two ExprList objects are different, or
 107377 // a malfunction will result.
 107378 //
 107379 // Two NULL pointers are considered to be the same.  But a NULL pointer
 107380 // always differs from a non-NULL pointer.
 107381 func Xsqlite3ExprListCompare(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) int32 {
 107382 	var i int32
 107383 	if pA == uintptr(0) && pB == uintptr(0) {
 107384 		return 0
 107385 	}
 107386 	if pA == uintptr(0) || pB == uintptr(0) {
 107387 		return 1
 107388 	}
 107389 	if (*ExprList)(unsafe.Pointer(pA)).FnExpr != (*ExprList)(unsafe.Pointer(pB)).FnExpr {
 107390 		return 1
 107391 	}
 107392 	for i = 0; i < (*ExprList)(unsafe.Pointer(pA)).FnExpr; i++ {
 107393 		var res int32
 107394 		var pExprA uintptr = (*ExprList_item)(unsafe.Pointer(pA + 8 + uintptr(i)*32)).FpExpr
 107395 		var pExprB uintptr = (*ExprList_item)(unsafe.Pointer(pB + 8 + uintptr(i)*32)).FpExpr
 107396 		if int32((*ExprList_item)(unsafe.Pointer(pA+8+uintptr(i)*32)).Ffg.FsortFlags) != int32((*ExprList_item)(unsafe.Pointer(pB+8+uintptr(i)*32)).Ffg.FsortFlags) {
 107397 			return 1
 107398 		}
 107399 		if libc.AssignInt32(&res, Xsqlite3ExprCompare(tls, uintptr(0), pExprA, pExprB, iTab)) != 0 {
 107400 			return res
 107401 		}
 107402 	}
 107403 	return 0
 107404 }
 107405 
 107406 // Like sqlite3ExprCompare() except COLLATE operators at the top-level
 107407 // are ignored.
 107408 func Xsqlite3ExprCompareSkip(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) int32 {
 107409 	return Xsqlite3ExprCompare(tls, uintptr(0),
 107410 		Xsqlite3ExprSkipCollateAndLikely(tls, pA),
 107411 		Xsqlite3ExprSkipCollateAndLikely(tls, pB),
 107412 		iTab)
 107413 }
 107414 
 107415 func exprImpliesNotNull(tls *libc.TLS, pParse uintptr, p uintptr, pNN uintptr, iTab int32, seenNot int32) int32 {
 107416 	if Xsqlite3ExprCompare(tls, pParse, p, pNN, iTab) == 0 {
 107417 		return libc.Bool32(int32((*Expr)(unsafe.Pointer(pNN)).Fop) != TK_NULL)
 107418 	}
 107419 	{
 107420 		switch int32((*Expr)(unsafe.Pointer(p)).Fop) {
 107421 		case TK_IN:
 107422 			{
 107423 				if seenNot != 0 && (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_xIsSelect) != U32(0) {
 107424 					return 0
 107425 				}
 107426 
 107427 				return exprImpliesNotNull(tls, pParse, (*Expr)(unsafe.Pointer(p)).FpLeft, pNN, iTab, 1)
 107428 
 107429 			}
 107430 		case TK_BETWEEN:
 107431 			{
 107432 				var pList uintptr
 107433 
 107434 				pList = *(*uintptr)(unsafe.Pointer(p + 32))
 107435 
 107436 				if seenNot != 0 {
 107437 					return 0
 107438 				}
 107439 				if exprImpliesNotNull(tls, pParse, (*ExprList_item)(unsafe.Pointer(pList+8)).FpExpr, pNN, iTab, 1) != 0 ||
 107440 					exprImpliesNotNull(tls, pParse, (*ExprList_item)(unsafe.Pointer(pList+8+1*32)).FpExpr, pNN, iTab, 1) != 0 {
 107441 					return 1
 107442 				}
 107443 				return exprImpliesNotNull(tls, pParse, (*Expr)(unsafe.Pointer(p)).FpLeft, pNN, iTab, 1)
 107444 
 107445 			}
 107446 		case TK_EQ:
 107447 			fallthrough
 107448 		case TK_NE:
 107449 			fallthrough
 107450 		case TK_LT:
 107451 			fallthrough
 107452 		case TK_LE:
 107453 			fallthrough
 107454 		case TK_GT:
 107455 			fallthrough
 107456 		case TK_GE:
 107457 			fallthrough
 107458 		case TK_PLUS:
 107459 			fallthrough
 107460 		case TK_MINUS:
 107461 			fallthrough
 107462 		case TK_BITOR:
 107463 			fallthrough
 107464 		case TK_LSHIFT:
 107465 			fallthrough
 107466 		case TK_RSHIFT:
 107467 			fallthrough
 107468 		case TK_CONCAT:
 107469 			seenNot = 1
 107470 			fallthrough
 107471 		case TK_STAR:
 107472 			fallthrough
 107473 		case TK_REM:
 107474 			fallthrough
 107475 		case TK_BITAND:
 107476 			fallthrough
 107477 		case TK_SLASH:
 107478 			{
 107479 				if exprImpliesNotNull(tls, pParse, (*Expr)(unsafe.Pointer(p)).FpRight, pNN, iTab, seenNot) != 0 {
 107480 					return 1
 107481 				}
 107482 
 107483 			}
 107484 			fallthrough
 107485 		case TK_SPAN:
 107486 			fallthrough
 107487 		case TK_COLLATE:
 107488 			fallthrough
 107489 		case TK_UPLUS:
 107490 			fallthrough
 107491 		case TK_UMINUS:
 107492 			{
 107493 				return exprImpliesNotNull(tls, pParse, (*Expr)(unsafe.Pointer(p)).FpLeft, pNN, iTab, seenNot)
 107494 
 107495 			}
 107496 		case TK_TRUTH:
 107497 			{
 107498 				if seenNot != 0 {
 107499 					return 0
 107500 				}
 107501 				if int32((*Expr)(unsafe.Pointer(p)).Fop2) != TK_IS {
 107502 					return 0
 107503 				}
 107504 				return exprImpliesNotNull(tls, pParse, (*Expr)(unsafe.Pointer(p)).FpLeft, pNN, iTab, 1)
 107505 
 107506 			}
 107507 		case TK_BITNOT:
 107508 			fallthrough
 107509 		case TK_NOT:
 107510 			{
 107511 				return exprImpliesNotNull(tls, pParse, (*Expr)(unsafe.Pointer(p)).FpLeft, pNN, iTab, 1)
 107512 
 107513 			}
 107514 		}
 107515 	}
 107516 	return 0
 107517 }
 107518 
 107519 // Return true if we can prove the pE2 will always be true if pE1 is
 107520 // true.  Return false if we cannot complete the proof or if pE2 might
 107521 // be false.  Examples:
 107522 //
 107523 //	pE1: x==5       pE2: x==5             Result: true
 107524 //	pE1: x>0        pE2: x==5             Result: false
 107525 //	pE1: x=21       pE2: x=21 OR y=43     Result: true
 107526 //	pE1: x!=123     pE2: x IS NOT NULL    Result: true
 107527 //	pE1: x!=?1      pE2: x IS NOT NULL    Result: true
 107528 //	pE1: x IS NULL  pE2: x IS NOT NULL    Result: false
 107529 //	pE1: x IS ?2    pE2: x IS NOT NULL    Reuslt: false
 107530 //
 107531 // When comparing TK_COLUMN nodes between pE1 and pE2, if pE2 has
 107532 // Expr.iTable<0 then assume a table number given by iTab.
 107533 //
 107534 // If pParse is not NULL, then the values of bound variables in pE1 are
 107535 // compared against literal values in pE2 and pParse->pVdbe->expmask is
 107536 // modified to record which bound variables are referenced.  If pParse
 107537 // is NULL, then false will be returned if pE1 contains any bound variables.
 107538 //
 107539 // When in doubt, return false.  Returning true might give a performance
 107540 // improvement.  Returning false might cause a performance reduction, but
 107541 // it will always give the correct answer and is hence always safe.
 107542 func Xsqlite3ExprImpliesExpr(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uintptr, iTab int32) int32 {
 107543 	if Xsqlite3ExprCompare(tls, pParse, pE1, pE2, iTab) == 0 {
 107544 		return 1
 107545 	}
 107546 	if int32((*Expr)(unsafe.Pointer(pE2)).Fop) == TK_OR &&
 107547 		(Xsqlite3ExprImpliesExpr(tls, pParse, pE1, (*Expr)(unsafe.Pointer(pE2)).FpLeft, iTab) != 0 ||
 107548 			Xsqlite3ExprImpliesExpr(tls, pParse, pE1, (*Expr)(unsafe.Pointer(pE2)).FpRight, iTab) != 0) {
 107549 		return 1
 107550 	}
 107551 	if int32((*Expr)(unsafe.Pointer(pE2)).Fop) == TK_NOTNULL &&
 107552 		exprImpliesNotNull(tls, pParse, pE1, (*Expr)(unsafe.Pointer(pE2)).FpLeft, iTab, 0) != 0 {
 107553 		return 1
 107554 	}
 107555 	return 0
 107556 }
 107557 
 107558 func impliesNotNullRow(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 107559 	if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_OuterON) != U32(0) {
 107560 		return WRC_Prune
 107561 	}
 107562 	switch int32((*Expr)(unsafe.Pointer(pExpr)).Fop) {
 107563 	case TK_ISNOT:
 107564 		fallthrough
 107565 	case TK_ISNULL:
 107566 		fallthrough
 107567 	case TK_NOTNULL:
 107568 		fallthrough
 107569 	case TK_IS:
 107570 		fallthrough
 107571 	case TK_OR:
 107572 		fallthrough
 107573 	case TK_VECTOR:
 107574 		fallthrough
 107575 	case TK_CASE:
 107576 		fallthrough
 107577 	case TK_IN:
 107578 		fallthrough
 107579 	case TK_FUNCTION:
 107580 		fallthrough
 107581 	case TK_TRUTH:
 107582 		return WRC_Prune
 107583 	case TK_COLUMN:
 107584 		if *(*int32)(unsafe.Pointer(pWalker + 40)) == (*Expr)(unsafe.Pointer(pExpr)).FiTable {
 107585 			(*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(1)
 107586 			return WRC_Abort
 107587 		}
 107588 		return WRC_Prune
 107589 
 107590 	case TK_AND:
 107591 		if int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 0 {
 107592 			Xsqlite3WalkExpr(tls, pWalker, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
 107593 			if (*Walker)(unsafe.Pointer(pWalker)).FeCode != 0 {
 107594 				(*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0)
 107595 				Xsqlite3WalkExpr(tls, pWalker, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
 107596 			}
 107597 		}
 107598 		return WRC_Prune
 107599 
 107600 	case TK_BETWEEN:
 107601 		if Xsqlite3WalkExpr(tls, pWalker, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) == WRC_Abort {
 107602 			return WRC_Abort
 107603 		}
 107604 		return WRC_Prune
 107605 
 107606 	case TK_EQ:
 107607 		fallthrough
 107608 	case TK_NE:
 107609 		fallthrough
 107610 	case TK_LT:
 107611 		fallthrough
 107612 	case TK_LE:
 107613 		fallthrough
 107614 	case TK_GT:
 107615 		fallthrough
 107616 	case TK_GE:
 107617 		{
 107618 			var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
 107619 			var pRight uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpRight
 107620 
 107621 			if int32((*Expr)(unsafe.Pointer(pLeft)).Fop) == TK_COLUMN &&
 107622 				*(*uintptr)(unsafe.Pointer(pLeft + 64)) != uintptr(0) &&
 107623 				int32((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLeft + 64)))).FeTabType) == TABTYP_VTAB ||
 107624 				int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_COLUMN &&
 107625 					*(*uintptr)(unsafe.Pointer(pRight + 64)) != uintptr(0) &&
 107626 					int32((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pRight + 64)))).FeTabType) == TABTYP_VTAB {
 107627 				return WRC_Prune
 107628 			}
 107629 
 107630 		}
 107631 		fallthrough
 107632 	default:
 107633 		return WRC_Continue
 107634 	}
 107635 	return int32(0)
 107636 }
 107637 
 107638 // Return true (non-zero) if expression p can only be true if at least
 107639 // one column of table iTab is non-null.  In other words, return true
 107640 // if expression p will always be NULL or false if every column of iTab
 107641 // is NULL.
 107642 //
 107643 // False negatives are acceptable.  In other words, it is ok to return
 107644 // zero even if expression p will never be true of every column of iTab
 107645 // is NULL.  A false negative is merely a missed optimization opportunity.
 107646 //
 107647 // False positives are not allowed, however.  A false positive may result
 107648 // in an incorrect answer.
 107649 //
 107650 // Terms of p that are marked with EP_OuterON (and hence that come from
 107651 // the ON or USING clauses of OUTER JOINS) are excluded from the analysis.
 107652 //
 107653 // This routine is used to check if a LEFT JOIN can be converted into
 107654 // an ordinary JOIN.  The p argument is the WHERE clause.  If the WHERE
 107655 // clause requires that some column of the right table of the LEFT JOIN
 107656 // be non-NULL, then the LEFT JOIN can be safely converted into an
 107657 // ordinary join.
 107658 func Xsqlite3ExprImpliesNonNullRow(tls *libc.TLS, p uintptr, iTab int32) int32 {
 107659 	bp := tls.Alloc(48)
 107660 	defer tls.Free(48)
 107661 
 107662 	p = Xsqlite3ExprSkipCollateAndLikely(tls, p)
 107663 	if p == uintptr(0) {
 107664 		return 0
 107665 	}
 107666 	if int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_NOTNULL {
 107667 		p = (*Expr)(unsafe.Pointer(p)).FpLeft
 107668 	} else {
 107669 		for int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_AND {
 107670 			if Xsqlite3ExprImpliesNonNullRow(tls, (*Expr)(unsafe.Pointer(p)).FpLeft, iTab) != 0 {
 107671 				return 1
 107672 			}
 107673 			p = (*Expr)(unsafe.Pointer(p)).FpRight
 107674 		}
 107675 	}
 107676 	(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 107677 		f func(*libc.TLS, uintptr, uintptr) int32
 107678 	}{impliesNotNullRow}))
 107679 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback = uintptr(0)
 107680 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback2 = uintptr(0)
 107681 	(*Walker)(unsafe.Pointer(bp)).FeCode = U16(0)
 107682 	*(*int32)(unsafe.Pointer(bp + 40)) = iTab
 107683 	Xsqlite3WalkExpr(tls, bp, p)
 107684 	return int32((*Walker)(unsafe.Pointer(bp)).FeCode)
 107685 }
 107686 
 107687 func exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 107688 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN &&
 107689 		(*Expr)(unsafe.Pointer(pExpr)).FiTable == (*IdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FiCur &&
 107690 		int32(Xsqlite3TableColumnToIndex(tls, (*IdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FpIdx, (*Expr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 {
 107691 		(*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(1)
 107692 		return WRC_Abort
 107693 	}
 107694 	return WRC_Continue
 107695 }
 107696 
 107697 // Determine if an index pIdx on table with cursor iCur contains will
 107698 // the expression pExpr.  Return true if the index does cover the
 107699 // expression and false if the pExpr expression references table columns
 107700 // that are not found in the index pIdx.
 107701 //
 107702 // An index covering an expression means that the expression can be
 107703 // evaluated using only the index and without having to lookup the
 107704 // corresponding table entry.
 107705 func Xsqlite3ExprCoveredByIndex(tls *libc.TLS, pExpr uintptr, iCur int32, pIdx uintptr) int32 {
 107706 	bp := tls.Alloc(64)
 107707 	defer tls.Free(64)
 107708 
 107709 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Walker{})))
 107710 	(*IdxCover)(unsafe.Pointer(bp + 48)).FiCur = iCur
 107711 	(*IdxCover)(unsafe.Pointer(bp + 48)).FpIdx = pIdx
 107712 	(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 107713 		f func(*libc.TLS, uintptr, uintptr) int32
 107714 	}{exprIdxCover}))
 107715 	*(*uintptr)(unsafe.Pointer(bp + 40)) = bp + 48
 107716 	Xsqlite3WalkExpr(tls, bp, pExpr)
 107717 	return libc.BoolInt32(!((*Walker)(unsafe.Pointer(bp)).FeCode != 0))
 107718 }
 107719 
 107720 func selectRefEnter(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 {
 107721 	var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40))
 107722 	var pSrc uintptr = (*Select)(unsafe.Pointer(pSelect)).FpSrc
 107723 	var i I64
 107724 	var j I64
 107725 	var piNew uintptr
 107726 	if (*SrcList)(unsafe.Pointer(pSrc)).FnSrc == 0 {
 107727 		return WRC_Continue
 107728 	}
 107729 	j = (*RefSrcList)(unsafe.Pointer(p)).FnExclude
 107730 	*(*I64)(unsafe.Pointer(p + 16)) += I64((*SrcList)(unsafe.Pointer(pSrc)).FnSrc)
 107731 	piNew = Xsqlite3DbRealloc(tls, (*RefSrcList)(unsafe.Pointer(p)).Fdb, (*RefSrcList)(unsafe.Pointer(p)).FaiExclude, uint64((*RefSrcList)(unsafe.Pointer(p)).FnExclude)*uint64(unsafe.Sizeof(int32(0))))
 107732 	if piNew == uintptr(0) {
 107733 		(*RefSrcList)(unsafe.Pointer(p)).FnExclude = int64(0)
 107734 		return WRC_Abort
 107735 	} else {
 107736 		(*RefSrcList)(unsafe.Pointer(p)).FaiExclude = piNew
 107737 	}
 107738 	i = int64(0)
 107739 __1:
 107740 	if !(i < I64((*SrcList)(unsafe.Pointer(pSrc)).FnSrc)) {
 107741 		goto __3
 107742 	}
 107743 	{
 107744 		*(*int32)(unsafe.Pointer((*RefSrcList)(unsafe.Pointer(p)).FaiExclude + uintptr(j)*4)) = (*SrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104)).FiCursor
 107745 
 107746 	}
 107747 	goto __2
 107748 __2:
 107749 	i++
 107750 	j++
 107751 	goto __1
 107752 	goto __3
 107753 __3:
 107754 	;
 107755 	return WRC_Continue
 107756 }
 107757 
 107758 func selectRefLeave(tls *libc.TLS, pWalker uintptr, pSelect uintptr) {
 107759 	var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40))
 107760 	var pSrc uintptr = (*Select)(unsafe.Pointer(pSelect)).FpSrc
 107761 	if (*RefSrcList)(unsafe.Pointer(p)).FnExclude != 0 {
 107762 		*(*I64)(unsafe.Pointer(p + 16)) -= I64((*SrcList)(unsafe.Pointer(pSrc)).FnSrc)
 107763 	}
 107764 }
 107765 
 107766 func exprRefToSrcList(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 107767 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN ||
 107768 		int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AGG_COLUMN {
 107769 		var i int32
 107770 		var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40))
 107771 		var pSrc uintptr = (*RefSrcList)(unsafe.Pointer(p)).FpRef
 107772 		var nSrc int32
 107773 		if pSrc != 0 {
 107774 			nSrc = (*SrcList)(unsafe.Pointer(pSrc)).FnSrc
 107775 		} else {
 107776 			nSrc = 0
 107777 		}
 107778 		for i = 0; i < nSrc; i++ {
 107779 			if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcItem)(unsafe.Pointer(pSrc+8+uintptr(i)*104)).FiCursor {
 107780 				*(*U16)(unsafe.Pointer(pWalker + 36)) |= U16(1)
 107781 				return WRC_Continue
 107782 			}
 107783 		}
 107784 		for i = 0; I64(i) < (*RefSrcList)(unsafe.Pointer(p)).FnExclude && *(*int32)(unsafe.Pointer((*RefSrcList)(unsafe.Pointer(p)).FaiExclude + uintptr(i)*4)) != (*Expr)(unsafe.Pointer(pExpr)).FiTable; i++ {
 107785 		}
 107786 		if I64(i) >= (*RefSrcList)(unsafe.Pointer(p)).FnExclude {
 107787 			*(*U16)(unsafe.Pointer(pWalker + 36)) |= U16(2)
 107788 		}
 107789 	}
 107790 	return WRC_Continue
 107791 }
 107792 
 107793 // Check to see if pExpr references any tables in pSrcList.
 107794 // Possible return values:
 107795 //
 107796 //	 1         pExpr does references a table in pSrcList.
 107797 //
 107798 //	 0         pExpr references some table that is not defined in either
 107799 //	           pSrcList or in subqueries of pExpr itself.
 107800 //
 107801 //	-1         pExpr only references no tables at all, or it only
 107802 //	           references tables defined in subqueries of pExpr itself.
 107803 //
 107804 // As currently used, pExpr is always an aggregate function call.  That
 107805 // fact is exploited for efficiency.
 107806 func Xsqlite3ReferencesSrcList(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSrcList uintptr) int32 {
 107807 	bp := tls.Alloc(80)
 107808 	defer tls.Free(80)
 107809 
 107810 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Walker{})))
 107811 	libc.Xmemset(tls, bp+48, 0, uint64(unsafe.Sizeof(RefSrcList{})))
 107812 	(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 107813 		f func(*libc.TLS, uintptr, uintptr) int32
 107814 	}{exprRefToSrcList}))
 107815 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
 107816 		f func(*libc.TLS, uintptr, uintptr) int32
 107817 	}{selectRefEnter}))
 107818 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback2 = *(*uintptr)(unsafe.Pointer(&struct {
 107819 		f func(*libc.TLS, uintptr, uintptr)
 107820 	}{selectRefLeave}))
 107821 	*(*uintptr)(unsafe.Pointer(bp + 40)) = bp + 48
 107822 	(*RefSrcList)(unsafe.Pointer(bp + 48)).Fdb = (*Parse)(unsafe.Pointer(pParse)).Fdb
 107823 	(*RefSrcList)(unsafe.Pointer(bp + 48)).FpRef = pSrcList
 107824 
 107825 	Xsqlite3WalkExprList(tls, bp, *(*uintptr)(unsafe.Pointer(pExpr + 32)))
 107826 	if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0) {
 107827 		Xsqlite3WalkExpr(tls, bp, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64)))).FpFilter)
 107828 	}
 107829 	if (*RefSrcList)(unsafe.Pointer(bp+48)).FaiExclude != 0 {
 107830 		Xsqlite3DbNNFreeNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*RefSrcList)(unsafe.Pointer(bp+48)).FaiExclude)
 107831 	}
 107832 	if int32((*Walker)(unsafe.Pointer(bp)).FeCode)&0x01 != 0 {
 107833 		return 1
 107834 	} else if (*Walker)(unsafe.Pointer(bp)).FeCode != 0 {
 107835 		return 0
 107836 	} else {
 107837 		return -1
 107838 	}
 107839 	return int32(0)
 107840 }
 107841 
 107842 func agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 107843 	if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_TokenOnly|EP_Reduced) != U32(0)) &&
 107844 		(*Expr)(unsafe.Pointer(pExpr)).FpAggInfo != uintptr(0) {
 107845 		var pAggInfo uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo
 107846 		var iAgg int32 = int32((*Expr)(unsafe.Pointer(pExpr)).FiAgg)
 107847 		var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse
 107848 		var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 107849 		if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_AGG_FUNCTION {
 107850 			if (*AggInfo_col)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol+uintptr(iAgg)*24)).FpCExpr == pExpr {
 107851 				pExpr = Xsqlite3ExprDup(tls, db, pExpr, 0)
 107852 				if pExpr != 0 {
 107853 					(*AggInfo_col)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*24)).FpCExpr = pExpr
 107854 					Xsqlite3ExprDeferredDelete(tls, pParse, pExpr)
 107855 				}
 107856 			}
 107857 		} else {
 107858 			if (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc+uintptr(iAgg)*24)).FpFExpr == pExpr {
 107859 				pExpr = Xsqlite3ExprDup(tls, db, pExpr, 0)
 107860 				if pExpr != 0 {
 107861 					(*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(iAgg)*24)).FpFExpr = pExpr
 107862 					Xsqlite3ExprDeferredDelete(tls, pParse, pExpr)
 107863 				}
 107864 			}
 107865 		}
 107866 	}
 107867 	return WRC_Continue
 107868 }
 107869 
 107870 // Initialize a Walker object so that will persist AggInfo entries referenced
 107871 // by the tree that is walked.
 107872 func Xsqlite3AggInfoPersistWalkerInit(tls *libc.TLS, pWalker uintptr, pParse uintptr) {
 107873 	libc.Xmemset(tls, pWalker, 0, uint64(unsafe.Sizeof(Walker{})))
 107874 	(*Walker)(unsafe.Pointer(pWalker)).FpParse = pParse
 107875 	(*Walker)(unsafe.Pointer(pWalker)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 107876 		f func(*libc.TLS, uintptr, uintptr) int32
 107877 	}{agginfoPersistExprCb}))
 107878 	(*Walker)(unsafe.Pointer(pWalker)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
 107879 		f func(*libc.TLS, uintptr, uintptr) int32
 107880 	}{Xsqlite3SelectWalkNoop}))
 107881 }
 107882 
 107883 func addAggInfoColumn(tls *libc.TLS, db uintptr, pInfo uintptr) int32 {
 107884 	bp := tls.Alloc(4)
 107885 	defer tls.Free(4)
 107886 
 107887 	(*AggInfo)(unsafe.Pointer(pInfo)).FaCol = Xsqlite3ArrayAllocate(tls,
 107888 		db,
 107889 		(*AggInfo)(unsafe.Pointer(pInfo)).FaCol,
 107890 		int32(unsafe.Sizeof(AggInfo_col{})),
 107891 		pInfo+32,
 107892 		bp)
 107893 	return *(*int32)(unsafe.Pointer(bp))
 107894 }
 107895 
 107896 func addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) int32 {
 107897 	bp := tls.Alloc(4)
 107898 	defer tls.Free(4)
 107899 
 107900 	(*AggInfo)(unsafe.Pointer(pInfo)).FaFunc = Xsqlite3ArrayAllocate(tls,
 107901 		db,
 107902 		(*AggInfo)(unsafe.Pointer(pInfo)).FaFunc,
 107903 		int32(unsafe.Sizeof(AggInfo_func{})),
 107904 		pInfo+48,
 107905 		bp)
 107906 	return *(*int32)(unsafe.Pointer(bp))
 107907 }
 107908 
 107909 func findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pExpr uintptr) {
 107910 	var pCol uintptr
 107911 	var k int32
 107912 	var pE uintptr
 107913 	var j int32
 107914 	var n int32
 107915 	var pGB uintptr
 107916 	var pTerm uintptr
 107917 
 107918 	pCol = (*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol
 107919 	k = 0
 107920 __1:
 107921 	if !(k < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) {
 107922 		goto __3
 107923 	}
 107924 	if !((*AggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*Expr)(unsafe.Pointer(pExpr)).FiTable &&
 107925 		int32((*AggInfo_col)(unsafe.Pointer(pCol)).FiColumn) == int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) &&
 107926 		int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_IF_NULL_ROW) {
 107927 		goto __4
 107928 	}
 107929 	goto fix_up_expr
 107930 __4:
 107931 	;
 107932 	goto __2
 107933 __2:
 107934 	k++
 107935 	pCol += 24
 107936 	goto __1
 107937 	goto __3
 107938 __3:
 107939 	;
 107940 	k = addAggInfoColumn(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pAggInfo)
 107941 	if !(k < 0) {
 107942 		goto __5
 107943 	}
 107944 
 107945 	return
 107946 __5:
 107947 	;
 107948 	pCol = (*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*24
 107949 
 107950 	(*AggInfo_col)(unsafe.Pointer(pCol)).FpTab = *(*uintptr)(unsafe.Pointer(pExpr + 64))
 107951 	(*AggInfo_col)(unsafe.Pointer(pCol)).FiTable = (*Expr)(unsafe.Pointer(pExpr)).FiTable
 107952 	(*AggInfo_col)(unsafe.Pointer(pCol)).FiColumn = (*Expr)(unsafe.Pointer(pExpr)).FiColumn
 107953 	(*AggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(-1)
 107954 	(*AggInfo_col)(unsafe.Pointer(pCol)).FpCExpr = pExpr
 107955 	if !((*AggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy != 0 && int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_IF_NULL_ROW) {
 107956 		goto __6
 107957 	}
 107958 	pGB = (*AggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy
 107959 	pTerm = pGB + 8
 107960 	n = (*ExprList)(unsafe.Pointer(pGB)).FnExpr
 107961 	j = 0
 107962 __7:
 107963 	if !(j < n) {
 107964 		goto __9
 107965 	}
 107966 	pE = (*ExprList_item)(unsafe.Pointer(pTerm)).FpExpr
 107967 	if !(int32((*Expr)(unsafe.Pointer(pE)).Fop) == TK_COLUMN &&
 107968 		(*Expr)(unsafe.Pointer(pE)).FiTable == (*Expr)(unsafe.Pointer(pExpr)).FiTable &&
 107969 		int32((*Expr)(unsafe.Pointer(pE)).FiColumn) == int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)) {
 107970 		goto __10
 107971 	}
 107972 	(*AggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = I16(j)
 107973 	goto __9
 107974 __10:
 107975 	;
 107976 	goto __8
 107977 __8:
 107978 	j++
 107979 	pTerm += 32
 107980 	goto __7
 107981 	goto __9
 107982 __9:
 107983 	;
 107984 __6:
 107985 	;
 107986 	if !(int32((*AggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) < 0) {
 107987 		goto __11
 107988 	}
 107989 	(*AggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = I16(libc.PostIncUint16(&(*AggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn, 1))
 107990 __11:
 107991 	;
 107992 fix_up_expr:
 107993 	;
 107994 	(*Expr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo
 107995 	if !(int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN) {
 107996 		goto __12
 107997 	}
 107998 	(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_AGG_COLUMN)
 107999 __12:
 108000 	;
 108001 	(*Expr)(unsafe.Pointer(pExpr)).FiAgg = I16(k)
 108002 }
 108003 
 108004 func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 108005 	bp := tls.Alloc(72)
 108006 	defer tls.Free(72)
 108007 
 108008 	var i int32
 108009 	var pNC uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40))
 108010 	var pParse uintptr = (*NameContext)(unsafe.Pointer(pNC)).FpParse
 108011 	var pSrcList uintptr = (*NameContext)(unsafe.Pointer(pNC)).FpSrcList
 108012 	var pAggInfo uintptr = *(*uintptr)(unsafe.Pointer(pNC + 16))
 108013 
 108014 	switch int32((*Expr)(unsafe.Pointer(pExpr)).Fop) {
 108015 	default:
 108016 		{
 108017 			var pIEpr uintptr
 108018 
 108019 			if (*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_InAggFunc == 0 {
 108020 				break
 108021 			}
 108022 			if (*Parse)(unsafe.Pointer(pParse)).FpIdxEpr == uintptr(0) {
 108023 				break
 108024 			}
 108025 			for pIEpr = (*Parse)(unsafe.Pointer(pParse)).FpIdxEpr; pIEpr != 0; pIEpr = (*IndexedExpr)(unsafe.Pointer(pIEpr)).FpIENext {
 108026 				var iDataCur int32 = (*IndexedExpr)(unsafe.Pointer(pIEpr)).FiDataCur
 108027 				if iDataCur < 0 {
 108028 					continue
 108029 				}
 108030 				if Xsqlite3ExprCompare(tls, uintptr(0), pExpr, (*IndexedExpr)(unsafe.Pointer(pIEpr)).FpExpr, iDataCur) == 0 {
 108031 					break
 108032 				}
 108033 			}
 108034 			if pIEpr == uintptr(0) {
 108035 				break
 108036 			}
 108037 			if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc|EP_Subrtn) == U32(0)) {
 108038 				break
 108039 			}
 108040 			if (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo != uintptr(0) {
 108041 				break
 108042 			}
 108043 
 108044 			libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Expr{})))
 108045 			(*Expr)(unsafe.Pointer(bp)).Fop = U8(TK_AGG_COLUMN)
 108046 			(*Expr)(unsafe.Pointer(bp)).FiTable = (*IndexedExpr)(unsafe.Pointer(pIEpr)).FiIdxCur
 108047 			(*Expr)(unsafe.Pointer(bp)).FiColumn = YnVar((*IndexedExpr)(unsafe.Pointer(pIEpr)).FiIdxCol)
 108048 			findOrCreateAggInfoColumn(tls, pParse, pAggInfo, bp)
 108049 			(*AggInfo_col)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*Expr)(unsafe.Pointer(bp)).FiAgg)*24)).FpCExpr = pExpr
 108050 			(*Expr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo
 108051 			(*Expr)(unsafe.Pointer(pExpr)).FiAgg = (*Expr)(unsafe.Pointer(bp)).FiAgg
 108052 			return WRC_Prune
 108053 
 108054 		}
 108055 	case TK_IF_NULL_ROW:
 108056 		fallthrough
 108057 	case TK_AGG_COLUMN:
 108058 		fallthrough
 108059 	case TK_COLUMN:
 108060 		{
 108061 			if pSrcList != uintptr(0) {
 108062 				var pItem uintptr = pSrcList + 8
 108063 				i = 0
 108064 			__1:
 108065 				if !(i < (*SrcList)(unsafe.Pointer(pSrcList)).FnSrc) {
 108066 					goto __3
 108067 				}
 108068 				{
 108069 					if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcItem)(unsafe.Pointer(pItem)).FiCursor {
 108070 						findOrCreateAggInfoColumn(tls, pParse, pAggInfo, pExpr)
 108071 						goto __3
 108072 					}
 108073 
 108074 				}
 108075 				goto __2
 108076 			__2:
 108077 				i++
 108078 				pItem += 104
 108079 				goto __1
 108080 				goto __3
 108081 			__3:
 108082 			}
 108083 			return WRC_Prune
 108084 
 108085 		}
 108086 	case TK_AGG_FUNCTION:
 108087 		{
 108088 			if (*NameContext)(unsafe.Pointer(pNC)).FncFlags&NC_InAggFunc == 0 &&
 108089 				(*Walker)(unsafe.Pointer(pWalker)).FwalkerDepth == int32((*Expr)(unsafe.Pointer(pExpr)).Fop2) {
 108090 				var pItem uintptr = (*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc
 108091 				i = 0
 108092 			__4:
 108093 				if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) {
 108094 					goto __6
 108095 				}
 108096 				{
 108097 					if (*AggInfo_func)(unsafe.Pointer(pItem)).FpFExpr == pExpr {
 108098 						goto __6
 108099 					}
 108100 					if Xsqlite3ExprCompare(tls, uintptr(0), (*AggInfo_func)(unsafe.Pointer(pItem)).FpFExpr, pExpr, -1) == 0 {
 108101 						goto __6
 108102 					}
 108103 
 108104 				}
 108105 				goto __5
 108106 			__5:
 108107 				i++
 108108 				pItem += 24
 108109 				goto __4
 108110 				goto __6
 108111 			__6:
 108112 				;
 108113 				if i >= (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc {
 108114 					var enc U8 = (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fenc
 108115 					i = addAggInfoFunc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pAggInfo)
 108116 					if i >= 0 {
 108117 						pItem = (*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24
 108118 						(*AggInfo_func)(unsafe.Pointer(pItem)).FpFExpr = pExpr
 108119 
 108120 						(*AggInfo_func)(unsafe.Pointer(pItem)).FpFunc = Xsqlite3FindFunction(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb,
 108121 							*(*uintptr)(unsafe.Pointer(pExpr + 8)),
 108122 							func() int32 {
 108123 								if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 {
 108124 									return (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr
 108125 								}
 108126 								return 0
 108127 							}(), enc, uint8(0))
 108128 						if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Distinct) != 0 {
 108129 							(*AggInfo_func)(unsafe.Pointer(pItem)).FiDistinct = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 108130 						} else {
 108131 							(*AggInfo_func)(unsafe.Pointer(pItem)).FiDistinct = -1
 108132 						}
 108133 					}
 108134 				}
 108135 
 108136 				(*Expr)(unsafe.Pointer(pExpr)).FiAgg = I16(i)
 108137 				(*Expr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo
 108138 				return WRC_Prune
 108139 			} else {
 108140 				return WRC_Continue
 108141 			}
 108142 
 108143 		}
 108144 	}
 108145 	return WRC_Continue
 108146 }
 108147 
 108148 // Analyze the pExpr expression looking for aggregate functions and
 108149 // for variables that need to be added to AggInfo object that pNC->pAggInfo
 108150 // points to.  Additional entries are made on the AggInfo object as
 108151 // necessary.
 108152 //
 108153 // This routine should only be called after the expression has been
 108154 // analyzed by sqlite3ResolveExprNames().
 108155 func Xsqlite3ExprAnalyzeAggregates(tls *libc.TLS, pNC uintptr, pExpr uintptr) {
 108156 	bp := tls.Alloc(48)
 108157 	defer tls.Free(48)
 108158 
 108159 	(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 108160 		f func(*libc.TLS, uintptr, uintptr) int32
 108161 	}{analyzeAggregate}))
 108162 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
 108163 		f func(*libc.TLS, uintptr, uintptr) int32
 108164 	}{Xsqlite3WalkerDepthIncrease}))
 108165 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback2 = *(*uintptr)(unsafe.Pointer(&struct {
 108166 		f func(*libc.TLS, uintptr, uintptr)
 108167 	}{Xsqlite3WalkerDepthDecrease}))
 108168 	(*Walker)(unsafe.Pointer(bp)).FwalkerDepth = 0
 108169 	*(*uintptr)(unsafe.Pointer(bp + 40)) = pNC
 108170 	(*Walker)(unsafe.Pointer(bp)).FpParse = uintptr(0)
 108171 
 108172 	Xsqlite3WalkExpr(tls, bp, pExpr)
 108173 }
 108174 
 108175 // Call sqlite3ExprAnalyzeAggregates() for every expression in an
 108176 // expression list.  Return the number of errors.
 108177 //
 108178 // If an error is found, the analysis is cut short.
 108179 func Xsqlite3ExprAnalyzeAggList(tls *libc.TLS, pNC uintptr, pList uintptr) {
 108180 	var pItem uintptr
 108181 	var i int32
 108182 	if pList != 0 {
 108183 		pItem = pList + 8
 108184 		i = 0
 108185 	__1:
 108186 		if !(i < (*ExprList)(unsafe.Pointer(pList)).FnExpr) {
 108187 			goto __3
 108188 		}
 108189 		{
 108190 			Xsqlite3ExprAnalyzeAggregates(tls, pNC, (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr)
 108191 
 108192 		}
 108193 		goto __2
 108194 	__2:
 108195 		i++
 108196 		pItem += 32
 108197 		goto __1
 108198 		goto __3
 108199 	__3:
 108200 	}
 108201 }
 108202 
 108203 // Allocate a single new register for use to hold some intermediate result.
 108204 func Xsqlite3GetTempReg(tls *libc.TLS, pParse uintptr) int32 {
 108205 	if int32((*Parse)(unsafe.Pointer(pParse)).FnTempReg) == 0 {
 108206 		return libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 108207 	}
 108208 	return *(*int32)(unsafe.Pointer(pParse + 228 + uintptr(libc.PreDecUint8(&(*Parse)(unsafe.Pointer(pParse)).FnTempReg, 1))*4))
 108209 }
 108210 
 108211 // Deallocate a register, making available for reuse for some other
 108212 // purpose.
 108213 func Xsqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32) {
 108214 	if iReg != 0 {
 108215 		if int32((*Parse)(unsafe.Pointer(pParse)).FnTempReg) < int32(uint64(unsafe.Sizeof([8]int32{}))/uint64(unsafe.Sizeof(int32(0)))) {
 108216 			*(*int32)(unsafe.Pointer(pParse + 228 + uintptr(libc.PostIncUint8(&(*Parse)(unsafe.Pointer(pParse)).FnTempReg, 1))*4)) = iReg
 108217 		}
 108218 	}
 108219 }
 108220 
 108221 // Allocate or deallocate a block of nReg consecutive registers.
 108222 func Xsqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) int32 {
 108223 	var i int32
 108224 	var n int32
 108225 	if nReg == 1 {
 108226 		return Xsqlite3GetTempReg(tls, pParse)
 108227 	}
 108228 	i = (*Parse)(unsafe.Pointer(pParse)).FiRangeReg
 108229 	n = (*Parse)(unsafe.Pointer(pParse)).FnRangeReg
 108230 	if nReg <= n {
 108231 		*(*int32)(unsafe.Pointer(pParse + 44)) += nReg
 108232 		*(*int32)(unsafe.Pointer(pParse + 40)) -= nReg
 108233 	} else {
 108234 		i = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 108235 		*(*int32)(unsafe.Pointer(pParse + 56)) += nReg
 108236 	}
 108237 	return i
 108238 }
 108239 
 108240 func Xsqlite3ReleaseTempRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg int32) {
 108241 	if nReg == 1 {
 108242 		Xsqlite3ReleaseTempReg(tls, pParse, iReg)
 108243 		return
 108244 	}
 108245 
 108246 	if nReg > (*Parse)(unsafe.Pointer(pParse)).FnRangeReg {
 108247 		(*Parse)(unsafe.Pointer(pParse)).FnRangeReg = nReg
 108248 		(*Parse)(unsafe.Pointer(pParse)).FiRangeReg = iReg
 108249 	}
 108250 }
 108251 
 108252 // Mark all temporary registers as being unavailable for reuse.
 108253 //
 108254 // Always invoke this procedure after coding a subroutine or co-routine
 108255 // that might be invoked from other parts of the code, to ensure that
 108256 // the sub/co-routine does not use registers in common with the code that
 108257 // invokes the sub/co-routine.
 108258 func Xsqlite3ClearTempRegCache(tls *libc.TLS, pParse uintptr) {
 108259 	(*Parse)(unsafe.Pointer(pParse)).FnTempReg = U8(0)
 108260 	(*Parse)(unsafe.Pointer(pParse)).FnRangeReg = 0
 108261 }
 108262 
 108263 func isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 {
 108264 	bp := tls.Alloc(8)
 108265 	defer tls.Free(8)
 108266 
 108267 	if 0 == Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+7733, 7) ||
 108268 		(*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Eponymous) != U32(0) ||
 108269 		(*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Shadow) != U32(0) &&
 108270 			Xsqlite3ReadOnlyShadowTables(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb) != 0 {
 108271 		Xsqlite3ErrorMsg(tls, pParse, ts+9494, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
 108272 		return 1
 108273 	}
 108274 	return 0
 108275 }
 108276 
 108277 func renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, zWhen uintptr, bNoDQS int32) {
 108278 	bp := tls.Alloc(64)
 108279 	defer tls.Free(64)
 108280 
 108281 	(*Parse)(unsafe.Pointer(pParse)).FcolNamesSet = U8(1)
 108282 	Xsqlite3NestedParse(tls, pParse,
 108283 		ts+9522,
 108284 		libc.VaList(bp, zDb,
 108285 			zDb, bTemp, zWhen, bNoDQS))
 108286 
 108287 	if bTemp == 0 {
 108288 		Xsqlite3NestedParse(tls, pParse,
 108289 			ts+9697,
 108290 			libc.VaList(bp+40, zDb, zWhen, bNoDQS))
 108291 	}
 108292 }
 108293 
 108294 func renameFixQuotes(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32) {
 108295 	bp := tls.Alloc(16)
 108296 	defer tls.Free(16)
 108297 
 108298 	Xsqlite3NestedParse(tls, pParse,
 108299 		ts+9871, libc.VaList(bp, zDb, zDb))
 108300 	if bTemp == 0 {
 108301 		Xsqlite3NestedParse(tls, pParse,
 108302 			ts+10018, 0)
 108303 	}
 108304 }
 108305 
 108306 func renameReloadSchema(tls *libc.TLS, pParse uintptr, iDb int32, p5 U16) {
 108307 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 108308 	if v != 0 {
 108309 		Xsqlite3ChangeCookie(tls, pParse, iDb)
 108310 		Xsqlite3VdbeAddParseSchemaOp(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iDb, uintptr(0), p5)
 108311 		if iDb != 1 {
 108312 			Xsqlite3VdbeAddParseSchemaOp(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, 1, uintptr(0), p5)
 108313 		}
 108314 	}
 108315 }
 108316 
 108317 // Generate code to implement the "ALTER TABLE xxx RENAME TO yyy"
 108318 // command.
 108319 func Xsqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName uintptr) {
 108320 	bp := tls.Alloc(184)
 108321 	defer tls.Free(184)
 108322 
 108323 	var iDb int32
 108324 	var zDb uintptr
 108325 	var pTab uintptr
 108326 	var zName uintptr
 108327 	var db uintptr
 108328 	var nTabName int32
 108329 	var zTabName uintptr
 108330 	var v uintptr
 108331 	var pVTab uintptr
 108332 	var i int32
 108333 	zName = uintptr(0)
 108334 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 108335 	pVTab = uintptr(0)
 108336 
 108337 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 108338 		goto __1
 108339 	}
 108340 	goto exit_rename_table
 108341 __1:
 108342 	;
 108343 	pTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), pSrc+8)
 108344 	if !!(pTab != 0) {
 108345 		goto __2
 108346 	}
 108347 	goto exit_rename_table
 108348 __2:
 108349 	;
 108350 	iDb = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Table)(unsafe.Pointer(pTab)).FpSchema)
 108351 	zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
 108352 
 108353 	zName = Xsqlite3NameFromToken(tls, db, pName)
 108354 	if !!(zName != 0) {
 108355 		goto __3
 108356 	}
 108357 	goto exit_rename_table
 108358 __3:
 108359 	;
 108360 	if !(Xsqlite3FindTable(tls, db, zName, zDb) != 0 ||
 108361 		Xsqlite3FindIndex(tls, db, zName, zDb) != 0 ||
 108362 		Xsqlite3IsShadowTableOf(tls, db, pTab, zName) != 0) {
 108363 		goto __4
 108364 	}
 108365 	Xsqlite3ErrorMsg(tls, pParse,
 108366 		ts+10169, libc.VaList(bp, zName))
 108367 	goto exit_rename_table
 108368 __4:
 108369 	;
 108370 	if !(SQLITE_OK != isAlterableTable(tls, pParse, pTab)) {
 108371 		goto __5
 108372 	}
 108373 	goto exit_rename_table
 108374 __5:
 108375 	;
 108376 	if !(SQLITE_OK != Xsqlite3CheckObjectName(tls, pParse, zName, ts+10228, zName)) {
 108377 		goto __6
 108378 	}
 108379 	goto exit_rename_table
 108380 __6:
 108381 	;
 108382 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW) {
 108383 		goto __7
 108384 	}
 108385 	Xsqlite3ErrorMsg(tls, pParse, ts+10234, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
 108386 	goto exit_rename_table
 108387 __7:
 108388 	;
 108389 	if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_ALTER_TABLE, zDb, (*Table)(unsafe.Pointer(pTab)).FzName, uintptr(0)) != 0) {
 108390 		goto __8
 108391 	}
 108392 	goto exit_rename_table
 108393 __8:
 108394 	;
 108395 	if !(Xsqlite3ViewGetColumnNames(tls, pParse, pTab) != 0) {
 108396 		goto __9
 108397 	}
 108398 	goto exit_rename_table
 108399 __9:
 108400 	;
 108401 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
 108402 		goto __10
 108403 	}
 108404 	pVTab = Xsqlite3GetVTable(tls, db, pTab)
 108405 	if !((*Sqlite3_module)(unsafe.Pointer((*Sqlite3_vtab)(unsafe.Pointer((*VTable)(unsafe.Pointer(pVTab)).FpVtab)).FpModule)).FxRename == uintptr(0)) {
 108406 		goto __11
 108407 	}
 108408 	pVTab = uintptr(0)
 108409 __11:
 108410 	;
 108411 __10:
 108412 	;
 108413 	v = Xsqlite3GetVdbe(tls, pParse)
 108414 	if !(v == uintptr(0)) {
 108415 		goto __12
 108416 	}
 108417 	goto exit_rename_table
 108418 __12:
 108419 	;
 108420 	Xsqlite3MayAbort(tls, pParse)
 108421 
 108422 	zTabName = (*Table)(unsafe.Pointer(pTab)).FzName
 108423 	nTabName = Xsqlite3Utf8CharLen(tls, zTabName, -1)
 108424 
 108425 	Xsqlite3NestedParse(tls, pParse,
 108426 		ts+10261, libc.VaList(bp+16, zDb, zDb, zTabName, zName, libc.Bool32(iDb == 1), zTabName))
 108427 
 108428 	Xsqlite3NestedParse(tls, pParse,
 108429 		ts+10445,
 108430 		libc.VaList(bp+64, zDb,
 108431 			zName, zName, zName,
 108432 			nTabName, zTabName))
 108433 
 108434 	if !(Xsqlite3FindTable(tls, db, ts+10750, zDb) != 0) {
 108435 		goto __13
 108436 	}
 108437 	Xsqlite3NestedParse(tls, pParse,
 108438 		ts+10766,
 108439 		libc.VaList(bp+112, zDb, zName, (*Table)(unsafe.Pointer(pTab)).FzName))
 108440 __13:
 108441 	;
 108442 	if !(iDb != 1) {
 108443 		goto __14
 108444 	}
 108445 	Xsqlite3NestedParse(tls, pParse,
 108446 		ts+10824, libc.VaList(bp+136, zDb, zTabName, zName, zTabName, zDb, zName))
 108447 __14:
 108448 	;
 108449 	if !(pVTab != 0) {
 108450 		goto __15
 108451 	}
 108452 	i = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 108453 	Xsqlite3VdbeLoadString(tls, v, i, zName)
 108454 	Xsqlite3VdbeAddOp4(tls, v, OP_VRename, i, 0, 0, pVTab, -11)
 108455 __15:
 108456 	;
 108457 	renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename))
 108458 	renameTestSchema(tls, pParse, zDb, libc.Bool32(iDb == 1), ts+11089, 0)
 108459 
 108460 exit_rename_table:
 108461 	Xsqlite3SrcListDelete(tls, db, pSrc)
 108462 	Xsqlite3DbFree(tls, db, zName)
 108463 }
 108464 
 108465 func sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) {
 108466 	bp := tls.Alloc(24)
 108467 	defer tls.Free(24)
 108468 
 108469 	Xsqlite3NestedParse(tls, pParse,
 108470 		ts+11102,
 108471 		libc.VaList(bp, zErr, zDb, zTab))
 108472 }
 108473 
 108474 // This function is called after an "ALTER TABLE ... ADD" statement
 108475 // has been parsed. Argument pColDef contains the text of the new
 108476 // column definition.
 108477 //
 108478 // The Table structure pParse->pNewTable was extended to include
 108479 // the new column during parsing.
 108480 func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr) {
 108481 	bp := tls.Alloc(64)
 108482 	defer tls.Free(64)
 108483 
 108484 	var pNew uintptr
 108485 	var pTab uintptr
 108486 	var iDb int32
 108487 	var zDb uintptr
 108488 	var zTab uintptr
 108489 	var zCol uintptr
 108490 	var pCol uintptr
 108491 	var pDflt uintptr
 108492 	var db uintptr
 108493 	var v uintptr
 108494 	var r1 int32
 108495 
 108496 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 108497 
 108498 	if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 108499 		return
 108500 	}
 108501 
 108502 	pNew = (*Parse)(unsafe.Pointer(pParse)).FpNewTable
 108503 
 108504 	iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pNew)).FpSchema)
 108505 	zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
 108506 	zTab = (*Table)(unsafe.Pointer(pNew)).FzName + 16
 108507 	pCol = (*Table)(unsafe.Pointer(pNew)).FaCol + uintptr(int32((*Table)(unsafe.Pointer(pNew)).FnCol)-1)*24
 108508 	pDflt = Xsqlite3ColumnExpr(tls, pNew, pCol)
 108509 	pTab = Xsqlite3FindTable(tls, db, zTab, zDb)
 108510 
 108511 	if Xsqlite3AuthCheck(tls, pParse, SQLITE_ALTER_TABLE, zDb, (*Table)(unsafe.Pointer(pTab)).FzName, uintptr(0)) != 0 {
 108512 		return
 108513 	}
 108514 
 108515 	if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_PRIMKEY != 0 {
 108516 		Xsqlite3ErrorMsg(tls, pParse, ts+11140, 0)
 108517 		return
 108518 	}
 108519 	if (*Table)(unsafe.Pointer(pNew)).FpIndex != 0 {
 108520 		Xsqlite3ErrorMsg(tls, pParse,
 108521 			ts+11172, 0)
 108522 		return
 108523 	}
 108524 	if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_GENERATED == 0 {
 108525 		if pDflt != 0 && int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pDflt)).FpLeft)).Fop) == TK_NULL {
 108526 			pDflt = uintptr(0)
 108527 		}
 108528 
 108529 		if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ForeignKeys) != 0 && *(*uintptr)(unsafe.Pointer(pNew + 64 + 8)) != 0 && pDflt != 0 {
 108530 			sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab,
 108531 				ts+11199)
 108532 		}
 108533 		if uint32(int32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && !(pDflt != 0) {
 108534 			sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab,
 108535 				ts+11258)
 108536 		}
 108537 
 108538 		if pDflt != 0 {
 108539 			*(*uintptr)(unsafe.Pointer(bp + 56)) = uintptr(0)
 108540 			var rc int32
 108541 			rc = Xsqlite3ValueFromExpr(tls, db, pDflt, uint8(SQLITE_UTF8), uint8(SQLITE_AFF_BLOB), bp+56)
 108542 
 108543 			if rc != SQLITE_OK {
 108544 				return
 108545 			}
 108546 			if !(*(*uintptr)(unsafe.Pointer(bp + 56)) != 0) {
 108547 				sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab,
 108548 					ts+11311)
 108549 			}
 108550 			Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp + 56)))
 108551 		}
 108552 	} else if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_STORED != 0 {
 108553 		sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, ts+11357)
 108554 	}
 108555 
 108556 	zCol = Xsqlite3DbStrNDup(tls, db, (*Token)(unsafe.Pointer(pColDef)).Fz, uint64((*Token)(unsafe.Pointer(pColDef)).Fn))
 108557 	if zCol != 0 {
 108558 		var zEnd uintptr = zCol + uintptr((*Token)(unsafe.Pointer(pColDef)).Fn-uint32(1))
 108559 		for zEnd > zCol && (int32(*(*int8)(unsafe.Pointer(zEnd))) == ';' || int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zEnd)))])&0x01 != 0) {
 108560 			*(*int8)(unsafe.Pointer(libc.PostDecUintptr(&zEnd, 1))) = int8(0)
 108561 		}
 108562 
 108563 		Xsqlite3NestedParse(tls, pParse,
 108564 			ts+11384,
 108565 			libc.VaList(bp, zDb, *(*int32)(unsafe.Pointer(pNew + 64)), zCol, *(*int32)(unsafe.Pointer(pNew + 64)),
 108566 				zTab))
 108567 		Xsqlite3DbFree(tls, db, zCol)
 108568 	}
 108569 
 108570 	v = Xsqlite3GetVdbe(tls, pParse)
 108571 	if v != 0 {
 108572 		r1 = Xsqlite3GetTempReg(tls, pParse)
 108573 		Xsqlite3VdbeAddOp3(tls, v, OP_ReadCookie, iDb, r1, BTREE_FILE_FORMAT)
 108574 		Xsqlite3VdbeUsesBtree(tls, v, iDb)
 108575 		Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, r1, -2)
 108576 		Xsqlite3VdbeAddOp2(tls, v, OP_IfPos, r1, Xsqlite3VdbeCurrentAddr(tls, v)+2)
 108577 
 108578 		Xsqlite3VdbeAddOp3(tls, v, OP_SetCookie, iDb, BTREE_FILE_FORMAT, 3)
 108579 		Xsqlite3ReleaseTempReg(tls, pParse, r1)
 108580 
 108581 		renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterAdd))
 108582 
 108583 		if (*Table)(unsafe.Pointer(pNew)).FpCheck != uintptr(0) ||
 108584 			uint32(int32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_GENERATED != 0 {
 108585 			Xsqlite3NestedParse(tls, pParse,
 108586 				ts+11530,
 108587 				libc.VaList(bp+40, zTab, zDb))
 108588 		}
 108589 	}
 108590 }
 108591 
 108592 // This function is called by the parser after the table-name in
 108593 // an "ALTER TABLE <table-name> ADD" statement is parsed. Argument
 108594 // pSrc is the full-name of the table being altered.
 108595 //
 108596 // This routine makes a (partial) copy of the Table structure
 108597 // for the table being altered and sets Parse.pNewTable to point
 108598 // to it. Routines called by the parser as the column definition
 108599 // is parsed (i.e. sqlite3AddColumn()) add the new Column data to
 108600 // the copy. The copy of the Table structure is deleted by tokenize.c
 108601 // after parsing is finished.
 108602 //
 108603 // Routine sqlite3AlterFinishAddColumn() will be called to complete
 108604 // coding the "ALTER TABLE ... ADD" statement.
 108605 func Xsqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) {
 108606 	bp := tls.Alloc(8)
 108607 	defer tls.Free(8)
 108608 
 108609 	var pNew uintptr
 108610 	var pTab uintptr
 108611 	var iDb int32
 108612 	var i int32
 108613 	var nAlloc int32
 108614 	var db uintptr
 108615 	var pCol uintptr
 108616 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 108617 
 108618 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 108619 		goto __1
 108620 	}
 108621 	goto exit_begin_add_column
 108622 __1:
 108623 	;
 108624 	pTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), pSrc+8)
 108625 	if !!(pTab != 0) {
 108626 		goto __2
 108627 	}
 108628 	goto exit_begin_add_column
 108629 __2:
 108630 	;
 108631 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
 108632 		goto __3
 108633 	}
 108634 	Xsqlite3ErrorMsg(tls, pParse, ts+11760, 0)
 108635 	goto exit_begin_add_column
 108636 __3:
 108637 	;
 108638 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW) {
 108639 		goto __4
 108640 	}
 108641 	Xsqlite3ErrorMsg(tls, pParse, ts+11794, 0)
 108642 	goto exit_begin_add_column
 108643 __4:
 108644 	;
 108645 	if !(SQLITE_OK != isAlterableTable(tls, pParse, pTab)) {
 108646 		goto __5
 108647 	}
 108648 	goto exit_begin_add_column
 108649 __5:
 108650 	;
 108651 	Xsqlite3MayAbort(tls, pParse)
 108652 
 108653 	iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
 108654 
 108655 	pNew = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Table{})))
 108656 	if !!(pNew != 0) {
 108657 		goto __6
 108658 	}
 108659 	goto exit_begin_add_column
 108660 __6:
 108661 	;
 108662 	(*Parse)(unsafe.Pointer(pParse)).FpNewTable = pNew
 108663 	(*Table)(unsafe.Pointer(pNew)).FnTabRef = U32(1)
 108664 	(*Table)(unsafe.Pointer(pNew)).FnCol = (*Table)(unsafe.Pointer(pTab)).FnCol
 108665 
 108666 	nAlloc = (int32((*Table)(unsafe.Pointer(pNew)).FnCol)-1)/8*8 + 8
 108667 
 108668 	(*Table)(unsafe.Pointer(pNew)).FaCol = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Column{}))*uint64(nAlloc))
 108669 	(*Table)(unsafe.Pointer(pNew)).FzName = Xsqlite3MPrintf(tls, db, ts+11824, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
 108670 	if !(!(int32((*Table)(unsafe.Pointer(pNew)).FaCol) != 0) || !(int32((*Table)(unsafe.Pointer(pNew)).FzName) != 0)) {
 108671 		goto __7
 108672 	}
 108673 
 108674 	goto exit_begin_add_column
 108675 __7:
 108676 	;
 108677 	libc.Xmemcpy(tls, (*Table)(unsafe.Pointer(pNew)).FaCol, (*Table)(unsafe.Pointer(pTab)).FaCol, uint64(unsafe.Sizeof(Column{}))*uint64((*Table)(unsafe.Pointer(pNew)).FnCol))
 108678 	i = 0
 108679 __8:
 108680 	if !(i < int32((*Table)(unsafe.Pointer(pNew)).FnCol)) {
 108681 		goto __10
 108682 	}
 108683 	pCol = (*Table)(unsafe.Pointer(pNew)).FaCol + uintptr(i)*24
 108684 	(*Column)(unsafe.Pointer(pCol)).FzCnName = Xsqlite3DbStrDup(tls, db, (*Column)(unsafe.Pointer(pCol)).FzCnName)
 108685 	(*Column)(unsafe.Pointer(pCol)).FhName = Xsqlite3StrIHash(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName)
 108686 	goto __9
 108687 __9:
 108688 	i++
 108689 	goto __8
 108690 	goto __10
 108691 __10:
 108692 	;
 108693 	*(*uintptr)(unsafe.Pointer(pNew + 64 + 16)) = Xsqlite3ExprListDup(tls, db, *(*uintptr)(unsafe.Pointer(pTab + 64 + 16)), 0)
 108694 	(*Table)(unsafe.Pointer(pNew)).FpSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpSchema
 108695 	*(*int32)(unsafe.Pointer(pNew + 64)) = *(*int32)(unsafe.Pointer(pTab + 64))
 108696 	(*Table)(unsafe.Pointer(pNew)).FnTabRef = U32(1)
 108697 
 108698 exit_begin_add_column:
 108699 	Xsqlite3SrcListDelete(tls, db, pSrc)
 108700 	return
 108701 }
 108702 
 108703 func isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr, bDrop int32) int32 {
 108704 	bp := tls.Alloc(24)
 108705 	defer tls.Free(24)
 108706 
 108707 	var zType uintptr = uintptr(0)
 108708 	if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW {
 108709 		zType = ts + 11843
 108710 	}
 108711 	if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
 108712 		zType = ts + 11848
 108713 	}
 108714 	if zType != 0 {
 108715 		Xsqlite3ErrorMsg(tls, pParse, ts+11862,
 108716 			libc.VaList(bp, func() uintptr {
 108717 				if bDrop != 0 {
 108718 					return ts + 11880
 108719 				}
 108720 				return ts + 11897
 108721 			}(),
 108722 				zType, (*Table)(unsafe.Pointer(pTab)).FzName))
 108723 		return 1
 108724 	}
 108725 	return 0
 108726 }
 108727 
 108728 // Handles the following parser reduction:
 108729 //
 108730 //	cmd ::= ALTER TABLE pSrc RENAME COLUMN pOld TO pNew
 108731 func Xsqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld uintptr, pNew uintptr) {
 108732 	bp := tls.Alloc(112)
 108733 	defer tls.Free(112)
 108734 
 108735 	var db uintptr
 108736 	var pTab uintptr
 108737 	var iCol int32
 108738 	var zOld uintptr
 108739 	var zNew uintptr
 108740 	var zDb uintptr
 108741 	var iSchema int32
 108742 	var bQuote int32
 108743 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 108744 	zOld = uintptr(0)
 108745 	zNew = uintptr(0)
 108746 
 108747 	pTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), pSrc+8)
 108748 	if !!(pTab != 0) {
 108749 		goto __1
 108750 	}
 108751 	goto exit_rename_column
 108752 __1:
 108753 	;
 108754 	if !(SQLITE_OK != isAlterableTable(tls, pParse, pTab)) {
 108755 		goto __2
 108756 	}
 108757 	goto exit_rename_column
 108758 __2:
 108759 	;
 108760 	if !(SQLITE_OK != isRealTable(tls, pParse, pTab, 0)) {
 108761 		goto __3
 108762 	}
 108763 	goto exit_rename_column
 108764 __3:
 108765 	;
 108766 	iSchema = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
 108767 
 108768 	zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iSchema)*32)).FzDbSName
 108769 
 108770 	if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_ALTER_TABLE, zDb, (*Table)(unsafe.Pointer(pTab)).FzName, uintptr(0)) != 0) {
 108771 		goto __4
 108772 	}
 108773 	goto exit_rename_column
 108774 __4:
 108775 	;
 108776 	zOld = Xsqlite3NameFromToken(tls, db, pOld)
 108777 	if !!(zOld != 0) {
 108778 		goto __5
 108779 	}
 108780 	goto exit_rename_column
 108781 __5:
 108782 	;
 108783 	iCol = 0
 108784 __6:
 108785 	if !(iCol < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 108786 		goto __8
 108787 	}
 108788 	if !(0 == Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*24)).FzCnName, zOld)) {
 108789 		goto __9
 108790 	}
 108791 	goto __8
 108792 __9:
 108793 	;
 108794 	goto __7
 108795 __7:
 108796 	iCol++
 108797 	goto __6
 108798 	goto __8
 108799 __8:
 108800 	;
 108801 	if !(iCol == int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 108802 		goto __10
 108803 	}
 108804 	Xsqlite3ErrorMsg(tls, pParse, ts+11915, libc.VaList(bp, pOld))
 108805 	goto exit_rename_column
 108806 __10:
 108807 	;
 108808 	renameTestSchema(tls, pParse, zDb, libc.Bool32(iSchema == 1), ts+1544, 0)
 108809 	renameFixQuotes(tls, pParse, zDb, libc.Bool32(iSchema == 1))
 108810 
 108811 	Xsqlite3MayAbort(tls, pParse)
 108812 	zNew = Xsqlite3NameFromToken(tls, db, pNew)
 108813 	if !!(zNew != 0) {
 108814 		goto __11
 108815 	}
 108816 	goto exit_rename_column
 108817 __11:
 108818 	;
 108819 	bQuote = int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(pNew)).Fz)))]) & 0x80
 108820 	Xsqlite3NestedParse(tls, pParse,
 108821 		ts+11936,
 108822 		libc.VaList(bp+8, zDb,
 108823 			zDb, (*Table)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.Bool32(iSchema == 1),
 108824 			(*Table)(unsafe.Pointer(pTab)).FzName))
 108825 
 108826 	Xsqlite3NestedParse(tls, pParse,
 108827 		ts+12118,
 108828 		libc.VaList(bp+72, zDb, (*Table)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote))
 108829 
 108830 	renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename))
 108831 	renameTestSchema(tls, pParse, zDb, libc.Bool32(iSchema == 1), ts+11089, 1)
 108832 
 108833 exit_rename_column:
 108834 	Xsqlite3SrcListDelete(tls, db, pSrc)
 108835 	Xsqlite3DbFree(tls, db, zOld)
 108836 	Xsqlite3DbFree(tls, db, zNew)
 108837 	return
 108838 }
 108839 
 108840 // The context of an ALTER TABLE RENAME COLUMN operation that gets passed
 108841 // down into the Walker.
 108842 type RenameCtx = RenameCtx1
 108843 
 108844 // Remember that the parser tree element pPtr was created using
 108845 // the token pToken.
 108846 //
 108847 // In other words, construct a new RenameToken object and add it
 108848 // to the list of RenameToken objects currently being built up
 108849 // in pParse->pRename.
 108850 //
 108851 // The pPtr argument is returned so that this routine can be used
 108852 // with tail recursion in tokenExpr() routine, for a small performance
 108853 // improvement.
 108854 func Xsqlite3RenameTokenMap(tls *libc.TLS, pParse uintptr, pPtr uintptr, pToken uintptr) uintptr {
 108855 	var pNew uintptr
 108856 
 108857 	if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_UNMAP {
 108858 		pNew = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(RenameToken{})))
 108859 		if pNew != 0 {
 108860 			(*RenameToken)(unsafe.Pointer(pNew)).Fp = pPtr
 108861 			(*RenameToken)(unsafe.Pointer(pNew)).Ft = *(*Token)(unsafe.Pointer(pToken))
 108862 			(*RenameToken)(unsafe.Pointer(pNew)).FpNext = (*Parse)(unsafe.Pointer(pParse)).FpRename
 108863 			(*Parse)(unsafe.Pointer(pParse)).FpRename = pNew
 108864 		}
 108865 	}
 108866 
 108867 	return pPtr
 108868 }
 108869 
 108870 // It is assumed that there is already a RenameToken object associated
 108871 // with parse tree element pFrom. This function remaps the associated token
 108872 // to parse tree element pTo.
 108873 func Xsqlite3RenameTokenRemap(tls *libc.TLS, pParse uintptr, pTo uintptr, pFrom uintptr) {
 108874 	var p uintptr
 108875 
 108876 	for p = (*Parse)(unsafe.Pointer(pParse)).FpRename; p != 0; p = (*RenameToken)(unsafe.Pointer(p)).FpNext {
 108877 		if (*RenameToken)(unsafe.Pointer(p)).Fp == pFrom {
 108878 			(*RenameToken)(unsafe.Pointer(p)).Fp = pTo
 108879 			break
 108880 		}
 108881 	}
 108882 }
 108883 
 108884 func renameUnmapExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 108885 	var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse
 108886 	Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr)
 108887 	if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc|EP_Subrtn) == U32(0) {
 108888 		Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr+64)
 108889 	}
 108890 	return WRC_Continue
 108891 }
 108892 
 108893 func renameWalkWith(tls *libc.TLS, pWalker uintptr, pSelect uintptr) {
 108894 	bp := tls.Alloc(56)
 108895 	defer tls.Free(56)
 108896 
 108897 	var pWith uintptr = (*Select)(unsafe.Pointer(pSelect)).FpWith
 108898 	if pWith != 0 {
 108899 		var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse
 108900 		var i int32
 108901 		var pCopy uintptr = uintptr(0)
 108902 
 108903 		if (*Select)(unsafe.Pointer((*Cte)(unsafe.Pointer(pWith+16)).FpSelect)).FselFlags&U32(SF_Expanded) == U32(0) {
 108904 			pCopy = Xsqlite3WithDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pWith)
 108905 			pCopy = Xsqlite3WithPush(tls, pParse, pCopy, uint8(1))
 108906 		}
 108907 		for i = 0; i < (*With)(unsafe.Pointer(pWith)).FnCte; i++ {
 108908 			var p uintptr = (*Cte)(unsafe.Pointer(pWith + 16 + uintptr(i)*48)).FpSelect
 108909 
 108910 			libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(NameContext{})))
 108911 			(*NameContext)(unsafe.Pointer(bp)).FpParse = pParse
 108912 			if pCopy != 0 {
 108913 				Xsqlite3SelectPrep(tls, (*NameContext)(unsafe.Pointer(bp)).FpParse, p, bp)
 108914 			}
 108915 			if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*NameContext)(unsafe.Pointer(bp)).FpParse)).Fdb)).FmallocFailed != 0 {
 108916 				return
 108917 			}
 108918 			Xsqlite3WalkSelect(tls, pWalker, p)
 108919 			Xsqlite3RenameExprlistUnmap(tls, pParse, (*Cte)(unsafe.Pointer(pWith+16+uintptr(i)*48)).FpCols)
 108920 		}
 108921 		if pCopy != 0 && (*Parse)(unsafe.Pointer(pParse)).FpWith == pCopy {
 108922 			(*Parse)(unsafe.Pointer(pParse)).FpWith = (*With)(unsafe.Pointer(pCopy)).FpOuter
 108923 		}
 108924 	}
 108925 }
 108926 
 108927 func unmapColumnIdlistNames(tls *libc.TLS, pParse uintptr, pIdList uintptr) {
 108928 	var ii int32
 108929 
 108930 	for ii = 0; ii < (*IdList)(unsafe.Pointer(pIdList)).FnId; ii++ {
 108931 		Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), (*IdList_item)(unsafe.Pointer(pIdList+8+uintptr(ii)*16)).FzName)
 108932 	}
 108933 }
 108934 
 108935 func renameUnmapSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 {
 108936 	var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse
 108937 	var i int32
 108938 	if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 108939 		return WRC_Abort
 108940 	}
 108941 
 108942 	if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_View|SF_CopyCte) != 0 {
 108943 		return WRC_Prune
 108944 	}
 108945 	if (*Select)(unsafe.Pointer(p)).FpEList != 0 {
 108946 		var pList uintptr = (*Select)(unsafe.Pointer(p)).FpEList
 108947 		for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ {
 108948 			if (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*32)).FzEName != 0 && int32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*32 + 16 + 4))&0x3>>0) == ENAME_NAME {
 108949 				Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*32)).FzEName)
 108950 			}
 108951 		}
 108952 	}
 108953 	if (*Select)(unsafe.Pointer(p)).FpSrc != 0 {
 108954 		var pSrc uintptr = (*Select)(unsafe.Pointer(p)).FpSrc
 108955 		for i = 0; i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc; i++ {
 108956 			Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), (*SrcItem)(unsafe.Pointer(pSrc+8+uintptr(i)*104)).FzName)
 108957 			if int32(*(*uint16)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104 + 60 + 4))&0x400>>10) == 0 {
 108958 				Xsqlite3WalkExpr(tls, pWalker, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104 + 72)))
 108959 			} else {
 108960 				unmapColumnIdlistNames(tls, pParse, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104 + 72)))
 108961 			}
 108962 		}
 108963 	}
 108964 
 108965 	renameWalkWith(tls, pWalker, p)
 108966 	return WRC_Continue
 108967 }
 108968 
 108969 // Remove all nodes that are part of expression pExpr from the rename list.
 108970 func Xsqlite3RenameExprUnmap(tls *libc.TLS, pParse uintptr, pExpr uintptr) {
 108971 	bp := tls.Alloc(48)
 108972 	defer tls.Free(48)
 108973 
 108974 	var eMode U8 = (*Parse)(unsafe.Pointer(pParse)).FeParseMode
 108975 
 108976 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Walker{})))
 108977 	(*Walker)(unsafe.Pointer(bp)).FpParse = pParse
 108978 	(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 108979 		f func(*libc.TLS, uintptr, uintptr) int32
 108980 	}{renameUnmapExprCb}))
 108981 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
 108982 		f func(*libc.TLS, uintptr, uintptr) int32
 108983 	}{renameUnmapSelectCb}))
 108984 	(*Parse)(unsafe.Pointer(pParse)).FeParseMode = U8(PARSE_MODE_UNMAP)
 108985 	Xsqlite3WalkExpr(tls, bp, pExpr)
 108986 	(*Parse)(unsafe.Pointer(pParse)).FeParseMode = eMode
 108987 }
 108988 
 108989 // Remove all nodes that are part of expression-list pEList from the
 108990 // rename list.
 108991 func Xsqlite3RenameExprlistUnmap(tls *libc.TLS, pParse uintptr, pEList uintptr) {
 108992 	bp := tls.Alloc(48)
 108993 	defer tls.Free(48)
 108994 
 108995 	if pEList != 0 {
 108996 		var i int32
 108997 
 108998 		libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Walker{})))
 108999 		(*Walker)(unsafe.Pointer(bp)).FpParse = pParse
 109000 		(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 109001 			f func(*libc.TLS, uintptr, uintptr) int32
 109002 		}{renameUnmapExprCb}))
 109003 		Xsqlite3WalkExprList(tls, bp, pEList)
 109004 		for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ {
 109005 			if int32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(i)*32 + 16 + 4))&0x3>>0) == ENAME_NAME {
 109006 				Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), (*ExprList_item)(unsafe.Pointer(pEList+8+uintptr(i)*32)).FzEName)
 109007 			}
 109008 		}
 109009 	}
 109010 }
 109011 
 109012 func renameTokenFree(tls *libc.TLS, db uintptr, pToken uintptr) {
 109013 	var pNext uintptr
 109014 	var p uintptr
 109015 	for p = pToken; p != 0; p = pNext {
 109016 		pNext = (*RenameToken)(unsafe.Pointer(p)).FpNext
 109017 		Xsqlite3DbFree(tls, db, p)
 109018 	}
 109019 }
 109020 
 109021 func renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) uintptr {
 109022 	var pp uintptr
 109023 	if pPtr == uintptr(0) {
 109024 		return uintptr(0)
 109025 	}
 109026 	for pp = pParse + 416; *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = *(*uintptr)(unsafe.Pointer(pp)) + 24 {
 109027 		if (*RenameToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).Fp == pPtr {
 109028 			var pToken uintptr = *(*uintptr)(unsafe.Pointer(pp))
 109029 			if pCtx != 0 {
 109030 				*(*uintptr)(unsafe.Pointer(pp)) = (*RenameToken)(unsafe.Pointer(pToken)).FpNext
 109031 				(*RenameToken)(unsafe.Pointer(pToken)).FpNext = (*RenameCtx1)(unsafe.Pointer(pCtx)).FpList
 109032 				(*RenameCtx1)(unsafe.Pointer(pCtx)).FpList = pToken
 109033 				(*RenameCtx1)(unsafe.Pointer(pCtx)).FnList++
 109034 			}
 109035 			return pToken
 109036 		}
 109037 	}
 109038 	return uintptr(0)
 109039 }
 109040 
 109041 func renameColumnSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 {
 109042 	if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_View|SF_CopyCte) != 0 {
 109043 		return WRC_Prune
 109044 	}
 109045 	renameWalkWith(tls, pWalker, p)
 109046 	return WRC_Continue
 109047 }
 109048 
 109049 func renameColumnExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 109050 	var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40))
 109051 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_TRIGGER &&
 109052 		int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) == (*RenameCtx)(unsafe.Pointer(p)).FiCol &&
 109053 		(*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(pWalker)).FpParse)).FpTriggerTab == (*RenameCtx)(unsafe.Pointer(p)).FpTab {
 109054 		renameTokenFind(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, p, pExpr)
 109055 	} else if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN &&
 109056 		int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) == (*RenameCtx)(unsafe.Pointer(p)).FiCol &&
 109057 		(*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc|EP_Subrtn) == U32(0) &&
 109058 		(*RenameCtx)(unsafe.Pointer(p)).FpTab == *(*uintptr)(unsafe.Pointer(pExpr + 64)) {
 109059 		renameTokenFind(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, p, pExpr)
 109060 	}
 109061 	return WRC_Continue
 109062 }
 109063 
 109064 func renameColumnTokenNext(tls *libc.TLS, pCtx uintptr) uintptr {
 109065 	var pBest uintptr = (*RenameCtx)(unsafe.Pointer(pCtx)).FpList
 109066 	var pToken uintptr
 109067 	var pp uintptr
 109068 
 109069 	for pToken = (*RenameToken)(unsafe.Pointer(pBest)).FpNext; pToken != 0; pToken = (*RenameToken)(unsafe.Pointer(pToken)).FpNext {
 109070 		if (*RenameToken)(unsafe.Pointer(pToken)).Ft.Fz > (*RenameToken)(unsafe.Pointer(pBest)).Ft.Fz {
 109071 			pBest = pToken
 109072 		}
 109073 	}
 109074 	for pp = pCtx; *(*uintptr)(unsafe.Pointer(pp)) != pBest; pp = *(*uintptr)(unsafe.Pointer(pp)) + 24 {
 109075 	}
 109076 	*(*uintptr)(unsafe.Pointer(pp)) = (*RenameToken)(unsafe.Pointer(pBest)).FpNext
 109077 
 109078 	return pBest
 109079 }
 109080 
 109081 func renameColumnParseError(tls *libc.TLS, pCtx uintptr, zWhen uintptr, pType uintptr, pObject uintptr, pParse uintptr) {
 109082 	bp := tls.Alloc(40)
 109083 	defer tls.Free(40)
 109084 
 109085 	var zT uintptr = Xsqlite3_value_text(tls, pType)
 109086 	var zN uintptr = Xsqlite3_value_text(tls, pObject)
 109087 	var zErr uintptr
 109088 
 109089 	zErr = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+12249,
 109090 		libc.VaList(bp, zT, zN, func() uintptr {
 109091 			if *(*int8)(unsafe.Pointer(zWhen)) != 0 {
 109092 				return ts + 12272
 109093 			}
 109094 			return ts + 1544
 109095 		}(), zWhen,
 109096 			(*Parse)(unsafe.Pointer(pParse)).FzErrMsg))
 109097 	Xsqlite3_result_error(tls, pCtx, zErr, -1)
 109098 	Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, zErr)
 109099 }
 109100 
 109101 func renameColumnElistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pEList uintptr, zOld uintptr) {
 109102 	if pEList != 0 {
 109103 		var i int32
 109104 		for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ {
 109105 			var zName uintptr = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*32)).FzEName
 109106 			if int32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(i)*32 + 16 + 4))&0x3>>0) == ENAME_NAME &&
 109107 				zName != uintptr(0) &&
 109108 				0 == Xsqlite3_stricmp(tls, zName, zOld) {
 109109 				renameTokenFind(tls, pParse, pCtx, zName)
 109110 			}
 109111 		}
 109112 	}
 109113 }
 109114 
 109115 func renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdList uintptr, zOld uintptr) {
 109116 	if pIdList != 0 {
 109117 		var i int32
 109118 		for i = 0; i < (*IdList)(unsafe.Pointer(pIdList)).FnId; i++ {
 109119 			var zName uintptr = (*IdList_item)(unsafe.Pointer(pIdList + 8 + uintptr(i)*16)).FzName
 109120 			if 0 == Xsqlite3_stricmp(tls, zName, zOld) {
 109121 				renameTokenFind(tls, pParse, pCtx, zName)
 109122 			}
 109123 		}
 109124 	}
 109125 }
 109126 
 109127 func renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintptr, bTemp int32) int32 {
 109128 	var rc int32
 109129 
 109130 	Xsqlite3ParseObjectInit(tls, p, db)
 109131 	if zSql == uintptr(0) {
 109132 		return SQLITE_NOMEM
 109133 	}
 109134 	if Xsqlite3_strnicmp(tls, zSql, ts+12274, 7) != 0 {
 109135 		return Xsqlite3CorruptError(tls, 113516)
 109136 	}
 109137 	(*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = func() uint8 {
 109138 		if bTemp != 0 {
 109139 			return uint8(1)
 109140 		}
 109141 		return uint8(Xsqlite3FindDbName(tls, db, zDb))
 109142 	}()
 109143 	(*Parse)(unsafe.Pointer(p)).FeParseMode = U8(PARSE_MODE_RENAME)
 109144 	(*Parse)(unsafe.Pointer(p)).Fdb = db
 109145 	(*Parse)(unsafe.Pointer(p)).FnQueryLoop = U32(1)
 109146 	rc = Xsqlite3RunParser(tls, p, zSql)
 109147 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 109148 		rc = SQLITE_NOMEM
 109149 	}
 109150 	if rc == SQLITE_OK &&
 109151 		((*Parse)(unsafe.Pointer(p)).FpNewTable == uintptr(0) && (*Parse)(unsafe.Pointer(p)).FpNewIndex == uintptr(0) && (*Parse)(unsafe.Pointer(p)).FpNewTrigger == uintptr(0)) {
 109152 		rc = Xsqlite3CorruptError(tls, 113527)
 109153 	}
 109154 
 109155 	(*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(0)
 109156 	return rc
 109157 }
 109158 
 109159 func renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, zNew uintptr, bQuote int32) int32 {
 109160 	bp := tls.Alloc(24)
 109161 	defer tls.Free(24)
 109162 
 109163 	var nNew I64 = I64(Xsqlite3Strlen30(tls, zNew))
 109164 	var nSql I64 = I64(Xsqlite3Strlen30(tls, zSql))
 109165 	var db uintptr = Xsqlite3_context_db_handle(tls, pCtx)
 109166 	var rc int32 = SQLITE_OK
 109167 	var zQuot uintptr = uintptr(0)
 109168 	var zOut uintptr
 109169 	var nQuot I64 = int64(0)
 109170 	var zBuf1 uintptr = uintptr(0)
 109171 	var zBuf2 uintptr = uintptr(0)
 109172 
 109173 	if zNew != 0 {
 109174 		zQuot = Xsqlite3MPrintf(tls, db, ts+12282, libc.VaList(bp, zNew))
 109175 		if zQuot == uintptr(0) {
 109176 			return SQLITE_NOMEM
 109177 		} else {
 109178 			nQuot = I64(Xsqlite3Strlen30(tls, zQuot) - 1)
 109179 		}
 109180 
 109181 		zOut = Xsqlite3DbMallocZero(tls, db, uint64(nSql+I64((*RenameCtx)(unsafe.Pointer(pRename)).FnList)*nQuot+int64(1)))
 109182 	} else {
 109183 		zOut = Xsqlite3DbMallocZero(tls, db, uint64((nSql*int64(2)+int64(1))*int64(3)))
 109184 		if zOut != 0 {
 109185 			zBuf1 = zOut + uintptr(nSql*int64(2)+int64(1))
 109186 			zBuf2 = zOut + uintptr(nSql*int64(4)+int64(2))
 109187 		}
 109188 	}
 109189 
 109190 	if zOut != 0 {
 109191 		var nOut int32 = int32(nSql)
 109192 		libc.Xmemcpy(tls, zOut, zSql, uint64(nSql))
 109193 		for (*RenameCtx)(unsafe.Pointer(pRename)).FpList != 0 {
 109194 			var iOff int32
 109195 			var nReplace U32
 109196 			var zReplace uintptr
 109197 			var pBest uintptr = renameColumnTokenNext(tls, pRename)
 109198 
 109199 			if zNew != 0 {
 109200 				if bQuote == 0 && Xsqlite3IsIdChar(tls, uint8(*(*int8)(unsafe.Pointer((*RenameToken)(unsafe.Pointer(pBest)).Ft.Fz)))) != 0 {
 109201 					nReplace = U32(nNew)
 109202 					zReplace = zNew
 109203 				} else {
 109204 					nReplace = U32(nQuot)
 109205 					zReplace = zQuot
 109206 					if int32(*(*int8)(unsafe.Pointer((*RenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*RenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == '"' {
 109207 						nReplace++
 109208 					}
 109209 				}
 109210 			} else {
 109211 				libc.Xmemcpy(tls, zBuf1, (*RenameToken)(unsafe.Pointer(pBest)).Ft.Fz, uint64((*RenameToken)(unsafe.Pointer(pBest)).Ft.Fn))
 109212 				*(*int8)(unsafe.Pointer(zBuf1 + uintptr((*RenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) = int8(0)
 109213 				Xsqlite3Dequote(tls, zBuf1)
 109214 				Xsqlite3_snprintf(tls, int32(nSql*int64(2)), zBuf2, ts+12288, libc.VaList(bp+8, zBuf1,
 109215 					func() uintptr {
 109216 						if int32(*(*int8)(unsafe.Pointer((*RenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*RenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == '\'' {
 109217 							return ts + 12272
 109218 						}
 109219 						return ts + 1544
 109220 					}()))
 109221 				zReplace = zBuf2
 109222 				nReplace = U32(Xsqlite3Strlen30(tls, zReplace))
 109223 			}
 109224 
 109225 			iOff = int32((int64((*RenameToken)(unsafe.Pointer(pBest)).Ft.Fz) - int64(zSql)) / 1)
 109226 			if (*RenameToken)(unsafe.Pointer(pBest)).Ft.Fn != nReplace {
 109227 				libc.Xmemmove(tls, zOut+uintptr(U32(iOff)+nReplace), zOut+uintptr(uint32(iOff)+(*RenameToken)(unsafe.Pointer(pBest)).Ft.Fn),
 109228 					uint64(uint32(nOut)-(uint32(iOff)+(*RenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))
 109229 				nOut = int32(U32(nOut) + (nReplace - (*RenameToken)(unsafe.Pointer(pBest)).Ft.Fn))
 109230 				*(*int8)(unsafe.Pointer(zOut + uintptr(nOut))) = int8(0)
 109231 			}
 109232 			libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, uint64(nReplace))
 109233 			Xsqlite3DbFree(tls, db, pBest)
 109234 		}
 109235 
 109236 		Xsqlite3_result_text(tls, pCtx, zOut, -1, libc.UintptrFromInt32(-1))
 109237 		Xsqlite3DbFree(tls, db, zOut)
 109238 	} else {
 109239 		rc = SQLITE_NOMEM
 109240 	}
 109241 
 109242 	Xsqlite3_free(tls, zQuot)
 109243 	return rc
 109244 }
 109245 
 109246 func renameResolveTrigger(tls *libc.TLS, pParse uintptr) int32 {
 109247 	bp := tls.Alloc(56)
 109248 	defer tls.Free(56)
 109249 
 109250 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 109251 	var pNew uintptr = (*Parse)(unsafe.Pointer(pParse)).FpNewTrigger
 109252 	var pStep uintptr
 109253 
 109254 	var rc int32 = SQLITE_OK
 109255 
 109256 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(NameContext{})))
 109257 	(*NameContext)(unsafe.Pointer(bp)).FpParse = pParse
 109258 
 109259 	(*Parse)(unsafe.Pointer(pParse)).FpTriggerTab = Xsqlite3FindTable(tls, db, (*Trigger)(unsafe.Pointer(pNew)).Ftable,
 109260 		(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(Xsqlite3SchemaToIndex(tls, db, (*Trigger)(unsafe.Pointer(pNew)).FpTabSchema))*32)).FzDbSName)
 109261 	(*Parse)(unsafe.Pointer(pParse)).FeTriggerOp = (*Trigger)(unsafe.Pointer(pNew)).Fop
 109262 
 109263 	if (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab != 0 {
 109264 		rc = Xsqlite3ViewGetColumnNames(tls, pParse, (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab)
 109265 	}
 109266 
 109267 	if rc == SQLITE_OK && (*Trigger)(unsafe.Pointer(pNew)).FpWhen != 0 {
 109268 		rc = Xsqlite3ResolveExprNames(tls, bp, (*Trigger)(unsafe.Pointer(pNew)).FpWhen)
 109269 	}
 109270 
 109271 	for pStep = (*Trigger)(unsafe.Pointer(pNew)).Fstep_list; rc == SQLITE_OK && pStep != 0; pStep = (*TriggerStep)(unsafe.Pointer(pStep)).FpNext {
 109272 		if (*TriggerStep)(unsafe.Pointer(pStep)).FpSelect != 0 {
 109273 			Xsqlite3SelectPrep(tls, pParse, (*TriggerStep)(unsafe.Pointer(pStep)).FpSelect, bp)
 109274 			if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 109275 				rc = (*Parse)(unsafe.Pointer(pParse)).Frc
 109276 			}
 109277 		}
 109278 		if rc == SQLITE_OK && (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget != 0 {
 109279 			var pSrc uintptr = Xsqlite3TriggerStepSrc(tls, pParse, pStep)
 109280 			if pSrc != 0 {
 109281 				var pSel uintptr = Xsqlite3SelectNew(tls,
 109282 					pParse, (*TriggerStep)(unsafe.Pointer(pStep)).FpExprList, pSrc, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0))
 109283 				if pSel == uintptr(0) {
 109284 					(*TriggerStep)(unsafe.Pointer(pStep)).FpExprList = uintptr(0)
 109285 					pSrc = uintptr(0)
 109286 					rc = SQLITE_NOMEM
 109287 				} else {
 109288 					Xsqlite3SelectPrep(tls, pParse, pSel, uintptr(0))
 109289 					if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 109290 						rc = SQLITE_ERROR
 109291 					} else {
 109292 						rc = SQLITE_OK
 109293 					}
 109294 
 109295 					if (*TriggerStep)(unsafe.Pointer(pStep)).FpExprList != 0 {
 109296 						(*Select)(unsafe.Pointer(pSel)).FpEList = uintptr(0)
 109297 					}
 109298 					(*Select)(unsafe.Pointer(pSel)).FpSrc = uintptr(0)
 109299 					Xsqlite3SelectDelete(tls, db, pSel)
 109300 				}
 109301 				if (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom != 0 {
 109302 					var i int32
 109303 					for i = 0; i < (*SrcList)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(pStep)).FpFrom)).FnSrc && rc == SQLITE_OK; i++ {
 109304 						var p uintptr = (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom + 8 + uintptr(i)*104
 109305 						if (*SrcItem)(unsafe.Pointer(p)).FpSelect != 0 {
 109306 							Xsqlite3SelectPrep(tls, pParse, (*SrcItem)(unsafe.Pointer(p)).FpSelect, uintptr(0))
 109307 						}
 109308 					}
 109309 				}
 109310 
 109311 				if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 109312 					rc = SQLITE_NOMEM
 109313 				}
 109314 				(*NameContext)(unsafe.Pointer(bp)).FpSrcList = pSrc
 109315 				if rc == SQLITE_OK && (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere != 0 {
 109316 					rc = Xsqlite3ResolveExprNames(tls, bp, (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere)
 109317 				}
 109318 				if rc == SQLITE_OK {
 109319 					rc = Xsqlite3ResolveExprListNames(tls, bp, (*TriggerStep)(unsafe.Pointer(pStep)).FpExprList)
 109320 				}
 109321 
 109322 				if (*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert != 0 && rc == SQLITE_OK {
 109323 					var pUpsert uintptr = (*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert
 109324 					(*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc = pSrc
 109325 					*(*uintptr)(unsafe.Pointer(bp + 16)) = pUpsert
 109326 					(*NameContext)(unsafe.Pointer(bp)).FncFlags = NC_UUpsert
 109327 					rc = Xsqlite3ResolveExprListNames(tls, bp, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget)
 109328 					if rc == SQLITE_OK {
 109329 						var pUpsertSet uintptr = (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSet
 109330 						rc = Xsqlite3ResolveExprListNames(tls, bp, pUpsertSet)
 109331 					}
 109332 					if rc == SQLITE_OK {
 109333 						rc = Xsqlite3ResolveExprNames(tls, bp, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertWhere)
 109334 					}
 109335 					if rc == SQLITE_OK {
 109336 						rc = Xsqlite3ResolveExprNames(tls, bp, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTargetWhere)
 109337 					}
 109338 					(*NameContext)(unsafe.Pointer(bp)).FncFlags = 0
 109339 				}
 109340 				(*NameContext)(unsafe.Pointer(bp)).FpSrcList = uintptr(0)
 109341 				Xsqlite3SrcListDelete(tls, db, pSrc)
 109342 			} else {
 109343 				rc = SQLITE_NOMEM
 109344 			}
 109345 		}
 109346 	}
 109347 	return rc
 109348 }
 109349 
 109350 func renameWalkTrigger(tls *libc.TLS, pWalker uintptr, pTrigger uintptr) {
 109351 	var pStep uintptr
 109352 
 109353 	Xsqlite3WalkExpr(tls, pWalker, (*Trigger)(unsafe.Pointer(pTrigger)).FpWhen)
 109354 
 109355 	for pStep = (*Trigger)(unsafe.Pointer(pTrigger)).Fstep_list; pStep != 0; pStep = (*TriggerStep)(unsafe.Pointer(pStep)).FpNext {
 109356 		Xsqlite3WalkSelect(tls, pWalker, (*TriggerStep)(unsafe.Pointer(pStep)).FpSelect)
 109357 		Xsqlite3WalkExpr(tls, pWalker, (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere)
 109358 		Xsqlite3WalkExprList(tls, pWalker, (*TriggerStep)(unsafe.Pointer(pStep)).FpExprList)
 109359 		if (*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert != 0 {
 109360 			var pUpsert uintptr = (*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert
 109361 			Xsqlite3WalkExprList(tls, pWalker, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget)
 109362 			Xsqlite3WalkExprList(tls, pWalker, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSet)
 109363 			Xsqlite3WalkExpr(tls, pWalker, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertWhere)
 109364 			Xsqlite3WalkExpr(tls, pWalker, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTargetWhere)
 109365 		}
 109366 		if (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom != 0 {
 109367 			var i int32
 109368 			for i = 0; i < (*SrcList)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(pStep)).FpFrom)).FnSrc; i++ {
 109369 				Xsqlite3WalkSelect(tls, pWalker, (*SrcItem)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(pStep)).FpFrom+8+uintptr(i)*104)).FpSelect)
 109370 			}
 109371 		}
 109372 	}
 109373 }
 109374 
 109375 func renameParseCleanup(tls *libc.TLS, pParse uintptr) {
 109376 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 109377 	var pIdx uintptr
 109378 	if (*Parse)(unsafe.Pointer(pParse)).FpVdbe != 0 {
 109379 		Xsqlite3VdbeFinalize(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe)
 109380 	}
 109381 	Xsqlite3DeleteTable(tls, db, (*Parse)(unsafe.Pointer(pParse)).FpNewTable)
 109382 	for libc.AssignUintptr(&pIdx, (*Parse)(unsafe.Pointer(pParse)).FpNewIndex) != uintptr(0) {
 109383 		(*Parse)(unsafe.Pointer(pParse)).FpNewIndex = (*Index)(unsafe.Pointer(pIdx)).FpNext
 109384 		Xsqlite3FreeIndex(tls, db, pIdx)
 109385 	}
 109386 	Xsqlite3DeleteTrigger(tls, db, (*Parse)(unsafe.Pointer(pParse)).FpNewTrigger)
 109387 	Xsqlite3DbFree(tls, db, (*Parse)(unsafe.Pointer(pParse)).FzErrMsg)
 109388 	renameTokenFree(tls, db, (*Parse)(unsafe.Pointer(pParse)).FpRename)
 109389 	Xsqlite3ParseObjectReset(tls, pParse)
 109390 }
 109391 
 109392 func renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) {
 109393 	bp := tls.Alloc(504)
 109394 	defer tls.Free(504)
 109395 
 109396 	var db uintptr
 109397 
 109398 	var zSql uintptr
 109399 	var zDb uintptr
 109400 	var zTable uintptr
 109401 	var iCol int32
 109402 	var zNew uintptr
 109403 	var bQuote int32
 109404 	var bTemp int32
 109405 	var zOld uintptr
 109406 	var rc int32
 109407 
 109408 	var pIdx uintptr
 109409 	var i int32
 109410 	var pTab uintptr
 109411 	var xAuth Sqlite3_xauth
 109412 	var pSelect uintptr
 109413 	var pExpr uintptr
 109414 
 109415 	var bFKOnly int32
 109416 	var pFKey uintptr
 109417 	var pUpsertSet uintptr
 109418 	var pTarget uintptr
 109419 
 109420 	var pStep uintptr
 109421 	db = Xsqlite3_context_db_handle(tls, context)
 109422 	zSql = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 109423 	zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)))
 109424 	zTable = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 4*8)))
 109425 	iCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 5*8)))
 109426 	zNew = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 6*8)))
 109427 	bQuote = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 7*8)))
 109428 	bTemp = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 8*8)))
 109429 	xAuth = (*Sqlite3)(unsafe.Pointer(db)).FxAuth
 109430 
 109431 	_ = NotUsed
 109432 	if !(zSql == uintptr(0)) {
 109433 		goto __1
 109434 	}
 109435 	return
 109436 __1:
 109437 	;
 109438 	if !(zTable == uintptr(0)) {
 109439 		goto __2
 109440 	}
 109441 	return
 109442 __2:
 109443 	;
 109444 	if !(zNew == uintptr(0)) {
 109445 		goto __3
 109446 	}
 109447 	return
 109448 __3:
 109449 	;
 109450 	if !(iCol < 0) {
 109451 		goto __4
 109452 	}
 109453 	return
 109454 __4:
 109455 	;
 109456 	Xsqlite3BtreeEnterAll(tls, db)
 109457 	pTab = Xsqlite3FindTable(tls, db, zTable, zDb)
 109458 	if !(pTab == uintptr(0) || iCol >= int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 109459 		goto __5
 109460 	}
 109461 	Xsqlite3BtreeLeaveAll(tls, db)
 109462 	return
 109463 __5:
 109464 	;
 109465 	zOld = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*24)).FzCnName
 109466 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(RenameCtx{})))
 109467 	(*RenameCtx)(unsafe.Pointer(bp)).FiCol = func() int32 {
 109468 		if iCol == int32((*Table)(unsafe.Pointer(pTab)).FiPKey) {
 109469 			return -1
 109470 		}
 109471 		return iCol
 109472 	}()
 109473 
 109474 	(*Sqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0)
 109475 	rc = renameParseSql(tls, bp+32, zDb, db, zSql, bTemp)
 109476 
 109477 	libc.Xmemset(tls, bp+456, 0, uint64(unsafe.Sizeof(Walker{})))
 109478 	(*Walker)(unsafe.Pointer(bp + 456)).FpParse = bp + 32
 109479 	(*Walker)(unsafe.Pointer(bp + 456)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 109480 		f func(*libc.TLS, uintptr, uintptr) int32
 109481 	}{renameColumnExprCb}))
 109482 	(*Walker)(unsafe.Pointer(bp + 456)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
 109483 		f func(*libc.TLS, uintptr, uintptr) int32
 109484 	}{renameColumnSelectCb}))
 109485 	*(*uintptr)(unsafe.Pointer(bp + 456 + 40)) = bp
 109486 
 109487 	(*RenameCtx)(unsafe.Pointer(bp)).FpTab = pTab
 109488 	if !(rc != SQLITE_OK) {
 109489 		goto __6
 109490 	}
 109491 	goto renameColumnFunc_done
 109492 __6:
 109493 	;
 109494 	if !((*Parse)(unsafe.Pointer(bp+32)).FpNewTable != 0) {
 109495 		goto __7
 109496 	}
 109497 	if !(int32((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32)).FpNewTable)).FeTabType) == TABTYP_VIEW) {
 109498 		goto __9
 109499 	}
 109500 	pSelect = *(*uintptr)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32)).FpNewTable + 64))
 109501 	*(*U32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(libc.CplInt32(SF_View))
 109502 	(*Parse)(unsafe.Pointer(bp + 32)).Frc = SQLITE_OK
 109503 	Xsqlite3SelectPrep(tls, bp+32, pSelect, uintptr(0))
 109504 	rc = func() int32 {
 109505 		if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 109506 			return SQLITE_NOMEM
 109507 		}
 109508 		return (*Parse)(unsafe.Pointer(bp + 32)).Frc
 109509 	}()
 109510 	if !(rc == SQLITE_OK) {
 109511 		goto __11
 109512 	}
 109513 	Xsqlite3WalkSelect(tls, bp+456, pSelect)
 109514 __11:
 109515 	;
 109516 	if !(rc != SQLITE_OK) {
 109517 		goto __12
 109518 	}
 109519 	goto renameColumnFunc_done
 109520 __12:
 109521 	;
 109522 	goto __10
 109523 __9:
 109524 	if !(int32((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32)).FpNewTable)).FeTabType) == TABTYP_NORM) {
 109525 		goto __13
 109526 	}
 109527 
 109528 	bFKOnly = Xsqlite3_stricmp(tls, zTable, (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32)).FpNewTable)).FzName)
 109529 	(*RenameCtx)(unsafe.Pointer(bp)).FpTab = (*Parse)(unsafe.Pointer(bp + 32)).FpNewTable
 109530 	if !(bFKOnly == 0) {
 109531 		goto __14
 109532 	}
 109533 	if !(iCol < int32((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32)).FpNewTable)).FnCol)) {
 109534 		goto __15
 109535 	}
 109536 	renameTokenFind(tls,
 109537 		bp+32, bp, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32)).FpNewTable)).FaCol+uintptr(iCol)*24)).FzCnName)
 109538 __15:
 109539 	;
 109540 	if !((*RenameCtx)(unsafe.Pointer(bp)).FiCol < 0) {
 109541 		goto __16
 109542 	}
 109543 	renameTokenFind(tls, bp+32, bp, (*Parse)(unsafe.Pointer(bp+32)).FpNewTable+52)
 109544 __16:
 109545 	;
 109546 	Xsqlite3WalkExprList(tls, bp+456, (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32)).FpNewTable)).FpCheck)
 109547 	pIdx = (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp + 32)).FpNewTable)).FpIndex
 109548 __17:
 109549 	if !(pIdx != 0) {
 109550 		goto __19
 109551 	}
 109552 	Xsqlite3WalkExprList(tls, bp+456, (*Index)(unsafe.Pointer(pIdx)).FaColExpr)
 109553 	goto __18
 109554 __18:
 109555 	pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
 109556 	goto __17
 109557 	goto __19
 109558 __19:
 109559 	;
 109560 	pIdx = (*Parse)(unsafe.Pointer(bp + 32)).FpNewIndex
 109561 __20:
 109562 	if !(pIdx != 0) {
 109563 		goto __22
 109564 	}
 109565 	Xsqlite3WalkExprList(tls, bp+456, (*Index)(unsafe.Pointer(pIdx)).FaColExpr)
 109566 	goto __21
 109567 __21:
 109568 	pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
 109569 	goto __20
 109570 	goto __22
 109571 __22:
 109572 	;
 109573 	i = 0
 109574 __23:
 109575 	if !(i < int32((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32)).FpNewTable)).FnCol)) {
 109576 		goto __25
 109577 	}
 109578 	pExpr = Xsqlite3ColumnExpr(tls, (*Parse)(unsafe.Pointer(bp+32)).FpNewTable,
 109579 		(*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32)).FpNewTable)).FaCol+uintptr(i)*24)
 109580 	Xsqlite3WalkExpr(tls, bp+456, pExpr)
 109581 	goto __24
 109582 __24:
 109583 	i++
 109584 	goto __23
 109585 	goto __25
 109586 __25:
 109587 	;
 109588 __14:
 109589 	;
 109590 	pFKey = *(*uintptr)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32)).FpNewTable + 64 + 8))
 109591 __26:
 109592 	if !(pFKey != 0) {
 109593 		goto __28
 109594 	}
 109595 	i = 0
 109596 __29:
 109597 	if !(i < (*FKey)(unsafe.Pointer(pFKey)).FnCol) {
 109598 		goto __31
 109599 	}
 109600 	if !(bFKOnly == 0 && (*sColMap)(unsafe.Pointer(pFKey+64+uintptr(i)*16)).FiFrom == iCol) {
 109601 		goto __32
 109602 	}
 109603 	renameTokenFind(tls, bp+32, bp, pFKey+64+uintptr(i)*16)
 109604 __32:
 109605 	;
 109606 	if !(0 == Xsqlite3_stricmp(tls, (*FKey)(unsafe.Pointer(pFKey)).FzTo, zTable) &&
 109607 		0 == Xsqlite3_stricmp(tls, (*sColMap)(unsafe.Pointer(pFKey+64+uintptr(i)*16)).FzCol, zOld)) {
 109608 		goto __33
 109609 	}
 109610 	renameTokenFind(tls, bp+32, bp, (*sColMap)(unsafe.Pointer(pFKey+64+uintptr(i)*16)).FzCol)
 109611 __33:
 109612 	;
 109613 	goto __30
 109614 __30:
 109615 	i++
 109616 	goto __29
 109617 	goto __31
 109618 __31:
 109619 	;
 109620 	goto __27
 109621 __27:
 109622 	pFKey = (*FKey)(unsafe.Pointer(pFKey)).FpNextFrom
 109623 	goto __26
 109624 	goto __28
 109625 __28:
 109626 	;
 109627 __13:
 109628 	;
 109629 __10:
 109630 	;
 109631 	goto __8
 109632 __7:
 109633 	if !((*Parse)(unsafe.Pointer(bp+32)).FpNewIndex != 0) {
 109634 		goto __34
 109635 	}
 109636 	Xsqlite3WalkExprList(tls, bp+456, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32)).FpNewIndex)).FaColExpr)
 109637 	Xsqlite3WalkExpr(tls, bp+456, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32)).FpNewIndex)).FpPartIdxWhere)
 109638 	goto __35
 109639 __34:
 109640 	rc = renameResolveTrigger(tls, bp+32)
 109641 	if !(rc != SQLITE_OK) {
 109642 		goto __36
 109643 	}
 109644 	goto renameColumnFunc_done
 109645 __36:
 109646 	;
 109647 	pStep = (*Trigger)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp + 32)).FpNewTrigger)).Fstep_list
 109648 __37:
 109649 	if !(pStep != 0) {
 109650 		goto __39
 109651 	}
 109652 	if !((*TriggerStep)(unsafe.Pointer(pStep)).FzTarget != 0) {
 109653 		goto __40
 109654 	}
 109655 	pTarget = Xsqlite3LocateTable(tls, bp+32, uint32(0), (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget, zDb)
 109656 	if !(pTarget == pTab) {
 109657 		goto __41
 109658 	}
 109659 	if !((*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert != 0) {
 109660 		goto __42
 109661 	}
 109662 	pUpsertSet = (*Upsert)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert)).FpUpsertSet
 109663 	renameColumnElistNames(tls, bp+32, bp, pUpsertSet, zOld)
 109664 __42:
 109665 	;
 109666 	renameColumnIdlistNames(tls, bp+32, bp, (*TriggerStep)(unsafe.Pointer(pStep)).FpIdList, zOld)
 109667 	renameColumnElistNames(tls, bp+32, bp, (*TriggerStep)(unsafe.Pointer(pStep)).FpExprList, zOld)
 109668 __41:
 109669 	;
 109670 __40:
 109671 	;
 109672 	goto __38
 109673 __38:
 109674 	pStep = (*TriggerStep)(unsafe.Pointer(pStep)).FpNext
 109675 	goto __37
 109676 	goto __39
 109677 __39:
 109678 	;
 109679 	if !((*Parse)(unsafe.Pointer(bp+32)).FpTriggerTab == pTab) {
 109680 		goto __43
 109681 	}
 109682 	renameColumnIdlistNames(tls, bp+32, bp, (*Trigger)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32)).FpNewTrigger)).FpColumns, zOld)
 109683 __43:
 109684 	;
 109685 	renameWalkTrigger(tls, bp+456, (*Parse)(unsafe.Pointer(bp+32)).FpNewTrigger)
 109686 __35:
 109687 	;
 109688 __8:
 109689 	;
 109690 	rc = renameEditSql(tls, context, bp, zSql, zNew, bQuote)
 109691 
 109692 renameColumnFunc_done:
 109693 	if !(rc != SQLITE_OK) {
 109694 		goto __44
 109695 	}
 109696 	if !(rc == SQLITE_ERROR && Xsqlite3WritableSchema(tls, db) != 0) {
 109697 		goto __45
 109698 	}
 109699 	Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv)))
 109700 	goto __46
 109701 __45:
 109702 	if !((*Parse)(unsafe.Pointer(bp+32)).FzErrMsg != 0) {
 109703 		goto __47
 109704 	}
 109705 	renameColumnParseError(tls, context, ts+1544, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+32)
 109706 	goto __48
 109707 __47:
 109708 	Xsqlite3_result_error_code(tls, context, rc)
 109709 __48:
 109710 	;
 109711 __46:
 109712 	;
 109713 __44:
 109714 	;
 109715 	renameParseCleanup(tls, bp+32)
 109716 	renameTokenFree(tls, db, (*RenameCtx)(unsafe.Pointer(bp)).FpList)
 109717 	(*Sqlite3)(unsafe.Pointer(db)).FxAuth = xAuth
 109718 	Xsqlite3BtreeLeaveAll(tls, db)
 109719 }
 109720 
 109721 func renameTableExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 109722 	var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40))
 109723 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN &&
 109724 		(*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc|EP_Subrtn) == U32(0) &&
 109725 		(*RenameCtx)(unsafe.Pointer(p)).FpTab == *(*uintptr)(unsafe.Pointer(pExpr + 64)) {
 109726 		renameTokenFind(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, p, pExpr+64)
 109727 	}
 109728 	return WRC_Continue
 109729 }
 109730 
 109731 func renameTableSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 {
 109732 	var i int32
 109733 	var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40))
 109734 	var pSrc uintptr = (*Select)(unsafe.Pointer(pSelect)).FpSrc
 109735 	if (*Select)(unsafe.Pointer(pSelect)).FselFlags&U32(SF_View|SF_CopyCte) != 0 {
 109736 		return WRC_Prune
 109737 	}
 109738 	if pSrc == uintptr(0) {
 109739 		return WRC_Abort
 109740 	}
 109741 	for i = 0; i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc; i++ {
 109742 		var pItem uintptr = pSrc + 8 + uintptr(i)*104
 109743 		if (*SrcItem)(unsafe.Pointer(pItem)).FpTab == (*RenameCtx)(unsafe.Pointer(p)).FpTab {
 109744 			renameTokenFind(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, p, (*SrcItem)(unsafe.Pointer(pItem)).FzName)
 109745 		}
 109746 	}
 109747 	renameWalkWith(tls, pWalker, pSelect)
 109748 
 109749 	return WRC_Continue
 109750 }
 109751 
 109752 func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) {
 109753 	bp := tls.Alloc(560)
 109754 	defer tls.Free(560)
 109755 
 109756 	var db uintptr = Xsqlite3_context_db_handle(tls, context)
 109757 	var zDb uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 109758 	var zInput uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)))
 109759 	var zOld uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 4*8)))
 109760 	var zNew uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 5*8)))
 109761 	var bTemp int32 = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 6*8)))
 109762 	_ = NotUsed
 109763 
 109764 	if zInput != 0 && zOld != 0 && zNew != 0 {
 109765 		var rc int32
 109766 		var bQuote int32 = 1
 109767 
 109768 		var xAuth Sqlite3_xauth = (*Sqlite3)(unsafe.Pointer(db)).FxAuth
 109769 		(*Sqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0)
 109770 
 109771 		Xsqlite3BtreeEnterAll(tls, db)
 109772 
 109773 		libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(RenameCtx{})))
 109774 		(*RenameCtx)(unsafe.Pointer(bp)).FpTab = Xsqlite3FindTable(tls, db, zOld, zDb)
 109775 		libc.Xmemset(tls, bp+32, 0, uint64(unsafe.Sizeof(Walker{})))
 109776 		(*Walker)(unsafe.Pointer(bp + 32)).FpParse = bp + 80
 109777 		(*Walker)(unsafe.Pointer(bp + 32)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 109778 			f func(*libc.TLS, uintptr, uintptr) int32
 109779 		}{renameTableExprCb}))
 109780 		(*Walker)(unsafe.Pointer(bp + 32)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
 109781 			f func(*libc.TLS, uintptr, uintptr) int32
 109782 		}{renameTableSelectCb}))
 109783 		*(*uintptr)(unsafe.Pointer(bp + 32 + 40)) = bp
 109784 
 109785 		rc = renameParseSql(tls, bp+80, zDb, db, zInput, bTemp)
 109786 
 109787 		if rc == SQLITE_OK {
 109788 			var isLegacy int32 = int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyAlter))
 109789 			if (*Parse)(unsafe.Pointer(bp+80)).FpNewTable != 0 {
 109790 				var pTab uintptr = (*Parse)(unsafe.Pointer(bp + 80)).FpNewTable
 109791 
 109792 				if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW {
 109793 					if isLegacy == 0 {
 109794 						var pSelect uintptr = *(*uintptr)(unsafe.Pointer(pTab + 64))
 109795 
 109796 						libc.Xmemset(tls, bp+504, 0, uint64(unsafe.Sizeof(NameContext{})))
 109797 						(*NameContext)(unsafe.Pointer(bp + 504)).FpParse = bp + 80
 109798 
 109799 						*(*U32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(libc.CplInt32(SF_View))
 109800 						Xsqlite3SelectPrep(tls, bp+80, *(*uintptr)(unsafe.Pointer(pTab + 64)), bp+504)
 109801 						if (*Parse)(unsafe.Pointer(bp+80)).FnErr != 0 {
 109802 							rc = (*Parse)(unsafe.Pointer(bp + 80)).Frc
 109803 						} else {
 109804 							Xsqlite3WalkSelect(tls, bp+32, *(*uintptr)(unsafe.Pointer(pTab + 64)))
 109805 						}
 109806 					}
 109807 				} else {
 109808 					if (isLegacy == 0 || (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ForeignKeys) != 0) &&
 109809 						!(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
 109810 						var pFKey uintptr
 109811 
 109812 						for pFKey = *(*uintptr)(unsafe.Pointer(pTab + 64 + 8)); pFKey != 0; pFKey = (*FKey)(unsafe.Pointer(pFKey)).FpNextFrom {
 109813 							if Xsqlite3_stricmp(tls, (*FKey)(unsafe.Pointer(pFKey)).FzTo, zOld) == 0 {
 109814 								renameTokenFind(tls, bp+80, bp, (*FKey)(unsafe.Pointer(pFKey)).FzTo)
 109815 							}
 109816 						}
 109817 					}
 109818 
 109819 					if Xsqlite3_stricmp(tls, zOld, (*Table)(unsafe.Pointer(pTab)).FzName) == 0 {
 109820 						(*RenameCtx)(unsafe.Pointer(bp)).FpTab = pTab
 109821 						if isLegacy == 0 {
 109822 							Xsqlite3WalkExprList(tls, bp+32, (*Table)(unsafe.Pointer(pTab)).FpCheck)
 109823 						}
 109824 						renameTokenFind(tls, bp+80, bp, (*Table)(unsafe.Pointer(pTab)).FzName)
 109825 					}
 109826 				}
 109827 			} else if (*Parse)(unsafe.Pointer(bp+80)).FpNewIndex != 0 {
 109828 				renameTokenFind(tls, bp+80, bp, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+80)).FpNewIndex)).FzName)
 109829 				if isLegacy == 0 {
 109830 					Xsqlite3WalkExpr(tls, bp+32, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+80)).FpNewIndex)).FpPartIdxWhere)
 109831 				}
 109832 			} else {
 109833 				var pTrigger uintptr = (*Parse)(unsafe.Pointer(bp + 80)).FpNewTrigger
 109834 				var pStep uintptr
 109835 				if 0 == Xsqlite3_stricmp(tls, (*Trigger)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+80)).FpNewTrigger)).Ftable, zOld) &&
 109836 					(*Table)(unsafe.Pointer((*RenameCtx)(unsafe.Pointer(bp)).FpTab)).FpSchema == (*Trigger)(unsafe.Pointer(pTrigger)).FpTabSchema {
 109837 					renameTokenFind(tls, bp+80, bp, (*Trigger)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+80)).FpNewTrigger)).Ftable)
 109838 				}
 109839 
 109840 				if isLegacy == 0 {
 109841 					rc = renameResolveTrigger(tls, bp+80)
 109842 					if rc == SQLITE_OK {
 109843 						renameWalkTrigger(tls, bp+32, pTrigger)
 109844 						for pStep = (*Trigger)(unsafe.Pointer(pTrigger)).Fstep_list; pStep != 0; pStep = (*TriggerStep)(unsafe.Pointer(pStep)).FpNext {
 109845 							if (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget != 0 && 0 == Xsqlite3_stricmp(tls, (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget, zOld) {
 109846 								renameTokenFind(tls, bp+80, bp, (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget)
 109847 							}
 109848 							if (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom != 0 {
 109849 								var i int32
 109850 								for i = 0; i < (*SrcList)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(pStep)).FpFrom)).FnSrc; i++ {
 109851 									var pItem uintptr = (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom + 8 + uintptr(i)*104
 109852 									if 0 == Xsqlite3_stricmp(tls, (*SrcItem)(unsafe.Pointer(pItem)).FzName, zOld) {
 109853 										renameTokenFind(tls, bp+80, bp, (*SrcItem)(unsafe.Pointer(pItem)).FzName)
 109854 									}
 109855 								}
 109856 							}
 109857 						}
 109858 					}
 109859 				}
 109860 			}
 109861 		}
 109862 
 109863 		if rc == SQLITE_OK {
 109864 			rc = renameEditSql(tls, context, bp, zInput, zNew, bQuote)
 109865 		}
 109866 		if rc != SQLITE_OK {
 109867 			if rc == SQLITE_ERROR && Xsqlite3WritableSchema(tls, db) != 0 {
 109868 				Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv + 3*8)))
 109869 			} else if (*Parse)(unsafe.Pointer(bp+80)).FzErrMsg != 0 {
 109870 				renameColumnParseError(tls, context, ts+1544, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+80)
 109871 			} else {
 109872 				Xsqlite3_result_error_code(tls, context, rc)
 109873 			}
 109874 		}
 109875 
 109876 		renameParseCleanup(tls, bp+80)
 109877 		renameTokenFree(tls, db, (*RenameCtx)(unsafe.Pointer(bp)).FpList)
 109878 		Xsqlite3BtreeLeaveAll(tls, db)
 109879 		(*Sqlite3)(unsafe.Pointer(db)).FxAuth = xAuth
 109880 	}
 109881 
 109882 	return
 109883 }
 109884 
 109885 func renameQuotefixExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 109886 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_STRING && (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_DblQuoted) != 0 {
 109887 		renameTokenFind(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, *(*uintptr)(unsafe.Pointer(pWalker + 40)), pExpr)
 109888 	}
 109889 	return WRC_Continue
 109890 }
 109891 
 109892 func renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) {
 109893 	bp := tls.Alloc(504)
 109894 	defer tls.Free(504)
 109895 
 109896 	var db uintptr = Xsqlite3_context_db_handle(tls, context)
 109897 	var zDb uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 109898 	var zInput uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 109899 
 109900 	var xAuth Sqlite3_xauth = (*Sqlite3)(unsafe.Pointer(db)).FxAuth
 109901 	(*Sqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0)
 109902 
 109903 	Xsqlite3BtreeEnterAll(tls, db)
 109904 
 109905 	_ = NotUsed
 109906 	if zDb != 0 && zInput != 0 {
 109907 		var rc int32
 109908 
 109909 		rc = renameParseSql(tls, bp, zDb, db, zInput, 0)
 109910 
 109911 		if rc == SQLITE_OK {
 109912 			libc.Xmemset(tls, bp+424, 0, uint64(unsafe.Sizeof(RenameCtx{})))
 109913 			libc.Xmemset(tls, bp+456, 0, uint64(unsafe.Sizeof(Walker{})))
 109914 			(*Walker)(unsafe.Pointer(bp + 456)).FpParse = bp
 109915 			(*Walker)(unsafe.Pointer(bp + 456)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 109916 				f func(*libc.TLS, uintptr, uintptr) int32
 109917 			}{renameQuotefixExprCb}))
 109918 			(*Walker)(unsafe.Pointer(bp + 456)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
 109919 				f func(*libc.TLS, uintptr, uintptr) int32
 109920 			}{renameColumnSelectCb}))
 109921 			*(*uintptr)(unsafe.Pointer(bp + 456 + 40)) = bp + 424
 109922 
 109923 			if (*Parse)(unsafe.Pointer(bp)).FpNewTable != 0 {
 109924 				if int32((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp)).FpNewTable)).FeTabType) == TABTYP_VIEW {
 109925 					var pSelect uintptr = *(*uintptr)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp)).FpNewTable + 64))
 109926 					*(*U32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(libc.CplInt32(SF_View))
 109927 					(*Parse)(unsafe.Pointer(bp)).Frc = SQLITE_OK
 109928 					Xsqlite3SelectPrep(tls, bp, pSelect, uintptr(0))
 109929 					rc = func() int32 {
 109930 						if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 109931 							return SQLITE_NOMEM
 109932 						}
 109933 						return (*Parse)(unsafe.Pointer(bp)).Frc
 109934 					}()
 109935 					if rc == SQLITE_OK {
 109936 						Xsqlite3WalkSelect(tls, bp+456, pSelect)
 109937 					}
 109938 				} else {
 109939 					var i int32
 109940 					Xsqlite3WalkExprList(tls, bp+456, (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp)).FpNewTable)).FpCheck)
 109941 					for i = 0; i < int32((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp)).FpNewTable)).FnCol); i++ {
 109942 						Xsqlite3WalkExpr(tls, bp+456,
 109943 							Xsqlite3ColumnExpr(tls, (*Parse)(unsafe.Pointer(bp)).FpNewTable,
 109944 								(*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp)).FpNewTable)).FaCol+uintptr(i)*24))
 109945 					}
 109946 				}
 109947 			} else if (*Parse)(unsafe.Pointer(bp)).FpNewIndex != 0 {
 109948 				Xsqlite3WalkExprList(tls, bp+456, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp)).FpNewIndex)).FaColExpr)
 109949 				Xsqlite3WalkExpr(tls, bp+456, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp)).FpNewIndex)).FpPartIdxWhere)
 109950 			} else {
 109951 				rc = renameResolveTrigger(tls, bp)
 109952 				if rc == SQLITE_OK {
 109953 					renameWalkTrigger(tls, bp+456, (*Parse)(unsafe.Pointer(bp)).FpNewTrigger)
 109954 				}
 109955 			}
 109956 
 109957 			if rc == SQLITE_OK {
 109958 				rc = renameEditSql(tls, context, bp+424, zInput, uintptr(0), 0)
 109959 			}
 109960 			renameTokenFree(tls, db, (*RenameCtx)(unsafe.Pointer(bp+424)).FpList)
 109961 		}
 109962 		if rc != SQLITE_OK {
 109963 			if Xsqlite3WritableSchema(tls, db) != 0 && rc == SQLITE_ERROR {
 109964 				Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 109965 			} else {
 109966 				Xsqlite3_result_error_code(tls, context, rc)
 109967 			}
 109968 		}
 109969 		renameParseCleanup(tls, bp)
 109970 	}
 109971 
 109972 	(*Sqlite3)(unsafe.Pointer(db)).FxAuth = xAuth
 109973 
 109974 	Xsqlite3BtreeLeaveAll(tls, db)
 109975 }
 109976 
 109977 func renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) {
 109978 	bp := tls.Alloc(480)
 109979 	defer tls.Free(480)
 109980 
 109981 	var db uintptr = Xsqlite3_context_db_handle(tls, context)
 109982 	var zDb uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 109983 	var zInput uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 109984 	var bTemp int32 = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 4*8)))
 109985 	var isLegacy int32 = int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyAlter))
 109986 	var zWhen uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 5*8)))
 109987 	var bNoDQS int32 = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 6*8)))
 109988 
 109989 	var xAuth Sqlite3_xauth = (*Sqlite3)(unsafe.Pointer(db)).FxAuth
 109990 	(*Sqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0)
 109991 
 109992 	_ = NotUsed
 109993 
 109994 	if zDb != 0 && zInput != 0 {
 109995 		var rc int32
 109996 
 109997 		var flags int32 = int32((*Sqlite3)(unsafe.Pointer(db)).Fflags)
 109998 		if bNoDQS != 0 {
 109999 			*(*U64)(unsafe.Pointer(db + 48)) &= libc.Uint64FromInt32(libc.CplInt32(SQLITE_DqsDML | SQLITE_DqsDDL))
 110000 		}
 110001 		rc = renameParseSql(tls, bp, zDb, db, zInput, bTemp)
 110002 		*(*U64)(unsafe.Pointer(db + 48)) |= U64(flags & (SQLITE_DqsDML | SQLITE_DqsDDL))
 110003 		if rc == SQLITE_OK {
 110004 			if isLegacy == 0 && (*Parse)(unsafe.Pointer(bp)).FpNewTable != 0 && int32((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp)).FpNewTable)).FeTabType) == TABTYP_VIEW {
 110005 				libc.Xmemset(tls, bp+424, 0, uint64(unsafe.Sizeof(NameContext{})))
 110006 				(*NameContext)(unsafe.Pointer(bp + 424)).FpParse = bp
 110007 				Xsqlite3SelectPrep(tls, bp, *(*uintptr)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp)).FpNewTable + 64)), bp+424)
 110008 				if (*Parse)(unsafe.Pointer(bp)).FnErr != 0 {
 110009 					rc = (*Parse)(unsafe.Pointer(bp)).Frc
 110010 				}
 110011 			} else if (*Parse)(unsafe.Pointer(bp)).FpNewTrigger != 0 {
 110012 				if isLegacy == 0 {
 110013 					rc = renameResolveTrigger(tls, bp)
 110014 				}
 110015 				if rc == SQLITE_OK {
 110016 					var i1 int32 = Xsqlite3SchemaToIndex(tls, db, (*Trigger)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp)).FpNewTrigger)).FpTabSchema)
 110017 					var i2 int32 = Xsqlite3FindDbName(tls, db, zDb)
 110018 					if i1 == i2 {
 110019 						Xsqlite3_result_int(tls, context, 1)
 110020 					}
 110021 				}
 110022 			}
 110023 		}
 110024 
 110025 		if rc != SQLITE_OK && zWhen != 0 && !(Xsqlite3WritableSchema(tls, db) != 0) {
 110026 			renameColumnParseError(tls, context, zWhen, *(*uintptr)(unsafe.Pointer(argv + 2*8)), *(*uintptr)(unsafe.Pointer(argv + 3*8)), bp)
 110027 		}
 110028 		renameParseCleanup(tls, bp)
 110029 	}
 110030 
 110031 	(*Sqlite3)(unsafe.Pointer(db)).FxAuth = xAuth
 110032 }
 110033 
 110034 func dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) {
 110035 	bp := tls.Alloc(448)
 110036 	defer tls.Free(448)
 110037 
 110038 	var db uintptr
 110039 	var iSchema int32
 110040 	var zSql uintptr
 110041 	var iCol int32
 110042 	var zDb uintptr
 110043 	var rc int32
 110044 
 110045 	var pCol uintptr
 110046 	var pTab uintptr
 110047 	var zEnd uintptr
 110048 	var zNew uintptr
 110049 	var xAuth Sqlite3_xauth
 110050 	var pEnd uintptr
 110051 	db = Xsqlite3_context_db_handle(tls, context)
 110052 	iSchema = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv)))
 110053 	zSql = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 110054 	iCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))
 110055 	zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iSchema)*32)).FzDbSName
 110056 	zNew = uintptr(0)
 110057 	xAuth = (*Sqlite3)(unsafe.Pointer(db)).FxAuth
 110058 	(*Sqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0)
 110059 
 110060 	_ = NotUsed
 110061 	rc = renameParseSql(tls, bp+24, zDb, db, zSql, libc.Bool32(iSchema == 1))
 110062 	if !(rc != SQLITE_OK) {
 110063 		goto __1
 110064 	}
 110065 	goto drop_column_done
 110066 __1:
 110067 	;
 110068 	pTab = (*Parse)(unsafe.Pointer(bp + 24)).FpNewTable
 110069 	if !(pTab == uintptr(0) || int32((*Table)(unsafe.Pointer(pTab)).FnCol) == 1 || iCol >= int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 110070 		goto __2
 110071 	}
 110072 
 110073 	rc = Xsqlite3CorruptError(tls, 114463)
 110074 	goto drop_column_done
 110075 __2:
 110076 	;
 110077 	pCol = renameTokenFind(tls, bp+24, uintptr(0), (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*24)).FzCnName)
 110078 	if !(iCol < int32((*Table)(unsafe.Pointer(pTab)).FnCol)-1) {
 110079 		goto __3
 110080 	}
 110081 	pEnd = renameTokenFind(tls, bp+24, uintptr(0), (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol+1)*24)).FzCnName)
 110082 	zEnd = (*RenameToken)(unsafe.Pointer(pEnd)).Ft.Fz
 110083 	goto __4
 110084 __3:
 110085 	;
 110086 	zEnd = zSql + uintptr(*(*int32)(unsafe.Pointer(pTab + 64)))
 110087 __5:
 110088 	if !(int32(*(*int8)(unsafe.Pointer((*RenameToken)(unsafe.Pointer(pCol)).Ft.Fz))) != 0 && int32(*(*int8)(unsafe.Pointer((*RenameToken)(unsafe.Pointer(pCol)).Ft.Fz))) != ',') {
 110089 		goto __6
 110090 	}
 110091 	(*RenameToken)(unsafe.Pointer(pCol)).Ft.Fz--
 110092 	goto __5
 110093 __6:
 110094 	;
 110095 __4:
 110096 	;
 110097 	zNew = Xsqlite3MPrintf(tls, db, ts+12293, libc.VaList(bp, (int64((*RenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql))/1, zSql, zEnd))
 110098 	Xsqlite3_result_text(tls, context, zNew, -1, libc.UintptrFromInt32(-1))
 110099 	Xsqlite3_free(tls, zNew)
 110100 
 110101 drop_column_done:
 110102 	renameParseCleanup(tls, bp+24)
 110103 	(*Sqlite3)(unsafe.Pointer(db)).FxAuth = xAuth
 110104 	if !(rc != SQLITE_OK) {
 110105 		goto __7
 110106 	}
 110107 	Xsqlite3_result_error_code(tls, context, rc)
 110108 __7:
 110109 }
 110110 
 110111 // This function is called by the parser upon parsing an
 110112 //
 110113 //	ALTER TABLE pSrc DROP COLUMN pName
 110114 //
 110115 // statement. Argument pSrc contains the possibly qualified name of the
 110116 // table being edited, and token pName the name of the column to drop.
 110117 func Xsqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName uintptr) {
 110118 	bp := tls.Alloc(64)
 110119 	defer tls.Free(64)
 110120 
 110121 	var db uintptr
 110122 	var pTab uintptr
 110123 	var iDb int32
 110124 	var zDb uintptr
 110125 	var zCol uintptr
 110126 	var iCol int32
 110127 	var iPos int32
 110128 	var iColPos int32
 110129 	var regOut int32
 110130 	var i int32
 110131 	var addr int32
 110132 	var reg int32
 110133 	var regRec int32
 110134 	var pPk uintptr
 110135 	var nField int32
 110136 	var iCur int32
 110137 	var v uintptr
 110138 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 110139 	zCol = uintptr(0)
 110140 
 110141 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 110142 		goto __1
 110143 	}
 110144 	goto exit_drop_column
 110145 __1:
 110146 	;
 110147 	pTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), pSrc+8)
 110148 	if !!(pTab != 0) {
 110149 		goto __2
 110150 	}
 110151 	goto exit_drop_column
 110152 __2:
 110153 	;
 110154 	if !(SQLITE_OK != isAlterableTable(tls, pParse, pTab)) {
 110155 		goto __3
 110156 	}
 110157 	goto exit_drop_column
 110158 __3:
 110159 	;
 110160 	if !(SQLITE_OK != isRealTable(tls, pParse, pTab, 1)) {
 110161 		goto __4
 110162 	}
 110163 	goto exit_drop_column
 110164 __4:
 110165 	;
 110166 	zCol = Xsqlite3NameFromToken(tls, db, pName)
 110167 	if !(zCol == uintptr(0)) {
 110168 		goto __5
 110169 	}
 110170 
 110171 	goto exit_drop_column
 110172 __5:
 110173 	;
 110174 	iCol = Xsqlite3ColumnIndex(tls, pTab, zCol)
 110175 	if !(iCol < 0) {
 110176 		goto __6
 110177 	}
 110178 	Xsqlite3ErrorMsg(tls, pParse, ts+11915, libc.VaList(bp, pName))
 110179 	goto exit_drop_column
 110180 __6:
 110181 	;
 110182 	if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*24)).FcolFlags)&(COLFLAG_PRIMKEY|COLFLAG_UNIQUE) != 0) {
 110183 		goto __7
 110184 	}
 110185 	Xsqlite3ErrorMsg(tls, pParse, ts+12300,
 110186 		libc.VaList(bp+8, func() uintptr {
 110187 			if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*24)).FcolFlags)&COLFLAG_PRIMKEY != 0 {
 110188 				return ts + 12328
 110189 			}
 110190 			return ts + 7479
 110191 		}(),
 110192 			zCol))
 110193 	goto exit_drop_column
 110194 __7:
 110195 	;
 110196 	if !(int32((*Table)(unsafe.Pointer(pTab)).FnCol) <= 1) {
 110197 		goto __8
 110198 	}
 110199 	Xsqlite3ErrorMsg(tls, pParse, ts+12340, libc.VaList(bp+24, zCol))
 110200 	goto exit_drop_column
 110201 __8:
 110202 	;
 110203 	iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
 110204 
 110205 	zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
 110206 
 110207 	if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_ALTER_TABLE, zDb, (*Table)(unsafe.Pointer(pTab)).FzName, zCol) != 0) {
 110208 		goto __9
 110209 	}
 110210 	goto exit_drop_column
 110211 __9:
 110212 	;
 110213 	renameTestSchema(tls, pParse, zDb, libc.Bool32(iDb == 1), ts+1544, 0)
 110214 	renameFixQuotes(tls, pParse, zDb, libc.Bool32(iDb == 1))
 110215 	Xsqlite3NestedParse(tls, pParse,
 110216 		ts+12388, libc.VaList(bp+32, zDb, iDb, iCol, (*Table)(unsafe.Pointer(pTab)).FzName))
 110217 
 110218 	renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterDrop))
 110219 	renameTestSchema(tls, pParse, zDb, libc.Bool32(iDb == 1), ts+12509, 1)
 110220 
 110221 	if !((*Parse)(unsafe.Pointer(pParse)).FnErr == 0 && int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*24)).FcolFlags)&COLFLAG_VIRTUAL == 0) {
 110222 		goto __10
 110223 	}
 110224 	pPk = uintptr(0)
 110225 	nField = 0
 110226 	v = Xsqlite3GetVdbe(tls, pParse)
 110227 	iCur = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 110228 	Xsqlite3OpenTable(tls, pParse, iCur, iDb, pTab, OP_OpenWrite)
 110229 	addr = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, iCur)
 110230 	reg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 110231 	if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 110232 		goto __11
 110233 	}
 110234 	Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iCur, reg)
 110235 	*(*int32)(unsafe.Pointer(pParse + 56)) += int32((*Table)(unsafe.Pointer(pTab)).FnCol)
 110236 	goto __12
 110237 __11:
 110238 	pPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
 110239 	*(*int32)(unsafe.Pointer(pParse + 56)) += int32((*Index)(unsafe.Pointer(pPk)).FnColumn)
 110240 	i = 0
 110241 __13:
 110242 	if !(i < int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol)) {
 110243 		goto __15
 110244 	}
 110245 	Xsqlite3VdbeAddOp3(tls, v, OP_Column, iCur, i, reg+i+1)
 110246 	goto __14
 110247 __14:
 110248 	i++
 110249 	goto __13
 110250 	goto __15
 110251 __15:
 110252 	;
 110253 	nField = int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol)
 110254 __12:
 110255 	;
 110256 	regRec = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 110257 	i = 0
 110258 __16:
 110259 	if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 110260 		goto __18
 110261 	}
 110262 	if !(i != iCol && int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24)).FcolFlags)&COLFLAG_VIRTUAL == 0) {
 110263 		goto __19
 110264 	}
 110265 	if !(pPk != 0) {
 110266 		goto __20
 110267 	}
 110268 	iPos = int32(Xsqlite3TableColumnToIndex(tls, pPk, int16(i)))
 110269 	iColPos = int32(Xsqlite3TableColumnToIndex(tls, pPk, int16(iCol)))
 110270 	if !(iPos < int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol)) {
 110271 		goto __22
 110272 	}
 110273 	goto __17
 110274 __22:
 110275 	;
 110276 	regOut = reg + 1 + iPos - libc.Bool32(iPos > iColPos)
 110277 	goto __21
 110278 __20:
 110279 	regOut = reg + 1 + nField
 110280 __21:
 110281 	;
 110282 	if !(i == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) {
 110283 		goto __23
 110284 	}
 110285 	Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regOut)
 110286 	goto __24
 110287 __23:
 110288 	Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iCur, i, regOut)
 110289 __24:
 110290 	;
 110291 	nField++
 110292 __19:
 110293 	;
 110294 	goto __17
 110295 __17:
 110296 	i++
 110297 	goto __16
 110298 	goto __18
 110299 __18:
 110300 	;
 110301 	if !(nField == 0) {
 110302 		goto __25
 110303 	}
 110304 
 110305 	(*Parse)(unsafe.Pointer(pParse)).FnMem++
 110306 	Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, reg+1)
 110307 	nField = 1
 110308 __25:
 110309 	;
 110310 	Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, reg+1, nField, regRec)
 110311 	if !(pPk != 0) {
 110312 		goto __26
 110313 	}
 110314 	Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iCur, regRec, reg+1, int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol))
 110315 	goto __27
 110316 __26:
 110317 	Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iCur, regRec, reg)
 110318 __27:
 110319 	;
 110320 	Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION))
 110321 
 110322 	Xsqlite3VdbeAddOp2(tls, v, OP_Next, iCur, addr+1)
 110323 	Xsqlite3VdbeJumpHere(tls, v, addr)
 110324 __10:
 110325 	;
 110326 exit_drop_column:
 110327 	Xsqlite3DbFree(tls, db, zCol)
 110328 	Xsqlite3SrcListDelete(tls, db, pSrc)
 110329 }
 110330 
 110331 // Register built-in functions used to help implement ALTER TABLE
 110332 func Xsqlite3AlterFunctions(tls *libc.TLS) {
 110333 	Xsqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&aAlterTableFuncs)), int32(uint64(unsafe.Sizeof(aAlterTableFuncs))/uint64(unsafe.Sizeof(FuncDef{}))))
 110334 }
 110335 
 110336 var aAlterTableFuncs = [5]FuncDef{
 110337 	{FnArg: int8(9), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_INTERNAL | SQLITE_UTF8 | SQLITE_FUNC_CONSTANT), FxSFunc: 0, FzName: ts + 12527},
 110338 	{FnArg: int8(7), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_INTERNAL | SQLITE_UTF8 | SQLITE_FUNC_CONSTANT), FxSFunc: 0, FzName: ts + 12548},
 110339 	{FnArg: int8(7), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_INTERNAL | SQLITE_UTF8 | SQLITE_FUNC_CONSTANT), FxSFunc: 0, FzName: ts + 12568},
 110340 	{FnArg: int8(3), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_INTERNAL | SQLITE_UTF8 | SQLITE_FUNC_CONSTANT), FxSFunc: 0, FzName: ts + 12587},
 110341 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_INTERNAL | SQLITE_UTF8 | SQLITE_FUNC_CONSTANT), FxSFunc: 0, FzName: ts + 12606}}
 110342 
 110343 func openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zWhere uintptr, zWhereType uintptr) {
 110344 	bp := tls.Alloc(88)
 110345 	defer tls.Free(88)
 110346 
 110347 	var i int32
 110348 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 110349 	var pDb uintptr
 110350 	var v uintptr = Xsqlite3GetVdbe(tls, pParse)
 110351 
 110352 	var nToOpen int32
 110353 	if (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_Stat4) == U32(0) {
 110354 		nToOpen = 2
 110355 	} else {
 110356 		nToOpen = 1
 110357 	}
 110358 
 110359 	if v == uintptr(0) {
 110360 		return
 110361 	}
 110362 
 110363 	pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32
 110364 
 110365 	for i = 0; i < int32(uint64(unsafe.Sizeof(aTable))/uint64(unsafe.Sizeof(struct {
 110366 		FzName uintptr
 110367 		FzCols uintptr
 110368 	}{}))); i++ {
 110369 		var zTab uintptr = aTable[i].FzName
 110370 		var pStat uintptr
 110371 		*(*U8)(unsafe.Pointer(bp + 72 + uintptr(i))) = U8(0)
 110372 		if libc.AssignUintptr(&pStat, Xsqlite3FindTable(tls, db, zTab, (*Db)(unsafe.Pointer(pDb)).FzDbSName)) == uintptr(0) {
 110373 			if i < nToOpen {
 110374 				Xsqlite3NestedParse(tls, pParse,
 110375 					ts+12629, libc.VaList(bp, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab, aTable[i].FzCols))
 110376 				*(*U32)(unsafe.Pointer(bp + 76 + uintptr(i)*4)) = U32((*Parse)(unsafe.Pointer(pParse)).FregRoot)
 110377 				*(*U8)(unsafe.Pointer(bp + 72 + uintptr(i))) = U8(OPFLAG_P2ISREG)
 110378 			}
 110379 		} else {
 110380 			*(*U32)(unsafe.Pointer(bp + 76 + uintptr(i)*4)) = (*Table)(unsafe.Pointer(pStat)).Ftnum
 110381 			Xsqlite3TableLock(tls, pParse, iDb, *(*U32)(unsafe.Pointer(bp + 76 + uintptr(i)*4)), uint8(1), zTab)
 110382 			if zWhere != 0 {
 110383 				Xsqlite3NestedParse(tls, pParse,
 110384 					ts+12652,
 110385 					libc.VaList(bp+24, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere))
 110386 			} else if (*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 {
 110387 				Xsqlite3NestedParse(tls, pParse, ts+12682, libc.VaList(bp+56, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab))
 110388 			} else {
 110389 				Xsqlite3VdbeAddOp2(tls, v, OP_Clear, int32(*(*U32)(unsafe.Pointer(bp + 76 + uintptr(i)*4))), iDb)
 110390 			}
 110391 		}
 110392 	}
 110393 
 110394 	for i = 0; i < nToOpen; i++ {
 110395 		Xsqlite3VdbeAddOp4Int(tls, v, OP_OpenWrite, iStatCur+i, int32(*(*U32)(unsafe.Pointer(bp + 76 + uintptr(i)*4))), iDb, 3)
 110396 		Xsqlite3VdbeChangeP5(tls, v, uint16(*(*U8)(unsafe.Pointer(bp + 72 + uintptr(i)))))
 110397 
 110398 	}
 110399 }
 110400 
 110401 var aTable = [3]struct {
 110402 	FzName uintptr
 110403 	FzCols uintptr
 110404 }{
 110405 	{FzName: ts + 12700, FzCols: ts + 12713},
 110406 	{FzName: ts + 12726, FzCols: ts + 12739},
 110407 	{FzName: ts + 12767},
 110408 }
 110409 
 110410 // Three SQL functions - stat_init(), stat_push(), and stat_get() -
 110411 // share an instance of the following structure to hold their state
 110412 // information.
 110413 type StatAccum1 = struct {
 110414 	Fdb          uintptr
 110415 	FnEst        TRowcnt
 110416 	FnRow        TRowcnt
 110417 	FnLimit      int32
 110418 	FnCol        int32
 110419 	FnKeyCol     int32
 110420 	FnSkipAhead  U8
 110421 	F__ccgo_pad1 [3]byte
 110422 	Fcurrent     StatSample
 110423 	FnPSample    TRowcnt
 110424 	FmxSample    int32
 110425 	FiPrn        U32
 110426 	FaBest       uintptr
 110427 	FiMin        int32
 110428 	FnSample     int32
 110429 	FnMaxEqZero  int32
 110430 	FiGet        int32
 110431 	Fa           uintptr
 110432 }
 110433 
 110434 // Three SQL functions - stat_init(), stat_push(), and stat_get() -
 110435 // share an instance of the following structure to hold their state
 110436 // information.
 110437 type StatAccum = StatAccum1
 110438 type StatSample1 = struct {
 110439 	FanEq        uintptr
 110440 	FanDLt       uintptr
 110441 	FanLt        uintptr
 110442 	Fu           struct{ FiRowid I64 }
 110443 	FnRowid      U32
 110444 	FisPSample   U8
 110445 	F__ccgo_pad1 [3]byte
 110446 	FiCol        int32
 110447 	FiHash       U32
 110448 }
 110449 
 110450 type StatSample = StatSample1
 110451 
 110452 func sampleClear(tls *libc.TLS, db uintptr, p uintptr) {
 110453 	if (*StatSample)(unsafe.Pointer(p)).FnRowid != 0 {
 110454 		Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 24)))
 110455 		(*StatSample)(unsafe.Pointer(p)).FnRowid = U32(0)
 110456 	}
 110457 }
 110458 
 110459 func sampleSetRowid(tls *libc.TLS, db uintptr, p uintptr, n int32, pData uintptr) {
 110460 	if (*StatSample)(unsafe.Pointer(p)).FnRowid != 0 {
 110461 		Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 24)))
 110462 	}
 110463 	*(*uintptr)(unsafe.Pointer(p + 24)) = Xsqlite3DbMallocRawNN(tls, db, uint64(n))
 110464 	if *(*uintptr)(unsafe.Pointer(p + 24)) != 0 {
 110465 		(*StatSample)(unsafe.Pointer(p)).FnRowid = U32(n)
 110466 		libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(p + 24)), pData, uint64(n))
 110467 	} else {
 110468 		(*StatSample)(unsafe.Pointer(p)).FnRowid = U32(0)
 110469 	}
 110470 }
 110471 
 110472 func sampleSetRowidInt64(tls *libc.TLS, db uintptr, p uintptr, iRowid I64) {
 110473 	if (*StatSample)(unsafe.Pointer(p)).FnRowid != 0 {
 110474 		Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 24)))
 110475 	}
 110476 	(*StatSample)(unsafe.Pointer(p)).FnRowid = U32(0)
 110477 	*(*I64)(unsafe.Pointer(p + 24)) = iRowid
 110478 }
 110479 
 110480 func sampleCopy(tls *libc.TLS, p uintptr, pTo uintptr, pFrom uintptr) {
 110481 	(*StatSample)(unsafe.Pointer(pTo)).FisPSample = (*StatSample)(unsafe.Pointer(pFrom)).FisPSample
 110482 	(*StatSample)(unsafe.Pointer(pTo)).FiCol = (*StatSample)(unsafe.Pointer(pFrom)).FiCol
 110483 	(*StatSample)(unsafe.Pointer(pTo)).FiHash = (*StatSample)(unsafe.Pointer(pFrom)).FiHash
 110484 	libc.Xmemcpy(tls, (*StatSample)(unsafe.Pointer(pTo)).FanEq, (*StatSample)(unsafe.Pointer(pFrom)).FanEq, uint64(unsafe.Sizeof(TRowcnt(0)))*uint64((*StatAccum)(unsafe.Pointer(p)).FnCol))
 110485 	libc.Xmemcpy(tls, (*StatSample)(unsafe.Pointer(pTo)).FanLt, (*StatSample)(unsafe.Pointer(pFrom)).FanLt, uint64(unsafe.Sizeof(TRowcnt(0)))*uint64((*StatAccum)(unsafe.Pointer(p)).FnCol))
 110486 	libc.Xmemcpy(tls, (*StatSample)(unsafe.Pointer(pTo)).FanDLt, (*StatSample)(unsafe.Pointer(pFrom)).FanDLt, uint64(unsafe.Sizeof(TRowcnt(0)))*uint64((*StatAccum)(unsafe.Pointer(p)).FnCol))
 110487 	if (*StatSample)(unsafe.Pointer(pFrom)).FnRowid != 0 {
 110488 		sampleSetRowid(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, pTo, int32((*StatSample)(unsafe.Pointer(pFrom)).FnRowid), *(*uintptr)(unsafe.Pointer(pFrom + 24)))
 110489 	} else {
 110490 		sampleSetRowidInt64(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, pTo, *(*I64)(unsafe.Pointer(pFrom + 24)))
 110491 	}
 110492 }
 110493 
 110494 func statAccumDestructor(tls *libc.TLS, pOld uintptr) {
 110495 	var p uintptr = pOld
 110496 	if (*StatAccum)(unsafe.Pointer(p)).FmxSample != 0 {
 110497 		var i int32
 110498 		for i = 0; i < (*StatAccum)(unsafe.Pointer(p)).FnCol; i++ {
 110499 			sampleClear(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, (*StatAccum)(unsafe.Pointer(p)).FaBest+uintptr(i)*48)
 110500 		}
 110501 		for i = 0; i < (*StatAccum)(unsafe.Pointer(p)).FmxSample; i++ {
 110502 			sampleClear(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, (*StatAccum)(unsafe.Pointer(p)).Fa+uintptr(i)*48)
 110503 		}
 110504 		sampleClear(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, p+40)
 110505 	}
 110506 	Xsqlite3DbFree(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, p)
 110507 }
 110508 
 110509 func statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 110510 	var p uintptr
 110511 	var nCol int32
 110512 	var nKeyCol int32
 110513 	var nColUp int32
 110514 	var n int32
 110515 	var db uintptr = Xsqlite3_context_db_handle(tls, context)
 110516 
 110517 	var mxSample int32
 110518 	if (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_Stat4) == U32(0) {
 110519 		mxSample = SQLITE_STAT4_SAMPLES
 110520 	} else {
 110521 		mxSample = 0
 110522 	}
 110523 
 110524 	_ = argc
 110525 	nCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv)))
 110526 
 110527 	if uint64(unsafe.Sizeof(TRowcnt(0))) < uint64(8) {
 110528 		nColUp = (nCol + 1) & libc.CplInt32(1)
 110529 	} else {
 110530 		nColUp = nCol
 110531 	}
 110532 	nKeyCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 110533 
 110534 	n = int32(uint64(unsafe.Sizeof(StatAccum{})) +
 110535 		uint64(unsafe.Sizeof(TRowcnt(0)))*uint64(nColUp) +
 110536 		uint64(unsafe.Sizeof(TRowcnt(0)))*uint64(nColUp))
 110537 	if mxSample != 0 {
 110538 		n = int32(uint64(n) + (uint64(unsafe.Sizeof(TRowcnt(0)))*uint64(nColUp) +
 110539 			uint64(unsafe.Sizeof(StatSample{}))*uint64(nCol+mxSample) +
 110540 			uint64(unsafe.Sizeof(TRowcnt(0)))*uint64(3)*uint64(nColUp)*uint64(nCol+mxSample)))
 110541 	}
 110542 	p = Xsqlite3DbMallocZero(tls, db, uint64(n))
 110543 	if p == uintptr(0) {
 110544 		Xsqlite3_result_error_nomem(tls, context)
 110545 		return
 110546 	}
 110547 
 110548 	(*StatAccum)(unsafe.Pointer(p)).Fdb = db
 110549 	(*StatAccum)(unsafe.Pointer(p)).FnEst = TRowcnt(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8))))
 110550 	(*StatAccum)(unsafe.Pointer(p)).FnRow = uint64(0)
 110551 	(*StatAccum)(unsafe.Pointer(p)).FnLimit = int32(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))))
 110552 	(*StatAccum)(unsafe.Pointer(p)).FnCol = nCol
 110553 	(*StatAccum)(unsafe.Pointer(p)).FnKeyCol = nKeyCol
 110554 	(*StatAccum)(unsafe.Pointer(p)).FnSkipAhead = U8(0)
 110555 	(*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt = p + 1*136
 110556 	(*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq = (*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt + uintptr(nColUp)*8
 110557 
 110558 	(*StatAccum)(unsafe.Pointer(p)).FmxSample = func() int32 {
 110559 		if (*StatAccum)(unsafe.Pointer(p)).FnLimit == 0 {
 110560 			return mxSample
 110561 		}
 110562 		return 0
 110563 	}()
 110564 	if mxSample != 0 {
 110565 		var pSpace uintptr
 110566 		var i int32
 110567 
 110568 		(*StatAccum)(unsafe.Pointer(p)).FiGet = -1
 110569 		(*StatAccum)(unsafe.Pointer(p)).FnPSample = (*StatAccum)(unsafe.Pointer(p)).FnEst/TRowcnt(mxSample/3+1) + uint64(1)
 110570 		(*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanLt = (*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq + uintptr(nColUp)*8
 110571 		(*StatAccum)(unsafe.Pointer(p)).FiPrn = U32(0x689e962d)*U32(nCol) ^ 0xd0944565*U32(Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8))))
 110572 
 110573 		(*StatAccum)(unsafe.Pointer(p)).Fa = (*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanLt + uintptr(nColUp)*8
 110574 		(*StatAccum)(unsafe.Pointer(p)).FaBest = (*StatAccum)(unsafe.Pointer(p)).Fa + uintptr(mxSample)*48
 110575 		pSpace = (*StatAccum)(unsafe.Pointer(p)).Fa + uintptr(mxSample+nCol)*48
 110576 		for i = 0; i < mxSample+nCol; i++ {
 110577 			(*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr(i)*48)).FanEq = pSpace
 110578 			pSpace += uintptr(uint64(unsafe.Sizeof(TRowcnt(0))) * uint64(nColUp))
 110579 			(*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr(i)*48)).FanLt = pSpace
 110580 			pSpace += uintptr(uint64(unsafe.Sizeof(TRowcnt(0))) * uint64(nColUp))
 110581 			(*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr(i)*48)).FanDLt = pSpace
 110582 			pSpace += uintptr(uint64(unsafe.Sizeof(TRowcnt(0))) * uint64(nColUp))
 110583 		}
 110584 
 110585 		for i = 0; i < nCol; i++ {
 110586 			(*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).FaBest + uintptr(i)*48)).FiCol = i
 110587 		}
 110588 	}
 110589 
 110590 	Xsqlite3_result_blob(tls, context, p, int32(unsafe.Sizeof(StatAccum{})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{statAccumDestructor})))
 110591 }
 110592 
 110593 var statInitFuncdef = FuncDef{
 110594 	FnArg:      int8(4),
 110595 	FfuncFlags: U32(SQLITE_UTF8),
 110596 	FxSFunc:    0,
 110597 	FzName:     ts + 12780}
 110598 
 110599 func sampleIsBetterPost(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintptr) int32 {
 110600 	var nCol int32 = (*StatAccum)(unsafe.Pointer(pAccum)).FnCol
 110601 	var i int32
 110602 
 110603 	for i = (*StatSample)(unsafe.Pointer(pNew)).FiCol + 1; i < nCol; i++ {
 110604 		if *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pNew)).FanEq + uintptr(i)*8)) > *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pOld)).FanEq + uintptr(i)*8)) {
 110605 			return 1
 110606 		}
 110607 		if *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pNew)).FanEq + uintptr(i)*8)) < *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pOld)).FanEq + uintptr(i)*8)) {
 110608 			return 0
 110609 		}
 110610 	}
 110611 	if (*StatSample)(unsafe.Pointer(pNew)).FiHash > (*StatSample)(unsafe.Pointer(pOld)).FiHash {
 110612 		return 1
 110613 	}
 110614 	return 0
 110615 }
 110616 
 110617 func sampleIsBetter(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintptr) int32 {
 110618 	var nEqNew TRowcnt = *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pNew)).FanEq + uintptr((*StatSample)(unsafe.Pointer(pNew)).FiCol)*8))
 110619 	var nEqOld TRowcnt = *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pOld)).FanEq + uintptr((*StatSample)(unsafe.Pointer(pOld)).FiCol)*8))
 110620 
 110621 	if nEqNew > nEqOld {
 110622 		return 1
 110623 	}
 110624 	if nEqNew == nEqOld {
 110625 		if (*StatSample)(unsafe.Pointer(pNew)).FiCol < (*StatSample)(unsafe.Pointer(pOld)).FiCol {
 110626 			return 1
 110627 		}
 110628 		return libc.Bool32((*StatSample)(unsafe.Pointer(pNew)).FiCol == (*StatSample)(unsafe.Pointer(pOld)).FiCol && sampleIsBetterPost(tls, pAccum, pNew, pOld) != 0)
 110629 	}
 110630 	return 0
 110631 }
 110632 
 110633 func sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) {
 110634 	var pSample uintptr
 110635 	var i int32
 110636 	var pOld uintptr
 110637 	var pUpgrade uintptr
 110638 	var pMin uintptr
 110639 	var anEq uintptr
 110640 	var anLt uintptr
 110641 	var anDLt uintptr
 110642 	var iMin int32
 110643 	pSample = uintptr(0)
 110644 
 110645 	if !(nEqZero > (*StatAccum)(unsafe.Pointer(p)).FnMaxEqZero) {
 110646 		goto __1
 110647 	}
 110648 	(*StatAccum)(unsafe.Pointer(p)).FnMaxEqZero = nEqZero
 110649 __1:
 110650 	;
 110651 	if !(int32((*StatSample)(unsafe.Pointer(pNew)).FisPSample) == 0) {
 110652 		goto __2
 110653 	}
 110654 	pUpgrade = uintptr(0)
 110655 
 110656 	i = (*StatAccum)(unsafe.Pointer(p)).FnSample - 1
 110657 __3:
 110658 	if !(i >= 0) {
 110659 		goto __5
 110660 	}
 110661 	pOld = (*StatAccum)(unsafe.Pointer(p)).Fa + uintptr(i)*48
 110662 	if !(*(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pOld)).FanEq + uintptr((*StatSample)(unsafe.Pointer(pNew)).FiCol)*8)) == uint64(0)) {
 110663 		goto __6
 110664 	}
 110665 	if !((*StatSample)(unsafe.Pointer(pOld)).FisPSample != 0) {
 110666 		goto __7
 110667 	}
 110668 	return
 110669 __7:
 110670 	;
 110671 	if !(pUpgrade == uintptr(0) || sampleIsBetter(tls, p, pOld, pUpgrade) != 0) {
 110672 		goto __8
 110673 	}
 110674 	pUpgrade = pOld
 110675 __8:
 110676 	;
 110677 __6:
 110678 	;
 110679 	goto __4
 110680 __4:
 110681 	i--
 110682 	goto __3
 110683 	goto __5
 110684 __5:
 110685 	;
 110686 	if !(pUpgrade != 0) {
 110687 		goto __9
 110688 	}
 110689 	(*StatSample)(unsafe.Pointer(pUpgrade)).FiCol = (*StatSample)(unsafe.Pointer(pNew)).FiCol
 110690 	*(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pUpgrade)).FanEq + uintptr((*StatSample)(unsafe.Pointer(pUpgrade)).FiCol)*8)) = *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pNew)).FanEq + uintptr((*StatSample)(unsafe.Pointer(pUpgrade)).FiCol)*8))
 110691 	goto find_new_min
 110692 __9:
 110693 	;
 110694 __2:
 110695 	;
 110696 	if !((*StatAccum)(unsafe.Pointer(p)).FnSample >= (*StatAccum)(unsafe.Pointer(p)).FmxSample) {
 110697 		goto __10
 110698 	}
 110699 	pMin = (*StatAccum)(unsafe.Pointer(p)).Fa + uintptr((*StatAccum)(unsafe.Pointer(p)).FiMin)*48
 110700 	anEq = (*StatSample)(unsafe.Pointer(pMin)).FanEq
 110701 	anLt = (*StatSample)(unsafe.Pointer(pMin)).FanLt
 110702 	anDLt = (*StatSample)(unsafe.Pointer(pMin)).FanDLt
 110703 	sampleClear(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, pMin)
 110704 	libc.Xmemmove(tls, pMin, pMin+1*48, uint64(unsafe.Sizeof(StatSample{}))*uint64((*StatAccum)(unsafe.Pointer(p)).FnSample-(*StatAccum)(unsafe.Pointer(p)).FiMin-1))
 110705 	pSample = (*StatAccum)(unsafe.Pointer(p)).Fa + uintptr((*StatAccum)(unsafe.Pointer(p)).FnSample-1)*48
 110706 	(*StatSample)(unsafe.Pointer(pSample)).FnRowid = U32(0)
 110707 	(*StatSample)(unsafe.Pointer(pSample)).FanEq = anEq
 110708 	(*StatSample)(unsafe.Pointer(pSample)).FanDLt = anDLt
 110709 	(*StatSample)(unsafe.Pointer(pSample)).FanLt = anLt
 110710 	(*StatAccum)(unsafe.Pointer(p)).FnSample = (*StatAccum)(unsafe.Pointer(p)).FmxSample - 1
 110711 __10:
 110712 	;
 110713 	pSample = (*StatAccum)(unsafe.Pointer(p)).Fa + uintptr((*StatAccum)(unsafe.Pointer(p)).FnSample)*48
 110714 	sampleCopy(tls, p, pSample, pNew)
 110715 	(*StatAccum)(unsafe.Pointer(p)).FnSample++
 110716 
 110717 	libc.Xmemset(tls, (*StatSample)(unsafe.Pointer(pSample)).FanEq, 0, uint64(unsafe.Sizeof(TRowcnt(0)))*uint64(nEqZero))
 110718 
 110719 find_new_min:
 110720 	if !((*StatAccum)(unsafe.Pointer(p)).FnSample >= (*StatAccum)(unsafe.Pointer(p)).FmxSample) {
 110721 		goto __11
 110722 	}
 110723 	iMin = -1
 110724 	i = 0
 110725 __12:
 110726 	if !(i < (*StatAccum)(unsafe.Pointer(p)).FmxSample) {
 110727 		goto __14
 110728 	}
 110729 	if !((*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fa+uintptr(i)*48)).FisPSample != 0) {
 110730 		goto __15
 110731 	}
 110732 	goto __13
 110733 __15:
 110734 	;
 110735 	if !(iMin < 0 || sampleIsBetter(tls, p, (*StatAccum)(unsafe.Pointer(p)).Fa+uintptr(iMin)*48, (*StatAccum)(unsafe.Pointer(p)).Fa+uintptr(i)*48) != 0) {
 110736 		goto __16
 110737 	}
 110738 	iMin = i
 110739 __16:
 110740 	;
 110741 	goto __13
 110742 __13:
 110743 	i++
 110744 	goto __12
 110745 	goto __14
 110746 __14:
 110747 	;
 110748 	(*StatAccum)(unsafe.Pointer(p)).FiMin = iMin
 110749 __11:
 110750 }
 110751 
 110752 func samplePushPrevious(tls *libc.TLS, p uintptr, iChng int32) {
 110753 	var i int32
 110754 
 110755 	for i = (*StatAccum)(unsafe.Pointer(p)).FnCol - 2; i >= iChng; i-- {
 110756 		var pBest uintptr = (*StatAccum)(unsafe.Pointer(p)).FaBest + uintptr(i)*48
 110757 		*(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pBest)).FanEq + uintptr(i)*8)) = *(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq + uintptr(i)*8))
 110758 		if (*StatAccum)(unsafe.Pointer(p)).FnSample < (*StatAccum)(unsafe.Pointer(p)).FmxSample || sampleIsBetter(tls, p, pBest, (*StatAccum)(unsafe.Pointer(p)).Fa+uintptr((*StatAccum)(unsafe.Pointer(p)).FiMin)*48) != 0 {
 110759 			sampleInsert(tls, p, pBest, i)
 110760 		}
 110761 	}
 110762 
 110763 	for i = (*StatAccum)(unsafe.Pointer(p)).FnSample - 1; i >= 0; i-- {
 110764 		var j int32
 110765 		for j = (*StatAccum)(unsafe.Pointer(p)).FnMaxEqZero; j < (*StatAccum)(unsafe.Pointer(p)).FnCol; j++ {
 110766 		}
 110767 	}
 110768 
 110769 	if iChng < (*StatAccum)(unsafe.Pointer(p)).FnMaxEqZero {
 110770 		for i = (*StatAccum)(unsafe.Pointer(p)).FnSample - 1; i >= 0; i-- {
 110771 			var j int32
 110772 			for j = iChng; j < (*StatAccum)(unsafe.Pointer(p)).FnCol; j++ {
 110773 				if *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fa+uintptr(i)*48)).FanEq + uintptr(j)*8)) == uint64(0) {
 110774 					*(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fa+uintptr(i)*48)).FanEq + uintptr(j)*8)) = *(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq + uintptr(j)*8))
 110775 				}
 110776 			}
 110777 		}
 110778 		(*StatAccum)(unsafe.Pointer(p)).FnMaxEqZero = iChng
 110779 	}
 110780 }
 110781 
 110782 func statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 110783 	var i int32
 110784 
 110785 	var p uintptr = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv)))
 110786 	var iChng int32 = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 110787 
 110788 	_ = argc
 110789 	_ = context
 110790 
 110791 	if (*StatAccum)(unsafe.Pointer(p)).FnRow == uint64(0) {
 110792 		for i = 0; i < (*StatAccum)(unsafe.Pointer(p)).FnCol; i++ {
 110793 			*(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq + uintptr(i)*8)) = uint64(1)
 110794 		}
 110795 	} else {
 110796 		if (*StatAccum)(unsafe.Pointer(p)).FmxSample != 0 {
 110797 			samplePushPrevious(tls, p, iChng)
 110798 		}
 110799 
 110800 		for i = 0; i < iChng; i++ {
 110801 			*(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq + uintptr(i)*8))++
 110802 		}
 110803 		for i = iChng; i < (*StatAccum)(unsafe.Pointer(p)).FnCol; i++ {
 110804 			*(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt + uintptr(i)*8))++
 110805 			if (*StatAccum)(unsafe.Pointer(p)).FmxSample != 0 {
 110806 				*(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanLt + uintptr(i)*8)) += *(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq + uintptr(i)*8))
 110807 			}
 110808 			*(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq + uintptr(i)*8)) = uint64(1)
 110809 		}
 110810 	}
 110811 
 110812 	(*StatAccum)(unsafe.Pointer(p)).FnRow++
 110813 	if (*StatAccum)(unsafe.Pointer(p)).FmxSample != 0 {
 110814 		var nLt TRowcnt
 110815 		if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8))) == SQLITE_INTEGER {
 110816 			sampleSetRowidInt64(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, p+40, Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8))))
 110817 		} else {
 110818 			sampleSetRowid(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, p+40, Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8))),
 110819 				Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8))))
 110820 		}
 110821 		(*StatAccum)(unsafe.Pointer(p)).Fcurrent.FiHash = libc.AssignPtrUint32(p+100, (*StatAccum)(unsafe.Pointer(p)).FiPrn*U32(1103515245)+U32(12345))
 110822 
 110823 		nLt = *(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanLt + uintptr((*StatAccum)(unsafe.Pointer(p)).FnCol-1)*8))
 110824 
 110825 		if nLt/(*StatAccum)(unsafe.Pointer(p)).FnPSample != (nLt+uint64(1))/(*StatAccum)(unsafe.Pointer(p)).FnPSample {
 110826 			(*StatAccum)(unsafe.Pointer(p)).Fcurrent.FisPSample = U8(1)
 110827 			(*StatAccum)(unsafe.Pointer(p)).Fcurrent.FiCol = 0
 110828 			sampleInsert(tls, p, p+40, (*StatAccum)(unsafe.Pointer(p)).FnCol-1)
 110829 			(*StatAccum)(unsafe.Pointer(p)).Fcurrent.FisPSample = U8(0)
 110830 		}
 110831 
 110832 		for i = 0; i < (*StatAccum)(unsafe.Pointer(p)).FnCol-1; i++ {
 110833 			(*StatAccum)(unsafe.Pointer(p)).Fcurrent.FiCol = i
 110834 			if i >= iChng || sampleIsBetterPost(tls, p, p+40, (*StatAccum)(unsafe.Pointer(p)).FaBest+uintptr(i)*48) != 0 {
 110835 				sampleCopy(tls, p, (*StatAccum)(unsafe.Pointer(p)).FaBest+uintptr(i)*48, p+40)
 110836 			}
 110837 		}
 110838 	} else if (*StatAccum)(unsafe.Pointer(p)).FnLimit != 0 && (*StatAccum)(unsafe.Pointer(p)).FnRow > TRowcnt((*StatAccum)(unsafe.Pointer(p)).FnLimit)*TRowcnt(int32((*StatAccum)(unsafe.Pointer(p)).FnSkipAhead)+1) {
 110839 		(*StatAccum)(unsafe.Pointer(p)).FnSkipAhead++
 110840 		Xsqlite3_result_int(tls, context, libc.Bool32(*(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt)) > uint64(0)))
 110841 	}
 110842 }
 110843 
 110844 var statPushFuncdef = FuncDef{
 110845 	FnArg:      int8(2 + IsStat4),
 110846 	FfuncFlags: U32(SQLITE_UTF8),
 110847 	FxSFunc:    0,
 110848 	FzName:     ts + 12790}
 110849 
 110850 func statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 110851 	bp := tls.Alloc(88)
 110852 	defer tls.Free(88)
 110853 
 110854 	var p uintptr = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv)))
 110855 
 110856 	var eCall int32 = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 110857 
 110858 	if eCall == STAT_GET_STAT1 {
 110859 		var i int32
 110860 
 110861 		Xsqlite3StrAccumInit(tls, bp+24, uintptr(0), uintptr(0), 0, ((*StatAccum)(unsafe.Pointer(p)).FnKeyCol+1)*100)
 110862 		Xsqlite3_str_appendf(tls, bp+24, ts+12800,
 110863 			libc.VaList(bp, func() uint64 {
 110864 				if (*StatAccum)(unsafe.Pointer(p)).FnSkipAhead != 0 {
 110865 					return (*StatAccum)(unsafe.Pointer(p)).FnEst
 110866 				}
 110867 				return (*StatAccum)(unsafe.Pointer(p)).FnRow
 110868 			}()))
 110869 		for i = 0; i < (*StatAccum)(unsafe.Pointer(p)).FnKeyCol; i++ {
 110870 			var nDistinct U64 = *(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt + uintptr(i)*8)) + uint64(1)
 110871 			var iVal U64 = ((*StatAccum)(unsafe.Pointer(p)).FnRow + nDistinct - uint64(1)) / nDistinct
 110872 			if iVal == uint64(2) && (*StatAccum)(unsafe.Pointer(p)).FnRow*uint64(10) <= nDistinct*uint64(11) {
 110873 				iVal = uint64(1)
 110874 			}
 110875 			Xsqlite3_str_appendf(tls, bp+24, ts+12805, libc.VaList(bp+8, iVal))
 110876 
 110877 		}
 110878 		Xsqlite3ResultStrAccum(tls, context, bp+24)
 110879 	} else if eCall == STAT_GET_ROWID {
 110880 		if (*StatAccum)(unsafe.Pointer(p)).FiGet < 0 {
 110881 			samplePushPrevious(tls, p, 0)
 110882 			(*StatAccum)(unsafe.Pointer(p)).FiGet = 0
 110883 		}
 110884 		if (*StatAccum)(unsafe.Pointer(p)).FiGet < (*StatAccum)(unsafe.Pointer(p)).FnSample {
 110885 			var pS uintptr = (*StatAccum)(unsafe.Pointer(p)).Fa + uintptr((*StatAccum)(unsafe.Pointer(p)).FiGet)*48
 110886 			if (*StatSample)(unsafe.Pointer(pS)).FnRowid == U32(0) {
 110887 				Xsqlite3_result_int64(tls, context, *(*I64)(unsafe.Pointer(pS + 24)))
 110888 			} else {
 110889 				Xsqlite3_result_blob(tls, context, *(*uintptr)(unsafe.Pointer(pS + 24)), int32((*StatSample)(unsafe.Pointer(pS)).FnRowid),
 110890 					libc.UintptrFromInt32(-1))
 110891 			}
 110892 		}
 110893 	} else {
 110894 		var aCnt uintptr = uintptr(0)
 110895 
 110896 		var i int32
 110897 
 110898 		switch eCall {
 110899 		case STAT_GET_NEQ:
 110900 			aCnt = (*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr((*StatAccum)(unsafe.Pointer(p)).FiGet)*48)).FanEq
 110901 			break
 110902 			fallthrough
 110903 		case STAT_GET_NLT:
 110904 			aCnt = (*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr((*StatAccum)(unsafe.Pointer(p)).FiGet)*48)).FanLt
 110905 			break
 110906 			fallthrough
 110907 		default:
 110908 			{
 110909 				aCnt = (*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr((*StatAccum)(unsafe.Pointer(p)).FiGet)*48)).FanDLt
 110910 				(*StatAccum)(unsafe.Pointer(p)).FiGet++
 110911 				break
 110912 
 110913 			}
 110914 		}
 110915 		Xsqlite3StrAccumInit(tls, bp+56, uintptr(0), uintptr(0), 0, (*StatAccum)(unsafe.Pointer(p)).FnCol*100)
 110916 		for i = 0; i < (*StatAccum)(unsafe.Pointer(p)).FnCol; i++ {
 110917 			Xsqlite3_str_appendf(tls, bp+56, ts+12811, libc.VaList(bp+16, *(*TRowcnt)(unsafe.Pointer(aCnt + uintptr(i)*8))))
 110918 		}
 110919 		if (*Sqlite3_str)(unsafe.Pointer(bp+56)).FnChar != 0 {
 110920 			(*Sqlite3_str)(unsafe.Pointer(bp+56)).FnChar--
 110921 		}
 110922 		Xsqlite3ResultStrAccum(tls, context, bp+56)
 110923 	}
 110924 	_ = argc
 110925 }
 110926 
 110927 var statGetFuncdef = FuncDef{
 110928 	FnArg:      int8(1 + IsStat4),
 110929 	FfuncFlags: U32(SQLITE_UTF8),
 110930 	FxSFunc:    0,
 110931 	FzName:     ts + 12817}
 110932 
 110933 func callStatGet(tls *libc.TLS, pParse uintptr, regStat int32, iParam int32, regOut int32) {
 110934 	Xsqlite3VdbeAddOp2(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, OP_Integer, iParam, regStat+1)
 110935 
 110936 	Xsqlite3VdbeAddFunctionCall(tls, pParse, 0, regStat, regOut, 1+IsStat4,
 110937 		uintptr(unsafe.Pointer(&statGetFuncdef)), 0)
 110938 }
 110939 
 110940 func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr, iStatCur int32, iMem int32, iTab int32) {
 110941 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 110942 	var pIdx uintptr
 110943 	var iIdxCur int32
 110944 	var iTabCur int32
 110945 	var v uintptr
 110946 	var i int32
 110947 	var jZeroRows int32 = -1
 110948 	var iDb int32
 110949 	var needTableCnt U8 = U8(1)
 110950 	var regNewRowid int32 = libc.PostIncInt32(&iMem, 1)
 110951 	var regStat int32 = libc.PostIncInt32(&iMem, 1)
 110952 	var regChng int32 = libc.PostIncInt32(&iMem, 1)
 110953 	var regRowid int32 = libc.PostIncInt32(&iMem, 1)
 110954 	var regTemp int32 = libc.PostIncInt32(&iMem, 1)
 110955 	var regTemp2 int32 = libc.PostIncInt32(&iMem, 1)
 110956 	var regTabname int32 = libc.PostIncInt32(&iMem, 1)
 110957 	var regIdxname int32 = libc.PostIncInt32(&iMem, 1)
 110958 	var regStat1 int32 = libc.PostIncInt32(&iMem, 1)
 110959 	var regPrev int32 = iMem
 110960 	var pStat1 uintptr = uintptr(0)
 110961 
 110962 	(*Parse)(unsafe.Pointer(pParse)).FnMem = func() int32 {
 110963 		if (*Parse)(unsafe.Pointer(pParse)).FnMem > iMem {
 110964 			return (*Parse)(unsafe.Pointer(pParse)).FnMem
 110965 		}
 110966 		return iMem
 110967 	}()
 110968 	v = Xsqlite3GetVdbe(tls, pParse)
 110969 	if v == uintptr(0) || pTab == uintptr(0) {
 110970 		return
 110971 	}
 110972 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM) {
 110973 		return
 110974 	}
 110975 	if Xsqlite3_strlike(tls, ts+12826, (*Table)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 {
 110976 		return
 110977 	}
 110978 
 110979 	iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
 110980 
 110981 	if Xsqlite3AuthCheck(tls, pParse, SQLITE_ANALYZE, (*Table)(unsafe.Pointer(pTab)).FzName, uintptr(0),
 110982 		(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName) != 0 {
 110983 		return
 110984 	}
 110985 
 110986 	if (*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 {
 110987 		pStat1 = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Table{}))+uint64(13))
 110988 		if pStat1 == uintptr(0) {
 110989 			return
 110990 		}
 110991 		(*Table)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*104
 110992 		libc.Xmemcpy(tls, (*Table)(unsafe.Pointer(pStat1)).FzName, ts+12700, uint64(13))
 110993 		(*Table)(unsafe.Pointer(pStat1)).FnCol = int16(3)
 110994 		(*Table)(unsafe.Pointer(pStat1)).FiPKey = int16(-1)
 110995 		Xsqlite3VdbeAddOp4(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, OP_Noop, 0, 0, 0, pStat1, -6)
 110996 	}
 110997 
 110998 	Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, uint8(0), (*Table)(unsafe.Pointer(pTab)).FzName)
 110999 	iTabCur = libc.PostIncInt32(&iTab, 1)
 111000 	iIdxCur = libc.PostIncInt32(&iTab, 1)
 111001 	(*Parse)(unsafe.Pointer(pParse)).FnTab = func() int32 {
 111002 		if (*Parse)(unsafe.Pointer(pParse)).FnTab > iTab {
 111003 			return (*Parse)(unsafe.Pointer(pParse)).FnTab
 111004 		}
 111005 		return iTab
 111006 	}()
 111007 	Xsqlite3OpenTable(tls, pParse, iTabCur, iDb, pTab, OP_OpenRead)
 111008 	Xsqlite3VdbeLoadString(tls, v, regTabname, (*Table)(unsafe.Pointer(pTab)).FzName)
 111009 
 111010 	for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
 111011 		var nCol int32
 111012 		var addrRewind int32
 111013 		var addrNextRow int32
 111014 		var zIdxName uintptr
 111015 		var nColTest int32
 111016 
 111017 		if pOnlyIdx != 0 && pOnlyIdx != pIdx {
 111018 			continue
 111019 		}
 111020 		if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) {
 111021 			needTableCnt = U8(0)
 111022 		}
 111023 		if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) && int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY {
 111024 			nCol = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
 111025 			zIdxName = (*Table)(unsafe.Pointer(pTab)).FzName
 111026 			nColTest = nCol - 1
 111027 		} else {
 111028 			nCol = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
 111029 			zIdxName = (*Index)(unsafe.Pointer(pIdx)).FzName
 111030 			if uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x8>>3)) != 0 {
 111031 				nColTest = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) - 1
 111032 			} else {
 111033 				nColTest = nCol - 1
 111034 			}
 111035 		}
 111036 
 111037 		Xsqlite3VdbeLoadString(tls, v, regIdxname, zIdxName)
 111038 
 111039 		(*Parse)(unsafe.Pointer(pParse)).FnMem = func() int32 {
 111040 			if (*Parse)(unsafe.Pointer(pParse)).FnMem > regPrev+nColTest {
 111041 				return (*Parse)(unsafe.Pointer(pParse)).FnMem
 111042 			}
 111043 			return regPrev + nColTest
 111044 		}()
 111045 
 111046 		Xsqlite3VdbeAddOp3(tls, v, OP_OpenRead, iIdxCur, int32((*Index)(unsafe.Pointer(pIdx)).Ftnum), iDb)
 111047 		Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx)
 111048 
 111049 		Xsqlite3VdbeAddOp2(tls, v, OP_Integer, nCol, regStat+1)
 111050 
 111051 		Xsqlite3VdbeAddOp2(tls, v, OP_Integer, int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol), regRowid)
 111052 		if (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_Stat4) == U32(0) {
 111053 			Xsqlite3VdbeAddOp2(tls, v, OP_Count, iIdxCur, regTemp)
 111054 			addrRewind = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, iIdxCur)
 111055 
 111056 		} else {
 111057 			addrRewind = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, iIdxCur)
 111058 
 111059 			Xsqlite3VdbeAddOp3(tls, v, OP_Count, iIdxCur, regTemp, 1)
 111060 		}
 111061 
 111062 		Xsqlite3VdbeAddOp2(tls, v, OP_Integer, (*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit, regTemp2)
 111063 		Xsqlite3VdbeAddFunctionCall(tls, pParse, 0, regStat+1, regStat, 4,
 111064 			uintptr(unsafe.Pointer(&statInitFuncdef)), 0)
 111065 
 111066 		Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regChng)
 111067 		addrNextRow = Xsqlite3VdbeCurrentAddr(tls, v)
 111068 
 111069 		if nColTest > 0 {
 111070 			var endDistinctTest int32 = Xsqlite3VdbeMakeLabel(tls, pParse)
 111071 			var aGotoChng uintptr
 111072 			aGotoChng = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(int32(0)))*uint64(nColTest))
 111073 			if aGotoChng == uintptr(0) {
 111074 				continue
 111075 			}
 111076 
 111077 			Xsqlite3VdbeAddOp0(tls, v, OP_Goto)
 111078 			addrNextRow = Xsqlite3VdbeCurrentAddr(tls, v)
 111079 			if nColTest == 1 && int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) == 1 && int32((*Index)(unsafe.Pointer(pIdx)).FonError) != OE_None {
 111080 				Xsqlite3VdbeAddOp2(tls, v, OP_NotNull, regPrev, endDistinctTest)
 111081 
 111082 			}
 111083 			for i = 0; i < nColTest; i++ {
 111084 				var pColl uintptr = Xsqlite3LocateCollSeq(tls, pParse, *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(i)*8)))
 111085 				Xsqlite3VdbeAddOp2(tls, v, OP_Integer, i, regChng)
 111086 				Xsqlite3VdbeAddOp3(tls, v, OP_Column, iIdxCur, i, regTemp)
 111087 
 111088 				*(*int32)(unsafe.Pointer(aGotoChng + uintptr(i)*4)) = Xsqlite3VdbeAddOp4(tls, v, OP_Ne, regTemp, 0, regPrev+i, pColl, -2)
 111089 				Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NULLEQ))
 111090 
 111091 			}
 111092 			Xsqlite3VdbeAddOp2(tls, v, OP_Integer, nColTest, regChng)
 111093 			Xsqlite3VdbeGoto(tls, v, endDistinctTest)
 111094 
 111095 			Xsqlite3VdbeJumpHere(tls, v, addrNextRow-1)
 111096 			for i = 0; i < nColTest; i++ {
 111097 				Xsqlite3VdbeJumpHere(tls, v, *(*int32)(unsafe.Pointer(aGotoChng + uintptr(i)*4)))
 111098 				Xsqlite3VdbeAddOp3(tls, v, OP_Column, iIdxCur, i, regPrev+i)
 111099 
 111100 			}
 111101 			Xsqlite3VdbeResolveLabel(tls, v, endDistinctTest)
 111102 			Xsqlite3DbFree(tls, db, aGotoChng)
 111103 		}
 111104 
 111105 		if (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_Stat4) == U32(0) {
 111106 			if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
 111107 				Xsqlite3VdbeAddOp2(tls, v, OP_IdxRowid, iIdxCur, regRowid)
 111108 			} else {
 111109 				var pPk uintptr = Xsqlite3PrimaryKeyIndex(tls, (*Index)(unsafe.Pointer(pIdx)).FpTable)
 111110 				var j int32
 111111 				var k int32
 111112 				var regKey int32
 111113 				regKey = Xsqlite3GetTempRange(tls, pParse, int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol))
 111114 				for j = 0; j < int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol); j++ {
 111115 					k = int32(Xsqlite3TableColumnToIndex(tls, pIdx, *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2))))
 111116 
 111117 					Xsqlite3VdbeAddOp3(tls, v, OP_Column, iIdxCur, k, regKey+j)
 111118 
 111119 				}
 111120 				Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regKey, int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol), regRowid)
 111121 				Xsqlite3ReleaseTempRange(tls, pParse, regKey, int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol))
 111122 			}
 111123 		}
 111124 
 111125 		{
 111126 			Xsqlite3VdbeAddFunctionCall(tls, pParse, 1, regStat, regTemp, 2+IsStat4,
 111127 				uintptr(unsafe.Pointer(&statPushFuncdef)), 0)
 111128 			if (*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit != 0 {
 111129 				var j1 int32
 111130 				var j2 int32
 111131 				var j3 int32
 111132 				j1 = Xsqlite3VdbeAddOp1(tls, v, OP_IsNull, regTemp)
 111133 				j2 = Xsqlite3VdbeAddOp1(tls, v, OP_If, regTemp)
 111134 				j3 = Xsqlite3VdbeAddOp4Int(tls, v, OP_SeekGT, iIdxCur, 0, regPrev, 1)
 111135 
 111136 				Xsqlite3VdbeJumpHere(tls, v, j1)
 111137 				Xsqlite3VdbeAddOp2(tls, v, OP_Next, iIdxCur, addrNextRow)
 111138 				Xsqlite3VdbeJumpHere(tls, v, j2)
 111139 				Xsqlite3VdbeJumpHere(tls, v, j3)
 111140 			} else {
 111141 				Xsqlite3VdbeAddOp2(tls, v, OP_Next, iIdxCur, addrNextRow)
 111142 			}
 111143 
 111144 		}
 111145 
 111146 		callStatGet(tls, pParse, regStat, STAT_GET_STAT1, regStat1)
 111147 
 111148 		Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, regTabname, 3, regTemp, ts+12836, 0)
 111149 		Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iStatCur, regNewRowid)
 111150 		Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iStatCur, regTemp, regNewRowid)
 111151 		Xsqlite3VdbeChangeP4(tls, v, -1, pStat1, -5)
 111152 		Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND))
 111153 
 111154 		if (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_Stat4) == U32(0) && (*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit == 0 {
 111155 			var regEq int32 = regStat1
 111156 			var regLt int32 = regStat1 + 1
 111157 			var regDLt int32 = regStat1 + 2
 111158 			var regSample int32 = regStat1 + 3
 111159 			var regCol int32 = regStat1 + 4
 111160 			var regSampleRowid int32 = regCol + nCol
 111161 			var addrNext int32
 111162 			var addrIsNull int32
 111163 			var seekOp U8
 111164 			if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
 111165 				seekOp = uint8(OP_NotExists)
 111166 			} else {
 111167 				seekOp = uint8(OP_NotFound)
 111168 			}
 111169 
 111170 			(*Parse)(unsafe.Pointer(pParse)).FnMem = func() int32 {
 111171 				if (*Parse)(unsafe.Pointer(pParse)).FnMem > regCol+nCol {
 111172 					return (*Parse)(unsafe.Pointer(pParse)).FnMem
 111173 				}
 111174 				return regCol + nCol
 111175 			}()
 111176 
 111177 			addrNext = Xsqlite3VdbeCurrentAddr(tls, v)
 111178 			callStatGet(tls, pParse, regStat, STAT_GET_ROWID, regSampleRowid)
 111179 			addrIsNull = Xsqlite3VdbeAddOp1(tls, v, OP_IsNull, regSampleRowid)
 111180 
 111181 			callStatGet(tls, pParse, regStat, STAT_GET_NEQ, regEq)
 111182 			callStatGet(tls, pParse, regStat, STAT_GET_NLT, regLt)
 111183 			callStatGet(tls, pParse, regStat, STAT_GET_NDLT, regDLt)
 111184 			Xsqlite3VdbeAddOp4Int(tls, v, int32(seekOp), iTabCur, addrNext, regSampleRowid, 0)
 111185 
 111186 			for i = 0; i < nCol; i++ {
 111187 				Xsqlite3ExprCodeLoadIndexColumn(tls, pParse, pIdx, iTabCur, i, regCol+i)
 111188 			}
 111189 			Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regCol, nCol, regSample)
 111190 			Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regTabname, 6, regTemp)
 111191 			Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iStatCur+1, regNewRowid)
 111192 			Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iStatCur+1, regTemp, regNewRowid)
 111193 			Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 1, addrNext)
 111194 			Xsqlite3VdbeJumpHere(tls, v, addrIsNull)
 111195 		}
 111196 
 111197 		Xsqlite3VdbeJumpHere(tls, v, addrRewind)
 111198 	}
 111199 
 111200 	if pOnlyIdx == uintptr(0) && needTableCnt != 0 {
 111201 		Xsqlite3VdbeAddOp2(tls, v, OP_Count, iTabCur, regStat1)
 111202 		jZeroRows = Xsqlite3VdbeAddOp1(tls, v, OP_IfNot, regStat1)
 111203 		Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regIdxname)
 111204 
 111205 		Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, regTabname, 3, regTemp, ts+12836, 0)
 111206 		Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iStatCur, regNewRowid)
 111207 		Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iStatCur, regTemp, regNewRowid)
 111208 		Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND))
 111209 		Xsqlite3VdbeChangeP4(tls, v, -1, pStat1, -5)
 111210 		Xsqlite3VdbeJumpHere(tls, v, jZeroRows)
 111211 	}
 111212 }
 111213 
 111214 func loadAnalysis(tls *libc.TLS, pParse uintptr, iDb int32) {
 111215 	var v uintptr = Xsqlite3GetVdbe(tls, pParse)
 111216 	if v != 0 {
 111217 		Xsqlite3VdbeAddOp1(tls, v, OP_LoadAnalysis, iDb)
 111218 	}
 111219 }
 111220 
 111221 func analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) {
 111222 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 111223 	var pSchema uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpSchema
 111224 	var k uintptr
 111225 	var iStatCur int32
 111226 	var iMem int32
 111227 	var iTab int32
 111228 
 111229 	Xsqlite3BeginWriteOperation(tls, pParse, 0, iDb)
 111230 	iStatCur = (*Parse)(unsafe.Pointer(pParse)).FnTab
 111231 	*(*int32)(unsafe.Pointer(pParse + 52)) += 3
 111232 	openStatTable(tls, pParse, iDb, iStatCur, uintptr(0), uintptr(0))
 111233 	iMem = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 111234 	iTab = (*Parse)(unsafe.Pointer(pParse)).FnTab
 111235 
 111236 	for k = (*Hash)(unsafe.Pointer(pSchema + 8)).Ffirst; k != 0; k = (*HashElem)(unsafe.Pointer(k)).Fnext {
 111237 		var pTab uintptr = (*HashElem)(unsafe.Pointer(k)).Fdata
 111238 		analyzeOneTable(tls, pParse, pTab, uintptr(0), iStatCur, iMem, iTab)
 111239 	}
 111240 	loadAnalysis(tls, pParse, iDb)
 111241 }
 111242 
 111243 func analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr) {
 111244 	var iDb int32
 111245 	var iStatCur int32
 111246 
 111247 	iDb = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Table)(unsafe.Pointer(pTab)).FpSchema)
 111248 	Xsqlite3BeginWriteOperation(tls, pParse, 0, iDb)
 111249 	iStatCur = (*Parse)(unsafe.Pointer(pParse)).FnTab
 111250 	*(*int32)(unsafe.Pointer(pParse + 52)) += 3
 111251 	if pOnlyIdx != 0 {
 111252 		openStatTable(tls, pParse, iDb, iStatCur, (*Index)(unsafe.Pointer(pOnlyIdx)).FzName, ts+12840)
 111253 	} else {
 111254 		openStatTable(tls, pParse, iDb, iStatCur, (*Table)(unsafe.Pointer(pTab)).FzName, ts+12844)
 111255 	}
 111256 	analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*Parse)(unsafe.Pointer(pParse)).FnMem+1, (*Parse)(unsafe.Pointer(pParse)).FnTab)
 111257 	loadAnalysis(tls, pParse, iDb)
 111258 }
 111259 
 111260 // Generate code for the ANALYZE command.  The parser calls this routine
 111261 // when it recognizes an ANALYZE command.
 111262 //
 111263 //	ANALYZE                            -- 1
 111264 //	ANALYZE  <database>                -- 2
 111265 //	ANALYZE  ?<database>.?<tablename>  -- 3
 111266 //
 111267 // Form 1 causes all indices in all attached databases to be analyzed.
 111268 // Form 2 analyzes all indices the single database named.
 111269 // Form 3 analyzes all indices associated with the named table.
 111270 func Xsqlite3Analyze(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr) {
 111271 	bp := tls.Alloc(8)
 111272 	defer tls.Free(8)
 111273 
 111274 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 111275 	var iDb int32
 111276 	var i int32
 111277 	var z uintptr
 111278 	var zDb uintptr
 111279 	var pTab uintptr
 111280 	var pIdx uintptr
 111281 
 111282 	var v uintptr
 111283 
 111284 	if SQLITE_OK != Xsqlite3ReadSchema(tls, pParse) {
 111285 		return
 111286 	}
 111287 
 111288 	if pName1 == uintptr(0) {
 111289 		for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
 111290 			if i == 1 {
 111291 				continue
 111292 			}
 111293 			analyzeDatabase(tls, pParse, i)
 111294 		}
 111295 	} else if (*Token)(unsafe.Pointer(pName2)).Fn == uint32(0) && libc.AssignInt32(&iDb, Xsqlite3FindDb(tls, db, pName1)) >= 0 {
 111296 		analyzeDatabase(tls, pParse, iDb)
 111297 	} else {
 111298 		iDb = Xsqlite3TwoPartName(tls, pParse, pName1, pName2, bp)
 111299 		if iDb >= 0 {
 111300 			if (*Token)(unsafe.Pointer(pName2)).Fn != 0 {
 111301 				zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
 111302 			} else {
 111303 				zDb = uintptr(0)
 111304 			}
 111305 			z = Xsqlite3NameFromToken(tls, db, *(*uintptr)(unsafe.Pointer(bp)))
 111306 			if z != 0 {
 111307 				if libc.AssignUintptr(&pIdx, Xsqlite3FindIndex(tls, db, z, zDb)) != uintptr(0) {
 111308 					analyzeTable(tls, pParse, (*Index)(unsafe.Pointer(pIdx)).FpTable, pIdx)
 111309 				} else if libc.AssignUintptr(&pTab, Xsqlite3LocateTable(tls, pParse, uint32(0), z, zDb)) != uintptr(0) {
 111310 					analyzeTable(tls, pParse, pTab, uintptr(0))
 111311 				}
 111312 				Xsqlite3DbFree(tls, db, z)
 111313 			}
 111314 		}
 111315 	}
 111316 	if int32((*Sqlite3)(unsafe.Pointer(db)).FnSqlExec) == 0 && libc.AssignUintptr(&v, Xsqlite3GetVdbe(tls, pParse)) != uintptr(0) {
 111317 		Xsqlite3VdbeAddOp0(tls, v, OP_Expire)
 111318 	}
 111319 }
 111320 
 111321 type analysisInfo = struct {
 111322 	Fdb        uintptr
 111323 	FzDatabase uintptr
 111324 }
 111325 
 111326 // Used to pass information from the analyzer reader through to the
 111327 // callback routine.
 111328 type AnalysisInfo = analysisInfo
 111329 
 111330 func decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, aLog uintptr, pIndex uintptr) {
 111331 	var z uintptr = zIntArray
 111332 	var c int32
 111333 	var i int32
 111334 	var v TRowcnt
 111335 
 111336 	if z == uintptr(0) {
 111337 		z = ts + 1544
 111338 	}
 111339 	for i = 0; *(*int8)(unsafe.Pointer(z)) != 0 && i < nOut; i++ {
 111340 		v = uint64(0)
 111341 		for libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z)))) >= '0' && c <= '9' {
 111342 			v = v*uint64(10) + TRowcnt(c) - uint64('0')
 111343 			z++
 111344 		}
 111345 		if aOut != 0 {
 111346 			*(*TRowcnt)(unsafe.Pointer(aOut + uintptr(i)*8)) = v
 111347 		}
 111348 		if aLog != 0 {
 111349 			*(*LogEst)(unsafe.Pointer(aLog + uintptr(i)*2)) = Xsqlite3LogEst(tls, v)
 111350 		}
 111351 		if int32(*(*int8)(unsafe.Pointer(z))) == ' ' {
 111352 			z++
 111353 		}
 111354 	}
 111355 	if pIndex != 0 {
 111356 		libc.SetBitFieldPtr16Uint32(pIndex+100, uint32(0), 2, 0x4)
 111357 		libc.SetBitFieldPtr16Uint32(pIndex+100, uint32(0), 6, 0x40)
 111358 		for *(*int8)(unsafe.Pointer(z)) != 0 {
 111359 			if Xsqlite3_strglob(tls, ts+12848, z) == 0 {
 111360 				libc.SetBitFieldPtr16Uint32(pIndex+100, uint32(1), 2, 0x4)
 111361 			} else if Xsqlite3_strglob(tls, ts+12859, z) == 0 {
 111362 				var sz int32 = Xsqlite3Atoi(tls, z+uintptr(3))
 111363 				if sz < 2 {
 111364 					sz = 2
 111365 				}
 111366 				(*Index)(unsafe.Pointer(pIndex)).FszIdxRow = Xsqlite3LogEst(tls, uint64(sz))
 111367 			} else if Xsqlite3_strglob(tls, ts+12869, z) == 0 {
 111368 				libc.SetBitFieldPtr16Uint32(pIndex+100, uint32(1), 6, 0x40)
 111369 			}
 111370 			for int32(*(*int8)(unsafe.Pointer(z))) != 0 && int32(*(*int8)(unsafe.Pointer(z))) != ' ' {
 111371 				z++
 111372 			}
 111373 			for int32(*(*int8)(unsafe.Pointer(z))) == ' ' {
 111374 				z++
 111375 			}
 111376 		}
 111377 	}
 111378 }
 111379 
 111380 func analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, NotUsed uintptr) int32 {
 111381 	bp := tls.Alloc(152)
 111382 	defer tls.Free(152)
 111383 
 111384 	var pInfo uintptr = pData
 111385 	var pIndex uintptr
 111386 	var pTable uintptr
 111387 	var z uintptr
 111388 
 111389 	_ = NotUsed
 111390 	_ = argc
 111391 
 111392 	if argv == uintptr(0) || *(*uintptr)(unsafe.Pointer(argv)) == uintptr(0) || *(*uintptr)(unsafe.Pointer(argv + 2*8)) == uintptr(0) {
 111393 		return 0
 111394 	}
 111395 	pTable = Xsqlite3FindTable(tls, (*AnalysisInfo)(unsafe.Pointer(pInfo)).Fdb, *(*uintptr)(unsafe.Pointer(argv)), (*AnalysisInfo)(unsafe.Pointer(pInfo)).FzDatabase)
 111396 	if pTable == uintptr(0) {
 111397 		return 0
 111398 	}
 111399 	if *(*uintptr)(unsafe.Pointer(argv + 1*8)) == uintptr(0) {
 111400 		pIndex = uintptr(0)
 111401 	} else if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*uintptr)(unsafe.Pointer(argv + 1*8))) == 0 {
 111402 		pIndex = Xsqlite3PrimaryKeyIndex(tls, pTable)
 111403 	} else {
 111404 		pIndex = Xsqlite3FindIndex(tls, (*AnalysisInfo)(unsafe.Pointer(pInfo)).Fdb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), (*AnalysisInfo)(unsafe.Pointer(pInfo)).FzDatabase)
 111405 	}
 111406 	z = *(*uintptr)(unsafe.Pointer(argv + 2*8))
 111407 
 111408 	if pIndex != 0 {
 111409 		var aiRowEst uintptr = uintptr(0)
 111410 		var nCol int32 = int32((*Index)(unsafe.Pointer(pIndex)).FnKeyCol) + 1
 111411 
 111412 		if (*Index)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) {
 111413 			(*Index)(unsafe.Pointer(pIndex)).FaiRowEst = Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(TRowcnt(0)))*uint64(nCol))
 111414 			if (*Index)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) {
 111415 				Xsqlite3OomFault(tls, (*AnalysisInfo)(unsafe.Pointer(pInfo)).Fdb)
 111416 			}
 111417 		}
 111418 		aiRowEst = (*Index)(unsafe.Pointer(pIndex)).FaiRowEst
 111419 		libc.SetBitFieldPtr16Uint32(pIndex+100, uint32(0), 2, 0x4)
 111420 		decodeIntArray(tls, z, nCol, aiRowEst, (*Index)(unsafe.Pointer(pIndex)).FaiRowLogEst, pIndex)
 111421 		libc.SetBitFieldPtr16Uint32(pIndex+100, uint32(1), 7, 0x80)
 111422 		if (*Index)(unsafe.Pointer(pIndex)).FpPartIdxWhere == uintptr(0) {
 111423 			(*Table)(unsafe.Pointer(pTable)).FnRowLogEst = *(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiRowLogEst))
 111424 			*(*U32)(unsafe.Pointer(pTable + 48)) |= U32(TF_HasStat1)
 111425 		}
 111426 	} else {
 111427 		(*Index)(unsafe.Pointer(bp)).FszIdxRow = (*Table)(unsafe.Pointer(pTable)).FszTabRow
 111428 		decodeIntArray(tls, z, 1, uintptr(0), pTable+58, bp)
 111429 		(*Table)(unsafe.Pointer(pTable)).FszTabRow = (*Index)(unsafe.Pointer(bp)).FszIdxRow
 111430 		*(*U32)(unsafe.Pointer(pTable + 48)) |= U32(TF_HasStat1)
 111431 	}
 111432 
 111433 	return 0
 111434 }
 111435 
 111436 // If the Index.aSample variable is not NULL, delete the aSample[] array
 111437 // and its contents.
 111438 func Xsqlite3DeleteIndexSamples(tls *libc.TLS, db uintptr, pIdx uintptr) {
 111439 	if (*Index)(unsafe.Pointer(pIdx)).FaSample != 0 {
 111440 		var j int32
 111441 		for j = 0; j < (*Index)(unsafe.Pointer(pIdx)).FnSample; j++ {
 111442 			var p uintptr = (*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr(j)*40
 111443 			Xsqlite3DbFree(tls, db, (*IndexSample)(unsafe.Pointer(p)).Fp)
 111444 		}
 111445 		Xsqlite3DbFree(tls, db, (*Index)(unsafe.Pointer(pIdx)).FaSample)
 111446 	}
 111447 	if (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0) {
 111448 		(*Index)(unsafe.Pointer(pIdx)).FnSample = 0
 111449 		(*Index)(unsafe.Pointer(pIdx)).FaSample = uintptr(0)
 111450 	}
 111451 }
 111452 
 111453 func initAvgEq(tls *libc.TLS, pIdx uintptr) {
 111454 	if pIdx != 0 {
 111455 		var aSample uintptr = (*Index)(unsafe.Pointer(pIdx)).FaSample
 111456 		var pFinal uintptr = aSample + uintptr((*Index)(unsafe.Pointer(pIdx)).FnSample-1)*40
 111457 		var iCol int32
 111458 		var nCol int32 = 1
 111459 		if (*Index)(unsafe.Pointer(pIdx)).FnSampleCol > 1 {
 111460 			nCol = (*Index)(unsafe.Pointer(pIdx)).FnSampleCol - 1
 111461 			*(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaAvgEq + uintptr(nCol)*8)) = uint64(1)
 111462 		}
 111463 		for iCol = 0; iCol < nCol; iCol++ {
 111464 			var nSample int32 = (*Index)(unsafe.Pointer(pIdx)).FnSample
 111465 			var i int32
 111466 			var sumEq TRowcnt = uint64(0)
 111467 			var avgEq TRowcnt = uint64(0)
 111468 			var nRow TRowcnt
 111469 			var nSum100 I64 = int64(0)
 111470 			var nDist100 I64
 111471 
 111472 			if !(int32((*Index)(unsafe.Pointer(pIdx)).FaiRowEst) != 0) || iCol >= int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) || *(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowEst + uintptr(iCol+1)*8)) == uint64(0) {
 111473 				nRow = *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(pFinal)).FanLt + uintptr(iCol)*8))
 111474 				nDist100 = I64(TRowcnt(int64(100)) * *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(pFinal)).FanDLt + uintptr(iCol)*8)))
 111475 				nSample--
 111476 			} else {
 111477 				nRow = *(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowEst))
 111478 				nDist100 = I64(TRowcnt(int64(100)) * *(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowEst)) / *(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowEst + uintptr(iCol+1)*8)))
 111479 			}
 111480 			(*Index)(unsafe.Pointer(pIdx)).FnRowEst0 = nRow
 111481 
 111482 			for i = 0; i < nSample; i++ {
 111483 				if i == (*Index)(unsafe.Pointer(pIdx)).FnSample-1 ||
 111484 					*(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(i)*40)).FanDLt + uintptr(iCol)*8)) != *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(i+1)*40)).FanDLt + uintptr(iCol)*8)) {
 111485 					sumEq = sumEq + *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(i)*40)).FanEq + uintptr(iCol)*8))
 111486 					nSum100 = nSum100 + int64(100)
 111487 				}
 111488 			}
 111489 
 111490 			if nDist100 > nSum100 && sumEq < nRow {
 111491 				avgEq = TRowcnt(int64(100)) * (nRow - sumEq) / TRowcnt(nDist100-nSum100)
 111492 			}
 111493 			if avgEq == uint64(0) {
 111494 				avgEq = uint64(1)
 111495 			}
 111496 			*(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaAvgEq + uintptr(iCol)*8)) = avgEq
 111497 		}
 111498 	}
 111499 }
 111500 
 111501 func findIndexOrPrimaryKey(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) uintptr {
 111502 	var pIdx uintptr = Xsqlite3FindIndex(tls, db, zName, zDb)
 111503 	if pIdx == uintptr(0) {
 111504 		var pTab uintptr = Xsqlite3FindTable(tls, db, zName, zDb)
 111505 		if pTab != 0 && !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 111506 			pIdx = Xsqlite3PrimaryKeyIndex(tls, pTab)
 111507 		}
 111508 	}
 111509 	return pIdx
 111510 }
 111511 
 111512 func loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb uintptr) int32 {
 111513 	bp := tls.Alloc(24)
 111514 	defer tls.Free(24)
 111515 
 111516 	var rc int32
 111517 	*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
 111518 	var zSql uintptr
 111519 	var pPrevIdx uintptr = uintptr(0)
 111520 	var pSample uintptr
 111521 
 111522 	zSql = Xsqlite3MPrintf(tls, db, zSql1, libc.VaList(bp, zDb))
 111523 	if !(zSql != 0) {
 111524 		return SQLITE_NOMEM
 111525 	}
 111526 	rc = Xsqlite3_prepare(tls, db, zSql, -1, bp+16, uintptr(0))
 111527 	Xsqlite3DbFree(tls, db, zSql)
 111528 	if rc != 0 {
 111529 		return rc
 111530 	}
 111531 
 111532 	for Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) == SQLITE_ROW {
 111533 		var nIdxCol int32 = 1
 111534 
 111535 		var zIndex uintptr
 111536 		var pIdx uintptr
 111537 		var nSample int32
 111538 		var nByte int32
 111539 		var i int32
 111540 		var pSpace uintptr
 111541 
 111542 		zIndex = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), 0)
 111543 		if zIndex == uintptr(0) {
 111544 			continue
 111545 		}
 111546 		nSample = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), 1)
 111547 		pIdx = findIndexOrPrimaryKey(tls, db, zIndex, zDb)
 111548 
 111549 		if pIdx == uintptr(0) {
 111550 			continue
 111551 		}
 111552 
 111553 		if !((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) && int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY {
 111554 			nIdxCol = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
 111555 		} else {
 111556 			nIdxCol = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
 111557 		}
 111558 		(*Index)(unsafe.Pointer(pIdx)).FnSampleCol = nIdxCol
 111559 		nByte = int32(uint64(unsafe.Sizeof(IndexSample{})) * uint64(nSample))
 111560 		nByte = int32(uint64(nByte) + uint64(unsafe.Sizeof(TRowcnt(0)))*uint64(nIdxCol)*uint64(3)*uint64(nSample))
 111561 		nByte = int32(uint64(nByte) + uint64(nIdxCol)*uint64(unsafe.Sizeof(TRowcnt(0))))
 111562 
 111563 		(*Index)(unsafe.Pointer(pIdx)).FaSample = Xsqlite3DbMallocZero(tls, db, uint64(nByte))
 111564 		if (*Index)(unsafe.Pointer(pIdx)).FaSample == uintptr(0) {
 111565 			Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
 111566 			return SQLITE_NOMEM
 111567 		}
 111568 		pSpace = (*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr(nSample)*40
 111569 		(*Index)(unsafe.Pointer(pIdx)).FaAvgEq = pSpace
 111570 		pSpace += 8 * uintptr(nIdxCol)
 111571 		*(*U32)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable + 48)) |= U32(TF_HasStat4)
 111572 		for i = 0; i < nSample; i++ {
 111573 			(*IndexSample)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr(i)*40)).FanEq = pSpace
 111574 			pSpace += 8 * uintptr(nIdxCol)
 111575 			(*IndexSample)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr(i)*40)).FanLt = pSpace
 111576 			pSpace += 8 * uintptr(nIdxCol)
 111577 			(*IndexSample)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr(i)*40)).FanDLt = pSpace
 111578 			pSpace += 8 * uintptr(nIdxCol)
 111579 		}
 111580 
 111581 	}
 111582 	rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
 111583 	if rc != 0 {
 111584 		return rc
 111585 	}
 111586 
 111587 	zSql = Xsqlite3MPrintf(tls, db, zSql2, libc.VaList(bp+8, zDb))
 111588 	if !(zSql != 0) {
 111589 		return SQLITE_NOMEM
 111590 	}
 111591 	rc = Xsqlite3_prepare(tls, db, zSql, -1, bp+16, uintptr(0))
 111592 	Xsqlite3DbFree(tls, db, zSql)
 111593 	if rc != 0 {
 111594 		return rc
 111595 	}
 111596 
 111597 	for Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) == SQLITE_ROW {
 111598 		var zIndex uintptr
 111599 		var pIdx uintptr
 111600 		var nCol int32 = 1
 111601 
 111602 		zIndex = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), 0)
 111603 		if zIndex == uintptr(0) {
 111604 			continue
 111605 		}
 111606 		pIdx = findIndexOrPrimaryKey(tls, db, zIndex, zDb)
 111607 		if pIdx == uintptr(0) {
 111608 			continue
 111609 		}
 111610 
 111611 		nCol = (*Index)(unsafe.Pointer(pIdx)).FnSampleCol
 111612 		if pIdx != pPrevIdx {
 111613 			initAvgEq(tls, pPrevIdx)
 111614 			pPrevIdx = pIdx
 111615 		}
 111616 		pSample = (*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr((*Index)(unsafe.Pointer(pIdx)).FnSample)*40
 111617 		decodeIntArray(tls, Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), 1), nCol, (*IndexSample)(unsafe.Pointer(pSample)).FanEq, uintptr(0), uintptr(0))
 111618 		decodeIntArray(tls, Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), 2), nCol, (*IndexSample)(unsafe.Pointer(pSample)).FanLt, uintptr(0), uintptr(0))
 111619 		decodeIntArray(tls, Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), 3), nCol, (*IndexSample)(unsafe.Pointer(pSample)).FanDLt, uintptr(0), uintptr(0))
 111620 
 111621 		(*IndexSample)(unsafe.Pointer(pSample)).Fn = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), 4)
 111622 		(*IndexSample)(unsafe.Pointer(pSample)).Fp = Xsqlite3DbMallocZero(tls, db, uint64((*IndexSample)(unsafe.Pointer(pSample)).Fn+2))
 111623 		if (*IndexSample)(unsafe.Pointer(pSample)).Fp == uintptr(0) {
 111624 			Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
 111625 			return SQLITE_NOMEM
 111626 		}
 111627 		if (*IndexSample)(unsafe.Pointer(pSample)).Fn != 0 {
 111628 			libc.Xmemcpy(tls, (*IndexSample)(unsafe.Pointer(pSample)).Fp, Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), 4), uint64((*IndexSample)(unsafe.Pointer(pSample)).Fn))
 111629 		}
 111630 		(*Index)(unsafe.Pointer(pIdx)).FnSample++
 111631 	}
 111632 	rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
 111633 	if rc == SQLITE_OK {
 111634 		initAvgEq(tls, pPrevIdx)
 111635 	}
 111636 	return rc
 111637 }
 111638 
 111639 func loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) int32 {
 111640 	var rc int32 = SQLITE_OK
 111641 	var pStat4 uintptr
 111642 
 111643 	if libc.AssignUintptr(&pStat4, Xsqlite3FindTable(tls, db, ts+12726, zDb)) != uintptr(0) &&
 111644 		int32((*Table)(unsafe.Pointer(pStat4)).FeTabType) == TABTYP_NORM {
 111645 		rc = loadStatTbl(tls, db,
 111646 			ts+12881,
 111647 			ts+12935,
 111648 			zDb)
 111649 	}
 111650 	return rc
 111651 }
 111652 
 111653 // Load the content of the sqlite_stat1 and sqlite_stat4 tables. The
 111654 // contents of sqlite_stat1 are used to populate the Index.aiRowEst[]
 111655 // arrays. The contents of sqlite_stat4 are used to populate the
 111656 // Index.aSample[] arrays.
 111657 //
 111658 // If the sqlite_stat1 table is not present in the database, SQLITE_ERROR
 111659 // is returned. In this case, even if SQLITE_ENABLE_STAT4 was defined
 111660 // during compilation and the sqlite_stat4 table is present, no data is
 111661 // read from it.
 111662 //
 111663 // If SQLITE_ENABLE_STAT4 was defined during compilation and the
 111664 // sqlite_stat4 table is not present in the database, SQLITE_ERROR is
 111665 // returned. However, in this case, data is read from the sqlite_stat1
 111666 // table (if it is present) before returning.
 111667 //
 111668 // If an OOM error occurs, this function always sets db->mallocFailed.
 111669 // This means if the caller does not care about other errors, the return
 111670 // code may be ignored.
 111671 func Xsqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) int32 {
 111672 	bp := tls.Alloc(24)
 111673 	defer tls.Free(24)
 111674 
 111675 	var i uintptr
 111676 	var zSql uintptr
 111677 	var rc int32 = SQLITE_OK
 111678 	var pSchema uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpSchema
 111679 	var pStat1 uintptr
 111680 
 111681 	for i = (*Hash)(unsafe.Pointer(pSchema + 8)).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
 111682 		var pTab uintptr = (*HashElem)(unsafe.Pointer(i)).Fdata
 111683 		*(*U32)(unsafe.Pointer(pTab + 48)) &= libc.Uint32FromInt32(libc.CplInt32(TF_HasStat1))
 111684 	}
 111685 	for i = (*Hash)(unsafe.Pointer(pSchema + 32)).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
 111686 		var pIdx uintptr = (*HashElem)(unsafe.Pointer(i)).Fdata
 111687 		libc.SetBitFieldPtr16Uint32(pIdx+100, uint32(0), 7, 0x80)
 111688 		Xsqlite3DeleteIndexSamples(tls, db, pIdx)
 111689 		(*Index)(unsafe.Pointer(pIdx)).FaSample = uintptr(0)
 111690 	}
 111691 
 111692 	(*AnalysisInfo)(unsafe.Pointer(bp + 8)).Fdb = db
 111693 	(*AnalysisInfo)(unsafe.Pointer(bp + 8)).FzDatabase = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
 111694 	if libc.AssignUintptr(&pStat1, Xsqlite3FindTable(tls, db, ts+12700, (*AnalysisInfo)(unsafe.Pointer(bp+8)).FzDatabase)) != 0 &&
 111695 		int32((*Table)(unsafe.Pointer(pStat1)).FeTabType) == TABTYP_NORM {
 111696 		zSql = Xsqlite3MPrintf(tls, db,
 111697 			ts+12987, libc.VaList(bp, (*AnalysisInfo)(unsafe.Pointer(bp+8)).FzDatabase))
 111698 		if zSql == uintptr(0) {
 111699 			rc = SQLITE_NOMEM
 111700 		} else {
 111701 			rc = Xsqlite3_exec(tls, db, zSql, *(*uintptr)(unsafe.Pointer(&struct {
 111702 				f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
 111703 			}{analysisLoader})), bp+8, uintptr(0))
 111704 			Xsqlite3DbFree(tls, db, zSql)
 111705 		}
 111706 	}
 111707 
 111708 	for i = (*Hash)(unsafe.Pointer(pSchema + 32)).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
 111709 		var pIdx uintptr = (*HashElem)(unsafe.Pointer(i)).Fdata
 111710 		if !(int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x80>>7) != 0) {
 111711 			Xsqlite3DefaultRowEst(tls, pIdx)
 111712 		}
 111713 	}
 111714 
 111715 	if rc == SQLITE_OK {
 111716 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++
 111717 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0)
 111718 		rc = loadStat4(tls, db, (*AnalysisInfo)(unsafe.Pointer(bp+8)).FzDatabase)
 111719 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable--
 111720 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = func() uint16 {
 111721 			if (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable != 0 {
 111722 				return uint16(0)
 111723 			}
 111724 			return (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue
 111725 		}()
 111726 	}
 111727 	for i = (*Hash)(unsafe.Pointer(pSchema + 32)).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
 111728 		var pIdx uintptr = (*HashElem)(unsafe.Pointer(i)).Fdata
 111729 		Xsqlite3_free(tls, (*Index)(unsafe.Pointer(pIdx)).FaiRowEst)
 111730 		(*Index)(unsafe.Pointer(pIdx)).FaiRowEst = uintptr(0)
 111731 	}
 111732 
 111733 	if rc == SQLITE_NOMEM {
 111734 		Xsqlite3OomFault(tls, db)
 111735 	}
 111736 	return rc
 111737 }
 111738 
 111739 func resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) int32 {
 111740 	var rc int32 = SQLITE_OK
 111741 	if pExpr != 0 {
 111742 		if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_ID {
 111743 			rc = Xsqlite3ResolveExprNames(tls, pName, pExpr)
 111744 		} else {
 111745 			(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_STRING)
 111746 		}
 111747 	}
 111748 	return rc
 111749 }
 111750 
 111751 // Return true if zName points to a name that may be used to refer to
 111752 // database iDb attached to handle db.
 111753 func Xsqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) int32 {
 111754 	return libc.Bool32(Xsqlite3StrICmp(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, zName) == 0 ||
 111755 		iDb == 0 && Xsqlite3StrICmp(tls, ts+7793, zName) == 0)
 111756 }
 111757 
 111758 func attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) {
 111759 	bp := tls.Alloc(72)
 111760 	defer tls.Free(72)
 111761 
 111762 	var i int32
 111763 	var rc int32
 111764 	var db uintptr
 111765 	var zName uintptr
 111766 	var zFile uintptr
 111767 
 111768 	var aNew uintptr
 111769 	var pNew uintptr
 111770 
 111771 	var pNewSchema uintptr
 111772 
 111773 	var pPager uintptr
 111774 	var iDb int32
 111775 	rc = 0
 111776 	db = Xsqlite3_context_db_handle(tls, context)
 111777 	*(*uintptr)(unsafe.Pointer(bp + 48)) = uintptr(0)
 111778 	*(*uintptr)(unsafe.Pointer(bp + 56)) = uintptr(0)
 111779 	pNew = uintptr(0)
 111780 	*(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0)
 111781 
 111782 	_ = NotUsed
 111783 	zFile = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 111784 	zName = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 111785 	if !(zFile == uintptr(0)) {
 111786 		goto __1
 111787 	}
 111788 	zFile = ts + 1544
 111789 __1:
 111790 	;
 111791 	if !(zName == uintptr(0)) {
 111792 		goto __2
 111793 	}
 111794 	zName = ts + 1544
 111795 __2:
 111796 	;
 111797 	if !(uint32(int32(*(*uint8)(unsafe.Pointer(db + 192 + 8))&0x4>>2)) != 0) {
 111798 		goto __3
 111799 	}
 111800 
 111801 	*(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0)
 111802 	*(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_vfs_find(tls, ts+5187)
 111803 	if !(*(*uintptr)(unsafe.Pointer(bp + 40)) == uintptr(0)) {
 111804 		goto __5
 111805 	}
 111806 	return
 111807 __5:
 111808 	;
 111809 	rc = Xsqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 40)), ts+13028, db, bp+24, 0, SQLITE_OPEN_MAIN_DB)
 111810 	if !(rc == SQLITE_OK) {
 111811 		goto __6
 111812 	}
 111813 	pNewSchema = Xsqlite3SchemaGet(tls, db, *(*uintptr)(unsafe.Pointer(bp + 24)))
 111814 	if !(pNewSchema != 0) {
 111815 		goto __7
 111816 	}
 111817 
 111818 	pNew = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb)*32
 111819 	if !((*Db)(unsafe.Pointer(pNew)).FpBt != 0) {
 111820 		goto __9
 111821 	}
 111822 	Xsqlite3BtreeClose(tls, (*Db)(unsafe.Pointer(pNew)).FpBt)
 111823 __9:
 111824 	;
 111825 	(*Db)(unsafe.Pointer(pNew)).FpBt = *(*uintptr)(unsafe.Pointer(bp + 24))
 111826 	(*Db)(unsafe.Pointer(pNew)).FpSchema = pNewSchema
 111827 	goto __8
 111828 __7:
 111829 	Xsqlite3BtreeClose(tls, *(*uintptr)(unsafe.Pointer(bp + 24)))
 111830 	rc = SQLITE_NOMEM
 111831 __8:
 111832 	;
 111833 __6:
 111834 	;
 111835 	if !(rc != 0) {
 111836 		goto __10
 111837 	}
 111838 	goto attach_error
 111839 __10:
 111840 	;
 111841 	goto __4
 111842 __3:
 111843 	if !((*Sqlite3)(unsafe.Pointer(db)).FnDb >= *(*int32)(unsafe.Pointer(db + 136 + 7*4))+2) {
 111844 		goto __11
 111845 	}
 111846 	*(*uintptr)(unsafe.Pointer(bp + 64)) = Xsqlite3MPrintf(tls, db, ts+13031,
 111847 		libc.VaList(bp, *(*int32)(unsafe.Pointer(db + 136 + 7*4))))
 111848 	goto attach_error
 111849 __11:
 111850 	;
 111851 	i = 0
 111852 __12:
 111853 	if !(i < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
 111854 		goto __14
 111855 	}
 111856 
 111857 	if !(Xsqlite3DbIsNamed(tls, db, i, zName) != 0) {
 111858 		goto __15
 111859 	}
 111860 	*(*uintptr)(unsafe.Pointer(bp + 64)) = Xsqlite3MPrintf(tls, db, ts+13068, libc.VaList(bp+8, zName))
 111861 	goto attach_error
 111862 __15:
 111863 	;
 111864 	goto __13
 111865 __13:
 111866 	i++
 111867 	goto __12
 111868 	goto __14
 111869 __14:
 111870 	;
 111871 	if !((*Sqlite3)(unsafe.Pointer(db)).FaDb == db+696) {
 111872 		goto __16
 111873 	}
 111874 	aNew = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(Db{}))*uint64(3))
 111875 	if !(aNew == uintptr(0)) {
 111876 		goto __18
 111877 	}
 111878 	return
 111879 __18:
 111880 	;
 111881 	libc.Xmemcpy(tls, aNew, (*Sqlite3)(unsafe.Pointer(db)).FaDb, uint64(unsafe.Sizeof(Db{}))*uint64(2))
 111882 	goto __17
 111883 __16:
 111884 	aNew = Xsqlite3DbRealloc(tls, db, (*Sqlite3)(unsafe.Pointer(db)).FaDb, uint64(unsafe.Sizeof(Db{}))*uint64((*Sqlite3)(unsafe.Pointer(db)).FnDb+1))
 111885 	if !(aNew == uintptr(0)) {
 111886 		goto __19
 111887 	}
 111888 	return
 111889 __19:
 111890 	;
 111891 __17:
 111892 	;
 111893 	(*Sqlite3)(unsafe.Pointer(db)).FaDb = aNew
 111894 	pNew = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Sqlite3)(unsafe.Pointer(db)).FnDb)*32
 111895 	libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(Db{})))
 111896 
 111897 	*(*uint32)(unsafe.Pointer(bp + 32)) = (*Sqlite3)(unsafe.Pointer(db)).FopenFlags
 111898 	rc = Xsqlite3ParseUri(tls, (*Sqlite3_vfs)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FpVfs)).FzName, zFile, bp+32, bp+40, bp+48, bp+56)
 111899 	if !(rc != SQLITE_OK) {
 111900 		goto __20
 111901 	}
 111902 	if !(rc == SQLITE_NOMEM) {
 111903 		goto __21
 111904 	}
 111905 	Xsqlite3OomFault(tls, db)
 111906 __21:
 111907 	;
 111908 	Xsqlite3_result_error(tls, context, *(*uintptr)(unsafe.Pointer(bp + 56)), -1)
 111909 	Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 56)))
 111910 	return
 111911 __20:
 111912 	;
 111913 	*(*uint32)(unsafe.Pointer(bp + 32)) |= uint32(SQLITE_OPEN_MAIN_DB)
 111914 	rc = Xsqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 40)), *(*uintptr)(unsafe.Pointer(bp + 48)), db, pNew+8, 0, int32(*(*uint32)(unsafe.Pointer(bp + 32))))
 111915 	(*Sqlite3)(unsafe.Pointer(db)).FnDb++
 111916 	(*Db)(unsafe.Pointer(pNew)).FzDbSName = Xsqlite3DbStrDup(tls, db, zName)
 111917 __4:
 111918 	;
 111919 	(*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache = U8(0)
 111920 	if !(rc == SQLITE_CONSTRAINT) {
 111921 		goto __22
 111922 	}
 111923 	rc = SQLITE_ERROR
 111924 	*(*uintptr)(unsafe.Pointer(bp + 64)) = Xsqlite3MPrintf(tls, db, ts+13098, 0)
 111925 	goto __23
 111926 __22:
 111927 	if !(rc == SQLITE_OK) {
 111928 		goto __24
 111929 	}
 111930 	(*Db)(unsafe.Pointer(pNew)).FpSchema = Xsqlite3SchemaGet(tls, db, (*Db)(unsafe.Pointer(pNew)).FpBt)
 111931 	if !!(int32((*Db)(unsafe.Pointer(pNew)).FpSchema) != 0) {
 111932 		goto __25
 111933 	}
 111934 	rc = SQLITE_NOMEM
 111935 	goto __26
 111936 __25:
 111937 	if !((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pNew)).FpSchema)).Ffile_format != 0 && int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pNew)).FpSchema)).Fenc) != int32((*Sqlite3)(unsafe.Pointer(db)).Fenc)) {
 111938 		goto __27
 111939 	}
 111940 	*(*uintptr)(unsafe.Pointer(bp + 64)) = Xsqlite3MPrintf(tls, db,
 111941 		ts+13127, 0)
 111942 	rc = SQLITE_ERROR
 111943 __27:
 111944 	;
 111945 __26:
 111946 	;
 111947 	Xsqlite3BtreeEnter(tls, (*Db)(unsafe.Pointer(pNew)).FpBt)
 111948 	pPager = Xsqlite3BtreePager(tls, (*Db)(unsafe.Pointer(pNew)).FpBt)
 111949 	Xsqlite3PagerLockingMode(tls, pPager, int32((*Sqlite3)(unsafe.Pointer(db)).FdfltLockMode))
 111950 	Xsqlite3BtreeSecureDelete(tls, (*Db)(unsafe.Pointer(pNew)).FpBt,
 111951 		Xsqlite3BtreeSecureDelete(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpBt, -1))
 111952 	Xsqlite3BtreeSetPagerFlags(tls, (*Db)(unsafe.Pointer(pNew)).FpBt,
 111953 		uint32(uint64(PAGER_SYNCHRONOUS_FULL)|(*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(PAGER_FLAGS_MASK)))
 111954 	Xsqlite3BtreeLeave(tls, (*Db)(unsafe.Pointer(pNew)).FpBt)
 111955 __24:
 111956 	;
 111957 __23:
 111958 	;
 111959 	(*Db)(unsafe.Pointer(pNew)).Fsafety_level = U8(SQLITE_DEFAULT_SYNCHRONOUS + 1)
 111960 	if !(rc == SQLITE_OK && (*Db)(unsafe.Pointer(pNew)).FzDbSName == uintptr(0)) {
 111961 		goto __28
 111962 	}
 111963 	rc = SQLITE_NOMEM
 111964 __28:
 111965 	;
 111966 	Xsqlite3_free_filename(tls, *(*uintptr)(unsafe.Pointer(bp + 48)))
 111967 
 111968 	if !(rc == SQLITE_OK) {
 111969 		goto __29
 111970 	}
 111971 	Xsqlite3BtreeEnterAll(tls, db)
 111972 	(*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(0)
 111973 	*(*U32)(unsafe.Pointer(db + 44)) &= libc.Uint32FromInt32(libc.CplInt32(DBFLAG_SchemaKnownOk))
 111974 	if !!(int32(*(*uint8)(unsafe.Pointer(db + 192 + 8))&0x4>>2) != 0) {
 111975 		goto __30
 111976 	}
 111977 	rc = Xsqlite3Init(tls, db, bp+64)
 111978 __30:
 111979 	;
 111980 	Xsqlite3BtreeLeaveAll(tls, db)
 111981 
 111982 __29:
 111983 	;
 111984 	if !(rc != 0) {
 111985 		goto __31
 111986 	}
 111987 	if !!(int32(*(*uint8)(unsafe.Pointer(db + 192 + 8))&0x4>>2) != 0) {
 111988 		goto __32
 111989 	}
 111990 	iDb = (*Sqlite3)(unsafe.Pointer(db)).FnDb - 1
 111991 
 111992 	if !((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpBt != 0) {
 111993 		goto __33
 111994 	}
 111995 	Xsqlite3BtreeClose(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpBt)
 111996 	(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpBt = uintptr(0)
 111997 	(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpSchema = uintptr(0)
 111998 __33:
 111999 	;
 112000 	Xsqlite3ResetAllSchemasOfConnection(tls, db)
 112001 	(*Sqlite3)(unsafe.Pointer(db)).FnDb = iDb
 112002 	if !(rc == SQLITE_NOMEM || rc == SQLITE_IOERR|int32(12)<<8) {
 112003 		goto __34
 112004 	}
 112005 	Xsqlite3OomFault(tls, db)
 112006 	Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 64)))
 112007 	*(*uintptr)(unsafe.Pointer(bp + 64)) = Xsqlite3MPrintf(tls, db, ts+1480, 0)
 112008 	goto __35
 112009 __34:
 112010 	if !(*(*uintptr)(unsafe.Pointer(bp + 64)) == uintptr(0)) {
 112011 		goto __36
 112012 	}
 112013 	*(*uintptr)(unsafe.Pointer(bp + 64)) = Xsqlite3MPrintf(tls, db, ts+13195, libc.VaList(bp+16, zFile))
 112014 __36:
 112015 	;
 112016 __35:
 112017 	;
 112018 __32:
 112019 	;
 112020 	goto attach_error
 112021 __31:
 112022 	;
 112023 	return
 112024 
 112025 attach_error:
 112026 	if !(*(*uintptr)(unsafe.Pointer(bp + 64)) != 0) {
 112027 		goto __37
 112028 	}
 112029 	Xsqlite3_result_error(tls, context, *(*uintptr)(unsafe.Pointer(bp + 64)), -1)
 112030 	Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 64)))
 112031 __37:
 112032 	;
 112033 	if !(rc != 0) {
 112034 		goto __38
 112035 	}
 112036 	Xsqlite3_result_error_code(tls, context, rc)
 112037 __38:
 112038 }
 112039 
 112040 func detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) {
 112041 	bp := tls.Alloc(152)
 112042 	defer tls.Free(152)
 112043 
 112044 	var zName uintptr
 112045 	var db uintptr
 112046 	var i int32
 112047 	var pDb uintptr
 112048 	var pEntry uintptr
 112049 
 112050 	var pTrig uintptr
 112051 	zName = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 112052 	db = Xsqlite3_context_db_handle(tls, context)
 112053 	pDb = uintptr(0)
 112054 
 112055 	_ = NotUsed
 112056 
 112057 	if !(zName == uintptr(0)) {
 112058 		goto __1
 112059 	}
 112060 	zName = ts + 1544
 112061 __1:
 112062 	;
 112063 	i = 0
 112064 __2:
 112065 	if !(i < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
 112066 		goto __4
 112067 	}
 112068 	pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32
 112069 	if !((*Db)(unsafe.Pointer(pDb)).FpBt == uintptr(0)) {
 112070 		goto __5
 112071 	}
 112072 	goto __3
 112073 __5:
 112074 	;
 112075 	if !(Xsqlite3DbIsNamed(tls, db, i, zName) != 0) {
 112076 		goto __6
 112077 	}
 112078 	goto __4
 112079 __6:
 112080 	;
 112081 	goto __3
 112082 __3:
 112083 	i++
 112084 	goto __2
 112085 	goto __4
 112086 __4:
 112087 	;
 112088 	if !(i >= (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
 112089 		goto __7
 112090 	}
 112091 	Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]int8{})), bp+24, ts+13223, libc.VaList(bp, zName))
 112092 	goto detach_error
 112093 __7:
 112094 	;
 112095 	if !(i < 2) {
 112096 		goto __8
 112097 	}
 112098 	Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]int8{})), bp+24, ts+13244, libc.VaList(bp+8, zName))
 112099 	goto detach_error
 112100 __8:
 112101 	;
 112102 	if !(Xsqlite3BtreeTxnState(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) != SQLITE_TXN_NONE ||
 112103 		Xsqlite3BtreeIsInBackup(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) != 0) {
 112104 		goto __9
 112105 	}
 112106 	Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]int8{})), bp+24, ts+13270, libc.VaList(bp+16, zName))
 112107 	goto detach_error
 112108 __9:
 112109 	;
 112110 	pEntry = (*Hash)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema + 56)).Ffirst
 112111 __10:
 112112 	if !(pEntry != 0) {
 112113 		goto __11
 112114 	}
 112115 	pTrig = (*HashElem)(unsafe.Pointer(pEntry)).Fdata
 112116 	if !((*Trigger)(unsafe.Pointer(pTrig)).FpTabSchema == (*Db)(unsafe.Pointer(pDb)).FpSchema) {
 112117 		goto __12
 112118 	}
 112119 	(*Trigger)(unsafe.Pointer(pTrig)).FpTabSchema = (*Trigger)(unsafe.Pointer(pTrig)).FpSchema
 112120 __12:
 112121 	;
 112122 	pEntry = (*HashElem)(unsafe.Pointer(pEntry)).Fnext
 112123 	goto __10
 112124 __11:
 112125 	;
 112126 	Xsqlite3BtreeClose(tls, (*Db)(unsafe.Pointer(pDb)).FpBt)
 112127 	(*Db)(unsafe.Pointer(pDb)).FpBt = uintptr(0)
 112128 	(*Db)(unsafe.Pointer(pDb)).FpSchema = uintptr(0)
 112129 	Xsqlite3CollapseDatabaseArray(tls, db)
 112130 	return
 112131 
 112132 detach_error:
 112133 	Xsqlite3_result_error(tls, context, bp+24, -1)
 112134 }
 112135 
 112136 func codeAttach(tls *libc.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAuthArg uintptr, pFilename uintptr, pDbname uintptr, pKey uintptr) {
 112137 	bp := tls.Alloc(56)
 112138 	defer tls.Free(56)
 112139 
 112140 	var rc int32
 112141 
 112142 	var v uintptr
 112143 	var db uintptr
 112144 	var regArgs int32
 112145 	var zAuthArg uintptr
 112146 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 112147 
 112148 	if !(SQLITE_OK != Xsqlite3ReadSchema(tls, pParse)) {
 112149 		goto __1
 112150 	}
 112151 	goto attach_end
 112152 __1:
 112153 	;
 112154 	if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
 112155 		goto __2
 112156 	}
 112157 	goto attach_end
 112158 __2:
 112159 	;
 112160 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(NameContext{})))
 112161 	(*NameContext)(unsafe.Pointer(bp)).FpParse = pParse
 112162 
 112163 	if !(SQLITE_OK != resolveAttachExpr(tls, bp, pFilename) || SQLITE_OK != resolveAttachExpr(tls, bp, pDbname) || SQLITE_OK != resolveAttachExpr(tls, bp, pKey)) {
 112164 		goto __3
 112165 	}
 112166 	goto attach_end
 112167 __3:
 112168 	;
 112169 	if !(pAuthArg != 0) {
 112170 		goto __4
 112171 	}
 112172 	if !(int32((*Expr)(unsafe.Pointer(pAuthArg)).Fop) == TK_STRING) {
 112173 		goto __5
 112174 	}
 112175 
 112176 	zAuthArg = *(*uintptr)(unsafe.Pointer(pAuthArg + 8))
 112177 	goto __6
 112178 __5:
 112179 	zAuthArg = uintptr(0)
 112180 __6:
 112181 	;
 112182 	rc = Xsqlite3AuthCheck(tls, pParse, type1, zAuthArg, uintptr(0), uintptr(0))
 112183 	if !(rc != SQLITE_OK) {
 112184 		goto __7
 112185 	}
 112186 	goto attach_end
 112187 __7:
 112188 	;
 112189 __4:
 112190 	;
 112191 	v = Xsqlite3GetVdbe(tls, pParse)
 112192 	regArgs = Xsqlite3GetTempRange(tls, pParse, 4)
 112193 	Xsqlite3ExprCode(tls, pParse, pFilename, regArgs)
 112194 	Xsqlite3ExprCode(tls, pParse, pDbname, regArgs+1)
 112195 	Xsqlite3ExprCode(tls, pParse, pKey, regArgs+2)
 112196 
 112197 	if !(v != 0) {
 112198 		goto __8
 112199 	}
 112200 	Xsqlite3VdbeAddFunctionCall(tls, pParse, 0, regArgs+3-int32((*FuncDef)(unsafe.Pointer(pFunc)).FnArg), regArgs+3,
 112201 		int32((*FuncDef)(unsafe.Pointer(pFunc)).FnArg), pFunc, 0)
 112202 
 112203 	Xsqlite3VdbeAddOp1(tls, v, OP_Expire, libc.Bool32(type1 == SQLITE_ATTACH))
 112204 __8:
 112205 	;
 112206 attach_end:
 112207 	Xsqlite3ExprDelete(tls, db, pFilename)
 112208 	Xsqlite3ExprDelete(tls, db, pDbname)
 112209 	Xsqlite3ExprDelete(tls, db, pKey)
 112210 }
 112211 
 112212 // Called by the parser to compile a DETACH statement.
 112213 //
 112214 //	DETACH pDbname
 112215 func Xsqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) {
 112216 	codeAttach(tls, pParse, SQLITE_DETACH, uintptr(unsafe.Pointer(&detach_func)), pDbname, uintptr(0), uintptr(0), pDbname)
 112217 }
 112218 
 112219 var detach_func = FuncDef{
 112220 	FnArg:      int8(1),
 112221 	FfuncFlags: U32(SQLITE_UTF8),
 112222 	FxSFunc:    0,
 112223 	FzName:     ts + 13292}
 112224 
 112225 // Called by the parser to compile an ATTACH statement.
 112226 //
 112227 //	ATTACH p AS pDbname KEY pKey
 112228 func Xsqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, pKey uintptr) {
 112229 	codeAttach(tls, pParse, SQLITE_ATTACH, uintptr(unsafe.Pointer(&attach_func)), p, p, pDbname, pKey)
 112230 }
 112231 
 112232 var attach_func = FuncDef{
 112233 	FnArg:      int8(3),
 112234 	FfuncFlags: U32(SQLITE_UTF8),
 112235 	FxSFunc:    0,
 112236 	FzName:     ts + 13306}
 112237 
 112238 func fixExprCb(tls *libc.TLS, p uintptr, pExpr uintptr) int32 {
 112239 	bp := tls.Alloc(8)
 112240 	defer tls.Free(8)
 112241 
 112242 	var pFix uintptr = *(*uintptr)(unsafe.Pointer(p + 40))
 112243 	if !(int32((*DbFixer)(unsafe.Pointer(pFix)).FbTemp) != 0) {
 112244 		*(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_FromDDL)
 112245 	}
 112246 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VARIABLE {
 112247 		if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*DbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit.Fbusy != 0 {
 112248 			(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL)
 112249 		} else {
 112250 			Xsqlite3ErrorMsg(tls, (*DbFixer)(unsafe.Pointer(pFix)).FpParse, ts+13320, libc.VaList(bp, (*DbFixer)(unsafe.Pointer(pFix)).FzType))
 112251 			return WRC_Abort
 112252 		}
 112253 	}
 112254 	return WRC_Continue
 112255 }
 112256 
 112257 func fixSelectCb(tls *libc.TLS, p uintptr, pSelect uintptr) int32 {
 112258 	bp := tls.Alloc(24)
 112259 	defer tls.Free(24)
 112260 
 112261 	var pFix uintptr = *(*uintptr)(unsafe.Pointer(p + 40))
 112262 	var i int32
 112263 	var pItem uintptr
 112264 	var db uintptr = (*Parse)(unsafe.Pointer((*DbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb
 112265 	var iDb int32 = Xsqlite3FindDbName(tls, db, (*DbFixer)(unsafe.Pointer(pFix)).FzDb)
 112266 	var pList uintptr = (*Select)(unsafe.Pointer(pSelect)).FpSrc
 112267 
 112268 	if pList == uintptr(0) {
 112269 		return WRC_Continue
 112270 	}
 112271 	i = 0
 112272 	pItem = pList + 8
 112273 __1:
 112274 	if !(i < (*SrcList)(unsafe.Pointer(pList)).FnSrc) {
 112275 		goto __3
 112276 	}
 112277 	{
 112278 		if int32((*DbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 {
 112279 			if (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase != 0 {
 112280 				if iDb != Xsqlite3FindDbName(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase) {
 112281 					Xsqlite3ErrorMsg(tls, (*DbFixer)(unsafe.Pointer(pFix)).FpParse,
 112282 						ts+13344,
 112283 						libc.VaList(bp, (*DbFixer)(unsafe.Pointer(pFix)).FzType, (*DbFixer)(unsafe.Pointer(pFix)).FpName, (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase))
 112284 					return WRC_Abort
 112285 				}
 112286 				Xsqlite3DbFree(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase)
 112287 				(*SrcItem)(unsafe.Pointer(pItem)).FzDatabase = uintptr(0)
 112288 				libc.SetBitFieldPtr16Uint32(pItem+60+4, uint32(1), 9, 0x200)
 112289 			}
 112290 			(*SrcItem)(unsafe.Pointer(pItem)).FpSchema = (*DbFixer)(unsafe.Pointer(pFix)).FpSchema
 112291 			libc.SetBitFieldPtr16Uint32(pItem+60+4, uint32(1), 7, 0x80)
 112292 		}
 112293 		if int32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*104 + 60 + 4))&0x400>>10) == 0 &&
 112294 			Xsqlite3WalkExpr(tls, pFix+8, *(*uintptr)(unsafe.Pointer(pList + 8 + uintptr(i)*104 + 72))) != 0 {
 112295 			return WRC_Abort
 112296 		}
 112297 
 112298 	}
 112299 	goto __2
 112300 __2:
 112301 	i++
 112302 	pItem += 104
 112303 	goto __1
 112304 	goto __3
 112305 __3:
 112306 	;
 112307 	if (*Select)(unsafe.Pointer(pSelect)).FpWith != 0 {
 112308 		for i = 0; i < (*With)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpWith)).FnCte; i++ {
 112309 			if Xsqlite3WalkSelect(tls, p, (*Cte)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpWith+16+uintptr(i)*48)).FpSelect) != 0 {
 112310 				return WRC_Abort
 112311 			}
 112312 		}
 112313 	}
 112314 	return WRC_Continue
 112315 }
 112316 
 112317 // Initialize a DbFixer structure.  This routine must be called prior
 112318 // to passing the structure to one of the sqliteFixAAAA() routines below.
 112319 func Xsqlite3FixInit(tls *libc.TLS, pFix uintptr, pParse uintptr, iDb int32, zType uintptr, pName uintptr) {
 112320 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 112321 
 112322 	(*DbFixer)(unsafe.Pointer(pFix)).FpParse = pParse
 112323 	(*DbFixer)(unsafe.Pointer(pFix)).FzDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
 112324 	(*DbFixer)(unsafe.Pointer(pFix)).FpSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpSchema
 112325 	(*DbFixer)(unsafe.Pointer(pFix)).FzType = zType
 112326 	(*DbFixer)(unsafe.Pointer(pFix)).FpName = pName
 112327 	(*DbFixer)(unsafe.Pointer(pFix)).FbTemp = U8(libc.Bool32(iDb == 1))
 112328 	(*DbFixer)(unsafe.Pointer(pFix)).Fw.FpParse = pParse
 112329 	(*DbFixer)(unsafe.Pointer(pFix)).Fw.FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 112330 		f func(*libc.TLS, uintptr, uintptr) int32
 112331 	}{fixExprCb}))
 112332 	(*DbFixer)(unsafe.Pointer(pFix)).Fw.FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
 112333 		f func(*libc.TLS, uintptr, uintptr) int32
 112334 	}{fixSelectCb}))
 112335 	(*DbFixer)(unsafe.Pointer(pFix)).Fw.FxSelectCallback2 = *(*uintptr)(unsafe.Pointer(&struct {
 112336 		f func(*libc.TLS, uintptr, uintptr)
 112337 	}{Xsqlite3WalkWinDefnDummyCallback}))
 112338 	(*DbFixer)(unsafe.Pointer(pFix)).Fw.FwalkerDepth = 0
 112339 	(*DbFixer)(unsafe.Pointer(pFix)).Fw.FeCode = U16(0)
 112340 	*(*uintptr)(unsafe.Pointer(pFix + 8 + 40)) = pFix
 112341 }
 112342 
 112343 // The following set of routines walk through the parse tree and assign
 112344 // a specific database to all table references where the database name
 112345 // was left unspecified in the original SQL statement.  The pFix structure
 112346 // must have been initialized by a prior call to sqlite3FixInit().
 112347 //
 112348 // These routines are used to make sure that an index, trigger, or
 112349 // view in one database does not refer to objects in a different database.
 112350 // (Exception: indices, triggers, and views in the TEMP database are
 112351 // allowed to refer to anything.)  If a reference is explicitly made
 112352 // to an object in a different database, an error message is added to
 112353 // pParse->zErrMsg and these routines return non-zero.  If everything
 112354 // checks out, these routines return 0.
 112355 func Xsqlite3FixSrcList(tls *libc.TLS, pFix uintptr, pList uintptr) int32 {
 112356 	bp := tls.Alloc(128)
 112357 	defer tls.Free(128)
 112358 
 112359 	var res int32 = 0
 112360 	if pList != 0 {
 112361 		libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Select{})))
 112362 		(*Select)(unsafe.Pointer(bp)).FpSrc = pList
 112363 		res = Xsqlite3WalkSelect(tls, pFix+8, bp)
 112364 	}
 112365 	return res
 112366 }
 112367 
 112368 func Xsqlite3FixSelect(tls *libc.TLS, pFix uintptr, pSelect uintptr) int32 {
 112369 	return Xsqlite3WalkSelect(tls, pFix+8, pSelect)
 112370 }
 112371 
 112372 func Xsqlite3FixExpr(tls *libc.TLS, pFix uintptr, pExpr uintptr) int32 {
 112373 	return Xsqlite3WalkExpr(tls, pFix+8, pExpr)
 112374 }
 112375 
 112376 func Xsqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) int32 {
 112377 	for pStep != 0 {
 112378 		if Xsqlite3WalkSelect(tls, pFix+8, (*TriggerStep)(unsafe.Pointer(pStep)).FpSelect) != 0 ||
 112379 			Xsqlite3WalkExpr(tls, pFix+8, (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere) != 0 ||
 112380 			Xsqlite3WalkExprList(tls, pFix+8, (*TriggerStep)(unsafe.Pointer(pStep)).FpExprList) != 0 ||
 112381 			Xsqlite3FixSrcList(tls, pFix, (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom) != 0 {
 112382 			return 1
 112383 		}
 112384 		{
 112385 			var pUp uintptr
 112386 			for pUp = (*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert; pUp != 0; pUp = (*Upsert)(unsafe.Pointer(pUp)).FpNextUpsert {
 112387 				if Xsqlite3WalkExprList(tls, pFix+8, (*Upsert)(unsafe.Pointer(pUp)).FpUpsertTarget) != 0 ||
 112388 					Xsqlite3WalkExpr(tls, pFix+8, (*Upsert)(unsafe.Pointer(pUp)).FpUpsertTargetWhere) != 0 ||
 112389 					Xsqlite3WalkExprList(tls, pFix+8, (*Upsert)(unsafe.Pointer(pUp)).FpUpsertSet) != 0 ||
 112390 					Xsqlite3WalkExpr(tls, pFix+8, (*Upsert)(unsafe.Pointer(pUp)).FpUpsertWhere) != 0 {
 112391 					return 1
 112392 				}
 112393 			}
 112394 
 112395 		}
 112396 		pStep = (*TriggerStep)(unsafe.Pointer(pStep)).FpNext
 112397 	}
 112398 
 112399 	return 0
 112400 }
 112401 
 112402 // Set or clear the access authorization function.
 112403 //
 112404 // The access authorization function is be called during the compilation
 112405 // phase to verify that the user has read and/or write access permission on
 112406 // various fields of the database.  The first argument to the auth function
 112407 // is a copy of the 3rd argument to this routine.  The second argument
 112408 // to the auth function is one of these constants:
 112409 //
 112410 //	SQLITE_CREATE_INDEX
 112411 //	SQLITE_CREATE_TABLE
 112412 //	SQLITE_CREATE_TEMP_INDEX
 112413 //	SQLITE_CREATE_TEMP_TABLE
 112414 //	SQLITE_CREATE_TEMP_TRIGGER
 112415 //	SQLITE_CREATE_TEMP_VIEW
 112416 //	SQLITE_CREATE_TRIGGER
 112417 //	SQLITE_CREATE_VIEW
 112418 //	SQLITE_DELETE
 112419 //	SQLITE_DROP_INDEX
 112420 //	SQLITE_DROP_TABLE
 112421 //	SQLITE_DROP_TEMP_INDEX
 112422 //	SQLITE_DROP_TEMP_TABLE
 112423 //	SQLITE_DROP_TEMP_TRIGGER
 112424 //	SQLITE_DROP_TEMP_VIEW
 112425 //	SQLITE_DROP_TRIGGER
 112426 //	SQLITE_DROP_VIEW
 112427 //	SQLITE_INSERT
 112428 //	SQLITE_PRAGMA
 112429 //	SQLITE_READ
 112430 //	SQLITE_SELECT
 112431 //	SQLITE_TRANSACTION
 112432 //	SQLITE_UPDATE
 112433 //
 112434 // The third and fourth arguments to the auth function are the name of
 112435 // the table and the column that are being accessed.  The auth function
 112436 // should return either SQLITE_OK, SQLITE_DENY, or SQLITE_IGNORE.  If
 112437 // SQLITE_OK is returned, it means that access is allowed.  SQLITE_DENY
 112438 // means that the SQL statement will never-run - the sqlite3_exec() call
 112439 // will return with an error.  SQLITE_IGNORE means that the SQL statement
 112440 // should run but attempts to read the specified column will return NULL
 112441 // and attempts to write the column will be ignored.
 112442 //
 112443 // Setting the auth function to NULL disables this hook.  The default
 112444 // setting of the auth function is NULL.
 112445 func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uintptr) int32 {
 112446 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 112447 	(*Sqlite3)(unsafe.Pointer(db)).FxAuth = xAuth
 112448 	(*Sqlite3)(unsafe.Pointer(db)).FpAuthArg = pArg
 112449 	if (*Sqlite3)(unsafe.Pointer(db)).FxAuth != 0 {
 112450 		Xsqlite3ExpirePreparedStatements(tls, db, 1)
 112451 	}
 112452 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 112453 	return SQLITE_OK
 112454 }
 112455 
 112456 func sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) {
 112457 	Xsqlite3ErrorMsg(tls, pParse, ts+13390, 0)
 112458 	(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR
 112459 }
 112460 
 112461 // Invoke the authorization callback for permission to read column zCol from
 112462 // table zTab in database zDb. This function assumes that an authorization
 112463 // callback has been registered (i.e. that sqlite3.xAuth is not NULL).
 112464 //
 112465 // If SQLITE_IGNORE is returned and pExpr is not NULL, then pExpr is changed
 112466 // to an SQL NULL expression. Otherwise, if pExpr is NULL, then SQLITE_IGNORE
 112467 // is treated as SQLITE_DENY. In this case an error is left in pParse.
 112468 func Xsqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintptr, iDb int32) int32 {
 112469 	bp := tls.Alloc(40)
 112470 	defer tls.Free(40)
 112471 
 112472 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 112473 	var zDb uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
 112474 	var rc int32
 112475 
 112476 	if (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 {
 112477 		return SQLITE_OK
 112478 	}
 112479 	rc = (*struct {
 112480 		f func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32
 112481 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxAuth})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpAuthArg, SQLITE_READ, zTab, zCol, zDb, (*Parse)(unsafe.Pointer(pParse)).FzAuthContext)
 112482 	if rc == SQLITE_DENY {
 112483 		var z uintptr = Xsqlite3_mprintf(tls, ts+13413, libc.VaList(bp, zTab, zCol))
 112484 		if (*Sqlite3)(unsafe.Pointer(db)).FnDb > 2 || iDb != 0 {
 112485 			z = Xsqlite3_mprintf(tls, ts+13419, libc.VaList(bp+16, zDb, z))
 112486 		}
 112487 		Xsqlite3ErrorMsg(tls, pParse, ts+13425, libc.VaList(bp+32, z))
 112488 		(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_AUTH
 112489 	} else if rc != SQLITE_IGNORE && rc != SQLITE_OK {
 112490 		sqliteAuthBadReturnCode(tls, pParse)
 112491 	}
 112492 	return rc
 112493 }
 112494 
 112495 // The pExpr should be a TK_COLUMN expression.  The table referred to
 112496 // is in pTabList or else it is the NEW or OLD table of a trigger.
 112497 // Check to see if it is OK to read this particular column.
 112498 //
 112499 // If the auth function returns SQLITE_IGNORE, change the TK_COLUMN
 112500 // instruction into a TK_NULL.  If the auth function returns SQLITE_DENY,
 112501 // then generate an error.
 112502 func Xsqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uintptr, pTabList uintptr) {
 112503 	var pTab uintptr = uintptr(0)
 112504 	var zCol uintptr
 112505 	var iSrc int32
 112506 	var iDb int32
 112507 	var iCol int32
 112508 
 112509 	iDb = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pSchema)
 112510 	if iDb < 0 {
 112511 		return
 112512 	}
 112513 
 112514 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_TRIGGER {
 112515 		pTab = (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab
 112516 	} else {
 112517 		for iSrc = 0; iSrc < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc; iSrc++ {
 112518 			if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcItem)(unsafe.Pointer(pTabList+8+uintptr(iSrc)*104)).FiCursor {
 112519 				pTab = (*SrcItem)(unsafe.Pointer(pTabList + 8 + uintptr(iSrc)*104)).FpTab
 112520 				break
 112521 			}
 112522 		}
 112523 	}
 112524 	iCol = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)
 112525 	if pTab == uintptr(0) {
 112526 		return
 112527 	}
 112528 
 112529 	if iCol >= 0 {
 112530 		zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*24)).FzCnName
 112531 	} else if int32((*Table)(unsafe.Pointer(pTab)).FiPKey) >= 0 {
 112532 		zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr((*Table)(unsafe.Pointer(pTab)).FiPKey)*24)).FzCnName
 112533 	} else {
 112534 		zCol = ts + 9065
 112535 	}
 112536 
 112537 	if SQLITE_IGNORE == Xsqlite3AuthReadCol(tls, pParse, (*Table)(unsafe.Pointer(pTab)).FzName, zCol, iDb) {
 112538 		(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL)
 112539 	}
 112540 }
 112541 
 112542 // Do an authorization check using the code and arguments given.  Return
 112543 // either SQLITE_OK (zero) or SQLITE_IGNORE or SQLITE_DENY.  If SQLITE_DENY
 112544 // is returned, then the error count and error message in pParse are
 112545 // modified appropriately.
 112546 func Xsqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, zArg2 uintptr, zArg3 uintptr) int32 {
 112547 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 112548 	var rc int32
 112549 
 112550 	if (*Sqlite3)(unsafe.Pointer(db)).FxAuth == uintptr(0) || (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 || int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL {
 112551 		return SQLITE_OK
 112552 	}
 112553 
 112554 	rc = (*struct {
 112555 		f func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32
 112556 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxAuth})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpAuthArg, code, zArg1, zArg2, zArg3, (*Parse)(unsafe.Pointer(pParse)).FzAuthContext)
 112557 	if rc == SQLITE_DENY {
 112558 		Xsqlite3ErrorMsg(tls, pParse, ts+13452, 0)
 112559 		(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_AUTH
 112560 	} else if rc != SQLITE_OK && rc != SQLITE_IGNORE {
 112561 		rc = SQLITE_DENY
 112562 		sqliteAuthBadReturnCode(tls, pParse)
 112563 	}
 112564 	return rc
 112565 }
 112566 
 112567 // Push an authorization context.  After this routine is called, the
 112568 // zArg3 argument to authorization callbacks will be zContext until
 112569 // popped.  Or if pParse==0, this routine is a no-op.
 112570 func Xsqlite3AuthContextPush(tls *libc.TLS, pParse uintptr, pContext uintptr, zContext uintptr) {
 112571 	(*AuthContext)(unsafe.Pointer(pContext)).FpParse = pParse
 112572 	(*AuthContext)(unsafe.Pointer(pContext)).FzAuthContext = (*Parse)(unsafe.Pointer(pParse)).FzAuthContext
 112573 	(*Parse)(unsafe.Pointer(pParse)).FzAuthContext = zContext
 112574 }
 112575 
 112576 // Pop an authorization context that was previously pushed
 112577 // by sqlite3AuthContextPush
 112578 func Xsqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) {
 112579 	if (*AuthContext)(unsafe.Pointer(pContext)).FpParse != 0 {
 112580 		(*Parse)(unsafe.Pointer((*AuthContext)(unsafe.Pointer(pContext)).FpParse)).FzAuthContext = (*AuthContext)(unsafe.Pointer(pContext)).FzAuthContext
 112581 		(*AuthContext)(unsafe.Pointer(pContext)).FpParse = uintptr(0)
 112582 	}
 112583 }
 112584 
 112585 func lockTable(tls *libc.TLS, pParse uintptr, iDb int32, iTab Pgno, isWriteLock U8, zName uintptr) {
 112586 	var pToplevel uintptr
 112587 	var i int32
 112588 	var nBytes int32
 112589 	var p uintptr
 112590 
 112591 	pToplevel = func() uintptr {
 112592 		if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
 112593 			return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
 112594 		}
 112595 		return pParse
 112596 	}()
 112597 	for i = 0; i < (*Parse)(unsafe.Pointer(pToplevel)).FnTableLock; i++ {
 112598 		p = (*Parse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(i)*24
 112599 		if (*TableLock)(unsafe.Pointer(p)).FiDb == iDb && (*TableLock)(unsafe.Pointer(p)).FiTab == iTab {
 112600 			(*TableLock)(unsafe.Pointer(p)).FisWriteLock = U8(libc.Bool32((*TableLock)(unsafe.Pointer(p)).FisWriteLock != 0 || isWriteLock != 0))
 112601 			return
 112602 		}
 112603 	}
 112604 
 112605 	nBytes = int32(uint64(unsafe.Sizeof(TableLock{})) * uint64((*Parse)(unsafe.Pointer(pToplevel)).FnTableLock+1))
 112606 	(*Parse)(unsafe.Pointer(pToplevel)).FaTableLock = Xsqlite3DbReallocOrFree(tls, (*Parse)(unsafe.Pointer(pToplevel)).Fdb, (*Parse)(unsafe.Pointer(pToplevel)).FaTableLock, uint64(nBytes))
 112607 	if (*Parse)(unsafe.Pointer(pToplevel)).FaTableLock != 0 {
 112608 		p = (*Parse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pToplevel)).FnTableLock, 1))*24
 112609 		(*TableLock)(unsafe.Pointer(p)).FiDb = iDb
 112610 		(*TableLock)(unsafe.Pointer(p)).FiTab = iTab
 112611 		(*TableLock)(unsafe.Pointer(p)).FisWriteLock = isWriteLock
 112612 		(*TableLock)(unsafe.Pointer(p)).FzLockName = zName
 112613 	} else {
 112614 		(*Parse)(unsafe.Pointer(pToplevel)).FnTableLock = 0
 112615 		Xsqlite3OomFault(tls, (*Parse)(unsafe.Pointer(pToplevel)).Fdb)
 112616 	}
 112617 }
 112618 
 112619 func Xsqlite3TableLock(tls *libc.TLS, pParse uintptr, iDb int32, iTab Pgno, isWriteLock U8, zName uintptr) {
 112620 	if iDb == 1 {
 112621 		return
 112622 	}
 112623 	if !(Xsqlite3BtreeSharable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb+uintptr(iDb)*32)).FpBt) != 0) {
 112624 		return
 112625 	}
 112626 	lockTable(tls, pParse, iDb, iTab, isWriteLock, zName)
 112627 }
 112628 
 112629 func codeTableLocks(tls *libc.TLS, pParse uintptr) {
 112630 	var i int32
 112631 	var pVdbe uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 112632 
 112633 	for i = 0; i < (*Parse)(unsafe.Pointer(pParse)).FnTableLock; i++ {
 112634 		var p uintptr = (*Parse)(unsafe.Pointer(pParse)).FaTableLock + uintptr(i)*24
 112635 		var p1 int32 = (*TableLock)(unsafe.Pointer(p)).FiDb
 112636 		Xsqlite3VdbeAddOp4(tls, pVdbe, OP_TableLock, p1, int32((*TableLock)(unsafe.Pointer(p)).FiTab), int32((*TableLock)(unsafe.Pointer(p)).FisWriteLock),
 112637 			(*TableLock)(unsafe.Pointer(p)).FzLockName, -1)
 112638 	}
 112639 }
 112640 
 112641 // This routine is called after a single SQL statement has been
 112642 // parsed and a VDBE program to execute that statement has been
 112643 // prepared.  This routine puts the finishing touches on the
 112644 // VDBE program and resets the pParse structure for the next
 112645 // parse.
 112646 //
 112647 // Note that if an error occurred, it might be the case that
 112648 // no VDBE code was generated.
 112649 func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr) {
 112650 	var db uintptr
 112651 	var v uintptr
 112652 	var iDb int32
 112653 	var i int32
 112654 
 112655 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 112656 
 112657 	if (*Parse)(unsafe.Pointer(pParse)).Fnested != 0 {
 112658 		return
 112659 	}
 112660 	if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 112661 		if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 112662 			(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_NOMEM
 112663 		}
 112664 		return
 112665 	}
 112666 
 112667 	v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 112668 	if v == uintptr(0) {
 112669 		if (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 {
 112670 			(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_DONE
 112671 			return
 112672 		}
 112673 		v = Xsqlite3GetVdbe(tls, pParse)
 112674 		if v == uintptr(0) {
 112675 			(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR
 112676 		}
 112677 	}
 112678 
 112679 	if v != 0 {
 112680 		if (*Parse)(unsafe.Pointer(pParse)).FbReturning != 0 {
 112681 			var pReturning uintptr = *(*uintptr)(unsafe.Pointer(pParse + 200))
 112682 			var addrRewind int32
 112683 			var reg int32
 112684 
 112685 			if (*Returning)(unsafe.Pointer(pReturning)).FnRetCol != 0 {
 112686 				Xsqlite3VdbeAddOp0(tls, v, OP_FkCheck)
 112687 				addrRewind = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur)
 112688 
 112689 				reg = (*Returning)(unsafe.Pointer(pReturning)).FiRetReg
 112690 				for i = 0; i < (*Returning)(unsafe.Pointer(pReturning)).FnRetCol; i++ {
 112691 					Xsqlite3VdbeAddOp3(tls, v, OP_Column, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur, i, reg+i)
 112692 				}
 112693 				Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, reg, i)
 112694 				Xsqlite3VdbeAddOp2(tls, v, OP_Next, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur, addrRewind+1)
 112695 
 112696 				Xsqlite3VdbeJumpHere(tls, v, addrRewind)
 112697 			}
 112698 		}
 112699 		Xsqlite3VdbeAddOp0(tls, v, OP_Halt)
 112700 
 112701 		Xsqlite3VdbeJumpHere(tls, v, 0)
 112702 
 112703 		iDb = 0
 112704 		for __ccgo := true; __ccgo; __ccgo = libc.PreIncInt32(&iDb, 1) < (*Sqlite3)(unsafe.Pointer(db)).FnDb {
 112705 			var pSchema uintptr
 112706 			if libc.Bool32((*Parse)(unsafe.Pointer(pParse)).FcookieMask&(YDbMask(1)<<iDb) != YDbMask(0)) == 0 {
 112707 				continue
 112708 			}
 112709 			Xsqlite3VdbeUsesBtree(tls, v, iDb)
 112710 			pSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpSchema
 112711 			Xsqlite3VdbeAddOp4Int(tls, v,
 112712 				OP_Transaction,
 112713 				iDb,
 112714 				libc.Bool32((*Parse)(unsafe.Pointer(pParse)).FwriteMask&(YDbMask(1)<<iDb) != YDbMask(0)),
 112715 				(*Schema)(unsafe.Pointer(pSchema)).Fschema_cookie,
 112716 				(*Schema)(unsafe.Pointer(pSchema)).FiGeneration)
 112717 			if int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0 {
 112718 				Xsqlite3VdbeChangeP5(tls, v, uint16(1))
 112719 			}
 112720 
 112721 		}
 112722 		for i = 0; i < (*Parse)(unsafe.Pointer(pParse)).FnVtabLock; i++ {
 112723 			var vtab uintptr = Xsqlite3GetVTable(tls, db, *(*uintptr)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).FapVtabLock + uintptr(i)*8)))
 112724 			Xsqlite3VdbeAddOp4(tls, v, OP_VBegin, 0, 0, 0, vtab, -11)
 112725 		}
 112726 		(*Parse)(unsafe.Pointer(pParse)).FnVtabLock = 0
 112727 
 112728 		codeTableLocks(tls, pParse)
 112729 
 112730 		Xsqlite3AutoincrementBegin(tls, pParse)
 112731 
 112732 		if (*Parse)(unsafe.Pointer(pParse)).FpConstExpr != 0 {
 112733 			var pEL uintptr = (*Parse)(unsafe.Pointer(pParse)).FpConstExpr
 112734 			(*Parse)(unsafe.Pointer(pParse)).FokConstFactor = U8(0)
 112735 			for i = 0; i < (*ExprList)(unsafe.Pointer(pEL)).FnExpr; i++ {
 112736 				var iReg int32 = *(*int32)(unsafe.Pointer(pEL + 8 + uintptr(i)*32 + 24))
 112737 				Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(pEL+8+uintptr(i)*32)).FpExpr, iReg)
 112738 			}
 112739 		}
 112740 
 112741 		if (*Parse)(unsafe.Pointer(pParse)).FbReturning != 0 {
 112742 			var pRet uintptr = *(*uintptr)(unsafe.Pointer(pParse + 200))
 112743 			if (*Returning)(unsafe.Pointer(pRet)).FnRetCol != 0 {
 112744 				Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*Returning)(unsafe.Pointer(pRet)).FiRetCur, (*Returning)(unsafe.Pointer(pRet)).FnRetCol)
 112745 			}
 112746 		}
 112747 
 112748 		Xsqlite3VdbeGoto(tls, v, 1)
 112749 	}
 112750 
 112751 	if (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 {
 112752 		Xsqlite3VdbeMakeReady(tls, v, pParse)
 112753 		(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_DONE
 112754 	} else {
 112755 		(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR
 112756 	}
 112757 }
 112758 
 112759 // Run the parser and code generator recursively in order to generate
 112760 // code for the SQL statement given onto the end of the pParse context
 112761 // currently under construction.  Notes:
 112762 //
 112763 //   - The final OP_Halt is not appended and other initialization
 112764 //     and finalization steps are omitted because those are handling by the
 112765 //     outermost parser.
 112766 //
 112767 //   - Built-in SQL functions always take precedence over application-defined
 112768 //     SQL functions.  In other words, it is not possible to override a
 112769 //     built-in function.
 112770 func Xsqlite3NestedParse(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr) {
 112771 	bp := tls.Alloc(136)
 112772 	defer tls.Free(136)
 112773 
 112774 	var ap Va_list
 112775 	_ = ap
 112776 	var zSql uintptr
 112777 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 112778 	var savedDbFlags U32 = (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags
 112779 
 112780 	if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 112781 		return
 112782 	}
 112783 	if (*Parse)(unsafe.Pointer(pParse)).FeParseMode != 0 {
 112784 		return
 112785 	}
 112786 
 112787 	ap = va
 112788 	zSql = Xsqlite3VMPrintf(tls, db, zFormat, ap)
 112789 	_ = ap
 112790 	if zSql == uintptr(0) {
 112791 		if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
 112792 			(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_TOOBIG
 112793 		}
 112794 		(*Parse)(unsafe.Pointer(pParse)).FnErr++
 112795 		return
 112796 	}
 112797 	(*Parse)(unsafe.Pointer(pParse)).Fnested++
 112798 	libc.Xmemcpy(tls, bp, pParse+uintptr(uint64(uintptr(0)+288)), uint64(unsafe.Sizeof(Parse{}))-uint64(uintptr(0)+288))
 112799 	libc.Xmemset(tls, pParse+uintptr(uint64(uintptr(0)+288)), 0, uint64(unsafe.Sizeof(Parse{}))-uint64(uintptr(0)+288))
 112800 	*(*U32)(unsafe.Pointer(db + 44)) |= U32(DBFLAG_PreferBuiltin)
 112801 	Xsqlite3RunParser(tls, pParse, zSql)
 112802 	(*Sqlite3)(unsafe.Pointer(db)).FmDbFlags = savedDbFlags
 112803 	Xsqlite3DbFree(tls, db, zSql)
 112804 	libc.Xmemcpy(tls, pParse+uintptr(uint64(uintptr(0)+288)), bp, uint64(unsafe.Sizeof(Parse{}))-uint64(uintptr(0)+288))
 112805 	(*Parse)(unsafe.Pointer(pParse)).Fnested--
 112806 }
 112807 
 112808 // Locate the in-memory structure that describes a particular database
 112809 // table given the name of that table and (optionally) the name of the
 112810 // database containing the table.  Return NULL if not found.
 112811 //
 112812 // If zDatabase is 0, all databases are searched for the table and the
 112813 // first matching table is returned.  (No checking for duplicate table
 112814 // names is done.)  The search order is TEMP first, then MAIN, then any
 112815 // auxiliary databases added using the ATTACH command.
 112816 //
 112817 // See also sqlite3LocateTable().
 112818 func Xsqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintptr) uintptr {
 112819 	var p uintptr = uintptr(0)
 112820 	var i int32
 112821 
 112822 	if zDatabase != 0 {
 112823 		for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
 112824 			if Xsqlite3StrICmp(tls, zDatabase, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FzDbSName) == 0 {
 112825 				break
 112826 			}
 112827 		}
 112828 		if i >= (*Sqlite3)(unsafe.Pointer(db)).FnDb {
 112829 			if Xsqlite3StrICmp(tls, zDatabase, ts+7793) == 0 {
 112830 				i = 0
 112831 			} else {
 112832 				return uintptr(0)
 112833 			}
 112834 		}
 112835 		p = Xsqlite3HashFind(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FpSchema+8, zName)
 112836 		if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, ts+7733, 7) == 0 {
 112837 			if i == 1 {
 112838 				if Xsqlite3StrICmp(tls, zName+uintptr(7), ts+7760+7) == 0 ||
 112839 					Xsqlite3StrICmp(tls, zName+uintptr(7), ts+7779+7) == 0 ||
 112840 					Xsqlite3StrICmp(tls, zName+uintptr(7), ts+7235+7) == 0 {
 112841 					p = Xsqlite3HashFind(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema+8,
 112842 						ts+7741)
 112843 				}
 112844 			} else {
 112845 				if Xsqlite3StrICmp(tls, zName+uintptr(7), ts+7779+7) == 0 {
 112846 					p = Xsqlite3HashFind(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FpSchema+8,
 112847 						ts+7235)
 112848 				}
 112849 			}
 112850 		}
 112851 	} else {
 112852 		p = Xsqlite3HashFind(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema+8, zName)
 112853 		if p != 0 {
 112854 			return p
 112855 		}
 112856 
 112857 		p = Xsqlite3HashFind(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema+8, zName)
 112858 		if p != 0 {
 112859 			return p
 112860 		}
 112861 
 112862 		for i = 2; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
 112863 			p = Xsqlite3HashFind(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FpSchema+8, zName)
 112864 			if p != 0 {
 112865 				break
 112866 			}
 112867 		}
 112868 		if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, ts+7733, 7) == 0 {
 112869 			if Xsqlite3StrICmp(tls, zName+uintptr(7), ts+7779+7) == 0 {
 112870 				p = Xsqlite3HashFind(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema+8, ts+7235)
 112871 			} else if Xsqlite3StrICmp(tls, zName+uintptr(7), ts+7760+7) == 0 {
 112872 				p = Xsqlite3HashFind(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema+8,
 112873 					ts+7741)
 112874 			}
 112875 		}
 112876 	}
 112877 	return p
 112878 }
 112879 
 112880 // Locate the in-memory structure that describes a particular database
 112881 // table given the name of that table and (optionally) the name of the
 112882 // database containing the table.  Return NULL if not found.  Also leave an
 112883 // error message in pParse->zErrMsg.
 112884 //
 112885 // The difference between this routine and sqlite3FindTable() is that this
 112886 // routine leaves an error message in pParse->zErrMsg where
 112887 // sqlite3FindTable() does not.
 112888 func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr, zDbase uintptr) uintptr {
 112889 	bp := tls.Alloc(40)
 112890 	defer tls.Free(40)
 112891 
 112892 	var p uintptr
 112893 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 112894 
 112895 	if (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_SchemaKnownOk) == U32(0) &&
 112896 		SQLITE_OK != Xsqlite3ReadSchema(tls, pParse) {
 112897 		return uintptr(0)
 112898 	}
 112899 
 112900 	p = Xsqlite3FindTable(tls, db, zName, zDbase)
 112901 	if p == uintptr(0) {
 112902 		if int32((*Parse)(unsafe.Pointer(pParse)).FprepFlags)&SQLITE_PREPARE_NO_VTAB == 0 && int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0 {
 112903 			var pMod uintptr = Xsqlite3HashFind(tls, db+576, zName)
 112904 			if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, ts+13467, 7) == 0 {
 112905 				pMod = Xsqlite3PragmaVtabRegister(tls, db, zName)
 112906 			}
 112907 			if pMod != 0 && Xsqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 {
 112908 				return (*Module)(unsafe.Pointer(pMod)).FpEpoTab
 112909 			}
 112910 		}
 112911 		if flags&U32(LOCATE_NOERR) != 0 {
 112912 			return uintptr(0)
 112913 		}
 112914 		(*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1)
 112915 	} else if int32((*Table)(unsafe.Pointer(p)).FeTabType) == TABTYP_VTAB && int32((*Parse)(unsafe.Pointer(pParse)).FprepFlags)&SQLITE_PREPARE_NO_VTAB != 0 {
 112916 		p = uintptr(0)
 112917 	}
 112918 
 112919 	if p == uintptr(0) {
 112920 		var zMsg uintptr
 112921 		if flags&U32(LOCATE_VIEW) != 0 {
 112922 			zMsg = ts + 13475
 112923 		} else {
 112924 			zMsg = ts + 13488
 112925 		}
 112926 		if zDbase != 0 {
 112927 			Xsqlite3ErrorMsg(tls, pParse, ts+7997, libc.VaList(bp, zMsg, zDbase, zName))
 112928 		} else {
 112929 			Xsqlite3ErrorMsg(tls, pParse, ts+8007, libc.VaList(bp+24, zMsg, zName))
 112930 		}
 112931 	} else {
 112932 	}
 112933 
 112934 	return p
 112935 }
 112936 
 112937 // Locate the table identified by *p.
 112938 //
 112939 // This is a wrapper around sqlite3LocateTable(). The difference between
 112940 // sqlite3LocateTable() and this function is that this function restricts
 112941 // the search to schema (p->pSchema) if it is not NULL. p->pSchema may be
 112942 // non-NULL if it is part of a view or trigger program definition. See
 112943 // sqlite3FixSrcList() for details.
 112944 func Xsqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags U32, p uintptr) uintptr {
 112945 	var zDb uintptr
 112946 
 112947 	if (*SrcItem)(unsafe.Pointer(p)).FpSchema != 0 {
 112948 		var iDb int32 = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*SrcItem)(unsafe.Pointer(p)).FpSchema)
 112949 		zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32)).FzDbSName
 112950 	} else {
 112951 		zDb = (*SrcItem)(unsafe.Pointer(p)).FzDatabase
 112952 	}
 112953 	return Xsqlite3LocateTable(tls, pParse, flags, (*SrcItem)(unsafe.Pointer(p)).FzName, zDb)
 112954 }
 112955 
 112956 // Return the preferred table name for system tables.  Translate legacy
 112957 // names into the new preferred names, as appropriate.
 112958 func Xsqlite3PreferredTableName(tls *libc.TLS, zName uintptr) uintptr {
 112959 	if Xsqlite3_strnicmp(tls, zName, ts+7733, 7) == 0 {
 112960 		if Xsqlite3StrICmp(tls, zName+uintptr(7), ts+7235+7) == 0 {
 112961 			return ts + 7779
 112962 		}
 112963 		if Xsqlite3StrICmp(tls, zName+uintptr(7), ts+7741+7) == 0 {
 112964 			return ts + 7760
 112965 		}
 112966 	}
 112967 	return zName
 112968 }
 112969 
 112970 // Locate the in-memory structure that describes
 112971 // a particular index given the name of that index
 112972 // and the name of the database that contains the index.
 112973 // Return NULL if not found.
 112974 //
 112975 // If zDatabase is 0, all databases are searched for the
 112976 // table and the first matching index is returned.  (No checking
 112977 // for duplicate index names is done.)  The search order is
 112978 // TEMP first, then MAIN, then any auxiliary databases added
 112979 // using the ATTACH command.
 112980 func Xsqlite3FindIndex(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) uintptr {
 112981 	var p uintptr = uintptr(0)
 112982 	var i int32
 112983 
 112984 	for i = OMIT_TEMPDB; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
 112985 		var j int32
 112986 		if i < 2 {
 112987 			j = i ^ 1
 112988 		} else {
 112989 			j = i
 112990 		}
 112991 		var pSchema uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*32)).FpSchema
 112992 
 112993 		if zDb != 0 && Xsqlite3DbIsNamed(tls, db, j, zDb) == 0 {
 112994 			continue
 112995 		}
 112996 
 112997 		p = Xsqlite3HashFind(tls, pSchema+32, zName)
 112998 		if p != 0 {
 112999 			break
 113000 		}
 113001 	}
 113002 	return p
 113003 }
 113004 
 113005 // Reclaim the memory used by an index
 113006 func Xsqlite3FreeIndex(tls *libc.TLS, db uintptr, p uintptr) {
 113007 	Xsqlite3DeleteIndexSamples(tls, db, p)
 113008 	Xsqlite3ExprDelete(tls, db, (*Index)(unsafe.Pointer(p)).FpPartIdxWhere)
 113009 	Xsqlite3ExprListDelete(tls, db, (*Index)(unsafe.Pointer(p)).FaColExpr)
 113010 	Xsqlite3DbFree(tls, db, (*Index)(unsafe.Pointer(p)).FzColAff)
 113011 	if uint32(int32(*(*uint16)(unsafe.Pointer(p + 100))&0x10>>4)) != 0 {
 113012 		Xsqlite3DbFree(tls, db, (*Index)(unsafe.Pointer(p)).FazColl)
 113013 	}
 113014 	Xsqlite3_free(tls, (*Index)(unsafe.Pointer(p)).FaiRowEst)
 113015 	Xsqlite3DbFree(tls, db, p)
 113016 }
 113017 
 113018 // For the index called zIdxName which is found in the database iDb,
 113019 // unlike that index from its Table then remove the index from
 113020 // the index hash table and free all memory structures associated
 113021 // with the index.
 113022 func Xsqlite3UnlinkAndDeleteIndex(tls *libc.TLS, db uintptr, iDb int32, zIdxName uintptr) {
 113023 	var pIndex uintptr
 113024 	var pHash uintptr
 113025 
 113026 	pHash = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpSchema + 32
 113027 	pIndex = Xsqlite3HashInsert(tls, pHash, zIdxName, uintptr(0))
 113028 	if pIndex != 0 {
 113029 		if (*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FpTable)).FpIndex == pIndex {
 113030 			(*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FpTable)).FpIndex = (*Index)(unsafe.Pointer(pIndex)).FpNext
 113031 		} else {
 113032 			var p uintptr
 113033 
 113034 			p = (*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FpTable)).FpIndex
 113035 			for p != 0 && (*Index)(unsafe.Pointer(p)).FpNext != pIndex {
 113036 				p = (*Index)(unsafe.Pointer(p)).FpNext
 113037 			}
 113038 			if p != 0 && (*Index)(unsafe.Pointer(p)).FpNext == pIndex {
 113039 				(*Index)(unsafe.Pointer(p)).FpNext = (*Index)(unsafe.Pointer(pIndex)).FpNext
 113040 			}
 113041 		}
 113042 		Xsqlite3FreeIndex(tls, db, pIndex)
 113043 	}
 113044 	*(*U32)(unsafe.Pointer(db + 44)) |= U32(DBFLAG_SchemaChange)
 113045 }
 113046 
 113047 // Look through the list of open database files in db->aDb[] and if
 113048 // any have been closed, remove them from the list.  Reallocate the
 113049 // db->aDb[] structure to a smaller size, if possible.
 113050 //
 113051 // Entry 0 (the "main" database) and entry 1 (the "temp" database)
 113052 // are never candidates for being collapsed.
 113053 func Xsqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) {
 113054 	var i int32
 113055 	var j int32
 113056 	for i = libc.AssignInt32(&j, 2); i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
 113057 		var pDb uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32
 113058 		if (*Db1)(unsafe.Pointer(pDb)).FpBt == uintptr(0) {
 113059 			Xsqlite3DbFree(tls, db, (*Db1)(unsafe.Pointer(pDb)).FzDbSName)
 113060 			(*Db1)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0)
 113061 			continue
 113062 		}
 113063 		if j < i {
 113064 			*(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*32)) = *(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))
 113065 		}
 113066 		j++
 113067 	}
 113068 	(*Sqlite3)(unsafe.Pointer(db)).FnDb = j
 113069 	if (*Sqlite3)(unsafe.Pointer(db)).FnDb <= 2 && (*Sqlite3)(unsafe.Pointer(db)).FaDb != db+696 {
 113070 		libc.Xmemcpy(tls, db+696, (*Sqlite3)(unsafe.Pointer(db)).FaDb, uint64(2)*uint64(unsafe.Sizeof(Db{})))
 113071 		Xsqlite3DbFree(tls, db, (*Sqlite3)(unsafe.Pointer(db)).FaDb)
 113072 		(*Sqlite3)(unsafe.Pointer(db)).FaDb = db + 696
 113073 	}
 113074 }
 113075 
 113076 // Reset the schema for the database at index iDb.  Also reset the
 113077 // TEMP schema.  The reset is deferred if db->nSchemaLock is not zero.
 113078 // Deferred resets may be run by calling with iDb<0.
 113079 func Xsqlite3ResetOneSchema(tls *libc.TLS, db uintptr, iDb int32) {
 113080 	var i int32
 113081 
 113082 	if iDb >= 0 {
 113083 		*(*U16)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpSchema + 114)) |= U16(DB_ResetWanted)
 113084 		*(*U16)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema + 114)) |= U16(DB_ResetWanted)
 113085 		*(*U32)(unsafe.Pointer(db + 44)) &= libc.Uint32FromInt32(libc.CplInt32(DBFLAG_SchemaKnownOk))
 113086 	}
 113087 
 113088 	if (*Sqlite3)(unsafe.Pointer(db)).FnSchemaLock == U32(0) {
 113089 		for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
 113090 			if int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FpSchema)).FschemaFlags)&DB_ResetWanted == DB_ResetWanted {
 113091 				Xsqlite3SchemaClear(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FpSchema)
 113092 			}
 113093 		}
 113094 	}
 113095 }
 113096 
 113097 // Erase all schema information from all attached databases (including
 113098 // "main" and "temp") for a single database connection.
 113099 func Xsqlite3ResetAllSchemasOfConnection(tls *libc.TLS, db uintptr) {
 113100 	var i int32
 113101 	Xsqlite3BtreeEnterAll(tls, db)
 113102 	for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
 113103 		var pDb uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32
 113104 		if (*Db)(unsafe.Pointer(pDb)).FpSchema != 0 {
 113105 			if (*Sqlite3)(unsafe.Pointer(db)).FnSchemaLock == U32(0) {
 113106 				Xsqlite3SchemaClear(tls, (*Db)(unsafe.Pointer(pDb)).FpSchema)
 113107 			} else {
 113108 				*(*U16)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FpSchema + 114)) |= U16(DB_ResetWanted)
 113109 			}
 113110 		}
 113111 	}
 113112 	*(*U32)(unsafe.Pointer(db + 44)) &= libc.Uint32FromInt32(libc.CplInt32(DBFLAG_SchemaChange | DBFLAG_SchemaKnownOk))
 113113 	Xsqlite3VtabUnlockList(tls, db)
 113114 	Xsqlite3BtreeLeaveAll(tls, db)
 113115 	if (*Sqlite3)(unsafe.Pointer(db)).FnSchemaLock == U32(0) {
 113116 		Xsqlite3CollapseDatabaseArray(tls, db)
 113117 	}
 113118 }
 113119 
 113120 // This routine is called when a commit occurs.
 113121 func Xsqlite3CommitInternalChanges(tls *libc.TLS, db uintptr) {
 113122 	*(*U32)(unsafe.Pointer(db + 44)) &= libc.Uint32FromInt32(libc.CplInt32(DBFLAG_SchemaChange))
 113123 }
 113124 
 113125 // Set the expression associated with a column.  This is usually
 113126 // the DEFAULT value, but might also be the expression that computes
 113127 // the value for a generated column.
 113128 func Xsqlite3ColumnSetExpr(tls *libc.TLS, pParse uintptr, pTab uintptr, pCol uintptr, pExpr uintptr) {
 113129 	var pList uintptr
 113130 
 113131 	pList = *(*uintptr)(unsafe.Pointer(pTab + 64 + 16))
 113132 	if int32((*Column)(unsafe.Pointer(pCol)).FiDflt) == 0 ||
 113133 		pList == uintptr(0) ||
 113134 		(*ExprList)(unsafe.Pointer(pList)).FnExpr < int32((*Column)(unsafe.Pointer(pCol)).FiDflt) {
 113135 		(*Column)(unsafe.Pointer(pCol)).FiDflt = func() uint16 {
 113136 			if pList == uintptr(0) {
 113137 				return uint16(1)
 113138 			}
 113139 			return uint16((*ExprList)(unsafe.Pointer(pList)).FnExpr + 1)
 113140 		}()
 113141 		*(*uintptr)(unsafe.Pointer(pTab + 64 + 16)) = Xsqlite3ExprListAppend(tls, pParse, pList, pExpr)
 113142 	} else {
 113143 		Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(int32((*Column)(unsafe.Pointer(pCol)).FiDflt)-1)*32)).FpExpr)
 113144 		(*ExprList_item)(unsafe.Pointer(pList + 8 + uintptr(int32((*Column)(unsafe.Pointer(pCol)).FiDflt)-1)*32)).FpExpr = pExpr
 113145 	}
 113146 }
 113147 
 113148 // Return the expression associated with a column.  The expression might be
 113149 // the DEFAULT clause or the AS clause of a generated column.
 113150 // Return NULL if the column has no associated expression.
 113151 func Xsqlite3ColumnExpr(tls *libc.TLS, pTab uintptr, pCol uintptr) uintptr {
 113152 	if int32((*Column)(unsafe.Pointer(pCol)).FiDflt) == 0 {
 113153 		return uintptr(0)
 113154 	}
 113155 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM) {
 113156 		return uintptr(0)
 113157 	}
 113158 	if *(*uintptr)(unsafe.Pointer(pTab + 64 + 16)) == uintptr(0) {
 113159 		return uintptr(0)
 113160 	}
 113161 	if (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTab + 64 + 16)))).FnExpr < int32((*Column)(unsafe.Pointer(pCol)).FiDflt) {
 113162 		return uintptr(0)
 113163 	}
 113164 	return (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTab + 64 + 16)) + 8 + uintptr(int32((*Column)(unsafe.Pointer(pCol)).FiDflt)-1)*32)).FpExpr
 113165 }
 113166 
 113167 // Set the collating sequence name for a column.
 113168 func Xsqlite3ColumnSetColl(tls *libc.TLS, db uintptr, pCol uintptr, zColl uintptr) {
 113169 	var nColl I64
 113170 	var n I64
 113171 	var zNew uintptr
 113172 
 113173 	n = I64(Xsqlite3Strlen30(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName) + 1)
 113174 	if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_HASTYPE != 0 {
 113175 		n = n + I64(Xsqlite3Strlen30(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName+uintptr(n))+1)
 113176 	}
 113177 	nColl = I64(Xsqlite3Strlen30(tls, zColl) + 1)
 113178 	zNew = Xsqlite3DbRealloc(tls, db, (*Column)(unsafe.Pointer(pCol)).FzCnName, uint64(nColl+n))
 113179 	if zNew != 0 {
 113180 		(*Column)(unsafe.Pointer(pCol)).FzCnName = zNew
 113181 		libc.Xmemcpy(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName+uintptr(n), zColl, uint64(nColl))
 113182 		*(*U16)(unsafe.Pointer(pCol + 16)) |= U16(COLFLAG_HASCOLL)
 113183 	}
 113184 }
 113185 
 113186 // Return the collating squence name for a column
 113187 func Xsqlite3ColumnColl(tls *libc.TLS, pCol uintptr) uintptr {
 113188 	var z uintptr
 113189 	if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_HASCOLL == 0 {
 113190 		return uintptr(0)
 113191 	}
 113192 	z = (*Column)(unsafe.Pointer(pCol)).FzCnName
 113193 	for *(*int8)(unsafe.Pointer(z)) != 0 {
 113194 		z++
 113195 	}
 113196 	if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_HASTYPE != 0 {
 113197 		for __ccgo := true; __ccgo; __ccgo = *(*int8)(unsafe.Pointer(z)) != 0 {
 113198 			z++
 113199 		}
 113200 	}
 113201 	return z + uintptr(1)
 113202 }
 113203 
 113204 // Delete memory allocated for the column names of a table or view (the
 113205 // Table.aCol[] array).
 113206 func Xsqlite3DeleteColumnNames(tls *libc.TLS, db uintptr, pTable uintptr) {
 113207 	var i int32
 113208 	var pCol uintptr
 113209 
 113210 	if libc.AssignUintptr(&pCol, (*Table)(unsafe.Pointer(pTable)).FaCol) != uintptr(0) {
 113211 		i = 0
 113212 	__1:
 113213 		if !(i < int32((*Table)(unsafe.Pointer(pTable)).FnCol)) {
 113214 			goto __3
 113215 		}
 113216 		{
 113217 			Xsqlite3DbFree(tls, db, (*Column)(unsafe.Pointer(pCol)).FzCnName)
 113218 
 113219 		}
 113220 		goto __2
 113221 	__2:
 113222 		i++
 113223 		pCol += 24
 113224 		goto __1
 113225 		goto __3
 113226 	__3:
 113227 		;
 113228 		Xsqlite3DbNNFreeNN(tls, db, (*Table)(unsafe.Pointer(pTable)).FaCol)
 113229 		if int32((*Table)(unsafe.Pointer(pTable)).FeTabType) == TABTYP_NORM {
 113230 			Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(pTable + 64 + 16)))
 113231 		}
 113232 		if (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0) {
 113233 			(*Table)(unsafe.Pointer(pTable)).FaCol = uintptr(0)
 113234 			(*Table)(unsafe.Pointer(pTable)).FnCol = int16(0)
 113235 			if int32((*Table)(unsafe.Pointer(pTable)).FeTabType) == TABTYP_NORM {
 113236 				*(*uintptr)(unsafe.Pointer(pTable + 64 + 16)) = uintptr(0)
 113237 			}
 113238 		}
 113239 	}
 113240 }
 113241 
 113242 func deleteTable(tls *libc.TLS, db uintptr, pTable uintptr) {
 113243 	var pIndex uintptr
 113244 	var pNext uintptr
 113245 
 113246 	for pIndex = (*Table)(unsafe.Pointer(pTable)).FpIndex; pIndex != 0; pIndex = pNext {
 113247 		pNext = (*Index)(unsafe.Pointer(pIndex)).FpNext
 113248 
 113249 		if (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0) && !(int32((*Table)(unsafe.Pointer(pTable)).FeTabType) == TABTYP_VTAB) {
 113250 			var zName uintptr = (*Index)(unsafe.Pointer(pIndex)).FzName
 113251 			Xsqlite3HashInsert(tls,
 113252 				(*Index)(unsafe.Pointer(pIndex)).FpSchema+32, zName, uintptr(0))
 113253 
 113254 		}
 113255 		Xsqlite3FreeIndex(tls, db, pIndex)
 113256 	}
 113257 
 113258 	if int32((*Table)(unsafe.Pointer(pTable)).FeTabType) == TABTYP_NORM {
 113259 		Xsqlite3FkDelete(tls, db, pTable)
 113260 	} else if int32((*Table)(unsafe.Pointer(pTable)).FeTabType) == TABTYP_VTAB {
 113261 		Xsqlite3VtabClear(tls, db, pTable)
 113262 	} else {
 113263 		Xsqlite3SelectDelete(tls, db, *(*uintptr)(unsafe.Pointer(pTable + 64)))
 113264 	}
 113265 
 113266 	Xsqlite3DeleteColumnNames(tls, db, pTable)
 113267 	Xsqlite3DbFree(tls, db, (*Table)(unsafe.Pointer(pTable)).FzName)
 113268 	Xsqlite3DbFree(tls, db, (*Table)(unsafe.Pointer(pTable)).FzColAff)
 113269 	Xsqlite3ExprListDelete(tls, db, (*Table)(unsafe.Pointer(pTable)).FpCheck)
 113270 	Xsqlite3DbFree(tls, db, pTable)
 113271 
 113272 }
 113273 
 113274 func Xsqlite3DeleteTable(tls *libc.TLS, db uintptr, pTable uintptr) {
 113275 	if !(pTable != 0) {
 113276 		return
 113277 	}
 113278 	if (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0) && libc.PreDecUint32(&(*Table)(unsafe.Pointer(pTable)).FnTabRef, 1) > U32(0) {
 113279 		return
 113280 	}
 113281 	deleteTable(tls, db, pTable)
 113282 }
 113283 
 113284 // Unlink the given table from the hash tables and the delete the
 113285 // table structure with all its indices and foreign keys.
 113286 func Xsqlite3UnlinkAndDeleteTable(tls *libc.TLS, db uintptr, iDb int32, zTabName uintptr) {
 113287 	var p uintptr
 113288 	var pDb uintptr
 113289 
 113290 	pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32
 113291 	p = Xsqlite3HashInsert(tls, (*Db)(unsafe.Pointer(pDb)).FpSchema+8, zTabName, uintptr(0))
 113292 	Xsqlite3DeleteTable(tls, db, p)
 113293 	*(*U32)(unsafe.Pointer(db + 44)) |= U32(DBFLAG_SchemaChange)
 113294 }
 113295 
 113296 // Given a token, return a string that consists of the text of that
 113297 // token.  Space to hold the returned string
 113298 // is obtained from sqliteMalloc() and must be freed by the calling
 113299 // function.
 113300 //
 113301 // Any quotation marks (ex:  "name", 'name', [name], or `name`) that
 113302 // surround the body of the token are removed.
 113303 //
 113304 // Tokens are often just pointers into the original SQL text and so
 113305 // are not \000 terminated and are not persistent.  The returned string
 113306 // is \000 terminated and is persistent.
 113307 func Xsqlite3NameFromToken(tls *libc.TLS, db uintptr, pName uintptr) uintptr {
 113308 	var zName uintptr
 113309 	if pName != 0 {
 113310 		zName = Xsqlite3DbStrNDup(tls, db, (*Token)(unsafe.Pointer(pName)).Fz, uint64((*Token)(unsafe.Pointer(pName)).Fn))
 113311 		Xsqlite3Dequote(tls, zName)
 113312 	} else {
 113313 		zName = uintptr(0)
 113314 	}
 113315 	return zName
 113316 }
 113317 
 113318 // Open the sqlite_schema table stored in database number iDb for
 113319 // writing. The table is opened using cursor 0.
 113320 func Xsqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) {
 113321 	var v uintptr = Xsqlite3GetVdbe(tls, p)
 113322 	Xsqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), ts+7235)
 113323 	Xsqlite3VdbeAddOp4Int(tls, v, OP_OpenWrite, 0, SCHEMA_ROOT, iDb, 5)
 113324 	if (*Parse)(unsafe.Pointer(p)).FnTab == 0 {
 113325 		(*Parse)(unsafe.Pointer(p)).FnTab = 1
 113326 	}
 113327 }
 113328 
 113329 // Parameter zName points to a nul-terminated buffer containing the name
 113330 // of a database ("main", "temp" or the name of an attached db). This
 113331 // function returns the index of the named database in db->aDb[], or
 113332 // -1 if the named db cannot be found.
 113333 func Xsqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) int32 {
 113334 	var i int32 = -1
 113335 	if zName != 0 {
 113336 		var pDb uintptr
 113337 		i = (*Sqlite3)(unsafe.Pointer(db)).FnDb - 1
 113338 		pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32
 113339 	__1:
 113340 		if !(i >= 0) {
 113341 			goto __3
 113342 		}
 113343 		{
 113344 			if 0 == Xsqlite3_stricmp(tls, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zName) {
 113345 				goto __3
 113346 			}
 113347 
 113348 			if i == 0 && 0 == Xsqlite3_stricmp(tls, ts+7793, zName) {
 113349 				goto __3
 113350 			}
 113351 
 113352 		}
 113353 		goto __2
 113354 	__2:
 113355 		i--
 113356 		pDb -= 32
 113357 		goto __1
 113358 		goto __3
 113359 	__3:
 113360 	}
 113361 	return i
 113362 }
 113363 
 113364 // The token *pName contains the name of a database (either "main" or
 113365 // "temp" or the name of an attached db). This routine returns the
 113366 // index of the named database in db->aDb[], or -1 if the named db
 113367 // does not exist.
 113368 func Xsqlite3FindDb(tls *libc.TLS, db uintptr, pName uintptr) int32 {
 113369 	var i int32
 113370 	var zName uintptr
 113371 	zName = Xsqlite3NameFromToken(tls, db, pName)
 113372 	i = Xsqlite3FindDbName(tls, db, zName)
 113373 	Xsqlite3DbFree(tls, db, zName)
 113374 	return i
 113375 }
 113376 
 113377 // The table or view or trigger name is passed to this routine via tokens
 113378 // pName1 and pName2. If the table name was fully qualified, for example:
 113379 //
 113380 // CREATE TABLE xxx.yyy (...);
 113381 //
 113382 // Then pName1 is set to "xxx" and pName2 "yyy". On the other hand if
 113383 // the table name is not fully qualified, i.e.:
 113384 //
 113385 // CREATE TABLE yyy(...);
 113386 //
 113387 // Then pName1 is set to "yyy" and pName2 is "".
 113388 //
 113389 // This routine sets the *ppUnqual pointer to point at the token (pName1 or
 113390 // pName2) that stores the unqualified table name.  The index of the
 113391 // database "xxx" is returned.
 113392 func Xsqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pUnqual uintptr) int32 {
 113393 	bp := tls.Alloc(8)
 113394 	defer tls.Free(8)
 113395 
 113396 	var iDb int32
 113397 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 113398 
 113399 	if (*Token)(unsafe.Pointer(pName2)).Fn > uint32(0) {
 113400 		if (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 {
 113401 			Xsqlite3ErrorMsg(tls, pParse, ts+13502, 0)
 113402 			return -1
 113403 		}
 113404 		*(*uintptr)(unsafe.Pointer(pUnqual)) = pName2
 113405 		iDb = Xsqlite3FindDb(tls, db, pName1)
 113406 		if iDb < 0 {
 113407 			Xsqlite3ErrorMsg(tls, pParse, ts+13519, libc.VaList(bp, pName1))
 113408 			return -1
 113409 		}
 113410 	} else {
 113411 		iDb = int32((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb)
 113412 		*(*uintptr)(unsafe.Pointer(pUnqual)) = pName1
 113413 	}
 113414 	return iDb
 113415 }
 113416 
 113417 // True if PRAGMA writable_schema is ON
 113418 func Xsqlite3WritableSchema(tls *libc.TLS, db uintptr) int32 {
 113419 	return libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_WriteSchema|SQLITE_Defensive) == uint64(SQLITE_WriteSchema))
 113420 }
 113421 
 113422 // This routine is used to check if the UTF-8 string zName is a legal
 113423 // unqualified name for a new schema object (table, index, view or
 113424 // trigger). All names are legal except those that begin with the string
 113425 // "sqlite_" (in upper, lower or mixed case). This portion of the namespace
 113426 // is reserved for internal use.
 113427 //
 113428 // When parsing the sqlite_schema table, this routine also checks to
 113429 // make sure the "type", "name", and "tbl_name" columns are consistent
 113430 // with the SQL.
 113431 func Xsqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType uintptr, zTblName uintptr) int32 {
 113432 	bp := tls.Alloc(8)
 113433 	defer tls.Free(8)
 113434 
 113435 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 113436 	if Xsqlite3WritableSchema(tls, db) != 0 ||
 113437 		uint32(int32(*(*uint8)(unsafe.Pointer(db + 192 + 8))&0x2>>1)) != 0 ||
 113438 		!(int32(Xsqlite3Config.FbExtraSchemaChecks) != 0) {
 113439 		return SQLITE_OK
 113440 	}
 113441 	if (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 {
 113442 		if Xsqlite3_stricmp(tls, zType, *(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).Finit.FazInit))) != 0 ||
 113443 			Xsqlite3_stricmp(tls, zName, *(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).Finit.FazInit + 1*8))) != 0 ||
 113444 			Xsqlite3_stricmp(tls, zTblName, *(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).Finit.FazInit + 2*8))) != 0 {
 113445 			Xsqlite3ErrorMsg(tls, pParse, ts+1544, 0)
 113446 			return SQLITE_ERROR
 113447 		}
 113448 	} else {
 113449 		if int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, ts+7733, 7) ||
 113450 			Xsqlite3ReadOnlyShadowTables(tls, db) != 0 && Xsqlite3ShadowTableName(tls, db, zName) != 0 {
 113451 			Xsqlite3ErrorMsg(tls, pParse, ts+13539,
 113452 				libc.VaList(bp, zName))
 113453 			return SQLITE_ERROR
 113454 		}
 113455 
 113456 	}
 113457 	return SQLITE_OK
 113458 }
 113459 
 113460 // Return the PRIMARY KEY index of a table
 113461 func Xsqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) uintptr {
 113462 	var p uintptr
 113463 	for p = (*Table)(unsafe.Pointer(pTab)).FpIndex; p != 0 && !(int32(*(*uint16)(unsafe.Pointer(p + 100))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY); p = (*Index)(unsafe.Pointer(p)).FpNext {
 113464 	}
 113465 	return p
 113466 }
 113467 
 113468 // Convert an table column number into a index column number.  That is,
 113469 // for the column iCol in the table (as defined by the CREATE TABLE statement)
 113470 // find the (first) offset of that column in index pIdx.  Or return -1
 113471 // if column iCol is not used in index pIdx.
 113472 func Xsqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol I16) I16 {
 113473 	var i int32
 113474 	for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnColumn); i++ {
 113475 		if int32(iCol) == int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) {
 113476 			return I16(i)
 113477 		}
 113478 	}
 113479 	return int16(-1)
 113480 }
 113481 
 113482 // Convert a storage column number into a table column number.
 113483 //
 113484 // The storage column number (0,1,2,....) is the index of the value
 113485 // as it appears in the record on disk.  The true column number
 113486 // is the index (0,1,2,...) of the column in the CREATE TABLE statement.
 113487 //
 113488 // The storage column number is less than the table column number if
 113489 // and only there are VIRTUAL columns to the left.
 113490 //
 113491 // If SQLITE_OMIT_GENERATED_COLUMNS, this routine is a no-op macro.
 113492 func Xsqlite3StorageColumnToTable(tls *libc.TLS, pTab uintptr, iCol I16) I16 {
 113493 	if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasVirtual) != 0 {
 113494 		var i int32
 113495 		for i = 0; i <= int32(iCol); i++ {
 113496 			if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24)).FcolFlags)&COLFLAG_VIRTUAL != 0 {
 113497 				iCol++
 113498 			}
 113499 		}
 113500 	}
 113501 	return iCol
 113502 }
 113503 
 113504 // Convert a table column number into a storage column number.
 113505 //
 113506 // The storage column number (0,1,2,....) is the index of the value
 113507 // as it appears in the record on disk.  Or, if the input column is
 113508 // the N-th virtual column (zero-based) then the storage number is
 113509 // the number of non-virtual columns in the table plus N.
 113510 //
 113511 // The true column number is the index (0,1,2,...) of the column in
 113512 // the CREATE TABLE statement.
 113513 //
 113514 // If the input column is a VIRTUAL column, then it should not appear
 113515 // in storage.  But the value sometimes is cached in registers that
 113516 // follow the range of registers used to construct storage.  This
 113517 // avoids computing the same VIRTUAL column multiple times, and provides
 113518 // values for use by OP_Param opcodes in triggers.  Hence, if the
 113519 // input column is a VIRTUAL table, put it after all the other columns.
 113520 //
 113521 // In the following, N means "normal column", S means STORED, and
 113522 // V means VIRTUAL.  Suppose the CREATE TABLE has columns like this:
 113523 //
 113524 //	CREATE TABLE ex(N,S,V,N,S,V,N,S,V);
 113525 //	             -- 0 1 2 3 4 5 6 7 8
 113526 //
 113527 // Then the mapping from this function is as follows:
 113528 //
 113529 //	INPUTS:     0 1 2 3 4 5 6 7 8
 113530 //	OUTPUTS:    0 1 6 2 3 7 4 5 8
 113531 //
 113532 // So, in other words, this routine shifts all the virtual columns to
 113533 // the end.
 113534 //
 113535 // If SQLITE_OMIT_GENERATED_COLUMNS then there are no virtual columns and
 113536 // this routine is a no-op macro.  If the pTab does not have any virtual
 113537 // columns, then this routine is no-op that always return iCol.  If iCol
 113538 // is negative (indicating the ROWID column) then this routine return iCol.
 113539 func Xsqlite3TableColumnToStorage(tls *libc.TLS, pTab uintptr, iCol I16) I16 {
 113540 	var i int32
 113541 	var n I16
 113542 
 113543 	if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasVirtual) == U32(0) || int32(iCol) < 0 {
 113544 		return iCol
 113545 	}
 113546 	i = 0
 113547 	n = int16(0)
 113548 	for ; i < int32(iCol); i++ {
 113549 		if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24)).FcolFlags)&COLFLAG_VIRTUAL == 0 {
 113550 			n++
 113551 		}
 113552 	}
 113553 	if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24)).FcolFlags)&COLFLAG_VIRTUAL != 0 {
 113554 		return I16(int32((*Table)(unsafe.Pointer(pTab)).FnNVCol) + i - int32(n))
 113555 	} else {
 113556 		return n
 113557 	}
 113558 	return I16(0)
 113559 }
 113560 
 113561 func sqlite3ForceNotReadOnly(tls *libc.TLS, pParse uintptr) {
 113562 	var iReg int32 = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 113563 	var v uintptr = Xsqlite3GetVdbe(tls, pParse)
 113564 	if v != 0 {
 113565 		Xsqlite3VdbeAddOp3(tls, v, OP_JournalMode, 0, iReg, -1)
 113566 		Xsqlite3VdbeUsesBtree(tls, v, 0)
 113567 	}
 113568 }
 113569 
 113570 // Begin constructing a new table representation in memory.  This is
 113571 // the first of several action routines that get called in response
 113572 // to a CREATE TABLE statement.  In particular, this routine is called
 113573 // after seeing tokens "CREATE" and "TABLE" and the table name. The isTemp
 113574 // flag is true if the table should be stored in the auxiliary database
 113575 // file instead of in the main database file.  This is normally the case
 113576 // when the "TEMP" or "TEMPORARY" keyword occurs in between
 113577 // CREATE and TABLE.
 113578 //
 113579 // The new table record is initialized and put in pParse->pNewTable.
 113580 // As more of the CREATE TABLE statement is parsed, additional action
 113581 // routines will be called to add more information to this record.
 113582 // At the end of the CREATE TABLE statement, the sqlite3EndTable() routine
 113583 // is called to complete the construction of the new table record.
 113584 func Xsqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, isTemp int32, isView int32, isVirtual int32, noErr int32) {
 113585 	bp := tls.Alloc(32)
 113586 	defer tls.Free(32)
 113587 
 113588 	var pTable uintptr
 113589 	var zName uintptr
 113590 	var db uintptr
 113591 	var v uintptr
 113592 	var iDb int32
 113593 
 113594 	var zDb uintptr
 113595 	var zDb1 uintptr
 113596 	var addr1 int32
 113597 	var fileFormat int32
 113598 	var reg1 int32
 113599 	var reg2 int32
 113600 	var reg3 int32
 113601 	zName = uintptr(0)
 113602 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 113603 
 113604 	if !((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 && (*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum == Pgno(1)) {
 113605 		goto __1
 113606 	}
 113607 
 113608 	iDb = int32((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb)
 113609 	zName = Xsqlite3DbStrDup(tls, db, func() uintptr {
 113610 		if !(0 != 0) && iDb == 1 {
 113611 			return ts + 7741
 113612 		}
 113613 		return ts + 7235
 113614 	}())
 113615 	*(*uintptr)(unsafe.Pointer(bp + 24)) = pName1
 113616 	goto __2
 113617 __1:
 113618 	iDb = Xsqlite3TwoPartName(tls, pParse, pName1, pName2, bp+24)
 113619 	if !(iDb < 0) {
 113620 		goto __3
 113621 	}
 113622 	return
 113623 __3:
 113624 	;
 113625 	if !(!(0 != 0) && isTemp != 0 && (*Token)(unsafe.Pointer(pName2)).Fn > uint32(0) && iDb != 1) {
 113626 		goto __4
 113627 	}
 113628 
 113629 	Xsqlite3ErrorMsg(tls, pParse, ts+13581, 0)
 113630 	return
 113631 __4:
 113632 	;
 113633 	if !(!(0 != 0) && isTemp != 0) {
 113634 		goto __5
 113635 	}
 113636 	iDb = 1
 113637 __5:
 113638 	;
 113639 	zName = Xsqlite3NameFromToken(tls, db, *(*uintptr)(unsafe.Pointer(bp + 24)))
 113640 	if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 113641 		goto __6
 113642 	}
 113643 	Xsqlite3RenameTokenMap(tls, pParse, zName, *(*uintptr)(unsafe.Pointer(bp + 24)))
 113644 __6:
 113645 	;
 113646 __2:
 113647 	;
 113648 	(*Parse)(unsafe.Pointer(pParse)).FsNameToken = *(*Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24))))
 113649 	if !(zName == uintptr(0)) {
 113650 		goto __7
 113651 	}
 113652 	return
 113653 __7:
 113654 	;
 113655 	if !(Xsqlite3CheckObjectName(tls, pParse, zName, func() uintptr {
 113656 		if isView != 0 {
 113657 			return ts + 11843
 113658 		}
 113659 		return ts + 10228
 113660 	}(), zName) != 0) {
 113661 		goto __8
 113662 	}
 113663 	goto begin_table_error
 113664 __8:
 113665 	;
 113666 	if !(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb) == 1) {
 113667 		goto __9
 113668 	}
 113669 	isTemp = 1
 113670 __9:
 113671 	;
 113672 	zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
 113673 	if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_INSERT, func() uintptr {
 113674 		if !(0 != 0) && isTemp == 1 {
 113675 			return ts + 7741
 113676 		}
 113677 		return ts + 7235
 113678 	}(), uintptr(0), zDb) != 0) {
 113679 		goto __10
 113680 	}
 113681 	goto begin_table_error
 113682 __10:
 113683 	;
 113684 	if !(!(isVirtual != 0) && Xsqlite3AuthCheck(tls, pParse, int32(aCode[isTemp+2*isView]),
 113685 		zName, uintptr(0), zDb) != 0) {
 113686 		goto __11
 113687 	}
 113688 	goto begin_table_error
 113689 __11:
 113690 	;
 113691 	if !!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL) {
 113692 		goto __12
 113693 	}
 113694 	zDb1 = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
 113695 	if !(SQLITE_OK != Xsqlite3ReadSchema(tls, pParse)) {
 113696 		goto __13
 113697 	}
 113698 	goto begin_table_error
 113699 __13:
 113700 	;
 113701 	pTable = Xsqlite3FindTable(tls, db, zName, zDb1)
 113702 	if !(pTable != 0) {
 113703 		goto __14
 113704 	}
 113705 	if !!(noErr != 0) {
 113706 		goto __15
 113707 	}
 113708 	Xsqlite3ErrorMsg(tls, pParse, ts+13622,
 113709 		libc.VaList(bp, func() uintptr {
 113710 			if int32((*Table)(unsafe.Pointer(pTable)).FeTabType) == TABTYP_VIEW {
 113711 				return ts + 11843
 113712 			}
 113713 			return ts + 10228
 113714 		}(), *(*uintptr)(unsafe.Pointer(bp + 24))))
 113715 	goto __16
 113716 __15:
 113717 	;
 113718 	Xsqlite3CodeVerifySchema(tls, pParse, iDb)
 113719 	sqlite3ForceNotReadOnly(tls, pParse)
 113720 __16:
 113721 	;
 113722 	goto begin_table_error
 113723 __14:
 113724 	;
 113725 	if !(Xsqlite3FindIndex(tls, db, zName, zDb1) != uintptr(0)) {
 113726 		goto __17
 113727 	}
 113728 	Xsqlite3ErrorMsg(tls, pParse, ts+13643, libc.VaList(bp+16, zName))
 113729 	goto begin_table_error
 113730 __17:
 113731 	;
 113732 __12:
 113733 	;
 113734 	pTable = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Table{})))
 113735 	if !(pTable == uintptr(0)) {
 113736 		goto __18
 113737 	}
 113738 
 113739 	(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_NOMEM
 113740 	(*Parse)(unsafe.Pointer(pParse)).FnErr++
 113741 	goto begin_table_error
 113742 __18:
 113743 	;
 113744 	(*Table)(unsafe.Pointer(pTable)).FzName = zName
 113745 	(*Table)(unsafe.Pointer(pTable)).FiPKey = int16(-1)
 113746 	(*Table)(unsafe.Pointer(pTable)).FpSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpSchema
 113747 	(*Table)(unsafe.Pointer(pTable)).FnTabRef = U32(1)
 113748 	(*Table)(unsafe.Pointer(pTable)).FnRowLogEst = int16(200)
 113749 
 113750 	(*Parse)(unsafe.Pointer(pParse)).FpNewTable = pTable
 113751 
 113752 	if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0) && libc.AssignUintptr(&v, Xsqlite3GetVdbe(tls, pParse)) != uintptr(0)) {
 113753 		goto __19
 113754 	}
 113755 	Xsqlite3BeginWriteOperation(tls, pParse, 1, iDb)
 113756 
 113757 	if !(isVirtual != 0) {
 113758 		goto __20
 113759 	}
 113760 	Xsqlite3VdbeAddOp0(tls, v, OP_VBegin)
 113761 __20:
 113762 	;
 113763 	reg1 = libc.AssignPtrInt32(pParse+128, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
 113764 	reg2 = libc.AssignPtrInt32(pParse+132, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
 113765 	reg3 = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 113766 	Xsqlite3VdbeAddOp3(tls, v, OP_ReadCookie, iDb, reg3, BTREE_FILE_FORMAT)
 113767 	Xsqlite3VdbeUsesBtree(tls, v, iDb)
 113768 	addr1 = Xsqlite3VdbeAddOp1(tls, v, OP_If, reg3)
 113769 	if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_LegacyFileFmt) != uint64(0) {
 113770 		fileFormat = 1
 113771 	} else {
 113772 		fileFormat = SQLITE_MAX_FILE_FORMAT
 113773 	}
 113774 	Xsqlite3VdbeAddOp3(tls, v, OP_SetCookie, iDb, BTREE_FILE_FORMAT, fileFormat)
 113775 	Xsqlite3VdbeAddOp3(tls, v, OP_SetCookie, iDb, BTREE_TEXT_ENCODING, int32((*Sqlite3)(unsafe.Pointer(db)).Fenc))
 113776 	Xsqlite3VdbeJumpHere(tls, v, addr1)
 113777 
 113778 	if !(isView != 0 || isVirtual != 0) {
 113779 		goto __21
 113780 	}
 113781 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, reg2)
 113782 	goto __22
 113783 __21:
 113784 	;
 113785 	*(*int32)(unsafe.Pointer(pParse + 200)) = Xsqlite3VdbeAddOp3(tls, v, OP_CreateBtree, iDb, reg2, BTREE_INTKEY)
 113786 __22:
 113787 	;
 113788 	Xsqlite3OpenSchemaTable(tls, pParse, iDb)
 113789 	Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, 0, reg1)
 113790 	Xsqlite3VdbeAddOp4(tls, v, OP_Blob, 6, reg3, 0, uintptr(unsafe.Pointer(&nullRow)), -1)
 113791 	Xsqlite3VdbeAddOp3(tls, v, OP_Insert, 0, reg3, reg1)
 113792 	Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND))
 113793 	Xsqlite3VdbeAddOp0(tls, v, OP_Close)
 113794 __19:
 113795 	;
 113796 	return
 113797 
 113798 begin_table_error:
 113799 	(*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1)
 113800 	Xsqlite3DbFree(tls, db, zName)
 113801 	return
 113802 }
 113803 
 113804 var aCode = [4]U8{
 113805 	U8(SQLITE_CREATE_TABLE),
 113806 	U8(SQLITE_CREATE_TEMP_TABLE),
 113807 	U8(SQLITE_CREATE_VIEW),
 113808 	U8(SQLITE_CREATE_TEMP_VIEW),
 113809 }
 113810 var nullRow = [6]int8{int8(6), int8(0), int8(0), int8(0), int8(0), int8(0)}
 113811 
 113812 func sqlite3DeleteReturning(tls *libc.TLS, db uintptr, pRet uintptr) {
 113813 	var pHash uintptr
 113814 	pHash = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema + 56
 113815 	Xsqlite3HashInsert(tls, pHash, ts+13678, uintptr(0))
 113816 	Xsqlite3ExprListDelete(tls, db, (*Returning)(unsafe.Pointer(pRet)).FpReturnEL)
 113817 	Xsqlite3DbFree(tls, db, pRet)
 113818 }
 113819 
 113820 // Add the RETURNING clause to the parse currently underway.
 113821 //
 113822 // This routine creates a special TEMP trigger that will fire for each row
 113823 // of the DML statement.  That TEMP trigger contains a single SELECT
 113824 // statement with a result set that is the argument of the RETURNING clause.
 113825 // The trigger has the Trigger.bReturning flag and an opcode of
 113826 // TK_RETURNING instead of TK_SELECT, so that the trigger code generator
 113827 // knows to handle it specially.  The TEMP trigger is automatically
 113828 // removed at the end of the parse.
 113829 //
 113830 // When this routine is called, we do not yet know if the RETURNING clause
 113831 // is attached to a DELETE, INSERT, or UPDATE, so construct it as a
 113832 // RETURNING trigger instead.  It will then be converted into the appropriate
 113833 // type on the first call to sqlite3TriggersExist().
 113834 func Xsqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) {
 113835 	var pRet uintptr
 113836 	var pHash uintptr
 113837 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 113838 	if (*Parse)(unsafe.Pointer(pParse)).FpNewTrigger != 0 {
 113839 		Xsqlite3ErrorMsg(tls, pParse, ts+13695, 0)
 113840 	} else {
 113841 	}
 113842 	(*Parse)(unsafe.Pointer(pParse)).FbReturning = U8(1)
 113843 	pRet = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Returning{})))
 113844 	if pRet == uintptr(0) {
 113845 		Xsqlite3ExprListDelete(tls, db, pList)
 113846 		return
 113847 	}
 113848 	*(*uintptr)(unsafe.Pointer(pParse + 200)) = pRet
 113849 	(*Returning)(unsafe.Pointer(pRet)).FpParse = pParse
 113850 	(*Returning)(unsafe.Pointer(pRet)).FpReturnEL = pList
 113851 	Xsqlite3ParserAddCleanup(tls, pParse,
 113852 		*(*uintptr)(unsafe.Pointer(&struct {
 113853 			f func(*libc.TLS, uintptr, uintptr)
 113854 		}{sqlite3DeleteReturning})), pRet)
 113855 
 113856 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 113857 		return
 113858 	}
 113859 	(*Returning)(unsafe.Pointer(pRet)).FretTrig.FzName = ts + 13678
 113860 	(*Returning)(unsafe.Pointer(pRet)).FretTrig.Fop = U8(TK_RETURNING)
 113861 	(*Returning)(unsafe.Pointer(pRet)).FretTrig.Ftr_tm = U8(TRIGGER_AFTER)
 113862 	(*Returning)(unsafe.Pointer(pRet)).FretTrig.FbReturning = U8(1)
 113863 	(*Returning)(unsafe.Pointer(pRet)).FretTrig.FpSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).FpSchema
 113864 	(*Returning)(unsafe.Pointer(pRet)).FretTrig.FpTabSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).FpSchema
 113865 	(*Returning)(unsafe.Pointer(pRet)).FretTrig.Fstep_list = pRet + 88
 113866 	(*Returning)(unsafe.Pointer(pRet)).FretTStep.Fop = U8(TK_RETURNING)
 113867 	(*Returning)(unsafe.Pointer(pRet)).FretTStep.FpTrig = pRet + 16
 113868 	(*Returning)(unsafe.Pointer(pRet)).FretTStep.FpExprList = pList
 113869 	pHash = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema + 56
 113870 
 113871 	if Xsqlite3HashInsert(tls, pHash, ts+13678, pRet+16) ==
 113872 		pRet+16 {
 113873 		Xsqlite3OomFault(tls, db)
 113874 	}
 113875 }
 113876 
 113877 // Add a new column to the table currently being constructed.
 113878 //
 113879 // The parser calls this routine once for each column declaration
 113880 // in a CREATE TABLE statement.  sqlite3StartTable() gets called
 113881 // first to get things going.  Then this routine is called for each
 113882 // column.
 113883 func Xsqlite3AddColumn(tls *libc.TLS, pParse uintptr, sName Token, sType Token) {
 113884 	bp := tls.Alloc(48)
 113885 	defer tls.Free(48)
 113886 	*(*Token)(unsafe.Pointer(bp + 16)) = sName
 113887 	*(*Token)(unsafe.Pointer(bp + 32)) = sType
 113888 
 113889 	var p uintptr
 113890 	var i int32
 113891 	var z uintptr
 113892 	var zType uintptr
 113893 	var pCol uintptr
 113894 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 113895 	var hName U8
 113896 	var aNew uintptr
 113897 	var eType U8 = U8(COLTYPE_CUSTOM)
 113898 	var szEst U8 = U8(1)
 113899 	var affinity int8 = int8(SQLITE_AFF_BLOB)
 113900 
 113901 	if libc.AssignUintptr(&p, (*Parse)(unsafe.Pointer(pParse)).FpNewTable) == uintptr(0) {
 113902 		return
 113903 	}
 113904 	if int32((*Table)(unsafe.Pointer(p)).FnCol)+1 > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) {
 113905 		Xsqlite3ErrorMsg(tls, pParse, ts+13729, libc.VaList(bp, (*Table)(unsafe.Pointer(p)).FzName))
 113906 		return
 113907 	}
 113908 	if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 113909 		Xsqlite3DequoteToken(tls, bp+16)
 113910 	}
 113911 
 113912 	if (*Token)(unsafe.Pointer(bp+32)).Fn >= uint32(16) &&
 113913 		Xsqlite3_strnicmp(tls, (*Token)(unsafe.Pointer(bp+32)).Fz+uintptr((*Token)(unsafe.Pointer(bp+32)).Fn-uint32(6)), ts+13752, 6) == 0 {
 113914 		*(*uint32)(unsafe.Pointer(bp + 32 + 8)) -= uint32(6)
 113915 		for (*Token)(unsafe.Pointer(bp+32)).Fn > uint32(0) && int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(bp+32)).Fz + uintptr((*Token)(unsafe.Pointer(bp+32)).Fn-uint32(1)))))])&0x01 != 0 {
 113916 			(*Token)(unsafe.Pointer(bp+32)).Fn--
 113917 		}
 113918 		if (*Token)(unsafe.Pointer(bp+32)).Fn >= uint32(9) &&
 113919 			Xsqlite3_strnicmp(tls, (*Token)(unsafe.Pointer(bp+32)).Fz+uintptr((*Token)(unsafe.Pointer(bp+32)).Fn-uint32(9)), ts+13759, 9) == 0 {
 113920 			*(*uint32)(unsafe.Pointer(bp + 32 + 8)) -= uint32(9)
 113921 			for (*Token)(unsafe.Pointer(bp+32)).Fn > uint32(0) && int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(bp+32)).Fz + uintptr((*Token)(unsafe.Pointer(bp+32)).Fn-uint32(1)))))])&0x01 != 0 {
 113922 				(*Token)(unsafe.Pointer(bp+32)).Fn--
 113923 			}
 113924 		}
 113925 	}
 113926 
 113927 	if (*Token)(unsafe.Pointer(bp+32)).Fn >= uint32(3) {
 113928 		Xsqlite3DequoteToken(tls, bp+32)
 113929 		for i = 0; i < SQLITE_N_STDTYPE; i++ {
 113930 			if (*Token)(unsafe.Pointer(bp+32)).Fn == uint32(Xsqlite3StdTypeLen[i]) &&
 113931 				Xsqlite3_strnicmp(tls, (*Token)(unsafe.Pointer(bp+32)).Fz, Xsqlite3StdType[i], int32((*Token)(unsafe.Pointer(bp+32)).Fn)) == 0 {
 113932 				(*Token)(unsafe.Pointer(bp + 32)).Fn = uint32(0)
 113933 				eType = U8(i + 1)
 113934 				affinity = Xsqlite3StdTypeAffinity[i]
 113935 				if int32(affinity) <= SQLITE_AFF_TEXT {
 113936 					szEst = U8(5)
 113937 				}
 113938 				break
 113939 			}
 113940 		}
 113941 	}
 113942 
 113943 	z = Xsqlite3DbMallocRaw(tls, db, uint64(I64((*Token)(unsafe.Pointer(bp+16)).Fn)+int64(1)+I64((*Token)(unsafe.Pointer(bp+32)).Fn)+I64(libc.Bool32((*Token)(unsafe.Pointer(bp+32)).Fn > uint32(0)))))
 113944 	if z == uintptr(0) {
 113945 		return
 113946 	}
 113947 	if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
 113948 		Xsqlite3RenameTokenMap(tls, pParse, z, bp+16)
 113949 	}
 113950 	libc.Xmemcpy(tls, z, (*Token)(unsafe.Pointer(bp+16)).Fz, uint64((*Token)(unsafe.Pointer(bp+16)).Fn))
 113951 	*(*int8)(unsafe.Pointer(z + uintptr((*Token)(unsafe.Pointer(bp+16)).Fn))) = int8(0)
 113952 	Xsqlite3Dequote(tls, z)
 113953 	hName = Xsqlite3StrIHash(tls, z)
 113954 	for i = 0; i < int32((*Table)(unsafe.Pointer(p)).FnCol); i++ {
 113955 		if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(i)*24)).FhName) == int32(hName) && Xsqlite3StrICmp(tls, z, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(i)*24)).FzCnName) == 0 {
 113956 			Xsqlite3ErrorMsg(tls, pParse, ts+13769, libc.VaList(bp+8, z))
 113957 			Xsqlite3DbFree(tls, db, z)
 113958 			return
 113959 		}
 113960 	}
 113961 	aNew = Xsqlite3DbRealloc(tls, db, (*Table)(unsafe.Pointer(p)).FaCol, uint64(I64((*Table)(unsafe.Pointer(p)).FnCol)+int64(1))*uint64(unsafe.Sizeof(Column{})))
 113962 	if aNew == uintptr(0) {
 113963 		Xsqlite3DbFree(tls, db, z)
 113964 		return
 113965 	}
 113966 	(*Table)(unsafe.Pointer(p)).FaCol = aNew
 113967 	pCol = (*Table)(unsafe.Pointer(p)).FaCol + uintptr((*Table)(unsafe.Pointer(p)).FnCol)*24
 113968 	libc.Xmemset(tls, pCol, 0, uint64(unsafe.Sizeof(Column{})))
 113969 	(*Column)(unsafe.Pointer(pCol)).FzCnName = z
 113970 	(*Column)(unsafe.Pointer(pCol)).FhName = hName
 113971 
 113972 	if (*Token)(unsafe.Pointer(bp+32)).Fn == uint32(0) {
 113973 		(*Column)(unsafe.Pointer(pCol)).Faffinity = affinity
 113974 		libc.SetBitFieldPtr8Uint32(pCol+8, uint32(eType), 4, 0xf0)
 113975 		(*Column)(unsafe.Pointer(pCol)).FszEst = szEst
 113976 	} else {
 113977 		zType = z + uintptr(Xsqlite3Strlen30(tls, z)) + uintptr(1)
 113978 		libc.Xmemcpy(tls, zType, (*Token)(unsafe.Pointer(bp+32)).Fz, uint64((*Token)(unsafe.Pointer(bp+32)).Fn))
 113979 		*(*int8)(unsafe.Pointer(zType + uintptr((*Token)(unsafe.Pointer(bp+32)).Fn))) = int8(0)
 113980 		Xsqlite3Dequote(tls, zType)
 113981 		(*Column)(unsafe.Pointer(pCol)).Faffinity = Xsqlite3AffinityType(tls, zType, pCol)
 113982 		*(*U16)(unsafe.Pointer(pCol + 16)) |= U16(COLFLAG_HASTYPE)
 113983 	}
 113984 	(*Table)(unsafe.Pointer(p)).FnCol++
 113985 	(*Table)(unsafe.Pointer(p)).FnNVCol++
 113986 	(*Parse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0)
 113987 }
 113988 
 113989 // This routine is called by the parser while in the middle of
 113990 // parsing a CREATE TABLE statement.  A "NOT NULL" constraint has
 113991 // been seen on a column.  This routine sets the notNull flag on
 113992 // the column currently under construction.
 113993 func Xsqlite3AddNotNull(tls *libc.TLS, pParse uintptr, onError int32) {
 113994 	var p uintptr
 113995 	var pCol uintptr
 113996 	p = (*Parse)(unsafe.Pointer(pParse)).FpNewTable
 113997 	if p == uintptr(0) || int32((*Table)(unsafe.Pointer(p)).FnCol) < 1 {
 113998 		return
 113999 	}
 114000 	pCol = (*Table)(unsafe.Pointer(p)).FaCol + uintptr(int32((*Table)(unsafe.Pointer(p)).FnCol)-1)*24
 114001 	libc.SetBitFieldPtr8Uint32(pCol+8, uint32(U8(onError)), 0, 0xf)
 114002 	*(*U32)(unsafe.Pointer(p + 48)) |= U32(TF_HasNotNull)
 114003 
 114004 	if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_UNIQUE != 0 {
 114005 		var pIdx uintptr
 114006 		for pIdx = (*Table)(unsafe.Pointer(p)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
 114007 			if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn))) == int32((*Table)(unsafe.Pointer(p)).FnCol)-1 {
 114008 				libc.SetBitFieldPtr16Uint32(pIdx+100, uint32(1), 3, 0x8)
 114009 			}
 114010 		}
 114011 	}
 114012 }
 114013 
 114014 // Scan the column type name zType (length nType) and return the
 114015 // associated affinity type.
 114016 //
 114017 // This routine does a case-independent search of zType for the
 114018 // substrings in the following table. If one of the substrings is
 114019 // found, the corresponding affinity is returned. If zType contains
 114020 // more than one of the substrings, entries toward the top of
 114021 // the table take priority. For example, if zType is 'BLOBINT',
 114022 // SQLITE_AFF_INTEGER is returned.
 114023 //
 114024 // Substring     | Affinity
 114025 // --------------------------------
 114026 // 'INT'         | SQLITE_AFF_INTEGER
 114027 // 'CHAR'        | SQLITE_AFF_TEXT
 114028 // 'CLOB'        | SQLITE_AFF_TEXT
 114029 // 'TEXT'        | SQLITE_AFF_TEXT
 114030 // 'BLOB'        | SQLITE_AFF_BLOB
 114031 // 'REAL'        | SQLITE_AFF_REAL
 114032 // 'FLOA'        | SQLITE_AFF_REAL
 114033 // 'DOUB'        | SQLITE_AFF_REAL
 114034 //
 114035 // If none of the substrings in the above table are found,
 114036 // SQLITE_AFF_NUMERIC is returned.
 114037 func Xsqlite3AffinityType(tls *libc.TLS, zIn uintptr, pCol uintptr) int8 {
 114038 	bp := tls.Alloc(4)
 114039 	defer tls.Free(4)
 114040 
 114041 	var h U32 = U32(0)
 114042 	var aff int8 = int8(SQLITE_AFF_NUMERIC)
 114043 	var zChar uintptr = uintptr(0)
 114044 
 114045 	for *(*int8)(unsafe.Pointer(zIn)) != 0 {
 114046 		h = h<<8 + U32(Xsqlite3UpperToLower[int32(*(*int8)(unsafe.Pointer(zIn)))&0xff])
 114047 		zIn++
 114048 		if h == U32(int32('c')<<24+int32('h')<<16+int32('a')<<8+'r') {
 114049 			aff = int8(SQLITE_AFF_TEXT)
 114050 			zChar = zIn
 114051 		} else if h == U32(int32('c')<<24+int32('l')<<16+int32('o')<<8+'b') {
 114052 			aff = int8(SQLITE_AFF_TEXT)
 114053 		} else if h == U32(int32('t')<<24+int32('e')<<16+int32('x')<<8+'t') {
 114054 			aff = int8(SQLITE_AFF_TEXT)
 114055 		} else if h == U32(int32('b')<<24+int32('l')<<16+int32('o')<<8+'b') &&
 114056 			(int32(aff) == SQLITE_AFF_NUMERIC || int32(aff) == SQLITE_AFF_REAL) {
 114057 			aff = int8(SQLITE_AFF_BLOB)
 114058 			if int32(*(*int8)(unsafe.Pointer(zIn))) == '(' {
 114059 				zChar = zIn
 114060 			}
 114061 		} else if h == U32(int32('r')<<24+int32('e')<<16+int32('a')<<8+'l') &&
 114062 			int32(aff) == SQLITE_AFF_NUMERIC {
 114063 			aff = int8(SQLITE_AFF_REAL)
 114064 		} else if h == U32(int32('f')<<24+int32('l')<<16+int32('o')<<8+'a') &&
 114065 			int32(aff) == SQLITE_AFF_NUMERIC {
 114066 			aff = int8(SQLITE_AFF_REAL)
 114067 		} else if h == U32(int32('d')<<24+int32('o')<<16+int32('u')<<8+'b') &&
 114068 			int32(aff) == SQLITE_AFF_NUMERIC {
 114069 			aff = int8(SQLITE_AFF_REAL)
 114070 		} else if h&U32(0x00FFFFFF) == U32(int32('i')<<16+int32('n')<<8+'t') {
 114071 			aff = int8(SQLITE_AFF_INTEGER)
 114072 			break
 114073 		}
 114074 	}
 114075 
 114076 	if pCol != 0 {
 114077 		*(*int32)(unsafe.Pointer(bp)) = 0
 114078 		if int32(aff) < SQLITE_AFF_NUMERIC {
 114079 			if zChar != 0 {
 114080 				for *(*int8)(unsafe.Pointer(zChar)) != 0 {
 114081 					if int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zChar)))])&0x04 != 0 {
 114082 						Xsqlite3GetInt32(tls, zChar, bp)
 114083 						break
 114084 					}
 114085 					zChar++
 114086 				}
 114087 			} else {
 114088 				*(*int32)(unsafe.Pointer(bp)) = 16
 114089 			}
 114090 		}
 114091 		*(*int32)(unsafe.Pointer(bp)) = *(*int32)(unsafe.Pointer(bp))/4 + 1
 114092 		if *(*int32)(unsafe.Pointer(bp)) > 255 {
 114093 			*(*int32)(unsafe.Pointer(bp)) = 255
 114094 		}
 114095 		(*Column)(unsafe.Pointer(pCol)).FszEst = U8(*(*int32)(unsafe.Pointer(bp)))
 114096 	}
 114097 	return aff
 114098 }
 114099 
 114100 // The expression is the default value for the most recently added column
 114101 // of the table currently under construction.
 114102 //
 114103 // Default value expressions must be constant.  Raise an exception if this
 114104 // is not the case.
 114105 //
 114106 // This routine is called by the parser while in the middle of
 114107 // parsing a CREATE TABLE statement.
 114108 func Xsqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStart uintptr, zEnd uintptr) {
 114109 	bp := tls.Alloc(80)
 114110 	defer tls.Free(80)
 114111 
 114112 	var p uintptr
 114113 	var pCol uintptr
 114114 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 114115 	p = (*Parse)(unsafe.Pointer(pParse)).FpNewTable
 114116 	if p != uintptr(0) {
 114117 		var isInit int32 = libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 && int32((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb) != 1)
 114118 		pCol = (*Table)(unsafe.Pointer(p)).FaCol + uintptr(int32((*Table)(unsafe.Pointer(p)).FnCol)-1)*24
 114119 		if !(Xsqlite3ExprIsConstantOrFunction(tls, pExpr, uint8(isInit)) != 0) {
 114120 			Xsqlite3ErrorMsg(tls, pParse, ts+13795,
 114121 				libc.VaList(bp, (*Column)(unsafe.Pointer(pCol)).FzCnName))
 114122 		} else if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_GENERATED != 0 {
 114123 			Xsqlite3ErrorMsg(tls, pParse, ts+13840, 0)
 114124 		} else {
 114125 			var pDfltExpr uintptr
 114126 			libc.Xmemset(tls, bp+8, 0, uint64(unsafe.Sizeof(Expr{})))
 114127 			(*Expr)(unsafe.Pointer(bp + 8)).Fop = U8(TK_SPAN)
 114128 			*(*uintptr)(unsafe.Pointer(bp + 8 + 8)) = Xsqlite3DbSpanDup(tls, db, zStart, zEnd)
 114129 			(*Expr)(unsafe.Pointer(bp + 8)).FpLeft = pExpr
 114130 			(*Expr)(unsafe.Pointer(bp + 8)).Fflags = U32(EP_Skip)
 114131 			pDfltExpr = Xsqlite3ExprDup(tls, db, bp+8, EXPRDUP_REDUCE)
 114132 			Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8 + 8)))
 114133 			Xsqlite3ColumnSetExpr(tls, pParse, p, pCol, pDfltExpr)
 114134 		}
 114135 	}
 114136 	if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
 114137 		Xsqlite3RenameExprUnmap(tls, pParse, pExpr)
 114138 	}
 114139 	Xsqlite3ExprDelete(tls, db, pExpr)
 114140 }
 114141 
 114142 func sqlite3StringToId(tls *libc.TLS, p uintptr) {
 114143 	if int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_STRING {
 114144 		(*Expr)(unsafe.Pointer(p)).Fop = U8(TK_ID)
 114145 	} else if int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLLATE && int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fop) == TK_STRING {
 114146 		(*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fop = U8(TK_ID)
 114147 	}
 114148 }
 114149 
 114150 func makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) {
 114151 	*(*U16)(unsafe.Pointer(pCol + 16)) |= U16(COLFLAG_PRIMKEY)
 114152 	if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_GENERATED != 0 {
 114153 		Xsqlite3ErrorMsg(tls, pParse,
 114154 			ts+13881, 0)
 114155 	}
 114156 }
 114157 
 114158 // Designate the PRIMARY KEY for the table.  pList is a list of names
 114159 // of columns that form the primary key.  If pList is NULL, then the
 114160 // most recently added column of the table is the primary key.
 114161 //
 114162 // A table can have at most one primary key.  If the table already has
 114163 // a primary key (and this is the second primary key) then create an
 114164 // error.
 114165 //
 114166 // If the PRIMARY KEY is on a single column whose datatype is INTEGER,
 114167 // then we will try to use that column as the rowid.  Set the Table.iPKey
 114168 // field of the table under construction to be the index of the
 114169 // INTEGER PRIMARY KEY column.  Table.iPKey is set to -1 if there is
 114170 // no INTEGER PRIMARY KEY.
 114171 //
 114172 // If the key is not an INTEGER PRIMARY KEY, then create a unique
 114173 // index for the key.  No index is created for INTEGER PRIMARY KEYs.
 114174 func Xsqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError int32, autoInc int32, sortOrder int32) {
 114175 	bp := tls.Alloc(8)
 114176 	defer tls.Free(8)
 114177 
 114178 	var pTab uintptr
 114179 	var pCol uintptr
 114180 	var iCol int32
 114181 	var i int32
 114182 	var nTerm int32
 114183 	var zCName uintptr
 114184 	var pCExpr uintptr
 114185 	var pCExpr1 uintptr
 114186 	pTab = (*Parse)(unsafe.Pointer(pParse)).FpNewTable
 114187 	pCol = uintptr(0)
 114188 	iCol = -1
 114189 	if !(pTab == uintptr(0)) {
 114190 		goto __1
 114191 	}
 114192 	goto primary_key_exit
 114193 __1:
 114194 	;
 114195 	if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasPrimaryKey) != 0) {
 114196 		goto __2
 114197 	}
 114198 	Xsqlite3ErrorMsg(tls, pParse,
 114199 		ts+13933, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
 114200 	goto primary_key_exit
 114201 __2:
 114202 	;
 114203 	*(*U32)(unsafe.Pointer(pTab + 48)) |= U32(TF_HasPrimaryKey)
 114204 	if !(pList == uintptr(0)) {
 114205 		goto __3
 114206 	}
 114207 	iCol = int32((*Table)(unsafe.Pointer(pTab)).FnCol) - 1
 114208 	pCol = (*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*24
 114209 	makeColumnPartOfPrimaryKey(tls, pParse, pCol)
 114210 	nTerm = 1
 114211 	goto __4
 114212 __3:
 114213 	nTerm = (*ExprList)(unsafe.Pointer(pList)).FnExpr
 114214 	i = 0
 114215 __5:
 114216 	if !(i < nTerm) {
 114217 		goto __7
 114218 	}
 114219 	pCExpr = Xsqlite3ExprSkipCollate(tls, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*32)).FpExpr)
 114220 
 114221 	sqlite3StringToId(tls, pCExpr)
 114222 	if !(int32((*Expr)(unsafe.Pointer(pCExpr)).Fop) == TK_ID) {
 114223 		goto __8
 114224 	}
 114225 
 114226 	zCName = *(*uintptr)(unsafe.Pointer(pCExpr + 8))
 114227 	iCol = 0
 114228 __9:
 114229 	if !(iCol < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 114230 		goto __11
 114231 	}
 114232 	if !(Xsqlite3StrICmp(tls, zCName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*24)).FzCnName) == 0) {
 114233 		goto __12
 114234 	}
 114235 	pCol = (*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*24
 114236 	makeColumnPartOfPrimaryKey(tls, pParse, pCol)
 114237 	goto __11
 114238 __12:
 114239 	;
 114240 	goto __10
 114241 __10:
 114242 	iCol++
 114243 	goto __9
 114244 	goto __11
 114245 __11:
 114246 	;
 114247 __8:
 114248 	;
 114249 	goto __6
 114250 __6:
 114251 	i++
 114252 	goto __5
 114253 	goto __7
 114254 __7:
 114255 	;
 114256 __4:
 114257 	;
 114258 	if !(nTerm == 1 &&
 114259 		pCol != 0 &&
 114260 		int32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf0>>4) == COLTYPE_INTEGER &&
 114261 		sortOrder != SQLITE_SO_DESC) {
 114262 		goto __13
 114263 	}
 114264 	if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME && pList != 0) {
 114265 		goto __15
 114266 	}
 114267 	pCExpr1 = Xsqlite3ExprSkipCollate(tls, (*ExprList_item)(unsafe.Pointer(pList+8)).FpExpr)
 114268 	Xsqlite3RenameTokenRemap(tls, pParse, pTab+52, pCExpr1)
 114269 __15:
 114270 	;
 114271 	(*Table)(unsafe.Pointer(pTab)).FiPKey = I16(iCol)
 114272 	(*Table)(unsafe.Pointer(pTab)).FkeyConf = U8(onError)
 114273 
 114274 	*(*U32)(unsafe.Pointer(pTab + 48)) |= U32(autoInc * TF_Autoincrement)
 114275 	if !(pList != 0) {
 114276 		goto __16
 114277 	}
 114278 	(*Parse)(unsafe.Pointer(pParse)).FiPkSortOrder = (*ExprList_item)(unsafe.Pointer(pList + 8)).Ffg.FsortFlags
 114279 __16:
 114280 	;
 114281 	Xsqlite3HasExplicitNulls(tls, pParse, pList)
 114282 	goto __14
 114283 __13:
 114284 	if !(autoInc != 0) {
 114285 		goto __17
 114286 	}
 114287 	Xsqlite3ErrorMsg(tls, pParse,
 114288 		ts+13974, 0)
 114289 	goto __18
 114290 __17:
 114291 	Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, onError, uintptr(0),
 114292 		uintptr(0), sortOrder, 0, uint8(SQLITE_IDXTYPE_PRIMARYKEY))
 114293 	pList = uintptr(0)
 114294 __18:
 114295 	;
 114296 __14:
 114297 	;
 114298 primary_key_exit:
 114299 	Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pList)
 114300 	return
 114301 }
 114302 
 114303 // Add a new CHECK constraint to the table currently under construction.
 114304 func Xsqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintptr, zStart uintptr, zEnd uintptr) {
 114305 	bp := tls.Alloc(16)
 114306 	defer tls.Free(16)
 114307 
 114308 	var pTab uintptr = (*Parse)(unsafe.Pointer(pParse)).FpNewTable
 114309 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 114310 	if pTab != 0 && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) == PARSE_MODE_DECLARE_VTAB) &&
 114311 		!(Xsqlite3BtreeIsReadonly(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb)*32)).FpBt) != 0) {
 114312 		(*Table)(unsafe.Pointer(pTab)).FpCheck = Xsqlite3ExprListAppend(tls, pParse, (*Table)(unsafe.Pointer(pTab)).FpCheck, pCheckExpr)
 114313 		if (*Parse)(unsafe.Pointer(pParse)).FconstraintName.Fn != 0 {
 114314 			Xsqlite3ExprListSetName(tls, pParse, (*Table)(unsafe.Pointer(pTab)).FpCheck, pParse+104, 1)
 114315 		} else {
 114316 			for zStart++; int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zStart)))])&0x01 != 0; zStart++ {
 114317 			}
 114318 			for int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zEnd + libc.UintptrFromInt32(-1))))])&0x01 != 0 {
 114319 				zEnd--
 114320 			}
 114321 			(*Token)(unsafe.Pointer(bp)).Fz = zStart
 114322 			(*Token)(unsafe.Pointer(bp)).Fn = uint32(int32((int64(zEnd) - int64((*Token)(unsafe.Pointer(bp)).Fz)) / 1))
 114323 			Xsqlite3ExprListSetName(tls, pParse, (*Table)(unsafe.Pointer(pTab)).FpCheck, bp, 1)
 114324 		}
 114325 	} else {
 114326 		Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pCheckExpr)
 114327 	}
 114328 }
 114329 
 114330 // Set the collation function of the most recently parsed table column
 114331 // to the CollSeq given.
 114332 func Xsqlite3AddCollateType(tls *libc.TLS, pParse uintptr, pToken uintptr) {
 114333 	var p uintptr
 114334 	var i int32
 114335 	var zColl uintptr
 114336 	var db uintptr
 114337 
 114338 	if libc.AssignUintptr(&p, (*Parse)(unsafe.Pointer(pParse)).FpNewTable) == uintptr(0) || int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
 114339 		return
 114340 	}
 114341 	i = int32((*Table)(unsafe.Pointer(p)).FnCol) - 1
 114342 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 114343 	zColl = Xsqlite3NameFromToken(tls, db, pToken)
 114344 	if !(zColl != 0) {
 114345 		return
 114346 	}
 114347 
 114348 	if Xsqlite3LocateCollSeq(tls, pParse, zColl) != 0 {
 114349 		var pIdx uintptr
 114350 		Xsqlite3ColumnSetColl(tls, db, (*Table)(unsafe.Pointer(p)).FaCol+uintptr(i)*24, zColl)
 114351 
 114352 		for pIdx = (*Table)(unsafe.Pointer(p)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
 114353 			if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn))) == i {
 114354 				*(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl)) = Xsqlite3ColumnColl(tls, (*Table)(unsafe.Pointer(p)).FaCol+uintptr(i)*24)
 114355 			}
 114356 		}
 114357 	}
 114358 	Xsqlite3DbFree(tls, db, zColl)
 114359 }
 114360 
 114361 // Change the most recently parsed column to be a GENERATED ALWAYS AS
 114362 // column.
 114363 func Xsqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType uintptr) {
 114364 	bp := tls.Alloc(8)
 114365 	defer tls.Free(8)
 114366 
 114367 	var eType U8
 114368 	var pTab uintptr
 114369 	var pCol uintptr
 114370 	eType = U8(COLFLAG_VIRTUAL)
 114371 	pTab = (*Parse)(unsafe.Pointer(pParse)).FpNewTable
 114372 	if !(pTab == uintptr(0)) {
 114373 		goto __1
 114374 	}
 114375 
 114376 	goto generated_done
 114377 __1:
 114378 	;
 114379 	pCol = (*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(int32((*Table)(unsafe.Pointer(pTab)).FnCol)-1)*24
 114380 	if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) == PARSE_MODE_DECLARE_VTAB) {
 114381 		goto __2
 114382 	}
 114383 	Xsqlite3ErrorMsg(tls, pParse, ts+14030, 0)
 114384 	goto generated_done
 114385 __2:
 114386 	;
 114387 	if !(int32((*Column)(unsafe.Pointer(pCol)).FiDflt) > 0) {
 114388 		goto __3
 114389 	}
 114390 	goto generated_error
 114391 __3:
 114392 	;
 114393 	if !(pType != 0) {
 114394 		goto __4
 114395 	}
 114396 	if !((*Token)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, ts+14073, (*Token)(unsafe.Pointer(pType)).Fz, 7) == 0) {
 114397 		goto __5
 114398 	}
 114399 
 114400 	goto __6
 114401 __5:
 114402 	if !((*Token)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, ts+14081, (*Token)(unsafe.Pointer(pType)).Fz, 6) == 0) {
 114403 		goto __7
 114404 	}
 114405 	eType = U8(COLFLAG_STORED)
 114406 	goto __8
 114407 __7:
 114408 	goto generated_error
 114409 __8:
 114410 	;
 114411 __6:
 114412 	;
 114413 __4:
 114414 	;
 114415 	if !(int32(eType) == COLFLAG_VIRTUAL) {
 114416 		goto __9
 114417 	}
 114418 	(*Table)(unsafe.Pointer(pTab)).FnNVCol--
 114419 __9:
 114420 	;
 114421 	*(*U16)(unsafe.Pointer(pCol + 16)) |= U16(int32(eType))
 114422 
 114423 	*(*U32)(unsafe.Pointer(pTab + 48)) |= U32(eType)
 114424 	if !(int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_PRIMKEY != 0) {
 114425 		goto __10
 114426 	}
 114427 	makeColumnPartOfPrimaryKey(tls, pParse, pCol)
 114428 __10:
 114429 	;
 114430 	if !(pExpr != 0 && int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_ID) {
 114431 		goto __11
 114432 	}
 114433 
 114434 	pExpr = Xsqlite3PExpr(tls, pParse, TK_UPLUS, pExpr, uintptr(0))
 114435 __11:
 114436 	;
 114437 	if !(pExpr != 0 && int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_RAISE) {
 114438 		goto __12
 114439 	}
 114440 	(*Expr)(unsafe.Pointer(pExpr)).FaffExpr = (*Column)(unsafe.Pointer(pCol)).Faffinity
 114441 __12:
 114442 	;
 114443 	Xsqlite3ColumnSetExpr(tls, pParse, pTab, pCol, pExpr)
 114444 	pExpr = uintptr(0)
 114445 	goto generated_done
 114446 
 114447 generated_error:
 114448 	Xsqlite3ErrorMsg(tls, pParse, ts+14088,
 114449 		libc.VaList(bp, (*Column)(unsafe.Pointer(pCol)).FzCnName))
 114450 generated_done:
 114451 	Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr)
 114452 }
 114453 
 114454 // Generate code that will increment the schema cookie.
 114455 //
 114456 // The schema cookie is used to determine when the schema for the
 114457 // database changes.  After each schema change, the cookie value
 114458 // changes.  When a process first reads the schema it records the
 114459 // cookie.  Thereafter, whenever it goes to access the database,
 114460 // it checks the cookie to make sure the schema has not changed
 114461 // since it was last read.
 114462 //
 114463 // This plan is not completely bullet-proof.  It is possible for
 114464 // the schema to change multiple times and for the cookie to be
 114465 // set back to prior value.  But schema changes are infrequent
 114466 // and the probability of hitting the same cookie value is only
 114467 // 1 chance in 2^32.  So we're safe enough.
 114468 //
 114469 // IMPLEMENTATION-OF: R-34230-56049 SQLite automatically increments
 114470 // the schema-version whenever the schema changes.
 114471 func Xsqlite3ChangeCookie(tls *libc.TLS, pParse uintptr, iDb int32) {
 114472 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 114473 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 114474 
 114475 	Xsqlite3VdbeAddOp3(tls, v, OP_SetCookie, iDb, BTREE_SCHEMA_VERSION,
 114476 		int32(uint32(1)+uint32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpSchema)).Fschema_cookie)))
 114477 }
 114478 
 114479 func identLength(tls *libc.TLS, z uintptr) int32 {
 114480 	var n int32
 114481 	n = 0
 114482 __1:
 114483 	if !(*(*int8)(unsafe.Pointer(z)) != 0) {
 114484 		goto __3
 114485 	}
 114486 	{
 114487 		if int32(*(*int8)(unsafe.Pointer(z))) == '"' {
 114488 			n++
 114489 		}
 114490 
 114491 	}
 114492 	goto __2
 114493 __2:
 114494 	n++
 114495 	z++
 114496 	goto __1
 114497 	goto __3
 114498 __3:
 114499 	;
 114500 	return n + 2
 114501 }
 114502 
 114503 func identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) {
 114504 	var zIdent uintptr = zSignedIdent
 114505 	var i int32
 114506 	var j int32
 114507 	var needQuote int32
 114508 	i = *(*int32)(unsafe.Pointer(pIdx))
 114509 
 114510 	for j = 0; *(*uint8)(unsafe.Pointer(zIdent + uintptr(j))) != 0; j++ {
 114511 		if !(int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zIdent + uintptr(j)))])&0x06 != 0) && int32(*(*uint8)(unsafe.Pointer(zIdent + uintptr(j)))) != '_' {
 114512 			break
 114513 		}
 114514 	}
 114515 	needQuote = libc.Bool32(int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zIdent))])&0x04 != 0 ||
 114516 		Xsqlite3KeywordCode(tls, zIdent, j) != TK_ID ||
 114517 		int32(*(*uint8)(unsafe.Pointer(zIdent + uintptr(j)))) != 0 ||
 114518 		j == 0)
 114519 
 114520 	if needQuote != 0 {
 114521 		*(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&i, 1)))) = int8('"')
 114522 	}
 114523 	for j = 0; *(*uint8)(unsafe.Pointer(zIdent + uintptr(j))) != 0; j++ {
 114524 		*(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&i, 1)))) = int8(*(*uint8)(unsafe.Pointer(zIdent + uintptr(j))))
 114525 		if int32(*(*uint8)(unsafe.Pointer(zIdent + uintptr(j)))) == '"' {
 114526 			*(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&i, 1)))) = int8('"')
 114527 		}
 114528 	}
 114529 	if needQuote != 0 {
 114530 		*(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&i, 1)))) = int8('"')
 114531 	}
 114532 	*(*int8)(unsafe.Pointer(z + uintptr(i))) = int8(0)
 114533 	*(*int32)(unsafe.Pointer(pIdx)) = i
 114534 }
 114535 
 114536 func createTableStmt(tls *libc.TLS, db uintptr, p uintptr) uintptr {
 114537 	bp := tls.Alloc(12)
 114538 	defer tls.Free(12)
 114539 
 114540 	var i int32
 114541 
 114542 	var n int32
 114543 	var zStmt uintptr
 114544 	var zSep uintptr
 114545 	var zSep2 uintptr
 114546 	var zEnd uintptr
 114547 	var pCol uintptr
 114548 	n = 0
 114549 	pCol = (*Table)(unsafe.Pointer(p)).FaCol
 114550 	i = 0
 114551 __1:
 114552 	if !(i < int32((*Table)(unsafe.Pointer(p)).FnCol)) {
 114553 		goto __3
 114554 	}
 114555 	{
 114556 		n = n + (identLength(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName) + 5)
 114557 
 114558 	}
 114559 	goto __2
 114560 __2:
 114561 	i++
 114562 	pCol += 24
 114563 	goto __1
 114564 	goto __3
 114565 __3:
 114566 	;
 114567 	n = n + identLength(tls, (*Table)(unsafe.Pointer(p)).FzName)
 114568 	if n < 50 {
 114569 		zSep = ts + 1544
 114570 		zSep2 = ts + 14119
 114571 		zEnd = ts + 6309
 114572 	} else {
 114573 		zSep = ts + 14121
 114574 		zSep2 = ts + 14125
 114575 		zEnd = ts + 14130
 114576 	}
 114577 	n = n + (35 + 6*int32((*Table)(unsafe.Pointer(p)).FnCol))
 114578 	zStmt = Xsqlite3DbMallocRaw(tls, uintptr(0), uint64(n))
 114579 	if zStmt == uintptr(0) {
 114580 		Xsqlite3OomFault(tls, db)
 114581 		return uintptr(0)
 114582 	}
 114583 	Xsqlite3_snprintf(tls, n, zStmt, ts+14133, 0)
 114584 	*(*int32)(unsafe.Pointer(bp + 8)) = Xsqlite3Strlen30(tls, zStmt)
 114585 	identPut(tls, zStmt, bp+8, (*Table)(unsafe.Pointer(p)).FzName)
 114586 	*(*int8)(unsafe.Pointer(zStmt + uintptr(libc.PostIncInt32(&*(*int32)(unsafe.Pointer(bp + 8)), 1)))) = int8('(')
 114587 	pCol = (*Table)(unsafe.Pointer(p)).FaCol
 114588 	i = 0
 114589 __4:
 114590 	if !(i < int32((*Table)(unsafe.Pointer(p)).FnCol)) {
 114591 		goto __6
 114592 	}
 114593 	{
 114594 		var len int32
 114595 		var zType uintptr
 114596 
 114597 		Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp + 8)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp + 8))), zSep, 0)
 114598 		*(*int32)(unsafe.Pointer(bp + 8)) += Xsqlite3Strlen30(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp + 8))))
 114599 		zSep = zSep2
 114600 		identPut(tls, zStmt, bp+8, (*Column)(unsafe.Pointer(pCol)).FzCnName)
 114601 
 114602 		zType = azType1[int32((*Column)(unsafe.Pointer(pCol)).Faffinity)-SQLITE_AFF_BLOB]
 114603 		len = Xsqlite3Strlen30(tls, zType)
 114604 
 114605 		libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp + 8))), zType, uint64(len))
 114606 		*(*int32)(unsafe.Pointer(bp + 8)) += len
 114607 
 114608 	}
 114609 	goto __5
 114610 __5:
 114611 	i++
 114612 	pCol += 24
 114613 	goto __4
 114614 	goto __6
 114615 __6:
 114616 	;
 114617 	Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp + 8)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp + 8))), ts+4493, libc.VaList(bp, zEnd))
 114618 	return zStmt
 114619 }
 114620 
 114621 var azType1 = [6]uintptr{
 114622 	ts + 1544,
 114623 	ts + 14147,
 114624 	ts + 14153,
 114625 	ts + 14158,
 114626 	ts + 14163,
 114627 	ts + 14153,
 114628 }
 114629 
 114630 func resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) int32 {
 114631 	var zExtra uintptr
 114632 	var nByte int32
 114633 	if int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) >= N {
 114634 		return SQLITE_OK
 114635 	}
 114636 
 114637 	nByte = int32((uint64(unsafe.Sizeof(uintptr(0))) + uint64(unsafe.Sizeof(LogEst(0))) + uint64(unsafe.Sizeof(I16(0))) + uint64(1)) * uint64(N))
 114638 	zExtra = Xsqlite3DbMallocZero(tls, db, uint64(nByte))
 114639 	if zExtra == uintptr(0) {
 114640 		return SQLITE_NOMEM
 114641 	}
 114642 	libc.Xmemcpy(tls, zExtra, (*Index)(unsafe.Pointer(pIdx)).FazColl, uint64(unsafe.Sizeof(uintptr(0)))*uint64((*Index)(unsafe.Pointer(pIdx)).FnColumn))
 114643 	(*Index)(unsafe.Pointer(pIdx)).FazColl = zExtra
 114644 	zExtra += uintptr(uint64(unsafe.Sizeof(uintptr(0))) * uint64(N))
 114645 	libc.Xmemcpy(tls, zExtra, (*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst, uint64(unsafe.Sizeof(LogEst(0)))*uint64(int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)+1))
 114646 	(*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst = zExtra
 114647 	zExtra += uintptr(uint64(unsafe.Sizeof(LogEst(0))) * uint64(N))
 114648 	libc.Xmemcpy(tls, zExtra, (*Index)(unsafe.Pointer(pIdx)).FaiColumn, uint64(unsafe.Sizeof(I16(0)))*uint64((*Index)(unsafe.Pointer(pIdx)).FnColumn))
 114649 	(*Index)(unsafe.Pointer(pIdx)).FaiColumn = zExtra
 114650 	zExtra += uintptr(uint64(unsafe.Sizeof(I16(0))) * uint64(N))
 114651 	libc.Xmemcpy(tls, zExtra, (*Index)(unsafe.Pointer(pIdx)).FaSortOrder, uint64((*Index)(unsafe.Pointer(pIdx)).FnColumn))
 114652 	(*Index)(unsafe.Pointer(pIdx)).FaSortOrder = zExtra
 114653 	(*Index)(unsafe.Pointer(pIdx)).FnColumn = U16(N)
 114654 	libc.SetBitFieldPtr16Uint32(pIdx+100, uint32(1), 4, 0x10)
 114655 	return SQLITE_OK
 114656 }
 114657 
 114658 func estimateTableWidth(tls *libc.TLS, pTab uintptr) {
 114659 	var wTable uint32 = uint32(0)
 114660 	var pTabCol uintptr
 114661 	var i int32
 114662 	i = int32((*Table)(unsafe.Pointer(pTab)).FnCol)
 114663 	pTabCol = (*Table)(unsafe.Pointer(pTab)).FaCol
 114664 __1:
 114665 	if !(i > 0) {
 114666 		goto __3
 114667 	}
 114668 	{
 114669 		wTable = wTable + uint32((*Column)(unsafe.Pointer(pTabCol)).FszEst)
 114670 
 114671 	}
 114672 	goto __2
 114673 __2:
 114674 	i--
 114675 	pTabCol += 24
 114676 	goto __1
 114677 	goto __3
 114678 __3:
 114679 	;
 114680 	if int32((*Table)(unsafe.Pointer(pTab)).FiPKey) < 0 {
 114681 		wTable++
 114682 	}
 114683 	(*Table)(unsafe.Pointer(pTab)).FszTabRow = Xsqlite3LogEst(tls, uint64(wTable*uint32(4)))
 114684 }
 114685 
 114686 func estimateIndexWidth(tls *libc.TLS, pIdx uintptr) {
 114687 	var wIndex uint32 = uint32(0)
 114688 	var i int32
 114689 	var aCol uintptr = (*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FaCol
 114690 	for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnColumn); i++ {
 114691 		var x I16 = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))
 114692 
 114693 		wIndex = wIndex + func() uint32 {
 114694 			if int32(x) < 0 {
 114695 				return uint32(1)
 114696 			}
 114697 			return uint32((*Column)(unsafe.Pointer(aCol + uintptr(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2)))*24)).FszEst)
 114698 		}()
 114699 	}
 114700 	(*Index)(unsafe.Pointer(pIdx)).FszIdxRow = Xsqlite3LogEst(tls, uint64(wIndex*uint32(4)))
 114701 }
 114702 
 114703 func hasColumn(tls *libc.TLS, aiCol uintptr, nCol int32, x int32) int32 {
 114704 	for libc.PostDecInt32(&nCol, 1) > 0 {
 114705 		if x == int32(*(*I16)(unsafe.Pointer(libc.PostIncUintptr(&aiCol, 2)))) {
 114706 			return 1
 114707 		}
 114708 	}
 114709 	return 0
 114710 }
 114711 
 114712 func isDupColumn(tls *libc.TLS, pIdx uintptr, nKey int32, pPk uintptr, iCol int32) int32 {
 114713 	var i int32
 114714 	var j int32
 114715 
 114716 	j = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(iCol)*2)))
 114717 
 114718 	for i = 0; i < nKey; i++ {
 114719 		if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) == j &&
 114720 			Xsqlite3StrICmp(tls, *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FazColl + uintptr(iCol)*8))) == 0 {
 114721 			return 1
 114722 		}
 114723 	}
 114724 	return 0
 114725 }
 114726 
 114727 func recomputeColumnsNotIndexed(tls *libc.TLS, pIdx uintptr) {
 114728 	var m Bitmask = uint64(0)
 114729 	var j int32
 114730 	var pTab uintptr = (*Index)(unsafe.Pointer(pIdx)).FpTable
 114731 	for j = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) - 1; j >= 0; j-- {
 114732 		var x int32 = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)))
 114733 		if x >= 0 && int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(x)*24)).FcolFlags)&COLFLAG_VIRTUAL == 0 {
 114734 			if x < int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8))-1 {
 114735 				m = m | uint64(1)<<x
 114736 			}
 114737 		}
 114738 	}
 114739 	(*Index)(unsafe.Pointer(pIdx)).FcolNotIdxed = ^m
 114740 
 114741 }
 114742 
 114743 func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) {
 114744 	bp := tls.Alloc(16)
 114745 	defer tls.Free(16)
 114746 
 114747 	var pIdx uintptr
 114748 	var pPk uintptr
 114749 	var nPk int32
 114750 	var nExtra int32
 114751 	var i int32
 114752 	var j int32
 114753 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 114754 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 114755 
 114756 	if !(int32(*(*uint8)(unsafe.Pointer(db + 192 + 8))&0x2>>1) != 0) {
 114757 		for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
 114758 			if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24)).FcolFlags)&COLFLAG_PRIMKEY != 0 &&
 114759 				int32(*(*uint8)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*24 + 8))&0xf>>0) == OE_None {
 114760 				libc.SetBitFieldPtr8Uint32((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24+8, uint32(OE_Abort), 0, 0xf)
 114761 			}
 114762 		}
 114763 		*(*U32)(unsafe.Pointer(pTab + 48)) |= U32(TF_HasNotNull)
 114764 	}
 114765 
 114766 	if *(*int32)(unsafe.Pointer(pParse + 200)) != 0 {
 114767 		Xsqlite3VdbeChangeP3(tls, v, *(*int32)(unsafe.Pointer(pParse + 200)), BTREE_BLOBKEY)
 114768 	}
 114769 
 114770 	if int32((*Table)(unsafe.Pointer(pTab)).FiPKey) >= 0 {
 114771 		var pList uintptr
 114772 
 114773 		Xsqlite3TokenInit(tls, bp, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr((*Table)(unsafe.Pointer(pTab)).FiPKey)*24)).FzCnName)
 114774 		pList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0),
 114775 			Xsqlite3ExprAlloc(tls, db, TK_ID, bp, 0))
 114776 		if pList == uintptr(0) {
 114777 			*(*U32)(unsafe.Pointer(pTab + 48)) &= libc.Uint32FromInt32(libc.CplInt32(TF_WithoutRowid))
 114778 			return
 114779 		}
 114780 		if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
 114781 			Xsqlite3RenameTokenRemap(tls, pParse, (*ExprList_item)(unsafe.Pointer(pList+8)).FpExpr, pTab+52)
 114782 		}
 114783 		(*ExprList_item)(unsafe.Pointer(pList + 8)).Ffg.FsortFlags = (*Parse)(unsafe.Pointer(pParse)).FiPkSortOrder
 114784 
 114785 		(*Table)(unsafe.Pointer(pTab)).FiPKey = int16(-1)
 114786 		Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, int32((*Table)(unsafe.Pointer(pTab)).FkeyConf), uintptr(0), uintptr(0), 0, 0,
 114787 			uint8(SQLITE_IDXTYPE_PRIMARYKEY))
 114788 		if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 114789 			*(*U32)(unsafe.Pointer(pTab + 48)) &= libc.Uint32FromInt32(libc.CplInt32(TF_WithoutRowid))
 114790 			return
 114791 		}
 114792 
 114793 		pPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
 114794 
 114795 	} else {
 114796 		pPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
 114797 
 114798 		for i = libc.AssignInt32(&j, 1); i < int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol); i++ {
 114799 			if isDupColumn(tls, pPk, j, pPk, i) != 0 {
 114800 				(*Index)(unsafe.Pointer(pPk)).FnColumn--
 114801 			} else {
 114802 				*(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FazColl + uintptr(j)*8)) = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FazColl + uintptr(i)*8))
 114803 				*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(j))) = *(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(i)))
 114804 				*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(libc.PostIncInt32(&j, 1))*2)) = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))
 114805 			}
 114806 		}
 114807 		(*Index)(unsafe.Pointer(pPk)).FnKeyCol = U16(j)
 114808 	}
 114809 
 114810 	libc.SetBitFieldPtr16Uint32(pPk+100, uint32(1), 5, 0x20)
 114811 	if !(int32(*(*uint8)(unsafe.Pointer(db + 192 + 8))&0x2>>1) != 0) {
 114812 		libc.SetBitFieldPtr16Uint32(pPk+100, uint32(1), 3, 0x8)
 114813 	}
 114814 	nPk = int32(libc.AssignPtrUint16(pPk+96, (*Index)(unsafe.Pointer(pPk)).FnKeyCol))
 114815 
 114816 	if v != 0 && (*Index)(unsafe.Pointer(pPk)).Ftnum > Pgno(0) {
 114817 		Xsqlite3VdbeChangeOpcode(tls, v, int32((*Index)(unsafe.Pointer(pPk)).Ftnum), uint8(OP_Goto))
 114818 	}
 114819 
 114820 	(*Index)(unsafe.Pointer(pPk)).Ftnum = (*Table)(unsafe.Pointer(pTab)).Ftnum
 114821 
 114822 	for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
 114823 		var n int32
 114824 		if int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY {
 114825 			continue
 114826 		}
 114827 		for i = libc.AssignInt32(&n, 0); i < nPk; i++ {
 114828 			if !(isDupColumn(tls, pIdx, int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol), pPk, i) != 0) {
 114829 				n++
 114830 			}
 114831 		}
 114832 		if n == 0 {
 114833 			(*Index)(unsafe.Pointer(pIdx)).FnColumn = (*Index)(unsafe.Pointer(pIdx)).FnKeyCol
 114834 			continue
 114835 		}
 114836 		if resizeIndexObject(tls, db, pIdx, int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 {
 114837 			return
 114838 		}
 114839 		i = 0
 114840 		j = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
 114841 		for ; i < nPk; i++ {
 114842 			if !(isDupColumn(tls, pIdx, int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol), pPk, i) != 0) {
 114843 				*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)) = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))
 114844 				*(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*8)) = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FazColl + uintptr(i)*8))
 114845 				if *(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(i))) != 0 {
 114846 					libc.SetBitFieldPtr16Uint32(pIdx+100, uint32(1), 9, 0x200)
 114847 				}
 114848 				j++
 114849 			}
 114850 		}
 114851 
 114852 	}
 114853 
 114854 	nExtra = 0
 114855 	for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
 114856 		if !(hasColumn(tls, (*Index)(unsafe.Pointer(pPk)).FaiColumn, nPk, i) != 0) &&
 114857 			int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24)).FcolFlags)&COLFLAG_VIRTUAL == 0 {
 114858 			nExtra++
 114859 		}
 114860 	}
 114861 	if resizeIndexObject(tls, db, pPk, nPk+nExtra) != 0 {
 114862 		return
 114863 	}
 114864 	i = 0
 114865 	j = nPk
 114866 	for ; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
 114867 		if !(hasColumn(tls, (*Index)(unsafe.Pointer(pPk)).FaiColumn, j, i) != 0) &&
 114868 			int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24)).FcolFlags)&COLFLAG_VIRTUAL == 0 {
 114869 			*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)) = I16(i)
 114870 			*(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FazColl + uintptr(j)*8)) = uintptr(unsafe.Pointer(&Xsqlite3StrBINARY))
 114871 			j++
 114872 		}
 114873 	}
 114874 
 114875 	recomputeColumnsNotIndexed(tls, pPk)
 114876 }
 114877 
 114878 // Return true if pTab is a virtual table and zName is a shadow table name
 114879 // for that virtual table.
 114880 func Xsqlite3IsShadowTableOf(tls *libc.TLS, db uintptr, pTab uintptr, zName uintptr) int32 {
 114881 	var nName int32
 114882 	var pMod uintptr
 114883 
 114884 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
 114885 		return 0
 114886 	}
 114887 	nName = Xsqlite3Strlen30(tls, (*Table)(unsafe.Pointer(pTab)).FzName)
 114888 	if Xsqlite3_strnicmp(tls, zName, (*Table)(unsafe.Pointer(pTab)).FzName, nName) != 0 {
 114889 		return 0
 114890 	}
 114891 	if int32(*(*int8)(unsafe.Pointer(zName + uintptr(nName)))) != '_' {
 114892 		return 0
 114893 	}
 114894 	pMod = Xsqlite3HashFind(tls, db+576, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTab + 64 + 8)))))
 114895 	if pMod == uintptr(0) {
 114896 		return 0
 114897 	}
 114898 	if (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FiVersion < 3 {
 114899 		return 0
 114900 	}
 114901 	if (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxShadowName == uintptr(0) {
 114902 		return 0
 114903 	}
 114904 	return (*struct {
 114905 		f func(*libc.TLS, uintptr) int32
 114906 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxShadowName})).f(tls, zName+uintptr(nName)+uintptr(1))
 114907 }
 114908 
 114909 // Table pTab is a virtual table.  If it the virtual table implementation
 114910 // exists and has an xShadowName method, then loop over all other ordinary
 114911 // tables within the same schema looking for shadow tables of pTab, and mark
 114912 // any shadow tables seen using the TF_Shadow flag.
 114913 func Xsqlite3MarkAllShadowTablesOf(tls *libc.TLS, db uintptr, pTab uintptr) {
 114914 	var nName int32
 114915 	var pMod uintptr
 114916 	var k uintptr
 114917 
 114918 	pMod = Xsqlite3HashFind(tls, db+576, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTab + 64 + 8)))))
 114919 	if pMod == uintptr(0) {
 114920 		return
 114921 	}
 114922 	if (*Module)(unsafe.Pointer(pMod)).FpModule == uintptr(0) {
 114923 		return
 114924 	}
 114925 	if (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FiVersion < 3 {
 114926 		return
 114927 	}
 114928 	if (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxShadowName == uintptr(0) {
 114929 		return
 114930 	}
 114931 
 114932 	nName = Xsqlite3Strlen30(tls, (*Table)(unsafe.Pointer(pTab)).FzName)
 114933 	for k = (*Hash)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FpSchema + 8)).Ffirst; k != 0; k = (*HashElem)(unsafe.Pointer(k)).Fnext {
 114934 		var pOther uintptr = (*HashElem)(unsafe.Pointer(k)).Fdata
 114935 
 114936 		if !(int32((*Table)(unsafe.Pointer(pOther)).FeTabType) == TABTYP_NORM) {
 114937 			continue
 114938 		}
 114939 		if (*Table)(unsafe.Pointer(pOther)).FtabFlags&U32(TF_Shadow) != 0 {
 114940 			continue
 114941 		}
 114942 		if Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pOther)).FzName, (*Table)(unsafe.Pointer(pTab)).FzName, nName) == 0 &&
 114943 			int32(*(*int8)(unsafe.Pointer((*Table)(unsafe.Pointer(pOther)).FzName + uintptr(nName)))) == '_' &&
 114944 			(*struct {
 114945 				f func(*libc.TLS, uintptr) int32
 114946 			})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxShadowName})).f(tls, (*Table)(unsafe.Pointer(pOther)).FzName+uintptr(nName)+uintptr(1)) != 0 {
 114947 			*(*U32)(unsafe.Pointer(pOther + 48)) |= U32(TF_Shadow)
 114948 		}
 114949 	}
 114950 }
 114951 
 114952 // Return true if zName is a shadow table name in the current database
 114953 // connection.
 114954 //
 114955 // zName is temporarily modified while this routine is running, but is
 114956 // restored to its original value prior to this routine returning.
 114957 func Xsqlite3ShadowTableName(tls *libc.TLS, db uintptr, zName uintptr) int32 {
 114958 	var zTail uintptr
 114959 	var pTab uintptr
 114960 	zTail = libc.Xstrrchr(tls, zName, '_')
 114961 	if zTail == uintptr(0) {
 114962 		return 0
 114963 	}
 114964 	*(*int8)(unsafe.Pointer(zTail)) = int8(0)
 114965 	pTab = Xsqlite3FindTable(tls, db, zName, uintptr(0))
 114966 	*(*int8)(unsafe.Pointer(zTail)) = int8('_')
 114967 	if pTab == uintptr(0) {
 114968 		return 0
 114969 	}
 114970 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
 114971 		return 0
 114972 	}
 114973 	return Xsqlite3IsShadowTableOf(tls, db, pTab, zName)
 114974 }
 114975 
 114976 // This routine is called to report the final ")" that terminates
 114977 // a CREATE TABLE statement.
 114978 //
 114979 // The table structure that other action routines have been building
 114980 // is added to the internal hash tables, assuming no errors have
 114981 // occurred.
 114982 //
 114983 // An entry for the table is made in the schema table on disk, unless
 114984 // this is a temporary table or db->init.busy==1.  When db->init.busy==1
 114985 // it means we are reading the sqlite_schema table because we just
 114986 // connected to the database or because the sqlite_schema table has
 114987 // recently changed, so the entry for this table already exists in
 114988 // the sqlite_schema table.  We do not want to create it again.
 114989 //
 114990 // If the pSelect argument is not NULL, it means that this routine
 114991 // was called to create a table generated from a
 114992 // "CREATE TABLE ... AS SELECT ..." statement.  The column names of
 114993 // the new table will match the result set of the SELECT.
 114994 func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr, tabOpts U32, pSelect uintptr) {
 114995 	bp := tls.Alloc(184)
 114996 	defer tls.Free(184)
 114997 
 114998 	var p uintptr
 114999 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 115000 	var iDb int32
 115001 	var pIdx uintptr
 115002 
 115003 	if pEnd == uintptr(0) && pSelect == uintptr(0) {
 115004 		return
 115005 	}
 115006 	p = (*Parse)(unsafe.Pointer(pParse)).FpNewTable
 115007 	if p == uintptr(0) {
 115008 		return
 115009 	}
 115010 
 115011 	if pSelect == uintptr(0) && Xsqlite3ShadowTableName(tls, db, (*Table)(unsafe.Pointer(p)).FzName) != 0 {
 115012 		*(*U32)(unsafe.Pointer(p + 48)) |= U32(TF_Shadow)
 115013 	}
 115014 
 115015 	if (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 {
 115016 		if pSelect != 0 || !(int32((*Table)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM) && (*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum != 0 {
 115017 			Xsqlite3ErrorMsg(tls, pParse, ts+1544, 0)
 115018 			return
 115019 		}
 115020 		(*Table)(unsafe.Pointer(p)).Ftnum = (*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum
 115021 		if (*Table)(unsafe.Pointer(p)).Ftnum == Pgno(1) {
 115022 			*(*U32)(unsafe.Pointer(p + 48)) |= U32(TF_Readonly)
 115023 		}
 115024 	}
 115025 
 115026 	if tabOpts&U32(TF_Strict) != 0 {
 115027 		var ii int32
 115028 		*(*U32)(unsafe.Pointer(p + 48)) |= U32(TF_Strict)
 115029 		for ii = 0; ii < int32((*Table)(unsafe.Pointer(p)).FnCol); ii++ {
 115030 			var pCol uintptr = (*Table)(unsafe.Pointer(p)).FaCol + uintptr(ii)*24
 115031 			if int32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf0>>4) == COLTYPE_CUSTOM {
 115032 				if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_HASTYPE != 0 {
 115033 					Xsqlite3ErrorMsg(tls, pParse,
 115034 						ts+14169,
 115035 						libc.VaList(bp, (*Table)(unsafe.Pointer(p)).FzName, (*Column)(unsafe.Pointer(pCol)).FzCnName, Xsqlite3ColumnType(tls, pCol, ts+1544)))
 115036 				} else {
 115037 					Xsqlite3ErrorMsg(tls, pParse, ts+14202,
 115038 						libc.VaList(bp+24, (*Table)(unsafe.Pointer(p)).FzName, (*Column)(unsafe.Pointer(pCol)).FzCnName))
 115039 				}
 115040 				return
 115041 			} else if int32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf0>>4) == COLTYPE_ANY {
 115042 				(*Column)(unsafe.Pointer(pCol)).Faffinity = int8(SQLITE_AFF_BLOB)
 115043 			}
 115044 			if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_PRIMKEY != 0 &&
 115045 				int32((*Table)(unsafe.Pointer(p)).FiPKey) != ii &&
 115046 				int32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0) == OE_None {
 115047 				libc.SetBitFieldPtr8Uint32(pCol+8, uint32(OE_Abort), 0, 0xf)
 115048 				*(*U32)(unsafe.Pointer(p + 48)) |= U32(TF_HasNotNull)
 115049 			}
 115050 		}
 115051 	}
 115052 
 115053 	if tabOpts&U32(TF_WithoutRowid) != 0 {
 115054 		if (*Table)(unsafe.Pointer(p)).FtabFlags&U32(TF_Autoincrement) != 0 {
 115055 			Xsqlite3ErrorMsg(tls, pParse,
 115056 				ts+14229, 0)
 115057 			return
 115058 		}
 115059 		if (*Table)(unsafe.Pointer(p)).FtabFlags&U32(TF_HasPrimaryKey) == U32(0) {
 115060 			Xsqlite3ErrorMsg(tls, pParse, ts+14279, libc.VaList(bp+40, (*Table)(unsafe.Pointer(p)).FzName))
 115061 			return
 115062 		}
 115063 		*(*U32)(unsafe.Pointer(p + 48)) |= U32(TF_WithoutRowid | TF_NoVisibleRowid)
 115064 		convertToWithoutRowidTable(tls, pParse, p)
 115065 	}
 115066 	iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(p)).FpSchema)
 115067 
 115068 	if (*Table)(unsafe.Pointer(p)).FpCheck != 0 {
 115069 		Xsqlite3ResolveSelfReference(tls, pParse, p, NC_IsCheck, uintptr(0), (*Table)(unsafe.Pointer(p)).FpCheck)
 115070 		if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 115071 			Xsqlite3ExprListDelete(tls, db, (*Table)(unsafe.Pointer(p)).FpCheck)
 115072 			(*Table)(unsafe.Pointer(p)).FpCheck = uintptr(0)
 115073 		} else {
 115074 		}
 115075 	}
 115076 	if (*Table)(unsafe.Pointer(p)).FtabFlags&U32(TF_HasGenerated) != 0 {
 115077 		var ii int32
 115078 		var nNG int32 = 0
 115079 
 115080 		for ii = 0; ii < int32((*Table)(unsafe.Pointer(p)).FnCol); ii++ {
 115081 			var colFlags U32 = U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol + uintptr(ii)*24)).FcolFlags)
 115082 			if colFlags&U32(COLFLAG_GENERATED) != U32(0) {
 115083 				var pX uintptr = Xsqlite3ColumnExpr(tls, p, (*Table)(unsafe.Pointer(p)).FaCol+uintptr(ii)*24)
 115084 
 115085 				if Xsqlite3ResolveSelfReference(tls, pParse, p, NC_GenCol, pX, uintptr(0)) != 0 {
 115086 					Xsqlite3ColumnSetExpr(tls, pParse, p, (*Table)(unsafe.Pointer(p)).FaCol+uintptr(ii)*24,
 115087 						Xsqlite3ExprAlloc(tls, db, TK_NULL, uintptr(0), 0))
 115088 				}
 115089 			} else {
 115090 				nNG++
 115091 			}
 115092 		}
 115093 		if nNG == 0 {
 115094 			Xsqlite3ErrorMsg(tls, pParse, ts+14311, 0)
 115095 			return
 115096 		}
 115097 	}
 115098 
 115099 	estimateTableWidth(tls, p)
 115100 	for pIdx = (*Table)(unsafe.Pointer(p)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
 115101 		estimateIndexWidth(tls, pIdx)
 115102 	}
 115103 
 115104 	if !(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0) {
 115105 		var n int32
 115106 		var v uintptr
 115107 		var zType uintptr
 115108 		var zType2 uintptr
 115109 		var zStmt uintptr
 115110 
 115111 		v = Xsqlite3GetVdbe(tls, pParse)
 115112 		if v == uintptr(0) {
 115113 			return
 115114 		}
 115115 
 115116 		Xsqlite3VdbeAddOp1(tls, v, OP_Close, 0)
 115117 
 115118 		if int32((*Table)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM {
 115119 			zType = ts + 10228
 115120 			zType2 = ts + 14355
 115121 		} else {
 115122 			zType = ts + 11843
 115123 			zType2 = ts + 14361
 115124 		}
 115125 
 115126 		if pSelect != 0 {
 115127 			var regYield int32
 115128 			var addrTop int32
 115129 			var regRec int32
 115130 			var regRowid int32
 115131 			var addrInsLoop int32
 115132 			var pSelTab uintptr
 115133 
 115134 			if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL {
 115135 				(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR
 115136 				(*Parse)(unsafe.Pointer(pParse)).FnErr++
 115137 				return
 115138 			}
 115139 			regYield = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 115140 			regRec = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 115141 			regRowid = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 115142 
 115143 			Xsqlite3MayAbort(tls, pParse)
 115144 			Xsqlite3VdbeAddOp3(tls, v, OP_OpenWrite, 1, (*Parse)(unsafe.Pointer(pParse)).FregRoot, iDb)
 115145 			Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_P2ISREG))
 115146 			(*Parse)(unsafe.Pointer(pParse)).FnTab = 2
 115147 			addrTop = Xsqlite3VdbeCurrentAddr(tls, v) + 1
 115148 			Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regYield, 0, addrTop)
 115149 			if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 115150 				return
 115151 			}
 115152 			pSelTab = Xsqlite3ResultSetOfSelect(tls, pParse, pSelect, int8(SQLITE_AFF_BLOB))
 115153 			if pSelTab == uintptr(0) {
 115154 				return
 115155 			}
 115156 
 115157 			(*Table)(unsafe.Pointer(p)).FnCol = libc.AssignPtrInt16(p+56, (*Table)(unsafe.Pointer(pSelTab)).FnCol)
 115158 			(*Table)(unsafe.Pointer(p)).FaCol = (*Table)(unsafe.Pointer(pSelTab)).FaCol
 115159 			(*Table)(unsafe.Pointer(pSelTab)).FnCol = int16(0)
 115160 			(*Table)(unsafe.Pointer(pSelTab)).FaCol = uintptr(0)
 115161 			Xsqlite3DeleteTable(tls, db, pSelTab)
 115162 			Xsqlite3SelectDestInit(tls, bp+144, SRT_Coroutine, regYield)
 115163 			Xsqlite3Select(tls, pParse, pSelect, bp+144)
 115164 			if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 115165 				return
 115166 			}
 115167 			Xsqlite3VdbeEndCoroutine(tls, v, regYield)
 115168 			Xsqlite3VdbeJumpHere(tls, v, addrTop-1)
 115169 			addrInsLoop = Xsqlite3VdbeAddOp1(tls, v, OP_Yield, (*SelectDest)(unsafe.Pointer(bp+144)).FiSDParm)
 115170 
 115171 			Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, (*SelectDest)(unsafe.Pointer(bp+144)).FiSdst, (*SelectDest)(unsafe.Pointer(bp+144)).FnSdst, regRec)
 115172 			Xsqlite3TableAffinity(tls, v, p, 0)
 115173 			Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, 1, regRowid)
 115174 			Xsqlite3VdbeAddOp3(tls, v, OP_Insert, 1, regRec, regRowid)
 115175 			Xsqlite3VdbeGoto(tls, v, addrInsLoop)
 115176 			Xsqlite3VdbeJumpHere(tls, v, addrInsLoop)
 115177 			Xsqlite3VdbeAddOp1(tls, v, OP_Close, 1)
 115178 		}
 115179 
 115180 		if pSelect != 0 {
 115181 			zStmt = createTableStmt(tls, db, p)
 115182 		} else {
 115183 			var pEnd2 uintptr
 115184 			if tabOpts != 0 {
 115185 				pEnd2 = pParse + 288
 115186 			} else {
 115187 				pEnd2 = pEnd
 115188 			}
 115189 			n = int32((int64((*Token)(unsafe.Pointer(pEnd2)).Fz) - int64((*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) / 1)
 115190 			if int32(*(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(pEnd2)).Fz))) != ';' {
 115191 				n = int32(uint32(n) + (*Token)(unsafe.Pointer(pEnd2)).Fn)
 115192 			}
 115193 			zStmt = Xsqlite3MPrintf(tls, db,
 115194 				ts+14366, libc.VaList(bp+48, zType2, n, (*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz))
 115195 		}
 115196 
 115197 		Xsqlite3NestedParse(tls, pParse,
 115198 			ts+14381,
 115199 			libc.VaList(bp+72, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName,
 115200 				zType,
 115201 				(*Table)(unsafe.Pointer(p)).FzName,
 115202 				(*Table)(unsafe.Pointer(p)).FzName,
 115203 				(*Parse)(unsafe.Pointer(pParse)).FregRoot,
 115204 				zStmt,
 115205 				(*Parse)(unsafe.Pointer(pParse)).FregRowid))
 115206 		Xsqlite3DbFree(tls, db, zStmt)
 115207 		Xsqlite3ChangeCookie(tls, pParse, iDb)
 115208 
 115209 		if (*Table)(unsafe.Pointer(p)).FtabFlags&U32(TF_Autoincrement) != U32(0) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL) {
 115210 			var pDb uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32
 115211 
 115212 			if (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab == uintptr(0) {
 115213 				Xsqlite3NestedParse(tls, pParse,
 115214 					ts+14479,
 115215 					libc.VaList(bp+128, (*Db)(unsafe.Pointer(pDb)).FzDbSName))
 115216 			}
 115217 		}
 115218 
 115219 		Xsqlite3VdbeAddParseSchemaOp(tls, v, iDb,
 115220 			Xsqlite3MPrintf(tls, db, ts+14521, libc.VaList(bp+136, (*Table)(unsafe.Pointer(p)).FzName)), uint16(0))
 115221 	}
 115222 
 115223 	if (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 {
 115224 		var pOld uintptr
 115225 		var pSchema uintptr = (*Table)(unsafe.Pointer(p)).FpSchema
 115226 
 115227 		pOld = Xsqlite3HashInsert(tls, pSchema+8, (*Table)(unsafe.Pointer(p)).FzName, p)
 115228 		if pOld != 0 {
 115229 			Xsqlite3OomFault(tls, db)
 115230 			return
 115231 		}
 115232 		(*Parse)(unsafe.Pointer(pParse)).FpNewTable = uintptr(0)
 115233 		*(*U32)(unsafe.Pointer(db + 44)) |= U32(DBFLAG_SchemaChange)
 115234 
 115235 		if libc.Xstrcmp(tls, (*Table)(unsafe.Pointer(p)).FzName, ts+10750) == 0 {
 115236 			(*Schema)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p
 115237 		}
 115238 	}
 115239 
 115240 	if !(pSelect != 0) && int32((*Table)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM {
 115241 		if (*Token)(unsafe.Pointer(pCons)).Fz == uintptr(0) {
 115242 			pCons = pEnd
 115243 		}
 115244 		*(*int32)(unsafe.Pointer(p + 64)) = 13 + int32((int64((*Token)(unsafe.Pointer(pCons)).Fz)-int64((*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz))/1)
 115245 	}
 115246 }
 115247 
 115248 // The parser calls this routine in order to create a new VIEW
 115249 func Xsqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 uintptr, pName2 uintptr, pCNames uintptr, pSelect uintptr, isTemp int32, noErr int32) {
 115250 	bp := tls.Alloc(120)
 115251 	defer tls.Free(120)
 115252 
 115253 	var p uintptr
 115254 	var n int32
 115255 	var z uintptr
 115256 
 115257 	var iDb int32
 115258 	var db uintptr
 115259 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 115260 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 115261 
 115262 	if !(int32((*Parse)(unsafe.Pointer(pParse)).FnVar) > 0) {
 115263 		goto __1
 115264 	}
 115265 	Xsqlite3ErrorMsg(tls, pParse, ts+14555, 0)
 115266 	goto create_view_fail
 115267 __1:
 115268 	;
 115269 	Xsqlite3StartTable(tls, pParse, pName1, pName2, isTemp, 1, 0, noErr)
 115270 	p = (*Parse)(unsafe.Pointer(pParse)).FpNewTable
 115271 	if !(p == uintptr(0) || (*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
 115272 		goto __2
 115273 	}
 115274 	goto create_view_fail
 115275 __2:
 115276 	;
 115277 	*(*U32)(unsafe.Pointer(p + 48)) |= U32(TF_NoVisibleRowid)
 115278 
 115279 	Xsqlite3TwoPartName(tls, pParse, pName1, pName2, bp)
 115280 	iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(p)).FpSchema)
 115281 	Xsqlite3FixInit(tls, bp+8, pParse, iDb, ts+11843, *(*uintptr)(unsafe.Pointer(bp)))
 115282 	if !(Xsqlite3FixSelect(tls, bp+8, pSelect) != 0) {
 115283 		goto __3
 115284 	}
 115285 	goto create_view_fail
 115286 __3:
 115287 	;
 115288 	*(*U32)(unsafe.Pointer(pSelect + 4)) |= U32(SF_View)
 115289 	if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 115290 		goto __4
 115291 	}
 115292 	*(*uintptr)(unsafe.Pointer(p + 64)) = pSelect
 115293 	pSelect = uintptr(0)
 115294 	goto __5
 115295 __4:
 115296 	*(*uintptr)(unsafe.Pointer(p + 64)) = Xsqlite3SelectDup(tls, db, pSelect, EXPRDUP_REDUCE)
 115297 __5:
 115298 	;
 115299 	(*Table)(unsafe.Pointer(p)).FpCheck = Xsqlite3ExprListDup(tls, db, pCNames, EXPRDUP_REDUCE)
 115300 	(*Table)(unsafe.Pointer(p)).FeTabType = U8(TABTYP_VIEW)
 115301 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 115302 		goto __6
 115303 	}
 115304 	goto create_view_fail
 115305 __6:
 115306 	;
 115307 	*(*Token)(unsafe.Pointer(bp + 104)) = (*Parse)(unsafe.Pointer(pParse)).FsLastToken
 115308 
 115309 	if !(int32(*(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(bp + 104)).Fz))) != ';') {
 115310 		goto __7
 115311 	}
 115312 	*(*uintptr)(unsafe.Pointer(bp + 104)) += uintptr((*Token)(unsafe.Pointer(bp + 104)).Fn)
 115313 __7:
 115314 	;
 115315 	(*Token)(unsafe.Pointer(bp + 104)).Fn = uint32(0)
 115316 	n = int32((int64((*Token)(unsafe.Pointer(bp+104)).Fz) - int64((*Token)(unsafe.Pointer(pBegin)).Fz)) / 1)
 115317 
 115318 	z = (*Token)(unsafe.Pointer(pBegin)).Fz
 115319 __8:
 115320 	if !(int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(n-1))))])&0x01 != 0) {
 115321 		goto __9
 115322 	}
 115323 	n--
 115324 	goto __8
 115325 __9:
 115326 	;
 115327 	(*Token)(unsafe.Pointer(bp + 104)).Fz = z + uintptr(n-1)
 115328 	(*Token)(unsafe.Pointer(bp + 104)).Fn = uint32(1)
 115329 
 115330 	Xsqlite3EndTable(tls, pParse, uintptr(0), bp+104, uint32(0), uintptr(0))
 115331 
 115332 create_view_fail:
 115333 	Xsqlite3SelectDelete(tls, db, pSelect)
 115334 	if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 115335 		goto __10
 115336 	}
 115337 	Xsqlite3RenameExprlistUnmap(tls, pParse, pCNames)
 115338 __10:
 115339 	;
 115340 	Xsqlite3ExprListDelete(tls, db, pCNames)
 115341 	return
 115342 }
 115343 
 115344 func viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) int32 {
 115345 	bp := tls.Alloc(8)
 115346 	defer tls.Free(8)
 115347 
 115348 	var pSelTab uintptr
 115349 	var pSel uintptr
 115350 	var nErr int32 = 0
 115351 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 115352 	var rc int32
 115353 	var xAuth Sqlite3_xauth
 115354 
 115355 	if int32((*Table)(unsafe.Pointer(pTable)).FeTabType) == TABTYP_VTAB {
 115356 		(*Sqlite3)(unsafe.Pointer(db)).FnSchemaLock++
 115357 		rc = Xsqlite3VtabCallConnect(tls, pParse, pTable)
 115358 		(*Sqlite3)(unsafe.Pointer(db)).FnSchemaLock--
 115359 		return rc
 115360 	}
 115361 
 115362 	if int32((*Table)(unsafe.Pointer(pTable)).FnCol) < 0 {
 115363 		Xsqlite3ErrorMsg(tls, pParse, ts+14591, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName))
 115364 		return 1
 115365 	}
 115366 
 115367 	pSel = Xsqlite3SelectDup(tls, db, *(*uintptr)(unsafe.Pointer(pTable + 64)), 0)
 115368 	if pSel != 0 {
 115369 		var eParseMode U8 = (*Parse)(unsafe.Pointer(pParse)).FeParseMode
 115370 		var nTab int32 = (*Parse)(unsafe.Pointer(pParse)).FnTab
 115371 		var nSelect int32 = (*Parse)(unsafe.Pointer(pParse)).FnSelect
 115372 		(*Parse)(unsafe.Pointer(pParse)).FeParseMode = U8(PARSE_MODE_NORMAL)
 115373 		Xsqlite3SrcListAssignCursors(tls, pParse, (*Select)(unsafe.Pointer(pSel)).FpSrc)
 115374 		(*Table)(unsafe.Pointer(pTable)).FnCol = int16(-1)
 115375 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++
 115376 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0)
 115377 		xAuth = (*Sqlite3)(unsafe.Pointer(db)).FxAuth
 115378 		(*Sqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0)
 115379 		pSelTab = Xsqlite3ResultSetOfSelect(tls, pParse, pSel, int8(SQLITE_AFF_NONE))
 115380 		(*Sqlite3)(unsafe.Pointer(db)).FxAuth = xAuth
 115381 		(*Parse)(unsafe.Pointer(pParse)).FnTab = nTab
 115382 		(*Parse)(unsafe.Pointer(pParse)).FnSelect = nSelect
 115383 		if pSelTab == uintptr(0) {
 115384 			(*Table)(unsafe.Pointer(pTable)).FnCol = int16(0)
 115385 			nErr++
 115386 		} else if (*Table)(unsafe.Pointer(pTable)).FpCheck != 0 {
 115387 			Xsqlite3ColumnsFromExprList(tls, pParse, (*Table)(unsafe.Pointer(pTable)).FpCheck,
 115388 				pTable+54, pTable+8)
 115389 			if (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 &&
 115390 				int32((*Table)(unsafe.Pointer(pTable)).FnCol) == (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpEList)).FnExpr {
 115391 				Xsqlite3SubqueryColumnTypes(tls, pParse, pTable, pSel, int8(SQLITE_AFF_NONE))
 115392 			}
 115393 		} else {
 115394 			(*Table)(unsafe.Pointer(pTable)).FnCol = (*Table)(unsafe.Pointer(pSelTab)).FnCol
 115395 			(*Table)(unsafe.Pointer(pTable)).FaCol = (*Table)(unsafe.Pointer(pSelTab)).FaCol
 115396 			*(*U32)(unsafe.Pointer(pTable + 48)) |= (*Table)(unsafe.Pointer(pSelTab)).FtabFlags & U32(COLFLAG_NOINSERT)
 115397 			(*Table)(unsafe.Pointer(pSelTab)).FnCol = int16(0)
 115398 			(*Table)(unsafe.Pointer(pSelTab)).FaCol = uintptr(0)
 115399 
 115400 		}
 115401 		(*Table)(unsafe.Pointer(pTable)).FnNVCol = (*Table)(unsafe.Pointer(pTable)).FnCol
 115402 		Xsqlite3DeleteTable(tls, db, pSelTab)
 115403 		Xsqlite3SelectDelete(tls, db, pSel)
 115404 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable--
 115405 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = func() uint16 {
 115406 			if (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable != 0 {
 115407 				return uint16(0)
 115408 			}
 115409 			return (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue
 115410 		}()
 115411 		(*Parse)(unsafe.Pointer(pParse)).FeParseMode = eParseMode
 115412 	} else {
 115413 		nErr++
 115414 	}
 115415 	*(*U16)(unsafe.Pointer((*Table)(unsafe.Pointer(pTable)).FpSchema + 114)) |= U16(DB_UnresetViews)
 115416 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 115417 		Xsqlite3DeleteColumnNames(tls, db, pTable)
 115418 	}
 115419 	return nErr
 115420 }
 115421 
 115422 func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) int32 {
 115423 	if !(int32((*Table)(unsafe.Pointer(pTable)).FeTabType) == TABTYP_VTAB) && int32((*Table)(unsafe.Pointer(pTable)).FnCol) > 0 {
 115424 		return 0
 115425 	}
 115426 	return viewGetColumnNames(tls, pParse, pTable)
 115427 }
 115428 
 115429 func sqliteViewResetAll(tls *libc.TLS, db uintptr, idx int32) {
 115430 	var i uintptr
 115431 
 115432 	if !(int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(idx)*32)).FpSchema)).FschemaFlags)&DB_UnresetViews == DB_UnresetViews) {
 115433 		return
 115434 	}
 115435 	for i = (*Hash)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(idx)*32)).FpSchema + 8)).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
 115436 		var pTab uintptr = (*HashElem)(unsafe.Pointer(i)).Fdata
 115437 		if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW {
 115438 			Xsqlite3DeleteColumnNames(tls, db, pTab)
 115439 		}
 115440 	}
 115441 	*(*U16)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(idx)*32)).FpSchema + 114)) &= libc.Uint16FromInt32(libc.CplInt32(DB_UnresetViews))
 115442 }
 115443 
 115444 // This function is called by the VDBE to adjust the internal schema
 115445 // used by SQLite when the btree layer moves a table root page. The
 115446 // root-page of a table or index in database iDb has changed from iFrom
 115447 // to iTo.
 115448 //
 115449 // Ticket #1728:  The symbol table might still contain information
 115450 // on tables and/or indices that are the process of being deleted.
 115451 // If you are unlucky, one of those deleted indices or tables might
 115452 // have the same rootpage number as the real table or index that is
 115453 // being moved.  So we cannot stop searching after the first match
 115454 // because the first match might be for one of the deleted indices
 115455 // or tables and not the table/index that is actually being moved.
 115456 // We must continue looping until all tables and indices with
 115457 // rootpage==iFrom have been converted to have a rootpage of iTo
 115458 // in order to be certain that we got the right one.
 115459 func Xsqlite3RootPageMoved(tls *libc.TLS, db uintptr, iDb int32, iFrom Pgno, iTo Pgno) {
 115460 	var pElem uintptr
 115461 	var pHash uintptr
 115462 	var pDb uintptr
 115463 
 115464 	pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32
 115465 	pHash = (*Db)(unsafe.Pointer(pDb)).FpSchema + 8
 115466 	for pElem = (*Hash)(unsafe.Pointer(pHash)).Ffirst; pElem != 0; pElem = (*HashElem)(unsafe.Pointer(pElem)).Fnext {
 115467 		var pTab uintptr = (*HashElem)(unsafe.Pointer(pElem)).Fdata
 115468 		if (*Table)(unsafe.Pointer(pTab)).Ftnum == iFrom {
 115469 			(*Table)(unsafe.Pointer(pTab)).Ftnum = iTo
 115470 		}
 115471 	}
 115472 	pHash = (*Db)(unsafe.Pointer(pDb)).FpSchema + 32
 115473 	for pElem = (*Hash)(unsafe.Pointer(pHash)).Ffirst; pElem != 0; pElem = (*HashElem)(unsafe.Pointer(pElem)).Fnext {
 115474 		var pIdx uintptr = (*HashElem)(unsafe.Pointer(pElem)).Fdata
 115475 		if (*Index)(unsafe.Pointer(pIdx)).Ftnum == iFrom {
 115476 			(*Index)(unsafe.Pointer(pIdx)).Ftnum = iTo
 115477 		}
 115478 	}
 115479 }
 115480 
 115481 func destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) {
 115482 	bp := tls.Alloc(32)
 115483 	defer tls.Free(32)
 115484 
 115485 	var v uintptr = Xsqlite3GetVdbe(tls, pParse)
 115486 	var r1 int32 = Xsqlite3GetTempReg(tls, pParse)
 115487 	if iTable < 2 {
 115488 		Xsqlite3ErrorMsg(tls, pParse, ts+14621, 0)
 115489 	}
 115490 	Xsqlite3VdbeAddOp3(tls, v, OP_Destroy, iTable, r1, iDb)
 115491 	Xsqlite3MayAbort(tls, pParse)
 115492 
 115493 	Xsqlite3NestedParse(tls, pParse,
 115494 		ts+14636,
 115495 		libc.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb+uintptr(iDb)*32)).FzDbSName, iTable, r1, r1))
 115496 	Xsqlite3ReleaseTempReg(tls, pParse, r1)
 115497 }
 115498 
 115499 func destroyTable(tls *libc.TLS, pParse uintptr, pTab uintptr) {
 115500 	var iTab Pgno = (*Table)(unsafe.Pointer(pTab)).Ftnum
 115501 	var iDestroyed Pgno = Pgno(0)
 115502 
 115503 	for 1 != 0 {
 115504 		var pIdx uintptr
 115505 		var iLargest Pgno = Pgno(0)
 115506 
 115507 		if iDestroyed == Pgno(0) || iTab < iDestroyed {
 115508 			iLargest = iTab
 115509 		}
 115510 		for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
 115511 			var iIdx Pgno = (*Index)(unsafe.Pointer(pIdx)).Ftnum
 115512 
 115513 			if (iDestroyed == Pgno(0) || iIdx < iDestroyed) && iIdx > iLargest {
 115514 				iLargest = iIdx
 115515 			}
 115516 		}
 115517 		if iLargest == Pgno(0) {
 115518 			return
 115519 		} else {
 115520 			var iDb int32 = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Table)(unsafe.Pointer(pTab)).FpSchema)
 115521 
 115522 			destroyRootPage(tls, pParse, int32(iLargest), iDb)
 115523 			iDestroyed = iLargest
 115524 		}
 115525 	}
 115526 }
 115527 
 115528 func sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uintptr, zName uintptr) {
 115529 	bp := tls.Alloc(64)
 115530 	defer tls.Free(64)
 115531 
 115532 	var i int32
 115533 	var zDbName uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32)).FzDbSName
 115534 	for i = 1; i <= 4; i++ {
 115535 		Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([24]int8{})), bp+40, ts+14703, libc.VaList(bp, i))
 115536 		if Xsqlite3FindTable(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, bp+40, zDbName) != 0 {
 115537 			Xsqlite3NestedParse(tls, pParse,
 115538 				ts+12652,
 115539 				libc.VaList(bp+8, zDbName, bp+40, zType, zName))
 115540 		}
 115541 	}
 115542 }
 115543 
 115544 // Generate code to drop a table.
 115545 func Xsqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int32, isView int32) {
 115546 	bp := tls.Alloc(32)
 115547 	defer tls.Free(32)
 115548 
 115549 	var v uintptr
 115550 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 115551 	var pTrigger uintptr
 115552 	var pDb uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32
 115553 
 115554 	v = Xsqlite3GetVdbe(tls, pParse)
 115555 
 115556 	Xsqlite3BeginWriteOperation(tls, pParse, 1, iDb)
 115557 
 115558 	if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
 115559 		Xsqlite3VdbeAddOp0(tls, v, OP_VBegin)
 115560 	}
 115561 
 115562 	pTrigger = Xsqlite3TriggerList(tls, pParse, pTab)
 115563 	for pTrigger != 0 {
 115564 		Xsqlite3DropTriggerPtr(tls, pParse, pTrigger)
 115565 		pTrigger = (*Trigger)(unsafe.Pointer(pTrigger)).FpNext
 115566 	}
 115567 
 115568 	if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Autoincrement) != 0 {
 115569 		Xsqlite3NestedParse(tls, pParse,
 115570 			ts+14717,
 115571 			libc.VaList(bp, (*Db)(unsafe.Pointer(pDb)).FzDbSName, (*Table)(unsafe.Pointer(pTab)).FzName))
 115572 	}
 115573 
 115574 	Xsqlite3NestedParse(tls, pParse,
 115575 		ts+14762,
 115576 		libc.VaList(bp+16, (*Db)(unsafe.Pointer(pDb)).FzDbSName, (*Table)(unsafe.Pointer(pTab)).FzName))
 115577 	if !(isView != 0) && !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
 115578 		destroyTable(tls, pParse, pTab)
 115579 	}
 115580 
 115581 	if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
 115582 		Xsqlite3VdbeAddOp4(tls, v, OP_VDestroy, iDb, 0, 0, (*Table)(unsafe.Pointer(pTab)).FzName, 0)
 115583 		Xsqlite3MayAbort(tls, pParse)
 115584 	}
 115585 	Xsqlite3VdbeAddOp4(tls, v, OP_DropTable, iDb, 0, 0, (*Table)(unsafe.Pointer(pTab)).FzName, 0)
 115586 	Xsqlite3ChangeCookie(tls, pParse, iDb)
 115587 	sqliteViewResetAll(tls, db, iDb)
 115588 }
 115589 
 115590 // Return TRUE if shadow tables should be read-only in the current
 115591 // context.
 115592 func Xsqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) int32 {
 115593 	if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_Defensive) != uint64(0) &&
 115594 		(*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx == uintptr(0) &&
 115595 		(*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec == 0 &&
 115596 		!((*Sqlite3)(unsafe.Pointer(db)).FnVTrans > 0 && (*Sqlite3)(unsafe.Pointer(db)).FaVTrans == uintptr(0)) {
 115597 		return 1
 115598 	}
 115599 	return 0
 115600 }
 115601 
 115602 func tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) int32 {
 115603 	if Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+7733, 7) == 0 {
 115604 		if Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName+uintptr(7), ts+14829, 4) == 0 {
 115605 			return 0
 115606 		}
 115607 		if Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName+uintptr(7), ts+8474, 10) == 0 {
 115608 			return 0
 115609 		}
 115610 		return 1
 115611 	}
 115612 	if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Shadow) != U32(0) && Xsqlite3ReadOnlyShadowTables(tls, db) != 0 {
 115613 		return 1
 115614 	}
 115615 	if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Eponymous) != 0 {
 115616 		return 1
 115617 	}
 115618 	return 0
 115619 }
 115620 
 115621 // This routine is called to do the work of a DROP TABLE statement.
 115622 // pName is the name of the table to be dropped.
 115623 func Xsqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int32, noErr int32) {
 115624 	bp := tls.Alloc(24)
 115625 	defer tls.Free(24)
 115626 
 115627 	var pTab uintptr
 115628 	var v uintptr
 115629 	var db uintptr
 115630 	var iDb int32
 115631 	var code int32
 115632 	var zTab uintptr
 115633 	var zDb uintptr
 115634 	var zArg2 uintptr
 115635 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 115636 
 115637 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 115638 		goto __1
 115639 	}
 115640 	goto exit_drop_table
 115641 __1:
 115642 	;
 115643 	if !(Xsqlite3ReadSchema(tls, pParse) != 0) {
 115644 		goto __2
 115645 	}
 115646 	goto exit_drop_table
 115647 __2:
 115648 	;
 115649 	if !(noErr != 0) {
 115650 		goto __3
 115651 	}
 115652 	(*Sqlite3)(unsafe.Pointer(db)).FsuppressErr++
 115653 __3:
 115654 	;
 115655 	pTab = Xsqlite3LocateTableItem(tls, pParse, uint32(isView), pName+8)
 115656 	if !(noErr != 0) {
 115657 		goto __4
 115658 	}
 115659 	(*Sqlite3)(unsafe.Pointer(db)).FsuppressErr--
 115660 __4:
 115661 	;
 115662 	if !(pTab == uintptr(0)) {
 115663 		goto __5
 115664 	}
 115665 	if !(noErr != 0) {
 115666 		goto __6
 115667 	}
 115668 	Xsqlite3CodeVerifyNamedSchema(tls, pParse, (*SrcItem)(unsafe.Pointer(pName+8)).FzDatabase)
 115669 	sqlite3ForceNotReadOnly(tls, pParse)
 115670 __6:
 115671 	;
 115672 	goto exit_drop_table
 115673 __5:
 115674 	;
 115675 	iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
 115676 
 115677 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB && Xsqlite3ViewGetColumnNames(tls, pParse, pTab) != 0) {
 115678 		goto __7
 115679 	}
 115680 	goto exit_drop_table
 115681 __7:
 115682 	;
 115683 	zTab = func() uintptr {
 115684 		if !(0 != 0) && iDb == 1 {
 115685 			return ts + 7741
 115686 		}
 115687 		return ts + 7235
 115688 	}()
 115689 	zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
 115690 	zArg2 = uintptr(0)
 115691 	if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_DELETE, zTab, uintptr(0), zDb) != 0) {
 115692 		goto __8
 115693 	}
 115694 	goto exit_drop_table
 115695 __8:
 115696 	;
 115697 	if !(isView != 0) {
 115698 		goto __9
 115699 	}
 115700 	if !(!(0 != 0) && iDb == 1) {
 115701 		goto __11
 115702 	}
 115703 	code = SQLITE_DROP_TEMP_VIEW
 115704 	goto __12
 115705 __11:
 115706 	code = SQLITE_DROP_VIEW
 115707 __12:
 115708 	;
 115709 	goto __10
 115710 __9:
 115711 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
 115712 		goto __13
 115713 	}
 115714 	code = SQLITE_DROP_VTABLE
 115715 	zArg2 = (*Module)(unsafe.Pointer((*VTable)(unsafe.Pointer(Xsqlite3GetVTable(tls, db, pTab))).FpMod)).FzName
 115716 	goto __14
 115717 __13:
 115718 	if !(!(0 != 0) && iDb == 1) {
 115719 		goto __15
 115720 	}
 115721 	code = SQLITE_DROP_TEMP_TABLE
 115722 	goto __16
 115723 __15:
 115724 	code = SQLITE_DROP_TABLE
 115725 __16:
 115726 	;
 115727 __14:
 115728 	;
 115729 __10:
 115730 	;
 115731 	if !(Xsqlite3AuthCheck(tls, pParse, code, (*Table)(unsafe.Pointer(pTab)).FzName, zArg2, zDb) != 0) {
 115732 		goto __17
 115733 	}
 115734 	goto exit_drop_table
 115735 __17:
 115736 	;
 115737 	if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_DELETE, (*Table)(unsafe.Pointer(pTab)).FzName, uintptr(0), zDb) != 0) {
 115738 		goto __18
 115739 	}
 115740 	goto exit_drop_table
 115741 __18:
 115742 	;
 115743 	if !(tableMayNotBeDropped(tls, db, pTab) != 0) {
 115744 		goto __19
 115745 	}
 115746 	Xsqlite3ErrorMsg(tls, pParse, ts+14834, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
 115747 	goto exit_drop_table
 115748 __19:
 115749 	;
 115750 	if !(isView != 0 && !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW)) {
 115751 		goto __20
 115752 	}
 115753 	Xsqlite3ErrorMsg(tls, pParse, ts+14862, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
 115754 	goto exit_drop_table
 115755 __20:
 115756 	;
 115757 	if !(!(isView != 0) && int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW) {
 115758 		goto __21
 115759 	}
 115760 	Xsqlite3ErrorMsg(tls, pParse, ts+14896, libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName))
 115761 	goto exit_drop_table
 115762 __21:
 115763 	;
 115764 	v = Xsqlite3GetVdbe(tls, pParse)
 115765 	if !(v != 0) {
 115766 		goto __22
 115767 	}
 115768 	Xsqlite3BeginWriteOperation(tls, pParse, 1, iDb)
 115769 	if !!(isView != 0) {
 115770 		goto __23
 115771 	}
 115772 	sqlite3ClearStatTables(tls, pParse, iDb, ts+12844, (*Table)(unsafe.Pointer(pTab)).FzName)
 115773 	Xsqlite3FkDropTable(tls, pParse, pName, pTab)
 115774 __23:
 115775 	;
 115776 	Xsqlite3CodeDropTable(tls, pParse, pTab, iDb, isView)
 115777 __22:
 115778 	;
 115779 exit_drop_table:
 115780 	Xsqlite3SrcListDelete(tls, db, pName)
 115781 }
 115782 
 115783 // This routine is called to create a new foreign key on the table
 115784 // currently under construction.  pFromCol determines which columns
 115785 // in the current table point to the foreign key.  If pFromCol==0 then
 115786 // connect the key to the last column inserted.  pTo is the name of
 115787 // the table referred to (a.k.a the "parent" table).  pToCol is a list
 115788 // of tables in the parent pTo table.  flags contains all
 115789 // information about the conflict resolution algorithms specified
 115790 // in the ON DELETE, ON UPDATE and ON INSERT clauses.
 115791 //
 115792 // An FKey structure is created and added to the table currently
 115793 // under construction in the pParse->pNewTable field.
 115794 //
 115795 // The foreign key is set for IMMEDIATE processing.  A subsequent call
 115796 // to sqlite3DeferForeignKey() might change this to DEFERRED.
 115797 func Xsqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, pTo uintptr, pToCol uintptr, flags int32) {
 115798 	bp := tls.Alloc(24)
 115799 	defer tls.Free(24)
 115800 
 115801 	var db uintptr
 115802 	var pFKey uintptr
 115803 	var pNextTo uintptr
 115804 	var p uintptr
 115805 	var nByte I64
 115806 	var i int32
 115807 	var nCol int32
 115808 	var z uintptr
 115809 	var iCol int32
 115810 	var j int32
 115811 	var n int32
 115812 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 115813 	pFKey = uintptr(0)
 115814 	p = (*Parse)(unsafe.Pointer(pParse)).FpNewTable
 115815 
 115816 	if !(p == uintptr(0) || int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) == PARSE_MODE_DECLARE_VTAB) {
 115817 		goto __1
 115818 	}
 115819 	goto fk_end
 115820 __1:
 115821 	;
 115822 	if !(pFromCol == uintptr(0)) {
 115823 		goto __2
 115824 	}
 115825 	iCol = int32((*Table)(unsafe.Pointer(p)).FnCol) - 1
 115826 	if !(iCol < 0) {
 115827 		goto __4
 115828 	}
 115829 	goto fk_end
 115830 __4:
 115831 	;
 115832 	if !(pToCol != 0 && (*ExprList)(unsafe.Pointer(pToCol)).FnExpr != 1) {
 115833 		goto __5
 115834 	}
 115835 	Xsqlite3ErrorMsg(tls, pParse,
 115836 		ts+14928,
 115837 		libc.VaList(bp, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(iCol)*24)).FzCnName, pTo))
 115838 	goto fk_end
 115839 __5:
 115840 	;
 115841 	nCol = 1
 115842 	goto __3
 115843 __2:
 115844 	if !(pToCol != 0 && (*ExprList)(unsafe.Pointer(pToCol)).FnExpr != (*ExprList)(unsafe.Pointer(pFromCol)).FnExpr) {
 115845 		goto __6
 115846 	}
 115847 	Xsqlite3ErrorMsg(tls, pParse,
 115848 		ts+14991, 0)
 115849 	goto fk_end
 115850 	goto __7
 115851 __6:
 115852 	nCol = (*ExprList)(unsafe.Pointer(pFromCol)).FnExpr
 115853 __7:
 115854 	;
 115855 __3:
 115856 	;
 115857 	nByte = I64(uint64(unsafe.Sizeof(FKey{})) + uint64(nCol-1)*uint64(unsafe.Sizeof(sColMap{})) + uint64((*Token)(unsafe.Pointer(pTo)).Fn) + uint64(1))
 115858 	if !(pToCol != 0) {
 115859 		goto __8
 115860 	}
 115861 	i = 0
 115862 __9:
 115863 	if !(i < (*ExprList)(unsafe.Pointer(pToCol)).FnExpr) {
 115864 		goto __11
 115865 	}
 115866 	nByte = nByte + I64(Xsqlite3Strlen30(tls, (*ExprList_item)(unsafe.Pointer(pToCol+8+uintptr(i)*32)).FzEName)+1)
 115867 	goto __10
 115868 __10:
 115869 	i++
 115870 	goto __9
 115871 	goto __11
 115872 __11:
 115873 	;
 115874 __8:
 115875 	;
 115876 	pFKey = Xsqlite3DbMallocZero(tls, db, uint64(nByte))
 115877 	if !(pFKey == uintptr(0)) {
 115878 		goto __12
 115879 	}
 115880 	goto fk_end
 115881 __12:
 115882 	;
 115883 	(*FKey)(unsafe.Pointer(pFKey)).FpFrom = p
 115884 
 115885 	(*FKey)(unsafe.Pointer(pFKey)).FpNextFrom = *(*uintptr)(unsafe.Pointer(p + 64 + 8))
 115886 	z = pFKey + 64 + uintptr(nCol)*16
 115887 	(*FKey)(unsafe.Pointer(pFKey)).FzTo = z
 115888 	if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 115889 		goto __13
 115890 	}
 115891 	Xsqlite3RenameTokenMap(tls, pParse, z, pTo)
 115892 __13:
 115893 	;
 115894 	libc.Xmemcpy(tls, z, (*Token)(unsafe.Pointer(pTo)).Fz, uint64((*Token)(unsafe.Pointer(pTo)).Fn))
 115895 	*(*int8)(unsafe.Pointer(z + uintptr((*Token)(unsafe.Pointer(pTo)).Fn))) = int8(0)
 115896 	Xsqlite3Dequote(tls, z)
 115897 	z += uintptr((*Token)(unsafe.Pointer(pTo)).Fn + uint32(1))
 115898 	(*FKey)(unsafe.Pointer(pFKey)).FnCol = nCol
 115899 	if !(pFromCol == uintptr(0)) {
 115900 		goto __14
 115901 	}
 115902 	(*sColMap)(unsafe.Pointer(pFKey + 64)).FiFrom = int32((*Table)(unsafe.Pointer(p)).FnCol) - 1
 115903 	goto __15
 115904 __14:
 115905 	i = 0
 115906 __16:
 115907 	if !(i < nCol) {
 115908 		goto __18
 115909 	}
 115910 	j = 0
 115911 __19:
 115912 	if !(j < int32((*Table)(unsafe.Pointer(p)).FnCol)) {
 115913 		goto __21
 115914 	}
 115915 	if !(Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(j)*24)).FzCnName, (*ExprList_item)(unsafe.Pointer(pFromCol+8+uintptr(i)*32)).FzEName) == 0) {
 115916 		goto __22
 115917 	}
 115918 	(*sColMap)(unsafe.Pointer(pFKey + 64 + uintptr(i)*16)).FiFrom = j
 115919 	goto __21
 115920 __22:
 115921 	;
 115922 	goto __20
 115923 __20:
 115924 	j++
 115925 	goto __19
 115926 	goto __21
 115927 __21:
 115928 	;
 115929 	if !(j >= int32((*Table)(unsafe.Pointer(p)).FnCol)) {
 115930 		goto __23
 115931 	}
 115932 	Xsqlite3ErrorMsg(tls, pParse,
 115933 		ts+15085,
 115934 		libc.VaList(bp+16, (*ExprList_item)(unsafe.Pointer(pFromCol+8+uintptr(i)*32)).FzEName))
 115935 	goto fk_end
 115936 __23:
 115937 	;
 115938 	if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 115939 		goto __24
 115940 	}
 115941 	Xsqlite3RenameTokenRemap(tls, pParse, pFKey+64+uintptr(i)*16, (*ExprList_item)(unsafe.Pointer(pFromCol+8+uintptr(i)*32)).FzEName)
 115942 __24:
 115943 	;
 115944 	goto __17
 115945 __17:
 115946 	i++
 115947 	goto __16
 115948 	goto __18
 115949 __18:
 115950 	;
 115951 __15:
 115952 	;
 115953 	if !(pToCol != 0) {
 115954 		goto __25
 115955 	}
 115956 	i = 0
 115957 __26:
 115958 	if !(i < nCol) {
 115959 		goto __28
 115960 	}
 115961 	n = Xsqlite3Strlen30(tls, (*ExprList_item)(unsafe.Pointer(pToCol+8+uintptr(i)*32)).FzEName)
 115962 	(*sColMap)(unsafe.Pointer(pFKey + 64 + uintptr(i)*16)).FzCol = z
 115963 	if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 115964 		goto __29
 115965 	}
 115966 	Xsqlite3RenameTokenRemap(tls, pParse, z, (*ExprList_item)(unsafe.Pointer(pToCol+8+uintptr(i)*32)).FzEName)
 115967 __29:
 115968 	;
 115969 	libc.Xmemcpy(tls, z, (*ExprList_item)(unsafe.Pointer(pToCol+8+uintptr(i)*32)).FzEName, uint64(n))
 115970 	*(*int8)(unsafe.Pointer(z + uintptr(n))) = int8(0)
 115971 	z += uintptr(n + 1)
 115972 	goto __27
 115973 __27:
 115974 	i++
 115975 	goto __26
 115976 	goto __28
 115977 __28:
 115978 	;
 115979 __25:
 115980 	;
 115981 	(*FKey)(unsafe.Pointer(pFKey)).FisDeferred = U8(0)
 115982 	*(*U8)(unsafe.Pointer(pFKey + 45)) = U8(flags & 0xff)
 115983 	*(*U8)(unsafe.Pointer(pFKey + 45 + 1)) = U8(flags >> 8 & 0xff)
 115984 
 115985 	pNextTo = Xsqlite3HashInsert(tls, (*Table)(unsafe.Pointer(p)).FpSchema+80,
 115986 		(*FKey)(unsafe.Pointer(pFKey)).FzTo, pFKey)
 115987 	if !(pNextTo == pFKey) {
 115988 		goto __30
 115989 	}
 115990 	Xsqlite3OomFault(tls, db)
 115991 	goto fk_end
 115992 __30:
 115993 	;
 115994 	if !(pNextTo != 0) {
 115995 		goto __31
 115996 	}
 115997 
 115998 	(*FKey)(unsafe.Pointer(pFKey)).FpNextTo = pNextTo
 115999 	(*FKey)(unsafe.Pointer(pNextTo)).FpPrevTo = pFKey
 116000 __31:
 116001 	;
 116002 	*(*uintptr)(unsafe.Pointer(p + 64 + 8)) = pFKey
 116003 	pFKey = uintptr(0)
 116004 
 116005 fk_end:
 116006 	Xsqlite3DbFree(tls, db, pFKey)
 116007 	Xsqlite3ExprListDelete(tls, db, pFromCol)
 116008 	Xsqlite3ExprListDelete(tls, db, pToCol)
 116009 }
 116010 
 116011 // This routine is called when an INITIALLY IMMEDIATE or INITIALLY DEFERRED
 116012 // clause is seen as part of a foreign key definition.  The isDeferred
 116013 // parameter is 1 for INITIALLY DEFERRED and 0 for INITIALLY IMMEDIATE.
 116014 // The behavior of the most recently created foreign key is adjusted
 116015 // accordingly.
 116016 func Xsqlite3DeferForeignKey(tls *libc.TLS, pParse uintptr, isDeferred int32) {
 116017 	var pTab uintptr
 116018 	var pFKey uintptr
 116019 	if libc.AssignUintptr(&pTab, (*Parse)(unsafe.Pointer(pParse)).FpNewTable) == uintptr(0) {
 116020 		return
 116021 	}
 116022 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM) {
 116023 		return
 116024 	}
 116025 	if libc.AssignUintptr(&pFKey, *(*uintptr)(unsafe.Pointer(pTab + 64 + 8))) == uintptr(0) {
 116026 		return
 116027 	}
 116028 
 116029 	(*FKey)(unsafe.Pointer(pFKey)).FisDeferred = U8(isDeferred)
 116030 }
 116031 
 116032 func sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootPage int32) {
 116033 	bp := tls.Alloc(4)
 116034 	defer tls.Free(4)
 116035 
 116036 	var pTab uintptr = (*Index)(unsafe.Pointer(pIndex)).FpTable
 116037 	var iTab int32 = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 116038 	var iIdx int32 = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 116039 	var iSorter int32
 116040 	var addr1 int32
 116041 	var addr2 int32
 116042 	var tnum Pgno
 116043 
 116044 	var v uintptr
 116045 	var pKey uintptr
 116046 	var regRecord int32
 116047 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 116048 	var iDb int32 = Xsqlite3SchemaToIndex(tls, db, (*Index)(unsafe.Pointer(pIndex)).FpSchema)
 116049 
 116050 	if Xsqlite3AuthCheck(tls, pParse, SQLITE_REINDEX, (*Index)(unsafe.Pointer(pIndex)).FzName, uintptr(0),
 116051 		(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName) != 0 {
 116052 		return
 116053 	}
 116054 
 116055 	Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, uint8(1), (*Table)(unsafe.Pointer(pTab)).FzName)
 116056 
 116057 	v = Xsqlite3GetVdbe(tls, pParse)
 116058 	if v == uintptr(0) {
 116059 		return
 116060 	}
 116061 	if memRootPage >= 0 {
 116062 		tnum = Pgno(memRootPage)
 116063 	} else {
 116064 		tnum = (*Index)(unsafe.Pointer(pIndex)).Ftnum
 116065 	}
 116066 	pKey = Xsqlite3KeyInfoOfIndex(tls, pParse, pIndex)
 116067 
 116068 	iSorter = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 116069 	Xsqlite3VdbeAddOp4(tls, v, OP_SorterOpen, iSorter, 0, int32((*Index)(unsafe.Pointer(pIndex)).FnKeyCol), Xsqlite3KeyInfoRef(tls, pKey), -8)
 116070 
 116071 	Xsqlite3OpenTable(tls, pParse, iTab, iDb, pTab, OP_OpenRead)
 116072 	addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, iTab, 0)
 116073 	regRecord = Xsqlite3GetTempReg(tls, pParse)
 116074 	Xsqlite3MultiWrite(tls, pParse)
 116075 
 116076 	Xsqlite3GenerateIndexKey(tls, pParse, pIndex, iTab, regRecord, 0, bp, uintptr(0), 0)
 116077 	Xsqlite3VdbeAddOp2(tls, v, OP_SorterInsert, iSorter, regRecord)
 116078 	Xsqlite3ResolvePartIdxLabel(tls, pParse, *(*int32)(unsafe.Pointer(bp)))
 116079 	Xsqlite3VdbeAddOp2(tls, v, OP_Next, iTab, addr1+1)
 116080 	Xsqlite3VdbeJumpHere(tls, v, addr1)
 116081 	if memRootPage < 0 {
 116082 		Xsqlite3VdbeAddOp2(tls, v, OP_Clear, int32(tnum), iDb)
 116083 	}
 116084 	Xsqlite3VdbeAddOp4(tls, v, OP_OpenWrite, iIdx, int32(tnum), iDb,
 116085 		pKey, -8)
 116086 	Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_BULKCSR|func() int32 {
 116087 		if memRootPage >= 0 {
 116088 			return OPFLAG_P2ISREG
 116089 		}
 116090 		return 0
 116091 	}()))
 116092 
 116093 	addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_SorterSort, iSorter, 0)
 116094 	if int32((*Index)(unsafe.Pointer(pIndex)).FonError) != OE_None {
 116095 		var j2 int32 = Xsqlite3VdbeGoto(tls, v, 1)
 116096 		addr2 = Xsqlite3VdbeCurrentAddr(tls, v)
 116097 
 116098 		Xsqlite3VdbeAddOp4Int(tls, v, OP_SorterCompare, iSorter, j2, regRecord,
 116099 			int32((*Index)(unsafe.Pointer(pIndex)).FnKeyCol))
 116100 		Xsqlite3UniqueConstraint(tls, pParse, OE_Abort, pIndex)
 116101 		Xsqlite3VdbeJumpHere(tls, v, j2)
 116102 	} else {
 116103 		Xsqlite3MayAbort(tls, pParse)
 116104 		addr2 = Xsqlite3VdbeCurrentAddr(tls, v)
 116105 	}
 116106 	Xsqlite3VdbeAddOp3(tls, v, OP_SorterData, iSorter, regRecord, iIdx)
 116107 	if !(int32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x200>>9) != 0) {
 116108 		Xsqlite3VdbeAddOp1(tls, v, OP_SeekEnd, iIdx)
 116109 	}
 116110 	Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, iIdx, regRecord)
 116111 	Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT))
 116112 	Xsqlite3ReleaseTempReg(tls, pParse, regRecord)
 116113 	Xsqlite3VdbeAddOp2(tls, v, OP_SorterNext, iSorter, addr2)
 116114 	Xsqlite3VdbeJumpHere(tls, v, addr1)
 116115 
 116116 	Xsqlite3VdbeAddOp1(tls, v, OP_Close, iTab)
 116117 	Xsqlite3VdbeAddOp1(tls, v, OP_Close, iIdx)
 116118 	Xsqlite3VdbeAddOp1(tls, v, OP_Close, iSorter)
 116119 }
 116120 
 116121 // Allocate heap space to hold an Index object with nCol columns.
 116122 //
 116123 // Increase the allocation size to provide an extra nExtra bytes
 116124 // of 8-byte aligned space after the Index object and return a
 116125 // pointer to this extra space in *ppExtra.
 116126 func Xsqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol I16, nExtra int32, ppExtra uintptr) uintptr {
 116127 	var p uintptr
 116128 	var nByte int32
 116129 
 116130 	nByte = int32((uint64(unsafe.Sizeof(Index{}))+uint64(7))&libc.Uint64FromInt32(libc.CplInt32(7)) + (uint64(unsafe.Sizeof(uintptr(0)))*uint64(nCol)+uint64(7))&libc.Uint64FromInt32(libc.CplInt32(7)) + (uint64(unsafe.Sizeof(LogEst(0)))*uint64(int32(nCol)+1)+uint64(unsafe.Sizeof(I16(0)))*uint64(nCol)+uint64(unsafe.Sizeof(U8(0)))*uint64(nCol)+uint64(7))&libc.Uint64FromInt32(libc.CplInt32(7)))
 116131 	p = Xsqlite3DbMallocZero(tls, db, uint64(nByte+nExtra))
 116132 	if p != 0 {
 116133 		var pExtra uintptr = p + uintptr((uint64(unsafe.Sizeof(Index{}))+uint64(7))&libc.Uint64FromInt32(libc.CplInt32(7)))
 116134 		(*Index)(unsafe.Pointer(p)).FazColl = pExtra
 116135 		pExtra += uintptr((uint64(unsafe.Sizeof(uintptr(0)))*uint64(nCol) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7)))
 116136 		(*Index)(unsafe.Pointer(p)).FaiRowLogEst = pExtra
 116137 		pExtra += uintptr(uint64(unsafe.Sizeof(LogEst(0))) * uint64(int32(nCol)+1))
 116138 		(*Index)(unsafe.Pointer(p)).FaiColumn = pExtra
 116139 		pExtra += uintptr(uint64(unsafe.Sizeof(I16(0))) * uint64(nCol))
 116140 		(*Index)(unsafe.Pointer(p)).FaSortOrder = pExtra
 116141 		(*Index)(unsafe.Pointer(p)).FnColumn = U16(nCol)
 116142 		(*Index)(unsafe.Pointer(p)).FnKeyCol = U16(int32(nCol) - 1)
 116143 		*(*uintptr)(unsafe.Pointer(ppExtra)) = p + uintptr(nByte)
 116144 	}
 116145 	return p
 116146 }
 116147 
 116148 // If expression list pList contains an expression that was parsed with
 116149 // an explicit "NULLS FIRST" or "NULLS LAST" clause, leave an error in
 116150 // pParse and return non-zero. Otherwise, return zero.
 116151 func Xsqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) int32 {
 116152 	bp := tls.Alloc(8)
 116153 	defer tls.Free(8)
 116154 
 116155 	if pList != 0 {
 116156 		var i int32
 116157 		for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ {
 116158 			if uint32(int32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*32 + 16 + 4))&0x20>>5)) != 0 {
 116159 				var sf U8 = (*ExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32)).Ffg.FsortFlags
 116160 				Xsqlite3ErrorMsg(tls, pParse, ts+15131,
 116161 					libc.VaList(bp, func() uintptr {
 116162 						if int32(sf) == 0 || int32(sf) == 3 {
 116163 							return ts + 15159
 116164 						}
 116165 						return ts + 15165
 116166 					}()))
 116167 				return 1
 116168 			}
 116169 		}
 116170 	}
 116171 	return 0
 116172 }
 116173 
 116174 // Create a new index for an SQL table.  pName1.pName2 is the name of the index
 116175 // and pTblList is the name of the table that is to be indexed.  Both will
 116176 // be NULL for a primary key or an index that is created to satisfy a
 116177 // UNIQUE constraint.  If pTable and pIndex are NULL, use pParse->pNewTable
 116178 // as the table to be indexed.  pParse->pNewTable is a table that is
 116179 // currently being constructed by a CREATE TABLE statement.
 116180 //
 116181 // pList is a list of columns to be indexed.  pList will be NULL if this
 116182 // is a primary key or unique-constraint on the most recent column added
 116183 // to the table currently under construction.
 116184 func Xsqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pTblName uintptr, pList uintptr, onError int32, pStart uintptr, pPIWhere uintptr, sortOrder int32, ifNotExist int32, idxType U8) {
 116185 	bp := tls.Alloc(256)
 116186 	defer tls.Free(256)
 116187 
 116188 	var pTab uintptr
 116189 	var pIndex uintptr
 116190 	var zName uintptr
 116191 	var nName int32
 116192 	var i int32
 116193 	var j int32
 116194 
 116195 	var sortOrderMask int32
 116196 	var db uintptr
 116197 	var pDb uintptr
 116198 	var iDb int32
 116199 
 116200 	var pListItem uintptr
 116201 	var nExtra int32
 116202 	var nExtraCol int32
 116203 
 116204 	var pPk uintptr
 116205 	var n int32
 116206 	var pLoop uintptr
 116207 	var zDb uintptr
 116208 
 116209 	var pCol uintptr
 116210 	var pExpr uintptr
 116211 	var nColl int32
 116212 	var pCExpr uintptr
 116213 	var requestedSortOrder int32
 116214 	var zColl uintptr
 116215 	var x int32
 116216 	var z1 uintptr
 116217 	var z2 uintptr
 116218 	var k int32
 116219 
 116220 	var pIdx uintptr
 116221 	var p uintptr
 116222 	var n1 int32
 116223 	var v uintptr
 116224 	var zStmt uintptr
 116225 	var iMem int32
 116226 	var pNext uintptr
 116227 
 116228 	var ppFrom uintptr
 116229 	var pThis uintptr
 116230 	pTab = uintptr(0)
 116231 	pIndex = uintptr(0)
 116232 	zName = uintptr(0)
 116233 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 116234 	*(*uintptr)(unsafe.Pointer(bp + 128)) = uintptr(0)
 116235 	nExtra = 0
 116236 	*(*uintptr)(unsafe.Pointer(bp + 248)) = uintptr(0)
 116237 	pPk = uintptr(0)
 116238 
 116239 	if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
 116240 		goto __1
 116241 	}
 116242 	goto exit_create_index
 116243 __1:
 116244 	;
 116245 	if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) == PARSE_MODE_DECLARE_VTAB && int32(idxType) != SQLITE_IDXTYPE_PRIMARYKEY) {
 116246 		goto __2
 116247 	}
 116248 	goto exit_create_index
 116249 __2:
 116250 	;
 116251 	if !(SQLITE_OK != Xsqlite3ReadSchema(tls, pParse)) {
 116252 		goto __3
 116253 	}
 116254 	goto exit_create_index
 116255 __3:
 116256 	;
 116257 	if !(Xsqlite3HasExplicitNulls(tls, pParse, pList) != 0) {
 116258 		goto __4
 116259 	}
 116260 	goto exit_create_index
 116261 __4:
 116262 	;
 116263 	if !(pTblName != uintptr(0)) {
 116264 		goto __5
 116265 	}
 116266 
 116267 	iDb = Xsqlite3TwoPartName(tls, pParse, pName1, pName2, bp+128)
 116268 	if !(iDb < 0) {
 116269 		goto __7
 116270 	}
 116271 	goto exit_create_index
 116272 __7:
 116273 	;
 116274 	if !!(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0) {
 116275 		goto __8
 116276 	}
 116277 	pTab = Xsqlite3SrcListLookup(tls, pParse, pTblName)
 116278 	if !((*Token)(unsafe.Pointer(pName2)).Fn == uint32(0) && pTab != 0 && (*Table)(unsafe.Pointer(pTab)).FpSchema == (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema) {
 116279 		goto __9
 116280 	}
 116281 	iDb = 1
 116282 __9:
 116283 	;
 116284 __8:
 116285 	;
 116286 	Xsqlite3FixInit(tls, bp+136, pParse, iDb, ts+15170, *(*uintptr)(unsafe.Pointer(bp + 128)))
 116287 	if !(Xsqlite3FixSrcList(tls, bp+136, pTblName) != 0) {
 116288 		goto __10
 116289 	}
 116290 
 116291 __10:
 116292 	;
 116293 	pTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), pTblName+8)
 116294 
 116295 	if !(pTab == uintptr(0)) {
 116296 		goto __11
 116297 	}
 116298 	goto exit_create_index
 116299 __11:
 116300 	;
 116301 	if !(iDb == 1 && (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpSchema != (*Table)(unsafe.Pointer(pTab)).FpSchema) {
 116302 		goto __12
 116303 	}
 116304 	Xsqlite3ErrorMsg(tls, pParse,
 116305 		ts+15176,
 116306 		libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
 116307 	goto exit_create_index
 116308 __12:
 116309 	;
 116310 	if !!((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 116311 		goto __13
 116312 	}
 116313 	pPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
 116314 __13:
 116315 	;
 116316 	goto __6
 116317 __5:
 116318 	;
 116319 	pTab = (*Parse)(unsafe.Pointer(pParse)).FpNewTable
 116320 	if !!(pTab != 0) {
 116321 		goto __14
 116322 	}
 116323 	goto exit_create_index
 116324 __14:
 116325 	;
 116326 	iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
 116327 __6:
 116328 	;
 116329 	pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32
 116330 
 116331 	if !(Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+7733, 7) == 0 &&
 116332 		int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0 &&
 116333 		pTblName != uintptr(0)) {
 116334 		goto __15
 116335 	}
 116336 	Xsqlite3ErrorMsg(tls, pParse, ts+15226, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
 116337 	goto exit_create_index
 116338 __15:
 116339 	;
 116340 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW) {
 116341 		goto __16
 116342 	}
 116343 	Xsqlite3ErrorMsg(tls, pParse, ts+15254, 0)
 116344 	goto exit_create_index
 116345 __16:
 116346 	;
 116347 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
 116348 		goto __17
 116349 	}
 116350 	Xsqlite3ErrorMsg(tls, pParse, ts+15279, 0)
 116351 	goto exit_create_index
 116352 __17:
 116353 	;
 116354 	if !(*(*uintptr)(unsafe.Pointer(bp + 128)) != 0) {
 116355 		goto __18
 116356 	}
 116357 	zName = Xsqlite3NameFromToken(tls, db, *(*uintptr)(unsafe.Pointer(bp + 128)))
 116358 	if !(zName == uintptr(0)) {
 116359 		goto __20
 116360 	}
 116361 	goto exit_create_index
 116362 __20:
 116363 	;
 116364 	if !(SQLITE_OK != Xsqlite3CheckObjectName(tls, pParse, zName, ts+15170, (*Table)(unsafe.Pointer(pTab)).FzName)) {
 116365 		goto __21
 116366 	}
 116367 	goto exit_create_index
 116368 __21:
 116369 	;
 116370 	if !!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 116371 		goto __22
 116372 	}
 116373 	if !!(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0) {
 116374 		goto __23
 116375 	}
 116376 	if !(Xsqlite3FindTable(tls, db, zName, (*Db)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0)) {
 116377 		goto __24
 116378 	}
 116379 	Xsqlite3ErrorMsg(tls, pParse, ts+15313, libc.VaList(bp+16, zName))
 116380 	goto exit_create_index
 116381 __24:
 116382 	;
 116383 __23:
 116384 	;
 116385 	if !(Xsqlite3FindIndex(tls, db, zName, (*Db)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0)) {
 116386 		goto __25
 116387 	}
 116388 	if !!(ifNotExist != 0) {
 116389 		goto __26
 116390 	}
 116391 	Xsqlite3ErrorMsg(tls, pParse, ts+15347, libc.VaList(bp+24, zName))
 116392 	goto __27
 116393 __26:
 116394 	;
 116395 	Xsqlite3CodeVerifySchema(tls, pParse, iDb)
 116396 	sqlite3ForceNotReadOnly(tls, pParse)
 116397 __27:
 116398 	;
 116399 	goto exit_create_index
 116400 __25:
 116401 	;
 116402 __22:
 116403 	;
 116404 	goto __19
 116405 __18:
 116406 	pLoop = (*Table)(unsafe.Pointer(pTab)).FpIndex
 116407 	n = 1
 116408 __28:
 116409 	if !(pLoop != 0) {
 116410 		goto __30
 116411 	}
 116412 	goto __29
 116413 __29:
 116414 	pLoop = (*Index)(unsafe.Pointer(pLoop)).FpNext
 116415 	n++
 116416 	goto __28
 116417 	goto __30
 116418 __30:
 116419 	;
 116420 	zName = Xsqlite3MPrintf(tls, db, ts+15371, libc.VaList(bp+32, (*Table)(unsafe.Pointer(pTab)).FzName, n))
 116421 	if !(zName == uintptr(0)) {
 116422 		goto __31
 116423 	}
 116424 	goto exit_create_index
 116425 __31:
 116426 	;
 116427 	if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL) {
 116428 		goto __32
 116429 	}
 116430 	*(*int8)(unsafe.Pointer(zName + 7))++
 116431 __32:
 116432 	;
 116433 __19:
 116434 	;
 116435 	if !!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 116436 		goto __33
 116437 	}
 116438 	zDb = (*Db)(unsafe.Pointer(pDb)).FzDbSName
 116439 	if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_INSERT, func() uintptr {
 116440 		if !(0 != 0) && iDb == 1 {
 116441 			return ts + 7741
 116442 		}
 116443 		return ts + 7235
 116444 	}(), uintptr(0), zDb) != 0) {
 116445 		goto __34
 116446 	}
 116447 	goto exit_create_index
 116448 __34:
 116449 	;
 116450 	i = SQLITE_CREATE_INDEX
 116451 	if !(!(0 != 0) && iDb == 1) {
 116452 		goto __35
 116453 	}
 116454 	i = SQLITE_CREATE_TEMP_INDEX
 116455 __35:
 116456 	;
 116457 	if !(Xsqlite3AuthCheck(tls, pParse, i, zName, (*Table)(unsafe.Pointer(pTab)).FzName, zDb) != 0) {
 116458 		goto __36
 116459 	}
 116460 	goto exit_create_index
 116461 __36:
 116462 	;
 116463 __33:
 116464 	;
 116465 	if !(pList == uintptr(0)) {
 116466 		goto __37
 116467 	}
 116468 	pCol = (*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(int32((*Table)(unsafe.Pointer(pTab)).FnCol)-1)*24
 116469 	*(*U16)(unsafe.Pointer(pCol + 16)) |= U16(COLFLAG_UNIQUE)
 116470 	Xsqlite3TokenInit(tls, bp+232, (*Column)(unsafe.Pointer(pCol)).FzCnName)
 116471 	pList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0),
 116472 		Xsqlite3ExprAlloc(tls, db, TK_ID, bp+232, 0))
 116473 	if !(pList == uintptr(0)) {
 116474 		goto __39
 116475 	}
 116476 	goto exit_create_index
 116477 __39:
 116478 	;
 116479 	Xsqlite3ExprListSetSortOrder(tls, pList, sortOrder, -1)
 116480 	goto __38
 116481 __37:
 116482 	Xsqlite3ExprListCheckLength(tls, pParse, pList, ts+15170)
 116483 	if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
 116484 		goto __40
 116485 	}
 116486 	goto exit_create_index
 116487 __40:
 116488 	;
 116489 __38:
 116490 	;
 116491 	i = 0
 116492 __41:
 116493 	if !(i < (*ExprList)(unsafe.Pointer(pList)).FnExpr) {
 116494 		goto __43
 116495 	}
 116496 	pExpr = (*ExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32)).FpExpr
 116497 
 116498 	if !(int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLLATE) {
 116499 		goto __44
 116500 	}
 116501 
 116502 	nExtra = nExtra + (1 + Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8))))
 116503 __44:
 116504 	;
 116505 	goto __42
 116506 __42:
 116507 	i++
 116508 	goto __41
 116509 	goto __43
 116510 __43:
 116511 	;
 116512 	nName = Xsqlite3Strlen30(tls, zName)
 116513 	if pPk != 0 {
 116514 		nExtraCol = int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol)
 116515 	} else {
 116516 		nExtraCol = 1
 116517 	}
 116518 
 116519 	pIndex = Xsqlite3AllocateIndexObject(tls, db, int16((*ExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol),
 116520 		nName+nExtra+1, bp+248)
 116521 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 116522 		goto __45
 116523 	}
 116524 	goto exit_create_index
 116525 __45:
 116526 	;
 116527 	(*Index)(unsafe.Pointer(pIndex)).FzName = *(*uintptr)(unsafe.Pointer(bp + 248))
 116528 	*(*uintptr)(unsafe.Pointer(bp + 248)) += uintptr(nName + 1)
 116529 	libc.Xmemcpy(tls, (*Index)(unsafe.Pointer(pIndex)).FzName, zName, uint64(nName+1))
 116530 	(*Index)(unsafe.Pointer(pIndex)).FpTable = pTab
 116531 	(*Index)(unsafe.Pointer(pIndex)).FonError = U8(onError)
 116532 	libc.SetBitFieldPtr16Uint32(pIndex+100, uint32(libc.Bool32(onError != OE_None)), 3, 0x8)
 116533 	libc.SetBitFieldPtr16Uint32(pIndex+100, uint32(idxType), 0, 0x3)
 116534 	(*Index)(unsafe.Pointer(pIndex)).FpSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpSchema
 116535 	(*Index)(unsafe.Pointer(pIndex)).FnKeyCol = U16((*ExprList)(unsafe.Pointer(pList)).FnExpr)
 116536 	if !(pPIWhere != 0) {
 116537 		goto __46
 116538 	}
 116539 	Xsqlite3ResolveSelfReference(tls, pParse, pTab, NC_PartIdx, pPIWhere, uintptr(0))
 116540 	(*Index)(unsafe.Pointer(pIndex)).FpPartIdxWhere = pPIWhere
 116541 	pPIWhere = uintptr(0)
 116542 __46:
 116543 	;
 116544 	if !(int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) >= 4) {
 116545 		goto __47
 116546 	}
 116547 	sortOrderMask = -1
 116548 	goto __48
 116549 __47:
 116550 	sortOrderMask = 0
 116551 __48:
 116552 	;
 116553 	pListItem = pList + 8
 116554 	if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 116555 		goto __49
 116556 	}
 116557 	(*Index)(unsafe.Pointer(pIndex)).FaColExpr = pList
 116558 	pList = uintptr(0)
 116559 __49:
 116560 	;
 116561 	i = 0
 116562 __50:
 116563 	if !(i < int32((*Index)(unsafe.Pointer(pIndex)).FnKeyCol)) {
 116564 		goto __52
 116565 	}
 116566 
 116567 	sqlite3StringToId(tls, (*ExprList_item)(unsafe.Pointer(pListItem)).FpExpr)
 116568 	Xsqlite3ResolveSelfReference(tls, pParse, pTab, NC_IdxExpr, (*ExprList_item)(unsafe.Pointer(pListItem)).FpExpr, uintptr(0))
 116569 	if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
 116570 		goto __53
 116571 	}
 116572 	goto exit_create_index
 116573 __53:
 116574 	;
 116575 	pCExpr = Xsqlite3ExprSkipCollate(tls, (*ExprList_item)(unsafe.Pointer(pListItem)).FpExpr)
 116576 	if !(int32((*Expr)(unsafe.Pointer(pCExpr)).Fop) != TK_COLUMN) {
 116577 		goto __54
 116578 	}
 116579 	if !(pTab == (*Parse)(unsafe.Pointer(pParse)).FpNewTable) {
 116580 		goto __56
 116581 	}
 116582 	Xsqlite3ErrorMsg(tls, pParse,
 116583 		ts+15394, 0)
 116584 	goto exit_create_index
 116585 __56:
 116586 	;
 116587 	if !((*Index)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0)) {
 116588 		goto __57
 116589 	}
 116590 	(*Index)(unsafe.Pointer(pIndex)).FaColExpr = pList
 116591 	pList = uintptr(0)
 116592 __57:
 116593 	;
 116594 	j = -2
 116595 	*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(-2)
 116596 	libc.SetBitFieldPtr16Uint32(pIndex+100, uint32(0), 3, 0x8)
 116597 	libc.SetBitFieldPtr16Uint32(pIndex+100, uint32(1), 11, 0x800)
 116598 	goto __55
 116599 __54:
 116600 	j = int32((*Expr)(unsafe.Pointer(pCExpr)).FiColumn)
 116601 
 116602 	if !(j < 0) {
 116603 		goto __58
 116604 	}
 116605 	j = int32((*Table)(unsafe.Pointer(pTab)).FiPKey)
 116606 	goto __59
 116607 __58:
 116608 	if !(int32(*(*uint8)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*24 + 8))&0xf>>0) == 0) {
 116609 		goto __60
 116610 	}
 116611 	libc.SetBitFieldPtr16Uint32(pIndex+100, uint32(0), 3, 0x8)
 116612 __60:
 116613 	;
 116614 	if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*24)).FcolFlags)&COLFLAG_VIRTUAL != 0) {
 116615 		goto __61
 116616 	}
 116617 	libc.SetBitFieldPtr16Uint32(pIndex+100, uint32(1), 10, 0x400)
 116618 	libc.SetBitFieldPtr16Uint32(pIndex+100, uint32(1), 11, 0x800)
 116619 __61:
 116620 	;
 116621 __59:
 116622 	;
 116623 	*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = I16(j)
 116624 __55:
 116625 	;
 116626 	zColl = uintptr(0)
 116627 	if !(int32((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(pListItem)).FpExpr)).Fop) == TK_COLLATE) {
 116628 		goto __62
 116629 	}
 116630 
 116631 	zColl = *(*uintptr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(pListItem)).FpExpr + 8))
 116632 	nColl = Xsqlite3Strlen30(tls, zColl) + 1
 116633 
 116634 	libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 248)), zColl, uint64(nColl))
 116635 	zColl = *(*uintptr)(unsafe.Pointer(bp + 248))
 116636 	*(*uintptr)(unsafe.Pointer(bp + 248)) += uintptr(nColl)
 116637 	nExtra = nExtra - nColl
 116638 	goto __63
 116639 __62:
 116640 	if !(j >= 0) {
 116641 		goto __64
 116642 	}
 116643 	zColl = Xsqlite3ColumnColl(tls, (*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*24)
 116644 __64:
 116645 	;
 116646 __63:
 116647 	;
 116648 	if !!(zColl != 0) {
 116649 		goto __65
 116650 	}
 116651 	zColl = uintptr(unsafe.Pointer(&Xsqlite3StrBINARY))
 116652 __65:
 116653 	;
 116654 	if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0) && !(Xsqlite3LocateCollSeq(tls, pParse, zColl) != 0)) {
 116655 		goto __66
 116656 	}
 116657 	goto exit_create_index
 116658 __66:
 116659 	;
 116660 	*(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FazColl + uintptr(i)*8)) = zColl
 116661 	requestedSortOrder = int32((*ExprList_item)(unsafe.Pointer(pListItem)).Ffg.FsortFlags) & sortOrderMask
 116662 	*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaSortOrder + uintptr(i))) = U8(requestedSortOrder)
 116663 	goto __51
 116664 __51:
 116665 	i++
 116666 	pListItem += 32
 116667 	goto __50
 116668 	goto __52
 116669 __52:
 116670 	;
 116671 	if !(pPk != 0) {
 116672 		goto __67
 116673 	}
 116674 	j = 0
 116675 __69:
 116676 	if !(j < int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol)) {
 116677 		goto __71
 116678 	}
 116679 	x = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))
 116680 
 116681 	if !(isDupColumn(tls, pIndex, int32((*Index)(unsafe.Pointer(pIndex)).FnKeyCol), pPk, j) != 0) {
 116682 		goto __72
 116683 	}
 116684 	(*Index)(unsafe.Pointer(pIndex)).FnColumn--
 116685 	goto __73
 116686 __72:
 116687 	;
 116688 	*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = I16(x)
 116689 	*(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FazColl + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FazColl + uintptr(j)*8))
 116690 	*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaSortOrder + uintptr(i))) = *(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(j)))
 116691 	i++
 116692 __73:
 116693 	;
 116694 	goto __70
 116695 __70:
 116696 	j++
 116697 	goto __69
 116698 	goto __71
 116699 __71:
 116700 	;
 116701 	goto __68
 116702 __67:
 116703 	*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(-1)
 116704 	*(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FazColl + uintptr(i)*8)) = uintptr(unsafe.Pointer(&Xsqlite3StrBINARY))
 116705 __68:
 116706 	;
 116707 	Xsqlite3DefaultRowEst(tls, pIndex)
 116708 	if !((*Parse)(unsafe.Pointer(pParse)).FpNewTable == uintptr(0)) {
 116709 		goto __74
 116710 	}
 116711 	estimateIndexWidth(tls, pIndex)
 116712 __74:
 116713 	;
 116714 	recomputeColumnsNotIndexed(tls, pIndex)
 116715 	if !(pTblName != uintptr(0) && int32((*Index)(unsafe.Pointer(pIndex)).FnColumn) >= int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 116716 		goto __75
 116717 	}
 116718 	libc.SetBitFieldPtr16Uint32(pIndex+100, uint32(1), 5, 0x20)
 116719 	j = 0
 116720 __76:
 116721 	if !(j < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 116722 		goto __78
 116723 	}
 116724 	if !(j == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) {
 116725 		goto __79
 116726 	}
 116727 	goto __77
 116728 __79:
 116729 	;
 116730 	if !(int32(Xsqlite3TableColumnToIndex(tls, pIndex, int16(j))) >= 0) {
 116731 		goto __80
 116732 	}
 116733 	goto __77
 116734 __80:
 116735 	;
 116736 	libc.SetBitFieldPtr16Uint32(pIndex+100, uint32(0), 5, 0x20)
 116737 	goto __78
 116738 	goto __77
 116739 __77:
 116740 	j++
 116741 	goto __76
 116742 	goto __78
 116743 __78:
 116744 	;
 116745 __75:
 116746 	;
 116747 	if !(pTab == (*Parse)(unsafe.Pointer(pParse)).FpNewTable) {
 116748 		goto __81
 116749 	}
 116750 	pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex
 116751 __82:
 116752 	if !(pIdx != 0) {
 116753 		goto __84
 116754 	}
 116755 
 116756 	if !(int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) != int32((*Index)(unsafe.Pointer(pIndex)).FnKeyCol)) {
 116757 		goto __85
 116758 	}
 116759 	goto __83
 116760 __85:
 116761 	;
 116762 	k = 0
 116763 __86:
 116764 	if !(k < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)) {
 116765 		goto __88
 116766 	}
 116767 
 116768 	if !(int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(k)*2))) != int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(k)*2)))) {
 116769 		goto __89
 116770 	}
 116771 	goto __88
 116772 __89:
 116773 	;
 116774 	z1 = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(k)*8))
 116775 	z2 = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FazColl + uintptr(k)*8))
 116776 	if !(Xsqlite3StrICmp(tls, z1, z2) != 0) {
 116777 		goto __90
 116778 	}
 116779 	goto __88
 116780 __90:
 116781 	;
 116782 	goto __87
 116783 __87:
 116784 	k++
 116785 	goto __86
 116786 	goto __88
 116787 __88:
 116788 	;
 116789 	if !(k == int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)) {
 116790 		goto __91
 116791 	}
 116792 	if !(int32((*Index)(unsafe.Pointer(pIdx)).FonError) != int32((*Index)(unsafe.Pointer(pIndex)).FonError)) {
 116793 		goto __92
 116794 	}
 116795 
 116796 	if !!(int32((*Index)(unsafe.Pointer(pIdx)).FonError) == OE_Default || int32((*Index)(unsafe.Pointer(pIndex)).FonError) == OE_Default) {
 116797 		goto __93
 116798 	}
 116799 	Xsqlite3ErrorMsg(tls, pParse,
 116800 		ts+15455, libc.VaList(bp+48, 0))
 116801 __93:
 116802 	;
 116803 	if !(int32((*Index)(unsafe.Pointer(pIdx)).FonError) == OE_Default) {
 116804 		goto __94
 116805 	}
 116806 	(*Index)(unsafe.Pointer(pIdx)).FonError = (*Index)(unsafe.Pointer(pIndex)).FonError
 116807 __94:
 116808 	;
 116809 __92:
 116810 	;
 116811 	if !(int32(idxType) == SQLITE_IDXTYPE_PRIMARYKEY) {
 116812 		goto __95
 116813 	}
 116814 	libc.SetBitFieldPtr16Uint32(pIdx+100, uint32(idxType), 0, 0x3)
 116815 __95:
 116816 	;
 116817 	if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 116818 		goto __96
 116819 	}
 116820 	(*Index)(unsafe.Pointer(pIndex)).FpNext = (*Parse)(unsafe.Pointer(pParse)).FpNewIndex
 116821 	(*Parse)(unsafe.Pointer(pParse)).FpNewIndex = pIndex
 116822 	pIndex = uintptr(0)
 116823 __96:
 116824 	;
 116825 	goto exit_create_index
 116826 __91:
 116827 	;
 116828 	goto __83
 116829 __83:
 116830 	pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
 116831 	goto __82
 116832 	goto __84
 116833 __84:
 116834 	;
 116835 __81:
 116836 	;
 116837 	if !!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 116838 		goto __97
 116839 	}
 116840 
 116841 	if !((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0) {
 116842 		goto __98
 116843 	}
 116844 
 116845 	if !(pTblName != uintptr(0)) {
 116846 		goto __100
 116847 	}
 116848 	(*Index)(unsafe.Pointer(pIndex)).Ftnum = (*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum
 116849 	if !(Xsqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0) {
 116850 		goto __101
 116851 	}
 116852 	Xsqlite3ErrorMsg(tls, pParse, ts+15497, 0)
 116853 	(*Parse)(unsafe.Pointer(pParse)).Frc = Xsqlite3CorruptError(tls, 121859)
 116854 	goto exit_create_index
 116855 __101:
 116856 	;
 116857 __100:
 116858 	;
 116859 	p = Xsqlite3HashInsert(tls, (*Index)(unsafe.Pointer(pIndex)).FpSchema+32,
 116860 		(*Index)(unsafe.Pointer(pIndex)).FzName, pIndex)
 116861 	if !(p != 0) {
 116862 		goto __102
 116863 	}
 116864 
 116865 	Xsqlite3OomFault(tls, db)
 116866 	goto exit_create_index
 116867 __102:
 116868 	;
 116869 	*(*U32)(unsafe.Pointer(db + 44)) |= U32(DBFLAG_SchemaChange)
 116870 	goto __99
 116871 __98:
 116872 	if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) || pTblName != uintptr(0)) {
 116873 		goto __103
 116874 	}
 116875 	iMem = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 116876 
 116877 	v = Xsqlite3GetVdbe(tls, pParse)
 116878 	if !(v == uintptr(0)) {
 116879 		goto __104
 116880 	}
 116881 	goto exit_create_index
 116882 __104:
 116883 	;
 116884 	Xsqlite3BeginWriteOperation(tls, pParse, 1, iDb)
 116885 
 116886 	(*Index)(unsafe.Pointer(pIndex)).Ftnum = Pgno(Xsqlite3VdbeAddOp0(tls, v, OP_Noop))
 116887 	Xsqlite3VdbeAddOp3(tls, v, OP_CreateBtree, iDb, iMem, BTREE_BLOBKEY)
 116888 
 116889 	if !(pStart != 0) {
 116890 		goto __105
 116891 	}
 116892 	n1 = int32(uint32(int32((int64((*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fz)-int64((*Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 128)))).Fz))/1)) + (*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fn)
 116893 	if !(int32(*(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 128)))).Fz + uintptr(n1-1)))) == ';') {
 116894 		goto __107
 116895 	}
 116896 	n1--
 116897 __107:
 116898 	;
 116899 	zStmt = Xsqlite3MPrintf(tls, db, ts+15514,
 116900 		libc.VaList(bp+56, func() uintptr {
 116901 			if onError == OE_None {
 116902 				return ts + 1544
 116903 			}
 116904 			return ts + 15534
 116905 		}(), n1, (*Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 128)))).Fz))
 116906 	goto __106
 116907 __105:
 116908 	zStmt = uintptr(0)
 116909 __106:
 116910 	;
 116911 	Xsqlite3NestedParse(tls, pParse,
 116912 		ts+15542,
 116913 		libc.VaList(bp+80, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName,
 116914 			(*Index)(unsafe.Pointer(pIndex)).FzName,
 116915 			(*Table)(unsafe.Pointer(pTab)).FzName,
 116916 			iMem,
 116917 			zStmt))
 116918 	Xsqlite3DbFree(tls, db, zStmt)
 116919 
 116920 	if !(pTblName != 0) {
 116921 		goto __108
 116922 	}
 116923 	sqlite3RefillIndex(tls, pParse, pIndex, iMem)
 116924 	Xsqlite3ChangeCookie(tls, pParse, iDb)
 116925 	Xsqlite3VdbeAddParseSchemaOp(tls, v, iDb,
 116926 		Xsqlite3MPrintf(tls, db, ts+15601, libc.VaList(bp+120, (*Index)(unsafe.Pointer(pIndex)).FzName)), uint16(0))
 116927 	Xsqlite3VdbeAddOp2(tls, v, OP_Expire, 0, 1)
 116928 __108:
 116929 	;
 116930 	Xsqlite3VdbeJumpHere(tls, v, int32((*Index)(unsafe.Pointer(pIndex)).Ftnum))
 116931 __103:
 116932 	;
 116933 __99:
 116934 	;
 116935 __97:
 116936 	;
 116937 	if !((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 || pTblName == uintptr(0)) {
 116938 		goto __109
 116939 	}
 116940 	(*Index)(unsafe.Pointer(pIndex)).FpNext = (*Table)(unsafe.Pointer(pTab)).FpIndex
 116941 	(*Table)(unsafe.Pointer(pTab)).FpIndex = pIndex
 116942 	pIndex = uintptr(0)
 116943 	goto __110
 116944 __109:
 116945 	if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 116946 		goto __111
 116947 	}
 116948 
 116949 	(*Parse)(unsafe.Pointer(pParse)).FpNewIndex = pIndex
 116950 	pIndex = uintptr(0)
 116951 __111:
 116952 	;
 116953 __110:
 116954 	;
 116955 exit_create_index:
 116956 	if !(pIndex != 0) {
 116957 		goto __112
 116958 	}
 116959 	Xsqlite3FreeIndex(tls, db, pIndex)
 116960 __112:
 116961 	;
 116962 	if !(pTab != 0) {
 116963 		goto __113
 116964 	}
 116965 	ppFrom = pTab + 16
 116966 __114:
 116967 	if !(libc.AssignUintptr(&pThis, *(*uintptr)(unsafe.Pointer(ppFrom))) != uintptr(0)) {
 116968 		goto __116
 116969 	}
 116970 	if !(int32((*Index)(unsafe.Pointer(pThis)).FonError) != OE_Replace) {
 116971 		goto __117
 116972 	}
 116973 	goto __115
 116974 __117:
 116975 	;
 116976 __118:
 116977 	if !(libc.AssignUintptr(&pNext, (*Index)(unsafe.Pointer(pThis)).FpNext) != uintptr(0) && int32((*Index)(unsafe.Pointer(pNext)).FonError) != OE_Replace) {
 116978 		goto __119
 116979 	}
 116980 	*(*uintptr)(unsafe.Pointer(ppFrom)) = pNext
 116981 	(*Index)(unsafe.Pointer(pThis)).FpNext = (*Index)(unsafe.Pointer(pNext)).FpNext
 116982 	(*Index)(unsafe.Pointer(pNext)).FpNext = pThis
 116983 	ppFrom = pNext + 40
 116984 	goto __118
 116985 __119:
 116986 	;
 116987 	goto __116
 116988 	goto __115
 116989 __115:
 116990 	ppFrom = pThis + 40
 116991 	goto __114
 116992 	goto __116
 116993 __116:
 116994 	;
 116995 __113:
 116996 	;
 116997 	Xsqlite3ExprDelete(tls, db, pPIWhere)
 116998 	Xsqlite3ExprListDelete(tls, db, pList)
 116999 	Xsqlite3SrcListDelete(tls, db, pTblName)
 117000 	Xsqlite3DbFree(tls, db, zName)
 117001 }
 117002 
 117003 // Fill the Index.aiRowEst[] array with default information - information
 117004 // to be used when we have not run the ANALYZE command.
 117005 //
 117006 // aiRowEst[0] is supposed to contain the number of elements in the index.
 117007 // Since we do not know, guess 1 million.  aiRowEst[1] is an estimate of the
 117008 // number of rows in the table that match any particular value of the
 117009 // first column of the index.  aiRowEst[2] is an estimate of the number
 117010 // of rows that match any particular combination of the first 2 columns
 117011 // of the index.  And so forth.  It must always be the case that
 117012 //
 117013 //	aiRowEst[N]<=aiRowEst[N-1]
 117014 //	aiRowEst[N]>=1
 117015 //
 117016 // Apart from that, we have little to go on besides intuition as to
 117017 // how aiRowEst[] should be initialized.  The numbers generated here
 117018 // are based on typical values found in actual indices.
 117019 func Xsqlite3DefaultRowEst(tls *libc.TLS, pIdx uintptr) {
 117020 	var a uintptr = (*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst
 117021 	var x LogEst
 117022 	var nCopy int32 = func() int32 {
 117023 		if int32(uint64(unsafe.Sizeof(aVal))/uint64(unsafe.Sizeof(LogEst(0)))) < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) {
 117024 			return int32(uint64(unsafe.Sizeof(aVal)) / uint64(unsafe.Sizeof(LogEst(0))))
 117025 		}
 117026 		return int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
 117027 	}()
 117028 	var i int32
 117029 
 117030 	x = (*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FnRowLogEst
 117031 
 117032 	if int32(x) < 99 {
 117033 		(*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FnRowLogEst = libc.AssignInt16(&x, int16(99))
 117034 	}
 117035 	if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != uintptr(0) {
 117036 		x = int16(int32(x) - 10)
 117037 	}
 117038 	*(*LogEst)(unsafe.Pointer(a)) = x
 117039 
 117040 	libc.Xmemcpy(tls, a+1*2, uintptr(unsafe.Pointer(&aVal)), uint64(nCopy)*uint64(unsafe.Sizeof(LogEst(0))))
 117041 	for i = nCopy + 1; i <= int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol); i++ {
 117042 		*(*LogEst)(unsafe.Pointer(a + uintptr(i)*2)) = int16(23)
 117043 	}
 117044 
 117045 	if int32((*Index)(unsafe.Pointer(pIdx)).FonError) != OE_None {
 117046 		*(*LogEst)(unsafe.Pointer(a + uintptr((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)*2)) = int16(0)
 117047 	}
 117048 }
 117049 
 117050 var aVal = [5]LogEst{int16(33), int16(32), int16(30), int16(28), int16(26)}
 117051 
 117052 // This routine will drop an existing named index.  This routine
 117053 // implements the DROP INDEX statement.
 117054 func Xsqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists int32) {
 117055 	bp := tls.Alloc(32)
 117056 	defer tls.Free(32)
 117057 
 117058 	var pIndex uintptr
 117059 	var v uintptr
 117060 	var db uintptr
 117061 	var iDb int32
 117062 	var code int32
 117063 	var pTab uintptr
 117064 	var zDb uintptr
 117065 	var zTab uintptr
 117066 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 117067 
 117068 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 117069 		goto __1
 117070 	}
 117071 	goto exit_drop_index
 117072 __1:
 117073 	;
 117074 	if !(SQLITE_OK != Xsqlite3ReadSchema(tls, pParse)) {
 117075 		goto __2
 117076 	}
 117077 	goto exit_drop_index
 117078 __2:
 117079 	;
 117080 	pIndex = Xsqlite3FindIndex(tls, db, (*SrcItem)(unsafe.Pointer(pName+8)).FzName, (*SrcItem)(unsafe.Pointer(pName+8)).FzDatabase)
 117081 	if !(pIndex == uintptr(0)) {
 117082 		goto __3
 117083 	}
 117084 	if !!(ifExists != 0) {
 117085 		goto __4
 117086 	}
 117087 	Xsqlite3ErrorMsg(tls, pParse, ts+15628, libc.VaList(bp, pName+8))
 117088 	goto __5
 117089 __4:
 117090 	Xsqlite3CodeVerifyNamedSchema(tls, pParse, (*SrcItem)(unsafe.Pointer(pName+8)).FzDatabase)
 117091 	sqlite3ForceNotReadOnly(tls, pParse)
 117092 __5:
 117093 	;
 117094 	(*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1)
 117095 	goto exit_drop_index
 117096 __3:
 117097 	;
 117098 	if !(int32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x3>>0) != SQLITE_IDXTYPE_APPDEF) {
 117099 		goto __6
 117100 	}
 117101 	Xsqlite3ErrorMsg(tls, pParse,
 117102 		ts+15646, libc.VaList(bp+8, 0))
 117103 	goto exit_drop_index
 117104 __6:
 117105 	;
 117106 	iDb = Xsqlite3SchemaToIndex(tls, db, (*Index)(unsafe.Pointer(pIndex)).FpSchema)
 117107 
 117108 	code = SQLITE_DROP_INDEX
 117109 	pTab = (*Index)(unsafe.Pointer(pIndex)).FpTable
 117110 	zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
 117111 	zTab = func() uintptr {
 117112 		if !(0 != 0) && iDb == 1 {
 117113 			return ts + 7741
 117114 		}
 117115 		return ts + 7235
 117116 	}()
 117117 	if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_DELETE, zTab, uintptr(0), zDb) != 0) {
 117118 		goto __7
 117119 	}
 117120 	goto exit_drop_index
 117121 __7:
 117122 	;
 117123 	if !(!(0 != 0) && iDb == 1) {
 117124 		goto __8
 117125 	}
 117126 	code = SQLITE_DROP_TEMP_INDEX
 117127 __8:
 117128 	;
 117129 	if !(Xsqlite3AuthCheck(tls, pParse, code, (*Index)(unsafe.Pointer(pIndex)).FzName, (*Table)(unsafe.Pointer(pTab)).FzName, zDb) != 0) {
 117130 		goto __9
 117131 	}
 117132 	goto exit_drop_index
 117133 __9:
 117134 	;
 117135 	v = Xsqlite3GetVdbe(tls, pParse)
 117136 	if !(v != 0) {
 117137 		goto __10
 117138 	}
 117139 	Xsqlite3BeginWriteOperation(tls, pParse, 1, iDb)
 117140 	Xsqlite3NestedParse(tls, pParse,
 117141 		ts+15719,
 117142 		libc.VaList(bp+16, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, (*Index)(unsafe.Pointer(pIndex)).FzName))
 117143 	sqlite3ClearStatTables(tls, pParse, iDb, ts+12840, (*Index)(unsafe.Pointer(pIndex)).FzName)
 117144 	Xsqlite3ChangeCookie(tls, pParse, iDb)
 117145 	destroyRootPage(tls, pParse, int32((*Index)(unsafe.Pointer(pIndex)).Ftnum), iDb)
 117146 	Xsqlite3VdbeAddOp4(tls, v, OP_DropIndex, iDb, 0, 0, (*Index)(unsafe.Pointer(pIndex)).FzName, 0)
 117147 __10:
 117148 	;
 117149 exit_drop_index:
 117150 	Xsqlite3SrcListDelete(tls, db, pName)
 117151 }
 117152 
 117153 // pArray is a pointer to an array of objects. Each object in the
 117154 // array is szEntry bytes in size. This routine uses sqlite3DbRealloc()
 117155 // to extend the array so that there is space for a new object at the end.
 117156 //
 117157 // When this function is called, *pnEntry contains the current size of
 117158 // the array (in entries - so the allocation is ((*pnEntry) * szEntry) bytes
 117159 // in total).
 117160 //
 117161 // If the realloc() is successful (i.e. if no OOM condition occurs), the
 117162 // space allocated for the new object is zeroed, *pnEntry updated to
 117163 // reflect the new size of the array and a pointer to the new allocation
 117164 // returned. *pIdx is set to the index of the new array entry in this case.
 117165 //
 117166 // Otherwise, if the realloc() fails, *pIdx is set to -1, *pnEntry remains
 117167 // unchanged and a copy of pArray returned.
 117168 func Xsqlite3ArrayAllocate(tls *libc.TLS, db uintptr, pArray uintptr, szEntry int32, pnEntry uintptr, pIdx uintptr) uintptr {
 117169 	var z uintptr
 117170 	var n Sqlite3_int64 = Sqlite3_int64(libc.AssignPtrInt32(pIdx, *(*int32)(unsafe.Pointer(pnEntry))))
 117171 	if n&(n-int64(1)) == int64(0) {
 117172 		var sz Sqlite3_int64
 117173 		if n == int64(0) {
 117174 			sz = int64(1)
 117175 		} else {
 117176 			sz = int64(2) * n
 117177 		}
 117178 		var pNew uintptr = Xsqlite3DbRealloc(tls, db, pArray, uint64(sz*Sqlite3_int64(szEntry)))
 117179 		if pNew == uintptr(0) {
 117180 			*(*int32)(unsafe.Pointer(pIdx)) = -1
 117181 			return pArray
 117182 		}
 117183 		pArray = pNew
 117184 	}
 117185 	z = pArray
 117186 	libc.Xmemset(tls, z+uintptr(n*Sqlite3_int64(szEntry)), 0, uint64(szEntry))
 117187 	*(*int32)(unsafe.Pointer(pnEntry))++
 117188 	return pArray
 117189 }
 117190 
 117191 // Append a new element to the given IdList.  Create a new IdList if
 117192 // need be.
 117193 //
 117194 // A new IdList is returned, or NULL if malloc() fails.
 117195 func Xsqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken uintptr) uintptr {
 117196 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 117197 	var i int32
 117198 	if pList == uintptr(0) {
 117199 		pList = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(IdList{})))
 117200 		if pList == uintptr(0) {
 117201 			return uintptr(0)
 117202 		}
 117203 	} else {
 117204 		var pNew uintptr
 117205 		pNew = Xsqlite3DbRealloc(tls, db, pList,
 117206 			uint64(unsafe.Sizeof(IdList{}))+uint64((*IdList)(unsafe.Pointer(pList)).FnId)*uint64(unsafe.Sizeof([1]IdList_item{})))
 117207 		if pNew == uintptr(0) {
 117208 			Xsqlite3IdListDelete(tls, db, pList)
 117209 			return uintptr(0)
 117210 		}
 117211 		pList = pNew
 117212 	}
 117213 	i = libc.PostIncInt32(&(*IdList)(unsafe.Pointer(pList)).FnId, 1)
 117214 	(*IdList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*16)).FzName = Xsqlite3NameFromToken(tls, db, pToken)
 117215 	if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME && (*IdList_item)(unsafe.Pointer(pList+8+uintptr(i)*16)).FzName != 0 {
 117216 		Xsqlite3RenameTokenMap(tls, pParse, (*IdList_item)(unsafe.Pointer(pList+8+uintptr(i)*16)).FzName, pToken)
 117217 	}
 117218 	return pList
 117219 }
 117220 
 117221 // Delete an IdList.
 117222 func Xsqlite3IdListDelete(tls *libc.TLS, db uintptr, pList uintptr) {
 117223 	var i int32
 117224 
 117225 	if pList == uintptr(0) {
 117226 		return
 117227 	}
 117228 
 117229 	for i = 0; i < (*IdList)(unsafe.Pointer(pList)).FnId; i++ {
 117230 		Xsqlite3DbFree(tls, db, (*IdList_item)(unsafe.Pointer(pList+8+uintptr(i)*16)).FzName)
 117231 	}
 117232 	Xsqlite3DbNNFreeNN(tls, db, pList)
 117233 }
 117234 
 117235 // Return the index in pList of the identifier named zId.  Return -1
 117236 // if not found.
 117237 func Xsqlite3IdListIndex(tls *libc.TLS, pList uintptr, zName uintptr) int32 {
 117238 	var i int32
 117239 
 117240 	for i = 0; i < (*IdList)(unsafe.Pointer(pList)).FnId; i++ {
 117241 		if Xsqlite3StrICmp(tls, (*IdList_item)(unsafe.Pointer(pList+8+uintptr(i)*16)).FzName, zName) == 0 {
 117242 			return i
 117243 		}
 117244 	}
 117245 	return -1
 117246 }
 117247 
 117248 // Expand the space allocated for the given SrcList object by
 117249 // creating nExtra new slots beginning at iStart.  iStart is zero based.
 117250 // New slots are zeroed.
 117251 //
 117252 // For example, suppose a SrcList initially contains two entries: A,B.
 117253 // To append 3 new entries onto the end, do this:
 117254 //
 117255 //	sqlite3SrcListEnlarge(db, pSrclist, 3, 2);
 117256 //
 117257 // After the call above it would contain:  A, B, nil, nil, nil.
 117258 // If the iStart argument had been 1 instead of 2, then the result
 117259 // would have been:  A, nil, nil, nil, B.  To prepend the new slots,
 117260 // the iStart value would be 0.  The result then would
 117261 // be: nil, nil, nil, A, B.
 117262 //
 117263 // If a memory allocation fails or the SrcList becomes too large, leave
 117264 // the original SrcList unchanged, return NULL, and leave an error message
 117265 // in pParse.
 117266 func Xsqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra int32, iStart int32) uintptr {
 117267 	bp := tls.Alloc(8)
 117268 	defer tls.Free(8)
 117269 
 117270 	var i int32
 117271 
 117272 	if U32((*SrcList)(unsafe.Pointer(pSrc)).FnSrc)+U32(nExtra) > (*SrcList)(unsafe.Pointer(pSrc)).FnAlloc {
 117273 		var pNew uintptr
 117274 		var nAlloc Sqlite3_int64 = int64(2)*Sqlite3_int64((*SrcList)(unsafe.Pointer(pSrc)).FnSrc) + Sqlite3_int64(nExtra)
 117275 		var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 117276 
 117277 		if (*SrcList)(unsafe.Pointer(pSrc)).FnSrc+nExtra >= SQLITE_MAX_SRCLIST {
 117278 			Xsqlite3ErrorMsg(tls, pParse, ts+15779,
 117279 				libc.VaList(bp, SQLITE_MAX_SRCLIST))
 117280 			return uintptr(0)
 117281 		}
 117282 		if nAlloc > int64(SQLITE_MAX_SRCLIST) {
 117283 			nAlloc = int64(SQLITE_MAX_SRCLIST)
 117284 		}
 117285 		pNew = Xsqlite3DbRealloc(tls, db, pSrc,
 117286 			uint64(unsafe.Sizeof(SrcList{}))+uint64(nAlloc-int64(1))*uint64(unsafe.Sizeof(SrcItem{})))
 117287 		if pNew == uintptr(0) {
 117288 			return uintptr(0)
 117289 		}
 117290 		pSrc = pNew
 117291 		(*SrcList)(unsafe.Pointer(pSrc)).FnAlloc = U32(nAlloc)
 117292 	}
 117293 
 117294 	for i = (*SrcList)(unsafe.Pointer(pSrc)).FnSrc - 1; i >= iStart; i-- {
 117295 		*(*SrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i+nExtra)*104)) = *(*SrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104))
 117296 	}
 117297 	*(*int32)(unsafe.Pointer(pSrc)) += nExtra
 117298 
 117299 	libc.Xmemset(tls, pSrc+8+uintptr(iStart)*104, 0, uint64(unsafe.Sizeof(SrcItem{}))*uint64(nExtra))
 117300 	for i = iStart; i < iStart+nExtra; i++ {
 117301 		(*SrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104)).FiCursor = -1
 117302 	}
 117303 
 117304 	return pSrc
 117305 }
 117306 
 117307 // Append a new table name to the given SrcList.  Create a new SrcList if
 117308 // need be.  A new entry is created in the SrcList even if pTable is NULL.
 117309 //
 117310 // A SrcList is returned, or NULL if there is an OOM error or if the
 117311 // SrcList grows to large.  The returned
 117312 // SrcList might be the same as the SrcList that was input or it might be
 117313 // a new one.  If an OOM error does occurs, then the prior value of pList
 117314 // that is input to this routine is automatically freed.
 117315 //
 117316 // If pDatabase is not null, it means that the table has an optional
 117317 // database name prefix.  Like this:  "database.table".  The pDatabase
 117318 // points to the table name and the pTable points to the database name.
 117319 // The SrcList.a[].zName field is filled with the table name which might
 117320 // come from pTable (if pDatabase is NULL) or from pDatabase.
 117321 // SrcList.a[].zDatabase is filled with the database name from pTable,
 117322 // or with NULL if no database is specified.
 117323 //
 117324 // In other words, if call like this:
 117325 //
 117326 //	sqlite3SrcListAppend(D,A,B,0);
 117327 //
 117328 // Then B is a table name and the database name is unspecified.  If called
 117329 // like this:
 117330 //
 117331 //	sqlite3SrcListAppend(D,A,B,C);
 117332 //
 117333 // Then C is the table name and B is the database name.  If C is defined
 117334 // then so is B.  In other words, we never have a case where:
 117335 //
 117336 //	sqlite3SrcListAppend(D,A,0,C);
 117337 //
 117338 // Both pTable and pDatabase are assumed to be quoted.  They are dequoted
 117339 // before being added to the SrcList.
 117340 func Xsqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable uintptr, pDatabase uintptr) uintptr {
 117341 	var pItem uintptr
 117342 	var db uintptr
 117343 
 117344 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 117345 	if pList == uintptr(0) {
 117346 		pList = Xsqlite3DbMallocRawNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(SrcList{})))
 117347 		if pList == uintptr(0) {
 117348 			return uintptr(0)
 117349 		}
 117350 		(*SrcList)(unsafe.Pointer(pList)).FnAlloc = U32(1)
 117351 		(*SrcList)(unsafe.Pointer(pList)).FnSrc = 1
 117352 		libc.Xmemset(tls, pList+8, 0, uint64(unsafe.Sizeof(SrcItem{})))
 117353 		(*SrcItem)(unsafe.Pointer(pList + 8)).FiCursor = -1
 117354 	} else {
 117355 		var pNew uintptr = Xsqlite3SrcListEnlarge(tls, pParse, pList, 1, (*SrcList)(unsafe.Pointer(pList)).FnSrc)
 117356 		if pNew == uintptr(0) {
 117357 			Xsqlite3SrcListDelete(tls, db, pList)
 117358 			return uintptr(0)
 117359 		} else {
 117360 			pList = pNew
 117361 		}
 117362 	}
 117363 	pItem = pList + 8 + uintptr((*SrcList)(unsafe.Pointer(pList)).FnSrc-1)*104
 117364 	if pDatabase != 0 && (*Token)(unsafe.Pointer(pDatabase)).Fz == uintptr(0) {
 117365 		pDatabase = uintptr(0)
 117366 	}
 117367 	if pDatabase != 0 {
 117368 		(*SrcItem)(unsafe.Pointer(pItem)).FzName = Xsqlite3NameFromToken(tls, db, pDatabase)
 117369 		(*SrcItem)(unsafe.Pointer(pItem)).FzDatabase = Xsqlite3NameFromToken(tls, db, pTable)
 117370 	} else {
 117371 		(*SrcItem)(unsafe.Pointer(pItem)).FzName = Xsqlite3NameFromToken(tls, db, pTable)
 117372 		(*SrcItem)(unsafe.Pointer(pItem)).FzDatabase = uintptr(0)
 117373 	}
 117374 	return pList
 117375 }
 117376 
 117377 // Assign VdbeCursor index numbers to all tables in a SrcList
 117378 func Xsqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) {
 117379 	var i int32
 117380 	var pItem uintptr
 117381 
 117382 	if pList != 0 {
 117383 		i = 0
 117384 		pItem = pList + 8
 117385 	__1:
 117386 		if !(i < (*SrcList)(unsafe.Pointer(pList)).FnSrc) {
 117387 			goto __3
 117388 		}
 117389 		{
 117390 			if (*SrcItem)(unsafe.Pointer(pItem)).FiCursor >= 0 {
 117391 				goto __2
 117392 			}
 117393 			(*SrcItem)(unsafe.Pointer(pItem)).FiCursor = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 117394 			if (*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0 {
 117395 				Xsqlite3SrcListAssignCursors(tls, pParse, (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FpSrc)
 117396 			}
 117397 
 117398 		}
 117399 		goto __2
 117400 	__2:
 117401 		i++
 117402 		pItem += 104
 117403 		goto __1
 117404 		goto __3
 117405 	__3:
 117406 	}
 117407 }
 117408 
 117409 // Delete an entire SrcList including all its substructure.
 117410 func Xsqlite3SrcListDelete(tls *libc.TLS, db uintptr, pList uintptr) {
 117411 	var i int32
 117412 	var pItem uintptr
 117413 
 117414 	if pList == uintptr(0) {
 117415 		return
 117416 	}
 117417 	pItem = pList + 8
 117418 	i = 0
 117419 __1:
 117420 	if !(i < (*SrcList)(unsafe.Pointer(pList)).FnSrc) {
 117421 		goto __3
 117422 	}
 117423 	{
 117424 		if (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase != 0 {
 117425 			Xsqlite3DbNNFreeNN(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase)
 117426 		}
 117427 		if (*SrcItem)(unsafe.Pointer(pItem)).FzName != 0 {
 117428 			Xsqlite3DbNNFreeNN(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FzName)
 117429 		}
 117430 		if (*SrcItem)(unsafe.Pointer(pItem)).FzAlias != 0 {
 117431 			Xsqlite3DbNNFreeNN(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FzAlias)
 117432 		}
 117433 		if uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x2>>1)) != 0 {
 117434 			Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 88)))
 117435 		}
 117436 		if uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x4>>2)) != 0 {
 117437 			Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 88)))
 117438 		}
 117439 		Xsqlite3DeleteTable(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FpTab)
 117440 		if (*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0 {
 117441 			Xsqlite3SelectDelete(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FpSelect)
 117442 		}
 117443 		if uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x400>>10)) != 0 {
 117444 			Xsqlite3IdListDelete(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72)))
 117445 		} else if *(*uintptr)(unsafe.Pointer(pItem + 72)) != 0 {
 117446 			Xsqlite3ExprDelete(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72)))
 117447 		}
 117448 
 117449 	}
 117450 	goto __2
 117451 __2:
 117452 	i++
 117453 	pItem += 104
 117454 	goto __1
 117455 	goto __3
 117456 __3:
 117457 	;
 117458 	Xsqlite3DbNNFreeNN(tls, db, pList)
 117459 }
 117460 
 117461 // This routine is called by the parser to add a new term to the
 117462 // end of a growing FROM clause.  The "p" parameter is the part of
 117463 // the FROM clause that has already been constructed.  "p" is NULL
 117464 // if this is the first term of the FROM clause.  pTable and pDatabase
 117465 // are the name of the table and database named in the FROM clause term.
 117466 // pDatabase is NULL if the database name qualifier is missing - the
 117467 // usual case.  If the term has an alias, then pAlias points to the
 117468 // alias token.  If the term is a subquery, then pSubquery is the
 117469 // SELECT statement that the subquery encodes.  The pTable and
 117470 // pDatabase parameters are NULL for subqueries.  The pOn and pUsing
 117471 // parameters are the content of the ON and USING clauses.
 117472 //
 117473 // Return a new SrcList which encodes is the FROM with the new
 117474 // term added.
 117475 func Xsqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTable uintptr, pDatabase uintptr, pAlias uintptr, pSubquery uintptr, pOnUsing uintptr) uintptr {
 117476 	bp := tls.Alloc(8)
 117477 	defer tls.Free(8)
 117478 
 117479 	var pItem uintptr
 117480 	var db uintptr
 117481 	var pToken uintptr
 117482 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 117483 	if !(!(p != 0) && pOnUsing != uintptr(0) && ((*OnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 || (*OnOrUsing)(unsafe.Pointer(pOnUsing)).FpUsing != 0)) {
 117484 		goto __1
 117485 	}
 117486 	Xsqlite3ErrorMsg(tls, pParse, ts+15815,
 117487 		libc.VaList(bp, func() uintptr {
 117488 			if (*OnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 {
 117489 				return ts + 15851
 117490 			}
 117491 			return ts + 15854
 117492 		}()))
 117493 	goto append_from_error
 117494 __1:
 117495 	;
 117496 	p = Xsqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase)
 117497 	if !(p == uintptr(0)) {
 117498 		goto __2
 117499 	}
 117500 	goto append_from_error
 117501 __2:
 117502 	;
 117503 	pItem = p + 8 + uintptr((*SrcList)(unsafe.Pointer(p)).FnSrc-1)*104
 117504 
 117505 	if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME && (*SrcItem)(unsafe.Pointer(pItem)).FzName != 0) {
 117506 		goto __3
 117507 	}
 117508 	if pDatabase != 0 && (*Token)(unsafe.Pointer(pDatabase)).Fz != 0 {
 117509 		pToken = pDatabase
 117510 	} else {
 117511 		pToken = pTable
 117512 	}
 117513 	Xsqlite3RenameTokenMap(tls, pParse, (*SrcItem)(unsafe.Pointer(pItem)).FzName, pToken)
 117514 __3:
 117515 	;
 117516 	if !((*Token)(unsafe.Pointer(pAlias)).Fn != 0) {
 117517 		goto __4
 117518 	}
 117519 	(*SrcItem)(unsafe.Pointer(pItem)).FzAlias = Xsqlite3NameFromToken(tls, db, pAlias)
 117520 __4:
 117521 	;
 117522 	if !(pSubquery != 0) {
 117523 		goto __5
 117524 	}
 117525 	(*SrcItem)(unsafe.Pointer(pItem)).FpSelect = pSubquery
 117526 	if !((*Select)(unsafe.Pointer(pSubquery)).FselFlags&U32(SF_NestedFrom) != 0) {
 117527 		goto __6
 117528 	}
 117529 	libc.SetBitFieldPtr16Uint32(pItem+60+4, uint32(1), 13, 0x2000)
 117530 __6:
 117531 	;
 117532 __5:
 117533 	;
 117534 	if !(pOnUsing == uintptr(0)) {
 117535 		goto __7
 117536 	}
 117537 	*(*uintptr)(unsafe.Pointer(pItem + 72)) = uintptr(0)
 117538 	goto __8
 117539 __7:
 117540 	if !((*OnOrUsing)(unsafe.Pointer(pOnUsing)).FpUsing != 0) {
 117541 		goto __9
 117542 	}
 117543 	libc.SetBitFieldPtr16Uint32(pItem+60+4, uint32(1), 10, 0x400)
 117544 	*(*uintptr)(unsafe.Pointer(pItem + 72)) = (*OnOrUsing)(unsafe.Pointer(pOnUsing)).FpUsing
 117545 	goto __10
 117546 __9:
 117547 	*(*uintptr)(unsafe.Pointer(pItem + 72)) = (*OnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn
 117548 __10:
 117549 	;
 117550 __8:
 117551 	;
 117552 	return p
 117553 
 117554 append_from_error:
 117555 	;
 117556 	Xsqlite3ClearOnOrUsing(tls, db, pOnUsing)
 117557 	Xsqlite3SelectDelete(tls, db, pSubquery)
 117558 	return uintptr(0)
 117559 }
 117560 
 117561 // Add an INDEXED BY or NOT INDEXED clause to the most recently added
 117562 // element of the source-list passed as the second argument.
 117563 func Xsqlite3SrcListIndexedBy(tls *libc.TLS, pParse uintptr, p uintptr, pIndexedBy uintptr) {
 117564 	if p != 0 && (*Token)(unsafe.Pointer(pIndexedBy)).Fn > uint32(0) {
 117565 		var pItem uintptr
 117566 
 117567 		pItem = p + 8 + uintptr((*SrcList)(unsafe.Pointer(p)).FnSrc-1)*104
 117568 
 117569 		if (*Token)(unsafe.Pointer(pIndexedBy)).Fn == uint32(1) && !(int32((*Token)(unsafe.Pointer(pIndexedBy)).Fz) != 0) {
 117570 			libc.SetBitFieldPtr16Uint32(pItem+60+4, uint32(1), 0, 0x1)
 117571 		} else {
 117572 			*(*uintptr)(unsafe.Pointer(pItem + 88)) = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pIndexedBy)
 117573 			libc.SetBitFieldPtr16Uint32(pItem+60+4, uint32(1), 1, 0x2)
 117574 
 117575 		}
 117576 	}
 117577 }
 117578 
 117579 // Append the contents of SrcList p2 to SrcList p1 and return the resulting
 117580 // SrcList. Or, if an error occurs, return NULL. In all cases, p1 and p2
 117581 // are deleted by this function.
 117582 func Xsqlite3SrcListAppendList(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uintptr) uintptr {
 117583 	if p2 != 0 {
 117584 		var pNew uintptr = Xsqlite3SrcListEnlarge(tls, pParse, p1, (*SrcList)(unsafe.Pointer(p2)).FnSrc, 1)
 117585 		if pNew == uintptr(0) {
 117586 			Xsqlite3SrcListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, p2)
 117587 		} else {
 117588 			p1 = pNew
 117589 			libc.Xmemcpy(tls, p1+8+1*104, p2+8, uint64((*SrcList)(unsafe.Pointer(p2)).FnSrc)*uint64(unsafe.Sizeof(SrcItem{})))
 117590 			Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, p2)
 117591 			*(*U8)(unsafe.Pointer(p1 + 8 + 60)) |= U8(JT_LTORJ & int32((*SrcItem)(unsafe.Pointer(p1+8+1*104)).Ffg.Fjointype))
 117592 		}
 117593 	}
 117594 	return p1
 117595 }
 117596 
 117597 // Add the list of function arguments to the SrcList entry for a
 117598 // table-valued-function.
 117599 func Xsqlite3SrcListFuncArgs(tls *libc.TLS, pParse uintptr, p uintptr, pList uintptr) {
 117600 	if p != 0 {
 117601 		var pItem uintptr = p + 8 + uintptr((*SrcList)(unsafe.Pointer(p)).FnSrc-1)*104
 117602 
 117603 		*(*uintptr)(unsafe.Pointer(pItem + 88)) = pList
 117604 		libc.SetBitFieldPtr16Uint32(pItem+60+4, uint32(1), 2, 0x4)
 117605 	} else {
 117606 		Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pList)
 117607 	}
 117608 }
 117609 
 117610 // When building up a FROM clause in the parser, the join operator
 117611 // is initially attached to the left operand.  But the code generator
 117612 // expects the join operator to be on the right operand.  This routine
 117613 // Shifts all join operators from left to right for an entire FROM
 117614 // clause.
 117615 //
 117616 // Example: Suppose the join is like this:
 117617 //
 117618 //	A natural cross join B
 117619 //
 117620 // The operator is "natural cross join".  The A and B operands are stored
 117621 // in p->a[0] and p->a[1], respectively.  The parser initially stores the
 117622 // operator with A.  This routine shifts that operator over to B.
 117623 //
 117624 // Additional changes:
 117625 //
 117626 //   - All tables to the left of the right-most RIGHT JOIN are tagged with
 117627 //     JT_LTORJ (mnemonic: Left Table Of Right Join) so that the
 117628 //     code generator can easily tell that the table is part of
 117629 //     the left operand of at least one RIGHT JOIN.
 117630 func Xsqlite3SrcListShiftJoinType(tls *libc.TLS, pParse uintptr, p uintptr) {
 117631 	_ = pParse
 117632 	if p != 0 && (*SrcList)(unsafe.Pointer(p)).FnSrc > 1 {
 117633 		var i int32 = (*SrcList)(unsafe.Pointer(p)).FnSrc - 1
 117634 		var allFlags U8 = U8(0)
 117635 		for __ccgo := true; __ccgo; __ccgo = libc.PreDecInt32(&i, 1) > 0 {
 117636 			allFlags = U8(int32(allFlags) | int32(libc.AssignPtrUint8(p+8+uintptr(i)*104+60, (*SrcItem)(unsafe.Pointer(p+8+uintptr(i-1)*104)).Ffg.Fjointype)))
 117637 		}
 117638 		(*SrcItem)(unsafe.Pointer(p + 8)).Ffg.Fjointype = U8(0)
 117639 
 117640 		if int32(allFlags)&JT_RIGHT != 0 {
 117641 			for i = (*SrcList)(unsafe.Pointer(p)).FnSrc - 1; i > 0 && int32((*SrcItem)(unsafe.Pointer(p+8+uintptr(i)*104)).Ffg.Fjointype)&JT_RIGHT == 0; i-- {
 117642 			}
 117643 			i--
 117644 
 117645 			for __ccgo1 := true; __ccgo1; __ccgo1 = libc.PreDecInt32(&i, 1) >= 0 {
 117646 				*(*U8)(unsafe.Pointer(p + 8 + uintptr(i)*104 + 60)) |= U8(JT_LTORJ)
 117647 			}
 117648 		}
 117649 	}
 117650 }
 117651 
 117652 // Generate VDBE code for a BEGIN statement.
 117653 func Xsqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) {
 117654 	var db uintptr
 117655 	var v uintptr
 117656 	var i int32
 117657 
 117658 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 117659 
 117660 	if Xsqlite3AuthCheck(tls, pParse, SQLITE_TRANSACTION, ts+15860, uintptr(0), uintptr(0)) != 0 {
 117661 		return
 117662 	}
 117663 	v = Xsqlite3GetVdbe(tls, pParse)
 117664 	if !(v != 0) {
 117665 		return
 117666 	}
 117667 	if type1 != TK_DEFERRED {
 117668 		for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
 117669 			var eTxnType int32
 117670 			var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt
 117671 			if pBt != 0 && Xsqlite3BtreeIsReadonly(tls, pBt) != 0 {
 117672 				eTxnType = 0
 117673 			} else if type1 == TK_EXCLUSIVE {
 117674 				eTxnType = 2
 117675 			} else {
 117676 				eTxnType = 1
 117677 			}
 117678 			Xsqlite3VdbeAddOp2(tls, v, OP_Transaction, i, eTxnType)
 117679 			Xsqlite3VdbeUsesBtree(tls, v, i)
 117680 		}
 117681 	}
 117682 	Xsqlite3VdbeAddOp0(tls, v, OP_AutoCommit)
 117683 }
 117684 
 117685 // Generate VDBE code for a COMMIT or ROLLBACK statement.
 117686 // Code for ROLLBACK is generated if eType==TK_ROLLBACK.  Otherwise
 117687 // code is generated for a COMMIT.
 117688 func Xsqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) {
 117689 	var v uintptr
 117690 	var isRollback int32
 117691 
 117692 	isRollback = libc.Bool32(eType == TK_ROLLBACK)
 117693 	if Xsqlite3AuthCheck(tls, pParse, SQLITE_TRANSACTION,
 117694 		func() uintptr {
 117695 			if isRollback != 0 {
 117696 				return ts + 15866
 117697 			}
 117698 			return ts + 15875
 117699 		}(), uintptr(0), uintptr(0)) != 0 {
 117700 		return
 117701 	}
 117702 	v = Xsqlite3GetVdbe(tls, pParse)
 117703 	if v != 0 {
 117704 		Xsqlite3VdbeAddOp2(tls, v, OP_AutoCommit, 1, isRollback)
 117705 	}
 117706 }
 117707 
 117708 // This function is called by the parser when it parses a command to create,
 117709 // release or rollback an SQL savepoint.
 117710 func Xsqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) {
 117711 	var zName uintptr = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pName)
 117712 	if zName != 0 {
 117713 		var v uintptr = Xsqlite3GetVdbe(tls, pParse)
 117714 
 117715 		if !(v != 0) || Xsqlite3AuthCheck(tls, pParse, SQLITE_SAVEPOINT, az[op], zName, uintptr(0)) != 0 {
 117716 			Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, zName)
 117717 			return
 117718 		}
 117719 		Xsqlite3VdbeAddOp4(tls, v, OP_Savepoint, op, 0, 0, zName, -6)
 117720 	}
 117721 }
 117722 
 117723 var az = [3]uintptr{ts + 15860, ts + 15882, ts + 15866}
 117724 
 117725 // Make sure the TEMP database is open and available for use.  Return
 117726 // the number of errors.  Leave any error messages in the pParse structure.
 117727 func Xsqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) int32 {
 117728 	bp := tls.Alloc(8)
 117729 	defer tls.Free(8)
 117730 
 117731 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 117732 	if (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpBt == uintptr(0) && !(int32((*Parse)(unsafe.Pointer(pParse)).Fexplain) != 0) {
 117733 		var rc int32
 117734 
 117735 		rc = Xsqlite3BtreeOpen(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, bp, 0, flags)
 117736 		if rc != SQLITE_OK {
 117737 			Xsqlite3ErrorMsg(tls, pParse,
 117738 				ts+15890, 0)
 117739 			(*Parse)(unsafe.Pointer(pParse)).Frc = rc
 117740 			return 1
 117741 		}
 117742 		(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).FpBt = *(*uintptr)(unsafe.Pointer(bp))
 117743 
 117744 		if SQLITE_NOMEM == Xsqlite3BtreeSetPageSize(tls, *(*uintptr)(unsafe.Pointer(bp)), (*Sqlite3)(unsafe.Pointer(db)).FnextPagesize, 0, 0) {
 117745 			Xsqlite3OomFault(tls, db)
 117746 			return 1
 117747 		}
 117748 	}
 117749 	return 0
 117750 }
 117751 
 117752 var flags int32 = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_DELETEONCLOSE | SQLITE_OPEN_TEMP_DB
 117753 
 117754 func sqlite3CodeVerifySchemaAtToplevel(tls *libc.TLS, pToplevel uintptr, iDb int32) {
 117755 	if libc.Bool32((*Parse)(unsafe.Pointer(pToplevel)).FcookieMask&(YDbMask(1)<<iDb) != YDbMask(0)) == 0 {
 117756 		*(*YDbMask)(unsafe.Pointer(pToplevel + 124)) |= YDbMask(1) << iDb
 117757 		if !(0 != 0) && iDb == 1 {
 117758 			Xsqlite3OpenTempDatabase(tls, pToplevel)
 117759 		}
 117760 	}
 117761 }
 117762 
 117763 func Xsqlite3CodeVerifySchema(tls *libc.TLS, pParse uintptr, iDb int32) {
 117764 	sqlite3CodeVerifySchemaAtToplevel(tls, func() uintptr {
 117765 		if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
 117766 			return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
 117767 		}
 117768 		return pParse
 117769 	}(), iDb)
 117770 }
 117771 
 117772 // If argument zDb is NULL, then call sqlite3CodeVerifySchema() for each
 117773 // attached database. Otherwise, invoke it for the database named zDb only.
 117774 func Xsqlite3CodeVerifyNamedSchema(tls *libc.TLS, pParse uintptr, zDb uintptr) {
 117775 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 117776 	var i int32
 117777 	for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
 117778 		var pDb uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32
 117779 		if (*Db)(unsafe.Pointer(pDb)).FpBt != 0 && (!(zDb != 0) || 0 == Xsqlite3StrICmp(tls, zDb, (*Db)(unsafe.Pointer(pDb)).FzDbSName)) {
 117780 			Xsqlite3CodeVerifySchema(tls, pParse, i)
 117781 		}
 117782 	}
 117783 }
 117784 
 117785 // Generate VDBE code that prepares for doing an operation that
 117786 // might change the database.
 117787 //
 117788 // This routine starts a new transaction if we are not already within
 117789 // a transaction.  If we are already within a transaction, then a checkpoint
 117790 // is set if the setStatement parameter is true.  A checkpoint should
 117791 // be set for operations that might fail (due to a constraint) part of
 117792 // the way through and which will need to undo some writes without having to
 117793 // rollback the whole transaction.  For operations where all constraints
 117794 // can be checked before any changes are made to the database, it is never
 117795 // necessary to undo a write and the checkpoint should not be set.
 117796 func Xsqlite3BeginWriteOperation(tls *libc.TLS, pParse uintptr, setStatement int32, iDb int32) {
 117797 	var pToplevel uintptr = func() uintptr {
 117798 		if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
 117799 			return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
 117800 		}
 117801 		return pParse
 117802 	}()
 117803 	sqlite3CodeVerifySchemaAtToplevel(tls, pToplevel, iDb)
 117804 	*(*YDbMask)(unsafe.Pointer(pToplevel + 120)) |= YDbMask(1) << iDb
 117805 	*(*U8)(unsafe.Pointer(pToplevel + 32)) |= U8(setStatement)
 117806 }
 117807 
 117808 // Indicate that the statement currently under construction might write
 117809 // more than one entry (example: deleting one row then inserting another,
 117810 // inserting multiple rows in a table, or inserting a row and index entries.)
 117811 // If an abort occurs after some of these writes have completed, then it will
 117812 // be necessary to undo the completed writes.
 117813 func Xsqlite3MultiWrite(tls *libc.TLS, pParse uintptr) {
 117814 	var pToplevel uintptr = func() uintptr {
 117815 		if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
 117816 			return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
 117817 		}
 117818 		return pParse
 117819 	}()
 117820 	(*Parse)(unsafe.Pointer(pToplevel)).FisMultiWrite = U8(1)
 117821 }
 117822 
 117823 // The code generator calls this routine if is discovers that it is
 117824 // possible to abort a statement prior to completion.  In order to
 117825 // perform this abort without corrupting the database, we need to make
 117826 // sure that the statement is protected by a statement transaction.
 117827 //
 117828 // Technically, we only need to set the mayAbort flag if the
 117829 // isMultiWrite flag was previously set.  There is a time dependency
 117830 // such that the abort must occur after the multiwrite.  This makes
 117831 // some statements involving the REPLACE conflict resolution algorithm
 117832 // go a little faster.  But taking advantage of this time dependency
 117833 // makes it more difficult to prove that the code is correct (in
 117834 // particular, it prevents us from writing an effective
 117835 // implementation of sqlite3AssertMayAbort()) and so we have chosen
 117836 // to take the safe route and skip the optimization.
 117837 func Xsqlite3MayAbort(tls *libc.TLS, pParse uintptr) {
 117838 	var pToplevel uintptr = func() uintptr {
 117839 		if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
 117840 			return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
 117841 		}
 117842 		return pParse
 117843 	}()
 117844 	(*Parse)(unsafe.Pointer(pToplevel)).FmayAbort = U8(1)
 117845 }
 117846 
 117847 // Code an OP_Halt that causes the vdbe to return an SQLITE_CONSTRAINT
 117848 // error. The onError parameter determines which (if any) of the statement
 117849 // and/or current transaction is rolled back.
 117850 func Xsqlite3HaltConstraint(tls *libc.TLS, pParse uintptr, errCode int32, onError int32, p4 uintptr, p4type I8, p5Errmsg U8) {
 117851 	var v uintptr
 117852 
 117853 	v = Xsqlite3GetVdbe(tls, pParse)
 117854 
 117855 	if onError == OE_Abort {
 117856 		Xsqlite3MayAbort(tls, pParse)
 117857 	}
 117858 	Xsqlite3VdbeAddOp4(tls, v, OP_Halt, errCode, onError, 0, p4, int32(p4type))
 117859 	Xsqlite3VdbeChangeP5(tls, v, uint16(p5Errmsg))
 117860 }
 117861 
 117862 // Code an OP_Halt due to UNIQUE or PRIMARY KEY constraint violation.
 117863 func Xsqlite3UniqueConstraint(tls *libc.TLS, pParse uintptr, onError int32, pIdx uintptr) {
 117864 	bp := tls.Alloc(40)
 117865 	defer tls.Free(40)
 117866 
 117867 	var zErr uintptr
 117868 	var j int32
 117869 
 117870 	var pTab uintptr = (*Index)(unsafe.Pointer(pIdx)).FpTable
 117871 
 117872 	Xsqlite3StrAccumInit(tls, bp+8, (*Parse)(unsafe.Pointer(pParse)).Fdb, uintptr(0), 0,
 117873 		*(*int32)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb + 136)))
 117874 	if (*Index)(unsafe.Pointer(pIdx)).FaColExpr != 0 {
 117875 		Xsqlite3_str_appendf(tls, bp+8, ts+15960, libc.VaList(bp, (*Index)(unsafe.Pointer(pIdx)).FzName))
 117876 	} else {
 117877 		for j = 0; j < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol); j++ {
 117878 			var zCol uintptr
 117879 
 117880 			zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)))*24)).FzCnName
 117881 			if j != 0 {
 117882 				Xsqlite3_str_append(tls, bp+8, ts+15971, 2)
 117883 			}
 117884 			Xsqlite3_str_appendall(tls, bp+8, (*Table)(unsafe.Pointer(pTab)).FzName)
 117885 			Xsqlite3_str_append(tls, bp+8, ts+1557, 1)
 117886 			Xsqlite3_str_appendall(tls, bp+8, zCol)
 117887 		}
 117888 	}
 117889 	zErr = Xsqlite3StrAccumFinish(tls, bp+8)
 117890 	Xsqlite3HaltConstraint(tls, pParse,
 117891 		func() int32 {
 117892 			if int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY {
 117893 				return SQLITE_CONSTRAINT | int32(6)<<8
 117894 			}
 117895 			return SQLITE_CONSTRAINT | int32(8)<<8
 117896 		}(),
 117897 		onError, zErr, int8(-6), uint8(P5_ConstraintUnique))
 117898 }
 117899 
 117900 // Code an OP_Halt due to non-unique rowid.
 117901 func Xsqlite3RowidConstraint(tls *libc.TLS, pParse uintptr, onError int32, pTab uintptr) {
 117902 	bp := tls.Alloc(24)
 117903 	defer tls.Free(24)
 117904 
 117905 	var zMsg uintptr
 117906 	var rc int32
 117907 	if int32((*Table)(unsafe.Pointer(pTab)).FiPKey) >= 0 {
 117908 		zMsg = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+13413, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName,
 117909 			(*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr((*Table)(unsafe.Pointer(pTab)).FiPKey)*24)).FzCnName))
 117910 		rc = SQLITE_CONSTRAINT | int32(6)<<8
 117911 	} else {
 117912 		zMsg = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+15974, libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName))
 117913 		rc = SQLITE_CONSTRAINT | int32(10)<<8
 117914 	}
 117915 	Xsqlite3HaltConstraint(tls, pParse, rc, onError, zMsg, int8(-6),
 117916 		uint8(P5_ConstraintUnique))
 117917 }
 117918 
 117919 func collationMatch(tls *libc.TLS, zColl uintptr, pIndex uintptr) int32 {
 117920 	var i int32
 117921 
 117922 	for i = 0; i < int32((*Index)(unsafe.Pointer(pIndex)).FnColumn); i++ {
 117923 		var z uintptr = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FazColl + uintptr(i)*8))
 117924 
 117925 		if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2))) >= 0 && 0 == Xsqlite3StrICmp(tls, z, zColl) {
 117926 			return 1
 117927 		}
 117928 	}
 117929 	return 0
 117930 }
 117931 
 117932 func reindexTable(tls *libc.TLS, pParse uintptr, pTab uintptr, zColl uintptr) {
 117933 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
 117934 		var pIndex uintptr
 117935 
 117936 		for pIndex = (*Table)(unsafe.Pointer(pTab)).FpIndex; pIndex != 0; pIndex = (*Index)(unsafe.Pointer(pIndex)).FpNext {
 117937 			if zColl == uintptr(0) || collationMatch(tls, zColl, pIndex) != 0 {
 117938 				var iDb int32 = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Table)(unsafe.Pointer(pTab)).FpSchema)
 117939 				Xsqlite3BeginWriteOperation(tls, pParse, 0, iDb)
 117940 				sqlite3RefillIndex(tls, pParse, pIndex, -1)
 117941 			}
 117942 		}
 117943 	}
 117944 }
 117945 
 117946 func reindexDatabases(tls *libc.TLS, pParse uintptr, zColl uintptr) {
 117947 	var pDb uintptr
 117948 	var iDb int32
 117949 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 117950 	var k uintptr
 117951 	var pTab uintptr
 117952 
 117953 	iDb = 0
 117954 	pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb
 117955 __1:
 117956 	if !(iDb < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
 117957 		goto __3
 117958 	}
 117959 	{
 117960 		for k = (*Hash)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema + 8)).Ffirst; k != 0; k = (*HashElem)(unsafe.Pointer(k)).Fnext {
 117961 			pTab = (*HashElem)(unsafe.Pointer(k)).Fdata
 117962 			reindexTable(tls, pParse, pTab, zColl)
 117963 		}
 117964 
 117965 	}
 117966 	goto __2
 117967 __2:
 117968 	iDb++
 117969 	pDb += 32
 117970 	goto __1
 117971 	goto __3
 117972 __3:
 117973 }
 117974 
 117975 // Generate code for the REINDEX command.
 117976 //
 117977 //	REINDEX                            -- 1
 117978 //	REINDEX  <collation>               -- 2
 117979 //	REINDEX  ?<database>.?<tablename>  -- 3
 117980 //	REINDEX  ?<database>.?<indexname>  -- 4
 117981 //
 117982 // Form 1 causes all indices in all attached databases to be rebuilt.
 117983 // Form 2 rebuilds all indices in all databases that use the named
 117984 // collating function.  Forms 3 and 4 rebuild the named index or all
 117985 // indices associated with the named table.
 117986 func Xsqlite3Reindex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr) {
 117987 	bp := tls.Alloc(8)
 117988 	defer tls.Free(8)
 117989 
 117990 	var pColl uintptr
 117991 	var z uintptr
 117992 	var zDb uintptr
 117993 	var pTab uintptr
 117994 	var pIndex uintptr
 117995 	var iDb int32
 117996 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 117997 
 117998 	if SQLITE_OK != Xsqlite3ReadSchema(tls, pParse) {
 117999 		return
 118000 	}
 118001 
 118002 	if pName1 == uintptr(0) {
 118003 		reindexDatabases(tls, pParse, uintptr(0))
 118004 		return
 118005 	} else if pName2 == uintptr(0) || (*Token)(unsafe.Pointer(pName2)).Fz == uintptr(0) {
 118006 		var zColl uintptr
 118007 
 118008 		zColl = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pName1)
 118009 		if !(zColl != 0) {
 118010 			return
 118011 		}
 118012 		pColl = Xsqlite3FindCollSeq(tls, db, (*Sqlite3)(unsafe.Pointer(db)).Fenc, zColl, 0)
 118013 		if pColl != 0 {
 118014 			reindexDatabases(tls, pParse, zColl)
 118015 			Xsqlite3DbFree(tls, db, zColl)
 118016 			return
 118017 		}
 118018 		Xsqlite3DbFree(tls, db, zColl)
 118019 	}
 118020 	iDb = Xsqlite3TwoPartName(tls, pParse, pName1, pName2, bp)
 118021 	if iDb < 0 {
 118022 		return
 118023 	}
 118024 	z = Xsqlite3NameFromToken(tls, db, *(*uintptr)(unsafe.Pointer(bp)))
 118025 	if z == uintptr(0) {
 118026 		return
 118027 	}
 118028 	zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
 118029 	pTab = Xsqlite3FindTable(tls, db, z, zDb)
 118030 	if pTab != 0 {
 118031 		reindexTable(tls, pParse, pTab, uintptr(0))
 118032 		Xsqlite3DbFree(tls, db, z)
 118033 		return
 118034 	}
 118035 	pIndex = Xsqlite3FindIndex(tls, db, z, zDb)
 118036 	Xsqlite3DbFree(tls, db, z)
 118037 	if pIndex != 0 {
 118038 		Xsqlite3BeginWriteOperation(tls, pParse, 0, iDb)
 118039 		sqlite3RefillIndex(tls, pParse, pIndex, -1)
 118040 		return
 118041 	}
 118042 	Xsqlite3ErrorMsg(tls, pParse, ts+15983, 0)
 118043 }
 118044 
 118045 // Return a KeyInfo structure that is appropriate for the given Index.
 118046 //
 118047 // The caller should invoke sqlite3KeyInfoUnref() on the returned object
 118048 // when it has finished using it.
 118049 func Xsqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) uintptr {
 118050 	var i int32
 118051 	var nCol int32 = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
 118052 	var nKey int32 = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
 118053 	var pKey uintptr
 118054 	if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 118055 		return uintptr(0)
 118056 	}
 118057 	if uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x8>>3)) != 0 {
 118058 		pKey = Xsqlite3KeyInfoAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, nKey, nCol-nKey)
 118059 	} else {
 118060 		pKey = Xsqlite3KeyInfoAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, nCol, 0)
 118061 	}
 118062 	if pKey != 0 {
 118063 		for i = 0; i < nCol; i++ {
 118064 			var zColl uintptr = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(i)*8))
 118065 			*(*uintptr)(unsafe.Pointer(pKey + 32 + uintptr(i)*8)) = func() uintptr {
 118066 				if zColl == uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)) {
 118067 					return uintptr(0)
 118068 				}
 118069 				return Xsqlite3LocateCollSeq(tls, pParse, zColl)
 118070 			}()
 118071 			*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKey)).FaSortFlags + uintptr(i))) = *(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i)))
 118072 
 118073 		}
 118074 		if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 118075 			if int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x100>>8) == 0 {
 118076 				libc.SetBitFieldPtr16Uint32(pIdx+100, uint32(1), 8, 0x100)
 118077 				(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR | int32(2)<<8
 118078 			}
 118079 			Xsqlite3KeyInfoUnref(tls, pKey)
 118080 			pKey = uintptr(0)
 118081 		}
 118082 	}
 118083 	return pKey
 118084 }
 118085 
 118086 // Create a new CTE object
 118087 func Xsqlite3CteNew(tls *libc.TLS, pParse uintptr, pName uintptr, pArglist uintptr, pQuery uintptr, eM10d U8) uintptr {
 118088 	var pNew uintptr
 118089 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 118090 
 118091 	pNew = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Cte{})))
 118092 
 118093 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 118094 		Xsqlite3ExprListDelete(tls, db, pArglist)
 118095 		Xsqlite3SelectDelete(tls, db, pQuery)
 118096 	} else {
 118097 		(*Cte)(unsafe.Pointer(pNew)).FpSelect = pQuery
 118098 		(*Cte)(unsafe.Pointer(pNew)).FpCols = pArglist
 118099 		(*Cte)(unsafe.Pointer(pNew)).FzName = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pName)
 118100 		(*Cte)(unsafe.Pointer(pNew)).FeM10d = eM10d
 118101 	}
 118102 	return pNew
 118103 }
 118104 
 118105 func cteClear(tls *libc.TLS, db uintptr, pCte uintptr) {
 118106 	Xsqlite3ExprListDelete(tls, db, (*Cte)(unsafe.Pointer(pCte)).FpCols)
 118107 	Xsqlite3SelectDelete(tls, db, (*Cte)(unsafe.Pointer(pCte)).FpSelect)
 118108 	Xsqlite3DbFree(tls, db, (*Cte)(unsafe.Pointer(pCte)).FzName)
 118109 }
 118110 
 118111 // Free the contents of the CTE object passed as the second argument.
 118112 func Xsqlite3CteDelete(tls *libc.TLS, db uintptr, pCte uintptr) {
 118113 	cteClear(tls, db, pCte)
 118114 	Xsqlite3DbFree(tls, db, pCte)
 118115 }
 118116 
 118117 // This routine is invoked once per CTE by the parser while parsing a
 118118 // WITH clause.  The CTE described by teh third argument is added to
 118119 // the WITH clause of the second argument.  If the second argument is
 118120 // NULL, then a new WITH argument is created.
 118121 func Xsqlite3WithAdd(tls *libc.TLS, pParse uintptr, pWith uintptr, pCte uintptr) uintptr {
 118122 	bp := tls.Alloc(8)
 118123 	defer tls.Free(8)
 118124 
 118125 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 118126 	var pNew uintptr
 118127 	var zName uintptr
 118128 
 118129 	if pCte == uintptr(0) {
 118130 		return pWith
 118131 	}
 118132 
 118133 	zName = (*Cte)(unsafe.Pointer(pCte)).FzName
 118134 	if zName != 0 && pWith != 0 {
 118135 		var i int32
 118136 		for i = 0; i < (*With)(unsafe.Pointer(pWith)).FnCte; i++ {
 118137 			if Xsqlite3StrICmp(tls, zName, (*Cte)(unsafe.Pointer(pWith+16+uintptr(i)*48)).FzName) == 0 {
 118138 				Xsqlite3ErrorMsg(tls, pParse, ts+16029, libc.VaList(bp, zName))
 118139 			}
 118140 		}
 118141 	}
 118142 
 118143 	if pWith != 0 {
 118144 		var nByte Sqlite3_int64 = Sqlite3_int64(uint64(unsafe.Sizeof(With{})) + uint64(unsafe.Sizeof(Cte{}))*uint64((*With)(unsafe.Pointer(pWith)).FnCte))
 118145 		pNew = Xsqlite3DbRealloc(tls, db, pWith, uint64(nByte))
 118146 	} else {
 118147 		pNew = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(With{})))
 118148 	}
 118149 
 118150 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 118151 		Xsqlite3CteDelete(tls, db, pCte)
 118152 		pNew = pWith
 118153 	} else {
 118154 		*(*Cte)(unsafe.Pointer(pNew + 16 + uintptr(libc.PostIncInt32(&(*With)(unsafe.Pointer(pNew)).FnCte, 1))*48)) = *(*Cte)(unsafe.Pointer(pCte))
 118155 		Xsqlite3DbFree(tls, db, pCte)
 118156 	}
 118157 
 118158 	return pNew
 118159 }
 118160 
 118161 // Free the contents of the With object passed as the second argument.
 118162 func Xsqlite3WithDelete(tls *libc.TLS, db uintptr, pWith uintptr) {
 118163 	if pWith != 0 {
 118164 		var i int32
 118165 		for i = 0; i < (*With)(unsafe.Pointer(pWith)).FnCte; i++ {
 118166 			cteClear(tls, db, pWith+16+uintptr(i)*48)
 118167 		}
 118168 		Xsqlite3DbFree(tls, db, pWith)
 118169 	}
 118170 }
 118171 
 118172 func callCollNeeded(tls *libc.TLS, db uintptr, enc int32, zName uintptr) {
 118173 	if (*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded != 0 {
 118174 		var zExternal uintptr = Xsqlite3DbStrDup(tls, db, zName)
 118175 		if !(zExternal != 0) {
 118176 			return
 118177 		}
 118178 		(*struct {
 118179 			f func(*libc.TLS, uintptr, uintptr, int32, uintptr)
 118180 		})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCollNeededArg, db, enc, zExternal)
 118181 		Xsqlite3DbFree(tls, db, zExternal)
 118182 	}
 118183 	if (*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded16 != 0 {
 118184 		var zExternal uintptr
 118185 		var pTmp uintptr = Xsqlite3ValueNew(tls, db)
 118186 		Xsqlite3ValueSetStr(tls, pTmp, -1, zName, uint8(SQLITE_UTF8), uintptr(0))
 118187 		zExternal = Xsqlite3ValueText(tls, pTmp, uint8(SQLITE_UTF16LE))
 118188 		if zExternal != 0 {
 118189 			(*struct {
 118190 				f func(*libc.TLS, uintptr, uintptr, int32, uintptr)
 118191 			})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded16})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCollNeededArg, db, int32((*Sqlite3)(unsafe.Pointer(db)).Fenc), zExternal)
 118192 		}
 118193 		Xsqlite3ValueFree(tls, pTmp)
 118194 	}
 118195 }
 118196 
 118197 func synthCollSeq(tls *libc.TLS, db uintptr, pColl uintptr) int32 {
 118198 	var pColl2 uintptr
 118199 	var z uintptr = (*CollSeq)(unsafe.Pointer(pColl)).FzName
 118200 	var i int32
 118201 	for i = 0; i < 3; i++ {
 118202 		pColl2 = Xsqlite3FindCollSeq(tls, db, aEnc[i], z, 0)
 118203 		if (*CollSeq)(unsafe.Pointer(pColl2)).FxCmp != uintptr(0) {
 118204 			libc.Xmemcpy(tls, pColl, pColl2, uint64(unsafe.Sizeof(CollSeq{})))
 118205 			(*CollSeq)(unsafe.Pointer(pColl)).FxDel = uintptr(0)
 118206 			return SQLITE_OK
 118207 		}
 118208 	}
 118209 	return SQLITE_ERROR
 118210 }
 118211 
 118212 var aEnc = [3]U8{U8(SQLITE_UTF16BE), U8(SQLITE_UTF16LE), U8(SQLITE_UTF8)}
 118213 
 118214 // This routine is called on a collation sequence before it is used to
 118215 // check that it is defined. An undefined collation sequence exists when
 118216 // a database is loaded that contains references to collation sequences
 118217 // that have not been defined by sqlite3_create_collation() etc.
 118218 //
 118219 // If required, this routine calls the 'collation needed' callback to
 118220 // request a definition of the collating sequence. If this doesn't work,
 118221 // an equivalent collating sequence that uses a text encoding different
 118222 // from the main database is substituted, if one is available.
 118223 func Xsqlite3CheckCollSeq(tls *libc.TLS, pParse uintptr, pColl uintptr) int32 {
 118224 	if pColl != 0 && (*CollSeq)(unsafe.Pointer(pColl)).FxCmp == uintptr(0) {
 118225 		var zName uintptr = (*CollSeq)(unsafe.Pointer(pColl)).FzName
 118226 		var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 118227 		var p uintptr = Xsqlite3GetCollSeq(tls, pParse, (*Sqlite3)(unsafe.Pointer(db)).Fenc, pColl, zName)
 118228 		if !(p != 0) {
 118229 			return SQLITE_ERROR
 118230 		}
 118231 
 118232 	}
 118233 	return SQLITE_OK
 118234 }
 118235 
 118236 func findCollSeqEntry(tls *libc.TLS, db uintptr, zName uintptr, create int32) uintptr {
 118237 	var pColl uintptr
 118238 	pColl = Xsqlite3HashFind(tls, db+648, zName)
 118239 
 118240 	if uintptr(0) == pColl && create != 0 {
 118241 		var nName int32 = Xsqlite3Strlen30(tls, zName) + 1
 118242 		pColl = Xsqlite3DbMallocZero(tls, db, uint64(3)*uint64(unsafe.Sizeof(CollSeq{}))+uint64(nName))
 118243 		if pColl != 0 {
 118244 			var pDel uintptr = uintptr(0)
 118245 			(*CollSeq)(unsafe.Pointer(pColl)).FzName = pColl + 3*40
 118246 			(*CollSeq)(unsafe.Pointer(pColl)).Fenc = U8(SQLITE_UTF8)
 118247 			(*CollSeq)(unsafe.Pointer(pColl + 1*40)).FzName = pColl + 3*40
 118248 			(*CollSeq)(unsafe.Pointer(pColl + 1*40)).Fenc = U8(SQLITE_UTF16LE)
 118249 			(*CollSeq)(unsafe.Pointer(pColl + 2*40)).FzName = pColl + 3*40
 118250 			(*CollSeq)(unsafe.Pointer(pColl + 2*40)).Fenc = U8(SQLITE_UTF16BE)
 118251 			libc.Xmemcpy(tls, (*CollSeq)(unsafe.Pointer(pColl)).FzName, zName, uint64(nName))
 118252 			pDel = Xsqlite3HashInsert(tls, db+648, (*CollSeq)(unsafe.Pointer(pColl)).FzName, pColl)
 118253 
 118254 			if pDel != uintptr(0) {
 118255 				Xsqlite3OomFault(tls, db)
 118256 				Xsqlite3DbFree(tls, db, pDel)
 118257 				pColl = uintptr(0)
 118258 			}
 118259 		}
 118260 	}
 118261 	return pColl
 118262 }
 118263 
 118264 // Parameter zName points to a UTF-8 encoded string nName bytes long.
 118265 // Return the CollSeq* pointer for the collation sequence named zName
 118266 // for the encoding 'enc' from the database 'db'.
 118267 //
 118268 // If the entry specified is not found and 'create' is true, then create a
 118269 // new entry.  Otherwise return NULL.
 118270 //
 118271 // A separate function sqlite3LocateCollSeq() is a wrapper around
 118272 // this routine.  sqlite3LocateCollSeq() invokes the collation factory
 118273 // if necessary and generates an error message if the collating sequence
 118274 // cannot be found.
 118275 //
 118276 // See also: sqlite3LocateCollSeq(), sqlite3GetCollSeq()
 118277 func Xsqlite3FindCollSeq(tls *libc.TLS, db uintptr, enc U8, zName uintptr, create int32) uintptr {
 118278 	var pColl uintptr
 118279 
 118280 	if zName != 0 {
 118281 		pColl = findCollSeqEntry(tls, db, zName, create)
 118282 		if pColl != 0 {
 118283 			pColl += 40 * uintptr(int32(enc)-1)
 118284 		}
 118285 	} else {
 118286 		pColl = (*Sqlite3)(unsafe.Pointer(db)).FpDfltColl
 118287 	}
 118288 	return pColl
 118289 }
 118290 
 118291 // Change the text encoding for a database connection. This means that
 118292 // the pDfltColl must change as well.
 118293 func Xsqlite3SetTextEncoding(tls *libc.TLS, db uintptr, enc U8) {
 118294 	(*Sqlite3)(unsafe.Pointer(db)).Fenc = enc
 118295 
 118296 	(*Sqlite3)(unsafe.Pointer(db)).FpDfltColl = Xsqlite3FindCollSeq(tls, db, enc, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), 0)
 118297 }
 118298 
 118299 // This function is responsible for invoking the collation factory callback
 118300 // or substituting a collation sequence of a different encoding when the
 118301 // requested collation sequence is not available in the desired encoding.
 118302 //
 118303 // If it is not NULL, then pColl must point to the database native encoding
 118304 // collation sequence with name zName, length nName.
 118305 //
 118306 // The return value is either the collation sequence to be used in database
 118307 // db for collation type name zName, length nName, or NULL, if no collation
 118308 // sequence can be found.  If no collation is found, leave an error message.
 118309 //
 118310 // See also: sqlite3LocateCollSeq(), sqlite3FindCollSeq()
 118311 func Xsqlite3GetCollSeq(tls *libc.TLS, pParse uintptr, enc U8, pColl uintptr, zName uintptr) uintptr {
 118312 	bp := tls.Alloc(8)
 118313 	defer tls.Free(8)
 118314 
 118315 	var p uintptr
 118316 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 118317 
 118318 	p = pColl
 118319 	if !(p != 0) {
 118320 		p = Xsqlite3FindCollSeq(tls, db, enc, zName, 0)
 118321 	}
 118322 	if !(p != 0) || !(int32((*CollSeq)(unsafe.Pointer(p)).FxCmp) != 0) {
 118323 		callCollNeeded(tls, db, int32(enc), zName)
 118324 		p = Xsqlite3FindCollSeq(tls, db, enc, zName, 0)
 118325 	}
 118326 	if p != 0 && !(int32((*CollSeq)(unsafe.Pointer(p)).FxCmp) != 0) && synthCollSeq(tls, db, p) != 0 {
 118327 		p = uintptr(0)
 118328 	}
 118329 
 118330 	if p == uintptr(0) {
 118331 		Xsqlite3ErrorMsg(tls, pParse, ts+16059, libc.VaList(bp, zName))
 118332 		(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR | int32(1)<<8
 118333 	}
 118334 	return p
 118335 }
 118336 
 118337 // This function returns the collation sequence for database native text
 118338 // encoding identified by the string zName.
 118339 //
 118340 // If the requested collation sequence is not available, or not available
 118341 // in the database native encoding, the collation factory is invoked to
 118342 // request it. If the collation factory does not supply such a sequence,
 118343 // and the sequence is available in another text encoding, then that is
 118344 // returned instead.
 118345 //
 118346 // If no versions of the requested collations sequence are available, or
 118347 // another error occurs, NULL is returned and an error message written into
 118348 // pParse.
 118349 //
 118350 // This routine is a wrapper around sqlite3FindCollSeq().  This routine
 118351 // invokes the collation factory if the named collation cannot be found
 118352 // and generates an error message.
 118353 //
 118354 // See also: sqlite3FindCollSeq(), sqlite3GetCollSeq()
 118355 func Xsqlite3LocateCollSeq(tls *libc.TLS, pParse uintptr, zName uintptr) uintptr {
 118356 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 118357 	var enc U8 = (*Sqlite3)(unsafe.Pointer(db)).Fenc
 118358 	var initbusy U8 = (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy
 118359 	var pColl uintptr
 118360 
 118361 	pColl = Xsqlite3FindCollSeq(tls, db, enc, zName, int32(initbusy))
 118362 	if !(initbusy != 0) && (!(pColl != 0) || !(int32((*CollSeq)(unsafe.Pointer(pColl)).FxCmp) != 0)) {
 118363 		pColl = Xsqlite3GetCollSeq(tls, pParse, enc, pColl, zName)
 118364 	}
 118365 
 118366 	return pColl
 118367 }
 118368 
 118369 func matchQuality(tls *libc.TLS, p uintptr, nArg int32, enc U8) int32 {
 118370 	var match int32
 118371 
 118372 	if int32((*FuncDef)(unsafe.Pointer(p)).FnArg) != nArg {
 118373 		if nArg == -2 {
 118374 			if (*FuncDef)(unsafe.Pointer(p)).FxSFunc == uintptr(0) {
 118375 				return 0
 118376 			}
 118377 			return FUNC_PERFECT_MATCH
 118378 		}
 118379 		if int32((*FuncDef)(unsafe.Pointer(p)).FnArg) >= 0 {
 118380 			return 0
 118381 		}
 118382 	}
 118383 
 118384 	if int32((*FuncDef)(unsafe.Pointer(p)).FnArg) == nArg {
 118385 		match = 4
 118386 	} else {
 118387 		match = 1
 118388 	}
 118389 
 118390 	if U32(enc) == (*FuncDef)(unsafe.Pointer(p)).FfuncFlags&U32(SQLITE_FUNC_ENCMASK) {
 118391 		match = match + 2
 118392 	} else if U32(enc)&(*FuncDef)(unsafe.Pointer(p)).FfuncFlags&U32(2) != U32(0) {
 118393 		match = match + 1
 118394 	}
 118395 
 118396 	return match
 118397 }
 118398 
 118399 // Search a FuncDefHash for a function with the given name.  Return
 118400 // a pointer to the matching FuncDef if found, or 0 if there is no match.
 118401 func Xsqlite3FunctionSearch(tls *libc.TLS, h int32, zFunc uintptr) uintptr {
 118402 	var p uintptr
 118403 	for p = *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&Xsqlite3BuiltinFunctions)) + uintptr(h)*8)); p != 0; p = *(*uintptr)(unsafe.Pointer(p + 64)) {
 118404 		if Xsqlite3StrICmp(tls, (*FuncDef)(unsafe.Pointer(p)).FzName, zFunc) == 0 {
 118405 			return p
 118406 		}
 118407 	}
 118408 	return uintptr(0)
 118409 }
 118410 
 118411 // Insert a new FuncDef into a FuncDefHash hash table.
 118412 func Xsqlite3InsertBuiltinFuncs(tls *libc.TLS, aDef uintptr, nDef int32) {
 118413 	var i int32
 118414 	for i = 0; i < nDef; i++ {
 118415 		var pOther uintptr
 118416 		var zName uintptr = (*FuncDef)(unsafe.Pointer(aDef + uintptr(i)*72)).FzName
 118417 		var nName int32 = Xsqlite3Strlen30(tls, zName)
 118418 		var h int32 = (int32(*(*int8)(unsafe.Pointer(zName))) + nName) % SQLITE_FUNC_HASH_SZ
 118419 
 118420 		pOther = Xsqlite3FunctionSearch(tls, h, zName)
 118421 		if pOther != 0 {
 118422 			(*FuncDef)(unsafe.Pointer(aDef + uintptr(i)*72)).FpNext = (*FuncDef)(unsafe.Pointer(pOther)).FpNext
 118423 			(*FuncDef)(unsafe.Pointer(pOther)).FpNext = aDef + uintptr(i)*72
 118424 		} else {
 118425 			(*FuncDef)(unsafe.Pointer(aDef + uintptr(i)*72)).FpNext = uintptr(0)
 118426 			*(*uintptr)(unsafe.Pointer(aDef + uintptr(i)*72 + 64)) = *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&Xsqlite3BuiltinFunctions)) + uintptr(h)*8))
 118427 			*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&Xsqlite3BuiltinFunctions)) + uintptr(h)*8)) = aDef + uintptr(i)*72
 118428 		}
 118429 	}
 118430 }
 118431 
 118432 // Locate a user function given a name, a number of arguments and a flag
 118433 // indicating whether the function prefers UTF-16 over UTF-8.  Return a
 118434 // pointer to the FuncDef structure that defines that function, or return
 118435 // NULL if the function does not exist.
 118436 //
 118437 // If the createFlag argument is true, then a new (blank) FuncDef
 118438 // structure is created and liked into the "db" structure if a
 118439 // no matching function previously existed.
 118440 //
 118441 // If nArg is -2, then the first valid function found is returned.  A
 118442 // function is valid if xSFunc is non-zero.  The nArg==(-2)
 118443 // case is used to see if zName is a valid function name for some number
 118444 // of arguments.  If nArg is -2, then createFlag must be 0.
 118445 //
 118446 // If createFlag is false, then a function with the required name and
 118447 // number of arguments may be returned even if the eTextRep flag does not
 118448 // match that requested.
 118449 func Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, enc U8, createFlag U8) uintptr {
 118450 	var p uintptr
 118451 	var pBest uintptr = uintptr(0)
 118452 	var bestScore int32 = 0
 118453 	var h int32
 118454 	var nName int32
 118455 
 118456 	nName = Xsqlite3Strlen30(tls, zName)
 118457 
 118458 	p = Xsqlite3HashFind(tls, db+624, zName)
 118459 	for p != 0 {
 118460 		var score int32 = matchQuality(tls, p, nArg, enc)
 118461 		if score > bestScore {
 118462 			pBest = p
 118463 			bestScore = score
 118464 		}
 118465 		p = (*FuncDef)(unsafe.Pointer(p)).FpNext
 118466 	}
 118467 
 118468 	if !(createFlag != 0) && (pBest == uintptr(0) || (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_PreferBuiltin) != U32(0)) {
 118469 		bestScore = 0
 118470 		h = (int32(Xsqlite3UpperToLower[U8(*(*int8)(unsafe.Pointer(zName)))]) + nName) % SQLITE_FUNC_HASH_SZ
 118471 		p = Xsqlite3FunctionSearch(tls, h, zName)
 118472 		for p != 0 {
 118473 			var score int32 = matchQuality(tls, p, nArg, enc)
 118474 			if score > bestScore {
 118475 				pBest = p
 118476 				bestScore = score
 118477 			}
 118478 			p = (*FuncDef)(unsafe.Pointer(p)).FpNext
 118479 		}
 118480 	}
 118481 
 118482 	if createFlag != 0 && bestScore < FUNC_PERFECT_MATCH && libc.AssignUintptr(&pBest, Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(FuncDef{}))+uint64(nName)+uint64(1))) != uintptr(0) {
 118483 		var pOther uintptr
 118484 		var z uintptr
 118485 		(*FuncDef)(unsafe.Pointer(pBest)).FzName = pBest + 1*72
 118486 		(*FuncDef)(unsafe.Pointer(pBest)).FnArg = I8(U16(nArg))
 118487 		(*FuncDef)(unsafe.Pointer(pBest)).FfuncFlags = U32(enc)
 118488 		libc.Xmemcpy(tls, pBest+1*72, zName, uint64(nName+1))
 118489 		for z = (*FuncDef)(unsafe.Pointer(pBest)).FzName; *(*U8)(unsafe.Pointer(z)) != 0; z++ {
 118490 			*(*U8)(unsafe.Pointer(z)) = Xsqlite3UpperToLower[*(*U8)(unsafe.Pointer(z))]
 118491 		}
 118492 		pOther = Xsqlite3HashInsert(tls, db+624, (*FuncDef)(unsafe.Pointer(pBest)).FzName, pBest)
 118493 		if pOther == pBest {
 118494 			Xsqlite3DbFree(tls, db, pBest)
 118495 			Xsqlite3OomFault(tls, db)
 118496 			return uintptr(0)
 118497 		} else {
 118498 			(*FuncDef)(unsafe.Pointer(pBest)).FpNext = pOther
 118499 		}
 118500 	}
 118501 
 118502 	if pBest != 0 && ((*FuncDef)(unsafe.Pointer(pBest)).FxSFunc != 0 || createFlag != 0) {
 118503 		return pBest
 118504 	}
 118505 	return uintptr(0)
 118506 }
 118507 
 118508 // Free all resources held by the schema structure. The void* argument points
 118509 // at a Schema struct. This function does not call sqlite3DbFree(db, ) on the
 118510 // pointer itself, it just cleans up subsidiary resources (i.e. the contents
 118511 // of the schema hash tables).
 118512 //
 118513 // The Schema.cache_size variable is not cleared.
 118514 func Xsqlite3SchemaClear(tls *libc.TLS, p uintptr) {
 118515 	bp := tls.Alloc(896)
 118516 	defer tls.Free(896)
 118517 
 118518 	var pElem uintptr
 118519 	var pSchema uintptr = p
 118520 
 118521 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Sqlite3{})))
 118522 	*(*Hash)(unsafe.Pointer(bp + 872)) = (*Schema)(unsafe.Pointer(pSchema)).FtblHash
 118523 	*(*Hash)(unsafe.Pointer(bp + 848)) = (*Schema)(unsafe.Pointer(pSchema)).FtrigHash
 118524 	Xsqlite3HashInit(tls, pSchema+56)
 118525 	Xsqlite3HashClear(tls, pSchema+32)
 118526 	for pElem = (*Hash)(unsafe.Pointer(bp + 848)).Ffirst; pElem != 0; pElem = (*HashElem)(unsafe.Pointer(pElem)).Fnext {
 118527 		Xsqlite3DeleteTrigger(tls, bp, (*HashElem)(unsafe.Pointer(pElem)).Fdata)
 118528 	}
 118529 	Xsqlite3HashClear(tls, bp+848)
 118530 	Xsqlite3HashInit(tls, pSchema+8)
 118531 	for pElem = (*Hash)(unsafe.Pointer(bp + 872)).Ffirst; pElem != 0; pElem = (*HashElem)(unsafe.Pointer(pElem)).Fnext {
 118532 		var pTab uintptr = (*HashElem)(unsafe.Pointer(pElem)).Fdata
 118533 		Xsqlite3DeleteTable(tls, bp, pTab)
 118534 	}
 118535 	Xsqlite3HashClear(tls, bp+872)
 118536 	Xsqlite3HashClear(tls, pSchema+80)
 118537 	(*Schema)(unsafe.Pointer(pSchema)).FpSeqTab = uintptr(0)
 118538 	if int32((*Schema)(unsafe.Pointer(pSchema)).FschemaFlags)&DB_SchemaLoaded != 0 {
 118539 		(*Schema)(unsafe.Pointer(pSchema)).FiGeneration++
 118540 	}
 118541 	*(*U16)(unsafe.Pointer(pSchema + 114)) &= libc.Uint16FromInt32(libc.CplInt32(DB_SchemaLoaded | DB_ResetWanted))
 118542 }
 118543 
 118544 // Find and return the schema associated with a BTree.  Create
 118545 // a new one if necessary.
 118546 func Xsqlite3SchemaGet(tls *libc.TLS, db uintptr, pBt uintptr) uintptr {
 118547 	var p uintptr
 118548 	if pBt != 0 {
 118549 		p = Xsqlite3BtreeSchema(tls, pBt, int32(unsafe.Sizeof(Schema{})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3SchemaClear})))
 118550 	} else {
 118551 		p = Xsqlite3DbMallocZero(tls, uintptr(0), uint64(unsafe.Sizeof(Schema{})))
 118552 	}
 118553 	if !(p != 0) {
 118554 		Xsqlite3OomFault(tls, db)
 118555 	} else if 0 == int32((*Schema)(unsafe.Pointer(p)).Ffile_format) {
 118556 		Xsqlite3HashInit(tls, p+8)
 118557 		Xsqlite3HashInit(tls, p+32)
 118558 		Xsqlite3HashInit(tls, p+56)
 118559 		Xsqlite3HashInit(tls, p+80)
 118560 		(*Schema)(unsafe.Pointer(p)).Fenc = U8(SQLITE_UTF8)
 118561 	}
 118562 	return p
 118563 }
 118564 
 118565 // While a SrcList can in general represent multiple tables and subqueries
 118566 // (as in the FROM clause of a SELECT statement) in this case it contains
 118567 // the name of a single table, as one might find in an INSERT, DELETE,
 118568 // or UPDATE statement.  Look up that table in the symbol table and
 118569 // return a pointer.  Set an error message and return NULL if the table
 118570 // name is not found or if any other error occurs.
 118571 //
 118572 // The following fields are initialized appropriate in pSrc:
 118573 //
 118574 //	pSrc->a[0].pTab       Pointer to the Table object
 118575 //	pSrc->a[0].pIndex     Pointer to the INDEXED BY index, if there is one
 118576 func Xsqlite3SrcListLookup(tls *libc.TLS, pParse uintptr, pSrc uintptr) uintptr {
 118577 	var pItem uintptr = pSrc + 8
 118578 	var pTab uintptr
 118579 
 118580 	pTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), pItem)
 118581 	Xsqlite3DeleteTable(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*SrcItem)(unsafe.Pointer(pItem)).FpTab)
 118582 	(*SrcItem)(unsafe.Pointer(pItem)).FpTab = pTab
 118583 	if pTab != 0 {
 118584 		(*Table)(unsafe.Pointer(pTab)).FnTabRef++
 118585 		if uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x2>>1)) != 0 && Xsqlite3IndexedByLookup(tls, pParse, pItem) != 0 {
 118586 			pTab = uintptr(0)
 118587 		}
 118588 	}
 118589 	return pTab
 118590 }
 118591 
 118592 // Generate byte-code that will report the number of rows modified
 118593 // by a DELETE, INSERT, or UPDATE statement.
 118594 func Xsqlite3CodeChangeCount(tls *libc.TLS, v uintptr, regCounter int32, zColName uintptr) {
 118595 	Xsqlite3VdbeAddOp0(tls, v, OP_FkCheck)
 118596 	Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, regCounter, 1)
 118597 	Xsqlite3VdbeSetNumCols(tls, v, 1)
 118598 	Xsqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, zColName, uintptr(0))
 118599 }
 118600 
 118601 func vtabIsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 {
 118602 	bp := tls.Alloc(8)
 118603 	defer tls.Free(8)
 118604 
 118605 	if (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer((*VTable)(unsafe.Pointer(Xsqlite3GetVTable(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pTab))).FpMod)).FpModule)).FxUpdate == uintptr(0) {
 118606 		return 1
 118607 	}
 118608 
 118609 	if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != uintptr(0) &&
 118610 		int32((*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTab + 64 + 16)))).FeVtabRisk) > libc.Bool32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) {
 118611 		Xsqlite3ErrorMsg(tls, pParse, ts+16090,
 118612 			libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
 118613 	}
 118614 	return 0
 118615 }
 118616 
 118617 func tabIsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 {
 118618 	var db uintptr
 118619 	if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
 118620 		return vtabIsReadOnly(tls, pParse, pTab)
 118621 	}
 118622 	if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Readonly|TF_Shadow) == U32(0) {
 118623 		return 0
 118624 	}
 118625 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 118626 	if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Readonly) != U32(0) {
 118627 		return libc.Bool32(Xsqlite3WritableSchema(tls, db) == 0 && int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0)
 118628 	}
 118629 
 118630 	return Xsqlite3ReadOnlyShadowTables(tls, db)
 118631 }
 118632 
 118633 // Check to make sure the given table is writable.
 118634 //
 118635 // If pTab is not writable  ->  generate an error message and return 1.
 118636 // If pTab is writable but other errors have occurred -> return 1.
 118637 // If pTab is writable and no prior errors -> return 0;
 118638 func Xsqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, viewOk int32) int32 {
 118639 	bp := tls.Alloc(16)
 118640 	defer tls.Free(16)
 118641 
 118642 	if tabIsReadOnly(tls, pParse, pTab) != 0 {
 118643 		Xsqlite3ErrorMsg(tls, pParse, ts+16123, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
 118644 		return 1
 118645 	}
 118646 	if !(viewOk != 0) && int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW {
 118647 		Xsqlite3ErrorMsg(tls, pParse, ts+16152, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
 118648 		return 1
 118649 	}
 118650 	return 0
 118651 }
 118652 
 118653 // Evaluate a view and store its result in an ephemeral table.  The
 118654 // pWhere argument is an optional WHERE clause that restricts the
 118655 // set of rows in the view that are to be added to the ephemeral table.
 118656 func Xsqlite3MaterializeView(tls *libc.TLS, pParse uintptr, pView uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr, iCur int32) {
 118657 	bp := tls.Alloc(40)
 118658 	defer tls.Free(40)
 118659 
 118660 	var pSel uintptr
 118661 	var pFrom uintptr
 118662 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 118663 	var iDb int32 = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pView)).FpSchema)
 118664 	pWhere = Xsqlite3ExprDup(tls, db, pWhere, 0)
 118665 	pFrom = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0))
 118666 	if pFrom != 0 {
 118667 		(*SrcItem)(unsafe.Pointer(pFrom + 8)).FzName = Xsqlite3DbStrDup(tls, db, (*Table)(unsafe.Pointer(pView)).FzName)
 118668 		(*SrcItem)(unsafe.Pointer(pFrom + 8)).FzDatabase = Xsqlite3DbStrDup(tls, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName)
 118669 
 118670 	}
 118671 	pSel = Xsqlite3SelectNew(tls, pParse, uintptr(0), pFrom, pWhere, uintptr(0), uintptr(0), pOrderBy,
 118672 		uint32(SF_IncludeHidden), pLimit)
 118673 	Xsqlite3SelectDestInit(tls, bp, SRT_EphemTab, iCur)
 118674 	Xsqlite3Select(tls, pParse, pSel, bp)
 118675 	Xsqlite3SelectDelete(tls, db, pSel)
 118676 }
 118677 
 118678 // Generate code for a DELETE FROM statement.
 118679 //
 118680 //	DELETE FROM table_wxyz WHERE a<5 AND b NOT NULL;
 118681 //	            \________/       \________________/
 118682 //	             pTabList              pWhere
 118683 func Xsqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr) {
 118684 	bp := tls.Alloc(88)
 118685 	defer tls.Free(88)
 118686 
 118687 	var v uintptr
 118688 	var pTab uintptr
 118689 	var i int32
 118690 	var pWInfo uintptr
 118691 	var pIdx uintptr
 118692 	var iTabCur int32
 118693 
 118694 	var nIdx int32
 118695 	var db uintptr
 118696 
 118697 	var iDb int32
 118698 	var memCnt int32
 118699 	var rcauth int32
 118700 	var eOnePass int32
 118701 
 118702 	var aToOpen uintptr
 118703 	var pPk uintptr
 118704 	var iPk int32
 118705 	var nPk I16
 118706 	var iKey int32
 118707 	var nKey I16
 118708 	var iEphCur int32
 118709 	var iRowSet int32
 118710 	var addrBypass int32
 118711 	var addrLoop int32
 118712 	var addrEphOpen int32
 118713 	var bComplex int32
 118714 
 118715 	var isView int32
 118716 	var pTrigger uintptr
 118717 	var iAddrOnce int32
 118718 	var pVTab uintptr
 118719 	var count int32
 118720 	var wcf U16
 118721 	*(*int32)(unsafe.Pointer(bp + 80)) = 0
 118722 	*(*int32)(unsafe.Pointer(bp + 84)) = 0
 118723 	memCnt = 0
 118724 	aToOpen = uintptr(0)
 118725 	iPk = 0
 118726 	nPk = int16(1)
 118727 	iEphCur = 0
 118728 	iRowSet = 0
 118729 	addrBypass = 0
 118730 	addrLoop = 0
 118731 	addrEphOpen = 0
 118732 
 118733 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(AuthContext{})))
 118734 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 118735 
 118736 	if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
 118737 		goto __1
 118738 	}
 118739 	goto delete_from_cleanup
 118740 __1:
 118741 	;
 118742 	pTab = Xsqlite3SrcListLookup(tls, pParse, pTabList)
 118743 	if !(pTab == uintptr(0)) {
 118744 		goto __2
 118745 	}
 118746 	goto delete_from_cleanup
 118747 __2:
 118748 	;
 118749 	pTrigger = Xsqlite3TriggersExist(tls, pParse, pTab, TK_DELETE, uintptr(0), uintptr(0))
 118750 	isView = libc.Bool32(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW)
 118751 	bComplex = libc.Bool32(pTrigger != 0 || Xsqlite3FkRequired(tls, pParse, pTab, uintptr(0), 0) != 0)
 118752 
 118753 	if !(Xsqlite3ViewGetColumnNames(tls, pParse, pTab) != 0) {
 118754 		goto __3
 118755 	}
 118756 	goto delete_from_cleanup
 118757 __3:
 118758 	;
 118759 	if !(Xsqlite3IsReadOnly(tls, pParse, pTab, func() int32 {
 118760 		if pTrigger != 0 {
 118761 			return 1
 118762 		}
 118763 		return 0
 118764 	}()) != 0) {
 118765 		goto __4
 118766 	}
 118767 	goto delete_from_cleanup
 118768 __4:
 118769 	;
 118770 	iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
 118771 
 118772 	rcauth = Xsqlite3AuthCheck(tls, pParse, SQLITE_DELETE, (*Table)(unsafe.Pointer(pTab)).FzName, uintptr(0),
 118773 		(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName)
 118774 
 118775 	if !(rcauth == SQLITE_DENY) {
 118776 		goto __5
 118777 	}
 118778 	goto delete_from_cleanup
 118779 __5:
 118780 	;
 118781 	iTabCur = libc.AssignPtrInt32(pTabList+8+68, libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1))
 118782 	nIdx = 0
 118783 	pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex
 118784 __6:
 118785 	if !(pIdx != 0) {
 118786 		goto __8
 118787 	}
 118788 	(*Parse)(unsafe.Pointer(pParse)).FnTab++
 118789 	goto __7
 118790 __7:
 118791 	pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
 118792 	nIdx++
 118793 	goto __6
 118794 	goto __8
 118795 __8:
 118796 	;
 118797 	if !(isView != 0) {
 118798 		goto __9
 118799 	}
 118800 	Xsqlite3AuthContextPush(tls, pParse, bp, (*Table)(unsafe.Pointer(pTab)).FzName)
 118801 __9:
 118802 	;
 118803 	v = Xsqlite3GetVdbe(tls, pParse)
 118804 	if !(v == uintptr(0)) {
 118805 		goto __10
 118806 	}
 118807 	goto delete_from_cleanup
 118808 __10:
 118809 	;
 118810 	if !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) {
 118811 		goto __11
 118812 	}
 118813 	Xsqlite3VdbeCountChanges(tls, v)
 118814 __11:
 118815 	;
 118816 	Xsqlite3BeginWriteOperation(tls, pParse, bComplex, iDb)
 118817 
 118818 	if !(isView != 0) {
 118819 		goto __12
 118820 	}
 118821 	Xsqlite3MaterializeView(tls, pParse, pTab,
 118822 		pWhere, pOrderBy, pLimit, iTabCur)
 118823 	*(*int32)(unsafe.Pointer(bp + 80)) = libc.AssignPtrInt32(bp+84, iTabCur)
 118824 	pOrderBy = uintptr(0)
 118825 	pLimit = uintptr(0)
 118826 __12:
 118827 	;
 118828 	libc.Xmemset(tls, bp+16, 0, uint64(unsafe.Sizeof(NameContext{})))
 118829 	(*NameContext)(unsafe.Pointer(bp + 16)).FpParse = pParse
 118830 	(*NameContext)(unsafe.Pointer(bp + 16)).FpSrcList = pTabList
 118831 	if !(Xsqlite3ResolveExprNames(tls, bp+16, pWhere) != 0) {
 118832 		goto __13
 118833 	}
 118834 	goto delete_from_cleanup
 118835 __13:
 118836 	;
 118837 	if !((*Sqlite3)(unsafe.Pointer(db)).Fflags&(uint64(0x00001)<<32) != uint64(0) &&
 118838 		!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) &&
 118839 		!(int32((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0) &&
 118840 		!(int32((*Parse)(unsafe.Pointer(pParse)).FbReturning) != 0)) {
 118841 		goto __14
 118842 	}
 118843 	memCnt = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 118844 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, memCnt)
 118845 __14:
 118846 	;
 118847 	if !(rcauth == SQLITE_OK &&
 118848 		pWhere == uintptr(0) &&
 118849 		!(bComplex != 0) &&
 118850 		!(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) &&
 118851 		(*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback == uintptr(0)) {
 118852 		goto __15
 118853 	}
 118854 
 118855 	Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, uint8(1), (*Table)(unsafe.Pointer(pTab)).FzName)
 118856 	if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 118857 		goto __17
 118858 	}
 118859 	Xsqlite3VdbeAddOp4(tls, v, OP_Clear, int32((*Table)(unsafe.Pointer(pTab)).Ftnum), iDb, func() int32 {
 118860 		if memCnt != 0 {
 118861 			return memCnt
 118862 		}
 118863 		return -1
 118864 	}(),
 118865 		(*Table)(unsafe.Pointer(pTab)).FzName, -1)
 118866 __17:
 118867 	;
 118868 	pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex
 118869 __18:
 118870 	if !(pIdx != 0) {
 118871 		goto __20
 118872 	}
 118873 
 118874 	if !(int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY && !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0))) {
 118875 		goto __21
 118876 	}
 118877 	Xsqlite3VdbeAddOp3(tls, v, OP_Clear, int32((*Index)(unsafe.Pointer(pIdx)).Ftnum), iDb, func() int32 {
 118878 		if memCnt != 0 {
 118879 			return memCnt
 118880 		}
 118881 		return -1
 118882 	}())
 118883 	goto __22
 118884 __21:
 118885 	Xsqlite3VdbeAddOp2(tls, v, OP_Clear, int32((*Index)(unsafe.Pointer(pIdx)).Ftnum), iDb)
 118886 __22:
 118887 	;
 118888 	goto __19
 118889 __19:
 118890 	pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
 118891 	goto __18
 118892 	goto __20
 118893 __20:
 118894 	;
 118895 	goto __16
 118896 __15:
 118897 	wcf = U16(WHERE_ONEPASS_DESIRED | WHERE_DUPLICATES_OK)
 118898 	if !((*NameContext)(unsafe.Pointer(bp+16)).FncFlags&NC_Subquery != 0) {
 118899 		goto __23
 118900 	}
 118901 	bComplex = 1
 118902 __23:
 118903 	;
 118904 	wcf = U16(int32(wcf) | func() int32 {
 118905 		if bComplex != 0 {
 118906 			return 0
 118907 		}
 118908 		return WHERE_ONEPASS_MULTIROW
 118909 	}())
 118910 	if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 118911 		goto __24
 118912 	}
 118913 
 118914 	pPk = uintptr(0)
 118915 	nPk = int16(1)
 118916 	iRowSet = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 118917 	Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, iRowSet)
 118918 	goto __25
 118919 __24:
 118920 	pPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
 118921 
 118922 	nPk = I16((*Index)(unsafe.Pointer(pPk)).FnKeyCol)
 118923 	iPk = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 118924 	*(*int32)(unsafe.Pointer(pParse + 56)) += int32(nPk)
 118925 	iEphCur = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 118926 	addrEphOpen = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, iEphCur, int32(nPk))
 118927 	Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pPk)
 118928 __25:
 118929 	;
 118930 	pWInfo = Xsqlite3WhereBegin(tls, pParse, pTabList, pWhere, uintptr(0), uintptr(0), uintptr(0), wcf, iTabCur+1)
 118931 	if !(pWInfo == uintptr(0)) {
 118932 		goto __26
 118933 	}
 118934 	goto delete_from_cleanup
 118935 __26:
 118936 	;
 118937 	eOnePass = Xsqlite3WhereOkOnePass(tls, pWInfo, bp+72)
 118938 
 118939 	if !(eOnePass != ONEPASS_SINGLE) {
 118940 		goto __27
 118941 	}
 118942 	Xsqlite3MultiWrite(tls, pParse)
 118943 __27:
 118944 	;
 118945 	if !(Xsqlite3WhereUsesDeferredSeek(tls, pWInfo) != 0) {
 118946 		goto __28
 118947 	}
 118948 	Xsqlite3VdbeAddOp1(tls, v, OP_FinishSeek, iTabCur)
 118949 __28:
 118950 	;
 118951 	if !(memCnt != 0) {
 118952 		goto __29
 118953 	}
 118954 	Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, memCnt, 1)
 118955 __29:
 118956 	;
 118957 	if !(pPk != 0) {
 118958 		goto __30
 118959 	}
 118960 	i = 0
 118961 __32:
 118962 	if !(i < int32(nPk)) {
 118963 		goto __34
 118964 	}
 118965 
 118966 	Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iTabCur,
 118967 		int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))), iPk+i)
 118968 	goto __33
 118969 __33:
 118970 	i++
 118971 	goto __32
 118972 	goto __34
 118973 __34:
 118974 	;
 118975 	iKey = iPk
 118976 	goto __31
 118977 __30:
 118978 	iKey = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 118979 	Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iTabCur, -1, iKey)
 118980 __31:
 118981 	;
 118982 	if !(eOnePass != ONEPASS_OFF) {
 118983 		goto __35
 118984 	}
 118985 
 118986 	nKey = nPk
 118987 	aToOpen = Xsqlite3DbMallocRawNN(tls, db, uint64(nIdx+2))
 118988 	if !(aToOpen == uintptr(0)) {
 118989 		goto __37
 118990 	}
 118991 	Xsqlite3WhereEnd(tls, pWInfo)
 118992 	goto delete_from_cleanup
 118993 __37:
 118994 	;
 118995 	libc.Xmemset(tls, aToOpen, 1, uint64(nIdx+1))
 118996 	*(*U8)(unsafe.Pointer(aToOpen + uintptr(nIdx+1))) = U8(0)
 118997 	if !(*(*int32)(unsafe.Pointer(bp + 72)) >= 0) {
 118998 		goto __38
 118999 	}
 119000 	*(*U8)(unsafe.Pointer(aToOpen + uintptr(*(*int32)(unsafe.Pointer(bp + 72))-iTabCur))) = U8(0)
 119001 __38:
 119002 	;
 119003 	if !(*(*int32)(unsafe.Pointer(bp + 72 + 1*4)) >= 0) {
 119004 		goto __39
 119005 	}
 119006 	*(*U8)(unsafe.Pointer(aToOpen + uintptr(*(*int32)(unsafe.Pointer(bp + 72 + 1*4))-iTabCur))) = U8(0)
 119007 __39:
 119008 	;
 119009 	if !(addrEphOpen != 0) {
 119010 		goto __40
 119011 	}
 119012 	Xsqlite3VdbeChangeToNoop(tls, v, addrEphOpen)
 119013 __40:
 119014 	;
 119015 	addrBypass = Xsqlite3VdbeMakeLabel(tls, pParse)
 119016 	goto __36
 119017 __35:
 119018 	if !(pPk != 0) {
 119019 		goto __41
 119020 	}
 119021 
 119022 	iKey = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 119023 	nKey = int16(0)
 119024 	Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, iPk, int32(nPk), iKey,
 119025 		Xsqlite3IndexAffinityStr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pPk), int32(nPk))
 119026 	Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iEphCur, iKey, iPk, int32(nPk))
 119027 	goto __42
 119028 __41:
 119029 	nKey = int16(1)
 119030 	Xsqlite3VdbeAddOp2(tls, v, OP_RowSetAdd, iRowSet, iKey)
 119031 __42:
 119032 	;
 119033 	Xsqlite3WhereEnd(tls, pWInfo)
 119034 __36:
 119035 	;
 119036 	if !!(isView != 0) {
 119037 		goto __43
 119038 	}
 119039 	iAddrOnce = 0
 119040 	if !(eOnePass == ONEPASS_MULTI) {
 119041 		goto __44
 119042 	}
 119043 	iAddrOnce = Xsqlite3VdbeAddOp0(tls, v, OP_Once)
 119044 __44:
 119045 	;
 119046 	Xsqlite3OpenTableAndIndices(tls, pParse, pTab, OP_OpenWrite, uint8(OPFLAG_FORDELETE),
 119047 		iTabCur, aToOpen, bp+80, bp+84)
 119048 
 119049 	if !(eOnePass == ONEPASS_MULTI) {
 119050 		goto __45
 119051 	}
 119052 	Xsqlite3VdbeJumpHereOrPopInst(tls, v, iAddrOnce)
 119053 __45:
 119054 	;
 119055 __43:
 119056 	;
 119057 	if !(eOnePass != ONEPASS_OFF) {
 119058 		goto __46
 119059 	}
 119060 
 119061 	if !(!(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) && *(*U8)(unsafe.Pointer(aToOpen + uintptr(*(*int32)(unsafe.Pointer(bp + 80))-iTabCur))) != 0) {
 119062 		goto __48
 119063 	}
 119064 
 119065 	Xsqlite3VdbeAddOp4Int(tls, v, OP_NotFound, *(*int32)(unsafe.Pointer(bp + 80)), addrBypass, iKey, int32(nKey))
 119066 
 119067 __48:
 119068 	;
 119069 	goto __47
 119070 __46:
 119071 	if !(pPk != 0) {
 119072 		goto __49
 119073 	}
 119074 	addrLoop = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, iEphCur)
 119075 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
 119076 		goto __51
 119077 	}
 119078 	Xsqlite3VdbeAddOp3(tls, v, OP_Column, iEphCur, 0, iKey)
 119079 	goto __52
 119080 __51:
 119081 	Xsqlite3VdbeAddOp2(tls, v, OP_RowData, iEphCur, iKey)
 119082 __52:
 119083 	;
 119084 	goto __50
 119085 __49:
 119086 	addrLoop = Xsqlite3VdbeAddOp3(tls, v, OP_RowSetRead, iRowSet, 0, iKey)
 119087 
 119088 __50:
 119089 	;
 119090 __47:
 119091 	;
 119092 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
 119093 		goto __53
 119094 	}
 119095 	pVTab = Xsqlite3GetVTable(tls, db, pTab)
 119096 	Xsqlite3VtabMakeWritable(tls, pParse, pTab)
 119097 
 119098 	Xsqlite3MayAbort(tls, pParse)
 119099 	if !(eOnePass == ONEPASS_SINGLE) {
 119100 		goto __55
 119101 	}
 119102 	Xsqlite3VdbeAddOp1(tls, v, OP_Close, iTabCur)
 119103 	if !((*Parse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0)) {
 119104 		goto __56
 119105 	}
 119106 	(*Parse)(unsafe.Pointer(pParse)).FisMultiWrite = U8(0)
 119107 __56:
 119108 	;
 119109 __55:
 119110 	;
 119111 	Xsqlite3VdbeAddOp4(tls, v, OP_VUpdate, 0, 1, iKey, pVTab, -11)
 119112 	Xsqlite3VdbeChangeP5(tls, v, uint16(OE_Abort))
 119113 	goto __54
 119114 __53:
 119115 	count = libc.Bool32(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0)
 119116 	Xsqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, *(*int32)(unsafe.Pointer(bp + 80)), *(*int32)(unsafe.Pointer(bp + 84)),
 119117 		iKey, nKey, uint8(count), uint8(OE_Default), uint8(eOnePass), *(*int32)(unsafe.Pointer(bp + 72 + 1*4)))
 119118 __54:
 119119 	;
 119120 	if !(eOnePass != ONEPASS_OFF) {
 119121 		goto __57
 119122 	}
 119123 	Xsqlite3VdbeResolveLabel(tls, v, addrBypass)
 119124 	Xsqlite3WhereEnd(tls, pWInfo)
 119125 	goto __58
 119126 __57:
 119127 	if !(pPk != 0) {
 119128 		goto __59
 119129 	}
 119130 	Xsqlite3VdbeAddOp2(tls, v, OP_Next, iEphCur, addrLoop+1)
 119131 	Xsqlite3VdbeJumpHere(tls, v, addrLoop)
 119132 	goto __60
 119133 __59:
 119134 	Xsqlite3VdbeGoto(tls, v, addrLoop)
 119135 	Xsqlite3VdbeJumpHere(tls, v, addrLoop)
 119136 __60:
 119137 	;
 119138 __58:
 119139 	;
 119140 __16:
 119141 	;
 119142 	if !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab == uintptr(0)) {
 119143 		goto __61
 119144 	}
 119145 	Xsqlite3AutoincrementEnd(tls, pParse)
 119146 __61:
 119147 	;
 119148 	if !(memCnt != 0) {
 119149 		goto __62
 119150 	}
 119151 	Xsqlite3CodeChangeCount(tls, v, memCnt, ts+16190)
 119152 __62:
 119153 	;
 119154 delete_from_cleanup:
 119155 	Xsqlite3AuthContextPop(tls, bp)
 119156 	Xsqlite3SrcListDelete(tls, db, pTabList)
 119157 	Xsqlite3ExprDelete(tls, db, pWhere)
 119158 	if !(aToOpen != 0) {
 119159 		goto __63
 119160 	}
 119161 	Xsqlite3DbNNFreeNN(tls, db, aToOpen)
 119162 __63:
 119163 	;
 119164 	return
 119165 }
 119166 
 119167 // This routine generates VDBE code that causes a single row of a
 119168 // single table to be deleted.  Both the original table entry and
 119169 // all indices are removed.
 119170 //
 119171 // Preconditions:
 119172 //
 119173 //  1. iDataCur is an open cursor on the btree that is the canonical data
 119174 //     store for the table.  (This will be either the table itself,
 119175 //     in the case of a rowid table, or the PRIMARY KEY index in the case
 119176 //     of a WITHOUT ROWID table.)
 119177 //
 119178 //  2. Read/write cursors for all indices of pTab must be open as
 119179 //     cursor number iIdxCur+i for the i-th index.
 119180 //
 119181 //  3. The primary key for the row to be deleted must be stored in a
 119182 //     sequence of nPk memory cells starting at iPk.  If nPk==0 that means
 119183 //     that a search record formed from OP_MakeRecord is contained in the
 119184 //     single memory location iPk.
 119185 //
 119186 // eMode:
 119187 //
 119188 //	Parameter eMode may be passed either ONEPASS_OFF (0), ONEPASS_SINGLE, or
 119189 //	ONEPASS_MULTI.  If eMode is not ONEPASS_OFF, then the cursor
 119190 //	iDataCur already points to the row to delete. If eMode is ONEPASS_OFF
 119191 //	then this function must seek iDataCur to the entry identified by iPk
 119192 //	and nPk before reading from it.
 119193 //
 119194 //	If eMode is ONEPASS_MULTI, then this call is being made as part
 119195 //	of a ONEPASS delete that affects multiple rows. In this case, if
 119196 //	iIdxNoSeek is a valid cursor number (>=0) and is not the same as
 119197 //	iDataCur, then its position should be preserved following the delete
 119198 //	operation. Or, if iIdxNoSeek is not a valid cursor number, the
 119199 //	position of iDataCur should be preserved instead.
 119200 //
 119201 // iIdxNoSeek:
 119202 //
 119203 //	If iIdxNoSeek is a valid cursor number (>=0) not equal to iDataCur,
 119204 //	then it identifies an index cursor (from within array of cursors
 119205 //	starting at iIdxCur) that already points to the index entry to be deleted.
 119206 //	Except, this optimization is disabled if there are BEFORE triggers since
 119207 //	the trigger body might have moved the cursor.
 119208 func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger uintptr, iDataCur int32, iIdxCur int32, iPk int32, nPk I16, count U8, onconf U8, eMode U8, iIdxNoSeek int32) {
 119209 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 119210 	var iOld int32 = 0
 119211 	var iLabel int32
 119212 	var opSeek U8
 119213 
 119214 	iLabel = Xsqlite3VdbeMakeLabel(tls, pParse)
 119215 	if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
 119216 		opSeek = uint8(OP_NotExists)
 119217 	} else {
 119218 		opSeek = uint8(OP_NotFound)
 119219 	}
 119220 	if int32(eMode) == ONEPASS_OFF {
 119221 		Xsqlite3VdbeAddOp4Int(tls, v, int32(opSeek), iDataCur, iLabel, iPk, int32(nPk))
 119222 
 119223 	}
 119224 
 119225 	if Xsqlite3FkRequired(tls, pParse, pTab, uintptr(0), 0) != 0 || pTrigger != 0 {
 119226 		var mask U32
 119227 		var iCol int32
 119228 		var addrStart int32
 119229 
 119230 		mask = Xsqlite3TriggerColmask(tls,
 119231 			pParse, pTrigger, uintptr(0), 0, TRIGGER_BEFORE|TRIGGER_AFTER, pTab, int32(onconf))
 119232 		mask = mask | Xsqlite3FkOldmask(tls, pParse, pTab)
 119233 		iOld = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 119234 		*(*int32)(unsafe.Pointer(pParse + 56)) += 1 + int32((*Table)(unsafe.Pointer(pTab)).FnCol)
 119235 
 119236 		Xsqlite3VdbeAddOp2(tls, v, OP_Copy, iPk, iOld)
 119237 		for iCol = 0; iCol < int32((*Table)(unsafe.Pointer(pTab)).FnCol); iCol++ {
 119238 			if mask == 0xffffffff || iCol <= 31 && mask&(uint32(1)<<iCol) != U32(0) {
 119239 				var kk int32 = int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(iCol)))
 119240 				Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, iCol, iOld+kk+1)
 119241 			}
 119242 		}
 119243 
 119244 		addrStart = Xsqlite3VdbeCurrentAddr(tls, v)
 119245 		Xsqlite3CodeRowTrigger(tls, pParse, pTrigger,
 119246 			TK_DELETE, uintptr(0), TRIGGER_BEFORE, pTab, iOld, int32(onconf), iLabel)
 119247 
 119248 		if addrStart < Xsqlite3VdbeCurrentAddr(tls, v) {
 119249 			Xsqlite3VdbeAddOp4Int(tls, v, int32(opSeek), iDataCur, iLabel, iPk, int32(nPk))
 119250 
 119251 			iIdxNoSeek = -1
 119252 		}
 119253 
 119254 		Xsqlite3FkCheck(tls, pParse, pTab, iOld, 0, uintptr(0), 0)
 119255 	}
 119256 
 119257 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW) {
 119258 		var p5 U8 = U8(0)
 119259 		Xsqlite3GenerateRowIndexDelete(tls, pParse, pTab, iDataCur, iIdxCur, uintptr(0), iIdxNoSeek)
 119260 		Xsqlite3VdbeAddOp2(tls, v, OP_Delete, iDataCur, func() int32 {
 119261 			if count != 0 {
 119262 				return OPFLAG_NCHANGE
 119263 			}
 119264 			return 0
 119265 		}())
 119266 		if int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0 || 0 == Xsqlite3_stricmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+12700) {
 119267 			Xsqlite3VdbeAppendP4(tls, v, pTab, -5)
 119268 		}
 119269 		if int32(eMode) != ONEPASS_OFF {
 119270 			Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_AUXDELETE))
 119271 		}
 119272 		if iIdxNoSeek >= 0 && iIdxNoSeek != iDataCur {
 119273 			Xsqlite3VdbeAddOp1(tls, v, OP_Delete, iIdxNoSeek)
 119274 		}
 119275 		if int32(eMode) == ONEPASS_MULTI {
 119276 			p5 = U8(int32(p5) | OPFLAG_SAVEPOSITION)
 119277 		}
 119278 		Xsqlite3VdbeChangeP5(tls, v, uint16(p5))
 119279 	}
 119280 
 119281 	Xsqlite3FkActions(tls, pParse, pTab, uintptr(0), iOld, uintptr(0), 0)
 119282 
 119283 	Xsqlite3CodeRowTrigger(tls, pParse, pTrigger,
 119284 		TK_DELETE, uintptr(0), TRIGGER_AFTER, pTab, iOld, int32(onconf), iLabel)
 119285 
 119286 	Xsqlite3VdbeResolveLabel(tls, v, iLabel)
 119287 
 119288 }
 119289 
 119290 // This routine generates VDBE code that causes the deletion of all
 119291 // index entries associated with a single row of a single table, pTab
 119292 //
 119293 // Preconditions:
 119294 //
 119295 //  1. A read/write cursor "iDataCur" must be open on the canonical storage
 119296 //     btree for the table pTab.  (This will be either the table itself
 119297 //     for rowid tables or to the primary key index for WITHOUT ROWID
 119298 //     tables.)
 119299 //
 119300 //  2. Read/write cursors for all indices of pTab must be open as
 119301 //     cursor number iIdxCur+i for the i-th index.  (The pTab->pIndex
 119302 //     index is the 0-th index.)
 119303 //
 119304 //  3. The "iDataCur" cursor must be already be positioned on the row
 119305 //     that is to be deleted.
 119306 func Xsqlite3GenerateRowIndexDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, iDataCur int32, iIdxCur int32, aRegIdx uintptr, iIdxNoSeek int32) {
 119307 	bp := tls.Alloc(4)
 119308 	defer tls.Free(4)
 119309 
 119310 	var i int32
 119311 	var r1 int32 = -1
 119312 
 119313 	var pIdx uintptr
 119314 	var pPrior uintptr = uintptr(0)
 119315 	var v uintptr
 119316 	var pPk uintptr
 119317 
 119318 	v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 119319 	if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
 119320 		pPk = uintptr(0)
 119321 	} else {
 119322 		pPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
 119323 	}
 119324 	i = 0
 119325 	pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex
 119326 __1:
 119327 	if !(pIdx != 0) {
 119328 		goto __3
 119329 	}
 119330 	{
 119331 		if aRegIdx != uintptr(0) && *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) == 0 {
 119332 			goto __2
 119333 		}
 119334 		if pIdx == pPk {
 119335 			goto __2
 119336 		}
 119337 		if iIdxCur+i == iIdxNoSeek {
 119338 			goto __2
 119339 		}
 119340 
 119341 		r1 = Xsqlite3GenerateIndexKey(tls, pParse, pIdx, iDataCur, 0, 1,
 119342 			bp, pPrior, r1)
 119343 		Xsqlite3VdbeAddOp3(tls, v, OP_IdxDelete, iIdxCur+i, r1,
 119344 			func() int32 {
 119345 				if uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x8>>3)) != 0 {
 119346 					return int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
 119347 				}
 119348 				return int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
 119349 			}())
 119350 		Xsqlite3VdbeChangeP5(tls, v, uint16(1))
 119351 		Xsqlite3ResolvePartIdxLabel(tls, pParse, *(*int32)(unsafe.Pointer(bp)))
 119352 		pPrior = pIdx
 119353 
 119354 	}
 119355 	goto __2
 119356 __2:
 119357 	i++
 119358 	pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
 119359 	goto __1
 119360 	goto __3
 119361 __3:
 119362 }
 119363 
 119364 // Generate code that will assemble an index key and stores it in register
 119365 // regOut.  The key with be for index pIdx which is an index on pTab.
 119366 // iCur is the index of a cursor open on the pTab table and pointing to
 119367 // the entry that needs indexing.  If pTab is a WITHOUT ROWID table, then
 119368 // iCur must be the cursor of the PRIMARY KEY index.
 119369 //
 119370 // Return a register number which is the first in a block of
 119371 // registers that holds the elements of the index key.  The
 119372 // block of registers has already been deallocated by the time
 119373 // this routine returns.
 119374 //
 119375 // If *piPartIdxLabel is not NULL, fill it in with a label and jump
 119376 // to that label if pIdx is a partial index that should be skipped.
 119377 // The label should be resolved using sqlite3ResolvePartIdxLabel().
 119378 // A partial index should be skipped if its WHERE clause evaluates
 119379 // to false or null.  If pIdx is not a partial index, *piPartIdxLabel
 119380 // will be set to zero which is an empty label that is ignored by
 119381 // sqlite3ResolvePartIdxLabel().
 119382 //
 119383 // The pPrior and regPrior parameters are used to implement a cache to
 119384 // avoid unnecessary register loads.  If pPrior is not NULL, then it is
 119385 // a pointer to a different index for which an index key has just been
 119386 // computed into register regPrior.  If the current pIdx index is generating
 119387 // its key into the same sequence of registers and if pPrior and pIdx share
 119388 // a column in common, then the register corresponding to that column already
 119389 // holds the correct value and the loading of that register is skipped.
 119390 // This optimization is helpful when doing a DELETE or an INTEGRITY_CHECK
 119391 // on a table with multiple indices, and especially with the ROWID or
 119392 // PRIMARY KEY columns of the index.
 119393 func Xsqlite3GenerateIndexKey(tls *libc.TLS, pParse uintptr, pIdx uintptr, iDataCur int32, regOut int32, prefixOnly int32, piPartIdxLabel uintptr, pPrior uintptr, regPrior int32) int32 {
 119394 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 119395 	var j int32
 119396 	var regBase int32
 119397 	var nCol int32
 119398 
 119399 	if piPartIdxLabel != 0 {
 119400 		if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 {
 119401 			*(*int32)(unsafe.Pointer(piPartIdxLabel)) = Xsqlite3VdbeMakeLabel(tls, pParse)
 119402 			(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = iDataCur + 1
 119403 			Xsqlite3ExprIfFalseDup(tls, pParse, (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere, *(*int32)(unsafe.Pointer(piPartIdxLabel)),
 119404 				SQLITE_JUMPIFNULL)
 119405 			(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = 0
 119406 			pPrior = uintptr(0)
 119407 
 119408 		} else {
 119409 			*(*int32)(unsafe.Pointer(piPartIdxLabel)) = 0
 119410 		}
 119411 	}
 119412 	if prefixOnly != 0 && uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x8>>3)) != 0 {
 119413 		nCol = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
 119414 	} else {
 119415 		nCol = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
 119416 	}
 119417 	regBase = Xsqlite3GetTempRange(tls, pParse, nCol)
 119418 	if pPrior != 0 && (regBase != regPrior || (*Index)(unsafe.Pointer(pPrior)).FpPartIdxWhere != 0) {
 119419 		pPrior = uintptr(0)
 119420 	}
 119421 	for j = 0; j < nCol; j++ {
 119422 		if pPrior != 0 &&
 119423 			int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPrior)).FaiColumn + uintptr(j)*2))) == int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2))) &&
 119424 			int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPrior)).FaiColumn + uintptr(j)*2))) != -2 {
 119425 			continue
 119426 		}
 119427 		Xsqlite3ExprCodeLoadIndexColumn(tls, pParse, pIdx, iDataCur, j, regBase+j)
 119428 		if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2))) >= 0 {
 119429 			Xsqlite3VdbeDeletePriorOpcode(tls, v, uint8(OP_RealAffinity))
 119430 		}
 119431 	}
 119432 	if regOut != 0 {
 119433 		Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regBase, nCol, regOut)
 119434 	}
 119435 	Xsqlite3ReleaseTempRange(tls, pParse, regBase, nCol)
 119436 	return regBase
 119437 }
 119438 
 119439 // If a prior call to sqlite3GenerateIndexKey() generated a jump-over label
 119440 // because it was a partial index, then this routine should be called to
 119441 // resolve that label.
 119442 func Xsqlite3ResolvePartIdxLabel(tls *libc.TLS, pParse uintptr, iLabel int32) {
 119443 	if iLabel != 0 {
 119444 		Xsqlite3VdbeResolveLabel(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iLabel)
 119445 	}
 119446 }
 119447 
 119448 func sqlite3GetFuncCollSeq(tls *libc.TLS, context uintptr) uintptr {
 119449 	var pOp uintptr
 119450 
 119451 	pOp = (*Vdbe)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(context)).FpVdbe)).FaOp + uintptr((*Sqlite3_context)(unsafe.Pointer(context)).FiOp-1)*24
 119452 
 119453 	return *(*uintptr)(unsafe.Pointer(pOp + 16))
 119454 }
 119455 
 119456 func sqlite3SkipAccumulatorLoad(tls *libc.TLS, context uintptr) {
 119457 	(*Sqlite3_context)(unsafe.Pointer(context)).FisError = -1
 119458 	(*Sqlite3_context)(unsafe.Pointer(context)).FskipFlag = U8(1)
 119459 }
 119460 
 119461 func minmaxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 119462 	var i int32
 119463 	var mask int32
 119464 	var iBest int32
 119465 	var pColl uintptr
 119466 
 119467 	if Xsqlite3_user_data(tls, context) == uintptr(0) {
 119468 		mask = 0
 119469 	} else {
 119470 		mask = -1
 119471 	}
 119472 	pColl = sqlite3GetFuncCollSeq(tls, context)
 119473 
 119474 	iBest = 0
 119475 	if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) == SQLITE_NULL {
 119476 		return
 119477 	}
 119478 	for i = 1; i < argc; i++ {
 119479 		if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) == SQLITE_NULL {
 119480 			return
 119481 		}
 119482 		if Xsqlite3MemCompare(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(iBest)*8)), *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), pColl)^mask >= 0 {
 119483 			iBest = i
 119484 		}
 119485 	}
 119486 	Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(iBest)*8)))
 119487 }
 119488 
 119489 func typeofFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) {
 119490 	var i int32 = Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) - 1
 119491 	_ = NotUsed
 119492 
 119493 	Xsqlite3_result_text(tls, context, azType2[i], -1, uintptr(0))
 119494 }
 119495 
 119496 var azType2 = [5]uintptr{ts + 7543, ts + 7538, ts + 9357, ts + 9352, ts + 7533}
 119497 
 119498 func subtypeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 119499 	_ = argc
 119500 	Xsqlite3_result_int(tls, context, int32(Xsqlite3_value_subtype(tls, *(*uintptr)(unsafe.Pointer(argv)))))
 119501 }
 119502 
 119503 func lengthFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 119504 	_ = argc
 119505 	switch Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) {
 119506 	case SQLITE_BLOB:
 119507 		fallthrough
 119508 	case SQLITE_INTEGER:
 119509 		fallthrough
 119510 	case SQLITE_FLOAT:
 119511 		{
 119512 			Xsqlite3_result_int(tls, context, Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))))
 119513 			break
 119514 
 119515 		}
 119516 	case SQLITE_TEXT:
 119517 		{
 119518 			var z uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 119519 			var z0 uintptr
 119520 			var c uint8
 119521 			if z == uintptr(0) {
 119522 				return
 119523 			}
 119524 			z0 = z
 119525 			for int32(libc.AssignUint8(&c, *(*uint8)(unsafe.Pointer(z)))) != 0 {
 119526 				z++
 119527 				if int32(c) >= 0xc0 {
 119528 					for int32(*(*uint8)(unsafe.Pointer(z)))&0xc0 == 0x80 {
 119529 						z++
 119530 						z0++
 119531 					}
 119532 				}
 119533 			}
 119534 			Xsqlite3_result_int(tls, context, int32((int64(z)-int64(z0))/1))
 119535 			break
 119536 
 119537 		}
 119538 	default:
 119539 		{
 119540 			Xsqlite3_result_null(tls, context)
 119541 			break
 119542 
 119543 		}
 119544 	}
 119545 }
 119546 
 119547 func absFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 119548 	_ = argc
 119549 	switch Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) {
 119550 	case SQLITE_INTEGER:
 119551 		{
 119552 			var iVal I64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv)))
 119553 			if iVal < int64(0) {
 119554 				if iVal == int64(-1)-(int64(0xffffffff)|int64(0x7fffffff)<<32) {
 119555 					Xsqlite3_result_error(tls, context, ts+16203, -1)
 119556 					return
 119557 				}
 119558 				iVal = -iVal
 119559 			}
 119560 			Xsqlite3_result_int64(tls, context, iVal)
 119561 			break
 119562 
 119563 		}
 119564 	case SQLITE_NULL:
 119565 		{
 119566 			Xsqlite3_result_null(tls, context)
 119567 			break
 119568 
 119569 		}
 119570 	default:
 119571 		{
 119572 			var rVal float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv)))
 119573 			if rVal < float64(0) {
 119574 				rVal = -rVal
 119575 			}
 119576 			Xsqlite3_result_double(tls, context, rVal)
 119577 			break
 119578 
 119579 		}
 119580 	}
 119581 }
 119582 
 119583 func instrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 119584 	var zHaystack uintptr
 119585 	var zNeedle uintptr
 119586 	var nHaystack int32
 119587 	var nNeedle int32
 119588 	var typeHaystack int32
 119589 	var typeNeedle int32
 119590 	var N int32
 119591 	var isText int32
 119592 	var firstChar uint8
 119593 	var pC1 uintptr
 119594 	var pC2 uintptr
 119595 	N = 1
 119596 	pC1 = uintptr(0)
 119597 	pC2 = uintptr(0)
 119598 
 119599 	_ = argc
 119600 	typeHaystack = Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv)))
 119601 	typeNeedle = Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 119602 	if !(typeHaystack == SQLITE_NULL || typeNeedle == SQLITE_NULL) {
 119603 		goto __1
 119604 	}
 119605 	return
 119606 __1:
 119607 	;
 119608 	nHaystack = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))
 119609 	nNeedle = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 119610 	if !(nNeedle > 0) {
 119611 		goto __2
 119612 	}
 119613 	if !(typeHaystack == SQLITE_BLOB && typeNeedle == SQLITE_BLOB) {
 119614 		goto __3
 119615 	}
 119616 	zHaystack = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv)))
 119617 	zNeedle = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 119618 	isText = 0
 119619 	goto __4
 119620 __3:
 119621 	if !(typeHaystack != SQLITE_BLOB && typeNeedle != SQLITE_BLOB) {
 119622 		goto __5
 119623 	}
 119624 	zHaystack = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 119625 	zNeedle = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 119626 	isText = 1
 119627 	goto __6
 119628 __5:
 119629 	pC1 = Xsqlite3_value_dup(tls, *(*uintptr)(unsafe.Pointer(argv)))
 119630 	zHaystack = Xsqlite3_value_text(tls, pC1)
 119631 	if !(zHaystack == uintptr(0)) {
 119632 		goto __7
 119633 	}
 119634 	goto endInstrOOM
 119635 __7:
 119636 	;
 119637 	nHaystack = Xsqlite3_value_bytes(tls, pC1)
 119638 	pC2 = Xsqlite3_value_dup(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 119639 	zNeedle = Xsqlite3_value_text(tls, pC2)
 119640 	if !(zNeedle == uintptr(0)) {
 119641 		goto __8
 119642 	}
 119643 	goto endInstrOOM
 119644 __8:
 119645 	;
 119646 	nNeedle = Xsqlite3_value_bytes(tls, pC2)
 119647 	isText = 1
 119648 __6:
 119649 	;
 119650 __4:
 119651 	;
 119652 	if !(zNeedle == uintptr(0) || nHaystack != 0 && zHaystack == uintptr(0)) {
 119653 		goto __9
 119654 	}
 119655 	goto endInstrOOM
 119656 __9:
 119657 	;
 119658 	firstChar = *(*uint8)(unsafe.Pointer(zNeedle))
 119659 __10:
 119660 	if !(nNeedle <= nHaystack &&
 119661 		(int32(*(*uint8)(unsafe.Pointer(zHaystack))) != int32(firstChar) || libc.Xmemcmp(tls, zHaystack, zNeedle, uint64(nNeedle)) != 0)) {
 119662 		goto __11
 119663 	}
 119664 	N++
 119665 __12:
 119666 	nHaystack--
 119667 	zHaystack++
 119668 	goto __13
 119669 __13:
 119670 	if isText != 0 && int32(*(*uint8)(unsafe.Pointer(zHaystack)))&0xc0 == 0x80 {
 119671 		goto __12
 119672 	}
 119673 	goto __14
 119674 __14:
 119675 	;
 119676 	goto __10
 119677 __11:
 119678 	;
 119679 	if !(nNeedle > nHaystack) {
 119680 		goto __15
 119681 	}
 119682 	N = 0
 119683 __15:
 119684 	;
 119685 __2:
 119686 	;
 119687 	Xsqlite3_result_int(tls, context, N)
 119688 endInstr:
 119689 	Xsqlite3_value_free(tls, pC1)
 119690 	Xsqlite3_value_free(tls, pC2)
 119691 	return
 119692 endInstrOOM:
 119693 	Xsqlite3_result_error_nomem(tls, context)
 119694 	goto endInstr
 119695 }
 119696 
 119697 func printfFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 119698 	bp := tls.Alloc(56)
 119699 	defer tls.Free(56)
 119700 
 119701 	var zFormat uintptr
 119702 	var n int32
 119703 	var db uintptr = Xsqlite3_context_db_handle(tls, context)
 119704 
 119705 	if argc >= 1 && libc.AssignUintptr(&zFormat, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))) != uintptr(0) {
 119706 		(*PrintfArguments)(unsafe.Pointer(bp + 40)).FnArg = argc - 1
 119707 		(*PrintfArguments)(unsafe.Pointer(bp + 40)).FnUsed = 0
 119708 		(*PrintfArguments)(unsafe.Pointer(bp + 40)).FapArg = argv + uintptr(1)*8
 119709 		Xsqlite3StrAccumInit(tls, bp+8, db, uintptr(0), 0, *(*int32)(unsafe.Pointer(db + 136)))
 119710 		(*StrAccum)(unsafe.Pointer(bp + 8)).FprintfFlags = U8(SQLITE_PRINTF_SQLFUNC)
 119711 		Xsqlite3_str_appendf(tls, bp+8, zFormat, libc.VaList(bp, bp+40))
 119712 		n = int32((*StrAccum)(unsafe.Pointer(bp + 8)).FnChar)
 119713 		Xsqlite3_result_text(tls, context, Xsqlite3StrAccumFinish(tls, bp+8), n,
 119714 			*(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomClear})))
 119715 	}
 119716 }
 119717 
 119718 func substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 119719 	var z uintptr
 119720 	var z2 uintptr
 119721 	var len int32
 119722 	var p0type int32
 119723 	var p1 I64
 119724 	var p2 I64
 119725 	var negP2 int32 = 0
 119726 
 119727 	if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == SQLITE_NULL ||
 119728 		argc == 3 && Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8))) == SQLITE_NULL {
 119729 		return
 119730 	}
 119731 	p0type = Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv)))
 119732 	p1 = I64(Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))
 119733 	if p0type == SQLITE_BLOB {
 119734 		len = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))
 119735 		z = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv)))
 119736 		if z == uintptr(0) {
 119737 			return
 119738 		}
 119739 
 119740 	} else {
 119741 		z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 119742 		if z == uintptr(0) {
 119743 			return
 119744 		}
 119745 		len = 0
 119746 		if p1 < int64(0) {
 119747 			for z2 = z; *(*uint8)(unsafe.Pointer(z2)) != 0; len++ {
 119748 				{
 119749 					if int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z2, 1)))) >= 0xc0 {
 119750 						for int32(*(*uint8)(unsafe.Pointer(z2)))&0xc0 == 0x80 {
 119751 							z2++
 119752 						}
 119753 					}
 119754 				}
 119755 
 119756 			}
 119757 		}
 119758 	}
 119759 	if argc == 3 {
 119760 		p2 = I64(Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8))))
 119761 		if p2 < int64(0) {
 119762 			p2 = -p2
 119763 			negP2 = 1
 119764 		}
 119765 	} else {
 119766 		p2 = I64(*(*int32)(unsafe.Pointer(Xsqlite3_context_db_handle(tls, context) + 136)))
 119767 	}
 119768 	if p1 < int64(0) {
 119769 		p1 = p1 + I64(len)
 119770 		if p1 < int64(0) {
 119771 			p2 = p2 + p1
 119772 			if p2 < int64(0) {
 119773 				p2 = int64(0)
 119774 			}
 119775 			p1 = int64(0)
 119776 		}
 119777 	} else if p1 > int64(0) {
 119778 		p1--
 119779 	} else if p2 > int64(0) {
 119780 		p2--
 119781 	}
 119782 	if negP2 != 0 {
 119783 		p1 = p1 - p2
 119784 		if p1 < int64(0) {
 119785 			p2 = p2 + p1
 119786 			p1 = int64(0)
 119787 		}
 119788 	}
 119789 
 119790 	if p0type != SQLITE_BLOB {
 119791 		for *(*uint8)(unsafe.Pointer(z)) != 0 && p1 != 0 {
 119792 			{
 119793 				if int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) >= 0xc0 {
 119794 					for int32(*(*uint8)(unsafe.Pointer(z)))&0xc0 == 0x80 {
 119795 						z++
 119796 					}
 119797 				}
 119798 			}
 119799 
 119800 			p1--
 119801 		}
 119802 		for z2 = z; *(*uint8)(unsafe.Pointer(z2)) != 0 && p2 != 0; p2-- {
 119803 			{
 119804 				if int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z2, 1)))) >= 0xc0 {
 119805 					for int32(*(*uint8)(unsafe.Pointer(z2)))&0xc0 == 0x80 {
 119806 						z2++
 119807 					}
 119808 				}
 119809 			}
 119810 
 119811 		}
 119812 		Xsqlite3_result_text64(tls, context, z, uint64((int64(z2)-int64(z))/1), libc.UintptrFromInt32(-1),
 119813 			uint8(SQLITE_UTF8))
 119814 	} else {
 119815 		if p1+p2 > I64(len) {
 119816 			p2 = I64(len) - p1
 119817 			if p2 < int64(0) {
 119818 				p2 = int64(0)
 119819 			}
 119820 		}
 119821 		Xsqlite3_result_blob64(tls, context, z+uintptr(p1), U64(p2), libc.UintptrFromInt32(-1))
 119822 	}
 119823 }
 119824 
 119825 func roundFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 119826 	bp := tls.Alloc(24)
 119827 	defer tls.Free(24)
 119828 
 119829 	var n int32 = 0
 119830 
 119831 	var zBuf uintptr
 119832 
 119833 	if argc == 2 {
 119834 		if SQLITE_NULL == Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) {
 119835 			return
 119836 		}
 119837 		n = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 119838 		if n > 30 {
 119839 			n = 30
 119840 		}
 119841 		if n < 0 {
 119842 			n = 0
 119843 		}
 119844 	}
 119845 	if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) == SQLITE_NULL {
 119846 		return
 119847 	}
 119848 	*(*float64)(unsafe.Pointer(bp + 16)) = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv)))
 119849 
 119850 	if *(*float64)(unsafe.Pointer(bp + 16)) < -4503599627370496.0 || *(*float64)(unsafe.Pointer(bp + 16)) > +4503599627370496.0 {
 119851 	} else if n == 0 {
 119852 		*(*float64)(unsafe.Pointer(bp + 16)) = float64(libc.Int64FromFloat64(*(*float64)(unsafe.Pointer(bp + 16)) + func() float64 {
 119853 			if *(*float64)(unsafe.Pointer(bp + 16)) < float64(0) {
 119854 				return -0.5
 119855 			}
 119856 			return +0.5
 119857 		}()))
 119858 	} else {
 119859 		zBuf = Xsqlite3_mprintf(tls, ts+16220, libc.VaList(bp, n, *(*float64)(unsafe.Pointer(bp + 16))))
 119860 		if zBuf == uintptr(0) {
 119861 			Xsqlite3_result_error_nomem(tls, context)
 119862 			return
 119863 		}
 119864 		Xsqlite3AtoF(tls, zBuf, bp+16, Xsqlite3Strlen30(tls, zBuf), uint8(SQLITE_UTF8))
 119865 		Xsqlite3_free(tls, zBuf)
 119866 	}
 119867 	Xsqlite3_result_double(tls, context, *(*float64)(unsafe.Pointer(bp + 16)))
 119868 }
 119869 
 119870 func contextMalloc(tls *libc.TLS, context uintptr, nByte I64) uintptr {
 119871 	var z uintptr
 119872 	var db uintptr = Xsqlite3_context_db_handle(tls, context)
 119873 
 119874 	if nByte > I64(*(*int32)(unsafe.Pointer(db + 136))) {
 119875 		Xsqlite3_result_error_toobig(tls, context)
 119876 		z = uintptr(0)
 119877 	} else {
 119878 		z = Xsqlite3Malloc(tls, uint64(nByte))
 119879 		if !(z != 0) {
 119880 			Xsqlite3_result_error_nomem(tls, context)
 119881 		}
 119882 	}
 119883 	return z
 119884 }
 119885 
 119886 func upperFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 119887 	var z1 uintptr
 119888 	var z2 uintptr
 119889 	var i int32
 119890 	var n int32
 119891 	_ = argc
 119892 	z2 = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 119893 	n = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))
 119894 
 119895 	if z2 != 0 {
 119896 		z1 = contextMalloc(tls, context, I64(n)+int64(1))
 119897 		if z1 != 0 {
 119898 			for i = 0; i < n; i++ {
 119899 				*(*int8)(unsafe.Pointer(z1 + uintptr(i))) = int8(int32(*(*int8)(unsafe.Pointer(z2 + uintptr(i)))) & ^(int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z2 + uintptr(i))))]) & 0x20))
 119900 			}
 119901 			Xsqlite3_result_text(tls, context, z1, n, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
 119902 		}
 119903 	}
 119904 }
 119905 
 119906 func lowerFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 119907 	var z1 uintptr
 119908 	var z2 uintptr
 119909 	var i int32
 119910 	var n int32
 119911 	_ = argc
 119912 	z2 = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 119913 	n = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))
 119914 
 119915 	if z2 != 0 {
 119916 		z1 = contextMalloc(tls, context, I64(n)+int64(1))
 119917 		if z1 != 0 {
 119918 			for i = 0; i < n; i++ {
 119919 				*(*int8)(unsafe.Pointer(z1 + uintptr(i))) = int8(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(z2 + uintptr(i))))])
 119920 			}
 119921 			Xsqlite3_result_text(tls, context, z1, n, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
 119922 		}
 119923 	}
 119924 }
 119925 
 119926 func randomFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) {
 119927 	bp := tls.Alloc(8)
 119928 	defer tls.Free(8)
 119929 
 119930 	_ = NotUsed
 119931 	_ = NotUsed2
 119932 	Xsqlite3_randomness(tls, int32(unsafe.Sizeof(Sqlite_int64(0))), bp)
 119933 	if *(*Sqlite_int64)(unsafe.Pointer(bp)) < int64(0) {
 119934 		*(*Sqlite_int64)(unsafe.Pointer(bp)) = -(*(*Sqlite_int64)(unsafe.Pointer(bp)) & (int64(0xffffffff) | int64(0x7fffffff)<<32))
 119935 	}
 119936 	Xsqlite3_result_int64(tls, context, *(*Sqlite_int64)(unsafe.Pointer(bp)))
 119937 }
 119938 
 119939 func randomBlob(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 119940 	var n Sqlite3_int64
 119941 	var p uintptr
 119942 
 119943 	_ = argc
 119944 	n = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv)))
 119945 	if n < int64(1) {
 119946 		n = int64(1)
 119947 	}
 119948 	p = contextMalloc(tls, context, n)
 119949 	if p != 0 {
 119950 		Xsqlite3_randomness(tls, int32(n), p)
 119951 		Xsqlite3_result_blob(tls, context, p, int32(n), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
 119952 	}
 119953 }
 119954 
 119955 func last_insert_rowid(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) {
 119956 	var db uintptr = Xsqlite3_context_db_handle(tls, context)
 119957 	_ = NotUsed
 119958 	_ = NotUsed2
 119959 
 119960 	Xsqlite3_result_int64(tls, context, Xsqlite3_last_insert_rowid(tls, db))
 119961 }
 119962 
 119963 func changes(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) {
 119964 	var db uintptr = Xsqlite3_context_db_handle(tls, context)
 119965 	_ = NotUsed
 119966 	_ = NotUsed2
 119967 	Xsqlite3_result_int64(tls, context, Xsqlite3_changes64(tls, db))
 119968 }
 119969 
 119970 func total_changes(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) {
 119971 	var db uintptr = Xsqlite3_context_db_handle(tls, context)
 119972 	_ = NotUsed
 119973 	_ = NotUsed2
 119974 
 119975 	Xsqlite3_result_int64(tls, context, Xsqlite3_total_changes64(tls, db))
 119976 }
 119977 
 119978 type compareInfo = struct {
 119979 	FmatchAll U8
 119980 	FmatchOne U8
 119981 	FmatchSet U8
 119982 	FnoCase   U8
 119983 }
 119984 
 119985 var globInfo = compareInfo{FmatchAll: U8('*'), FmatchOne: U8('?'), FmatchSet: U8('[')}
 119986 
 119987 var likeInfoNorm = compareInfo{FmatchAll: U8('%'), FmatchOne: U8('_'), FnoCase: U8(1)}
 119988 
 119989 var likeInfoAlt = compareInfo{FmatchAll: U8('%'), FmatchOne: U8('_')}
 119990 
 119991 func patternCompare(tls *libc.TLS, zPattern uintptr, zString uintptr, pInfo uintptr, matchOther U32) int32 {
 119992 	bp := tls.Alloc(19)
 119993 	defer tls.Free(19)
 119994 	*(*uintptr)(unsafe.Pointer(bp)) = zPattern
 119995 	*(*uintptr)(unsafe.Pointer(bp + 8)) = zString
 119996 
 119997 	var c U32
 119998 	var c2 U32
 119999 	var matchOne U32 = U32((*compareInfo)(unsafe.Pointer(pInfo)).FmatchOne)
 120000 	var matchAll U32 = U32((*compareInfo)(unsafe.Pointer(pInfo)).FmatchAll)
 120001 	var noCase U8 = (*compareInfo)(unsafe.Pointer(pInfo)).FnoCase
 120002 	var zEscaped uintptr = uintptr(0)
 120003 
 120004 	for libc.AssignUint32(&c, func() uint32 {
 120005 		if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) < 0x80 {
 120006 			return uint32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp)), 1))))
 120007 		}
 120008 		return Xsqlite3Utf8Read(tls, bp)
 120009 	}()) != U32(0) {
 120010 		if c == matchAll {
 120011 			for libc.AssignUint32(&c, func() uint32 {
 120012 				if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) < 0x80 {
 120013 					return uint32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp)), 1))))
 120014 				}
 120015 				return Xsqlite3Utf8Read(tls, bp)
 120016 			}()) == matchAll ||
 120017 				c == matchOne && matchOne != U32(0) {
 120018 				if c == matchOne && Xsqlite3Utf8Read(tls, bp+8) == U32(0) {
 120019 					return SQLITE_NOWILDCARDMATCH
 120020 				}
 120021 			}
 120022 			if c == U32(0) {
 120023 				return SQLITE_MATCH
 120024 			} else if c == matchOther {
 120025 				if int32((*compareInfo)(unsafe.Pointer(pInfo)).FmatchSet) == 0 {
 120026 					c = Xsqlite3Utf8Read(tls, bp)
 120027 					if c == U32(0) {
 120028 						return SQLITE_NOWILDCARDMATCH
 120029 					}
 120030 				} else {
 120031 					for *(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))) != 0 {
 120032 						var bMatch int32 = patternCompare(tls, *(*uintptr)(unsafe.Pointer(bp))+libc.UintptrFromInt32(-1), *(*uintptr)(unsafe.Pointer(bp + 8)), pInfo, matchOther)
 120033 						if bMatch != SQLITE_NOMATCH {
 120034 							return bMatch
 120035 						}
 120036 						{
 120037 							if int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 8)), 1)))) >= 0xc0 {
 120038 								for int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))))&0xc0 == 0x80 {
 120039 									*(*uintptr)(unsafe.Pointer(bp + 8))++
 120040 								}
 120041 							}
 120042 						}
 120043 
 120044 					}
 120045 					return SQLITE_NOWILDCARDMATCH
 120046 				}
 120047 			}
 120048 
 120049 			if c < U32(0x80) {
 120050 				var bMatch int32
 120051 				if noCase != 0 {
 120052 					*(*int8)(unsafe.Pointer(bp + 16)) = int8(c & U32(^(int32(Xsqlite3CtypeMap[uint8(c)]) & 0x20)))
 120053 					*(*int8)(unsafe.Pointer(bp + 16 + 1)) = int8(Xsqlite3UpperToLower[uint8(c)])
 120054 					*(*int8)(unsafe.Pointer(bp + 16 + 2)) = int8(0)
 120055 				} else {
 120056 					*(*int8)(unsafe.Pointer(bp + 16)) = int8(c)
 120057 					*(*int8)(unsafe.Pointer(bp + 16 + 1)) = int8(0)
 120058 				}
 120059 				for 1 != 0 {
 120060 					*(*uintptr)(unsafe.Pointer(bp + 8)) += uintptr(libc.Xstrcspn(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), bp+16))
 120061 					if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8))))) == 0 {
 120062 						break
 120063 					}
 120064 					*(*uintptr)(unsafe.Pointer(bp + 8))++
 120065 					bMatch = patternCompare(tls, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)), pInfo, matchOther)
 120066 					if bMatch != SQLITE_NOMATCH {
 120067 						return bMatch
 120068 					}
 120069 				}
 120070 			} else {
 120071 				var bMatch int32
 120072 				for libc.AssignUint32(&c2, func() uint32 {
 120073 					if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8))))) < 0x80 {
 120074 						return uint32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 8)), 1))))
 120075 					}
 120076 					return Xsqlite3Utf8Read(tls, bp+8)
 120077 				}()) != U32(0) {
 120078 					if c2 != c {
 120079 						continue
 120080 					}
 120081 					bMatch = patternCompare(tls, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)), pInfo, matchOther)
 120082 					if bMatch != SQLITE_NOMATCH {
 120083 						return bMatch
 120084 					}
 120085 				}
 120086 			}
 120087 			return SQLITE_NOWILDCARDMATCH
 120088 		}
 120089 		if c == matchOther {
 120090 			if int32((*compareInfo)(unsafe.Pointer(pInfo)).FmatchSet) == 0 {
 120091 				c = Xsqlite3Utf8Read(tls, bp)
 120092 				if c == U32(0) {
 120093 					return SQLITE_NOMATCH
 120094 				}
 120095 				zEscaped = *(*uintptr)(unsafe.Pointer(bp))
 120096 			} else {
 120097 				var prior_c U32 = U32(0)
 120098 				var seen int32 = 0
 120099 				var invert int32 = 0
 120100 				c = Xsqlite3Utf8Read(tls, bp+8)
 120101 				if c == U32(0) {
 120102 					return SQLITE_NOMATCH
 120103 				}
 120104 				c2 = Xsqlite3Utf8Read(tls, bp)
 120105 				if c2 == U32('^') {
 120106 					invert = 1
 120107 					c2 = Xsqlite3Utf8Read(tls, bp)
 120108 				}
 120109 				if c2 == U32(']') {
 120110 					if c == U32(']') {
 120111 						seen = 1
 120112 					}
 120113 					c2 = Xsqlite3Utf8Read(tls, bp)
 120114 				}
 120115 				for c2 != 0 && c2 != U32(']') {
 120116 					if c2 == U32('-') && int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) != ']' && int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) != 0 && prior_c > U32(0) {
 120117 						c2 = Xsqlite3Utf8Read(tls, bp)
 120118 						if c >= prior_c && c <= c2 {
 120119 							seen = 1
 120120 						}
 120121 						prior_c = U32(0)
 120122 					} else {
 120123 						if c == c2 {
 120124 							seen = 1
 120125 						}
 120126 						prior_c = c2
 120127 					}
 120128 					c2 = Xsqlite3Utf8Read(tls, bp)
 120129 				}
 120130 				if c2 == U32(0) || seen^invert == 0 {
 120131 					return SQLITE_NOMATCH
 120132 				}
 120133 				continue
 120134 			}
 120135 		}
 120136 		c2 = func() uint32 {
 120137 			if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8))))) < 0x80 {
 120138 				return uint32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 8)), 1))))
 120139 			}
 120140 			return Xsqlite3Utf8Read(tls, bp+8)
 120141 		}()
 120142 		if c == c2 {
 120143 			continue
 120144 		}
 120145 		if noCase != 0 && int32(Xsqlite3UpperToLower[uint8(c)]) == int32(Xsqlite3UpperToLower[uint8(c2)]) && c < U32(0x80) && c2 < U32(0x80) {
 120146 			continue
 120147 		}
 120148 		if c == matchOne && *(*uintptr)(unsafe.Pointer(bp)) != zEscaped && c2 != U32(0) {
 120149 			continue
 120150 		}
 120151 		return SQLITE_NOMATCH
 120152 	}
 120153 	if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8))))) == 0 {
 120154 		return SQLITE_MATCH
 120155 	}
 120156 	return SQLITE_NOMATCH
 120157 }
 120158 
 120159 // The sqlite3_strglob() interface.  Return 0 on a match (like strcmp()) and
 120160 // non-zero if there is no match.
 120161 func Xsqlite3_strglob(tls *libc.TLS, zGlobPattern uintptr, zString uintptr) int32 {
 120162 	if zString == uintptr(0) {
 120163 		return libc.Bool32(zGlobPattern != uintptr(0))
 120164 	} else if zGlobPattern == uintptr(0) {
 120165 		return 1
 120166 	} else {
 120167 		return patternCompare(tls, zGlobPattern, zString, uintptr(unsafe.Pointer(&globInfo)), uint32('['))
 120168 	}
 120169 	return int32(0)
 120170 }
 120171 
 120172 // The sqlite3_strlike() interface.  Return 0 on a match and non-zero for
 120173 // a miss - like strcmp().
 120174 func Xsqlite3_strlike(tls *libc.TLS, zPattern uintptr, zStr uintptr, esc uint32) int32 {
 120175 	if zStr == uintptr(0) {
 120176 		return libc.Bool32(zPattern != uintptr(0))
 120177 	} else if zPattern == uintptr(0) {
 120178 		return 1
 120179 	} else {
 120180 		return patternCompare(tls, zPattern, zStr, uintptr(unsafe.Pointer(&likeInfoNorm)), esc)
 120181 	}
 120182 	return int32(0)
 120183 }
 120184 
 120185 func likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 120186 	bp := tls.Alloc(12)
 120187 	defer tls.Free(12)
 120188 
 120189 	var zA uintptr
 120190 	var zB uintptr
 120191 	var escape U32
 120192 	var nPat int32
 120193 	var db uintptr = Xsqlite3_context_db_handle(tls, context)
 120194 	var pInfo uintptr = Xsqlite3_user_data(tls, context)
 120195 
 120196 	if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) == SQLITE_BLOB ||
 120197 		Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == SQLITE_BLOB {
 120198 		Xsqlite3_result_int(tls, context, 0)
 120199 		return
 120200 	}
 120201 
 120202 	nPat = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))
 120203 
 120204 	if nPat > *(*int32)(unsafe.Pointer(db + 136 + 8*4)) {
 120205 		Xsqlite3_result_error(tls, context, ts+16225, -1)
 120206 		return
 120207 	}
 120208 	if argc == 3 {
 120209 		*(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))
 120210 		if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) {
 120211 			return
 120212 		}
 120213 		if Xsqlite3Utf8CharLen(tls, *(*uintptr)(unsafe.Pointer(bp)), -1) != 1 {
 120214 			Xsqlite3_result_error(tls, context,
 120215 				ts+16258, -1)
 120216 			return
 120217 		}
 120218 		escape = Xsqlite3Utf8Read(tls, bp)
 120219 		if escape == U32((*compareInfo)(unsafe.Pointer(pInfo)).FmatchAll) || escape == U32((*compareInfo)(unsafe.Pointer(pInfo)).FmatchOne) {
 120220 			libc.Xmemcpy(tls, bp+8, pInfo, uint64(unsafe.Sizeof(compareInfo{})))
 120221 			pInfo = bp + 8
 120222 			if escape == U32((*compareInfo)(unsafe.Pointer(pInfo)).FmatchAll) {
 120223 				(*compareInfo)(unsafe.Pointer(pInfo)).FmatchAll = U8(0)
 120224 			}
 120225 			if escape == U32((*compareInfo)(unsafe.Pointer(pInfo)).FmatchOne) {
 120226 				(*compareInfo)(unsafe.Pointer(pInfo)).FmatchOne = U8(0)
 120227 			}
 120228 		}
 120229 	} else {
 120230 		escape = U32((*compareInfo)(unsafe.Pointer(pInfo)).FmatchSet)
 120231 	}
 120232 	zB = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 120233 	zA = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 120234 	if zA != 0 && zB != 0 {
 120235 		Xsqlite3_result_int(tls, context,
 120236 			libc.Bool32(patternCompare(tls, zB, zA, pInfo, escape) == SQLITE_MATCH))
 120237 	}
 120238 }
 120239 
 120240 func nullifFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) {
 120241 	var pColl uintptr = sqlite3GetFuncCollSeq(tls, context)
 120242 	_ = NotUsed
 120243 	if Xsqlite3MemCompare(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*uintptr)(unsafe.Pointer(argv + 1*8)), pColl) != 0 {
 120244 		Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv)))
 120245 	}
 120246 }
 120247 
 120248 func versionFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) {
 120249 	_ = NotUsed
 120250 	_ = NotUsed2
 120251 
 120252 	Xsqlite3_result_text(tls, context, Xsqlite3_libversion(tls), -1, uintptr(0))
 120253 }
 120254 
 120255 func sourceidFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) {
 120256 	_ = NotUsed
 120257 	_ = NotUsed2
 120258 
 120259 	Xsqlite3_result_text(tls, context, Xsqlite3_sourceid(tls), -1, uintptr(0))
 120260 }
 120261 
 120262 func errlogFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 120263 	bp := tls.Alloc(8)
 120264 	defer tls.Free(8)
 120265 
 120266 	_ = argc
 120267 	_ = context
 120268 	Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), ts+4493, libc.VaList(bp, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))))
 120269 }
 120270 
 120271 func compileoptionusedFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 120272 	var zOptName uintptr
 120273 
 120274 	_ = argc
 120275 
 120276 	if libc.AssignUintptr(&zOptName, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))) != uintptr(0) {
 120277 		Xsqlite3_result_int(tls, context, Xsqlite3_compileoption_used(tls, zOptName))
 120278 	}
 120279 }
 120280 
 120281 func compileoptiongetFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 120282 	var n int32
 120283 
 120284 	_ = argc
 120285 
 120286 	n = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv)))
 120287 	Xsqlite3_result_text(tls, context, Xsqlite3_compileoption_get(tls, n), -1, uintptr(0))
 120288 }
 120289 
 120290 var hexdigits = [16]int8{
 120291 	int8('0'), int8('1'), int8('2'), int8('3'), int8('4'), int8('5'), int8('6'), int8('7'),
 120292 	int8('8'), int8('9'), int8('A'), int8('B'), int8('C'), int8('D'), int8('E'), int8('F'),
 120293 }
 120294 
 120295 // Append to pStr text that is the SQL literal representation of the
 120296 // value contained in pValue.
 120297 func Xsqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) {
 120298 	bp := tls.Alloc(40)
 120299 	defer tls.Free(40)
 120300 
 120301 	switch Xsqlite3_value_type(tls, pValue) {
 120302 	case SQLITE_FLOAT:
 120303 		{
 120304 			var r1 float64
 120305 
 120306 			var zVal uintptr
 120307 			r1 = Xsqlite3_value_double(tls, pValue)
 120308 			Xsqlite3_str_appendf(tls, pStr, ts+6277, libc.VaList(bp, r1))
 120309 			zVal = Xsqlite3_str_value(tls, pStr)
 120310 			if zVal != 0 {
 120311 				Xsqlite3AtoF(tls, zVal, bp+32, int32((*StrAccum)(unsafe.Pointer(pStr)).FnChar), uint8(SQLITE_UTF8))
 120312 				if r1 != *(*float64)(unsafe.Pointer(bp + 32)) {
 120313 					Xsqlite3_str_reset(tls, pStr)
 120314 					Xsqlite3_str_appendf(tls, pStr, ts+16303, libc.VaList(bp+8, r1))
 120315 				}
 120316 			}
 120317 			break
 120318 
 120319 		}
 120320 	case SQLITE_INTEGER:
 120321 		{
 120322 			Xsqlite3_str_appendf(tls, pStr, ts+1324, libc.VaList(bp+16, Xsqlite3_value_int64(tls, pValue)))
 120323 			break
 120324 
 120325 		}
 120326 	case SQLITE_BLOB:
 120327 		{
 120328 			var zBlob uintptr = Xsqlite3_value_blob(tls, pValue)
 120329 			var nBlob I64 = I64(Xsqlite3_value_bytes(tls, pValue))
 120330 
 120331 			Xsqlite3StrAccumEnlarge(tls, pStr, nBlob*int64(2)+int64(4))
 120332 			if int32((*StrAccum)(unsafe.Pointer(pStr)).FaccError) == 0 {
 120333 				var zText uintptr = (*StrAccum)(unsafe.Pointer(pStr)).FzText
 120334 				var i int32
 120335 				for i = 0; I64(i) < nBlob; i++ {
 120336 					*(*int8)(unsafe.Pointer(zText + uintptr(i*2+2))) = hexdigits[int32(*(*int8)(unsafe.Pointer(zBlob + uintptr(i))))>>4&0x0F]
 120337 					*(*int8)(unsafe.Pointer(zText + uintptr(i*2+3))) = hexdigits[int32(*(*int8)(unsafe.Pointer(zBlob + uintptr(i))))&0x0F]
 120338 				}
 120339 				*(*int8)(unsafe.Pointer(zText + uintptr(nBlob*int64(2)+int64(2)))) = int8('\'')
 120340 				*(*int8)(unsafe.Pointer(zText + uintptr(nBlob*int64(2)+int64(3)))) = int8(0)
 120341 				*(*int8)(unsafe.Pointer(zText)) = int8('X')
 120342 				*(*int8)(unsafe.Pointer(zText + 1)) = int8('\'')
 120343 				(*StrAccum)(unsafe.Pointer(pStr)).FnChar = U32(nBlob*int64(2) + int64(3))
 120344 			}
 120345 			break
 120346 
 120347 		}
 120348 	case SQLITE_TEXT:
 120349 		{
 120350 			var zArg uintptr = Xsqlite3_value_text(tls, pValue)
 120351 			Xsqlite3_str_appendf(tls, pStr, ts+16310, libc.VaList(bp+24, zArg))
 120352 			break
 120353 
 120354 		}
 120355 	default:
 120356 		{
 120357 			Xsqlite3_str_append(tls, pStr, ts+1545, 4)
 120358 			break
 120359 
 120360 		}
 120361 	}
 120362 }
 120363 
 120364 func quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 120365 	bp := tls.Alloc(32)
 120366 	defer tls.Free(32)
 120367 
 120368 	var db uintptr = Xsqlite3_context_db_handle(tls, context)
 120369 
 120370 	_ = argc
 120371 	Xsqlite3StrAccumInit(tls, bp, db, uintptr(0), 0, *(*int32)(unsafe.Pointer(db + 136)))
 120372 	Xsqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv)))
 120373 	Xsqlite3_result_text(tls, context, Xsqlite3StrAccumFinish(tls, bp), int32((*Sqlite3_str)(unsafe.Pointer(bp)).FnChar),
 120374 		*(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomClear})))
 120375 	if int32((*Sqlite3_str)(unsafe.Pointer(bp)).FaccError) != SQLITE_OK {
 120376 		Xsqlite3_result_null(tls, context)
 120377 		Xsqlite3_result_error_code(tls, context, int32((*Sqlite3_str)(unsafe.Pointer(bp)).FaccError))
 120378 	}
 120379 }
 120380 
 120381 func unicodeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 120382 	bp := tls.Alloc(8)
 120383 	defer tls.Free(8)
 120384 
 120385 	*(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 120386 	_ = argc
 120387 	if *(*uintptr)(unsafe.Pointer(bp)) != 0 && *(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) != 0 {
 120388 		Xsqlite3_result_int(tls, context, int32(Xsqlite3Utf8Read(tls, bp)))
 120389 	}
 120390 }
 120391 
 120392 func charFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 120393 	var z uintptr
 120394 	var zOut uintptr
 120395 	var i int32
 120396 	zOut = libc.AssignUintptr(&z, Xsqlite3_malloc64(tls, uint64(argc*4+1)))
 120397 	if z == uintptr(0) {
 120398 		Xsqlite3_result_error_nomem(tls, context)
 120399 		return
 120400 	}
 120401 	for i = 0; i < argc; i++ {
 120402 		var x Sqlite3_int64
 120403 		var c uint32
 120404 		x = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
 120405 		if x < int64(0) || x > int64(0x10ffff) {
 120406 			x = int64(0xfffd)
 120407 		}
 120408 		c = uint32(x & int64(0x1fffff))
 120409 		if c < uint32(0x00080) {
 120410 			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = U8(c & uint32(0xFF))
 120411 		} else if c < uint32(0x00800) {
 120412 			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0xC0 + int32(U8(c>>6&uint32(0x1F))))
 120413 			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(c&uint32(0x3F))))
 120414 		} else if c < uint32(0x10000) {
 120415 			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0xE0 + int32(U8(c>>12&uint32(0x0F))))
 120416 			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(c>>6&uint32(0x3F))))
 120417 			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(c&uint32(0x3F))))
 120418 		} else {
 120419 			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0xF0 + int32(U8(c>>18&uint32(0x07))))
 120420 			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(c>>12&uint32(0x3F))))
 120421 			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(c>>6&uint32(0x3F))))
 120422 			*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = uint8(0x80 + int32(U8(c&uint32(0x3F))))
 120423 		}
 120424 	}
 120425 	Xsqlite3_result_text64(tls, context, z, uint64((int64(zOut)-int64(z))/1), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})), uint8(SQLITE_UTF8))
 120426 }
 120427 
 120428 func hexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 120429 	var i int32
 120430 	var n int32
 120431 	var pBlob uintptr
 120432 	var zHex uintptr
 120433 	var z uintptr
 120434 
 120435 	_ = argc
 120436 	pBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv)))
 120437 	n = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))
 120438 
 120439 	z = libc.AssignUintptr(&zHex, contextMalloc(tls, context, I64(n)*int64(2)+int64(1)))
 120440 	if zHex != 0 {
 120441 		i = 0
 120442 	__1:
 120443 		if !(i < n) {
 120444 			goto __3
 120445 		}
 120446 		{
 120447 			var c uint8 = *(*uint8)(unsafe.Pointer(pBlob))
 120448 			*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = hexdigits[int32(c)>>4&0xf]
 120449 			*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = hexdigits[int32(c)&0xf]
 120450 
 120451 		}
 120452 		goto __2
 120453 	__2:
 120454 		i++
 120455 		pBlob++
 120456 		goto __1
 120457 		goto __3
 120458 	__3:
 120459 		;
 120460 		*(*int8)(unsafe.Pointer(z)) = int8(0)
 120461 		Xsqlite3_result_text(tls, context, zHex, n*2, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
 120462 	}
 120463 }
 120464 
 120465 func strContainsChar(tls *libc.TLS, zStr uintptr, nStr int32, ch U32) int32 {
 120466 	bp := tls.Alloc(8)
 120467 	defer tls.Free(8)
 120468 
 120469 	var zEnd uintptr = zStr + uintptr(nStr)
 120470 	*(*uintptr)(unsafe.Pointer(bp)) = zStr
 120471 	for *(*uintptr)(unsafe.Pointer(bp)) < zEnd {
 120472 		var tst U32 = func() uint32 {
 120473 			if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) < 0x80 {
 120474 				return uint32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp)), 1))))
 120475 			}
 120476 			return Xsqlite3Utf8Read(tls, bp)
 120477 		}()
 120478 		if tst == ch {
 120479 			return 1
 120480 		}
 120481 	}
 120482 	return 0
 120483 }
 120484 
 120485 func unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) {
 120486 	bp := tls.Alloc(8)
 120487 	defer tls.Free(8)
 120488 
 120489 	var zPass uintptr
 120490 	var nPass int32
 120491 
 120492 	var nHex int32
 120493 	var pBlob uintptr
 120494 	var p uintptr
 120495 	var ch U32
 120496 	var c U8
 120497 	var d U8
 120498 	zPass = ts + 1544
 120499 	nPass = 0
 120500 	*(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 120501 	nHex = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))
 120502 	pBlob = uintptr(0)
 120503 	p = uintptr(0)
 120504 
 120505 	if !(argc == 2) {
 120506 		goto __1
 120507 	}
 120508 	zPass = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 120509 	nPass = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 120510 __1:
 120511 	;
 120512 	if !(!(*(*uintptr)(unsafe.Pointer(bp)) != 0) || !(zPass != 0)) {
 120513 		goto __2
 120514 	}
 120515 	return
 120516 __2:
 120517 	;
 120518 	p = libc.AssignUintptr(&pBlob, contextMalloc(tls, pCtx, int64(nHex/2+1)))
 120519 	if !(pBlob != 0) {
 120520 		goto __3
 120521 	}
 120522 
 120523 __4:
 120524 	if !(int32(libc.AssignUint8(&c, *(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))) != 0x00) {
 120525 		goto __5
 120526 	}
 120527 __6:
 120528 	if !!(int32(Xsqlite3CtypeMap[c])&0x08 != 0) {
 120529 		goto __7
 120530 	}
 120531 	ch = func() uint32 {
 120532 		if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) < 0x80 {
 120533 			return uint32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp)), 1))))
 120534 		}
 120535 		return Xsqlite3Utf8Read(tls, bp)
 120536 	}()
 120537 
 120538 	if !!(strContainsChar(tls, zPass, nPass, ch) != 0) {
 120539 		goto __8
 120540 	}
 120541 	goto unhex_null
 120542 __8:
 120543 	;
 120544 	c = *(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))
 120545 	if !(int32(c) == 0x00) {
 120546 		goto __9
 120547 	}
 120548 	goto unhex_done
 120549 __9:
 120550 	;
 120551 	goto __6
 120552 __7:
 120553 	;
 120554 	*(*uintptr)(unsafe.Pointer(bp))++
 120555 
 120556 	d = *(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp)), 1)))
 120557 	if !!(int32(Xsqlite3CtypeMap[d])&0x08 != 0) {
 120558 		goto __10
 120559 	}
 120560 	goto unhex_null
 120561 __10:
 120562 	;
 120563 	*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = U8(int32(Xsqlite3HexToInt(tls, int32(c)))<<4 | int32(Xsqlite3HexToInt(tls, int32(d))))
 120564 	goto __4
 120565 __5:
 120566 	;
 120567 __3:
 120568 	;
 120569 unhex_done:
 120570 	Xsqlite3_result_blob(tls, pCtx, pBlob, int32((int64(p)-int64(pBlob))/1), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
 120571 	return
 120572 
 120573 unhex_null:
 120574 	Xsqlite3_free(tls, pBlob)
 120575 	return
 120576 }
 120577 
 120578 func zeroblobFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 120579 	var n I64
 120580 	var rc int32
 120581 
 120582 	_ = argc
 120583 	n = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv)))
 120584 	if n < int64(0) {
 120585 		n = int64(0)
 120586 	}
 120587 	rc = Xsqlite3_result_zeroblob64(tls, context, uint64(n))
 120588 	if rc != 0 {
 120589 		Xsqlite3_result_error_code(tls, context, rc)
 120590 	}
 120591 }
 120592 
 120593 func replaceFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 120594 	var zStr uintptr
 120595 	var zPattern uintptr
 120596 	var zRep uintptr
 120597 	var zOut uintptr
 120598 	var nStr int32
 120599 	var nPattern int32
 120600 	var nRep int32
 120601 	var nOut I64
 120602 	var loopLimit int32
 120603 	var i int32
 120604 	var j int32
 120605 	var cntExpand uint32
 120606 	var db uintptr = Xsqlite3_context_db_handle(tls, context)
 120607 
 120608 	_ = argc
 120609 	zStr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 120610 	if zStr == uintptr(0) {
 120611 		return
 120612 	}
 120613 	nStr = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))
 120614 
 120615 	zPattern = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 120616 	if zPattern == uintptr(0) {
 120617 		return
 120618 	}
 120619 	if int32(*(*uint8)(unsafe.Pointer(zPattern))) == 0 {
 120620 		Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv)))
 120621 		return
 120622 	}
 120623 	nPattern = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 120624 
 120625 	zRep = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))
 120626 	if zRep == uintptr(0) {
 120627 		return
 120628 	}
 120629 	nRep = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))
 120630 
 120631 	nOut = I64(nStr + 1)
 120632 
 120633 	zOut = contextMalloc(tls, context, nOut)
 120634 	if zOut == uintptr(0) {
 120635 		return
 120636 	}
 120637 	loopLimit = nStr - nPattern
 120638 	cntExpand = uint32(0)
 120639 	for i = libc.AssignInt32(&j, 0); i <= loopLimit; i++ {
 120640 		if int32(*(*uint8)(unsafe.Pointer(zStr + uintptr(i)))) != int32(*(*uint8)(unsafe.Pointer(zPattern))) || libc.Xmemcmp(tls, zStr+uintptr(i), zPattern, uint64(nPattern)) != 0 {
 120641 			*(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&j, 1)))) = *(*uint8)(unsafe.Pointer(zStr + uintptr(i)))
 120642 		} else {
 120643 			if nRep > nPattern {
 120644 				nOut = nOut + I64(nRep-nPattern)
 120645 
 120646 				if nOut-int64(1) > I64(*(*int32)(unsafe.Pointer(db + 136))) {
 120647 					Xsqlite3_result_error_toobig(tls, context)
 120648 					Xsqlite3_free(tls, zOut)
 120649 					return
 120650 				}
 120651 				cntExpand++
 120652 				if cntExpand&(cntExpand-uint32(1)) == uint32(0) {
 120653 					var zOld uintptr
 120654 					zOld = zOut
 120655 					zOut = Xsqlite3Realloc(tls, zOut, uint64(I64(int32(nOut))+(nOut-I64(nStr)-int64(1))))
 120656 					if zOut == uintptr(0) {
 120657 						Xsqlite3_result_error_nomem(tls, context)
 120658 						Xsqlite3_free(tls, zOld)
 120659 						return
 120660 					}
 120661 				}
 120662 			}
 120663 			libc.Xmemcpy(tls, zOut+uintptr(j), zRep, uint64(nRep))
 120664 			j = j + nRep
 120665 			i = i + (nPattern - 1)
 120666 		}
 120667 	}
 120668 
 120669 	libc.Xmemcpy(tls, zOut+uintptr(j), zStr+uintptr(i), uint64(nStr-i))
 120670 	j = j + (nStr - i)
 120671 
 120672 	*(*uint8)(unsafe.Pointer(zOut + uintptr(j))) = uint8(0)
 120673 	Xsqlite3_result_text(tls, context, zOut, j, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
 120674 }
 120675 
 120676 func trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 120677 	var zIn uintptr
 120678 	var zCharSet uintptr
 120679 	var nIn uint32
 120680 	var flags int32
 120681 	var i int32
 120682 	var aLen uintptr = uintptr(0)
 120683 	var azChar uintptr = uintptr(0)
 120684 	var nChar int32
 120685 
 120686 	if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) == SQLITE_NULL {
 120687 		return
 120688 	}
 120689 	zIn = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 120690 	if zIn == uintptr(0) {
 120691 		return
 120692 	}
 120693 	nIn = uint32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))))
 120694 
 120695 	if argc == 1 {
 120696 		nChar = 1
 120697 		aLen = uintptr(unsafe.Pointer(&lenOne))
 120698 		azChar = uintptr(unsafe.Pointer(&azOne))
 120699 		zCharSet = uintptr(0)
 120700 	} else if libc.AssignUintptr(&zCharSet, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))) == uintptr(0) {
 120701 		return
 120702 	} else {
 120703 		var z uintptr
 120704 		z = zCharSet
 120705 		nChar = 0
 120706 		for ; *(*uint8)(unsafe.Pointer(z)) != 0; nChar++ {
 120707 			{
 120708 				if int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) >= 0xc0 {
 120709 					for int32(*(*uint8)(unsafe.Pointer(z)))&0xc0 == 0x80 {
 120710 						z++
 120711 					}
 120712 				}
 120713 			}
 120714 
 120715 		}
 120716 		if nChar > 0 {
 120717 			azChar = contextMalloc(tls, context,
 120718 				int64(uint64(I64(nChar))*(uint64(unsafe.Sizeof(uintptr(0)))+uint64(unsafe.Sizeof(uint32(0))))))
 120719 			if azChar == uintptr(0) {
 120720 				return
 120721 			}
 120722 			aLen = azChar + uintptr(nChar)*8
 120723 			z = zCharSet
 120724 			nChar = 0
 120725 			for ; *(*uint8)(unsafe.Pointer(z)) != 0; nChar++ {
 120726 				*(*uintptr)(unsafe.Pointer(azChar + uintptr(nChar)*8)) = z
 120727 				{
 120728 					if int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) >= 0xc0 {
 120729 						for int32(*(*uint8)(unsafe.Pointer(z)))&0xc0 == 0x80 {
 120730 							z++
 120731 						}
 120732 					}
 120733 				}
 120734 
 120735 				*(*uint32)(unsafe.Pointer(aLen + uintptr(nChar)*4)) = uint32((int64(z) - int64(*(*uintptr)(unsafe.Pointer(azChar + uintptr(nChar)*8)))) / 1)
 120736 			}
 120737 		}
 120738 	}
 120739 	if nChar > 0 {
 120740 		flags = int32(Xsqlite3_user_data(tls, context))
 120741 		if flags&1 != 0 {
 120742 			for nIn > uint32(0) {
 120743 				var len uint32 = uint32(0)
 120744 				for i = 0; i < nChar; i++ {
 120745 					len = *(*uint32)(unsafe.Pointer(aLen + uintptr(i)*4))
 120746 					if len <= nIn && libc.Xmemcmp(tls, zIn, *(*uintptr)(unsafe.Pointer(azChar + uintptr(i)*8)), uint64(len)) == 0 {
 120747 						break
 120748 					}
 120749 				}
 120750 				if i >= nChar {
 120751 					break
 120752 				}
 120753 				zIn += uintptr(len)
 120754 				nIn = nIn - len
 120755 			}
 120756 		}
 120757 		if flags&2 != 0 {
 120758 			for nIn > uint32(0) {
 120759 				var len uint32 = uint32(0)
 120760 				for i = 0; i < nChar; i++ {
 120761 					len = *(*uint32)(unsafe.Pointer(aLen + uintptr(i)*4))
 120762 					if len <= nIn && libc.Xmemcmp(tls, zIn+uintptr(nIn-len), *(*uintptr)(unsafe.Pointer(azChar + uintptr(i)*8)), uint64(len)) == 0 {
 120763 						break
 120764 					}
 120765 				}
 120766 				if i >= nChar {
 120767 					break
 120768 				}
 120769 				nIn = nIn - len
 120770 			}
 120771 		}
 120772 		if zCharSet != 0 {
 120773 			Xsqlite3_free(tls, azChar)
 120774 		}
 120775 	}
 120776 	Xsqlite3_result_text(tls, context, zIn, int32(nIn), libc.UintptrFromInt32(-1))
 120777 }
 120778 
 120779 var lenOne = [1]uint32{uint32(1)}
 120780 var azOne = [1]uintptr{ts + 12272}
 120781 
 120782 func soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 120783 	bp := tls.Alloc(8)
 120784 	defer tls.Free(8)
 120785 
 120786 	var zIn uintptr
 120787 	var i int32
 120788 	var j int32
 120789 
 120790 	zIn = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 120791 	if zIn == uintptr(0) {
 120792 		zIn = ts + 1544
 120793 	}
 120794 	for i = 0; *(*U8)(unsafe.Pointer(zIn + uintptr(i))) != 0 && !(int32(Xsqlite3CtypeMap[*(*U8)(unsafe.Pointer(zIn + uintptr(i)))])&0x02 != 0); i++ {
 120795 	}
 120796 	if *(*U8)(unsafe.Pointer(zIn + uintptr(i))) != 0 {
 120797 		var prevcode U8 = iCode[int32(*(*U8)(unsafe.Pointer(zIn + uintptr(i))))&0x7f]
 120798 		*(*int8)(unsafe.Pointer(bp)) = int8(int32(*(*U8)(unsafe.Pointer(zIn + uintptr(i)))) & ^(int32(Xsqlite3CtypeMap[*(*U8)(unsafe.Pointer(zIn + uintptr(i)))]) & 0x20))
 120799 		for j = 1; j < 4 && *(*U8)(unsafe.Pointer(zIn + uintptr(i))) != 0; i++ {
 120800 			var code int32 = int32(iCode[int32(*(*U8)(unsafe.Pointer(zIn + uintptr(i))))&0x7f])
 120801 			if code > 0 {
 120802 				if code != int32(prevcode) {
 120803 					prevcode = U8(code)
 120804 					*(*int8)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&j, 1)))) = int8(code + '0')
 120805 				}
 120806 			} else {
 120807 				prevcode = U8(0)
 120808 			}
 120809 		}
 120810 		for j < 4 {
 120811 			*(*int8)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&j, 1)))) = int8('0')
 120812 		}
 120813 		*(*int8)(unsafe.Pointer(bp + uintptr(j))) = int8(0)
 120814 		Xsqlite3_result_text(tls, context, bp, 4, libc.UintptrFromInt32(-1))
 120815 	} else {
 120816 		Xsqlite3_result_text(tls, context, ts+16313, 4, uintptr(0))
 120817 	}
 120818 }
 120819 
 120820 var iCode = [128]uint8{
 120821 	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
 120822 	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
 120823 	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
 120824 	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
 120825 	uint8(0), uint8(0), uint8(1), uint8(2), uint8(3), uint8(0), uint8(1), uint8(2), uint8(0), uint8(0), uint8(2), uint8(2), uint8(4), uint8(5), uint8(5), uint8(0),
 120826 	uint8(1), uint8(2), uint8(6), uint8(2), uint8(3), uint8(0), uint8(1), uint8(0), uint8(2), uint8(0), uint8(2), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
 120827 	uint8(0), uint8(0), uint8(1), uint8(2), uint8(3), uint8(0), uint8(1), uint8(2), uint8(0), uint8(0), uint8(2), uint8(2), uint8(4), uint8(5), uint8(5), uint8(0),
 120828 	uint8(1), uint8(2), uint8(6), uint8(2), uint8(3), uint8(0), uint8(1), uint8(0), uint8(2), uint8(0), uint8(2), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
 120829 }
 120830 
 120831 func loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 120832 	bp := tls.Alloc(8)
 120833 	defer tls.Free(8)
 120834 
 120835 	var zFile uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 120836 	var zProc uintptr
 120837 	var db uintptr = Xsqlite3_context_db_handle(tls, context)
 120838 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 120839 
 120840 	if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_LoadExtFunc) == uint64(0) {
 120841 		Xsqlite3_result_error(tls, context, ts+13452, -1)
 120842 		return
 120843 	}
 120844 
 120845 	if argc == 2 {
 120846 		zProc = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 120847 	} else {
 120848 		zProc = uintptr(0)
 120849 	}
 120850 	if zFile != 0 && Xsqlite3_load_extension(tls, db, zFile, zProc, bp) != 0 {
 120851 		Xsqlite3_result_error(tls, context, *(*uintptr)(unsafe.Pointer(bp)), -1)
 120852 		Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp)))
 120853 	}
 120854 }
 120855 
 120856 // An instance of the following structure holds the context of a
 120857 // sum() or avg() aggregate computation.
 120858 type SumCtx1 = struct {
 120859 	FrSum        float64
 120860 	FiSum        I64
 120861 	Fcnt         I64
 120862 	Foverflow    U8
 120863 	Fapprox      U8
 120864 	F__ccgo_pad1 [6]byte
 120865 }
 120866 
 120867 // An instance of the following structure holds the context of a
 120868 // sum() or avg() aggregate computation.
 120869 type SumCtx = SumCtx1
 120870 
 120871 func sumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 120872 	var p uintptr
 120873 	var type1 int32
 120874 
 120875 	_ = argc
 120876 	p = Xsqlite3_aggregate_context(tls, context, int32(unsafe.Sizeof(SumCtx{})))
 120877 	type1 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv)))
 120878 	if p != 0 && type1 != SQLITE_NULL {
 120879 		(*SumCtx)(unsafe.Pointer(p)).Fcnt++
 120880 		if type1 == SQLITE_INTEGER {
 120881 			var v I64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv)))
 120882 			*(*float64)(unsafe.Pointer(p)) += float64(v)
 120883 			if int32((*SumCtx)(unsafe.Pointer(p)).Fapprox)|int32((*SumCtx)(unsafe.Pointer(p)).Foverflow) == 0 && Xsqlite3AddInt64(tls, p+8, v) != 0 {
 120884 				(*SumCtx)(unsafe.Pointer(p)).Fapprox = libc.AssignPtrUint8(p+24, U8(1))
 120885 			}
 120886 		} else {
 120887 			*(*float64)(unsafe.Pointer(p)) += Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv)))
 120888 			(*SumCtx)(unsafe.Pointer(p)).Fapprox = U8(1)
 120889 		}
 120890 	}
 120891 }
 120892 
 120893 func sumInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 120894 	var p uintptr
 120895 	var type1 int32
 120896 
 120897 	_ = argc
 120898 	p = Xsqlite3_aggregate_context(tls, context, int32(unsafe.Sizeof(SumCtx{})))
 120899 	type1 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv)))
 120900 
 120901 	if p != 0 && type1 != SQLITE_NULL {
 120902 		(*SumCtx)(unsafe.Pointer(p)).Fcnt--
 120903 
 120904 		if type1 == SQLITE_INTEGER && int32((*SumCtx)(unsafe.Pointer(p)).Fapprox) == 0 {
 120905 			var v I64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv)))
 120906 			*(*float64)(unsafe.Pointer(p)) -= float64(v)
 120907 			*(*I64)(unsafe.Pointer(p + 8)) -= v
 120908 		} else {
 120909 			*(*float64)(unsafe.Pointer(p)) -= Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv)))
 120910 		}
 120911 	}
 120912 }
 120913 
 120914 func sumFinalize(tls *libc.TLS, context uintptr) {
 120915 	var p uintptr
 120916 	p = Xsqlite3_aggregate_context(tls, context, 0)
 120917 	if p != 0 && (*SumCtx)(unsafe.Pointer(p)).Fcnt > int64(0) {
 120918 		if (*SumCtx)(unsafe.Pointer(p)).Foverflow != 0 {
 120919 			Xsqlite3_result_error(tls, context, ts+16203, -1)
 120920 		} else if (*SumCtx)(unsafe.Pointer(p)).Fapprox != 0 {
 120921 			Xsqlite3_result_double(tls, context, (*SumCtx)(unsafe.Pointer(p)).FrSum)
 120922 		} else {
 120923 			Xsqlite3_result_int64(tls, context, (*SumCtx)(unsafe.Pointer(p)).FiSum)
 120924 		}
 120925 	}
 120926 }
 120927 
 120928 func avgFinalize(tls *libc.TLS, context uintptr) {
 120929 	var p uintptr
 120930 	p = Xsqlite3_aggregate_context(tls, context, 0)
 120931 	if p != 0 && (*SumCtx)(unsafe.Pointer(p)).Fcnt > int64(0) {
 120932 		Xsqlite3_result_double(tls, context, (*SumCtx)(unsafe.Pointer(p)).FrSum/float64((*SumCtx)(unsafe.Pointer(p)).Fcnt))
 120933 	}
 120934 }
 120935 
 120936 func totalFinalize(tls *libc.TLS, context uintptr) {
 120937 	var p uintptr
 120938 	p = Xsqlite3_aggregate_context(tls, context, 0)
 120939 
 120940 	Xsqlite3_result_double(tls, context, func() float64 {
 120941 		if p != 0 {
 120942 			return (*SumCtx)(unsafe.Pointer(p)).FrSum
 120943 		}
 120944 		return float64(0)
 120945 	}())
 120946 }
 120947 
 120948 // The following structure keeps track of state information for the
 120949 // count() aggregate function.
 120950 type CountCtx1 = struct{ Fn I64 }
 120951 
 120952 // The following structure keeps track of state information for the
 120953 // count() aggregate function.
 120954 type CountCtx = CountCtx1
 120955 
 120956 func countStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 120957 	var p uintptr
 120958 	p = Xsqlite3_aggregate_context(tls, context, int32(unsafe.Sizeof(CountCtx{})))
 120959 	if (argc == 0 || SQLITE_NULL != Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv)))) && p != 0 {
 120960 		(*CountCtx)(unsafe.Pointer(p)).Fn++
 120961 	}
 120962 
 120963 }
 120964 
 120965 func countFinalize(tls *libc.TLS, context uintptr) {
 120966 	var p uintptr
 120967 	p = Xsqlite3_aggregate_context(tls, context, 0)
 120968 	Xsqlite3_result_int64(tls, context, func() int64 {
 120969 		if p != 0 {
 120970 			return (*CountCtx)(unsafe.Pointer(p)).Fn
 120971 		}
 120972 		return int64(0)
 120973 	}())
 120974 }
 120975 
 120976 func countInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) {
 120977 	var p uintptr
 120978 	p = Xsqlite3_aggregate_context(tls, ctx, int32(unsafe.Sizeof(CountCtx{})))
 120979 
 120980 	if (argc == 0 || SQLITE_NULL != Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv)))) && p != 0 {
 120981 		(*CountCtx)(unsafe.Pointer(p)).Fn--
 120982 	}
 120983 }
 120984 
 120985 func minmaxStep(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) {
 120986 	var pArg uintptr = *(*uintptr)(unsafe.Pointer(argv))
 120987 	var pBest uintptr
 120988 	_ = NotUsed
 120989 
 120990 	pBest = Xsqlite3_aggregate_context(tls, context, int32(unsafe.Sizeof(Mem{})))
 120991 	if !(pBest != 0) {
 120992 		return
 120993 	}
 120994 
 120995 	if Xsqlite3_value_type(tls, pArg) == SQLITE_NULL {
 120996 		if (*Mem)(unsafe.Pointer(pBest)).Fflags != 0 {
 120997 			sqlite3SkipAccumulatorLoad(tls, context)
 120998 		}
 120999 	} else if (*Mem)(unsafe.Pointer(pBest)).Fflags != 0 {
 121000 		var max int32
 121001 		var cmp int32
 121002 		var pColl uintptr = sqlite3GetFuncCollSeq(tls, context)
 121003 
 121004 		max = libc.Bool32(Xsqlite3_user_data(tls, context) != uintptr(0))
 121005 		cmp = Xsqlite3MemCompare(tls, pBest, pArg, pColl)
 121006 		if max != 0 && cmp < 0 || !(max != 0) && cmp > 0 {
 121007 			Xsqlite3VdbeMemCopy(tls, pBest, pArg)
 121008 		} else {
 121009 			sqlite3SkipAccumulatorLoad(tls, context)
 121010 		}
 121011 	} else {
 121012 		(*Mem)(unsafe.Pointer(pBest)).Fdb = Xsqlite3_context_db_handle(tls, context)
 121013 		Xsqlite3VdbeMemCopy(tls, pBest, pArg)
 121014 	}
 121015 }
 121016 
 121017 func minMaxValueFinalize(tls *libc.TLS, context uintptr, bValue int32) {
 121018 	var pRes uintptr
 121019 	pRes = Xsqlite3_aggregate_context(tls, context, 0)
 121020 	if pRes != 0 {
 121021 		if (*Sqlite3_value)(unsafe.Pointer(pRes)).Fflags != 0 {
 121022 			Xsqlite3_result_value(tls, context, pRes)
 121023 		}
 121024 		if bValue == 0 {
 121025 			Xsqlite3VdbeMemRelease(tls, pRes)
 121026 		}
 121027 	}
 121028 }
 121029 
 121030 func minMaxValue(tls *libc.TLS, context uintptr) {
 121031 	minMaxValueFinalize(tls, context, 1)
 121032 }
 121033 
 121034 func minMaxFinalize(tls *libc.TLS, context uintptr) {
 121035 	minMaxValueFinalize(tls, context, 0)
 121036 }
 121037 
 121038 // group_concat(EXPR, ?SEPARATOR?)
 121039 //
 121040 // The SEPARATOR goes before the EXPR string.  This is tragic.  The
 121041 // groupConcatInverse() implementation would have been easier if the
 121042 // SEPARATOR were appended after EXPR.  And the order is undocumented,
 121043 // so we could change it, in theory.  But the old behavior has been
 121044 // around for so long that we dare not, for fear of breaking something.
 121045 type GroupConcatCtx = struct {
 121046 	Fstr             StrAccum
 121047 	FnAccum          int32
 121048 	FnFirstSepLength int32
 121049 	FpnSepLengths    uintptr
 121050 }
 121051 
 121052 func groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 121053 	var zVal uintptr
 121054 	var pGCC uintptr
 121055 	var zSep uintptr
 121056 	var nVal int32
 121057 	var nSep int32
 121058 
 121059 	if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) == SQLITE_NULL {
 121060 		return
 121061 	}
 121062 	pGCC = Xsqlite3_aggregate_context(tls, context, int32(unsafe.Sizeof(GroupConcatCtx{})))
 121063 	if pGCC != 0 {
 121064 		var db uintptr = Xsqlite3_context_db_handle(tls, context)
 121065 		var firstTerm int32 = libc.Bool32((*GroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FmxAlloc == U32(0))
 121066 		(*GroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FmxAlloc = U32(*(*int32)(unsafe.Pointer(db + 136)))
 121067 		if argc == 1 {
 121068 			if !(firstTerm != 0) {
 121069 				Xsqlite3_str_appendchar(tls, pGCC, 1, int8(','))
 121070 			} else {
 121071 				(*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnFirstSepLength = 1
 121072 			}
 121073 		} else if !(firstTerm != 0) {
 121074 			zSep = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 121075 			nSep = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 121076 			if zSep != 0 {
 121077 				Xsqlite3_str_append(tls, pGCC, zSep, nSep)
 121078 			} else {
 121079 				nSep = 0
 121080 			}
 121081 			if nSep != (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnFirstSepLength || (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths != uintptr(0) {
 121082 				var pnsl uintptr = (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths
 121083 				if pnsl == uintptr(0) {
 121084 					pnsl = Xsqlite3_malloc64(tls, uint64((*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+1)*uint64(unsafe.Sizeof(int32(0))))
 121085 					if pnsl != uintptr(0) {
 121086 						var i int32 = 0
 121087 						var nA int32 = (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum - 1
 121088 						for i < nA {
 121089 							*(*int32)(unsafe.Pointer(pnsl + uintptr(libc.PostIncInt32(&i, 1))*4)) = (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnFirstSepLength
 121090 						}
 121091 					}
 121092 				} else {
 121093 					pnsl = Xsqlite3_realloc64(tls, pnsl, uint64((*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint64(unsafe.Sizeof(int32(0))))
 121094 				}
 121095 				if pnsl != uintptr(0) {
 121096 					if (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 {
 121097 						*(*int32)(unsafe.Pointer(pnsl + uintptr((*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum-1)*4)) = nSep
 121098 					}
 121099 					(*GroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths = pnsl
 121100 				} else {
 121101 					Xsqlite3StrAccumSetError(tls, pGCC, uint8(SQLITE_NOMEM))
 121102 				}
 121103 			}
 121104 		} else {
 121105 			(*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnFirstSepLength = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 121106 		}
 121107 		*(*int32)(unsafe.Pointer(pGCC + 32)) += 1
 121108 		zVal = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 121109 		nVal = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))
 121110 		if zVal != 0 {
 121111 			Xsqlite3_str_append(tls, pGCC, zVal, nVal)
 121112 		}
 121113 	}
 121114 }
 121115 
 121116 func groupConcatInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 121117 	var pGCC uintptr
 121118 
 121119 	_ = argc
 121120 	if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) == SQLITE_NULL {
 121121 		return
 121122 	}
 121123 	pGCC = Xsqlite3_aggregate_context(tls, context, int32(unsafe.Sizeof(GroupConcatCtx{})))
 121124 
 121125 	if pGCC != 0 {
 121126 		var nVS int32
 121127 
 121128 		Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 121129 		nVS = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))
 121130 		*(*int32)(unsafe.Pointer(pGCC + 32)) -= 1
 121131 		if (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths != uintptr(0) {
 121132 			if (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 {
 121133 				nVS = nVS + *(*int32)(unsafe.Pointer((*GroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths))
 121134 				libc.Xmemmove(tls, (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths, (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths+uintptr(1)*4,
 121135 					uint64((*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum-1)*uint64(unsafe.Sizeof(int32(0))))
 121136 			}
 121137 		} else {
 121138 			nVS = nVS + (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FnFirstSepLength
 121139 		}
 121140 		if nVS >= int32((*GroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FnChar) {
 121141 			(*GroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FnChar = U32(0)
 121142 		} else {
 121143 			*(*U32)(unsafe.Pointer(pGCC + 24)) -= U32(nVS)
 121144 			libc.Xmemmove(tls, (*GroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FzText, (*GroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FzText+uintptr(nVS), uint64((*GroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FnChar))
 121145 		}
 121146 		if (*GroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FnChar == U32(0) {
 121147 			(*GroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FmxAlloc = U32(0)
 121148 			Xsqlite3_free(tls, (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths)
 121149 			(*GroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths = uintptr(0)
 121150 		}
 121151 	}
 121152 }
 121153 
 121154 func groupConcatFinalize(tls *libc.TLS, context uintptr) {
 121155 	var pGCC uintptr = Xsqlite3_aggregate_context(tls, context, 0)
 121156 	if pGCC != 0 {
 121157 		Xsqlite3ResultStrAccum(tls, context, pGCC)
 121158 		Xsqlite3_free(tls, (*GroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths)
 121159 	}
 121160 }
 121161 
 121162 func groupConcatValue(tls *libc.TLS, context uintptr) {
 121163 	var pGCC uintptr = Xsqlite3_aggregate_context(tls, context, 0)
 121164 	if pGCC != 0 {
 121165 		var pAccum uintptr = pGCC
 121166 		if int32((*StrAccum)(unsafe.Pointer(pAccum)).FaccError) == SQLITE_TOOBIG {
 121167 			Xsqlite3_result_error_toobig(tls, context)
 121168 		} else if int32((*StrAccum)(unsafe.Pointer(pAccum)).FaccError) == SQLITE_NOMEM {
 121169 			Xsqlite3_result_error_nomem(tls, context)
 121170 		} else {
 121171 			var zText uintptr = Xsqlite3_str_value(tls, pAccum)
 121172 			Xsqlite3_result_text(tls, context, zText, int32((*StrAccum)(unsafe.Pointer(pAccum)).FnChar), libc.UintptrFromInt32(-1))
 121173 		}
 121174 	}
 121175 }
 121176 
 121177 // This routine does per-connection function registration.  Most
 121178 // of the built-in functions above are part of the global function set.
 121179 // This routine only deals with those that are not global.
 121180 func Xsqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) {
 121181 	var rc int32 = Xsqlite3_overload_function(tls, db, ts+16318, 2)
 121182 
 121183 	if rc == SQLITE_NOMEM {
 121184 		Xsqlite3OomFault(tls, db)
 121185 	}
 121186 }
 121187 
 121188 // Re-register the built-in LIKE functions.  The caseSensitive
 121189 // parameter determines whether or not the LIKE operator is case
 121190 // sensitive.
 121191 func Xsqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int32) {
 121192 	var pInfo uintptr
 121193 	var flags int32
 121194 	if caseSensitive != 0 {
 121195 		pInfo = uintptr(unsafe.Pointer(&likeInfoAlt))
 121196 		flags = SQLITE_FUNC_LIKE | SQLITE_FUNC_CASE
 121197 	} else {
 121198 		pInfo = uintptr(unsafe.Pointer(&likeInfoNorm))
 121199 		flags = SQLITE_FUNC_LIKE
 121200 	}
 121201 	Xsqlite3CreateFunc(tls, db, ts+16324, 2, SQLITE_UTF8, pInfo, *(*uintptr)(unsafe.Pointer(&struct {
 121202 		f func(*libc.TLS, uintptr, int32, uintptr)
 121203 	}{likeFunc})), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0))
 121204 	Xsqlite3CreateFunc(tls, db, ts+16324, 3, SQLITE_UTF8, pInfo, *(*uintptr)(unsafe.Pointer(&struct {
 121205 		f func(*libc.TLS, uintptr, int32, uintptr)
 121206 	}{likeFunc})), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0))
 121207 	*(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+16324, 2, uint8(SQLITE_UTF8), uint8(0)) + 4)) |= U32(flags)
 121208 	*(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+16324, 3, uint8(SQLITE_UTF8), uint8(0)) + 4)) |= U32(flags)
 121209 }
 121210 
 121211 // pExpr points to an expression which implements a function.  If
 121212 // it is appropriate to apply the LIKE optimization to that function
 121213 // then set aWc[0] through aWc[2] to the wildcard characters and the
 121214 // escape character and then return TRUE.  If the function is not a
 121215 // LIKE-style function then return FALSE.
 121216 //
 121217 // The expression "a LIKE b ESCAPE c" is only considered a valid LIKE
 121218 // operator if c is a string literal that is exactly one byte in length.
 121219 // That one byte is stored in aWc[3].  aWc[3] is set to zero if there is
 121220 // no ESCAPE clause.
 121221 //
 121222 // *pIsNocase is set to true if uppercase and lowercase are equivalent for
 121223 // the function (default for LIKE).  If the function makes the distinction
 121224 // between uppercase and lowercase (as does GLOB) then *pIsNocase is set to
 121225 // false.
 121226 func Xsqlite3IsLikeFunction(tls *libc.TLS, db uintptr, pExpr uintptr, pIsNocase uintptr, aWc uintptr) int32 {
 121227 	var pDef uintptr
 121228 	var nExpr int32
 121229 
 121230 	if !(int32(*(*uintptr)(unsafe.Pointer(pExpr + 32))) != 0) {
 121231 		return 0
 121232 	}
 121233 	nExpr = (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr
 121234 
 121235 	pDef = Xsqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nExpr, uint8(SQLITE_UTF8), uint8(0))
 121236 	if pDef == uintptr(0) || (*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_LIKE) == U32(0) {
 121237 		return 0
 121238 	}
 121239 
 121240 	libc.Xmemcpy(tls, aWc, (*FuncDef)(unsafe.Pointer(pDef)).FpUserData, uint64(3))
 121241 
 121242 	if nExpr < 3 {
 121243 		*(*int8)(unsafe.Pointer(aWc + 3)) = int8(0)
 121244 	} else {
 121245 		var pEscape uintptr = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8 + 2*32)).FpExpr
 121246 		var zEscape uintptr
 121247 		if int32((*Expr)(unsafe.Pointer(pEscape)).Fop) != TK_STRING {
 121248 			return 0
 121249 		}
 121250 
 121251 		zEscape = *(*uintptr)(unsafe.Pointer(pEscape + 8))
 121252 		if int32(*(*int8)(unsafe.Pointer(zEscape))) == 0 || int32(*(*int8)(unsafe.Pointer(zEscape + 1))) != 0 {
 121253 			return 0
 121254 		}
 121255 		if int32(*(*int8)(unsafe.Pointer(zEscape))) == int32(*(*int8)(unsafe.Pointer(aWc))) {
 121256 			return 0
 121257 		}
 121258 		if int32(*(*int8)(unsafe.Pointer(zEscape))) == int32(*(*int8)(unsafe.Pointer(aWc + 1))) {
 121259 			return 0
 121260 		}
 121261 		*(*int8)(unsafe.Pointer(aWc + 3)) = *(*int8)(unsafe.Pointer(zEscape))
 121262 	}
 121263 
 121264 	*(*int32)(unsafe.Pointer(pIsNocase)) = libc.Bool32((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags&U32(SQLITE_FUNC_CASE) == U32(0))
 121265 	return 1
 121266 }
 121267 
 121268 func ceilingFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 121269 	switch Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv))) {
 121270 	case SQLITE_INTEGER:
 121271 		{
 121272 			Xsqlite3_result_int64(tls, context, Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv))))
 121273 			break
 121274 
 121275 		}
 121276 	case SQLITE_FLOAT:
 121277 		{
 121278 			var x uintptr = Xsqlite3_user_data(tls, context)
 121279 			Xsqlite3_result_double(tls, context, (*struct {
 121280 				f func(*libc.TLS, float64) float64
 121281 			})(unsafe.Pointer(&struct{ uintptr }{x})).f(tls, Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv)))))
 121282 			break
 121283 
 121284 		}
 121285 	default:
 121286 		{
 121287 			break
 121288 
 121289 		}
 121290 	}
 121291 }
 121292 
 121293 func xCeil(tls *libc.TLS, x float64) float64 {
 121294 	return libc.Xceil(tls, x)
 121295 }
 121296 
 121297 func xFloor(tls *libc.TLS, x float64) float64 {
 121298 	return libc.Xfloor(tls, x)
 121299 }
 121300 
 121301 func logFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 121302 	var x float64
 121303 	var b float64
 121304 	var ans float64
 121305 
 121306 	switch Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv))) {
 121307 	case SQLITE_INTEGER:
 121308 		fallthrough
 121309 	case SQLITE_FLOAT:
 121310 		x = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv)))
 121311 		if x <= 0.0 {
 121312 			return
 121313 		}
 121314 		break
 121315 	default:
 121316 		return
 121317 	}
 121318 	if argc == 2 {
 121319 		switch Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv))) {
 121320 		case SQLITE_INTEGER:
 121321 			fallthrough
 121322 		case SQLITE_FLOAT:
 121323 			b = libc.Xlog(tls, x)
 121324 			if b <= 0.0 {
 121325 				return
 121326 			}
 121327 			x = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 121328 			if x <= 0.0 {
 121329 				return
 121330 			}
 121331 			break
 121332 			fallthrough
 121333 		default:
 121334 			return
 121335 		}
 121336 		ans = libc.Xlog(tls, x) / b
 121337 	} else {
 121338 		switch int32(Xsqlite3_user_data(tls, context)) {
 121339 		case 1:
 121340 			ans = libc.Xlog10(tls, x)
 121341 			break
 121342 			fallthrough
 121343 		case 2:
 121344 			ans = libc.Xlog2(tls, x)
 121345 			break
 121346 			fallthrough
 121347 		default:
 121348 			ans = libc.Xlog(tls, x)
 121349 			break
 121350 		}
 121351 	}
 121352 	Xsqlite3_result_double(tls, context, ans)
 121353 }
 121354 
 121355 func degToRad(tls *libc.TLS, x float64) float64 {
 121356 	return x * (float64(3.14159265358979323846) / 180.0)
 121357 }
 121358 
 121359 func radToDeg(tls *libc.TLS, x float64) float64 {
 121360 	return x * (float64(180.0) / 3.14159265358979323846)
 121361 }
 121362 
 121363 func math1Func(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 121364 	var type0 int32
 121365 	var v0 float64
 121366 	var ans float64
 121367 	var x uintptr
 121368 
 121369 	type0 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv)))
 121370 	if type0 != SQLITE_INTEGER && type0 != SQLITE_FLOAT {
 121371 		return
 121372 	}
 121373 	v0 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv)))
 121374 	x = Xsqlite3_user_data(tls, context)
 121375 	ans = (*struct {
 121376 		f func(*libc.TLS, float64) float64
 121377 	})(unsafe.Pointer(&struct{ uintptr }{x})).f(tls, v0)
 121378 	Xsqlite3_result_double(tls, context, ans)
 121379 }
 121380 
 121381 func math2Func(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 121382 	var type0 int32
 121383 	var type1 int32
 121384 	var v0 float64
 121385 	var v1 float64
 121386 	var ans float64
 121387 	var x uintptr
 121388 
 121389 	type0 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv)))
 121390 	if type0 != SQLITE_INTEGER && type0 != SQLITE_FLOAT {
 121391 		return
 121392 	}
 121393 	type1 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 121394 	if type1 != SQLITE_INTEGER && type1 != SQLITE_FLOAT {
 121395 		return
 121396 	}
 121397 	v0 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv)))
 121398 	v1 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 121399 	x = Xsqlite3_user_data(tls, context)
 121400 	ans = (*struct {
 121401 		f func(*libc.TLS, float64, float64) float64
 121402 	})(unsafe.Pointer(&struct{ uintptr }{x})).f(tls, v0, v1)
 121403 	Xsqlite3_result_double(tls, context, ans)
 121404 }
 121405 
 121406 func piFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 121407 	_ = argv
 121408 	Xsqlite3_result_double(tls, context, 3.14159265358979323846)
 121409 }
 121410 
 121411 func signFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 121412 	var type0 int32
 121413 	var x float64
 121414 	_ = argc
 121415 
 121416 	type0 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv)))
 121417 	if type0 != SQLITE_INTEGER && type0 != SQLITE_FLOAT {
 121418 		return
 121419 	}
 121420 	x = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv)))
 121421 	Xsqlite3_result_int(tls, context, func() int32 {
 121422 		if x < 0.0 {
 121423 			return -1
 121424 		}
 121425 		return func() int32 {
 121426 			if x > 0.0 {
 121427 				return +1
 121428 			}
 121429 			return 0
 121430 		}()
 121431 	}())
 121432 }
 121433 
 121434 // All of the FuncDef structures in the aBuiltinFunc[] array above
 121435 // to the global function hash table.  This occurs at start-time (as
 121436 // a consequence of calling sqlite3_initialize()).
 121437 //
 121438 // After this routine runs
 121439 func Xsqlite3RegisterBuiltinFunctions(tls *libc.TLS) {
 121440 	Xsqlite3AlterFunctions(tls)
 121441 	Xsqlite3WindowFunctions(tls)
 121442 	Xsqlite3RegisterDateTimeFunctions(tls)
 121443 	Xsqlite3RegisterJsonFunctions(tls)
 121444 	Xsqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&aBuiltinFunc)), int32(uint64(unsafe.Sizeof(aBuiltinFunc))/uint64(unsafe.Sizeof(FuncDef{}))))
 121445 
 121446 }
 121447 
 121448 var aBuiltinFunc = [103]FuncDef{
 121449 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_INTERNAL | SQLITE_FUNC_TEST | SQLITE_FUNC_INLINE | SQLITE_FUNC_CONSTANT | 0), FpUserData: uintptr(int64(INLINEFUNC_implies_nonnull_row)), FxSFunc: 0, FzName: ts + 16329},
 121450 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_INTERNAL | SQLITE_FUNC_TEST | SQLITE_FUNC_INLINE | SQLITE_FUNC_CONSTANT | 0), FpUserData: uintptr(int64(INLINEFUNC_expr_compare)), FxSFunc: 0, FzName: ts + 16349},
 121451 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_INTERNAL | SQLITE_FUNC_TEST | SQLITE_FUNC_INLINE | SQLITE_FUNC_CONSTANT | 0), FpUserData: uintptr(int64(INLINEFUNC_expr_implies_expr)), FxSFunc: 0, FzName: ts + 16362},
 121452 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_INTERNAL | SQLITE_FUNC_TEST | SQLITE_FUNC_INLINE | SQLITE_FUNC_CONSTANT | 0), FpUserData: uintptr(int64(INLINEFUNC_affinity)), FxSFunc: 0, FzName: ts + 16380},
 121453 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16389},
 121454 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_DIRECTONLY | SQLITE_FUNC_UNSAFE), FxSFunc: 0, FzName: ts + 16397},
 121455 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_DIRECTONLY | SQLITE_FUNC_UNSAFE), FxSFunc: 0, FzName: ts + 16397},
 121456 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 16412},
 121457 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 16438},
 121458 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_INLINE | SQLITE_FUNC_CONSTANT | SQLITE_FUNC_UNLIKELY), FpUserData: uintptr(int64(INLINEFUNC_unlikely)), FxSFunc: 0, FzName: ts + 16463},
 121459 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_INLINE | SQLITE_FUNC_CONSTANT | SQLITE_FUNC_UNLIKELY), FpUserData: uintptr(int64(INLINEFUNC_unlikely)), FxSFunc: 0, FzName: ts + 16472},
 121460 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_INLINE | SQLITE_FUNC_CONSTANT | SQLITE_FUNC_UNLIKELY), FpUserData: uintptr(int64(INLINEFUNC_unlikely)), FxSFunc: 0, FzName: ts + 16483},
 121461 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_INLINE | SQLITE_FUNC_CONSTANT | 0), FpUserData: uintptr(int64(INLINEFUNC_sqlite_offset)), FxSFunc: 0, FzName: ts + 16490},
 121462 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FpUserData: uintptr(int64(1)), FxSFunc: 0, FzName: ts + 16504},
 121463 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FpUserData: uintptr(int64(1)), FxSFunc: 0, FzName: ts + 16504},
 121464 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FpUserData: uintptr(int64(2)), FxSFunc: 0, FzName: ts + 16510},
 121465 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FpUserData: uintptr(int64(2)), FxSFunc: 0, FzName: ts + 16510},
 121466 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FpUserData: uintptr(int64(3)), FxSFunc: 0, FzName: ts + 16516},
 121467 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FpUserData: uintptr(int64(3)), FxSFunc: 0, FzName: ts + 16516},
 121468 	{FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 1*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16521},
 121469 	{FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 1*SQLITE_FUNC_NEEDCOLL), FzName: ts + 16521},
 121470 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 1*SQLITE_FUNC_NEEDCOLL | SQLITE_FUNC_MINMAX | SQLITE_FUNC_ANYORDER), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FzName: ts + 16521},
 121471 	{FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 1*SQLITE_FUNC_NEEDCOLL), FpUserData: uintptr(int64(1)), FxSFunc: 0, FzName: ts + 16525},
 121472 	{FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 1*SQLITE_FUNC_NEEDCOLL), FpUserData: uintptr(int64(1)), FzName: ts + 16525},
 121473 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 1*SQLITE_FUNC_NEEDCOLL | SQLITE_FUNC_MINMAX | SQLITE_FUNC_ANYORDER), FpUserData: uintptr(int64(1)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FzName: ts + 16525},
 121474 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL | SQLITE_FUNC_TYPEOF), FxSFunc: 0, FzName: ts + 16529},
 121475 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL | SQLITE_FUNC_TYPEOF), FxSFunc: 0, FzName: ts + 16536},
 121476 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL | SQLITE_FUNC_LENGTH), FxSFunc: 0, FzName: ts + 16544},
 121477 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16551},
 121478 	{FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16557},
 121479 	{FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16564},
 121480 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16571},
 121481 	{FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16579},
 121482 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16584},
 121483 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16588},
 121484 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16588},
 121485 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16594},
 121486 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16600},
 121487 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16606},
 121488 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16610},
 121489 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16610},
 121490 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_INLINE | SQLITE_FUNC_CONSTANT | 0), FxSFunc: 0, FzName: ts + 16616},
 121491 	{FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16623},
 121492 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16630},
 121493 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 1*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16641},
 121494 	{FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 16648},
 121495 	{FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_SLOCHNG | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 16663},
 121496 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16680},
 121497 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16691},
 121498 	{FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16697},
 121499 	{FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16715},
 121500 	{FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16723},
 121501 	{FnArg: int8(3), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16737},
 121502 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16745},
 121503 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16754},
 121504 	{FnArg: int8(3), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16754},
 121505 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16761},
 121506 	{FnArg: int8(3), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16761},
 121507 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16771},
 121508 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16775},
 121509 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16781},
 121510 	{FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL | SQLITE_FUNC_COUNT | SQLITE_FUNC_ANYORDER), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16785},
 121511 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL | SQLITE_FUNC_ANYORDER), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16785},
 121512 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16791},
 121513 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16791},
 121514 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | SQLITE_FUNC_LIKE | SQLITE_FUNC_CASE), FpUserData: 0, FxSFunc: 0, FzName: ts + 16804},
 121515 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | SQLITE_FUNC_LIKE), FpUserData: 0, FxSFunc: 0, FzName: ts + 16324},
 121516 	{FnArg: int8(3), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | SQLITE_FUNC_LIKE), FpUserData: 0, FxSFunc: 0, FzName: ts + 16324},
 121517 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FzName: ts + 7938},
 121518 	{FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FzName: ts + 7938},
 121519 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16809},
 121520 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16814},
 121521 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16822},
 121522 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16828},
 121523 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16834},
 121524 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FpUserData: uintptr(int64(1)), FxSFunc: 0, FzName: ts + 16837},
 121525 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FpUserData: uintptr(int64(1)), FxSFunc: 0, FzName: ts + 16841},
 121526 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FpUserData: uintptr(int64(2)), FxSFunc: 0, FzName: ts + 16847},
 121527 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16837},
 121528 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16852},
 121529 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16856},
 121530 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16860},
 121531 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16866},
 121532 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16870},
 121533 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16875},
 121534 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16880},
 121535 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16885},
 121536 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16891},
 121537 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16895},
 121538 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16899},
 121539 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16903},
 121540 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16908},
 121541 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16913},
 121542 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16918},
 121543 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16924},
 121544 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16930},
 121545 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16936},
 121546 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16941},
 121547 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: 0, FxSFunc: 0, FzName: ts + 16949},
 121548 	{FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16957},
 121549 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_FUNC_CONSTANT | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL), FxSFunc: 0, FzName: ts + 16960},
 121550 	{FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_INLINE | SQLITE_FUNC_CONSTANT | 0), FxSFunc: 0, FzName: ts + 7938},
 121551 	{FnArg: int8(3), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_INLINE | SQLITE_FUNC_CONSTANT | 0), FpUserData: uintptr(int64(INLINEFUNC_iif)), FxSFunc: 0, FzName: ts + 16965}}
 121552 
 121553 // A foreign key constraint requires that the key columns in the parent
 121554 // table are collectively subject to a UNIQUE or PRIMARY KEY constraint.
 121555 // Given that pParent is the parent table for foreign key constraint pFKey,
 121556 // search the schema for a unique index on the parent key columns.
 121557 //
 121558 // If successful, zero is returned. If the parent key is an INTEGER PRIMARY
 121559 // KEY column, then output variable *ppIdx is set to NULL. Otherwise, *ppIdx
 121560 // is set to point to the unique index.
 121561 //
 121562 // If the parent key consists of a single column (the foreign key constraint
 121563 // is not a composite foreign key), output variable *paiCol is set to NULL.
 121564 // Otherwise, it is set to point to an allocated array of size N, where
 121565 // N is the number of columns in the parent key. The first element of the
 121566 // array is the index of the child table column that is mapped by the FK
 121567 // constraint to the parent table column stored in the left-most column
 121568 // of index *ppIdx. The second element of the array is the index of the
 121569 // child table column that corresponds to the second left-most column of
 121570 // *ppIdx, and so on.
 121571 //
 121572 // If the required index cannot be found, either because:
 121573 //
 121574 //  1. The named parent key columns do not exist, or
 121575 //
 121576 //  2. The named parent key columns do exist, but are not subject to a
 121577 //     UNIQUE or PRIMARY KEY constraint, or
 121578 //
 121579 //  3. No parent key columns were provided explicitly as part of the
 121580 //     foreign key definition, and the parent table does not have a
 121581 //     PRIMARY KEY, or
 121582 //
 121583 //  4. No parent key columns were provided explicitly as part of the
 121584 //     foreign key definition, and the PRIMARY KEY of the parent table
 121585 //     consists of a different number of columns to the child key in
 121586 //     the child table.
 121587 //
 121588 // then non-zero is returned, and a "foreign key mismatch" error loaded
 121589 // into pParse. If an OOM error occurs, non-zero is returned and the
 121590 // pParse->db->mallocFailed flag is set.
 121591 func Xsqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey uintptr, ppIdx uintptr, paiCol uintptr) int32 {
 121592 	bp := tls.Alloc(16)
 121593 	defer tls.Free(16)
 121594 
 121595 	var pIdx uintptr = uintptr(0)
 121596 	var aiCol uintptr = uintptr(0)
 121597 	var nCol int32 = (*FKey)(unsafe.Pointer(pFKey)).FnCol
 121598 	var zKey uintptr = (*sColMap)(unsafe.Pointer(pFKey + 64)).FzCol
 121599 
 121600 	if nCol == 1 {
 121601 		if int32((*Table)(unsafe.Pointer(pParent)).FiPKey) >= 0 {
 121602 			if !(zKey != 0) {
 121603 				return 0
 121604 			}
 121605 			if !(Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pParent)).FaCol+uintptr((*Table)(unsafe.Pointer(pParent)).FiPKey)*24)).FzCnName, zKey) != 0) {
 121606 				return 0
 121607 			}
 121608 		}
 121609 	} else if paiCol != 0 {
 121610 		aiCol = Xsqlite3DbMallocRawNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(nCol)*uint64(unsafe.Sizeof(int32(0))))
 121611 		if !(aiCol != 0) {
 121612 			return 1
 121613 		}
 121614 		*(*uintptr)(unsafe.Pointer(paiCol)) = aiCol
 121615 	}
 121616 
 121617 	for pIdx = (*Table)(unsafe.Pointer(pParent)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
 121618 		if int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) == nCol && int32((*Index)(unsafe.Pointer(pIdx)).FonError) != OE_None && (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) {
 121619 			if zKey == uintptr(0) {
 121620 				if int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY {
 121621 					if aiCol != 0 {
 121622 						var i int32
 121623 						for i = 0; i < nCol; i++ {
 121624 							*(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)) = (*sColMap)(unsafe.Pointer(pFKey + 64 + uintptr(i)*16)).FiFrom
 121625 						}
 121626 					}
 121627 					break
 121628 				}
 121629 			} else {
 121630 				var i int32
 121631 				var j int32
 121632 				for i = 0; i < nCol; i++ {
 121633 					var iCol I16 = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))
 121634 					var zDfltColl uintptr
 121635 					var zIdxCol uintptr
 121636 
 121637 					if int32(iCol) < 0 {
 121638 						break
 121639 					}
 121640 
 121641 					zDfltColl = Xsqlite3ColumnColl(tls, (*Table)(unsafe.Pointer(pParent)).FaCol+uintptr(iCol)*24)
 121642 					if !(zDfltColl != 0) {
 121643 						zDfltColl = uintptr(unsafe.Pointer(&Xsqlite3StrBINARY))
 121644 					}
 121645 					if Xsqlite3StrICmp(tls, *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(i)*8)), zDfltColl) != 0 {
 121646 						break
 121647 					}
 121648 
 121649 					zIdxCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pParent)).FaCol + uintptr(iCol)*24)).FzCnName
 121650 					for j = 0; j < nCol; j++ {
 121651 						if Xsqlite3StrICmp(tls, (*sColMap)(unsafe.Pointer(pFKey+64+uintptr(j)*16)).FzCol, zIdxCol) == 0 {
 121652 							if aiCol != 0 {
 121653 								*(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)) = (*sColMap)(unsafe.Pointer(pFKey + 64 + uintptr(j)*16)).FiFrom
 121654 							}
 121655 							break
 121656 						}
 121657 					}
 121658 					if j == nCol {
 121659 						break
 121660 					}
 121661 				}
 121662 				if i == nCol {
 121663 					break
 121664 				}
 121665 			}
 121666 		}
 121667 	}
 121668 
 121669 	if !(pIdx != 0) {
 121670 		if !(int32((*Parse)(unsafe.Pointer(pParse)).FdisableTriggers) != 0) {
 121671 			Xsqlite3ErrorMsg(tls, pParse,
 121672 				ts+16969,
 121673 				libc.VaList(bp, (*Table)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*FKey)(unsafe.Pointer(pFKey)).FzTo))
 121674 		}
 121675 		Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, aiCol)
 121676 		return 1
 121677 	}
 121678 
 121679 	*(*uintptr)(unsafe.Pointer(ppIdx)) = pIdx
 121680 	return 0
 121681 }
 121682 
 121683 func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx uintptr, pFKey uintptr, aiCol uintptr, regData int32, nIncr int32, isIgnore int32) {
 121684 	var i int32
 121685 	var v uintptr = Xsqlite3GetVdbe(tls, pParse)
 121686 	var iCur int32 = (*Parse)(unsafe.Pointer(pParse)).FnTab - 1
 121687 	var iOk int32 = Xsqlite3VdbeMakeLabel(tls, pParse)
 121688 
 121689 	if nIncr < 0 {
 121690 		Xsqlite3VdbeAddOp2(tls, v, OP_FkIfZero, int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred), iOk)
 121691 
 121692 	}
 121693 	for i = 0; i < (*FKey)(unsafe.Pointer(pFKey)).FnCol; i++ {
 121694 		var iReg int32 = int32(Xsqlite3TableColumnToStorage(tls, (*FKey)(unsafe.Pointer(pFKey)).FpFrom, int16(*(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4))))) + regData + 1
 121695 		Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, iReg, iOk)
 121696 	}
 121697 
 121698 	if isIgnore == 0 {
 121699 		if pIdx == uintptr(0) {
 121700 			var iMustBeInt int32
 121701 			var regTemp int32 = Xsqlite3GetTempReg(tls, pParse)
 121702 
 121703 			Xsqlite3VdbeAddOp2(tls, v, OP_SCopy,
 121704 				int32(Xsqlite3TableColumnToStorage(tls, (*FKey)(unsafe.Pointer(pFKey)).FpFrom, int16(*(*int32)(unsafe.Pointer(aiCol)))))+1+regData, regTemp)
 121705 			iMustBeInt = Xsqlite3VdbeAddOp2(tls, v, OP_MustBeInt, regTemp, 0)
 121706 
 121707 			if pTab == (*FKey)(unsafe.Pointer(pFKey)).FpFrom && nIncr == 1 {
 121708 				Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regData, iOk, regTemp)
 121709 				Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL))
 121710 			}
 121711 
 121712 			Xsqlite3OpenTable(tls, pParse, iCur, iDb, pTab, OP_OpenRead)
 121713 			Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iCur, 0, regTemp)
 121714 			Xsqlite3VdbeGoto(tls, v, iOk)
 121715 			Xsqlite3VdbeJumpHere(tls, v, Xsqlite3VdbeCurrentAddr(tls, v)-2)
 121716 			Xsqlite3VdbeJumpHere(tls, v, iMustBeInt)
 121717 			Xsqlite3ReleaseTempReg(tls, pParse, regTemp)
 121718 		} else {
 121719 			var nCol int32 = (*FKey)(unsafe.Pointer(pFKey)).FnCol
 121720 			var regTemp int32 = Xsqlite3GetTempRange(tls, pParse, nCol)
 121721 
 121722 			Xsqlite3VdbeAddOp3(tls, v, OP_OpenRead, iCur, int32((*Index)(unsafe.Pointer(pIdx)).Ftnum), iDb)
 121723 			Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx)
 121724 			for i = 0; i < nCol; i++ {
 121725 				Xsqlite3VdbeAddOp2(tls, v, OP_Copy,
 121726 					int32(Xsqlite3TableColumnToStorage(tls, (*FKey)(unsafe.Pointer(pFKey)).FpFrom, int16(*(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)))))+1+regData,
 121727 					regTemp+i)
 121728 			}
 121729 
 121730 			if pTab == (*FKey)(unsafe.Pointer(pFKey)).FpFrom && nIncr == 1 {
 121731 				var iJump int32 = Xsqlite3VdbeCurrentAddr(tls, v) + nCol + 1
 121732 				for i = 0; i < nCol; i++ {
 121733 					var iChild int32 = int32(Xsqlite3TableColumnToStorage(tls, (*FKey)(unsafe.Pointer(pFKey)).FpFrom, int16(*(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4))))) +
 121734 						1 + regData
 121735 					var iParent int32 = 1 + regData
 121736 					iParent = iParent + int32(Xsqlite3TableColumnToStorage(tls, (*Index)(unsafe.Pointer(pIdx)).FpTable,
 121737 						*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))))
 121738 
 121739 					if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) == int32((*Table)(unsafe.Pointer(pTab)).FiPKey) {
 121740 						iParent = regData
 121741 					}
 121742 					Xsqlite3VdbeAddOp3(tls, v, OP_Ne, iChild, iJump, iParent)
 121743 					Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_JUMPIFNULL))
 121744 				}
 121745 				Xsqlite3VdbeGoto(tls, v, iOk)
 121746 			}
 121747 
 121748 			Xsqlite3VdbeAddOp4(tls, v, OP_Affinity, regTemp, nCol, 0,
 121749 				Xsqlite3IndexAffinityStr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pIdx), nCol)
 121750 			Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, iCur, iOk, regTemp, nCol)
 121751 
 121752 			Xsqlite3ReleaseTempRange(tls, pParse, regTemp, nCol)
 121753 		}
 121754 	}
 121755 
 121756 	if !(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && !((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_DeferFKs) != 0) &&
 121757 		!(int32((*Parse)(unsafe.Pointer(pParse)).FpToplevel) != 0) &&
 121758 		!(int32((*Parse)(unsafe.Pointer(pParse)).FisMultiWrite) != 0) {
 121759 		Xsqlite3HaltConstraint(tls, pParse, SQLITE_CONSTRAINT|int32(3)<<8,
 121760 			OE_Abort, uintptr(0), int8(-1), uint8(P5_ConstraintFK))
 121761 	} else {
 121762 		if nIncr > 0 && int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) == 0 {
 121763 			Xsqlite3MayAbort(tls, pParse)
 121764 		}
 121765 		Xsqlite3VdbeAddOp2(tls, v, OP_FkCounter, int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred), nIncr)
 121766 	}
 121767 
 121768 	Xsqlite3VdbeResolveLabel(tls, v, iOk)
 121769 	Xsqlite3VdbeAddOp1(tls, v, OP_Close, iCur)
 121770 }
 121771 
 121772 func exprTableRegister(tls *libc.TLS, pParse uintptr, pTab uintptr, regBase int32, iCol I16) uintptr {
 121773 	var pExpr uintptr
 121774 	var pCol uintptr
 121775 	var zColl uintptr
 121776 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 121777 
 121778 	pExpr = Xsqlite3Expr(tls, db, TK_REGISTER, uintptr(0))
 121779 	if pExpr != 0 {
 121780 		if int32(iCol) >= 0 && int32(iCol) != int32((*Table)(unsafe.Pointer(pTab)).FiPKey) {
 121781 			pCol = (*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*24
 121782 			(*Expr)(unsafe.Pointer(pExpr)).FiTable = regBase + int32(Xsqlite3TableColumnToStorage(tls, pTab, iCol)) + 1
 121783 			(*Expr)(unsafe.Pointer(pExpr)).FaffExpr = (*Column)(unsafe.Pointer(pCol)).Faffinity
 121784 			zColl = Xsqlite3ColumnColl(tls, pCol)
 121785 			if zColl == uintptr(0) {
 121786 				zColl = (*CollSeq)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FpDfltColl)).FzName
 121787 			}
 121788 			pExpr = Xsqlite3ExprAddCollateString(tls, pParse, pExpr, zColl)
 121789 		} else {
 121790 			(*Expr)(unsafe.Pointer(pExpr)).FiTable = regBase
 121791 			(*Expr)(unsafe.Pointer(pExpr)).FaffExpr = int8(SQLITE_AFF_INTEGER)
 121792 		}
 121793 	}
 121794 	return pExpr
 121795 }
 121796 
 121797 func exprTableColumn(tls *libc.TLS, db uintptr, pTab uintptr, iCursor int32, iCol I16) uintptr {
 121798 	var pExpr uintptr = Xsqlite3Expr(tls, db, TK_COLUMN, uintptr(0))
 121799 	if pExpr != 0 {
 121800 		*(*uintptr)(unsafe.Pointer(pExpr + 64)) = pTab
 121801 		(*Expr)(unsafe.Pointer(pExpr)).FiTable = iCursor
 121802 		(*Expr)(unsafe.Pointer(pExpr)).FiColumn = iCol
 121803 	}
 121804 	return pExpr
 121805 }
 121806 
 121807 func fkScanChildren(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, pIdx uintptr, pFKey uintptr, aiCol uintptr, regData int32, nIncr int32) {
 121808 	bp := tls.Alloc(56)
 121809 	defer tls.Free(56)
 121810 
 121811 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 121812 	var i int32
 121813 	var pWhere uintptr = uintptr(0)
 121814 
 121815 	var pWInfo uintptr
 121816 	var iFkIfZero int32 = 0
 121817 	var v uintptr = Xsqlite3GetVdbe(tls, pParse)
 121818 
 121819 	if nIncr < 0 {
 121820 		iFkIfZero = Xsqlite3VdbeAddOp2(tls, v, OP_FkIfZero, int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred), 0)
 121821 
 121822 	}
 121823 
 121824 	for i = 0; i < (*FKey)(unsafe.Pointer(pFKey)).FnCol; i++ {
 121825 		var pLeft uintptr
 121826 		var pRight uintptr
 121827 		var pEq uintptr
 121828 		var iCol I16
 121829 		var zCol uintptr
 121830 
 121831 		if pIdx != 0 {
 121832 			iCol = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))
 121833 		} else {
 121834 			iCol = int16(-1)
 121835 		}
 121836 		pLeft = exprTableRegister(tls, pParse, pTab, regData, iCol)
 121837 		if aiCol != 0 {
 121838 			iCol = int16(*(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)))
 121839 		} else {
 121840 			iCol = int16((*sColMap)(unsafe.Pointer(pFKey + 64)).FiFrom)
 121841 		}
 121842 
 121843 		zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpFrom)).FaCol + uintptr(iCol)*24)).FzCnName
 121844 		pRight = Xsqlite3Expr(tls, db, TK_ID, zCol)
 121845 		pEq = Xsqlite3PExpr(tls, pParse, TK_EQ, pLeft, pRight)
 121846 		pWhere = Xsqlite3ExprAnd(tls, pParse, pWhere, pEq)
 121847 	}
 121848 
 121849 	if pTab == (*FKey)(unsafe.Pointer(pFKey)).FpFrom && nIncr > 0 {
 121850 		var pNe uintptr
 121851 		var pLeft uintptr
 121852 		var pRight uintptr
 121853 		if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
 121854 			pLeft = exprTableRegister(tls, pParse, pTab, regData, int16(-1))
 121855 			pRight = exprTableColumn(tls, db, pTab, (*SrcItem)(unsafe.Pointer(pSrc+8)).FiCursor, int16(-1))
 121856 			pNe = Xsqlite3PExpr(tls, pParse, TK_NE, pLeft, pRight)
 121857 		} else {
 121858 			var pEq uintptr
 121859 			var pAll uintptr = uintptr(0)
 121860 
 121861 			for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol); i++ {
 121862 				var iCol I16 = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))
 121863 
 121864 				pLeft = exprTableRegister(tls, pParse, pTab, regData, iCol)
 121865 				pRight = Xsqlite3Expr(tls, db, TK_ID, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*24)).FzCnName)
 121866 				pEq = Xsqlite3PExpr(tls, pParse, TK_IS, pLeft, pRight)
 121867 				pAll = Xsqlite3ExprAnd(tls, pParse, pAll, pEq)
 121868 			}
 121869 			pNe = Xsqlite3PExpr(tls, pParse, TK_NOT, pAll, uintptr(0))
 121870 		}
 121871 		pWhere = Xsqlite3ExprAnd(tls, pParse, pWhere, pNe)
 121872 	}
 121873 
 121874 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(NameContext{})))
 121875 	(*NameContext)(unsafe.Pointer(bp)).FpSrcList = pSrc
 121876 	(*NameContext)(unsafe.Pointer(bp)).FpParse = pParse
 121877 	Xsqlite3ResolveExprNames(tls, bp, pWhere)
 121878 
 121879 	if (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 {
 121880 		pWInfo = Xsqlite3WhereBegin(tls, pParse, pSrc, pWhere, uintptr(0), uintptr(0), uintptr(0), uint16(0), 0)
 121881 		Xsqlite3VdbeAddOp2(tls, v, OP_FkCounter, int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred), nIncr)
 121882 		if pWInfo != 0 {
 121883 			Xsqlite3WhereEnd(tls, pWInfo)
 121884 		}
 121885 	}
 121886 
 121887 	Xsqlite3ExprDelete(tls, db, pWhere)
 121888 	if iFkIfZero != 0 {
 121889 		Xsqlite3VdbeJumpHereOrPopInst(tls, v, iFkIfZero)
 121890 	}
 121891 }
 121892 
 121893 // This function returns a linked list of FKey objects (connected by
 121894 // FKey.pNextTo) holding all children of table pTab.  For example,
 121895 // given the following schema:
 121896 //
 121897 //	CREATE TABLE t1(a PRIMARY KEY);
 121898 //	CREATE TABLE t2(b REFERENCES t1(a);
 121899 //
 121900 // Calling this function with table "t1" as an argument returns a pointer
 121901 // to the FKey structure representing the foreign key constraint on table
 121902 // "t2". Calling this function with "t2" as the argument would return a
 121903 // NULL pointer (as there are no FK constraints for which t2 is the parent
 121904 // table).
 121905 func Xsqlite3FkReferences(tls *libc.TLS, pTab uintptr) uintptr {
 121906 	return Xsqlite3HashFind(tls, (*Table)(unsafe.Pointer(pTab)).FpSchema+80, (*Table)(unsafe.Pointer(pTab)).FzName)
 121907 }
 121908 
 121909 func fkTriggerDelete(tls *libc.TLS, dbMem uintptr, p uintptr) {
 121910 	if p != 0 {
 121911 		var pStep uintptr = (*Trigger)(unsafe.Pointer(p)).Fstep_list
 121912 		Xsqlite3ExprDelete(tls, dbMem, (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere)
 121913 		Xsqlite3ExprListDelete(tls, dbMem, (*TriggerStep)(unsafe.Pointer(pStep)).FpExprList)
 121914 		Xsqlite3SelectDelete(tls, dbMem, (*TriggerStep)(unsafe.Pointer(pStep)).FpSelect)
 121915 		Xsqlite3ExprDelete(tls, dbMem, (*Trigger)(unsafe.Pointer(p)).FpWhen)
 121916 		Xsqlite3DbFree(tls, dbMem, p)
 121917 	}
 121918 }
 121919 
 121920 // Clear the apTrigger[] cache of CASCADE triggers for all foreign keys
 121921 // in a particular database.  This needs to happen when the schema
 121922 // changes.
 121923 func Xsqlite3FkClearTriggerCache(tls *libc.TLS, db uintptr, iDb int32) {
 121924 	var k uintptr
 121925 	var pHash uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpSchema + 8
 121926 	for k = (*Hash)(unsafe.Pointer(pHash)).Ffirst; k != 0; k = (*HashElem)(unsafe.Pointer(k)).Fnext {
 121927 		var pTab uintptr = (*HashElem)(unsafe.Pointer(k)).Fdata
 121928 		var pFKey uintptr
 121929 		if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM) {
 121930 			continue
 121931 		}
 121932 		for pFKey = *(*uintptr)(unsafe.Pointer(pTab + 64 + 8)); pFKey != 0; pFKey = (*FKey)(unsafe.Pointer(pFKey)).FpNextFrom {
 121933 			fkTriggerDelete(tls, db, *(*uintptr)(unsafe.Pointer(pFKey + 48)))
 121934 			*(*uintptr)(unsafe.Pointer(pFKey + 48)) = uintptr(0)
 121935 			fkTriggerDelete(tls, db, *(*uintptr)(unsafe.Pointer(pFKey + 48 + 1*8)))
 121936 			*(*uintptr)(unsafe.Pointer(pFKey + 48 + 1*8)) = uintptr(0)
 121937 		}
 121938 	}
 121939 }
 121940 
 121941 // This function is called to generate code that runs when table pTab is
 121942 // being dropped from the database. The SrcList passed as the second argument
 121943 // to this function contains a single entry guaranteed to resolve to
 121944 // table pTab.
 121945 //
 121946 // Normally, no code is required. However, if either
 121947 //
 121948 //	(a) The table is the parent table of a FK constraint, or
 121949 //	(b) The table is the child table of a deferred FK constraint and it is
 121950 //	    determined at runtime that there are outstanding deferred FK
 121951 //	    constraint violations in the database,
 121952 //
 121953 // then the equivalent of "DELETE FROM <tbl>" is executed before dropping
 121954 // the table from the database. Triggers are disabled while running this
 121955 // DELETE, but foreign key actions are not.
 121956 func Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uintptr) {
 121957 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 121958 	if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ForeignKeys) != 0 && int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM {
 121959 		var iSkip int32 = 0
 121960 		var v uintptr = Xsqlite3GetVdbe(tls, pParse)
 121961 
 121962 		if Xsqlite3FkReferences(tls, pTab) == uintptr(0) {
 121963 			var p uintptr
 121964 			for p = *(*uintptr)(unsafe.Pointer(pTab + 64 + 8)); p != 0; p = (*FKey)(unsafe.Pointer(p)).FpNextFrom {
 121965 				if (*FKey)(unsafe.Pointer(p)).FisDeferred != 0 || (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 {
 121966 					break
 121967 				}
 121968 			}
 121969 			if !(p != 0) {
 121970 				return
 121971 			}
 121972 			iSkip = Xsqlite3VdbeMakeLabel(tls, pParse)
 121973 			Xsqlite3VdbeAddOp2(tls, v, OP_FkIfZero, 1, iSkip)
 121974 		}
 121975 
 121976 		(*Parse)(unsafe.Pointer(pParse)).FdisableTriggers = U8(1)
 121977 		Xsqlite3DeleteFrom(tls, pParse, Xsqlite3SrcListDup(tls, db, pName, 0), uintptr(0), uintptr(0), uintptr(0))
 121978 		(*Parse)(unsafe.Pointer(pParse)).FdisableTriggers = U8(0)
 121979 
 121980 		if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) == uint64(0) {
 121981 			Xsqlite3VdbeAddOp2(tls, v, OP_FkIfZero, 0, Xsqlite3VdbeCurrentAddr(tls, v)+2)
 121982 
 121983 			Xsqlite3HaltConstraint(tls, pParse, SQLITE_CONSTRAINT|int32(3)<<8,
 121984 				OE_Abort, uintptr(0), int8(-1), uint8(P5_ConstraintFK))
 121985 		}
 121986 
 121987 		if iSkip != 0 {
 121988 			Xsqlite3VdbeResolveLabel(tls, v, iSkip)
 121989 		}
 121990 	}
 121991 }
 121992 
 121993 func fkChildIsModified(tls *libc.TLS, pTab uintptr, p uintptr, aChange uintptr, bChngRowid int32) int32 {
 121994 	var i int32
 121995 	for i = 0; i < (*FKey)(unsafe.Pointer(p)).FnCol; i++ {
 121996 		var iChildKey int32 = (*sColMap)(unsafe.Pointer(p + 64 + uintptr(i)*16)).FiFrom
 121997 		if *(*int32)(unsafe.Pointer(aChange + uintptr(iChildKey)*4)) >= 0 {
 121998 			return 1
 121999 		}
 122000 		if iChildKey == int32((*Table)(unsafe.Pointer(pTab)).FiPKey) && bChngRowid != 0 {
 122001 			return 1
 122002 		}
 122003 	}
 122004 	return 0
 122005 }
 122006 
 122007 func fkParentIsModified(tls *libc.TLS, pTab uintptr, p uintptr, aChange uintptr, bChngRowid int32) int32 {
 122008 	var i int32
 122009 	for i = 0; i < (*FKey)(unsafe.Pointer(p)).FnCol; i++ {
 122010 		var zKey uintptr = (*sColMap)(unsafe.Pointer(p + 64 + uintptr(i)*16)).FzCol
 122011 		var iKey int32
 122012 		for iKey = 0; iKey < int32((*Table)(unsafe.Pointer(pTab)).FnCol); iKey++ {
 122013 			if *(*int32)(unsafe.Pointer(aChange + uintptr(iKey)*4)) >= 0 || iKey == int32((*Table)(unsafe.Pointer(pTab)).FiPKey) && bChngRowid != 0 {
 122014 				var pCol uintptr = (*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iKey)*24
 122015 				if zKey != 0 {
 122016 					if 0 == Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName, zKey) {
 122017 						return 1
 122018 					}
 122019 				} else if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_PRIMKEY != 0 {
 122020 					return 1
 122021 				}
 122022 			}
 122023 		}
 122024 	}
 122025 	return 0
 122026 }
 122027 
 122028 func isSetNullAction(tls *libc.TLS, pParse uintptr, pFKey uintptr) int32 {
 122029 	var pTop uintptr = func() uintptr {
 122030 		if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
 122031 			return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
 122032 		}
 122033 		return pParse
 122034 	}()
 122035 	if (*Parse)(unsafe.Pointer(pTop)).FpTriggerPrg != 0 {
 122036 		var p uintptr = (*TriggerPrg)(unsafe.Pointer((*Parse)(unsafe.Pointer(pTop)).FpTriggerPrg)).FpTrigger
 122037 		if p == *(*uintptr)(unsafe.Pointer(pFKey + 48)) && int32(*(*U8)(unsafe.Pointer(pFKey + 45))) == OE_SetNull ||
 122038 			p == *(*uintptr)(unsafe.Pointer(pFKey + 48 + 1*8)) && int32(*(*U8)(unsafe.Pointer(pFKey + 45 + 1))) == OE_SetNull {
 122039 			return 1
 122040 		}
 122041 	}
 122042 	return 0
 122043 }
 122044 
 122045 // This function is called when inserting, deleting or updating a row of
 122046 // table pTab to generate VDBE code to perform foreign key constraint
 122047 // processing for the operation.
 122048 //
 122049 // For a DELETE operation, parameter regOld is passed the index of the
 122050 // first register in an array of (pTab->nCol+1) registers containing the
 122051 // rowid of the row being deleted, followed by each of the column values
 122052 // of the row being deleted, from left to right. Parameter regNew is passed
 122053 // zero in this case.
 122054 //
 122055 // For an INSERT operation, regOld is passed zero and regNew is passed the
 122056 // first register of an array of (pTab->nCol+1) registers containing the new
 122057 // row data.
 122058 //
 122059 // For an UPDATE operation, this function is called twice. Once before
 122060 // the original record is deleted from the table using the calling convention
 122061 // described for DELETE. Then again after the original record is deleted
 122062 // but before the new record is inserted using the INSERT convention.
 122063 func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, regNew int32, aChange uintptr, bChngRowid int32) {
 122064 	bp := tls.Alloc(40)
 122065 	defer tls.Free(40)
 122066 
 122067 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 122068 	var pFKey uintptr
 122069 	var iDb int32
 122070 	var zDb uintptr
 122071 	var isIgnoreErrors int32 = int32((*Parse)(unsafe.Pointer(pParse)).FdisableTriggers)
 122072 
 122073 	if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ForeignKeys) == uint64(0) {
 122074 		return
 122075 	}
 122076 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM) {
 122077 		return
 122078 	}
 122079 
 122080 	iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
 122081 	zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
 122082 
 122083 	for pFKey = *(*uintptr)(unsafe.Pointer(pTab + 64 + 8)); pFKey != 0; pFKey = (*FKey)(unsafe.Pointer(pFKey)).FpNextFrom {
 122084 		var pTo uintptr
 122085 		*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 122086 		*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 122087 		var aiCol uintptr
 122088 
 122089 		var i int32
 122090 		var bIgnore int32 = 0
 122091 
 122092 		if aChange != 0 &&
 122093 			Xsqlite3_stricmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, (*FKey)(unsafe.Pointer(pFKey)).FzTo) != 0 &&
 122094 			fkChildIsModified(tls, pTab, pFKey, aChange, bChngRowid) == 0 {
 122095 			continue
 122096 		}
 122097 
 122098 		if (*Parse)(unsafe.Pointer(pParse)).FdisableTriggers != 0 {
 122099 			pTo = Xsqlite3FindTable(tls, db, (*FKey)(unsafe.Pointer(pFKey)).FzTo, zDb)
 122100 		} else {
 122101 			pTo = Xsqlite3LocateTable(tls, pParse, uint32(0), (*FKey)(unsafe.Pointer(pFKey)).FzTo, zDb)
 122102 		}
 122103 		if !(pTo != 0) || Xsqlite3FkLocateIndex(tls, pParse, pTo, pFKey, bp, bp+8) != 0 {
 122104 			if !(isIgnoreErrors != 0) || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 122105 				return
 122106 			}
 122107 			if pTo == uintptr(0) {
 122108 				var v uintptr = Xsqlite3GetVdbe(tls, pParse)
 122109 				var iJump int32 = Xsqlite3VdbeCurrentAddr(tls, v) + (*FKey)(unsafe.Pointer(pFKey)).FnCol + 1
 122110 				for i = 0; i < (*FKey)(unsafe.Pointer(pFKey)).FnCol; i++ {
 122111 					var iFromCol int32
 122112 					var iReg int32
 122113 					iFromCol = (*sColMap)(unsafe.Pointer(pFKey + 64 + uintptr(i)*16)).FiFrom
 122114 					iReg = int32(Xsqlite3TableColumnToStorage(tls, (*FKey)(unsafe.Pointer(pFKey)).FpFrom, int16(iFromCol))) + regOld + 1
 122115 					Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, iReg, iJump)
 122116 				}
 122117 				Xsqlite3VdbeAddOp2(tls, v, OP_FkCounter, int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred), -1)
 122118 			}
 122119 			continue
 122120 		}
 122121 
 122122 		if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 {
 122123 			aiCol = *(*uintptr)(unsafe.Pointer(bp + 8))
 122124 		} else {
 122125 			*(*int32)(unsafe.Pointer(bp + 16)) = (*sColMap)(unsafe.Pointer(pFKey + 64)).FiFrom
 122126 			aiCol = bp + 16
 122127 		}
 122128 		for i = 0; i < (*FKey)(unsafe.Pointer(pFKey)).FnCol; i++ {
 122129 			if *(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)) == int32((*Table)(unsafe.Pointer(pTab)).FiPKey) {
 122130 				*(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)) = -1
 122131 			}
 122132 
 122133 			if (*Sqlite3)(unsafe.Pointer(db)).FxAuth != 0 {
 122134 				var rcauth int32
 122135 				var zCol uintptr = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTo)).FaCol + uintptr(func() int32 {
 122136 					if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
 122137 						return int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaiColumn + uintptr(i)*2)))
 122138 					}
 122139 					return int32((*Table)(unsafe.Pointer(pTo)).FiPKey)
 122140 				}())*24)).FzCnName
 122141 				rcauth = Xsqlite3AuthReadCol(tls, pParse, (*Table)(unsafe.Pointer(pTo)).FzName, zCol, iDb)
 122142 				bIgnore = libc.Bool32(rcauth == SQLITE_IGNORE)
 122143 			}
 122144 		}
 122145 
 122146 		Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTo)).Ftnum, uint8(0), (*Table)(unsafe.Pointer(pTo)).FzName)
 122147 		(*Parse)(unsafe.Pointer(pParse)).FnTab++
 122148 
 122149 		if regOld != 0 {
 122150 			fkLookupParent(tls, pParse, iDb, pTo, *(*uintptr)(unsafe.Pointer(bp)), pFKey, aiCol, regOld, -1, bIgnore)
 122151 		}
 122152 		if regNew != 0 && !(isSetNullAction(tls, pParse, pFKey) != 0) {
 122153 			fkLookupParent(tls, pParse, iDb, pTo, *(*uintptr)(unsafe.Pointer(bp)), pFKey, aiCol, regNew, +1, bIgnore)
 122154 		}
 122155 
 122156 		Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)))
 122157 	}
 122158 
 122159 	for pFKey = Xsqlite3FkReferences(tls, pTab); pFKey != 0; pFKey = (*FKey)(unsafe.Pointer(pFKey)).FpNextTo {
 122160 		*(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0)
 122161 		var pSrc uintptr
 122162 		*(*uintptr)(unsafe.Pointer(bp + 32)) = uintptr(0)
 122163 
 122164 		if aChange != 0 && fkParentIsModified(tls, pTab, pFKey, aChange, bChngRowid) == 0 {
 122165 			continue
 122166 		}
 122167 
 122168 		if !(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && !((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0) &&
 122169 			!(int32((*Parse)(unsafe.Pointer(pParse)).FpToplevel) != 0) && !(int32((*Parse)(unsafe.Pointer(pParse)).FisMultiWrite) != 0) {
 122170 			continue
 122171 		}
 122172 
 122173 		if Xsqlite3FkLocateIndex(tls, pParse, pTab, pFKey, bp+24, bp+32) != 0 {
 122174 			if !(isIgnoreErrors != 0) || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 122175 				return
 122176 			}
 122177 			continue
 122178 		}
 122179 
 122180 		pSrc = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0))
 122181 		if pSrc != 0 {
 122182 			var pItem uintptr = pSrc + 8
 122183 			(*SrcItem)(unsafe.Pointer(pItem)).FpTab = (*FKey)(unsafe.Pointer(pFKey)).FpFrom
 122184 			(*SrcItem)(unsafe.Pointer(pItem)).FzName = (*Table)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName
 122185 			(*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpTab)).FnTabRef++
 122186 			(*SrcItem)(unsafe.Pointer(pItem)).FiCursor = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 122187 
 122188 			if regNew != 0 {
 122189 				fkScanChildren(tls, pParse, pSrc, pTab, *(*uintptr)(unsafe.Pointer(bp + 24)), pFKey, *(*uintptr)(unsafe.Pointer(bp + 32)), regNew, -1)
 122190 			}
 122191 			if regOld != 0 {
 122192 				var eAction int32 = int32(*(*U8)(unsafe.Pointer(pFKey + 45 + uintptr(libc.Bool32(aChange != uintptr(0))))))
 122193 				fkScanChildren(tls, pParse, pSrc, pTab, *(*uintptr)(unsafe.Pointer(bp + 24)), pFKey, *(*uintptr)(unsafe.Pointer(bp + 32)), regOld, 1)
 122194 
 122195 				if !(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && eAction != OE_Cascade && eAction != OE_SetNull {
 122196 					Xsqlite3MayAbort(tls, pParse)
 122197 				}
 122198 			}
 122199 			(*SrcItem)(unsafe.Pointer(pItem)).FzName = uintptr(0)
 122200 			Xsqlite3SrcListDelete(tls, db, pSrc)
 122201 		}
 122202 		Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 32)))
 122203 	}
 122204 }
 122205 
 122206 // This function is called before generating code to update or delete a
 122207 // row contained in table pTab.
 122208 func Xsqlite3FkOldmask(tls *libc.TLS, pParse uintptr, pTab uintptr) U32 {
 122209 	bp := tls.Alloc(8)
 122210 	defer tls.Free(8)
 122211 
 122212 	var mask U32 = U32(0)
 122213 	if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_ForeignKeys) != 0 && int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM {
 122214 		var p uintptr
 122215 		var i int32
 122216 		for p = *(*uintptr)(unsafe.Pointer(pTab + 64 + 8)); p != 0; p = (*FKey)(unsafe.Pointer(p)).FpNextFrom {
 122217 			for i = 0; i < (*FKey)(unsafe.Pointer(p)).FnCol; i++ {
 122218 				mask = mask | func() uint32 {
 122219 					if (*sColMap)(unsafe.Pointer(p+64+uintptr(i)*16)).FiFrom > 31 {
 122220 						return 0xffffffff
 122221 					}
 122222 					return U32(1) << (*sColMap)(unsafe.Pointer(p+64+uintptr(i)*16)).FiFrom
 122223 				}()
 122224 			}
 122225 		}
 122226 		for p = Xsqlite3FkReferences(tls, pTab); p != 0; p = (*FKey)(unsafe.Pointer(p)).FpNextTo {
 122227 			*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 122228 			Xsqlite3FkLocateIndex(tls, pParse, pTab, p, bp, uintptr(0))
 122229 			if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
 122230 				for i = 0; i < int32((*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnKeyCol); i++ {
 122231 					mask = mask | func() uint32 {
 122232 						if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaiColumn + uintptr(i)*2))) > 31 {
 122233 							return 0xffffffff
 122234 						}
 122235 						return U32(1) << int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaiColumn + uintptr(i)*2)))
 122236 					}()
 122237 				}
 122238 			}
 122239 		}
 122240 	}
 122241 	return mask
 122242 }
 122243 
 122244 // This function is called before generating code to update or delete a
 122245 // row contained in table pTab. If the operation is a DELETE, then
 122246 // parameter aChange is passed a NULL value. For an UPDATE, aChange points
 122247 // to an array of size N, where N is the number of columns in table pTab.
 122248 // If the i'th column is not modified by the UPDATE, then the corresponding
 122249 // entry in the aChange[] array is set to -1. If the column is modified,
 122250 // the value is 0 or greater. Parameter chngRowid is set to true if the
 122251 // UPDATE statement modifies the rowid fields of the table.
 122252 //
 122253 // If any foreign key processing will be required, this function returns
 122254 // non-zero. If there is no foreign key related processing, this function
 122255 // returns zero.
 122256 //
 122257 // For an UPDATE, this function returns 2 if:
 122258 //
 122259 //   - There are any FKs for which pTab is the child and the parent table
 122260 //     and any FK processing at all is required (even of a different FK), or
 122261 //
 122262 //   - the UPDATE modifies one or more parent keys for which the action is
 122263 //     not "NO ACTION" (i.e. is CASCADE, SET DEFAULT or SET NULL).
 122264 //
 122265 // Or, assuming some other foreign key processing is required, 1.
 122266 func Xsqlite3FkRequired(tls *libc.TLS, pParse uintptr, pTab uintptr, aChange uintptr, chngRowid int32) int32 {
 122267 	var eRet int32 = 1
 122268 	var bHaveFK int32 = 0
 122269 	if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_ForeignKeys) != 0 && int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM {
 122270 		if !(aChange != 0) {
 122271 			bHaveFK = libc.Bool32(Xsqlite3FkReferences(tls, pTab) != 0 || *(*uintptr)(unsafe.Pointer(pTab + 64 + 8)) != 0)
 122272 		} else {
 122273 			var p uintptr
 122274 
 122275 			for p = *(*uintptr)(unsafe.Pointer(pTab + 64 + 8)); p != 0; p = (*FKey)(unsafe.Pointer(p)).FpNextFrom {
 122276 				if fkChildIsModified(tls, pTab, p, aChange, chngRowid) != 0 {
 122277 					if 0 == Xsqlite3_stricmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, (*FKey)(unsafe.Pointer(p)).FzTo) {
 122278 						eRet = 2
 122279 					}
 122280 					bHaveFK = 1
 122281 				}
 122282 			}
 122283 
 122284 			for p = Xsqlite3FkReferences(tls, pTab); p != 0; p = (*FKey)(unsafe.Pointer(p)).FpNextTo {
 122285 				if fkParentIsModified(tls, pTab, p, aChange, chngRowid) != 0 {
 122286 					if int32(*(*U8)(unsafe.Pointer(p + 45 + 1))) != OE_None {
 122287 						return 2
 122288 					}
 122289 					bHaveFK = 1
 122290 				}
 122291 			}
 122292 		}
 122293 	}
 122294 	if bHaveFK != 0 {
 122295 		return eRet
 122296 	}
 122297 	return 0
 122298 }
 122299 
 122300 func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, pChanges uintptr) uintptr {
 122301 	bp := tls.Alloc(112)
 122302 	defer tls.Free(112)
 122303 
 122304 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 122305 	var action int32
 122306 	var pTrigger uintptr
 122307 	var iAction int32 = libc.Bool32(pChanges != uintptr(0))
 122308 
 122309 	action = int32(*(*U8)(unsafe.Pointer(pFKey + 45 + uintptr(iAction))))
 122310 	if action == OE_Restrict && (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 {
 122311 		return uintptr(0)
 122312 	}
 122313 	pTrigger = *(*uintptr)(unsafe.Pointer(pFKey + 48 + uintptr(iAction)*8))
 122314 
 122315 	if action != OE_None && !(pTrigger != 0) {
 122316 		var zFrom uintptr
 122317 		var nFrom int32
 122318 		*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 122319 		*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 122320 		var pStep uintptr = uintptr(0)
 122321 		var pWhere uintptr = uintptr(0)
 122322 		var pList uintptr = uintptr(0)
 122323 		var pSelect uintptr = uintptr(0)
 122324 		var i int32
 122325 		var pWhen uintptr = uintptr(0)
 122326 
 122327 		if Xsqlite3FkLocateIndex(tls, pParse, pTab, pFKey, bp, bp+8) != 0 {
 122328 			return uintptr(0)
 122329 		}
 122330 
 122331 		for i = 0; i < (*FKey)(unsafe.Pointer(pFKey)).FnCol; i++ {
 122332 			*(*Token)(unsafe.Pointer(bp + 48)) = Token{Fz: ts + 7804, Fn: uint32(3)}
 122333 			*(*Token)(unsafe.Pointer(bp + 64)) = Token{Fz: ts + 7800, Fn: uint32(3)}
 122334 
 122335 			var iFromCol int32
 122336 			var pEq uintptr
 122337 
 122338 			if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 {
 122339 				iFromCol = *(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*4))
 122340 			} else {
 122341 				iFromCol = (*sColMap)(unsafe.Pointer(pFKey + 64)).FiFrom
 122342 			}
 122343 
 122344 			Xsqlite3TokenInit(tls, bp+16,
 122345 				(*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(func() int32 {
 122346 					if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
 122347 						return int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaiColumn + uintptr(i)*2)))
 122348 					}
 122349 					return int32((*Table)(unsafe.Pointer(pTab)).FiPKey)
 122350 				}())*24)).FzCnName)
 122351 			Xsqlite3TokenInit(tls, bp+32, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpFrom)).FaCol+uintptr(iFromCol)*24)).FzCnName)
 122352 
 122353 			pEq = Xsqlite3PExpr(tls, pParse, TK_EQ,
 122354 				Xsqlite3PExpr(tls, pParse, TK_DOT,
 122355 					Xsqlite3ExprAlloc(tls, db, TK_ID, bp+48, 0),
 122356 					Xsqlite3ExprAlloc(tls, db, TK_ID, bp+16, 0)),
 122357 				Xsqlite3ExprAlloc(tls, db, TK_ID, bp+32, 0))
 122358 			pWhere = Xsqlite3ExprAnd(tls, pParse, pWhere, pEq)
 122359 
 122360 			if pChanges != 0 {
 122361 				pEq = Xsqlite3PExpr(tls, pParse, TK_IS,
 122362 					Xsqlite3PExpr(tls, pParse, TK_DOT,
 122363 						Xsqlite3ExprAlloc(tls, db, TK_ID, bp+48, 0),
 122364 						Xsqlite3ExprAlloc(tls, db, TK_ID, bp+16, 0)),
 122365 					Xsqlite3PExpr(tls, pParse, TK_DOT,
 122366 						Xsqlite3ExprAlloc(tls, db, TK_ID, bp+64, 0),
 122367 						Xsqlite3ExprAlloc(tls, db, TK_ID, bp+16, 0)))
 122368 				pWhen = Xsqlite3ExprAnd(tls, pParse, pWhen, pEq)
 122369 			}
 122370 
 122371 			if action != OE_Restrict && (action != OE_Cascade || pChanges != 0) {
 122372 				var pNew uintptr
 122373 				if action == OE_Cascade {
 122374 					pNew = Xsqlite3PExpr(tls, pParse, TK_DOT,
 122375 						Xsqlite3ExprAlloc(tls, db, TK_ID, bp+64, 0),
 122376 						Xsqlite3ExprAlloc(tls, db, TK_ID, bp+16, 0))
 122377 				} else if action == OE_SetDflt {
 122378 					var pCol uintptr = (*Table)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpFrom)).FaCol + uintptr(iFromCol)*24
 122379 					var pDflt uintptr
 122380 					if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_GENERATED != 0 {
 122381 						pDflt = uintptr(0)
 122382 					} else {
 122383 						pDflt = Xsqlite3ColumnExpr(tls, (*FKey)(unsafe.Pointer(pFKey)).FpFrom, pCol)
 122384 					}
 122385 					if pDflt != 0 {
 122386 						pNew = Xsqlite3ExprDup(tls, db, pDflt, 0)
 122387 					} else {
 122388 						pNew = Xsqlite3ExprAlloc(tls, db, TK_NULL, uintptr(0), 0)
 122389 					}
 122390 				} else {
 122391 					pNew = Xsqlite3ExprAlloc(tls, db, TK_NULL, uintptr(0), 0)
 122392 				}
 122393 				pList = Xsqlite3ExprListAppend(tls, pParse, pList, pNew)
 122394 				Xsqlite3ExprListSetName(tls, pParse, pList, bp+32, 0)
 122395 			}
 122396 		}
 122397 		Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)))
 122398 
 122399 		zFrom = (*Table)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName
 122400 		nFrom = Xsqlite3Strlen30(tls, zFrom)
 122401 
 122402 		if action == OE_Restrict {
 122403 			var iDb int32 = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
 122404 
 122405 			var pRaise uintptr
 122406 
 122407 			(*Token)(unsafe.Pointer(bp + 96)).Fz = zFrom
 122408 			(*Token)(unsafe.Pointer(bp + 96)).Fn = uint32(nFrom)
 122409 			(*Token)(unsafe.Pointer(bp + 80)).Fz = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
 122410 			(*Token)(unsafe.Pointer(bp + 80)).Fn = uint32(Xsqlite3Strlen30(tls, (*Token)(unsafe.Pointer(bp+80)).Fz))
 122411 
 122412 			pRaise = Xsqlite3Expr(tls, db, TK_RAISE, ts+6488)
 122413 			if pRaise != 0 {
 122414 				(*Expr)(unsafe.Pointer(pRaise)).FaffExpr = int8(OE_Abort)
 122415 			}
 122416 			pSelect = Xsqlite3SelectNew(tls, pParse,
 122417 				Xsqlite3ExprListAppend(tls, pParse, uintptr(0), pRaise),
 122418 				Xsqlite3SrcListAppend(tls, pParse, uintptr(0), bp+80, bp+96),
 122419 				pWhere,
 122420 				uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0))
 122421 			pWhere = uintptr(0)
 122422 		}
 122423 
 122424 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++
 122425 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0)
 122426 
 122427 		pTrigger = Xsqlite3DbMallocZero(tls, db,
 122428 			uint64(unsafe.Sizeof(Trigger{}))+uint64(unsafe.Sizeof(TriggerStep{}))+uint64(nFrom)+uint64(1))
 122429 		if pTrigger != 0 {
 122430 			pStep = libc.AssignPtrUintptr(pTrigger+56, pTrigger+1*72)
 122431 			(*TriggerStep)(unsafe.Pointer(pStep)).FzTarget = pStep + 1*96
 122432 			libc.Xmemcpy(tls, (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget, zFrom, uint64(nFrom))
 122433 
 122434 			(*TriggerStep)(unsafe.Pointer(pStep)).FpWhere = Xsqlite3ExprDup(tls, db, pWhere, EXPRDUP_REDUCE)
 122435 			(*TriggerStep)(unsafe.Pointer(pStep)).FpExprList = Xsqlite3ExprListDup(tls, db, pList, EXPRDUP_REDUCE)
 122436 			(*TriggerStep)(unsafe.Pointer(pStep)).FpSelect = Xsqlite3SelectDup(tls, db, pSelect, EXPRDUP_REDUCE)
 122437 			if pWhen != 0 {
 122438 				pWhen = Xsqlite3PExpr(tls, pParse, TK_NOT, pWhen, uintptr(0))
 122439 				(*Trigger)(unsafe.Pointer(pTrigger)).FpWhen = Xsqlite3ExprDup(tls, db, pWhen, EXPRDUP_REDUCE)
 122440 			}
 122441 		}
 122442 
 122443 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable--
 122444 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = func() uint16 {
 122445 			if (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable != 0 {
 122446 				return uint16(0)
 122447 			}
 122448 			return (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue
 122449 		}()
 122450 
 122451 		Xsqlite3ExprDelete(tls, db, pWhere)
 122452 		Xsqlite3ExprDelete(tls, db, pWhen)
 122453 		Xsqlite3ExprListDelete(tls, db, pList)
 122454 		Xsqlite3SelectDelete(tls, db, pSelect)
 122455 		if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 1 {
 122456 			fkTriggerDelete(tls, db, pTrigger)
 122457 			return uintptr(0)
 122458 		}
 122459 
 122460 		{
 122461 			switch action {
 122462 			case OE_Restrict:
 122463 				(*TriggerStep)(unsafe.Pointer(pStep)).Fop = U8(TK_SELECT)
 122464 				break
 122465 				fallthrough
 122466 			case OE_Cascade:
 122467 				if !(pChanges != 0) {
 122468 					(*TriggerStep)(unsafe.Pointer(pStep)).Fop = U8(TK_DELETE)
 122469 					break
 122470 				}
 122471 				fallthrough
 122472 			default:
 122473 				(*TriggerStep)(unsafe.Pointer(pStep)).Fop = U8(TK_UPDATE)
 122474 			}
 122475 		}
 122476 		(*TriggerStep)(unsafe.Pointer(pStep)).FpTrig = pTrigger
 122477 		(*Trigger)(unsafe.Pointer(pTrigger)).FpSchema = (*Table)(unsafe.Pointer(pTab)).FpSchema
 122478 		(*Trigger)(unsafe.Pointer(pTrigger)).FpTabSchema = (*Table)(unsafe.Pointer(pTab)).FpSchema
 122479 		*(*uintptr)(unsafe.Pointer(pFKey + 48 + uintptr(iAction)*8)) = pTrigger
 122480 		(*Trigger)(unsafe.Pointer(pTrigger)).Fop = func() uint8 {
 122481 			if pChanges != 0 {
 122482 				return uint8(TK_UPDATE)
 122483 			}
 122484 			return uint8(TK_DELETE)
 122485 		}()
 122486 	}
 122487 
 122488 	return pTrigger
 122489 }
 122490 
 122491 // This function is called when deleting or updating a row to implement
 122492 // any required CASCADE, SET NULL or SET DEFAULT actions.
 122493 func Xsqlite3FkActions(tls *libc.TLS, pParse uintptr, pTab uintptr, pChanges uintptr, regOld int32, aChange uintptr, bChngRowid int32) {
 122494 	if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_ForeignKeys) != 0 {
 122495 		var pFKey uintptr
 122496 		for pFKey = Xsqlite3FkReferences(tls, pTab); pFKey != 0; pFKey = (*FKey)(unsafe.Pointer(pFKey)).FpNextTo {
 122497 			if aChange == uintptr(0) || fkParentIsModified(tls, pTab, pFKey, aChange, bChngRowid) != 0 {
 122498 				var pAct uintptr = fkActionTrigger(tls, pParse, pTab, pFKey, pChanges)
 122499 				if pAct != 0 {
 122500 					Xsqlite3CodeRowTriggerDirect(tls, pParse, pAct, pTab, regOld, OE_Abort, 0)
 122501 				}
 122502 			}
 122503 		}
 122504 	}
 122505 }
 122506 
 122507 // Free all memory associated with foreign key definitions attached to
 122508 // table pTab. Remove the deleted foreign keys from the Schema.fkeyHash
 122509 // hash table.
 122510 func Xsqlite3FkDelete(tls *libc.TLS, db uintptr, pTab uintptr) {
 122511 	var pFKey uintptr
 122512 	var pNext uintptr
 122513 
 122514 	for pFKey = *(*uintptr)(unsafe.Pointer(pTab + 64 + 8)); pFKey != 0; pFKey = pNext {
 122515 		if (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0) {
 122516 			if (*FKey)(unsafe.Pointer(pFKey)).FpPrevTo != 0 {
 122517 				(*FKey)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpPrevTo)).FpNextTo = (*FKey)(unsafe.Pointer(pFKey)).FpNextTo
 122518 			} else {
 122519 				var p uintptr = (*FKey)(unsafe.Pointer(pFKey)).FpNextTo
 122520 				var z uintptr = func() uintptr {
 122521 					if p != 0 {
 122522 						return (*FKey)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpNextTo)).FzTo
 122523 					}
 122524 					return (*FKey)(unsafe.Pointer(pFKey)).FzTo
 122525 				}()
 122526 				Xsqlite3HashInsert(tls, (*Table)(unsafe.Pointer(pTab)).FpSchema+80, z, p)
 122527 			}
 122528 			if (*FKey)(unsafe.Pointer(pFKey)).FpNextTo != 0 {
 122529 				(*FKey)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpNextTo)).FpPrevTo = (*FKey)(unsafe.Pointer(pFKey)).FpPrevTo
 122530 			}
 122531 		}
 122532 
 122533 		fkTriggerDelete(tls, db, *(*uintptr)(unsafe.Pointer(pFKey + 48)))
 122534 		fkTriggerDelete(tls, db, *(*uintptr)(unsafe.Pointer(pFKey + 48 + 1*8)))
 122535 
 122536 		pNext = (*FKey)(unsafe.Pointer(pFKey)).FpNextFrom
 122537 		Xsqlite3DbFree(tls, db, pFKey)
 122538 	}
 122539 }
 122540 
 122541 // Generate code that will
 122542 //
 122543 //	(1) acquire a lock for table pTab then
 122544 //	(2) open pTab as cursor iCur.
 122545 //
 122546 // If pTab is a WITHOUT ROWID table, then it is the PRIMARY KEY index
 122547 // for that table that is actually opened.
 122548 func Xsqlite3OpenTable(tls *libc.TLS, pParse uintptr, iCur int32, iDb int32, pTab uintptr, opcode int32) {
 122549 	var v uintptr
 122550 
 122551 	v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 122552 
 122553 	Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum,
 122554 		func() uint8 {
 122555 			if opcode == OP_OpenWrite {
 122556 				return uint8(1)
 122557 			}
 122558 			return uint8(0)
 122559 		}(), (*Table)(unsafe.Pointer(pTab)).FzName)
 122560 	if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
 122561 		Xsqlite3VdbeAddOp4Int(tls, v, opcode, iCur, int32((*Table)(unsafe.Pointer(pTab)).Ftnum), iDb, int32((*Table)(unsafe.Pointer(pTab)).FnNVCol))
 122562 
 122563 	} else {
 122564 		var pPk uintptr = Xsqlite3PrimaryKeyIndex(tls, pTab)
 122565 
 122566 		Xsqlite3VdbeAddOp3(tls, v, opcode, iCur, int32((*Index)(unsafe.Pointer(pPk)).Ftnum), iDb)
 122567 		Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pPk)
 122568 
 122569 	}
 122570 }
 122571 
 122572 // Return a pointer to the column affinity string associated with index
 122573 // pIdx. A column affinity string has one character for each column in
 122574 // the table, according to the affinity of the column:
 122575 //
 122576 //	Character      Column affinity
 122577 //	------------------------------
 122578 //	'A'            BLOB
 122579 //	'B'            TEXT
 122580 //	'C'            NUMERIC
 122581 //	'D'            INTEGER
 122582 //	'F'            REAL
 122583 //
 122584 // An extra 'D' is appended to the end of the string to cover the
 122585 // rowid that appears as the last column in every index.
 122586 //
 122587 // Memory for the buffer containing the column index affinity string
 122588 // is managed along with the rest of the Index structure. It will be
 122589 // released when sqlite3DeleteIndex() is called.
 122590 func Xsqlite3IndexAffinityStr(tls *libc.TLS, db uintptr, pIdx uintptr) uintptr {
 122591 	if !(int32((*Index)(unsafe.Pointer(pIdx)).FzColAff) != 0) {
 122592 		var n int32
 122593 		var pTab uintptr = (*Index)(unsafe.Pointer(pIdx)).FpTable
 122594 		(*Index)(unsafe.Pointer(pIdx)).FzColAff = Xsqlite3DbMallocRaw(tls, uintptr(0), uint64(int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)+1))
 122595 		if !(int32((*Index)(unsafe.Pointer(pIdx)).FzColAff) != 0) {
 122596 			Xsqlite3OomFault(tls, db)
 122597 			return uintptr(0)
 122598 		}
 122599 		for n = 0; n < int32((*Index)(unsafe.Pointer(pIdx)).FnColumn); n++ {
 122600 			var x I16 = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(n)*2))
 122601 			var aff int8
 122602 			if int32(x) >= 0 {
 122603 				aff = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(x)*24)).Faffinity
 122604 			} else if int32(x) == -1 {
 122605 				aff = int8(SQLITE_AFF_INTEGER)
 122606 			} else {
 122607 				aff = Xsqlite3ExprAffinity(tls, (*ExprList_item)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaColExpr+8+uintptr(n)*32)).FpExpr)
 122608 			}
 122609 			if int32(aff) < SQLITE_AFF_BLOB {
 122610 				aff = int8(SQLITE_AFF_BLOB)
 122611 			}
 122612 			if int32(aff) > SQLITE_AFF_NUMERIC {
 122613 				aff = int8(SQLITE_AFF_NUMERIC)
 122614 			}
 122615 			*(*int8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FzColAff + uintptr(n))) = aff
 122616 		}
 122617 		*(*int8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FzColAff + uintptr(n))) = int8(0)
 122618 	}
 122619 
 122620 	return (*Index)(unsafe.Pointer(pIdx)).FzColAff
 122621 }
 122622 
 122623 // Compute an affinity string for a table.   Space is obtained
 122624 // from sqlite3DbMalloc().  The caller is responsible for freeing
 122625 // the space when done.
 122626 func Xsqlite3TableAffinityStr(tls *libc.TLS, db uintptr, pTab uintptr) uintptr {
 122627 	var zColAff uintptr
 122628 	zColAff = Xsqlite3DbMallocRaw(tls, db, uint64(int32((*Table)(unsafe.Pointer(pTab)).FnCol)+1))
 122629 	if zColAff != 0 {
 122630 		var i int32
 122631 		var j int32
 122632 		for i = libc.AssignInt32(&j, 0); i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
 122633 			if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24)).FcolFlags)&COLFLAG_VIRTUAL == 0 {
 122634 				*(*int8)(unsafe.Pointer(zColAff + uintptr(libc.PostIncInt32(&j, 1)))) = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*24)).Faffinity
 122635 			}
 122636 		}
 122637 		for __ccgo := true; __ccgo; __ccgo = j >= 0 && int32(*(*int8)(unsafe.Pointer(zColAff + uintptr(j)))) <= SQLITE_AFF_BLOB {
 122638 			*(*int8)(unsafe.Pointer(zColAff + uintptr(libc.PostDecInt32(&j, 1)))) = int8(0)
 122639 		}
 122640 	}
 122641 	return zColAff
 122642 }
 122643 
 122644 // Make changes to the evolving bytecode to do affinity transformations
 122645 // of values that are about to be gathered into a row for table pTab.
 122646 //
 122647 // For ordinary (legacy, non-strict) tables:
 122648 // -----------------------------------------
 122649 //
 122650 // Compute the affinity string for table pTab, if it has not already been
 122651 // computed.  As an optimization, omit trailing SQLITE_AFF_BLOB affinities.
 122652 //
 122653 // If the affinity string is empty (because it was all SQLITE_AFF_BLOB entries
 122654 // which were then optimized out) then this routine becomes a no-op.
 122655 //
 122656 // Otherwise if iReg>0 then code an OP_Affinity opcode that will set the
 122657 // affinities for register iReg and following.  Or if iReg==0,
 122658 // then just set the P4 operand of the previous opcode (which should  be
 122659 // an OP_MakeRecord) to the affinity string.
 122660 //
 122661 // A column affinity string has one character per column:
 122662 //
 122663 //	Character      Column affinity
 122664 //	---------      ---------------
 122665 //	'A'            BLOB
 122666 //	'B'            TEXT
 122667 //	'C'            NUMERIC
 122668 //	'D'            INTEGER
 122669 //	'E'            REAL
 122670 //
 122671 // For STRICT tables:
 122672 // ------------------
 122673 //
 122674 // Generate an appropropriate OP_TypeCheck opcode that will verify the
 122675 // datatypes against the column definitions in pTab.  If iReg==0, that
 122676 // means an OP_MakeRecord opcode has already been generated and should be
 122677 // the last opcode generated.  The new OP_TypeCheck needs to be inserted
 122678 // before the OP_MakeRecord.  The new OP_TypeCheck should use the same
 122679 // register set as the OP_MakeRecord.  If iReg>0 then register iReg is
 122680 // the first of a series of registers that will form the new record.
 122681 // Apply the type checking to that array of registers.
 122682 func Xsqlite3TableAffinity(tls *libc.TLS, v uintptr, pTab uintptr, iReg int32) {
 122683 	var i int32
 122684 	var zColAff uintptr
 122685 	if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Strict) != 0 {
 122686 		if iReg == 0 {
 122687 			var pPrev uintptr
 122688 			Xsqlite3VdbeAppendP4(tls, v, pTab, -5)
 122689 			pPrev = Xsqlite3VdbeGetLastOp(tls, v)
 122690 
 122691 			(*VdbeOp)(unsafe.Pointer(pPrev)).Fopcode = U8(OP_TypeCheck)
 122692 			Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, (*VdbeOp)(unsafe.Pointer(pPrev)).Fp1, (*VdbeOp)(unsafe.Pointer(pPrev)).Fp2, (*VdbeOp)(unsafe.Pointer(pPrev)).Fp3)
 122693 		} else {
 122694 			Xsqlite3VdbeAddOp2(tls, v, OP_TypeCheck, iReg, int32((*Table)(unsafe.Pointer(pTab)).FnNVCol))
 122695 			Xsqlite3VdbeAppendP4(tls, v, pTab, -5)
 122696 		}
 122697 		return
 122698 	}
 122699 	zColAff = (*Table)(unsafe.Pointer(pTab)).FzColAff
 122700 	if zColAff == uintptr(0) {
 122701 		zColAff = Xsqlite3TableAffinityStr(tls, uintptr(0), pTab)
 122702 		if !(zColAff != 0) {
 122703 			Xsqlite3OomFault(tls, Xsqlite3VdbeDb(tls, v))
 122704 			return
 122705 		}
 122706 		(*Table)(unsafe.Pointer(pTab)).FzColAff = zColAff
 122707 	}
 122708 
 122709 	i = int32(libc.Xstrlen(tls, zColAff) & uint64(0x3fffffff))
 122710 	if i != 0 {
 122711 		if iReg != 0 {
 122712 			Xsqlite3VdbeAddOp4(tls, v, OP_Affinity, iReg, i, 0, zColAff, i)
 122713 		} else {
 122714 			Xsqlite3VdbeChangeP4(tls, v, -1, zColAff, i)
 122715 		}
 122716 	}
 122717 }
 122718 
 122719 func readsTable(tls *libc.TLS, p uintptr, iDb int32, pTab uintptr) int32 {
 122720 	var v uintptr = Xsqlite3GetVdbe(tls, p)
 122721 	var i int32
 122722 	var iEnd int32 = Xsqlite3VdbeCurrentAddr(tls, v)
 122723 	var pVTab uintptr
 122724 	if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
 122725 		pVTab = Xsqlite3GetVTable(tls, (*Parse)(unsafe.Pointer(p)).Fdb, pTab)
 122726 	} else {
 122727 		pVTab = uintptr(0)
 122728 	}
 122729 
 122730 	for i = 1; i < iEnd; i++ {
 122731 		var pOp uintptr = Xsqlite3VdbeGetOp(tls, v, i)
 122732 
 122733 		if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_OpenRead && (*VdbeOp)(unsafe.Pointer(pOp)).Fp3 == iDb {
 122734 			var pIndex uintptr
 122735 			var tnum Pgno = Pgno((*VdbeOp)(unsafe.Pointer(pOp)).Fp2)
 122736 			if tnum == (*Table)(unsafe.Pointer(pTab)).Ftnum {
 122737 				return 1
 122738 			}
 122739 			for pIndex = (*Table)(unsafe.Pointer(pTab)).FpIndex; pIndex != 0; pIndex = (*Index)(unsafe.Pointer(pIndex)).FpNext {
 122740 				if tnum == (*Index)(unsafe.Pointer(pIndex)).Ftnum {
 122741 					return 1
 122742 				}
 122743 			}
 122744 		}
 122745 		if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_VOpen && *(*uintptr)(unsafe.Pointer(pOp + 16)) == pVTab {
 122746 			return 1
 122747 		}
 122748 	}
 122749 	return 0
 122750 }
 122751 
 122752 func exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 122753 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN && int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 {
 122754 		*(*U16)(unsafe.Pointer(pWalker + 36)) |= U16(int32((*Column)(unsafe.Pointer((*Table1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FaCol + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiColumn)*24)).FcolFlags))
 122755 	}
 122756 	return WRC_Continue
 122757 }
 122758 
 122759 // All regular columns for table pTab have been puts into registers
 122760 // starting with iRegStore.  The registers that correspond to STORED
 122761 // or VIRTUAL columns have not yet been initialized.  This routine goes
 122762 // back and computes the values for those columns based on the previously
 122763 // computed normal columns.
 122764 func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore int32, pTab uintptr) {
 122765 	bp := tls.Alloc(56)
 122766 	defer tls.Free(56)
 122767 
 122768 	var i int32
 122769 
 122770 	var pRedo uintptr
 122771 	var eProgress int32
 122772 	var pOp uintptr
 122773 
 122774 	Xsqlite3TableAffinity(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, pTab, iRegStore)
 122775 	if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasStored) != U32(0) {
 122776 		pOp = Xsqlite3VdbeGetLastOp(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe)
 122777 		if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Affinity {
 122778 			var ii int32
 122779 			var jj int32
 122780 			var zP4 uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16))
 122781 
 122782 			for ii = libc.AssignInt32(&jj, 0); *(*int8)(unsafe.Pointer(zP4 + uintptr(jj))) != 0; ii++ {
 122783 				if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(ii)*24)).FcolFlags)&COLFLAG_VIRTUAL != 0 {
 122784 					continue
 122785 				}
 122786 				if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(ii)*24)).FcolFlags)&COLFLAG_STORED != 0 {
 122787 					*(*int8)(unsafe.Pointer(zP4 + uintptr(jj))) = int8(SQLITE_AFF_NONE)
 122788 				}
 122789 				jj++
 122790 			}
 122791 		} else if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_TypeCheck {
 122792 			(*VdbeOp)(unsafe.Pointer(pOp)).Fp3 = 1
 122793 		}
 122794 	}
 122795 
 122796 	for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
 122797 		if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24)).FcolFlags)&COLFLAG_GENERATED != 0 {
 122798 			*(*U16)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*24 + 16)) |= U16(COLFLAG_NOTAVAIL)
 122799 		}
 122800 	}
 122801 
 122802 	*(*uintptr)(unsafe.Pointer(bp + 8 + 40)) = pTab
 122803 	(*Walker)(unsafe.Pointer(bp + 8)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 122804 		f func(*libc.TLS, uintptr, uintptr) int32
 122805 	}{exprColumnFlagUnion}))
 122806 	(*Walker)(unsafe.Pointer(bp + 8)).FxSelectCallback = uintptr(0)
 122807 	(*Walker)(unsafe.Pointer(bp + 8)).FxSelectCallback2 = uintptr(0)
 122808 
 122809 	(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = -iRegStore
 122810 	for __ccgo := true; __ccgo; __ccgo = pRedo != 0 && eProgress != 0 {
 122811 		eProgress = 0
 122812 		pRedo = uintptr(0)
 122813 		for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
 122814 			var pCol uintptr = (*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*24
 122815 			if int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_NOTAVAIL != 0 {
 122816 				var x int32
 122817 				*(*U16)(unsafe.Pointer(pCol + 16)) |= U16(COLFLAG_BUSY)
 122818 				(*Walker)(unsafe.Pointer(bp + 8)).FeCode = U16(0)
 122819 				Xsqlite3WalkExpr(tls, bp+8, Xsqlite3ColumnExpr(tls, pTab, pCol))
 122820 				*(*U16)(unsafe.Pointer(pCol + 16)) &= libc.Uint16FromInt32(libc.CplInt32(COLFLAG_BUSY))
 122821 				if int32((*Walker)(unsafe.Pointer(bp+8)).FeCode)&COLFLAG_NOTAVAIL != 0 {
 122822 					pRedo = pCol
 122823 					continue
 122824 				}
 122825 				eProgress = 1
 122826 
 122827 				x = int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(i))) + iRegStore
 122828 				Xsqlite3ExprCodeGeneratedColumn(tls, pParse, pTab, pCol, x)
 122829 				*(*U16)(unsafe.Pointer(pCol + 16)) &= libc.Uint16FromInt32(libc.CplInt32(COLFLAG_NOTAVAIL))
 122830 			}
 122831 		}
 122832 	}
 122833 	if pRedo != 0 {
 122834 		Xsqlite3ErrorMsg(tls, pParse, ts+9322, libc.VaList(bp, (*Column)(unsafe.Pointer(pRedo)).FzCnName))
 122835 	}
 122836 	(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = 0
 122837 }
 122838 
 122839 func autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) int32 {
 122840 	var memId int32 = 0
 122841 
 122842 	if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Autoincrement) != U32(0) &&
 122843 		(*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags&U32(DBFLAG_Vacuum) == U32(0) {
 122844 		var pToplevel uintptr = func() uintptr {
 122845 			if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
 122846 				return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
 122847 			}
 122848 			return pParse
 122849 		}()
 122850 		var pInfo uintptr
 122851 		var pSeqTab uintptr = (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32)).FpSchema)).FpSeqTab
 122852 
 122853 		if pSeqTab == uintptr(0) ||
 122854 			!((*Table)(unsafe.Pointer(pSeqTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) ||
 122855 			int32((*Table)(unsafe.Pointer(pSeqTab)).FeTabType) == TABTYP_VTAB ||
 122856 			int32((*Table)(unsafe.Pointer(pSeqTab)).FnCol) != 2 {
 122857 			(*Parse)(unsafe.Pointer(pParse)).FnErr++
 122858 			(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_CORRUPT | int32(2)<<8
 122859 			return 0
 122860 		}
 122861 
 122862 		pInfo = (*Parse)(unsafe.Pointer(pToplevel)).FpAinc
 122863 		for pInfo != 0 && (*AutoincInfo)(unsafe.Pointer(pInfo)).FpTab != pTab {
 122864 			pInfo = (*AutoincInfo)(unsafe.Pointer(pInfo)).FpNext
 122865 		}
 122866 		if pInfo == uintptr(0) {
 122867 			pInfo = Xsqlite3DbMallocRawNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(AutoincInfo{})))
 122868 			Xsqlite3ParserAddCleanup(tls, pToplevel, *(*uintptr)(unsafe.Pointer(&struct {
 122869 				f func(*libc.TLS, uintptr, uintptr)
 122870 			}{Xsqlite3DbFree})), pInfo)
 122871 
 122872 			if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 {
 122873 				return 0
 122874 			}
 122875 			(*AutoincInfo)(unsafe.Pointer(pInfo)).FpNext = (*Parse)(unsafe.Pointer(pToplevel)).FpAinc
 122876 			(*Parse)(unsafe.Pointer(pToplevel)).FpAinc = pInfo
 122877 			(*AutoincInfo)(unsafe.Pointer(pInfo)).FpTab = pTab
 122878 			(*AutoincInfo)(unsafe.Pointer(pInfo)).FiDb = iDb
 122879 			(*Parse)(unsafe.Pointer(pToplevel)).FnMem++
 122880 			(*AutoincInfo)(unsafe.Pointer(pInfo)).FregCtr = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pToplevel)).FnMem, 1)
 122881 			*(*int32)(unsafe.Pointer(pToplevel + 56)) += 2
 122882 		}
 122883 		memId = (*AutoincInfo)(unsafe.Pointer(pInfo)).FregCtr
 122884 	}
 122885 	return memId
 122886 }
 122887 
 122888 // This routine generates code that will initialize all of the
 122889 // register used by the autoincrement tracker.
 122890 func Xsqlite3AutoincrementBegin(tls *libc.TLS, pParse uintptr) {
 122891 	var p uintptr
 122892 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 122893 	var pDb uintptr
 122894 	var memId int32
 122895 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 122896 
 122897 	for p = (*Parse)(unsafe.Pointer(pParse)).FpAinc; p != 0; p = (*AutoincInfo)(unsafe.Pointer(p)).FpNext {
 122898 		var aOp uintptr
 122899 		pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*AutoincInfo)(unsafe.Pointer(p)).FiDb)*32
 122900 		memId = (*AutoincInfo)(unsafe.Pointer(p)).FregCtr
 122901 
 122902 		Xsqlite3OpenTable(tls, pParse, 0, (*AutoincInfo)(unsafe.Pointer(p)).FiDb, (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab, OP_OpenRead)
 122903 		Xsqlite3VdbeLoadString(tls, v, memId-1, (*Table)(unsafe.Pointer((*AutoincInfo)(unsafe.Pointer(p)).FpTab)).FzName)
 122904 		aOp = Xsqlite3VdbeAddOpList(tls, v, int32(uint64(unsafe.Sizeof(autoInc))/uint64(unsafe.Sizeof(VdbeOpList{}))), uintptr(unsafe.Pointer(&autoInc)), iLn1)
 122905 		if aOp == uintptr(0) {
 122906 			break
 122907 		}
 122908 		(*VdbeOp)(unsafe.Pointer(aOp)).Fp2 = memId
 122909 		(*VdbeOp)(unsafe.Pointer(aOp)).Fp3 = memId + 2
 122910 		(*VdbeOp)(unsafe.Pointer(aOp + 2*24)).Fp3 = memId
 122911 		(*VdbeOp)(unsafe.Pointer(aOp + 3*24)).Fp1 = memId - 1
 122912 		(*VdbeOp)(unsafe.Pointer(aOp + 3*24)).Fp3 = memId
 122913 		(*VdbeOp)(unsafe.Pointer(aOp + 3*24)).Fp5 = U16(SQLITE_JUMPIFNULL)
 122914 		(*VdbeOp)(unsafe.Pointer(aOp + 4*24)).Fp2 = memId + 1
 122915 		(*VdbeOp)(unsafe.Pointer(aOp + 5*24)).Fp3 = memId
 122916 		(*VdbeOp)(unsafe.Pointer(aOp + 6*24)).Fp1 = memId
 122917 		(*VdbeOp)(unsafe.Pointer(aOp + 7*24)).Fp2 = memId + 2
 122918 		(*VdbeOp)(unsafe.Pointer(aOp + 7*24)).Fp1 = memId
 122919 		(*VdbeOp)(unsafe.Pointer(aOp + 10*24)).Fp2 = memId
 122920 		if (*Parse)(unsafe.Pointer(pParse)).FnTab == 0 {
 122921 			(*Parse)(unsafe.Pointer(pParse)).FnTab = 1
 122922 		}
 122923 	}
 122924 }
 122925 
 122926 var iLn1 int32 = 0
 122927 var autoInc = [12]VdbeOpList{
 122928 	{Fopcode: U8(OP_Null)},
 122929 	{Fopcode: U8(OP_Rewind), Fp2: int8(10)},
 122930 	{Fopcode: U8(OP_Column)},
 122931 	{Fopcode: U8(OP_Ne), Fp2: int8(9)},
 122932 	{Fopcode: U8(OP_Rowid)},
 122933 	{Fopcode: U8(OP_Column), Fp2: int8(1)},
 122934 	{Fopcode: U8(OP_AddImm)},
 122935 	{Fopcode: U8(OP_Copy)},
 122936 	{Fopcode: U8(OP_Goto), Fp2: int8(11)},
 122937 	{Fopcode: U8(OP_Next), Fp2: int8(2)},
 122938 	{Fopcode: U8(OP_Integer)},
 122939 	{Fopcode: U8(OP_Close)},
 122940 }
 122941 
 122942 func autoIncStep(tls *libc.TLS, pParse uintptr, memId int32, regRowid int32) {
 122943 	if memId > 0 {
 122944 		Xsqlite3VdbeAddOp2(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, OP_MemMax, memId, regRowid)
 122945 	}
 122946 }
 122947 
 122948 func autoIncrementEnd(tls *libc.TLS, pParse uintptr) {
 122949 	var p uintptr
 122950 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 122951 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 122952 
 122953 	for p = (*Parse)(unsafe.Pointer(pParse)).FpAinc; p != 0; p = (*AutoincInfo)(unsafe.Pointer(p)).FpNext {
 122954 		var aOp uintptr
 122955 		var pDb uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*AutoincInfo)(unsafe.Pointer(p)).FiDb)*32
 122956 		var iRec int32
 122957 		var memId int32 = (*AutoincInfo)(unsafe.Pointer(p)).FregCtr
 122958 
 122959 		iRec = Xsqlite3GetTempReg(tls, pParse)
 122960 
 122961 		Xsqlite3VdbeAddOp3(tls, v, OP_Le, memId+2, Xsqlite3VdbeCurrentAddr(tls, v)+7, memId)
 122962 
 122963 		Xsqlite3OpenTable(tls, pParse, 0, (*AutoincInfo)(unsafe.Pointer(p)).FiDb, (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab, OP_OpenWrite)
 122964 		aOp = Xsqlite3VdbeAddOpList(tls, v, int32(uint64(unsafe.Sizeof(autoIncEnd))/uint64(unsafe.Sizeof(VdbeOpList{}))), uintptr(unsafe.Pointer(&autoIncEnd)), iLn2)
 122965 		if aOp == uintptr(0) {
 122966 			break
 122967 		}
 122968 		(*VdbeOp)(unsafe.Pointer(aOp)).Fp1 = memId + 1
 122969 		(*VdbeOp)(unsafe.Pointer(aOp + 1*24)).Fp2 = memId + 1
 122970 		(*VdbeOp)(unsafe.Pointer(aOp + 2*24)).Fp1 = memId - 1
 122971 		(*VdbeOp)(unsafe.Pointer(aOp + 2*24)).Fp3 = iRec
 122972 		(*VdbeOp)(unsafe.Pointer(aOp + 3*24)).Fp2 = iRec
 122973 		(*VdbeOp)(unsafe.Pointer(aOp + 3*24)).Fp3 = memId + 1
 122974 		(*VdbeOp)(unsafe.Pointer(aOp + 3*24)).Fp5 = U16(OPFLAG_APPEND)
 122975 		Xsqlite3ReleaseTempReg(tls, pParse, iRec)
 122976 	}
 122977 }
 122978 
 122979 var iLn2 int32 = 0
 122980 var autoIncEnd = [5]VdbeOpList{
 122981 	{Fopcode: U8(OP_NotNull), Fp2: int8(2)},
 122982 	{Fopcode: U8(OP_NewRowid)},
 122983 	{Fopcode: U8(OP_MakeRecord), Fp2: int8(2)},
 122984 	{Fopcode: U8(OP_Insert)},
 122985 	{Fopcode: U8(OP_Close)},
 122986 }
 122987 
 122988 func Xsqlite3AutoincrementEnd(tls *libc.TLS, pParse uintptr) {
 122989 	if (*Parse)(unsafe.Pointer(pParse)).FpAinc != 0 {
 122990 		autoIncrementEnd(tls, pParse)
 122991 	}
 122992 }
 122993 
 122994 // This routine is called to handle SQL of the following forms:
 122995 //
 122996 //	insert into TABLE (IDLIST) values(EXPRLIST),(EXPRLIST),...
 122997 //	insert into TABLE (IDLIST) select
 122998 //	insert into TABLE (IDLIST) default values
 122999 //
 123000 // The IDLIST following the table name is always optional.  If omitted,
 123001 // then a list of all (non-hidden) columns for the table is substituted.
 123002 // The IDLIST appears in the pColumn parameter.  pColumn is NULL if IDLIST
 123003 // is omitted.
 123004 //
 123005 // For the pSelect parameter holds the values to be inserted for the
 123006 // first two forms shown above.  A VALUES clause is really just short-hand
 123007 // for a SELECT statement that omits the FROM clause and everything else
 123008 // that follows.  If the pSelect parameter is NULL, that means that the
 123009 // DEFAULT VALUES form of the INSERT statement is intended.
 123010 //
 123011 // The code generated follows one of four templates.  For a simple
 123012 // insert with data coming from a single-row VALUES clause, the code executes
 123013 // once straight down through.  Pseudo-code follows (we call this
 123014 // the "1st template"):
 123015 //
 123016 //	open write cursor to <table> and its indices
 123017 //	put VALUES clause expressions into registers
 123018 //	write the resulting record into <table>
 123019 //	cleanup
 123020 //
 123021 // The three remaining templates assume the statement is of the form
 123022 //
 123023 //	INSERT INTO <table> SELECT ...
 123024 //
 123025 // If the SELECT clause is of the restricted form "SELECT * FROM <table2>" -
 123026 // in other words if the SELECT pulls all columns from a single table
 123027 // and there is no WHERE or LIMIT or GROUP BY or ORDER BY clauses, and
 123028 // if <table2> and <table1> are distinct tables but have identical
 123029 // schemas, including all the same indices, then a special optimization
 123030 // is invoked that copies raw records from <table2> over to <table1>.
 123031 // See the xferOptimization() function for the implementation of this
 123032 // template.  This is the 2nd template.
 123033 //
 123034 //	open a write cursor to <table>
 123035 //	open read cursor on <table2>
 123036 //	transfer all records in <table2> over to <table>
 123037 //	close cursors
 123038 //	foreach index on <table>
 123039 //	  open a write cursor on the <table> index
 123040 //	  open a read cursor on the corresponding <table2> index
 123041 //	  transfer all records from the read to the write cursors
 123042 //	  close cursors
 123043 //	end foreach
 123044 //
 123045 // The 3rd template is for when the second template does not apply
 123046 // and the SELECT clause does not read from <table> at any time.
 123047 // The generated code follows this template:
 123048 //
 123049 //	   X <- A
 123050 //	   goto B
 123051 //	A: setup for the SELECT
 123052 //	   loop over the rows in the SELECT
 123053 //	     load values into registers R..R+n
 123054 //	     yield X
 123055 //	   end loop
 123056 //	   cleanup after the SELECT
 123057 //	   end-coroutine X
 123058 //	B: open write cursor to <table> and its indices
 123059 //	C: yield X, at EOF goto D
 123060 //	   insert the select result into <table> from R..R+n
 123061 //	   goto C
 123062 //	D: cleanup
 123063 //
 123064 // The 4th template is used if the insert statement takes its
 123065 // values from a SELECT but the data is being inserted into a table
 123066 // that is also read as part of the SELECT.  In the third form,
 123067 // we have to use an intermediate table to store the results of
 123068 // the select.  The template is like this:
 123069 //
 123070 //	   X <- A
 123071 //	   goto B
 123072 //	A: setup for the SELECT
 123073 //	   loop over the tables in the SELECT
 123074 //	     load value into register R..R+n
 123075 //	     yield X
 123076 //	   end loop
 123077 //	   cleanup after the SELECT
 123078 //	   end co-routine R
 123079 //	B: open temp table
 123080 //	L: yield X, at EOF goto M
 123081 //	   insert row from R..R+n into temp table
 123082 //	   goto L
 123083 //	M: open write cursor to <table> and its indices
 123084 //	   rewind temp table
 123085 //	C: loop over rows of intermediate table
 123086 //	     transfer values form intermediate table into <table>
 123087 //	   end loop
 123088 //	D: cleanup
 123089 func Xsqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) {
 123090 	bp := tls.Alloc(188)
 123091 	defer tls.Free(188)
 123092 
 123093 	var db uintptr
 123094 	var pTab uintptr
 123095 	var i int32
 123096 	var j int32
 123097 	var v uintptr
 123098 	var pIdx uintptr
 123099 	var nColumn int32
 123100 	var nHidden int32
 123101 
 123102 	var ipkColumn int32
 123103 	var endOfLoop int32
 123104 	var srcTab int32
 123105 	var addrInsTop int32
 123106 	var addrCont int32
 123107 
 123108 	var iDb int32
 123109 	var useTempTable U8
 123110 	var appendFlag U8
 123111 	var withoutRowid U8
 123112 	var bIdListInOrder U8
 123113 	var pList uintptr
 123114 	var iRegStore int32
 123115 
 123116 	var regFromSelect int32
 123117 	var regAutoinc int32
 123118 	var regRowCount int32
 123119 	var regIns int32
 123120 	var regRowid int32
 123121 	var regData int32
 123122 	var aRegIdx uintptr
 123123 
 123124 	var isView int32
 123125 	var pTrigger uintptr
 123126 
 123127 	var regRec int32
 123128 	var regTempRowid int32
 123129 	var addrL int32
 123130 
 123131 	var regYield int32
 123132 	var addrTop int32
 123133 	var rc int32
 123134 
 123135 	var nIdx int32
 123136 	var pNx uintptr
 123137 	var pX uintptr
 123138 	var y int32
 123139 	var k int32
 123140 	var colFlags U32
 123141 	var addr1 int32
 123142 	var regCols int32
 123143 	var pIpk uintptr
 123144 	var addr11 int32
 123145 	var pVTab uintptr
 123146 
 123147 	var bUseSeek int32
 123148 	nHidden = 0
 123149 	*(*int32)(unsafe.Pointer(bp + 176)) = 0
 123150 	*(*int32)(unsafe.Pointer(bp + 180)) = 0
 123151 	ipkColumn = -1
 123152 	srcTab = 0
 123153 	addrInsTop = 0
 123154 	addrCont = 0
 123155 	useTempTable = U8(0)
 123156 	appendFlag = U8(0)
 123157 	pList = uintptr(0)
 123158 	regFromSelect = 0
 123159 	regAutoinc = 0
 123160 	regRowCount = 0
 123161 	aRegIdx = uintptr(0)
 123162 
 123163 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 123164 
 123165 	if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
 123166 		goto __1
 123167 	}
 123168 	goto insert_cleanup
 123169 __1:
 123170 	;
 123171 	(*SelectDest)(unsafe.Pointer(bp + 80)).FiSDParm = 0
 123172 
 123173 	if !(pSelect != 0 && (*Select)(unsafe.Pointer(pSelect)).FselFlags&U32(SF_Values) != U32(0) && (*Select)(unsafe.Pointer(pSelect)).FpPrior == uintptr(0)) {
 123174 		goto __2
 123175 	}
 123176 	pList = (*Select)(unsafe.Pointer(pSelect)).FpEList
 123177 	(*Select)(unsafe.Pointer(pSelect)).FpEList = uintptr(0)
 123178 	Xsqlite3SelectDelete(tls, db, pSelect)
 123179 	pSelect = uintptr(0)
 123180 __2:
 123181 	;
 123182 	pTab = Xsqlite3SrcListLookup(tls, pParse, pTabList)
 123183 	if !(pTab == uintptr(0)) {
 123184 		goto __3
 123185 	}
 123186 	goto insert_cleanup
 123187 __3:
 123188 	;
 123189 	iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
 123190 
 123191 	if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_INSERT, (*Table)(unsafe.Pointer(pTab)).FzName, uintptr(0),
 123192 		(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName) != 0) {
 123193 		goto __4
 123194 	}
 123195 	goto insert_cleanup
 123196 __4:
 123197 	;
 123198 	withoutRowid = libc.BoolUint8(!((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)))
 123199 
 123200 	pTrigger = Xsqlite3TriggersExist(tls, pParse, pTab, TK_INSERT, uintptr(0), bp+72)
 123201 	isView = libc.Bool32(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW)
 123202 
 123203 	if !(Xsqlite3ViewGetColumnNames(tls, pParse, pTab) != 0) {
 123204 		goto __5
 123205 	}
 123206 	goto insert_cleanup
 123207 __5:
 123208 	;
 123209 	if !(Xsqlite3IsReadOnly(tls, pParse, pTab, *(*int32)(unsafe.Pointer(bp + 72))) != 0) {
 123210 		goto __6
 123211 	}
 123212 	goto insert_cleanup
 123213 __6:
 123214 	;
 123215 	v = Xsqlite3GetVdbe(tls, pParse)
 123216 	if !(v == uintptr(0)) {
 123217 		goto __7
 123218 	}
 123219 	goto insert_cleanup
 123220 __7:
 123221 	;
 123222 	if !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) {
 123223 		goto __8
 123224 	}
 123225 	Xsqlite3VdbeCountChanges(tls, v)
 123226 __8:
 123227 	;
 123228 	Xsqlite3BeginWriteOperation(tls, pParse, libc.Bool32(pSelect != 0 || pTrigger != 0), iDb)
 123229 
 123230 	if !(pColumn == uintptr(0) &&
 123231 		pSelect != uintptr(0) &&
 123232 		pTrigger == uintptr(0) &&
 123233 		xferOptimization(tls, pParse, pTab, pSelect, onError, iDb) != 0) {
 123234 		goto __9
 123235 	}
 123236 
 123237 	goto insert_end
 123238 __9:
 123239 	;
 123240 	regAutoinc = autoIncBegin(tls, pParse, iDb, pTab)
 123241 
 123242 	regRowid = libc.AssignInt32(&regIns, (*Parse)(unsafe.Pointer(pParse)).FnMem+1)
 123243 	*(*int32)(unsafe.Pointer(pParse + 56)) += int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 1
 123244 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
 123245 		goto __10
 123246 	}
 123247 	regRowid++
 123248 	(*Parse)(unsafe.Pointer(pParse)).FnMem++
 123249 __10:
 123250 	;
 123251 	regData = regRowid + 1
 123252 
 123253 	bIdListInOrder = U8(libc.Bool32((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_OOOHidden|TF_HasStored) == U32(0)))
 123254 	if !(pColumn != 0) {
 123255 		goto __11
 123256 	}
 123257 
 123258 	(*IdList)(unsafe.Pointer(pColumn)).FeU4 = U8(EU4_IDX)
 123259 	i = 0
 123260 __12:
 123261 	if !(i < (*IdList)(unsafe.Pointer(pColumn)).FnId) {
 123262 		goto __14
 123263 	}
 123264 	*(*int32)(unsafe.Pointer(pColumn + 8 + uintptr(i)*16 + 8)) = -1
 123265 	goto __13
 123266 __13:
 123267 	i++
 123268 	goto __12
 123269 	goto __14
 123270 __14:
 123271 	;
 123272 	i = 0
 123273 __15:
 123274 	if !(i < (*IdList)(unsafe.Pointer(pColumn)).FnId) {
 123275 		goto __17
 123276 	}
 123277 	j = 0
 123278 __18:
 123279 	if !(j < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 123280 		goto __20
 123281 	}
 123282 	if !(Xsqlite3StrICmp(tls, (*IdList_item)(unsafe.Pointer(pColumn+8+uintptr(i)*16)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*24)).FzCnName) == 0) {
 123283 		goto __21
 123284 	}
 123285 	*(*int32)(unsafe.Pointer(pColumn + 8 + uintptr(i)*16 + 8)) = j
 123286 	if !(i != j) {
 123287 		goto __22
 123288 	}
 123289 	bIdListInOrder = U8(0)
 123290 __22:
 123291 	;
 123292 	if !(j == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) {
 123293 		goto __23
 123294 	}
 123295 	ipkColumn = i
 123296 __23:
 123297 	;
 123298 	if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*24)).FcolFlags)&(COLFLAG_STORED|COLFLAG_VIRTUAL) != 0) {
 123299 		goto __24
 123300 	}
 123301 	Xsqlite3ErrorMsg(tls, pParse,
 123302 		ts+17014,
 123303 		libc.VaList(bp, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*24)).FzCnName))
 123304 	goto insert_cleanup
 123305 __24:
 123306 	;
 123307 	goto __20
 123308 __21:
 123309 	;
 123310 	goto __19
 123311 __19:
 123312 	j++
 123313 	goto __18
 123314 	goto __20
 123315 __20:
 123316 	;
 123317 	if !(j >= int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 123318 		goto __25
 123319 	}
 123320 	if !(Xsqlite3IsRowid(tls, (*IdList_item)(unsafe.Pointer(pColumn+8+uintptr(i)*16)).FzName) != 0 && !(withoutRowid != 0)) {
 123321 		goto __26
 123322 	}
 123323 	ipkColumn = i
 123324 	bIdListInOrder = U8(0)
 123325 	goto __27
 123326 __26:
 123327 	Xsqlite3ErrorMsg(tls, pParse, ts+17055,
 123328 		libc.VaList(bp+8, pTabList+8, (*IdList_item)(unsafe.Pointer(pColumn+8+uintptr(i)*16)).FzName))
 123329 	(*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1)
 123330 	goto insert_cleanup
 123331 __27:
 123332 	;
 123333 __25:
 123334 	;
 123335 	goto __16
 123336 __16:
 123337 	i++
 123338 	goto __15
 123339 	goto __17
 123340 __17:
 123341 	;
 123342 __11:
 123343 	;
 123344 	if !(pSelect != 0) {
 123345 		goto __28
 123346 	}
 123347 
 123348 	regYield = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 123349 	addrTop = Xsqlite3VdbeCurrentAddr(tls, v) + 1
 123350 	Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regYield, 0, addrTop)
 123351 	Xsqlite3SelectDestInit(tls, bp+80, SRT_Coroutine, regYield)
 123352 	(*SelectDest)(unsafe.Pointer(bp + 80)).FiSdst = func() int32 {
 123353 		if bIdListInOrder != 0 {
 123354 			return regData
 123355 		}
 123356 		return 0
 123357 	}()
 123358 	(*SelectDest)(unsafe.Pointer(bp + 80)).FnSdst = int32((*Table)(unsafe.Pointer(pTab)).FnCol)
 123359 	rc = Xsqlite3Select(tls, pParse, pSelect, bp+80)
 123360 	regFromSelect = (*SelectDest)(unsafe.Pointer(bp + 80)).FiSdst
 123361 
 123362 	if !(rc != 0 || (*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
 123363 		goto __30
 123364 	}
 123365 	goto insert_cleanup
 123366 __30:
 123367 	;
 123368 	Xsqlite3VdbeEndCoroutine(tls, v, regYield)
 123369 	Xsqlite3VdbeJumpHere(tls, v, addrTop-1)
 123370 
 123371 	nColumn = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpEList)).FnExpr
 123372 
 123373 	if !(pTrigger != 0 || readsTable(tls, pParse, iDb, pTab) != 0) {
 123374 		goto __31
 123375 	}
 123376 	useTempTable = U8(1)
 123377 __31:
 123378 	;
 123379 	if !(useTempTable != 0) {
 123380 		goto __32
 123381 	}
 123382 
 123383 	srcTab = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 123384 	regRec = Xsqlite3GetTempReg(tls, pParse)
 123385 	regTempRowid = Xsqlite3GetTempReg(tls, pParse)
 123386 	Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, srcTab, nColumn)
 123387 	addrL = Xsqlite3VdbeAddOp1(tls, v, OP_Yield, (*SelectDest)(unsafe.Pointer(bp+80)).FiSDParm)
 123388 	Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regFromSelect, nColumn, regRec)
 123389 	Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, srcTab, regTempRowid)
 123390 	Xsqlite3VdbeAddOp3(tls, v, OP_Insert, srcTab, regRec, regTempRowid)
 123391 	Xsqlite3VdbeGoto(tls, v, addrL)
 123392 	Xsqlite3VdbeJumpHere(tls, v, addrL)
 123393 	Xsqlite3ReleaseTempReg(tls, pParse, regRec)
 123394 	Xsqlite3ReleaseTempReg(tls, pParse, regTempRowid)
 123395 __32:
 123396 	;
 123397 	goto __29
 123398 __28:
 123399 	libc.Xmemset(tls, bp+120, 0, uint64(unsafe.Sizeof(NameContext{})))
 123400 	(*NameContext)(unsafe.Pointer(bp + 120)).FpParse = pParse
 123401 	srcTab = -1
 123402 
 123403 	if !(pList != 0) {
 123404 		goto __33
 123405 	}
 123406 	nColumn = (*ExprList)(unsafe.Pointer(pList)).FnExpr
 123407 	if !(Xsqlite3ResolveExprListNames(tls, bp+120, pList) != 0) {
 123408 		goto __35
 123409 	}
 123410 	goto insert_cleanup
 123411 __35:
 123412 	;
 123413 	goto __34
 123414 __33:
 123415 	nColumn = 0
 123416 __34:
 123417 	;
 123418 __29:
 123419 	;
 123420 	if !(pColumn == uintptr(0) && nColumn > 0) {
 123421 		goto __36
 123422 	}
 123423 	ipkColumn = int32((*Table)(unsafe.Pointer(pTab)).FiPKey)
 123424 	if !(ipkColumn >= 0 && (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasGenerated) != U32(0)) {
 123425 		goto __37
 123426 	}
 123427 
 123428 	i = ipkColumn - 1
 123429 __38:
 123430 	if !(i >= 0) {
 123431 		goto __40
 123432 	}
 123433 	if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24)).FcolFlags)&COLFLAG_GENERATED != 0) {
 123434 		goto __41
 123435 	}
 123436 
 123437 	ipkColumn--
 123438 __41:
 123439 	;
 123440 	goto __39
 123441 __39:
 123442 	i--
 123443 	goto __38
 123444 	goto __40
 123445 __40:
 123446 	;
 123447 __37:
 123448 	;
 123449 	if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasGenerated|TF_HasHidden) != U32(0)) {
 123450 		goto __42
 123451 	}
 123452 	i = 0
 123453 __43:
 123454 	if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 123455 		goto __45
 123456 	}
 123457 	if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24)).FcolFlags)&COLFLAG_NOINSERT != 0) {
 123458 		goto __46
 123459 	}
 123460 	nHidden++
 123461 __46:
 123462 	;
 123463 	goto __44
 123464 __44:
 123465 	i++
 123466 	goto __43
 123467 	goto __45
 123468 __45:
 123469 	;
 123470 __42:
 123471 	;
 123472 	if !(nColumn != int32((*Table)(unsafe.Pointer(pTab)).FnCol)-nHidden) {
 123473 		goto __47
 123474 	}
 123475 	Xsqlite3ErrorMsg(tls, pParse,
 123476 		ts+17087,
 123477 		libc.VaList(bp+24, pTabList+8, int32((*Table)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn))
 123478 	goto insert_cleanup
 123479 __47:
 123480 	;
 123481 __36:
 123482 	;
 123483 	if !(pColumn != uintptr(0) && nColumn != (*IdList)(unsafe.Pointer(pColumn)).FnId) {
 123484 		goto __48
 123485 	}
 123486 	Xsqlite3ErrorMsg(tls, pParse, ts+17139, libc.VaList(bp+48, nColumn, (*IdList)(unsafe.Pointer(pColumn)).FnId))
 123487 	goto insert_cleanup
 123488 __48:
 123489 	;
 123490 	if !((*Sqlite3)(unsafe.Pointer(db)).Fflags&(uint64(0x00001)<<32) != uint64(0) &&
 123491 		!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) &&
 123492 		!(int32((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0) &&
 123493 		!(int32((*Parse)(unsafe.Pointer(pParse)).FbReturning) != 0)) {
 123494 		goto __49
 123495 	}
 123496 	regRowCount = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 123497 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regRowCount)
 123498 __49:
 123499 	;
 123500 	if !!(isView != 0) {
 123501 		goto __50
 123502 	}
 123503 	nIdx = Xsqlite3OpenTableAndIndices(tls, pParse, pTab, OP_OpenWrite, uint8(0), -1, uintptr(0),
 123504 		bp+176, bp+180)
 123505 	aRegIdx = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(int32(0)))*uint64(nIdx+2))
 123506 	if !(aRegIdx == uintptr(0)) {
 123507 		goto __51
 123508 	}
 123509 	goto insert_cleanup
 123510 __51:
 123511 	;
 123512 	i = 0
 123513 	pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex
 123514 __52:
 123515 	if !(i < nIdx) {
 123516 		goto __54
 123517 	}
 123518 
 123519 	*(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 123520 	*(*int32)(unsafe.Pointer(pParse + 56)) += int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
 123521 	goto __53
 123522 __53:
 123523 	pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
 123524 	i++
 123525 	goto __52
 123526 	goto __54
 123527 __54:
 123528 	;
 123529 	*(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 123530 __50:
 123531 	;
 123532 	if !(pUpsert != 0) {
 123533 		goto __55
 123534 	}
 123535 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
 123536 		goto __56
 123537 	}
 123538 	Xsqlite3ErrorMsg(tls, pParse, ts+17164,
 123539 		libc.VaList(bp+64, (*Table)(unsafe.Pointer(pTab)).FzName))
 123540 	goto insert_cleanup
 123541 __56:
 123542 	;
 123543 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW) {
 123544 		goto __57
 123545 	}
 123546 	Xsqlite3ErrorMsg(tls, pParse, ts+17210, 0)
 123547 	goto insert_cleanup
 123548 __57:
 123549 	;
 123550 	if !(Xsqlite3HasExplicitNulls(tls, pParse, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget) != 0) {
 123551 		goto __58
 123552 	}
 123553 	goto insert_cleanup
 123554 __58:
 123555 	;
 123556 	(*SrcItem)(unsafe.Pointer(pTabList + 8)).FiCursor = *(*int32)(unsafe.Pointer(bp + 176))
 123557 	pNx = pUpsert
 123558 __59:
 123559 	(*Upsert)(unsafe.Pointer(pNx)).FpUpsertSrc = pTabList
 123560 	(*Upsert)(unsafe.Pointer(pNx)).FregData = regData
 123561 	(*Upsert)(unsafe.Pointer(pNx)).FiDataCur = *(*int32)(unsafe.Pointer(bp + 176))
 123562 	(*Upsert)(unsafe.Pointer(pNx)).FiIdxCur = *(*int32)(unsafe.Pointer(bp + 180))
 123563 	if !((*Upsert)(unsafe.Pointer(pNx)).FpUpsertTarget != 0) {
 123564 		goto __62
 123565 	}
 123566 	if !(Xsqlite3UpsertAnalyzeTarget(tls, pParse, pTabList, pNx) != 0) {
 123567 		goto __63
 123568 	}
 123569 	goto insert_cleanup
 123570 __63:
 123571 	;
 123572 __62:
 123573 	;
 123574 	pNx = (*Upsert)(unsafe.Pointer(pNx)).FpNextUpsert
 123575 	goto __60
 123576 __60:
 123577 	if pNx != uintptr(0) {
 123578 		goto __59
 123579 	}
 123580 	goto __61
 123581 __61:
 123582 	;
 123583 __55:
 123584 	;
 123585 	if !(useTempTable != 0) {
 123586 		goto __64
 123587 	}
 123588 
 123589 	addrInsTop = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, srcTab)
 123590 	addrCont = Xsqlite3VdbeCurrentAddr(tls, v)
 123591 	goto __65
 123592 __64:
 123593 	if !(pSelect != 0) {
 123594 		goto __66
 123595 	}
 123596 
 123597 	addrInsTop = libc.AssignInt32(&addrCont, Xsqlite3VdbeAddOp1(tls, v, OP_Yield, (*SelectDest)(unsafe.Pointer(bp+80)).FiSDParm))
 123598 
 123599 	if !(ipkColumn >= 0) {
 123600 		goto __67
 123601 	}
 123602 
 123603 	Xsqlite3VdbeAddOp2(tls, v, OP_Copy, regFromSelect+ipkColumn, regRowid)
 123604 __67:
 123605 	;
 123606 __66:
 123607 	;
 123608 __65:
 123609 	;
 123610 	nHidden = 0
 123611 	iRegStore = regData
 123612 	i = 0
 123613 __68:
 123614 	if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 123615 		goto __70
 123616 	}
 123617 
 123618 	if !(i == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) {
 123619 		goto __71
 123620 	}
 123621 
 123622 	Xsqlite3VdbeAddOp1(tls, v, OP_SoftNull, iRegStore)
 123623 	goto __69
 123624 __71:
 123625 	;
 123626 	if !(libc.AssignUint32(&colFlags, U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24)).FcolFlags))&U32(COLFLAG_NOINSERT) != U32(0)) {
 123627 		goto __72
 123628 	}
 123629 	nHidden++
 123630 	if !(colFlags&U32(COLFLAG_VIRTUAL) != U32(0)) {
 123631 		goto __73
 123632 	}
 123633 
 123634 	iRegStore--
 123635 	goto __69
 123636 	goto __74
 123637 __73:
 123638 	if !(colFlags&U32(COLFLAG_STORED) != U32(0)) {
 123639 		goto __75
 123640 	}
 123641 
 123642 	if !(*(*int32)(unsafe.Pointer(bp + 72))&TRIGGER_BEFORE != 0) {
 123643 		goto __77
 123644 	}
 123645 	Xsqlite3VdbeAddOp1(tls, v, OP_SoftNull, iRegStore)
 123646 __77:
 123647 	;
 123648 	goto __69
 123649 	goto __76
 123650 __75:
 123651 	if !(pColumn == uintptr(0)) {
 123652 		goto __78
 123653 	}
 123654 
 123655 	Xsqlite3ExprCodeFactorable(tls, pParse,
 123656 		Xsqlite3ColumnExpr(tls, pTab, (*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24),
 123657 		iRegStore)
 123658 	goto __69
 123659 __78:
 123660 	;
 123661 __76:
 123662 	;
 123663 __74:
 123664 	;
 123665 __72:
 123666 	;
 123667 	if !(pColumn != 0) {
 123668 		goto __79
 123669 	}
 123670 
 123671 	j = 0
 123672 __81:
 123673 	if !(j < (*IdList)(unsafe.Pointer(pColumn)).FnId && *(*int32)(unsafe.Pointer(pColumn + 8 + uintptr(j)*16 + 8)) != i) {
 123674 		goto __83
 123675 	}
 123676 	goto __82
 123677 __82:
 123678 	j++
 123679 	goto __81
 123680 	goto __83
 123681 __83:
 123682 	;
 123683 	if !(j >= (*IdList)(unsafe.Pointer(pColumn)).FnId) {
 123684 		goto __84
 123685 	}
 123686 
 123687 	Xsqlite3ExprCodeFactorable(tls, pParse,
 123688 		Xsqlite3ColumnExpr(tls, pTab, (*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24),
 123689 		iRegStore)
 123690 	goto __69
 123691 __84:
 123692 	;
 123693 	k = j
 123694 	goto __80
 123695 __79:
 123696 	if !(nColumn == 0) {
 123697 		goto __85
 123698 	}
 123699 
 123700 	Xsqlite3ExprCodeFactorable(tls, pParse,
 123701 		Xsqlite3ColumnExpr(tls, pTab, (*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24),
 123702 		iRegStore)
 123703 	goto __69
 123704 	goto __86
 123705 __85:
 123706 	k = i - nHidden
 123707 __86:
 123708 	;
 123709 __80:
 123710 	;
 123711 	if !(useTempTable != 0) {
 123712 		goto __87
 123713 	}
 123714 	Xsqlite3VdbeAddOp3(tls, v, OP_Column, srcTab, k, iRegStore)
 123715 	goto __88
 123716 __87:
 123717 	if !(pSelect != 0) {
 123718 		goto __89
 123719 	}
 123720 	if !(regFromSelect != regData) {
 123721 		goto __91
 123722 	}
 123723 	Xsqlite3VdbeAddOp2(tls, v, OP_SCopy, regFromSelect+k, iRegStore)
 123724 __91:
 123725 	;
 123726 	goto __90
 123727 __89:
 123728 	pX = (*ExprList_item)(unsafe.Pointer(pList + 8 + uintptr(k)*32)).FpExpr
 123729 	y = Xsqlite3ExprCodeTarget(tls, pParse, pX, iRegStore)
 123730 	if !(y != iRegStore) {
 123731 		goto __92
 123732 	}
 123733 	Xsqlite3VdbeAddOp2(tls, v,
 123734 		func() int32 {
 123735 			if (*Expr)(unsafe.Pointer(pX)).Fflags&U32(EP_Subquery) != U32(0) {
 123736 				return OP_Copy
 123737 			}
 123738 			return OP_SCopy
 123739 		}(), y, iRegStore)
 123740 __92:
 123741 	;
 123742 __90:
 123743 	;
 123744 __88:
 123745 	;
 123746 	goto __69
 123747 __69:
 123748 	i++
 123749 	iRegStore++
 123750 	goto __68
 123751 	goto __70
 123752 __70:
 123753 	;
 123754 	endOfLoop = Xsqlite3VdbeMakeLabel(tls, pParse)
 123755 	if !(*(*int32)(unsafe.Pointer(bp + 72))&TRIGGER_BEFORE != 0) {
 123756 		goto __93
 123757 	}
 123758 	regCols = Xsqlite3GetTempRange(tls, pParse, int32((*Table)(unsafe.Pointer(pTab)).FnCol)+1)
 123759 
 123760 	if !(ipkColumn < 0) {
 123761 		goto __94
 123762 	}
 123763 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, -1, regCols)
 123764 	goto __95
 123765 __94:
 123766 	;
 123767 	if !(useTempTable != 0) {
 123768 		goto __96
 123769 	}
 123770 	Xsqlite3VdbeAddOp3(tls, v, OP_Column, srcTab, ipkColumn, regCols)
 123771 	goto __97
 123772 __96:
 123773 	;
 123774 	Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(ipkColumn)*32)).FpExpr, regCols)
 123775 __97:
 123776 	;
 123777 	addr1 = Xsqlite3VdbeAddOp1(tls, v, OP_NotNull, regCols)
 123778 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, -1, regCols)
 123779 	Xsqlite3VdbeJumpHere(tls, v, addr1)
 123780 	Xsqlite3VdbeAddOp1(tls, v, OP_MustBeInt, regCols)
 123781 __95:
 123782 	;
 123783 	Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regRowid+1, regCols+1, int32((*Table)(unsafe.Pointer(pTab)).FnNVCol)-1)
 123784 
 123785 	if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasGenerated) != 0) {
 123786 		goto __98
 123787 	}
 123788 
 123789 	Xsqlite3ComputeGeneratedColumns(tls, pParse, regCols+1, pTab)
 123790 __98:
 123791 	;
 123792 	if !!(isView != 0) {
 123793 		goto __99
 123794 	}
 123795 	Xsqlite3TableAffinity(tls, v, pTab, regCols+1)
 123796 __99:
 123797 	;
 123798 	Xsqlite3CodeRowTrigger(tls, pParse, pTrigger, TK_INSERT, uintptr(0), TRIGGER_BEFORE,
 123799 		pTab, regCols-int32((*Table)(unsafe.Pointer(pTab)).FnCol)-1, onError, endOfLoop)
 123800 
 123801 	Xsqlite3ReleaseTempRange(tls, pParse, regCols, int32((*Table)(unsafe.Pointer(pTab)).FnCol)+1)
 123802 __93:
 123803 	;
 123804 	if !!(isView != 0) {
 123805 		goto __100
 123806 	}
 123807 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
 123808 		goto __101
 123809 	}
 123810 
 123811 	Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regIns)
 123812 __101:
 123813 	;
 123814 	if !(ipkColumn >= 0) {
 123815 		goto __102
 123816 	}
 123817 
 123818 	if !(useTempTable != 0) {
 123819 		goto __104
 123820 	}
 123821 	Xsqlite3VdbeAddOp3(tls, v, OP_Column, srcTab, ipkColumn, regRowid)
 123822 	goto __105
 123823 __104:
 123824 	if !(pSelect != 0) {
 123825 		goto __106
 123826 	}
 123827 
 123828 	goto __107
 123829 __106:
 123830 	pIpk = (*ExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ipkColumn)*32)).FpExpr
 123831 	if !(int32((*Expr)(unsafe.Pointer(pIpk)).Fop) == TK_NULL && !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB)) {
 123832 		goto __108
 123833 	}
 123834 	Xsqlite3VdbeAddOp3(tls, v, OP_NewRowid, *(*int32)(unsafe.Pointer(bp + 176)), regRowid, regAutoinc)
 123835 	appendFlag = U8(1)
 123836 	goto __109
 123837 __108:
 123838 	Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(ipkColumn)*32)).FpExpr, regRowid)
 123839 __109:
 123840 	;
 123841 __107:
 123842 	;
 123843 __105:
 123844 	;
 123845 	if !!(appendFlag != 0) {
 123846 		goto __110
 123847 	}
 123848 	if !!(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
 123849 		goto __111
 123850 	}
 123851 	addr11 = Xsqlite3VdbeAddOp1(tls, v, OP_NotNull, regRowid)
 123852 	Xsqlite3VdbeAddOp3(tls, v, OP_NewRowid, *(*int32)(unsafe.Pointer(bp + 176)), regRowid, regAutoinc)
 123853 	Xsqlite3VdbeJumpHere(tls, v, addr11)
 123854 	goto __112
 123855 __111:
 123856 	addr11 = Xsqlite3VdbeCurrentAddr(tls, v)
 123857 	Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, regRowid, addr11+2)
 123858 __112:
 123859 	;
 123860 	Xsqlite3VdbeAddOp1(tls, v, OP_MustBeInt, regRowid)
 123861 __110:
 123862 	;
 123863 	goto __103
 123864 __102:
 123865 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB || withoutRowid != 0) {
 123866 		goto __113
 123867 	}
 123868 	Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regRowid)
 123869 	goto __114
 123870 __113:
 123871 	Xsqlite3VdbeAddOp3(tls, v, OP_NewRowid, *(*int32)(unsafe.Pointer(bp + 176)), regRowid, regAutoinc)
 123872 	appendFlag = U8(1)
 123873 __114:
 123874 	;
 123875 __103:
 123876 	;
 123877 	autoIncStep(tls, pParse, regAutoinc, regRowid)
 123878 
 123879 	if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasGenerated) != 0) {
 123880 		goto __115
 123881 	}
 123882 	Xsqlite3ComputeGeneratedColumns(tls, pParse, regRowid+1, pTab)
 123883 __115:
 123884 	;
 123885 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
 123886 		goto __116
 123887 	}
 123888 	pVTab = Xsqlite3GetVTable(tls, db, pTab)
 123889 	Xsqlite3VtabMakeWritable(tls, pParse, pTab)
 123890 	Xsqlite3VdbeAddOp4(tls, v, OP_VUpdate, 1, int32((*Table)(unsafe.Pointer(pTab)).FnCol)+2, regIns, pVTab, -11)
 123891 	Xsqlite3VdbeChangeP5(tls, v, func() uint16 {
 123892 		if onError == OE_Default {
 123893 			return uint16(OE_Abort)
 123894 		}
 123895 		return uint16(onError)
 123896 	}())
 123897 	Xsqlite3MayAbort(tls, pParse)
 123898 	goto __117
 123899 __116:
 123900 	*(*int32)(unsafe.Pointer(bp + 184)) = 0
 123901 	Xsqlite3GenerateConstraintChecks(tls, pParse, pTab, aRegIdx, *(*int32)(unsafe.Pointer(bp + 176)), *(*int32)(unsafe.Pointer(bp + 180)),
 123902 		regIns, 0, uint8(libc.Bool32(ipkColumn >= 0)), uint8(onError), endOfLoop, bp+184, uintptr(0), pUpsert)
 123903 	if !((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ForeignKeys) != 0) {
 123904 		goto __118
 123905 	}
 123906 	Xsqlite3FkCheck(tls, pParse, pTab, 0, regIns, uintptr(0), 0)
 123907 __118:
 123908 	;
 123909 	bUseSeek = libc.Bool32(*(*int32)(unsafe.Pointer(bp + 184)) == 0 || !(Xsqlite3VdbeHasSubProgram(tls, v) != 0))
 123910 	Xsqlite3CompleteInsertion(tls, pParse, pTab, *(*int32)(unsafe.Pointer(bp + 176)), *(*int32)(unsafe.Pointer(bp + 180)),
 123911 		regIns, aRegIdx, 0, int32(appendFlag), bUseSeek)
 123912 __117:
 123913 	;
 123914 __100:
 123915 	;
 123916 	if !(regRowCount != 0) {
 123917 		goto __119
 123918 	}
 123919 	Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, regRowCount, 1)
 123920 __119:
 123921 	;
 123922 	if !(pTrigger != 0) {
 123923 		goto __120
 123924 	}
 123925 
 123926 	Xsqlite3CodeRowTrigger(tls, pParse, pTrigger, TK_INSERT, uintptr(0), TRIGGER_AFTER,
 123927 		pTab, regData-2-int32((*Table)(unsafe.Pointer(pTab)).FnCol), onError, endOfLoop)
 123928 __120:
 123929 	;
 123930 	Xsqlite3VdbeResolveLabel(tls, v, endOfLoop)
 123931 	if !(useTempTable != 0) {
 123932 		goto __121
 123933 	}
 123934 	Xsqlite3VdbeAddOp2(tls, v, OP_Next, srcTab, addrCont)
 123935 	Xsqlite3VdbeJumpHere(tls, v, addrInsTop)
 123936 	Xsqlite3VdbeAddOp1(tls, v, OP_Close, srcTab)
 123937 	goto __122
 123938 __121:
 123939 	if !(pSelect != 0) {
 123940 		goto __123
 123941 	}
 123942 	Xsqlite3VdbeGoto(tls, v, addrCont)
 123943 	Xsqlite3VdbeJumpHere(tls, v, addrInsTop)
 123944 __123:
 123945 	;
 123946 __122:
 123947 	;
 123948 insert_end:
 123949 	if !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab == uintptr(0)) {
 123950 		goto __124
 123951 	}
 123952 	Xsqlite3AutoincrementEnd(tls, pParse)
 123953 __124:
 123954 	;
 123955 	if !(regRowCount != 0) {
 123956 		goto __125
 123957 	}
 123958 	Xsqlite3CodeChangeCount(tls, v, regRowCount, ts+17231)
 123959 __125:
 123960 	;
 123961 insert_cleanup:
 123962 	Xsqlite3SrcListDelete(tls, db, pTabList)
 123963 	Xsqlite3ExprListDelete(tls, db, pList)
 123964 	Xsqlite3UpsertDelete(tls, db, pUpsert)
 123965 	Xsqlite3SelectDelete(tls, db, pSelect)
 123966 	Xsqlite3IdListDelete(tls, db, pColumn)
 123967 	if !(aRegIdx != 0) {
 123968 		goto __126
 123969 	}
 123970 	Xsqlite3DbNNFreeNN(tls, db, aRegIdx)
 123971 __126:
 123972 }
 123973 
 123974 func checkConstraintExprNode(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 123975 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN {
 123976 		if int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 {
 123977 			if *(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)) + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiColumn)*4)) >= 0 {
 123978 				*(*U16)(unsafe.Pointer(pWalker + 36)) |= U16(CKCNSTRNT_COLUMN)
 123979 			}
 123980 		} else {
 123981 			*(*U16)(unsafe.Pointer(pWalker + 36)) |= U16(CKCNSTRNT_ROWID)
 123982 		}
 123983 	}
 123984 	return WRC_Continue
 123985 }
 123986 
 123987 // pExpr is a CHECK constraint on a row that is being UPDATE-ed.  The
 123988 // only columns that are modified by the UPDATE are those for which
 123989 // aiChng[i]>=0, and also the ROWID is modified if chngRowid is true.
 123990 //
 123991 // Return true if CHECK constraint pExpr uses any of the
 123992 // changing columns (or the rowid if it is changing).  In other words,
 123993 // return true if this CHECK constraint must be validated for
 123994 // the new row in the UPDATE statement.
 123995 //
 123996 // 2018-09-15: pExpr might also be an expression for an index-on-expressions.
 123997 // The operation of this routine is the same - return true if an only if
 123998 // the expression uses one or more of columns identified by the second and
 123999 // third arguments.
 124000 func Xsqlite3ExprReferencesUpdatedColumn(tls *libc.TLS, pExpr uintptr, aiChng uintptr, chngRowid int32) int32 {
 124001 	bp := tls.Alloc(48)
 124002 	defer tls.Free(48)
 124003 
 124004 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Walker{})))
 124005 	(*Walker)(unsafe.Pointer(bp)).FeCode = U16(0)
 124006 	(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 124007 		f func(*libc.TLS, uintptr, uintptr) int32
 124008 	}{checkConstraintExprNode}))
 124009 	*(*uintptr)(unsafe.Pointer(bp + 40)) = aiChng
 124010 	Xsqlite3WalkExpr(tls, bp, pExpr)
 124011 	if !(chngRowid != 0) {
 124012 		*(*U16)(unsafe.Pointer(bp + 36)) &= libc.Uint16FromInt32(libc.CplInt32(CKCNSTRNT_ROWID))
 124013 	}
 124014 
 124015 	return libc.Bool32(int32((*Walker)(unsafe.Pointer(bp)).FeCode) != 0)
 124016 }
 124017 
 124018 // The sqlite3GenerateConstraintChecks() routine usually wants to visit
 124019 // the indexes of a table in the order provided in the Table->pIndex list.
 124020 // However, sometimes (rarely - when there is an upsert) it wants to visit
 124021 // the indexes in a different order.  The following data structures accomplish
 124022 // this.
 124023 //
 124024 // The IndexIterator object is used to walk through all of the indexes
 124025 // of a table in either Index.pNext order, or in some other order established
 124026 // by an array of IndexListTerm objects.
 124027 type IndexListTerm1 = struct {
 124028 	Fp           uintptr
 124029 	Fix          int32
 124030 	F__ccgo_pad1 [4]byte
 124031 }
 124032 
 124033 // The sqlite3GenerateConstraintChecks() routine usually wants to visit
 124034 // the indexes of a table in the order provided in the Table->pIndex list.
 124035 // However, sometimes (rarely - when there is an upsert) it wants to visit
 124036 // the indexes in a different order.  The following data structures accomplish
 124037 // this.
 124038 //
 124039 // The IndexIterator object is used to walk through all of the indexes
 124040 // of a table in either Index.pNext order, or in some other order established
 124041 // by an array of IndexListTerm objects.
 124042 type IndexListTerm = IndexListTerm1
 124043 type IndexIterator1 = struct {
 124044 	FeType int32
 124045 	Fi     int32
 124046 	Fu     struct {
 124047 		Flx          struct{ FpIdx uintptr }
 124048 		F__ccgo_pad1 [8]byte
 124049 	}
 124050 }
 124051 
 124052 type IndexIterator = IndexIterator1
 124053 
 124054 func indexIteratorFirst(tls *libc.TLS, pIter uintptr, pIx uintptr) uintptr {
 124055 	if (*IndexIterator)(unsafe.Pointer(pIter)).FeType != 0 {
 124056 		*(*int32)(unsafe.Pointer(pIx)) = (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIter + 8 + 8)))).Fix
 124057 		return (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIter + 8 + 8)))).Fp
 124058 	} else {
 124059 		*(*int32)(unsafe.Pointer(pIx)) = 0
 124060 		return *(*uintptr)(unsafe.Pointer(pIter + 8))
 124061 	}
 124062 	return uintptr(0)
 124063 }
 124064 
 124065 func indexIteratorNext(tls *libc.TLS, pIter uintptr, pIx uintptr) uintptr {
 124066 	if (*IndexIterator)(unsafe.Pointer(pIter)).FeType != 0 {
 124067 		var i int32 = libc.PreIncInt32(&(*IndexIterator)(unsafe.Pointer(pIter)).Fi, 1)
 124068 		if i >= *(*int32)(unsafe.Pointer(pIter + 8)) {
 124069 			*(*int32)(unsafe.Pointer(pIx)) = i
 124070 			return uintptr(0)
 124071 		}
 124072 		*(*int32)(unsafe.Pointer(pIx)) = (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIter + 8 + 8)) + uintptr(i)*16)).Fix
 124073 		return (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIter + 8 + 8)) + uintptr(i)*16)).Fp
 124074 	} else {
 124075 		*(*int32)(unsafe.Pointer(pIx))++
 124076 		*(*uintptr)(unsafe.Pointer(pIter + 8)) = (*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIter + 8)))).FpNext
 124077 		return *(*uintptr)(unsafe.Pointer(pIter + 8))
 124078 	}
 124079 	return uintptr(0)
 124080 }
 124081 
 124082 // Generate code to do constraint checks prior to an INSERT or an UPDATE
 124083 // on table pTab.
 124084 //
 124085 // The regNewData parameter is the first register in a range that contains
 124086 // the data to be inserted or the data after the update.  There will be
 124087 // pTab->nCol+1 registers in this range.  The first register (the one
 124088 // that regNewData points to) will contain the new rowid, or NULL in the
 124089 // case of a WITHOUT ROWID table.  The second register in the range will
 124090 // contain the content of the first table column.  The third register will
 124091 // contain the content of the second table column.  And so forth.
 124092 //
 124093 // The regOldData parameter is similar to regNewData except that it contains
 124094 // the data prior to an UPDATE rather than afterwards.  regOldData is zero
 124095 // for an INSERT.  This routine can distinguish between UPDATE and INSERT by
 124096 // checking regOldData for zero.
 124097 //
 124098 // For an UPDATE, the pkChng boolean is true if the true primary key (the
 124099 // rowid for a normal table or the PRIMARY KEY for a WITHOUT ROWID table)
 124100 // might be modified by the UPDATE.  If pkChng is false, then the key of
 124101 // the iDataCur content table is guaranteed to be unchanged by the UPDATE.
 124102 //
 124103 // For an INSERT, the pkChng boolean indicates whether or not the rowid
 124104 // was explicitly specified as part of the INSERT statement.  If pkChng
 124105 // is zero, it means that the either rowid is computed automatically or
 124106 // that the table is a WITHOUT ROWID table and has no rowid.  On an INSERT,
 124107 // pkChng will only be true if the INSERT statement provides an integer
 124108 // value for either the rowid column or its INTEGER PRIMARY KEY alias.
 124109 //
 124110 // The code generated by this routine will store new index entries into
 124111 // registers identified by aRegIdx[].  No index entry is created for
 124112 // indices where aRegIdx[i]==0.  The order of indices in aRegIdx[] is
 124113 // the same as the order of indices on the linked list of indices
 124114 // at pTab->pIndex.
 124115 //
 124116 // (2019-05-07) The generated code also creates a new record for the
 124117 // main table, if pTab is a rowid table, and stores that record in the
 124118 // register identified by aRegIdx[nIdx] - in other words in the first
 124119 // entry of aRegIdx[] past the last index.  It is important that the
 124120 // record be generated during constraint checks to avoid affinity changes
 124121 // to the register content that occur after constraint checks but before
 124122 // the new record is inserted.
 124123 //
 124124 // The caller must have already opened writeable cursors on the main
 124125 // table and all applicable indices (that is to say, all indices for which
 124126 // aRegIdx[] is not zero).  iDataCur is the cursor for the main table when
 124127 // inserting or updating a rowid table, or the cursor for the PRIMARY KEY
 124128 // index when operating on a WITHOUT ROWID table.  iIdxCur is the cursor
 124129 // for the first index in the pTab->pIndex list.  Cursors for other indices
 124130 // are at iIdxCur+N for the N-th element of the pTab->pIndex list.
 124131 //
 124132 // This routine also generates code to check constraints.  NOT NULL,
 124133 // CHECK, and UNIQUE constraints are all checked.  If a constraint fails,
 124134 // then the appropriate action is performed.  There are five possible
 124135 // actions: ROLLBACK, ABORT, FAIL, REPLACE, and IGNORE.
 124136 //
 124137 //	Constraint type  Action       What Happens
 124138 //	---------------  ----------   ----------------------------------------
 124139 //	any              ROLLBACK     The current transaction is rolled back and
 124140 //	                              sqlite3_step() returns immediately with a
 124141 //	                              return code of SQLITE_CONSTRAINT.
 124142 //
 124143 //	any              ABORT        Back out changes from the current command
 124144 //	                              only (do not do a complete rollback) then
 124145 //	                              cause sqlite3_step() to return immediately
 124146 //	                              with SQLITE_CONSTRAINT.
 124147 //
 124148 //	any              FAIL         Sqlite3_step() returns immediately with a
 124149 //	                              return code of SQLITE_CONSTRAINT.  The
 124150 //	                              transaction is not rolled back and any
 124151 //	                              changes to prior rows are retained.
 124152 //
 124153 //	any              IGNORE       The attempt in insert or update the current
 124154 //	                              row is skipped, without throwing an error.
 124155 //	                              Processing continues with the next row.
 124156 //	                              (There is an immediate jump to ignoreDest.)
 124157 //
 124158 //	NOT NULL         REPLACE      The NULL value is replace by the default
 124159 //	                              value for that column.  If the default value
 124160 //	                              is NULL, the action is the same as ABORT.
 124161 //
 124162 //	UNIQUE           REPLACE      The other row that conflicts with the row
 124163 //	                              being inserted is removed.
 124164 //
 124165 //	CHECK            REPLACE      Illegal.  The results in an exception.
 124166 //
 124167 // Which action to take is determined by the overrideError parameter.
 124168 // Or if overrideError==OE_Default, then the pParse->onError parameter
 124169 // is used.  Or if pParse->onError==OE_Default then the onError value
 124170 // for the constraint is used.
 124171 func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintptr, aRegIdx uintptr, iDataCur int32, iIdxCur int32, regNewData int32, regOldData int32, pkChng U8, overrideError U8, ignoreDest int32, pbMayReplace uintptr, aiChng uintptr, pUpsert uintptr) {
 124172 	bp := tls.Alloc(72)
 124173 	defer tls.Free(72)
 124174 
 124175 	var v uintptr
 124176 	var pIdx uintptr
 124177 	var pPk uintptr = uintptr(0)
 124178 	var db uintptr
 124179 	var i int32
 124180 
 124181 	var nCol int32
 124182 	var onError int32
 124183 	var seenReplace int32 = 0
 124184 	var nPkField int32
 124185 	var pUpsertClause uintptr = uintptr(0)
 124186 	var isUpdate U8
 124187 	var bAffinityDone U8 = U8(0)
 124188 	var upsertIpkReturn int32 = 0
 124189 	var upsertIpkDelay int32 = 0
 124190 	var ipkTop int32 = 0
 124191 	var ipkBottom int32 = 0
 124192 
 124193 	var regTrigCnt int32
 124194 	var addrRecheck int32 = 0
 124195 	var lblRecheckOk int32 = 0
 124196 	var pTrigger uintptr
 124197 	var nReplaceTrig int32 = 0
 124198 
 124199 	isUpdate = U8(libc.Bool32(regOldData != 0))
 124200 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 124201 	v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 124202 
 124203 	nCol = int32((*Table)(unsafe.Pointer(pTab)).FnCol)
 124204 
 124205 	if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
 124206 		pPk = uintptr(0)
 124207 		nPkField = 1
 124208 	} else {
 124209 		pPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
 124210 		nPkField = int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol)
 124211 	}
 124212 
 124213 	if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasNotNull) != 0 {
 124214 		var b2ndPass int32 = 0
 124215 		var nSeenReplace int32 = 0
 124216 		var nGenerated int32 = 0
 124217 		for 1 != 0 {
 124218 			for i = 0; i < nCol; i++ {
 124219 				var iReg int32
 124220 				var pCol uintptr = (*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*24
 124221 				var isGenerated int32
 124222 				onError = int32(*(*uint8)(unsafe.Pointer(pCol + 8)) & 0xf >> 0)
 124223 				if onError == OE_None {
 124224 					continue
 124225 				}
 124226 				if i == int32((*Table)(unsafe.Pointer(pTab)).FiPKey) {
 124227 					continue
 124228 				}
 124229 				isGenerated = int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_GENERATED
 124230 				if isGenerated != 0 && !(b2ndPass != 0) {
 124231 					nGenerated++
 124232 					continue
 124233 				}
 124234 				if aiChng != 0 && *(*int32)(unsafe.Pointer(aiChng + uintptr(i)*4)) < 0 && !(isGenerated != 0) {
 124235 					continue
 124236 				}
 124237 				if int32(overrideError) != OE_Default {
 124238 					onError = int32(overrideError)
 124239 				} else if onError == OE_Default {
 124240 					onError = OE_Abort
 124241 				}
 124242 				if onError == OE_Replace {
 124243 					if b2ndPass != 0 ||
 124244 						int32((*Column)(unsafe.Pointer(pCol)).FiDflt) == 0 {
 124245 						onError = OE_Abort
 124246 					} else {
 124247 					}
 124248 				} else if b2ndPass != 0 && !(isGenerated != 0) {
 124249 					continue
 124250 				}
 124251 
 124252 				iReg = int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(i))) + regNewData + 1
 124253 				{
 124254 					switch onError {
 124255 					case OE_Replace:
 124256 						{
 124257 							var addr1 int32 = Xsqlite3VdbeAddOp1(tls, v, OP_NotNull, iReg)
 124258 
 124259 							nSeenReplace++
 124260 							Xsqlite3ExprCodeCopy(tls, pParse,
 124261 								Xsqlite3ColumnExpr(tls, pTab, pCol), iReg)
 124262 							Xsqlite3VdbeJumpHere(tls, v, addr1)
 124263 							break
 124264 
 124265 						}
 124266 						fallthrough
 124267 					case OE_Abort:
 124268 						Xsqlite3MayAbort(tls, pParse)
 124269 						fallthrough
 124270 					case OE_Rollback:
 124271 						fallthrough
 124272 					case OE_Fail:
 124273 						{
 124274 							var zMsg uintptr = Xsqlite3MPrintf(tls, db, ts+13413, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName,
 124275 								(*Column)(unsafe.Pointer(pCol)).FzCnName))
 124276 
 124277 							Xsqlite3VdbeAddOp3(tls, v, OP_HaltIfNull, SQLITE_CONSTRAINT|int32(5)<<8,
 124278 								onError, iReg)
 124279 							Xsqlite3VdbeAppendP4(tls, v, zMsg, -6)
 124280 							Xsqlite3VdbeChangeP5(tls, v, uint16(P5_ConstraintNotNull))
 124281 
 124282 							break
 124283 
 124284 						}
 124285 						fallthrough
 124286 					default:
 124287 						{
 124288 							Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, iReg, ignoreDest)
 124289 
 124290 							break
 124291 
 124292 						}
 124293 					}
 124294 				}
 124295 			}
 124296 			if nGenerated == 0 && nSeenReplace == 0 {
 124297 				break
 124298 			}
 124299 			if b2ndPass != 0 {
 124300 				break
 124301 			}
 124302 			b2ndPass = 1
 124303 			if nSeenReplace > 0 && (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasGenerated) != U32(0) {
 124304 				Xsqlite3ComputeGeneratedColumns(tls, pParse, regNewData+1, pTab)
 124305 			}
 124306 		}
 124307 	}
 124308 
 124309 	if (*Table)(unsafe.Pointer(pTab)).FpCheck != 0 && (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_IgnoreChecks) == uint64(0) {
 124310 		var pCheck uintptr = (*Table)(unsafe.Pointer(pTab)).FpCheck
 124311 		(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = -(regNewData + 1)
 124312 		if int32(overrideError) != OE_Default {
 124313 			onError = int32(overrideError)
 124314 		} else {
 124315 			onError = OE_Abort
 124316 		}
 124317 		for i = 0; i < (*ExprList)(unsafe.Pointer(pCheck)).FnExpr; i++ {
 124318 			var allOk int32
 124319 			var pCopy uintptr
 124320 			var pExpr uintptr = (*ExprList_item)(unsafe.Pointer(pCheck + 8 + uintptr(i)*32)).FpExpr
 124321 			if aiChng != 0 &&
 124322 				!(Xsqlite3ExprReferencesUpdatedColumn(tls, pExpr, aiChng, int32(pkChng)) != 0) {
 124323 				continue
 124324 			}
 124325 			if int32(bAffinityDone) == 0 {
 124326 				Xsqlite3TableAffinity(tls, v, pTab, regNewData+1)
 124327 				bAffinityDone = U8(1)
 124328 			}
 124329 			allOk = Xsqlite3VdbeMakeLabel(tls, pParse)
 124330 
 124331 			pCopy = Xsqlite3ExprDup(tls, db, pExpr, 0)
 124332 			if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
 124333 				Xsqlite3ExprIfTrue(tls, pParse, pCopy, allOk, SQLITE_JUMPIFNULL)
 124334 			}
 124335 			Xsqlite3ExprDelete(tls, db, pCopy)
 124336 			if onError == OE_Ignore {
 124337 				Xsqlite3VdbeGoto(tls, v, ignoreDest)
 124338 			} else {
 124339 				var zName uintptr = (*ExprList_item)(unsafe.Pointer(pCheck + 8 + uintptr(i)*32)).FzEName
 124340 
 124341 				if onError == OE_Replace {
 124342 					onError = OE_Abort
 124343 				}
 124344 				Xsqlite3HaltConstraint(tls, pParse, SQLITE_CONSTRAINT|int32(1)<<8,
 124345 					onError, zName, int8(P4_TRANSIENT),
 124346 					uint8(P5_ConstraintCheck))
 124347 			}
 124348 			Xsqlite3VdbeResolveLabel(tls, v, allOk)
 124349 		}
 124350 		(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = 0
 124351 	}
 124352 
 124353 	(*IndexIterator)(unsafe.Pointer(bp + 16)).FeType = 0
 124354 	(*IndexIterator)(unsafe.Pointer(bp + 16)).Fi = 0
 124355 	*(*uintptr)(unsafe.Pointer(bp + 16 + 8 + 8)) = uintptr(0)
 124356 	*(*uintptr)(unsafe.Pointer(bp + 16 + 8)) = (*Table)(unsafe.Pointer(pTab)).FpIndex
 124357 	if pUpsert != 0 {
 124358 		if (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget == uintptr(0) {
 124359 			if int32((*Upsert)(unsafe.Pointer(pUpsert)).FisDoUpdate) == 0 {
 124360 				overrideError = U8(OE_Ignore)
 124361 				pUpsert = uintptr(0)
 124362 			} else {
 124363 				overrideError = U8(OE_Update)
 124364 			}
 124365 		} else if (*Table)(unsafe.Pointer(pTab)).FpIndex != uintptr(0) {
 124366 			var nIdx int32
 124367 			var jj int32
 124368 			var nByte U64
 124369 			var pTerm uintptr
 124370 			var bUsed uintptr
 124371 			nIdx = 0
 124372 			pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex
 124373 		__1:
 124374 			if !(pIdx != 0) {
 124375 				goto __3
 124376 			}
 124377 			{
 124378 			}
 124379 			goto __2
 124380 		__2:
 124381 			pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
 124382 			nIdx++
 124383 			goto __1
 124384 			goto __3
 124385 		__3:
 124386 			;
 124387 			(*IndexIterator)(unsafe.Pointer(bp + 16)).FeType = 1
 124388 			*(*int32)(unsafe.Pointer(bp + 16 + 8)) = nIdx
 124389 			nByte = (uint64(unsafe.Sizeof(IndexListTerm{}))+uint64(1))*uint64(nIdx) + uint64(nIdx)
 124390 			*(*uintptr)(unsafe.Pointer(bp + 16 + 8 + 8)) = Xsqlite3DbMallocZero(tls, db, nByte)
 124391 			if *(*uintptr)(unsafe.Pointer(bp + 16 + 8 + 8)) == uintptr(0) {
 124392 				return
 124393 			}
 124394 			bUsed = *(*uintptr)(unsafe.Pointer(bp + 16 + 8 + 8)) + uintptr(nIdx)*16
 124395 			(*Upsert)(unsafe.Pointer(pUpsert)).FpToFree = *(*uintptr)(unsafe.Pointer(bp + 16 + 8 + 8))
 124396 			i = 0
 124397 			pTerm = pUpsert
 124398 			for ; pTerm != 0; pTerm = (*Upsert)(unsafe.Pointer(pTerm)).FpNextUpsert {
 124399 				if (*Upsert)(unsafe.Pointer(pTerm)).FpUpsertTarget == uintptr(0) {
 124400 					break
 124401 				}
 124402 				if (*Upsert)(unsafe.Pointer(pTerm)).FpUpsertIdx == uintptr(0) {
 124403 					continue
 124404 				}
 124405 				jj = 0
 124406 				pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex
 124407 				for pIdx != uintptr(0) && pIdx != (*Upsert)(unsafe.Pointer(pTerm)).FpUpsertIdx {
 124408 					pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
 124409 					jj++
 124410 				}
 124411 				if *(*U8)(unsafe.Pointer(bUsed + uintptr(jj))) != 0 {
 124412 					continue
 124413 				}
 124414 				*(*U8)(unsafe.Pointer(bUsed + uintptr(jj))) = U8(1)
 124415 				(*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 + 8 + 8)) + uintptr(i)*16)).Fp = pIdx
 124416 				(*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 + 8 + 8)) + uintptr(i)*16)).Fix = jj
 124417 				i++
 124418 			}
 124419 			jj = 0
 124420 			pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex
 124421 		__4:
 124422 			if !(pIdx != 0) {
 124423 				goto __6
 124424 			}
 124425 			{
 124426 				if *(*U8)(unsafe.Pointer(bUsed + uintptr(jj))) != 0 {
 124427 					goto __5
 124428 				}
 124429 				(*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 + 8 + 8)) + uintptr(i)*16)).Fp = pIdx
 124430 				(*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 + 8 + 8)) + uintptr(i)*16)).Fix = jj
 124431 				i++
 124432 
 124433 			}
 124434 			goto __5
 124435 		__5:
 124436 			pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
 124437 			jj++
 124438 			goto __4
 124439 			goto __6
 124440 		__6:
 124441 		}
 124442 	}
 124443 
 124444 	if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_RecTriggers|SQLITE_ForeignKeys) == uint64(0) {
 124445 		pTrigger = uintptr(0)
 124446 		regTrigCnt = 0
 124447 	} else {
 124448 		if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_RecTriggers) != 0 {
 124449 			pTrigger = Xsqlite3TriggersExist(tls, pParse, pTab, TK_DELETE, uintptr(0), uintptr(0))
 124450 			regTrigCnt = libc.Bool32(pTrigger != uintptr(0) || Xsqlite3FkRequired(tls, pParse, pTab, uintptr(0), 0) != 0)
 124451 		} else {
 124452 			pTrigger = uintptr(0)
 124453 			regTrigCnt = Xsqlite3FkRequired(tls, pParse, pTab, uintptr(0), 0)
 124454 		}
 124455 		if regTrigCnt != 0 {
 124456 			regTrigCnt = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 124457 			Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regTrigCnt)
 124458 
 124459 			lblRecheckOk = Xsqlite3VdbeMakeLabel(tls, pParse)
 124460 			addrRecheck = lblRecheckOk
 124461 		}
 124462 	}
 124463 
 124464 	if pkChng != 0 && pPk == uintptr(0) {
 124465 		var addrRowidOk int32 = Xsqlite3VdbeMakeLabel(tls, pParse)
 124466 
 124467 		onError = int32((*Table)(unsafe.Pointer(pTab)).FkeyConf)
 124468 		if int32(overrideError) != OE_Default {
 124469 			onError = int32(overrideError)
 124470 		} else if onError == OE_Default {
 124471 			onError = OE_Abort
 124472 		}
 124473 
 124474 		if pUpsert != 0 {
 124475 			pUpsertClause = Xsqlite3UpsertOfIndex(tls, pUpsert, uintptr(0))
 124476 			if pUpsertClause != uintptr(0) {
 124477 				if int32((*Upsert)(unsafe.Pointer(pUpsertClause)).FisDoUpdate) == 0 {
 124478 					onError = OE_Ignore
 124479 				} else {
 124480 					onError = OE_Update
 124481 				}
 124482 			}
 124483 			if pUpsertClause != pUpsert {
 124484 				upsertIpkDelay = Xsqlite3VdbeAddOp0(tls, v, OP_Goto)
 124485 			}
 124486 		}
 124487 
 124488 		if onError == OE_Replace &&
 124489 			onError != int32(overrideError) &&
 124490 			(*Table)(unsafe.Pointer(pTab)).FpIndex != 0 &&
 124491 			!(upsertIpkDelay != 0) {
 124492 			ipkTop = Xsqlite3VdbeAddOp0(tls, v, OP_Goto) + 1
 124493 
 124494 		}
 124495 
 124496 		if isUpdate != 0 {
 124497 			Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regNewData, addrRowidOk, regOldData)
 124498 			Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL))
 124499 
 124500 		}
 124501 
 124502 		Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDataCur, addrRowidOk, regNewData)
 124503 
 124504 		switch onError {
 124505 		default:
 124506 			{
 124507 				onError = OE_Abort
 124508 
 124509 			}
 124510 			fallthrough
 124511 		case OE_Rollback:
 124512 			fallthrough
 124513 		case OE_Abort:
 124514 			fallthrough
 124515 		case OE_Fail:
 124516 			{
 124517 				Xsqlite3RowidConstraint(tls, pParse, onError, pTab)
 124518 				break
 124519 
 124520 			}
 124521 			fallthrough
 124522 		case OE_Replace:
 124523 			{
 124524 				if regTrigCnt != 0 {
 124525 					Xsqlite3MultiWrite(tls, pParse)
 124526 					Xsqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, iDataCur, iIdxCur,
 124527 						regNewData, int16(1), uint8(0), uint8(OE_Replace), uint8(1), -1)
 124528 					Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, regTrigCnt, 1)
 124529 					nReplaceTrig++
 124530 				} else {
 124531 					Xsqlite3VdbeAddOp2(tls, v, OP_Delete, iDataCur, OPFLAG_ISNOOP)
 124532 					Xsqlite3VdbeAppendP4(tls, v, pTab, -5)
 124533 					if (*Table)(unsafe.Pointer(pTab)).FpIndex != 0 {
 124534 						Xsqlite3MultiWrite(tls, pParse)
 124535 						Xsqlite3GenerateRowIndexDelete(tls, pParse, pTab, iDataCur, iIdxCur, uintptr(0), -1)
 124536 					}
 124537 				}
 124538 				seenReplace = 1
 124539 				break
 124540 
 124541 			}
 124542 			fallthrough
 124543 		case OE_Update:
 124544 			{
 124545 				Xsqlite3UpsertDoUpdate(tls, pParse, pUpsert, pTab, uintptr(0), iDataCur)
 124546 
 124547 			}
 124548 			fallthrough
 124549 		case OE_Ignore:
 124550 			{
 124551 				Xsqlite3VdbeGoto(tls, v, ignoreDest)
 124552 				break
 124553 
 124554 			}
 124555 		}
 124556 		Xsqlite3VdbeResolveLabel(tls, v, addrRowidOk)
 124557 		if pUpsert != 0 && pUpsertClause != pUpsert {
 124558 			upsertIpkReturn = Xsqlite3VdbeAddOp0(tls, v, OP_Goto)
 124559 		} else if ipkTop != 0 {
 124560 			ipkBottom = Xsqlite3VdbeAddOp0(tls, v, OP_Goto)
 124561 			Xsqlite3VdbeJumpHere(tls, v, ipkTop-1)
 124562 		}
 124563 	}
 124564 
 124565 	for pIdx = indexIteratorFirst(tls, bp+16, bp+40); pIdx != 0; pIdx = indexIteratorNext(tls, bp+16, bp+40) {
 124566 		var regIdx int32
 124567 		var regR int32
 124568 		var iThisCur int32
 124569 		var addrUniqueOk int32
 124570 		var addrConflictCk int32
 124571 
 124572 		if *(*int32)(unsafe.Pointer(aRegIdx + uintptr(*(*int32)(unsafe.Pointer(bp + 40)))*4)) == 0 {
 124573 			continue
 124574 		}
 124575 		if pUpsert != 0 {
 124576 			pUpsertClause = Xsqlite3UpsertOfIndex(tls, pUpsert, pIdx)
 124577 			if upsertIpkDelay != 0 && pUpsertClause == pUpsert {
 124578 				Xsqlite3VdbeJumpHere(tls, v, upsertIpkDelay)
 124579 			}
 124580 		}
 124581 		addrUniqueOk = Xsqlite3VdbeMakeLabel(tls, pParse)
 124582 		if int32(bAffinityDone) == 0 {
 124583 			Xsqlite3TableAffinity(tls, v, pTab, regNewData+1)
 124584 			bAffinityDone = U8(1)
 124585 		}
 124586 
 124587 		iThisCur = iIdxCur + *(*int32)(unsafe.Pointer(bp + 40))
 124588 
 124589 		if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 {
 124590 			Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, *(*int32)(unsafe.Pointer(aRegIdx + uintptr(*(*int32)(unsafe.Pointer(bp + 40)))*4)))
 124591 			(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = -(regNewData + 1)
 124592 			Xsqlite3ExprIfFalseDup(tls, pParse, (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere, addrUniqueOk,
 124593 				SQLITE_JUMPIFNULL)
 124594 			(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = 0
 124595 		}
 124596 
 124597 		regIdx = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(*(*int32)(unsafe.Pointer(bp + 40)))*4)) + 1
 124598 		for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnColumn); i++ {
 124599 			var iField int32 = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2)))
 124600 			var x int32
 124601 			if iField == -2 {
 124602 				(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = -(regNewData + 1)
 124603 				Xsqlite3ExprCodeCopy(tls, pParse, (*ExprList_item)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaColExpr+8+uintptr(i)*32)).FpExpr, regIdx+i)
 124604 				(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = 0
 124605 
 124606 			} else if iField == -1 || iField == int32((*Table)(unsafe.Pointer(pTab)).FiPKey) {
 124607 				x = regNewData
 124608 				Xsqlite3VdbeAddOp2(tls, v, OP_IntCopy, x, regIdx+i)
 124609 
 124610 			} else {
 124611 				x = int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(iField))) + regNewData + 1
 124612 				Xsqlite3VdbeAddOp2(tls, v, OP_SCopy, x, regIdx+i)
 124613 
 124614 			}
 124615 		}
 124616 		Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regIdx, int32((*Index)(unsafe.Pointer(pIdx)).FnColumn), *(*int32)(unsafe.Pointer(aRegIdx + uintptr(*(*int32)(unsafe.Pointer(bp + 40)))*4)))
 124617 
 124618 		if isUpdate != 0 && pPk == pIdx && int32(pkChng) == 0 {
 124619 			Xsqlite3VdbeResolveLabel(tls, v, addrUniqueOk)
 124620 			continue
 124621 		}
 124622 
 124623 		onError = int32((*Index)(unsafe.Pointer(pIdx)).FonError)
 124624 		if onError == OE_None {
 124625 			Xsqlite3VdbeResolveLabel(tls, v, addrUniqueOk)
 124626 			continue
 124627 		}
 124628 		if int32(overrideError) != OE_Default {
 124629 			onError = int32(overrideError)
 124630 		} else if onError == OE_Default {
 124631 			onError = OE_Abort
 124632 		}
 124633 
 124634 		if pUpsertClause != 0 {
 124635 			if int32((*Upsert)(unsafe.Pointer(pUpsertClause)).FisDoUpdate) == 0 {
 124636 				onError = OE_Ignore
 124637 			} else {
 124638 				onError = OE_Update
 124639 			}
 124640 		}
 124641 
 124642 		addrConflictCk = Xsqlite3VdbeAddOp4Int(tls, v, OP_NoConflict, iThisCur, addrUniqueOk,
 124643 			regIdx, int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol))
 124644 
 124645 		if pIdx == pPk {
 124646 			regR = regIdx
 124647 		} else {
 124648 			regR = Xsqlite3GetTempRange(tls, pParse, nPkField)
 124649 		}
 124650 		if isUpdate != 0 || onError == OE_Replace {
 124651 			if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
 124652 				Xsqlite3VdbeAddOp2(tls, v, OP_IdxRowid, iThisCur, regR)
 124653 
 124654 				if isUpdate != 0 {
 124655 					Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regR, addrUniqueOk, regOldData)
 124656 					Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL))
 124657 
 124658 				}
 124659 			} else {
 124660 				var x int32
 124661 
 124662 				if pIdx != pPk {
 124663 					for i = 0; i < int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol); i++ {
 124664 						x = int32(Xsqlite3TableColumnToIndex(tls, pIdx, *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))))
 124665 						Xsqlite3VdbeAddOp3(tls, v, OP_Column, iThisCur, x, regR+i)
 124666 
 124667 					}
 124668 				}
 124669 				if isUpdate != 0 {
 124670 					var addrJump int32 = Xsqlite3VdbeCurrentAddr(tls, v) + int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol)
 124671 					var op int32 = OP_Ne
 124672 					var regCmp int32 = func() int32 {
 124673 						if int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY {
 124674 							return regIdx
 124675 						}
 124676 						return regR
 124677 					}()
 124678 
 124679 					for i = 0; i < int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol); i++ {
 124680 						var p4 uintptr = Xsqlite3LocateCollSeq(tls, pParse, *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FazColl + uintptr(i)*8)))
 124681 						x = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))
 124682 
 124683 						if i == int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol)-1 {
 124684 							addrJump = addrUniqueOk
 124685 							op = OP_Eq
 124686 						}
 124687 						x = int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(x)))
 124688 						Xsqlite3VdbeAddOp4(tls, v, op,
 124689 							regOldData+1+x, addrJump, regCmp+i, p4, -2)
 124690 						Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL))
 124691 
 124692 					}
 124693 				}
 124694 			}
 124695 		}
 124696 
 124697 		switch onError {
 124698 		case OE_Rollback:
 124699 			fallthrough
 124700 		case OE_Abort:
 124701 			fallthrough
 124702 		case OE_Fail:
 124703 			{
 124704 				Xsqlite3UniqueConstraint(tls, pParse, onError, pIdx)
 124705 				break
 124706 
 124707 			}
 124708 		case OE_Update:
 124709 			{
 124710 				Xsqlite3UpsertDoUpdate(tls, pParse, pUpsert, pTab, pIdx, iIdxCur+*(*int32)(unsafe.Pointer(bp + 40)))
 124711 
 124712 			}
 124713 			fallthrough
 124714 		case OE_Ignore:
 124715 			{
 124716 				Xsqlite3VdbeGoto(tls, v, ignoreDest)
 124717 				break
 124718 
 124719 			}
 124720 		default:
 124721 			{
 124722 				var nConflictCk int32
 124723 
 124724 				nConflictCk = Xsqlite3VdbeCurrentAddr(tls, v) - addrConflictCk
 124725 
 124726 				if regTrigCnt != 0 {
 124727 					Xsqlite3MultiWrite(tls, pParse)
 124728 					nReplaceTrig++
 124729 				}
 124730 				if pTrigger != 0 && isUpdate != 0 {
 124731 					Xsqlite3VdbeAddOp1(tls, v, OP_CursorLock, iDataCur)
 124732 				}
 124733 				Xsqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, iDataCur, iIdxCur,
 124734 					regR, int16(nPkField), uint8(0), uint8(OE_Replace),
 124735 					func() uint8 {
 124736 						if pIdx == pPk {
 124737 							return uint8(ONEPASS_SINGLE)
 124738 						}
 124739 						return uint8(ONEPASS_OFF)
 124740 					}(), iThisCur)
 124741 				if pTrigger != 0 && isUpdate != 0 {
 124742 					Xsqlite3VdbeAddOp1(tls, v, OP_CursorUnlock, iDataCur)
 124743 				}
 124744 				if regTrigCnt != 0 {
 124745 					var addrBypass int32
 124746 
 124747 					Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, regTrigCnt, 1)
 124748 					addrBypass = Xsqlite3VdbeAddOp0(tls, v, OP_Goto)
 124749 
 124750 					Xsqlite3VdbeResolveLabel(tls, v, lblRecheckOk)
 124751 					lblRecheckOk = Xsqlite3VdbeMakeLabel(tls, pParse)
 124752 					if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 {
 124753 						Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, regIdx-1, lblRecheckOk)
 124754 
 124755 					}
 124756 
 124757 					for nConflictCk > 0 {
 124758 						*(*VdbeOp)(unsafe.Pointer(bp + 48)) = *(*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, v, addrConflictCk)))
 124759 						if int32((*VdbeOp)(unsafe.Pointer(bp+48)).Fopcode) != OP_IdxRowid {
 124760 							var p2 int32
 124761 							var zP4 uintptr
 124762 							if int32(Xsqlite3OpcodeProperty[(*VdbeOp)(unsafe.Pointer(bp+48)).Fopcode])&OPFLG_JUMP != 0 {
 124763 								p2 = lblRecheckOk
 124764 							} else {
 124765 								p2 = (*VdbeOp)(unsafe.Pointer(bp + 48)).Fp2
 124766 							}
 124767 							if int32((*VdbeOp)(unsafe.Pointer(bp+48)).Fp4type) == -3 {
 124768 								zP4 = uintptr(int64(*(*int32)(unsafe.Pointer(bp + 48 + 16))))
 124769 							} else {
 124770 								zP4 = *(*uintptr)(unsafe.Pointer(bp + 48 + 16))
 124771 							}
 124772 							Xsqlite3VdbeAddOp4(tls, v, int32((*VdbeOp)(unsafe.Pointer(bp+48)).Fopcode), (*VdbeOp)(unsafe.Pointer(bp+48)).Fp1, p2, (*VdbeOp)(unsafe.Pointer(bp+48)).Fp3, zP4, int32((*VdbeOp)(unsafe.Pointer(bp+48)).Fp4type))
 124773 							Xsqlite3VdbeChangeP5(tls, v, (*VdbeOp)(unsafe.Pointer(bp+48)).Fp5)
 124774 
 124775 						}
 124776 						nConflictCk--
 124777 						addrConflictCk++
 124778 					}
 124779 
 124780 					Xsqlite3UniqueConstraint(tls, pParse, OE_Abort, pIdx)
 124781 
 124782 					Xsqlite3VdbeJumpHere(tls, v, addrBypass)
 124783 				}
 124784 				seenReplace = 1
 124785 				break
 124786 
 124787 			}
 124788 		}
 124789 		Xsqlite3VdbeResolveLabel(tls, v, addrUniqueOk)
 124790 		if regR != regIdx {
 124791 			Xsqlite3ReleaseTempRange(tls, pParse, regR, nPkField)
 124792 		}
 124793 		if pUpsertClause != 0 &&
 124794 			upsertIpkReturn != 0 &&
 124795 			Xsqlite3UpsertNextIsIPK(tls, pUpsertClause) != 0 {
 124796 			Xsqlite3VdbeGoto(tls, v, upsertIpkDelay+1)
 124797 			Xsqlite3VdbeJumpHere(tls, v, upsertIpkReturn)
 124798 			upsertIpkReturn = 0
 124799 		}
 124800 	}
 124801 
 124802 	if ipkTop != 0 {
 124803 		Xsqlite3VdbeGoto(tls, v, ipkTop)
 124804 
 124805 		Xsqlite3VdbeJumpHere(tls, v, ipkBottom)
 124806 	}
 124807 
 124808 	if nReplaceTrig != 0 {
 124809 		Xsqlite3VdbeAddOp2(tls, v, OP_IfNot, regTrigCnt, lblRecheckOk)
 124810 
 124811 		if !(pPk != 0) {
 124812 			if isUpdate != 0 {
 124813 				Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regNewData, addrRecheck, regOldData)
 124814 				Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL))
 124815 
 124816 			}
 124817 			Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDataCur, addrRecheck, regNewData)
 124818 
 124819 			Xsqlite3RowidConstraint(tls, pParse, OE_Abort, pTab)
 124820 		} else {
 124821 			Xsqlite3VdbeGoto(tls, v, addrRecheck)
 124822 		}
 124823 		Xsqlite3VdbeResolveLabel(tls, v, lblRecheckOk)
 124824 	}
 124825 
 124826 	if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
 124827 		var regRec int32 = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(*(*int32)(unsafe.Pointer(bp + 40)))*4))
 124828 		Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regNewData+1, int32((*Table)(unsafe.Pointer(pTab)).FnNVCol), regRec)
 124829 
 124830 		if !(bAffinityDone != 0) {
 124831 			Xsqlite3TableAffinity(tls, v, pTab, 0)
 124832 		}
 124833 	}
 124834 
 124835 	*(*int32)(unsafe.Pointer(pbMayReplace)) = seenReplace
 124836 
 124837 }
 124838 
 124839 func codeWithoutRowidPreupdate(tls *libc.TLS, pParse uintptr, pTab uintptr, iCur int32, regData int32) {
 124840 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 124841 	var r int32 = Xsqlite3GetTempReg(tls, pParse)
 124842 
 124843 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, r)
 124844 	Xsqlite3VdbeAddOp4(tls, v, OP_Insert, iCur, regData, r, pTab, -5)
 124845 	Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_ISNOOP))
 124846 	Xsqlite3ReleaseTempReg(tls, pParse, r)
 124847 }
 124848 
 124849 // This routine generates code to finish the INSERT or UPDATE operation
 124850 // that was started by a prior call to sqlite3GenerateConstraintChecks.
 124851 // A consecutive range of registers starting at regNewData contains the
 124852 // rowid and the content to be inserted.
 124853 //
 124854 // The arguments to this routine should be the same as the first six
 124855 // arguments to sqlite3GenerateConstraintChecks.
 124856 func Xsqlite3CompleteInsertion(tls *libc.TLS, pParse uintptr, pTab uintptr, iDataCur int32, iIdxCur int32, regNewData int32, aRegIdx uintptr, update_flags int32, appendBias int32, useSeekResult int32) {
 124857 	var v uintptr
 124858 	var pIdx uintptr
 124859 	var pik_flags U8
 124860 	var i int32
 124861 
 124862 	v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 124863 
 124864 	i = 0
 124865 	pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex
 124866 __1:
 124867 	if !(pIdx != 0) {
 124868 		goto __3
 124869 	}
 124870 	{
 124871 		if *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) == 0 {
 124872 			goto __2
 124873 		}
 124874 		if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 {
 124875 			Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)), Xsqlite3VdbeCurrentAddr(tls, v)+2)
 124876 
 124877 		}
 124878 		pik_flags = func() uint8 {
 124879 			if useSeekResult != 0 {
 124880 				return uint8(OPFLAG_USESEEKRESULT)
 124881 			}
 124882 			return uint8(0)
 124883 		}()
 124884 		if int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY && !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 124885 			pik_flags = U8(int32(pik_flags) | OPFLAG_NCHANGE)
 124886 			pik_flags = U8(int32(pik_flags) | update_flags&OPFLAG_SAVEPOSITION)
 124887 			if update_flags == 0 {
 124888 				codeWithoutRowidPreupdate(tls, pParse, pTab, iIdxCur+i, *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)))
 124889 			}
 124890 		}
 124891 		Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iIdxCur+i, *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)),
 124892 			*(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4))+1,
 124893 			func() int32 {
 124894 				if uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x8>>3)) != 0 {
 124895 					return int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
 124896 				}
 124897 				return int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
 124898 			}())
 124899 		Xsqlite3VdbeChangeP5(tls, v, uint16(pik_flags))
 124900 
 124901 	}
 124902 	goto __2
 124903 __2:
 124904 	pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
 124905 	i++
 124906 	goto __1
 124907 	goto __3
 124908 __3:
 124909 	;
 124910 	if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 124911 		return
 124912 	}
 124913 	if (*Parse)(unsafe.Pointer(pParse)).Fnested != 0 {
 124914 		pik_flags = U8(0)
 124915 	} else {
 124916 		pik_flags = U8(OPFLAG_NCHANGE)
 124917 		pik_flags = U8(int32(pik_flags) | func() int32 {
 124918 			if update_flags != 0 {
 124919 				return update_flags
 124920 			}
 124921 			return OPFLAG_LASTROWID
 124922 		}())
 124923 	}
 124924 	if appendBias != 0 {
 124925 		pik_flags = U8(int32(pik_flags) | OPFLAG_APPEND)
 124926 	}
 124927 	if useSeekResult != 0 {
 124928 		pik_flags = U8(int32(pik_flags) | OPFLAG_USESEEKRESULT)
 124929 	}
 124930 	Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iDataCur, *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)), regNewData)
 124931 	if !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) {
 124932 		Xsqlite3VdbeAppendP4(tls, v, pTab, -5)
 124933 	}
 124934 	Xsqlite3VdbeChangeP5(tls, v, uint16(pik_flags))
 124935 }
 124936 
 124937 // Allocate cursors for the pTab table and all its indices and generate
 124938 // code to open and initialized those cursors.
 124939 //
 124940 // The cursor for the object that contains the complete data (normally
 124941 // the table itself, but the PRIMARY KEY index in the case of a WITHOUT
 124942 // ROWID table) is returned in *piDataCur.  The first index cursor is
 124943 // returned in *piIdxCur.  The number of indices is returned.
 124944 //
 124945 // Use iBase as the first cursor (either the *piDataCur for rowid tables
 124946 // or the first index for WITHOUT ROWID tables) if it is non-negative.
 124947 // If iBase is negative, then allocate the next available cursor.
 124948 //
 124949 // For a rowid table, *piDataCur will be exactly one less than *piIdxCur.
 124950 // For a WITHOUT ROWID table, *piDataCur will be somewhere in the range
 124951 // of *piIdxCurs, depending on where the PRIMARY KEY index appears on the
 124952 // pTab->pIndex list.
 124953 //
 124954 // If pTab is a virtual table, then this routine is a no-op and the
 124955 // *piDataCur and *piIdxCur values are left uninitialized.
 124956 func Xsqlite3OpenTableAndIndices(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, p5 U8, iBase int32, aToOpen uintptr, piDataCur uintptr, piIdxCur uintptr) int32 {
 124957 	var i int32
 124958 	var iDb int32
 124959 	var iDataCur int32
 124960 	var pIdx uintptr
 124961 	var v uintptr
 124962 
 124963 	if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
 124964 		*(*int32)(unsafe.Pointer(piDataCur)) = libc.AssignPtrInt32(piIdxCur, -999)
 124965 		return 0
 124966 	}
 124967 	iDb = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Table)(unsafe.Pointer(pTab)).FpSchema)
 124968 	v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 124969 
 124970 	if iBase < 0 {
 124971 		iBase = (*Parse)(unsafe.Pointer(pParse)).FnTab
 124972 	}
 124973 	iDataCur = libc.PostIncInt32(&iBase, 1)
 124974 	if piDataCur != 0 {
 124975 		*(*int32)(unsafe.Pointer(piDataCur)) = iDataCur
 124976 	}
 124977 	if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) && (aToOpen == uintptr(0) || *(*U8)(unsafe.Pointer(aToOpen)) != 0) {
 124978 		Xsqlite3OpenTable(tls, pParse, iDataCur, iDb, pTab, op)
 124979 	} else {
 124980 		Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, uint8(libc.Bool32(op == OP_OpenWrite)), (*Table)(unsafe.Pointer(pTab)).FzName)
 124981 	}
 124982 	if piIdxCur != 0 {
 124983 		*(*int32)(unsafe.Pointer(piIdxCur)) = iBase
 124984 	}
 124985 	i = 0
 124986 	pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex
 124987 __1:
 124988 	if !(pIdx != 0) {
 124989 		goto __3
 124990 	}
 124991 	{
 124992 		var iIdxCur int32 = libc.PostIncInt32(&iBase, 1)
 124993 
 124994 		if int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY && !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 124995 			if piDataCur != 0 {
 124996 				*(*int32)(unsafe.Pointer(piDataCur)) = iIdxCur
 124997 			}
 124998 			p5 = U8(0)
 124999 		}
 125000 		if aToOpen == uintptr(0) || *(*U8)(unsafe.Pointer(aToOpen + uintptr(i+1))) != 0 {
 125001 			Xsqlite3VdbeAddOp3(tls, v, op, iIdxCur, int32((*Index)(unsafe.Pointer(pIdx)).Ftnum), iDb)
 125002 			Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx)
 125003 			Xsqlite3VdbeChangeP5(tls, v, uint16(p5))
 125004 
 125005 		}
 125006 
 125007 	}
 125008 	goto __2
 125009 __2:
 125010 	pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
 125011 	i++
 125012 	goto __1
 125013 	goto __3
 125014 __3:
 125015 	;
 125016 	if iBase > (*Parse)(unsafe.Pointer(pParse)).FnTab {
 125017 		(*Parse)(unsafe.Pointer(pParse)).FnTab = iBase
 125018 	}
 125019 	return i
 125020 }
 125021 
 125022 func xferCompatibleIndex(tls *libc.TLS, pDest uintptr, pSrc uintptr) int32 {
 125023 	var i int32
 125024 
 125025 	if int32((*Index)(unsafe.Pointer(pDest)).FnKeyCol) != int32((*Index)(unsafe.Pointer(pSrc)).FnKeyCol) || int32((*Index)(unsafe.Pointer(pDest)).FnColumn) != int32((*Index)(unsafe.Pointer(pSrc)).FnColumn) {
 125026 		return 0
 125027 	}
 125028 	if int32((*Index)(unsafe.Pointer(pDest)).FonError) != int32((*Index)(unsafe.Pointer(pSrc)).FonError) {
 125029 		return 0
 125030 	}
 125031 	for i = 0; i < int32((*Index)(unsafe.Pointer(pSrc)).FnKeyCol); i++ {
 125032 		if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pSrc)).FaiColumn + uintptr(i)*2))) != int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pDest)).FaiColumn + uintptr(i)*2))) {
 125033 			return 0
 125034 		}
 125035 		if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pSrc)).FaiColumn + uintptr(i)*2))) == -2 {
 125036 			if Xsqlite3ExprCompare(tls, uintptr(0), (*ExprList_item)(unsafe.Pointer((*Index)(unsafe.Pointer(pSrc)).FaColExpr+8+uintptr(i)*32)).FpExpr,
 125037 				(*ExprList_item)(unsafe.Pointer((*Index)(unsafe.Pointer(pDest)).FaColExpr+8+uintptr(i)*32)).FpExpr, -1) != 0 {
 125038 				return 0
 125039 			}
 125040 		}
 125041 		if int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pSrc)).FaSortOrder + uintptr(i)))) != int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pDest)).FaSortOrder + uintptr(i)))) {
 125042 			return 0
 125043 		}
 125044 		if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pSrc)).FazColl + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pDest)).FazColl + uintptr(i)*8))) != 0 {
 125045 			return 0
 125046 		}
 125047 	}
 125048 	if Xsqlite3ExprCompare(tls, uintptr(0), (*Index)(unsafe.Pointer(pSrc)).FpPartIdxWhere, (*Index)(unsafe.Pointer(pDest)).FpPartIdxWhere, -1) != 0 {
 125049 		return 0
 125050 	}
 125051 
 125052 	return 1
 125053 }
 125054 
 125055 func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uintptr, onError int32, iDbDest int32) int32 {
 125056 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 125057 	var pEList uintptr
 125058 	var pSrc uintptr
 125059 	var pSrcIdx uintptr
 125060 	var pDestIdx uintptr
 125061 	var pItem uintptr
 125062 	var i int32
 125063 	var iDbSrc int32
 125064 	var iSrc int32
 125065 	var iDest int32
 125066 	var addr1 int32
 125067 	var addr2 int32
 125068 	var emptyDestTest int32 = 0
 125069 	var emptySrcTest int32 = 0
 125070 	var v uintptr
 125071 	var regAutoinc int32
 125072 	var destHasUniqueIdx int32 = 0
 125073 	var regData int32
 125074 	var regRowid int32
 125075 
 125076 	if (*Parse)(unsafe.Pointer(pParse)).FpWith != 0 || (*Select)(unsafe.Pointer(pSelect)).FpWith != 0 {
 125077 		return 0
 125078 	}
 125079 	if int32((*Table)(unsafe.Pointer(pDest)).FeTabType) == TABTYP_VTAB {
 125080 		return 0
 125081 	}
 125082 	if onError == OE_Default {
 125083 		if int32((*Table)(unsafe.Pointer(pDest)).FiPKey) >= 0 {
 125084 			onError = int32((*Table)(unsafe.Pointer(pDest)).FkeyConf)
 125085 		}
 125086 		if onError == OE_Default {
 125087 			onError = OE_Abort
 125088 		}
 125089 	}
 125090 
 125091 	if (*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpSrc)).FnSrc != 1 {
 125092 		return 0
 125093 	}
 125094 	if (*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpSrc+8)).FpSelect != 0 {
 125095 		return 0
 125096 	}
 125097 	if (*Select)(unsafe.Pointer(pSelect)).FpWhere != 0 {
 125098 		return 0
 125099 	}
 125100 	if (*Select)(unsafe.Pointer(pSelect)).FpOrderBy != 0 {
 125101 		return 0
 125102 	}
 125103 
 125104 	if (*Select)(unsafe.Pointer(pSelect)).FpGroupBy != 0 {
 125105 		return 0
 125106 	}
 125107 	if (*Select)(unsafe.Pointer(pSelect)).FpLimit != 0 {
 125108 		return 0
 125109 	}
 125110 	if (*Select)(unsafe.Pointer(pSelect)).FpPrior != 0 {
 125111 		return 0
 125112 	}
 125113 	if (*Select)(unsafe.Pointer(pSelect)).FselFlags&U32(SF_Distinct) != 0 {
 125114 		return 0
 125115 	}
 125116 	pEList = (*Select)(unsafe.Pointer(pSelect)).FpEList
 125117 
 125118 	if (*ExprList)(unsafe.Pointer(pEList)).FnExpr != 1 {
 125119 		return 0
 125120 	}
 125121 
 125122 	if int32((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(pEList+8)).FpExpr)).Fop) != TK_ASTERISK {
 125123 		return 0
 125124 	}
 125125 
 125126 	pItem = (*Select)(unsafe.Pointer(pSelect)).FpSrc + 8
 125127 	pSrc = Xsqlite3LocateTableItem(tls, pParse, uint32(0), pItem)
 125128 	if pSrc == uintptr(0) {
 125129 		return 0
 125130 	}
 125131 	if (*Table)(unsafe.Pointer(pSrc)).Ftnum == (*Table)(unsafe.Pointer(pDest)).Ftnum && (*Table)(unsafe.Pointer(pSrc)).FpSchema == (*Table)(unsafe.Pointer(pDest)).FpSchema {
 125132 		return 0
 125133 	}
 125134 	if libc.Bool32((*Table)(unsafe.Pointer(pDest)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) != libc.Bool32((*Table)(unsafe.Pointer(pSrc)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 125135 		return 0
 125136 	}
 125137 	if !(int32((*Table)(unsafe.Pointer(pSrc)).FeTabType) == TABTYP_NORM) {
 125138 		return 0
 125139 	}
 125140 	if int32((*Table)(unsafe.Pointer(pDest)).FnCol) != int32((*Table)(unsafe.Pointer(pSrc)).FnCol) {
 125141 		return 0
 125142 	}
 125143 	if int32((*Table)(unsafe.Pointer(pDest)).FiPKey) != int32((*Table)(unsafe.Pointer(pSrc)).FiPKey) {
 125144 		return 0
 125145 	}
 125146 	if (*Table)(unsafe.Pointer(pDest)).FtabFlags&U32(TF_Strict) != U32(0) && (*Table)(unsafe.Pointer(pSrc)).FtabFlags&U32(TF_Strict) == U32(0) {
 125147 		return 0
 125148 	}
 125149 	for i = 0; i < int32((*Table)(unsafe.Pointer(pDest)).FnCol); i++ {
 125150 		var pDestCol uintptr = (*Table)(unsafe.Pointer(pDest)).FaCol + uintptr(i)*24
 125151 		var pSrcCol uintptr = (*Table)(unsafe.Pointer(pSrc)).FaCol + uintptr(i)*24
 125152 
 125153 		if int32((*Column)(unsafe.Pointer(pDestCol)).FcolFlags)&COLFLAG_GENERATED != int32((*Column)(unsafe.Pointer(pSrcCol)).FcolFlags)&COLFLAG_GENERATED {
 125154 			return 0
 125155 		}
 125156 
 125157 		if int32((*Column)(unsafe.Pointer(pDestCol)).FcolFlags)&COLFLAG_GENERATED != 0 {
 125158 			if Xsqlite3ExprCompare(tls, uintptr(0),
 125159 				Xsqlite3ColumnExpr(tls, pSrc, pSrcCol),
 125160 				Xsqlite3ColumnExpr(tls, pDest, pDestCol), -1) != 0 {
 125161 				return 0
 125162 			}
 125163 		}
 125164 		if int32((*Column)(unsafe.Pointer(pDestCol)).Faffinity) != int32((*Column)(unsafe.Pointer(pSrcCol)).Faffinity) {
 125165 			return 0
 125166 		}
 125167 		if Xsqlite3_stricmp(tls, Xsqlite3ColumnColl(tls, pDestCol),
 125168 			Xsqlite3ColumnColl(tls, pSrcCol)) != 0 {
 125169 			return 0
 125170 		}
 125171 		if uint32(int32(*(*uint8)(unsafe.Pointer(pDestCol + 8))&0xf>>0)) != 0 && !(int32(*(*uint8)(unsafe.Pointer(pSrcCol + 8))&0xf>>0) != 0) {
 125172 			return 0
 125173 		}
 125174 
 125175 		if int32((*Column)(unsafe.Pointer(pDestCol)).FcolFlags)&COLFLAG_GENERATED == 0 && i > 0 {
 125176 			var pDestExpr uintptr = Xsqlite3ColumnExpr(tls, pDest, pDestCol)
 125177 			var pSrcExpr uintptr = Xsqlite3ColumnExpr(tls, pSrc, pSrcCol)
 125178 
 125179 			if libc.Bool32(pDestExpr == uintptr(0)) != libc.Bool32(pSrcExpr == uintptr(0)) ||
 125180 				pDestExpr != uintptr(0) && libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(pDestExpr + 8)),
 125181 					*(*uintptr)(unsafe.Pointer(pSrcExpr + 8))) != 0 {
 125182 				return 0
 125183 			}
 125184 		}
 125185 	}
 125186 	for pDestIdx = (*Table)(unsafe.Pointer(pDest)).FpIndex; pDestIdx != 0; pDestIdx = (*Index)(unsafe.Pointer(pDestIdx)).FpNext {
 125187 		if int32((*Index)(unsafe.Pointer(pDestIdx)).FonError) != OE_None {
 125188 			destHasUniqueIdx = 1
 125189 		}
 125190 		for pSrcIdx = (*Table)(unsafe.Pointer(pSrc)).FpIndex; pSrcIdx != 0; pSrcIdx = (*Index)(unsafe.Pointer(pSrcIdx)).FpNext {
 125191 			if xferCompatibleIndex(tls, pDestIdx, pSrcIdx) != 0 {
 125192 				break
 125193 			}
 125194 		}
 125195 		if pSrcIdx == uintptr(0) {
 125196 			return 0
 125197 		}
 125198 		if (*Index)(unsafe.Pointer(pSrcIdx)).Ftnum == (*Index)(unsafe.Pointer(pDestIdx)).Ftnum && (*Table)(unsafe.Pointer(pSrc)).FpSchema == (*Table)(unsafe.Pointer(pDest)).FpSchema &&
 125199 			Xsqlite3FaultSim(tls, 411) == SQLITE_OK {
 125200 			return 0
 125201 		}
 125202 	}
 125203 	if (*Table)(unsafe.Pointer(pDest)).FpCheck != 0 && Xsqlite3ExprListCompare(tls, (*Table)(unsafe.Pointer(pSrc)).FpCheck, (*Table)(unsafe.Pointer(pDest)).FpCheck, -1) != 0 {
 125204 		return 0
 125205 	}
 125206 
 125207 	if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ForeignKeys) != uint64(0) && *(*uintptr)(unsafe.Pointer(pDest + 64 + 8)) != uintptr(0) {
 125208 		return 0
 125209 	}
 125210 	if (*Sqlite3)(unsafe.Pointer(db)).Fflags&(uint64(0x00001)<<32) != uint64(0) {
 125211 		return 0
 125212 	}
 125213 
 125214 	iDbSrc = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pSrc)).FpSchema)
 125215 	v = Xsqlite3GetVdbe(tls, pParse)
 125216 	Xsqlite3CodeVerifySchema(tls, pParse, iDbSrc)
 125217 	iSrc = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 125218 	iDest = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 125219 	regAutoinc = autoIncBegin(tls, pParse, iDbDest, pDest)
 125220 	regData = Xsqlite3GetTempReg(tls, pParse)
 125221 	Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regData)
 125222 	regRowid = Xsqlite3GetTempReg(tls, pParse)
 125223 	Xsqlite3OpenTable(tls, pParse, iDest, iDbDest, pDest, OP_OpenWrite)
 125224 
 125225 	if (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_Vacuum) == U32(0) && (int32((*Table)(unsafe.Pointer(pDest)).FiPKey) < 0 && (*Table)(unsafe.Pointer(pDest)).FpIndex != uintptr(0) ||
 125226 		destHasUniqueIdx != 0 ||
 125227 		onError != OE_Abort && onError != OE_Rollback) {
 125228 		addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, iDest, 0)
 125229 		emptyDestTest = Xsqlite3VdbeAddOp0(tls, v, OP_Goto)
 125230 		Xsqlite3VdbeJumpHere(tls, v, addr1)
 125231 	}
 125232 	if (*Table)(unsafe.Pointer(pSrc)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
 125233 		var insFlags U8
 125234 		Xsqlite3OpenTable(tls, pParse, iSrc, iDbSrc, pSrc, OP_OpenRead)
 125235 		emptySrcTest = Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, iSrc, 0)
 125236 		if int32((*Table)(unsafe.Pointer(pDest)).FiPKey) >= 0 {
 125237 			addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iSrc, regRowid)
 125238 			if (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_Vacuum) == U32(0) {
 125239 				addr2 = Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDest, 0, regRowid)
 125240 
 125241 				Xsqlite3RowidConstraint(tls, pParse, onError, pDest)
 125242 				Xsqlite3VdbeJumpHere(tls, v, addr2)
 125243 			}
 125244 			autoIncStep(tls, pParse, regAutoinc, regRowid)
 125245 		} else if (*Table)(unsafe.Pointer(pDest)).FpIndex == uintptr(0) && !((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_VacuumInto) != 0) {
 125246 			addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iDest, regRowid)
 125247 		} else {
 125248 			addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iSrc, regRowid)
 125249 
 125250 		}
 125251 
 125252 		if (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_Vacuum) != 0 {
 125253 			Xsqlite3VdbeAddOp1(tls, v, OP_SeekEnd, iDest)
 125254 			insFlags = U8(OPFLAG_APPEND | OPFLAG_USESEEKRESULT | OPFLAG_PREFORMAT)
 125255 		} else {
 125256 			insFlags = U8(OPFLAG_NCHANGE | OPFLAG_LASTROWID | OPFLAG_APPEND | OPFLAG_PREFORMAT)
 125257 		}
 125258 		if (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_Vacuum) == U32(0) {
 125259 			Xsqlite3VdbeAddOp3(tls, v, OP_RowData, iSrc, regData, 1)
 125260 			insFlags = libc.Uint8FromInt32(int32(insFlags) & libc.CplInt32(OPFLAG_PREFORMAT))
 125261 		} else {
 125262 			Xsqlite3VdbeAddOp3(tls, v, OP_RowCell, iDest, iSrc, regRowid)
 125263 		}
 125264 		Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iDest, regData, regRowid)
 125265 		if (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_Vacuum) == U32(0) {
 125266 			Xsqlite3VdbeChangeP4(tls, v, -1, pDest, -5)
 125267 		}
 125268 		Xsqlite3VdbeChangeP5(tls, v, uint16(insFlags))
 125269 
 125270 		Xsqlite3VdbeAddOp2(tls, v, OP_Next, iSrc, addr1)
 125271 		Xsqlite3VdbeAddOp2(tls, v, OP_Close, iSrc, 0)
 125272 		Xsqlite3VdbeAddOp2(tls, v, OP_Close, iDest, 0)
 125273 	} else {
 125274 		Xsqlite3TableLock(tls, pParse, iDbDest, (*Table)(unsafe.Pointer(pDest)).Ftnum, uint8(1), (*Table)(unsafe.Pointer(pDest)).FzName)
 125275 		Xsqlite3TableLock(tls, pParse, iDbSrc, (*Table)(unsafe.Pointer(pSrc)).Ftnum, uint8(0), (*Table)(unsafe.Pointer(pSrc)).FzName)
 125276 	}
 125277 	for pDestIdx = (*Table)(unsafe.Pointer(pDest)).FpIndex; pDestIdx != 0; pDestIdx = (*Index)(unsafe.Pointer(pDestIdx)).FpNext {
 125278 		var idxInsFlags U8 = U8(0)
 125279 		for pSrcIdx = (*Table)(unsafe.Pointer(pSrc)).FpIndex; pSrcIdx != 0; pSrcIdx = (*Index)(unsafe.Pointer(pSrcIdx)).FpNext {
 125280 			if xferCompatibleIndex(tls, pDestIdx, pSrcIdx) != 0 {
 125281 				break
 125282 			}
 125283 		}
 125284 
 125285 		Xsqlite3VdbeAddOp3(tls, v, OP_OpenRead, iSrc, int32((*Index)(unsafe.Pointer(pSrcIdx)).Ftnum), iDbSrc)
 125286 		Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pSrcIdx)
 125287 
 125288 		Xsqlite3VdbeAddOp3(tls, v, OP_OpenWrite, iDest, int32((*Index)(unsafe.Pointer(pDestIdx)).Ftnum), iDbDest)
 125289 		Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pDestIdx)
 125290 		Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_BULKCSR))
 125291 
 125292 		addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, iSrc, 0)
 125293 		if (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_Vacuum) != 0 {
 125294 			for i = 0; i < int32((*Index)(unsafe.Pointer(pSrcIdx)).FnColumn); i++ {
 125295 				var zColl uintptr = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pSrcIdx)).FazColl + uintptr(i)*8))
 125296 				if Xsqlite3_stricmp(tls, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), zColl) != 0 {
 125297 					break
 125298 				}
 125299 			}
 125300 			if i == int32((*Index)(unsafe.Pointer(pSrcIdx)).FnColumn) {
 125301 				idxInsFlags = U8(OPFLAG_USESEEKRESULT | OPFLAG_PREFORMAT)
 125302 				Xsqlite3VdbeAddOp1(tls, v, OP_SeekEnd, iDest)
 125303 				Xsqlite3VdbeAddOp2(tls, v, OP_RowCell, iDest, iSrc)
 125304 			}
 125305 		} else if !((*Table)(unsafe.Pointer(pSrc)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) && int32(*(*uint16)(unsafe.Pointer(pDestIdx + 100))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY {
 125306 			idxInsFlags = U8(int32(idxInsFlags) | OPFLAG_NCHANGE)
 125307 		}
 125308 		if int32(idxInsFlags) != OPFLAG_USESEEKRESULT|OPFLAG_PREFORMAT {
 125309 			Xsqlite3VdbeAddOp3(tls, v, OP_RowData, iSrc, regData, 1)
 125310 			if (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_Vacuum) == U32(0) &&
 125311 				!((*Table)(unsafe.Pointer(pDest)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) &&
 125312 				int32(*(*uint16)(unsafe.Pointer(pDestIdx + 100))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY {
 125313 				codeWithoutRowidPreupdate(tls, pParse, pDest, iDest, regData)
 125314 			}
 125315 		}
 125316 		Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, iDest, regData)
 125317 		Xsqlite3VdbeChangeP5(tls, v, uint16(int32(idxInsFlags)|OPFLAG_APPEND))
 125318 		Xsqlite3VdbeAddOp2(tls, v, OP_Next, iSrc, addr1+1)
 125319 		Xsqlite3VdbeJumpHere(tls, v, addr1)
 125320 		Xsqlite3VdbeAddOp2(tls, v, OP_Close, iSrc, 0)
 125321 		Xsqlite3VdbeAddOp2(tls, v, OP_Close, iDest, 0)
 125322 	}
 125323 	if emptySrcTest != 0 {
 125324 		Xsqlite3VdbeJumpHere(tls, v, emptySrcTest)
 125325 	}
 125326 	Xsqlite3ReleaseTempReg(tls, pParse, regRowid)
 125327 	Xsqlite3ReleaseTempReg(tls, pParse, regData)
 125328 	if emptyDestTest != 0 {
 125329 		Xsqlite3AutoincrementEnd(tls, pParse)
 125330 		Xsqlite3VdbeAddOp2(tls, v, OP_Halt, SQLITE_OK, 0)
 125331 		Xsqlite3VdbeJumpHere(tls, v, emptyDestTest)
 125332 		Xsqlite3VdbeAddOp2(tls, v, OP_Close, iDest, 0)
 125333 		return 0
 125334 	} else {
 125335 		return 1
 125336 	}
 125337 	return int32(0)
 125338 }
 125339 
 125340 // Execute SQL code.  Return one of the SQLITE_ success/failure
 125341 // codes.  Also write an error message into memory obtained from
 125342 // malloc() and make *pzErrMsg point to that message.
 125343 //
 125344 // If the SQL is a query, then for each row in the query result
 125345 // the xCallback() function is called.  pArg becomes the first
 125346 // argument to xCallback().  If xCallback=NULL then no callback
 125347 // is invoked, even for queries.
 125348 func Xsqlite3_exec(tls *libc.TLS, db uintptr, zSql uintptr, xCallback Sqlite3_callback, pArg uintptr, pzErrMsg uintptr) int32 {
 125349 	bp := tls.Alloc(16)
 125350 	defer tls.Free(16)
 125351 
 125352 	var rc int32
 125353 
 125354 	var azCols uintptr
 125355 	var callbackIsInit int32
 125356 	var i int32
 125357 	var nCol int32
 125358 	var azVals uintptr
 125359 	rc = SQLITE_OK
 125360 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 125361 	azCols = uintptr(0)
 125362 
 125363 	if !!(Xsqlite3SafetyCheckOk(tls, db) != 0) {
 125364 		goto __1
 125365 	}
 125366 	return Xsqlite3MisuseError(tls, 131931)
 125367 __1:
 125368 	;
 125369 	if !(zSql == uintptr(0)) {
 125370 		goto __2
 125371 	}
 125372 	zSql = ts + 1544
 125373 __2:
 125374 	;
 125375 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 125376 	Xsqlite3Error(tls, db, SQLITE_OK)
 125377 __3:
 125378 	if !(rc == SQLITE_OK && *(*int8)(unsafe.Pointer(zSql)) != 0) {
 125379 		goto __4
 125380 	}
 125381 	nCol = 0
 125382 	azVals = uintptr(0)
 125383 
 125384 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 125385 	rc = Xsqlite3_prepare_v2(tls, db, zSql, -1, bp, bp+8)
 125386 
 125387 	if !(rc != SQLITE_OK) {
 125388 		goto __5
 125389 	}
 125390 	goto __3
 125391 __5:
 125392 	;
 125393 	if !!(*(*uintptr)(unsafe.Pointer(bp)) != 0) {
 125394 		goto __6
 125395 	}
 125396 
 125397 	zSql = *(*uintptr)(unsafe.Pointer(bp + 8))
 125398 	goto __3
 125399 __6:
 125400 	;
 125401 	callbackIsInit = 0
 125402 
 125403 __7:
 125404 	if !(1 != 0) {
 125405 		goto __8
 125406 	}
 125407 	rc = Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp)))
 125408 
 125409 	if !(xCallback != 0 && (SQLITE_ROW == rc || SQLITE_DONE == rc && !(callbackIsInit != 0) &&
 125410 		(*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_NullCallback) != 0)) {
 125411 		goto __9
 125412 	}
 125413 	if !!(callbackIsInit != 0) {
 125414 		goto __10
 125415 	}
 125416 	nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp)))
 125417 	azCols = Xsqlite3DbMallocRaw(tls, db, uint64(2*nCol+1)*uint64(unsafe.Sizeof(uintptr(0))))
 125418 	if !(azCols == uintptr(0)) {
 125419 		goto __11
 125420 	}
 125421 	goto exec_out
 125422 __11:
 125423 	;
 125424 	i = 0
 125425 __12:
 125426 	if !(i < nCol) {
 125427 		goto __14
 125428 	}
 125429 	*(*uintptr)(unsafe.Pointer(azCols + uintptr(i)*8)) = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), i)
 125430 
 125431 	goto __13
 125432 __13:
 125433 	i++
 125434 	goto __12
 125435 	goto __14
 125436 __14:
 125437 	;
 125438 	callbackIsInit = 1
 125439 __10:
 125440 	;
 125441 	if !(rc == SQLITE_ROW) {
 125442 		goto __15
 125443 	}
 125444 	azVals = azCols + uintptr(nCol)*8
 125445 	i = 0
 125446 __16:
 125447 	if !(i < nCol) {
 125448 		goto __18
 125449 	}
 125450 	*(*uintptr)(unsafe.Pointer(azVals + uintptr(i)*8)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), i)
 125451 	if !(!(int32(*(*uintptr)(unsafe.Pointer(azVals + uintptr(i)*8))) != 0) && Xsqlite3_column_type(tls, *(*uintptr)(unsafe.Pointer(bp)), i) != SQLITE_NULL) {
 125452 		goto __19
 125453 	}
 125454 	Xsqlite3OomFault(tls, db)
 125455 	goto exec_out
 125456 __19:
 125457 	;
 125458 	goto __17
 125459 __17:
 125460 	i++
 125461 	goto __16
 125462 	goto __18
 125463 __18:
 125464 	;
 125465 	*(*uintptr)(unsafe.Pointer(azVals + uintptr(i)*8)) = uintptr(0)
 125466 __15:
 125467 	;
 125468 	if !((*struct {
 125469 		f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
 125470 	})(unsafe.Pointer(&struct{ uintptr }{xCallback})).f(tls, pArg, nCol, azVals, azCols) != 0) {
 125471 		goto __20
 125472 	}
 125473 
 125474 	rc = SQLITE_ABORT
 125475 	Xsqlite3VdbeFinalize(tls, *(*uintptr)(unsafe.Pointer(bp)))
 125476 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 125477 	Xsqlite3Error(tls, db, SQLITE_ABORT)
 125478 	goto exec_out
 125479 __20:
 125480 	;
 125481 __9:
 125482 	;
 125483 	if !(rc != SQLITE_ROW) {
 125484 		goto __21
 125485 	}
 125486 	rc = Xsqlite3VdbeFinalize(tls, *(*uintptr)(unsafe.Pointer(bp)))
 125487 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 125488 	zSql = *(*uintptr)(unsafe.Pointer(bp + 8))
 125489 __22:
 125490 	if !(int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zSql)))])&0x01 != 0) {
 125491 		goto __23
 125492 	}
 125493 	zSql++
 125494 	goto __22
 125495 __23:
 125496 	;
 125497 	goto __8
 125498 __21:
 125499 	;
 125500 	goto __7
 125501 __8:
 125502 	;
 125503 	Xsqlite3DbFree(tls, db, azCols)
 125504 	azCols = uintptr(0)
 125505 	goto __3
 125506 __4:
 125507 	;
 125508 exec_out:
 125509 	if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) {
 125510 		goto __24
 125511 	}
 125512 	Xsqlite3VdbeFinalize(tls, *(*uintptr)(unsafe.Pointer(bp)))
 125513 __24:
 125514 	;
 125515 	Xsqlite3DbFree(tls, db, azCols)
 125516 
 125517 	rc = Xsqlite3ApiExit(tls, db, rc)
 125518 	if !(rc != SQLITE_OK && pzErrMsg != 0) {
 125519 		goto __25
 125520 	}
 125521 	*(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3DbStrDup(tls, uintptr(0), Xsqlite3_errmsg(tls, db))
 125522 	if !(*(*uintptr)(unsafe.Pointer(pzErrMsg)) == uintptr(0)) {
 125523 		goto __27
 125524 	}
 125525 	rc = SQLITE_NOMEM
 125526 	Xsqlite3Error(tls, db, SQLITE_NOMEM)
 125527 __27:
 125528 	;
 125529 	goto __26
 125530 __25:
 125531 	if !(pzErrMsg != 0) {
 125532 		goto __28
 125533 	}
 125534 	*(*uintptr)(unsafe.Pointer(pzErrMsg)) = uintptr(0)
 125535 __28:
 125536 	;
 125537 __26:
 125538 	;
 125539 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 125540 	return rc
 125541 }
 125542 
 125543 // This is the function signature used for all extension entry points.  It
 125544 // is also defined in the file "loadext.c".
 125545 type Sqlite3_loadext_entry = uintptr
 125546 
 125547 var sqlite3Apis = Sqlite3_api_routines{
 125548 	Faggregate_context:      0,
 125549 	Faggregate_count:        0,
 125550 	Fbind_blob:              0,
 125551 	Fbind_double:            0,
 125552 	Fbind_int:               0,
 125553 	Fbind_int64:             0,
 125554 	Fbind_null:              0,
 125555 	Fbind_parameter_count:   0,
 125556 	Fbind_parameter_index:   0,
 125557 	Fbind_parameter_name:    0,
 125558 	Fbind_text:              0,
 125559 	Fbind_text16:            0,
 125560 	Fbind_value:             0,
 125561 	Fbusy_handler:           0,
 125562 	Fbusy_timeout:           0,
 125563 	Fchanges:                0,
 125564 	Fclose:                  0,
 125565 	Fcollation_needed:       0,
 125566 	Fcollation_needed16:     0,
 125567 	Fcolumn_blob:            0,
 125568 	Fcolumn_bytes:           0,
 125569 	Fcolumn_bytes16:         0,
 125570 	Fcolumn_count:           0,
 125571 	Fcolumn_database_name:   0,
 125572 	Fcolumn_database_name16: 0,
 125573 	Fcolumn_decltype:        0,
 125574 	Fcolumn_decltype16:      0,
 125575 	Fcolumn_double:          0,
 125576 	Fcolumn_int:             0,
 125577 	Fcolumn_int64:           0,
 125578 	Fcolumn_name:            0,
 125579 	Fcolumn_name16:          0,
 125580 	Fcolumn_origin_name:     0,
 125581 	Fcolumn_origin_name16:   0,
 125582 	Fcolumn_table_name:      0,
 125583 	Fcolumn_table_name16:    0,
 125584 	Fcolumn_text:            0,
 125585 	Fcolumn_text16:          0,
 125586 	Fcolumn_type:            0,
 125587 	Fcolumn_value:           0,
 125588 	Fcommit_hook:            0,
 125589 	Fcomplete:               0,
 125590 	Fcomplete16:             0,
 125591 	Fcreate_collation:       0,
 125592 	Fcreate_collation16:     0,
 125593 	Fcreate_function:        0,
 125594 	Fcreate_function16:      0,
 125595 	Fcreate_module:          0,
 125596 	Fdata_count:             0,
 125597 	Fdb_handle:              0,
 125598 	Fdeclare_vtab:           0,
 125599 	Fenable_shared_cache:    0,
 125600 	Ferrcode:                0,
 125601 	Ferrmsg:                 0,
 125602 	Ferrmsg16:               0,
 125603 	Fexec:                   0,
 125604 	Fexpired:                0,
 125605 	Ffinalize:               0,
 125606 	Ffree:                   0,
 125607 	Ffree_table:             0,
 125608 	Fget_autocommit:         0,
 125609 	Fget_auxdata:            0,
 125610 	Fget_table:              0,
 125611 	Finterruptx:             0,
 125612 	Flast_insert_rowid:      0,
 125613 	Flibversion:             0,
 125614 	Flibversion_number:      0,
 125615 	Fmalloc:                 0,
 125616 	Fmprintf:                0,
 125617 	Fopen:                   0,
 125618 	Fopen16:                 0,
 125619 	Fprepare:                0,
 125620 	Fprepare16:              0,
 125621 	Fprofile:                0,
 125622 	Fprogress_handler:       0,
 125623 	Frealloc:                0,
 125624 	Freset:                  0,
 125625 	Fresult_blob:            0,
 125626 	Fresult_double:          0,
 125627 	Fresult_error:           0,
 125628 	Fresult_error16:         0,
 125629 	Fresult_int:             0,
 125630 	Fresult_int64:           0,
 125631 	Fresult_null:            0,
 125632 	Fresult_text:            0,
 125633 	Fresult_text16:          0,
 125634 	Fresult_text16be:        0,
 125635 	Fresult_text16le:        0,
 125636 	Fresult_value:           0,
 125637 	Frollback_hook:          0,
 125638 	Fset_authorizer:         0,
 125639 	Fset_auxdata:            0,
 125640 	Fxsnprintf:              0,
 125641 	Fstep:                   0,
 125642 	Ftable_column_metadata:  0,
 125643 	Fthread_cleanup:         0,
 125644 	Ftotal_changes:          0,
 125645 	Ftrace:                  0,
 125646 	Ftransfer_bindings:      0,
 125647 	Fupdate_hook:            0,
 125648 	Fuser_data:              0,
 125649 	Fvalue_blob:             0,
 125650 	Fvalue_bytes:            0,
 125651 	Fvalue_bytes16:          0,
 125652 	Fvalue_double:           0,
 125653 	Fvalue_int:              0,
 125654 	Fvalue_int64:            0,
 125655 	Fvalue_numeric_type:     0,
 125656 	Fvalue_text:             0,
 125657 	Fvalue_text16:           0,
 125658 	Fvalue_text16be:         0,
 125659 	Fvalue_text16le:         0,
 125660 	Fvalue_type:             0,
 125661 	Fvmprintf:               0,
 125662 	Foverload_function:      0,
 125663 	Fprepare_v2:             0,
 125664 	Fprepare16_v2:           0,
 125665 	Fclear_bindings:         0,
 125666 	Fcreate_module_v2:       0,
 125667 	Fbind_zeroblob:          0,
 125668 	Fblob_bytes:             0,
 125669 	Fblob_close:             0,
 125670 	Fblob_open:              0,
 125671 	Fblob_read:              0,
 125672 	Fblob_write:             0,
 125673 	Fcreate_collation_v2:    0,
 125674 	Ffile_control:           0,
 125675 	Fmemory_highwater:       0,
 125676 	Fmemory_used:            0,
 125677 	Fmutex_alloc:            0,
 125678 	Fmutex_enter:            0,
 125679 	Fmutex_free:             0,
 125680 	Fmutex_leave:            0,
 125681 	Fmutex_try:              0,
 125682 	Fopen_v2:                0,
 125683 	Frelease_memory:         0,
 125684 	Fresult_error_nomem:     0,
 125685 	Fresult_error_toobig:    0,
 125686 	Fsleep:                  0,
 125687 	Fsoft_heap_limit:        0,
 125688 	Fvfs_find:               0,
 125689 	Fvfs_register:           0,
 125690 	Fvfs_unregister:         0,
 125691 	Fxthreadsafe:            0,
 125692 	Fresult_zeroblob:        0,
 125693 	Fresult_error_code:      0,
 125694 	Ftest_control:           0,
 125695 	Frandomness:             0,
 125696 	Fcontext_db_handle:      0,
 125697 	Fextended_result_codes:  0,
 125698 	Flimit:                  0,
 125699 	Fnext_stmt:              0,
 125700 	Fsql:                    0,
 125701 	Fstatus:                 0,
 125702 	Fbackup_finish:          0,
 125703 	Fbackup_init:            0,
 125704 	Fbackup_pagecount:       0,
 125705 	Fbackup_remaining:       0,
 125706 	Fbackup_step:            0,
 125707 	Fcompileoption_get:      0,
 125708 	Fcompileoption_used:     0,
 125709 	Fcreate_function_v2:     0,
 125710 	Fdb_config:              0,
 125711 	Fdb_mutex:               0,
 125712 	Fdb_status:              0,
 125713 	Fextended_errcode:       0,
 125714 	Flog:                    0,
 125715 	Fsoft_heap_limit64:      0,
 125716 	Fsourceid:               0,
 125717 	Fstmt_status:            0,
 125718 	Fstrnicmp:               0,
 125719 	Funlock_notify:          0,
 125720 	Fwal_autocheckpoint:     0,
 125721 	Fwal_checkpoint:         0,
 125722 	Fwal_hook:               0,
 125723 	Fblob_reopen:            0,
 125724 	Fvtab_config:            0,
 125725 	Fvtab_on_conflict:       0,
 125726 	Fclose_v2:               0,
 125727 	Fdb_filename:            0,
 125728 	Fdb_readonly:            0,
 125729 	Fdb_release_memory:      0,
 125730 	Ferrstr:                 0,
 125731 	Fstmt_busy:              0,
 125732 	Fstmt_readonly:          0,
 125733 	Fstricmp:                0,
 125734 	Furi_boolean:            0,
 125735 	Furi_int64:              0,
 125736 	Furi_parameter:          0,
 125737 	Fxvsnprintf:             0,
 125738 	Fwal_checkpoint_v2:      0,
 125739 	Fauto_extension:         0,
 125740 	Fbind_blob64:            0,
 125741 	Fbind_text64:            0,
 125742 	Fcancel_auto_extension:  0,
 125743 	Fload_extension:         0,
 125744 	Fmalloc64:               0,
 125745 	Fmsize:                  0,
 125746 	Frealloc64:              0,
 125747 	Freset_auto_extension:   0,
 125748 	Fresult_blob64:          0,
 125749 	Fresult_text64:          0,
 125750 	Fstrglob:                0,
 125751 	Fvalue_dup:              0,
 125752 	Fvalue_free:             0,
 125753 	Fresult_zeroblob64:      0,
 125754 	Fbind_zeroblob64:        0,
 125755 	Fvalue_subtype:          0,
 125756 	Fresult_subtype:         0,
 125757 	Fstatus64:               0,
 125758 	Fstrlike:                0,
 125759 	Fdb_cacheflush:          0,
 125760 	Fsystem_errno:           0,
 125761 	Ftrace_v2:               0,
 125762 	Fexpanded_sql:           0,
 125763 	Fset_last_insert_rowid:  0,
 125764 	Fprepare_v3:             0,
 125765 	Fprepare16_v3:           0,
 125766 	Fbind_pointer:           0,
 125767 	Fresult_pointer:         0,
 125768 	Fvalue_pointer:          0,
 125769 	Fvtab_nochange:          0,
 125770 	Fvalue_nochange:         0,
 125771 	Fvtab_collation:         0,
 125772 	Fkeyword_count:          0,
 125773 	Fkeyword_name:           0,
 125774 	Fkeyword_check:          0,
 125775 	Fstr_new:                0,
 125776 	Fstr_finish:             0,
 125777 	Fstr_appendf:            0,
 125778 	Fstr_vappendf:           0,
 125779 	Fstr_append:             0,
 125780 	Fstr_appendall:          0,
 125781 	Fstr_appendchar:         0,
 125782 	Fstr_reset:              0,
 125783 	Fstr_errcode:            0,
 125784 	Fstr_length:             0,
 125785 	Fstr_value:              0,
 125786 	Fcreate_window_function: 0,
 125787 	Fstmt_isexplain:         0,
 125788 	Fvalue_frombind:         0,
 125789 	Fdrop_modules:           0,
 125790 	Fhard_heap_limit64:      0,
 125791 	Furi_key:                0,
 125792 	Ffilename_database:      0,
 125793 	Ffilename_journal:       0,
 125794 	Ffilename_wal:           0,
 125795 	Fcreate_filename:        0,
 125796 	Ffree_filename:          0,
 125797 	Fdatabase_file_object:   0,
 125798 	Ftxn_state:              0,
 125799 	Fchanges64:              0,
 125800 	Ftotal_changes64:        0,
 125801 	Fautovacuum_pages:       0,
 125802 	Ferror_offset:           0,
 125803 	Fvtab_rhs_value:         0,
 125804 	Fvtab_distinct:          0,
 125805 	Fvtab_in:                0,
 125806 	Fvtab_in_first:          0,
 125807 	Fvtab_in_next:           0,
 125808 	Fdeserialize:            0,
 125809 	Fserialize:              0,
 125810 	Fdb_name:                0,
 125811 	Fvalue_encoding:         0,
 125812 	Fis_interrupted:         0,
 125813 }
 125814 
 125815 func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) int32 {
 125816 	bp := tls.Alloc(64)
 125817 	defer tls.Free(64)
 125818 
 125819 	var pVfs uintptr
 125820 	var handle uintptr
 125821 	var xInit Sqlite3_loadext_entry
 125822 
 125823 	var zEntry uintptr
 125824 	var zAltEntry uintptr
 125825 	var aHandle uintptr
 125826 	var nMsg U64
 125827 	var ii int32
 125828 	var rc int32
 125829 	var zAltFile uintptr
 125830 	var iFile int32
 125831 	var iEntry int32
 125832 	var c int32
 125833 	var ncFile int32
 125834 	pVfs = (*Sqlite3)(unsafe.Pointer(db)).FpVfs
 125835 	*(*uintptr)(unsafe.Pointer(bp + 56)) = uintptr(0)
 125836 	zAltEntry = uintptr(0)
 125837 	nMsg = libc.Xstrlen(tls, zFile)
 125838 
 125839 	if !(pzErrMsg != 0) {
 125840 		goto __1
 125841 	}
 125842 	*(*uintptr)(unsafe.Pointer(pzErrMsg)) = uintptr(0)
 125843 __1:
 125844 	;
 125845 	if !((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_LoadExtension) == uint64(0)) {
 125846 		goto __2
 125847 	}
 125848 	if !(pzErrMsg != 0) {
 125849 		goto __3
 125850 	}
 125851 	*(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+13452, 0)
 125852 __3:
 125853 	;
 125854 	return SQLITE_ERROR
 125855 __2:
 125856 	;
 125857 	if zProc != 0 {
 125858 		zEntry = zProc
 125859 	} else {
 125860 		zEntry = ts + 17245
 125861 	}
 125862 
 125863 	if !(nMsg > uint64(FILENAME_MAX)) {
 125864 		goto __4
 125865 	}
 125866 	goto extension_not_found
 125867 __4:
 125868 	;
 125869 	handle = Xsqlite3OsDlOpen(tls, pVfs, zFile)
 125870 	ii = 0
 125871 __5:
 125872 	if !(ii < int32(uint64(unsafe.Sizeof(azEndings))/uint64(unsafe.Sizeof(uintptr(0)))) && handle == uintptr(0)) {
 125873 		goto __7
 125874 	}
 125875 	zAltFile = Xsqlite3_mprintf(tls, ts+13413, libc.VaList(bp, zFile, azEndings[ii]))
 125876 	if !(zAltFile == uintptr(0)) {
 125877 		goto __8
 125878 	}
 125879 	return SQLITE_NOMEM
 125880 __8:
 125881 	;
 125882 	handle = Xsqlite3OsDlOpen(tls, pVfs, zAltFile)
 125883 	Xsqlite3_free(tls, zAltFile)
 125884 	goto __6
 125885 __6:
 125886 	ii++
 125887 	goto __5
 125888 	goto __7
 125889 __7:
 125890 	;
 125891 	if !(handle == uintptr(0)) {
 125892 		goto __9
 125893 	}
 125894 	goto extension_not_found
 125895 __9:
 125896 	;
 125897 	xInit = Xsqlite3OsDlSym(tls, pVfs, handle, zEntry)
 125898 
 125899 	if !(xInit == uintptr(0) && zProc == uintptr(0)) {
 125900 		goto __10
 125901 	}
 125902 	ncFile = Xsqlite3Strlen30(tls, zFile)
 125903 	zAltEntry = Xsqlite3_malloc64(tls, uint64(ncFile+30))
 125904 	if !(zAltEntry == uintptr(0)) {
 125905 		goto __11
 125906 	}
 125907 	Xsqlite3OsDlClose(tls, pVfs, handle)
 125908 	return SQLITE_NOMEM
 125909 __11:
 125910 	;
 125911 	libc.Xmemcpy(tls, zAltEntry, ts+17268, uint64(8))
 125912 	iFile = ncFile - 1
 125913 __12:
 125914 	if !(iFile >= 0 && !(int32(*(*int8)(unsafe.Pointer(zFile + uintptr(iFile)))) == '/' || int32(*(*int8)(unsafe.Pointer(zFile + uintptr(iFile)))) == '\\')) {
 125915 		goto __14
 125916 	}
 125917 	goto __13
 125918 __13:
 125919 	iFile--
 125920 	goto __12
 125921 	goto __14
 125922 __14:
 125923 	;
 125924 	iFile++
 125925 	if !(Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), ts+17277, 3) == 0) {
 125926 		goto __15
 125927 	}
 125928 	iFile = iFile + 3
 125929 __15:
 125930 	;
 125931 	iEntry = 8
 125932 __16:
 125933 	if !(libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(zFile + uintptr(iFile))))) != 0 && c != '.') {
 125934 		goto __18
 125935 	}
 125936 	if !(int32(Xsqlite3CtypeMap[uint8(c)])&0x02 != 0) {
 125937 		goto __19
 125938 	}
 125939 	*(*int8)(unsafe.Pointer(zAltEntry + uintptr(libc.PostIncInt32(&iEntry, 1)))) = int8(Xsqlite3UpperToLower[uint32(c)])
 125940 __19:
 125941 	;
 125942 	goto __17
 125943 __17:
 125944 	iFile++
 125945 	goto __16
 125946 	goto __18
 125947 __18:
 125948 	;
 125949 	libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), ts+17281, uint64(6))
 125950 	zEntry = zAltEntry
 125951 	xInit = Xsqlite3OsDlSym(tls, pVfs, handle, zEntry)
 125952 __10:
 125953 	;
 125954 	if !(xInit == uintptr(0)) {
 125955 		goto __20
 125956 	}
 125957 	if !(pzErrMsg != 0) {
 125958 		goto __21
 125959 	}
 125960 	nMsg = nMsg + (libc.Xstrlen(tls, zEntry) + uint64(300))
 125961 	*(*uintptr)(unsafe.Pointer(pzErrMsg)) = libc.AssignPtrUintptr(bp+56, Xsqlite3_malloc64(tls, nMsg))
 125962 	if !(*(*uintptr)(unsafe.Pointer(bp + 56)) != 0) {
 125963 		goto __22
 125964 	}
 125965 
 125966 	Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp + 56)),
 125967 		ts+17287, libc.VaList(bp+16, zEntry, zFile))
 125968 	Xsqlite3OsDlError(tls, pVfs, int32(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp + 56)))
 125969 __22:
 125970 	;
 125971 __21:
 125972 	;
 125973 	Xsqlite3OsDlClose(tls, pVfs, handle)
 125974 	Xsqlite3_free(tls, zAltEntry)
 125975 	return SQLITE_ERROR
 125976 __20:
 125977 	;
 125978 	Xsqlite3_free(tls, zAltEntry)
 125979 	rc = (*struct {
 125980 		f func(*libc.TLS, uintptr, uintptr, uintptr) int32
 125981 	})(unsafe.Pointer(&struct{ uintptr }{xInit})).f(tls, db, bp+56, uintptr(unsafe.Pointer(&sqlite3Apis)))
 125982 	if !(rc != 0) {
 125983 		goto __23
 125984 	}
 125985 	if !(rc == SQLITE_OK|int32(1)<<8) {
 125986 		goto __24
 125987 	}
 125988 	return SQLITE_OK
 125989 __24:
 125990 	;
 125991 	if !(pzErrMsg != 0) {
 125992 		goto __25
 125993 	}
 125994 	*(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+17330, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(bp + 56))))
 125995 __25:
 125996 	;
 125997 	Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 56)))
 125998 	Xsqlite3OsDlClose(tls, pVfs, handle)
 125999 	return SQLITE_ERROR
 126000 __23:
 126001 	;
 126002 	aHandle = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(handle))*uint64((*Sqlite3)(unsafe.Pointer(db)).FnExtension+1))
 126003 	if !(aHandle == uintptr(0)) {
 126004 		goto __26
 126005 	}
 126006 	return SQLITE_NOMEM
 126007 __26:
 126008 	;
 126009 	if !((*Sqlite3)(unsafe.Pointer(db)).FnExtension > 0) {
 126010 		goto __27
 126011 	}
 126012 	libc.Xmemcpy(tls, aHandle, (*Sqlite3)(unsafe.Pointer(db)).FaExtension, uint64(unsafe.Sizeof(handle))*uint64((*Sqlite3)(unsafe.Pointer(db)).FnExtension))
 126013 __27:
 126014 	;
 126015 	Xsqlite3DbFree(tls, db, (*Sqlite3)(unsafe.Pointer(db)).FaExtension)
 126016 	(*Sqlite3)(unsafe.Pointer(db)).FaExtension = aHandle
 126017 
 126018 	*(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaExtension + uintptr(libc.PostIncInt32(&(*Sqlite3)(unsafe.Pointer(db)).FnExtension, 1))*8)) = handle
 126019 	return SQLITE_OK
 126020 
 126021 extension_not_found:
 126022 	if !(pzErrMsg != 0) {
 126023 		goto __28
 126024 	}
 126025 	nMsg = nMsg + uint64(300)
 126026 	*(*uintptr)(unsafe.Pointer(pzErrMsg)) = libc.AssignPtrUintptr(bp+56, Xsqlite3_malloc64(tls, nMsg))
 126027 	if !(*(*uintptr)(unsafe.Pointer(bp + 56)) != 0) {
 126028 		goto __29
 126029 	}
 126030 
 126031 	Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp + 56)),
 126032 		ts+17362, libc.VaList(bp+40, FILENAME_MAX, zFile))
 126033 	Xsqlite3OsDlError(tls, pVfs, int32(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp + 56)))
 126034 __29:
 126035 	;
 126036 __28:
 126037 	;
 126038 	return SQLITE_ERROR
 126039 }
 126040 
 126041 var azEndings = [1]uintptr{
 126042 	ts + 17399,
 126043 }
 126044 
 126045 func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) int32 {
 126046 	var rc int32
 126047 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 126048 	rc = sqlite3LoadExtension(tls, db, zFile, zProc, pzErrMsg)
 126049 	rc = Xsqlite3ApiExit(tls, db, rc)
 126050 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 126051 	return rc
 126052 }
 126053 
 126054 // Call this routine when the database connection is closing in order
 126055 // to clean up loaded extensions
 126056 func Xsqlite3CloseExtensions(tls *libc.TLS, db uintptr) {
 126057 	var i int32
 126058 
 126059 	for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnExtension; i++ {
 126060 		Xsqlite3OsDlClose(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, *(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaExtension + uintptr(i)*8)))
 126061 	}
 126062 	Xsqlite3DbFree(tls, db, (*Sqlite3)(unsafe.Pointer(db)).FaExtension)
 126063 }
 126064 
 126065 // Enable or disable extension loading.  Extension loading is disabled by
 126066 // default so as not to open security holes in older applications.
 126067 func Xsqlite3_enable_load_extension(tls *libc.TLS, db uintptr, onoff int32) int32 {
 126068 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 126069 	if onoff != 0 {
 126070 		*(*U64)(unsafe.Pointer(db + 48)) |= uint64(SQLITE_LoadExtension | SQLITE_LoadExtFunc)
 126071 	} else {
 126072 		*(*U64)(unsafe.Pointer(db + 48)) &= libc.CplUint64(uint64(SQLITE_LoadExtension | SQLITE_LoadExtFunc))
 126073 	}
 126074 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 126075 	return SQLITE_OK
 126076 }
 126077 
 126078 type sqlite3AutoExtList = struct {
 126079 	FnExt        U32
 126080 	F__ccgo_pad1 [4]byte
 126081 	FaExt        uintptr
 126082 }
 126083 
 126084 // The following object holds the list of automatically loaded
 126085 // extensions.
 126086 //
 126087 // This list is shared across threads.  The SQLITE_MUTEX_STATIC_MAIN
 126088 // mutex must be held while accessing this list.
 126089 type Sqlite3AutoExtList = sqlite3AutoExtList
 126090 
 126091 var sqlite3Autoext = sqlite3AutoExtList{}
 126092 
 126093 // Register a statically linked extension that is automatically
 126094 // loaded by every new database connection.
 126095 func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) int32 {
 126096 	var rc int32 = SQLITE_OK
 126097 	rc = Xsqlite3_initialize(tls)
 126098 	if rc != 0 {
 126099 		return rc
 126100 	} else {
 126101 		var i U32
 126102 		var mutex uintptr = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN)
 126103 
 126104 		Xsqlite3_mutex_enter(tls, mutex)
 126105 		for i = U32(0); i < sqlite3Autoext.FnExt; i++ {
 126106 			if *(*uintptr)(unsafe.Pointer(sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit {
 126107 				break
 126108 			}
 126109 		}
 126110 		if i == sqlite3Autoext.FnExt {
 126111 			var nByte U64 = uint64(sqlite3Autoext.FnExt+U32(1)) * uint64(unsafe.Sizeof(uintptr(0)))
 126112 			var aNew uintptr
 126113 			aNew = Xsqlite3_realloc64(tls, sqlite3Autoext.FaExt, nByte)
 126114 			if aNew == uintptr(0) {
 126115 				rc = SQLITE_NOMEM
 126116 			} else {
 126117 				sqlite3Autoext.FaExt = aNew
 126118 				*(*uintptr)(unsafe.Pointer(sqlite3Autoext.FaExt + uintptr(sqlite3Autoext.FnExt)*8)) = xInit
 126119 				sqlite3Autoext.FnExt++
 126120 			}
 126121 		}
 126122 		Xsqlite3_mutex_leave(tls, mutex)
 126123 
 126124 		return rc
 126125 	}
 126126 	return int32(0)
 126127 }
 126128 
 126129 // Cancel a prior call to sqlite3_auto_extension.  Remove xInit from the
 126130 // set of routines that is invoked for each new database connection, if it
 126131 // is currently on the list.  If xInit is not on the list, then this
 126132 // routine is a no-op.
 126133 //
 126134 // Return 1 if xInit was found on the list and removed.  Return 0 if xInit
 126135 // was not on the list.
 126136 func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) int32 {
 126137 	var mutex uintptr = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN)
 126138 	var i int32
 126139 	var n int32 = 0
 126140 
 126141 	Xsqlite3_mutex_enter(tls, mutex)
 126142 	for i = int32(sqlite3Autoext.FnExt) - 1; i >= 0; i-- {
 126143 		if *(*uintptr)(unsafe.Pointer(sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit {
 126144 			sqlite3Autoext.FnExt--
 126145 			*(*uintptr)(unsafe.Pointer(sqlite3Autoext.FaExt + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(sqlite3Autoext.FaExt + uintptr(sqlite3Autoext.FnExt)*8))
 126146 			n++
 126147 			break
 126148 		}
 126149 	}
 126150 	Xsqlite3_mutex_leave(tls, mutex)
 126151 	return n
 126152 }
 126153 
 126154 // Reset the automatic extension loading mechanism.
 126155 func Xsqlite3_reset_auto_extension(tls *libc.TLS) {
 126156 	if Xsqlite3_initialize(tls) == SQLITE_OK {
 126157 		var mutex uintptr = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN)
 126158 
 126159 		Xsqlite3_mutex_enter(tls, mutex)
 126160 		Xsqlite3_free(tls, sqlite3Autoext.FaExt)
 126161 		sqlite3Autoext.FaExt = uintptr(0)
 126162 		sqlite3Autoext.FnExt = U32(0)
 126163 		Xsqlite3_mutex_leave(tls, mutex)
 126164 	}
 126165 }
 126166 
 126167 // Load all automatic extensions.
 126168 //
 126169 // If anything goes wrong, set an error in the database connection.
 126170 func Xsqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) {
 126171 	bp := tls.Alloc(16)
 126172 	defer tls.Free(16)
 126173 
 126174 	var i U32
 126175 	var go1 int32 = 1
 126176 	var rc int32
 126177 	var xInit Sqlite3_loadext_entry
 126178 
 126179 	if sqlite3Autoext.FnExt == U32(0) {
 126180 		return
 126181 	}
 126182 	for i = U32(0); go1 != 0; i++ {
 126183 		var mutex uintptr = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN)
 126184 		var pThunk uintptr = uintptr(unsafe.Pointer(&sqlite3Apis))
 126185 		Xsqlite3_mutex_enter(tls, mutex)
 126186 		if i >= sqlite3Autoext.FnExt {
 126187 			xInit = uintptr(0)
 126188 			go1 = 0
 126189 		} else {
 126190 			xInit = *(*uintptr)(unsafe.Pointer(sqlite3Autoext.FaExt + uintptr(i)*8))
 126191 		}
 126192 		Xsqlite3_mutex_leave(tls, mutex)
 126193 		*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 126194 		if xInit != 0 && libc.AssignInt32(&rc, (*struct {
 126195 			f func(*libc.TLS, uintptr, uintptr, uintptr) int32
 126196 		})(unsafe.Pointer(&struct{ uintptr }{xInit})).f(tls, db, bp+8, pThunk)) != 0 {
 126197 			Xsqlite3ErrorWithMsg(tls, db, rc,
 126198 				ts+17403, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 8))))
 126199 			go1 = 0
 126200 		}
 126201 		Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
 126202 	}
 126203 }
 126204 
 126205 var pragCName = [57]uintptr{
 126206 	ts + 6409,
 126207 	ts + 17442,
 126208 	ts + 10228,
 126209 	ts + 17446,
 126210 	ts + 17451,
 126211 	ts + 17454,
 126212 	ts + 17464,
 126213 	ts + 17474,
 126214 	ts + 17480,
 126215 	ts + 17484,
 126216 	ts + 17489,
 126217 	ts + 17494,
 126218 	ts + 17502,
 126219 	ts + 17513,
 126220 	ts + 17516,
 126221 	ts + 17523,
 126222 	ts + 17484,
 126223 	ts + 17489,
 126224 	ts + 17530,
 126225 	ts + 17535,
 126226 	ts + 17538,
 126227 	ts + 17545,
 126228 	ts + 17480,
 126229 	ts + 17484,
 126230 	ts + 17551,
 126231 	ts + 17556,
 126232 	ts + 17561,
 126233 	ts + 17484,
 126234 	ts + 17565,
 126235 	ts + 17489,
 126236 	ts + 17573,
 126237 	ts + 17577,
 126238 	ts + 17582,
 126239 	ts + 12844,
 126240 	ts + 12840,
 126241 	ts + 17588,
 126242 	ts + 17593,
 126243 	ts + 17598,
 126244 	ts + 17442,
 126245 	ts + 17484,
 126246 	ts + 17603,
 126247 	ts + 17610,
 126248 	ts + 17617,
 126249 	ts + 10228,
 126250 	ts + 17625,
 126251 	ts + 6412,
 126252 	ts + 17631,
 126253 	ts + 17442,
 126254 	ts + 17484,
 126255 	ts + 17636,
 126256 	ts + 17641,
 126257 	ts + 16837,
 126258 	ts + 17646,
 126259 	ts + 17659,
 126260 	ts + 17668,
 126261 	ts + 17675,
 126262 	ts + 17686,
 126263 }
 126264 
 126265 // Definitions of all built-in pragmas
 126266 type PragmaName1 = struct {
 126267 	FzName       uintptr
 126268 	FePragTyp    U8
 126269 	FmPragFlg    U8
 126270 	FiPragCName  U8
 126271 	FnPragCName  U8
 126272 	F__ccgo_pad1 [4]byte
 126273 	FiArg        U64
 126274 }
 126275 
 126276 // Definitions of all built-in pragmas
 126277 type PragmaName = PragmaName1
 126278 
 126279 var aPragmaName = [67]PragmaName{
 126280 	{FzName: ts + 17694,
 126281 		FePragTyp: U8(PragTyp_ANALYSIS_LIMIT),
 126282 		FmPragFlg: U8(PragFlg_Result0)},
 126283 	{FzName: ts + 17709,
 126284 		FePragTyp: U8(PragTyp_HEADER_VALUE),
 126285 		FmPragFlg: U8(PragFlg_NoColumns1 | PragFlg_Result0),
 126286 		FiArg:     uint64(BTREE_APPLICATION_ID)},
 126287 	{FzName: ts + 17724,
 126288 		FePragTyp: U8(PragTyp_AUTO_VACUUM),
 126289 		FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result0 | PragFlg_SchemaReq | PragFlg_NoColumns1)},
 126290 	{FzName: ts + 17736,
 126291 		FePragTyp: U8(PragTyp_FLAG),
 126292 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
 126293 		FiArg:     uint64(SQLITE_AutoIndex)},
 126294 	{FzName: ts + 17752,
 126295 		FePragTyp:   U8(PragTyp_BUSY_TIMEOUT),
 126296 		FmPragFlg:   U8(PragFlg_Result0),
 126297 		FiPragCName: U8(56), FnPragCName: U8(1)},
 126298 	{FzName: ts + 17675,
 126299 		FePragTyp: U8(PragTyp_CACHE_SIZE),
 126300 		FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result0 | PragFlg_SchemaReq | PragFlg_NoColumns1)},
 126301 	{FzName: ts + 17765,
 126302 		FePragTyp: U8(PragTyp_CACHE_SPILL),
 126303 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_SchemaReq | PragFlg_NoColumns1)},
 126304 	{FzName: ts + 17777,
 126305 		FePragTyp: U8(PragTyp_CASE_SENSITIVE_LIKE),
 126306 		FmPragFlg: U8(PragFlg_NoColumns)},
 126307 	{FzName: ts + 17797,
 126308 		FePragTyp: U8(PragTyp_FLAG),
 126309 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
 126310 		FiArg:     uint64(SQLITE_CellSizeCk)},
 126311 	{FzName: ts + 17813,
 126312 		FePragTyp: U8(PragTyp_FLAG),
 126313 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
 126314 		FiArg:     uint64(SQLITE_CkptFullFSync)},
 126315 	{FzName: ts + 17834,
 126316 		FePragTyp:   U8(PragTyp_COLLATION_LIST),
 126317 		FmPragFlg:   U8(PragFlg_Result0),
 126318 		FiPragCName: U8(38), FnPragCName: U8(2)},
 126319 	{FzName: ts + 17849,
 126320 		FePragTyp: U8(PragTyp_COMPILE_OPTIONS),
 126321 		FmPragFlg: U8(PragFlg_Result0)},
 126322 	{FzName: ts + 17865,
 126323 		FePragTyp: U8(PragTyp_FLAG),
 126324 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
 126325 		FiArg:     uint64(0x00001) << 32},
 126326 	{FzName: ts + 17879,
 126327 		FePragTyp: U8(PragTyp_DATA_STORE_DIRECTORY),
 126328 		FmPragFlg: U8(PragFlg_NoColumns1)},
 126329 	{FzName: ts + 17900,
 126330 		FePragTyp: U8(PragTyp_HEADER_VALUE),
 126331 		FmPragFlg: U8(PragFlg_ReadOnly | PragFlg_Result0),
 126332 		FiArg:     uint64(BTREE_DATA_VERSION)},
 126333 	{FzName: ts + 17913,
 126334 		FePragTyp:   U8(PragTyp_DATABASE_LIST),
 126335 		FmPragFlg:   U8(PragFlg_Result0),
 126336 		FiPragCName: U8(47), FnPragCName: U8(3)},
 126337 	{FzName: ts + 17927,
 126338 		FePragTyp:   U8(PragTyp_DEFAULT_CACHE_SIZE),
 126339 		FmPragFlg:   U8(PragFlg_NeedSchema | PragFlg_Result0 | PragFlg_SchemaReq | PragFlg_NoColumns1),
 126340 		FiPragCName: U8(55), FnPragCName: U8(1)},
 126341 	{FzName: ts + 17946,
 126342 		FePragTyp: U8(PragTyp_FLAG),
 126343 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
 126344 		FiArg:     uint64(SQLITE_DeferFKs)},
 126345 	{FzName: ts + 17965,
 126346 		FePragTyp: U8(PragTyp_FLAG),
 126347 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
 126348 		FiArg:     uint64(SQLITE_NullCallback)},
 126349 	{FzName: ts + 17988,
 126350 		FePragTyp: U8(PragTyp_ENCODING),
 126351 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1)},
 126352 	{FzName: ts + 17997,
 126353 		FePragTyp:   U8(PragTyp_FOREIGN_KEY_CHECK),
 126354 		FmPragFlg:   U8(PragFlg_NeedSchema | PragFlg_Result0 | PragFlg_Result1 | PragFlg_SchemaOpt),
 126355 		FiPragCName: U8(43), FnPragCName: U8(4)},
 126356 	{FzName: ts + 18015,
 126357 		FePragTyp: U8(PragTyp_FOREIGN_KEY_LIST),
 126358 		FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result1 | PragFlg_SchemaOpt), FnPragCName: U8(8)},
 126359 	{FzName: ts + 18032,
 126360 		FePragTyp: U8(PragTyp_FLAG),
 126361 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
 126362 		FiArg:     uint64(SQLITE_ForeignKeys)},
 126363 	{FzName: ts + 18045,
 126364 		FePragTyp: U8(PragTyp_HEADER_VALUE),
 126365 		FmPragFlg: U8(PragFlg_ReadOnly | PragFlg_Result0)},
 126366 	{FzName: ts + 18060,
 126367 		FePragTyp: U8(PragTyp_FLAG),
 126368 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
 126369 		FiArg:     uint64(SQLITE_FullColNames)},
 126370 	{FzName: ts + 18078,
 126371 		FePragTyp: U8(PragTyp_FLAG),
 126372 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
 126373 		FiArg:     uint64(SQLITE_FullFSync)},
 126374 	{FzName: ts + 18088,
 126375 		FePragTyp:   U8(PragTyp_FUNCTION_LIST),
 126376 		FmPragFlg:   U8(PragFlg_Result0),
 126377 		FiPragCName: U8(27), FnPragCName: U8(6)},
 126378 	{FzName: ts + 18102,
 126379 		FePragTyp: U8(PragTyp_HARD_HEAP_LIMIT),
 126380 		FmPragFlg: U8(PragFlg_Result0)},
 126381 	{FzName: ts + 18118,
 126382 		FePragTyp: U8(PragTyp_FLAG),
 126383 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
 126384 		FiArg:     uint64(SQLITE_IgnoreChecks)},
 126385 	{FzName: ts + 18143,
 126386 		FePragTyp: U8(PragTyp_INCREMENTAL_VACUUM),
 126387 		FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_NoColumns)},
 126388 	{FzName: ts + 18162,
 126389 		FePragTyp:   U8(PragTyp_INDEX_INFO),
 126390 		FmPragFlg:   U8(PragFlg_NeedSchema | PragFlg_Result1 | PragFlg_SchemaOpt),
 126391 		FiPragCName: U8(21), FnPragCName: U8(3)},
 126392 	{FzName: ts + 18173,
 126393 		FePragTyp:   U8(PragTyp_INDEX_LIST),
 126394 		FmPragFlg:   U8(PragFlg_NeedSchema | PragFlg_Result1 | PragFlg_SchemaOpt),
 126395 		FiPragCName: U8(38), FnPragCName: U8(5)},
 126396 	{FzName: ts + 18184,
 126397 		FePragTyp:   U8(PragTyp_INDEX_INFO),
 126398 		FmPragFlg:   U8(PragFlg_NeedSchema | PragFlg_Result1 | PragFlg_SchemaOpt),
 126399 		FiPragCName: U8(21), FnPragCName: U8(6),
 126400 		FiArg: uint64(1)},
 126401 	{FzName: ts + 18196,
 126402 		FePragTyp: U8(PragTyp_INTEGRITY_CHECK),
 126403 		FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result0 | PragFlg_Result1 | PragFlg_SchemaOpt)},
 126404 	{FzName: ts + 18212,
 126405 		FePragTyp: U8(PragTyp_JOURNAL_MODE),
 126406 		FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result0 | PragFlg_SchemaReq)},
 126407 	{FzName: ts + 18225,
 126408 		FePragTyp: U8(PragTyp_JOURNAL_SIZE_LIMIT),
 126409 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_SchemaReq)},
 126410 	{FzName: ts + 18244,
 126411 		FePragTyp: U8(PragTyp_FLAG),
 126412 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
 126413 		FiArg:     uint64(SQLITE_LegacyAlter)},
 126414 	{FzName: ts + 18263,
 126415 		FePragTyp: U8(PragTyp_LOCKING_MODE),
 126416 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_SchemaReq)},
 126417 	{FzName: ts + 18276,
 126418 		FePragTyp: U8(PragTyp_PAGE_COUNT),
 126419 		FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result0 | PragFlg_SchemaReq)},
 126420 	{FzName: ts + 18291,
 126421 		FePragTyp: U8(PragTyp_MMAP_SIZE)},
 126422 	{FzName: ts + 18301,
 126423 		FePragTyp:   U8(PragTyp_MODULE_LIST),
 126424 		FmPragFlg:   U8(PragFlg_Result0),
 126425 		FiPragCName: U8(9), FnPragCName: U8(1)},
 126426 	{FzName: ts + 18313,
 126427 		FePragTyp: U8(PragTyp_OPTIMIZE),
 126428 		FmPragFlg: U8(PragFlg_Result1 | PragFlg_NeedSchema)},
 126429 	{FzName: ts + 18322,
 126430 		FePragTyp: U8(PragTyp_PAGE_COUNT),
 126431 		FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result0 | PragFlg_SchemaReq)},
 126432 	{FzName: ts + 18333,
 126433 		FePragTyp: U8(PragTyp_PAGE_SIZE),
 126434 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_SchemaReq | PragFlg_NoColumns1)},
 126435 	{FzName: ts + 18343,
 126436 		FePragTyp:   U8(PragTyp_PRAGMA_LIST),
 126437 		FmPragFlg:   U8(PragFlg_Result0),
 126438 		FiPragCName: U8(9), FnPragCName: U8(1)},
 126439 	{FzName: ts + 18355,
 126440 		FePragTyp: U8(PragTyp_FLAG),
 126441 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
 126442 		FiArg:     uint64(SQLITE_QueryOnly)},
 126443 	{FzName: ts + 18366,
 126444 		FePragTyp: U8(PragTyp_INTEGRITY_CHECK),
 126445 		FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result0 | PragFlg_Result1 | PragFlg_SchemaOpt)},
 126446 	{FzName: ts + 18378,
 126447 		FePragTyp: U8(PragTyp_FLAG),
 126448 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
 126449 		FiArg:     uint64(SQLITE_ReadUncommit)},
 126450 	{FzName: ts + 18395,
 126451 		FePragTyp: U8(PragTyp_FLAG),
 126452 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
 126453 		FiArg:     uint64(SQLITE_RecTriggers)},
 126454 	{FzName: ts + 18414,
 126455 		FePragTyp: U8(PragTyp_FLAG),
 126456 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
 126457 		FiArg:     uint64(SQLITE_ReverseOrder)},
 126458 	{FzName: ts + 18440,
 126459 		FePragTyp: U8(PragTyp_HEADER_VALUE),
 126460 		FmPragFlg: U8(PragFlg_NoColumns1 | PragFlg_Result0),
 126461 		FiArg:     uint64(BTREE_SCHEMA_VERSION)},
 126462 	{FzName: ts + 18455,
 126463 		FePragTyp: U8(PragTyp_SECURE_DELETE),
 126464 		FmPragFlg: U8(PragFlg_Result0)},
 126465 	{FzName: ts + 18469,
 126466 		FePragTyp: U8(PragTyp_FLAG),
 126467 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
 126468 		FiArg:     uint64(SQLITE_ShortColNames)},
 126469 	{FzName: ts + 18488,
 126470 		FePragTyp: U8(PragTyp_SHRINK_MEMORY),
 126471 		FmPragFlg: U8(PragFlg_NoColumns)},
 126472 	{FzName: ts + 18502,
 126473 		FePragTyp: U8(PragTyp_SOFT_HEAP_LIMIT),
 126474 		FmPragFlg: U8(PragFlg_Result0)},
 126475 	{FzName: ts + 18518,
 126476 		FePragTyp: U8(PragTyp_SYNCHRONOUS),
 126477 		FmPragFlg: U8(PragFlg_NeedSchema | PragFlg_Result0 | PragFlg_SchemaReq | PragFlg_NoColumns1)},
 126478 	{FzName: ts + 18530,
 126479 		FePragTyp:   U8(PragTyp_TABLE_INFO),
 126480 		FmPragFlg:   U8(PragFlg_NeedSchema | PragFlg_Result1 | PragFlg_SchemaOpt),
 126481 		FiPragCName: U8(8), FnPragCName: U8(6)},
 126482 	{FzName: ts + 18541,
 126483 		FePragTyp:   U8(PragTyp_TABLE_LIST),
 126484 		FmPragFlg:   U8(PragFlg_NeedSchema | PragFlg_Result1),
 126485 		FiPragCName: U8(15), FnPragCName: U8(6)},
 126486 	{FzName: ts + 18552,
 126487 		FePragTyp:   U8(PragTyp_TABLE_INFO),
 126488 		FmPragFlg:   U8(PragFlg_NeedSchema | PragFlg_Result1 | PragFlg_SchemaOpt),
 126489 		FiPragCName: U8(8), FnPragCName: U8(7),
 126490 		FiArg: uint64(1)},
 126491 	{FzName: ts + 18564,
 126492 		FePragTyp: U8(PragTyp_TEMP_STORE),
 126493 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1)},
 126494 	{FzName: ts + 18575,
 126495 		FePragTyp: U8(PragTyp_TEMP_STORE_DIRECTORY),
 126496 		FmPragFlg: U8(PragFlg_NoColumns1)},
 126497 	{FzName: ts + 18596,
 126498 		FePragTyp: U8(PragTyp_THREADS),
 126499 		FmPragFlg: U8(PragFlg_Result0)},
 126500 	{FzName: ts + 18604,
 126501 		FePragTyp: U8(PragTyp_FLAG),
 126502 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
 126503 		FiArg:     uint64(SQLITE_TrustedSchema)},
 126504 	{FzName: ts + 18619,
 126505 		FePragTyp: U8(PragTyp_HEADER_VALUE),
 126506 		FmPragFlg: U8(PragFlg_NoColumns1 | PragFlg_Result0),
 126507 		FiArg:     uint64(BTREE_USER_VERSION)},
 126508 	{FzName: ts + 18632,
 126509 		FePragTyp: U8(PragTyp_WAL_AUTOCHECKPOINT)},
 126510 	{FzName: ts + 18651,
 126511 		FePragTyp:   U8(PragTyp_WAL_CHECKPOINT),
 126512 		FmPragFlg:   U8(PragFlg_NeedSchema),
 126513 		FiPragCName: U8(50), FnPragCName: U8(3)},
 126514 	{FzName: ts + 18666,
 126515 		FePragTyp: U8(PragTyp_FLAG),
 126516 		FmPragFlg: U8(PragFlg_Result0 | PragFlg_NoColumns1),
 126517 		FiArg:     uint64(SQLITE_WriteSchema | SQLITE_NoSchemaError)},
 126518 }
 126519 
 126520 func getSafetyLevel(tls *libc.TLS, z uintptr, omitFull int32, dflt U8) U8 {
 126521 	var i int32
 126522 	var n int32
 126523 	if int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&0x04 != 0 {
 126524 		return U8(Xsqlite3Atoi(tls, z))
 126525 	}
 126526 	n = Xsqlite3Strlen30(tls, z)
 126527 	for i = 0; i < int32(uint64(unsafe.Sizeof(iLength))/uint64(unsafe.Sizeof(U8(0)))); i++ {
 126528 		if int32(iLength[i]) == n && Xsqlite3_strnicmp(tls, uintptr(unsafe.Pointer(&zText))+uintptr(iOffset[i]), z, n) == 0 &&
 126529 			(!(omitFull != 0) || int32(iValue[i]) <= 1) {
 126530 			return iValue[i]
 126531 		}
 126532 	}
 126533 	return dflt
 126534 }
 126535 
 126536 var zText = *(*[25]int8)(unsafe.Pointer(ts + 18682))
 126537 var iOffset = [8]U8{U8(0), U8(1), U8(2), U8(4), U8(9), U8(12), U8(15), U8(20)}
 126538 var iLength = [8]U8{U8(2), U8(2), U8(3), U8(5), U8(3), U8(4), U8(5), U8(4)}
 126539 var iValue = [8]U8{U8(1), U8(0), U8(0), U8(0), U8(1), U8(1), U8(3), U8(2)}
 126540 
 126541 // Interpret the given string as a boolean value.
 126542 func Xsqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt U8) U8 {
 126543 	return U8(libc.Bool32(int32(getSafetyLevel(tls, z, 1, dflt)) != 0))
 126544 }
 126545 
 126546 func getLockingMode(tls *libc.TLS, z uintptr) int32 {
 126547 	if z != 0 {
 126548 		if 0 == Xsqlite3StrICmp(tls, z, ts+5017) {
 126549 			return PAGER_LOCKINGMODE_EXCLUSIVE
 126550 		}
 126551 		if 0 == Xsqlite3StrICmp(tls, z, ts+18707) {
 126552 			return PAGER_LOCKINGMODE_NORMAL
 126553 		}
 126554 	}
 126555 	return -1
 126556 }
 126557 
 126558 func getAutoVacuum(tls *libc.TLS, z uintptr) int32 {
 126559 	var i int32
 126560 	if 0 == Xsqlite3StrICmp(tls, z, ts+9378) {
 126561 		return BTREE_AUTOVACUUM_NONE
 126562 	}
 126563 	if 0 == Xsqlite3StrICmp(tls, z, ts+18714) {
 126564 		return BTREE_AUTOVACUUM_FULL
 126565 	}
 126566 	if 0 == Xsqlite3StrICmp(tls, z, ts+18719) {
 126567 		return BTREE_AUTOVACUUM_INCR
 126568 	}
 126569 	i = Xsqlite3Atoi(tls, z)
 126570 	return int32(func() uint8 {
 126571 		if i >= 0 && i <= 2 {
 126572 			return uint8(i)
 126573 		}
 126574 		return uint8(0)
 126575 	}())
 126576 }
 126577 
 126578 func getTempStore(tls *libc.TLS, z uintptr) int32 {
 126579 	if int32(*(*int8)(unsafe.Pointer(z))) >= '0' && int32(*(*int8)(unsafe.Pointer(z))) <= '2' {
 126580 		return int32(*(*int8)(unsafe.Pointer(z))) - '0'
 126581 	} else if Xsqlite3StrICmp(tls, z, ts+17636) == 0 {
 126582 		return 1
 126583 	} else if Xsqlite3StrICmp(tls, z, ts+18731) == 0 {
 126584 		return 2
 126585 	} else {
 126586 		return 0
 126587 	}
 126588 	return int32(0)
 126589 }
 126590 
 126591 func invalidateTempStorage(tls *libc.TLS, pParse uintptr) int32 {
 126592 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 126593 	if (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpBt != uintptr(0) {
 126594 		if !(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0) ||
 126595 			Xsqlite3BtreeTxnState(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpBt) != SQLITE_TXN_NONE {
 126596 			Xsqlite3ErrorMsg(tls, pParse,
 126597 				ts+18738, 0)
 126598 			return SQLITE_ERROR
 126599 		}
 126600 		Xsqlite3BtreeClose(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpBt)
 126601 		(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).FpBt = uintptr(0)
 126602 		Xsqlite3ResetAllSchemasOfConnection(tls, db)
 126603 	}
 126604 	return SQLITE_OK
 126605 }
 126606 
 126607 func changeTempStorage(tls *libc.TLS, pParse uintptr, zStorageType uintptr) int32 {
 126608 	var ts int32 = getTempStore(tls, zStorageType)
 126609 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 126610 	if int32((*Sqlite3)(unsafe.Pointer(db)).Ftemp_store) == ts {
 126611 		return SQLITE_OK
 126612 	}
 126613 	if invalidateTempStorage(tls, pParse) != SQLITE_OK {
 126614 		return SQLITE_ERROR
 126615 	}
 126616 	(*Sqlite3)(unsafe.Pointer(db)).Ftemp_store = U8(ts)
 126617 	return SQLITE_OK
 126618 }
 126619 
 126620 func setPragmaResultColumnNames(tls *libc.TLS, v uintptr, pPragma uintptr) {
 126621 	var n U8 = (*PragmaName)(unsafe.Pointer(pPragma)).FnPragCName
 126622 	Xsqlite3VdbeSetNumCols(tls, v, func() int32 {
 126623 		if int32(n) == 0 {
 126624 			return 1
 126625 		}
 126626 		return int32(n)
 126627 	}())
 126628 	if int32(n) == 0 {
 126629 		Xsqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, (*PragmaName)(unsafe.Pointer(pPragma)).FzName, uintptr(0))
 126630 	} else {
 126631 		var i int32
 126632 		var j int32
 126633 		i = 0
 126634 		j = int32((*PragmaName)(unsafe.Pointer(pPragma)).FiPragCName)
 126635 	__1:
 126636 		if !(i < int32(n)) {
 126637 			goto __3
 126638 		}
 126639 		{
 126640 			Xsqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, pragCName[j], uintptr(0))
 126641 
 126642 		}
 126643 		goto __2
 126644 	__2:
 126645 		i++
 126646 		j++
 126647 		goto __1
 126648 		goto __3
 126649 	__3:
 126650 	}
 126651 }
 126652 
 126653 func returnSingleInt(tls *libc.TLS, v uintptr, value I64) {
 126654 	bp := tls.Alloc(8)
 126655 	defer tls.Free(8)
 126656 	*(*I64)(unsafe.Pointer(bp)) = value
 126657 
 126658 	Xsqlite3VdbeAddOp4Dup8(tls, v, OP_Int64, 0, 1, 0, bp, -13)
 126659 	Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, 1, 1)
 126660 }
 126661 
 126662 func returnSingleText(tls *libc.TLS, v uintptr, zValue uintptr) {
 126663 	if zValue != 0 {
 126664 		Xsqlite3VdbeLoadString(tls, v, 1, zValue)
 126665 		Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, 1, 1)
 126666 	}
 126667 }
 126668 
 126669 func setAllPagerFlags(tls *libc.TLS, db uintptr) {
 126670 	if (*Sqlite3)(unsafe.Pointer(db)).FautoCommit != 0 {
 126671 		var pDb uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaDb
 126672 		var n int32 = (*Sqlite3)(unsafe.Pointer(db)).FnDb
 126673 
 126674 		for libc.PostDecInt32(&n, 1) > 0 {
 126675 			if (*Db)(unsafe.Pointer(pDb)).FpBt != 0 {
 126676 				Xsqlite3BtreeSetPagerFlags(tls, (*Db)(unsafe.Pointer(pDb)).FpBt,
 126677 					uint32(U64((*Db)(unsafe.Pointer(pDb)).Fsafety_level)|(*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(PAGER_FLAGS_MASK)))
 126678 			}
 126679 			pDb += 32
 126680 		}
 126681 	}
 126682 }
 126683 
 126684 func actionName(tls *libc.TLS, action U8) uintptr {
 126685 	var zName uintptr
 126686 	switch int32(action) {
 126687 	case OE_SetNull:
 126688 		zName = ts + 18800
 126689 		break
 126690 	case OE_SetDflt:
 126691 		zName = ts + 18809
 126692 		break
 126693 	case OE_Cascade:
 126694 		zName = ts + 18821
 126695 		break
 126696 	case OE_Restrict:
 126697 		zName = ts + 18829
 126698 		break
 126699 	default:
 126700 		zName = ts + 18838
 126701 		break
 126702 	}
 126703 	return zName
 126704 }
 126705 
 126706 // Parameter eMode must be one of the PAGER_JOURNALMODE_XXX constants
 126707 // defined in pager.h. This function returns the associated lowercase
 126708 // journal-mode name.
 126709 func Xsqlite3JournalModename(tls *libc.TLS, eMode int32) uintptr {
 126710 	if eMode == int32(uint64(unsafe.Sizeof(azModeName))/uint64(unsafe.Sizeof(uintptr(0)))) {
 126711 		return uintptr(0)
 126712 	}
 126713 	return azModeName[eMode]
 126714 }
 126715 
 126716 var azModeName = [6]uintptr{
 126717 	ts + 18848, ts + 18855, ts + 18863, ts + 18867, ts + 18731, ts + 18876,
 126718 }
 126719 
 126720 func pragmaLocate(tls *libc.TLS, zName uintptr) uintptr {
 126721 	var upr int32
 126722 	var lwr int32
 126723 	var mid int32 = 0
 126724 	var rc int32
 126725 	lwr = 0
 126726 	upr = int32(uint64(unsafe.Sizeof(aPragmaName))/uint64(unsafe.Sizeof(PragmaName{}))) - 1
 126727 	for lwr <= upr {
 126728 		mid = (lwr + upr) / 2
 126729 		rc = Xsqlite3_stricmp(tls, zName, aPragmaName[mid].FzName)
 126730 		if rc == 0 {
 126731 			break
 126732 		}
 126733 		if rc < 0 {
 126734 			upr = mid - 1
 126735 		} else {
 126736 			lwr = mid + 1
 126737 		}
 126738 	}
 126739 	if lwr > upr {
 126740 		return uintptr(0)
 126741 	}
 126742 	return uintptr(unsafe.Pointer(&aPragmaName)) + uintptr(mid)*24
 126743 }
 126744 
 126745 func pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, showInternFuncs int32) {
 126746 	bp := tls.Alloc(48)
 126747 	defer tls.Free(48)
 126748 
 126749 	var mask U32 = U32(SQLITE_DETERMINISTIC | SQLITE_DIRECTONLY | SQLITE_SUBTYPE | SQLITE_INNOCUOUS | SQLITE_FUNC_INTERNAL)
 126750 	if showInternFuncs != 0 {
 126751 		mask = 0xffffffff
 126752 	}
 126753 	for ; p != 0; p = (*FuncDef)(unsafe.Pointer(p)).FpNext {
 126754 		var zType uintptr
 126755 
 126756 		if (*FuncDef)(unsafe.Pointer(p)).FxSFunc == uintptr(0) {
 126757 			continue
 126758 		}
 126759 		if (*FuncDef)(unsafe.Pointer(p)).FfuncFlags&U32(SQLITE_FUNC_INTERNAL) != U32(0) &&
 126760 			showInternFuncs == 0 {
 126761 			continue
 126762 		}
 126763 		if (*FuncDef)(unsafe.Pointer(p)).FxValue != uintptr(0) {
 126764 			zType = ts + 18880
 126765 		} else if (*FuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) {
 126766 			zType = ts + 18882
 126767 		} else {
 126768 			zType = ts + 8869
 126769 		}
 126770 		Xsqlite3VdbeMultiLoad(tls, v, 1, ts+18884,
 126771 			libc.VaList(bp, (*FuncDef)(unsafe.Pointer(p)).FzName, isBuiltin,
 126772 				zType, azEnc[(*FuncDef)(unsafe.Pointer(p)).FfuncFlags&U32(SQLITE_FUNC_ENCMASK)],
 126773 				int32((*FuncDef)(unsafe.Pointer(p)).FnArg),
 126774 				(*FuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^U32(SQLITE_INNOCUOUS)))
 126775 	}
 126776 }
 126777 
 126778 var azEnc = [4]uintptr{uintptr(0), ts + 18891, ts + 18896, ts + 18904}
 126779 
 126780 func integrityCheckResultRow(tls *libc.TLS, v uintptr) int32 {
 126781 	var addr int32
 126782 	Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, 3, 1)
 126783 	addr = Xsqlite3VdbeAddOp3(tls, v, OP_IfPos, 1, Xsqlite3VdbeCurrentAddr(tls, v)+2, 1)
 126784 
 126785 	Xsqlite3VdbeAddOp0(tls, v, OP_Halt)
 126786 	return addr
 126787 }
 126788 
 126789 // Process a pragma statement.
 126790 //
 126791 // Pragmas are of this form:
 126792 //
 126793 //	PRAGMA [schema.]id [= value]
 126794 //
 126795 // The identifier might also be a string.  The value is a string, and
 126796 // identifier, or a number.  If minusFlag is true, then the value is
 126797 // a number that was preceded by a minus sign.
 126798 //
 126799 // If the left side is "database.id" then pId1 is the database name
 126800 // and pId2 is the id.  If the left side is just "id" then pId1 is the
 126801 // id and pId2 is any empty string.
 126802 func Xsqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, pValue uintptr, minusFlag int32) {
 126803 	bp := tls.Alloc(680)
 126804 	defer tls.Free(680)
 126805 
 126806 	var zLeft uintptr
 126807 	var zRight uintptr
 126808 	var zDb uintptr
 126809 
 126810 	var iDb int32
 126811 	var rc int32
 126812 	var db uintptr
 126813 	var pDb uintptr
 126814 	var v uintptr
 126815 	var pPragma uintptr
 126816 	var size int32
 126817 	var aOp uintptr
 126818 	var size1 int32
 126819 	var pBt uintptr
 126820 	var ii int32
 126821 	var pBt1 uintptr
 126822 	var b int32
 126823 	var iReg int32
 126824 
 126825 	var ii1 int32
 126826 	var pPager uintptr
 126827 	var zRet uintptr
 126828 	var eMode int32
 126829 	var zMode uintptr
 126830 	var n int32
 126831 	var eMode1 int32
 126832 	var ii2 int32
 126833 	var pPager1 uintptr
 126834 
 126835 	var aOp1 uintptr
 126836 	var iAddr int32
 126837 	var eAuto int32
 126838 	var pBt2 uintptr
 126839 
 126840 	var addr int32
 126841 	var size2 int32
 126842 
 126843 	var ii3 int32
 126844 
 126845 	var iLevel int32
 126846 	var mask U64
 126847 	var isHidden int32
 126848 	var pColExpr uintptr
 126849 	var i int32
 126850 	var k int32
 126851 	var nHidden int32
 126852 	var pCol uintptr
 126853 	var pPk uintptr
 126854 	var pTab uintptr
 126855 
 126856 	var zSql uintptr
 126857 	var pTab1 uintptr
 126858 	var pTab2 uintptr
 126859 	var zType uintptr
 126860 	var k1 uintptr
 126861 	var pHash uintptr
 126862 	var initNCol int32
 126863 	var ii4 int32
 126864 	var cnum I16
 126865 	var iIdxDb int32
 126866 	var i1 int32
 126867 	var mx int32
 126868 	var pIdx uintptr
 126869 	var pTab3 uintptr
 126870 
 126871 	var iTabDb int32
 126872 	var pIdx1 uintptr
 126873 	var pTab4 uintptr
 126874 	var i2 int32
 126875 	var i3 int32
 126876 	var pColl uintptr
 126877 	var i4 int32
 126878 	var p uintptr
 126879 	var i5 int32
 126880 	var j uintptr
 126881 	var p1 uintptr
 126882 	var showInternFunc int32
 126883 	var pMod uintptr
 126884 	var j1 uintptr
 126885 	var i6 int32
 126886 	var j2 int32
 126887 	var iTabDb1 int32
 126888 	var i7 int32
 126889 	var pFK uintptr
 126890 	var pTab5 uintptr
 126891 	var iCol int32
 126892 	var jmp int32
 126893 	var pFK1 uintptr
 126894 	var pTab6 uintptr
 126895 	var pParent uintptr
 126896 
 126897 	var i8 int32
 126898 	var j3 int32
 126899 	var k2 uintptr
 126900 	var x1 int32
 126901 	var regResult int32
 126902 	var regRow int32
 126903 	var addrTop int32
 126904 	var addrOk int32
 126905 
 126906 	var pTab7 uintptr
 126907 	var pIdx3 uintptr
 126908 	var nIdx int32
 126909 	var pTab8 uintptr
 126910 	var pIdx4 uintptr
 126911 
 126912 	var a1 int32
 126913 	var zErr uintptr
 126914 
 126915 	var jmp2 int32
 126916 	var zErr1 uintptr
 126917 	var pCol1 uintptr
 126918 	var labelError int32
 126919 	var labelOk int32
 126920 	var p11 int32
 126921 	var p3 int32
 126922 	var p4 int32
 126923 	var doTypeCheck int32
 126924 	var addrCkFault int32
 126925 	var addrCkOk int32
 126926 	var zErr2 uintptr
 126927 	var k3 int32
 126928 	var pCheck uintptr
 126929 	var jmp7 int32
 126930 	var jmp6 int32
 126931 	var iCol1 int32
 126932 	var uniqOk int32
 126933 	var jmp61 int32
 126934 	var jmp21 int32
 126935 
 126936 	var jmp4 int32
 126937 	var jmp5 int32
 126938 	var label6 int32
 126939 	var kk int32
 126940 	var ckUniq int32
 126941 	var pTab9 uintptr
 126942 	var pIdx5 uintptr
 126943 	var pPk1 uintptr
 126944 	var pPrior uintptr
 126945 	var loopTop int32
 126946 
 126947 	var r1 int32
 126948 	var bStrict int32
 126949 	var r2 int32
 126950 	var mxCol int32
 126951 	var x2 uintptr
 126952 	var pTbls uintptr
 126953 	var aRoot uintptr
 126954 	var cnt int32
 126955 	var mxIdx int32
 126956 	var aOp2 uintptr
 126957 	var i9 int32
 126958 	var j4 int32
 126959 	var addr1 int32
 126960 
 126961 	var pObjTab uintptr
 126962 
 126963 	var isQuick int32
 126964 	var enc U8
 126965 	var pEnc uintptr
 126966 	var aOp3 uintptr
 126967 	var aOp4 uintptr
 126968 	var iCookie int32
 126969 	var i10 int32
 126970 	var zOpt uintptr
 126971 	var iBt int32
 126972 	var eMode2 int32
 126973 	var r11 int32
 126974 	var iDbLast int32
 126975 	var iTabCur int32
 126976 	var k4 uintptr
 126977 	var pSchema uintptr
 126978 	var pTab10 uintptr
 126979 	var pIdx6 uintptr
 126980 	var szThreshold LogEst
 126981 	var zSubSql uintptr
 126982 	var opMask U32
 126983 
 126984 	var iPrior Sqlite3_int64
 126985 
 126986 	zLeft = uintptr(0)
 126987 	zRight = uintptr(0)
 126988 	zDb = uintptr(0)
 126989 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 126990 	v = Xsqlite3GetVdbe(tls, pParse)
 126991 
 126992 	if !(v == uintptr(0)) {
 126993 		goto __1
 126994 	}
 126995 	return
 126996 __1:
 126997 	;
 126998 	Xsqlite3VdbeRunOnlyOnce(tls, v)
 126999 	(*Parse)(unsafe.Pointer(pParse)).FnMem = 2
 127000 
 127001 	iDb = Xsqlite3TwoPartName(tls, pParse, pId1, pId2, bp+488)
 127002 	if !(iDb < 0) {
 127003 		goto __2
 127004 	}
 127005 	return
 127006 __2:
 127007 	;
 127008 	pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32
 127009 
 127010 	if !(iDb == 1 && Xsqlite3OpenTempDatabase(tls, pParse) != 0) {
 127011 		goto __3
 127012 	}
 127013 	return
 127014 __3:
 127015 	;
 127016 	zLeft = Xsqlite3NameFromToken(tls, db, *(*uintptr)(unsafe.Pointer(bp + 488)))
 127017 	if !!(zLeft != 0) {
 127018 		goto __4
 127019 	}
 127020 	return
 127021 __4:
 127022 	;
 127023 	if !(minusFlag != 0) {
 127024 		goto __5
 127025 	}
 127026 	zRight = Xsqlite3MPrintf(tls, db, ts+18912, libc.VaList(bp, pValue))
 127027 	goto __6
 127028 __5:
 127029 	zRight = Xsqlite3NameFromToken(tls, db, pValue)
 127030 __6:
 127031 	;
 127032 	if (*Token)(unsafe.Pointer(pId2)).Fn > uint32(0) {
 127033 		zDb = (*Db)(unsafe.Pointer(pDb)).FzDbSName
 127034 	} else {
 127035 		zDb = uintptr(0)
 127036 	}
 127037 	if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_PRAGMA, zLeft, zRight, zDb) != 0) {
 127038 		goto __7
 127039 	}
 127040 	goto pragma_out
 127041 __7:
 127042 	;
 127043 	*(*uintptr)(unsafe.Pointer(bp + 496)) = uintptr(0)
 127044 	*(*uintptr)(unsafe.Pointer(bp + 496 + 1*8)) = zLeft
 127045 	*(*uintptr)(unsafe.Pointer(bp + 496 + 2*8)) = zRight
 127046 	*(*uintptr)(unsafe.Pointer(bp + 496 + 3*8)) = uintptr(0)
 127047 	(*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0
 127048 	rc = Xsqlite3_file_control(tls, db, zDb, SQLITE_FCNTL_PRAGMA, bp+496)
 127049 	if !(rc == SQLITE_OK) {
 127050 		goto __8
 127051 	}
 127052 	Xsqlite3VdbeSetNumCols(tls, v, 1)
 127053 	Xsqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, *(*uintptr)(unsafe.Pointer(bp + 496)), libc.UintptrFromInt32(-1))
 127054 	returnSingleText(tls, v, *(*uintptr)(unsafe.Pointer(bp + 496)))
 127055 	Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 496)))
 127056 	goto pragma_out
 127057 __8:
 127058 	;
 127059 	if !(rc != SQLITE_NOTFOUND) {
 127060 		goto __9
 127061 	}
 127062 	if !(*(*uintptr)(unsafe.Pointer(bp + 496)) != 0) {
 127063 		goto __10
 127064 	}
 127065 	Xsqlite3ErrorMsg(tls, pParse, ts+4493, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 496))))
 127066 	Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 496)))
 127067 __10:
 127068 	;
 127069 	(*Parse)(unsafe.Pointer(pParse)).FnErr++
 127070 	(*Parse)(unsafe.Pointer(pParse)).Frc = rc
 127071 	goto pragma_out
 127072 __9:
 127073 	;
 127074 	pPragma = pragmaLocate(tls, zLeft)
 127075 	if !(pPragma == uintptr(0)) {
 127076 		goto __11
 127077 	}
 127078 
 127079 	goto pragma_out
 127080 __11:
 127081 	;
 127082 	if !(int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&PragFlg_NeedSchema != 0) {
 127083 		goto __12
 127084 	}
 127085 	if !(Xsqlite3ReadSchema(tls, pParse) != 0) {
 127086 		goto __13
 127087 	}
 127088 	goto pragma_out
 127089 __13:
 127090 	;
 127091 __12:
 127092 	;
 127093 	if !(int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&PragFlg_NoColumns == 0 &&
 127094 		(int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&PragFlg_NoColumns1 == 0 || zRight == uintptr(0))) {
 127095 		goto __14
 127096 	}
 127097 	setPragmaResultColumnNames(tls, v, pPragma)
 127098 __14:
 127099 	;
 127100 	switch int32((*PragmaName)(unsafe.Pointer(pPragma)).FePragTyp) {
 127101 	case PragTyp_DEFAULT_CACHE_SIZE:
 127102 		goto __16
 127103 
 127104 	case PragTyp_PAGE_SIZE:
 127105 		goto __17
 127106 
 127107 	case PragTyp_SECURE_DELETE:
 127108 		goto __18
 127109 
 127110 	case PragTyp_PAGE_COUNT:
 127111 		goto __19
 127112 
 127113 	case PragTyp_LOCKING_MODE:
 127114 		goto __20
 127115 
 127116 	case PragTyp_JOURNAL_MODE:
 127117 		goto __21
 127118 
 127119 	case PragTyp_JOURNAL_SIZE_LIMIT:
 127120 		goto __22
 127121 
 127122 	case PragTyp_AUTO_VACUUM:
 127123 		goto __23
 127124 
 127125 	case PragTyp_INCREMENTAL_VACUUM:
 127126 		goto __24
 127127 
 127128 	case PragTyp_CACHE_SIZE:
 127129 		goto __25
 127130 
 127131 	case PragTyp_CACHE_SPILL:
 127132 		goto __26
 127133 
 127134 	case PragTyp_MMAP_SIZE:
 127135 		goto __27
 127136 
 127137 	case PragTyp_TEMP_STORE:
 127138 		goto __28
 127139 
 127140 	case PragTyp_TEMP_STORE_DIRECTORY:
 127141 		goto __29
 127142 
 127143 	case PragTyp_DATA_STORE_DIRECTORY:
 127144 		goto __30
 127145 
 127146 	case PragTyp_SYNCHRONOUS:
 127147 		goto __31
 127148 
 127149 	case PragTyp_FLAG:
 127150 		goto __32
 127151 
 127152 	case PragTyp_TABLE_INFO:
 127153 		goto __33
 127154 
 127155 	case PragTyp_TABLE_LIST:
 127156 		goto __34
 127157 
 127158 	case PragTyp_INDEX_INFO:
 127159 		goto __35
 127160 
 127161 	case PragTyp_INDEX_LIST:
 127162 		goto __36
 127163 
 127164 	case PragTyp_DATABASE_LIST:
 127165 		goto __37
 127166 
 127167 	case PragTyp_COLLATION_LIST:
 127168 		goto __38
 127169 
 127170 	case PragTyp_FUNCTION_LIST:
 127171 		goto __39
 127172 
 127173 	case PragTyp_MODULE_LIST:
 127174 		goto __40
 127175 
 127176 	case PragTyp_PRAGMA_LIST:
 127177 		goto __41
 127178 
 127179 	case PragTyp_FOREIGN_KEY_LIST:
 127180 		goto __42
 127181 
 127182 	case PragTyp_FOREIGN_KEY_CHECK:
 127183 		goto __43
 127184 
 127185 	case PragTyp_CASE_SENSITIVE_LIKE:
 127186 		goto __44
 127187 
 127188 	case PragTyp_INTEGRITY_CHECK:
 127189 		goto __45
 127190 
 127191 	case PragTyp_ENCODING:
 127192 		goto __46
 127193 
 127194 	case PragTyp_HEADER_VALUE:
 127195 		goto __47
 127196 
 127197 	case PragTyp_COMPILE_OPTIONS:
 127198 		goto __48
 127199 
 127200 	case PragTyp_WAL_CHECKPOINT:
 127201 		goto __49
 127202 
 127203 	case PragTyp_WAL_AUTOCHECKPOINT:
 127204 		goto __50
 127205 
 127206 	case PragTyp_SHRINK_MEMORY:
 127207 		goto __51
 127208 
 127209 	case PragTyp_OPTIMIZE:
 127210 		goto __52
 127211 
 127212 	default:
 127213 		goto __53
 127214 
 127215 	case PragTyp_SOFT_HEAP_LIMIT:
 127216 		goto __54
 127217 
 127218 	case PragTyp_HARD_HEAP_LIMIT:
 127219 		goto __55
 127220 
 127221 	case PragTyp_THREADS:
 127222 		goto __56
 127223 
 127224 	case PragTyp_ANALYSIS_LIMIT:
 127225 		goto __57
 127226 	}
 127227 	goto __15
 127228 
 127229 __16:
 127230 	Xsqlite3VdbeUsesBtree(tls, v, iDb)
 127231 	if !!(zRight != 0) {
 127232 		goto __58
 127233 	}
 127234 	*(*int32)(unsafe.Pointer(pParse + 56)) += 2
 127235 
 127236 	aOp = Xsqlite3VdbeAddOpList(tls, v, int32(uint64(unsafe.Sizeof(getCacheSize))/uint64(unsafe.Sizeof(VdbeOpList{}))), uintptr(unsafe.Pointer(&getCacheSize)), iLn3)
 127237 	if !(0 != 0) {
 127238 		goto __60
 127239 	}
 127240 	goto __15
 127241 __60:
 127242 	;
 127243 	(*VdbeOp)(unsafe.Pointer(aOp)).Fp1 = iDb
 127244 	(*VdbeOp)(unsafe.Pointer(aOp + 1*24)).Fp1 = iDb
 127245 	(*VdbeOp)(unsafe.Pointer(aOp + 6*24)).Fp1 = -2000
 127246 	goto __59
 127247 __58:
 127248 	size = Xsqlite3AbsInt32(tls, Xsqlite3Atoi(tls, zRight))
 127249 	Xsqlite3BeginWriteOperation(tls, pParse, 0, iDb)
 127250 	Xsqlite3VdbeAddOp3(tls, v, OP_SetCookie, iDb, BTREE_DEFAULT_CACHE_SIZE, size)
 127251 
 127252 	(*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fcache_size = size
 127253 	Xsqlite3BtreeSetCacheSize(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fcache_size)
 127254 __59:
 127255 	;
 127256 	goto __15
 127257 
 127258 __17:
 127259 	pBt = (*Db)(unsafe.Pointer(pDb)).FpBt
 127260 
 127261 	if !!(zRight != 0) {
 127262 		goto __61
 127263 	}
 127264 	if pBt != 0 {
 127265 		size1 = Xsqlite3BtreeGetPageSize(tls, pBt)
 127266 	} else {
 127267 		size1 = 0
 127268 	}
 127269 	returnSingleInt(tls, v, int64(size1))
 127270 	goto __62
 127271 __61:
 127272 	(*Sqlite3)(unsafe.Pointer(db)).FnextPagesize = Xsqlite3Atoi(tls, zRight)
 127273 	if !(SQLITE_NOMEM == Xsqlite3BtreeSetPageSize(tls, pBt, (*Sqlite3)(unsafe.Pointer(db)).FnextPagesize, 0, 0)) {
 127274 		goto __63
 127275 	}
 127276 	Xsqlite3OomFault(tls, db)
 127277 __63:
 127278 	;
 127279 __62:
 127280 	;
 127281 	goto __15
 127282 
 127283 __18:
 127284 	pBt1 = (*Db)(unsafe.Pointer(pDb)).FpBt
 127285 	b = -1
 127286 
 127287 	if !(zRight != 0) {
 127288 		goto __64
 127289 	}
 127290 	if !(Xsqlite3_stricmp(tls, zRight, ts+18916) == 0) {
 127291 		goto __65
 127292 	}
 127293 	b = 2
 127294 	goto __66
 127295 __65:
 127296 	b = int32(Xsqlite3GetBoolean(tls, zRight, uint8(0)))
 127297 __66:
 127298 	;
 127299 __64:
 127300 	;
 127301 	if !((*Token)(unsafe.Pointer(pId2)).Fn == uint32(0) && b >= 0) {
 127302 		goto __67
 127303 	}
 127304 	ii = 0
 127305 __68:
 127306 	if !(ii < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
 127307 		goto __70
 127308 	}
 127309 	Xsqlite3BtreeSecureDelete(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii)*32)).FpBt, b)
 127310 	goto __69
 127311 __69:
 127312 	ii++
 127313 	goto __68
 127314 	goto __70
 127315 __70:
 127316 	;
 127317 __67:
 127318 	;
 127319 	b = Xsqlite3BtreeSecureDelete(tls, pBt1, b)
 127320 	returnSingleInt(tls, v, int64(b))
 127321 	goto __15
 127322 
 127323 __19:
 127324 	*(*I64)(unsafe.Pointer(bp + 528)) = int64(0)
 127325 	Xsqlite3CodeVerifySchema(tls, pParse, iDb)
 127326 	iReg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 127327 	if !(int32(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(zLeft)))]) == 'p') {
 127328 		goto __71
 127329 	}
 127330 	Xsqlite3VdbeAddOp2(tls, v, OP_Pagecount, iDb, iReg)
 127331 	goto __72
 127332 __71:
 127333 	if !(zRight != 0 && Xsqlite3DecOrHexToI64(tls, zRight, bp+528) == 0) {
 127334 		goto __73
 127335 	}
 127336 	if !(*(*I64)(unsafe.Pointer(bp + 528)) < int64(0)) {
 127337 		goto __75
 127338 	}
 127339 	*(*I64)(unsafe.Pointer(bp + 528)) = int64(0)
 127340 	goto __76
 127341 __75:
 127342 	if !(*(*I64)(unsafe.Pointer(bp + 528)) > int64(0xfffffffe)) {
 127343 		goto __77
 127344 	}
 127345 	*(*I64)(unsafe.Pointer(bp + 528)) = int64(0xfffffffe)
 127346 __77:
 127347 	;
 127348 __76:
 127349 	;
 127350 	goto __74
 127351 __73:
 127352 	*(*I64)(unsafe.Pointer(bp + 528)) = int64(0)
 127353 __74:
 127354 	;
 127355 	Xsqlite3VdbeAddOp3(tls, v, OP_MaxPgcnt, iDb, iReg, int32(*(*I64)(unsafe.Pointer(bp + 528))))
 127356 __72:
 127357 	;
 127358 	Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, iReg, 1)
 127359 	goto __15
 127360 
 127361 __20:
 127362 	zRet = ts + 18707
 127363 	eMode = getLockingMode(tls, zRight)
 127364 
 127365 	if !((*Token)(unsafe.Pointer(pId2)).Fn == uint32(0) && eMode == -1) {
 127366 		goto __78
 127367 	}
 127368 
 127369 	eMode = int32((*Sqlite3)(unsafe.Pointer(db)).FdfltLockMode)
 127370 	goto __79
 127371 __78:
 127372 	if !((*Token)(unsafe.Pointer(pId2)).Fn == uint32(0)) {
 127373 		goto __80
 127374 	}
 127375 
 127376 	ii1 = 2
 127377 __81:
 127378 	if !(ii1 < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
 127379 		goto __83
 127380 	}
 127381 	pPager = Xsqlite3BtreePager(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii1)*32)).FpBt)
 127382 	Xsqlite3PagerLockingMode(tls, pPager, eMode)
 127383 	goto __82
 127384 __82:
 127385 	ii1++
 127386 	goto __81
 127387 	goto __83
 127388 __83:
 127389 	;
 127390 	(*Sqlite3)(unsafe.Pointer(db)).FdfltLockMode = U8(eMode)
 127391 __80:
 127392 	;
 127393 	pPager = Xsqlite3BtreePager(tls, (*Db)(unsafe.Pointer(pDb)).FpBt)
 127394 	eMode = Xsqlite3PagerLockingMode(tls, pPager, eMode)
 127395 __79:
 127396 	;
 127397 	if !(eMode == PAGER_LOCKINGMODE_EXCLUSIVE) {
 127398 		goto __84
 127399 	}
 127400 	zRet = ts + 5017
 127401 __84:
 127402 	;
 127403 	returnSingleText(tls, v, zRet)
 127404 	goto __15
 127405 
 127406 __21:
 127407 	if !(zRight == uintptr(0)) {
 127408 		goto __85
 127409 	}
 127410 
 127411 	eMode1 = -1
 127412 	goto __86
 127413 __85:
 127414 	n = Xsqlite3Strlen30(tls, zRight)
 127415 	eMode1 = 0
 127416 __87:
 127417 	if !(libc.AssignUintptr(&zMode, Xsqlite3JournalModename(tls, eMode1)) != uintptr(0)) {
 127418 		goto __89
 127419 	}
 127420 	if !(Xsqlite3_strnicmp(tls, zRight, zMode, n) == 0) {
 127421 		goto __90
 127422 	}
 127423 	goto __89
 127424 __90:
 127425 	;
 127426 	goto __88
 127427 __88:
 127428 	eMode1++
 127429 	goto __87
 127430 	goto __89
 127431 __89:
 127432 	;
 127433 	if !!(zMode != 0) {
 127434 		goto __91
 127435 	}
 127436 
 127437 	eMode1 = -1
 127438 __91:
 127439 	;
 127440 	if !(eMode1 == PAGER_JOURNALMODE_OFF && (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_Defensive) != uint64(0)) {
 127441 		goto __92
 127442 	}
 127443 
 127444 	eMode1 = -1
 127445 __92:
 127446 	;
 127447 __86:
 127448 	;
 127449 	if !(eMode1 == -1 && (*Token)(unsafe.Pointer(pId2)).Fn == uint32(0)) {
 127450 		goto __93
 127451 	}
 127452 
 127453 	iDb = 0
 127454 	(*Token)(unsafe.Pointer(pId2)).Fn = uint32(1)
 127455 __93:
 127456 	;
 127457 	ii2 = (*Sqlite3)(unsafe.Pointer(db)).FnDb - 1
 127458 __94:
 127459 	if !(ii2 >= 0) {
 127460 		goto __96
 127461 	}
 127462 	if !((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii2)*32)).FpBt != 0 && (ii2 == iDb || (*Token)(unsafe.Pointer(pId2)).Fn == uint32(0))) {
 127463 		goto __97
 127464 	}
 127465 	Xsqlite3VdbeUsesBtree(tls, v, ii2)
 127466 	Xsqlite3VdbeAddOp3(tls, v, OP_JournalMode, ii2, 1, eMode1)
 127467 __97:
 127468 	;
 127469 	goto __95
 127470 __95:
 127471 	ii2--
 127472 	goto __94
 127473 	goto __96
 127474 __96:
 127475 	;
 127476 	Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, 1, 1)
 127477 	goto __15
 127478 
 127479 __22:
 127480 	pPager1 = Xsqlite3BtreePager(tls, (*Db)(unsafe.Pointer(pDb)).FpBt)
 127481 	*(*I64)(unsafe.Pointer(bp + 536)) = int64(-2)
 127482 	if !(zRight != 0) {
 127483 		goto __98
 127484 	}
 127485 	Xsqlite3DecOrHexToI64(tls, zRight, bp+536)
 127486 	if !(*(*I64)(unsafe.Pointer(bp + 536)) < int64(-1)) {
 127487 		goto __99
 127488 	}
 127489 	*(*I64)(unsafe.Pointer(bp + 536)) = int64(-1)
 127490 __99:
 127491 	;
 127492 __98:
 127493 	;
 127494 	*(*I64)(unsafe.Pointer(bp + 536)) = Xsqlite3PagerJournalSizeLimit(tls, pPager1, *(*I64)(unsafe.Pointer(bp + 536)))
 127495 	returnSingleInt(tls, v, *(*I64)(unsafe.Pointer(bp + 536)))
 127496 	goto __15
 127497 
 127498 __23:
 127499 	pBt2 = (*Db)(unsafe.Pointer(pDb)).FpBt
 127500 
 127501 	if !!(zRight != 0) {
 127502 		goto __100
 127503 	}
 127504 	returnSingleInt(tls, v, int64(Xsqlite3BtreeGetAutoVacuum(tls, pBt2)))
 127505 	goto __101
 127506 __100:
 127507 	eAuto = getAutoVacuum(tls, zRight)
 127508 
 127509 	(*Sqlite3)(unsafe.Pointer(db)).FnextAutovac = int8(U8(eAuto))
 127510 
 127511 	rc = Xsqlite3BtreeSetAutoVacuum(tls, pBt2, eAuto)
 127512 	if !(rc == SQLITE_OK && (eAuto == 1 || eAuto == 2)) {
 127513 		goto __102
 127514 	}
 127515 	iAddr = Xsqlite3VdbeCurrentAddr(tls, v)
 127516 
 127517 	aOp1 = Xsqlite3VdbeAddOpList(tls, v, int32(uint64(unsafe.Sizeof(setMeta6))/uint64(unsafe.Sizeof(VdbeOpList{}))), uintptr(unsafe.Pointer(&setMeta6)), iLn4)
 127518 	if !(0 != 0) {
 127519 		goto __103
 127520 	}
 127521 	goto __15
 127522 __103:
 127523 	;
 127524 	(*VdbeOp)(unsafe.Pointer(aOp1)).Fp1 = iDb
 127525 	(*VdbeOp)(unsafe.Pointer(aOp1 + 1*24)).Fp1 = iDb
 127526 	(*VdbeOp)(unsafe.Pointer(aOp1 + 2*24)).Fp2 = iAddr + 4
 127527 	(*VdbeOp)(unsafe.Pointer(aOp1 + 4*24)).Fp1 = iDb
 127528 	(*VdbeOp)(unsafe.Pointer(aOp1 + 4*24)).Fp3 = eAuto - 1
 127529 	Xsqlite3VdbeUsesBtree(tls, v, iDb)
 127530 __102:
 127531 	;
 127532 __101:
 127533 	;
 127534 	goto __15
 127535 
 127536 __24:
 127537 	*(*int32)(unsafe.Pointer(bp + 544)) = 0
 127538 	if !(zRight == uintptr(0) || !(Xsqlite3GetInt32(tls, zRight, bp+544) != 0) || *(*int32)(unsafe.Pointer(bp + 544)) <= 0) {
 127539 		goto __104
 127540 	}
 127541 	*(*int32)(unsafe.Pointer(bp + 544)) = 0x7fffffff
 127542 __104:
 127543 	;
 127544 	Xsqlite3BeginWriteOperation(tls, pParse, 0, iDb)
 127545 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, *(*int32)(unsafe.Pointer(bp + 544)), 1)
 127546 	addr = Xsqlite3VdbeAddOp1(tls, v, OP_IncrVacuum, iDb)
 127547 	Xsqlite3VdbeAddOp1(tls, v, OP_ResultRow, 1)
 127548 	Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, 1, -1)
 127549 	Xsqlite3VdbeAddOp2(tls, v, OP_IfPos, 1, addr)
 127550 	Xsqlite3VdbeJumpHere(tls, v, addr)
 127551 	goto __15
 127552 
 127553 __25:
 127554 	;
 127555 	if !!(zRight != 0) {
 127556 		goto __105
 127557 	}
 127558 	returnSingleInt(tls, v, int64((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fcache_size))
 127559 	goto __106
 127560 __105:
 127561 	size2 = Xsqlite3Atoi(tls, zRight)
 127562 	(*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fcache_size = size2
 127563 	Xsqlite3BtreeSetCacheSize(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fcache_size)
 127564 __106:
 127565 	;
 127566 	goto __15
 127567 
 127568 __26:
 127569 	;
 127570 	if !!(zRight != 0) {
 127571 		goto __107
 127572 	}
 127573 	returnSingleInt(tls, v,
 127574 		func() int64 {
 127575 			if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_CacheSpill) == uint64(0) {
 127576 				return int64(0)
 127577 			}
 127578 			return int64(Xsqlite3BtreeSetSpillSize(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, 0))
 127579 		}())
 127580 	goto __108
 127581 __107:
 127582 	*(*int32)(unsafe.Pointer(bp + 548)) = 1
 127583 	if !(Xsqlite3GetInt32(tls, zRight, bp+548) != 0) {
 127584 		goto __109
 127585 	}
 127586 	Xsqlite3BtreeSetSpillSize(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, *(*int32)(unsafe.Pointer(bp + 548)))
 127587 __109:
 127588 	;
 127589 	if !(Xsqlite3GetBoolean(tls, zRight, uint8(libc.Bool32(*(*int32)(unsafe.Pointer(bp + 548)) != 0))) != 0) {
 127590 		goto __110
 127591 	}
 127592 	*(*U64)(unsafe.Pointer(db + 48)) |= uint64(SQLITE_CacheSpill)
 127593 	goto __111
 127594 __110:
 127595 	*(*U64)(unsafe.Pointer(db + 48)) &= libc.CplUint64(uint64(SQLITE_CacheSpill))
 127596 __111:
 127597 	;
 127598 	setAllPagerFlags(tls, db)
 127599 __108:
 127600 	;
 127601 	goto __15
 127602 
 127603 __27:
 127604 	;
 127605 	if !(zRight != 0) {
 127606 		goto __112
 127607 	}
 127608 	Xsqlite3DecOrHexToI64(tls, zRight, bp+552)
 127609 	if !(*(*Sqlite3_int64)(unsafe.Pointer(bp + 552)) < int64(0)) {
 127610 		goto __113
 127611 	}
 127612 	*(*Sqlite3_int64)(unsafe.Pointer(bp + 552)) = Xsqlite3Config.FszMmap
 127613 __113:
 127614 	;
 127615 	if !((*Token)(unsafe.Pointer(pId2)).Fn == uint32(0)) {
 127616 		goto __114
 127617 	}
 127618 	(*Sqlite3)(unsafe.Pointer(db)).FszMmap = *(*Sqlite3_int64)(unsafe.Pointer(bp + 552))
 127619 __114:
 127620 	;
 127621 	ii3 = (*Sqlite3)(unsafe.Pointer(db)).FnDb - 1
 127622 __115:
 127623 	if !(ii3 >= 0) {
 127624 		goto __117
 127625 	}
 127626 	if !((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii3)*32)).FpBt != 0 && (ii3 == iDb || (*Token)(unsafe.Pointer(pId2)).Fn == uint32(0))) {
 127627 		goto __118
 127628 	}
 127629 	Xsqlite3BtreeSetMmapLimit(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii3)*32)).FpBt, *(*Sqlite3_int64)(unsafe.Pointer(bp + 552)))
 127630 __118:
 127631 	;
 127632 	goto __116
 127633 __116:
 127634 	ii3--
 127635 	goto __115
 127636 	goto __117
 127637 __117:
 127638 	;
 127639 __112:
 127640 	;
 127641 	*(*Sqlite3_int64)(unsafe.Pointer(bp + 552)) = int64(-1)
 127642 	rc = Xsqlite3_file_control(tls, db, zDb, SQLITE_FCNTL_MMAP_SIZE, bp+552)
 127643 	if !(rc == SQLITE_OK) {
 127644 		goto __119
 127645 	}
 127646 	returnSingleInt(tls, v, *(*Sqlite3_int64)(unsafe.Pointer(bp + 552)))
 127647 	goto __120
 127648 __119:
 127649 	if !(rc != SQLITE_NOTFOUND) {
 127650 		goto __121
 127651 	}
 127652 	(*Parse)(unsafe.Pointer(pParse)).FnErr++
 127653 	(*Parse)(unsafe.Pointer(pParse)).Frc = rc
 127654 __121:
 127655 	;
 127656 __120:
 127657 	;
 127658 	goto __15
 127659 
 127660 __28:
 127661 	if !!(zRight != 0) {
 127662 		goto __122
 127663 	}
 127664 	returnSingleInt(tls, v, int64((*Sqlite3)(unsafe.Pointer(db)).Ftemp_store))
 127665 	goto __123
 127666 __122:
 127667 	changeTempStorage(tls, pParse, zRight)
 127668 __123:
 127669 	;
 127670 	goto __15
 127671 
 127672 __29:
 127673 	Xsqlite3_mutex_enter(tls, Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_VFS1))
 127674 	if !!(zRight != 0) {
 127675 		goto __124
 127676 	}
 127677 	returnSingleText(tls, v, Xsqlite3_temp_directory)
 127678 	goto __125
 127679 __124:
 127680 	if !(*(*int8)(unsafe.Pointer(zRight)) != 0) {
 127681 		goto __126
 127682 	}
 127683 	rc = Xsqlite3OsAccess(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, zRight, SQLITE_ACCESS_READWRITE, bp+560)
 127684 	if !(rc != SQLITE_OK || *(*int32)(unsafe.Pointer(bp + 560)) == 0) {
 127685 		goto __127
 127686 	}
 127687 	Xsqlite3ErrorMsg(tls, pParse, ts+18921, 0)
 127688 	Xsqlite3_mutex_leave(tls, Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_VFS1))
 127689 	goto pragma_out
 127690 __127:
 127691 	;
 127692 __126:
 127693 	;
 127694 	if !(SQLITE_TEMP_STORE == 0 ||
 127695 		SQLITE_TEMP_STORE == 1 && int32((*Sqlite3)(unsafe.Pointer(db)).Ftemp_store) <= 1 ||
 127696 		SQLITE_TEMP_STORE == 2 && int32((*Sqlite3)(unsafe.Pointer(db)).Ftemp_store) == 1) {
 127697 		goto __128
 127698 	}
 127699 	invalidateTempStorage(tls, pParse)
 127700 __128:
 127701 	;
 127702 	Xsqlite3_free(tls, Xsqlite3_temp_directory)
 127703 	if !(*(*int8)(unsafe.Pointer(zRight)) != 0) {
 127704 		goto __129
 127705 	}
 127706 	Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp+16, zRight))
 127707 	goto __130
 127708 __129:
 127709 	Xsqlite3_temp_directory = uintptr(0)
 127710 __130:
 127711 	;
 127712 __125:
 127713 	;
 127714 	Xsqlite3_mutex_leave(tls, Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_VFS1))
 127715 	goto __15
 127716 
 127717 __30:
 127718 	Xsqlite3_mutex_enter(tls, Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_VFS1))
 127719 	if !!(zRight != 0) {
 127720 		goto __131
 127721 	}
 127722 	returnSingleText(tls, v, Xsqlite3_data_directory)
 127723 	goto __132
 127724 __131:
 127725 	if !(*(*int8)(unsafe.Pointer(zRight)) != 0) {
 127726 		goto __133
 127727 	}
 127728 	rc = Xsqlite3OsAccess(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, zRight, SQLITE_ACCESS_READWRITE, bp+564)
 127729 	if !(rc != SQLITE_OK || *(*int32)(unsafe.Pointer(bp + 564)) == 0) {
 127730 		goto __134
 127731 	}
 127732 	Xsqlite3ErrorMsg(tls, pParse, ts+18921, 0)
 127733 	Xsqlite3_mutex_leave(tls, Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_VFS1))
 127734 	goto pragma_out
 127735 __134:
 127736 	;
 127737 __133:
 127738 	;
 127739 	Xsqlite3_free(tls, Xsqlite3_data_directory)
 127740 	if !(*(*int8)(unsafe.Pointer(zRight)) != 0) {
 127741 		goto __135
 127742 	}
 127743 	Xsqlite3_data_directory = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp+24, zRight))
 127744 	goto __136
 127745 __135:
 127746 	Xsqlite3_data_directory = uintptr(0)
 127747 __136:
 127748 	;
 127749 __132:
 127750 	;
 127751 	Xsqlite3_mutex_leave(tls, Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_VFS1))
 127752 	goto __15
 127753 
 127754 __31:
 127755 	if !!(zRight != 0) {
 127756 		goto __137
 127757 	}
 127758 	returnSingleInt(tls, v, int64(int32((*Db)(unsafe.Pointer(pDb)).Fsafety_level)-1))
 127759 	goto __138
 127760 __137:
 127761 	if !!(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0) {
 127762 		goto __139
 127763 	}
 127764 	Xsqlite3ErrorMsg(tls, pParse,
 127765 		ts+18946, 0)
 127766 	goto __140
 127767 __139:
 127768 	if !(iDb != 1) {
 127769 		goto __141
 127770 	}
 127771 	iLevel = (int32(getSafetyLevel(tls, zRight, 0, uint8(1))) + 1) & PAGER_SYNCHRONOUS_MASK
 127772 	if !(iLevel == 0) {
 127773 		goto __142
 127774 	}
 127775 	iLevel = 1
 127776 __142:
 127777 	;
 127778 	(*Db)(unsafe.Pointer(pDb)).Fsafety_level = U8(iLevel)
 127779 	(*Db)(unsafe.Pointer(pDb)).FbSyncSet = U8(1)
 127780 	setAllPagerFlags(tls, db)
 127781 __141:
 127782 	;
 127783 __140:
 127784 	;
 127785 __138:
 127786 	;
 127787 	goto __15
 127788 
 127789 __32:
 127790 	if !(zRight == uintptr(0)) {
 127791 		goto __143
 127792 	}
 127793 	setPragmaResultColumnNames(tls, v, pPragma)
 127794 	returnSingleInt(tls, v, int64(libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).Fflags&(*PragmaName)(unsafe.Pointer(pPragma)).FiArg != uint64(0))))
 127795 	goto __144
 127796 __143:
 127797 	mask = (*PragmaName)(unsafe.Pointer(pPragma)).FiArg
 127798 	if !(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) == 0) {
 127799 		goto __145
 127800 	}
 127801 
 127802 	mask = mask & libc.Uint64FromInt32(libc.CplInt32(SQLITE_ForeignKeys))
 127803 __145:
 127804 	;
 127805 	if !(Xsqlite3GetBoolean(tls, zRight, uint8(0)) != 0) {
 127806 		goto __146
 127807 	}
 127808 	*(*U64)(unsafe.Pointer(db + 48)) |= mask
 127809 	goto __147
 127810 __146:
 127811 	*(*U64)(unsafe.Pointer(db + 48)) &= ^mask
 127812 	if !(mask == uint64(SQLITE_DeferFKs)) {
 127813 		goto __148
 127814 	}
 127815 	(*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = int64(0)
 127816 __148:
 127817 	;
 127818 	if !(mask&uint64(SQLITE_WriteSchema) != uint64(0) &&
 127819 		Xsqlite3_stricmp(tls, zRight, ts+18999) == 0) {
 127820 		goto __149
 127821 	}
 127822 
 127823 	Xsqlite3ResetAllSchemasOfConnection(tls, db)
 127824 __149:
 127825 	;
 127826 __147:
 127827 	;
 127828 	Xsqlite3VdbeAddOp0(tls, v, OP_Expire)
 127829 	setAllPagerFlags(tls, db)
 127830 __144:
 127831 	;
 127832 	goto __15
 127833 
 127834 __33:
 127835 	if !(zRight != 0) {
 127836 		goto __150
 127837 	}
 127838 	Xsqlite3CodeVerifyNamedSchema(tls, pParse, zDb)
 127839 	pTab = Xsqlite3LocateTable(tls, pParse, uint32(LOCATE_NOERR), zRight, zDb)
 127840 	if !(pTab != 0) {
 127841 		goto __151
 127842 	}
 127843 	nHidden = 0
 127844 	pPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
 127845 	(*Parse)(unsafe.Pointer(pParse)).FnMem = 7
 127846 	Xsqlite3ViewGetColumnNames(tls, pParse, pTab)
 127847 	i = 0
 127848 	pCol = (*Table)(unsafe.Pointer(pTab)).FaCol
 127849 __152:
 127850 	if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 127851 		goto __154
 127852 	}
 127853 	isHidden = 0
 127854 	if !(int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_NOINSERT != 0) {
 127855 		goto __155
 127856 	}
 127857 	if !((*PragmaName)(unsafe.Pointer(pPragma)).FiArg == uint64(0)) {
 127858 		goto __156
 127859 	}
 127860 	nHidden++
 127861 	goto __153
 127862 __156:
 127863 	;
 127864 	if !(int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_VIRTUAL != 0) {
 127865 		goto __157
 127866 	}
 127867 	isHidden = 2
 127868 	goto __158
 127869 __157:
 127870 	if !(int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_STORED != 0) {
 127871 		goto __159
 127872 	}
 127873 	isHidden = 3
 127874 	goto __160
 127875 __159:
 127876 	;
 127877 	isHidden = 1
 127878 __160:
 127879 	;
 127880 __158:
 127881 	;
 127882 __155:
 127883 	;
 127884 	if !(int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_PRIMKEY == 0) {
 127885 		goto __161
 127886 	}
 127887 	k = 0
 127888 	goto __162
 127889 __161:
 127890 	if !(pPk == uintptr(0)) {
 127891 		goto __163
 127892 	}
 127893 	k = 1
 127894 	goto __164
 127895 __163:
 127896 	k = 1
 127897 __165:
 127898 	if !(k <= int32((*Table)(unsafe.Pointer(pTab)).FnCol) && int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(k-1)*2))) != i) {
 127899 		goto __167
 127900 	}
 127901 	goto __166
 127902 __166:
 127903 	k++
 127904 	goto __165
 127905 	goto __167
 127906 __167:
 127907 	;
 127908 __164:
 127909 	;
 127910 __162:
 127911 	;
 127912 	pColExpr = Xsqlite3ColumnExpr(tls, pTab, pCol)
 127913 
 127914 	Xsqlite3VdbeMultiLoad(tls, v, 1, func() uintptr {
 127915 		if (*PragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 {
 127916 			return ts + 19005
 127917 		}
 127918 		return ts + 19013
 127919 	}(),
 127920 		libc.VaList(bp+32, i-nHidden,
 127921 			(*Column)(unsafe.Pointer(pCol)).FzCnName,
 127922 			Xsqlite3ColumnType(tls, pCol, ts+1544),
 127923 			func() int32 {
 127924 				if uint32(int32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 {
 127925 					return 1
 127926 				}
 127927 				return 0
 127928 			}(),
 127929 			func() uintptr {
 127930 				if isHidden >= 2 || pColExpr == uintptr(0) {
 127931 					return uintptr(0)
 127932 				}
 127933 				return *(*uintptr)(unsafe.Pointer(pColExpr + 8))
 127934 			}(),
 127935 			k,
 127936 			isHidden))
 127937 	goto __153
 127938 __153:
 127939 	i++
 127940 	pCol += 24
 127941 	goto __152
 127942 	goto __154
 127943 __154:
 127944 	;
 127945 __151:
 127946 	;
 127947 __150:
 127948 	;
 127949 	goto __15
 127950 
 127951 __34:
 127952 	(*Parse)(unsafe.Pointer(pParse)).FnMem = 6
 127953 	Xsqlite3CodeVerifyNamedSchema(tls, pParse, zDb)
 127954 	ii4 = 0
 127955 __168:
 127956 	if !(ii4 < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
 127957 		goto __170
 127958 	}
 127959 	if !(zDb != 0 && Xsqlite3_stricmp(tls, zDb, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii4)*32)).FzDbSName) != 0) {
 127960 		goto __171
 127961 	}
 127962 	goto __169
 127963 __171:
 127964 	;
 127965 	pHash = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii4)*32)).FpSchema + 8
 127966 	initNCol = int32((*Hash)(unsafe.Pointer(pHash)).Fcount)
 127967 __172:
 127968 	if !(libc.PostDecInt32(&initNCol, 1) != 0) {
 127969 		goto __173
 127970 	}
 127971 	k1 = (*Hash)(unsafe.Pointer(pHash)).Ffirst
 127972 __174:
 127973 	if !(1 != 0) {
 127974 		goto __176
 127975 	}
 127976 	if !(k1 == uintptr(0)) {
 127977 		goto __177
 127978 	}
 127979 	initNCol = 0
 127980 	goto __176
 127981 __177:
 127982 	;
 127983 	pTab1 = (*HashElem)(unsafe.Pointer(k1)).Fdata
 127984 	if !(int32((*Table)(unsafe.Pointer(pTab1)).FnCol) == 0) {
 127985 		goto __178
 127986 	}
 127987 	zSql = Xsqlite3MPrintf(tls, db, ts+19020, libc.VaList(bp+88, (*Table)(unsafe.Pointer(pTab1)).FzName))
 127988 	if !(zSql != 0) {
 127989 		goto __179
 127990 	}
 127991 	*(*uintptr)(unsafe.Pointer(bp + 568)) = uintptr(0)
 127992 	Xsqlite3_prepare(tls, db, zSql, -1, bp+568, uintptr(0))
 127993 	Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 568)))
 127994 	Xsqlite3DbFree(tls, db, zSql)
 127995 __179:
 127996 	;
 127997 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 127998 		goto __180
 127999 	}
 128000 	Xsqlite3ErrorMsg(tls, (*Sqlite3)(unsafe.Pointer(db)).FpParse, ts+1480, 0)
 128001 	(*Parse)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FpParse)).Frc = SQLITE_NOMEM
 128002 __180:
 128003 	;
 128004 	pHash = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii4)*32)).FpSchema + 8
 128005 	goto __176
 128006 __178:
 128007 	;
 128008 	goto __175
 128009 __175:
 128010 	k1 = (*HashElem)(unsafe.Pointer(k1)).Fnext
 128011 	goto __174
 128012 	goto __176
 128013 __176:
 128014 	;
 128015 	goto __172
 128016 __173:
 128017 	;
 128018 	k1 = (*Hash)(unsafe.Pointer(pHash)).Ffirst
 128019 __181:
 128020 	if !(k1 != 0) {
 128021 		goto __183
 128022 	}
 128023 	pTab2 = (*HashElem)(unsafe.Pointer(k1)).Fdata
 128024 	if !(zRight != 0 && Xsqlite3_stricmp(tls, zRight, (*Table)(unsafe.Pointer(pTab2)).FzName) != 0) {
 128025 		goto __184
 128026 	}
 128027 	goto __182
 128028 __184:
 128029 	;
 128030 	if !(int32((*Table)(unsafe.Pointer(pTab2)).FeTabType) == TABTYP_VIEW) {
 128031 		goto __185
 128032 	}
 128033 	zType = ts + 11843
 128034 	goto __186
 128035 __185:
 128036 	if !(int32((*Table)(unsafe.Pointer(pTab2)).FeTabType) == TABTYP_VTAB) {
 128037 		goto __187
 128038 	}
 128039 	zType = ts + 14073
 128040 	goto __188
 128041 __187:
 128042 	if !((*Table)(unsafe.Pointer(pTab2)).FtabFlags&U32(TF_Shadow) != 0) {
 128043 		goto __189
 128044 	}
 128045 	zType = ts + 19036
 128046 	goto __190
 128047 __189:
 128048 	zType = ts + 10228
 128049 __190:
 128050 	;
 128051 __188:
 128052 	;
 128053 __186:
 128054 	;
 128055 	Xsqlite3VdbeMultiLoad(tls, v, 1, ts+19043,
 128056 		libc.VaList(bp+96, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii4)*32)).FzDbSName,
 128057 			Xsqlite3PreferredTableName(tls, (*Table)(unsafe.Pointer(pTab2)).FzName),
 128058 			zType,
 128059 			int32((*Table)(unsafe.Pointer(pTab2)).FnCol),
 128060 			libc.Bool32((*Table)(unsafe.Pointer(pTab2)).FtabFlags&U32(TF_WithoutRowid) != U32(0)),
 128061 			libc.Bool32((*Table)(unsafe.Pointer(pTab2)).FtabFlags&U32(TF_Strict) != U32(0))))
 128062 	goto __182
 128063 __182:
 128064 	k1 = (*HashElem)(unsafe.Pointer(k1)).Fnext
 128065 	goto __181
 128066 	goto __183
 128067 __183:
 128068 	;
 128069 	goto __169
 128070 __169:
 128071 	ii4++
 128072 	goto __168
 128073 	goto __170
 128074 __170:
 128075 	;
 128076 	goto __15
 128077 
 128078 __35:
 128079 	if !(zRight != 0) {
 128080 		goto __191
 128081 	}
 128082 	pIdx = Xsqlite3FindIndex(tls, db, zRight, zDb)
 128083 	if !(pIdx == uintptr(0)) {
 128084 		goto __192
 128085 	}
 128086 
 128087 	pTab3 = Xsqlite3LocateTable(tls, pParse, uint32(LOCATE_NOERR), zRight, zDb)
 128088 	if !(pTab3 != 0 && !((*Table)(unsafe.Pointer(pTab3)).FtabFlags&U32(TF_WithoutRowid) == U32(0))) {
 128089 		goto __193
 128090 	}
 128091 	pIdx = Xsqlite3PrimaryKeyIndex(tls, pTab3)
 128092 __193:
 128093 	;
 128094 __192:
 128095 	;
 128096 	if !(pIdx != 0) {
 128097 		goto __194
 128098 	}
 128099 	iIdxDb = Xsqlite3SchemaToIndex(tls, db, (*Index)(unsafe.Pointer(pIdx)).FpSchema)
 128100 	if !((*PragmaName)(unsafe.Pointer(pPragma)).FiArg != 0) {
 128101 		goto __195
 128102 	}
 128103 
 128104 	mx = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
 128105 	(*Parse)(unsafe.Pointer(pParse)).FnMem = 6
 128106 	goto __196
 128107 __195:
 128108 	mx = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
 128109 	(*Parse)(unsafe.Pointer(pParse)).FnMem = 3
 128110 __196:
 128111 	;
 128112 	pTab3 = (*Index)(unsafe.Pointer(pIdx)).FpTable
 128113 	Xsqlite3CodeVerifySchema(tls, pParse, iIdxDb)
 128114 
 128115 	i1 = 0
 128116 __197:
 128117 	if !(i1 < mx) {
 128118 		goto __199
 128119 	}
 128120 	cnum = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i1)*2))
 128121 	Xsqlite3VdbeMultiLoad(tls, v, 1, ts+19050, libc.VaList(bp+144, i1, int32(cnum),
 128122 		func() uintptr {
 128123 			if int32(cnum) < 0 {
 128124 				return uintptr(0)
 128125 			}
 128126 			return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab3)).FaCol + uintptr(cnum)*24)).FzCnName
 128127 		}()))
 128128 	if !((*PragmaName)(unsafe.Pointer(pPragma)).FiArg != 0) {
 128129 		goto __200
 128130 	}
 128131 	Xsqlite3VdbeMultiLoad(tls, v, 4, ts+19055,
 128132 		libc.VaList(bp+168, int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))),
 128133 			*(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)),
 128134 			libc.Bool32(i1 < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol))))
 128135 __200:
 128136 	;
 128137 	Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, 1, (*Parse)(unsafe.Pointer(pParse)).FnMem)
 128138 	goto __198
 128139 __198:
 128140 	i1++
 128141 	goto __197
 128142 	goto __199
 128143 __199:
 128144 	;
 128145 __194:
 128146 	;
 128147 __191:
 128148 	;
 128149 	goto __15
 128150 
 128151 __36:
 128152 	if !(zRight != 0) {
 128153 		goto __201
 128154 	}
 128155 	pTab4 = Xsqlite3FindTable(tls, db, zRight, zDb)
 128156 	if !(pTab4 != 0) {
 128157 		goto __202
 128158 	}
 128159 	iTabDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab4)).FpSchema)
 128160 	(*Parse)(unsafe.Pointer(pParse)).FnMem = 5
 128161 	Xsqlite3CodeVerifySchema(tls, pParse, iTabDb)
 128162 	pIdx1 = (*Table)(unsafe.Pointer(pTab4)).FpIndex
 128163 	i2 = 0
 128164 __203:
 128165 	if !(pIdx1 != 0) {
 128166 		goto __205
 128167 	}
 128168 	*(*[3]uintptr)(unsafe.Pointer(bp + 576)) = [3]uintptr{ts + 19060, ts + 19062, ts + 17513}
 128169 	Xsqlite3VdbeMultiLoad(tls, v, 1, ts+19064,
 128170 		libc.VaList(bp+192, i2,
 128171 			(*Index)(unsafe.Pointer(pIdx1)).FzName,
 128172 			libc.Bool32(int32((*Index)(unsafe.Pointer(pIdx1)).FonError) != OE_None),
 128173 			*(*uintptr)(unsafe.Pointer(bp + 576 + uintptr(uint32(int32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0)))*8)),
 128174 			libc.Bool32((*Index)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0))))
 128175 	goto __204
 128176 __204:
 128177 	pIdx1 = (*Index)(unsafe.Pointer(pIdx1)).FpNext
 128178 	i2++
 128179 	goto __203
 128180 	goto __205
 128181 __205:
 128182 	;
 128183 __202:
 128184 	;
 128185 __201:
 128186 	;
 128187 	goto __15
 128188 
 128189 __37:
 128190 	(*Parse)(unsafe.Pointer(pParse)).FnMem = 3
 128191 	i3 = 0
 128192 __206:
 128193 	if !(i3 < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
 128194 		goto __208
 128195 	}
 128196 	if !((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i3)*32)).FpBt == uintptr(0)) {
 128197 		goto __209
 128198 	}
 128199 	goto __207
 128200 __209:
 128201 	;
 128202 	Xsqlite3VdbeMultiLoad(tls, v, 1, ts+19070,
 128203 		libc.VaList(bp+232, i3,
 128204 			(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i3)*32)).FzDbSName,
 128205 			Xsqlite3BtreeGetFilename(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i3)*32)).FpBt)))
 128206 	goto __207
 128207 __207:
 128208 	i3++
 128209 	goto __206
 128210 	goto __208
 128211 __208:
 128212 	;
 128213 	goto __15
 128214 
 128215 __38:
 128216 	i4 = 0
 128217 	(*Parse)(unsafe.Pointer(pParse)).FnMem = 2
 128218 	p = (*Hash)(unsafe.Pointer(db + 648)).Ffirst
 128219 __210:
 128220 	if !(p != 0) {
 128221 		goto __212
 128222 	}
 128223 	pColl = (*HashElem)(unsafe.Pointer(p)).Fdata
 128224 	Xsqlite3VdbeMultiLoad(tls, v, 1, ts+19074, libc.VaList(bp+256, libc.PostIncInt32(&i4, 1), (*CollSeq)(unsafe.Pointer(pColl)).FzName))
 128225 	goto __211
 128226 __211:
 128227 	p = (*HashElem)(unsafe.Pointer(p)).Fnext
 128228 	goto __210
 128229 	goto __212
 128230 __212:
 128231 	;
 128232 	goto __15
 128233 
 128234 __39:
 128235 	showInternFunc = libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_InternalFunc) != U32(0))
 128236 	(*Parse)(unsafe.Pointer(pParse)).FnMem = 6
 128237 	i5 = 0
 128238 __213:
 128239 	if !(i5 < SQLITE_FUNC_HASH_SZ) {
 128240 		goto __215
 128241 	}
 128242 	p1 = *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&Xsqlite3BuiltinFunctions)) + uintptr(i5)*8))
 128243 __216:
 128244 	if !(p1 != 0) {
 128245 		goto __218
 128246 	}
 128247 
 128248 	pragmaFunclistLine(tls, v, p1, 1, showInternFunc)
 128249 	goto __217
 128250 __217:
 128251 	p1 = *(*uintptr)(unsafe.Pointer(p1 + 64))
 128252 	goto __216
 128253 	goto __218
 128254 __218:
 128255 	;
 128256 	goto __214
 128257 __214:
 128258 	i5++
 128259 	goto __213
 128260 	goto __215
 128261 __215:
 128262 	;
 128263 	j = (*Hash)(unsafe.Pointer(db + 624)).Ffirst
 128264 __219:
 128265 	if !(j != 0) {
 128266 		goto __221
 128267 	}
 128268 	p1 = (*HashElem)(unsafe.Pointer(j)).Fdata
 128269 
 128270 	pragmaFunclistLine(tls, v, p1, 0, showInternFunc)
 128271 	goto __220
 128272 __220:
 128273 	j = (*HashElem)(unsafe.Pointer(j)).Fnext
 128274 	goto __219
 128275 	goto __221
 128276 __221:
 128277 	;
 128278 	goto __15
 128279 
 128280 __40:
 128281 	(*Parse)(unsafe.Pointer(pParse)).FnMem = 1
 128282 	j1 = (*Hash)(unsafe.Pointer(db + 576)).Ffirst
 128283 __222:
 128284 	if !(j1 != 0) {
 128285 		goto __224
 128286 	}
 128287 	pMod = (*HashElem)(unsafe.Pointer(j1)).Fdata
 128288 	Xsqlite3VdbeMultiLoad(tls, v, 1, ts+8869, libc.VaList(bp+272, (*Module)(unsafe.Pointer(pMod)).FzName))
 128289 	goto __223
 128290 __223:
 128291 	j1 = (*HashElem)(unsafe.Pointer(j1)).Fnext
 128292 	goto __222
 128293 	goto __224
 128294 __224:
 128295 	;
 128296 	goto __15
 128297 
 128298 __41:
 128299 	i6 = 0
 128300 __225:
 128301 	if !(i6 < int32(uint64(unsafe.Sizeof(aPragmaName))/uint64(unsafe.Sizeof(PragmaName{})))) {
 128302 		goto __227
 128303 	}
 128304 	Xsqlite3VdbeMultiLoad(tls, v, 1, ts+8869, libc.VaList(bp+280, aPragmaName[i6].FzName))
 128305 	goto __226
 128306 __226:
 128307 	i6++
 128308 	goto __225
 128309 	goto __227
 128310 __227:
 128311 	;
 128312 	goto __15
 128313 
 128314 __42:
 128315 	if !(zRight != 0) {
 128316 		goto __228
 128317 	}
 128318 	pTab5 = Xsqlite3FindTable(tls, db, zRight, zDb)
 128319 	if !(pTab5 != 0 && int32((*Table)(unsafe.Pointer(pTab5)).FeTabType) == TABTYP_NORM) {
 128320 		goto __229
 128321 	}
 128322 	pFK = *(*uintptr)(unsafe.Pointer(pTab5 + 64 + 8))
 128323 	if !(pFK != 0) {
 128324 		goto __230
 128325 	}
 128326 	iTabDb1 = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab5)).FpSchema)
 128327 	i7 = 0
 128328 	(*Parse)(unsafe.Pointer(pParse)).FnMem = 8
 128329 	Xsqlite3CodeVerifySchema(tls, pParse, iTabDb1)
 128330 __231:
 128331 	if !(pFK != 0) {
 128332 		goto __232
 128333 	}
 128334 	j2 = 0
 128335 __233:
 128336 	if !(j2 < (*FKey)(unsafe.Pointer(pFK)).FnCol) {
 128337 		goto __235
 128338 	}
 128339 	Xsqlite3VdbeMultiLoad(tls, v, 1, ts+19077,
 128340 		libc.VaList(bp+288, i7,
 128341 			j2,
 128342 			(*FKey)(unsafe.Pointer(pFK)).FzTo,
 128343 			(*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab5)).FaCol+uintptr((*sColMap)(unsafe.Pointer(pFK+64+uintptr(j2)*16)).FiFrom)*24)).FzCnName,
 128344 			(*sColMap)(unsafe.Pointer(pFK+64+uintptr(j2)*16)).FzCol,
 128345 			actionName(tls, *(*U8)(unsafe.Pointer(pFK + 45 + 1))),
 128346 			actionName(tls, *(*U8)(unsafe.Pointer(pFK + 45))),
 128347 			ts+19086))
 128348 	goto __234
 128349 __234:
 128350 	j2++
 128351 	goto __233
 128352 	goto __235
 128353 __235:
 128354 	;
 128355 	i7++
 128356 	pFK = (*FKey)(unsafe.Pointer(pFK)).FpNextFrom
 128357 	goto __231
 128358 __232:
 128359 	;
 128360 __230:
 128361 	;
 128362 __229:
 128363 	;
 128364 __228:
 128365 	;
 128366 	goto __15
 128367 
 128368 __43:
 128369 	regResult = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 128370 	*(*int32)(unsafe.Pointer(pParse + 56)) += 4
 128371 	regRow = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 128372 	k2 = (*Hash)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpSchema + 8)).Ffirst
 128373 __236:
 128374 	if !(k2 != 0) {
 128375 		goto __237
 128376 	}
 128377 	if !(zRight != 0) {
 128378 		goto __238
 128379 	}
 128380 	pTab6 = Xsqlite3LocateTable(tls, pParse, uint32(0), zRight, zDb)
 128381 	k2 = uintptr(0)
 128382 	goto __239
 128383 __238:
 128384 	pTab6 = (*HashElem)(unsafe.Pointer(k2)).Fdata
 128385 	k2 = (*HashElem)(unsafe.Pointer(k2)).Fnext
 128386 __239:
 128387 	;
 128388 	if !(pTab6 == uintptr(0) || !(int32((*Table)(unsafe.Pointer(pTab6)).FeTabType) == TABTYP_NORM) || *(*uintptr)(unsafe.Pointer(pTab6 + 64 + 8)) == uintptr(0)) {
 128389 		goto __240
 128390 	}
 128391 	goto __236
 128392 __240:
 128393 	;
 128394 	iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab6)).FpSchema)
 128395 	zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
 128396 	Xsqlite3CodeVerifySchema(tls, pParse, iDb)
 128397 	Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab6)).Ftnum, uint8(0), (*Table)(unsafe.Pointer(pTab6)).FzName)
 128398 	if !(int32((*Table)(unsafe.Pointer(pTab6)).FnCol)+regRow > (*Parse)(unsafe.Pointer(pParse)).FnMem) {
 128399 		goto __241
 128400 	}
 128401 	(*Parse)(unsafe.Pointer(pParse)).FnMem = int32((*Table)(unsafe.Pointer(pTab6)).FnCol) + regRow
 128402 __241:
 128403 	;
 128404 	Xsqlite3OpenTable(tls, pParse, 0, iDb, pTab6, OP_OpenRead)
 128405 	Xsqlite3VdbeLoadString(tls, v, regResult, (*Table)(unsafe.Pointer(pTab6)).FzName)
 128406 
 128407 	i8 = 1
 128408 	pFK1 = *(*uintptr)(unsafe.Pointer(pTab6 + 64 + 8))
 128409 __242:
 128410 	if !(pFK1 != 0) {
 128411 		goto __244
 128412 	}
 128413 	pParent = Xsqlite3FindTable(tls, db, (*FKey)(unsafe.Pointer(pFK1)).FzTo, zDb)
 128414 	if !(pParent == uintptr(0)) {
 128415 		goto __245
 128416 	}
 128417 	goto __243
 128418 __245:
 128419 	;
 128420 	*(*uintptr)(unsafe.Pointer(bp + 600)) = uintptr(0)
 128421 	Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pParent)).Ftnum, uint8(0), (*Table)(unsafe.Pointer(pParent)).FzName)
 128422 	x1 = Xsqlite3FkLocateIndex(tls, pParse, pParent, pFK1, bp+600, uintptr(0))
 128423 	if !(x1 == 0) {
 128424 		goto __246
 128425 	}
 128426 	if !(*(*uintptr)(unsafe.Pointer(bp + 600)) == uintptr(0)) {
 128427 		goto __248
 128428 	}
 128429 	Xsqlite3OpenTable(tls, pParse, i8, iDb, pParent, OP_OpenRead)
 128430 	goto __249
 128431 __248:
 128432 	Xsqlite3VdbeAddOp3(tls, v, OP_OpenRead, i8, int32((*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 600)))).Ftnum), iDb)
 128433 	Xsqlite3VdbeSetP4KeyInfo(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 600)))
 128434 __249:
 128435 	;
 128436 	goto __247
 128437 __246:
 128438 	k2 = uintptr(0)
 128439 	goto __244
 128440 __247:
 128441 	;
 128442 	goto __243
 128443 __243:
 128444 	i8++
 128445 	pFK1 = (*FKey)(unsafe.Pointer(pFK1)).FpNextFrom
 128446 	goto __242
 128447 	goto __244
 128448 __244:
 128449 	;
 128450 	if !(pFK1 != 0) {
 128451 		goto __250
 128452 	}
 128453 	goto __237
 128454 __250:
 128455 	;
 128456 	if !((*Parse)(unsafe.Pointer(pParse)).FnTab < i8) {
 128457 		goto __251
 128458 	}
 128459 	(*Parse)(unsafe.Pointer(pParse)).FnTab = i8
 128460 __251:
 128461 	;
 128462 	addrTop = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, 0)
 128463 
 128464 	i8 = 1
 128465 	pFK1 = *(*uintptr)(unsafe.Pointer(pTab6 + 64 + 8))
 128466 __252:
 128467 	if !(pFK1 != 0) {
 128468 		goto __254
 128469 	}
 128470 	pParent = Xsqlite3FindTable(tls, db, (*FKey)(unsafe.Pointer(pFK1)).FzTo, zDb)
 128471 	*(*uintptr)(unsafe.Pointer(bp + 600)) = uintptr(0)
 128472 	*(*uintptr)(unsafe.Pointer(bp + 608)) = uintptr(0)
 128473 	if !(pParent != 0) {
 128474 		goto __255
 128475 	}
 128476 	x1 = Xsqlite3FkLocateIndex(tls, pParse, pParent, pFK1, bp+600, bp+608)
 128477 
 128478 __255:
 128479 	;
 128480 	addrOk = Xsqlite3VdbeMakeLabel(tls, pParse)
 128481 
 128482 	if !(regRow+(*FKey)(unsafe.Pointer(pFK1)).FnCol > (*Parse)(unsafe.Pointer(pParse)).FnMem) {
 128483 		goto __256
 128484 	}
 128485 	(*Parse)(unsafe.Pointer(pParse)).FnMem = regRow + (*FKey)(unsafe.Pointer(pFK1)).FnCol
 128486 __256:
 128487 	;
 128488 	j3 = 0
 128489 __257:
 128490 	if !(j3 < (*FKey)(unsafe.Pointer(pFK1)).FnCol) {
 128491 		goto __259
 128492 	}
 128493 	if *(*uintptr)(unsafe.Pointer(bp + 608)) != 0 {
 128494 		iCol = *(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 608)) + uintptr(j3)*4))
 128495 	} else {
 128496 		iCol = (*sColMap)(unsafe.Pointer(pFK1 + 64 + uintptr(j3)*16)).FiFrom
 128497 	}
 128498 	Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab6, 0, iCol, regRow+j3)
 128499 	Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, regRow+j3, addrOk)
 128500 	goto __258
 128501 __258:
 128502 	j3++
 128503 	goto __257
 128504 	goto __259
 128505 __259:
 128506 	;
 128507 	if !(*(*uintptr)(unsafe.Pointer(bp + 600)) != 0) {
 128508 		goto __260
 128509 	}
 128510 	Xsqlite3VdbeAddOp4(tls, v, OP_Affinity, regRow, (*FKey)(unsafe.Pointer(pFK1)).FnCol, 0,
 128511 		Xsqlite3IndexAffinityStr(tls, db, *(*uintptr)(unsafe.Pointer(bp + 600))), (*FKey)(unsafe.Pointer(pFK1)).FnCol)
 128512 	Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, i8, addrOk, regRow, (*FKey)(unsafe.Pointer(pFK1)).FnCol)
 128513 
 128514 	goto __261
 128515 __260:
 128516 	if !(pParent != 0) {
 128517 		goto __262
 128518 	}
 128519 	jmp = Xsqlite3VdbeCurrentAddr(tls, v) + 2
 128520 	Xsqlite3VdbeAddOp3(tls, v, OP_SeekRowid, i8, jmp, regRow)
 128521 	Xsqlite3VdbeGoto(tls, v, addrOk)
 128522 
 128523 __262:
 128524 	;
 128525 __261:
 128526 	;
 128527 	if !((*Table)(unsafe.Pointer(pTab6)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 128528 		goto __263
 128529 	}
 128530 	Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, 0, regResult+1)
 128531 	goto __264
 128532 __263:
 128533 	Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regResult+1)
 128534 __264:
 128535 	;
 128536 	Xsqlite3VdbeMultiLoad(tls, v, regResult+2, ts+19091, libc.VaList(bp+352, (*FKey)(unsafe.Pointer(pFK1)).FzTo, i8-1))
 128537 	Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, regResult, 4)
 128538 	Xsqlite3VdbeResolveLabel(tls, v, addrOk)
 128539 	Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 608)))
 128540 	goto __253
 128541 __253:
 128542 	i8++
 128543 	pFK1 = (*FKey)(unsafe.Pointer(pFK1)).FpNextFrom
 128544 	goto __252
 128545 	goto __254
 128546 __254:
 128547 	;
 128548 	Xsqlite3VdbeAddOp2(tls, v, OP_Next, 0, addrTop+1)
 128549 	Xsqlite3VdbeJumpHere(tls, v, addrTop)
 128550 	goto __236
 128551 __237:
 128552 	;
 128553 	goto __15
 128554 
 128555 __44:
 128556 	if !(zRight != 0) {
 128557 		goto __265
 128558 	}
 128559 	Xsqlite3RegisterLikeFunctions(tls, db, int32(Xsqlite3GetBoolean(tls, zRight, uint8(0))))
 128560 __265:
 128561 	;
 128562 	goto __15
 128563 
 128564 __45:
 128565 	pObjTab = uintptr(0)
 128566 
 128567 	isQuick = libc.Bool32(int32(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(zLeft)))]) == 'q')
 128568 
 128569 	if !((*Token)(unsafe.Pointer(pId2)).Fz == uintptr(0)) {
 128570 		goto __266
 128571 	}
 128572 	iDb = -1
 128573 __266:
 128574 	;
 128575 	(*Parse)(unsafe.Pointer(pParse)).FnMem = 6
 128576 
 128577 	*(*int32)(unsafe.Pointer(bp + 616)) = SQLITE_INTEGRITY_CHECK_ERROR_MAX
 128578 	if !(zRight != 0) {
 128579 		goto __267
 128580 	}
 128581 	if !(Xsqlite3GetInt32(tls, zRight, bp+616) != 0) {
 128582 		goto __268
 128583 	}
 128584 	if !(*(*int32)(unsafe.Pointer(bp + 616)) <= 0) {
 128585 		goto __270
 128586 	}
 128587 	*(*int32)(unsafe.Pointer(bp + 616)) = SQLITE_INTEGRITY_CHECK_ERROR_MAX
 128588 __270:
 128589 	;
 128590 	goto __269
 128591 __268:
 128592 	pObjTab = Xsqlite3LocateTable(tls, pParse, uint32(0), zRight,
 128593 		func() uintptr {
 128594 			if iDb >= 0 {
 128595 				return (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
 128596 			}
 128597 			return uintptr(0)
 128598 		}())
 128599 __269:
 128600 	;
 128601 __267:
 128602 	;
 128603 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, *(*int32)(unsafe.Pointer(bp + 616))-1, 1)
 128604 
 128605 	i9 = 0
 128606 __271:
 128607 	if !(i9 < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
 128608 		goto __273
 128609 	}
 128610 	cnt = 0
 128611 	mxIdx = 0
 128612 
 128613 	if !(0 != 0 && i9 == 1) {
 128614 		goto __274
 128615 	}
 128616 	goto __272
 128617 __274:
 128618 	;
 128619 	if !(iDb >= 0 && i9 != iDb) {
 128620 		goto __275
 128621 	}
 128622 	goto __272
 128623 __275:
 128624 	;
 128625 	Xsqlite3CodeVerifySchema(tls, pParse, i9)
 128626 
 128627 	pTbls = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i9)*32)).FpSchema + 8
 128628 	cnt = 0
 128629 	x2 = (*Hash)(unsafe.Pointer(pTbls)).Ffirst
 128630 __276:
 128631 	if !(x2 != 0) {
 128632 		goto __278
 128633 	}
 128634 	pTab7 = (*HashElem)(unsafe.Pointer(x2)).Fdata
 128635 	if !(pObjTab != 0 && pObjTab != pTab7) {
 128636 		goto __279
 128637 	}
 128638 	goto __277
 128639 __279:
 128640 	;
 128641 	if !((*Table)(unsafe.Pointer(pTab7)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 128642 		goto __280
 128643 	}
 128644 	cnt++
 128645 __280:
 128646 	;
 128647 	nIdx = 0
 128648 	pIdx3 = (*Table)(unsafe.Pointer(pTab7)).FpIndex
 128649 __281:
 128650 	if !(pIdx3 != 0) {
 128651 		goto __283
 128652 	}
 128653 	cnt++
 128654 	goto __282
 128655 __282:
 128656 	pIdx3 = (*Index)(unsafe.Pointer(pIdx3)).FpNext
 128657 	nIdx++
 128658 	goto __281
 128659 	goto __283
 128660 __283:
 128661 	;
 128662 	if !(nIdx > mxIdx) {
 128663 		goto __284
 128664 	}
 128665 	mxIdx = nIdx
 128666 __284:
 128667 	;
 128668 	goto __277
 128669 __277:
 128670 	x2 = (*HashElem)(unsafe.Pointer(x2)).Fnext
 128671 	goto __276
 128672 	goto __278
 128673 __278:
 128674 	;
 128675 	if !(cnt == 0) {
 128676 		goto __285
 128677 	}
 128678 	goto __272
 128679 __285:
 128680 	;
 128681 	if !(pObjTab != 0) {
 128682 		goto __286
 128683 	}
 128684 	cnt++
 128685 __286:
 128686 	;
 128687 	aRoot = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(int32(0)))*uint64(cnt+1))
 128688 	if !(aRoot == uintptr(0)) {
 128689 		goto __287
 128690 	}
 128691 	goto __273
 128692 __287:
 128693 	;
 128694 	cnt = 0
 128695 	if !(pObjTab != 0) {
 128696 		goto __288
 128697 	}
 128698 	*(*int32)(unsafe.Pointer(aRoot + uintptr(libc.PreIncInt32(&cnt, 1))*4)) = 0
 128699 __288:
 128700 	;
 128701 	x2 = (*Hash)(unsafe.Pointer(pTbls)).Ffirst
 128702 __289:
 128703 	if !(x2 != 0) {
 128704 		goto __291
 128705 	}
 128706 	pTab8 = (*HashElem)(unsafe.Pointer(x2)).Fdata
 128707 	if !(pObjTab != 0 && pObjTab != pTab8) {
 128708 		goto __292
 128709 	}
 128710 	goto __290
 128711 __292:
 128712 	;
 128713 	if !((*Table)(unsafe.Pointer(pTab8)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 128714 		goto __293
 128715 	}
 128716 	*(*int32)(unsafe.Pointer(aRoot + uintptr(libc.PreIncInt32(&cnt, 1))*4)) = int32((*Table)(unsafe.Pointer(pTab8)).Ftnum)
 128717 __293:
 128718 	;
 128719 	pIdx4 = (*Table)(unsafe.Pointer(pTab8)).FpIndex
 128720 __294:
 128721 	if !(pIdx4 != 0) {
 128722 		goto __296
 128723 	}
 128724 	*(*int32)(unsafe.Pointer(aRoot + uintptr(libc.PreIncInt32(&cnt, 1))*4)) = int32((*Index)(unsafe.Pointer(pIdx4)).Ftnum)
 128725 	goto __295
 128726 __295:
 128727 	pIdx4 = (*Index)(unsafe.Pointer(pIdx4)).FpNext
 128728 	goto __294
 128729 	goto __296
 128730 __296:
 128731 	;
 128732 	goto __290
 128733 __290:
 128734 	x2 = (*HashElem)(unsafe.Pointer(x2)).Fnext
 128735 	goto __289
 128736 	goto __291
 128737 __291:
 128738 	;
 128739 	*(*int32)(unsafe.Pointer(aRoot)) = cnt
 128740 
 128741 	(*Parse)(unsafe.Pointer(pParse)).FnMem = func() int32 {
 128742 		if (*Parse)(unsafe.Pointer(pParse)).FnMem > 8+mxIdx {
 128743 			return (*Parse)(unsafe.Pointer(pParse)).FnMem
 128744 		}
 128745 		return 8 + mxIdx
 128746 	}()
 128747 	Xsqlite3ClearTempRegCache(tls, pParse)
 128748 
 128749 	Xsqlite3VdbeAddOp4(tls, v, OP_IntegrityCk, 2, cnt, 1, aRoot, -14)
 128750 	Xsqlite3VdbeChangeP5(tls, v, uint16(U8(i9)))
 128751 	addr1 = Xsqlite3VdbeAddOp1(tls, v, OP_IsNull, 2)
 128752 	Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, 3, 0,
 128753 		Xsqlite3MPrintf(tls, db, ts+19095, libc.VaList(bp+368, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i9)*32)).FzDbSName)),
 128754 		-6)
 128755 	Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 2, 3, 3)
 128756 	integrityCheckResultRow(tls, v)
 128757 	Xsqlite3VdbeJumpHere(tls, v, addr1)
 128758 
 128759 	x2 = (*Hash)(unsafe.Pointer(pTbls)).Ffirst
 128760 __297:
 128761 	if !(x2 != 0) {
 128762 		goto __299
 128763 	}
 128764 	pTab9 = (*HashElem)(unsafe.Pointer(x2)).Fdata
 128765 	pPrior = uintptr(0)
 128766 	r1 = -1
 128767 
 128768 	if !!(int32((*Table)(unsafe.Pointer(pTab9)).FeTabType) == TABTYP_NORM) {
 128769 		goto __300
 128770 	}
 128771 	goto __298
 128772 __300:
 128773 	;
 128774 	if !(pObjTab != 0 && pObjTab != pTab9) {
 128775 		goto __301
 128776 	}
 128777 	goto __298
 128778 __301:
 128779 	;
 128780 	if !(isQuick != 0 || (*Table)(unsafe.Pointer(pTab9)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 128781 		goto __302
 128782 	}
 128783 	pPk1 = uintptr(0)
 128784 	r2 = 0
 128785 	goto __303
 128786 __302:
 128787 	pPk1 = Xsqlite3PrimaryKeyIndex(tls, pTab9)
 128788 	r2 = Xsqlite3GetTempRange(tls, pParse, int32((*Index)(unsafe.Pointer(pPk1)).FnKeyCol))
 128789 	Xsqlite3VdbeAddOp3(tls, v, OP_Null, 1, r2, r2+int32((*Index)(unsafe.Pointer(pPk1)).FnKeyCol)-1)
 128790 __303:
 128791 	;
 128792 	Xsqlite3OpenTableAndIndices(tls, pParse, pTab9, OP_OpenRead, uint8(0),
 128793 		1, uintptr(0), bp+620, bp+624)
 128794 
 128795 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, 7)
 128796 	j4 = 0
 128797 	pIdx5 = (*Table)(unsafe.Pointer(pTab9)).FpIndex
 128798 __304:
 128799 	if !(pIdx5 != 0) {
 128800 		goto __306
 128801 	}
 128802 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, 8+j4)
 128803 	goto __305
 128804 __305:
 128805 	pIdx5 = (*Index)(unsafe.Pointer(pIdx5)).FpNext
 128806 	j4++
 128807 	goto __304
 128808 	goto __306
 128809 __306:
 128810 	;
 128811 	Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, *(*int32)(unsafe.Pointer(bp + 620)), 0)
 128812 	loopTop = Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, 7, 1)
 128813 
 128814 	if !((*Table)(unsafe.Pointer(pTab9)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 128815 		goto __307
 128816 	}
 128817 	mxCol = -1
 128818 	j4 = 0
 128819 __309:
 128820 	if !(j4 < int32((*Table)(unsafe.Pointer(pTab9)).FnCol)) {
 128821 		goto __311
 128822 	}
 128823 	if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab9)).FaCol+uintptr(j4)*24)).FcolFlags)&COLFLAG_VIRTUAL == 0) {
 128824 		goto __312
 128825 	}
 128826 	mxCol++
 128827 __312:
 128828 	;
 128829 	goto __310
 128830 __310:
 128831 	j4++
 128832 	goto __309
 128833 	goto __311
 128834 __311:
 128835 	;
 128836 	if !(mxCol == int32((*Table)(unsafe.Pointer(pTab9)).FiPKey)) {
 128837 		goto __313
 128838 	}
 128839 	mxCol--
 128840 __313:
 128841 	;
 128842 	goto __308
 128843 __307:
 128844 	mxCol = int32((*Index)(unsafe.Pointer(Xsqlite3PrimaryKeyIndex(tls, pTab9))).FnColumn) - 1
 128845 __308:
 128846 	;
 128847 	if !(mxCol >= 0) {
 128848 		goto __314
 128849 	}
 128850 	Xsqlite3VdbeAddOp3(tls, v, OP_Column, *(*int32)(unsafe.Pointer(bp + 620)), mxCol, 3)
 128851 	Xsqlite3VdbeTypeofColumn(tls, v, 3)
 128852 __314:
 128853 	;
 128854 	if !!(isQuick != 0) {
 128855 		goto __315
 128856 	}
 128857 	if !(pPk1 != 0) {
 128858 		goto __316
 128859 	}
 128860 	a1 = Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxGT, *(*int32)(unsafe.Pointer(bp + 620)), 0, r2, int32((*Index)(unsafe.Pointer(pPk1)).FnKeyCol))
 128861 
 128862 	Xsqlite3VdbeAddOp1(tls, v, OP_IsNull, r2)
 128863 	zErr = Xsqlite3MPrintf(tls, db,
 128864 		ts+19119,
 128865 		libc.VaList(bp+376, (*Table)(unsafe.Pointer(pTab9)).FzName))
 128866 	Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, 3, 0, zErr, -6)
 128867 	integrityCheckResultRow(tls, v)
 128868 	Xsqlite3VdbeJumpHere(tls, v, a1)
 128869 	Xsqlite3VdbeJumpHere(tls, v, a1+1)
 128870 	j4 = 0
 128871 __317:
 128872 	if !(j4 < int32((*Index)(unsafe.Pointer(pPk1)).FnKeyCol)) {
 128873 		goto __319
 128874 	}
 128875 	Xsqlite3ExprCodeLoadIndexColumn(tls, pParse, pPk1, *(*int32)(unsafe.Pointer(bp + 620)), j4, r2+j4)
 128876 	goto __318
 128877 __318:
 128878 	j4++
 128879 	goto __317
 128880 	goto __319
 128881 __319:
 128882 	;
 128883 __316:
 128884 	;
 128885 __315:
 128886 	;
 128887 	bStrict = libc.Bool32((*Table)(unsafe.Pointer(pTab9)).FtabFlags&U32(TF_Strict) != U32(0))
 128888 	j4 = 0
 128889 __320:
 128890 	if !(j4 < int32((*Table)(unsafe.Pointer(pTab9)).FnCol)) {
 128891 		goto __322
 128892 	}
 128893 	pCol1 = (*Table)(unsafe.Pointer(pTab9)).FaCol + uintptr(j4)*24
 128894 
 128895 	if !(j4 == int32((*Table)(unsafe.Pointer(pTab9)).FiPKey)) {
 128896 		goto __323
 128897 	}
 128898 	goto __321
 128899 __323:
 128900 	;
 128901 	if !(bStrict != 0) {
 128902 		goto __324
 128903 	}
 128904 	doTypeCheck = libc.Bool32(int32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4) > COLTYPE_ANY)
 128905 	goto __325
 128906 __324:
 128907 	doTypeCheck = libc.Bool32(int32((*Column)(unsafe.Pointer(pCol1)).Faffinity) > SQLITE_AFF_BLOB)
 128908 __325:
 128909 	;
 128910 	if !(int32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf>>0) == 0 && !(doTypeCheck != 0)) {
 128911 		goto __326
 128912 	}
 128913 	goto __321
 128914 __326:
 128915 	;
 128916 	p4 = SQLITE_NULL
 128917 	if !(int32((*Column)(unsafe.Pointer(pCol1)).FcolFlags)&COLFLAG_VIRTUAL != 0) {
 128918 		goto __327
 128919 	}
 128920 	Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab9, *(*int32)(unsafe.Pointer(bp + 620)), j4, 3)
 128921 	p11 = -1
 128922 	p3 = 3
 128923 	goto __328
 128924 __327:
 128925 	if !((*Column)(unsafe.Pointer(pCol1)).FiDflt != 0) {
 128926 		goto __329
 128927 	}
 128928 	*(*uintptr)(unsafe.Pointer(bp + 632)) = uintptr(0)
 128929 	Xsqlite3ValueFromExpr(tls, db, Xsqlite3ColumnExpr(tls, pTab9, pCol1), (*Sqlite3)(unsafe.Pointer(db)).Fenc,
 128930 		uint8((*Column)(unsafe.Pointer(pCol1)).Faffinity), bp+632)
 128931 	if !(*(*uintptr)(unsafe.Pointer(bp + 632)) != 0) {
 128932 		goto __330
 128933 	}
 128934 	p4 = Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp + 632)))
 128935 	Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp + 632)))
 128936 __330:
 128937 	;
 128938 __329:
 128939 	;
 128940 	p11 = *(*int32)(unsafe.Pointer(bp + 620))
 128941 	if !!((*Table)(unsafe.Pointer(pTab9)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 128942 		goto __331
 128943 	}
 128944 
 128945 	p3 = int32(Xsqlite3TableColumnToIndex(tls, Xsqlite3PrimaryKeyIndex(tls, pTab9), int16(j4)))
 128946 	goto __332
 128947 __331:
 128948 	p3 = int32(Xsqlite3TableColumnToStorage(tls, pTab9, int16(j4)))
 128949 
 128950 __332:
 128951 	;
 128952 __328:
 128953 	;
 128954 	labelError = Xsqlite3VdbeMakeLabel(tls, pParse)
 128955 	labelOk = Xsqlite3VdbeMakeLabel(tls, pParse)
 128956 	if !(uint32(int32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf>>0)) != 0) {
 128957 		goto __333
 128958 	}
 128959 
 128960 	jmp2 = Xsqlite3VdbeAddOp4Int(tls, v, OP_IsType, p11, labelOk, p3, p4)
 128961 	Xsqlite3VdbeChangeP5(tls, v, uint16(0x0f))
 128962 
 128963 	zErr1 = Xsqlite3MPrintf(tls, db, ts+19155, libc.VaList(bp+384, (*Table)(unsafe.Pointer(pTab9)).FzName,
 128964 		(*Column)(unsafe.Pointer(pCol1)).FzCnName))
 128965 	Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, 3, 0, zErr1, -6)
 128966 	if !(doTypeCheck != 0) {
 128967 		goto __334
 128968 	}
 128969 	Xsqlite3VdbeGoto(tls, v, labelError)
 128970 	Xsqlite3VdbeJumpHere(tls, v, jmp2)
 128971 	goto __335
 128972 __334:
 128973 	;
 128974 __335:
 128975 	;
 128976 __333:
 128977 	;
 128978 	if !(bStrict != 0 && doTypeCheck != 0) {
 128979 		goto __336
 128980 	}
 128981 	Xsqlite3VdbeAddOp4Int(tls, v, OP_IsType, p11, labelOk, p3, p4)
 128982 
 128983 	Xsqlite3VdbeChangeP5(tls, v, uint16(aStdTypeMask[(int32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4)-1)&0xf<<28>>28]))
 128984 
 128985 	zErr1 = Xsqlite3MPrintf(tls, db, ts+19175,
 128986 		libc.VaList(bp+400, Xsqlite3StdType[(int32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4)-1)&0xf<<28>>28],
 128987 			(*Table)(unsafe.Pointer(pTab9)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab9)).FaCol+uintptr(j4)*24)).FzCnName))
 128988 	Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, 3, 0, zErr1, -6)
 128989 	goto __337
 128990 __336:
 128991 	if !(!(bStrict != 0) && int32((*Column)(unsafe.Pointer(pCol1)).Faffinity) == SQLITE_AFF_TEXT) {
 128992 		goto __338
 128993 	}
 128994 
 128995 	Xsqlite3VdbeAddOp4Int(tls, v, OP_IsType, p11, labelOk, p3, p4)
 128996 	Xsqlite3VdbeChangeP5(tls, v, uint16(0x1c))
 128997 
 128998 	zErr1 = Xsqlite3MPrintf(tls, db, ts+19197,
 128999 		libc.VaList(bp+424, (*Table)(unsafe.Pointer(pTab9)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab9)).FaCol+uintptr(j4)*24)).FzCnName))
 129000 	Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, 3, 0, zErr1, -6)
 129001 	goto __339
 129002 __338:
 129003 	if !(!(bStrict != 0) && int32((*Column)(unsafe.Pointer(pCol1)).Faffinity) >= SQLITE_AFF_NUMERIC) {
 129004 		goto __340
 129005 	}
 129006 
 129007 	Xsqlite3VdbeAddOp4Int(tls, v, OP_IsType, p11, labelOk, p3, p4)
 129008 	Xsqlite3VdbeChangeP5(tls, v, uint16(0x1b))
 129009 
 129010 	if !(p11 >= 0) {
 129011 		goto __341
 129012 	}
 129013 	Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab9, *(*int32)(unsafe.Pointer(bp + 620)), j4, 3)
 129014 __341:
 129015 	;
 129016 	Xsqlite3VdbeAddOp4(tls, v, OP_Affinity, 3, 1, 0, ts+19220, -1)
 129017 	Xsqlite3VdbeAddOp4Int(tls, v, OP_IsType, -1, labelOk, 3, p4)
 129018 	Xsqlite3VdbeChangeP5(tls, v, uint16(0x1c))
 129019 
 129020 	zErr1 = Xsqlite3MPrintf(tls, db, ts+19222,
 129021 		libc.VaList(bp+440, (*Table)(unsafe.Pointer(pTab9)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab9)).FaCol+uintptr(j4)*24)).FzCnName))
 129022 	Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, 3, 0, zErr1, -6)
 129023 __340:
 129024 	;
 129025 __339:
 129026 	;
 129027 __337:
 129028 	;
 129029 	Xsqlite3VdbeResolveLabel(tls, v, labelError)
 129030 	integrityCheckResultRow(tls, v)
 129031 	Xsqlite3VdbeResolveLabel(tls, v, labelOk)
 129032 	goto __321
 129033 __321:
 129034 	j4++
 129035 	goto __320
 129036 	goto __322
 129037 __322:
 129038 	;
 129039 	if !((*Table)(unsafe.Pointer(pTab9)).FpCheck != 0 && (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_IgnoreChecks) == uint64(0)) {
 129040 		goto __342
 129041 	}
 129042 	pCheck = Xsqlite3ExprListDup(tls, db, (*Table)(unsafe.Pointer(pTab9)).FpCheck, 0)
 129043 	if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) {
 129044 		goto __343
 129045 	}
 129046 	addrCkFault = Xsqlite3VdbeMakeLabel(tls, pParse)
 129047 	addrCkOk = Xsqlite3VdbeMakeLabel(tls, pParse)
 129048 	(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = *(*int32)(unsafe.Pointer(bp + 620)) + 1
 129049 	k3 = (*ExprList)(unsafe.Pointer(pCheck)).FnExpr - 1
 129050 __344:
 129051 	if !(k3 > 0) {
 129052 		goto __346
 129053 	}
 129054 	Xsqlite3ExprIfFalse(tls, pParse, (*ExprList_item)(unsafe.Pointer(pCheck+8+uintptr(k3)*32)).FpExpr, addrCkFault, 0)
 129055 	goto __345
 129056 __345:
 129057 	k3--
 129058 	goto __344
 129059 	goto __346
 129060 __346:
 129061 	;
 129062 	Xsqlite3ExprIfTrue(tls, pParse, (*ExprList_item)(unsafe.Pointer(pCheck+8)).FpExpr, addrCkOk,
 129063 		SQLITE_JUMPIFNULL)
 129064 	Xsqlite3VdbeResolveLabel(tls, v, addrCkFault)
 129065 	(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = 0
 129066 	zErr2 = Xsqlite3MPrintf(tls, db, ts+19242,
 129067 		libc.VaList(bp+456, (*Table)(unsafe.Pointer(pTab9)).FzName))
 129068 	Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, 3, 0, zErr2, -6)
 129069 	integrityCheckResultRow(tls, v)
 129070 	Xsqlite3VdbeResolveLabel(tls, v, addrCkOk)
 129071 __343:
 129072 	;
 129073 	Xsqlite3ExprListDelete(tls, db, pCheck)
 129074 __342:
 129075 	;
 129076 	if !!(isQuick != 0) {
 129077 		goto __347
 129078 	}
 129079 
 129080 	j4 = 0
 129081 	pIdx5 = (*Table)(unsafe.Pointer(pTab9)).FpIndex
 129082 __348:
 129083 	if !(pIdx5 != 0) {
 129084 		goto __350
 129085 	}
 129086 	ckUniq = Xsqlite3VdbeMakeLabel(tls, pParse)
 129087 	if !(pPk1 == pIdx5) {
 129088 		goto __351
 129089 	}
 129090 	goto __349
 129091 __351:
 129092 	;
 129093 	r1 = Xsqlite3GenerateIndexKey(tls, pParse, pIdx5, *(*int32)(unsafe.Pointer(bp + 620)), 0, 0, bp+640,
 129094 		pPrior, r1)
 129095 	pPrior = pIdx5
 129096 	Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, 8+j4, 1)
 129097 
 129098 	jmp21 = Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, *(*int32)(unsafe.Pointer(bp + 624))+j4, ckUniq, r1,
 129099 		int32((*Index)(unsafe.Pointer(pIdx5)).FnColumn))
 129100 	Xsqlite3VdbeLoadString(tls, v, 3, ts+19272)
 129101 	Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 7, 3, 3)
 129102 	Xsqlite3VdbeLoadString(tls, v, 4, ts+19277)
 129103 	Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 4, 3, 3)
 129104 	jmp5 = Xsqlite3VdbeLoadString(tls, v, 4, (*Index)(unsafe.Pointer(pIdx5)).FzName)
 129105 	Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 4, 3, 3)
 129106 	jmp4 = integrityCheckResultRow(tls, v)
 129107 	Xsqlite3VdbeJumpHere(tls, v, jmp21)
 129108 
 129109 	if !((*Table)(unsafe.Pointer(pTab9)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 129110 		goto __352
 129111 	}
 129112 	Xsqlite3VdbeAddOp2(tls, v, OP_IdxRowid, *(*int32)(unsafe.Pointer(bp + 624))+j4, 3)
 129113 	jmp7 = Xsqlite3VdbeAddOp3(tls, v, OP_Eq, 3, 0, r1+int32((*Index)(unsafe.Pointer(pIdx5)).FnColumn)-1)
 129114 
 129115 	Xsqlite3VdbeLoadString(tls, v, 3,
 129116 		ts+19298)
 129117 	Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 7, 3, 3)
 129118 	Xsqlite3VdbeLoadString(tls, v, 4, ts+19334)
 129119 	Xsqlite3VdbeGoto(tls, v, jmp5-1)
 129120 	Xsqlite3VdbeJumpHere(tls, v, jmp7)
 129121 __352:
 129122 	;
 129123 	label6 = 0
 129124 	kk = 0
 129125 __353:
 129126 	if !(kk < int32((*Index)(unsafe.Pointer(pIdx5)).FnKeyCol)) {
 129127 		goto __355
 129128 	}
 129129 	if !(*(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx5)).FazColl + uintptr(kk)*8)) == uintptr(unsafe.Pointer(&Xsqlite3StrBINARY))) {
 129130 		goto __356
 129131 	}
 129132 	goto __354
 129133 __356:
 129134 	;
 129135 	if !(label6 == 0) {
 129136 		goto __357
 129137 	}
 129138 	label6 = Xsqlite3VdbeMakeLabel(tls, pParse)
 129139 __357:
 129140 	;
 129141 	Xsqlite3VdbeAddOp3(tls, v, OP_Column, *(*int32)(unsafe.Pointer(bp + 624))+j4, kk, 3)
 129142 	Xsqlite3VdbeAddOp3(tls, v, OP_Ne, 3, label6, r1+kk)
 129143 	goto __354
 129144 __354:
 129145 	kk++
 129146 	goto __353
 129147 	goto __355
 129148 __355:
 129149 	;
 129150 	if !(label6 != 0) {
 129151 		goto __358
 129152 	}
 129153 	jmp6 = Xsqlite3VdbeAddOp0(tls, v, OP_Goto)
 129154 	Xsqlite3VdbeResolveLabel(tls, v, label6)
 129155 	Xsqlite3VdbeLoadString(tls, v, 3, ts+19272)
 129156 	Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 7, 3, 3)
 129157 	Xsqlite3VdbeLoadString(tls, v, 4, ts+19345)
 129158 	Xsqlite3VdbeGoto(tls, v, jmp5-1)
 129159 	Xsqlite3VdbeJumpHere(tls, v, jmp6)
 129160 __358:
 129161 	;
 129162 	if !(int32((*Index)(unsafe.Pointer(pIdx5)).FonError) != OE_None) {
 129163 		goto __359
 129164 	}
 129165 	uniqOk = Xsqlite3VdbeMakeLabel(tls, pParse)
 129166 	kk = 0
 129167 __360:
 129168 	if !(kk < int32((*Index)(unsafe.Pointer(pIdx5)).FnKeyCol)) {
 129169 		goto __362
 129170 	}
 129171 	iCol1 = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx5)).FaiColumn + uintptr(kk)*2)))
 129172 
 129173 	if !(iCol1 >= 0 && uint32(int32(*(*uint8)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab9)).FaCol + uintptr(iCol1)*24 + 8))&0xf>>0)) != 0) {
 129174 		goto __363
 129175 	}
 129176 	goto __361
 129177 __363:
 129178 	;
 129179 	Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, r1+kk, uniqOk)
 129180 
 129181 	goto __361
 129182 __361:
 129183 	kk++
 129184 	goto __360
 129185 	goto __362
 129186 __362:
 129187 	;
 129188 	jmp61 = Xsqlite3VdbeAddOp1(tls, v, OP_Next, *(*int32)(unsafe.Pointer(bp + 624))+j4)
 129189 	Xsqlite3VdbeGoto(tls, v, uniqOk)
 129190 	Xsqlite3VdbeJumpHere(tls, v, jmp61)
 129191 	Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxGT, *(*int32)(unsafe.Pointer(bp + 624))+j4, uniqOk, r1,
 129192 		int32((*Index)(unsafe.Pointer(pIdx5)).FnKeyCol))
 129193 	Xsqlite3VdbeLoadString(tls, v, 3, ts+19372)
 129194 	Xsqlite3VdbeGoto(tls, v, jmp5)
 129195 	Xsqlite3VdbeResolveLabel(tls, v, uniqOk)
 129196 __359:
 129197 	;
 129198 	Xsqlite3VdbeJumpHere(tls, v, jmp4)
 129199 	Xsqlite3ResolvePartIdxLabel(tls, pParse, *(*int32)(unsafe.Pointer(bp + 640)))
 129200 	goto __349
 129201 __349:
 129202 	pIdx5 = (*Index)(unsafe.Pointer(pIdx5)).FpNext
 129203 	j4++
 129204 	goto __348
 129205 	goto __350
 129206 __350:
 129207 	;
 129208 __347:
 129209 	;
 129210 	Xsqlite3VdbeAddOp2(tls, v, OP_Next, *(*int32)(unsafe.Pointer(bp + 620)), loopTop)
 129211 	Xsqlite3VdbeJumpHere(tls, v, loopTop-1)
 129212 	if !!(isQuick != 0) {
 129213 		goto __364
 129214 	}
 129215 	Xsqlite3VdbeLoadString(tls, v, 2, ts+19399)
 129216 	j4 = 0
 129217 	pIdx5 = (*Table)(unsafe.Pointer(pTab9)).FpIndex
 129218 __365:
 129219 	if !(pIdx5 != 0) {
 129220 		goto __367
 129221 	}
 129222 	if !(pPk1 == pIdx5) {
 129223 		goto __368
 129224 	}
 129225 	goto __366
 129226 __368:
 129227 	;
 129228 	Xsqlite3VdbeAddOp2(tls, v, OP_Count, *(*int32)(unsafe.Pointer(bp + 624))+j4, 3)
 129229 	addr1 = Xsqlite3VdbeAddOp3(tls, v, OP_Eq, 8+j4, 0, 3)
 129230 	Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL))
 129231 	Xsqlite3VdbeLoadString(tls, v, 4, (*Index)(unsafe.Pointer(pIdx5)).FzName)
 129232 	Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 4, 2, 3)
 129233 	integrityCheckResultRow(tls, v)
 129234 	Xsqlite3VdbeJumpHere(tls, v, addr1)
 129235 	goto __366
 129236 __366:
 129237 	pIdx5 = (*Index)(unsafe.Pointer(pIdx5)).FpNext
 129238 	j4++
 129239 	goto __365
 129240 	goto __367
 129241 __367:
 129242 	;
 129243 	if !(pPk1 != 0) {
 129244 		goto __369
 129245 	}
 129246 	Xsqlite3ReleaseTempRange(tls, pParse, r2, int32((*Index)(unsafe.Pointer(pPk1)).FnKeyCol))
 129247 __369:
 129248 	;
 129249 __364:
 129250 	;
 129251 	goto __298
 129252 __298:
 129253 	x2 = (*HashElem)(unsafe.Pointer(x2)).Fnext
 129254 	goto __297
 129255 	goto __299
 129256 __299:
 129257 	;
 129258 	goto __272
 129259 __272:
 129260 	i9++
 129261 	goto __271
 129262 	goto __273
 129263 __273:
 129264 	;
 129265 	aOp2 = Xsqlite3VdbeAddOpList(tls, v, int32(uint64(unsafe.Sizeof(endCode))/uint64(unsafe.Sizeof(VdbeOpList{}))), uintptr(unsafe.Pointer(&endCode)), iLn5)
 129266 	if !(aOp2 != 0) {
 129267 		goto __370
 129268 	}
 129269 	(*VdbeOp)(unsafe.Pointer(aOp2)).Fp2 = 1 - *(*int32)(unsafe.Pointer(bp + 616))
 129270 	(*VdbeOp)(unsafe.Pointer(aOp2 + 2*24)).Fp4type = int8(-1)
 129271 	*(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = ts + 19428
 129272 	(*VdbeOp)(unsafe.Pointer(aOp2 + 5*24)).Fp4type = int8(-1)
 129273 	*(*uintptr)(unsafe.Pointer(aOp2 + 5*24 + 16)) = Xsqlite3ErrStr(tls, SQLITE_CORRUPT)
 129274 __370:
 129275 	;
 129276 	Xsqlite3VdbeChangeP3(tls, v, 0, Xsqlite3VdbeCurrentAddr(tls, v)-2)
 129277 
 129278 	goto __15
 129279 
 129280 __46:
 129281 	if !!(zRight != 0) {
 129282 		goto __371
 129283 	}
 129284 	if !(Xsqlite3ReadSchema(tls, pParse) != 0) {
 129285 		goto __373
 129286 	}
 129287 	goto pragma_out
 129288 __373:
 129289 	;
 129290 	returnSingleText(tls, v, encnames1[(*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fenc].FzName)
 129291 	goto __372
 129292 __371:
 129293 	if !((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_EncodingFixed) == U32(0)) {
 129294 		goto __374
 129295 	}
 129296 	pEnc = uintptr(unsafe.Pointer(&encnames1))
 129297 __375:
 129298 	if !((*EncName)(unsafe.Pointer(pEnc)).FzName != 0) {
 129299 		goto __377
 129300 	}
 129301 	if !(0 == Xsqlite3StrICmp(tls, zRight, (*EncName)(unsafe.Pointer(pEnc)).FzName)) {
 129302 		goto __378
 129303 	}
 129304 	if (*EncName)(unsafe.Pointer(pEnc)).Fenc != 0 {
 129305 		enc = (*EncName)(unsafe.Pointer(pEnc)).Fenc
 129306 	} else {
 129307 		enc = uint8(SQLITE_UTF16LE)
 129308 	}
 129309 	(*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema)).Fenc = enc
 129310 	Xsqlite3SetTextEncoding(tls, db, enc)
 129311 	goto __377
 129312 __378:
 129313 	;
 129314 	goto __376
 129315 __376:
 129316 	pEnc += 16
 129317 	goto __375
 129318 	goto __377
 129319 __377:
 129320 	;
 129321 	if !!(int32((*EncName)(unsafe.Pointer(pEnc)).FzName) != 0) {
 129322 		goto __379
 129323 	}
 129324 	Xsqlite3ErrorMsg(tls, pParse, ts+19431, libc.VaList(bp+464, zRight))
 129325 __379:
 129326 	;
 129327 __374:
 129328 	;
 129329 __372:
 129330 	;
 129331 	goto __15
 129332 
 129333 __47:
 129334 	iCookie = int32((*PragmaName)(unsafe.Pointer(pPragma)).FiArg)
 129335 	Xsqlite3VdbeUsesBtree(tls, v, iDb)
 129336 	if !(zRight != 0 && int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&PragFlg_ReadOnly == 0) {
 129337 		goto __380
 129338 	}
 129339 
 129340 	aOp3 = Xsqlite3VdbeAddOpList(tls, v, int32(uint64(unsafe.Sizeof(setCookie))/uint64(unsafe.Sizeof(VdbeOpList{}))), uintptr(unsafe.Pointer(&setCookie)), 0)
 129341 	if !(0 != 0) {
 129342 		goto __382
 129343 	}
 129344 	goto __15
 129345 __382:
 129346 	;
 129347 	(*VdbeOp)(unsafe.Pointer(aOp3)).Fp1 = iDb
 129348 	(*VdbeOp)(unsafe.Pointer(aOp3 + 1*24)).Fp1 = iDb
 129349 	(*VdbeOp)(unsafe.Pointer(aOp3 + 1*24)).Fp2 = iCookie
 129350 	(*VdbeOp)(unsafe.Pointer(aOp3 + 1*24)).Fp3 = Xsqlite3Atoi(tls, zRight)
 129351 	(*VdbeOp)(unsafe.Pointer(aOp3 + 1*24)).Fp5 = U16(1)
 129352 	if !(iCookie == BTREE_SCHEMA_VERSION && (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_Defensive) != uint64(0)) {
 129353 		goto __383
 129354 	}
 129355 
 129356 	(*VdbeOp)(unsafe.Pointer(aOp3 + 1*24)).Fopcode = U8(OP_Noop)
 129357 __383:
 129358 	;
 129359 	goto __381
 129360 __380:
 129361 	;
 129362 	aOp4 = Xsqlite3VdbeAddOpList(tls, v, int32(uint64(unsafe.Sizeof(readCookie))/uint64(unsafe.Sizeof(VdbeOpList{}))), uintptr(unsafe.Pointer(&readCookie)), 0)
 129363 	if !(0 != 0) {
 129364 		goto __384
 129365 	}
 129366 	goto __15
 129367 __384:
 129368 	;
 129369 	(*VdbeOp)(unsafe.Pointer(aOp4)).Fp1 = iDb
 129370 	(*VdbeOp)(unsafe.Pointer(aOp4 + 1*24)).Fp1 = iDb
 129371 	(*VdbeOp)(unsafe.Pointer(aOp4 + 1*24)).Fp3 = iCookie
 129372 	Xsqlite3VdbeReusable(tls, v)
 129373 __381:
 129374 	;
 129375 	goto __15
 129376 
 129377 __48:
 129378 	i10 = 0
 129379 	(*Parse)(unsafe.Pointer(pParse)).FnMem = 1
 129380 __385:
 129381 	if !(libc.AssignUintptr(&zOpt, Xsqlite3_compileoption_get(tls, libc.PostIncInt32(&i10, 1))) != uintptr(0)) {
 129382 		goto __386
 129383 	}
 129384 	Xsqlite3VdbeLoadString(tls, v, 1, zOpt)
 129385 	Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, 1, 1)
 129386 	goto __385
 129387 __386:
 129388 	;
 129389 	Xsqlite3VdbeReusable(tls, v)
 129390 
 129391 	goto __15
 129392 
 129393 __49:
 129394 	iBt = func() int32 {
 129395 		if (*Token)(unsafe.Pointer(pId2)).Fz != 0 {
 129396 			return iDb
 129397 		}
 129398 		return SQLITE_MAX_ATTACHED + 2
 129399 	}()
 129400 	eMode2 = SQLITE_CHECKPOINT_PASSIVE
 129401 	if !(zRight != 0) {
 129402 		goto __387
 129403 	}
 129404 	if !(Xsqlite3StrICmp(tls, zRight, ts+18714) == 0) {
 129405 		goto __388
 129406 	}
 129407 	eMode2 = SQLITE_CHECKPOINT_FULL
 129408 	goto __389
 129409 __388:
 129410 	if !(Xsqlite3StrICmp(tls, zRight, ts+19456) == 0) {
 129411 		goto __390
 129412 	}
 129413 	eMode2 = SQLITE_CHECKPOINT_RESTART
 129414 	goto __391
 129415 __390:
 129416 	if !(Xsqlite3StrICmp(tls, zRight, ts+18867) == 0) {
 129417 		goto __392
 129418 	}
 129419 	eMode2 = SQLITE_CHECKPOINT_TRUNCATE
 129420 __392:
 129421 	;
 129422 __391:
 129423 	;
 129424 __389:
 129425 	;
 129426 __387:
 129427 	;
 129428 	(*Parse)(unsafe.Pointer(pParse)).FnMem = 3
 129429 	Xsqlite3VdbeAddOp3(tls, v, OP_Checkpoint, iBt, eMode2, 1)
 129430 	Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, 1, 3)
 129431 
 129432 	goto __15
 129433 
 129434 __50:
 129435 	if !(zRight != 0) {
 129436 		goto __393
 129437 	}
 129438 	Xsqlite3_wal_autocheckpoint(tls, db, Xsqlite3Atoi(tls, zRight))
 129439 __393:
 129440 	;
 129441 	returnSingleInt(tls, v,
 129442 		func() int64 {
 129443 			if (*Sqlite3)(unsafe.Pointer(db)).FxWalCallback == *(*uintptr)(unsafe.Pointer(&struct {
 129444 				f func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32
 129445 			}{Xsqlite3WalDefaultHook})) {
 129446 				return int64(int32((*Sqlite3)(unsafe.Pointer(db)).FpWalArg))
 129447 			}
 129448 			return int64(0)
 129449 		}())
 129450 
 129451 	goto __15
 129452 
 129453 __51:
 129454 	Xsqlite3_db_release_memory(tls, db)
 129455 	goto __15
 129456 
 129457 __52:
 129458 	if !(zRight != 0) {
 129459 		goto __394
 129460 	}
 129461 	opMask = U32(Xsqlite3Atoi(tls, zRight))
 129462 	if !(opMask&U32(0x02) == U32(0)) {
 129463 		goto __396
 129464 	}
 129465 	goto __15
 129466 __396:
 129467 	;
 129468 	goto __395
 129469 __394:
 129470 	opMask = U32(0xfffe)
 129471 __395:
 129472 	;
 129473 	iTabCur = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 129474 	iDbLast = func() int32 {
 129475 		if zDb != 0 {
 129476 			return iDb
 129477 		}
 129478 		return (*Sqlite3)(unsafe.Pointer(db)).FnDb - 1
 129479 	}()
 129480 __397:
 129481 	if !(iDb <= iDbLast) {
 129482 		goto __399
 129483 	}
 129484 	if !(iDb == 1) {
 129485 		goto __400
 129486 	}
 129487 	goto __398
 129488 __400:
 129489 	;
 129490 	Xsqlite3CodeVerifySchema(tls, pParse, iDb)
 129491 	pSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpSchema
 129492 	k4 = (*Hash)(unsafe.Pointer(pSchema + 8)).Ffirst
 129493 __401:
 129494 	if !(k4 != 0) {
 129495 		goto __403
 129496 	}
 129497 	pTab10 = (*HashElem)(unsafe.Pointer(k4)).Fdata
 129498 
 129499 	if !((*Table)(unsafe.Pointer(pTab10)).FtabFlags&U32(TF_StatsUsed) == U32(0)) {
 129500 		goto __404
 129501 	}
 129502 	goto __402
 129503 __404:
 129504 	;
 129505 	szThreshold = LogEst(int32((*Table)(unsafe.Pointer(pTab10)).FnRowLogEst) + 46)
 129506 	pIdx6 = (*Table)(unsafe.Pointer(pTab10)).FpIndex
 129507 __405:
 129508 	if !(pIdx6 != 0) {
 129509 		goto __407
 129510 	}
 129511 	if !!(int32(*(*uint16)(unsafe.Pointer(pIdx6 + 100))&0x80>>7) != 0) {
 129512 		goto __408
 129513 	}
 129514 	szThreshold = int16(0)
 129515 	goto __407
 129516 __408:
 129517 	;
 129518 	goto __406
 129519 __406:
 129520 	pIdx6 = (*Index)(unsafe.Pointer(pIdx6)).FpNext
 129521 	goto __405
 129522 	goto __407
 129523 __407:
 129524 	;
 129525 	if !(szThreshold != 0) {
 129526 		goto __409
 129527 	}
 129528 	Xsqlite3OpenTable(tls, pParse, iTabCur, iDb, pTab10, OP_OpenRead)
 129529 	Xsqlite3VdbeAddOp3(tls, v, OP_IfSmaller, iTabCur,
 129530 		int32(U32(Xsqlite3VdbeCurrentAddr(tls, v)+2)+opMask&U32(1)), int32(szThreshold))
 129531 
 129532 __409:
 129533 	;
 129534 	zSubSql = Xsqlite3MPrintf(tls, db, ts+19464,
 129535 		libc.VaList(bp+472, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, (*Table)(unsafe.Pointer(pTab10)).FzName))
 129536 	if !(opMask&U32(0x01) != 0) {
 129537 		goto __410
 129538 	}
 129539 	r11 = Xsqlite3GetTempReg(tls, pParse)
 129540 	Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, r11, 0, zSubSql, -6)
 129541 	Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, r11, 1)
 129542 	goto __411
 129543 __410:
 129544 	Xsqlite3VdbeAddOp4(tls, v, OP_SqlExec, 0, 0, 0, zSubSql, -6)
 129545 __411:
 129546 	;
 129547 	goto __402
 129548 __402:
 129549 	k4 = (*HashElem)(unsafe.Pointer(k4)).Fnext
 129550 	goto __401
 129551 	goto __403
 129552 __403:
 129553 	;
 129554 	goto __398
 129555 __398:
 129556 	iDb++
 129557 	goto __397
 129558 	goto __399
 129559 __399:
 129560 	;
 129561 	Xsqlite3VdbeAddOp0(tls, v, OP_Expire)
 129562 	goto __15
 129563 
 129564 __53:
 129565 	;
 129566 	if !(zRight != 0) {
 129567 		goto __412
 129568 	}
 129569 	Xsqlite3_busy_timeout(tls, db, Xsqlite3Atoi(tls, zRight))
 129570 __412:
 129571 	;
 129572 	returnSingleInt(tls, v, int64((*Sqlite3)(unsafe.Pointer(db)).FbusyTimeout))
 129573 	goto __15
 129574 
 129575 __54:
 129576 	if !(zRight != 0 && Xsqlite3DecOrHexToI64(tls, zRight, bp+648) == SQLITE_OK) {
 129577 		goto __413
 129578 	}
 129579 	Xsqlite3_soft_heap_limit64(tls, *(*Sqlite3_int64)(unsafe.Pointer(bp + 648)))
 129580 __413:
 129581 	;
 129582 	returnSingleInt(tls, v, Xsqlite3_soft_heap_limit64(tls, int64(-1)))
 129583 	goto __15
 129584 
 129585 __55:
 129586 	if !(zRight != 0 && Xsqlite3DecOrHexToI64(tls, zRight, bp+656) == SQLITE_OK) {
 129587 		goto __414
 129588 	}
 129589 	iPrior = Xsqlite3_hard_heap_limit64(tls, int64(-1))
 129590 	if !(*(*Sqlite3_int64)(unsafe.Pointer(bp + 656)) > int64(0) && (iPrior == int64(0) || iPrior > *(*Sqlite3_int64)(unsafe.Pointer(bp + 656)))) {
 129591 		goto __415
 129592 	}
 129593 	Xsqlite3_hard_heap_limit64(tls, *(*Sqlite3_int64)(unsafe.Pointer(bp + 656)))
 129594 __415:
 129595 	;
 129596 __414:
 129597 	;
 129598 	returnSingleInt(tls, v, Xsqlite3_hard_heap_limit64(tls, int64(-1)))
 129599 	goto __15
 129600 
 129601 __56:
 129602 	if !(zRight != 0 &&
 129603 		Xsqlite3DecOrHexToI64(tls, zRight, bp+664) == SQLITE_OK &&
 129604 		*(*Sqlite3_int64)(unsafe.Pointer(bp + 664)) >= int64(0)) {
 129605 		goto __416
 129606 	}
 129607 	Xsqlite3_limit(tls, db, SQLITE_LIMIT_WORKER_THREADS, int32(*(*Sqlite3_int64)(unsafe.Pointer(bp + 664))&int64(0x7fffffff)))
 129608 __416:
 129609 	;
 129610 	returnSingleInt(tls, v, int64(Xsqlite3_limit(tls, db, SQLITE_LIMIT_WORKER_THREADS, -1)))
 129611 	goto __15
 129612 
 129613 __57:
 129614 	if !(zRight != 0 &&
 129615 		Xsqlite3DecOrHexToI64(tls, zRight, bp+672) == SQLITE_OK &&
 129616 		*(*Sqlite3_int64)(unsafe.Pointer(bp + 672)) >= int64(0)) {
 129617 		goto __417
 129618 	}
 129619 	(*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit = int32(*(*Sqlite3_int64)(unsafe.Pointer(bp + 672)) & int64(0x7fffffff))
 129620 __417:
 129621 	;
 129622 	returnSingleInt(tls, v, int64((*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit))
 129623 	goto __15
 129624 
 129625 __15:
 129626 	;
 129627 	if !(int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&PragFlg_NoColumns1 != 0 && zRight != 0) {
 129628 		goto __418
 129629 	}
 129630 
 129631 __418:
 129632 	;
 129633 pragma_out:
 129634 	Xsqlite3DbFree(tls, db, zLeft)
 129635 	Xsqlite3DbFree(tls, db, zRight)
 129636 }
 129637 
 129638 type EncName = struct {
 129639 	FzName       uintptr
 129640 	Fenc         U8
 129641 	F__ccgo_pad1 [7]byte
 129642 }
 129643 
 129644 var iLn3 int32 = 0
 129645 var getCacheSize = [9]VdbeOpList{
 129646 	{Fopcode: U8(OP_Transaction)},
 129647 	{Fopcode: U8(OP_ReadCookie), Fp2: int8(1), Fp3: int8(BTREE_DEFAULT_CACHE_SIZE)},
 129648 	{Fopcode: U8(OP_IfPos), Fp1: int8(1), Fp2: int8(8)},
 129649 	{Fopcode: U8(OP_Integer), Fp2: int8(2)},
 129650 	{Fopcode: U8(OP_Subtract), Fp1: int8(1), Fp2: int8(2), Fp3: int8(1)},
 129651 	{Fopcode: U8(OP_IfPos), Fp1: int8(1), Fp2: int8(8)},
 129652 	{Fopcode: U8(OP_Integer), Fp2: int8(1)},
 129653 	{Fopcode: U8(OP_Noop)},
 129654 	{Fopcode: U8(OP_ResultRow), Fp1: int8(1), Fp2: int8(1)},
 129655 }
 129656 var iLn4 int32 = 0
 129657 var setMeta6 = [5]VdbeOpList{
 129658 	{Fopcode: U8(OP_Transaction), Fp2: int8(1)},
 129659 	{Fopcode: U8(OP_ReadCookie), Fp2: int8(1), Fp3: int8(BTREE_LARGEST_ROOT_PAGE)},
 129660 	{Fopcode: U8(OP_If), Fp1: int8(1)},
 129661 	{Fopcode: U8(OP_Halt), Fp2: int8(OE_Abort)},
 129662 	{Fopcode: U8(OP_SetCookie), Fp2: int8(BTREE_INCR_VACUUM)},
 129663 }
 129664 var aStdTypeMask = [6]uint8{
 129665 	uint8(0x1f),
 129666 	uint8(0x18),
 129667 	uint8(0x11),
 129668 	uint8(0x11),
 129669 	uint8(0x13),
 129670 	uint8(0x14),
 129671 }
 129672 var iLn5 int32 = 0
 129673 var endCode = [7]VdbeOpList{
 129674 	{Fopcode: U8(OP_AddImm), Fp1: int8(1)},
 129675 	{Fopcode: U8(OP_IfNotZero), Fp1: int8(1), Fp2: int8(4)},
 129676 	{Fopcode: U8(OP_String8), Fp2: int8(3)},
 129677 	{Fopcode: U8(OP_ResultRow), Fp1: int8(3), Fp2: int8(1)},
 129678 	{Fopcode: U8(OP_Halt)},
 129679 	{Fopcode: U8(OP_String8), Fp2: int8(3)},
 129680 	{Fopcode: U8(OP_Goto), Fp2: int8(3)},
 129681 }
 129682 var encnames1 = [9]EncName{
 129683 	{FzName: ts + 19482, Fenc: U8(SQLITE_UTF8)},
 129684 	{FzName: ts + 19487, Fenc: U8(SQLITE_UTF8)},
 129685 	{FzName: ts + 19493, Fenc: U8(SQLITE_UTF16LE)},
 129686 	{FzName: ts + 19502, Fenc: U8(SQLITE_UTF16BE)},
 129687 	{FzName: ts + 19511, Fenc: U8(SQLITE_UTF16LE)},
 129688 	{FzName: ts + 19519, Fenc: U8(SQLITE_UTF16BE)},
 129689 	{FzName: ts + 19527},
 129690 	{FzName: ts + 19534},
 129691 	{},
 129692 }
 129693 var setCookie = [2]VdbeOpList{
 129694 	{Fopcode: U8(OP_Transaction), Fp2: int8(1)},
 129695 	{Fopcode: U8(OP_SetCookie)},
 129696 }
 129697 var readCookie = [3]VdbeOpList{
 129698 	{Fopcode: U8(OP_Transaction)},
 129699 	{Fopcode: U8(OP_ReadCookie), Fp2: int8(1)},
 129700 	{Fopcode: U8(OP_ResultRow), Fp1: int8(1), Fp2: int8(1)},
 129701 }
 129702 
 129703 // ****************************************************************************
 129704 //
 129705 // Implementation of an eponymous virtual table that runs a pragma.
 129706 type PragmaVtab1 = struct {
 129707 	Fbase        Sqlite3_vtab
 129708 	Fdb          uintptr
 129709 	FpName       uintptr
 129710 	FnHidden     U8
 129711 	FiHidden     U8
 129712 	F__ccgo_pad1 [6]byte
 129713 }
 129714 
 129715 // ****************************************************************************
 129716 //
 129717 // Implementation of an eponymous virtual table that runs a pragma.
 129718 type PragmaVtab = PragmaVtab1
 129719 type PragmaVtabCursor1 = struct {
 129720 	Fbase    Sqlite3_vtab_cursor
 129721 	FpPragma uintptr
 129722 	FiRowid  Sqlite_int64
 129723 	FazArg   [2]uintptr
 129724 }
 129725 
 129726 type PragmaVtabCursor = PragmaVtabCursor1
 129727 
 129728 func pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 {
 129729 	bp := tls.Alloc(264)
 129730 	defer tls.Free(264)
 129731 
 129732 	var pPragma uintptr = pAux
 129733 	var pTab uintptr = uintptr(0)
 129734 	var rc int32
 129735 	var i int32
 129736 	var j int32
 129737 	var cSep int8 = int8('(')
 129738 
 129739 	_ = argc
 129740 	_ = argv
 129741 	Xsqlite3StrAccumInit(tls, bp+32, uintptr(0), bp+64, int32(unsafe.Sizeof([200]int8{})), 0)
 129742 	Xsqlite3_str_appendall(tls, bp+32, ts+19540)
 129743 	i = 0
 129744 	j = int32((*PragmaName)(unsafe.Pointer(pPragma)).FiPragCName)
 129745 __1:
 129746 	if !(i < int32((*PragmaName)(unsafe.Pointer(pPragma)).FnPragCName)) {
 129747 		goto __3
 129748 	}
 129749 	{
 129750 		Xsqlite3_str_appendf(tls, bp+32, ts+19555, libc.VaList(bp, int32(cSep), pragCName[j]))
 129751 		cSep = int8(',')
 129752 
 129753 	}
 129754 	goto __2
 129755 __2:
 129756 	i++
 129757 	j++
 129758 	goto __1
 129759 	goto __3
 129760 __3:
 129761 	;
 129762 	if i == 0 {
 129763 		Xsqlite3_str_appendf(tls, bp+32, ts+19562, libc.VaList(bp+16, (*PragmaName)(unsafe.Pointer(pPragma)).FzName))
 129764 		i++
 129765 	}
 129766 	j = 0
 129767 	if int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&PragFlg_Result1 != 0 {
 129768 		Xsqlite3_str_appendall(tls, bp+32, ts+19568)
 129769 		j++
 129770 	}
 129771 	if int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&(PragFlg_SchemaOpt|PragFlg_SchemaReq) != 0 {
 129772 		Xsqlite3_str_appendall(tls, bp+32, ts+19580)
 129773 		j++
 129774 	}
 129775 	Xsqlite3_str_append(tls, bp+32, ts+6309, 1)
 129776 	Xsqlite3StrAccumFinish(tls, bp+32)
 129777 
 129778 	rc = Xsqlite3_declare_vtab(tls, db, bp+64)
 129779 	if rc == SQLITE_OK {
 129780 		pTab = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(PragmaVtab{})))
 129781 		if pTab == uintptr(0) {
 129782 			rc = SQLITE_NOMEM
 129783 		} else {
 129784 			libc.Xmemset(tls, pTab, 0, uint64(unsafe.Sizeof(PragmaVtab{})))
 129785 			(*PragmaVtab)(unsafe.Pointer(pTab)).FpName = pPragma
 129786 			(*PragmaVtab)(unsafe.Pointer(pTab)).Fdb = db
 129787 			(*PragmaVtab)(unsafe.Pointer(pTab)).FiHidden = U8(i)
 129788 			(*PragmaVtab)(unsafe.Pointer(pTab)).FnHidden = U8(j)
 129789 		}
 129790 	} else {
 129791 		*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp+24, Xsqlite3_errmsg(tls, db)))
 129792 	}
 129793 
 129794 	*(*uintptr)(unsafe.Pointer(ppVtab)) = pTab
 129795 	return rc
 129796 }
 129797 
 129798 func pragmaVtabDisconnect(tls *libc.TLS, pVtab uintptr) int32 {
 129799 	var pTab uintptr = pVtab
 129800 	Xsqlite3_free(tls, pTab)
 129801 	return SQLITE_OK
 129802 }
 129803 
 129804 func pragmaVtabBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 {
 129805 	bp := tls.Alloc(8)
 129806 	defer tls.Free(8)
 129807 
 129808 	var pTab uintptr = tab
 129809 	var pConstraint uintptr
 129810 	var i int32
 129811 	var j int32
 129812 
 129813 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(1)
 129814 	if int32((*PragmaVtab)(unsafe.Pointer(pTab)).FnHidden) == 0 {
 129815 		return SQLITE_OK
 129816 	}
 129817 	pConstraint = (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint
 129818 	*(*int32)(unsafe.Pointer(bp)) = 0
 129819 	*(*int32)(unsafe.Pointer(bp + 1*4)) = 0
 129820 	i = 0
 129821 __1:
 129822 	if !(i < (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint) {
 129823 		goto __3
 129824 	}
 129825 	{
 129826 		if int32((*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fusable) == 0 {
 129827 			goto __2
 129828 		}
 129829 		if int32((*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fop) != SQLITE_INDEX_CONSTRAINT_EQ {
 129830 			goto __2
 129831 		}
 129832 		if (*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).FiColumn < int32((*PragmaVtab)(unsafe.Pointer(pTab)).FiHidden) {
 129833 			goto __2
 129834 		}
 129835 		j = (*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).FiColumn - int32((*PragmaVtab)(unsafe.Pointer(pTab)).FiHidden)
 129836 
 129837 		*(*int32)(unsafe.Pointer(bp + uintptr(j)*4)) = i + 1
 129838 
 129839 	}
 129840 	goto __2
 129841 __2:
 129842 	i++
 129843 	pConstraint += 12
 129844 	goto __1
 129845 	goto __3
 129846 __3:
 129847 	;
 129848 	if *(*int32)(unsafe.Pointer(bp)) == 0 {
 129849 		(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(2147483647)
 129850 		(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(2147483647)
 129851 		return SQLITE_OK
 129852 	}
 129853 	j = *(*int32)(unsafe.Pointer(bp)) - 1
 129854 	(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(j)*8)).FargvIndex = 1
 129855 	(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(j)*8)).Fomit = uint8(1)
 129856 	if *(*int32)(unsafe.Pointer(bp + 1*4)) == 0 {
 129857 		return SQLITE_OK
 129858 	}
 129859 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(20)
 129860 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(20)
 129861 	j = *(*int32)(unsafe.Pointer(bp + 1*4)) - 1
 129862 	(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(j)*8)).FargvIndex = 2
 129863 	(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(j)*8)).Fomit = uint8(1)
 129864 	return SQLITE_OK
 129865 }
 129866 
 129867 func pragmaVtabOpen(tls *libc.TLS, pVtab uintptr, ppCursor uintptr) int32 {
 129868 	var pCsr uintptr
 129869 	pCsr = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(PragmaVtabCursor{})))
 129870 	if pCsr == uintptr(0) {
 129871 		return SQLITE_NOMEM
 129872 	}
 129873 	libc.Xmemset(tls, pCsr, 0, uint64(unsafe.Sizeof(PragmaVtabCursor{})))
 129874 	(*PragmaVtabCursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab = pVtab
 129875 	*(*uintptr)(unsafe.Pointer(ppCursor)) = pCsr
 129876 	return SQLITE_OK
 129877 }
 129878 
 129879 func pragmaVtabCursorClear(tls *libc.TLS, pCsr uintptr) {
 129880 	var i int32
 129881 	Xsqlite3_finalize(tls, (*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma)
 129882 	(*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma = uintptr(0)
 129883 	for i = 0; i < int32(uint64(unsafe.Sizeof([2]uintptr{}))/uint64(unsafe.Sizeof(uintptr(0)))); i++ {
 129884 		Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(i)*8)))
 129885 		*(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(i)*8)) = uintptr(0)
 129886 	}
 129887 }
 129888 
 129889 func pragmaVtabClose(tls *libc.TLS, cur uintptr) int32 {
 129890 	var pCsr uintptr = cur
 129891 	pragmaVtabCursorClear(tls, pCsr)
 129892 	Xsqlite3_free(tls, pCsr)
 129893 	return SQLITE_OK
 129894 }
 129895 
 129896 func pragmaVtabNext(tls *libc.TLS, pVtabCursor uintptr) int32 {
 129897 	var pCsr uintptr = pVtabCursor
 129898 	var rc int32 = SQLITE_OK
 129899 
 129900 	(*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FiRowid++
 129901 
 129902 	if SQLITE_ROW != Xsqlite3_step(tls, (*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma) {
 129903 		rc = Xsqlite3_finalize(tls, (*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma)
 129904 		(*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma = uintptr(0)
 129905 		pragmaVtabCursorClear(tls, pCsr)
 129906 	}
 129907 	return rc
 129908 }
 129909 
 129910 func pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 {
 129911 	bp := tls.Alloc(64)
 129912 	defer tls.Free(64)
 129913 
 129914 	var pCsr uintptr = pVtabCursor
 129915 	var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pVtabCursor)).FpVtab
 129916 	var rc int32
 129917 	var i int32
 129918 	var j int32
 129919 
 129920 	var zSql uintptr
 129921 
 129922 	_ = idxNum
 129923 	_ = idxStr
 129924 	pragmaVtabCursorClear(tls, pCsr)
 129925 	if int32((*PragmaName)(unsafe.Pointer((*PragmaVtab)(unsafe.Pointer(pTab)).FpName)).FmPragFlg)&PragFlg_Result1 != 0 {
 129926 		j = 0
 129927 	} else {
 129928 		j = 1
 129929 	}
 129930 	i = 0
 129931 __1:
 129932 	if !(i < argc) {
 129933 		goto __3
 129934 	}
 129935 	{
 129936 		var zText uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
 129937 
 129938 		if zText != 0 {
 129939 			*(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp, zText))
 129940 			if *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) == uintptr(0) {
 129941 				return SQLITE_NOMEM
 129942 			}
 129943 		}
 129944 
 129945 	}
 129946 	goto __2
 129947 __2:
 129948 	i++
 129949 	j++
 129950 	goto __1
 129951 	goto __3
 129952 __3:
 129953 	;
 129954 	Xsqlite3StrAccumInit(tls, bp+32, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer((*PragmaVtab)(unsafe.Pointer(pTab)).Fdb + 136 + 1*4)))
 129955 	Xsqlite3_str_appendall(tls, bp+32, ts+19595)
 129956 	if *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)) != 0 {
 129957 		Xsqlite3_str_appendf(tls, bp+32, ts+19603, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8))))
 129958 	}
 129959 	Xsqlite3_str_appendall(tls, bp+32, (*PragmaName)(unsafe.Pointer((*PragmaVtab)(unsafe.Pointer(pTab)).FpName)).FzName)
 129960 	if *(*uintptr)(unsafe.Pointer(pCsr + 24)) != 0 {
 129961 		Xsqlite3_str_appendf(tls, bp+32, ts+19607, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pCsr + 24))))
 129962 	}
 129963 	zSql = Xsqlite3StrAccumFinish(tls, bp+32)
 129964 	if zSql == uintptr(0) {
 129965 		return SQLITE_NOMEM
 129966 	}
 129967 	rc = Xsqlite3_prepare_v2(tls, (*PragmaVtab)(unsafe.Pointer(pTab)).Fdb, zSql, -1, pCsr+8, uintptr(0))
 129968 	Xsqlite3_free(tls, zSql)
 129969 	if rc != SQLITE_OK {
 129970 		(*PragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp+24, Xsqlite3_errmsg(tls, (*PragmaVtab)(unsafe.Pointer(pTab)).Fdb)))
 129971 		return rc
 129972 	}
 129973 	return pragmaVtabNext(tls, pVtabCursor)
 129974 }
 129975 
 129976 func pragmaVtabEof(tls *libc.TLS, pVtabCursor uintptr) int32 {
 129977 	var pCsr uintptr = pVtabCursor
 129978 	return libc.Bool32((*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma == uintptr(0))
 129979 }
 129980 
 129981 func pragmaVtabColumn(tls *libc.TLS, pVtabCursor uintptr, ctx uintptr, i int32) int32 {
 129982 	var pCsr uintptr = pVtabCursor
 129983 	var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pVtabCursor)).FpVtab
 129984 	if i < int32((*PragmaVtab)(unsafe.Pointer(pTab)).FiHidden) {
 129985 		Xsqlite3_result_value(tls, ctx, Xsqlite3_column_value(tls, (*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma, i))
 129986 	} else {
 129987 		Xsqlite3_result_text(tls, ctx, *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(i-int32((*PragmaVtab)(unsafe.Pointer(pTab)).FiHidden))*8)), -1, libc.UintptrFromInt32(-1))
 129988 	}
 129989 	return SQLITE_OK
 129990 }
 129991 
 129992 func pragmaVtabRowid(tls *libc.TLS, pVtabCursor uintptr, p uintptr) int32 {
 129993 	var pCsr uintptr = pVtabCursor
 129994 	*(*Sqlite_int64)(unsafe.Pointer(p)) = (*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FiRowid
 129995 	return SQLITE_OK
 129996 }
 129997 
 129998 var pragmaVtabModule = Sqlite3_module{
 129999 	FxConnect:    0,
 130000 	FxBestIndex:  0,
 130001 	FxDisconnect: 0,
 130002 	FxOpen:       0,
 130003 	FxClose:      0,
 130004 	FxFilter:     0,
 130005 	FxNext:       0,
 130006 	FxEof:        0,
 130007 	FxColumn:     0,
 130008 	FxRowid:      0,
 130009 }
 130010 
 130011 // Check to see if zTabName is really the name of a pragma.  If it is,
 130012 // then register an eponymous virtual table for that pragma and return
 130013 // a pointer to the Module object for the new virtual table.
 130014 func Xsqlite3PragmaVtabRegister(tls *libc.TLS, db uintptr, zName uintptr) uintptr {
 130015 	var pName uintptr
 130016 
 130017 	pName = pragmaLocate(tls, zName+uintptr(7))
 130018 	if pName == uintptr(0) {
 130019 		return uintptr(0)
 130020 	}
 130021 	if int32((*PragmaName)(unsafe.Pointer(pName)).FmPragFlg)&(PragFlg_Result0|PragFlg_Result1) == 0 {
 130022 		return uintptr(0)
 130023 	}
 130024 
 130025 	return Xsqlite3VtabCreateModule(tls, db, zName, uintptr(unsafe.Pointer(&pragmaVtabModule)), pName, uintptr(0))
 130026 }
 130027 
 130028 func corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) {
 130029 	bp := tls.Alloc(56)
 130030 	defer tls.Free(56)
 130031 
 130032 	var db uintptr = (*InitData)(unsafe.Pointer(pData)).Fdb
 130033 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 130034 		(*InitData)(unsafe.Pointer(pData)).Frc = SQLITE_NOMEM
 130035 	} else if *(*uintptr)(unsafe.Pointer((*InitData)(unsafe.Pointer(pData)).FpzErrMsg)) != uintptr(0) {
 130036 	} else if (*InitData)(unsafe.Pointer(pData)).FmInitFlags&U32(INITFLAG_AlterMask) != 0 {
 130037 		*(*uintptr)(unsafe.Pointer((*InitData)(unsafe.Pointer(pData)).FpzErrMsg)) = Xsqlite3MPrintf(tls, db,
 130038 			ts+19611, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)),
 130039 				azAlterType[(*InitData)(unsafe.Pointer(pData)).FmInitFlags&U32(INITFLAG_AlterMask)-U32(1)],
 130040 				zExtra))
 130041 		(*InitData)(unsafe.Pointer(pData)).Frc = SQLITE_ERROR
 130042 	} else if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_WriteSchema) != 0 {
 130043 		(*InitData)(unsafe.Pointer(pData)).Frc = Xsqlite3CorruptError(tls, 137249)
 130044 	} else {
 130045 		var z uintptr
 130046 		var zObj uintptr
 130047 		if *(*uintptr)(unsafe.Pointer(azObj + 1*8)) != 0 {
 130048 			zObj = *(*uintptr)(unsafe.Pointer(azObj + 1*8))
 130049 		} else {
 130050 			zObj = ts + 6360
 130051 		}
 130052 		z = Xsqlite3MPrintf(tls, db, ts+19639, libc.VaList(bp+32, zObj))
 130053 		if zExtra != 0 && *(*int8)(unsafe.Pointer(zExtra)) != 0 {
 130054 			z = Xsqlite3MPrintf(tls, db, ts+19670, libc.VaList(bp+40, z, zExtra))
 130055 		}
 130056 		*(*uintptr)(unsafe.Pointer((*InitData)(unsafe.Pointer(pData)).FpzErrMsg)) = z
 130057 		(*InitData)(unsafe.Pointer(pData)).Frc = Xsqlite3CorruptError(tls, 137256)
 130058 	}
 130059 }
 130060 
 130061 var azAlterType = [3]uintptr{
 130062 	ts + 19678,
 130063 	ts + 19685,
 130064 	ts + 19697,
 130065 }
 130066 
 130067 // Check to see if any sibling index (another index on the same table)
 130068 // of pIndex has the same root page number, and if it does, return true.
 130069 // This would indicate a corrupt schema.
 130070 func Xsqlite3IndexHasDuplicateRootPage(tls *libc.TLS, pIndex uintptr) int32 {
 130071 	var p uintptr
 130072 	for p = (*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FpTable)).FpIndex; p != 0; p = (*Index)(unsafe.Pointer(p)).FpNext {
 130073 		if (*Index)(unsafe.Pointer(p)).Ftnum == (*Index)(unsafe.Pointer(pIndex)).Ftnum && p != pIndex {
 130074 			return 1
 130075 		}
 130076 	}
 130077 	return 0
 130078 }
 130079 
 130080 // This is the callback routine for the code that initializes the
 130081 // database.  See sqlite3Init() below for additional information.
 130082 // This routine is also called from the OP_ParseSchema opcode of the VDBE.
 130083 //
 130084 // Each callback contains the following information:
 130085 //
 130086 //	argv[0] = type of object: "table", "index", "trigger", or "view".
 130087 //	argv[1] = name of thing being created
 130088 //	argv[2] = associated table if an index or trigger
 130089 //	argv[3] = root page number for table or index. 0 for trigger or view.
 130090 //	argv[4] = SQL text for the CREATE statement.
 130091 func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr, NotUsed uintptr) int32 {
 130092 	bp := tls.Alloc(8)
 130093 	defer tls.Free(8)
 130094 
 130095 	var pData uintptr = pInit
 130096 	var db uintptr = (*InitData)(unsafe.Pointer(pData)).Fdb
 130097 	var iDb int32 = (*InitData)(unsafe.Pointer(pData)).FiDb
 130098 
 130099 	_ = NotUsed
 130100 	_ = argc
 130101 
 130102 	*(*U32)(unsafe.Pointer(db + 44)) |= U32(DBFLAG_EncodingFixed)
 130103 	if argv == uintptr(0) {
 130104 		return 0
 130105 	}
 130106 	(*InitData)(unsafe.Pointer(pData)).FnInitRow++
 130107 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 130108 		corruptSchema(tls, pData, argv, uintptr(0))
 130109 		return 1
 130110 	}
 130111 
 130112 	if *(*uintptr)(unsafe.Pointer(argv + 3*8)) == uintptr(0) {
 130113 		corruptSchema(tls, pData, argv, uintptr(0))
 130114 	} else if *(*uintptr)(unsafe.Pointer(argv + 4*8)) != 0 &&
 130115 		'c' == int32(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 4*8)))))]) &&
 130116 		'r' == int32(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 4*8)) + 1)))]) {
 130117 		var rc int32
 130118 		var saved_iDb U8 = (*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb
 130119 
 130120 		(*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(iDb)
 130121 		if Xsqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), db+192) == 0 ||
 130122 			(*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum > (*InitData)(unsafe.Pointer(pData)).FmxPage && (*InitData)(unsafe.Pointer(pData)).FmxPage > Pgno(0) {
 130123 			if Xsqlite3Config.FbExtraSchemaChecks != 0 {
 130124 				corruptSchema(tls, pData, argv, ts+15497)
 130125 			}
 130126 		}
 130127 		libc.SetBitFieldPtr8Uint32(db+192+8, uint32(0), 0, 0x1)
 130128 		(*Sqlite3)(unsafe.Pointer(db)).Finit.FazInit = argv
 130129 		*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 130130 		sqlite3Prepare(tls, db, *(*uintptr)(unsafe.Pointer(argv + 4*8)), -1, uint32(0), uintptr(0), bp, uintptr(0))
 130131 		rc = (*Sqlite3)(unsafe.Pointer(db)).FerrCode
 130132 
 130133 		(*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = saved_iDb
 130134 
 130135 		if SQLITE_OK != rc {
 130136 			if uint32(int32(*(*uint8)(unsafe.Pointer(db + 192 + 8))&0x1>>0)) != 0 {
 130137 			} else {
 130138 				if rc > (*InitData)(unsafe.Pointer(pData)).Frc {
 130139 					(*InitData)(unsafe.Pointer(pData)).Frc = rc
 130140 				}
 130141 				if rc == SQLITE_NOMEM {
 130142 					Xsqlite3OomFault(tls, db)
 130143 				} else if rc != SQLITE_INTERRUPT && rc&0xFF != SQLITE_LOCKED {
 130144 					corruptSchema(tls, pData, argv, Xsqlite3_errmsg(tls, db))
 130145 				}
 130146 			}
 130147 		}
 130148 		(*Sqlite3)(unsafe.Pointer(db)).Finit.FazInit = uintptr(unsafe.Pointer(&Xsqlite3StdType))
 130149 		Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp)))
 130150 	} else if *(*uintptr)(unsafe.Pointer(argv + 1*8)) == uintptr(0) || *(*uintptr)(unsafe.Pointer(argv + 4*8)) != uintptr(0) && int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 4*8))))) != 0 {
 130151 		corruptSchema(tls, pData, argv, uintptr(0))
 130152 	} else {
 130153 		var pIndex uintptr
 130154 		pIndex = Xsqlite3FindIndex(tls, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName)
 130155 		if pIndex == uintptr(0) {
 130156 			corruptSchema(tls, pData, argv, ts+19708)
 130157 		} else if Xsqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), pIndex+88) == 0 ||
 130158 			(*Index)(unsafe.Pointer(pIndex)).Ftnum < Pgno(2) ||
 130159 			(*Index)(unsafe.Pointer(pIndex)).Ftnum > (*InitData)(unsafe.Pointer(pData)).FmxPage ||
 130160 			Xsqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 {
 130161 			if Xsqlite3Config.FbExtraSchemaChecks != 0 {
 130162 				corruptSchema(tls, pData, argv, ts+15497)
 130163 			}
 130164 		}
 130165 	}
 130166 	return 0
 130167 }
 130168 
 130169 // Attempt to read the database schema and initialize internal
 130170 // data structures for a single database file.  The index of the
 130171 // database file is given by iDb.  iDb==0 is used for the main
 130172 // database.  iDb==1 should never be used.  iDb>=2 is used for
 130173 // auxiliary databases.  Return one of the SQLITE_ error codes to
 130174 // indicate success or failure.
 130175 func Xsqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFlags U32) int32 {
 130176 	bp := tls.Alloc(124)
 130177 	defer tls.Free(124)
 130178 
 130179 	var rc int32
 130180 	var i int32
 130181 	var size int32
 130182 	var pDb uintptr
 130183 
 130184 	var zSchemaTabName uintptr
 130185 	var openedTransaction int32
 130186 	var mask int32
 130187 	var encoding U8
 130188 	var xAuth Sqlite3_xauth
 130189 	var zSql uintptr
 130190 	openedTransaction = 0
 130191 	mask = int32((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_EncodingFixed) | libc.Uint32FromInt32(libc.CplInt32(DBFLAG_EncodingFixed)))
 130192 
 130193 	(*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(1)
 130194 
 130195 	*(*uintptr)(unsafe.Pointer(bp + 16)) = ts + 10228
 130196 	*(*uintptr)(unsafe.Pointer(bp + 16 + 1*8)) = libc.AssignUintptr(&zSchemaTabName, func() uintptr {
 130197 		if !(0 != 0) && iDb == 1 {
 130198 			return ts + 7741
 130199 		}
 130200 		return ts + 7235
 130201 	}())
 130202 	*(*uintptr)(unsafe.Pointer(bp + 16 + 2*8)) = *(*uintptr)(unsafe.Pointer(bp + 16 + 1*8))
 130203 	*(*uintptr)(unsafe.Pointer(bp + 16 + 3*8)) = ts + 9290
 130204 	*(*uintptr)(unsafe.Pointer(bp + 16 + 4*8)) = ts + 19721
 130205 	*(*uintptr)(unsafe.Pointer(bp + 16 + 5*8)) = uintptr(0)
 130206 	(*InitData)(unsafe.Pointer(bp + 64)).Fdb = db
 130207 	(*InitData)(unsafe.Pointer(bp + 64)).FiDb = iDb
 130208 	(*InitData)(unsafe.Pointer(bp + 64)).Frc = SQLITE_OK
 130209 	(*InitData)(unsafe.Pointer(bp + 64)).FpzErrMsg = pzErrMsg
 130210 	(*InitData)(unsafe.Pointer(bp + 64)).FmInitFlags = mFlags
 130211 	(*InitData)(unsafe.Pointer(bp + 64)).FnInitRow = U32(0)
 130212 	(*InitData)(unsafe.Pointer(bp + 64)).FmxPage = Pgno(0)
 130213 	Xsqlite3InitCallback(tls, bp+64, 5, bp+16, uintptr(0))
 130214 	*(*U32)(unsafe.Pointer(db + 44)) &= U32(mask)
 130215 	if !((*InitData)(unsafe.Pointer(bp+64)).Frc != 0) {
 130216 		goto __1
 130217 	}
 130218 	rc = (*InitData)(unsafe.Pointer(bp + 64)).Frc
 130219 	goto error_out
 130220 __1:
 130221 	;
 130222 	pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32
 130223 	if !((*Db)(unsafe.Pointer(pDb)).FpBt == uintptr(0)) {
 130224 		goto __2
 130225 	}
 130226 
 130227 	*(*U16)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema + 114)) |= U16(DB_SchemaLoaded)
 130228 	rc = SQLITE_OK
 130229 	goto error_out
 130230 __2:
 130231 	;
 130232 	Xsqlite3BtreeEnter(tls, (*Db)(unsafe.Pointer(pDb)).FpBt)
 130233 	if !(Xsqlite3BtreeTxnState(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) == SQLITE_TXN_NONE) {
 130234 		goto __3
 130235 	}
 130236 	rc = Xsqlite3BtreeBeginTrans(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, 0, uintptr(0))
 130237 	if !(rc != SQLITE_OK) {
 130238 		goto __4
 130239 	}
 130240 	Xsqlite3SetString(tls, pzErrMsg, db, Xsqlite3ErrStr(tls, rc))
 130241 	goto initone_error_out
 130242 __4:
 130243 	;
 130244 	openedTransaction = 1
 130245 __3:
 130246 	;
 130247 	i = 0
 130248 __5:
 130249 	if !(i < int32(uint64(unsafe.Sizeof([5]int32{}))/uint64(unsafe.Sizeof(int32(0))))) {
 130250 		goto __7
 130251 	}
 130252 	Xsqlite3BtreeGetMeta(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, i+1, bp+104+uintptr(i)*4)
 130253 	goto __6
 130254 __6:
 130255 	i++
 130256 	goto __5
 130257 	goto __7
 130258 __7:
 130259 	;
 130260 	if !((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ResetDatabase) != uint64(0)) {
 130261 		goto __8
 130262 	}
 130263 	libc.Xmemset(tls, bp+104, 0, uint64(unsafe.Sizeof([5]int32{})))
 130264 __8:
 130265 	;
 130266 	(*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fschema_cookie = *(*int32)(unsafe.Pointer(bp + 104))
 130267 
 130268 	if !(*(*int32)(unsafe.Pointer(bp + 104 + 4*4)) != 0) {
 130269 		goto __9
 130270 	}
 130271 	if !(iDb == 0 && (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_EncodingFixed) == U32(0)) {
 130272 		goto __10
 130273 	}
 130274 
 130275 	encoding = U8(int32(U8(*(*int32)(unsafe.Pointer(bp + 104 + 4*4)))) & 3)
 130276 	if !(int32(encoding) == 0) {
 130277 		goto __12
 130278 	}
 130279 	encoding = U8(SQLITE_UTF8)
 130280 __12:
 130281 	;
 130282 	if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive > 0 && int32(encoding) != int32((*Sqlite3)(unsafe.Pointer(db)).Fenc)) {
 130283 		goto __13
 130284 	}
 130285 	rc = SQLITE_LOCKED
 130286 	goto initone_error_out
 130287 	goto __14
 130288 __13:
 130289 	Xsqlite3SetTextEncoding(tls, db, encoding)
 130290 __14:
 130291 	;
 130292 	goto __11
 130293 __10:
 130294 	if !(*(*int32)(unsafe.Pointer(bp + 104 + 4*4))&3 != int32((*Sqlite3)(unsafe.Pointer(db)).Fenc)) {
 130295 		goto __15
 130296 	}
 130297 	Xsqlite3SetString(tls, pzErrMsg, db,
 130298 		ts+13127)
 130299 	rc = SQLITE_ERROR
 130300 	goto initone_error_out
 130301 __15:
 130302 	;
 130303 __11:
 130304 	;
 130305 __9:
 130306 	;
 130307 	(*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fenc = (*Sqlite3)(unsafe.Pointer(db)).Fenc
 130308 
 130309 	if !((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fcache_size == 0) {
 130310 		goto __16
 130311 	}
 130312 	size = Xsqlite3AbsInt32(tls, *(*int32)(unsafe.Pointer(bp + 104 + 2*4)))
 130313 	if !(size == 0) {
 130314 		goto __17
 130315 	}
 130316 	size = -2000
 130317 __17:
 130318 	;
 130319 	(*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fcache_size = size
 130320 	Xsqlite3BtreeSetCacheSize(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fcache_size)
 130321 __16:
 130322 	;
 130323 	(*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = U8(*(*int32)(unsafe.Pointer(bp + 104 + 1*4)))
 130324 	if !(int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) == 0) {
 130325 		goto __18
 130326 	}
 130327 	(*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = U8(1)
 130328 __18:
 130329 	;
 130330 	if !(int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) > SQLITE_MAX_FILE_FORMAT) {
 130331 		goto __19
 130332 	}
 130333 	Xsqlite3SetString(tls, pzErrMsg, db, ts+19793)
 130334 	rc = SQLITE_ERROR
 130335 	goto initone_error_out
 130336 __19:
 130337 	;
 130338 	if !(iDb == 0 && *(*int32)(unsafe.Pointer(bp + 104 + 1*4)) >= 4) {
 130339 		goto __20
 130340 	}
 130341 	*(*U64)(unsafe.Pointer(db + 48)) &= libc.CplUint64(uint64(SQLITE_LegacyFileFmt))
 130342 __20:
 130343 	;
 130344 	(*InitData)(unsafe.Pointer(bp + 64)).FmxPage = Xsqlite3BtreeLastPage(tls, (*Db)(unsafe.Pointer(pDb)).FpBt)
 130345 
 130346 	zSql = Xsqlite3MPrintf(tls, db,
 130347 		ts+19817,
 130348 		libc.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, zSchemaTabName))
 130349 
 130350 	xAuth = (*Sqlite3)(unsafe.Pointer(db)).FxAuth
 130351 	(*Sqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0)
 130352 	rc = Xsqlite3_exec(tls, db, zSql, *(*uintptr)(unsafe.Pointer(&struct {
 130353 		f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
 130354 	}{Xsqlite3InitCallback})), bp+64, uintptr(0))
 130355 	(*Sqlite3)(unsafe.Pointer(db)).FxAuth = xAuth
 130356 
 130357 	if !(rc == SQLITE_OK) {
 130358 		goto __21
 130359 	}
 130360 	rc = (*InitData)(unsafe.Pointer(bp + 64)).Frc
 130361 __21:
 130362 	;
 130363 	Xsqlite3DbFree(tls, db, zSql)
 130364 	if !(rc == SQLITE_OK) {
 130365 		goto __22
 130366 	}
 130367 	Xsqlite3AnalysisLoad(tls, db, iDb)
 130368 __22:
 130369 	;
 130370 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 130371 		goto __23
 130372 	}
 130373 	rc = SQLITE_NOMEM
 130374 	Xsqlite3ResetAllSchemasOfConnection(tls, db)
 130375 	pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32
 130376 	goto __24
 130377 __23:
 130378 	if !(rc == SQLITE_OK || (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_NoSchemaError) != 0 && rc != SQLITE_NOMEM) {
 130379 		goto __25
 130380 	}
 130381 
 130382 	*(*U16)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpSchema + 114)) |= U16(DB_SchemaLoaded)
 130383 	rc = SQLITE_OK
 130384 __25:
 130385 	;
 130386 __24:
 130387 	;
 130388 initone_error_out:
 130389 	if !(openedTransaction != 0) {
 130390 		goto __26
 130391 	}
 130392 	Xsqlite3BtreeCommit(tls, (*Db)(unsafe.Pointer(pDb)).FpBt)
 130393 __26:
 130394 	;
 130395 	Xsqlite3BtreeLeave(tls, (*Db)(unsafe.Pointer(pDb)).FpBt)
 130396 
 130397 error_out:
 130398 	if !(rc != 0) {
 130399 		goto __27
 130400 	}
 130401 	if !(rc == SQLITE_NOMEM || rc == SQLITE_IOERR|int32(12)<<8) {
 130402 		goto __28
 130403 	}
 130404 	Xsqlite3OomFault(tls, db)
 130405 __28:
 130406 	;
 130407 	Xsqlite3ResetOneSchema(tls, db, iDb)
 130408 __27:
 130409 	;
 130410 	(*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(0)
 130411 	return rc
 130412 }
 130413 
 130414 // Initialize all database files - the main database file, the file
 130415 // used to store temporary tables, and any additional database files
 130416 // created using ATTACH statements.  Return a success code.  If an
 130417 // error occurs, write an error message into *pzErrMsg.
 130418 //
 130419 // After a database is initialized, the DB_SchemaLoaded bit is set
 130420 // bit is set in the flags field of the Db structure.
 130421 func Xsqlite3Init(tls *libc.TLS, db uintptr, pzErrMsg uintptr) int32 {
 130422 	var i int32
 130423 	var rc int32
 130424 	var commit_internal int32 = libc.BoolInt32(!((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_SchemaChange) != 0))
 130425 
 130426 	(*Sqlite3)(unsafe.Pointer(db)).Fenc = (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema)).Fenc
 130427 
 130428 	if !(int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema)).FschemaFlags)&DB_SchemaLoaded == DB_SchemaLoaded) {
 130429 		rc = Xsqlite3InitOne(tls, db, 0, pzErrMsg, uint32(0))
 130430 		if rc != 0 {
 130431 			return rc
 130432 		}
 130433 	}
 130434 
 130435 	for i = (*Sqlite3)(unsafe.Pointer(db)).FnDb - 1; i > 0; i-- {
 130436 		if !(int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FpSchema)).FschemaFlags)&DB_SchemaLoaded == DB_SchemaLoaded) {
 130437 			rc = Xsqlite3InitOne(tls, db, i, pzErrMsg, uint32(0))
 130438 			if rc != 0 {
 130439 				return rc
 130440 			}
 130441 		}
 130442 	}
 130443 	if commit_internal != 0 {
 130444 		Xsqlite3CommitInternalChanges(tls, db)
 130445 	}
 130446 	return SQLITE_OK
 130447 }
 130448 
 130449 // This routine is a no-op if the database schema is already initialized.
 130450 // Otherwise, the schema is loaded. An error code is returned.
 130451 func Xsqlite3ReadSchema(tls *libc.TLS, pParse uintptr) int32 {
 130452 	var rc int32 = SQLITE_OK
 130453 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 130454 
 130455 	if !(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0) {
 130456 		rc = Xsqlite3Init(tls, db, pParse+8)
 130457 		if rc != SQLITE_OK {
 130458 			(*Parse)(unsafe.Pointer(pParse)).Frc = rc
 130459 			(*Parse)(unsafe.Pointer(pParse)).FnErr++
 130460 		} else if (*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache != 0 {
 130461 			*(*U32)(unsafe.Pointer(db + 44)) |= U32(DBFLAG_SchemaKnownOk)
 130462 		}
 130463 	}
 130464 	return rc
 130465 }
 130466 
 130467 func schemaIsValid(tls *libc.TLS, pParse uintptr) {
 130468 	bp := tls.Alloc(4)
 130469 	defer tls.Free(4)
 130470 
 130471 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 130472 	var iDb int32
 130473 	var rc int32
 130474 
 130475 	for iDb = 0; iDb < (*Sqlite3)(unsafe.Pointer(db)).FnDb; iDb++ {
 130476 		var openedTransaction int32 = 0
 130477 		var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpBt
 130478 		if pBt == uintptr(0) {
 130479 			continue
 130480 		}
 130481 
 130482 		if Xsqlite3BtreeTxnState(tls, pBt) == SQLITE_TXN_NONE {
 130483 			rc = Xsqlite3BtreeBeginTrans(tls, pBt, 0, uintptr(0))
 130484 			if rc == SQLITE_NOMEM || rc == SQLITE_IOERR|int32(12)<<8 {
 130485 				Xsqlite3OomFault(tls, db)
 130486 				(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_NOMEM
 130487 			}
 130488 			if rc != SQLITE_OK {
 130489 				return
 130490 			}
 130491 			openedTransaction = 1
 130492 		}
 130493 
 130494 		Xsqlite3BtreeGetMeta(tls, pBt, BTREE_SCHEMA_VERSION, bp)
 130495 
 130496 		if *(*int32)(unsafe.Pointer(bp)) != (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpSchema)).Fschema_cookie {
 130497 			if int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpSchema)).FschemaFlags)&DB_SchemaLoaded == DB_SchemaLoaded {
 130498 				(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_SCHEMA
 130499 			}
 130500 			Xsqlite3ResetOneSchema(tls, db, iDb)
 130501 		}
 130502 
 130503 		if openedTransaction != 0 {
 130504 			Xsqlite3BtreeCommit(tls, pBt)
 130505 		}
 130506 	}
 130507 }
 130508 
 130509 // Convert a schema pointer into the iDb index that indicates
 130510 // which database file in db->aDb[] the schema refers to.
 130511 //
 130512 // If the same database is attached more than once, the first
 130513 // attached database is returned.
 130514 func Xsqlite3SchemaToIndex(tls *libc.TLS, db uintptr, pSchema uintptr) int32 {
 130515 	var i int32 = -32768
 130516 
 130517 	if pSchema != 0 {
 130518 		for i = 0; 1 != 0; i++ {
 130519 			if (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FpSchema == pSchema {
 130520 				break
 130521 			}
 130522 		}
 130523 
 130524 	}
 130525 	return i
 130526 }
 130527 
 130528 // Free all memory allocations in the pParse object
 130529 func Xsqlite3ParseObjectReset(tls *libc.TLS, pParse uintptr) {
 130530 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 130531 
 130532 	if (*Parse)(unsafe.Pointer(pParse)).FaTableLock != 0 {
 130533 		Xsqlite3DbNNFreeNN(tls, db, (*Parse)(unsafe.Pointer(pParse)).FaTableLock)
 130534 	}
 130535 	for (*Parse)(unsafe.Pointer(pParse)).FpCleanup != 0 {
 130536 		var pCleanup uintptr = (*Parse)(unsafe.Pointer(pParse)).FpCleanup
 130537 		(*Parse)(unsafe.Pointer(pParse)).FpCleanup = (*ParseCleanup)(unsafe.Pointer(pCleanup)).FpNext
 130538 		(*struct {
 130539 			f func(*libc.TLS, uintptr, uintptr)
 130540 		})(unsafe.Pointer(&struct{ uintptr }{(*ParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup})).f(tls, db, (*ParseCleanup)(unsafe.Pointer(pCleanup)).FpPtr)
 130541 		Xsqlite3DbNNFreeNN(tls, db, pCleanup)
 130542 	}
 130543 	if (*Parse)(unsafe.Pointer(pParse)).FaLabel != 0 {
 130544 		Xsqlite3DbNNFreeNN(tls, db, (*Parse)(unsafe.Pointer(pParse)).FaLabel)
 130545 	}
 130546 	if (*Parse)(unsafe.Pointer(pParse)).FpConstExpr != 0 {
 130547 		Xsqlite3ExprListDelete(tls, db, (*Parse)(unsafe.Pointer(pParse)).FpConstExpr)
 130548 	}
 130549 
 130550 	*(*U32)(unsafe.Pointer(db + 440)) -= U32((*Parse)(unsafe.Pointer(pParse)).FdisableLookaside)
 130551 	(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = func() uint16 {
 130552 		if (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable != 0 {
 130553 			return uint16(0)
 130554 		}
 130555 		return (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue
 130556 	}()
 130557 
 130558 	(*Sqlite3)(unsafe.Pointer(db)).FpParse = (*Parse)(unsafe.Pointer(pParse)).FpOuterParse
 130559 	(*Parse)(unsafe.Pointer(pParse)).Fdb = uintptr(0)
 130560 	(*Parse)(unsafe.Pointer(pParse)).FdisableLookaside = U8(0)
 130561 }
 130562 
 130563 // Add a new cleanup operation to a Parser.  The cleanup should happen when
 130564 // the parser object is destroyed.  But, beware: the cleanup might happen
 130565 // immediately.
 130566 //
 130567 // Use this mechanism for uncommon cleanups.  There is a higher setup
 130568 // cost for this mechansim (an extra malloc), so it should not be used
 130569 // for common cleanups that happen on most calls.  But for less
 130570 // common cleanups, we save a single NULL-pointer comparison in
 130571 // sqlite3ParseObjectReset(), which reduces the total CPU cycle count.
 130572 //
 130573 // If a memory allocation error occurs, then the cleanup happens immediately.
 130574 // When either SQLITE_DEBUG or SQLITE_COVERAGE_TEST are defined, the
 130575 // pParse->earlyCleanup flag is set in that case.  Calling code show verify
 130576 // that test cases exist for which this happens, to guard against possible
 130577 // use-after-free errors following an OOM.  The preferred way to do this is
 130578 // to immediately follow the call to this routine with:
 130579 //
 130580 //	testcase( pParse->earlyCleanup );
 130581 //
 130582 // This routine returns a copy of its pPtr input (the third parameter)
 130583 // except if an early cleanup occurs, in which case it returns NULL.  So
 130584 // another way to check for early cleanup is to check the return value.
 130585 // Or, stop using the pPtr parameter with this call and use only its
 130586 // return value thereafter.  Something like this:
 130587 //
 130588 //	pObj = sqlite3ParserAddCleanup(pParse, destructor, pObj);
 130589 func Xsqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, pPtr uintptr) uintptr {
 130590 	var pCleanup uintptr = Xsqlite3DbMallocRaw(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(ParseCleanup{})))
 130591 	if pCleanup != 0 {
 130592 		(*ParseCleanup)(unsafe.Pointer(pCleanup)).FpNext = (*Parse)(unsafe.Pointer(pParse)).FpCleanup
 130593 		(*Parse)(unsafe.Pointer(pParse)).FpCleanup = pCleanup
 130594 		(*ParseCleanup)(unsafe.Pointer(pCleanup)).FpPtr = pPtr
 130595 		(*ParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = xCleanup
 130596 	} else {
 130597 		(*struct {
 130598 			f func(*libc.TLS, uintptr, uintptr)
 130599 		})(unsafe.Pointer(&struct{ uintptr }{xCleanup})).f(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pPtr)
 130600 		pPtr = uintptr(0)
 130601 	}
 130602 	return pPtr
 130603 }
 130604 
 130605 // Turn bulk memory into a valid Parse object and link that Parse object
 130606 // into database connection db.
 130607 //
 130608 // Call sqlite3ParseObjectReset() to undo this operation.
 130609 //
 130610 // Caution:  Do not confuse this routine with sqlite3ParseObjectInit() which
 130611 // is generated by Lemon.
 130612 func Xsqlite3ParseObjectInit(tls *libc.TLS, pParse uintptr, db uintptr) {
 130613 	libc.Xmemset(tls, pParse+uintptr(uint64(uintptr(0)+8)), 0, uint64(uintptr(0)+228)-uint64(uintptr(0)+8))
 130614 	libc.Xmemset(tls, pParse+uintptr(uint64(uintptr(0)+288)), 0, uint64(unsafe.Sizeof(Parse{}))-uint64(uintptr(0)+288))
 130615 
 130616 	(*Parse)(unsafe.Pointer(pParse)).FpOuterParse = (*Sqlite3)(unsafe.Pointer(db)).FpParse
 130617 	(*Sqlite3)(unsafe.Pointer(db)).FpParse = pParse
 130618 	(*Parse)(unsafe.Pointer(pParse)).Fdb = db
 130619 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 130620 		Xsqlite3ErrorMsg(tls, pParse, ts+1480, 0)
 130621 	}
 130622 }
 130623 
 130624 func sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, pReprepare uintptr, ppStmt uintptr, pzTail uintptr) int32 {
 130625 	bp := tls.Alloc(440)
 130626 	defer tls.Free(440)
 130627 
 130628 	var rc int32
 130629 	var i int32
 130630 
 130631 	var zDb uintptr
 130632 	var pBt uintptr
 130633 	var zSqlCopy uintptr
 130634 	var mxLen int32
 130635 	var pT uintptr
 130636 	rc = SQLITE_OK
 130637 
 130638 	libc.Xmemset(tls, bp+16+uintptr(uint64(uintptr(0)+8)), 0, uint64(uintptr(0)+228)-uint64(uintptr(0)+8))
 130639 	libc.Xmemset(tls, bp+16+uintptr(uint64(uintptr(0)+288)), 0, uint64(unsafe.Sizeof(Parse{}))-uint64(uintptr(0)+288))
 130640 	(*Parse)(unsafe.Pointer(bp + 16)).FpOuterParse = (*Sqlite3)(unsafe.Pointer(db)).FpParse
 130641 	(*Sqlite3)(unsafe.Pointer(db)).FpParse = bp + 16
 130642 	(*Parse)(unsafe.Pointer(bp + 16)).Fdb = db
 130643 	(*Parse)(unsafe.Pointer(bp + 16)).FpReprepare = pReprepare
 130644 
 130645 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 130646 		goto __1
 130647 	}
 130648 	Xsqlite3ErrorMsg(tls, bp+16, ts+1480, 0)
 130649 __1:
 130650 	;
 130651 	if !(prepFlags&U32(SQLITE_PREPARE_PERSISTENT) != 0) {
 130652 		goto __2
 130653 	}
 130654 	(*Parse)(unsafe.Pointer(bp+16)).FdisableLookaside++
 130655 	(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++
 130656 	(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0)
 130657 __2:
 130658 	;
 130659 	(*Parse)(unsafe.Pointer(bp + 16)).FprepFlags = U8(prepFlags & U32(0xff))
 130660 
 130661 	if !!(int32((*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache) != 0) {
 130662 		goto __3
 130663 	}
 130664 	i = 0
 130665 __4:
 130666 	if !(i < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
 130667 		goto __6
 130668 	}
 130669 	pBt = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt
 130670 	if !(pBt != 0) {
 130671 		goto __7
 130672 	}
 130673 
 130674 	rc = Xsqlite3BtreeSchemaLocked(tls, pBt)
 130675 	if !(rc != 0) {
 130676 		goto __8
 130677 	}
 130678 	zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FzDbSName
 130679 	Xsqlite3ErrorWithMsg(tls, db, rc, ts+19851, libc.VaList(bp, zDb))
 130680 
 130681 	goto end_prepare
 130682 __8:
 130683 	;
 130684 __7:
 130685 	;
 130686 	goto __5
 130687 __5:
 130688 	i++
 130689 	goto __4
 130690 	goto __6
 130691 __6:
 130692 	;
 130693 __3:
 130694 	;
 130695 	if !((*Sqlite3)(unsafe.Pointer(db)).FpDisconnect != 0) {
 130696 		goto __9
 130697 	}
 130698 	Xsqlite3VtabUnlockList(tls, db)
 130699 __9:
 130700 	;
 130701 	if !(nBytes >= 0 && (nBytes == 0 || int32(*(*int8)(unsafe.Pointer(zSql + uintptr(nBytes-1)))) != 0)) {
 130702 		goto __10
 130703 	}
 130704 	mxLen = *(*int32)(unsafe.Pointer(db + 136 + 1*4))
 130705 
 130706 	if !(nBytes > mxLen) {
 130707 		goto __12
 130708 	}
 130709 	Xsqlite3ErrorWithMsg(tls, db, SQLITE_TOOBIG, ts+19881, 0)
 130710 	rc = Xsqlite3ApiExit(tls, db, SQLITE_TOOBIG)
 130711 	goto end_prepare
 130712 __12:
 130713 	;
 130714 	zSqlCopy = Xsqlite3DbStrNDup(tls, db, zSql, uint64(nBytes))
 130715 	if !(zSqlCopy != 0) {
 130716 		goto __13
 130717 	}
 130718 	Xsqlite3RunParser(tls, bp+16, zSqlCopy)
 130719 	(*Parse)(unsafe.Pointer(bp + 16)).FzTail = zSql + uintptr((int64((*Parse)(unsafe.Pointer(bp+16)).FzTail)-int64(zSqlCopy))/1)
 130720 	Xsqlite3DbFree(tls, db, zSqlCopy)
 130721 	goto __14
 130722 __13:
 130723 	(*Parse)(unsafe.Pointer(bp + 16)).FzTail = zSql + uintptr(nBytes)
 130724 __14:
 130725 	;
 130726 	goto __11
 130727 __10:
 130728 	Xsqlite3RunParser(tls, bp+16, zSql)
 130729 __11:
 130730 	;
 130731 	if !(pzTail != 0) {
 130732 		goto __15
 130733 	}
 130734 	*(*uintptr)(unsafe.Pointer(pzTail)) = (*Parse)(unsafe.Pointer(bp + 16)).FzTail
 130735 __15:
 130736 	;
 130737 	if !(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0) {
 130738 		goto __16
 130739 	}
 130740 	Xsqlite3VdbeSetSql(tls, (*Parse)(unsafe.Pointer(bp+16)).FpVdbe, zSql, int32((int64((*Parse)(unsafe.Pointer(bp+16)).FzTail)-int64(zSql))/1), uint8(prepFlags))
 130741 __16:
 130742 	;
 130743 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 130744 		goto __17
 130745 	}
 130746 	(*Parse)(unsafe.Pointer(bp + 16)).Frc = SQLITE_NOMEM
 130747 	(*Parse)(unsafe.Pointer(bp + 16)).FcheckSchema = U8(0)
 130748 __17:
 130749 	;
 130750 	if !((*Parse)(unsafe.Pointer(bp+16)).Frc != SQLITE_OK && (*Parse)(unsafe.Pointer(bp+16)).Frc != SQLITE_DONE) {
 130751 		goto __18
 130752 	}
 130753 	if !((*Parse)(unsafe.Pointer(bp+16)).FcheckSchema != 0 && int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0) {
 130754 		goto __20
 130755 	}
 130756 	schemaIsValid(tls, bp+16)
 130757 __20:
 130758 	;
 130759 	if !((*Parse)(unsafe.Pointer(bp+16)).FpVdbe != 0) {
 130760 		goto __21
 130761 	}
 130762 	Xsqlite3VdbeFinalize(tls, (*Parse)(unsafe.Pointer(bp+16)).FpVdbe)
 130763 __21:
 130764 	;
 130765 	rc = (*Parse)(unsafe.Pointer(bp + 16)).Frc
 130766 	if !((*Parse)(unsafe.Pointer(bp+16)).FzErrMsg != 0) {
 130767 		goto __22
 130768 	}
 130769 	Xsqlite3ErrorWithMsg(tls, db, rc, ts+4493, libc.VaList(bp+8, (*Parse)(unsafe.Pointer(bp+16)).FzErrMsg))
 130770 	Xsqlite3DbFree(tls, db, (*Parse)(unsafe.Pointer(bp+16)).FzErrMsg)
 130771 	goto __23
 130772 __22:
 130773 	Xsqlite3Error(tls, db, rc)
 130774 __23:
 130775 	;
 130776 	goto __19
 130777 __18:
 130778 	;
 130779 	*(*uintptr)(unsafe.Pointer(ppStmt)) = (*Parse)(unsafe.Pointer(bp + 16)).FpVdbe
 130780 	rc = SQLITE_OK
 130781 	Xsqlite3ErrorClear(tls, db)
 130782 __19:
 130783 	;
 130784 __24:
 130785 	if !((*Parse)(unsafe.Pointer(bp+16)).FpTriggerPrg != 0) {
 130786 		goto __25
 130787 	}
 130788 	pT = (*Parse)(unsafe.Pointer(bp + 16)).FpTriggerPrg
 130789 	(*Parse)(unsafe.Pointer(bp + 16)).FpTriggerPrg = (*TriggerPrg)(unsafe.Pointer(pT)).FpNext
 130790 	Xsqlite3DbFree(tls, db, pT)
 130791 	goto __24
 130792 __25:
 130793 	;
 130794 end_prepare:
 130795 	Xsqlite3ParseObjectReset(tls, bp+16)
 130796 	return rc
 130797 }
 130798 
 130799 func sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, pOld uintptr, ppStmt uintptr, pzTail uintptr) int32 {
 130800 	var rc int32
 130801 	var cnt int32 = 0
 130802 
 130803 	*(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0)
 130804 	if !(Xsqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) {
 130805 		return Xsqlite3MisuseError(tls, 138048)
 130806 	}
 130807 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 130808 	Xsqlite3BtreeEnterAll(tls, db)
 130809 	for __ccgo := true; __ccgo; __ccgo = rc == SQLITE_ERROR|int32(2)<<8 && libc.PostIncInt32(&cnt, 1) < SQLITE_MAX_PREPARE_RETRY ||
 130810 		rc == SQLITE_SCHEMA && func() int32 { Xsqlite3ResetOneSchema(tls, db, -1); return libc.PostIncInt32(&cnt, 1) }() == 0 {
 130811 		rc = sqlite3Prepare(tls, db, zSql, nBytes, prepFlags, pOld, ppStmt, pzTail)
 130812 
 130813 		if rc == SQLITE_OK || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 130814 			break
 130815 		}
 130816 	}
 130817 	Xsqlite3BtreeLeaveAll(tls, db)
 130818 	rc = Xsqlite3ApiExit(tls, db, rc)
 130819 
 130820 	(*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0
 130821 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 130822 	return rc
 130823 }
 130824 
 130825 // Rerun the compilation of a statement after a schema change.
 130826 //
 130827 // If the statement is successfully recompiled, return SQLITE_OK. Otherwise,
 130828 // if the statement cannot be recompiled because another connection has
 130829 // locked the sqlite3_schema table, return SQLITE_LOCKED. If any other error
 130830 // occurs, return SQLITE_SCHEMA.
 130831 func Xsqlite3Reprepare(tls *libc.TLS, p uintptr) int32 {
 130832 	bp := tls.Alloc(8)
 130833 	defer tls.Free(8)
 130834 
 130835 	var rc int32
 130836 
 130837 	var zSql uintptr
 130838 	var db uintptr
 130839 	var prepFlags U8
 130840 
 130841 	zSql = Xsqlite3_sql(tls, p)
 130842 
 130843 	db = Xsqlite3VdbeDb(tls, p)
 130844 
 130845 	prepFlags = Xsqlite3VdbePrepareFlags(tls, p)
 130846 	rc = sqlite3LockAndPrepare(tls, db, zSql, -1, uint32(prepFlags), p, bp, uintptr(0))
 130847 	if rc != 0 {
 130848 		if rc == SQLITE_NOMEM {
 130849 			Xsqlite3OomFault(tls, db)
 130850 		}
 130851 
 130852 		return rc
 130853 	} else {
 130854 	}
 130855 	Xsqlite3VdbeSwap(tls, *(*uintptr)(unsafe.Pointer(bp)), p)
 130856 	Xsqlite3TransferBindings(tls, *(*uintptr)(unsafe.Pointer(bp)), p)
 130857 	Xsqlite3VdbeResetStepResult(tls, *(*uintptr)(unsafe.Pointer(bp)))
 130858 	Xsqlite3VdbeFinalize(tls, *(*uintptr)(unsafe.Pointer(bp)))
 130859 	return SQLITE_OK
 130860 }
 130861 
 130862 // Two versions of the official API.  Legacy and new use.  In the legacy
 130863 // version, the original SQL text is not saved in the prepared statement
 130864 // and so if a schema change occurs, SQLITE_SCHEMA is returned by
 130865 // sqlite3_step().  In the new version, the original SQL text is retained
 130866 // and the statement is automatically recompiled if an schema change
 130867 // occurs.
 130868 func Xsqlite3_prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 {
 130869 	var rc int32
 130870 	rc = sqlite3LockAndPrepare(tls, db, zSql, nBytes, uint32(0), uintptr(0), ppStmt, pzTail)
 130871 
 130872 	return rc
 130873 }
 130874 
 130875 func Xsqlite3_prepare_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 {
 130876 	var rc int32
 130877 
 130878 	rc = sqlite3LockAndPrepare(tls, db, zSql, nBytes, uint32(SQLITE_PREPARE_SAVESQL), uintptr(0),
 130879 		ppStmt, pzTail)
 130880 
 130881 	return rc
 130882 }
 130883 
 130884 func Xsqlite3_prepare_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags uint32, ppStmt uintptr, pzTail uintptr) int32 {
 130885 	var rc int32
 130886 
 130887 	rc = sqlite3LockAndPrepare(tls, db, zSql, nBytes,
 130888 		uint32(SQLITE_PREPARE_SAVESQL)|prepFlags&uint32(SQLITE_PREPARE_MASK),
 130889 		uintptr(0), ppStmt, pzTail)
 130890 
 130891 	return rc
 130892 }
 130893 
 130894 func sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, ppStmt uintptr, pzTail uintptr) int32 {
 130895 	bp := tls.Alloc(8)
 130896 	defer tls.Free(8)
 130897 
 130898 	var zSql8 uintptr
 130899 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 130900 	var rc int32 = SQLITE_OK
 130901 
 130902 	*(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0)
 130903 	if !(Xsqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) {
 130904 		return Xsqlite3MisuseError(tls, 138196)
 130905 	}
 130906 	if nBytes >= 0 {
 130907 		var sz int32
 130908 		var z uintptr = zSql
 130909 		for sz = 0; sz < nBytes && (int32(*(*int8)(unsafe.Pointer(z + uintptr(sz)))) != 0 || int32(*(*int8)(unsafe.Pointer(z + uintptr(sz+1)))) != 0); sz = sz + 2 {
 130910 		}
 130911 		nBytes = sz
 130912 	}
 130913 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 130914 	zSql8 = Xsqlite3Utf16to8(tls, db, zSql, nBytes, uint8(SQLITE_UTF16LE))
 130915 	if zSql8 != 0 {
 130916 		rc = sqlite3LockAndPrepare(tls, db, zSql8, -1, prepFlags, uintptr(0), ppStmt, bp)
 130917 	}
 130918 
 130919 	if *(*uintptr)(unsafe.Pointer(bp)) != 0 && pzTail != 0 {
 130920 		var chars_parsed int32 = Xsqlite3Utf8CharLen(tls, zSql8, int32((int64(*(*uintptr)(unsafe.Pointer(bp)))-int64(zSql8))/1))
 130921 		*(*uintptr)(unsafe.Pointer(pzTail)) = zSql + uintptr(Xsqlite3Utf16ByteLen(tls, zSql, chars_parsed))
 130922 	}
 130923 	Xsqlite3DbFree(tls, db, zSql8)
 130924 	rc = Xsqlite3ApiExit(tls, db, rc)
 130925 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 130926 	return rc
 130927 }
 130928 
 130929 // Two versions of the official API.  Legacy and new use.  In the legacy
 130930 // version, the original SQL text is not saved in the prepared statement
 130931 // and so if a schema change occurs, SQLITE_SCHEMA is returned by
 130932 // sqlite3_step().  In the new version, the original SQL text is retained
 130933 // and the statement is automatically recompiled if an schema change
 130934 // occurs.
 130935 func Xsqlite3_prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 {
 130936 	var rc int32
 130937 	rc = sqlite3Prepare16(tls, db, zSql, nBytes, uint32(0), ppStmt, pzTail)
 130938 
 130939 	return rc
 130940 }
 130941 
 130942 func Xsqlite3_prepare16_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 {
 130943 	var rc int32
 130944 	rc = sqlite3Prepare16(tls, db, zSql, nBytes, uint32(SQLITE_PREPARE_SAVESQL), ppStmt, pzTail)
 130945 
 130946 	return rc
 130947 }
 130948 
 130949 func Xsqlite3_prepare16_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags uint32, ppStmt uintptr, pzTail uintptr) int32 {
 130950 	var rc int32
 130951 	rc = sqlite3Prepare16(tls, db, zSql, nBytes,
 130952 		uint32(SQLITE_PREPARE_SAVESQL)|prepFlags&uint32(SQLITE_PREPARE_MASK),
 130953 		ppStmt, pzTail)
 130954 
 130955 	return rc
 130956 }
 130957 
 130958 // An instance of the following object is used to record information about
 130959 // how to process the DISTINCT keyword, to simplify passing that information
 130960 // into the selectInnerLoop() routine.
 130961 type DistinctCtx1 = struct {
 130962 	FisTnct      U8
 130963 	FeTnctType   U8
 130964 	F__ccgo_pad1 [2]byte
 130965 	FtabTnct     int32
 130966 	FaddrTnct    int32
 130967 }
 130968 
 130969 // An instance of the following object is used to record information about
 130970 // how to process the DISTINCT keyword, to simplify passing that information
 130971 // into the selectInnerLoop() routine.
 130972 type DistinctCtx = DistinctCtx1
 130973 
 130974 // An instance of the following object is used to record information about
 130975 // the ORDER BY (or GROUP BY) clause of query is being coded.
 130976 //
 130977 // The aDefer[] array is used by the sorter-references optimization. For
 130978 // example, assuming there is no index that can be used for the ORDER BY,
 130979 // for the query:
 130980 //
 130981 //	SELECT a, bigblob FROM t1 ORDER BY a LIMIT 10;
 130982 //
 130983 // it may be more efficient to add just the "a" values to the sorter, and
 130984 // retrieve the associated "bigblob" values directly from table t1 as the
 130985 // 10 smallest "a" values are extracted from the sorter.
 130986 //
 130987 // When the sorter-reference optimization is used, there is one entry in the
 130988 // aDefer[] array for each database table that may be read as values are
 130989 // extracted from the sorter.
 130990 type SortCtx1 = struct {
 130991 	FpOrderBy         uintptr
 130992 	FnOBSat           int32
 130993 	FiECursor         int32
 130994 	FregReturn        int32
 130995 	FlabelBkOut       int32
 130996 	FaddrSortIndex    int32
 130997 	FlabelDone        int32
 130998 	FlabelOBLopt      int32
 130999 	FsortFlags        U8
 131000 	F__ccgo_pad1      [3]byte
 131001 	FpDeferredRowLoad uintptr
 131002 }
 131003 
 131004 // An instance of the following object is used to record information about
 131005 // the ORDER BY (or GROUP BY) clause of query is being coded.
 131006 //
 131007 // The aDefer[] array is used by the sorter-references optimization. For
 131008 // example, assuming there is no index that can be used for the ORDER BY,
 131009 // for the query:
 131010 //
 131011 //	SELECT a, bigblob FROM t1 ORDER BY a LIMIT 10;
 131012 //
 131013 // it may be more efficient to add just the "a" values to the sorter, and
 131014 // retrieve the associated "bigblob" values directly from table t1 as the
 131015 // 10 smallest "a" values are extracted from the sorter.
 131016 //
 131017 // When the sorter-reference optimization is used, there is one entry in the
 131018 // aDefer[] array for each database table that may be read as values are
 131019 // extracted from the sorter.
 131020 type SortCtx = SortCtx1
 131021 type RowLoadInfo1 = struct {
 131022 	FregResult   int32
 131023 	FecelFlags   U8
 131024 	F__ccgo_pad1 [3]byte
 131025 }
 131026 
 131027 func clearSelect(tls *libc.TLS, db uintptr, p uintptr, bFree int32) {
 131028 	for p != 0 {
 131029 		var pPrior uintptr = (*Select)(unsafe.Pointer(p)).FpPrior
 131030 		Xsqlite3ExprListDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpEList)
 131031 		Xsqlite3SrcListDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpSrc)
 131032 		Xsqlite3ExprDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpWhere)
 131033 		Xsqlite3ExprListDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpGroupBy)
 131034 		Xsqlite3ExprDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpHaving)
 131035 		Xsqlite3ExprListDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpOrderBy)
 131036 		Xsqlite3ExprDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpLimit)
 131037 		if (*Select)(unsafe.Pointer(p)).FpWith != 0 {
 131038 			Xsqlite3WithDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpWith)
 131039 		}
 131040 		if (*Select)(unsafe.Pointer(p)).FpWinDefn != 0 {
 131041 			Xsqlite3WindowListDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpWinDefn)
 131042 		}
 131043 		for (*Select)(unsafe.Pointer(p)).FpWin != 0 {
 131044 			Xsqlite3WindowUnlinkFromSelect(tls, (*Select)(unsafe.Pointer(p)).FpWin)
 131045 		}
 131046 		if bFree != 0 {
 131047 			Xsqlite3DbNNFreeNN(tls, db, p)
 131048 		}
 131049 		p = pPrior
 131050 		bFree = 1
 131051 	}
 131052 }
 131053 
 131054 // Initialize a SelectDest structure.
 131055 func Xsqlite3SelectDestInit(tls *libc.TLS, pDest uintptr, eDest int32, iParm int32) {
 131056 	(*SelectDest)(unsafe.Pointer(pDest)).FeDest = U8(eDest)
 131057 	(*SelectDest)(unsafe.Pointer(pDest)).FiSDParm = iParm
 131058 	(*SelectDest)(unsafe.Pointer(pDest)).FiSDParm2 = 0
 131059 	(*SelectDest)(unsafe.Pointer(pDest)).FzAffSdst = uintptr(0)
 131060 	(*SelectDest)(unsafe.Pointer(pDest)).FiSdst = 0
 131061 	(*SelectDest)(unsafe.Pointer(pDest)).FnSdst = 0
 131062 }
 131063 
 131064 // Allocate a new Select structure and return a pointer to that
 131065 // structure.
 131066 func Xsqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintptr, pWhere uintptr, pGroupBy uintptr, pHaving uintptr, pOrderBy uintptr, selFlags U32, pLimit uintptr) uintptr {
 131067 	bp := tls.Alloc(128)
 131068 	defer tls.Free(128)
 131069 
 131070 	var pNew uintptr
 131071 	var pAllocated uintptr
 131072 
 131073 	pAllocated = libc.AssignUintptr(&pNew, Xsqlite3DbMallocRawNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Select{}))))
 131074 	if pNew == uintptr(0) {
 131075 		pNew = bp
 131076 	}
 131077 	if pEList == uintptr(0) {
 131078 		pEList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0),
 131079 			Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ASTERISK, uintptr(0)))
 131080 	}
 131081 	(*Select)(unsafe.Pointer(pNew)).FpEList = pEList
 131082 	(*Select)(unsafe.Pointer(pNew)).Fop = U8(TK_SELECT)
 131083 	(*Select)(unsafe.Pointer(pNew)).FselFlags = selFlags
 131084 	(*Select)(unsafe.Pointer(pNew)).FiLimit = 0
 131085 	(*Select)(unsafe.Pointer(pNew)).FiOffset = 0
 131086 	(*Select)(unsafe.Pointer(pNew)).FselId = U32(libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnSelect, 1))
 131087 	*(*int32)(unsafe.Pointer(pNew + 20)) = -1
 131088 	*(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -1
 131089 	(*Select)(unsafe.Pointer(pNew)).FnSelectRow = int16(0)
 131090 	if pSrc == uintptr(0) {
 131091 		pSrc = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(SrcList{})))
 131092 	}
 131093 	(*Select)(unsafe.Pointer(pNew)).FpSrc = pSrc
 131094 	(*Select)(unsafe.Pointer(pNew)).FpWhere = pWhere
 131095 	(*Select)(unsafe.Pointer(pNew)).FpGroupBy = pGroupBy
 131096 	(*Select)(unsafe.Pointer(pNew)).FpHaving = pHaving
 131097 	(*Select)(unsafe.Pointer(pNew)).FpOrderBy = pOrderBy
 131098 	(*Select)(unsafe.Pointer(pNew)).FpPrior = uintptr(0)
 131099 	(*Select)(unsafe.Pointer(pNew)).FpNext = uintptr(0)
 131100 	(*Select)(unsafe.Pointer(pNew)).FpLimit = pLimit
 131101 	(*Select)(unsafe.Pointer(pNew)).FpWith = uintptr(0)
 131102 	(*Select)(unsafe.Pointer(pNew)).FpWin = uintptr(0)
 131103 	(*Select)(unsafe.Pointer(pNew)).FpWinDefn = uintptr(0)
 131104 	if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 {
 131105 		clearSelect(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pNew, libc.Bool32(pNew != bp))
 131106 		pAllocated = uintptr(0)
 131107 	} else {
 131108 	}
 131109 	return pAllocated
 131110 }
 131111 
 131112 // Delete the given Select structure and all of its substructures.
 131113 func Xsqlite3SelectDelete(tls *libc.TLS, db uintptr, p uintptr) {
 131114 	if p != 0 {
 131115 		clearSelect(tls, db, p, 1)
 131116 	}
 131117 }
 131118 
 131119 func findRightmost(tls *libc.TLS, p uintptr) uintptr {
 131120 	for (*Select)(unsafe.Pointer(p)).FpNext != 0 {
 131121 		p = (*Select)(unsafe.Pointer(p)).FpNext
 131122 	}
 131123 	return p
 131124 }
 131125 
 131126 // Given 1 to 3 identifiers preceding the JOIN keyword, determine the
 131127 // type of join.  Return an integer constant that expresses that type
 131128 // in terms of the following bit values:
 131129 //
 131130 //	JT_INNER
 131131 //	JT_CROSS
 131132 //	JT_OUTER
 131133 //	JT_NATURAL
 131134 //	JT_LEFT
 131135 //	JT_RIGHT
 131136 //
 131137 // A full outer join is the combination of JT_LEFT and JT_RIGHT.
 131138 //
 131139 // If an illegal or unsupported join type is seen, then still return
 131140 // a join type, but put an error in the pParse structure.
 131141 //
 131142 // These are the valid join types:
 131143 //
 131144 //	 pA       pB       pC               Return Value
 131145 //	-------  -----    -----             ------------
 131146 //	CROSS      -        -                 JT_CROSS
 131147 //	INNER      -        -                 JT_INNER
 131148 //	LEFT       -        -                 JT_LEFT|JT_OUTER
 131149 //	LEFT     OUTER      -                 JT_LEFT|JT_OUTER
 131150 //	RIGHT      -        -                 JT_RIGHT|JT_OUTER
 131151 //	RIGHT    OUTER      -                 JT_RIGHT|JT_OUTER
 131152 //	FULL       -        -                 JT_LEFT|JT_RIGHT|JT_OUTER
 131153 //	FULL     OUTER      -                 JT_LEFT|JT_RIGHT|JT_OUTER
 131154 //	NATURAL  INNER      -                 JT_NATURAL|JT_INNER
 131155 //	NATURAL  LEFT       -                 JT_NATURAL|JT_LEFT|JT_OUTER
 131156 //	NATURAL  LEFT     OUTER               JT_NATURAL|JT_LEFT|JT_OUTER
 131157 //	NATURAL  RIGHT      -                 JT_NATURAL|JT_RIGHT|JT_OUTER
 131158 //	NATURAL  RIGHT    OUTER               JT_NATURAL|JT_RIGHT|JT_OUTER
 131159 //	NATURAL  FULL       -                 JT_NATURAL|JT_LEFT|JT_RIGHT
 131160 //	NATURAL  FULL     OUTER               JT_NATRUAL|JT_LEFT|JT_RIGHT
 131161 //
 131162 // To preserve historical compatibly, SQLite also accepts a variety
 131163 // of other non-standard and in many cases non-sensical join types.
 131164 // This routine makes as much sense at it can from the nonsense join
 131165 // type and returns a result.  Examples of accepted nonsense join types
 131166 // include but are not limited to:
 131167 //
 131168 //	INNER CROSS JOIN        ->   same as JOIN
 131169 //	NATURAL CROSS JOIN      ->   same as NATURAL JOIN
 131170 //	OUTER LEFT JOIN         ->   same as LEFT JOIN
 131171 //	LEFT NATURAL JOIN       ->   same as NATURAL LEFT JOIN
 131172 //	LEFT RIGHT JOIN         ->   same as FULL JOIN
 131173 //	RIGHT OUTER FULL JOIN   ->   same as FULL JOIN
 131174 //	CROSS CROSS CROSS JOIN  ->   same as JOIN
 131175 //
 131176 // The only restrictions on the join type name are:
 131177 //
 131178 //   - "INNER" cannot appear together with "OUTER", "LEFT", "RIGHT",
 131179 //     or "FULL".
 131180 //
 131181 //   - "CROSS" cannot appear together with "OUTER", "LEFT", "RIGHT,
 131182 //     or "FULL".
 131183 //
 131184 //   - If "OUTER" is present then there must also be one of
 131185 //     "LEFT", "RIGHT", or "FULL"
 131186 func Xsqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC uintptr) int32 {
 131187 	bp := tls.Alloc(64)
 131188 	defer tls.Free(64)
 131189 
 131190 	var jointype int32 = 0
 131191 
 131192 	var p uintptr
 131193 	var i int32
 131194 	var j int32
 131195 	*(*uintptr)(unsafe.Pointer(bp + 40)) = pA
 131196 	*(*uintptr)(unsafe.Pointer(bp + 40 + 1*8)) = pB
 131197 	*(*uintptr)(unsafe.Pointer(bp + 40 + 2*8)) = pC
 131198 	for i = 0; i < 3 && *(*uintptr)(unsafe.Pointer(bp + 40 + uintptr(i)*8)) != 0; i++ {
 131199 		p = *(*uintptr)(unsafe.Pointer(bp + 40 + uintptr(i)*8))
 131200 		for j = 0; j < int32(uint64(unsafe.Sizeof(aKeyword))/uint64(unsafe.Sizeof(struct {
 131201 			Fi     U8
 131202 			FnChar U8
 131203 			Fcode  U8
 131204 		}{}))); j++ {
 131205 			if (*Token)(unsafe.Pointer(p)).Fn == uint32(aKeyword[j].FnChar) &&
 131206 				Xsqlite3_strnicmp(tls, (*Token)(unsafe.Pointer(p)).Fz, uintptr(unsafe.Pointer(&zKeyText))+uintptr(aKeyword[j].Fi), int32((*Token)(unsafe.Pointer(p)).Fn)) == 0 {
 131207 				jointype = jointype | int32(aKeyword[j].Fcode)
 131208 				break
 131209 			}
 131210 		}
 131211 
 131212 		if j >= int32(uint64(unsafe.Sizeof(aKeyword))/uint64(unsafe.Sizeof(struct {
 131213 			Fi     U8
 131214 			FnChar U8
 131215 			Fcode  U8
 131216 		}{}))) {
 131217 			jointype = jointype | JT_ERROR
 131218 			break
 131219 		}
 131220 	}
 131221 	if jointype&(JT_INNER|JT_OUTER) == JT_INNER|JT_OUTER || jointype&JT_ERROR != 0 || jointype&(JT_OUTER|JT_LEFT|JT_RIGHT) == JT_OUTER {
 131222 		var zSp1 uintptr = ts + 12272
 131223 		var zSp2 uintptr = ts + 12272
 131224 		if pB == uintptr(0) {
 131225 			zSp1++
 131226 		}
 131227 		if pC == uintptr(0) {
 131228 			zSp2++
 131229 		}
 131230 		Xsqlite3ErrorMsg(tls, pParse,
 131231 			ts+19900, libc.VaList(bp, pA, zSp1, pB, zSp2, pC))
 131232 		jointype = JT_INNER
 131233 	}
 131234 	return jointype
 131235 }
 131236 
 131237 var zKeyText = *(*[34]int8)(unsafe.Pointer(ts + 19930))
 131238 var aKeyword = [7]struct {
 131239 	Fi     U8
 131240 	FnChar U8
 131241 	Fcode  U8
 131242 }{
 131243 	{FnChar: U8(7), Fcode: U8(JT_NATURAL)},
 131244 	{Fi: U8(6), FnChar: U8(4), Fcode: U8(JT_LEFT | JT_OUTER)},
 131245 	{Fi: U8(10), FnChar: U8(5), Fcode: U8(JT_OUTER)},
 131246 	{Fi: U8(14), FnChar: U8(5), Fcode: U8(JT_RIGHT | JT_OUTER)},
 131247 	{Fi: U8(19), FnChar: U8(4), Fcode: U8(JT_LEFT | JT_RIGHT | JT_OUTER)},
 131248 	{Fi: U8(23), FnChar: U8(5), Fcode: U8(JT_INNER)},
 131249 	{Fi: U8(28), FnChar: U8(5), Fcode: U8(JT_INNER | JT_CROSS)},
 131250 }
 131251 
 131252 // Return the index of a column in a table.  Return -1 if the column
 131253 // is not contained in the table.
 131254 func Xsqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) int32 {
 131255 	var i int32
 131256 	var h U8 = Xsqlite3StrIHash(tls, zCol)
 131257 	var pCol uintptr
 131258 	pCol = (*Table)(unsafe.Pointer(pTab)).FaCol
 131259 	i = 0
 131260 __1:
 131261 	if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 131262 		goto __3
 131263 	}
 131264 	{
 131265 		if int32((*Column)(unsafe.Pointer(pCol)).FhName) == int32(h) && Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 {
 131266 			return i
 131267 		}
 131268 
 131269 	}
 131270 	goto __2
 131271 __2:
 131272 	pCol += 24
 131273 	i++
 131274 	goto __1
 131275 	goto __3
 131276 __3:
 131277 	;
 131278 	return -1
 131279 }
 131280 
 131281 // Mark a subquery result column as having been used.
 131282 func Xsqlite3SrcItemColumnUsed(tls *libc.TLS, pItem uintptr, iCol int32) {
 131283 	if uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x2000>>13)) != 0 {
 131284 		var pResults uintptr
 131285 
 131286 		pResults = (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FpEList
 131287 
 131288 		libc.SetBitFieldPtr16Uint32(pResults+8+uintptr(iCol)*32+16+4, uint32(1), 6, 0x40)
 131289 	}
 131290 }
 131291 
 131292 func tableAndColumnIndex(tls *libc.TLS, pSrc uintptr, iStart int32, iEnd int32, zCol uintptr, piTab uintptr, piCol uintptr, bIgnoreHidden int32) int32 {
 131293 	var i int32
 131294 	var iCol int32
 131295 
 131296 	for i = iStart; i <= iEnd; i++ {
 131297 		iCol = Xsqlite3ColumnIndex(tls, (*SrcItem)(unsafe.Pointer(pSrc+8+uintptr(i)*104)).FpTab, zCol)
 131298 		if iCol >= 0 &&
 131299 			(bIgnoreHidden == 0 || libc.Bool32(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc+8+uintptr(i)*104)).FpTab)).FaCol+uintptr(iCol)*24)).FcolFlags)&COLFLAG_HIDDEN != 0) == 0) {
 131300 			if piTab != 0 {
 131301 				Xsqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(i)*104, iCol)
 131302 				*(*int32)(unsafe.Pointer(piTab)) = i
 131303 				*(*int32)(unsafe.Pointer(piCol)) = iCol
 131304 			}
 131305 			return 1
 131306 		}
 131307 	}
 131308 	return 0
 131309 }
 131310 
 131311 // Set the EP_OuterON property on all terms of the given expression.
 131312 // And set the Expr.w.iJoin to iTable for every term in the
 131313 // expression.
 131314 //
 131315 // The EP_OuterON property is used on terms of an expression to tell
 131316 // the OUTER JOIN processing logic that this term is part of the
 131317 // join restriction specified in the ON or USING clause and not a part
 131318 // of the more general WHERE clause.  These terms are moved over to the
 131319 // WHERE clause during join processing but we need to remember that they
 131320 // originated in the ON or USING clause.
 131321 //
 131322 // The Expr.w.iJoin tells the WHERE clause processing that the
 131323 // expression depends on table w.iJoin even if that table is not
 131324 // explicitly mentioned in the expression.  That information is needed
 131325 // for cases like this:
 131326 //
 131327 //	SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.b AND t1.x=5
 131328 //
 131329 // The where clause needs to defer the handling of the t1.x=5
 131330 // term until after the t2 loop of the join.  In that way, a
 131331 // NULL t2 row will be inserted whenever t1.x!=5.  If we do not
 131332 // defer the handling of t1.x=5, it will be processed immediately
 131333 // after the t1 loop and rows with t1.x!=5 will never appear in
 131334 // the output, which is incorrect.
 131335 func Xsqlite3SetJoinExpr(tls *libc.TLS, p uintptr, iTable int32, joinFlag U32) {
 131336 	for p != 0 {
 131337 		*(*U32)(unsafe.Pointer(p + 4)) |= joinFlag
 131338 
 131339 		*(*int32)(unsafe.Pointer(p + 52)) = iTable
 131340 		if int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_FUNCTION {
 131341 			if *(*uintptr)(unsafe.Pointer(p + 32)) != 0 {
 131342 				var i int32
 131343 				for i = 0; i < (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32)))).FnExpr; i++ {
 131344 					Xsqlite3SetJoinExpr(tls, (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32))+8+uintptr(i)*32)).FpExpr, iTable, joinFlag)
 131345 				}
 131346 			}
 131347 		}
 131348 		Xsqlite3SetJoinExpr(tls, (*Expr)(unsafe.Pointer(p)).FpLeft, iTable, joinFlag)
 131349 		p = (*Expr)(unsafe.Pointer(p)).FpRight
 131350 	}
 131351 }
 131352 
 131353 func unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32, nullable int32) {
 131354 	for p != 0 {
 131355 		if iTable < 0 || (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_OuterON) != U32(0) && *(*int32)(unsafe.Pointer(p + 52)) == iTable {
 131356 			*(*U32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(libc.CplInt32(EP_OuterON | EP_InnerON))
 131357 			if iTable >= 0 {
 131358 				*(*U32)(unsafe.Pointer(p + 4)) |= U32(EP_InnerON)
 131359 			}
 131360 		}
 131361 		if int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN && (*Expr)(unsafe.Pointer(p)).FiTable == iTable && !(nullable != 0) {
 131362 			*(*U32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(libc.CplInt32(EP_CanBeNull))
 131363 		}
 131364 		if int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_FUNCTION {
 131365 			if *(*uintptr)(unsafe.Pointer(p + 32)) != 0 {
 131366 				var i int32
 131367 				for i = 0; i < (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32)))).FnExpr; i++ {
 131368 					unsetJoinExpr(tls, (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32))+8+uintptr(i)*32)).FpExpr, iTable, nullable)
 131369 				}
 131370 			}
 131371 		}
 131372 		unsetJoinExpr(tls, (*Expr)(unsafe.Pointer(p)).FpLeft, iTable, nullable)
 131373 		p = (*Expr)(unsafe.Pointer(p)).FpRight
 131374 	}
 131375 }
 131376 
 131377 func sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) int32 {
 131378 	bp := tls.Alloc(32)
 131379 	defer tls.Free(32)
 131380 
 131381 	var pSrc uintptr
 131382 	var i int32
 131383 	var j int32
 131384 	var pLeft uintptr
 131385 	var pRight uintptr
 131386 
 131387 	pSrc = (*Select)(unsafe.Pointer(p)).FpSrc
 131388 	pLeft = pSrc + 8
 131389 	pRight = pLeft + 1*104
 131390 	i = 0
 131391 __1:
 131392 	if !(i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc-1) {
 131393 		goto __3
 131394 	}
 131395 	{
 131396 		var pRightTab uintptr = (*SrcItem)(unsafe.Pointer(pRight)).FpTab
 131397 		var joinType U32
 131398 
 131399 		if (*SrcItem)(unsafe.Pointer(pLeft)).FpTab == uintptr(0) || pRightTab == uintptr(0) {
 131400 			goto __2
 131401 		}
 131402 		if int32((*SrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&JT_OUTER != 0 {
 131403 			joinType = uint32(EP_OuterON)
 131404 		} else {
 131405 			joinType = uint32(EP_InnerON)
 131406 		}
 131407 
 131408 		if int32((*SrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&JT_NATURAL != 0 {
 131409 			var pUsing uintptr = uintptr(0)
 131410 			if uint32(int32(*(*uint16)(unsafe.Pointer(pRight + 60 + 4))&0x400>>10)) != 0 || *(*uintptr)(unsafe.Pointer(pRight + 72)) != 0 {
 131411 				Xsqlite3ErrorMsg(tls, pParse,
 131412 					ts+19964, libc.VaList(bp, 0))
 131413 				return 1
 131414 			}
 131415 			for j = 0; j < int32((*Table)(unsafe.Pointer(pRightTab)).FnCol); j++ {
 131416 				var zName uintptr
 131417 
 131418 				if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pRightTab)).FaCol+uintptr(j)*24)).FcolFlags)&COLFLAG_HIDDEN != 0 {
 131419 					continue
 131420 				}
 131421 				zName = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pRightTab)).FaCol + uintptr(j)*24)).FzCnName
 131422 				if tableAndColumnIndex(tls, pSrc, 0, i, zName, uintptr(0), uintptr(0), 1) != 0 {
 131423 					pUsing = Xsqlite3IdListAppend(tls, pParse, pUsing, uintptr(0))
 131424 					if pUsing != 0 {
 131425 						(*IdList_item)(unsafe.Pointer(pUsing + 8 + uintptr((*IdList)(unsafe.Pointer(pUsing)).FnId-1)*16)).FzName = Xsqlite3DbStrDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, zName)
 131426 					}
 131427 				}
 131428 			}
 131429 			if pUsing != 0 {
 131430 				libc.SetBitFieldPtr16Uint32(pRight+60+4, uint32(1), 10, 0x400)
 131431 				libc.SetBitFieldPtr16Uint32(pRight+60+4, uint32(1), 12, 0x1000)
 131432 				*(*uintptr)(unsafe.Pointer(pRight + 72)) = pUsing
 131433 			}
 131434 			if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 131435 				return 1
 131436 			}
 131437 		}
 131438 
 131439 		if uint32(int32(*(*uint16)(unsafe.Pointer(pRight + 60 + 4))&0x400>>10)) != 0 {
 131440 			var pList uintptr = *(*uintptr)(unsafe.Pointer(pRight + 72))
 131441 			var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 131442 
 131443 			for j = 0; j < (*IdList)(unsafe.Pointer(pList)).FnId; j++ {
 131444 				var zName uintptr
 131445 
 131446 				var iRightCol int32
 131447 				var pE1 uintptr
 131448 				var pE2 uintptr
 131449 				var pEq uintptr
 131450 
 131451 				zName = (*IdList_item)(unsafe.Pointer(pList + 8 + uintptr(j)*16)).FzName
 131452 				iRightCol = Xsqlite3ColumnIndex(tls, pRightTab, zName)
 131453 				if iRightCol < 0 ||
 131454 					tableAndColumnIndex(tls, pSrc, 0, i, zName, bp+24, bp+28,
 131455 						int32(*(*uint16)(unsafe.Pointer(pRight + 60 + 4))&0x1000>>12)) == 0 {
 131456 					Xsqlite3ErrorMsg(tls, pParse,
 131457 						ts+20014, libc.VaList(bp+8, zName))
 131458 					return 1
 131459 				}
 131460 				pE1 = Xsqlite3CreateColumnExpr(tls, db, pSrc, *(*int32)(unsafe.Pointer(bp + 24)), *(*int32)(unsafe.Pointer(bp + 28)))
 131461 				Xsqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(*(*int32)(unsafe.Pointer(bp + 24)))*104, *(*int32)(unsafe.Pointer(bp + 28)))
 131462 				if int32((*SrcItem)(unsafe.Pointer(pSrc+8)).Ffg.Fjointype)&JT_LTORJ != 0 {
 131463 					var pFuncArgs uintptr = uintptr(0)
 131464 					for tableAndColumnIndex(tls, pSrc, *(*int32)(unsafe.Pointer(bp + 24))+1, i, zName, bp+24, bp+28,
 131465 						int32(*(*uint16)(unsafe.Pointer(pRight + 60 + 4))&0x1000>>12)) != 0 {
 131466 						if int32(*(*uint16)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp + 24)))*104 + 60 + 4))&0x400>>10) == 0 ||
 131467 							Xsqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp + 24)))*104 + 72)), zName) < 0 {
 131468 							Xsqlite3ErrorMsg(tls, pParse, ts+20078,
 131469 								libc.VaList(bp+16, zName))
 131470 							break
 131471 						}
 131472 						pFuncArgs = Xsqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1)
 131473 						pE1 = Xsqlite3CreateColumnExpr(tls, db, pSrc, *(*int32)(unsafe.Pointer(bp + 24)), *(*int32)(unsafe.Pointer(bp + 28)))
 131474 						Xsqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(*(*int32)(unsafe.Pointer(bp + 24)))*104, *(*int32)(unsafe.Pointer(bp + 28)))
 131475 					}
 131476 					if pFuncArgs != 0 {
 131477 						pFuncArgs = Xsqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1)
 131478 						pE1 = Xsqlite3ExprFunction(tls, pParse, pFuncArgs, uintptr(unsafe.Pointer(&tkCoalesce)), 0)
 131479 					}
 131480 				}
 131481 				pE2 = Xsqlite3CreateColumnExpr(tls, db, pSrc, i+1, iRightCol)
 131482 				Xsqlite3SrcItemColumnUsed(tls, pRight, iRightCol)
 131483 				pEq = Xsqlite3PExpr(tls, pParse, TK_EQ, pE1, pE2)
 131484 
 131485 				if pEq != 0 {
 131486 					*(*U32)(unsafe.Pointer(pEq + 4)) |= joinType
 131487 
 131488 					*(*int32)(unsafe.Pointer(pEq + 52)) = (*Expr)(unsafe.Pointer(pE2)).FiTable
 131489 				}
 131490 				(*Select)(unsafe.Pointer(p)).FpWhere = Xsqlite3ExprAnd(tls, pParse, (*Select)(unsafe.Pointer(p)).FpWhere, pEq)
 131491 			}
 131492 		} else if *(*uintptr)(unsafe.Pointer(pRight + 72)) != 0 {
 131493 			Xsqlite3SetJoinExpr(tls, *(*uintptr)(unsafe.Pointer(pRight + 72)), (*SrcItem)(unsafe.Pointer(pRight)).FiCursor, joinType)
 131494 			(*Select)(unsafe.Pointer(p)).FpWhere = Xsqlite3ExprAnd(tls, pParse, (*Select)(unsafe.Pointer(p)).FpWhere, *(*uintptr)(unsafe.Pointer(pRight + 72)))
 131495 			*(*uintptr)(unsafe.Pointer(pRight + 72)) = uintptr(0)
 131496 			libc.SetBitFieldPtr16Uint32(pRight+60+4, uint32(1), 11, 0x800)
 131497 		}
 131498 
 131499 	}
 131500 	goto __2
 131501 __2:
 131502 	i++
 131503 	pRight += 104
 131504 	pLeft += 104
 131505 	goto __1
 131506 	goto __3
 131507 __3:
 131508 	;
 131509 	return 0
 131510 }
 131511 
 131512 var tkCoalesce = Token{Fz: ts + 7938, Fn: uint32(8)}
 131513 
 131514 // An instance of this object holds information (beyond pParse and pSelect)
 131515 // needed to load the next result row that is to be added to the sorter.
 131516 type RowLoadInfo = RowLoadInfo1
 131517 
 131518 func innerLoopLoadRow(tls *libc.TLS, pParse uintptr, pSelect uintptr, pInfo uintptr) {
 131519 	Xsqlite3ExprCodeExprList(tls, pParse, (*Select)(unsafe.Pointer(pSelect)).FpEList, (*RowLoadInfo)(unsafe.Pointer(pInfo)).FregResult,
 131520 		0, (*RowLoadInfo)(unsafe.Pointer(pInfo)).FecelFlags)
 131521 }
 131522 
 131523 func makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintptr, regBase int32, nBase int32) int32 {
 131524 	var nOBSat int32 = (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat
 131525 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 131526 	var regOut int32 = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 131527 	if (*SortCtx)(unsafe.Pointer(pSort)).FpDeferredRowLoad != 0 {
 131528 		innerLoopLoadRow(tls, pParse, pSelect, (*SortCtx)(unsafe.Pointer(pSort)).FpDeferredRowLoad)
 131529 	}
 131530 	Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regBase+nOBSat, nBase-nOBSat, regOut)
 131531 	return regOut
 131532 }
 131533 
 131534 func pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintptr, regData int32, regOrigData int32, nData int32, nPrefixReg int32) {
 131535 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 131536 	var bSeq int32 = libc.Bool32(int32((*SortCtx)(unsafe.Pointer(pSort)).FsortFlags)&SORTFLAG_UseSorter == 0)
 131537 	var nExpr int32 = (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy)).FnExpr
 131538 	var nBase int32 = nExpr + bSeq + nData
 131539 	var regBase int32
 131540 	var regRecord int32 = 0
 131541 	var nOBSat int32 = (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat
 131542 	var op int32
 131543 	var iLimit int32
 131544 	var iSkip int32 = 0
 131545 
 131546 	if nPrefixReg != 0 {
 131547 		regBase = regData - nPrefixReg
 131548 	} else {
 131549 		regBase = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 131550 		*(*int32)(unsafe.Pointer(pParse + 56)) += nBase
 131551 	}
 131552 
 131553 	if (*Select)(unsafe.Pointer(pSelect)).FiOffset != 0 {
 131554 		iLimit = (*Select)(unsafe.Pointer(pSelect)).FiOffset + 1
 131555 	} else {
 131556 		iLimit = (*Select)(unsafe.Pointer(pSelect)).FiLimit
 131557 	}
 131558 	(*SortCtx)(unsafe.Pointer(pSort)).FlabelDone = Xsqlite3VdbeMakeLabel(tls, pParse)
 131559 	Xsqlite3ExprCodeExprList(tls, pParse, (*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy, regBase, regOrigData,
 131560 		uint8(SQLITE_ECEL_DUP|func() int32 {
 131561 			if regOrigData != 0 {
 131562 				return SQLITE_ECEL_REF
 131563 			}
 131564 			return 0
 131565 		}()))
 131566 	if bSeq != 0 {
 131567 		Xsqlite3VdbeAddOp2(tls, v, OP_Sequence, (*SortCtx)(unsafe.Pointer(pSort)).FiECursor, regBase+nExpr)
 131568 	}
 131569 	if nPrefixReg == 0 && nData > 0 {
 131570 		Xsqlite3ExprCodeMove(tls, pParse, regData, regBase+nExpr+bSeq, nData)
 131571 	}
 131572 	if nOBSat > 0 {
 131573 		var regPrevKey int32
 131574 		var addrFirst int32
 131575 		var addrJmp int32
 131576 		var pOp uintptr
 131577 		var nKey int32
 131578 		var pKI uintptr
 131579 
 131580 		regRecord = makeSorterRecord(tls, pParse, pSort, pSelect, regBase, nBase)
 131581 		regPrevKey = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 131582 		*(*int32)(unsafe.Pointer(pParse + 56)) += (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat
 131583 		nKey = nExpr - (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat + bSeq
 131584 		if bSeq != 0 {
 131585 			addrFirst = Xsqlite3VdbeAddOp1(tls, v, OP_IfNot, regBase+nExpr)
 131586 		} else {
 131587 			addrFirst = Xsqlite3VdbeAddOp1(tls, v, OP_SequenceTest, (*SortCtx)(unsafe.Pointer(pSort)).FiECursor)
 131588 		}
 131589 
 131590 		Xsqlite3VdbeAddOp3(tls, v, OP_Compare, regPrevKey, regBase, (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat)
 131591 		pOp = Xsqlite3VdbeGetOp(tls, v, (*SortCtx)(unsafe.Pointer(pSort)).FaddrSortIndex)
 131592 		if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 {
 131593 			return
 131594 		}
 131595 		(*VdbeOp)(unsafe.Pointer(pOp)).Fp2 = nKey + nData
 131596 		pKI = *(*uintptr)(unsafe.Pointer(pOp + 16))
 131597 		libc.Xmemset(tls, (*KeyInfo)(unsafe.Pointer(pKI)).FaSortFlags, 0, uint64((*KeyInfo)(unsafe.Pointer(pKI)).FnKeyField))
 131598 		Xsqlite3VdbeChangeP4(tls, v, -1, pKI, -8)
 131599 
 131600 		*(*uintptr)(unsafe.Pointer(pOp + 16)) = Xsqlite3KeyInfoFromExprList(tls, pParse, (*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy, nOBSat,
 131601 			int32((*KeyInfo)(unsafe.Pointer(pKI)).FnAllField)-int32((*KeyInfo)(unsafe.Pointer(pKI)).FnKeyField)-1)
 131602 		pOp = uintptr(0)
 131603 		addrJmp = Xsqlite3VdbeCurrentAddr(tls, v)
 131604 		Xsqlite3VdbeAddOp3(tls, v, OP_Jump, addrJmp+1, 0, addrJmp+1)
 131605 		(*SortCtx)(unsafe.Pointer(pSort)).FlabelBkOut = Xsqlite3VdbeMakeLabel(tls, pParse)
 131606 		(*SortCtx)(unsafe.Pointer(pSort)).FregReturn = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 131607 		Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, (*SortCtx)(unsafe.Pointer(pSort)).FregReturn, (*SortCtx)(unsafe.Pointer(pSort)).FlabelBkOut)
 131608 		Xsqlite3VdbeAddOp1(tls, v, OP_ResetSorter, (*SortCtx)(unsafe.Pointer(pSort)).FiECursor)
 131609 		if iLimit != 0 {
 131610 			Xsqlite3VdbeAddOp2(tls, v, OP_IfNot, iLimit, (*SortCtx)(unsafe.Pointer(pSort)).FlabelDone)
 131611 
 131612 		}
 131613 		Xsqlite3VdbeJumpHere(tls, v, addrFirst)
 131614 		Xsqlite3ExprCodeMove(tls, pParse, regBase, regPrevKey, (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat)
 131615 		Xsqlite3VdbeJumpHere(tls, v, addrJmp)
 131616 	}
 131617 	if iLimit != 0 {
 131618 		var iCsr int32 = (*SortCtx)(unsafe.Pointer(pSort)).FiECursor
 131619 		Xsqlite3VdbeAddOp2(tls, v, OP_IfNotZero, iLimit, Xsqlite3VdbeCurrentAddr(tls, v)+4)
 131620 
 131621 		Xsqlite3VdbeAddOp2(tls, v, OP_Last, iCsr, 0)
 131622 		iSkip = Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxLE,
 131623 			iCsr, 0, regBase+nOBSat, nExpr-nOBSat)
 131624 
 131625 		Xsqlite3VdbeAddOp1(tls, v, OP_Delete, iCsr)
 131626 	}
 131627 	if regRecord == 0 {
 131628 		regRecord = makeSorterRecord(tls, pParse, pSort, pSelect, regBase, nBase)
 131629 	}
 131630 	if int32((*SortCtx)(unsafe.Pointer(pSort)).FsortFlags)&SORTFLAG_UseSorter != 0 {
 131631 		op = OP_SorterInsert
 131632 	} else {
 131633 		op = OP_IdxInsert
 131634 	}
 131635 	Xsqlite3VdbeAddOp4Int(tls, v, op, (*SortCtx)(unsafe.Pointer(pSort)).FiECursor, regRecord,
 131636 		regBase+nOBSat, nBase-nOBSat)
 131637 	if iSkip != 0 {
 131638 		Xsqlite3VdbeChangeP2(tls, v, iSkip,
 131639 			func() int32 {
 131640 				if (*SortCtx)(unsafe.Pointer(pSort)).FlabelOBLopt != 0 {
 131641 					return (*SortCtx)(unsafe.Pointer(pSort)).FlabelOBLopt
 131642 				}
 131643 				return Xsqlite3VdbeCurrentAddr(tls, v)
 131644 			}())
 131645 	}
 131646 }
 131647 
 131648 func codeOffset(tls *libc.TLS, v uintptr, iOffset int32, iContinue int32) {
 131649 	if iOffset > 0 {
 131650 		Xsqlite3VdbeAddOp3(tls, v, OP_IfPos, iOffset, iContinue, 1)
 131651 
 131652 	}
 131653 }
 131654 
 131655 func codeDistinct(tls *libc.TLS, pParse uintptr, eTnctType int32, iTab int32, addrRepeat int32, pEList uintptr, regElem int32) int32 {
 131656 	var iRet int32 = 0
 131657 	var nResultCol int32 = (*ExprList)(unsafe.Pointer(pEList)).FnExpr
 131658 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 131659 
 131660 	switch eTnctType {
 131661 	case WHERE_DISTINCT_ORDERED:
 131662 		{
 131663 			var i int32
 131664 			var iJump int32
 131665 			var regPrev int32
 131666 
 131667 			iRet = libc.AssignInt32(&regPrev, (*Parse)(unsafe.Pointer(pParse)).FnMem+1)
 131668 			*(*int32)(unsafe.Pointer(pParse + 56)) += nResultCol
 131669 
 131670 			iJump = Xsqlite3VdbeCurrentAddr(tls, v) + nResultCol
 131671 			for i = 0; i < nResultCol; i++ {
 131672 				var pColl uintptr = Xsqlite3ExprCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer(pEList+8+uintptr(i)*32)).FpExpr)
 131673 				if i < nResultCol-1 {
 131674 					Xsqlite3VdbeAddOp3(tls, v, OP_Ne, regElem+i, iJump, regPrev+i)
 131675 
 131676 				} else {
 131677 					Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regElem+i, addrRepeat, regPrev+i)
 131678 
 131679 				}
 131680 				Xsqlite3VdbeChangeP4(tls, v, -1, pColl, -2)
 131681 				Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NULLEQ))
 131682 			}
 131683 
 131684 			Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regElem, regPrev, nResultCol-1)
 131685 			break
 131686 
 131687 		}
 131688 
 131689 	case WHERE_DISTINCT_UNIQUE:
 131690 		{
 131691 			break
 131692 
 131693 		}
 131694 
 131695 	default:
 131696 		{
 131697 			var r1 int32 = Xsqlite3GetTempReg(tls, pParse)
 131698 			Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, iTab, addrRepeat, regElem, nResultCol)
 131699 
 131700 			Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regElem, nResultCol, r1)
 131701 			Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iTab, r1, regElem, nResultCol)
 131702 			Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT))
 131703 			Xsqlite3ReleaseTempReg(tls, pParse, r1)
 131704 			iRet = iTab
 131705 			break
 131706 
 131707 		}
 131708 	}
 131709 
 131710 	return iRet
 131711 }
 131712 
 131713 func fixDistinctOpenEph(tls *libc.TLS, pParse uintptr, eTnctType int32, iVal int32, iOpenEphAddr int32) {
 131714 	if (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 &&
 131715 		(eTnctType == WHERE_DISTINCT_UNIQUE || eTnctType == WHERE_DISTINCT_ORDERED) {
 131716 		var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 131717 		Xsqlite3VdbeChangeToNoop(tls, v, iOpenEphAddr)
 131718 		if int32((*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, v, iOpenEphAddr+1))).Fopcode) == OP_Explain {
 131719 			Xsqlite3VdbeChangeToNoop(tls, v, iOpenEphAddr+1)
 131720 		}
 131721 		if eTnctType == WHERE_DISTINCT_ORDERED {
 131722 			var pOp uintptr = Xsqlite3VdbeGetOp(tls, v, iOpenEphAddr)
 131723 			(*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Null)
 131724 			(*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = 1
 131725 			(*VdbeOp)(unsafe.Pointer(pOp)).Fp2 = iVal
 131726 		}
 131727 	}
 131728 }
 131729 
 131730 func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSort uintptr, pDistinct uintptr, pDest uintptr, iContinue int32, iBreak int32) {
 131731 	bp := tls.Alloc(8)
 131732 	defer tls.Free(8)
 131733 
 131734 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 131735 	var i int32
 131736 	var hasDistinct int32
 131737 	var eDest int32 = int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest)
 131738 	var iParm int32 = (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm
 131739 	var nResultCol int32
 131740 	var nPrefixReg int32 = 0
 131741 
 131742 	var regResult int32
 131743 	var regOrig int32
 131744 
 131745 	if pDistinct != 0 {
 131746 		hasDistinct = int32((*DistinctCtx)(unsafe.Pointer(pDistinct)).FeTnctType)
 131747 	} else {
 131748 		hasDistinct = WHERE_DISTINCT_NOOP
 131749 	}
 131750 	if pSort != 0 && (*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy == uintptr(0) {
 131751 		pSort = uintptr(0)
 131752 	}
 131753 	if pSort == uintptr(0) && !(hasDistinct != 0) {
 131754 		codeOffset(tls, v, (*Select)(unsafe.Pointer(p)).FiOffset, iContinue)
 131755 	}
 131756 
 131757 	nResultCol = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr
 131758 
 131759 	if (*SelectDest)(unsafe.Pointer(pDest)).FiSdst == 0 {
 131760 		if pSort != 0 {
 131761 			nPrefixReg = (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy)).FnExpr
 131762 			if !(int32((*SortCtx)(unsafe.Pointer(pSort)).FsortFlags)&SORTFLAG_UseSorter != 0) {
 131763 				nPrefixReg++
 131764 			}
 131765 			*(*int32)(unsafe.Pointer(pParse + 56)) += nPrefixReg
 131766 		}
 131767 		(*SelectDest)(unsafe.Pointer(pDest)).FiSdst = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 131768 		*(*int32)(unsafe.Pointer(pParse + 56)) += nResultCol
 131769 	} else if (*SelectDest)(unsafe.Pointer(pDest)).FiSdst+nResultCol > (*Parse)(unsafe.Pointer(pParse)).FnMem {
 131770 		*(*int32)(unsafe.Pointer(pParse + 56)) += nResultCol
 131771 	}
 131772 	(*SelectDest)(unsafe.Pointer(pDest)).FnSdst = nResultCol
 131773 	regOrig = libc.AssignInt32(&regResult, (*SelectDest)(unsafe.Pointer(pDest)).FiSdst)
 131774 	if srcTab >= 0 {
 131775 		for i = 0; i < nResultCol; i++ {
 131776 			Xsqlite3VdbeAddOp3(tls, v, OP_Column, srcTab, i, regResult+i)
 131777 
 131778 		}
 131779 	} else if eDest != SRT_Exists {
 131780 		var ecelFlags U8
 131781 		var pEList uintptr
 131782 		if eDest == SRT_Mem || eDest == SRT_Output || eDest == SRT_Coroutine {
 131783 			ecelFlags = U8(SQLITE_ECEL_DUP)
 131784 		} else {
 131785 			ecelFlags = U8(0)
 131786 		}
 131787 		if pSort != 0 && hasDistinct == 0 && eDest != SRT_EphemTab && eDest != SRT_Table {
 131788 			ecelFlags = U8(int32(ecelFlags) | (SQLITE_ECEL_OMITREF | SQLITE_ECEL_REF))
 131789 
 131790 			for i = (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat; i < (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy)).FnExpr; i++ {
 131791 				var j int32
 131792 				if libc.AssignInt32(&j, int32(*(*U16)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy + 8 + uintptr(i)*32 + 24)))) > 0 {
 131793 					*(*U16)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList + 8 + uintptr(j-1)*32 + 24)) = U16(i + 1 - (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat)
 131794 				}
 131795 			}
 131796 
 131797 			pEList = (*Select)(unsafe.Pointer(p)).FpEList
 131798 			for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ {
 131799 				if int32(*(*U16)(unsafe.Pointer(pEList + 8 + uintptr(i)*32 + 24))) > 0 {
 131800 					nResultCol--
 131801 					regOrig = 0
 131802 				}
 131803 			}
 131804 
 131805 		}
 131806 		(*RowLoadInfo)(unsafe.Pointer(bp)).FregResult = regResult
 131807 		(*RowLoadInfo)(unsafe.Pointer(bp)).FecelFlags = ecelFlags
 131808 		if (*Select)(unsafe.Pointer(p)).FiLimit != 0 &&
 131809 			int32(ecelFlags)&SQLITE_ECEL_OMITREF != 0 &&
 131810 			nPrefixReg > 0 {
 131811 			(*SortCtx)(unsafe.Pointer(pSort)).FpDeferredRowLoad = bp
 131812 			regOrig = 0
 131813 		} else {
 131814 			innerLoopLoadRow(tls, pParse, p, bp)
 131815 		}
 131816 	}
 131817 
 131818 	if hasDistinct != 0 {
 131819 		var eType int32 = int32((*DistinctCtx)(unsafe.Pointer(pDistinct)).FeTnctType)
 131820 		var iTab int32 = (*DistinctCtx)(unsafe.Pointer(pDistinct)).FtabTnct
 131821 
 131822 		iTab = codeDistinct(tls, pParse, eType, iTab, iContinue, (*Select)(unsafe.Pointer(p)).FpEList, regResult)
 131823 		fixDistinctOpenEph(tls, pParse, eType, iTab, (*DistinctCtx)(unsafe.Pointer(pDistinct)).FaddrTnct)
 131824 		if pSort == uintptr(0) {
 131825 			codeOffset(tls, v, (*Select)(unsafe.Pointer(p)).FiOffset, iContinue)
 131826 		}
 131827 	}
 131828 
 131829 	switch eDest {
 131830 	case SRT_Union:
 131831 		{
 131832 			var r1 int32
 131833 			r1 = Xsqlite3GetTempReg(tls, pParse)
 131834 			Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regResult, nResultCol, r1)
 131835 			Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iParm, r1, regResult, nResultCol)
 131836 			Xsqlite3ReleaseTempReg(tls, pParse, r1)
 131837 			break
 131838 
 131839 		}
 131840 
 131841 	case SRT_Except:
 131842 		{
 131843 			Xsqlite3VdbeAddOp3(tls, v, OP_IdxDelete, iParm, regResult, nResultCol)
 131844 			break
 131845 
 131846 		}
 131847 
 131848 	case SRT_Fifo:
 131849 		fallthrough
 131850 	case SRT_DistFifo:
 131851 		fallthrough
 131852 	case SRT_Table:
 131853 		fallthrough
 131854 	case SRT_EphemTab:
 131855 		{
 131856 			var r1 int32 = Xsqlite3GetTempRange(tls, pParse, nPrefixReg+1)
 131857 
 131858 			Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regResult, nResultCol, r1+nPrefixReg)
 131859 			if eDest == SRT_DistFifo {
 131860 				var addr int32 = Xsqlite3VdbeCurrentAddr(tls, v) + 4
 131861 				Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, iParm+1, addr, r1, 0)
 131862 
 131863 				Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iParm+1, r1, regResult, nResultCol)
 131864 
 131865 			}
 131866 			if pSort != 0 {
 131867 				pushOntoSorter(tls, pParse, pSort, p, r1+nPrefixReg, regOrig, 1, nPrefixReg)
 131868 			} else {
 131869 				var r2 int32 = Xsqlite3GetTempReg(tls, pParse)
 131870 				Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iParm, r2)
 131871 				Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iParm, r1, r2)
 131872 				Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND))
 131873 				Xsqlite3ReleaseTempReg(tls, pParse, r2)
 131874 			}
 131875 			Xsqlite3ReleaseTempRange(tls, pParse, r1, nPrefixReg+1)
 131876 			break
 131877 
 131878 		}
 131879 
 131880 	case SRT_Upfrom:
 131881 		{
 131882 			if pSort != 0 {
 131883 				pushOntoSorter(tls,
 131884 					pParse, pSort, p, regResult, regOrig, nResultCol, nPrefixReg)
 131885 			} else {
 131886 				var i2 int32 = (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm2
 131887 				var r1 int32 = Xsqlite3GetTempReg(tls, pParse)
 131888 
 131889 				Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, regResult, iBreak)
 131890 
 131891 				Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord,
 131892 					regResult+libc.Bool32(i2 < 0), nResultCol-libc.Bool32(i2 < 0), r1)
 131893 				if i2 < 0 {
 131894 					Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iParm, r1, regResult)
 131895 				} else {
 131896 					Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iParm, r1, regResult, i2)
 131897 				}
 131898 			}
 131899 			break
 131900 
 131901 		}
 131902 
 131903 	case SRT_Set:
 131904 		{
 131905 			if pSort != 0 {
 131906 				pushOntoSorter(tls,
 131907 					pParse, pSort, p, regResult, regOrig, nResultCol, nPrefixReg)
 131908 			} else {
 131909 				var r1 int32 = Xsqlite3GetTempReg(tls, pParse)
 131910 
 131911 				Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, regResult, nResultCol,
 131912 					r1, (*SelectDest)(unsafe.Pointer(pDest)).FzAffSdst, nResultCol)
 131913 				Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iParm, r1, regResult, nResultCol)
 131914 				Xsqlite3ReleaseTempReg(tls, pParse, r1)
 131915 			}
 131916 			break
 131917 
 131918 		}
 131919 
 131920 	case SRT_Exists:
 131921 		{
 131922 			Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, iParm)
 131923 
 131924 			break
 131925 
 131926 		}
 131927 
 131928 	case SRT_Mem:
 131929 		{
 131930 			if pSort != 0 {
 131931 				pushOntoSorter(tls,
 131932 					pParse, pSort, p, regResult, regOrig, nResultCol, nPrefixReg)
 131933 			} else {
 131934 			}
 131935 			break
 131936 
 131937 		}
 131938 
 131939 	case SRT_Coroutine:
 131940 		fallthrough
 131941 	case SRT_Output:
 131942 		{
 131943 			if pSort != 0 {
 131944 				pushOntoSorter(tls, pParse, pSort, p, regResult, regOrig, nResultCol,
 131945 					nPrefixReg)
 131946 			} else if eDest == SRT_Coroutine {
 131947 				Xsqlite3VdbeAddOp1(tls, v, OP_Yield, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm)
 131948 			} else {
 131949 				Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, regResult, nResultCol)
 131950 			}
 131951 			break
 131952 
 131953 		}
 131954 
 131955 	case SRT_DistQueue:
 131956 		fallthrough
 131957 	case SRT_Queue:
 131958 		{
 131959 			var nKey int32
 131960 			var r1 int32
 131961 			var r2 int32
 131962 			var r3 int32
 131963 			var addrTest int32 = 0
 131964 			var pSO uintptr
 131965 			pSO = (*SelectDest)(unsafe.Pointer(pDest)).FpOrderBy
 131966 
 131967 			nKey = (*ExprList)(unsafe.Pointer(pSO)).FnExpr
 131968 			r1 = Xsqlite3GetTempReg(tls, pParse)
 131969 			r2 = Xsqlite3GetTempRange(tls, pParse, nKey+2)
 131970 			r3 = r2 + nKey + 1
 131971 			if eDest == SRT_DistQueue {
 131972 				addrTest = Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, iParm+1, 0,
 131973 					regResult, nResultCol)
 131974 
 131975 			}
 131976 			Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regResult, nResultCol, r3)
 131977 			if eDest == SRT_DistQueue {
 131978 				Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, iParm+1, r3)
 131979 				Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT))
 131980 			}
 131981 			for i = 0; i < nKey; i++ {
 131982 				Xsqlite3VdbeAddOp2(tls, v, OP_SCopy,
 131983 					regResult+int32(*(*U16)(unsafe.Pointer(pSO + 8 + uintptr(i)*32 + 24)))-1,
 131984 					r2+i)
 131985 			}
 131986 			Xsqlite3VdbeAddOp2(tls, v, OP_Sequence, iParm, r2+nKey)
 131987 			Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, r2, nKey+2, r1)
 131988 			Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iParm, r1, r2, nKey+2)
 131989 			if addrTest != 0 {
 131990 				Xsqlite3VdbeJumpHere(tls, v, addrTest)
 131991 			}
 131992 			Xsqlite3ReleaseTempReg(tls, pParse, r1)
 131993 			Xsqlite3ReleaseTempRange(tls, pParse, r2, nKey+2)
 131994 			break
 131995 
 131996 		}
 131997 
 131998 	default:
 131999 		{
 132000 			break
 132001 
 132002 		}
 132003 	}
 132004 
 132005 	if pSort == uintptr(0) && (*Select)(unsafe.Pointer(p)).FiLimit != 0 {
 132006 		Xsqlite3VdbeAddOp2(tls, v, OP_DecrJumpZero, (*Select)(unsafe.Pointer(p)).FiLimit, iBreak)
 132007 	}
 132008 }
 132009 
 132010 // Allocate a KeyInfo object sufficient for an index of N key columns and
 132011 // X extra columns.
 132012 func Xsqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) uintptr {
 132013 	var nExtra int32 = int32(uint64(N+X)*(uint64(unsafe.Sizeof(uintptr(0)))+uint64(1)) - uint64(unsafe.Sizeof(uintptr(0))))
 132014 	var p uintptr = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(KeyInfo{}))+uint64(nExtra))
 132015 	if p != 0 {
 132016 		(*KeyInfo)(unsafe.Pointer(p)).FaSortFlags = p + 32 + uintptr(N+X)*8
 132017 		(*KeyInfo)(unsafe.Pointer(p)).FnKeyField = U16(N)
 132018 		(*KeyInfo)(unsafe.Pointer(p)).FnAllField = U16(N + X)
 132019 		(*KeyInfo)(unsafe.Pointer(p)).Fenc = (*Sqlite3)(unsafe.Pointer(db)).Fenc
 132020 		(*KeyInfo)(unsafe.Pointer(p)).Fdb = db
 132021 		(*KeyInfo)(unsafe.Pointer(p)).FnRef = U32(1)
 132022 		libc.Xmemset(tls, p+1*40, 0, uint64(nExtra))
 132023 	} else {
 132024 		return Xsqlite3OomFault(tls, db)
 132025 	}
 132026 	return p
 132027 }
 132028 
 132029 // Deallocate a KeyInfo object
 132030 func Xsqlite3KeyInfoUnref(tls *libc.TLS, p uintptr) {
 132031 	if p != 0 {
 132032 		(*KeyInfo)(unsafe.Pointer(p)).FnRef--
 132033 		if (*KeyInfo)(unsafe.Pointer(p)).FnRef == U32(0) {
 132034 			Xsqlite3DbNNFreeNN(tls, (*KeyInfo)(unsafe.Pointer(p)).Fdb, p)
 132035 		}
 132036 	}
 132037 }
 132038 
 132039 // Make a new pointer to a KeyInfo object
 132040 func Xsqlite3KeyInfoRef(tls *libc.TLS, p uintptr) uintptr {
 132041 	if p != 0 {
 132042 		(*KeyInfo)(unsafe.Pointer(p)).FnRef++
 132043 	}
 132044 	return p
 132045 }
 132046 
 132047 // Given an expression list, generate a KeyInfo structure that records
 132048 // the collating sequence for each expression in that expression list.
 132049 //
 132050 // If the ExprList is an ORDER BY or GROUP BY clause then the resulting
 132051 // KeyInfo structure is appropriate for initializing a virtual index to
 132052 // implement that clause.  If the ExprList is the result set of a SELECT
 132053 // then the KeyInfo structure is appropriate for initializing a virtual
 132054 // index to implement a DISTINCT test.
 132055 //
 132056 // Space to hold the KeyInfo structure is obtained from malloc.  The calling
 132057 // function is responsible for seeing that this structure is eventually
 132058 // freed.
 132059 func Xsqlite3KeyInfoFromExprList(tls *libc.TLS, pParse uintptr, pList uintptr, iStart int32, nExtra int32) uintptr {
 132060 	var nExpr int32
 132061 	var pInfo uintptr
 132062 	var pItem uintptr
 132063 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 132064 	var i int32
 132065 
 132066 	nExpr = (*ExprList)(unsafe.Pointer(pList)).FnExpr
 132067 	pInfo = Xsqlite3KeyInfoAlloc(tls, db, nExpr-iStart, nExtra+1)
 132068 	if pInfo != 0 {
 132069 		i = iStart
 132070 		pItem = pList + 8 + uintptr(iStart)*32
 132071 	__1:
 132072 		if !(i < nExpr) {
 132073 			goto __3
 132074 		}
 132075 		{
 132076 			*(*uintptr)(unsafe.Pointer(pInfo + 32 + uintptr(i-iStart)*8)) = Xsqlite3ExprNNCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr)
 132077 			*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pInfo)).FaSortFlags + uintptr(i-iStart))) = (*ExprList_item)(unsafe.Pointer(pItem)).Ffg.FsortFlags
 132078 
 132079 		}
 132080 		goto __2
 132081 	__2:
 132082 		i++
 132083 		pItem += 32
 132084 		goto __1
 132085 		goto __3
 132086 	__3:
 132087 	}
 132088 	return pInfo
 132089 }
 132090 
 132091 // Name of the connection operator, used for error messages.
 132092 func Xsqlite3SelectOpName(tls *libc.TLS, id int32) uintptr {
 132093 	var z uintptr
 132094 	switch id {
 132095 	case TK_ALL:
 132096 		z = ts + 20115
 132097 		break
 132098 	case TK_INTERSECT:
 132099 		z = ts + 20125
 132100 		break
 132101 	case TK_EXCEPT:
 132102 		z = ts + 20135
 132103 		break
 132104 	default:
 132105 		z = ts + 20142
 132106 		break
 132107 	}
 132108 	return z
 132109 }
 132110 
 132111 func explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) {
 132112 	bp := tls.Alloc(8)
 132113 	defer tls.Free(8)
 132114 
 132115 	Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+20148, libc.VaList(bp, zUsage))
 132116 }
 132117 
 132118 func generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, nColumn int32, pDest uintptr) {
 132119 	bp := tls.Alloc(8)
 132120 	defer tls.Free(8)
 132121 
 132122 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 132123 	var addrBreak int32 = (*SortCtx)(unsafe.Pointer(pSort)).FlabelDone
 132124 	var addrContinue int32 = Xsqlite3VdbeMakeLabel(tls, pParse)
 132125 	var addr int32
 132126 	var addrOnce int32 = 0
 132127 	var iTab int32
 132128 	var pOrderBy uintptr = (*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy
 132129 	var eDest int32 = int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest)
 132130 	var iParm int32 = (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm
 132131 	var regRow int32
 132132 	var regRowid int32
 132133 	var iCol int32
 132134 	var nKey int32
 132135 	var iSortTab int32
 132136 	var i int32
 132137 	var bSeq int32
 132138 	var nRefKey int32 = 0
 132139 	var aOutEx uintptr = (*Select)(unsafe.Pointer(p)).FpEList + 8
 132140 
 132141 	Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+20171, libc.VaList(bp, func() uintptr {
 132142 		if (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat > 0 {
 132143 			return ts + 20202
 132144 		}
 132145 		return ts + 1544
 132146 	}()))
 132147 
 132148 	if (*SortCtx)(unsafe.Pointer(pSort)).FlabelBkOut != 0 {
 132149 		Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, (*SortCtx)(unsafe.Pointer(pSort)).FregReturn, (*SortCtx)(unsafe.Pointer(pSort)).FlabelBkOut)
 132150 		Xsqlite3VdbeGoto(tls, v, addrBreak)
 132151 		Xsqlite3VdbeResolveLabel(tls, v, (*SortCtx)(unsafe.Pointer(pSort)).FlabelBkOut)
 132152 	}
 132153 
 132154 	iTab = (*SortCtx)(unsafe.Pointer(pSort)).FiECursor
 132155 	if eDest == SRT_Output || eDest == SRT_Coroutine || eDest == SRT_Mem {
 132156 		if eDest == SRT_Mem && (*Select)(unsafe.Pointer(p)).FiOffset != 0 {
 132157 			Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, (*SelectDest)(unsafe.Pointer(pDest)).FiSdst)
 132158 		}
 132159 		regRowid = 0
 132160 		regRow = (*SelectDest)(unsafe.Pointer(pDest)).FiSdst
 132161 	} else {
 132162 		regRowid = Xsqlite3GetTempReg(tls, pParse)
 132163 		if eDest == SRT_EphemTab || eDest == SRT_Table {
 132164 			regRow = Xsqlite3GetTempReg(tls, pParse)
 132165 			nColumn = 0
 132166 		} else {
 132167 			regRow = Xsqlite3GetTempRange(tls, pParse, nColumn)
 132168 		}
 132169 	}
 132170 	nKey = (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr - (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat
 132171 	if int32((*SortCtx)(unsafe.Pointer(pSort)).FsortFlags)&SORTFLAG_UseSorter != 0 {
 132172 		var regSortOut int32 = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 132173 		iSortTab = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 132174 		if (*SortCtx)(unsafe.Pointer(pSort)).FlabelBkOut != 0 {
 132175 			addrOnce = Xsqlite3VdbeAddOp0(tls, v, OP_Once)
 132176 		}
 132177 		Xsqlite3VdbeAddOp3(tls, v, OP_OpenPseudo, iSortTab, regSortOut,
 132178 			nKey+1+nColumn+nRefKey)
 132179 		if addrOnce != 0 {
 132180 			Xsqlite3VdbeJumpHere(tls, v, addrOnce)
 132181 		}
 132182 		addr = 1 + Xsqlite3VdbeAddOp2(tls, v, OP_SorterSort, iTab, addrBreak)
 132183 
 132184 		Xsqlite3VdbeAddOp3(tls, v, OP_SorterData, iTab, regSortOut, iSortTab)
 132185 		bSeq = 0
 132186 	} else {
 132187 		addr = 1 + Xsqlite3VdbeAddOp2(tls, v, OP_Sort, iTab, addrBreak)
 132188 		codeOffset(tls, v, (*Select)(unsafe.Pointer(p)).FiOffset, addrContinue)
 132189 		iSortTab = iTab
 132190 		bSeq = 1
 132191 		if (*Select)(unsafe.Pointer(p)).FiOffset > 0 {
 132192 			Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, (*Select)(unsafe.Pointer(p)).FiLimit, -1)
 132193 		}
 132194 	}
 132195 	i = 0
 132196 	iCol = nKey + bSeq - 1
 132197 	for ; i < nColumn; i++ {
 132198 		if int32(*(*U16)(unsafe.Pointer(aOutEx + uintptr(i)*32 + 24))) == 0 {
 132199 			iCol++
 132200 		}
 132201 	}
 132202 	for i = nColumn - 1; i >= 0; i-- {
 132203 		{
 132204 			var iRead int32
 132205 			if *(*U16)(unsafe.Pointer(aOutEx + uintptr(i)*32 + 24)) != 0 {
 132206 				iRead = int32(*(*U16)(unsafe.Pointer(aOutEx + uintptr(i)*32 + 24))) - 1
 132207 			} else {
 132208 				iRead = libc.PostDecInt32(&iCol, 1)
 132209 			}
 132210 			Xsqlite3VdbeAddOp3(tls, v, OP_Column, iSortTab, iRead, regRow+i)
 132211 
 132212 		}
 132213 	}
 132214 
 132215 	switch eDest {
 132216 	case SRT_Table:
 132217 		fallthrough
 132218 	case SRT_EphemTab:
 132219 		{
 132220 			Xsqlite3VdbeAddOp3(tls, v, OP_Column, iSortTab, nKey+bSeq, regRow)
 132221 			Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iParm, regRowid)
 132222 			Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iParm, regRow, regRowid)
 132223 			Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND))
 132224 			break
 132225 
 132226 		}
 132227 	case SRT_Set:
 132228 		{
 132229 			Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, regRow, nColumn, regRowid,
 132230 				(*SelectDest)(unsafe.Pointer(pDest)).FzAffSdst, nColumn)
 132231 			Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iParm, regRowid, regRow, nColumn)
 132232 			break
 132233 
 132234 		}
 132235 	case SRT_Mem:
 132236 		{
 132237 			break
 132238 
 132239 		}
 132240 	case SRT_Upfrom:
 132241 		{
 132242 			var i2 int32 = (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm2
 132243 			var r1 int32 = Xsqlite3GetTempReg(tls, pParse)
 132244 			Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regRow+libc.Bool32(i2 < 0), nColumn-libc.Bool32(i2 < 0), r1)
 132245 			if i2 < 0 {
 132246 				Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iParm, r1, regRow)
 132247 			} else {
 132248 				Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iParm, r1, regRow, i2)
 132249 			}
 132250 			break
 132251 
 132252 		}
 132253 	default:
 132254 		{
 132255 			if eDest == SRT_Output {
 132256 				Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, (*SelectDest)(unsafe.Pointer(pDest)).FiSdst, nColumn)
 132257 			} else {
 132258 				Xsqlite3VdbeAddOp1(tls, v, OP_Yield, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm)
 132259 			}
 132260 			break
 132261 
 132262 		}
 132263 	}
 132264 	if regRowid != 0 {
 132265 		if eDest == SRT_Set {
 132266 			Xsqlite3ReleaseTempRange(tls, pParse, regRow, nColumn)
 132267 		} else {
 132268 			Xsqlite3ReleaseTempReg(tls, pParse, regRow)
 132269 		}
 132270 		Xsqlite3ReleaseTempReg(tls, pParse, regRowid)
 132271 	}
 132272 
 132273 	Xsqlite3VdbeResolveLabel(tls, v, addrContinue)
 132274 	if int32((*SortCtx)(unsafe.Pointer(pSort)).FsortFlags)&SORTFLAG_UseSorter != 0 {
 132275 		Xsqlite3VdbeAddOp2(tls, v, OP_SorterNext, iTab, addr)
 132276 	} else {
 132277 		Xsqlite3VdbeAddOp2(tls, v, OP_Next, iTab, addr)
 132278 	}
 132279 
 132280 	if (*SortCtx)(unsafe.Pointer(pSort)).FregReturn != 0 {
 132281 		Xsqlite3VdbeAddOp1(tls, v, OP_Return, (*SortCtx)(unsafe.Pointer(pSort)).FregReturn)
 132282 	}
 132283 	Xsqlite3VdbeResolveLabel(tls, v, addrBreak)
 132284 }
 132285 
 132286 func columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr, pzOrigTab uintptr, pzOrigCol uintptr) uintptr {
 132287 	bp := tls.Alloc(136)
 132288 	defer tls.Free(136)
 132289 
 132290 	var zType uintptr = uintptr(0)
 132291 	var j int32
 132292 	*(*uintptr)(unsafe.Pointer(bp + 56)) = uintptr(0)
 132293 	*(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0)
 132294 	*(*uintptr)(unsafe.Pointer(bp + 72)) = uintptr(0)
 132295 
 132296 	switch int32((*Expr)(unsafe.Pointer(pExpr)).Fop) {
 132297 	case TK_COLUMN:
 132298 		{
 132299 			var pTab uintptr = uintptr(0)
 132300 			var pS uintptr = uintptr(0)
 132301 			var iCol int32 = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)
 132302 			for pNC != 0 && !(pTab != 0) {
 132303 				var pTabList uintptr = (*NameContext)(unsafe.Pointer(pNC)).FpSrcList
 132304 				for j = 0; j < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc && (*SrcItem)(unsafe.Pointer(pTabList+8+uintptr(j)*104)).FiCursor != (*Expr)(unsafe.Pointer(pExpr)).FiTable; j++ {
 132305 				}
 132306 				if j < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc {
 132307 					pTab = (*SrcItem)(unsafe.Pointer(pTabList + 8 + uintptr(j)*104)).FpTab
 132308 					pS = (*SrcItem)(unsafe.Pointer(pTabList + 8 + uintptr(j)*104)).FpSelect
 132309 				} else {
 132310 					pNC = (*NameContext)(unsafe.Pointer(pNC)).FpNext
 132311 				}
 132312 			}
 132313 
 132314 			if pTab == uintptr(0) {
 132315 				break
 132316 			}
 132317 
 132318 			if pS != 0 {
 132319 				if iCol < (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pS)).FpEList)).FnExpr &&
 132320 					iCol >= 0 {
 132321 					var p uintptr = (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(pS)).FpEList + 8 + uintptr(iCol)*32)).FpExpr
 132322 					(*NameContext)(unsafe.Pointer(bp)).FpSrcList = (*Select)(unsafe.Pointer(pS)).FpSrc
 132323 					(*NameContext)(unsafe.Pointer(bp)).FpNext = pNC
 132324 					(*NameContext)(unsafe.Pointer(bp)).FpParse = (*NameContext)(unsafe.Pointer(pNC)).FpParse
 132325 					zType = columnTypeImpl(tls, bp, p, bp+56, bp+64, bp+72)
 132326 				}
 132327 			} else {
 132328 				if iCol < 0 {
 132329 					iCol = int32((*Table)(unsafe.Pointer(pTab)).FiPKey)
 132330 				}
 132331 
 132332 				if iCol < 0 {
 132333 					zType = ts + 1109
 132334 					*(*uintptr)(unsafe.Pointer(bp + 72)) = ts + 17625
 132335 				} else {
 132336 					*(*uintptr)(unsafe.Pointer(bp + 72)) = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*24)).FzCnName
 132337 					zType = Xsqlite3ColumnType(tls, (*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*24, uintptr(0))
 132338 				}
 132339 				*(*uintptr)(unsafe.Pointer(bp + 64)) = (*Table)(unsafe.Pointer(pTab)).FzName
 132340 				if (*NameContext)(unsafe.Pointer(pNC)).FpParse != 0 && (*Table)(unsafe.Pointer(pTab)).FpSchema != 0 {
 132341 					var iDb int32 = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer((*NameContext)(unsafe.Pointer(pNC)).FpParse)).Fdb, (*Table)(unsafe.Pointer(pTab)).FpSchema)
 132342 					*(*uintptr)(unsafe.Pointer(bp + 56)) = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*NameContext)(unsafe.Pointer(pNC)).FpParse)).Fdb)).FaDb + uintptr(iDb)*32)).FzDbSName
 132343 				}
 132344 			}
 132345 			break
 132346 
 132347 		}
 132348 	case TK_SELECT:
 132349 		{
 132350 			var pS uintptr
 132351 			var p uintptr
 132352 
 132353 			pS = *(*uintptr)(unsafe.Pointer(pExpr + 32))
 132354 			p = (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(pS)).FpEList + 8)).FpExpr
 132355 			(*NameContext)(unsafe.Pointer(bp + 80)).FpSrcList = (*Select)(unsafe.Pointer(pS)).FpSrc
 132356 			(*NameContext)(unsafe.Pointer(bp + 80)).FpNext = pNC
 132357 			(*NameContext)(unsafe.Pointer(bp + 80)).FpParse = (*NameContext)(unsafe.Pointer(pNC)).FpParse
 132358 			zType = columnTypeImpl(tls, bp+80, p, bp+56, bp+64, bp+72)
 132359 			break
 132360 
 132361 		}
 132362 	}
 132363 
 132364 	if pzOrigDb != 0 {
 132365 		*(*uintptr)(unsafe.Pointer(pzOrigDb)) = *(*uintptr)(unsafe.Pointer(bp + 56))
 132366 		*(*uintptr)(unsafe.Pointer(pzOrigTab)) = *(*uintptr)(unsafe.Pointer(bp + 64))
 132367 		*(*uintptr)(unsafe.Pointer(pzOrigCol)) = *(*uintptr)(unsafe.Pointer(bp + 72))
 132368 	}
 132369 	return zType
 132370 }
 132371 
 132372 func generateColumnTypes(tls *libc.TLS, pParse uintptr, pTabList uintptr, pEList uintptr) {
 132373 	bp := tls.Alloc(80)
 132374 	defer tls.Free(80)
 132375 
 132376 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 132377 	var i int32
 132378 
 132379 	(*NameContext)(unsafe.Pointer(bp)).FpSrcList = pTabList
 132380 	(*NameContext)(unsafe.Pointer(bp)).FpParse = pParse
 132381 	(*NameContext)(unsafe.Pointer(bp)).FpNext = uintptr(0)
 132382 	for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ {
 132383 		var p uintptr = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*32)).FpExpr
 132384 		var zType uintptr
 132385 		*(*uintptr)(unsafe.Pointer(bp + 56)) = uintptr(0)
 132386 		*(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0)
 132387 		*(*uintptr)(unsafe.Pointer(bp + 72)) = uintptr(0)
 132388 		zType = columnTypeImpl(tls, bp, p, bp+56, bp+64, bp+72)
 132389 
 132390 		Xsqlite3VdbeSetColName(tls, v, i, COLNAME_DATABASE, *(*uintptr)(unsafe.Pointer(bp + 56)), libc.UintptrFromInt32(-1))
 132391 		Xsqlite3VdbeSetColName(tls, v, i, COLNAME_TABLE, *(*uintptr)(unsafe.Pointer(bp + 64)), libc.UintptrFromInt32(-1))
 132392 		Xsqlite3VdbeSetColName(tls, v, i, COLNAME_COLUMN, *(*uintptr)(unsafe.Pointer(bp + 72)), libc.UintptrFromInt32(-1))
 132393 		Xsqlite3VdbeSetColName(tls, v, i, COLNAME_DECLTYPE, zType, libc.UintptrFromInt32(-1))
 132394 	}
 132395 }
 132396 
 132397 // Compute the column names for a SELECT statement.
 132398 //
 132399 // The only guarantee that SQLite makes about column names is that if the
 132400 // column has an AS clause assigning it a name, that will be the name used.
 132401 // That is the only documented guarantee.  However, countless applications
 132402 // developed over the years have made baseless assumptions about column names
 132403 // and will break if those assumptions changes.  Hence, use extreme caution
 132404 // when modifying this routine to avoid breaking legacy.
 132405 //
 132406 // See Also: sqlite3ColumnsFromExprList()
 132407 //
 132408 // The PRAGMA short_column_names and PRAGMA full_column_names settings are
 132409 // deprecated.  The default setting is short=ON, full=OFF.  99.9% of all
 132410 // applications should operate this way.  Nevertheless, we need to support the
 132411 // other modes for legacy:
 132412 //
 132413 //	short=OFF, full=OFF:      Column name is the text of the expression has it
 132414 //	                          originally appears in the SELECT statement.  In
 132415 //	                          other words, the zSpan of the result expression.
 132416 //
 132417 //	short=ON, full=OFF:       (This is the default setting).  If the result
 132418 //	                          refers directly to a table column, then the
 132419 //	                          result column name is just the table column
 132420 //	                          name: COLUMN.  Otherwise use zSpan.
 132421 //
 132422 //	full=ON, short=ANY:       If the result refers directly to a table column,
 132423 //	                          then the result column name with the table name
 132424 //	                          prefix, ex: TABLE.COLUMN.  Otherwise use zSpan.
 132425 func Xsqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) {
 132426 	bp := tls.Alloc(24)
 132427 	defer tls.Free(24)
 132428 
 132429 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 132430 	var i int32
 132431 	var pTab uintptr
 132432 	var pTabList uintptr
 132433 	var pEList uintptr
 132434 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 132435 	var fullName int32
 132436 	var srcName int32
 132437 
 132438 	if (*Parse)(unsafe.Pointer(pParse)).Fexplain != 0 {
 132439 		return
 132440 	}
 132441 
 132442 	if (*Parse)(unsafe.Pointer(pParse)).FcolNamesSet != 0 {
 132443 		return
 132444 	}
 132445 
 132446 	for (*Select)(unsafe.Pointer(pSelect)).FpPrior != 0 {
 132447 		pSelect = (*Select)(unsafe.Pointer(pSelect)).FpPrior
 132448 	}
 132449 
 132450 	pTabList = (*Select)(unsafe.Pointer(pSelect)).FpSrc
 132451 	pEList = (*Select)(unsafe.Pointer(pSelect)).FpEList
 132452 
 132453 	(*Parse)(unsafe.Pointer(pParse)).FcolNamesSet = U8(1)
 132454 	fullName = libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_FullColNames) != uint64(0))
 132455 	srcName = libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ShortColNames) != uint64(0) || fullName != 0)
 132456 	Xsqlite3VdbeSetNumCols(tls, v, (*ExprList)(unsafe.Pointer(pEList)).FnExpr)
 132457 	for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ {
 132458 		var p uintptr = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*32)).FpExpr
 132459 
 132460 		if (*ExprList_item)(unsafe.Pointer(pEList+8+uintptr(i)*32)).FzEName != 0 && int32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(i)*32 + 16 + 4))&0x3>>0) == ENAME_NAME {
 132461 			var zName uintptr = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*32)).FzEName
 132462 			Xsqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zName, libc.UintptrFromInt32(-1))
 132463 		} else if srcName != 0 && int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN {
 132464 			var zCol uintptr
 132465 			var iCol int32 = int32((*Expr)(unsafe.Pointer(p)).FiColumn)
 132466 			pTab = *(*uintptr)(unsafe.Pointer(p + 64))
 132467 
 132468 			if iCol < 0 {
 132469 				iCol = int32((*Table)(unsafe.Pointer(pTab)).FiPKey)
 132470 			}
 132471 
 132472 			if iCol < 0 {
 132473 				zCol = ts + 17625
 132474 			} else {
 132475 				zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*24)).FzCnName
 132476 			}
 132477 			if fullName != 0 {
 132478 				var zName uintptr = uintptr(0)
 132479 				zName = Xsqlite3MPrintf(tls, db, ts+13413, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, zCol))
 132480 				Xsqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zName, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomClear})))
 132481 			} else {
 132482 				Xsqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zCol, libc.UintptrFromInt32(-1))
 132483 			}
 132484 		} else {
 132485 			var z uintptr = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*32)).FzEName
 132486 			if z == uintptr(0) {
 132487 				z = Xsqlite3MPrintf(tls, db, ts+20217, libc.VaList(bp+16, i+1))
 132488 			} else {
 132489 				z = Xsqlite3DbStrDup(tls, db, z)
 132490 			}
 132491 			Xsqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, z, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomClear})))
 132492 		}
 132493 	}
 132494 	generateColumnTypes(tls, pParse, pTabList, pEList)
 132495 }
 132496 
 132497 // Given an expression list (which is really the list of expressions
 132498 // that form the result set of a SELECT statement) compute appropriate
 132499 // column names for a table that would hold the expression list.
 132500 //
 132501 // All column names will be unique.
 132502 //
 132503 // Only the column names are computed.  Column.zType, Column.zColl,
 132504 // and other fields of Column are zeroed.
 132505 //
 132506 // Return SQLITE_OK on success.  If a memory allocation error occurs,
 132507 // store NULL in *paCol and 0 in *pnCol and return SQLITE_NOMEM.
 132508 //
 132509 // The only guarantee that SQLite makes about column names is that if the
 132510 // column has an AS clause assigning it a name, that will be the name used.
 132511 // That is the only documented guarantee.  However, countless applications
 132512 // developed over the years have made baseless assumptions about column names
 132513 // and will break if those assumptions changes.  Hence, use extreme caution
 132514 // when modifying this routine to avoid breaking legacy.
 132515 //
 132516 // See Also: sqlite3GenerateColumnNames()
 132517 func Xsqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, pnCol uintptr, paCol uintptr) int32 {
 132518 	bp := tls.Alloc(60)
 132519 	defer tls.Free(60)
 132520 
 132521 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 132522 	var i int32
 132523 	var j int32
 132524 
 132525 	var aCol uintptr
 132526 	var pCol uintptr
 132527 	var nCol int32
 132528 	var zName uintptr
 132529 	var nName int32
 132530 
 132531 	var pTab uintptr
 132532 
 132533 	Xsqlite3HashInit(tls, bp+32)
 132534 	if pEList != 0 {
 132535 		nCol = (*ExprList)(unsafe.Pointer(pEList)).FnExpr
 132536 		aCol = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Column{}))*uint64(nCol))
 132537 
 132538 		if nCol > 32767 {
 132539 			nCol = 32767
 132540 		}
 132541 	} else {
 132542 		nCol = 0
 132543 		aCol = uintptr(0)
 132544 	}
 132545 
 132546 	*(*I16)(unsafe.Pointer(pnCol)) = I16(nCol)
 132547 	*(*uintptr)(unsafe.Pointer(paCol)) = aCol
 132548 
 132549 	i = 0
 132550 	pCol = aCol
 132551 __1:
 132552 	if !(i < nCol && !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0)) {
 132553 		goto __3
 132554 	}
 132555 	{
 132556 		var pX uintptr = pEList + 8 + uintptr(i)*32
 132557 		var pCollide uintptr
 132558 
 132559 		if libc.AssignUintptr(&zName, (*ExprList_item)(unsafe.Pointer(pX)).FzEName) != uintptr(0) && int32(*(*uint16)(unsafe.Pointer(pX + 16 + 4))&0x3>>0) == ENAME_NAME {
 132560 		} else {
 132561 			var pColExpr uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer(pX)).FpExpr)
 132562 			for pColExpr != uintptr(0) && int32((*Expr)(unsafe.Pointer(pColExpr)).Fop) == TK_DOT {
 132563 				pColExpr = (*Expr)(unsafe.Pointer(pColExpr)).FpRight
 132564 
 132565 			}
 132566 			if int32((*Expr)(unsafe.Pointer(pColExpr)).Fop) == TK_COLUMN &&
 132567 				(*Expr)(unsafe.Pointer(pColExpr)).Fflags&U32(EP_WinFunc|EP_Subrtn) == U32(0) &&
 132568 				*(*uintptr)(unsafe.Pointer(pColExpr + 64)) != uintptr(0) {
 132569 				var iCol int32 = int32((*Expr)(unsafe.Pointer(pColExpr)).FiColumn)
 132570 				pTab = *(*uintptr)(unsafe.Pointer(pColExpr + 64))
 132571 				if iCol < 0 {
 132572 					iCol = int32((*Table)(unsafe.Pointer(pTab)).FiPKey)
 132573 				}
 132574 				if iCol >= 0 {
 132575 					zName = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*24)).FzCnName
 132576 				} else {
 132577 					zName = ts + 17625
 132578 				}
 132579 			} else if int32((*Expr)(unsafe.Pointer(pColExpr)).Fop) == TK_ID {
 132580 				zName = *(*uintptr)(unsafe.Pointer(pColExpr + 8))
 132581 			} else {
 132582 			}
 132583 		}
 132584 		if zName != 0 && !(Xsqlite3IsTrueOrFalse(tls, zName) != 0) {
 132585 			zName = Xsqlite3DbStrDup(tls, db, zName)
 132586 		} else {
 132587 			zName = Xsqlite3MPrintf(tls, db, ts+20217, libc.VaList(bp, i+1))
 132588 		}
 132589 
 132590 		*(*U32)(unsafe.Pointer(bp + 56)) = U32(0)
 132591 		for zName != 0 && libc.AssignUintptr(&pCollide, Xsqlite3HashFind(tls, bp+32, zName)) != uintptr(0) {
 132592 			if uint32(int32(*(*uint16)(unsafe.Pointer(pCollide + 16 + 4))&0x80>>7)) != 0 {
 132593 				*(*U16)(unsafe.Pointer(pCol + 16)) |= U16(COLFLAG_NOEXPAND)
 132594 			}
 132595 			nName = Xsqlite3Strlen30(tls, zName)
 132596 			if nName > 0 {
 132597 				for j = nName - 1; j > 0 && int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zName + uintptr(j))))])&0x04 != 0; j-- {
 132598 				}
 132599 				if int32(*(*int8)(unsafe.Pointer(zName + uintptr(j)))) == ':' {
 132600 					nName = j
 132601 				}
 132602 			}
 132603 			zName = Xsqlite3MPrintf(tls, db, ts+20226, libc.VaList(bp+8, nName, zName, libc.PreIncUint32(&*(*U32)(unsafe.Pointer(bp + 56)), 1)))
 132604 			Xsqlite3ProgressCheck(tls, pParse)
 132605 			if *(*U32)(unsafe.Pointer(bp + 56)) > U32(3) {
 132606 				Xsqlite3_randomness(tls, int32(unsafe.Sizeof(U32(0))), bp+56)
 132607 			}
 132608 		}
 132609 		(*Column)(unsafe.Pointer(pCol)).FzCnName = zName
 132610 		(*Column)(unsafe.Pointer(pCol)).FhName = Xsqlite3StrIHash(tls, zName)
 132611 		if uint32(int32(*(*uint16)(unsafe.Pointer(pX + 16 + 4))&0x100>>8)) != 0 {
 132612 			*(*U16)(unsafe.Pointer(pCol + 16)) |= U16(COLFLAG_NOEXPAND)
 132613 		}
 132614 
 132615 		if zName != 0 && Xsqlite3HashInsert(tls, bp+32, zName, pX) == pX {
 132616 			Xsqlite3OomFault(tls, db)
 132617 		}
 132618 
 132619 	}
 132620 	goto __2
 132621 __2:
 132622 	i++
 132623 	pCol += 24
 132624 	goto __1
 132625 	goto __3
 132626 __3:
 132627 	;
 132628 	Xsqlite3HashClear(tls, bp+32)
 132629 	if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 132630 		for j = 0; j < i; j++ {
 132631 			Xsqlite3DbFree(tls, db, (*Column)(unsafe.Pointer(aCol+uintptr(j)*24)).FzCnName)
 132632 		}
 132633 		Xsqlite3DbFree(tls, db, aCol)
 132634 		*(*uintptr)(unsafe.Pointer(paCol)) = uintptr(0)
 132635 		*(*I16)(unsafe.Pointer(pnCol)) = int16(0)
 132636 		return (*Parse)(unsafe.Pointer(pParse)).Frc
 132637 	}
 132638 	return SQLITE_OK
 132639 }
 132640 
 132641 // pTab is a transient Table object that represents a subquery of some
 132642 // kind (maybe a parenthesized subquery in the FROM clause of a larger
 132643 // query, or a VIEW, or a CTE).  This routine computes type information
 132644 // for that Table object based on the Select object that implements the
 132645 // subquery.  For the purposes of this routine, "type infomation" means:
 132646 //
 132647 //   - The datatype name, as it might appear in a CREATE TABLE statement
 132648 //   - Which collating sequence to use for the column
 132649 //   - The affinity of the column
 132650 func Xsqlite3SubqueryColumnTypes(tls *libc.TLS, pParse uintptr, pTab uintptr, pSelect uintptr, aff int8) {
 132651 	bp := tls.Alloc(56)
 132652 	defer tls.Free(56)
 132653 
 132654 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 132655 	var pCol uintptr
 132656 	var pColl uintptr
 132657 	var i int32
 132658 	var j int32
 132659 	var p uintptr
 132660 	var a uintptr
 132661 
 132662 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 132663 		return
 132664 	}
 132665 	for (*Select)(unsafe.Pointer(pSelect)).FpPrior != 0 {
 132666 		pSelect = (*Select)(unsafe.Pointer(pSelect)).FpPrior
 132667 	}
 132668 	a = (*Select)(unsafe.Pointer(pSelect)).FpEList + 8
 132669 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(NameContext{})))
 132670 	(*NameContext)(unsafe.Pointer(bp)).FpSrcList = (*Select)(unsafe.Pointer(pSelect)).FpSrc
 132671 	i = 0
 132672 	pCol = (*Table)(unsafe.Pointer(pTab)).FaCol
 132673 __1:
 132674 	if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 132675 		goto __3
 132676 	}
 132677 	{
 132678 		var zType uintptr
 132679 		var n I64
 132680 		*(*U32)(unsafe.Pointer(pTab + 48)) |= U32(int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_NOINSERT)
 132681 		p = (*ExprList_item)(unsafe.Pointer(a + uintptr(i)*32)).FpExpr
 132682 
 132683 		(*Column)(unsafe.Pointer(pCol)).Faffinity = Xsqlite3ExprAffinity(tls, p)
 132684 		if int32((*Column)(unsafe.Pointer(pCol)).Faffinity) <= SQLITE_AFF_NONE {
 132685 			(*Column)(unsafe.Pointer(pCol)).Faffinity = aff
 132686 		}
 132687 		if int32((*Column)(unsafe.Pointer(pCol)).Faffinity) >= SQLITE_AFF_TEXT && (*Select)(unsafe.Pointer(pSelect)).FpNext != 0 {
 132688 			var m int32 = 0
 132689 			var pS2 uintptr
 132690 			m = 0
 132691 			pS2 = (*Select)(unsafe.Pointer(pSelect)).FpNext
 132692 			for ; pS2 != 0; pS2 = (*Select)(unsafe.Pointer(pS2)).FpNext {
 132693 				m = m | Xsqlite3ExprDataType(tls, (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(pS2)).FpEList+8+uintptr(i)*32)).FpExpr)
 132694 			}
 132695 			if int32((*Column)(unsafe.Pointer(pCol)).Faffinity) == SQLITE_AFF_TEXT && m&0x01 != 0 {
 132696 				(*Column)(unsafe.Pointer(pCol)).Faffinity = int8(SQLITE_AFF_BLOB)
 132697 			} else if int32((*Column)(unsafe.Pointer(pCol)).Faffinity) >= SQLITE_AFF_NUMERIC && m&0x02 != 0 {
 132698 				(*Column)(unsafe.Pointer(pCol)).Faffinity = int8(SQLITE_AFF_BLOB)
 132699 			}
 132700 			if int32((*Column)(unsafe.Pointer(pCol)).Faffinity) >= SQLITE_AFF_NUMERIC && int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_CAST {
 132701 				(*Column)(unsafe.Pointer(pCol)).Faffinity = int8(SQLITE_AFF_FLEXNUM)
 132702 			}
 132703 		}
 132704 		zType = columnTypeImpl(tls, bp, p, uintptr(0), uintptr(0), uintptr(0))
 132705 		if zType == uintptr(0) || int32((*Column)(unsafe.Pointer(pCol)).Faffinity) != int32(Xsqlite3AffinityType(tls, zType, uintptr(0))) {
 132706 			if int32((*Column)(unsafe.Pointer(pCol)).Faffinity) == SQLITE_AFF_NUMERIC ||
 132707 				int32((*Column)(unsafe.Pointer(pCol)).Faffinity) == SQLITE_AFF_FLEXNUM {
 132708 				zType = ts + 20234
 132709 			} else {
 132710 				zType = uintptr(0)
 132711 				for j = 1; j < SQLITE_N_STDTYPE; j++ {
 132712 					if int32(Xsqlite3StdTypeAffinity[j]) == int32((*Column)(unsafe.Pointer(pCol)).Faffinity) {
 132713 						zType = Xsqlite3StdType[j]
 132714 						break
 132715 					}
 132716 				}
 132717 			}
 132718 		}
 132719 		if zType != 0 {
 132720 			var m I64 = I64(Xsqlite3Strlen30(tls, zType))
 132721 			n = I64(Xsqlite3Strlen30(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName))
 132722 			(*Column)(unsafe.Pointer(pCol)).FzCnName = Xsqlite3DbReallocOrFree(tls, db, (*Column)(unsafe.Pointer(pCol)).FzCnName, uint64(n+m+int64(2)))
 132723 			if (*Column)(unsafe.Pointer(pCol)).FzCnName != 0 {
 132724 				libc.Xmemcpy(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName+uintptr(n+int64(1)), zType, uint64(m+int64(1)))
 132725 				*(*U16)(unsafe.Pointer(pCol + 16)) |= U16(COLFLAG_HASTYPE)
 132726 			} else {
 132727 				*(*U16)(unsafe.Pointer(pCol + 16)) &= libc.Uint16FromInt32(libc.CplInt32(COLFLAG_HASTYPE | COLFLAG_HASCOLL))
 132728 			}
 132729 		}
 132730 		pColl = Xsqlite3ExprCollSeq(tls, pParse, p)
 132731 		if pColl != 0 {
 132732 			Xsqlite3ColumnSetColl(tls, db, pCol, (*CollSeq)(unsafe.Pointer(pColl)).FzName)
 132733 		}
 132734 
 132735 	}
 132736 	goto __2
 132737 __2:
 132738 	i++
 132739 	pCol += 24
 132740 	goto __1
 132741 	goto __3
 132742 __3:
 132743 	;
 132744 	(*Table)(unsafe.Pointer(pTab)).FszTabRow = int16(1)
 132745 }
 132746 
 132747 // Given a SELECT statement, generate a Table structure that describes
 132748 // the result set of that SELECT.
 132749 func Xsqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, aff int8) uintptr {
 132750 	var pTab uintptr
 132751 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 132752 	var savedFlags U64
 132753 
 132754 	savedFlags = (*Sqlite3)(unsafe.Pointer(db)).Fflags
 132755 	*(*U64)(unsafe.Pointer(db + 48)) &= libc.CplUint64(uint64(SQLITE_FullColNames))
 132756 	*(*U64)(unsafe.Pointer(db + 48)) |= uint64(SQLITE_ShortColNames)
 132757 	Xsqlite3SelectPrep(tls, pParse, pSelect, uintptr(0))
 132758 	(*Sqlite3)(unsafe.Pointer(db)).Fflags = savedFlags
 132759 	if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 132760 		return uintptr(0)
 132761 	}
 132762 	for (*Select)(unsafe.Pointer(pSelect)).FpPrior != 0 {
 132763 		pSelect = (*Select)(unsafe.Pointer(pSelect)).FpPrior
 132764 	}
 132765 	pTab = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Table{})))
 132766 	if pTab == uintptr(0) {
 132767 		return uintptr(0)
 132768 	}
 132769 	(*Table)(unsafe.Pointer(pTab)).FnTabRef = U32(1)
 132770 	(*Table)(unsafe.Pointer(pTab)).FzName = uintptr(0)
 132771 	(*Table)(unsafe.Pointer(pTab)).FnRowLogEst = int16(200)
 132772 	Xsqlite3ColumnsFromExprList(tls, pParse, (*Select)(unsafe.Pointer(pSelect)).FpEList, pTab+54, pTab+8)
 132773 	Xsqlite3SubqueryColumnTypes(tls, pParse, pTab, pSelect, aff)
 132774 	(*Table)(unsafe.Pointer(pTab)).FiPKey = int16(-1)
 132775 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 132776 		Xsqlite3DeleteTable(tls, db, pTab)
 132777 		return uintptr(0)
 132778 	}
 132779 	return pTab
 132780 }
 132781 
 132782 // Get a VDBE for the given parser context.  Create a new one if necessary.
 132783 // If an error occurs, return NULL and leave a message in pParse.
 132784 func Xsqlite3GetVdbe(tls *libc.TLS, pParse uintptr) uintptr {
 132785 	if (*Parse)(unsafe.Pointer(pParse)).FpVdbe != 0 {
 132786 		return (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 132787 	}
 132788 	if (*Parse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0) &&
 132789 		(*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&U32(SQLITE_FactorOutConst) == U32(0) {
 132790 		(*Parse)(unsafe.Pointer(pParse)).FokConstFactor = U8(1)
 132791 	}
 132792 	return Xsqlite3VdbeCreate(tls, pParse)
 132793 }
 132794 
 132795 func computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int32) {
 132796 	bp := tls.Alloc(4)
 132797 	defer tls.Free(4)
 132798 
 132799 	var v uintptr = uintptr(0)
 132800 	var iLimit int32 = 0
 132801 	var iOffset int32
 132802 
 132803 	var pLimit uintptr = (*Select)(unsafe.Pointer(p)).FpLimit
 132804 
 132805 	if (*Select)(unsafe.Pointer(p)).FiLimit != 0 {
 132806 		return
 132807 	}
 132808 
 132809 	if pLimit != 0 {
 132810 		(*Select)(unsafe.Pointer(p)).FiLimit = libc.AssignInt32(&iLimit, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
 132811 		v = Xsqlite3GetVdbe(tls, pParse)
 132812 
 132813 		if Xsqlite3ExprIsInteger(tls, (*Expr)(unsafe.Pointer(pLimit)).FpLeft, bp) != 0 {
 132814 			Xsqlite3VdbeAddOp2(tls, v, OP_Integer, *(*int32)(unsafe.Pointer(bp)), iLimit)
 132815 
 132816 			if *(*int32)(unsafe.Pointer(bp)) == 0 {
 132817 				Xsqlite3VdbeGoto(tls, v, iBreak)
 132818 			} else if *(*int32)(unsafe.Pointer(bp)) >= 0 && int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > int32(Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp))))) {
 132819 				(*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp))))
 132820 				*(*U32)(unsafe.Pointer(p + 4)) |= U32(SF_FixedLimit)
 132821 			}
 132822 		} else {
 132823 			Xsqlite3ExprCode(tls, pParse, (*Expr)(unsafe.Pointer(pLimit)).FpLeft, iLimit)
 132824 			Xsqlite3VdbeAddOp1(tls, v, OP_MustBeInt, iLimit)
 132825 
 132826 			Xsqlite3VdbeAddOp2(tls, v, OP_IfNot, iLimit, iBreak)
 132827 		}
 132828 		if (*Expr)(unsafe.Pointer(pLimit)).FpRight != 0 {
 132829 			(*Select)(unsafe.Pointer(p)).FiOffset = libc.AssignInt32(&iOffset, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
 132830 			(*Parse)(unsafe.Pointer(pParse)).FnMem++
 132831 			Xsqlite3ExprCode(tls, pParse, (*Expr)(unsafe.Pointer(pLimit)).FpRight, iOffset)
 132832 			Xsqlite3VdbeAddOp1(tls, v, OP_MustBeInt, iOffset)
 132833 
 132834 			Xsqlite3VdbeAddOp3(tls, v, OP_OffsetLimit, iLimit, iOffset+1, iOffset)
 132835 
 132836 		}
 132837 	}
 132838 }
 132839 
 132840 func multiSelectCollSeq(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) uintptr {
 132841 	var pRet uintptr
 132842 	if (*Select)(unsafe.Pointer(p)).FpPrior != 0 {
 132843 		pRet = multiSelectCollSeq(tls, pParse, (*Select)(unsafe.Pointer(p)).FpPrior, iCol)
 132844 	} else {
 132845 		pRet = uintptr(0)
 132846 	}
 132847 
 132848 	if pRet == uintptr(0) && iCol < (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr {
 132849 		pRet = Xsqlite3ExprCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList+8+uintptr(iCol)*32)).FpExpr)
 132850 	}
 132851 	return pRet
 132852 }
 132853 
 132854 func multiSelectOrderByKeyInfo(tls *libc.TLS, pParse uintptr, p uintptr, nExtra int32) uintptr {
 132855 	var pOrderBy uintptr = (*Select)(unsafe.Pointer(p)).FpOrderBy
 132856 	var nOrderBy int32
 132857 	if pOrderBy != uintptr(0) {
 132858 		nOrderBy = (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr
 132859 	} else {
 132860 		nOrderBy = 0
 132861 	}
 132862 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 132863 	var pRet uintptr = Xsqlite3KeyInfoAlloc(tls, db, nOrderBy+nExtra, 1)
 132864 	if pRet != 0 {
 132865 		var i int32
 132866 		for i = 0; i < nOrderBy; i++ {
 132867 			var pItem uintptr = pOrderBy + 8 + uintptr(i)*32
 132868 			var pTerm uintptr = (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr
 132869 			var pColl uintptr
 132870 
 132871 			if (*Expr)(unsafe.Pointer(pTerm)).Fflags&U32(EP_Collate) != 0 {
 132872 				pColl = Xsqlite3ExprCollSeq(tls, pParse, pTerm)
 132873 			} else {
 132874 				pColl = multiSelectCollSeq(tls, pParse, p, int32(*(*U16)(unsafe.Pointer(pItem + 24)))-1)
 132875 				if pColl == uintptr(0) {
 132876 					pColl = (*Sqlite3)(unsafe.Pointer(db)).FpDfltColl
 132877 				}
 132878 				(*ExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32)).FpExpr = Xsqlite3ExprAddCollateString(tls, pParse, pTerm, (*CollSeq)(unsafe.Pointer(pColl)).FzName)
 132879 			}
 132880 
 132881 			*(*uintptr)(unsafe.Pointer(pRet + 32 + uintptr(i)*8)) = pColl
 132882 			*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pRet)).FaSortFlags + uintptr(i))) = (*ExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32)).Ffg.FsortFlags
 132883 		}
 132884 	}
 132885 
 132886 	return pRet
 132887 }
 132888 
 132889 func generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) {
 132890 	bp := tls.Alloc(40)
 132891 	defer tls.Free(40)
 132892 
 132893 	var pSrc uintptr
 132894 	var nCol int32
 132895 	var v uintptr
 132896 	var pSetup uintptr
 132897 	var pFirstRec uintptr
 132898 	var addrTop int32
 132899 	var addrCont int32
 132900 	var addrBreak int32
 132901 	var iCurrent int32
 132902 	var regCurrent int32
 132903 	var iQueue int32
 132904 	var iDistinct int32
 132905 	var eDest int32
 132906 
 132907 	var i int32
 132908 	var rc int32
 132909 	var pOrderBy uintptr
 132910 	var pLimit uintptr
 132911 	var regLimit int32
 132912 	var regOffset int32
 132913 	var pKeyInfo uintptr
 132914 	pSrc = (*Select)(unsafe.Pointer(p)).FpSrc
 132915 	nCol = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr
 132916 	v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 132917 	iCurrent = 0
 132918 	iDistinct = 0
 132919 	eDest = SRT_Fifo
 132920 
 132921 	if !((*Select)(unsafe.Pointer(p)).FpWin != 0) {
 132922 		goto __1
 132923 	}
 132924 	Xsqlite3ErrorMsg(tls, pParse, ts+20238, 0)
 132925 	return
 132926 __1:
 132927 	;
 132928 	if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_RECURSIVE, uintptr(0), uintptr(0), uintptr(0)) != 0) {
 132929 		goto __2
 132930 	}
 132931 	return
 132932 __2:
 132933 	;
 132934 	addrBreak = Xsqlite3VdbeMakeLabel(tls, pParse)
 132935 	(*Select)(unsafe.Pointer(p)).FnSelectRow = int16(320)
 132936 	computeLimitRegisters(tls, pParse, p, addrBreak)
 132937 	pLimit = (*Select)(unsafe.Pointer(p)).FpLimit
 132938 	regLimit = (*Select)(unsafe.Pointer(p)).FiLimit
 132939 	regOffset = (*Select)(unsafe.Pointer(p)).FiOffset
 132940 	(*Select)(unsafe.Pointer(p)).FpLimit = uintptr(0)
 132941 	(*Select)(unsafe.Pointer(p)).FiLimit = libc.AssignPtrInt32(p+12, 0)
 132942 	pOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy
 132943 
 132944 	i = 0
 132945 __3:
 132946 	if !(i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc) {
 132947 		goto __5
 132948 	}
 132949 	if !(uint32(int32(*(*uint16)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104 + 60 + 4))&0x40>>6)) != 0) {
 132950 		goto __6
 132951 	}
 132952 	iCurrent = (*SrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104)).FiCursor
 132953 	goto __5
 132954 __6:
 132955 	;
 132956 	goto __4
 132957 __4:
 132958 	i++
 132959 	goto __3
 132960 	goto __5
 132961 __5:
 132962 	;
 132963 	iQueue = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 132964 	if !(int32((*Select)(unsafe.Pointer(p)).Fop) == TK_UNION) {
 132965 		goto __7
 132966 	}
 132967 	if pOrderBy != 0 {
 132968 		eDest = SRT_DistQueue
 132969 	} else {
 132970 		eDest = SRT_DistFifo
 132971 	}
 132972 	iDistinct = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 132973 	goto __8
 132974 __7:
 132975 	if pOrderBy != 0 {
 132976 		eDest = SRT_Queue
 132977 	} else {
 132978 		eDest = SRT_Fifo
 132979 	}
 132980 __8:
 132981 	;
 132982 	Xsqlite3SelectDestInit(tls, bp, eDest, iQueue)
 132983 
 132984 	regCurrent = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 132985 	Xsqlite3VdbeAddOp3(tls, v, OP_OpenPseudo, iCurrent, regCurrent, nCol)
 132986 	if !(pOrderBy != 0) {
 132987 		goto __9
 132988 	}
 132989 	pKeyInfo = multiSelectOrderByKeyInfo(tls, pParse, p, 1)
 132990 	Xsqlite3VdbeAddOp4(tls, v, OP_OpenEphemeral, iQueue, (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr+2, 0,
 132991 		pKeyInfo, -8)
 132992 	(*SelectDest)(unsafe.Pointer(bp)).FpOrderBy = pOrderBy
 132993 	goto __10
 132994 __9:
 132995 	Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, iQueue, nCol)
 132996 __10:
 132997 	;
 132998 	if !(iDistinct != 0) {
 132999 		goto __11
 133000 	}
 133001 	*(*int32)(unsafe.Pointer(p + 20)) = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, iDistinct, 0)
 133002 	*(*U32)(unsafe.Pointer(p + 4)) |= U32(SF_UsesEphemeral)
 133003 __11:
 133004 	;
 133005 	(*Select)(unsafe.Pointer(p)).FpOrderBy = uintptr(0)
 133006 
 133007 	pFirstRec = p
 133008 __12:
 133009 	if !(pFirstRec != uintptr(0)) {
 133010 		goto __14
 133011 	}
 133012 	if !((*Select)(unsafe.Pointer(pFirstRec)).FselFlags&U32(SF_Aggregate) != 0) {
 133013 		goto __15
 133014 	}
 133015 	Xsqlite3ErrorMsg(tls, pParse, ts+20287, 0)
 133016 	goto end_of_recursive_query
 133017 __15:
 133018 	;
 133019 	(*Select)(unsafe.Pointer(pFirstRec)).Fop = U8(TK_ALL)
 133020 	if !((*Select)(unsafe.Pointer((*Select)(unsafe.Pointer(pFirstRec)).FpPrior)).FselFlags&U32(SF_Recursive) == U32(0)) {
 133021 		goto __16
 133022 	}
 133023 	goto __14
 133024 __16:
 133025 	;
 133026 	goto __13
 133027 __13:
 133028 	pFirstRec = (*Select)(unsafe.Pointer(pFirstRec)).FpPrior
 133029 	goto __12
 133030 	goto __14
 133031 __14:
 133032 	;
 133033 	pSetup = (*Select)(unsafe.Pointer(pFirstRec)).FpPrior
 133034 	(*Select)(unsafe.Pointer(pSetup)).FpNext = uintptr(0)
 133035 	Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20329, 0)
 133036 	rc = Xsqlite3Select(tls, pParse, pSetup, bp)
 133037 	(*Select)(unsafe.Pointer(pSetup)).FpNext = p
 133038 	if !(rc != 0) {
 133039 		goto __17
 133040 	}
 133041 	goto end_of_recursive_query
 133042 __17:
 133043 	;
 133044 	addrTop = Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, iQueue, addrBreak)
 133045 
 133046 	Xsqlite3VdbeAddOp1(tls, v, OP_NullRow, iCurrent)
 133047 	if !(pOrderBy != 0) {
 133048 		goto __18
 133049 	}
 133050 	Xsqlite3VdbeAddOp3(tls, v, OP_Column, iQueue, (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr+1, regCurrent)
 133051 	goto __19
 133052 __18:
 133053 	Xsqlite3VdbeAddOp2(tls, v, OP_RowData, iQueue, regCurrent)
 133054 __19:
 133055 	;
 133056 	Xsqlite3VdbeAddOp1(tls, v, OP_Delete, iQueue)
 133057 
 133058 	addrCont = Xsqlite3VdbeMakeLabel(tls, pParse)
 133059 	codeOffset(tls, v, regOffset, addrCont)
 133060 	selectInnerLoop(tls, pParse, p, iCurrent,
 133061 		uintptr(0), uintptr(0), pDest, addrCont, addrBreak)
 133062 	if !(regLimit != 0) {
 133063 		goto __20
 133064 	}
 133065 	Xsqlite3VdbeAddOp2(tls, v, OP_DecrJumpZero, regLimit, addrBreak)
 133066 
 133067 __20:
 133068 	;
 133069 	Xsqlite3VdbeResolveLabel(tls, v, addrCont)
 133070 
 133071 	(*Select)(unsafe.Pointer(pFirstRec)).FpPrior = uintptr(0)
 133072 	Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20335, 0)
 133073 	Xsqlite3Select(tls, pParse, p, bp)
 133074 
 133075 	(*Select)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup
 133076 
 133077 	Xsqlite3VdbeGoto(tls, v, addrTop)
 133078 	Xsqlite3VdbeResolveLabel(tls, v, addrBreak)
 133079 
 133080 end_of_recursive_query:
 133081 	Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Select)(unsafe.Pointer(p)).FpOrderBy)
 133082 	(*Select)(unsafe.Pointer(p)).FpOrderBy = pOrderBy
 133083 	(*Select)(unsafe.Pointer(p)).FpLimit = pLimit
 133084 	return
 133085 }
 133086 
 133087 func multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 {
 133088 	bp := tls.Alloc(16)
 133089 	defer tls.Free(16)
 133090 
 133091 	var nRow int32 = 1
 133092 	var rc int32 = 0
 133093 	var bShowAll int32 = libc.Bool32((*Select)(unsafe.Pointer(p)).FpLimit == uintptr(0))
 133094 
 133095 	for __ccgo := true; __ccgo; __ccgo = 1 != 0 {
 133096 		if (*Select)(unsafe.Pointer(p)).FpWin != 0 {
 133097 			return -1
 133098 		}
 133099 		if (*Select)(unsafe.Pointer(p)).FpPrior == uintptr(0) {
 133100 			break
 133101 		}
 133102 
 133103 		p = (*Select)(unsafe.Pointer(p)).FpPrior
 133104 		nRow = nRow + bShowAll
 133105 	}
 133106 	Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+20350, libc.VaList(bp, nRow, func() uintptr {
 133107 		if nRow == 1 {
 133108 			return ts + 1544
 133109 		}
 133110 		return ts + 20373
 133111 	}()))
 133112 	for p != 0 {
 133113 		selectInnerLoop(tls, pParse, p, -1, uintptr(0), uintptr(0), pDest, 1, 1)
 133114 		if !(bShowAll != 0) {
 133115 			break
 133116 		}
 133117 		(*Select)(unsafe.Pointer(p)).FnSelectRow = LogEst(nRow)
 133118 		p = (*Select)(unsafe.Pointer(p)).FpNext
 133119 	}
 133120 	return rc
 133121 }
 133122 
 133123 func hasAnchor(tls *libc.TLS, p uintptr) int32 {
 133124 	for p != 0 && (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Recursive) != U32(0) {
 133125 		p = (*Select)(unsafe.Pointer(p)).FpPrior
 133126 	}
 133127 	return libc.Bool32(p != uintptr(0))
 133128 }
 133129 
 133130 func multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 {
 133131 	bp := tls.Alloc(144)
 133132 	defer tls.Free(144)
 133133 
 133134 	var rc int32
 133135 	var pPrior uintptr
 133136 	var v uintptr
 133137 
 133138 	var pDelete uintptr
 133139 	var db uintptr
 133140 	var addr int32
 133141 
 133142 	var iCont int32
 133143 	var iBreak int32
 133144 	var iStart int32
 133145 	var unionTab int32
 133146 	var op U8
 133147 	var priorOp int32
 133148 	var pLimit uintptr
 133149 	var addr1 int32
 133150 
 133151 	var tab1 int32
 133152 	var tab2 int32
 133153 	var iCont1 int32
 133154 	var iBreak1 int32
 133155 	var iStart1 int32
 133156 	var pLimit1 uintptr
 133157 	var addr2 int32
 133158 
 133159 	var r1 int32
 133160 	var addr3 int32
 133161 	var i int32
 133162 	var pKeyInfo uintptr
 133163 	var pLoop uintptr
 133164 	var apColl uintptr
 133165 	var nCol int32
 133166 	rc = SQLITE_OK
 133167 	pDelete = uintptr(0)
 133168 
 133169 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 133170 	pPrior = (*Select)(unsafe.Pointer(p)).FpPrior
 133171 	*(*SelectDest)(unsafe.Pointer(bp + 16)) = *(*SelectDest)(unsafe.Pointer(pDest))
 133172 
 133173 	v = Xsqlite3GetVdbe(tls, pParse)
 133174 
 133175 	if !(int32((*SelectDest)(unsafe.Pointer(bp+16)).FeDest) == SRT_EphemTab) {
 133176 		goto __1
 133177 	}
 133178 
 133179 	Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*SelectDest)(unsafe.Pointer(bp+16)).FiSDParm, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr)
 133180 	(*SelectDest)(unsafe.Pointer(bp + 16)).FeDest = U8(SRT_Table)
 133181 __1:
 133182 	;
 133183 	if !((*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_MultiValue) != 0) {
 133184 		goto __2
 133185 	}
 133186 	rc = multiSelectValues(tls, pParse, p, bp+16)
 133187 	if !(rc >= 0) {
 133188 		goto __3
 133189 	}
 133190 	goto multi_select_end
 133191 __3:
 133192 	;
 133193 	rc = SQLITE_OK
 133194 __2:
 133195 	;
 133196 	if !((*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Recursive) != U32(0) && hasAnchor(tls, p) != 0) {
 133197 		goto __4
 133198 	}
 133199 	generateWithRecursiveQuery(tls, pParse, p, bp+16)
 133200 	goto __5
 133201 __4:
 133202 	if !((*Select)(unsafe.Pointer(p)).FpOrderBy != 0) {
 133203 		goto __6
 133204 	}
 133205 	return multiSelectOrderBy(tls, pParse, p, pDest)
 133206 	goto __7
 133207 __6:
 133208 	if !((*Select)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0)) {
 133209 		goto __8
 133210 	}
 133211 	Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20375, 0)
 133212 	Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20390, 0)
 133213 __8:
 133214 	;
 133215 	switch int32((*Select)(unsafe.Pointer(p)).Fop) {
 133216 	case TK_ALL:
 133217 		goto __10
 133218 	case TK_EXCEPT:
 133219 		goto __11
 133220 	case TK_UNION:
 133221 		goto __12
 133222 	default:
 133223 		goto __13
 133224 	}
 133225 	goto __9
 133226 __10:
 133227 	addr = 0
 133228 	*(*int32)(unsafe.Pointer(bp + 56)) = 0
 133229 
 133230 	(*Select)(unsafe.Pointer(pPrior)).FiLimit = (*Select)(unsafe.Pointer(p)).FiLimit
 133231 	(*Select)(unsafe.Pointer(pPrior)).FiOffset = (*Select)(unsafe.Pointer(p)).FiOffset
 133232 	(*Select)(unsafe.Pointer(pPrior)).FpLimit = (*Select)(unsafe.Pointer(p)).FpLimit
 133233 
 133234 	rc = Xsqlite3Select(tls, pParse, pPrior, bp+16)
 133235 	(*Select)(unsafe.Pointer(pPrior)).FpLimit = uintptr(0)
 133236 	if !(rc != 0) {
 133237 		goto __14
 133238 	}
 133239 	goto multi_select_end
 133240 __14:
 133241 	;
 133242 	(*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0)
 133243 	(*Select)(unsafe.Pointer(p)).FiLimit = (*Select)(unsafe.Pointer(pPrior)).FiLimit
 133244 	(*Select)(unsafe.Pointer(p)).FiOffset = (*Select)(unsafe.Pointer(pPrior)).FiOffset
 133245 	if !((*Select)(unsafe.Pointer(p)).FiLimit != 0) {
 133246 		goto __15
 133247 	}
 133248 	addr = Xsqlite3VdbeAddOp1(tls, v, OP_IfNot, (*Select)(unsafe.Pointer(p)).FiLimit)
 133249 
 133250 	if !((*Select)(unsafe.Pointer(p)).FiOffset != 0) {
 133251 		goto __16
 133252 	}
 133253 	Xsqlite3VdbeAddOp3(tls, v, OP_OffsetLimit,
 133254 		(*Select)(unsafe.Pointer(p)).FiLimit, (*Select)(unsafe.Pointer(p)).FiOffset+1, (*Select)(unsafe.Pointer(p)).FiOffset)
 133255 __16:
 133256 	;
 133257 __15:
 133258 	;
 133259 	Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20115, 0)
 133260 
 133261 	rc = Xsqlite3Select(tls, pParse, p, bp+16)
 133262 
 133263 	pDelete = (*Select)(unsafe.Pointer(p)).FpPrior
 133264 	(*Select)(unsafe.Pointer(p)).FpPrior = pPrior
 133265 	(*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3LogEstAdd(tls, (*Select)(unsafe.Pointer(p)).FnSelectRow, (*Select)(unsafe.Pointer(pPrior)).FnSelectRow)
 133266 	if !((*Select)(unsafe.Pointer(p)).FpLimit != 0 &&
 133267 		Xsqlite3ExprIsInteger(tls, (*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpLimit)).FpLeft, bp+56) != 0 &&
 133268 		*(*int32)(unsafe.Pointer(bp + 56)) > 0 && int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > int32(Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp + 56)))))) {
 133269 		goto __17
 133270 	}
 133271 	(*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp + 56))))
 133272 __17:
 133273 	;
 133274 	if !(addr != 0) {
 133275 		goto __18
 133276 	}
 133277 	Xsqlite3VdbeJumpHere(tls, v, addr)
 133278 __18:
 133279 	;
 133280 	goto __9
 133281 
 133282 __11:
 133283 __12:
 133284 	op = U8(0)
 133285 
 133286 	priorOp = SRT_Union
 133287 	if !(int32((*SelectDest)(unsafe.Pointer(bp+16)).FeDest) == priorOp) {
 133288 		goto __19
 133289 	}
 133290 
 133291 	unionTab = (*SelectDest)(unsafe.Pointer(bp + 16)).FiSDParm
 133292 	goto __20
 133293 __19:
 133294 	unionTab = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 133295 
 133296 	addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, unionTab, 0)
 133297 
 133298 	*(*int32)(unsafe.Pointer(p + 20)) = addr1
 133299 	*(*U32)(unsafe.Pointer(findRightmost(tls, p) + 4)) |= U32(SF_UsesEphemeral)
 133300 
 133301 __20:
 133302 	;
 133303 	Xsqlite3SelectDestInit(tls, bp+64, priorOp, unionTab)
 133304 
 133305 	rc = Xsqlite3Select(tls, pParse, pPrior, bp+64)
 133306 	if !(rc != 0) {
 133307 		goto __21
 133308 	}
 133309 	goto multi_select_end
 133310 __21:
 133311 	;
 133312 	if !(int32((*Select)(unsafe.Pointer(p)).Fop) == TK_EXCEPT) {
 133313 		goto __22
 133314 	}
 133315 	op = U8(SRT_Except)
 133316 	goto __23
 133317 __22:
 133318 	;
 133319 	op = U8(SRT_Union)
 133320 __23:
 133321 	;
 133322 	(*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0)
 133323 	pLimit = (*Select)(unsafe.Pointer(p)).FpLimit
 133324 	(*Select)(unsafe.Pointer(p)).FpLimit = uintptr(0)
 133325 	(*SelectDest)(unsafe.Pointer(bp + 64)).FeDest = op
 133326 	Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20409, libc.VaList(bp, Xsqlite3SelectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop))))
 133327 
 133328 	rc = Xsqlite3Select(tls, pParse, p, bp+64)
 133329 
 133330 	pDelete = (*Select)(unsafe.Pointer(p)).FpPrior
 133331 	(*Select)(unsafe.Pointer(p)).FpPrior = pPrior
 133332 	(*Select)(unsafe.Pointer(p)).FpOrderBy = uintptr(0)
 133333 	if !(int32((*Select)(unsafe.Pointer(p)).Fop) == TK_UNION) {
 133334 		goto __24
 133335 	}
 133336 	(*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3LogEstAdd(tls, (*Select)(unsafe.Pointer(p)).FnSelectRow, (*Select)(unsafe.Pointer(pPrior)).FnSelectRow)
 133337 __24:
 133338 	;
 133339 	Xsqlite3ExprDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpLimit)
 133340 	(*Select)(unsafe.Pointer(p)).FpLimit = pLimit
 133341 	(*Select)(unsafe.Pointer(p)).FiLimit = 0
 133342 	(*Select)(unsafe.Pointer(p)).FiOffset = 0
 133343 
 133344 	if !(int32((*SelectDest)(unsafe.Pointer(bp+16)).FeDest) != priorOp && int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) {
 133345 		goto __25
 133346 	}
 133347 	iBreak = Xsqlite3VdbeMakeLabel(tls, pParse)
 133348 	iCont = Xsqlite3VdbeMakeLabel(tls, pParse)
 133349 	computeLimitRegisters(tls, pParse, p, iBreak)
 133350 	Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, unionTab, iBreak)
 133351 	iStart = Xsqlite3VdbeCurrentAddr(tls, v)
 133352 	selectInnerLoop(tls, pParse, p, unionTab,
 133353 		uintptr(0), uintptr(0), bp+16, iCont, iBreak)
 133354 	Xsqlite3VdbeResolveLabel(tls, v, iCont)
 133355 	Xsqlite3VdbeAddOp2(tls, v, OP_Next, unionTab, iStart)
 133356 	Xsqlite3VdbeResolveLabel(tls, v, iBreak)
 133357 	Xsqlite3VdbeAddOp2(tls, v, OP_Close, unionTab, 0)
 133358 __25:
 133359 	;
 133360 	goto __9
 133361 
 133362 __13:
 133363 	;
 133364 	tab1 = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 133365 	tab2 = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 133366 
 133367 	addr2 = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, tab1, 0)
 133368 
 133369 	*(*int32)(unsafe.Pointer(p + 20)) = addr2
 133370 	*(*U32)(unsafe.Pointer(findRightmost(tls, p) + 4)) |= U32(SF_UsesEphemeral)
 133371 
 133372 	Xsqlite3SelectDestInit(tls, bp+104, SRT_Union, tab1)
 133373 
 133374 	rc = Xsqlite3Select(tls, pParse, pPrior, bp+104)
 133375 	if !(rc != 0) {
 133376 		goto __26
 133377 	}
 133378 	goto multi_select_end
 133379 __26:
 133380 	;
 133381 	addr2 = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, tab2, 0)
 133382 
 133383 	*(*int32)(unsafe.Pointer(p + 20 + 1*4)) = addr2
 133384 	(*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0)
 133385 	pLimit1 = (*Select)(unsafe.Pointer(p)).FpLimit
 133386 	(*Select)(unsafe.Pointer(p)).FpLimit = uintptr(0)
 133387 	(*SelectDest)(unsafe.Pointer(bp + 104)).FiSDParm = tab2
 133388 	Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20409, libc.VaList(bp+8, Xsqlite3SelectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop))))
 133389 
 133390 	rc = Xsqlite3Select(tls, pParse, p, bp+104)
 133391 
 133392 	pDelete = (*Select)(unsafe.Pointer(p)).FpPrior
 133393 	(*Select)(unsafe.Pointer(p)).FpPrior = pPrior
 133394 	if !(int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > int32((*Select)(unsafe.Pointer(pPrior)).FnSelectRow)) {
 133395 		goto __27
 133396 	}
 133397 	(*Select)(unsafe.Pointer(p)).FnSelectRow = (*Select)(unsafe.Pointer(pPrior)).FnSelectRow
 133398 __27:
 133399 	;
 133400 	Xsqlite3ExprDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpLimit)
 133401 	(*Select)(unsafe.Pointer(p)).FpLimit = pLimit1
 133402 
 133403 	if !(rc != 0) {
 133404 		goto __28
 133405 	}
 133406 	goto __9
 133407 __28:
 133408 	;
 133409 	iBreak1 = Xsqlite3VdbeMakeLabel(tls, pParse)
 133410 	iCont1 = Xsqlite3VdbeMakeLabel(tls, pParse)
 133411 	computeLimitRegisters(tls, pParse, p, iBreak1)
 133412 	Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, tab1, iBreak1)
 133413 	r1 = Xsqlite3GetTempReg(tls, pParse)
 133414 	iStart1 = Xsqlite3VdbeAddOp2(tls, v, OP_RowData, tab1, r1)
 133415 	Xsqlite3VdbeAddOp4Int(tls, v, OP_NotFound, tab2, iCont1, r1, 0)
 133416 
 133417 	Xsqlite3ReleaseTempReg(tls, pParse, r1)
 133418 	selectInnerLoop(tls, pParse, p, tab1,
 133419 		uintptr(0), uintptr(0), bp+16, iCont1, iBreak1)
 133420 	Xsqlite3VdbeResolveLabel(tls, v, iCont1)
 133421 	Xsqlite3VdbeAddOp2(tls, v, OP_Next, tab1, iStart1)
 133422 	Xsqlite3VdbeResolveLabel(tls, v, iBreak1)
 133423 	Xsqlite3VdbeAddOp2(tls, v, OP_Close, tab2, 0)
 133424 	Xsqlite3VdbeAddOp2(tls, v, OP_Close, tab1, 0)
 133425 	goto __9
 133426 
 133427 __9:
 133428 	;
 133429 	if !((*Select)(unsafe.Pointer(p)).FpNext == uintptr(0)) {
 133430 		goto __29
 133431 	}
 133432 	Xsqlite3VdbeExplainPop(tls, pParse)
 133433 __29:
 133434 	;
 133435 __7:
 133436 	;
 133437 __5:
 133438 	;
 133439 	if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
 133440 		goto __30
 133441 	}
 133442 	goto multi_select_end
 133443 __30:
 133444 	;
 133445 	if !((*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_UsesEphemeral) != 0) {
 133446 		goto __31
 133447 	}
 133448 
 133449 	nCol = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr
 133450 	pKeyInfo = Xsqlite3KeyInfoAlloc(tls, db, nCol, 1)
 133451 	if !!(pKeyInfo != 0) {
 133452 		goto __32
 133453 	}
 133454 	rc = SQLITE_NOMEM
 133455 	goto multi_select_end
 133456 __32:
 133457 	;
 133458 	i = 0
 133459 	apColl = pKeyInfo + 32
 133460 __33:
 133461 	if !(i < nCol) {
 133462 		goto __35
 133463 	}
 133464 	*(*uintptr)(unsafe.Pointer(apColl)) = multiSelectCollSeq(tls, pParse, p, i)
 133465 	if !(uintptr(0) == *(*uintptr)(unsafe.Pointer(apColl))) {
 133466 		goto __36
 133467 	}
 133468 	*(*uintptr)(unsafe.Pointer(apColl)) = (*Sqlite3)(unsafe.Pointer(db)).FpDfltColl
 133469 __36:
 133470 	;
 133471 	goto __34
 133472 __34:
 133473 	i++
 133474 	apColl += 8
 133475 	goto __33
 133476 	goto __35
 133477 __35:
 133478 	;
 133479 	pLoop = p
 133480 __37:
 133481 	if !(pLoop != 0) {
 133482 		goto __39
 133483 	}
 133484 	i = 0
 133485 __40:
 133486 	if !(i < 2) {
 133487 		goto __42
 133488 	}
 133489 	addr3 = *(*int32)(unsafe.Pointer(pLoop + 20 + uintptr(i)*4))
 133490 	if !(addr3 < 0) {
 133491 		goto __43
 133492 	}
 133493 
 133494 	goto __42
 133495 __43:
 133496 	;
 133497 	Xsqlite3VdbeChangeP2(tls, v, addr3, nCol)
 133498 	Xsqlite3VdbeChangeP4(tls, v, addr3, Xsqlite3KeyInfoRef(tls, pKeyInfo),
 133499 		-8)
 133500 	*(*int32)(unsafe.Pointer(pLoop + 20 + uintptr(i)*4)) = -1
 133501 	goto __41
 133502 __41:
 133503 	i++
 133504 	goto __40
 133505 	goto __42
 133506 __42:
 133507 	;
 133508 	goto __38
 133509 __38:
 133510 	pLoop = (*Select)(unsafe.Pointer(pLoop)).FpPrior
 133511 	goto __37
 133512 	goto __39
 133513 __39:
 133514 	;
 133515 	Xsqlite3KeyInfoUnref(tls, pKeyInfo)
 133516 __31:
 133517 	;
 133518 multi_select_end:
 133519 	(*SelectDest)(unsafe.Pointer(pDest)).FiSdst = (*SelectDest)(unsafe.Pointer(bp + 16)).FiSdst
 133520 	(*SelectDest)(unsafe.Pointer(pDest)).FnSdst = (*SelectDest)(unsafe.Pointer(bp + 16)).FnSdst
 133521 	if !(pDelete != 0) {
 133522 		goto __44
 133523 	}
 133524 	Xsqlite3ParserAddCleanup(tls, pParse,
 133525 		*(*uintptr)(unsafe.Pointer(&struct {
 133526 			f func(*libc.TLS, uintptr, uintptr)
 133527 		}{Xsqlite3SelectDelete})),
 133528 		pDelete)
 133529 __44:
 133530 	;
 133531 	return rc
 133532 }
 133533 
 133534 // Error message for when two or more terms of a compound select have different
 133535 // size result sets.
 133536 func Xsqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) {
 133537 	bp := tls.Alloc(8)
 133538 	defer tls.Free(8)
 133539 
 133540 	if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Values) != 0 {
 133541 		Xsqlite3ErrorMsg(tls, pParse, ts+20430, 0)
 133542 	} else {
 133543 		Xsqlite3ErrorMsg(tls, pParse,
 133544 			ts+20476,
 133545 			libc.VaList(bp, Xsqlite3SelectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop))))
 133546 	}
 133547 }
 133548 
 133549 func generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uintptr, pDest uintptr, regReturn int32, regPrev int32, pKeyInfo uintptr, iBreak int32) int32 {
 133550 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 133551 	var iContinue int32
 133552 	var addr int32
 133553 
 133554 	addr = Xsqlite3VdbeCurrentAddr(tls, v)
 133555 	iContinue = Xsqlite3VdbeMakeLabel(tls, pParse)
 133556 
 133557 	if regPrev != 0 {
 133558 		var addr1 int32
 133559 		var addr2 int32
 133560 		addr1 = Xsqlite3VdbeAddOp1(tls, v, OP_IfNot, regPrev)
 133561 		addr2 = Xsqlite3VdbeAddOp4(tls, v, OP_Compare, (*SelectDest)(unsafe.Pointer(pIn)).FiSdst, regPrev+1, (*SelectDest)(unsafe.Pointer(pIn)).FnSdst,
 133562 			Xsqlite3KeyInfoRef(tls, pKeyInfo), -8)
 133563 		Xsqlite3VdbeAddOp3(tls, v, OP_Jump, addr2+2, iContinue, addr2+2)
 133564 		Xsqlite3VdbeJumpHere(tls, v, addr1)
 133565 		Xsqlite3VdbeAddOp3(tls, v, OP_Copy, (*SelectDest)(unsafe.Pointer(pIn)).FiSdst, regPrev+1, (*SelectDest)(unsafe.Pointer(pIn)).FnSdst-1)
 133566 		Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, regPrev)
 133567 	}
 133568 	if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 {
 133569 		return 0
 133570 	}
 133571 
 133572 	codeOffset(tls, v, (*Select)(unsafe.Pointer(p)).FiOffset, iContinue)
 133573 
 133574 	switch int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest) {
 133575 	case SRT_EphemTab:
 133576 		{
 133577 			var r1 int32 = Xsqlite3GetTempReg(tls, pParse)
 133578 			var r2 int32 = Xsqlite3GetTempReg(tls, pParse)
 133579 			Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, (*SelectDest)(unsafe.Pointer(pIn)).FiSdst, (*SelectDest)(unsafe.Pointer(pIn)).FnSdst, r1)
 133580 			Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm, r2)
 133581 			Xsqlite3VdbeAddOp3(tls, v, OP_Insert, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm, r1, r2)
 133582 			Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND))
 133583 			Xsqlite3ReleaseTempReg(tls, pParse, r2)
 133584 			Xsqlite3ReleaseTempReg(tls, pParse, r1)
 133585 			break
 133586 
 133587 		}
 133588 
 133589 	case SRT_Set:
 133590 		{
 133591 			var r1 int32
 133592 
 133593 			r1 = Xsqlite3GetTempReg(tls, pParse)
 133594 			Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, (*SelectDest)(unsafe.Pointer(pIn)).FiSdst, (*SelectDest)(unsafe.Pointer(pIn)).FnSdst,
 133595 				r1, (*SelectDest)(unsafe.Pointer(pDest)).FzAffSdst, (*SelectDest)(unsafe.Pointer(pIn)).FnSdst)
 133596 			Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm, r1,
 133597 				(*SelectDest)(unsafe.Pointer(pIn)).FiSdst, (*SelectDest)(unsafe.Pointer(pIn)).FnSdst)
 133598 			Xsqlite3ReleaseTempReg(tls, pParse, r1)
 133599 			break
 133600 
 133601 		}
 133602 
 133603 	case SRT_Mem:
 133604 		{
 133605 			Xsqlite3ExprCodeMove(tls, pParse, (*SelectDest)(unsafe.Pointer(pIn)).FiSdst, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm, (*SelectDest)(unsafe.Pointer(pIn)).FnSdst)
 133606 
 133607 			break
 133608 
 133609 		}
 133610 
 133611 	case SRT_Coroutine:
 133612 		{
 133613 			if (*SelectDest)(unsafe.Pointer(pDest)).FiSdst == 0 {
 133614 				(*SelectDest)(unsafe.Pointer(pDest)).FiSdst = Xsqlite3GetTempRange(tls, pParse, (*SelectDest)(unsafe.Pointer(pIn)).FnSdst)
 133615 				(*SelectDest)(unsafe.Pointer(pDest)).FnSdst = (*SelectDest)(unsafe.Pointer(pIn)).FnSdst
 133616 			}
 133617 			Xsqlite3ExprCodeMove(tls, pParse, (*SelectDest)(unsafe.Pointer(pIn)).FiSdst, (*SelectDest)(unsafe.Pointer(pDest)).FiSdst, (*SelectDest)(unsafe.Pointer(pIn)).FnSdst)
 133618 			Xsqlite3VdbeAddOp1(tls, v, OP_Yield, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm)
 133619 			break
 133620 
 133621 		}
 133622 
 133623 	default:
 133624 		{
 133625 			Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, (*SelectDest)(unsafe.Pointer(pIn)).FiSdst, (*SelectDest)(unsafe.Pointer(pIn)).FnSdst)
 133626 			break
 133627 
 133628 		}
 133629 	}
 133630 
 133631 	if (*Select)(unsafe.Pointer(p)).FiLimit != 0 {
 133632 		Xsqlite3VdbeAddOp2(tls, v, OP_DecrJumpZero, (*Select)(unsafe.Pointer(p)).FiLimit, iBreak)
 133633 	}
 133634 
 133635 	Xsqlite3VdbeResolveLabel(tls, v, iContinue)
 133636 	Xsqlite3VdbeAddOp1(tls, v, OP_Return, regReturn)
 133637 
 133638 	return addr
 133639 }
 133640 
 133641 func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 {
 133642 	bp := tls.Alloc(88)
 133643 	defer tls.Free(88)
 133644 
 133645 	var i int32
 133646 	var j int32
 133647 	var pPrior uintptr
 133648 	var pSplit uintptr
 133649 	var nSelect int32
 133650 	var v uintptr
 133651 
 133652 	var regAddrA int32
 133653 	var regAddrB int32
 133654 	var addrSelectA int32
 133655 	var addrSelectB int32
 133656 	var regOutA int32
 133657 	var regOutB int32
 133658 	var addrOutA int32
 133659 	var addrOutB int32 = 0
 133660 	var addrEofA int32
 133661 	var addrEofA_noB int32
 133662 	var addrEofB int32
 133663 	var addrAltB int32
 133664 	var addrAeqB int32
 133665 	var addrAgtB int32
 133666 	var regLimitA int32
 133667 	var regLimitB int32
 133668 	var regPrev int32
 133669 	var savedLimit int32
 133670 	var savedOffset int32
 133671 	var labelCmpr int32
 133672 	var labelEnd int32
 133673 	var addr1 int32
 133674 	var op int32
 133675 	var pKeyDup uintptr = uintptr(0)
 133676 	var pKeyMerge uintptr
 133677 	var db uintptr
 133678 	var pOrderBy uintptr
 133679 	var nOrderBy int32
 133680 	var aPermute uintptr
 133681 
 133682 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 133683 	v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 133684 
 133685 	labelEnd = Xsqlite3VdbeMakeLabel(tls, pParse)
 133686 	labelCmpr = Xsqlite3VdbeMakeLabel(tls, pParse)
 133687 
 133688 	op = int32((*Select)(unsafe.Pointer(p)).Fop)
 133689 
 133690 	pOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy
 133691 
 133692 	nOrderBy = (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr
 133693 
 133694 	if op != TK_ALL {
 133695 		for i = 1; int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 && i <= (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr; i++ {
 133696 			var pItem uintptr
 133697 			j = 0
 133698 			pItem = pOrderBy + 8
 133699 		__1:
 133700 			if !(j < nOrderBy) {
 133701 				goto __3
 133702 			}
 133703 			{
 133704 				if int32(*(*U16)(unsafe.Pointer(pItem + 24))) == i {
 133705 					goto __3
 133706 				}
 133707 
 133708 			}
 133709 			goto __2
 133710 		__2:
 133711 			j++
 133712 			pItem += 32
 133713 			goto __1
 133714 			goto __3
 133715 		__3:
 133716 			;
 133717 			if j == nOrderBy {
 133718 				var pNew uintptr = Xsqlite3Expr(tls, db, TK_INTEGER, uintptr(0))
 133719 				if pNew == uintptr(0) {
 133720 					return SQLITE_NOMEM
 133721 				}
 133722 				*(*U32)(unsafe.Pointer(pNew + 4)) |= U32(EP_IntValue)
 133723 				*(*int32)(unsafe.Pointer(pNew + 8)) = i
 133724 				(*Select)(unsafe.Pointer(p)).FpOrderBy = libc.AssignUintptr(&pOrderBy, Xsqlite3ExprListAppend(tls, pParse, pOrderBy, pNew))
 133725 				if pOrderBy != 0 {
 133726 					*(*U16)(unsafe.Pointer(pOrderBy + 8 + uintptr(libc.PostIncInt32(&nOrderBy, 1))*32 + 24)) = U16(i)
 133727 				}
 133728 			}
 133729 		}
 133730 	}
 133731 
 133732 	aPermute = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(U32(0)))*uint64(nOrderBy+1))
 133733 	if aPermute != 0 {
 133734 		var pItem uintptr
 133735 		*(*U32)(unsafe.Pointer(aPermute)) = U32(nOrderBy)
 133736 		i = 1
 133737 		pItem = pOrderBy + 8
 133738 	__4:
 133739 		if !(i <= nOrderBy) {
 133740 			goto __6
 133741 		}
 133742 		{
 133743 			*(*U32)(unsafe.Pointer(aPermute + uintptr(i)*4)) = U32(int32(*(*U16)(unsafe.Pointer(pItem + 24))) - 1)
 133744 
 133745 		}
 133746 		goto __5
 133747 	__5:
 133748 		i++
 133749 		pItem += 32
 133750 		goto __4
 133751 		goto __6
 133752 	__6:
 133753 		;
 133754 		pKeyMerge = multiSelectOrderByKeyInfo(tls, pParse, p, 1)
 133755 	} else {
 133756 		pKeyMerge = uintptr(0)
 133757 	}
 133758 
 133759 	if op == TK_ALL {
 133760 		regPrev = 0
 133761 	} else {
 133762 		var nExpr int32 = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr
 133763 
 133764 		regPrev = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 133765 		*(*int32)(unsafe.Pointer(pParse + 56)) += nExpr + 1
 133766 		Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regPrev)
 133767 		pKeyDup = Xsqlite3KeyInfoAlloc(tls, db, nExpr, 1)
 133768 		if pKeyDup != 0 {
 133769 			for i = 0; i < nExpr; i++ {
 133770 				*(*uintptr)(unsafe.Pointer(pKeyDup + 32 + uintptr(i)*8)) = multiSelectCollSeq(tls, pParse, p, i)
 133771 				*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyDup)).FaSortFlags + uintptr(i))) = U8(0)
 133772 			}
 133773 		}
 133774 	}
 133775 
 133776 	nSelect = 1
 133777 	if (op == TK_ALL || op == TK_UNION) &&
 133778 		(*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_BalancedMerge) == U32(0) {
 133779 		for pSplit = p; (*Select)(unsafe.Pointer(pSplit)).FpPrior != uintptr(0) && int32((*Select)(unsafe.Pointer(pSplit)).Fop) == op; pSplit = (*Select)(unsafe.Pointer(pSplit)).FpPrior {
 133780 			nSelect++
 133781 
 133782 		}
 133783 	}
 133784 	if nSelect <= 3 {
 133785 		pSplit = p
 133786 	} else {
 133787 		pSplit = p
 133788 		for i = 2; i < nSelect; i = i + 2 {
 133789 			pSplit = (*Select)(unsafe.Pointer(pSplit)).FpPrior
 133790 		}
 133791 	}
 133792 	pPrior = (*Select)(unsafe.Pointer(pSplit)).FpPrior
 133793 
 133794 	(*Select)(unsafe.Pointer(pSplit)).FpPrior = uintptr(0)
 133795 	(*Select)(unsafe.Pointer(pPrior)).FpNext = uintptr(0)
 133796 
 133797 	(*Select)(unsafe.Pointer(pPrior)).FpOrderBy = Xsqlite3ExprListDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pOrderBy, 0)
 133798 	Xsqlite3ResolveOrderGroupBy(tls, pParse, p, (*Select)(unsafe.Pointer(p)).FpOrderBy, ts+8575)
 133799 	Xsqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*Select)(unsafe.Pointer(pPrior)).FpOrderBy, ts+8575)
 133800 
 133801 	computeLimitRegisters(tls, pParse, p, labelEnd)
 133802 	if (*Select)(unsafe.Pointer(p)).FiLimit != 0 && op == TK_ALL {
 133803 		regLimitA = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 133804 		regLimitB = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 133805 		Xsqlite3VdbeAddOp2(tls, v, OP_Copy, func() int32 {
 133806 			if (*Select)(unsafe.Pointer(p)).FiOffset != 0 {
 133807 				return (*Select)(unsafe.Pointer(p)).FiOffset + 1
 133808 			}
 133809 			return (*Select)(unsafe.Pointer(p)).FiLimit
 133810 		}(),
 133811 			regLimitA)
 133812 		Xsqlite3VdbeAddOp2(tls, v, OP_Copy, regLimitA, regLimitB)
 133813 	} else {
 133814 		regLimitA = libc.AssignInt32(&regLimitB, 0)
 133815 	}
 133816 	Xsqlite3ExprDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpLimit)
 133817 	(*Select)(unsafe.Pointer(p)).FpLimit = uintptr(0)
 133818 
 133819 	regAddrA = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 133820 	regAddrB = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 133821 	regOutA = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 133822 	regOutB = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 133823 	Xsqlite3SelectDestInit(tls, bp+8, SRT_Coroutine, regAddrA)
 133824 	Xsqlite3SelectDestInit(tls, bp+48, SRT_Coroutine, regAddrB)
 133825 
 133826 	Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20558, libc.VaList(bp, Xsqlite3SelectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop))))
 133827 
 133828 	addrSelectA = Xsqlite3VdbeCurrentAddr(tls, v) + 1
 133829 	addr1 = Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regAddrA, 0, addrSelectA)
 133830 
 133831 	(*Select)(unsafe.Pointer(pPrior)).FiLimit = regLimitA
 133832 	Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20569, 0)
 133833 	Xsqlite3Select(tls, pParse, pPrior, bp+8)
 133834 	Xsqlite3VdbeEndCoroutine(tls, v, regAddrA)
 133835 	Xsqlite3VdbeJumpHere(tls, v, addr1)
 133836 
 133837 	addrSelectB = Xsqlite3VdbeCurrentAddr(tls, v) + 1
 133838 	addr1 = Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regAddrB, 0, addrSelectB)
 133839 
 133840 	savedLimit = (*Select)(unsafe.Pointer(p)).FiLimit
 133841 	savedOffset = (*Select)(unsafe.Pointer(p)).FiOffset
 133842 	(*Select)(unsafe.Pointer(p)).FiLimit = regLimitB
 133843 	(*Select)(unsafe.Pointer(p)).FiOffset = 0
 133844 	Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20574, 0)
 133845 	Xsqlite3Select(tls, pParse, p, bp+48)
 133846 	(*Select)(unsafe.Pointer(p)).FiLimit = savedLimit
 133847 	(*Select)(unsafe.Pointer(p)).FiOffset = savedOffset
 133848 	Xsqlite3VdbeEndCoroutine(tls, v, regAddrB)
 133849 
 133850 	addrOutA = generateOutputSubroutine(tls, pParse,
 133851 		p, bp+8, pDest, regOutA,
 133852 		regPrev, pKeyDup, labelEnd)
 133853 
 133854 	if op == TK_ALL || op == TK_UNION {
 133855 		addrOutB = generateOutputSubroutine(tls, pParse,
 133856 			p, bp+48, pDest, regOutB,
 133857 			regPrev, pKeyDup, labelEnd)
 133858 	}
 133859 	Xsqlite3KeyInfoUnref(tls, pKeyDup)
 133860 
 133861 	if op == TK_EXCEPT || op == TK_INTERSECT {
 133862 		addrEofA_noB = libc.AssignInt32(&addrEofA, labelEnd)
 133863 	} else {
 133864 		addrEofA = Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, regOutB, addrOutB)
 133865 		addrEofA_noB = Xsqlite3VdbeAddOp2(tls, v, OP_Yield, regAddrB, labelEnd)
 133866 
 133867 		Xsqlite3VdbeGoto(tls, v, addrEofA)
 133868 		(*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3LogEstAdd(tls, (*Select)(unsafe.Pointer(p)).FnSelectRow, (*Select)(unsafe.Pointer(pPrior)).FnSelectRow)
 133869 	}
 133870 
 133871 	if op == TK_INTERSECT {
 133872 		addrEofB = addrEofA
 133873 		if int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > int32((*Select)(unsafe.Pointer(pPrior)).FnSelectRow) {
 133874 			(*Select)(unsafe.Pointer(p)).FnSelectRow = (*Select)(unsafe.Pointer(pPrior)).FnSelectRow
 133875 		}
 133876 	} else {
 133877 		addrEofB = Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, regOutA, addrOutA)
 133878 		Xsqlite3VdbeAddOp2(tls, v, OP_Yield, regAddrA, labelEnd)
 133879 		Xsqlite3VdbeGoto(tls, v, addrEofB)
 133880 	}
 133881 
 133882 	addrAltB = Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, regOutA, addrOutA)
 133883 	Xsqlite3VdbeAddOp2(tls, v, OP_Yield, regAddrA, addrEofA)
 133884 	Xsqlite3VdbeGoto(tls, v, labelCmpr)
 133885 
 133886 	if op == TK_ALL {
 133887 		addrAeqB = addrAltB
 133888 	} else if op == TK_INTERSECT {
 133889 		addrAeqB = addrAltB
 133890 		addrAltB++
 133891 	} else {
 133892 		addrAeqB = Xsqlite3VdbeAddOp2(tls, v, OP_Yield, regAddrA, addrEofA)
 133893 		Xsqlite3VdbeGoto(tls, v, labelCmpr)
 133894 	}
 133895 
 133896 	addrAgtB = Xsqlite3VdbeCurrentAddr(tls, v)
 133897 	if op == TK_ALL || op == TK_UNION {
 133898 		Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, regOutB, addrOutB)
 133899 	}
 133900 	Xsqlite3VdbeAddOp2(tls, v, OP_Yield, regAddrB, addrEofB)
 133901 	Xsqlite3VdbeGoto(tls, v, labelCmpr)
 133902 
 133903 	Xsqlite3VdbeJumpHere(tls, v, addr1)
 133904 	Xsqlite3VdbeAddOp2(tls, v, OP_Yield, regAddrA, addrEofA_noB)
 133905 	Xsqlite3VdbeAddOp2(tls, v, OP_Yield, regAddrB, addrEofB)
 133906 
 133907 	Xsqlite3VdbeResolveLabel(tls, v, labelCmpr)
 133908 	Xsqlite3VdbeAddOp4(tls, v, OP_Permutation, 0, 0, 0, aPermute, -14)
 133909 	Xsqlite3VdbeAddOp4(tls, v, OP_Compare, (*SelectDest)(unsafe.Pointer(bp+8)).FiSdst, (*SelectDest)(unsafe.Pointer(bp+48)).FiSdst, nOrderBy,
 133910 		pKeyMerge, -8)
 133911 	Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_PERMUTE))
 133912 	Xsqlite3VdbeAddOp3(tls, v, OP_Jump, addrAltB, addrAeqB, addrAgtB)
 133913 
 133914 	Xsqlite3VdbeResolveLabel(tls, v, labelEnd)
 133915 
 133916 	if (*Select)(unsafe.Pointer(pSplit)).FpPrior != 0 {
 133917 		Xsqlite3ParserAddCleanup(tls, pParse,
 133918 			*(*uintptr)(unsafe.Pointer(&struct {
 133919 				f func(*libc.TLS, uintptr, uintptr)
 133920 			}{Xsqlite3SelectDelete})), (*Select)(unsafe.Pointer(pSplit)).FpPrior)
 133921 	}
 133922 	(*Select)(unsafe.Pointer(pSplit)).FpPrior = pPrior
 133923 	(*Select)(unsafe.Pointer(pPrior)).FpNext = pSplit
 133924 	Xsqlite3ExprListDelete(tls, db, (*Select)(unsafe.Pointer(pPrior)).FpOrderBy)
 133925 	(*Select)(unsafe.Pointer(pPrior)).FpOrderBy = uintptr(0)
 133926 
 133927 	Xsqlite3VdbeExplainPop(tls, pParse)
 133928 	return libc.Bool32((*Parse)(unsafe.Pointer(pParse)).FnErr != 0)
 133929 }
 133930 
 133931 // An instance of the SubstContext object describes an substitution edit
 133932 // to be performed on a parse tree.
 133933 //
 133934 // All references to columns in table iTable are to be replaced by corresponding
 133935 // expressions in pEList.
 133936 //
 133937 // ## About "isOuterJoin":
 133938 //
 133939 // The isOuterJoin column indicates that the replacement will occur into a
 133940 // position in the parent that NULL-able due to an OUTER JOIN.  Either the
 133941 // target slot in the parent is the right operand of a LEFT JOIN, or one of
 133942 // the left operands of a RIGHT JOIN.  In either case, we need to potentially
 133943 // bypass the substituted expression with OP_IfNullRow.
 133944 //
 133945 // Suppose the original expression is an integer constant. Even though the table
 133946 // has the nullRow flag set, because the expression is an integer constant,
 133947 // it will not be NULLed out.  So instead, we insert an OP_IfNullRow opcode
 133948 // that checks to see if the nullRow flag is set on the table.  If the nullRow
 133949 // flag is set, then the value in the register is set to NULL and the original
 133950 // expression is bypassed.  If the nullRow flag is not set, then the original
 133951 // expression runs to populate the register.
 133952 //
 133953 // Example where this is needed:
 133954 //
 133955 //	CREATE TABLE t1(a INTEGER PRIMARY KEY, b INT);
 133956 //	CREATE TABLE t2(x INT UNIQUE);
 133957 //
 133958 //	SELECT a,b,m,x FROM t1 LEFT JOIN (SELECT 59 AS m,x FROM t2) ON b=x;
 133959 //
 133960 // When the subquery on the right side of the LEFT JOIN is flattened, we
 133961 // have to add OP_IfNullRow in front of the OP_Integer that implements the
 133962 // "m" value of the subquery so that a NULL will be loaded instead of 59
 133963 // when processing a non-matched row of the left.
 133964 type SubstContext1 = struct {
 133965 	FpParse      uintptr
 133966 	FiTable      int32
 133967 	FiNewTable   int32
 133968 	FisOuterJoin int32
 133969 	F__ccgo_pad1 [4]byte
 133970 	FpEList      uintptr
 133971 	FpCList      uintptr
 133972 }
 133973 
 133974 // An instance of the SubstContext object describes an substitution edit
 133975 // to be performed on a parse tree.
 133976 //
 133977 // All references to columns in table iTable are to be replaced by corresponding
 133978 // expressions in pEList.
 133979 //
 133980 // ## About "isOuterJoin":
 133981 //
 133982 // The isOuterJoin column indicates that the replacement will occur into a
 133983 // position in the parent that NULL-able due to an OUTER JOIN.  Either the
 133984 // target slot in the parent is the right operand of a LEFT JOIN, or one of
 133985 // the left operands of a RIGHT JOIN.  In either case, we need to potentially
 133986 // bypass the substituted expression with OP_IfNullRow.
 133987 //
 133988 // Suppose the original expression is an integer constant. Even though the table
 133989 // has the nullRow flag set, because the expression is an integer constant,
 133990 // it will not be NULLed out.  So instead, we insert an OP_IfNullRow opcode
 133991 // that checks to see if the nullRow flag is set on the table.  If the nullRow
 133992 // flag is set, then the value in the register is set to NULL and the original
 133993 // expression is bypassed.  If the nullRow flag is not set, then the original
 133994 // expression runs to populate the register.
 133995 //
 133996 // Example where this is needed:
 133997 //
 133998 //	CREATE TABLE t1(a INTEGER PRIMARY KEY, b INT);
 133999 //	CREATE TABLE t2(x INT UNIQUE);
 134000 //
 134001 //	SELECT a,b,m,x FROM t1 LEFT JOIN (SELECT 59 AS m,x FROM t2) ON b=x;
 134002 //
 134003 // When the subquery on the right side of the LEFT JOIN is flattened, we
 134004 // have to add OP_IfNullRow in front of the OP_Integer that implements the
 134005 // "m" value of the subquery so that a NULL will be loaded instead of 59
 134006 // when processing a non-matched row of the left.
 134007 type SubstContext = SubstContext1
 134008 
 134009 func substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) uintptr {
 134010 	bp := tls.Alloc(72)
 134011 	defer tls.Free(72)
 134012 
 134013 	if pExpr == uintptr(0) {
 134014 		return uintptr(0)
 134015 	}
 134016 	if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_OuterON|EP_InnerON) != U32(0) &&
 134017 		*(*int32)(unsafe.Pointer(pExpr + 52)) == (*SubstContext)(unsafe.Pointer(pSubst)).FiTable {
 134018 		*(*int32)(unsafe.Pointer(pExpr + 52)) = (*SubstContext)(unsafe.Pointer(pSubst)).FiNewTable
 134019 	}
 134020 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN &&
 134021 		(*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SubstContext)(unsafe.Pointer(pSubst)).FiTable &&
 134022 		!((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_FixedCol) != U32(0)) {
 134023 		{
 134024 			var pNew uintptr
 134025 			var iColumn int32 = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)
 134026 			var pCopy uintptr = (*ExprList_item)(unsafe.Pointer((*SubstContext)(unsafe.Pointer(pSubst)).FpEList + 8 + uintptr(iColumn)*32)).FpExpr
 134027 
 134028 			if Xsqlite3ExprIsVector(tls, pCopy) != 0 {
 134029 				Xsqlite3VectorErrorMsg(tls, (*SubstContext)(unsafe.Pointer(pSubst)).FpParse, pCopy)
 134030 			} else {
 134031 				var db uintptr = (*Parse)(unsafe.Pointer((*SubstContext)(unsafe.Pointer(pSubst)).FpParse)).Fdb
 134032 				if (*SubstContext)(unsafe.Pointer(pSubst)).FisOuterJoin != 0 &&
 134033 					(int32((*Expr)(unsafe.Pointer(pCopy)).Fop) != TK_COLUMN || (*Expr)(unsafe.Pointer(pCopy)).FiTable != (*SubstContext)(unsafe.Pointer(pSubst)).FiNewTable) {
 134034 					libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Expr{})))
 134035 					(*Expr)(unsafe.Pointer(bp)).Fop = U8(TK_IF_NULL_ROW)
 134036 					(*Expr)(unsafe.Pointer(bp)).FpLeft = pCopy
 134037 					(*Expr)(unsafe.Pointer(bp)).FiTable = (*SubstContext)(unsafe.Pointer(pSubst)).FiNewTable
 134038 					(*Expr)(unsafe.Pointer(bp)).FiColumn = int16(-99)
 134039 					(*Expr)(unsafe.Pointer(bp)).Fflags = U32(EP_IfNullRow)
 134040 					pCopy = bp
 134041 				}
 134042 
 134043 				pNew = Xsqlite3ExprDup(tls, db, pCopy, 0)
 134044 				if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 134045 					Xsqlite3ExprDelete(tls, db, pNew)
 134046 					return pExpr
 134047 				}
 134048 				if (*SubstContext)(unsafe.Pointer(pSubst)).FisOuterJoin != 0 {
 134049 					*(*U32)(unsafe.Pointer(pNew + 4)) |= U32(EP_CanBeNull)
 134050 				}
 134051 				if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_OuterON|EP_InnerON) != U32(0) {
 134052 					Xsqlite3SetJoinExpr(tls, pNew, *(*int32)(unsafe.Pointer(pExpr + 52)),
 134053 						(*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_OuterON|EP_InnerON))
 134054 				}
 134055 				Xsqlite3ExprDelete(tls, db, pExpr)
 134056 				pExpr = pNew
 134057 				if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_TRUEFALSE {
 134058 					*(*int32)(unsafe.Pointer(pExpr + 8)) = Xsqlite3ExprTruthValue(tls, pExpr)
 134059 					(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_INTEGER)
 134060 					*(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_IntValue)
 134061 				}
 134062 
 134063 				{
 134064 					var pNat uintptr = Xsqlite3ExprCollSeq(tls, (*SubstContext)(unsafe.Pointer(pSubst)).FpParse, pExpr)
 134065 					var pColl uintptr = Xsqlite3ExprCollSeq(tls, (*SubstContext)(unsafe.Pointer(pSubst)).FpParse,
 134066 						(*ExprList_item)(unsafe.Pointer((*SubstContext)(unsafe.Pointer(pSubst)).FpCList+8+uintptr(iColumn)*32)).FpExpr)
 134067 					if pNat != pColl || int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLUMN && int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLLATE {
 134068 						pExpr = Xsqlite3ExprAddCollateString(tls, (*SubstContext)(unsafe.Pointer(pSubst)).FpParse, pExpr,
 134069 							func() uintptr {
 134070 								if pColl != 0 {
 134071 									return (*CollSeq)(unsafe.Pointer(pColl)).FzName
 134072 								}
 134073 								return ts + 1089
 134074 							}())
 134075 					}
 134076 
 134077 				}
 134078 				*(*U32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(libc.CplInt32(EP_Collate))
 134079 			}
 134080 
 134081 		}
 134082 	} else {
 134083 		if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IF_NULL_ROW && (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SubstContext)(unsafe.Pointer(pSubst)).FiTable {
 134084 			(*Expr)(unsafe.Pointer(pExpr)).FiTable = (*SubstContext)(unsafe.Pointer(pSubst)).FiNewTable
 134085 		}
 134086 		(*Expr)(unsafe.Pointer(pExpr)).FpLeft = substExpr(tls, pSubst, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
 134087 		(*Expr)(unsafe.Pointer(pExpr)).FpRight = substExpr(tls, pSubst, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
 134088 		if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) {
 134089 			substSelect(tls, pSubst, *(*uintptr)(unsafe.Pointer(pExpr + 32)), 1)
 134090 		} else {
 134091 			substExprList(tls, pSubst, *(*uintptr)(unsafe.Pointer(pExpr + 32)))
 134092 		}
 134093 		if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0) {
 134094 			var pWin uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 64))
 134095 			(*Window)(unsafe.Pointer(pWin)).FpFilter = substExpr(tls, pSubst, (*Window)(unsafe.Pointer(pWin)).FpFilter)
 134096 			substExprList(tls, pSubst, (*Window)(unsafe.Pointer(pWin)).FpPartition)
 134097 			substExprList(tls, pSubst, (*Window)(unsafe.Pointer(pWin)).FpOrderBy)
 134098 		}
 134099 	}
 134100 	return pExpr
 134101 }
 134102 
 134103 func substExprList(tls *libc.TLS, pSubst uintptr, pList uintptr) {
 134104 	var i int32
 134105 	if pList == uintptr(0) {
 134106 		return
 134107 	}
 134108 	for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ {
 134109 		(*ExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32)).FpExpr = substExpr(tls, pSubst, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*32)).FpExpr)
 134110 	}
 134111 }
 134112 
 134113 func substSelect(tls *libc.TLS, pSubst uintptr, p uintptr, doPrior int32) {
 134114 	var pSrc uintptr
 134115 	var pItem uintptr
 134116 	var i int32
 134117 	if !(p != 0) {
 134118 		return
 134119 	}
 134120 	for __ccgo := true; __ccgo; __ccgo = doPrior != 0 && libc.AssignUintptr(&p, (*Select)(unsafe.Pointer(p)).FpPrior) != uintptr(0) {
 134121 		substExprList(tls, pSubst, (*Select)(unsafe.Pointer(p)).FpEList)
 134122 		substExprList(tls, pSubst, (*Select)(unsafe.Pointer(p)).FpGroupBy)
 134123 		substExprList(tls, pSubst, (*Select)(unsafe.Pointer(p)).FpOrderBy)
 134124 		(*Select)(unsafe.Pointer(p)).FpHaving = substExpr(tls, pSubst, (*Select)(unsafe.Pointer(p)).FpHaving)
 134125 		(*Select)(unsafe.Pointer(p)).FpWhere = substExpr(tls, pSubst, (*Select)(unsafe.Pointer(p)).FpWhere)
 134126 		pSrc = (*Select)(unsafe.Pointer(p)).FpSrc
 134127 
 134128 		i = (*SrcList)(unsafe.Pointer(pSrc)).FnSrc
 134129 		pItem = pSrc + 8
 134130 	__1:
 134131 		if !(i > 0) {
 134132 			goto __3
 134133 		}
 134134 		{
 134135 			substSelect(tls, pSubst, (*SrcItem)(unsafe.Pointer(pItem)).FpSelect, 1)
 134136 			if uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x4>>2)) != 0 {
 134137 				substExprList(tls, pSubst, *(*uintptr)(unsafe.Pointer(pItem + 88)))
 134138 			}
 134139 
 134140 		}
 134141 		goto __2
 134142 	__2:
 134143 		i--
 134144 		pItem += 104
 134145 		goto __1
 134146 		goto __3
 134147 	__3:
 134148 	}
 134149 }
 134150 
 134151 func recomputeColumnsUsedExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 134152 	var pItem uintptr
 134153 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLUMN {
 134154 		return WRC_Continue
 134155 	}
 134156 	pItem = *(*uintptr)(unsafe.Pointer(pWalker + 40))
 134157 	if (*SrcItem)(unsafe.Pointer(pItem)).FiCursor != (*Expr)(unsafe.Pointer(pExpr)).FiTable {
 134158 		return WRC_Continue
 134159 	}
 134160 	if int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) < 0 {
 134161 		return WRC_Continue
 134162 	}
 134163 	*(*Bitmask)(unsafe.Pointer(pItem + 80)) |= Xsqlite3ExprColUsed(tls, pExpr)
 134164 	return WRC_Continue
 134165 }
 134166 
 134167 func recomputeColumnsUsed(tls *libc.TLS, pSelect uintptr, pSrcItem uintptr) {
 134168 	bp := tls.Alloc(48)
 134169 	defer tls.Free(48)
 134170 
 134171 	if (*SrcItem)(unsafe.Pointer(pSrcItem)).FpTab == uintptr(0) {
 134172 		return
 134173 	}
 134174 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Walker{})))
 134175 	(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 134176 		f func(*libc.TLS, uintptr, uintptr) int32
 134177 	}{recomputeColumnsUsedExpr}))
 134178 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
 134179 		f func(*libc.TLS, uintptr, uintptr) int32
 134180 	}{Xsqlite3SelectWalkNoop}))
 134181 	*(*uintptr)(unsafe.Pointer(bp + 40)) = pSrcItem
 134182 	(*SrcItem)(unsafe.Pointer(pSrcItem)).FcolUsed = uint64(0)
 134183 	Xsqlite3WalkSelect(tls, bp, pSelect)
 134184 }
 134185 
 134186 func srclistRenumberCursors(tls *libc.TLS, pParse uintptr, aCsrMap uintptr, pSrc uintptr, iExcept int32) {
 134187 	var i int32
 134188 	var pItem uintptr
 134189 	i = 0
 134190 	pItem = pSrc + 8
 134191 __1:
 134192 	if !(i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc) {
 134193 		goto __3
 134194 	}
 134195 	{
 134196 		if i != iExcept {
 134197 			var p uintptr
 134198 
 134199 			if !(int32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x40>>6) != 0) || *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*SrcItem)(unsafe.Pointer(pItem)).FiCursor+1)*4)) == 0 {
 134200 				*(*int32)(unsafe.Pointer(aCsrMap + uintptr((*SrcItem)(unsafe.Pointer(pItem)).FiCursor+1)*4)) = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 134201 			}
 134202 			(*SrcItem)(unsafe.Pointer(pItem)).FiCursor = *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*SrcItem)(unsafe.Pointer(pItem)).FiCursor+1)*4))
 134203 			for p = (*SrcItem)(unsafe.Pointer(pItem)).FpSelect; p != 0; p = (*Select)(unsafe.Pointer(p)).FpPrior {
 134204 				srclistRenumberCursors(tls, pParse, aCsrMap, (*Select)(unsafe.Pointer(p)).FpSrc, -1)
 134205 			}
 134206 		}
 134207 
 134208 	}
 134209 	goto __2
 134210 __2:
 134211 	i++
 134212 	pItem += 104
 134213 	goto __1
 134214 	goto __3
 134215 __3:
 134216 }
 134217 
 134218 func renumberCursorDoMapping(tls *libc.TLS, pWalker uintptr, piCursor uintptr) {
 134219 	var aCsrMap uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40))
 134220 	var iCsr int32 = *(*int32)(unsafe.Pointer(piCursor))
 134221 	if iCsr < *(*int32)(unsafe.Pointer(aCsrMap)) && *(*int32)(unsafe.Pointer(aCsrMap + uintptr(iCsr+1)*4)) > 0 {
 134222 		*(*int32)(unsafe.Pointer(piCursor)) = *(*int32)(unsafe.Pointer(aCsrMap + uintptr(iCsr+1)*4))
 134223 	}
 134224 }
 134225 
 134226 func renumberCursorsCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 134227 	var op int32 = int32((*Expr)(unsafe.Pointer(pExpr)).Fop)
 134228 	if op == TK_COLUMN || op == TK_IF_NULL_ROW {
 134229 		renumberCursorDoMapping(tls, pWalker, pExpr+44)
 134230 	}
 134231 	if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_OuterON) != U32(0) {
 134232 		renumberCursorDoMapping(tls, pWalker, pExpr+52)
 134233 	}
 134234 	return WRC_Continue
 134235 }
 134236 
 134237 func renumberCursors(tls *libc.TLS, pParse uintptr, p uintptr, iExcept int32, aCsrMap uintptr) {
 134238 	bp := tls.Alloc(48)
 134239 	defer tls.Free(48)
 134240 
 134241 	srclistRenumberCursors(tls, pParse, aCsrMap, (*Select)(unsafe.Pointer(p)).FpSrc, iExcept)
 134242 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Walker{})))
 134243 	*(*uintptr)(unsafe.Pointer(bp + 40)) = aCsrMap
 134244 	(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 134245 		f func(*libc.TLS, uintptr, uintptr) int32
 134246 	}{renumberCursorsCb}))
 134247 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
 134248 		f func(*libc.TLS, uintptr, uintptr) int32
 134249 	}{Xsqlite3SelectWalkNoop}))
 134250 	Xsqlite3WalkSelect(tls, bp, p)
 134251 }
 134252 
 134253 func findLeftmostExprlist(tls *libc.TLS, pSel uintptr) uintptr {
 134254 	for (*Select)(unsafe.Pointer(pSel)).FpPrior != 0 {
 134255 		pSel = (*Select)(unsafe.Pointer(pSel)).FpPrior
 134256 	}
 134257 	return (*Select)(unsafe.Pointer(pSel)).FpEList
 134258 }
 134259 
 134260 func compoundHasDifferentAffinities(tls *libc.TLS, p uintptr) int32 {
 134261 	var ii int32
 134262 	var pList uintptr
 134263 
 134264 	pList = (*Select)(unsafe.Pointer(p)).FpEList
 134265 	for ii = 0; ii < (*ExprList)(unsafe.Pointer(pList)).FnExpr; ii++ {
 134266 		var aff int8
 134267 		var pSub1 uintptr
 134268 
 134269 		aff = Xsqlite3ExprAffinity(tls, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(ii)*32)).FpExpr)
 134270 		for pSub1 = (*Select)(unsafe.Pointer(p)).FpPrior; pSub1 != 0; pSub1 = (*Select)(unsafe.Pointer(pSub1)).FpPrior {
 134271 			if int32(Xsqlite3ExprAffinity(tls, (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub1)).FpEList+8+uintptr(ii)*32)).FpExpr)) != int32(aff) {
 134272 				return 1
 134273 			}
 134274 		}
 134275 	}
 134276 	return 0
 134277 }
 134278 
 134279 func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAgg int32) int32 {
 134280 	bp := tls.Alloc(88)
 134281 	defer tls.Free(88)
 134282 
 134283 	var zSavedAuthContext uintptr = (*Parse)(unsafe.Pointer(pParse)).FzAuthContext
 134284 	var pParent uintptr
 134285 	var pSub uintptr
 134286 	var pSub1 uintptr
 134287 	var pSrc uintptr
 134288 	var pSubSrc uintptr
 134289 	var iParent int32
 134290 	var iNewParent int32 = -1
 134291 	var isOuterJoin int32 = 0
 134292 	var i int32
 134293 	var pWhere uintptr
 134294 	var pSubitem uintptr
 134295 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 134296 
 134297 	var aCsrMap uintptr = uintptr(0)
 134298 
 134299 	if (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_QueryFlattener) != U32(0) {
 134300 		return 0
 134301 	}
 134302 	pSrc = (*Select)(unsafe.Pointer(p)).FpSrc
 134303 
 134304 	pSubitem = pSrc + 8 + uintptr(iFrom)*104
 134305 	iParent = (*SrcItem)(unsafe.Pointer(pSubitem)).FiCursor
 134306 	pSub = (*SrcItem)(unsafe.Pointer(pSubitem)).FpSelect
 134307 
 134308 	if (*Select)(unsafe.Pointer(p)).FpWin != 0 || (*Select)(unsafe.Pointer(pSub)).FpWin != 0 {
 134309 		return 0
 134310 	}
 134311 
 134312 	pSubSrc = (*Select)(unsafe.Pointer(pSub)).FpSrc
 134313 
 134314 	if (*Select)(unsafe.Pointer(pSub)).FpLimit != 0 && (*Select)(unsafe.Pointer(p)).FpLimit != 0 {
 134315 		return 0
 134316 	}
 134317 	if (*Select)(unsafe.Pointer(pSub)).FpLimit != 0 && (*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub)).FpLimit)).FpRight != 0 {
 134318 		return 0
 134319 	}
 134320 	if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Compound) != U32(0) && (*Select)(unsafe.Pointer(pSub)).FpLimit != 0 {
 134321 		return 0
 134322 	}
 134323 	if (*SrcList)(unsafe.Pointer(pSubSrc)).FnSrc == 0 {
 134324 		return 0
 134325 	}
 134326 	if (*Select)(unsafe.Pointer(pSub)).FselFlags&U32(SF_Distinct) != 0 {
 134327 		return 0
 134328 	}
 134329 	if (*Select)(unsafe.Pointer(pSub)).FpLimit != 0 && ((*SrcList)(unsafe.Pointer(pSrc)).FnSrc > 1 || isAgg != 0) {
 134330 		return 0
 134331 	}
 134332 	if (*Select)(unsafe.Pointer(p)).FpOrderBy != 0 && (*Select)(unsafe.Pointer(pSub)).FpOrderBy != 0 {
 134333 		return 0
 134334 	}
 134335 	if isAgg != 0 && (*Select)(unsafe.Pointer(pSub)).FpOrderBy != 0 {
 134336 		return 0
 134337 	}
 134338 	if (*Select)(unsafe.Pointer(pSub)).FpLimit != 0 && (*Select)(unsafe.Pointer(p)).FpWhere != 0 {
 134339 		return 0
 134340 	}
 134341 	if (*Select)(unsafe.Pointer(pSub)).FpLimit != 0 && (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Distinct) != U32(0) {
 134342 		return 0
 134343 	}
 134344 	if (*Select)(unsafe.Pointer(pSub)).FselFlags&U32(SF_Recursive) != 0 {
 134345 		return 0
 134346 	}
 134347 
 134348 	if int32((*SrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&(JT_OUTER|JT_LTORJ) != 0 {
 134349 		if (*SrcList)(unsafe.Pointer(pSubSrc)).FnSrc > 1 ||
 134350 			int32((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSubSrc+8)).FpTab)).FeTabType) == TABTYP_VTAB ||
 134351 			(*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Distinct) != U32(0) ||
 134352 			int32((*SrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&JT_RIGHT != 0 {
 134353 			return 0
 134354 		}
 134355 		isOuterJoin = 1
 134356 	}
 134357 
 134358 	if iFrom > 0 && int32((*SrcItem)(unsafe.Pointer(pSubSrc+8)).Ffg.Fjointype)&JT_LTORJ != 0 {
 134359 		return 0
 134360 	}
 134361 	if uint32(int32(*(*uint16)(unsafe.Pointer(pSubitem + 60 + 4))&0x100>>8)) != 0 && int32((*CteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pSubitem + 96)))).FeM10d) == M10d_Yes {
 134362 		return 0
 134363 	}
 134364 
 134365 	if (*Select)(unsafe.Pointer(pSub)).FpPrior != 0 {
 134366 		var ii int32
 134367 		if (*Select)(unsafe.Pointer(pSub)).FpOrderBy != 0 {
 134368 			return 0
 134369 		}
 134370 		if isAgg != 0 || (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Distinct) != U32(0) || isOuterJoin > 0 {
 134371 			return 0
 134372 		}
 134373 		for pSub1 = pSub; pSub1 != 0; pSub1 = (*Select)(unsafe.Pointer(pSub1)).FpPrior {
 134374 			if (*Select)(unsafe.Pointer(pSub1)).FselFlags&U32(SF_Distinct|SF_Aggregate) != U32(0) ||
 134375 				(*Select)(unsafe.Pointer(pSub1)).FpPrior != 0 && int32((*Select)(unsafe.Pointer(pSub1)).Fop) != TK_ALL ||
 134376 				(*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub1)).FpSrc)).FnSrc < 1 ||
 134377 				(*Select)(unsafe.Pointer(pSub1)).FpWin != 0 {
 134378 				return 0
 134379 			}
 134380 			if iFrom > 0 && int32((*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub1)).FpSrc+8)).Ffg.Fjointype)&JT_LTORJ != 0 {
 134381 				return 0
 134382 			}
 134383 
 134384 		}
 134385 
 134386 		if (*Select)(unsafe.Pointer(p)).FpOrderBy != 0 {
 134387 			for ii = 0; ii < (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpOrderBy)).FnExpr; ii++ {
 134388 				if int32(*(*U16)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpOrderBy + 8 + uintptr(ii)*32 + 24))) == 0 {
 134389 					return 0
 134390 				}
 134391 			}
 134392 		}
 134393 
 134394 		if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Recursive) != 0 {
 134395 			return 0
 134396 		}
 134397 
 134398 		if compoundHasDifferentAffinities(tls, pSub) != 0 {
 134399 			return 0
 134400 		}
 134401 
 134402 		if (*SrcList)(unsafe.Pointer(pSrc)).FnSrc > 1 {
 134403 			if (*Parse)(unsafe.Pointer(pParse)).FnSelect > 500 {
 134404 				return 0
 134405 			}
 134406 			if (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_FlttnUnionAll) != U32(0) {
 134407 				return 0
 134408 			}
 134409 			aCsrMap = Xsqlite3DbMallocZero(tls, db, uint64(I64((*Parse)(unsafe.Pointer(pParse)).FnTab)+int64(1))*uint64(unsafe.Sizeof(int32(0))))
 134410 			if aCsrMap != 0 {
 134411 				*(*int32)(unsafe.Pointer(aCsrMap)) = (*Parse)(unsafe.Pointer(pParse)).FnTab
 134412 			}
 134413 		}
 134414 	}
 134415 
 134416 	(*Parse)(unsafe.Pointer(pParse)).FzAuthContext = (*SrcItem)(unsafe.Pointer(pSubitem)).FzName
 134417 	Xsqlite3AuthCheck(tls, pParse, SQLITE_SELECT, uintptr(0), uintptr(0), uintptr(0))
 134418 
 134419 	(*Parse)(unsafe.Pointer(pParse)).FzAuthContext = zSavedAuthContext
 134420 
 134421 	pSub1 = (*SrcItem)(unsafe.Pointer(pSubitem)).FpSelect
 134422 	Xsqlite3DbFree(tls, db, (*SrcItem)(unsafe.Pointer(pSubitem)).FzDatabase)
 134423 	Xsqlite3DbFree(tls, db, (*SrcItem)(unsafe.Pointer(pSubitem)).FzName)
 134424 	Xsqlite3DbFree(tls, db, (*SrcItem)(unsafe.Pointer(pSubitem)).FzAlias)
 134425 	(*SrcItem)(unsafe.Pointer(pSubitem)).FzDatabase = uintptr(0)
 134426 	(*SrcItem)(unsafe.Pointer(pSubitem)).FzName = uintptr(0)
 134427 	(*SrcItem)(unsafe.Pointer(pSubitem)).FzAlias = uintptr(0)
 134428 	(*SrcItem)(unsafe.Pointer(pSubitem)).FpSelect = uintptr(0)
 134429 
 134430 	for pSub = (*Select)(unsafe.Pointer(pSub)).FpPrior; pSub != 0; pSub = (*Select)(unsafe.Pointer(pSub)).FpPrior {
 134431 		var pNew uintptr
 134432 		var pOrderBy uintptr = (*Select)(unsafe.Pointer(p)).FpOrderBy
 134433 		var pLimit uintptr = (*Select)(unsafe.Pointer(p)).FpLimit
 134434 		var pPrior uintptr = (*Select)(unsafe.Pointer(p)).FpPrior
 134435 		var pItemTab uintptr = (*SrcItem)(unsafe.Pointer(pSubitem)).FpTab
 134436 		(*SrcItem)(unsafe.Pointer(pSubitem)).FpTab = uintptr(0)
 134437 		(*Select)(unsafe.Pointer(p)).FpOrderBy = uintptr(0)
 134438 		(*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0)
 134439 		(*Select)(unsafe.Pointer(p)).FpLimit = uintptr(0)
 134440 		pNew = Xsqlite3SelectDup(tls, db, p, 0)
 134441 		(*Select)(unsafe.Pointer(p)).FpLimit = pLimit
 134442 		(*Select)(unsafe.Pointer(p)).FpOrderBy = pOrderBy
 134443 		(*Select)(unsafe.Pointer(p)).Fop = U8(TK_ALL)
 134444 		(*SrcItem)(unsafe.Pointer(pSubitem)).FpTab = pItemTab
 134445 		if pNew == uintptr(0) {
 134446 			(*Select)(unsafe.Pointer(p)).FpPrior = pPrior
 134447 		} else {
 134448 			(*Select)(unsafe.Pointer(pNew)).FselId = U32(libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnSelect, 1))
 134449 			if aCsrMap != 0 && int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 {
 134450 				renumberCursors(tls, pParse, pNew, iFrom, aCsrMap)
 134451 			}
 134452 			(*Select)(unsafe.Pointer(pNew)).FpPrior = pPrior
 134453 			if pPrior != 0 {
 134454 				(*Select)(unsafe.Pointer(pPrior)).FpNext = pNew
 134455 			}
 134456 			(*Select)(unsafe.Pointer(pNew)).FpNext = p
 134457 			(*Select)(unsafe.Pointer(p)).FpPrior = pNew
 134458 
 134459 		}
 134460 
 134461 	}
 134462 	Xsqlite3DbFree(tls, db, aCsrMap)
 134463 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 134464 		(*SrcItem)(unsafe.Pointer(pSubitem)).FpSelect = pSub1
 134465 		return 1
 134466 	}
 134467 
 134468 	if (*SrcItem)(unsafe.Pointer(pSubitem)).FpTab != uintptr(0) {
 134469 		var pTabToDel uintptr = (*SrcItem)(unsafe.Pointer(pSubitem)).FpTab
 134470 		if (*Table)(unsafe.Pointer(pTabToDel)).FnTabRef == U32(1) {
 134471 			var pToplevel uintptr = func() uintptr {
 134472 				if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
 134473 					return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
 134474 				}
 134475 				return pParse
 134476 			}()
 134477 			Xsqlite3ParserAddCleanup(tls, pToplevel,
 134478 				*(*uintptr)(unsafe.Pointer(&struct {
 134479 					f func(*libc.TLS, uintptr, uintptr)
 134480 				}{Xsqlite3DeleteTable})),
 134481 				pTabToDel)
 134482 
 134483 		} else {
 134484 			(*Table)(unsafe.Pointer(pTabToDel)).FnTabRef--
 134485 		}
 134486 		(*SrcItem)(unsafe.Pointer(pSubitem)).FpTab = uintptr(0)
 134487 	}
 134488 
 134489 	pSub = pSub1
 134490 	pParent = p
 134491 __1:
 134492 	if !(pParent != 0) {
 134493 		goto __3
 134494 	}
 134495 	{
 134496 		var nSubSrc int32
 134497 		var jointype U8 = U8(0)
 134498 		var ltorj U8 = U8(int32((*SrcItem)(unsafe.Pointer(pSrc+8+uintptr(iFrom)*104)).Ffg.Fjointype) & JT_LTORJ)
 134499 
 134500 		pSubSrc = (*Select)(unsafe.Pointer(pSub)).FpSrc
 134501 		nSubSrc = (*SrcList)(unsafe.Pointer(pSubSrc)).FnSrc
 134502 		pSrc = (*Select)(unsafe.Pointer(pParent)).FpSrc
 134503 
 134504 		if pParent == p {
 134505 			jointype = (*SrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype
 134506 		}
 134507 
 134508 		if nSubSrc > 1 {
 134509 			pSrc = Xsqlite3SrcListEnlarge(tls, pParse, pSrc, nSubSrc-1, iFrom+1)
 134510 			if pSrc == uintptr(0) {
 134511 				goto __3
 134512 			}
 134513 			(*Select)(unsafe.Pointer(pParent)).FpSrc = pSrc
 134514 		}
 134515 
 134516 		for i = 0; i < nSubSrc; i++ {
 134517 			var pItem uintptr = pSrc + 8 + uintptr(i+iFrom)*104
 134518 			if uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x400>>10)) != 0 {
 134519 				Xsqlite3IdListDelete(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72)))
 134520 			}
 134521 
 134522 			*(*SrcItem)(unsafe.Pointer(pItem)) = *(*SrcItem)(unsafe.Pointer(pSubSrc + 8 + uintptr(i)*104))
 134523 			*(*U8)(unsafe.Pointer(pItem + 60)) |= U8(int32(ltorj))
 134524 			iNewParent = (*SrcItem)(unsafe.Pointer(pSubSrc + 8 + uintptr(i)*104)).FiCursor
 134525 			libc.Xmemset(tls, pSubSrc+8+uintptr(i)*104, 0, uint64(unsafe.Sizeof(SrcItem{})))
 134526 		}
 134527 		*(*U8)(unsafe.Pointer(pSrc + 8 + uintptr(iFrom)*104 + 60)) &= U8(JT_LTORJ)
 134528 		*(*U8)(unsafe.Pointer(pSrc + 8 + uintptr(iFrom)*104 + 60)) |= U8(int32(jointype) | int32(ltorj))
 134529 
 134530 		if (*Select)(unsafe.Pointer(pSub)).FpOrderBy != 0 && (*Select)(unsafe.Pointer(pParent)).FselFlags&U32(SF_NoopOrderBy) == U32(0) {
 134531 			var pOrderBy uintptr = (*Select)(unsafe.Pointer(pSub)).FpOrderBy
 134532 			for i = 0; i < (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr; i++ {
 134533 				*(*U16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32 + 24)) = U16(0)
 134534 			}
 134535 
 134536 			(*Select)(unsafe.Pointer(pParent)).FpOrderBy = pOrderBy
 134537 			(*Select)(unsafe.Pointer(pSub)).FpOrderBy = uintptr(0)
 134538 		}
 134539 		pWhere = (*Select)(unsafe.Pointer(pSub)).FpWhere
 134540 		(*Select)(unsafe.Pointer(pSub)).FpWhere = uintptr(0)
 134541 		if isOuterJoin > 0 {
 134542 			Xsqlite3SetJoinExpr(tls, pWhere, iNewParent, uint32(EP_OuterON))
 134543 		}
 134544 		if pWhere != 0 {
 134545 			if (*Select)(unsafe.Pointer(pParent)).FpWhere != 0 {
 134546 				(*Select)(unsafe.Pointer(pParent)).FpWhere = Xsqlite3PExpr(tls, pParse, TK_AND, pWhere, (*Select)(unsafe.Pointer(pParent)).FpWhere)
 134547 			} else {
 134548 				(*Select)(unsafe.Pointer(pParent)).FpWhere = pWhere
 134549 			}
 134550 		}
 134551 		if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 {
 134552 			(*SubstContext)(unsafe.Pointer(bp)).FpParse = pParse
 134553 			(*SubstContext)(unsafe.Pointer(bp)).FiTable = iParent
 134554 			(*SubstContext)(unsafe.Pointer(bp)).FiNewTable = iNewParent
 134555 			(*SubstContext)(unsafe.Pointer(bp)).FisOuterJoin = isOuterJoin
 134556 			(*SubstContext)(unsafe.Pointer(bp)).FpEList = (*Select)(unsafe.Pointer(pSub)).FpEList
 134557 			(*SubstContext)(unsafe.Pointer(bp)).FpCList = findLeftmostExprlist(tls, pSub)
 134558 			substSelect(tls, bp, pParent, 0)
 134559 		}
 134560 
 134561 		*(*U32)(unsafe.Pointer(pParent + 4)) |= (*Select)(unsafe.Pointer(pSub)).FselFlags & U32(SF_Compound)
 134562 
 134563 		if (*Select)(unsafe.Pointer(pSub)).FpLimit != 0 {
 134564 			(*Select)(unsafe.Pointer(pParent)).FpLimit = (*Select)(unsafe.Pointer(pSub)).FpLimit
 134565 			(*Select)(unsafe.Pointer(pSub)).FpLimit = uintptr(0)
 134566 		}
 134567 
 134568 		for i = 0; i < nSubSrc; i++ {
 134569 			recomputeColumnsUsed(tls, pParent, pSrc+8+uintptr(i+iFrom)*104)
 134570 		}
 134571 
 134572 	}
 134573 	goto __2
 134574 __2:
 134575 	pParent = (*Select)(unsafe.Pointer(pParent)).FpPrior
 134576 	pSub = (*Select)(unsafe.Pointer(pSub)).FpPrior
 134577 	goto __1
 134578 	goto __3
 134579 __3:
 134580 	;
 134581 	Xsqlite3AggInfoPersistWalkerInit(tls, bp+40, pParse)
 134582 	Xsqlite3WalkSelect(tls, bp+40, pSub1)
 134583 	Xsqlite3SelectDelete(tls, db, pSub1)
 134584 
 134585 	return 1
 134586 }
 134587 
 134588 // A structure to keep track of all of the column values that are fixed to
 134589 // a known value due to WHERE clause constraints of the form COLUMN=VALUE.
 134590 type WhereConst = WhereConst1
 134591 
 134592 func constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr, pExpr uintptr) {
 134593 	var i int32
 134594 
 134595 	if (*Expr)(unsafe.Pointer(pColumn)).Fflags&U32(EP_FixedCol) != U32(0) {
 134596 		return
 134597 	}
 134598 	if int32(Xsqlite3ExprAffinity(tls, pValue)) != 0 {
 134599 		return
 134600 	}
 134601 	if !(Xsqlite3IsBinary(tls, Xsqlite3ExprCompareCollSeq(tls, (*WhereConst)(unsafe.Pointer(pConst)).FpParse, pExpr)) != 0) {
 134602 		return
 134603 	}
 134604 
 134605 	for i = 0; i < (*WhereConst)(unsafe.Pointer(pConst)).FnConst; i++ {
 134606 		var pE2 uintptr = *(*uintptr)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(i*2)*8))
 134607 
 134608 		if (*Expr)(unsafe.Pointer(pE2)).FiTable == (*Expr)(unsafe.Pointer(pColumn)).FiTable &&
 134609 			int32((*Expr)(unsafe.Pointer(pE2)).FiColumn) == int32((*Expr)(unsafe.Pointer(pColumn)).FiColumn) {
 134610 			return
 134611 		}
 134612 	}
 134613 	if int32(Xsqlite3ExprAffinity(tls, pColumn)) == SQLITE_AFF_BLOB {
 134614 		(*WhereConst)(unsafe.Pointer(pConst)).FbHasAffBlob = 1
 134615 	}
 134616 
 134617 	(*WhereConst)(unsafe.Pointer(pConst)).FnConst++
 134618 	(*WhereConst)(unsafe.Pointer(pConst)).FapExpr = Xsqlite3DbReallocOrFree(tls, (*Parse)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*WhereConst)(unsafe.Pointer(pConst)).FapExpr,
 134619 		uint64((*WhereConst)(unsafe.Pointer(pConst)).FnConst*2)*uint64(unsafe.Sizeof(uintptr(0))))
 134620 	if (*WhereConst)(unsafe.Pointer(pConst)).FapExpr == uintptr(0) {
 134621 		(*WhereConst)(unsafe.Pointer(pConst)).FnConst = 0
 134622 	} else {
 134623 		*(*uintptr)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr((*WhereConst)(unsafe.Pointer(pConst)).FnConst*2-2)*8)) = pColumn
 134624 		*(*uintptr)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr((*WhereConst)(unsafe.Pointer(pConst)).FnConst*2-1)*8)) = pValue
 134625 	}
 134626 }
 134627 
 134628 func findConstInWhere(tls *libc.TLS, pConst uintptr, pExpr uintptr) {
 134629 	var pRight uintptr
 134630 	var pLeft uintptr
 134631 	if pExpr == uintptr(0) {
 134632 		return
 134633 	}
 134634 	if (*Expr)(unsafe.Pointer(pExpr)).Fflags&(*WhereConst)(unsafe.Pointer(pConst)).FmExcludeOn != U32(0) {
 134635 		return
 134636 	}
 134637 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND {
 134638 		findConstInWhere(tls, pConst, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
 134639 		findConstInWhere(tls, pConst, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
 134640 		return
 134641 	}
 134642 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_EQ {
 134643 		return
 134644 	}
 134645 	pRight = (*Expr)(unsafe.Pointer(pExpr)).FpRight
 134646 	pLeft = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
 134647 
 134648 	if int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_COLUMN && Xsqlite3ExprIsConstant(tls, pLeft) != 0 {
 134649 		constInsert(tls, pConst, pRight, pLeft, pExpr)
 134650 	}
 134651 	if int32((*Expr)(unsafe.Pointer(pLeft)).Fop) == TK_COLUMN && Xsqlite3ExprIsConstant(tls, pRight) != 0 {
 134652 		constInsert(tls, pConst, pLeft, pRight, pExpr)
 134653 	}
 134654 }
 134655 
 134656 func propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintptr, bIgnoreAffBlob int32) int32 {
 134657 	var i int32
 134658 	if *(*U8)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FpOomFault)) != 0 {
 134659 		return WRC_Prune
 134660 	}
 134661 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLUMN {
 134662 		return WRC_Continue
 134663 	}
 134664 	if (*Expr)(unsafe.Pointer(pExpr)).Fflags&(U32(EP_FixedCol)|(*WhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != U32(0) {
 134665 		return WRC_Continue
 134666 	}
 134667 	for i = 0; i < (*WhereConst)(unsafe.Pointer(pConst)).FnConst; i++ {
 134668 		var pColumn uintptr = *(*uintptr)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(i*2)*8))
 134669 		if pColumn == pExpr {
 134670 			continue
 134671 		}
 134672 		if (*Expr)(unsafe.Pointer(pColumn)).FiTable != (*Expr)(unsafe.Pointer(pExpr)).FiTable {
 134673 			continue
 134674 		}
 134675 		if int32((*Expr)(unsafe.Pointer(pColumn)).FiColumn) != int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) {
 134676 			continue
 134677 		}
 134678 		if bIgnoreAffBlob != 0 && int32(Xsqlite3ExprAffinity(tls, pColumn)) == SQLITE_AFF_BLOB {
 134679 			break
 134680 		}
 134681 
 134682 		(*WhereConst)(unsafe.Pointer(pConst)).FnChng++
 134683 		*(*U32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(libc.CplInt32(EP_Leaf))
 134684 		*(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_FixedCol)
 134685 
 134686 		(*Expr)(unsafe.Pointer(pExpr)).FpLeft = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, *(*uintptr)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(i*2+1)*8)), 0)
 134687 		if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb)).FmallocFailed != 0 {
 134688 			return WRC_Prune
 134689 		}
 134690 		break
 134691 	}
 134692 	return WRC_Prune
 134693 }
 134694 
 134695 func propagateConstantExprRewrite(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 134696 	var pConst uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40))
 134697 
 134698 	if (*WhereConst)(unsafe.Pointer(pConst)).FbHasAffBlob != 0 {
 134699 		if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) >= TK_EQ && int32((*Expr)(unsafe.Pointer(pExpr)).Fop) <= TK_GE ||
 134700 			int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IS {
 134701 			propagateConstantExprRewriteOne(tls, pConst, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, 0)
 134702 			if *(*U8)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FpOomFault)) != 0 {
 134703 				return WRC_Prune
 134704 			}
 134705 			if int32(Xsqlite3ExprAffinity(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)) != SQLITE_AFF_TEXT {
 134706 				propagateConstantExprRewriteOne(tls, pConst, (*Expr)(unsafe.Pointer(pExpr)).FpRight, 0)
 134707 			}
 134708 		}
 134709 	}
 134710 	return propagateConstantExprRewriteOne(tls, pConst, pExpr, (*WhereConst)(unsafe.Pointer(pConst)).FbHasAffBlob)
 134711 }
 134712 
 134713 func propagateConstants(tls *libc.TLS, pParse uintptr, p uintptr) int32 {
 134714 	bp := tls.Alloc(88)
 134715 	defer tls.Free(88)
 134716 
 134717 	var nChng int32 = 0
 134718 	(*WhereConst)(unsafe.Pointer(bp)).FpParse = pParse
 134719 	(*WhereConst)(unsafe.Pointer(bp)).FpOomFault = (*Parse)(unsafe.Pointer(pParse)).Fdb + 103
 134720 	for __ccgo := true; __ccgo; __ccgo = (*WhereConst)(unsafe.Pointer(bp)).FnChng != 0 {
 134721 		(*WhereConst)(unsafe.Pointer(bp)).FnConst = 0
 134722 		(*WhereConst)(unsafe.Pointer(bp)).FnChng = 0
 134723 		(*WhereConst)(unsafe.Pointer(bp)).FapExpr = uintptr(0)
 134724 		(*WhereConst)(unsafe.Pointer(bp)).FbHasAffBlob = 0
 134725 		if (*Select)(unsafe.Pointer(p)).FpSrc != uintptr(0) &&
 134726 			(*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc)).FnSrc > 0 &&
 134727 			int32((*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc+8)).Ffg.Fjointype)&JT_LTORJ != 0 {
 134728 			(*WhereConst)(unsafe.Pointer(bp)).FmExcludeOn = U32(EP_InnerON | EP_OuterON)
 134729 		} else {
 134730 			(*WhereConst)(unsafe.Pointer(bp)).FmExcludeOn = U32(EP_OuterON)
 134731 		}
 134732 		findConstInWhere(tls, bp, (*Select)(unsafe.Pointer(p)).FpWhere)
 134733 		if (*WhereConst)(unsafe.Pointer(bp)).FnConst != 0 {
 134734 			libc.Xmemset(tls, bp+40, 0, uint64(unsafe.Sizeof(Walker{})))
 134735 			(*Walker)(unsafe.Pointer(bp + 40)).FpParse = pParse
 134736 			(*Walker)(unsafe.Pointer(bp + 40)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 134737 				f func(*libc.TLS, uintptr, uintptr) int32
 134738 			}{propagateConstantExprRewrite}))
 134739 			(*Walker)(unsafe.Pointer(bp + 40)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
 134740 				f func(*libc.TLS, uintptr, uintptr) int32
 134741 			}{Xsqlite3SelectWalkNoop}))
 134742 			(*Walker)(unsafe.Pointer(bp + 40)).FxSelectCallback2 = uintptr(0)
 134743 			(*Walker)(unsafe.Pointer(bp + 40)).FwalkerDepth = 0
 134744 			*(*uintptr)(unsafe.Pointer(bp + 40 + 40)) = bp
 134745 			Xsqlite3WalkExpr(tls, bp+40, (*Select)(unsafe.Pointer(p)).FpWhere)
 134746 			Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(bp)).FpParse)).Fdb, (*WhereConst)(unsafe.Pointer(bp)).FapExpr)
 134747 			nChng = nChng + (*WhereConst)(unsafe.Pointer(bp)).FnChng
 134748 		}
 134749 	}
 134750 	return nChng
 134751 }
 134752 
 134753 func pushDownWindowCheck(tls *libc.TLS, pParse uintptr, pSubq uintptr, pExpr uintptr) int32 {
 134754 	return Xsqlite3ExprIsConstantOrGroupBy(tls, pParse, pExpr, (*Window)(unsafe.Pointer((*Select)(unsafe.Pointer(pSubq)).FpWin)).FpPartition)
 134755 }
 134756 
 134757 func pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uintptr, pSrc uintptr) int32 {
 134758 	bp := tls.Alloc(40)
 134759 	defer tls.Free(40)
 134760 
 134761 	var pNew uintptr
 134762 	var nChng int32 = 0
 134763 	if pWhere == uintptr(0) {
 134764 		return 0
 134765 	}
 134766 	if (*Select)(unsafe.Pointer(pSubq)).FselFlags&U32(SF_Recursive|SF_MultiPart) != 0 {
 134767 		return 0
 134768 	}
 134769 	if int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&(JT_LTORJ|JT_RIGHT) != 0 {
 134770 		return 0
 134771 	}
 134772 
 134773 	if (*Select)(unsafe.Pointer(pSubq)).FpPrior != 0 {
 134774 		var pSel uintptr
 134775 		var notUnionAll int32 = 0
 134776 		for pSel = pSubq; pSel != 0; pSel = (*Select)(unsafe.Pointer(pSel)).FpPrior {
 134777 			var op U8 = (*Select)(unsafe.Pointer(pSel)).Fop
 134778 
 134779 			if int32(op) != TK_ALL && int32(op) != TK_SELECT {
 134780 				notUnionAll = 1
 134781 			}
 134782 			if (*Select)(unsafe.Pointer(pSel)).FpWin != 0 {
 134783 				return 0
 134784 			}
 134785 		}
 134786 		if compoundHasDifferentAffinities(tls, pSubq) != 0 {
 134787 			return 0
 134788 		}
 134789 		if notUnionAll != 0 {
 134790 			for pSel = pSubq; pSel != 0; pSel = (*Select)(unsafe.Pointer(pSel)).FpPrior {
 134791 				var ii int32
 134792 				var pList uintptr = (*Select)(unsafe.Pointer(pSel)).FpEList
 134793 
 134794 				for ii = 0; ii < (*ExprList)(unsafe.Pointer(pList)).FnExpr; ii++ {
 134795 					var pColl uintptr = Xsqlite3ExprCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(ii)*32)).FpExpr)
 134796 					if !(Xsqlite3IsBinary(tls, pColl) != 0) {
 134797 						return 0
 134798 					}
 134799 				}
 134800 			}
 134801 		}
 134802 	} else {
 134803 		if (*Select)(unsafe.Pointer(pSubq)).FpWin != 0 && (*Window)(unsafe.Pointer((*Select)(unsafe.Pointer(pSubq)).FpWin)).FpPartition == uintptr(0) {
 134804 			return 0
 134805 		}
 134806 	}
 134807 
 134808 	if (*Select)(unsafe.Pointer(pSubq)).FpLimit != uintptr(0) {
 134809 		return 0
 134810 	}
 134811 	for int32((*Expr)(unsafe.Pointer(pWhere)).Fop) == TK_AND {
 134812 		nChng = nChng + pushDownWhereTerms(tls, pParse, pSubq, (*Expr)(unsafe.Pointer(pWhere)).FpRight, pSrc)
 134813 		pWhere = (*Expr)(unsafe.Pointer(pWhere)).FpLeft
 134814 	}
 134815 
 134816 	if Xsqlite3ExprIsTableConstraint(tls, pWhere, pSrc) != 0 {
 134817 		nChng++
 134818 		*(*U32)(unsafe.Pointer(pSubq + 4)) |= U32(SF_PushDown)
 134819 		for pSubq != 0 {
 134820 			pNew = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pWhere, 0)
 134821 			unsetJoinExpr(tls, pNew, -1, 1)
 134822 			(*SubstContext)(unsafe.Pointer(bp)).FpParse = pParse
 134823 			(*SubstContext)(unsafe.Pointer(bp)).FiTable = (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor
 134824 			(*SubstContext)(unsafe.Pointer(bp)).FiNewTable = (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor
 134825 			(*SubstContext)(unsafe.Pointer(bp)).FisOuterJoin = 0
 134826 			(*SubstContext)(unsafe.Pointer(bp)).FpEList = (*Select)(unsafe.Pointer(pSubq)).FpEList
 134827 			(*SubstContext)(unsafe.Pointer(bp)).FpCList = findLeftmostExprlist(tls, pSubq)
 134828 			pNew = substExpr(tls, bp, pNew)
 134829 			if (*Select)(unsafe.Pointer(pSubq)).FpWin != 0 && 0 == pushDownWindowCheck(tls, pParse, pSubq, pNew) {
 134830 				Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pNew)
 134831 				nChng--
 134832 				break
 134833 			}
 134834 			if (*Select)(unsafe.Pointer(pSubq)).FselFlags&U32(SF_Aggregate) != 0 {
 134835 				(*Select)(unsafe.Pointer(pSubq)).FpHaving = Xsqlite3ExprAnd(tls, pParse, (*Select)(unsafe.Pointer(pSubq)).FpHaving, pNew)
 134836 			} else {
 134837 				(*Select)(unsafe.Pointer(pSubq)).FpWhere = Xsqlite3ExprAnd(tls, pParse, (*Select)(unsafe.Pointer(pSubq)).FpWhere, pNew)
 134838 			}
 134839 			pSubq = (*Select)(unsafe.Pointer(pSubq)).FpPrior
 134840 		}
 134841 	}
 134842 	return nChng
 134843 }
 134844 
 134845 func minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) U8 {
 134846 	var eRet int32 = WHERE_ORDERBY_NORMAL
 134847 	var pEList uintptr
 134848 	var zFunc uintptr
 134849 	var pOrderBy uintptr
 134850 	var sortFlags U8 = U8(0)
 134851 
 134852 	pEList = *(*uintptr)(unsafe.Pointer(pFunc + 32))
 134853 	if pEList == uintptr(0) ||
 134854 		(*ExprList)(unsafe.Pointer(pEList)).FnExpr != 1 ||
 134855 		(*Expr)(unsafe.Pointer(pFunc)).Fflags&U32(EP_WinFunc) != U32(0) ||
 134856 		(*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_MinMaxOpt) != U32(0) {
 134857 		return U8(eRet)
 134858 	}
 134859 
 134860 	zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8))
 134861 	if Xsqlite3StrICmp(tls, zFunc, ts+16521) == 0 {
 134862 		eRet = WHERE_ORDERBY_MIN
 134863 		if Xsqlite3ExprCanBeNull(tls, (*ExprList_item)(unsafe.Pointer(pEList+8)).FpExpr) != 0 {
 134864 			sortFlags = U8(KEYINFO_ORDER_BIGNULL)
 134865 		}
 134866 	} else if Xsqlite3StrICmp(tls, zFunc, ts+16525) == 0 {
 134867 		eRet = WHERE_ORDERBY_MAX
 134868 		sortFlags = U8(KEYINFO_ORDER_DESC)
 134869 	} else {
 134870 		return U8(eRet)
 134871 	}
 134872 	*(*uintptr)(unsafe.Pointer(ppMinMax)) = libc.AssignUintptr(&pOrderBy, Xsqlite3ExprListDup(tls, db, pEList, 0))
 134873 
 134874 	if pOrderBy != 0 {
 134875 		(*ExprList_item)(unsafe.Pointer(pOrderBy + 8)).Ffg.FsortFlags = sortFlags
 134876 	}
 134877 	return U8(eRet)
 134878 }
 134879 
 134880 func isSimpleCount(tls *libc.TLS, p uintptr, pAggInfo uintptr) uintptr {
 134881 	var pTab uintptr
 134882 	var pExpr uintptr
 134883 
 134884 	if (*Select)(unsafe.Pointer(p)).FpWhere != 0 ||
 134885 		(*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr != 1 ||
 134886 		(*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc)).FnSrc != 1 ||
 134887 		(*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc+8)).FpSelect != 0 ||
 134888 		(*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc != 1 ||
 134889 		(*Select)(unsafe.Pointer(p)).FpHaving != 0 {
 134890 		return uintptr(0)
 134891 	}
 134892 	pTab = (*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc + 8)).FpTab
 134893 
 134894 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM) {
 134895 		return uintptr(0)
 134896 	}
 134897 	pExpr = (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList + 8)).FpExpr
 134898 
 134899 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_AGG_FUNCTION {
 134900 		return uintptr(0)
 134901 	}
 134902 	if (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo != pAggInfo {
 134903 		return uintptr(0)
 134904 	}
 134905 	if (*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFunc)).FfuncFlags&U32(SQLITE_FUNC_COUNT) == U32(0) {
 134906 		return uintptr(0)
 134907 	}
 134908 
 134909 	if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Distinct|EP_WinFunc) != U32(0) {
 134910 		return uintptr(0)
 134911 	}
 134912 
 134913 	return pTab
 134914 }
 134915 
 134916 // If the source-list item passed as an argument was augmented with an
 134917 // INDEXED BY clause, then try to locate the specified index. If there
 134918 // was such a clause and the named index cannot be found, return
 134919 // SQLITE_ERROR and leave an error in pParse. Otherwise, populate
 134920 // pFrom->pIndex and return SQLITE_OK.
 134921 func Xsqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 {
 134922 	bp := tls.Alloc(16)
 134923 	defer tls.Free(16)
 134924 
 134925 	var pTab uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FpTab
 134926 	var zIndexedBy uintptr = *(*uintptr)(unsafe.Pointer(pFrom + 88))
 134927 	var pIdx uintptr
 134928 
 134929 	for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; pIdx != 0 && Xsqlite3StrICmp(tls, (*Index)(unsafe.Pointer(pIdx)).FzName, zIndexedBy) != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
 134930 	}
 134931 	if !(pIdx != 0) {
 134932 		Xsqlite3ErrorMsg(tls, pParse, ts+20580, libc.VaList(bp, zIndexedBy, 0))
 134933 		(*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1)
 134934 		return SQLITE_ERROR
 134935 	}
 134936 
 134937 	*(*uintptr)(unsafe.Pointer(pFrom + 96)) = pIdx
 134938 	return SQLITE_OK
 134939 }
 134940 
 134941 func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) int32 {
 134942 	bp := tls.Alloc(16)
 134943 	defer tls.Free(16)
 134944 
 134945 	var i int32
 134946 	var pNew uintptr
 134947 	var pX uintptr
 134948 	var db uintptr
 134949 	var a uintptr
 134950 	var pNewSrc uintptr
 134951 	var pParse uintptr
 134952 
 134953 	if (*Select)(unsafe.Pointer(p)).FpPrior == uintptr(0) {
 134954 		return WRC_Continue
 134955 	}
 134956 	if (*Select)(unsafe.Pointer(p)).FpOrderBy == uintptr(0) {
 134957 		return WRC_Continue
 134958 	}
 134959 	for pX = p; pX != 0 && (int32((*Select)(unsafe.Pointer(pX)).Fop) == TK_ALL || int32((*Select)(unsafe.Pointer(pX)).Fop) == TK_SELECT); pX = (*Select)(unsafe.Pointer(pX)).FpPrior {
 134960 	}
 134961 	if pX == uintptr(0) {
 134962 		return WRC_Continue
 134963 	}
 134964 	a = (*Select)(unsafe.Pointer(p)).FpOrderBy + 8
 134965 
 134966 	if *(*U16)(unsafe.Pointer(a + 24)) != 0 {
 134967 		return WRC_Continue
 134968 	}
 134969 	for i = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpOrderBy)).FnExpr - 1; i >= 0; i-- {
 134970 		if (*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(a+uintptr(i)*32)).FpExpr)).Fflags&U32(EP_Collate) != 0 {
 134971 			break
 134972 		}
 134973 	}
 134974 	if i < 0 {
 134975 		return WRC_Continue
 134976 	}
 134977 
 134978 	pParse = (*Walker)(unsafe.Pointer(pWalker)).FpParse
 134979 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 134980 	pNew = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Select{})))
 134981 	if pNew == uintptr(0) {
 134982 		return WRC_Abort
 134983 	}
 134984 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Token{})))
 134985 	pNewSrc = Xsqlite3SrcListAppendFromTerm(tls, pParse, uintptr(0), uintptr(0), uintptr(0), bp, pNew, uintptr(0))
 134986 	if pNewSrc == uintptr(0) {
 134987 		return WRC_Abort
 134988 	}
 134989 	*(*Select)(unsafe.Pointer(pNew)) = *(*Select)(unsafe.Pointer(p))
 134990 	(*Select)(unsafe.Pointer(p)).FpSrc = pNewSrc
 134991 	(*Select)(unsafe.Pointer(p)).FpEList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), Xsqlite3Expr(tls, db, TK_ASTERISK, uintptr(0)))
 134992 	(*Select)(unsafe.Pointer(p)).Fop = U8(TK_SELECT)
 134993 	(*Select)(unsafe.Pointer(p)).FpWhere = uintptr(0)
 134994 	(*Select)(unsafe.Pointer(pNew)).FpGroupBy = uintptr(0)
 134995 	(*Select)(unsafe.Pointer(pNew)).FpHaving = uintptr(0)
 134996 	(*Select)(unsafe.Pointer(pNew)).FpOrderBy = uintptr(0)
 134997 	(*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0)
 134998 	(*Select)(unsafe.Pointer(p)).FpNext = uintptr(0)
 134999 	(*Select)(unsafe.Pointer(p)).FpWith = uintptr(0)
 135000 	(*Select)(unsafe.Pointer(p)).FpWinDefn = uintptr(0)
 135001 	*(*U32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(libc.CplInt32(SF_Compound))
 135002 
 135003 	*(*U32)(unsafe.Pointer(p + 4)) |= U32(SF_Converted)
 135004 
 135005 	(*Select)(unsafe.Pointer((*Select)(unsafe.Pointer(pNew)).FpPrior)).FpNext = pNew
 135006 	(*Select)(unsafe.Pointer(pNew)).FpLimit = uintptr(0)
 135007 	return WRC_Continue
 135008 }
 135009 
 135010 func cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 {
 135011 	bp := tls.Alloc(8)
 135012 	defer tls.Free(8)
 135013 
 135014 	if uint32(int32(*(*uint16)(unsafe.Pointer(pFrom + 60 + 4))&0x4>>2)) != 0 {
 135015 		Xsqlite3ErrorMsg(tls, pParse, ts+20598, libc.VaList(bp, (*SrcItem)(unsafe.Pointer(pFrom)).FzName))
 135016 		return 1
 135017 	}
 135018 	return 0
 135019 }
 135020 
 135021 func searchWith(tls *libc.TLS, pWith uintptr, pItem uintptr, ppContext uintptr) uintptr {
 135022 	var zName uintptr = (*SrcItem)(unsafe.Pointer(pItem)).FzName
 135023 	var p uintptr
 135024 
 135025 	for p = pWith; p != 0; p = (*With)(unsafe.Pointer(p)).FpOuter {
 135026 		var i int32
 135027 		for i = 0; i < (*With)(unsafe.Pointer(p)).FnCte; i++ {
 135028 			if Xsqlite3StrICmp(tls, zName, (*Cte)(unsafe.Pointer(p+16+uintptr(i)*48)).FzName) == 0 {
 135029 				*(*uintptr)(unsafe.Pointer(ppContext)) = p
 135030 				return p + 16 + uintptr(i)*48
 135031 			}
 135032 		}
 135033 		if (*With)(unsafe.Pointer(p)).FbView != 0 {
 135034 			break
 135035 		}
 135036 	}
 135037 	return uintptr(0)
 135038 }
 135039 
 135040 // The code generator maintains a stack of active WITH clauses
 135041 // with the inner-most WITH clause being at the top of the stack.
 135042 //
 135043 // This routine pushes the WITH clause passed as the second argument
 135044 // onto the top of the stack. If argument bFree is true, then this
 135045 // WITH clause will never be popped from the stack but should instead
 135046 // be freed along with the Parse object. In other cases, when
 135047 // bFree==0, the With object will be freed along with the SELECT
 135048 // statement with which it is associated.
 135049 //
 135050 // This routine returns a copy of pWith.  Or, if bFree is true and
 135051 // the pWith object is destroyed immediately due to an OOM condition,
 135052 // then this routine return NULL.
 135053 //
 135054 // If bFree is true, do not continue to use the pWith pointer after
 135055 // calling this routine,  Instead, use only the return value.
 135056 func Xsqlite3WithPush(tls *libc.TLS, pParse uintptr, pWith uintptr, bFree U8) uintptr {
 135057 	if pWith != 0 {
 135058 		if bFree != 0 {
 135059 			pWith = Xsqlite3ParserAddCleanup(tls, pParse,
 135060 				*(*uintptr)(unsafe.Pointer(&struct {
 135061 					f func(*libc.TLS, uintptr, uintptr)
 135062 				}{Xsqlite3WithDelete})),
 135063 				pWith)
 135064 			if pWith == uintptr(0) {
 135065 				return uintptr(0)
 135066 			}
 135067 		}
 135068 		if (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 {
 135069 			(*With)(unsafe.Pointer(pWith)).FpOuter = (*Parse)(unsafe.Pointer(pParse)).FpWith
 135070 			(*Parse)(unsafe.Pointer(pParse)).FpWith = pWith
 135071 		}
 135072 	}
 135073 	return pWith
 135074 }
 135075 
 135076 func resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom uintptr) int32 {
 135077 	bp := tls.Alloc(56)
 135078 	defer tls.Free(56)
 135079 
 135080 	var pCte uintptr
 135081 
 135082 	if (*Parse)(unsafe.Pointer(pParse)).FpWith == uintptr(0) {
 135083 		return 0
 135084 	}
 135085 	if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 135086 		return 0
 135087 	}
 135088 	if (*SrcItem)(unsafe.Pointer(pFrom)).FzDatabase != uintptr(0) {
 135089 		return 0
 135090 	}
 135091 	if uint32(int32(*(*uint16)(unsafe.Pointer(pFrom + 60 + 4))&0x200>>9)) != 0 {
 135092 		return 0
 135093 	}
 135094 	pCte = searchWith(tls, (*Parse)(unsafe.Pointer(pParse)).FpWith, pFrom, bp+48)
 135095 	if pCte != 0 {
 135096 		var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 135097 		var pTab uintptr
 135098 		var pEList uintptr
 135099 		var pSel uintptr
 135100 		var pLeft uintptr
 135101 		var pRecTerm uintptr
 135102 		var bMayRecursive int32
 135103 		var pSavedWith uintptr
 135104 		var iRecTab int32 = -1
 135105 		var pCteUse uintptr
 135106 
 135107 		if (*Cte)(unsafe.Pointer(pCte)).FzCteErr != 0 {
 135108 			Xsqlite3ErrorMsg(tls, pParse, (*Cte)(unsafe.Pointer(pCte)).FzCteErr, libc.VaList(bp, (*Cte)(unsafe.Pointer(pCte)).FzName))
 135109 			return 2
 135110 		}
 135111 		if cannotBeFunction(tls, pParse, pFrom) != 0 {
 135112 			return 2
 135113 		}
 135114 
 135115 		pTab = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Table{})))
 135116 		if pTab == uintptr(0) {
 135117 			return 2
 135118 		}
 135119 		pCteUse = (*Cte)(unsafe.Pointer(pCte)).FpUse
 135120 		if pCteUse == uintptr(0) {
 135121 			(*Cte)(unsafe.Pointer(pCte)).FpUse = libc.AssignUintptr(&pCteUse, Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(CteUse{}))))
 135122 			if pCteUse == uintptr(0) ||
 135123 				Xsqlite3ParserAddCleanup(tls, pParse, *(*uintptr)(unsafe.Pointer(&struct {
 135124 					f func(*libc.TLS, uintptr, uintptr)
 135125 				}{Xsqlite3DbFree})), pCteUse) == uintptr(0) {
 135126 				Xsqlite3DbFree(tls, db, pTab)
 135127 				return 2
 135128 			}
 135129 			(*CteUse)(unsafe.Pointer(pCteUse)).FeM10d = (*Cte)(unsafe.Pointer(pCte)).FeM10d
 135130 		}
 135131 		(*SrcItem)(unsafe.Pointer(pFrom)).FpTab = pTab
 135132 		(*Table)(unsafe.Pointer(pTab)).FnTabRef = U32(1)
 135133 		(*Table)(unsafe.Pointer(pTab)).FzName = Xsqlite3DbStrDup(tls, db, (*Cte)(unsafe.Pointer(pCte)).FzName)
 135134 		(*Table)(unsafe.Pointer(pTab)).FiPKey = int16(-1)
 135135 		(*Table)(unsafe.Pointer(pTab)).FnRowLogEst = int16(200)
 135136 		*(*U32)(unsafe.Pointer(pTab + 48)) |= U32(TF_Ephemeral | TF_NoVisibleRowid)
 135137 		(*SrcItem)(unsafe.Pointer(pFrom)).FpSelect = Xsqlite3SelectDup(tls, db, (*Cte)(unsafe.Pointer(pCte)).FpSelect, 0)
 135138 		if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 135139 			return 2
 135140 		}
 135141 		*(*U32)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pFrom)).FpSelect + 4)) |= U32(SF_CopyCte)
 135142 
 135143 		if uint32(int32(*(*uint16)(unsafe.Pointer(pFrom + 60 + 4))&0x2>>1)) != 0 {
 135144 			Xsqlite3ErrorMsg(tls, pParse, ts+20621, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pFrom + 88))))
 135145 			return 2
 135146 		}
 135147 		libc.SetBitFieldPtr16Uint32(pFrom+60+4, uint32(1), 8, 0x100)
 135148 		*(*uintptr)(unsafe.Pointer(pFrom + 96)) = pCteUse
 135149 		(*CteUse)(unsafe.Pointer(pCteUse)).FnUse++
 135150 
 135151 		pRecTerm = libc.AssignUintptr(&pSel, (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect)
 135152 		bMayRecursive = libc.Bool32(int32((*Select)(unsafe.Pointer(pSel)).Fop) == TK_ALL || int32((*Select)(unsafe.Pointer(pSel)).Fop) == TK_UNION)
 135153 		for bMayRecursive != 0 && int32((*Select)(unsafe.Pointer(pRecTerm)).Fop) == int32((*Select)(unsafe.Pointer(pSel)).Fop) {
 135154 			var i int32
 135155 			var pSrc uintptr = (*Select)(unsafe.Pointer(pRecTerm)).FpSrc
 135156 
 135157 			for i = 0; i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc; i++ {
 135158 				var pItem uintptr = pSrc + 8 + uintptr(i)*104
 135159 				if (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase == uintptr(0) &&
 135160 					(*SrcItem)(unsafe.Pointer(pItem)).FzName != uintptr(0) &&
 135161 					0 == Xsqlite3StrICmp(tls, (*SrcItem)(unsafe.Pointer(pItem)).FzName, (*Cte)(unsafe.Pointer(pCte)).FzName) {
 135162 					(*SrcItem)(unsafe.Pointer(pItem)).FpTab = pTab
 135163 					(*Table)(unsafe.Pointer(pTab)).FnTabRef++
 135164 					libc.SetBitFieldPtr16Uint32(pItem+60+4, uint32(1), 6, 0x40)
 135165 					if (*Select)(unsafe.Pointer(pRecTerm)).FselFlags&U32(SF_Recursive) != 0 {
 135166 						Xsqlite3ErrorMsg(tls, pParse,
 135167 							ts+20641, libc.VaList(bp+16, (*Cte)(unsafe.Pointer(pCte)).FzName))
 135168 						return 2
 135169 					}
 135170 					*(*U32)(unsafe.Pointer(pRecTerm + 4)) |= U32(SF_Recursive)
 135171 					if iRecTab < 0 {
 135172 						iRecTab = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 135173 					}
 135174 					(*SrcItem)(unsafe.Pointer(pItem)).FiCursor = iRecTab
 135175 				}
 135176 			}
 135177 			if (*Select)(unsafe.Pointer(pRecTerm)).FselFlags&U32(SF_Recursive) == U32(0) {
 135178 				break
 135179 			}
 135180 			pRecTerm = (*Select)(unsafe.Pointer(pRecTerm)).FpPrior
 135181 		}
 135182 
 135183 		(*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 20684
 135184 		pSavedWith = (*Parse)(unsafe.Pointer(pParse)).FpWith
 135185 		(*Parse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp + 48))
 135186 		if (*Select)(unsafe.Pointer(pSel)).FselFlags&U32(SF_Recursive) != 0 {
 135187 			var rc int32
 135188 
 135189 			(*Select)(unsafe.Pointer(pRecTerm)).FpWith = (*Select)(unsafe.Pointer(pSel)).FpWith
 135190 			rc = Xsqlite3WalkSelect(tls, pWalker, pRecTerm)
 135191 			(*Select)(unsafe.Pointer(pRecTerm)).FpWith = uintptr(0)
 135192 			if rc != 0 {
 135193 				(*Parse)(unsafe.Pointer(pParse)).FpWith = pSavedWith
 135194 				return 2
 135195 			}
 135196 		} else {
 135197 			if Xsqlite3WalkSelect(tls, pWalker, pSel) != 0 {
 135198 				(*Parse)(unsafe.Pointer(pParse)).FpWith = pSavedWith
 135199 				return 2
 135200 			}
 135201 		}
 135202 		(*Parse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp + 48))
 135203 
 135204 		for pLeft = pSel; (*Select)(unsafe.Pointer(pLeft)).FpPrior != 0; pLeft = (*Select)(unsafe.Pointer(pLeft)).FpPrior {
 135205 		}
 135206 		pEList = (*Select)(unsafe.Pointer(pLeft)).FpEList
 135207 		if (*Cte)(unsafe.Pointer(pCte)).FpCols != 0 {
 135208 			if pEList != 0 && (*ExprList)(unsafe.Pointer(pEList)).FnExpr != (*ExprList)(unsafe.Pointer((*Cte)(unsafe.Pointer(pCte)).FpCols)).FnExpr {
 135209 				Xsqlite3ErrorMsg(tls, pParse, ts+20707,
 135210 					libc.VaList(bp+24, (*Cte)(unsafe.Pointer(pCte)).FzName, (*ExprList)(unsafe.Pointer(pEList)).FnExpr, (*ExprList)(unsafe.Pointer((*Cte)(unsafe.Pointer(pCte)).FpCols)).FnExpr))
 135211 				(*Parse)(unsafe.Pointer(pParse)).FpWith = pSavedWith
 135212 				return 2
 135213 			}
 135214 			pEList = (*Cte)(unsafe.Pointer(pCte)).FpCols
 135215 		}
 135216 
 135217 		Xsqlite3ColumnsFromExprList(tls, pParse, pEList, pTab+54, pTab+8)
 135218 		if bMayRecursive != 0 {
 135219 			if (*Select)(unsafe.Pointer(pSel)).FselFlags&U32(SF_Recursive) != 0 {
 135220 				(*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 20745
 135221 			} else {
 135222 				(*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 20779
 135223 			}
 135224 			Xsqlite3WalkSelect(tls, pWalker, pSel)
 135225 		}
 135226 		(*Cte)(unsafe.Pointer(pCte)).FzCteErr = uintptr(0)
 135227 		(*Parse)(unsafe.Pointer(pParse)).FpWith = pSavedWith
 135228 		return 1
 135229 	}
 135230 	return 0
 135231 }
 135232 
 135233 // If the SELECT passed as the second argument has an associated WITH
 135234 // clause, pop it from the stack stored as part of the Parse object.
 135235 //
 135236 // This function is used as the xSelectCallback2() callback by
 135237 // sqlite3SelectExpand() when walking a SELECT tree to resolve table
 135238 // names and other FROM clause elements.
 135239 func Xsqlite3SelectPopWith(tls *libc.TLS, pWalker uintptr, p uintptr) {
 135240 	var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse
 135241 	if (*Parse)(unsafe.Pointer(pParse)).FpWith != 0 && (*Select)(unsafe.Pointer(p)).FpPrior == uintptr(0) {
 135242 		var pWith uintptr = (*Select)(unsafe.Pointer(findRightmost(tls, p))).FpWith
 135243 		if pWith != uintptr(0) {
 135244 			(*Parse)(unsafe.Pointer(pParse)).FpWith = (*With)(unsafe.Pointer(pWith)).FpOuter
 135245 		}
 135246 	}
 135247 }
 135248 
 135249 // The SrcItem structure passed as the second argument represents a
 135250 // sub-query in the FROM clause of a SELECT statement. This function
 135251 // allocates and populates the SrcItem.pTab object. If successful,
 135252 // SQLITE_OK is returned. Otherwise, if an OOM error is encountered,
 135253 // SQLITE_NOMEM.
 135254 func Xsqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 {
 135255 	bp := tls.Alloc(8)
 135256 	defer tls.Free(8)
 135257 
 135258 	var pSel uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect
 135259 	var pTab uintptr
 135260 
 135261 	(*SrcItem)(unsafe.Pointer(pFrom)).FpTab = libc.AssignUintptr(&pTab, Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Table{}))))
 135262 	if pTab == uintptr(0) {
 135263 		return SQLITE_NOMEM
 135264 	}
 135265 	(*Table)(unsafe.Pointer(pTab)).FnTabRef = U32(1)
 135266 	if (*SrcItem)(unsafe.Pointer(pFrom)).FzAlias != 0 {
 135267 		(*Table)(unsafe.Pointer(pTab)).FzName = Xsqlite3DbStrDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*SrcItem)(unsafe.Pointer(pFrom)).FzAlias)
 135268 	} else {
 135269 		(*Table)(unsafe.Pointer(pTab)).FzName = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+20817, libc.VaList(bp, pFrom))
 135270 	}
 135271 	for (*Select)(unsafe.Pointer(pSel)).FpPrior != 0 {
 135272 		pSel = (*Select)(unsafe.Pointer(pSel)).FpPrior
 135273 	}
 135274 	Xsqlite3ColumnsFromExprList(tls, pParse, (*Select)(unsafe.Pointer(pSel)).FpEList, pTab+54, pTab+8)
 135275 	(*Table)(unsafe.Pointer(pTab)).FiPKey = int16(-1)
 135276 	(*Table)(unsafe.Pointer(pTab)).FnRowLogEst = int16(200)
 135277 
 135278 	*(*U32)(unsafe.Pointer(pTab + 48)) |= U32(TF_Ephemeral | TF_NoVisibleRowid)
 135279 	if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 135280 		return SQLITE_ERROR
 135281 	}
 135282 	return SQLITE_OK
 135283 }
 135284 
 135285 func inAnyUsingClause(tls *libc.TLS, zName uintptr, pBase uintptr, N int32) int32 {
 135286 	for N > 0 {
 135287 		N--
 135288 		pBase += 104
 135289 		if int32(*(*uint16)(unsafe.Pointer(pBase + 60 + 4))&0x400>>10) == 0 {
 135290 			continue
 135291 		}
 135292 		if *(*uintptr)(unsafe.Pointer(pBase + 72)) == uintptr(0) {
 135293 			continue
 135294 		}
 135295 		if Xsqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pBase + 72)), zName) >= 0 {
 135296 			return 1
 135297 		}
 135298 	}
 135299 	return 0
 135300 }
 135301 
 135302 func selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) int32 {
 135303 	bp := tls.Alloc(80)
 135304 	defer tls.Free(80)
 135305 
 135306 	var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse
 135307 	var i int32
 135308 	var j int32
 135309 	var k int32
 135310 	var rc int32
 135311 	var pTabList uintptr
 135312 	var pEList uintptr
 135313 	var pFrom uintptr
 135314 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 135315 	var pE uintptr
 135316 	var pRight uintptr
 135317 	var pExpr uintptr
 135318 	var selFlags U16 = U16((*Select)(unsafe.Pointer(p)).FselFlags)
 135319 	var elistFlags U32 = U32(0)
 135320 
 135321 	*(*U32)(unsafe.Pointer(p + 4)) |= U32(SF_Expanded)
 135322 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 135323 		return WRC_Abort
 135324 	}
 135325 
 135326 	if int32(selFlags)&SF_Expanded != 0 {
 135327 		return WRC_Prune
 135328 	}
 135329 	if (*Walker)(unsafe.Pointer(pWalker)).FeCode != 0 {
 135330 		(*Select)(unsafe.Pointer(p)).FselId = U32(libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnSelect, 1))
 135331 	}
 135332 	pTabList = (*Select)(unsafe.Pointer(p)).FpSrc
 135333 	pEList = (*Select)(unsafe.Pointer(p)).FpEList
 135334 	if (*Parse)(unsafe.Pointer(pParse)).FpWith != 0 && (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_View) != 0 {
 135335 		if (*Select)(unsafe.Pointer(p)).FpWith == uintptr(0) {
 135336 			(*Select)(unsafe.Pointer(p)).FpWith = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(With{})))
 135337 			if (*Select)(unsafe.Pointer(p)).FpWith == uintptr(0) {
 135338 				return WRC_Abort
 135339 			}
 135340 		}
 135341 		(*With)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpWith)).FbView = 1
 135342 	}
 135343 	Xsqlite3WithPush(tls, pParse, (*Select)(unsafe.Pointer(p)).FpWith, uint8(0))
 135344 
 135345 	Xsqlite3SrcListAssignCursors(tls, pParse, pTabList)
 135346 
 135347 	i = 0
 135348 	pFrom = pTabList + 8
 135349 __1:
 135350 	if !(i < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc) {
 135351 		goto __3
 135352 	}
 135353 	{
 135354 		var pTab uintptr
 135355 
 135356 		if (*SrcItem)(unsafe.Pointer(pFrom)).FpTab != 0 {
 135357 			goto __2
 135358 		}
 135359 
 135360 		if (*SrcItem)(unsafe.Pointer(pFrom)).FzName == uintptr(0) {
 135361 			var pSel uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect
 135362 
 135363 			if Xsqlite3WalkSelect(tls, pWalker, pSel) != 0 {
 135364 				return WRC_Abort
 135365 			}
 135366 			if Xsqlite3ExpandSubquery(tls, pParse, pFrom) != 0 {
 135367 				return WRC_Abort
 135368 			}
 135369 		} else if libc.AssignInt32(&rc, resolveFromTermToCte(tls, pParse, pWalker, pFrom)) != 0 {
 135370 			if rc > 1 {
 135371 				return WRC_Abort
 135372 			}
 135373 			pTab = (*SrcItem)(unsafe.Pointer(pFrom)).FpTab
 135374 
 135375 		} else {
 135376 			(*SrcItem)(unsafe.Pointer(pFrom)).FpTab = libc.AssignUintptr(&pTab, Xsqlite3LocateTableItem(tls, pParse, uint32(0), pFrom))
 135377 			if pTab == uintptr(0) {
 135378 				return WRC_Abort
 135379 			}
 135380 			if (*Table)(unsafe.Pointer(pTab)).FnTabRef >= U32(0xffff) {
 135381 				Xsqlite3ErrorMsg(tls, pParse, ts+20821,
 135382 					libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
 135383 				(*SrcItem)(unsafe.Pointer(pFrom)).FpTab = uintptr(0)
 135384 				return WRC_Abort
 135385 			}
 135386 			(*Table)(unsafe.Pointer(pTab)).FnTabRef++
 135387 			if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) && cannotBeFunction(tls, pParse, pFrom) != 0 {
 135388 				return WRC_Abort
 135389 			}
 135390 			if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_NORM) {
 135391 				var nCol I16
 135392 				var eCodeOrig U8 = U8((*Walker)(unsafe.Pointer(pWalker)).FeCode)
 135393 				if Xsqlite3ViewGetColumnNames(tls, pParse, pTab) != 0 {
 135394 					return WRC_Abort
 135395 				}
 135396 
 135397 				if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW {
 135398 					if (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableView) == uint64(0) &&
 135399 						(*Table)(unsafe.Pointer(pTab)).FpSchema != (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema {
 135400 						Xsqlite3ErrorMsg(tls, pParse, ts+20860,
 135401 							libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
 135402 					}
 135403 					(*SrcItem)(unsafe.Pointer(pFrom)).FpSelect = Xsqlite3SelectDup(tls, db, *(*uintptr)(unsafe.Pointer(pTab + 64)), 0)
 135404 				} else if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB &&
 135405 					uint32(int32(*(*uint16)(unsafe.Pointer(pFrom + 60 + 4))&0x80>>7)) != 0 &&
 135406 					*(*uintptr)(unsafe.Pointer(pTab + 64 + 16)) != uintptr(0) &&
 135407 					int32((*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTab + 64 + 16)))).FeVtabRisk) > libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) {
 135408 					Xsqlite3ErrorMsg(tls, pParse, ts+16090,
 135409 						libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName))
 135410 				}
 135411 
 135412 				nCol = (*Table)(unsafe.Pointer(pTab)).FnCol
 135413 				(*Table)(unsafe.Pointer(pTab)).FnCol = int16(-1)
 135414 				(*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(1)
 135415 				Xsqlite3WalkSelect(tls, pWalker, (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect)
 135416 				(*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(eCodeOrig)
 135417 				(*Table)(unsafe.Pointer(pTab)).FnCol = nCol
 135418 			}
 135419 		}
 135420 
 135421 		if uint32(int32(*(*uint16)(unsafe.Pointer(pFrom + 60 + 4))&0x2>>1)) != 0 && Xsqlite3IndexedByLookup(tls, pParse, pFrom) != 0 {
 135422 			return WRC_Abort
 135423 		}
 135424 
 135425 	}
 135426 	goto __2
 135427 __2:
 135428 	i++
 135429 	pFrom += 104
 135430 	goto __1
 135431 	goto __3
 135432 __3:
 135433 	;
 135434 	if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 || sqlite3ProcessJoin(tls, pParse, p) != 0 {
 135435 		return WRC_Abort
 135436 	}
 135437 
 135438 	for k = 0; k < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; k++ {
 135439 		pE = (*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(k)*32)).FpExpr
 135440 		if int32((*Expr)(unsafe.Pointer(pE)).Fop) == TK_ASTERISK {
 135441 			break
 135442 		}
 135443 
 135444 		if int32((*Expr)(unsafe.Pointer(pE)).Fop) == TK_DOT && int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pE)).FpRight)).Fop) == TK_ASTERISK {
 135445 			break
 135446 		}
 135447 		elistFlags = elistFlags | (*Expr)(unsafe.Pointer(pE)).Fflags
 135448 	}
 135449 	if k < (*ExprList)(unsafe.Pointer(pEList)).FnExpr {
 135450 		var a uintptr = pEList + 8
 135451 		var pNew uintptr = uintptr(0)
 135452 		var flags int32 = int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags)
 135453 		var longNames int32 = libc.Bool32(flags&SQLITE_FullColNames != 0 &&
 135454 			flags&SQLITE_ShortColNames == 0)
 135455 
 135456 		for k = 0; k < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; k++ {
 135457 			pE = (*ExprList_item)(unsafe.Pointer(a + uintptr(k)*32)).FpExpr
 135458 			elistFlags = elistFlags | (*Expr)(unsafe.Pointer(pE)).Fflags
 135459 			pRight = (*Expr)(unsafe.Pointer(pE)).FpRight
 135460 
 135461 			if int32((*Expr)(unsafe.Pointer(pE)).Fop) != TK_ASTERISK &&
 135462 				(int32((*Expr)(unsafe.Pointer(pE)).Fop) != TK_DOT || int32((*Expr)(unsafe.Pointer(pRight)).Fop) != TK_ASTERISK) {
 135463 				pNew = Xsqlite3ExprListAppend(tls, pParse, pNew, (*ExprList_item)(unsafe.Pointer(a+uintptr(k)*32)).FpExpr)
 135464 				if pNew != 0 {
 135465 					(*ExprList_item)(unsafe.Pointer(pNew + 8 + uintptr((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1)*32)).FzEName = (*ExprList_item)(unsafe.Pointer(a + uintptr(k)*32)).FzEName
 135466 					libc.SetBitFieldPtr16Uint32(pNew+8+uintptr((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1)*32+16+4, uint32(int32(*(*uint16)(unsafe.Pointer(a + uintptr(k)*32 + 16 + 4))&0x3>>0)), 0, 0x3)
 135467 					(*ExprList_item)(unsafe.Pointer(a + uintptr(k)*32)).FzEName = uintptr(0)
 135468 				}
 135469 				(*ExprList_item)(unsafe.Pointer(a + uintptr(k)*32)).FpExpr = uintptr(0)
 135470 			} else {
 135471 				var tableSeen int32 = 0
 135472 				var zTName uintptr = uintptr(0)
 135473 				if int32((*Expr)(unsafe.Pointer(pE)).Fop) == TK_DOT {
 135474 					zTName = *(*uintptr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pE)).FpLeft + 8))
 135475 				}
 135476 				i = 0
 135477 				pFrom = pTabList + 8
 135478 			__4:
 135479 				if !(i < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc) {
 135480 					goto __6
 135481 				}
 135482 				{
 135483 					var pTab uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FpTab
 135484 					var pNestedFrom uintptr
 135485 					var zTabName uintptr
 135486 					var zSchemaName uintptr = uintptr(0)
 135487 					var iDb int32
 135488 					var pUsing uintptr
 135489 
 135490 					if libc.AssignUintptr(&zTabName, (*SrcItem)(unsafe.Pointer(pFrom)).FzAlias) == uintptr(0) {
 135491 						zTabName = (*Table)(unsafe.Pointer(pTab)).FzName
 135492 					}
 135493 					if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 135494 						goto __6
 135495 					}
 135496 
 135497 					if uint32(int32(*(*uint16)(unsafe.Pointer(pFrom + 60 + 4))&0x2000>>13)) != 0 {
 135498 						pNestedFrom = (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pFrom)).FpSelect)).FpEList
 135499 
 135500 					} else {
 135501 						if zTName != 0 && Xsqlite3StrICmp(tls, zTName, zTabName) != 0 {
 135502 							goto __5
 135503 						}
 135504 						pNestedFrom = uintptr(0)
 135505 						iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
 135506 						if iDb >= 0 {
 135507 							zSchemaName = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
 135508 						} else {
 135509 							zSchemaName = ts + 7798
 135510 						}
 135511 					}
 135512 					if i+1 < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc &&
 135513 						uint32(int32(*(*uint16)(unsafe.Pointer(pFrom + 1*104 + 60 + 4))&0x400>>10)) != 0 &&
 135514 						int32(selFlags)&SF_NestedFrom != 0 {
 135515 						var ii int32
 135516 						pUsing = *(*uintptr)(unsafe.Pointer(pFrom + 1*104 + 72))
 135517 						for ii = 0; ii < (*IdList)(unsafe.Pointer(pUsing)).FnId; ii++ {
 135518 							var zUName uintptr = (*IdList_item)(unsafe.Pointer(pUsing + 8 + uintptr(ii)*16)).FzName
 135519 							pRight = Xsqlite3Expr(tls, db, TK_ID, zUName)
 135520 							pNew = Xsqlite3ExprListAppend(tls, pParse, pNew, pRight)
 135521 							if pNew != 0 {
 135522 								var pX uintptr = pNew + 8 + uintptr((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1)*32
 135523 
 135524 								(*ExprList_item)(unsafe.Pointer(pX)).FzEName = Xsqlite3MPrintf(tls, db, ts+20891, libc.VaList(bp+24, zUName))
 135525 								libc.SetBitFieldPtr16Uint32(pX+16+4, uint32(ENAME_TAB), 0, 0x3)
 135526 								libc.SetBitFieldPtr16Uint32(pX+16+4, uint32(1), 7, 0x80)
 135527 							}
 135528 						}
 135529 					} else {
 135530 						pUsing = uintptr(0)
 135531 					}
 135532 					for j = 0; j < int32((*Table)(unsafe.Pointer(pTab)).FnCol); j++ {
 135533 						var zName uintptr = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*24)).FzCnName
 135534 						var pX uintptr
 135535 
 135536 						if zTName != 0 &&
 135537 							pNestedFrom != 0 &&
 135538 							Xsqlite3MatchEName(tls, pNestedFrom+8+uintptr(j)*32, uintptr(0), zTName, uintptr(0)) == 0 {
 135539 							continue
 135540 						}
 135541 
 135542 						if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_IncludeHidden) == U32(0) &&
 135543 							int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*24)).FcolFlags)&COLFLAG_HIDDEN != 0 {
 135544 							continue
 135545 						}
 135546 						if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*24)).FcolFlags)&COLFLAG_NOEXPAND != 0 &&
 135547 							zTName == uintptr(0) &&
 135548 							int32(selFlags)&SF_NestedFrom == 0 {
 135549 							continue
 135550 						}
 135551 						tableSeen = 1
 135552 
 135553 						if i > 0 && zTName == uintptr(0) && int32(selFlags)&SF_NestedFrom == 0 {
 135554 							if uint32(int32(*(*uint16)(unsafe.Pointer(pFrom + 60 + 4))&0x400>>10)) != 0 &&
 135555 								Xsqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pFrom + 72)), zName) >= 0 {
 135556 								continue
 135557 							}
 135558 						}
 135559 						pRight = Xsqlite3Expr(tls, db, TK_ID, zName)
 135560 						if (*SrcList)(unsafe.Pointer(pTabList)).FnSrc > 1 &&
 135561 							(int32((*SrcItem)(unsafe.Pointer(pFrom)).Ffg.Fjointype)&JT_LTORJ == 0 ||
 135562 								int32(selFlags)&SF_NestedFrom != 0 ||
 135563 								!(inAnyUsingClause(tls, zName, pFrom, (*SrcList)(unsafe.Pointer(pTabList)).FnSrc-i-1) != 0)) ||
 135564 							int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
 135565 							var pLeft uintptr
 135566 							pLeft = Xsqlite3Expr(tls, db, TK_ID, zTabName)
 135567 							pExpr = Xsqlite3PExpr(tls, pParse, TK_DOT, pLeft, pRight)
 135568 							if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME && (*Expr)(unsafe.Pointer(pE)).FpLeft != 0 {
 135569 								Xsqlite3RenameTokenRemap(tls, pParse, pLeft, (*Expr)(unsafe.Pointer(pE)).FpLeft)
 135570 							}
 135571 							if zSchemaName != 0 {
 135572 								pLeft = Xsqlite3Expr(tls, db, TK_ID, zSchemaName)
 135573 								pExpr = Xsqlite3PExpr(tls, pParse, TK_DOT, pLeft, pExpr)
 135574 							}
 135575 						} else {
 135576 							pExpr = pRight
 135577 						}
 135578 						pNew = Xsqlite3ExprListAppend(tls, pParse, pNew, pExpr)
 135579 						if pNew == uintptr(0) {
 135580 							break
 135581 						}
 135582 						pX = pNew + 8 + uintptr((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1)*32
 135583 
 135584 						if int32(selFlags)&SF_NestedFrom != 0 && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 135585 							if pNestedFrom != 0 {
 135586 								(*ExprList_item)(unsafe.Pointer(pX)).FzEName = Xsqlite3DbStrDup(tls, db, (*ExprList_item)(unsafe.Pointer(pNestedFrom+8+uintptr(j)*32)).FzEName)
 135587 
 135588 							} else {
 135589 								(*ExprList_item)(unsafe.Pointer(pX)).FzEName = Xsqlite3MPrintf(tls, db, ts+20896,
 135590 									libc.VaList(bp+32, zSchemaName, zTabName, zName))
 135591 
 135592 							}
 135593 							libc.SetBitFieldPtr16Uint32(pX+16+4, uint32(ENAME_TAB), 0, 0x3)
 135594 							if uint32(int32(*(*uint16)(unsafe.Pointer(pFrom + 60 + 4))&0x400>>10)) != 0 &&
 135595 								Xsqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pFrom + 72)), zName) >= 0 ||
 135596 								pUsing != 0 && Xsqlite3IdListIndex(tls, pUsing, zName) >= 0 ||
 135597 								int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*24)).FcolFlags)&COLFLAG_NOEXPAND != 0 {
 135598 								libc.SetBitFieldPtr16Uint32(pX+16+4, uint32(1), 8, 0x100)
 135599 							}
 135600 						} else if longNames != 0 {
 135601 							(*ExprList_item)(unsafe.Pointer(pX)).FzEName = Xsqlite3MPrintf(tls, db, ts+13413, libc.VaList(bp+56, zTabName, zName))
 135602 							libc.SetBitFieldPtr16Uint32(pX+16+4, uint32(ENAME_NAME), 0, 0x3)
 135603 						} else {
 135604 							(*ExprList_item)(unsafe.Pointer(pX)).FzEName = Xsqlite3DbStrDup(tls, db, zName)
 135605 							libc.SetBitFieldPtr16Uint32(pX+16+4, uint32(ENAME_NAME), 0, 0x3)
 135606 						}
 135607 					}
 135608 
 135609 				}
 135610 				goto __5
 135611 			__5:
 135612 				i++
 135613 				pFrom += 104
 135614 				goto __4
 135615 				goto __6
 135616 			__6:
 135617 				;
 135618 				if !(tableSeen != 0) {
 135619 					if zTName != 0 {
 135620 						Xsqlite3ErrorMsg(tls, pParse, ts+20905, libc.VaList(bp+72, zTName))
 135621 					} else {
 135622 						Xsqlite3ErrorMsg(tls, pParse, ts+20923, 0)
 135623 					}
 135624 				}
 135625 			}
 135626 		}
 135627 		Xsqlite3ExprListDelete(tls, db, pEList)
 135628 		(*Select)(unsafe.Pointer(p)).FpEList = pNew
 135629 	}
 135630 	if (*Select)(unsafe.Pointer(p)).FpEList != 0 {
 135631 		if (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) {
 135632 			Xsqlite3ErrorMsg(tls, pParse, ts+20943, 0)
 135633 			return WRC_Abort
 135634 		}
 135635 		if elistFlags&U32(EP_HasFunc|EP_Subquery) != U32(0) {
 135636 			*(*U32)(unsafe.Pointer(p + 4)) |= U32(SF_ComplexResult)
 135637 		}
 135638 	}
 135639 	return WRC_Continue
 135640 }
 135641 
 135642 func sqlite3SelectExpand(tls *libc.TLS, pParse uintptr, pSelect uintptr) {
 135643 	bp := tls.Alloc(48)
 135644 	defer tls.Free(48)
 135645 
 135646 	(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 135647 		f func(*libc.TLS, uintptr, uintptr) int32
 135648 	}{Xsqlite3ExprWalkNoop}))
 135649 	(*Walker)(unsafe.Pointer(bp)).FpParse = pParse
 135650 	if (*Parse)(unsafe.Pointer(pParse)).FhasCompound != 0 {
 135651 		(*Walker)(unsafe.Pointer(bp)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
 135652 			f func(*libc.TLS, uintptr, uintptr) int32
 135653 		}{convertCompoundSelectToSubquery}))
 135654 		(*Walker)(unsafe.Pointer(bp)).FxSelectCallback2 = uintptr(0)
 135655 		Xsqlite3WalkSelect(tls, bp, pSelect)
 135656 	}
 135657 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
 135658 		f func(*libc.TLS, uintptr, uintptr) int32
 135659 	}{selectExpander}))
 135660 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback2 = *(*uintptr)(unsafe.Pointer(&struct {
 135661 		f func(*libc.TLS, uintptr, uintptr)
 135662 	}{Xsqlite3SelectPopWith}))
 135663 	(*Walker)(unsafe.Pointer(bp)).FeCode = U16(0)
 135664 	Xsqlite3WalkSelect(tls, bp, pSelect)
 135665 }
 135666 
 135667 func selectAddSubqueryTypeInfo(tls *libc.TLS, pWalker uintptr, p uintptr) {
 135668 	var pParse uintptr
 135669 	var i int32
 135670 	var pTabList uintptr
 135671 	var pFrom uintptr
 135672 
 135673 	if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_HasTypeInfo) != 0 {
 135674 		return
 135675 	}
 135676 	*(*U32)(unsafe.Pointer(p + 4)) |= U32(SF_HasTypeInfo)
 135677 	pParse = (*Walker)(unsafe.Pointer(pWalker)).FpParse
 135678 	pTabList = (*Select)(unsafe.Pointer(p)).FpSrc
 135679 	i = 0
 135680 	pFrom = pTabList + 8
 135681 __1:
 135682 	if !(i < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc) {
 135683 		goto __3
 135684 	}
 135685 	{
 135686 		var pTab uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FpTab
 135687 
 135688 		if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Ephemeral) != U32(0) {
 135689 			var pSel uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect
 135690 			if pSel != 0 {
 135691 				Xsqlite3SubqueryColumnTypes(tls, pParse, pTab, pSel, int8(SQLITE_AFF_NONE))
 135692 			}
 135693 		}
 135694 
 135695 	}
 135696 	goto __2
 135697 __2:
 135698 	i++
 135699 	pFrom += 104
 135700 	goto __1
 135701 	goto __3
 135702 __3:
 135703 }
 135704 
 135705 func sqlite3SelectAddTypeInfo(tls *libc.TLS, pParse uintptr, pSelect uintptr) {
 135706 	bp := tls.Alloc(48)
 135707 	defer tls.Free(48)
 135708 
 135709 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
 135710 		f func(*libc.TLS, uintptr, uintptr) int32
 135711 	}{Xsqlite3SelectWalkNoop}))
 135712 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback2 = *(*uintptr)(unsafe.Pointer(&struct {
 135713 		f func(*libc.TLS, uintptr, uintptr)
 135714 	}{selectAddSubqueryTypeInfo}))
 135715 	(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 135716 		f func(*libc.TLS, uintptr, uintptr) int32
 135717 	}{Xsqlite3ExprWalkNoop}))
 135718 	(*Walker)(unsafe.Pointer(bp)).FpParse = pParse
 135719 	Xsqlite3WalkSelect(tls, bp, pSelect)
 135720 }
 135721 
 135722 // This routine sets up a SELECT statement for processing.  The
 135723 // following is accomplished:
 135724 //
 135725 //   - VDBE Cursor numbers are assigned to all FROM-clause terms.
 135726 //   - Ephemeral Table objects are created for all FROM-clause subqueries.
 135727 //   - ON and USING clauses are shifted into WHERE statements
 135728 //   - Wildcards "*" and "TABLE.*" in result sets are expanded.
 135729 //   - Identifiers in expression are matched to tables.
 135730 //
 135731 // This routine acts recursively on all subqueries within the SELECT.
 135732 func Xsqlite3SelectPrep(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintptr) {
 135733 	if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 {
 135734 		return
 135735 	}
 135736 	if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_HasTypeInfo) != 0 {
 135737 		return
 135738 	}
 135739 	sqlite3SelectExpand(tls, pParse, p)
 135740 	if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 135741 		return
 135742 	}
 135743 	Xsqlite3ResolveSelectNames(tls, pParse, p, pOuterNC)
 135744 	if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 135745 		return
 135746 	}
 135747 	sqlite3SelectAddTypeInfo(tls, pParse, p)
 135748 }
 135749 
 135750 func analyzeAggFuncArgs(tls *libc.TLS, pAggInfo uintptr, pNC uintptr) {
 135751 	var i int32
 135752 
 135753 	*(*int32)(unsafe.Pointer(pNC + 40)) |= NC_InAggFunc
 135754 	for i = 0; i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc; i++ {
 135755 		var pExpr uintptr = (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24)).FpFExpr
 135756 
 135757 		Xsqlite3ExprAnalyzeAggList(tls, pNC, *(*uintptr)(unsafe.Pointer(pExpr + 32)))
 135758 
 135759 		if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0) {
 135760 			Xsqlite3ExprAnalyzeAggregates(tls, pNC, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64)))).FpFilter)
 135761 		}
 135762 	}
 135763 	*(*int32)(unsafe.Pointer(pNC + 40)) &= libc.CplInt32(NC_InAggFunc)
 135764 }
 135765 
 135766 func optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect uintptr, pAggInfo uintptr, pNC uintptr) {
 135767 	(*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn = (*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator
 135768 	if int32((*AggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn) > 0 {
 135769 		if (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn == 0 {
 135770 			(*AggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = U16((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpGroupBy)).FnExpr)
 135771 		} else {
 135772 			(*AggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = U16(int32((*AggInfo_col)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol+uintptr((*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn-1)*24)).FiSorterColumn) + 1)
 135773 		}
 135774 	}
 135775 	analyzeAggFuncArgs(tls, pAggInfo, pNC)
 135776 	_ = pSelect
 135777 	_ = pParse
 135778 }
 135779 
 135780 func aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 135781 	var pAggInfo uintptr
 135782 	var pCol uintptr
 135783 	_ = pWalker
 135784 	if (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) {
 135785 		return WRC_Continue
 135786 	}
 135787 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AGG_COLUMN {
 135788 		return WRC_Continue
 135789 	}
 135790 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AGG_FUNCTION {
 135791 		return WRC_Continue
 135792 	}
 135793 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IF_NULL_ROW {
 135794 		return WRC_Continue
 135795 	}
 135796 	pAggInfo = (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo
 135797 
 135798 	pCol = (*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiAgg)*24
 135799 	(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_AGG_COLUMN)
 135800 	(*Expr)(unsafe.Pointer(pExpr)).FiTable = (*AggInfo_col)(unsafe.Pointer(pCol)).FiTable
 135801 	(*Expr)(unsafe.Pointer(pExpr)).FiColumn = (*AggInfo_col)(unsafe.Pointer(pCol)).FiColumn
 135802 	return WRC_Prune
 135803 }
 135804 
 135805 func aggregateConvertIndexedExprRefToColumn(tls *libc.TLS, pAggInfo uintptr) {
 135806 	bp := tls.Alloc(48)
 135807 	defer tls.Free(48)
 135808 
 135809 	var i int32
 135810 
 135811 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Walker{})))
 135812 	(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 135813 		f func(*libc.TLS, uintptr, uintptr) int32
 135814 	}{aggregateIdxEprRefToColCallback}))
 135815 	for i = 0; i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc; i++ {
 135816 		Xsqlite3WalkExpr(tls, bp, (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc+uintptr(i)*24)).FpFExpr)
 135817 	}
 135818 }
 135819 
 135820 func assignAggregateRegisters(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) {
 135821 	(*AggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 135822 	*(*int32)(unsafe.Pointer(pParse + 56)) += (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc
 135823 }
 135824 
 135825 func resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) {
 135826 	bp := tls.Alloc(8)
 135827 	defer tls.Free(8)
 135828 
 135829 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 135830 	var i int32
 135831 	var pFunc uintptr
 135832 	var nReg int32 = (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc + (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn
 135833 
 135834 	if nReg == 0 {
 135835 		return
 135836 	}
 135837 	if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 135838 		return
 135839 	}
 135840 	Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, (*AggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg,
 135841 		(*AggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg+nReg-1)
 135842 	pFunc = (*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc
 135843 	i = 0
 135844 __1:
 135845 	if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) {
 135846 		goto __3
 135847 	}
 135848 	{
 135849 		if (*AggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct >= 0 {
 135850 			var pE uintptr = (*AggInfo_func)(unsafe.Pointer(pFunc)).FpFExpr
 135851 
 135852 			if *(*uintptr)(unsafe.Pointer(pE + 32)) == uintptr(0) || (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pE + 32)))).FnExpr != 1 {
 135853 				Xsqlite3ErrorMsg(tls, pParse,
 135854 					ts+20974, 0)
 135855 				(*AggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct = -1
 135856 			} else {
 135857 				var pKeyInfo uintptr = Xsqlite3KeyInfoFromExprList(tls, pParse, *(*uintptr)(unsafe.Pointer(pE + 32)), 0, 0)
 135858 				(*AggInfo_func)(unsafe.Pointer(pFunc)).FiDistAddr = Xsqlite3VdbeAddOp4(tls, v, OP_OpenEphemeral,
 135859 					(*AggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct, 0, 0, pKeyInfo, -8)
 135860 				Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+21025, libc.VaList(bp, (*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName))
 135861 			}
 135862 		}
 135863 
 135864 	}
 135865 	goto __2
 135866 __2:
 135867 	i++
 135868 	pFunc += 24
 135869 	goto __1
 135870 	goto __3
 135871 __3:
 135872 }
 135873 
 135874 func finalizeAggFunctions(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) {
 135875 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 135876 	var i int32
 135877 	var pF uintptr
 135878 	i = 0
 135879 	pF = (*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc
 135880 __1:
 135881 	if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) {
 135882 		goto __3
 135883 	}
 135884 	{
 135885 		var pList uintptr
 135886 
 135887 		pList = *(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr + 32))
 135888 		Xsqlite3VdbeAddOp2(tls, v, OP_AggFinal, func() int32 {
 135889 			return (*AggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg + (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + i
 135890 		}(),
 135891 			func() int32 {
 135892 				if pList != 0 {
 135893 					return (*ExprList)(unsafe.Pointer(pList)).FnExpr
 135894 				}
 135895 				return 0
 135896 			}())
 135897 		Xsqlite3VdbeAppendP4(tls, v, (*AggInfo_func)(unsafe.Pointer(pF)).FpFunc, -7)
 135898 
 135899 	}
 135900 	goto __2
 135901 __2:
 135902 	i++
 135903 	pF += 24
 135904 	goto __1
 135905 	goto __3
 135906 __3:
 135907 }
 135908 
 135909 func updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo uintptr, eDistinctType int32) {
 135910 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 135911 	var i int32
 135912 	var regHit int32 = 0
 135913 	var addrHitTest int32 = 0
 135914 	var pF uintptr
 135915 	var pC uintptr
 135916 
 135917 	if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 135918 		return
 135919 	}
 135920 	(*AggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = U8(1)
 135921 	i = 0
 135922 	pF = (*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc
 135923 __1:
 135924 	if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) {
 135925 		goto __3
 135926 	}
 135927 	{
 135928 		var nArg int32
 135929 		var addrNext int32 = 0
 135930 		var regAgg int32
 135931 		var pList uintptr
 135932 
 135933 		pList = *(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr + 32))
 135934 		if (*Expr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr)).Fflags&U32(EP_WinFunc) != U32(0) {
 135935 			var pFilter uintptr = (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr + 64)))).FpFilter
 135936 			if (*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0 &&
 135937 				(*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags&U32(SQLITE_FUNC_NEEDCOLL) != 0 &&
 135938 				regAcc != 0 {
 135939 				if regHit == 0 {
 135940 					regHit = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 135941 				}
 135942 
 135943 				Xsqlite3VdbeAddOp2(tls, v, OP_Copy, regAcc, regHit)
 135944 			}
 135945 			addrNext = Xsqlite3VdbeMakeLabel(tls, pParse)
 135946 			Xsqlite3ExprIfFalse(tls, pParse, pFilter, addrNext, SQLITE_JUMPIFNULL)
 135947 		}
 135948 		if pList != 0 {
 135949 			nArg = (*ExprList)(unsafe.Pointer(pList)).FnExpr
 135950 			regAgg = Xsqlite3GetTempRange(tls, pParse, nArg)
 135951 			Xsqlite3ExprCodeExprList(tls, pParse, pList, regAgg, 0, uint8(SQLITE_ECEL_DUP))
 135952 		} else {
 135953 			nArg = 0
 135954 			regAgg = 0
 135955 		}
 135956 		if (*AggInfo_func)(unsafe.Pointer(pF)).FiDistinct >= 0 && pList != 0 {
 135957 			if addrNext == 0 {
 135958 				addrNext = Xsqlite3VdbeMakeLabel(tls, pParse)
 135959 			}
 135960 			(*AggInfo_func)(unsafe.Pointer(pF)).FiDistinct = codeDistinct(tls, pParse, eDistinctType,
 135961 				(*AggInfo_func)(unsafe.Pointer(pF)).FiDistinct, addrNext, pList, regAgg)
 135962 		}
 135963 		if (*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags&U32(SQLITE_FUNC_NEEDCOLL) != 0 {
 135964 			var pColl uintptr = uintptr(0)
 135965 			var pItem uintptr
 135966 			var j int32
 135967 
 135968 			j = 0
 135969 			pItem = pList + 8
 135970 		__4:
 135971 			if !(!(pColl != 0) && j < nArg) {
 135972 				goto __6
 135973 			}
 135974 			{
 135975 				pColl = Xsqlite3ExprCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr)
 135976 
 135977 			}
 135978 			goto __5
 135979 		__5:
 135980 			j++
 135981 			pItem += 32
 135982 			goto __4
 135983 			goto __6
 135984 		__6:
 135985 			;
 135986 			if !(pColl != 0) {
 135987 				pColl = (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl
 135988 			}
 135989 			if regHit == 0 && (*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0 {
 135990 				regHit = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 135991 			}
 135992 			Xsqlite3VdbeAddOp4(tls, v, OP_CollSeq, regHit, 0, 0, pColl, -2)
 135993 		}
 135994 		Xsqlite3VdbeAddOp3(tls, v, OP_AggStep, 0, regAgg, func() int32 {
 135995 			return (*AggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg + (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + i
 135996 		}())
 135997 		Xsqlite3VdbeAppendP4(tls, v, (*AggInfo_func)(unsafe.Pointer(pF)).FpFunc, -7)
 135998 		Xsqlite3VdbeChangeP5(tls, v, uint16(U8(nArg)))
 135999 		Xsqlite3ReleaseTempRange(tls, pParse, regAgg, nArg)
 136000 		if addrNext != 0 {
 136001 			Xsqlite3VdbeResolveLabel(tls, v, addrNext)
 136002 		}
 136003 
 136004 	}
 136005 	goto __2
 136006 __2:
 136007 	i++
 136008 	pF += 24
 136009 	goto __1
 136010 	goto __3
 136011 __3:
 136012 	;
 136013 	if regHit == 0 && (*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0 {
 136014 		regHit = regAcc
 136015 	}
 136016 	if regHit != 0 {
 136017 		addrHitTest = Xsqlite3VdbeAddOp1(tls, v, OP_If, regHit)
 136018 	}
 136019 	i = 0
 136020 	pC = (*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol
 136021 __7:
 136022 	if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator) {
 136023 		goto __9
 136024 	}
 136025 	{
 136026 		Xsqlite3ExprCode(tls, pParse, (*AggInfo_col)(unsafe.Pointer(pC)).FpCExpr, func() int32 { ; return (*AggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg + i }())
 136027 
 136028 	}
 136029 	goto __8
 136030 __8:
 136031 	i++
 136032 	pC += 24
 136033 	goto __7
 136034 	goto __9
 136035 __9:
 136036 	;
 136037 	(*AggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = U8(0)
 136038 	if addrHitTest != 0 {
 136039 		Xsqlite3VdbeJumpHereOrPopInst(tls, v, addrHitTest)
 136040 	}
 136041 }
 136042 
 136043 func explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintptr) {
 136044 	bp := tls.Alloc(24)
 136045 	defer tls.Free(24)
 136046 
 136047 	if int32((*Parse)(unsafe.Pointer(pParse)).Fexplain) == 2 {
 136048 		var bCover int32 = libc.Bool32(pIdx != uintptr(0) && ((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) || !(int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY)))
 136049 		Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+21058,
 136050 			libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName,
 136051 				func() uintptr {
 136052 					if bCover != 0 {
 136053 						return ts + 21070
 136054 					}
 136055 					return ts + 1544
 136056 				}(),
 136057 				func() uintptr {
 136058 					if bCover != 0 {
 136059 						return (*Index)(unsafe.Pointer(pIdx)).FzName
 136060 					}
 136061 					return ts + 1544
 136062 				}()))
 136063 	}
 136064 }
 136065 
 136066 func havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 136067 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_AND {
 136068 		var pS uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40))
 136069 
 136070 		if Xsqlite3ExprIsConstantOrGroupBy(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*Select)(unsafe.Pointer(pS)).FpGroupBy) != 0 &&
 136071 			libc.Bool32((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_OuterON|EP_IsFalse) == U32(EP_IsFalse)) == 0 &&
 136072 			(*Expr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) {
 136073 			var db uintptr = (*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(pWalker)).FpParse)).Fdb
 136074 			var pNew uintptr = Xsqlite3Expr(tls, db, TK_INTEGER, ts+9290)
 136075 			if pNew != 0 {
 136076 				var pWhere uintptr = (*Select)(unsafe.Pointer(pS)).FpWhere
 136077 				{
 136078 					var t = *(*Expr)(unsafe.Pointer(pNew))
 136079 					*(*Expr)(unsafe.Pointer(pNew)) = *(*Expr)(unsafe.Pointer(pExpr))
 136080 					*(*Expr)(unsafe.Pointer(pExpr)) = t
 136081 				}
 136082 
 136083 				pNew = Xsqlite3ExprAnd(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, pWhere, pNew)
 136084 				(*Select)(unsafe.Pointer(pS)).FpWhere = pNew
 136085 				(*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(1)
 136086 			}
 136087 		}
 136088 		return WRC_Prune
 136089 	}
 136090 	return WRC_Continue
 136091 }
 136092 
 136093 func havingToWhere(tls *libc.TLS, pParse uintptr, p uintptr) {
 136094 	bp := tls.Alloc(48)
 136095 	defer tls.Free(48)
 136096 
 136097 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Walker{})))
 136098 	(*Walker)(unsafe.Pointer(bp)).FpParse = pParse
 136099 	(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 136100 		f func(*libc.TLS, uintptr, uintptr) int32
 136101 	}{havingToWhereExprCb}))
 136102 	*(*uintptr)(unsafe.Pointer(bp + 40)) = p
 136103 	Xsqlite3WalkExpr(tls, bp, (*Select)(unsafe.Pointer(p)).FpHaving)
 136104 }
 136105 
 136106 func isSelfJoinView(tls *libc.TLS, pTabList uintptr, pThis uintptr, iFirst int32, iEnd int32) uintptr {
 136107 	var pItem uintptr
 136108 
 136109 	if (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pThis)).FpSelect)).FselFlags&U32(SF_PushDown) != 0 {
 136110 		return uintptr(0)
 136111 	}
 136112 	for iFirst < iEnd {
 136113 		var pS1 uintptr
 136114 		pItem = pTabList + 8 + uintptr(libc.PostIncInt32(&iFirst, 1))*104
 136115 		if (*SrcItem)(unsafe.Pointer(pItem)).FpSelect == uintptr(0) {
 136116 			continue
 136117 		}
 136118 		if uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x20>>5)) != 0 {
 136119 			continue
 136120 		}
 136121 		if (*SrcItem)(unsafe.Pointer(pItem)).FzName == uintptr(0) {
 136122 			continue
 136123 		}
 136124 
 136125 		if (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpTab)).FpSchema != (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pThis)).FpTab)).FpSchema {
 136126 			continue
 136127 		}
 136128 		if Xsqlite3_stricmp(tls, (*SrcItem)(unsafe.Pointer(pItem)).FzName, (*SrcItem)(unsafe.Pointer(pThis)).FzName) != 0 {
 136129 			continue
 136130 		}
 136131 		pS1 = (*SrcItem)(unsafe.Pointer(pItem)).FpSelect
 136132 		if (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpTab)).FpSchema == uintptr(0) && (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pThis)).FpSelect)).FselId != (*Select)(unsafe.Pointer(pS1)).FselId {
 136133 			continue
 136134 		}
 136135 		if (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FselFlags&U32(SF_PushDown) != 0 {
 136136 			continue
 136137 		}
 136138 		return pItem
 136139 	}
 136140 	return uintptr(0)
 136141 }
 136142 
 136143 func agginfoFree(tls *libc.TLS, db uintptr, p uintptr) {
 136144 	Xsqlite3DbFree(tls, db, (*AggInfo)(unsafe.Pointer(p)).FaCol)
 136145 	Xsqlite3DbFree(tls, db, (*AggInfo)(unsafe.Pointer(p)).FaFunc)
 136146 	Xsqlite3DbFreeNN(tls, db, p)
 136147 }
 136148 
 136149 func sameSrcAlias(tls *libc.TLS, p0 uintptr, pSrc uintptr) int32 {
 136150 	var i int32
 136151 	for i = 0; i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc; i++ {
 136152 		var p1 uintptr = pSrc + 8 + uintptr(i)*104
 136153 		if p1 == p0 {
 136154 			continue
 136155 		}
 136156 		if (*SrcItem)(unsafe.Pointer(p0)).FpTab == (*SrcItem)(unsafe.Pointer(p1)).FpTab && 0 == Xsqlite3_stricmp(tls, (*SrcItem)(unsafe.Pointer(p0)).FzAlias, (*SrcItem)(unsafe.Pointer(p1)).FzAlias) {
 136157 			return 1
 136158 		}
 136159 		if (*SrcItem)(unsafe.Pointer(p1)).FpSelect != 0 &&
 136160 			(*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(p1)).FpSelect)).FselFlags&U32(SF_NestedFrom) != U32(0) &&
 136161 			sameSrcAlias(tls, p0, (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(p1)).FpSelect)).FpSrc) != 0 {
 136162 			return 1
 136163 		}
 136164 	}
 136165 	return 0
 136166 }
 136167 
 136168 func fromClauseTermCanBeCoroutine(tls *libc.TLS, pParse uintptr, pTabList uintptr, i int32, selFlags int32) int32 {
 136169 	var pItem uintptr = pTabList + 8 + uintptr(i)*104
 136170 	if uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x100>>8)) != 0 {
 136171 		var pCteUse uintptr = *(*uintptr)(unsafe.Pointer(pItem + 96))
 136172 		if int32((*CteUse)(unsafe.Pointer(pCteUse)).FeM10d) == M10d_Yes {
 136173 			return 0
 136174 		}
 136175 		if (*CteUse)(unsafe.Pointer(pCteUse)).FnUse >= 2 && int32((*CteUse)(unsafe.Pointer(pCteUse)).FeM10d) != M10d_No {
 136176 			return 0
 136177 		}
 136178 	}
 136179 	if int32((*SrcItem)(unsafe.Pointer(pTabList+8)).Ffg.Fjointype)&JT_LTORJ != 0 {
 136180 		return 0
 136181 	}
 136182 	if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&U32(SQLITE_Coroutines) != U32(0) {
 136183 		return 0
 136184 	}
 136185 	if isSelfJoinView(tls, pTabList, pItem, i+1, (*SrcList)(unsafe.Pointer(pTabList)).FnSrc) != uintptr(0) {
 136186 		return 0
 136187 	}
 136188 	if i == 0 {
 136189 		if (*SrcList)(unsafe.Pointer(pTabList)).FnSrc == 1 {
 136190 			return 1
 136191 		}
 136192 		if int32((*SrcItem)(unsafe.Pointer(pTabList+8+1*104)).Ffg.Fjointype)&JT_CROSS != 0 {
 136193 			return 1
 136194 		}
 136195 		if selFlags&SF_UpdateFrom != 0 {
 136196 			return 0
 136197 		}
 136198 		return 1
 136199 	}
 136200 	if selFlags&SF_UpdateFrom != 0 {
 136201 		return 0
 136202 	}
 136203 	for 1 != 0 {
 136204 		if int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&(JT_OUTER|JT_CROSS) != 0 {
 136205 			return 0
 136206 		}
 136207 		if i == 0 {
 136208 			break
 136209 		}
 136210 		i--
 136211 		pItem -= 104
 136212 		if (*SrcItem)(unsafe.Pointer(pItem)).FpSelect != uintptr(0) {
 136213 			return 0
 136214 		}
 136215 	}
 136216 	return 1
 136217 }
 136218 
 136219 // Generate code for the SELECT statement given in the p argument.
 136220 //
 136221 // The results are returned according to the SelectDest structure.
 136222 // See comments in sqliteInt.h for further information.
 136223 //
 136224 // This routine returns the number of errors.  If any errors are
 136225 // encountered, then an appropriate error message is left in
 136226 // pParse->zErrMsg.
 136227 //
 136228 // This routine does NOT free the Select structure passed in.  The
 136229 // calling function needs to do that.
 136230 func Xsqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 {
 136231 	bp := tls.Alloc(216)
 136232 	defer tls.Free(216)
 136233 
 136234 	var i int32
 136235 	var j int32
 136236 	var pWInfo uintptr
 136237 	var v uintptr
 136238 	var isAgg int32
 136239 	var pEList uintptr
 136240 	var pTabList uintptr
 136241 	var pWhere uintptr
 136242 	var pGroupBy uintptr
 136243 	var pHaving uintptr
 136244 	var pAggInfo uintptr
 136245 	var rc int32
 136246 
 136247 	var iEnd int32
 136248 	var db uintptr
 136249 
 136250 	var minMaxFlag U8
 136251 	var p0 uintptr
 136252 	var pItem uintptr
 136253 	var pSub uintptr
 136254 	var pTab uintptr
 136255 
 136256 	var addrTop int32
 136257 
 136258 	var pCteUse uintptr
 136259 	var pCteUse1 uintptr
 136260 
 136261 	var topAddr int32
 136262 	var onceAddr int32
 136263 	var pItem1 uintptr
 136264 	var pPrior uintptr
 136265 
 136266 	var pSub1 uintptr
 136267 	var zSavedAuthContext uintptr
 136268 	var pKeyInfo uintptr
 136269 
 136270 	var ii int32
 136271 	var addrGosub int32
 136272 	var iCont int32
 136273 	var iBreak int32
 136274 	var regGosub int32
 136275 
 136276 	var wctrlFlags U16
 136277 	var pWin uintptr
 136278 	var sortFlags U8
 136279 	var ii1 int32
 136280 	var k int32
 136281 	var pItem2 uintptr
 136282 	var pExpr uintptr
 136283 	var pCol uintptr
 136284 
 136285 	var regBase int32
 136286 	var regRecord int32
 136287 	var nCol int32
 136288 	var nGroupBy int32
 136289 	var pF uintptr
 136290 	var pKeyInfo1 uintptr
 136291 	var addr1 int32
 136292 	var addrOutputRow int32
 136293 	var regOutputRow int32
 136294 	var addrSetAbort int32
 136295 	var addrTopOfLoop int32
 136296 	var addrSortingIdx int32
 136297 	var addrReset int32
 136298 	var regReset int32
 136299 	var pDistinct uintptr
 136300 	var distFlag U16
 136301 	var eDist int32
 136302 
 136303 	var iDb int32
 136304 	var iCsr int32
 136305 	var pIdx uintptr
 136306 	var pKeyInfo2 uintptr
 136307 	var pBest uintptr
 136308 	var iRoot Pgno
 136309 	var pF1 uintptr
 136310 	var regAcc int32
 136311 	var pDistinct1 uintptr
 136312 	var distFlag1 U16
 136313 	var eDist1 int32
 136314 	var pTab1 uintptr
 136315 
 136316 	var iAMem int32
 136317 	var iBMem int32
 136318 	var iUseFlag int32
 136319 
 136320 	var iAbortFlag int32
 136321 	var groupBySort int32
 136322 	var addrEnd int32
 136323 	var sortPTab int32
 136324 	var sortOut int32
 136325 	var orderByGrp int32
 136326 	pEList = uintptr(0)
 136327 	pAggInfo = uintptr(0)
 136328 	rc = 1
 136329 	*(*uintptr)(unsafe.Pointer(bp + 208)) = uintptr(0)
 136330 
 136331 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 136332 
 136333 	v = Xsqlite3GetVdbe(tls, pParse)
 136334 	if !(p == uintptr(0) || (*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
 136335 		goto __1
 136336 	}
 136337 	return 1
 136338 __1:
 136339 	;
 136340 	if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_SELECT, uintptr(0), uintptr(0), uintptr(0)) != 0) {
 136341 		goto __2
 136342 	}
 136343 	return 1
 136344 __2:
 136345 	;
 136346 	if !(int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest) <= SRT_DistQueue) {
 136347 		goto __3
 136348 	}
 136349 
 136350 	if !((*Select)(unsafe.Pointer(p)).FpOrderBy != 0) {
 136351 		goto __4
 136352 	}
 136353 	Xsqlite3ParserAddCleanup(tls, pParse,
 136354 		*(*uintptr)(unsafe.Pointer(&struct {
 136355 			f func(*libc.TLS, uintptr, uintptr)
 136356 		}{Xsqlite3ExprListDelete})),
 136357 		(*Select)(unsafe.Pointer(p)).FpOrderBy)
 136358 
 136359 	(*Select)(unsafe.Pointer(p)).FpOrderBy = uintptr(0)
 136360 __4:
 136361 	;
 136362 	*(*U32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(libc.CplInt32(SF_Distinct))
 136363 	*(*U32)(unsafe.Pointer(p + 4)) |= U32(SF_NoopOrderBy)
 136364 __3:
 136365 	;
 136366 	Xsqlite3SelectPrep(tls, pParse, p, uintptr(0))
 136367 	if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
 136368 		goto __5
 136369 	}
 136370 	goto select_end
 136371 __5:
 136372 	;
 136373 	if !((*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_UFSrcCheck) != 0) {
 136374 		goto __6
 136375 	}
 136376 	p0 = (*Select)(unsafe.Pointer(p)).FpSrc + 8
 136377 	if !(sameSrcAlias(tls, p0, (*Select)(unsafe.Pointer(p)).FpSrc) != 0) {
 136378 		goto __7
 136379 	}
 136380 	Xsqlite3ErrorMsg(tls, pParse,
 136381 		ts+21093,
 136382 		libc.VaList(bp, func() uintptr {
 136383 			if (*SrcItem)(unsafe.Pointer(p0)).FzAlias != 0 {
 136384 				return (*SrcItem)(unsafe.Pointer(p0)).FzAlias
 136385 			}
 136386 			return (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(p0)).FpTab)).FzName
 136387 		}()))
 136388 	goto select_end
 136389 __7:
 136390 	;
 136391 	*(*U32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(libc.CplInt32(SF_UFSrcCheck))
 136392 __6:
 136393 	;
 136394 	if !(int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest) == SRT_Output) {
 136395 		goto __8
 136396 	}
 136397 	Xsqlite3GenerateColumnNames(tls, pParse, p)
 136398 __8:
 136399 	;
 136400 	if !(Xsqlite3WindowRewrite(tls, pParse, p) != 0) {
 136401 		goto __9
 136402 	}
 136403 
 136404 	goto select_end
 136405 __9:
 136406 	;
 136407 	pTabList = (*Select)(unsafe.Pointer(p)).FpSrc
 136408 	isAgg = libc.Bool32((*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Aggregate) != U32(0))
 136409 	libc.Xmemset(tls, bp+48, 0, uint64(unsafe.Sizeof(SortCtx{})))
 136410 	(*SortCtx)(unsafe.Pointer(bp + 48)).FpOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy
 136411 
 136412 	i = 0
 136413 __10:
 136414 	if !(!(int32((*Select)(unsafe.Pointer(p)).FpPrior) != 0) && i < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc) {
 136415 		goto __12
 136416 	}
 136417 	pItem = pTabList + 8 + uintptr(i)*104
 136418 	pSub = (*SrcItem)(unsafe.Pointer(pItem)).FpSelect
 136419 	pTab = (*SrcItem)(unsafe.Pointer(pItem)).FpTab
 136420 
 136421 	if !(int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&(JT_LEFT|JT_RIGHT) == JT_LEFT &&
 136422 		Xsqlite3ExprImpliesNonNullRow(tls, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcItem)(unsafe.Pointer(pItem)).FiCursor) != 0 &&
 136423 		(*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_SimplifyJoin) == U32(0)) {
 136424 		goto __13
 136425 	}
 136426 
 136427 	*(*U8)(unsafe.Pointer(pItem + 60)) &= libc.Uint8FromInt32(libc.CplInt32(JT_LEFT | JT_OUTER))
 136428 
 136429 	unsetJoinExpr(tls, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcItem)(unsafe.Pointer(pItem)).FiCursor,
 136430 		int32((*SrcItem)(unsafe.Pointer(pTabList+8)).Ffg.Fjointype)&JT_LTORJ)
 136431 __13:
 136432 	;
 136433 	if !(pSub == uintptr(0)) {
 136434 		goto __14
 136435 	}
 136436 	goto __11
 136437 __14:
 136438 	;
 136439 	if !(int32((*Table)(unsafe.Pointer(pTab)).FnCol) != (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub)).FpEList)).FnExpr) {
 136440 		goto __15
 136441 	}
 136442 	Xsqlite3ErrorMsg(tls, pParse, ts+21147,
 136443 		libc.VaList(bp+8, int32((*Table)(unsafe.Pointer(pTab)).FnCol), (*Table)(unsafe.Pointer(pTab)).FzName, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub)).FpEList)).FnExpr))
 136444 	goto select_end
 136445 __15:
 136446 	;
 136447 	if !((*Select)(unsafe.Pointer(pSub)).FselFlags&U32(SF_Aggregate) != U32(0)) {
 136448 		goto __16
 136449 	}
 136450 	goto __11
 136451 __16:
 136452 	;
 136453 	if !((*Select)(unsafe.Pointer(pSub)).FpOrderBy != uintptr(0) &&
 136454 		((*Select)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) || (*SrcList)(unsafe.Pointer(pTabList)).FnSrc > 1) &&
 136455 		(*Select)(unsafe.Pointer(pSub)).FpLimit == uintptr(0) &&
 136456 		(*Select)(unsafe.Pointer(pSub)).FselFlags&U32(SF_OrderByReqd) == U32(0) &&
 136457 		(*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_OrderByReqd) == U32(0) &&
 136458 		(*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_OmitOrderBy) == U32(0)) {
 136459 		goto __17
 136460 	}
 136461 
 136462 	Xsqlite3ParserAddCleanup(tls, pParse,
 136463 		*(*uintptr)(unsafe.Pointer(&struct {
 136464 			f func(*libc.TLS, uintptr, uintptr)
 136465 		}{Xsqlite3ExprListDelete})),
 136466 		(*Select)(unsafe.Pointer(pSub)).FpOrderBy)
 136467 	(*Select)(unsafe.Pointer(pSub)).FpOrderBy = uintptr(0)
 136468 __17:
 136469 	;
 136470 	if !((*Select)(unsafe.Pointer(pSub)).FpOrderBy != uintptr(0) &&
 136471 		i == 0 &&
 136472 		(*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_ComplexResult) != U32(0) &&
 136473 		((*SrcList)(unsafe.Pointer(pTabList)).FnSrc == 1 ||
 136474 			int32((*SrcItem)(unsafe.Pointer(pTabList+8+1*104)).Ffg.Fjointype)&(JT_OUTER|JT_CROSS) != 0)) {
 136475 		goto __18
 136476 	}
 136477 	goto __11
 136478 __18:
 136479 	;
 136480 	if !(flattenSubquery(tls, pParse, p, i, isAgg) != 0) {
 136481 		goto __19
 136482 	}
 136483 	if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
 136484 		goto __20
 136485 	}
 136486 	goto select_end
 136487 __20:
 136488 	;
 136489 	i = -1
 136490 __19:
 136491 	;
 136492 	pTabList = (*Select)(unsafe.Pointer(p)).FpSrc
 136493 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 136494 		goto __21
 136495 	}
 136496 	goto select_end
 136497 __21:
 136498 	;
 136499 	if !!(int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest) <= SRT_Fifo) {
 136500 		goto __22
 136501 	}
 136502 	(*SortCtx)(unsafe.Pointer(bp + 48)).FpOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy
 136503 __22:
 136504 	;
 136505 	goto __11
 136506 __11:
 136507 	i++
 136508 	goto __10
 136509 	goto __12
 136510 __12:
 136511 	;
 136512 	if !((*Select)(unsafe.Pointer(p)).FpPrior != 0) {
 136513 		goto __23
 136514 	}
 136515 	rc = multiSelect(tls, pParse, p, pDest)
 136516 	if !((*Select)(unsafe.Pointer(p)).FpNext == uintptr(0)) {
 136517 		goto __24
 136518 	}
 136519 	Xsqlite3VdbeExplainPop(tls, pParse)
 136520 __24:
 136521 	;
 136522 	return rc
 136523 __23:
 136524 	;
 136525 	if !((*Select)(unsafe.Pointer(p)).FpWhere != uintptr(0) &&
 136526 		int32((*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpWhere)).Fop) == TK_AND &&
 136527 		(*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_PropagateConst) == U32(0) &&
 136528 		propagateConstants(tls, pParse, p) != 0) {
 136529 		goto __25
 136530 	}
 136531 	goto __26
 136532 __25:
 136533 	;
 136534 __26:
 136535 	;
 136536 	i = 0
 136537 __27:
 136538 	if !(i < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc) {
 136539 		goto __29
 136540 	}
 136541 	pItem1 = pTabList + 8 + uintptr(i)*104
 136542 
 136543 	if !((*SrcItem)(unsafe.Pointer(pItem1)).FcolUsed == uint64(0) && (*SrcItem)(unsafe.Pointer(pItem1)).FzName != uintptr(0)) {
 136544 		goto __30
 136545 	}
 136546 	Xsqlite3AuthCheck(tls, pParse, SQLITE_READ, (*SrcItem)(unsafe.Pointer(pItem1)).FzName, ts+1544, (*SrcItem)(unsafe.Pointer(pItem1)).FzDatabase)
 136547 __30:
 136548 	;
 136549 	pSub1 = (*SrcItem)(unsafe.Pointer(pItem1)).FpSelect
 136550 	if !(pSub1 == uintptr(0)) {
 136551 		goto __31
 136552 	}
 136553 	goto __28
 136554 __31:
 136555 	;
 136556 	*(*int32)(unsafe.Pointer(pParse + 316)) += Xsqlite3SelectExprHeight(tls, p)
 136557 
 136558 	if !((*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_PushDown) == U32(0) &&
 136559 		(int32(*(*uint16)(unsafe.Pointer(pItem1 + 60 + 4))&0x100>>8) == 0 ||
 136560 			int32((*CteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 96)))).FeM10d) != M10d_Yes && (*CteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 96)))).FnUse < 2) &&
 136561 		pushDownWhereTerms(tls, pParse, pSub1, (*Select)(unsafe.Pointer(p)).FpWhere, pItem1) != 0) {
 136562 		goto __32
 136563 	}
 136564 
 136565 	goto __33
 136566 __32:
 136567 	;
 136568 __33:
 136569 	;
 136570 	zSavedAuthContext = (*Parse)(unsafe.Pointer(pParse)).FzAuthContext
 136571 	(*Parse)(unsafe.Pointer(pParse)).FzAuthContext = (*SrcItem)(unsafe.Pointer(pItem1)).FzName
 136572 
 136573 	if !(fromClauseTermCanBeCoroutine(tls, pParse, pTabList, i, int32((*Select)(unsafe.Pointer(p)).FselFlags)) != 0) {
 136574 		goto __34
 136575 	}
 136576 
 136577 	addrTop = Xsqlite3VdbeCurrentAddr(tls, v) + 1
 136578 
 136579 	(*SrcItem)(unsafe.Pointer(pItem1)).FregReturn = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 136580 	Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn, 0, addrTop)
 136581 
 136582 	(*SrcItem)(unsafe.Pointer(pItem1)).FaddrFillSub = addrTop
 136583 	Xsqlite3SelectDestInit(tls, bp+96, SRT_Coroutine, (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn)
 136584 	Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+21187, libc.VaList(bp+32, pItem1))
 136585 	Xsqlite3Select(tls, pParse, pSub1, bp+96)
 136586 	(*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem1)).FpTab)).FnRowLogEst = (*Select)(unsafe.Pointer(pSub1)).FnSelectRow
 136587 	libc.SetBitFieldPtr16Uint32(pItem1+60+4, uint32(1), 5, 0x20)
 136588 	(*SrcItem)(unsafe.Pointer(pItem1)).FregResult = (*SelectDest)(unsafe.Pointer(bp + 96)).FiSdst
 136589 	Xsqlite3VdbeEndCoroutine(tls, v, (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn)
 136590 	Xsqlite3VdbeJumpHere(tls, v, addrTop-1)
 136591 	Xsqlite3ClearTempRegCache(tls, pParse)
 136592 	goto __35
 136593 __34:
 136594 	if !(uint32(int32(*(*uint16)(unsafe.Pointer(pItem1 + 60 + 4))&0x100>>8)) != 0 && (*CteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 96)))).FaddrM9e > 0) {
 136595 		goto __36
 136596 	}
 136597 
 136598 	pCteUse = *(*uintptr)(unsafe.Pointer(pItem1 + 96))
 136599 	Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, (*CteUse)(unsafe.Pointer(pCteUse)).FregRtn, (*CteUse)(unsafe.Pointer(pCteUse)).FaddrM9e)
 136600 	if !((*SrcItem)(unsafe.Pointer(pItem1)).FiCursor != (*CteUse)(unsafe.Pointer(pCteUse)).FiCur) {
 136601 		goto __38
 136602 	}
 136603 	Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, (*SrcItem)(unsafe.Pointer(pItem1)).FiCursor, (*CteUse)(unsafe.Pointer(pCteUse)).FiCur)
 136604 
 136605 __38:
 136606 	;
 136607 	(*Select)(unsafe.Pointer(pSub1)).FnSelectRow = (*CteUse)(unsafe.Pointer(pCteUse)).FnRowEst
 136608 	goto __37
 136609 __36:
 136610 	if !(libc.AssignUintptr(&pPrior, isSelfJoinView(tls, pTabList, pItem1, 0, i)) != uintptr(0)) {
 136611 		goto __39
 136612 	}
 136613 
 136614 	if !((*SrcItem)(unsafe.Pointer(pPrior)).FaddrFillSub != 0) {
 136615 		goto __41
 136616 	}
 136617 	Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, (*SrcItem)(unsafe.Pointer(pPrior)).FregReturn, (*SrcItem)(unsafe.Pointer(pPrior)).FaddrFillSub)
 136618 __41:
 136619 	;
 136620 	Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, (*SrcItem)(unsafe.Pointer(pItem1)).FiCursor, (*SrcItem)(unsafe.Pointer(pPrior)).FiCursor)
 136621 	(*Select)(unsafe.Pointer(pSub1)).FnSelectRow = (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pPrior)).FpSelect)).FnSelectRow
 136622 	goto __40
 136623 __39:
 136624 	onceAddr = 0
 136625 
 136626 	(*SrcItem)(unsafe.Pointer(pItem1)).FregReturn = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 136627 	topAddr = Xsqlite3VdbeAddOp0(tls, v, OP_Goto)
 136628 	(*SrcItem)(unsafe.Pointer(pItem1)).FaddrFillSub = topAddr + 1
 136629 	libc.SetBitFieldPtr16Uint32(pItem1+60+4, uint32(1), 4, 0x10)
 136630 	if !(int32(*(*uint16)(unsafe.Pointer(pItem1 + 60 + 4))&0x8>>3) == 0) {
 136631 		goto __42
 136632 	}
 136633 
 136634 	onceAddr = Xsqlite3VdbeAddOp0(tls, v, OP_Once)
 136635 
 136636 	goto __43
 136637 __42:
 136638 	;
 136639 __43:
 136640 	;
 136641 	Xsqlite3SelectDestInit(tls, bp+96, SRT_EphemTab, (*SrcItem)(unsafe.Pointer(pItem1)).FiCursor)
 136642 
 136643 	Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+21202, libc.VaList(bp+40, pItem1))
 136644 	Xsqlite3Select(tls, pParse, pSub1, bp+96)
 136645 	(*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem1)).FpTab)).FnRowLogEst = (*Select)(unsafe.Pointer(pSub1)).FnSelectRow
 136646 	if !(onceAddr != 0) {
 136647 		goto __44
 136648 	}
 136649 	Xsqlite3VdbeJumpHere(tls, v, onceAddr)
 136650 __44:
 136651 	;
 136652 	Xsqlite3VdbeAddOp2(tls, v, OP_Return, (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn, topAddr+1)
 136653 
 136654 	Xsqlite3VdbeJumpHere(tls, v, topAddr)
 136655 	Xsqlite3ClearTempRegCache(tls, pParse)
 136656 	if !(uint32(int32(*(*uint16)(unsafe.Pointer(pItem1 + 60 + 4))&0x100>>8)) != 0 && int32(*(*uint16)(unsafe.Pointer(pItem1 + 60 + 4))&0x8>>3) == 0) {
 136657 		goto __45
 136658 	}
 136659 	pCteUse1 = *(*uintptr)(unsafe.Pointer(pItem1 + 96))
 136660 	(*CteUse)(unsafe.Pointer(pCteUse1)).FaddrM9e = (*SrcItem)(unsafe.Pointer(pItem1)).FaddrFillSub
 136661 	(*CteUse)(unsafe.Pointer(pCteUse1)).FregRtn = (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn
 136662 	(*CteUse)(unsafe.Pointer(pCteUse1)).FiCur = (*SrcItem)(unsafe.Pointer(pItem1)).FiCursor
 136663 	(*CteUse)(unsafe.Pointer(pCteUse1)).FnRowEst = (*Select)(unsafe.Pointer(pSub1)).FnSelectRow
 136664 __45:
 136665 	;
 136666 __40:
 136667 	;
 136668 __37:
 136669 	;
 136670 __35:
 136671 	;
 136672 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 136673 		goto __46
 136674 	}
 136675 	goto select_end
 136676 __46:
 136677 	;
 136678 	*(*int32)(unsafe.Pointer(pParse + 316)) -= Xsqlite3SelectExprHeight(tls, p)
 136679 	(*Parse)(unsafe.Pointer(pParse)).FzAuthContext = zSavedAuthContext
 136680 	goto __28
 136681 __28:
 136682 	i++
 136683 	goto __27
 136684 	goto __29
 136685 __29:
 136686 	;
 136687 	pEList = (*Select)(unsafe.Pointer(p)).FpEList
 136688 	pWhere = (*Select)(unsafe.Pointer(p)).FpWhere
 136689 	pGroupBy = (*Select)(unsafe.Pointer(p)).FpGroupBy
 136690 	pHaving = (*Select)(unsafe.Pointer(p)).FpHaving
 136691 	(*DistinctCtx)(unsafe.Pointer(bp + 136)).FisTnct = U8(libc.Bool32((*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Distinct) != U32(0)))
 136692 
 136693 	if !((*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Distinct|SF_Aggregate) == U32(SF_Distinct) &&
 136694 		Xsqlite3ExprListCompare(tls, (*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy, pEList, -1) == 0 &&
 136695 		(*Select)(unsafe.Pointer(p)).FpWin == uintptr(0)) {
 136696 		goto __47
 136697 	}
 136698 	*(*U32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(libc.CplInt32(SF_Distinct))
 136699 	pGroupBy = libc.AssignPtrUintptr(p+56, Xsqlite3ExprListDup(tls, db, pEList, 0))
 136700 	*(*U32)(unsafe.Pointer(p + 4)) |= U32(SF_Aggregate)
 136701 
 136702 	(*DistinctCtx)(unsafe.Pointer(bp + 136)).FisTnct = U8(2)
 136703 
 136704 __47:
 136705 	;
 136706 	if !((*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy != 0) {
 136707 		goto __48
 136708 	}
 136709 	pKeyInfo = Xsqlite3KeyInfoFromExprList(tls,
 136710 		pParse, (*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy, 0, (*ExprList)(unsafe.Pointer(pEList)).FnExpr)
 136711 	(*SortCtx)(unsafe.Pointer(bp + 48)).FiECursor = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 136712 	(*SortCtx)(unsafe.Pointer(bp + 48)).FaddrSortIndex = Xsqlite3VdbeAddOp4(tls, v, OP_OpenEphemeral,
 136713 		(*SortCtx)(unsafe.Pointer(bp+48)).FiECursor, (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy)).FnExpr+1+(*ExprList)(unsafe.Pointer(pEList)).FnExpr, 0,
 136714 		pKeyInfo, -8)
 136715 	goto __49
 136716 __48:
 136717 	(*SortCtx)(unsafe.Pointer(bp + 48)).FaddrSortIndex = -1
 136718 __49:
 136719 	;
 136720 	if !(int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest) == SRT_EphemTab) {
 136721 		goto __50
 136722 	}
 136723 	Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm, (*ExprList)(unsafe.Pointer(pEList)).FnExpr)
 136724 	if !((*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_NestedFrom) != 0) {
 136725 		goto __51
 136726 	}
 136727 	ii = (*ExprList)(unsafe.Pointer(pEList)).FnExpr - 1
 136728 __52:
 136729 	if !(ii > 0 && int32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(ii)*32 + 16 + 4))&0x40>>6) == 0) {
 136730 		goto __54
 136731 	}
 136732 	Xsqlite3ExprDelete(tls, db, (*ExprList_item)(unsafe.Pointer(pEList+8+uintptr(ii)*32)).FpExpr)
 136733 	Xsqlite3DbFree(tls, db, (*ExprList_item)(unsafe.Pointer(pEList+8+uintptr(ii)*32)).FzEName)
 136734 	(*ExprList)(unsafe.Pointer(pEList)).FnExpr--
 136735 	goto __53
 136736 __53:
 136737 	ii--
 136738 	goto __52
 136739 	goto __54
 136740 __54:
 136741 	;
 136742 	ii = 0
 136743 __55:
 136744 	if !(ii < (*ExprList)(unsafe.Pointer(pEList)).FnExpr) {
 136745 		goto __57
 136746 	}
 136747 	if !(int32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(ii)*32 + 16 + 4))&0x40>>6) == 0) {
 136748 		goto __58
 136749 	}
 136750 	(*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(ii)*32)).FpExpr)).Fop = U8(TK_NULL)
 136751 __58:
 136752 	;
 136753 	goto __56
 136754 __56:
 136755 	ii++
 136756 	goto __55
 136757 	goto __57
 136758 __57:
 136759 	;
 136760 __51:
 136761 	;
 136762 __50:
 136763 	;
 136764 	iEnd = Xsqlite3VdbeMakeLabel(tls, pParse)
 136765 	if !((*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_FixedLimit) == U32(0)) {
 136766 		goto __59
 136767 	}
 136768 	(*Select)(unsafe.Pointer(p)).FnSelectRow = int16(320)
 136769 __59:
 136770 	;
 136771 	if !((*Select)(unsafe.Pointer(p)).FpLimit != 0) {
 136772 		goto __60
 136773 	}
 136774 	computeLimitRegisters(tls, pParse, p, iEnd)
 136775 __60:
 136776 	;
 136777 	if !((*Select)(unsafe.Pointer(p)).FiLimit == 0 && (*SortCtx)(unsafe.Pointer(bp+48)).FaddrSortIndex >= 0) {
 136778 		goto __61
 136779 	}
 136780 	Xsqlite3VdbeChangeOpcode(tls, v, (*SortCtx)(unsafe.Pointer(bp+48)).FaddrSortIndex, uint8(OP_SorterOpen))
 136781 	*(*U8)(unsafe.Pointer(bp + 48 + 36)) |= U8(SORTFLAG_UseSorter)
 136782 __61:
 136783 	;
 136784 	if !((*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Distinct) != 0) {
 136785 		goto __62
 136786 	}
 136787 	(*DistinctCtx)(unsafe.Pointer(bp + 136)).FtabTnct = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 136788 	(*DistinctCtx)(unsafe.Pointer(bp + 136)).FaddrTnct = Xsqlite3VdbeAddOp4(tls, v, OP_OpenEphemeral,
 136789 		(*DistinctCtx)(unsafe.Pointer(bp+136)).FtabTnct, 0, 0,
 136790 		Xsqlite3KeyInfoFromExprList(tls, pParse, (*Select)(unsafe.Pointer(p)).FpEList, 0, 0),
 136791 		-8)
 136792 	Xsqlite3VdbeChangeP5(tls, v, uint16(BTREE_UNORDERED))
 136793 	(*DistinctCtx)(unsafe.Pointer(bp + 136)).FeTnctType = U8(WHERE_DISTINCT_UNORDERED)
 136794 	goto __63
 136795 __62:
 136796 	(*DistinctCtx)(unsafe.Pointer(bp + 136)).FeTnctType = U8(WHERE_DISTINCT_NOOP)
 136797 __63:
 136798 	;
 136799 	if !(!(isAgg != 0) && pGroupBy == uintptr(0)) {
 136800 		goto __64
 136801 	}
 136802 
 136803 	wctrlFlags = U16(func() uint32 {
 136804 		if (*DistinctCtx)(unsafe.Pointer(bp+136)).FisTnct != 0 {
 136805 			return uint32(WHERE_WANT_DISTINCT)
 136806 		}
 136807 		return uint32(0)
 136808 	}() |
 136809 		(*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_FixedLimit))
 136810 	pWin = (*Select)(unsafe.Pointer(p)).FpWin
 136811 	if !(pWin != 0) {
 136812 		goto __66
 136813 	}
 136814 	Xsqlite3WindowCodeInit(tls, pParse, p)
 136815 __66:
 136816 	;
 136817 	pWInfo = Xsqlite3WhereBegin(tls, pParse, pTabList, pWhere, (*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy,
 136818 		(*Select)(unsafe.Pointer(p)).FpEList, p, wctrlFlags, int32((*Select)(unsafe.Pointer(p)).FnSelectRow))
 136819 	if !(pWInfo == uintptr(0)) {
 136820 		goto __67
 136821 	}
 136822 	goto select_end
 136823 __67:
 136824 	;
 136825 	if !(int32(Xsqlite3WhereOutputRowCount(tls, pWInfo)) < int32((*Select)(unsafe.Pointer(p)).FnSelectRow)) {
 136826 		goto __68
 136827 	}
 136828 	(*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3WhereOutputRowCount(tls, pWInfo)
 136829 __68:
 136830 	;
 136831 	if !((*DistinctCtx)(unsafe.Pointer(bp+136)).FisTnct != 0 && Xsqlite3WhereIsDistinct(tls, pWInfo) != 0) {
 136832 		goto __69
 136833 	}
 136834 	(*DistinctCtx)(unsafe.Pointer(bp + 136)).FeTnctType = U8(Xsqlite3WhereIsDistinct(tls, pWInfo))
 136835 __69:
 136836 	;
 136837 	if !((*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy != 0) {
 136838 		goto __70
 136839 	}
 136840 	(*SortCtx)(unsafe.Pointer(bp + 48)).FnOBSat = Xsqlite3WhereIsOrdered(tls, pWInfo)
 136841 	(*SortCtx)(unsafe.Pointer(bp + 48)).FlabelOBLopt = Xsqlite3WhereOrderByLimitOptLabel(tls, pWInfo)
 136842 	if !((*SortCtx)(unsafe.Pointer(bp+48)).FnOBSat == (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy)).FnExpr) {
 136843 		goto __71
 136844 	}
 136845 	(*SortCtx)(unsafe.Pointer(bp + 48)).FpOrderBy = uintptr(0)
 136846 __71:
 136847 	;
 136848 __70:
 136849 	;
 136850 	if !((*SortCtx)(unsafe.Pointer(bp+48)).FaddrSortIndex >= 0 && (*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy == uintptr(0)) {
 136851 		goto __72
 136852 	}
 136853 	Xsqlite3VdbeChangeToNoop(tls, v, (*SortCtx)(unsafe.Pointer(bp+48)).FaddrSortIndex)
 136854 __72:
 136855 	;
 136856 	if !(pWin != 0) {
 136857 		goto __73
 136858 	}
 136859 	addrGosub = Xsqlite3VdbeMakeLabel(tls, pParse)
 136860 	iCont = Xsqlite3VdbeMakeLabel(tls, pParse)
 136861 	iBreak = Xsqlite3VdbeMakeLabel(tls, pParse)
 136862 	regGosub = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 136863 
 136864 	Xsqlite3WindowCodeStep(tls, pParse, p, pWInfo, regGosub, addrGosub)
 136865 
 136866 	Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, iBreak)
 136867 	Xsqlite3VdbeResolveLabel(tls, v, addrGosub)
 136868 
 136869 	(*SortCtx)(unsafe.Pointer(bp + 48)).FlabelOBLopt = 0
 136870 	selectInnerLoop(tls, pParse, p, -1, bp+48, bp+136, pDest, iCont, iBreak)
 136871 	Xsqlite3VdbeResolveLabel(tls, v, iCont)
 136872 	Xsqlite3VdbeAddOp1(tls, v, OP_Return, regGosub)
 136873 
 136874 	Xsqlite3VdbeResolveLabel(tls, v, iBreak)
 136875 	goto __74
 136876 __73:
 136877 	selectInnerLoop(tls, pParse, p, -1, bp+48, bp+136, pDest,
 136878 		Xsqlite3WhereContinueLabel(tls, pWInfo),
 136879 		Xsqlite3WhereBreakLabel(tls, pWInfo))
 136880 
 136881 	Xsqlite3WhereEnd(tls, pWInfo)
 136882 __74:
 136883 	;
 136884 	goto __65
 136885 __64:
 136886 	sortPTab = 0
 136887 	sortOut = 0
 136888 	orderByGrp = 0
 136889 
 136890 	if !(pGroupBy != 0) {
 136891 		goto __75
 136892 	}
 136893 
 136894 	k = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr
 136895 	pItem2 = (*Select)(unsafe.Pointer(p)).FpEList + 8
 136896 __77:
 136897 	if !(k > 0) {
 136898 		goto __79
 136899 	}
 136900 	*(*U16)(unsafe.Pointer(pItem2 + 24 + 2)) = U16(0)
 136901 	goto __78
 136902 __78:
 136903 	k--
 136904 	pItem2 += 32
 136905 	goto __77
 136906 	goto __79
 136907 __79:
 136908 	;
 136909 	k = (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr
 136910 	pItem2 = pGroupBy + 8
 136911 __80:
 136912 	if !(k > 0) {
 136913 		goto __82
 136914 	}
 136915 	*(*U16)(unsafe.Pointer(pItem2 + 24 + 2)) = U16(0)
 136916 	goto __81
 136917 __81:
 136918 	k--
 136919 	pItem2 += 32
 136920 	goto __80
 136921 	goto __82
 136922 __82:
 136923 	;
 136924 	if !(int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > 66) {
 136925 		goto __83
 136926 	}
 136927 	(*Select)(unsafe.Pointer(p)).FnSelectRow = int16(66)
 136928 __83:
 136929 	;
 136930 	if !((*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy != 0 && (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr == (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy)).FnExpr) {
 136931 		goto __84
 136932 	}
 136933 
 136934 	ii1 = 0
 136935 __85:
 136936 	if !(ii1 < (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr) {
 136937 		goto __87
 136938 	}
 136939 	sortFlags = U8(int32((*ExprList_item)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy+8+uintptr(ii1)*32)).Ffg.FsortFlags) & KEYINFO_ORDER_DESC)
 136940 	(*ExprList_item)(unsafe.Pointer(pGroupBy + 8 + uintptr(ii1)*32)).Ffg.FsortFlags = sortFlags
 136941 	goto __86
 136942 __86:
 136943 	ii1++
 136944 	goto __85
 136945 	goto __87
 136946 __87:
 136947 	;
 136948 	if !(Xsqlite3ExprListCompare(tls, pGroupBy, (*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy, -1) == 0) {
 136949 		goto __88
 136950 	}
 136951 	orderByGrp = 1
 136952 __88:
 136953 	;
 136954 __84:
 136955 	;
 136956 	goto __76
 136957 __75:
 136958 	;
 136959 	(*Select)(unsafe.Pointer(p)).FnSelectRow = int16(0)
 136960 __76:
 136961 	;
 136962 	addrEnd = Xsqlite3VdbeMakeLabel(tls, pParse)
 136963 
 136964 	pAggInfo = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(AggInfo{})))
 136965 	if !(pAggInfo != 0) {
 136966 		goto __89
 136967 	}
 136968 	Xsqlite3ParserAddCleanup(tls, pParse,
 136969 		*(*uintptr)(unsafe.Pointer(&struct {
 136970 			f func(*libc.TLS, uintptr, uintptr)
 136971 		}{agginfoFree})), pAggInfo)
 136972 
 136973 __89:
 136974 	;
 136975 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 136976 		goto __90
 136977 	}
 136978 	goto select_end
 136979 __90:
 136980 	;
 136981 	(*AggInfo)(unsafe.Pointer(pAggInfo)).FselId = (*Select)(unsafe.Pointer(p)).FselId
 136982 	libc.Xmemset(tls, bp+152, 0, uint64(unsafe.Sizeof(NameContext{})))
 136983 	(*NameContext)(unsafe.Pointer(bp + 152)).FpParse = pParse
 136984 	(*NameContext)(unsafe.Pointer(bp + 152)).FpSrcList = pTabList
 136985 	*(*uintptr)(unsafe.Pointer(bp + 152 + 16)) = pAggInfo
 136986 
 136987 	(*AggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = func() uint16 {
 136988 		if pGroupBy != 0 {
 136989 			return uint16((*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr)
 136990 		}
 136991 		return uint16(0)
 136992 	}()
 136993 	(*AggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy
 136994 	Xsqlite3ExprAnalyzeAggList(tls, bp+152, pEList)
 136995 	Xsqlite3ExprAnalyzeAggList(tls, bp+152, (*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy)
 136996 	if !(pHaving != 0) {
 136997 		goto __91
 136998 	}
 136999 	if !(pGroupBy != 0) {
 137000 		goto __92
 137001 	}
 137002 
 137003 	havingToWhere(tls, pParse, p)
 137004 	pWhere = (*Select)(unsafe.Pointer(p)).FpWhere
 137005 __92:
 137006 	;
 137007 	Xsqlite3ExprAnalyzeAggregates(tls, bp+152, pHaving)
 137008 __91:
 137009 	;
 137010 	(*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator = (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn
 137011 	if !((*Select)(unsafe.Pointer(p)).FpGroupBy == uintptr(0) && (*Select)(unsafe.Pointer(p)).FpHaving == uintptr(0) && (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == 1) {
 137012 		goto __93
 137013 	}
 137014 	minMaxFlag = minMaxQuery(tls, db, (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFExpr, bp+208)
 137015 	goto __94
 137016 __93:
 137017 	minMaxFlag = U8(WHERE_ORDERBY_NORMAL)
 137018 __94:
 137019 	;
 137020 	analyzeAggFuncArgs(tls, pAggInfo, bp+152)
 137021 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 137022 		goto __95
 137023 	}
 137024 	goto select_end
 137025 __95:
 137026 	;
 137027 	if !(pGroupBy != 0) {
 137028 		goto __96
 137029 	}
 137030 	pDistinct = uintptr(0)
 137031 	distFlag = U16(0)
 137032 	eDist = WHERE_DISTINCT_NOOP
 137033 
 137034 	if !((*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == 1 &&
 137035 		(*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FiDistinct >= 0 &&
 137036 		(*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFExpr != uintptr(0) &&
 137037 		(*Expr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFExpr)).Fflags&U32(EP_xIsSelect) == U32(0) &&
 137038 		*(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFExpr + 32)) != uintptr(0)) {
 137039 		goto __98
 137040 	}
 137041 	pExpr = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFExpr + 32)) + 8)).FpExpr
 137042 	pExpr = Xsqlite3ExprDup(tls, db, pExpr, 0)
 137043 	pDistinct = Xsqlite3ExprListDup(tls, db, pGroupBy, 0)
 137044 	pDistinct = Xsqlite3ExprListAppend(tls, pParse, pDistinct, pExpr)
 137045 	if pDistinct != 0 {
 137046 		distFlag = uint16(WHERE_WANT_DISTINCT | WHERE_AGG_DISTINCT)
 137047 	} else {
 137048 		distFlag = uint16(0)
 137049 	}
 137050 __98:
 137051 	;
 137052 	(*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 137053 	pKeyInfo1 = Xsqlite3KeyInfoFromExprList(tls, pParse, pGroupBy,
 137054 		0, (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn)
 137055 	addrSortingIdx = Xsqlite3VdbeAddOp4(tls, v, OP_SorterOpen,
 137056 		(*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, int32((*AggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn),
 137057 		0, pKeyInfo1, -8)
 137058 
 137059 	iUseFlag = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 137060 	iAbortFlag = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 137061 	regOutputRow = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 137062 	addrOutputRow = Xsqlite3VdbeMakeLabel(tls, pParse)
 137063 	regReset = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 137064 	addrReset = Xsqlite3VdbeMakeLabel(tls, pParse)
 137065 	iAMem = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 137066 	*(*int32)(unsafe.Pointer(pParse + 56)) += (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr
 137067 	iBMem = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 137068 	*(*int32)(unsafe.Pointer(pParse + 56)) += (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr
 137069 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, iAbortFlag)
 137070 
 137071 	Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, iAMem, iAMem+(*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr-1)
 137072 
 137073 	Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, regReset, addrReset)
 137074 
 137075 	pWInfo = Xsqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct,
 137076 		p, uint16(func() int32 {
 137077 			if int32((*DistinctCtx)(unsafe.Pointer(bp+136)).FisTnct) == 2 {
 137078 				return WHERE_DISTINCTBY
 137079 			}
 137080 			return WHERE_GROUPBY
 137081 		}()|
 137082 			func() int32 {
 137083 				if orderByGrp != 0 {
 137084 					return WHERE_SORTBYGROUP
 137085 				}
 137086 				return 0
 137087 			}()|int32(distFlag)), 0)
 137088 	if !(pWInfo == uintptr(0)) {
 137089 		goto __99
 137090 	}
 137091 	Xsqlite3ExprListDelete(tls, db, pDistinct)
 137092 	goto select_end
 137093 __99:
 137094 	;
 137095 	if !((*Parse)(unsafe.Pointer(pParse)).FpIdxEpr != 0) {
 137096 		goto __100
 137097 	}
 137098 	optimizeAggregateUseOfIndexedExpr(tls, pParse, p, pAggInfo, bp+152)
 137099 __100:
 137100 	;
 137101 	assignAggregateRegisters(tls, pParse, pAggInfo)
 137102 	eDist = Xsqlite3WhereIsDistinct(tls, pWInfo)
 137103 
 137104 	if !(Xsqlite3WhereIsOrdered(tls, pWInfo) == (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr) {
 137105 		goto __101
 137106 	}
 137107 
 137108 	groupBySort = 0
 137109 	goto __102
 137110 __101:
 137111 	explainTempTable(tls, pParse,
 137112 		func() uintptr {
 137113 			if (*DistinctCtx)(unsafe.Pointer(bp+136)).FisTnct != 0 && (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Distinct) == U32(0) {
 137114 				return ts + 21218
 137115 			}
 137116 			return ts + 21227
 137117 		}())
 137118 
 137119 	groupBySort = 1
 137120 	nGroupBy = (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr
 137121 	nCol = nGroupBy
 137122 	j = nGroupBy
 137123 	i = 0
 137124 __103:
 137125 	if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) {
 137126 		goto __105
 137127 	}
 137128 	if !(int32((*AggInfo_col)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol+uintptr(i)*24)).FiSorterColumn) >= j) {
 137129 		goto __106
 137130 	}
 137131 	nCol++
 137132 	j++
 137133 __106:
 137134 	;
 137135 	goto __104
 137136 __104:
 137137 	i++
 137138 	goto __103
 137139 	goto __105
 137140 __105:
 137141 	;
 137142 	regBase = Xsqlite3GetTempRange(tls, pParse, nCol)
 137143 	Xsqlite3ExprCodeExprList(tls, pParse, pGroupBy, regBase, 0, uint8(0))
 137144 	j = nGroupBy
 137145 	(*AggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = U8(1)
 137146 	i = 0
 137147 __107:
 137148 	if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) {
 137149 		goto __109
 137150 	}
 137151 	pCol = (*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*24
 137152 	if !(int32((*AggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) >= j) {
 137153 		goto __110
 137154 	}
 137155 	Xsqlite3ExprCode(tls, pParse, (*AggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase)
 137156 	j++
 137157 __110:
 137158 	;
 137159 	goto __108
 137160 __108:
 137161 	i++
 137162 	goto __107
 137163 	goto __109
 137164 __109:
 137165 	;
 137166 	(*AggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = U8(0)
 137167 	regRecord = Xsqlite3GetTempReg(tls, pParse)
 137168 	Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regBase, nCol, regRecord)
 137169 	Xsqlite3VdbeAddOp2(tls, v, OP_SorterInsert, (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, regRecord)
 137170 	Xsqlite3ReleaseTempReg(tls, pParse, regRecord)
 137171 	Xsqlite3ReleaseTempRange(tls, pParse, regBase, nCol)
 137172 
 137173 	Xsqlite3WhereEnd(tls, pWInfo)
 137174 	(*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = libc.AssignInt32(&sortPTab, libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1))
 137175 	sortOut = Xsqlite3GetTempReg(tls, pParse)
 137176 	Xsqlite3VdbeAddOp3(tls, v, OP_OpenPseudo, sortPTab, sortOut, nCol)
 137177 	Xsqlite3VdbeAddOp2(tls, v, OP_SorterSort, (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrEnd)
 137178 
 137179 	(*AggInfo)(unsafe.Pointer(pAggInfo)).FuseSortingIdx = U8(1)
 137180 __102:
 137181 	;
 137182 	if !((*Parse)(unsafe.Pointer(pParse)).FpIdxEpr != 0) {
 137183 		goto __111
 137184 	}
 137185 	aggregateConvertIndexedExprRefToColumn(tls, pAggInfo)
 137186 __111:
 137187 	;
 137188 	if !(orderByGrp != 0 && (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_GroupByOrder) == U32(0) &&
 137189 		(groupBySort != 0 || Xsqlite3WhereIsSorted(tls, pWInfo) != 0)) {
 137190 		goto __112
 137191 	}
 137192 	(*SortCtx)(unsafe.Pointer(bp + 48)).FpOrderBy = uintptr(0)
 137193 	Xsqlite3VdbeChangeToNoop(tls, v, (*SortCtx)(unsafe.Pointer(bp+48)).FaddrSortIndex)
 137194 __112:
 137195 	;
 137196 	addrTopOfLoop = Xsqlite3VdbeCurrentAddr(tls, v)
 137197 	if !(groupBySort != 0) {
 137198 		goto __113
 137199 	}
 137200 	Xsqlite3VdbeAddOp3(tls, v, OP_SorterData, (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx,
 137201 		sortOut, sortPTab)
 137202 __113:
 137203 	;
 137204 	j = 0
 137205 __114:
 137206 	if !(j < (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr) {
 137207 		goto __116
 137208 	}
 137209 	if !(groupBySort != 0) {
 137210 		goto __117
 137211 	}
 137212 	Xsqlite3VdbeAddOp3(tls, v, OP_Column, sortPTab, j, iBMem+j)
 137213 	goto __118
 137214 __117:
 137215 	(*AggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = U8(1)
 137216 	Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(pGroupBy+8+uintptr(j)*32)).FpExpr, iBMem+j)
 137217 __118:
 137218 	;
 137219 	goto __115
 137220 __115:
 137221 	j++
 137222 	goto __114
 137223 	goto __116
 137224 __116:
 137225 	;
 137226 	Xsqlite3VdbeAddOp4(tls, v, OP_Compare, iAMem, iBMem, (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr,
 137227 		Xsqlite3KeyInfoRef(tls, pKeyInfo1), -8)
 137228 	addr1 = Xsqlite3VdbeCurrentAddr(tls, v)
 137229 	Xsqlite3VdbeAddOp3(tls, v, OP_Jump, addr1+1, 0, addr1+1)
 137230 
 137231 	Xsqlite3ExprCodeMove(tls, pParse, iBMem, iAMem, (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr)
 137232 	Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, regOutputRow, addrOutputRow)
 137233 
 137234 	Xsqlite3VdbeAddOp2(tls, v, OP_IfPos, iAbortFlag, addrEnd)
 137235 
 137236 	Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, regReset, addrReset)
 137237 
 137238 	Xsqlite3VdbeJumpHere(tls, v, addr1)
 137239 	updateAccumulator(tls, pParse, iUseFlag, pAggInfo, eDist)
 137240 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, iUseFlag)
 137241 
 137242 	if !(groupBySort != 0) {
 137243 		goto __119
 137244 	}
 137245 	Xsqlite3VdbeAddOp2(tls, v, OP_SorterNext, (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrTopOfLoop)
 137246 
 137247 	goto __120
 137248 __119:
 137249 	;
 137250 	Xsqlite3WhereEnd(tls, pWInfo)
 137251 	Xsqlite3VdbeChangeToNoop(tls, v, addrSortingIdx)
 137252 __120:
 137253 	;
 137254 	Xsqlite3ExprListDelete(tls, db, pDistinct)
 137255 
 137256 	Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, regOutputRow, addrOutputRow)
 137257 
 137258 	Xsqlite3VdbeGoto(tls, v, addrEnd)
 137259 
 137260 	addrSetAbort = Xsqlite3VdbeCurrentAddr(tls, v)
 137261 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, iAbortFlag)
 137262 
 137263 	Xsqlite3VdbeAddOp1(tls, v, OP_Return, regOutputRow)
 137264 	Xsqlite3VdbeResolveLabel(tls, v, addrOutputRow)
 137265 	addrOutputRow = Xsqlite3VdbeCurrentAddr(tls, v)
 137266 	Xsqlite3VdbeAddOp2(tls, v, OP_IfPos, iUseFlag, addrOutputRow+2)
 137267 
 137268 	Xsqlite3VdbeAddOp1(tls, v, OP_Return, regOutputRow)
 137269 	finalizeAggFunctions(tls, pParse, pAggInfo)
 137270 	Xsqlite3ExprIfFalse(tls, pParse, pHaving, addrOutputRow+1, SQLITE_JUMPIFNULL)
 137271 	selectInnerLoop(tls, pParse, p, -1, bp+48,
 137272 		bp+136, pDest,
 137273 		addrOutputRow+1, addrSetAbort)
 137274 	Xsqlite3VdbeAddOp1(tls, v, OP_Return, regOutputRow)
 137275 
 137276 	Xsqlite3VdbeResolveLabel(tls, v, addrReset)
 137277 	resetAccumulator(tls, pParse, pAggInfo)
 137278 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, iUseFlag)
 137279 
 137280 	Xsqlite3VdbeAddOp1(tls, v, OP_Return, regReset)
 137281 
 137282 	if !(int32(distFlag) != 0 && eDist != WHERE_DISTINCT_NOOP) {
 137283 		goto __121
 137284 	}
 137285 	pF = (*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc
 137286 	fixDistinctOpenEph(tls, pParse, eDist, (*AggInfo_func)(unsafe.Pointer(pF)).FiDistinct, (*AggInfo_func)(unsafe.Pointer(pF)).FiDistAddr)
 137287 __121:
 137288 	;
 137289 	goto __97
 137290 __96:
 137291 	if !(libc.AssignUintptr(&pTab1, isSimpleCount(tls, p, pAggInfo)) != uintptr(0)) {
 137292 		goto __122
 137293 	}
 137294 
 137295 	iDb = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Table)(unsafe.Pointer(pTab1)).FpSchema)
 137296 	iCsr = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 137297 	pKeyInfo2 = uintptr(0)
 137298 	pBest = uintptr(0)
 137299 	iRoot = (*Table)(unsafe.Pointer(pTab1)).Ftnum
 137300 
 137301 	Xsqlite3CodeVerifySchema(tls, pParse, iDb)
 137302 	Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab1)).Ftnum, uint8(0), (*Table)(unsafe.Pointer(pTab1)).FzName)
 137303 
 137304 	if !!((*Table)(unsafe.Pointer(pTab1)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 137305 		goto __124
 137306 	}
 137307 	pBest = Xsqlite3PrimaryKeyIndex(tls, pTab1)
 137308 __124:
 137309 	;
 137310 	if !!(int32(*(*uint16)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc + 8 + 60 + 4))&0x1>>0) != 0) {
 137311 		goto __125
 137312 	}
 137313 	pIdx = (*Table)(unsafe.Pointer(pTab1)).FpIndex
 137314 __126:
 137315 	if !(pIdx != 0) {
 137316 		goto __128
 137317 	}
 137318 	if !(int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x4>>2) == 0 &&
 137319 		int32((*Index)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*Table)(unsafe.Pointer(pTab1)).FszTabRow) &&
 137320 		(*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) &&
 137321 		(!(pBest != 0) || int32((*Index)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*Index)(unsafe.Pointer(pBest)).FszIdxRow))) {
 137322 		goto __129
 137323 	}
 137324 	pBest = pIdx
 137325 __129:
 137326 	;
 137327 	goto __127
 137328 __127:
 137329 	pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
 137330 	goto __126
 137331 	goto __128
 137332 __128:
 137333 	;
 137334 __125:
 137335 	;
 137336 	if !(pBest != 0) {
 137337 		goto __130
 137338 	}
 137339 	iRoot = (*Index)(unsafe.Pointer(pBest)).Ftnum
 137340 	pKeyInfo2 = Xsqlite3KeyInfoOfIndex(tls, pParse, pBest)
 137341 __130:
 137342 	;
 137343 	Xsqlite3VdbeAddOp4Int(tls, v, OP_OpenRead, iCsr, int32(iRoot), iDb, 1)
 137344 	if !(pKeyInfo2 != 0) {
 137345 		goto __131
 137346 	}
 137347 	Xsqlite3VdbeChangeP4(tls, v, -1, pKeyInfo2, -8)
 137348 __131:
 137349 	;
 137350 	assignAggregateRegisters(tls, pParse, pAggInfo)
 137351 	Xsqlite3VdbeAddOp2(tls, v, OP_Count, iCsr, func() int32 {
 137352 		return (*AggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg + (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + 0
 137353 	}())
 137354 	Xsqlite3VdbeAddOp1(tls, v, OP_Close, iCsr)
 137355 	explainSimpleCount(tls, pParse, pTab1, pBest)
 137356 	goto __123
 137357 __122:
 137358 	regAcc = 0
 137359 	pDistinct1 = uintptr(0)
 137360 	distFlag1 = U16(0)
 137361 
 137362 	if !((*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0) {
 137363 		goto __132
 137364 	}
 137365 	i = 0
 137366 __134:
 137367 	if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) {
 137368 		goto __136
 137369 	}
 137370 	if !((*Expr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc+uintptr(i)*24)).FpFExpr)).Fflags&U32(EP_WinFunc) != U32(0)) {
 137371 		goto __137
 137372 	}
 137373 	goto __135
 137374 __137:
 137375 	;
 137376 	if !((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc+uintptr(i)*24)).FpFunc)).FfuncFlags&U32(SQLITE_FUNC_NEEDCOLL) != 0) {
 137377 		goto __138
 137378 	}
 137379 	goto __136
 137380 __138:
 137381 	;
 137382 	goto __135
 137383 __135:
 137384 	i++
 137385 	goto __134
 137386 	goto __136
 137387 __136:
 137388 	;
 137389 	if !(i == (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) {
 137390 		goto __139
 137391 	}
 137392 	regAcc = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 137393 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regAcc)
 137394 __139:
 137395 	;
 137396 	goto __133
 137397 __132:
 137398 	if !((*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == 1 && (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FiDistinct >= 0) {
 137399 		goto __140
 137400 	}
 137401 
 137402 	pDistinct1 = *(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFExpr + 32))
 137403 	if pDistinct1 != 0 {
 137404 		distFlag1 = uint16(WHERE_WANT_DISTINCT | WHERE_AGG_DISTINCT)
 137405 	} else {
 137406 		distFlag1 = uint16(0)
 137407 	}
 137408 __140:
 137409 	;
 137410 __133:
 137411 	;
 137412 	assignAggregateRegisters(tls, pParse, pAggInfo)
 137413 
 137414 	resetAccumulator(tls, pParse, pAggInfo)
 137415 
 137416 	pWInfo = Xsqlite3WhereBegin(tls, pParse, pTabList, pWhere, *(*uintptr)(unsafe.Pointer(bp + 208)),
 137417 		pDistinct1, p, uint16(int32(minMaxFlag)|int32(distFlag1)), 0)
 137418 	if !(pWInfo == uintptr(0)) {
 137419 		goto __141
 137420 	}
 137421 	goto select_end
 137422 __141:
 137423 	;
 137424 	eDist1 = Xsqlite3WhereIsDistinct(tls, pWInfo)
 137425 	updateAccumulator(tls, pParse, regAcc, pAggInfo, eDist1)
 137426 	if !(eDist1 != WHERE_DISTINCT_NOOP) {
 137427 		goto __142
 137428 	}
 137429 	pF1 = (*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc
 137430 	if !(pF1 != 0) {
 137431 		goto __143
 137432 	}
 137433 	fixDistinctOpenEph(tls, pParse, eDist1, (*AggInfo_func)(unsafe.Pointer(pF1)).FiDistinct, (*AggInfo_func)(unsafe.Pointer(pF1)).FiDistAddr)
 137434 __143:
 137435 	;
 137436 __142:
 137437 	;
 137438 	if !(regAcc != 0) {
 137439 		goto __144
 137440 	}
 137441 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, regAcc)
 137442 __144:
 137443 	;
 137444 	if !(minMaxFlag != 0) {
 137445 		goto __145
 137446 	}
 137447 	Xsqlite3WhereMinMaxOptEarlyOut(tls, v, pWInfo)
 137448 __145:
 137449 	;
 137450 	Xsqlite3WhereEnd(tls, pWInfo)
 137451 	finalizeAggFunctions(tls, pParse, pAggInfo)
 137452 __123:
 137453 	;
 137454 	(*SortCtx)(unsafe.Pointer(bp + 48)).FpOrderBy = uintptr(0)
 137455 	Xsqlite3ExprIfFalse(tls, pParse, pHaving, addrEnd, SQLITE_JUMPIFNULL)
 137456 	selectInnerLoop(tls, pParse, p, -1, uintptr(0), uintptr(0),
 137457 		pDest, addrEnd, addrEnd)
 137458 __97:
 137459 	;
 137460 	Xsqlite3VdbeResolveLabel(tls, v, addrEnd)
 137461 
 137462 __65:
 137463 	;
 137464 	if !(int32((*DistinctCtx)(unsafe.Pointer(bp+136)).FeTnctType) == WHERE_DISTINCT_UNORDERED) {
 137465 		goto __146
 137466 	}
 137467 	explainTempTable(tls, pParse, ts+21218)
 137468 __146:
 137469 	;
 137470 	if !((*SortCtx)(unsafe.Pointer(bp+48)).FpOrderBy != 0) {
 137471 		goto __147
 137472 	}
 137473 
 137474 	generateSortTail(tls, pParse, p, bp+48, (*ExprList)(unsafe.Pointer(pEList)).FnExpr, pDest)
 137475 __147:
 137476 	;
 137477 	Xsqlite3VdbeResolveLabel(tls, v, iEnd)
 137478 
 137479 	rc = libc.Bool32((*Parse)(unsafe.Pointer(pParse)).FnErr > 0)
 137480 
 137481 select_end:
 137482 	;
 137483 	Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp + 208)))
 137484 
 137485 	Xsqlite3VdbeExplainPop(tls, pParse)
 137486 	return rc
 137487 }
 137488 
 137489 // This structure is used to pass data from sqlite3_get_table() through
 137490 // to the callback function is uses to build the result.
 137491 type TabResult1 = struct {
 137492 	FazResult    uintptr
 137493 	FzErrMsg     uintptr
 137494 	FnAlloc      U32
 137495 	FnRow        U32
 137496 	FnColumn     U32
 137497 	FnData       U32
 137498 	Frc          int32
 137499 	F__ccgo_pad1 [4]byte
 137500 }
 137501 
 137502 // This structure is used to pass data from sqlite3_get_table() through
 137503 // to the callback function is uses to build the result.
 137504 type TabResult = TabResult1
 137505 
 137506 func sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr, colv uintptr) int32 {
 137507 	bp := tls.Alloc(8)
 137508 	defer tls.Free(8)
 137509 
 137510 	var p uintptr
 137511 	var need int32
 137512 	var i int32
 137513 	var z uintptr
 137514 	var azNew uintptr
 137515 	var n int32
 137516 	p = pArg
 137517 
 137518 	if !((*TabResult)(unsafe.Pointer(p)).FnRow == U32(0) && argv != uintptr(0)) {
 137519 		goto __1
 137520 	}
 137521 	need = nCol * 2
 137522 	goto __2
 137523 __1:
 137524 	need = nCol
 137525 __2:
 137526 	;
 137527 	if !((*TabResult)(unsafe.Pointer(p)).FnData+U32(need) > (*TabResult)(unsafe.Pointer(p)).FnAlloc) {
 137528 		goto __3
 137529 	}
 137530 	(*TabResult)(unsafe.Pointer(p)).FnAlloc = (*TabResult)(unsafe.Pointer(p)).FnAlloc*U32(2) + U32(need)
 137531 	azNew = Xsqlite3Realloc(tls, (*TabResult)(unsafe.Pointer(p)).FazResult, uint64(unsafe.Sizeof(uintptr(0)))*uint64((*TabResult)(unsafe.Pointer(p)).FnAlloc))
 137532 	if !(azNew == uintptr(0)) {
 137533 		goto __4
 137534 	}
 137535 	goto malloc_failed
 137536 __4:
 137537 	;
 137538 	(*TabResult)(unsafe.Pointer(p)).FazResult = azNew
 137539 __3:
 137540 	;
 137541 	if !((*TabResult)(unsafe.Pointer(p)).FnRow == U32(0)) {
 137542 		goto __5
 137543 	}
 137544 	(*TabResult)(unsafe.Pointer(p)).FnColumn = U32(nCol)
 137545 	i = 0
 137546 __7:
 137547 	if !(i < nCol) {
 137548 		goto __9
 137549 	}
 137550 	z = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8))))
 137551 	if !(z == uintptr(0)) {
 137552 		goto __10
 137553 	}
 137554 	goto malloc_failed
 137555 __10:
 137556 	;
 137557 	*(*uintptr)(unsafe.Pointer((*TabResult)(unsafe.Pointer(p)).FazResult + uintptr(libc.PostIncUint32(&(*TabResult)(unsafe.Pointer(p)).FnData, 1))*8)) = z
 137558 	goto __8
 137559 __8:
 137560 	i++
 137561 	goto __7
 137562 	goto __9
 137563 __9:
 137564 	;
 137565 	goto __6
 137566 __5:
 137567 	if !(int32((*TabResult)(unsafe.Pointer(p)).FnColumn) != nCol) {
 137568 		goto __11
 137569 	}
 137570 	Xsqlite3_free(tls, (*TabResult)(unsafe.Pointer(p)).FzErrMsg)
 137571 	(*TabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls,
 137572 		ts+21236, 0)
 137573 	(*TabResult)(unsafe.Pointer(p)).Frc = SQLITE_ERROR
 137574 	return 1
 137575 __11:
 137576 	;
 137577 __6:
 137578 	;
 137579 	if !(argv != uintptr(0)) {
 137580 		goto __12
 137581 	}
 137582 	i = 0
 137583 __13:
 137584 	if !(i < nCol) {
 137585 		goto __15
 137586 	}
 137587 	if !(*(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) == uintptr(0)) {
 137588 		goto __16
 137589 	}
 137590 	z = uintptr(0)
 137591 	goto __17
 137592 __16:
 137593 	n = Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) + 1
 137594 	z = Xsqlite3_malloc64(tls, uint64(n))
 137595 	if !(z == uintptr(0)) {
 137596 		goto __18
 137597 	}
 137598 	goto malloc_failed
 137599 __18:
 137600 	;
 137601 	libc.Xmemcpy(tls, z, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), uint64(n))
 137602 __17:
 137603 	;
 137604 	*(*uintptr)(unsafe.Pointer((*TabResult)(unsafe.Pointer(p)).FazResult + uintptr(libc.PostIncUint32(&(*TabResult)(unsafe.Pointer(p)).FnData, 1))*8)) = z
 137605 	goto __14
 137606 __14:
 137607 	i++
 137608 	goto __13
 137609 	goto __15
 137610 __15:
 137611 	;
 137612 	(*TabResult)(unsafe.Pointer(p)).FnRow++
 137613 __12:
 137614 	;
 137615 	return 0
 137616 
 137617 malloc_failed:
 137618 	(*TabResult)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
 137619 	return 1
 137620 }
 137621 
 137622 // Query the database.  But instead of invoking a callback for each row,
 137623 // malloc() for space to hold the result and return the entire results
 137624 // at the conclusion of the call.
 137625 //
 137626 // The result that is written to ***pazResult is held in memory obtained
 137627 // from malloc().  But the caller cannot free this memory directly.
 137628 // Instead, the entire table should be passed to sqlite3_free_table() when
 137629 // the calling procedure is finished using it.
 137630 func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintptr, pnRow uintptr, pnColumn uintptr, pzErrMsg uintptr) int32 {
 137631 	bp := tls.Alloc(48)
 137632 	defer tls.Free(48)
 137633 
 137634 	var rc int32
 137635 
 137636 	*(*uintptr)(unsafe.Pointer(pazResult)) = uintptr(0)
 137637 	if pnColumn != 0 {
 137638 		*(*int32)(unsafe.Pointer(pnColumn)) = 0
 137639 	}
 137640 	if pnRow != 0 {
 137641 		*(*int32)(unsafe.Pointer(pnRow)) = 0
 137642 	}
 137643 	if pzErrMsg != 0 {
 137644 		*(*uintptr)(unsafe.Pointer(pzErrMsg)) = uintptr(0)
 137645 	}
 137646 	(*TabResult)(unsafe.Pointer(bp + 8)).FzErrMsg = uintptr(0)
 137647 	(*TabResult)(unsafe.Pointer(bp + 8)).FnRow = U32(0)
 137648 	(*TabResult)(unsafe.Pointer(bp + 8)).FnColumn = U32(0)
 137649 	(*TabResult)(unsafe.Pointer(bp + 8)).FnData = U32(1)
 137650 	(*TabResult)(unsafe.Pointer(bp + 8)).FnAlloc = U32(20)
 137651 	(*TabResult)(unsafe.Pointer(bp + 8)).Frc = SQLITE_OK
 137652 	(*TabResult)(unsafe.Pointer(bp + 8)).FazResult = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(uintptr(0)))*uint64((*TabResult)(unsafe.Pointer(bp+8)).FnAlloc))
 137653 	if (*TabResult)(unsafe.Pointer(bp+8)).FazResult == uintptr(0) {
 137654 		(*Sqlite3)(unsafe.Pointer(db)).FerrCode = SQLITE_NOMEM
 137655 		return SQLITE_NOMEM
 137656 	}
 137657 	*(*uintptr)(unsafe.Pointer((*TabResult)(unsafe.Pointer(bp + 8)).FazResult)) = uintptr(0)
 137658 	rc = Xsqlite3_exec(tls, db, zSql, *(*uintptr)(unsafe.Pointer(&struct {
 137659 		f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
 137660 	}{sqlite3_get_table_cb})), bp+8, pzErrMsg)
 137661 
 137662 	*(*uintptr)(unsafe.Pointer((*TabResult)(unsafe.Pointer(bp + 8)).FazResult)) = uintptr(int64((*TabResult)(unsafe.Pointer(bp + 8)).FnData))
 137663 	if rc&0xff == SQLITE_ABORT {
 137664 		Xsqlite3_free_table(tls, (*TabResult)(unsafe.Pointer(bp+8)).FazResult+1*8)
 137665 		if (*TabResult)(unsafe.Pointer(bp+8)).FzErrMsg != 0 {
 137666 			if pzErrMsg != 0 {
 137667 				Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pzErrMsg)))
 137668 				*(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp, (*TabResult)(unsafe.Pointer(bp+8)).FzErrMsg))
 137669 			}
 137670 			Xsqlite3_free(tls, (*TabResult)(unsafe.Pointer(bp+8)).FzErrMsg)
 137671 		}
 137672 		(*Sqlite3)(unsafe.Pointer(db)).FerrCode = (*TabResult)(unsafe.Pointer(bp + 8)).Frc
 137673 		return (*TabResult)(unsafe.Pointer(bp + 8)).Frc
 137674 	}
 137675 	Xsqlite3_free(tls, (*TabResult)(unsafe.Pointer(bp+8)).FzErrMsg)
 137676 	if rc != SQLITE_OK {
 137677 		Xsqlite3_free_table(tls, (*TabResult)(unsafe.Pointer(bp+8)).FazResult+1*8)
 137678 		return rc
 137679 	}
 137680 	if (*TabResult)(unsafe.Pointer(bp+8)).FnAlloc > (*TabResult)(unsafe.Pointer(bp+8)).FnData {
 137681 		var azNew uintptr
 137682 		azNew = Xsqlite3Realloc(tls, (*TabResult)(unsafe.Pointer(bp+8)).FazResult, uint64(unsafe.Sizeof(uintptr(0)))*uint64((*TabResult)(unsafe.Pointer(bp+8)).FnData))
 137683 		if azNew == uintptr(0) {
 137684 			Xsqlite3_free_table(tls, (*TabResult)(unsafe.Pointer(bp+8)).FazResult+1*8)
 137685 			(*Sqlite3)(unsafe.Pointer(db)).FerrCode = SQLITE_NOMEM
 137686 			return SQLITE_NOMEM
 137687 		}
 137688 		(*TabResult)(unsafe.Pointer(bp + 8)).FazResult = azNew
 137689 	}
 137690 	*(*uintptr)(unsafe.Pointer(pazResult)) = (*TabResult)(unsafe.Pointer(bp+8)).FazResult + 1*8
 137691 	if pnColumn != 0 {
 137692 		*(*int32)(unsafe.Pointer(pnColumn)) = int32((*TabResult)(unsafe.Pointer(bp + 8)).FnColumn)
 137693 	}
 137694 	if pnRow != 0 {
 137695 		*(*int32)(unsafe.Pointer(pnRow)) = int32((*TabResult)(unsafe.Pointer(bp + 8)).FnRow)
 137696 	}
 137697 	return rc
 137698 }
 137699 
 137700 // This routine frees the space the sqlite3_get_table() malloced.
 137701 func Xsqlite3_free_table(tls *libc.TLS, azResult uintptr) {
 137702 	if azResult != 0 {
 137703 		var i int32
 137704 		var n int32
 137705 		azResult -= 8
 137706 
 137707 		n = int32(*(*uintptr)(unsafe.Pointer(azResult)))
 137708 		for i = 1; i < n; i++ {
 137709 			if *(*uintptr)(unsafe.Pointer(azResult + uintptr(i)*8)) != 0 {
 137710 				Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(azResult + uintptr(i)*8)))
 137711 			}
 137712 		}
 137713 		Xsqlite3_free(tls, azResult)
 137714 	}
 137715 }
 137716 
 137717 // Delete a linked list of TriggerStep structures.
 137718 func Xsqlite3DeleteTriggerStep(tls *libc.TLS, db uintptr, pTriggerStep uintptr) {
 137719 	for pTriggerStep != 0 {
 137720 		var pTmp uintptr = pTriggerStep
 137721 		pTriggerStep = (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpNext
 137722 
 137723 		Xsqlite3ExprDelete(tls, db, (*TriggerStep)(unsafe.Pointer(pTmp)).FpWhere)
 137724 		Xsqlite3ExprListDelete(tls, db, (*TriggerStep)(unsafe.Pointer(pTmp)).FpExprList)
 137725 		Xsqlite3SelectDelete(tls, db, (*TriggerStep)(unsafe.Pointer(pTmp)).FpSelect)
 137726 		Xsqlite3IdListDelete(tls, db, (*TriggerStep)(unsafe.Pointer(pTmp)).FpIdList)
 137727 		Xsqlite3UpsertDelete(tls, db, (*TriggerStep)(unsafe.Pointer(pTmp)).FpUpsert)
 137728 		Xsqlite3SrcListDelete(tls, db, (*TriggerStep)(unsafe.Pointer(pTmp)).FpFrom)
 137729 		Xsqlite3DbFree(tls, db, (*TriggerStep)(unsafe.Pointer(pTmp)).FzSpan)
 137730 
 137731 		Xsqlite3DbFree(tls, db, pTmp)
 137732 	}
 137733 }
 137734 
 137735 // Given table pTab, return a list of all the triggers attached to
 137736 // the table. The list is connected by Trigger.pNext pointers.
 137737 //
 137738 // All of the triggers on pTab that are in the same database as pTab
 137739 // are already attached to pTab->pTrigger.  But there might be additional
 137740 // triggers on pTab in the TEMP schema.  This routine prepends all
 137741 // TEMP triggers on pTab to the beginning of the pTab->pTrigger list
 137742 // and returns the combined list.
 137743 //
 137744 // To state it another way:  This routine returns a list of all triggers
 137745 // that fire off of pTab.  The list will include any TEMP triggers on
 137746 // pTab as well as the triggers lised in pTab->pTrigger.
 137747 func Xsqlite3TriggerList(tls *libc.TLS, pParse uintptr, pTab uintptr) uintptr {
 137748 	var pTmpSchema uintptr
 137749 	var pList uintptr
 137750 	var p uintptr
 137751 
 137752 	pTmpSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb + 1*32)).FpSchema
 137753 	p = (*Hash)(unsafe.Pointer(pTmpSchema + 56)).Ffirst
 137754 	pList = (*Table)(unsafe.Pointer(pTab)).FpTrigger
 137755 	for p != 0 {
 137756 		var pTrig uintptr = (*HashElem)(unsafe.Pointer(p)).Fdata
 137757 		if (*Trigger)(unsafe.Pointer(pTrig)).FpTabSchema == (*Table)(unsafe.Pointer(pTab)).FpSchema &&
 137758 			(*Trigger)(unsafe.Pointer(pTrig)).Ftable != 0 &&
 137759 			0 == Xsqlite3StrICmp(tls, (*Trigger)(unsafe.Pointer(pTrig)).Ftable, (*Table)(unsafe.Pointer(pTab)).FzName) &&
 137760 			((*Trigger)(unsafe.Pointer(pTrig)).FpTabSchema != pTmpSchema || (*Trigger)(unsafe.Pointer(pTrig)).FbReturning != 0) {
 137761 			(*Trigger)(unsafe.Pointer(pTrig)).FpNext = pList
 137762 			pList = pTrig
 137763 		} else if int32((*Trigger)(unsafe.Pointer(pTrig)).Fop) == TK_RETURNING {
 137764 			(*Trigger)(unsafe.Pointer(pTrig)).Ftable = (*Table)(unsafe.Pointer(pTab)).FzName
 137765 			(*Trigger)(unsafe.Pointer(pTrig)).FpTabSchema = (*Table)(unsafe.Pointer(pTab)).FpSchema
 137766 			(*Trigger)(unsafe.Pointer(pTrig)).FpNext = pList
 137767 			pList = pTrig
 137768 		}
 137769 		p = (*HashElem)(unsafe.Pointer(p)).Fnext
 137770 	}
 137771 	return pList
 137772 }
 137773 
 137774 // This is called by the parser when it sees a CREATE TRIGGER statement
 137775 // up to the point of the BEGIN before the trigger actions.  A Trigger
 137776 // structure is generated based on the information available and stored
 137777 // in pParse->pNewTrigger.  After the trigger actions have been parsed, the
 137778 // sqlite3FinishTrigger() function is called to complete the trigger
 137779 // construction process.
 137780 func Xsqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, tr_tm int32, op int32, pColumns uintptr, pTableName uintptr, pWhen uintptr, isTemp int32, noErr int32) {
 137781 	bp := tls.Alloc(136)
 137782 	defer tls.Free(136)
 137783 
 137784 	var pTrigger uintptr
 137785 	var pTab uintptr
 137786 	var zName uintptr
 137787 	var db uintptr
 137788 	var iDb int32
 137789 
 137790 	var iTabDb int32
 137791 	var code int32
 137792 	var zDb uintptr
 137793 	var zDbTrig uintptr
 137794 	pTrigger = uintptr(0)
 137795 	zName = uintptr(0)
 137796 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 137797 
 137798 	if !(isTemp != 0) {
 137799 		goto __1
 137800 	}
 137801 
 137802 	if !((*Token)(unsafe.Pointer(pName2)).Fn > uint32(0)) {
 137803 		goto __3
 137804 	}
 137805 	Xsqlite3ErrorMsg(tls, pParse, ts+21301, 0)
 137806 	goto trigger_cleanup
 137807 __3:
 137808 	;
 137809 	iDb = 1
 137810 	*(*uintptr)(unsafe.Pointer(bp + 32)) = pName1
 137811 	goto __2
 137812 __1:
 137813 	iDb = Xsqlite3TwoPartName(tls, pParse, pName1, pName2, bp+32)
 137814 	if !(iDb < 0) {
 137815 		goto __4
 137816 	}
 137817 	goto trigger_cleanup
 137818 __4:
 137819 	;
 137820 __2:
 137821 	;
 137822 	if !(!(pTableName != 0) || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 137823 		goto __5
 137824 	}
 137825 	goto trigger_cleanup
 137826 __5:
 137827 	;
 137828 	if !((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 && iDb != 1) {
 137829 		goto __6
 137830 	}
 137831 	Xsqlite3DbFree(tls, db, (*SrcItem)(unsafe.Pointer(pTableName+8)).FzDatabase)
 137832 	(*SrcItem)(unsafe.Pointer(pTableName + 8)).FzDatabase = uintptr(0)
 137833 __6:
 137834 	;
 137835 	pTab = Xsqlite3SrcListLookup(tls, pParse, pTableName)
 137836 	if !(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0 && (*Token)(unsafe.Pointer(pName2)).Fn == uint32(0) && pTab != 0 &&
 137837 		(*Table)(unsafe.Pointer(pTab)).FpSchema == (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema) {
 137838 		goto __7
 137839 	}
 137840 	iDb = 1
 137841 __7:
 137842 	;
 137843 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 137844 		goto __8
 137845 	}
 137846 	goto trigger_cleanup
 137847 __8:
 137848 	;
 137849 	Xsqlite3FixInit(tls, bp+40, pParse, iDb, ts+21347, *(*uintptr)(unsafe.Pointer(bp + 32)))
 137850 	if !(Xsqlite3FixSrcList(tls, bp+40, pTableName) != 0) {
 137851 		goto __9
 137852 	}
 137853 	goto trigger_cleanup
 137854 __9:
 137855 	;
 137856 	pTab = Xsqlite3SrcListLookup(tls, pParse, pTableName)
 137857 	if !!(pTab != 0) {
 137858 		goto __10
 137859 	}
 137860 
 137861 	goto trigger_orphan_error
 137862 __10:
 137863 	;
 137864 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
 137865 		goto __11
 137866 	}
 137867 	Xsqlite3ErrorMsg(tls, pParse, ts+21355, 0)
 137868 	goto trigger_orphan_error
 137869 __11:
 137870 	;
 137871 	zName = Xsqlite3NameFromToken(tls, db, *(*uintptr)(unsafe.Pointer(bp + 32)))
 137872 	if !(zName == uintptr(0)) {
 137873 		goto __12
 137874 	}
 137875 
 137876 	goto trigger_cleanup
 137877 __12:
 137878 	;
 137879 	if !(Xsqlite3CheckObjectName(tls, pParse, zName, ts+21347, (*Table)(unsafe.Pointer(pTab)).FzName) != 0) {
 137880 		goto __13
 137881 	}
 137882 	goto trigger_cleanup
 137883 __13:
 137884 	;
 137885 	if !!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 137886 		goto __14
 137887 	}
 137888 	if !(Xsqlite3HashFind(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpSchema+56, zName) != 0) {
 137889 		goto __15
 137890 	}
 137891 	if !!(noErr != 0) {
 137892 		goto __16
 137893 	}
 137894 	Xsqlite3ErrorMsg(tls, pParse, ts+21396, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 32))))
 137895 	goto __17
 137896 __16:
 137897 	;
 137898 	Xsqlite3CodeVerifySchema(tls, pParse, iDb)
 137899 
 137900 __17:
 137901 	;
 137902 	goto trigger_cleanup
 137903 __15:
 137904 	;
 137905 __14:
 137906 	;
 137907 	if !(Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+7733, 7) == 0) {
 137908 		goto __18
 137909 	}
 137910 	Xsqlite3ErrorMsg(tls, pParse, ts+21422, 0)
 137911 	goto trigger_cleanup
 137912 __18:
 137913 	;
 137914 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW && tr_tm != TK_INSTEAD) {
 137915 		goto __19
 137916 	}
 137917 	Xsqlite3ErrorMsg(tls, pParse, ts+21460,
 137918 		libc.VaList(bp+8, func() uintptr {
 137919 			if tr_tm == TK_BEFORE {
 137920 				return ts + 21497
 137921 			}
 137922 			return ts + 21504
 137923 		}(), pTableName+8))
 137924 	goto trigger_orphan_error
 137925 __19:
 137926 	;
 137927 	if !(!(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW) && tr_tm == TK_INSTEAD) {
 137928 		goto __20
 137929 	}
 137930 	Xsqlite3ErrorMsg(tls, pParse,
 137931 		ts+21510, libc.VaList(bp+24, pTableName+8))
 137932 	goto trigger_orphan_error
 137933 __20:
 137934 	;
 137935 	if !!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 137936 		goto __21
 137937 	}
 137938 	iTabDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
 137939 	code = SQLITE_CREATE_TRIGGER
 137940 	zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iTabDb)*32)).FzDbSName
 137941 	if isTemp != 0 {
 137942 		zDbTrig = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).FzDbSName
 137943 	} else {
 137944 		zDbTrig = zDb
 137945 	}
 137946 	if !(iTabDb == 1 || isTemp != 0) {
 137947 		goto __22
 137948 	}
 137949 	code = SQLITE_CREATE_TEMP_TRIGGER
 137950 __22:
 137951 	;
 137952 	if !(Xsqlite3AuthCheck(tls, pParse, code, zName, (*Table)(unsafe.Pointer(pTab)).FzName, zDbTrig) != 0) {
 137953 		goto __23
 137954 	}
 137955 	goto trigger_cleanup
 137956 __23:
 137957 	;
 137958 	if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_INSERT, func() uintptr {
 137959 		if !(0 != 0) && iTabDb == 1 {
 137960 			return ts + 7741
 137961 		}
 137962 		return ts + 7235
 137963 	}(), uintptr(0), zDb) != 0) {
 137964 		goto __24
 137965 	}
 137966 	goto trigger_cleanup
 137967 __24:
 137968 	;
 137969 __21:
 137970 	;
 137971 	if !(tr_tm == TK_INSTEAD) {
 137972 		goto __25
 137973 	}
 137974 	tr_tm = TK_BEFORE
 137975 __25:
 137976 	;
 137977 	pTrigger = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Trigger{})))
 137978 	if !(pTrigger == uintptr(0)) {
 137979 		goto __26
 137980 	}
 137981 	goto trigger_cleanup
 137982 __26:
 137983 	;
 137984 	(*Trigger)(unsafe.Pointer(pTrigger)).FzName = zName
 137985 	zName = uintptr(0)
 137986 	(*Trigger)(unsafe.Pointer(pTrigger)).Ftable = Xsqlite3DbStrDup(tls, db, (*SrcItem)(unsafe.Pointer(pTableName+8)).FzName)
 137987 	(*Trigger)(unsafe.Pointer(pTrigger)).FpSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpSchema
 137988 	(*Trigger)(unsafe.Pointer(pTrigger)).FpTabSchema = (*Table)(unsafe.Pointer(pTab)).FpSchema
 137989 	(*Trigger)(unsafe.Pointer(pTrigger)).Fop = U8(op)
 137990 	(*Trigger)(unsafe.Pointer(pTrigger)).Ftr_tm = func() uint8 {
 137991 		if tr_tm == TK_BEFORE {
 137992 			return uint8(TRIGGER_BEFORE)
 137993 		}
 137994 		return uint8(TRIGGER_AFTER)
 137995 	}()
 137996 	if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 137997 		goto __27
 137998 	}
 137999 	Xsqlite3RenameTokenRemap(tls, pParse, (*Trigger)(unsafe.Pointer(pTrigger)).Ftable, (*SrcItem)(unsafe.Pointer(pTableName+8)).FzName)
 138000 	(*Trigger)(unsafe.Pointer(pTrigger)).FpWhen = pWhen
 138001 	pWhen = uintptr(0)
 138002 	goto __28
 138003 __27:
 138004 	(*Trigger)(unsafe.Pointer(pTrigger)).FpWhen = Xsqlite3ExprDup(tls, db, pWhen, EXPRDUP_REDUCE)
 138005 __28:
 138006 	;
 138007 	(*Trigger)(unsafe.Pointer(pTrigger)).FpColumns = pColumns
 138008 	pColumns = uintptr(0)
 138009 
 138010 	(*Parse)(unsafe.Pointer(pParse)).FpNewTrigger = pTrigger
 138011 
 138012 trigger_cleanup:
 138013 	Xsqlite3DbFree(tls, db, zName)
 138014 	Xsqlite3SrcListDelete(tls, db, pTableName)
 138015 	Xsqlite3IdListDelete(tls, db, pColumns)
 138016 	Xsqlite3ExprDelete(tls, db, pWhen)
 138017 	if !!(int32((*Parse)(unsafe.Pointer(pParse)).FpNewTrigger) != 0) {
 138018 		goto __29
 138019 	}
 138020 	Xsqlite3DeleteTrigger(tls, db, pTrigger)
 138021 	goto __30
 138022 __29:
 138023 	;
 138024 __30:
 138025 	;
 138026 	return
 138027 
 138028 trigger_orphan_error:
 138029 	if !(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb) == 1) {
 138030 		goto __31
 138031 	}
 138032 
 138033 	libc.SetBitFieldPtr8Uint32(db+192+8, uint32(1), 0, 0x1)
 138034 __31:
 138035 	;
 138036 	goto trigger_cleanup
 138037 }
 138038 
 138039 // This routine is called after all of the trigger actions have been parsed
 138040 // in order to complete the process of building the trigger.
 138041 func Xsqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAll uintptr) {
 138042 	bp := tls.Alloc(168)
 138043 	defer tls.Free(168)
 138044 
 138045 	var pTrig uintptr
 138046 	var zName uintptr
 138047 	var db uintptr
 138048 
 138049 	var iDb int32
 138050 
 138051 	var pStep uintptr
 138052 	var v uintptr
 138053 	var z uintptr
 138054 	var pTab uintptr
 138055 	var pLink uintptr
 138056 	var pHash uintptr
 138057 	pTrig = (*Parse)(unsafe.Pointer(pParse)).FpNewTrigger
 138058 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 138059 
 138060 	(*Parse)(unsafe.Pointer(pParse)).FpNewTrigger = uintptr(0)
 138061 	if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0 || !(pTrig != 0)) {
 138062 		goto __1
 138063 	}
 138064 	goto triggerfinish_cleanup
 138065 __1:
 138066 	;
 138067 	zName = (*Trigger)(unsafe.Pointer(pTrig)).FzName
 138068 	iDb = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Trigger)(unsafe.Pointer(pTrig)).FpSchema)
 138069 	(*Trigger)(unsafe.Pointer(pTrig)).Fstep_list = pStepList
 138070 __2:
 138071 	if !(pStepList != 0) {
 138072 		goto __3
 138073 	}
 138074 	(*TriggerStep)(unsafe.Pointer(pStepList)).FpTrig = pTrig
 138075 	pStepList = (*TriggerStep)(unsafe.Pointer(pStepList)).FpNext
 138076 	goto __2
 138077 __3:
 138078 	;
 138079 	Xsqlite3TokenInit(tls, bp+56, (*Trigger)(unsafe.Pointer(pTrig)).FzName)
 138080 	Xsqlite3FixInit(tls, bp+72, pParse, iDb, ts+21347, bp+56)
 138081 	if !(Xsqlite3FixTriggerStep(tls, bp+72, (*Trigger)(unsafe.Pointer(pTrig)).Fstep_list) != 0 ||
 138082 		Xsqlite3FixExpr(tls, bp+72, (*Trigger)(unsafe.Pointer(pTrig)).FpWhen) != 0) {
 138083 		goto __4
 138084 	}
 138085 	goto triggerfinish_cleanup
 138086 __4:
 138087 	;
 138088 	if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 138089 		goto __5
 138090 	}
 138091 
 138092 	(*Parse)(unsafe.Pointer(pParse)).FpNewTrigger = pTrig
 138093 	pTrig = uintptr(0)
 138094 	goto __6
 138095 __5:
 138096 	if !!(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0) {
 138097 		goto __7
 138098 	}
 138099 
 138100 	if !(Xsqlite3ReadOnlyShadowTables(tls, db) != 0) {
 138101 		goto __8
 138102 	}
 138103 	pStep = (*Trigger)(unsafe.Pointer(pTrig)).Fstep_list
 138104 __9:
 138105 	if !(pStep != 0) {
 138106 		goto __11
 138107 	}
 138108 	if !((*TriggerStep)(unsafe.Pointer(pStep)).FzTarget != uintptr(0) &&
 138109 		Xsqlite3ShadowTableName(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget) != 0) {
 138110 		goto __12
 138111 	}
 138112 	Xsqlite3ErrorMsg(tls, pParse,
 138113 		ts+21556,
 138114 		libc.VaList(bp, (*Trigger)(unsafe.Pointer(pTrig)).FzName, (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget))
 138115 	goto triggerfinish_cleanup
 138116 __12:
 138117 	;
 138118 	goto __10
 138119 __10:
 138120 	pStep = (*TriggerStep)(unsafe.Pointer(pStep)).FpNext
 138121 	goto __9
 138122 	goto __11
 138123 __11:
 138124 	;
 138125 __8:
 138126 	;
 138127 	v = Xsqlite3GetVdbe(tls, pParse)
 138128 	if !(v == uintptr(0)) {
 138129 		goto __13
 138130 	}
 138131 	goto triggerfinish_cleanup
 138132 __13:
 138133 	;
 138134 	Xsqlite3BeginWriteOperation(tls, pParse, 0, iDb)
 138135 	z = Xsqlite3DbStrNDup(tls, db, (*Token)(unsafe.Pointer(pAll)).Fz, uint64((*Token)(unsafe.Pointer(pAll)).Fn))
 138136 
 138137 	Xsqlite3NestedParse(tls, pParse,
 138138 		ts+21604,
 138139 		libc.VaList(bp+16, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, zName,
 138140 			(*Trigger)(unsafe.Pointer(pTrig)).Ftable, z))
 138141 	Xsqlite3DbFree(tls, db, z)
 138142 	Xsqlite3ChangeCookie(tls, pParse, iDb)
 138143 	Xsqlite3VdbeAddParseSchemaOp(tls, v, iDb,
 138144 		Xsqlite3MPrintf(tls, db, ts+21679, libc.VaList(bp+48, zName)), uint16(0))
 138145 __7:
 138146 	;
 138147 __6:
 138148 	;
 138149 	if !((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0) {
 138150 		goto __14
 138151 	}
 138152 	pLink = pTrig
 138153 	pHash = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpSchema + 56
 138154 
 138155 	pTrig = Xsqlite3HashInsert(tls, pHash, zName, pTrig)
 138156 	if !(pTrig != 0) {
 138157 		goto __15
 138158 	}
 138159 	Xsqlite3OomFault(tls, db)
 138160 	goto __16
 138161 __15:
 138162 	if !((*Trigger)(unsafe.Pointer(pLink)).FpSchema == (*Trigger)(unsafe.Pointer(pLink)).FpTabSchema) {
 138163 		goto __17
 138164 	}
 138165 	pTab = Xsqlite3HashFind(tls, (*Trigger)(unsafe.Pointer(pLink)).FpTabSchema+8, (*Trigger)(unsafe.Pointer(pLink)).Ftable)
 138166 
 138167 	(*Trigger)(unsafe.Pointer(pLink)).FpNext = (*Table)(unsafe.Pointer(pTab)).FpTrigger
 138168 	(*Table)(unsafe.Pointer(pTab)).FpTrigger = pLink
 138169 __17:
 138170 	;
 138171 __16:
 138172 	;
 138173 __14:
 138174 	;
 138175 triggerfinish_cleanup:
 138176 	Xsqlite3DeleteTrigger(tls, db, pTrig)
 138177 
 138178 	Xsqlite3DeleteTriggerStep(tls, db, pStepList)
 138179 }
 138180 
 138181 func triggerSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) uintptr {
 138182 	var z uintptr = Xsqlite3DbSpanDup(tls, db, zStart, zEnd)
 138183 	var i int32
 138184 	if z != 0 {
 138185 		for i = 0; *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0; i++ {
 138186 			if int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))])&0x01 != 0 {
 138187 				*(*int8)(unsafe.Pointer(z + uintptr(i))) = int8(' ')
 138188 			}
 138189 		}
 138190 	}
 138191 	return z
 138192 }
 138193 
 138194 // Turn a SELECT statement (that the pSelect parameter points to) into
 138195 // a trigger step.  Return a pointer to a TriggerStep structure.
 138196 //
 138197 // The parser calls this routine when it finds a SELECT statement in
 138198 // body of a TRIGGER.
 138199 func Xsqlite3TriggerSelectStep(tls *libc.TLS, db uintptr, pSelect uintptr, zStart uintptr, zEnd uintptr) uintptr {
 138200 	var pTriggerStep uintptr = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(TriggerStep{})))
 138201 	if pTriggerStep == uintptr(0) {
 138202 		Xsqlite3SelectDelete(tls, db, pSelect)
 138203 		return uintptr(0)
 138204 	}
 138205 	(*TriggerStep)(unsafe.Pointer(pTriggerStep)).Fop = U8(TK_SELECT)
 138206 	(*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpSelect = pSelect
 138207 	(*TriggerStep)(unsafe.Pointer(pTriggerStep)).Forconf = U8(OE_Default)
 138208 	(*TriggerStep)(unsafe.Pointer(pTriggerStep)).FzSpan = triggerSpanDup(tls, db, zStart, zEnd)
 138209 	return pTriggerStep
 138210 }
 138211 
 138212 func triggerStepAllocate(tls *libc.TLS, pParse uintptr, op U8, pName uintptr, zStart uintptr, zEnd uintptr) uintptr {
 138213 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 138214 	var pTriggerStep uintptr
 138215 
 138216 	if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 138217 		return uintptr(0)
 138218 	}
 138219 	pTriggerStep = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(TriggerStep{}))+uint64((*Token)(unsafe.Pointer(pName)).Fn)+uint64(1))
 138220 	if pTriggerStep != 0 {
 138221 		var z uintptr = pTriggerStep + 1*96
 138222 		libc.Xmemcpy(tls, z, (*Token)(unsafe.Pointer(pName)).Fz, uint64((*Token)(unsafe.Pointer(pName)).Fn))
 138223 		Xsqlite3Dequote(tls, z)
 138224 		(*TriggerStep)(unsafe.Pointer(pTriggerStep)).FzTarget = z
 138225 		(*TriggerStep)(unsafe.Pointer(pTriggerStep)).Fop = op
 138226 		(*TriggerStep)(unsafe.Pointer(pTriggerStep)).FzSpan = triggerSpanDup(tls, db, zStart, zEnd)
 138227 		if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
 138228 			Xsqlite3RenameTokenMap(tls, pParse, (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FzTarget, pName)
 138229 		}
 138230 	}
 138231 	return pTriggerStep
 138232 }
 138233 
 138234 // Build a trigger step out of an INSERT statement.  Return a pointer
 138235 // to the new trigger step.
 138236 //
 138237 // The parser calls this routine when it sees an INSERT inside the
 138238 // body of a trigger.
 138239 func Xsqlite3TriggerInsertStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pColumn uintptr, pSelect uintptr, orconf U8, pUpsert uintptr, zStart uintptr, zEnd uintptr) uintptr {
 138240 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 138241 	var pTriggerStep uintptr
 138242 
 138243 	pTriggerStep = triggerStepAllocate(tls, pParse, uint8(TK_INSERT), pTableName, zStart, zEnd)
 138244 	if pTriggerStep != 0 {
 138245 		if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
 138246 			(*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpSelect = pSelect
 138247 			pSelect = uintptr(0)
 138248 		} else {
 138249 			(*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpSelect = Xsqlite3SelectDup(tls, db, pSelect, EXPRDUP_REDUCE)
 138250 		}
 138251 		(*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpIdList = pColumn
 138252 		(*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpUpsert = pUpsert
 138253 		(*TriggerStep)(unsafe.Pointer(pTriggerStep)).Forconf = orconf
 138254 		if pUpsert != 0 {
 138255 			Xsqlite3HasExplicitNulls(tls, pParse, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget)
 138256 		}
 138257 	} else {
 138258 		Xsqlite3IdListDelete(tls, db, pColumn)
 138259 
 138260 		Xsqlite3UpsertDelete(tls, db, pUpsert)
 138261 	}
 138262 	Xsqlite3SelectDelete(tls, db, pSelect)
 138263 
 138264 	return pTriggerStep
 138265 }
 138266 
 138267 // Construct a trigger step that implements an UPDATE statement and return
 138268 // a pointer to that trigger step.  The parser calls this routine when it
 138269 // sees an UPDATE statement inside the body of a CREATE TRIGGER.
 138270 func Xsqlite3TriggerUpdateStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pFrom uintptr, pEList uintptr, pWhere uintptr, orconf U8, zStart uintptr, zEnd uintptr) uintptr {
 138271 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 138272 	var pTriggerStep uintptr
 138273 
 138274 	pTriggerStep = triggerStepAllocate(tls, pParse, uint8(TK_UPDATE), pTableName, zStart, zEnd)
 138275 	if pTriggerStep != 0 {
 138276 		if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
 138277 			(*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpExprList = pEList
 138278 			(*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpWhere = pWhere
 138279 			(*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpFrom = pFrom
 138280 			pEList = uintptr(0)
 138281 			pWhere = uintptr(0)
 138282 			pFrom = uintptr(0)
 138283 		} else {
 138284 			(*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpExprList = Xsqlite3ExprListDup(tls, db, pEList, EXPRDUP_REDUCE)
 138285 			(*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpWhere = Xsqlite3ExprDup(tls, db, pWhere, EXPRDUP_REDUCE)
 138286 			(*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpFrom = Xsqlite3SrcListDup(tls, db, pFrom, EXPRDUP_REDUCE)
 138287 		}
 138288 		(*TriggerStep)(unsafe.Pointer(pTriggerStep)).Forconf = orconf
 138289 	}
 138290 	Xsqlite3ExprListDelete(tls, db, pEList)
 138291 	Xsqlite3ExprDelete(tls, db, pWhere)
 138292 	Xsqlite3SrcListDelete(tls, db, pFrom)
 138293 	return pTriggerStep
 138294 }
 138295 
 138296 // Construct a trigger step that implements a DELETE statement and return
 138297 // a pointer to that trigger step.  The parser calls this routine when it
 138298 // sees a DELETE statement inside the body of a CREATE TRIGGER.
 138299 func Xsqlite3TriggerDeleteStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pWhere uintptr, zStart uintptr, zEnd uintptr) uintptr {
 138300 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 138301 	var pTriggerStep uintptr
 138302 
 138303 	pTriggerStep = triggerStepAllocate(tls, pParse, uint8(TK_DELETE), pTableName, zStart, zEnd)
 138304 	if pTriggerStep != 0 {
 138305 		if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
 138306 			(*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpWhere = pWhere
 138307 			pWhere = uintptr(0)
 138308 		} else {
 138309 			(*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpWhere = Xsqlite3ExprDup(tls, db, pWhere, EXPRDUP_REDUCE)
 138310 		}
 138311 		(*TriggerStep)(unsafe.Pointer(pTriggerStep)).Forconf = U8(OE_Default)
 138312 	}
 138313 	Xsqlite3ExprDelete(tls, db, pWhere)
 138314 	return pTriggerStep
 138315 }
 138316 
 138317 // Recursively delete a Trigger structure
 138318 func Xsqlite3DeleteTrigger(tls *libc.TLS, db uintptr, pTrigger uintptr) {
 138319 	if pTrigger == uintptr(0) || (*Trigger)(unsafe.Pointer(pTrigger)).FbReturning != 0 {
 138320 		return
 138321 	}
 138322 	Xsqlite3DeleteTriggerStep(tls, db, (*Trigger)(unsafe.Pointer(pTrigger)).Fstep_list)
 138323 	Xsqlite3DbFree(tls, db, (*Trigger)(unsafe.Pointer(pTrigger)).FzName)
 138324 	Xsqlite3DbFree(tls, db, (*Trigger)(unsafe.Pointer(pTrigger)).Ftable)
 138325 	Xsqlite3ExprDelete(tls, db, (*Trigger)(unsafe.Pointer(pTrigger)).FpWhen)
 138326 	Xsqlite3IdListDelete(tls, db, (*Trigger)(unsafe.Pointer(pTrigger)).FpColumns)
 138327 	Xsqlite3DbFree(tls, db, pTrigger)
 138328 }
 138329 
 138330 // This function is called to drop a trigger from the database schema.
 138331 //
 138332 // This may be called directly from the parser and therefore identifies
 138333 // the trigger by name.  The sqlite3DropTriggerPtr() routine does the
 138334 // same job as this routine except it takes a pointer to the trigger
 138335 // instead of the trigger name.
 138336 func Xsqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int32) {
 138337 	bp := tls.Alloc(8)
 138338 	defer tls.Free(8)
 138339 
 138340 	var pTrigger uintptr
 138341 	var i int32
 138342 	var zDb uintptr
 138343 	var zName uintptr
 138344 	var db uintptr
 138345 	var j int32
 138346 	pTrigger = uintptr(0)
 138347 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 138348 
 138349 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 138350 		goto __1
 138351 	}
 138352 	goto drop_trigger_cleanup
 138353 __1:
 138354 	;
 138355 	if !(SQLITE_OK != Xsqlite3ReadSchema(tls, pParse)) {
 138356 		goto __2
 138357 	}
 138358 	goto drop_trigger_cleanup
 138359 __2:
 138360 	;
 138361 	zDb = (*SrcItem)(unsafe.Pointer(pName + 8)).FzDatabase
 138362 	zName = (*SrcItem)(unsafe.Pointer(pName + 8)).FzName
 138363 
 138364 	i = OMIT_TEMPDB
 138365 __3:
 138366 	if !(i < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
 138367 		goto __5
 138368 	}
 138369 	if i < 2 {
 138370 		j = i ^ 1
 138371 	} else {
 138372 		j = i
 138373 	}
 138374 	if !(zDb != 0 && Xsqlite3DbIsNamed(tls, db, j, zDb) == 0) {
 138375 		goto __6
 138376 	}
 138377 	goto __4
 138378 __6:
 138379 	;
 138380 	pTrigger = Xsqlite3HashFind(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(j)*32)).FpSchema+56, zName)
 138381 	if !(pTrigger != 0) {
 138382 		goto __7
 138383 	}
 138384 	goto __5
 138385 __7:
 138386 	;
 138387 	goto __4
 138388 __4:
 138389 	i++
 138390 	goto __3
 138391 	goto __5
 138392 __5:
 138393 	;
 138394 	if !!(pTrigger != 0) {
 138395 		goto __8
 138396 	}
 138397 	if !!(noErr != 0) {
 138398 		goto __9
 138399 	}
 138400 	Xsqlite3ErrorMsg(tls, pParse, ts+21708, libc.VaList(bp, pName+8))
 138401 	goto __10
 138402 __9:
 138403 	Xsqlite3CodeVerifyNamedSchema(tls, pParse, zDb)
 138404 __10:
 138405 	;
 138406 	(*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1)
 138407 	goto drop_trigger_cleanup
 138408 __8:
 138409 	;
 138410 	Xsqlite3DropTriggerPtr(tls, pParse, pTrigger)
 138411 
 138412 drop_trigger_cleanup:
 138413 	Xsqlite3SrcListDelete(tls, db, pName)
 138414 }
 138415 
 138416 func tableOfTrigger(tls *libc.TLS, pTrigger uintptr) uintptr {
 138417 	return Xsqlite3HashFind(tls, (*Trigger)(unsafe.Pointer(pTrigger)).FpTabSchema+8, (*Trigger)(unsafe.Pointer(pTrigger)).Ftable)
 138418 }
 138419 
 138420 // Drop a trigger given a pointer to that trigger.
 138421 func Xsqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) {
 138422 	bp := tls.Alloc(16)
 138423 	defer tls.Free(16)
 138424 
 138425 	var pTable uintptr
 138426 	var v uintptr
 138427 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 138428 	var iDb int32
 138429 
 138430 	iDb = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Trigger)(unsafe.Pointer(pTrigger)).FpSchema)
 138431 
 138432 	pTable = tableOfTrigger(tls, pTrigger)
 138433 
 138434 	if pTable != 0 {
 138435 		var code int32 = SQLITE_DROP_TRIGGER
 138436 		var zDb uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
 138437 		var zTab uintptr = func() uintptr {
 138438 			if !(0 != 0) && iDb == 1 {
 138439 				return ts + 7741
 138440 			}
 138441 			return ts + 7235
 138442 		}()
 138443 		if iDb == 1 {
 138444 			code = SQLITE_DROP_TEMP_TRIGGER
 138445 		}
 138446 		if Xsqlite3AuthCheck(tls, pParse, code, (*Trigger)(unsafe.Pointer(pTrigger)).FzName, (*Table)(unsafe.Pointer(pTable)).FzName, zDb) != 0 || Xsqlite3AuthCheck(tls, pParse, SQLITE_DELETE, zTab, uintptr(0), zDb) != 0 {
 138447 			return
 138448 		}
 138449 	}
 138450 
 138451 	if libc.AssignUintptr(&v, Xsqlite3GetVdbe(tls, pParse)) != uintptr(0) {
 138452 		Xsqlite3NestedParse(tls, pParse,
 138453 			ts+21728,
 138454 			libc.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, (*Trigger)(unsafe.Pointer(pTrigger)).FzName))
 138455 		Xsqlite3ChangeCookie(tls, pParse, iDb)
 138456 		Xsqlite3VdbeAddOp4(tls, v, OP_DropTrigger, iDb, 0, 0, (*Trigger)(unsafe.Pointer(pTrigger)).FzName, 0)
 138457 	}
 138458 }
 138459 
 138460 // Remove a trigger from the hash tables of the sqlite* pointer.
 138461 func Xsqlite3UnlinkAndDeleteTrigger(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) {
 138462 	var pTrigger uintptr
 138463 	var pHash uintptr
 138464 
 138465 	pHash = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpSchema + 56
 138466 	pTrigger = Xsqlite3HashInsert(tls, pHash, zName, uintptr(0))
 138467 	if pTrigger != 0 {
 138468 		if (*Trigger)(unsafe.Pointer(pTrigger)).FpSchema == (*Trigger)(unsafe.Pointer(pTrigger)).FpTabSchema {
 138469 			var pTab uintptr = tableOfTrigger(tls, pTrigger)
 138470 			if pTab != 0 {
 138471 				var pp uintptr
 138472 				for pp = pTab + 88; *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = *(*uintptr)(unsafe.Pointer(pp)) + 64 {
 138473 					if *(*uintptr)(unsafe.Pointer(pp)) == pTrigger {
 138474 						*(*uintptr)(unsafe.Pointer(pp)) = (*Trigger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FpNext
 138475 						break
 138476 					}
 138477 				}
 138478 			}
 138479 		}
 138480 		Xsqlite3DeleteTrigger(tls, db, pTrigger)
 138481 		*(*U32)(unsafe.Pointer(db + 44)) |= U32(DBFLAG_SchemaChange)
 138482 	}
 138483 }
 138484 
 138485 func checkColumnOverlap(tls *libc.TLS, pIdList uintptr, pEList uintptr) int32 {
 138486 	var e int32
 138487 	if pIdList == uintptr(0) || pEList == uintptr(0) {
 138488 		return 1
 138489 	}
 138490 	for e = 0; e < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; e++ {
 138491 		if Xsqlite3IdListIndex(tls, pIdList, (*ExprList_item)(unsafe.Pointer(pEList+8+uintptr(e)*32)).FzEName) >= 0 {
 138492 			return 1
 138493 		}
 138494 	}
 138495 	return 0
 138496 }
 138497 
 138498 func tempTriggersExist(tls *libc.TLS, db uintptr) int32 {
 138499 	if (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema == uintptr(0) {
 138500 		return 0
 138501 	}
 138502 	if (*Hash)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema+56)).Ffirst == uintptr(0) {
 138503 		return 0
 138504 	}
 138505 	return 1
 138506 }
 138507 
 138508 func triggersReallyExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, pChanges uintptr, pMask uintptr) uintptr {
 138509 	bp := tls.Alloc(8)
 138510 	defer tls.Free(8)
 138511 
 138512 	var mask int32
 138513 	var pList uintptr
 138514 	var p uintptr
 138515 	mask = 0
 138516 	pList = uintptr(0)
 138517 
 138518 	pList = Xsqlite3TriggerList(tls, pParse, pTab)
 138519 
 138520 	if !(pList != uintptr(0)) {
 138521 		goto __1
 138522 	}
 138523 	p = pList
 138524 	if !((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_EnableTrigger) == uint64(0) &&
 138525 		(*Table)(unsafe.Pointer(pTab)).FpTrigger != uintptr(0)) {
 138526 		goto __2
 138527 	}
 138528 
 138529 	if !(pList == (*Table)(unsafe.Pointer(pTab)).FpTrigger) {
 138530 		goto __3
 138531 	}
 138532 	pList = uintptr(0)
 138533 	goto exit_triggers_exist
 138534 __3:
 138535 	;
 138536 __4:
 138537 	if !((*Trigger)(unsafe.Pointer(p)).FpNext != 0 && (*Trigger)(unsafe.Pointer(p)).FpNext != (*Table)(unsafe.Pointer(pTab)).FpTrigger) {
 138538 		goto __5
 138539 	}
 138540 	p = (*Trigger)(unsafe.Pointer(p)).FpNext
 138541 	goto __4
 138542 __5:
 138543 	;
 138544 	(*Trigger)(unsafe.Pointer(p)).FpNext = uintptr(0)
 138545 	p = pList
 138546 __2:
 138547 	;
 138548 __6:
 138549 	if !(int32((*Trigger)(unsafe.Pointer(p)).Fop) == op && checkColumnOverlap(tls, (*Trigger)(unsafe.Pointer(p)).FpColumns, pChanges) != 0) {
 138550 		goto __9
 138551 	}
 138552 	mask = mask | int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm)
 138553 	goto __10
 138554 __9:
 138555 	if !(int32((*Trigger)(unsafe.Pointer(p)).Fop) == TK_RETURNING) {
 138556 		goto __11
 138557 	}
 138558 
 138559 	(*Trigger)(unsafe.Pointer(p)).Fop = U8(op)
 138560 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
 138561 		goto __13
 138562 	}
 138563 	if !(op != TK_INSERT) {
 138564 		goto __15
 138565 	}
 138566 	Xsqlite3ErrorMsg(tls, pParse,
 138567 		ts+21790,
 138568 		libc.VaList(bp, func() uintptr {
 138569 			if op == TK_DELETE {
 138570 				return ts + 21838
 138571 			}
 138572 			return ts + 21845
 138573 		}()))
 138574 __15:
 138575 	;
 138576 	(*Trigger)(unsafe.Pointer(p)).Ftr_tm = U8(TRIGGER_BEFORE)
 138577 	goto __14
 138578 __13:
 138579 	(*Trigger)(unsafe.Pointer(p)).Ftr_tm = U8(TRIGGER_AFTER)
 138580 __14:
 138581 	;
 138582 	mask = mask | int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm)
 138583 	goto __12
 138584 __11:
 138585 	if !((*Trigger)(unsafe.Pointer(p)).FbReturning != 0 && int32((*Trigger)(unsafe.Pointer(p)).Fop) == TK_INSERT && op == TK_UPDATE &&
 138586 		(*Parse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0)) {
 138587 		goto __16
 138588 	}
 138589 
 138590 	mask = mask | int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm)
 138591 __16:
 138592 	;
 138593 __12:
 138594 	;
 138595 __10:
 138596 	;
 138597 	p = (*Trigger)(unsafe.Pointer(p)).FpNext
 138598 	goto __7
 138599 __7:
 138600 	if p != 0 {
 138601 		goto __6
 138602 	}
 138603 	goto __8
 138604 __8:
 138605 	;
 138606 __1:
 138607 	;
 138608 exit_triggers_exist:
 138609 	if !(pMask != 0) {
 138610 		goto __17
 138611 	}
 138612 	*(*int32)(unsafe.Pointer(pMask)) = mask
 138613 __17:
 138614 	;
 138615 	return func() uintptr {
 138616 		if mask != 0 {
 138617 			return pList
 138618 		}
 138619 		return uintptr(0)
 138620 	}()
 138621 }
 138622 
 138623 func Xsqlite3TriggersExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, pChanges uintptr, pMask uintptr) uintptr {
 138624 	if (*Table)(unsafe.Pointer(pTab)).FpTrigger == uintptr(0) && !(tempTriggersExist(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb) != 0) ||
 138625 		(*Parse)(unsafe.Pointer(pParse)).FdisableTriggers != 0 {
 138626 		if pMask != 0 {
 138627 			*(*int32)(unsafe.Pointer(pMask)) = 0
 138628 		}
 138629 		return uintptr(0)
 138630 	}
 138631 	return triggersReallyExist(tls, pParse, pTab, op, pChanges, pMask)
 138632 }
 138633 
 138634 // Convert the pStep->zTarget string into a SrcList and return a pointer
 138635 // to that SrcList.
 138636 //
 138637 // This routine adds a specific database name, if needed, to the target when
 138638 // forming the SrcList.  This prevents a trigger in one database from
 138639 // referring to a target in another database.  An exception is when the
 138640 // trigger is in TEMP in which case it can refer to any other database it
 138641 // wants.
 138642 func Xsqlite3TriggerStepSrc(tls *libc.TLS, pParse uintptr, pStep uintptr) uintptr {
 138643 	bp := tls.Alloc(16)
 138644 	defer tls.Free(16)
 138645 
 138646 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 138647 	var pSrc uintptr
 138648 	var zName uintptr = Xsqlite3DbStrDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget)
 138649 	pSrc = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0))
 138650 
 138651 	if pSrc != 0 {
 138652 		var pSchema uintptr = (*Trigger)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(pStep)).FpTrig)).FpSchema
 138653 		(*SrcItem)(unsafe.Pointer(pSrc + 8)).FzName = zName
 138654 		if pSchema != (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema {
 138655 			(*SrcItem)(unsafe.Pointer(pSrc + 8)).FpSchema = pSchema
 138656 		}
 138657 		if (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom != 0 {
 138658 			var pDup uintptr = Xsqlite3SrcListDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom, 0)
 138659 			if pDup != 0 && (*SrcList)(unsafe.Pointer(pDup)).FnSrc > 1 && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 138660 				var pSubquery uintptr
 138661 
 138662 				pSubquery = Xsqlite3SelectNew(tls, pParse, uintptr(0), pDup, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_NestedFrom), uintptr(0))
 138663 				(*Token)(unsafe.Pointer(bp)).Fn = uint32(0)
 138664 				(*Token)(unsafe.Pointer(bp)).Fz = uintptr(0)
 138665 				pDup = Xsqlite3SrcListAppendFromTerm(tls, pParse, uintptr(0), uintptr(0), uintptr(0), bp, pSubquery, uintptr(0))
 138666 			}
 138667 			pSrc = Xsqlite3SrcListAppendList(tls, pParse, pSrc, pDup)
 138668 		}
 138669 	} else {
 138670 		Xsqlite3DbFree(tls, db, zName)
 138671 	}
 138672 	return pSrc
 138673 }
 138674 
 138675 func isAsteriskTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr) int32 {
 138676 	if int32((*Expr)(unsafe.Pointer(pTerm)).Fop) == TK_ASTERISK {
 138677 		return 1
 138678 	}
 138679 	if int32((*Expr)(unsafe.Pointer(pTerm)).Fop) != TK_DOT {
 138680 		return 0
 138681 	}
 138682 
 138683 	if int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pTerm)).FpRight)).Fop) != TK_ASTERISK {
 138684 		return 0
 138685 	}
 138686 	Xsqlite3ErrorMsg(tls, pParse, ts+21852, 0)
 138687 	return 1
 138688 }
 138689 
 138690 func sqlite3ExpandReturning(tls *libc.TLS, pParse uintptr, pList uintptr, pTab uintptr) uintptr {
 138691 	var pNew uintptr = uintptr(0)
 138692 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 138693 	var i int32
 138694 
 138695 	for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ {
 138696 		var pOldExpr uintptr = (*ExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32)).FpExpr
 138697 		if pOldExpr == uintptr(0) {
 138698 			continue
 138699 		}
 138700 		if isAsteriskTerm(tls, pParse, pOldExpr) != 0 {
 138701 			var jj int32
 138702 			for jj = 0; jj < int32((*Table)(unsafe.Pointer(pTab)).FnCol); jj++ {
 138703 				var pNewExpr uintptr
 138704 				if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(jj)*24)).FcolFlags)&COLFLAG_HIDDEN != 0 {
 138705 					continue
 138706 				}
 138707 				pNewExpr = Xsqlite3Expr(tls, db, TK_ID, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(jj)*24)).FzCnName)
 138708 				pNew = Xsqlite3ExprListAppend(tls, pParse, pNew, pNewExpr)
 138709 				if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
 138710 					var pItem uintptr = pNew + 8 + uintptr((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1)*32
 138711 					(*ExprList_item)(unsafe.Pointer(pItem)).FzEName = Xsqlite3DbStrDup(tls, db, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(jj)*24)).FzCnName)
 138712 					libc.SetBitFieldPtr16Uint32(pItem+16+4, uint32(ENAME_NAME), 0, 0x3)
 138713 				}
 138714 			}
 138715 		} else {
 138716 			var pNewExpr uintptr = Xsqlite3ExprDup(tls, db, pOldExpr, 0)
 138717 			pNew = Xsqlite3ExprListAppend(tls, pParse, pNew, pNewExpr)
 138718 			if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) && (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*32)).FzEName != uintptr(0) {
 138719 				var pItem uintptr = pNew + 8 + uintptr((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1)*32
 138720 				(*ExprList_item)(unsafe.Pointer(pItem)).FzEName = Xsqlite3DbStrDup(tls, db, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*32)).FzEName)
 138721 				libc.SetBitFieldPtr16Uint32(pItem+16+4, uint32(int32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*32 + 16 + 4))&0x3>>0)), 0, 0x3)
 138722 			}
 138723 		}
 138724 	}
 138725 	return pNew
 138726 }
 138727 
 138728 func codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, regIn int32) {
 138729 	bp := tls.Alloc(296)
 138730 	defer tls.Free(296)
 138731 
 138732 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 138733 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 138734 	var pNew uintptr
 138735 	var pReturning uintptr
 138736 
 138737 	pReturning = *(*uintptr)(unsafe.Pointer(pParse + 200))
 138738 
 138739 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Select{})))
 138740 	libc.Xmemset(tls, bp+128, 0, uint64(unsafe.Sizeof(SrcList{})))
 138741 	(*Select)(unsafe.Pointer(bp)).FpEList = Xsqlite3ExprListDup(tls, db, (*Returning)(unsafe.Pointer(pReturning)).FpReturnEL, 0)
 138742 	(*Select)(unsafe.Pointer(bp)).FpSrc = bp + 128
 138743 	(*SrcList)(unsafe.Pointer(bp + 128)).FnSrc = 1
 138744 	(*SrcItem)(unsafe.Pointer(bp + 128 + 8)).FpTab = pTab
 138745 	(*SrcItem)(unsafe.Pointer(bp + 128 + 8)).FiCursor = -1
 138746 	Xsqlite3SelectPrep(tls, pParse, bp, uintptr(0))
 138747 	if (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 {
 138748 		Xsqlite3GenerateColumnNames(tls, pParse, bp)
 138749 	}
 138750 	Xsqlite3ExprListDelete(tls, db, (*Select)(unsafe.Pointer(bp)).FpEList)
 138751 	pNew = sqlite3ExpandReturning(tls, pParse, (*Returning)(unsafe.Pointer(pReturning)).FpReturnEL, pTab)
 138752 	if (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 {
 138753 		libc.Xmemset(tls, bp+240, 0, uint64(unsafe.Sizeof(NameContext{})))
 138754 		if (*Returning)(unsafe.Pointer(pReturning)).FnRetCol == 0 {
 138755 			(*Returning)(unsafe.Pointer(pReturning)).FnRetCol = (*ExprList)(unsafe.Pointer(pNew)).FnExpr
 138756 			(*Returning)(unsafe.Pointer(pReturning)).FiRetCur = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 138757 		}
 138758 		(*NameContext)(unsafe.Pointer(bp + 240)).FpParse = pParse
 138759 		*(*int32)(unsafe.Pointer(bp + 240 + 16)) = regIn
 138760 		(*NameContext)(unsafe.Pointer(bp + 240)).FncFlags = NC_UBaseReg
 138761 		(*Parse)(unsafe.Pointer(pParse)).FeTriggerOp = (*Trigger)(unsafe.Pointer(pTrigger)).Fop
 138762 		(*Parse)(unsafe.Pointer(pParse)).FpTriggerTab = pTab
 138763 		if Xsqlite3ResolveExprListNames(tls, bp+240, pNew) == SQLITE_OK &&
 138764 			!(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
 138765 			var i int32
 138766 			var nCol int32 = (*ExprList)(unsafe.Pointer(pNew)).FnExpr
 138767 			var reg int32 = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 138768 			*(*int32)(unsafe.Pointer(pParse + 56)) += nCol + 2
 138769 			(*Returning)(unsafe.Pointer(pReturning)).FiRetReg = reg
 138770 			for i = 0; i < nCol; i++ {
 138771 				var pCol uintptr = (*ExprList_item)(unsafe.Pointer(pNew + 8 + uintptr(i)*32)).FpExpr
 138772 
 138773 				Xsqlite3ExprCodeFactorable(tls, pParse, pCol, reg+i)
 138774 				if int32(Xsqlite3ExprAffinity(tls, pCol)) == SQLITE_AFF_REAL {
 138775 					Xsqlite3VdbeAddOp1(tls, v, OP_RealAffinity, reg+i)
 138776 				}
 138777 			}
 138778 			Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, reg, i, reg+i)
 138779 			Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur, reg+i+1)
 138780 			Xsqlite3VdbeAddOp3(tls, v, OP_Insert, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur, reg+i, reg+i+1)
 138781 		}
 138782 	}
 138783 	Xsqlite3ExprListDelete(tls, db, pNew)
 138784 	(*Parse)(unsafe.Pointer(pParse)).FeTriggerOp = U8(0)
 138785 	(*Parse)(unsafe.Pointer(pParse)).FpTriggerTab = uintptr(0)
 138786 }
 138787 
 138788 func codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orconf int32) int32 {
 138789 	bp := tls.Alloc(48)
 138790 	defer tls.Free(48)
 138791 
 138792 	var pStep uintptr
 138793 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 138794 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 138795 
 138796 	for pStep = pStepList; pStep != 0; pStep = (*TriggerStep)(unsafe.Pointer(pStep)).FpNext {
 138797 		(*Parse)(unsafe.Pointer(pParse)).FeOrconf = func() uint8 {
 138798 			if orconf == OE_Default {
 138799 				return (*TriggerStep)(unsafe.Pointer(pStep)).Forconf
 138800 			}
 138801 			return U8(orconf)
 138802 		}()
 138803 
 138804 		if (*TriggerStep)(unsafe.Pointer(pStep)).FzSpan != 0 {
 138805 			Xsqlite3VdbeAddOp4(tls, v, OP_Trace, 0x7fffffff, 1, 0,
 138806 				Xsqlite3MPrintf(tls, db, ts+7432, libc.VaList(bp, (*TriggerStep)(unsafe.Pointer(pStep)).FzSpan)),
 138807 				-6)
 138808 		}
 138809 
 138810 		switch int32((*TriggerStep)(unsafe.Pointer(pStep)).Fop) {
 138811 		case TK_UPDATE:
 138812 			{
 138813 				Xsqlite3Update(tls, pParse,
 138814 					Xsqlite3TriggerStepSrc(tls, pParse, pStep),
 138815 					Xsqlite3ExprListDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpExprList, 0),
 138816 					Xsqlite3ExprDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere, 0),
 138817 					int32((*Parse)(unsafe.Pointer(pParse)).FeOrconf), uintptr(0), uintptr(0), uintptr(0))
 138818 				Xsqlite3VdbeAddOp0(tls, v, OP_ResetCount)
 138819 				break
 138820 
 138821 			}
 138822 		case TK_INSERT:
 138823 			{
 138824 				Xsqlite3Insert(tls, pParse,
 138825 					Xsqlite3TriggerStepSrc(tls, pParse, pStep),
 138826 					Xsqlite3SelectDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpSelect, 0),
 138827 					Xsqlite3IdListDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpIdList),
 138828 					int32((*Parse)(unsafe.Pointer(pParse)).FeOrconf),
 138829 					Xsqlite3UpsertDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert))
 138830 				Xsqlite3VdbeAddOp0(tls, v, OP_ResetCount)
 138831 				break
 138832 
 138833 			}
 138834 		case TK_DELETE:
 138835 			{
 138836 				Xsqlite3DeleteFrom(tls, pParse,
 138837 					Xsqlite3TriggerStepSrc(tls, pParse, pStep),
 138838 					Xsqlite3ExprDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere, 0), uintptr(0), uintptr(0))
 138839 				Xsqlite3VdbeAddOp0(tls, v, OP_ResetCount)
 138840 				break
 138841 
 138842 			}
 138843 		default:
 138844 			{
 138845 				var pSelect uintptr = Xsqlite3SelectDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpSelect, 0)
 138846 				Xsqlite3SelectDestInit(tls, bp+8, SRT_Discard, 0)
 138847 				Xsqlite3Select(tls, pParse, pSelect, bp+8)
 138848 				Xsqlite3SelectDelete(tls, db, pSelect)
 138849 				break
 138850 
 138851 			}
 138852 		}
 138853 	}
 138854 
 138855 	return 0
 138856 }
 138857 
 138858 func transferParseError(tls *libc.TLS, pTo uintptr, pFrom uintptr) {
 138859 	if (*Parse)(unsafe.Pointer(pTo)).FnErr == 0 {
 138860 		(*Parse)(unsafe.Pointer(pTo)).FzErrMsg = (*Parse)(unsafe.Pointer(pFrom)).FzErrMsg
 138861 		(*Parse)(unsafe.Pointer(pTo)).FnErr = (*Parse)(unsafe.Pointer(pFrom)).FnErr
 138862 		(*Parse)(unsafe.Pointer(pTo)).Frc = (*Parse)(unsafe.Pointer(pFrom)).Frc
 138863 	} else {
 138864 		Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pFrom)).Fdb, (*Parse)(unsafe.Pointer(pFrom)).FzErrMsg)
 138865 	}
 138866 }
 138867 
 138868 func codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, orconf int32) uintptr {
 138869 	bp := tls.Alloc(488)
 138870 	defer tls.Free(488)
 138871 
 138872 	var pTop uintptr = func() uintptr {
 138873 		if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
 138874 			return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
 138875 		}
 138876 		return pParse
 138877 	}()
 138878 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 138879 	var pPrg uintptr
 138880 	var pWhen uintptr = uintptr(0)
 138881 	var v uintptr
 138882 
 138883 	var pProgram uintptr = uintptr(0)
 138884 	var iEndTrigger int32 = 0
 138885 
 138886 	pPrg = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(TriggerPrg{})))
 138887 	if !(pPrg != 0) {
 138888 		return uintptr(0)
 138889 	}
 138890 	(*TriggerPrg)(unsafe.Pointer(pPrg)).FpNext = (*Parse)(unsafe.Pointer(pTop)).FpTriggerPrg
 138891 	(*Parse)(unsafe.Pointer(pTop)).FpTriggerPrg = pPrg
 138892 	(*TriggerPrg)(unsafe.Pointer(pPrg)).FpProgram = libc.AssignUintptr(&pProgram, Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(SubProgram{}))))
 138893 	if !(pProgram != 0) {
 138894 		return uintptr(0)
 138895 	}
 138896 	Xsqlite3VdbeLinkSubProgram(tls, (*Parse)(unsafe.Pointer(pTop)).FpVdbe, pProgram)
 138897 	(*TriggerPrg)(unsafe.Pointer(pPrg)).FpTrigger = pTrigger
 138898 	(*TriggerPrg)(unsafe.Pointer(pPrg)).Forconf = orconf
 138899 	*(*U32)(unsafe.Pointer(pPrg + 28)) = 0xffffffff
 138900 	*(*U32)(unsafe.Pointer(pPrg + 28 + 1*4)) = 0xffffffff
 138901 
 138902 	Xsqlite3ParseObjectInit(tls, bp+8, db)
 138903 	libc.Xmemset(tls, bp+432, 0, uint64(unsafe.Sizeof(NameContext{})))
 138904 	(*NameContext)(unsafe.Pointer(bp + 432)).FpParse = bp + 8
 138905 	(*Parse)(unsafe.Pointer(bp + 8)).FpTriggerTab = pTab
 138906 	(*Parse)(unsafe.Pointer(bp + 8)).FpToplevel = pTop
 138907 	(*Parse)(unsafe.Pointer(bp + 8)).FzAuthContext = (*Trigger)(unsafe.Pointer(pTrigger)).FzName
 138908 	(*Parse)(unsafe.Pointer(bp + 8)).FeTriggerOp = (*Trigger)(unsafe.Pointer(pTrigger)).Fop
 138909 	(*Parse)(unsafe.Pointer(bp + 8)).FnQueryLoop = (*Parse)(unsafe.Pointer(pParse)).FnQueryLoop
 138910 	(*Parse)(unsafe.Pointer(bp + 8)).FprepFlags = (*Parse)(unsafe.Pointer(pParse)).FprepFlags
 138911 
 138912 	v = Xsqlite3GetVdbe(tls, bp+8)
 138913 	if v != 0 {
 138914 		if (*Trigger)(unsafe.Pointer(pTrigger)).FzName != 0 {
 138915 			Xsqlite3VdbeChangeP4(tls, v, -1,
 138916 				Xsqlite3MPrintf(tls, db, ts+21894, libc.VaList(bp, (*Trigger)(unsafe.Pointer(pTrigger)).FzName)), -6)
 138917 		}
 138918 
 138919 		if (*Trigger)(unsafe.Pointer(pTrigger)).FpWhen != 0 {
 138920 			pWhen = Xsqlite3ExprDup(tls, db, (*Trigger)(unsafe.Pointer(pTrigger)).FpWhen, 0)
 138921 			if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 &&
 138922 				SQLITE_OK == Xsqlite3ResolveExprNames(tls, bp+432, pWhen) {
 138923 				iEndTrigger = Xsqlite3VdbeMakeLabel(tls, bp+8)
 138924 				Xsqlite3ExprIfFalse(tls, bp+8, pWhen, iEndTrigger, SQLITE_JUMPIFNULL)
 138925 			}
 138926 			Xsqlite3ExprDelete(tls, db, pWhen)
 138927 		}
 138928 
 138929 		codeTriggerProgram(tls, bp+8, (*Trigger)(unsafe.Pointer(pTrigger)).Fstep_list, orconf)
 138930 
 138931 		if iEndTrigger != 0 {
 138932 			Xsqlite3VdbeResolveLabel(tls, v, iEndTrigger)
 138933 		}
 138934 		Xsqlite3VdbeAddOp0(tls, v, OP_Halt)
 138935 
 138936 		transferParseError(tls, pParse, bp+8)
 138937 
 138938 		if (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 {
 138939 			(*SubProgram)(unsafe.Pointer(pProgram)).FaOp = Xsqlite3VdbeTakeOpArray(tls, v, pProgram+8, pTop+136)
 138940 		}
 138941 		(*SubProgram)(unsafe.Pointer(pProgram)).FnMem = (*Parse)(unsafe.Pointer(bp + 8)).FnMem
 138942 		(*SubProgram)(unsafe.Pointer(pProgram)).FnCsr = (*Parse)(unsafe.Pointer(bp + 8)).FnTab
 138943 		(*SubProgram)(unsafe.Pointer(pProgram)).Ftoken = pTrigger
 138944 		*(*U32)(unsafe.Pointer(pPrg + 28)) = (*Parse)(unsafe.Pointer(bp + 8)).Foldmask
 138945 		*(*U32)(unsafe.Pointer(pPrg + 28 + 1*4)) = (*Parse)(unsafe.Pointer(bp + 8)).Fnewmask
 138946 		Xsqlite3VdbeDelete(tls, v)
 138947 	} else {
 138948 		transferParseError(tls, pParse, bp+8)
 138949 	}
 138950 
 138951 	Xsqlite3ParseObjectReset(tls, bp+8)
 138952 	return pPrg
 138953 }
 138954 
 138955 func getRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, orconf int32) uintptr {
 138956 	var pRoot uintptr = func() uintptr {
 138957 		if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
 138958 			return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
 138959 		}
 138960 		return pParse
 138961 	}()
 138962 	var pPrg uintptr
 138963 
 138964 	for pPrg = (*Parse)(unsafe.Pointer(pRoot)).FpTriggerPrg; pPrg != 0 && ((*TriggerPrg)(unsafe.Pointer(pPrg)).FpTrigger != pTrigger || (*TriggerPrg)(unsafe.Pointer(pPrg)).Forconf != orconf); pPrg = (*TriggerPrg)(unsafe.Pointer(pPrg)).FpNext {
 138965 	}
 138966 
 138967 	if !(pPrg != 0) {
 138968 		pPrg = codeRowTrigger(tls, pParse, pTrigger, pTab, orconf)
 138969 		(*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FerrByteOffset = -1
 138970 	}
 138971 
 138972 	return pPrg
 138973 }
 138974 
 138975 // Generate code for the trigger program associated with trigger p on
 138976 // table pTab. The reg, orconf and ignoreJump parameters passed to this
 138977 // function are the same as those described in the header function for
 138978 // sqlite3CodeRowTrigger()
 138979 func Xsqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab uintptr, reg int32, orconf int32, ignoreJump int32) {
 138980 	var v uintptr = Xsqlite3GetVdbe(tls, pParse)
 138981 	var pPrg uintptr
 138982 	pPrg = getRowTrigger(tls, pParse, p, pTab, orconf)
 138983 
 138984 	if pPrg != 0 {
 138985 		var bRecursive int32 = libc.Bool32((*Trigger)(unsafe.Pointer(p)).FzName != 0 && uint64(0) == (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_RecTriggers))
 138986 
 138987 		Xsqlite3VdbeAddOp4(tls, v, OP_Program, reg, ignoreJump, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1),
 138988 			(*TriggerPrg)(unsafe.Pointer(pPrg)).FpProgram, -4)
 138989 
 138990 		Xsqlite3VdbeChangeP5(tls, v, uint16(U8(bRecursive)))
 138991 	}
 138992 }
 138993 
 138994 // This is called to code the required FOR EACH ROW triggers for an operation
 138995 // on table pTab. The operation to code triggers for (INSERT, UPDATE or DELETE)
 138996 // is given by the op parameter. The tr_tm parameter determines whether the
 138997 // BEFORE or AFTER triggers are coded. If the operation is an UPDATE, then
 138998 // parameter pChanges is passed the list of columns being modified.
 138999 //
 139000 // If there are no triggers that fire at the specified time for the specified
 139001 // operation on pTab, this function is a no-op.
 139002 //
 139003 // The reg argument is the address of the first in an array of registers
 139004 // that contain the values substituted for the new.* and old.* references
 139005 // in the trigger program. If N is the number of columns in table pTab
 139006 // (a copy of pTab->nCol), then registers are populated as follows:
 139007 //
 139008 //	Register       Contains
 139009 //	------------------------------------------------------
 139010 //	reg+0          OLD.rowid
 139011 //	reg+1          OLD.* value of left-most column of pTab
 139012 //	...            ...
 139013 //	reg+N          OLD.* value of right-most column of pTab
 139014 //	reg+N+1        NEW.rowid
 139015 //	reg+N+2        NEW.* value of left-most column of pTab
 139016 //	...            ...
 139017 //	reg+N+N+1      NEW.* value of right-most column of pTab
 139018 //
 139019 // For ON DELETE triggers, the registers containing the NEW.* values will
 139020 // never be accessed by the trigger program, so they are not allocated or
 139021 // populated by the caller (there is no data to populate them with anyway).
 139022 // Similarly, for ON INSERT triggers the values stored in the OLD.* registers
 139023 // are never accessed, and so are not allocated by the caller. So, for an
 139024 // ON INSERT trigger, the value passed to this function as parameter reg
 139025 // is not a readable register, although registers (reg+N) through
 139026 // (reg+N+N+1) are.
 139027 //
 139028 // Parameter orconf is the default conflict resolution algorithm for the
 139029 // trigger program to use (REPLACE, IGNORE etc.). Parameter ignoreJump
 139030 // is the instruction that control should jump to if a trigger program
 139031 // raises an IGNORE exception.
 139032 func Xsqlite3CodeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, op int32, pChanges uintptr, tr_tm int32, pTab uintptr, reg int32, orconf int32, ignoreJump int32) {
 139033 	var p uintptr
 139034 
 139035 	for p = pTrigger; p != 0; p = (*Trigger)(unsafe.Pointer(p)).FpNext {
 139036 		if (int32((*Trigger)(unsafe.Pointer(p)).Fop) == op || (*Trigger)(unsafe.Pointer(p)).FbReturning != 0 && int32((*Trigger)(unsafe.Pointer(p)).Fop) == TK_INSERT && op == TK_UPDATE) &&
 139037 			int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm) == tr_tm &&
 139038 			checkColumnOverlap(tls, (*Trigger)(unsafe.Pointer(p)).FpColumns, pChanges) != 0 {
 139039 			if !(int32((*Trigger)(unsafe.Pointer(p)).FbReturning) != 0) {
 139040 				Xsqlite3CodeRowTriggerDirect(tls, pParse, p, pTab, reg, orconf, ignoreJump)
 139041 			} else if (*Parse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0) {
 139042 				codeReturningTrigger(tls, pParse, p, pTab, reg)
 139043 			}
 139044 		}
 139045 	}
 139046 }
 139047 
 139048 // Triggers may access values stored in the old.* or new.* pseudo-table.
 139049 // This function returns a 32-bit bitmask indicating which columns of the
 139050 // old.* or new.* tables actually are used by triggers. This information
 139051 // may be used by the caller, for example, to avoid having to load the entire
 139052 // old.* record into memory when executing an UPDATE or DELETE command.
 139053 //
 139054 // Bit 0 of the returned mask is set if the left-most column of the
 139055 // table may be accessed using an [old|new].<col> reference. Bit 1 is set if
 139056 // the second leftmost column value is required, and so on. If there
 139057 // are more than 32 columns in the table, and at least one of the columns
 139058 // with an index greater than 32 may be accessed, 0xffffffff is returned.
 139059 //
 139060 // It is not possible to determine if the old.rowid or new.rowid column is
 139061 // accessed by triggers. The caller must always assume that it is.
 139062 //
 139063 // Parameter isNew must be either 1 or 0. If it is 0, then the mask returned
 139064 // applies to the old.* table. If 1, the new.* table.
 139065 //
 139066 // Parameter tr_tm must be a mask with one or both of the TRIGGER_BEFORE
 139067 // and TRIGGER_AFTER bits set. Values accessed by BEFORE triggers are only
 139068 // included in the returned mask if the TRIGGER_BEFORE bit is set in the
 139069 // tr_tm parameter. Similarly, values accessed by AFTER triggers are only
 139070 // included in the returned mask if the TRIGGER_AFTER bit is set in tr_tm.
 139071 func Xsqlite3TriggerColmask(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pChanges uintptr, isNew int32, tr_tm int32, pTab uintptr, orconf int32) U32 {
 139072 	var op int32
 139073 	if pChanges != 0 {
 139074 		op = TK_UPDATE
 139075 	} else {
 139076 		op = TK_DELETE
 139077 	}
 139078 	var mask U32 = U32(0)
 139079 	var p uintptr
 139080 
 139081 	for p = pTrigger; p != 0; p = (*Trigger)(unsafe.Pointer(p)).FpNext {
 139082 		if int32((*Trigger)(unsafe.Pointer(p)).Fop) == op &&
 139083 			tr_tm&int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm) != 0 &&
 139084 			checkColumnOverlap(tls, (*Trigger)(unsafe.Pointer(p)).FpColumns, pChanges) != 0 {
 139085 			if (*Trigger)(unsafe.Pointer(p)).FbReturning != 0 {
 139086 				mask = 0xffffffff
 139087 			} else {
 139088 				var pPrg uintptr
 139089 				pPrg = getRowTrigger(tls, pParse, p, pTab, orconf)
 139090 				if pPrg != 0 {
 139091 					mask = mask | *(*U32)(unsafe.Pointer(pPrg + 28 + uintptr(isNew)*4))
 139092 				}
 139093 			}
 139094 		}
 139095 	}
 139096 
 139097 	return mask
 139098 }
 139099 
 139100 // The most recently coded instruction was an OP_Column to retrieve the
 139101 // i-th column of table pTab. This routine sets the P4 parameter of the
 139102 // OP_Column to the default value, if any.
 139103 //
 139104 // The default value of a column is specified by a DEFAULT clause in the
 139105 // column definition. This was either supplied by the user when the table
 139106 // was created, or added later to the table definition by an ALTER TABLE
 139107 // command. If the latter, then the row-records in the table btree on disk
 139108 // may not contain a value for the column and the default value, taken
 139109 // from the P4 parameter of the OP_Column instruction, is returned instead.
 139110 // If the former, then all row-records are guaranteed to include a value
 139111 // for the column and the P4 value is not required.
 139112 //
 139113 // Column definitions created by an ALTER TABLE command may only have
 139114 // literal default values specified: a number, null or a string. (If a more
 139115 // complicated default expression value was provided, it is evaluated
 139116 // when the ALTER TABLE is executed and one of the literal values written
 139117 // into the sqlite_schema table.)
 139118 //
 139119 // Therefore, the P4 parameter is only required if the default value for
 139120 // the column is a literal number, string or null. The sqlite3ValueFromExpr()
 139121 // function is capable of transforming these types of expressions into
 139122 // sqlite3_value objects.
 139123 //
 139124 // If column as REAL affinity and the table is an ordinary b-tree table
 139125 // (not a virtual table) then the value might have been stored as an
 139126 // integer.  In that case, add an OP_RealAffinity opcode to make sure
 139127 // it has been converted into REAL.
 139128 func Xsqlite3ColumnDefault(tls *libc.TLS, v uintptr, pTab uintptr, i int32, iReg int32) {
 139129 	bp := tls.Alloc(8)
 139130 	defer tls.Free(8)
 139131 
 139132 	var pCol uintptr
 139133 
 139134 	pCol = (*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*24
 139135 	if (*Column)(unsafe.Pointer(pCol)).FiDflt != 0 {
 139136 		*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 139137 		var enc U8 = (*Sqlite3)(unsafe.Pointer(Xsqlite3VdbeDb(tls, v))).Fenc
 139138 
 139139 		Xsqlite3ValueFromExpr(tls, Xsqlite3VdbeDb(tls, v),
 139140 			Xsqlite3ColumnExpr(tls, pTab, pCol), enc,
 139141 			uint8((*Column)(unsafe.Pointer(pCol)).Faffinity), bp)
 139142 		if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
 139143 			Xsqlite3VdbeAppendP4(tls, v, *(*uintptr)(unsafe.Pointer(bp)), -10)
 139144 		}
 139145 	}
 139146 	if int32((*Column)(unsafe.Pointer(pCol)).Faffinity) == SQLITE_AFF_REAL && !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
 139147 		Xsqlite3VdbeAddOp1(tls, v, OP_RealAffinity, iReg)
 139148 	}
 139149 }
 139150 
 139151 func indexColumnIsBeingUpdated(tls *libc.TLS, pIdx uintptr, iCol int32, aXRef uintptr, chngRowid int32) int32 {
 139152 	var iIdxCol I16 = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iCol)*2))
 139153 
 139154 	if int32(iIdxCol) >= 0 {
 139155 		return libc.Bool32(*(*int32)(unsafe.Pointer(aXRef + uintptr(iIdxCol)*4)) >= 0)
 139156 	}
 139157 
 139158 	return Xsqlite3ExprReferencesUpdatedColumn(tls, (*ExprList_item)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaColExpr+8+uintptr(iCol)*32)).FpExpr,
 139159 		aXRef, chngRowid)
 139160 }
 139161 
 139162 func indexWhereClauseMightChange(tls *libc.TLS, pIdx uintptr, aXRef uintptr, chngRowid int32) int32 {
 139163 	if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) {
 139164 		return 0
 139165 	}
 139166 	return Xsqlite3ExprReferencesUpdatedColumn(tls, (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere,
 139167 		aXRef, chngRowid)
 139168 }
 139169 
 139170 func exprRowColumn(tls *libc.TLS, pParse uintptr, iCol int32) uintptr {
 139171 	var pRet uintptr = Xsqlite3PExpr(tls, pParse, TK_ROW, uintptr(0), uintptr(0))
 139172 	if pRet != 0 {
 139173 		(*Expr)(unsafe.Pointer(pRet)).FiColumn = YnVar(iCol + 1)
 139174 	}
 139175 	return pRet
 139176 }
 139177 
 139178 func updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, pChanges uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr) {
 139179 	bp := tls.Alloc(40)
 139180 	defer tls.Free(40)
 139181 
 139182 	var i int32
 139183 
 139184 	var pSelect uintptr = uintptr(0)
 139185 	var pList uintptr = uintptr(0)
 139186 	var pGrp uintptr = uintptr(0)
 139187 	var pLimit2 uintptr = uintptr(0)
 139188 	var pOrderBy2 uintptr = uintptr(0)
 139189 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 139190 	var pTab uintptr = (*SrcItem)(unsafe.Pointer(pTabList + 8)).FpTab
 139191 	var pSrc uintptr
 139192 	var pWhere2 uintptr
 139193 	var eDest int32
 139194 
 139195 	_ = pOrderBy
 139196 	_ = pLimit
 139197 
 139198 	pSrc = Xsqlite3SrcListDup(tls, db, pTabList, 0)
 139199 	pWhere2 = Xsqlite3ExprDup(tls, db, pWhere, 0)
 139200 
 139201 	if pSrc != 0 {
 139202 		libc.SetBitFieldPtr16Uint32(pSrc+8+60+4, uint32(1), 9, 0x200)
 139203 		(*SrcItem)(unsafe.Pointer(pSrc + 8)).FiCursor = -1
 139204 		(*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc+8)).FpTab)).FnTabRef--
 139205 		(*SrcItem)(unsafe.Pointer(pSrc + 8)).FpTab = uintptr(0)
 139206 	}
 139207 	if pPk != 0 {
 139208 		for i = 0; i < int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol); i++ {
 139209 			var pNew uintptr = exprRowColumn(tls, pParse, int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))))
 139210 			pList = Xsqlite3ExprListAppend(tls, pParse, pList, pNew)
 139211 		}
 139212 		if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
 139213 			eDest = SRT_Table
 139214 		} else {
 139215 			eDest = SRT_Upfrom
 139216 		}
 139217 	} else if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW {
 139218 		for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
 139219 			pList = Xsqlite3ExprListAppend(tls, pParse, pList, exprRowColumn(tls, pParse, i))
 139220 		}
 139221 		eDest = SRT_Table
 139222 	} else {
 139223 		if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
 139224 			eDest = SRT_Table
 139225 		} else {
 139226 			eDest = SRT_Upfrom
 139227 		}
 139228 		pList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), Xsqlite3PExpr(tls, pParse, TK_ROW, uintptr(0), uintptr(0)))
 139229 	}
 139230 
 139231 	if pChanges != 0 {
 139232 		for i = 0; i < (*ExprList)(unsafe.Pointer(pChanges)).FnExpr; i++ {
 139233 			pList = Xsqlite3ExprListAppend(tls, pParse, pList,
 139234 				Xsqlite3ExprDup(tls, db, (*ExprList_item)(unsafe.Pointer(pChanges+8+uintptr(i)*32)).FpExpr, 0))
 139235 		}
 139236 	}
 139237 	pSelect = Xsqlite3SelectNew(tls, pParse, pList,
 139238 		pSrc, pWhere2, pGrp, uintptr(0), pOrderBy2,
 139239 		uint32(SF_UFSrcCheck|SF_IncludeHidden|SF_UpdateFrom), pLimit2)
 139240 	if pSelect != 0 {
 139241 		*(*U32)(unsafe.Pointer(pSelect + 4)) |= U32(SF_OrderByReqd)
 139242 	}
 139243 	Xsqlite3SelectDestInit(tls, bp, eDest, iEph)
 139244 	(*SelectDest)(unsafe.Pointer(bp)).FiSDParm2 = func() int32 {
 139245 		if pPk != 0 {
 139246 			return int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol)
 139247 		}
 139248 		return -1
 139249 	}()
 139250 	Xsqlite3Select(tls, pParse, pSelect, bp)
 139251 	Xsqlite3SelectDelete(tls, db, pSelect)
 139252 }
 139253 
 139254 // Process an UPDATE statement.
 139255 //
 139256 //	UPDATE OR IGNORE tbl SET a=b, c=d FROM tbl2... WHERE e<5 AND f NOT NULL;
 139257 //	       \_______/ \_/     \______/      \_____/       \________________/
 139258 //	        onError   |      pChanges         |                pWhere
 139259 //	                  \_______________________/
 139260 //	                            pTabList
 139261 func Xsqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr) {
 139262 	bp := tls.Alloc(108)
 139263 	defer tls.Free(108)
 139264 
 139265 	var i int32
 139266 	var j int32
 139267 	var k int32
 139268 	var pTab uintptr
 139269 	var addrTop int32
 139270 	var pWInfo uintptr
 139271 	var v uintptr
 139272 	var pIdx uintptr
 139273 	var pPk uintptr
 139274 	var nIdx int32
 139275 	var nAllIdx int32
 139276 	var iBaseCur int32
 139277 	var iDataCur int32
 139278 	var iIdxCur int32
 139279 	var db uintptr
 139280 	var aRegIdx uintptr
 139281 	var aXRef uintptr
 139282 
 139283 	var aToOpen uintptr
 139284 	var chngPk U8
 139285 	var chngRowid U8
 139286 	var chngKey U8
 139287 	var pRowidExpr uintptr
 139288 	var iRowidExpr int32
 139289 
 139290 	var iDb int32
 139291 	var eOnePass int32
 139292 	var hasFK int32
 139293 	var labelBreak int32
 139294 	var labelContinue int32
 139295 	var flags int32
 139296 
 139297 	var isView int32
 139298 	var pTrigger uintptr
 139299 
 139300 	var newmask int32
 139301 	var iEph int32
 139302 	var nKey int32
 139303 
 139304 	var addrOpen int32
 139305 	var iPk int32
 139306 	var nPk I16
 139307 
 139308 	var bFinishSeek int32
 139309 	var nChangeFrom int32
 139310 
 139311 	var regRowCount int32
 139312 	var regOldRowid int32
 139313 	var regNewRowid int32
 139314 	var regNew int32
 139315 	var regOld int32
 139316 	var regRowSet int32
 139317 	var regKey int32
 139318 	var rc int32
 139319 	var hCol U8
 139320 	var bProgress int32
 139321 	var reg int32
 139322 	var pKeyInfo uintptr
 139323 	var nEphCol int32
 139324 	var iCur int32
 139325 	var addrOnce int32
 139326 	var colFlags U32
 139327 	var oldmask U32
 139328 	var nOff int32
 139329 	addrTop = 0
 139330 	pWInfo = uintptr(0)
 139331 	aRegIdx = uintptr(0)
 139332 	aXRef = uintptr(0)
 139333 	pRowidExpr = uintptr(0)
 139334 	iRowidExpr = -1
 139335 	iEph = 0
 139336 	nKey = 0
 139337 	addrOpen = 0
 139338 	iPk = 0
 139339 	nPk = int16(0)
 139340 	*(*int32)(unsafe.Pointer(bp + 104)) = 0
 139341 	bFinishSeek = 1
 139342 	nChangeFrom = 0
 139343 	regRowCount = 0
 139344 	regOldRowid = 0
 139345 	regNewRowid = 0
 139346 	regNew = 0
 139347 	regOld = 0
 139348 	regRowSet = 0
 139349 	regKey = 0
 139350 
 139351 	libc.Xmemset(tls, bp+16, 0, uint64(unsafe.Sizeof(AuthContext{})))
 139352 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 139353 
 139354 	if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
 139355 		goto __1
 139356 	}
 139357 	goto update_cleanup
 139358 __1:
 139359 	;
 139360 	pTab = Xsqlite3SrcListLookup(tls, pParse, pTabList)
 139361 	if !(pTab == uintptr(0)) {
 139362 		goto __2
 139363 	}
 139364 	goto update_cleanup
 139365 __2:
 139366 	;
 139367 	iDb = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Table)(unsafe.Pointer(pTab)).FpSchema)
 139368 
 139369 	pTrigger = Xsqlite3TriggersExist(tls, pParse, pTab, TK_UPDATE, pChanges, bp+32)
 139370 	isView = libc.Bool32(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW)
 139371 
 139372 	if (*SrcList)(unsafe.Pointer(pTabList)).FnSrc > 1 {
 139373 		nChangeFrom = (*ExprList)(unsafe.Pointer(pChanges)).FnExpr
 139374 	} else {
 139375 		nChangeFrom = 0
 139376 	}
 139377 
 139378 	if !(Xsqlite3ViewGetColumnNames(tls, pParse, pTab) != 0) {
 139379 		goto __3
 139380 	}
 139381 	goto update_cleanup
 139382 __3:
 139383 	;
 139384 	if !(Xsqlite3IsReadOnly(tls, pParse, pTab, *(*int32)(unsafe.Pointer(bp + 32))) != 0) {
 139385 		goto __4
 139386 	}
 139387 	goto update_cleanup
 139388 __4:
 139389 	;
 139390 	iBaseCur = libc.AssignInt32(&iDataCur, libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1))
 139391 	iIdxCur = iDataCur + 1
 139392 	if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
 139393 		pPk = uintptr(0)
 139394 	} else {
 139395 		pPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
 139396 	}
 139397 
 139398 	nIdx = 0
 139399 	pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex
 139400 __5:
 139401 	if !(pIdx != 0) {
 139402 		goto __7
 139403 	}
 139404 	if !(pPk == pIdx) {
 139405 		goto __8
 139406 	}
 139407 	iDataCur = (*Parse)(unsafe.Pointer(pParse)).FnTab
 139408 __8:
 139409 	;
 139410 	(*Parse)(unsafe.Pointer(pParse)).FnTab++
 139411 	goto __6
 139412 __6:
 139413 	pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
 139414 	nIdx++
 139415 	goto __5
 139416 	goto __7
 139417 __7:
 139418 	;
 139419 	if !(pUpsert != 0) {
 139420 		goto __9
 139421 	}
 139422 
 139423 	iDataCur = (*Upsert)(unsafe.Pointer(pUpsert)).FiDataCur
 139424 	iIdxCur = (*Upsert)(unsafe.Pointer(pUpsert)).FiIdxCur
 139425 	(*Parse)(unsafe.Pointer(pParse)).FnTab = iBaseCur
 139426 __9:
 139427 	;
 139428 	(*SrcItem)(unsafe.Pointer(pTabList + 8)).FiCursor = iDataCur
 139429 
 139430 	aXRef = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(int32(0)))*uint64(int32((*Table)(unsafe.Pointer(pTab)).FnCol)+nIdx+1)+uint64(nIdx)+uint64(2))
 139431 	if !(aXRef == uintptr(0)) {
 139432 		goto __10
 139433 	}
 139434 	goto update_cleanup
 139435 __10:
 139436 	;
 139437 	aRegIdx = aXRef + uintptr((*Table)(unsafe.Pointer(pTab)).FnCol)*4
 139438 	aToOpen = aRegIdx + uintptr(nIdx)*4 + uintptr(1)*4
 139439 	libc.Xmemset(tls, aToOpen, 1, uint64(nIdx+1))
 139440 	*(*U8)(unsafe.Pointer(aToOpen + uintptr(nIdx+1))) = U8(0)
 139441 	i = 0
 139442 __11:
 139443 	if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 139444 		goto __13
 139445 	}
 139446 	*(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) = -1
 139447 	goto __12
 139448 __12:
 139449 	i++
 139450 	goto __11
 139451 	goto __13
 139452 __13:
 139453 	;
 139454 	libc.Xmemset(tls, bp+40, 0, uint64(unsafe.Sizeof(NameContext{})))
 139455 	(*NameContext)(unsafe.Pointer(bp + 40)).FpParse = pParse
 139456 	(*NameContext)(unsafe.Pointer(bp + 40)).FpSrcList = pTabList
 139457 	*(*uintptr)(unsafe.Pointer(bp + 40 + 16)) = pUpsert
 139458 	(*NameContext)(unsafe.Pointer(bp + 40)).FncFlags = NC_UUpsert
 139459 
 139460 	v = Xsqlite3GetVdbe(tls, pParse)
 139461 	if !(v == uintptr(0)) {
 139462 		goto __14
 139463 	}
 139464 	goto update_cleanup
 139465 __14:
 139466 	;
 139467 	chngRowid = libc.AssignUint8(&chngPk, U8(0))
 139468 	i = 0
 139469 __15:
 139470 	if !(i < (*ExprList)(unsafe.Pointer(pChanges)).FnExpr) {
 139471 		goto __17
 139472 	}
 139473 	hCol = Xsqlite3StrIHash(tls, (*ExprList_item)(unsafe.Pointer(pChanges+8+uintptr(i)*32)).FzEName)
 139474 
 139475 	if !(nChangeFrom == 0 && Xsqlite3ResolveExprNames(tls, bp+40, (*ExprList_item)(unsafe.Pointer(pChanges+8+uintptr(i)*32)).FpExpr) != 0) {
 139476 		goto __18
 139477 	}
 139478 	goto update_cleanup
 139479 __18:
 139480 	;
 139481 	j = 0
 139482 __19:
 139483 	if !(j < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 139484 		goto __21
 139485 	}
 139486 	if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*24)).FhName) == int32(hCol) &&
 139487 		Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*24)).FzCnName, (*ExprList_item)(unsafe.Pointer(pChanges+8+uintptr(i)*32)).FzEName) == 0) {
 139488 		goto __22
 139489 	}
 139490 	if !(j == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) {
 139491 		goto __23
 139492 	}
 139493 	chngRowid = U8(1)
 139494 	pRowidExpr = (*ExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32)).FpExpr
 139495 	iRowidExpr = i
 139496 	goto __24
 139497 __23:
 139498 	if !(pPk != 0 && int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*24)).FcolFlags)&COLFLAG_PRIMKEY != 0) {
 139499 		goto __25
 139500 	}
 139501 	chngPk = U8(1)
 139502 	goto __26
 139503 __25:
 139504 	if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*24)).FcolFlags)&COLFLAG_GENERATED != 0) {
 139505 		goto __27
 139506 	}
 139507 
 139508 	Xsqlite3ErrorMsg(tls, pParse,
 139509 		ts+21908,
 139510 		libc.VaList(bp, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*24)).FzCnName))
 139511 	goto update_cleanup
 139512 __27:
 139513 	;
 139514 __26:
 139515 	;
 139516 __24:
 139517 	;
 139518 	*(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i
 139519 	goto __21
 139520 __22:
 139521 	;
 139522 	goto __20
 139523 __20:
 139524 	j++
 139525 	goto __19
 139526 	goto __21
 139527 __21:
 139528 	;
 139529 	if !(j >= int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 139530 		goto __28
 139531 	}
 139532 	if !(pPk == uintptr(0) && Xsqlite3IsRowid(tls, (*ExprList_item)(unsafe.Pointer(pChanges+8+uintptr(i)*32)).FzEName) != 0) {
 139533 		goto __29
 139534 	}
 139535 	j = -1
 139536 	chngRowid = U8(1)
 139537 	pRowidExpr = (*ExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32)).FpExpr
 139538 	iRowidExpr = i
 139539 	goto __30
 139540 __29:
 139541 	Xsqlite3ErrorMsg(tls, pParse, ts+21944, libc.VaList(bp+8, (*ExprList_item)(unsafe.Pointer(pChanges+8+uintptr(i)*32)).FzEName))
 139542 	(*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1)
 139543 	goto update_cleanup
 139544 __30:
 139545 	;
 139546 __28:
 139547 	;
 139548 	rc = Xsqlite3AuthCheck(tls, pParse, SQLITE_UPDATE, (*Table)(unsafe.Pointer(pTab)).FzName,
 139549 		func() uintptr {
 139550 			if j < 0 {
 139551 				return ts + 9065
 139552 			}
 139553 			return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*24)).FzCnName
 139554 		}(),
 139555 		(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName)
 139556 	if !(rc == SQLITE_DENY) {
 139557 		goto __31
 139558 	}
 139559 	goto update_cleanup
 139560 	goto __32
 139561 __31:
 139562 	if !(rc == SQLITE_IGNORE) {
 139563 		goto __33
 139564 	}
 139565 	*(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = -1
 139566 __33:
 139567 	;
 139568 __32:
 139569 	;
 139570 	goto __16
 139571 __16:
 139572 	i++
 139573 	goto __15
 139574 	goto __17
 139575 __17:
 139576 	;
 139577 	chngKey = U8(int32(chngRowid) + int32(chngPk))
 139578 
 139579 	if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasGenerated) != 0) {
 139580 		goto __34
 139581 	}
 139582 
 139583 __35:
 139584 	bProgress = 0
 139585 	i = 0
 139586 __38:
 139587 	if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 139588 		goto __40
 139589 	}
 139590 	if !(*(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0) {
 139591 		goto __41
 139592 	}
 139593 	goto __39
 139594 __41:
 139595 	;
 139596 	if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24)).FcolFlags)&COLFLAG_GENERATED == 0) {
 139597 		goto __42
 139598 	}
 139599 	goto __39
 139600 __42:
 139601 	;
 139602 	if !(Xsqlite3ExprReferencesUpdatedColumn(tls,
 139603 		Xsqlite3ColumnExpr(tls, pTab, (*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24),
 139604 		aXRef, int32(chngRowid)) != 0) {
 139605 		goto __43
 139606 	}
 139607 	*(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) = 99999
 139608 	bProgress = 1
 139609 __43:
 139610 	;
 139611 	goto __39
 139612 __39:
 139613 	i++
 139614 	goto __38
 139615 	goto __40
 139616 __40:
 139617 	;
 139618 	goto __36
 139619 __36:
 139620 	if bProgress != 0 {
 139621 		goto __35
 139622 	}
 139623 	goto __37
 139624 __37:
 139625 	;
 139626 __34:
 139627 	;
 139628 	(*SrcItem)(unsafe.Pointer(pTabList + 8)).FcolUsed = func() uint64 {
 139629 		if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
 139630 			return libc.Uint64(libc.Uint64FromInt32(-1))
 139631 		}
 139632 		return uint64(0)
 139633 	}()
 139634 
 139635 	hasFK = Xsqlite3FkRequired(tls, pParse, pTab, aXRef, int32(chngKey))
 139636 
 139637 	if !(onError == OE_Replace) {
 139638 		goto __44
 139639 	}
 139640 	*(*int32)(unsafe.Pointer(bp + 104)) = 1
 139641 __44:
 139642 	;
 139643 	nAllIdx = 0
 139644 	pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex
 139645 __45:
 139646 	if !(pIdx != 0) {
 139647 		goto __47
 139648 	}
 139649 	if !(chngKey != 0 || hasFK > 1 || pIdx == pPk ||
 139650 		indexWhereClauseMightChange(tls, pIdx, aXRef, int32(chngRowid)) != 0) {
 139651 		goto __48
 139652 	}
 139653 	reg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 139654 	*(*int32)(unsafe.Pointer(pParse + 56)) += int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
 139655 	goto __49
 139656 __48:
 139657 	reg = 0
 139658 	i = 0
 139659 __50:
 139660 	if !(i < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)) {
 139661 		goto __52
 139662 	}
 139663 	if !(indexColumnIsBeingUpdated(tls, pIdx, i, aXRef, int32(chngRowid)) != 0) {
 139664 		goto __53
 139665 	}
 139666 	reg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 139667 	*(*int32)(unsafe.Pointer(pParse + 56)) += int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
 139668 	if !(onError == OE_Default && int32((*Index)(unsafe.Pointer(pIdx)).FonError) == OE_Replace) {
 139669 		goto __54
 139670 	}
 139671 	*(*int32)(unsafe.Pointer(bp + 104)) = 1
 139672 __54:
 139673 	;
 139674 	goto __52
 139675 __53:
 139676 	;
 139677 	goto __51
 139678 __51:
 139679 	i++
 139680 	goto __50
 139681 	goto __52
 139682 __52:
 139683 	;
 139684 __49:
 139685 	;
 139686 	if !(reg == 0) {
 139687 		goto __55
 139688 	}
 139689 	*(*U8)(unsafe.Pointer(aToOpen + uintptr(nAllIdx+1))) = U8(0)
 139690 __55:
 139691 	;
 139692 	*(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = reg
 139693 	goto __46
 139694 __46:
 139695 	pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
 139696 	nAllIdx++
 139697 	goto __45
 139698 	goto __47
 139699 __47:
 139700 	;
 139701 	*(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 139702 	if !(*(*int32)(unsafe.Pointer(bp + 104)) != 0) {
 139703 		goto __56
 139704 	}
 139705 
 139706 	libc.Xmemset(tls, aToOpen, 1, uint64(nIdx+1))
 139707 __56:
 139708 	;
 139709 	if !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) {
 139710 		goto __57
 139711 	}
 139712 	Xsqlite3VdbeCountChanges(tls, v)
 139713 __57:
 139714 	;
 139715 	Xsqlite3BeginWriteOperation(tls, pParse, libc.Bool32(pTrigger != 0 || hasFK != 0), iDb)
 139716 
 139717 	if !!(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
 139718 		goto __58
 139719 	}
 139720 
 139721 	regRowSet = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4))
 139722 	regOldRowid = libc.AssignInt32(&regNewRowid, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
 139723 	if !(chngPk != 0 || pTrigger != 0 || hasFK != 0) {
 139724 		goto __59
 139725 	}
 139726 	regOld = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 139727 	*(*int32)(unsafe.Pointer(pParse + 56)) += int32((*Table)(unsafe.Pointer(pTab)).FnCol)
 139728 __59:
 139729 	;
 139730 	if !(chngKey != 0 || pTrigger != 0 || hasFK != 0) {
 139731 		goto __60
 139732 	}
 139733 	regNewRowid = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 139734 __60:
 139735 	;
 139736 	regNew = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 139737 	*(*int32)(unsafe.Pointer(pParse + 56)) += int32((*Table)(unsafe.Pointer(pTab)).FnCol)
 139738 __58:
 139739 	;
 139740 	if !(isView != 0) {
 139741 		goto __61
 139742 	}
 139743 	Xsqlite3AuthContextPush(tls, pParse, bp+16, (*Table)(unsafe.Pointer(pTab)).FzName)
 139744 __61:
 139745 	;
 139746 	if !(nChangeFrom == 0 && isView != 0) {
 139747 		goto __62
 139748 	}
 139749 	Xsqlite3MaterializeView(tls, pParse, pTab,
 139750 		pWhere, pOrderBy, pLimit, iDataCur)
 139751 	pOrderBy = uintptr(0)
 139752 	pLimit = uintptr(0)
 139753 __62:
 139754 	;
 139755 	if !(nChangeFrom == 0 && Xsqlite3ResolveExprNames(tls, bp+40, pWhere) != 0) {
 139756 		goto __63
 139757 	}
 139758 	goto update_cleanup
 139759 __63:
 139760 	;
 139761 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
 139762 		goto __64
 139763 	}
 139764 	updateVirtualTable(tls, pParse, pTabList, pTab, pChanges, pRowidExpr, aXRef,
 139765 		pWhere, onError)
 139766 	goto update_cleanup
 139767 __64:
 139768 	;
 139769 	labelContinue = libc.AssignInt32(&labelBreak, Xsqlite3VdbeMakeLabel(tls, pParse))
 139770 
 139771 	if !((*Sqlite3)(unsafe.Pointer(db)).Fflags&(uint64(0x00001)<<32) != uint64(0) &&
 139772 		!(int32((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0) &&
 139773 		!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) &&
 139774 		!(int32((*Parse)(unsafe.Pointer(pParse)).FbReturning) != 0) &&
 139775 		pUpsert == uintptr(0)) {
 139776 		goto __65
 139777 	}
 139778 	regRowCount = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 139779 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regRowCount)
 139780 __65:
 139781 	;
 139782 	if !(nChangeFrom == 0 && (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 139783 		goto __66
 139784 	}
 139785 	Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, regRowSet, regOldRowid)
 139786 	iEph = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 139787 	addrOpen = Xsqlite3VdbeAddOp3(tls, v, OP_OpenEphemeral, iEph, 0, regRowSet)
 139788 	goto __67
 139789 __66:
 139790 	;
 139791 	if pPk != 0 {
 139792 		nPk = int16((*Index)(unsafe.Pointer(pPk)).FnKeyCol)
 139793 	} else {
 139794 		nPk = int16(0)
 139795 	}
 139796 	iPk = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 139797 	*(*int32)(unsafe.Pointer(pParse + 56)) += int32(nPk)
 139798 	*(*int32)(unsafe.Pointer(pParse + 56)) += nChangeFrom
 139799 	regKey = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 139800 	if !(pUpsert == uintptr(0)) {
 139801 		goto __68
 139802 	}
 139803 	nEphCol = int32(nPk) + nChangeFrom + func() int32 {
 139804 		if isView != 0 {
 139805 			return int32((*Table)(unsafe.Pointer(pTab)).FnCol)
 139806 		}
 139807 		return 0
 139808 	}()
 139809 	iEph = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 139810 	if !(pPk != 0) {
 139811 		goto __69
 139812 	}
 139813 	Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, iPk, iPk+int32(nPk)-1)
 139814 __69:
 139815 	;
 139816 	addrOpen = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, iEph, nEphCol)
 139817 	if !(pPk != 0) {
 139818 		goto __70
 139819 	}
 139820 	pKeyInfo = Xsqlite3KeyInfoOfIndex(tls, pParse, pPk)
 139821 	if !(pKeyInfo != 0) {
 139822 		goto __71
 139823 	}
 139824 	(*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField = U16(nEphCol)
 139825 	Xsqlite3VdbeAppendP4(tls, v, pKeyInfo, -8)
 139826 __71:
 139827 	;
 139828 __70:
 139829 	;
 139830 	if !(nChangeFrom != 0) {
 139831 		goto __72
 139832 	}
 139833 	updateFromSelect(tls,
 139834 		pParse, iEph, pPk, pChanges, pTabList, pWhere, pOrderBy, pLimit)
 139835 	if !(isView != 0) {
 139836 		goto __73
 139837 	}
 139838 	iDataCur = iEph
 139839 __73:
 139840 	;
 139841 __72:
 139842 	;
 139843 __68:
 139844 	;
 139845 __67:
 139846 	;
 139847 	if !(nChangeFrom != 0) {
 139848 		goto __74
 139849 	}
 139850 	Xsqlite3MultiWrite(tls, pParse)
 139851 	eOnePass = ONEPASS_OFF
 139852 	nKey = int32(nPk)
 139853 	regKey = iPk
 139854 	goto __75
 139855 __74:
 139856 	if !(pUpsert != 0) {
 139857 		goto __76
 139858 	}
 139859 
 139860 	pWInfo = uintptr(0)
 139861 	eOnePass = ONEPASS_SINGLE
 139862 	Xsqlite3ExprIfFalse(tls, pParse, pWhere, labelBreak, SQLITE_JUMPIFNULL)
 139863 	bFinishSeek = 0
 139864 	goto __77
 139865 __76:
 139866 	flags = WHERE_ONEPASS_DESIRED
 139867 	if !(!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) &&
 139868 		!(pTrigger != 0) &&
 139869 		!(hasFK != 0) &&
 139870 		!(chngKey != 0) &&
 139871 		!(*(*int32)(unsafe.Pointer(bp + 104)) != 0) &&
 139872 		(*NameContext)(unsafe.Pointer(bp+40)).FncFlags&NC_Subquery == 0) {
 139873 		goto __78
 139874 	}
 139875 	flags = flags | WHERE_ONEPASS_MULTIROW
 139876 __78:
 139877 	;
 139878 	pWInfo = Xsqlite3WhereBegin(tls, pParse, pTabList, pWhere, uintptr(0), uintptr(0), uintptr(0), uint16(flags), iIdxCur)
 139879 	if !(pWInfo == uintptr(0)) {
 139880 		goto __79
 139881 	}
 139882 	goto update_cleanup
 139883 __79:
 139884 	;
 139885 	eOnePass = Xsqlite3WhereOkOnePass(tls, pWInfo, bp+96)
 139886 	bFinishSeek = Xsqlite3WhereUsesDeferredSeek(tls, pWInfo)
 139887 	if !(eOnePass != ONEPASS_SINGLE) {
 139888 		goto __80
 139889 	}
 139890 	Xsqlite3MultiWrite(tls, pParse)
 139891 	if !(eOnePass == ONEPASS_MULTI) {
 139892 		goto __81
 139893 	}
 139894 	iCur = *(*int32)(unsafe.Pointer(bp + 96 + 1*4))
 139895 	if !(iCur >= 0 && iCur != iDataCur && *(*U8)(unsafe.Pointer(aToOpen + uintptr(iCur-iBaseCur))) != 0) {
 139896 		goto __82
 139897 	}
 139898 	eOnePass = ONEPASS_OFF
 139899 __82:
 139900 	;
 139901 __81:
 139902 	;
 139903 __80:
 139904 	;
 139905 __77:
 139906 	;
 139907 	if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 139908 		goto __83
 139909 	}
 139910 
 139911 	Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iDataCur, regOldRowid)
 139912 	if !(eOnePass == ONEPASS_OFF) {
 139913 		goto __85
 139914 	}
 139915 	*(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 139916 	Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iEph, regRowSet, regOldRowid)
 139917 	goto __86
 139918 __85:
 139919 	if !(addrOpen != 0) {
 139920 		goto __87
 139921 	}
 139922 	Xsqlite3VdbeChangeToNoop(tls, v, addrOpen)
 139923 __87:
 139924 	;
 139925 __86:
 139926 	;
 139927 	goto __84
 139928 __83:
 139929 	i = 0
 139930 __88:
 139931 	if !(i < int32(nPk)) {
 139932 		goto __90
 139933 	}
 139934 
 139935 	Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur,
 139936 		int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))), iPk+i)
 139937 	goto __89
 139938 __89:
 139939 	i++
 139940 	goto __88
 139941 	goto __90
 139942 __90:
 139943 	;
 139944 	if !(eOnePass != 0) {
 139945 		goto __91
 139946 	}
 139947 	if !(addrOpen != 0) {
 139948 		goto __93
 139949 	}
 139950 	Xsqlite3VdbeChangeToNoop(tls, v, addrOpen)
 139951 __93:
 139952 	;
 139953 	nKey = int32(nPk)
 139954 	regKey = iPk
 139955 	goto __92
 139956 __91:
 139957 	Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, iPk, int32(nPk), regKey,
 139958 		Xsqlite3IndexAffinityStr(tls, db, pPk), int32(nPk))
 139959 	Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iEph, regKey, iPk, int32(nPk))
 139960 __92:
 139961 	;
 139962 __84:
 139963 	;
 139964 __75:
 139965 	;
 139966 	if !(pUpsert == uintptr(0)) {
 139967 		goto __94
 139968 	}
 139969 	if !(nChangeFrom == 0 && eOnePass != ONEPASS_MULTI) {
 139970 		goto __95
 139971 	}
 139972 	Xsqlite3WhereEnd(tls, pWInfo)
 139973 __95:
 139974 	;
 139975 	if !!(isView != 0) {
 139976 		goto __96
 139977 	}
 139978 	addrOnce = 0
 139979 
 139980 	if !(eOnePass != ONEPASS_OFF) {
 139981 		goto __97
 139982 	}
 139983 	if !(*(*int32)(unsafe.Pointer(bp + 96)) >= 0) {
 139984 		goto __98
 139985 	}
 139986 	*(*U8)(unsafe.Pointer(aToOpen + uintptr(*(*int32)(unsafe.Pointer(bp + 96))-iBaseCur))) = U8(0)
 139987 __98:
 139988 	;
 139989 	if !(*(*int32)(unsafe.Pointer(bp + 96 + 1*4)) >= 0) {
 139990 		goto __99
 139991 	}
 139992 	*(*U8)(unsafe.Pointer(aToOpen + uintptr(*(*int32)(unsafe.Pointer(bp + 96 + 1*4))-iBaseCur))) = U8(0)
 139993 __99:
 139994 	;
 139995 __97:
 139996 	;
 139997 	if !(eOnePass == ONEPASS_MULTI && nIdx-libc.Bool32(*(*int32)(unsafe.Pointer(bp + 96 + 1*4)) >= 0) > 0) {
 139998 		goto __100
 139999 	}
 140000 	addrOnce = Xsqlite3VdbeAddOp0(tls, v, OP_Once)
 140001 __100:
 140002 	;
 140003 	Xsqlite3OpenTableAndIndices(tls, pParse, pTab, OP_OpenWrite, uint8(0), iBaseCur,
 140004 		aToOpen, uintptr(0), uintptr(0))
 140005 	if !(addrOnce != 0) {
 140006 		goto __101
 140007 	}
 140008 	Xsqlite3VdbeJumpHereOrPopInst(tls, v, addrOnce)
 140009 __101:
 140010 	;
 140011 __96:
 140012 	;
 140013 	if !(eOnePass != ONEPASS_OFF) {
 140014 		goto __102
 140015 	}
 140016 	if !(*(*int32)(unsafe.Pointer(bp + 96)) != iDataCur &&
 140017 		*(*int32)(unsafe.Pointer(bp + 96 + 1*4)) != iDataCur) {
 140018 		goto __104
 140019 	}
 140020 
 140021 	Xsqlite3VdbeAddOp4Int(tls, v, OP_NotFound, iDataCur, labelBreak, regKey, nKey)
 140022 
 140023 __104:
 140024 	;
 140025 	if !(eOnePass != ONEPASS_SINGLE) {
 140026 		goto __105
 140027 	}
 140028 	labelContinue = Xsqlite3VdbeMakeLabel(tls, pParse)
 140029 __105:
 140030 	;
 140031 	Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, func() int32 {
 140032 		if pPk != 0 {
 140033 			return regKey
 140034 		}
 140035 		return regOldRowid
 140036 	}(), labelBreak)
 140037 
 140038 	goto __103
 140039 __102:
 140040 	if !(pPk != 0 || nChangeFrom != 0) {
 140041 		goto __106
 140042 	}
 140043 	labelContinue = Xsqlite3VdbeMakeLabel(tls, pParse)
 140044 	Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, iEph, labelBreak)
 140045 	addrTop = Xsqlite3VdbeCurrentAddr(tls, v)
 140046 	if !(nChangeFrom != 0) {
 140047 		goto __108
 140048 	}
 140049 	if !!(isView != 0) {
 140050 		goto __110
 140051 	}
 140052 	if !(pPk != 0) {
 140053 		goto __111
 140054 	}
 140055 	i = 0
 140056 __113:
 140057 	if !(i < int32(nPk)) {
 140058 		goto __115
 140059 	}
 140060 	Xsqlite3VdbeAddOp3(tls, v, OP_Column, iEph, i, iPk+i)
 140061 	goto __114
 140062 __114:
 140063 	i++
 140064 	goto __113
 140065 	goto __115
 140066 __115:
 140067 	;
 140068 	Xsqlite3VdbeAddOp4Int(tls,
 140069 		v, OP_NotFound, iDataCur, labelContinue, iPk, int32(nPk))
 140070 	goto __112
 140071 __111:
 140072 	Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iEph, regOldRowid)
 140073 	Xsqlite3VdbeAddOp3(tls,
 140074 		v, OP_NotExists, iDataCur, labelContinue, regOldRowid)
 140075 __112:
 140076 	;
 140077 __110:
 140078 	;
 140079 	goto __109
 140080 __108:
 140081 	Xsqlite3VdbeAddOp2(tls, v, OP_RowData, iEph, regKey)
 140082 	Xsqlite3VdbeAddOp4Int(tls, v, OP_NotFound, iDataCur, labelContinue, regKey, 0)
 140083 
 140084 __109:
 140085 	;
 140086 	goto __107
 140087 __106:
 140088 	Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, iEph, labelBreak)
 140089 	labelContinue = Xsqlite3VdbeMakeLabel(tls, pParse)
 140090 	addrTop = Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iEph, regOldRowid)
 140091 
 140092 	Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDataCur, labelContinue, regOldRowid)
 140093 
 140094 __107:
 140095 	;
 140096 __103:
 140097 	;
 140098 __94:
 140099 	;
 140100 	if !(chngRowid != 0) {
 140101 		goto __116
 140102 	}
 140103 
 140104 	if !(nChangeFrom == 0) {
 140105 		goto __117
 140106 	}
 140107 	Xsqlite3ExprCode(tls, pParse, pRowidExpr, regNewRowid)
 140108 	goto __118
 140109 __117:
 140110 	Xsqlite3VdbeAddOp3(tls, v, OP_Column, iEph, iRowidExpr, regNewRowid)
 140111 __118:
 140112 	;
 140113 	Xsqlite3VdbeAddOp1(tls, v, OP_MustBeInt, regNewRowid)
 140114 __116:
 140115 	;
 140116 	if !(chngPk != 0 || hasFK != 0 || pTrigger != 0) {
 140117 		goto __119
 140118 	}
 140119 	oldmask = func() uint32 {
 140120 		if hasFK != 0 {
 140121 			return Xsqlite3FkOldmask(tls, pParse, pTab)
 140122 		}
 140123 		return uint32(0)
 140124 	}()
 140125 	oldmask = oldmask | Xsqlite3TriggerColmask(tls, pParse,
 140126 		pTrigger, pChanges, 0, TRIGGER_BEFORE|TRIGGER_AFTER, pTab, onError)
 140127 	i = 0
 140128 __120:
 140129 	if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 140130 		goto __122
 140131 	}
 140132 	colFlags = U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*24)).FcolFlags)
 140133 	k = int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(i))) + regOld
 140134 	if !(oldmask == 0xffffffff ||
 140135 		i < 32 && oldmask&(uint32(1)<<i) != U32(0) ||
 140136 		colFlags&U32(COLFLAG_PRIMKEY) != U32(0)) {
 140137 		goto __123
 140138 	}
 140139 
 140140 	Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k)
 140141 	goto __124
 140142 __123:
 140143 	Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, k)
 140144 __124:
 140145 	;
 140146 	goto __121
 140147 __121:
 140148 	i++
 140149 	goto __120
 140150 	goto __122
 140151 __122:
 140152 	;
 140153 	if !(int32(chngRowid) == 0 && pPk == uintptr(0)) {
 140154 		goto __125
 140155 	}
 140156 	Xsqlite3VdbeAddOp2(tls, v, OP_Copy, regOldRowid, regNewRowid)
 140157 __125:
 140158 	;
 140159 __119:
 140160 	;
 140161 	newmask = int32(Xsqlite3TriggerColmask(tls,
 140162 		pParse, pTrigger, pChanges, 1, TRIGGER_BEFORE, pTab, onError))
 140163 	i = 0
 140164 	k = regNew
 140165 __126:
 140166 	if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 140167 		goto __128
 140168 	}
 140169 	if !(i == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) {
 140170 		goto __129
 140171 	}
 140172 	Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, k)
 140173 	goto __130
 140174 __129:
 140175 	if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24)).FcolFlags)&COLFLAG_GENERATED != 0) {
 140176 		goto __131
 140177 	}
 140178 	if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24)).FcolFlags)&COLFLAG_VIRTUAL != 0) {
 140179 		goto __133
 140180 	}
 140181 	k--
 140182 __133:
 140183 	;
 140184 	goto __132
 140185 __131:
 140186 	j = *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4))
 140187 	if !(j >= 0) {
 140188 		goto __134
 140189 	}
 140190 	if !(nChangeFrom != 0) {
 140191 		goto __136
 140192 	}
 140193 	nOff = func() int32 {
 140194 		if isView != 0 {
 140195 			return int32((*Table)(unsafe.Pointer(pTab)).FnCol)
 140196 		}
 140197 		return int32(nPk)
 140198 	}()
 140199 
 140200 	Xsqlite3VdbeAddOp3(tls, v, OP_Column, iEph, nOff+j, k)
 140201 	goto __137
 140202 __136:
 140203 	Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(pChanges+8+uintptr(j)*32)).FpExpr, k)
 140204 __137:
 140205 	;
 140206 	goto __135
 140207 __134:
 140208 	if !(0 == *(*int32)(unsafe.Pointer(bp + 32))&TRIGGER_BEFORE || i > 31 || uint32(newmask)&(uint32(1)<<i) != 0) {
 140209 		goto __138
 140210 	}
 140211 
 140212 	Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k)
 140213 	bFinishSeek = 0
 140214 	goto __139
 140215 __138:
 140216 	Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, k)
 140217 __139:
 140218 	;
 140219 __135:
 140220 	;
 140221 __132:
 140222 	;
 140223 __130:
 140224 	;
 140225 	goto __127
 140226 __127:
 140227 	i++
 140228 	k++
 140229 	goto __126
 140230 	goto __128
 140231 __128:
 140232 	;
 140233 	if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasGenerated) != 0) {
 140234 		goto __140
 140235 	}
 140236 
 140237 	Xsqlite3ComputeGeneratedColumns(tls, pParse, regNew, pTab)
 140238 __140:
 140239 	;
 140240 	if !(*(*int32)(unsafe.Pointer(bp + 32))&TRIGGER_BEFORE != 0) {
 140241 		goto __141
 140242 	}
 140243 	Xsqlite3TableAffinity(tls, v, pTab, regNew)
 140244 	Xsqlite3CodeRowTrigger(tls, pParse, pTrigger, TK_UPDATE, pChanges,
 140245 		TRIGGER_BEFORE, pTab, regOldRowid, onError, labelContinue)
 140246 
 140247 	if !!(isView != 0) {
 140248 		goto __142
 140249 	}
 140250 
 140251 	if !(pPk != 0) {
 140252 		goto __143
 140253 	}
 140254 	Xsqlite3VdbeAddOp4Int(tls, v, OP_NotFound, iDataCur, labelContinue, regKey, nKey)
 140255 
 140256 	goto __144
 140257 __143:
 140258 	Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDataCur, labelContinue, regOldRowid)
 140259 
 140260 __144:
 140261 	;
 140262 	i = 0
 140263 	k = regNew
 140264 __145:
 140265 	if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 140266 		goto __147
 140267 	}
 140268 	if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24)).FcolFlags)&COLFLAG_GENERATED != 0) {
 140269 		goto __148
 140270 	}
 140271 	if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24)).FcolFlags)&COLFLAG_VIRTUAL != 0) {
 140272 		goto __150
 140273 	}
 140274 	k--
 140275 __150:
 140276 	;
 140277 	goto __149
 140278 __148:
 140279 	if !(*(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) < 0 && i != int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) {
 140280 		goto __151
 140281 	}
 140282 	Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k)
 140283 __151:
 140284 	;
 140285 __149:
 140286 	;
 140287 	goto __146
 140288 __146:
 140289 	i++
 140290 	k++
 140291 	goto __145
 140292 	goto __147
 140293 __147:
 140294 	;
 140295 	if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasGenerated) != 0) {
 140296 		goto __152
 140297 	}
 140298 
 140299 	Xsqlite3ComputeGeneratedColumns(tls, pParse, regNew, pTab)
 140300 __152:
 140301 	;
 140302 __142:
 140303 	;
 140304 __141:
 140305 	;
 140306 	if !!(isView != 0) {
 140307 		goto __153
 140308 	}
 140309 
 140310 	Xsqlite3GenerateConstraintChecks(tls, pParse, pTab, aRegIdx, iDataCur, iIdxCur,
 140311 		regNewRowid, regOldRowid, chngKey, uint8(onError), labelContinue, bp+104,
 140312 		aXRef, uintptr(0))
 140313 
 140314 	if !(*(*int32)(unsafe.Pointer(bp + 104)) != 0 || chngKey != 0) {
 140315 		goto __154
 140316 	}
 140317 	if !(pPk != 0) {
 140318 		goto __155
 140319 	}
 140320 	Xsqlite3VdbeAddOp4Int(tls, v, OP_NotFound, iDataCur, labelContinue, regKey, nKey)
 140321 	goto __156
 140322 __155:
 140323 	Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDataCur, labelContinue, regOldRowid)
 140324 __156:
 140325 	;
 140326 __154:
 140327 	;
 140328 	if !(hasFK != 0) {
 140329 		goto __157
 140330 	}
 140331 	Xsqlite3FkCheck(tls, pParse, pTab, regOldRowid, 0, aXRef, int32(chngKey))
 140332 __157:
 140333 	;
 140334 	Xsqlite3GenerateRowIndexDelete(tls, pParse, pTab, iDataCur, iIdxCur, aRegIdx, -1)
 140335 
 140336 	if !(bFinishSeek != 0) {
 140337 		goto __158
 140338 	}
 140339 	Xsqlite3VdbeAddOp1(tls, v, OP_FinishSeek, iDataCur)
 140340 __158:
 140341 	;
 140342 	Xsqlite3VdbeAddOp3(tls, v, OP_Delete, iDataCur,
 140343 		OPFLAG_ISUPDATE|func() int32 {
 140344 			if hasFK > 1 || chngKey != 0 {
 140345 				return 0
 140346 			}
 140347 			return OPFLAG_ISNOOP
 140348 		}(),
 140349 		regNewRowid)
 140350 	if !(eOnePass == ONEPASS_MULTI) {
 140351 		goto __159
 140352 	}
 140353 
 140354 	Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION))
 140355 __159:
 140356 	;
 140357 	if !!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) {
 140358 		goto __160
 140359 	}
 140360 	Xsqlite3VdbeAppendP4(tls, v, pTab, -5)
 140361 __160:
 140362 	;
 140363 	if !(hasFK != 0) {
 140364 		goto __161
 140365 	}
 140366 	Xsqlite3FkCheck(tls, pParse, pTab, 0, regNewRowid, aXRef, int32(chngKey))
 140367 __161:
 140368 	;
 140369 	Xsqlite3CompleteInsertion(tls,
 140370 		pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx,
 140371 		OPFLAG_ISUPDATE|func() int32 {
 140372 			if eOnePass == ONEPASS_MULTI {
 140373 				return OPFLAG_SAVEPOSITION
 140374 			}
 140375 			return 0
 140376 		}(),
 140377 		0, 0)
 140378 
 140379 	if !(hasFK != 0) {
 140380 		goto __162
 140381 	}
 140382 	Xsqlite3FkActions(tls, pParse, pTab, pChanges, regOldRowid, aXRef, int32(chngKey))
 140383 __162:
 140384 	;
 140385 __153:
 140386 	;
 140387 	if !(regRowCount != 0) {
 140388 		goto __163
 140389 	}
 140390 	Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, regRowCount, 1)
 140391 __163:
 140392 	;
 140393 	Xsqlite3CodeRowTrigger(tls, pParse, pTrigger, TK_UPDATE, pChanges,
 140394 		TRIGGER_AFTER, pTab, regOldRowid, onError, labelContinue)
 140395 
 140396 	if !(eOnePass == ONEPASS_SINGLE) {
 140397 		goto __164
 140398 	}
 140399 
 140400 	goto __165
 140401 __164:
 140402 	if !(eOnePass == ONEPASS_MULTI) {
 140403 		goto __166
 140404 	}
 140405 	Xsqlite3VdbeResolveLabel(tls, v, labelContinue)
 140406 	Xsqlite3WhereEnd(tls, pWInfo)
 140407 	goto __167
 140408 __166:
 140409 	Xsqlite3VdbeResolveLabel(tls, v, labelContinue)
 140410 	Xsqlite3VdbeAddOp2(tls, v, OP_Next, iEph, addrTop)
 140411 __167:
 140412 	;
 140413 __165:
 140414 	;
 140415 	Xsqlite3VdbeResolveLabel(tls, v, labelBreak)
 140416 
 140417 	if !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab == uintptr(0) && pUpsert == uintptr(0)) {
 140418 		goto __168
 140419 	}
 140420 	Xsqlite3AutoincrementEnd(tls, pParse)
 140421 __168:
 140422 	;
 140423 	if !(regRowCount != 0) {
 140424 		goto __169
 140425 	}
 140426 	Xsqlite3CodeChangeCount(tls, v, regRowCount, ts+21963)
 140427 __169:
 140428 	;
 140429 update_cleanup:
 140430 	Xsqlite3AuthContextPop(tls, bp+16)
 140431 	Xsqlite3DbFree(tls, db, aXRef)
 140432 	Xsqlite3SrcListDelete(tls, db, pTabList)
 140433 	Xsqlite3ExprListDelete(tls, db, pChanges)
 140434 	Xsqlite3ExprDelete(tls, db, pWhere)
 140435 	return
 140436 }
 140437 
 140438 func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, pChanges uintptr, pRowid uintptr, aXRef uintptr, pWhere uintptr, onError int32) {
 140439 	bp := tls.Alloc(8)
 140440 	defer tls.Free(8)
 140441 
 140442 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 140443 	var ephemTab int32
 140444 	var i int32
 140445 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 140446 	var pVTab uintptr = Xsqlite3GetVTable(tls, db, pTab)
 140447 	var pWInfo uintptr = uintptr(0)
 140448 	var nArg int32 = 2 + int32((*Table)(unsafe.Pointer(pTab)).FnCol)
 140449 	var regArg int32
 140450 	var regRec int32
 140451 	var regRowid int32
 140452 	var iCsr int32 = (*SrcItem)(unsafe.Pointer(pSrc + 8)).FiCursor
 140453 
 140454 	var eOnePass int32
 140455 	var addr int32
 140456 
 140457 	ephemTab = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 140458 	addr = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, ephemTab, nArg)
 140459 	regArg = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 140460 	*(*int32)(unsafe.Pointer(pParse + 56)) += nArg
 140461 	if (*SrcList)(unsafe.Pointer(pSrc)).FnSrc > 1 {
 140462 		var pPk uintptr = uintptr(0)
 140463 		var pRow uintptr
 140464 		var pList uintptr
 140465 		if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
 140466 			if pRowid != 0 {
 140467 				pRow = Xsqlite3ExprDup(tls, db, pRowid, 0)
 140468 			} else {
 140469 				pRow = Xsqlite3PExpr(tls, pParse, TK_ROW, uintptr(0), uintptr(0))
 140470 			}
 140471 		} else {
 140472 			var iPk I16
 140473 			pPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
 140474 
 140475 			iPk = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn))
 140476 			if *(*int32)(unsafe.Pointer(aXRef + uintptr(iPk)*4)) >= 0 {
 140477 				pRow = Xsqlite3ExprDup(tls, db, (*ExprList_item)(unsafe.Pointer(pChanges+8+uintptr(*(*int32)(unsafe.Pointer(aXRef + uintptr(iPk)*4)))*32)).FpExpr, 0)
 140478 			} else {
 140479 				pRow = exprRowColumn(tls, pParse, int32(iPk))
 140480 			}
 140481 		}
 140482 		pList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), pRow)
 140483 
 140484 		for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
 140485 			if *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0 {
 140486 				pList = Xsqlite3ExprListAppend(tls, pParse, pList,
 140487 					Xsqlite3ExprDup(tls, db, (*ExprList_item)(unsafe.Pointer(pChanges+8+uintptr(*(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)))*32)).FpExpr, 0))
 140488 			} else {
 140489 				pList = Xsqlite3ExprListAppend(tls, pParse, pList, exprRowColumn(tls, pParse, i))
 140490 			}
 140491 		}
 140492 
 140493 		updateFromSelect(tls, pParse, ephemTab, pPk, pList, pSrc, pWhere, uintptr(0), uintptr(0))
 140494 		Xsqlite3ExprListDelete(tls, db, pList)
 140495 		eOnePass = ONEPASS_OFF
 140496 	} else {
 140497 		regRec = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 140498 		regRowid = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 140499 
 140500 		pWInfo = Xsqlite3WhereBegin(tls,
 140501 			pParse, pSrc, pWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_ONEPASS_DESIRED), 0)
 140502 		if pWInfo == uintptr(0) {
 140503 			return
 140504 		}
 140505 
 140506 		for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
 140507 			if *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0 {
 140508 				Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(pChanges+8+uintptr(*(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)))*32)).FpExpr, regArg+2+i)
 140509 			} else {
 140510 				Xsqlite3VdbeAddOp3(tls, v, OP_VColumn, iCsr, i, regArg+2+i)
 140511 				Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_NOCHNG))
 140512 			}
 140513 		}
 140514 		if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
 140515 			Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iCsr, regArg)
 140516 			if pRowid != 0 {
 140517 				Xsqlite3ExprCode(tls, pParse, pRowid, regArg+1)
 140518 			} else {
 140519 				Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iCsr, regArg+1)
 140520 			}
 140521 		} else {
 140522 			var pPk uintptr
 140523 			var iPk I16
 140524 			pPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
 140525 
 140526 			iPk = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn))
 140527 			Xsqlite3VdbeAddOp3(tls, v, OP_VColumn, iCsr, int32(iPk), regArg)
 140528 			Xsqlite3VdbeAddOp2(tls, v, OP_SCopy, regArg+2+int32(iPk), regArg+1)
 140529 		}
 140530 
 140531 		eOnePass = Xsqlite3WhereOkOnePass(tls, pWInfo, bp)
 140532 
 140533 		if eOnePass != 0 {
 140534 			Xsqlite3VdbeChangeToNoop(tls, v, addr)
 140535 			Xsqlite3VdbeAddOp1(tls, v, OP_Close, iCsr)
 140536 		} else {
 140537 			Xsqlite3MultiWrite(tls, pParse)
 140538 			Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regArg, nArg, regRec)
 140539 			Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, ephemTab, regRowid)
 140540 			Xsqlite3VdbeAddOp3(tls, v, OP_Insert, ephemTab, regRec, regRowid)
 140541 		}
 140542 	}
 140543 
 140544 	if eOnePass == ONEPASS_OFF {
 140545 		if (*SrcList)(unsafe.Pointer(pSrc)).FnSrc == 1 {
 140546 			Xsqlite3WhereEnd(tls, pWInfo)
 140547 		}
 140548 
 140549 		addr = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, ephemTab)
 140550 
 140551 		for i = 0; i < nArg; i++ {
 140552 			Xsqlite3VdbeAddOp3(tls, v, OP_Column, ephemTab, i, regArg+i)
 140553 		}
 140554 	}
 140555 	Xsqlite3VtabMakeWritable(tls, pParse, pTab)
 140556 	Xsqlite3VdbeAddOp4(tls, v, OP_VUpdate, 0, nArg, regArg, pVTab, -11)
 140557 	Xsqlite3VdbeChangeP5(tls, v, func() uint16 {
 140558 		if onError == OE_Default {
 140559 			return uint16(OE_Abort)
 140560 		}
 140561 		return uint16(onError)
 140562 	}())
 140563 	Xsqlite3MayAbort(tls, pParse)
 140564 
 140565 	if eOnePass == ONEPASS_OFF {
 140566 		Xsqlite3VdbeAddOp2(tls, v, OP_Next, ephemTab, addr+1)
 140567 		Xsqlite3VdbeJumpHere(tls, v, addr)
 140568 		Xsqlite3VdbeAddOp2(tls, v, OP_Close, ephemTab, 0)
 140569 	} else {
 140570 		Xsqlite3WhereEnd(tls, pWInfo)
 140571 	}
 140572 }
 140573 
 140574 func upsertDelete(tls *libc.TLS, db uintptr, p uintptr) {
 140575 	for __ccgo := true; __ccgo; __ccgo = p != 0 {
 140576 		var pNext uintptr = (*Upsert)(unsafe.Pointer(p)).FpNextUpsert
 140577 		Xsqlite3ExprListDelete(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertTarget)
 140578 		Xsqlite3ExprDelete(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertTargetWhere)
 140579 		Xsqlite3ExprListDelete(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertSet)
 140580 		Xsqlite3ExprDelete(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertWhere)
 140581 		Xsqlite3DbFree(tls, db, (*Upsert)(unsafe.Pointer(p)).FpToFree)
 140582 		Xsqlite3DbFree(tls, db, p)
 140583 		p = pNext
 140584 	}
 140585 }
 140586 
 140587 func Xsqlite3UpsertDelete(tls *libc.TLS, db uintptr, p uintptr) {
 140588 	if p != 0 {
 140589 		upsertDelete(tls, db, p)
 140590 	}
 140591 }
 140592 
 140593 // Duplicate an Upsert object.
 140594 func Xsqlite3UpsertDup(tls *libc.TLS, db uintptr, p uintptr) uintptr {
 140595 	if p == uintptr(0) {
 140596 		return uintptr(0)
 140597 	}
 140598 	return Xsqlite3UpsertNew(tls, db,
 140599 		Xsqlite3ExprListDup(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertTarget, 0),
 140600 		Xsqlite3ExprDup(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertTargetWhere, 0),
 140601 		Xsqlite3ExprListDup(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertSet, 0),
 140602 		Xsqlite3ExprDup(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertWhere, 0),
 140603 		Xsqlite3UpsertDup(tls, db, (*Upsert)(unsafe.Pointer(p)).FpNextUpsert))
 140604 }
 140605 
 140606 // Create a new Upsert object.
 140607 func Xsqlite3UpsertNew(tls *libc.TLS, db uintptr, pTarget uintptr, pTargetWhere uintptr, pSet uintptr, pWhere uintptr, pNext uintptr) uintptr {
 140608 	var pNew uintptr
 140609 	pNew = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Upsert{})))
 140610 	if pNew == uintptr(0) {
 140611 		Xsqlite3ExprListDelete(tls, db, pTarget)
 140612 		Xsqlite3ExprDelete(tls, db, pTargetWhere)
 140613 		Xsqlite3ExprListDelete(tls, db, pSet)
 140614 		Xsqlite3ExprDelete(tls, db, pWhere)
 140615 		Xsqlite3UpsertDelete(tls, db, pNext)
 140616 		return uintptr(0)
 140617 	} else {
 140618 		(*Upsert)(unsafe.Pointer(pNew)).FpUpsertTarget = pTarget
 140619 		(*Upsert)(unsafe.Pointer(pNew)).FpUpsertTargetWhere = pTargetWhere
 140620 		(*Upsert)(unsafe.Pointer(pNew)).FpUpsertSet = pSet
 140621 		(*Upsert)(unsafe.Pointer(pNew)).FpUpsertWhere = pWhere
 140622 		(*Upsert)(unsafe.Pointer(pNew)).FisDoUpdate = U8(libc.Bool32(pSet != uintptr(0)))
 140623 		(*Upsert)(unsafe.Pointer(pNew)).FpNextUpsert = pNext
 140624 	}
 140625 	return pNew
 140626 }
 140627 
 140628 // Analyze the ON CONFLICT clause described by pUpsert.  Resolve all
 140629 // symbols in the conflict-target.
 140630 //
 140631 // Return SQLITE_OK if everything works, or an error code is something
 140632 // is wrong.
 140633 func Xsqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr, pUpsert uintptr) int32 {
 140634 	bp := tls.Alloc(232)
 140635 	defer tls.Free(232)
 140636 
 140637 	var pTab uintptr
 140638 	var rc int32
 140639 	var iCursor int32
 140640 	var pIdx uintptr
 140641 	var pTarget uintptr
 140642 	var pTerm uintptr
 140643 
 140644 	var nClause int32 = 0
 140645 
 140646 	libc.Xmemset(tls, bp+16, 0, uint64(unsafe.Sizeof(NameContext{})))
 140647 	(*NameContext)(unsafe.Pointer(bp + 16)).FpParse = pParse
 140648 	(*NameContext)(unsafe.Pointer(bp + 16)).FpSrcList = pTabList
 140649 __1:
 140650 	if !(pUpsert != 0 && (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget != 0) {
 140651 		goto __3
 140652 	}
 140653 	{
 140654 		rc = Xsqlite3ResolveExprListNames(tls, bp+16, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget)
 140655 		if rc != 0 {
 140656 			return rc
 140657 		}
 140658 		rc = Xsqlite3ResolveExprNames(tls, bp+16, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTargetWhere)
 140659 		if rc != 0 {
 140660 			return rc
 140661 		}
 140662 
 140663 		pTab = (*SrcItem)(unsafe.Pointer(pTabList + 8)).FpTab
 140664 		pTarget = (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget
 140665 		iCursor = (*SrcItem)(unsafe.Pointer(pTabList + 8)).FiCursor
 140666 		if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) &&
 140667 			(*ExprList)(unsafe.Pointer(pTarget)).FnExpr == 1 &&
 140668 			int32((*Expr)(unsafe.Pointer(libc.AssignUintptr(&pTerm, (*ExprList_item)(unsafe.Pointer(pTarget+8)).FpExpr))).Fop) == TK_COLUMN &&
 140669 			int32((*Expr)(unsafe.Pointer(pTerm)).FiColumn) == -1 {
 140670 			goto __2
 140671 		}
 140672 
 140673 		libc.Xmemset(tls, bp+72, 0, uint64(unsafe.Sizeof([2]Expr{})))
 140674 		(*Expr)(unsafe.Pointer(bp + 72)).Fop = U8(TK_COLLATE)
 140675 		(*Expr)(unsafe.Pointer(bp + 72)).FpLeft = bp + 72 + 1*72
 140676 		(*Expr)(unsafe.Pointer(bp + 72 + 1*72)).Fop = U8(TK_COLUMN)
 140677 		(*Expr)(unsafe.Pointer(bp + 72 + 1*72)).FiTable = (*SrcItem)(unsafe.Pointer(pTabList + 8)).FiCursor
 140678 
 140679 		for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
 140680 			var ii int32
 140681 			var jj int32
 140682 			var nn int32
 140683 			if !(int32((*Index)(unsafe.Pointer(pIdx)).FonError) != OE_None) {
 140684 				continue
 140685 			}
 140686 			if (*ExprList)(unsafe.Pointer(pTarget)).FnExpr != int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) {
 140687 				continue
 140688 			}
 140689 			if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 {
 140690 				if (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTargetWhere == uintptr(0) {
 140691 					continue
 140692 				}
 140693 				if Xsqlite3ExprCompare(tls, pParse, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTargetWhere,
 140694 					(*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere, iCursor) != 0 {
 140695 					continue
 140696 				}
 140697 			}
 140698 			nn = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
 140699 			for ii = 0; ii < nn; ii++ {
 140700 				var pExpr uintptr
 140701 				*(*uintptr)(unsafe.Pointer(bp + 72 + 8)) = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(ii)*8))
 140702 				if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(ii)*2))) == -2 {
 140703 					pExpr = (*ExprList_item)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaColExpr + 8 + uintptr(ii)*32)).FpExpr
 140704 					if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLLATE {
 140705 						(*Expr)(unsafe.Pointer(bp + 72)).FpLeft = pExpr
 140706 						pExpr = bp + 72
 140707 					}
 140708 				} else {
 140709 					(*Expr)(unsafe.Pointer(bp + 72)).FpLeft = bp + 72 + 1*72
 140710 					(*Expr)(unsafe.Pointer(bp + 72 + 1*72)).FiColumn = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(ii)*2))
 140711 					pExpr = bp + 72
 140712 				}
 140713 				for jj = 0; jj < nn; jj++ {
 140714 					if Xsqlite3ExprCompare(tls, pParse, (*ExprList_item)(unsafe.Pointer(pTarget+8+uintptr(jj)*32)).FpExpr, pExpr, iCursor) < 2 {
 140715 						break
 140716 					}
 140717 				}
 140718 				if jj >= nn {
 140719 					break
 140720 				}
 140721 			}
 140722 			if ii < nn {
 140723 				continue
 140724 			}
 140725 			(*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertIdx = pIdx
 140726 			break
 140727 		}
 140728 		if (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertIdx == uintptr(0) {
 140729 			if nClause == 0 && (*Upsert)(unsafe.Pointer(pUpsert)).FpNextUpsert == uintptr(0) {
 140730 				*(*int8)(unsafe.Pointer(bp + 216)) = int8(0)
 140731 			} else {
 140732 				Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([16]int8{})), bp+216, ts+21976, libc.VaList(bp, nClause+1))
 140733 			}
 140734 			Xsqlite3ErrorMsg(tls, pParse,
 140735 				ts+21980, libc.VaList(bp+8, bp+216))
 140736 			return SQLITE_ERROR
 140737 		}
 140738 
 140739 	}
 140740 	goto __2
 140741 __2:
 140742 	pUpsert = (*Upsert)(unsafe.Pointer(pUpsert)).FpNextUpsert
 140743 	nClause++
 140744 	goto __1
 140745 	goto __3
 140746 __3:
 140747 	;
 140748 	return SQLITE_OK
 140749 }
 140750 
 140751 // Return true if pUpsert is the last ON CONFLICT clause with a
 140752 // conflict target, or if pUpsert is followed by another ON CONFLICT
 140753 // clause that targets the INTEGER PRIMARY KEY.
 140754 func Xsqlite3UpsertNextIsIPK(tls *libc.TLS, pUpsert uintptr) int32 {
 140755 	var pNext uintptr
 140756 	if pUpsert == uintptr(0) {
 140757 		return 0
 140758 	}
 140759 	pNext = (*Upsert)(unsafe.Pointer(pUpsert)).FpNextUpsert
 140760 	if pNext == uintptr(0) {
 140761 		return 1
 140762 	}
 140763 	if (*Upsert)(unsafe.Pointer(pNext)).FpUpsertTarget == uintptr(0) {
 140764 		return 1
 140765 	}
 140766 	if (*Upsert)(unsafe.Pointer(pNext)).FpUpsertIdx == uintptr(0) {
 140767 		return 1
 140768 	}
 140769 	return 0
 140770 }
 140771 
 140772 // Given the list of ON CONFLICT clauses described by pUpsert, and
 140773 // a particular index pIdx, return a pointer to the particular ON CONFLICT
 140774 // clause that applies to the index.  Or, if the index is not subject to
 140775 // any ON CONFLICT clause, return NULL.
 140776 func Xsqlite3UpsertOfIndex(tls *libc.TLS, pUpsert uintptr, pIdx uintptr) uintptr {
 140777 	for pUpsert != 0 &&
 140778 		(*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget != uintptr(0) &&
 140779 		(*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertIdx != pIdx {
 140780 		pUpsert = (*Upsert)(unsafe.Pointer(pUpsert)).FpNextUpsert
 140781 	}
 140782 	return pUpsert
 140783 }
 140784 
 140785 // Generate bytecode that does an UPDATE as part of an upsert.
 140786 //
 140787 // If pIdx is NULL, then the UNIQUE constraint that failed was the IPK.
 140788 // In this case parameter iCur is a cursor open on the table b-tree that
 140789 // currently points to the conflicting table row. Otherwise, if pIdx
 140790 // is not NULL, then pIdx is the constraint that failed and iCur is a
 140791 // cursor points to the conflicting row.
 140792 func Xsqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab uintptr, pIdx uintptr, iCur int32) {
 140793 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 140794 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 140795 	var pSrc uintptr
 140796 	var iDataCur int32
 140797 	var i int32
 140798 	var pTop uintptr = pUpsert
 140799 
 140800 	iDataCur = (*Upsert)(unsafe.Pointer(pUpsert)).FiDataCur
 140801 	pUpsert = Xsqlite3UpsertOfIndex(tls, pTop, pIdx)
 140802 
 140803 	if pIdx != 0 && iCur != iDataCur {
 140804 		if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
 140805 			var regRowid int32 = Xsqlite3GetTempReg(tls, pParse)
 140806 			Xsqlite3VdbeAddOp2(tls, v, OP_IdxRowid, iCur, regRowid)
 140807 			Xsqlite3VdbeAddOp3(tls, v, OP_SeekRowid, iDataCur, 0, regRowid)
 140808 
 140809 			Xsqlite3ReleaseTempReg(tls, pParse, regRowid)
 140810 		} else {
 140811 			var pPk uintptr = Xsqlite3PrimaryKeyIndex(tls, pTab)
 140812 			var nPk int32 = int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol)
 140813 			var iPk int32 = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 140814 			*(*int32)(unsafe.Pointer(pParse + 56)) += nPk
 140815 			for i = 0; i < nPk; i++ {
 140816 				var k int32
 140817 
 140818 				k = int32(Xsqlite3TableColumnToIndex(tls, pIdx, *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))))
 140819 				Xsqlite3VdbeAddOp3(tls, v, OP_Column, iCur, k, iPk+i)
 140820 
 140821 			}
 140822 
 140823 			i = Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, iDataCur, 0, iPk, nPk)
 140824 
 140825 			Xsqlite3VdbeAddOp4(tls, v, OP_Halt, SQLITE_CORRUPT, OE_Abort, 0,
 140826 				ts+13502, -1)
 140827 			Xsqlite3MayAbort(tls, pParse)
 140828 			Xsqlite3VdbeJumpHere(tls, v, i)
 140829 		}
 140830 	}
 140831 
 140832 	pSrc = Xsqlite3SrcListDup(tls, db, (*Upsert)(unsafe.Pointer(pTop)).FpUpsertSrc, 0)
 140833 
 140834 	for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
 140835 		if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24)).Faffinity) == SQLITE_AFF_REAL {
 140836 			Xsqlite3VdbeAddOp1(tls, v, OP_RealAffinity, (*Upsert)(unsafe.Pointer(pTop)).FregData+i)
 140837 		}
 140838 	}
 140839 	Xsqlite3Update(tls, pParse, pSrc, Xsqlite3ExprListDup(tls, db, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSet, 0),
 140840 		Xsqlite3ExprDup(tls, db, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertWhere, 0), OE_Abort, uintptr(0), uintptr(0), pUpsert)
 140841 
 140842 }
 140843 
 140844 func execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) int32 {
 140845 	bp := tls.Alloc(8)
 140846 	defer tls.Free(8)
 140847 
 140848 	var rc int32
 140849 
 140850 	rc = Xsqlite3_prepare_v2(tls, db, zSql, -1, bp, uintptr(0))
 140851 	if rc != SQLITE_OK {
 140852 		return rc
 140853 	}
 140854 	for SQLITE_ROW == libc.AssignInt32(&rc, Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp)))) {
 140855 		var zSubSql uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0)
 140856 
 140857 		if zSubSql != 0 &&
 140858 			(libc.Xstrncmp(tls, zSubSql, ts+22053, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, ts+22057, uint64(3)) == 0) {
 140859 			rc = execSql(tls, db, pzErrMsg, zSubSql)
 140860 			if rc != SQLITE_OK {
 140861 				break
 140862 			}
 140863 		}
 140864 	}
 140865 
 140866 	if rc == SQLITE_DONE {
 140867 		rc = SQLITE_OK
 140868 	}
 140869 	if rc != 0 {
 140870 		Xsqlite3SetString(tls, pzErrMsg, db, Xsqlite3_errmsg(tls, db))
 140871 	}
 140872 	Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp)))
 140873 	return rc
 140874 }
 140875 
 140876 func execSqlF(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr, va uintptr) int32 {
 140877 	var z uintptr
 140878 	var ap Va_list
 140879 	_ = ap
 140880 	var rc int32
 140881 	ap = va
 140882 	z = Xsqlite3VMPrintf(tls, db, zSql, ap)
 140883 	_ = ap
 140884 	if z == uintptr(0) {
 140885 		return SQLITE_NOMEM
 140886 	}
 140887 	rc = execSql(tls, db, pzErrMsg, z)
 140888 	Xsqlite3DbFree(tls, db, z)
 140889 	return rc
 140890 }
 140891 
 140892 // The VACUUM command is used to clean up the database,
 140893 // collapse free space, etc.  It is modelled after the VACUUM command
 140894 // in PostgreSQL.  The VACUUM command works as follows:
 140895 //
 140896 //	(1)  Create a new transient database file
 140897 //	(2)  Copy all content from the database being vacuumed into
 140898 //	     the new transient database file
 140899 //	(3)  Copy content from the transient database back into the
 140900 //	     original database.
 140901 //
 140902 // The transient database requires temporary disk space approximately
 140903 // equal to the size of the original database.  The copy operation of
 140904 // step (3) requires additional temporary disk space approximately equal
 140905 // to the size of the original database for the rollback journal.
 140906 // Hence, temporary disk space that is approximately 2x the size of the
 140907 // original database is required.  Every page of the database is written
 140908 // approximately 3 times:  Once for step (2) and twice for step (3).
 140909 // Two writes per page are required in step (3) because the original
 140910 // database content must be written into the rollback journal prior to
 140911 // overwriting the database with the vacuumed content.
 140912 //
 140913 // Only 1x temporary space and only 1x writes would be required if
 140914 // the copy of step (3) were replaced by deleting the original database
 140915 // and renaming the transient database as the original.  But that will
 140916 // not work if other processes are attached to the original database.
 140917 // And a power loss in between deleting the original and renaming the
 140918 // transient would cause the database file to appear to be deleted
 140919 // following reboot.
 140920 func Xsqlite3Vacuum(tls *libc.TLS, pParse uintptr, pNm uintptr, pInto uintptr) {
 140921 	bp := tls.Alloc(8)
 140922 	defer tls.Free(8)
 140923 	*(*uintptr)(unsafe.Pointer(bp)) = pNm
 140924 
 140925 	var v uintptr
 140926 	var iDb int32
 140927 	var iIntoReg int32
 140928 	v = Xsqlite3GetVdbe(tls, pParse)
 140929 	iDb = 0
 140930 	if !(v == uintptr(0)) {
 140931 		goto __1
 140932 	}
 140933 	goto build_vacuum_end
 140934 __1:
 140935 	;
 140936 	if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
 140937 		goto __2
 140938 	}
 140939 	goto build_vacuum_end
 140940 __2:
 140941 	;
 140942 	if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) {
 140943 		goto __3
 140944 	}
 140945 
 140946 	iDb = Xsqlite3TwoPartName(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp)), bp)
 140947 	if !(iDb < 0) {
 140948 		goto __4
 140949 	}
 140950 	goto build_vacuum_end
 140951 __4:
 140952 	;
 140953 __3:
 140954 	;
 140955 	if !(iDb != 1) {
 140956 		goto __5
 140957 	}
 140958 	iIntoReg = 0
 140959 	if !(pInto != 0 && Xsqlite3ResolveSelfReference(tls, pParse, uintptr(0), 0, pInto, uintptr(0)) == 0) {
 140960 		goto __6
 140961 	}
 140962 	iIntoReg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 140963 	Xsqlite3ExprCode(tls, pParse, pInto, iIntoReg)
 140964 __6:
 140965 	;
 140966 	Xsqlite3VdbeAddOp2(tls, v, OP_Vacuum, iDb, iIntoReg)
 140967 	Xsqlite3VdbeUsesBtree(tls, v, iDb)
 140968 __5:
 140969 	;
 140970 build_vacuum_end:
 140971 	Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pInto)
 140972 	return
 140973 }
 140974 
 140975 // This routine implements the OP_Vacuum opcode of the VDBE.
 140976 func Xsqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, pOut uintptr) int32 {
 140977 	bp := tls.Alloc(52)
 140978 	defer tls.Free(52)
 140979 
 140980 	var rc int32
 140981 	var pMain uintptr
 140982 	var pTemp uintptr
 140983 	var saved_mDbFlags U32
 140984 	var saved_flags U64
 140985 	var saved_nChange I64
 140986 	var saved_nTotalChange I64
 140987 	var saved_openFlags U32
 140988 	var saved_mTrace U8
 140989 	var pDb uintptr
 140990 	var isMemDb int32
 140991 	var nRes int32
 140992 	var nDb int32
 140993 	var zDbMain uintptr
 140994 	var zOut uintptr
 140995 	var pgflags U32
 140996 	var id uintptr
 140997 
 140998 	var i int32
 140999 	rc = SQLITE_OK
 141000 	pDb = uintptr(0)
 141001 	pgflags = U32(PAGER_SYNCHRONOUS_OFF)
 141002 
 141003 	if !!(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0) {
 141004 		goto __1
 141005 	}
 141006 	Xsqlite3SetString(tls, pzErrMsg, db, ts+22061)
 141007 	return SQLITE_ERROR
 141008 __1:
 141009 	;
 141010 	if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive > 1) {
 141011 		goto __2
 141012 	}
 141013 	Xsqlite3SetString(tls, pzErrMsg, db, ts+22101)
 141014 	return SQLITE_ERROR
 141015 __2:
 141016 	;
 141017 	saved_openFlags = (*Sqlite3)(unsafe.Pointer(db)).FopenFlags
 141018 	if !(pOut != 0) {
 141019 		goto __3
 141020 	}
 141021 	if !(Xsqlite3_value_type(tls, pOut) != SQLITE_TEXT) {
 141022 		goto __5
 141023 	}
 141024 	Xsqlite3SetString(tls, pzErrMsg, db, ts+22144)
 141025 	return SQLITE_ERROR
 141026 __5:
 141027 	;
 141028 	zOut = Xsqlite3_value_text(tls, pOut)
 141029 	*(*uint32)(unsafe.Pointer(db + 76)) &= libc.Uint32FromInt32(libc.CplInt32(SQLITE_OPEN_READONLY))
 141030 	*(*uint32)(unsafe.Pointer(db + 76)) |= uint32(SQLITE_OPEN_CREATE | SQLITE_OPEN_READWRITE)
 141031 	goto __4
 141032 __3:
 141033 	zOut = ts + 1544
 141034 __4:
 141035 	;
 141036 	saved_flags = (*Sqlite3)(unsafe.Pointer(db)).Fflags
 141037 	saved_mDbFlags = (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags
 141038 	saved_nChange = (*Sqlite3)(unsafe.Pointer(db)).FnChange
 141039 	saved_nTotalChange = (*Sqlite3)(unsafe.Pointer(db)).FnTotalChange
 141040 	saved_mTrace = (*Sqlite3)(unsafe.Pointer(db)).FmTrace
 141041 	*(*U64)(unsafe.Pointer(db + 48)) |= uint64(SQLITE_WriteSchema | SQLITE_IgnoreChecks)
 141042 	*(*U32)(unsafe.Pointer(db + 44)) |= U32(DBFLAG_PreferBuiltin | DBFLAG_Vacuum)
 141043 	*(*U64)(unsafe.Pointer(db + 48)) &= libc.CplUint64(uint64(SQLITE_ForeignKeys|SQLITE_ReverseOrder|
 141044 		SQLITE_Defensive) | uint64(0x00001)<<32)
 141045 	(*Sqlite3)(unsafe.Pointer(db)).FmTrace = U8(0)
 141046 
 141047 	zDbMain = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
 141048 	pMain = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpBt
 141049 	isMemDb = Xsqlite3PagerIsMemdb(tls, Xsqlite3BtreePager(tls, pMain))
 141050 
 141051 	nDb = (*Sqlite3)(unsafe.Pointer(db)).FnDb
 141052 	rc = execSqlF(tls, db, pzErrMsg, ts+22162, libc.VaList(bp, zOut))
 141053 	(*Sqlite3)(unsafe.Pointer(db)).FopenFlags = saved_openFlags
 141054 	if !(rc != SQLITE_OK) {
 141055 		goto __6
 141056 	}
 141057 	goto end_of_vacuum
 141058 __6:
 141059 	;
 141060 	pDb = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(nDb)*32
 141061 
 141062 	pTemp = (*Db)(unsafe.Pointer(pDb)).FpBt
 141063 	if !(pOut != 0) {
 141064 		goto __7
 141065 	}
 141066 	id = Xsqlite3PagerFile(tls, Xsqlite3BtreePager(tls, pTemp))
 141067 	*(*I64)(unsafe.Pointer(bp + 40)) = int64(0)
 141068 	if !((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods != uintptr(0) && (Xsqlite3OsFileSize(tls, id, bp+40) != SQLITE_OK || *(*I64)(unsafe.Pointer(bp + 40)) > int64(0))) {
 141069 		goto __8
 141070 	}
 141071 	rc = SQLITE_ERROR
 141072 	Xsqlite3SetString(tls, pzErrMsg, db, ts+22185)
 141073 	goto end_of_vacuum
 141074 __8:
 141075 	;
 141076 	*(*U32)(unsafe.Pointer(db + 44)) |= U32(DBFLAG_VacuumInto)
 141077 
 141078 	pgflags = U32(U64((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).Fsafety_level) | (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(PAGER_FLAGS_MASK))
 141079 __7:
 141080 	;
 141081 	nRes = Xsqlite3BtreeGetRequestedReserve(tls, pMain)
 141082 
 141083 	Xsqlite3BtreeSetCacheSize(tls, pTemp, (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpSchema)).Fcache_size)
 141084 	Xsqlite3BtreeSetSpillSize(tls, pTemp, Xsqlite3BtreeSetSpillSize(tls, pMain, 0))
 141085 	Xsqlite3BtreeSetPagerFlags(tls, pTemp, pgflags|U32(PAGER_CACHESPILL))
 141086 
 141087 	rc = execSql(tls, db, pzErrMsg, ts+15860)
 141088 	if !(rc != SQLITE_OK) {
 141089 		goto __9
 141090 	}
 141091 	goto end_of_vacuum
 141092 __9:
 141093 	;
 141094 	rc = Xsqlite3BtreeBeginTrans(tls, pMain, func() int32 {
 141095 		if pOut == uintptr(0) {
 141096 			return 2
 141097 		}
 141098 		return 0
 141099 	}(), uintptr(0))
 141100 	if !(rc != SQLITE_OK) {
 141101 		goto __10
 141102 	}
 141103 	goto end_of_vacuum
 141104 __10:
 141105 	;
 141106 	if !(Xsqlite3PagerGetJournalMode(tls, Xsqlite3BtreePager(tls, pMain)) ==
 141107 		PAGER_JOURNALMODE_WAL &&
 141108 		pOut == uintptr(0)) {
 141109 		goto __11
 141110 	}
 141111 	(*Sqlite3)(unsafe.Pointer(db)).FnextPagesize = 0
 141112 __11:
 141113 	;
 141114 	if !(Xsqlite3BtreeSetPageSize(tls, pTemp, Xsqlite3BtreeGetPageSize(tls, pMain), nRes, 0) != 0 ||
 141115 		!(isMemDb != 0) && Xsqlite3BtreeSetPageSize(tls, pTemp, (*Sqlite3)(unsafe.Pointer(db)).FnextPagesize, nRes, 0) != 0 ||
 141116 		(*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 141117 		goto __12
 141118 	}
 141119 	rc = SQLITE_NOMEM
 141120 	goto end_of_vacuum
 141121 __12:
 141122 	;
 141123 	Xsqlite3BtreeSetAutoVacuum(tls, pTemp, func() int32 {
 141124 		if int32((*Sqlite3)(unsafe.Pointer(db)).FnextAutovac) >= 0 {
 141125 			return int32((*Sqlite3)(unsafe.Pointer(db)).FnextAutovac)
 141126 		}
 141127 		return Xsqlite3BtreeGetAutoVacuum(tls, pMain)
 141128 	}())
 141129 
 141130 	(*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(nDb)
 141131 	rc = execSqlF(tls, db, pzErrMsg,
 141132 		ts+22212,
 141133 		libc.VaList(bp+8, zDbMain))
 141134 	if !(rc != SQLITE_OK) {
 141135 		goto __13
 141136 	}
 141137 	goto end_of_vacuum
 141138 __13:
 141139 	;
 141140 	rc = execSqlF(tls, db, pzErrMsg,
 141141 		ts+22320,
 141142 		libc.VaList(bp+16, zDbMain))
 141143 	if !(rc != SQLITE_OK) {
 141144 		goto __14
 141145 	}
 141146 	goto end_of_vacuum
 141147 __14:
 141148 	;
 141149 	(*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(0)
 141150 
 141151 	rc = execSqlF(tls, db, pzErrMsg,
 141152 		ts+22374,
 141153 		libc.VaList(bp+24, zDbMain))
 141154 
 141155 	*(*U32)(unsafe.Pointer(db + 44)) &= libc.Uint32FromInt32(libc.CplInt32(DBFLAG_Vacuum))
 141156 	if !(rc != SQLITE_OK) {
 141157 		goto __15
 141158 	}
 141159 	goto end_of_vacuum
 141160 __15:
 141161 	;
 141162 	rc = execSqlF(tls, db, pzErrMsg,
 141163 		ts+22525,
 141164 		libc.VaList(bp+32, zDbMain))
 141165 	if !(rc != 0) {
 141166 		goto __16
 141167 	}
 141168 	goto end_of_vacuum
 141169 __16:
 141170 	;
 141171 	i = 0
 141172 __17:
 141173 	if !(i < int32(uint64(unsafe.Sizeof(aCopy))/uint64(unsafe.Sizeof(uint8(0))))) {
 141174 		goto __19
 141175 	}
 141176 
 141177 	Xsqlite3BtreeGetMeta(tls, pMain, int32(aCopy[i]), bp+48)
 141178 	rc = Xsqlite3BtreeUpdateMeta(tls, pTemp, int32(aCopy[i]), *(*U32)(unsafe.Pointer(bp + 48))+U32(aCopy[i+1]))
 141179 	if !(rc != SQLITE_OK) {
 141180 		goto __20
 141181 	}
 141182 	goto end_of_vacuum
 141183 __20:
 141184 	;
 141185 	goto __18
 141186 __18:
 141187 	i = i + 2
 141188 	goto __17
 141189 	goto __19
 141190 __19:
 141191 	;
 141192 	if !(pOut == uintptr(0)) {
 141193 		goto __21
 141194 	}
 141195 	rc = Xsqlite3BtreeCopyFile(tls, pMain, pTemp)
 141196 __21:
 141197 	;
 141198 	if !(rc != SQLITE_OK) {
 141199 		goto __22
 141200 	}
 141201 	goto end_of_vacuum
 141202 __22:
 141203 	;
 141204 	rc = Xsqlite3BtreeCommit(tls, pTemp)
 141205 	if !(rc != SQLITE_OK) {
 141206 		goto __23
 141207 	}
 141208 	goto end_of_vacuum
 141209 __23:
 141210 	;
 141211 	if !(pOut == uintptr(0)) {
 141212 		goto __24
 141213 	}
 141214 	Xsqlite3BtreeSetAutoVacuum(tls, pMain, Xsqlite3BtreeGetAutoVacuum(tls, pTemp))
 141215 __24:
 141216 	;
 141217 	if !(pOut == uintptr(0)) {
 141218 		goto __25
 141219 	}
 141220 	nRes = Xsqlite3BtreeGetRequestedReserve(tls, pTemp)
 141221 	rc = Xsqlite3BtreeSetPageSize(tls, pMain, Xsqlite3BtreeGetPageSize(tls, pTemp), nRes, 1)
 141222 __25:
 141223 	;
 141224 end_of_vacuum:
 141225 	(*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(0)
 141226 	(*Sqlite3)(unsafe.Pointer(db)).FmDbFlags = saved_mDbFlags
 141227 	(*Sqlite3)(unsafe.Pointer(db)).Fflags = saved_flags
 141228 	(*Sqlite3)(unsafe.Pointer(db)).FnChange = saved_nChange
 141229 	(*Sqlite3)(unsafe.Pointer(db)).FnTotalChange = saved_nTotalChange
 141230 	(*Sqlite3)(unsafe.Pointer(db)).FmTrace = saved_mTrace
 141231 	Xsqlite3BtreeSetPageSize(tls, pMain, -1, 0, 1)
 141232 
 141233 	(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1)
 141234 
 141235 	if !(pDb != 0) {
 141236 		goto __26
 141237 	}
 141238 	Xsqlite3BtreeClose(tls, (*Db)(unsafe.Pointer(pDb)).FpBt)
 141239 	(*Db)(unsafe.Pointer(pDb)).FpBt = uintptr(0)
 141240 	(*Db)(unsafe.Pointer(pDb)).FpSchema = uintptr(0)
 141241 __26:
 141242 	;
 141243 	Xsqlite3ResetAllSchemasOfConnection(tls, db)
 141244 
 141245 	return rc
 141246 }
 141247 
 141248 var aCopy = [10]uint8{
 141249 	uint8(BTREE_SCHEMA_VERSION), uint8(1),
 141250 	uint8(BTREE_DEFAULT_CACHE_SIZE), uint8(0),
 141251 	uint8(BTREE_TEXT_ENCODING), uint8(0),
 141252 	uint8(BTREE_USER_VERSION), uint8(0),
 141253 	uint8(BTREE_APPLICATION_ID), uint8(0),
 141254 }
 141255 
 141256 // Construct and install a Module object for a virtual table.  When this
 141257 // routine is called, it is guaranteed that all appropriate locks are held
 141258 // and the module is not already part of the connection.
 141259 //
 141260 // If there already exists a module with zName, replace it with the new one.
 141261 // If pModule==0, then delete the module zName if it exists.
 141262 func Xsqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) uintptr {
 141263 	var pMod uintptr
 141264 	var pDel uintptr
 141265 	var zCopy uintptr
 141266 	if pModule == uintptr(0) {
 141267 		zCopy = zName
 141268 		pMod = uintptr(0)
 141269 	} else {
 141270 		var nName int32 = Xsqlite3Strlen30(tls, zName)
 141271 		pMod = Xsqlite3Malloc(tls, uint64(unsafe.Sizeof(Module{}))+uint64(nName)+uint64(1))
 141272 		if pMod == uintptr(0) {
 141273 			Xsqlite3OomFault(tls, db)
 141274 			return uintptr(0)
 141275 		}
 141276 		zCopy = pMod + 1*48
 141277 		libc.Xmemcpy(tls, zCopy, zName, uint64(nName+1))
 141278 		(*Module)(unsafe.Pointer(pMod)).FzName = zCopy
 141279 		(*Module)(unsafe.Pointer(pMod)).FpModule = pModule
 141280 		(*Module)(unsafe.Pointer(pMod)).FpAux = pAux
 141281 		(*Module)(unsafe.Pointer(pMod)).FxDestroy = xDestroy
 141282 		(*Module)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0)
 141283 		(*Module)(unsafe.Pointer(pMod)).FnRefModule = 1
 141284 	}
 141285 	pDel = Xsqlite3HashInsert(tls, db+576, zCopy, pMod)
 141286 	if pDel != 0 {
 141287 		if pDel == pMod {
 141288 			Xsqlite3OomFault(tls, db)
 141289 			Xsqlite3DbFree(tls, db, pDel)
 141290 			pMod = uintptr(0)
 141291 		} else {
 141292 			Xsqlite3VtabEponymousTableClear(tls, db, pDel)
 141293 			Xsqlite3VtabModuleUnref(tls, db, pDel)
 141294 		}
 141295 	}
 141296 	return pMod
 141297 }
 141298 
 141299 func createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) int32 {
 141300 	var rc int32 = SQLITE_OK
 141301 
 141302 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 141303 	Xsqlite3VtabCreateModule(tls, db, zName, pModule, pAux, xDestroy)
 141304 	rc = Xsqlite3ApiExit(tls, db, rc)
 141305 	if rc != SQLITE_OK && xDestroy != 0 {
 141306 		(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{xDestroy})).f(tls, pAux)
 141307 	}
 141308 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 141309 	return rc
 141310 }
 141311 
 141312 // External API function used to create a new virtual-table module.
 141313 func Xsqlite3_create_module(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr) int32 {
 141314 	return createModule(tls, db, zName, pModule, pAux, uintptr(0))
 141315 }
 141316 
 141317 // External API function used to create a new virtual-table module.
 141318 func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) int32 {
 141319 	return createModule(tls, db, zName, pModule, pAux, xDestroy)
 141320 }
 141321 
 141322 // External API to drop all virtual-table modules, except those named
 141323 // on the azNames list.
 141324 func Xsqlite3_drop_modules(tls *libc.TLS, db uintptr, azNames uintptr) int32 {
 141325 	var pThis uintptr
 141326 	var pNext uintptr
 141327 	for pThis = (*Hash)(unsafe.Pointer(db + 576)).Ffirst; pThis != 0; pThis = pNext {
 141328 		var pMod uintptr = (*HashElem)(unsafe.Pointer(pThis)).Fdata
 141329 		pNext = (*HashElem)(unsafe.Pointer(pThis)).Fnext
 141330 		if azNames != 0 {
 141331 			var ii int32
 141332 			for ii = 0; *(*uintptr)(unsafe.Pointer(azNames + uintptr(ii)*8)) != uintptr(0) && libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(azNames + uintptr(ii)*8)), (*Module)(unsafe.Pointer(pMod)).FzName) != 0; ii++ {
 141333 			}
 141334 			if *(*uintptr)(unsafe.Pointer(azNames + uintptr(ii)*8)) != uintptr(0) {
 141335 				continue
 141336 			}
 141337 		}
 141338 		createModule(tls, db, (*Module)(unsafe.Pointer(pMod)).FzName, uintptr(0), uintptr(0), uintptr(0))
 141339 	}
 141340 	return SQLITE_OK
 141341 }
 141342 
 141343 // Decrement the reference count on a Module object.  Destroy the
 141344 // module when the reference count reaches zero.
 141345 func Xsqlite3VtabModuleUnref(tls *libc.TLS, db uintptr, pMod uintptr) {
 141346 	(*Module)(unsafe.Pointer(pMod)).FnRefModule--
 141347 	if (*Module)(unsafe.Pointer(pMod)).FnRefModule == 0 {
 141348 		if (*Module)(unsafe.Pointer(pMod)).FxDestroy != 0 {
 141349 			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Module)(unsafe.Pointer(pMod)).FxDestroy})).f(tls, (*Module)(unsafe.Pointer(pMod)).FpAux)
 141350 		}
 141351 
 141352 		Xsqlite3DbFree(tls, db, pMod)
 141353 	}
 141354 }
 141355 
 141356 // Lock the virtual table so that it cannot be disconnected.
 141357 // Locks nest.  Every lock should have a corresponding unlock.
 141358 // If an unlock is omitted, resources leaks will occur.
 141359 //
 141360 // If a disconnect is attempted while a virtual table is locked,
 141361 // the disconnect is deferred until all locks have been removed.
 141362 func Xsqlite3VtabLock(tls *libc.TLS, pVTab uintptr) {
 141363 	(*VTable)(unsafe.Pointer(pVTab)).FnRef++
 141364 }
 141365 
 141366 // pTab is a pointer to a Table structure representing a virtual-table.
 141367 // Return a pointer to the VTable object used by connection db to access
 141368 // this virtual-table, if one has been created, or NULL otherwise.
 141369 func Xsqlite3GetVTable(tls *libc.TLS, db uintptr, pTab uintptr) uintptr {
 141370 	var pVtab uintptr
 141371 
 141372 	for pVtab = *(*uintptr)(unsafe.Pointer(pTab + 64 + 16)); pVtab != 0 && (*VTable)(unsafe.Pointer(pVtab)).Fdb != db; pVtab = (*VTable)(unsafe.Pointer(pVtab)).FpNext {
 141373 	}
 141374 	return pVtab
 141375 }
 141376 
 141377 // Decrement the ref-count on a virtual table object. When the ref-count
 141378 // reaches zero, call the xDisconnect() method to delete the object.
 141379 func Xsqlite3VtabUnlock(tls *libc.TLS, pVTab uintptr) {
 141380 	var db uintptr = (*VTable)(unsafe.Pointer(pVTab)).Fdb
 141381 
 141382 	(*VTable)(unsafe.Pointer(pVTab)).FnRef--
 141383 	if (*VTable)(unsafe.Pointer(pVTab)).FnRef == 0 {
 141384 		var p uintptr = (*VTable)(unsafe.Pointer(pVTab)).FpVtab
 141385 		if p != 0 {
 141386 			(*struct {
 141387 				f func(*libc.TLS, uintptr) int32
 141388 			})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer((*Sqlite3_vtab)(unsafe.Pointer(p)).FpModule)).FxDisconnect})).f(tls, p)
 141389 		}
 141390 		Xsqlite3VtabModuleUnref(tls, (*VTable)(unsafe.Pointer(pVTab)).Fdb, (*VTable)(unsafe.Pointer(pVTab)).FpMod)
 141391 		Xsqlite3DbFree(tls, db, pVTab)
 141392 	}
 141393 }
 141394 
 141395 func vtabDisconnectAll(tls *libc.TLS, db uintptr, p uintptr) uintptr {
 141396 	var pRet uintptr = uintptr(0)
 141397 	var pVTable uintptr
 141398 
 141399 	pVTable = *(*uintptr)(unsafe.Pointer(p + 64 + 16))
 141400 	*(*uintptr)(unsafe.Pointer(p + 64 + 16)) = uintptr(0)
 141401 
 141402 	for pVTable != 0 {
 141403 		var db2 uintptr = (*VTable)(unsafe.Pointer(pVTable)).Fdb
 141404 		var pNext uintptr = (*VTable)(unsafe.Pointer(pVTable)).FpNext
 141405 
 141406 		if db2 == db {
 141407 			pRet = pVTable
 141408 			*(*uintptr)(unsafe.Pointer(p + 64 + 16)) = pRet
 141409 			(*VTable)(unsafe.Pointer(pRet)).FpNext = uintptr(0)
 141410 		} else {
 141411 			(*VTable)(unsafe.Pointer(pVTable)).FpNext = (*Sqlite3)(unsafe.Pointer(db2)).FpDisconnect
 141412 			(*Sqlite3)(unsafe.Pointer(db2)).FpDisconnect = pVTable
 141413 		}
 141414 		pVTable = pNext
 141415 	}
 141416 
 141417 	return pRet
 141418 }
 141419 
 141420 // Table *p is a virtual table. This function removes the VTable object
 141421 // for table *p associated with database connection db from the linked
 141422 // list in p->pVTab. It also decrements the VTable ref count. This is
 141423 // used when closing database connection db to free all of its VTable
 141424 // objects without disturbing the rest of the Schema object (which may
 141425 // be being used by other shared-cache connections).
 141426 func Xsqlite3VtabDisconnect(tls *libc.TLS, db uintptr, p uintptr) {
 141427 	var ppVTab uintptr
 141428 
 141429 	for ppVTab = p + 64 + 16; *(*uintptr)(unsafe.Pointer(ppVTab)) != 0; ppVTab = *(*uintptr)(unsafe.Pointer(ppVTab)) + 40 {
 141430 		if (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppVTab)))).Fdb == db {
 141431 			var pVTab uintptr = *(*uintptr)(unsafe.Pointer(ppVTab))
 141432 			*(*uintptr)(unsafe.Pointer(ppVTab)) = (*VTable)(unsafe.Pointer(pVTab)).FpNext
 141433 			Xsqlite3VtabUnlock(tls, pVTab)
 141434 			break
 141435 		}
 141436 	}
 141437 }
 141438 
 141439 // Disconnect all the virtual table objects in the sqlite3.pDisconnect list.
 141440 //
 141441 // This function may only be called when the mutexes associated with all
 141442 // shared b-tree databases opened using connection db are held by the
 141443 // caller. This is done to protect the sqlite3.pDisconnect list. The
 141444 // sqlite3.pDisconnect list is accessed only as follows:
 141445 //
 141446 //  1. By this function. In this case, all BtShared mutexes and the mutex
 141447 //     associated with the database handle itself must be held.
 141448 //
 141449 //  2. By function vtabDisconnectAll(), when it adds a VTable entry to
 141450 //     the sqlite3.pDisconnect list. In this case either the BtShared mutex
 141451 //     associated with the database the virtual table is stored in is held
 141452 //     or, if the virtual table is stored in a non-sharable database, then
 141453 //     the database handle mutex is held.
 141454 //
 141455 // As a result, a sqlite3.pDisconnect cannot be accessed simultaneously
 141456 // by multiple threads. It is thread-safe.
 141457 func Xsqlite3VtabUnlockList(tls *libc.TLS, db uintptr) {
 141458 	var p uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpDisconnect
 141459 
 141460 	if p != 0 {
 141461 		(*Sqlite3)(unsafe.Pointer(db)).FpDisconnect = uintptr(0)
 141462 		Xsqlite3ExpirePreparedStatements(tls, db, 0)
 141463 		for __ccgo := true; __ccgo; __ccgo = p != 0 {
 141464 			var pNext uintptr = (*VTable)(unsafe.Pointer(p)).FpNext
 141465 			Xsqlite3VtabUnlock(tls, p)
 141466 			p = pNext
 141467 		}
 141468 	}
 141469 }
 141470 
 141471 // Clear any and all virtual-table information from the Table record.
 141472 // This routine is called, for example, just before deleting the Table
 141473 // record.
 141474 //
 141475 // Since it is a virtual-table, the Table structure contains a pointer
 141476 // to the head of a linked list of VTable structures. Each VTable
 141477 // structure is associated with a single sqlite3* user of the schema.
 141478 // The reference count of the VTable structure associated with database
 141479 // connection db is decremented immediately (which may lead to the
 141480 // structure being xDisconnected and free). Any other VTable structures
 141481 // in the list are moved to the sqlite3.pDisconnect list of the associated
 141482 // database connection.
 141483 func Xsqlite3VtabClear(tls *libc.TLS, db uintptr, p uintptr) {
 141484 	if (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0) {
 141485 		vtabDisconnectAll(tls, uintptr(0), p)
 141486 	}
 141487 	if *(*uintptr)(unsafe.Pointer(p + 64 + 8)) != 0 {
 141488 		var i int32
 141489 		for i = 0; i < *(*int32)(unsafe.Pointer(p + 64)); i++ {
 141490 			if i != 1 {
 141491 				Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 64 + 8)) + uintptr(i)*8)))
 141492 			}
 141493 		}
 141494 		Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 64 + 8)))
 141495 	}
 141496 }
 141497 
 141498 func addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uintptr) {
 141499 	bp := tls.Alloc(8)
 141500 	defer tls.Free(8)
 141501 
 141502 	var nBytes Sqlite3_int64
 141503 	var azModuleArg uintptr
 141504 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 141505 
 141506 	nBytes = Sqlite3_int64(uint64(unsafe.Sizeof(uintptr(0))) * uint64(2+*(*int32)(unsafe.Pointer(pTable + 64))))
 141507 	if *(*int32)(unsafe.Pointer(pTable + 64))+3 >= *(*int32)(unsafe.Pointer(db + 136 + 2*4)) {
 141508 		Xsqlite3ErrorMsg(tls, pParse, ts+13729, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName))
 141509 	}
 141510 	azModuleArg = Xsqlite3DbRealloc(tls, db, *(*uintptr)(unsafe.Pointer(pTable + 64 + 8)), uint64(nBytes))
 141511 	if azModuleArg == uintptr(0) {
 141512 		Xsqlite3DbFree(tls, db, zArg)
 141513 	} else {
 141514 		var i int32 = libc.PostIncInt32(&*(*int32)(unsafe.Pointer(pTable + 64)), 1)
 141515 		*(*uintptr)(unsafe.Pointer(azModuleArg + uintptr(i)*8)) = zArg
 141516 		*(*uintptr)(unsafe.Pointer(azModuleArg + uintptr(i+1)*8)) = uintptr(0)
 141517 		*(*uintptr)(unsafe.Pointer(pTable + 64 + 8)) = azModuleArg
 141518 	}
 141519 }
 141520 
 141521 // The parser calls this routine when it first sees a CREATE VIRTUAL TABLE
 141522 // statement.  The module name has been parsed, but the optional list
 141523 // of parameters that follow the module name are still pending.
 141524 func Xsqlite3VtabBeginParse(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pModuleName uintptr, ifNotExists int32) {
 141525 	var pTable uintptr
 141526 	var db uintptr
 141527 
 141528 	Xsqlite3StartTable(tls, pParse, pName1, pName2, 0, 0, 1, ifNotExists)
 141529 	pTable = (*Parse)(unsafe.Pointer(pParse)).FpNewTable
 141530 	if pTable == uintptr(0) {
 141531 		return
 141532 	}
 141533 
 141534 	(*Table)(unsafe.Pointer(pTable)).FeTabType = U8(TABTYP_VTAB)
 141535 
 141536 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 141537 
 141538 	addModuleArgument(tls, pParse, pTable, Xsqlite3NameFromToken(tls, db, pModuleName))
 141539 	addModuleArgument(tls, pParse, pTable, uintptr(0))
 141540 	addModuleArgument(tls, pParse, pTable, Xsqlite3DbStrDup(tls, db, (*Table)(unsafe.Pointer(pTable)).FzName))
 141541 
 141542 	(*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fn = uint32(int32((int64((*Token)(unsafe.Pointer(pModuleName)).Fz+uintptr((*Token)(unsafe.Pointer(pModuleName)).Fn)) - int64((*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) / 1))
 141543 
 141544 	if *(*uintptr)(unsafe.Pointer(pTable + 64 + 8)) != 0 {
 141545 		var iDb int32 = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTable)).FpSchema)
 141546 
 141547 		Xsqlite3AuthCheck(tls, pParse, SQLITE_CREATE_VTABLE, (*Table)(unsafe.Pointer(pTable)).FzName,
 141548 			*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTable + 64 + 8)))), (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb+uintptr(iDb)*32)).FzDbSName)
 141549 	}
 141550 }
 141551 
 141552 func addArgumentToVtab(tls *libc.TLS, pParse uintptr) {
 141553 	if (*Parse)(unsafe.Pointer(pParse)).FsArg.Fz != 0 && (*Parse)(unsafe.Pointer(pParse)).FpNewTable != 0 {
 141554 		var z uintptr = (*Parse)(unsafe.Pointer(pParse)).FsArg.Fz
 141555 		var n int32 = int32((*Parse)(unsafe.Pointer(pParse)).FsArg.Fn)
 141556 		var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 141557 		addModuleArgument(tls, pParse, (*Parse)(unsafe.Pointer(pParse)).FpNewTable, Xsqlite3DbStrNDup(tls, db, z, uint64(n)))
 141558 	}
 141559 }
 141560 
 141561 // The parser calls this routine after the CREATE VIRTUAL TABLE statement
 141562 // has been completely parsed.
 141563 func Xsqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) {
 141564 	bp := tls.Alloc(64)
 141565 	defer tls.Free(64)
 141566 
 141567 	var pTab uintptr = (*Parse)(unsafe.Pointer(pParse)).FpNewTable
 141568 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 141569 
 141570 	if pTab == uintptr(0) {
 141571 		return
 141572 	}
 141573 
 141574 	addArgumentToVtab(tls, pParse)
 141575 	(*Parse)(unsafe.Pointer(pParse)).FsArg.Fz = uintptr(0)
 141576 	if *(*int32)(unsafe.Pointer(pTab + 64)) < 1 {
 141577 		return
 141578 	}
 141579 
 141580 	if !(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0) {
 141581 		var zStmt uintptr
 141582 		var zWhere uintptr
 141583 		var iDb int32
 141584 		var iReg int32
 141585 		var v uintptr
 141586 
 141587 		Xsqlite3MayAbort(tls, pParse)
 141588 
 141589 		if pEnd != 0 {
 141590 			(*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fn = uint32(int32((int64((*Token)(unsafe.Pointer(pEnd)).Fz)-int64((*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz))/1)) + (*Token)(unsafe.Pointer(pEnd)).Fn
 141591 		}
 141592 		zStmt = Xsqlite3MPrintf(tls, db, ts+22655, libc.VaList(bp, pParse+272))
 141593 
 141594 		iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
 141595 		Xsqlite3NestedParse(tls, pParse,
 141596 			ts+22679,
 141597 			libc.VaList(bp+8, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName,
 141598 				(*Table)(unsafe.Pointer(pTab)).FzName,
 141599 				(*Table)(unsafe.Pointer(pTab)).FzName,
 141600 				zStmt,
 141601 				(*Parse)(unsafe.Pointer(pParse)).FregRowid))
 141602 		v = Xsqlite3GetVdbe(tls, pParse)
 141603 		Xsqlite3ChangeCookie(tls, pParse, iDb)
 141604 
 141605 		Xsqlite3VdbeAddOp0(tls, v, OP_Expire)
 141606 		zWhere = Xsqlite3MPrintf(tls, db, ts+22778, libc.VaList(bp+48, (*Table)(unsafe.Pointer(pTab)).FzName, zStmt))
 141607 		Xsqlite3VdbeAddParseSchemaOp(tls, v, iDb, zWhere, uint16(0))
 141608 		Xsqlite3DbFree(tls, db, zStmt)
 141609 
 141610 		iReg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 141611 		Xsqlite3VdbeLoadString(tls, v, iReg, (*Table)(unsafe.Pointer(pTab)).FzName)
 141612 		Xsqlite3VdbeAddOp2(tls, v, OP_VCreate, iDb, iReg)
 141613 	} else {
 141614 		var pOld uintptr
 141615 		var pSchema uintptr = (*Table)(unsafe.Pointer(pTab)).FpSchema
 141616 		var zName uintptr = (*Table)(unsafe.Pointer(pTab)).FzName
 141617 
 141618 		Xsqlite3MarkAllShadowTablesOf(tls, db, pTab)
 141619 		pOld = Xsqlite3HashInsert(tls, pSchema+8, zName, pTab)
 141620 		if pOld != 0 {
 141621 			Xsqlite3OomFault(tls, db)
 141622 
 141623 			return
 141624 		}
 141625 		(*Parse)(unsafe.Pointer(pParse)).FpNewTable = uintptr(0)
 141626 	}
 141627 }
 141628 
 141629 // The parser calls this routine when it sees the first token
 141630 // of an argument to the module name in a CREATE VIRTUAL TABLE statement.
 141631 func Xsqlite3VtabArgInit(tls *libc.TLS, pParse uintptr) {
 141632 	addArgumentToVtab(tls, pParse)
 141633 	(*Parse)(unsafe.Pointer(pParse)).FsArg.Fz = uintptr(0)
 141634 	(*Parse)(unsafe.Pointer(pParse)).FsArg.Fn = uint32(0)
 141635 }
 141636 
 141637 // The parser calls this routine for each token after the first token
 141638 // in an argument to the module name in a CREATE VIRTUAL TABLE statement.
 141639 func Xsqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) {
 141640 	var pArg uintptr = pParse + 384
 141641 	if (*Token)(unsafe.Pointer(pArg)).Fz == uintptr(0) {
 141642 		(*Token)(unsafe.Pointer(pArg)).Fz = (*Token)(unsafe.Pointer(p)).Fz
 141643 		(*Token)(unsafe.Pointer(pArg)).Fn = (*Token)(unsafe.Pointer(p)).Fn
 141644 	} else {
 141645 		(*Token)(unsafe.Pointer(pArg)).Fn = uint32(int32((int64((*Token)(unsafe.Pointer(p)).Fz+uintptr((*Token)(unsafe.Pointer(p)).Fn)) - int64((*Token)(unsafe.Pointer(pArg)).Fz)) / 1))
 141646 	}
 141647 }
 141648 
 141649 func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, xConstruct uintptr, pzErr uintptr) int32 {
 141650 	bp := tls.Alloc(72)
 141651 	defer tls.Free(72)
 141652 
 141653 	var pVTable uintptr
 141654 	var rc int32
 141655 	var azArg uintptr
 141656 	var nArg int32 = *(*int32)(unsafe.Pointer(pTab + 64))
 141657 	*(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0)
 141658 	var zModuleName uintptr
 141659 	var iDb int32
 141660 	var pCtx uintptr
 141661 
 141662 	azArg = *(*uintptr)(unsafe.Pointer(pTab + 64 + 8))
 141663 
 141664 	for pCtx = (*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx; pCtx != 0; pCtx = (*VtabCtx)(unsafe.Pointer(pCtx)).FpPrior {
 141665 		if (*VtabCtx)(unsafe.Pointer(pCtx)).FpTab == pTab {
 141666 			*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db,
 141667 				ts+22797, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
 141668 			return SQLITE_LOCKED
 141669 		}
 141670 	}
 141671 
 141672 	zModuleName = Xsqlite3DbStrDup(tls, db, (*Table)(unsafe.Pointer(pTab)).FzName)
 141673 	if !(zModuleName != 0) {
 141674 		return SQLITE_NOMEM
 141675 	}
 141676 
 141677 	pVTable = Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(VTable{})))
 141678 	if !(pVTable != 0) {
 141679 		Xsqlite3OomFault(tls, db)
 141680 		Xsqlite3DbFree(tls, db, zModuleName)
 141681 		return SQLITE_NOMEM
 141682 	}
 141683 	(*VTable)(unsafe.Pointer(pVTable)).Fdb = db
 141684 	(*VTable)(unsafe.Pointer(pVTable)).FpMod = pMod
 141685 	(*VTable)(unsafe.Pointer(pVTable)).FeVtabRisk = U8(SQLITE_VTABRISK_Normal)
 141686 
 141687 	iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
 141688 	*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTab + 64 + 8)) + 1*8)) = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
 141689 
 141690 	(*VtabCtx)(unsafe.Pointer(bp + 32)).FpTab = pTab
 141691 	(*VtabCtx)(unsafe.Pointer(bp + 32)).FpVTable = pVTable
 141692 	(*VtabCtx)(unsafe.Pointer(bp + 32)).FpPrior = (*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx
 141693 	(*VtabCtx)(unsafe.Pointer(bp + 32)).FbDeclared = 0
 141694 	(*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx = bp + 32
 141695 	(*Table)(unsafe.Pointer(pTab)).FnTabRef++
 141696 	rc = (*struct {
 141697 		f func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32
 141698 	})(unsafe.Pointer(&struct{ uintptr }{xConstruct})).f(tls, db, (*Module)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+16, bp+64)
 141699 	Xsqlite3DeleteTable(tls, db, pTab)
 141700 	(*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx = (*VtabCtx)(unsafe.Pointer(bp + 32)).FpPrior
 141701 	if rc == SQLITE_NOMEM {
 141702 		Xsqlite3OomFault(tls, db)
 141703 	}
 141704 
 141705 	if SQLITE_OK != rc {
 141706 		if *(*uintptr)(unsafe.Pointer(bp + 64)) == uintptr(0) {
 141707 			*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+22839, libc.VaList(bp+8, zModuleName))
 141708 		} else {
 141709 			*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+4493, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp + 64))))
 141710 			Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 64)))
 141711 		}
 141712 		Xsqlite3DbFree(tls, db, pVTable)
 141713 	} else if (*VTable)(unsafe.Pointer(pVTable)).FpVtab != 0 {
 141714 		libc.Xmemset(tls, (*VTable)(unsafe.Pointer(pVTable)).FpVtab, 0, uint64(unsafe.Sizeof(Sqlite3_vtab{})))
 141715 		(*Sqlite3_vtab)(unsafe.Pointer((*VTable)(unsafe.Pointer(pVTable)).FpVtab)).FpModule = (*Module)(unsafe.Pointer(pMod)).FpModule
 141716 		(*Module)(unsafe.Pointer(pMod)).FnRefModule++
 141717 		(*VTable)(unsafe.Pointer(pVTable)).FnRef = 1
 141718 		if (*VtabCtx)(unsafe.Pointer(bp+32)).FbDeclared == 0 {
 141719 			var zFormat uintptr = ts + 22869
 141720 			*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+24, (*Table)(unsafe.Pointer(pTab)).FzName))
 141721 			Xsqlite3VtabUnlock(tls, pVTable)
 141722 			rc = SQLITE_ERROR
 141723 		} else {
 141724 			var iCol int32
 141725 			var oooHidden U16 = U16(0)
 141726 
 141727 			(*VTable)(unsafe.Pointer(pVTable)).FpNext = *(*uintptr)(unsafe.Pointer(pTab + 64 + 16))
 141728 			*(*uintptr)(unsafe.Pointer(pTab + 64 + 16)) = pVTable
 141729 
 141730 			for iCol = 0; iCol < int32((*Table)(unsafe.Pointer(pTab)).FnCol); iCol++ {
 141731 				var zType uintptr = Xsqlite3ColumnType(tls, (*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*24, ts+1544)
 141732 				var nType int32
 141733 				var i int32 = 0
 141734 				nType = Xsqlite3Strlen30(tls, zType)
 141735 				for i = 0; i < nType; i++ {
 141736 					if 0 == Xsqlite3_strnicmp(tls, ts+17516, zType+uintptr(i), 6) &&
 141737 						(i == 0 || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i-1)))) == ' ') &&
 141738 						(int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+6)))) == 0 || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+6)))) == ' ') {
 141739 						break
 141740 					}
 141741 				}
 141742 				if i < nType {
 141743 					var j int32
 141744 					var nDel int32 = 6 + func() int32 {
 141745 						if *(*int8)(unsafe.Pointer(zType + uintptr(i+6))) != 0 {
 141746 							return 1
 141747 						}
 141748 						return 0
 141749 					}()
 141750 					for j = i; j+nDel <= nType; j++ {
 141751 						*(*int8)(unsafe.Pointer(zType + uintptr(j))) = *(*int8)(unsafe.Pointer(zType + uintptr(j+nDel)))
 141752 					}
 141753 					if int32(*(*int8)(unsafe.Pointer(zType + uintptr(i)))) == 0 && i > 0 {
 141754 						*(*int8)(unsafe.Pointer(zType + uintptr(i-1))) = int8(0)
 141755 					}
 141756 					*(*U16)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*24 + 16)) |= U16(COLFLAG_HIDDEN)
 141757 					*(*U32)(unsafe.Pointer(pTab + 48)) |= U32(TF_HasHidden)
 141758 					oooHidden = U16(TF_OOOHidden)
 141759 				} else {
 141760 					*(*U32)(unsafe.Pointer(pTab + 48)) |= U32(oooHidden)
 141761 				}
 141762 			}
 141763 		}
 141764 	}
 141765 
 141766 	Xsqlite3DbFree(tls, db, zModuleName)
 141767 	return rc
 141768 }
 141769 
 141770 // This function is invoked by the parser to call the xConnect() method
 141771 // of the virtual table pTab. If an error occurs, an error code is returned
 141772 // and an error left in pParse.
 141773 //
 141774 // This call is a no-op if table pTab is not a virtual table.
 141775 func Xsqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 {
 141776 	bp := tls.Alloc(24)
 141777 	defer tls.Free(24)
 141778 
 141779 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 141780 	var zMod uintptr
 141781 	var pMod uintptr
 141782 	var rc int32
 141783 
 141784 	if Xsqlite3GetVTable(tls, db, pTab) != 0 {
 141785 		return SQLITE_OK
 141786 	}
 141787 
 141788 	zMod = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTab + 64 + 8))))
 141789 	pMod = Xsqlite3HashFind(tls, db+576, zMod)
 141790 
 141791 	if !(pMod != 0) {
 141792 		var zModule uintptr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTab + 64 + 8))))
 141793 		Xsqlite3ErrorMsg(tls, pParse, ts+22915, libc.VaList(bp, zModule))
 141794 		rc = SQLITE_ERROR
 141795 	} else {
 141796 		*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
 141797 		rc = vtabCallConstructor(tls, db, pTab, pMod, (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxConnect, bp+16)
 141798 		if rc != SQLITE_OK {
 141799 			Xsqlite3ErrorMsg(tls, pParse, ts+4493, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 16))))
 141800 			(*Parse)(unsafe.Pointer(pParse)).Frc = rc
 141801 		}
 141802 		Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 16)))
 141803 	}
 141804 
 141805 	return rc
 141806 }
 141807 
 141808 func growVTrans(tls *libc.TLS, db uintptr) int32 {
 141809 	var ARRAY_INCR int32 = 5
 141810 
 141811 	if (*Sqlite3)(unsafe.Pointer(db)).FnVTrans%ARRAY_INCR == 0 {
 141812 		var aVTrans uintptr
 141813 		var nBytes Sqlite3_int64 = Sqlite3_int64(uint64(unsafe.Sizeof(uintptr(0))) * uint64(Sqlite3_int64((*Sqlite3)(unsafe.Pointer(db)).FnVTrans)+Sqlite3_int64(ARRAY_INCR)))
 141814 		aVTrans = Xsqlite3DbRealloc(tls, db, (*Sqlite3)(unsafe.Pointer(db)).FaVTrans, uint64(nBytes))
 141815 		if !(aVTrans != 0) {
 141816 			return SQLITE_NOMEM
 141817 		}
 141818 		libc.Xmemset(tls, aVTrans+uintptr((*Sqlite3)(unsafe.Pointer(db)).FnVTrans)*8, 0, uint64(unsafe.Sizeof(uintptr(0)))*uint64(ARRAY_INCR))
 141819 		(*Sqlite3)(unsafe.Pointer(db)).FaVTrans = aVTrans
 141820 	}
 141821 
 141822 	return SQLITE_OK
 141823 }
 141824 
 141825 func addToVTrans(tls *libc.TLS, db uintptr, pVTab uintptr) {
 141826 	*(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaVTrans + uintptr(libc.PostIncInt32(&(*Sqlite3)(unsafe.Pointer(db)).FnVTrans, 1))*8)) = pVTab
 141827 	Xsqlite3VtabLock(tls, pVTab)
 141828 }
 141829 
 141830 // This function is invoked by the vdbe to call the xCreate method
 141831 // of the virtual table named zTab in database iDb.
 141832 //
 141833 // If an error occurs, *pzErr is set to point to an English language
 141834 // description of the error and an SQLITE_XXX error code is returned.
 141835 // In this case the caller must call sqlite3DbFree(db, ) on *pzErr.
 141836 func Xsqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, pzErr uintptr) int32 {
 141837 	bp := tls.Alloc(8)
 141838 	defer tls.Free(8)
 141839 
 141840 	var rc int32 = SQLITE_OK
 141841 	var pTab uintptr
 141842 	var pMod uintptr
 141843 	var zMod uintptr
 141844 
 141845 	pTab = Xsqlite3FindTable(tls, db, zTab, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName)
 141846 
 141847 	zMod = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTab + 64 + 8))))
 141848 	pMod = Xsqlite3HashFind(tls, db+576, zMod)
 141849 
 141850 	if pMod == uintptr(0) || (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxCreate == uintptr(0) || (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxDestroy == uintptr(0) {
 141851 		*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+22915, libc.VaList(bp, zMod))
 141852 		rc = SQLITE_ERROR
 141853 	} else {
 141854 		rc = vtabCallConstructor(tls, db, pTab, pMod, (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxCreate, pzErr)
 141855 	}
 141856 
 141857 	if rc == SQLITE_OK && Xsqlite3GetVTable(tls, db, pTab) != 0 {
 141858 		rc = growVTrans(tls, db)
 141859 		if rc == SQLITE_OK {
 141860 			addToVTrans(tls, db, Xsqlite3GetVTable(tls, db, pTab))
 141861 		}
 141862 	}
 141863 
 141864 	return rc
 141865 }
 141866 
 141867 // This function is used to set the schema of a virtual table.  It is only
 141868 // valid to call this function from within the xCreate() or xConnect() of a
 141869 // virtual table module.
 141870 func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) int32 {
 141871 	bp := tls.Alloc(432)
 141872 	defer tls.Free(432)
 141873 
 141874 	var pCtx uintptr
 141875 	var rc int32 = SQLITE_OK
 141876 	var pTab uintptr
 141877 
 141878 	var initBusy int32
 141879 
 141880 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 141881 	pCtx = (*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx
 141882 	if !(pCtx != 0) || (*VtabCtx)(unsafe.Pointer(pCtx)).FbDeclared != 0 {
 141883 		Xsqlite3Error(tls, db, SQLITE_MISUSE)
 141884 		Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 141885 		return Xsqlite3MisuseError(tls, 151102)
 141886 	}
 141887 	pTab = (*VtabCtx)(unsafe.Pointer(pCtx)).FpTab
 141888 
 141889 	Xsqlite3ParseObjectInit(tls, bp+8, db)
 141890 	(*Parse)(unsafe.Pointer(bp + 8)).FeParseMode = U8(PARSE_MODE_DECLARE_VTAB)
 141891 	(*Parse)(unsafe.Pointer(bp + 8)).FdisableTriggers = U8(1)
 141892 
 141893 	initBusy = int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy)
 141894 	(*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(0)
 141895 	(*Parse)(unsafe.Pointer(bp + 8)).FnQueryLoop = U32(1)
 141896 	if SQLITE_OK == Xsqlite3RunParser(tls, bp+8, zCreateTable) &&
 141897 		(*Parse)(unsafe.Pointer(bp+8)).FpNewTable != uintptr(0) &&
 141898 		!(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) &&
 141899 		int32((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+8)).FpNewTable)).FeTabType) == TABTYP_NORM {
 141900 		if !(int32((*Table)(unsafe.Pointer(pTab)).FaCol) != 0) {
 141901 			var pNew uintptr = (*Parse)(unsafe.Pointer(bp + 8)).FpNewTable
 141902 			var pIdx uintptr
 141903 			(*Table)(unsafe.Pointer(pTab)).FaCol = (*Table)(unsafe.Pointer(pNew)).FaCol
 141904 			Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(pNew + 64 + 16)))
 141905 			(*Table)(unsafe.Pointer(pTab)).FnNVCol = libc.AssignPtrInt16(pTab+54, (*Table)(unsafe.Pointer(pNew)).FnCol)
 141906 			*(*U32)(unsafe.Pointer(pTab + 48)) |= (*Table)(unsafe.Pointer(pNew)).FtabFlags & U32(TF_WithoutRowid|TF_NoVisibleRowid)
 141907 			(*Table)(unsafe.Pointer(pNew)).FnCol = int16(0)
 141908 			(*Table)(unsafe.Pointer(pNew)).FaCol = uintptr(0)
 141909 
 141910 			if !((*Table)(unsafe.Pointer(pNew)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) &&
 141911 				(*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer((*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(pCtx)).FpVTable)).FpMod)).FpModule)).FxUpdate != uintptr(0) &&
 141912 				int32((*Index)(unsafe.Pointer(Xsqlite3PrimaryKeyIndex(tls, pNew))).FnKeyCol) != 1 {
 141913 				rc = SQLITE_ERROR
 141914 			}
 141915 			pIdx = (*Table)(unsafe.Pointer(pNew)).FpIndex
 141916 			if pIdx != 0 {
 141917 				(*Table)(unsafe.Pointer(pTab)).FpIndex = pIdx
 141918 				(*Table)(unsafe.Pointer(pNew)).FpIndex = uintptr(0)
 141919 				(*Index)(unsafe.Pointer(pIdx)).FpTable = pTab
 141920 			}
 141921 		}
 141922 		(*VtabCtx)(unsafe.Pointer(pCtx)).FbDeclared = 1
 141923 	} else {
 141924 		Xsqlite3ErrorWithMsg(tls, db, SQLITE_ERROR,
 141925 			func() uintptr {
 141926 				if (*Parse)(unsafe.Pointer(bp+8)).FzErrMsg != 0 {
 141927 					return ts + 4493
 141928 				}
 141929 				return uintptr(0)
 141930 			}(), libc.VaList(bp, (*Parse)(unsafe.Pointer(bp+8)).FzErrMsg))
 141931 		Xsqlite3DbFree(tls, db, (*Parse)(unsafe.Pointer(bp+8)).FzErrMsg)
 141932 		rc = SQLITE_ERROR
 141933 	}
 141934 	(*Parse)(unsafe.Pointer(bp + 8)).FeParseMode = U8(PARSE_MODE_NORMAL)
 141935 
 141936 	if (*Parse)(unsafe.Pointer(bp+8)).FpVdbe != 0 {
 141937 		Xsqlite3VdbeFinalize(tls, (*Parse)(unsafe.Pointer(bp+8)).FpVdbe)
 141938 	}
 141939 	Xsqlite3DeleteTable(tls, db, (*Parse)(unsafe.Pointer(bp+8)).FpNewTable)
 141940 	Xsqlite3ParseObjectReset(tls, bp+8)
 141941 	(*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(initBusy)
 141942 
 141943 	rc = Xsqlite3ApiExit(tls, db, rc)
 141944 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 141945 	return rc
 141946 }
 141947 
 141948 // This function is invoked by the vdbe to call the xDestroy method
 141949 // of the virtual table named zTab in database iDb. This occurs
 141950 // when a DROP TABLE is mentioned.
 141951 //
 141952 // This call is a no-op if zTab is not a virtual table.
 141953 func Xsqlite3VtabCallDestroy(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr) int32 {
 141954 	var rc int32 = SQLITE_OK
 141955 	var pTab uintptr
 141956 
 141957 	pTab = Xsqlite3FindTable(tls, db, zTab, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName)
 141958 	if pTab != uintptr(0) &&
 141959 		int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB &&
 141960 		*(*uintptr)(unsafe.Pointer(pTab + 64 + 16)) != uintptr(0) {
 141961 		var p uintptr
 141962 		var xDestroy uintptr
 141963 		for p = *(*uintptr)(unsafe.Pointer(pTab + 64 + 16)); p != 0; p = (*VTable)(unsafe.Pointer(p)).FpNext {
 141964 			if (*Sqlite3_vtab)(unsafe.Pointer((*VTable)(unsafe.Pointer(p)).FpVtab)).FnRef > 0 {
 141965 				return SQLITE_LOCKED
 141966 			}
 141967 		}
 141968 		p = vtabDisconnectAll(tls, db, pTab)
 141969 		xDestroy = (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer((*VTable)(unsafe.Pointer(p)).FpMod)).FpModule)).FxDestroy
 141970 		if xDestroy == uintptr(0) {
 141971 			xDestroy = (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer((*VTable)(unsafe.Pointer(p)).FpMod)).FpModule)).FxDisconnect
 141972 		}
 141973 
 141974 		(*Table)(unsafe.Pointer(pTab)).FnTabRef++
 141975 		rc = (*struct {
 141976 			f func(*libc.TLS, uintptr) int32
 141977 		})(unsafe.Pointer(&struct{ uintptr }{xDestroy})).f(tls, (*VTable)(unsafe.Pointer(p)).FpVtab)
 141978 
 141979 		if rc == SQLITE_OK {
 141980 			(*VTable)(unsafe.Pointer(p)).FpVtab = uintptr(0)
 141981 			*(*uintptr)(unsafe.Pointer(pTab + 64 + 16)) = uintptr(0)
 141982 			Xsqlite3VtabUnlock(tls, p)
 141983 		}
 141984 		Xsqlite3DeleteTable(tls, db, pTab)
 141985 	}
 141986 
 141987 	return rc
 141988 }
 141989 
 141990 func callFinaliser(tls *libc.TLS, db uintptr, offset int32) {
 141991 	var i int32
 141992 	if (*Sqlite3)(unsafe.Pointer(db)).FaVTrans != 0 {
 141993 		var aVTrans uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaVTrans
 141994 		(*Sqlite3)(unsafe.Pointer(db)).FaVTrans = uintptr(0)
 141995 		for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnVTrans; i++ {
 141996 			var pVTab uintptr = *(*uintptr)(unsafe.Pointer(aVTrans + uintptr(i)*8))
 141997 			var p uintptr = (*VTable)(unsafe.Pointer(pVTab)).FpVtab
 141998 			if p != 0 {
 141999 				var x uintptr
 142000 				x = *(*uintptr)(unsafe.Pointer((*Sqlite3_vtab)(unsafe.Pointer(p)).FpModule + uintptr(offset)))
 142001 				if x != 0 {
 142002 					(*struct {
 142003 						f func(*libc.TLS, uintptr) int32
 142004 					})(unsafe.Pointer(&struct{ uintptr }{x})).f(tls, p)
 142005 				}
 142006 			}
 142007 			(*VTable)(unsafe.Pointer(pVTab)).FiSavepoint = 0
 142008 			Xsqlite3VtabUnlock(tls, pVTab)
 142009 		}
 142010 		Xsqlite3DbFree(tls, db, aVTrans)
 142011 		(*Sqlite3)(unsafe.Pointer(db)).FnVTrans = 0
 142012 	}
 142013 }
 142014 
 142015 // Invoke the xSync method of all virtual tables in the sqlite3.aVTrans
 142016 // array. Return the error code for the first error that occurs, or
 142017 // SQLITE_OK if all xSync operations are successful.
 142018 //
 142019 // If an error message is available, leave it in p->zErrMsg.
 142020 func Xsqlite3VtabSync(tls *libc.TLS, db uintptr, p uintptr) int32 {
 142021 	var i int32
 142022 	var rc int32 = SQLITE_OK
 142023 	var aVTrans uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaVTrans
 142024 
 142025 	(*Sqlite3)(unsafe.Pointer(db)).FaVTrans = uintptr(0)
 142026 	for i = 0; rc == SQLITE_OK && i < (*Sqlite3)(unsafe.Pointer(db)).FnVTrans; i++ {
 142027 		var x uintptr
 142028 		var pVtab uintptr = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aVTrans + uintptr(i)*8)))).FpVtab
 142029 		if pVtab != 0 && libc.AssignUintptr(&x, (*Sqlite3_module)(unsafe.Pointer((*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FpModule)).FxSync) != uintptr(0) {
 142030 			rc = (*struct {
 142031 				f func(*libc.TLS, uintptr) int32
 142032 			})(unsafe.Pointer(&struct{ uintptr }{x})).f(tls, pVtab)
 142033 			Xsqlite3VtabImportErrmsg(tls, p, pVtab)
 142034 		}
 142035 	}
 142036 	(*Sqlite3)(unsafe.Pointer(db)).FaVTrans = aVTrans
 142037 	return rc
 142038 }
 142039 
 142040 // Invoke the xRollback method of all virtual tables in the
 142041 // sqlite3.aVTrans array. Then clear the array itself.
 142042 func Xsqlite3VtabRollback(tls *libc.TLS, db uintptr) int32 {
 142043 	callFinaliser(tls, db, int32(uintptr(0)+136))
 142044 	return SQLITE_OK
 142045 }
 142046 
 142047 // Invoke the xCommit method of all virtual tables in the
 142048 // sqlite3.aVTrans array. Then clear the array itself.
 142049 func Xsqlite3VtabCommit(tls *libc.TLS, db uintptr) int32 {
 142050 	callFinaliser(tls, db, int32(uintptr(0)+128))
 142051 	return SQLITE_OK
 142052 }
 142053 
 142054 // If the virtual table pVtab supports the transaction interface
 142055 // (xBegin/xRollback/xCommit and optionally xSync) and a transaction is
 142056 // not currently open, invoke the xBegin method now.
 142057 //
 142058 // If the xBegin call is successful, place the sqlite3_vtab pointer
 142059 // in the sqlite3.aVTrans array.
 142060 func Xsqlite3VtabBegin(tls *libc.TLS, db uintptr, pVTab uintptr) int32 {
 142061 	var rc int32 = SQLITE_OK
 142062 	var pModule uintptr
 142063 
 142064 	if (*Sqlite3)(unsafe.Pointer(db)).FnVTrans > 0 && (*Sqlite3)(unsafe.Pointer(db)).FaVTrans == uintptr(0) {
 142065 		return SQLITE_LOCKED
 142066 	}
 142067 	if !(pVTab != 0) {
 142068 		return SQLITE_OK
 142069 	}
 142070 	pModule = (*Sqlite3_vtab)(unsafe.Pointer((*VTable)(unsafe.Pointer(pVTab)).FpVtab)).FpModule
 142071 
 142072 	if (*Sqlite3_module)(unsafe.Pointer(pModule)).FxBegin != 0 {
 142073 		var i int32
 142074 
 142075 		for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnVTrans; i++ {
 142076 			if *(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaVTrans + uintptr(i)*8)) == pVTab {
 142077 				return SQLITE_OK
 142078 			}
 142079 		}
 142080 
 142081 		rc = growVTrans(tls, db)
 142082 		if rc == SQLITE_OK {
 142083 			rc = (*struct {
 142084 				f func(*libc.TLS, uintptr) int32
 142085 			})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule)).FxBegin})).f(tls, (*VTable)(unsafe.Pointer(pVTab)).FpVtab)
 142086 			if rc == SQLITE_OK {
 142087 				var iSvpt int32 = (*Sqlite3)(unsafe.Pointer(db)).FnStatement + (*Sqlite3)(unsafe.Pointer(db)).FnSavepoint
 142088 				addToVTrans(tls, db, pVTab)
 142089 				if iSvpt != 0 && (*Sqlite3_module)(unsafe.Pointer(pModule)).FxSavepoint != 0 {
 142090 					(*VTable)(unsafe.Pointer(pVTab)).FiSavepoint = iSvpt
 142091 					rc = (*struct {
 142092 						f func(*libc.TLS, uintptr, int32) int32
 142093 					})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pModule)).FxSavepoint})).f(tls, (*VTable)(unsafe.Pointer(pVTab)).FpVtab, iSvpt-1)
 142094 				}
 142095 			}
 142096 		}
 142097 	}
 142098 	return rc
 142099 }
 142100 
 142101 // Invoke either the xSavepoint, xRollbackTo or xRelease method of all
 142102 // virtual tables that currently have an open transaction. Pass iSavepoint
 142103 // as the second argument to the virtual table method invoked.
 142104 //
 142105 // If op is SAVEPOINT_BEGIN, the xSavepoint method is invoked. If it is
 142106 // SAVEPOINT_ROLLBACK, the xRollbackTo method. Otherwise, if op is
 142107 // SAVEPOINT_RELEASE, then the xRelease method of each virtual table with
 142108 // an open transaction is invoked.
 142109 //
 142110 // If any virtual table method returns an error code other than SQLITE_OK,
 142111 // processing is abandoned and the error returned to the caller of this
 142112 // function immediately. If all calls to virtual table methods are successful,
 142113 // SQLITE_OK is returned.
 142114 func Xsqlite3VtabSavepoint(tls *libc.TLS, db uintptr, op int32, iSavepoint int32) int32 {
 142115 	var rc int32 = SQLITE_OK
 142116 
 142117 	if (*Sqlite3)(unsafe.Pointer(db)).FaVTrans != 0 {
 142118 		var i int32
 142119 		for i = 0; rc == SQLITE_OK && i < (*Sqlite3)(unsafe.Pointer(db)).FnVTrans; i++ {
 142120 			var pVTab uintptr = *(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaVTrans + uintptr(i)*8))
 142121 			var pMod uintptr = (*Module)(unsafe.Pointer((*VTable)(unsafe.Pointer(pVTab)).FpMod)).FpModule
 142122 			if (*VTable)(unsafe.Pointer(pVTab)).FpVtab != 0 && (*Sqlite3_module)(unsafe.Pointer(pMod)).FiVersion >= 2 {
 142123 				var xMethod uintptr
 142124 				Xsqlite3VtabLock(tls, pVTab)
 142125 				switch op {
 142126 				case SAVEPOINT_BEGIN:
 142127 					xMethod = (*Sqlite3_module)(unsafe.Pointer(pMod)).FxSavepoint
 142128 					(*VTable)(unsafe.Pointer(pVTab)).FiSavepoint = iSavepoint + 1
 142129 					break
 142130 					fallthrough
 142131 				case SAVEPOINT_ROLLBACK:
 142132 					xMethod = (*Sqlite3_module)(unsafe.Pointer(pMod)).FxRollbackTo
 142133 					break
 142134 					fallthrough
 142135 				default:
 142136 					xMethod = (*Sqlite3_module)(unsafe.Pointer(pMod)).FxRelease
 142137 					break
 142138 				}
 142139 				if xMethod != 0 && (*VTable)(unsafe.Pointer(pVTab)).FiSavepoint > iSavepoint {
 142140 					rc = (*struct {
 142141 						f func(*libc.TLS, uintptr, int32) int32
 142142 					})(unsafe.Pointer(&struct{ uintptr }{xMethod})).f(tls, (*VTable)(unsafe.Pointer(pVTab)).FpVtab, iSavepoint)
 142143 				}
 142144 				Xsqlite3VtabUnlock(tls, pVTab)
 142145 			}
 142146 		}
 142147 	}
 142148 	return rc
 142149 }
 142150 
 142151 // The first parameter (pDef) is a function implementation.  The
 142152 // second parameter (pExpr) is the first argument to this function.
 142153 // If pExpr is a column in a virtual table, then let the virtual
 142154 // table implementation have an opportunity to overload the function.
 142155 //
 142156 // This routine is used to allow virtual table implementations to
 142157 // overload MATCH, LIKE, GLOB, and REGEXP operators.
 142158 //
 142159 // Return either the pDef argument (indicating no change) or a
 142160 // new FuncDef structure that is marked as ephemeral using the
 142161 // SQLITE_FUNC_EPHEM flag.
 142162 func Xsqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg int32, pExpr uintptr) uintptr {
 142163 	bp := tls.Alloc(16)
 142164 	defer tls.Free(16)
 142165 
 142166 	var pTab uintptr
 142167 	var pVtab uintptr
 142168 	var pMod uintptr
 142169 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 142170 	*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 142171 	var pNew uintptr
 142172 	var rc int32 = 0
 142173 
 142174 	if pExpr == uintptr(0) {
 142175 		return pDef
 142176 	}
 142177 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLUMN {
 142178 		return pDef
 142179 	}
 142180 
 142181 	pTab = *(*uintptr)(unsafe.Pointer(pExpr + 64))
 142182 	if pTab == uintptr(0) {
 142183 		return pDef
 142184 	}
 142185 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
 142186 		return pDef
 142187 	}
 142188 	pVtab = (*VTable)(unsafe.Pointer(Xsqlite3GetVTable(tls, db, pTab))).FpVtab
 142189 
 142190 	pMod = (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FpModule
 142191 	if (*Sqlite3_module)(unsafe.Pointer(pMod)).FxFindFunction == uintptr(0) {
 142192 		return pDef
 142193 	}
 142194 
 142195 	rc = (*struct {
 142196 		f func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32
 142197 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pMod)).FxFindFunction})).f(tls, pVtab, nArg, (*FuncDef)(unsafe.Pointer(pDef)).FzName, bp, bp+8)
 142198 	if rc == 0 {
 142199 		return pDef
 142200 	}
 142201 
 142202 	pNew = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(FuncDef{}))+
 142203 		uint64(Xsqlite3Strlen30(tls, (*FuncDef)(unsafe.Pointer(pDef)).FzName))+uint64(1))
 142204 	if pNew == uintptr(0) {
 142205 		return pDef
 142206 	}
 142207 	*(*FuncDef)(unsafe.Pointer(pNew)) = *(*FuncDef)(unsafe.Pointer(pDef))
 142208 	(*FuncDef)(unsafe.Pointer(pNew)).FzName = pNew + 1*72
 142209 	libc.Xmemcpy(tls, pNew+1*72, (*FuncDef)(unsafe.Pointer(pDef)).FzName, uint64(Xsqlite3Strlen30(tls, (*FuncDef)(unsafe.Pointer(pDef)).FzName)+1))
 142210 	(*FuncDef)(unsafe.Pointer(pNew)).FxSFunc = *(*uintptr)(unsafe.Pointer(bp))
 142211 	(*FuncDef)(unsafe.Pointer(pNew)).FpUserData = *(*uintptr)(unsafe.Pointer(bp + 8))
 142212 	*(*U32)(unsafe.Pointer(pNew + 4)) |= U32(SQLITE_FUNC_EPHEM)
 142213 	return pNew
 142214 }
 142215 
 142216 // Make sure virtual table pTab is contained in the pParse->apVirtualLock[]
 142217 // array so that an OP_VBegin will get generated for it.  Add pTab to the
 142218 // array if it is missing.  If pTab is already in the array, this routine
 142219 // is a no-op.
 142220 func Xsqlite3VtabMakeWritable(tls *libc.TLS, pParse uintptr, pTab uintptr) {
 142221 	var pToplevel uintptr = func() uintptr {
 142222 		if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
 142223 			return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
 142224 		}
 142225 		return pParse
 142226 	}()
 142227 	var i int32
 142228 	var n int32
 142229 	var apVtabLock uintptr
 142230 
 142231 	for i = 0; i < (*Parse)(unsafe.Pointer(pToplevel)).FnVtabLock; i++ {
 142232 		if pTab == *(*uintptr)(unsafe.Pointer((*Parse)(unsafe.Pointer(pToplevel)).FapVtabLock + uintptr(i)*8)) {
 142233 			return
 142234 		}
 142235 	}
 142236 	n = int32(uint64((*Parse)(unsafe.Pointer(pToplevel)).FnVtabLock+1) * uint64(unsafe.Sizeof(uintptr(0))))
 142237 	apVtabLock = Xsqlite3Realloc(tls, (*Parse)(unsafe.Pointer(pToplevel)).FapVtabLock, uint64(n))
 142238 	if apVtabLock != 0 {
 142239 		(*Parse)(unsafe.Pointer(pToplevel)).FapVtabLock = apVtabLock
 142240 		*(*uintptr)(unsafe.Pointer((*Parse)(unsafe.Pointer(pToplevel)).FapVtabLock + uintptr(libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pToplevel)).FnVtabLock, 1))*8)) = pTab
 142241 	} else {
 142242 		Xsqlite3OomFault(tls, (*Parse)(unsafe.Pointer(pToplevel)).Fdb)
 142243 	}
 142244 }
 142245 
 142246 // Check to see if virtual table module pMod can be have an eponymous
 142247 // virtual table instance.  If it can, create one if one does not already
 142248 // exist. Return non-zero if either the eponymous virtual table instance
 142249 // exists when this routine returns or if an attempt to create it failed
 142250 // and an error message was left in pParse.
 142251 //
 142252 // An eponymous virtual table instance is one that is named after its
 142253 // module, and more importantly, does not require a CREATE VIRTUAL TABLE
 142254 // statement in order to come into existance.  Eponymous virtual table
 142255 // instances always exist.  They cannot be DROP-ed.
 142256 //
 142257 // Any virtual table module for which xConnect and xCreate are the same
 142258 // method can have an eponymous virtual table instance.
 142259 func Xsqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) int32 {
 142260 	bp := tls.Alloc(16)
 142261 	defer tls.Free(16)
 142262 
 142263 	var pModule uintptr = (*Module)(unsafe.Pointer(pMod)).FpModule
 142264 	var pTab uintptr
 142265 	*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 142266 	var rc int32
 142267 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 142268 	if (*Module)(unsafe.Pointer(pMod)).FpEpoTab != 0 {
 142269 		return 1
 142270 	}
 142271 	if (*Sqlite3_module)(unsafe.Pointer(pModule)).FxCreate != uintptr(0) && (*Sqlite3_module)(unsafe.Pointer(pModule)).FxCreate != (*Sqlite3_module)(unsafe.Pointer(pModule)).FxConnect {
 142272 		return 0
 142273 	}
 142274 	pTab = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Table{})))
 142275 	if pTab == uintptr(0) {
 142276 		return 0
 142277 	}
 142278 	(*Table)(unsafe.Pointer(pTab)).FzName = Xsqlite3DbStrDup(tls, db, (*Module)(unsafe.Pointer(pMod)).FzName)
 142279 	if (*Table)(unsafe.Pointer(pTab)).FzName == uintptr(0) {
 142280 		Xsqlite3DbFree(tls, db, pTab)
 142281 		return 0
 142282 	}
 142283 	(*Module)(unsafe.Pointer(pMod)).FpEpoTab = pTab
 142284 	(*Table)(unsafe.Pointer(pTab)).FnTabRef = U32(1)
 142285 	(*Table)(unsafe.Pointer(pTab)).FeTabType = U8(TABTYP_VTAB)
 142286 	(*Table)(unsafe.Pointer(pTab)).FpSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema
 142287 
 142288 	(*Table)(unsafe.Pointer(pTab)).FiPKey = int16(-1)
 142289 	*(*U32)(unsafe.Pointer(pTab + 48)) |= U32(TF_Eponymous)
 142290 	addModuleArgument(tls, pParse, pTab, Xsqlite3DbStrDup(tls, db, (*Table)(unsafe.Pointer(pTab)).FzName))
 142291 	addModuleArgument(tls, pParse, pTab, uintptr(0))
 142292 	addModuleArgument(tls, pParse, pTab, Xsqlite3DbStrDup(tls, db, (*Table)(unsafe.Pointer(pTab)).FzName))
 142293 	rc = vtabCallConstructor(tls, db, pTab, pMod, (*Sqlite3_module)(unsafe.Pointer(pModule)).FxConnect, bp+8)
 142294 	if rc != 0 {
 142295 		Xsqlite3ErrorMsg(tls, pParse, ts+4493, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 8))))
 142296 		Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)))
 142297 		Xsqlite3VtabEponymousTableClear(tls, db, pMod)
 142298 	}
 142299 	return 1
 142300 }
 142301 
 142302 // Erase the eponymous virtual table instance associated with
 142303 // virtual table module pMod, if it exists.
 142304 func Xsqlite3VtabEponymousTableClear(tls *libc.TLS, db uintptr, pMod uintptr) {
 142305 	var pTab uintptr = (*Module)(unsafe.Pointer(pMod)).FpEpoTab
 142306 	if pTab != uintptr(0) {
 142307 		*(*U32)(unsafe.Pointer(pTab + 48)) |= U32(TF_Ephemeral)
 142308 		Xsqlite3DeleteTable(tls, db, pTab)
 142309 		(*Module)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0)
 142310 	}
 142311 }
 142312 
 142313 // Return the ON CONFLICT resolution mode in effect for the virtual
 142314 // table update operation currently in progress.
 142315 //
 142316 // The results of this routine are undefined unless it is called from
 142317 // within an xUpdate method.
 142318 func Xsqlite3_vtab_on_conflict(tls *libc.TLS, db uintptr) int32 {
 142319 	return int32(aMap[int32((*Sqlite3)(unsafe.Pointer(db)).FvtabOnConflict)-1])
 142320 }
 142321 
 142322 var aMap = [5]uint8{
 142323 	uint8(SQLITE_ROLLBACK), uint8(SQLITE_ABORT), uint8(SQLITE_FAIL), uint8(SQLITE_IGNORE), uint8(SQLITE_REPLACE),
 142324 }
 142325 
 142326 // Call from within the xCreate() or xConnect() methods to provide
 142327 // the SQLite core with additional information about the behavior
 142328 // of the virtual table being implemented.
 142329 func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32 {
 142330 	var ap Va_list
 142331 	_ = ap
 142332 	var rc int32 = SQLITE_OK
 142333 	var p uintptr
 142334 
 142335 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 142336 	p = (*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx
 142337 	if !(p != 0) {
 142338 		rc = Xsqlite3MisuseError(tls, 151593)
 142339 	} else {
 142340 		ap = va
 142341 		switch op {
 142342 		case SQLITE_VTAB_CONSTRAINT_SUPPORT:
 142343 			{
 142344 				(*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(p)).FpVTable)).FbConstraint = U8(libc.VaInt32(&ap))
 142345 				break
 142346 
 142347 			}
 142348 			fallthrough
 142349 		case SQLITE_VTAB_INNOCUOUS:
 142350 			{
 142351 				(*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(p)).FpVTable)).FeVtabRisk = U8(SQLITE_VTABRISK_Low)
 142352 				break
 142353 
 142354 			}
 142355 			fallthrough
 142356 		case SQLITE_VTAB_DIRECTONLY:
 142357 			{
 142358 				(*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(p)).FpVTable)).FeVtabRisk = U8(SQLITE_VTABRISK_High)
 142359 				break
 142360 
 142361 			}
 142362 			fallthrough
 142363 		default:
 142364 			{
 142365 				rc = Xsqlite3MisuseError(tls, 151611)
 142366 				break
 142367 
 142368 			}
 142369 		}
 142370 		_ = ap
 142371 	}
 142372 
 142373 	if rc != SQLITE_OK {
 142374 		Xsqlite3Error(tls, db, rc)
 142375 	}
 142376 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 142377 	return rc
 142378 }
 142379 
 142380 // Forward references
 142381 type WhereClause1 = struct {
 142382 	FpWInfo      uintptr
 142383 	FpOuter      uintptr
 142384 	Fop          U8
 142385 	FhasOr       U8
 142386 	F__ccgo_pad1 [2]byte
 142387 	FnTerm       int32
 142388 	FnSlot       int32
 142389 	FnBase       int32
 142390 	Fa           uintptr
 142391 	FaStatic     [8]WhereTerm
 142392 }
 142393 
 142394 // Forward references
 142395 type WhereClause = WhereClause1
 142396 type WhereMaskSet1 = struct {
 142397 	FbVarSelect int32
 142398 	Fn          int32
 142399 	Fix         [64]int32
 142400 }
 142401 
 142402 type WhereMaskSet = WhereMaskSet1
 142403 type WhereOrInfo1 = struct {
 142404 	Fwc        WhereClause
 142405 	Findexable Bitmask
 142406 }
 142407 
 142408 type WhereOrInfo = WhereOrInfo1
 142409 type WhereAndInfo1 = struct{ Fwc WhereClause }
 142410 
 142411 type WhereAndInfo = WhereAndInfo1
 142412 type WhereLevel1 = struct {
 142413 	FiLeftJoin   int32
 142414 	FiTabCur     int32
 142415 	FiIdxCur     int32
 142416 	FaddrBrk     int32
 142417 	FaddrNxt     int32
 142418 	FaddrSkip    int32
 142419 	FaddrCont    int32
 142420 	FaddrFirst   int32
 142421 	FaddrBody    int32
 142422 	FregBignull  int32
 142423 	FaddrBignull int32
 142424 	FregFilter   int32
 142425 	FpRJ         uintptr
 142426 	FiFrom       U8
 142427 	Fop          U8
 142428 	Fp3          U8
 142429 	Fp5          U8
 142430 	Fp1          int32
 142431 	Fp2          int32
 142432 	F__ccgo_pad1 [4]byte
 142433 	Fu           struct {
 142434 		Fin struct {
 142435 			FnIn         int32
 142436 			F__ccgo_pad1 [4]byte
 142437 			FaInLoop     uintptr
 142438 		}
 142439 	}
 142440 	FpWLoop   uintptr
 142441 	FnotReady Bitmask
 142442 }
 142443 
 142444 type WhereLevel = WhereLevel1
 142445 type WhereLoop1 = struct {
 142446 	Fprereq   Bitmask
 142447 	FmaskSelf Bitmask
 142448 	FiTab     U8
 142449 	FiSortIdx U8
 142450 	FrSetup   LogEst
 142451 	FrRun     LogEst
 142452 	FnOut     LogEst
 142453 	Fu        struct {
 142454 		Fbtree struct {
 142455 			FnEq          U16
 142456 			FnBtm         U16
 142457 			FnTop         U16
 142458 			FnDistinctCol U16
 142459 			FpIndex       uintptr
 142460 		}
 142461 		F__ccgo_pad1 [16]byte
 142462 	}
 142463 	FwsFlags     U32
 142464 	FnLTerm      U16
 142465 	FnSkip       U16
 142466 	FnLSlot      U16
 142467 	F__ccgo_pad1 [6]byte
 142468 	FaLTerm      uintptr
 142469 	FpNextLoop   uintptr
 142470 	FaLTermSpace [3]uintptr
 142471 }
 142472 
 142473 type WhereLoop = WhereLoop1
 142474 type WherePath1 = struct {
 142475 	FmaskLoop    Bitmask
 142476 	FrevLoop     Bitmask
 142477 	FnRow        LogEst
 142478 	FrCost       LogEst
 142479 	FrUnsorted   LogEst
 142480 	FisOrdered   I8
 142481 	F__ccgo_pad1 [1]byte
 142482 	FaLoop       uintptr
 142483 }
 142484 
 142485 type WherePath = WherePath1
 142486 type WhereTerm1 = struct {
 142487 	FpExpr      uintptr
 142488 	FpWC        uintptr
 142489 	FtruthProb  LogEst
 142490 	FwtFlags    U16
 142491 	FeOperator  U16
 142492 	FnChild     U8
 142493 	FeMatchOp   U8
 142494 	FiParent    int32
 142495 	FleftCursor int32
 142496 	Fu          struct {
 142497 		F__ccgo_pad1 [0]uint64
 142498 		Fx           struct {
 142499 			FleftColumn int32
 142500 			FiField     int32
 142501 		}
 142502 	}
 142503 	FprereqRight Bitmask
 142504 	FprereqAll   Bitmask
 142505 }
 142506 
 142507 type WhereTerm = WhereTerm1
 142508 type WhereLoopBuilder1 = struct {
 142509 	FpWInfo      uintptr
 142510 	FpWC         uintptr
 142511 	FpNew        uintptr
 142512 	FpOrSet      uintptr
 142513 	FpRec        uintptr
 142514 	FnRecValid   int32
 142515 	FbldFlags1   uint8
 142516 	FbldFlags2   uint8
 142517 	F__ccgo_pad1 [2]byte
 142518 	FiPlanLimit  uint32
 142519 	F__ccgo_pad2 [4]byte
 142520 }
 142521 
 142522 type WhereLoopBuilder = WhereLoopBuilder1
 142523 type WhereScan1 = struct {
 142524 	FpOrigWC     uintptr
 142525 	FpWC         uintptr
 142526 	FzCollName   uintptr
 142527 	FpIdxExpr    uintptr
 142528 	Fk           int32
 142529 	FopMask      U32
 142530 	Fidxaff      int8
 142531 	FiEquiv      uint8
 142532 	FnEquiv      uint8
 142533 	F__ccgo_pad1 [1]byte
 142534 	FaiCur       [11]int32
 142535 	FaiColumn    [11]I16
 142536 	F__ccgo_pad2 [2]byte
 142537 }
 142538 
 142539 type WhereScan = WhereScan1
 142540 type WhereOrCost1 = struct {
 142541 	Fprereq      Bitmask
 142542 	FrRun        LogEst
 142543 	FnOut        LogEst
 142544 	F__ccgo_pad1 [4]byte
 142545 }
 142546 
 142547 type WhereOrCost = WhereOrCost1
 142548 type WhereOrSet1 = struct {
 142549 	Fn           U16
 142550 	F__ccgo_pad1 [6]byte
 142551 	Fa           [3]WhereOrCost
 142552 }
 142553 
 142554 type WhereOrSet = WhereOrSet1
 142555 type WhereMemBlock1 = struct {
 142556 	FpNext uintptr
 142557 	Fsz    U64
 142558 }
 142559 
 142560 type WhereMemBlock = WhereMemBlock1
 142561 type WhereRightJoin1 = struct {
 142562 	FiMatch     int32
 142563 	FregBloom   int32
 142564 	FregReturn  int32
 142565 	FaddrSubrtn int32
 142566 	FendSubrtn  int32
 142567 }
 142568 
 142569 type WhereRightJoin = WhereRightJoin1
 142570 
 142571 // This object contains information needed to implement a single nested
 142572 // loop in WHERE clause.
 142573 //
 142574 // Contrast this object with WhereLoop.  This object describes the
 142575 // implementation of the loop.  WhereLoop describes the algorithm.
 142576 // This object contains a pointer to the WhereLoop algorithm as one of
 142577 // its elements.
 142578 //
 142579 // The WhereInfo object contains a single instance of this object for
 142580 // each term in the FROM clause (which is to say, for each of the
 142581 // nested loops as implemented).  The order of WhereLevel objects determines
 142582 // the loop nested order, with WhereInfo.a[0] being the outer loop and
 142583 // WhereInfo.a[WhereInfo.nLevel-1] being the inner loop.
 142584 type InLoop = struct {
 142585 	FiCur        int32
 142586 	FaddrInTop   int32
 142587 	FiBase       int32
 142588 	FnPrefix     int32
 142589 	FeEndLoopOp  U8
 142590 	F__ccgo_pad1 [3]byte
 142591 }
 142592 
 142593 func explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) uintptr {
 142594 	i = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2)))
 142595 	if i == -2 {
 142596 		return ts + 22934
 142597 	}
 142598 	if i == -1 {
 142599 		return ts + 17625
 142600 	}
 142601 	return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*24)).FzCnName
 142602 }
 142603 
 142604 func explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, iTerm int32, bAnd int32, zOp uintptr) {
 142605 	var i int32
 142606 
 142607 	if bAnd != 0 {
 142608 		Xsqlite3_str_append(tls, pStr, ts+22941, 5)
 142609 	}
 142610 
 142611 	if nTerm > 1 {
 142612 		Xsqlite3_str_append(tls, pStr, ts+22947, 1)
 142613 	}
 142614 	for i = 0; i < nTerm; i++ {
 142615 		if i != 0 {
 142616 			Xsqlite3_str_append(tls, pStr, ts+14119, 1)
 142617 		}
 142618 		Xsqlite3_str_appendall(tls, pStr, explainIndexColumnName(tls, pIdx, iTerm+i))
 142619 	}
 142620 	if nTerm > 1 {
 142621 		Xsqlite3_str_append(tls, pStr, ts+6309, 1)
 142622 	}
 142623 
 142624 	Xsqlite3_str_append(tls, pStr, zOp, 1)
 142625 
 142626 	if nTerm > 1 {
 142627 		Xsqlite3_str_append(tls, pStr, ts+22947, 1)
 142628 	}
 142629 	for i = 0; i < nTerm; i++ {
 142630 		if i != 0 {
 142631 			Xsqlite3_str_append(tls, pStr, ts+14119, 1)
 142632 		}
 142633 		Xsqlite3_str_append(tls, pStr, ts+6360, 1)
 142634 	}
 142635 	if nTerm > 1 {
 142636 		Xsqlite3_str_append(tls, pStr, ts+6309, 1)
 142637 	}
 142638 }
 142639 
 142640 func explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) {
 142641 	bp := tls.Alloc(8)
 142642 	defer tls.Free(8)
 142643 
 142644 	var pIndex uintptr = *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8))
 142645 	var nEq U16 = *(*U16)(unsafe.Pointer(pLoop + 24))
 142646 	var nSkip U16 = (*WhereLoop)(unsafe.Pointer(pLoop)).FnSkip
 142647 	var i int32
 142648 	var j int32
 142649 
 142650 	if int32(nEq) == 0 && (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_BTM_LIMIT|WHERE_TOP_LIMIT) == U32(0) {
 142651 		return
 142652 	}
 142653 	Xsqlite3_str_append(tls, pStr, ts+22949, 2)
 142654 	for i = 0; i < int32(nEq); i++ {
 142655 		var z uintptr = explainIndexColumnName(tls, pIndex, i)
 142656 		if i != 0 {
 142657 			Xsqlite3_str_append(tls, pStr, ts+22941, 5)
 142658 		}
 142659 		Xsqlite3_str_appendf(tls, pStr, func() uintptr {
 142660 			if i >= int32(nSkip) {
 142661 				return ts + 22952
 142662 			}
 142663 			return ts + 22957
 142664 		}(), libc.VaList(bp, z))
 142665 	}
 142666 
 142667 	j = i
 142668 	if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_BTM_LIMIT) != 0 {
 142669 		explainAppendTerm(tls, pStr, pIndex, int32(*(*U16)(unsafe.Pointer(pLoop + 24 + 2))), j, i, ts+22965)
 142670 		i = 1
 142671 	}
 142672 	if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_TOP_LIMIT) != 0 {
 142673 		explainAppendTerm(tls, pStr, pIndex, int32(*(*U16)(unsafe.Pointer(pLoop + 24 + 4))), j, i, ts+22967)
 142674 	}
 142675 	Xsqlite3_str_append(tls, pStr, ts+6309, 1)
 142676 }
 142677 
 142678 // This function is a no-op unless currently processing an EXPLAIN QUERY PLAN
 142679 // command, or if either SQLITE_DEBUG or SQLITE_ENABLE_STMT_SCANSTATUS was
 142680 // defined at compile-time. If it is not a no-op, a single OP_Explain opcode
 142681 // is added to the output to describe the table scan strategy in pLevel.
 142682 //
 142683 // If an OP_Explain opcode is added to the VM, its address is returned.
 142684 // Otherwise, if no OP_Explain is coded, zero is returned.
 142685 func Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr, pLevel uintptr, wctrlFlags U16) int32 {
 142686 	bp := tls.Alloc(196)
 142687 	defer tls.Free(196)
 142688 
 142689 	var ret int32 = 0
 142690 	if int32((*Parse)(unsafe.Pointer(func() uintptr {
 142691 		if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
 142692 			return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
 142693 		}
 142694 		return pParse
 142695 	}())).Fexplain) == 2 {
 142696 		var pItem uintptr = pTabList + 8 + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104
 142697 		var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 142698 		var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 142699 		var isSearch int32
 142700 		var pLoop uintptr
 142701 		var flags U32
 142702 		var zMsg uintptr
 142703 
 142704 		pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop
 142705 		flags = (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags
 142706 		if flags&U32(WHERE_MULTI_OR) != 0 || int32(wctrlFlags)&WHERE_OR_SUBCLAUSE != 0 {
 142707 			return 0
 142708 		}
 142709 
 142710 		isSearch = libc.Bool32(flags&U32(WHERE_BTM_LIMIT|WHERE_TOP_LIMIT) != U32(0) ||
 142711 			flags&U32(WHERE_VIRTUALTABLE) == U32(0) && int32(*(*U16)(unsafe.Pointer(pLoop + 24))) > 0 ||
 142712 			int32(wctrlFlags)&(WHERE_ORDERBY_MIN|WHERE_ORDERBY_MAX) != 0)
 142713 
 142714 		Xsqlite3StrAccumInit(tls, bp+64, db, bp+96, int32(unsafe.Sizeof([100]int8{})), SQLITE_MAX_LENGTH)
 142715 		(*StrAccum)(unsafe.Pointer(bp + 64)).FprintfFlags = U8(SQLITE_PRINTF_INTERNAL)
 142716 		Xsqlite3_str_appendf(tls, bp+64, ts+22969, libc.VaList(bp, func() uintptr {
 142717 			if isSearch != 0 {
 142718 				return ts + 22975
 142719 			}
 142720 			return ts + 22982
 142721 		}(), pItem))
 142722 		if flags&U32(WHERE_IPK|WHERE_VIRTUALTABLE) == U32(0) {
 142723 			var zFmt uintptr = uintptr(0)
 142724 			var pIdx uintptr
 142725 
 142726 			pIdx = *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8))
 142727 
 142728 			if !((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) && int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY {
 142729 				if isSearch != 0 {
 142730 					zFmt = ts + 12328
 142731 				}
 142732 			} else if flags&U32(WHERE_PARTIALIDX) != 0 {
 142733 				zFmt = ts + 22987
 142734 			} else if flags&U32(WHERE_AUTO_INDEX) != 0 {
 142735 				zFmt = ts + 23020
 142736 			} else if flags&U32(WHERE_IDX_ONLY) != 0 {
 142737 				zFmt = ts + 23045
 142738 			} else {
 142739 				zFmt = ts + 23063
 142740 			}
 142741 			if zFmt != 0 {
 142742 				Xsqlite3_str_append(tls, bp+64, ts+23072, 7)
 142743 				Xsqlite3_str_appendf(tls, bp+64, zFmt, libc.VaList(bp+16, (*Index)(unsafe.Pointer(pIdx)).FzName))
 142744 				explainIndexRange(tls, bp+64, pLoop)
 142745 			}
 142746 		} else if flags&U32(WHERE_IPK) != U32(0) && flags&U32(WHERE_CONSTRAINT) != U32(0) {
 142747 			var cRangeOp int8
 142748 			var zRowid uintptr = ts + 17625
 142749 			Xsqlite3_str_appendf(tls, bp+64, ts+23080, libc.VaList(bp+24, zRowid))
 142750 			if flags&U32(WHERE_COLUMN_EQ|WHERE_COLUMN_IN) != 0 {
 142751 				cRangeOp = int8('=')
 142752 			} else if flags&U32(WHERE_BOTH_LIMIT) == U32(WHERE_BOTH_LIMIT) {
 142753 				Xsqlite3_str_appendf(tls, bp+64, ts+23111, libc.VaList(bp+32, zRowid))
 142754 				cRangeOp = int8('<')
 142755 			} else if flags&U32(WHERE_BTM_LIMIT) != 0 {
 142756 				cRangeOp = int8('>')
 142757 			} else {
 142758 				cRangeOp = int8('<')
 142759 			}
 142760 			Xsqlite3_str_appendf(tls, bp+64, ts+23121, libc.VaList(bp+40, int32(cRangeOp)))
 142761 		} else if flags&U32(WHERE_VIRTUALTABLE) != U32(0) {
 142762 			Xsqlite3_str_appendf(tls, bp+64, ts+23126,
 142763 				libc.VaList(bp+48, *(*int32)(unsafe.Pointer(pLoop + 24)), *(*uintptr)(unsafe.Pointer(pLoop + 24 + 16))))
 142764 		}
 142765 		if int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&JT_LEFT != 0 {
 142766 			Xsqlite3_str_appendf(tls, bp+64, ts+23153, 0)
 142767 		}
 142768 		zMsg = Xsqlite3StrAccumFinish(tls, bp+64)
 142769 
 142770 		ret = Xsqlite3VdbeAddOp4(tls, v, OP_Explain, Xsqlite3VdbeCurrentAddr(tls, v),
 142771 			(*Parse)(unsafe.Pointer(pParse)).FaddrExplain, 0, zMsg, -6)
 142772 	}
 142773 	return ret
 142774 }
 142775 
 142776 // Add a single OP_Explain opcode that describes a Bloom filter.
 142777 //
 142778 // Or if not processing EXPLAIN QUERY PLAN and not in a SQLITE_DEBUG and/or
 142779 // SQLITE_ENABLE_STMT_SCANSTATUS build, then OP_Explain opcodes are not
 142780 // required and this routine is a no-op.
 142781 //
 142782 // If an OP_Explain opcode is added to the VM, its address is returned.
 142783 // Otherwise, if no OP_Explain is coded, zero is returned.
 142784 func Xsqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintptr, pLevel uintptr) int32 {
 142785 	bp := tls.Alloc(156)
 142786 	defer tls.Free(156)
 142787 
 142788 	var ret int32 = 0
 142789 	var pItem uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104
 142790 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 142791 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 142792 	var zMsg uintptr
 142793 	var i int32
 142794 	var pLoop uintptr
 142795 
 142796 	Xsqlite3StrAccumInit(tls, bp+24, db, bp+56, int32(unsafe.Sizeof([100]int8{})), SQLITE_MAX_LENGTH)
 142797 	(*StrAccum)(unsafe.Pointer(bp + 24)).FprintfFlags = U8(SQLITE_PRINTF_INTERNAL)
 142798 	Xsqlite3_str_appendf(tls, bp+24, ts+23164, libc.VaList(bp, pItem))
 142799 	pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop
 142800 	if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IPK) != 0 {
 142801 		var pTab uintptr = (*SrcItem)(unsafe.Pointer(pItem)).FpTab
 142802 		if int32((*Table)(unsafe.Pointer(pTab)).FiPKey) >= 0 {
 142803 			Xsqlite3_str_appendf(tls, bp+24, ts+22952, libc.VaList(bp+8, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr((*Table)(unsafe.Pointer(pTab)).FiPKey)*24)).FzCnName))
 142804 		} else {
 142805 			Xsqlite3_str_appendf(tls, bp+24, ts+23185, 0)
 142806 		}
 142807 	} else {
 142808 		for i = int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnSkip); i < int32(*(*U16)(unsafe.Pointer(pLoop + 24))); i++ {
 142809 			var z uintptr = explainIndexColumnName(tls, *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8)), i)
 142810 			if i > int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnSkip) {
 142811 				Xsqlite3_str_append(tls, bp+24, ts+22941, 5)
 142812 			}
 142813 			Xsqlite3_str_appendf(tls, bp+24, ts+22952, libc.VaList(bp+16, z))
 142814 		}
 142815 	}
 142816 	Xsqlite3_str_append(tls, bp+24, ts+6309, 1)
 142817 	zMsg = Xsqlite3StrAccumFinish(tls, bp+24)
 142818 	ret = Xsqlite3VdbeAddOp4(tls, v, OP_Explain, Xsqlite3VdbeCurrentAddr(tls, v),
 142819 		(*Parse)(unsafe.Pointer(pParse)).FaddrExplain, 0, zMsg, -6)
 142820 
 142821 	return ret
 142822 }
 142823 
 142824 func disableTerm(tls *libc.TLS, pLevel uintptr, pTerm uintptr) {
 142825 	var nLoop int32 = 0
 142826 
 142827 	for int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_CODED == 0 &&
 142828 		((*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0 || (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&U32(EP_OuterON) != U32(0)) &&
 142829 		(*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady&(*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll == uint64(0) {
 142830 		if nLoop != 0 && int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_LIKE != 0 {
 142831 			*(*U16)(unsafe.Pointer(pTerm + 18)) |= U16(TERM_LIKECOND)
 142832 		} else {
 142833 			*(*U16)(unsafe.Pointer(pTerm + 18)) |= U16(TERM_CODED)
 142834 		}
 142835 		if (*WhereTerm)(unsafe.Pointer(pTerm)).FiParent < 0 {
 142836 			break
 142837 		}
 142838 		pTerm = (*WhereClause)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpWC)).Fa + uintptr((*WhereTerm)(unsafe.Pointer(pTerm)).FiParent)*56
 142839 
 142840 		(*WhereTerm)(unsafe.Pointer(pTerm)).FnChild--
 142841 		if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FnChild) != 0 {
 142842 			break
 142843 		}
 142844 		nLoop++
 142845 	}
 142846 }
 142847 
 142848 func codeApplyAffinity(tls *libc.TLS, pParse uintptr, base int32, n int32, zAff uintptr) {
 142849 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 142850 	if zAff == uintptr(0) {
 142851 		return
 142852 	}
 142853 
 142854 	for n > 0 && int32(*(*int8)(unsafe.Pointer(zAff))) <= SQLITE_AFF_BLOB {
 142855 		n--
 142856 		base++
 142857 		zAff++
 142858 	}
 142859 	for n > 1 && int32(*(*int8)(unsafe.Pointer(zAff + uintptr(n-1)))) <= SQLITE_AFF_BLOB {
 142860 		n--
 142861 	}
 142862 
 142863 	if n > 0 {
 142864 		Xsqlite3VdbeAddOp4(tls, v, OP_Affinity, base, n, 0, zAff, n)
 142865 	}
 142866 }
 142867 
 142868 func updateRangeAffinityStr(tls *libc.TLS, pRight uintptr, n int32, zAff uintptr) {
 142869 	var i int32
 142870 	for i = 0; i < n; i++ {
 142871 		var p uintptr = Xsqlite3VectorFieldSubexpr(tls, pRight, i)
 142872 		if int32(Xsqlite3CompareAffinity(tls, p, *(*int8)(unsafe.Pointer(zAff + uintptr(i))))) == SQLITE_AFF_BLOB ||
 142873 			Xsqlite3ExprNeedsNoAffinityChange(tls, p, *(*int8)(unsafe.Pointer(zAff + uintptr(i)))) != 0 {
 142874 			*(*int8)(unsafe.Pointer(zAff + uintptr(i))) = int8(SQLITE_AFF_BLOB)
 142875 		}
 142876 	}
 142877 }
 142878 
 142879 func removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, pLoop uintptr, pX uintptr) uintptr {
 142880 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 142881 	var pSelect uintptr
 142882 	var pNew uintptr
 142883 	pNew = Xsqlite3ExprDup(tls, db, pX, 0)
 142884 	if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 {
 142885 		for pSelect = *(*uintptr)(unsafe.Pointer(pNew + 32)); pSelect != 0; pSelect = (*Select)(unsafe.Pointer(pSelect)).FpPrior {
 142886 			var pOrigRhs uintptr
 142887 			var pOrigLhs uintptr = uintptr(0)
 142888 			var pRhs uintptr = uintptr(0)
 142889 			var pLhs uintptr = uintptr(0)
 142890 			var i int32
 142891 
 142892 			pOrigRhs = (*Select)(unsafe.Pointer(pSelect)).FpEList
 142893 
 142894 			if pSelect == *(*uintptr)(unsafe.Pointer(pNew + 32)) {
 142895 				pOrigLhs = *(*uintptr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pNew)).FpLeft + 32))
 142896 			}
 142897 			for i = iEq; i < int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm); i++ {
 142898 				if (*WhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)))).FpExpr == pX {
 142899 					var iField int32
 142900 
 142901 					iField = *(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)) + 32 + 4)) - 1
 142902 					if (*ExprList_item)(unsafe.Pointer(pOrigRhs+8+uintptr(iField)*32)).FpExpr == uintptr(0) {
 142903 						continue
 142904 					}
 142905 					pRhs = Xsqlite3ExprListAppend(tls, pParse, pRhs, (*ExprList_item)(unsafe.Pointer(pOrigRhs+8+uintptr(iField)*32)).FpExpr)
 142906 					(*ExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32)).FpExpr = uintptr(0)
 142907 					if pOrigLhs != 0 {
 142908 						pLhs = Xsqlite3ExprListAppend(tls, pParse, pLhs, (*ExprList_item)(unsafe.Pointer(pOrigLhs+8+uintptr(iField)*32)).FpExpr)
 142909 						(*ExprList_item)(unsafe.Pointer(pOrigLhs + 8 + uintptr(iField)*32)).FpExpr = uintptr(0)
 142910 					}
 142911 				}
 142912 			}
 142913 			Xsqlite3ExprListDelete(tls, db, pOrigRhs)
 142914 			if pOrigLhs != 0 {
 142915 				Xsqlite3ExprListDelete(tls, db, pOrigLhs)
 142916 				*(*uintptr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pNew)).FpLeft + 32)) = pLhs
 142917 			}
 142918 			(*Select)(unsafe.Pointer(pSelect)).FpEList = pRhs
 142919 			if pLhs != 0 && (*ExprList)(unsafe.Pointer(pLhs)).FnExpr == 1 {
 142920 				var p uintptr = (*ExprList_item)(unsafe.Pointer(pLhs + 8)).FpExpr
 142921 				(*ExprList_item)(unsafe.Pointer(pLhs + 8)).FpExpr = uintptr(0)
 142922 				Xsqlite3ExprDelete(tls, db, (*Expr)(unsafe.Pointer(pNew)).FpLeft)
 142923 				(*Expr)(unsafe.Pointer(pNew)).FpLeft = p
 142924 			}
 142925 			if (*Select)(unsafe.Pointer(pSelect)).FpOrderBy != 0 {
 142926 				var pOrderBy uintptr = (*Select)(unsafe.Pointer(pSelect)).FpOrderBy
 142927 				for i = 0; i < (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr; i++ {
 142928 					*(*U16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32 + 24)) = U16(0)
 142929 				}
 142930 			}
 142931 
 142932 		}
 142933 	}
 142934 	return pNew
 142935 }
 142936 
 142937 func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) int32 {
 142938 	bp := tls.Alloc(4)
 142939 	defer tls.Free(4)
 142940 
 142941 	var pX uintptr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
 142942 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 142943 	var iReg int32
 142944 
 142945 	if int32((*Expr)(unsafe.Pointer(pX)).Fop) == TK_EQ || int32((*Expr)(unsafe.Pointer(pX)).Fop) == TK_IS {
 142946 		iReg = Xsqlite3ExprCodeTarget(tls, pParse, (*Expr)(unsafe.Pointer(pX)).FpRight, iTarget)
 142947 	} else if int32((*Expr)(unsafe.Pointer(pX)).Fop) == TK_ISNULL {
 142948 		iReg = iTarget
 142949 		Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, iReg)
 142950 	} else {
 142951 		var eType int32 = IN_INDEX_NOOP
 142952 
 142953 		var pIn uintptr
 142954 		var pLoop uintptr = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop
 142955 		var i int32
 142956 		var nEq int32 = 0
 142957 		var aiMap uintptr = uintptr(0)
 142958 
 142959 		if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_VIRTUALTABLE) == U32(0) &&
 142960 			*(*uintptr)(unsafe.Pointer(pLoop + 24 + 8)) != uintptr(0) &&
 142961 			*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLoop + 24 + 8)))).FaSortOrder + uintptr(iEq))) != 0 {
 142962 			bRev = libc.BoolInt32(!(bRev != 0))
 142963 		}
 142964 
 142965 		iReg = iTarget
 142966 
 142967 		for i = 0; i < iEq; i++ {
 142968 			if *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)) != 0 && (*WhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)))).FpExpr == pX {
 142969 				disableTerm(tls, pLevel, pTerm)
 142970 				return iTarget
 142971 			}
 142972 		}
 142973 		for i = iEq; i < int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm); i++ {
 142974 			if (*WhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)))).FpExpr == pX {
 142975 				nEq++
 142976 			}
 142977 		}
 142978 
 142979 		*(*int32)(unsafe.Pointer(bp)) = 0
 142980 		if !((*Expr)(unsafe.Pointer(pX)).Fflags&U32(EP_xIsSelect) != U32(0)) || (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32)))).FpEList)).FnExpr == 1 {
 142981 			eType = Xsqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), uintptr(0), bp)
 142982 		} else {
 142983 			var pExpr uintptr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
 142984 			if (*Expr)(unsafe.Pointer(pExpr)).FiTable == 0 || !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Subrtn) != U32(0)) {
 142985 				var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 142986 				pX = removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX)
 142987 				if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
 142988 					aiMap = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(int32(0)))*uint64(nEq))
 142989 					eType = Xsqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp)
 142990 					(*Expr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(bp))
 142991 				}
 142992 				Xsqlite3ExprDelete(tls, db, pX)
 142993 			} else {
 142994 				var n int32 = Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pX)).FpLeft)
 142995 				aiMap = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(int32(0)))*func() uint64 {
 142996 					if nEq > n {
 142997 						return uint64(nEq)
 142998 					}
 142999 					return uint64(n)
 143000 				}())
 143001 				eType = Xsqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp)
 143002 			}
 143003 			pX = pExpr
 143004 		}
 143005 
 143006 		if eType == IN_INDEX_INDEX_DESC {
 143007 			bRev = libc.BoolInt32(!(bRev != 0))
 143008 		}
 143009 		Xsqlite3VdbeAddOp2(tls, v, func() int32 {
 143010 			if bRev != 0 {
 143011 				return OP_Last
 143012 			}
 143013 			return OP_Rewind
 143014 		}(), *(*int32)(unsafe.Pointer(bp)), 0)
 143015 
 143016 		*(*U32)(unsafe.Pointer(pLoop + 56)) |= U32(WHERE_IN_ABLE)
 143017 		if *(*int32)(unsafe.Pointer(pLevel + 72)) == 0 {
 143018 			(*WhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt = Xsqlite3VdbeMakeLabel(tls, pParse)
 143019 		}
 143020 		if iEq > 0 && (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IN_SEEKSCAN) == U32(0) {
 143021 			*(*U32)(unsafe.Pointer(pLoop + 56)) |= U32(WHERE_IN_EARLYOUT)
 143022 		}
 143023 
 143024 		i = *(*int32)(unsafe.Pointer(pLevel + 72))
 143025 		*(*int32)(unsafe.Pointer(pLevel + 72)) += nEq
 143026 		*(*uintptr)(unsafe.Pointer(pLevel + 72 + 8)) = Xsqlite3WhereRealloc(tls, (*WhereClause)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpWC)).FpWInfo,
 143027 			*(*uintptr)(unsafe.Pointer(pLevel + 72 + 8)),
 143028 			uint64(unsafe.Sizeof(InLoop{}))*uint64(*(*int32)(unsafe.Pointer(pLevel + 72))))
 143029 		pIn = *(*uintptr)(unsafe.Pointer(pLevel + 72 + 8))
 143030 		if pIn != 0 {
 143031 			var iMap int32 = 0
 143032 			pIn += 20 * uintptr(i)
 143033 			for i = iEq; i < int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm); i++ {
 143034 				if (*WhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)))).FpExpr == pX {
 143035 					var iOut int32 = iReg + i - iEq
 143036 					if eType == IN_INDEX_ROWID {
 143037 						*(*int32)(unsafe.Pointer(pIn + 4)) = Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, *(*int32)(unsafe.Pointer(bp)), iOut)
 143038 					} else {
 143039 						var iCol int32
 143040 						if aiMap != 0 {
 143041 							iCol = *(*int32)(unsafe.Pointer(aiMap + uintptr(libc.PostIncInt32(&iMap, 1))*4))
 143042 						} else {
 143043 							iCol = 0
 143044 						}
 143045 						*(*int32)(unsafe.Pointer(pIn + 4)) = Xsqlite3VdbeAddOp3(tls, v, OP_Column, *(*int32)(unsafe.Pointer(bp)), iCol, iOut)
 143046 					}
 143047 					Xsqlite3VdbeAddOp1(tls, v, OP_IsNull, iOut)
 143048 					if i == iEq {
 143049 						*(*int32)(unsafe.Pointer(pIn)) = *(*int32)(unsafe.Pointer(bp))
 143050 						*(*U8)(unsafe.Pointer(pIn + 16)) = func() uint8 {
 143051 							if bRev != 0 {
 143052 								return uint8(OP_Prev)
 143053 							}
 143054 							return uint8(OP_Next)
 143055 						}()
 143056 						if iEq > 0 {
 143057 							*(*int32)(unsafe.Pointer(pIn + 8)) = iReg - i
 143058 							*(*int32)(unsafe.Pointer(pIn + 12)) = i
 143059 						} else {
 143060 							*(*int32)(unsafe.Pointer(pIn + 12)) = 0
 143061 						}
 143062 					} else {
 143063 						*(*U8)(unsafe.Pointer(pIn + 16)) = U8(OP_Noop)
 143064 					}
 143065 					pIn += 20
 143066 				}
 143067 			}
 143068 
 143069 			if iEq > 0 &&
 143070 				(*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IN_SEEKSCAN|WHERE_VIRTUALTABLE) == U32(0) {
 143071 				Xsqlite3VdbeAddOp3(tls, v, OP_SeekHit, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, 0, iEq)
 143072 			}
 143073 		} else {
 143074 			*(*int32)(unsafe.Pointer(pLevel + 72)) = 0
 143075 		}
 143076 		Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, aiMap)
 143077 	}
 143078 
 143079 	if (*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&U32(WHERE_TRANSCONS) == U32(0) ||
 143080 		int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&WO_EQUIV == 0 {
 143081 		disableTerm(tls, pLevel, pTerm)
 143082 	}
 143083 
 143084 	return iReg
 143085 }
 143086 
 143087 func codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev int32, nExtraReg int32, pzAff uintptr) int32 {
 143088 	var nEq U16
 143089 	var nSkip U16
 143090 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 143091 	var pIdx uintptr
 143092 	var pTerm uintptr
 143093 	var pLoop uintptr
 143094 	var j int32
 143095 	var regBase int32
 143096 	var nReg int32
 143097 	var zAff uintptr
 143098 
 143099 	pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop
 143100 
 143101 	nEq = *(*U16)(unsafe.Pointer(pLoop + 24))
 143102 	nSkip = (*WhereLoop)(unsafe.Pointer(pLoop)).FnSkip
 143103 	pIdx = *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8))
 143104 
 143105 	regBase = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 143106 	nReg = int32(*(*U16)(unsafe.Pointer(pLoop + 24))) + nExtraReg
 143107 	*(*int32)(unsafe.Pointer(pParse + 56)) += nReg
 143108 
 143109 	zAff = Xsqlite3DbStrDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, Xsqlite3IndexAffinityStr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pIdx))
 143110 
 143111 	if nSkip != 0 {
 143112 		var iIdxCur int32 = (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur
 143113 		Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, regBase, regBase+int32(nSkip)-1)
 143114 		Xsqlite3VdbeAddOp1(tls, v, func() int32 {
 143115 			if bRev != 0 {
 143116 				return OP_Last
 143117 			}
 143118 			return OP_Rewind
 143119 		}(), iIdxCur)
 143120 
 143121 		j = Xsqlite3VdbeAddOp0(tls, v, OP_Goto)
 143122 
 143123 		(*WhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip = Xsqlite3VdbeAddOp4Int(tls, v, func() int32 {
 143124 			if bRev != 0 {
 143125 				return OP_SeekLT
 143126 			}
 143127 			return OP_SeekGT
 143128 		}(),
 143129 			iIdxCur, 0, regBase, int32(nSkip))
 143130 
 143131 		Xsqlite3VdbeJumpHere(tls, v, j)
 143132 		for j = 0; j < int32(nSkip); j++ {
 143133 			Xsqlite3VdbeAddOp3(tls, v, OP_Column, iIdxCur, j, regBase+j)
 143134 
 143135 		}
 143136 	}
 143137 
 143138 	for j = int32(nSkip); j < int32(nEq); j++ {
 143139 		var r1 int32
 143140 		pTerm = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*8))
 143141 
 143142 		r1 = codeEqualityTerm(tls, pParse, pTerm, pLevel, j, bRev, regBase+j)
 143143 		if r1 != regBase+j {
 143144 			if nReg == 1 {
 143145 				Xsqlite3ReleaseTempReg(tls, pParse, regBase)
 143146 				regBase = r1
 143147 			} else {
 143148 				Xsqlite3VdbeAddOp2(tls, v, OP_Copy, r1, regBase+j)
 143149 			}
 143150 		}
 143151 	}
 143152 	for j = int32(nSkip); j < int32(nEq); j++ {
 143153 		pTerm = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*8))
 143154 		if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&WO_IN != 0 {
 143155 			if (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&U32(EP_xIsSelect) != 0 {
 143156 				if zAff != 0 {
 143157 					*(*int8)(unsafe.Pointer(zAff + uintptr(j))) = int8(SQLITE_AFF_BLOB)
 143158 				}
 143159 			}
 143160 		} else if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&WO_ISNULL == 0 {
 143161 			var pRight uintptr = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight
 143162 			if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_IS == 0 && Xsqlite3ExprCanBeNull(tls, pRight) != 0 {
 143163 				Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, regBase+j, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBrk)
 143164 
 143165 			}
 143166 			if (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 {
 143167 				if int32(Xsqlite3CompareAffinity(tls, pRight, *(*int8)(unsafe.Pointer(zAff + uintptr(j))))) == SQLITE_AFF_BLOB {
 143168 					*(*int8)(unsafe.Pointer(zAff + uintptr(j))) = int8(SQLITE_AFF_BLOB)
 143169 				}
 143170 				if Xsqlite3ExprNeedsNoAffinityChange(tls, pRight, *(*int8)(unsafe.Pointer(zAff + uintptr(j)))) != 0 {
 143171 					*(*int8)(unsafe.Pointer(zAff + uintptr(j))) = int8(SQLITE_AFF_BLOB)
 143172 				}
 143173 			}
 143174 		}
 143175 	}
 143176 	*(*uintptr)(unsafe.Pointer(pzAff)) = zAff
 143177 	return regBase
 143178 }
 143179 
 143180 func codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, iIdxCur int32) {
 143181 	var pParse uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse
 143182 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 143183 
 143184 	libc.SetBitFieldPtr8Uint32(pWInfo+68, uint32(1), 0, 0x1)
 143185 	Xsqlite3VdbeAddOp3(tls, v, OP_DeferredSeek, iIdxCur, 0, iCur)
 143186 	if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&(WHERE_OR_SUBCLAUSE|WHERE_RIGHT_JOIN) != 0 &&
 143187 		(*Parse)(unsafe.Pointer(func() uintptr {
 143188 			if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
 143189 				return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
 143190 			}
 143191 			return pParse
 143192 		}())).FwriteMask == YDbMask(0) {
 143193 		var i int32
 143194 		var pTab uintptr = (*Index)(unsafe.Pointer(pIdx)).FpTable
 143195 		var ai uintptr = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(U32(0)))*uint64(int32((*Table)(unsafe.Pointer(pTab)).FnCol)+1))
 143196 		if ai != 0 {
 143197 			*(*U32)(unsafe.Pointer(ai)) = U32((*Table)(unsafe.Pointer(pTab)).FnCol)
 143198 			for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)-1; i++ {
 143199 				var x1 int32
 143200 				var x2 int32
 143201 
 143202 				x1 = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2)))
 143203 				x2 = int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(x1)))
 143204 
 143205 				if x1 >= 0 {
 143206 					*(*U32)(unsafe.Pointer(ai + uintptr(x2+1)*4)) = U32(i + 1)
 143207 				}
 143208 			}
 143209 			Xsqlite3VdbeChangeP4(tls, v, -1, ai, -14)
 143210 		}
 143211 	}
 143212 }
 143213 
 143214 func codeExprOrVector(tls *libc.TLS, pParse uintptr, p uintptr, iReg int32, nReg int32) {
 143215 	if p != 0 && Xsqlite3ExprIsVector(tls, p) != 0 {
 143216 		if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_xIsSelect) != U32(0) {
 143217 			var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 143218 			var iSelect int32
 143219 
 143220 			iSelect = Xsqlite3CodeSubselect(tls, pParse, p)
 143221 			Xsqlite3VdbeAddOp3(tls, v, OP_Copy, iSelect, iReg, nReg-1)
 143222 		} else {
 143223 			var i int32
 143224 			var pList uintptr
 143225 
 143226 			pList = *(*uintptr)(unsafe.Pointer(p + 32))
 143227 
 143228 			for i = 0; i < nReg; i++ {
 143229 				Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*32)).FpExpr, iReg+i)
 143230 			}
 143231 		}
 143232 	} else {
 143233 		Xsqlite3ExprCode(tls, pParse, p, iReg)
 143234 	}
 143235 }
 143236 
 143237 func whereApplyPartialIndexConstraints(tls *libc.TLS, pTruth uintptr, iTabCur int32, pWC uintptr) {
 143238 	var i int32
 143239 	var pTerm uintptr
 143240 	for int32((*Expr)(unsafe.Pointer(pTruth)).Fop) == TK_AND {
 143241 		whereApplyPartialIndexConstraints(tls, (*Expr)(unsafe.Pointer(pTruth)).FpLeft, iTabCur, pWC)
 143242 		pTruth = (*Expr)(unsafe.Pointer(pTruth)).FpRight
 143243 	}
 143244 	i = 0
 143245 	pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa
 143246 __1:
 143247 	if !(i < (*WhereClause)(unsafe.Pointer(pWC)).FnTerm) {
 143248 		goto __3
 143249 	}
 143250 	{
 143251 		var pExpr uintptr
 143252 		if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_CODED != 0 {
 143253 			goto __2
 143254 		}
 143255 		pExpr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
 143256 		if Xsqlite3ExprCompare(tls, uintptr(0), pExpr, pTruth, iTabCur) == 0 {
 143257 			*(*U16)(unsafe.Pointer(pTerm + 18)) |= U16(TERM_CODED)
 143258 		}
 143259 
 143260 	}
 143261 	goto __2
 143262 __2:
 143263 	i++
 143264 	pTerm += 56
 143265 	goto __1
 143266 	goto __3
 143267 __3:
 143268 }
 143269 
 143270 func filterPullDown(tls *libc.TLS, pParse uintptr, pWInfo uintptr, iLevel int32, addrNxt int32, notReady Bitmask) {
 143271 	bp := tls.Alloc(8)
 143272 	defer tls.Free(8)
 143273 
 143274 	for libc.PreIncInt32(&iLevel, 1) < int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) {
 143275 		var pLevel uintptr = pWInfo + 856 + uintptr(iLevel)*104
 143276 		var pLoop uintptr = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop
 143277 		if (*WhereLevel)(unsafe.Pointer(pLevel)).FregFilter == 0 {
 143278 			continue
 143279 		}
 143280 		if (*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 {
 143281 			continue
 143282 		}
 143283 
 143284 		if (*WhereLoop)(unsafe.Pointer(pLoop)).Fprereq&notReady != 0 {
 143285 			continue
 143286 		}
 143287 
 143288 		(*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBrk = addrNxt
 143289 		if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IPK) != 0 {
 143290 			var pTerm uintptr = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm))
 143291 			var regRowid int32
 143292 
 143293 			regRowid = Xsqlite3GetTempReg(tls, pParse)
 143294 			regRowid = codeEqualityTerm(tls, pParse, pTerm, pLevel, 0, 0, regRowid)
 143295 			Xsqlite3VdbeAddOp2(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, OP_MustBeInt, regRowid, addrNxt)
 143296 
 143297 			Xsqlite3VdbeAddOp4Int(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, OP_Filter, (*WhereLevel)(unsafe.Pointer(pLevel)).FregFilter,
 143298 				addrNxt, regRowid, 1)
 143299 
 143300 		} else {
 143301 			var nEq U16 = *(*U16)(unsafe.Pointer(pLoop + 24))
 143302 			var r1 int32
 143303 
 143304 			r1 = codeAllEqualityTerms(tls, pParse, pLevel, 0, 0, bp)
 143305 			codeApplyAffinity(tls, pParse, r1, int32(nEq), *(*uintptr)(unsafe.Pointer(bp)))
 143306 			Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(bp)))
 143307 			Xsqlite3VdbeAddOp4Int(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, OP_Filter, (*WhereLevel)(unsafe.Pointer(pLevel)).FregFilter,
 143308 				addrNxt, r1, int32(nEq))
 143309 
 143310 		}
 143311 		(*WhereLevel)(unsafe.Pointer(pLevel)).FregFilter = 0
 143312 		(*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBrk = 0
 143313 	}
 143314 }
 143315 
 143316 // Generate code for the start of the iLevel-th loop in the WHERE clause
 143317 // implementation described by pWInfo.
 143318 func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWInfo uintptr, iLevel int32, pLevel uintptr, notReady Bitmask) Bitmask {
 143319 	bp := tls.Alloc(96)
 143320 	defer tls.Free(96)
 143321 
 143322 	var j int32
 143323 	var k int32
 143324 	var iCur int32
 143325 	var addrNxt int32
 143326 	var bRev int32
 143327 	var pLoop uintptr
 143328 	var pWC uintptr
 143329 	var pTerm uintptr
 143330 	var db uintptr
 143331 	var pTabItem uintptr
 143332 	var addrBrk int32
 143333 	var addrHalt int32
 143334 	var addrCont int32
 143335 	var iRowidReg int32
 143336 	var iReleaseReg int32
 143337 	var pIdx uintptr
 143338 	var iLoop int32
 143339 	var regYield int32
 143340 	var iTab int32
 143341 	var iCache int32
 143342 	var pRight uintptr
 143343 	var iTarget int32
 143344 	var iFld int32
 143345 	var pLeft uintptr
 143346 	var pCompare uintptr
 143347 	var pRight1 uintptr
 143348 	var pOp uintptr
 143349 	var iIn int32
 143350 
 143351 	var iReg int32
 143352 	var addrNotFound int32
 143353 	var nConstraint int32
 143354 	var pX uintptr
 143355 	var r1 int32
 143356 
 143357 	var op int32
 143358 
 143359 	var pX1 uintptr
 143360 
 143361 	var testOp int32
 143362 	var start int32
 143363 	var memEndValue int32
 143364 	var pStart uintptr
 143365 	var pEnd uintptr
 143366 	var t uintptr
 143367 	var t1 U8
 143368 	var t2 U8
 143369 	var pRight2 uintptr
 143370 	var pRight3 uintptr
 143371 	var pPk uintptr
 143372 	var nEq U16
 143373 	var nBtm U16
 143374 	var nTop U16
 143375 	var regBase int32
 143376 	var pRangeStart uintptr
 143377 	var pRangeEnd uintptr
 143378 	var startEq int32
 143379 	var endEq int32
 143380 	var start_constraints int32
 143381 	var nConstraint1 int32
 143382 	var iIdxCur int32
 143383 	var nExtraReg int32
 143384 	var op1 int32
 143385 
 143386 	var zEndAff uintptr
 143387 	var bSeekPastNull U8
 143388 	var bStopAtNull U8
 143389 	var omitTable int32
 143390 	var regBignull int32
 143391 	var addrSeekScan int32
 143392 	var nNotReady int32
 143393 	var origSrc uintptr
 143394 	var pPk1 uintptr
 143395 	var pExpr uintptr
 143396 	var iTerm int32
 143397 	var iCol int32
 143398 	var pPk2 uintptr
 143399 	var nPk int32
 143400 	var iPk int32
 143401 	var r int32
 143402 	var iSet int32
 143403 	var pSubLoop uintptr
 143404 	var addrExplain int32
 143405 	_ = addrExplain
 143406 	var pSubWInfo uintptr
 143407 	var pOrExpr uintptr
 143408 	var pDelete uintptr
 143409 	var jmp1 int32
 143410 	var pOrTerm uintptr
 143411 
 143412 	var pOrWc uintptr
 143413 	var pOrTab uintptr
 143414 	var pCov uintptr
 143415 	var iCovCur int32
 143416 
 143417 	var regReturn int32
 143418 	var regRowset int32
 143419 	var regRowid int32
 143420 	var iLoopBody int32
 143421 	var iRetInit int32
 143422 	var untestedTerms int32
 143423 	var ii int32
 143424 	var pAndExpr uintptr
 143425 	var pTab uintptr
 143426 	var m Bitmask
 143427 	var pE uintptr
 143428 	var skipLikeAddr int32
 143429 	var iNext int32
 143430 	var pE1 uintptr
 143431 
 143432 	var pAlt uintptr
 143433 	var iCol1 int32
 143434 	var iPk1 int32
 143435 	var pPk3 uintptr
 143436 	var pTab1 uintptr
 143437 	var nPk1 int32
 143438 	var r2 int32
 143439 	var jmp11 int32
 143440 	var pRJ uintptr
 143441 
 143442 	var pRJ1 uintptr
 143443 	iRowidReg = 0
 143444 	iReleaseReg = 0
 143445 	pIdx = uintptr(0)
 143446 
 143447 	pWC = pWInfo + 104
 143448 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 143449 	pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop
 143450 	pTabItem = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104
 143451 	iCur = (*SrcItem)(unsafe.Pointer(pTabItem)).FiCursor
 143452 	(*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady = notReady & ^Xsqlite3WhereGetMask(tls, pWInfo+592, iCur)
 143453 	bRev = int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FrevMask >> iLevel & uint64(1))
 143454 
 143455 	addrBrk = libc.AssignPtrInt32(pLevel+12, libc.AssignPtrInt32(pLevel+16, Xsqlite3VdbeMakeLabel(tls, pParse)))
 143456 	addrCont = libc.AssignPtrInt32(pLevel+24, Xsqlite3VdbeMakeLabel(tls, pParse))
 143457 
 143458 	if !(int32((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0 && int32((*SrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&JT_LEFT != 0) {
 143459 		goto __1
 143460 	}
 143461 	(*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 143462 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin)
 143463 
 143464 __1:
 143465 	;
 143466 	j = iLevel
 143467 __2:
 143468 	if !(j > 0) {
 143469 		goto __4
 143470 	}
 143471 	if !((*WhereLevel)(unsafe.Pointer(pWInfo+856+uintptr(j)*104)).FiLeftJoin != 0) {
 143472 		goto __5
 143473 	}
 143474 	goto __4
 143475 __5:
 143476 	;
 143477 	if !((*WhereLevel)(unsafe.Pointer(pWInfo+856+uintptr(j)*104)).FpRJ != 0) {
 143478 		goto __6
 143479 	}
 143480 	goto __4
 143481 __6:
 143482 	;
 143483 	goto __3
 143484 __3:
 143485 	j--
 143486 	goto __2
 143487 	goto __4
 143488 __4:
 143489 	;
 143490 	addrHalt = (*WhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(j)*104)).FaddrBrk
 143491 
 143492 	if !(uint32(int32(*(*uint16)(unsafe.Pointer(pTabItem + 60 + 4))&0x20>>5)) != 0) {
 143493 		goto __7
 143494 	}
 143495 	regYield = (*SrcItem)(unsafe.Pointer(pTabItem)).FregReturn
 143496 	Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regYield, 0, (*SrcItem)(unsafe.Pointer(pTabItem)).FaddrFillSub)
 143497 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = Xsqlite3VdbeAddOp2(tls, v, OP_Yield, regYield, addrBrk)
 143498 
 143499 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Goto)
 143500 	goto __8
 143501 __7:
 143502 	if !((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_VIRTUALTABLE) != U32(0)) {
 143503 		goto __9
 143504 	}
 143505 	nConstraint = int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm)
 143506 
 143507 	iReg = Xsqlite3GetTempRange(tls, pParse, nConstraint+2)
 143508 	addrNotFound = (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBrk
 143509 	j = 0
 143510 __11:
 143511 	if !(j < nConstraint) {
 143512 		goto __13
 143513 	}
 143514 	iTarget = iReg + j + 2
 143515 	pTerm = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*8))
 143516 	if !(pTerm == uintptr(0)) {
 143517 		goto __14
 143518 	}
 143519 	goto __12
 143520 __14:
 143521 	;
 143522 	if !(int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&WO_IN != 0) {
 143523 		goto __15
 143524 	}
 143525 	if !(func() uint32 {
 143526 		if j <= 31 {
 143527 			return uint32(1) << j
 143528 		}
 143529 		return uint32(0)
 143530 	}()&*(*U32)(unsafe.Pointer(pLoop + 24 + 24)) != 0) {
 143531 		goto __17
 143532 	}
 143533 	iTab = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 143534 	iCache = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 143535 	Xsqlite3CodeRhsOfIN(tls, pParse, (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr, iTab)
 143536 	Xsqlite3VdbeAddOp3(tls, v, OP_VInitIn, iTab, iTarget, iCache)
 143537 	goto __18
 143538 __17:
 143539 	codeEqualityTerm(tls, pParse, pTerm, pLevel, j, bRev, iTarget)
 143540 	addrNotFound = (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt
 143541 __18:
 143542 	;
 143543 	goto __16
 143544 __15:
 143545 	pRight = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight
 143546 	codeExprOrVector(tls, pParse, pRight, iTarget, 1)
 143547 	if !(int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp) == SQLITE_INDEX_CONSTRAINT_OFFSET &&
 143548 		U32(int32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x2>>1)) != 0) {
 143549 		goto __19
 143550 	}
 143551 
 143552 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*Select)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FiOffset)
 143553 
 143554 __19:
 143555 	;
 143556 __16:
 143557 	;
 143558 	goto __12
 143559 __12:
 143560 	j++
 143561 	goto __11
 143562 	goto __13
 143563 __13:
 143564 	;
 143565 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, *(*int32)(unsafe.Pointer(pLoop + 24)), iReg)
 143566 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, nConstraint, iReg+1)
 143567 	Xsqlite3VdbeAddOp4(tls, v, OP_VFilter, iCur, addrNotFound, iReg,
 143568 		*(*uintptr)(unsafe.Pointer(pLoop + 24 + 16)),
 143569 		func() int32 {
 143570 			if U32(int32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x1>>0)) != 0 {
 143571 				return -6
 143572 			}
 143573 			return -1
 143574 		}())
 143575 
 143576 	libc.SetBitFieldPtr8Uint32(pLoop+24+4, U32(0), 0, 0x1)
 143577 
 143578 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 143579 		goto __20
 143580 	}
 143581 	*(*uintptr)(unsafe.Pointer(pLoop + 24 + 16)) = uintptr(0)
 143582 __20:
 143583 	;
 143584 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur
 143585 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fop = func() uint8 {
 143586 		if (*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass != 0 {
 143587 			return uint8(OP_Noop)
 143588 		}
 143589 		return uint8(OP_VNext)
 143590 	}()
 143591 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = Xsqlite3VdbeCurrentAddr(tls, v)
 143592 
 143593 	j = 0
 143594 __21:
 143595 	if !(j < nConstraint) {
 143596 		goto __23
 143597 	}
 143598 	pTerm = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*8))
 143599 	if !(j < 16 && int32(*(*U16)(unsafe.Pointer(pLoop + 24 + 8)))>>j&1 != 0) {
 143600 		goto __24
 143601 	}
 143602 	disableTerm(tls, pLevel, pTerm)
 143603 	goto __22
 143604 __24:
 143605 	;
 143606 	if !(int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&WO_IN != 0 &&
 143607 		func() uint32 {
 143608 			if j <= 31 {
 143609 				return uint32(1) << j
 143610 			}
 143611 			return uint32(0)
 143612 		}()&*(*U32)(unsafe.Pointer(pLoop + 24 + 24)) == uint32(0) &&
 143613 		!(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0)) {
 143614 		goto __25
 143615 	}
 143616 
 143617 	iIn = 0
 143618 __26:
 143619 	if !(iIn < *(*int32)(unsafe.Pointer(pLevel + 72))) {
 143620 		goto __28
 143621 	}
 143622 	pOp = Xsqlite3VdbeGetOp(tls, v, *(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLevel + 72 + 8)) + uintptr(iIn)*20 + 4)))
 143623 	if !(int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Column && (*VdbeOp)(unsafe.Pointer(pOp)).Fp3 == iReg+j+2 ||
 143624 		int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Rowid && (*VdbeOp)(unsafe.Pointer(pOp)).Fp2 == iReg+j+2) {
 143625 		goto __29
 143626 	}
 143627 
 143628 	Xsqlite3VdbeAddOp3(tls, v, int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode), (*VdbeOp)(unsafe.Pointer(pOp)).Fp1, (*VdbeOp)(unsafe.Pointer(pOp)).Fp2, (*VdbeOp)(unsafe.Pointer(pOp)).Fp3)
 143629 	goto __28
 143630 __29:
 143631 	;
 143632 	goto __27
 143633 __27:
 143634 	iIn++
 143635 	goto __26
 143636 	goto __28
 143637 __28:
 143638 	;
 143639 	pCompare = Xsqlite3PExpr(tls, pParse, TK_EQ, uintptr(0), uintptr(0))
 143640 	if !!(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
 143641 		goto __30
 143642 	}
 143643 	iFld = *(*int32)(unsafe.Pointer(pTerm + 32 + 4))
 143644 	pLeft = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft
 143645 
 143646 	if !(iFld > 0) {
 143647 		goto __31
 143648 	}
 143649 
 143650 	(*Expr)(unsafe.Pointer(pCompare)).FpLeft = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLeft + 32)) + 8 + uintptr(iFld-1)*32)).FpExpr
 143651 	goto __32
 143652 __31:
 143653 	(*Expr)(unsafe.Pointer(pCompare)).FpLeft = pLeft
 143654 __32:
 143655 	;
 143656 	(*Expr)(unsafe.Pointer(pCompare)).FpRight = libc.AssignUintptr(&pRight1, Xsqlite3Expr(tls, db, TK_REGISTER, uintptr(0)))
 143657 	if !(pRight1 != 0) {
 143658 		goto __33
 143659 	}
 143660 	(*Expr)(unsafe.Pointer(pRight1)).FiTable = iReg + j + 2
 143661 	Xsqlite3ExprIfFalse(tls,
 143662 		pParse, pCompare, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrCont, SQLITE_JUMPIFNULL)
 143663 __33:
 143664 	;
 143665 	(*Expr)(unsafe.Pointer(pCompare)).FpLeft = uintptr(0)
 143666 __30:
 143667 	;
 143668 	Xsqlite3ExprDelete(tls, db, pCompare)
 143669 __25:
 143670 	;
 143671 	goto __22
 143672 __22:
 143673 	j++
 143674 	goto __21
 143675 	goto __23
 143676 __23:
 143677 	;
 143678 	goto __10
 143679 __9:
 143680 	if !((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IPK) != U32(0) &&
 143681 		(*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_COLUMN_IN|WHERE_COLUMN_EQ) != U32(0)) {
 143682 		goto __34
 143683 	}
 143684 
 143685 	pTerm = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm))
 143686 
 143687 	iReleaseReg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 143688 	iRowidReg = codeEqualityTerm(tls, pParse, pTerm, pLevel, 0, bRev, iReleaseReg)
 143689 	if !(iRowidReg != iReleaseReg) {
 143690 		goto __36
 143691 	}
 143692 	Xsqlite3ReleaseTempReg(tls, pParse, iReleaseReg)
 143693 __36:
 143694 	;
 143695 	addrNxt = (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt
 143696 	if !((*WhereLevel)(unsafe.Pointer(pLevel)).FregFilter != 0) {
 143697 		goto __37
 143698 	}
 143699 	Xsqlite3VdbeAddOp2(tls, v, OP_MustBeInt, iRowidReg, addrNxt)
 143700 
 143701 	Xsqlite3VdbeAddOp4Int(tls, v, OP_Filter, (*WhereLevel)(unsafe.Pointer(pLevel)).FregFilter, addrNxt,
 143702 		iRowidReg, 1)
 143703 
 143704 	filterPullDown(tls, pParse, pWInfo, iLevel, addrNxt, notReady)
 143705 __37:
 143706 	;
 143707 	Xsqlite3VdbeAddOp3(tls, v, OP_SeekRowid, iCur, addrNxt, iRowidReg)
 143708 
 143709 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Noop)
 143710 	goto __35
 143711 __34:
 143712 	if !((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IPK) != U32(0) &&
 143713 		(*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_COLUMN_RANGE) != U32(0)) {
 143714 		goto __38
 143715 	}
 143716 
 143717 	testOp = OP_Noop
 143718 	memEndValue = 0
 143719 
 143720 	j = 0
 143721 	pStart = libc.AssignUintptr(&pEnd, uintptr(0))
 143722 	if !((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_BTM_LIMIT) != 0) {
 143723 		goto __40
 143724 	}
 143725 	pStart = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8))
 143726 __40:
 143727 	;
 143728 	if !((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_TOP_LIMIT) != 0) {
 143729 		goto __41
 143730 	}
 143731 	pEnd = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8))
 143732 __41:
 143733 	;
 143734 	if !(bRev != 0) {
 143735 		goto __42
 143736 	}
 143737 	pTerm = pStart
 143738 	pStart = pEnd
 143739 	pEnd = pTerm
 143740 __42:
 143741 	;
 143742 	if !(pStart != 0) {
 143743 		goto __43
 143744 	}
 143745 
 143746 	*(*[4]U8)(unsafe.Pointer(bp + 8)) = [4]U8{
 143747 		U8(OP_SeekGT),
 143748 		U8(OP_SeekLE),
 143749 		U8(OP_SeekLT),
 143750 		U8(OP_SeekGE),
 143751 	}
 143752 
 143753 	pX = (*WhereTerm)(unsafe.Pointer(pStart)).FpExpr
 143754 
 143755 	if !(Xsqlite3ExprIsVector(tls, (*Expr)(unsafe.Pointer(pX)).FpRight) != 0) {
 143756 		goto __45
 143757 	}
 143758 	r1 = libc.AssignPtrInt32(bp+12, Xsqlite3GetTempReg(tls, pParse))
 143759 	codeExprOrVector(tls, pParse, (*Expr)(unsafe.Pointer(pX)).FpRight, r1, 1)
 143760 
 143761 	op = int32(*(*U8)(unsafe.Pointer(bp + 8 + uintptr((int32((*Expr)(unsafe.Pointer(pX)).Fop)-TK_GT-1)&0x3|0x1))))
 143762 
 143763 	goto __46
 143764 __45:
 143765 	r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pX)).FpRight, bp+12)
 143766 	disableTerm(tls, pLevel, pStart)
 143767 	op = int32(*(*U8)(unsafe.Pointer(bp + 8 + uintptr(int32((*Expr)(unsafe.Pointer(pX)).Fop)-TK_GT))))
 143768 __46:
 143769 	;
 143770 	Xsqlite3VdbeAddOp3(tls, v, op, iCur, addrBrk, r1)
 143771 
 143772 	Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 12)))
 143773 	goto __44
 143774 __43:
 143775 	Xsqlite3VdbeAddOp2(tls, v, func() int32 {
 143776 		if bRev != 0 {
 143777 			return OP_Last
 143778 		}
 143779 		return OP_Rewind
 143780 	}(), iCur, addrHalt)
 143781 
 143782 __44:
 143783 	;
 143784 	if !(pEnd != 0) {
 143785 		goto __47
 143786 	}
 143787 	pX1 = (*WhereTerm)(unsafe.Pointer(pEnd)).FpExpr
 143788 
 143789 	memEndValue = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 143790 	codeExprOrVector(tls, pParse, (*Expr)(unsafe.Pointer(pX1)).FpRight, memEndValue, 1)
 143791 	if !(0 == Xsqlite3ExprIsVector(tls, (*Expr)(unsafe.Pointer(pX1)).FpRight) &&
 143792 		(int32((*Expr)(unsafe.Pointer(pX1)).Fop) == TK_LT || int32((*Expr)(unsafe.Pointer(pX1)).Fop) == TK_GT)) {
 143793 		goto __48
 143794 	}
 143795 	if bRev != 0 {
 143796 		testOp = OP_Le
 143797 	} else {
 143798 		testOp = OP_Ge
 143799 	}
 143800 	goto __49
 143801 __48:
 143802 	if bRev != 0 {
 143803 		testOp = OP_Lt
 143804 	} else {
 143805 		testOp = OP_Gt
 143806 	}
 143807 __49:
 143808 	;
 143809 	if !(0 == Xsqlite3ExprIsVector(tls, (*Expr)(unsafe.Pointer(pX1)).FpRight)) {
 143810 		goto __50
 143811 	}
 143812 	disableTerm(tls, pLevel, pEnd)
 143813 __50:
 143814 	;
 143815 __47:
 143816 	;
 143817 	start = Xsqlite3VdbeCurrentAddr(tls, v)
 143818 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fop = func() uint8 {
 143819 		if bRev != 0 {
 143820 			return uint8(OP_Prev)
 143821 		}
 143822 		return uint8(OP_Next)
 143823 	}()
 143824 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur
 143825 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = start
 143826 
 143827 	if !(testOp != OP_Noop) {
 143828 		goto __51
 143829 	}
 143830 	iRowidReg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 143831 	Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iCur, iRowidReg)
 143832 	Xsqlite3VdbeAddOp3(tls, v, testOp, memEndValue, addrBrk, iRowidReg)
 143833 
 143834 	Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_AFF_NUMERIC|SQLITE_JUMPIFNULL))
 143835 __51:
 143836 	;
 143837 	goto __39
 143838 __38:
 143839 	if !((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_INDEXED) != 0) {
 143840 		goto __52
 143841 	}
 143842 	nEq = *(*U16)(unsafe.Pointer(pLoop + 24))
 143843 	nBtm = *(*U16)(unsafe.Pointer(pLoop + 24 + 2))
 143844 	nTop = *(*U16)(unsafe.Pointer(pLoop + 24 + 4))
 143845 	pRangeStart = uintptr(0)
 143846 	pRangeEnd = uintptr(0)
 143847 	nExtraReg = 0
 143848 	zEndAff = uintptr(0)
 143849 	bSeekPastNull = U8(0)
 143850 	bStopAtNull = U8(0)
 143851 	regBignull = 0
 143852 	addrSeekScan = 0
 143853 
 143854 	pIdx = *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8))
 143855 	iIdxCur = (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur
 143856 
 143857 	j = int32(nEq)
 143858 	if !((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_BTM_LIMIT) != 0) {
 143859 		goto __54
 143860 	}
 143861 	pRangeStart = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8))
 143862 	nExtraReg = func() int32 {
 143863 		if nExtraReg > int32(*(*U16)(unsafe.Pointer(pLoop + 24 + 2))) {
 143864 			return nExtraReg
 143865 		}
 143866 		return int32(*(*U16)(unsafe.Pointer(pLoop + 24 + 2)))
 143867 	}()
 143868 
 143869 __54:
 143870 	;
 143871 	if !((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_TOP_LIMIT) != 0) {
 143872 		goto __55
 143873 	}
 143874 	pRangeEnd = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8))
 143875 	nExtraReg = func() int32 {
 143876 		if nExtraReg > int32(*(*U16)(unsafe.Pointer(pLoop + 24 + 4))) {
 143877 			return nExtraReg
 143878 		}
 143879 		return int32(*(*U16)(unsafe.Pointer(pLoop + 24 + 4)))
 143880 	}()
 143881 	if !(pRangeStart == uintptr(0)) {
 143882 		goto __56
 143883 	}
 143884 	j = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(nEq)*2)))
 143885 	if !(j >= 0 && int32(*(*uint8)(unsafe.Pointer((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(j)*24 + 8))&0xf>>0) == 0 || j == -2) {
 143886 		goto __57
 143887 	}
 143888 	bSeekPastNull = U8(1)
 143889 __57:
 143890 	;
 143891 __56:
 143892 	;
 143893 __55:
 143894 	;
 143895 	if !((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_TOP_LIMIT|WHERE_BTM_LIMIT) == U32(0) &&
 143896 		(*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_BIGNULL_SORT) != U32(0)) {
 143897 		goto __58
 143898 	}
 143899 
 143900 	nExtraReg = 1
 143901 	bSeekPastNull = U8(1)
 143902 	(*WhereLevel)(unsafe.Pointer(pLevel)).FregBignull = libc.AssignInt32(&regBignull, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
 143903 	if !((*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin != 0) {
 143904 		goto __59
 143905 	}
 143906 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regBignull)
 143907 __59:
 143908 	;
 143909 	(*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBignull = Xsqlite3VdbeMakeLabel(tls, pParse)
 143910 __58:
 143911 	;
 143912 	if !(int32(nEq) < int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) && bRev == libc.Bool32(int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(nEq)))) == SQLITE_SO_ASC)) {
 143913 		goto __60
 143914 	}
 143915 
 143916 	t = pRangeEnd
 143917 	pRangeEnd = pRangeStart
 143918 	pRangeStart = t
 143919 
 143920 	t1 = bSeekPastNull
 143921 	bSeekPastNull = bStopAtNull
 143922 	bStopAtNull = t1
 143923 
 143924 	t2 = U8(nBtm)
 143925 	nBtm = nTop
 143926 	nTop = U16(t2)
 143927 
 143928 __60:
 143929 	;
 143930 	if !(iLevel > 0 && (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IN_SEEKSCAN) != U32(0)) {
 143931 		goto __61
 143932 	}
 143933 
 143934 	Xsqlite3VdbeAddOp1(tls, v, OP_NullRow, iIdxCur)
 143935 __61:
 143936 	;
 143937 	regBase = codeAllEqualityTerms(tls, pParse, pLevel, bRev, nExtraReg, bp+16)
 143938 
 143939 	if !(*(*uintptr)(unsafe.Pointer(bp + 16)) != 0 && nTop != 0) {
 143940 		goto __62
 143941 	}
 143942 	zEndAff = Xsqlite3DbStrDup(tls, db, *(*uintptr)(unsafe.Pointer(bp + 16))+uintptr(nEq))
 143943 __62:
 143944 	;
 143945 	addrNxt = func() int32 {
 143946 		if regBignull != 0 {
 143947 			return (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBignull
 143948 		}
 143949 		return (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt
 143950 	}()
 143951 
 143952 	startEq = libc.Bool32(!(pRangeStart != 0) || int32((*WhereTerm)(unsafe.Pointer(pRangeStart)).FeOperator)&(int32(WO_EQ)<<(TK_LE-TK_EQ)|int32(WO_EQ)<<(TK_GE-TK_EQ)) != 0)
 143953 	endEq = libc.Bool32(!(pRangeEnd != 0) || int32((*WhereTerm)(unsafe.Pointer(pRangeEnd)).FeOperator)&(int32(WO_EQ)<<(TK_LE-TK_EQ)|int32(WO_EQ)<<(TK_GE-TK_EQ)) != 0)
 143954 	start_constraints = libc.Bool32(pRangeStart != 0 || int32(nEq) > 0)
 143955 
 143956 	nConstraint1 = int32(nEq)
 143957 	if !(pRangeStart != 0) {
 143958 		goto __63
 143959 	}
 143960 	pRight2 = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pRangeStart)).FpExpr)).FpRight
 143961 	codeExprOrVector(tls, pParse, pRight2, regBase+int32(nEq), int32(nBtm))
 143962 
 143963 	if !(int32((*WhereTerm)(unsafe.Pointer(pRangeStart)).FwtFlags)&TERM_VNULL == 0 &&
 143964 		Xsqlite3ExprCanBeNull(tls, pRight2) != 0) {
 143965 		goto __65
 143966 	}
 143967 	Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, regBase+int32(nEq), addrNxt)
 143968 
 143969 __65:
 143970 	;
 143971 	if !(*(*uintptr)(unsafe.Pointer(bp + 16)) != 0) {
 143972 		goto __66
 143973 	}
 143974 	updateRangeAffinityStr(tls, pRight2, int32(nBtm), *(*uintptr)(unsafe.Pointer(bp + 16))+uintptr(nEq))
 143975 __66:
 143976 	;
 143977 	nConstraint1 = nConstraint1 + int32(nBtm)
 143978 
 143979 	if !(Xsqlite3ExprIsVector(tls, pRight2) == 0) {
 143980 		goto __67
 143981 	}
 143982 	disableTerm(tls, pLevel, pRangeStart)
 143983 	goto __68
 143984 __67:
 143985 	startEq = 1
 143986 __68:
 143987 	;
 143988 	bSeekPastNull = U8(0)
 143989 	goto __64
 143990 __63:
 143991 	if !(bSeekPastNull != 0) {
 143992 		goto __69
 143993 	}
 143994 	startEq = 0
 143995 	Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regBase+int32(nEq))
 143996 	start_constraints = 1
 143997 	nConstraint1++
 143998 	goto __70
 143999 __69:
 144000 	if !(regBignull != 0) {
 144001 		goto __71
 144002 	}
 144003 	Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regBase+int32(nEq))
 144004 	start_constraints = 1
 144005 	nConstraint1++
 144006 __71:
 144007 	;
 144008 __70:
 144009 	;
 144010 __64:
 144011 	;
 144012 	codeApplyAffinity(tls, pParse, regBase, nConstraint1-int32(bSeekPastNull), *(*uintptr)(unsafe.Pointer(bp + 16)))
 144013 	if !(int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnSkip) > 0 && nConstraint1 == int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnSkip)) {
 144014 		goto __72
 144015 	}
 144016 
 144017 	goto __73
 144018 __72:
 144019 	if !(regBignull != 0) {
 144020 		goto __74
 144021 	}
 144022 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, regBignull)
 144023 
 144024 __74:
 144025 	;
 144026 	if !((*WhereLevel)(unsafe.Pointer(pLevel)).FregFilter != 0) {
 144027 		goto __75
 144028 	}
 144029 	Xsqlite3VdbeAddOp4Int(tls, v, OP_Filter, (*WhereLevel)(unsafe.Pointer(pLevel)).FregFilter, addrNxt,
 144030 		regBase, int32(nEq))
 144031 
 144032 	filterPullDown(tls, pParse, pWInfo, iLevel, addrNxt, notReady)
 144033 __75:
 144034 	;
 144035 	op1 = int32(aStartOp[start_constraints<<2+startEq<<1+bRev])
 144036 
 144037 	if !((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IN_SEEKSCAN) != U32(0) && op1 == OP_SeekGE) {
 144038 		goto __76
 144039 	}
 144040 
 144041 	addrSeekScan = Xsqlite3VdbeAddOp1(tls, v, OP_SeekScan,
 144042 		(int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst)))+9)/10)
 144043 	if !(pRangeStart != 0) {
 144044 		goto __77
 144045 	}
 144046 	Xsqlite3VdbeChangeP5(tls, v, uint16(1))
 144047 	Xsqlite3VdbeChangeP2(tls, v, addrSeekScan, Xsqlite3VdbeCurrentAddr(tls, v)+1)
 144048 	addrSeekScan = 0
 144049 __77:
 144050 	;
 144051 __76:
 144052 	;
 144053 	Xsqlite3VdbeAddOp4Int(tls, v, op1, iIdxCur, addrNxt, regBase, nConstraint1)
 144054 
 144055 	if !(regBignull != 0) {
 144056 		goto __78
 144057 	}
 144058 
 144059 	Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, Xsqlite3VdbeCurrentAddr(tls, v)+2)
 144060 	op1 = int32(aStartOp[libc.Bool32(nConstraint1 > 1)*4+2+bRev])
 144061 	Xsqlite3VdbeAddOp4Int(tls, v, op1, iIdxCur, addrNxt, regBase,
 144062 		nConstraint1-startEq)
 144063 
 144064 __78:
 144065 	;
 144066 __73:
 144067 	;
 144068 	nConstraint1 = int32(nEq)
 144069 
 144070 	if !(pRangeEnd != 0) {
 144071 		goto __79
 144072 	}
 144073 	pRight3 = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pRangeEnd)).FpExpr)).FpRight
 144074 	if !(addrSeekScan != 0) {
 144075 		goto __81
 144076 	}
 144077 
 144078 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = Xsqlite3VdbeCurrentAddr(tls, v)
 144079 __81:
 144080 	;
 144081 	codeExprOrVector(tls, pParse, pRight3, regBase+int32(nEq), int32(nTop))
 144082 
 144083 	if !(int32((*WhereTerm)(unsafe.Pointer(pRangeEnd)).FwtFlags)&TERM_VNULL == 0 &&
 144084 		Xsqlite3ExprCanBeNull(tls, pRight3) != 0) {
 144085 		goto __82
 144086 	}
 144087 	Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, regBase+int32(nEq), addrNxt)
 144088 
 144089 __82:
 144090 	;
 144091 	if !(zEndAff != 0) {
 144092 		goto __83
 144093 	}
 144094 	updateRangeAffinityStr(tls, pRight3, int32(nTop), zEndAff)
 144095 	codeApplyAffinity(tls, pParse, regBase+int32(nEq), int32(nTop), zEndAff)
 144096 	goto __84
 144097 __83:
 144098 	;
 144099 __84:
 144100 	;
 144101 	nConstraint1 = nConstraint1 + int32(nTop)
 144102 
 144103 	if !(Xsqlite3ExprIsVector(tls, pRight3) == 0) {
 144104 		goto __85
 144105 	}
 144106 	disableTerm(tls, pLevel, pRangeEnd)
 144107 	goto __86
 144108 __85:
 144109 	endEq = 1
 144110 __86:
 144111 	;
 144112 	goto __80
 144113 __79:
 144114 	if !(bStopAtNull != 0) {
 144115 		goto __87
 144116 	}
 144117 	if !(regBignull == 0) {
 144118 		goto __88
 144119 	}
 144120 	Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regBase+int32(nEq))
 144121 	endEq = 0
 144122 __88:
 144123 	;
 144124 	nConstraint1++
 144125 __87:
 144126 	;
 144127 __80:
 144128 	;
 144129 	if !(*(*uintptr)(unsafe.Pointer(bp + 16)) != 0) {
 144130 		goto __89
 144131 	}
 144132 	Xsqlite3DbNNFreeNN(tls, db, *(*uintptr)(unsafe.Pointer(bp + 16)))
 144133 __89:
 144134 	;
 144135 	if !(zEndAff != 0) {
 144136 		goto __90
 144137 	}
 144138 	Xsqlite3DbNNFreeNN(tls, db, zEndAff)
 144139 __90:
 144140 	;
 144141 	if !((*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 == 0) {
 144142 		goto __91
 144143 	}
 144144 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = Xsqlite3VdbeCurrentAddr(tls, v)
 144145 __91:
 144146 	;
 144147 	if !(nConstraint1 != 0) {
 144148 		goto __92
 144149 	}
 144150 	if !(regBignull != 0) {
 144151 		goto __93
 144152 	}
 144153 
 144154 	Xsqlite3VdbeAddOp2(tls, v, OP_IfNot, regBignull, Xsqlite3VdbeCurrentAddr(tls, v)+3)
 144155 
 144156 __93:
 144157 	;
 144158 	op1 = int32(aEndOp[bRev*2+endEq])
 144159 	Xsqlite3VdbeAddOp4Int(tls, v, op1, iIdxCur, addrNxt, regBase, nConstraint1)
 144160 
 144161 	if !(addrSeekScan != 0) {
 144162 		goto __94
 144163 	}
 144164 	Xsqlite3VdbeJumpHere(tls, v, addrSeekScan)
 144165 __94:
 144166 	;
 144167 __92:
 144168 	;
 144169 	if !(regBignull != 0) {
 144170 		goto __95
 144171 	}
 144172 
 144173 	Xsqlite3VdbeAddOp2(tls, v, OP_If, regBignull, Xsqlite3VdbeCurrentAddr(tls, v)+2)
 144174 
 144175 	op1 = int32(aEndOp[bRev*2+int32(bSeekPastNull)])
 144176 	Xsqlite3VdbeAddOp4Int(tls, v, op1, iIdxCur, addrNxt, regBase,
 144177 		nConstraint1+int32(bSeekPastNull))
 144178 
 144179 __95:
 144180 	;
 144181 	if !((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IN_EARLYOUT) != U32(0)) {
 144182 		goto __96
 144183 	}
 144184 	Xsqlite3VdbeAddOp3(tls, v, OP_SeekHit, iIdxCur, int32(nEq), int32(nEq))
 144185 __96:
 144186 	;
 144187 	omitTable = libc.Bool32((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IDX_ONLY) != U32(0) &&
 144188 		int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&(WHERE_OR_SUBCLAUSE|WHERE_RIGHT_JOIN) == 0)
 144189 	if !(omitTable != 0) {
 144190 		goto __97
 144191 	}
 144192 
 144193 	goto __98
 144194 __97:
 144195 	if !((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 144196 		goto __99
 144197 	}
 144198 	codeDeferredSeek(tls, pWInfo, pIdx, iCur, iIdxCur)
 144199 	goto __100
 144200 __99:
 144201 	if !(iCur != iIdxCur) {
 144202 		goto __101
 144203 	}
 144204 	pPk = Xsqlite3PrimaryKeyIndex(tls, (*Index)(unsafe.Pointer(pIdx)).FpTable)
 144205 	iRowidReg = Xsqlite3GetTempRange(tls, pParse, int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol))
 144206 	j = 0
 144207 __102:
 144208 	if !(j < int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol)) {
 144209 		goto __104
 144210 	}
 144211 	k = int32(Xsqlite3TableColumnToIndex(tls, pIdx, *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2))))
 144212 	Xsqlite3VdbeAddOp3(tls, v, OP_Column, iIdxCur, k, iRowidReg+j)
 144213 	goto __103
 144214 __103:
 144215 	j++
 144216 	goto __102
 144217 	goto __104
 144218 __104:
 144219 	;
 144220 	Xsqlite3VdbeAddOp4Int(tls, v, OP_NotFound, iCur, addrCont,
 144221 		iRowidReg, int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol))
 144222 __101:
 144223 	;
 144224 __100:
 144225 	;
 144226 __98:
 144227 	;
 144228 	if !((*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0) {
 144229 		goto __105
 144230 	}
 144231 
 144232 	if !((*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0) {
 144233 		goto __107
 144234 	}
 144235 	whereApplyPartialIndexConstraints(tls, (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere, iCur, pWC)
 144236 __107:
 144237 	;
 144238 	goto __106
 144239 __105:
 144240 	;
 144241 __106:
 144242 	;
 144243 	if !((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_ONEROW) != 0) {
 144244 		goto __108
 144245 	}
 144246 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Noop)
 144247 	goto __109
 144248 __108:
 144249 	if !(bRev != 0) {
 144250 		goto __110
 144251 	}
 144252 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Prev)
 144253 	goto __111
 144254 __110:
 144255 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Next)
 144256 __111:
 144257 	;
 144258 __109:
 144259 	;
 144260 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iIdxCur
 144261 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fp3 = func() uint8 {
 144262 		if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_UNQ_WANTED) != U32(0) {
 144263 			return uint8(1)
 144264 		}
 144265 		return uint8(0)
 144266 	}()
 144267 	if !((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_CONSTRAINT) == U32(0)) {
 144268 		goto __112
 144269 	}
 144270 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fp5 = U8(SQLITE_STMTSTATUS_FULLSCAN_STEP)
 144271 	goto __113
 144272 __112:
 144273 	;
 144274 __113:
 144275 	;
 144276 	if !(omitTable != 0) {
 144277 		goto __114
 144278 	}
 144279 	pIdx = uintptr(0)
 144280 __114:
 144281 	;
 144282 	goto __53
 144283 __52:
 144284 	if !((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_MULTI_OR) != 0) {
 144285 		goto __115
 144286 	}
 144287 	pCov = uintptr(0)
 144288 	iCovCur = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 144289 
 144290 	regReturn = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 144291 	regRowset = 0
 144292 	regRowid = 0
 144293 	iLoopBody = Xsqlite3VdbeMakeLabel(tls, pParse)
 144294 	untestedTerms = 0
 144295 	pAndExpr = uintptr(0)
 144296 	pTab = (*SrcItem)(unsafe.Pointer(pTabItem)).FpTab
 144297 
 144298 	pTerm = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm))
 144299 
 144300 	pOrWc = *(*uintptr)(unsafe.Pointer(pTerm + 32))
 144301 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Return)
 144302 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = regReturn
 144303 
 144304 	if !(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) > 1) {
 144305 		goto __117
 144306 	}
 144307 	nNotReady = int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - iLevel - 1
 144308 	pOrTab = Xsqlite3DbMallocRawNN(tls, db,
 144309 		uint64(unsafe.Sizeof(SrcList{}))+uint64(nNotReady)*uint64(unsafe.Sizeof(SrcItem{})))
 144310 	if !(pOrTab == uintptr(0)) {
 144311 		goto __119
 144312 	}
 144313 	return notReady
 144314 __119:
 144315 	;
 144316 	(*SrcList)(unsafe.Pointer(pOrTab)).FnAlloc = U32(U8(nNotReady + 1))
 144317 	(*SrcList)(unsafe.Pointer(pOrTab)).FnSrc = int32((*SrcList)(unsafe.Pointer(pOrTab)).FnAlloc)
 144318 	libc.Xmemcpy(tls, pOrTab+8, pTabItem, uint64(unsafe.Sizeof(SrcItem{})))
 144319 	origSrc = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8
 144320 	k = 1
 144321 __120:
 144322 	if !(k <= nNotReady) {
 144323 		goto __122
 144324 	}
 144325 	libc.Xmemcpy(tls, pOrTab+8+uintptr(k)*104, origSrc+uintptr((*WhereLevel)(unsafe.Pointer(pLevel+uintptr(k)*104)).FiFrom)*104, uint64(unsafe.Sizeof(SrcItem{})))
 144326 	goto __121
 144327 __121:
 144328 	k++
 144329 	goto __120
 144330 	goto __122
 144331 __122:
 144332 	;
 144333 	goto __118
 144334 __117:
 144335 	pOrTab = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList
 144336 __118:
 144337 	;
 144338 	if !(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_DUPLICATES_OK == 0) {
 144339 		goto __123
 144340 	}
 144341 	if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 144342 		goto __124
 144343 	}
 144344 	regRowset = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 144345 	Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regRowset)
 144346 	goto __125
 144347 __124:
 144348 	pPk1 = Xsqlite3PrimaryKeyIndex(tls, pTab)
 144349 	regRowset = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 144350 	Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, regRowset, int32((*Index)(unsafe.Pointer(pPk1)).FnKeyCol))
 144351 	Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pPk1)
 144352 __125:
 144353 	;
 144354 	regRowid = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 144355 __123:
 144356 	;
 144357 	iRetInit = Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regReturn)
 144358 
 144359 	if !((*WhereClause)(unsafe.Pointer(pWC)).FnTerm > 1) {
 144360 		goto __126
 144361 	}
 144362 	iTerm = 0
 144363 __127:
 144364 	if !(iTerm < (*WhereClause)(unsafe.Pointer(pWC)).FnTerm) {
 144365 		goto __129
 144366 	}
 144367 	pExpr = (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iTerm)*56)).FpExpr
 144368 	if !((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iTerm)*56 == pTerm) {
 144369 		goto __130
 144370 	}
 144371 	goto __128
 144372 __130:
 144373 	;
 144374 	if !(int32((*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iTerm)*56)).FwtFlags)&(TERM_VIRTUAL|TERM_CODED|TERM_SLICE) != 0) {
 144375 		goto __131
 144376 	}
 144377 	goto __128
 144378 __131:
 144379 	;
 144380 	if !(int32((*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iTerm)*56)).FeOperator)&WO_ALL == 0) {
 144381 		goto __132
 144382 	}
 144383 	goto __128
 144384 __132:
 144385 	;
 144386 	if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_Subquery) != U32(0)) {
 144387 		goto __133
 144388 	}
 144389 	goto __128
 144390 __133:
 144391 	;
 144392 	pExpr = Xsqlite3ExprDup(tls, db, pExpr, 0)
 144393 	pAndExpr = Xsqlite3ExprAnd(tls, pParse, pAndExpr, pExpr)
 144394 	goto __128
 144395 __128:
 144396 	iTerm++
 144397 	goto __127
 144398 	goto __129
 144399 __129:
 144400 	;
 144401 	if !(pAndExpr != 0) {
 144402 		goto __134
 144403 	}
 144404 
 144405 	pAndExpr = Xsqlite3PExpr(tls, pParse, TK_AND|0x10000, uintptr(0), pAndExpr)
 144406 __134:
 144407 	;
 144408 __126:
 144409 	;
 144410 	Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+23193, 0)
 144411 	ii = 0
 144412 __135:
 144413 	if !(ii < (*WhereClause)(unsafe.Pointer(pOrWc)).FnTerm) {
 144414 		goto __137
 144415 	}
 144416 	pOrTerm = (*WhereClause)(unsafe.Pointer(pOrWc)).Fa + uintptr(ii)*56
 144417 	if !((*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor == iCur || int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator)&WO_AND != 0) {
 144418 		goto __138
 144419 	}
 144420 	pOrExpr = (*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr
 144421 	jmp1 = 0
 144422 
 144423 	pDelete = libc.AssignUintptr(&pOrExpr, Xsqlite3ExprDup(tls, db, pOrExpr, 0))
 144424 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 144425 		goto __139
 144426 	}
 144427 	Xsqlite3ExprDelete(tls, db, pDelete)
 144428 	goto __136
 144429 __139:
 144430 	;
 144431 	if !(pAndExpr != 0) {
 144432 		goto __140
 144433 	}
 144434 	(*Expr)(unsafe.Pointer(pAndExpr)).FpLeft = pOrExpr
 144435 	pOrExpr = pAndExpr
 144436 __140:
 144437 	;
 144438 	Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+23208, libc.VaList(bp, ii+1))
 144439 
 144440 	pSubWInfo = Xsqlite3WhereBegin(tls, pParse, pOrTab, pOrExpr, uintptr(0), uintptr(0), uintptr(0),
 144441 		uint16(WHERE_OR_SUBCLAUSE), iCovCur)
 144442 
 144443 	if !(pSubWInfo != 0) {
 144444 		goto __141
 144445 	}
 144446 	addrExplain = Xsqlite3WhereExplainOneScan(tls,
 144447 		pParse, pOrTab, pSubWInfo+856, uint16(0))
 144448 	_ = addrExplain
 144449 
 144450 	if !(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_DUPLICATES_OK == 0) {
 144451 		goto __142
 144452 	}
 144453 	iSet = func() int32 {
 144454 		if ii == (*WhereClause)(unsafe.Pointer(pOrWc)).FnTerm-1 {
 144455 			return -1
 144456 		}
 144457 		return ii
 144458 	}()
 144459 	if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 144460 		goto __143
 144461 	}
 144462 	Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iCur, -1, regRowid)
 144463 	jmp1 = Xsqlite3VdbeAddOp4Int(tls, v, OP_RowSetTest, regRowset, 0,
 144464 		regRowid, iSet)
 144465 
 144466 	goto __144
 144467 __143:
 144468 	pPk2 = Xsqlite3PrimaryKeyIndex(tls, pTab)
 144469 	nPk = int32((*Index)(unsafe.Pointer(pPk2)).FnKeyCol)
 144470 
 144471 	r = Xsqlite3GetTempRange(tls, pParse, nPk)
 144472 	iPk = 0
 144473 __145:
 144474 	if !(iPk < nPk) {
 144475 		goto __147
 144476 	}
 144477 	iCol = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk2)).FaiColumn + uintptr(iPk)*2)))
 144478 	Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iCur, iCol, r+iPk)
 144479 	goto __146
 144480 __146:
 144481 	iPk++
 144482 	goto __145
 144483 	goto __147
 144484 __147:
 144485 	;
 144486 	if !(iSet != 0) {
 144487 		goto __148
 144488 	}
 144489 	jmp1 = Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, regRowset, 0, r, nPk)
 144490 
 144491 __148:
 144492 	;
 144493 	if !(iSet >= 0) {
 144494 		goto __149
 144495 	}
 144496 	Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, r, nPk, regRowid)
 144497 	Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, regRowset, regRowid,
 144498 		r, nPk)
 144499 	if !(iSet != 0) {
 144500 		goto __150
 144501 	}
 144502 	Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT))
 144503 __150:
 144504 	;
 144505 __149:
 144506 	;
 144507 	Xsqlite3ReleaseTempRange(tls, pParse, r, nPk)
 144508 __144:
 144509 	;
 144510 __142:
 144511 	;
 144512 	Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, regReturn, iLoopBody)
 144513 
 144514 	if !(jmp1 != 0) {
 144515 		goto __151
 144516 	}
 144517 	Xsqlite3VdbeJumpHere(tls, v, jmp1)
 144518 __151:
 144519 	;
 144520 	if !(uint32(int32(*(*uint8)(unsafe.Pointer(pSubWInfo + 68))&0x2>>1)) != 0) {
 144521 		goto __152
 144522 	}
 144523 	untestedTerms = 1
 144524 __152:
 144525 	;
 144526 	pSubLoop = (*WhereLevel)(unsafe.Pointer(pSubWInfo + 856)).FpWLoop
 144527 
 144528 	if !((*WhereLoop)(unsafe.Pointer(pSubLoop)).FwsFlags&U32(WHERE_INDEXED) != U32(0) &&
 144529 		(ii == 0 || *(*uintptr)(unsafe.Pointer(pSubLoop + 24 + 8)) == pCov) &&
 144530 		((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) || !(int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pSubLoop + 24 + 8)) + 100))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY))) {
 144531 		goto __153
 144532 	}
 144533 
 144534 	pCov = *(*uintptr)(unsafe.Pointer(pSubLoop + 24 + 8))
 144535 	goto __154
 144536 __153:
 144537 	pCov = uintptr(0)
 144538 __154:
 144539 	;
 144540 	if !(Xsqlite3WhereUsesDeferredSeek(tls, pSubWInfo) != 0) {
 144541 		goto __155
 144542 	}
 144543 	libc.SetBitFieldPtr8Uint32(pWInfo+68, uint32(1), 0, 0x1)
 144544 __155:
 144545 	;
 144546 	Xsqlite3WhereEnd(tls, pSubWInfo)
 144547 	Xsqlite3VdbeExplainPop(tls, pParse)
 144548 __141:
 144549 	;
 144550 	Xsqlite3ExprDelete(tls, db, pDelete)
 144551 __138:
 144552 	;
 144553 	goto __136
 144554 __136:
 144555 	ii++
 144556 	goto __135
 144557 	goto __137
 144558 __137:
 144559 	;
 144560 	Xsqlite3VdbeExplainPop(tls, pParse)
 144561 
 144562 	*(*uintptr)(unsafe.Pointer(pLevel + 72)) = pCov
 144563 	if !(pCov != 0) {
 144564 		goto __156
 144565 	}
 144566 	(*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur = iCovCur
 144567 __156:
 144568 	;
 144569 	if !(pAndExpr != 0) {
 144570 		goto __157
 144571 	}
 144572 	(*Expr)(unsafe.Pointer(pAndExpr)).FpLeft = uintptr(0)
 144573 	Xsqlite3ExprDelete(tls, db, pAndExpr)
 144574 __157:
 144575 	;
 144576 	Xsqlite3VdbeChangeP1(tls, v, iRetInit, Xsqlite3VdbeCurrentAddr(tls, v))
 144577 	Xsqlite3VdbeGoto(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBrk)
 144578 	Xsqlite3VdbeResolveLabel(tls, v, iLoopBody)
 144579 
 144580 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = Xsqlite3VdbeCurrentAddr(tls, v)
 144581 
 144582 	if !(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) > 1) {
 144583 		goto __158
 144584 	}
 144585 	Xsqlite3DbFreeNN(tls, db, pOrTab)
 144586 __158:
 144587 	;
 144588 	if !!(untestedTerms != 0) {
 144589 		goto __159
 144590 	}
 144591 	disableTerm(tls, pLevel, pTerm)
 144592 __159:
 144593 	;
 144594 	goto __116
 144595 __115:
 144596 	;
 144597 	if !(uint32(int32(*(*uint16)(unsafe.Pointer(pTabItem + 60 + 4))&0x40>>6)) != 0) {
 144598 		goto __160
 144599 	}
 144600 
 144601 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Noop)
 144602 	goto __161
 144603 __160:
 144604 	;
 144605 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fop = aStep[bRev]
 144606 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur
 144607 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = 1 + Xsqlite3VdbeAddOp2(tls, v, int32(aStart[bRev]), iCur, addrHalt)
 144608 
 144609 	(*WhereLevel)(unsafe.Pointer(pLevel)).Fp5 = U8(SQLITE_STMTSTATUS_FULLSCAN_STEP)
 144610 __161:
 144611 	;
 144612 __116:
 144613 	;
 144614 __53:
 144615 	;
 144616 __39:
 144617 	;
 144618 __35:
 144619 	;
 144620 __10:
 144621 	;
 144622 __8:
 144623 	;
 144624 	iLoop = func() int32 {
 144625 		if pIdx != 0 {
 144626 			return 1
 144627 		}
 144628 		return 2
 144629 	}()
 144630 __162:
 144631 	iNext = 0
 144632 	pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa
 144633 	j = (*WhereClause)(unsafe.Pointer(pWC)).FnTerm
 144634 __165:
 144635 	if !(j > 0) {
 144636 		goto __167
 144637 	}
 144638 	skipLikeAddr = 0
 144639 
 144640 	if !(int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&(TERM_VIRTUAL|TERM_CODED) != 0) {
 144641 		goto __168
 144642 	}
 144643 	goto __166
 144644 __168:
 144645 	;
 144646 	if !((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll&(*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady != uint64(0)) {
 144647 		goto __169
 144648 	}
 144649 
 144650 	libc.SetBitFieldPtr8Uint32(pWInfo+68, uint32(1), 1, 0x2)
 144651 	goto __166
 144652 __169:
 144653 	;
 144654 	pE = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
 144655 
 144656 	if !(int32((*SrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&(JT_LEFT|JT_LTORJ|JT_RIGHT) != 0) {
 144657 		goto __170
 144658 	}
 144659 	if !!((*Expr)(unsafe.Pointer(pE)).Fflags&U32(EP_OuterON|EP_InnerON) != U32(0)) {
 144660 		goto __171
 144661 	}
 144662 
 144663 	goto __166
 144664 	goto __172
 144665 __171:
 144666 	if !(int32((*SrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&JT_LEFT == JT_LEFT &&
 144667 		!((*Expr)(unsafe.Pointer(pE)).Fflags&U32(EP_OuterON) != U32(0))) {
 144668 		goto __173
 144669 	}
 144670 	goto __166
 144671 	goto __174
 144672 __173:
 144673 	m = Xsqlite3WhereGetMask(tls, pWInfo+592, *(*int32)(unsafe.Pointer(pE + 52)))
 144674 	if !(m&(*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady != 0) {
 144675 		goto __175
 144676 	}
 144677 
 144678 	goto __166
 144679 __175:
 144680 	;
 144681 __174:
 144682 	;
 144683 __172:
 144684 	;
 144685 __170:
 144686 	;
 144687 	if !(iLoop == 1 && !(Xsqlite3ExprCoveredByIndex(tls, pE, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, pIdx) != 0)) {
 144688 		goto __176
 144689 	}
 144690 	iNext = 2
 144691 	goto __166
 144692 __176:
 144693 	;
 144694 	if !(iLoop < 3 && int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_VARSELECT != 0) {
 144695 		goto __177
 144696 	}
 144697 	if !(iNext == 0) {
 144698 		goto __178
 144699 	}
 144700 	iNext = 3
 144701 __178:
 144702 	;
 144703 	goto __166
 144704 __177:
 144705 	;
 144706 	if !(int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_LIKECOND != 0) {
 144707 		goto __179
 144708 	}
 144709 
 144710 	goto __166
 144711 __179:
 144712 	;
 144713 	Xsqlite3ExprIfFalse(tls, pParse, pE, addrCont, SQLITE_JUMPIFNULL)
 144714 	if !(skipLikeAddr != 0) {
 144715 		goto __180
 144716 	}
 144717 	Xsqlite3VdbeJumpHere(tls, v, skipLikeAddr)
 144718 __180:
 144719 	;
 144720 	*(*U16)(unsafe.Pointer(pTerm + 18)) |= U16(TERM_CODED)
 144721 	goto __166
 144722 __166:
 144723 	j--
 144724 	pTerm += 56
 144725 	goto __165
 144726 	goto __167
 144727 __167:
 144728 	;
 144729 	iLoop = iNext
 144730 	goto __163
 144731 __163:
 144732 	if iLoop > 0 {
 144733 		goto __162
 144734 	}
 144735 	goto __164
 144736 __164:
 144737 	;
 144738 	pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa
 144739 	j = (*WhereClause)(unsafe.Pointer(pWC)).FnBase
 144740 __181:
 144741 	if !(j > 0) {
 144742 		goto __183
 144743 	}
 144744 	if !(int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&(TERM_VIRTUAL|TERM_CODED) != 0) {
 144745 		goto __184
 144746 	}
 144747 	goto __182
 144748 __184:
 144749 	;
 144750 	if !(int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(WO_EQ|WO_IS) == 0) {
 144751 		goto __185
 144752 	}
 144753 	goto __182
 144754 __185:
 144755 	;
 144756 	if !(int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&WO_EQUIV == 0) {
 144757 		goto __186
 144758 	}
 144759 	goto __182
 144760 __186:
 144761 	;
 144762 	if !((*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != iCur) {
 144763 		goto __187
 144764 	}
 144765 	goto __182
 144766 __187:
 144767 	;
 144768 	if !(int32((*SrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&(JT_LEFT|JT_LTORJ|JT_RIGHT) != 0) {
 144769 		goto __188
 144770 	}
 144771 	goto __182
 144772 __188:
 144773 	;
 144774 	pE1 = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
 144775 
 144776 	pAlt = Xsqlite3WhereFindTerm(tls, pWC, iCur, *(*int32)(unsafe.Pointer(pTerm + 32)), notReady,
 144777 		uint32(WO_EQ|WO_IN|WO_IS), uintptr(0))
 144778 	if !(pAlt == uintptr(0)) {
 144779 		goto __189
 144780 	}
 144781 	goto __182
 144782 __189:
 144783 	;
 144784 	if !(int32((*WhereTerm)(unsafe.Pointer(pAlt)).FwtFlags)&TERM_CODED != 0) {
 144785 		goto __190
 144786 	}
 144787 	goto __182
 144788 __190:
 144789 	;
 144790 	if !(int32((*WhereTerm)(unsafe.Pointer(pAlt)).FeOperator)&WO_IN != 0 &&
 144791 		(*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAlt)).FpExpr)).Fflags&U32(EP_xIsSelect) != U32(0) &&
 144792 		(*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAlt)).FpExpr + 32)))).FpEList)).FnExpr > 1) {
 144793 		goto __191
 144794 	}
 144795 	goto __182
 144796 __191:
 144797 	;
 144798 	*(*Expr)(unsafe.Pointer(bp + 24)) = *(*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAlt)).FpExpr))
 144799 	(*Expr)(unsafe.Pointer(bp + 24)).FpLeft = (*Expr)(unsafe.Pointer(pE1)).FpLeft
 144800 	Xsqlite3ExprIfFalse(tls, pParse, bp+24, addrCont, SQLITE_JUMPIFNULL)
 144801 	*(*U16)(unsafe.Pointer(pAlt + 18)) |= U16(TERM_CODED)
 144802 	goto __182
 144803 __182:
 144804 	j--
 144805 	pTerm += 56
 144806 	goto __181
 144807 	goto __183
 144808 __183:
 144809 	;
 144810 	if !((*WhereLevel)(unsafe.Pointer(pLevel)).FpRJ != 0) {
 144811 		goto __192
 144812 	}
 144813 	jmp11 = 0
 144814 	pRJ = (*WhereLevel)(unsafe.Pointer(pLevel)).FpRJ
 144815 
 144816 	pTab1 = (*SrcItem)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104)).FpTab
 144817 	if !((*Table)(unsafe.Pointer(pTab1)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 144818 		goto __193
 144819 	}
 144820 	r2 = Xsqlite3GetTempRange(tls, pParse, 2)
 144821 	Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab1, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, -1, r2+1)
 144822 	nPk1 = 1
 144823 	goto __194
 144824 __193:
 144825 	pPk3 = Xsqlite3PrimaryKeyIndex(tls, pTab1)
 144826 	nPk1 = int32((*Index)(unsafe.Pointer(pPk3)).FnKeyCol)
 144827 	r2 = Xsqlite3GetTempRange(tls, pParse, nPk1+1)
 144828 	iPk1 = 0
 144829 __195:
 144830 	if !(iPk1 < nPk1) {
 144831 		goto __197
 144832 	}
 144833 	iCol1 = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk3)).FaiColumn + uintptr(iPk1)*2)))
 144834 	Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab1, iCur, iCol1, r2+1+iPk1)
 144835 	goto __196
 144836 __196:
 144837 	iPk1++
 144838 	goto __195
 144839 	goto __197
 144840 __197:
 144841 	;
 144842 __194:
 144843 	;
 144844 	jmp11 = Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, (*WhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch, 0, r2+1, nPk1)
 144845 
 144846 	Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, r2+1, nPk1, r2)
 144847 	Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, (*WhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch, r2, r2+1, nPk1)
 144848 	Xsqlite3VdbeAddOp4Int(tls, v, OP_FilterAdd, (*WhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom, 0, r2+1, nPk1)
 144849 	Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT))
 144850 	Xsqlite3VdbeJumpHere(tls, v, jmp11)
 144851 	Xsqlite3ReleaseTempRange(tls, pParse, r2, nPk1+1)
 144852 __192:
 144853 	;
 144854 	if !((*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin != 0) {
 144855 		goto __198
 144856 	}
 144857 	(*WhereLevel)(unsafe.Pointer(pLevel)).FaddrFirst = Xsqlite3VdbeCurrentAddr(tls, v)
 144858 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, (*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin)
 144859 
 144860 	if !((*WhereLevel)(unsafe.Pointer(pLevel)).FpRJ == uintptr(0)) {
 144861 		goto __199
 144862 	}
 144863 	goto code_outer_join_constraints
 144864 __199:
 144865 	;
 144866 __198:
 144867 	;
 144868 	if !((*WhereLevel)(unsafe.Pointer(pLevel)).FpRJ != 0) {
 144869 		goto __200
 144870 	}
 144871 	pRJ1 = (*WhereLevel)(unsafe.Pointer(pLevel)).FpRJ
 144872 	Xsqlite3VdbeAddOp2(tls, v, OP_BeginSubrtn, 0, (*WhereRightJoin)(unsafe.Pointer(pRJ1)).FregReturn)
 144873 	(*WhereRightJoin)(unsafe.Pointer(pRJ1)).FaddrSubrtn = Xsqlite3VdbeCurrentAddr(tls, v)
 144874 
 144875 	(*Parse)(unsafe.Pointer(pParse)).FwithinRJSubrtn++
 144876 
 144877 code_outer_join_constraints:
 144878 	pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa
 144879 	j = 0
 144880 __201:
 144881 	if !(j < (*WhereClause)(unsafe.Pointer(pWC)).FnBase) {
 144882 		goto __203
 144883 	}
 144884 
 144885 	if !(int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&(TERM_VIRTUAL|TERM_CODED) != 0) {
 144886 		goto __204
 144887 	}
 144888 	goto __202
 144889 __204:
 144890 	;
 144891 	if !((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll&(*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady != uint64(0)) {
 144892 		goto __205
 144893 	}
 144894 
 144895 	goto __202
 144896 __205:
 144897 	;
 144898 	if !(int32((*SrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&JT_LTORJ != 0) {
 144899 		goto __206
 144900 	}
 144901 	goto __202
 144902 __206:
 144903 	;
 144904 	Xsqlite3ExprIfFalse(tls, pParse, (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr, addrCont, SQLITE_JUMPIFNULL)
 144905 	*(*U16)(unsafe.Pointer(pTerm + 18)) |= U16(TERM_CODED)
 144906 	goto __202
 144907 __202:
 144908 	j++
 144909 	pTerm += 56
 144910 	goto __201
 144911 	goto __203
 144912 __203:
 144913 	;
 144914 __200:
 144915 	;
 144916 	return (*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady
 144917 }
 144918 
 144919 var aStartOp = [8]U8{
 144920 	U8(0),
 144921 	U8(0),
 144922 	U8(OP_Rewind),
 144923 	U8(OP_Last),
 144924 	U8(OP_SeekGT),
 144925 	U8(OP_SeekLT),
 144926 	U8(OP_SeekGE),
 144927 	U8(OP_SeekLE),
 144928 }
 144929 var aEndOp = [4]U8{
 144930 	U8(OP_IdxGE),
 144931 	U8(OP_IdxGT),
 144932 	U8(OP_IdxLE),
 144933 	U8(OP_IdxLT),
 144934 }
 144935 var aStep = [2]U8{U8(OP_Next), U8(OP_Prev)}
 144936 var aStart = [2]U8{U8(OP_Rewind), U8(OP_Last)}
 144937 
 144938 // Generate the code for the loop that finds all non-matched terms
 144939 // for a RIGHT JOIN.
 144940 func Xsqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLevel uintptr) {
 144941 	bp := tls.Alloc(120)
 144942 	defer tls.Free(120)
 144943 
 144944 	var pParse uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse
 144945 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 144946 	var pRJ uintptr = (*WhereLevel)(unsafe.Pointer(pLevel)).FpRJ
 144947 	var pSubWhere uintptr = uintptr(0)
 144948 	var pWC uintptr = pWInfo + 104
 144949 	var pSubWInfo uintptr
 144950 	var pLoop uintptr = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop
 144951 	var pTabItem uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104
 144952 
 144953 	var mAll Bitmask = uint64(0)
 144954 	var k int32
 144955 
 144956 	Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+23217, libc.VaList(bp, (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pTabItem)).FpTab)).FzName))
 144957 
 144958 	for k = 0; k < iLevel; k++ {
 144959 		var iIdxCur int32
 144960 		mAll = mAll | (*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pWInfo+856+uintptr(k)*104)).FpWLoop)).FmaskSelf
 144961 		Xsqlite3VdbeAddOp1(tls, v, OP_NullRow, (*WhereLevel)(unsafe.Pointer(pWInfo+856+uintptr(k)*104)).FiTabCur)
 144962 		iIdxCur = (*WhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104)).FiIdxCur
 144963 		if iIdxCur != 0 {
 144964 			Xsqlite3VdbeAddOp1(tls, v, OP_NullRow, iIdxCur)
 144965 		}
 144966 	}
 144967 	if int32((*SrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&JT_LTORJ == 0 {
 144968 		mAll = mAll | (*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf
 144969 		for k = 0; k < (*WhereClause)(unsafe.Pointer(pWC)).FnTerm; k++ {
 144970 			var pTerm uintptr = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(k)*56
 144971 			if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&(TERM_VIRTUAL|TERM_SLICE) != 0 &&
 144972 				int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) != WO_ROWVAL {
 144973 				break
 144974 			}
 144975 			if (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll & ^mAll != 0 {
 144976 				continue
 144977 			}
 144978 			if (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&U32(EP_OuterON|EP_InnerON) != U32(0) {
 144979 				continue
 144980 			}
 144981 			pSubWhere = Xsqlite3ExprAnd(tls, pParse, pSubWhere,
 144982 				Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr, 0))
 144983 		}
 144984 	}
 144985 	(*SrcList)(unsafe.Pointer(bp + 8)).FnSrc = 1
 144986 	(*SrcList)(unsafe.Pointer(bp + 8)).FnAlloc = U32(1)
 144987 	libc.Xmemcpy(tls, bp+8+8, pTabItem, uint64(unsafe.Sizeof(SrcItem{})))
 144988 	(*SrcItem)(unsafe.Pointer(bp + 8 + 8)).Ffg.Fjointype = U8(0)
 144989 
 144990 	(*Parse)(unsafe.Pointer(pParse)).FwithinRJSubrtn++
 144991 	pSubWInfo = Xsqlite3WhereBegin(tls, pParse, bp+8, pSubWhere, uintptr(0), uintptr(0), uintptr(0),
 144992 		uint16(WHERE_RIGHT_JOIN), 0)
 144993 	if pSubWInfo != 0 {
 144994 		var iCur int32 = (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur
 144995 		var r int32 = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 144996 		var nPk int32
 144997 		var jmp int32
 144998 		var addrCont int32 = Xsqlite3WhereContinueLabel(tls, pSubWInfo)
 144999 		var pTab uintptr = (*SrcItem)(unsafe.Pointer(pTabItem)).FpTab
 145000 		if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) {
 145001 			Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iCur, -1, r)
 145002 			nPk = 1
 145003 		} else {
 145004 			var iPk int32
 145005 			var pPk uintptr = Xsqlite3PrimaryKeyIndex(tls, pTab)
 145006 			nPk = int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol)
 145007 			*(*int32)(unsafe.Pointer(pParse + 56)) += nPk - 1
 145008 			for iPk = 0; iPk < nPk; iPk++ {
 145009 				var iCol int32 = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(iPk)*2)))
 145010 				Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iCur, iCol, r+iPk)
 145011 			}
 145012 		}
 145013 		jmp = Xsqlite3VdbeAddOp4Int(tls, v, OP_Filter, (*WhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom, 0, r, nPk)
 145014 
 145015 		Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, (*WhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch, addrCont, r, nPk)
 145016 
 145017 		Xsqlite3VdbeJumpHere(tls, v, jmp)
 145018 		Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, (*WhereRightJoin)(unsafe.Pointer(pRJ)).FregReturn, (*WhereRightJoin)(unsafe.Pointer(pRJ)).FaddrSubrtn)
 145019 		Xsqlite3WhereEnd(tls, pSubWInfo)
 145020 	}
 145021 	Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pSubWhere)
 145022 	Xsqlite3VdbeExplainPop(tls, pParse)
 145023 
 145024 	(*Parse)(unsafe.Pointer(pParse)).FwithinRJSubrtn--
 145025 }
 145026 
 145027 func whereOrInfoDelete(tls *libc.TLS, db uintptr, p uintptr) {
 145028 	Xsqlite3WhereClauseClear(tls, p)
 145029 	Xsqlite3DbFree(tls, db, p)
 145030 }
 145031 
 145032 func whereAndInfoDelete(tls *libc.TLS, db uintptr, p uintptr) {
 145033 	Xsqlite3WhereClauseClear(tls, p)
 145034 	Xsqlite3DbFree(tls, db, p)
 145035 }
 145036 
 145037 func whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags U16) int32 {
 145038 	var pTerm uintptr
 145039 	var idx int32
 145040 
 145041 	if (*WhereClause)(unsafe.Pointer(pWC)).FnTerm >= (*WhereClause)(unsafe.Pointer(pWC)).FnSlot {
 145042 		var pOld uintptr = (*WhereClause)(unsafe.Pointer(pWC)).Fa
 145043 		var db uintptr = (*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)).Fdb
 145044 		(*WhereClause)(unsafe.Pointer(pWC)).Fa = Xsqlite3WhereMalloc(tls, (*WhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(unsafe.Sizeof(WhereTerm{}))*uint64((*WhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint64(2))
 145045 		if (*WhereClause)(unsafe.Pointer(pWC)).Fa == uintptr(0) {
 145046 			if int32(wtFlags)&TERM_DYNAMIC != 0 {
 145047 				Xsqlite3ExprDelete(tls, db, p)
 145048 			}
 145049 			(*WhereClause)(unsafe.Pointer(pWC)).Fa = pOld
 145050 			return 0
 145051 		}
 145052 		libc.Xmemcpy(tls, (*WhereClause)(unsafe.Pointer(pWC)).Fa, pOld, uint64(unsafe.Sizeof(WhereTerm{}))*uint64((*WhereClause)(unsafe.Pointer(pWC)).FnTerm))
 145053 		(*WhereClause)(unsafe.Pointer(pWC)).FnSlot = (*WhereClause)(unsafe.Pointer(pWC)).FnSlot * 2
 145054 	}
 145055 	pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(libc.AssignInt32(&idx, libc.PostIncInt32(&(*WhereClause)(unsafe.Pointer(pWC)).FnTerm, 1)))*56
 145056 	if int32(wtFlags)&TERM_VIRTUAL == 0 {
 145057 		(*WhereClause)(unsafe.Pointer(pWC)).FnBase = (*WhereClause)(unsafe.Pointer(pWC)).FnTerm
 145058 	}
 145059 	if p != 0 && (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_Unlikely) != U32(0) {
 145060 		(*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb = LogEst(int32(Xsqlite3LogEst(tls, uint64((*Expr)(unsafe.Pointer(p)).FiTable))) - 270)
 145061 	} else {
 145062 		(*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb = int16(1)
 145063 	}
 145064 	(*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr = Xsqlite3ExprSkipCollateAndLikely(tls, p)
 145065 	(*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags = wtFlags
 145066 	(*WhereTerm)(unsafe.Pointer(pTerm)).FpWC = pWC
 145067 	(*WhereTerm)(unsafe.Pointer(pTerm)).FiParent = -1
 145068 	libc.Xmemset(tls, pTerm+20, 0,
 145069 		uint64(unsafe.Sizeof(WhereTerm{}))-uint64(uintptr(0)+20))
 145070 	return idx
 145071 }
 145072 
 145073 func allowedOp(tls *libc.TLS, op int32) int32 {
 145074 	return libc.Bool32(op == TK_IN || op >= TK_EQ && op <= TK_GE || op == TK_ISNULL || op == TK_IS)
 145075 }
 145076 
 145077 func exprCommute(tls *libc.TLS, pParse uintptr, pExpr uintptr) U16 {
 145078 	if int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_VECTOR ||
 145079 		int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpRight)).Fop) == TK_VECTOR ||
 145080 		Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight) != Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) {
 145081 		*(*U32)(unsafe.Pointer(pExpr + 4)) ^= U32(EP_Commuted)
 145082 	}
 145083 	{
 145084 		var t uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpRight
 145085 		(*Expr)(unsafe.Pointer(pExpr)).FpRight = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
 145086 		(*Expr)(unsafe.Pointer(pExpr)).FpLeft = t
 145087 	}
 145088 
 145089 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) >= TK_GT {
 145090 		(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(int32((*Expr)(unsafe.Pointer(pExpr)).Fop) - TK_GT ^ 2 + TK_GT)
 145091 	}
 145092 	return U16(0)
 145093 }
 145094 
 145095 func operatorMask(tls *libc.TLS, op int32) U16 {
 145096 	var c U16
 145097 
 145098 	if op == TK_IN {
 145099 		c = U16(WO_IN)
 145100 	} else if op == TK_ISNULL {
 145101 		c = U16(WO_ISNULL)
 145102 	} else if op == TK_IS {
 145103 		c = U16(WO_IS)
 145104 	} else {
 145105 		c = U16(int32(WO_EQ) << (op - TK_EQ))
 145106 	}
 145107 
 145108 	return c
 145109 }
 145110 
 145111 func isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr, pisComplete uintptr, pnoCase uintptr) int32 {
 145112 	bp := tls.Alloc(16)
 145113 	defer tls.Free(16)
 145114 
 145115 	var z uintptr = uintptr(0)
 145116 	var pRight uintptr
 145117 	var pLeft uintptr
 145118 	var pList uintptr
 145119 	var c U8
 145120 	var cnt int32
 145121 
 145122 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 145123 	var pVal uintptr = uintptr(0)
 145124 	var op int32
 145125 	var rc int32
 145126 
 145127 	if !(Xsqlite3IsLikeFunction(tls, db, pExpr, pnoCase, bp) != 0) {
 145128 		return 0
 145129 	}
 145130 
 145131 	pList = *(*uintptr)(unsafe.Pointer(pExpr + 32))
 145132 	pLeft = (*ExprList_item)(unsafe.Pointer(pList + 8 + 1*32)).FpExpr
 145133 
 145134 	pRight = Xsqlite3ExprSkipCollate(tls, (*ExprList_item)(unsafe.Pointer(pList+8)).FpExpr)
 145135 	op = int32((*Expr)(unsafe.Pointer(pRight)).Fop)
 145136 	if op == TK_VARIABLE && (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableQPSG) == uint64(0) {
 145137 		var pReprepare uintptr = (*Parse)(unsafe.Pointer(pParse)).FpReprepare
 145138 		var iCol int32 = int32((*Expr)(unsafe.Pointer(pRight)).FiColumn)
 145139 		pVal = Xsqlite3VdbeGetBoundValue(tls, pReprepare, iCol, uint8(SQLITE_AFF_BLOB))
 145140 		if pVal != 0 && Xsqlite3_value_type(tls, pVal) == SQLITE_TEXT {
 145141 			z = Xsqlite3_value_text(tls, pVal)
 145142 		}
 145143 		Xsqlite3VdbeSetVarmask(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iCol)
 145144 
 145145 	} else if op == TK_STRING {
 145146 		z = *(*uintptr)(unsafe.Pointer(pRight + 8))
 145147 	}
 145148 	if z != 0 {
 145149 		cnt = 0
 145150 		for int32(libc.AssignUint8(&c, *(*U8)(unsafe.Pointer(z + uintptr(cnt))))) != 0 && int32(c) != int32(*(*U8)(unsafe.Pointer(bp))) && int32(c) != int32(*(*U8)(unsafe.Pointer(bp + 1))) && int32(c) != int32(*(*U8)(unsafe.Pointer(bp + 2))) {
 145151 			cnt++
 145152 			if int32(c) == int32(*(*U8)(unsafe.Pointer(bp + 3))) && int32(*(*U8)(unsafe.Pointer(z + uintptr(cnt)))) != 0 {
 145153 				cnt++
 145154 			}
 145155 		}
 145156 
 145157 		if cnt != 0 && 255 != int32(*(*U8)(unsafe.Pointer(z + uintptr(cnt-1)))) && (cnt > 1 || int32(*(*U8)(unsafe.Pointer(z))) != int32(*(*U8)(unsafe.Pointer(bp + 3)))) {
 145158 			var pPrefix uintptr
 145159 
 145160 			*(*int32)(unsafe.Pointer(pisComplete)) = libc.Bool32(int32(c) == int32(*(*U8)(unsafe.Pointer(bp))) && int32(*(*U8)(unsafe.Pointer(z + uintptr(cnt+1)))) == 0)
 145161 
 145162 			pPrefix = Xsqlite3Expr(tls, db, TK_STRING, z)
 145163 			if pPrefix != 0 {
 145164 				var iFrom int32
 145165 				var iTo int32
 145166 				var zNew uintptr
 145167 
 145168 				zNew = *(*uintptr)(unsafe.Pointer(pPrefix + 8))
 145169 				*(*int8)(unsafe.Pointer(zNew + uintptr(cnt))) = int8(0)
 145170 				for iFrom = libc.AssignInt32(&iTo, 0); iFrom < cnt; iFrom++ {
 145171 					if int32(*(*int8)(unsafe.Pointer(zNew + uintptr(iFrom)))) == int32(*(*U8)(unsafe.Pointer(bp + 3))) {
 145172 						iFrom++
 145173 					}
 145174 					*(*int8)(unsafe.Pointer(zNew + uintptr(libc.PostIncInt32(&iTo, 1)))) = *(*int8)(unsafe.Pointer(zNew + uintptr(iFrom)))
 145175 				}
 145176 				*(*int8)(unsafe.Pointer(zNew + uintptr(iTo))) = int8(0)
 145177 
 145178 				if int32((*Expr)(unsafe.Pointer(pLeft)).Fop) != TK_COLUMN ||
 145179 					int32(Xsqlite3ExprAffinity(tls, pLeft)) != SQLITE_AFF_TEXT ||
 145180 					(*Expr)(unsafe.Pointer(pLeft)).Fflags&U32(EP_WinFunc|EP_Subrtn) == U32(0) &&
 145181 						*(*uintptr)(unsafe.Pointer(pLeft + 64)) != 0 &&
 145182 						int32((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLeft + 64)))).FeTabType) == TABTYP_VTAB {
 145183 					var isNum int32
 145184 
 145185 					isNum = Xsqlite3AtoF(tls, zNew, bp+8, iTo, uint8(SQLITE_UTF8))
 145186 					if isNum <= 0 {
 145187 						if iTo == 1 && int32(*(*int8)(unsafe.Pointer(zNew))) == '-' {
 145188 							isNum = +1
 145189 						} else {
 145190 							*(*int8)(unsafe.Pointer(zNew + uintptr(iTo-1)))++
 145191 							isNum = Xsqlite3AtoF(tls, zNew, bp+8, iTo, uint8(SQLITE_UTF8))
 145192 							*(*int8)(unsafe.Pointer(zNew + uintptr(iTo-1)))--
 145193 						}
 145194 					}
 145195 					if isNum > 0 {
 145196 						Xsqlite3ExprDelete(tls, db, pPrefix)
 145197 						Xsqlite3ValueFree(tls, pVal)
 145198 						return 0
 145199 					}
 145200 				}
 145201 			}
 145202 			*(*uintptr)(unsafe.Pointer(ppPrefix)) = pPrefix
 145203 
 145204 			if op == TK_VARIABLE {
 145205 				var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 145206 				Xsqlite3VdbeSetVarmask(tls, v, int32((*Expr)(unsafe.Pointer(pRight)).FiColumn))
 145207 
 145208 				if *(*int32)(unsafe.Pointer(pisComplete)) != 0 && *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pRight + 8)) + 1)) != 0 {
 145209 					var r1 int32 = Xsqlite3GetTempReg(tls, pParse)
 145210 					Xsqlite3ExprCodeTarget(tls, pParse, pRight, r1)
 145211 					Xsqlite3VdbeChangeP3(tls, v, Xsqlite3VdbeCurrentAddr(tls, v)-1, 0)
 145212 					Xsqlite3ReleaseTempReg(tls, pParse, r1)
 145213 				}
 145214 			}
 145215 		} else {
 145216 			z = uintptr(0)
 145217 		}
 145218 	}
 145219 
 145220 	rc = libc.Bool32(z != uintptr(0))
 145221 	Xsqlite3ValueFree(tls, pVal)
 145222 	return rc
 145223 }
 145224 
 145225 func isAuxiliaryVtabOperator(tls *libc.TLS, db uintptr, pExpr uintptr, peOp2 uintptr, ppLeft uintptr, ppRight uintptr) int32 {
 145226 	bp := tls.Alloc(16)
 145227 	defer tls.Free(16)
 145228 
 145229 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION {
 145230 		var pList uintptr
 145231 		var pCol uintptr
 145232 		var i int32
 145233 
 145234 		pList = *(*uintptr)(unsafe.Pointer(pExpr + 32))
 145235 		if pList == uintptr(0) || (*ExprList)(unsafe.Pointer(pList)).FnExpr != 2 {
 145236 			return 0
 145237 		}
 145238 
 145239 		pCol = (*ExprList_item)(unsafe.Pointer(pList + 8 + 1*32)).FpExpr
 145240 
 145241 		if int32((*Expr)(unsafe.Pointer(pCol)).Fop) == TK_COLUMN && int32((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCol + 64)))).FeTabType) == TABTYP_VTAB {
 145242 			for i = 0; i < int32(uint64(unsafe.Sizeof(aOp))/uint64(unsafe.Sizeof(Op2{}))); i++ {
 145243 				if Xsqlite3StrICmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), aOp[i].FzOp) == 0 {
 145244 					*(*uint8)(unsafe.Pointer(peOp2)) = aOp[i].FeOp2
 145245 					*(*uintptr)(unsafe.Pointer(ppRight)) = (*ExprList_item)(unsafe.Pointer(pList + 8)).FpExpr
 145246 					*(*uintptr)(unsafe.Pointer(ppLeft)) = pCol
 145247 					return 1
 145248 				}
 145249 			}
 145250 		}
 145251 
 145252 		pCol = (*ExprList_item)(unsafe.Pointer(pList + 8)).FpExpr
 145253 
 145254 		if int32((*Expr)(unsafe.Pointer(pCol)).Fop) == TK_COLUMN && int32((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCol + 64)))).FeTabType) == TABTYP_VTAB {
 145255 			var pVtab uintptr
 145256 			var pMod uintptr
 145257 
 145258 			pVtab = (*VTable)(unsafe.Pointer(Xsqlite3GetVTable(tls, db, *(*uintptr)(unsafe.Pointer(pCol + 64))))).FpVtab
 145259 
 145260 			pMod = (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FpModule
 145261 			if (*Sqlite3_module)(unsafe.Pointer(pMod)).FxFindFunction != uintptr(0) {
 145262 				i = (*struct {
 145263 					f func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32
 145264 				})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer(pMod)).FxFindFunction})).f(tls, pVtab, 2, *(*uintptr)(unsafe.Pointer(pExpr + 8)), bp, bp+8)
 145265 				if i >= SQLITE_INDEX_CONSTRAINT_FUNCTION {
 145266 					*(*uint8)(unsafe.Pointer(peOp2)) = uint8(i)
 145267 					*(*uintptr)(unsafe.Pointer(ppRight)) = (*ExprList_item)(unsafe.Pointer(pList + 8 + 1*32)).FpExpr
 145268 					*(*uintptr)(unsafe.Pointer(ppLeft)) = pCol
 145269 					return 1
 145270 				}
 145271 			}
 145272 		}
 145273 	} else if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NE || int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_ISNOT || int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NOTNULL {
 145274 		var res int32 = 0
 145275 		var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
 145276 		var pRight uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpRight
 145277 
 145278 		if int32((*Expr)(unsafe.Pointer(pLeft)).Fop) == TK_COLUMN && int32((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLeft + 64)))).FeTabType) == TABTYP_VTAB {
 145279 			res++
 145280 		}
 145281 
 145282 		if pRight != 0 && (int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_COLUMN && int32((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pRight + 64)))).FeTabType) == TABTYP_VTAB) {
 145283 			res++
 145284 			{
 145285 				var t uintptr = pLeft
 145286 				pLeft = pRight
 145287 				pRight = t
 145288 			}
 145289 
 145290 		}
 145291 		*(*uintptr)(unsafe.Pointer(ppLeft)) = pLeft
 145292 		*(*uintptr)(unsafe.Pointer(ppRight)) = pRight
 145293 		if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NE {
 145294 			*(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_NE)
 145295 		}
 145296 		if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_ISNOT {
 145297 			*(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_ISNOT)
 145298 		}
 145299 		if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NOTNULL {
 145300 			*(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_ISNOTNULL)
 145301 		}
 145302 		return res
 145303 	}
 145304 	return 0
 145305 }
 145306 
 145307 type Op2 = struct {
 145308 	FzOp         uintptr
 145309 	FeOp2        uint8
 145310 	F__ccgo_pad1 [7]byte
 145311 }
 145312 
 145313 var aOp = [4]Op2{
 145314 	{FzOp: ts + 17474, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH)},
 145315 	{FzOp: ts + 16804, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB)},
 145316 	{FzOp: ts + 16324, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE)},
 145317 	{FzOp: ts + 23231, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP)},
 145318 }
 145319 
 145320 func transferJoinMarkings(tls *libc.TLS, pDerived uintptr, pBase uintptr) {
 145321 	if pDerived != 0 && (*Expr)(unsafe.Pointer(pBase)).Fflags&U32(EP_OuterON|EP_InnerON) != U32(0) {
 145322 		*(*U32)(unsafe.Pointer(pDerived + 4)) |= (*Expr)(unsafe.Pointer(pBase)).Fflags & U32(EP_OuterON|EP_InnerON)
 145323 		*(*int32)(unsafe.Pointer(pDerived + 52)) = *(*int32)(unsafe.Pointer(pBase + 52))
 145324 	}
 145325 }
 145326 
 145327 func markTermAsChild(tls *libc.TLS, pWC uintptr, iChild int32, iParent int32) {
 145328 	(*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iChild)*56)).FiParent = iParent
 145329 	(*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iChild)*56)).FtruthProb = (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iParent)*56)).FtruthProb
 145330 	(*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iParent)*56)).FnChild++
 145331 }
 145332 
 145333 func whereNthSubterm(tls *libc.TLS, pTerm uintptr, N int32) uintptr {
 145334 	if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) != WO_AND {
 145335 		if N == 0 {
 145336 			return pTerm
 145337 		}
 145338 		return uintptr(0)
 145339 	}
 145340 	if N < (*WhereAndInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTerm + 32)))).Fwc.FnTerm {
 145341 		return (*WhereAndInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTerm + 32)))).Fwc.Fa + uintptr(N)*56
 145342 	}
 145343 	return uintptr(0)
 145344 }
 145345 
 145346 func whereCombineDisjuncts(tls *libc.TLS, pSrc uintptr, pWC uintptr, pOne uintptr, pTwo uintptr) {
 145347 	var eOp U16 = U16(int32((*WhereTerm)(unsafe.Pointer(pOne)).FeOperator) | int32((*WhereTerm)(unsafe.Pointer(pTwo)).FeOperator))
 145348 	var db uintptr
 145349 	var pNew uintptr
 145350 	var op int32
 145351 	var idxNew int32
 145352 
 145353 	if (int32((*WhereTerm)(unsafe.Pointer(pOne)).FwtFlags)|int32((*WhereTerm)(unsafe.Pointer(pTwo)).FwtFlags))&TERM_VNULL != 0 {
 145354 		return
 145355 	}
 145356 	if int32((*WhereTerm)(unsafe.Pointer(pOne)).FeOperator)&(WO_EQ|int32(WO_EQ)<<(TK_LT-TK_EQ)|int32(WO_EQ)<<(TK_LE-TK_EQ)|int32(WO_EQ)<<(TK_GT-TK_EQ)|int32(WO_EQ)<<(TK_GE-TK_EQ)) == 0 {
 145357 		return
 145358 	}
 145359 	if int32((*WhereTerm)(unsafe.Pointer(pTwo)).FeOperator)&(WO_EQ|int32(WO_EQ)<<(TK_LT-TK_EQ)|int32(WO_EQ)<<(TK_LE-TK_EQ)|int32(WO_EQ)<<(TK_GT-TK_EQ)|int32(WO_EQ)<<(TK_GE-TK_EQ)) == 0 {
 145360 		return
 145361 	}
 145362 	if int32(eOp)&(WO_EQ|int32(WO_EQ)<<(TK_LT-TK_EQ)|int32(WO_EQ)<<(TK_LE-TK_EQ)) != int32(eOp) &&
 145363 		int32(eOp)&(WO_EQ|int32(WO_EQ)<<(TK_GT-TK_EQ)|int32(WO_EQ)<<(TK_GE-TK_EQ)) != int32(eOp) {
 145364 		return
 145365 	}
 145366 
 145367 	if Xsqlite3ExprCompare(tls, uintptr(0), (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pOne)).FpExpr)).FpLeft, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTwo)).FpExpr)).FpLeft, -1) != 0 {
 145368 		return
 145369 	}
 145370 	if Xsqlite3ExprCompare(tls, uintptr(0), (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pOne)).FpExpr)).FpRight, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTwo)).FpExpr)).FpRight, -1) != 0 {
 145371 		return
 145372 	}
 145373 
 145374 	if int32(eOp)&(int32(eOp)-1) != 0 {
 145375 		if int32(eOp)&(int32(WO_EQ)<<(TK_LT-TK_EQ)|int32(WO_EQ)<<(TK_LE-TK_EQ)) != 0 {
 145376 			eOp = U16(int32(WO_EQ) << (TK_LE - TK_EQ))
 145377 		} else {
 145378 			eOp = U16(int32(WO_EQ) << (TK_GE - TK_EQ))
 145379 		}
 145380 	}
 145381 	db = (*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)).Fdb
 145382 	pNew = Xsqlite3ExprDup(tls, db, (*WhereTerm)(unsafe.Pointer(pOne)).FpExpr, 0)
 145383 	if pNew == uintptr(0) {
 145384 		return
 145385 	}
 145386 	for op = TK_EQ; int32(eOp) != int32(WO_EQ)<<(op-TK_EQ); op++ {
 145387 	}
 145388 	(*Expr)(unsafe.Pointer(pNew)).Fop = U8(op)
 145389 	idxNew = whereClauseInsert(tls, pWC, pNew, uint16(TERM_VIRTUAL|TERM_DYNAMIC))
 145390 	exprAnalyze(tls, pSrc, pWC, idxNew)
 145391 }
 145392 
 145393 func exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) {
 145394 	var pWInfo uintptr = (*WhereClause)(unsafe.Pointer(pWC)).FpWInfo
 145395 	var pParse uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse
 145396 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 145397 	var pTerm uintptr = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56
 145398 	var pExpr uintptr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
 145399 	var i int32
 145400 	var pOrWc uintptr
 145401 	var pOrTerm uintptr
 145402 	var pOrInfo uintptr
 145403 	var chngToIN Bitmask
 145404 	var indexable Bitmask
 145405 
 145406 	*(*uintptr)(unsafe.Pointer(pTerm + 32)) = libc.AssignUintptr(&pOrInfo, Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(WhereOrInfo{}))))
 145407 	if pOrInfo == uintptr(0) {
 145408 		return
 145409 	}
 145410 	*(*U16)(unsafe.Pointer(pTerm + 18)) |= U16(TERM_ORINFO)
 145411 	pOrWc = pOrInfo
 145412 	libc.Xmemset(tls, pOrWc+40, 0, uint64(unsafe.Sizeof([8]WhereTerm{})))
 145413 	Xsqlite3WhereClauseInit(tls, pOrWc, pWInfo)
 145414 	Xsqlite3WhereSplit(tls, pOrWc, pExpr, uint8(TK_OR))
 145415 	Xsqlite3WhereExprAnalyze(tls, pSrc, pOrWc)
 145416 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 145417 		return
 145418 	}
 145419 
 145420 	indexable = libc.CplUint64(uint64(0))
 145421 	chngToIN = libc.CplUint64(uint64(0))
 145422 	i = (*WhereClause)(unsafe.Pointer(pOrWc)).FnTerm - 1
 145423 	pOrTerm = (*WhereClause)(unsafe.Pointer(pOrWc)).Fa
 145424 __1:
 145425 	if !(i >= 0 && indexable != 0) {
 145426 		goto __3
 145427 	}
 145428 	{
 145429 		if int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator)&WO_SINGLE == 0 {
 145430 			var pAndInfo uintptr
 145431 
 145432 			chngToIN = uint64(0)
 145433 			pAndInfo = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(WhereAndInfo{})))
 145434 			if pAndInfo != 0 {
 145435 				var pAndWC uintptr
 145436 				var pAndTerm uintptr
 145437 				var j int32
 145438 				var b Bitmask = uint64(0)
 145439 				*(*uintptr)(unsafe.Pointer(pOrTerm + 32)) = pAndInfo
 145440 				*(*U16)(unsafe.Pointer(pOrTerm + 18)) |= U16(TERM_ANDINFO)
 145441 				(*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator = U16(WO_AND)
 145442 				(*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor = -1
 145443 				pAndWC = pAndInfo
 145444 				libc.Xmemset(tls, pAndWC+40, 0, uint64(unsafe.Sizeof([8]WhereTerm{})))
 145445 				Xsqlite3WhereClauseInit(tls, pAndWC, (*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)
 145446 				Xsqlite3WhereSplit(tls, pAndWC, (*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr, uint8(TK_AND))
 145447 				Xsqlite3WhereExprAnalyze(tls, pSrc, pAndWC)
 145448 				(*WhereClause)(unsafe.Pointer(pAndWC)).FpOuter = pWC
 145449 				if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
 145450 					j = 0
 145451 					pAndTerm = (*WhereClause)(unsafe.Pointer(pAndWC)).Fa
 145452 				__4:
 145453 					if !(j < (*WhereClause)(unsafe.Pointer(pAndWC)).FnTerm) {
 145454 						goto __6
 145455 					}
 145456 					{
 145457 						if allowedOp(tls, int32((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAndTerm)).FpExpr)).Fop)) != 0 ||
 145458 							int32((*WhereTerm)(unsafe.Pointer(pAndTerm)).FeOperator) == WO_AUX {
 145459 							b = b | Xsqlite3WhereGetMask(tls, pWInfo+592, (*WhereTerm)(unsafe.Pointer(pAndTerm)).FleftCursor)
 145460 						}
 145461 
 145462 					}
 145463 					goto __5
 145464 				__5:
 145465 					j++
 145466 					pAndTerm += 56
 145467 					goto __4
 145468 					goto __6
 145469 				__6:
 145470 				}
 145471 				indexable = indexable & b
 145472 			}
 145473 		} else if int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FwtFlags)&TERM_COPIED != 0 {
 145474 		} else {
 145475 			var b Bitmask
 145476 			b = Xsqlite3WhereGetMask(tls, pWInfo+592, (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor)
 145477 			if int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FwtFlags)&TERM_VIRTUAL != 0 {
 145478 				var pOther uintptr = (*WhereClause)(unsafe.Pointer(pOrWc)).Fa + uintptr((*WhereTerm)(unsafe.Pointer(pOrTerm)).FiParent)*56
 145479 				b = b | Xsqlite3WhereGetMask(tls, pWInfo+592, (*WhereTerm)(unsafe.Pointer(pOther)).FleftCursor)
 145480 			}
 145481 			indexable = indexable & b
 145482 			if int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator)&WO_EQ == 0 {
 145483 				chngToIN = uint64(0)
 145484 			} else {
 145485 				chngToIN = chngToIN & b
 145486 			}
 145487 		}
 145488 
 145489 	}
 145490 	goto __2
 145491 __2:
 145492 	i--
 145493 	pOrTerm += 56
 145494 	goto __1
 145495 	goto __3
 145496 __3:
 145497 	;
 145498 	(*WhereOrInfo)(unsafe.Pointer(pOrInfo)).Findexable = indexable
 145499 	(*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(WO_OR)
 145500 	(*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor = -1
 145501 	if indexable != 0 {
 145502 		(*WhereClause)(unsafe.Pointer(pWC)).FhasOr = U8(1)
 145503 	}
 145504 
 145505 	if indexable != 0 && (*WhereClause)(unsafe.Pointer(pOrWc)).FnTerm == 2 {
 145506 		var iOne int32 = 0
 145507 		var pOne uintptr
 145508 		for libc.AssignUintptr(&pOne, whereNthSubterm(tls, (*WhereClause)(unsafe.Pointer(pOrWc)).Fa, libc.PostIncInt32(&iOne, 1))) != uintptr(0) {
 145509 			var iTwo int32 = 0
 145510 			var pTwo uintptr
 145511 			for libc.AssignUintptr(&pTwo, whereNthSubterm(tls, (*WhereClause)(unsafe.Pointer(pOrWc)).Fa+1*56, libc.PostIncInt32(&iTwo, 1))) != uintptr(0) {
 145512 				whereCombineDisjuncts(tls, pSrc, pWC, pOne, pTwo)
 145513 			}
 145514 		}
 145515 	}
 145516 
 145517 	if chngToIN != 0 {
 145518 		var okToChngToIN int32 = 0
 145519 		var iColumn int32 = -1
 145520 		var iCursor int32 = -1
 145521 		var j int32 = 0
 145522 
 145523 		for j = 0; j < 2 && !(okToChngToIN != 0); j++ {
 145524 			var pLeft uintptr = uintptr(0)
 145525 			pOrTerm = (*WhereClause)(unsafe.Pointer(pOrWc)).Fa
 145526 			i = (*WhereClause)(unsafe.Pointer(pOrWc)).FnTerm - 1
 145527 		__7:
 145528 			if !(i >= 0) {
 145529 				goto __9
 145530 			}
 145531 			{
 145532 				*(*U16)(unsafe.Pointer(pOrTerm + 18)) &= libc.Uint16FromInt32(libc.CplInt32(TERM_OK))
 145533 				if (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor == iCursor {
 145534 					goto __8
 145535 				}
 145536 				if chngToIN&Xsqlite3WhereGetMask(tls, pWInfo+592,
 145537 					(*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor) == uint64(0) {
 145538 					goto __8
 145539 				}
 145540 
 145541 				iColumn = *(*int32)(unsafe.Pointer(pOrTerm + 32))
 145542 				iCursor = (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor
 145543 				pLeft = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr)).FpLeft
 145544 				goto __9
 145545 
 145546 			}
 145547 			goto __8
 145548 		__8:
 145549 			i--
 145550 			pOrTerm += 56
 145551 			goto __7
 145552 			goto __9
 145553 		__9:
 145554 			;
 145555 			if i < 0 {
 145556 				break
 145557 			}
 145558 
 145559 			okToChngToIN = 1
 145560 		__10:
 145561 			if !(i >= 0 && okToChngToIN != 0) {
 145562 				goto __12
 145563 			}
 145564 			{
 145565 				if (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor != iCursor {
 145566 					*(*U16)(unsafe.Pointer(pOrTerm + 18)) &= libc.Uint16FromInt32(libc.CplInt32(TERM_OK))
 145567 				} else if *(*int32)(unsafe.Pointer(pOrTerm + 32)) != iColumn || iColumn == -2 &&
 145568 					Xsqlite3ExprCompare(tls, pParse, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr)).FpLeft, pLeft, -1) != 0 {
 145569 					okToChngToIN = 0
 145570 				} else {
 145571 					var affLeft int32
 145572 					var affRight int32
 145573 
 145574 					affRight = int32(Xsqlite3ExprAffinity(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr)).FpRight))
 145575 					affLeft = int32(Xsqlite3ExprAffinity(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr)).FpLeft))
 145576 					if affRight != 0 && affRight != affLeft {
 145577 						okToChngToIN = 0
 145578 					} else {
 145579 						*(*U16)(unsafe.Pointer(pOrTerm + 18)) |= U16(TERM_OK)
 145580 					}
 145581 				}
 145582 
 145583 			}
 145584 			goto __11
 145585 		__11:
 145586 			i--
 145587 			pOrTerm += 56
 145588 			goto __10
 145589 			goto __12
 145590 		__12:
 145591 		}
 145592 
 145593 		if okToChngToIN != 0 {
 145594 			var pDup uintptr
 145595 			var pList uintptr = uintptr(0)
 145596 			var pLeft uintptr = uintptr(0)
 145597 			var pNew uintptr
 145598 
 145599 			i = (*WhereClause)(unsafe.Pointer(pOrWc)).FnTerm - 1
 145600 			pOrTerm = (*WhereClause)(unsafe.Pointer(pOrWc)).Fa
 145601 		__13:
 145602 			if !(i >= 0) {
 145603 				goto __15
 145604 			}
 145605 			{
 145606 				if int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FwtFlags)&TERM_OK == 0 {
 145607 					goto __14
 145608 				}
 145609 
 145610 				pDup = Xsqlite3ExprDup(tls, db, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr)).FpRight, 0)
 145611 				pList = Xsqlite3ExprListAppend(tls, (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse, pList, pDup)
 145612 				pLeft = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr)).FpLeft
 145613 
 145614 			}
 145615 			goto __14
 145616 		__14:
 145617 			i--
 145618 			pOrTerm += 56
 145619 			goto __13
 145620 			goto __15
 145621 		__15:
 145622 			;
 145623 			pDup = Xsqlite3ExprDup(tls, db, pLeft, 0)
 145624 			pNew = Xsqlite3PExpr(tls, pParse, TK_IN, pDup, uintptr(0))
 145625 			if pNew != 0 {
 145626 				var idxNew int32
 145627 				transferJoinMarkings(tls, pNew, pExpr)
 145628 
 145629 				*(*uintptr)(unsafe.Pointer(pNew + 32)) = pList
 145630 				idxNew = whereClauseInsert(tls, pWC, pNew, uint16(TERM_VIRTUAL|TERM_DYNAMIC))
 145631 
 145632 				exprAnalyze(tls, pSrc, pWC, idxNew)
 145633 
 145634 				markTermAsChild(tls, pWC, idxNew, idxTerm)
 145635 			} else {
 145636 				Xsqlite3ExprListDelete(tls, db, pList)
 145637 			}
 145638 		}
 145639 	}
 145640 }
 145641 
 145642 func termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 {
 145643 	var aff1 int8
 145644 	var aff2 int8
 145645 	var pColl uintptr
 145646 	if !((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&U32(SQLITE_Transitive) == U32(0)) {
 145647 		return 0
 145648 	}
 145649 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_EQ && int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_IS {
 145650 		return 0
 145651 	}
 145652 	if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_OuterON) != U32(0) {
 145653 		return 0
 145654 	}
 145655 	aff1 = Xsqlite3ExprAffinity(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
 145656 	aff2 = Xsqlite3ExprAffinity(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
 145657 	if int32(aff1) != int32(aff2) &&
 145658 		(!(int32(aff1) >= SQLITE_AFF_NUMERIC) || !(int32(aff2) >= SQLITE_AFF_NUMERIC)) {
 145659 		return 0
 145660 	}
 145661 	pColl = Xsqlite3ExprCompareCollSeq(tls, pParse, pExpr)
 145662 	if Xsqlite3IsBinary(tls, pColl) != 0 {
 145663 		return 1
 145664 	}
 145665 	return Xsqlite3ExprCollSeqMatch(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
 145666 }
 145667 
 145668 func exprSelectUsage(tls *libc.TLS, pMaskSet uintptr, pS uintptr) Bitmask {
 145669 	var mask Bitmask = uint64(0)
 145670 	for pS != 0 {
 145671 		var pSrc uintptr = (*Select)(unsafe.Pointer(pS)).FpSrc
 145672 		mask = mask | Xsqlite3WhereExprListUsage(tls, pMaskSet, (*Select)(unsafe.Pointer(pS)).FpEList)
 145673 		mask = mask | Xsqlite3WhereExprListUsage(tls, pMaskSet, (*Select)(unsafe.Pointer(pS)).FpGroupBy)
 145674 		mask = mask | Xsqlite3WhereExprListUsage(tls, pMaskSet, (*Select)(unsafe.Pointer(pS)).FpOrderBy)
 145675 		mask = mask | Xsqlite3WhereExprUsage(tls, pMaskSet, (*Select)(unsafe.Pointer(pS)).FpWhere)
 145676 		mask = mask | Xsqlite3WhereExprUsage(tls, pMaskSet, (*Select)(unsafe.Pointer(pS)).FpHaving)
 145677 		if pSrc != uintptr(0) {
 145678 			var i int32
 145679 			for i = 0; i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc; i++ {
 145680 				mask = mask | exprSelectUsage(tls, pMaskSet, (*SrcItem)(unsafe.Pointer(pSrc+8+uintptr(i)*104)).FpSelect)
 145681 				if int32(*(*uint16)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104 + 60 + 4))&0x400>>10) == 0 {
 145682 					mask = mask | Xsqlite3WhereExprUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104 + 72)))
 145683 				}
 145684 				if uint32(int32(*(*uint16)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104 + 60 + 4))&0x4>>2)) != 0 {
 145685 					mask = mask | Xsqlite3WhereExprListUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104 + 88)))
 145686 				}
 145687 			}
 145688 		}
 145689 		pS = (*Select)(unsafe.Pointer(pS)).FpPrior
 145690 	}
 145691 	return mask
 145692 }
 145693 
 145694 func exprMightBeIndexed2(tls *libc.TLS, pFrom uintptr, aiCurCol uintptr, pExpr uintptr, j int32) int32 {
 145695 	var pIdx uintptr
 145696 	var i int32
 145697 	var iCur int32
 145698 	for __ccgo := true; __ccgo; __ccgo = libc.PreIncInt32(&j, 1) < (*SrcList)(unsafe.Pointer(pFrom)).FnSrc {
 145699 		iCur = (*SrcItem)(unsafe.Pointer(pFrom + 8 + uintptr(j)*104)).FiCursor
 145700 		for pIdx = (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pFrom + 8 + uintptr(j)*104)).FpTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
 145701 			if (*Index)(unsafe.Pointer(pIdx)).FaColExpr == uintptr(0) {
 145702 				continue
 145703 			}
 145704 			for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol); i++ {
 145705 				if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) != -2 {
 145706 					continue
 145707 				}
 145708 
 145709 				if Xsqlite3ExprCompareSkip(tls, pExpr, (*ExprList_item)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaColExpr+8+uintptr(i)*32)).FpExpr, iCur) == 0 &&
 145710 					int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_STRING {
 145711 					*(*int32)(unsafe.Pointer(aiCurCol)) = iCur
 145712 					*(*int32)(unsafe.Pointer(aiCurCol + 1*4)) = -2
 145713 					return 1
 145714 				}
 145715 			}
 145716 		}
 145717 	}
 145718 	return 0
 145719 }
 145720 
 145721 func exprMightBeIndexed(tls *libc.TLS, pFrom uintptr, aiCurCol uintptr, pExpr uintptr, op int32) int32 {
 145722 	var i int32
 145723 
 145724 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VECTOR && (op >= TK_GT && op <= TK_GE) {
 145725 		pExpr = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8)).FpExpr
 145726 	}
 145727 
 145728 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN {
 145729 		*(*int32)(unsafe.Pointer(aiCurCol)) = (*Expr)(unsafe.Pointer(pExpr)).FiTable
 145730 		*(*int32)(unsafe.Pointer(aiCurCol + 1*4)) = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)
 145731 		return 1
 145732 	}
 145733 
 145734 	for i = 0; i < (*SrcList)(unsafe.Pointer(pFrom)).FnSrc; i++ {
 145735 		var pIdx uintptr
 145736 		for pIdx = (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pFrom + 8 + uintptr(i)*104)).FpTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
 145737 			if (*Index)(unsafe.Pointer(pIdx)).FaColExpr != 0 {
 145738 				return exprMightBeIndexed2(tls, pFrom, aiCurCol, pExpr, i)
 145739 			}
 145740 		}
 145741 	}
 145742 	return 0
 145743 }
 145744 
 145745 func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) {
 145746 	bp := tls.Alloc(48)
 145747 	defer tls.Free(48)
 145748 
 145749 	var pWInfo uintptr = (*WhereClause)(unsafe.Pointer(pWC)).FpWInfo
 145750 	var pTerm uintptr
 145751 	var pMaskSet uintptr
 145752 	var pExpr uintptr
 145753 	var prereqLeft Bitmask
 145754 	var prereqAll Bitmask
 145755 	var extraRight Bitmask = uint64(0)
 145756 	*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 145757 	*(*int32)(unsafe.Pointer(bp + 16)) = 0
 145758 	*(*int32)(unsafe.Pointer(bp + 20)) = 0
 145759 	var op int32
 145760 	var pParse uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse
 145761 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 145762 	*(*uint8)(unsafe.Pointer(bp + 24)) = uint8(0)
 145763 	var nLeft int32
 145764 
 145765 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 145766 		return
 145767 	}
 145768 
 145769 	pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56
 145770 	pMaskSet = pWInfo + 592
 145771 	pExpr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
 145772 
 145773 	(*WhereMaskSet)(unsafe.Pointer(pMaskSet)).FbVarSelect = 0
 145774 	prereqLeft = Xsqlite3WhereExprUsage(tls, pMaskSet, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
 145775 	op = int32((*Expr)(unsafe.Pointer(pExpr)).Fop)
 145776 	if op == TK_IN {
 145777 		if Xsqlite3ExprCheckIN(tls, pParse, pExpr) != 0 {
 145778 			return
 145779 		}
 145780 		if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) {
 145781 			(*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight = exprSelectUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(pExpr + 32)))
 145782 		} else {
 145783 			(*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight = Xsqlite3WhereExprListUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(pExpr + 32)))
 145784 		}
 145785 		prereqAll = prereqLeft | (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight
 145786 	} else {
 145787 		(*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight = Xsqlite3WhereExprUsage(tls, pMaskSet, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
 145788 		if (*Expr)(unsafe.Pointer(pExpr)).FpLeft == uintptr(0) ||
 145789 			(*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect|EP_IfNullRow) != U32(0) ||
 145790 			*(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) {
 145791 			prereqAll = Xsqlite3WhereExprUsageNN(tls, pMaskSet, pExpr)
 145792 		} else {
 145793 			prereqAll = prereqLeft | (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight
 145794 		}
 145795 	}
 145796 	if (*WhereMaskSet)(unsafe.Pointer(pMaskSet)).FbVarSelect != 0 {
 145797 		*(*U16)(unsafe.Pointer(pTerm + 18)) |= U16(TERM_VARSELECT)
 145798 	}
 145799 
 145800 	if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_OuterON|EP_InnerON) != U32(0) {
 145801 		var x Bitmask = Xsqlite3WhereGetMask(tls, pMaskSet, *(*int32)(unsafe.Pointer(pExpr + 52)))
 145802 		if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_OuterON) != U32(0) {
 145803 			prereqAll = prereqAll | x
 145804 			extraRight = x - uint64(1)
 145805 
 145806 			if prereqAll>>1 >= x {
 145807 				Xsqlite3ErrorMsg(tls, pParse, ts+23238, 0)
 145808 				return
 145809 			}
 145810 		} else if prereqAll>>1 >= x {
 145811 			if (*SrcList)(unsafe.Pointer(pSrc)).FnSrc > 0 && int32((*SrcItem)(unsafe.Pointer(pSrc+8)).Ffg.Fjointype)&JT_LTORJ != 0 {
 145812 				Xsqlite3ErrorMsg(tls, pParse, ts+23238, 0)
 145813 				return
 145814 			}
 145815 			*(*U32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(libc.CplInt32(EP_InnerON))
 145816 		}
 145817 	}
 145818 	(*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll = prereqAll
 145819 	(*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor = -1
 145820 	(*WhereTerm)(unsafe.Pointer(pTerm)).FiParent = -1
 145821 	(*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(0)
 145822 	if allowedOp(tls, op) != 0 {
 145823 		var pLeft uintptr = Xsqlite3ExprSkipCollate(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
 145824 		var pRight uintptr = Xsqlite3ExprSkipCollate(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
 145825 		var opMask U16
 145826 		if (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight&prereqLeft == uint64(0) {
 145827 			opMask = uint16(WO_ALL)
 145828 		} else {
 145829 			opMask = uint16(WO_EQUIV)
 145830 		}
 145831 
 145832 		if *(*int32)(unsafe.Pointer(pTerm + 32 + 4)) > 0 {
 145833 			pLeft = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLeft + 32)) + 8 + uintptr(*(*int32)(unsafe.Pointer(pTerm + 32 + 4))-1)*32)).FpExpr
 145834 		}
 145835 
 145836 		if exprMightBeIndexed(tls, pSrc, bp, pLeft, op) != 0 {
 145837 			(*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor = *(*int32)(unsafe.Pointer(bp))
 145838 
 145839 			*(*int32)(unsafe.Pointer(pTerm + 32)) = *(*int32)(unsafe.Pointer(bp + 1*4))
 145840 			(*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(int32(operatorMask(tls, op)) & int32(opMask))
 145841 		}
 145842 		if op == TK_IS {
 145843 			*(*U16)(unsafe.Pointer(pTerm + 18)) |= U16(TERM_IS)
 145844 		}
 145845 		if pRight != 0 &&
 145846 			exprMightBeIndexed(tls, pSrc, bp, pRight, op) != 0 &&
 145847 			!((*Expr)(unsafe.Pointer(pRight)).Fflags&U32(EP_FixedCol) != U32(0)) {
 145848 			var pNew uintptr
 145849 			var pDup uintptr
 145850 			var eExtraOp U16 = U16(0)
 145851 
 145852 			if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor >= 0 {
 145853 				var idxNew int32
 145854 				pDup = Xsqlite3ExprDup(tls, db, pExpr, 0)
 145855 				if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 145856 					Xsqlite3ExprDelete(tls, db, pDup)
 145857 					return
 145858 				}
 145859 				idxNew = whereClauseInsert(tls, pWC, pDup, uint16(TERM_VIRTUAL|TERM_DYNAMIC))
 145860 				if idxNew == 0 {
 145861 					return
 145862 				}
 145863 				pNew = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*56
 145864 				markTermAsChild(tls, pWC, idxNew, idxTerm)
 145865 				if op == TK_IS {
 145866 					*(*U16)(unsafe.Pointer(pNew + 18)) |= U16(TERM_IS)
 145867 				}
 145868 				pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56
 145869 				*(*U16)(unsafe.Pointer(pTerm + 18)) |= U16(TERM_COPIED)
 145870 
 145871 				if termIsEquivalence(tls, pParse, pDup) != 0 {
 145872 					*(*U16)(unsafe.Pointer(pTerm + 20)) |= U16(WO_EQUIV)
 145873 					eExtraOp = U16(WO_EQUIV)
 145874 				}
 145875 			} else {
 145876 				pDup = pExpr
 145877 				pNew = pTerm
 145878 			}
 145879 			*(*U16)(unsafe.Pointer(pNew + 18)) |= U16(int32(exprCommute(tls, pParse, pDup)))
 145880 			(*WhereTerm)(unsafe.Pointer(pNew)).FleftCursor = *(*int32)(unsafe.Pointer(bp))
 145881 
 145882 			*(*int32)(unsafe.Pointer(pNew + 32)) = *(*int32)(unsafe.Pointer(bp + 1*4))
 145883 
 145884 			(*WhereTerm)(unsafe.Pointer(pNew)).FprereqRight = prereqLeft | extraRight
 145885 			(*WhereTerm)(unsafe.Pointer(pNew)).FprereqAll = prereqAll
 145886 			(*WhereTerm)(unsafe.Pointer(pNew)).FeOperator = U16((int32(operatorMask(tls, int32((*Expr)(unsafe.Pointer(pDup)).Fop))) + int32(eExtraOp)) & int32(opMask))
 145887 		} else if op == TK_ISNULL &&
 145888 			!((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_OuterON) != U32(0)) &&
 145889 			0 == Xsqlite3ExprCanBeNull(tls, pLeft) {
 145890 			(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_TRUEFALSE)
 145891 			*(*uintptr)(unsafe.Pointer(pExpr + 8)) = ts + 9051
 145892 			*(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_IsFalse)
 145893 			(*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll = uint64(0)
 145894 			(*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(0)
 145895 		}
 145896 	} else if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_BETWEEN && int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND {
 145897 		var pList uintptr
 145898 		var i int32
 145899 
 145900 		pList = *(*uintptr)(unsafe.Pointer(pExpr + 32))
 145901 
 145902 		for i = 0; i < 2; i++ {
 145903 			var pNewExpr uintptr
 145904 			var idxNew int32
 145905 			pNewExpr = Xsqlite3PExpr(tls, pParse, int32(ops[i]),
 145906 				Xsqlite3ExprDup(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, 0),
 145907 				Xsqlite3ExprDup(tls, db, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*32)).FpExpr, 0))
 145908 			transferJoinMarkings(tls, pNewExpr, pExpr)
 145909 			idxNew = whereClauseInsert(tls, pWC, pNewExpr, uint16(TERM_VIRTUAL|TERM_DYNAMIC))
 145910 
 145911 			exprAnalyze(tls, pSrc, pWC, idxNew)
 145912 			pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56
 145913 			markTermAsChild(tls, pWC, idxNew, idxTerm)
 145914 		}
 145915 	} else if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_OR {
 145916 		exprAnalyzeOrTerm(tls, pSrc, pWC, idxTerm)
 145917 		pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56
 145918 	} else if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NOTNULL {
 145919 		if int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_COLUMN &&
 145920 			int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).FiColumn) >= 0 &&
 145921 			!((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_OuterON) != U32(0)) {
 145922 			var pNewExpr uintptr
 145923 			var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
 145924 			var idxNew int32
 145925 			var pNewTerm uintptr
 145926 
 145927 			pNewExpr = Xsqlite3PExpr(tls, pParse, TK_GT,
 145928 				Xsqlite3ExprDup(tls, db, pLeft, 0),
 145929 				Xsqlite3ExprAlloc(tls, db, TK_NULL, uintptr(0), 0))
 145930 
 145931 			idxNew = whereClauseInsert(tls, pWC, pNewExpr,
 145932 				uint16(TERM_VIRTUAL|TERM_DYNAMIC|TERM_VNULL))
 145933 			if idxNew != 0 {
 145934 				pNewTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*56
 145935 				(*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqRight = uint64(0)
 145936 				(*WhereTerm)(unsafe.Pointer(pNewTerm)).FleftCursor = (*Expr)(unsafe.Pointer(pLeft)).FiTable
 145937 				*(*int32)(unsafe.Pointer(pNewTerm + 32)) = int32((*Expr)(unsafe.Pointer(pLeft)).FiColumn)
 145938 				(*WhereTerm)(unsafe.Pointer(pNewTerm)).FeOperator = U16(int32(WO_EQ) << (TK_GT - TK_EQ))
 145939 				markTermAsChild(tls, pWC, idxNew, idxTerm)
 145940 				pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56
 145941 				*(*U16)(unsafe.Pointer(pTerm + 18)) |= U16(TERM_COPIED)
 145942 				(*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqAll = (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll
 145943 			}
 145944 		}
 145945 	} else if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION &&
 145946 		int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND &&
 145947 		isLikeOrGlob(tls, pParse, pExpr, bp+8, bp+16, bp+20) != 0 {
 145948 		var pLeft uintptr
 145949 		var pStr2 uintptr
 145950 		var pNewExpr1 uintptr
 145951 		var pNewExpr2 uintptr
 145952 		var idxNew1 int32
 145953 		var idxNew2 int32
 145954 		var zCollSeqName uintptr
 145955 		var wtFlags U16 = U16(TERM_LIKEOPT | TERM_VIRTUAL | TERM_DYNAMIC)
 145956 
 145957 		pLeft = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8 + 1*32)).FpExpr
 145958 		pStr2 = Xsqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)), 0)
 145959 
 145960 		if *(*int32)(unsafe.Pointer(bp + 20)) != 0 && !(int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed) != 0) {
 145961 			var i int32
 145962 			var c int8
 145963 			*(*U16)(unsafe.Pointer(pTerm + 18)) |= U16(TERM_LIKE)
 145964 			for i = 0; int32(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8)) + uintptr(i))))) != 0; i++ {
 145965 				*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8)) + uintptr(i))) = int8(int32(c) & ^(int32(Xsqlite3CtypeMap[uint8(c)]) & 0x20))
 145966 				*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pStr2 + 8)) + uintptr(i))) = int8(Xsqlite3UpperToLower[uint8(c)])
 145967 			}
 145968 		}
 145969 
 145970 		if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
 145971 			var c U8
 145972 			var pC uintptr
 145973 			pC = *(*uintptr)(unsafe.Pointer(pStr2 + 8)) + uintptr(Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(pStr2 + 8)))-1)
 145974 			c = *(*U8)(unsafe.Pointer(pC))
 145975 			if *(*int32)(unsafe.Pointer(bp + 20)) != 0 {
 145976 				if int32(c) == 'A'-1 {
 145977 					*(*int32)(unsafe.Pointer(bp + 16)) = 0
 145978 				}
 145979 				c = Xsqlite3UpperToLower[c]
 145980 			}
 145981 			*(*U8)(unsafe.Pointer(pC)) = U8(int32(c) + 1)
 145982 		}
 145983 		zCollSeqName = func() uintptr {
 145984 			if *(*int32)(unsafe.Pointer(bp + 20)) != 0 {
 145985 				return ts + 23279
 145986 			}
 145987 			return uintptr(unsafe.Pointer(&Xsqlite3StrBINARY))
 145988 		}()
 145989 		pNewExpr1 = Xsqlite3ExprDup(tls, db, pLeft, 0)
 145990 		pNewExpr1 = Xsqlite3PExpr(tls, pParse, TK_GE,
 145991 			Xsqlite3ExprAddCollateString(tls, pParse, pNewExpr1, zCollSeqName),
 145992 			*(*uintptr)(unsafe.Pointer(bp + 8)))
 145993 		transferJoinMarkings(tls, pNewExpr1, pExpr)
 145994 		idxNew1 = whereClauseInsert(tls, pWC, pNewExpr1, wtFlags)
 145995 
 145996 		pNewExpr2 = Xsqlite3ExprDup(tls, db, pLeft, 0)
 145997 		pNewExpr2 = Xsqlite3PExpr(tls, pParse, TK_LT,
 145998 			Xsqlite3ExprAddCollateString(tls, pParse, pNewExpr2, zCollSeqName),
 145999 			pStr2)
 146000 		transferJoinMarkings(tls, pNewExpr2, pExpr)
 146001 		idxNew2 = whereClauseInsert(tls, pWC, pNewExpr2, wtFlags)
 146002 
 146003 		exprAnalyze(tls, pSrc, pWC, idxNew1)
 146004 		exprAnalyze(tls, pSrc, pWC, idxNew2)
 146005 		pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56
 146006 		if *(*int32)(unsafe.Pointer(bp + 16)) != 0 {
 146007 			markTermAsChild(tls, pWC, idxNew1, idxTerm)
 146008 			markTermAsChild(tls, pWC, idxNew2, idxTerm)
 146009 		}
 146010 	}
 146011 
 146012 	if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_EQ || int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IS) &&
 146013 		libc.AssignInt32(&nLeft, Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)) > 1 &&
 146014 		Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight) == nLeft &&
 146015 		((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fflags&U32(EP_xIsSelect) == U32(0) ||
 146016 			(*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpRight)).Fflags&U32(EP_xIsSelect) == U32(0)) &&
 146017 		int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND {
 146018 		var i int32
 146019 		for i = 0; i < nLeft; i++ {
 146020 			var idxNew int32
 146021 			var pNew uintptr
 146022 			var pLeft uintptr = Xsqlite3ExprForVectorField(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, i, nLeft)
 146023 			var pRight uintptr = Xsqlite3ExprForVectorField(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, i, nLeft)
 146024 
 146025 			pNew = Xsqlite3PExpr(tls, pParse, int32((*Expr)(unsafe.Pointer(pExpr)).Fop), pLeft, pRight)
 146026 			transferJoinMarkings(tls, pNew, pExpr)
 146027 			idxNew = whereClauseInsert(tls, pWC, pNew, uint16(TERM_DYNAMIC|TERM_SLICE))
 146028 			exprAnalyze(tls, pSrc, pWC, idxNew)
 146029 		}
 146030 		pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56
 146031 		*(*U16)(unsafe.Pointer(pTerm + 18)) |= U16(TERM_CODED | TERM_VIRTUAL)
 146032 		(*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(WO_ROWVAL)
 146033 	} else if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IN &&
 146034 		*(*int32)(unsafe.Pointer(pTerm + 32 + 4)) == 0 &&
 146035 		int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_VECTOR &&
 146036 		(*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) &&
 146037 		((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FpPrior == uintptr(0) || (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FselFlags&U32(SF_Values) != 0) &&
 146038 		(*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FpWin == uintptr(0) &&
 146039 		int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND {
 146040 		var i int32
 146041 		for i = 0; i < Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft); i++ {
 146042 			var idxNew int32
 146043 			idxNew = whereClauseInsert(tls, pWC, pExpr, uint16(TERM_VIRTUAL|TERM_SLICE))
 146044 			*(*int32)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*56 + 32 + 4)) = i + 1
 146045 			exprAnalyze(tls, pSrc, pWC, idxNew)
 146046 			markTermAsChild(tls, pWC, idxNew, idxTerm)
 146047 		}
 146048 	} else if int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND {
 146049 		*(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0)
 146050 		*(*uintptr)(unsafe.Pointer(bp + 32)) = uintptr(0)
 146051 		var res int32 = isAuxiliaryVtabOperator(tls, db, pExpr, bp+24, bp+32, bp+40)
 146052 		for libc.PostDecInt32(&res, 1) > 0 {
 146053 			var idxNew int32
 146054 			var pNewTerm uintptr
 146055 			var prereqColumn Bitmask
 146056 			var prereqExpr Bitmask
 146057 
 146058 			prereqExpr = Xsqlite3WhereExprUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(bp + 40)))
 146059 			prereqColumn = Xsqlite3WhereExprUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(bp + 32)))
 146060 			if prereqExpr&prereqColumn == uint64(0) {
 146061 				var pNewExpr uintptr
 146062 				pNewExpr = Xsqlite3PExpr(tls, pParse, TK_MATCH,
 146063 					uintptr(0), Xsqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(bp + 40)), 0))
 146064 				if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_OuterON) != U32(0) && pNewExpr != 0 {
 146065 					*(*U32)(unsafe.Pointer(pNewExpr + 4)) |= U32(EP_OuterON)
 146066 					*(*int32)(unsafe.Pointer(pNewExpr + 52)) = *(*int32)(unsafe.Pointer(pExpr + 52))
 146067 				}
 146068 				idxNew = whereClauseInsert(tls, pWC, pNewExpr, uint16(TERM_VIRTUAL|TERM_DYNAMIC))
 146069 
 146070 				pNewTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*56
 146071 				(*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqRight = prereqExpr
 146072 				(*WhereTerm)(unsafe.Pointer(pNewTerm)).FleftCursor = (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)))).FiTable
 146073 				*(*int32)(unsafe.Pointer(pNewTerm + 32)) = int32((*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)))).FiColumn)
 146074 				(*WhereTerm)(unsafe.Pointer(pNewTerm)).FeOperator = U16(WO_AUX)
 146075 				(*WhereTerm)(unsafe.Pointer(pNewTerm)).FeMatchOp = *(*uint8)(unsafe.Pointer(bp + 24))
 146076 				markTermAsChild(tls, pWC, idxNew, idxTerm)
 146077 				pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56
 146078 				*(*U16)(unsafe.Pointer(pTerm + 18)) |= U16(TERM_COPIED)
 146079 				(*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqAll = (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll
 146080 			}
 146081 			{
 146082 				var t uintptr = *(*uintptr)(unsafe.Pointer(bp + 32))
 146083 				*(*uintptr)(unsafe.Pointer(bp + 32)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 146084 				*(*uintptr)(unsafe.Pointer(bp + 40)) = t
 146085 			}
 146086 
 146087 		}
 146088 	}
 146089 
 146090 	pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56
 146091 	*(*Bitmask)(unsafe.Pointer(pTerm + 40)) |= extraRight
 146092 }
 146093 
 146094 var ops = [2]U8{U8(TK_GE), U8(TK_LE)}
 146095 
 146096 // This routine identifies subexpressions in the WHERE clause where
 146097 // each subexpression is separated by the AND operator or some other
 146098 // operator specified in the op parameter.  The WhereClause structure
 146099 // is filled with pointers to subexpressions.  For example:
 146100 //
 146101 //	WHERE  a=='hello' AND coalesce(b,11)<10 AND (c+12!=d OR c==22)
 146102 //	       \________/     \_______________/     \________________/
 146103 //	        slot[0]            slot[1]               slot[2]
 146104 //
 146105 // The original WHERE clause in pExpr is unaltered.  All this routine
 146106 // does is make slot[] entries point to substructure within pExpr.
 146107 //
 146108 // In the previous sentence and in the diagram, "slot[]" refers to
 146109 // the WhereClause.a[] array.  The slot[] array grows as needed to contain
 146110 // all terms of the WHERE clause.
 146111 func Xsqlite3WhereSplit(tls *libc.TLS, pWC uintptr, pExpr uintptr, op U8) {
 146112 	var pE2 uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, pExpr)
 146113 	(*WhereClause)(unsafe.Pointer(pWC)).Fop = op
 146114 
 146115 	if pE2 == uintptr(0) {
 146116 		return
 146117 	}
 146118 	if int32((*Expr)(unsafe.Pointer(pE2)).Fop) != int32(op) {
 146119 		whereClauseInsert(tls, pWC, pExpr, uint16(0))
 146120 	} else {
 146121 		Xsqlite3WhereSplit(tls, pWC, (*Expr)(unsafe.Pointer(pE2)).FpLeft, op)
 146122 		Xsqlite3WhereSplit(tls, pWC, (*Expr)(unsafe.Pointer(pE2)).FpRight, op)
 146123 	}
 146124 }
 146125 
 146126 func whereAddLimitExpr(tls *libc.TLS, pWC uintptr, iReg int32, pExpr uintptr, iCsr int32, eMatchOp int32) {
 146127 	bp := tls.Alloc(4)
 146128 	defer tls.Free(4)
 146129 
 146130 	var pParse uintptr = (*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse
 146131 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 146132 	var pNew uintptr
 146133 	*(*int32)(unsafe.Pointer(bp)) = 0
 146134 
 146135 	if Xsqlite3ExprIsInteger(tls, pExpr, bp) != 0 && *(*int32)(unsafe.Pointer(bp)) >= 0 {
 146136 		var pVal uintptr = Xsqlite3Expr(tls, db, TK_INTEGER, uintptr(0))
 146137 		if pVal == uintptr(0) {
 146138 			return
 146139 		}
 146140 		*(*U32)(unsafe.Pointer(pVal + 4)) |= U32(EP_IntValue)
 146141 		*(*int32)(unsafe.Pointer(pVal + 8)) = *(*int32)(unsafe.Pointer(bp))
 146142 		pNew = Xsqlite3PExpr(tls, pParse, TK_MATCH, uintptr(0), pVal)
 146143 	} else {
 146144 		var pVal uintptr = Xsqlite3Expr(tls, db, TK_REGISTER, uintptr(0))
 146145 		if pVal == uintptr(0) {
 146146 			return
 146147 		}
 146148 		(*Expr)(unsafe.Pointer(pVal)).FiTable = iReg
 146149 		pNew = Xsqlite3PExpr(tls, pParse, TK_MATCH, uintptr(0), pVal)
 146150 	}
 146151 	if pNew != 0 {
 146152 		var pTerm uintptr
 146153 		var idx int32
 146154 		idx = whereClauseInsert(tls, pWC, pNew, uint16(TERM_DYNAMIC|TERM_VIRTUAL))
 146155 		pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idx)*56
 146156 		(*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor = iCsr
 146157 		(*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(WO_AUX)
 146158 		(*WhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp = U8(eMatchOp)
 146159 	}
 146160 }
 146161 
 146162 // Possibly add terms corresponding to the LIMIT and OFFSET clauses of the
 146163 // SELECT statement passed as the second argument. These terms are only
 146164 // added if:
 146165 //
 146166 //  1. The SELECT statement has a LIMIT clause, and
 146167 //  2. The SELECT statement is not an aggregate or DISTINCT query, and
 146168 //  3. The SELECT statement has exactly one object in its from clause, and
 146169 //     that object is a virtual table, and
 146170 //  4. There are no terms in the WHERE clause that will not be passed
 146171 //     to the virtual table xBestIndex method.
 146172 //  5. The ORDER BY clause, if any, will be made available to the xBestIndex
 146173 //     method.
 146174 //
 146175 // LIMIT and OFFSET terms are ignored by most of the planner code. They
 146176 // exist only so that they may be passed to the xBestIndex method of the
 146177 // single virtual table in the FROM clause of the SELECT.
 146178 func Xsqlite3WhereAddLimit(tls *libc.TLS, pWC uintptr, p uintptr) {
 146179 	if (*Select)(unsafe.Pointer(p)).FpGroupBy == uintptr(0) &&
 146180 		(*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Distinct|SF_Aggregate) == U32(0) &&
 146181 		((*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc)).FnSrc == 1 && int32((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc+8)).FpTab)).FeTabType) == TABTYP_VTAB) {
 146182 		var pOrderBy uintptr = (*Select)(unsafe.Pointer(p)).FpOrderBy
 146183 		var iCsr int32 = (*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc + 8)).FiCursor
 146184 		var ii int32
 146185 
 146186 		for ii = 0; ii < (*WhereClause)(unsafe.Pointer(pWC)).FnTerm; ii++ {
 146187 			if int32((*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(ii)*56)).FwtFlags)&TERM_CODED != 0 {
 146188 				continue
 146189 			}
 146190 			if (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(ii)*56)).FnChild != 0 {
 146191 				continue
 146192 			}
 146193 			if (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(ii)*56)).FleftCursor != iCsr {
 146194 				return
 146195 			}
 146196 		}
 146197 
 146198 		if pOrderBy != 0 {
 146199 			for ii = 0; ii < (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr; ii++ {
 146200 				var pExpr uintptr = (*ExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(ii)*32)).FpExpr
 146201 				if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLUMN {
 146202 					return
 146203 				}
 146204 				if (*Expr)(unsafe.Pointer(pExpr)).FiTable != iCsr {
 146205 					return
 146206 				}
 146207 				if int32((*ExprList_item)(unsafe.Pointer(pOrderBy+8+uintptr(ii)*32)).Ffg.FsortFlags)&KEYINFO_ORDER_BIGNULL != 0 {
 146208 					return
 146209 				}
 146210 			}
 146211 		}
 146212 
 146213 		whereAddLimitExpr(tls, pWC, (*Select)(unsafe.Pointer(p)).FiLimit, (*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpLimit)).FpLeft,
 146214 			iCsr, SQLITE_INDEX_CONSTRAINT_LIMIT)
 146215 		if (*Select)(unsafe.Pointer(p)).FiOffset > 0 {
 146216 			whereAddLimitExpr(tls, pWC, (*Select)(unsafe.Pointer(p)).FiOffset, (*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpLimit)).FpRight,
 146217 				iCsr, SQLITE_INDEX_CONSTRAINT_OFFSET)
 146218 		}
 146219 	}
 146220 }
 146221 
 146222 // Initialize a preallocated WhereClause structure.
 146223 func Xsqlite3WhereClauseInit(tls *libc.TLS, pWC uintptr, pWInfo uintptr) {
 146224 	(*WhereClause)(unsafe.Pointer(pWC)).FpWInfo = pWInfo
 146225 	(*WhereClause)(unsafe.Pointer(pWC)).FhasOr = U8(0)
 146226 	(*WhereClause)(unsafe.Pointer(pWC)).FpOuter = uintptr(0)
 146227 	(*WhereClause)(unsafe.Pointer(pWC)).FnTerm = 0
 146228 	(*WhereClause)(unsafe.Pointer(pWC)).FnBase = 0
 146229 	(*WhereClause)(unsafe.Pointer(pWC)).FnSlot = int32(uint64(unsafe.Sizeof([8]WhereTerm{})) / uint64(unsafe.Sizeof(WhereTerm{})))
 146230 	(*WhereClause)(unsafe.Pointer(pWC)).Fa = pWC + 40
 146231 }
 146232 
 146233 // Deallocate a WhereClause structure.  The WhereClause structure
 146234 // itself is not freed.  This routine is the inverse of
 146235 // sqlite3WhereClauseInit().
 146236 func Xsqlite3WhereClauseClear(tls *libc.TLS, pWC uintptr) {
 146237 	var db uintptr = (*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)).Fdb
 146238 
 146239 	if (*WhereClause)(unsafe.Pointer(pWC)).FnTerm > 0 {
 146240 		var a uintptr = (*WhereClause)(unsafe.Pointer(pWC)).Fa
 146241 		var aLast uintptr = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pWC)).FnTerm-1)*56
 146242 		for 1 != 0 {
 146243 			if int32((*WhereTerm)(unsafe.Pointer(a)).FwtFlags)&TERM_DYNAMIC != 0 {
 146244 				Xsqlite3ExprDelete(tls, db, (*WhereTerm)(unsafe.Pointer(a)).FpExpr)
 146245 			}
 146246 			if int32((*WhereTerm)(unsafe.Pointer(a)).FwtFlags)&(TERM_ORINFO|TERM_ANDINFO) != 0 {
 146247 				if int32((*WhereTerm)(unsafe.Pointer(a)).FwtFlags)&TERM_ORINFO != 0 {
 146248 					whereOrInfoDelete(tls, db, *(*uintptr)(unsafe.Pointer(a + 32)))
 146249 				} else {
 146250 					whereAndInfoDelete(tls, db, *(*uintptr)(unsafe.Pointer(a + 32)))
 146251 				}
 146252 			}
 146253 			if a == aLast {
 146254 				break
 146255 			}
 146256 			a += 56
 146257 		}
 146258 	}
 146259 }
 146260 
 146261 func sqlite3WhereExprUsageFull(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmask {
 146262 	var mask Bitmask
 146263 	if int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_IF_NULL_ROW {
 146264 		mask = Xsqlite3WhereGetMask(tls, pMaskSet, (*Expr)(unsafe.Pointer(p)).FiTable)
 146265 	} else {
 146266 		mask = uint64(0)
 146267 	}
 146268 	if (*Expr)(unsafe.Pointer(p)).FpLeft != 0 {
 146269 		mask = mask | Xsqlite3WhereExprUsageNN(tls, pMaskSet, (*Expr)(unsafe.Pointer(p)).FpLeft)
 146270 	}
 146271 	if (*Expr)(unsafe.Pointer(p)).FpRight != 0 {
 146272 		mask = mask | Xsqlite3WhereExprUsageNN(tls, pMaskSet, (*Expr)(unsafe.Pointer(p)).FpRight)
 146273 
 146274 	} else if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_xIsSelect) != U32(0) {
 146275 		if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_VarSelect) != U32(0) {
 146276 			(*WhereMaskSet)(unsafe.Pointer(pMaskSet)).FbVarSelect = 1
 146277 		}
 146278 		mask = mask | exprSelectUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(p + 32)))
 146279 	} else if *(*uintptr)(unsafe.Pointer(p + 32)) != 0 {
 146280 		mask = mask | Xsqlite3WhereExprListUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(p + 32)))
 146281 	}
 146282 	if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_FUNCTION || int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_AGG_FUNCTION) && (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_WinFunc) != U32(0) {
 146283 		mask = mask | Xsqlite3WhereExprListUsage(tls, pMaskSet, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 64)))).FpPartition)
 146284 		mask = mask | Xsqlite3WhereExprListUsage(tls, pMaskSet, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 64)))).FpOrderBy)
 146285 		mask = mask | Xsqlite3WhereExprUsage(tls, pMaskSet, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 64)))).FpFilter)
 146286 	}
 146287 	return mask
 146288 }
 146289 
 146290 func Xsqlite3WhereExprUsageNN(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmask {
 146291 	if int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN && !((*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_FixedCol) != U32(0)) {
 146292 		return Xsqlite3WhereGetMask(tls, pMaskSet, (*Expr)(unsafe.Pointer(p)).FiTable)
 146293 	} else if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_TokenOnly|EP_Leaf) != U32(0) {
 146294 		return uint64(0)
 146295 	}
 146296 	return sqlite3WhereExprUsageFull(tls, pMaskSet, p)
 146297 }
 146298 
 146299 func Xsqlite3WhereExprUsage(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmask {
 146300 	if p != 0 {
 146301 		return Xsqlite3WhereExprUsageNN(tls, pMaskSet, p)
 146302 	}
 146303 	return uint64(0)
 146304 }
 146305 
 146306 func Xsqlite3WhereExprListUsage(tls *libc.TLS, pMaskSet uintptr, pList uintptr) Bitmask {
 146307 	var i int32
 146308 	var mask Bitmask = uint64(0)
 146309 	if pList != 0 {
 146310 		for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ {
 146311 			mask = mask | Xsqlite3WhereExprUsage(tls, pMaskSet, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*32)).FpExpr)
 146312 		}
 146313 	}
 146314 	return mask
 146315 }
 146316 
 146317 // Call exprAnalyze on all terms in a WHERE clause.
 146318 //
 146319 // Note that exprAnalyze() might add new virtual terms onto the
 146320 // end of the WHERE clause.  We do not want to analyze these new
 146321 // virtual terms, so start analyzing at the end and work forward
 146322 // so that the added virtual terms are never processed.
 146323 func Xsqlite3WhereExprAnalyze(tls *libc.TLS, pTabList uintptr, pWC uintptr) {
 146324 	var i int32
 146325 	for i = (*WhereClause)(unsafe.Pointer(pWC)).FnTerm - 1; i >= 0; i-- {
 146326 		exprAnalyze(tls, pTabList, pWC, i)
 146327 	}
 146328 }
 146329 
 146330 // For table-valued-functions, transform the function arguments into
 146331 // new WHERE clause terms.
 146332 //
 146333 // Each function argument translates into an equality constraint against
 146334 // a HIDDEN column in the table.
 146335 func Xsqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC uintptr) {
 146336 	bp := tls.Alloc(16)
 146337 	defer tls.Free(16)
 146338 
 146339 	var pTab uintptr
 146340 	var j int32
 146341 	var k int32
 146342 	var pArgs uintptr
 146343 	var pColRef uintptr
 146344 	var pTerm uintptr
 146345 	if int32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x4>>2) == 0 {
 146346 		return
 146347 	}
 146348 	pTab = (*SrcItem)(unsafe.Pointer(pItem)).FpTab
 146349 
 146350 	pArgs = *(*uintptr)(unsafe.Pointer(pItem + 88))
 146351 	if pArgs == uintptr(0) {
 146352 		return
 146353 	}
 146354 	for j = libc.AssignInt32(&k, 0); j < (*ExprList)(unsafe.Pointer(pArgs)).FnExpr; j++ {
 146355 		var pRhs uintptr
 146356 		var joinType U32
 146357 		for k < int32((*Table)(unsafe.Pointer(pTab)).FnCol) && int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(k)*24)).FcolFlags)&COLFLAG_HIDDEN == 0 {
 146358 			k++
 146359 		}
 146360 		if k >= int32((*Table)(unsafe.Pointer(pTab)).FnCol) {
 146361 			Xsqlite3ErrorMsg(tls, pParse, ts+23286,
 146362 				libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, j))
 146363 			return
 146364 		}
 146365 		pColRef = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_COLUMN, uintptr(0), 0)
 146366 		if pColRef == uintptr(0) {
 146367 			return
 146368 		}
 146369 		(*Expr)(unsafe.Pointer(pColRef)).FiTable = (*SrcItem)(unsafe.Pointer(pItem)).FiCursor
 146370 		(*Expr)(unsafe.Pointer(pColRef)).FiColumn = YnVar(libc.PostIncInt32(&k, 1))
 146371 
 146372 		*(*uintptr)(unsafe.Pointer(pColRef + 64)) = pTab
 146373 		*(*Bitmask)(unsafe.Pointer(pItem + 80)) |= Xsqlite3ExprColUsed(tls, pColRef)
 146374 		pRhs = Xsqlite3PExpr(tls, pParse, TK_UPLUS,
 146375 			Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*ExprList_item)(unsafe.Pointer(pArgs+8+uintptr(j)*32)).FpExpr, 0), uintptr(0))
 146376 		pTerm = Xsqlite3PExpr(tls, pParse, TK_EQ, pColRef, pRhs)
 146377 		if int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&(JT_LEFT|JT_LTORJ|JT_RIGHT) != 0 {
 146378 			joinType = U32(EP_OuterON)
 146379 		} else {
 146380 			joinType = U32(EP_InnerON)
 146381 		}
 146382 		Xsqlite3SetJoinExpr(tls, pTerm, (*SrcItem)(unsafe.Pointer(pItem)).FiCursor, joinType)
 146383 		whereClauseInsert(tls, pWC, pTerm, uint16(TERM_DYNAMIC))
 146384 	}
 146385 }
 146386 
 146387 // Extra information appended to the end of sqlite3_index_info but not
 146388 // visible to the xBestIndex function, at least not directly.  The
 146389 // sqlite3_vtab_collation() interface knows how to reach it, however.
 146390 //
 146391 // This object is not an API and can be changed from one release to the
 146392 // next.  As long as allocateIndexInfo() and sqlite3_vtab_collation()
 146393 // agree on the structure, all will be well.
 146394 type HiddenIndexInfo1 = struct {
 146395 	FpWC         uintptr
 146396 	FpParse      uintptr
 146397 	FeDistinct   int32
 146398 	FmIn         U32
 146399 	FmHandleIn   U32
 146400 	F__ccgo_pad1 [4]byte
 146401 	FaRhs        [1]uintptr
 146402 }
 146403 
 146404 // Extra information appended to the end of sqlite3_index_info but not
 146405 // visible to the xBestIndex function, at least not directly.  The
 146406 // sqlite3_vtab_collation() interface knows how to reach it, however.
 146407 //
 146408 // This object is not an API and can be changed from one release to the
 146409 // next.  As long as allocateIndexInfo() and sqlite3_vtab_collation()
 146410 // agree on the structure, all will be well.
 146411 type HiddenIndexInfo = HiddenIndexInfo1
 146412 
 146413 // Return the estimated number of output rows from a WHERE clause
 146414 func Xsqlite3WhereOutputRowCount(tls *libc.TLS, pWInfo uintptr) LogEst {
 146415 	return (*WhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut
 146416 }
 146417 
 146418 // Return one of the WHERE_DISTINCT_xxxxx values to indicate how this
 146419 // WHERE clause returns outputs for DISTINCT processing.
 146420 func Xsqlite3WhereIsDistinct(tls *libc.TLS, pWInfo uintptr) int32 {
 146421 	return int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct)
 146422 }
 146423 
 146424 // Return the number of ORDER BY terms that are satisfied by the
 146425 // WHERE clause.  A return of 0 means that the output must be
 146426 // completely sorted.  A return equal to the number of ORDER BY
 146427 // terms means that no sorting is needed at all.  A return that
 146428 // is positive but less than the number of ORDER BY terms means that
 146429 // block sorting is required.
 146430 func Xsqlite3WhereIsOrdered(tls *libc.TLS, pWInfo uintptr) int32 {
 146431 	if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat) < 0 {
 146432 		return 0
 146433 	}
 146434 	return int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat)
 146435 }
 146436 
 146437 // In the ORDER BY LIMIT optimization, if the inner-most loop is known
 146438 // to emit rows in increasing order, and if the last row emitted by the
 146439 // inner-most loop did not fit within the sorter, then we can skip all
 146440 // subsequent rows for the current iteration of the inner loop (because they
 146441 // will not fit in the sorter either) and continue with the second inner
 146442 // loop - the loop immediately outside the inner-most.
 146443 //
 146444 // When a row does not fit in the sorter (because the sorter already
 146445 // holds LIMIT+OFFSET rows that are smaller), then a jump is made to the
 146446 // label returned by this function.
 146447 //
 146448 // If the ORDER BY LIMIT optimization applies, the jump destination should
 146449 // be the continuation for the second-inner-most loop.  If the ORDER BY
 146450 // LIMIT optimization does not apply, then the jump destination should
 146451 // be the continuation for the inner-most loop.
 146452 //
 146453 // It is always safe for this routine to return the continuation of the
 146454 // inner-most loop, in the sense that a correct answer will result.
 146455 // Returning the continuation the second inner loop is an optimization
 146456 // that might make the code run a little faster, but should not change
 146457 // the final answer.
 146458 func Xsqlite3WhereOrderByLimitOptLabel(tls *libc.TLS, pWInfo uintptr) int32 {
 146459 	var pInner uintptr
 146460 	if !(int32(*(*uint8)(unsafe.Pointer(pWInfo + 68))&0x4>>2) != 0) {
 146461 		return (*WhereInfo)(unsafe.Pointer(pWInfo)).FiContinue
 146462 	}
 146463 	pInner = pWInfo + 856 + uintptr(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-1)*104
 146464 
 146465 	if (*WhereLevel)(unsafe.Pointer(pInner)).FpRJ != 0 {
 146466 		return (*WhereInfo)(unsafe.Pointer(pWInfo)).FiContinue
 146467 	}
 146468 	return (*WhereLevel)(unsafe.Pointer(pInner)).FaddrNxt
 146469 }
 146470 
 146471 // While generating code for the min/max optimization, after handling
 146472 // the aggregate-step call to min() or max(), check to see if any
 146473 // additional looping is required.  If the output order is such that
 146474 // we are certain that the correct answer has already been found, then
 146475 // code an OP_Goto to by pass subsequent processing.
 146476 //
 146477 // Any extra OP_Goto that is coded here is an optimization.  The
 146478 // correct answer should be obtained regardless.  This OP_Goto just
 146479 // makes the answer appear faster.
 146480 func Xsqlite3WhereMinMaxOptEarlyOut(tls *libc.TLS, v uintptr, pWInfo uintptr) {
 146481 	var pInner uintptr
 146482 	var i int32
 146483 	if !(int32(*(*uint8)(unsafe.Pointer(pWInfo + 68))&0x4>>2) != 0) {
 146484 		return
 146485 	}
 146486 	if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat) == 0 {
 146487 		return
 146488 	}
 146489 	for i = int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1; i >= 0; i-- {
 146490 		pInner = pWInfo + 856 + uintptr(i)*104
 146491 		if (*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&U32(WHERE_COLUMN_IN) != U32(0) {
 146492 			Xsqlite3VdbeGoto(tls, v, (*WhereLevel)(unsafe.Pointer(pInner)).FaddrNxt)
 146493 			return
 146494 		}
 146495 	}
 146496 	Xsqlite3VdbeGoto(tls, v, (*WhereInfo)(unsafe.Pointer(pWInfo)).FiBreak)
 146497 }
 146498 
 146499 // Return the VDBE address or label to jump to in order to continue
 146500 // immediately with the next row of a WHERE clause.
 146501 func Xsqlite3WhereContinueLabel(tls *libc.TLS, pWInfo uintptr) int32 {
 146502 	return (*WhereInfo)(unsafe.Pointer(pWInfo)).FiContinue
 146503 }
 146504 
 146505 // Return the VDBE address or label to jump to in order to break
 146506 // out of a WHERE loop.
 146507 func Xsqlite3WhereBreakLabel(tls *libc.TLS, pWInfo uintptr) int32 {
 146508 	return (*WhereInfo)(unsafe.Pointer(pWInfo)).FiBreak
 146509 }
 146510 
 146511 // Return ONEPASS_OFF (0) if an UPDATE or DELETE statement is unable to
 146512 // operate directly on the rowids returned by a WHERE clause.  Return
 146513 // ONEPASS_SINGLE (1) if the statement can operation directly because only
 146514 // a single row is to be changed.  Return ONEPASS_MULTI (2) if the one-pass
 146515 // optimization can be used on multiple
 146516 //
 146517 // If the ONEPASS optimization is used (if this routine returns true)
 146518 // then also write the indices of open cursors used by ONEPASS
 146519 // into aiCur[0] and aiCur[1].  iaCur[0] gets the cursor of the data
 146520 // table and iaCur[1] gets the cursor used by an auxiliary index.
 146521 // Either value may be -1, indicating that cursor is not used.
 146522 // Any cursors returned will have been opened for writing.
 146523 //
 146524 // aiCur[0] and aiCur[1] both get -1 if the where-clause logic is
 146525 // unable to use the ONEPASS optimization.
 146526 func Xsqlite3WhereOkOnePass(tls *libc.TLS, pWInfo uintptr, aiCur uintptr) int32 {
 146527 	libc.Xmemcpy(tls, aiCur, pWInfo+40, uint64(unsafe.Sizeof(int32(0)))*uint64(2))
 146528 	return int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass)
 146529 }
 146530 
 146531 // Return TRUE if the WHERE loop uses the OP_DeferredSeek opcode to move
 146532 // the data cursor to the row selected by the index cursor.
 146533 func Xsqlite3WhereUsesDeferredSeek(tls *libc.TLS, pWInfo uintptr) int32 {
 146534 	return int32(*(*uint8)(unsafe.Pointer(pWInfo + 68)) & 0x1 >> 0)
 146535 }
 146536 
 146537 func whereOrMove(tls *libc.TLS, pDest uintptr, pSrc uintptr) {
 146538 	(*WhereOrSet)(unsafe.Pointer(pDest)).Fn = (*WhereOrSet)(unsafe.Pointer(pSrc)).Fn
 146539 	libc.Xmemcpy(tls, pDest+8, pSrc+8, uint64((*WhereOrSet)(unsafe.Pointer(pDest)).Fn)*uint64(unsafe.Sizeof(WhereOrCost{})))
 146540 }
 146541 
 146542 func whereOrInsert(tls *libc.TLS, pSet uintptr, prereq Bitmask, rRun LogEst, nOut LogEst) int32 {
 146543 	var i U16
 146544 	var p uintptr
 146545 	i = (*WhereOrSet)(unsafe.Pointer(pSet)).Fn
 146546 	p = pSet + 8
 146547 __1:
 146548 	if !(int32(i) > 0) {
 146549 		goto __3
 146550 	}
 146551 	if !(int32(rRun) <= int32((*WhereOrCost)(unsafe.Pointer(p)).FrRun) && prereq&(*WhereOrCost)(unsafe.Pointer(p)).Fprereq == prereq) {
 146552 		goto __4
 146553 	}
 146554 	goto whereOrInsert_done
 146555 __4:
 146556 	;
 146557 	if !(int32((*WhereOrCost)(unsafe.Pointer(p)).FrRun) <= int32(rRun) && (*WhereOrCost)(unsafe.Pointer(p)).Fprereq&prereq == (*WhereOrCost)(unsafe.Pointer(p)).Fprereq) {
 146558 		goto __5
 146559 	}
 146560 	return 0
 146561 __5:
 146562 	;
 146563 	goto __2
 146564 __2:
 146565 	i--
 146566 	p += 16
 146567 	goto __1
 146568 	goto __3
 146569 __3:
 146570 	;
 146571 	if !(int32((*WhereOrSet)(unsafe.Pointer(pSet)).Fn) < N_OR_COST) {
 146572 		goto __6
 146573 	}
 146574 	p = pSet + 8 + uintptr(libc.PostIncUint16(&(*WhereOrSet)(unsafe.Pointer(pSet)).Fn, 1))*16
 146575 	(*WhereOrCost)(unsafe.Pointer(p)).FnOut = nOut
 146576 	goto __7
 146577 __6:
 146578 	p = pSet + 8
 146579 	i = U16(1)
 146580 __8:
 146581 	if !(int32(i) < int32((*WhereOrSet)(unsafe.Pointer(pSet)).Fn)) {
 146582 		goto __10
 146583 	}
 146584 	if !(int32((*WhereOrCost)(unsafe.Pointer(p)).FrRun) > int32((*WhereOrCost)(unsafe.Pointer(pSet+8+uintptr(i)*16)).FrRun)) {
 146585 		goto __11
 146586 	}
 146587 	p = pSet + 8 + uintptr(i)*16
 146588 __11:
 146589 	;
 146590 	goto __9
 146591 __9:
 146592 	i++
 146593 	goto __8
 146594 	goto __10
 146595 __10:
 146596 	;
 146597 	if !(int32((*WhereOrCost)(unsafe.Pointer(p)).FrRun) <= int32(rRun)) {
 146598 		goto __12
 146599 	}
 146600 	return 0
 146601 __12:
 146602 	;
 146603 __7:
 146604 	;
 146605 whereOrInsert_done:
 146606 	(*WhereOrCost)(unsafe.Pointer(p)).Fprereq = prereq
 146607 	(*WhereOrCost)(unsafe.Pointer(p)).FrRun = rRun
 146608 	if !(int32((*WhereOrCost)(unsafe.Pointer(p)).FnOut) > int32(nOut)) {
 146609 		goto __13
 146610 	}
 146611 	(*WhereOrCost)(unsafe.Pointer(p)).FnOut = nOut
 146612 __13:
 146613 	;
 146614 	return 1
 146615 }
 146616 
 146617 // Return the bitmask for the given cursor number.  Return 0 if
 146618 // iCursor is not in the set.
 146619 func Xsqlite3WhereGetMask(tls *libc.TLS, pMaskSet uintptr, iCursor int32) Bitmask {
 146620 	var i int32
 146621 
 146622 	if *(*int32)(unsafe.Pointer(pMaskSet + 8)) == iCursor {
 146623 		return uint64(1)
 146624 	}
 146625 	for i = 1; i < (*WhereMaskSet)(unsafe.Pointer(pMaskSet)).Fn; i++ {
 146626 		if *(*int32)(unsafe.Pointer(pMaskSet + 8 + uintptr(i)*4)) == iCursor {
 146627 			return uint64(1) << i
 146628 		}
 146629 	}
 146630 	return uint64(0)
 146631 }
 146632 
 146633 // Allocate memory that is automatically freed when pWInfo is freed.
 146634 func Xsqlite3WhereMalloc(tls *libc.TLS, pWInfo uintptr, nByte U64) uintptr {
 146635 	var pBlock uintptr
 146636 	pBlock = Xsqlite3DbMallocRawNN(tls, (*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb, nByte+U64(unsafe.Sizeof(WhereMemBlock{})))
 146637 	if pBlock != 0 {
 146638 		(*WhereMemBlock)(unsafe.Pointer(pBlock)).FpNext = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpMemToFree
 146639 		(*WhereMemBlock)(unsafe.Pointer(pBlock)).Fsz = nByte
 146640 		(*WhereInfo)(unsafe.Pointer(pWInfo)).FpMemToFree = pBlock
 146641 		pBlock += 16
 146642 	}
 146643 	return pBlock
 146644 }
 146645 
 146646 func Xsqlite3WhereRealloc(tls *libc.TLS, pWInfo uintptr, pOld uintptr, nByte U64) uintptr {
 146647 	var pNew uintptr = Xsqlite3WhereMalloc(tls, pWInfo, nByte)
 146648 	if pNew != 0 && pOld != 0 {
 146649 		var pOldBlk uintptr = pOld
 146650 		pOldBlk -= 16
 146651 
 146652 		libc.Xmemcpy(tls, pNew, pOld, (*WhereMemBlock)(unsafe.Pointer(pOldBlk)).Fsz)
 146653 	}
 146654 	return pNew
 146655 }
 146656 
 146657 func createMask(tls *libc.TLS, pMaskSet uintptr, iCursor int32) {
 146658 	*(*int32)(unsafe.Pointer(pMaskSet + 8 + uintptr(libc.PostIncInt32(&(*WhereMaskSet)(unsafe.Pointer(pMaskSet)).Fn, 1))*4)) = iCursor
 146659 }
 146660 
 146661 func whereRightSubexprIsColumn(tls *libc.TLS, p uintptr) uintptr {
 146662 	p = Xsqlite3ExprSkipCollateAndLikely(tls, (*Expr)(unsafe.Pointer(p)).FpRight)
 146663 	if p != uintptr(0) && int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN && !((*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_FixedCol) != U32(0)) {
 146664 		return p
 146665 	}
 146666 	return uintptr(0)
 146667 }
 146668 
 146669 func whereScanNext(tls *libc.TLS, pScan uintptr) uintptr {
 146670 	var iCur int32
 146671 	var iColumn I16
 146672 	var pX uintptr
 146673 	var pWC uintptr
 146674 	var pTerm uintptr
 146675 	var k int32 = (*WhereScan)(unsafe.Pointer(pScan)).Fk
 146676 
 146677 	pWC = (*WhereScan)(unsafe.Pointer(pScan)).FpWC
 146678 	for 1 != 0 {
 146679 		iColumn = *(*I16)(unsafe.Pointer(pScan + 88 + uintptr(int32((*WhereScan)(unsafe.Pointer(pScan)).FiEquiv)-1)*2))
 146680 		iCur = *(*int32)(unsafe.Pointer(pScan + 44 + uintptr(int32((*WhereScan)(unsafe.Pointer(pScan)).FiEquiv)-1)*4))
 146681 
 146682 		for __ccgo := true; __ccgo; __ccgo = pWC != uintptr(0) {
 146683 			pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(k)*56
 146684 		__1:
 146685 			if !(k < (*WhereClause)(unsafe.Pointer(pWC)).FnTerm) {
 146686 				goto __3
 146687 			}
 146688 			{
 146689 				if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor == iCur &&
 146690 					*(*int32)(unsafe.Pointer(pTerm + 32)) == int32(iColumn) &&
 146691 					(int32(iColumn) != -2 ||
 146692 						Xsqlite3ExprCompareSkip(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft,
 146693 							(*WhereScan)(unsafe.Pointer(pScan)).FpIdxExpr, iCur) == 0) &&
 146694 					(int32((*WhereScan)(unsafe.Pointer(pScan)).FiEquiv) <= 1 || !((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&U32(EP_OuterON) != U32(0))) {
 146695 					if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&WO_EQUIV != 0 &&
 146696 						int32((*WhereScan)(unsafe.Pointer(pScan)).FnEquiv) < int32(uint64(unsafe.Sizeof([11]int32{}))/uint64(unsafe.Sizeof(int32(0)))) &&
 146697 						libc.AssignUintptr(&pX, whereRightSubexprIsColumn(tls, (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)) != uintptr(0) {
 146698 						var j int32
 146699 						for j = 0; j < int32((*WhereScan)(unsafe.Pointer(pScan)).FnEquiv); j++ {
 146700 							if *(*int32)(unsafe.Pointer(pScan + 44 + uintptr(j)*4)) == (*Expr)(unsafe.Pointer(pX)).FiTable &&
 146701 								int32(*(*I16)(unsafe.Pointer(pScan + 88 + uintptr(j)*2))) == int32((*Expr)(unsafe.Pointer(pX)).FiColumn) {
 146702 								break
 146703 							}
 146704 						}
 146705 						if j == int32((*WhereScan)(unsafe.Pointer(pScan)).FnEquiv) {
 146706 							*(*int32)(unsafe.Pointer(pScan + 44 + uintptr(j)*4)) = (*Expr)(unsafe.Pointer(pX)).FiTable
 146707 							*(*I16)(unsafe.Pointer(pScan + 88 + uintptr(j)*2)) = (*Expr)(unsafe.Pointer(pX)).FiColumn
 146708 							(*WhereScan)(unsafe.Pointer(pScan)).FnEquiv++
 146709 						}
 146710 					}
 146711 					if U32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(*WhereScan)(unsafe.Pointer(pScan)).FopMask != U32(0) {
 146712 						if (*WhereScan)(unsafe.Pointer(pScan)).FzCollName != 0 && int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&WO_ISNULL == 0 {
 146713 							var pColl uintptr
 146714 							var pParse uintptr = (*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse
 146715 							pX = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
 146716 							if !(Xsqlite3IndexAffinityOk(tls, pX, (*WhereScan)(unsafe.Pointer(pScan)).Fidxaff) != 0) {
 146717 								goto __2
 146718 							}
 146719 
 146720 							pColl = Xsqlite3ExprCompareCollSeq(tls, pParse, pX)
 146721 							if pColl == uintptr(0) {
 146722 								pColl = (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl
 146723 							}
 146724 							if Xsqlite3StrICmp(tls, (*CollSeq)(unsafe.Pointer(pColl)).FzName, (*WhereScan)(unsafe.Pointer(pScan)).FzCollName) != 0 {
 146725 								goto __2
 146726 							}
 146727 						}
 146728 						if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(WO_EQ|WO_IS) != 0 &&
 146729 							func() bool {
 146730 								pX = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight
 146731 								return pX != uintptr(0)
 146732 							}() &&
 146733 							int32((*Expr)(unsafe.Pointer(pX)).Fop) == TK_COLUMN &&
 146734 							(*Expr)(unsafe.Pointer(pX)).FiTable == *(*int32)(unsafe.Pointer(pScan + 44)) &&
 146735 							int32((*Expr)(unsafe.Pointer(pX)).FiColumn) == int32(*(*I16)(unsafe.Pointer(pScan + 88))) {
 146736 							goto __2
 146737 						}
 146738 						(*WhereScan)(unsafe.Pointer(pScan)).FpWC = pWC
 146739 						(*WhereScan)(unsafe.Pointer(pScan)).Fk = k + 1
 146740 						return pTerm
 146741 					}
 146742 				}
 146743 
 146744 			}
 146745 			goto __2
 146746 		__2:
 146747 			k++
 146748 			pTerm += 56
 146749 			goto __1
 146750 			goto __3
 146751 		__3:
 146752 			;
 146753 			pWC = (*WhereClause)(unsafe.Pointer(pWC)).FpOuter
 146754 			k = 0
 146755 		}
 146756 		if int32((*WhereScan)(unsafe.Pointer(pScan)).FiEquiv) >= int32((*WhereScan)(unsafe.Pointer(pScan)).FnEquiv) {
 146757 			break
 146758 		}
 146759 		pWC = (*WhereScan)(unsafe.Pointer(pScan)).FpOrigWC
 146760 		k = 0
 146761 		(*WhereScan)(unsafe.Pointer(pScan)).FiEquiv++
 146762 	}
 146763 	return uintptr(0)
 146764 }
 146765 
 146766 func whereScanInitIndexExpr(tls *libc.TLS, pScan uintptr) uintptr {
 146767 	(*WhereScan)(unsafe.Pointer(pScan)).Fidxaff = Xsqlite3ExprAffinity(tls, (*WhereScan)(unsafe.Pointer(pScan)).FpIdxExpr)
 146768 	return whereScanNext(tls, pScan)
 146769 }
 146770 
 146771 func whereScanInit(tls *libc.TLS, pScan uintptr, pWC uintptr, iCur int32, iColumn int32, opMask U32, pIdx uintptr) uintptr {
 146772 	(*WhereScan)(unsafe.Pointer(pScan)).FpOrigWC = pWC
 146773 	(*WhereScan)(unsafe.Pointer(pScan)).FpWC = pWC
 146774 	(*WhereScan)(unsafe.Pointer(pScan)).FpIdxExpr = uintptr(0)
 146775 	(*WhereScan)(unsafe.Pointer(pScan)).Fidxaff = int8(0)
 146776 	(*WhereScan)(unsafe.Pointer(pScan)).FzCollName = uintptr(0)
 146777 	(*WhereScan)(unsafe.Pointer(pScan)).FopMask = opMask
 146778 	(*WhereScan)(unsafe.Pointer(pScan)).Fk = 0
 146779 	*(*int32)(unsafe.Pointer(pScan + 44)) = iCur
 146780 	(*WhereScan)(unsafe.Pointer(pScan)).FnEquiv = uint8(1)
 146781 	(*WhereScan)(unsafe.Pointer(pScan)).FiEquiv = uint8(1)
 146782 	if pIdx != 0 {
 146783 		var j int32 = iColumn
 146784 		iColumn = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)))
 146785 		if iColumn == int32((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FiPKey) {
 146786 			iColumn = -1
 146787 		} else if iColumn >= 0 {
 146788 			(*WhereScan)(unsafe.Pointer(pScan)).Fidxaff = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(iColumn)*24)).Faffinity
 146789 			(*WhereScan)(unsafe.Pointer(pScan)).FzCollName = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*8))
 146790 		} else if iColumn == -2 {
 146791 			(*WhereScan)(unsafe.Pointer(pScan)).FpIdxExpr = (*ExprList_item)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaColExpr + 8 + uintptr(j)*32)).FpExpr
 146792 			(*WhereScan)(unsafe.Pointer(pScan)).FzCollName = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*8))
 146793 			*(*I16)(unsafe.Pointer(pScan + 88)) = int16(-2)
 146794 			return whereScanInitIndexExpr(tls, pScan)
 146795 		}
 146796 	} else if iColumn == -2 {
 146797 		return uintptr(0)
 146798 	}
 146799 	*(*I16)(unsafe.Pointer(pScan + 88)) = I16(iColumn)
 146800 	return whereScanNext(tls, pScan)
 146801 }
 146802 
 146803 // Search for a term in the WHERE clause that is of the form "X <op> <expr>"
 146804 // where X is a reference to the iColumn of table iCur or of index pIdx
 146805 // if pIdx!=0 and <op> is one of the WO_xx operator codes specified by
 146806 // the op parameter.  Return a pointer to the term.  Return 0 if not found.
 146807 //
 146808 // If pIdx!=0 then it must be one of the indexes of table iCur.
 146809 // Search for terms matching the iColumn-th column of pIdx
 146810 // rather than the iColumn-th column of table iCur.
 146811 //
 146812 // The term returned might by Y=<expr> if there is another constraint in
 146813 // the WHERE clause that specifies that X=Y.  Any such constraints will be
 146814 // identified by the WO_EQUIV bit in the pTerm->eOperator field.  The
 146815 // aiCur[]/iaColumn[] arrays hold X and all its equivalents. There are 11
 146816 // slots in aiCur[]/aiColumn[] so that means we can look for X plus up to 10
 146817 // other equivalent values.  Hence a search for X will return <expr> if X=A1
 146818 // and A1=A2 and A2=A3 and ... and A9=A10 and A10=<expr>.
 146819 //
 146820 // If there are multiple terms in the WHERE clause of the form "X <op> <expr>"
 146821 // then try for the one with no dependencies on <expr> - in other words where
 146822 // <expr> is a constant expression of some kind.  Only return entries of
 146823 // the form "X <op> Y" where Y is a column in another table if no terms of
 146824 // the form "X <op> <const-expr>" exist.   If no terms with a constant RHS
 146825 // exist, try to return a term that does not use WO_EQUIV.
 146826 func Xsqlite3WhereFindTerm(tls *libc.TLS, pWC uintptr, iCur int32, iColumn int32, notReady Bitmask, op U32, pIdx uintptr) uintptr {
 146827 	bp := tls.Alloc(112)
 146828 	defer tls.Free(112)
 146829 
 146830 	var pResult uintptr = uintptr(0)
 146831 	var p uintptr
 146832 
 146833 	p = whereScanInit(tls, bp, pWC, iCur, iColumn, op, pIdx)
 146834 	op = op & U32(WO_EQ|WO_IS)
 146835 	for p != 0 {
 146836 		if (*WhereTerm)(unsafe.Pointer(p)).FprereqRight&notReady == uint64(0) {
 146837 			if (*WhereTerm)(unsafe.Pointer(p)).FprereqRight == uint64(0) && U32((*WhereTerm)(unsafe.Pointer(p)).FeOperator)&op != U32(0) {
 146838 				return p
 146839 			}
 146840 			if pResult == uintptr(0) {
 146841 				pResult = p
 146842 			}
 146843 		}
 146844 		p = whereScanNext(tls, bp)
 146845 	}
 146846 	return pResult
 146847 }
 146848 
 146849 func findIndexCol(tls *libc.TLS, pParse uintptr, pList uintptr, iBase int32, pIdx uintptr, iCol int32) int32 {
 146850 	var i int32
 146851 	var zColl uintptr = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(iCol)*8))
 146852 
 146853 	for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ {
 146854 		var p uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*32)).FpExpr)
 146855 		if p != uintptr(0) &&
 146856 			(int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN || int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_AGG_COLUMN) &&
 146857 			int32((*Expr)(unsafe.Pointer(p)).FiColumn) == int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iCol)*2))) &&
 146858 			(*Expr)(unsafe.Pointer(p)).FiTable == iBase {
 146859 			var pColl uintptr = Xsqlite3ExprNNCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*32)).FpExpr)
 146860 			if 0 == Xsqlite3StrICmp(tls, (*CollSeq)(unsafe.Pointer(pColl)).FzName, zColl) {
 146861 				return i
 146862 			}
 146863 		}
 146864 	}
 146865 
 146866 	return -1
 146867 }
 146868 
 146869 func indexColumnNotNull(tls *libc.TLS, pIdx uintptr, iCol int32) int32 {
 146870 	var j int32
 146871 
 146872 	j = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iCol)*2)))
 146873 	if j >= 0 {
 146874 		return int32(*(*uint8)(unsafe.Pointer((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(j)*24 + 8)) & 0xf >> 0)
 146875 	} else if j == -1 {
 146876 		return 1
 146877 	} else {
 146878 		return 0
 146879 
 146880 	}
 146881 	return int32(0)
 146882 }
 146883 
 146884 func isDistinctRedundant(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWC uintptr, pDistinct uintptr) int32 {
 146885 	var pTab uintptr
 146886 	var pIdx uintptr
 146887 	var i int32
 146888 	var iBase int32
 146889 
 146890 	if (*SrcList)(unsafe.Pointer(pTabList)).FnSrc != 1 {
 146891 		return 0
 146892 	}
 146893 	iBase = (*SrcItem)(unsafe.Pointer(pTabList + 8)).FiCursor
 146894 	pTab = (*SrcItem)(unsafe.Pointer(pTabList + 8)).FpTab
 146895 
 146896 	for i = 0; i < (*ExprList)(unsafe.Pointer(pDistinct)).FnExpr; i++ {
 146897 		var p uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer(pDistinct+8+uintptr(i)*32)).FpExpr)
 146898 		if p == uintptr(0) {
 146899 			continue
 146900 		}
 146901 		if int32((*Expr)(unsafe.Pointer(p)).Fop) != TK_COLUMN && int32((*Expr)(unsafe.Pointer(p)).Fop) != TK_AGG_COLUMN {
 146902 			continue
 146903 		}
 146904 		if (*Expr)(unsafe.Pointer(p)).FiTable == iBase && int32((*Expr)(unsafe.Pointer(p)).FiColumn) < 0 {
 146905 			return 1
 146906 		}
 146907 	}
 146908 
 146909 	for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
 146910 		if !(int32((*Index)(unsafe.Pointer(pIdx)).FonError) != OE_None) {
 146911 			continue
 146912 		}
 146913 		if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 {
 146914 			continue
 146915 		}
 146916 		for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol); i++ {
 146917 			if uintptr(0) == Xsqlite3WhereFindTerm(tls, pWC, iBase, i, libc.CplUint64(uint64(0)), uint32(WO_EQ), pIdx) {
 146918 				if findIndexCol(tls, pParse, pDistinct, iBase, pIdx, i) < 0 {
 146919 					break
 146920 				}
 146921 				if indexColumnNotNull(tls, pIdx, i) == 0 {
 146922 					break
 146923 				}
 146924 			}
 146925 		}
 146926 		if i == int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) {
 146927 			return 1
 146928 		}
 146929 	}
 146930 
 146931 	return 0
 146932 }
 146933 
 146934 func estLog(tls *libc.TLS, N LogEst) LogEst {
 146935 	if int32(N) <= 10 {
 146936 		return int16(0)
 146937 	}
 146938 	return int16(int32(Xsqlite3LogEst(tls, uint64(N))) - 33)
 146939 }
 146940 
 146941 func translateColumnToCopy(tls *libc.TLS, pParse uintptr, iStart int32, iTabCur int32, iRegister int32, iAutoidxCur int32) {
 146942 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 146943 	var pOp uintptr = Xsqlite3VdbeGetOp(tls, v, iStart)
 146944 	var iEnd int32 = Xsqlite3VdbeCurrentAddr(tls, v)
 146945 	if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 {
 146946 		return
 146947 	}
 146948 __1:
 146949 	if !(iStart < iEnd) {
 146950 		goto __3
 146951 	}
 146952 	{
 146953 		if (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 != iTabCur {
 146954 			goto __2
 146955 		}
 146956 		if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Column {
 146957 			(*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Copy)
 146958 			(*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*VdbeOp)(unsafe.Pointer(pOp)).Fp2 + iRegister
 146959 			(*VdbeOp)(unsafe.Pointer(pOp)).Fp2 = (*VdbeOp)(unsafe.Pointer(pOp)).Fp3
 146960 			(*VdbeOp)(unsafe.Pointer(pOp)).Fp3 = 0
 146961 			(*VdbeOp)(unsafe.Pointer(pOp)).Fp5 = U16(2)
 146962 		} else if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Rowid {
 146963 			(*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Sequence)
 146964 			(*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = iAutoidxCur
 146965 		}
 146966 
 146967 	}
 146968 	goto __2
 146969 __2:
 146970 	iStart++
 146971 	pOp += 24
 146972 	goto __1
 146973 	goto __3
 146974 __3:
 146975 }
 146976 
 146977 func constraintCompatibleWithOuterJoin(tls *libc.TLS, pTerm uintptr, pSrc uintptr) int32 {
 146978 	if !((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&U32(EP_OuterON|EP_InnerON) != U32(0)) ||
 146979 		*(*int32)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr + 52)) != (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor {
 146980 		return 0
 146981 	}
 146982 	if int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&(JT_LEFT|JT_RIGHT) != 0 &&
 146983 		(*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&U32(EP_InnerON) != U32(0) {
 146984 		return 0
 146985 	}
 146986 	return 1
 146987 }
 146988 
 146989 func termCanDriveIndex(tls *libc.TLS, pTerm uintptr, pSrc uintptr, notReady Bitmask) int32 {
 146990 	var aff int8
 146991 	if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor {
 146992 		return 0
 146993 	}
 146994 	if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(WO_EQ|WO_IS) == 0 {
 146995 		return 0
 146996 	}
 146997 
 146998 	if int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&(JT_LEFT|JT_LTORJ|JT_RIGHT) != 0 &&
 146999 		!(constraintCompatibleWithOuterJoin(tls, pTerm, pSrc) != 0) {
 147000 		return 0
 147001 	}
 147002 	if (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight&notReady != uint64(0) {
 147003 		return 0
 147004 	}
 147005 
 147006 	if *(*int32)(unsafe.Pointer(pTerm + 32)) < 0 {
 147007 		return 0
 147008 	}
 147009 	aff = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FaCol + uintptr(*(*int32)(unsafe.Pointer(pTerm + 32)))*24)).Faffinity
 147010 	if !(Xsqlite3IndexAffinityOk(tls, (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr, aff) != 0) {
 147011 		return 0
 147012 	}
 147013 
 147014 	return 1
 147015 }
 147016 
 147017 func constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, pSrc uintptr, notReady Bitmask, pLevel uintptr) {
 147018 	bp := tls.Alloc(24)
 147019 	defer tls.Free(24)
 147020 
 147021 	var nKeyCol int32
 147022 	var pTerm uintptr
 147023 	var pWCEnd uintptr
 147024 	var pIdx uintptr
 147025 	var v uintptr
 147026 	var addrInit int32
 147027 	var pTable uintptr
 147028 	var addrTop int32
 147029 	var regRecord int32
 147030 	var n int32
 147031 	var i int32
 147032 	var mxBitCol int32
 147033 	var pColl uintptr
 147034 	var pLoop uintptr
 147035 
 147036 	var idxCols Bitmask
 147037 	var extraCols Bitmask
 147038 	var sentWarning U8
 147039 	var pPartial uintptr
 147040 	var iContinue int32
 147041 	var pTabItem uintptr
 147042 	var addrCounter int32
 147043 	var regBase int32
 147044 	var iCol int32
 147045 	var cMask Bitmask
 147046 	var pExpr uintptr
 147047 	var pX uintptr
 147048 	var iCol1 int32
 147049 	var cMask1 Bitmask
 147050 	var regYield int32
 147051 	sentWarning = U8(0)
 147052 	pPartial = uintptr(0)
 147053 	iContinue = 0
 147054 	addrCounter = 0
 147055 
 147056 	v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 147057 
 147058 	addrInit = Xsqlite3VdbeAddOp0(tls, v, OP_Once)
 147059 
 147060 	nKeyCol = 0
 147061 	pTable = (*SrcItem)(unsafe.Pointer(pSrc)).FpTab
 147062 	pWCEnd = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)*56
 147063 	pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop
 147064 	idxCols = uint64(0)
 147065 	pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa
 147066 __1:
 147067 	if !(pTerm < pWCEnd) {
 147068 		goto __3
 147069 	}
 147070 	pExpr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
 147071 
 147072 	if !(int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_VIRTUAL == 0 &&
 147073 		Xsqlite3ExprIsTableConstraint(tls, pExpr, pSrc) != 0) {
 147074 		goto __4
 147075 	}
 147076 	pPartial = Xsqlite3ExprAnd(tls, pParse, pPartial,
 147077 		Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, 0))
 147078 __4:
 147079 	;
 147080 	if !(termCanDriveIndex(tls, pTerm, pSrc, notReady) != 0) {
 147081 		goto __5
 147082 	}
 147083 
 147084 	iCol = *(*int32)(unsafe.Pointer(pTerm + 32))
 147085 	if iCol >= int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8)) {
 147086 		cMask = uint64(1) << (int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8)) - 1)
 147087 	} else {
 147088 		cMask = uint64(1) << iCol
 147089 	}
 147090 
 147091 	if !!(sentWarning != 0) {
 147092 		goto __6
 147093 	}
 147094 	Xsqlite3_log(tls, SQLITE_WARNING|int32(1)<<8,
 147095 		ts+23322, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName,
 147096 			(*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTable)).FaCol+uintptr(iCol)*24)).FzCnName))
 147097 	sentWarning = U8(1)
 147098 __6:
 147099 	;
 147100 	if !(idxCols&cMask == uint64(0)) {
 147101 		goto __7
 147102 	}
 147103 	if !(whereLoopResize(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pLoop, nKeyCol+1) != 0) {
 147104 		goto __8
 147105 	}
 147106 	goto end_auto_index_create
 147107 __8:
 147108 	;
 147109 	*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&nKeyCol, 1))*8)) = pTerm
 147110 	idxCols = idxCols | cMask
 147111 __7:
 147112 	;
 147113 __5:
 147114 	;
 147115 	goto __2
 147116 __2:
 147117 	pTerm += 56
 147118 	goto __1
 147119 	goto __3
 147120 __3:
 147121 	;
 147122 	*(*U16)(unsafe.Pointer(pLoop + 24)) = libc.AssignPtrUint16(pLoop+60, U16(nKeyCol))
 147123 	(*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = U32(WHERE_COLUMN_EQ | WHERE_IDX_ONLY | WHERE_INDEXED |
 147124 		WHERE_AUTO_INDEX)
 147125 
 147126 	extraCols = (*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed & (^idxCols | uint64(1)<<(int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8))-1))
 147127 	mxBitCol = func() int32 {
 147128 		if int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8))-1 < int32((*Table)(unsafe.Pointer(pTable)).FnCol) {
 147129 			return int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8)) - 1
 147130 		}
 147131 		return int32((*Table)(unsafe.Pointer(pTable)).FnCol)
 147132 	}()
 147133 
 147134 	i = 0
 147135 __9:
 147136 	if !(i < mxBitCol) {
 147137 		goto __11
 147138 	}
 147139 	if !(extraCols&(uint64(1)<<i) != 0) {
 147140 		goto __12
 147141 	}
 147142 	nKeyCol++
 147143 __12:
 147144 	;
 147145 	goto __10
 147146 __10:
 147147 	i++
 147148 	goto __9
 147149 	goto __11
 147150 __11:
 147151 	;
 147152 	if !((*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed&(uint64(1)<<(int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8))-1)) != 0) {
 147153 		goto __13
 147154 	}
 147155 	nKeyCol = nKeyCol + (int32((*Table)(unsafe.Pointer(pTable)).FnCol) - int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8)) + 1)
 147156 __13:
 147157 	;
 147158 	pIdx = Xsqlite3AllocateIndexObject(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, int16(nKeyCol+1), 0, bp+16)
 147159 	if !(pIdx == uintptr(0)) {
 147160 		goto __14
 147161 	}
 147162 	goto end_auto_index_create
 147163 __14:
 147164 	;
 147165 	*(*uintptr)(unsafe.Pointer(pLoop + 24 + 8)) = pIdx
 147166 	(*Index)(unsafe.Pointer(pIdx)).FzName = ts + 23348
 147167 	(*Index)(unsafe.Pointer(pIdx)).FpTable = pTable
 147168 	n = 0
 147169 	idxCols = uint64(0)
 147170 	pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa
 147171 __15:
 147172 	if !(pTerm < pWCEnd) {
 147173 		goto __17
 147174 	}
 147175 	if !(termCanDriveIndex(tls, pTerm, pSrc, notReady) != 0) {
 147176 		goto __18
 147177 	}
 147178 
 147179 	iCol1 = *(*int32)(unsafe.Pointer(pTerm + 32))
 147180 	if iCol1 >= int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8)) {
 147181 		cMask1 = uint64(1) << (int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8)) - 1)
 147182 	} else {
 147183 		cMask1 = uint64(1) << iCol1
 147184 	}
 147185 
 147186 	if !(idxCols&cMask1 == uint64(0)) {
 147187 		goto __19
 147188 	}
 147189 	pX = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
 147190 	idxCols = idxCols | cMask1
 147191 	*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(n)*2)) = I16(*(*int32)(unsafe.Pointer(pTerm + 32)))
 147192 	pColl = Xsqlite3ExprCompareCollSeq(tls, pParse, pX)
 147193 
 147194 	*(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(n)*8)) = func() uintptr {
 147195 		if pColl != 0 {
 147196 			return (*CollSeq)(unsafe.Pointer(pColl)).FzName
 147197 		}
 147198 		return uintptr(unsafe.Pointer(&Xsqlite3StrBINARY))
 147199 	}()
 147200 	n++
 147201 __19:
 147202 	;
 147203 __18:
 147204 	;
 147205 	goto __16
 147206 __16:
 147207 	pTerm += 56
 147208 	goto __15
 147209 	goto __17
 147210 __17:
 147211 	;
 147212 	i = 0
 147213 __20:
 147214 	if !(i < mxBitCol) {
 147215 		goto __22
 147216 	}
 147217 	if !(extraCols&(uint64(1)<<i) != 0) {
 147218 		goto __23
 147219 	}
 147220 	*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(n)*2)) = I16(i)
 147221 	*(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(n)*8)) = uintptr(unsafe.Pointer(&Xsqlite3StrBINARY))
 147222 	n++
 147223 __23:
 147224 	;
 147225 	goto __21
 147226 __21:
 147227 	i++
 147228 	goto __20
 147229 	goto __22
 147230 __22:
 147231 	;
 147232 	if !((*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed&(uint64(1)<<(int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8))-1)) != 0) {
 147233 		goto __24
 147234 	}
 147235 	i = int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8)) - 1
 147236 __25:
 147237 	if !(i < int32((*Table)(unsafe.Pointer(pTable)).FnCol)) {
 147238 		goto __27
 147239 	}
 147240 	*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(n)*2)) = I16(i)
 147241 	*(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(n)*8)) = uintptr(unsafe.Pointer(&Xsqlite3StrBINARY))
 147242 	n++
 147243 	goto __26
 147244 __26:
 147245 	i++
 147246 	goto __25
 147247 	goto __27
 147248 __27:
 147249 	;
 147250 __24:
 147251 	;
 147252 	*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(n)*2)) = int16(-1)
 147253 	*(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(n)*8)) = uintptr(unsafe.Pointer(&Xsqlite3StrBINARY))
 147254 
 147255 	(*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 147256 	Xsqlite3VdbeAddOp2(tls, v, OP_OpenAutoindex, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, nKeyCol+1)
 147257 	Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx)
 147258 
 147259 	if !((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&U32(SQLITE_BloomFilter) == U32(0)) {
 147260 		goto __28
 147261 	}
 147262 	(*WhereLevel)(unsafe.Pointer(pLevel)).FregFilter = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 147263 	Xsqlite3VdbeAddOp2(tls, v, OP_Blob, 10000, (*WhereLevel)(unsafe.Pointer(pLevel)).FregFilter)
 147264 __28:
 147265 	;
 147266 	pTabItem = (*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpTabList + 8 + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104
 147267 	if !(uint32(int32(*(*uint16)(unsafe.Pointer(pTabItem + 60 + 4))&0x20>>5)) != 0) {
 147268 		goto __29
 147269 	}
 147270 	regYield = (*SrcItem)(unsafe.Pointer(pTabItem)).FregReturn
 147271 	addrCounter = Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, 0)
 147272 	Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regYield, 0, (*SrcItem)(unsafe.Pointer(pTabItem)).FaddrFillSub)
 147273 	addrTop = Xsqlite3VdbeAddOp1(tls, v, OP_Yield, regYield)
 147274 
 147275 	goto __30
 147276 __29:
 147277 	addrTop = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur)
 147278 __30:
 147279 	;
 147280 	if !(pPartial != 0) {
 147281 		goto __31
 147282 	}
 147283 	iContinue = Xsqlite3VdbeMakeLabel(tls, pParse)
 147284 	Xsqlite3ExprIfFalse(tls, pParse, pPartial, iContinue, SQLITE_JUMPIFNULL)
 147285 	*(*U32)(unsafe.Pointer(pLoop + 56)) |= U32(WHERE_PARTIALIDX)
 147286 __31:
 147287 	;
 147288 	regRecord = Xsqlite3GetTempReg(tls, pParse)
 147289 	regBase = Xsqlite3GenerateIndexKey(tls,
 147290 		pParse, pIdx, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, regRecord, 0, uintptr(0), uintptr(0), 0)
 147291 	if !((*WhereLevel)(unsafe.Pointer(pLevel)).FregFilter != 0) {
 147292 		goto __32
 147293 	}
 147294 	Xsqlite3VdbeAddOp4Int(tls, v, OP_FilterAdd, (*WhereLevel)(unsafe.Pointer(pLevel)).FregFilter, 0,
 147295 		regBase, int32(*(*U16)(unsafe.Pointer(pLoop + 24))))
 147296 __32:
 147297 	;
 147298 	Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, regRecord)
 147299 	Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT))
 147300 	if !(pPartial != 0) {
 147301 		goto __33
 147302 	}
 147303 	Xsqlite3VdbeResolveLabel(tls, v, iContinue)
 147304 __33:
 147305 	;
 147306 	if !(uint32(int32(*(*uint16)(unsafe.Pointer(pTabItem + 60 + 4))&0x20>>5)) != 0) {
 147307 		goto __34
 147308 	}
 147309 	Xsqlite3VdbeChangeP2(tls, v, addrCounter, regBase+n)
 147310 
 147311 	translateColumnToCopy(tls, pParse, addrTop, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur,
 147312 		(*SrcItem)(unsafe.Pointer(pTabItem)).FregResult, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur)
 147313 	Xsqlite3VdbeGoto(tls, v, addrTop)
 147314 	libc.SetBitFieldPtr16Uint32(pTabItem+60+4, uint32(0), 5, 0x20)
 147315 	goto __35
 147316 __34:
 147317 	Xsqlite3VdbeAddOp2(tls, v, OP_Next, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, addrTop+1)
 147318 	Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_STMTSTATUS_AUTOINDEX))
 147319 __35:
 147320 	;
 147321 	Xsqlite3VdbeJumpHere(tls, v, addrTop)
 147322 	Xsqlite3ReleaseTempReg(tls, pParse, regRecord)
 147323 
 147324 	Xsqlite3VdbeJumpHere(tls, v, addrInit)
 147325 
 147326 end_auto_index_create:
 147327 	Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pPartial)
 147328 }
 147329 
 147330 func sqlite3ConstructBloomFilter(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLevel uintptr, notReady Bitmask) {
 147331 	var addrOnce int32
 147332 	var addrTop int32
 147333 	var addrCont int32
 147334 	var pTerm uintptr
 147335 	var pWCEnd uintptr
 147336 	var pParse uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse
 147337 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 147338 	var pLoop uintptr = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop
 147339 	var iCur int32
 147340 	var saved_pIdxEpr uintptr
 147341 
 147342 	saved_pIdxEpr = (*Parse)(unsafe.Pointer(pParse)).FpIdxEpr
 147343 	(*Parse)(unsafe.Pointer(pParse)).FpIdxEpr = uintptr(0)
 147344 
 147345 	addrOnce = Xsqlite3VdbeAddOp0(tls, v, OP_Once)
 147346 	for __ccgo := true; __ccgo; __ccgo = iLevel < int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) {
 147347 		var pItem uintptr
 147348 		var pTab uintptr
 147349 		var sz U64
 147350 		Xsqlite3WhereExplainBloomFilter(tls, pParse, pWInfo, pLevel)
 147351 		addrCont = Xsqlite3VdbeMakeLabel(tls, pParse)
 147352 		iCur = (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur
 147353 		(*WhereLevel)(unsafe.Pointer(pLevel)).FregFilter = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 147354 
 147355 		pItem = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104
 147356 
 147357 		pTab = (*SrcItem)(unsafe.Pointer(pItem)).FpTab
 147358 
 147359 		sz = Xsqlite3LogEstToInt(tls, (*Table)(unsafe.Pointer(pTab)).FnRowLogEst)
 147360 		if sz < uint64(10000) {
 147361 			sz = uint64(10000)
 147362 		} else if sz > uint64(10000000) {
 147363 			sz = uint64(10000000)
 147364 		}
 147365 		Xsqlite3VdbeAddOp2(tls, v, OP_Blob, int32(sz), (*WhereLevel)(unsafe.Pointer(pLevel)).FregFilter)
 147366 
 147367 		addrTop = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, iCur)
 147368 		pWCEnd = (*WhereInfo)(unsafe.Pointer(pWInfo)).FsWC.Fa + uintptr((*WhereInfo)(unsafe.Pointer(pWInfo)).FsWC.FnTerm)*56
 147369 		for pTerm = (*WhereInfo)(unsafe.Pointer(pWInfo)).FsWC.Fa; pTerm < pWCEnd; pTerm += 56 {
 147370 			var pExpr uintptr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
 147371 			if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_VIRTUAL == 0 &&
 147372 				Xsqlite3ExprIsTableConstraint(tls, pExpr, pItem) != 0 {
 147373 				Xsqlite3ExprIfFalse(tls, pParse, (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr, addrCont, SQLITE_JUMPIFNULL)
 147374 			}
 147375 		}
 147376 		if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IPK) != 0 {
 147377 			var r1 int32 = Xsqlite3GetTempReg(tls, pParse)
 147378 			Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iCur, r1)
 147379 			Xsqlite3VdbeAddOp4Int(tls, v, OP_FilterAdd, (*WhereLevel)(unsafe.Pointer(pLevel)).FregFilter, 0, r1, 1)
 147380 			Xsqlite3ReleaseTempReg(tls, pParse, r1)
 147381 		} else {
 147382 			var pIdx uintptr = *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8))
 147383 			var n int32 = int32(*(*U16)(unsafe.Pointer(pLoop + 24)))
 147384 			var r1 int32 = Xsqlite3GetTempRange(tls, pParse, n)
 147385 			var jj int32
 147386 			for jj = 0; jj < n; jj++ {
 147387 				Xsqlite3ExprCodeLoadIndexColumn(tls, pParse, pIdx, iCur, jj, r1+jj)
 147388 			}
 147389 			Xsqlite3VdbeAddOp4Int(tls, v, OP_FilterAdd, (*WhereLevel)(unsafe.Pointer(pLevel)).FregFilter, 0, r1, n)
 147390 			Xsqlite3ReleaseTempRange(tls, pParse, r1, n)
 147391 		}
 147392 		Xsqlite3VdbeResolveLabel(tls, v, addrCont)
 147393 		Xsqlite3VdbeAddOp2(tls, v, OP_Next, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, addrTop+1)
 147394 
 147395 		Xsqlite3VdbeJumpHere(tls, v, addrTop)
 147396 		*(*U32)(unsafe.Pointer(pLoop + 56)) &= libc.Uint32FromInt32(libc.CplInt32(WHERE_BLOOMFILTER))
 147397 		if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&U32(SQLITE_BloomPulldown) != U32(0) {
 147398 			break
 147399 		}
 147400 		for libc.PreIncInt32(&iLevel, 1) < int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) {
 147401 			var pTabItem uintptr
 147402 			pLevel = pWInfo + 856 + uintptr(iLevel)*104
 147403 			pTabItem = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104
 147404 			if int32((*SrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&(JT_LEFT|JT_LTORJ) != 0 {
 147405 				continue
 147406 			}
 147407 			pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop
 147408 			if pLoop == uintptr(0) {
 147409 				continue
 147410 			}
 147411 			if (*WhereLoop)(unsafe.Pointer(pLoop)).Fprereq&notReady != 0 {
 147412 				continue
 147413 			}
 147414 			if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_BLOOMFILTER|WHERE_COLUMN_IN) ==
 147415 				U32(WHERE_BLOOMFILTER) {
 147416 				break
 147417 			}
 147418 		}
 147419 	}
 147420 	Xsqlite3VdbeJumpHere(tls, v, addrOnce)
 147421 	(*Parse)(unsafe.Pointer(pParse)).FpIdxEpr = saved_pIdxEpr
 147422 }
 147423 
 147424 func allocateIndexInfo(tls *libc.TLS, pWInfo uintptr, pWC uintptr, mUnusable Bitmask, pSrc uintptr, pmNoOmit uintptr) uintptr {
 147425 	var i int32
 147426 	var j int32
 147427 	var nTerm int32
 147428 	var pParse uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse
 147429 	var pIdxCons uintptr
 147430 	var pIdxOrderBy uintptr
 147431 	var pUsage uintptr
 147432 	var pHidden uintptr
 147433 	var pTerm uintptr
 147434 	var nOrderBy int32
 147435 	var pIdxInfo uintptr
 147436 	var mNoOmit U16 = U16(0)
 147437 	var pTab uintptr
 147438 	var eDistinct int32 = 0
 147439 	var pOrderBy uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy
 147440 
 147441 	pTab = (*SrcItem)(unsafe.Pointer(pSrc)).FpTab
 147442 
 147443 	i = libc.AssignInt32(&nTerm, 0)
 147444 	pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa
 147445 __1:
 147446 	if !(i < (*WhereClause)(unsafe.Pointer(pWC)).FnTerm) {
 147447 		goto __3
 147448 	}
 147449 	{
 147450 		*(*U16)(unsafe.Pointer(pTerm + 18)) &= libc.Uint16FromInt32(libc.CplInt32(TERM_OK))
 147451 		if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor {
 147452 			goto __2
 147453 		}
 147454 		if (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight&mUnusable != 0 {
 147455 			goto __2
 147456 		}
 147457 
 147458 		if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&libc.CplInt32(WO_EQUIV) == 0 {
 147459 			goto __2
 147460 		}
 147461 		if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_VNULL != 0 {
 147462 			goto __2
 147463 		}
 147464 
 147465 		if int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&(JT_LEFT|JT_LTORJ|JT_RIGHT) != 0 &&
 147466 			!(constraintCompatibleWithOuterJoin(tls, pTerm, pSrc) != 0) {
 147467 			goto __2
 147468 		}
 147469 		nTerm++
 147470 		*(*U16)(unsafe.Pointer(pTerm + 18)) |= U16(TERM_OK)
 147471 
 147472 	}
 147473 	goto __2
 147474 __2:
 147475 	i++
 147476 	pTerm += 56
 147477 	goto __1
 147478 	goto __3
 147479 __3:
 147480 	;
 147481 	nOrderBy = 0
 147482 	if pOrderBy != 0 {
 147483 		var n int32 = (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr
 147484 		for i = 0; i < n; i++ {
 147485 			var pExpr uintptr = (*ExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32)).FpExpr
 147486 			var pE2 uintptr
 147487 
 147488 			if Xsqlite3ExprIsConstant(tls, pExpr) != 0 {
 147489 				continue
 147490 			}
 147491 
 147492 			if int32((*ExprList_item)(unsafe.Pointer(pOrderBy+8+uintptr(i)*32)).Ffg.FsortFlags)&KEYINFO_ORDER_BIGNULL != 0 {
 147493 				break
 147494 			}
 147495 
 147496 			if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN && (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor {
 147497 				continue
 147498 			}
 147499 
 147500 			if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLLATE &&
 147501 				int32((*Expr)(unsafe.Pointer(libc.AssignUintptr(&pE2, (*Expr)(unsafe.Pointer(pExpr)).FpLeft))).Fop) == TK_COLUMN &&
 147502 				(*Expr)(unsafe.Pointer(pE2)).FiTable == (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor {
 147503 				var zColl uintptr
 147504 
 147505 				(*Expr)(unsafe.Pointer(pExpr)).FiColumn = (*Expr)(unsafe.Pointer(pE2)).FiColumn
 147506 				if int32((*Expr)(unsafe.Pointer(pE2)).FiColumn) < 0 {
 147507 					continue
 147508 				}
 147509 				zColl = Xsqlite3ColumnColl(tls, (*Table)(unsafe.Pointer(pTab)).FaCol+uintptr((*Expr)(unsafe.Pointer(pE2)).FiColumn)*24)
 147510 				if zColl == uintptr(0) {
 147511 					zColl = uintptr(unsafe.Pointer(&Xsqlite3StrBINARY))
 147512 				}
 147513 				if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), zColl) == 0 {
 147514 					continue
 147515 				}
 147516 			}
 147517 
 147518 			break
 147519 		}
 147520 		if i == n {
 147521 			nOrderBy = n
 147522 			if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_DISTINCTBY != 0 {
 147523 				eDistinct = 2 + libc.Bool32(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_SORTBYGROUP != 0)
 147524 			} else if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_GROUPBY != 0 {
 147525 				eDistinct = 1
 147526 			}
 147527 		}
 147528 	}
 147529 
 147530 	pIdxInfo = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Sqlite3_index_info{}))+
 147531 		(uint64(unsafe.Sizeof(sqlite3_index_constraint{}))+uint64(unsafe.Sizeof(sqlite3_index_constraint_usage{})))*uint64(nTerm)+
 147532 		uint64(unsafe.Sizeof(sqlite3_index_orderby{}))*uint64(nOrderBy)+uint64(unsafe.Sizeof(HiddenIndexInfo1{}))+
 147533 		uint64(unsafe.Sizeof(uintptr(0)))*uint64(nTerm))
 147534 	if pIdxInfo == uintptr(0) {
 147535 		Xsqlite3ErrorMsg(tls, pParse, ts+1480, 0)
 147536 		return uintptr(0)
 147537 	}
 147538 	pHidden = pIdxInfo + 1*96
 147539 	pIdxCons = pHidden + 32 + uintptr(nTerm)*8
 147540 	pIdxOrderBy = pIdxCons + uintptr(nTerm)*12
 147541 	pUsage = pIdxOrderBy + uintptr(nOrderBy)*8
 147542 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint = pIdxCons
 147543 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy = pIdxOrderBy
 147544 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage = pUsage
 147545 	(*HiddenIndexInfo1)(unsafe.Pointer(pHidden)).FpWC = pWC
 147546 	(*HiddenIndexInfo1)(unsafe.Pointer(pHidden)).FpParse = pParse
 147547 	(*HiddenIndexInfo1)(unsafe.Pointer(pHidden)).FeDistinct = eDistinct
 147548 	(*HiddenIndexInfo1)(unsafe.Pointer(pHidden)).FmIn = U32(0)
 147549 	i = libc.AssignInt32(&j, 0)
 147550 	pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa
 147551 __4:
 147552 	if !(i < (*WhereClause)(unsafe.Pointer(pWC)).FnTerm) {
 147553 		goto __6
 147554 	}
 147555 	{
 147556 		var op U16
 147557 		if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_OK == 0 {
 147558 			goto __5
 147559 		}
 147560 		(*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).FiColumn = *(*int32)(unsafe.Pointer(pTerm + 32))
 147561 		(*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).FiTermOffset = i
 147562 		op = U16(int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_ALL)
 147563 		if int32(op) == WO_IN {
 147564 			if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_SLICE == 0 {
 147565 				*(*U32)(unsafe.Pointer(pHidden + 20)) |= func() uint32 {
 147566 					if j <= 31 {
 147567 						return uint32(1) << j
 147568 					}
 147569 					return uint32(0)
 147570 				}()
 147571 			}
 147572 			op = U16(WO_EQ)
 147573 		}
 147574 		if int32(op) == WO_AUX {
 147575 			(*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = (*WhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp
 147576 		} else if int32(op)&(WO_ISNULL|WO_IS) != 0 {
 147577 			if int32(op) == WO_ISNULL {
 147578 				(*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = uint8(SQLITE_INDEX_CONSTRAINT_ISNULL)
 147579 			} else {
 147580 				(*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = uint8(SQLITE_INDEX_CONSTRAINT_IS)
 147581 			}
 147582 		} else {
 147583 			(*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = U8(op)
 147584 
 147585 			if int32(op)&(int32(WO_EQ)<<(TK_LT-TK_EQ)|int32(WO_EQ)<<(TK_LE-TK_EQ)|int32(WO_EQ)<<(TK_GT-TK_EQ)|int32(WO_EQ)<<(TK_GE-TK_EQ)) != 0 &&
 147586 				Xsqlite3ExprIsVector(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight) != 0 {
 147587 				if j < 16 {
 147588 					mNoOmit = U16(int32(mNoOmit) | int32(1)<<j)
 147589 				}
 147590 				if int32(op) == int32(WO_EQ)<<(TK_LT-TK_EQ) {
 147591 					(*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = uint8(int32(WO_EQ) << (TK_LE - TK_EQ))
 147592 				}
 147593 				if int32(op) == int32(WO_EQ)<<(TK_GT-TK_EQ) {
 147594 					(*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = uint8(int32(WO_EQ) << (TK_GE - TK_EQ))
 147595 				}
 147596 			}
 147597 		}
 147598 
 147599 		j++
 147600 
 147601 	}
 147602 	goto __5
 147603 __5:
 147604 	i++
 147605 	pTerm += 56
 147606 	goto __4
 147607 	goto __6
 147608 __6:
 147609 	;
 147610 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint = j
 147611 	for i = libc.AssignInt32(&j, 0); i < nOrderBy; i++ {
 147612 		var pExpr uintptr = (*ExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32)).FpExpr
 147613 		if Xsqlite3ExprIsConstant(tls, pExpr) != 0 {
 147614 			continue
 147615 		}
 147616 
 147617 		(*sqlite3_index_orderby)(unsafe.Pointer(pIdxOrderBy + uintptr(j)*8)).FiColumn = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)
 147618 		(*sqlite3_index_orderby)(unsafe.Pointer(pIdxOrderBy + uintptr(j)*8)).Fdesc = uint8(int32((*ExprList_item)(unsafe.Pointer(pOrderBy+8+uintptr(i)*32)).Ffg.FsortFlags) & KEYINFO_ORDER_DESC)
 147619 		j++
 147620 	}
 147621 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnOrderBy = j
 147622 
 147623 	*(*U16)(unsafe.Pointer(pmNoOmit)) = mNoOmit
 147624 	return pIdxInfo
 147625 }
 147626 
 147627 func freeIndexInfo(tls *libc.TLS, db uintptr, pIdxInfo uintptr) {
 147628 	var pHidden uintptr
 147629 	var i int32
 147630 
 147631 	pHidden = pIdxInfo + 1*96
 147632 
 147633 	for i = 0; i < (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint; i++ {
 147634 		Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(pHidden + 32 + uintptr(i)*8)))
 147635 		*(*uintptr)(unsafe.Pointer(pHidden + 32 + uintptr(i)*8)) = uintptr(0)
 147636 	}
 147637 	Xsqlite3DbFree(tls, db, pIdxInfo)
 147638 }
 147639 
 147640 func vtabBestIndex(tls *libc.TLS, pParse uintptr, pTab uintptr, p uintptr) int32 {
 147641 	bp := tls.Alloc(16)
 147642 	defer tls.Free(16)
 147643 
 147644 	var pVtab uintptr = (*VTable)(unsafe.Pointer(Xsqlite3GetVTable(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pTab))).FpVtab
 147645 	var rc int32
 147646 
 147647 	(*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FnSchemaLock++
 147648 	rc = (*struct {
 147649 		f func(*libc.TLS, uintptr, uintptr) int32
 147650 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_module)(unsafe.Pointer((*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FpModule)).FxBestIndex})).f(tls, pVtab, p)
 147651 	(*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FnSchemaLock--
 147652 
 147653 	if rc != SQLITE_OK && rc != SQLITE_CONSTRAINT {
 147654 		if rc == SQLITE_NOMEM {
 147655 			Xsqlite3OomFault(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb)
 147656 		} else if !(int32((*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg) != 0) {
 147657 			Xsqlite3ErrorMsg(tls, pParse, ts+4493, libc.VaList(bp, Xsqlite3ErrStr(tls, rc)))
 147658 		} else {
 147659 			Xsqlite3ErrorMsg(tls, pParse, ts+4493, libc.VaList(bp+8, (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg))
 147660 		}
 147661 	}
 147662 	Xsqlite3_free(tls, (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg)
 147663 	(*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = uintptr(0)
 147664 	return rc
 147665 }
 147666 
 147667 func whereKeyStats(tls *libc.TLS, pParse uintptr, pIdx uintptr, pRec uintptr, roundUp int32, aStat uintptr) int32 {
 147668 	var aSample uintptr = (*Index)(unsafe.Pointer(pIdx)).FaSample
 147669 	var iCol int32
 147670 	var i int32
 147671 	var iSample int32
 147672 	var iMin int32 = 0
 147673 	var iTest int32
 147674 	var res int32
 147675 	var nField int32
 147676 	var iLower TRowcnt = uint64(0)
 147677 
 147678 	_ = pParse
 147679 
 147680 	if !((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) && int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY {
 147681 		nField = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
 147682 	} else {
 147683 		nField = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
 147684 	}
 147685 	nField = func() int32 {
 147686 		if int32((*UnpackedRecord)(unsafe.Pointer(pRec)).FnField) < nField {
 147687 			return int32((*UnpackedRecord)(unsafe.Pointer(pRec)).FnField)
 147688 		}
 147689 		return nField
 147690 	}()
 147691 	iCol = 0
 147692 	iSample = (*Index)(unsafe.Pointer(pIdx)).FnSample * nField
 147693 	for __ccgo := true; __ccgo; __ccgo = res != 0 && iMin < iSample {
 147694 		var iSamp int32
 147695 		var n int32
 147696 
 147697 		iTest = (iMin + iSample) / 2
 147698 		iSamp = iTest / nField
 147699 		if iSamp > 0 {
 147700 			for n = iTest%nField + 1; n < nField; n++ {
 147701 				if *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp-1)*40)).FanLt + uintptr(n-1)*8)) != *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp)*40)).FanLt + uintptr(n-1)*8)) {
 147702 					break
 147703 				}
 147704 			}
 147705 		} else {
 147706 			n = iTest + 1
 147707 		}
 147708 
 147709 		(*UnpackedRecord)(unsafe.Pointer(pRec)).FnField = U16(n)
 147710 		res = Xsqlite3VdbeRecordCompare(tls, (*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp)*40)).Fn, (*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp)*40)).Fp, pRec)
 147711 		if res < 0 {
 147712 			iLower = *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp)*40)).FanLt + uintptr(n-1)*8)) + *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp)*40)).FanEq + uintptr(n-1)*8))
 147713 			iMin = iTest + 1
 147714 		} else if res == 0 && n < nField {
 147715 			iLower = *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp)*40)).FanLt + uintptr(n-1)*8))
 147716 			iMin = iTest + 1
 147717 			res = -1
 147718 		} else {
 147719 			iSample = iTest
 147720 			iCol = n - 1
 147721 		}
 147722 	}
 147723 	i = iSample / nField
 147724 
 147725 	if res == 0 {
 147726 		*(*TRowcnt)(unsafe.Pointer(aStat)) = *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(i)*40)).FanLt + uintptr(iCol)*8))
 147727 		*(*TRowcnt)(unsafe.Pointer(aStat + 1*8)) = *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(i)*40)).FanEq + uintptr(iCol)*8))
 147728 	} else {
 147729 		var iUpper TRowcnt
 147730 		var iGap TRowcnt
 147731 		if i >= (*Index)(unsafe.Pointer(pIdx)).FnSample {
 147732 			iUpper = (*Index)(unsafe.Pointer(pIdx)).FnRowEst0
 147733 		} else {
 147734 			iUpper = *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(i)*40)).FanLt + uintptr(iCol)*8))
 147735 		}
 147736 
 147737 		if iLower >= iUpper {
 147738 			iGap = uint64(0)
 147739 		} else {
 147740 			iGap = iUpper - iLower
 147741 		}
 147742 		if roundUp != 0 {
 147743 			iGap = iGap * uint64(2) / uint64(3)
 147744 		} else {
 147745 			iGap = iGap / uint64(3)
 147746 		}
 147747 		*(*TRowcnt)(unsafe.Pointer(aStat)) = iLower + iGap
 147748 		*(*TRowcnt)(unsafe.Pointer(aStat + 1*8)) = *(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaAvgEq + uintptr(nField-1)*8))
 147749 	}
 147750 
 147751 	(*UnpackedRecord)(unsafe.Pointer(pRec)).FnField = U16(nField)
 147752 	return i
 147753 }
 147754 
 147755 func whereRangeAdjust(tls *libc.TLS, pTerm uintptr, nNew LogEst) LogEst {
 147756 	var nRet LogEst = nNew
 147757 	if pTerm != 0 {
 147758 		if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb) <= 0 {
 147759 			nRet = LogEst(int32(nRet) + int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb))
 147760 		} else if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_VNULL == 0 {
 147761 			nRet = int16(int32(nRet) - 20)
 147762 		}
 147763 	}
 147764 	return nRet
 147765 }
 147766 
 147767 // Return the affinity for a single column of an index.
 147768 func Xsqlite3IndexColumnAffinity(tls *libc.TLS, db uintptr, pIdx uintptr, iCol int32) int8 {
 147769 	if !(int32((*Index)(unsafe.Pointer(pIdx)).FzColAff) != 0) {
 147770 		if Xsqlite3IndexAffinityStr(tls, db, pIdx) == uintptr(0) {
 147771 			return int8(SQLITE_AFF_BLOB)
 147772 		}
 147773 	}
 147774 
 147775 	return *(*int8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FzColAff + uintptr(iCol)))
 147776 }
 147777 
 147778 func whereRangeSkipScanEst(tls *libc.TLS, pParse uintptr, pLower uintptr, pUpper uintptr, pLoop uintptr, pbDone uintptr) int32 {
 147779 	bp := tls.Alloc(24)
 147780 	defer tls.Free(24)
 147781 
 147782 	var p uintptr = *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8))
 147783 	var nEq int32 = int32(*(*U16)(unsafe.Pointer(pLoop + 24)))
 147784 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 147785 	var nLower int32 = -1
 147786 	var nUpper int32 = (*Index)(unsafe.Pointer(p)).FnSample + 1
 147787 	var rc int32 = SQLITE_OK
 147788 	var aff U8 = U8(Xsqlite3IndexColumnAffinity(tls, db, p, nEq))
 147789 	var pColl uintptr
 147790 
 147791 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 147792 	*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 147793 	*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
 147794 
 147795 	pColl = Xsqlite3LocateCollSeq(tls, pParse, *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(p)).FazColl + uintptr(nEq)*8)))
 147796 	if pLower != 0 {
 147797 		rc = Xsqlite3Stat4ValueFromExpr(tls, pParse, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pLower)).FpExpr)).FpRight, aff, bp)
 147798 		nLower = 0
 147799 	}
 147800 	if pUpper != 0 && rc == SQLITE_OK {
 147801 		rc = Xsqlite3Stat4ValueFromExpr(tls, pParse, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pUpper)).FpExpr)).FpRight, aff, bp+8)
 147802 		if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 {
 147803 			nUpper = 0
 147804 		} else {
 147805 			nUpper = (*Index)(unsafe.Pointer(p)).FnSample
 147806 		}
 147807 	}
 147808 
 147809 	if *(*uintptr)(unsafe.Pointer(bp)) != 0 || *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 {
 147810 		var i int32
 147811 		var nDiff int32
 147812 		for i = 0; rc == SQLITE_OK && i < (*Index)(unsafe.Pointer(p)).FnSample; i++ {
 147813 			rc = Xsqlite3Stat4Column(tls, db, (*IndexSample)(unsafe.Pointer((*Index)(unsafe.Pointer(p)).FaSample+uintptr(i)*40)).Fp, (*IndexSample)(unsafe.Pointer((*Index)(unsafe.Pointer(p)).FaSample+uintptr(i)*40)).Fn, nEq, bp+16)
 147814 			if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp)) != 0 {
 147815 				var res int32 = Xsqlite3MemCompare(tls, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 16)), pColl)
 147816 				if res >= 0 {
 147817 					nLower++
 147818 				}
 147819 			}
 147820 			if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 {
 147821 				var res int32 = Xsqlite3MemCompare(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 16)), pColl)
 147822 				if res >= 0 {
 147823 					nUpper++
 147824 				}
 147825 			}
 147826 		}
 147827 		nDiff = nUpper - nLower
 147828 		if nDiff <= 0 {
 147829 			nDiff = 1
 147830 		}
 147831 
 147832 		if nDiff != 1 || pUpper == uintptr(0) || pLower == uintptr(0) {
 147833 			var nAdjust int32 = int32(Xsqlite3LogEst(tls, uint64((*Index)(unsafe.Pointer(p)).FnSample))) - int32(Xsqlite3LogEst(tls, uint64(nDiff)))
 147834 			*(*LogEst)(unsafe.Pointer(pLoop + 22)) -= LogEst(nAdjust)
 147835 			*(*int32)(unsafe.Pointer(pbDone)) = 1
 147836 
 147837 		}
 147838 
 147839 	} else {
 147840 	}
 147841 
 147842 	Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp)))
 147843 	Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
 147844 	Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
 147845 
 147846 	return rc
 147847 }
 147848 
 147849 func whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower uintptr, pUpper uintptr, pLoop uintptr) int32 {
 147850 	bp := tls.Alloc(36)
 147851 	defer tls.Free(36)
 147852 
 147853 	var rc int32 = SQLITE_OK
 147854 	var nOut int32 = int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnOut)
 147855 	var nNew LogEst
 147856 
 147857 	var p uintptr = *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8))
 147858 	var nEq int32 = int32(*(*U16)(unsafe.Pointer(pLoop + 24)))
 147859 
 147860 	if (*Index)(unsafe.Pointer(p)).FnSample > 0 && nEq < (*Index)(unsafe.Pointer(p)).FnSampleCol &&
 147861 		(*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&U32(SQLITE_Stat4) == U32(0) {
 147862 		if nEq == (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid {
 147863 			*(*uintptr)(unsafe.Pointer(bp + 16)) = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec
 147864 
 147865 			var nBtm int32 = int32(*(*U16)(unsafe.Pointer(pLoop + 24 + 2)))
 147866 			var nTop int32 = int32(*(*U16)(unsafe.Pointer(pLoop + 24 + 4)))
 147867 
 147868 			var iLower TRowcnt
 147869 			var iUpper TRowcnt
 147870 			var iLwrIdx int32 = -2
 147871 			var iUprIdx int32 = -1
 147872 
 147873 			if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 {
 147874 				(*UnpackedRecord)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnField = U16((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid)
 147875 			}
 147876 
 147877 			if nEq == 0 {
 147878 				iLower = uint64(0)
 147879 				iUpper = (*Index)(unsafe.Pointer(p)).FnRowEst0
 147880 			} else {
 147881 				whereKeyStats(tls, pParse, p, *(*uintptr)(unsafe.Pointer(bp + 16)), 0, bp)
 147882 				iLower = *(*TRowcnt)(unsafe.Pointer(bp))
 147883 				iUpper = *(*TRowcnt)(unsafe.Pointer(bp)) + *(*TRowcnt)(unsafe.Pointer(bp + 1*8))
 147884 			}
 147885 
 147886 			if *(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(p)).FaSortOrder + uintptr(nEq))) != 0 {
 147887 				{
 147888 					var t uintptr = pLower
 147889 					pLower = pUpper
 147890 					pUpper = t
 147891 				}
 147892 
 147893 				{
 147894 					var t int32 = nBtm
 147895 					nBtm = nTop
 147896 					nTop = t
 147897 				}
 147898 
 147899 			}
 147900 
 147901 			if pLower != 0 {
 147902 				var pExpr uintptr = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pLower)).FpExpr)).FpRight
 147903 				rc = Xsqlite3Stat4ProbeSetValue(tls, pParse, p, bp+16, pExpr, nBtm, nEq, bp+24)
 147904 				if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 24)) != 0 {
 147905 					var iNew TRowcnt
 147906 					var mask U16 = U16(int32(WO_EQ)<<(TK_GT-TK_EQ) | int32(WO_EQ)<<(TK_LE-TK_EQ))
 147907 					if Xsqlite3ExprVectorSize(tls, pExpr) > *(*int32)(unsafe.Pointer(bp + 24)) {
 147908 						mask = U16(int32(WO_EQ)<<(TK_LE-TK_EQ) | int32(WO_EQ)<<(TK_LT-TK_EQ))
 147909 					}
 147910 					iLwrIdx = whereKeyStats(tls, pParse, p, *(*uintptr)(unsafe.Pointer(bp + 16)), 0, bp)
 147911 					iNew = *(*TRowcnt)(unsafe.Pointer(bp)) + func() uint64 {
 147912 						if int32((*WhereTerm)(unsafe.Pointer(pLower)).FeOperator)&int32(mask) != 0 {
 147913 							return *(*TRowcnt)(unsafe.Pointer(bp + 1*8))
 147914 						}
 147915 						return uint64(0)
 147916 					}()
 147917 					if iNew > iLower {
 147918 						iLower = iNew
 147919 					}
 147920 					nOut--
 147921 					pLower = uintptr(0)
 147922 				}
 147923 			}
 147924 
 147925 			if pUpper != 0 {
 147926 				var pExpr uintptr = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pUpper)).FpExpr)).FpRight
 147927 				rc = Xsqlite3Stat4ProbeSetValue(tls, pParse, p, bp+16, pExpr, nTop, nEq, bp+28)
 147928 				if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 28)) != 0 {
 147929 					var iNew TRowcnt
 147930 					var mask U16 = U16(int32(WO_EQ)<<(TK_GT-TK_EQ) | int32(WO_EQ)<<(TK_LE-TK_EQ))
 147931 					if Xsqlite3ExprVectorSize(tls, pExpr) > *(*int32)(unsafe.Pointer(bp + 28)) {
 147932 						mask = U16(int32(WO_EQ)<<(TK_LE-TK_EQ) | int32(WO_EQ)<<(TK_LT-TK_EQ))
 147933 					}
 147934 					iUprIdx = whereKeyStats(tls, pParse, p, *(*uintptr)(unsafe.Pointer(bp + 16)), 1, bp)
 147935 					iNew = *(*TRowcnt)(unsafe.Pointer(bp)) + func() uint64 {
 147936 						if int32((*WhereTerm)(unsafe.Pointer(pUpper)).FeOperator)&int32(mask) != 0 {
 147937 							return *(*TRowcnt)(unsafe.Pointer(bp + 1*8))
 147938 						}
 147939 						return uint64(0)
 147940 					}()
 147941 					if iNew < iUpper {
 147942 						iUpper = iNew
 147943 					}
 147944 					nOut--
 147945 					pUpper = uintptr(0)
 147946 				}
 147947 			}
 147948 
 147949 			(*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec = *(*uintptr)(unsafe.Pointer(bp + 16))
 147950 			if rc == SQLITE_OK {
 147951 				if iUpper > iLower {
 147952 					nNew = Xsqlite3LogEst(tls, iUpper-iLower)
 147953 
 147954 					if iLwrIdx == iUprIdx {
 147955 						nNew = int16(int32(nNew) - 20)
 147956 					}
 147957 				} else {
 147958 					nNew = int16(10)
 147959 				}
 147960 				if int32(nNew) < nOut {
 147961 					nOut = int32(nNew)
 147962 				}
 147963 
 147964 			}
 147965 		} else {
 147966 			*(*int32)(unsafe.Pointer(bp + 32)) = 0
 147967 			rc = whereRangeSkipScanEst(tls, pParse, pLower, pUpper, pLoop, bp+32)
 147968 			if *(*int32)(unsafe.Pointer(bp + 32)) != 0 {
 147969 				return rc
 147970 			}
 147971 		}
 147972 	}
 147973 
 147974 	nNew = whereRangeAdjust(tls, pLower, int16(nOut))
 147975 	nNew = whereRangeAdjust(tls, pUpper, nNew)
 147976 
 147977 	if pLower != 0 && int32((*WhereTerm)(unsafe.Pointer(pLower)).FtruthProb) > 0 && pUpper != 0 && int32((*WhereTerm)(unsafe.Pointer(pUpper)).FtruthProb) > 0 {
 147978 		nNew = int16(int32(nNew) - 20)
 147979 	}
 147980 
 147981 	nOut = nOut - (libc.Bool32(pLower != uintptr(0)) + libc.Bool32(pUpper != uintptr(0)))
 147982 	if int32(nNew) < 10 {
 147983 		nNew = int16(10)
 147984 	}
 147985 	if int32(nNew) < nOut {
 147986 		nOut = int32(nNew)
 147987 	}
 147988 	(*WhereLoop)(unsafe.Pointer(pLoop)).FnOut = LogEst(nOut)
 147989 	return rc
 147990 }
 147991 
 147992 func whereEqualScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pExpr uintptr, pnRow uintptr) int32 {
 147993 	bp := tls.Alloc(32)
 147994 	defer tls.Free(32)
 147995 
 147996 	var p uintptr = *(*uintptr)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew + 24 + 8))
 147997 	var nEq int32 = int32(*(*U16)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew + 24)))
 147998 	*(*uintptr)(unsafe.Pointer(bp)) = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec
 147999 	var rc int32
 148000 
 148001 	if (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid < nEq-1 {
 148002 		return SQLITE_NOTFOUND
 148003 	}
 148004 
 148005 	if nEq >= int32((*Index)(unsafe.Pointer(p)).FnColumn) {
 148006 		*(*TRowcnt)(unsafe.Pointer(pnRow)) = uint64(1)
 148007 		return SQLITE_OK
 148008 	}
 148009 
 148010 	rc = Xsqlite3Stat4ProbeSetValue(tls, pParse, p, bp, pExpr, 1, nEq-1, bp+8)
 148011 	(*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec = *(*uintptr)(unsafe.Pointer(bp))
 148012 	if rc != SQLITE_OK {
 148013 		return rc
 148014 	}
 148015 	if *(*int32)(unsafe.Pointer(bp + 8)) == 0 {
 148016 		return SQLITE_NOTFOUND
 148017 	}
 148018 	(*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid = nEq
 148019 
 148020 	whereKeyStats(tls, pParse, p, *(*uintptr)(unsafe.Pointer(bp)), 0, bp+16)
 148021 
 148022 	*(*TRowcnt)(unsafe.Pointer(pnRow)) = *(*TRowcnt)(unsafe.Pointer(bp + 16 + 1*8))
 148023 
 148024 	return rc
 148025 }
 148026 
 148027 func whereInScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pList uintptr, pnRow uintptr) int32 {
 148028 	bp := tls.Alloc(8)
 148029 	defer tls.Free(8)
 148030 
 148031 	var p uintptr = *(*uintptr)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew + 24 + 8))
 148032 	var nRow0 I64 = I64(Xsqlite3LogEstToInt(tls, *(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(p)).FaiRowLogEst))))
 148033 	var nRecValid int32 = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid
 148034 	var rc int32 = SQLITE_OK
 148035 
 148036 	var nRowEst TRowcnt = uint64(0)
 148037 	var i int32
 148038 
 148039 	for i = 0; rc == SQLITE_OK && i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ {
 148040 		*(*TRowcnt)(unsafe.Pointer(bp)) = TRowcnt(nRow0)
 148041 		rc = whereEqualScanEst(tls, pParse, pBuilder, (*ExprList_item)(unsafe.Pointer(pList+8+uintptr(i)*32)).FpExpr, bp)
 148042 		nRowEst = nRowEst + *(*TRowcnt)(unsafe.Pointer(bp))
 148043 		(*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid = nRecValid
 148044 	}
 148045 
 148046 	if rc == SQLITE_OK {
 148047 		if nRowEst > TRowcnt(nRow0) {
 148048 			nRowEst = TRowcnt(nRow0)
 148049 		}
 148050 		*(*TRowcnt)(unsafe.Pointer(pnRow)) = nRowEst
 148051 
 148052 	}
 148053 
 148054 	return rc
 148055 }
 148056 
 148057 func whereLoopInit(tls *libc.TLS, p uintptr) {
 148058 	(*WhereLoop)(unsafe.Pointer(p)).FaLTerm = p + 88
 148059 	(*WhereLoop)(unsafe.Pointer(p)).FnLTerm = U16(0)
 148060 	(*WhereLoop)(unsafe.Pointer(p)).FnLSlot = U16(int32(uint64(unsafe.Sizeof([3]uintptr{})) / uint64(unsafe.Sizeof(uintptr(0)))))
 148061 	(*WhereLoop)(unsafe.Pointer(p)).FwsFlags = U32(0)
 148062 }
 148063 
 148064 func whereLoopClearUnion(tls *libc.TLS, db uintptr, p uintptr) {
 148065 	if (*WhereLoop)(unsafe.Pointer(p)).FwsFlags&U32(WHERE_VIRTUALTABLE|WHERE_AUTO_INDEX) != 0 {
 148066 		if (*WhereLoop)(unsafe.Pointer(p)).FwsFlags&U32(WHERE_VIRTUALTABLE) != U32(0) && U32(int32(*(*uint8)(unsafe.Pointer(p + 24 + 4))&0x1>>0)) != 0 {
 148067 			Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(p + 24 + 16)))
 148068 			libc.SetBitFieldPtr8Uint32(p+24+4, U32(0), 0, 0x1)
 148069 			*(*uintptr)(unsafe.Pointer(p + 24 + 16)) = uintptr(0)
 148070 		} else if (*WhereLoop)(unsafe.Pointer(p)).FwsFlags&U32(WHERE_AUTO_INDEX) != U32(0) && *(*uintptr)(unsafe.Pointer(p + 24 + 8)) != uintptr(0) {
 148071 			Xsqlite3DbFree(tls, db, (*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 24 + 8)))).FzColAff)
 148072 			Xsqlite3DbFreeNN(tls, db, *(*uintptr)(unsafe.Pointer(p + 24 + 8)))
 148073 			*(*uintptr)(unsafe.Pointer(p + 24 + 8)) = uintptr(0)
 148074 		}
 148075 	}
 148076 }
 148077 
 148078 func whereLoopClear(tls *libc.TLS, db uintptr, p uintptr) {
 148079 	if (*WhereLoop)(unsafe.Pointer(p)).FaLTerm != p+88 {
 148080 		Xsqlite3DbFreeNN(tls, db, (*WhereLoop)(unsafe.Pointer(p)).FaLTerm)
 148081 		(*WhereLoop)(unsafe.Pointer(p)).FaLTerm = p + 88
 148082 		(*WhereLoop)(unsafe.Pointer(p)).FnLSlot = U16(int32(uint64(unsafe.Sizeof([3]uintptr{})) / uint64(unsafe.Sizeof(uintptr(0)))))
 148083 	}
 148084 	whereLoopClearUnion(tls, db, p)
 148085 	(*WhereLoop)(unsafe.Pointer(p)).FnLTerm = U16(0)
 148086 	(*WhereLoop)(unsafe.Pointer(p)).FwsFlags = U32(0)
 148087 }
 148088 
 148089 func whereLoopResize(tls *libc.TLS, db uintptr, p uintptr, n int32) int32 {
 148090 	var paNew uintptr
 148091 	if int32((*WhereLoop)(unsafe.Pointer(p)).FnLSlot) >= n {
 148092 		return SQLITE_OK
 148093 	}
 148094 	n = (n + 7) & libc.CplInt32(7)
 148095 	paNew = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(uintptr(0)))*uint64(n))
 148096 	if paNew == uintptr(0) {
 148097 		return SQLITE_NOMEM
 148098 	}
 148099 	libc.Xmemcpy(tls, paNew, (*WhereLoop)(unsafe.Pointer(p)).FaLTerm, uint64(unsafe.Sizeof(uintptr(0)))*uint64((*WhereLoop)(unsafe.Pointer(p)).FnLSlot))
 148100 	if (*WhereLoop)(unsafe.Pointer(p)).FaLTerm != p+88 {
 148101 		Xsqlite3DbFreeNN(tls, db, (*WhereLoop)(unsafe.Pointer(p)).FaLTerm)
 148102 	}
 148103 	(*WhereLoop)(unsafe.Pointer(p)).FaLTerm = paNew
 148104 	(*WhereLoop)(unsafe.Pointer(p)).FnLSlot = U16(n)
 148105 	return SQLITE_OK
 148106 }
 148107 
 148108 func whereLoopXfer(tls *libc.TLS, db uintptr, pTo uintptr, pFrom uintptr) int32 {
 148109 	whereLoopClearUnion(tls, db, pTo)
 148110 	if int32((*WhereLoop)(unsafe.Pointer(pFrom)).FnLTerm) > int32((*WhereLoop)(unsafe.Pointer(pTo)).FnLSlot) &&
 148111 		whereLoopResize(tls, db, pTo, int32((*WhereLoop)(unsafe.Pointer(pFrom)).FnLTerm)) != 0 {
 148112 		libc.Xmemset(tls, pTo, 0, uint64(uintptr(0)+64))
 148113 		return SQLITE_NOMEM
 148114 	}
 148115 	libc.Xmemcpy(tls, pTo, pFrom, uint64(uintptr(0)+64))
 148116 	libc.Xmemcpy(tls, (*WhereLoop)(unsafe.Pointer(pTo)).FaLTerm, (*WhereLoop)(unsafe.Pointer(pFrom)).FaLTerm, uint64((*WhereLoop)(unsafe.Pointer(pTo)).FnLTerm)*uint64(unsafe.Sizeof(uintptr(0))))
 148117 	if (*WhereLoop)(unsafe.Pointer(pFrom)).FwsFlags&U32(WHERE_VIRTUALTABLE) != 0 {
 148118 		libc.SetBitFieldPtr8Uint32(pFrom+24+4, U32(0), 0, 0x1)
 148119 	} else if (*WhereLoop)(unsafe.Pointer(pFrom)).FwsFlags&U32(WHERE_AUTO_INDEX) != U32(0) {
 148120 		*(*uintptr)(unsafe.Pointer(pFrom + 24 + 8)) = uintptr(0)
 148121 	}
 148122 	return SQLITE_OK
 148123 }
 148124 
 148125 func whereLoopDelete(tls *libc.TLS, db uintptr, p uintptr) {
 148126 	whereLoopClear(tls, db, p)
 148127 	Xsqlite3DbNNFreeNN(tls, db, p)
 148128 }
 148129 
 148130 func whereInfoFree(tls *libc.TLS, db uintptr, pWInfo uintptr) {
 148131 	Xsqlite3WhereClauseClear(tls, pWInfo+104)
 148132 	for (*WhereInfo)(unsafe.Pointer(pWInfo)).FpLoops != 0 {
 148133 		var p uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpLoops
 148134 		(*WhereInfo)(unsafe.Pointer(pWInfo)).FpLoops = (*WhereLoop)(unsafe.Pointer(p)).FpNextLoop
 148135 		whereLoopDelete(tls, db, p)
 148136 	}
 148137 	for (*WhereInfo)(unsafe.Pointer(pWInfo)).FpMemToFree != 0 {
 148138 		var pNext uintptr = (*WhereMemBlock)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpMemToFree)).FpNext
 148139 		Xsqlite3DbNNFreeNN(tls, db, (*WhereInfo)(unsafe.Pointer(pWInfo)).FpMemToFree)
 148140 		(*WhereInfo)(unsafe.Pointer(pWInfo)).FpMemToFree = pNext
 148141 	}
 148142 	Xsqlite3DbNNFreeNN(tls, db, pWInfo)
 148143 }
 148144 
 148145 func whereLoopCheaperProperSubset(tls *libc.TLS, pX uintptr, pY uintptr) int32 {
 148146 	var i int32
 148147 	var j int32
 148148 	if int32((*WhereLoop)(unsafe.Pointer(pX)).FnLTerm)-int32((*WhereLoop)(unsafe.Pointer(pX)).FnSkip) >= int32((*WhereLoop)(unsafe.Pointer(pY)).FnLTerm)-int32((*WhereLoop)(unsafe.Pointer(pY)).FnSkip) {
 148149 		return 0
 148150 	}
 148151 	if int32((*WhereLoop)(unsafe.Pointer(pX)).FrRun) > int32((*WhereLoop)(unsafe.Pointer(pY)).FrRun) && int32((*WhereLoop)(unsafe.Pointer(pX)).FnOut) > int32((*WhereLoop)(unsafe.Pointer(pY)).FnOut) {
 148152 		return 0
 148153 	}
 148154 	if int32((*WhereLoop)(unsafe.Pointer(pY)).FnSkip) > int32((*WhereLoop)(unsafe.Pointer(pX)).FnSkip) {
 148155 		return 0
 148156 	}
 148157 	for i = int32((*WhereLoop)(unsafe.Pointer(pX)).FnLTerm) - 1; i >= 0; i-- {
 148158 		if *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pX)).FaLTerm + uintptr(i)*8)) == uintptr(0) {
 148159 			continue
 148160 		}
 148161 		for j = int32((*WhereLoop)(unsafe.Pointer(pY)).FnLTerm) - 1; j >= 0; j-- {
 148162 			if *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pY)).FaLTerm + uintptr(j)*8)) == *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pX)).FaLTerm + uintptr(i)*8)) {
 148163 				break
 148164 			}
 148165 		}
 148166 		if j < 0 {
 148167 			return 0
 148168 		}
 148169 	}
 148170 	if (*WhereLoop)(unsafe.Pointer(pX)).FwsFlags&U32(WHERE_IDX_ONLY) != U32(0) &&
 148171 		(*WhereLoop)(unsafe.Pointer(pY)).FwsFlags&U32(WHERE_IDX_ONLY) == U32(0) {
 148172 		return 0
 148173 	}
 148174 	return 1
 148175 }
 148176 
 148177 func whereLoopAdjustCost(tls *libc.TLS, p uintptr, pTemplate uintptr) {
 148178 	if (*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags&U32(WHERE_INDEXED) == U32(0) {
 148179 		return
 148180 	}
 148181 	for ; p != 0; p = (*WhereLoop)(unsafe.Pointer(p)).FpNextLoop {
 148182 		if int32((*WhereLoop)(unsafe.Pointer(p)).FiTab) != int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FiTab) {
 148183 			continue
 148184 		}
 148185 		if (*WhereLoop)(unsafe.Pointer(p)).FwsFlags&U32(WHERE_INDEXED) == U32(0) {
 148186 			continue
 148187 		}
 148188 		if whereLoopCheaperProperSubset(tls, p, pTemplate) != 0 {
 148189 			(*WhereLoop)(unsafe.Pointer(pTemplate)).FrRun = func() int16 {
 148190 				if int32((*WhereLoop)(unsafe.Pointer(p)).FrRun) < int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FrRun) {
 148191 					return (*WhereLoop)(unsafe.Pointer(p)).FrRun
 148192 				}
 148193 				return (*WhereLoop)(unsafe.Pointer(pTemplate)).FrRun
 148194 			}()
 148195 			(*WhereLoop)(unsafe.Pointer(pTemplate)).FnOut = func() int16 {
 148196 				if int32((*WhereLoop)(unsafe.Pointer(p)).FnOut)-1 < int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FnOut) {
 148197 					return int16(int32((*WhereLoop)(unsafe.Pointer(p)).FnOut) - 1)
 148198 				}
 148199 				return (*WhereLoop)(unsafe.Pointer(pTemplate)).FnOut
 148200 			}()
 148201 		} else if whereLoopCheaperProperSubset(tls, pTemplate, p) != 0 {
 148202 			(*WhereLoop)(unsafe.Pointer(pTemplate)).FrRun = func() int16 {
 148203 				if int32((*WhereLoop)(unsafe.Pointer(p)).FrRun) > int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FrRun) {
 148204 					return (*WhereLoop)(unsafe.Pointer(p)).FrRun
 148205 				}
 148206 				return (*WhereLoop)(unsafe.Pointer(pTemplate)).FrRun
 148207 			}()
 148208 			(*WhereLoop)(unsafe.Pointer(pTemplate)).FnOut = func() int16 {
 148209 				if int32((*WhereLoop)(unsafe.Pointer(p)).FnOut)+1 > int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FnOut) {
 148210 					return int16(int32((*WhereLoop)(unsafe.Pointer(p)).FnOut) + 1)
 148211 				}
 148212 				return (*WhereLoop)(unsafe.Pointer(pTemplate)).FnOut
 148213 			}()
 148214 		}
 148215 	}
 148216 }
 148217 
 148218 func whereLoopFindLesser(tls *libc.TLS, ppPrev uintptr, pTemplate uintptr) uintptr {
 148219 	var p uintptr
 148220 	p = *(*uintptr)(unsafe.Pointer(ppPrev))
 148221 __1:
 148222 	if !(p != 0) {
 148223 		goto __3
 148224 	}
 148225 	{
 148226 		if int32((*WhereLoop)(unsafe.Pointer(p)).FiTab) != int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FiTab) || int32((*WhereLoop)(unsafe.Pointer(p)).FiSortIdx) != int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FiSortIdx) {
 148227 			goto __2
 148228 		}
 148229 
 148230 		if (*WhereLoop)(unsafe.Pointer(p)).FwsFlags&U32(WHERE_AUTO_INDEX) != U32(0) &&
 148231 			int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FnSkip) == 0 &&
 148232 			(*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags&U32(WHERE_INDEXED) != U32(0) &&
 148233 			(*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags&U32(WHERE_COLUMN_EQ) != U32(0) &&
 148234 			(*WhereLoop)(unsafe.Pointer(p)).Fprereq&(*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq == (*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq {
 148235 			goto __3
 148236 		}
 148237 
 148238 		if (*WhereLoop)(unsafe.Pointer(p)).Fprereq&(*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq == (*WhereLoop)(unsafe.Pointer(p)).Fprereq &&
 148239 			int32((*WhereLoop)(unsafe.Pointer(p)).FrSetup) <= int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FrSetup) &&
 148240 			int32((*WhereLoop)(unsafe.Pointer(p)).FrRun) <= int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FrRun) &&
 148241 			int32((*WhereLoop)(unsafe.Pointer(p)).FnOut) <= int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FnOut) {
 148242 			return uintptr(0)
 148243 		}
 148244 
 148245 		if (*WhereLoop)(unsafe.Pointer(p)).Fprereq&(*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq == (*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq &&
 148246 			int32((*WhereLoop)(unsafe.Pointer(p)).FrRun) >= int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FrRun) &&
 148247 			int32((*WhereLoop)(unsafe.Pointer(p)).FnOut) >= int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FnOut) {
 148248 			goto __3
 148249 		}
 148250 
 148251 	}
 148252 	goto __2
 148253 __2:
 148254 	ppPrev = p + 80
 148255 	p = *(*uintptr)(unsafe.Pointer(ppPrev))
 148256 	goto __1
 148257 	goto __3
 148258 __3:
 148259 	;
 148260 	return ppPrev
 148261 }
 148262 
 148263 func whereLoopInsert(tls *libc.TLS, pBuilder uintptr, pTemplate uintptr) int32 {
 148264 	var ppPrev uintptr
 148265 	var p uintptr
 148266 	var pWInfo uintptr = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo
 148267 	var db uintptr = (*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb
 148268 	var rc int32
 148269 
 148270 	if (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FiPlanLimit == uint32(0) {
 148271 		if (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpOrSet != 0 {
 148272 			(*WhereOrSet)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpOrSet)).Fn = U16(0)
 148273 		}
 148274 		return SQLITE_DONE
 148275 	}
 148276 	(*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FiPlanLimit--
 148277 
 148278 	whereLoopAdjustCost(tls, (*WhereInfo)(unsafe.Pointer(pWInfo)).FpLoops, pTemplate)
 148279 
 148280 	if (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpOrSet != uintptr(0) {
 148281 		if (*WhereLoop)(unsafe.Pointer(pTemplate)).FnLTerm != 0 {
 148282 			whereOrInsert(tls, (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpOrSet, (*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq, (*WhereLoop)(unsafe.Pointer(pTemplate)).FrRun,
 148283 				(*WhereLoop)(unsafe.Pointer(pTemplate)).FnOut)
 148284 		}
 148285 		return SQLITE_OK
 148286 	}
 148287 
 148288 	ppPrev = whereLoopFindLesser(tls, pWInfo+80, pTemplate)
 148289 
 148290 	if ppPrev == uintptr(0) {
 148291 		return SQLITE_OK
 148292 	} else {
 148293 		p = *(*uintptr)(unsafe.Pointer(ppPrev))
 148294 	}
 148295 
 148296 	if p == uintptr(0) {
 148297 		*(*uintptr)(unsafe.Pointer(ppPrev)) = libc.AssignUintptr(&p, Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(WhereLoop{}))))
 148298 		if p == uintptr(0) {
 148299 			return SQLITE_NOMEM
 148300 		}
 148301 		whereLoopInit(tls, p)
 148302 		(*WhereLoop)(unsafe.Pointer(p)).FpNextLoop = uintptr(0)
 148303 	} else {
 148304 		var ppTail uintptr = p + 80
 148305 		var pToDel uintptr
 148306 		for *(*uintptr)(unsafe.Pointer(ppTail)) != 0 {
 148307 			ppTail = whereLoopFindLesser(tls, ppTail, pTemplate)
 148308 			if ppTail == uintptr(0) {
 148309 				break
 148310 			}
 148311 			pToDel = *(*uintptr)(unsafe.Pointer(ppTail))
 148312 			if pToDel == uintptr(0) {
 148313 				break
 148314 			}
 148315 			*(*uintptr)(unsafe.Pointer(ppTail)) = (*WhereLoop)(unsafe.Pointer(pToDel)).FpNextLoop
 148316 			whereLoopDelete(tls, db, pToDel)
 148317 		}
 148318 	}
 148319 	rc = whereLoopXfer(tls, db, p, pTemplate)
 148320 	if (*WhereLoop)(unsafe.Pointer(p)).FwsFlags&U32(WHERE_VIRTUALTABLE) == U32(0) {
 148321 		var pIndex uintptr = *(*uintptr)(unsafe.Pointer(p + 24 + 8))
 148322 		if pIndex != 0 && int32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x3>>0) == SQLITE_IDXTYPE_IPK {
 148323 			*(*uintptr)(unsafe.Pointer(p + 24 + 8)) = uintptr(0)
 148324 		}
 148325 	}
 148326 	return rc
 148327 }
 148328 
 148329 func whereLoopOutputAdjust(tls *libc.TLS, pWC uintptr, pLoop uintptr, nRow LogEst) {
 148330 	bp := tls.Alloc(4)
 148331 	defer tls.Free(4)
 148332 
 148333 	var pTerm uintptr
 148334 	var pX uintptr
 148335 	var notAllowed Bitmask = ^((*WhereLoop)(unsafe.Pointer(pLoop)).Fprereq | (*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf)
 148336 	var i int32
 148337 	var j int32
 148338 	var iReduce LogEst = int16(0)
 148339 
 148340 	i = (*WhereClause)(unsafe.Pointer(pWC)).FnBase
 148341 	pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa
 148342 __1:
 148343 	if !(i > 0) {
 148344 		goto __3
 148345 	}
 148346 	{
 148347 		if (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll&notAllowed != uint64(0) {
 148348 			goto __2
 148349 		}
 148350 		if (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll&(*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf == uint64(0) {
 148351 			goto __2
 148352 		}
 148353 		if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_VIRTUAL != 0 {
 148354 			goto __2
 148355 		}
 148356 		for j = int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm) - 1; j >= 0; j-- {
 148357 			pX = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*8))
 148358 			if pX == uintptr(0) {
 148359 				continue
 148360 			}
 148361 			if pX == pTerm {
 148362 				break
 148363 			}
 148364 			if (*WhereTerm)(unsafe.Pointer(pX)).FiParent >= 0 && (*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr((*WhereTerm)(unsafe.Pointer(pX)).FiParent)*56 == pTerm {
 148365 				break
 148366 			}
 148367 		}
 148368 		if j < 0 {
 148369 			Xsqlite3ProgressCheck(tls, (*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)
 148370 			if (*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf == (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll {
 148371 				if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&0x3f != 0 ||
 148372 					int32((*SrcItem)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpTabList+8+uintptr((*WhereLoop)(unsafe.Pointer(pLoop)).FiTab)*104)).Ffg.Fjointype)&
 148373 						(JT_LEFT|JT_LTORJ) == 0 {
 148374 					*(*U32)(unsafe.Pointer(pLoop + 56)) |= U32(WHERE_SELFCULL)
 148375 				}
 148376 			}
 148377 			if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb) <= 0 {
 148378 				*(*LogEst)(unsafe.Pointer(pLoop + 22)) += LogEst(int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb))
 148379 			} else {
 148380 				(*WhereLoop)(unsafe.Pointer(pLoop)).FnOut--
 148381 				if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(WO_EQ|WO_IS) != 0 &&
 148382 					int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_HIGHTRUTH == 0 {
 148383 					var pRight uintptr = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight
 148384 					*(*int32)(unsafe.Pointer(bp)) = 0
 148385 
 148386 					if Xsqlite3ExprIsInteger(tls, pRight, bp) != 0 && *(*int32)(unsafe.Pointer(bp)) >= -1 && *(*int32)(unsafe.Pointer(bp)) <= 1 {
 148387 						*(*int32)(unsafe.Pointer(bp)) = 10
 148388 					} else {
 148389 						*(*int32)(unsafe.Pointer(bp)) = 20
 148390 					}
 148391 					if int32(iReduce) < *(*int32)(unsafe.Pointer(bp)) {
 148392 						*(*U16)(unsafe.Pointer(pTerm + 18)) |= U16(TERM_HEURTRUTH)
 148393 						iReduce = LogEst(*(*int32)(unsafe.Pointer(bp)))
 148394 					}
 148395 				}
 148396 			}
 148397 		}
 148398 
 148399 	}
 148400 	goto __2
 148401 __2:
 148402 	i--
 148403 	pTerm += 56
 148404 	goto __1
 148405 	goto __3
 148406 __3:
 148407 	;
 148408 	if int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnOut) > int32(nRow)-int32(iReduce) {
 148409 		(*WhereLoop)(unsafe.Pointer(pLoop)).FnOut = LogEst(int32(nRow) - int32(iReduce))
 148410 	}
 148411 }
 148412 
 148413 func whereRangeVectorLen(tls *libc.TLS, pParse uintptr, iCur int32, pIdx uintptr, nEq int32, pTerm uintptr) int32 {
 148414 	var nCmp int32 = Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft)
 148415 	var i int32
 148416 
 148417 	nCmp = func() int32 {
 148418 		if nCmp < int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)-nEq {
 148419 			return nCmp
 148420 		}
 148421 		return int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) - nEq
 148422 	}()
 148423 	for i = 1; i < nCmp; i++ {
 148424 		var aff int8
 148425 		var idxaff int8 = int8(0)
 148426 		var pColl uintptr
 148427 		var pLhs uintptr
 148428 		var pRhs uintptr
 148429 
 148430 		pLhs = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft + 32)) + 8 + uintptr(i)*32)).FpExpr
 148431 		pRhs = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight
 148432 		if (*Expr)(unsafe.Pointer(pRhs)).Fflags&U32(EP_xIsSelect) != U32(0) {
 148433 			pRhs = (*ExprList_item)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pRhs + 32)))).FpEList + 8 + uintptr(i)*32)).FpExpr
 148434 		} else {
 148435 			pRhs = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pRhs + 32)) + 8 + uintptr(i)*32)).FpExpr
 148436 		}
 148437 
 148438 		if int32((*Expr)(unsafe.Pointer(pLhs)).Fop) != TK_COLUMN ||
 148439 			(*Expr)(unsafe.Pointer(pLhs)).FiTable != iCur ||
 148440 			int32((*Expr)(unsafe.Pointer(pLhs)).FiColumn) != int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i+nEq)*2))) ||
 148441 			int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i+nEq)))) != int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(nEq)))) {
 148442 			break
 148443 		}
 148444 
 148445 		aff = Xsqlite3CompareAffinity(tls, pRhs, Xsqlite3ExprAffinity(tls, pLhs))
 148446 		idxaff = Xsqlite3TableColumnAffinity(tls, (*Index)(unsafe.Pointer(pIdx)).FpTable, int32((*Expr)(unsafe.Pointer(pLhs)).FiColumn))
 148447 		if int32(aff) != int32(idxaff) {
 148448 			break
 148449 		}
 148450 
 148451 		pColl = Xsqlite3BinaryCompareCollSeq(tls, pParse, pLhs, pRhs)
 148452 		if pColl == uintptr(0) {
 148453 			break
 148454 		}
 148455 		if Xsqlite3StrICmp(tls, (*CollSeq)(unsafe.Pointer(pColl)).FzName, *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(i+nEq)*8))) != 0 {
 148456 			break
 148457 		}
 148458 	}
 148459 	return i
 148460 }
 148461 
 148462 func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProbe uintptr, nInMul LogEst) int32 {
 148463 	bp := tls.Alloc(120)
 148464 	defer tls.Free(120)
 148465 
 148466 	var pWInfo uintptr = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo
 148467 	var pParse uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse
 148468 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 148469 	var pNew uintptr
 148470 	var pTerm uintptr
 148471 	var opMask int32
 148472 
 148473 	var saved_prereq Bitmask
 148474 	var saved_nLTerm U16
 148475 	var saved_nEq U16
 148476 	var saved_nBtm U16
 148477 	var saved_nTop U16
 148478 	var saved_nSkip U16
 148479 	var saved_wsFlags U32
 148480 	var saved_nOut LogEst
 148481 	var rc int32 = SQLITE_OK
 148482 	var rSize LogEst
 148483 	var rLogSize LogEst
 148484 	var pTop uintptr = uintptr(0)
 148485 	var pBtm uintptr = uintptr(0)
 148486 
 148487 	pNew = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew
 148488 
 148489 	if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
 148490 		return (*Parse)(unsafe.Pointer(pParse)).Frc
 148491 	}
 148492 
 148493 	if (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags&U32(WHERE_BTM_LIMIT) != 0 {
 148494 		opMask = int32(WO_EQ)<<(TK_LT-TK_EQ) | int32(WO_EQ)<<(TK_LE-TK_EQ)
 148495 	} else {
 148496 		opMask = WO_EQ | WO_IN | int32(WO_EQ)<<(TK_GT-TK_EQ) | int32(WO_EQ)<<(TK_GE-TK_EQ) | int32(WO_EQ)<<(TK_LT-TK_EQ) | int32(WO_EQ)<<(TK_LE-TK_EQ) | WO_ISNULL | WO_IS
 148497 	}
 148498 	if uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 {
 148499 		opMask = opMask & libc.CplInt32(int32(WO_EQ)<<(TK_GT-TK_EQ)|int32(WO_EQ)<<(TK_GE-TK_EQ)|int32(WO_EQ)<<(TK_LT-TK_EQ)|int32(WO_EQ)<<(TK_LE-TK_EQ))
 148500 	}
 148501 
 148502 	saved_nEq = *(*U16)(unsafe.Pointer(pNew + 24))
 148503 	saved_nBtm = *(*U16)(unsafe.Pointer(pNew + 24 + 2))
 148504 	saved_nTop = *(*U16)(unsafe.Pointer(pNew + 24 + 4))
 148505 	saved_nSkip = (*WhereLoop)(unsafe.Pointer(pNew)).FnSkip
 148506 	saved_nLTerm = (*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm
 148507 	saved_wsFlags = (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags
 148508 	saved_prereq = (*WhereLoop)(unsafe.Pointer(pNew)).Fprereq
 148509 	saved_nOut = (*WhereLoop)(unsafe.Pointer(pNew)).FnOut
 148510 	pTerm = whereScanInit(tls, bp, (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor, int32(saved_nEq),
 148511 		uint32(opMask), pProbe)
 148512 	(*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(0)
 148513 	rSize = *(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst))
 148514 	rLogSize = estLog(tls, rSize)
 148515 	for ; rc == SQLITE_OK && pTerm != uintptr(0); pTerm = whereScanNext(tls, bp) {
 148516 		var eOp U16 = (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator
 148517 		var rCostIdx LogEst
 148518 		var nOutUnadjusted LogEst
 148519 		var nIn int32 = 0
 148520 		var nRecValid int32 = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid
 148521 		if (int32(eOp) == WO_ISNULL || int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_VNULL != 0) &&
 148522 			indexColumnNotNull(tls, pProbe, int32(saved_nEq)) != 0 {
 148523 			continue
 148524 		}
 148525 		if (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight&(*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf != 0 {
 148526 			continue
 148527 		}
 148528 
 148529 		if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_LIKEOPT != 0 && int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) == int32(WO_EQ)<<(TK_LT-TK_EQ) {
 148530 			continue
 148531 		}
 148532 
 148533 		if int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&(JT_LEFT|JT_LTORJ|JT_RIGHT) != 0 &&
 148534 			!(constraintCompatibleWithOuterJoin(tls, pTerm, pSrc) != 0) {
 148535 			continue
 148536 		}
 148537 		if int32((*Index)(unsafe.Pointer(pProbe)).FonError) != OE_None && int32(saved_nEq) == int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol)-1 {
 148538 			*(*uint8)(unsafe.Pointer(pBuilder + 44)) |= uint8(SQLITE_BLDF1_UNIQUE)
 148539 		} else {
 148540 			*(*uint8)(unsafe.Pointer(pBuilder + 44)) |= uint8(SQLITE_BLDF1_INDEXED)
 148541 		}
 148542 		(*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = saved_wsFlags
 148543 		*(*U16)(unsafe.Pointer(pNew + 24)) = saved_nEq
 148544 		*(*U16)(unsafe.Pointer(pNew + 24 + 2)) = saved_nBtm
 148545 		*(*U16)(unsafe.Pointer(pNew + 24 + 4)) = saved_nTop
 148546 		(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm = saved_nLTerm
 148547 		if int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm) >= int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLSlot) &&
 148548 			whereLoopResize(tls, db, pNew, int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+1) != 0 {
 148549 			break
 148550 		}
 148551 		*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(libc.PostIncUint16(&(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm, 1))*8)) = pTerm
 148552 		(*WhereLoop)(unsafe.Pointer(pNew)).Fprereq = (saved_prereq | (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight) & ^(*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf
 148553 
 148554 		if int32(eOp)&WO_IN != 0 {
 148555 			var pExpr uintptr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
 148556 			if (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_xIsSelect) != U32(0) {
 148557 				var i int32
 148558 				nIn = 46
 148559 
 148560 				for i = 0; i < int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)-1; i++ {
 148561 					if *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) != 0 && (*WhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)))).FpExpr == pExpr {
 148562 						nIn = 0
 148563 					}
 148564 				}
 148565 			} else if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 && (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr != 0 {
 148566 				nIn = int32(Xsqlite3LogEst(tls, uint64((*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr)))
 148567 			}
 148568 			if uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x80>>7)) != 0 && int32(rLogSize) >= 10 {
 148569 				var M LogEst
 148570 				var logK LogEst
 148571 				var x LogEst
 148572 
 148573 				M = *(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(saved_nEq)*2))
 148574 				logK = estLog(tls, int16(nIn))
 148575 
 148576 				x = LogEst(int32(M) + int32(logK) + 10 - (nIn + int32(rLogSize)))
 148577 				if int32(x) >= 0 {
 148578 				} else if int32(nInMul) < 2 && (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_SeekScan) == U32(0) {
 148579 					*(*U32)(unsafe.Pointer(pNew + 56)) |= U32(WHERE_IN_SEEKSCAN)
 148580 				} else {
 148581 					continue
 148582 				}
 148583 			}
 148584 			*(*U32)(unsafe.Pointer(pNew + 56)) |= U32(WHERE_COLUMN_IN)
 148585 		} else if int32(eOp)&(WO_EQ|WO_IS) != 0 {
 148586 			var iCol int32 = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiColumn + uintptr(saved_nEq)*2)))
 148587 			*(*U32)(unsafe.Pointer(pNew + 56)) |= U32(WHERE_COLUMN_EQ)
 148588 
 148589 			if iCol == -1 ||
 148590 				iCol >= 0 && int32(nInMul) == 0 && int32(saved_nEq) == int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol)-1 {
 148591 				if iCol == -1 || uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x8>>3)) != 0 ||
 148592 					int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol) == 1 && (*Index)(unsafe.Pointer(pProbe)).FonError != 0 && int32(eOp) == WO_EQ {
 148593 					*(*U32)(unsafe.Pointer(pNew + 56)) |= U32(WHERE_ONEROW)
 148594 				} else {
 148595 					*(*U32)(unsafe.Pointer(pNew + 56)) |= U32(WHERE_UNQ_WANTED)
 148596 				}
 148597 			}
 148598 			if int32((*WhereScan)(unsafe.Pointer(bp)).FiEquiv) > 1 {
 148599 				*(*U32)(unsafe.Pointer(pNew + 56)) |= U32(WHERE_TRANSCONS)
 148600 			}
 148601 		} else if int32(eOp)&WO_ISNULL != 0 {
 148602 			*(*U32)(unsafe.Pointer(pNew + 56)) |= U32(WHERE_COLUMN_NULL)
 148603 		} else {
 148604 			var nVecLen int32 = whereRangeVectorLen(tls,
 148605 				pParse, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor, pProbe, int32(saved_nEq), pTerm)
 148606 			if int32(eOp)&(int32(WO_EQ)<<(TK_GT-TK_EQ)|int32(WO_EQ)<<(TK_GE-TK_EQ)) != 0 {
 148607 				*(*U32)(unsafe.Pointer(pNew + 56)) |= U32(WHERE_COLUMN_RANGE | WHERE_BTM_LIMIT)
 148608 				*(*U16)(unsafe.Pointer(pNew + 24 + 2)) = U16(nVecLen)
 148609 				pBtm = pTerm
 148610 				pTop = uintptr(0)
 148611 				if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_LIKEOPT != 0 {
 148612 					pTop = pTerm + 1*56
 148613 
 148614 					if whereLoopResize(tls, db, pNew, int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+1) != 0 {
 148615 						break
 148616 					}
 148617 					*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(libc.PostIncUint16(&(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm, 1))*8)) = pTop
 148618 					*(*U32)(unsafe.Pointer(pNew + 56)) |= U32(WHERE_TOP_LIMIT)
 148619 					*(*U16)(unsafe.Pointer(pNew + 24 + 4)) = U16(1)
 148620 				}
 148621 			} else {
 148622 				*(*U32)(unsafe.Pointer(pNew + 56)) |= U32(WHERE_COLUMN_RANGE | WHERE_TOP_LIMIT)
 148623 				*(*U16)(unsafe.Pointer(pNew + 24 + 4)) = U16(nVecLen)
 148624 				pTop = pTerm
 148625 				if (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags&U32(WHERE_BTM_LIMIT) != U32(0) {
 148626 					pBtm = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)-2)*8))
 148627 				} else {
 148628 					pBtm = uintptr(0)
 148629 				}
 148630 			}
 148631 		}
 148632 
 148633 		if (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags&U32(WHERE_COLUMN_RANGE) != 0 {
 148634 			whereRangeScanEst(tls, pParse, pBuilder, pBtm, pTop, pNew)
 148635 		} else {
 148636 			var nEq int32 = int32(libc.PreIncUint16(&*(*U16)(unsafe.Pointer(pNew + 24)), 1))
 148637 
 148638 			if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb) <= 0 && int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiColumn + uintptr(saved_nEq)*2))) >= 0 {
 148639 				*(*LogEst)(unsafe.Pointer(pNew + 22)) += LogEst(int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb))
 148640 				*(*LogEst)(unsafe.Pointer(pNew + 22)) -= LogEst(nIn)
 148641 			} else {
 148642 				*(*TRowcnt)(unsafe.Pointer(bp + 112)) = uint64(0)
 148643 				if int32(nInMul) == 0 &&
 148644 					(*Index)(unsafe.Pointer(pProbe)).FnSample != 0 &&
 148645 					int32(*(*U16)(unsafe.Pointer(pNew + 24))) <= (*Index)(unsafe.Pointer(pProbe)).FnSampleCol &&
 148646 					(int32(eOp)&WO_IN == 0 || (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&U32(EP_xIsSelect) == U32(0)) &&
 148647 					(*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_Stat4) == U32(0) {
 148648 					var pExpr uintptr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
 148649 					if int32(eOp)&(WO_EQ|WO_ISNULL|WO_IS) != 0 {
 148650 						rc = whereEqualScanEst(tls, pParse, pBuilder, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+112)
 148651 					} else {
 148652 						rc = whereInScanEst(tls, pParse, pBuilder, *(*uintptr)(unsafe.Pointer(pExpr + 32)), bp+112)
 148653 					}
 148654 					if rc == SQLITE_NOTFOUND {
 148655 						rc = SQLITE_OK
 148656 					}
 148657 					if rc != SQLITE_OK {
 148658 						break
 148659 					}
 148660 					if *(*TRowcnt)(unsafe.Pointer(bp + 112)) != 0 {
 148661 						(*WhereLoop)(unsafe.Pointer(pNew)).FnOut = Xsqlite3LogEst(tls, *(*TRowcnt)(unsafe.Pointer(bp + 112)))
 148662 						if nEq == 1 &&
 148663 							int32((*WhereLoop)(unsafe.Pointer(pNew)).FnOut)+10 > int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst))) {
 148664 							*(*U16)(unsafe.Pointer(pTerm + 18)) |= U16(TERM_HIGHTRUTH)
 148665 							if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_HEURTRUTH != 0 {
 148666 								*(*uint8)(unsafe.Pointer(pBuilder + 45)) |= uint8(SQLITE_BLDF2_2NDPASS)
 148667 							}
 148668 						}
 148669 						if int32((*WhereLoop)(unsafe.Pointer(pNew)).FnOut) > int32(saved_nOut) {
 148670 							(*WhereLoop)(unsafe.Pointer(pNew)).FnOut = saved_nOut
 148671 						}
 148672 						*(*LogEst)(unsafe.Pointer(pNew + 22)) -= LogEst(nIn)
 148673 					}
 148674 				}
 148675 				if *(*TRowcnt)(unsafe.Pointer(bp + 112)) == uint64(0) {
 148676 					*(*LogEst)(unsafe.Pointer(pNew + 22)) += LogEst(int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(nEq)*2))) - int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(nEq-1)*2))))
 148677 					if int32(eOp)&WO_ISNULL != 0 {
 148678 						*(*LogEst)(unsafe.Pointer(pNew + 22)) += int16(10)
 148679 					}
 148680 				}
 148681 			}
 148682 		}
 148683 
 148684 		if int32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0) == SQLITE_IDXTYPE_IPK {
 148685 			rCostIdx = LogEst(int32((*WhereLoop)(unsafe.Pointer(pNew)).FnOut) + 16)
 148686 		} else {
 148687 			rCostIdx = LogEst(int32((*WhereLoop)(unsafe.Pointer(pNew)).FnOut) + 1 + 15*int32((*Index)(unsafe.Pointer(pProbe)).FszIdxRow)/int32((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FszTabRow))
 148688 		}
 148689 		(*WhereLoop)(unsafe.Pointer(pNew)).FrRun = Xsqlite3LogEstAdd(tls, rLogSize, rCostIdx)
 148690 		if (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags&U32(WHERE_IDX_ONLY|WHERE_IPK|WHERE_EXPRIDX) == U32(0) {
 148691 			(*WhereLoop)(unsafe.Pointer(pNew)).FrRun = Xsqlite3LogEstAdd(tls, (*WhereLoop)(unsafe.Pointer(pNew)).FrRun, int16(int32((*WhereLoop)(unsafe.Pointer(pNew)).FnOut)+16))
 148692 		}
 148693 
 148694 		nOutUnadjusted = (*WhereLoop)(unsafe.Pointer(pNew)).FnOut
 148695 		*(*LogEst)(unsafe.Pointer(pNew + 20)) += LogEst(int32(nInMul) + nIn)
 148696 		*(*LogEst)(unsafe.Pointer(pNew + 22)) += LogEst(int32(nInMul) + nIn)
 148697 		whereLoopOutputAdjust(tls, (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC, pNew, rSize)
 148698 		rc = whereLoopInsert(tls, pBuilder, pNew)
 148699 
 148700 		if (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags&U32(WHERE_COLUMN_RANGE) != 0 {
 148701 			(*WhereLoop)(unsafe.Pointer(pNew)).FnOut = saved_nOut
 148702 		} else {
 148703 			(*WhereLoop)(unsafe.Pointer(pNew)).FnOut = nOutUnadjusted
 148704 		}
 148705 
 148706 		if (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags&U32(WHERE_TOP_LIMIT) == U32(0) &&
 148707 			int32(*(*U16)(unsafe.Pointer(pNew + 24))) < int32((*Index)(unsafe.Pointer(pProbe)).FnColumn) &&
 148708 			(int32(*(*U16)(unsafe.Pointer(pNew + 24))) < int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0) != SQLITE_IDXTYPE_PRIMARYKEY) {
 148709 			if int32(*(*U16)(unsafe.Pointer(pNew + 24))) > 3 {
 148710 				Xsqlite3ProgressCheck(tls, pParse)
 148711 			}
 148712 			whereLoopAddBtreeIndex(tls, pBuilder, pSrc, pProbe, int16(int32(nInMul)+nIn))
 148713 		}
 148714 		(*WhereLoop)(unsafe.Pointer(pNew)).FnOut = saved_nOut
 148715 		(*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid = nRecValid
 148716 	}
 148717 	(*WhereLoop)(unsafe.Pointer(pNew)).Fprereq = saved_prereq
 148718 	*(*U16)(unsafe.Pointer(pNew + 24)) = saved_nEq
 148719 	*(*U16)(unsafe.Pointer(pNew + 24 + 2)) = saved_nBtm
 148720 	*(*U16)(unsafe.Pointer(pNew + 24 + 4)) = saved_nTop
 148721 	(*WhereLoop)(unsafe.Pointer(pNew)).FnSkip = saved_nSkip
 148722 	(*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = saved_wsFlags
 148723 	(*WhereLoop)(unsafe.Pointer(pNew)).FnOut = saved_nOut
 148724 	(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm = saved_nLTerm
 148725 
 148726 	if int32(saved_nEq) == int32(saved_nSkip) &&
 148727 		int32(saved_nEq)+1 < int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol) &&
 148728 		int32(saved_nEq) == int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm) &&
 148729 		int32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x40>>6) == 0 &&
 148730 		int32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x80>>7) != 0 &&
 148731 		(*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_SkipScan) == U32(0) &&
 148732 		int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(int32(saved_nEq)+1)*2))) >= 42 &&
 148733 		libc.AssignInt32(&rc, whereLoopResize(tls, db, pNew, int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+1)) == SQLITE_OK {
 148734 		var nIter LogEst
 148735 		*(*U16)(unsafe.Pointer(pNew + 24))++
 148736 		(*WhereLoop)(unsafe.Pointer(pNew)).FnSkip++
 148737 		*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(libc.PostIncUint16(&(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm, 1))*8)) = uintptr(0)
 148738 		*(*U32)(unsafe.Pointer(pNew + 56)) |= U32(WHERE_SKIPSCAN)
 148739 		nIter = LogEst(int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(saved_nEq)*2))) - int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(int32(saved_nEq)+1)*2))))
 148740 		*(*LogEst)(unsafe.Pointer(pNew + 22)) -= LogEst(int32(nIter))
 148741 
 148742 		nIter = int16(int32(nIter) + 5)
 148743 		whereLoopAddBtreeIndex(tls, pBuilder, pSrc, pProbe, int16(int32(nIter)+int32(nInMul)))
 148744 		(*WhereLoop)(unsafe.Pointer(pNew)).FnOut = saved_nOut
 148745 		*(*U16)(unsafe.Pointer(pNew + 24)) = saved_nEq
 148746 		(*WhereLoop)(unsafe.Pointer(pNew)).FnSkip = saved_nSkip
 148747 		(*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = saved_wsFlags
 148748 	}
 148749 
 148750 	return rc
 148751 }
 148752 
 148753 func indexMightHelpWithOrderBy(tls *libc.TLS, pBuilder uintptr, pIndex uintptr, iCursor int32) int32 {
 148754 	var pOB uintptr
 148755 	var aColExpr uintptr
 148756 	var ii int32
 148757 	var jj int32
 148758 
 148759 	if uint32(int32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x4>>2)) != 0 {
 148760 		return 0
 148761 	}
 148762 	if libc.AssignUintptr(&pOB, (*WhereInfo)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo)).FpOrderBy) == uintptr(0) {
 148763 		return 0
 148764 	}
 148765 	for ii = 0; ii < (*ExprList)(unsafe.Pointer(pOB)).FnExpr; ii++ {
 148766 		var pExpr uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer(pOB+8+uintptr(ii)*32)).FpExpr)
 148767 		if pExpr == uintptr(0) {
 148768 			continue
 148769 		}
 148770 		if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN && (*Expr)(unsafe.Pointer(pExpr)).FiTable == iCursor {
 148771 			if int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) < 0 {
 148772 				return 1
 148773 			}
 148774 			for jj = 0; jj < int32((*Index)(unsafe.Pointer(pIndex)).FnKeyCol); jj++ {
 148775 				if int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) == int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(jj)*2))) {
 148776 					return 1
 148777 				}
 148778 			}
 148779 		} else if libc.AssignUintptr(&aColExpr, (*Index)(unsafe.Pointer(pIndex)).FaColExpr) != uintptr(0) {
 148780 			for jj = 0; jj < int32((*Index)(unsafe.Pointer(pIndex)).FnKeyCol); jj++ {
 148781 				if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(jj)*2))) != -2 {
 148782 					continue
 148783 				}
 148784 				if Xsqlite3ExprCompareSkip(tls, pExpr, (*ExprList_item)(unsafe.Pointer(aColExpr+8+uintptr(jj)*32)).FpExpr, iCursor) == 0 {
 148785 					return 1
 148786 				}
 148787 			}
 148788 		}
 148789 	}
 148790 	return 0
 148791 }
 148792 
 148793 func whereUsablePartialIndex(tls *libc.TLS, iTab int32, jointype U8, pWC uintptr, pWhere uintptr) int32 {
 148794 	var i int32
 148795 	var pTerm uintptr
 148796 	var pParse uintptr
 148797 
 148798 	if int32(jointype)&JT_LTORJ != 0 {
 148799 		return 0
 148800 	}
 148801 	pParse = (*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse
 148802 	for int32((*Expr)(unsafe.Pointer(pWhere)).Fop) == TK_AND {
 148803 		if !(whereUsablePartialIndex(tls, iTab, jointype, pWC, (*Expr)(unsafe.Pointer(pWhere)).FpLeft) != 0) {
 148804 			return 0
 148805 		}
 148806 		pWhere = (*Expr)(unsafe.Pointer(pWhere)).FpRight
 148807 	}
 148808 	if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_EnableQPSG) != 0 {
 148809 		pParse = uintptr(0)
 148810 	}
 148811 	i = 0
 148812 	pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa
 148813 __1:
 148814 	if !(i < (*WhereClause)(unsafe.Pointer(pWC)).FnTerm) {
 148815 		goto __3
 148816 	}
 148817 	{
 148818 		var pExpr uintptr
 148819 		pExpr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
 148820 		if (!((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_OuterON) != U32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) &&
 148821 			(int32(jointype)&JT_OUTER == 0 || (*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_OuterON) != U32(0)) &&
 148822 			Xsqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 &&
 148823 			int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&TERM_VNULL == 0 {
 148824 			return 1
 148825 		}
 148826 
 148827 	}
 148828 	goto __2
 148829 __2:
 148830 	i++
 148831 	pTerm += 56
 148832 	goto __1
 148833 	goto __3
 148834 __3:
 148835 	;
 148836 	return 0
 148837 }
 148838 
 148839 func exprIsCoveredByIndex(tls *libc.TLS, pExpr uintptr, pIdx uintptr, iTabCur int32) int32 {
 148840 	var i int32
 148841 	for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnColumn); i++ {
 148842 		if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) == -2 &&
 148843 			Xsqlite3ExprCompare(tls, uintptr(0), pExpr, (*ExprList_item)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaColExpr+8+uintptr(i)*32)).FpExpr, iTabCur) == 0 {
 148844 			return 1
 148845 		}
 148846 	}
 148847 	return 0
 148848 }
 148849 
 148850 // Structure passed to the whereIsCoveringIndex Walker callback.
 148851 type CoveringIndexCheck = CoveringIndexCheck1
 148852 
 148853 func whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintptr) int32 {
 148854 	var i int32
 148855 	var pIdx uintptr
 148856 	var aiColumn uintptr
 148857 	var nColumn U16
 148858 	var pCk uintptr
 148859 
 148860 	pCk = *(*uintptr)(unsafe.Pointer(pWalk + 40))
 148861 	pIdx = (*CoveringIndexCheck)(unsafe.Pointer(pCk)).FpIdx
 148862 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN || int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AGG_COLUMN {
 148863 		if (*Expr)(unsafe.Pointer(pExpr)).FiTable != (*CoveringIndexCheck)(unsafe.Pointer(pCk)).FiTabCur {
 148864 			return WRC_Continue
 148865 		}
 148866 		pIdx = (*CoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FpIdx
 148867 		aiColumn = (*Index)(unsafe.Pointer(pIdx)).FaiColumn
 148868 		nColumn = (*Index)(unsafe.Pointer(pIdx)).FnColumn
 148869 		for i = 0; i < int32(nColumn); i++ {
 148870 			if int32(*(*I16)(unsafe.Pointer(aiColumn + uintptr(i)*2))) == int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) {
 148871 				return WRC_Continue
 148872 			}
 148873 		}
 148874 		(*CoveringIndexCheck)(unsafe.Pointer(pCk)).FbUnidx = U8(1)
 148875 		return WRC_Abort
 148876 	} else if uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) != 0 &&
 148877 		exprIsCoveredByIndex(tls, pExpr, pIdx, (*CoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FiTabCur) != 0 {
 148878 		(*CoveringIndexCheck)(unsafe.Pointer(pCk)).FbExpr = U8(1)
 148879 		return WRC_Prune
 148880 	}
 148881 	return WRC_Continue
 148882 }
 148883 
 148884 func whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur int32) U32 {
 148885 	bp := tls.Alloc(64)
 148886 	defer tls.Free(64)
 148887 
 148888 	var i int32
 148889 	var rc int32
 148890 
 148891 	if (*WhereInfo)(unsafe.Pointer(pWInfo)).FpSelect == uintptr(0) {
 148892 		return U32(0)
 148893 	}
 148894 	if int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11) == 0 {
 148895 		for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnColumn); i++ {
 148896 			if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) >= int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8))-1 {
 148897 				break
 148898 			}
 148899 		}
 148900 		if i >= int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) {
 148901 			return U32(0)
 148902 		}
 148903 	}
 148904 	(*CoveringIndexCheck1)(unsafe.Pointer(bp + 48)).FpIdx = pIdx
 148905 	(*CoveringIndexCheck1)(unsafe.Pointer(bp + 48)).FiTabCur = iTabCur
 148906 	(*CoveringIndexCheck1)(unsafe.Pointer(bp + 48)).FbExpr = U8(0)
 148907 	(*CoveringIndexCheck1)(unsafe.Pointer(bp + 48)).FbUnidx = U8(0)
 148908 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Walker{})))
 148909 	(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 148910 		f func(*libc.TLS, uintptr, uintptr) int32
 148911 	}{whereIsCoveringIndexWalkCallback}))
 148912 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
 148913 		f func(*libc.TLS, uintptr, uintptr) int32
 148914 	}{Xsqlite3SelectWalkNoop}))
 148915 	*(*uintptr)(unsafe.Pointer(bp + 40)) = bp + 48
 148916 	Xsqlite3WalkSelect(tls, bp, (*WhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)
 148917 	if (*CoveringIndexCheck1)(unsafe.Pointer(bp+48)).FbUnidx != 0 {
 148918 		rc = 0
 148919 	} else if (*CoveringIndexCheck1)(unsafe.Pointer(bp+48)).FbExpr != 0 {
 148920 		rc = WHERE_EXPRIDX
 148921 	} else {
 148922 		rc = WHERE_IDX_ONLY
 148923 	}
 148924 	return U32(rc)
 148925 }
 148926 
 148927 func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 {
 148928 	bp := tls.Alloc(158)
 148929 	defer tls.Free(158)
 148930 
 148931 	var pWInfo uintptr
 148932 	var pProbe uintptr
 148933 
 148934 	*(*I16)(unsafe.Pointer(bp + 152)) = int16(-1)
 148935 	var pTabList uintptr
 148936 	var pSrc uintptr
 148937 	var pNew uintptr
 148938 	var rc int32 = SQLITE_OK
 148939 	var iSortIdx int32 = 1
 148940 	var b int32
 148941 	var rSize LogEst
 148942 	var pWC uintptr
 148943 	var pTab uintptr
 148944 
 148945 	pNew = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew
 148946 	pWInfo = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo
 148947 	pTabList = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList
 148948 	pSrc = pTabList + 8 + uintptr((*WhereLoop)(unsafe.Pointer(pNew)).FiTab)*104
 148949 	pTab = (*SrcItem)(unsafe.Pointer(pSrc)).FpTab
 148950 	pWC = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC
 148951 
 148952 	if uint32(int32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x2>>1)) != 0 {
 148953 		pProbe = *(*uintptr)(unsafe.Pointer(pSrc + 96))
 148954 	} else if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 148955 		pProbe = (*Table)(unsafe.Pointer(pTab)).FpIndex
 148956 	} else {
 148957 		var pFirst uintptr
 148958 		libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Index{})))
 148959 		(*Index)(unsafe.Pointer(bp)).FnKeyCol = U16(1)
 148960 		(*Index)(unsafe.Pointer(bp)).FnColumn = U16(1)
 148961 		(*Index)(unsafe.Pointer(bp)).FaiColumn = bp + 152
 148962 		(*Index)(unsafe.Pointer(bp)).FaiRowLogEst = bp + 154
 148963 		(*Index)(unsafe.Pointer(bp)).FonError = U8(OE_Replace)
 148964 		(*Index)(unsafe.Pointer(bp)).FpTable = pTab
 148965 		(*Index)(unsafe.Pointer(bp)).FszIdxRow = int16(3)
 148966 		libc.SetBitFieldPtr16Uint32(bp+100, uint32(SQLITE_IDXTYPE_IPK), 0, 0x3)
 148967 		*(*LogEst)(unsafe.Pointer(bp + 154)) = (*Table)(unsafe.Pointer(pTab)).FnRowLogEst
 148968 		*(*LogEst)(unsafe.Pointer(bp + 154 + 1*2)) = int16(0)
 148969 		pFirst = (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FpIndex
 148970 		if int32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x1>>0) == 0 {
 148971 			(*Index)(unsafe.Pointer(bp)).FpNext = pFirst
 148972 		}
 148973 		pProbe = bp
 148974 	}
 148975 	rSize = (*Table)(unsafe.Pointer(pTab)).FnRowLogEst
 148976 
 148977 	if !(int32((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpOrSet) != 0) &&
 148978 		int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&(WHERE_RIGHT_JOIN|WHERE_OR_SUBCLAUSE) == 0 &&
 148979 		(*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb)).Fflags&uint64(SQLITE_AutoIndex) != uint64(0) &&
 148980 		!(int32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x2>>1) != 0) &&
 148981 		!(int32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x1>>0) != 0) &&
 148982 		(*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) &&
 148983 		!(int32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x8>>3) != 0) &&
 148984 		!(int32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x40>>6) != 0) &&
 148985 		int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&JT_RIGHT == 0 {
 148986 		var rLogSize LogEst
 148987 		var pTerm uintptr
 148988 		var pWCEnd uintptr = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)*56
 148989 		rLogSize = estLog(tls, rSize)
 148990 		for pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa; rc == SQLITE_OK && pTerm < pWCEnd; pTerm += 56 {
 148991 			if (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight&(*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf != 0 {
 148992 				continue
 148993 			}
 148994 			if termCanDriveIndex(tls, pTerm, pSrc, uint64(0)) != 0 {
 148995 				*(*U16)(unsafe.Pointer(pNew + 24)) = U16(1)
 148996 				(*WhereLoop)(unsafe.Pointer(pNew)).FnSkip = U16(0)
 148997 				*(*uintptr)(unsafe.Pointer(pNew + 24 + 8)) = uintptr(0)
 148998 				(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm = U16(1)
 148999 				*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm)) = pTerm
 149000 
 149001 				(*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = LogEst(int32(rLogSize) + int32(rSize))
 149002 				if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW) && (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Ephemeral) == U32(0) {
 149003 					*(*LogEst)(unsafe.Pointer(pNew + 18)) += int16(28)
 149004 				} else {
 149005 					*(*LogEst)(unsafe.Pointer(pNew + 18)) -= int16(25)
 149006 
 149007 				}
 149008 
 149009 				if int32((*WhereLoop)(unsafe.Pointer(pNew)).FrSetup) < 0 {
 149010 					(*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(0)
 149011 				}
 149012 
 149013 				(*WhereLoop)(unsafe.Pointer(pNew)).FnOut = int16(43)
 149014 				(*WhereLoop)(unsafe.Pointer(pNew)).FrRun = Xsqlite3LogEstAdd(tls, rLogSize, (*WhereLoop)(unsafe.Pointer(pNew)).FnOut)
 149015 				(*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_AUTO_INDEX)
 149016 				(*WhereLoop)(unsafe.Pointer(pNew)).Fprereq = mPrereq | (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight
 149017 				rc = whereLoopInsert(tls, pBuilder, pNew)
 149018 			}
 149019 		}
 149020 	}
 149021 
 149022 __1:
 149023 	if !(rc == SQLITE_OK && pProbe != 0) {
 149024 		goto __3
 149025 	}
 149026 	{
 149027 		if (*Index)(unsafe.Pointer(pProbe)).FpPartIdxWhere != uintptr(0) &&
 149028 			!(whereUsablePartialIndex(tls, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor, (*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype, pWC,
 149029 				(*Index)(unsafe.Pointer(pProbe)).FpPartIdxWhere) != 0) {
 149030 			goto __2
 149031 		}
 149032 		if uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 {
 149033 			goto __2
 149034 		}
 149035 		rSize = *(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst))
 149036 		*(*U16)(unsafe.Pointer(pNew + 24)) = U16(0)
 149037 		*(*U16)(unsafe.Pointer(pNew + 24 + 2)) = U16(0)
 149038 		*(*U16)(unsafe.Pointer(pNew + 24 + 4)) = U16(0)
 149039 		(*WhereLoop)(unsafe.Pointer(pNew)).FnSkip = U16(0)
 149040 		(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm = U16(0)
 149041 		(*WhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = U8(0)
 149042 		(*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(0)
 149043 		(*WhereLoop)(unsafe.Pointer(pNew)).Fprereq = mPrereq
 149044 		(*WhereLoop)(unsafe.Pointer(pNew)).FnOut = rSize
 149045 		*(*uintptr)(unsafe.Pointer(pNew + 24 + 8)) = pProbe
 149046 		b = indexMightHelpWithOrderBy(tls, pBuilder, pProbe, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor)
 149047 
 149048 		if int32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0) == SQLITE_IDXTYPE_IPK {
 149049 			(*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_IPK)
 149050 
 149051 			(*WhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = func() uint8 {
 149052 				if b != 0 {
 149053 					return uint8(iSortIdx)
 149054 				}
 149055 				return uint8(0)
 149056 			}()
 149057 
 149058 			(*WhereLoop)(unsafe.Pointer(pNew)).FrRun = LogEst(int32(rSize) + 16 - 2*libc.Bool32((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasStat4) != U32(0)))
 149059 			if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW || (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Ephemeral) != U32(0) {
 149060 				*(*U32)(unsafe.Pointer(pNew + 56)) |= U32(WHERE_VIEWSCAN)
 149061 			}
 149062 
 149063 			whereLoopOutputAdjust(tls, pWC, pNew, rSize)
 149064 			rc = whereLoopInsert(tls, pBuilder, pNew)
 149065 			(*WhereLoop)(unsafe.Pointer(pNew)).FnOut = rSize
 149066 			if rc != 0 {
 149067 				goto __3
 149068 			}
 149069 		} else {
 149070 			var m Bitmask
 149071 			if uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x20>>5)) != 0 {
 149072 				m = uint64(0)
 149073 				(*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_IDX_ONLY | WHERE_INDEXED)
 149074 			} else {
 149075 				m = (*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed & (*Index)(unsafe.Pointer(pProbe)).FcolNotIdxed
 149076 				(*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_INDEXED)
 149077 				if m == uint64(1)<<(int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8))-1) || uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x800>>11)) != 0 && !(int32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x400>>10) != 0) && m != uint64(0) {
 149078 					var isCov U32 = whereIsCoveringIndex(tls, pWInfo, pProbe, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor)
 149079 					if isCov == U32(0) {
 149080 					} else {
 149081 						m = uint64(0)
 149082 						*(*U32)(unsafe.Pointer(pNew + 56)) |= isCov
 149083 						if isCov&U32(WHERE_IDX_ONLY) != 0 {
 149084 						} else {
 149085 						}
 149086 					}
 149087 				} else if m == uint64(0) {
 149088 					(*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_IDX_ONLY | WHERE_INDEXED)
 149089 				}
 149090 			}
 149091 
 149092 			if b != 0 ||
 149093 				!((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) ||
 149094 				(*Index)(unsafe.Pointer(pProbe)).FpPartIdxWhere != uintptr(0) ||
 149095 				uint32(int32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x2>>1)) != 0 ||
 149096 				m == uint64(0) &&
 149097 					int32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2) == 0 &&
 149098 					int32((*Index)(unsafe.Pointer(pProbe)).FszIdxRow) < int32((*Table)(unsafe.Pointer(pTab)).FszTabRow) &&
 149099 					int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_ONEPASS_DESIRED == 0 &&
 149100 					Xsqlite3Config.FbUseCis != 0 &&
 149101 					(*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb)).FdbOptFlags&U32(SQLITE_CoverIdxScan) == U32(0) {
 149102 				(*WhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = func() uint8 {
 149103 					if b != 0 {
 149104 						return uint8(iSortIdx)
 149105 					}
 149106 					return uint8(0)
 149107 				}()
 149108 
 149109 				(*WhereLoop)(unsafe.Pointer(pNew)).FrRun = LogEst(int32(rSize) + 1 + 15*int32((*Index)(unsafe.Pointer(pProbe)).FszIdxRow)/int32((*Table)(unsafe.Pointer(pTab)).FszTabRow))
 149110 				if m != uint64(0) {
 149111 					var nLookup LogEst = LogEst(int32(rSize) + 16)
 149112 					var ii int32
 149113 					var iCur int32 = (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor
 149114 					var pWC2 uintptr = pWInfo + 104
 149115 					for ii = 0; ii < (*WhereClause)(unsafe.Pointer(pWC2)).FnTerm; ii++ {
 149116 						var pTerm uintptr = (*WhereClause)(unsafe.Pointer(pWC2)).Fa + uintptr(ii)*56
 149117 						if !(Xsqlite3ExprCoveredByIndex(tls, (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr, iCur, pProbe) != 0) {
 149118 							break
 149119 						}
 149120 
 149121 						if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb) <= 0 {
 149122 							nLookup = LogEst(int32(nLookup) + int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb))
 149123 						} else {
 149124 							nLookup--
 149125 							if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(WO_EQ|WO_IS) != 0 {
 149126 								nLookup = int16(int32(nLookup) - 19)
 149127 							}
 149128 						}
 149129 					}
 149130 
 149131 					(*WhereLoop)(unsafe.Pointer(pNew)).FrRun = Xsqlite3LogEstAdd(tls, (*WhereLoop)(unsafe.Pointer(pNew)).FrRun, nLookup)
 149132 				}
 149133 
 149134 				whereLoopOutputAdjust(tls, pWC, pNew, rSize)
 149135 				if int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&JT_RIGHT != 0 && (*Index)(unsafe.Pointer(pProbe)).FaColExpr != 0 {
 149136 				} else {
 149137 					rc = whereLoopInsert(tls, pBuilder, pNew)
 149138 				}
 149139 				(*WhereLoop)(unsafe.Pointer(pNew)).FnOut = rSize
 149140 				if rc != 0 {
 149141 					goto __3
 149142 				}
 149143 			}
 149144 		}
 149145 
 149146 		(*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FbldFlags1 = uint8(0)
 149147 		rc = whereLoopAddBtreeIndex(tls, pBuilder, pSrc, pProbe, int16(0))
 149148 		if int32((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FbldFlags1) == SQLITE_BLDF1_INDEXED {
 149149 			*(*U32)(unsafe.Pointer(pTab + 48)) |= U32(TF_StatsUsed)
 149150 		}
 149151 		Xsqlite3Stat4ProbeFree(tls, (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec)
 149152 		(*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid = 0
 149153 		(*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec = uintptr(0)
 149154 
 149155 	}
 149156 	goto __2
 149157 __2:
 149158 	pProbe = func() uintptr {
 149159 		if uint32(int32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x2>>1)) != 0 {
 149160 			return uintptr(0)
 149161 		}
 149162 		return (*Index)(unsafe.Pointer(pProbe)).FpNext
 149163 	}()
 149164 	iSortIdx++
 149165 	goto __1
 149166 	goto __3
 149167 __3:
 149168 	;
 149169 	return rc
 149170 }
 149171 
 149172 func isLimitTerm(tls *libc.TLS, pTerm uintptr) int32 {
 149173 	return libc.Bool32(int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp) >= SQLITE_INDEX_CONSTRAINT_LIMIT &&
 149174 		int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp) <= SQLITE_INDEX_CONSTRAINT_OFFSET)
 149175 }
 149176 
 149177 func whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUsable Bitmask, mExclude U16, pIdxInfo uintptr, mNoOmit U16, pbIn uintptr, pbRetryLimit uintptr) int32 {
 149178 	bp := tls.Alloc(16)
 149179 	defer tls.Free(16)
 149180 
 149181 	var pWC uintptr = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC
 149182 	var pHidden uintptr = pIdxInfo + 1*96
 149183 	var pIdxCons uintptr
 149184 	var pUsage uintptr = (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage
 149185 	var i int32
 149186 	var mxTerm int32
 149187 	var rc int32 = SQLITE_OK
 149188 	var pNew uintptr = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew
 149189 	var pParse uintptr = (*WhereInfo)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo)).FpParse
 149190 	var pSrc uintptr = (*WhereInfo)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo)).FpTabList + 8 + uintptr((*WhereLoop)(unsafe.Pointer(pNew)).FiTab)*104
 149191 	var nConstraint int32 = (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint
 149192 
 149193 	*(*int32)(unsafe.Pointer(pbIn)) = 0
 149194 	(*WhereLoop)(unsafe.Pointer(pNew)).Fprereq = mPrereq
 149195 
 149196 	pIdxCons = *(*uintptr)(unsafe.Pointer(pIdxInfo + 8))
 149197 	i = 0
 149198 __1:
 149199 	if !(i < nConstraint) {
 149200 		goto __3
 149201 	}
 149202 	{
 149203 		var pTerm uintptr = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).FiTermOffset)*56
 149204 		(*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable = uint8(0)
 149205 		if (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight&mUsable == (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight &&
 149206 			int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(mExclude) == 0 &&
 149207 			(pbRetryLimit != 0 || !(isLimitTerm(tls, pTerm) != 0)) {
 149208 			(*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable = uint8(1)
 149209 		}
 149210 
 149211 	}
 149212 	goto __2
 149213 __2:
 149214 	i++
 149215 	pIdxCons += 12
 149216 	goto __1
 149217 	goto __3
 149218 __3:
 149219 	;
 149220 	libc.Xmemset(tls, pUsage, 0, uint64(unsafe.Sizeof(sqlite3_index_constraint_usage{}))*uint64(nConstraint))
 149221 
 149222 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = uintptr(0)
 149223 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 0
 149224 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).ForderByConsumed = 0
 149225 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(1e99) / float64(2)
 149226 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(25)
 149227 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxFlags = 0
 149228 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FcolUsed = Sqlite3_uint64(Sqlite3_int64((*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed))
 149229 	(*HiddenIndexInfo)(unsafe.Pointer(pHidden)).FmHandleIn = U32(0)
 149230 
 149231 	rc = vtabBestIndex(tls, pParse, (*SrcItem)(unsafe.Pointer(pSrc)).FpTab, pIdxInfo)
 149232 	if rc != 0 {
 149233 		if rc == SQLITE_CONSTRAINT {
 149234 			return SQLITE_OK
 149235 		}
 149236 		return rc
 149237 	}
 149238 
 149239 	mxTerm = -1
 149240 
 149241 	libc.Xmemset(tls, (*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm, 0, uint64(unsafe.Sizeof(uintptr(0)))*uint64(nConstraint))
 149242 	libc.Xmemset(tls, pNew+24, 0, uint64(unsafe.Sizeof(struct {
 149243 		FidxNum      int32
 149244 		FneedFree    uint8
 149245 		F__ccgo_pad1 [1]byte
 149246 		FisOrdered   I8
 149247 		F__ccgo_pad2 [1]byte
 149248 		FomitMask    U16
 149249 		F__ccgo_pad3 [6]byte
 149250 		FidxStr      uintptr
 149251 		FmHandleIn   U32
 149252 		F__ccgo_pad4 [4]byte
 149253 	}{})))
 149254 	pIdxCons = *(*uintptr)(unsafe.Pointer(pIdxInfo + 8))
 149255 	i = 0
 149256 __4:
 149257 	if !(i < nConstraint) {
 149258 		goto __6
 149259 	}
 149260 	{
 149261 		var iTerm int32
 149262 		if libc.AssignInt32(&iTerm, (*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage+uintptr(i)*8)).FargvIndex-1) >= 0 {
 149263 			var pTerm uintptr
 149264 			var j int32 = (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).FiTermOffset
 149265 			if iTerm >= nConstraint ||
 149266 				j < 0 ||
 149267 				j >= (*WhereClause)(unsafe.Pointer(pWC)).FnTerm ||
 149268 				*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*8)) != uintptr(0) ||
 149269 				int32((*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0 {
 149270 				Xsqlite3ErrorMsg(tls, pParse, ts+23359, libc.VaList(bp, (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FzName))
 149271 
 149272 				return SQLITE_ERROR
 149273 			}
 149274 
 149275 			pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(j)*56
 149276 			*(*Bitmask)(unsafe.Pointer(pNew)) |= (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight
 149277 
 149278 			*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*8)) = pTerm
 149279 			if iTerm > mxTerm {
 149280 				mxTerm = iTerm
 149281 			}
 149282 
 149283 			if (*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage+uintptr(i)*8)).Fomit != 0 {
 149284 				if i < 16 && int32(1)<<i&int32(mNoOmit) == 0 {
 149285 					*(*U16)(unsafe.Pointer(pNew + 24 + 8)) |= U16(int32(1) << iTerm)
 149286 				} else {
 149287 				}
 149288 				if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp) == SQLITE_INDEX_CONSTRAINT_OFFSET {
 149289 					libc.SetBitFieldPtr8Uint32(pNew+24+4, U32(1), 1, 0x2)
 149290 				}
 149291 			}
 149292 			if func() uint32 {
 149293 				if i <= 31 {
 149294 					return uint32(1) << i
 149295 				}
 149296 				return uint32(0)
 149297 			}()&(*HiddenIndexInfo)(unsafe.Pointer(pHidden)).FmHandleIn != 0 {
 149298 				*(*U32)(unsafe.Pointer(pNew + 24 + 24)) |= uint32(1) << iTerm
 149299 			} else if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&WO_IN != 0 {
 149300 				(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).ForderByConsumed = 0
 149301 				*(*int32)(unsafe.Pointer(pIdxInfo + 80)) &= libc.CplInt32(SQLITE_INDEX_SCAN_UNIQUE)
 149302 				*(*int32)(unsafe.Pointer(pbIn)) = 1
 149303 			}
 149304 
 149305 			if isLimitTerm(tls, pTerm) != 0 && *(*int32)(unsafe.Pointer(pbIn)) != 0 {
 149306 				if (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FneedToFreeIdxStr != 0 {
 149307 					Xsqlite3_free(tls, (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr)
 149308 					(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = uintptr(0)
 149309 					(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FneedToFreeIdxStr = 0
 149310 				}
 149311 				*(*int32)(unsafe.Pointer(pbRetryLimit)) = 1
 149312 				return SQLITE_OK
 149313 			}
 149314 		}
 149315 
 149316 	}
 149317 	goto __5
 149318 __5:
 149319 	i++
 149320 	pIdxCons += 12
 149321 	goto __4
 149322 	goto __6
 149323 __6:
 149324 	;
 149325 	(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm = U16(mxTerm + 1)
 149326 	for i = 0; i <= mxTerm; i++ {
 149327 		if *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) == uintptr(0) {
 149328 			Xsqlite3ErrorMsg(tls, pParse, ts+23359, libc.VaList(bp+8, (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FzName))
 149329 
 149330 			return SQLITE_ERROR
 149331 		}
 149332 	}
 149333 
 149334 	*(*int32)(unsafe.Pointer(pNew + 24)) = (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum
 149335 	libc.SetBitFieldPtr8Uint32(pNew+24+4, U32((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FneedToFreeIdxStr), 0, 0x1)
 149336 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FneedToFreeIdxStr = 0
 149337 	*(*uintptr)(unsafe.Pointer(pNew + 24 + 16)) = (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr
 149338 	*(*I8)(unsafe.Pointer(pNew + 24 + 6)) = func() int8 {
 149339 		if (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).ForderByConsumed != 0 {
 149340 			return int8((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnOrderBy)
 149341 		}
 149342 		return int8(0)
 149343 	}()
 149344 	(*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(0)
 149345 	(*WhereLoop)(unsafe.Pointer(pNew)).FrRun = Xsqlite3LogEstFromDouble(tls, (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost)
 149346 	(*WhereLoop)(unsafe.Pointer(pNew)).FnOut = Xsqlite3LogEst(tls, uint64((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows))
 149347 
 149348 	if (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxFlags&SQLITE_INDEX_SCAN_UNIQUE != 0 {
 149349 		*(*U32)(unsafe.Pointer(pNew + 56)) |= U32(WHERE_ONEROW)
 149350 	} else {
 149351 		*(*U32)(unsafe.Pointer(pNew + 56)) &= libc.Uint32FromInt32(libc.CplInt32(WHERE_ONEROW))
 149352 	}
 149353 	rc = whereLoopInsert(tls, pBuilder, pNew)
 149354 	if U32(int32(*(*uint8)(unsafe.Pointer(pNew + 24 + 4))&0x1>>0)) != 0 {
 149355 		Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pNew + 24 + 16)))
 149356 		libc.SetBitFieldPtr8Uint32(pNew+24+4, U32(0), 0, 0x1)
 149357 	}
 149358 
 149359 	return rc
 149360 }
 149361 
 149362 // Return the collating sequence for a constraint passed into xBestIndex.
 149363 //
 149364 // pIdxInfo must be an sqlite3_index_info structure passed into xBestIndex.
 149365 // This routine depends on there being a HiddenIndexInfo structure immediately
 149366 // following the sqlite3_index_info structure.
 149367 //
 149368 // Return a pointer to the collation name:
 149369 //
 149370 //  1. If there is an explicit COLLATE operator on the constaint, return it.
 149371 //
 149372 //  2. Else, if the column has an alternative collation, return that.
 149373 //
 149374 //  3. Otherwise, return "BINARY".
 149375 func Xsqlite3_vtab_collation(tls *libc.TLS, pIdxInfo uintptr, iCons int32) uintptr {
 149376 	var pHidden uintptr = pIdxInfo + 1*96
 149377 	var zRet uintptr = uintptr(0)
 149378 	if iCons >= 0 && iCons < (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint {
 149379 		var pC uintptr = uintptr(0)
 149380 		var iTerm int32 = (*sqlite3_index_constraint)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iCons)*12)).FiTermOffset
 149381 		var pX uintptr = (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer((*HiddenIndexInfo)(unsafe.Pointer(pHidden)).FpWC)).Fa + uintptr(iTerm)*56)).FpExpr
 149382 		if (*Expr)(unsafe.Pointer(pX)).FpLeft != 0 {
 149383 			pC = Xsqlite3ExprCompareCollSeq(tls, (*HiddenIndexInfo)(unsafe.Pointer(pHidden)).FpParse, pX)
 149384 		}
 149385 		zRet = func() uintptr {
 149386 			if pC != 0 {
 149387 				return (*CollSeq)(unsafe.Pointer(pC)).FzName
 149388 			}
 149389 			return uintptr(unsafe.Pointer(&Xsqlite3StrBINARY))
 149390 		}()
 149391 	}
 149392 	return zRet
 149393 }
 149394 
 149395 // Return true if constraint iCons is really an IN(...) constraint, or
 149396 // false otherwise. If iCons is an IN(...) constraint, set (if bHandle!=0)
 149397 // or clear (if bHandle==0) the flag to handle it using an iterator.
 149398 func Xsqlite3_vtab_in(tls *libc.TLS, pIdxInfo uintptr, iCons int32, bHandle int32) int32 {
 149399 	var pHidden uintptr = pIdxInfo + 1*96
 149400 	var m U32 = func() uint32 {
 149401 		if iCons <= 31 {
 149402 			return uint32(1) << iCons
 149403 		}
 149404 		return uint32(0)
 149405 	}()
 149406 	if m&(*HiddenIndexInfo)(unsafe.Pointer(pHidden)).FmIn != 0 {
 149407 		if bHandle == 0 {
 149408 			*(*U32)(unsafe.Pointer(pHidden + 24)) &= ^m
 149409 		} else if bHandle > 0 {
 149410 			*(*U32)(unsafe.Pointer(pHidden + 24)) |= m
 149411 		}
 149412 		return 1
 149413 	}
 149414 	return 0
 149415 }
 149416 
 149417 // This interface is callable from within the xBestIndex callback only.
 149418 //
 149419 // If possible, set (*ppVal) to point to an object containing the value
 149420 // on the right-hand-side of constraint iCons.
 149421 func Xsqlite3_vtab_rhs_value(tls *libc.TLS, pIdxInfo uintptr, iCons int32, ppVal uintptr) int32 {
 149422 	var pH uintptr = pIdxInfo + 1*96
 149423 	var pVal uintptr = uintptr(0)
 149424 	var rc int32 = SQLITE_OK
 149425 	if iCons < 0 || iCons >= (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint {
 149426 		rc = SQLITE_MISUSE
 149427 	} else {
 149428 		if *(*uintptr)(unsafe.Pointer(pH + 32 + uintptr(iCons)*8)) == uintptr(0) {
 149429 			var pTerm uintptr = (*WhereClause)(unsafe.Pointer((*HiddenIndexInfo)(unsafe.Pointer(pH)).FpWC)).Fa + uintptr((*sqlite3_index_constraint)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint+uintptr(iCons)*12)).FiTermOffset)*56
 149430 			rc = Xsqlite3ValueFromExpr(tls,
 149431 				(*Parse)(unsafe.Pointer((*HiddenIndexInfo)(unsafe.Pointer(pH)).FpParse)).Fdb, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight, (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*HiddenIndexInfo)(unsafe.Pointer(pH)).FpParse)).Fdb)).Fenc,
 149432 				uint8(SQLITE_AFF_BLOB), pH+32+uintptr(iCons)*8)
 149433 
 149434 		}
 149435 		pVal = *(*uintptr)(unsafe.Pointer(pH + 32 + uintptr(iCons)*8))
 149436 	}
 149437 	*(*uintptr)(unsafe.Pointer(ppVal)) = pVal
 149438 
 149439 	if rc == SQLITE_OK && pVal == uintptr(0) {
 149440 		rc = SQLITE_NOTFOUND
 149441 	}
 149442 
 149443 	return rc
 149444 }
 149445 
 149446 // Return true if ORDER BY clause may be handled as DISTINCT.
 149447 func Xsqlite3_vtab_distinct(tls *libc.TLS, pIdxInfo uintptr) int32 {
 149448 	var pHidden uintptr = pIdxInfo + 1*96
 149449 
 149450 	return (*HiddenIndexInfo)(unsafe.Pointer(pHidden)).FeDistinct
 149451 }
 149452 
 149453 func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable Bitmask) int32 {
 149454 	bp := tls.Alloc(12)
 149455 	defer tls.Free(12)
 149456 
 149457 	var rc int32 = SQLITE_OK
 149458 	var pWInfo uintptr
 149459 	var pParse uintptr
 149460 	var pWC uintptr
 149461 	var pSrc uintptr
 149462 	var p uintptr
 149463 	var nConstraint int32
 149464 
 149465 	var pNew uintptr
 149466 	var mBest Bitmask
 149467 
 149468 	*(*int32)(unsafe.Pointer(bp + 8)) = 0
 149469 
 149470 	pWInfo = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo
 149471 	pParse = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse
 149472 	pWC = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC
 149473 	pNew = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew
 149474 	pSrc = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*WhereLoop)(unsafe.Pointer(pNew)).FiTab)*104
 149475 
 149476 	p = allocateIndexInfo(tls, pWInfo, pWC, mUnusable, pSrc, bp)
 149477 	if p == uintptr(0) {
 149478 		return SQLITE_NOMEM
 149479 	}
 149480 	(*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(0)
 149481 	(*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_VIRTUALTABLE)
 149482 	(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm = U16(0)
 149483 	libc.SetBitFieldPtr8Uint32(pNew+24+4, U32(0), 0, 0x1)
 149484 	nConstraint = (*Sqlite3_index_info)(unsafe.Pointer(p)).FnConstraint
 149485 	if whereLoopResize(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pNew, nConstraint) != 0 {
 149486 		freeIndexInfo(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, p)
 149487 		return SQLITE_NOMEM
 149488 	}
 149489 
 149490 	rc = whereLoopAddVirtualOne(tls,
 149491 		pBuilder, mPrereq, libc.Uint64(libc.Uint64FromInt32(-1)), uint16(0), p, *(*U16)(unsafe.Pointer(bp)), bp+4, bp+8)
 149492 	if *(*int32)(unsafe.Pointer(bp + 8)) != 0 {
 149493 		rc = whereLoopAddVirtualOne(tls,
 149494 			pBuilder, mPrereq, libc.Uint64(libc.Uint64FromInt32(-1)), uint16(0), p, *(*U16)(unsafe.Pointer(bp)), bp+4, uintptr(0))
 149495 	}
 149496 
 149497 	if rc == SQLITE_OK && (libc.AssignUint64(&mBest, (*WhereLoop)(unsafe.Pointer(pNew)).Fprereq & ^mPrereq) != uint64(0) || *(*int32)(unsafe.Pointer(bp + 4)) != 0) {
 149498 		var seenZero int32 = 0
 149499 		var seenZeroNoIN int32 = 0
 149500 		var mPrev Bitmask = uint64(0)
 149501 		var mBestNoIn Bitmask = uint64(0)
 149502 
 149503 		if *(*int32)(unsafe.Pointer(bp + 4)) != 0 {
 149504 			rc = whereLoopAddVirtualOne(tls,
 149505 				pBuilder, mPrereq, libc.Uint64(libc.Uint64FromInt32(-1)), uint16(WO_IN), p, *(*U16)(unsafe.Pointer(bp)), bp+4, uintptr(0))
 149506 
 149507 			mBestNoIn = (*WhereLoop)(unsafe.Pointer(pNew)).Fprereq & ^mPrereq
 149508 			if mBestNoIn == uint64(0) {
 149509 				seenZero = 1
 149510 				seenZeroNoIN = 1
 149511 			}
 149512 		}
 149513 
 149514 		for rc == SQLITE_OK {
 149515 			var i int32
 149516 			var mNext Bitmask = libc.Uint64(libc.Uint64FromInt32(-1))
 149517 
 149518 			for i = 0; i < nConstraint; i++ {
 149519 				var mThis Bitmask = (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr((*sqlite3_index_constraint)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(p)).FaConstraint+uintptr(i)*12)).FiTermOffset)*56)).FprereqRight & ^mPrereq
 149520 				if mThis > mPrev && mThis < mNext {
 149521 					mNext = mThis
 149522 				}
 149523 			}
 149524 			mPrev = mNext
 149525 			if mNext == libc.Uint64(libc.Uint64FromInt32(-1)) {
 149526 				break
 149527 			}
 149528 			if mNext == mBest || mNext == mBestNoIn {
 149529 				continue
 149530 			}
 149531 
 149532 			rc = whereLoopAddVirtualOne(tls,
 149533 				pBuilder, mPrereq, mNext|mPrereq, uint16(0), p, *(*U16)(unsafe.Pointer(bp)), bp+4, uintptr(0))
 149534 			if (*WhereLoop)(unsafe.Pointer(pNew)).Fprereq == mPrereq {
 149535 				seenZero = 1
 149536 				if *(*int32)(unsafe.Pointer(bp + 4)) == 0 {
 149537 					seenZeroNoIN = 1
 149538 				}
 149539 			}
 149540 		}
 149541 
 149542 		if rc == SQLITE_OK && seenZero == 0 {
 149543 			rc = whereLoopAddVirtualOne(tls,
 149544 				pBuilder, mPrereq, mPrereq, uint16(0), p, *(*U16)(unsafe.Pointer(bp)), bp+4, uintptr(0))
 149545 			if *(*int32)(unsafe.Pointer(bp + 4)) == 0 {
 149546 				seenZeroNoIN = 1
 149547 			}
 149548 		}
 149549 
 149550 		if rc == SQLITE_OK && seenZeroNoIN == 0 {
 149551 			rc = whereLoopAddVirtualOne(tls,
 149552 				pBuilder, mPrereq, mPrereq, uint16(WO_IN), p, *(*U16)(unsafe.Pointer(bp)), bp+4, uintptr(0))
 149553 		}
 149554 	}
 149555 
 149556 	if (*Sqlite3_index_info)(unsafe.Pointer(p)).FneedToFreeIdxStr != 0 {
 149557 		Xsqlite3_free(tls, (*Sqlite3_index_info)(unsafe.Pointer(p)).FidxStr)
 149558 	}
 149559 	freeIndexInfo(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, p)
 149560 
 149561 	return rc
 149562 }
 149563 
 149564 func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable Bitmask) int32 {
 149565 	bp := tls.Alloc(712)
 149566 	defer tls.Free(712)
 149567 
 149568 	var pWInfo uintptr = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo
 149569 	var pWC uintptr
 149570 	var pNew uintptr
 149571 	var pTerm uintptr
 149572 	var pWCEnd uintptr
 149573 	var rc int32 = SQLITE_OK
 149574 	var iCur int32
 149575 
 149576 	var pItem uintptr
 149577 
 149578 	pWC = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC
 149579 	pWCEnd = (*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)*56
 149580 	pNew = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew
 149581 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(WhereOrSet{})))
 149582 	pItem = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*WhereLoop)(unsafe.Pointer(pNew)).FiTab)*104
 149583 	iCur = (*SrcItem)(unsafe.Pointer(pItem)).FiCursor
 149584 
 149585 	if int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&JT_RIGHT != 0 {
 149586 		return SQLITE_OK
 149587 	}
 149588 
 149589 	for pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa; pTerm < pWCEnd && rc == SQLITE_OK; pTerm += 56 {
 149590 		if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&WO_OR != 0 &&
 149591 			(*WhereOrInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTerm + 32)))).Findexable&(*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf != uint64(0) {
 149592 			var pOrWC uintptr = *(*uintptr)(unsafe.Pointer(pTerm + 32))
 149593 			var pOrWCEnd uintptr = (*WhereClause)(unsafe.Pointer(pOrWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pOrWC)).FnTerm)*56
 149594 			var pOrTerm uintptr
 149595 			var once int32 = 1
 149596 			var i int32
 149597 			var j int32
 149598 
 149599 			*(*WhereLoopBuilder)(unsafe.Pointer(bp + 600)) = *(*WhereLoopBuilder)(unsafe.Pointer(pBuilder))
 149600 			(*WhereLoopBuilder)(unsafe.Pointer(bp + 600)).FpOrSet = bp + 56
 149601 
 149602 			for pOrTerm = (*WhereClause)(unsafe.Pointer(pOrWC)).Fa; pOrTerm < pOrWCEnd; pOrTerm += 56 {
 149603 				if int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator)&WO_AND != 0 {
 149604 					(*WhereLoopBuilder)(unsafe.Pointer(bp + 600)).FpWC = *(*uintptr)(unsafe.Pointer(pOrTerm + 32))
 149605 				} else if (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor == iCur {
 149606 					(*WhereClause)(unsafe.Pointer(bp + 112)).FpWInfo = (*WhereClause)(unsafe.Pointer(pWC)).FpWInfo
 149607 					(*WhereClause)(unsafe.Pointer(bp + 112)).FpOuter = pWC
 149608 					(*WhereClause)(unsafe.Pointer(bp + 112)).Fop = U8(TK_AND)
 149609 					(*WhereClause)(unsafe.Pointer(bp + 112)).FnTerm = 1
 149610 					(*WhereClause)(unsafe.Pointer(bp + 112)).FnBase = 1
 149611 					(*WhereClause)(unsafe.Pointer(bp + 112)).Fa = pOrTerm
 149612 					(*WhereLoopBuilder)(unsafe.Pointer(bp + 600)).FpWC = bp + 112
 149613 				} else {
 149614 					continue
 149615 				}
 149616 				(*WhereOrSet)(unsafe.Pointer(bp + 56)).Fn = U16(0)
 149617 				if int32((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpTab)).FeTabType) == TABTYP_VTAB {
 149618 					rc = whereLoopAddVirtual(tls, bp+600, mPrereq, mUnusable)
 149619 				} else {
 149620 					rc = whereLoopAddBtree(tls, bp+600, mPrereq)
 149621 				}
 149622 				if rc == SQLITE_OK {
 149623 					rc = whereLoopAddOr(tls, bp+600, mPrereq, mUnusable)
 149624 				}
 149625 
 149626 				if int32((*WhereOrSet)(unsafe.Pointer(bp+56)).Fn) == 0 {
 149627 					(*WhereOrSet)(unsafe.Pointer(bp)).Fn = U16(0)
 149628 					break
 149629 				} else if once != 0 {
 149630 					whereOrMove(tls, bp, bp+56)
 149631 					once = 0
 149632 				} else {
 149633 					whereOrMove(tls, bp+656, bp)
 149634 					(*WhereOrSet)(unsafe.Pointer(bp)).Fn = U16(0)
 149635 					for i = 0; i < int32((*WhereOrSet)(unsafe.Pointer(bp+656)).Fn); i++ {
 149636 						for j = 0; j < int32((*WhereOrSet)(unsafe.Pointer(bp+56)).Fn); j++ {
 149637 							whereOrInsert(tls, bp, (*WhereOrCost)(unsafe.Pointer(bp+656+8+uintptr(i)*16)).Fprereq|(*WhereOrCost)(unsafe.Pointer(bp+56+8+uintptr(j)*16)).Fprereq,
 149638 								Xsqlite3LogEstAdd(tls, (*WhereOrCost)(unsafe.Pointer(bp+656+8+uintptr(i)*16)).FrRun, (*WhereOrCost)(unsafe.Pointer(bp+56+8+uintptr(j)*16)).FrRun),
 149639 								Xsqlite3LogEstAdd(tls, (*WhereOrCost)(unsafe.Pointer(bp+656+8+uintptr(i)*16)).FnOut, (*WhereOrCost)(unsafe.Pointer(bp+56+8+uintptr(j)*16)).FnOut))
 149640 						}
 149641 					}
 149642 				}
 149643 			}
 149644 			(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm = U16(1)
 149645 			*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm)) = pTerm
 149646 			(*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_MULTI_OR)
 149647 			(*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(0)
 149648 			(*WhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = U8(0)
 149649 			libc.Xmemset(tls, pNew+24, 0, uint64(unsafe.Sizeof(struct {
 149650 				Fbtree struct {
 149651 					FnEq          U16
 149652 					FnBtm         U16
 149653 					FnTop         U16
 149654 					FnDistinctCol U16
 149655 					FpIndex       uintptr
 149656 				}
 149657 				F__ccgo_pad1 [16]byte
 149658 			}{})))
 149659 			for i = 0; rc == SQLITE_OK && i < int32((*WhereOrSet)(unsafe.Pointer(bp)).Fn); i++ {
 149660 				(*WhereLoop)(unsafe.Pointer(pNew)).FrRun = LogEst(int32((*WhereOrCost)(unsafe.Pointer(bp+8+uintptr(i)*16)).FrRun) + 1)
 149661 				(*WhereLoop)(unsafe.Pointer(pNew)).FnOut = (*WhereOrCost)(unsafe.Pointer(bp + 8 + uintptr(i)*16)).FnOut
 149662 				(*WhereLoop)(unsafe.Pointer(pNew)).Fprereq = (*WhereOrCost)(unsafe.Pointer(bp + 8 + uintptr(i)*16)).Fprereq
 149663 				rc = whereLoopInsert(tls, pBuilder, pNew)
 149664 			}
 149665 
 149666 		}
 149667 	}
 149668 	return rc
 149669 }
 149670 
 149671 func whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) int32 {
 149672 	var pWInfo uintptr = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo
 149673 	var mPrereq Bitmask = uint64(0)
 149674 	var mPrior Bitmask = uint64(0)
 149675 	var iTab int32
 149676 	var pTabList uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList
 149677 	var pItem uintptr
 149678 	var pEnd uintptr = pTabList + 8 + uintptr((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)*104
 149679 	var db uintptr = (*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb
 149680 	var rc int32 = SQLITE_OK
 149681 	var bFirstPastRJ int32 = 0
 149682 	var hasRightJoin int32 = 0
 149683 	var pNew uintptr
 149684 
 149685 	pNew = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew
 149686 
 149687 	(*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FiPlanLimit = uint32(SQLITE_QUERY_PLANNER_LIMIT)
 149688 	iTab = 0
 149689 	pItem = pTabList + 8
 149690 __1:
 149691 	if !(pItem < pEnd) {
 149692 		goto __3
 149693 	}
 149694 	{
 149695 		var mUnusable Bitmask = uint64(0)
 149696 		(*WhereLoop)(unsafe.Pointer(pNew)).FiTab = U8(iTab)
 149697 		*(*uint32)(unsafe.Pointer(pBuilder + 48)) += uint32(SQLITE_QUERY_PLANNER_LIMIT_INCR)
 149698 		(*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf = Xsqlite3WhereGetMask(tls, pWInfo+592, (*SrcItem)(unsafe.Pointer(pItem)).FiCursor)
 149699 		if bFirstPastRJ != 0 ||
 149700 			int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&(JT_OUTER|JT_CROSS|JT_LTORJ) != 0 {
 149701 			if int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&JT_LTORJ != 0 {
 149702 				hasRightJoin = 1
 149703 			}
 149704 			mPrereq = mPrereq | mPrior
 149705 			bFirstPastRJ = libc.Bool32(int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&JT_RIGHT != 0)
 149706 		} else if !(hasRightJoin != 0) {
 149707 			mPrereq = uint64(0)
 149708 		}
 149709 		if int32((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpTab)).FeTabType) == TABTYP_VTAB {
 149710 			var p uintptr
 149711 			for p = pItem + 1*104; p < pEnd; p += 104 {
 149712 				if mUnusable != 0 || int32((*SrcItem)(unsafe.Pointer(p)).Ffg.Fjointype)&(JT_OUTER|JT_CROSS) != 0 {
 149713 					mUnusable = mUnusable | Xsqlite3WhereGetMask(tls, pWInfo+592, (*SrcItem)(unsafe.Pointer(p)).FiCursor)
 149714 				}
 149715 			}
 149716 			rc = whereLoopAddVirtual(tls, pBuilder, mPrereq, mUnusable)
 149717 		} else {
 149718 			rc = whereLoopAddBtree(tls, pBuilder, mPrereq)
 149719 		}
 149720 		if rc == SQLITE_OK && (*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC)).FhasOr != 0 {
 149721 			rc = whereLoopAddOr(tls, pBuilder, mPrereq, mUnusable)
 149722 		}
 149723 		mPrior = mPrior | (*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf
 149724 		if rc != 0 || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 149725 			if rc == SQLITE_DONE {
 149726 				Xsqlite3_log(tls, SQLITE_WARNING, ts+23385, 0)
 149727 				rc = SQLITE_OK
 149728 			} else {
 149729 				goto __3
 149730 			}
 149731 		}
 149732 
 149733 	}
 149734 	goto __2
 149735 __2:
 149736 	iTab++
 149737 	pItem += 104
 149738 	goto __1
 149739 	goto __3
 149740 __3:
 149741 	;
 149742 	whereLoopClear(tls, db, pNew)
 149743 	return rc
 149744 }
 149745 
 149746 func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, pPath uintptr, wctrlFlags U16, nLoop U16, pLast uintptr, pRevMask uintptr) I8 {
 149747 	var revSet U8
 149748 	var rev U8
 149749 	var revIdx U8
 149750 	var isOrderDistinct U8
 149751 	var distinctColumns U8
 149752 	var isMatch U8
 149753 	var eqOpMask U16
 149754 	var nKeyCol U16
 149755 	var nColumn U16
 149756 	var nOrderBy U16
 149757 	var iLoop int32
 149758 	var i int32
 149759 	var j int32
 149760 	var iCur int32
 149761 	var iColumn int32
 149762 	var pLoop uintptr = uintptr(0)
 149763 	var pTerm uintptr
 149764 	var pOBExpr uintptr
 149765 	var pColl uintptr
 149766 	var pIndex uintptr
 149767 	var db uintptr = (*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb
 149768 	var obSat Bitmask = uint64(0)
 149769 	var obDone Bitmask
 149770 	var orderDistinctMask Bitmask
 149771 	var ready Bitmask
 149772 
 149773 	if nLoop != 0 && (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_OrderByIdxJoin) != U32(0) {
 149774 		return int8(0)
 149775 	}
 149776 
 149777 	nOrderBy = U16((*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr)
 149778 
 149779 	if int32(nOrderBy) > int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8))-1 {
 149780 		return int8(0)
 149781 	}
 149782 	isOrderDistinct = U8(1)
 149783 	obDone = uint64(1)<<int32(nOrderBy) - uint64(1)
 149784 	orderDistinctMask = uint64(0)
 149785 	ready = uint64(0)
 149786 	eqOpMask = U16(WO_EQ | WO_IS | WO_ISNULL)
 149787 	if int32(wctrlFlags)&(WHERE_ORDERBY_LIMIT|WHERE_ORDERBY_MAX|WHERE_ORDERBY_MIN) != 0 {
 149788 		eqOpMask = U16(int32(eqOpMask) | WO_IN)
 149789 	}
 149790 	for iLoop = 0; isOrderDistinct != 0 && obSat < obDone && iLoop <= int32(nLoop); iLoop++ {
 149791 		if iLoop > 0 {
 149792 			ready = ready | (*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf
 149793 		}
 149794 		if iLoop < int32(nLoop) {
 149795 			pLoop = *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pPath)).FaLoop + uintptr(iLoop)*8))
 149796 			if int32(wctrlFlags)&WHERE_ORDERBY_LIMIT != 0 {
 149797 				continue
 149798 			}
 149799 		} else {
 149800 			pLoop = pLast
 149801 		}
 149802 		if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_VIRTUALTABLE) != 0 {
 149803 			if *(*I8)(unsafe.Pointer(pLoop + 24 + 6)) != 0 &&
 149804 				int32(wctrlFlags)&(WHERE_DISTINCTBY|WHERE_SORTBYGROUP) != WHERE_DISTINCTBY {
 149805 				obSat = obDone
 149806 			}
 149807 			break
 149808 		} else if int32(wctrlFlags)&WHERE_DISTINCTBY != 0 {
 149809 			*(*U16)(unsafe.Pointer(pLoop + 24 + 6)) = U16(0)
 149810 		}
 149811 		iCur = (*SrcItem)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*WhereLoop)(unsafe.Pointer(pLoop)).FiTab)*104)).FiCursor
 149812 
 149813 		for i = 0; i < int32(nOrderBy); i++ {
 149814 			if uint64(1)<<i&obSat != 0 {
 149815 				continue
 149816 			}
 149817 			pOBExpr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer(pOrderBy+8+uintptr(i)*32)).FpExpr)
 149818 			if pOBExpr == uintptr(0) {
 149819 				continue
 149820 			}
 149821 			if int32((*Expr)(unsafe.Pointer(pOBExpr)).Fop) != TK_COLUMN && int32((*Expr)(unsafe.Pointer(pOBExpr)).Fop) != TK_AGG_COLUMN {
 149822 				continue
 149823 			}
 149824 			if (*Expr)(unsafe.Pointer(pOBExpr)).FiTable != iCur {
 149825 				continue
 149826 			}
 149827 			pTerm = Xsqlite3WhereFindTerm(tls, pWInfo+104, iCur, int32((*Expr)(unsafe.Pointer(pOBExpr)).FiColumn),
 149828 				^ready, uint32(eqOpMask), uintptr(0))
 149829 			if pTerm == uintptr(0) {
 149830 				continue
 149831 			}
 149832 			if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) == WO_IN {
 149833 				for j = 0; j < int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm) && pTerm != *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*8)); j++ {
 149834 				}
 149835 				if j >= int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm) {
 149836 					continue
 149837 				}
 149838 			}
 149839 			if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(WO_EQ|WO_IS) != 0 && int32((*Expr)(unsafe.Pointer(pOBExpr)).FiColumn) >= 0 {
 149840 				var pParse uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse
 149841 				var pColl1 uintptr = Xsqlite3ExprNNCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer(pOrderBy+8+uintptr(i)*32)).FpExpr)
 149842 				var pColl2 uintptr = Xsqlite3ExprCompareCollSeq(tls, pParse, (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)
 149843 
 149844 				if pColl2 == uintptr(0) || Xsqlite3StrICmp(tls, (*CollSeq)(unsafe.Pointer(pColl1)).FzName, (*CollSeq)(unsafe.Pointer(pColl2)).FzName) != 0 {
 149845 					continue
 149846 				}
 149847 
 149848 			}
 149849 			obSat = obSat | uint64(1)<<i
 149850 		}
 149851 
 149852 		if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_ONEROW) == U32(0) {
 149853 			if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IPK) != 0 {
 149854 				pIndex = uintptr(0)
 149855 				nKeyCol = U16(0)
 149856 				nColumn = U16(1)
 149857 			} else if libc.AssignUintptr(&pIndex, *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8))) == uintptr(0) || uint32(int32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x4>>2)) != 0 {
 149858 				return int8(0)
 149859 			} else {
 149860 				nKeyCol = (*Index)(unsafe.Pointer(pIndex)).FnKeyCol
 149861 				nColumn = (*Index)(unsafe.Pointer(pIndex)).FnColumn
 149862 
 149863 				isOrderDistinct = U8(libc.Bool32(int32((*Index)(unsafe.Pointer(pIndex)).FonError) != OE_None &&
 149864 					(*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_SKIPSCAN) == U32(0)))
 149865 			}
 149866 
 149867 			rev = libc.AssignUint8(&revSet, U8(0))
 149868 			distinctColumns = U8(0)
 149869 			for j = 0; j < int32(nColumn); j++ {
 149870 				var bOnce U8 = U8(1)
 149871 
 149872 				if j < int32(*(*U16)(unsafe.Pointer(pLoop + 24))) && j >= int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnSkip) {
 149873 					var eOp U16 = (*WhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*8)))).FeOperator
 149874 
 149875 					if int32(eOp)&int32(eqOpMask) != 0 {
 149876 						if int32(eOp)&(WO_ISNULL|WO_IS) != 0 {
 149877 							isOrderDistinct = U8(0)
 149878 						}
 149879 						continue
 149880 					} else if int32(eOp)&WO_IN != 0 {
 149881 						var pX uintptr = (*WhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*8)))).FpExpr
 149882 						for i = j + 1; i < int32(*(*U16)(unsafe.Pointer(pLoop + 24))); i++ {
 149883 							if (*WhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)))).FpExpr == pX {
 149884 								bOnce = U8(0)
 149885 								break
 149886 							}
 149887 						}
 149888 					}
 149889 				}
 149890 
 149891 				if pIndex != 0 {
 149892 					iColumn = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(j)*2)))
 149893 					revIdx = U8(int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaSortOrder + uintptr(j)))) & KEYINFO_ORDER_DESC)
 149894 					if iColumn == int32((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FpTable)).FiPKey) {
 149895 						iColumn = -1
 149896 					}
 149897 				} else {
 149898 					iColumn = -1
 149899 					revIdx = U8(0)
 149900 				}
 149901 
 149902 				if isOrderDistinct != 0 {
 149903 					if iColumn >= 0 &&
 149904 						j >= int32(*(*U16)(unsafe.Pointer(pLoop + 24))) &&
 149905 						int32(*(*uint8)(unsafe.Pointer((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FpTable)).FaCol + uintptr(iColumn)*24 + 8))&0xf>>0) == 0 {
 149906 						isOrderDistinct = U8(0)
 149907 					}
 149908 					if iColumn == -2 {
 149909 						isOrderDistinct = U8(0)
 149910 					}
 149911 				}
 149912 
 149913 				isMatch = U8(0)
 149914 				for i = 0; bOnce != 0 && i < int32(nOrderBy); i++ {
 149915 					if uint64(1)<<i&obSat != 0 {
 149916 						continue
 149917 					}
 149918 					pOBExpr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer(pOrderBy+8+uintptr(i)*32)).FpExpr)
 149919 
 149920 					if pOBExpr == uintptr(0) {
 149921 						continue
 149922 					}
 149923 					if int32(wctrlFlags)&(WHERE_GROUPBY|WHERE_DISTINCTBY) == 0 {
 149924 						bOnce = U8(0)
 149925 					}
 149926 					if iColumn >= -1 {
 149927 						if int32((*Expr)(unsafe.Pointer(pOBExpr)).Fop) != TK_COLUMN && int32((*Expr)(unsafe.Pointer(pOBExpr)).Fop) != TK_AGG_COLUMN {
 149928 							continue
 149929 						}
 149930 						if (*Expr)(unsafe.Pointer(pOBExpr)).FiTable != iCur {
 149931 							continue
 149932 						}
 149933 						if int32((*Expr)(unsafe.Pointer(pOBExpr)).FiColumn) != iColumn {
 149934 							continue
 149935 						}
 149936 					} else {
 149937 						var pIxExpr uintptr = (*ExprList_item)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaColExpr + 8 + uintptr(j)*32)).FpExpr
 149938 						if Xsqlite3ExprCompareSkip(tls, pOBExpr, pIxExpr, iCur) != 0 {
 149939 							continue
 149940 						}
 149941 					}
 149942 					if iColumn != -1 {
 149943 						pColl = Xsqlite3ExprNNCollSeq(tls, (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse, (*ExprList_item)(unsafe.Pointer(pOrderBy+8+uintptr(i)*32)).FpExpr)
 149944 						if Xsqlite3StrICmp(tls, (*CollSeq)(unsafe.Pointer(pColl)).FzName, *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FazColl + uintptr(j)*8))) != 0 {
 149945 							continue
 149946 						}
 149947 					}
 149948 					if int32(wctrlFlags)&WHERE_DISTINCTBY != 0 {
 149949 						*(*U16)(unsafe.Pointer(pLoop + 24 + 6)) = U16(j + 1)
 149950 					}
 149951 					isMatch = U8(1)
 149952 					break
 149953 				}
 149954 				if isMatch != 0 && int32(wctrlFlags)&WHERE_GROUPBY == 0 {
 149955 					if revSet != 0 {
 149956 						if int32(rev)^int32(revIdx) !=
 149957 							int32((*ExprList_item)(unsafe.Pointer(pOrderBy+8+uintptr(i)*32)).Ffg.FsortFlags)&KEYINFO_ORDER_DESC {
 149958 							isMatch = U8(0)
 149959 						}
 149960 					} else {
 149961 						rev = U8(int32(revIdx) ^ int32((*ExprList_item)(unsafe.Pointer(pOrderBy+8+uintptr(i)*32)).Ffg.FsortFlags)&KEYINFO_ORDER_DESC)
 149962 						if rev != 0 {
 149963 							*(*Bitmask)(unsafe.Pointer(pRevMask)) |= uint64(1) << iLoop
 149964 						}
 149965 						revSet = U8(1)
 149966 					}
 149967 				}
 149968 				if isMatch != 0 && int32((*ExprList_item)(unsafe.Pointer(pOrderBy+8+uintptr(i)*32)).Ffg.FsortFlags)&KEYINFO_ORDER_BIGNULL != 0 {
 149969 					if j == int32(*(*U16)(unsafe.Pointer(pLoop + 24))) {
 149970 						*(*U32)(unsafe.Pointer(pLoop + 56)) |= U32(WHERE_BIGNULL_SORT)
 149971 					} else {
 149972 						isMatch = U8(0)
 149973 					}
 149974 				}
 149975 				if isMatch != 0 {
 149976 					if iColumn == -1 {
 149977 						distinctColumns = U8(1)
 149978 					}
 149979 					obSat = obSat | uint64(1)<<i
 149980 				} else {
 149981 					if j == 0 || j < int32(nKeyCol) {
 149982 						isOrderDistinct = U8(0)
 149983 					}
 149984 					break
 149985 				}
 149986 			}
 149987 			if distinctColumns != 0 {
 149988 				isOrderDistinct = U8(1)
 149989 			}
 149990 		}
 149991 
 149992 		if isOrderDistinct != 0 {
 149993 			orderDistinctMask = orderDistinctMask | (*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf
 149994 			for i = 0; i < int32(nOrderBy); i++ {
 149995 				var p uintptr
 149996 				var mTerm Bitmask
 149997 				if uint64(1)<<i&obSat != 0 {
 149998 					continue
 149999 				}
 150000 				p = (*ExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32)).FpExpr
 150001 				mTerm = Xsqlite3WhereExprUsage(tls, pWInfo+592, p)
 150002 				if mTerm == uint64(0) && !(Xsqlite3ExprIsConstant(tls, p) != 0) {
 150003 					continue
 150004 				}
 150005 				if mTerm & ^orderDistinctMask == uint64(0) {
 150006 					obSat = obSat | uint64(1)<<i
 150007 				}
 150008 			}
 150009 		}
 150010 	}
 150011 	if obSat == obDone {
 150012 		return I8(nOrderBy)
 150013 	}
 150014 	if !(isOrderDistinct != 0) {
 150015 		for i = int32(nOrderBy) - 1; i > 0; i-- {
 150016 			var m Bitmask
 150017 			if i < int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8)) {
 150018 				m = uint64(1)<<i - uint64(1)
 150019 			} else {
 150020 				m = uint64(0)
 150021 			}
 150022 			if obSat&m == m {
 150023 				return I8(i)
 150024 			}
 150025 		}
 150026 		return int8(0)
 150027 	}
 150028 	return int8(-1)
 150029 }
 150030 
 150031 // If the WHERE_GROUPBY flag is set in the mask passed to sqlite3WhereBegin(),
 150032 // the planner assumes that the specified pOrderBy list is actually a GROUP
 150033 // BY clause - and so any order that groups rows as required satisfies the
 150034 // request.
 150035 //
 150036 // Normally, in this case it is not possible for the caller to determine
 150037 // whether or not the rows are really being delivered in sorted order, or
 150038 // just in some other order that provides the required grouping. However,
 150039 // if the WHERE_SORTBYGROUP flag is also passed to sqlite3WhereBegin(), then
 150040 // this function may be called on the returned WhereInfo object. It returns
 150041 // true if the rows really will be sorted in the specified order, or false
 150042 // otherwise.
 150043 //
 150044 // For example, assuming:
 150045 //
 150046 //	CREATE INDEX i1 ON t1(x, Y);
 150047 //
 150048 // then
 150049 //
 150050 //	SELECT * FROM t1 GROUP BY x,y ORDER BY x,y;   -- IsSorted()==1
 150051 //	SELECT * FROM t1 GROUP BY y,x ORDER BY y,x;   -- IsSorted()==0
 150052 func Xsqlite3WhereIsSorted(tls *libc.TLS, pWInfo uintptr) int32 {
 150053 	return int32(*(*uint8)(unsafe.Pointer(pWInfo + 68)) & 0x8 >> 3)
 150054 }
 150055 
 150056 func whereSortingCost(tls *libc.TLS, pWInfo uintptr, nRow LogEst, nOrderBy int32, nSorted int32) LogEst {
 150057 	var rSortCost LogEst
 150058 	var nCol LogEst
 150059 
 150060 	nCol = Xsqlite3LogEst(tls, uint64(((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FpEList)).FnExpr+59)/30))
 150061 	rSortCost = LogEst(int32(nRow) + int32(nCol))
 150062 	if nSorted > 0 {
 150063 		rSortCost = LogEst(int32(rSortCost) + (int32(Xsqlite3LogEst(tls, uint64((nOrderBy-nSorted)*100/nOrderBy))) - 66))
 150064 	}
 150065 
 150066 	if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_USE_LIMIT != 0 {
 150067 		rSortCost = int16(int32(rSortCost) + 10)
 150068 		if nSorted != 0 {
 150069 			rSortCost = int16(int32(rSortCost) + 6)
 150070 		}
 150071 		if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FiLimit) < int32(nRow) {
 150072 			nRow = (*WhereInfo)(unsafe.Pointer(pWInfo)).FiLimit
 150073 		}
 150074 	} else if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_WANT_DISTINCT != 0 {
 150075 		if int32(nRow) > 10 {
 150076 			nRow = int16(int32(nRow) - 10)
 150077 		}
 150078 	}
 150079 	rSortCost = LogEst(int32(rSortCost) + int32(estLog(tls, nRow)))
 150080 	return rSortCost
 150081 }
 150082 
 150083 func wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst LogEst) int32 {
 150084 	bp := tls.Alloc(32)
 150085 	defer tls.Free(32)
 150086 
 150087 	var mxChoice int32
 150088 	var nLoop int32
 150089 	var pParse uintptr
 150090 	var iLoop int32
 150091 	var ii int32
 150092 	var jj int32
 150093 	var mxI int32 = 0
 150094 	var nOrderBy int32
 150095 	var mxCost LogEst = int16(0)
 150096 	var mxUnsorted LogEst = int16(0)
 150097 	var nTo int32
 150098 	var nFrom int32
 150099 	var aFrom uintptr
 150100 	var aTo uintptr
 150101 	var pFrom uintptr
 150102 	var pTo uintptr
 150103 	var pWLoop uintptr
 150104 	var pX uintptr
 150105 	var aSortCost uintptr = uintptr(0)
 150106 	var pSpace uintptr
 150107 	var nSpace int32
 150108 
 150109 	pParse = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse
 150110 	nLoop = int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)
 150111 
 150112 	if nLoop <= 1 {
 150113 		mxChoice = 1
 150114 	} else {
 150115 		mxChoice = func() int32 {
 150116 			if nLoop == 2 {
 150117 				return 5
 150118 			}
 150119 			return 10
 150120 		}()
 150121 	}
 150122 
 150123 	if (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy == uintptr(0) || int32(nRowEst) == 0 {
 150124 		nOrderBy = 0
 150125 	} else {
 150126 		nOrderBy = (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr
 150127 	}
 150128 
 150129 	nSpace = int32((uint64(unsafe.Sizeof(WherePath{})) + uint64(unsafe.Sizeof(uintptr(0)))*uint64(nLoop)) * uint64(mxChoice) * uint64(2))
 150130 	nSpace = int32(uint64(nSpace) + uint64(unsafe.Sizeof(LogEst(0)))*uint64(nOrderBy))
 150131 	pSpace = Xsqlite3DbMallocRawNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(nSpace))
 150132 	if pSpace == uintptr(0) {
 150133 		return SQLITE_NOMEM
 150134 	}
 150135 	aTo = pSpace
 150136 	aFrom = aTo + uintptr(mxChoice)*32
 150137 	libc.Xmemset(tls, aFrom, 0, uint64(unsafe.Sizeof(WherePath{})))
 150138 	pX = aFrom + uintptr(mxChoice)*32
 150139 	ii = mxChoice * 2
 150140 	pFrom = aTo
 150141 __1:
 150142 	if !(ii > 0) {
 150143 		goto __3
 150144 	}
 150145 	{
 150146 		(*WherePath)(unsafe.Pointer(pFrom)).FaLoop = pX
 150147 
 150148 	}
 150149 	goto __2
 150150 __2:
 150151 	ii--
 150152 	pFrom += 32
 150153 	pX += 8 * uintptr(nLoop)
 150154 	goto __1
 150155 	goto __3
 150156 __3:
 150157 	;
 150158 	if nOrderBy != 0 {
 150159 		aSortCost = pX
 150160 		libc.Xmemset(tls, aSortCost, 0, uint64(unsafe.Sizeof(LogEst(0)))*uint64(nOrderBy))
 150161 	}
 150162 
 150163 	(*WherePath)(unsafe.Pointer(aFrom)).FnRow = func() int16 {
 150164 		if (*Parse)(unsafe.Pointer(pParse)).FnQueryLoop < U32(48) {
 150165 			return int16((*Parse)(unsafe.Pointer(pParse)).FnQueryLoop)
 150166 		}
 150167 		return int16(48)
 150168 	}()
 150169 	nFrom = 1
 150170 
 150171 	if nOrderBy != 0 {
 150172 		(*WherePath)(unsafe.Pointer(aFrom)).FisOrdered = func() int8 {
 150173 			if nLoop > 0 {
 150174 				return int8(-1)
 150175 			}
 150176 			return int8(nOrderBy)
 150177 		}()
 150178 	}
 150179 
 150180 	for iLoop = 0; iLoop < nLoop; iLoop++ {
 150181 		nTo = 0
 150182 		ii = 0
 150183 		pFrom = aFrom
 150184 	__4:
 150185 		if !(ii < nFrom) {
 150186 			goto __6
 150187 		}
 150188 		{
 150189 			for pWLoop = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpLoops; pWLoop != 0; pWLoop = (*WhereLoop)(unsafe.Pointer(pWLoop)).FpNextLoop {
 150190 				var nOut LogEst
 150191 				var rCost LogEst
 150192 				var rUnsorted LogEst
 150193 				var isOrdered I8
 150194 				var maskNew Bitmask
 150195 
 150196 				if (*WhereLoop)(unsafe.Pointer(pWLoop)).Fprereq & ^(*WherePath)(unsafe.Pointer(pFrom)).FmaskLoop != uint64(0) {
 150197 					continue
 150198 				}
 150199 				if (*WhereLoop)(unsafe.Pointer(pWLoop)).FmaskSelf&(*WherePath)(unsafe.Pointer(pFrom)).FmaskLoop != uint64(0) {
 150200 					continue
 150201 				}
 150202 				if (*WhereLoop)(unsafe.Pointer(pWLoop)).FwsFlags&U32(WHERE_AUTO_INDEX) != U32(0) && int32((*WherePath)(unsafe.Pointer(pFrom)).FnRow) < 3 {
 150203 					continue
 150204 				}
 150205 
 150206 				rUnsorted = Xsqlite3LogEstAdd(tls, (*WhereLoop)(unsafe.Pointer(pWLoop)).FrSetup, int16(int32((*WhereLoop)(unsafe.Pointer(pWLoop)).FrRun)+int32((*WherePath)(unsafe.Pointer(pFrom)).FnRow)))
 150207 				rUnsorted = Xsqlite3LogEstAdd(tls, rUnsorted, (*WherePath)(unsafe.Pointer(pFrom)).FrUnsorted)
 150208 				nOut = LogEst(int32((*WherePath)(unsafe.Pointer(pFrom)).FnRow) + int32((*WhereLoop)(unsafe.Pointer(pWLoop)).FnOut))
 150209 				maskNew = (*WherePath)(unsafe.Pointer(pFrom)).FmaskLoop | (*WhereLoop)(unsafe.Pointer(pWLoop)).FmaskSelf
 150210 				isOrdered = (*WherePath)(unsafe.Pointer(pFrom)).FisOrdered
 150211 				if int32(isOrdered) < 0 {
 150212 					*(*Bitmask)(unsafe.Pointer(bp)) = uint64(0)
 150213 					isOrdered = wherePathSatisfiesOrderBy(tls, pWInfo,
 150214 						(*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy, pFrom, (*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags,
 150215 						uint16(iLoop), pWLoop, bp)
 150216 				} else {
 150217 					*(*Bitmask)(unsafe.Pointer(bp)) = (*WherePath)(unsafe.Pointer(pFrom)).FrevLoop
 150218 				}
 150219 				if int32(isOrdered) >= 0 && int32(isOrdered) < nOrderBy {
 150220 					if int32(*(*LogEst)(unsafe.Pointer(aSortCost + uintptr(isOrdered)*2))) == 0 {
 150221 						*(*LogEst)(unsafe.Pointer(aSortCost + uintptr(isOrdered)*2)) = whereSortingCost(tls,
 150222 							pWInfo, nRowEst, nOrderBy, int32(isOrdered))
 150223 					}
 150224 
 150225 					rCost = LogEst(int32(Xsqlite3LogEstAdd(tls, rUnsorted, *(*LogEst)(unsafe.Pointer(aSortCost + uintptr(isOrdered)*2)))) + 3)
 150226 
 150227 				} else {
 150228 					rCost = rUnsorted
 150229 					rUnsorted = int16(int32(rUnsorted) - 2)
 150230 				}
 150231 
 150232 				if iLoop == 0 && (*WhereLoop)(unsafe.Pointer(pWLoop)).FwsFlags&U32(WHERE_VIEWSCAN) != U32(0) {
 150233 					rCost = int16(int32(rCost) + -10)
 150234 					nOut = int16(int32(nOut) + -30)
 150235 				}
 150236 
 150237 				jj = 0
 150238 				pTo = aTo
 150239 			__7:
 150240 				if !(jj < nTo) {
 150241 					goto __9
 150242 				}
 150243 				{
 150244 					if (*WherePath)(unsafe.Pointer(pTo)).FmaskLoop == maskNew &&
 150245 						(int32((*WherePath)(unsafe.Pointer(pTo)).FisOrdered)^int32(isOrdered))&0x80 == 0 {
 150246 						goto __9
 150247 					}
 150248 
 150249 				}
 150250 				goto __8
 150251 			__8:
 150252 				jj++
 150253 				pTo += 32
 150254 				goto __7
 150255 				goto __9
 150256 			__9:
 150257 				;
 150258 				if jj >= nTo {
 150259 					if nTo >= mxChoice &&
 150260 						(int32(rCost) > int32(mxCost) || int32(rCost) == int32(mxCost) && int32(rUnsorted) >= int32(mxUnsorted)) {
 150261 						continue
 150262 					}
 150263 
 150264 					if nTo < mxChoice {
 150265 						jj = libc.PostIncInt32(&nTo, 1)
 150266 					} else {
 150267 						jj = mxI
 150268 					}
 150269 					pTo = aTo + uintptr(jj)*32
 150270 				} else {
 150271 					if int32((*WherePath)(unsafe.Pointer(pTo)).FrCost) < int32(rCost) ||
 150272 						int32((*WherePath)(unsafe.Pointer(pTo)).FrCost) == int32(rCost) &&
 150273 							(int32((*WherePath)(unsafe.Pointer(pTo)).FnRow) < int32(nOut) ||
 150274 								int32((*WherePath)(unsafe.Pointer(pTo)).FnRow) == int32(nOut) && int32((*WherePath)(unsafe.Pointer(pTo)).FrUnsorted) <= int32(rUnsorted)) {
 150275 						continue
 150276 					}
 150277 
 150278 				}
 150279 
 150280 				(*WherePath)(unsafe.Pointer(pTo)).FmaskLoop = (*WherePath)(unsafe.Pointer(pFrom)).FmaskLoop | (*WhereLoop)(unsafe.Pointer(pWLoop)).FmaskSelf
 150281 				(*WherePath)(unsafe.Pointer(pTo)).FrevLoop = *(*Bitmask)(unsafe.Pointer(bp))
 150282 				(*WherePath)(unsafe.Pointer(pTo)).FnRow = nOut
 150283 				(*WherePath)(unsafe.Pointer(pTo)).FrCost = rCost
 150284 				(*WherePath)(unsafe.Pointer(pTo)).FrUnsorted = rUnsorted
 150285 				(*WherePath)(unsafe.Pointer(pTo)).FisOrdered = isOrdered
 150286 				libc.Xmemcpy(tls, (*WherePath)(unsafe.Pointer(pTo)).FaLoop, (*WherePath)(unsafe.Pointer(pFrom)).FaLoop, uint64(unsafe.Sizeof(uintptr(0)))*uint64(iLoop))
 150287 				*(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pTo)).FaLoop + uintptr(iLoop)*8)) = pWLoop
 150288 				if nTo >= mxChoice {
 150289 					mxI = 0
 150290 					mxCost = (*WherePath)(unsafe.Pointer(aTo)).FrCost
 150291 					mxUnsorted = (*WherePath)(unsafe.Pointer(aTo)).FnRow
 150292 					jj = 1
 150293 					pTo = aTo + 1*32
 150294 				__10:
 150295 					if !(jj < mxChoice) {
 150296 						goto __12
 150297 					}
 150298 					{
 150299 						if int32((*WherePath)(unsafe.Pointer(pTo)).FrCost) > int32(mxCost) ||
 150300 							int32((*WherePath)(unsafe.Pointer(pTo)).FrCost) == int32(mxCost) && int32((*WherePath)(unsafe.Pointer(pTo)).FrUnsorted) > int32(mxUnsorted) {
 150301 							mxCost = (*WherePath)(unsafe.Pointer(pTo)).FrCost
 150302 							mxUnsorted = (*WherePath)(unsafe.Pointer(pTo)).FrUnsorted
 150303 							mxI = jj
 150304 						}
 150305 
 150306 					}
 150307 					goto __11
 150308 				__11:
 150309 					jj++
 150310 					pTo += 32
 150311 					goto __10
 150312 					goto __12
 150313 				__12:
 150314 				}
 150315 			}
 150316 
 150317 		}
 150318 		goto __5
 150319 	__5:
 150320 		ii++
 150321 		pFrom += 32
 150322 		goto __4
 150323 		goto __6
 150324 	__6:
 150325 		;
 150326 		pFrom = aTo
 150327 		aTo = aFrom
 150328 		aFrom = pFrom
 150329 		nFrom = nTo
 150330 	}
 150331 
 150332 	if nFrom == 0 {
 150333 		Xsqlite3ErrorMsg(tls, pParse, ts+23420, 0)
 150334 		Xsqlite3DbFreeNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pSpace)
 150335 		return SQLITE_ERROR
 150336 	}
 150337 
 150338 	pFrom = aFrom
 150339 	for ii = 1; ii < nFrom; ii++ {
 150340 		if int32((*WherePath)(unsafe.Pointer(pFrom)).FrCost) > int32((*WherePath)(unsafe.Pointer(aFrom+uintptr(ii)*32)).FrCost) {
 150341 			pFrom = aFrom + uintptr(ii)*32
 150342 		}
 150343 	}
 150344 
 150345 	for iLoop = 0; iLoop < nLoop; iLoop++ {
 150346 		var pLevel uintptr = pWInfo + 856 + uintptr(iLoop)*104
 150347 		(*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop = libc.AssignUintptr(&pWLoop, *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr(iLoop)*8)))
 150348 		(*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom = (*WhereLoop)(unsafe.Pointer(pWLoop)).FiTab
 150349 		(*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur = (*SrcItem)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104)).FiCursor
 150350 	}
 150351 	if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_WANT_DISTINCT != 0 &&
 150352 		int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_DISTINCTBY == 0 &&
 150353 		int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) == WHERE_DISTINCT_NOOP &&
 150354 		nRowEst != 0 {
 150355 		var rc int32 = int32(wherePathSatisfiesOrderBy(tls, pWInfo, (*WhereInfo)(unsafe.Pointer(pWInfo)).FpResultSet, pFrom,
 150356 			uint16(WHERE_DISTINCTBY), uint16(nLoop-1), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr(nLoop-1)*8)), bp+8))
 150357 		if rc == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpResultSet)).FnExpr {
 150358 			(*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_ORDERED)
 150359 		}
 150360 	}
 150361 	libc.SetBitFieldPtr8Uint32(pWInfo+68, uint32(0), 2, 0x4)
 150362 	if (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy != 0 {
 150363 		(*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = (*WherePath)(unsafe.Pointer(pFrom)).FisOrdered
 150364 		if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_DISTINCTBY != 0 {
 150365 			if int32((*WherePath)(unsafe.Pointer(pFrom)).FisOrdered) == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr {
 150366 				(*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_ORDERED)
 150367 			}
 150368 			if (*Select)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FpOrderBy != 0 &&
 150369 				int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat) > (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FpOrderBy)).FnExpr {
 150370 				(*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = I8((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FpOrderBy)).FnExpr)
 150371 			}
 150372 		} else {
 150373 			(*WhereInfo)(unsafe.Pointer(pWInfo)).FrevMask = (*WherePath)(unsafe.Pointer(pFrom)).FrevLoop
 150374 			if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat) <= 0 {
 150375 				(*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = int8(0)
 150376 				if nLoop > 0 {
 150377 					var wsFlags U32 = (*WhereLoop)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr(nLoop-1)*8)))).FwsFlags
 150378 					if wsFlags&U32(WHERE_ONEROW) == U32(0) &&
 150379 						wsFlags&U32(WHERE_IPK|WHERE_COLUMN_IN) != U32(WHERE_IPK|WHERE_COLUMN_IN) {
 150380 						*(*Bitmask)(unsafe.Pointer(bp + 16)) = uint64(0)
 150381 						var rc int32 = int32(wherePathSatisfiesOrderBy(tls, pWInfo, (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy, pFrom,
 150382 							uint16(WHERE_ORDERBY_LIMIT), uint16(nLoop-1), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr(nLoop-1)*8)), bp+16))
 150383 
 150384 						if rc == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr {
 150385 							libc.SetBitFieldPtr8Uint32(pWInfo+68, uint32(1), 2, 0x4)
 150386 							(*WhereInfo)(unsafe.Pointer(pWInfo)).FrevMask = *(*Bitmask)(unsafe.Pointer(bp + 16))
 150387 						}
 150388 					}
 150389 				}
 150390 			} else if nLoop != 0 &&
 150391 				int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat) == 1 &&
 150392 				int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&(WHERE_ORDERBY_MIN|WHERE_ORDERBY_MAX) != 0 {
 150393 				libc.SetBitFieldPtr8Uint32(pWInfo+68, uint32(1), 2, 0x4)
 150394 			}
 150395 		}
 150396 		if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_SORTBYGROUP != 0 &&
 150397 			int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat) == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr && nLoop > 0 {
 150398 			*(*Bitmask)(unsafe.Pointer(bp + 24)) = uint64(0)
 150399 			var nOrder int32 = int32(wherePathSatisfiesOrderBy(tls, pWInfo, (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy,
 150400 				pFrom, uint16(0), uint16(nLoop-1), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr(nLoop-1)*8)), bp+24))
 150401 
 150402 			if nOrder == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr {
 150403 				libc.SetBitFieldPtr8Uint32(pWInfo+68, uint32(1), 3, 0x8)
 150404 				(*WhereInfo)(unsafe.Pointer(pWInfo)).FrevMask = *(*Bitmask)(unsafe.Pointer(bp + 24))
 150405 			}
 150406 		}
 150407 	}
 150408 
 150409 	(*WhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut = (*WherePath)(unsafe.Pointer(pFrom)).FnRow
 150410 
 150411 	Xsqlite3DbFreeNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pSpace)
 150412 	return SQLITE_OK
 150413 }
 150414 
 150415 func whereShortCut(tls *libc.TLS, pBuilder uintptr) int32 {
 150416 	bp := tls.Alloc(112)
 150417 	defer tls.Free(112)
 150418 
 150419 	var pWInfo uintptr
 150420 	var pItem uintptr
 150421 	var pWC uintptr
 150422 	var pTerm uintptr
 150423 	var pLoop uintptr
 150424 	var iCur int32
 150425 	var j int32
 150426 	var pTab uintptr
 150427 	var pIdx uintptr
 150428 
 150429 	pWInfo = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo
 150430 	if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_OR_SUBCLAUSE != 0 {
 150431 		return 0
 150432 	}
 150433 
 150434 	pItem = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8
 150435 	pTab = (*SrcItem)(unsafe.Pointer(pItem)).FpTab
 150436 	if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
 150437 		return 0
 150438 	}
 150439 	if uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x2>>1)) != 0 || uint32(int32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x1>>0)) != 0 {
 150440 		return 0
 150441 	}
 150442 	iCur = (*SrcItem)(unsafe.Pointer(pItem)).FiCursor
 150443 	pWC = pWInfo + 104
 150444 	pLoop = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew
 150445 	(*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = U32(0)
 150446 	(*WhereLoop)(unsafe.Pointer(pLoop)).FnSkip = U16(0)
 150447 	pTerm = whereScanInit(tls, bp, pWC, iCur, -1, uint32(WO_EQ|WO_IS), uintptr(0))
 150448 	for pTerm != 0 && (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight != 0 {
 150449 		pTerm = whereScanNext(tls, bp)
 150450 	}
 150451 	if pTerm != 0 {
 150452 		(*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = U32(WHERE_COLUMN_EQ | WHERE_IPK | WHERE_ONEROW)
 150453 		*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) = pTerm
 150454 		(*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm = U16(1)
 150455 		*(*U16)(unsafe.Pointer(pLoop + 24)) = U16(1)
 150456 
 150457 		(*WhereLoop)(unsafe.Pointer(pLoop)).FrRun = int16(33)
 150458 	} else {
 150459 		for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
 150460 			var opMask int32
 150461 
 150462 			if !(int32((*Index)(unsafe.Pointer(pIdx)).FonError) != OE_None) ||
 150463 				(*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != uintptr(0) ||
 150464 				int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) > int32(uint64(unsafe.Sizeof([3]uintptr{}))/uint64(unsafe.Sizeof(uintptr(0)))) {
 150465 				continue
 150466 			}
 150467 			if uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x8>>3)) != 0 {
 150468 				opMask = WO_EQ | WO_IS
 150469 			} else {
 150470 				opMask = WO_EQ
 150471 			}
 150472 			for j = 0; j < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol); j++ {
 150473 				pTerm = whereScanInit(tls, bp, pWC, iCur, j, uint32(opMask), pIdx)
 150474 				for pTerm != 0 && (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight != 0 {
 150475 					pTerm = whereScanNext(tls, bp)
 150476 				}
 150477 				if pTerm == uintptr(0) {
 150478 					break
 150479 				}
 150480 
 150481 				*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*8)) = pTerm
 150482 			}
 150483 			if j != int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) {
 150484 				continue
 150485 			}
 150486 			(*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = U32(WHERE_COLUMN_EQ | WHERE_ONEROW | WHERE_INDEXED)
 150487 			if uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x20>>5)) != 0 || (*SrcItem)(unsafe.Pointer(pItem)).FcolUsed&(*Index)(unsafe.Pointer(pIdx)).FcolNotIdxed == uint64(0) {
 150488 				*(*U32)(unsafe.Pointer(pLoop + 56)) |= U32(WHERE_IDX_ONLY)
 150489 			}
 150490 			(*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm = U16(j)
 150491 			*(*U16)(unsafe.Pointer(pLoop + 24)) = U16(j)
 150492 			*(*uintptr)(unsafe.Pointer(pLoop + 24 + 8)) = pIdx
 150493 
 150494 			(*WhereLoop)(unsafe.Pointer(pLoop)).FrRun = int16(39)
 150495 			break
 150496 		}
 150497 	}
 150498 	if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags != 0 {
 150499 		(*WhereLoop)(unsafe.Pointer(pLoop)).FnOut = int16(1)
 150500 		(*WhereLevel)(unsafe.Pointer(pWInfo + 856)).FpWLoop = pLoop
 150501 
 150502 		(*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf = uint64(1)
 150503 		(*WhereLevel)(unsafe.Pointer(pWInfo + 856)).FiTabCur = iCur
 150504 		(*WhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut = int16(1)
 150505 		if (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy != 0 {
 150506 			(*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = I8((*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr)
 150507 		}
 150508 		if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_WANT_DISTINCT != 0 {
 150509 			(*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_UNIQUE)
 150510 		}
 150511 		if int32((*WhereScan)(unsafe.Pointer(bp)).FiEquiv) > 1 {
 150512 			*(*U32)(unsafe.Pointer(pLoop + 56)) |= U32(WHERE_TRANSCONS)
 150513 		}
 150514 		return 1
 150515 	}
 150516 	return 0
 150517 }
 150518 
 150519 func exprNodeIsDeterministic(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 150520 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION && libc.Bool32((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_ConstFunc) != U32(0)) == 0 {
 150521 		(*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0)
 150522 		return WRC_Abort
 150523 	}
 150524 	return WRC_Continue
 150525 }
 150526 
 150527 func exprIsDeterministic(tls *libc.TLS, p uintptr) int32 {
 150528 	bp := tls.Alloc(48)
 150529 	defer tls.Free(48)
 150530 
 150531 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Walker{})))
 150532 	(*Walker)(unsafe.Pointer(bp)).FeCode = U16(1)
 150533 	(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 150534 		f func(*libc.TLS, uintptr, uintptr) int32
 150535 	}{exprNodeIsDeterministic}))
 150536 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
 150537 		f func(*libc.TLS, uintptr, uintptr) int32
 150538 	}{Xsqlite3SelectWalkFail}))
 150539 	Xsqlite3WalkExpr(tls, bp, p)
 150540 	return int32((*Walker)(unsafe.Pointer(bp)).FeCode)
 150541 }
 150542 
 150543 func whereOmitNoopJoin(tls *libc.TLS, pWInfo uintptr, notReady Bitmask) Bitmask {
 150544 	var i int32
 150545 	var tabUsed Bitmask
 150546 
 150547 	tabUsed = Xsqlite3WhereExprListUsage(tls, pWInfo+592, (*WhereInfo)(unsafe.Pointer(pWInfo)).FpResultSet)
 150548 	if (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy != 0 {
 150549 		tabUsed = tabUsed | Xsqlite3WhereExprListUsage(tls, pWInfo+592, (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)
 150550 	}
 150551 	for i = int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1; i >= 1; i-- {
 150552 		var pTerm uintptr
 150553 		var pEnd uintptr
 150554 		var pItem uintptr
 150555 		var pLoop uintptr
 150556 		pLoop = (*WhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(i)*104)).FpWLoop
 150557 		pItem = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*WhereLoop)(unsafe.Pointer(pLoop)).FiTab)*104
 150558 		if int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&(JT_LEFT|JT_RIGHT) != JT_LEFT {
 150559 			continue
 150560 		}
 150561 		if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_WANT_DISTINCT == 0 &&
 150562 			(*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_ONEROW) == U32(0) {
 150563 			continue
 150564 		}
 150565 		if tabUsed&(*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf != uint64(0) {
 150566 			continue
 150567 		}
 150568 		pEnd = (*WhereInfo)(unsafe.Pointer(pWInfo)).FsWC.Fa + uintptr((*WhereInfo)(unsafe.Pointer(pWInfo)).FsWC.FnTerm)*56
 150569 		for pTerm = (*WhereInfo)(unsafe.Pointer(pWInfo)).FsWC.Fa; pTerm < pEnd; pTerm += 56 {
 150570 			if (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll&(*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf != uint64(0) {
 150571 				if !((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&U32(EP_OuterON) != U32(0)) ||
 150572 					*(*int32)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr + 52)) != (*SrcItem)(unsafe.Pointer(pItem)).FiCursor {
 150573 					break
 150574 				}
 150575 			}
 150576 		}
 150577 		if pTerm < pEnd {
 150578 			continue
 150579 		}
 150580 
 150581 		notReady = notReady & ^(*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf
 150582 		for pTerm = (*WhereInfo)(unsafe.Pointer(pWInfo)).FsWC.Fa; pTerm < pEnd; pTerm += 56 {
 150583 			if (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll&(*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf != uint64(0) {
 150584 				*(*U16)(unsafe.Pointer(pTerm + 18)) |= U16(TERM_CODED)
 150585 			}
 150586 		}
 150587 		if i != int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-1 {
 150588 			var nByte int32 = int32(uint64(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-1-i) * uint64(unsafe.Sizeof(WhereLevel{})))
 150589 			libc.Xmemmove(tls, pWInfo+856+uintptr(i)*104, pWInfo+856+uintptr(i+1)*104, uint64(nByte))
 150590 		}
 150591 		(*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel--
 150592 
 150593 	}
 150594 	return notReady
 150595 }
 150596 
 150597 func whereCheckIfBloomFilterIsUseful(tls *libc.TLS, pWInfo uintptr) {
 150598 	var i int32
 150599 	var nSearch LogEst = int16(0)
 150600 
 150601 	for i = 0; i < int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel); i++ {
 150602 		var pLoop uintptr = (*WhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(i)*104)).FpWLoop
 150603 		var reqFlags uint32 = uint32(WHERE_SELFCULL | WHERE_COLUMN_EQ)
 150604 		var pItem uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*WhereLoop)(unsafe.Pointer(pLoop)).FiTab)*104
 150605 		var pTab uintptr = (*SrcItem)(unsafe.Pointer(pItem)).FpTab
 150606 		if (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasStat1) == U32(0) {
 150607 			break
 150608 		}
 150609 		*(*U32)(unsafe.Pointer(pTab + 48)) |= U32(TF_StatsUsed)
 150610 		if i >= 1 &&
 150611 			(*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&reqFlags == reqFlags &&
 150612 			(*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IPK|WHERE_INDEXED) != U32(0) {
 150613 			if int32(nSearch) > int32((*Table)(unsafe.Pointer(pTab)).FnRowLogEst) {
 150614 				*(*U32)(unsafe.Pointer(pLoop + 56)) |= U32(WHERE_BLOOMFILTER)
 150615 				*(*U32)(unsafe.Pointer(pLoop + 56)) &= libc.Uint32FromInt32(libc.CplInt32(WHERE_IDX_ONLY))
 150616 
 150617 			}
 150618 		}
 150619 		nSearch = LogEst(int32(nSearch) + int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnOut))
 150620 	}
 150621 }
 150622 
 150623 func whereIndexedExprCleanup(tls *libc.TLS, db uintptr, pObject uintptr) {
 150624 	var pParse uintptr = pObject
 150625 	for (*Parse)(unsafe.Pointer(pParse)).FpIdxEpr != uintptr(0) {
 150626 		var p uintptr = (*Parse)(unsafe.Pointer(pParse)).FpIdxEpr
 150627 		(*Parse)(unsafe.Pointer(pParse)).FpIdxEpr = (*IndexedExpr)(unsafe.Pointer(p)).FpIENext
 150628 		Xsqlite3ExprDelete(tls, db, (*IndexedExpr)(unsafe.Pointer(p)).FpExpr)
 150629 		Xsqlite3DbFreeNN(tls, db, p)
 150630 	}
 150631 }
 150632 
 150633 func whereAddIndexedExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, iIdxCur int32, pTabItem uintptr) {
 150634 	var i int32
 150635 	var p uintptr
 150636 	var pTab uintptr
 150637 
 150638 	pTab = (*Index)(unsafe.Pointer(pIdx)).FpTable
 150639 	for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnColumn); i++ {
 150640 		var pExpr uintptr
 150641 		var j int32 = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2)))
 150642 		var bMaybeNullRow int32
 150643 		if j == -2 {
 150644 			pExpr = (*ExprList_item)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaColExpr + 8 + uintptr(i)*32)).FpExpr
 150645 
 150646 			bMaybeNullRow = libc.Bool32(int32((*SrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&(JT_LEFT|JT_LTORJ|JT_RIGHT) != 0)
 150647 		} else if j >= 0 && int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*24)).FcolFlags)&COLFLAG_VIRTUAL != 0 {
 150648 			pExpr = Xsqlite3ColumnExpr(tls, pTab, (*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*24)
 150649 			bMaybeNullRow = 0
 150650 		} else {
 150651 			continue
 150652 		}
 150653 		if Xsqlite3ExprIsConstant(tls, pExpr) != 0 {
 150654 			continue
 150655 		}
 150656 		p = Xsqlite3DbMallocRaw(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(IndexedExpr{})))
 150657 		if p == uintptr(0) {
 150658 			break
 150659 		}
 150660 		(*IndexedExpr)(unsafe.Pointer(p)).FpIENext = (*Parse)(unsafe.Pointer(pParse)).FpIdxEpr
 150661 		(*IndexedExpr)(unsafe.Pointer(p)).FpExpr = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, 0)
 150662 		(*IndexedExpr)(unsafe.Pointer(p)).FiDataCur = (*SrcItem)(unsafe.Pointer(pTabItem)).FiCursor
 150663 		(*IndexedExpr)(unsafe.Pointer(p)).FiIdxCur = iIdxCur
 150664 		(*IndexedExpr)(unsafe.Pointer(p)).FiIdxCol = i
 150665 		(*IndexedExpr)(unsafe.Pointer(p)).FbMaybeNullRow = U8(bMaybeNullRow)
 150666 		if Xsqlite3IndexAffinityStr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pIdx) != 0 {
 150667 			(*IndexedExpr)(unsafe.Pointer(p)).Faff = U8(*(*int8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FzColAff + uintptr(i))))
 150668 		}
 150669 		(*Parse)(unsafe.Pointer(pParse)).FpIdxEpr = p
 150670 		if (*IndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) {
 150671 			Xsqlite3ParserAddCleanup(tls, pParse, *(*uintptr)(unsafe.Pointer(&struct {
 150672 				f func(*libc.TLS, uintptr, uintptr)
 150673 			}{whereIndexedExprCleanup})), pParse)
 150674 		}
 150675 	}
 150676 }
 150677 
 150678 // Generate the beginning of the loop used for WHERE clause processing.
 150679 // The return value is a pointer to an opaque structure that contains
 150680 // information needed to terminate the loop.  Later, the calling routine
 150681 // should invoke sqlite3WhereEnd() with the return value of this function
 150682 // in order to complete the WHERE clause processing.
 150683 //
 150684 // If an error occurs, this routine returns NULL.
 150685 //
 150686 // The basic idea is to do a nested loop, one loop for each table in
 150687 // the FROM clause of a select.  (INSERT and UPDATE statements are the
 150688 // same as a SELECT with only a single table in the FROM clause.)  For
 150689 // example, if the SQL is this:
 150690 //
 150691 //	SELECT * FROM t1, t2, t3 WHERE ...;
 150692 //
 150693 // Then the code generated is conceptually like the following:
 150694 //
 150695 //	foreach row1 in t1 do       \    Code generated
 150696 //	  foreach row2 in t2 do      |-- by sqlite3WhereBegin()
 150697 //	    foreach row3 in t3 do   /
 150698 //	      ...
 150699 //	    end                     \    Code generated
 150700 //	  end                        |-- by sqlite3WhereEnd()
 150701 //	end                         /
 150702 //
 150703 // Note that the loops might not be nested in the order in which they
 150704 // appear in the FROM clause if a different order is better able to make
 150705 // use of indices.  Note also that when the IN operator appears in
 150706 // the WHERE clause, it might result in additional nested loops for
 150707 // scanning through all values on the right-hand side of the IN.
 150708 //
 150709 // There are Btree cursors associated with each table.  t1 uses cursor
 150710 // number pTabList->a[0].iCursor.  t2 uses the cursor pTabList->a[1].iCursor.
 150711 // And so forth.  This routine generates code to open those VDBE cursors
 150712 // and sqlite3WhereEnd() generates the code to close them.
 150713 //
 150714 // The code that sqlite3WhereBegin() generates leaves the cursors named
 150715 // in pTabList pointing at their appropriate entries.  The [...] code
 150716 // can use OP_Column and OP_Rowid opcodes on these cursors to extract
 150717 // data from the various tables of the loop.
 150718 //
 150719 // If the WHERE clause is empty, the foreach loops must each scan their
 150720 // entire tables.  Thus a three-way join is an O(N^3) operation.  But if
 150721 // the tables have indices and there are terms in the WHERE clause that
 150722 // refer to those indices, a complete table scan can be avoided and the
 150723 // code will run much faster.  Most of the work of this routine is checking
 150724 // to see if there are indices that can be used to speed up the loop.
 150725 //
 150726 // Terms of the WHERE clause are also used to limit which rows actually
 150727 // make it to the "..." in the middle of the loop.  After each "foreach",
 150728 // terms of the WHERE clause that use only terms in that loop and outer
 150729 // loops are evaluated and if false a jump is made around all subsequent
 150730 // inner loops (or around the "..." if the test occurs within the inner-
 150731 // most loop)
 150732 //
 150733 // # OUTER JOINS
 150734 //
 150735 // An outer join of tables t1 and t2 is conceptally coded as follows:
 150736 //
 150737 //	foreach row1 in t1 do
 150738 //	  flag = 0
 150739 //	  foreach row2 in t2 do
 150740 //	    start:
 150741 //	      ...
 150742 //	      flag = 1
 150743 //	  end
 150744 //	  if flag==0 then
 150745 //	    move the row2 cursor to a null row
 150746 //	    goto start
 150747 //	  fi
 150748 //	end
 150749 //
 150750 // # ORDER BY CLAUSE PROCESSING
 150751 //
 150752 // pOrderBy is a pointer to the ORDER BY clause (or the GROUP BY clause
 150753 // if the WHERE_GROUPBY flag is set in wctrlFlags) of a SELECT statement
 150754 // if there is one.  If there is no ORDER BY clause or if this routine
 150755 // is called from an UPDATE or DELETE statement, then pOrderBy is NULL.
 150756 //
 150757 // The iIdxCur parameter is the cursor number of an index.  If
 150758 // WHERE_OR_SUBCLAUSE is set, iIdxCur is the cursor number of an index
 150759 // to use for OR clause processing.  The WHERE clause should use this
 150760 // specific cursor.  If WHERE_ONEPASS_DESIRED is set, then iIdxCur is
 150761 // the first cursor in an array of cursors for all indices.  iIdxCur should
 150762 // be used to compute the appropriate cursor depending on which index is
 150763 // used.
 150764 func Xsqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pResultSet uintptr, pSelect uintptr, wctrlFlags U16, iAuxArg int32) uintptr {
 150765 	bp := tls.Alloc(64)
 150766 	defer tls.Free(64)
 150767 
 150768 	var nByteWInfo int32
 150769 	var nTabList int32
 150770 	var pWInfo uintptr
 150771 	var v uintptr
 150772 	var notReady Bitmask
 150773 
 150774 	var pMaskSet uintptr
 150775 	var pLevel uintptr
 150776 	var pLoop uintptr
 150777 	var ii int32
 150778 	var db uintptr
 150779 	var rc int32
 150780 	var bFordelete U8
 150781 	var pT uintptr
 150782 	var p uintptr
 150783 	var wsFlags int32
 150784 	var bOnerow int32
 150785 	var pVTab uintptr
 150786 	var iCur int32
 150787 
 150788 	var b Bitmask
 150789 	var n int32
 150790 	var op int32
 150791 	var pJ uintptr
 150792 	var pIx uintptr
 150793 	var iIndexCur int32
 150794 	var op1 int32
 150795 	var pInfo uintptr
 150796 	var pPk uintptr
 150797 	var pRJ uintptr
 150798 	var pTab uintptr
 150799 	var iDb int32
 150800 	var pTabItem uintptr
 150801 	var iOnce int32
 150802 	var addrExplain int32
 150803 	_ = addrExplain
 150804 	var wsFlags1 int32
 150805 	var pSrc uintptr
 150806 	v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 150807 	bFordelete = U8(0)
 150808 
 150809 	db = (*Parse)(unsafe.Pointer(pParse)).Fdb
 150810 	libc.Xmemset(tls, bp+8, 0, uint64(unsafe.Sizeof(WhereLoopBuilder{})))
 150811 
 150812 	if !(pOrderBy != 0 && (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr >= int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8))) {
 150813 		goto __1
 150814 	}
 150815 	pOrderBy = uintptr(0)
 150816 __1:
 150817 	;
 150818 	if !((*SrcList)(unsafe.Pointer(pTabList)).FnSrc > int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8))) {
 150819 		goto __2
 150820 	}
 150821 	Xsqlite3ErrorMsg(tls, pParse, ts+23438, libc.VaList(bp, int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8))))
 150822 	return uintptr(0)
 150823 __2:
 150824 	;
 150825 	if int32(wctrlFlags)&WHERE_OR_SUBCLAUSE != 0 {
 150826 		nTabList = 1
 150827 	} else {
 150828 		nTabList = (*SrcList)(unsafe.Pointer(pTabList)).FnSrc
 150829 	}
 150830 
 150831 	nByteWInfo = int32(uint64(unsafe.Sizeof(WhereInfo{})) + uint64(nTabList-1)*uint64(unsafe.Sizeof(WhereLevel{})))
 150832 	pWInfo = Xsqlite3DbMallocRawNN(tls, db, uint64(nByteWInfo)+uint64(unsafe.Sizeof(WhereLoop{})))
 150833 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 150834 		goto __3
 150835 	}
 150836 	Xsqlite3DbFree(tls, db, pWInfo)
 150837 	pWInfo = uintptr(0)
 150838 	goto whereBeginError
 150839 __3:
 150840 	;
 150841 	(*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse = pParse
 150842 	(*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList = pTabList
 150843 	(*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy = pOrderBy
 150844 	(*WhereInfo)(unsafe.Pointer(pWInfo)).FpResultSet = pResultSet
 150845 	*(*int32)(unsafe.Pointer(pWInfo + 40)) = libc.AssignPtrInt32(pWInfo+40+1*4, -1)
 150846 	(*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel = U8(nTabList)
 150847 	(*WhereInfo)(unsafe.Pointer(pWInfo)).FiBreak = libc.AssignPtrInt32(pWInfo+48, Xsqlite3VdbeMakeLabel(tls, pParse))
 150848 	(*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags = wctrlFlags
 150849 	(*WhereInfo)(unsafe.Pointer(pWInfo)).FiLimit = LogEst(iAuxArg)
 150850 	(*WhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop = int32((*Parse)(unsafe.Pointer(pParse)).FnQueryLoop)
 150851 	(*WhereInfo)(unsafe.Pointer(pWInfo)).FpSelect = pSelect
 150852 	libc.Xmemset(tls, pWInfo+65, 0,
 150853 		uint64(uintptr(0)+104)-uint64(uintptr(0)+65))
 150854 	libc.Xmemset(tls, pWInfo+856, 0, uint64(unsafe.Sizeof(WhereLoop{}))+uint64(nTabList)*uint64(unsafe.Sizeof(WhereLevel{})))
 150855 
 150856 	pMaskSet = pWInfo + 592
 150857 	(*WhereMaskSet)(unsafe.Pointer(pMaskSet)).Fn = 0
 150858 	*(*int32)(unsafe.Pointer(pMaskSet + 8)) = -99
 150859 
 150860 	(*WhereLoopBuilder)(unsafe.Pointer(bp + 8)).FpWInfo = pWInfo
 150861 	(*WhereLoopBuilder)(unsafe.Pointer(bp + 8)).FpWC = pWInfo + 104
 150862 	(*WhereLoopBuilder)(unsafe.Pointer(bp + 8)).FpNew = pWInfo + uintptr(nByteWInfo)
 150863 
 150864 	whereLoopInit(tls, (*WhereLoopBuilder)(unsafe.Pointer(bp+8)).FpNew)
 150865 
 150866 	Xsqlite3WhereClauseInit(tls, pWInfo+104, pWInfo)
 150867 	Xsqlite3WhereSplit(tls, pWInfo+104, pWhere, uint8(TK_AND))
 150868 
 150869 	if !(nTabList == 0) {
 150870 		goto __4
 150871 	}
 150872 	if !(pOrderBy != 0) {
 150873 		goto __6
 150874 	}
 150875 	(*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = I8((*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr)
 150876 __6:
 150877 	;
 150878 	if !(int32(wctrlFlags)&WHERE_WANT_DISTINCT != 0 &&
 150879 		(*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_DistinctOpt) == U32(0)) {
 150880 		goto __7
 150881 	}
 150882 	(*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_UNIQUE)
 150883 __7:
 150884 	;
 150885 	Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+23466, 0)
 150886 	goto __5
 150887 __4:
 150888 	ii = 0
 150889 __8:
 150890 	createMask(tls, pMaskSet, (*SrcItem)(unsafe.Pointer(pTabList+8+uintptr(ii)*104)).FiCursor)
 150891 	Xsqlite3WhereTabFuncArgs(tls, pParse, pTabList+8+uintptr(ii)*104, pWInfo+104)
 150892 	goto __9
 150893 __9:
 150894 	if libc.PreIncInt32(&ii, 1) < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc {
 150895 		goto __8
 150896 	}
 150897 	goto __10
 150898 __10:
 150899 	;
 150900 __5:
 150901 	;
 150902 	Xsqlite3WhereExprAnalyze(tls, pTabList, pWInfo+104)
 150903 	if !(pSelect != 0 && (*Select)(unsafe.Pointer(pSelect)).FpLimit != 0) {
 150904 		goto __11
 150905 	}
 150906 	Xsqlite3WhereAddLimit(tls, pWInfo+104, pSelect)
 150907 __11:
 150908 	;
 150909 	if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
 150910 		goto __12
 150911 	}
 150912 	goto whereBeginError
 150913 __12:
 150914 	;
 150915 	ii = 0
 150916 __13:
 150917 	if !(ii < (*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+8)).FpWC)).FnBase) {
 150918 		goto __15
 150919 	}
 150920 	pT = (*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+8)).FpWC)).Fa + uintptr(ii)*56
 150921 	if !(int32((*WhereTerm)(unsafe.Pointer(pT)).FwtFlags)&TERM_VIRTUAL != 0) {
 150922 		goto __16
 150923 	}
 150924 	goto __14
 150925 __16:
 150926 	;
 150927 	if !((*WhereTerm)(unsafe.Pointer(pT)).FprereqAll == uint64(0) && (nTabList == 0 || exprIsDeterministic(tls, (*WhereTerm)(unsafe.Pointer(pT)).FpExpr) != 0)) {
 150928 		goto __17
 150929 	}
 150930 	Xsqlite3ExprIfFalse(tls, pParse, (*WhereTerm)(unsafe.Pointer(pT)).FpExpr, (*WhereInfo)(unsafe.Pointer(pWInfo)).FiBreak, SQLITE_JUMPIFNULL)
 150931 	*(*U16)(unsafe.Pointer(pT + 18)) |= U16(TERM_CODED)
 150932 __17:
 150933 	;
 150934 	goto __14
 150935 __14:
 150936 	ii++
 150937 	goto __13
 150938 	goto __15
 150939 __15:
 150940 	;
 150941 	if !(int32(wctrlFlags)&WHERE_WANT_DISTINCT != 0) {
 150942 		goto __18
 150943 	}
 150944 	if !((*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_DistinctOpt) != U32(0)) {
 150945 		goto __19
 150946 	}
 150947 
 150948 	wctrlFlags = libc.Uint16FromInt32(int32(wctrlFlags) & libc.CplInt32(WHERE_WANT_DISTINCT))
 150949 	*(*U16)(unsafe.Pointer(pWInfo + 60)) &= libc.Uint16FromInt32(libc.CplInt32(WHERE_WANT_DISTINCT))
 150950 	goto __20
 150951 __19:
 150952 	if !(isDistinctRedundant(tls, pParse, pTabList, pWInfo+104, pResultSet) != 0) {
 150953 		goto __21
 150954 	}
 150955 
 150956 	(*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_UNIQUE)
 150957 	goto __22
 150958 __21:
 150959 	if !(pOrderBy == uintptr(0)) {
 150960 		goto __23
 150961 	}
 150962 
 150963 	*(*U16)(unsafe.Pointer(pWInfo + 60)) |= U16(WHERE_DISTINCTBY)
 150964 	(*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy = pResultSet
 150965 __23:
 150966 	;
 150967 __22:
 150968 	;
 150969 __20:
 150970 	;
 150971 __18:
 150972 	;
 150973 	if !(nTabList != 1 || whereShortCut(tls, bp+8) == 0) {
 150974 		goto __24
 150975 	}
 150976 	rc = whereLoopAddAll(tls, bp+8)
 150977 	if !(rc != 0) {
 150978 		goto __25
 150979 	}
 150980 	goto whereBeginError
 150981 __25:
 150982 	;
 150983 	if !(int32((*WhereLoopBuilder)(unsafe.Pointer(bp+8)).FbldFlags2)&SQLITE_BLDF2_2NDPASS != 0) {
 150984 		goto __26
 150985 	}
 150986 
 150987 __27:
 150988 	if !((*WhereInfo)(unsafe.Pointer(pWInfo)).FpLoops != 0) {
 150989 		goto __28
 150990 	}
 150991 	p = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpLoops
 150992 	(*WhereInfo)(unsafe.Pointer(pWInfo)).FpLoops = (*WhereLoop)(unsafe.Pointer(p)).FpNextLoop
 150993 	whereLoopDelete(tls, db, p)
 150994 	goto __27
 150995 __28:
 150996 	;
 150997 	rc = whereLoopAddAll(tls, bp+8)
 150998 	if !(rc != 0) {
 150999 		goto __29
 151000 	}
 151001 	goto whereBeginError
 151002 __29:
 151003 	;
 151004 __26:
 151005 	;
 151006 	wherePathSolver(tls, pWInfo, int16(0))
 151007 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 151008 		goto __30
 151009 	}
 151010 	goto whereBeginError
 151011 __30:
 151012 	;
 151013 	if !((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy != 0) {
 151014 		goto __31
 151015 	}
 151016 	wherePathSolver(tls, pWInfo, int16(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)+1))
 151017 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 151018 		goto __32
 151019 	}
 151020 	goto whereBeginError
 151021 __32:
 151022 	;
 151023 __31:
 151024 	;
 151025 __24:
 151026 	;
 151027 	if !((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy == uintptr(0) && (*Sqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ReverseOrder) != uint64(0)) {
 151028 		goto __33
 151029 	}
 151030 	(*WhereInfo)(unsafe.Pointer(pWInfo)).FrevMask = libc.Uint64(libc.Uint64FromInt32(-1))
 151031 __33:
 151032 	;
 151033 	if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
 151034 		goto __34
 151035 	}
 151036 	goto whereBeginError
 151037 __34:
 151038 	;
 151039 	notReady = libc.CplUint64(uint64(0))
 151040 	if !(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= 2 &&
 151041 		pResultSet != uintptr(0) &&
 151042 		0 == int32(wctrlFlags)&WHERE_AGG_DISTINCT &&
 151043 		(*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_OmitNoopJoin) == U32(0)) {
 151044 		goto __35
 151045 	}
 151046 	notReady = whereOmitNoopJoin(tls, pWInfo, notReady)
 151047 	nTabList = int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)
 151048 
 151049 __35:
 151050 	;
 151051 	if !(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= 2 &&
 151052 		(*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_BloomFilter) == U32(0)) {
 151053 		goto __36
 151054 	}
 151055 	whereCheckIfBloomFilterIsUseful(tls, pWInfo)
 151056 __36:
 151057 	;
 151058 	*(*U32)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 208)) += U32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)
 151059 
 151060 	if !(int32(wctrlFlags)&WHERE_ONEPASS_DESIRED != 0) {
 151061 		goto __37
 151062 	}
 151063 	wsFlags = int32((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pWInfo + 856)).FpWLoop)).FwsFlags)
 151064 	bOnerow = libc.Bool32(wsFlags&WHERE_ONEROW != 0)
 151065 
 151066 	if !(bOnerow != 0 || 0 != int32(wctrlFlags)&WHERE_ONEPASS_MULTIROW &&
 151067 		!(int32((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pTabList+8)).FpTab)).FeTabType) == TABTYP_VTAB) &&
 151068 		(0 == wsFlags&WHERE_MULTI_OR || int32(wctrlFlags)&WHERE_DUPLICATES_OK != 0)) {
 151069 		goto __38
 151070 	}
 151071 	(*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass = func() uint8 {
 151072 		if bOnerow != 0 {
 151073 			return uint8(ONEPASS_SINGLE)
 151074 		}
 151075 		return uint8(ONEPASS_MULTI)
 151076 	}()
 151077 	if !((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pTabList+8)).FpTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) && wsFlags&WHERE_IDX_ONLY != 0) {
 151078 		goto __39
 151079 	}
 151080 	if !(int32(wctrlFlags)&WHERE_ONEPASS_MULTIROW != 0) {
 151081 		goto __40
 151082 	}
 151083 	bFordelete = U8(OPFLAG_FORDELETE)
 151084 __40:
 151085 	;
 151086 	(*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pWInfo + 856)).FpWLoop)).FwsFlags = U32(wsFlags & libc.CplInt32(WHERE_IDX_ONLY))
 151087 __39:
 151088 	;
 151089 __38:
 151090 	;
 151091 __37:
 151092 	;
 151093 	ii = 0
 151094 	pLevel = pWInfo + 856
 151095 __41:
 151096 	if !(ii < nTabList) {
 151097 		goto __43
 151098 	}
 151099 
 151100 	pTabItem = pTabList + 8 + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104
 151101 	pTab = (*SrcItem)(unsafe.Pointer(pTabItem)).FpTab
 151102 	iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
 151103 	pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop
 151104 	if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Ephemeral) != U32(0) || int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW) {
 151105 		goto __44
 151106 	}
 151107 
 151108 	goto __45
 151109 __44:
 151110 	if !((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_VIRTUALTABLE) != U32(0)) {
 151111 		goto __46
 151112 	}
 151113 	pVTab = Xsqlite3GetVTable(tls, db, pTab)
 151114 	iCur = (*SrcItem)(unsafe.Pointer(pTabItem)).FiCursor
 151115 	Xsqlite3VdbeAddOp4(tls, v, OP_VOpen, iCur, 0, 0, pVTab, -11)
 151116 	goto __47
 151117 __46:
 151118 	if !(int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB) {
 151119 		goto __48
 151120 	}
 151121 
 151122 	goto __49
 151123 __48:
 151124 	if !((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IDX_ONLY) == U32(0) &&
 151125 		int32(wctrlFlags)&WHERE_OR_SUBCLAUSE == 0 ||
 151126 		int32((*SrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&(JT_LTORJ|JT_RIGHT) != 0) {
 151127 		goto __50
 151128 	}
 151129 	op = OP_OpenRead
 151130 	if !(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) != ONEPASS_OFF) {
 151131 		goto __52
 151132 	}
 151133 	op = OP_OpenWrite
 151134 	*(*int32)(unsafe.Pointer(pWInfo + 40)) = (*SrcItem)(unsafe.Pointer(pTabItem)).FiCursor
 151135 __52:
 151136 	;
 151137 	Xsqlite3OpenTable(tls, pParse, (*SrcItem)(unsafe.Pointer(pTabItem)).FiCursor, iDb, pTab, op)
 151138 
 151139 	if !(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_OFF &&
 151140 		int32((*Table)(unsafe.Pointer(pTab)).FnCol) < int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8)) &&
 151141 		(*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_HasGenerated|TF_WithoutRowid) == U32(0) &&
 151142 		(*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_AUTO_INDEX|WHERE_BLOOMFILTER) == U32(0)) {
 151143 		goto __53
 151144 	}
 151145 
 151146 	b = (*SrcItem)(unsafe.Pointer(pTabItem)).FcolUsed
 151147 	n = 0
 151148 __54:
 151149 	if !(b != 0) {
 151150 		goto __56
 151151 	}
 151152 	goto __55
 151153 __55:
 151154 	b = b >> 1
 151155 	n++
 151156 	goto __54
 151157 	goto __56
 151158 __56:
 151159 	;
 151160 	Xsqlite3VdbeChangeP4(tls, v, -1, uintptr(int64(n)), -3)
 151161 
 151162 __53:
 151163 	;
 151164 	Xsqlite3VdbeChangeP5(tls, v, uint16(bFordelete))
 151165 
 151166 	goto __51
 151167 __50:
 151168 	Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, uint8(0), (*Table)(unsafe.Pointer(pTab)).FzName)
 151169 __51:
 151170 	;
 151171 __49:
 151172 	;
 151173 __47:
 151174 	;
 151175 __45:
 151176 	;
 151177 	if !((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_INDEXED) != 0) {
 151178 		goto __57
 151179 	}
 151180 	pIx = *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8))
 151181 	op1 = OP_OpenRead
 151182 
 151183 	if !(!((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) && int32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x3>>0) == SQLITE_IDXTYPE_PRIMARYKEY &&
 151184 		int32(wctrlFlags)&WHERE_OR_SUBCLAUSE != 0) {
 151185 		goto __58
 151186 	}
 151187 
 151188 	iIndexCur = (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur
 151189 	op1 = 0
 151190 	goto __59
 151191 __58:
 151192 	if !(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) != ONEPASS_OFF) {
 151193 		goto __60
 151194 	}
 151195 	pJ = (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pTabItem)).FpTab)).FpIndex
 151196 	iIndexCur = iAuxArg
 151197 
 151198 __62:
 151199 	if !(pJ != 0 && pJ != pIx) {
 151200 		goto __63
 151201 	}
 151202 	iIndexCur++
 151203 	pJ = (*Index)(unsafe.Pointer(pJ)).FpNext
 151204 	goto __62
 151205 __63:
 151206 	;
 151207 	op1 = OP_OpenWrite
 151208 	*(*int32)(unsafe.Pointer(pWInfo + 40 + 1*4)) = iIndexCur
 151209 	goto __61
 151210 __60:
 151211 	if !(iAuxArg != 0 && int32(wctrlFlags)&WHERE_OR_SUBCLAUSE != 0) {
 151212 		goto __64
 151213 	}
 151214 	iIndexCur = iAuxArg
 151215 	op1 = OP_ReopenIdx
 151216 	goto __65
 151217 __64:
 151218 	iIndexCur = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 151219 	if !(uint32(int32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x800>>11)) != 0 && (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags&U32(SQLITE_IndexedExpr) == U32(0)) {
 151220 		goto __66
 151221 	}
 151222 	whereAddIndexedExpr(tls, pParse, pIx, iIndexCur, pTabItem)
 151223 __66:
 151224 	;
 151225 __65:
 151226 	;
 151227 __61:
 151228 	;
 151229 __59:
 151230 	;
 151231 	(*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur = iIndexCur
 151232 
 151233 	if !(op1 != 0) {
 151234 		goto __67
 151235 	}
 151236 	Xsqlite3VdbeAddOp3(tls, v, op1, iIndexCur, int32((*Index)(unsafe.Pointer(pIx)).Ftnum), iDb)
 151237 	Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIx)
 151238 	if !((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_CONSTRAINT) != U32(0) &&
 151239 		(*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_COLUMN_RANGE|WHERE_SKIPSCAN) == U32(0) &&
 151240 		(*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_BIGNULL_SORT) == U32(0) &&
 151241 		(*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IN_SEEKSCAN) == U32(0) &&
 151242 		int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&WHERE_ORDERBY_MIN == 0 &&
 151243 		int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) != WHERE_DISTINCT_ORDERED) {
 151244 		goto __68
 151245 	}
 151246 	Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SEEKEQ))
 151247 __68:
 151248 	;
 151249 __67:
 151250 	;
 151251 __57:
 151252 	;
 151253 	if !(iDb >= 0) {
 151254 		goto __69
 151255 	}
 151256 	Xsqlite3CodeVerifySchema(tls, pParse, iDb)
 151257 __69:
 151258 	;
 151259 	if !(int32((*SrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&JT_RIGHT != 0 &&
 151260 		libc.AssignPtrUintptr(pLevel+48, Xsqlite3WhereMalloc(tls, pWInfo, uint64(unsafe.Sizeof(WhereRightJoin{})))) != uintptr(0)) {
 151261 		goto __70
 151262 	}
 151263 	pRJ = (*WhereLevel)(unsafe.Pointer(pLevel)).FpRJ
 151264 	(*WhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 151265 	(*WhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 151266 	Xsqlite3VdbeAddOp2(tls, v, OP_Blob, 65536, (*WhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom)
 151267 	(*WhereRightJoin)(unsafe.Pointer(pRJ)).FregReturn = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 151268 	Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, (*WhereRightJoin)(unsafe.Pointer(pRJ)).FregReturn)
 151269 
 151270 	if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 151271 		goto __71
 151272 	}
 151273 	Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*WhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch, 1)
 151274 	pInfo = Xsqlite3KeyInfoAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 1, 0)
 151275 	if !(pInfo != 0) {
 151276 		goto __73
 151277 	}
 151278 	*(*uintptr)(unsafe.Pointer(pInfo + 32)) = uintptr(0)
 151279 	*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pInfo)).FaSortFlags)) = U8(0)
 151280 	Xsqlite3VdbeAppendP4(tls, v, pInfo, -8)
 151281 __73:
 151282 	;
 151283 	goto __72
 151284 __71:
 151285 	pPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
 151286 	Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*WhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch, int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol))
 151287 	Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pPk)
 151288 __72:
 151289 	;
 151290 	*(*U32)(unsafe.Pointer(pLoop + 56)) &= libc.Uint32FromInt32(libc.CplInt32(WHERE_IDX_ONLY))
 151291 
 151292 	(*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = int8(0)
 151293 	(*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_UNORDERED)
 151294 __70:
 151295 	;
 151296 	goto __42
 151297 __42:
 151298 	ii++
 151299 	pLevel += 104
 151300 	goto __41
 151301 	goto __43
 151302 __43:
 151303 	;
 151304 	(*WhereInfo)(unsafe.Pointer(pWInfo)).FiTop = Xsqlite3VdbeCurrentAddr(tls, v)
 151305 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 151306 		goto __74
 151307 	}
 151308 	goto whereBeginError
 151309 __74:
 151310 	;
 151311 	ii = 0
 151312 __75:
 151313 	if !(ii < nTabList) {
 151314 		goto __77
 151315 	}
 151316 	if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
 151317 		goto __78
 151318 	}
 151319 	goto whereBeginError
 151320 __78:
 151321 	;
 151322 	pLevel = pWInfo + 856 + uintptr(ii)*104
 151323 	wsFlags1 = int32((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags)
 151324 	pSrc = pTabList + 8 + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104
 151325 	if !(uint32(int32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x10>>4)) != 0) {
 151326 		goto __79
 151327 	}
 151328 	if !(uint32(int32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x8>>3)) != 0) {
 151329 		goto __80
 151330 	}
 151331 	Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, (*SrcItem)(unsafe.Pointer(pSrc)).FregReturn, (*SrcItem)(unsafe.Pointer(pSrc)).FaddrFillSub)
 151332 	goto __81
 151333 __80:
 151334 	iOnce = Xsqlite3VdbeAddOp0(tls, v, OP_Once)
 151335 	Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, (*SrcItem)(unsafe.Pointer(pSrc)).FregReturn, (*SrcItem)(unsafe.Pointer(pSrc)).FaddrFillSub)
 151336 	Xsqlite3VdbeJumpHere(tls, v, iOnce)
 151337 __81:
 151338 	;
 151339 __79:
 151340 	;
 151341 	if !(wsFlags1&(WHERE_AUTO_INDEX|WHERE_BLOOMFILTER) != 0) {
 151342 		goto __82
 151343 	}
 151344 	if !(wsFlags1&WHERE_AUTO_INDEX != 0) {
 151345 		goto __83
 151346 	}
 151347 	constructAutomaticIndex(tls, pParse, pWInfo+104,
 151348 		pTabList+8+uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104, notReady, pLevel)
 151349 	goto __84
 151350 __83:
 151351 	sqlite3ConstructBloomFilter(tls, pWInfo, ii, pLevel, notReady)
 151352 __84:
 151353 	;
 151354 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 151355 		goto __85
 151356 	}
 151357 	goto whereBeginError
 151358 __85:
 151359 	;
 151360 __82:
 151361 	;
 151362 	addrExplain = Xsqlite3WhereExplainOneScan(tls,
 151363 		pParse, pTabList, pLevel, wctrlFlags)
 151364 	(*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBody = Xsqlite3VdbeCurrentAddr(tls, v)
 151365 	notReady = Xsqlite3WhereCodeOneLoopStart(tls, pParse, v, pWInfo, ii, pLevel, notReady)
 151366 	(*WhereInfo)(unsafe.Pointer(pWInfo)).FiContinue = (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrCont
 151367 	if !(wsFlags1&WHERE_MULTI_OR == 0 && int32(wctrlFlags)&WHERE_OR_SUBCLAUSE == 0) {
 151368 		goto __86
 151369 	}
 151370 	_ = addrExplain
 151371 __86:
 151372 	;
 151373 	goto __76
 151374 __76:
 151375 	ii++
 151376 	goto __75
 151377 	goto __77
 151378 __77:
 151379 	;
 151380 	(*WhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere = Xsqlite3VdbeCurrentAddr(tls, v)
 151381 	return pWInfo
 151382 
 151383 whereBeginError:
 151384 	if !(pWInfo != 0) {
 151385 		goto __87
 151386 	}
 151387 	(*Parse)(unsafe.Pointer(pParse)).FnQueryLoop = U32((*WhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop)
 151388 	whereInfoFree(tls, db, pWInfo)
 151389 __87:
 151390 	;
 151391 	return uintptr(0)
 151392 }
 151393 
 151394 // Generate the end of the WHERE loop.  See comments on
 151395 // sqlite3WhereBegin() for additional information.
 151396 func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) {
 151397 	var pParse uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse
 151398 	var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
 151399 	var i int32
 151400 	var pLevel uintptr
 151401 	var pLoop uintptr
 151402 	var pTabList uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList
 151403 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 151404 	var iEnd int32 = Xsqlite3VdbeCurrentAddr(tls, v)
 151405 	var nRJ int32 = 0
 151406 
 151407 	for i = int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1; i >= 0; i-- {
 151408 		var addr int32
 151409 		pLevel = pWInfo + 856 + uintptr(i)*104
 151410 		if (*WhereLevel)(unsafe.Pointer(pLevel)).FpRJ != 0 {
 151411 			var pRJ uintptr = (*WhereLevel)(unsafe.Pointer(pLevel)).FpRJ
 151412 			Xsqlite3VdbeResolveLabel(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrCont)
 151413 			(*WhereLevel)(unsafe.Pointer(pLevel)).FaddrCont = 0
 151414 			(*WhereRightJoin)(unsafe.Pointer(pRJ)).FendSubrtn = Xsqlite3VdbeCurrentAddr(tls, v)
 151415 			Xsqlite3VdbeAddOp3(tls, v, OP_Return, (*WhereRightJoin)(unsafe.Pointer(pRJ)).FregReturn, (*WhereRightJoin)(unsafe.Pointer(pRJ)).FaddrSubrtn, 1)
 151416 
 151417 			nRJ++
 151418 		}
 151419 		pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop
 151420 		if int32((*WhereLevel)(unsafe.Pointer(pLevel)).Fop) != OP_Noop {
 151421 			var addrSeek int32 = 0
 151422 			var pIdx uintptr
 151423 			var n int32
 151424 			if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) == WHERE_DISTINCT_ORDERED &&
 151425 				i == int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-1 &&
 151426 				(*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_INDEXED) != U32(0) &&
 151427 				uint32(int32(*(*uint16)(unsafe.Pointer(libc.AssignUintptr(&pIdx, *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8))) + 100))&0x80>>7)) != 0 &&
 151428 				libc.AssignInt32(&n, int32(*(*U16)(unsafe.Pointer(pLoop + 24 + 6)))) > 0 &&
 151429 				int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst + uintptr(n)*2))) >= 36 {
 151430 				var r1 int32 = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 151431 				var j int32
 151432 				var op int32
 151433 				for j = 0; j < n; j++ {
 151434 					Xsqlite3VdbeAddOp3(tls, v, OP_Column, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, j, r1+j)
 151435 				}
 151436 				*(*int32)(unsafe.Pointer(pParse + 56)) += n + 1
 151437 				if int32((*WhereLevel)(unsafe.Pointer(pLevel)).Fop) == OP_Prev {
 151438 					op = OP_SeekLT
 151439 				} else {
 151440 					op = OP_SeekGT
 151441 				}
 151442 				addrSeek = Xsqlite3VdbeAddOp4Int(tls, v, op, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, 0, r1, n)
 151443 
 151444 				Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 1, (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2)
 151445 			}
 151446 
 151447 			if (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrCont != 0 {
 151448 				Xsqlite3VdbeResolveLabel(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrCont)
 151449 			}
 151450 			Xsqlite3VdbeAddOp3(tls, v, int32((*WhereLevel)(unsafe.Pointer(pLevel)).Fop), (*WhereLevel)(unsafe.Pointer(pLevel)).Fp1, (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2, int32((*WhereLevel)(unsafe.Pointer(pLevel)).Fp3))
 151451 			Xsqlite3VdbeChangeP5(tls, v, uint16((*WhereLevel)(unsafe.Pointer(pLevel)).Fp5))
 151452 
 151453 			if (*WhereLevel)(unsafe.Pointer(pLevel)).FregBignull != 0 {
 151454 				Xsqlite3VdbeResolveLabel(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBignull)
 151455 				Xsqlite3VdbeAddOp2(tls, v, OP_DecrJumpZero, (*WhereLevel)(unsafe.Pointer(pLevel)).FregBignull, (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2-1)
 151456 
 151457 			}
 151458 			if addrSeek != 0 {
 151459 				Xsqlite3VdbeJumpHere(tls, v, addrSeek)
 151460 			}
 151461 		} else if (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrCont != 0 {
 151462 			Xsqlite3VdbeResolveLabel(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrCont)
 151463 		}
 151464 		if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IN_ABLE) != U32(0) && *(*int32)(unsafe.Pointer(pLevel + 72)) > 0 {
 151465 			var pIn uintptr
 151466 			var j int32
 151467 			Xsqlite3VdbeResolveLabel(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt)
 151468 			j = *(*int32)(unsafe.Pointer(pLevel + 72))
 151469 			pIn = *(*uintptr)(unsafe.Pointer(pLevel + 72 + 8)) + uintptr(j-1)*20
 151470 		__1:
 151471 			if !(j > 0) {
 151472 				goto __3
 151473 			}
 151474 			{
 151475 				Xsqlite3VdbeJumpHere(tls, v, *(*int32)(unsafe.Pointer(pIn + 4))+1)
 151476 				if int32(*(*U8)(unsafe.Pointer(pIn + 16))) != OP_Noop {
 151477 					if *(*int32)(unsafe.Pointer(pIn + 12)) != 0 {
 151478 						var bEarlyOut int32 = libc.Bool32((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_VIRTUALTABLE) == U32(0) &&
 151479 							(*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_IN_EARLYOUT) != U32(0))
 151480 						if (*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin != 0 {
 151481 							Xsqlite3VdbeAddOp2(tls, v, OP_IfNotOpen, *(*int32)(unsafe.Pointer(pIn)),
 151482 								Xsqlite3VdbeCurrentAddr(tls, v)+2+bEarlyOut)
 151483 
 151484 						}
 151485 						if bEarlyOut != 0 {
 151486 							Xsqlite3VdbeAddOp4Int(tls, v, OP_IfNoHope, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur,
 151487 								Xsqlite3VdbeCurrentAddr(tls, v)+2,
 151488 								*(*int32)(unsafe.Pointer(pIn + 8)), *(*int32)(unsafe.Pointer(pIn + 12)))
 151489 
 151490 							Xsqlite3VdbeJumpHere(tls, v, *(*int32)(unsafe.Pointer(pIn + 4))+1)
 151491 						}
 151492 					}
 151493 					Xsqlite3VdbeAddOp2(tls, v, int32(*(*U8)(unsafe.Pointer(pIn + 16))), *(*int32)(unsafe.Pointer(pIn)), *(*int32)(unsafe.Pointer(pIn + 4)))
 151494 
 151495 				}
 151496 				Xsqlite3VdbeJumpHere(tls, v, *(*int32)(unsafe.Pointer(pIn + 4))-1)
 151497 
 151498 			}
 151499 			goto __2
 151500 		__2:
 151501 			j--
 151502 			pIn -= 20
 151503 			goto __1
 151504 			goto __3
 151505 		__3:
 151506 		}
 151507 		Xsqlite3VdbeResolveLabel(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBrk)
 151508 		if (*WhereLevel)(unsafe.Pointer(pLevel)).FpRJ != 0 {
 151509 			Xsqlite3VdbeAddOp3(tls, v, OP_Return, (*WhereRightJoin)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpRJ)).FregReturn, 0, 1)
 151510 
 151511 		}
 151512 		if (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip != 0 {
 151513 			Xsqlite3VdbeGoto(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip)
 151514 
 151515 			Xsqlite3VdbeJumpHere(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip)
 151516 			Xsqlite3VdbeJumpHere(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip-2)
 151517 		}
 151518 		if (*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin != 0 {
 151519 			var ws int32 = int32((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags)
 151520 			addr = Xsqlite3VdbeAddOp1(tls, v, OP_IfPos, (*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin)
 151521 
 151522 			if ws&WHERE_IDX_ONLY == 0 {
 151523 				Xsqlite3VdbeAddOp1(tls, v, OP_NullRow, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur)
 151524 			}
 151525 			if ws&WHERE_INDEXED != 0 ||
 151526 				ws&WHERE_MULTI_OR != 0 && *(*uintptr)(unsafe.Pointer(pLevel + 72)) != 0 {
 151527 				if ws&WHERE_MULTI_OR != 0 {
 151528 					var pIx uintptr = *(*uintptr)(unsafe.Pointer(pLevel + 72))
 151529 					var iDb int32 = Xsqlite3SchemaToIndex(tls, db, (*Index)(unsafe.Pointer(pIx)).FpSchema)
 151530 					Xsqlite3VdbeAddOp3(tls, v, OP_ReopenIdx, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, int32((*Index)(unsafe.Pointer(pIx)).Ftnum), iDb)
 151531 					Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIx)
 151532 				}
 151533 				Xsqlite3VdbeAddOp1(tls, v, OP_NullRow, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur)
 151534 			}
 151535 			if int32((*WhereLevel)(unsafe.Pointer(pLevel)).Fop) == OP_Return {
 151536 				Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, (*WhereLevel)(unsafe.Pointer(pLevel)).Fp1, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrFirst)
 151537 			} else {
 151538 				Xsqlite3VdbeGoto(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrFirst)
 151539 			}
 151540 			Xsqlite3VdbeJumpHere(tls, v, addr)
 151541 		}
 151542 
 151543 	}
 151544 
 151545 	i = 0
 151546 	pLevel = pWInfo + 856
 151547 __4:
 151548 	if !(i < int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)) {
 151549 		goto __6
 151550 	}
 151551 	{
 151552 		var k int32
 151553 		var last int32
 151554 		var pOp uintptr
 151555 		var pLastOp uintptr
 151556 		var pIdx uintptr = uintptr(0)
 151557 		var pTabItem uintptr = pTabList + 8 + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104
 151558 		var pTab uintptr = (*SrcItem)(unsafe.Pointer(pTabItem)).FpTab
 151559 
 151560 		pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop
 151561 
 151562 		if (*WhereLevel)(unsafe.Pointer(pLevel)).FpRJ != 0 {
 151563 			Xsqlite3WhereRightJoinLoop(tls, pWInfo, i, pLevel)
 151564 			goto __5
 151565 		}
 151566 
 151567 		if uint32(int32(*(*uint16)(unsafe.Pointer(pTabItem + 60 + 4))&0x20>>5)) != 0 {
 151568 			translateColumnToCopy(tls, pParse, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBody, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur,
 151569 				(*SrcItem)(unsafe.Pointer(pTabItem)).FregResult, 0)
 151570 			goto __5
 151571 		}
 151572 
 151573 		if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_INDEXED|WHERE_IDX_ONLY) != 0 {
 151574 			pIdx = *(*uintptr)(unsafe.Pointer(pLoop + 24 + 8))
 151575 		} else if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&U32(WHERE_MULTI_OR) != 0 {
 151576 			pIdx = *(*uintptr)(unsafe.Pointer(pLevel + 72))
 151577 		}
 151578 		if pIdx != 0 &&
 151579 			!(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
 151580 			if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_OFF || !((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 151581 				last = iEnd
 151582 			} else {
 151583 				last = (*WhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere
 151584 			}
 151585 			if uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) != 0 {
 151586 				var p uintptr = (*Parse)(unsafe.Pointer(pParse)).FpIdxEpr
 151587 				for p != 0 {
 151588 					if (*IndexedExpr)(unsafe.Pointer(p)).FiIdxCur == (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur {
 151589 						(*IndexedExpr)(unsafe.Pointer(p)).FiDataCur = -1
 151590 						(*IndexedExpr)(unsafe.Pointer(p)).FiIdxCur = -1
 151591 					}
 151592 					p = (*IndexedExpr)(unsafe.Pointer(p)).FpIENext
 151593 				}
 151594 			}
 151595 			k = (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBody + 1
 151596 			pOp = Xsqlite3VdbeGetOp(tls, v, k)
 151597 			pLastOp = pOp + uintptr(last-k)*24
 151598 
 151599 			for __ccgo := true; __ccgo; __ccgo = libc.PreIncUintptr(&pOp, 24) < pLastOp {
 151600 				if (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 != (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur {
 151601 				} else if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Column ||
 151602 					int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Offset {
 151603 					var x int32 = (*VdbeOp)(unsafe.Pointer(pOp)).Fp2
 151604 
 151605 					if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Offset {
 151606 					} else if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0)) {
 151607 						var pPk uintptr = Xsqlite3PrimaryKeyIndex(tls, pTab)
 151608 						x = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(x)*2)))
 151609 
 151610 					} else {
 151611 						x = int32(Xsqlite3StorageColumnToTable(tls, pTab, int16(x)))
 151612 					}
 151613 					x = int32(Xsqlite3TableColumnToIndex(tls, pIdx, int16(x)))
 151614 					if x >= 0 {
 151615 						(*VdbeOp)(unsafe.Pointer(pOp)).Fp2 = x
 151616 						(*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur
 151617 
 151618 					} else {
 151619 					}
 151620 				} else if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Rowid {
 151621 					(*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur
 151622 					(*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_IdxRowid)
 151623 
 151624 				} else if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_IfNullRow {
 151625 					(*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur
 151626 
 151627 				}
 151628 			}
 151629 		}
 151630 
 151631 	}
 151632 	goto __5
 151633 __5:
 151634 	i++
 151635 	pLevel += 104
 151636 	goto __4
 151637 	goto __6
 151638 __6:
 151639 	;
 151640 	Xsqlite3VdbeResolveLabel(tls, v, (*WhereInfo)(unsafe.Pointer(pWInfo)).FiBreak)
 151641 
 151642 	(*Parse)(unsafe.Pointer(pParse)).FnQueryLoop = U32((*WhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop)
 151643 	whereInfoFree(tls, db, pWInfo)
 151644 	*(*U8)(unsafe.Pointer(pParse + 38)) -= U8(nRJ)
 151645 	return
 151646 }
 151647 
 151648 func row_numberStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) {
 151649 	var p uintptr = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(I64(0))))
 151650 	if p != 0 {
 151651 		*(*I64)(unsafe.Pointer(p))++
 151652 	}
 151653 	_ = nArg
 151654 	_ = apArg
 151655 }
 151656 
 151657 func row_numberValueFunc(tls *libc.TLS, pCtx uintptr) {
 151658 	var p uintptr = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(I64(0))))
 151659 	Xsqlite3_result_int64(tls, pCtx, func() int64 {
 151660 		if p != 0 {
 151661 			return *(*I64)(unsafe.Pointer(p))
 151662 		}
 151663 		return int64(0)
 151664 	}())
 151665 }
 151666 
 151667 // Context object type used by rank(), dense_rank(), percent_rank() and
 151668 // cume_dist().
 151669 type CallCount = struct {
 151670 	FnValue I64
 151671 	FnStep  I64
 151672 	FnTotal I64
 151673 }
 151674 
 151675 func dense_rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) {
 151676 	var p uintptr
 151677 	p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{})))
 151678 	if p != 0 {
 151679 		(*CallCount)(unsafe.Pointer(p)).FnStep = int64(1)
 151680 	}
 151681 	_ = nArg
 151682 	_ = apArg
 151683 }
 151684 
 151685 func dense_rankValueFunc(tls *libc.TLS, pCtx uintptr) {
 151686 	var p uintptr
 151687 	p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{})))
 151688 	if p != 0 {
 151689 		if (*CallCount)(unsafe.Pointer(p)).FnStep != 0 {
 151690 			(*CallCount)(unsafe.Pointer(p)).FnValue++
 151691 			(*CallCount)(unsafe.Pointer(p)).FnStep = int64(0)
 151692 		}
 151693 		Xsqlite3_result_int64(tls, pCtx, (*CallCount)(unsafe.Pointer(p)).FnValue)
 151694 	}
 151695 }
 151696 
 151697 // Implementation of built-in window function nth_value(). This
 151698 // implementation is used in "slow mode" only - when the EXCLUDE clause
 151699 // is not set to the default value "NO OTHERS".
 151700 type NthValueCtx = struct {
 151701 	FnStep  I64
 151702 	FpValue uintptr
 151703 }
 151704 
 151705 func nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) {
 151706 	var p uintptr
 151707 	var fVal float64
 151708 	var iVal I64
 151709 	p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(NthValueCtx{})))
 151710 	if !(p != 0) {
 151711 		goto __1
 151712 	}
 151713 	switch Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8))) {
 151714 	case SQLITE_INTEGER:
 151715 		goto __3
 151716 	case SQLITE_FLOAT:
 151717 		goto __4
 151718 	default:
 151719 		goto __5
 151720 	}
 151721 	goto __2
 151722 __3:
 151723 	iVal = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8)))
 151724 	goto __2
 151725 __4:
 151726 	fVal = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8)))
 151727 	if !(float64(I64(fVal)) != fVal) {
 151728 		goto __6
 151729 	}
 151730 	goto error_out
 151731 __6:
 151732 	;
 151733 	iVal = I64(fVal)
 151734 	goto __2
 151735 
 151736 __5:
 151737 	goto error_out
 151738 __2:
 151739 	;
 151740 	if !(iVal <= int64(0)) {
 151741 		goto __7
 151742 	}
 151743 	goto error_out
 151744 __7:
 151745 	;
 151746 	(*NthValueCtx)(unsafe.Pointer(p)).FnStep++
 151747 	if !(iVal == (*NthValueCtx)(unsafe.Pointer(p)).FnStep) {
 151748 		goto __8
 151749 	}
 151750 	(*NthValueCtx)(unsafe.Pointer(p)).FpValue = Xsqlite3_value_dup(tls, *(*uintptr)(unsafe.Pointer(apArg)))
 151751 	if !!(int32((*NthValueCtx)(unsafe.Pointer(p)).FpValue) != 0) {
 151752 		goto __9
 151753 	}
 151754 	Xsqlite3_result_error_nomem(tls, pCtx)
 151755 __9:
 151756 	;
 151757 __8:
 151758 	;
 151759 __1:
 151760 	;
 151761 	_ = nArg
 151762 	_ = apArg
 151763 	return
 151764 
 151765 error_out:
 151766 	Xsqlite3_result_error(tls,
 151767 		pCtx, ts+23484, -1)
 151768 }
 151769 
 151770 func nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) {
 151771 	var p uintptr
 151772 	p = Xsqlite3_aggregate_context(tls, pCtx, 0)
 151773 	if p != 0 && (*NthValueCtx)(unsafe.Pointer(p)).FpValue != 0 {
 151774 		Xsqlite3_result_value(tls, pCtx, (*NthValueCtx)(unsafe.Pointer(p)).FpValue)
 151775 		Xsqlite3_value_free(tls, (*NthValueCtx)(unsafe.Pointer(p)).FpValue)
 151776 		(*NthValueCtx)(unsafe.Pointer(p)).FpValue = uintptr(0)
 151777 	}
 151778 }
 151779 
 151780 func first_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) {
 151781 	var p uintptr
 151782 	p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(NthValueCtx{})))
 151783 	if p != 0 && (*NthValueCtx)(unsafe.Pointer(p)).FpValue == uintptr(0) {
 151784 		(*NthValueCtx)(unsafe.Pointer(p)).FpValue = Xsqlite3_value_dup(tls, *(*uintptr)(unsafe.Pointer(apArg)))
 151785 		if !(int32((*NthValueCtx)(unsafe.Pointer(p)).FpValue) != 0) {
 151786 			Xsqlite3_result_error_nomem(tls, pCtx)
 151787 		}
 151788 	}
 151789 	_ = nArg
 151790 	_ = apArg
 151791 }
 151792 
 151793 func first_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) {
 151794 	var p uintptr
 151795 	p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(NthValueCtx{})))
 151796 	if p != 0 && (*NthValueCtx)(unsafe.Pointer(p)).FpValue != 0 {
 151797 		Xsqlite3_result_value(tls, pCtx, (*NthValueCtx)(unsafe.Pointer(p)).FpValue)
 151798 		Xsqlite3_value_free(tls, (*NthValueCtx)(unsafe.Pointer(p)).FpValue)
 151799 		(*NthValueCtx)(unsafe.Pointer(p)).FpValue = uintptr(0)
 151800 	}
 151801 }
 151802 
 151803 func rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) {
 151804 	var p uintptr
 151805 	p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{})))
 151806 	if p != 0 {
 151807 		(*CallCount)(unsafe.Pointer(p)).FnStep++
 151808 		if (*CallCount)(unsafe.Pointer(p)).FnValue == int64(0) {
 151809 			(*CallCount)(unsafe.Pointer(p)).FnValue = (*CallCount)(unsafe.Pointer(p)).FnStep
 151810 		}
 151811 	}
 151812 	_ = nArg
 151813 	_ = apArg
 151814 }
 151815 
 151816 func rankValueFunc(tls *libc.TLS, pCtx uintptr) {
 151817 	var p uintptr
 151818 	p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{})))
 151819 	if p != 0 {
 151820 		Xsqlite3_result_int64(tls, pCtx, (*CallCount)(unsafe.Pointer(p)).FnValue)
 151821 		(*CallCount)(unsafe.Pointer(p)).FnValue = int64(0)
 151822 	}
 151823 }
 151824 
 151825 func percent_rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) {
 151826 	var p uintptr
 151827 	_ = nArg
 151828 	_ = apArg
 151829 	p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{})))
 151830 	if p != 0 {
 151831 		(*CallCount)(unsafe.Pointer(p)).FnTotal++
 151832 	}
 151833 }
 151834 
 151835 func percent_rankInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) {
 151836 	var p uintptr
 151837 	_ = nArg
 151838 	_ = apArg
 151839 	p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{})))
 151840 	(*CallCount)(unsafe.Pointer(p)).FnStep++
 151841 }
 151842 
 151843 func percent_rankValueFunc(tls *libc.TLS, pCtx uintptr) {
 151844 	var p uintptr
 151845 	p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{})))
 151846 	if p != 0 {
 151847 		(*CallCount)(unsafe.Pointer(p)).FnValue = (*CallCount)(unsafe.Pointer(p)).FnStep
 151848 		if (*CallCount)(unsafe.Pointer(p)).FnTotal > int64(1) {
 151849 			var r float64 = float64((*CallCount)(unsafe.Pointer(p)).FnValue) / float64((*CallCount)(unsafe.Pointer(p)).FnTotal-int64(1))
 151850 			Xsqlite3_result_double(tls, pCtx, r)
 151851 		} else {
 151852 			Xsqlite3_result_double(tls, pCtx, 0.0)
 151853 		}
 151854 	}
 151855 }
 151856 
 151857 func cume_distStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) {
 151858 	var p uintptr
 151859 	_ = nArg
 151860 	_ = apArg
 151861 	p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{})))
 151862 	if p != 0 {
 151863 		(*CallCount)(unsafe.Pointer(p)).FnTotal++
 151864 	}
 151865 }
 151866 
 151867 func cume_distInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) {
 151868 	var p uintptr
 151869 	_ = nArg
 151870 	_ = apArg
 151871 	p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{})))
 151872 	(*CallCount)(unsafe.Pointer(p)).FnStep++
 151873 }
 151874 
 151875 func cume_distValueFunc(tls *libc.TLS, pCtx uintptr) {
 151876 	var p uintptr
 151877 	p = Xsqlite3_aggregate_context(tls, pCtx, 0)
 151878 	if p != 0 {
 151879 		var r float64 = float64((*CallCount)(unsafe.Pointer(p)).FnStep) / float64((*CallCount)(unsafe.Pointer(p)).FnTotal)
 151880 		Xsqlite3_result_double(tls, pCtx, r)
 151881 	}
 151882 }
 151883 
 151884 // Context object for ntile() window function.
 151885 type NtileCtx = struct {
 151886 	FnTotal I64
 151887 	FnParam I64
 151888 	FiRow   I64
 151889 }
 151890 
 151891 func ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) {
 151892 	var p uintptr
 151893 	_ = nArg
 151894 	p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(NtileCtx{})))
 151895 	if p != 0 {
 151896 		if (*NtileCtx)(unsafe.Pointer(p)).FnTotal == int64(0) {
 151897 			(*NtileCtx)(unsafe.Pointer(p)).FnParam = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg)))
 151898 			if (*NtileCtx)(unsafe.Pointer(p)).FnParam <= int64(0) {
 151899 				Xsqlite3_result_error(tls,
 151900 					pCtx, ts+23540, -1)
 151901 			}
 151902 		}
 151903 		(*NtileCtx)(unsafe.Pointer(p)).FnTotal++
 151904 	}
 151905 }
 151906 
 151907 func ntileInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) {
 151908 	var p uintptr
 151909 	_ = nArg
 151910 	_ = apArg
 151911 	p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(NtileCtx{})))
 151912 	(*NtileCtx)(unsafe.Pointer(p)).FiRow++
 151913 }
 151914 
 151915 func ntileValueFunc(tls *libc.TLS, pCtx uintptr) {
 151916 	var p uintptr
 151917 	p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(NtileCtx{})))
 151918 	if p != 0 && (*NtileCtx)(unsafe.Pointer(p)).FnParam > int64(0) {
 151919 		var nSize int32 = int32((*NtileCtx)(unsafe.Pointer(p)).FnTotal / (*NtileCtx)(unsafe.Pointer(p)).FnParam)
 151920 		if nSize == 0 {
 151921 			Xsqlite3_result_int64(tls, pCtx, (*NtileCtx)(unsafe.Pointer(p)).FiRow+int64(1))
 151922 		} else {
 151923 			var nLarge I64 = (*NtileCtx)(unsafe.Pointer(p)).FnTotal - (*NtileCtx)(unsafe.Pointer(p)).FnParam*I64(nSize)
 151924 			var iSmall I64 = nLarge * I64(nSize+1)
 151925 			var iRow I64 = (*NtileCtx)(unsafe.Pointer(p)).FiRow
 151926 
 151927 			if iRow < iSmall {
 151928 				Xsqlite3_result_int64(tls, pCtx, int64(1)+iRow/I64(nSize+1))
 151929 			} else {
 151930 				Xsqlite3_result_int64(tls, pCtx, int64(1)+nLarge+(iRow-iSmall)/I64(nSize))
 151931 			}
 151932 		}
 151933 	}
 151934 }
 151935 
 151936 // Context object for last_value() window function.
 151937 type LastValueCtx = struct {
 151938 	FpVal        uintptr
 151939 	FnVal        int32
 151940 	F__ccgo_pad1 [4]byte
 151941 }
 151942 
 151943 func last_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) {
 151944 	var p uintptr
 151945 	_ = nArg
 151946 	p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(LastValueCtx{})))
 151947 	if p != 0 {
 151948 		Xsqlite3_value_free(tls, (*LastValueCtx)(unsafe.Pointer(p)).FpVal)
 151949 		(*LastValueCtx)(unsafe.Pointer(p)).FpVal = Xsqlite3_value_dup(tls, *(*uintptr)(unsafe.Pointer(apArg)))
 151950 		if (*LastValueCtx)(unsafe.Pointer(p)).FpVal == uintptr(0) {
 151951 			Xsqlite3_result_error_nomem(tls, pCtx)
 151952 		} else {
 151953 			(*LastValueCtx)(unsafe.Pointer(p)).FnVal++
 151954 		}
 151955 	}
 151956 }
 151957 
 151958 func last_valueInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) {
 151959 	var p uintptr
 151960 	_ = nArg
 151961 	_ = apArg
 151962 	p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(LastValueCtx{})))
 151963 	if p != 0 {
 151964 		(*LastValueCtx)(unsafe.Pointer(p)).FnVal--
 151965 		if (*LastValueCtx)(unsafe.Pointer(p)).FnVal == 0 {
 151966 			Xsqlite3_value_free(tls, (*LastValueCtx)(unsafe.Pointer(p)).FpVal)
 151967 			(*LastValueCtx)(unsafe.Pointer(p)).FpVal = uintptr(0)
 151968 		}
 151969 	}
 151970 }
 151971 
 151972 func last_valueValueFunc(tls *libc.TLS, pCtx uintptr) {
 151973 	var p uintptr
 151974 	p = Xsqlite3_aggregate_context(tls, pCtx, 0)
 151975 	if p != 0 && (*LastValueCtx)(unsafe.Pointer(p)).FpVal != 0 {
 151976 		Xsqlite3_result_value(tls, pCtx, (*LastValueCtx)(unsafe.Pointer(p)).FpVal)
 151977 	}
 151978 }
 151979 
 151980 func last_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) {
 151981 	var p uintptr
 151982 	p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(LastValueCtx{})))
 151983 	if p != 0 && (*LastValueCtx)(unsafe.Pointer(p)).FpVal != 0 {
 151984 		Xsqlite3_result_value(tls, pCtx, (*LastValueCtx)(unsafe.Pointer(p)).FpVal)
 151985 		Xsqlite3_value_free(tls, (*LastValueCtx)(unsafe.Pointer(p)).FpVal)
 151986 		(*LastValueCtx)(unsafe.Pointer(p)).FpVal = uintptr(0)
 151987 	}
 151988 }
 151989 
 151990 var row_numberName = *(*[11]int8)(unsafe.Pointer(ts + 23585))
 151991 var dense_rankName = *(*[11]int8)(unsafe.Pointer(ts + 23596))
 151992 var rankName = *(*[5]int8)(unsafe.Pointer(ts + 23607))
 151993 var percent_rankName = *(*[13]int8)(unsafe.Pointer(ts + 23612))
 151994 var cume_distName = *(*[10]int8)(unsafe.Pointer(ts + 23625))
 151995 var ntileName = *(*[6]int8)(unsafe.Pointer(ts + 23635))
 151996 var last_valueName = *(*[11]int8)(unsafe.Pointer(ts + 23641))
 151997 var nth_valueName = *(*[10]int8)(unsafe.Pointer(ts + 23652))
 151998 var first_valueName = *(*[12]int8)(unsafe.Pointer(ts + 23662))
 151999 var leadName = *(*[5]int8)(unsafe.Pointer(ts + 23674))
 152000 var lagName = *(*[4]int8)(unsafe.Pointer(ts + 23679))
 152001 
 152002 func noopStepFunc(tls *libc.TLS, p uintptr, n int32, a uintptr) {
 152003 	_ = p
 152004 	_ = n
 152005 	_ = a
 152006 
 152007 }
 152008 
 152009 func noopValueFunc(tls *libc.TLS, p uintptr) {
 152010 	_ = p
 152011 }
 152012 
 152013 // Register those built-in window functions that are not also aggregates.
 152014 func Xsqlite3WindowFunctions(tls *libc.TLS) {
 152015 	Xsqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&aWindowFuncs)), int32(uint64(unsafe.Sizeof(aWindowFuncs))/uint64(unsafe.Sizeof(FuncDef{}))))
 152016 }
 152017 
 152018 var aWindowFuncs = [15]FuncDef{
 152019 	{FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
 152020 	{FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
 152021 	{FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
 152022 	{FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
 152023 	{FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
 152024 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
 152025 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
 152026 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
 152027 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
 152028 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
 152029 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
 152030 	{FnArg: int8(3), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
 152031 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
 152032 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0},
 152033 	{FnArg: int8(3), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | SQLITE_FUNC_WINDOW | 0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0}}
 152034 
 152035 func windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) uintptr {
 152036 	bp := tls.Alloc(8)
 152037 	defer tls.Free(8)
 152038 
 152039 	var p uintptr
 152040 	for p = pList; p != 0; p = (*Window)(unsafe.Pointer(p)).FpNextWin {
 152041 		if Xsqlite3StrICmp(tls, (*Window)(unsafe.Pointer(p)).FzName, zName) == 0 {
 152042 			break
 152043 		}
 152044 	}
 152045 	if p == uintptr(0) {
 152046 		Xsqlite3ErrorMsg(tls, pParse, ts+23683, libc.VaList(bp, zName))
 152047 	}
 152048 	return p
 152049 }
 152050 
 152051 // This function is called immediately after resolving the function name
 152052 // for a window function within a SELECT statement. Argument pList is a
 152053 // linked list of WINDOW definitions for the current SELECT statement.
 152054 // Argument pFunc is the function definition just resolved and pWin
 152055 // is the Window object representing the associated OVER clause. This
 152056 // function updates the contents of pWin as follows:
 152057 //
 152058 //   - If the OVER clause refered to a named window (as in "max(x) OVER win"),
 152059 //     search list pList for a matching WINDOW definition, and update pWin
 152060 //     accordingly. If no such WINDOW clause can be found, leave an error
 152061 //     in pParse.
 152062 //
 152063 //   - If the function is a built-in window function that requires the
 152064 //     window to be coerced (see "BUILT-IN WINDOW FUNCTIONS" at the top
 152065 //     of this file), pWin is updated here.
 152066 func Xsqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uintptr, pFunc uintptr) {
 152067 	bp := tls.Alloc(192)
 152068 	defer tls.Free(192)
 152069 
 152070 	if (*Window)(unsafe.Pointer(pWin)).FzName != 0 && int32((*Window)(unsafe.Pointer(pWin)).FeFrmType) == 0 {
 152071 		var p uintptr = windowFind(tls, pParse, pList, (*Window)(unsafe.Pointer(pWin)).FzName)
 152072 		if p == uintptr(0) {
 152073 			return
 152074 		}
 152075 		(*Window)(unsafe.Pointer(pWin)).FpPartition = Xsqlite3ExprListDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Window)(unsafe.Pointer(p)).FpPartition, 0)
 152076 		(*Window)(unsafe.Pointer(pWin)).FpOrderBy = Xsqlite3ExprListDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Window)(unsafe.Pointer(p)).FpOrderBy, 0)
 152077 		(*Window)(unsafe.Pointer(pWin)).FpStart = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Window)(unsafe.Pointer(p)).FpStart, 0)
 152078 		(*Window)(unsafe.Pointer(pWin)).FpEnd = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Window)(unsafe.Pointer(p)).FpEnd, 0)
 152079 		(*Window)(unsafe.Pointer(pWin)).FeStart = (*Window)(unsafe.Pointer(p)).FeStart
 152080 		(*Window)(unsafe.Pointer(pWin)).FeEnd = (*Window)(unsafe.Pointer(p)).FeEnd
 152081 		(*Window)(unsafe.Pointer(pWin)).FeFrmType = (*Window)(unsafe.Pointer(p)).FeFrmType
 152082 		(*Window)(unsafe.Pointer(pWin)).FeExclude = (*Window)(unsafe.Pointer(p)).FeExclude
 152083 	} else {
 152084 		Xsqlite3WindowChain(tls, pParse, pWin, pList)
 152085 	}
 152086 	if int32((*Window)(unsafe.Pointer(pWin)).FeFrmType) == TK_RANGE &&
 152087 		((*Window)(unsafe.Pointer(pWin)).FpStart != 0 || (*Window)(unsafe.Pointer(pWin)).FpEnd != 0) &&
 152088 		((*Window)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0) || (*ExprList)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != 1) {
 152089 		Xsqlite3ErrorMsg(tls, pParse,
 152090 			ts+23702, 0)
 152091 	} else if (*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&U32(SQLITE_FUNC_WINDOW) != 0 {
 152092 		var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 152093 		if (*Window)(unsafe.Pointer(pWin)).FpFilter != 0 {
 152094 			Xsqlite3ErrorMsg(tls, pParse,
 152095 				ts+23773, 0)
 152096 		} else {
 152097 			*(*[8]WindowUpdate)(unsafe.Pointer(bp)) = [8]WindowUpdate{
 152098 				{FzFunc: uintptr(unsafe.Pointer(&row_numberName)), FeFrmType: TK_ROWS, FeStart: TK_UNBOUNDED, FeEnd: TK_CURRENT},
 152099 				{FzFunc: uintptr(unsafe.Pointer(&dense_rankName)), FeFrmType: TK_RANGE, FeStart: TK_UNBOUNDED, FeEnd: TK_CURRENT},
 152100 				{FzFunc: uintptr(unsafe.Pointer(&rankName)), FeFrmType: TK_RANGE, FeStart: TK_UNBOUNDED, FeEnd: TK_CURRENT},
 152101 				{FzFunc: uintptr(unsafe.Pointer(&percent_rankName)), FeFrmType: TK_GROUPS, FeStart: TK_CURRENT, FeEnd: TK_UNBOUNDED},
 152102 				{FzFunc: uintptr(unsafe.Pointer(&cume_distName)), FeFrmType: TK_GROUPS, FeStart: TK_FOLLOWING, FeEnd: TK_UNBOUNDED},
 152103 				{FzFunc: uintptr(unsafe.Pointer(&ntileName)), FeFrmType: TK_ROWS, FeStart: TK_CURRENT, FeEnd: TK_UNBOUNDED},
 152104 				{FzFunc: uintptr(unsafe.Pointer(&leadName)), FeFrmType: TK_ROWS, FeStart: TK_UNBOUNDED, FeEnd: TK_UNBOUNDED},
 152105 				{FzFunc: uintptr(unsafe.Pointer(&lagName)), FeFrmType: TK_ROWS, FeStart: TK_UNBOUNDED, FeEnd: TK_CURRENT},
 152106 			}
 152107 			var i int32
 152108 			for i = 0; i < int32(uint64(unsafe.Sizeof([8]WindowUpdate{}))/uint64(unsafe.Sizeof(WindowUpdate{}))); i++ {
 152109 				if (*FuncDef)(unsafe.Pointer(pFunc)).FzName == (*WindowUpdate)(unsafe.Pointer(bp+uintptr(i)*24)).FzFunc {
 152110 					Xsqlite3ExprDelete(tls, db, (*Window)(unsafe.Pointer(pWin)).FpStart)
 152111 					Xsqlite3ExprDelete(tls, db, (*Window)(unsafe.Pointer(pWin)).FpEnd)
 152112 					(*Window)(unsafe.Pointer(pWin)).FpEnd = libc.AssignPtrUintptr(pWin+40, uintptr(0))
 152113 					(*Window)(unsafe.Pointer(pWin)).FeFrmType = U8((*WindowUpdate)(unsafe.Pointer(bp + uintptr(i)*24)).FeFrmType)
 152114 					(*Window)(unsafe.Pointer(pWin)).FeStart = U8((*WindowUpdate)(unsafe.Pointer(bp + uintptr(i)*24)).FeStart)
 152115 					(*Window)(unsafe.Pointer(pWin)).FeEnd = U8((*WindowUpdate)(unsafe.Pointer(bp + uintptr(i)*24)).FeEnd)
 152116 					(*Window)(unsafe.Pointer(pWin)).FeExclude = U8(0)
 152117 					if int32((*Window)(unsafe.Pointer(pWin)).FeStart) == TK_FOLLOWING {
 152118 						(*Window)(unsafe.Pointer(pWin)).FpStart = Xsqlite3Expr(tls, db, TK_INTEGER, ts+9290)
 152119 					}
 152120 					break
 152121 				}
 152122 			}
 152123 		}
 152124 	}
 152125 	(*Window)(unsafe.Pointer(pWin)).FpWFunc = pFunc
 152126 }
 152127 
 152128 type WindowUpdate = struct {
 152129 	FzFunc       uintptr
 152130 	FeFrmType    int32
 152131 	FeStart      int32
 152132 	FeEnd        int32
 152133 	F__ccgo_pad1 [4]byte
 152134 }
 152135 
 152136 // Context object passed through sqlite3WalkExprList() to
 152137 // selectWindowRewriteExprCb() by selectWindowRewriteEList().
 152138 type WindowRewrite = WindowRewrite1
 152139 
 152140 func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 152141 	var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40))
 152142 	var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse
 152143 
 152144 	if (*WindowRewrite1)(unsafe.Pointer(p)).FpSubSelect != 0 {
 152145 		if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLUMN {
 152146 			return WRC_Continue
 152147 		} else {
 152148 			var nSrc int32 = (*SrcList)(unsafe.Pointer((*WindowRewrite1)(unsafe.Pointer(p)).FpSrc)).FnSrc
 152149 			var i int32
 152150 			for i = 0; i < nSrc; i++ {
 152151 				if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcItem)(unsafe.Pointer((*WindowRewrite1)(unsafe.Pointer(p)).FpSrc+8+uintptr(i)*104)).FiCursor {
 152152 					break
 152153 				}
 152154 			}
 152155 			if i == nSrc {
 152156 				return WRC_Continue
 152157 			}
 152158 		}
 152159 	}
 152160 
 152161 	{
 152162 		switch int32((*Expr)(unsafe.Pointer(pExpr)).Fop) {
 152163 		case TK_FUNCTION:
 152164 			if !((*Expr)(unsafe.Pointer(pExpr)).Fflags&U32(EP_WinFunc) != U32(0)) {
 152165 				break
 152166 			} else {
 152167 				var pWin uintptr
 152168 				for pWin = (*WindowRewrite1)(unsafe.Pointer(p)).FpWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin {
 152169 					if *(*uintptr)(unsafe.Pointer(pExpr + 64)) == pWin {
 152170 						return WRC_Prune
 152171 					}
 152172 				}
 152173 			}
 152174 			fallthrough
 152175 
 152176 		case TK_AGG_FUNCTION:
 152177 			fallthrough
 152178 		case TK_COLUMN:
 152179 			{
 152180 				var iCol int32 = -1
 152181 				if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 {
 152182 					return WRC_Abort
 152183 				}
 152184 				if (*WindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 {
 152185 					var i int32
 152186 					for i = 0; i < (*ExprList)(unsafe.Pointer((*WindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr; i++ {
 152187 						if 0 == Xsqlite3ExprCompare(tls, uintptr(0), (*ExprList_item)(unsafe.Pointer((*WindowRewrite1)(unsafe.Pointer(p)).FpSub+8+uintptr(i)*32)).FpExpr, pExpr, -1) {
 152188 							iCol = i
 152189 							break
 152190 						}
 152191 					}
 152192 				}
 152193 				if iCol < 0 {
 152194 					var pDup uintptr = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, 0)
 152195 					if pDup != 0 && int32((*Expr)(unsafe.Pointer(pDup)).Fop) == TK_AGG_FUNCTION {
 152196 						(*Expr)(unsafe.Pointer(pDup)).Fop = U8(TK_FUNCTION)
 152197 					}
 152198 					(*WindowRewrite1)(unsafe.Pointer(p)).FpSub = Xsqlite3ExprListAppend(tls, pParse, (*WindowRewrite1)(unsafe.Pointer(p)).FpSub, pDup)
 152199 				}
 152200 				if (*WindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 {
 152201 					var f int32 = int32((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_Collate))
 152202 
 152203 					*(*U32)(unsafe.Pointer(pExpr + 4)) |= U32(EP_Static)
 152204 					Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr)
 152205 					*(*U32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(libc.CplInt32(EP_Static))
 152206 					libc.Xmemset(tls, pExpr, 0, uint64(unsafe.Sizeof(Expr{})))
 152207 
 152208 					(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_COLUMN)
 152209 					(*Expr)(unsafe.Pointer(pExpr)).FiColumn = func() int16 {
 152210 						if iCol < 0 {
 152211 							return int16((*ExprList)(unsafe.Pointer((*WindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr - 1)
 152212 						}
 152213 						return int16(iCol)
 152214 					}()
 152215 					(*Expr)(unsafe.Pointer(pExpr)).FiTable = (*Window)(unsafe.Pointer((*WindowRewrite1)(unsafe.Pointer(p)).FpWin)).FiEphCsr
 152216 					*(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*WindowRewrite1)(unsafe.Pointer(p)).FpTab
 152217 					(*Expr)(unsafe.Pointer(pExpr)).Fflags = U32(f)
 152218 				}
 152219 				if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 {
 152220 					return WRC_Abort
 152221 				}
 152222 				break
 152223 
 152224 			}
 152225 
 152226 		default:
 152227 			break
 152228 		}
 152229 	}
 152230 
 152231 	return WRC_Continue
 152232 }
 152233 
 152234 func selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 {
 152235 	var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40))
 152236 	var pSave uintptr = (*WindowRewrite1)(unsafe.Pointer(p)).FpSubSelect
 152237 	if pSave == pSelect {
 152238 		return WRC_Continue
 152239 	} else {
 152240 		(*WindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSelect
 152241 		Xsqlite3WalkSelect(tls, pWalker, pSelect)
 152242 		(*WindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSave
 152243 	}
 152244 	return WRC_Prune
 152245 }
 152246 
 152247 func selectWindowRewriteEList(tls *libc.TLS, pParse uintptr, pWin uintptr, pSrc uintptr, pEList uintptr, pTab uintptr, ppSub uintptr) {
 152248 	bp := tls.Alloc(88)
 152249 	defer tls.Free(88)
 152250 
 152251 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Walker{})))
 152252 	libc.Xmemset(tls, bp+48, 0, uint64(unsafe.Sizeof(WindowRewrite{})))
 152253 
 152254 	(*WindowRewrite)(unsafe.Pointer(bp + 48)).FpSub = *(*uintptr)(unsafe.Pointer(ppSub))
 152255 	(*WindowRewrite)(unsafe.Pointer(bp + 48)).FpWin = pWin
 152256 	(*WindowRewrite)(unsafe.Pointer(bp + 48)).FpSrc = pSrc
 152257 	(*WindowRewrite)(unsafe.Pointer(bp + 48)).FpTab = pTab
 152258 
 152259 	(*Walker)(unsafe.Pointer(bp)).FpParse = pParse
 152260 	(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 152261 		f func(*libc.TLS, uintptr, uintptr) int32
 152262 	}{selectWindowRewriteExprCb}))
 152263 	(*Walker)(unsafe.Pointer(bp)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
 152264 		f func(*libc.TLS, uintptr, uintptr) int32
 152265 	}{selectWindowRewriteSelectCb}))
 152266 	*(*uintptr)(unsafe.Pointer(bp + 40)) = bp + 48
 152267 
 152268 	Xsqlite3WalkExprList(tls, bp, pEList)
 152269 
 152270 	*(*uintptr)(unsafe.Pointer(ppSub)) = (*WindowRewrite)(unsafe.Pointer(bp + 48)).FpSub
 152271 }
 152272 
 152273 func exprListAppendList(tls *libc.TLS, pParse uintptr, pList uintptr, pAppend uintptr, bIntToNull int32) uintptr {
 152274 	bp := tls.Alloc(4)
 152275 	defer tls.Free(4)
 152276 
 152277 	if pAppend != 0 {
 152278 		var i int32
 152279 		var nInit int32
 152280 		if pList != 0 {
 152281 			nInit = (*ExprList)(unsafe.Pointer(pList)).FnExpr
 152282 		} else {
 152283 			nInit = 0
 152284 		}
 152285 		for i = 0; i < (*ExprList)(unsafe.Pointer(pAppend)).FnExpr; i++ {
 152286 			var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 152287 			var pDup uintptr = Xsqlite3ExprDup(tls, db, (*ExprList_item)(unsafe.Pointer(pAppend+8+uintptr(i)*32)).FpExpr, 0)
 152288 			if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 152289 				Xsqlite3ExprDelete(tls, db, pDup)
 152290 				break
 152291 			}
 152292 			if bIntToNull != 0 {
 152293 				var pSub uintptr
 152294 				pSub = Xsqlite3ExprSkipCollateAndLikely(tls, pDup)
 152295 				if Xsqlite3ExprIsInteger(tls, pSub, bp) != 0 {
 152296 					(*Expr)(unsafe.Pointer(pSub)).Fop = U8(TK_NULL)
 152297 					*(*U32)(unsafe.Pointer(pSub + 4)) &= libc.Uint32FromInt32(libc.CplInt32(EP_IntValue | EP_IsTrue | EP_IsFalse))
 152298 					*(*uintptr)(unsafe.Pointer(pSub + 8)) = uintptr(0)
 152299 				}
 152300 			}
 152301 			pList = Xsqlite3ExprListAppend(tls, pParse, pList, pDup)
 152302 			if pList != 0 {
 152303 				(*ExprList_item)(unsafe.Pointer(pList + 8 + uintptr(nInit+i)*32)).Ffg.FsortFlags = (*ExprList_item)(unsafe.Pointer(pAppend + 8 + uintptr(i)*32)).Ffg.FsortFlags
 152304 			}
 152305 		}
 152306 	}
 152307 	return pList
 152308 }
 152309 
 152310 func sqlite3WindowExtraAggFuncDepth(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 152311 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AGG_FUNCTION &&
 152312 		int32((*Expr)(unsafe.Pointer(pExpr)).Fop2) >= (*Walker)(unsafe.Pointer(pWalker)).FwalkerDepth {
 152313 		(*Expr)(unsafe.Pointer(pExpr)).Fop2++
 152314 	}
 152315 	return WRC_Continue
 152316 }
 152317 
 152318 func disallowAggregatesInOrderByCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 {
 152319 	bp := tls.Alloc(8)
 152320 	defer tls.Free(8)
 152321 
 152322 	if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AGG_FUNCTION && (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) {
 152323 		Xsqlite3ErrorMsg(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse,
 152324 			ts+23836, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(pExpr + 8))))
 152325 	}
 152326 	return WRC_Continue
 152327 }
 152328 
 152329 // If the SELECT statement passed as the second argument does not invoke
 152330 // any SQL window functions, this function is a no-op. Otherwise, it
 152331 // rewrites the SELECT statement so that window function xStep functions
 152332 // are invoked in the correct order as described under "SELECT REWRITING"
 152333 // at the top of this file.
 152334 func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 {
 152335 	bp := tls.Alloc(56)
 152336 	defer tls.Free(56)
 152337 
 152338 	var rc int32 = SQLITE_OK
 152339 	if (*Select)(unsafe.Pointer(p)).FpWin != 0 &&
 152340 		(*Select)(unsafe.Pointer(p)).FpPrior == uintptr(0) &&
 152341 		(*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_WinRewrite) == U32(0) &&
 152342 		!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 152343 		var v uintptr = Xsqlite3GetVdbe(tls, pParse)
 152344 		var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 152345 		var pSub uintptr = uintptr(0)
 152346 		var pSrc uintptr = (*Select)(unsafe.Pointer(p)).FpSrc
 152347 		var pWhere uintptr = (*Select)(unsafe.Pointer(p)).FpWhere
 152348 		var pGroupBy uintptr = (*Select)(unsafe.Pointer(p)).FpGroupBy
 152349 		var pHaving uintptr = (*Select)(unsafe.Pointer(p)).FpHaving
 152350 		var pSort uintptr = uintptr(0)
 152351 
 152352 		*(*uintptr)(unsafe.Pointer(bp + 48)) = uintptr(0)
 152353 		var pMWin uintptr = (*Select)(unsafe.Pointer(p)).FpWin
 152354 		var pWin uintptr
 152355 		var pTab uintptr
 152356 
 152357 		var selFlags U32 = (*Select)(unsafe.Pointer(p)).FselFlags
 152358 
 152359 		pTab = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Table{})))
 152360 		if pTab == uintptr(0) {
 152361 			return Xsqlite3ErrorToParser(tls, db, SQLITE_NOMEM)
 152362 		}
 152363 		Xsqlite3AggInfoPersistWalkerInit(tls, bp, pParse)
 152364 		Xsqlite3WalkSelect(tls, bp, p)
 152365 		if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_Aggregate) == U32(0) {
 152366 			(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 152367 				f func(*libc.TLS, uintptr, uintptr) int32
 152368 			}{disallowAggregatesInOrderByCb}))
 152369 			(*Walker)(unsafe.Pointer(bp)).FxSelectCallback = uintptr(0)
 152370 			Xsqlite3WalkExprList(tls, bp, (*Select)(unsafe.Pointer(p)).FpOrderBy)
 152371 		}
 152372 
 152373 		(*Select)(unsafe.Pointer(p)).FpSrc = uintptr(0)
 152374 		(*Select)(unsafe.Pointer(p)).FpWhere = uintptr(0)
 152375 		(*Select)(unsafe.Pointer(p)).FpGroupBy = uintptr(0)
 152376 		(*Select)(unsafe.Pointer(p)).FpHaving = uintptr(0)
 152377 		*(*U32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(libc.CplInt32(SF_Aggregate))
 152378 		*(*U32)(unsafe.Pointer(p + 4)) |= U32(SF_WinRewrite)
 152379 
 152380 		pSort = exprListAppendList(tls, pParse, uintptr(0), (*Window)(unsafe.Pointer(pMWin)).FpPartition, 1)
 152381 		pSort = exprListAppendList(tls, pParse, pSort, (*Window)(unsafe.Pointer(pMWin)).FpOrderBy, 1)
 152382 		if pSort != 0 && (*Select)(unsafe.Pointer(p)).FpOrderBy != 0 && (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpOrderBy)).FnExpr <= (*ExprList)(unsafe.Pointer(pSort)).FnExpr {
 152383 			var nSave int32 = (*ExprList)(unsafe.Pointer(pSort)).FnExpr
 152384 			(*ExprList)(unsafe.Pointer(pSort)).FnExpr = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpOrderBy)).FnExpr
 152385 			if Xsqlite3ExprListCompare(tls, pSort, (*Select)(unsafe.Pointer(p)).FpOrderBy, -1) == 0 {
 152386 				Xsqlite3ExprListDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpOrderBy)
 152387 				(*Select)(unsafe.Pointer(p)).FpOrderBy = uintptr(0)
 152388 			}
 152389 			(*ExprList)(unsafe.Pointer(pSort)).FnExpr = nSave
 152390 		}
 152391 
 152392 		(*Window)(unsafe.Pointer(pMWin)).FiEphCsr = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 152393 		*(*int32)(unsafe.Pointer(pParse + 52)) += 3
 152394 
 152395 		selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*Select)(unsafe.Pointer(p)).FpEList, pTab, bp+48)
 152396 		selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*Select)(unsafe.Pointer(p)).FpOrderBy, pTab, bp+48)
 152397 		(*Window)(unsafe.Pointer(pMWin)).FnBufferCol = func() int32 {
 152398 			if *(*uintptr)(unsafe.Pointer(bp + 48)) != 0 {
 152399 				return (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48)))).FnExpr
 152400 			}
 152401 			return 0
 152402 		}()
 152403 
 152404 		*(*uintptr)(unsafe.Pointer(bp + 48)) = exprListAppendList(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 48)), (*Window)(unsafe.Pointer(pMWin)).FpPartition, 0)
 152405 		*(*uintptr)(unsafe.Pointer(bp + 48)) = exprListAppendList(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 48)), (*Window)(unsafe.Pointer(pMWin)).FpOrderBy, 0)
 152406 
 152407 		for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin {
 152408 			var pArgs uintptr
 152409 
 152410 			pArgs = *(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 32))
 152411 			if (*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpWFunc)).FfuncFlags&U32(SQLITE_FUNC_SUBTYPE) != 0 {
 152412 				selectWindowRewriteEList(tls, pParse, pMWin, pSrc, pArgs, pTab, bp+48)
 152413 				(*Window)(unsafe.Pointer(pWin)).FiArgCol = func() int32 {
 152414 					if *(*uintptr)(unsafe.Pointer(bp + 48)) != 0 {
 152415 						return (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48)))).FnExpr
 152416 					}
 152417 					return 0
 152418 				}()
 152419 				(*Window)(unsafe.Pointer(pWin)).FbExprArgs = U8(1)
 152420 			} else {
 152421 				(*Window)(unsafe.Pointer(pWin)).FiArgCol = func() int32 {
 152422 					if *(*uintptr)(unsafe.Pointer(bp + 48)) != 0 {
 152423 						return (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48)))).FnExpr
 152424 					}
 152425 					return 0
 152426 				}()
 152427 				*(*uintptr)(unsafe.Pointer(bp + 48)) = exprListAppendList(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 48)), pArgs, 0)
 152428 			}
 152429 			if (*Window)(unsafe.Pointer(pWin)).FpFilter != 0 {
 152430 				var pFilter uintptr = Xsqlite3ExprDup(tls, db, (*Window)(unsafe.Pointer(pWin)).FpFilter, 0)
 152431 				*(*uintptr)(unsafe.Pointer(bp + 48)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 48)), pFilter)
 152432 			}
 152433 			(*Window)(unsafe.Pointer(pWin)).FregAccum = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 152434 			(*Window)(unsafe.Pointer(pWin)).FregResult = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 152435 			Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, (*Window)(unsafe.Pointer(pWin)).FregAccum)
 152436 		}
 152437 
 152438 		if *(*uintptr)(unsafe.Pointer(bp + 48)) == uintptr(0) {
 152439 			*(*uintptr)(unsafe.Pointer(bp + 48)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0),
 152440 				Xsqlite3Expr(tls, db, TK_INTEGER, ts+8871))
 152441 		}
 152442 
 152443 		pSub = Xsqlite3SelectNew(tls,
 152444 			pParse, *(*uintptr)(unsafe.Pointer(bp + 48)), pSrc, pWhere, pGroupBy, pHaving, pSort, uint32(0), uintptr(0))
 152445 
 152446 		(*Select)(unsafe.Pointer(p)).FpSrc = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0))
 152447 
 152448 		if (*Select)(unsafe.Pointer(p)).FpSrc != 0 {
 152449 			var pTab2 uintptr
 152450 			(*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc + 8)).FpSelect = pSub
 152451 			libc.SetBitFieldPtr16Uint32((*Select)(unsafe.Pointer(p)).FpSrc+8+60+4, uint32(1), 3, 0x8)
 152452 			Xsqlite3SrcListAssignCursors(tls, pParse, (*Select)(unsafe.Pointer(p)).FpSrc)
 152453 			*(*U32)(unsafe.Pointer(pSub + 4)) |= U32(SF_Expanded | SF_OrderByReqd)
 152454 			pTab2 = Xsqlite3ResultSetOfSelect(tls, pParse, pSub, int8(SQLITE_AFF_NONE))
 152455 			*(*U32)(unsafe.Pointer(pSub + 4)) |= selFlags & U32(SF_Aggregate)
 152456 			if pTab2 == uintptr(0) {
 152457 				rc = SQLITE_NOMEM
 152458 			} else {
 152459 				libc.Xmemcpy(tls, pTab, pTab2, uint64(unsafe.Sizeof(Table{})))
 152460 				*(*U32)(unsafe.Pointer(pTab + 48)) |= U32(TF_Ephemeral)
 152461 				(*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc + 8)).FpTab = pTab
 152462 				pTab = pTab2
 152463 				libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Walker{})))
 152464 				(*Walker)(unsafe.Pointer(bp)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
 152465 					f func(*libc.TLS, uintptr, uintptr) int32
 152466 				}{sqlite3WindowExtraAggFuncDepth}))
 152467 				(*Walker)(unsafe.Pointer(bp)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
 152468 					f func(*libc.TLS, uintptr, uintptr) int32
 152469 				}{Xsqlite3WalkerDepthIncrease}))
 152470 				(*Walker)(unsafe.Pointer(bp)).FxSelectCallback2 = *(*uintptr)(unsafe.Pointer(&struct {
 152471 					f func(*libc.TLS, uintptr, uintptr)
 152472 				}{Xsqlite3WalkerDepthDecrease}))
 152473 				Xsqlite3WalkSelect(tls, bp, pSub)
 152474 			}
 152475 		} else {
 152476 			Xsqlite3SelectDelete(tls, db, pSub)
 152477 		}
 152478 		if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 152479 			rc = SQLITE_NOMEM
 152480 		}
 152481 
 152482 		Xsqlite3ParserAddCleanup(tls, pParse, *(*uintptr)(unsafe.Pointer(&struct {
 152483 			f func(*libc.TLS, uintptr, uintptr)
 152484 		}{Xsqlite3DbFree})), pTab)
 152485 	}
 152486 
 152487 	return rc
 152488 }
 152489 
 152490 // Unlink the Window object from the Select to which it is attached,
 152491 // if it is attached.
 152492 func Xsqlite3WindowUnlinkFromSelect(tls *libc.TLS, p uintptr) {
 152493 	if (*Window)(unsafe.Pointer(p)).FppThis != 0 {
 152494 		*(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(p)).FppThis)) = (*Window)(unsafe.Pointer(p)).FpNextWin
 152495 		if (*Window)(unsafe.Pointer(p)).FpNextWin != 0 {
 152496 			(*Window)(unsafe.Pointer((*Window)(unsafe.Pointer(p)).FpNextWin)).FppThis = (*Window)(unsafe.Pointer(p)).FppThis
 152497 		}
 152498 		(*Window)(unsafe.Pointer(p)).FppThis = uintptr(0)
 152499 	}
 152500 }
 152501 
 152502 // Free the Window object passed as the second argument.
 152503 func Xsqlite3WindowDelete(tls *libc.TLS, db uintptr, p uintptr) {
 152504 	if p != 0 {
 152505 		Xsqlite3WindowUnlinkFromSelect(tls, p)
 152506 		Xsqlite3ExprDelete(tls, db, (*Window)(unsafe.Pointer(p)).FpFilter)
 152507 		Xsqlite3ExprListDelete(tls, db, (*Window)(unsafe.Pointer(p)).FpPartition)
 152508 		Xsqlite3ExprListDelete(tls, db, (*Window)(unsafe.Pointer(p)).FpOrderBy)
 152509 		Xsqlite3ExprDelete(tls, db, (*Window)(unsafe.Pointer(p)).FpEnd)
 152510 		Xsqlite3ExprDelete(tls, db, (*Window)(unsafe.Pointer(p)).FpStart)
 152511 		Xsqlite3DbFree(tls, db, (*Window)(unsafe.Pointer(p)).FzName)
 152512 		Xsqlite3DbFree(tls, db, (*Window)(unsafe.Pointer(p)).FzBase)
 152513 		Xsqlite3DbFree(tls, db, p)
 152514 	}
 152515 }
 152516 
 152517 // Free the linked list of Window objects starting at the second argument.
 152518 func Xsqlite3WindowListDelete(tls *libc.TLS, db uintptr, p uintptr) {
 152519 	for p != 0 {
 152520 		var pNext uintptr = (*Window)(unsafe.Pointer(p)).FpNextWin
 152521 		Xsqlite3WindowDelete(tls, db, p)
 152522 		p = pNext
 152523 	}
 152524 }
 152525 
 152526 func sqlite3WindowOffsetExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr {
 152527 	if 0 == Xsqlite3ExprIsConstant(tls, pExpr) {
 152528 		if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
 152529 			Xsqlite3RenameExprUnmap(tls, pParse, pExpr)
 152530 		}
 152531 		Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr)
 152532 		pExpr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_NULL, uintptr(0), 0)
 152533 	}
 152534 	return pExpr
 152535 }
 152536 
 152537 // Allocate and return a new Window object describing a Window Definition.
 152538 func Xsqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int32, pStart uintptr, eEnd int32, pEnd uintptr, eExclude U8) uintptr {
 152539 	var pWin uintptr
 152540 	var bImplicitFrame int32
 152541 	pWin = uintptr(0)
 152542 	bImplicitFrame = 0
 152543 
 152544 	if !(eType == 0) {
 152545 		goto __1
 152546 	}
 152547 	bImplicitFrame = 1
 152548 	eType = TK_RANGE
 152549 __1:
 152550 	;
 152551 	if !(eStart == TK_CURRENT && eEnd == TK_PRECEDING ||
 152552 		eStart == TK_FOLLOWING && (eEnd == TK_PRECEDING || eEnd == TK_CURRENT)) {
 152553 		goto __2
 152554 	}
 152555 	Xsqlite3ErrorMsg(tls, pParse, ts+23862, 0)
 152556 	goto windowAllocErr
 152557 __2:
 152558 	;
 152559 	pWin = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Window{})))
 152560 	if !(pWin == uintptr(0)) {
 152561 		goto __3
 152562 	}
 152563 	goto windowAllocErr
 152564 __3:
 152565 	;
 152566 	(*Window)(unsafe.Pointer(pWin)).FeFrmType = U8(eType)
 152567 	(*Window)(unsafe.Pointer(pWin)).FeStart = U8(eStart)
 152568 	(*Window)(unsafe.Pointer(pWin)).FeEnd = U8(eEnd)
 152569 	if !(int32(eExclude) == 0 && (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&U32(SQLITE_WindowFunc) != U32(0)) {
 152570 		goto __4
 152571 	}
 152572 	eExclude = U8(TK_NO)
 152573 __4:
 152574 	;
 152575 	(*Window)(unsafe.Pointer(pWin)).FeExclude = eExclude
 152576 	(*Window)(unsafe.Pointer(pWin)).FbImplicitFrame = U8(bImplicitFrame)
 152577 	(*Window)(unsafe.Pointer(pWin)).FpEnd = sqlite3WindowOffsetExpr(tls, pParse, pEnd)
 152578 	(*Window)(unsafe.Pointer(pWin)).FpStart = sqlite3WindowOffsetExpr(tls, pParse, pStart)
 152579 	return pWin
 152580 
 152581 windowAllocErr:
 152582 	Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pEnd)
 152583 	Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pStart)
 152584 	return uintptr(0)
 152585 }
 152586 
 152587 // Attach PARTITION and ORDER BY clauses pPartition and pOrderBy to window
 152588 // pWin. Also, if parameter pBase is not NULL, set pWin->zBase to the
 152589 // equivalent nul-terminated string.
 152590 func Xsqlite3WindowAssemble(tls *libc.TLS, pParse uintptr, pWin uintptr, pPartition uintptr, pOrderBy uintptr, pBase uintptr) uintptr {
 152591 	if pWin != 0 {
 152592 		(*Window)(unsafe.Pointer(pWin)).FpPartition = pPartition
 152593 		(*Window)(unsafe.Pointer(pWin)).FpOrderBy = pOrderBy
 152594 		if pBase != 0 {
 152595 			(*Window)(unsafe.Pointer(pWin)).FzBase = Xsqlite3DbStrNDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Token)(unsafe.Pointer(pBase)).Fz, uint64((*Token)(unsafe.Pointer(pBase)).Fn))
 152596 		}
 152597 	} else {
 152598 		Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pPartition)
 152599 		Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pOrderBy)
 152600 	}
 152601 	return pWin
 152602 }
 152603 
 152604 // Window *pWin has just been created from a WINDOW clause. Tokne pBase
 152605 // is the base window. Earlier windows from the same WINDOW clause are
 152606 // stored in the linked list starting at pWin->pNextWin. This function
 152607 // either updates *pWin according to the base specification, or else
 152608 // leaves an error in pParse.
 152609 func Xsqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uintptr) {
 152610 	bp := tls.Alloc(16)
 152611 	defer tls.Free(16)
 152612 
 152613 	if (*Window)(unsafe.Pointer(pWin)).FzBase != 0 {
 152614 		var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 152615 		var pExist uintptr = windowFind(tls, pParse, pList, (*Window)(unsafe.Pointer(pWin)).FzBase)
 152616 		if pExist != 0 {
 152617 			var zErr uintptr = uintptr(0)
 152618 
 152619 			if (*Window)(unsafe.Pointer(pWin)).FpPartition != 0 {
 152620 				zErr = ts + 23894
 152621 			} else if (*Window)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*Window)(unsafe.Pointer(pWin)).FpOrderBy != 0 {
 152622 				zErr = ts + 23911
 152623 			} else if int32((*Window)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 {
 152624 				zErr = ts + 23927
 152625 			}
 152626 			if zErr != 0 {
 152627 				Xsqlite3ErrorMsg(tls, pParse,
 152628 					ts+23947, libc.VaList(bp, zErr, (*Window)(unsafe.Pointer(pWin)).FzBase))
 152629 			} else {
 152630 				(*Window)(unsafe.Pointer(pWin)).FpPartition = Xsqlite3ExprListDup(tls, db, (*Window)(unsafe.Pointer(pExist)).FpPartition, 0)
 152631 				if (*Window)(unsafe.Pointer(pExist)).FpOrderBy != 0 {
 152632 					(*Window)(unsafe.Pointer(pWin)).FpOrderBy = Xsqlite3ExprListDup(tls, db, (*Window)(unsafe.Pointer(pExist)).FpOrderBy, 0)
 152633 				}
 152634 				Xsqlite3DbFree(tls, db, (*Window)(unsafe.Pointer(pWin)).FzBase)
 152635 				(*Window)(unsafe.Pointer(pWin)).FzBase = uintptr(0)
 152636 			}
 152637 		}
 152638 	}
 152639 }
 152640 
 152641 // Attach window object pWin to expression p.
 152642 func Xsqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr) {
 152643 	if p != 0 {
 152644 		*(*uintptr)(unsafe.Pointer(p + 64)) = pWin
 152645 		*(*U32)(unsafe.Pointer(p + 4)) |= U32(EP_WinFunc)
 152646 		(*Window)(unsafe.Pointer(pWin)).FpOwner = p
 152647 		if (*Expr)(unsafe.Pointer(p)).Fflags&U32(EP_Distinct) != 0 && int32((*Window)(unsafe.Pointer(pWin)).FeFrmType) != TK_FILTER {
 152648 			Xsqlite3ErrorMsg(tls, pParse,
 152649 				ts+23980, 0)
 152650 		}
 152651 	} else {
 152652 		Xsqlite3WindowDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pWin)
 152653 	}
 152654 }
 152655 
 152656 // Possibly link window pWin into the list at pSel->pWin (window functions
 152657 // to be processed as part of SELECT statement pSel). The window is linked
 152658 // in if either (a) there are no other windows already linked to this
 152659 // SELECT, or (b) the windows already linked use a compatible window frame.
 152660 func Xsqlite3WindowLink(tls *libc.TLS, pSel uintptr, pWin uintptr) {
 152661 	if pSel != 0 {
 152662 		if uintptr(0) == (*Select)(unsafe.Pointer(pSel)).FpWin || 0 == Xsqlite3WindowCompare(tls, uintptr(0), (*Select)(unsafe.Pointer(pSel)).FpWin, pWin, 0) {
 152663 			(*Window)(unsafe.Pointer(pWin)).FpNextWin = (*Select)(unsafe.Pointer(pSel)).FpWin
 152664 			if (*Select)(unsafe.Pointer(pSel)).FpWin != 0 {
 152665 				(*Window)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpWin)).FppThis = pWin + 64
 152666 			}
 152667 			(*Select)(unsafe.Pointer(pSel)).FpWin = pWin
 152668 			(*Window)(unsafe.Pointer(pWin)).FppThis = pSel + 112
 152669 		} else {
 152670 			if Xsqlite3ExprListCompare(tls, (*Window)(unsafe.Pointer(pWin)).FpPartition, (*Window)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpWin)).FpPartition, -1) != 0 {
 152671 				*(*U32)(unsafe.Pointer(pSel + 4)) |= U32(SF_MultiPart)
 152672 			}
 152673 		}
 152674 	}
 152675 }
 152676 
 152677 // Return 0 if the two window objects are identical, 1 if they are
 152678 // different, or 2 if it cannot be determined if the objects are identical
 152679 // or not. Identical window objects can be processed in a single scan.
 152680 func Xsqlite3WindowCompare(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uintptr, bFilter int32) int32 {
 152681 	var res int32
 152682 	if p1 == uintptr(0) || p2 == uintptr(0) {
 152683 		return 1
 152684 	}
 152685 	if int32((*Window)(unsafe.Pointer(p1)).FeFrmType) != int32((*Window)(unsafe.Pointer(p2)).FeFrmType) {
 152686 		return 1
 152687 	}
 152688 	if int32((*Window)(unsafe.Pointer(p1)).FeStart) != int32((*Window)(unsafe.Pointer(p2)).FeStart) {
 152689 		return 1
 152690 	}
 152691 	if int32((*Window)(unsafe.Pointer(p1)).FeEnd) != int32((*Window)(unsafe.Pointer(p2)).FeEnd) {
 152692 		return 1
 152693 	}
 152694 	if int32((*Window)(unsafe.Pointer(p1)).FeExclude) != int32((*Window)(unsafe.Pointer(p2)).FeExclude) {
 152695 		return 1
 152696 	}
 152697 	if Xsqlite3ExprCompare(tls, pParse, (*Window)(unsafe.Pointer(p1)).FpStart, (*Window)(unsafe.Pointer(p2)).FpStart, -1) != 0 {
 152698 		return 1
 152699 	}
 152700 	if Xsqlite3ExprCompare(tls, pParse, (*Window)(unsafe.Pointer(p1)).FpEnd, (*Window)(unsafe.Pointer(p2)).FpEnd, -1) != 0 {
 152701 		return 1
 152702 	}
 152703 	if libc.AssignInt32(&res, Xsqlite3ExprListCompare(tls, (*Window)(unsafe.Pointer(p1)).FpPartition, (*Window)(unsafe.Pointer(p2)).FpPartition, -1)) != 0 {
 152704 		return res
 152705 	}
 152706 	if libc.AssignInt32(&res, Xsqlite3ExprListCompare(tls, (*Window)(unsafe.Pointer(p1)).FpOrderBy, (*Window)(unsafe.Pointer(p2)).FpOrderBy, -1)) != 0 {
 152707 		return res
 152708 	}
 152709 	if bFilter != 0 {
 152710 		if libc.AssignInt32(&res, Xsqlite3ExprCompare(tls, pParse, (*Window)(unsafe.Pointer(p1)).FpFilter, (*Window)(unsafe.Pointer(p2)).FpFilter, -1)) != 0 {
 152711 			return res
 152712 		}
 152713 	}
 152714 	return 0
 152715 }
 152716 
 152717 // This is called by code in select.c before it calls sqlite3WhereBegin()
 152718 // to begin iterating through the sub-query results. It is used to allocate
 152719 // and initialize registers and cursors used by sqlite3WindowCodeStep().
 152720 func Xsqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) {
 152721 	var nEphExpr int32 = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpSrc + 8)).FpSelect)).FpEList)).FnExpr
 152722 	var pMWin uintptr = (*Select)(unsafe.Pointer(pSelect)).FpWin
 152723 	var pWin uintptr
 152724 	var v uintptr = Xsqlite3GetVdbe(tls, pParse)
 152725 
 152726 	Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr, nEphExpr)
 152727 	Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr+1, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr)
 152728 	Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr+2, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr)
 152729 	Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr+3, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr)
 152730 
 152731 	if (*Window)(unsafe.Pointer(pMWin)).FpPartition != 0 {
 152732 		var nExpr int32 = (*ExprList)(unsafe.Pointer((*Window)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr
 152733 		(*Window)(unsafe.Pointer(pMWin)).FregPart = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 152734 		*(*int32)(unsafe.Pointer(pParse + 56)) += nExpr
 152735 		Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, (*Window)(unsafe.Pointer(pMWin)).FregPart, (*Window)(unsafe.Pointer(pMWin)).FregPart+nExpr-1)
 152736 	}
 152737 
 152738 	(*Window)(unsafe.Pointer(pMWin)).FregOne = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 152739 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, (*Window)(unsafe.Pointer(pMWin)).FregOne)
 152740 
 152741 	if (*Window)(unsafe.Pointer(pMWin)).FeExclude != 0 {
 152742 		(*Window)(unsafe.Pointer(pMWin)).FregStartRowid = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 152743 		(*Window)(unsafe.Pointer(pMWin)).FregEndRowid = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 152744 		(*Window)(unsafe.Pointer(pMWin)).FcsrApp = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 152745 		Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, (*Window)(unsafe.Pointer(pMWin)).FregStartRowid)
 152746 		Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*Window)(unsafe.Pointer(pMWin)).FregEndRowid)
 152747 		Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, (*Window)(unsafe.Pointer(pMWin)).FcsrApp, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr)
 152748 		return
 152749 	}
 152750 
 152751 	for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin {
 152752 		var p uintptr = (*Window)(unsafe.Pointer(pWin)).FpWFunc
 152753 		if (*FuncDef)(unsafe.Pointer(p)).FfuncFlags&U32(SQLITE_FUNC_MINMAX) != 0 && int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED {
 152754 			var pList uintptr
 152755 			var pKeyInfo uintptr
 152756 
 152757 			pList = *(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 32))
 152758 			pKeyInfo = Xsqlite3KeyInfoFromExprList(tls, pParse, pList, 0, 0)
 152759 			(*Window)(unsafe.Pointer(pWin)).FcsrApp = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 152760 			(*Window)(unsafe.Pointer(pWin)).FregApp = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 152761 			*(*int32)(unsafe.Pointer(pParse + 56)) += 3
 152762 			if pKeyInfo != 0 && int32(*(*int8)(unsafe.Pointer((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpWFunc)).FzName + 1))) == 'i' {
 152763 				*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = U8(KEYINFO_ORDER_DESC)
 152764 			}
 152765 			Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*Window)(unsafe.Pointer(pWin)).FcsrApp, 2)
 152766 			Xsqlite3VdbeAppendP4(tls, v, pKeyInfo, -8)
 152767 			Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*Window)(unsafe.Pointer(pWin)).FregApp+1)
 152768 		} else if (*FuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&nth_valueName)) || (*FuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&first_valueName)) {
 152769 			(*Window)(unsafe.Pointer(pWin)).FregApp = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 152770 			(*Window)(unsafe.Pointer(pWin)).FcsrApp = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 152771 			*(*int32)(unsafe.Pointer(pParse + 56)) += 2
 152772 			Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, (*Window)(unsafe.Pointer(pWin)).FcsrApp, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr)
 152773 		} else if (*FuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&leadName)) || (*FuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&lagName)) {
 152774 			(*Window)(unsafe.Pointer(pWin)).FcsrApp = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
 152775 			Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, (*Window)(unsafe.Pointer(pWin)).FcsrApp, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr)
 152776 		}
 152777 	}
 152778 }
 152779 
 152780 func windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) {
 152781 	var v uintptr = Xsqlite3GetVdbe(tls, pParse)
 152782 	var regZero int32 = Xsqlite3GetTempReg(tls, pParse)
 152783 
 152784 	Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regZero)
 152785 	if eCond >= WINDOW_STARTING_NUM {
 152786 		var regString int32 = Xsqlite3GetTempReg(tls, pParse)
 152787 		Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, regString, 0, ts+1544, -1)
 152788 		Xsqlite3VdbeAddOp3(tls, v, OP_Ge, regString, Xsqlite3VdbeCurrentAddr(tls, v)+2, reg)
 152789 		Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_AFF_NUMERIC|SQLITE_JUMPIFNULL))
 152790 
 152791 	} else {
 152792 		Xsqlite3VdbeAddOp2(tls, v, OP_MustBeInt, reg, Xsqlite3VdbeCurrentAddr(tls, v)+2)
 152793 
 152794 	}
 152795 	Xsqlite3VdbeAddOp3(tls, v, aOp1[eCond], regZero, Xsqlite3VdbeCurrentAddr(tls, v)+2, reg)
 152796 	Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_AFF_NUMERIC))
 152797 
 152798 	Xsqlite3MayAbort(tls, pParse)
 152799 	Xsqlite3VdbeAddOp2(tls, v, OP_Halt, SQLITE_ERROR, OE_Abort)
 152800 	Xsqlite3VdbeAppendP4(tls, v, azErr[eCond], -1)
 152801 	Xsqlite3ReleaseTempReg(tls, pParse, regZero)
 152802 }
 152803 
 152804 var azErr = [5]uintptr{
 152805 	ts + 24027,
 152806 	ts + 24080,
 152807 	ts + 23484,
 152808 	ts + 24131,
 152809 	ts + 24183,
 152810 }
 152811 var aOp1 = [5]int32{OP_Ge, OP_Ge, OP_Gt, OP_Ge, OP_Ge}
 152812 
 152813 func windowArgCount(tls *libc.TLS, pWin uintptr) int32 {
 152814 	var pList uintptr
 152815 
 152816 	pList = *(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 32))
 152817 	return func() int32 {
 152818 		if pList != 0 {
 152819 			return (*ExprList)(unsafe.Pointer(pList)).FnExpr
 152820 		}
 152821 		return 0
 152822 	}()
 152823 }
 152824 
 152825 type WindowCodeArg1 = struct {
 152826 	FpParse      uintptr
 152827 	FpMWin       uintptr
 152828 	FpVdbe       uintptr
 152829 	FaddrGosub   int32
 152830 	FregGosub    int32
 152831 	FregArg      int32
 152832 	FeDelete     int32
 152833 	FregRowid    int32
 152834 	Fstart       WindowCsrAndReg
 152835 	Fcurrent     WindowCsrAndReg
 152836 	Fend         WindowCsrAndReg
 152837 	F__ccgo_pad1 [4]byte
 152838 }
 152839 
 152840 type WindowCodeArg = WindowCodeArg1
 152841 type WindowCsrAndReg1 = struct {
 152842 	Fcsr int32
 152843 	Freg int32
 152844 }
 152845 
 152846 type WindowCsrAndReg = WindowCsrAndReg1
 152847 
 152848 func windowReadPeerValues(tls *libc.TLS, p uintptr, csr int32, reg int32) {
 152849 	var pMWin uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpMWin
 152850 	var pOrderBy uintptr = (*Window)(unsafe.Pointer(pMWin)).FpOrderBy
 152851 	if pOrderBy != 0 {
 152852 		var v uintptr = Xsqlite3GetVdbe(tls, (*WindowCodeArg)(unsafe.Pointer(p)).FpParse)
 152853 		var pPart uintptr = (*Window)(unsafe.Pointer(pMWin)).FpPartition
 152854 		var iColOff int32 = (*Window)(unsafe.Pointer(pMWin)).FnBufferCol + func() int32 {
 152855 			if pPart != 0 {
 152856 				return (*ExprList)(unsafe.Pointer(pPart)).FnExpr
 152857 			}
 152858 			return 0
 152859 		}()
 152860 		var i int32
 152861 		for i = 0; i < (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr; i++ {
 152862 			Xsqlite3VdbeAddOp3(tls, v, OP_Column, csr, iColOff+i, reg+i)
 152863 		}
 152864 	}
 152865 }
 152866 
 152867 func windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse int32, reg int32) {
 152868 	var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse
 152869 	var v uintptr = Xsqlite3GetVdbe(tls, pParse)
 152870 	var pWin uintptr
 152871 	for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin {
 152872 		var pFunc uintptr = (*Window)(unsafe.Pointer(pWin)).FpWFunc
 152873 		var regArg int32
 152874 		var nArg int32
 152875 		if (*Window)(unsafe.Pointer(pWin)).FbExprArgs != 0 {
 152876 			nArg = 0
 152877 		} else {
 152878 			nArg = windowArgCount(tls, pWin)
 152879 		}
 152880 		var i int32
 152881 
 152882 		for i = 0; i < nArg; i++ {
 152883 			if i != 1 || (*FuncDef)(unsafe.Pointer(pFunc)).FzName != uintptr(unsafe.Pointer(&nth_valueName)) {
 152884 				Xsqlite3VdbeAddOp3(tls, v, OP_Column, csr, (*Window)(unsafe.Pointer(pWin)).FiArgCol+i, reg+i)
 152885 			} else {
 152886 				Xsqlite3VdbeAddOp3(tls, v, OP_Column, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr, (*Window)(unsafe.Pointer(pWin)).FiArgCol+i, reg+i)
 152887 			}
 152888 		}
 152889 		regArg = reg
 152890 
 152891 		if (*Window)(unsafe.Pointer(pMWin)).FregStartRowid == 0 &&
 152892 			(*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&U32(SQLITE_FUNC_MINMAX) != 0 &&
 152893 			int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED {
 152894 			var addrIsNull int32 = Xsqlite3VdbeAddOp1(tls, v, OP_IsNull, regArg)
 152895 
 152896 			if bInverse == 0 {
 152897 				Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, (*Window)(unsafe.Pointer(pWin)).FregApp+1, 1)
 152898 				Xsqlite3VdbeAddOp2(tls, v, OP_SCopy, regArg, (*Window)(unsafe.Pointer(pWin)).FregApp)
 152899 				Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, (*Window)(unsafe.Pointer(pWin)).FregApp, 2, (*Window)(unsafe.Pointer(pWin)).FregApp+2)
 152900 				Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, (*Window)(unsafe.Pointer(pWin)).FcsrApp, (*Window)(unsafe.Pointer(pWin)).FregApp+2)
 152901 			} else {
 152902 				Xsqlite3VdbeAddOp4Int(tls, v, OP_SeekGE, (*Window)(unsafe.Pointer(pWin)).FcsrApp, 0, regArg, 1)
 152903 
 152904 				Xsqlite3VdbeAddOp1(tls, v, OP_Delete, (*Window)(unsafe.Pointer(pWin)).FcsrApp)
 152905 				Xsqlite3VdbeJumpHere(tls, v, Xsqlite3VdbeCurrentAddr(tls, v)-2)
 152906 			}
 152907 			Xsqlite3VdbeJumpHere(tls, v, addrIsNull)
 152908 		} else if (*Window)(unsafe.Pointer(pWin)).FregApp != 0 {
 152909 			Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, (*Window)(unsafe.Pointer(pWin)).FregApp+1-bInverse, 1)
 152910 		} else if (*FuncDef)(unsafe.Pointer(pFunc)).FxSFunc != *(*uintptr)(unsafe.Pointer(&struct {
 152911 			f func(*libc.TLS, uintptr, int32, uintptr)
 152912 		}{noopStepFunc})) {
 152913 			var addrIf int32 = 0
 152914 			if (*Window)(unsafe.Pointer(pWin)).FpFilter != 0 {
 152915 				var regTmp int32
 152916 
 152917 				regTmp = Xsqlite3GetTempReg(tls, pParse)
 152918 				Xsqlite3VdbeAddOp3(tls, v, OP_Column, csr, (*Window)(unsafe.Pointer(pWin)).FiArgCol+nArg, regTmp)
 152919 				addrIf = Xsqlite3VdbeAddOp3(tls, v, OP_IfNot, regTmp, 0, 1)
 152920 
 152921 				Xsqlite3ReleaseTempReg(tls, pParse, regTmp)
 152922 			}
 152923 
 152924 			if (*Window)(unsafe.Pointer(pWin)).FbExprArgs != 0 {
 152925 				var iOp int32 = Xsqlite3VdbeCurrentAddr(tls, v)
 152926 				var iEnd int32
 152927 
 152928 				nArg = (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 32)))).FnExpr
 152929 				regArg = Xsqlite3GetTempRange(tls, pParse, nArg)
 152930 				Xsqlite3ExprCodeExprList(tls, pParse, *(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 32)), regArg, 0, uint8(0))
 152931 
 152932 				for iEnd = Xsqlite3VdbeCurrentAddr(tls, v); iOp < iEnd; iOp++ {
 152933 					var pOp uintptr = Xsqlite3VdbeGetOp(tls, v, iOp)
 152934 					if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Column && (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 == (*Window)(unsafe.Pointer(pMWin)).FiEphCsr {
 152935 						(*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = csr
 152936 					}
 152937 				}
 152938 			}
 152939 			if (*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&U32(SQLITE_FUNC_NEEDCOLL) != 0 {
 152940 				var pColl uintptr
 152941 
 152942 				pColl = Xsqlite3ExprNNCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 32))+8)).FpExpr)
 152943 				Xsqlite3VdbeAddOp4(tls, v, OP_CollSeq, 0, 0, 0, pColl, -2)
 152944 			}
 152945 			Xsqlite3VdbeAddOp3(tls, v, func() int32 {
 152946 				if bInverse != 0 {
 152947 					return OP_AggInverse
 152948 				}
 152949 				return OP_AggStep
 152950 			}(),
 152951 				bInverse, regArg, (*Window)(unsafe.Pointer(pWin)).FregAccum)
 152952 			Xsqlite3VdbeAppendP4(tls, v, pFunc, -7)
 152953 			Xsqlite3VdbeChangeP5(tls, v, uint16(U8(nArg)))
 152954 			if (*Window)(unsafe.Pointer(pWin)).FbExprArgs != 0 {
 152955 				Xsqlite3ReleaseTempRange(tls, pParse, regArg, nArg)
 152956 			}
 152957 			if addrIf != 0 {
 152958 				Xsqlite3VdbeJumpHere(tls, v, addrIf)
 152959 			}
 152960 		}
 152961 	}
 152962 }
 152963 
 152964 func windowAggFinal(tls *libc.TLS, p uintptr, bFin int32) {
 152965 	var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse
 152966 	var pMWin uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpMWin
 152967 	var v uintptr = Xsqlite3GetVdbe(tls, pParse)
 152968 	var pWin uintptr
 152969 
 152970 	for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin {
 152971 		if (*Window)(unsafe.Pointer(pMWin)).FregStartRowid == 0 &&
 152972 			(*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpWFunc)).FfuncFlags&U32(SQLITE_FUNC_MINMAX) != 0 &&
 152973 			int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED {
 152974 			Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, (*Window)(unsafe.Pointer(pWin)).FregResult)
 152975 			Xsqlite3VdbeAddOp1(tls, v, OP_Last, (*Window)(unsafe.Pointer(pWin)).FcsrApp)
 152976 
 152977 			Xsqlite3VdbeAddOp3(tls, v, OP_Column, (*Window)(unsafe.Pointer(pWin)).FcsrApp, 0, (*Window)(unsafe.Pointer(pWin)).FregResult)
 152978 			Xsqlite3VdbeJumpHere(tls, v, Xsqlite3VdbeCurrentAddr(tls, v)-2)
 152979 		} else if (*Window)(unsafe.Pointer(pWin)).FregApp != 0 {
 152980 		} else {
 152981 			var nArg int32 = windowArgCount(tls, pWin)
 152982 			if bFin != 0 {
 152983 				Xsqlite3VdbeAddOp2(tls, v, OP_AggFinal, (*Window)(unsafe.Pointer(pWin)).FregAccum, nArg)
 152984 				Xsqlite3VdbeAppendP4(tls, v, (*Window)(unsafe.Pointer(pWin)).FpWFunc, -7)
 152985 				Xsqlite3VdbeAddOp2(tls, v, OP_Copy, (*Window)(unsafe.Pointer(pWin)).FregAccum, (*Window)(unsafe.Pointer(pWin)).FregResult)
 152986 				Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, (*Window)(unsafe.Pointer(pWin)).FregAccum)
 152987 			} else {
 152988 				Xsqlite3VdbeAddOp3(tls, v, OP_AggValue, (*Window)(unsafe.Pointer(pWin)).FregAccum, nArg, (*Window)(unsafe.Pointer(pWin)).FregResult)
 152989 				Xsqlite3VdbeAppendP4(tls, v, (*Window)(unsafe.Pointer(pWin)).FpWFunc, -7)
 152990 			}
 152991 		}
 152992 	}
 152993 }
 152994 
 152995 func windowFullScan(tls *libc.TLS, p uintptr) {
 152996 	var pWin uintptr
 152997 	var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse
 152998 	var pMWin uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpMWin
 152999 	var v uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpVdbe
 153000 
 153001 	var regCRowid int32 = 0
 153002 	var regCPeer int32 = 0
 153003 	var regRowid int32 = 0
 153004 	var regPeer int32 = 0
 153005 
 153006 	var nPeer int32
 153007 	var lblNext int32
 153008 	var lblBrk int32
 153009 	var addrNext int32
 153010 	var csr int32
 153011 
 153012 	csr = (*Window)(unsafe.Pointer(pMWin)).FcsrApp
 153013 	nPeer = func() int32 {
 153014 		if (*Window)(unsafe.Pointer(pMWin)).FpOrderBy != 0 {
 153015 			return (*ExprList)(unsafe.Pointer((*Window)(unsafe.Pointer(pMWin)).FpOrderBy)).FnExpr
 153016 		}
 153017 		return 0
 153018 	}()
 153019 
 153020 	lblNext = Xsqlite3VdbeMakeLabel(tls, pParse)
 153021 	lblBrk = Xsqlite3VdbeMakeLabel(tls, pParse)
 153022 
 153023 	regCRowid = Xsqlite3GetTempReg(tls, pParse)
 153024 	regRowid = Xsqlite3GetTempReg(tls, pParse)
 153025 	if nPeer != 0 {
 153026 		regCPeer = Xsqlite3GetTempRange(tls, pParse, nPeer)
 153027 		regPeer = Xsqlite3GetTempRange(tls, pParse, nPeer)
 153028 	}
 153029 
 153030 	Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr, regCRowid)
 153031 	windowReadPeerValues(tls, p, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr, regCPeer)
 153032 
 153033 	for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin {
 153034 		Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, (*Window)(unsafe.Pointer(pWin)).FregAccum)
 153035 	}
 153036 
 153037 	Xsqlite3VdbeAddOp3(tls, v, OP_SeekGE, csr, lblBrk, (*Window)(unsafe.Pointer(pMWin)).FregStartRowid)
 153038 
 153039 	addrNext = Xsqlite3VdbeCurrentAddr(tls, v)
 153040 	Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, csr, regRowid)
 153041 	Xsqlite3VdbeAddOp3(tls, v, OP_Gt, (*Window)(unsafe.Pointer(pMWin)).FregEndRowid, lblBrk, regRowid)
 153042 
 153043 	if int32((*Window)(unsafe.Pointer(pMWin)).FeExclude) == TK_CURRENT {
 153044 		Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regCRowid, lblNext, regRowid)
 153045 
 153046 	} else if int32((*Window)(unsafe.Pointer(pMWin)).FeExclude) != TK_NO {
 153047 		var addr int32
 153048 		var addrEq int32 = 0
 153049 		var pKeyInfo uintptr = uintptr(0)
 153050 
 153051 		if (*Window)(unsafe.Pointer(pMWin)).FpOrderBy != 0 {
 153052 			pKeyInfo = Xsqlite3KeyInfoFromExprList(tls, pParse, (*Window)(unsafe.Pointer(pMWin)).FpOrderBy, 0, 0)
 153053 		}
 153054 		if int32((*Window)(unsafe.Pointer(pMWin)).FeExclude) == TK_TIES {
 153055 			addrEq = Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regCRowid, 0, regRowid)
 153056 
 153057 		}
 153058 		if pKeyInfo != 0 {
 153059 			windowReadPeerValues(tls, p, csr, regPeer)
 153060 			Xsqlite3VdbeAddOp3(tls, v, OP_Compare, regPeer, regCPeer, nPeer)
 153061 			Xsqlite3VdbeAppendP4(tls, v, pKeyInfo, -8)
 153062 			addr = Xsqlite3VdbeCurrentAddr(tls, v) + 1
 153063 			Xsqlite3VdbeAddOp3(tls, v, OP_Jump, addr, lblNext, addr)
 153064 
 153065 		} else {
 153066 			Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, lblNext)
 153067 		}
 153068 		if addrEq != 0 {
 153069 			Xsqlite3VdbeJumpHere(tls, v, addrEq)
 153070 		}
 153071 	}
 153072 
 153073 	windowAggStep(tls, p, pMWin, csr, 0, (*WindowCodeArg)(unsafe.Pointer(p)).FregArg)
 153074 
 153075 	Xsqlite3VdbeResolveLabel(tls, v, lblNext)
 153076 	Xsqlite3VdbeAddOp2(tls, v, OP_Next, csr, addrNext)
 153077 
 153078 	Xsqlite3VdbeJumpHere(tls, v, addrNext-1)
 153079 	Xsqlite3VdbeJumpHere(tls, v, addrNext+1)
 153080 	Xsqlite3ReleaseTempReg(tls, pParse, regRowid)
 153081 	Xsqlite3ReleaseTempReg(tls, pParse, regCRowid)
 153082 	if nPeer != 0 {
 153083 		Xsqlite3ReleaseTempRange(tls, pParse, regPeer, nPeer)
 153084 		Xsqlite3ReleaseTempRange(tls, pParse, regCPeer, nPeer)
 153085 	}
 153086 
 153087 	windowAggFinal(tls, p, 1)
 153088 
 153089 }
 153090 
 153091 func windowReturnOneRow(tls *libc.TLS, p uintptr) {
 153092 	var pMWin uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpMWin
 153093 	var v uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpVdbe
 153094 
 153095 	if (*Window)(unsafe.Pointer(pMWin)).FregStartRowid != 0 {
 153096 		windowFullScan(tls, p)
 153097 	} else {
 153098 		var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse
 153099 		var pWin uintptr
 153100 
 153101 		for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin {
 153102 			var pFunc uintptr = (*Window)(unsafe.Pointer(pWin)).FpWFunc
 153103 
 153104 			if (*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&nth_valueName)) ||
 153105 				(*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&first_valueName)) {
 153106 				var csr int32 = (*Window)(unsafe.Pointer(pWin)).FcsrApp
 153107 				var lbl int32 = Xsqlite3VdbeMakeLabel(tls, pParse)
 153108 				var tmpReg int32 = Xsqlite3GetTempReg(tls, pParse)
 153109 				Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, (*Window)(unsafe.Pointer(pWin)).FregResult)
 153110 
 153111 				if (*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&nth_valueName)) {
 153112 					Xsqlite3VdbeAddOp3(tls, v, OP_Column, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr, (*Window)(unsafe.Pointer(pWin)).FiArgCol+1, tmpReg)
 153113 					windowCheckValue(tls, pParse, tmpReg, 2)
 153114 				} else {
 153115 					Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, tmpReg)
 153116 				}
 153117 				Xsqlite3VdbeAddOp3(tls, v, OP_Add, tmpReg, (*Window)(unsafe.Pointer(pWin)).FregApp, tmpReg)
 153118 				Xsqlite3VdbeAddOp3(tls, v, OP_Gt, (*Window)(unsafe.Pointer(pWin)).FregApp+1, lbl, tmpReg)
 153119 
 153120 				Xsqlite3VdbeAddOp3(tls, v, OP_SeekRowid, csr, 0, tmpReg)
 153121 
 153122 				Xsqlite3VdbeAddOp3(tls, v, OP_Column, csr, (*Window)(unsafe.Pointer(pWin)).FiArgCol, (*Window)(unsafe.Pointer(pWin)).FregResult)
 153123 				Xsqlite3VdbeResolveLabel(tls, v, lbl)
 153124 				Xsqlite3ReleaseTempReg(tls, pParse, tmpReg)
 153125 			} else if (*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&leadName)) || (*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&lagName)) {
 153126 				var nArg int32 = (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 32)))).FnExpr
 153127 				var csr int32 = (*Window)(unsafe.Pointer(pWin)).FcsrApp
 153128 				var lbl int32 = Xsqlite3VdbeMakeLabel(tls, pParse)
 153129 				var tmpReg int32 = Xsqlite3GetTempReg(tls, pParse)
 153130 				var iEph int32 = (*Window)(unsafe.Pointer(pMWin)).FiEphCsr
 153131 
 153132 				if nArg < 3 {
 153133 					Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, (*Window)(unsafe.Pointer(pWin)).FregResult)
 153134 				} else {
 153135 					Xsqlite3VdbeAddOp3(tls, v, OP_Column, iEph, (*Window)(unsafe.Pointer(pWin)).FiArgCol+2, (*Window)(unsafe.Pointer(pWin)).FregResult)
 153136 				}
 153137 				Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iEph, tmpReg)
 153138 				if nArg < 2 {
 153139 					var val int32 = func() int32 {
 153140 						if (*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&leadName)) {
 153141 							return 1
 153142 						}
 153143 						return -1
 153144 					}()
 153145 					Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, tmpReg, val)
 153146 				} else {
 153147 					var op int32 = func() int32 {
 153148 						if (*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&leadName)) {
 153149 							return OP_Add
 153150 						}
 153151 						return OP_Subtract
 153152 					}()
 153153 					var tmpReg2 int32 = Xsqlite3GetTempReg(tls, pParse)
 153154 					Xsqlite3VdbeAddOp3(tls, v, OP_Column, iEph, (*Window)(unsafe.Pointer(pWin)).FiArgCol+1, tmpReg2)
 153155 					Xsqlite3VdbeAddOp3(tls, v, op, tmpReg2, tmpReg, tmpReg)
 153156 					Xsqlite3ReleaseTempReg(tls, pParse, tmpReg2)
 153157 				}
 153158 
 153159 				Xsqlite3VdbeAddOp3(tls, v, OP_SeekRowid, csr, lbl, tmpReg)
 153160 
 153161 				Xsqlite3VdbeAddOp3(tls, v, OP_Column, csr, (*Window)(unsafe.Pointer(pWin)).FiArgCol, (*Window)(unsafe.Pointer(pWin)).FregResult)
 153162 				Xsqlite3VdbeResolveLabel(tls, v, lbl)
 153163 				Xsqlite3ReleaseTempReg(tls, pParse, tmpReg)
 153164 			}
 153165 		}
 153166 	}
 153167 	Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, (*WindowCodeArg)(unsafe.Pointer(p)).FregGosub, (*WindowCodeArg)(unsafe.Pointer(p)).FaddrGosub)
 153168 }
 153169 
 153170 func windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) int32 {
 153171 	var v uintptr = Xsqlite3GetVdbe(tls, pParse)
 153172 	var regArg int32
 153173 	var nArg int32 = 0
 153174 	var pWin uintptr
 153175 	for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin {
 153176 		var pFunc uintptr = (*Window)(unsafe.Pointer(pWin)).FpWFunc
 153177 
 153178 		Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, (*Window)(unsafe.Pointer(pWin)).FregAccum)
 153179 		nArg = func() int32 {
 153180 			if nArg > windowArgCount(tls, pWin) {
 153181 				return nArg
 153182 			}
 153183 			return windowArgCount(tls, pWin)
 153184 		}()
 153185 		if (*Window)(unsafe.Pointer(pMWin)).FregStartRowid == 0 {
 153186 			if (*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&nth_valueName)) || (*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&first_valueName)) {
 153187 				Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*Window)(unsafe.Pointer(pWin)).FregApp)
 153188 				Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*Window)(unsafe.Pointer(pWin)).FregApp+1)
 153189 			}
 153190 
 153191 			if (*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&U32(SQLITE_FUNC_MINMAX) != 0 && (*Window)(unsafe.Pointer(pWin)).FcsrApp != 0 {
 153192 				Xsqlite3VdbeAddOp1(tls, v, OP_ResetSorter, (*Window)(unsafe.Pointer(pWin)).FcsrApp)
 153193 				Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*Window)(unsafe.Pointer(pWin)).FregApp+1)
 153194 			}
 153195 		}
 153196 	}
 153197 	regArg = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 153198 	*(*int32)(unsafe.Pointer(pParse + 56)) += nArg
 153199 	return regArg
 153200 }
 153201 
 153202 func windowCacheFrame(tls *libc.TLS, pMWin uintptr) int32 {
 153203 	var pWin uintptr
 153204 	if (*Window)(unsafe.Pointer(pMWin)).FregStartRowid != 0 {
 153205 		return 1
 153206 	}
 153207 	for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin {
 153208 		var pFunc uintptr = (*Window)(unsafe.Pointer(pWin)).FpWFunc
 153209 		if (*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&nth_valueName)) ||
 153210 			(*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&first_valueName)) ||
 153211 			(*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&leadName)) ||
 153212 			(*FuncDef)(unsafe.Pointer(pFunc)).FzName == uintptr(unsafe.Pointer(&lagName)) {
 153213 			return 1
 153214 		}
 153215 	}
 153216 	return 0
 153217 }
 153218 
 153219 func windowIfNewPeer(tls *libc.TLS, pParse uintptr, pOrderBy uintptr, regNew int32, regOld int32, addr int32) {
 153220 	var v uintptr = Xsqlite3GetVdbe(tls, pParse)
 153221 	if pOrderBy != 0 {
 153222 		var nVal int32 = (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr
 153223 		var pKeyInfo uintptr = Xsqlite3KeyInfoFromExprList(tls, pParse, pOrderBy, 0, 0)
 153224 		Xsqlite3VdbeAddOp3(tls, v, OP_Compare, regOld, regNew, nVal)
 153225 		Xsqlite3VdbeAppendP4(tls, v, pKeyInfo, -8)
 153226 		Xsqlite3VdbeAddOp3(tls, v, OP_Jump,
 153227 			Xsqlite3VdbeCurrentAddr(tls, v)+1, addr, Xsqlite3VdbeCurrentAddr(tls, v)+1)
 153228 
 153229 		Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regNew, regOld, nVal-1)
 153230 	} else {
 153231 		Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, addr)
 153232 	}
 153233 }
 153234 
 153235 func windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal int32, csr2 int32, lbl int32) {
 153236 	var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse
 153237 	var v uintptr = Xsqlite3GetVdbe(tls, pParse)
 153238 	var pOrderBy uintptr = (*Window)(unsafe.Pointer((*WindowCodeArg)(unsafe.Pointer(p)).FpMWin)).FpOrderBy
 153239 	var reg1 int32 = Xsqlite3GetTempReg(tls, pParse)
 153240 	var reg2 int32 = Xsqlite3GetTempReg(tls, pParse)
 153241 	var regString int32 = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 153242 	var arith int32 = OP_Add
 153243 	var addrGe int32
 153244 	var addrDone int32 = Xsqlite3VdbeMakeLabel(tls, pParse)
 153245 	var pColl uintptr
 153246 
 153247 	windowReadPeerValues(tls, p, csr1, reg1)
 153248 	windowReadPeerValues(tls, p, csr2, reg2)
 153249 
 153250 	if int32((*ExprList_item)(unsafe.Pointer(pOrderBy+8)).Ffg.FsortFlags)&KEYINFO_ORDER_DESC != 0 {
 153251 		switch op {
 153252 		case OP_Ge:
 153253 			op = OP_Le
 153254 			break
 153255 			fallthrough
 153256 		case OP_Gt:
 153257 			op = OP_Lt
 153258 			break
 153259 			fallthrough
 153260 		default:
 153261 			op = OP_Ge
 153262 			break
 153263 		}
 153264 		arith = OP_Subtract
 153265 	}
 153266 
 153267 	if int32((*ExprList_item)(unsafe.Pointer(pOrderBy+8)).Ffg.FsortFlags)&KEYINFO_ORDER_BIGNULL != 0 {
 153268 		var addr int32 = Xsqlite3VdbeAddOp1(tls, v, OP_NotNull, reg1)
 153269 		switch op {
 153270 		case OP_Ge:
 153271 			Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, lbl)
 153272 			break
 153273 			fallthrough
 153274 		case OP_Gt:
 153275 			Xsqlite3VdbeAddOp2(tls, v, OP_NotNull, reg2, lbl)
 153276 
 153277 			break
 153278 			fallthrough
 153279 		case OP_Le:
 153280 			Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, reg2, lbl)
 153281 
 153282 			break
 153283 			fallthrough
 153284 		default:
 153285 			break
 153286 		}
 153287 		Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, addrDone)
 153288 
 153289 		Xsqlite3VdbeJumpHere(tls, v, addr)
 153290 		Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, reg2,
 153291 			func() int32 {
 153292 				if op == OP_Gt || op == OP_Ge {
 153293 					return addrDone
 153294 				}
 153295 				return lbl
 153296 			}())
 153297 
 153298 	}
 153299 
 153300 	Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, regString, 0, ts+1544, -1)
 153301 	addrGe = Xsqlite3VdbeAddOp3(tls, v, OP_Ge, regString, 0, reg1)
 153302 
 153303 	if op == OP_Ge && arith == OP_Add || op == OP_Le && arith == OP_Subtract {
 153304 		Xsqlite3VdbeAddOp3(tls, v, op, reg2, lbl, reg1)
 153305 	}
 153306 	Xsqlite3VdbeAddOp3(tls, v, arith, regVal, reg1, reg1)
 153307 	Xsqlite3VdbeJumpHere(tls, v, addrGe)
 153308 
 153309 	Xsqlite3VdbeAddOp3(tls, v, op, reg2, lbl, reg1)
 153310 	pColl = Xsqlite3ExprNNCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer(pOrderBy+8)).FpExpr)
 153311 	Xsqlite3VdbeAppendP4(tls, v, pColl, -2)
 153312 	Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NULLEQ))
 153313 	Xsqlite3VdbeResolveLabel(tls, v, addrDone)
 153314 
 153315 	Xsqlite3ReleaseTempReg(tls, pParse, reg1)
 153316 	Xsqlite3ReleaseTempReg(tls, pParse, reg2)
 153317 
 153318 }
 153319 
 153320 func windowCodeOp(tls *libc.TLS, p uintptr, op int32, regCountdown int32, jumpOnEof int32) int32 {
 153321 	var csr int32
 153322 	var reg int32
 153323 	var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse
 153324 	var pMWin uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpMWin
 153325 	var ret int32 = 0
 153326 	var v uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpVdbe
 153327 	var addrContinue int32 = 0
 153328 	var bPeer int32 = libc.Bool32(int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) != TK_ROWS)
 153329 
 153330 	var lblDone int32 = Xsqlite3VdbeMakeLabel(tls, pParse)
 153331 	var addrNextRange int32 = 0
 153332 
 153333 	if op == WINDOW_AGGINVERSE && int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == TK_UNBOUNDED {
 153334 		return 0
 153335 	}
 153336 
 153337 	if regCountdown > 0 {
 153338 		if int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) == TK_RANGE {
 153339 			addrNextRange = Xsqlite3VdbeCurrentAddr(tls, v)
 153340 
 153341 			if op == WINDOW_AGGINVERSE {
 153342 				if int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == TK_FOLLOWING {
 153343 					windowCodeRangeTest(tls,
 153344 						p, OP_Le, (*WindowCodeArg)(unsafe.Pointer(p)).Fcurrent.Fcsr, regCountdown, (*WindowCodeArg)(unsafe.Pointer(p)).Fstart.Fcsr, lblDone)
 153345 				} else {
 153346 					windowCodeRangeTest(tls,
 153347 						p, OP_Ge, (*WindowCodeArg)(unsafe.Pointer(p)).Fstart.Fcsr, regCountdown, (*WindowCodeArg)(unsafe.Pointer(p)).Fcurrent.Fcsr, lblDone)
 153348 				}
 153349 			} else {
 153350 				windowCodeRangeTest(tls,
 153351 					p, OP_Gt, (*WindowCodeArg)(unsafe.Pointer(p)).Fend.Fcsr, regCountdown, (*WindowCodeArg)(unsafe.Pointer(p)).Fcurrent.Fcsr, lblDone)
 153352 			}
 153353 		} else {
 153354 			Xsqlite3VdbeAddOp3(tls, v, OP_IfPos, regCountdown, lblDone, 1)
 153355 
 153356 		}
 153357 	}
 153358 
 153359 	if op == WINDOW_RETURN_ROW && (*Window)(unsafe.Pointer(pMWin)).FregStartRowid == 0 {
 153360 		windowAggFinal(tls, p, 0)
 153361 	}
 153362 	addrContinue = Xsqlite3VdbeCurrentAddr(tls, v)
 153363 
 153364 	if int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == int32((*Window)(unsafe.Pointer(pMWin)).FeEnd) && regCountdown != 0 &&
 153365 		int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) == TK_RANGE {
 153366 		var regRowid1 int32 = Xsqlite3GetTempReg(tls, pParse)
 153367 		var regRowid2 int32 = Xsqlite3GetTempReg(tls, pParse)
 153368 		if op == WINDOW_AGGINVERSE {
 153369 			Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, (*WindowCodeArg)(unsafe.Pointer(p)).Fstart.Fcsr, regRowid1)
 153370 			Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, (*WindowCodeArg)(unsafe.Pointer(p)).Fend.Fcsr, regRowid2)
 153371 			Xsqlite3VdbeAddOp3(tls, v, OP_Ge, regRowid2, lblDone, regRowid1)
 153372 
 153373 		} else if (*WindowCodeArg)(unsafe.Pointer(p)).FregRowid != 0 {
 153374 			Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, (*WindowCodeArg)(unsafe.Pointer(p)).Fend.Fcsr, regRowid1)
 153375 			Xsqlite3VdbeAddOp3(tls, v, OP_Ge, (*WindowCodeArg)(unsafe.Pointer(p)).FregRowid, lblDone, regRowid1)
 153376 
 153377 		}
 153378 		Xsqlite3ReleaseTempReg(tls, pParse, regRowid1)
 153379 		Xsqlite3ReleaseTempReg(tls, pParse, regRowid2)
 153380 
 153381 	}
 153382 
 153383 	switch op {
 153384 	case WINDOW_RETURN_ROW:
 153385 		csr = (*WindowCodeArg)(unsafe.Pointer(p)).Fcurrent.Fcsr
 153386 		reg = (*WindowCodeArg)(unsafe.Pointer(p)).Fcurrent.Freg
 153387 		windowReturnOneRow(tls, p)
 153388 		break
 153389 
 153390 	case WINDOW_AGGINVERSE:
 153391 		csr = (*WindowCodeArg)(unsafe.Pointer(p)).Fstart.Fcsr
 153392 		reg = (*WindowCodeArg)(unsafe.Pointer(p)).Fstart.Freg
 153393 		if (*Window)(unsafe.Pointer(pMWin)).FregStartRowid != 0 {
 153394 			Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, (*Window)(unsafe.Pointer(pMWin)).FregStartRowid, 1)
 153395 		} else {
 153396 			windowAggStep(tls, p, pMWin, csr, 1, (*WindowCodeArg)(unsafe.Pointer(p)).FregArg)
 153397 		}
 153398 		break
 153399 
 153400 	default:
 153401 		csr = (*WindowCodeArg)(unsafe.Pointer(p)).Fend.Fcsr
 153402 		reg = (*WindowCodeArg)(unsafe.Pointer(p)).Fend.Freg
 153403 		if (*Window)(unsafe.Pointer(pMWin)).FregStartRowid != 0 {
 153404 			Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, (*Window)(unsafe.Pointer(pMWin)).FregEndRowid, 1)
 153405 		} else {
 153406 			windowAggStep(tls, p, pMWin, csr, 0, (*WindowCodeArg)(unsafe.Pointer(p)).FregArg)
 153407 		}
 153408 		break
 153409 	}
 153410 
 153411 	if op == (*WindowCodeArg)(unsafe.Pointer(p)).FeDelete {
 153412 		Xsqlite3VdbeAddOp1(tls, v, OP_Delete, csr)
 153413 		Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION))
 153414 	}
 153415 
 153416 	if jumpOnEof != 0 {
 153417 		Xsqlite3VdbeAddOp2(tls, v, OP_Next, csr, Xsqlite3VdbeCurrentAddr(tls, v)+2)
 153418 
 153419 		ret = Xsqlite3VdbeAddOp0(tls, v, OP_Goto)
 153420 	} else {
 153421 		Xsqlite3VdbeAddOp2(tls, v, OP_Next, csr, Xsqlite3VdbeCurrentAddr(tls, v)+1+bPeer)
 153422 
 153423 		if bPeer != 0 {
 153424 			Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, lblDone)
 153425 		}
 153426 	}
 153427 
 153428 	if bPeer != 0 {
 153429 		var nReg int32 = func() int32 {
 153430 			if (*Window)(unsafe.Pointer(pMWin)).FpOrderBy != 0 {
 153431 				return (*ExprList)(unsafe.Pointer((*Window)(unsafe.Pointer(pMWin)).FpOrderBy)).FnExpr
 153432 			}
 153433 			return 0
 153434 		}()
 153435 		var regTmp int32 = func() int32 {
 153436 			if nReg != 0 {
 153437 				return Xsqlite3GetTempRange(tls, pParse, nReg)
 153438 			}
 153439 			return 0
 153440 		}()
 153441 		windowReadPeerValues(tls, p, csr, regTmp)
 153442 		windowIfNewPeer(tls, pParse, (*Window)(unsafe.Pointer(pMWin)).FpOrderBy, regTmp, reg, addrContinue)
 153443 		Xsqlite3ReleaseTempRange(tls, pParse, regTmp, nReg)
 153444 	}
 153445 
 153446 	if addrNextRange != 0 {
 153447 		Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, addrNextRange)
 153448 	}
 153449 	Xsqlite3VdbeResolveLabel(tls, v, lblDone)
 153450 	return ret
 153451 }
 153452 
 153453 // Allocate and return a duplicate of the Window object indicated by the
 153454 // third argument. Set the Window.pOwner field of the new object to
 153455 // pOwner.
 153456 func Xsqlite3WindowDup(tls *libc.TLS, db uintptr, pOwner uintptr, p uintptr) uintptr {
 153457 	var pNew uintptr = uintptr(0)
 153458 	if p != 0 {
 153459 		pNew = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Window{})))
 153460 		if pNew != 0 {
 153461 			(*Window)(unsafe.Pointer(pNew)).FzName = Xsqlite3DbStrDup(tls, db, (*Window)(unsafe.Pointer(p)).FzName)
 153462 			(*Window)(unsafe.Pointer(pNew)).FzBase = Xsqlite3DbStrDup(tls, db, (*Window)(unsafe.Pointer(p)).FzBase)
 153463 			(*Window)(unsafe.Pointer(pNew)).FpFilter = Xsqlite3ExprDup(tls, db, (*Window)(unsafe.Pointer(p)).FpFilter, 0)
 153464 			(*Window)(unsafe.Pointer(pNew)).FpWFunc = (*Window)(unsafe.Pointer(p)).FpWFunc
 153465 			(*Window)(unsafe.Pointer(pNew)).FpPartition = Xsqlite3ExprListDup(tls, db, (*Window)(unsafe.Pointer(p)).FpPartition, 0)
 153466 			(*Window)(unsafe.Pointer(pNew)).FpOrderBy = Xsqlite3ExprListDup(tls, db, (*Window)(unsafe.Pointer(p)).FpOrderBy, 0)
 153467 			(*Window)(unsafe.Pointer(pNew)).FeFrmType = (*Window)(unsafe.Pointer(p)).FeFrmType
 153468 			(*Window)(unsafe.Pointer(pNew)).FeEnd = (*Window)(unsafe.Pointer(p)).FeEnd
 153469 			(*Window)(unsafe.Pointer(pNew)).FeStart = (*Window)(unsafe.Pointer(p)).FeStart
 153470 			(*Window)(unsafe.Pointer(pNew)).FeExclude = (*Window)(unsafe.Pointer(p)).FeExclude
 153471 			(*Window)(unsafe.Pointer(pNew)).FregResult = (*Window)(unsafe.Pointer(p)).FregResult
 153472 			(*Window)(unsafe.Pointer(pNew)).FregAccum = (*Window)(unsafe.Pointer(p)).FregAccum
 153473 			(*Window)(unsafe.Pointer(pNew)).FiArgCol = (*Window)(unsafe.Pointer(p)).FiArgCol
 153474 			(*Window)(unsafe.Pointer(pNew)).FiEphCsr = (*Window)(unsafe.Pointer(p)).FiEphCsr
 153475 			(*Window)(unsafe.Pointer(pNew)).FbExprArgs = (*Window)(unsafe.Pointer(p)).FbExprArgs
 153476 			(*Window)(unsafe.Pointer(pNew)).FpStart = Xsqlite3ExprDup(tls, db, (*Window)(unsafe.Pointer(p)).FpStart, 0)
 153477 			(*Window)(unsafe.Pointer(pNew)).FpEnd = Xsqlite3ExprDup(tls, db, (*Window)(unsafe.Pointer(p)).FpEnd, 0)
 153478 			(*Window)(unsafe.Pointer(pNew)).FpOwner = pOwner
 153479 			(*Window)(unsafe.Pointer(pNew)).FbImplicitFrame = (*Window)(unsafe.Pointer(p)).FbImplicitFrame
 153480 		}
 153481 	}
 153482 	return pNew
 153483 }
 153484 
 153485 // Return a copy of the linked list of Window objects passed as the
 153486 // second argument.
 153487 func Xsqlite3WindowListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr {
 153488 	bp := tls.Alloc(8)
 153489 	defer tls.Free(8)
 153490 
 153491 	var pWin uintptr
 153492 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 153493 	var pp uintptr = bp
 153494 
 153495 	for pWin = p; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin {
 153496 		*(*uintptr)(unsafe.Pointer(pp)) = Xsqlite3WindowDup(tls, db, uintptr(0), pWin)
 153497 		if *(*uintptr)(unsafe.Pointer(pp)) == uintptr(0) {
 153498 			break
 153499 		}
 153500 		pp = *(*uintptr)(unsafe.Pointer(pp)) + 64
 153501 	}
 153502 
 153503 	return *(*uintptr)(unsafe.Pointer(bp))
 153504 }
 153505 
 153506 func windowExprGtZero(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 {
 153507 	bp := tls.Alloc(8)
 153508 	defer tls.Free(8)
 153509 
 153510 	var ret int32 = 0
 153511 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 153512 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 153513 	Xsqlite3ValueFromExpr(tls, db, pExpr, (*Sqlite3)(unsafe.Pointer(db)).Fenc, uint8(SQLITE_AFF_NUMERIC), bp)
 153514 	if *(*uintptr)(unsafe.Pointer(bp)) != 0 && Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(bp))) > 0 {
 153515 		ret = 1
 153516 	}
 153517 	Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp)))
 153518 	return ret
 153519 }
 153520 
 153521 // sqlite3WhereBegin() has already been called for the SELECT statement
 153522 // passed as the second argument when this function is invoked. It generates
 153523 // code to populate the Window.regResult register for each window function
 153524 // and invoke the sub-routine at instruction addrGosub once for each row.
 153525 // sqlite3WhereEnd() is always called before returning.
 153526 //
 153527 // This function handles several different types of window frames, which
 153528 // require slightly different processing. The following pseudo code is
 153529 // used to implement window frames of the form:
 153530 //
 153531 //	ROWS BETWEEN <expr1> PRECEDING AND <expr2> FOLLOWING
 153532 //
 153533 // Other window frame types use variants of the following:
 153534 //
 153535 //	... loop started by sqlite3WhereBegin() ...
 153536 //	  if( new partition ){
 153537 //	    Gosub flush
 153538 //	  }
 153539 //	  Insert new row into eph table.
 153540 //
 153541 //	  if( first row of partition ){
 153542 //	    // Rewind three cursors, all open on the eph table.
 153543 //	    Rewind(csrEnd);
 153544 //	    Rewind(csrStart);
 153545 //	    Rewind(csrCurrent);
 153546 //
 153547 //	    regEnd = <expr2>          // FOLLOWING expression
 153548 //	    regStart = <expr1>        // PRECEDING expression
 153549 //	  }else{
 153550 //	    // First time this branch is taken, the eph table contains two
 153551 //	    // rows. The first row in the partition, which all three cursors
 153552 //	    // currently point to, and the following row.
 153553 //	    AGGSTEP
 153554 //	    if( (regEnd--)<=0 ){
 153555 //	      RETURN_ROW
 153556 //	      if( (regStart--)<=0 ){
 153557 //	        AGGINVERSE
 153558 //	      }
 153559 //	    }
 153560 //	  }
 153561 //	}
 153562 //	flush:
 153563 //	  AGGSTEP
 153564 //	  while( 1 ){
 153565 //	    RETURN ROW
 153566 //	    if( csrCurrent is EOF ) break;
 153567 //	    if( (regStart--)<=0 ){
 153568 //	      AggInverse(csrStart)
 153569 //	      Next(csrStart)
 153570 //	    }
 153571 //	  }
 153572 //
 153573 // The pseudo-code above uses the following shorthand:
 153574 //
 153575 //	AGGSTEP:    invoke the aggregate xStep() function for each window function
 153576 //	            with arguments read from the current row of cursor csrEnd, then
 153577 //	            step cursor csrEnd forward one row (i.e. sqlite3BtreeNext()).
 153578 //
 153579 //	RETURN_ROW: return a row to the caller based on the contents of the
 153580 //	            current row of csrCurrent and the current state of all
 153581 //	            aggregates. Then step cursor csrCurrent forward one row.
 153582 //
 153583 //	AGGINVERSE: invoke the aggregate xInverse() function for each window
 153584 //	            functions with arguments read from the current row of cursor
 153585 //	            csrStart. Then step csrStart forward one row.
 153586 //
 153587 // There are two other ROWS window frames that are handled significantly
 153588 // differently from the above - "BETWEEN <expr> PRECEDING AND <expr> PRECEDING"
 153589 // and "BETWEEN <expr> FOLLOWING AND <expr> FOLLOWING". These are special
 153590 // cases because they change the order in which the three cursors (csrStart,
 153591 // csrCurrent and csrEnd) iterate through the ephemeral table. Cases that
 153592 // use UNBOUNDED or CURRENT ROW are much simpler variations on one of these
 153593 // three.
 153594 //
 153595 //	ROWS BETWEEN <expr1> PRECEDING AND <expr2> PRECEDING
 153596 //
 153597 //	  ... loop started by sqlite3WhereBegin() ...
 153598 //	    if( new partition ){
 153599 //	      Gosub flush
 153600 //	    }
 153601 //	    Insert new row into eph table.
 153602 //	    if( first row of partition ){
 153603 //	      Rewind(csrEnd) ; Rewind(csrStart) ; Rewind(csrCurrent)
 153604 //	      regEnd = <expr2>
 153605 //	      regStart = <expr1>
 153606 //	    }else{
 153607 //	      if( (regEnd--)<=0 ){
 153608 //	        AGGSTEP
 153609 //	      }
 153610 //	      RETURN_ROW
 153611 //	      if( (regStart--)<=0 ){
 153612 //	        AGGINVERSE
 153613 //	      }
 153614 //	    }
 153615 //	  }
 153616 //	  flush:
 153617 //	    if( (regEnd--)<=0 ){
 153618 //	      AGGSTEP
 153619 //	    }
 153620 //	    RETURN_ROW
 153621 //
 153622 //
 153623 //	ROWS BETWEEN <expr1> FOLLOWING AND <expr2> FOLLOWING
 153624 //
 153625 //	  ... loop started by sqlite3WhereBegin() ...
 153626 //	  if( new partition ){
 153627 //	    Gosub flush
 153628 //	  }
 153629 //	  Insert new row into eph table.
 153630 //	  if( first row of partition ){
 153631 //	    Rewind(csrEnd) ; Rewind(csrStart) ; Rewind(csrCurrent)
 153632 //	    regEnd = <expr2>
 153633 //	    regStart = regEnd - <expr1>
 153634 //	  }else{
 153635 //	    AGGSTEP
 153636 //	    if( (regEnd--)<=0 ){
 153637 //	      RETURN_ROW
 153638 //	    }
 153639 //	    if( (regStart--)<=0 ){
 153640 //	      AGGINVERSE
 153641 //	    }
 153642 //	  }
 153643 //	}
 153644 //	flush:
 153645 //	  AGGSTEP
 153646 //	  while( 1 ){
 153647 //	    if( (regEnd--)<=0 ){
 153648 //	      RETURN_ROW
 153649 //	      if( eof ) break;
 153650 //	    }
 153651 //	    if( (regStart--)<=0 ){
 153652 //	      AGGINVERSE
 153653 //	      if( eof ) break
 153654 //	    }
 153655 //	  }
 153656 //	  while( !eof csrCurrent ){
 153657 //	    RETURN_ROW
 153658 //	  }
 153659 //
 153660 // For the most part, the patterns above are adapted to support UNBOUNDED by
 153661 // assuming that it is equivalent to "infinity PRECEDING/FOLLOWING" and
 153662 // CURRENT ROW by assuming that it is equivilent to "0 PRECEDING/FOLLOWING".
 153663 // This is optimized of course - branches that will never be taken and
 153664 // conditions that are always true are omitted from the VM code. The only
 153665 // exceptional case is:
 153666 //
 153667 //	ROWS BETWEEN <expr1> FOLLOWING AND UNBOUNDED FOLLOWING
 153668 //
 153669 //	  ... loop started by sqlite3WhereBegin() ...
 153670 //	  if( new partition ){
 153671 //	    Gosub flush
 153672 //	  }
 153673 //	  Insert new row into eph table.
 153674 //	  if( first row of partition ){
 153675 //	    Rewind(csrEnd) ; Rewind(csrStart) ; Rewind(csrCurrent)
 153676 //	    regStart = <expr1>
 153677 //	  }else{
 153678 //	    AGGSTEP
 153679 //	  }
 153680 //	}
 153681 //	flush:
 153682 //	  AGGSTEP
 153683 //	  while( 1 ){
 153684 //	    if( (regStart--)<=0 ){
 153685 //	      AGGINVERSE
 153686 //	      if( eof ) break
 153687 //	    }
 153688 //	    RETURN_ROW
 153689 //	  }
 153690 //	  while( !eof csrCurrent ){
 153691 //	    RETURN_ROW
 153692 //	  }
 153693 //
 153694 // Also requiring special handling are the cases:
 153695 //
 153696 //	ROWS BETWEEN <expr1> PRECEDING AND <expr2> PRECEDING
 153697 //	ROWS BETWEEN <expr1> FOLLOWING AND <expr2> FOLLOWING
 153698 //
 153699 // when (expr1 < expr2). This is detected at runtime, not by this function.
 153700 // To handle this case, the pseudo-code programs depicted above are modified
 153701 // slightly to be:
 153702 //
 153703 //	... loop started by sqlite3WhereBegin() ...
 153704 //	if( new partition ){
 153705 //	  Gosub flush
 153706 //	}
 153707 //	Insert new row into eph table.
 153708 //	if( first row of partition ){
 153709 //	  Rewind(csrEnd) ; Rewind(csrStart) ; Rewind(csrCurrent)
 153710 //	  regEnd = <expr2>
 153711 //	  regStart = <expr1>
 153712 //	  if( regEnd < regStart ){
 153713 //	    RETURN_ROW
 153714 //	    delete eph table contents
 153715 //	    continue
 153716 //	  }
 153717 //	...
 153718 //
 153719 // The new "continue" statement in the above jumps to the next iteration
 153720 // of the outer loop - the one started by sqlite3WhereBegin().
 153721 //
 153722 // The various GROUPS cases are implemented using the same patterns as
 153723 // ROWS. The VM code is modified slightly so that:
 153724 //
 153725 //  1. The else branch in the main loop is only taken if the row just
 153726 //     added to the ephemeral table is the start of a new group. In
 153727 //     other words, it becomes:
 153728 //
 153729 //     ... loop started by sqlite3WhereBegin() ...
 153730 //     if( new partition ){
 153731 //     Gosub flush
 153732 //     }
 153733 //     Insert new row into eph table.
 153734 //     if( first row of partition ){
 153735 //     Rewind(csrEnd) ; Rewind(csrStart) ; Rewind(csrCurrent)
 153736 //     regEnd = <expr2>
 153737 //     regStart = <expr1>
 153738 //     }else if( new group ){
 153739 //     ...
 153740 //     }
 153741 //     }
 153742 //
 153743 //  2. Instead of processing a single row, each RETURN_ROW, AGGSTEP or
 153744 //     AGGINVERSE step processes the current row of the relevant cursor and
 153745 //     all subsequent rows belonging to the same group.
 153746 //
 153747 // RANGE window frames are a little different again. As for GROUPS, the
 153748 // main loop runs once per group only. And RETURN_ROW, AGGSTEP and AGGINVERSE
 153749 // deal in groups instead of rows. As for ROWS and GROUPS, there are three
 153750 // basic cases:
 153751 //
 153752 //	RANGE BETWEEN <expr1> PRECEDING AND <expr2> FOLLOWING
 153753 //
 153754 //	  ... loop started by sqlite3WhereBegin() ...
 153755 //	    if( new partition ){
 153756 //	      Gosub flush
 153757 //	    }
 153758 //	    Insert new row into eph table.
 153759 //	    if( first row of partition ){
 153760 //	      Rewind(csrEnd) ; Rewind(csrStart) ; Rewind(csrCurrent)
 153761 //	      regEnd = <expr2>
 153762 //	      regStart = <expr1>
 153763 //	    }else{
 153764 //	      AGGSTEP
 153765 //	      while( (csrCurrent.key + regEnd) < csrEnd.key ){
 153766 //	        RETURN_ROW
 153767 //	        while( csrStart.key + regStart) < csrCurrent.key ){
 153768 //	          AGGINVERSE
 153769 //	        }
 153770 //	      }
 153771 //	    }
 153772 //	  }
 153773 //	  flush:
 153774 //	    AGGSTEP
 153775 //	    while( 1 ){
 153776 //	      RETURN ROW
 153777 //	      if( csrCurrent is EOF ) break;
 153778 //	        while( csrStart.key + regStart) < csrCurrent.key ){
 153779 //	          AGGINVERSE
 153780 //	        }
 153781 //	      }
 153782 //	    }
 153783 //
 153784 // In the above notation, "csr.key" means the current value of the ORDER BY
 153785 // expression (there is only ever 1 for a RANGE that uses an <expr> FOLLOWING
 153786 // or <expr PRECEDING) read from cursor csr.
 153787 //
 153788 //	RANGE BETWEEN <expr1> PRECEDING AND <expr2> PRECEDING
 153789 //
 153790 //	  ... loop started by sqlite3WhereBegin() ...
 153791 //	    if( new partition ){
 153792 //	      Gosub flush
 153793 //	    }
 153794 //	    Insert new row into eph table.
 153795 //	    if( first row of partition ){
 153796 //	      Rewind(csrEnd) ; Rewind(csrStart) ; Rewind(csrCurrent)
 153797 //	      regEnd = <expr2>
 153798 //	      regStart = <expr1>
 153799 //	    }else{
 153800 //	      while( (csrEnd.key + regEnd) <= csrCurrent.key ){
 153801 //	        AGGSTEP
 153802 //	      }
 153803 //	      while( (csrStart.key + regStart) < csrCurrent.key ){
 153804 //	        AGGINVERSE
 153805 //	      }
 153806 //	      RETURN_ROW
 153807 //	    }
 153808 //	  }
 153809 //	  flush:
 153810 //	    while( (csrEnd.key + regEnd) <= csrCurrent.key ){
 153811 //	      AGGSTEP
 153812 //	    }
 153813 //	    while( (csrStart.key + regStart) < csrCurrent.key ){
 153814 //	      AGGINVERSE
 153815 //	    }
 153816 //	    RETURN_ROW
 153817 //
 153818 //	RANGE BETWEEN <expr1> FOLLOWING AND <expr2> FOLLOWING
 153819 //
 153820 //	  ... loop started by sqlite3WhereBegin() ...
 153821 //	    if( new partition ){
 153822 //	      Gosub flush
 153823 //	    }
 153824 //	    Insert new row into eph table.
 153825 //	    if( first row of partition ){
 153826 //	      Rewind(csrEnd) ; Rewind(csrStart) ; Rewind(csrCurrent)
 153827 //	      regEnd = <expr2>
 153828 //	      regStart = <expr1>
 153829 //	    }else{
 153830 //	      AGGSTEP
 153831 //	      while( (csrCurrent.key + regEnd) < csrEnd.key ){
 153832 //	        while( (csrCurrent.key + regStart) > csrStart.key ){
 153833 //	          AGGINVERSE
 153834 //	        }
 153835 //	        RETURN_ROW
 153836 //	      }
 153837 //	    }
 153838 //	  }
 153839 //	  flush:
 153840 //	    AGGSTEP
 153841 //	    while( 1 ){
 153842 //	      while( (csrCurrent.key + regStart) > csrStart.key ){
 153843 //	        AGGINVERSE
 153844 //	        if( eof ) break "while( 1 )" loop.
 153845 //	      }
 153846 //	      RETURN_ROW
 153847 //	    }
 153848 //	    while( !eof csrCurrent ){
 153849 //	      RETURN_ROW
 153850 //	    }
 153851 //
 153852 // The text above leaves out many details. Refer to the code and comments
 153853 // below for a more complete picture.
 153854 func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uintptr, regGosub int32, addrGosub int32) {
 153855 	bp := tls.Alloc(72)
 153856 	defer tls.Free(72)
 153857 
 153858 	var pMWin uintptr = (*Select)(unsafe.Pointer(p)).FpWin
 153859 	var pOrderBy uintptr = (*Window)(unsafe.Pointer(pMWin)).FpOrderBy
 153860 	var v uintptr = Xsqlite3GetVdbe(tls, pParse)
 153861 	var csrWrite int32
 153862 	var csrInput int32 = (*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc + 8)).FiCursor
 153863 	var nInput int32 = int32((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc + 8)).FpTab)).FnCol)
 153864 	var iInput int32
 153865 	var addrNe int32
 153866 	var addrGosubFlush int32 = 0
 153867 	var addrInteger int32 = 0
 153868 	var addrEmpty int32
 153869 	var regNew int32
 153870 	var regRecord int32
 153871 	var regNewPeer int32 = 0
 153872 	var regPeer int32 = 0
 153873 	var regFlushPart int32 = 0
 153874 
 153875 	var lblWhereEnd int32
 153876 	var regStart int32 = 0
 153877 	var regEnd int32 = 0
 153878 
 153879 	lblWhereEnd = Xsqlite3VdbeMakeLabel(tls, pParse)
 153880 
 153881 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(WindowCodeArg{})))
 153882 	(*WindowCodeArg)(unsafe.Pointer(bp)).FpParse = pParse
 153883 	(*WindowCodeArg)(unsafe.Pointer(bp)).FpMWin = pMWin
 153884 	(*WindowCodeArg)(unsafe.Pointer(bp)).FpVdbe = v
 153885 	(*WindowCodeArg)(unsafe.Pointer(bp)).FregGosub = regGosub
 153886 	(*WindowCodeArg)(unsafe.Pointer(bp)).FaddrGosub = addrGosub
 153887 	(*WindowCodeArg)(unsafe.Pointer(bp)).Fcurrent.Fcsr = (*Window)(unsafe.Pointer(pMWin)).FiEphCsr
 153888 	csrWrite = (*WindowCodeArg)(unsafe.Pointer(bp)).Fcurrent.Fcsr + 1
 153889 	(*WindowCodeArg)(unsafe.Pointer(bp)).Fstart.Fcsr = (*WindowCodeArg)(unsafe.Pointer(bp)).Fcurrent.Fcsr + 2
 153890 	(*WindowCodeArg)(unsafe.Pointer(bp)).Fend.Fcsr = (*WindowCodeArg)(unsafe.Pointer(bp)).Fcurrent.Fcsr + 3
 153891 
 153892 	switch int32((*Window)(unsafe.Pointer(pMWin)).FeStart) {
 153893 	case TK_FOLLOWING:
 153894 		if int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) != TK_RANGE &&
 153895 			windowExprGtZero(tls, pParse, (*Window)(unsafe.Pointer(pMWin)).FpStart) != 0 {
 153896 			(*WindowCodeArg)(unsafe.Pointer(bp)).FeDelete = WINDOW_RETURN_ROW
 153897 		}
 153898 		break
 153899 	case TK_UNBOUNDED:
 153900 		if windowCacheFrame(tls, pMWin) == 0 {
 153901 			if int32((*Window)(unsafe.Pointer(pMWin)).FeEnd) == TK_PRECEDING {
 153902 				if int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) != TK_RANGE &&
 153903 					windowExprGtZero(tls, pParse, (*Window)(unsafe.Pointer(pMWin)).FpEnd) != 0 {
 153904 					(*WindowCodeArg)(unsafe.Pointer(bp)).FeDelete = WINDOW_AGGSTEP
 153905 				}
 153906 			} else {
 153907 				(*WindowCodeArg)(unsafe.Pointer(bp)).FeDelete = WINDOW_RETURN_ROW
 153908 			}
 153909 		}
 153910 		break
 153911 	default:
 153912 		(*WindowCodeArg)(unsafe.Pointer(bp)).FeDelete = WINDOW_AGGINVERSE
 153913 		break
 153914 	}
 153915 
 153916 	regNew = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 153917 	*(*int32)(unsafe.Pointer(pParse + 56)) += nInput
 153918 	regRecord = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 153919 	(*WindowCodeArg)(unsafe.Pointer(bp)).FregRowid = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 153920 
 153921 	if int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == TK_PRECEDING || int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == TK_FOLLOWING {
 153922 		regStart = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 153923 	}
 153924 	if int32((*Window)(unsafe.Pointer(pMWin)).FeEnd) == TK_PRECEDING || int32((*Window)(unsafe.Pointer(pMWin)).FeEnd) == TK_FOLLOWING {
 153925 		regEnd = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 153926 	}
 153927 
 153928 	if int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) != TK_ROWS {
 153929 		var nPeer int32 = func() int32 {
 153930 			if pOrderBy != 0 {
 153931 				return (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr
 153932 			}
 153933 			return 0
 153934 		}()
 153935 		regNewPeer = regNew + (*Window)(unsafe.Pointer(pMWin)).FnBufferCol
 153936 		if (*Window)(unsafe.Pointer(pMWin)).FpPartition != 0 {
 153937 			regNewPeer = regNewPeer + (*ExprList)(unsafe.Pointer((*Window)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr
 153938 		}
 153939 		regPeer = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 153940 		*(*int32)(unsafe.Pointer(pParse + 56)) += nPeer
 153941 		(*WindowCodeArg)(unsafe.Pointer(bp)).Fstart.Freg = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 153942 		*(*int32)(unsafe.Pointer(pParse + 56)) += nPeer
 153943 		(*WindowCodeArg)(unsafe.Pointer(bp)).Fcurrent.Freg = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 153944 		*(*int32)(unsafe.Pointer(pParse + 56)) += nPeer
 153945 		(*WindowCodeArg)(unsafe.Pointer(bp)).Fend.Freg = (*Parse)(unsafe.Pointer(pParse)).FnMem + 1
 153946 		*(*int32)(unsafe.Pointer(pParse + 56)) += nPeer
 153947 	}
 153948 
 153949 	for iInput = 0; iInput < nInput; iInput++ {
 153950 		Xsqlite3VdbeAddOp3(tls, v, OP_Column, csrInput, iInput, regNew+iInput)
 153951 	}
 153952 	Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regNew, nInput, regRecord)
 153953 
 153954 	if (*Window)(unsafe.Pointer(pMWin)).FpPartition != 0 {
 153955 		var addr int32
 153956 		var pPart uintptr = (*Window)(unsafe.Pointer(pMWin)).FpPartition
 153957 		var nPart int32 = (*ExprList)(unsafe.Pointer(pPart)).FnExpr
 153958 		var regNewPart int32 = regNew + (*Window)(unsafe.Pointer(pMWin)).FnBufferCol
 153959 		var pKeyInfo uintptr = Xsqlite3KeyInfoFromExprList(tls, pParse, pPart, 0, 0)
 153960 
 153961 		regFlushPart = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
 153962 		addr = Xsqlite3VdbeAddOp3(tls, v, OP_Compare, regNewPart, (*Window)(unsafe.Pointer(pMWin)).FregPart, nPart)
 153963 		Xsqlite3VdbeAppendP4(tls, v, pKeyInfo, -8)
 153964 		Xsqlite3VdbeAddOp3(tls, v, OP_Jump, addr+2, addr+4, addr+2)
 153965 
 153966 		addrGosubFlush = Xsqlite3VdbeAddOp1(tls, v, OP_Gosub, regFlushPart)
 153967 
 153968 		Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regNewPart, (*Window)(unsafe.Pointer(pMWin)).FregPart, nPart-1)
 153969 	}
 153970 
 153971 	Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, csrWrite, (*WindowCodeArg)(unsafe.Pointer(bp)).FregRowid)
 153972 	Xsqlite3VdbeAddOp3(tls, v, OP_Insert, csrWrite, regRecord, (*WindowCodeArg)(unsafe.Pointer(bp)).FregRowid)
 153973 	addrNe = Xsqlite3VdbeAddOp3(tls, v, OP_Ne, (*Window)(unsafe.Pointer(pMWin)).FregOne, 0, (*WindowCodeArg)(unsafe.Pointer(bp)).FregRowid)
 153974 
 153975 	(*WindowCodeArg)(unsafe.Pointer(bp)).FregArg = windowInitAccum(tls, pParse, pMWin)
 153976 
 153977 	if regStart != 0 {
 153978 		Xsqlite3ExprCode(tls, pParse, (*Window)(unsafe.Pointer(pMWin)).FpStart, regStart)
 153979 		windowCheckValue(tls, pParse, regStart, 0+func() int32 {
 153980 			if int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) == TK_RANGE {
 153981 				return 3
 153982 			}
 153983 			return 0
 153984 		}())
 153985 	}
 153986 	if regEnd != 0 {
 153987 		Xsqlite3ExprCode(tls, pParse, (*Window)(unsafe.Pointer(pMWin)).FpEnd, regEnd)
 153988 		windowCheckValue(tls, pParse, regEnd, 1+func() int32 {
 153989 			if int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) == TK_RANGE {
 153990 				return 3
 153991 			}
 153992 			return 0
 153993 		}())
 153994 	}
 153995 
 153996 	if int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) != TK_RANGE && int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == int32((*Window)(unsafe.Pointer(pMWin)).FeEnd) && regStart != 0 {
 153997 		var op int32 = func() int32 {
 153998 			if int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == TK_FOLLOWING {
 153999 				return OP_Ge
 154000 			}
 154001 			return OP_Le
 154002 		}()
 154003 		var addrGe int32 = Xsqlite3VdbeAddOp3(tls, v, op, regStart, 0, regEnd)
 154004 
 154005 		windowAggFinal(tls, bp, 0)
 154006 		Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, (*WindowCodeArg)(unsafe.Pointer(bp)).Fcurrent.Fcsr)
 154007 		windowReturnOneRow(tls, bp)
 154008 		Xsqlite3VdbeAddOp1(tls, v, OP_ResetSorter, (*WindowCodeArg)(unsafe.Pointer(bp)).Fcurrent.Fcsr)
 154009 		Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, lblWhereEnd)
 154010 		Xsqlite3VdbeJumpHere(tls, v, addrGe)
 154011 	}
 154012 	if int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == TK_FOLLOWING && int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) != TK_RANGE && regEnd != 0 {
 154013 		Xsqlite3VdbeAddOp3(tls, v, OP_Subtract, regStart, regEnd, regStart)
 154014 	}
 154015 
 154016 	if int32((*Window)(unsafe.Pointer(pMWin)).FeStart) != TK_UNBOUNDED {
 154017 		Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, (*WindowCodeArg)(unsafe.Pointer(bp)).Fstart.Fcsr)
 154018 	}
 154019 	Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, (*WindowCodeArg)(unsafe.Pointer(bp)).Fcurrent.Fcsr)
 154020 	Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, (*WindowCodeArg)(unsafe.Pointer(bp)).Fend.Fcsr)
 154021 	if regPeer != 0 && pOrderBy != 0 {
 154022 		Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regNewPeer, regPeer, (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr-1)
 154023 		Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regPeer, (*WindowCodeArg)(unsafe.Pointer(bp)).Fstart.Freg, (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr-1)
 154024 		Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regPeer, (*WindowCodeArg)(unsafe.Pointer(bp)).Fcurrent.Freg, (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr-1)
 154025 		Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regPeer, (*WindowCodeArg)(unsafe.Pointer(bp)).Fend.Freg, (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr-1)
 154026 	}
 154027 
 154028 	Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, lblWhereEnd)
 154029 
 154030 	Xsqlite3VdbeJumpHere(tls, v, addrNe)
 154031 
 154032 	if regPeer != 0 {
 154033 		windowIfNewPeer(tls, pParse, pOrderBy, regNewPeer, regPeer, lblWhereEnd)
 154034 	}
 154035 	if int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == TK_FOLLOWING {
 154036 		windowCodeOp(tls, bp, WINDOW_AGGSTEP, 0, 0)
 154037 		if int32((*Window)(unsafe.Pointer(pMWin)).FeEnd) != TK_UNBOUNDED {
 154038 			if int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) == TK_RANGE {
 154039 				var lbl int32 = Xsqlite3VdbeMakeLabel(tls, pParse)
 154040 				var addrNext int32 = Xsqlite3VdbeCurrentAddr(tls, v)
 154041 				windowCodeRangeTest(tls, bp, OP_Ge, (*WindowCodeArg)(unsafe.Pointer(bp)).Fcurrent.Fcsr, regEnd, (*WindowCodeArg)(unsafe.Pointer(bp)).Fend.Fcsr, lbl)
 154042 				windowCodeOp(tls, bp, WINDOW_AGGINVERSE, regStart, 0)
 154043 				windowCodeOp(tls, bp, WINDOW_RETURN_ROW, 0, 0)
 154044 				Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, addrNext)
 154045 				Xsqlite3VdbeResolveLabel(tls, v, lbl)
 154046 			} else {
 154047 				windowCodeOp(tls, bp, WINDOW_RETURN_ROW, regEnd, 0)
 154048 				windowCodeOp(tls, bp, WINDOW_AGGINVERSE, regStart, 0)
 154049 			}
 154050 		}
 154051 	} else if int32((*Window)(unsafe.Pointer(pMWin)).FeEnd) == TK_PRECEDING {
 154052 		var bRPS int32 = libc.Bool32(int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == TK_PRECEDING && int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) == TK_RANGE)
 154053 		windowCodeOp(tls, bp, WINDOW_AGGSTEP, regEnd, 0)
 154054 		if bRPS != 0 {
 154055 			windowCodeOp(tls, bp, WINDOW_AGGINVERSE, regStart, 0)
 154056 		}
 154057 		windowCodeOp(tls, bp, WINDOW_RETURN_ROW, 0, 0)
 154058 		if !(bRPS != 0) {
 154059 			windowCodeOp(tls, bp, WINDOW_AGGINVERSE, regStart, 0)
 154060 		}
 154061 	} else {
 154062 		var addr int32 = 0
 154063 		windowCodeOp(tls, bp, WINDOW_AGGSTEP, 0, 0)
 154064 		if int32((*Window)(unsafe.Pointer(pMWin)).FeEnd) != TK_UNBOUNDED {
 154065 			if int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) == TK_RANGE {
 154066 				var lbl int32 = 0
 154067 				addr = Xsqlite3VdbeCurrentAddr(tls, v)
 154068 				if regEnd != 0 {
 154069 					lbl = Xsqlite3VdbeMakeLabel(tls, pParse)
 154070 					windowCodeRangeTest(tls, bp, OP_Ge, (*WindowCodeArg)(unsafe.Pointer(bp)).Fcurrent.Fcsr, regEnd, (*WindowCodeArg)(unsafe.Pointer(bp)).Fend.Fcsr, lbl)
 154071 				}
 154072 				windowCodeOp(tls, bp, WINDOW_RETURN_ROW, 0, 0)
 154073 				windowCodeOp(tls, bp, WINDOW_AGGINVERSE, regStart, 0)
 154074 				if regEnd != 0 {
 154075 					Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, addr)
 154076 					Xsqlite3VdbeResolveLabel(tls, v, lbl)
 154077 				}
 154078 			} else {
 154079 				if regEnd != 0 {
 154080 					addr = Xsqlite3VdbeAddOp3(tls, v, OP_IfPos, regEnd, 0, 1)
 154081 
 154082 				}
 154083 				windowCodeOp(tls, bp, WINDOW_RETURN_ROW, 0, 0)
 154084 				windowCodeOp(tls, bp, WINDOW_AGGINVERSE, regStart, 0)
 154085 				if regEnd != 0 {
 154086 					Xsqlite3VdbeJumpHere(tls, v, addr)
 154087 				}
 154088 			}
 154089 		}
 154090 	}
 154091 
 154092 	Xsqlite3VdbeResolveLabel(tls, v, lblWhereEnd)
 154093 	Xsqlite3WhereEnd(tls, pWInfo)
 154094 
 154095 	if (*Window)(unsafe.Pointer(pMWin)).FpPartition != 0 {
 154096 		addrInteger = Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regFlushPart)
 154097 		Xsqlite3VdbeJumpHere(tls, v, addrGosubFlush)
 154098 	}
 154099 
 154100 	(*WindowCodeArg)(unsafe.Pointer(bp)).FregRowid = 0
 154101 	addrEmpty = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, csrWrite)
 154102 
 154103 	if int32((*Window)(unsafe.Pointer(pMWin)).FeEnd) == TK_PRECEDING {
 154104 		var bRPS int32 = libc.Bool32(int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == TK_PRECEDING && int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) == TK_RANGE)
 154105 		windowCodeOp(tls, bp, WINDOW_AGGSTEP, regEnd, 0)
 154106 		if bRPS != 0 {
 154107 			windowCodeOp(tls, bp, WINDOW_AGGINVERSE, regStart, 0)
 154108 		}
 154109 		windowCodeOp(tls, bp, WINDOW_RETURN_ROW, 0, 0)
 154110 	} else if int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == TK_FOLLOWING {
 154111 		var addrStart int32
 154112 		var addrBreak1 int32
 154113 		var addrBreak2 int32
 154114 		var addrBreak3 int32
 154115 		windowCodeOp(tls, bp, WINDOW_AGGSTEP, 0, 0)
 154116 		if int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) == TK_RANGE {
 154117 			addrStart = Xsqlite3VdbeCurrentAddr(tls, v)
 154118 			addrBreak2 = windowCodeOp(tls, bp, WINDOW_AGGINVERSE, regStart, 1)
 154119 			addrBreak1 = windowCodeOp(tls, bp, WINDOW_RETURN_ROW, 0, 1)
 154120 		} else if int32((*Window)(unsafe.Pointer(pMWin)).FeEnd) == TK_UNBOUNDED {
 154121 			addrStart = Xsqlite3VdbeCurrentAddr(tls, v)
 154122 			addrBreak1 = windowCodeOp(tls, bp, WINDOW_RETURN_ROW, regStart, 1)
 154123 			addrBreak2 = windowCodeOp(tls, bp, WINDOW_AGGINVERSE, 0, 1)
 154124 		} else {
 154125 			addrStart = Xsqlite3VdbeCurrentAddr(tls, v)
 154126 			addrBreak1 = windowCodeOp(tls, bp, WINDOW_RETURN_ROW, regEnd, 1)
 154127 			addrBreak2 = windowCodeOp(tls, bp, WINDOW_AGGINVERSE, regStart, 1)
 154128 		}
 154129 		Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, addrStart)
 154130 		Xsqlite3VdbeJumpHere(tls, v, addrBreak2)
 154131 		addrStart = Xsqlite3VdbeCurrentAddr(tls, v)
 154132 		addrBreak3 = windowCodeOp(tls, bp, WINDOW_RETURN_ROW, 0, 1)
 154133 		Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, addrStart)
 154134 		Xsqlite3VdbeJumpHere(tls, v, addrBreak1)
 154135 		Xsqlite3VdbeJumpHere(tls, v, addrBreak3)
 154136 	} else {
 154137 		var addrBreak int32
 154138 		var addrStart int32
 154139 		windowCodeOp(tls, bp, WINDOW_AGGSTEP, 0, 0)
 154140 		addrStart = Xsqlite3VdbeCurrentAddr(tls, v)
 154141 		addrBreak = windowCodeOp(tls, bp, WINDOW_RETURN_ROW, 0, 1)
 154142 		windowCodeOp(tls, bp, WINDOW_AGGINVERSE, regStart, 0)
 154143 		Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, addrStart)
 154144 		Xsqlite3VdbeJumpHere(tls, v, addrBreak)
 154145 	}
 154146 	Xsqlite3VdbeJumpHere(tls, v, addrEmpty)
 154147 
 154148 	Xsqlite3VdbeAddOp1(tls, v, OP_ResetSorter, (*WindowCodeArg)(unsafe.Pointer(bp)).Fcurrent.Fcsr)
 154149 	if (*Window)(unsafe.Pointer(pMWin)).FpPartition != 0 {
 154150 		if (*Window)(unsafe.Pointer(pMWin)).FregStartRowid != 0 {
 154151 			Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, (*Window)(unsafe.Pointer(pMWin)).FregStartRowid)
 154152 			Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*Window)(unsafe.Pointer(pMWin)).FregEndRowid)
 154153 		}
 154154 		Xsqlite3VdbeChangeP1(tls, v, addrInteger, Xsqlite3VdbeCurrentAddr(tls, v))
 154155 		Xsqlite3VdbeAddOp1(tls, v, OP_Return, regFlushPart)
 154156 	}
 154157 }
 154158 
 154159 // An instance of the following structure describes the event of a
 154160 // TRIGGER.  "a" is the event type, one of TK_UPDATE, TK_INSERT,
 154161 // TK_DELETE, or TK_INSTEAD.  If the event is of the form
 154162 //
 154163 //	UPDATE ON (a,b,c)
 154164 //
 154165 // Then the "b" IdList records the list "a,b,c".
 154166 type TrigEvent = struct {
 154167 	Fa           int32
 154168 	F__ccgo_pad1 [4]byte
 154169 	Fb           uintptr
 154170 }
 154171 
 154172 type FrameBound = struct {
 154173 	FeType       int32
 154174 	F__ccgo_pad1 [4]byte
 154175 	FpExpr       uintptr
 154176 }
 154177 
 154178 func disableLookaside(tls *libc.TLS, pParse uintptr) {
 154179 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 154180 	(*Parse)(unsafe.Pointer(pParse)).FdisableLookaside++
 154181 	(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++
 154182 	(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0)
 154183 }
 154184 
 154185 func parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) {
 154186 	bp := tls.Alloc(16)
 154187 	defer tls.Free(16)
 154188 
 154189 	if (*Select)(unsafe.Pointer(p)).FpPrior != 0 {
 154190 		var pNext uintptr = uintptr(0)
 154191 		var pLoop uintptr = p
 154192 		var mxSelect int32
 154193 		var cnt int32 = 1
 154194 		for 1 != 0 {
 154195 			(*Select)(unsafe.Pointer(pLoop)).FpNext = pNext
 154196 			*(*U32)(unsafe.Pointer(pLoop + 4)) |= U32(SF_Compound)
 154197 			pNext = pLoop
 154198 			pLoop = (*Select)(unsafe.Pointer(pLoop)).FpPrior
 154199 			if pLoop == uintptr(0) {
 154200 				break
 154201 			}
 154202 			cnt++
 154203 			if (*Select)(unsafe.Pointer(pLoop)).FpOrderBy != 0 || (*Select)(unsafe.Pointer(pLoop)).FpLimit != 0 {
 154204 				Xsqlite3ErrorMsg(tls, pParse, ts+24233,
 154205 					libc.VaList(bp, func() uintptr {
 154206 						if (*Select)(unsafe.Pointer(pLoop)).FpOrderBy != uintptr(0) {
 154207 							return ts + 24275
 154208 						}
 154209 						return ts + 24284
 154210 					}(),
 154211 						Xsqlite3SelectOpName(tls, int32((*Select)(unsafe.Pointer(pNext)).Fop))))
 154212 				break
 154213 			}
 154214 		}
 154215 		if (*Select)(unsafe.Pointer(p)).FselFlags&U32(SF_MultiValue) == U32(0) && libc.AssignInt32(&mxSelect, *(*int32)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb + 136 + 4*4))) > 0 && cnt > mxSelect {
 154216 			Xsqlite3ErrorMsg(tls, pParse, ts+24290, 0)
 154217 		}
 154218 	}
 154219 
 154220 }
 154221 
 154222 func attachWithToSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, pWith uintptr) uintptr {
 154223 	if pSelect != 0 {
 154224 		(*Select)(unsafe.Pointer(pSelect)).FpWith = pWith
 154225 		parserDoubleLinkSelect(tls, pParse, pSelect)
 154226 	} else {
 154227 		Xsqlite3WithDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pWith)
 154228 	}
 154229 	return pSelect
 154230 
 154231 }
 154232 
 154233 func tokenExpr(tls *libc.TLS, pParse uintptr, op int32, t Token) uintptr {
 154234 	bp := tls.Alloc(16)
 154235 	defer tls.Free(16)
 154236 	*(*Token)(unsafe.Pointer(bp)) = t
 154237 
 154238 	var p uintptr = Xsqlite3DbMallocRawNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Expr{}))+uint64((*Token)(unsafe.Pointer(bp)).Fn)+uint64(1))
 154239 	if p != 0 {
 154240 		(*Expr)(unsafe.Pointer(p)).Fop = U8(op)
 154241 		(*Expr)(unsafe.Pointer(p)).FaffExpr = int8(0)
 154242 		(*Expr)(unsafe.Pointer(p)).Fflags = U32(EP_Leaf)
 154243 
 154244 		(*Expr)(unsafe.Pointer(p)).FpLeft = libc.AssignPtrUintptr(p+24, uintptr(0))
 154245 		(*Expr)(unsafe.Pointer(p)).FpAggInfo = uintptr(0)
 154246 		libc.Xmemset(tls, p+32, 0, uint64(unsafe.Sizeof(struct{ FpList uintptr }{})))
 154247 		libc.Xmemset(tls, p+64, 0, uint64(unsafe.Sizeof(struct{ FpTab uintptr }{})))
 154248 		(*Expr)(unsafe.Pointer(p)).Fop2 = U8(0)
 154249 		(*Expr)(unsafe.Pointer(p)).FiTable = 0
 154250 		(*Expr)(unsafe.Pointer(p)).FiColumn = int16(0)
 154251 		*(*uintptr)(unsafe.Pointer(p + 8)) = p + 1*72
 154252 		libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(p + 8)), (*Token)(unsafe.Pointer(bp)).Fz, uint64((*Token)(unsafe.Pointer(bp)).Fn))
 154253 		*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 8)) + uintptr((*Token)(unsafe.Pointer(bp)).Fn))) = int8(0)
 154254 		*(*int32)(unsafe.Pointer(p + 52)) = int32((int64((*Token)(unsafe.Pointer(bp)).Fz) - int64((*Parse)(unsafe.Pointer(pParse)).FzTail)) / 1)
 154255 		if int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 8)))))])&0x80 != 0 {
 154256 			Xsqlite3DequoteExpr(tls, p)
 154257 		}
 154258 		(*Expr)(unsafe.Pointer(p)).FnHeight = 1
 154259 		if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
 154260 			return Xsqlite3RenameTokenMap(tls, pParse, p, bp)
 154261 		}
 154262 	}
 154263 	return p
 154264 
 154265 }
 154266 
 154267 func binaryToUnaryIfNull(tls *libc.TLS, pParse uintptr, pY uintptr, pA uintptr, op int32) {
 154268 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 154269 	if pA != 0 && pY != 0 && int32((*Expr)(unsafe.Pointer(pY)).Fop) == TK_NULL && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 154270 		(*Expr)(unsafe.Pointer(pA)).Fop = U8(op)
 154271 		Xsqlite3ExprDelete(tls, db, (*Expr)(unsafe.Pointer(pA)).FpRight)
 154272 		(*Expr)(unsafe.Pointer(pA)).FpRight = uintptr(0)
 154273 	}
 154274 
 154275 }
 154276 
 154277 func parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pIdToken uintptr, hasCollate int32, sortOrder int32) uintptr {
 154278 	bp := tls.Alloc(16)
 154279 	defer tls.Free(16)
 154280 
 154281 	var p uintptr = Xsqlite3ExprListAppend(tls, pParse, pPrior, uintptr(0))
 154282 	if (hasCollate != 0 || sortOrder != -1) &&
 154283 		int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Finit.Fbusy) == 0 {
 154284 		Xsqlite3ErrorMsg(tls, pParse, ts+24324,
 154285 			libc.VaList(bp, (*Token)(unsafe.Pointer(pIdToken)).Fn, (*Token)(unsafe.Pointer(pIdToken)).Fz))
 154286 	}
 154287 	Xsqlite3ExprListSetName(tls, pParse, p, pIdToken, 1)
 154288 	return p
 154289 
 154290 }
 154291 
 154292 // The next sections is a series of control #defines.
 154293 // various aspects of the generated parser.
 154294 //
 154295 //	YYCODETYPE         is the data type used to store the integer codes
 154296 //	                   that represent terminal and non-terminal symbols.
 154297 //	                   "unsigned char" is used if there are fewer than
 154298 //	                   256 symbols.  Larger types otherwise.
 154299 //	YYNOCODE           is a number of type YYCODETYPE that is not used for
 154300 //	                   any terminal or nonterminal symbol.
 154301 //	YYFALLBACK         If defined, this indicates that one or more tokens
 154302 //	                   (also known as: "terminal symbols") have fall-back
 154303 //	                   values which should be used if the original symbol
 154304 //	                   would not parse.  This permits keywords to sometimes
 154305 //	                   be used as identifiers, for example.
 154306 //	YYACTIONTYPE       is the data type used for "action codes" - numbers
 154307 //	                   that indicate what to do in response to the next
 154308 //	                   token.
 154309 //	sqlite3ParserTOKENTYPE     is the data type used for minor type for terminal
 154310 //	                   symbols.  Background: A "minor type" is a semantic
 154311 //	                   value associated with a terminal or non-terminal
 154312 //	                   symbols.  For example, for an "ID" terminal symbol,
 154313 //	                   the minor type might be the name of the identifier.
 154314 //	                   Each non-terminal can have a different minor type.
 154315 //	                   Terminal symbols all have the same minor type, though.
 154316 //	                   This macros defines the minor type for terminal
 154317 //	                   symbols.
 154318 //	YYMINORTYPE        is the data type used for all minor types.
 154319 //	                   This is typically a union of many types, one of
 154320 //	                   which is sqlite3ParserTOKENTYPE.  The entry in the union
 154321 //	                   for terminal symbols is called "yy0".
 154322 //	YYSTACKDEPTH       is the maximum depth of the parser's stack.  If
 154323 //	                   zero the stack is dynamically sized using realloc()
 154324 //	sqlite3ParserARG_SDECL     A static variable declaration for the %extra_argument
 154325 //	sqlite3ParserARG_PDECL     A parameter declaration for the %extra_argument
 154326 //	sqlite3ParserARG_PARAM     Code to pass %extra_argument as a subroutine parameter
 154327 //	sqlite3ParserARG_STORE     Code to store %extra_argument into yypParser
 154328 //	sqlite3ParserARG_FETCH     Code to extract %extra_argument from yypParser
 154329 //	sqlite3ParserCTX_*         As sqlite3ParserARG_ except for %extra_context
 154330 //	YYERRORSYMBOL      is the code number of the error symbol.  If not
 154331 //	                   defined, then do no error processing.
 154332 //	YYNSTATE           the combined number of states.
 154333 //	YYNRULE            the number of rules in the grammar
 154334 //	YYNTOKEN           Number of terminal symbols
 154335 //	YY_MAX_SHIFT       Maximum value for shift actions
 154336 //	YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions
 154337 //	YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions
 154338 //	YY_ERROR_ACTION    The yy_action[] code for syntax error
 154339 //	YY_ACCEPT_ACTION   The yy_action[] code for accept
 154340 //	YY_NO_ACTION       The yy_action[] code for no-op
 154341 //	YY_MIN_REDUCE      Minimum value for reduce actions
 154342 //	YY_MAX_REDUCE      Maximum value for reduce actions
 154343 //
 154344 // ************ Begin control #defines ****************************************
 154345 type YYMINORTYPE = struct {
 154346 	F__ccgo_pad1 [0]uint64
 154347 	Fyyinit      int32
 154348 	F__ccgo_pad2 [12]byte
 154349 }
 154350 
 154351 var yy_action = [2098]uint16{
 154352 	uint16(568), uint16(208), uint16(568), uint16(118), uint16(115), uint16(229), uint16(568), uint16(118), uint16(115), uint16(229),
 154353 	uint16(568), uint16(1314), uint16(377), uint16(1293), uint16(408), uint16(562), uint16(562), uint16(562), uint16(568), uint16(409),
 154354 	uint16(378), uint16(1314), uint16(1276), uint16(41), uint16(41), uint16(41), uint16(41), uint16(208), uint16(1526), uint16(71),
 154355 	uint16(71), uint16(971), uint16(419), uint16(41), uint16(41), uint16(491), uint16(303), uint16(279), uint16(303), uint16(972),
 154356 	uint16(397), uint16(71), uint16(71), uint16(125), uint16(126), uint16(80), uint16(1217), uint16(1217), uint16(1050), uint16(1053),
 154357 	uint16(1040), uint16(1040), uint16(123), uint16(123), uint16(124), uint16(124), uint16(124), uint16(124), uint16(476), uint16(409),
 154358 	uint16(1241), uint16(1), uint16(1), uint16(575), uint16(2), uint16(1245), uint16(550), uint16(118), uint16(115), uint16(229),
 154359 	uint16(317), uint16(480), uint16(146), uint16(480), uint16(524), uint16(118), uint16(115), uint16(229), uint16(529), uint16(1327),
 154360 	uint16(417), uint16(523), uint16(142), uint16(125), uint16(126), uint16(80), uint16(1217), uint16(1217), uint16(1050), uint16(1053),
 154361 	uint16(1040), uint16(1040), uint16(123), uint16(123), uint16(124), uint16(124), uint16(124), uint16(124), uint16(118), uint16(115),
 154362 	uint16(229), uint16(327), uint16(122), uint16(122), uint16(122), uint16(122), uint16(121), uint16(121), uint16(120), uint16(120),
 154363 	uint16(120), uint16(119), uint16(116), uint16(444), uint16(284), uint16(284), uint16(284), uint16(284), uint16(442), uint16(442),
 154364 	uint16(442), uint16(1567), uint16(376), uint16(1569), uint16(1192), uint16(375), uint16(1163), uint16(565), uint16(1163), uint16(565),
 154365 	uint16(409), uint16(1567), uint16(537), uint16(259), uint16(226), uint16(444), uint16(101), uint16(145), uint16(449), uint16(316),
 154366 	uint16(559), uint16(240), uint16(122), uint16(122), uint16(122), uint16(122), uint16(121), uint16(121), uint16(120), uint16(120),
 154367 	uint16(120), uint16(119), uint16(116), uint16(444), uint16(125), uint16(126), uint16(80), uint16(1217), uint16(1217), uint16(1050),
 154368 	uint16(1053), uint16(1040), uint16(1040), uint16(123), uint16(123), uint16(124), uint16(124), uint16(124), uint16(124), uint16(142),
 154369 	uint16(294), uint16(1192), uint16(339), uint16(448), uint16(120), uint16(120), uint16(120), uint16(119), uint16(116), uint16(444),
 154370 	uint16(127), uint16(1192), uint16(1193), uint16(1194), uint16(148), uint16(441), uint16(440), uint16(568), uint16(119), uint16(116),
 154371 	uint16(444), uint16(124), uint16(124), uint16(124), uint16(124), uint16(117), uint16(122), uint16(122), uint16(122), uint16(122),
 154372 	uint16(121), uint16(121), uint16(120), uint16(120), uint16(120), uint16(119), uint16(116), uint16(444), uint16(454), uint16(113),
 154373 	uint16(13), uint16(13), uint16(546), uint16(122), uint16(122), uint16(122), uint16(122), uint16(121), uint16(121), uint16(120),
 154374 	uint16(120), uint16(120), uint16(119), uint16(116), uint16(444), uint16(422), uint16(316), uint16(559), uint16(1192), uint16(1193),
 154375 	uint16(1194), uint16(149), uint16(1224), uint16(409), uint16(1224), uint16(124), uint16(124), uint16(124), uint16(124), uint16(122),
 154376 	uint16(122), uint16(122), uint16(122), uint16(121), uint16(121), uint16(120), uint16(120), uint16(120), uint16(119), uint16(116),
 154377 	uint16(444), uint16(465), uint16(342), uint16(1037), uint16(1037), uint16(1051), uint16(1054), uint16(125), uint16(126), uint16(80),
 154378 	uint16(1217), uint16(1217), uint16(1050), uint16(1053), uint16(1040), uint16(1040), uint16(123), uint16(123), uint16(124), uint16(124),
 154379 	uint16(124), uint16(124), uint16(1279), uint16(522), uint16(222), uint16(1192), uint16(568), uint16(409), uint16(224), uint16(514),
 154380 	uint16(175), uint16(82), uint16(83), uint16(122), uint16(122), uint16(122), uint16(122), uint16(121), uint16(121), uint16(120),
 154381 	uint16(120), uint16(120), uint16(119), uint16(116), uint16(444), uint16(1007), uint16(16), uint16(16), uint16(1192), uint16(133),
 154382 	uint16(133), uint16(125), uint16(126), uint16(80), uint16(1217), uint16(1217), uint16(1050), uint16(1053), uint16(1040), uint16(1040),
 154383 	uint16(123), uint16(123), uint16(124), uint16(124), uint16(124), uint16(124), uint16(122), uint16(122), uint16(122), uint16(122),
 154384 	uint16(121), uint16(121), uint16(120), uint16(120), uint16(120), uint16(119), uint16(116), uint16(444), uint16(1041), uint16(546),
 154385 	uint16(1192), uint16(373), uint16(1192), uint16(1193), uint16(1194), uint16(252), uint16(1434), uint16(399), uint16(504), uint16(501),
 154386 	uint16(500), uint16(111), uint16(560), uint16(566), uint16(4), uint16(926), uint16(926), uint16(433), uint16(499), uint16(340),
 154387 	uint16(460), uint16(328), uint16(360), uint16(394), uint16(1237), uint16(1192), uint16(1193), uint16(1194), uint16(563), uint16(568),
 154388 	uint16(122), uint16(122), uint16(122), uint16(122), uint16(121), uint16(121), uint16(120), uint16(120), uint16(120), uint16(119),
 154389 	uint16(116), uint16(444), uint16(284), uint16(284), uint16(369), uint16(1580), uint16(1607), uint16(441), uint16(440), uint16(154),
 154390 	uint16(409), uint16(445), uint16(71), uint16(71), uint16(1286), uint16(565), uint16(1221), uint16(1192), uint16(1193), uint16(1194),
 154391 	uint16(85), uint16(1223), uint16(271), uint16(557), uint16(543), uint16(515), uint16(1561), uint16(568), uint16(98), uint16(1222),
 154392 	uint16(6), uint16(1278), uint16(472), uint16(142), uint16(125), uint16(126), uint16(80), uint16(1217), uint16(1217), uint16(1050),
 154393 	uint16(1053), uint16(1040), uint16(1040), uint16(123), uint16(123), uint16(124), uint16(124), uint16(124), uint16(124), uint16(550),
 154394 	uint16(13), uint16(13), uint16(1027), uint16(507), uint16(1224), uint16(1192), uint16(1224), uint16(549), uint16(109), uint16(109),
 154395 	uint16(222), uint16(568), uint16(1238), uint16(175), uint16(568), uint16(427), uint16(110), uint16(197), uint16(445), uint16(570),
 154396 	uint16(569), uint16(430), uint16(1552), uint16(1017), uint16(325), uint16(551), uint16(1192), uint16(270), uint16(287), uint16(368),
 154397 	uint16(510), uint16(363), uint16(509), uint16(257), uint16(71), uint16(71), uint16(543), uint16(71), uint16(71), uint16(359),
 154398 	uint16(316), uint16(559), uint16(1613), uint16(122), uint16(122), uint16(122), uint16(122), uint16(121), uint16(121), uint16(120),
 154399 	uint16(120), uint16(120), uint16(119), uint16(116), uint16(444), uint16(1017), uint16(1017), uint16(1019), uint16(1020), uint16(27),
 154400 	uint16(284), uint16(284), uint16(1192), uint16(1193), uint16(1194), uint16(1158), uint16(568), uint16(1612), uint16(409), uint16(901),
 154401 	uint16(190), uint16(550), uint16(356), uint16(565), uint16(550), uint16(937), uint16(533), uint16(517), uint16(1158), uint16(516),
 154402 	uint16(413), uint16(1158), uint16(552), uint16(1192), uint16(1193), uint16(1194), uint16(568), uint16(544), uint16(1554), uint16(51),
 154403 	uint16(51), uint16(214), uint16(125), uint16(126), uint16(80), uint16(1217), uint16(1217), uint16(1050), uint16(1053), uint16(1040),
 154404 	uint16(1040), uint16(123), uint16(123), uint16(124), uint16(124), uint16(124), uint16(124), uint16(1192), uint16(474), uint16(135),
 154405 	uint16(135), uint16(409), uint16(284), uint16(284), uint16(1490), uint16(505), uint16(121), uint16(121), uint16(120), uint16(120),
 154406 	uint16(120), uint16(119), uint16(116), uint16(444), uint16(1007), uint16(565), uint16(518), uint16(217), uint16(541), uint16(1561),
 154407 	uint16(316), uint16(559), uint16(142), uint16(6), uint16(532), uint16(125), uint16(126), uint16(80), uint16(1217), uint16(1217),
 154408 	uint16(1050), uint16(1053), uint16(1040), uint16(1040), uint16(123), uint16(123), uint16(124), uint16(124), uint16(124), uint16(124),
 154409 	uint16(1555), uint16(122), uint16(122), uint16(122), uint16(122), uint16(121), uint16(121), uint16(120), uint16(120), uint16(120),
 154410 	uint16(119), uint16(116), uint16(444), uint16(485), uint16(1192), uint16(1193), uint16(1194), uint16(482), uint16(281), uint16(1267),
 154411 	uint16(957), uint16(252), uint16(1192), uint16(373), uint16(504), uint16(501), uint16(500), uint16(1192), uint16(340), uint16(571),
 154412 	uint16(1192), uint16(571), uint16(409), uint16(292), uint16(499), uint16(957), uint16(876), uint16(191), uint16(480), uint16(316),
 154413 	uint16(559), uint16(384), uint16(290), uint16(380), uint16(122), uint16(122), uint16(122), uint16(122), uint16(121), uint16(121),
 154414 	uint16(120), uint16(120), uint16(120), uint16(119), uint16(116), uint16(444), uint16(125), uint16(126), uint16(80), uint16(1217),
 154415 	uint16(1217), uint16(1050), uint16(1053), uint16(1040), uint16(1040), uint16(123), uint16(123), uint16(124), uint16(124), uint16(124),
 154416 	uint16(124), uint16(409), uint16(394), uint16(1136), uint16(1192), uint16(869), uint16(100), uint16(284), uint16(284), uint16(1192),
 154417 	uint16(1193), uint16(1194), uint16(373), uint16(1093), uint16(1192), uint16(1193), uint16(1194), uint16(1192), uint16(1193), uint16(1194),
 154418 	uint16(565), uint16(455), uint16(32), uint16(373), uint16(233), uint16(125), uint16(126), uint16(80), uint16(1217), uint16(1217),
 154419 	uint16(1050), uint16(1053), uint16(1040), uint16(1040), uint16(123), uint16(123), uint16(124), uint16(124), uint16(124), uint16(124),
 154420 	uint16(1433), uint16(959), uint16(568), uint16(228), uint16(958), uint16(122), uint16(122), uint16(122), uint16(122), uint16(121),
 154421 	uint16(121), uint16(120), uint16(120), uint16(120), uint16(119), uint16(116), uint16(444), uint16(1158), uint16(228), uint16(1192),
 154422 	uint16(157), uint16(1192), uint16(1193), uint16(1194), uint16(1553), uint16(13), uint16(13), uint16(301), uint16(957), uint16(1232),
 154423 	uint16(1158), uint16(153), uint16(409), uint16(1158), uint16(373), uint16(1583), uint16(1176), uint16(5), uint16(369), uint16(1580),
 154424 	uint16(429), uint16(1238), uint16(3), uint16(957), uint16(122), uint16(122), uint16(122), uint16(122), uint16(121), uint16(121),
 154425 	uint16(120), uint16(120), uint16(120), uint16(119), uint16(116), uint16(444), uint16(125), uint16(126), uint16(80), uint16(1217),
 154426 	uint16(1217), uint16(1050), uint16(1053), uint16(1040), uint16(1040), uint16(123), uint16(123), uint16(124), uint16(124), uint16(124),
 154427 	uint16(124), uint16(409), uint16(208), uint16(567), uint16(1192), uint16(1028), uint16(1192), uint16(1193), uint16(1194), uint16(1192),
 154428 	uint16(388), uint16(852), uint16(155), uint16(1552), uint16(286), uint16(402), uint16(1098), uint16(1098), uint16(488), uint16(568),
 154429 	uint16(465), uint16(342), uint16(1319), uint16(1319), uint16(1552), uint16(125), uint16(126), uint16(80), uint16(1217), uint16(1217),
 154430 	uint16(1050), uint16(1053), uint16(1040), uint16(1040), uint16(123), uint16(123), uint16(124), uint16(124), uint16(124), uint16(124),
 154431 	uint16(129), uint16(568), uint16(13), uint16(13), uint16(374), uint16(122), uint16(122), uint16(122), uint16(122), uint16(121),
 154432 	uint16(121), uint16(120), uint16(120), uint16(120), uint16(119), uint16(116), uint16(444), uint16(302), uint16(568), uint16(453),
 154433 	uint16(528), uint16(1192), uint16(1193), uint16(1194), uint16(13), uint16(13), uint16(1192), uint16(1193), uint16(1194), uint16(1297),
 154434 	uint16(463), uint16(1267), uint16(409), uint16(1317), uint16(1317), uint16(1552), uint16(1012), uint16(453), uint16(452), uint16(200),
 154435 	uint16(299), uint16(71), uint16(71), uint16(1265), uint16(122), uint16(122), uint16(122), uint16(122), uint16(121), uint16(121),
 154436 	uint16(120), uint16(120), uint16(120), uint16(119), uint16(116), uint16(444), uint16(125), uint16(126), uint16(80), uint16(1217),
 154437 	uint16(1217), uint16(1050), uint16(1053), uint16(1040), uint16(1040), uint16(123), uint16(123), uint16(124), uint16(124), uint16(124),
 154438 	uint16(124), uint16(409), uint16(227), uint16(1073), uint16(1158), uint16(284), uint16(284), uint16(419), uint16(312), uint16(278),
 154439 	uint16(278), uint16(285), uint16(285), uint16(1419), uint16(406), uint16(405), uint16(382), uint16(1158), uint16(565), uint16(568),
 154440 	uint16(1158), uint16(1196), uint16(565), uint16(1600), uint16(565), uint16(125), uint16(126), uint16(80), uint16(1217), uint16(1217),
 154441 	uint16(1050), uint16(1053), uint16(1040), uint16(1040), uint16(123), uint16(123), uint16(124), uint16(124), uint16(124), uint16(124),
 154442 	uint16(453), uint16(1482), uint16(13), uint16(13), uint16(1536), uint16(122), uint16(122), uint16(122), uint16(122), uint16(121),
 154443 	uint16(121), uint16(120), uint16(120), uint16(120), uint16(119), uint16(116), uint16(444), uint16(201), uint16(568), uint16(354),
 154444 	uint16(1586), uint16(575), uint16(2), uint16(1245), uint16(840), uint16(841), uint16(842), uint16(1562), uint16(317), uint16(1212),
 154445 	uint16(146), uint16(6), uint16(409), uint16(255), uint16(254), uint16(253), uint16(206), uint16(1327), uint16(9), uint16(1196),
 154446 	uint16(262), uint16(71), uint16(71), uint16(424), uint16(122), uint16(122), uint16(122), uint16(122), uint16(121), uint16(121),
 154447 	uint16(120), uint16(120), uint16(120), uint16(119), uint16(116), uint16(444), uint16(125), uint16(126), uint16(80), uint16(1217),
 154448 	uint16(1217), uint16(1050), uint16(1053), uint16(1040), uint16(1040), uint16(123), uint16(123), uint16(124), uint16(124), uint16(124),
 154449 	uint16(124), uint16(568), uint16(284), uint16(284), uint16(568), uint16(1213), uint16(409), uint16(574), uint16(313), uint16(1245),
 154450 	uint16(349), uint16(1296), uint16(352), uint16(419), uint16(317), uint16(565), uint16(146), uint16(491), uint16(525), uint16(1643),
 154451 	uint16(395), uint16(371), uint16(491), uint16(1327), uint16(70), uint16(70), uint16(1295), uint16(71), uint16(71), uint16(240),
 154452 	uint16(1325), uint16(104), uint16(80), uint16(1217), uint16(1217), uint16(1050), uint16(1053), uint16(1040), uint16(1040), uint16(123),
 154453 	uint16(123), uint16(124), uint16(124), uint16(124), uint16(124), uint16(122), uint16(122), uint16(122), uint16(122), uint16(121),
 154454 	uint16(121), uint16(120), uint16(120), uint16(120), uint16(119), uint16(116), uint16(444), uint16(1114), uint16(284), uint16(284),
 154455 	uint16(428), uint16(448), uint16(1525), uint16(1213), uint16(439), uint16(284), uint16(284), uint16(1489), uint16(1352), uint16(311),
 154456 	uint16(474), uint16(565), uint16(1115), uint16(971), uint16(491), uint16(491), uint16(217), uint16(1263), uint16(565), uint16(1538),
 154457 	uint16(568), uint16(972), uint16(207), uint16(568), uint16(1027), uint16(240), uint16(383), uint16(1116), uint16(519), uint16(122),
 154458 	uint16(122), uint16(122), uint16(122), uint16(121), uint16(121), uint16(120), uint16(120), uint16(120), uint16(119), uint16(116),
 154459 	uint16(444), uint16(1018), uint16(107), uint16(71), uint16(71), uint16(1017), uint16(13), uint16(13), uint16(912), uint16(568),
 154460 	uint16(1495), uint16(568), uint16(284), uint16(284), uint16(97), uint16(526), uint16(491), uint16(448), uint16(913), uint16(1326),
 154461 	uint16(1322), uint16(545), uint16(409), uint16(284), uint16(284), uint16(565), uint16(151), uint16(209), uint16(1495), uint16(1497),
 154462 	uint16(262), uint16(450), uint16(55), uint16(55), uint16(56), uint16(56), uint16(565), uint16(1017), uint16(1017), uint16(1019),
 154463 	uint16(443), uint16(332), uint16(409), uint16(527), uint16(12), uint16(295), uint16(125), uint16(126), uint16(80), uint16(1217),
 154464 	uint16(1217), uint16(1050), uint16(1053), uint16(1040), uint16(1040), uint16(123), uint16(123), uint16(124), uint16(124), uint16(124),
 154465 	uint16(124), uint16(347), uint16(409), uint16(864), uint16(1534), uint16(1213), uint16(125), uint16(126), uint16(80), uint16(1217),
 154466 	uint16(1217), uint16(1050), uint16(1053), uint16(1040), uint16(1040), uint16(123), uint16(123), uint16(124), uint16(124), uint16(124),
 154467 	uint16(124), uint16(1137), uint16(1641), uint16(474), uint16(1641), uint16(371), uint16(125), uint16(114), uint16(80), uint16(1217),
 154468 	uint16(1217), uint16(1050), uint16(1053), uint16(1040), uint16(1040), uint16(123), uint16(123), uint16(124), uint16(124), uint16(124),
 154469 	uint16(124), uint16(1495), uint16(329), uint16(474), uint16(331), uint16(122), uint16(122), uint16(122), uint16(122), uint16(121),
 154470 	uint16(121), uint16(120), uint16(120), uint16(120), uint16(119), uint16(116), uint16(444), uint16(203), uint16(1419), uint16(568),
 154471 	uint16(1294), uint16(864), uint16(464), uint16(1213), uint16(436), uint16(122), uint16(122), uint16(122), uint16(122), uint16(121),
 154472 	uint16(121), uint16(120), uint16(120), uint16(120), uint16(119), uint16(116), uint16(444), uint16(553), uint16(1137), uint16(1642),
 154473 	uint16(539), uint16(1642), uint16(15), uint16(15), uint16(892), uint16(122), uint16(122), uint16(122), uint16(122), uint16(121),
 154474 	uint16(121), uint16(120), uint16(120), uint16(120), uint16(119), uint16(116), uint16(444), uint16(568), uint16(298), uint16(538),
 154475 	uint16(1135), uint16(1419), uint16(1559), uint16(1560), uint16(1331), uint16(409), uint16(6), uint16(6), uint16(1169), uint16(1268),
 154476 	uint16(415), uint16(320), uint16(284), uint16(284), uint16(1419), uint16(508), uint16(565), uint16(525), uint16(300), uint16(457),
 154477 	uint16(43), uint16(43), uint16(568), uint16(893), uint16(12), uint16(565), uint16(330), uint16(478), uint16(425), uint16(407),
 154478 	uint16(126), uint16(80), uint16(1217), uint16(1217), uint16(1050), uint16(1053), uint16(1040), uint16(1040), uint16(123), uint16(123),
 154479 	uint16(124), uint16(124), uint16(124), uint16(124), uint16(568), uint16(57), uint16(57), uint16(288), uint16(1192), uint16(1419),
 154480 	uint16(496), uint16(458), uint16(392), uint16(392), uint16(391), uint16(273), uint16(389), uint16(1135), uint16(1558), uint16(849),
 154481 	uint16(1169), uint16(407), uint16(6), uint16(568), uint16(321), uint16(1158), uint16(470), uint16(44), uint16(44), uint16(1557),
 154482 	uint16(1114), uint16(426), uint16(234), uint16(6), uint16(323), uint16(256), uint16(540), uint16(256), uint16(1158), uint16(431),
 154483 	uint16(568), uint16(1158), uint16(322), uint16(17), uint16(487), uint16(1115), uint16(58), uint16(58), uint16(122), uint16(122),
 154484 	uint16(122), uint16(122), uint16(121), uint16(121), uint16(120), uint16(120), uint16(120), uint16(119), uint16(116), uint16(444),
 154485 	uint16(1116), uint16(216), uint16(481), uint16(59), uint16(59), uint16(1192), uint16(1193), uint16(1194), uint16(111), uint16(560),
 154486 	uint16(324), uint16(4), uint16(236), uint16(456), uint16(526), uint16(568), uint16(237), uint16(456), uint16(568), uint16(437),
 154487 	uint16(168), uint16(556), uint16(420), uint16(141), uint16(479), uint16(563), uint16(568), uint16(293), uint16(568), uint16(1095),
 154488 	uint16(568), uint16(293), uint16(568), uint16(1095), uint16(531), uint16(568), uint16(872), uint16(8), uint16(60), uint16(60),
 154489 	uint16(235), uint16(61), uint16(61), uint16(568), uint16(414), uint16(568), uint16(414), uint16(568), uint16(445), uint16(62),
 154490 	uint16(62), uint16(45), uint16(45), uint16(46), uint16(46), uint16(47), uint16(47), uint16(199), uint16(49), uint16(49),
 154491 	uint16(557), uint16(568), uint16(359), uint16(568), uint16(100), uint16(486), uint16(50), uint16(50), uint16(63), uint16(63),
 154492 	uint16(64), uint16(64), uint16(561), uint16(415), uint16(535), uint16(410), uint16(568), uint16(1027), uint16(568), uint16(534),
 154493 	uint16(316), uint16(559), uint16(316), uint16(559), uint16(65), uint16(65), uint16(14), uint16(14), uint16(568), uint16(1027),
 154494 	uint16(568), uint16(512), uint16(932), uint16(872), uint16(1018), uint16(109), uint16(109), uint16(931), uint16(1017), uint16(66),
 154495 	uint16(66), uint16(131), uint16(131), uint16(110), uint16(451), uint16(445), uint16(570), uint16(569), uint16(416), uint16(177),
 154496 	uint16(1017), uint16(132), uint16(132), uint16(67), uint16(67), uint16(568), uint16(467), uint16(568), uint16(932), uint16(471),
 154497 	uint16(1364), uint16(283), uint16(226), uint16(931), uint16(315), uint16(1363), uint16(407), uint16(568), uint16(459), uint16(407),
 154498 	uint16(1017), uint16(1017), uint16(1019), uint16(239), uint16(407), uint16(86), uint16(213), uint16(1350), uint16(52), uint16(52),
 154499 	uint16(68), uint16(68), uint16(1017), uint16(1017), uint16(1019), uint16(1020), uint16(27), uint16(1585), uint16(1180), uint16(447),
 154500 	uint16(69), uint16(69), uint16(288), uint16(97), uint16(108), uint16(1541), uint16(106), uint16(392), uint16(392), uint16(391),
 154501 	uint16(273), uint16(389), uint16(568), uint16(879), uint16(849), uint16(883), uint16(568), uint16(111), uint16(560), uint16(466),
 154502 	uint16(4), uint16(568), uint16(152), uint16(30), uint16(38), uint16(568), uint16(1132), uint16(234), uint16(396), uint16(323),
 154503 	uint16(111), uint16(560), uint16(527), uint16(4), uint16(563), uint16(53), uint16(53), uint16(322), uint16(568), uint16(163),
 154504 	uint16(163), uint16(568), uint16(337), uint16(468), uint16(164), uint16(164), uint16(333), uint16(563), uint16(76), uint16(76),
 154505 	uint16(568), uint16(289), uint16(1514), uint16(568), uint16(31), uint16(1513), uint16(568), uint16(445), uint16(338), uint16(483),
 154506 	uint16(100), uint16(54), uint16(54), uint16(344), uint16(72), uint16(72), uint16(296), uint16(236), uint16(1080), uint16(557),
 154507 	uint16(445), uint16(879), uint16(1360), uint16(134), uint16(134), uint16(168), uint16(73), uint16(73), uint16(141), uint16(161),
 154508 	uint16(161), uint16(1574), uint16(557), uint16(535), uint16(568), uint16(319), uint16(568), uint16(348), uint16(536), uint16(1009),
 154509 	uint16(473), uint16(261), uint16(261), uint16(891), uint16(890), uint16(235), uint16(535), uint16(568), uint16(1027), uint16(568),
 154510 	uint16(475), uint16(534), uint16(261), uint16(367), uint16(109), uint16(109), uint16(521), uint16(136), uint16(136), uint16(130),
 154511 	uint16(130), uint16(1027), uint16(110), uint16(366), uint16(445), uint16(570), uint16(569), uint16(109), uint16(109), uint16(1017),
 154512 	uint16(162), uint16(162), uint16(156), uint16(156), uint16(568), uint16(110), uint16(1080), uint16(445), uint16(570), uint16(569),
 154513 	uint16(410), uint16(351), uint16(1017), uint16(568), uint16(353), uint16(316), uint16(559), uint16(568), uint16(343), uint16(568),
 154514 	uint16(100), uint16(497), uint16(357), uint16(258), uint16(100), uint16(898), uint16(899), uint16(140), uint16(140), uint16(355),
 154515 	uint16(1310), uint16(1017), uint16(1017), uint16(1019), uint16(1020), uint16(27), uint16(139), uint16(139), uint16(362), uint16(451),
 154516 	uint16(137), uint16(137), uint16(138), uint16(138), uint16(1017), uint16(1017), uint16(1019), uint16(1020), uint16(27), uint16(1180),
 154517 	uint16(447), uint16(568), uint16(372), uint16(288), uint16(111), uint16(560), uint16(1021), uint16(4), uint16(392), uint16(392),
 154518 	uint16(391), uint16(273), uint16(389), uint16(568), uint16(1141), uint16(849), uint16(568), uint16(1076), uint16(568), uint16(258),
 154519 	uint16(492), uint16(563), uint16(568), uint16(211), uint16(75), uint16(75), uint16(555), uint16(962), uint16(234), uint16(261),
 154520 	uint16(323), uint16(111), uint16(560), uint16(929), uint16(4), uint16(113), uint16(77), uint16(77), uint16(322), uint16(74),
 154521 	uint16(74), uint16(42), uint16(42), uint16(1373), uint16(445), uint16(48), uint16(48), uint16(1418), uint16(563), uint16(974),
 154522 	uint16(975), uint16(1092), uint16(1091), uint16(1092), uint16(1091), uint16(862), uint16(557), uint16(150), uint16(930), uint16(1346),
 154523 	uint16(113), uint16(1358), uint16(554), uint16(1424), uint16(1021), uint16(1275), uint16(1266), uint16(1254), uint16(236), uint16(1253),
 154524 	uint16(1255), uint16(445), uint16(1593), uint16(1343), uint16(308), uint16(276), uint16(168), uint16(309), uint16(11), uint16(141),
 154525 	uint16(393), uint16(310), uint16(232), uint16(557), uint16(1405), uint16(1027), uint16(335), uint16(291), uint16(1400), uint16(219),
 154526 	uint16(336), uint16(109), uint16(109), uint16(936), uint16(297), uint16(1410), uint16(235), uint16(341), uint16(477), uint16(110),
 154527 	uint16(502), uint16(445), uint16(570), uint16(569), uint16(1393), uint16(1409), uint16(1017), uint16(400), uint16(1293), uint16(365),
 154528 	uint16(223), uint16(1486), uint16(1027), uint16(1485), uint16(1355), uint16(1356), uint16(1354), uint16(1353), uint16(109), uint16(109),
 154529 	uint16(204), uint16(1596), uint16(1232), uint16(558), uint16(265), uint16(218), uint16(110), uint16(205), uint16(445), uint16(570),
 154530 	uint16(569), uint16(410), uint16(387), uint16(1017), uint16(1533), uint16(179), uint16(316), uint16(559), uint16(1017), uint16(1017),
 154531 	uint16(1019), uint16(1020), uint16(27), uint16(230), uint16(1531), uint16(1229), uint16(79), uint16(560), uint16(85), uint16(4),
 154532 	uint16(418), uint16(215), uint16(548), uint16(81), uint16(84), uint16(188), uint16(1406), uint16(173), uint16(181), uint16(461),
 154533 	uint16(451), uint16(35), uint16(462), uint16(563), uint16(183), uint16(1017), uint16(1017), uint16(1019), uint16(1020), uint16(27),
 154534 	uint16(184), uint16(1491), uint16(185), uint16(186), uint16(495), uint16(242), uint16(98), uint16(398), uint16(1412), uint16(36),
 154535 	uint16(1411), uint16(484), uint16(91), uint16(469), uint16(401), uint16(1414), uint16(445), uint16(192), uint16(1480), uint16(246),
 154536 	uint16(1502), uint16(490), uint16(346), uint16(277), uint16(248), uint16(196), uint16(493), uint16(511), uint16(557), uint16(350),
 154537 	uint16(1256), uint16(249), uint16(250), uint16(403), uint16(1313), uint16(1312), uint16(111), uint16(560), uint16(432), uint16(4),
 154538 	uint16(1311), uint16(1304), uint16(93), uint16(1611), uint16(883), uint16(1610), uint16(224), uint16(404), uint16(434), uint16(520),
 154539 	uint16(263), uint16(435), uint16(1579), uint16(563), uint16(1283), uint16(1282), uint16(364), uint16(1027), uint16(306), uint16(1281),
 154540 	uint16(264), uint16(1609), uint16(1565), uint16(109), uint16(109), uint16(370), uint16(1303), uint16(307), uint16(1564), uint16(438),
 154541 	uint16(128), uint16(110), uint16(1378), uint16(445), uint16(570), uint16(569), uint16(445), uint16(546), uint16(1017), uint16(10),
 154542 	uint16(1466), uint16(105), uint16(381), uint16(1377), uint16(34), uint16(572), uint16(99), uint16(1336), uint16(557), uint16(314),
 154543 	uint16(1186), uint16(530), uint16(272), uint16(274), uint16(379), uint16(210), uint16(1335), uint16(547), uint16(385), uint16(386),
 154544 	uint16(275), uint16(573), uint16(1251), uint16(1246), uint16(411), uint16(412), uint16(1518), uint16(165), uint16(178), uint16(1519),
 154545 	uint16(1017), uint16(1017), uint16(1019), uint16(1020), uint16(27), uint16(1517), uint16(1516), uint16(1027), uint16(78), uint16(147),
 154546 	uint16(166), uint16(220), uint16(221), uint16(109), uint16(109), uint16(836), uint16(304), uint16(167), uint16(446), uint16(212),
 154547 	uint16(318), uint16(110), uint16(231), uint16(445), uint16(570), uint16(569), uint16(144), uint16(1090), uint16(1017), uint16(1088),
 154548 	uint16(326), uint16(180), uint16(169), uint16(1212), uint16(182), uint16(334), uint16(238), uint16(915), uint16(241), uint16(1104),
 154549 	uint16(187), uint16(170), uint16(171), uint16(421), uint16(87), uint16(88), uint16(423), uint16(189), uint16(89), uint16(90),
 154550 	uint16(172), uint16(1107), uint16(243), uint16(1103), uint16(244), uint16(158), uint16(18), uint16(245), uint16(345), uint16(247),
 154551 	uint16(1017), uint16(1017), uint16(1019), uint16(1020), uint16(27), uint16(261), uint16(1096), uint16(193), uint16(1226), uint16(489),
 154552 	uint16(194), uint16(37), uint16(366), uint16(851), uint16(494), uint16(251), uint16(195), uint16(506), uint16(92), uint16(19),
 154553 	uint16(498), uint16(358), uint16(20), uint16(503), uint16(881), uint16(361), uint16(94), uint16(894), uint16(305), uint16(159),
 154554 	uint16(513), uint16(39), uint16(95), uint16(1174), uint16(160), uint16(1056), uint16(966), uint16(1143), uint16(96), uint16(174),
 154555 	uint16(1142), uint16(225), uint16(280), uint16(282), uint16(198), uint16(960), uint16(113), uint16(1164), uint16(1160), uint16(260),
 154556 	uint16(21), uint16(22), uint16(23), uint16(1162), uint16(1168), uint16(1167), uint16(1148), uint16(24), uint16(33), uint16(25),
 154557 	uint16(202), uint16(542), uint16(26), uint16(100), uint16(1071), uint16(102), uint16(1057), uint16(103), uint16(7), uint16(1055),
 154558 	uint16(1059), uint16(1113), uint16(1060), uint16(1112), uint16(266), uint16(267), uint16(28), uint16(40), uint16(390), uint16(1022),
 154559 	uint16(863), uint16(112), uint16(29), uint16(564), uint16(1182), uint16(1181), uint16(268), uint16(176), uint16(143), uint16(925),
 154560 	uint16(1242), uint16(1242), uint16(1242), uint16(1242), uint16(1242), uint16(1242), uint16(1242), uint16(1242), uint16(1242), uint16(1242),
 154561 	uint16(1242), uint16(1242), uint16(1242), uint16(1242), uint16(269), uint16(1602), uint16(1242), uint16(1601),
 154562 }
 154563 var yy_lookahead = [2283]uint16{
 154564 	uint16(193), uint16(193), uint16(193), uint16(274), uint16(275), uint16(276), uint16(193), uint16(274), uint16(275), uint16(276),
 154565 	uint16(193), uint16(223), uint16(219), uint16(225), uint16(206), uint16(210), uint16(211), uint16(212), uint16(193), uint16(19),
 154566 	uint16(219), uint16(233), uint16(216), uint16(216), uint16(217), uint16(216), uint16(217), uint16(193), uint16(295), uint16(216),
 154567 	uint16(217), uint16(31), uint16(193), uint16(216), uint16(217), uint16(193), uint16(228), uint16(213), uint16(230), uint16(39),
 154568 	uint16(206), uint16(216), uint16(217), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49),
 154569 	uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(193), uint16(19),
 154570 	uint16(185), uint16(186), uint16(187), uint16(188), uint16(189), uint16(190), uint16(253), uint16(274), uint16(275), uint16(276),
 154571 	uint16(195), uint16(193), uint16(197), uint16(193), uint16(261), uint16(274), uint16(275), uint16(276), uint16(253), uint16(204),
 154572 	uint16(238), uint16(204), uint16(81), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49),
 154573 	uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(274), uint16(275),
 154574 	uint16(276), uint16(262), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109),
 154575 	uint16(110), uint16(111), uint16(112), uint16(113), uint16(239), uint16(240), uint16(239), uint16(240), uint16(210), uint16(211),
 154576 	uint16(212), uint16(314), uint16(315), uint16(314), uint16(59), uint16(316), uint16(86), uint16(252), uint16(88), uint16(252),
 154577 	uint16(19), uint16(314), uint16(315), uint16(256), uint16(257), uint16(113), uint16(25), uint16(72), uint16(296), uint16(138),
 154578 	uint16(139), uint16(266), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109),
 154579 	uint16(110), uint16(111), uint16(112), uint16(113), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48),
 154580 	uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(81),
 154581 	uint16(292), uint16(59), uint16(292), uint16(298), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(113),
 154582 	uint16(69), uint16(116), uint16(117), uint16(118), uint16(72), uint16(106), uint16(107), uint16(193), uint16(111), uint16(112),
 154583 	uint16(113), uint16(54), uint16(55), uint16(56), uint16(57), uint16(58), uint16(102), uint16(103), uint16(104), uint16(105),
 154584 	uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(113), uint16(120), uint16(25),
 154585 	uint16(216), uint16(217), uint16(145), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108),
 154586 	uint16(109), uint16(110), uint16(111), uint16(112), uint16(113), uint16(231), uint16(138), uint16(139), uint16(116), uint16(117),
 154587 	uint16(118), uint16(164), uint16(153), uint16(19), uint16(155), uint16(54), uint16(55), uint16(56), uint16(57), uint16(102),
 154588 	uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112),
 154589 	uint16(113), uint16(128), uint16(129), uint16(46), uint16(47), uint16(48), uint16(49), uint16(43), uint16(44), uint16(45),
 154590 	uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55),
 154591 	uint16(56), uint16(57), uint16(216), uint16(193), uint16(25), uint16(59), uint16(193), uint16(19), uint16(165), uint16(166),
 154592 	uint16(193), uint16(67), uint16(24), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108),
 154593 	uint16(109), uint16(110), uint16(111), uint16(112), uint16(113), uint16(73), uint16(216), uint16(217), uint16(59), uint16(216),
 154594 	uint16(217), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51),
 154595 	uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(102), uint16(103), uint16(104), uint16(105),
 154596 	uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(113), uint16(121), uint16(145),
 154597 	uint16(59), uint16(193), uint16(116), uint16(117), uint16(118), uint16(119), uint16(273), uint16(204), uint16(122), uint16(123),
 154598 	uint16(124), uint16(19), uint16(20), uint16(134), uint16(22), uint16(136), uint16(137), uint16(19), uint16(132), uint16(127),
 154599 	uint16(128), uint16(129), uint16(24), uint16(22), uint16(23), uint16(116), uint16(117), uint16(118), uint16(36), uint16(193),
 154600 	uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111),
 154601 	uint16(112), uint16(113), uint16(239), uint16(240), uint16(311), uint16(312), uint16(215), uint16(106), uint16(107), uint16(241),
 154602 	uint16(19), uint16(59), uint16(216), uint16(217), uint16(223), uint16(252), uint16(115), uint16(116), uint16(117), uint16(118),
 154603 	uint16(151), uint16(120), uint16(26), uint16(71), uint16(193), uint16(308), uint16(309), uint16(193), uint16(149), uint16(128),
 154604 	uint16(313), uint16(216), uint16(269), uint16(81), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48),
 154605 	uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(253),
 154606 	uint16(216), uint16(217), uint16(100), uint16(95), uint16(153), uint16(59), uint16(155), uint16(261), uint16(106), uint16(107),
 154607 	uint16(25), uint16(193), uint16(101), uint16(193), uint16(193), uint16(231), uint16(114), uint16(25), uint16(116), uint16(117),
 154608 	uint16(118), uint16(113), uint16(304), uint16(121), uint16(193), uint16(204), uint16(59), uint16(119), uint16(120), uint16(121),
 154609 	uint16(122), uint16(123), uint16(124), uint16(125), uint16(216), uint16(217), uint16(193), uint16(216), uint16(217), uint16(131),
 154610 	uint16(138), uint16(139), uint16(230), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108),
 154611 	uint16(109), uint16(110), uint16(111), uint16(112), uint16(113), uint16(153), uint16(154), uint16(155), uint16(156), uint16(157),
 154612 	uint16(239), uint16(240), uint16(116), uint16(117), uint16(118), uint16(76), uint16(193), uint16(23), uint16(19), uint16(25),
 154613 	uint16(22), uint16(253), uint16(23), uint16(252), uint16(253), uint16(108), uint16(87), uint16(204), uint16(89), uint16(261),
 154614 	uint16(198), uint16(92), uint16(261), uint16(116), uint16(117), uint16(118), uint16(193), uint16(306), uint16(307), uint16(216),
 154615 	uint16(217), uint16(150), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50),
 154616 	uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(59), uint16(193), uint16(216),
 154617 	uint16(217), uint16(19), uint16(239), uint16(240), uint16(283), uint16(23), uint16(106), uint16(107), uint16(108), uint16(109),
 154618 	uint16(110), uint16(111), uint16(112), uint16(113), uint16(73), uint16(252), uint16(253), uint16(142), uint16(308), uint16(309),
 154619 	uint16(138), uint16(139), uint16(81), uint16(313), uint16(145), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47),
 154620 	uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57),
 154621 	uint16(307), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110),
 154622 	uint16(111), uint16(112), uint16(113), uint16(281), uint16(116), uint16(117), uint16(118), uint16(285), uint16(23), uint16(193),
 154623 	uint16(25), uint16(119), uint16(59), uint16(193), uint16(122), uint16(123), uint16(124), uint16(59), uint16(127), uint16(203),
 154624 	uint16(59), uint16(205), uint16(19), uint16(268), uint16(132), uint16(25), uint16(23), uint16(22), uint16(193), uint16(138),
 154625 	uint16(139), uint16(249), uint16(204), uint16(251), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107),
 154626 	uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(113), uint16(43), uint16(44), uint16(45), uint16(46),
 154627 	uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56),
 154628 	uint16(57), uint16(19), uint16(22), uint16(23), uint16(59), uint16(23), uint16(25), uint16(239), uint16(240), uint16(116),
 154629 	uint16(117), uint16(118), uint16(193), uint16(11), uint16(116), uint16(117), uint16(118), uint16(116), uint16(117), uint16(118),
 154630 	uint16(252), uint16(269), uint16(22), uint16(193), uint16(15), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47),
 154631 	uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57),
 154632 	uint16(273), uint16(143), uint16(193), uint16(118), uint16(143), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106),
 154633 	uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(113), uint16(76), uint16(118), uint16(59),
 154634 	uint16(241), uint16(116), uint16(117), uint16(118), uint16(304), uint16(216), uint16(217), uint16(292), uint16(143), uint16(60),
 154635 	uint16(89), uint16(241), uint16(19), uint16(92), uint16(193), uint16(193), uint16(23), uint16(22), uint16(311), uint16(312),
 154636 	uint16(231), uint16(101), uint16(22), uint16(143), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107),
 154637 	uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(113), uint16(43), uint16(44), uint16(45), uint16(46),
 154638 	uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56),
 154639 	uint16(57), uint16(19), uint16(193), uint16(193), uint16(59), uint16(23), uint16(116), uint16(117), uint16(118), uint16(59),
 154640 	uint16(201), uint16(21), uint16(241), uint16(304), uint16(22), uint16(206), uint16(127), uint16(128), uint16(129), uint16(193),
 154641 	uint16(128), uint16(129), uint16(235), uint16(236), uint16(304), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47),
 154642 	uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57),
 154643 	uint16(22), uint16(193), uint16(216), uint16(217), uint16(193), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106),
 154644 	uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(113), uint16(231), uint16(193), uint16(193),
 154645 	uint16(193), uint16(116), uint16(117), uint16(118), uint16(216), uint16(217), uint16(116), uint16(117), uint16(118), uint16(226),
 154646 	uint16(80), uint16(193), uint16(19), uint16(235), uint16(236), uint16(304), uint16(23), uint16(211), uint16(212), uint16(231),
 154647 	uint16(204), uint16(216), uint16(217), uint16(205), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107),
 154648 	uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(113), uint16(43), uint16(44), uint16(45), uint16(46),
 154649 	uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56),
 154650 	uint16(57), uint16(19), uint16(193), uint16(123), uint16(76), uint16(239), uint16(240), uint16(193), uint16(253), uint16(239),
 154651 	uint16(240), uint16(239), uint16(240), uint16(193), uint16(106), uint16(107), uint16(193), uint16(89), uint16(252), uint16(193),
 154652 	uint16(92), uint16(59), uint16(252), uint16(141), uint16(252), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47),
 154653 	uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57),
 154654 	uint16(284), uint16(161), uint16(216), uint16(217), uint16(193), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106),
 154655 	uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(113), uint16(231), uint16(193), uint16(16),
 154656 	uint16(187), uint16(188), uint16(189), uint16(190), uint16(7), uint16(8), uint16(9), uint16(309), uint16(195), uint16(25),
 154657 	uint16(197), uint16(313), uint16(19), uint16(127), uint16(128), uint16(129), uint16(262), uint16(204), uint16(22), uint16(117),
 154658 	uint16(24), uint16(216), uint16(217), uint16(263), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107),
 154659 	uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(113), uint16(43), uint16(44), uint16(45), uint16(46),
 154660 	uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56),
 154661 	uint16(57), uint16(193), uint16(239), uint16(240), uint16(193), uint16(59), uint16(19), uint16(188), uint16(253), uint16(190),
 154662 	uint16(77), uint16(226), uint16(79), uint16(193), uint16(195), uint16(252), uint16(197), uint16(193), uint16(19), uint16(301),
 154663 	uint16(302), uint16(193), uint16(193), uint16(204), uint16(216), uint16(217), uint16(226), uint16(216), uint16(217), uint16(266),
 154664 	uint16(204), uint16(159), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52),
 154665 	uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106),
 154666 	uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(113), uint16(12), uint16(239), uint16(240),
 154667 	uint16(232), uint16(298), uint16(238), uint16(117), uint16(253), uint16(239), uint16(240), uint16(238), uint16(259), uint16(260),
 154668 	uint16(193), uint16(252), uint16(27), uint16(31), uint16(193), uint16(193), uint16(142), uint16(204), uint16(252), uint16(193),
 154669 	uint16(193), uint16(39), uint16(262), uint16(193), uint16(100), uint16(266), uint16(278), uint16(42), uint16(204), uint16(102),
 154670 	uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112),
 154671 	uint16(113), uint16(117), uint16(159), uint16(216), uint16(217), uint16(121), uint16(216), uint16(217), uint16(63), uint16(193),
 154672 	uint16(193), uint16(193), uint16(239), uint16(240), uint16(115), uint16(116), uint16(193), uint16(298), uint16(73), uint16(238),
 154673 	uint16(238), uint16(231), uint16(19), uint16(239), uint16(240), uint16(252), uint16(22), uint16(24), uint16(211), uint16(212),
 154674 	uint16(24), uint16(193), uint16(216), uint16(217), uint16(216), uint16(217), uint16(252), uint16(153), uint16(154), uint16(155),
 154675 	uint16(253), uint16(16), uint16(19), uint16(144), uint16(213), uint16(268), uint16(43), uint16(44), uint16(45), uint16(46),
 154676 	uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56),
 154677 	uint16(57), uint16(238), uint16(19), uint16(59), uint16(193), uint16(59), uint16(43), uint16(44), uint16(45), uint16(46),
 154678 	uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56),
 154679 	uint16(57), uint16(22), uint16(23), uint16(193), uint16(25), uint16(193), uint16(43), uint16(44), uint16(45), uint16(46),
 154680 	uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56),
 154681 	uint16(57), uint16(284), uint16(77), uint16(193), uint16(79), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106),
 154682 	uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(113), uint16(286), uint16(193), uint16(193),
 154683 	uint16(193), uint16(117), uint16(291), uint16(117), uint16(232), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106),
 154684 	uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(113), uint16(204), uint16(22), uint16(23),
 154685 	uint16(66), uint16(25), uint16(216), uint16(217), uint16(35), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106),
 154686 	uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(113), uint16(193), uint16(268), uint16(85),
 154687 	uint16(101), uint16(193), uint16(309), uint16(309), uint16(240), uint16(19), uint16(313), uint16(313), uint16(94), uint16(208),
 154688 	uint16(209), uint16(193), uint16(239), uint16(240), uint16(193), uint16(66), uint16(252), uint16(19), uint16(268), uint16(244),
 154689 	uint16(216), uint16(217), uint16(193), uint16(74), uint16(213), uint16(252), uint16(161), uint16(19), uint16(263), uint16(254),
 154690 	uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53),
 154691 	uint16(54), uint16(55), uint16(56), uint16(57), uint16(193), uint16(216), uint16(217), uint16(5), uint16(59), uint16(193),
 154692 	uint16(19), uint16(244), uint16(10), uint16(11), uint16(12), uint16(13), uint16(14), uint16(101), uint16(309), uint16(17),
 154693 	uint16(146), uint16(254), uint16(313), uint16(193), uint16(193), uint16(76), uint16(115), uint16(216), uint16(217), uint16(309),
 154694 	uint16(12), uint16(263), uint16(30), uint16(313), uint16(32), uint16(46), uint16(87), uint16(46), uint16(89), uint16(130),
 154695 	uint16(193), uint16(92), uint16(40), uint16(22), uint16(263), uint16(27), uint16(216), uint16(217), uint16(102), uint16(103),
 154696 	uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(113),
 154697 	uint16(42), uint16(150), uint16(291), uint16(216), uint16(217), uint16(116), uint16(117), uint16(118), uint16(19), uint16(20),
 154698 	uint16(193), uint16(22), uint16(70), uint16(260), uint16(116), uint16(193), uint16(24), uint16(264), uint16(193), uint16(263),
 154699 	uint16(78), uint16(63), uint16(61), uint16(81), uint16(116), uint16(36), uint16(193), uint16(260), uint16(193), uint16(29),
 154700 	uint16(193), uint16(264), uint16(193), uint16(33), uint16(145), uint16(193), uint16(59), uint16(48), uint16(216), uint16(217),
 154701 	uint16(98), uint16(216), uint16(217), uint16(193), uint16(115), uint16(193), uint16(115), uint16(193), uint16(59), uint16(216),
 154702 	uint16(217), uint16(216), uint16(217), uint16(216), uint16(217), uint16(216), uint16(217), uint16(255), uint16(216), uint16(217),
 154703 	uint16(71), uint16(193), uint16(131), uint16(193), uint16(25), uint16(65), uint16(216), uint16(217), uint16(216), uint16(217),
 154704 	uint16(216), uint16(217), uint16(208), uint16(209), uint16(85), uint16(133), uint16(193), uint16(100), uint16(193), uint16(90),
 154705 	uint16(138), uint16(139), uint16(138), uint16(139), uint16(216), uint16(217), uint16(216), uint16(217), uint16(193), uint16(100),
 154706 	uint16(193), uint16(108), uint16(135), uint16(116), uint16(117), uint16(106), uint16(107), uint16(140), uint16(121), uint16(216),
 154707 	uint16(217), uint16(216), uint16(217), uint16(114), uint16(162), uint16(116), uint16(117), uint16(118), uint16(299), uint16(300),
 154708 	uint16(121), uint16(216), uint16(217), uint16(216), uint16(217), uint16(193), uint16(244), uint16(193), uint16(135), uint16(244),
 154709 	uint16(193), uint16(256), uint16(257), uint16(140), uint16(244), uint16(193), uint16(254), uint16(193), uint16(193), uint16(254),
 154710 	uint16(153), uint16(154), uint16(155), uint16(141), uint16(254), uint16(149), uint16(150), uint16(258), uint16(216), uint16(217),
 154711 	uint16(216), uint16(217), uint16(153), uint16(154), uint16(155), uint16(156), uint16(157), uint16(0), uint16(1), uint16(2),
 154712 	uint16(216), uint16(217), uint16(5), uint16(115), uint16(158), uint16(193), uint16(160), uint16(10), uint16(11), uint16(12),
 154713 	uint16(13), uint16(14), uint16(193), uint16(59), uint16(17), uint16(126), uint16(193), uint16(19), uint16(20), uint16(129),
 154714 	uint16(22), uint16(193), uint16(22), uint16(22), uint16(24), uint16(193), uint16(23), uint16(30), uint16(25), uint16(32),
 154715 	uint16(19), uint16(20), uint16(144), uint16(22), uint16(36), uint16(216), uint16(217), uint16(40), uint16(193), uint16(216),
 154716 	uint16(217), uint16(193), uint16(152), uint16(129), uint16(216), uint16(217), uint16(193), uint16(36), uint16(216), uint16(217),
 154717 	uint16(193), uint16(99), uint16(193), uint16(193), uint16(53), uint16(193), uint16(193), uint16(59), uint16(23), uint16(193),
 154718 	uint16(25), uint16(216), uint16(217), uint16(193), uint16(216), uint16(217), uint16(152), uint16(70), uint16(59), uint16(71),
 154719 	uint16(59), uint16(117), uint16(193), uint16(216), uint16(217), uint16(78), uint16(216), uint16(217), uint16(81), uint16(216),
 154720 	uint16(217), uint16(318), uint16(71), uint16(85), uint16(193), uint16(133), uint16(193), uint16(193), uint16(90), uint16(23),
 154721 	uint16(23), uint16(25), uint16(25), uint16(120), uint16(121), uint16(98), uint16(85), uint16(193), uint16(100), uint16(193),
 154722 	uint16(23), uint16(90), uint16(25), uint16(121), uint16(106), uint16(107), uint16(19), uint16(216), uint16(217), uint16(216),
 154723 	uint16(217), uint16(100), uint16(114), uint16(131), uint16(116), uint16(117), uint16(118), uint16(106), uint16(107), uint16(121),
 154724 	uint16(216), uint16(217), uint16(216), uint16(217), uint16(193), uint16(114), uint16(117), uint16(116), uint16(117), uint16(118),
 154725 	uint16(133), uint16(193), uint16(121), uint16(193), uint16(193), uint16(138), uint16(139), uint16(193), uint16(23), uint16(193),
 154726 	uint16(25), uint16(23), uint16(23), uint16(25), uint16(25), uint16(7), uint16(8), uint16(216), uint16(217), uint16(193),
 154727 	uint16(193), uint16(153), uint16(154), uint16(155), uint16(156), uint16(157), uint16(216), uint16(217), uint16(193), uint16(162),
 154728 	uint16(216), uint16(217), uint16(216), uint16(217), uint16(153), uint16(154), uint16(155), uint16(156), uint16(157), uint16(1),
 154729 	uint16(2), uint16(193), uint16(193), uint16(5), uint16(19), uint16(20), uint16(59), uint16(22), uint16(10), uint16(11),
 154730 	uint16(12), uint16(13), uint16(14), uint16(193), uint16(97), uint16(17), uint16(193), uint16(23), uint16(193), uint16(25),
 154731 	uint16(288), uint16(36), uint16(193), uint16(242), uint16(216), uint16(217), uint16(236), uint16(23), uint16(30), uint16(25),
 154732 	uint16(32), uint16(19), uint16(20), uint16(23), uint16(22), uint16(25), uint16(216), uint16(217), uint16(40), uint16(216),
 154733 	uint16(217), uint16(216), uint16(217), uint16(193), uint16(59), uint16(216), uint16(217), uint16(193), uint16(36), uint16(83),
 154734 	uint16(84), uint16(153), uint16(153), uint16(155), uint16(155), uint16(23), uint16(71), uint16(25), uint16(23), uint16(193),
 154735 	uint16(25), uint16(193), uint16(193), uint16(193), uint16(117), uint16(193), uint16(193), uint16(193), uint16(70), uint16(193),
 154736 	uint16(193), uint16(59), uint16(193), uint16(255), uint16(255), uint16(287), uint16(78), uint16(255), uint16(243), uint16(81),
 154737 	uint16(191), uint16(255), uint16(297), uint16(71), uint16(271), uint16(100), uint16(293), uint16(245), uint16(267), uint16(214),
 154738 	uint16(246), uint16(106), uint16(107), uint16(108), uint16(246), uint16(271), uint16(98), uint16(245), uint16(293), uint16(114),
 154739 	uint16(220), uint16(116), uint16(117), uint16(118), uint16(267), uint16(271), uint16(121), uint16(271), uint16(225), uint16(219),
 154740 	uint16(229), uint16(219), uint16(100), uint16(219), uint16(259), uint16(259), uint16(259), uint16(259), uint16(106), uint16(107),
 154741 	uint16(249), uint16(196), uint16(60), uint16(280), uint16(141), uint16(243), uint16(114), uint16(249), uint16(116), uint16(117),
 154742 	uint16(118), uint16(133), uint16(245), uint16(121), uint16(200), uint16(297), uint16(138), uint16(139), uint16(153), uint16(154),
 154743 	uint16(155), uint16(156), uint16(157), uint16(297), uint16(200), uint16(38), uint16(19), uint16(20), uint16(151), uint16(22),
 154744 	uint16(200), uint16(150), uint16(140), uint16(294), uint16(294), uint16(22), uint16(272), uint16(43), uint16(234), uint16(18),
 154745 	uint16(162), uint16(270), uint16(200), uint16(36), uint16(237), uint16(153), uint16(154), uint16(155), uint16(156), uint16(157),
 154746 	uint16(237), uint16(283), uint16(237), uint16(237), uint16(18), uint16(199), uint16(149), uint16(246), uint16(272), uint16(270),
 154747 	uint16(272), uint16(200), uint16(158), uint16(246), uint16(246), uint16(234), uint16(59), uint16(234), uint16(246), uint16(199),
 154748 	uint16(290), uint16(62), uint16(289), uint16(200), uint16(199), uint16(22), uint16(221), uint16(115), uint16(71), uint16(200),
 154749 	uint16(200), uint16(199), uint16(199), uint16(221), uint16(218), uint16(218), uint16(19), uint16(20), uint16(64), uint16(22),
 154750 	uint16(218), uint16(227), uint16(22), uint16(224), uint16(126), uint16(224), uint16(165), uint16(221), uint16(24), uint16(305),
 154751 	uint16(200), uint16(113), uint16(312), uint16(36), uint16(218), uint16(220), uint16(218), uint16(100), uint16(282), uint16(218),
 154752 	uint16(91), uint16(218), uint16(317), uint16(106), uint16(107), uint16(221), uint16(227), uint16(282), uint16(317), uint16(82),
 154753 	uint16(148), uint16(114), uint16(265), uint16(116), uint16(117), uint16(118), uint16(59), uint16(145), uint16(121), uint16(22),
 154754 	uint16(277), uint16(158), uint16(200), uint16(265), uint16(25), uint16(202), uint16(147), uint16(250), uint16(71), uint16(279),
 154755 	uint16(13), uint16(146), uint16(194), uint16(194), uint16(249), uint16(248), uint16(250), uint16(140), uint16(247), uint16(246),
 154756 	uint16(6), uint16(192), uint16(192), uint16(192), uint16(303), uint16(303), uint16(213), uint16(207), uint16(300), uint16(213),
 154757 	uint16(153), uint16(154), uint16(155), uint16(156), uint16(157), uint16(213), uint16(213), uint16(100), uint16(213), uint16(222),
 154758 	uint16(207), uint16(214), uint16(214), uint16(106), uint16(107), uint16(4), uint16(222), uint16(207), uint16(3), uint16(22),
 154759 	uint16(163), uint16(114), uint16(15), uint16(116), uint16(117), uint16(118), uint16(16), uint16(23), uint16(121), uint16(23),
 154760 	uint16(139), uint16(151), uint16(130), uint16(25), uint16(142), uint16(16), uint16(24), uint16(20), uint16(144), uint16(1),
 154761 	uint16(142), uint16(130), uint16(130), uint16(61), uint16(53), uint16(53), uint16(37), uint16(151), uint16(53), uint16(53),
 154762 	uint16(130), uint16(116), uint16(34), uint16(1), uint16(141), uint16(5), uint16(22), uint16(115), uint16(161), uint16(141),
 154763 	uint16(153), uint16(154), uint16(155), uint16(156), uint16(157), uint16(25), uint16(68), uint16(68), uint16(75), uint16(41),
 154764 	uint16(115), uint16(24), uint16(131), uint16(20), uint16(19), uint16(125), uint16(22), uint16(96), uint16(22), uint16(22),
 154765 	uint16(67), uint16(23), uint16(22), uint16(67), uint16(59), uint16(24), uint16(22), uint16(28), uint16(67), uint16(23),
 154766 	uint16(22), uint16(22), uint16(149), uint16(23), uint16(23), uint16(23), uint16(116), uint16(23), uint16(25), uint16(37),
 154767 	uint16(97), uint16(141), uint16(23), uint16(23), uint16(22), uint16(143), uint16(25), uint16(75), uint16(88), uint16(34),
 154768 	uint16(34), uint16(34), uint16(34), uint16(86), uint16(75), uint16(93), uint16(23), uint16(34), uint16(22), uint16(34),
 154769 	uint16(25), uint16(24), uint16(34), uint16(25), uint16(23), uint16(142), uint16(23), uint16(142), uint16(44), uint16(23),
 154770 	uint16(23), uint16(23), uint16(11), uint16(23), uint16(25), uint16(22), uint16(22), uint16(22), uint16(15), uint16(23),
 154771 	uint16(23), uint16(22), uint16(22), uint16(25), uint16(1), uint16(1), uint16(141), uint16(25), uint16(23), uint16(135),
 154772 	uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319),
 154773 	uint16(319), uint16(319), uint16(319), uint16(319), uint16(141), uint16(141), uint16(319), uint16(141), uint16(319), uint16(319),
 154774 	uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319),
 154775 	uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319),
 154776 	uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319),
 154777 	uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319),
 154778 	uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319),
 154779 	uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319),
 154780 	uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319),
 154781 	uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319),
 154782 	uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319),
 154783 	uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319),
 154784 	uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319),
 154785 	uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319),
 154786 	uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319),
 154787 	uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319),
 154788 	uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319),
 154789 	uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319),
 154790 	uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319),
 154791 	uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319), uint16(319),
 154792 	uint16(319), uint16(319), uint16(319),
 154793 }
 154794 var yy_shift_ofst = [576]uint16{
 154795 	uint16(1648), uint16(1477), uint16(1272), uint16(322), uint16(322), uint16(1), uint16(1319), uint16(1478), uint16(1491), uint16(1837),
 154796 	uint16(1837), uint16(1837), uint16(471), uint16(0), uint16(0), uint16(214), uint16(1093), uint16(1837), uint16(1837), uint16(1837),
 154797 	uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837),
 154798 	uint16(271), uint16(271), uint16(1219), uint16(1219), uint16(216), uint16(88), uint16(1), uint16(1), uint16(1), uint16(1),
 154799 	uint16(1), uint16(40), uint16(111), uint16(258), uint16(361), uint16(469), uint16(512), uint16(583), uint16(622), uint16(693),
 154800 	uint16(732), uint16(803), uint16(842), uint16(913), uint16(1073), uint16(1093), uint16(1093), uint16(1093), uint16(1093), uint16(1093),
 154801 	uint16(1093), uint16(1093), uint16(1093), uint16(1093), uint16(1093), uint16(1093), uint16(1093), uint16(1093), uint16(1093), uint16(1093),
 154802 	uint16(1093), uint16(1093), uint16(1093), uint16(1113), uint16(1093), uint16(1216), uint16(957), uint16(957), uint16(1635), uint16(1662),
 154803 	uint16(1777), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837),
 154804 	uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837),
 154805 	uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837),
 154806 	uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837),
 154807 	uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837), uint16(1837),
 154808 	uint16(137), uint16(181), uint16(181), uint16(181), uint16(181), uint16(181), uint16(181), uint16(181), uint16(94), uint16(430),
 154809 	uint16(66), uint16(65), uint16(112), uint16(366), uint16(533), uint16(533), uint16(740), uint16(1261), uint16(533), uint16(533),
 154810 	uint16(79), uint16(79), uint16(533), uint16(412), uint16(412), uint16(412), uint16(77), uint16(412), uint16(123), uint16(113),
 154811 	uint16(113), uint16(22), uint16(22), uint16(2098), uint16(2098), uint16(328), uint16(328), uint16(328), uint16(239), uint16(468),
 154812 	uint16(468), uint16(468), uint16(468), uint16(1015), uint16(1015), uint16(409), uint16(366), uint16(1129), uint16(1186), uint16(533),
 154813 	uint16(533), uint16(533), uint16(533), uint16(533), uint16(533), uint16(533), uint16(533), uint16(533), uint16(533), uint16(533),
 154814 	uint16(533), uint16(533), uint16(533), uint16(533), uint16(533), uint16(533), uint16(533), uint16(533), uint16(533), uint16(969),
 154815 	uint16(621), uint16(621), uint16(533), uint16(642), uint16(788), uint16(788), uint16(1228), uint16(1228), uint16(822), uint16(822),
 154816 	uint16(67), uint16(1274), uint16(2098), uint16(2098), uint16(2098), uint16(2098), uint16(2098), uint16(2098), uint16(2098), uint16(1307),
 154817 	uint16(954), uint16(954), uint16(585), uint16(472), uint16(640), uint16(387), uint16(695), uint16(538), uint16(541), uint16(700),
 154818 	uint16(533), uint16(533), uint16(533), uint16(533), uint16(533), uint16(533), uint16(533), uint16(533), uint16(533), uint16(533),
 154819 	uint16(222), uint16(533), uint16(533), uint16(533), uint16(533), uint16(533), uint16(533), uint16(533), uint16(533), uint16(533),
 154820 	uint16(533), uint16(533), uint16(533), uint16(1179), uint16(1179), uint16(1179), uint16(533), uint16(533), uint16(533), uint16(565),
 154821 	uint16(533), uint16(533), uint16(533), uint16(916), uint16(1144), uint16(533), uint16(533), uint16(1288), uint16(533), uint16(533),
 154822 	uint16(533), uint16(533), uint16(533), uint16(533), uint16(533), uint16(533), uint16(639), uint16(1330), uint16(209), uint16(1076),
 154823 	uint16(1076), uint16(1076), uint16(1076), uint16(580), uint16(209), uint16(209), uint16(1313), uint16(768), uint16(917), uint16(649),
 154824 	uint16(1181), uint16(1316), uint16(405), uint16(1316), uint16(1238), uint16(249), uint16(1181), uint16(1181), uint16(249), uint16(1181),
 154825 	uint16(405), uint16(1238), uint16(1369), uint16(464), uint16(1259), uint16(1012), uint16(1012), uint16(1012), uint16(1368), uint16(1368),
 154826 	uint16(1368), uint16(1368), uint16(184), uint16(184), uint16(1326), uint16(904), uint16(1287), uint16(1480), uint16(1712), uint16(1712),
 154827 	uint16(1633), uint16(1633), uint16(1757), uint16(1757), uint16(1633), uint16(1647), uint16(1651), uint16(1783), uint16(1764), uint16(1791),
 154828 	uint16(1791), uint16(1791), uint16(1791), uint16(1633), uint16(1806), uint16(1677), uint16(1651), uint16(1651), uint16(1677), uint16(1783),
 154829 	uint16(1764), uint16(1677), uint16(1764), uint16(1677), uint16(1633), uint16(1806), uint16(1674), uint16(1779), uint16(1633), uint16(1806),
 154830 	uint16(1823), uint16(1633), uint16(1806), uint16(1633), uint16(1806), uint16(1823), uint16(1732), uint16(1732), uint16(1732), uint16(1794),
 154831 	uint16(1840), uint16(1840), uint16(1823), uint16(1732), uint16(1738), uint16(1732), uint16(1794), uint16(1732), uint16(1732), uint16(1701),
 154832 	uint16(1844), uint16(1758), uint16(1758), uint16(1823), uint16(1633), uint16(1789), uint16(1789), uint16(1807), uint16(1807), uint16(1742),
 154833 	uint16(1752), uint16(1877), uint16(1633), uint16(1743), uint16(1742), uint16(1759), uint16(1765), uint16(1677), uint16(1879), uint16(1897),
 154834 	uint16(1897), uint16(1914), uint16(1914), uint16(1914), uint16(2098), uint16(2098), uint16(2098), uint16(2098), uint16(2098), uint16(2098),
 154835 	uint16(2098), uint16(2098), uint16(2098), uint16(2098), uint16(2098), uint16(2098), uint16(2098), uint16(2098), uint16(2098), uint16(207),
 154836 	uint16(1095), uint16(331), uint16(620), uint16(903), uint16(806), uint16(1074), uint16(1483), uint16(1432), uint16(1481), uint16(1322),
 154837 	uint16(1370), uint16(1394), uint16(1515), uint16(1291), uint16(1546), uint16(1547), uint16(1557), uint16(1595), uint16(1598), uint16(1599),
 154838 	uint16(1434), uint16(1453), uint16(1618), uint16(1462), uint16(1567), uint16(1489), uint16(1644), uint16(1654), uint16(1616), uint16(1660),
 154839 	uint16(1548), uint16(1549), uint16(1682), uint16(1685), uint16(1597), uint16(742), uint16(1941), uint16(1945), uint16(1927), uint16(1787),
 154840 	uint16(1937), uint16(1940), uint16(1934), uint16(1936), uint16(1821), uint16(1810), uint16(1832), uint16(1938), uint16(1938), uint16(1942),
 154841 	uint16(1822), uint16(1947), uint16(1824), uint16(1949), uint16(1968), uint16(1828), uint16(1841), uint16(1938), uint16(1842), uint16(1912),
 154842 	uint16(1939), uint16(1938), uint16(1826), uint16(1921), uint16(1922), uint16(1925), uint16(1926), uint16(1850), uint16(1865), uint16(1948),
 154843 	uint16(1843), uint16(1982), uint16(1980), uint16(1964), uint16(1872), uint16(1827), uint16(1928), uint16(1970), uint16(1929), uint16(1923),
 154844 	uint16(1958), uint16(1848), uint16(1885), uint16(1977), uint16(1983), uint16(1985), uint16(1871), uint16(1880), uint16(1984), uint16(1943),
 154845 	uint16(1986), uint16(1987), uint16(1988), uint16(1990), uint16(1946), uint16(1955), uint16(1991), uint16(1911), uint16(1989), uint16(1994),
 154846 	uint16(1951), uint16(1992), uint16(1996), uint16(1873), uint16(1998), uint16(2000), uint16(2001), uint16(2002), uint16(2003), uint16(2004),
 154847 	uint16(1999), uint16(1933), uint16(1890), uint16(2009), uint16(2010), uint16(1910), uint16(2005), uint16(2012), uint16(1892), uint16(2011),
 154848 	uint16(2006), uint16(2007), uint16(2008), uint16(2013), uint16(1950), uint16(1962), uint16(1957), uint16(2014), uint16(1969), uint16(1952),
 154849 	uint16(2015), uint16(2023), uint16(2026), uint16(2027), uint16(2025), uint16(2028), uint16(2018), uint16(1913), uint16(1915), uint16(2031),
 154850 	uint16(2011), uint16(2033), uint16(2036), uint16(2037), uint16(2038), uint16(2039), uint16(2040), uint16(2043), uint16(2051), uint16(2044),
 154851 	uint16(2045), uint16(2046), uint16(2047), uint16(2049), uint16(2050), uint16(2048), uint16(1944), uint16(1935), uint16(1953), uint16(1954),
 154852 	uint16(1956), uint16(2052), uint16(2055), uint16(2053), uint16(2073), uint16(2074),
 154853 }
 154854 var yy_reduce_ofst = [409]int16{
 154855 	int16(-125), int16(733), int16(789), int16(241), int16(293), int16(-123), int16(-193), int16(-191), int16(-183), int16(-187),
 154856 	int16(166), int16(238), int16(133), int16(-207), int16(-199), int16(-267), int16(-176), int16(-6), int16(204), int16(489),
 154857 	int16(576), int16(-175), int16(598), int16(686), int16(615), int16(725), int16(860), int16(778), int16(781), int16(857),
 154858 	int16(616), int16(887), int16(87), int16(240), int16(-192), int16(408), int16(626), int16(796), int16(843), int16(854),
 154859 	int16(1003), int16(-271), int16(-271), int16(-271), int16(-271), int16(-271), int16(-271), int16(-271), int16(-271), int16(-271),
 154860 	int16(-271), int16(-271), int16(-271), int16(-271), int16(-271), int16(-271), int16(-271), int16(-271), int16(-271), int16(-271),
 154861 	int16(-271), int16(-271), int16(-271), int16(-271), int16(-271), int16(-271), int16(-271), int16(-271), int16(-271), int16(-271),
 154862 	int16(-271), int16(-271), int16(-271), int16(-271), int16(-271), int16(-271), int16(-271), int16(-271), int16(80), int16(83),
 154863 	int16(313), int16(886), int16(888), int16(996), int16(1034), int16(1059), int16(1081), int16(1100), int16(1117), int16(1152),
 154864 	int16(1155), int16(1163), int16(1165), int16(1167), int16(1169), int16(1172), int16(1180), int16(1182), int16(1184), int16(1198),
 154865 	int16(1200), int16(1213), int16(1215), int16(1225), int16(1227), int16(1252), int16(1254), int16(1264), int16(1299), int16(1303),
 154866 	int16(1308), int16(1312), int16(1325), int16(1328), int16(1337), int16(1340), int16(1343), int16(1371), int16(1373), int16(1384),
 154867 	int16(1386), int16(1411), int16(1420), int16(1424), int16(1426), int16(1458), int16(1470), int16(1473), int16(1475), int16(1479),
 154868 	int16(-271), int16(-271), int16(-271), int16(-271), int16(-271), int16(-271), int16(-271), int16(-271), int16(-271), int16(-271),
 154869 	int16(-271), int16(138), int16(459), int16(396), int16(-158), int16(470), int16(302), int16(-212), int16(521), int16(201),
 154870 	int16(-195), int16(-92), int16(559), int16(630), int16(632), int16(630), int16(-271), int16(632), int16(901), int16(63),
 154871 	int16(407), int16(-271), int16(-271), int16(-271), int16(-271), int16(161), int16(161), int16(161), int16(251), int16(335),
 154872 	int16(847), int16(960), int16(980), int16(537), int16(588), int16(618), int16(628), int16(688), int16(688), int16(-166),
 154873 	int16(-161), int16(674), int16(790), int16(794), int16(799), int16(851), int16(852), int16(-122), int16(680), int16(-120),
 154874 	int16(995), int16(1038), int16(415), int16(1051), int16(893), int16(798), int16(962), int16(400), int16(1086), int16(779),
 154875 	int16(923), int16(924), int16(263), int16(1041), int16(979), int16(990), int16(1083), int16(1097), int16(1031), int16(1194),
 154876 	int16(362), int16(994), int16(1139), int16(1005), int16(1037), int16(1202), int16(1205), int16(1195), int16(1210), int16(-194),
 154877 	int16(56), int16(185), int16(-135), int16(232), int16(522), int16(560), int16(601), int16(617), int16(669), int16(683),
 154878 	int16(711), int16(856), int16(908), int16(941), int16(1048), int16(1101), int16(1147), int16(1257), int16(1262), int16(1265),
 154879 	int16(392), int16(1292), int16(1333), int16(1339), int16(1342), int16(1346), int16(1350), int16(1359), int16(1374), int16(1418),
 154880 	int16(1421), int16(1436), int16(1437), int16(593), int16(755), int16(770), int16(997), int16(1445), int16(1459), int16(1209),
 154881 	int16(1500), int16(1504), int16(1516), int16(1132), int16(1243), int16(1518), int16(1519), int16(1440), int16(1520), int16(560),
 154882 	int16(1522), int16(1523), int16(1524), int16(1526), int16(1527), int16(1529), int16(1382), int16(1438), int16(1431), int16(1468),
 154883 	int16(1469), int16(1472), int16(1476), int16(1209), int16(1431), int16(1431), int16(1485), int16(1525), int16(1539), int16(1435),
 154884 	int16(1463), int16(1471), int16(1492), int16(1487), int16(1443), int16(1494), int16(1474), int16(1484), int16(1498), int16(1486),
 154885 	int16(1502), int16(1455), int16(1530), int16(1531), int16(1533), int16(1540), int16(1542), int16(1544), int16(1505), int16(1506),
 154886 	int16(1507), int16(1508), int16(1521), int16(1528), int16(1493), int16(1537), int16(1532), int16(1575), int16(1488), int16(1496),
 154887 	int16(1584), int16(1594), int16(1509), int16(1510), int16(1600), int16(1538), int16(1534), int16(1541), int16(1574), int16(1577),
 154888 	int16(1583), int16(1585), int16(1586), int16(1612), int16(1626), int16(1581), int16(1556), int16(1558), int16(1587), int16(1559),
 154889 	int16(1601), int16(1588), int16(1603), int16(1592), int16(1631), int16(1640), int16(1550), int16(1553), int16(1643), int16(1645),
 154890 	int16(1625), int16(1649), int16(1652), int16(1650), int16(1653), int16(1632), int16(1636), int16(1637), int16(1642), int16(1634),
 154891 	int16(1639), int16(1641), int16(1646), int16(1656), int16(1655), int16(1658), int16(1659), int16(1661), int16(1663), int16(1560),
 154892 	int16(1564), int16(1596), int16(1605), int16(1664), int16(1670), int16(1565), int16(1571), int16(1627), int16(1638), int16(1657),
 154893 	int16(1665), int16(1623), int16(1702), int16(1630), int16(1666), int16(1667), int16(1671), int16(1673), int16(1703), int16(1718),
 154894 	int16(1719), int16(1729), int16(1730), int16(1731), int16(1621), int16(1622), int16(1628), int16(1720), int16(1713), int16(1716),
 154895 	int16(1722), int16(1723), int16(1733), int16(1717), int16(1724), int16(1727), int16(1728), int16(1725), int16(1740),
 154896 }
 154897 var yy_default = [576]uint16{
 154898 	uint16(1647), uint16(1647), uint16(1647), uint16(1475), uint16(1240), uint16(1351), uint16(1240), uint16(1240), uint16(1240), uint16(1475),
 154899 	uint16(1475), uint16(1475), uint16(1240), uint16(1381), uint16(1381), uint16(1528), uint16(1273), uint16(1240), uint16(1240), uint16(1240),
 154900 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1474), uint16(1240), uint16(1240),
 154901 	uint16(1240), uint16(1240), uint16(1563), uint16(1563), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240),
 154902 	uint16(1240), uint16(1240), uint16(1390), uint16(1240), uint16(1397), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240),
 154903 	uint16(1476), uint16(1477), uint16(1240), uint16(1240), uint16(1240), uint16(1527), uint16(1529), uint16(1492), uint16(1404), uint16(1403),
 154904 	uint16(1402), uint16(1401), uint16(1510), uint16(1369), uint16(1395), uint16(1388), uint16(1392), uint16(1470), uint16(1471), uint16(1469),
 154905 	uint16(1473), uint16(1477), uint16(1476), uint16(1240), uint16(1391), uint16(1438), uint16(1454), uint16(1437), uint16(1240), uint16(1240),
 154906 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240),
 154907 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240),
 154908 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240),
 154909 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240),
 154910 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240),
 154911 	uint16(1446), uint16(1453), uint16(1452), uint16(1451), uint16(1460), uint16(1450), uint16(1447), uint16(1440), uint16(1439), uint16(1441),
 154912 	uint16(1442), uint16(1240), uint16(1240), uint16(1264), uint16(1240), uint16(1240), uint16(1261), uint16(1315), uint16(1240), uint16(1240),
 154913 	uint16(1240), uint16(1240), uint16(1240), uint16(1547), uint16(1546), uint16(1240), uint16(1443), uint16(1240), uint16(1273), uint16(1432),
 154914 	uint16(1431), uint16(1457), uint16(1444), uint16(1456), uint16(1455), uint16(1535), uint16(1599), uint16(1598), uint16(1493), uint16(1240),
 154915 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1563), uint16(1240), uint16(1240), uint16(1240), uint16(1240),
 154916 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240),
 154917 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1371),
 154918 	uint16(1563), uint16(1563), uint16(1240), uint16(1273), uint16(1563), uint16(1563), uint16(1372), uint16(1372), uint16(1269), uint16(1269),
 154919 	uint16(1375), uint16(1240), uint16(1542), uint16(1342), uint16(1342), uint16(1342), uint16(1342), uint16(1351), uint16(1342), uint16(1240),
 154920 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240),
 154921 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1532), uint16(1530), uint16(1240), uint16(1240), uint16(1240), uint16(1240),
 154922 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240),
 154923 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240),
 154924 	uint16(1240), uint16(1240), uint16(1240), uint16(1347), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240),
 154925 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1592), uint16(1240), uint16(1505), uint16(1329), uint16(1347),
 154926 	uint16(1347), uint16(1347), uint16(1347), uint16(1349), uint16(1330), uint16(1328), uint16(1341), uint16(1274), uint16(1247), uint16(1639),
 154927 	uint16(1407), uint16(1396), uint16(1348), uint16(1396), uint16(1636), uint16(1394), uint16(1407), uint16(1407), uint16(1394), uint16(1407),
 154928 	uint16(1348), uint16(1636), uint16(1290), uint16(1615), uint16(1285), uint16(1381), uint16(1381), uint16(1381), uint16(1371), uint16(1371),
 154929 	uint16(1371), uint16(1371), uint16(1375), uint16(1375), uint16(1472), uint16(1348), uint16(1341), uint16(1240), uint16(1639), uint16(1639),
 154930 	uint16(1357), uint16(1357), uint16(1638), uint16(1638), uint16(1357), uint16(1493), uint16(1623), uint16(1416), uint16(1318), uint16(1324),
 154931 	uint16(1324), uint16(1324), uint16(1324), uint16(1357), uint16(1258), uint16(1394), uint16(1623), uint16(1623), uint16(1394), uint16(1416),
 154932 	uint16(1318), uint16(1394), uint16(1318), uint16(1394), uint16(1357), uint16(1258), uint16(1509), uint16(1633), uint16(1357), uint16(1258),
 154933 	uint16(1483), uint16(1357), uint16(1258), uint16(1357), uint16(1258), uint16(1483), uint16(1316), uint16(1316), uint16(1316), uint16(1305),
 154934 	uint16(1240), uint16(1240), uint16(1483), uint16(1316), uint16(1290), uint16(1316), uint16(1305), uint16(1316), uint16(1316), uint16(1581),
 154935 	uint16(1240), uint16(1487), uint16(1487), uint16(1483), uint16(1357), uint16(1573), uint16(1573), uint16(1384), uint16(1384), uint16(1389),
 154936 	uint16(1375), uint16(1478), uint16(1357), uint16(1240), uint16(1389), uint16(1387), uint16(1385), uint16(1394), uint16(1308), uint16(1595),
 154937 	uint16(1595), uint16(1591), uint16(1591), uint16(1591), uint16(1644), uint16(1644), uint16(1542), uint16(1608), uint16(1273), uint16(1273),
 154938 	uint16(1273), uint16(1273), uint16(1608), uint16(1292), uint16(1292), uint16(1274), uint16(1274), uint16(1273), uint16(1608), uint16(1240),
 154939 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1603), uint16(1240), uint16(1537), uint16(1494), uint16(1361),
 154940 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240),
 154941 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1548), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240),
 154942 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1421), uint16(1240), uint16(1243), uint16(1539), uint16(1240),
 154943 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1398), uint16(1399), uint16(1362),
 154944 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1413), uint16(1240), uint16(1240),
 154945 	uint16(1240), uint16(1408), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240),
 154946 	uint16(1635), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1508), uint16(1507), uint16(1240),
 154947 	uint16(1240), uint16(1359), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240),
 154948 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1288), uint16(1240), uint16(1240), uint16(1240), uint16(1240),
 154949 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240),
 154950 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1386),
 154951 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240),
 154952 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1578), uint16(1376), uint16(1240), uint16(1240), uint16(1240), uint16(1240),
 154953 	uint16(1626), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240),
 154954 	uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1240), uint16(1619), uint16(1332), uint16(1423), uint16(1240), uint16(1422),
 154955 	uint16(1426), uint16(1262), uint16(1240), uint16(1252), uint16(1240), uint16(1240),
 154956 }
 154957 
 154958 var yyFallback = [185]uint16{
 154959 	uint16(0),
 154960 	uint16(0),
 154961 	uint16(59),
 154962 	uint16(59),
 154963 	uint16(59),
 154964 	uint16(59),
 154965 	uint16(0),
 154966 	uint16(59),
 154967 	uint16(59),
 154968 	uint16(59),
 154969 	uint16(0),
 154970 	uint16(59),
 154971 	uint16(59),
 154972 	uint16(59),
 154973 	uint16(59),
 154974 	uint16(0),
 154975 	uint16(0),
 154976 	uint16(0),
 154977 	uint16(59),
 154978 	uint16(0),
 154979 	uint16(0),
 154980 	uint16(59),
 154981 	uint16(0),
 154982 	uint16(0),
 154983 	uint16(0),
 154984 	uint16(0),
 154985 	uint16(59),
 154986 	uint16(59),
 154987 	uint16(59),
 154988 	uint16(59),
 154989 	uint16(59),
 154990 	uint16(59),
 154991 	uint16(59),
 154992 	uint16(59),
 154993 	uint16(59),
 154994 	uint16(59),
 154995 	uint16(59),
 154996 	uint16(59),
 154997 	uint16(59),
 154998 	uint16(59),
 154999 	uint16(59),
 155000 	uint16(59),
 155001 	uint16(59),
 155002 	uint16(0),
 155003 	uint16(0),
 155004 	uint16(0),
 155005 	uint16(59),
 155006 	uint16(59),
 155007 	uint16(0),
 155008 	uint16(0),
 155009 	uint16(0),
 155010 	uint16(0),
 155011 	uint16(0),
 155012 	uint16(0),
 155013 	uint16(0),
 155014 	uint16(0),
 155015 	uint16(0),
 155016 	uint16(0),
 155017 	uint16(0),
 155018 	uint16(0),
 155019 	uint16(59),
 155020 	uint16(59),
 155021 	uint16(59),
 155022 	uint16(59),
 155023 	uint16(59),
 155024 	uint16(59),
 155025 	uint16(59),
 155026 	uint16(59),
 155027 	uint16(59),
 155028 	uint16(59),
 155029 	uint16(59),
 155030 	uint16(59),
 155031 	uint16(59),
 155032 	uint16(59),
 155033 	uint16(59),
 155034 	uint16(59),
 155035 	uint16(59),
 155036 	uint16(59),
 155037 	uint16(59),
 155038 	uint16(59),
 155039 	uint16(59),
 155040 	uint16(59),
 155041 	uint16(59),
 155042 	uint16(59),
 155043 	uint16(59),
 155044 	uint16(59),
 155045 	uint16(59),
 155046 	uint16(59),
 155047 	uint16(59),
 155048 	uint16(59),
 155049 	uint16(59),
 155050 	uint16(59),
 155051 	uint16(59),
 155052 	uint16(59),
 155053 	uint16(59),
 155054 	uint16(59),
 155055 	uint16(59),
 155056 	uint16(59),
 155057 	uint16(59),
 155058 	uint16(59),
 155059 	uint16(59),
 155060 	uint16(0),
 155061 	uint16(0),
 155062 	uint16(0),
 155063 	uint16(0),
 155064 	uint16(0),
 155065 	uint16(0),
 155066 	uint16(0),
 155067 	uint16(0),
 155068 	uint16(0),
 155069 	uint16(0),
 155070 	uint16(0),
 155071 	uint16(0),
 155072 	uint16(0),
 155073 	uint16(0),
 155074 	uint16(0),
 155075 	uint16(0),
 155076 	uint16(0),
 155077 	uint16(0),
 155078 	uint16(0),
 155079 	uint16(0),
 155080 	uint16(0),
 155081 	uint16(0),
 155082 	uint16(0),
 155083 	uint16(0),
 155084 	uint16(0),
 155085 	uint16(0),
 155086 	uint16(0),
 155087 	uint16(0),
 155088 	uint16(0),
 155089 	uint16(0),
 155090 	uint16(0),
 155091 	uint16(0),
 155092 	uint16(0),
 155093 	uint16(0),
 155094 	uint16(0),
 155095 	uint16(0),
 155096 	uint16(0),
 155097 	uint16(0),
 155098 	uint16(0),
 155099 	uint16(0),
 155100 	uint16(0),
 155101 	uint16(0),
 155102 	uint16(0),
 155103 	uint16(0),
 155104 	uint16(0),
 155105 	uint16(0),
 155106 	uint16(0),
 155107 	uint16(0),
 155108 	uint16(0),
 155109 	uint16(0),
 155110 	uint16(0),
 155111 	uint16(0),
 155112 	uint16(0),
 155113 	uint16(0),
 155114 	uint16(0),
 155115 	uint16(0),
 155116 	uint16(0),
 155117 	uint16(0),
 155118 	uint16(0),
 155119 	uint16(0),
 155120 	uint16(0),
 155121 	uint16(0),
 155122 	uint16(0),
 155123 	uint16(0),
 155124 	uint16(0),
 155125 	uint16(0),
 155126 	uint16(0),
 155127 	uint16(0),
 155128 	uint16(0),
 155129 	uint16(0),
 155130 	uint16(0),
 155131 	uint16(0),
 155132 	uint16(0),
 155133 	uint16(0),
 155134 	uint16(0),
 155135 	uint16(0),
 155136 	uint16(0),
 155137 	uint16(0),
 155138 	uint16(0),
 155139 	uint16(0),
 155140 	uint16(0),
 155141 	uint16(0),
 155142 	uint16(0),
 155143 	uint16(0),
 155144 }
 155145 
 155146 type yyStackEntry = struct {
 155147 	Fstateno     uint16
 155148 	Fmajor       uint16
 155149 	F__ccgo_pad1 [4]byte
 155150 	Fminor       YYMINORTYPE
 155151 }
 155152 
 155153 type YyStackEntry = yyStackEntry
 155154 
 155155 type yyParser = struct {
 155156 	Fyytos      uintptr
 155157 	FpParse     uintptr
 155158 	Fyystack    [100]YyStackEntry
 155159 	FyystackEnd uintptr
 155160 }
 155161 
 155162 type YyParser = yyParser
 155163 
 155164 // Initialize a new parser that has already been allocated.
 155165 func Xsqlite3ParserInit(tls *libc.TLS, yypRawParser uintptr, pParse uintptr) {
 155166 	var yypParser uintptr = yypRawParser
 155167 	(*YyParser)(unsafe.Pointer(yypParser)).FpParse = pParse
 155168 	(*YyParser)(unsafe.Pointer(yypParser)).Fyytos = yypParser + 16
 155169 	(*YyStackEntry)(unsafe.Pointer(yypParser + 16)).Fstateno = uint16(0)
 155170 	(*YyStackEntry)(unsafe.Pointer(yypParser + 16)).Fmajor = uint16(0)
 155171 	(*YyParser)(unsafe.Pointer(yypParser)).FyystackEnd = yypParser + 16 + 99*24
 155172 }
 155173 
 155174 func yy_destructor(tls *libc.TLS, yypParser uintptr, yymajor uint16, yypminor uintptr) {
 155175 	var pParse uintptr = (*YyParser)(unsafe.Pointer(yypParser)).FpParse
 155176 	switch int32(yymajor) {
 155177 	case 204:
 155178 		fallthrough
 155179 	case 239:
 155180 		fallthrough
 155181 	case 240:
 155182 		fallthrough
 155183 	case 252:
 155184 		{
 155185 			Xsqlite3SelectDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor)))
 155186 		}
 155187 		break
 155188 	case 216:
 155189 		fallthrough
 155190 	case 217:
 155191 		fallthrough
 155192 	case 246:
 155193 		fallthrough
 155194 	case 248:
 155195 		fallthrough
 155196 	case 267:
 155197 		fallthrough
 155198 	case 278:
 155199 		fallthrough
 155200 	case 280:
 155201 		fallthrough
 155202 	case 283:
 155203 		fallthrough
 155204 	case 290:
 155205 		fallthrough
 155206 	case 295:
 155207 		fallthrough
 155208 	case 311:
 155209 		{
 155210 			Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor)))
 155211 		}
 155212 		break
 155213 	case 221:
 155214 		fallthrough
 155215 	case 231:
 155216 		fallthrough
 155217 	case 232:
 155218 		fallthrough
 155219 	case 244:
 155220 		fallthrough
 155221 	case 247:
 155222 		fallthrough
 155223 	case 249:
 155224 		fallthrough
 155225 	case 253:
 155226 		fallthrough
 155227 	case 254:
 155228 		fallthrough
 155229 	case 261:
 155230 		fallthrough
 155231 	case 268:
 155232 		fallthrough
 155233 	case 277:
 155234 		fallthrough
 155235 	case 279:
 155236 		fallthrough
 155237 	case 310:
 155238 		{
 155239 			Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor)))
 155240 		}
 155241 		break
 155242 	case 238:
 155243 		fallthrough
 155244 	case 245:
 155245 		fallthrough
 155246 	case 256:
 155247 		fallthrough
 155248 	case 257:
 155249 		fallthrough
 155250 	case 262:
 155251 		{
 155252 			Xsqlite3SrcListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor)))
 155253 		}
 155254 		break
 155255 	case 241:
 155256 		{
 155257 			Xsqlite3WithDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor)))
 155258 		}
 155259 		break
 155260 	case 251:
 155261 		fallthrough
 155262 	case 306:
 155263 		{
 155264 			Xsqlite3WindowListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor)))
 155265 		}
 155266 		break
 155267 	case 263:
 155268 		fallthrough
 155269 	case 270:
 155270 		{
 155271 			Xsqlite3IdListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor)))
 155272 		}
 155273 		break
 155274 	case 273:
 155275 		fallthrough
 155276 	case 307:
 155277 		fallthrough
 155278 	case 308:
 155279 		fallthrough
 155280 	case 309:
 155281 		fallthrough
 155282 	case 312:
 155283 		{
 155284 			Xsqlite3WindowDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor)))
 155285 		}
 155286 		break
 155287 	case 286:
 155288 		fallthrough
 155289 	case 291:
 155290 		{
 155291 			Xsqlite3DeleteTriggerStep(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor)))
 155292 		}
 155293 		break
 155294 	case 288:
 155295 		{
 155296 			Xsqlite3IdListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*TrigEvent)(unsafe.Pointer(yypminor)).Fb)
 155297 		}
 155298 		break
 155299 	case 314:
 155300 		fallthrough
 155301 	case 315:
 155302 		fallthrough
 155303 	case 316:
 155304 		{
 155305 			Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*FrameBound)(unsafe.Pointer(yypminor)).FpExpr)
 155306 		}
 155307 		break
 155308 
 155309 	default:
 155310 		break
 155311 	}
 155312 }
 155313 
 155314 func yy_pop_parser_stack(tls *libc.TLS, pParser uintptr) {
 155315 	var yytos uintptr
 155316 
 155317 	yytos = libc.PostDecUintptr(&(*YyParser)(unsafe.Pointer(pParser)).Fyytos, 24)
 155318 	yy_destructor(tls, pParser, (*YyStackEntry)(unsafe.Pointer(yytos)).Fmajor, yytos+8)
 155319 }
 155320 
 155321 // Clear all secondary memory allocations from the parser
 155322 func Xsqlite3ParserFinalize(tls *libc.TLS, p uintptr) {
 155323 	var pParser uintptr = p
 155324 	for (*YyParser)(unsafe.Pointer(pParser)).Fyytos > pParser+16 {
 155325 		yy_pop_parser_stack(tls, pParser)
 155326 	}
 155327 }
 155328 
 155329 func yy_find_shift_action(tls *libc.TLS, iLookAhead uint16, stateno uint16) uint16 {
 155330 	var i int32
 155331 
 155332 	if int32(stateno) > YY_MAX_SHIFT {
 155333 		return stateno
 155334 	}
 155335 
 155336 	for __ccgo := true; __ccgo; __ccgo = 1 != 0 {
 155337 		i = int32(yy_shift_ofst[stateno])
 155338 
 155339 		i = i + int32(iLookAhead)
 155340 
 155341 		if int32(yy_lookahead[i]) != int32(iLookAhead) {
 155342 			var iFallback uint16
 155343 
 155344 			iFallback = yyFallback[iLookAhead]
 155345 			if int32(iFallback) != 0 {
 155346 				iLookAhead = iFallback
 155347 				continue
 155348 			}
 155349 			{
 155350 				var j int32 = i - int32(iLookAhead) + YYWILDCARD
 155351 
 155352 				if int32(yy_lookahead[j]) == YYWILDCARD && int32(iLookAhead) > 0 {
 155353 					return yy_action[j]
 155354 				}
 155355 
 155356 			}
 155357 			return yy_default[stateno]
 155358 		} else {
 155359 			return yy_action[i]
 155360 		}
 155361 	}
 155362 	return uint16(0)
 155363 }
 155364 
 155365 func yy_find_reduce_action(tls *libc.TLS, stateno uint16, iLookAhead uint16) uint16 {
 155366 	var i int32
 155367 
 155368 	i = int32(yy_reduce_ofst[stateno])
 155369 
 155370 	i = i + int32(iLookAhead)
 155371 
 155372 	return yy_action[i]
 155373 }
 155374 
 155375 func yyStackOverflow(tls *libc.TLS, yypParser uintptr) {
 155376 	var pParse uintptr = (*YyParser)(unsafe.Pointer(yypParser)).FpParse
 155377 	for (*YyParser)(unsafe.Pointer(yypParser)).Fyytos > yypParser+16 {
 155378 		yy_pop_parser_stack(tls, yypParser)
 155379 	}
 155380 
 155381 	Xsqlite3ErrorMsg(tls, pParse, ts+24362, 0)
 155382 
 155383 	(*YyParser)(unsafe.Pointer(yypParser)).FpParse = pParse
 155384 }
 155385 
 155386 func yy_shift(tls *libc.TLS, yypParser uintptr, yyNewState uint16, yyMajor uint16, yyMinor Token) {
 155387 	var yytos uintptr
 155388 	(*YyParser)(unsafe.Pointer(yypParser)).Fyytos += 24
 155389 	if (*YyParser)(unsafe.Pointer(yypParser)).Fyytos > (*YyParser)(unsafe.Pointer(yypParser)).FyystackEnd {
 155390 		(*YyParser)(unsafe.Pointer(yypParser)).Fyytos -= 24
 155391 		yyStackOverflow(tls, yypParser)
 155392 		return
 155393 	}
 155394 	if int32(yyNewState) > YY_MAX_SHIFT {
 155395 		yyNewState = uint16(int32(yyNewState) + (YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE))
 155396 	}
 155397 	yytos = (*YyParser)(unsafe.Pointer(yypParser)).Fyytos
 155398 	(*YyStackEntry)(unsafe.Pointer(yytos)).Fstateno = yyNewState
 155399 	(*YyStackEntry)(unsafe.Pointer(yytos)).Fmajor = yyMajor
 155400 	*(*Token)(unsafe.Pointer(yytos + 8)) = yyMinor
 155401 
 155402 }
 155403 
 155404 var yyRuleInfoLhs = [405]uint16{
 155405 	uint16(189),
 155406 	uint16(189),
 155407 	uint16(188),
 155408 	uint16(190),
 155409 	uint16(191),
 155410 	uint16(191),
 155411 	uint16(191),
 155412 	uint16(191),
 155413 	uint16(190),
 155414 	uint16(190),
 155415 	uint16(190),
 155416 	uint16(190),
 155417 	uint16(190),
 155418 	uint16(195),
 155419 	uint16(197),
 155420 	uint16(199),
 155421 	uint16(199),
 155422 	uint16(198),
 155423 	uint16(198),
 155424 	uint16(196),
 155425 	uint16(196),
 155426 	uint16(203),
 155427 	uint16(203),
 155428 	uint16(205),
 155429 	uint16(205),
 155430 	uint16(206),
 155431 	uint16(208),
 155432 	uint16(208),
 155433 	uint16(208),
 155434 	uint16(209),
 155435 	uint16(213),
 155436 	uint16(214),
 155437 	uint16(215),
 155438 	uint16(215),
 155439 	uint16(215),
 155440 	uint16(215),
 155441 	uint16(215),
 155442 	uint16(215),
 155443 	uint16(215),
 155444 	uint16(215),
 155445 	uint16(215),
 155446 	uint16(215),
 155447 	uint16(215),
 155448 	uint16(215),
 155449 	uint16(215),
 155450 	uint16(224),
 155451 	uint16(224),
 155452 	uint16(220),
 155453 	uint16(220),
 155454 	uint16(222),
 155455 	uint16(222),
 155456 	uint16(225),
 155457 	uint16(225),
 155458 	uint16(225),
 155459 	uint16(225),
 155460 	uint16(226),
 155461 	uint16(226),
 155462 	uint16(226),
 155463 	uint16(226),
 155464 	uint16(226),
 155465 	uint16(223),
 155466 	uint16(223),
 155467 	uint16(227),
 155468 	uint16(227),
 155469 	uint16(227),
 155470 	uint16(202),
 155471 	uint16(229),
 155472 	uint16(230),
 155473 	uint16(230),
 155474 	uint16(230),
 155475 	uint16(230),
 155476 	uint16(230),
 155477 	uint16(233),
 155478 	uint16(218),
 155479 	uint16(218),
 155480 	uint16(234),
 155481 	uint16(234),
 155482 	uint16(235),
 155483 	uint16(235),
 155484 	uint16(190),
 155485 	uint16(237),
 155486 	uint16(237),
 155487 	uint16(190),
 155488 	uint16(190),
 155489 	uint16(190),
 155490 	uint16(204),
 155491 	uint16(204),
 155492 	uint16(204),
 155493 	uint16(239),
 155494 	uint16(242),
 155495 	uint16(242),
 155496 	uint16(242),
 155497 	uint16(240),
 155498 	uint16(240),
 155499 	uint16(252),
 155500 	uint16(252),
 155501 	uint16(243),
 155502 	uint16(243),
 155503 	uint16(243),
 155504 	uint16(254),
 155505 	uint16(244),
 155506 	uint16(244),
 155507 	uint16(244),
 155508 	uint16(255),
 155509 	uint16(255),
 155510 	uint16(245),
 155511 	uint16(245),
 155512 	uint16(257),
 155513 	uint16(257),
 155514 	uint16(256),
 155515 	uint16(256),
 155516 	uint16(256),
 155517 	uint16(256),
 155518 	uint16(256),
 155519 	uint16(200),
 155520 	uint16(200),
 155521 	uint16(238),
 155522 	uint16(238),
 155523 	uint16(262),
 155524 	uint16(262),
 155525 	uint16(262),
 155526 	uint16(262),
 155527 	uint16(258),
 155528 	uint16(258),
 155529 	uint16(258),
 155530 	uint16(258),
 155531 	uint16(259),
 155532 	uint16(259),
 155533 	uint16(259),
 155534 	uint16(264),
 155535 	uint16(260),
 155536 	uint16(260),
 155537 	uint16(249),
 155538 	uint16(249),
 155539 	uint16(231),
 155540 	uint16(231),
 155541 	uint16(219),
 155542 	uint16(219),
 155543 	uint16(219),
 155544 	uint16(265),
 155545 	uint16(265),
 155546 	uint16(265),
 155547 	uint16(247),
 155548 	uint16(247),
 155549 	uint16(248),
 155550 	uint16(248),
 155551 	uint16(250),
 155552 	uint16(250),
 155553 	uint16(250),
 155554 	uint16(250),
 155555 	uint16(190),
 155556 	uint16(246),
 155557 	uint16(246),
 155558 	uint16(267),
 155559 	uint16(267),
 155560 	uint16(267),
 155561 	uint16(267),
 155562 	uint16(190),
 155563 	uint16(268),
 155564 	uint16(268),
 155565 	uint16(268),
 155566 	uint16(268),
 155567 	uint16(190),
 155568 	uint16(190),
 155569 	uint16(271),
 155570 	uint16(271),
 155571 	uint16(271),
 155572 	uint16(271),
 155573 	uint16(271),
 155574 	uint16(271),
 155575 	uint16(272),
 155576 	uint16(269),
 155577 	uint16(269),
 155578 	uint16(270),
 155579 	uint16(270),
 155580 	uint16(263),
 155581 	uint16(263),
 155582 	uint16(217),
 155583 	uint16(217),
 155584 	uint16(217),
 155585 	uint16(217),
 155586 	uint16(217),
 155587 	uint16(216),
 155588 	uint16(216),
 155589 	uint16(216),
 155590 	uint16(217),
 155591 	uint16(217),
 155592 	uint16(217),
 155593 	uint16(217),
 155594 	uint16(217),
 155595 	uint16(217),
 155596 	uint16(217),
 155597 	uint16(216),
 155598 	uint16(217),
 155599 	uint16(217),
 155600 	uint16(217),
 155601 	uint16(217),
 155602 	uint16(217),
 155603 	uint16(217),
 155604 	uint16(217),
 155605 	uint16(217),
 155606 	uint16(217),
 155607 	uint16(274),
 155608 	uint16(217),
 155609 	uint16(217),
 155610 	uint16(217),
 155611 	uint16(217),
 155612 	uint16(217),
 155613 	uint16(217),
 155614 	uint16(217),
 155615 	uint16(217),
 155616 	uint16(217),
 155617 	uint16(217),
 155618 	uint16(217),
 155619 	uint16(217),
 155620 	uint16(275),
 155621 	uint16(275),
 155622 	uint16(217),
 155623 	uint16(276),
 155624 	uint16(276),
 155625 	uint16(217),
 155626 	uint16(217),
 155627 	uint16(217),
 155628 	uint16(217),
 155629 	uint16(217),
 155630 	uint16(217),
 155631 	uint16(279),
 155632 	uint16(279),
 155633 	uint16(280),
 155634 	uint16(280),
 155635 	uint16(278),
 155636 	uint16(278),
 155637 	uint16(261),
 155638 	uint16(253),
 155639 	uint16(253),
 155640 	uint16(277),
 155641 	uint16(277),
 155642 	uint16(190),
 155643 	uint16(281),
 155644 	uint16(281),
 155645 	uint16(221),
 155646 	uint16(221),
 155647 	uint16(232),
 155648 	uint16(232),
 155649 	uint16(282),
 155650 	uint16(282),
 155651 	uint16(190),
 155652 	uint16(190),
 155653 	uint16(190),
 155654 	uint16(283),
 155655 	uint16(283),
 155656 	uint16(190),
 155657 	uint16(190),
 155658 	uint16(190),
 155659 	uint16(190),
 155660 	uint16(190),
 155661 	uint16(211),
 155662 	uint16(212),
 155663 	uint16(190),
 155664 	uint16(285),
 155665 	uint16(287),
 155666 	uint16(287),
 155667 	uint16(287),
 155668 	uint16(288),
 155669 	uint16(288),
 155670 	uint16(288),
 155671 	uint16(290),
 155672 	uint16(290),
 155673 	uint16(286),
 155674 	uint16(286),
 155675 	uint16(292),
 155676 	uint16(293),
 155677 	uint16(293),
 155678 	uint16(291),
 155679 	uint16(291),
 155680 	uint16(291),
 155681 	uint16(291),
 155682 	uint16(217),
 155683 	uint16(217),
 155684 	uint16(236),
 155685 	uint16(236),
 155686 	uint16(236),
 155687 	uint16(190),
 155688 	uint16(190),
 155689 	uint16(190),
 155690 	uint16(295),
 155691 	uint16(295),
 155692 	uint16(190),
 155693 	uint16(190),
 155694 	uint16(190),
 155695 	uint16(190),
 155696 	uint16(190),
 155697 	uint16(190),
 155698 	uint16(190),
 155699 	uint16(296),
 155700 	uint16(190),
 155701 	uint16(190),
 155702 	uint16(190),
 155703 	uint16(298),
 155704 	uint16(300),
 155705 	uint16(301),
 155706 	uint16(301),
 155707 	uint16(302),
 155708 	uint16(266),
 155709 	uint16(266),
 155710 	uint16(305),
 155711 	uint16(305),
 155712 	uint16(305),
 155713 	uint16(304),
 155714 	uint16(241),
 155715 	uint16(241),
 155716 	uint16(306),
 155717 	uint16(306),
 155718 	uint16(307),
 155719 	uint16(308),
 155720 	uint16(308),
 155721 	uint16(308),
 155722 	uint16(308),
 155723 	uint16(308),
 155724 	uint16(308),
 155725 	uint16(309),
 155726 	uint16(309),
 155727 	uint16(309),
 155728 	uint16(313),
 155729 	uint16(315),
 155730 	uint16(315),
 155731 	uint16(316),
 155732 	uint16(316),
 155733 	uint16(314),
 155734 	uint16(314),
 155735 	uint16(317),
 155736 	uint16(317),
 155737 	uint16(318),
 155738 	uint16(318),
 155739 	uint16(318),
 155740 	uint16(251),
 155741 	uint16(273),
 155742 	uint16(273),
 155743 	uint16(273),
 155744 	uint16(312),
 155745 	uint16(312),
 155746 	uint16(311),
 155747 	uint16(185),
 155748 	uint16(186),
 155749 	uint16(186),
 155750 	uint16(187),
 155751 	uint16(187),
 155752 	uint16(187),
 155753 	uint16(192),
 155754 	uint16(192),
 155755 	uint16(192),
 155756 	uint16(194),
 155757 	uint16(194),
 155758 	uint16(190),
 155759 	uint16(203),
 155760 	uint16(201),
 155761 	uint16(201),
 155762 	uint16(193),
 155763 	uint16(193),
 155764 	uint16(193),
 155765 	uint16(208),
 155766 	uint16(209),
 155767 	uint16(210),
 155768 	uint16(210),
 155769 	uint16(207),
 155770 	uint16(207),
 155771 	uint16(215),
 155772 	uint16(215),
 155773 	uint16(215),
 155774 	uint16(202),
 155775 	uint16(228),
 155776 	uint16(228),
 155777 	uint16(229),
 155778 	uint16(233),
 155779 	uint16(235),
 155780 	uint16(239),
 155781 	uint16(240),
 155782 	uint16(254),
 155783 	uint16(255),
 155784 	uint16(264),
 155785 	uint16(272),
 155786 	uint16(217),
 155787 	uint16(274),
 155788 	uint16(261),
 155789 	uint16(284),
 155790 	uint16(284),
 155791 	uint16(284),
 155792 	uint16(284),
 155793 	uint16(284),
 155794 	uint16(211),
 155795 	uint16(289),
 155796 	uint16(289),
 155797 	uint16(292),
 155798 	uint16(293),
 155799 	uint16(294),
 155800 	uint16(294),
 155801 	uint16(297),
 155802 	uint16(297),
 155803 	uint16(299),
 155804 	uint16(299),
 155805 	uint16(300),
 155806 	uint16(303),
 155807 	uint16(303),
 155808 	uint16(303),
 155809 	uint16(266),
 155810 }
 155811 
 155812 var yyRuleInfoNRhs = [405]int8{
 155813 	int8(-1),
 155814 	int8(-3),
 155815 	int8(-1),
 155816 	int8(-3),
 155817 	int8(0),
 155818 	int8(-1),
 155819 	int8(-1),
 155820 	int8(-1),
 155821 	int8(-2),
 155822 	int8(-2),
 155823 	int8(-2),
 155824 	int8(-3),
 155825 	int8(-5),
 155826 	int8(-6),
 155827 	int8(-1),
 155828 	int8(0),
 155829 	int8(-3),
 155830 	int8(-1),
 155831 	int8(0),
 155832 	int8(-5),
 155833 	int8(-2),
 155834 	int8(0),
 155835 	int8(-3),
 155836 	int8(-2),
 155837 	int8(-1),
 155838 	int8(-2),
 155839 	int8(0),
 155840 	int8(-4),
 155841 	int8(-6),
 155842 	int8(-2),
 155843 	int8(0),
 155844 	int8(0),
 155845 	int8(-2),
 155846 	int8(-3),
 155847 	int8(-4),
 155848 	int8(-4),
 155849 	int8(-4),
 155850 	int8(-3),
 155851 	int8(-3),
 155852 	int8(-5),
 155853 	int8(-2),
 155854 	int8(-4),
 155855 	int8(-4),
 155856 	int8(-1),
 155857 	int8(-2),
 155858 	int8(-3),
 155859 	int8(-4),
 155860 	int8(0),
 155861 	int8(-1),
 155862 	int8(0),
 155863 	int8(-2),
 155864 	int8(-2),
 155865 	int8(-3),
 155866 	int8(-3),
 155867 	int8(-3),
 155868 	int8(-2),
 155869 	int8(-2),
 155870 	int8(-1),
 155871 	int8(-1),
 155872 	int8(-2),
 155873 	int8(-3),
 155874 	int8(-2),
 155875 	int8(0),
 155876 	int8(-2),
 155877 	int8(-2),
 155878 	int8(0),
 155879 	int8(-1),
 155880 	int8(-2),
 155881 	int8(-7),
 155882 	int8(-5),
 155883 	int8(-5),
 155884 	int8(-10),
 155885 	int8(0),
 155886 	int8(0),
 155887 	int8(-3),
 155888 	int8(0),
 155889 	int8(-2),
 155890 	int8(-1),
 155891 	int8(-1),
 155892 	int8(-4),
 155893 	int8(-2),
 155894 	int8(0),
 155895 	int8(-9),
 155896 	int8(-4),
 155897 	int8(-1),
 155898 	int8(-3),
 155899 	int8(-4),
 155900 	int8(-1),
 155901 	int8(-3),
 155902 	int8(-1),
 155903 	int8(-2),
 155904 	int8(-1),
 155905 	int8(-9),
 155906 	int8(-10),
 155907 	int8(-4),
 155908 	int8(-5),
 155909 	int8(-1),
 155910 	int8(-1),
 155911 	int8(0),
 155912 	int8(0),
 155913 	int8(-5),
 155914 	int8(-3),
 155915 	int8(-5),
 155916 	int8(-2),
 155917 	int8(0),
 155918 	int8(0),
 155919 	int8(-2),
 155920 	int8(-2),
 155921 	int8(0),
 155922 	int8(-5),
 155923 	int8(-6),
 155924 	int8(-8),
 155925 	int8(-6),
 155926 	int8(-6),
 155927 	int8(0),
 155928 	int8(-2),
 155929 	int8(-1),
 155930 	int8(-3),
 155931 	int8(-1),
 155932 	int8(-3),
 155933 	int8(-5),
 155934 	int8(-3),
 155935 	int8(-1),
 155936 	int8(-2),
 155937 	int8(-3),
 155938 	int8(-4),
 155939 	int8(-2),
 155940 	int8(-4),
 155941 	int8(0),
 155942 	int8(0),
 155943 	int8(-3),
 155944 	int8(-2),
 155945 	int8(0),
 155946 	int8(-3),
 155947 	int8(-5),
 155948 	int8(-3),
 155949 	int8(-1),
 155950 	int8(-1),
 155951 	int8(0),
 155952 	int8(-2),
 155953 	int8(-2),
 155954 	int8(0),
 155955 	int8(0),
 155956 	int8(-3),
 155957 	int8(0),
 155958 	int8(-2),
 155959 	int8(0),
 155960 	int8(-2),
 155961 	int8(-4),
 155962 	int8(-4),
 155963 	int8(-6),
 155964 	int8(0),
 155965 	int8(-2),
 155966 	int8(0),
 155967 	int8(-2),
 155968 	int8(-2),
 155969 	int8(-4),
 155970 	int8(-9),
 155971 	int8(-5),
 155972 	int8(-7),
 155973 	int8(-3),
 155974 	int8(-5),
 155975 	int8(-7),
 155976 	int8(-8),
 155977 	int8(0),
 155978 	int8(-2),
 155979 	int8(-12),
 155980 	int8(-9),
 155981 	int8(-5),
 155982 	int8(-8),
 155983 	int8(-2),
 155984 	int8(-2),
 155985 	int8(-1),
 155986 	int8(0),
 155987 	int8(-3),
 155988 	int8(-3),
 155989 	int8(-1),
 155990 	int8(-3),
 155991 	int8(-1),
 155992 	int8(-1),
 155993 	int8(-3),
 155994 	int8(-5),
 155995 	int8(-1),
 155996 	int8(-1),
 155997 	int8(-1),
 155998 	int8(-1),
 155999 	int8(-3),
 156000 	int8(-6),
 156001 	int8(-5),
 156002 	int8(-4),
 156003 	int8(-6),
 156004 	int8(-5),
 156005 	int8(-1),
 156006 	int8(-5),
 156007 	int8(-3),
 156008 	int8(-3),
 156009 	int8(-3),
 156010 	int8(-3),
 156011 	int8(-3),
 156012 	int8(-3),
 156013 	int8(-3),
 156014 	int8(-3),
 156015 	int8(-2),
 156016 	int8(-3),
 156017 	int8(-5),
 156018 	int8(-2),
 156019 	int8(-3),
 156020 	int8(-3),
 156021 	int8(-4),
 156022 	int8(-6),
 156023 	int8(-5),
 156024 	int8(-2),
 156025 	int8(-2),
 156026 	int8(-2),
 156027 	int8(-3),
 156028 	int8(-1),
 156029 	int8(-2),
 156030 	int8(-5),
 156031 	int8(-1),
 156032 	int8(-2),
 156033 	int8(-5),
 156034 	int8(-3),
 156035 	int8(-5),
 156036 	int8(-5),
 156037 	int8(-4),
 156038 	int8(-5),
 156039 	int8(-5),
 156040 	int8(-4),
 156041 	int8(-2),
 156042 	int8(0),
 156043 	int8(-1),
 156044 	int8(0),
 156045 	int8(0),
 156046 	int8(-3),
 156047 	int8(-1),
 156048 	int8(0),
 156049 	int8(-3),
 156050 	int8(-12),
 156051 	int8(-1),
 156052 	int8(0),
 156053 	int8(0),
 156054 	int8(-3),
 156055 	int8(-5),
 156056 	int8(-3),
 156057 	int8(0),
 156058 	int8(-2),
 156059 	int8(-4),
 156060 	int8(-2),
 156061 	int8(-3),
 156062 	int8(-2),
 156063 	int8(0),
 156064 	int8(-3),
 156065 	int8(-5),
 156066 	int8(-6),
 156067 	int8(-5),
 156068 	int8(-6),
 156069 	int8(-2),
 156070 	int8(-2),
 156071 	int8(-5),
 156072 	int8(-11),
 156073 	int8(-1),
 156074 	int8(-2),
 156075 	int8(0),
 156076 	int8(-1),
 156077 	int8(-1),
 156078 	int8(-3),
 156079 	int8(0),
 156080 	int8(-2),
 156081 	int8(-3),
 156082 	int8(-2),
 156083 	int8(-3),
 156084 	int8(-3),
 156085 	int8(-2),
 156086 	int8(-9),
 156087 	int8(-8),
 156088 	int8(-6),
 156089 	int8(-3),
 156090 	int8(-4),
 156091 	int8(-6),
 156092 	int8(-1),
 156093 	int8(-1),
 156094 	int8(-1),
 156095 	int8(-4),
 156096 	int8(-6),
 156097 	int8(-3),
 156098 	int8(0),
 156099 	int8(-2),
 156100 	int8(-1),
 156101 	int8(-3),
 156102 	int8(-1),
 156103 	int8(-3),
 156104 	int8(-6),
 156105 	int8(-7),
 156106 	int8(-6),
 156107 	int8(-1),
 156108 	int8(-8),
 156109 	int8(-1),
 156110 	int8(-4),
 156111 	int8(-8),
 156112 	int8(0),
 156113 	int8(-1),
 156114 	int8(-3),
 156115 	int8(-1),
 156116 	int8(-2),
 156117 	int8(-3),
 156118 	int8(-1),
 156119 	int8(-2),
 156120 	int8(-3),
 156121 	int8(-6),
 156122 	int8(-1),
 156123 	int8(-3),
 156124 	int8(-1),
 156125 	int8(-3),
 156126 	int8(-5),
 156127 	int8(-5),
 156128 	int8(-6),
 156129 	int8(-4),
 156130 	int8(-5),
 156131 	int8(-1),
 156132 	int8(-2),
 156133 	int8(0),
 156134 	int8(-3),
 156135 	int8(-6),
 156136 	int8(-1),
 156137 	int8(-1),
 156138 	int8(-2),
 156139 	int8(-1),
 156140 	int8(-2),
 156141 	int8(-2),
 156142 	int8(-2),
 156143 	int8(0),
 156144 	int8(-2),
 156145 	int8(-2),
 156146 	int8(-2),
 156147 	int8(-1),
 156148 	int8(-2),
 156149 	int8(-2),
 156150 	int8(-1),
 156151 	int8(-1),
 156152 	int8(-4),
 156153 	int8(-2),
 156154 	int8(-5),
 156155 	int8(-1),
 156156 	int8(-2),
 156157 	int8(-1),
 156158 	int8(-1),
 156159 	int8(-2),
 156160 	int8(-3),
 156161 	int8(0),
 156162 	int8(-1),
 156163 	int8(-2),
 156164 	int8(-1),
 156165 	int8(0),
 156166 	int8(-2),
 156167 	int8(-1),
 156168 	int8(-4),
 156169 	int8(-2),
 156170 	int8(-1),
 156171 	int8(-1),
 156172 	int8(-1),
 156173 	int8(-1),
 156174 	int8(-1),
 156175 	int8(-1),
 156176 	int8(-1),
 156177 	int8(-2),
 156178 	int8(0),
 156179 	int8(-2),
 156180 	int8(-4),
 156181 	int8(-2),
 156182 	int8(-2),
 156183 	int8(-3),
 156184 	int8(-1),
 156185 	int8(0),
 156186 	int8(-1),
 156187 	int8(-1),
 156188 	int8(-1),
 156189 	int8(-1),
 156190 	int8(-2),
 156191 	int8(-1),
 156192 	int8(-1),
 156193 	int8(0),
 156194 	int8(-1),
 156195 	int8(-1),
 156196 	int8(-1),
 156197 	int8(-1),
 156198 	int8(-1),
 156199 	int8(-1),
 156200 	int8(-1),
 156201 	int8(-1),
 156202 	int8(-1),
 156203 	int8(0),
 156204 	int8(-3),
 156205 	int8(-1),
 156206 	int8(0),
 156207 	int8(-1),
 156208 	int8(0),
 156209 	int8(0),
 156210 	int8(-1),
 156211 	int8(-1),
 156212 	int8(-3),
 156213 	int8(-2),
 156214 	int8(0),
 156215 	int8(-4),
 156216 	int8(-2),
 156217 	int8(0),
 156218 }
 156219 
 156220 func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int32, yyLookaheadToken Token, pParse uintptr) uint16 {
 156221 	bp := tls.Alloc(160)
 156222 	defer tls.Free(160)
 156223 
 156224 	var yygoto int32
 156225 	var yyact uint16
 156226 	var yymsp uintptr
 156227 	var yysize int32
 156228 
 156229 	_ = yyLookahead
 156230 	_ = yyLookaheadToken
 156231 	yymsp = (*YyParser)(unsafe.Pointer(yypParser)).Fyytos
 156232 
 156233 	{
 156234 		switch yyruleno {
 156235 		case uint32(0):
 156236 			{
 156237 				(*Parse)(unsafe.Pointer(pParse)).Fexplain = U8(1)
 156238 			}
 156239 			break
 156240 		case uint32(1):
 156241 			{
 156242 				(*Parse)(unsafe.Pointer(pParse)).Fexplain = U8(2)
 156243 			}
 156244 			break
 156245 		case uint32(2):
 156246 			{
 156247 				Xsqlite3FinishCoding(tls, pParse)
 156248 			}
 156249 			break
 156250 		case uint32(3):
 156251 			{
 156252 				Xsqlite3BeginTransaction(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 156253 			}
 156254 			break
 156255 		case uint32(4):
 156256 			{
 156257 				*(*int32)(unsafe.Pointer(yymsp + 1*24 + 8)) = TK_DEFERRED
 156258 			}
 156259 			break
 156260 		case uint32(5):
 156261 			fallthrough
 156262 		case uint32(6):
 156263 			fallthrough
 156264 		case uint32(7):
 156265 			fallthrough
 156266 		case uint32(323):
 156267 			{
 156268 				*(*int32)(unsafe.Pointer(yymsp + 8)) = int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor)
 156269 			}
 156270 			break
 156271 		case uint32(8):
 156272 			fallthrough
 156273 		case uint32(9):
 156274 			{
 156275 				Xsqlite3EndTransaction(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24)).Fmajor))
 156276 			}
 156277 			break
 156278 		case uint32(10):
 156279 			{
 156280 				Xsqlite3Savepoint(tls, pParse, SAVEPOINT_BEGIN, yymsp+8)
 156281 			}
 156282 			break
 156283 		case uint32(11):
 156284 			{
 156285 				Xsqlite3Savepoint(tls, pParse, SAVEPOINT_RELEASE, yymsp+8)
 156286 			}
 156287 			break
 156288 		case uint32(12):
 156289 			{
 156290 				Xsqlite3Savepoint(tls, pParse, SAVEPOINT_ROLLBACK, yymsp+8)
 156291 			}
 156292 			break
 156293 		case uint32(13):
 156294 			{
 156295 				Xsqlite3StartTable(tls, pParse, yymsp+libc.UintptrFromInt32(-1)*24+8, yymsp+8, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), 0, 0, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)))
 156296 			}
 156297 			break
 156298 		case uint32(14):
 156299 			{
 156300 				disableLookaside(tls, pParse)
 156301 			}
 156302 			break
 156303 		case uint32(15):
 156304 			fallthrough
 156305 		case uint32(18):
 156306 			fallthrough
 156307 		case uint32(47):
 156308 			fallthrough
 156309 		case uint32(62):
 156310 			fallthrough
 156311 		case uint32(72):
 156312 			fallthrough
 156313 		case uint32(81):
 156314 			fallthrough
 156315 		case uint32(98):
 156316 			fallthrough
 156317 		case uint32(244):
 156318 			{
 156319 				*(*int32)(unsafe.Pointer(yymsp + 1*24 + 8)) = 0
 156320 			}
 156321 			break
 156322 		case uint32(16):
 156323 			{
 156324 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = 1
 156325 			}
 156326 			break
 156327 		case uint32(17):
 156328 			{
 156329 				*(*int32)(unsafe.Pointer(yymsp + 8)) = libc.Bool32(int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Finit.Fbusy) == 0)
 156330 			}
 156331 			break
 156332 		case uint32(19):
 156333 			{
 156334 				Xsqlite3EndTable(tls, pParse, yymsp+libc.UintptrFromInt32(-2)*24+8, yymsp+libc.UintptrFromInt32(-1)*24+8, *(*U32)(unsafe.Pointer(yymsp + 8)), uintptr(0))
 156335 			}
 156336 			break
 156337 		case uint32(20):
 156338 			{
 156339 				Xsqlite3EndTable(tls, pParse, uintptr(0), uintptr(0), uint32(0), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 156340 				Xsqlite3SelectDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 156341 			}
 156342 			break
 156343 		case uint32(21):
 156344 			{
 156345 				*(*U32)(unsafe.Pointer(yymsp + 1*24 + 8)) = U32(0)
 156346 			}
 156347 			break
 156348 		case uint32(22):
 156349 			{
 156350 				*(*U32)(unsafe.Pointer(bp + 40)) = *(*U32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) | *(*U32)(unsafe.Pointer(yymsp + 8))
 156351 			}
 156352 			*(*U32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = *(*U32)(unsafe.Pointer(bp + 40))
 156353 			break
 156354 		case uint32(23):
 156355 			{
 156356 				if (*Token)(unsafe.Pointer(yymsp+8)).Fn == uint32(5) && Xsqlite3_strnicmp(tls, (*Token)(unsafe.Pointer(yymsp+8)).Fz, ts+17625, 5) == 0 {
 156357 					*(*U32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = U32(TF_WithoutRowid | TF_NoVisibleRowid)
 156358 				} else {
 156359 					*(*U32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = U32(0)
 156360 					Xsqlite3ErrorMsg(tls, pParse, ts+24384, libc.VaList(bp, (*Token)(unsafe.Pointer(yymsp+8)).Fn, (*Token)(unsafe.Pointer(yymsp+8)).Fz))
 156361 				}
 156362 			}
 156363 			break
 156364 		case uint32(24):
 156365 			{
 156366 				if (*Token)(unsafe.Pointer(yymsp+8)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, (*Token)(unsafe.Pointer(yymsp+8)).Fz, ts+17538, 6) == 0 {
 156367 					*(*U32)(unsafe.Pointer(bp + 40)) = U32(TF_Strict)
 156368 				} else {
 156369 					*(*U32)(unsafe.Pointer(bp + 40)) = U32(0)
 156370 					Xsqlite3ErrorMsg(tls, pParse, ts+24384, libc.VaList(bp+16, (*Token)(unsafe.Pointer(yymsp+8)).Fn, (*Token)(unsafe.Pointer(yymsp+8)).Fz))
 156371 				}
 156372 			}
 156373 			*(*U32)(unsafe.Pointer(yymsp + 8)) = *(*U32)(unsafe.Pointer(bp + 40))
 156374 			break
 156375 		case uint32(25):
 156376 			{
 156377 				Xsqlite3AddColumn(tls, pParse, *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), *(*Token)(unsafe.Pointer(yymsp + 8)))
 156378 			}
 156379 			break
 156380 		case uint32(26):
 156381 			fallthrough
 156382 		case uint32(65):
 156383 			fallthrough
 156384 		case uint32(104):
 156385 			{
 156386 				(*Token)(unsafe.Pointer(yymsp + 1*24 + 8)).Fn = uint32(0)
 156387 				(*Token)(unsafe.Pointer(yymsp + 1*24 + 8)).Fz = uintptr(0)
 156388 			}
 156389 			break
 156390 		case uint32(27):
 156391 			{
 156392 				(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)).Fn = uint32(int32((int64((*Token)(unsafe.Pointer(yymsp+8)).Fz+uintptr((*Token)(unsafe.Pointer(yymsp+8)).Fn)) - int64((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*24+8)).Fz)) / 1))
 156393 			}
 156394 			break
 156395 		case uint32(28):
 156396 			{
 156397 				(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)).Fn = uint32(int32((int64((*Token)(unsafe.Pointer(yymsp+8)).Fz+uintptr((*Token)(unsafe.Pointer(yymsp+8)).Fn)) - int64((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-5)*24+8)).Fz)) / 1))
 156398 			}
 156399 			break
 156400 		case uint32(29):
 156401 			{
 156402 				(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)).Fn = (*Token)(unsafe.Pointer(yymsp+8)).Fn + uint32(int32((int64((*Token)(unsafe.Pointer(yymsp+8)).Fz)-int64((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8)).Fz))/1))
 156403 			}
 156404 			break
 156405 		case uint32(30):
 156406 			{
 156407 				*(*uintptr)(unsafe.Pointer(yymsp + 1*24 + 8)) = yyLookaheadToken.Fz
 156408 			}
 156409 			break
 156410 		case uint32(31):
 156411 			{
 156412 				*(*Token)(unsafe.Pointer(yymsp + 1*24 + 8)) = yyLookaheadToken
 156413 			}
 156414 			break
 156415 		case uint32(32):
 156416 			fallthrough
 156417 		case uint32(67):
 156418 			{
 156419 				(*Parse)(unsafe.Pointer(pParse)).FconstraintName = *(*Token)(unsafe.Pointer(yymsp + 8))
 156420 			}
 156421 			break
 156422 		case uint32(33):
 156423 			{
 156424 				Xsqlite3AddDefaultValue(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8)).Fz, (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8)).Fz+uintptr((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8)).Fn))
 156425 			}
 156426 			break
 156427 		case uint32(34):
 156428 			{
 156429 				Xsqlite3AddDefaultValue(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-2)*24+8)).Fz+uintptr(1), (*Token)(unsafe.Pointer(yymsp+8)).Fz)
 156430 			}
 156431 			break
 156432 		case uint32(35):
 156433 			{
 156434 				Xsqlite3AddDefaultValue(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-2)*24+8)).Fz, (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8)).Fz+uintptr((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8)).Fn))
 156435 			}
 156436 			break
 156437 		case uint32(36):
 156438 			{
 156439 				var p uintptr = Xsqlite3PExpr(tls, pParse, TK_UMINUS, *(*uintptr)(unsafe.Pointer(yymsp + 8)), uintptr(0))
 156440 				Xsqlite3AddDefaultValue(tls, pParse, p, (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-2)*24+8)).Fz, (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8)).Fz+uintptr((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8)).Fn))
 156441 			}
 156442 			break
 156443 		case uint32(37):
 156444 			{
 156445 				var p uintptr = tokenExpr(tls, pParse, TK_STRING, *(*Token)(unsafe.Pointer(yymsp + 8)))
 156446 				if p != 0 {
 156447 					Xsqlite3ExprIdToTrueFalse(tls, p)
 156448 
 156449 				}
 156450 				Xsqlite3AddDefaultValue(tls, pParse, p, (*Token)(unsafe.Pointer(yymsp+8)).Fz, (*Token)(unsafe.Pointer(yymsp+8)).Fz+uintptr((*Token)(unsafe.Pointer(yymsp+8)).Fn))
 156451 			}
 156452 			break
 156453 		case uint32(38):
 156454 			{
 156455 				Xsqlite3AddNotNull(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + 8)))
 156456 			}
 156457 			break
 156458 		case uint32(39):
 156459 			{
 156460 				Xsqlite3AddPrimaryKey(tls, pParse, uintptr(0), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + 8)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)))
 156461 			}
 156462 			break
 156463 		case uint32(40):
 156464 			{
 156465 				Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), uintptr(0), *(*int32)(unsafe.Pointer(yymsp + 8)), uintptr(0), uintptr(0), 0, 0,
 156466 					uint8(SQLITE_IDXTYPE_UNIQUE))
 156467 			}
 156468 			break
 156469 		case uint32(41):
 156470 			{
 156471 				Xsqlite3AddCheckConstraint(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-2)*24+8)).Fz, (*Token)(unsafe.Pointer(yymsp+8)).Fz)
 156472 			}
 156473 			break
 156474 		case uint32(42):
 156475 			{
 156476 				Xsqlite3CreateForeignKey(tls, pParse, uintptr(0), yymsp+libc.UintptrFromInt32(-2)*24+8, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + 8)))
 156477 			}
 156478 			break
 156479 		case uint32(43):
 156480 			{
 156481 				Xsqlite3DeferForeignKey(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + 8)))
 156482 			}
 156483 			break
 156484 		case uint32(44):
 156485 			{
 156486 				Xsqlite3AddCollateType(tls, pParse, yymsp+8)
 156487 			}
 156488 			break
 156489 		case uint32(45):
 156490 			{
 156491 				Xsqlite3AddGenerated(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), uintptr(0))
 156492 			}
 156493 			break
 156494 		case uint32(46):
 156495 			{
 156496 				Xsqlite3AddGenerated(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), yymsp+8)
 156497 			}
 156498 			break
 156499 		case uint32(48):
 156500 			{
 156501 				*(*int32)(unsafe.Pointer(yymsp + 8)) = 1
 156502 			}
 156503 			break
 156504 		case uint32(49):
 156505 			{
 156506 				*(*int32)(unsafe.Pointer(yymsp + 1*24 + 8)) = OE_None * 0x0101
 156507 			}
 156508 			break
 156509 		case uint32(50):
 156510 			{
 156511 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) & ^*(*int32)(unsafe.Pointer(yymsp + 8 + 4)) | *(*int32)(unsafe.Pointer(yymsp + 8))
 156512 			}
 156513 			break
 156514 		case uint32(51):
 156515 			{
 156516 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = 0
 156517 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 + 4)) = 0x000000
 156518 			}
 156519 			break
 156520 		case uint32(52):
 156521 			{
 156522 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = 0
 156523 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 + 4)) = 0x000000
 156524 			}
 156525 			break
 156526 		case uint32(53):
 156527 			{
 156528 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = *(*int32)(unsafe.Pointer(yymsp + 8))
 156529 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 + 4)) = 0x0000ff
 156530 			}
 156531 			break
 156532 		case uint32(54):
 156533 			{
 156534 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = *(*int32)(unsafe.Pointer(yymsp + 8)) << 8
 156535 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 + 4)) = 0x00ff00
 156536 			}
 156537 			break
 156538 		case uint32(55):
 156539 			{
 156540 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = OE_SetNull
 156541 			}
 156542 			break
 156543 		case uint32(56):
 156544 			{
 156545 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = OE_SetDflt
 156546 			}
 156547 			break
 156548 		case uint32(57):
 156549 			{
 156550 				*(*int32)(unsafe.Pointer(yymsp + 8)) = OE_Cascade
 156551 			}
 156552 			break
 156553 		case uint32(58):
 156554 			{
 156555 				*(*int32)(unsafe.Pointer(yymsp + 8)) = OE_Restrict
 156556 			}
 156557 			break
 156558 		case uint32(59):
 156559 			{
 156560 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = OE_None
 156561 			}
 156562 			break
 156563 		case uint32(60):
 156564 			{
 156565 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = 0
 156566 			}
 156567 			break
 156568 		case uint32(61):
 156569 			fallthrough
 156570 		case uint32(76):
 156571 			fallthrough
 156572 		case uint32(171):
 156573 			{
 156574 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = *(*int32)(unsafe.Pointer(yymsp + 8))
 156575 			}
 156576 			break
 156577 		case uint32(63):
 156578 			fallthrough
 156579 		case uint32(80):
 156580 			fallthrough
 156581 		case uint32(216):
 156582 			fallthrough
 156583 		case uint32(219):
 156584 			fallthrough
 156585 		case uint32(245):
 156586 			{
 156587 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = 1
 156588 			}
 156589 			break
 156590 		case uint32(64):
 156591 			{
 156592 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = 0
 156593 			}
 156594 			break
 156595 		case uint32(66):
 156596 			{
 156597 				(*Parse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0)
 156598 			}
 156599 			break
 156600 		case uint32(68):
 156601 			{
 156602 				Xsqlite3AddPrimaryKey(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + 8)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), 0)
 156603 			}
 156604 			break
 156605 		case uint32(69):
 156606 			{
 156607 				Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + 8)), uintptr(0), uintptr(0), 0, 0,
 156608 					uint8(SQLITE_IDXTYPE_UNIQUE))
 156609 			}
 156610 			break
 156611 		case uint32(70):
 156612 			{
 156613 				Xsqlite3AddCheckConstraint(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*24+8)).Fz, (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8)).Fz)
 156614 			}
 156615 			break
 156616 		case uint32(71):
 156617 			{
 156618 				Xsqlite3CreateForeignKey(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8)), yymsp+libc.UintptrFromInt32(-3)*24+8, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 156619 				Xsqlite3DeferForeignKey(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + 8)))
 156620 			}
 156621 			break
 156622 		case uint32(73):
 156623 			fallthrough
 156624 		case uint32(75):
 156625 			{
 156626 				*(*int32)(unsafe.Pointer(yymsp + 1*24 + 8)) = OE_Default
 156627 			}
 156628 			break
 156629 		case uint32(74):
 156630 			{
 156631 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = *(*int32)(unsafe.Pointer(yymsp + 8))
 156632 			}
 156633 			break
 156634 		case uint32(77):
 156635 			{
 156636 				*(*int32)(unsafe.Pointer(yymsp + 8)) = OE_Ignore
 156637 			}
 156638 			break
 156639 		case uint32(78):
 156640 			fallthrough
 156641 		case uint32(172):
 156642 			{
 156643 				*(*int32)(unsafe.Pointer(yymsp + 8)) = OE_Replace
 156644 			}
 156645 			break
 156646 		case uint32(79):
 156647 			{
 156648 				Xsqlite3DropTable(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)), 0, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 156649 			}
 156650 			break
 156651 		case uint32(82):
 156652 			{
 156653 				Xsqlite3CreateView(tls, pParse, yymsp+libc.UintptrFromInt32(-8)*24+8, yymsp+libc.UintptrFromInt32(-4)*24+8, yymsp+libc.UintptrFromInt32(-3)*24+8, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)))
 156654 			}
 156655 			break
 156656 		case uint32(83):
 156657 			{
 156658 				Xsqlite3DropTable(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)), 1, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 156659 			}
 156660 			break
 156661 		case uint32(84):
 156662 			{
 156663 				*(*SelectDest)(unsafe.Pointer(bp + 56)) = SelectDest{FeDest: U8(SRT_Output)}
 156664 				Xsqlite3Select(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)), bp+56)
 156665 				Xsqlite3SelectDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 156666 			}
 156667 			break
 156668 		case uint32(85):
 156669 			{
 156670 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = attachWithToSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 156671 			}
 156672 			break
 156673 		case uint32(86):
 156674 			{
 156675 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)) = attachWithToSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 156676 			}
 156677 			break
 156678 		case uint32(87):
 156679 			{
 156680 				var p uintptr = *(*uintptr)(unsafe.Pointer(yymsp + 8))
 156681 				if p != 0 {
 156682 					parserDoubleLinkSelect(tls, pParse, p)
 156683 				}
 156684 				*(*uintptr)(unsafe.Pointer(yymsp + 8)) = p
 156685 			}
 156686 			break
 156687 		case uint32(88):
 156688 			{
 156689 				var pRhs uintptr = *(*uintptr)(unsafe.Pointer(yymsp + 8))
 156690 				var pLhs uintptr = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8))
 156691 				if pRhs != 0 && (*Select)(unsafe.Pointer(pRhs)).FpPrior != 0 {
 156692 					var pFrom uintptr
 156693 
 156694 					(*Token)(unsafe.Pointer(bp + 96)).Fn = uint32(0)
 156695 					parserDoubleLinkSelect(tls, pParse, pRhs)
 156696 					pFrom = Xsqlite3SrcListAppendFromTerm(tls, pParse, uintptr(0), uintptr(0), uintptr(0), bp+96, pRhs, uintptr(0))
 156697 					pRhs = Xsqlite3SelectNew(tls, pParse, uintptr(0), pFrom, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0))
 156698 				}
 156699 				if pRhs != 0 {
 156700 					(*Select)(unsafe.Pointer(pRhs)).Fop = U8(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 156701 					(*Select)(unsafe.Pointer(pRhs)).FpPrior = pLhs
 156702 					if pLhs != 0 {
 156703 						*(*U32)(unsafe.Pointer(pLhs + 4)) &= libc.Uint32FromInt32(libc.CplInt32(SF_MultiValue))
 156704 					}
 156705 					*(*U32)(unsafe.Pointer(pRhs + 4)) &= libc.Uint32FromInt32(libc.CplInt32(SF_MultiValue))
 156706 					if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) != TK_ALL {
 156707 						(*Parse)(unsafe.Pointer(pParse)).FhasCompound = U8(1)
 156708 					}
 156709 				} else {
 156710 					Xsqlite3SelectDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pLhs)
 156711 				}
 156712 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = pRhs
 156713 			}
 156714 			break
 156715 		case uint32(89):
 156716 			fallthrough
 156717 		case uint32(91):
 156718 			{
 156719 				*(*int32)(unsafe.Pointer(yymsp + 8)) = int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor)
 156720 			}
 156721 			break
 156722 		case uint32(90):
 156723 			{
 156724 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = TK_ALL
 156725 			}
 156726 			break
 156727 		case uint32(92):
 156728 			{
 156729 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8)) = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), uint32(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8))), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 156730 			}
 156731 			break
 156732 		case uint32(93):
 156733 			{
 156734 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-9)*24 + 8)) = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), uint32(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8))), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 156735 				if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-9)*24 + 8)) != 0 {
 156736 					(*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-9)*24 + 8)))).FpWinDefn = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8))
 156737 				} else {
 156738 					Xsqlite3WindowListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)))
 156739 				}
 156740 			}
 156741 			break
 156742 		case uint32(94):
 156743 			{
 156744 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)) = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0))
 156745 			}
 156746 			break
 156747 		case uint32(95):
 156748 			{
 156749 				var pRight uintptr
 156750 				var pLeft uintptr = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8))
 156751 				pRight = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values|SF_MultiValue), uintptr(0))
 156752 				if pLeft != 0 {
 156753 					*(*U32)(unsafe.Pointer(pLeft + 4)) &= libc.Uint32FromInt32(libc.CplInt32(SF_MultiValue))
 156754 				}
 156755 				if pRight != 0 {
 156756 					(*Select)(unsafe.Pointer(pRight)).Fop = U8(TK_ALL)
 156757 					(*Select)(unsafe.Pointer(pRight)).FpPrior = pLeft
 156758 					*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = pRight
 156759 				} else {
 156760 					*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = pLeft
 156761 				}
 156762 			}
 156763 			break
 156764 		case uint32(96):
 156765 			{
 156766 				*(*int32)(unsafe.Pointer(yymsp + 8)) = SF_Distinct
 156767 			}
 156768 			break
 156769 		case uint32(97):
 156770 			{
 156771 				*(*int32)(unsafe.Pointer(yymsp + 8)) = SF_All
 156772 			}
 156773 			break
 156774 		case uint32(99):
 156775 			fallthrough
 156776 		case uint32(132):
 156777 			fallthrough
 156778 		case uint32(142):
 156779 			fallthrough
 156780 		case uint32(232):
 156781 			fallthrough
 156782 		case uint32(235):
 156783 			fallthrough
 156784 		case uint32(240):
 156785 			{
 156786 				*(*uintptr)(unsafe.Pointer(yymsp + 1*24 + 8)) = uintptr(0)
 156787 			}
 156788 			break
 156789 		case uint32(100):
 156790 			{
 156791 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)))
 156792 				if (*Token)(unsafe.Pointer(yymsp+8)).Fn > uint32(0) {
 156793 					Xsqlite3ExprListSetName(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), yymsp+8, 1)
 156794 				}
 156795 				Xsqlite3ExprListSetSpan(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 156796 			}
 156797 			break
 156798 		case uint32(101):
 156799 			{
 156800 				var p uintptr = Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ASTERISK, uintptr(0))
 156801 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), p)
 156802 			}
 156803 			break
 156804 		case uint32(102):
 156805 			{
 156806 				var pRight uintptr = Xsqlite3PExpr(tls, pParse, TK_ASTERISK, uintptr(0), uintptr(0))
 156807 				var pLeft uintptr = tokenExpr(tls, pParse, TK_ID, *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)))
 156808 				var pDot uintptr = Xsqlite3PExpr(tls, pParse, TK_DOT, pLeft, pRight)
 156809 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), pDot)
 156810 			}
 156811 			break
 156812 		case uint32(103):
 156813 			fallthrough
 156814 		case uint32(115):
 156815 			fallthrough
 156816 		case uint32(256):
 156817 			fallthrough
 156818 		case uint32(257):
 156819 			{
 156820 				*(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = *(*Token)(unsafe.Pointer(yymsp + 8))
 156821 			}
 156822 			break
 156823 		case uint32(105):
 156824 			fallthrough
 156825 		case uint32(108):
 156826 			{
 156827 				*(*uintptr)(unsafe.Pointer(yymsp + 1*24 + 8)) = uintptr(0)
 156828 			}
 156829 			break
 156830 		case uint32(106):
 156831 			{
 156832 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = *(*uintptr)(unsafe.Pointer(yymsp + 8))
 156833 				Xsqlite3SrcListShiftJoinType(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 156834 			}
 156835 			break
 156836 		case uint32(107):
 156837 			{
 156838 				if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) != 0 && (*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))).FnSrc > 0 {
 156839 					(*SrcItem)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) + 8 + uintptr((*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))).FnSrc-1)*104)).Ffg.Fjointype = U8(*(*int32)(unsafe.Pointer(yymsp + 8)))
 156840 				}
 156841 			}
 156842 			break
 156843 		case uint32(109):
 156844 			{
 156845 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), yymsp+libc.UintptrFromInt32(-3)*24+8, yymsp+libc.UintptrFromInt32(-2)*24+8, yymsp+libc.UintptrFromInt32(-1)*24+8, uintptr(0), yymsp+8)
 156846 			}
 156847 			break
 156848 		case uint32(110):
 156849 			{
 156850 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)), yymsp+libc.UintptrFromInt32(-4)*24+8, yymsp+libc.UintptrFromInt32(-3)*24+8, yymsp+libc.UintptrFromInt32(-2)*24+8, uintptr(0), yymsp+8)
 156851 				Xsqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)), yymsp+libc.UintptrFromInt32(-1)*24+8)
 156852 			}
 156853 			break
 156854 		case uint32(111):
 156855 			{
 156856 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8)), yymsp+libc.UintptrFromInt32(-6)*24+8, yymsp+libc.UintptrFromInt32(-5)*24+8, yymsp+libc.UintptrFromInt32(-1)*24+8, uintptr(0), yymsp+8)
 156857 				Xsqlite3SrcListFuncArgs(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)))
 156858 			}
 156859 			break
 156860 		case uint32(112):
 156861 			{
 156862 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)), uintptr(0), uintptr(0), yymsp+libc.UintptrFromInt32(-1)*24+8, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)), yymsp+8)
 156863 
 156864 			}
 156865 			break
 156866 		case uint32(113):
 156867 			{
 156868 				if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)) == uintptr(0) && (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8)).Fn == uint32(0) && (*OnOrUsing)(unsafe.Pointer(yymsp+8)).FpOn == uintptr(0) && (*OnOrUsing)(unsafe.Pointer(yymsp+8)).FpUsing == uintptr(0) {
 156869 					*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8))
 156870 				} else if (*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)))).FnSrc == 1 {
 156871 					*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)), uintptr(0), uintptr(0), yymsp+libc.UintptrFromInt32(-1)*24+8, uintptr(0), yymsp+8)
 156872 					if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)) != 0 {
 156873 						var pNew uintptr = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)) + 8 + uintptr((*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)))).FnSrc-1)*104
 156874 						var pOld uintptr = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)) + 8
 156875 						(*SrcItem)(unsafe.Pointer(pNew)).FzName = (*SrcItem)(unsafe.Pointer(pOld)).FzName
 156876 						(*SrcItem)(unsafe.Pointer(pNew)).FzDatabase = (*SrcItem)(unsafe.Pointer(pOld)).FzDatabase
 156877 						(*SrcItem)(unsafe.Pointer(pNew)).FpSelect = (*SrcItem)(unsafe.Pointer(pOld)).FpSelect
 156878 						if (*SrcItem)(unsafe.Pointer(pNew)).FpSelect != 0 && (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pNew)).FpSelect)).FselFlags&U32(SF_NestedFrom) != U32(0) {
 156879 							libc.SetBitFieldPtr16Uint32(pNew+60+4, uint32(1), 13, 0x2000)
 156880 						}
 156881 						if uint32(int32(*(*uint16)(unsafe.Pointer(pOld + 60 + 4))&0x4>>2)) != 0 {
 156882 							*(*uintptr)(unsafe.Pointer(pNew + 88)) = *(*uintptr)(unsafe.Pointer(pOld + 88))
 156883 							*(*uintptr)(unsafe.Pointer(pOld + 88)) = uintptr(0)
 156884 							libc.SetBitFieldPtr16Uint32(pOld+60+4, uint32(0), 2, 0x4)
 156885 							libc.SetBitFieldPtr16Uint32(pNew+60+4, uint32(1), 2, 0x4)
 156886 						}
 156887 						(*SrcItem)(unsafe.Pointer(pOld)).FzName = libc.AssignPtrUintptr(pOld+8, uintptr(0))
 156888 						(*SrcItem)(unsafe.Pointer(pOld)).FpSelect = uintptr(0)
 156889 					}
 156890 					Xsqlite3SrcListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)))
 156891 				} else {
 156892 					var pSubquery uintptr
 156893 					Xsqlite3SrcListShiftJoinType(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)))
 156894 					pSubquery = Xsqlite3SelectNew(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_NestedFrom), uintptr(0))
 156895 					*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)), uintptr(0), uintptr(0), yymsp+libc.UintptrFromInt32(-1)*24+8, pSubquery, yymsp+8)
 156896 				}
 156897 
 156898 			}
 156899 			break
 156900 		case uint32(114):
 156901 			fallthrough
 156902 		case uint32(129):
 156903 			{
 156904 				(*Token)(unsafe.Pointer(yymsp + 1*24 + 8)).Fz = uintptr(0)
 156905 				(*Token)(unsafe.Pointer(yymsp + 1*24 + 8)).Fn = uint32(0)
 156906 			}
 156907 			break
 156908 		case uint32(116):
 156909 			{
 156910 				*(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), yymsp+8, uintptr(0))
 156911 				if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME && *(*uintptr)(unsafe.Pointer(bp + 40)) != 0 {
 156912 					Xsqlite3RenameTokenMap(tls, pParse, (*SrcItem)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40))+8)).FzName, yymsp+8)
 156913 				}
 156914 			}
 156915 			*(*uintptr)(unsafe.Pointer(yymsp + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 156916 			break
 156917 		case uint32(117):
 156918 			{
 156919 				*(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), yymsp+libc.UintptrFromInt32(-2)*24+8, yymsp+8)
 156920 				if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME && *(*uintptr)(unsafe.Pointer(bp + 40)) != 0 {
 156921 					Xsqlite3RenameTokenMap(tls, pParse, (*SrcItem)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40))+8)).FzName, yymsp+8)
 156922 				}
 156923 			}
 156924 			*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 156925 			break
 156926 		case uint32(118):
 156927 			{
 156928 				*(*uintptr)(unsafe.Pointer(yymsp + 8)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), yymsp+8, uintptr(0))
 156929 			}
 156930 			break
 156931 		case uint32(119):
 156932 			{
 156933 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), yymsp+libc.UintptrFromInt32(-2)*24+8, yymsp+8)
 156934 			}
 156935 			break
 156936 		case uint32(120):
 156937 			{
 156938 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), yymsp+libc.UintptrFromInt32(-4)*24+8, yymsp+libc.UintptrFromInt32(-2)*24+8)
 156939 				if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) != 0 {
 156940 					(*SrcItem)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) + 8)).FzAlias = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, yymsp+8)
 156941 				}
 156942 			}
 156943 			break
 156944 		case uint32(121):
 156945 			{
 156946 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), yymsp+libc.UintptrFromInt32(-2)*24+8, uintptr(0))
 156947 				if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) != 0 {
 156948 					(*SrcItem)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) + 8)).FzAlias = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, yymsp+8)
 156949 				}
 156950 			}
 156951 			break
 156952 		case uint32(122):
 156953 			{
 156954 				*(*int32)(unsafe.Pointer(yymsp + 8)) = JT_INNER
 156955 			}
 156956 			break
 156957 		case uint32(123):
 156958 			{
 156959 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = Xsqlite3JoinType(tls, pParse, yymsp+libc.UintptrFromInt32(-1)*24+8, uintptr(0), uintptr(0))
 156960 			}
 156961 			break
 156962 		case uint32(124):
 156963 			{
 156964 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = Xsqlite3JoinType(tls, pParse, yymsp+libc.UintptrFromInt32(-2)*24+8, yymsp+libc.UintptrFromInt32(-1)*24+8, uintptr(0))
 156965 			}
 156966 			break
 156967 		case uint32(125):
 156968 			{
 156969 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)) = Xsqlite3JoinType(tls, pParse, yymsp+libc.UintptrFromInt32(-3)*24+8, yymsp+libc.UintptrFromInt32(-2)*24+8, yymsp+libc.UintptrFromInt32(-1)*24+8)
 156970 			}
 156971 			break
 156972 		case uint32(126):
 156973 			{
 156974 				(*OnOrUsing)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)).FpOn = *(*uintptr)(unsafe.Pointer(yymsp + 8))
 156975 				(*OnOrUsing)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)).FpUsing = uintptr(0)
 156976 			}
 156977 			break
 156978 		case uint32(127):
 156979 			{
 156980 				(*OnOrUsing)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)).FpOn = uintptr(0)
 156981 				(*OnOrUsing)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)).FpUsing = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8))
 156982 			}
 156983 			break
 156984 		case uint32(128):
 156985 			{
 156986 				(*OnOrUsing)(unsafe.Pointer(yymsp + 1*24 + 8)).FpOn = uintptr(0)
 156987 				(*OnOrUsing)(unsafe.Pointer(yymsp + 1*24 + 8)).FpUsing = uintptr(0)
 156988 			}
 156989 			break
 156990 		case uint32(130):
 156991 			{
 156992 				*(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = *(*Token)(unsafe.Pointer(yymsp + 8))
 156993 			}
 156994 			break
 156995 		case uint32(131):
 156996 			{
 156997 				(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)).Fz = uintptr(0)
 156998 				(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)).Fn = uint32(1)
 156999 			}
 157000 			break
 157001 		case uint32(133):
 157002 			fallthrough
 157003 		case uint32(143):
 157004 			{
 157005 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = *(*uintptr)(unsafe.Pointer(yymsp + 8))
 157006 			}
 157007 			break
 157008 		case uint32(134):
 157009 			{
 157010 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)))
 157011 				Xsqlite3ExprListSetSortOrder(tls, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + 8)))
 157012 			}
 157013 			break
 157014 		case uint32(135):
 157015 			{
 157016 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)))
 157017 				Xsqlite3ExprListSetSortOrder(tls, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + 8)))
 157018 			}
 157019 			break
 157020 		case uint32(136):
 157021 			{
 157022 				*(*int32)(unsafe.Pointer(yymsp + 8)) = SQLITE_SO_ASC
 157023 			}
 157024 			break
 157025 		case uint32(137):
 157026 			{
 157027 				*(*int32)(unsafe.Pointer(yymsp + 8)) = SQLITE_SO_DESC
 157028 			}
 157029 			break
 157030 		case uint32(138):
 157031 			fallthrough
 157032 		case uint32(141):
 157033 			{
 157034 				*(*int32)(unsafe.Pointer(yymsp + 1*24 + 8)) = -1
 157035 			}
 157036 			break
 157037 		case uint32(139):
 157038 			{
 157039 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = SQLITE_SO_ASC
 157040 			}
 157041 			break
 157042 		case uint32(140):
 157043 			{
 157044 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = SQLITE_SO_DESC
 157045 			}
 157046 			break
 157047 		case uint32(144):
 157048 			fallthrough
 157049 		case uint32(146):
 157050 			fallthrough
 157051 		case uint32(151):
 157052 			fallthrough
 157053 		case uint32(153):
 157054 			fallthrough
 157055 		case uint32(229):
 157056 			fallthrough
 157057 		case uint32(231):
 157058 			fallthrough
 157059 		case uint32(250):
 157060 			{
 157061 				*(*uintptr)(unsafe.Pointer(yymsp + 1*24 + 8)) = uintptr(0)
 157062 			}
 157063 			break
 157064 		case uint32(145):
 157065 			fallthrough
 157066 		case uint32(152):
 157067 			fallthrough
 157068 		case uint32(154):
 157069 			fallthrough
 157070 		case uint32(228):
 157071 			fallthrough
 157072 		case uint32(249):
 157073 			{
 157074 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = *(*uintptr)(unsafe.Pointer(yymsp + 8))
 157075 			}
 157076 			break
 157077 		case uint32(147):
 157078 			{
 157079 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_LIMIT, *(*uintptr)(unsafe.Pointer(yymsp + 8)), uintptr(0))
 157080 			}
 157081 			break
 157082 		case uint32(148):
 157083 			{
 157084 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_LIMIT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157085 			}
 157086 			break
 157087 		case uint32(149):
 157088 			{
 157089 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_LIMIT, *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)))
 157090 			}
 157091 			break
 157092 		case uint32(150):
 157093 			{
 157094 				Xsqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), yymsp+libc.UintptrFromInt32(-1)*24+8)
 157095 				Xsqlite3DeleteFrom(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)), uintptr(0), uintptr(0))
 157096 			}
 157097 			break
 157098 		case uint32(155):
 157099 			{
 157100 				Xsqlite3AddReturning(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157101 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = uintptr(0)
 157102 			}
 157103 			break
 157104 		case uint32(156):
 157105 			{
 157106 				Xsqlite3AddReturning(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157107 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8))
 157108 			}
 157109 			break
 157110 		case uint32(157):
 157111 			{
 157112 				Xsqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)), yymsp+libc.UintptrFromInt32(-4)*24+8)
 157113 				Xsqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), ts+24411)
 157114 				if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) != 0 {
 157115 					var pFromClause uintptr = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8))
 157116 					if (*SrcList)(unsafe.Pointer(pFromClause)).FnSrc > 1 {
 157117 						var pSubquery uintptr
 157118 
 157119 						pSubquery = Xsqlite3SelectNew(tls, pParse, uintptr(0), pFromClause, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_NestedFrom), uintptr(0))
 157120 						(*Token)(unsafe.Pointer(bp + 112)).Fn = uint32(0)
 157121 						(*Token)(unsafe.Pointer(bp + 112)).Fz = uintptr(0)
 157122 						pFromClause = Xsqlite3SrcListAppendFromTerm(tls, pParse, uintptr(0), uintptr(0), uintptr(0), bp+112, pSubquery, uintptr(0))
 157123 					}
 157124 					*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)) = Xsqlite3SrcListAppendList(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)), pFromClause)
 157125 				}
 157126 				Xsqlite3Update(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8)), uintptr(0), uintptr(0), uintptr(0))
 157127 			}
 157128 			break
 157129 		case uint32(158):
 157130 			{
 157131 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157132 				Xsqlite3ExprListSetName(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), yymsp+libc.UintptrFromInt32(-2)*24+8, 1)
 157133 			}
 157134 			break
 157135 		case uint32(159):
 157136 			{
 157137 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8)) = Xsqlite3ExprListAppendVector(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157138 			}
 157139 			break
 157140 		case uint32(160):
 157141 			{
 157142 				*(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157143 				Xsqlite3ExprListSetName(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 40)), yymsp+libc.UintptrFromInt32(-2)*24+8, 1)
 157144 			}
 157145 			*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 157146 			break
 157147 		case uint32(161):
 157148 			{
 157149 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3ExprListAppendVector(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157150 			}
 157151 			break
 157152 		case uint32(162):
 157153 			{
 157154 				Xsqlite3Insert(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157155 			}
 157156 			break
 157157 		case uint32(163):
 157158 			{
 157159 				Xsqlite3Insert(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8)), uintptr(0))
 157160 			}
 157161 			break
 157162 		case uint32(164):
 157163 			{
 157164 				*(*uintptr)(unsafe.Pointer(yymsp + 1*24 + 8)) = uintptr(0)
 157165 			}
 157166 			break
 157167 		case uint32(165):
 157168 			{
 157169 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = uintptr(0)
 157170 				Xsqlite3AddReturning(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157171 			}
 157172 			break
 157173 		case uint32(166):
 157174 			{
 157175 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-11)*24 + 8)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157176 			}
 157177 			break
 157178 		case uint32(167):
 157179 			{
 157180 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157181 			}
 157182 			break
 157183 		case uint32(168):
 157184 			{
 157185 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0))
 157186 			}
 157187 			break
 157188 		case uint32(169):
 157189 			{
 157190 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), uintptr(0))
 157191 			}
 157192 			break
 157193 		case uint32(170):
 157194 			{
 157195 				Xsqlite3AddReturning(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157196 			}
 157197 			break
 157198 		case uint32(173):
 157199 			{
 157200 				*(*uintptr)(unsafe.Pointer(yymsp + 1*24 + 8)) = uintptr(0)
 157201 			}
 157202 			break
 157203 		case uint32(174):
 157204 			{
 157205 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8))
 157206 			}
 157207 			break
 157208 		case uint32(175):
 157209 			{
 157210 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = Xsqlite3IdListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), yymsp+8)
 157211 			}
 157212 			break
 157213 		case uint32(176):
 157214 			{
 157215 				*(*uintptr)(unsafe.Pointer(yymsp + 8)) = Xsqlite3IdListAppend(tls, pParse, uintptr(0), yymsp+8)
 157216 			}
 157217 			break
 157218 		case uint32(177):
 157219 			{
 157220 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8))
 157221 			}
 157222 			break
 157223 		case uint32(178):
 157224 			fallthrough
 157225 		case uint32(179):
 157226 			{
 157227 				*(*uintptr)(unsafe.Pointer(yymsp + 8)) = tokenExpr(tls, pParse, TK_ID, *(*Token)(unsafe.Pointer(yymsp + 8)))
 157228 			}
 157229 			break
 157230 		case uint32(180):
 157231 			{
 157232 				var temp1 uintptr = tokenExpr(tls, pParse, TK_ID, *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)))
 157233 				var temp2 uintptr = tokenExpr(tls, pParse, TK_ID, *(*Token)(unsafe.Pointer(yymsp + 8)))
 157234 				*(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3PExpr(tls, pParse, TK_DOT, temp1, temp2)
 157235 			}
 157236 			*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 157237 			break
 157238 		case uint32(181):
 157239 			{
 157240 				var temp1 uintptr = tokenExpr(tls, pParse, TK_ID, *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)))
 157241 				var temp2 uintptr = tokenExpr(tls, pParse, TK_ID, *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)))
 157242 				var temp3 uintptr = tokenExpr(tls, pParse, TK_ID, *(*Token)(unsafe.Pointer(yymsp + 8)))
 157243 				var temp4 uintptr = Xsqlite3PExpr(tls, pParse, TK_DOT, temp2, temp3)
 157244 				if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME {
 157245 					Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), temp1)
 157246 				}
 157247 				*(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3PExpr(tls, pParse, TK_DOT, temp1, temp4)
 157248 			}
 157249 			*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 157250 			break
 157251 		case uint32(182):
 157252 			fallthrough
 157253 		case uint32(183):
 157254 			{
 157255 				*(*uintptr)(unsafe.Pointer(yymsp + 8)) = tokenExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor), *(*Token)(unsafe.Pointer(yymsp + 8)))
 157256 			}
 157257 			break
 157258 		case uint32(184):
 157259 			{
 157260 				*(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_INTEGER, yymsp+8, 1)
 157261 				if *(*uintptr)(unsafe.Pointer(bp + 40)) != 0 {
 157262 					*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 52)) = int32((int64((*Token)(unsafe.Pointer(yymsp+8)).Fz) - int64((*Parse)(unsafe.Pointer(pParse)).FzTail)) / 1)
 157263 				}
 157264 			}
 157265 			*(*uintptr)(unsafe.Pointer(yymsp + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 157266 			break
 157267 		case uint32(185):
 157268 			{
 157269 				if !(int32(*(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(yymsp + 8)).Fz))) == '#' && int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(yymsp+8)).Fz + 1)))])&0x04 != 0) {
 157270 					var n U32 = (*Token)(unsafe.Pointer(yymsp + 8)).Fn
 157271 					*(*uintptr)(unsafe.Pointer(yymsp + 8)) = tokenExpr(tls, pParse, TK_VARIABLE, *(*Token)(unsafe.Pointer(yymsp + 8)))
 157272 					Xsqlite3ExprAssignVarNumber(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)), n)
 157273 				} else {
 157274 					*(*Token)(unsafe.Pointer(bp + 128)) = *(*Token)(unsafe.Pointer(yymsp + 8))
 157275 
 157276 					if int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0 {
 157277 						Xsqlite3ErrorMsg(tls, pParse, ts+24420, libc.VaList(bp+32, bp+128))
 157278 						*(*uintptr)(unsafe.Pointer(yymsp + 8)) = uintptr(0)
 157279 					} else {
 157280 						*(*uintptr)(unsafe.Pointer(yymsp + 8)) = Xsqlite3PExpr(tls, pParse, TK_REGISTER, uintptr(0), uintptr(0))
 157281 						if *(*uintptr)(unsafe.Pointer(yymsp + 8)) != 0 {
 157282 							Xsqlite3GetInt32(tls, (*Token)(unsafe.Pointer(bp+128)).Fz+1, *(*uintptr)(unsafe.Pointer(yymsp + 8))+44)
 157283 						}
 157284 					}
 157285 				}
 157286 			}
 157287 			break
 157288 		case uint32(186):
 157289 			{
 157290 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = Xsqlite3ExprAddCollateToken(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), yymsp+8, 1)
 157291 			}
 157292 			break
 157293 		case uint32(187):
 157294 			{
 157295 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)) = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_CAST, yymsp+libc.UintptrFromInt32(-1)*24+8, 1)
 157296 				Xsqlite3ExprAttachSubtrees(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)), uintptr(0))
 157297 			}
 157298 			break
 157299 		case uint32(188):
 157300 			{
 157301 				*(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3ExprFunction(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), yymsp+libc.UintptrFromInt32(-4)*24+8, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)))
 157302 			}
 157303 			*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 157304 			break
 157305 		case uint32(189):
 157306 			{
 157307 				*(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3ExprFunction(tls, pParse, uintptr(0), yymsp+libc.UintptrFromInt32(-3)*24+8, 0)
 157308 			}
 157309 			*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 157310 			break
 157311 		case uint32(190):
 157312 			{
 157313 				*(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3ExprFunction(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), yymsp+libc.UintptrFromInt32(-5)*24+8, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)))
 157314 				Xsqlite3WindowAttach(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 40)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157315 			}
 157316 			*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 157317 			break
 157318 		case uint32(191):
 157319 			{
 157320 				*(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3ExprFunction(tls, pParse, uintptr(0), yymsp+libc.UintptrFromInt32(-4)*24+8, 0)
 157321 				Xsqlite3WindowAttach(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 40)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157322 			}
 157323 			*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 157324 			break
 157325 		case uint32(192):
 157326 			{
 157327 				*(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3ExprFunction(tls, pParse, uintptr(0), yymsp+8, 0)
 157328 			}
 157329 			*(*uintptr)(unsafe.Pointer(yymsp + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 157330 			break
 157331 		case uint32(193):
 157332 			{
 157333 				var pList uintptr = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 157334 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_VECTOR, uintptr(0), uintptr(0))
 157335 				if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) != 0 {
 157336 					*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) + 32)) = pList
 157337 					if (*ExprList)(unsafe.Pointer(pList)).FnExpr != 0 {
 157338 						*(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) + 4)) |= (*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(pList+8)).FpExpr)).Fflags & U32(EP_Collate|EP_Subquery|EP_HasFunc)
 157339 					}
 157340 				} else {
 157341 					Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pList)
 157342 				}
 157343 			}
 157344 			break
 157345 		case uint32(194):
 157346 			{
 157347 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = Xsqlite3ExprAnd(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157348 			}
 157349 			break
 157350 		case uint32(195):
 157351 			fallthrough
 157352 		case uint32(196):
 157353 			fallthrough
 157354 		case uint32(197):
 157355 			fallthrough
 157356 		case uint32(198):
 157357 			fallthrough
 157358 		case uint32(199):
 157359 			fallthrough
 157360 		case uint32(200):
 157361 			fallthrough
 157362 		case uint32(201):
 157363 			{
 157364 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = Xsqlite3PExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24)).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157365 			}
 157366 			break
 157367 		case uint32(202):
 157368 			{
 157369 				*(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = *(*Token)(unsafe.Pointer(yymsp + 8))
 157370 				*(*uint32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 + 8)) |= 0x80000000
 157371 			}
 157372 			break
 157373 		case uint32(203):
 157374 			{
 157375 				var pList uintptr
 157376 				var bNot int32 = int32((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8)).Fn & 0x80000000)
 157377 				*(*uint32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 + 8)) &= uint32(0x7fffffff)
 157378 				pList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157379 				pList = Xsqlite3ExprListAppend(tls, pParse, pList, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)))
 157380 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = Xsqlite3ExprFunction(tls, pParse, pList, yymsp+libc.UintptrFromInt32(-1)*24+8, 0)
 157381 				if bNot != 0 {
 157382 					*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), uintptr(0))
 157383 				}
 157384 				if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) != 0 {
 157385 					*(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) + 4)) |= U32(EP_InfixFunc)
 157386 				}
 157387 			}
 157388 			break
 157389 		case uint32(204):
 157390 			{
 157391 				var pList uintptr
 157392 				var bNot int32 = int32((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*24+8)).Fn & 0x80000000)
 157393 				*(*uint32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 + 8)) &= uint32(0x7fffffff)
 157394 				pList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)))
 157395 				pList = Xsqlite3ExprListAppend(tls, pParse, pList, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)))
 157396 				pList = Xsqlite3ExprListAppend(tls, pParse, pList, *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157397 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3ExprFunction(tls, pParse, pList, yymsp+libc.UintptrFromInt32(-3)*24+8, 0)
 157398 				if bNot != 0 {
 157399 					*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), uintptr(0))
 157400 				}
 157401 				if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) != 0 {
 157402 					*(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) + 4)) |= U32(EP_InfixFunc)
 157403 				}
 157404 			}
 157405 			break
 157406 		case uint32(205):
 157407 			{
 157408 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = Xsqlite3PExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), uintptr(0))
 157409 			}
 157410 			break
 157411 		case uint32(206):
 157412 			{
 157413 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_NOTNULL, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), uintptr(0))
 157414 			}
 157415 			break
 157416 		case uint32(207):
 157417 			{
 157418 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_IS, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157419 				binaryToUnaryIfNull(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), TK_ISNULL)
 157420 			}
 157421 			break
 157422 		case uint32(208):
 157423 			{
 157424 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_ISNOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157425 				binaryToUnaryIfNull(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)), TK_NOTNULL)
 157426 			}
 157427 			break
 157428 		case uint32(209):
 157429 			{
 157430 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_IS, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157431 				binaryToUnaryIfNull(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)), TK_ISNULL)
 157432 			}
 157433 			break
 157434 		case uint32(210):
 157435 			{
 157436 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_ISNOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157437 				binaryToUnaryIfNull(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), TK_NOTNULL)
 157438 			}
 157439 			break
 157440 		case uint32(211):
 157441 			fallthrough
 157442 		case uint32(212):
 157443 			{
 157444 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = Xsqlite3PExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24)).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + 8)), uintptr(0))
 157445 			}
 157446 			break
 157447 		case uint32(213):
 157448 			{
 157449 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = Xsqlite3PExpr(tls, pParse, func() int32 {
 157450 					if int32((*YyStackEntry)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24)).Fmajor) == TK_PLUS {
 157451 						return TK_UPLUS
 157452 					}
 157453 					return TK_UMINUS
 157454 				}(), *(*uintptr)(unsafe.Pointer(yymsp + 8)), uintptr(0))
 157455 
 157456 			}
 157457 			break
 157458 		case uint32(214):
 157459 			{
 157460 				var pList uintptr = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)))
 157461 				pList = Xsqlite3ExprListAppend(tls, pParse, pList, *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157462 				*(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3ExprFunction(tls, pParse, pList, yymsp+libc.UintptrFromInt32(-1)*24+8, 0)
 157463 			}
 157464 			*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 157465 			break
 157466 		case uint32(215):
 157467 			fallthrough
 157468 		case uint32(218):
 157469 			{
 157470 				*(*int32)(unsafe.Pointer(yymsp + 8)) = 0
 157471 			}
 157472 			break
 157473 		case uint32(217):
 157474 			{
 157475 				var pList uintptr = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)))
 157476 				pList = Xsqlite3ExprListAppend(tls, pParse, pList, *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157477 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_BETWEEN, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), uintptr(0))
 157478 				if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) != 0 {
 157479 					*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) + 32)) = pList
 157480 				} else {
 157481 					Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pList)
 157482 				}
 157483 				if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)) != 0 {
 157484 					*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), uintptr(0))
 157485 				}
 157486 			}
 157487 			break
 157488 		case uint32(220):
 157489 			{
 157490 				if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) == uintptr(0) {
 157491 					Xsqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)))
 157492 					*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_STRING, func() uintptr {
 157493 						if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)) != 0 {
 157494 							return ts + 9046
 157495 						}
 157496 						return ts + 9051
 157497 					}())
 157498 					if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) != 0 {
 157499 						Xsqlite3ExprIdToTrueFalse(tls, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)))
 157500 					}
 157501 				} else {
 157502 					var pRHS uintptr = (*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) + 8)).FpExpr
 157503 					if (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))).FnExpr == 1 && Xsqlite3ExprIsConstant(tls, pRHS) != 0 && int32((*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)))).Fop) != TK_VECTOR {
 157504 						(*ExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) + 8)).FpExpr = uintptr(0)
 157505 						Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 157506 						pRHS = Xsqlite3PExpr(tls, pParse, TK_UPLUS, pRHS, uintptr(0))
 157507 						*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_EQ, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), pRHS)
 157508 					} else if (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))).FnExpr == 1 && int32((*Expr)(unsafe.Pointer(pRHS)).Fop) == TK_SELECT {
 157509 						*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_IN, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), uintptr(0))
 157510 						Xsqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), *(*uintptr)(unsafe.Pointer(pRHS + 32)))
 157511 						*(*uintptr)(unsafe.Pointer(pRHS + 32)) = uintptr(0)
 157512 						Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 157513 					} else {
 157514 						*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_IN, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), uintptr(0))
 157515 						if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) == uintptr(0) {
 157516 							Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 157517 						} else if int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)))).FpLeft)).Fop) == TK_VECTOR {
 157518 							var nExpr int32 = (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)))).FpLeft + 32)))).FnExpr
 157519 							var pSelectRHS uintptr = Xsqlite3ExprListToValues(tls, pParse, nExpr, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 157520 							if pSelectRHS != 0 {
 157521 								parserDoubleLinkSelect(tls, pParse, pSelectRHS)
 157522 								Xsqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), pSelectRHS)
 157523 							}
 157524 						} else {
 157525 							*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) + 32)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8))
 157526 							Xsqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)))
 157527 						}
 157528 					}
 157529 					if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)) != 0 {
 157530 						*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), uintptr(0))
 157531 					}
 157532 				}
 157533 
 157534 			}
 157535 			break
 157536 		case uint32(221):
 157537 			{
 157538 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_SELECT, uintptr(0), uintptr(0))
 157539 				Xsqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 157540 
 157541 			}
 157542 			break
 157543 		case uint32(222):
 157544 			{
 157545 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_IN, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), uintptr(0))
 157546 				Xsqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 157547 				if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)) != 0 {
 157548 					*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), uintptr(0))
 157549 				}
 157550 
 157551 			}
 157552 			break
 157553 		case uint32(223):
 157554 			{
 157555 				var pSrc uintptr = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), yymsp+libc.UintptrFromInt32(-2)*24+8, yymsp+libc.UintptrFromInt32(-1)*24+8)
 157556 				var pSelect uintptr = Xsqlite3SelectNew(tls, pParse, uintptr(0), pSrc, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0))
 157557 				if *(*uintptr)(unsafe.Pointer(yymsp + 8)) != 0 {
 157558 					Xsqlite3SrcListFuncArgs(tls, pParse, func() uintptr {
 157559 						if pSelect != 0 {
 157560 							return pSrc
 157561 						}
 157562 						return uintptr(0)
 157563 					}(), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157564 				}
 157565 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_IN, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), uintptr(0))
 157566 				Xsqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), pSelect)
 157567 				if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)) != 0 {
 157568 					*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), uintptr(0))
 157569 				}
 157570 
 157571 			}
 157572 			break
 157573 		case uint32(224):
 157574 			{
 157575 				var p uintptr
 157576 				p = libc.AssignPtrUintptr(yymsp+libc.UintptrFromInt32(-3)*24+8, Xsqlite3PExpr(tls, pParse, TK_EXISTS, uintptr(0), uintptr(0)))
 157577 				Xsqlite3PExprAddSelect(tls, pParse, p, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 157578 
 157579 			}
 157580 			break
 157581 		case uint32(225):
 157582 			{
 157583 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_CASE, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)), uintptr(0))
 157584 				if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) != 0 {
 157585 					*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) + 32)) = func() uintptr {
 157586 						if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) != 0 {
 157587 							return Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 157588 						}
 157589 						return *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8))
 157590 					}()
 157591 					Xsqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)))
 157592 				} else {
 157593 					Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)))
 157594 					Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 157595 				}
 157596 			}
 157597 			break
 157598 		case uint32(226):
 157599 			{
 157600 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)))
 157601 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157602 			}
 157603 			break
 157604 		case uint32(227):
 157605 			{
 157606 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)))
 157607 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157608 			}
 157609 			break
 157610 		case uint32(230):
 157611 			{
 157612 				*(*uintptr)(unsafe.Pointer(yymsp + 8)) = *(*uintptr)(unsafe.Pointer(yymsp + 8))
 157613 			}
 157614 			break
 157615 		case uint32(233):
 157616 			{
 157617 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157618 			}
 157619 			break
 157620 		case uint32(234):
 157621 			{
 157622 				*(*uintptr)(unsafe.Pointer(yymsp + 8)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157623 			}
 157624 			break
 157625 		case uint32(236):
 157626 			fallthrough
 157627 		case uint32(241):
 157628 			{
 157629 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8))
 157630 			}
 157631 			break
 157632 		case uint32(237):
 157633 			{
 157634 				Xsqlite3CreateIndex(tls, pParse, yymsp+libc.UintptrFromInt32(-7)*24+8, yymsp+libc.UintptrFromInt32(-6)*24+8,
 157635 					Xsqlite3SrcListAppend(tls, pParse, uintptr(0), yymsp+libc.UintptrFromInt32(-4)*24+8, uintptr(0)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-10)*24 + 8)),
 157636 					yymsp+libc.UintptrFromInt32(-11)*24+8, *(*uintptr)(unsafe.Pointer(yymsp + 8)), SQLITE_SO_ASC, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8)), uint8(SQLITE_IDXTYPE_APPDEF))
 157637 				if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME && (*Parse)(unsafe.Pointer(pParse)).FpNewIndex != 0 {
 157638 					Xsqlite3RenameTokenMap(tls, pParse, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).FpNewIndex)).FzName, yymsp+libc.UintptrFromInt32(-4)*24+8)
 157639 				}
 157640 			}
 157641 			break
 157642 		case uint32(238):
 157643 			fallthrough
 157644 		case uint32(280):
 157645 			{
 157646 				*(*int32)(unsafe.Pointer(yymsp + 8)) = OE_Abort
 157647 			}
 157648 			break
 157649 		case uint32(239):
 157650 			{
 157651 				*(*int32)(unsafe.Pointer(yymsp + 1*24 + 8)) = OE_None
 157652 			}
 157653 			break
 157654 		case uint32(242):
 157655 			{
 157656 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = parserAddExprIdListTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), yymsp+libc.UintptrFromInt32(-2)*24+8, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + 8)))
 157657 			}
 157658 			break
 157659 		case uint32(243):
 157660 			{
 157661 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = parserAddExprIdListTerm(tls, pParse, uintptr(0), yymsp+libc.UintptrFromInt32(-2)*24+8, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + 8)))
 157662 			}
 157663 			break
 157664 		case uint32(246):
 157665 			{
 157666 				Xsqlite3DropIndex(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 157667 			}
 157668 			break
 157669 		case uint32(247):
 157670 			{
 157671 				Xsqlite3Vacuum(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157672 			}
 157673 			break
 157674 		case uint32(248):
 157675 			{
 157676 				Xsqlite3Vacuum(tls, pParse, yymsp+libc.UintptrFromInt32(-1)*24+8, *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157677 			}
 157678 			break
 157679 		case uint32(251):
 157680 			{
 157681 				Xsqlite3Pragma(tls, pParse, yymsp+libc.UintptrFromInt32(-1)*24+8, yymsp+8, uintptr(0), 0)
 157682 			}
 157683 			break
 157684 		case uint32(252):
 157685 			{
 157686 				Xsqlite3Pragma(tls, pParse, yymsp+libc.UintptrFromInt32(-3)*24+8, yymsp+libc.UintptrFromInt32(-2)*24+8, yymsp+8, 0)
 157687 			}
 157688 			break
 157689 		case uint32(253):
 157690 			{
 157691 				Xsqlite3Pragma(tls, pParse, yymsp+libc.UintptrFromInt32(-4)*24+8, yymsp+libc.UintptrFromInt32(-3)*24+8, yymsp+libc.UintptrFromInt32(-1)*24+8, 0)
 157692 			}
 157693 			break
 157694 		case uint32(254):
 157695 			{
 157696 				Xsqlite3Pragma(tls, pParse, yymsp+libc.UintptrFromInt32(-3)*24+8, yymsp+libc.UintptrFromInt32(-2)*24+8, yymsp+8, 1)
 157697 			}
 157698 			break
 157699 		case uint32(255):
 157700 			{
 157701 				Xsqlite3Pragma(tls, pParse, yymsp+libc.UintptrFromInt32(-4)*24+8, yymsp+libc.UintptrFromInt32(-3)*24+8, yymsp+libc.UintptrFromInt32(-1)*24+8, 1)
 157702 			}
 157703 			break
 157704 		case uint32(258):
 157705 			{
 157706 				(*Token)(unsafe.Pointer(bp + 144)).Fz = (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)).Fz
 157707 				(*Token)(unsafe.Pointer(bp + 144)).Fn = uint32(int32((int64((*Token)(unsafe.Pointer(yymsp+8)).Fz)-int64((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*24+8)).Fz))/1)) + (*Token)(unsafe.Pointer(yymsp+8)).Fn
 157708 				Xsqlite3FinishTrigger(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), bp+144)
 157709 			}
 157710 			break
 157711 		case uint32(259):
 157712 			{
 157713 				Xsqlite3BeginTrigger(tls, pParse, yymsp+libc.UintptrFromInt32(-7)*24+8, yymsp+libc.UintptrFromInt32(-6)*24+8, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)), (*TrigEvent)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*24+8)).Fa, (*TrigEvent)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*24+8)).Fb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-10)*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8)))
 157714 				*(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-10)*24 + 8)) = func() Token1 {
 157715 					if (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-6)*24+8)).Fn == uint32(0) {
 157716 						return *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8))
 157717 					}
 157718 					return *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8))
 157719 				}()
 157720 			}
 157721 			break
 157722 		case uint32(260):
 157723 			{
 157724 				*(*int32)(unsafe.Pointer(yymsp + 8)) = int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor)
 157725 			}
 157726 			break
 157727 		case uint32(261):
 157728 			{
 157729 				*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = TK_INSTEAD
 157730 			}
 157731 			break
 157732 		case uint32(262):
 157733 			{
 157734 				*(*int32)(unsafe.Pointer(yymsp + 1*24 + 8)) = TK_BEFORE
 157735 			}
 157736 			break
 157737 		case uint32(263):
 157738 			fallthrough
 157739 		case uint32(264):
 157740 			{
 157741 				(*TrigEvent)(unsafe.Pointer(yymsp + 8)).Fa = int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor)
 157742 				(*TrigEvent)(unsafe.Pointer(yymsp + 8)).Fb = uintptr(0)
 157743 			}
 157744 			break
 157745 		case uint32(265):
 157746 			{
 157747 				(*TrigEvent)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)).Fa = TK_UPDATE
 157748 				(*TrigEvent)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)).Fb = *(*uintptr)(unsafe.Pointer(yymsp + 8))
 157749 			}
 157750 			break
 157751 		case uint32(266):
 157752 			fallthrough
 157753 		case uint32(285):
 157754 			{
 157755 				*(*uintptr)(unsafe.Pointer(yymsp + 1*24 + 8)) = uintptr(0)
 157756 			}
 157757 			break
 157758 		case uint32(267):
 157759 			fallthrough
 157760 		case uint32(286):
 157761 			{
 157762 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = *(*uintptr)(unsafe.Pointer(yymsp + 8))
 157763 			}
 157764 			break
 157765 		case uint32(268):
 157766 			{
 157767 				(*TriggerStep)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)))).FpLast)).FpNext = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8))
 157768 				(*TriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)))).FpLast = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8))
 157769 			}
 157770 			break
 157771 		case uint32(269):
 157772 			{
 157773 				(*TriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))).FpLast = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8))
 157774 			}
 157775 			break
 157776 		case uint32(270):
 157777 			{
 157778 				*(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = *(*Token)(unsafe.Pointer(yymsp + 8))
 157779 				Xsqlite3ErrorMsg(tls, pParse,
 157780 					ts+24444, 0)
 157781 			}
 157782 			break
 157783 		case uint32(271):
 157784 			{
 157785 				Xsqlite3ErrorMsg(tls, pParse,
 157786 					ts+24539, 0)
 157787 			}
 157788 			break
 157789 		case uint32(272):
 157790 			{
 157791 				Xsqlite3ErrorMsg(tls, pParse,
 157792 					ts+24623, 0)
 157793 			}
 157794 			break
 157795 		case uint32(273):
 157796 			{
 157797 				*(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3TriggerUpdateStep(tls, pParse, yymsp+libc.UintptrFromInt32(-6)*24+8, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), uint8(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8))), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-8)*24+8)).Fz, *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157798 			}
 157799 			*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 157800 			break
 157801 		case uint32(274):
 157802 			{
 157803 				*(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3TriggerInsertStep(tls, pParse, yymsp+libc.UintptrFromInt32(-4)*24+8, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), uint8(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8))), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157804 			}
 157805 			*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 157806 			break
 157807 		case uint32(275):
 157808 			{
 157809 				*(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3TriggerDeleteStep(tls, pParse, yymsp+libc.UintptrFromInt32(-3)*24+8, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-5)*24+8)).Fz, *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157810 			}
 157811 			*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 157812 			break
 157813 		case uint32(276):
 157814 			{
 157815 				*(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3TriggerSelectStep(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157816 			}
 157817 			*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 157818 			break
 157819 		case uint32(277):
 157820 			{
 157821 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)) = Xsqlite3PExpr(tls, pParse, TK_RAISE, uintptr(0), uintptr(0))
 157822 				if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)) != 0 {
 157823 					(*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)))).FaffExpr = int8(OE_Ignore)
 157824 				}
 157825 			}
 157826 			break
 157827 		case uint32(278):
 157828 			{
 157829 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)) = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_RAISE, yymsp+libc.UintptrFromInt32(-1)*24+8, 1)
 157830 				if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)) != 0 {
 157831 					(*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)))).FaffExpr = int8(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)))
 157832 				}
 157833 			}
 157834 			break
 157835 		case uint32(279):
 157836 			{
 157837 				*(*int32)(unsafe.Pointer(yymsp + 8)) = OE_Rollback
 157838 			}
 157839 			break
 157840 		case uint32(281):
 157841 			{
 157842 				*(*int32)(unsafe.Pointer(yymsp + 8)) = OE_Fail
 157843 			}
 157844 			break
 157845 		case uint32(282):
 157846 			{
 157847 				Xsqlite3DropTrigger(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 157848 			}
 157849 			break
 157850 		case uint32(283):
 157851 			{
 157852 				Xsqlite3Attach(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157853 			}
 157854 			break
 157855 		case uint32(284):
 157856 			{
 157857 				Xsqlite3Detach(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157858 			}
 157859 			break
 157860 		case uint32(287):
 157861 			{
 157862 				Xsqlite3Reindex(tls, pParse, uintptr(0), uintptr(0))
 157863 			}
 157864 			break
 157865 		case uint32(288):
 157866 			{
 157867 				Xsqlite3Reindex(tls, pParse, yymsp+libc.UintptrFromInt32(-1)*24+8, yymsp+8)
 157868 			}
 157869 			break
 157870 		case uint32(289):
 157871 			{
 157872 				Xsqlite3Analyze(tls, pParse, uintptr(0), uintptr(0))
 157873 			}
 157874 			break
 157875 		case uint32(290):
 157876 			{
 157877 				Xsqlite3Analyze(tls, pParse, yymsp+libc.UintptrFromInt32(-1)*24+8, yymsp+8)
 157878 			}
 157879 			break
 157880 		case uint32(291):
 157881 			{
 157882 				Xsqlite3AlterRenameTable(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)), yymsp+8)
 157883 			}
 157884 			break
 157885 		case uint32(292):
 157886 			{
 157887 				(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)).Fn = uint32(int32((int64((*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fz)-int64((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8)).Fz))/1)) + (*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fn
 157888 				Xsqlite3AlterFinishAddColumn(tls, pParse, yymsp+libc.UintptrFromInt32(-1)*24+8)
 157889 			}
 157890 			break
 157891 		case uint32(293):
 157892 			{
 157893 				Xsqlite3AlterDropColumn(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)), yymsp+8)
 157894 			}
 157895 			break
 157896 		case uint32(294):
 157897 			{
 157898 				disableLookaside(tls, pParse)
 157899 				Xsqlite3AlterBeginAddColumn(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157900 			}
 157901 			break
 157902 		case uint32(295):
 157903 			{
 157904 				Xsqlite3AlterRenameColumn(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)), yymsp+libc.UintptrFromInt32(-2)*24+8, yymsp+8)
 157905 			}
 157906 			break
 157907 		case uint32(296):
 157908 			{
 157909 				Xsqlite3VtabFinishParse(tls, pParse, uintptr(0))
 157910 			}
 157911 			break
 157912 		case uint32(297):
 157913 			{
 157914 				Xsqlite3VtabFinishParse(tls, pParse, yymsp+8)
 157915 			}
 157916 			break
 157917 		case uint32(298):
 157918 			{
 157919 				Xsqlite3VtabBeginParse(tls, pParse, yymsp+libc.UintptrFromInt32(-3)*24+8, yymsp+libc.UintptrFromInt32(-2)*24+8, yymsp+8, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)))
 157920 			}
 157921 			break
 157922 		case uint32(299):
 157923 			{
 157924 				Xsqlite3VtabArgInit(tls, pParse)
 157925 			}
 157926 			break
 157927 		case uint32(300):
 157928 			fallthrough
 157929 		case uint32(301):
 157930 			fallthrough
 157931 		case uint32(302):
 157932 			{
 157933 				Xsqlite3VtabArgExtend(tls, pParse, yymsp+8)
 157934 			}
 157935 			break
 157936 		case uint32(303):
 157937 			fallthrough
 157938 		case uint32(304):
 157939 			{
 157940 				Xsqlite3WithPush(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)), uint8(1))
 157941 			}
 157942 			break
 157943 		case uint32(305):
 157944 			{
 157945 				*(*U8)(unsafe.Pointer(yymsp + 8)) = U8(M10d_Any)
 157946 			}
 157947 			break
 157948 		case uint32(306):
 157949 			{
 157950 				*(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = U8(M10d_Yes)
 157951 			}
 157952 			break
 157953 		case uint32(307):
 157954 			{
 157955 				*(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = U8(M10d_No)
 157956 			}
 157957 			break
 157958 		case uint32(308):
 157959 			{
 157960 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)) = Xsqlite3CteNew(tls, pParse, yymsp+libc.UintptrFromInt32(-5)*24+8, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), *(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)))
 157961 			}
 157962 			break
 157963 		case uint32(309):
 157964 			{
 157965 				*(*uintptr)(unsafe.Pointer(yymsp + 8)) = Xsqlite3WithAdd(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157966 			}
 157967 			break
 157968 		case uint32(310):
 157969 			{
 157970 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = Xsqlite3WithAdd(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 157971 			}
 157972 			break
 157973 		case uint32(311):
 157974 			{
 157975 				*(*uintptr)(unsafe.Pointer(bp + 40)) = *(*uintptr)(unsafe.Pointer(yymsp + 8))
 157976 			}
 157977 			*(*uintptr)(unsafe.Pointer(yymsp + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 157978 			break
 157979 		case uint32(312):
 157980 			{
 157981 				Xsqlite3WindowChain(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)))
 157982 				(*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + 8)))).FpNextWin = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8))
 157983 				*(*uintptr)(unsafe.Pointer(bp + 40)) = *(*uintptr)(unsafe.Pointer(yymsp + 8))
 157984 			}
 157985 			*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 157986 			break
 157987 		case uint32(313):
 157988 			{
 157989 				if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) != 0 {
 157990 					(*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))).FzName = Xsqlite3DbStrNDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*24+8)).Fz, uint64((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*24+8)).Fn))
 157991 				}
 157992 				*(*uintptr)(unsafe.Pointer(bp + 40)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8))
 157993 			}
 157994 			*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 157995 			break
 157996 		case uint32(314):
 157997 			{
 157998 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), uintptr(0))
 157999 			}
 158000 			break
 158001 		case uint32(315):
 158002 			{
 158003 				*(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), yymsp+libc.UintptrFromInt32(-5)*24+8)
 158004 			}
 158005 			*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 158006 			break
 158007 		case uint32(316):
 158008 			{
 158009 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), uintptr(0))
 158010 			}
 158011 			break
 158012 		case uint32(317):
 158013 			{
 158014 				*(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)), yymsp+libc.UintptrFromInt32(-4)*24+8)
 158015 			}
 158016 			*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 158017 			break
 158018 		case uint32(318):
 158019 			fallthrough
 158020 		case uint32(337):
 158021 			{
 158022 				*(*uintptr)(unsafe.Pointer(bp + 40)) = *(*uintptr)(unsafe.Pointer(yymsp + 8))
 158023 			}
 158024 			*(*uintptr)(unsafe.Pointer(yymsp + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 158025 			break
 158026 		case uint32(319):
 158027 			{
 158028 				*(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)), uintptr(0), uintptr(0), yymsp+libc.UintptrFromInt32(-1)*24+8)
 158029 			}
 158030 			*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 158031 			break
 158032 		case uint32(320):
 158033 			{
 158034 				*(*uintptr)(unsafe.Pointer(yymsp + 1*24 + 8)) = Xsqlite3WindowAlloc(tls, pParse, 0, TK_UNBOUNDED, uintptr(0), TK_CURRENT, uintptr(0), uint8(0))
 158035 			}
 158036 			break
 158037 		case uint32(321):
 158038 			{
 158039 				*(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3WindowAlloc(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)), (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8)).FeType, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8)).FpExpr, TK_CURRENT, uintptr(0), *(*U8)(unsafe.Pointer(yymsp + 8)))
 158040 			}
 158041 			*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 158042 			break
 158043 		case uint32(322):
 158044 			{
 158045 				*(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3WindowAlloc(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)), (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*24+8)).FeType, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*24+8)).FpExpr, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8)).FeType, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8)).FpExpr, *(*U8)(unsafe.Pointer(yymsp + 8)))
 158046 			}
 158047 			*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 158048 			break
 158049 		case uint32(324):
 158050 			fallthrough
 158051 		case uint32(326):
 158052 			{
 158053 				*(*FrameBound)(unsafe.Pointer(bp + 40)) = *(*FrameBound)(unsafe.Pointer(yymsp + 8))
 158054 			}
 158055 			*(*FrameBound)(unsafe.Pointer(yymsp + 8)) = *(*FrameBound)(unsafe.Pointer(bp + 40))
 158056 			break
 158057 		case uint32(325):
 158058 			fallthrough
 158059 		case uint32(327):
 158060 			fallthrough
 158061 		case uint32(329):
 158062 			{
 158063 				(*FrameBound)(unsafe.Pointer(bp + 40)).FeType = int32((*YyStackEntry)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24)).Fmajor)
 158064 				(*FrameBound)(unsafe.Pointer(bp + 40)).FpExpr = uintptr(0)
 158065 			}
 158066 			*(*FrameBound)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = *(*FrameBound)(unsafe.Pointer(bp + 40))
 158067 			break
 158068 		case uint32(328):
 158069 			{
 158070 				(*FrameBound)(unsafe.Pointer(bp + 40)).FeType = int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor)
 158071 				(*FrameBound)(unsafe.Pointer(bp + 40)).FpExpr = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8))
 158072 			}
 158073 			*(*FrameBound)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = *(*FrameBound)(unsafe.Pointer(bp + 40))
 158074 			break
 158075 		case uint32(330):
 158076 			{
 158077 				*(*U8)(unsafe.Pointer(yymsp + 1*24 + 8)) = U8(0)
 158078 			}
 158079 			break
 158080 		case uint32(331):
 158081 			{
 158082 				*(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = *(*U8)(unsafe.Pointer(yymsp + 8))
 158083 			}
 158084 			break
 158085 		case uint32(332):
 158086 			fallthrough
 158087 		case uint32(333):
 158088 			{
 158089 				*(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = U8((*YyStackEntry)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24)).Fmajor)
 158090 			}
 158091 			break
 158092 		case uint32(334):
 158093 			{
 158094 				*(*U8)(unsafe.Pointer(yymsp + 8)) = U8((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor)
 158095 			}
 158096 			break
 158097 		case uint32(335):
 158098 			{
 158099 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = *(*uintptr)(unsafe.Pointer(yymsp + 8))
 158100 			}
 158101 			break
 158102 		case uint32(336):
 158103 			{
 158104 				if *(*uintptr)(unsafe.Pointer(yymsp + 8)) != 0 {
 158105 					(*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + 8)))).FpFilter = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8))
 158106 				} else {
 158107 					Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 158108 				}
 158109 				*(*uintptr)(unsafe.Pointer(bp + 40)) = *(*uintptr)(unsafe.Pointer(yymsp + 8))
 158110 			}
 158111 			*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 158112 			break
 158113 		case uint32(338):
 158114 			{
 158115 				*(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Window{})))
 158116 				if *(*uintptr)(unsafe.Pointer(bp + 40)) != 0 {
 158117 					(*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).FeFrmType = U8(TK_FILTER)
 158118 					(*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).FpFilter = *(*uintptr)(unsafe.Pointer(yymsp + 8))
 158119 				} else {
 158120 					Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + 8)))
 158121 				}
 158122 			}
 158123 			*(*uintptr)(unsafe.Pointer(yymsp + 8)) = *(*uintptr)(unsafe.Pointer(bp + 40))
 158124 			break
 158125 		case uint32(339):
 158126 			{
 158127 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8))
 158128 
 158129 			}
 158130 			break
 158131 		case uint32(340):
 158132 			{
 158133 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Window{})))
 158134 				if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)) != 0 {
 158135 					(*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8)))).FzName = Xsqlite3DbStrNDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Token)(unsafe.Pointer(yymsp+8)).Fz, uint64((*Token)(unsafe.Pointer(yymsp+8)).Fn))
 158136 				}
 158137 			}
 158138 			break
 158139 		case uint32(341):
 158140 			{
 158141 				*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8))
 158142 			}
 158143 			break
 158144 		default:
 158145 			break
 158146 
 158147 		}
 158148 	}
 158149 
 158150 	yygoto = int32(yyRuleInfoLhs[yyruleno])
 158151 	yysize = int32(yyRuleInfoNRhs[yyruleno])
 158152 	yyact = yy_find_reduce_action(tls, (*YyStackEntry)(unsafe.Pointer(yymsp+uintptr(yysize)*24)).Fstateno, uint16(yygoto))
 158153 
 158154 	yymsp += 24 * uintptr(yysize+1)
 158155 	(*YyParser)(unsafe.Pointer(yypParser)).Fyytos = yymsp
 158156 	(*YyStackEntry)(unsafe.Pointer(yymsp)).Fstateno = yyact
 158157 	(*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor = uint16(yygoto)
 158158 
 158159 	return yyact
 158160 }
 158161 
 158162 func yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, yyminor Token) {
 158163 	bp := tls.Alloc(24)
 158164 	defer tls.Free(24)
 158165 	*(*Token)(unsafe.Pointer(bp + 8)) = yyminor
 158166 
 158167 	var pParse uintptr = (*YyParser)(unsafe.Pointer(yypParser)).FpParse
 158168 
 158169 	_ = yymajor
 158170 	if *(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(bp + 8)).Fz)) != 0 {
 158171 		Xsqlite3ErrorMsg(tls, pParse, ts+24420, libc.VaList(bp, bp+8))
 158172 	} else {
 158173 		Xsqlite3ErrorMsg(tls, pParse, ts+24708, 0)
 158174 	}
 158175 
 158176 	(*YyParser)(unsafe.Pointer(yypParser)).FpParse = pParse
 158177 }
 158178 
 158179 func yy_accept(tls *libc.TLS, yypParser uintptr) {
 158180 	var pParse uintptr = (*YyParser)(unsafe.Pointer(yypParser)).FpParse
 158181 
 158182 	(*YyParser)(unsafe.Pointer(yypParser)).FpParse = pParse
 158183 }
 158184 
 158185 // The main parser program.
 158186 // The first argument is a pointer to a structure obtained from
 158187 // "sqlite3ParserAlloc" which describes the current state of the parser.
 158188 // The second argument is the major token number.  The third is
 158189 // the minor token.  The fourth optional argument is whatever the
 158190 // user wants (and specified in the grammar) and is available for
 158191 // use by the action routines.
 158192 //
 158193 // Inputs:
 158194 // <ul>
 158195 // <li> A pointer to the parser (an opaque structure.)
 158196 // <li> The major token number.
 158197 // <li> The minor token number.
 158198 // <li> An option argument of a grammar-specified type.
 158199 // </ul>
 158200 //
 158201 // Outputs:
 158202 // None.
 158203 func Xsqlite3Parser(tls *libc.TLS, yyp uintptr, yymajor int32, yyminor Token) {
 158204 	bp := tls.Alloc(16)
 158205 	defer tls.Free(16)
 158206 
 158207 	var yyact uint16
 158208 	var yypParser uintptr = yyp
 158209 	var pParse uintptr = (*YyParser)(unsafe.Pointer(yypParser)).FpParse
 158210 
 158211 	yyact = (*YyStackEntry)(unsafe.Pointer((*YyParser)(unsafe.Pointer(yypParser)).Fyytos)).Fstateno
 158212 
 158213 	for 1 != 0 {
 158214 		yyact = yy_find_shift_action(tls, uint16(yymajor), yyact)
 158215 		if int32(yyact) >= YY_MIN_REDUCE {
 158216 			var yyruleno uint32 = uint32(int32(yyact) - YY_MIN_REDUCE)
 158217 
 158218 			if int32(yyRuleInfoNRhs[yyruleno]) == 0 {
 158219 				if (*YyParser)(unsafe.Pointer(yypParser)).Fyytos >= (*YyParser)(unsafe.Pointer(yypParser)).FyystackEnd {
 158220 					yyStackOverflow(tls, yypParser)
 158221 					break
 158222 				}
 158223 			}
 158224 			yyact = yy_reduce(tls, yypParser, yyruleno, yymajor, yyminor, pParse)
 158225 		} else if int32(yyact) <= YY_MAX_SHIFTREDUCE {
 158226 			yy_shift(tls, yypParser, yyact, uint16(yymajor), yyminor)
 158227 			break
 158228 		} else if int32(yyact) == YY_ACCEPT_ACTION {
 158229 			(*YyParser)(unsafe.Pointer(yypParser)).Fyytos -= 24
 158230 			yy_accept(tls, yypParser)
 158231 			return
 158232 		} else {
 158233 			*(*Token)(unsafe.Pointer(bp)) = yyminor
 158234 
 158235 			yy_syntax_error(tls, yypParser, yymajor, yyminor)
 158236 			yy_destructor(tls, yypParser, uint16(yymajor), bp)
 158237 			break
 158238 		}
 158239 	}
 158240 	return
 158241 }
 158242 
 158243 // Return the fallback token corresponding to canonical token iToken, or
 158244 // 0 if iToken has no fallback.
 158245 func Xsqlite3ParserFallback(tls *libc.TLS, iToken int32) int32 {
 158246 	return int32(yyFallback[iToken])
 158247 }
 158248 
 158249 var aiClass = [256]uint8{
 158250 	uint8(29), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(7), uint8(7), uint8(28), uint8(7), uint8(7), uint8(28), uint8(28),
 158251 	uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28),
 158252 	uint8(7), uint8(15), uint8(8), uint8(5), uint8(4), uint8(22), uint8(24), uint8(8), uint8(17), uint8(18), uint8(21), uint8(20), uint8(23), uint8(11), uint8(26), uint8(16),
 158253 	uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(5), uint8(19), uint8(12), uint8(14), uint8(13), uint8(6),
 158254 	uint8(5), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1),
 158255 	uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(0), uint8(2), uint8(2), uint8(9), uint8(28), uint8(28), uint8(28), uint8(2),
 158256 	uint8(8), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1),
 158257 	uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(0), uint8(2), uint8(2), uint8(28), uint8(10), uint8(28), uint8(25), uint8(28),
 158258 	uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27),
 158259 	uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27),
 158260 	uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27),
 158261 	uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27),
 158262 	uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27),
 158263 	uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27),
 158264 	uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(30),
 158265 	uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27),
 158266 }
 158267 
 158268 var zKWText = [666]int8{
 158269 	int8('R'), int8('E'), int8('I'), int8('N'), int8('D'), int8('E'), int8('X'), int8('E'), int8('D'), int8('E'), int8('S'), int8('C'), int8('A'), int8('P'), int8('E'), int8('A'), int8('C'), int8('H'),
 158270 	int8('E'), int8('C'), int8('K'), int8('E'), int8('Y'), int8('B'), int8('E'), int8('F'), int8('O'), int8('R'), int8('E'), int8('I'), int8('G'), int8('N'), int8('O'), int8('R'), int8('E'), int8('G'),
 158271 	int8('E'), int8('X'), int8('P'), int8('L'), int8('A'), int8('I'), int8('N'), int8('S'), int8('T'), int8('E'), int8('A'), int8('D'), int8('D'), int8('A'), int8('T'), int8('A'), int8('B'), int8('A'),
 158272 	int8('S'), int8('E'), int8('L'), int8('E'), int8('C'), int8('T'), int8('A'), int8('B'), int8('L'), int8('E'), int8('F'), int8('T'), int8('H'), int8('E'), int8('N'), int8('D'), int8('E'), int8('F'),
 158273 	int8('E'), int8('R'), int8('R'), int8('A'), int8('B'), int8('L'), int8('E'), int8('L'), int8('S'), int8('E'), int8('X'), int8('C'), int8('L'), int8('U'), int8('D'), int8('E'), int8('L'), int8('E'),
 158274 	int8('T'), int8('E'), int8('M'), int8('P'), int8('O'), int8('R'), int8('A'), int8('R'), int8('Y'), int8('I'), int8('S'), int8('N'), int8('U'), int8('L'), int8('L'), int8('S'), int8('A'), int8('V'),
 158275 	int8('E'), int8('P'), int8('O'), int8('I'), int8('N'), int8('T'), int8('E'), int8('R'), int8('S'), int8('E'), int8('C'), int8('T'), int8('I'), int8('E'), int8('S'), int8('N'), int8('O'), int8('T'),
 158276 	int8('N'), int8('U'), int8('L'), int8('L'), int8('I'), int8('K'), int8('E'), int8('X'), int8('C'), int8('E'), int8('P'), int8('T'), int8('R'), int8('A'), int8('N'), int8('S'), int8('A'), int8('C'),
 158277 	int8('T'), int8('I'), int8('O'), int8('N'), int8('A'), int8('T'), int8('U'), int8('R'), int8('A'), int8('L'), int8('T'), int8('E'), int8('R'), int8('A'), int8('I'), int8('S'), int8('E'), int8('X'),
 158278 	int8('C'), int8('L'), int8('U'), int8('S'), int8('I'), int8('V'), int8('E'), int8('X'), int8('I'), int8('S'), int8('T'), int8('S'), int8('C'), int8('O'), int8('N'), int8('S'), int8('T'), int8('R'),
 158279 	int8('A'), int8('I'), int8('N'), int8('T'), int8('O'), int8('F'), int8('F'), int8('S'), int8('E'), int8('T'), int8('R'), int8('I'), int8('G'), int8('G'), int8('E'), int8('R'), int8('A'), int8('N'),
 158280 	int8('G'), int8('E'), int8('N'), int8('E'), int8('R'), int8('A'), int8('T'), int8('E'), int8('D'), int8('E'), int8('T'), int8('A'), int8('C'), int8('H'), int8('A'), int8('V'), int8('I'), int8('N'),
 158281 	int8('G'), int8('L'), int8('O'), int8('B'), int8('E'), int8('G'), int8('I'), int8('N'), int8('N'), int8('E'), int8('R'), int8('E'), int8('F'), int8('E'), int8('R'), int8('E'), int8('N'), int8('C'),
 158282 	int8('E'), int8('S'), int8('U'), int8('N'), int8('I'), int8('Q'), int8('U'), int8('E'), int8('R'), int8('Y'), int8('W'), int8('I'), int8('T'), int8('H'), int8('O'), int8('U'), int8('T'), int8('E'),
 158283 	int8('R'), int8('E'), int8('L'), int8('E'), int8('A'), int8('S'), int8('E'), int8('A'), int8('T'), int8('T'), int8('A'), int8('C'), int8('H'), int8('B'), int8('E'), int8('T'), int8('W'), int8('E'),
 158284 	int8('E'), int8('N'), int8('O'), int8('T'), int8('H'), int8('I'), int8('N'), int8('G'), int8('R'), int8('O'), int8('U'), int8('P'), int8('S'), int8('C'), int8('A'), int8('S'), int8('C'), int8('A'),
 158285 	int8('D'), int8('E'), int8('F'), int8('A'), int8('U'), int8('L'), int8('T'), int8('C'), int8('A'), int8('S'), int8('E'), int8('C'), int8('O'), int8('L'), int8('L'), int8('A'), int8('T'), int8('E'),
 158286 	int8('C'), int8('R'), int8('E'), int8('A'), int8('T'), int8('E'), int8('C'), int8('U'), int8('R'), int8('R'), int8('E'), int8('N'), int8('T'), int8('_'), int8('D'), int8('A'), int8('T'), int8('E'),
 158287 	int8('I'), int8('M'), int8('M'), int8('E'), int8('D'), int8('I'), int8('A'), int8('T'), int8('E'), int8('J'), int8('O'), int8('I'), int8('N'), int8('S'), int8('E'), int8('R'), int8('T'), int8('M'),
 158288 	int8('A'), int8('T'), int8('C'), int8('H'), int8('P'), int8('L'), int8('A'), int8('N'), int8('A'), int8('L'), int8('Y'), int8('Z'), int8('E'), int8('P'), int8('R'), int8('A'), int8('G'), int8('M'),
 158289 	int8('A'), int8('T'), int8('E'), int8('R'), int8('I'), int8('A'), int8('L'), int8('I'), int8('Z'), int8('E'), int8('D'), int8('E'), int8('F'), int8('E'), int8('R'), int8('R'), int8('E'), int8('D'),
 158290 	int8('I'), int8('S'), int8('T'), int8('I'), int8('N'), int8('C'), int8('T'), int8('U'), int8('P'), int8('D'), int8('A'), int8('T'), int8('E'), int8('V'), int8('A'), int8('L'), int8('U'), int8('E'),
 158291 	int8('S'), int8('V'), int8('I'), int8('R'), int8('T'), int8('U'), int8('A'), int8('L'), int8('W'), int8('A'), int8('Y'), int8('S'), int8('W'), int8('H'), int8('E'), int8('N'), int8('W'), int8('H'),
 158292 	int8('E'), int8('R'), int8('E'), int8('C'), int8('U'), int8('R'), int8('S'), int8('I'), int8('V'), int8('E'), int8('A'), int8('B'), int8('O'), int8('R'), int8('T'), int8('A'), int8('F'), int8('T'),
 158293 	int8('E'), int8('R'), int8('E'), int8('N'), int8('A'), int8('M'), int8('E'), int8('A'), int8('N'), int8('D'), int8('R'), int8('O'), int8('P'), int8('A'), int8('R'), int8('T'), int8('I'), int8('T'),
 158294 	int8('I'), int8('O'), int8('N'), int8('A'), int8('U'), int8('T'), int8('O'), int8('I'), int8('N'), int8('C'), int8('R'), int8('E'), int8('M'), int8('E'), int8('N'), int8('T'), int8('C'), int8('A'),
 158295 	int8('S'), int8('T'), int8('C'), int8('O'), int8('L'), int8('U'), int8('M'), int8('N'), int8('C'), int8('O'), int8('M'), int8('M'), int8('I'), int8('T'), int8('C'), int8('O'), int8('N'), int8('F'),
 158296 	int8('L'), int8('I'), int8('C'), int8('T'), int8('C'), int8('R'), int8('O'), int8('S'), int8('S'), int8('C'), int8('U'), int8('R'), int8('R'), int8('E'), int8('N'), int8('T'), int8('_'), int8('T'),
 158297 	int8('I'), int8('M'), int8('E'), int8('S'), int8('T'), int8('A'), int8('M'), int8('P'), int8('R'), int8('E'), int8('C'), int8('E'), int8('D'), int8('I'), int8('N'), int8('G'), int8('F'), int8('A'),
 158298 	int8('I'), int8('L'), int8('A'), int8('S'), int8('T'), int8('F'), int8('I'), int8('L'), int8('T'), int8('E'), int8('R'), int8('E'), int8('P'), int8('L'), int8('A'), int8('C'), int8('E'), int8('F'),
 158299 	int8('I'), int8('R'), int8('S'), int8('T'), int8('F'), int8('O'), int8('L'), int8('L'), int8('O'), int8('W'), int8('I'), int8('N'), int8('G'), int8('F'), int8('R'), int8('O'), int8('M'), int8('F'),
 158300 	int8('U'), int8('L'), int8('L'), int8('I'), int8('M'), int8('I'), int8('T'), int8('I'), int8('F'), int8('O'), int8('R'), int8('D'), int8('E'), int8('R'), int8('E'), int8('S'), int8('T'), int8('R'),
 158301 	int8('I'), int8('C'), int8('T'), int8('O'), int8('T'), int8('H'), int8('E'), int8('R'), int8('S'), int8('O'), int8('V'), int8('E'), int8('R'), int8('E'), int8('T'), int8('U'), int8('R'), int8('N'),
 158302 	int8('I'), int8('N'), int8('G'), int8('R'), int8('I'), int8('G'), int8('H'), int8('T'), int8('R'), int8('O'), int8('L'), int8('L'), int8('B'), int8('A'), int8('C'), int8('K'), int8('R'), int8('O'),
 158303 	int8('W'), int8('S'), int8('U'), int8('N'), int8('B'), int8('O'), int8('U'), int8('N'), int8('D'), int8('E'), int8('D'), int8('U'), int8('N'), int8('I'), int8('O'), int8('N'), int8('U'), int8('S'),
 158304 	int8('I'), int8('N'), int8('G'), int8('V'), int8('A'), int8('C'), int8('U'), int8('U'), int8('M'), int8('V'), int8('I'), int8('E'), int8('W'), int8('I'), int8('N'), int8('D'), int8('O'), int8('W'),
 158305 	int8('B'), int8('Y'), int8('I'), int8('N'), int8('I'), int8('T'), int8('I'), int8('A'), int8('L'), int8('L'), int8('Y'), int8('P'), int8('R'), int8('I'), int8('M'), int8('A'), int8('R'), int8('Y'),
 158306 }
 158307 
 158308 var aKWHash = [127]uint8{
 158309 	uint8(84), uint8(92), uint8(134), uint8(82), uint8(105), uint8(29), uint8(0), uint8(0), uint8(94), uint8(0), uint8(85), uint8(72), uint8(0),
 158310 	uint8(53), uint8(35), uint8(86), uint8(15), uint8(0), uint8(42), uint8(97), uint8(54), uint8(89), uint8(135), uint8(19), uint8(0), uint8(0),
 158311 	uint8(140), uint8(0), uint8(40), uint8(129), uint8(0), uint8(22), uint8(107), uint8(0), uint8(9), uint8(0), uint8(0), uint8(123), uint8(80),
 158312 	uint8(0), uint8(78), uint8(6), uint8(0), uint8(65), uint8(103), uint8(147), uint8(0), uint8(136), uint8(115), uint8(0), uint8(0), uint8(48),
 158313 	uint8(0), uint8(90), uint8(24), uint8(0), uint8(17), uint8(0), uint8(27), uint8(70), uint8(23), uint8(26), uint8(5), uint8(60), uint8(142),
 158314 	uint8(110), uint8(122), uint8(0), uint8(73), uint8(91), uint8(71), uint8(145), uint8(61), uint8(120), uint8(74), uint8(0), uint8(49), uint8(0),
 158315 	uint8(11), uint8(41), uint8(0), uint8(113), uint8(0), uint8(0), uint8(0), uint8(109), uint8(10), uint8(111), uint8(116), uint8(125), uint8(14),
 158316 	uint8(50), uint8(124), uint8(0), uint8(100), uint8(0), uint8(18), uint8(121), uint8(144), uint8(56), uint8(130), uint8(139), uint8(88), uint8(83),
 158317 	uint8(37), uint8(30), uint8(126), uint8(0), uint8(0), uint8(108), uint8(51), uint8(131), uint8(128), uint8(0), uint8(34), uint8(0), uint8(0),
 158318 	uint8(132), uint8(0), uint8(98), uint8(38), uint8(39), uint8(0), uint8(20), uint8(45), uint8(117), uint8(93),
 158319 }
 158320 
 158321 var aKWNext = [147]uint8{
 158322 	uint8(0), uint8(0), uint8(0), uint8(0), uint8(4), uint8(0), uint8(43), uint8(0), uint8(0), uint8(106), uint8(114), uint8(0), uint8(0),
 158323 	uint8(0), uint8(2), uint8(0), uint8(0), uint8(143), uint8(0), uint8(0), uint8(0), uint8(13), uint8(0), uint8(0), uint8(0), uint8(0),
 158324 	uint8(141), uint8(0), uint8(0), uint8(119), uint8(52), uint8(0), uint8(0), uint8(137), uint8(12), uint8(0), uint8(0), uint8(62), uint8(0),
 158325 	uint8(138), uint8(0), uint8(133), uint8(0), uint8(0), uint8(36), uint8(0), uint8(0), uint8(28), uint8(77), uint8(0), uint8(0), uint8(0),
 158326 	uint8(0), uint8(59), uint8(0), uint8(47), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
 158327 	uint8(0), uint8(69), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(146), uint8(3), uint8(0), uint8(58), uint8(0), uint8(1),
 158328 	uint8(75), uint8(0), uint8(0), uint8(0), uint8(31), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(127), uint8(0), uint8(104),
 158329 	uint8(0), uint8(64), uint8(66), uint8(63), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(46), uint8(0), uint8(16), uint8(8),
 158330 	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(81), uint8(101), uint8(0),
 158331 	uint8(112), uint8(21), uint8(7), uint8(67), uint8(0), uint8(79), uint8(96), uint8(118), uint8(0), uint8(0), uint8(68), uint8(0), uint8(0),
 158332 	uint8(99), uint8(44), uint8(0), uint8(55), uint8(0), uint8(76), uint8(0), uint8(95), uint8(32), uint8(33), uint8(57), uint8(25), uint8(0),
 158333 	uint8(102), uint8(0), uint8(0), uint8(87),
 158334 }
 158335 
 158336 var aKWLen = [147]uint8{
 158337 	uint8(7), uint8(7), uint8(5), uint8(4), uint8(6), uint8(4), uint8(5), uint8(3), uint8(6), uint8(7), uint8(3), uint8(6), uint8(6),
 158338 	uint8(7), uint8(7), uint8(3), uint8(8), uint8(2), uint8(6), uint8(5), uint8(4), uint8(4), uint8(3), uint8(10), uint8(4), uint8(7),
 158339 	uint8(6), uint8(9), uint8(4), uint8(2), uint8(6), uint8(5), uint8(9), uint8(9), uint8(4), uint8(7), uint8(3), uint8(2), uint8(4),
 158340 	uint8(4), uint8(6), uint8(11), uint8(6), uint8(2), uint8(7), uint8(5), uint8(5), uint8(9), uint8(6), uint8(10), uint8(4), uint8(6),
 158341 	uint8(2), uint8(3), uint8(7), uint8(5), uint8(9), uint8(6), uint8(6), uint8(4), uint8(5), uint8(5), uint8(10), uint8(6), uint8(5),
 158342 	uint8(7), uint8(4), uint8(5), uint8(7), uint8(6), uint8(7), uint8(7), uint8(6), uint8(5), uint8(7), uint8(3), uint8(7), uint8(4),
 158343 	uint8(7), uint8(6), uint8(12), uint8(9), uint8(4), uint8(6), uint8(5), uint8(4), uint8(7), uint8(6), uint8(12), uint8(8), uint8(8),
 158344 	uint8(2), uint8(6), uint8(6), uint8(7), uint8(6), uint8(4), uint8(5), uint8(9), uint8(5), uint8(5), uint8(6), uint8(3), uint8(4),
 158345 	uint8(9), uint8(13), uint8(2), uint8(2), uint8(4), uint8(6), uint8(6), uint8(8), uint8(5), uint8(17), uint8(12), uint8(7), uint8(9),
 158346 	uint8(4), uint8(4), uint8(6), uint8(7), uint8(5), uint8(9), uint8(4), uint8(4), uint8(5), uint8(2), uint8(5), uint8(8), uint8(6),
 158347 	uint8(4), uint8(9), uint8(5), uint8(8), uint8(4), uint8(3), uint8(9), uint8(5), uint8(5), uint8(6), uint8(4), uint8(6), uint8(2),
 158348 	uint8(2), uint8(9), uint8(3), uint8(7),
 158349 }
 158350 
 158351 var aKWOffset = [147]uint16{
 158352 	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),
 158353 	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),
 158354 	uint16(86), uint16(90), uint16(90), uint16(94), uint16(99), uint16(101), uint16(105), uint16(111), uint16(119), uint16(123), uint16(123), uint16(123), uint16(126),
 158355 	uint16(129), uint16(132), uint16(137), uint16(142), uint16(146), uint16(147), uint16(152), uint16(156), uint16(160), uint16(168), uint16(174), uint16(181), uint16(184),
 158356 	uint16(184), uint16(187), uint16(189), uint16(195), uint16(198), uint16(206), uint16(211), uint16(216), uint16(219), uint16(222), uint16(226), uint16(236), uint16(239),
 158357 	uint16(244), uint16(244), uint16(248), uint16(252), uint16(259), uint16(265), uint16(271), uint16(277), uint16(277), uint16(283), uint16(284), uint16(288), uint16(295),
 158358 	uint16(299), uint16(306), uint16(312), uint16(324), uint16(333), uint16(335), uint16(341), uint16(346), uint16(348), uint16(355), uint16(359), uint16(370), uint16(377),
 158359 	uint16(378), uint16(385), uint16(391), uint16(397), uint16(402), uint16(408), uint16(412), uint16(415), uint16(424), uint16(429), uint16(433), uint16(439), uint16(441),
 158360 	uint16(444), uint16(453), uint16(455), uint16(457), uint16(466), uint16(470), uint16(476), uint16(482), uint16(490), uint16(495), uint16(495), uint16(495), uint16(511),
 158361 	uint16(520), uint16(523), uint16(527), uint16(532), uint16(539), uint16(544), uint16(553), uint16(557), uint16(560), uint16(565), uint16(567), uint16(571), uint16(579),
 158362 	uint16(585), uint16(588), uint16(597), uint16(602), uint16(610), uint16(610), uint16(614), uint16(623), uint16(628), uint16(633), uint16(639), uint16(642), uint16(645),
 158363 	uint16(648), uint16(650), uint16(655), uint16(659),
 158364 }
 158365 
 158366 var aKWCode = [147]uint8{
 158367 	uint8(TK_REINDEX), uint8(TK_INDEXED), uint8(TK_INDEX), uint8(TK_DESC), uint8(TK_ESCAPE),
 158368 	uint8(TK_EACH), uint8(TK_CHECK), uint8(TK_KEY), uint8(TK_BEFORE), uint8(TK_FOREIGN),
 158369 	uint8(TK_FOR), uint8(TK_IGNORE), uint8(TK_LIKE_KW), uint8(TK_EXPLAIN), uint8(TK_INSTEAD),
 158370 	uint8(TK_ADD), uint8(TK_DATABASE), uint8(TK_AS), uint8(TK_SELECT), uint8(TK_TABLE),
 158371 	uint8(TK_JOIN_KW), uint8(TK_THEN), uint8(TK_END), uint8(TK_DEFERRABLE), uint8(TK_ELSE),
 158372 	uint8(TK_EXCLUDE), uint8(TK_DELETE), uint8(TK_TEMP), uint8(TK_TEMP), uint8(TK_OR),
 158373 	uint8(TK_ISNULL), uint8(TK_NULLS), uint8(TK_SAVEPOINT), uint8(TK_INTERSECT), uint8(TK_TIES),
 158374 	uint8(TK_NOTNULL), uint8(TK_NOT), uint8(TK_NO), uint8(TK_NULL), uint8(TK_LIKE_KW),
 158375 	uint8(TK_EXCEPT), uint8(TK_TRANSACTION), uint8(TK_ACTION), uint8(TK_ON), uint8(TK_JOIN_KW),
 158376 	uint8(TK_ALTER), uint8(TK_RAISE), uint8(TK_EXCLUSIVE), uint8(TK_EXISTS), uint8(TK_CONSTRAINT),
 158377 	uint8(TK_INTO), uint8(TK_OFFSET), uint8(TK_OF), uint8(TK_SET), uint8(TK_TRIGGER),
 158378 	uint8(TK_RANGE), uint8(TK_GENERATED), uint8(TK_DETACH), uint8(TK_HAVING), uint8(TK_LIKE_KW),
 158379 	uint8(TK_BEGIN), uint8(TK_JOIN_KW), uint8(TK_REFERENCES), uint8(TK_UNIQUE), uint8(TK_QUERY),
 158380 	uint8(TK_WITHOUT), uint8(TK_WITH), uint8(TK_JOIN_KW), uint8(TK_RELEASE), uint8(TK_ATTACH),
 158381 	uint8(TK_BETWEEN), uint8(TK_NOTHING), uint8(TK_GROUPS), uint8(TK_GROUP), uint8(TK_CASCADE),
 158382 	uint8(TK_ASC), uint8(TK_DEFAULT), uint8(TK_CASE), uint8(TK_COLLATE), uint8(TK_CREATE),
 158383 	uint8(TK_CTIME_KW), uint8(TK_IMMEDIATE), uint8(TK_JOIN), uint8(TK_INSERT), uint8(TK_MATCH),
 158384 	uint8(TK_PLAN), uint8(TK_ANALYZE), uint8(TK_PRAGMA), uint8(TK_MATERIALIZED), uint8(TK_DEFERRED),
 158385 	uint8(TK_DISTINCT), uint8(TK_IS), uint8(TK_UPDATE), uint8(TK_VALUES), uint8(TK_VIRTUAL),
 158386 	uint8(TK_ALWAYS), uint8(TK_WHEN), uint8(TK_WHERE), uint8(TK_RECURSIVE), uint8(TK_ABORT),
 158387 	uint8(TK_AFTER), uint8(TK_RENAME), uint8(TK_AND), uint8(TK_DROP), uint8(TK_PARTITION),
 158388 	uint8(TK_AUTOINCR), uint8(TK_TO), uint8(TK_IN), uint8(TK_CAST), uint8(TK_COLUMNKW),
 158389 	uint8(TK_COMMIT), uint8(TK_CONFLICT), uint8(TK_JOIN_KW), uint8(TK_CTIME_KW), uint8(TK_CTIME_KW),
 158390 	uint8(TK_CURRENT), uint8(TK_PRECEDING), uint8(TK_FAIL), uint8(TK_LAST), uint8(TK_FILTER),
 158391 	uint8(TK_REPLACE), uint8(TK_FIRST), uint8(TK_FOLLOWING), uint8(TK_FROM), uint8(TK_JOIN_KW),
 158392 	uint8(TK_LIMIT), uint8(TK_IF), uint8(TK_ORDER), uint8(TK_RESTRICT), uint8(TK_OTHERS),
 158393 	uint8(TK_OVER), uint8(TK_RETURNING), uint8(TK_JOIN_KW), uint8(TK_ROLLBACK), uint8(TK_ROWS),
 158394 	uint8(TK_ROW), uint8(TK_UNBOUNDED), uint8(TK_UNION), uint8(TK_USING), uint8(TK_VACUUM),
 158395 	uint8(TK_VIEW), uint8(TK_WINDOW), uint8(TK_DO), uint8(TK_BY), uint8(TK_INITIALLY),
 158396 	uint8(TK_ALL), uint8(TK_PRIMARY),
 158397 }
 158398 
 158399 func keywordCode(tls *libc.TLS, z uintptr, n int32, pType uintptr) int32 {
 158400 	var i int32
 158401 	var j int32
 158402 	var zKW uintptr
 158403 	if n >= 2 {
 158404 		i = (int32(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(z)))])*4 ^ int32(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(z + uintptr(n-1))))])*3 ^ n*1) % 127
 158405 		for i = int32(aKWHash[i]) - 1; i >= 0; i = int32(aKWNext[i]) - 1 {
 158406 			if int32(aKWLen[i]) != n {
 158407 				continue
 158408 			}
 158409 			zKW = uintptr(unsafe.Pointer(&zKWText)) + uintptr(aKWOffset[i])
 158410 			if int32(*(*int8)(unsafe.Pointer(z)))&libc.CplInt32(0x20) != int32(*(*int8)(unsafe.Pointer(zKW))) {
 158411 				continue
 158412 			}
 158413 			if int32(*(*int8)(unsafe.Pointer(z + 1)))&libc.CplInt32(0x20) != int32(*(*int8)(unsafe.Pointer(zKW + 1))) {
 158414 				continue
 158415 			}
 158416 			j = 2
 158417 			for j < n && int32(*(*int8)(unsafe.Pointer(z + uintptr(j))))&libc.CplInt32(0x20) == int32(*(*int8)(unsafe.Pointer(zKW + uintptr(j)))) {
 158418 				j++
 158419 			}
 158420 			if j < n {
 158421 				continue
 158422 			}
 158423 
 158424 			*(*int32)(unsafe.Pointer(pType)) = int32(aKWCode[i])
 158425 			break
 158426 		}
 158427 	}
 158428 	return n
 158429 }
 158430 
 158431 func Xsqlite3KeywordCode(tls *libc.TLS, z uintptr, n int32) int32 {
 158432 	bp := tls.Alloc(4)
 158433 	defer tls.Free(4)
 158434 
 158435 	*(*int32)(unsafe.Pointer(bp)) = TK_ID
 158436 	keywordCode(tls, z, n, bp)
 158437 	return *(*int32)(unsafe.Pointer(bp))
 158438 }
 158439 
 158440 func Xsqlite3_keyword_name(tls *libc.TLS, i int32, pzName uintptr, pnName uintptr) int32 {
 158441 	if i < 0 || i >= SQLITE_N_KEYWORD {
 158442 		return SQLITE_ERROR
 158443 	}
 158444 	*(*uintptr)(unsafe.Pointer(pzName)) = uintptr(unsafe.Pointer(&zKWText)) + uintptr(aKWOffset[i])
 158445 	*(*int32)(unsafe.Pointer(pnName)) = int32(aKWLen[i])
 158446 	return SQLITE_OK
 158447 }
 158448 
 158449 func Xsqlite3_keyword_count(tls *libc.TLS) int32 {
 158450 	return SQLITE_N_KEYWORD
 158451 }
 158452 
 158453 func Xsqlite3_keyword_check(tls *libc.TLS, zName uintptr, nName int32) int32 {
 158454 	return libc.Bool32(TK_ID != Xsqlite3KeywordCode(tls, zName, nName))
 158455 }
 158456 
 158457 // Make the IdChar function accessible from ctime.c and alter.c
 158458 func Xsqlite3IsIdChar(tls *libc.TLS, c U8) int32 {
 158459 	return libc.Bool32(int32(Xsqlite3CtypeMap[c])&0x46 != 0)
 158460 }
 158461 
 158462 func getToken(tls *libc.TLS, pz uintptr) int32 {
 158463 	bp := tls.Alloc(4)
 158464 	defer tls.Free(4)
 158465 
 158466 	var z uintptr = *(*uintptr)(unsafe.Pointer(pz))
 158467 
 158468 	for __ccgo := true; __ccgo; __ccgo = *(*int32)(unsafe.Pointer(bp)) == TK_SPACE {
 158469 		z += uintptr(Xsqlite3GetToken(tls, z, bp))
 158470 	}
 158471 	if *(*int32)(unsafe.Pointer(bp)) == TK_ID ||
 158472 		*(*int32)(unsafe.Pointer(bp)) == TK_STRING ||
 158473 		*(*int32)(unsafe.Pointer(bp)) == TK_JOIN_KW ||
 158474 		*(*int32)(unsafe.Pointer(bp)) == TK_WINDOW ||
 158475 		*(*int32)(unsafe.Pointer(bp)) == TK_OVER ||
 158476 		Xsqlite3ParserFallback(tls, *(*int32)(unsafe.Pointer(bp))) == TK_ID {
 158477 		*(*int32)(unsafe.Pointer(bp)) = TK_ID
 158478 	}
 158479 	*(*uintptr)(unsafe.Pointer(pz)) = z
 158480 	return *(*int32)(unsafe.Pointer(bp))
 158481 }
 158482 
 158483 func analyzeWindowKeyword(tls *libc.TLS, z uintptr) int32 {
 158484 	bp := tls.Alloc(8)
 158485 	defer tls.Free(8)
 158486 	*(*uintptr)(unsafe.Pointer(bp)) = z
 158487 
 158488 	var t int32
 158489 	t = getToken(tls, bp)
 158490 	if t != TK_ID {
 158491 		return TK_ID
 158492 	}
 158493 	t = getToken(tls, bp)
 158494 	if t != TK_AS {
 158495 		return TK_ID
 158496 	}
 158497 	return TK_WINDOW
 158498 }
 158499 
 158500 func analyzeOverKeyword(tls *libc.TLS, z uintptr, lastToken int32) int32 {
 158501 	bp := tls.Alloc(8)
 158502 	defer tls.Free(8)
 158503 	*(*uintptr)(unsafe.Pointer(bp)) = z
 158504 
 158505 	if lastToken == TK_RP {
 158506 		var t int32 = getToken(tls, bp)
 158507 		if t == TK_LP || t == TK_ID {
 158508 			return TK_OVER
 158509 		}
 158510 	}
 158511 	return TK_ID
 158512 }
 158513 
 158514 func analyzeFilterKeyword(tls *libc.TLS, z uintptr, lastToken int32) int32 {
 158515 	bp := tls.Alloc(8)
 158516 	defer tls.Free(8)
 158517 	*(*uintptr)(unsafe.Pointer(bp)) = z
 158518 
 158519 	if lastToken == TK_RP && getToken(tls, bp) == TK_LP {
 158520 		return TK_FILTER
 158521 	}
 158522 	return TK_ID
 158523 }
 158524 
 158525 // Return the length (in bytes) of the token that begins at z[0].
 158526 // Store the token type in *tokenType before returning.
 158527 func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 {
 158528 	var i int32
 158529 	var c int32
 158530 	switch int32(aiClass[*(*uint8)(unsafe.Pointer(z))]) {
 158531 	case CC_SPACE:
 158532 		{
 158533 			for i = 1; int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&0x01 != 0; i++ {
 158534 			}
 158535 			*(*int32)(unsafe.Pointer(tokenType)) = TK_SPACE
 158536 			return i
 158537 
 158538 		}
 158539 	case CC_MINUS:
 158540 		{
 158541 			if int32(*(*uint8)(unsafe.Pointer(z + 1))) == '-' {
 158542 				for i = 2; libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i))))) != 0 && c != '\n'; i++ {
 158543 				}
 158544 				*(*int32)(unsafe.Pointer(tokenType)) = TK_SPACE
 158545 				return i
 158546 			} else if int32(*(*uint8)(unsafe.Pointer(z + 1))) == '>' {
 158547 				*(*int32)(unsafe.Pointer(tokenType)) = TK_PTR
 158548 				return 2 + libc.Bool32(int32(*(*uint8)(unsafe.Pointer(z + 2))) == '>')
 158549 			}
 158550 			*(*int32)(unsafe.Pointer(tokenType)) = TK_MINUS
 158551 			return 1
 158552 
 158553 		}
 158554 	case CC_LP:
 158555 		{
 158556 			*(*int32)(unsafe.Pointer(tokenType)) = TK_LP
 158557 			return 1
 158558 
 158559 		}
 158560 	case CC_RP:
 158561 		{
 158562 			*(*int32)(unsafe.Pointer(tokenType)) = TK_RP
 158563 			return 1
 158564 
 158565 		}
 158566 	case CC_SEMI:
 158567 		{
 158568 			*(*int32)(unsafe.Pointer(tokenType)) = TK_SEMI
 158569 			return 1
 158570 
 158571 		}
 158572 	case CC_PLUS:
 158573 		{
 158574 			*(*int32)(unsafe.Pointer(tokenType)) = TK_PLUS
 158575 			return 1
 158576 
 158577 		}
 158578 	case CC_STAR:
 158579 		{
 158580 			*(*int32)(unsafe.Pointer(tokenType)) = TK_STAR
 158581 			return 1
 158582 
 158583 		}
 158584 	case CC_SLASH:
 158585 		{
 158586 			if int32(*(*uint8)(unsafe.Pointer(z + 1))) != '*' || int32(*(*uint8)(unsafe.Pointer(z + 2))) == 0 {
 158587 				*(*int32)(unsafe.Pointer(tokenType)) = TK_SLASH
 158588 				return 1
 158589 			}
 158590 			i = 3
 158591 			c = int32(*(*uint8)(unsafe.Pointer(z + 2)))
 158592 			for ; (c != '*' || int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != '/') && libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i))))) != 0; i++ {
 158593 			}
 158594 			if c != 0 {
 158595 				i++
 158596 			}
 158597 			*(*int32)(unsafe.Pointer(tokenType)) = TK_SPACE
 158598 			return i
 158599 
 158600 		}
 158601 	case CC_PERCENT:
 158602 		{
 158603 			*(*int32)(unsafe.Pointer(tokenType)) = TK_REM
 158604 			return 1
 158605 
 158606 		}
 158607 	case CC_EQ:
 158608 		{
 158609 			*(*int32)(unsafe.Pointer(tokenType)) = TK_EQ
 158610 			return 1 + libc.Bool32(int32(*(*uint8)(unsafe.Pointer(z + 1))) == '=')
 158611 
 158612 		}
 158613 	case CC_LT:
 158614 		{
 158615 			if libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + 1)))) == '=' {
 158616 				*(*int32)(unsafe.Pointer(tokenType)) = TK_LE
 158617 				return 2
 158618 			} else if c == '>' {
 158619 				*(*int32)(unsafe.Pointer(tokenType)) = TK_NE
 158620 				return 2
 158621 			} else if c == '<' {
 158622 				*(*int32)(unsafe.Pointer(tokenType)) = TK_LSHIFT
 158623 				return 2
 158624 			} else {
 158625 				*(*int32)(unsafe.Pointer(tokenType)) = TK_LT
 158626 				return 1
 158627 			}
 158628 
 158629 		}
 158630 		fallthrough
 158631 	case CC_GT:
 158632 		{
 158633 			if libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + 1)))) == '=' {
 158634 				*(*int32)(unsafe.Pointer(tokenType)) = TK_GE
 158635 				return 2
 158636 			} else if c == '>' {
 158637 				*(*int32)(unsafe.Pointer(tokenType)) = TK_RSHIFT
 158638 				return 2
 158639 			} else {
 158640 				*(*int32)(unsafe.Pointer(tokenType)) = TK_GT
 158641 				return 1
 158642 			}
 158643 
 158644 		}
 158645 		fallthrough
 158646 	case CC_BANG:
 158647 		{
 158648 			if int32(*(*uint8)(unsafe.Pointer(z + 1))) != '=' {
 158649 				*(*int32)(unsafe.Pointer(tokenType)) = TK_ILLEGAL
 158650 				return 1
 158651 			} else {
 158652 				*(*int32)(unsafe.Pointer(tokenType)) = TK_NE
 158653 				return 2
 158654 			}
 158655 
 158656 		}
 158657 		fallthrough
 158658 	case CC_PIPE:
 158659 		{
 158660 			if int32(*(*uint8)(unsafe.Pointer(z + 1))) != '|' {
 158661 				*(*int32)(unsafe.Pointer(tokenType)) = TK_BITOR
 158662 				return 1
 158663 			} else {
 158664 				*(*int32)(unsafe.Pointer(tokenType)) = TK_CONCAT
 158665 				return 2
 158666 			}
 158667 
 158668 		}
 158669 		fallthrough
 158670 	case CC_COMMA:
 158671 		{
 158672 			*(*int32)(unsafe.Pointer(tokenType)) = TK_COMMA
 158673 			return 1
 158674 
 158675 		}
 158676 	case CC_AND:
 158677 		{
 158678 			*(*int32)(unsafe.Pointer(tokenType)) = TK_BITAND
 158679 			return 1
 158680 
 158681 		}
 158682 	case CC_TILDA:
 158683 		{
 158684 			*(*int32)(unsafe.Pointer(tokenType)) = TK_BITNOT
 158685 			return 1
 158686 
 158687 		}
 158688 	case CC_QUOTE:
 158689 		{
 158690 			var delim int32 = int32(*(*uint8)(unsafe.Pointer(z)))
 158691 
 158692 			for i = 1; libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i))))) != 0; i++ {
 158693 				if c == delim {
 158694 					if int32(*(*uint8)(unsafe.Pointer(z + uintptr(i+1)))) == delim {
 158695 						i++
 158696 					} else {
 158697 						break
 158698 					}
 158699 				}
 158700 			}
 158701 			if c == '\'' {
 158702 				*(*int32)(unsafe.Pointer(tokenType)) = TK_STRING
 158703 				return i + 1
 158704 			} else if c != 0 {
 158705 				*(*int32)(unsafe.Pointer(tokenType)) = TK_ID
 158706 				return i + 1
 158707 			} else {
 158708 				*(*int32)(unsafe.Pointer(tokenType)) = TK_ILLEGAL
 158709 				return i
 158710 			}
 158711 
 158712 		}
 158713 		fallthrough
 158714 	case CC_DOT:
 158715 		{
 158716 			if !(int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 1))])&0x04 != 0) {
 158717 				*(*int32)(unsafe.Pointer(tokenType)) = TK_DOT
 158718 				return 1
 158719 			}
 158720 
 158721 		}
 158722 		fallthrough
 158723 	case CC_DIGIT:
 158724 		{
 158725 			*(*int32)(unsafe.Pointer(tokenType)) = TK_INTEGER
 158726 			if int32(*(*uint8)(unsafe.Pointer(z))) == '0' && (int32(*(*uint8)(unsafe.Pointer(z + 1))) == 'x' || int32(*(*uint8)(unsafe.Pointer(z + 1))) == 'X') && int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 2))])&0x08 != 0 {
 158727 				for i = 3; int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&0x08 != 0; i++ {
 158728 				}
 158729 				return i
 158730 			}
 158731 			for i = 0; int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&0x04 != 0; i++ {
 158732 			}
 158733 			if int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == '.' {
 158734 				i++
 158735 				for int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&0x04 != 0 {
 158736 					i++
 158737 				}
 158738 				*(*int32)(unsafe.Pointer(tokenType)) = TK_FLOAT
 158739 			}
 158740 			if (int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == 'e' || int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == 'E') && (int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+1)))])&0x04 != 0 ||
 158741 				(int32(*(*uint8)(unsafe.Pointer(z + uintptr(i+1)))) == '+' || int32(*(*uint8)(unsafe.Pointer(z + uintptr(i+1)))) == '-') && int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+2)))])&0x04 != 0) {
 158742 				i = i + 2
 158743 				for int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&0x04 != 0 {
 158744 					i++
 158745 				}
 158746 				*(*int32)(unsafe.Pointer(tokenType)) = TK_FLOAT
 158747 			}
 158748 			for int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&0x46 != 0 {
 158749 				*(*int32)(unsafe.Pointer(tokenType)) = TK_ILLEGAL
 158750 				i++
 158751 			}
 158752 			return i
 158753 
 158754 		}
 158755 	case CC_QUOTE2:
 158756 		{
 158757 			i = 1
 158758 			c = int32(*(*uint8)(unsafe.Pointer(z)))
 158759 			for ; c != ']' && libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i))))) != 0; i++ {
 158760 			}
 158761 			*(*int32)(unsafe.Pointer(tokenType)) = func() int32 {
 158762 				if c == ']' {
 158763 					return TK_ID
 158764 				}
 158765 				return TK_ILLEGAL
 158766 			}()
 158767 			return i
 158768 
 158769 		}
 158770 	case CC_VARNUM:
 158771 		{
 158772 			*(*int32)(unsafe.Pointer(tokenType)) = TK_VARIABLE
 158773 			for i = 1; int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&0x04 != 0; i++ {
 158774 			}
 158775 			return i
 158776 
 158777 		}
 158778 	case CC_DOLLAR:
 158779 		fallthrough
 158780 	case CC_VARALPHA:
 158781 		{
 158782 			var n int32 = 0
 158783 
 158784 			*(*int32)(unsafe.Pointer(tokenType)) = TK_VARIABLE
 158785 			for i = 1; libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i))))) != 0; i++ {
 158786 				if int32(Xsqlite3CtypeMap[uint8(c)])&0x46 != 0 {
 158787 					n++
 158788 				} else if c == '(' && n > 0 {
 158789 					for __ccgo := true; __ccgo; __ccgo = libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i))))) != 0 && !(int32(Xsqlite3CtypeMap[uint8(c)])&0x01 != 0) && c != ')' {
 158790 						i++
 158791 					}
 158792 					if c == ')' {
 158793 						i++
 158794 					} else {
 158795 						*(*int32)(unsafe.Pointer(tokenType)) = TK_ILLEGAL
 158796 					}
 158797 					break
 158798 				} else if c == ':' && int32(*(*uint8)(unsafe.Pointer(z + uintptr(i+1)))) == ':' {
 158799 					i++
 158800 				} else {
 158801 					break
 158802 				}
 158803 			}
 158804 			if n == 0 {
 158805 				*(*int32)(unsafe.Pointer(tokenType)) = TK_ILLEGAL
 158806 			}
 158807 			return i
 158808 
 158809 		}
 158810 	case CC_KYWD0:
 158811 		{
 158812 			for i = 1; int32(aiClass[*(*uint8)(unsafe.Pointer(z + uintptr(i)))]) <= CC_KYWD; i++ {
 158813 			}
 158814 			if int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&0x46 != 0 {
 158815 				i++
 158816 				break
 158817 			}
 158818 			*(*int32)(unsafe.Pointer(tokenType)) = TK_ID
 158819 			return keywordCode(tls, z, i, tokenType)
 158820 
 158821 		}
 158822 	case CC_X:
 158823 		{
 158824 			if int32(*(*uint8)(unsafe.Pointer(z + 1))) == '\'' {
 158825 				*(*int32)(unsafe.Pointer(tokenType)) = TK_BLOB
 158826 				for i = 2; int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&0x08 != 0; i++ {
 158827 				}
 158828 				if int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != '\'' || i%2 != 0 {
 158829 					*(*int32)(unsafe.Pointer(tokenType)) = TK_ILLEGAL
 158830 					for *(*uint8)(unsafe.Pointer(z + uintptr(i))) != 0 && int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != '\'' {
 158831 						i++
 158832 					}
 158833 				}
 158834 				if *(*uint8)(unsafe.Pointer(z + uintptr(i))) != 0 {
 158835 					i++
 158836 				}
 158837 				return i
 158838 			}
 158839 
 158840 		}
 158841 		fallthrough
 158842 	case CC_KYWD:
 158843 		fallthrough
 158844 	case CC_ID:
 158845 		{
 158846 			i = 1
 158847 			break
 158848 
 158849 		}
 158850 	case CC_BOM:
 158851 		{
 158852 			if int32(*(*uint8)(unsafe.Pointer(z + 1))) == 0xbb && int32(*(*uint8)(unsafe.Pointer(z + 2))) == 0xbf {
 158853 				*(*int32)(unsafe.Pointer(tokenType)) = TK_SPACE
 158854 				return 3
 158855 			}
 158856 			i = 1
 158857 			break
 158858 
 158859 		}
 158860 	case CC_NUL:
 158861 		{
 158862 			*(*int32)(unsafe.Pointer(tokenType)) = TK_ILLEGAL
 158863 			return 0
 158864 
 158865 		}
 158866 	default:
 158867 		{
 158868 			*(*int32)(unsafe.Pointer(tokenType)) = TK_ILLEGAL
 158869 			return 1
 158870 
 158871 		}
 158872 	}
 158873 	for int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&0x46 != 0 {
 158874 		i++
 158875 	}
 158876 	*(*int32)(unsafe.Pointer(tokenType)) = TK_ID
 158877 	return i
 158878 }
 158879 
 158880 // Run the parser on the given SQL string.
 158881 func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) int32 {
 158882 	bp := tls.Alloc(2480)
 158883 	defer tls.Free(2480)
 158884 
 158885 	var nErr int32 = 0
 158886 	var pEngine uintptr
 158887 	var n int32 = 0
 158888 
 158889 	var lastTokenParsed int32 = -1
 158890 	var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
 158891 	var mxSqlLen int32
 158892 	var pParentParse uintptr = uintptr(0)
 158893 
 158894 	mxSqlLen = *(*int32)(unsafe.Pointer(db + 136 + 1*4))
 158895 	if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive == 0 {
 158896 		libc.AtomicStoreNInt32(db+432, int32(0), 0)
 158897 	}
 158898 	(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_OK
 158899 	(*Parse)(unsafe.Pointer(pParse)).FzTail = zSql
 158900 	pEngine = bp + 32
 158901 	Xsqlite3ParserInit(tls, pEngine, pParse)
 158902 
 158903 	pParentParse = (*Sqlite3)(unsafe.Pointer(db)).FpParse
 158904 	(*Sqlite3)(unsafe.Pointer(db)).FpParse = pParse
 158905 	for 1 != 0 {
 158906 		n = Xsqlite3GetToken(tls, zSql, bp+2456)
 158907 		mxSqlLen = mxSqlLen - n
 158908 		if mxSqlLen < 0 {
 158909 			(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_TOOBIG
 158910 			(*Parse)(unsafe.Pointer(pParse)).FnErr++
 158911 			break
 158912 		}
 158913 		if *(*int32)(unsafe.Pointer(bp + 2456)) >= TK_WINDOW {
 158914 			if libc.AtomicLoadNInt32(db+432, 0) != 0 {
 158915 				(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_INTERRUPT
 158916 				(*Parse)(unsafe.Pointer(pParse)).FnErr++
 158917 				break
 158918 			}
 158919 			if *(*int32)(unsafe.Pointer(bp + 2456)) == TK_SPACE {
 158920 				zSql += uintptr(n)
 158921 				continue
 158922 			}
 158923 			if int32(*(*int8)(unsafe.Pointer(zSql))) == 0 {
 158924 				if lastTokenParsed == TK_SEMI {
 158925 					*(*int32)(unsafe.Pointer(bp + 2456)) = 0
 158926 				} else if lastTokenParsed == 0 {
 158927 					break
 158928 				} else {
 158929 					*(*int32)(unsafe.Pointer(bp + 2456)) = TK_SEMI
 158930 				}
 158931 				n = 0
 158932 			} else if *(*int32)(unsafe.Pointer(bp + 2456)) == TK_WINDOW {
 158933 				*(*int32)(unsafe.Pointer(bp + 2456)) = analyzeWindowKeyword(tls, zSql+6)
 158934 			} else if *(*int32)(unsafe.Pointer(bp + 2456)) == TK_OVER {
 158935 				*(*int32)(unsafe.Pointer(bp + 2456)) = analyzeOverKeyword(tls, zSql+4, lastTokenParsed)
 158936 			} else if *(*int32)(unsafe.Pointer(bp + 2456)) == TK_FILTER {
 158937 				*(*int32)(unsafe.Pointer(bp + 2456)) = analyzeFilterKeyword(tls, zSql+6, lastTokenParsed)
 158938 			} else {
 158939 				(*Token)(unsafe.Pointer(bp + 2464)).Fz = zSql
 158940 				(*Token)(unsafe.Pointer(bp + 2464)).Fn = uint32(n)
 158941 				Xsqlite3ErrorMsg(tls, pParse, ts+24725, libc.VaList(bp, bp+2464))
 158942 				break
 158943 			}
 158944 		}
 158945 		(*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fz = zSql
 158946 		(*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fn = uint32(n)
 158947 		Xsqlite3Parser(tls, pEngine, *(*int32)(unsafe.Pointer(bp + 2456)), (*Parse)(unsafe.Pointer(pParse)).FsLastToken)
 158948 		lastTokenParsed = *(*int32)(unsafe.Pointer(bp + 2456))
 158949 		zSql += uintptr(n)
 158950 
 158951 		if (*Parse)(unsafe.Pointer(pParse)).Frc != SQLITE_OK {
 158952 			break
 158953 		}
 158954 	}
 158955 
 158956 	Xsqlite3ParserFinalize(tls, pEngine)
 158957 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 158958 		(*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_NOMEM
 158959 	}
 158960 	if (*Parse)(unsafe.Pointer(pParse)).FzErrMsg != 0 || (*Parse)(unsafe.Pointer(pParse)).Frc != SQLITE_OK && (*Parse)(unsafe.Pointer(pParse)).Frc != SQLITE_DONE {
 158961 		if (*Parse)(unsafe.Pointer(pParse)).FzErrMsg == uintptr(0) {
 158962 			(*Parse)(unsafe.Pointer(pParse)).FzErrMsg = Xsqlite3MPrintf(tls, db, ts+4493, libc.VaList(bp+8, Xsqlite3ErrStr(tls, (*Parse)(unsafe.Pointer(pParse)).Frc)))
 158963 		}
 158964 		Xsqlite3_log(tls, (*Parse)(unsafe.Pointer(pParse)).Frc, ts+24750, libc.VaList(bp+16, (*Parse)(unsafe.Pointer(pParse)).FzErrMsg, (*Parse)(unsafe.Pointer(pParse)).FzTail))
 158965 		nErr++
 158966 	}
 158967 	(*Parse)(unsafe.Pointer(pParse)).FzTail = zSql
 158968 	Xsqlite3_free(tls, (*Parse)(unsafe.Pointer(pParse)).FapVtabLock)
 158969 
 158970 	if (*Parse)(unsafe.Pointer(pParse)).FpNewTable != 0 && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL) {
 158971 		Xsqlite3DeleteTable(tls, db, (*Parse)(unsafe.Pointer(pParse)).FpNewTable)
 158972 	}
 158973 	if (*Parse)(unsafe.Pointer(pParse)).FpNewTrigger != 0 && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) {
 158974 		Xsqlite3DeleteTrigger(tls, db, (*Parse)(unsafe.Pointer(pParse)).FpNewTrigger)
 158975 	}
 158976 	if (*Parse)(unsafe.Pointer(pParse)).FpVList != 0 {
 158977 		Xsqlite3DbNNFreeNN(tls, db, (*Parse)(unsafe.Pointer(pParse)).FpVList)
 158978 	}
 158979 	(*Sqlite3)(unsafe.Pointer(db)).FpParse = pParentParse
 158980 
 158981 	return nErr
 158982 }
 158983 
 158984 // Return TRUE if the given SQL string ends in a semicolon.
 158985 //
 158986 // Special handling is require for CREATE TRIGGER statements.
 158987 // Whenever the CREATE TRIGGER keywords are seen, the statement
 158988 // must end with ";END;".
 158989 //
 158990 // This implementation uses a state machine with 8 states:
 158991 //
 158992 //	(0) INVALID   We have not yet seen a non-whitespace character.
 158993 //
 158994 //	(1) START     At the beginning or end of an SQL statement.  This routine
 158995 //	              returns 1 if it ends in the START state and 0 if it ends
 158996 //	              in any other state.
 158997 //
 158998 //	(2) NORMAL    We are in the middle of statement which ends with a single
 158999 //	              semicolon.
 159000 //
 159001 //	(3) EXPLAIN   The keyword EXPLAIN has been seen at the beginning of
 159002 //	              a statement.
 159003 //
 159004 //	(4) CREATE    The keyword CREATE has been seen at the beginning of a
 159005 //	              statement, possibly preceded by EXPLAIN and/or followed by
 159006 //	              TEMP or TEMPORARY
 159007 //
 159008 //	(5) TRIGGER   We are in the middle of a trigger definition that must be
 159009 //	              ended by a semicolon, the keyword END, and another semicolon.
 159010 //
 159011 //	(6) SEMI      We've seen the first semicolon in the ";END;" that occurs at
 159012 //	              the end of a trigger definition.
 159013 //
 159014 //	(7) END       We've seen the ";END" of the ";END;" that occurs at the end
 159015 //	              of a trigger definition.
 159016 //
 159017 // Transitions between states above are determined by tokens extracted
 159018 // from the input.  The following tokens are significant:
 159019 //
 159020 //	(0) tkSEMI      A semicolon.
 159021 //	(1) tkWS        Whitespace.
 159022 //	(2) tkOTHER     Any other SQL token.
 159023 //	(3) tkEXPLAIN   The "explain" keyword.
 159024 //	(4) tkCREATE    The "create" keyword.
 159025 //	(5) tkTEMP      The "temp" or "temporary" keyword.
 159026 //	(6) tkTRIGGER   The "trigger" keyword.
 159027 //	(7) tkEND       The "end" keyword.
 159028 //
 159029 // Whitespace never causes a state transition and is always ignored.
 159030 // This means that a SQL string of all whitespace is invalid.
 159031 //
 159032 // If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed
 159033 // to recognize the end of a trigger can be omitted.  All we have to do
 159034 // is look for a semicolon that is not part of an string or comment.
 159035 func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 {
 159036 	var state U8 = U8(0)
 159037 	var token U8
 159038 
 159039 	for *(*int8)(unsafe.Pointer(zSql)) != 0 {
 159040 		switch int32(*(*int8)(unsafe.Pointer(zSql))) {
 159041 		case ';':
 159042 			{
 159043 				token = U8(TkSEMI)
 159044 				break
 159045 
 159046 			}
 159047 		case ' ':
 159048 			fallthrough
 159049 		case '\r':
 159050 			fallthrough
 159051 		case '\t':
 159052 			fallthrough
 159053 		case '\n':
 159054 			fallthrough
 159055 		case '\f':
 159056 			{
 159057 				token = U8(TkWS)
 159058 				break
 159059 
 159060 			}
 159061 		case '/':
 159062 			{
 159063 				if int32(*(*int8)(unsafe.Pointer(zSql + 1))) != '*' {
 159064 					token = U8(TkOTHER)
 159065 					break
 159066 				}
 159067 				zSql += uintptr(2)
 159068 				for *(*int8)(unsafe.Pointer(zSql)) != 0 && (int32(*(*int8)(unsafe.Pointer(zSql))) != '*' || int32(*(*int8)(unsafe.Pointer(zSql + 1))) != '/') {
 159069 					zSql++
 159070 				}
 159071 				if int32(*(*int8)(unsafe.Pointer(zSql))) == 0 {
 159072 					return 0
 159073 				}
 159074 				zSql++
 159075 				token = U8(TkWS)
 159076 				break
 159077 
 159078 			}
 159079 		case '-':
 159080 			{
 159081 				if int32(*(*int8)(unsafe.Pointer(zSql + 1))) != '-' {
 159082 					token = U8(TkOTHER)
 159083 					break
 159084 				}
 159085 				for *(*int8)(unsafe.Pointer(zSql)) != 0 && int32(*(*int8)(unsafe.Pointer(zSql))) != '\n' {
 159086 					zSql++
 159087 				}
 159088 				if int32(*(*int8)(unsafe.Pointer(zSql))) == 0 {
 159089 					return libc.Bool32(int32(state) == 1)
 159090 				}
 159091 				token = U8(TkWS)
 159092 				break
 159093 
 159094 			}
 159095 		case '[':
 159096 			{
 159097 				zSql++
 159098 				for *(*int8)(unsafe.Pointer(zSql)) != 0 && int32(*(*int8)(unsafe.Pointer(zSql))) != ']' {
 159099 					zSql++
 159100 				}
 159101 				if int32(*(*int8)(unsafe.Pointer(zSql))) == 0 {
 159102 					return 0
 159103 				}
 159104 				token = U8(TkOTHER)
 159105 				break
 159106 
 159107 			}
 159108 		case '`':
 159109 			fallthrough
 159110 		case '"':
 159111 			fallthrough
 159112 		case '\'':
 159113 			{
 159114 				var c int32 = int32(*(*int8)(unsafe.Pointer(zSql)))
 159115 				zSql++
 159116 				for *(*int8)(unsafe.Pointer(zSql)) != 0 && int32(*(*int8)(unsafe.Pointer(zSql))) != c {
 159117 					zSql++
 159118 				}
 159119 				if int32(*(*int8)(unsafe.Pointer(zSql))) == 0 {
 159120 					return 0
 159121 				}
 159122 				token = U8(TkOTHER)
 159123 				break
 159124 
 159125 			}
 159126 		default:
 159127 			{
 159128 				if int32(Xsqlite3CtypeMap[U8(*(*int8)(unsafe.Pointer(zSql)))])&0x46 != 0 {
 159129 					var nId int32
 159130 					for nId = 1; int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zSql + uintptr(nId))))])&0x46 != 0; nId++ {
 159131 					}
 159132 					switch int32(*(*int8)(unsafe.Pointer(zSql))) {
 159133 					case 'c':
 159134 						fallthrough
 159135 					case 'C':
 159136 						{
 159137 							if nId == 6 && Xsqlite3_strnicmp(tls, zSql, ts+24761, 6) == 0 {
 159138 								token = U8(TkCREATE)
 159139 							} else {
 159140 								token = U8(TkOTHER)
 159141 							}
 159142 							break
 159143 
 159144 						}
 159145 						fallthrough
 159146 					case 't':
 159147 						fallthrough
 159148 					case 'T':
 159149 						{
 159150 							if nId == 7 && Xsqlite3_strnicmp(tls, zSql, ts+21347, 7) == 0 {
 159151 								token = U8(TkTRIGGER)
 159152 							} else if nId == 4 && Xsqlite3_strnicmp(tls, zSql, ts+24768, 4) == 0 {
 159153 								token = U8(TkTEMP)
 159154 							} else if nId == 9 && Xsqlite3_strnicmp(tls, zSql, ts+24773, 9) == 0 {
 159155 								token = U8(TkTEMP)
 159156 							} else {
 159157 								token = U8(TkOTHER)
 159158 							}
 159159 							break
 159160 
 159161 						}
 159162 						fallthrough
 159163 					case 'e':
 159164 						fallthrough
 159165 					case 'E':
 159166 						{
 159167 							if nId == 3 && Xsqlite3_strnicmp(tls, zSql, ts+24783, 3) == 0 {
 159168 								token = U8(TkEND)
 159169 							} else if nId == 7 && Xsqlite3_strnicmp(tls, zSql, ts+24787, 7) == 0 {
 159170 								token = U8(TkEXPLAIN)
 159171 							} else {
 159172 								token = U8(TkOTHER)
 159173 							}
 159174 							break
 159175 
 159176 						}
 159177 						fallthrough
 159178 					default:
 159179 						{
 159180 							token = U8(TkOTHER)
 159181 							break
 159182 
 159183 						}
 159184 					}
 159185 					zSql += uintptr(nId - 1)
 159186 				} else {
 159187 					token = U8(TkOTHER)
 159188 				}
 159189 				break
 159190 
 159191 			}
 159192 		}
 159193 		state = *(*U8)(unsafe.Pointer(uintptr(unsafe.Pointer(&trans)) + uintptr(state)*8 + uintptr(token)))
 159194 		zSql++
 159195 	}
 159196 	return libc.Bool32(int32(state) == 1)
 159197 }
 159198 
 159199 var trans = [8][8]U8{
 159200 	{U8(1), U8(0), U8(2), U8(3), U8(4), U8(2), U8(2), U8(2)},
 159201 	{U8(1), U8(1), U8(2), U8(3), U8(4), U8(2), U8(2), U8(2)},
 159202 	{U8(1), U8(2), U8(2), U8(2), U8(2), U8(2), U8(2), U8(2)},
 159203 	{U8(1), U8(3), U8(3), U8(2), U8(4), U8(2), U8(2), U8(2)},
 159204 	{U8(1), U8(4), U8(2), U8(2), U8(2), U8(4), U8(5), U8(2)},
 159205 	{U8(6), U8(5), U8(5), U8(5), U8(5), U8(5), U8(5), U8(5)},
 159206 	{U8(6), U8(6), U8(5), U8(5), U8(5), U8(5), U8(5), U8(7)},
 159207 	{U8(1), U8(7), U8(5), U8(5), U8(5), U8(5), U8(5), U8(5)},
 159208 }
 159209 
 159210 // This routine is the same as the sqlite3_complete() routine described
 159211 // above, except that the parameter is required to be UTF-16 encoded, not
 159212 // UTF-8.
 159213 func Xsqlite3_complete16(tls *libc.TLS, zSql uintptr) int32 {
 159214 	var pVal uintptr
 159215 	var zSql8 uintptr
 159216 	var rc int32
 159217 
 159218 	rc = Xsqlite3_initialize(tls)
 159219 	if rc != 0 {
 159220 		return rc
 159221 	}
 159222 	pVal = Xsqlite3ValueNew(tls, uintptr(0))
 159223 	Xsqlite3ValueSetStr(tls, pVal, -1, zSql, uint8(SQLITE_UTF16LE), uintptr(0))
 159224 	zSql8 = Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF8))
 159225 	if zSql8 != 0 {
 159226 		rc = Xsqlite3_complete(tls, zSql8)
 159227 	} else {
 159228 		rc = SQLITE_NOMEM
 159229 	}
 159230 	Xsqlite3ValueFree(tls, pVal)
 159231 	return rc & 0xff
 159232 }
 159233 
 159234 func sqlite3TestExtInit(tls *libc.TLS, db uintptr) int32 {
 159235 	_ = db
 159236 	return Xsqlite3FaultSim(tls, 500)
 159237 }
 159238 
 159239 var sqlite3BuiltinExtensions = [4]uintptr{
 159240 	0,
 159241 	0,
 159242 	0,
 159243 	0,
 159244 }
 159245 
 159246 // IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns
 159247 // a pointer to the to the sqlite3_version[] string constant.
 159248 func Xsqlite3_libversion(tls *libc.TLS) uintptr {
 159249 	return uintptr(unsafe.Pointer(&Xsqlite3_version))
 159250 }
 159251 
 159252 // IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function
 159253 // returns an integer equal to SQLITE_VERSION_NUMBER.
 159254 func Xsqlite3_libversion_number(tls *libc.TLS) int32 {
 159255 	return SQLITE_VERSION_NUMBER
 159256 }
 159257 
 159258 // IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns
 159259 // zero if and only if SQLite was compiled with mutexing code omitted due to
 159260 // the SQLITE_THREADSAFE compile-time option being set to 0.
 159261 func Xsqlite3_threadsafe(tls *libc.TLS) int32 {
 159262 	return SQLITE_THREADSAFE
 159263 }
 159264 
 159265 // If the following global variable points to a string which is the
 159266 // name of a directory, then that directory will be used to store
 159267 // temporary files.
 159268 //
 159269 // See also the "PRAGMA temp_store_directory" SQL command.
 159270 var Xsqlite3_temp_directory uintptr = uintptr(0)
 159271 
 159272 // If the following global variable points to a string which is the
 159273 // name of a directory, then that directory will be used to store
 159274 // all database files specified with a relative pathname.
 159275 //
 159276 // See also the "PRAGMA data_store_directory" SQL command.
 159277 var Xsqlite3_data_directory uintptr = uintptr(0)
 159278 
 159279 var mu mutex
 159280 
 159281 func init() { mu.recursive = true }
 159282 
 159283 func Xsqlite3_initialize(tls *libc.TLS) int32 {
 159284 	mu.enter(tls.ID)
 159285 	defer mu.leave(tls.ID)
 159286 
 159287 	var pMainMtx uintptr
 159288 	var rc int32
 159289 
 159290 	if Xsqlite3Config.FisInit != 0 {
 159291 		return SQLITE_OK
 159292 	}
 159293 
 159294 	rc = Xsqlite3MutexInit(tls)
 159295 	if rc != 0 {
 159296 		return rc
 159297 	}
 159298 
 159299 	pMainMtx = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN)
 159300 	Xsqlite3_mutex_enter(tls, pMainMtx)
 159301 	Xsqlite3Config.FisMutexInit = 1
 159302 	if !(Xsqlite3Config.FisMallocInit != 0) {
 159303 		rc = Xsqlite3MallocInit(tls)
 159304 	}
 159305 	if rc == SQLITE_OK {
 159306 		Xsqlite3Config.FisMallocInit = 1
 159307 		if !(int32(Xsqlite3Config.FpInitMutex) != 0) {
 159308 			Xsqlite3Config.FpInitMutex = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_RECURSIVE)
 159309 			if Xsqlite3Config.FbCoreMutex != 0 && !(int32(Xsqlite3Config.FpInitMutex) != 0) {
 159310 				rc = SQLITE_NOMEM
 159311 			}
 159312 		}
 159313 	}
 159314 	if rc == SQLITE_OK {
 159315 		Xsqlite3Config.FnRefInitMutex++
 159316 	}
 159317 	Xsqlite3_mutex_leave(tls, pMainMtx)
 159318 
 159319 	if rc != SQLITE_OK {
 159320 		return rc
 159321 	}
 159322 
 159323 	Xsqlite3_mutex_enter(tls, Xsqlite3Config.FpInitMutex)
 159324 	if Xsqlite3Config.FisInit == 0 && Xsqlite3Config.FinProgress == 0 {
 159325 		Xsqlite3Config.FinProgress = 1
 159326 		libc.Xmemset(tls, uintptr(unsafe.Pointer(&Xsqlite3BuiltinFunctions)), 0, uint64(unsafe.Sizeof(Xsqlite3BuiltinFunctions)))
 159327 		Xsqlite3RegisterBuiltinFunctions(tls)
 159328 		if Xsqlite3Config.FisPCacheInit == 0 {
 159329 			rc = Xsqlite3PcacheInitialize(tls)
 159330 		}
 159331 		if rc == SQLITE_OK {
 159332 			Xsqlite3Config.FisPCacheInit = 1
 159333 			rc = Xsqlite3OsInit(tls)
 159334 		}
 159335 		if rc == SQLITE_OK {
 159336 			rc = Xsqlite3MemdbInit(tls)
 159337 		}
 159338 		if rc == SQLITE_OK {
 159339 			Xsqlite3PCacheBufferSetup(tls, Xsqlite3Config.FpPage,
 159340 				Xsqlite3Config.FszPage, Xsqlite3Config.FnPage)
 159341 
 159342 			Xsqlite3Config.FisInit = 1
 159343 		}
 159344 		Xsqlite3Config.FinProgress = 0
 159345 	}
 159346 	Xsqlite3_mutex_leave(tls, Xsqlite3Config.FpInitMutex)
 159347 
 159348 	Xsqlite3_mutex_enter(tls, pMainMtx)
 159349 	Xsqlite3Config.FnRefInitMutex--
 159350 	if Xsqlite3Config.FnRefInitMutex <= 0 {
 159351 		Xsqlite3_mutex_free(tls, Xsqlite3Config.FpInitMutex)
 159352 		Xsqlite3Config.FpInitMutex = uintptr(0)
 159353 	}
 159354 	Xsqlite3_mutex_leave(tls, pMainMtx)
 159355 
 159356 	return rc
 159357 }
 159358 
 159359 // Undo the effects of sqlite3_initialize().  Must not be called while
 159360 // there are outstanding database connections or memory allocations or
 159361 // while any part of SQLite is otherwise in use in any thread.  This
 159362 // routine is not threadsafe.  But it is safe to invoke this routine
 159363 // on when SQLite is already shut down.  If SQLite is already shut down
 159364 // when this routine is invoked, then this routine is a harmless no-op.
 159365 func Xsqlite3_shutdown(tls *libc.TLS) int32 {
 159366 	if Xsqlite3Config.FisInit != 0 {
 159367 		Xsqlite3_os_end(tls)
 159368 		Xsqlite3_reset_auto_extension(tls)
 159369 		Xsqlite3Config.FisInit = 0
 159370 	}
 159371 	if Xsqlite3Config.FisPCacheInit != 0 {
 159372 		Xsqlite3PcacheShutdown(tls)
 159373 		Xsqlite3Config.FisPCacheInit = 0
 159374 	}
 159375 	if Xsqlite3Config.FisMallocInit != 0 {
 159376 		Xsqlite3MallocEnd(tls)
 159377 		Xsqlite3Config.FisMallocInit = 0
 159378 
 159379 		Xsqlite3_data_directory = uintptr(0)
 159380 		Xsqlite3_temp_directory = uintptr(0)
 159381 	}
 159382 	if Xsqlite3Config.FisMutexInit != 0 {
 159383 		Xsqlite3MutexEnd(tls)
 159384 		Xsqlite3Config.FisMutexInit = 0
 159385 	}
 159386 
 159387 	return SQLITE_OK
 159388 }
 159389 
 159390 // This API allows applications to modify the global configuration of
 159391 // the SQLite library at run-time.
 159392 //
 159393 // This routine should only be called when there are no outstanding
 159394 // database connections or memory allocations.  This routine is not
 159395 // threadsafe.  Failure to heed these warnings can lead to unpredictable
 159396 // behavior.
 159397 func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) int32 {
 159398 	var ap Va_list
 159399 	_ = ap
 159400 	var rc int32 = SQLITE_OK
 159401 
 159402 	if Xsqlite3Config.FisInit != 0 {
 159403 		return Xsqlite3MisuseError(tls, 174426)
 159404 	}
 159405 
 159406 	ap = va
 159407 	switch op {
 159408 	case SQLITE_CONFIG_SINGLETHREAD:
 159409 		{
 159410 			Xsqlite3Config.FbCoreMutex = U8(0)
 159411 			Xsqlite3Config.FbFullMutex = U8(0)
 159412 			break
 159413 
 159414 		}
 159415 	case SQLITE_CONFIG_MULTITHREAD:
 159416 		{
 159417 			Xsqlite3Config.FbCoreMutex = U8(1)
 159418 			Xsqlite3Config.FbFullMutex = U8(0)
 159419 			break
 159420 
 159421 		}
 159422 	case SQLITE_CONFIG_SERIALIZED:
 159423 		{
 159424 			Xsqlite3Config.FbCoreMutex = U8(1)
 159425 			Xsqlite3Config.FbFullMutex = U8(1)
 159426 			break
 159427 
 159428 		}
 159429 	case SQLITE_CONFIG_MUTEX:
 159430 		{
 159431 			Xsqlite3Config.Fmutex = *(*Sqlite3_mutex_methods)(unsafe.Pointer(libc.VaUintptr(&ap)))
 159432 			break
 159433 
 159434 		}
 159435 	case SQLITE_CONFIG_GETMUTEX:
 159436 		{
 159437 			*(*Sqlite3_mutex_methods)(unsafe.Pointer(libc.VaUintptr(&ap))) = Xsqlite3Config.Fmutex
 159438 			break
 159439 
 159440 		}
 159441 
 159442 	case SQLITE_CONFIG_MALLOC:
 159443 		{
 159444 			Xsqlite3Config.Fm = *(*Sqlite3_mem_methods)(unsafe.Pointer(libc.VaUintptr(&ap)))
 159445 			break
 159446 
 159447 		}
 159448 	case SQLITE_CONFIG_GETMALLOC:
 159449 		{
 159450 			if Xsqlite3Config.Fm.FxMalloc == uintptr(0) {
 159451 				Xsqlite3MemSetDefault(tls)
 159452 			}
 159453 			*(*Sqlite3_mem_methods)(unsafe.Pointer(libc.VaUintptr(&ap))) = Xsqlite3Config.Fm
 159454 			break
 159455 
 159456 		}
 159457 	case SQLITE_CONFIG_MEMSTATUS:
 159458 		{
 159459 			Xsqlite3Config.FbMemstat = libc.VaInt32(&ap)
 159460 			break
 159461 
 159462 		}
 159463 	case SQLITE_CONFIG_SMALL_MALLOC:
 159464 		{
 159465 			Xsqlite3Config.FbSmallMalloc = U8(libc.VaInt32(&ap))
 159466 			break
 159467 
 159468 		}
 159469 	case SQLITE_CONFIG_PAGECACHE:
 159470 		{
 159471 			Xsqlite3Config.FpPage = libc.VaUintptr(&ap)
 159472 			Xsqlite3Config.FszPage = libc.VaInt32(&ap)
 159473 			Xsqlite3Config.FnPage = libc.VaInt32(&ap)
 159474 			break
 159475 
 159476 		}
 159477 	case SQLITE_CONFIG_PCACHE_HDRSZ:
 159478 		{
 159479 			*(*int32)(unsafe.Pointer(libc.VaUintptr(&ap))) = Xsqlite3HeaderSizeBtree(tls) + Xsqlite3HeaderSizePcache(tls) + Xsqlite3HeaderSizePcache1(tls)
 159480 			break
 159481 
 159482 		}
 159483 
 159484 	case SQLITE_CONFIG_PCACHE:
 159485 		{
 159486 			break
 159487 
 159488 		}
 159489 	case SQLITE_CONFIG_GETPCACHE:
 159490 		{
 159491 			rc = SQLITE_ERROR
 159492 			break
 159493 
 159494 		}
 159495 
 159496 	case SQLITE_CONFIG_PCACHE2:
 159497 		{
 159498 			Xsqlite3Config.Fpcache2 = *(*Sqlite3_pcache_methods2)(unsafe.Pointer(libc.VaUintptr(&ap)))
 159499 			break
 159500 
 159501 		}
 159502 	case SQLITE_CONFIG_GETPCACHE2:
 159503 		{
 159504 			if Xsqlite3Config.Fpcache2.FxInit == uintptr(0) {
 159505 				Xsqlite3PCacheSetDefault(tls)
 159506 			}
 159507 			*(*Sqlite3_pcache_methods2)(unsafe.Pointer(libc.VaUintptr(&ap))) = Xsqlite3Config.Fpcache2
 159508 			break
 159509 
 159510 		}
 159511 
 159512 	case SQLITE_CONFIG_LOOKASIDE:
 159513 		{
 159514 			Xsqlite3Config.FszLookaside = libc.VaInt32(&ap)
 159515 			Xsqlite3Config.FnLookaside = libc.VaInt32(&ap)
 159516 			break
 159517 
 159518 		}
 159519 
 159520 	case SQLITE_CONFIG_LOG:
 159521 		{
 159522 			Xsqlite3Config.FxLog = libc.VaUintptr(&ap)
 159523 			Xsqlite3Config.FpLogArg = libc.VaUintptr(&ap)
 159524 			break
 159525 
 159526 		}
 159527 
 159528 	case SQLITE_CONFIG_URI:
 159529 		{
 159530 			Xsqlite3Config.FbOpenUri = U8(libc.VaInt32(&ap))
 159531 			break
 159532 
 159533 		}
 159534 
 159535 	case SQLITE_CONFIG_COVERING_INDEX_SCAN:
 159536 		{
 159537 			Xsqlite3Config.FbUseCis = U8(libc.VaInt32(&ap))
 159538 			break
 159539 
 159540 		}
 159541 
 159542 	case SQLITE_CONFIG_MMAP_SIZE:
 159543 		{
 159544 			var szMmap Sqlite3_int64 = libc.VaInt64(&ap)
 159545 			var mxMmap Sqlite3_int64 = libc.VaInt64(&ap)
 159546 
 159547 			if mxMmap < int64(0) || mxMmap > int64(SQLITE_MAX_MMAP_SIZE) {
 159548 				mxMmap = int64(SQLITE_MAX_MMAP_SIZE)
 159549 			}
 159550 			if szMmap < int64(0) {
 159551 				szMmap = int64(SQLITE_DEFAULT_MMAP_SIZE)
 159552 			}
 159553 			if szMmap > mxMmap {
 159554 				szMmap = mxMmap
 159555 			}
 159556 			Xsqlite3Config.FmxMmap = mxMmap
 159557 			Xsqlite3Config.FszMmap = szMmap
 159558 			break
 159559 
 159560 		}
 159561 
 159562 	case SQLITE_CONFIG_PMASZ:
 159563 		{
 159564 			Xsqlite3Config.FszPma = libc.VaUint32(&ap)
 159565 			break
 159566 
 159567 		}
 159568 
 159569 	case SQLITE_CONFIG_STMTJRNL_SPILL:
 159570 		{
 159571 			Xsqlite3Config.FnStmtSpill = libc.VaInt32(&ap)
 159572 			break
 159573 
 159574 		}
 159575 
 159576 	case SQLITE_CONFIG_MEMDB_MAXSIZE:
 159577 		{
 159578 			Xsqlite3Config.FmxMemdbSize = libc.VaInt64(&ap)
 159579 			break
 159580 
 159581 		}
 159582 
 159583 	default:
 159584 		{
 159585 			rc = SQLITE_ERROR
 159586 			break
 159587 
 159588 		}
 159589 	}
 159590 	_ = ap
 159591 	return rc
 159592 }
 159593 
 159594 func setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32) int32 {
 159595 	var pStart uintptr
 159596 	var szAlloc Sqlite3_int64 = Sqlite3_int64(sz) * Sqlite3_int64(cnt)
 159597 	var nBig int32
 159598 	var nSm int32
 159599 
 159600 	if Xsqlite3LookasideUsed(tls, db, uintptr(0)) > 0 {
 159601 		return SQLITE_BUSY
 159602 	}
 159603 
 159604 	if (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbMalloced != 0 {
 159605 		Xsqlite3_free(tls, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart)
 159606 	}
 159607 
 159608 	sz = sz & libc.CplInt32(7)
 159609 	if sz <= int32(unsafe.Sizeof(uintptr(0))) {
 159610 		sz = 0
 159611 	}
 159612 	if cnt < 0 {
 159613 		cnt = 0
 159614 	}
 159615 	if sz == 0 || cnt == 0 {
 159616 		sz = 0
 159617 		pStart = uintptr(0)
 159618 	} else if pBuf == uintptr(0) {
 159619 		Xsqlite3BeginBenignMalloc(tls)
 159620 		pStart = Xsqlite3Malloc(tls, uint64(szAlloc))
 159621 		Xsqlite3EndBenignMalloc(tls)
 159622 		if pStart != 0 {
 159623 			szAlloc = Sqlite3_int64(Xsqlite3MallocSize(tls, pStart))
 159624 		}
 159625 	} else {
 159626 		pStart = pBuf
 159627 	}
 159628 	if sz >= LOOKASIDE_SMALL*3 {
 159629 		nBig = int32(szAlloc / Sqlite3_int64(3*LOOKASIDE_SMALL+sz))
 159630 		nSm = int32((szAlloc - Sqlite3_int64(sz*nBig)) / int64(LOOKASIDE_SMALL))
 159631 	} else if sz >= LOOKASIDE_SMALL*2 {
 159632 		nBig = int32(szAlloc / Sqlite3_int64(LOOKASIDE_SMALL+sz))
 159633 		nSm = int32((szAlloc - Sqlite3_int64(sz*nBig)) / int64(LOOKASIDE_SMALL))
 159634 	} else if sz > 0 {
 159635 		nBig = int32(szAlloc / Sqlite3_int64(sz))
 159636 		nSm = 0
 159637 	} else {
 159638 		nBig = libc.AssignInt32(&nSm, 0)
 159639 	}
 159640 	(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart = pStart
 159641 	(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit = uintptr(0)
 159642 	(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree = uintptr(0)
 159643 	(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(sz)
 159644 	(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue = U16(sz)
 159645 	if pStart != 0 {
 159646 		var i int32
 159647 		var p uintptr
 159648 
 159649 		p = pStart
 159650 		for i = 0; i < nBig; i++ {
 159651 			(*LookasideSlot)(unsafe.Pointer(p)).FpNext = (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit
 159652 			(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit = p
 159653 			p = p + uintptr(sz)
 159654 		}
 159655 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit = uintptr(0)
 159656 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree = uintptr(0)
 159657 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle = p
 159658 		for i = 0; i < nSm; i++ {
 159659 			(*LookasideSlot)(unsafe.Pointer(p)).FpNext = (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit
 159660 			(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit = p
 159661 			p = p + 128
 159662 		}
 159663 
 159664 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = p
 159665 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable = U32(0)
 159666 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbMalloced = func() uint8 {
 159667 			if pBuf == uintptr(0) {
 159668 				return uint8(1)
 159669 			}
 159670 			return uint8(0)
 159671 		}()
 159672 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FnSlot = U32(nBig + nSm)
 159673 	} else {
 159674 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart = uintptr(0)
 159675 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit = uintptr(0)
 159676 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree = uintptr(0)
 159677 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle = uintptr(0)
 159678 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = uintptr(0)
 159679 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable = U32(1)
 159680 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0)
 159681 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbMalloced = U8(0)
 159682 		(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FnSlot = U32(0)
 159683 	}
 159684 	(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd = (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd
 159685 
 159686 	return SQLITE_OK
 159687 }
 159688 
 159689 // Return the mutex associated with a database connection.
 159690 func Xsqlite3_db_mutex(tls *libc.TLS, db uintptr) uintptr {
 159691 	return (*Sqlite3)(unsafe.Pointer(db)).Fmutex
 159692 }
 159693 
 159694 // Free up as much memory as we can from the given database
 159695 // connection.
 159696 func Xsqlite3_db_release_memory(tls *libc.TLS, db uintptr) int32 {
 159697 	var i int32
 159698 
 159699 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 159700 	Xsqlite3BtreeEnterAll(tls, db)
 159701 	for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
 159702 		var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt
 159703 		if pBt != 0 {
 159704 			var pPager uintptr = Xsqlite3BtreePager(tls, pBt)
 159705 			Xsqlite3PagerShrink(tls, pPager)
 159706 		}
 159707 	}
 159708 	Xsqlite3BtreeLeaveAll(tls, db)
 159709 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 159710 	return SQLITE_OK
 159711 }
 159712 
 159713 // Flush any dirty pages in the pager-cache for any attached database
 159714 // to disk.
 159715 func Xsqlite3_db_cacheflush(tls *libc.TLS, db uintptr) int32 {
 159716 	var i int32
 159717 	var rc int32 = SQLITE_OK
 159718 	var bSeenBusy int32 = 0
 159719 
 159720 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 159721 	Xsqlite3BtreeEnterAll(tls, db)
 159722 	for i = 0; rc == SQLITE_OK && i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
 159723 		var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt
 159724 		if pBt != 0 && Xsqlite3BtreeTxnState(tls, pBt) == SQLITE_TXN_WRITE {
 159725 			var pPager uintptr = Xsqlite3BtreePager(tls, pBt)
 159726 			rc = Xsqlite3PagerFlush(tls, pPager)
 159727 			if rc == SQLITE_BUSY {
 159728 				bSeenBusy = 1
 159729 				rc = SQLITE_OK
 159730 			}
 159731 		}
 159732 	}
 159733 	Xsqlite3BtreeLeaveAll(tls, db)
 159734 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 159735 	return func() int32 {
 159736 		if rc == SQLITE_OK && bSeenBusy != 0 {
 159737 			return SQLITE_BUSY
 159738 		}
 159739 		return rc
 159740 	}()
 159741 }
 159742 
 159743 // Configuration settings for an individual database connection
 159744 func Xsqlite3_db_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32 {
 159745 	var ap Va_list
 159746 	_ = ap
 159747 	var rc int32
 159748 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 159749 	ap = va
 159750 	switch op {
 159751 	case SQLITE_DBCONFIG_MAINDBNAME:
 159752 		{
 159753 			(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FzDbSName = libc.VaUintptr(&ap)
 159754 			rc = SQLITE_OK
 159755 			break
 159756 
 159757 		}
 159758 	case SQLITE_DBCONFIG_LOOKASIDE:
 159759 		{
 159760 			var pBuf uintptr = libc.VaUintptr(&ap)
 159761 			var sz int32 = libc.VaInt32(&ap)
 159762 			var cnt int32 = libc.VaInt32(&ap)
 159763 			rc = setupLookaside(tls, db, pBuf, sz, cnt)
 159764 			break
 159765 
 159766 		}
 159767 	default:
 159768 		{
 159769 			var i uint32
 159770 			rc = SQLITE_ERROR
 159771 			for i = uint32(0); i < uint32(int32(uint64(unsafe.Sizeof(aFlagOp))/uint64(unsafe.Sizeof(struct {
 159772 				Fop   int32
 159773 				Fmask U32
 159774 			}{})))); i++ {
 159775 				if aFlagOp[i].Fop == op {
 159776 					var onoff int32 = libc.VaInt32(&ap)
 159777 					var pRes uintptr = libc.VaUintptr(&ap)
 159778 					var oldFlags U64 = (*Sqlite3)(unsafe.Pointer(db)).Fflags
 159779 					if onoff > 0 {
 159780 						*(*U64)(unsafe.Pointer(db + 48)) |= U64(aFlagOp[i].Fmask)
 159781 					} else if onoff == 0 {
 159782 						*(*U64)(unsafe.Pointer(db + 48)) &= ^U64(aFlagOp[i].Fmask)
 159783 					}
 159784 					if oldFlags != (*Sqlite3)(unsafe.Pointer(db)).Fflags {
 159785 						Xsqlite3ExpirePreparedStatements(tls, db, 0)
 159786 					}
 159787 					if pRes != 0 {
 159788 						*(*int32)(unsafe.Pointer(pRes)) = libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).Fflags&U64(aFlagOp[i].Fmask) != uint64(0))
 159789 					}
 159790 					rc = SQLITE_OK
 159791 					break
 159792 				}
 159793 			}
 159794 			break
 159795 
 159796 		}
 159797 	}
 159798 	_ = ap
 159799 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 159800 	return rc
 159801 }
 159802 
 159803 var aFlagOp = [16]struct {
 159804 	Fop   int32
 159805 	Fmask U32
 159806 }{
 159807 	{Fop: SQLITE_DBCONFIG_ENABLE_FKEY, Fmask: U32(SQLITE_ForeignKeys)},
 159808 	{Fop: SQLITE_DBCONFIG_ENABLE_TRIGGER, Fmask: U32(SQLITE_EnableTrigger)},
 159809 	{Fop: SQLITE_DBCONFIG_ENABLE_VIEW, Fmask: SQLITE_EnableView},
 159810 	{Fop: SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, Fmask: U32(SQLITE_Fts3Tokenizer)},
 159811 	{Fop: SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, Fmask: U32(SQLITE_LoadExtension)},
 159812 	{Fop: SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE, Fmask: U32(SQLITE_NoCkptOnClose)},
 159813 	{Fop: SQLITE_DBCONFIG_ENABLE_QPSG, Fmask: U32(SQLITE_EnableQPSG)},
 159814 	{Fop: SQLITE_DBCONFIG_TRIGGER_EQP, Fmask: U32(SQLITE_TriggerEQP)},
 159815 	{Fop: SQLITE_DBCONFIG_RESET_DATABASE, Fmask: U32(SQLITE_ResetDatabase)},
 159816 	{Fop: SQLITE_DBCONFIG_DEFENSIVE, Fmask: U32(SQLITE_Defensive)},
 159817 	{Fop: SQLITE_DBCONFIG_WRITABLE_SCHEMA, Fmask: U32(SQLITE_WriteSchema | SQLITE_NoSchemaError)},
 159818 	{Fop: SQLITE_DBCONFIG_LEGACY_ALTER_TABLE, Fmask: U32(SQLITE_LegacyAlter)},
 159819 	{Fop: SQLITE_DBCONFIG_DQS_DDL, Fmask: U32(SQLITE_DqsDDL)},
 159820 	{Fop: SQLITE_DBCONFIG_DQS_DML, Fmask: U32(SQLITE_DqsDML)},
 159821 	{Fop: SQLITE_DBCONFIG_LEGACY_FILE_FORMAT, Fmask: U32(SQLITE_LegacyFileFmt)},
 159822 	{Fop: SQLITE_DBCONFIG_TRUSTED_SCHEMA, Fmask: U32(SQLITE_TrustedSchema)},
 159823 }
 159824 
 159825 func binCollFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 {
 159826 	var rc int32
 159827 	var n int32
 159828 	_ = NotUsed
 159829 	if nKey1 < nKey2 {
 159830 		n = nKey1
 159831 	} else {
 159832 		n = nKey2
 159833 	}
 159834 
 159835 	rc = libc.Xmemcmp(tls, pKey1, pKey2, uint64(n))
 159836 	if rc == 0 {
 159837 		rc = nKey1 - nKey2
 159838 	}
 159839 	return rc
 159840 }
 159841 
 159842 func rtrimCollFunc(tls *libc.TLS, pUser uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 {
 159843 	var pK1 uintptr = pKey1
 159844 	var pK2 uintptr = pKey2
 159845 	for nKey1 != 0 && int32(*(*U8)(unsafe.Pointer(pK1 + uintptr(nKey1-1)))) == ' ' {
 159846 		nKey1--
 159847 	}
 159848 	for nKey2 != 0 && int32(*(*U8)(unsafe.Pointer(pK2 + uintptr(nKey2-1)))) == ' ' {
 159849 		nKey2--
 159850 	}
 159851 	return binCollFunc(tls, pUser, nKey1, pKey1, nKey2, pKey2)
 159852 }
 159853 
 159854 // Return true if CollSeq is the default built-in BINARY.
 159855 func Xsqlite3IsBinary(tls *libc.TLS, p uintptr) int32 {
 159856 	return libc.Bool32(p == uintptr(0) || (*CollSeq)(unsafe.Pointer(p)).FxCmp == *(*uintptr)(unsafe.Pointer(&struct {
 159857 		f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
 159858 	}{binCollFunc})))
 159859 }
 159860 
 159861 func nocaseCollatingFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 {
 159862 	var r int32 = Xsqlite3_strnicmp(tls,
 159863 		pKey1, pKey2, func() int32 {
 159864 			if nKey1 < nKey2 {
 159865 				return nKey1
 159866 			}
 159867 			return nKey2
 159868 		}())
 159869 	_ = NotUsed
 159870 	if 0 == r {
 159871 		r = nKey1 - nKey2
 159872 	}
 159873 	return r
 159874 }
 159875 
 159876 // Return the ROWID of the most recent insert
 159877 func Xsqlite3_last_insert_rowid(tls *libc.TLS, db uintptr) Sqlite_int64 {
 159878 	return (*Sqlite3)(unsafe.Pointer(db)).FlastRowid
 159879 }
 159880 
 159881 // Set the value returned by the sqlite3_last_insert_rowid() API function.
 159882 func Xsqlite3_set_last_insert_rowid(tls *libc.TLS, db uintptr, iRowid Sqlite3_int64) {
 159883 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 159884 	(*Sqlite3)(unsafe.Pointer(db)).FlastRowid = iRowid
 159885 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 159886 }
 159887 
 159888 // Return the number of changes in the most recent call to sqlite3_exec().
 159889 func Xsqlite3_changes64(tls *libc.TLS, db uintptr) Sqlite3_int64 {
 159890 	return (*Sqlite3)(unsafe.Pointer(db)).FnChange
 159891 }
 159892 
 159893 func Xsqlite3_changes(tls *libc.TLS, db uintptr) int32 {
 159894 	return int32(Xsqlite3_changes64(tls, db))
 159895 }
 159896 
 159897 // Return the number of changes since the database handle was opened.
 159898 func Xsqlite3_total_changes64(tls *libc.TLS, db uintptr) Sqlite3_int64 {
 159899 	return (*Sqlite3)(unsafe.Pointer(db)).FnTotalChange
 159900 }
 159901 
 159902 func Xsqlite3_total_changes(tls *libc.TLS, db uintptr) int32 {
 159903 	return int32(Xsqlite3_total_changes64(tls, db))
 159904 }
 159905 
 159906 // Close all open savepoints. This function only manipulates fields of the
 159907 // database handle object, it does not close any savepoints that may be open
 159908 // at the b-tree/pager level.
 159909 func Xsqlite3CloseSavepoints(tls *libc.TLS, db uintptr) {
 159910 	for (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint != 0 {
 159911 		var pTmp uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint
 159912 		(*Sqlite3)(unsafe.Pointer(db)).FpSavepoint = (*Savepoint)(unsafe.Pointer(pTmp)).FpNext
 159913 		Xsqlite3DbFree(tls, db, pTmp)
 159914 	}
 159915 	(*Sqlite3)(unsafe.Pointer(db)).FnSavepoint = 0
 159916 	(*Sqlite3)(unsafe.Pointer(db)).FnStatement = 0
 159917 	(*Sqlite3)(unsafe.Pointer(db)).FisTransactionSavepoint = U8(0)
 159918 }
 159919 
 159920 func functionDestroy(tls *libc.TLS, db uintptr, p uintptr) {
 159921 	var pDestructor uintptr
 159922 
 159923 	pDestructor = *(*uintptr)(unsafe.Pointer(p + 64))
 159924 	if pDestructor != 0 {
 159925 		(*FuncDestructor)(unsafe.Pointer(pDestructor)).FnRef--
 159926 		if (*FuncDestructor)(unsafe.Pointer(pDestructor)).FnRef == 0 {
 159927 			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*FuncDestructor)(unsafe.Pointer(pDestructor)).FxDestroy})).f(tls, (*FuncDestructor)(unsafe.Pointer(pDestructor)).FpUserData)
 159928 			Xsqlite3DbFree(tls, db, pDestructor)
 159929 		}
 159930 	}
 159931 }
 159932 
 159933 func disconnectAllVtab(tls *libc.TLS, db uintptr) {
 159934 	var i int32
 159935 	var p uintptr
 159936 	Xsqlite3BtreeEnterAll(tls, db)
 159937 	for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
 159938 		var pSchema uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpSchema
 159939 		if pSchema != 0 {
 159940 			for p = (*Hash)(unsafe.Pointer(pSchema + 8)).Ffirst; p != 0; p = (*HashElem)(unsafe.Pointer(p)).Fnext {
 159941 				var pTab uintptr = (*HashElem)(unsafe.Pointer(p)).Fdata
 159942 				if int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VTAB {
 159943 					Xsqlite3VtabDisconnect(tls, db, pTab)
 159944 				}
 159945 			}
 159946 		}
 159947 	}
 159948 	for p = (*Hash)(unsafe.Pointer(db + 576)).Ffirst; p != 0; p = (*HashElem)(unsafe.Pointer(p)).Fnext {
 159949 		var pMod uintptr = (*HashElem)(unsafe.Pointer(p)).Fdata
 159950 		if (*Module)(unsafe.Pointer(pMod)).FpEpoTab != 0 {
 159951 			Xsqlite3VtabDisconnect(tls, db, (*Module)(unsafe.Pointer(pMod)).FpEpoTab)
 159952 		}
 159953 	}
 159954 	Xsqlite3VtabUnlockList(tls, db)
 159955 	Xsqlite3BtreeLeaveAll(tls, db)
 159956 }
 159957 
 159958 func connectionIsBusy(tls *libc.TLS, db uintptr) int32 {
 159959 	var j int32
 159960 
 159961 	if (*Sqlite3)(unsafe.Pointer(db)).FpVdbe != 0 {
 159962 		return 1
 159963 	}
 159964 	for j = 0; j < (*Sqlite3)(unsafe.Pointer(db)).FnDb; j++ {
 159965 		var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*32)).FpBt
 159966 		if pBt != 0 && Xsqlite3BtreeIsInBackup(tls, pBt) != 0 {
 159967 			return 1
 159968 		}
 159969 	}
 159970 	return 0
 159971 }
 159972 
 159973 func sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) int32 {
 159974 	if !(db != 0) {
 159975 		return SQLITE_OK
 159976 	}
 159977 	if !(Xsqlite3SafetyCheckSickOrOk(tls, db) != 0) {
 159978 		return Xsqlite3MisuseError(tls, 175200)
 159979 	}
 159980 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 159981 	if int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace)&SQLITE_TRACE_CLOSE != 0 {
 159982 		(*struct {
 159983 			f func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32
 159984 		})(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(db + 248))})).f(tls, uint32(SQLITE_TRACE_CLOSE), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, db, uintptr(0))
 159985 	}
 159986 
 159987 	disconnectAllVtab(tls, db)
 159988 
 159989 	Xsqlite3VtabRollback(tls, db)
 159990 
 159991 	if !(forceZombie != 0) && connectionIsBusy(tls, db) != 0 {
 159992 		Xsqlite3ErrorWithMsg(tls, db, SQLITE_BUSY,
 159993 			ts+24795, 0)
 159994 		Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 159995 		return SQLITE_BUSY
 159996 	}
 159997 
 159998 	(*Sqlite3)(unsafe.Pointer(db)).FeOpenState = U8(SQLITE_STATE_ZOMBIE)
 159999 	Xsqlite3LeaveMutexAndCloseZombie(tls, db)
 160000 	return SQLITE_OK
 160001 }
 160002 
 160003 // Return the transaction state for a single databse, or the maximum
 160004 // transaction state over all attached databases if zSchema is null.
 160005 func Xsqlite3_txn_state(tls *libc.TLS, db uintptr, zSchema uintptr) int32 {
 160006 	var iDb int32
 160007 	var nDb int32
 160008 	var iTxn int32 = -1
 160009 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160010 	if zSchema != 0 {
 160011 		nDb = libc.AssignInt32(&iDb, Xsqlite3FindDbName(tls, db, zSchema))
 160012 		if iDb < 0 {
 160013 			nDb--
 160014 		}
 160015 	} else {
 160016 		iDb = 0
 160017 		nDb = (*Sqlite3)(unsafe.Pointer(db)).FnDb - 1
 160018 	}
 160019 	for ; iDb <= nDb; iDb++ {
 160020 		var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpBt
 160021 		var x int32
 160022 		if pBt != uintptr(0) {
 160023 			x = Xsqlite3BtreeTxnState(tls, pBt)
 160024 		} else {
 160025 			x = SQLITE_TXN_NONE
 160026 		}
 160027 		if x > iTxn {
 160028 			iTxn = x
 160029 		}
 160030 	}
 160031 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160032 	return iTxn
 160033 }
 160034 
 160035 // Two variations on the public interface for closing a database
 160036 // connection. The sqlite3_close() version returns SQLITE_BUSY and
 160037 // leaves the connection open if there are unfinalized prepared
 160038 // statements or unfinished sqlite3_backups.  The sqlite3_close_v2()
 160039 // version forces the connection to become a zombie if there are
 160040 // unclosed resources, and arranges for deallocation when the last
 160041 // prepare statement or sqlite3_backup closes.
 160042 func Xsqlite3_close(tls *libc.TLS, db uintptr) int32 {
 160043 	return sqlite3Close(tls, db, 0)
 160044 }
 160045 
 160046 func Xsqlite3_close_v2(tls *libc.TLS, db uintptr) int32 {
 160047 	return sqlite3Close(tls, db, 1)
 160048 }
 160049 
 160050 // Close the mutex on database connection db.
 160051 //
 160052 // Furthermore, if database connection db is a zombie (meaning that there
 160053 // has been a prior call to sqlite3_close(db) or sqlite3_close_v2(db)) and
 160054 // every sqlite3_stmt has now been finalized and every sqlite3_backup has
 160055 // finished, then free all resources.
 160056 func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) {
 160057 	var i uintptr
 160058 	var j int32
 160059 
 160060 	if int32((*Sqlite3)(unsafe.Pointer(db)).FeOpenState) != SQLITE_STATE_ZOMBIE || connectionIsBusy(tls, db) != 0 {
 160061 		Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160062 		return
 160063 	}
 160064 
 160065 	Xsqlite3RollbackAll(tls, db, SQLITE_OK)
 160066 
 160067 	Xsqlite3CloseSavepoints(tls, db)
 160068 
 160069 	for j = 0; j < (*Sqlite3)(unsafe.Pointer(db)).FnDb; j++ {
 160070 		var pDb uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*32
 160071 		if (*Db1)(unsafe.Pointer(pDb)).FpBt != 0 {
 160072 			Xsqlite3BtreeClose(tls, (*Db1)(unsafe.Pointer(pDb)).FpBt)
 160073 			(*Db1)(unsafe.Pointer(pDb)).FpBt = uintptr(0)
 160074 			if j != 1 {
 160075 				(*Db1)(unsafe.Pointer(pDb)).FpSchema = uintptr(0)
 160076 			}
 160077 		}
 160078 	}
 160079 
 160080 	if (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema != 0 {
 160081 		Xsqlite3SchemaClear(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema)
 160082 	}
 160083 	Xsqlite3VtabUnlockList(tls, db)
 160084 
 160085 	Xsqlite3CollapseDatabaseArray(tls, db)
 160086 
 160087 	Xsqlite3ConnectionClosed(tls, db)
 160088 
 160089 	for i = (*Hash)(unsafe.Pointer(db + 624)).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
 160090 		var pNext uintptr
 160091 		var p uintptr
 160092 		p = (*HashElem)(unsafe.Pointer(i)).Fdata
 160093 		for __ccgo := true; __ccgo; __ccgo = p != 0 {
 160094 			functionDestroy(tls, db, p)
 160095 			pNext = (*FuncDef)(unsafe.Pointer(p)).FpNext
 160096 			Xsqlite3DbFree(tls, db, p)
 160097 			p = pNext
 160098 		}
 160099 	}
 160100 	Xsqlite3HashClear(tls, db+624)
 160101 	for i = (*Hash)(unsafe.Pointer(db + 648)).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
 160102 		var pColl uintptr = (*HashElem)(unsafe.Pointer(i)).Fdata
 160103 
 160104 		for j = 0; j < 3; j++ {
 160105 			if (*CollSeq)(unsafe.Pointer(pColl+uintptr(j)*40)).FxDel != 0 {
 160106 				(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*CollSeq)(unsafe.Pointer(pColl + uintptr(j)*40)).FxDel})).f(tls, (*CollSeq)(unsafe.Pointer(pColl+uintptr(j)*40)).FpUser)
 160107 			}
 160108 		}
 160109 		Xsqlite3DbFree(tls, db, pColl)
 160110 	}
 160111 	Xsqlite3HashClear(tls, db+648)
 160112 	for i = (*Hash)(unsafe.Pointer(db + 576)).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
 160113 		var pMod uintptr = (*HashElem)(unsafe.Pointer(i)).Fdata
 160114 		Xsqlite3VtabEponymousTableClear(tls, db, pMod)
 160115 		Xsqlite3VtabModuleUnref(tls, db, pMod)
 160116 	}
 160117 	Xsqlite3HashClear(tls, db+576)
 160118 
 160119 	Xsqlite3Error(tls, db, SQLITE_OK)
 160120 	Xsqlite3ValueFree(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr)
 160121 	Xsqlite3CloseExtensions(tls, db)
 160122 
 160123 	(*Sqlite3)(unsafe.Pointer(db)).FeOpenState = U8(SQLITE_STATE_ERROR)
 160124 
 160125 	Xsqlite3DbFree(tls, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema)
 160126 	if (*Sqlite3)(unsafe.Pointer(db)).FxAutovacDestr != 0 {
 160127 		(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxAutovacDestr})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg)
 160128 	}
 160129 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160130 	(*Sqlite3)(unsafe.Pointer(db)).FeOpenState = U8(SQLITE_STATE_CLOSED)
 160131 	Xsqlite3_mutex_free(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160132 
 160133 	if (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbMalloced != 0 {
 160134 		Xsqlite3_free(tls, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart)
 160135 	}
 160136 	Xsqlite3_free(tls, db)
 160137 }
 160138 
 160139 // Rollback all database files.  If tripCode is not SQLITE_OK, then
 160140 // any write cursors are invalidated ("tripped" - as in "tripping a circuit
 160141 // breaker") and made to return tripCode if there are any further
 160142 // attempts to use that cursor.  Read cursors remain open and valid
 160143 // but are "saved" in case the table pages are moved around.
 160144 func Xsqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) {
 160145 	var i int32
 160146 	var inTrans int32 = 0
 160147 	var schemaChange int32
 160148 
 160149 	Xsqlite3BeginBenignMalloc(tls)
 160150 
 160151 	Xsqlite3BtreeEnterAll(tls, db)
 160152 	schemaChange = libc.Bool32((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags&U32(DBFLAG_SchemaChange) != U32(0) && int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0)
 160153 
 160154 	for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
 160155 		var p uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt
 160156 		if p != 0 {
 160157 			if Xsqlite3BtreeTxnState(tls, p) == SQLITE_TXN_WRITE {
 160158 				inTrans = 1
 160159 			}
 160160 			Xsqlite3BtreeRollback(tls, p, tripCode, libc.BoolInt32(!(schemaChange != 0)))
 160161 		}
 160162 	}
 160163 	Xsqlite3VtabRollback(tls, db)
 160164 	Xsqlite3EndBenignMalloc(tls)
 160165 
 160166 	if schemaChange != 0 {
 160167 		Xsqlite3ExpirePreparedStatements(tls, db, 0)
 160168 		Xsqlite3ResetAllSchemasOfConnection(tls, db)
 160169 	}
 160170 	Xsqlite3BtreeLeaveAll(tls, db)
 160171 
 160172 	(*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons = int64(0)
 160173 	(*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = int64(0)
 160174 	*(*U64)(unsafe.Pointer(db + 48)) &= libc.CplUint64(uint64(SQLITE_DeferFKs) | uint64(0x00002)<<32)
 160175 
 160176 	if (*Sqlite3)(unsafe.Pointer(db)).FxRollbackCallback != 0 && (inTrans != 0 || !(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0)) {
 160177 		(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxRollbackCallback})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpRollbackArg)
 160178 	}
 160179 }
 160180 
 160181 // Return a static string that describes the kind of error specified in the
 160182 // argument.
 160183 func Xsqlite3ErrStr(tls *libc.TLS, rc int32) uintptr {
 160184 	var zErr uintptr = ts + 24863
 160185 	switch rc {
 160186 	case SQLITE_ABORT | int32(2)<<8:
 160187 		{
 160188 			zErr = ts + 24877
 160189 			break
 160190 
 160191 		}
 160192 	case SQLITE_ROW:
 160193 		{
 160194 			zErr = ts + 24899
 160195 			break
 160196 
 160197 		}
 160198 	case SQLITE_DONE:
 160199 		{
 160200 			zErr = ts + 24921
 160201 			break
 160202 
 160203 		}
 160204 	default:
 160205 		{
 160206 			rc = rc & 0xff
 160207 			if rc >= 0 && rc < int32(uint64(unsafe.Sizeof(aMsg))/uint64(unsafe.Sizeof(uintptr(0)))) && aMsg[rc] != uintptr(0) {
 160208 				zErr = aMsg[rc]
 160209 			}
 160210 			break
 160211 
 160212 		}
 160213 	}
 160214 	return zErr
 160215 }
 160216 
 160217 var aMsg = [29]uintptr{
 160218 	ts + 24944,
 160219 	ts + 24957,
 160220 	uintptr(0),
 160221 	ts + 24973,
 160222 	ts + 24998,
 160223 	ts + 25012,
 160224 	ts + 25031,
 160225 	ts + 1480,
 160226 	ts + 25056,
 160227 	ts + 25093,
 160228 	ts + 25105,
 160229 	ts + 25120,
 160230 	ts + 25153,
 160231 	ts + 25171,
 160232 	ts + 25196,
 160233 	ts + 25225,
 160234 	uintptr(0),
 160235 	ts + 7190,
 160236 	ts + 6686,
 160237 	ts + 25242,
 160238 	ts + 25260,
 160239 	ts + 25278,
 160240 	uintptr(0),
 160241 	ts + 25312,
 160242 	uintptr(0),
 160243 	ts + 25333,
 160244 	ts + 25359,
 160245 	ts + 25382,
 160246 	ts + 25403,
 160247 }
 160248 
 160249 func sqliteDefaultBusyCallback(tls *libc.TLS, ptr uintptr, count int32) int32 {
 160250 	var db uintptr = ptr
 160251 	var tmout int32 = (*Sqlite3)(unsafe.Pointer(db)).FbusyTimeout
 160252 	var delay int32
 160253 	var prior int32
 160254 
 160255 	if count < int32(uint64(unsafe.Sizeof(delays))/uint64(unsafe.Sizeof(U8(0)))) {
 160256 		delay = int32(delays[count])
 160257 		prior = int32(totals[count])
 160258 	} else {
 160259 		delay = int32(delays[int32(uint64(unsafe.Sizeof(delays))/uint64(unsafe.Sizeof(U8(0))))-1])
 160260 		prior = int32(totals[int32(uint64(unsafe.Sizeof(delays))/uint64(unsafe.Sizeof(U8(0))))-1]) + delay*(count-(int32(uint64(unsafe.Sizeof(delays))/uint64(unsafe.Sizeof(U8(0))))-1))
 160261 	}
 160262 	if prior+delay > tmout {
 160263 		delay = tmout - prior
 160264 		if delay <= 0 {
 160265 			return 0
 160266 		}
 160267 	}
 160268 	Xsqlite3OsSleep(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, delay*1000)
 160269 	return 1
 160270 }
 160271 
 160272 var delays = [12]U8{U8(1), U8(2), U8(5), U8(10), U8(15), U8(20), U8(25), U8(25), U8(25), U8(50), U8(50), U8(100)}
 160273 var totals = [12]U8{U8(0), U8(1), U8(3), U8(8), U8(18), U8(33), U8(53), U8(78), U8(103), U8(128), U8(178), U8(228)}
 160274 
 160275 // Invoke the given busy handler.
 160276 //
 160277 // This routine is called when an operation failed to acquire a
 160278 // lock on VFS file pFile.
 160279 //
 160280 // If this routine returns non-zero, the lock is retried.  If it
 160281 // returns 0, the operation aborts with an SQLITE_BUSY error.
 160282 func Xsqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) int32 {
 160283 	var rc int32
 160284 	if (*BusyHandler)(unsafe.Pointer(p)).FxBusyHandler == uintptr(0) || (*BusyHandler)(unsafe.Pointer(p)).FnBusy < 0 {
 160285 		return 0
 160286 	}
 160287 	rc = (*struct {
 160288 		f func(*libc.TLS, uintptr, int32) int32
 160289 	})(unsafe.Pointer(&struct{ uintptr }{(*BusyHandler)(unsafe.Pointer(p)).FxBusyHandler})).f(tls, (*BusyHandler)(unsafe.Pointer(p)).FpBusyArg, (*BusyHandler)(unsafe.Pointer(p)).FnBusy)
 160290 	if rc == 0 {
 160291 		(*BusyHandler)(unsafe.Pointer(p)).FnBusy = -1
 160292 	} else {
 160293 		(*BusyHandler)(unsafe.Pointer(p)).FnBusy++
 160294 	}
 160295 	return rc
 160296 }
 160297 
 160298 // This routine sets the busy callback for an Sqlite database to the
 160299 // given callback function with the given argument.
 160300 func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintptr) int32 {
 160301 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160302 	(*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = xBusy
 160303 	(*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FpBusyArg = pArg
 160304 	(*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0
 160305 	(*Sqlite3)(unsafe.Pointer(db)).FbusyTimeout = 0
 160306 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160307 	return SQLITE_OK
 160308 }
 160309 
 160310 // This routine sets the progress callback for an Sqlite database to the
 160311 // given callback function with the given argument. The progress callback will
 160312 // be invoked every nOps opcodes.
 160313 func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr) {
 160314 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160315 	if nOps > 0 {
 160316 		(*Sqlite3)(unsafe.Pointer(db)).FxProgress = xProgress
 160317 		(*Sqlite3)(unsafe.Pointer(db)).FnProgressOps = uint32(nOps)
 160318 		(*Sqlite3)(unsafe.Pointer(db)).FpProgressArg = pArg
 160319 	} else {
 160320 		(*Sqlite3)(unsafe.Pointer(db)).FxProgress = uintptr(0)
 160321 		(*Sqlite3)(unsafe.Pointer(db)).FnProgressOps = uint32(0)
 160322 		(*Sqlite3)(unsafe.Pointer(db)).FpProgressArg = uintptr(0)
 160323 	}
 160324 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160325 }
 160326 
 160327 // This routine installs a default busy handler that waits for the
 160328 // specified number of milliseconds before returning 0.
 160329 func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) int32 {
 160330 	if ms > 0 {
 160331 		Xsqlite3_busy_handler(tls, db, *(*uintptr)(unsafe.Pointer(&struct {
 160332 			f func(*libc.TLS, uintptr, int32) int32
 160333 		}{sqliteDefaultBusyCallback})),
 160334 			db)
 160335 		(*Sqlite3)(unsafe.Pointer(db)).FbusyTimeout = ms
 160336 	} else {
 160337 		Xsqlite3_busy_handler(tls, db, uintptr(0), uintptr(0))
 160338 	}
 160339 	return SQLITE_OK
 160340 }
 160341 
 160342 // Cause any pending operation to stop at its earliest opportunity.
 160343 func Xsqlite3_interrupt(tls *libc.TLS, db uintptr) {
 160344 	libc.AtomicStoreNInt32(db+432, int32(1), 0)
 160345 }
 160346 
 160347 // Return true or false depending on whether or not an interrupt is
 160348 // pending on connection db.
 160349 func Xsqlite3_is_interrupted(tls *libc.TLS, db uintptr) int32 {
 160350 	return libc.Bool32(libc.AtomicLoadNInt32(db+432, 0) != 0)
 160351 }
 160352 
 160353 // This function is exactly the same as sqlite3_create_function(), except
 160354 // that it is designed to be called by internal code. The difference is
 160355 // that if a malloc() fails in sqlite3_create_function(), an error code
 160356 // is returned and the mallocFailed flag cleared.
 160357 func Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) int32 {
 160358 	var p uintptr
 160359 	var extraFlags int32
 160360 
 160361 	if zFunctionName == uintptr(0) ||
 160362 		xSFunc != uintptr(0) && xFinal != uintptr(0) ||
 160363 		libc.Bool32(xFinal == uintptr(0)) != libc.Bool32(xStep == uintptr(0)) ||
 160364 		libc.Bool32(xValue == uintptr(0)) != libc.Bool32(xInverse == uintptr(0)) ||
 160365 		(nArg < -1 || nArg > SQLITE_MAX_FUNCTION_ARG) ||
 160366 		255 < Xsqlite3Strlen30(tls, zFunctionName) {
 160367 		return Xsqlite3MisuseError(tls, 175847)
 160368 	}
 160369 
 160370 	extraFlags = enc & (SQLITE_DETERMINISTIC | SQLITE_DIRECTONLY | SQLITE_SUBTYPE | SQLITE_INNOCUOUS)
 160371 	enc = enc & (SQLITE_FUNC_ENCMASK | SQLITE_ANY)
 160372 
 160373 	extraFlags = extraFlags ^ SQLITE_FUNC_UNSAFE
 160374 
 160375 	switch enc {
 160376 	case SQLITE_UTF16:
 160377 		enc = SQLITE_UTF16LE
 160378 		break
 160379 	case SQLITE_ANY:
 160380 		{
 160381 			var rc int32
 160382 			rc = Xsqlite3CreateFunc(tls, db, zFunctionName, nArg,
 160383 				SQLITE_UTF8|extraFlags^SQLITE_FUNC_UNSAFE,
 160384 				pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor)
 160385 			if rc == SQLITE_OK {
 160386 				rc = Xsqlite3CreateFunc(tls, db, zFunctionName, nArg,
 160387 					SQLITE_UTF16LE|extraFlags^SQLITE_FUNC_UNSAFE,
 160388 					pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor)
 160389 			}
 160390 			if rc != SQLITE_OK {
 160391 				return rc
 160392 			}
 160393 			enc = SQLITE_UTF16BE
 160394 			break
 160395 
 160396 		}
 160397 	case SQLITE_UTF8:
 160398 		fallthrough
 160399 	case SQLITE_UTF16LE:
 160400 		fallthrough
 160401 	case SQLITE_UTF16BE:
 160402 		break
 160403 	default:
 160404 		enc = SQLITE_UTF8
 160405 		break
 160406 	}
 160407 
 160408 	p = Xsqlite3FindFunction(tls, db, zFunctionName, nArg, U8(enc), uint8(0))
 160409 	if p != 0 && (*FuncDef)(unsafe.Pointer(p)).FfuncFlags&U32(SQLITE_FUNC_ENCMASK) == U32(enc) && int32((*FuncDef)(unsafe.Pointer(p)).FnArg) == nArg {
 160410 		if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 {
 160411 			Xsqlite3ErrorWithMsg(tls, db, SQLITE_BUSY,
 160412 				ts+25419, 0)
 160413 
 160414 			return SQLITE_BUSY
 160415 		} else {
 160416 			Xsqlite3ExpirePreparedStatements(tls, db, 0)
 160417 		}
 160418 	} else if xSFunc == uintptr(0) && xFinal == uintptr(0) {
 160419 		return SQLITE_OK
 160420 	}
 160421 
 160422 	p = Xsqlite3FindFunction(tls, db, zFunctionName, nArg, U8(enc), uint8(1))
 160423 
 160424 	if !(p != 0) {
 160425 		return SQLITE_NOMEM
 160426 	}
 160427 
 160428 	functionDestroy(tls, db, p)
 160429 
 160430 	if pDestructor != 0 {
 160431 		(*FuncDestructor)(unsafe.Pointer(pDestructor)).FnRef++
 160432 	}
 160433 	*(*uintptr)(unsafe.Pointer(p + 64)) = pDestructor
 160434 	(*FuncDef)(unsafe.Pointer(p)).FfuncFlags = (*FuncDef)(unsafe.Pointer(p)).FfuncFlags&U32(SQLITE_FUNC_ENCMASK) | U32(extraFlags)
 160435 
 160436 	(*FuncDef)(unsafe.Pointer(p)).FxSFunc = func() uintptr {
 160437 		if xSFunc != 0 {
 160438 			return xSFunc
 160439 		}
 160440 		return xStep
 160441 	}()
 160442 	(*FuncDef)(unsafe.Pointer(p)).FxFinalize = xFinal
 160443 	(*FuncDef)(unsafe.Pointer(p)).FxValue = xValue
 160444 	(*FuncDef)(unsafe.Pointer(p)).FxInverse = xInverse
 160445 	(*FuncDef)(unsafe.Pointer(p)).FpUserData = pUserData
 160446 	(*FuncDef)(unsafe.Pointer(p)).FnArg = I8(U16(nArg))
 160447 	return SQLITE_OK
 160448 }
 160449 
 160450 func createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) int32 {
 160451 	var rc int32
 160452 	var pArg uintptr
 160453 	rc = SQLITE_ERROR
 160454 	pArg = uintptr(0)
 160455 
 160456 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160457 	if !(xDestroy != 0) {
 160458 		goto __1
 160459 	}
 160460 	pArg = Xsqlite3Malloc(tls, uint64(unsafe.Sizeof(FuncDestructor{})))
 160461 	if !!(pArg != 0) {
 160462 		goto __2
 160463 	}
 160464 	Xsqlite3OomFault(tls, db)
 160465 	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{xDestroy})).f(tls, p)
 160466 	goto out
 160467 __2:
 160468 	;
 160469 	(*FuncDestructor)(unsafe.Pointer(pArg)).FnRef = 0
 160470 	(*FuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = xDestroy
 160471 	(*FuncDestructor)(unsafe.Pointer(pArg)).FpUserData = p
 160472 __1:
 160473 	;
 160474 	rc = Xsqlite3CreateFunc(tls, db, zFunc, nArg, enc, p,
 160475 		xSFunc, xStep, xFinal, xValue, xInverse, pArg)
 160476 	if !(pArg != 0 && (*FuncDestructor)(unsafe.Pointer(pArg)).FnRef == 0) {
 160477 		goto __3
 160478 	}
 160479 
 160480 	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{xDestroy})).f(tls, p)
 160481 	Xsqlite3_free(tls, pArg)
 160482 __3:
 160483 	;
 160484 out:
 160485 	rc = Xsqlite3ApiExit(tls, db, rc)
 160486 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160487 	return rc
 160488 }
 160489 
 160490 // Create new user functions.
 160491 func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) int32 {
 160492 	return createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep,
 160493 		xFinal, uintptr(0), uintptr(0), uintptr(0))
 160494 }
 160495 
 160496 func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) int32 {
 160497 	return createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep,
 160498 		xFinal, uintptr(0), uintptr(0), xDestroy)
 160499 }
 160500 
 160501 func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) int32 {
 160502 	return createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), xStep,
 160503 		xFinal, xValue, xInverse, xDestroy)
 160504 }
 160505 
 160506 func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) int32 {
 160507 	var rc int32
 160508 	var zFunc8 uintptr
 160509 
 160510 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160511 
 160512 	zFunc8 = Xsqlite3Utf16to8(tls, db, zFunctionName, -1, uint8(SQLITE_UTF16LE))
 160513 	rc = Xsqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0))
 160514 	Xsqlite3DbFree(tls, db, zFunc8)
 160515 	rc = Xsqlite3ApiExit(tls, db, rc)
 160516 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160517 	return rc
 160518 }
 160519 
 160520 func sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) {
 160521 	bp := tls.Alloc(8)
 160522 	defer tls.Free(8)
 160523 
 160524 	var zName uintptr = Xsqlite3_user_data(tls, context)
 160525 	var zErr uintptr
 160526 	_ = NotUsed
 160527 	_ = NotUsed2
 160528 	zErr = Xsqlite3_mprintf(tls,
 160529 		ts+25482, libc.VaList(bp, zName))
 160530 	Xsqlite3_result_error(tls, context, zErr, -1)
 160531 	Xsqlite3_free(tls, zErr)
 160532 }
 160533 
 160534 // Declare that a function has been overloaded by a virtual table.
 160535 //
 160536 // If the function already exists as a regular global function, then
 160537 // this routine is a no-op.  If the function does not exist, then create
 160538 // a new one that always throws a run-time error.
 160539 //
 160540 // When virtual tables intend to provide an overloaded function, they
 160541 // should call this routine to make sure the global function exists.
 160542 // A global function must exist in order for name resolution to work
 160543 // properly.
 160544 func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg int32) int32 {
 160545 	bp := tls.Alloc(8)
 160546 	defer tls.Free(8)
 160547 
 160548 	var rc int32
 160549 	var zCopy uintptr
 160550 
 160551 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160552 	rc = libc.Bool32(Xsqlite3FindFunction(tls, db, zName, nArg, uint8(SQLITE_UTF8), uint8(0)) != uintptr(0))
 160553 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160554 	if rc != 0 {
 160555 		return SQLITE_OK
 160556 	}
 160557 	zCopy = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp, zName))
 160558 	if zCopy == uintptr(0) {
 160559 		return SQLITE_NOMEM
 160560 	}
 160561 	return Xsqlite3_create_function_v2(tls, db, zName, nArg, SQLITE_UTF8,
 160562 		zCopy, *(*uintptr)(unsafe.Pointer(&struct {
 160563 			f func(*libc.TLS, uintptr, int32, uintptr)
 160564 		}{sqlite3InvalidFunction})), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
 160565 }
 160566 
 160567 // Register a trace function.  The pArg from the previously registered trace
 160568 // is returned.
 160569 //
 160570 // A NULL trace function means that no tracing is executes.  A non-NULL
 160571 // trace is a pointer to a function that is invoked at the start of each
 160572 // SQL statement.
 160573 func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) uintptr {
 160574 	var pOld uintptr
 160575 
 160576 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160577 	pOld = (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg
 160578 	(*Sqlite3)(unsafe.Pointer(db)).FmTrace = func() uint8 {
 160579 		if xTrace != 0 {
 160580 			return uint8(SQLITE_TRACE_LEGACY)
 160581 		}
 160582 		return uint8(0)
 160583 	}()
 160584 	*(*uintptr)(unsafe.Pointer(db + 248)) = xTrace
 160585 	(*Sqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg
 160586 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160587 	return pOld
 160588 }
 160589 
 160590 // Register a trace callback using the version-2 interface.
 160591 func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) int32 {
 160592 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160593 	if mTrace == uint32(0) {
 160594 		xTrace = uintptr(0)
 160595 	}
 160596 	if xTrace == uintptr(0) {
 160597 		mTrace = uint32(0)
 160598 	}
 160599 	(*Sqlite3)(unsafe.Pointer(db)).FmTrace = U8(mTrace)
 160600 	*(*uintptr)(unsafe.Pointer(db + 248)) = xTrace
 160601 	(*Sqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg
 160602 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160603 	return SQLITE_OK
 160604 }
 160605 
 160606 // Register a profile function.  The pArg from the previously registered
 160607 // profile function is returned.
 160608 //
 160609 // A NULL profile function means that no profiling is executes.  A non-NULL
 160610 // profile is a pointer to a function that is invoked at the conclusion of
 160611 // each SQL statement that is run.
 160612 func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) uintptr {
 160613 	var pOld uintptr
 160614 
 160615 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160616 	pOld = (*Sqlite3)(unsafe.Pointer(db)).FpProfileArg
 160617 	(*Sqlite3)(unsafe.Pointer(db)).FxProfile = xProfile
 160618 	(*Sqlite3)(unsafe.Pointer(db)).FpProfileArg = pArg
 160619 	*(*U8)(unsafe.Pointer(db + 110)) &= U8(SQLITE_TRACE_NONLEGACY_MASK)
 160620 	if (*Sqlite3)(unsafe.Pointer(db)).FxProfile != 0 {
 160621 		*(*U8)(unsafe.Pointer(db + 110)) |= U8(SQLITE_TRACE_XPROFILE)
 160622 	}
 160623 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160624 	return pOld
 160625 }
 160626 
 160627 // Register a function to be invoked when a transaction commits.
 160628 // If the invoked function returns non-zero, then the commit becomes a
 160629 // rollback.
 160630 func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr {
 160631 	var pOld uintptr
 160632 
 160633 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160634 	pOld = (*Sqlite3)(unsafe.Pointer(db)).FpCommitArg
 160635 	(*Sqlite3)(unsafe.Pointer(db)).FxCommitCallback = xCallback
 160636 	(*Sqlite3)(unsafe.Pointer(db)).FpCommitArg = pArg
 160637 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160638 	return pOld
 160639 }
 160640 
 160641 // Register a callback to be invoked each time a row is updated,
 160642 // inserted or deleted using this database connection.
 160643 func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr {
 160644 	var pRet uintptr
 160645 
 160646 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160647 	pRet = (*Sqlite3)(unsafe.Pointer(db)).FpUpdateArg
 160648 	(*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback = xCallback
 160649 	(*Sqlite3)(unsafe.Pointer(db)).FpUpdateArg = pArg
 160650 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160651 	return pRet
 160652 }
 160653 
 160654 // Register a callback to be invoked each time a transaction is rolled
 160655 // back by this database connection.
 160656 func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr {
 160657 	var pRet uintptr
 160658 
 160659 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160660 	pRet = (*Sqlite3)(unsafe.Pointer(db)).FpRollbackArg
 160661 	(*Sqlite3)(unsafe.Pointer(db)).FxRollbackCallback = xCallback
 160662 	(*Sqlite3)(unsafe.Pointer(db)).FpRollbackArg = pArg
 160663 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160664 	return pRet
 160665 }
 160666 
 160667 // Register a callback to be invoked each time a row is updated,
 160668 // inserted or deleted using this database connection.
 160669 func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr {
 160670 	var pRet uintptr
 160671 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160672 	pRet = (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdateArg
 160673 	(*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = xCallback
 160674 	(*Sqlite3)(unsafe.Pointer(db)).FpPreUpdateArg = pArg
 160675 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160676 	return pRet
 160677 }
 160678 
 160679 // Register a function to be invoked prior to each autovacuum that
 160680 // determines the number of pages to vacuum.
 160681 func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr, xDestructor uintptr) int32 {
 160682 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160683 	if (*Sqlite3)(unsafe.Pointer(db)).FxAutovacDestr != 0 {
 160684 		(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3)(unsafe.Pointer(db)).FxAutovacDestr})).f(tls, (*Sqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg)
 160685 	}
 160686 	(*Sqlite3)(unsafe.Pointer(db)).FxAutovacPages = xCallback
 160687 	(*Sqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg = pArg
 160688 	(*Sqlite3)(unsafe.Pointer(db)).FxAutovacDestr = xDestructor
 160689 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160690 	return SQLITE_OK
 160691 }
 160692 
 160693 // The sqlite3_wal_hook() callback registered by sqlite3_wal_autocheckpoint().
 160694 // Invoke sqlite3_wal_checkpoint if the number of frames in the log file
 160695 // is greater than sqlite3.pWalArg cast to an integer (the value configured by
 160696 // wal_autocheckpoint()).
 160697 func Xsqlite3WalDefaultHook(tls *libc.TLS, pClientData uintptr, db uintptr, zDb uintptr, nFrame int32) int32 {
 160698 	if nFrame >= int32(pClientData) {
 160699 		Xsqlite3BeginBenignMalloc(tls)
 160700 		Xsqlite3_wal_checkpoint(tls, db, zDb)
 160701 		Xsqlite3EndBenignMalloc(tls)
 160702 	}
 160703 	return SQLITE_OK
 160704 }
 160705 
 160706 // Configure an sqlite3_wal_hook() callback to automatically checkpoint
 160707 // a database after committing a transaction if there are nFrame or
 160708 // more frames in the log file. Passing zero or a negative value as the
 160709 // nFrame parameter disables automatic checkpoints entirely.
 160710 //
 160711 // The callback registered by this function replaces any existing callback
 160712 // registered using sqlite3_wal_hook(). Likewise, registering a callback
 160713 // using sqlite3_wal_hook() disables the automatic checkpoint mechanism
 160714 // configured by this function.
 160715 func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) int32 {
 160716 	if nFrame > 0 {
 160717 		Xsqlite3_wal_hook(tls, db, *(*uintptr)(unsafe.Pointer(&struct {
 160718 			f func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32
 160719 		}{Xsqlite3WalDefaultHook})), uintptr(int64(nFrame)))
 160720 	} else {
 160721 		Xsqlite3_wal_hook(tls, db, uintptr(0), uintptr(0))
 160722 	}
 160723 	return SQLITE_OK
 160724 }
 160725 
 160726 // Register a callback to be invoked each time a transaction is written
 160727 // into the write-ahead-log by this database connection.
 160728 func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr {
 160729 	var pRet uintptr
 160730 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160731 	pRet = (*Sqlite3)(unsafe.Pointer(db)).FpWalArg
 160732 	(*Sqlite3)(unsafe.Pointer(db)).FxWalCallback = xCallback
 160733 	(*Sqlite3)(unsafe.Pointer(db)).FpWalArg = pArg
 160734 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160735 	return pRet
 160736 }
 160737 
 160738 // Checkpoint database zDb.
 160739 func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 {
 160740 	bp := tls.Alloc(8)
 160741 	defer tls.Free(8)
 160742 
 160743 	var rc int32
 160744 	var iDb int32
 160745 
 160746 	if pnLog != 0 {
 160747 		*(*int32)(unsafe.Pointer(pnLog)) = -1
 160748 	}
 160749 	if pnCkpt != 0 {
 160750 		*(*int32)(unsafe.Pointer(pnCkpt)) = -1
 160751 	}
 160752 
 160753 	if eMode < SQLITE_CHECKPOINT_PASSIVE || eMode > SQLITE_CHECKPOINT_TRUNCATE {
 160754 		return SQLITE_MISUSE
 160755 	}
 160756 
 160757 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160758 	if zDb != 0 && *(*int8)(unsafe.Pointer(zDb)) != 0 {
 160759 		iDb = Xsqlite3FindDbName(tls, db, zDb)
 160760 	} else {
 160761 		iDb = SQLITE_MAX_ATTACHED + 2
 160762 	}
 160763 	if iDb < 0 {
 160764 		rc = SQLITE_ERROR
 160765 		Xsqlite3ErrorWithMsg(tls, db, SQLITE_ERROR, ts+25533, libc.VaList(bp, zDb))
 160766 	} else {
 160767 		(*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0
 160768 		rc = Xsqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt)
 160769 		Xsqlite3Error(tls, db, rc)
 160770 	}
 160771 	rc = Xsqlite3ApiExit(tls, db, rc)
 160772 
 160773 	if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive == 0 {
 160774 		libc.AtomicStoreNInt32(db+432, int32(0), 0)
 160775 	}
 160776 
 160777 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160778 	return rc
 160779 }
 160780 
 160781 // Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points
 160782 // to contains a zero-length string, all attached databases are
 160783 // checkpointed.
 160784 func Xsqlite3_wal_checkpoint(tls *libc.TLS, db uintptr, zDb uintptr) int32 {
 160785 	return Xsqlite3_wal_checkpoint_v2(tls, db, zDb, SQLITE_CHECKPOINT_PASSIVE, uintptr(0), uintptr(0))
 160786 }
 160787 
 160788 // Run a checkpoint on database iDb. This is a no-op if database iDb is
 160789 // not currently open in WAL mode.
 160790 //
 160791 // If a transaction is open on the database being checkpointed, this
 160792 // function returns SQLITE_LOCKED and a checkpoint is not attempted. If
 160793 // an error occurs while running the checkpoint, an SQLite error code is
 160794 // returned (i.e. SQLITE_IOERR). Otherwise, SQLITE_OK.
 160795 //
 160796 // The mutex on database handle db should be held by the caller. The mutex
 160797 // associated with the specific b-tree being checkpointed is taken by
 160798 // this function while the checkpoint is running.
 160799 //
 160800 // If iDb is passed SQLITE_MAX_DB then all attached databases are
 160801 // checkpointed. If an error is encountered it is returned immediately -
 160802 // no attempt is made to checkpoint any remaining databases.
 160803 //
 160804 // Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL, RESTART
 160805 // or TRUNCATE.
 160806 func Xsqlite3Checkpoint(tls *libc.TLS, db uintptr, iDb int32, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 {
 160807 	var rc int32 = SQLITE_OK
 160808 	var i int32
 160809 	var bBusy int32 = 0
 160810 
 160811 	for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb && rc == SQLITE_OK; i++ {
 160812 		if i == iDb || iDb == SQLITE_MAX_ATTACHED+2 {
 160813 			rc = Xsqlite3BtreeCheckpoint(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FpBt, eMode, pnLog, pnCkpt)
 160814 			pnLog = uintptr(0)
 160815 			pnCkpt = uintptr(0)
 160816 			if rc == SQLITE_BUSY {
 160817 				bBusy = 1
 160818 				rc = SQLITE_OK
 160819 			}
 160820 		}
 160821 	}
 160822 
 160823 	if rc == SQLITE_OK && bBusy != 0 {
 160824 		return SQLITE_BUSY
 160825 	}
 160826 	return rc
 160827 }
 160828 
 160829 // This function returns true if main-memory should be used instead of
 160830 // a temporary file for transient pager files and statement journals.
 160831 // The value returned depends on the value of db->temp_store (runtime
 160832 // parameter) and the compile time value of SQLITE_TEMP_STORE. The
 160833 // following table describes the relationship between these two values
 160834 // and this functions return value.
 160835 //
 160836 //	SQLITE_TEMP_STORE     db->temp_store     Location of temporary database
 160837 //	-----------------     --------------     ------------------------------
 160838 //	0                     any                file      (return 0)
 160839 //	1                     1                  file      (return 0)
 160840 //	1                     2                  memory    (return 1)
 160841 //	1                     0                  file      (return 0)
 160842 //	2                     1                  file      (return 0)
 160843 //	2                     2                  memory    (return 1)
 160844 //	2                     0                  memory    (return 1)
 160845 //	3                     any                memory    (return 1)
 160846 func Xsqlite3TempInMemory(tls *libc.TLS, db uintptr) int32 {
 160847 	return libc.Bool32(int32((*Sqlite3)(unsafe.Pointer(db)).Ftemp_store) == 2)
 160848 }
 160849 
 160850 // Return UTF-8 encoded English language explanation of the most recent
 160851 // error.
 160852 func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) uintptr {
 160853 	var z uintptr
 160854 	if !(db != 0) {
 160855 		return Xsqlite3ErrStr(tls, SQLITE_NOMEM)
 160856 	}
 160857 	if !(Xsqlite3SafetyCheckSickOrOk(tls, db) != 0) {
 160858 		return Xsqlite3ErrStr(tls, Xsqlite3MisuseError(tls, 176592))
 160859 	}
 160860 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160861 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 160862 		z = Xsqlite3ErrStr(tls, SQLITE_NOMEM)
 160863 	} else {
 160864 		if (*Sqlite3)(unsafe.Pointer(db)).FerrCode != 0 {
 160865 			z = Xsqlite3_value_text(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr)
 160866 		} else {
 160867 			z = uintptr(0)
 160868 		}
 160869 
 160870 		if z == uintptr(0) {
 160871 			z = Xsqlite3ErrStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FerrCode)
 160872 		}
 160873 	}
 160874 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160875 	return z
 160876 }
 160877 
 160878 // Return the byte offset of the most recent error
 160879 func Xsqlite3_error_offset(tls *libc.TLS, db uintptr) int32 {
 160880 	var iOffset int32 = -1
 160881 	if db != 0 && Xsqlite3SafetyCheckSickOrOk(tls, db) != 0 && (*Sqlite3)(unsafe.Pointer(db)).FerrCode != 0 {
 160882 		Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160883 		iOffset = (*Sqlite3)(unsafe.Pointer(db)).FerrByteOffset
 160884 		Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160885 	}
 160886 	return iOffset
 160887 }
 160888 
 160889 // Return UTF-16 encoded English language explanation of the most recent
 160890 // error.
 160891 func Xsqlite3_errmsg16(tls *libc.TLS, db uintptr) uintptr {
 160892 	var z uintptr
 160893 	if !(db != 0) {
 160894 		return uintptr(unsafe.Pointer(&outOfMem))
 160895 	}
 160896 	if !(Xsqlite3SafetyCheckSickOrOk(tls, db) != 0) {
 160897 		return uintptr(unsafe.Pointer(&misuse))
 160898 	}
 160899 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160900 	if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 160901 		z = uintptr(unsafe.Pointer(&outOfMem))
 160902 	} else {
 160903 		z = Xsqlite3_value_text16(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr)
 160904 		if z == uintptr(0) {
 160905 			Xsqlite3ErrorWithMsg(tls, db, (*Sqlite3)(unsafe.Pointer(db)).FerrCode, Xsqlite3ErrStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FerrCode), 0)
 160906 			z = Xsqlite3_value_text16(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr)
 160907 		}
 160908 
 160909 		Xsqlite3OomClear(tls, db)
 160910 	}
 160911 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 160912 	return z
 160913 }
 160914 
 160915 var outOfMem = [14]U16{
 160916 	U16('o'), U16('u'), U16('t'), U16(' '), U16('o'), U16('f'), U16(' '), U16('m'), U16('e'), U16('m'), U16('o'), U16('r'), U16('y'), U16(0),
 160917 }
 160918 var misuse = [34]U16{
 160919 	U16('b'), U16('a'), U16('d'), U16(' '), U16('p'), U16('a'), U16('r'), U16('a'), U16('m'), U16('e'), U16('t'), U16('e'), U16('r'), U16(' '),
 160920 	U16('o'), U16('r'), U16(' '), U16('o'), U16('t'), U16('h'), U16('e'), U16('r'), U16(' '), U16('A'), U16('P'), U16('I'), U16(' '),
 160921 	U16('m'), U16('i'), U16('s'), U16('u'), U16('s'), U16('e'), U16(0),
 160922 }
 160923 
 160924 // Return the most recent error code generated by an SQLite routine. If NULL is
 160925 // passed to this function, we assume a malloc() failed during sqlite3_open().
 160926 func Xsqlite3_errcode(tls *libc.TLS, db uintptr) int32 {
 160927 	if db != 0 && !(Xsqlite3SafetyCheckSickOrOk(tls, db) != 0) {
 160928 		return Xsqlite3MisuseError(tls, 176671)
 160929 	}
 160930 	if !(db != 0) || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 160931 		return SQLITE_NOMEM
 160932 	}
 160933 	return (*Sqlite3)(unsafe.Pointer(db)).FerrCode & (*Sqlite3)(unsafe.Pointer(db)).FerrMask
 160934 }
 160935 
 160936 func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) int32 {
 160937 	if db != 0 && !(Xsqlite3SafetyCheckSickOrOk(tls, db) != 0) {
 160938 		return Xsqlite3MisuseError(tls, 176680)
 160939 	}
 160940 	if !(db != 0) || (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
 160941 		return SQLITE_NOMEM
 160942 	}
 160943 	return (*Sqlite3)(unsafe.Pointer(db)).FerrCode
 160944 }
 160945 
 160946 func Xsqlite3_system_errno(tls *libc.TLS, db uintptr) int32 {
 160947 	if db != 0 {
 160948 		return (*Sqlite3)(unsafe.Pointer(db)).FiSysErrno
 160949 	}
 160950 	return 0
 160951 }
 160952 
 160953 // Return a string that describes the kind of error specified in the
 160954 // argument.  For now, this simply calls the internal sqlite3ErrStr()
 160955 // function.
 160956 func Xsqlite3_errstr(tls *libc.TLS, rc int32) uintptr {
 160957 	return Xsqlite3ErrStr(tls, rc)
 160958 }
 160959 
 160960 func createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc U8, pCtx uintptr, xCompare uintptr, xDel uintptr) int32 {
 160961 	var pColl uintptr
 160962 	var enc2 int32
 160963 
 160964 	enc2 = int32(enc)
 160965 
 160966 	if enc2 == SQLITE_UTF16 || enc2 == SQLITE_UTF16_ALIGNED {
 160967 		enc2 = SQLITE_UTF16LE
 160968 	}
 160969 	if enc2 < SQLITE_UTF8 || enc2 > SQLITE_UTF16BE {
 160970 		return Xsqlite3MisuseError(tls, 176728)
 160971 	}
 160972 
 160973 	pColl = Xsqlite3FindCollSeq(tls, db, U8(enc2), zName, 0)
 160974 	if pColl != 0 && (*CollSeq)(unsafe.Pointer(pColl)).FxCmp != 0 {
 160975 		if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 {
 160976 			Xsqlite3ErrorWithMsg(tls, db, SQLITE_BUSY,
 160977 				ts+25554, 0)
 160978 			return SQLITE_BUSY
 160979 		}
 160980 		Xsqlite3ExpirePreparedStatements(tls, db, 0)
 160981 
 160982 		if int32((*CollSeq)(unsafe.Pointer(pColl)).Fenc)&libc.CplInt32(SQLITE_UTF16_ALIGNED) == enc2 {
 160983 			var aColl uintptr = Xsqlite3HashFind(tls, db+648, zName)
 160984 			var j int32
 160985 			for j = 0; j < 3; j++ {
 160986 				var p uintptr = aColl + uintptr(j)*40
 160987 				if int32((*CollSeq)(unsafe.Pointer(p)).Fenc) == int32((*CollSeq)(unsafe.Pointer(pColl)).Fenc) {
 160988 					if (*CollSeq)(unsafe.Pointer(p)).FxDel != 0 {
 160989 						(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*CollSeq)(unsafe.Pointer(p)).FxDel})).f(tls, (*CollSeq)(unsafe.Pointer(p)).FpUser)
 160990 					}
 160991 					(*CollSeq)(unsafe.Pointer(p)).FxCmp = uintptr(0)
 160992 				}
 160993 			}
 160994 		}
 160995 	}
 160996 
 160997 	pColl = Xsqlite3FindCollSeq(tls, db, U8(enc2), zName, 1)
 160998 	if pColl == uintptr(0) {
 160999 		return SQLITE_NOMEM
 161000 	}
 161001 	(*CollSeq)(unsafe.Pointer(pColl)).FxCmp = xCompare
 161002 	(*CollSeq)(unsafe.Pointer(pColl)).FpUser = pCtx
 161003 	(*CollSeq)(unsafe.Pointer(pColl)).FxDel = xDel
 161004 	(*CollSeq)(unsafe.Pointer(pColl)).Fenc = U8(enc2 | int32(enc)&SQLITE_UTF16_ALIGNED)
 161005 	Xsqlite3Error(tls, db, SQLITE_OK)
 161006 	return SQLITE_OK
 161007 }
 161008 
 161009 var aHardLimit = [12]int32{
 161010 	SQLITE_MAX_LENGTH,
 161011 	SQLITE_MAX_SQL_LENGTH,
 161012 	SQLITE_MAX_COLUMN,
 161013 	SQLITE_MAX_EXPR_DEPTH,
 161014 	SQLITE_MAX_COMPOUND_SELECT,
 161015 	SQLITE_MAX_VDBE_OP,
 161016 	SQLITE_MAX_FUNCTION_ARG,
 161017 	SQLITE_MAX_ATTACHED,
 161018 	SQLITE_MAX_LIKE_PATTERN_LENGTH,
 161019 	SQLITE_MAX_VARIABLE_NUMBER,
 161020 	SQLITE_MAX_TRIGGER_DEPTH,
 161021 	SQLITE_MAX_WORKER_THREADS,
 161022 }
 161023 
 161024 // Change the value of a limit.  Report the old value.
 161025 // If an invalid limit index is supplied, report -1.
 161026 // Make no changes but still report the old value if the
 161027 // new limit is negative.
 161028 //
 161029 // A new lower limit does not shrink existing constructs.
 161030 // It merely prevents new constructs that exceed the limit
 161031 // from forming.
 161032 func Xsqlite3_limit(tls *libc.TLS, db uintptr, limitId int32, newLimit int32) int32 {
 161033 	var oldLimit int32
 161034 
 161035 	if limitId < 0 || limitId >= SQLITE_LIMIT_WORKER_THREADS+1 {
 161036 		return -1
 161037 	}
 161038 	oldLimit = *(*int32)(unsafe.Pointer(db + 136 + uintptr(limitId)*4))
 161039 	if newLimit >= 0 {
 161040 		if newLimit > aHardLimit[limitId] {
 161041 			newLimit = aHardLimit[limitId]
 161042 		} else if newLimit < 1 && limitId == SQLITE_LIMIT_LENGTH {
 161043 			newLimit = 1
 161044 		}
 161045 		*(*int32)(unsafe.Pointer(db + 136 + uintptr(limitId)*4)) = newLimit
 161046 	}
 161047 	return oldLimit
 161048 }
 161049 
 161050 // This function is used to parse both URIs and non-URI filenames passed by the
 161051 // user to API functions sqlite3_open() or sqlite3_open_v2(), and for database
 161052 // URIs specified as part of ATTACH statements.
 161053 //
 161054 // The first argument to this function is the name of the VFS to use (or
 161055 // a NULL to signify the default VFS) if the URI does not contain a "vfs=xxx"
 161056 // query parameter. The second argument contains the URI (or non-URI filename)
 161057 // itself. When this function is called the *pFlags variable should contain
 161058 // the default flags to open the database handle with. The value stored in
 161059 // *pFlags may be updated before returning if the URI filename contains
 161060 // "cache=xxx" or "mode=xxx" query parameters.
 161061 //
 161062 // If successful, SQLITE_OK is returned. In this case *ppVfs is set to point to
 161063 // the VFS that should be used to open the database file. *pzFile is set to
 161064 // point to a buffer containing the name of the file to open.  The value
 161065 // stored in *pzFile is a database name acceptable to sqlite3_uri_parameter()
 161066 // and is in the same format as names created using sqlite3_create_filename().
 161067 // The caller must invoke sqlite3_free_filename() (not sqlite3_free()!) on
 161068 // the value returned in *pzFile to avoid a memory leak.
 161069 //
 161070 // If an error occurs, then an SQLite error code is returned and *pzErrMsg
 161071 // may be set to point to a buffer containing an English language error
 161072 // message. It is the responsibility of the caller to eventually release
 161073 // this buffer by calling sqlite3_free().
 161074 func Xsqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags uintptr, ppVfs uintptr, pzFile uintptr, pzErrMsg uintptr) int32 {
 161075 	bp := tls.Alloc(56)
 161076 	defer tls.Free(56)
 161077 
 161078 	var rc int32
 161079 	var flags uint32
 161080 	var zVfs uintptr
 161081 	var zFile uintptr
 161082 	var c int8
 161083 	var nUri int32
 161084 	var octet int32
 161085 	var z uintptr
 161086 	var i int32
 161087 	var mode int32
 161088 	var aMode uintptr
 161089 	var zModeType uintptr
 161090 	var mask int32
 161091 	var limit int32
 161092 	var nOpt int32
 161093 	var zVal uintptr
 161094 	var nVal int32
 161095 	var zOpt uintptr
 161096 	var eState int32
 161097 	var iIn int32
 161098 	var iOut int32
 161099 	var nByte U64
 161100 	rc = SQLITE_OK
 161101 	flags = *(*uint32)(unsafe.Pointer(pFlags))
 161102 	zVfs = zDefaultVfs
 161103 	nUri = Xsqlite3Strlen30(tls, zUri)
 161104 
 161105 	if !((flags&uint32(SQLITE_OPEN_URI) != 0 ||
 161106 		Xsqlite3Config.FbOpenUri != 0) &&
 161107 		nUri >= 5 && libc.Xmemcmp(tls, zUri, ts+25622, uint64(5)) == 0) {
 161108 		goto __1
 161109 	}
 161110 	iOut = 0
 161111 	nByte = U64(nUri + 8)
 161112 
 161113 	flags = flags | uint32(SQLITE_OPEN_URI)
 161114 
 161115 	iIn = 0
 161116 __3:
 161117 	if !(iIn < nUri) {
 161118 		goto __5
 161119 	}
 161120 	nByte = nByte + U64(libc.Bool32(int32(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn)))) == '&'))
 161121 	goto __4
 161122 __4:
 161123 	iIn++
 161124 	goto __3
 161125 	goto __5
 161126 __5:
 161127 	;
 161128 	zFile = Xsqlite3_malloc64(tls, nByte)
 161129 	if !!(zFile != 0) {
 161130 		goto __6
 161131 	}
 161132 	return SQLITE_NOMEM
 161133 __6:
 161134 	;
 161135 	libc.Xmemset(tls, zFile, 0, uint64(4))
 161136 	zFile += uintptr(4)
 161137 
 161138 	iIn = 5
 161139 
 161140 	if !(int32(*(*int8)(unsafe.Pointer(zUri + 5))) == '/' && int32(*(*int8)(unsafe.Pointer(zUri + 6))) == '/') {
 161141 		goto __7
 161142 	}
 161143 	iIn = 7
 161144 __8:
 161145 	if !(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn))) != 0 && int32(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn)))) != '/') {
 161146 		goto __9
 161147 	}
 161148 	iIn++
 161149 	goto __8
 161150 __9:
 161151 	;
 161152 	if !(iIn != 7 && (iIn != 16 || libc.Xmemcmp(tls, ts+25628, zUri+7, uint64(9)) != 0)) {
 161153 		goto __10
 161154 	}
 161155 	*(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+25638,
 161156 		libc.VaList(bp, iIn-7, zUri+7))
 161157 	rc = SQLITE_ERROR
 161158 	goto parse_uri_out
 161159 __10:
 161160 	;
 161161 __7:
 161162 	;
 161163 	eState = 0
 161164 __11:
 161165 	if !(int32(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer(zUri + uintptr(iIn))))) != 0 && int32(c) != '#') {
 161166 		goto __12
 161167 	}
 161168 	iIn++
 161169 	if !(int32(c) == '%' &&
 161170 		int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn))))])&0x08 != 0 &&
 161171 		int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn+1))))])&0x08 != 0) {
 161172 		goto __13
 161173 	}
 161174 	octet = int32(Xsqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(zUri + uintptr(libc.PostIncInt32(&iIn, 1))))))) << 4
 161175 	octet = octet + int32(Xsqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(zUri + uintptr(libc.PostIncInt32(&iIn, 1)))))))
 161176 
 161177 	if !(octet == 0) {
 161178 		goto __15
 161179 	}
 161180 
 161181 __16:
 161182 	if !(int32(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer(zUri + uintptr(iIn))))) != 0 && int32(c) != '#' &&
 161183 		(eState != 0 || int32(c) != '?') &&
 161184 		(eState != 1 || int32(c) != '=' && int32(c) != '&') &&
 161185 		(eState != 2 || int32(c) != '&')) {
 161186 		goto __17
 161187 	}
 161188 	iIn++
 161189 	goto __16
 161190 __17:
 161191 	;
 161192 	goto __11
 161193 __15:
 161194 	;
 161195 	c = int8(octet)
 161196 	goto __14
 161197 __13:
 161198 	if !(eState == 1 && (int32(c) == '&' || int32(c) == '=')) {
 161199 		goto __18
 161200 	}
 161201 	if !(int32(*(*int8)(unsafe.Pointer(zFile + uintptr(iOut-1)))) == 0) {
 161202 		goto __20
 161203 	}
 161204 
 161205 __21:
 161206 	if !(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn))) != 0 && int32(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn)))) != '#' && int32(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn-1)))) != '&') {
 161207 		goto __22
 161208 	}
 161209 	iIn++
 161210 	goto __21
 161211 __22:
 161212 	;
 161213 	goto __11
 161214 __20:
 161215 	;
 161216 	if !(int32(c) == '&') {
 161217 		goto __23
 161218 	}
 161219 	*(*int8)(unsafe.Pointer(zFile + uintptr(libc.PostIncInt32(&iOut, 1)))) = int8(0)
 161220 	goto __24
 161221 __23:
 161222 	eState = 2
 161223 __24:
 161224 	;
 161225 	c = int8(0)
 161226 	goto __19
 161227 __18:
 161228 	if !(eState == 0 && int32(c) == '?' || eState == 2 && int32(c) == '&') {
 161229 		goto __25
 161230 	}
 161231 	c = int8(0)
 161232 	eState = 1
 161233 __25:
 161234 	;
 161235 __19:
 161236 	;
 161237 __14:
 161238 	;
 161239 	*(*int8)(unsafe.Pointer(zFile + uintptr(libc.PostIncInt32(&iOut, 1)))) = c
 161240 	goto __11
 161241 __12:
 161242 	;
 161243 	if !(eState == 1) {
 161244 		goto __26
 161245 	}
 161246 	*(*int8)(unsafe.Pointer(zFile + uintptr(libc.PostIncInt32(&iOut, 1)))) = int8(0)
 161247 __26:
 161248 	;
 161249 	libc.Xmemset(tls, zFile+uintptr(iOut), 0, uint64(4))
 161250 
 161251 	zOpt = zFile + uintptr(Xsqlite3Strlen30(tls, zFile)+1)
 161252 __27:
 161253 	if !(*(*int8)(unsafe.Pointer(zOpt)) != 0) {
 161254 		goto __28
 161255 	}
 161256 	nOpt = Xsqlite3Strlen30(tls, zOpt)
 161257 	zVal = zOpt + uintptr(nOpt+1)
 161258 	nVal = Xsqlite3Strlen30(tls, zVal)
 161259 
 161260 	if !(nOpt == 3 && libc.Xmemcmp(tls, ts+25666, zOpt, uint64(3)) == 0) {
 161261 		goto __29
 161262 	}
 161263 	zVfs = zVal
 161264 	goto __30
 161265 __29:
 161266 	aMode = uintptr(0)
 161267 	zModeType = uintptr(0)
 161268 	mask = 0
 161269 	limit = 0
 161270 
 161271 	if !(nOpt == 5 && libc.Xmemcmp(tls, ts+25670, zOpt, uint64(5)) == 0) {
 161272 		goto __31
 161273 	}
 161274 
 161275 	mask = SQLITE_OPEN_SHAREDCACHE | SQLITE_OPEN_PRIVATECACHE
 161276 	aMode = uintptr(unsafe.Pointer(&aCacheMode))
 161277 	limit = mask
 161278 	zModeType = ts + 25670
 161279 __31:
 161280 	;
 161281 	if !(nOpt == 4 && libc.Xmemcmp(tls, ts+25676, zOpt, uint64(4)) == 0) {
 161282 		goto __32
 161283 	}
 161284 
 161285 	mask = SQLITE_OPEN_READONLY | SQLITE_OPEN_READWRITE |
 161286 		SQLITE_OPEN_CREATE | SQLITE_OPEN_MEMORY
 161287 	aMode = uintptr(unsafe.Pointer(&aOpenMode))
 161288 	limit = int32(uint32(mask) & flags)
 161289 	zModeType = ts + 25681
 161290 __32:
 161291 	;
 161292 	if !(aMode != 0) {
 161293 		goto __33
 161294 	}
 161295 	mode = 0
 161296 	i = 0
 161297 __34:
 161298 	if !((*OpenMode)(unsafe.Pointer(aMode+uintptr(i)*16)).Fz != 0) {
 161299 		goto __36
 161300 	}
 161301 	z = (*OpenMode)(unsafe.Pointer(aMode + uintptr(i)*16)).Fz
 161302 	if !(nVal == Xsqlite3Strlen30(tls, z) && 0 == libc.Xmemcmp(tls, zVal, z, uint64(nVal))) {
 161303 		goto __37
 161304 	}
 161305 	mode = (*OpenMode)(unsafe.Pointer(aMode + uintptr(i)*16)).Fmode
 161306 	goto __36
 161307 __37:
 161308 	;
 161309 	goto __35
 161310 __35:
 161311 	i++
 161312 	goto __34
 161313 	goto __36
 161314 __36:
 161315 	;
 161316 	if !(mode == 0) {
 161317 		goto __38
 161318 	}
 161319 	*(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+25688, libc.VaList(bp+16, zModeType, zVal))
 161320 	rc = SQLITE_ERROR
 161321 	goto parse_uri_out
 161322 __38:
 161323 	;
 161324 	if !(mode&libc.CplInt32(SQLITE_OPEN_MEMORY) > limit) {
 161325 		goto __39
 161326 	}
 161327 	*(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+25708,
 161328 		libc.VaList(bp+32, zModeType, zVal))
 161329 	rc = SQLITE_PERM
 161330 	goto parse_uri_out
 161331 __39:
 161332 	;
 161333 	flags = flags&uint32(^mask) | uint32(mode)
 161334 __33:
 161335 	;
 161336 __30:
 161337 	;
 161338 	zOpt = zVal + uintptr(nVal+1)
 161339 	goto __27
 161340 __28:
 161341 	;
 161342 	goto __2
 161343 __1:
 161344 	zFile = Xsqlite3_malloc64(tls, uint64(nUri+8))
 161345 	if !!(zFile != 0) {
 161346 		goto __40
 161347 	}
 161348 	return SQLITE_NOMEM
 161349 __40:
 161350 	;
 161351 	libc.Xmemset(tls, zFile, 0, uint64(4))
 161352 	zFile += uintptr(4)
 161353 	if !(nUri != 0) {
 161354 		goto __41
 161355 	}
 161356 	libc.Xmemcpy(tls, zFile, zUri, uint64(nUri))
 161357 __41:
 161358 	;
 161359 	libc.Xmemset(tls, zFile+uintptr(nUri), 0, uint64(4))
 161360 	flags = flags & libc.Uint32FromInt32(libc.CplInt32(SQLITE_OPEN_URI))
 161361 __2:
 161362 	;
 161363 	*(*uintptr)(unsafe.Pointer(ppVfs)) = Xsqlite3_vfs_find(tls, zVfs)
 161364 	if !(*(*uintptr)(unsafe.Pointer(ppVfs)) == uintptr(0)) {
 161365 		goto __42
 161366 	}
 161367 	*(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+25732, libc.VaList(bp+48, zVfs))
 161368 	rc = SQLITE_ERROR
 161369 __42:
 161370 	;
 161371 parse_uri_out:
 161372 	if !(rc != SQLITE_OK) {
 161373 		goto __43
 161374 	}
 161375 	Xsqlite3_free_filename(tls, zFile)
 161376 	zFile = uintptr(0)
 161377 __43:
 161378 	;
 161379 	*(*uint32)(unsafe.Pointer(pFlags)) = flags
 161380 	*(*uintptr)(unsafe.Pointer(pzFile)) = zFile
 161381 	return rc
 161382 }
 161383 
 161384 type OpenMode = struct {
 161385 	Fz           uintptr
 161386 	Fmode        int32
 161387 	F__ccgo_pad1 [4]byte
 161388 }
 161389 
 161390 var aCacheMode = [3]OpenMode{
 161391 	{Fz: ts + 25748, Fmode: SQLITE_OPEN_SHAREDCACHE},
 161392 	{Fz: ts + 25755, Fmode: SQLITE_OPEN_PRIVATECACHE},
 161393 	{},
 161394 }
 161395 var aOpenMode = [5]OpenMode{
 161396 	{Fz: ts + 25763, Fmode: SQLITE_OPEN_READONLY},
 161397 	{Fz: ts + 25766, Fmode: SQLITE_OPEN_READWRITE},
 161398 	{Fz: ts + 25769, Fmode: SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE},
 161399 	{Fz: ts + 18731, Fmode: SQLITE_OPEN_MEMORY},
 161400 	{},
 161401 }
 161402 
 161403 func uriParameter(tls *libc.TLS, zFilename uintptr, zParam uintptr) uintptr {
 161404 	zFilename += uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)
 161405 	for zFilename != uintptr(0) && *(*int8)(unsafe.Pointer(zFilename)) != 0 {
 161406 		var x int32 = libc.Xstrcmp(tls, zFilename, zParam)
 161407 		zFilename += uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)
 161408 		if x == 0 {
 161409 			return zFilename
 161410 		}
 161411 		zFilename += uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)
 161412 	}
 161413 	return uintptr(0)
 161414 }
 161415 
 161416 func openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, flags uint32, zVfs uintptr) int32 {
 161417 	bp := tls.Alloc(32)
 161418 	defer tls.Free(32)
 161419 	*(*uint32)(unsafe.Pointer(bp + 8)) = flags
 161420 
 161421 	var db uintptr
 161422 	var rc int32
 161423 	var isThreadsafe int32
 161424 
 161425 	var i int32
 161426 	*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
 161427 	*(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0)
 161428 
 161429 	*(*uintptr)(unsafe.Pointer(ppDb)) = uintptr(0)
 161430 	rc = Xsqlite3_initialize(tls)
 161431 	if !(rc != 0) {
 161432 		goto __1
 161433 	}
 161434 	return rc
 161435 __1:
 161436 	;
 161437 	if !(int32(Xsqlite3Config.FbCoreMutex) == 0) {
 161438 		goto __2
 161439 	}
 161440 	isThreadsafe = 0
 161441 	goto __3
 161442 __2:
 161443 	if !(*(*uint32)(unsafe.Pointer(bp + 8))&uint32(SQLITE_OPEN_NOMUTEX) != 0) {
 161444 		goto __4
 161445 	}
 161446 	isThreadsafe = 0
 161447 	goto __5
 161448 __4:
 161449 	if !(*(*uint32)(unsafe.Pointer(bp + 8))&uint32(SQLITE_OPEN_FULLMUTEX) != 0) {
 161450 		goto __6
 161451 	}
 161452 	isThreadsafe = 1
 161453 	goto __7
 161454 __6:
 161455 	isThreadsafe = int32(Xsqlite3Config.FbFullMutex)
 161456 __7:
 161457 	;
 161458 __5:
 161459 	;
 161460 __3:
 161461 	;
 161462 	if !(*(*uint32)(unsafe.Pointer(bp + 8))&uint32(SQLITE_OPEN_PRIVATECACHE) != 0) {
 161463 		goto __8
 161464 	}
 161465 	*(*uint32)(unsafe.Pointer(bp + 8)) &= libc.Uint32FromInt32(libc.CplInt32(SQLITE_OPEN_SHAREDCACHE))
 161466 	goto __9
 161467 __8:
 161468 	if !(Xsqlite3Config.FsharedCacheEnabled != 0) {
 161469 		goto __10
 161470 	}
 161471 	*(*uint32)(unsafe.Pointer(bp + 8)) |= uint32(SQLITE_OPEN_SHAREDCACHE)
 161472 __10:
 161473 	;
 161474 __9:
 161475 	;
 161476 	*(*uint32)(unsafe.Pointer(bp + 8)) &= libc.Uint32FromInt32(libc.CplInt32(SQLITE_OPEN_DELETEONCLOSE | SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_MAIN_DB | SQLITE_OPEN_TEMP_DB | SQLITE_OPEN_TRANSIENT_DB | SQLITE_OPEN_MAIN_JOURNAL | SQLITE_OPEN_TEMP_JOURNAL | SQLITE_OPEN_SUBJOURNAL | SQLITE_OPEN_SUPER_JOURNAL | SQLITE_OPEN_NOMUTEX | SQLITE_OPEN_FULLMUTEX | SQLITE_OPEN_WAL))
 161477 
 161478 	db = Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(Sqlite3{})))
 161479 	if !(db == uintptr(0)) {
 161480 		goto __11
 161481 	}
 161482 	goto opendb_out
 161483 __11:
 161484 	;
 161485 	if !(isThreadsafe != 0) {
 161486 		goto __12
 161487 	}
 161488 	(*Sqlite3)(unsafe.Pointer(db)).Fmutex = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_RECURSIVE)
 161489 	if !((*Sqlite3)(unsafe.Pointer(db)).Fmutex == uintptr(0)) {
 161490 		goto __13
 161491 	}
 161492 	Xsqlite3_free(tls, db)
 161493 	db = uintptr(0)
 161494 	goto opendb_out
 161495 __13:
 161496 	;
 161497 	if !(isThreadsafe == 0) {
 161498 		goto __14
 161499 	}
 161500 
 161501 __14:
 161502 	;
 161503 __12:
 161504 	;
 161505 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 161506 	(*Sqlite3)(unsafe.Pointer(db)).FerrMask = func() int32 {
 161507 		if *(*uint32)(unsafe.Pointer(bp + 8))&uint32(SQLITE_OPEN_EXRESCODE) != uint32(0) {
 161508 			return libc.Int32FromUint32(0xffffffff)
 161509 		}
 161510 		return 0xff
 161511 	}()
 161512 	(*Sqlite3)(unsafe.Pointer(db)).FnDb = 2
 161513 	(*Sqlite3)(unsafe.Pointer(db)).FeOpenState = U8(SQLITE_STATE_BUSY)
 161514 	(*Sqlite3)(unsafe.Pointer(db)).FaDb = db + 696
 161515 	(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable = U32(1)
 161516 	(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0)
 161517 
 161518 	libc.Xmemcpy(tls, db+136, uintptr(unsafe.Pointer(&aHardLimit)), uint64(unsafe.Sizeof([12]int32{})))
 161519 	*(*int32)(unsafe.Pointer(db + 136 + 11*4)) = SQLITE_DEFAULT_WORKER_THREADS
 161520 	(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1)
 161521 	(*Sqlite3)(unsafe.Pointer(db)).FnextAutovac = int8(-1)
 161522 	(*Sqlite3)(unsafe.Pointer(db)).FszMmap = Xsqlite3Config.FszMmap
 161523 	(*Sqlite3)(unsafe.Pointer(db)).FnextPagesize = 0
 161524 	(*Sqlite3)(unsafe.Pointer(db)).Finit.FazInit = uintptr(unsafe.Pointer(&Xsqlite3StdType))
 161525 	*(*U64)(unsafe.Pointer(db + 48)) |= uint64(uint32(SQLITE_ShortColNames|
 161526 		SQLITE_EnableTrigger) |
 161527 		SQLITE_EnableView |
 161528 		uint32(SQLITE_CacheSpill) |
 161529 		uint32(SQLITE_TrustedSchema) |
 161530 		uint32(SQLITE_DqsDML) |
 161531 		uint32(SQLITE_DqsDDL) |
 161532 		uint32(SQLITE_AutoIndex))
 161533 	Xsqlite3HashInit(tls, db+648)
 161534 	Xsqlite3HashInit(tls, db+576)
 161535 
 161536 	createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), uint8(SQLITE_UTF8), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
 161537 		f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
 161538 	}{binCollFunc})), uintptr(0))
 161539 	createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), uint8(SQLITE_UTF16BE), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
 161540 		f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
 161541 	}{binCollFunc})), uintptr(0))
 161542 	createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), uint8(SQLITE_UTF16LE), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
 161543 		f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
 161544 	}{binCollFunc})), uintptr(0))
 161545 	createCollation(tls, db, ts+23279, uint8(SQLITE_UTF8), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
 161546 		f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
 161547 	}{nocaseCollatingFunc})), uintptr(0))
 161548 	createCollation(tls, db, ts+25773, uint8(SQLITE_UTF8), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
 161549 		f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
 161550 	}{rtrimCollFunc})), uintptr(0))
 161551 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 161552 		goto __15
 161553 	}
 161554 	goto opendb_out
 161555 __15:
 161556 	;
 161557 	(*Sqlite3)(unsafe.Pointer(db)).FopenFlags = *(*uint32)(unsafe.Pointer(bp + 8))
 161558 
 161559 	if !(int32(1)<<(*(*uint32)(unsafe.Pointer(bp + 8))&uint32(7))&0x46 == 0) {
 161560 		goto __16
 161561 	}
 161562 	rc = Xsqlite3MisuseError(tls, 177397)
 161563 	goto __17
 161564 __16:
 161565 	rc = Xsqlite3ParseUri(tls, zVfs, zFilename, bp+8, db, bp+16, bp+24)
 161566 __17:
 161567 	;
 161568 	if !(rc != SQLITE_OK) {
 161569 		goto __18
 161570 	}
 161571 	if !(rc == SQLITE_NOMEM) {
 161572 		goto __19
 161573 	}
 161574 	Xsqlite3OomFault(tls, db)
 161575 __19:
 161576 	;
 161577 	Xsqlite3ErrorWithMsg(tls, db, rc, func() uintptr {
 161578 		if *(*uintptr)(unsafe.Pointer(bp + 24)) != 0 {
 161579 			return ts + 4493
 161580 		}
 161581 		return uintptr(0)
 161582 	}(), libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 24))))
 161583 	Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 24)))
 161584 	goto opendb_out
 161585 __18:
 161586 	;
 161587 	rc = Xsqlite3BtreeOpen(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, *(*uintptr)(unsafe.Pointer(bp + 16)), db, (*Sqlite3)(unsafe.Pointer(db)).FaDb+8, 0,
 161588 		int32(*(*uint32)(unsafe.Pointer(bp + 8))|uint32(SQLITE_OPEN_MAIN_DB)))
 161589 	if !(rc != SQLITE_OK) {
 161590 		goto __20
 161591 	}
 161592 	if !(rc == SQLITE_IOERR|int32(12)<<8) {
 161593 		goto __21
 161594 	}
 161595 	rc = SQLITE_NOMEM
 161596 __21:
 161597 	;
 161598 	Xsqlite3Error(tls, db, rc)
 161599 	goto opendb_out
 161600 __20:
 161601 	;
 161602 	Xsqlite3BtreeEnter(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpBt)
 161603 	(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema = Xsqlite3SchemaGet(tls, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpBt)
 161604 	if !!(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
 161605 		goto __22
 161606 	}
 161607 	Xsqlite3SetTextEncoding(tls, db, (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema)).Fenc)
 161608 __22:
 161609 	;
 161610 	Xsqlite3BtreeLeave(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpBt)
 161611 	(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).FpSchema = Xsqlite3SchemaGet(tls, db, uintptr(0))
 161612 
 161613 	(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FzDbSName = ts + 7793
 161614 	(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).Fsafety_level = U8(SQLITE_DEFAULT_SYNCHRONOUS + 1)
 161615 	(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).FzDbSName = ts + 24768
 161616 	(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).Fsafety_level = U8(PAGER_SYNCHRONOUS_OFF)
 161617 
 161618 	(*Sqlite3)(unsafe.Pointer(db)).FeOpenState = U8(SQLITE_STATE_OPEN)
 161619 	if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
 161620 		goto __23
 161621 	}
 161622 	goto opendb_out
 161623 __23:
 161624 	;
 161625 	Xsqlite3Error(tls, db, SQLITE_OK)
 161626 	Xsqlite3RegisterPerConnectionBuiltinFunctions(tls, db)
 161627 	rc = Xsqlite3_errcode(tls, db)
 161628 
 161629 	i = 0
 161630 __24:
 161631 	if !(rc == SQLITE_OK && i < int32(uint64(unsafe.Sizeof(sqlite3BuiltinExtensions))/uint64(unsafe.Sizeof(uintptr(0))))) {
 161632 		goto __26
 161633 	}
 161634 	rc = (*struct {
 161635 		f func(*libc.TLS, uintptr) int32
 161636 	})(unsafe.Pointer(&struct{ uintptr }{sqlite3BuiltinExtensions[i]})).f(tls, db)
 161637 	goto __25
 161638 __25:
 161639 	i++
 161640 	goto __24
 161641 	goto __26
 161642 __26:
 161643 	;
 161644 	if !(rc == SQLITE_OK) {
 161645 		goto __27
 161646 	}
 161647 	Xsqlite3AutoLoadExtensions(tls, db)
 161648 	rc = Xsqlite3_errcode(tls, db)
 161649 	if !(rc != SQLITE_OK) {
 161650 		goto __28
 161651 	}
 161652 	goto opendb_out
 161653 __28:
 161654 	;
 161655 __27:
 161656 	;
 161657 	if !(rc != 0) {
 161658 		goto __29
 161659 	}
 161660 	Xsqlite3Error(tls, db, rc)
 161661 __29:
 161662 	;
 161663 	setupLookaside(tls, db, uintptr(0), Xsqlite3Config.FszLookaside,
 161664 		Xsqlite3Config.FnLookaside)
 161665 
 161666 	Xsqlite3_wal_autocheckpoint(tls, db, SQLITE_DEFAULT_WAL_AUTOCHECKPOINT)
 161667 
 161668 opendb_out:
 161669 	if !(db != 0) {
 161670 		goto __30
 161671 	}
 161672 
 161673 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 161674 __30:
 161675 	;
 161676 	rc = Xsqlite3_errcode(tls, db)
 161677 
 161678 	if !(rc&0xff == SQLITE_NOMEM) {
 161679 		goto __31
 161680 	}
 161681 	Xsqlite3_close(tls, db)
 161682 	db = uintptr(0)
 161683 	goto __32
 161684 __31:
 161685 	if !(rc != SQLITE_OK) {
 161686 		goto __33
 161687 	}
 161688 	(*Sqlite3)(unsafe.Pointer(db)).FeOpenState = U8(SQLITE_STATE_SICK)
 161689 __33:
 161690 	;
 161691 __32:
 161692 	;
 161693 	*(*uintptr)(unsafe.Pointer(ppDb)) = db
 161694 	Xsqlite3_free_filename(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
 161695 	return rc
 161696 }
 161697 
 161698 // Open a new database handle.
 161699 func Xsqlite3_open(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32 {
 161700 	return openDatabase(tls, zFilename, ppDb,
 161701 		uint32(SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE), uintptr(0))
 161702 }
 161703 
 161704 func Xsqlite3_open_v2(tls *libc.TLS, filename uintptr, ppDb uintptr, flags int32, zVfs uintptr) int32 {
 161705 	return openDatabase(tls, filename, ppDb, uint32(flags), zVfs)
 161706 }
 161707 
 161708 // Open a new database handle.
 161709 func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32 {
 161710 	var zFilename8 uintptr
 161711 	var pVal uintptr
 161712 	var rc int32
 161713 
 161714 	*(*uintptr)(unsafe.Pointer(ppDb)) = uintptr(0)
 161715 	rc = Xsqlite3_initialize(tls)
 161716 	if rc != 0 {
 161717 		return rc
 161718 	}
 161719 	if zFilename == uintptr(0) {
 161720 		zFilename = ts + 25779
 161721 	}
 161722 	pVal = Xsqlite3ValueNew(tls, uintptr(0))
 161723 	Xsqlite3ValueSetStr(tls, pVal, -1, zFilename, uint8(SQLITE_UTF16LE), uintptr(0))
 161724 	zFilename8 = Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF8))
 161725 	if zFilename8 != 0 {
 161726 		rc = openDatabase(tls, zFilename8, ppDb,
 161727 			uint32(SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE), uintptr(0))
 161728 
 161729 		if rc == SQLITE_OK && !(int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppDb)))).FaDb)).FpSchema)).FschemaFlags)&DB_SchemaLoaded == DB_SchemaLoaded) {
 161730 			(*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppDb)))).FaDb)).FpSchema)).Fenc = libc.AssignPtrUint8(*(*uintptr)(unsafe.Pointer(ppDb))+100, U8(SQLITE_UTF16LE))
 161731 		}
 161732 	} else {
 161733 		rc = SQLITE_NOMEM
 161734 	}
 161735 	Xsqlite3ValueFree(tls, pVal)
 161736 
 161737 	return rc & 0xff
 161738 }
 161739 
 161740 // Register a new collation sequence with the database handle db.
 161741 func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) int32 {
 161742 	return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, xCompare, uintptr(0))
 161743 }
 161744 
 161745 // Register a new collation sequence with the database handle db.
 161746 func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) int32 {
 161747 	var rc int32
 161748 
 161749 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 161750 
 161751 	rc = createCollation(tls, db, zName, U8(enc), pCtx, xCompare, xDel)
 161752 	rc = Xsqlite3ApiExit(tls, db, rc)
 161753 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 161754 	return rc
 161755 }
 161756 
 161757 // Register a new collation sequence with the database handle db.
 161758 func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) int32 {
 161759 	var rc int32 = SQLITE_OK
 161760 	var zName8 uintptr
 161761 
 161762 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 161763 
 161764 	zName8 = Xsqlite3Utf16to8(tls, db, zName, -1, uint8(SQLITE_UTF16LE))
 161765 	if zName8 != 0 {
 161766 		rc = createCollation(tls, db, zName8, U8(enc), pCtx, xCompare, uintptr(0))
 161767 		Xsqlite3DbFree(tls, db, zName8)
 161768 	}
 161769 	rc = Xsqlite3ApiExit(tls, db, rc)
 161770 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 161771 	return rc
 161772 }
 161773 
 161774 // Register a collation sequence factory callback with the database handle
 161775 // db. Replace any previously installed collation sequence factory.
 161776 func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) int32 {
 161777 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 161778 	(*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded = xCollNeeded
 161779 	(*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = uintptr(0)
 161780 	(*Sqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg
 161781 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 161782 	return SQLITE_OK
 161783 }
 161784 
 161785 // Register a collation sequence factory callback with the database handle
 161786 // db. Replace any previously installed collation sequence factory.
 161787 func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) int32 {
 161788 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 161789 	(*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded = uintptr(0)
 161790 	(*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = xCollNeeded16
 161791 	(*Sqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg
 161792 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 161793 	return SQLITE_OK
 161794 }
 161795 
 161796 // This function is now an anachronism. It used to be used to recover from a
 161797 // malloc() failure, but SQLite now does this automatically.
 161798 func Xsqlite3_global_recover(tls *libc.TLS) int32 {
 161799 	return SQLITE_OK
 161800 }
 161801 
 161802 // Test to see whether or not the database connection is in autocommit
 161803 // mode.  Return TRUE if it is and FALSE if not.  Autocommit mode is on
 161804 // by default.  Autocommit is disabled by a BEGIN statement and reenabled
 161805 // by the next COMMIT or ROLLBACK.
 161806 func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) int32 {
 161807 	return int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit)
 161808 }
 161809 
 161810 // The following routines are substitutes for constants SQLITE_CORRUPT,
 161811 // SQLITE_MISUSE, SQLITE_CANTOPEN, SQLITE_NOMEM and possibly other error
 161812 // constants.  They serve two purposes:
 161813 //
 161814 //  1. Serve as a convenient place to set a breakpoint in a debugger
 161815 //     to detect when version error conditions occurs.
 161816 //
 161817 //  2. Invoke sqlite3_log() to provide the source code location where
 161818 //     a low-level error is first detected.
 161819 func Xsqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) int32 {
 161820 	bp := tls.Alloc(24)
 161821 	defer tls.Free(24)
 161822 
 161823 	Xsqlite3_log(tls, iErr, ts+25782,
 161824 		libc.VaList(bp, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls)))
 161825 	return iErr
 161826 }
 161827 
 161828 func Xsqlite3CorruptError(tls *libc.TLS, lineno int32) int32 {
 161829 	return Xsqlite3ReportError(tls, SQLITE_CORRUPT, lineno, ts+25807)
 161830 }
 161831 
 161832 func Xsqlite3MisuseError(tls *libc.TLS, lineno int32) int32 {
 161833 	return Xsqlite3ReportError(tls, SQLITE_MISUSE, lineno, ts+25827)
 161834 }
 161835 
 161836 func Xsqlite3CantopenError(tls *libc.TLS, lineno int32) int32 {
 161837 	return Xsqlite3ReportError(tls, SQLITE_CANTOPEN, lineno, ts+25834)
 161838 }
 161839 
 161840 // This is a convenience routine that makes sure that all thread-specific
 161841 // data for this thread has been deallocated.
 161842 //
 161843 // SQLite no longer uses thread-specific data so this routine is now a
 161844 // no-op.  It is retained for historical compatibility.
 161845 func Xsqlite3_thread_cleanup(tls *libc.TLS) {
 161846 }
 161847 
 161848 // Return meta information about a specific column of a database table.
 161849 // See comment in sqlite3.h (sqlite.h.in) for details.
 161850 func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, zTableName uintptr, zColumnName uintptr, pzDataType uintptr, pzCollSeq uintptr, pNotNull uintptr, pPrimaryKey uintptr, pAutoinc uintptr) int32 {
 161851 	bp := tls.Alloc(32)
 161852 	defer tls.Free(32)
 161853 
 161854 	var rc int32
 161855 
 161856 	var pTab uintptr
 161857 	var pCol uintptr
 161858 	var iCol int32
 161859 	var zDataType uintptr
 161860 	var zCollSeq uintptr
 161861 	var notnull int32
 161862 	var primarykey int32
 161863 	var autoinc int32
 161864 	*(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0)
 161865 	pTab = uintptr(0)
 161866 	pCol = uintptr(0)
 161867 	iCol = 0
 161868 	zDataType = uintptr(0)
 161869 	zCollSeq = uintptr(0)
 161870 	notnull = 0
 161871 	primarykey = 0
 161872 	autoinc = 0
 161873 
 161874 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 161875 	Xsqlite3BtreeEnterAll(tls, db)
 161876 	rc = Xsqlite3Init(tls, db, bp+24)
 161877 	if !(SQLITE_OK != rc) {
 161878 		goto __1
 161879 	}
 161880 	goto error_out
 161881 __1:
 161882 	;
 161883 	pTab = Xsqlite3FindTable(tls, db, zTableName, zDbName)
 161884 	if !(!(pTab != 0) || int32((*Table)(unsafe.Pointer(pTab)).FeTabType) == TABTYP_VIEW) {
 161885 		goto __2
 161886 	}
 161887 	pTab = uintptr(0)
 161888 	goto error_out
 161889 __2:
 161890 	;
 161891 	if !(zColumnName == uintptr(0)) {
 161892 		goto __3
 161893 	}
 161894 
 161895 	goto __4
 161896 __3:
 161897 	iCol = 0
 161898 __5:
 161899 	if !(iCol < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 161900 		goto __7
 161901 	}
 161902 	pCol = (*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*24
 161903 	if !(0 == Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer(pCol)).FzCnName, zColumnName)) {
 161904 		goto __8
 161905 	}
 161906 	goto __7
 161907 __8:
 161908 	;
 161909 	goto __6
 161910 __6:
 161911 	iCol++
 161912 	goto __5
 161913 	goto __7
 161914 __7:
 161915 	;
 161916 	if !(iCol == int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
 161917 		goto __9
 161918 	}
 161919 	if !((*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_WithoutRowid) == U32(0) && Xsqlite3IsRowid(tls, zColumnName) != 0) {
 161920 		goto __10
 161921 	}
 161922 	iCol = int32((*Table)(unsafe.Pointer(pTab)).FiPKey)
 161923 	if iCol >= 0 {
 161924 		pCol = (*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*24
 161925 	} else {
 161926 		pCol = uintptr(0)
 161927 	}
 161928 	goto __11
 161929 __10:
 161930 	pTab = uintptr(0)
 161931 	goto error_out
 161932 __11:
 161933 	;
 161934 __9:
 161935 	;
 161936 __4:
 161937 	;
 161938 	if !(pCol != 0) {
 161939 		goto __12
 161940 	}
 161941 	zDataType = Xsqlite3ColumnType(tls, pCol, uintptr(0))
 161942 	zCollSeq = Xsqlite3ColumnColl(tls, pCol)
 161943 	notnull = libc.Bool32(int32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0) != 0)
 161944 	primarykey = libc.Bool32(int32((*Column)(unsafe.Pointer(pCol)).FcolFlags)&COLFLAG_PRIMKEY != 0)
 161945 	autoinc = libc.Bool32(int32((*Table)(unsafe.Pointer(pTab)).FiPKey) == iCol && (*Table)(unsafe.Pointer(pTab)).FtabFlags&U32(TF_Autoincrement) != U32(0))
 161946 	goto __13
 161947 __12:
 161948 	zDataType = ts + 1109
 161949 	primarykey = 1
 161950 __13:
 161951 	;
 161952 	if !!(zCollSeq != 0) {
 161953 		goto __14
 161954 	}
 161955 	zCollSeq = uintptr(unsafe.Pointer(&Xsqlite3StrBINARY))
 161956 __14:
 161957 	;
 161958 error_out:
 161959 	Xsqlite3BtreeLeaveAll(tls, db)
 161960 
 161961 	if !(pzDataType != 0) {
 161962 		goto __15
 161963 	}
 161964 	*(*uintptr)(unsafe.Pointer(pzDataType)) = zDataType
 161965 __15:
 161966 	;
 161967 	if !(pzCollSeq != 0) {
 161968 		goto __16
 161969 	}
 161970 	*(*uintptr)(unsafe.Pointer(pzCollSeq)) = zCollSeq
 161971 __16:
 161972 	;
 161973 	if !(pNotNull != 0) {
 161974 		goto __17
 161975 	}
 161976 	*(*int32)(unsafe.Pointer(pNotNull)) = notnull
 161977 __17:
 161978 	;
 161979 	if !(pPrimaryKey != 0) {
 161980 		goto __18
 161981 	}
 161982 	*(*int32)(unsafe.Pointer(pPrimaryKey)) = primarykey
 161983 __18:
 161984 	;
 161985 	if !(pAutoinc != 0) {
 161986 		goto __19
 161987 	}
 161988 	*(*int32)(unsafe.Pointer(pAutoinc)) = autoinc
 161989 __19:
 161990 	;
 161991 	if !(SQLITE_OK == rc && !(pTab != 0)) {
 161992 		goto __20
 161993 	}
 161994 	Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 24)))
 161995 	*(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3MPrintf(tls, db, ts+25851, libc.VaList(bp, zTableName,
 161996 		zColumnName))
 161997 	rc = SQLITE_ERROR
 161998 __20:
 161999 	;
 162000 	Xsqlite3ErrorWithMsg(tls, db, rc, func() uintptr {
 162001 		if *(*uintptr)(unsafe.Pointer(bp + 24)) != 0 {
 162002 			return ts + 4493
 162003 		}
 162004 		return uintptr(0)
 162005 	}(), libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp + 24))))
 162006 	Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 24)))
 162007 	rc = Xsqlite3ApiExit(tls, db, rc)
 162008 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 162009 	return rc
 162010 }
 162011 
 162012 // Sleep for a little while.  Return the amount of time slept.
 162013 func Xsqlite3_sleep(tls *libc.TLS, ms int32) int32 {
 162014 	var pVfs uintptr
 162015 	var rc int32
 162016 	pVfs = Xsqlite3_vfs_find(tls, uintptr(0))
 162017 	if pVfs == uintptr(0) {
 162018 		return 0
 162019 	}
 162020 
 162021 	rc = Xsqlite3OsSleep(tls, pVfs, 1000*ms) / 1000
 162022 	return rc
 162023 }
 162024 
 162025 // Enable or disable the extended result codes.
 162026 func Xsqlite3_extended_result_codes(tls *libc.TLS, db uintptr, onoff int32) int32 {
 162027 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 162028 	(*Sqlite3)(unsafe.Pointer(db)).FerrMask = func() int32 {
 162029 		if onoff != 0 {
 162030 			return libc.Int32FromUint32(0xffffffff)
 162031 		}
 162032 		return 0xff
 162033 	}()
 162034 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 162035 	return SQLITE_OK
 162036 }
 162037 
 162038 // Invoke the xFileControl method on a particular database.
 162039 func Xsqlite3_file_control(tls *libc.TLS, db uintptr, zDbName uintptr, op int32, pArg uintptr) int32 {
 162040 	var rc int32 = SQLITE_ERROR
 162041 	var pBtree uintptr
 162042 
 162043 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 162044 	pBtree = Xsqlite3DbNameToBtree(tls, db, zDbName)
 162045 	if pBtree != 0 {
 162046 		var pPager uintptr
 162047 		var fd uintptr
 162048 		Xsqlite3BtreeEnter(tls, pBtree)
 162049 		pPager = Xsqlite3BtreePager(tls, pBtree)
 162050 
 162051 		fd = Xsqlite3PagerFile(tls, pPager)
 162052 
 162053 		if op == SQLITE_FCNTL_FILE_POINTER {
 162054 			*(*uintptr)(unsafe.Pointer(pArg)) = fd
 162055 			rc = SQLITE_OK
 162056 		} else if op == SQLITE_FCNTL_VFS_POINTER {
 162057 			*(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3PagerVfs(tls, pPager)
 162058 			rc = SQLITE_OK
 162059 		} else if op == SQLITE_FCNTL_JOURNAL_POINTER {
 162060 			*(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3PagerJrnlFile(tls, pPager)
 162061 			rc = SQLITE_OK
 162062 		} else if op == SQLITE_FCNTL_DATA_VERSION {
 162063 			*(*uint32)(unsafe.Pointer(pArg)) = Xsqlite3PagerDataVersion(tls, pPager)
 162064 			rc = SQLITE_OK
 162065 		} else if op == SQLITE_FCNTL_RESERVE_BYTES {
 162066 			var iNew int32 = *(*int32)(unsafe.Pointer(pArg))
 162067 			*(*int32)(unsafe.Pointer(pArg)) = Xsqlite3BtreeGetRequestedReserve(tls, pBtree)
 162068 			if iNew >= 0 && iNew <= 255 {
 162069 				Xsqlite3BtreeSetPageSize(tls, pBtree, 0, iNew, 0)
 162070 			}
 162071 			rc = SQLITE_OK
 162072 		} else if op == SQLITE_FCNTL_RESET_CACHE {
 162073 			Xsqlite3BtreeClearCache(tls, pBtree)
 162074 			rc = SQLITE_OK
 162075 		} else {
 162076 			var nSave int32 = (*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy
 162077 			rc = Xsqlite3OsFileControl(tls, fd, op, pArg)
 162078 			(*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = nSave
 162079 		}
 162080 		Xsqlite3BtreeLeave(tls, pBtree)
 162081 	}
 162082 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 162083 	return rc
 162084 }
 162085 
 162086 // Interface to the testing logic.
 162087 func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 {
 162088 	var rc int32 = 0
 162089 	var ap Va_list
 162090 	_ = ap
 162091 	ap = va
 162092 	switch op {
 162093 	case SQLITE_TESTCTRL_PRNG_SAVE:
 162094 		{
 162095 			Xsqlite3PrngSaveState(tls)
 162096 			break
 162097 
 162098 		}
 162099 
 162100 	case SQLITE_TESTCTRL_PRNG_RESTORE:
 162101 		{
 162102 			Xsqlite3PrngRestoreState(tls)
 162103 			break
 162104 
 162105 		}
 162106 
 162107 	case SQLITE_TESTCTRL_PRNG_SEED:
 162108 		{
 162109 			var x int32 = libc.VaInt32(&ap)
 162110 			var y int32
 162111 			var db uintptr = libc.VaUintptr(&ap)
 162112 
 162113 			if db != 0 && libc.AssignInt32(&y, (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema)).Fschema_cookie) != 0 {
 162114 				x = y
 162115 			}
 162116 			Xsqlite3Config.FiPrngSeed = uint32(x)
 162117 			Xsqlite3_randomness(tls, 0, uintptr(0))
 162118 			break
 162119 
 162120 		}
 162121 
 162122 	case SQLITE_TESTCTRL_BITVEC_TEST:
 162123 		{
 162124 			var sz int32 = libc.VaInt32(&ap)
 162125 			var aProg uintptr = libc.VaUintptr(&ap)
 162126 			rc = Xsqlite3BitvecBuiltinTest(tls, sz, aProg)
 162127 			break
 162128 
 162129 		}
 162130 
 162131 	case SQLITE_TESTCTRL_FAULT_INSTALL:
 162132 		{
 162133 			Xsqlite3Config.FxTestCallback = libc.VaUintptr(&ap)
 162134 			rc = Xsqlite3FaultSim(tls, 0)
 162135 			break
 162136 
 162137 		}
 162138 
 162139 	case SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS:
 162140 		{
 162141 			var xBenignBegin uintptr
 162142 			var xBenignEnd uintptr
 162143 			xBenignBegin = libc.VaUintptr(&ap)
 162144 			xBenignEnd = libc.VaUintptr(&ap)
 162145 			Xsqlite3BenignMallocHooks(tls, xBenignBegin, xBenignEnd)
 162146 			break
 162147 
 162148 		}
 162149 
 162150 	case SQLITE_TESTCTRL_PENDING_BYTE:
 162151 		{
 162152 			rc = Xsqlite3PendingByte
 162153 			{
 162154 				var newVal uint32 = libc.VaUint32(&ap)
 162155 				if newVal != 0 {
 162156 					Xsqlite3PendingByte = int32(newVal)
 162157 				}
 162158 
 162159 			}
 162160 			break
 162161 
 162162 		}
 162163 
 162164 	case SQLITE_TESTCTRL_ASSERT:
 162165 		{
 162166 			var x int32 = 0
 162167 
 162168 			rc = x
 162169 			break
 162170 
 162171 		}
 162172 
 162173 	case SQLITE_TESTCTRL_ALWAYS:
 162174 		{
 162175 			var x int32 = libc.VaInt32(&ap)
 162176 			if x != 0 {
 162177 				rc = x
 162178 			} else {
 162179 				rc = 0
 162180 			}
 162181 			break
 162182 
 162183 		}
 162184 
 162185 	case SQLITE_TESTCTRL_BYTEORDER:
 162186 		{
 162187 			rc = SQLITE_BYTEORDER*100 + SQLITE_LITTLEENDIAN*10 + SQLITE_BIGENDIAN
 162188 			break
 162189 
 162190 		}
 162191 
 162192 	case SQLITE_TESTCTRL_OPTIMIZATIONS:
 162193 		{
 162194 			var db uintptr = libc.VaUintptr(&ap)
 162195 			(*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags = libc.VaUint32(&ap)
 162196 			break
 162197 
 162198 		}
 162199 
 162200 	case SQLITE_TESTCTRL_LOCALTIME_FAULT:
 162201 		{
 162202 			Xsqlite3Config.FbLocaltimeFault = libc.VaInt32(&ap)
 162203 			if Xsqlite3Config.FbLocaltimeFault == 2 {
 162204 				Xsqlite3Config.FxAltLocaltime = libc.VaUintptr(&ap)
 162205 			} else {
 162206 				Xsqlite3Config.FxAltLocaltime = uintptr(0)
 162207 			}
 162208 			break
 162209 
 162210 		}
 162211 
 162212 	case SQLITE_TESTCTRL_INTERNAL_FUNCTIONS:
 162213 		{
 162214 			var db uintptr = libc.VaUintptr(&ap)
 162215 			*(*U32)(unsafe.Pointer(db + 44)) ^= U32(DBFLAG_InternalFunc)
 162216 			break
 162217 
 162218 		}
 162219 
 162220 	case SQLITE_TESTCTRL_NEVER_CORRUPT:
 162221 		{
 162222 			Xsqlite3Config.FneverCorrupt = libc.VaInt32(&ap)
 162223 			break
 162224 
 162225 		}
 162226 
 162227 	case SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS:
 162228 		{
 162229 			Xsqlite3Config.FbExtraSchemaChecks = U8(libc.VaInt32(&ap))
 162230 			break
 162231 
 162232 		}
 162233 
 162234 	case SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD:
 162235 		{
 162236 			Xsqlite3Config.FiOnceResetThreshold = libc.VaInt32(&ap)
 162237 			break
 162238 
 162239 		}
 162240 
 162241 	case SQLITE_TESTCTRL_VDBE_COVERAGE:
 162242 		{
 162243 			break
 162244 
 162245 		}
 162246 
 162247 	case SQLITE_TESTCTRL_SORTER_MMAP:
 162248 		{
 162249 			var db uintptr = libc.VaUintptr(&ap)
 162250 			(*Sqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap = libc.VaInt32(&ap)
 162251 			break
 162252 
 162253 		}
 162254 
 162255 	case SQLITE_TESTCTRL_ISINIT:
 162256 		{
 162257 			if Xsqlite3Config.FisInit == 0 {
 162258 				rc = SQLITE_ERROR
 162259 			}
 162260 			break
 162261 
 162262 		}
 162263 
 162264 	case SQLITE_TESTCTRL_IMPOSTER:
 162265 		{
 162266 			var db uintptr = libc.VaUintptr(&ap)
 162267 			var iDb int32
 162268 			Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 162269 			iDb = Xsqlite3FindDbName(tls, db, libc.VaUintptr(&ap))
 162270 			if iDb >= 0 {
 162271 				(*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(iDb)
 162272 				(*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(libc.AssignBitFieldPtr8Uint32(db+192+8, uint32(libc.VaInt32(&ap)), 1, 1, 0x2))
 162273 				(*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum = Pgno(libc.VaInt32(&ap))
 162274 				if int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0 && (*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum > Pgno(0) {
 162275 					Xsqlite3ResetAllSchemasOfConnection(tls, db)
 162276 				}
 162277 			}
 162278 			Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 162279 			break
 162280 
 162281 		}
 162282 
 162283 	case SQLITE_TESTCTRL_RESULT_INTREAL:
 162284 		{
 162285 			var pCtx uintptr = libc.VaUintptr(&ap)
 162286 			Xsqlite3ResultIntReal(tls, pCtx)
 162287 			break
 162288 
 162289 		}
 162290 
 162291 	case SQLITE_TESTCTRL_SEEK_COUNT:
 162292 		{
 162293 			var db uintptr = libc.VaUintptr(&ap)
 162294 			_ = db
 162295 			var pn uintptr = libc.VaUintptr(&ap)
 162296 			*(*U64)(unsafe.Pointer(pn)) = uint64(0)
 162297 			_ = db
 162298 			break
 162299 
 162300 		}
 162301 
 162302 	case SQLITE_TESTCTRL_TRACEFLAGS:
 162303 		{
 162304 			var opTrace int32 = libc.VaInt32(&ap)
 162305 			var ptr uintptr = libc.VaUintptr(&ap)
 162306 			switch opTrace {
 162307 			case 0:
 162308 				*(*U32)(unsafe.Pointer(ptr)) = Xsqlite3TreeTrace
 162309 				break
 162310 			case 1:
 162311 				Xsqlite3TreeTrace = *(*U32)(unsafe.Pointer(ptr))
 162312 				break
 162313 			case 2:
 162314 				*(*U32)(unsafe.Pointer(ptr)) = Xsqlite3WhereTrace
 162315 				break
 162316 			case 3:
 162317 				Xsqlite3WhereTrace = *(*U32)(unsafe.Pointer(ptr))
 162318 				break
 162319 			}
 162320 			break
 162321 
 162322 		}
 162323 
 162324 	case SQLITE_TESTCTRL_LOGEST:
 162325 		{
 162326 			var rIn float64 = libc.VaFloat64(&ap)
 162327 			var rLogEst LogEst = Xsqlite3LogEstFromDouble(tls, rIn)
 162328 			var pI1 uintptr = libc.VaUintptr(&ap)
 162329 			var pU64 uintptr = libc.VaUintptr(&ap)
 162330 			var pI2 uintptr = libc.VaUintptr(&ap)
 162331 			*(*int32)(unsafe.Pointer(pI1)) = int32(rLogEst)
 162332 			*(*U64)(unsafe.Pointer(pU64)) = Xsqlite3LogEstToInt(tls, rLogEst)
 162333 			*(*int32)(unsafe.Pointer(pI2)) = int32(Xsqlite3LogEst(tls, *(*U64)(unsafe.Pointer(pU64))))
 162334 			break
 162335 
 162336 		}
 162337 
 162338 	}
 162339 	_ = ap
 162340 	return rc
 162341 }
 162342 
 162343 func databaseName(tls *libc.TLS, zName uintptr) uintptr {
 162344 	for int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-1)))) != 0 || int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-2)))) != 0 || int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-3)))) != 0 || int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-4)))) != 0 {
 162345 		zName--
 162346 	}
 162347 	return zName
 162348 }
 162349 
 162350 func appendText(tls *libc.TLS, p uintptr, z uintptr) uintptr {
 162351 	var n Size_t = libc.Xstrlen(tls, z)
 162352 	libc.Xmemcpy(tls, p, z, n+uint64(1))
 162353 	return p + uintptr(n) + uintptr(1)
 162354 }
 162355 
 162356 // Allocate memory to hold names for a database, journal file, WAL file,
 162357 // and query parameters.  The pointer returned is valid for use by
 162358 // sqlite3_filename_database() and sqlite3_uri_parameter() and related
 162359 // functions.
 162360 //
 162361 // Memory layout must be compatible with that generated by the pager
 162362 // and expected by sqlite3_uri_parameter() and databaseName().
 162363 func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr, zWal uintptr, nParam int32, azParam uintptr) uintptr {
 162364 	var nByte Sqlite3_int64
 162365 	var i int32
 162366 	var pResult uintptr
 162367 	var p uintptr
 162368 	nByte = Sqlite3_int64(libc.Xstrlen(tls, zDatabase) + libc.Xstrlen(tls, zJournal) + libc.Xstrlen(tls, zWal) + uint64(10))
 162369 	for i = 0; i < nParam*2; i++ {
 162370 		nByte = Sqlite3_int64(Size_t(nByte) + (libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8))) + uint64(1)))
 162371 	}
 162372 	pResult = libc.AssignUintptr(&p, Xsqlite3_malloc64(tls, uint64(nByte)))
 162373 	if p == uintptr(0) {
 162374 		return uintptr(0)
 162375 	}
 162376 	libc.Xmemset(tls, p, 0, uint64(4))
 162377 	p += uintptr(4)
 162378 	p = appendText(tls, p, zDatabase)
 162379 	for i = 0; i < nParam*2; i++ {
 162380 		p = appendText(tls, p, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8)))
 162381 	}
 162382 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = int8(0)
 162383 	p = appendText(tls, p, zJournal)
 162384 	p = appendText(tls, p, zWal)
 162385 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = int8(0)
 162386 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = int8(0)
 162387 
 162388 	return pResult + uintptr(4)
 162389 }
 162390 
 162391 // Free memory obtained from sqlite3_create_filename().  It is a severe
 162392 // error to call this routine with any parameter other than a pointer
 162393 // previously obtained from sqlite3_create_filename() or a NULL pointer.
 162394 func Xsqlite3_free_filename(tls *libc.TLS, p uintptr) {
 162395 	if p == uintptr(0) {
 162396 		return
 162397 	}
 162398 	p = databaseName(tls, p)
 162399 	Xsqlite3_free(tls, p-uintptr(4))
 162400 }
 162401 
 162402 // This is a utility routine, useful to VFS implementations, that checks
 162403 // to see if a database file was a URI that contained a specific query
 162404 // parameter, and if so obtains the value of the query parameter.
 162405 //
 162406 // The zFilename argument is the filename pointer passed into the xOpen()
 162407 // method of a VFS implementation.  The zParam argument is the name of the
 162408 // query parameter we seek.  This routine returns the value of the zParam
 162409 // parameter if it exists.  If the parameter does not exist, this routine
 162410 // returns a NULL pointer.
 162411 func Xsqlite3_uri_parameter(tls *libc.TLS, zFilename uintptr, zParam uintptr) uintptr {
 162412 	if zFilename == uintptr(0) || zParam == uintptr(0) {
 162413 		return uintptr(0)
 162414 	}
 162415 	zFilename = databaseName(tls, zFilename)
 162416 	return uriParameter(tls, zFilename, zParam)
 162417 }
 162418 
 162419 // Return a pointer to the name of Nth query parameter of the filename.
 162420 func Xsqlite3_uri_key(tls *libc.TLS, zFilename uintptr, N int32) uintptr {
 162421 	if zFilename == uintptr(0) || N < 0 {
 162422 		return uintptr(0)
 162423 	}
 162424 	zFilename = databaseName(tls, zFilename)
 162425 	zFilename += uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)
 162426 	for zFilename != 0 && *(*int8)(unsafe.Pointer(zFilename)) != 0 && libc.PostDecInt32(&N, 1) > 0 {
 162427 		zFilename += uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)
 162428 		zFilename += uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)
 162429 	}
 162430 	if *(*int8)(unsafe.Pointer(zFilename)) != 0 {
 162431 		return zFilename
 162432 	}
 162433 	return uintptr(0)
 162434 }
 162435 
 162436 // Return a boolean value for a query parameter.
 162437 func Xsqlite3_uri_boolean(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDflt int32) int32 {
 162438 	var z uintptr = Xsqlite3_uri_parameter(tls, zFilename, zParam)
 162439 	bDflt = libc.Bool32(bDflt != 0)
 162440 	if z != 0 {
 162441 		return int32(Xsqlite3GetBoolean(tls, z, uint8(bDflt)))
 162442 	}
 162443 	return bDflt
 162444 }
 162445 
 162446 // Return a 64-bit integer value for a query parameter.
 162447 func Xsqlite3_uri_int64(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDflt Sqlite3_int64) Sqlite3_int64 {
 162448 	bp := tls.Alloc(8)
 162449 	defer tls.Free(8)
 162450 
 162451 	var z uintptr = Xsqlite3_uri_parameter(tls, zFilename, zParam)
 162452 
 162453 	if z != 0 && Xsqlite3DecOrHexToI64(tls, z, bp) == 0 {
 162454 		bDflt = *(*Sqlite3_int64)(unsafe.Pointer(bp))
 162455 	}
 162456 	return bDflt
 162457 }
 162458 
 162459 // Translate a filename that was handed to a VFS routine into the corresponding
 162460 // database, journal, or WAL file.
 162461 //
 162462 // It is an error to pass this routine a filename string that was not
 162463 // passed into the VFS from the SQLite core.  Doing so is similar to
 162464 // passing free() a pointer that was not obtained from malloc() - it is
 162465 // an error that we cannot easily detect but that will likely cause memory
 162466 // corruption.
 162467 func Xsqlite3_filename_database(tls *libc.TLS, zFilename uintptr) uintptr {
 162468 	if zFilename == uintptr(0) {
 162469 		return uintptr(0)
 162470 	}
 162471 	return databaseName(tls, zFilename)
 162472 }
 162473 
 162474 func Xsqlite3_filename_journal(tls *libc.TLS, zFilename uintptr) uintptr {
 162475 	if zFilename == uintptr(0) {
 162476 		return uintptr(0)
 162477 	}
 162478 	zFilename = databaseName(tls, zFilename)
 162479 	zFilename += uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)
 162480 	for zFilename != 0 && *(*int8)(unsafe.Pointer(zFilename)) != 0 {
 162481 		zFilename += uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)
 162482 		zFilename += uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)
 162483 	}
 162484 	return zFilename + uintptr(1)
 162485 }
 162486 
 162487 func Xsqlite3_filename_wal(tls *libc.TLS, zFilename uintptr) uintptr {
 162488 	zFilename = Xsqlite3_filename_journal(tls, zFilename)
 162489 	if zFilename != 0 {
 162490 		zFilename += uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)
 162491 	}
 162492 	return zFilename
 162493 }
 162494 
 162495 // Return the Btree pointer identified by zDbName.  Return NULL if not found.
 162496 func Xsqlite3DbNameToBtree(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr {
 162497 	var iDb int32
 162498 	if zDbName != 0 {
 162499 		iDb = Xsqlite3FindDbName(tls, db, zDbName)
 162500 	} else {
 162501 		iDb = 0
 162502 	}
 162503 	if iDb < 0 {
 162504 		return uintptr(0)
 162505 	}
 162506 	return (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpBt
 162507 }
 162508 
 162509 // Return the name of the N-th database schema.  Return NULL if N is out
 162510 // of range.
 162511 func Xsqlite3_db_name(tls *libc.TLS, db uintptr, N int32) uintptr {
 162512 	if N < 0 || N >= (*Sqlite3)(unsafe.Pointer(db)).FnDb {
 162513 		return uintptr(0)
 162514 	} else {
 162515 		return (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(N)*32)).FzDbSName
 162516 	}
 162517 	return uintptr(0)
 162518 }
 162519 
 162520 // Return the filename of the database associated with a database
 162521 // connection.
 162522 func Xsqlite3_db_filename(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr {
 162523 	var pBt uintptr
 162524 	pBt = Xsqlite3DbNameToBtree(tls, db, zDbName)
 162525 	if pBt != 0 {
 162526 		return Xsqlite3BtreeGetFilename(tls, pBt)
 162527 	}
 162528 	return uintptr(0)
 162529 }
 162530 
 162531 // Return 1 if database is read-only or 0 if read/write.  Return -1 if
 162532 // no such database exists.
 162533 func Xsqlite3_db_readonly(tls *libc.TLS, db uintptr, zDbName uintptr) int32 {
 162534 	var pBt uintptr
 162535 	pBt = Xsqlite3DbNameToBtree(tls, db, zDbName)
 162536 	if pBt != 0 {
 162537 		return Xsqlite3BtreeIsReadonly(tls, pBt)
 162538 	}
 162539 	return -1
 162540 }
 162541 
 162542 // Obtain a snapshot handle for the snapshot of database zDb currently
 162543 // being read by handle db.
 162544 func Xsqlite3_snapshot_get(tls *libc.TLS, db uintptr, zDb uintptr, ppSnapshot uintptr) int32 {
 162545 	var rc int32 = SQLITE_ERROR
 162546 
 162547 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 162548 
 162549 	if int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) == 0 {
 162550 		var iDb int32 = Xsqlite3FindDbName(tls, db, zDb)
 162551 		if iDb == 0 || iDb > 1 {
 162552 			var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpBt
 162553 			if SQLITE_TXN_WRITE != Xsqlite3BtreeTxnState(tls, pBt) {
 162554 				rc = Xsqlite3BtreeBeginTrans(tls, pBt, 0, uintptr(0))
 162555 				if rc == SQLITE_OK {
 162556 					rc = Xsqlite3PagerSnapshotGet(tls, Xsqlite3BtreePager(tls, pBt), ppSnapshot)
 162557 				}
 162558 			}
 162559 		}
 162560 	}
 162561 
 162562 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 162563 	return rc
 162564 }
 162565 
 162566 // Open a read-transaction on the snapshot idendified by pSnapshot.
 162567 func Xsqlite3_snapshot_open(tls *libc.TLS, db uintptr, zDb uintptr, pSnapshot uintptr) int32 {
 162568 	var rc int32 = SQLITE_ERROR
 162569 
 162570 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 162571 	if int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) == 0 {
 162572 		var iDb int32
 162573 		iDb = Xsqlite3FindDbName(tls, db, zDb)
 162574 		if iDb == 0 || iDb > 1 {
 162575 			var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpBt
 162576 			if Xsqlite3BtreeTxnState(tls, pBt) != SQLITE_TXN_WRITE {
 162577 				var pPager uintptr = Xsqlite3BtreePager(tls, pBt)
 162578 				var bUnlock int32 = 0
 162579 				if Xsqlite3BtreeTxnState(tls, pBt) != SQLITE_TXN_NONE {
 162580 					if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive == 0 {
 162581 						rc = Xsqlite3PagerSnapshotCheck(tls, pPager, pSnapshot)
 162582 						if rc == SQLITE_OK {
 162583 							bUnlock = 1
 162584 							rc = Xsqlite3BtreeCommit(tls, pBt)
 162585 						}
 162586 					}
 162587 				} else {
 162588 					rc = SQLITE_OK
 162589 				}
 162590 				if rc == SQLITE_OK {
 162591 					rc = Xsqlite3PagerSnapshotOpen(tls, pPager, pSnapshot)
 162592 				}
 162593 				if rc == SQLITE_OK {
 162594 					rc = Xsqlite3BtreeBeginTrans(tls, pBt, 0, uintptr(0))
 162595 					Xsqlite3PagerSnapshotOpen(tls, pPager, uintptr(0))
 162596 				}
 162597 				if bUnlock != 0 {
 162598 					Xsqlite3PagerSnapshotUnlock(tls, pPager)
 162599 				}
 162600 			}
 162601 		}
 162602 	}
 162603 
 162604 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 162605 	return rc
 162606 }
 162607 
 162608 // Recover as many snapshots as possible from the wal file associated with
 162609 // schema zDb of database db.
 162610 func Xsqlite3_snapshot_recover(tls *libc.TLS, db uintptr, zDb uintptr) int32 {
 162611 	var rc int32 = SQLITE_ERROR
 162612 	var iDb int32
 162613 
 162614 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 162615 	iDb = Xsqlite3FindDbName(tls, db, zDb)
 162616 	if iDb == 0 || iDb > 1 {
 162617 		var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpBt
 162618 		if SQLITE_TXN_NONE == Xsqlite3BtreeTxnState(tls, pBt) {
 162619 			rc = Xsqlite3BtreeBeginTrans(tls, pBt, 0, uintptr(0))
 162620 			if rc == SQLITE_OK {
 162621 				rc = Xsqlite3PagerSnapshotRecover(tls, Xsqlite3BtreePager(tls, pBt))
 162622 				Xsqlite3BtreeCommit(tls, pBt)
 162623 			}
 162624 		}
 162625 	}
 162626 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 162627 	return rc
 162628 }
 162629 
 162630 // Free a snapshot handle obtained from sqlite3_snapshot_get().
 162631 func Xsqlite3_snapshot_free(tls *libc.TLS, pSnapshot uintptr) {
 162632 	Xsqlite3_free(tls, pSnapshot)
 162633 }
 162634 
 162635 // Given the name of a compile-time option, return true if that option
 162636 // was used and false if not.
 162637 //
 162638 // The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix
 162639 // is not required for a match.
 162640 func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) int32 {
 162641 	bp := tls.Alloc(4)
 162642 	defer tls.Free(4)
 162643 
 162644 	var i int32
 162645 	var n int32
 162646 
 162647 	var azCompileOpt uintptr
 162648 
 162649 	azCompileOpt = Xsqlite3CompileOptions(tls, bp)
 162650 
 162651 	if Xsqlite3_strnicmp(tls, zOptName, ts+25879, 7) == 0 {
 162652 		zOptName += uintptr(7)
 162653 	}
 162654 	n = Xsqlite3Strlen30(tls, zOptName)
 162655 
 162656 	for i = 0; i < *(*int32)(unsafe.Pointer(bp)); i++ {
 162657 		if Xsqlite3_strnicmp(tls, zOptName, *(*uintptr)(unsafe.Pointer(azCompileOpt + uintptr(i)*8)), n) == 0 &&
 162658 			Xsqlite3IsIdChar(tls, uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(azCompileOpt + uintptr(i)*8)) + uintptr(n))))) == 0 {
 162659 			return 1
 162660 		}
 162661 	}
 162662 	return 0
 162663 }
 162664 
 162665 // Return the N-th compile-time option string.  If N is out of range,
 162666 // return a NULL pointer.
 162667 func Xsqlite3_compileoption_get(tls *libc.TLS, N int32) uintptr {
 162668 	bp := tls.Alloc(4)
 162669 	defer tls.Free(4)
 162670 
 162671 	var azCompileOpt uintptr
 162672 	azCompileOpt = Xsqlite3CompileOptions(tls, bp)
 162673 	if N >= 0 && N < *(*int32)(unsafe.Pointer(bp)) {
 162674 		return *(*uintptr)(unsafe.Pointer(azCompileOpt + uintptr(N)*8))
 162675 	}
 162676 	return uintptr(0)
 162677 }
 162678 
 162679 var sqlite3BlockedList uintptr = uintptr(0)
 162680 
 162681 func removeFromBlockedList(tls *libc.TLS, db uintptr) {
 162682 	var pp uintptr
 162683 
 162684 	for pp = uintptr(unsafe.Pointer(&sqlite3BlockedList)); *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = *(*uintptr)(unsafe.Pointer(pp)) + 840 {
 162685 		if *(*uintptr)(unsafe.Pointer(pp)) == db {
 162686 			*(*uintptr)(unsafe.Pointer(pp)) = (*Sqlite3)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FpNextBlocked
 162687 			break
 162688 		}
 162689 	}
 162690 }
 162691 
 162692 func addToBlockedList(tls *libc.TLS, db uintptr) {
 162693 	var pp uintptr
 162694 
 162695 	for pp = uintptr(unsafe.Pointer(&sqlite3BlockedList)); *(*uintptr)(unsafe.Pointer(pp)) != 0 && (*Sqlite3)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FxUnlockNotify != (*Sqlite3)(unsafe.Pointer(db)).FxUnlockNotify; pp = *(*uintptr)(unsafe.Pointer(pp)) + 840 {
 162696 	}
 162697 	(*Sqlite3)(unsafe.Pointer(db)).FpNextBlocked = *(*uintptr)(unsafe.Pointer(pp))
 162698 	*(*uintptr)(unsafe.Pointer(pp)) = db
 162699 }
 162700 
 162701 func enterMutex(tls *libc.TLS) {
 162702 	Xsqlite3_mutex_enter(tls, Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN))
 162703 
 162704 }
 162705 
 162706 func leaveMutex(tls *libc.TLS) {
 162707 	Xsqlite3_mutex_leave(tls, Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN))
 162708 }
 162709 
 162710 // Register an unlock-notify callback.
 162711 //
 162712 // This is called after connection "db" has attempted some operation
 162713 // but has received an SQLITE_LOCKED error because another connection
 162714 // (call it pOther) in the same process was busy using the same shared
 162715 // cache.  pOther is found by looking at db->pBlockingConnection.
 162716 //
 162717 // If there is no blocking connection, the callback is invoked immediately,
 162718 // before this routine returns.
 162719 //
 162720 // If pOther is already blocked on db, then report SQLITE_LOCKED, to indicate
 162721 // a deadlock.
 162722 //
 162723 // Otherwise, make arrangements to invoke xNotify when pOther drops
 162724 // its locks.
 162725 //
 162726 // Each call to this routine overrides any prior callbacks registered
 162727 // on the same "db".  If xNotify==0 then any prior callbacks are immediately
 162728 // cancelled.
 162729 func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, pArg uintptr) int32 {
 162730 	bp := tls.Alloc(8)
 162731 	defer tls.Free(8)
 162732 	*(*uintptr)(unsafe.Pointer(bp)) = pArg
 162733 
 162734 	var rc int32 = SQLITE_OK
 162735 
 162736 	Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 162737 	enterMutex(tls)
 162738 
 162739 	if xNotify == uintptr(0) {
 162740 		removeFromBlockedList(tls, db)
 162741 		(*Sqlite3)(unsafe.Pointer(db)).FpBlockingConnection = uintptr(0)
 162742 		(*Sqlite3)(unsafe.Pointer(db)).FpUnlockConnection = uintptr(0)
 162743 		(*Sqlite3)(unsafe.Pointer(db)).FxUnlockNotify = uintptr(0)
 162744 		(*Sqlite3)(unsafe.Pointer(db)).FpUnlockArg = uintptr(0)
 162745 	} else if uintptr(0) == (*Sqlite3)(unsafe.Pointer(db)).FpBlockingConnection {
 162746 		(*struct {
 162747 			f func(*libc.TLS, uintptr, int32)
 162748 		})(unsafe.Pointer(&struct{ uintptr }{xNotify})).f(tls, bp, 1)
 162749 	} else {
 162750 		var p uintptr
 162751 
 162752 		for p = (*Sqlite3)(unsafe.Pointer(db)).FpBlockingConnection; p != 0 && p != db; p = (*Sqlite3)(unsafe.Pointer(p)).FpUnlockConnection {
 162753 		}
 162754 		if p != 0 {
 162755 			rc = SQLITE_LOCKED
 162756 		} else {
 162757 			(*Sqlite3)(unsafe.Pointer(db)).FpUnlockConnection = (*Sqlite3)(unsafe.Pointer(db)).FpBlockingConnection
 162758 			(*Sqlite3)(unsafe.Pointer(db)).FxUnlockNotify = xNotify
 162759 			(*Sqlite3)(unsafe.Pointer(db)).FpUnlockArg = *(*uintptr)(unsafe.Pointer(bp))
 162760 			removeFromBlockedList(tls, db)
 162761 			addToBlockedList(tls, db)
 162762 		}
 162763 	}
 162764 
 162765 	leaveMutex(tls)
 162766 
 162767 	Xsqlite3ErrorWithMsg(tls, db, rc, func() uintptr {
 162768 		if rc != 0 {
 162769 			return ts + 25887
 162770 		}
 162771 		return uintptr(0)
 162772 	}(), 0)
 162773 	Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
 162774 	return rc
 162775 }
 162776 
 162777 // This function is called while stepping or preparing a statement
 162778 // associated with connection db. The operation will return SQLITE_LOCKED
 162779 // to the user because it requires a lock that will not be available
 162780 // until connection pBlocker concludes its current transaction.
 162781 func Xsqlite3ConnectionBlocked(tls *libc.TLS, db uintptr, pBlocker uintptr) {
 162782 	enterMutex(tls)
 162783 	if (*Sqlite3)(unsafe.Pointer(db)).FpBlockingConnection == uintptr(0) && (*Sqlite3)(unsafe.Pointer(db)).FpUnlockConnection == uintptr(0) {
 162784 		addToBlockedList(tls, db)
 162785 	}
 162786 	(*Sqlite3)(unsafe.Pointer(db)).FpBlockingConnection = pBlocker
 162787 	leaveMutex(tls)
 162788 }
 162789 
 162790 // This function is called when
 162791 // the transaction opened by database db has just finished. Locks held
 162792 // by database connection db have been released.
 162793 //
 162794 // This function loops through each entry in the blocked connections
 162795 // list and does the following:
 162796 //
 162797 //  1. If the sqlite3.pBlockingConnection member of a list entry is
 162798 //     set to db, then set pBlockingConnection=0.
 162799 //
 162800 //  2. If the sqlite3.pUnlockConnection member of a list entry is
 162801 //     set to db, then invoke the configured unlock-notify callback and
 162802 //     set pUnlockConnection=0.
 162803 //
 162804 //  3. If the two steps above mean that pBlockingConnection==0 and
 162805 //     pUnlockConnection==0, remove the entry from the blocked connections
 162806 //     list.
 162807 func Xsqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) {
 162808 	bp := tls.Alloc(128)
 162809 	defer tls.Free(128)
 162810 
 162811 	var xUnlockNotify uintptr = uintptr(0)
 162812 	var nArg int32 = 0
 162813 	var pp uintptr
 162814 	var aArg uintptr
 162815 	var aDyn uintptr = uintptr(0)
 162816 
 162817 	aArg = bp
 162818 	enterMutex(tls)
 162819 
 162820 	for pp = uintptr(unsafe.Pointer(&sqlite3BlockedList)); *(*uintptr)(unsafe.Pointer(pp)) != 0; {
 162821 		var p uintptr = *(*uintptr)(unsafe.Pointer(pp))
 162822 
 162823 		if (*Sqlite3)(unsafe.Pointer(p)).FpBlockingConnection == db {
 162824 			(*Sqlite3)(unsafe.Pointer(p)).FpBlockingConnection = uintptr(0)
 162825 		}
 162826 
 162827 		if (*Sqlite3)(unsafe.Pointer(p)).FpUnlockConnection == db {
 162828 			if (*Sqlite3)(unsafe.Pointer(p)).FxUnlockNotify != xUnlockNotify && nArg != 0 {
 162829 				(*struct {
 162830 					f func(*libc.TLS, uintptr, int32)
 162831 				})(unsafe.Pointer(&struct{ uintptr }{xUnlockNotify})).f(tls, aArg, nArg)
 162832 				nArg = 0
 162833 			}
 162834 
 162835 			Xsqlite3BeginBenignMalloc(tls)
 162836 
 162837 			if !(aDyn != 0) && nArg == int32(uint64(unsafe.Sizeof([16]uintptr{}))/uint64(unsafe.Sizeof(uintptr(0)))) ||
 162838 				aDyn != 0 && nArg == int32(uint64(Xsqlite3MallocSize(tls, aDyn))/uint64(unsafe.Sizeof(uintptr(0)))) {
 162839 				var pNew uintptr = Xsqlite3Malloc(tls, uint64(nArg)*uint64(unsafe.Sizeof(uintptr(0)))*uint64(2))
 162840 				if pNew != 0 {
 162841 					libc.Xmemcpy(tls, pNew, aArg, uint64(nArg)*uint64(unsafe.Sizeof(uintptr(0))))
 162842 					Xsqlite3_free(tls, aDyn)
 162843 					aDyn = libc.AssignUintptr(&aArg, pNew)
 162844 				} else {
 162845 					(*struct {
 162846 						f func(*libc.TLS, uintptr, int32)
 162847 					})(unsafe.Pointer(&struct{ uintptr }{xUnlockNotify})).f(tls, aArg, nArg)
 162848 					nArg = 0
 162849 				}
 162850 			}
 162851 			Xsqlite3EndBenignMalloc(tls)
 162852 
 162853 			*(*uintptr)(unsafe.Pointer(aArg + uintptr(libc.PostIncInt32(&nArg, 1))*8)) = (*Sqlite3)(unsafe.Pointer(p)).FpUnlockArg
 162854 			xUnlockNotify = (*Sqlite3)(unsafe.Pointer(p)).FxUnlockNotify
 162855 			(*Sqlite3)(unsafe.Pointer(p)).FpUnlockConnection = uintptr(0)
 162856 			(*Sqlite3)(unsafe.Pointer(p)).FxUnlockNotify = uintptr(0)
 162857 			(*Sqlite3)(unsafe.Pointer(p)).FpUnlockArg = uintptr(0)
 162858 		}
 162859 
 162860 		if (*Sqlite3)(unsafe.Pointer(p)).FpBlockingConnection == uintptr(0) && (*Sqlite3)(unsafe.Pointer(p)).FpUnlockConnection == uintptr(0) {
 162861 			*(*uintptr)(unsafe.Pointer(pp)) = (*Sqlite3)(unsafe.Pointer(p)).FpNextBlocked
 162862 			(*Sqlite3)(unsafe.Pointer(p)).FpNextBlocked = uintptr(0)
 162863 		} else {
 162864 			pp = p + 840
 162865 		}
 162866 	}
 162867 
 162868 	if nArg != 0 {
 162869 		(*struct {
 162870 			f func(*libc.TLS, uintptr, int32)
 162871 		})(unsafe.Pointer(&struct{ uintptr }{xUnlockNotify})).f(tls, aArg, nArg)
 162872 	}
 162873 	Xsqlite3_free(tls, aDyn)
 162874 	leaveMutex(tls)
 162875 }
 162876 
 162877 // This is called when the database connection passed as an argument is
 162878 // being closed. The connection is removed from the blocked list.
 162879 func Xsqlite3ConnectionClosed(tls *libc.TLS, db uintptr) {
 162880 	Xsqlite3ConnectionUnlocked(tls, db)
 162881 	enterMutex(tls)
 162882 	removeFromBlockedList(tls, db)
 162883 
 162884 	leaveMutex(tls)
 162885 }
 162886 
 162887 var jsonIsSpace = [256]int8{
 162888 	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(1), int8(1), int8(0), int8(0), int8(1), int8(0), int8(0),
 162889 	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
 162890 	int8(1), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
 162891 	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
 162892 	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
 162893 	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
 162894 	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
 162895 	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
 162896 	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
 162897 	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
 162898 	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
 162899 	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
 162900 	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
 162901 	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
 162902 	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
 162903 	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
 162904 }
 162905 
 162906 // Objects
 162907 type JsonString1 = struct {
 162908 	FpCtx        uintptr
 162909 	FzBuf        uintptr
 162910 	FnAlloc      U64
 162911 	FnUsed       U64
 162912 	FbStatic     U8
 162913 	FbErr        U8
 162914 	FzSpace      [100]int8
 162915 	F__ccgo_pad1 [2]byte
 162916 }
 162917 
 162918 // Objects
 162919 type JsonString = JsonString1
 162920 type JsonNode1 = struct {
 162921 	FeType       U8
 162922 	FjnFlags     U8
 162923 	FeU          U8
 162924 	F__ccgo_pad1 [1]byte
 162925 	Fn           U32
 162926 	Fu           struct{ FzJContent uintptr }
 162927 }
 162928 
 162929 type JsonNode = JsonNode1
 162930 type JsonParse1 = struct {
 162931 	FnNode       U32
 162932 	FnAlloc      U32
 162933 	FaNode       uintptr
 162934 	FzJson       uintptr
 162935 	FaUp         uintptr
 162936 	Foom         U8
 162937 	FnErr        U8
 162938 	FiDepth      U16
 162939 	FnJson       int32
 162940 	FiHold       U32
 162941 	F__ccgo_pad1 [4]byte
 162942 }
 162943 
 162944 type JsonParse = JsonParse1
 162945 
 162946 var jsonType = [8]uintptr{
 162947 	ts + 7533, ts + 9046, ts + 9051, ts + 7543, ts + 7538, ts + 9357, ts + 25910, ts + 25916,
 162948 }
 162949 
 162950 func jsonZero(tls *libc.TLS, p uintptr) {
 162951 	(*JsonString)(unsafe.Pointer(p)).FzBuf = p + 34
 162952 	(*JsonString)(unsafe.Pointer(p)).FnAlloc = U64(unsafe.Sizeof([100]int8{}))
 162953 	(*JsonString)(unsafe.Pointer(p)).FnUsed = uint64(0)
 162954 	(*JsonString)(unsafe.Pointer(p)).FbStatic = U8(1)
 162955 }
 162956 
 162957 func jsonInit(tls *libc.TLS, p uintptr, pCtx uintptr) {
 162958 	(*JsonString)(unsafe.Pointer(p)).FpCtx = pCtx
 162959 	(*JsonString)(unsafe.Pointer(p)).FbErr = U8(0)
 162960 	jsonZero(tls, p)
 162961 }
 162962 
 162963 func jsonReset(tls *libc.TLS, p uintptr) {
 162964 	if !(int32((*JsonString)(unsafe.Pointer(p)).FbStatic) != 0) {
 162965 		Xsqlite3_free(tls, (*JsonString)(unsafe.Pointer(p)).FzBuf)
 162966 	}
 162967 	jsonZero(tls, p)
 162968 }
 162969 
 162970 func jsonOom(tls *libc.TLS, p uintptr) {
 162971 	(*JsonString)(unsafe.Pointer(p)).FbErr = U8(1)
 162972 	Xsqlite3_result_error_nomem(tls, (*JsonString)(unsafe.Pointer(p)).FpCtx)
 162973 	jsonReset(tls, p)
 162974 }
 162975 
 162976 func jsonGrow(tls *libc.TLS, p uintptr, N U32) int32 {
 162977 	var nTotal U64
 162978 	if U64(N) < (*JsonString)(unsafe.Pointer(p)).FnAlloc {
 162979 		nTotal = (*JsonString)(unsafe.Pointer(p)).FnAlloc * uint64(2)
 162980 	} else {
 162981 		nTotal = (*JsonString)(unsafe.Pointer(p)).FnAlloc + U64(N) + uint64(10)
 162982 	}
 162983 	var zNew uintptr
 162984 	if (*JsonString)(unsafe.Pointer(p)).FbStatic != 0 {
 162985 		if (*JsonString)(unsafe.Pointer(p)).FbErr != 0 {
 162986 			return 1
 162987 		}
 162988 		zNew = Xsqlite3_malloc64(tls, nTotal)
 162989 		if zNew == uintptr(0) {
 162990 			jsonOom(tls, p)
 162991 			return SQLITE_NOMEM
 162992 		}
 162993 		libc.Xmemcpy(tls, zNew, (*JsonString)(unsafe.Pointer(p)).FzBuf, (*JsonString)(unsafe.Pointer(p)).FnUsed)
 162994 		(*JsonString)(unsafe.Pointer(p)).FzBuf = zNew
 162995 		(*JsonString)(unsafe.Pointer(p)).FbStatic = U8(0)
 162996 	} else {
 162997 		zNew = Xsqlite3_realloc64(tls, (*JsonString)(unsafe.Pointer(p)).FzBuf, nTotal)
 162998 		if zNew == uintptr(0) {
 162999 			jsonOom(tls, p)
 163000 			return SQLITE_NOMEM
 163001 		}
 163002 		(*JsonString)(unsafe.Pointer(p)).FzBuf = zNew
 163003 	}
 163004 	(*JsonString)(unsafe.Pointer(p)).FnAlloc = nTotal
 163005 	return SQLITE_OK
 163006 }
 163007 
 163008 func jsonAppendRaw(tls *libc.TLS, p uintptr, zIn uintptr, N U32) {
 163009 	if N == U32(0) {
 163010 		return
 163011 	}
 163012 	if U64(N)+(*JsonString)(unsafe.Pointer(p)).FnUsed >= (*JsonString)(unsafe.Pointer(p)).FnAlloc && jsonGrow(tls, p, N) != 0 {
 163013 		return
 163014 	}
 163015 	libc.Xmemcpy(tls, (*JsonString)(unsafe.Pointer(p)).FzBuf+uintptr((*JsonString)(unsafe.Pointer(p)).FnUsed), zIn, uint64(N))
 163016 	*(*U64)(unsafe.Pointer(p + 24)) += U64(N)
 163017 }
 163018 
 163019 func jsonPrintf(tls *libc.TLS, N int32, p uintptr, zFormat uintptr, va uintptr) {
 163020 	var ap Va_list
 163021 	_ = ap
 163022 	if (*JsonString)(unsafe.Pointer(p)).FnUsed+U64(N) >= (*JsonString)(unsafe.Pointer(p)).FnAlloc && jsonGrow(tls, p, uint32(N)) != 0 {
 163023 		return
 163024 	}
 163025 	ap = va
 163026 	Xsqlite3_vsnprintf(tls, N, (*JsonString)(unsafe.Pointer(p)).FzBuf+uintptr((*JsonString)(unsafe.Pointer(p)).FnUsed), zFormat, ap)
 163027 	_ = ap
 163028 	*(*U64)(unsafe.Pointer(p + 24)) += U64(int32(libc.Xstrlen(tls, (*JsonString)(unsafe.Pointer(p)).FzBuf+uintptr((*JsonString)(unsafe.Pointer(p)).FnUsed))))
 163029 }
 163030 
 163031 func jsonAppendChar(tls *libc.TLS, p uintptr, c int8) {
 163032 	if (*JsonString)(unsafe.Pointer(p)).FnUsed >= (*JsonString)(unsafe.Pointer(p)).FnAlloc && jsonGrow(tls, p, uint32(1)) != 0 {
 163033 		return
 163034 	}
 163035 	*(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = c
 163036 }
 163037 
 163038 func jsonAppendSeparator(tls *libc.TLS, p uintptr) {
 163039 	var c int8
 163040 	if (*JsonString)(unsafe.Pointer(p)).FnUsed == uint64(0) {
 163041 		return
 163042 	}
 163043 	c = *(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*JsonString)(unsafe.Pointer(p)).FnUsed-uint64(1))))
 163044 	if int32(c) != '[' && int32(c) != '{' {
 163045 		jsonAppendChar(tls, p, int8(','))
 163046 	}
 163047 }
 163048 
 163049 func jsonAppendString(tls *libc.TLS, p uintptr, zIn uintptr, N U32) {
 163050 	var i U32
 163051 	var c uint8
 163052 	if !(zIn == uintptr(0) || U64(N)+(*JsonString)(unsafe.Pointer(p)).FnUsed+uint64(2) >= (*JsonString)(unsafe.Pointer(p)).FnAlloc && jsonGrow(tls, p, N+U32(2)) != 0) {
 163053 		goto __1
 163054 	}
 163055 	return
 163056 __1:
 163057 	;
 163058 	*(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = int8('"')
 163059 	i = U32(0)
 163060 __2:
 163061 	if !(i < N) {
 163062 		goto __4
 163063 	}
 163064 	c = *(*uint8)(unsafe.Pointer(zIn + uintptr(i)))
 163065 	if !(int32(c) == '"' || int32(c) == '\\') {
 163066 		goto __5
 163067 	}
 163068 json_simple_escape:
 163069 	if !((*JsonString)(unsafe.Pointer(p)).FnUsed+U64(N)+uint64(3)-U64(i) > (*JsonString)(unsafe.Pointer(p)).FnAlloc && jsonGrow(tls, p, N+U32(3)-i) != 0) {
 163070 		goto __7
 163071 	}
 163072 	return
 163073 __7:
 163074 	;
 163075 	*(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = int8('\\')
 163076 	goto __6
 163077 __5:
 163078 	if !(int32(c) <= 0x1f) {
 163079 		goto __8
 163080 	}
 163081 
 163082 	if !(aSpecial[c] != 0) {
 163083 		goto __9
 163084 	}
 163085 	c = uint8(aSpecial[c])
 163086 	goto json_simple_escape
 163087 __9:
 163088 	;
 163089 	if !((*JsonString)(unsafe.Pointer(p)).FnUsed+U64(N)+uint64(7)+U64(i) > (*JsonString)(unsafe.Pointer(p)).FnAlloc && jsonGrow(tls, p, N+U32(7)-i) != 0) {
 163090 		goto __10
 163091 	}
 163092 	return
 163093 __10:
 163094 	;
 163095 	*(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = int8('\\')
 163096 	*(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = int8('u')
 163097 	*(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = int8('0')
 163098 	*(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = int8('0')
 163099 	*(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = int8('0' + int32(c)>>4)
 163100 	c = uint8(*(*int8)(unsafe.Pointer(ts + 25923 + uintptr(int32(c)&0xf))))
 163101 __8:
 163102 	;
 163103 __6:
 163104 	;
 163105 	*(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = int8(c)
 163106 	goto __3
 163107 __3:
 163108 	i++
 163109 	goto __2
 163110 	goto __4
 163111 __4:
 163112 	;
 163113 	*(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = int8('"')
 163114 
 163115 }
 163116 
 163117 var aSpecial = [32]int8{
 163118 	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8('b'), int8('t'), int8('n'), int8(0), int8('f'), int8('r'), int8(0), int8(0),
 163119 	int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
 163120 }
 163121 
 163122 func jsonAppendValue(tls *libc.TLS, p uintptr, pValue uintptr) {
 163123 	switch Xsqlite3_value_type(tls, pValue) {
 163124 	case SQLITE_NULL:
 163125 		{
 163126 			jsonAppendRaw(tls, p, ts+7533, uint32(4))
 163127 			break
 163128 
 163129 		}
 163130 	case SQLITE_INTEGER:
 163131 		fallthrough
 163132 	case SQLITE_FLOAT:
 163133 		{
 163134 			var z uintptr = Xsqlite3_value_text(tls, pValue)
 163135 			var n U32 = U32(Xsqlite3_value_bytes(tls, pValue))
 163136 			jsonAppendRaw(tls, p, z, n)
 163137 			break
 163138 
 163139 		}
 163140 	case SQLITE_TEXT:
 163141 		{
 163142 			var z uintptr = Xsqlite3_value_text(tls, pValue)
 163143 			var n U32 = U32(Xsqlite3_value_bytes(tls, pValue))
 163144 			if Xsqlite3_value_subtype(tls, pValue) == uint32(JSON_SUBTYPE) {
 163145 				jsonAppendRaw(tls, p, z, n)
 163146 			} else {
 163147 				jsonAppendString(tls, p, z, n)
 163148 			}
 163149 			break
 163150 
 163151 		}
 163152 	default:
 163153 		{
 163154 			if int32((*JsonString)(unsafe.Pointer(p)).FbErr) == 0 {
 163155 				Xsqlite3_result_error(tls, (*JsonString)(unsafe.Pointer(p)).FpCtx, ts+25940, -1)
 163156 				(*JsonString)(unsafe.Pointer(p)).FbErr = U8(2)
 163157 				jsonReset(tls, p)
 163158 			}
 163159 			break
 163160 
 163161 		}
 163162 	}
 163163 }
 163164 
 163165 func jsonResult(tls *libc.TLS, p uintptr) {
 163166 	if int32((*JsonString)(unsafe.Pointer(p)).FbErr) == 0 {
 163167 		Xsqlite3_result_text64(tls, (*JsonString)(unsafe.Pointer(p)).FpCtx, (*JsonString)(unsafe.Pointer(p)).FzBuf, (*JsonString)(unsafe.Pointer(p)).FnUsed,
 163168 			func() uintptr {
 163169 				if (*JsonString)(unsafe.Pointer(p)).FbStatic != 0 {
 163170 					return libc.UintptrFromInt32(-1)
 163171 				}
 163172 				return *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))
 163173 			}(),
 163174 			uint8(SQLITE_UTF8))
 163175 		jsonZero(tls, p)
 163176 	}
 163177 
 163178 }
 163179 
 163180 func jsonNodeSize(tls *libc.TLS, pNode uintptr) U32 {
 163181 	if int32((*JsonNode)(unsafe.Pointer(pNode)).FeType) >= JSON_ARRAY {
 163182 		return (*JsonNode)(unsafe.Pointer(pNode)).Fn + U32(1)
 163183 	}
 163184 	return uint32(1)
 163185 }
 163186 
 163187 func jsonParseReset(tls *libc.TLS, pParse uintptr) {
 163188 	Xsqlite3_free(tls, (*JsonParse)(unsafe.Pointer(pParse)).FaNode)
 163189 	(*JsonParse)(unsafe.Pointer(pParse)).FaNode = uintptr(0)
 163190 	(*JsonParse)(unsafe.Pointer(pParse)).FnNode = U32(0)
 163191 	(*JsonParse)(unsafe.Pointer(pParse)).FnAlloc = U32(0)
 163192 	Xsqlite3_free(tls, (*JsonParse)(unsafe.Pointer(pParse)).FaUp)
 163193 	(*JsonParse)(unsafe.Pointer(pParse)).FaUp = uintptr(0)
 163194 }
 163195 
 163196 func jsonParseFree(tls *libc.TLS, pParse uintptr) {
 163197 	jsonParseReset(tls, pParse)
 163198 	Xsqlite3_free(tls, pParse)
 163199 }
 163200 
 163201 func jsonRenderNode(tls *libc.TLS, pNode uintptr, pOut uintptr, aReplace uintptr) {
 163202 	if int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags)&(JNODE_REPLACE|JNODE_PATCH) != 0 {
 163203 		if int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags)&JNODE_REPLACE != 0 && aReplace != uintptr(0) {
 163204 			jsonAppendValue(tls, pOut, *(*uintptr)(unsafe.Pointer(aReplace + uintptr(*(*U32)(unsafe.Pointer(pNode + 8)))*8)))
 163205 			return
 163206 		}
 163207 
 163208 		pNode = *(*uintptr)(unsafe.Pointer(pNode + 8))
 163209 	}
 163210 	switch int32((*JsonNode)(unsafe.Pointer(pNode)).FeType) {
 163211 	default:
 163212 		{
 163213 			jsonAppendRaw(tls, pOut, ts+7533, uint32(4))
 163214 			break
 163215 
 163216 		}
 163217 	case JSON_TRUE:
 163218 		{
 163219 			jsonAppendRaw(tls, pOut, ts+9046, uint32(4))
 163220 			break
 163221 
 163222 		}
 163223 	case JSON_FALSE:
 163224 		{
 163225 			jsonAppendRaw(tls, pOut, ts+9051, uint32(5))
 163226 			break
 163227 
 163228 		}
 163229 	case JSON_STRING:
 163230 		{
 163231 			if int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags)&JNODE_RAW != 0 {
 163232 				jsonAppendString(tls, pOut, *(*uintptr)(unsafe.Pointer(pNode + 8)), (*JsonNode)(unsafe.Pointer(pNode)).Fn)
 163233 				break
 163234 			}
 163235 
 163236 		}
 163237 		fallthrough
 163238 	case JSON_REAL:
 163239 		fallthrough
 163240 	case JSON_INT:
 163241 		{
 163242 			jsonAppendRaw(tls, pOut, *(*uintptr)(unsafe.Pointer(pNode + 8)), (*JsonNode)(unsafe.Pointer(pNode)).Fn)
 163243 			break
 163244 
 163245 		}
 163246 	case JSON_ARRAY:
 163247 		{
 163248 			var j U32 = U32(1)
 163249 			jsonAppendChar(tls, pOut, int8('['))
 163250 			for {
 163251 				for j <= (*JsonNode)(unsafe.Pointer(pNode)).Fn {
 163252 					if int32((*JsonNode)(unsafe.Pointer(pNode+uintptr(j)*16)).FjnFlags)&JNODE_REMOVE == 0 {
 163253 						jsonAppendSeparator(tls, pOut)
 163254 						jsonRenderNode(tls, pNode+uintptr(j)*16, pOut, aReplace)
 163255 					}
 163256 					j = j + jsonNodeSize(tls, pNode+uintptr(j)*16)
 163257 				}
 163258 				if int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags)&JNODE_APPEND == 0 {
 163259 					break
 163260 				}
 163261 
 163262 				pNode = pNode + uintptr(*(*U32)(unsafe.Pointer(pNode + 8)))*16
 163263 				j = U32(1)
 163264 			}
 163265 			jsonAppendChar(tls, pOut, int8(']'))
 163266 			break
 163267 
 163268 		}
 163269 	case JSON_OBJECT:
 163270 		{
 163271 			var j U32 = U32(1)
 163272 			jsonAppendChar(tls, pOut, int8('{'))
 163273 			for {
 163274 				for j <= (*JsonNode)(unsafe.Pointer(pNode)).Fn {
 163275 					if int32((*JsonNode)(unsafe.Pointer(pNode+uintptr(j+U32(1))*16)).FjnFlags)&JNODE_REMOVE == 0 {
 163276 						jsonAppendSeparator(tls, pOut)
 163277 						jsonRenderNode(tls, pNode+uintptr(j)*16, pOut, aReplace)
 163278 						jsonAppendChar(tls, pOut, int8(':'))
 163279 						jsonRenderNode(tls, pNode+uintptr(j+U32(1))*16, pOut, aReplace)
 163280 					}
 163281 					j = j + (U32(1) + jsonNodeSize(tls, pNode+uintptr(j+U32(1))*16))
 163282 				}
 163283 				if int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags)&JNODE_APPEND == 0 {
 163284 					break
 163285 				}
 163286 
 163287 				pNode = pNode + uintptr(*(*U32)(unsafe.Pointer(pNode + 8)))*16
 163288 				j = U32(1)
 163289 			}
 163290 			jsonAppendChar(tls, pOut, int8('}'))
 163291 			break
 163292 
 163293 		}
 163294 	}
 163295 }
 163296 
 163297 func jsonReturnJson(tls *libc.TLS, pNode uintptr, pCtx uintptr, aReplace uintptr) {
 163298 	bp := tls.Alloc(136)
 163299 	defer tls.Free(136)
 163300 
 163301 	jsonInit(tls, bp, pCtx)
 163302 	jsonRenderNode(tls, pNode, bp, aReplace)
 163303 	jsonResult(tls, bp)
 163304 	Xsqlite3_result_subtype(tls, pCtx, uint32(JSON_SUBTYPE))
 163305 }
 163306 
 163307 func jsonHexToInt(tls *libc.TLS, h int32) U8 {
 163308 	h = h + 9*(1&(h>>6))
 163309 	return U8(h & 0xf)
 163310 }
 163311 
 163312 func jsonHexToInt4(tls *libc.TLS, z uintptr) U32 {
 163313 	var v U32
 163314 
 163315 	v = U32(int32(jsonHexToInt(tls, int32(*(*int8)(unsafe.Pointer(z)))))<<12 +
 163316 		int32(jsonHexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + 1)))))<<8 +
 163317 		int32(jsonHexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + 2)))))<<4 +
 163318 		int32(jsonHexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + 3))))))
 163319 	return v
 163320 }
 163321 
 163322 func jsonReturn(tls *libc.TLS, pNode uintptr, pCtx uintptr, aReplace uintptr) {
 163323 	bp := tls.Alloc(8)
 163324 	defer tls.Free(8)
 163325 
 163326 	var v uint32
 163327 	var i Sqlite3_int64
 163328 	var z uintptr
 163329 
 163330 	var z1 uintptr
 163331 	var vlo U32
 163332 	var v1 U32
 163333 	var c int8
 163334 
 163335 	var i1 U32
 163336 	var n U32
 163337 	var z2 uintptr
 163338 	var zOut uintptr
 163339 	var j U32
 163340 	switch int32((*JsonNode)(unsafe.Pointer(pNode)).FeType) {
 163341 	default:
 163342 		goto __2
 163343 	case JSON_TRUE:
 163344 		goto __3
 163345 	case JSON_FALSE:
 163346 		goto __4
 163347 	case JSON_INT:
 163348 		goto __5
 163349 	case JSON_REAL:
 163350 		goto __6
 163351 	case JSON_STRING:
 163352 		goto __7
 163353 	case JSON_ARRAY:
 163354 		goto __8
 163355 	case JSON_OBJECT:
 163356 		goto __9
 163357 	}
 163358 	goto __1
 163359 __2:
 163360 	;
 163361 	Xsqlite3_result_null(tls, pCtx)
 163362 	goto __1
 163363 
 163364 __3:
 163365 	Xsqlite3_result_int(tls, pCtx, 1)
 163366 	goto __1
 163367 
 163368 __4:
 163369 	Xsqlite3_result_int(tls, pCtx, 0)
 163370 	goto __1
 163371 
 163372 __5:
 163373 	i = int64(0)
 163374 
 163375 	z = *(*uintptr)(unsafe.Pointer(pNode + 8))
 163376 	if !(int32(*(*int8)(unsafe.Pointer(z))) == '-') {
 163377 		goto __10
 163378 	}
 163379 	z++
 163380 __10:
 163381 	;
 163382 __11:
 163383 	if !(int32(*(*int8)(unsafe.Pointer(z))) >= '0' && int32(*(*int8)(unsafe.Pointer(z))) <= '9') {
 163384 		goto __12
 163385 	}
 163386 	v = uint32(int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) - '0')
 163387 	if !(i >= (int64(0xffffffff)|int64(0x7fffffff)<<32)/int64(10)) {
 163388 		goto __13
 163389 	}
 163390 	if !(i > (int64(0xffffffff)|int64(0x7fffffff)<<32)/int64(10)) {
 163391 		goto __14
 163392 	}
 163393 	goto int_as_real
 163394 __14:
 163395 	;
 163396 	if !(int32(*(*int8)(unsafe.Pointer(z))) >= '0' && int32(*(*int8)(unsafe.Pointer(z))) <= '9') {
 163397 		goto __15
 163398 	}
 163399 	goto int_as_real
 163400 __15:
 163401 	;
 163402 	if !(v == uint32(9)) {
 163403 		goto __16
 163404 	}
 163405 	goto int_as_real
 163406 __16:
 163407 	;
 163408 	if !(v == uint32(8)) {
 163409 		goto __17
 163410 	}
 163411 	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNode + 8))))) == '-') {
 163412 		goto __18
 163413 	}
 163414 	Xsqlite3_result_int64(tls, pCtx, int64(-1)-(int64(0xffffffff)|int64(0x7fffffff)<<32))
 163415 	goto int_done
 163416 	goto __19
 163417 __18:
 163418 	goto int_as_real
 163419 __19:
 163420 	;
 163421 __17:
 163422 	;
 163423 __13:
 163424 	;
 163425 	i = i*int64(10) + Sqlite3_int64(v)
 163426 	goto __11
 163427 __12:
 163428 	;
 163429 	if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNode + 8))))) == '-') {
 163430 		goto __20
 163431 	}
 163432 	i = -i
 163433 __20:
 163434 	;
 163435 	Xsqlite3_result_int64(tls, pCtx, i)
 163436 int_done:
 163437 	goto __1
 163438 int_as_real:
 163439 	;
 163440 __6:
 163441 	;
 163442 	z1 = *(*uintptr)(unsafe.Pointer(pNode + 8))
 163443 	Xsqlite3AtoF(tls, z1, bp, Xsqlite3Strlen30(tls, z1), uint8(SQLITE_UTF8))
 163444 	Xsqlite3_result_double(tls, pCtx, *(*float64)(unsafe.Pointer(bp)))
 163445 	goto __1
 163446 
 163447 __7:
 163448 	;
 163449 	if !(int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags)&JNODE_ESCAPE == 0) {
 163450 		goto __21
 163451 	}
 163452 
 163453 	Xsqlite3_result_text(tls, pCtx, *(*uintptr)(unsafe.Pointer(pNode + 8))+uintptr(1), int32((*JsonNode)(unsafe.Pointer(pNode)).Fn-U32(2)),
 163454 		libc.UintptrFromInt32(-1))
 163455 	goto __22
 163456 __21:
 163457 	n = (*JsonNode)(unsafe.Pointer(pNode)).Fn
 163458 
 163459 	z2 = *(*uintptr)(unsafe.Pointer(pNode + 8))
 163460 	zOut = Xsqlite3_malloc(tls, int32(n+U32(1)))
 163461 	if !(zOut == uintptr(0)) {
 163462 		goto __23
 163463 	}
 163464 	Xsqlite3_result_error_nomem(tls, pCtx)
 163465 	goto __1
 163466 __23:
 163467 	;
 163468 	i1 = U32(1)
 163469 	j = U32(0)
 163470 __24:
 163471 	if !(i1 < n-U32(1)) {
 163472 		goto __26
 163473 	}
 163474 	c = *(*int8)(unsafe.Pointer(z2 + uintptr(i1)))
 163475 	if !(int32(c) != '\\') {
 163476 		goto __27
 163477 	}
 163478 	*(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = c
 163479 	goto __28
 163480 __27:
 163481 	c = *(*int8)(unsafe.Pointer(z2 + uintptr(libc.PreIncUint32(&i1, 1))))
 163482 	if !(int32(c) == 'u') {
 163483 		goto __29
 163484 	}
 163485 	v1 = jsonHexToInt4(tls, z2+uintptr(i1)+uintptr(1))
 163486 	i1 = i1 + U32(4)
 163487 	if !(v1 == U32(0)) {
 163488 		goto __31
 163489 	}
 163490 	goto __26
 163491 __31:
 163492 	;
 163493 	if !(v1 <= U32(0x7f)) {
 163494 		goto __32
 163495 	}
 163496 	*(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = int8(v1)
 163497 	goto __33
 163498 __32:
 163499 	if !(v1 <= U32(0x7ff)) {
 163500 		goto __34
 163501 	}
 163502 	*(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = int8(U32(0xc0) | v1>>6)
 163503 	*(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = int8(U32(0x80) | v1&U32(0x3f))
 163504 	goto __35
 163505 __34:
 163506 	if !(v1&U32(0xfc00) == U32(0xd800) &&
 163507 		i1 < n-U32(6) &&
 163508 		int32(*(*int8)(unsafe.Pointer(z2 + uintptr(i1+U32(1))))) == '\\' &&
 163509 		int32(*(*int8)(unsafe.Pointer(z2 + uintptr(i1+U32(2))))) == 'u' &&
 163510 		libc.AssignUint32(&vlo, jsonHexToInt4(tls, z2+uintptr(i1)+uintptr(3)))&U32(0xfc00) == U32(0xdc00)) {
 163511 		goto __36
 163512 	}
 163513 
 163514 	v1 = v1&U32(0x3ff)<<10 + vlo&U32(0x3ff) + U32(0x10000)
 163515 	i1 = i1 + U32(6)
 163516 	*(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = int8(U32(0xf0) | v1>>18)
 163517 	*(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = int8(U32(0x80) | v1>>12&U32(0x3f))
 163518 	*(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = int8(U32(0x80) | v1>>6&U32(0x3f))
 163519 	*(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = int8(U32(0x80) | v1&U32(0x3f))
 163520 	goto __37
 163521 __36:
 163522 	*(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = int8(U32(0xe0) | v1>>12)
 163523 	*(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = int8(U32(0x80) | v1>>6&U32(0x3f))
 163524 	*(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = int8(U32(0x80) | v1&U32(0x3f))
 163525 __37:
 163526 	;
 163527 __35:
 163528 	;
 163529 __33:
 163530 	;
 163531 	goto __30
 163532 __29:
 163533 	if !(int32(c) == 'b') {
 163534 		goto __38
 163535 	}
 163536 	c = int8('\b')
 163537 	goto __39
 163538 __38:
 163539 	if !(int32(c) == 'f') {
 163540 		goto __40
 163541 	}
 163542 	c = int8('\f')
 163543 	goto __41
 163544 __40:
 163545 	if !(int32(c) == 'n') {
 163546 		goto __42
 163547 	}
 163548 	c = int8('\n')
 163549 	goto __43
 163550 __42:
 163551 	if !(int32(c) == 'r') {
 163552 		goto __44
 163553 	}
 163554 	c = int8('\r')
 163555 	goto __45
 163556 __44:
 163557 	if !(int32(c) == 't') {
 163558 		goto __46
 163559 	}
 163560 	c = int8('\t')
 163561 __46:
 163562 	;
 163563 __45:
 163564 	;
 163565 __43:
 163566 	;
 163567 __41:
 163568 	;
 163569 __39:
 163570 	;
 163571 	*(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = c
 163572 __30:
 163573 	;
 163574 __28:
 163575 	;
 163576 	goto __25
 163577 __25:
 163578 	i1++
 163579 	goto __24
 163580 	goto __26
 163581 __26:
 163582 	;
 163583 	*(*int8)(unsafe.Pointer(zOut + uintptr(j))) = int8(0)
 163584 	Xsqlite3_result_text(tls, pCtx, zOut, int32(j), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
 163585 __22:
 163586 	;
 163587 	goto __1
 163588 
 163589 __8:
 163590 __9:
 163591 	jsonReturnJson(tls, pNode, pCtx, aReplace)
 163592 	goto __1
 163593 
 163594 __1:
 163595 }
 163596 
 163597 func jsonParseAddNodeExpand(tls *libc.TLS, pParse uintptr, eType U32, n U32, zContent uintptr) int32 {
 163598 	var nNew U32
 163599 	var pNew uintptr
 163600 
 163601 	if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 {
 163602 		return -1
 163603 	}
 163604 	nNew = (*JsonParse)(unsafe.Pointer(pParse)).FnAlloc*U32(2) + U32(10)
 163605 	pNew = Xsqlite3_realloc64(tls, (*JsonParse)(unsafe.Pointer(pParse)).FaNode, uint64(unsafe.Sizeof(JsonNode{}))*uint64(nNew))
 163606 	if pNew == uintptr(0) {
 163607 		(*JsonParse)(unsafe.Pointer(pParse)).Foom = U8(1)
 163608 		return -1
 163609 	}
 163610 	(*JsonParse)(unsafe.Pointer(pParse)).FnAlloc = nNew
 163611 	(*JsonParse)(unsafe.Pointer(pParse)).FaNode = pNew
 163612 
 163613 	return jsonParseAddNode(tls, pParse, eType, n, zContent)
 163614 }
 163615 
 163616 func jsonParseAddNode(tls *libc.TLS, pParse uintptr, eType U32, n U32, zContent uintptr) int32 {
 163617 	var p uintptr
 163618 	if (*JsonParse)(unsafe.Pointer(pParse)).FaNode == uintptr(0) || (*JsonParse)(unsafe.Pointer(pParse)).FnNode >= (*JsonParse)(unsafe.Pointer(pParse)).FnAlloc {
 163619 		return jsonParseAddNodeExpand(tls, pParse, eType, n, zContent)
 163620 	}
 163621 	p = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr((*JsonParse)(unsafe.Pointer(pParse)).FnNode)*16
 163622 	(*JsonNode)(unsafe.Pointer(p)).FeType = U8(eType)
 163623 	(*JsonNode)(unsafe.Pointer(p)).FjnFlags = U8(0)
 163624 
 163625 	(*JsonNode)(unsafe.Pointer(p)).Fn = n
 163626 	*(*uintptr)(unsafe.Pointer(p + 8)) = zContent
 163627 	return int32(libc.PostIncUint32(&(*JsonParse)(unsafe.Pointer(pParse)).FnNode, 1))
 163628 }
 163629 
 163630 func jsonIs4Hex(tls *libc.TLS, z uintptr) int32 {
 163631 	var i int32
 163632 	for i = 0; i < 4; i++ {
 163633 		if !(int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))])&0x08 != 0) {
 163634 			return 0
 163635 		}
 163636 	}
 163637 	return 1
 163638 }
 163639 
 163640 func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 {
 163641 	var c int8
 163642 	var j U32
 163643 	var iThis int32
 163644 	var x int32
 163645 	var pNode uintptr
 163646 	var z uintptr = (*JsonParse)(unsafe.Pointer(pParse)).FzJson
 163647 	for jsonIsSpace[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))] != 0 {
 163648 		i++
 163649 	}
 163650 	if int32(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer(z + uintptr(i))))) == '{' {
 163651 		iThis = jsonParseAddNode(tls, pParse, uint32(JSON_OBJECT), uint32(0), uintptr(0))
 163652 		if iThis < 0 {
 163653 			return -1
 163654 		}
 163655 		for j = i + U32(1); ; j++ {
 163656 			for jsonIsSpace[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j))))] != 0 {
 163657 				j++
 163658 			}
 163659 			if int32(libc.PreIncUint16(&(*JsonParse)(unsafe.Pointer(pParse)).FiDepth, 1)) > JSON_MAX_DEPTH {
 163660 				return -1
 163661 			}
 163662 			x = jsonParseValue(tls, pParse, j)
 163663 			if x < 0 {
 163664 				(*JsonParse)(unsafe.Pointer(pParse)).FiDepth--
 163665 				if x == -2 && (*JsonParse)(unsafe.Pointer(pParse)).FnNode == U32(iThis)+U32(1) {
 163666 					return int32(j + U32(1))
 163667 				}
 163668 				return -1
 163669 			}
 163670 			if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 {
 163671 				return -1
 163672 			}
 163673 			pNode = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr((*JsonParse)(unsafe.Pointer(pParse)).FnNode-U32(1))*16
 163674 			if int32((*JsonNode)(unsafe.Pointer(pNode)).FeType) != JSON_STRING {
 163675 				return -1
 163676 			}
 163677 			*(*U8)(unsafe.Pointer(pNode + 1)) |= U8(JNODE_LABEL)
 163678 			j = U32(x)
 163679 			for jsonIsSpace[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j))))] != 0 {
 163680 				j++
 163681 			}
 163682 			if int32(*(*int8)(unsafe.Pointer(z + uintptr(j)))) != ':' {
 163683 				return -1
 163684 			}
 163685 			j++
 163686 			x = jsonParseValue(tls, pParse, j)
 163687 			(*JsonParse)(unsafe.Pointer(pParse)).FiDepth--
 163688 			if x < 0 {
 163689 				return -1
 163690 			}
 163691 			j = U32(x)
 163692 			for jsonIsSpace[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j))))] != 0 {
 163693 				j++
 163694 			}
 163695 			c = *(*int8)(unsafe.Pointer(z + uintptr(j)))
 163696 			if int32(c) == ',' {
 163697 				continue
 163698 			}
 163699 			if int32(c) != '}' {
 163700 				return -1
 163701 			}
 163702 			break
 163703 		}
 163704 		(*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iThis)*16)).Fn = (*JsonParse)(unsafe.Pointer(pParse)).FnNode - U32(iThis) - U32(1)
 163705 		return int32(j + U32(1))
 163706 	} else if int32(c) == '[' {
 163707 		iThis = jsonParseAddNode(tls, pParse, uint32(JSON_ARRAY), uint32(0), uintptr(0))
 163708 		if iThis < 0 {
 163709 			return -1
 163710 		}
 163711 		libc.Xmemset(tls, (*JsonParse)(unsafe.Pointer(pParse)).FaNode+uintptr(iThis)*16+8, 0, uint64(unsafe.Sizeof(struct{ FzJContent uintptr }{})))
 163712 		for j = i + U32(1); ; j++ {
 163713 			for jsonIsSpace[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j))))] != 0 {
 163714 				j++
 163715 			}
 163716 			if int32(libc.PreIncUint16(&(*JsonParse)(unsafe.Pointer(pParse)).FiDepth, 1)) > JSON_MAX_DEPTH {
 163717 				return -1
 163718 			}
 163719 			x = jsonParseValue(tls, pParse, j)
 163720 			(*JsonParse)(unsafe.Pointer(pParse)).FiDepth--
 163721 			if x < 0 {
 163722 				if x == -3 && (*JsonParse)(unsafe.Pointer(pParse)).FnNode == U32(iThis)+U32(1) {
 163723 					return int32(j + U32(1))
 163724 				}
 163725 				return -1
 163726 			}
 163727 			j = U32(x)
 163728 			for jsonIsSpace[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j))))] != 0 {
 163729 				j++
 163730 			}
 163731 			c = *(*int8)(unsafe.Pointer(z + uintptr(j)))
 163732 			if int32(c) == ',' {
 163733 				continue
 163734 			}
 163735 			if int32(c) != ']' {
 163736 				return -1
 163737 			}
 163738 			break
 163739 		}
 163740 		(*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iThis)*16)).Fn = (*JsonParse)(unsafe.Pointer(pParse)).FnNode - U32(iThis) - U32(1)
 163741 		return int32(j + U32(1))
 163742 	} else if int32(c) == '"' {
 163743 		var jnFlags U8 = U8(0)
 163744 		j = i + U32(1)
 163745 		for {
 163746 			c = *(*int8)(unsafe.Pointer(z + uintptr(j)))
 163747 			if int32(c)&libc.CplInt32(0x1f) == 0 {
 163748 				return -1
 163749 			}
 163750 			if int32(c) == '\\' {
 163751 				c = *(*int8)(unsafe.Pointer(z + uintptr(libc.PreIncUint32(&j, 1))))
 163752 				if int32(c) == '"' || int32(c) == '\\' || int32(c) == '/' || int32(c) == 'b' || int32(c) == 'f' ||
 163753 					int32(c) == 'n' || int32(c) == 'r' || int32(c) == 't' ||
 163754 					int32(c) == 'u' && jsonIs4Hex(tls, z+uintptr(j)+uintptr(1)) != 0 {
 163755 					jnFlags = U8(JNODE_ESCAPE)
 163756 				} else {
 163757 					return -1
 163758 				}
 163759 			} else if int32(c) == '"' {
 163760 				break
 163761 			}
 163762 			j++
 163763 		}
 163764 		jsonParseAddNode(tls, pParse, uint32(JSON_STRING), j+U32(1)-i, z+uintptr(i))
 163765 		if !(int32((*JsonParse)(unsafe.Pointer(pParse)).Foom) != 0) {
 163766 			(*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr((*JsonParse)(unsafe.Pointer(pParse)).FnNode-U32(1))*16)).FjnFlags = jnFlags
 163767 		}
 163768 		return int32(j + U32(1))
 163769 	} else if int32(c) == 'n' &&
 163770 		libc.Xstrncmp(tls, z+uintptr(i), ts+7533, uint64(4)) == 0 &&
 163771 		!(int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+U32(4)))))])&0x06 != 0) {
 163772 		jsonParseAddNode(tls, pParse, uint32(JSON_NULL), uint32(0), uintptr(0))
 163773 		return int32(i + U32(4))
 163774 	} else if int32(c) == 't' &&
 163775 		libc.Xstrncmp(tls, z+uintptr(i), ts+9046, uint64(4)) == 0 &&
 163776 		!(int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+U32(4)))))])&0x06 != 0) {
 163777 		jsonParseAddNode(tls, pParse, uint32(JSON_TRUE), uint32(0), uintptr(0))
 163778 		return int32(i + U32(4))
 163779 	} else if int32(c) == 'f' &&
 163780 		libc.Xstrncmp(tls, z+uintptr(i), ts+9051, uint64(5)) == 0 &&
 163781 		!(int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+U32(5)))))])&0x06 != 0) {
 163782 		jsonParseAddNode(tls, pParse, uint32(JSON_FALSE), uint32(0), uintptr(0))
 163783 		return int32(i + U32(5))
 163784 	} else if int32(c) == '-' || int32(c) >= '0' && int32(c) <= '9' {
 163785 		var seenDP U8 = U8(0)
 163786 		var seenE U8 = U8(0)
 163787 
 163788 		if int32(c) <= '0' {
 163789 			if int32(c) == '-' {
 163790 				j = i + U32(1)
 163791 			} else {
 163792 				j = i
 163793 			}
 163794 			if int32(*(*int8)(unsafe.Pointer(z + uintptr(j)))) == '0' && int32(*(*int8)(unsafe.Pointer(z + uintptr(j+U32(1))))) >= '0' && int32(*(*int8)(unsafe.Pointer(z + uintptr(j+U32(1))))) <= '9' {
 163795 				return -1
 163796 			}
 163797 		}
 163798 		j = i + U32(1)
 163799 		for ; ; j++ {
 163800 			c = *(*int8)(unsafe.Pointer(z + uintptr(j)))
 163801 			if int32(c) >= '0' && int32(c) <= '9' {
 163802 				continue
 163803 			}
 163804 			if int32(c) == '.' {
 163805 				if int32(*(*int8)(unsafe.Pointer(z + uintptr(j-U32(1))))) == '-' {
 163806 					return -1
 163807 				}
 163808 				if seenDP != 0 {
 163809 					return -1
 163810 				}
 163811 				seenDP = U8(1)
 163812 				continue
 163813 			}
 163814 			if int32(c) == 'e' || int32(c) == 'E' {
 163815 				if int32(*(*int8)(unsafe.Pointer(z + uintptr(j-U32(1))))) < '0' {
 163816 					return -1
 163817 				}
 163818 				if seenE != 0 {
 163819 					return -1
 163820 				}
 163821 				seenDP = libc.AssignUint8(&seenE, U8(1))
 163822 				c = *(*int8)(unsafe.Pointer(z + uintptr(j+U32(1))))
 163823 				if int32(c) == '+' || int32(c) == '-' {
 163824 					j++
 163825 					c = *(*int8)(unsafe.Pointer(z + uintptr(j+U32(1))))
 163826 				}
 163827 				if int32(c) < '0' || int32(c) > '9' {
 163828 					return -1
 163829 				}
 163830 				continue
 163831 			}
 163832 			break
 163833 		}
 163834 		if int32(*(*int8)(unsafe.Pointer(z + uintptr(j-U32(1))))) < '0' {
 163835 			return -1
 163836 		}
 163837 		jsonParseAddNode(tls, pParse, func() uint32 {
 163838 			if seenDP != 0 {
 163839 				return uint32(JSON_REAL)
 163840 			}
 163841 			return uint32(JSON_INT)
 163842 		}(),
 163843 			j-i, z+uintptr(i))
 163844 		return int32(j)
 163845 	} else if int32(c) == '}' {
 163846 		return -2
 163847 	} else if int32(c) == ']' {
 163848 		return -3
 163849 	} else if int32(c) == 0 {
 163850 		return 0
 163851 	} else {
 163852 		return -1
 163853 	}
 163854 	return int32(0)
 163855 }
 163856 
 163857 func jsonParse(tls *libc.TLS, pParse uintptr, pCtx uintptr, zJson uintptr) int32 {
 163858 	var i int32
 163859 	libc.Xmemset(tls, pParse, 0, uint64(unsafe.Sizeof(JsonParse{})))
 163860 	if zJson == uintptr(0) {
 163861 		return 1
 163862 	}
 163863 	(*JsonParse)(unsafe.Pointer(pParse)).FzJson = zJson
 163864 	i = jsonParseValue(tls, pParse, uint32(0))
 163865 	if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 {
 163866 		i = -1
 163867 	}
 163868 	if i > 0 {
 163869 		for jsonIsSpace[uint8(*(*int8)(unsafe.Pointer(zJson + uintptr(i))))] != 0 {
 163870 			i++
 163871 		}
 163872 		if *(*int8)(unsafe.Pointer(zJson + uintptr(i))) != 0 {
 163873 			i = -1
 163874 		}
 163875 	}
 163876 	if i <= 0 {
 163877 		if pCtx != uintptr(0) {
 163878 			if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 {
 163879 				Xsqlite3_result_error_nomem(tls, pCtx)
 163880 			} else {
 163881 				Xsqlite3_result_error(tls, pCtx, ts+25969, -1)
 163882 			}
 163883 		}
 163884 		jsonParseReset(tls, pParse)
 163885 		return 1
 163886 	}
 163887 	return 0
 163888 }
 163889 
 163890 func jsonParseFillInParentage(tls *libc.TLS, pParse uintptr, i U32, iParent U32) {
 163891 	var pNode uintptr = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(i)*16
 163892 	var j U32
 163893 	*(*U32)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaUp + uintptr(i)*4)) = iParent
 163894 	switch int32((*JsonNode)(unsafe.Pointer(pNode)).FeType) {
 163895 	case JSON_ARRAY:
 163896 		{
 163897 			for j = U32(1); j <= (*JsonNode)(unsafe.Pointer(pNode)).Fn; j = j + jsonNodeSize(tls, pNode+uintptr(j)*16) {
 163898 				jsonParseFillInParentage(tls, pParse, i+j, i)
 163899 			}
 163900 			break
 163901 
 163902 		}
 163903 	case JSON_OBJECT:
 163904 		{
 163905 			for j = U32(1); j <= (*JsonNode)(unsafe.Pointer(pNode)).Fn; j = j + (jsonNodeSize(tls, pNode+uintptr(j)*16+uintptr(1)*16) + U32(1)) {
 163906 				*(*U32)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaUp + uintptr(i+j)*4)) = i
 163907 				jsonParseFillInParentage(tls, pParse, i+j+U32(1), i)
 163908 			}
 163909 			break
 163910 
 163911 		}
 163912 	default:
 163913 		{
 163914 			break
 163915 
 163916 		}
 163917 	}
 163918 }
 163919 
 163920 func jsonParseFindParents(tls *libc.TLS, pParse uintptr) int32 {
 163921 	var aUp uintptr
 163922 
 163923 	aUp = libc.AssignPtrUintptr(pParse+24, Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(U32(0)))*uint64((*JsonParse)(unsafe.Pointer(pParse)).FnNode)))
 163924 	if aUp == uintptr(0) {
 163925 		(*JsonParse)(unsafe.Pointer(pParse)).Foom = U8(1)
 163926 		return SQLITE_NOMEM
 163927 	}
 163928 	jsonParseFillInParentage(tls, pParse, uint32(0), uint32(0))
 163929 	return SQLITE_OK
 163930 }
 163931 
 163932 func jsonParseCached(tls *libc.TLS, pCtx uintptr, argv uintptr, pErrCtx uintptr) uintptr {
 163933 	var zJson uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 163934 	var nJson int32 = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))
 163935 	var p uintptr
 163936 	var pMatch uintptr = uintptr(0)
 163937 	var iKey int32
 163938 	var iMinKey int32 = 0
 163939 	var iMinHold U32 = 0xffffffff
 163940 	var iMaxHold U32 = U32(0)
 163941 	if zJson == uintptr(0) {
 163942 		return uintptr(0)
 163943 	}
 163944 	for iKey = 0; iKey < JSON_CACHE_SZ; iKey++ {
 163945 		p = Xsqlite3_get_auxdata(tls, pCtx, -429938+iKey)
 163946 		if p == uintptr(0) {
 163947 			iMinKey = iKey
 163948 			break
 163949 		}
 163950 		if pMatch == uintptr(0) &&
 163951 			(*JsonParse)(unsafe.Pointer(p)).FnJson == nJson &&
 163952 			libc.Xmemcmp(tls, (*JsonParse)(unsafe.Pointer(p)).FzJson, zJson, uint64(nJson)) == 0 {
 163953 			(*JsonParse)(unsafe.Pointer(p)).FnErr = U8(0)
 163954 			pMatch = p
 163955 		} else if (*JsonParse)(unsafe.Pointer(p)).FiHold < iMinHold {
 163956 			iMinHold = (*JsonParse)(unsafe.Pointer(p)).FiHold
 163957 			iMinKey = iKey
 163958 		}
 163959 		if (*JsonParse)(unsafe.Pointer(p)).FiHold > iMaxHold {
 163960 			iMaxHold = (*JsonParse)(unsafe.Pointer(p)).FiHold
 163961 		}
 163962 	}
 163963 	if pMatch != 0 {
 163964 		(*JsonParse)(unsafe.Pointer(pMatch)).FnErr = U8(0)
 163965 		(*JsonParse)(unsafe.Pointer(pMatch)).FiHold = iMaxHold + U32(1)
 163966 		return pMatch
 163967 	}
 163968 	p = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(JsonParse{}))+uint64(nJson)+uint64(1))
 163969 	if p == uintptr(0) {
 163970 		Xsqlite3_result_error_nomem(tls, pCtx)
 163971 		return uintptr(0)
 163972 	}
 163973 	libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(JsonParse{})))
 163974 	(*JsonParse)(unsafe.Pointer(p)).FzJson = p + 1*48
 163975 	libc.Xmemcpy(tls, (*JsonParse)(unsafe.Pointer(p)).FzJson, zJson, uint64(nJson+1))
 163976 	if jsonParse(tls, p, pErrCtx, (*JsonParse)(unsafe.Pointer(p)).FzJson) != 0 {
 163977 		Xsqlite3_free(tls, p)
 163978 		return uintptr(0)
 163979 	}
 163980 	(*JsonParse)(unsafe.Pointer(p)).FnJson = nJson
 163981 	(*JsonParse)(unsafe.Pointer(p)).FiHold = iMaxHold + U32(1)
 163982 	Xsqlite3_set_auxdata(tls, pCtx, -429938+iMinKey, p,
 163983 		*(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{jsonParseFree})))
 163984 	return Xsqlite3_get_auxdata(tls, pCtx, -429938+iMinKey)
 163985 }
 163986 
 163987 func jsonLabelCompare(tls *libc.TLS, pNode uintptr, zKey uintptr, nKey U32) int32 {
 163988 	if int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags)&JNODE_RAW != 0 {
 163989 		if (*JsonNode)(unsafe.Pointer(pNode)).Fn != nKey {
 163990 			return 0
 163991 		}
 163992 		return libc.Bool32(libc.Xstrncmp(tls, *(*uintptr)(unsafe.Pointer(pNode + 8)), zKey, uint64(nKey)) == 0)
 163993 	} else {
 163994 		if (*JsonNode)(unsafe.Pointer(pNode)).Fn != nKey+U32(2) {
 163995 			return 0
 163996 		}
 163997 		return libc.Bool32(libc.Xstrncmp(tls, *(*uintptr)(unsafe.Pointer(pNode + 8))+uintptr(1), zKey, uint64(nKey)) == 0)
 163998 	}
 163999 	return int32(0)
 164000 }
 164001 
 164002 func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pApnd uintptr, pzErr uintptr) uintptr {
 164003 	var i U32
 164004 	var j U32
 164005 	var nKey U32
 164006 	var zKey uintptr
 164007 	var pRoot uintptr = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*16
 164008 	if int32(*(*int8)(unsafe.Pointer(zPath))) == 0 {
 164009 		return pRoot
 164010 	}
 164011 	if int32((*JsonNode)(unsafe.Pointer(pRoot)).FjnFlags)&JNODE_REPLACE != 0 {
 164012 		return uintptr(0)
 164013 	}
 164014 	if int32(*(*int8)(unsafe.Pointer(zPath))) == '.' {
 164015 		if int32((*JsonNode)(unsafe.Pointer(pRoot)).FeType) != JSON_OBJECT {
 164016 			return uintptr(0)
 164017 		}
 164018 		zPath++
 164019 		if int32(*(*int8)(unsafe.Pointer(zPath))) == '"' {
 164020 			zKey = zPath + uintptr(1)
 164021 			for i = U32(1); *(*int8)(unsafe.Pointer(zPath + uintptr(i))) != 0 && int32(*(*int8)(unsafe.Pointer(zPath + uintptr(i)))) != '"'; i++ {
 164022 			}
 164023 			nKey = i - U32(1)
 164024 			if *(*int8)(unsafe.Pointer(zPath + uintptr(i))) != 0 {
 164025 				i++
 164026 			} else {
 164027 				*(*uintptr)(unsafe.Pointer(pzErr)) = zPath
 164028 				return uintptr(0)
 164029 			}
 164030 
 164031 		} else {
 164032 			zKey = zPath
 164033 			for i = U32(0); *(*int8)(unsafe.Pointer(zPath + uintptr(i))) != 0 && int32(*(*int8)(unsafe.Pointer(zPath + uintptr(i)))) != '.' && int32(*(*int8)(unsafe.Pointer(zPath + uintptr(i)))) != '['; i++ {
 164034 			}
 164035 			nKey = i
 164036 			if nKey == U32(0) {
 164037 				*(*uintptr)(unsafe.Pointer(pzErr)) = zPath
 164038 				return uintptr(0)
 164039 			}
 164040 		}
 164041 		j = U32(1)
 164042 		for {
 164043 			for j <= (*JsonNode)(unsafe.Pointer(pRoot)).Fn {
 164044 				if jsonLabelCompare(tls, pRoot+uintptr(j)*16, zKey, nKey) != 0 {
 164045 					return jsonLookupStep(tls, pParse, iRoot+j+U32(1), zPath+uintptr(i), pApnd, pzErr)
 164046 				}
 164047 				j++
 164048 				j = j + jsonNodeSize(tls, pRoot+uintptr(j)*16)
 164049 			}
 164050 			if int32((*JsonNode)(unsafe.Pointer(pRoot)).FjnFlags)&JNODE_APPEND == 0 {
 164051 				break
 164052 			}
 164053 
 164054 			iRoot = iRoot + *(*U32)(unsafe.Pointer(pRoot + 8))
 164055 			pRoot = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*16
 164056 			j = U32(1)
 164057 		}
 164058 		if pApnd != 0 {
 164059 			var iStart U32
 164060 			var iLabel U32
 164061 			var pNode uintptr
 164062 			iStart = U32(jsonParseAddNode(tls, pParse, uint32(JSON_OBJECT), uint32(2), uintptr(0)))
 164063 			iLabel = U32(jsonParseAddNode(tls, pParse, uint32(JSON_STRING), nKey, zKey))
 164064 			zPath += uintptr(i)
 164065 			pNode = jsonLookupAppend(tls, pParse, zPath, pApnd, pzErr)
 164066 			if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 {
 164067 				return uintptr(0)
 164068 			}
 164069 			if pNode != 0 {
 164070 				pRoot = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*16
 164071 
 164072 				*(*U32)(unsafe.Pointer(pRoot + 8)) = iStart - iRoot
 164073 				*(*U8)(unsafe.Pointer(pRoot + 1)) |= U8(JNODE_APPEND)
 164074 
 164075 				*(*U8)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iLabel)*16 + 1)) |= U8(JNODE_RAW)
 164076 			}
 164077 			return pNode
 164078 		}
 164079 	} else if int32(*(*int8)(unsafe.Pointer(zPath))) == '[' {
 164080 		i = U32(0)
 164081 		j = U32(1)
 164082 		for int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zPath + uintptr(j))))])&0x04 != 0 {
 164083 			i = i*U32(10) + U32(*(*int8)(unsafe.Pointer(zPath + uintptr(j)))) - U32('0')
 164084 			j++
 164085 		}
 164086 		if j < U32(2) || int32(*(*int8)(unsafe.Pointer(zPath + uintptr(j)))) != ']' {
 164087 			if int32(*(*int8)(unsafe.Pointer(zPath + 1))) == '#' {
 164088 				var pBase uintptr = pRoot
 164089 				var iBase int32 = int32(iRoot)
 164090 				if int32((*JsonNode)(unsafe.Pointer(pRoot)).FeType) != JSON_ARRAY {
 164091 					return uintptr(0)
 164092 				}
 164093 				for {
 164094 					for j <= (*JsonNode)(unsafe.Pointer(pBase)).Fn {
 164095 						if int32((*JsonNode)(unsafe.Pointer(pBase+uintptr(j)*16)).FjnFlags)&JNODE_REMOVE == 0 {
 164096 							i++
 164097 						}
 164098 						j = j + jsonNodeSize(tls, pBase+uintptr(j)*16)
 164099 					}
 164100 					if int32((*JsonNode)(unsafe.Pointer(pBase)).FjnFlags)&JNODE_APPEND == 0 {
 164101 						break
 164102 					}
 164103 
 164104 					iBase = int32(U32(iBase) + *(*U32)(unsafe.Pointer(pBase + 8)))
 164105 					pBase = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iBase)*16
 164106 					j = U32(1)
 164107 				}
 164108 				j = U32(2)
 164109 				if int32(*(*int8)(unsafe.Pointer(zPath + 2))) == '-' && int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zPath + 3)))])&0x04 != 0 {
 164110 					var x uint32 = uint32(0)
 164111 					j = U32(3)
 164112 					for __ccgo := true; __ccgo; __ccgo = int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zPath + uintptr(j))))])&0x04 != 0 {
 164113 						x = x*uint32(10) + uint32(*(*int8)(unsafe.Pointer(zPath + uintptr(j)))) - uint32('0')
 164114 						j++
 164115 					}
 164116 					if x > i {
 164117 						return uintptr(0)
 164118 					}
 164119 					i = i - x
 164120 				}
 164121 				if int32(*(*int8)(unsafe.Pointer(zPath + uintptr(j)))) != ']' {
 164122 					*(*uintptr)(unsafe.Pointer(pzErr)) = zPath
 164123 					return uintptr(0)
 164124 				}
 164125 			} else {
 164126 				*(*uintptr)(unsafe.Pointer(pzErr)) = zPath
 164127 				return uintptr(0)
 164128 			}
 164129 		}
 164130 		if int32((*JsonNode)(unsafe.Pointer(pRoot)).FeType) != JSON_ARRAY {
 164131 			return uintptr(0)
 164132 		}
 164133 		zPath += uintptr(j + U32(1))
 164134 		j = U32(1)
 164135 		for {
 164136 			for j <= (*JsonNode)(unsafe.Pointer(pRoot)).Fn && (i > U32(0) || int32((*JsonNode)(unsafe.Pointer(pRoot+uintptr(j)*16)).FjnFlags)&JNODE_REMOVE != 0) {
 164137 				if int32((*JsonNode)(unsafe.Pointer(pRoot+uintptr(j)*16)).FjnFlags)&JNODE_REMOVE == 0 {
 164138 					i--
 164139 				}
 164140 				j = j + jsonNodeSize(tls, pRoot+uintptr(j)*16)
 164141 			}
 164142 			if int32((*JsonNode)(unsafe.Pointer(pRoot)).FjnFlags)&JNODE_APPEND == 0 {
 164143 				break
 164144 			}
 164145 
 164146 			iRoot = iRoot + *(*U32)(unsafe.Pointer(pRoot + 8))
 164147 			pRoot = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*16
 164148 			j = U32(1)
 164149 		}
 164150 		if j <= (*JsonNode)(unsafe.Pointer(pRoot)).Fn {
 164151 			return jsonLookupStep(tls, pParse, iRoot+j, zPath, pApnd, pzErr)
 164152 		}
 164153 		if i == U32(0) && pApnd != 0 {
 164154 			var iStart U32
 164155 			var pNode uintptr
 164156 			iStart = U32(jsonParseAddNode(tls, pParse, uint32(JSON_ARRAY), uint32(1), uintptr(0)))
 164157 			pNode = jsonLookupAppend(tls, pParse, zPath, pApnd, pzErr)
 164158 			if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 {
 164159 				return uintptr(0)
 164160 			}
 164161 			if pNode != 0 {
 164162 				pRoot = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*16
 164163 
 164164 				*(*U32)(unsafe.Pointer(pRoot + 8)) = iStart - iRoot
 164165 				*(*U8)(unsafe.Pointer(pRoot + 1)) |= U8(JNODE_APPEND)
 164166 
 164167 			}
 164168 			return pNode
 164169 		}
 164170 	} else {
 164171 		*(*uintptr)(unsafe.Pointer(pzErr)) = zPath
 164172 	}
 164173 	return uintptr(0)
 164174 }
 164175 
 164176 func jsonLookupAppend(tls *libc.TLS, pParse uintptr, zPath uintptr, pApnd uintptr, pzErr uintptr) uintptr {
 164177 	*(*int32)(unsafe.Pointer(pApnd)) = 1
 164178 	if int32(*(*int8)(unsafe.Pointer(zPath))) == 0 {
 164179 		jsonParseAddNode(tls, pParse, uint32(JSON_NULL), uint32(0), uintptr(0))
 164180 		if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 {
 164181 			return uintptr(0)
 164182 		}
 164183 		return (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr((*JsonParse)(unsafe.Pointer(pParse)).FnNode-U32(1))*16
 164184 	}
 164185 	if int32(*(*int8)(unsafe.Pointer(zPath))) == '.' {
 164186 		jsonParseAddNode(tls, pParse, uint32(JSON_OBJECT), uint32(0), uintptr(0))
 164187 	} else if libc.Xstrncmp(tls, zPath, ts+25984, uint64(3)) == 0 {
 164188 		jsonParseAddNode(tls, pParse, uint32(JSON_ARRAY), uint32(0), uintptr(0))
 164189 	} else {
 164190 		return uintptr(0)
 164191 	}
 164192 	if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 {
 164193 		return uintptr(0)
 164194 	}
 164195 	return jsonLookupStep(tls, pParse, (*JsonParse)(unsafe.Pointer(pParse)).FnNode-U32(1), zPath, pApnd, pzErr)
 164196 }
 164197 
 164198 func jsonPathSyntaxError(tls *libc.TLS, zErr uintptr) uintptr {
 164199 	bp := tls.Alloc(8)
 164200 	defer tls.Free(8)
 164201 
 164202 	return Xsqlite3_mprintf(tls, ts+25988, libc.VaList(bp, zErr))
 164203 }
 164204 
 164205 func jsonLookup(tls *libc.TLS, pParse uintptr, zPath uintptr, pApnd uintptr, pCtx uintptr) uintptr {
 164206 	bp := tls.Alloc(8)
 164207 	defer tls.Free(8)
 164208 
 164209 	var pNode uintptr
 164210 	var zMsg uintptr
 164211 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 164212 	pNode = uintptr(0)
 164213 
 164214 	if !(zPath == uintptr(0)) {
 164215 		goto __1
 164216 	}
 164217 	return uintptr(0)
 164218 __1:
 164219 	;
 164220 	if !(int32(*(*int8)(unsafe.Pointer(zPath))) != '$') {
 164221 		goto __2
 164222 	}
 164223 	*(*uintptr)(unsafe.Pointer(bp)) = zPath
 164224 	goto lookup_err
 164225 __2:
 164226 	;
 164227 	zPath++
 164228 	pNode = jsonLookupStep(tls, pParse, uint32(0), zPath, pApnd, bp)
 164229 	if !(*(*uintptr)(unsafe.Pointer(bp)) == uintptr(0)) {
 164230 		goto __3
 164231 	}
 164232 	return pNode
 164233 __3:
 164234 	;
 164235 lookup_err:
 164236 	(*JsonParse)(unsafe.Pointer(pParse)).FnErr++
 164237 
 164238 	zMsg = jsonPathSyntaxError(tls, *(*uintptr)(unsafe.Pointer(bp)))
 164239 	if !(zMsg != 0) {
 164240 		goto __4
 164241 	}
 164242 	Xsqlite3_result_error(tls, pCtx, zMsg, -1)
 164243 	Xsqlite3_free(tls, zMsg)
 164244 	goto __5
 164245 __4:
 164246 	Xsqlite3_result_error_nomem(tls, pCtx)
 164247 __5:
 164248 	;
 164249 	return uintptr(0)
 164250 }
 164251 
 164252 func jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) {
 164253 	bp := tls.Alloc(8)
 164254 	defer tls.Free(8)
 164255 
 164256 	var zMsg uintptr = Xsqlite3_mprintf(tls, ts+26014,
 164257 		libc.VaList(bp, zFuncName))
 164258 	Xsqlite3_result_error(tls, pCtx, zMsg, -1)
 164259 	Xsqlite3_free(tls, zMsg)
 164260 }
 164261 
 164262 func jsonRemoveAllNulls(tls *libc.TLS, pNode uintptr) {
 164263 	var i int32
 164264 	var n int32
 164265 
 164266 	n = int32((*JsonNode)(unsafe.Pointer(pNode)).Fn)
 164267 	for i = 2; i <= n; i = int32(U32(i) + (jsonNodeSize(tls, pNode+uintptr(i)*16) + U32(1))) {
 164268 		switch int32((*JsonNode)(unsafe.Pointer(pNode + uintptr(i)*16)).FeType) {
 164269 		case JSON_NULL:
 164270 			*(*U8)(unsafe.Pointer(pNode + uintptr(i)*16 + 1)) |= U8(JNODE_REMOVE)
 164271 			break
 164272 		case JSON_OBJECT:
 164273 			jsonRemoveAllNulls(tls, pNode+uintptr(i)*16)
 164274 			break
 164275 		}
 164276 	}
 164277 }
 164278 
 164279 func jsonQuoteFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) {
 164280 	bp := tls.Alloc(136)
 164281 	defer tls.Free(136)
 164282 
 164283 	_ = argc
 164284 
 164285 	jsonInit(tls, bp, ctx)
 164286 	jsonAppendValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv)))
 164287 	jsonResult(tls, bp)
 164288 	Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE))
 164289 }
 164290 
 164291 func jsonArrayFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) {
 164292 	bp := tls.Alloc(136)
 164293 	defer tls.Free(136)
 164294 
 164295 	var i int32
 164296 
 164297 	jsonInit(tls, bp, ctx)
 164298 	jsonAppendChar(tls, bp, int8('['))
 164299 	for i = 0; i < argc; i++ {
 164300 		jsonAppendSeparator(tls, bp)
 164301 		jsonAppendValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
 164302 	}
 164303 	jsonAppendChar(tls, bp, int8(']'))
 164304 	jsonResult(tls, bp)
 164305 	Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE))
 164306 }
 164307 
 164308 func jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) {
 164309 	var p uintptr
 164310 	var n Sqlite3_int64 = int64(0)
 164311 	var i U32
 164312 	var pNode uintptr
 164313 
 164314 	p = jsonParseCached(tls, ctx, argv, ctx)
 164315 	if p == uintptr(0) {
 164316 		return
 164317 	}
 164318 
 164319 	if argc == 2 {
 164320 		var zPath uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 164321 		pNode = jsonLookup(tls, p, zPath, uintptr(0), ctx)
 164322 	} else {
 164323 		pNode = (*JsonParse)(unsafe.Pointer(p)).FaNode
 164324 	}
 164325 	if pNode == uintptr(0) {
 164326 		return
 164327 	}
 164328 	if int32((*JsonNode)(unsafe.Pointer(pNode)).FeType) == JSON_ARRAY {
 164329 		for i = U32(1); i <= (*JsonNode)(unsafe.Pointer(pNode)).Fn; n++ {
 164330 			i = i + jsonNodeSize(tls, pNode+uintptr(i)*16)
 164331 		}
 164332 	}
 164333 	Xsqlite3_result_int64(tls, ctx, n)
 164334 }
 164335 
 164336 func jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) {
 164337 	bp := tls.Alloc(136)
 164338 	defer tls.Free(136)
 164339 
 164340 	var p uintptr
 164341 	var pNode uintptr
 164342 	var zPath uintptr
 164343 	var flags int32 = int32(Xsqlite3_user_data(tls, ctx))
 164344 
 164345 	if argc < 2 {
 164346 		return
 164347 	}
 164348 	p = jsonParseCached(tls, ctx, argv, ctx)
 164349 	if p == uintptr(0) {
 164350 		return
 164351 	}
 164352 	if argc == 2 {
 164353 		zPath = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 164354 		if zPath == uintptr(0) {
 164355 			return
 164356 		}
 164357 		if flags&JSON_ABPATH != 0 {
 164358 			if int32(*(*int8)(unsafe.Pointer(zPath))) != '$' {
 164359 				jsonInit(tls, bp, ctx)
 164360 				if int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zPath)))])&0x04 != 0 {
 164361 					jsonAppendRaw(tls, bp, ts+26057, uint32(2))
 164362 					jsonAppendRaw(tls, bp, zPath, uint32(int32(libc.Xstrlen(tls, zPath))))
 164363 					jsonAppendRaw(tls, bp, ts+6350, uint32(2))
 164364 				} else {
 164365 					jsonAppendRaw(tls, bp, ts+26060, uint32(1+libc.Bool32(int32(*(*int8)(unsafe.Pointer(zPath))) != '[')))
 164366 					jsonAppendRaw(tls, bp, zPath, uint32(int32(libc.Xstrlen(tls, zPath))))
 164367 					jsonAppendChar(tls, bp, int8(0))
 164368 				}
 164369 				if (*JsonString)(unsafe.Pointer(bp)).FbErr != 0 {
 164370 					pNode = uintptr(0)
 164371 				} else {
 164372 					pNode = jsonLookup(tls, p, (*JsonString)(unsafe.Pointer(bp)).FzBuf, uintptr(0), ctx)
 164373 				}
 164374 				jsonReset(tls, bp)
 164375 			} else {
 164376 				pNode = jsonLookup(tls, p, zPath, uintptr(0), ctx)
 164377 			}
 164378 			if pNode != 0 {
 164379 				if flags&JSON_JSON != 0 {
 164380 					jsonReturnJson(tls, pNode, ctx, uintptr(0))
 164381 				} else {
 164382 					jsonReturn(tls, pNode, ctx, uintptr(0))
 164383 					Xsqlite3_result_subtype(tls, ctx, uint32(0))
 164384 				}
 164385 			}
 164386 		} else {
 164387 			pNode = jsonLookup(tls, p, zPath, uintptr(0), ctx)
 164388 			if int32((*JsonParse)(unsafe.Pointer(p)).FnErr) == 0 && pNode != 0 {
 164389 				jsonReturn(tls, pNode, ctx, uintptr(0))
 164390 			}
 164391 		}
 164392 	} else {
 164393 		var i int32
 164394 		jsonInit(tls, bp, ctx)
 164395 		jsonAppendChar(tls, bp, int8('['))
 164396 		for i = 1; i < argc; i++ {
 164397 			zPath = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
 164398 			pNode = jsonLookup(tls, p, zPath, uintptr(0), ctx)
 164399 			if (*JsonParse)(unsafe.Pointer(p)).FnErr != 0 {
 164400 				break
 164401 			}
 164402 			jsonAppendSeparator(tls, bp)
 164403 			if pNode != 0 {
 164404 				jsonRenderNode(tls, pNode, bp, uintptr(0))
 164405 			} else {
 164406 				jsonAppendRaw(tls, bp, ts+7533, uint32(4))
 164407 			}
 164408 		}
 164409 		if i == argc {
 164410 			jsonAppendChar(tls, bp, int8(']'))
 164411 			jsonResult(tls, bp)
 164412 			Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE))
 164413 		}
 164414 		jsonReset(tls, bp)
 164415 	}
 164416 }
 164417 
 164418 func jsonMergePatch(tls *libc.TLS, pParse uintptr, iTarget U32, pPatch uintptr) uintptr {
 164419 	var i U32
 164420 	var j U32
 164421 	var iRoot U32
 164422 	var pTarget uintptr
 164423 	if int32((*JsonNode)(unsafe.Pointer(pPatch)).FeType) != JSON_OBJECT {
 164424 		return pPatch
 164425 	}
 164426 
 164427 	pTarget = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iTarget)*16
 164428 
 164429 	if int32((*JsonNode)(unsafe.Pointer(pTarget)).FeType) != JSON_OBJECT {
 164430 		jsonRemoveAllNulls(tls, pPatch)
 164431 		return pPatch
 164432 	}
 164433 	iRoot = iTarget
 164434 	for i = U32(1); i < (*JsonNode)(unsafe.Pointer(pPatch)).Fn; i = i + (jsonNodeSize(tls, pPatch+uintptr(i+U32(1))*16) + U32(1)) {
 164435 		var nKey U32
 164436 		var zKey uintptr
 164437 
 164438 		nKey = (*JsonNode)(unsafe.Pointer(pPatch + uintptr(i)*16)).Fn
 164439 		zKey = *(*uintptr)(unsafe.Pointer(pPatch + uintptr(i)*16 + 8))
 164440 
 164441 		for j = U32(1); j < (*JsonNode)(unsafe.Pointer(pTarget)).Fn; j = j + (jsonNodeSize(tls, pTarget+uintptr(j+U32(1))*16) + U32(1)) {
 164442 			if (*JsonNode)(unsafe.Pointer(pTarget+uintptr(j)*16)).Fn == nKey && libc.Xstrncmp(tls, *(*uintptr)(unsafe.Pointer(pTarget + uintptr(j)*16 + 8)), zKey, uint64(nKey)) == 0 {
 164443 				if int32((*JsonNode)(unsafe.Pointer(pTarget+uintptr(j+U32(1))*16)).FjnFlags)&(JNODE_REMOVE|JNODE_PATCH) != 0 {
 164444 					break
 164445 				}
 164446 				if int32((*JsonNode)(unsafe.Pointer(pPatch+uintptr(i+U32(1))*16)).FeType) == JSON_NULL {
 164447 					*(*U8)(unsafe.Pointer(pTarget + uintptr(j+U32(1))*16 + 1)) |= U8(JNODE_REMOVE)
 164448 				} else {
 164449 					var pNew uintptr = jsonMergePatch(tls, pParse, iTarget+j+U32(1), pPatch+uintptr(i+U32(1))*16)
 164450 					if pNew == uintptr(0) {
 164451 						return uintptr(0)
 164452 					}
 164453 					pTarget = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iTarget)*16
 164454 					if pNew != pTarget+uintptr(j+U32(1))*16 {
 164455 						*(*uintptr)(unsafe.Pointer(pTarget + uintptr(j+U32(1))*16 + 8)) = pNew
 164456 						*(*U8)(unsafe.Pointer(pTarget + uintptr(j+U32(1))*16 + 1)) |= U8(JNODE_PATCH)
 164457 					}
 164458 				}
 164459 				break
 164460 			}
 164461 		}
 164462 		if j >= (*JsonNode)(unsafe.Pointer(pTarget)).Fn && int32((*JsonNode)(unsafe.Pointer(pPatch+uintptr(i+U32(1))*16)).FeType) != JSON_NULL {
 164463 			var iStart int32
 164464 			var iPatch int32
 164465 			iStart = jsonParseAddNode(tls, pParse, uint32(JSON_OBJECT), uint32(2), uintptr(0))
 164466 			jsonParseAddNode(tls, pParse, uint32(JSON_STRING), nKey, zKey)
 164467 			iPatch = jsonParseAddNode(tls, pParse, uint32(JSON_TRUE), uint32(0), uintptr(0))
 164468 			if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 {
 164469 				return uintptr(0)
 164470 			}
 164471 			jsonRemoveAllNulls(tls, pPatch)
 164472 			pTarget = (*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iTarget)*16
 164473 
 164474 			*(*U8)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*16 + 1)) |= U8(JNODE_APPEND)
 164475 
 164476 			*(*U32)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*16 + 8)) = U32(iStart) - iRoot
 164477 			iRoot = U32(iStart)
 164478 
 164479 			*(*U8)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iPatch)*16 + 1)) |= U8(JNODE_PATCH)
 164480 			*(*uintptr)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iPatch)*16 + 8)) = pPatch + uintptr(i+U32(1))*16
 164481 		}
 164482 	}
 164483 	return pTarget
 164484 }
 164485 
 164486 func jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) {
 164487 	bp := tls.Alloc(96)
 164488 	defer tls.Free(96)
 164489 
 164490 	var pResult uintptr
 164491 
 164492 	_ = argc
 164493 	if jsonParse(tls, bp, ctx, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))) != 0 {
 164494 		return
 164495 	}
 164496 	if jsonParse(tls, bp+48, ctx, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))) != 0 {
 164497 		jsonParseReset(tls, bp)
 164498 		return
 164499 	}
 164500 	pResult = jsonMergePatch(tls, bp, uint32(0), (*JsonParse)(unsafe.Pointer(bp+48)).FaNode)
 164501 
 164502 	if pResult != 0 {
 164503 		jsonReturnJson(tls, pResult, ctx, uintptr(0))
 164504 	} else {
 164505 		Xsqlite3_result_error_nomem(tls, ctx)
 164506 	}
 164507 	jsonParseReset(tls, bp)
 164508 	jsonParseReset(tls, bp+48)
 164509 }
 164510 
 164511 func jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) {
 164512 	bp := tls.Alloc(136)
 164513 	defer tls.Free(136)
 164514 
 164515 	var i int32
 164516 
 164517 	var z uintptr
 164518 	var n U32
 164519 
 164520 	if argc&1 != 0 {
 164521 		Xsqlite3_result_error(tls, ctx,
 164522 			ts+26063, -1)
 164523 		return
 164524 	}
 164525 	jsonInit(tls, bp, ctx)
 164526 	jsonAppendChar(tls, bp, int8('{'))
 164527 	for i = 0; i < argc; i = i + 2 {
 164528 		if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != SQLITE_TEXT {
 164529 			Xsqlite3_result_error(tls, ctx, ts+26114, -1)
 164530 			jsonReset(tls, bp)
 164531 			return
 164532 		}
 164533 		jsonAppendSeparator(tls, bp)
 164534 		z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
 164535 		n = U32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
 164536 		jsonAppendString(tls, bp, z, n)
 164537 		jsonAppendChar(tls, bp, int8(':'))
 164538 		jsonAppendValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv + uintptr(i+1)*8)))
 164539 	}
 164540 	jsonAppendChar(tls, bp, int8('}'))
 164541 	jsonResult(tls, bp)
 164542 	Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE))
 164543 }
 164544 
 164545 func jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) {
 164546 	bp := tls.Alloc(48)
 164547 	defer tls.Free(48)
 164548 
 164549 	var pNode uintptr
 164550 	var zPath uintptr
 164551 	var i U32
 164552 
 164553 	if !(argc < 1) {
 164554 		goto __1
 164555 	}
 164556 	return
 164557 __1:
 164558 	;
 164559 	if !(jsonParse(tls, bp, ctx, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))) != 0) {
 164560 		goto __2
 164561 	}
 164562 	return
 164563 __2:
 164564 	;
 164565 	i = U32(1)
 164566 __3:
 164567 	if !(i < U32(argc)) {
 164568 		goto __5
 164569 	}
 164570 	zPath = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
 164571 	if !(zPath == uintptr(0)) {
 164572 		goto __6
 164573 	}
 164574 	goto remove_done
 164575 __6:
 164576 	;
 164577 	pNode = jsonLookup(tls, bp, zPath, uintptr(0), ctx)
 164578 	if !((*JsonParse)(unsafe.Pointer(bp)).FnErr != 0) {
 164579 		goto __7
 164580 	}
 164581 	goto remove_done
 164582 __7:
 164583 	;
 164584 	if !(pNode != 0) {
 164585 		goto __8
 164586 	}
 164587 	*(*U8)(unsafe.Pointer(pNode + 1)) |= U8(JNODE_REMOVE)
 164588 __8:
 164589 	;
 164590 	goto __4
 164591 __4:
 164592 	i++
 164593 	goto __3
 164594 	goto __5
 164595 __5:
 164596 	;
 164597 	if !(int32((*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(bp)).FaNode)).FjnFlags)&JNODE_REMOVE == 0) {
 164598 		goto __9
 164599 	}
 164600 	jsonReturnJson(tls, (*JsonParse)(unsafe.Pointer(bp)).FaNode, ctx, uintptr(0))
 164601 __9:
 164602 	;
 164603 remove_done:
 164604 	jsonParseReset(tls, bp)
 164605 }
 164606 
 164607 func jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) {
 164608 	bp := tls.Alloc(48)
 164609 	defer tls.Free(48)
 164610 
 164611 	var pNode uintptr
 164612 	var zPath uintptr
 164613 	var i U32
 164614 
 164615 	if !(argc < 1) {
 164616 		goto __1
 164617 	}
 164618 	return
 164619 __1:
 164620 	;
 164621 	if !(argc&1 == 0) {
 164622 		goto __2
 164623 	}
 164624 	jsonWrongNumArgs(tls, ctx, ts+16737)
 164625 	return
 164626 __2:
 164627 	;
 164628 	if !(jsonParse(tls, bp, ctx, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))) != 0) {
 164629 		goto __3
 164630 	}
 164631 	return
 164632 __3:
 164633 	;
 164634 	i = U32(1)
 164635 __4:
 164636 	if !(i < U32(argc)) {
 164637 		goto __6
 164638 	}
 164639 	zPath = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
 164640 	pNode = jsonLookup(tls, bp, zPath, uintptr(0), ctx)
 164641 	if !((*JsonParse)(unsafe.Pointer(bp)).FnErr != 0) {
 164642 		goto __7
 164643 	}
 164644 	goto replace_err
 164645 __7:
 164646 	;
 164647 	if !(pNode != 0) {
 164648 		goto __8
 164649 	}
 164650 
 164651 	*(*U8)(unsafe.Pointer(pNode + 1)) |= U8(int32(U8(JNODE_REPLACE)))
 164652 
 164653 	*(*U32)(unsafe.Pointer(pNode + 8)) = i + U32(1)
 164654 __8:
 164655 	;
 164656 	goto __5
 164657 __5:
 164658 	i = i + U32(2)
 164659 	goto __4
 164660 	goto __6
 164661 __6:
 164662 	;
 164663 	if !(int32((*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(bp)).FaNode)).FjnFlags)&JNODE_REPLACE != 0) {
 164664 		goto __9
 164665 	}
 164666 
 164667 	Xsqlite3_result_value(tls, ctx, *(*uintptr)(unsafe.Pointer(argv + uintptr(*(*U32)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(bp)).FaNode + 8)))*8)))
 164668 	goto __10
 164669 __9:
 164670 	jsonReturnJson(tls, (*JsonParse)(unsafe.Pointer(bp)).FaNode, ctx, argv)
 164671 __10:
 164672 	;
 164673 replace_err:
 164674 	jsonParseReset(tls, bp)
 164675 }
 164676 
 164677 func jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) {
 164678 	bp := tls.Alloc(52)
 164679 	defer tls.Free(52)
 164680 
 164681 	var pNode uintptr
 164682 	var zPath uintptr
 164683 	var i U32
 164684 
 164685 	var bIsSet int32
 164686 	bIsSet = libc.Bool32(Xsqlite3_user_data(tls, ctx) != uintptr(0))
 164687 
 164688 	if !(argc < 1) {
 164689 		goto __1
 164690 	}
 164691 	return
 164692 __1:
 164693 	;
 164694 	if !(argc&1 == 0) {
 164695 		goto __2
 164696 	}
 164697 	jsonWrongNumArgs(tls, ctx, func() uintptr {
 164698 		if bIsSet != 0 {
 164699 			return ts + 26148
 164700 		}
 164701 		return ts + 26152
 164702 	}())
 164703 	return
 164704 __2:
 164705 	;
 164706 	if !(jsonParse(tls, bp, ctx, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))) != 0) {
 164707 		goto __3
 164708 	}
 164709 	return
 164710 __3:
 164711 	;
 164712 	i = U32(1)
 164713 __4:
 164714 	if !(i < U32(argc)) {
 164715 		goto __6
 164716 	}
 164717 	zPath = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
 164718 	*(*int32)(unsafe.Pointer(bp + 48)) = 0
 164719 	pNode = jsonLookup(tls, bp, zPath, bp+48, ctx)
 164720 	if !((*JsonParse)(unsafe.Pointer(bp)).Foom != 0) {
 164721 		goto __7
 164722 	}
 164723 	Xsqlite3_result_error_nomem(tls, ctx)
 164724 	goto jsonSetDone
 164725 	goto __8
 164726 __7:
 164727 	if !((*JsonParse)(unsafe.Pointer(bp)).FnErr != 0) {
 164728 		goto __9
 164729 	}
 164730 	goto jsonSetDone
 164731 	goto __10
 164732 __9:
 164733 	if !(pNode != 0 && (*(*int32)(unsafe.Pointer(bp + 48)) != 0 || bIsSet != 0)) {
 164734 		goto __11
 164735 	}
 164736 
 164737 	*(*U8)(unsafe.Pointer(pNode + 1)) |= U8(int32(U8(JNODE_REPLACE)))
 164738 	*(*U32)(unsafe.Pointer(pNode + 8)) = i + U32(1)
 164739 __11:
 164740 	;
 164741 __10:
 164742 	;
 164743 __8:
 164744 	;
 164745 	goto __5
 164746 __5:
 164747 	i = i + U32(2)
 164748 	goto __4
 164749 	goto __6
 164750 __6:
 164751 	;
 164752 	if !(int32((*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(bp)).FaNode)).FjnFlags)&JNODE_REPLACE != 0) {
 164753 		goto __12
 164754 	}
 164755 
 164756 	Xsqlite3_result_value(tls, ctx, *(*uintptr)(unsafe.Pointer(argv + uintptr(*(*U32)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(bp)).FaNode + 8)))*8)))
 164757 	goto __13
 164758 __12:
 164759 	jsonReturnJson(tls, (*JsonParse)(unsafe.Pointer(bp)).FaNode, ctx, argv)
 164760 __13:
 164761 	;
 164762 jsonSetDone:
 164763 	jsonParseReset(tls, bp)
 164764 }
 164765 
 164766 func jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) {
 164767 	var p uintptr
 164768 	var zPath uintptr
 164769 	var pNode uintptr
 164770 
 164771 	p = jsonParseCached(tls, ctx, argv, ctx)
 164772 	if p == uintptr(0) {
 164773 		return
 164774 	}
 164775 	if argc == 2 {
 164776 		zPath = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 164777 		pNode = jsonLookup(tls, p, zPath, uintptr(0), ctx)
 164778 	} else {
 164779 		pNode = (*JsonParse)(unsafe.Pointer(p)).FaNode
 164780 	}
 164781 	if pNode != 0 {
 164782 		Xsqlite3_result_text(tls, ctx, jsonType[(*JsonNode)(unsafe.Pointer(pNode)).FeType], -1, uintptr(0))
 164783 	}
 164784 }
 164785 
 164786 func jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) {
 164787 	var p uintptr
 164788 	_ = argc
 164789 	p = jsonParseCached(tls, ctx, argv, uintptr(0))
 164790 	Xsqlite3_result_int(tls, ctx, libc.Bool32(p != uintptr(0)))
 164791 }
 164792 
 164793 func jsonArrayStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) {
 164794 	var pStr uintptr
 164795 	_ = argc
 164796 	pStr = Xsqlite3_aggregate_context(tls, ctx, int32(unsafe.Sizeof(JsonString{})))
 164797 	if pStr != 0 {
 164798 		if (*JsonString)(unsafe.Pointer(pStr)).FzBuf == uintptr(0) {
 164799 			jsonInit(tls, pStr, ctx)
 164800 			jsonAppendChar(tls, pStr, int8('['))
 164801 		} else if (*JsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) {
 164802 			jsonAppendChar(tls, pStr, int8(','))
 164803 		}
 164804 		(*JsonString)(unsafe.Pointer(pStr)).FpCtx = ctx
 164805 		jsonAppendValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv)))
 164806 	}
 164807 }
 164808 
 164809 func jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) {
 164810 	var pStr uintptr
 164811 	pStr = Xsqlite3_aggregate_context(tls, ctx, 0)
 164812 	if pStr != 0 {
 164813 		(*JsonString)(unsafe.Pointer(pStr)).FpCtx = ctx
 164814 		jsonAppendChar(tls, pStr, int8(']'))
 164815 		if (*JsonString)(unsafe.Pointer(pStr)).FbErr != 0 {
 164816 			if int32((*JsonString)(unsafe.Pointer(pStr)).FbErr) == 1 {
 164817 				Xsqlite3_result_error_nomem(tls, ctx)
 164818 			}
 164819 
 164820 		} else if isFinal != 0 {
 164821 			Xsqlite3_result_text(tls, ctx, (*JsonString)(unsafe.Pointer(pStr)).FzBuf, int32((*JsonString)(unsafe.Pointer(pStr)).FnUsed),
 164822 				func() uintptr {
 164823 					if (*JsonString)(unsafe.Pointer(pStr)).FbStatic != 0 {
 164824 						return libc.UintptrFromInt32(-1)
 164825 					}
 164826 					return *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))
 164827 				}())
 164828 			(*JsonString)(unsafe.Pointer(pStr)).FbStatic = U8(1)
 164829 		} else {
 164830 			Xsqlite3_result_text(tls, ctx, (*JsonString)(unsafe.Pointer(pStr)).FzBuf, int32((*JsonString)(unsafe.Pointer(pStr)).FnUsed), libc.UintptrFromInt32(-1))
 164831 			(*JsonString)(unsafe.Pointer(pStr)).FnUsed--
 164832 		}
 164833 	} else {
 164834 		Xsqlite3_result_text(tls, ctx, ts+26159, 2, uintptr(0))
 164835 	}
 164836 	Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE))
 164837 }
 164838 
 164839 func jsonArrayValue(tls *libc.TLS, ctx uintptr) {
 164840 	jsonArrayCompute(tls, ctx, 0)
 164841 }
 164842 
 164843 func jsonArrayFinal(tls *libc.TLS, ctx uintptr) {
 164844 	jsonArrayCompute(tls, ctx, 1)
 164845 }
 164846 
 164847 func jsonGroupInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) {
 164848 	var i uint32
 164849 	var inStr int32 = 0
 164850 	var nNest int32 = 0
 164851 	var z uintptr
 164852 	var c int8
 164853 	var pStr uintptr
 164854 	_ = argc
 164855 	_ = argv
 164856 	pStr = Xsqlite3_aggregate_context(tls, ctx, 0)
 164857 
 164858 	if !(pStr != 0) {
 164859 		return
 164860 	}
 164861 	z = (*JsonString)(unsafe.Pointer(pStr)).FzBuf
 164862 	for i = uint32(1); U64(i) < (*JsonString)(unsafe.Pointer(pStr)).FnUsed && (int32(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer(z + uintptr(i))))) != ',' || inStr != 0 || nNest != 0); i++ {
 164863 		if int32(c) == '"' {
 164864 			inStr = libc.BoolInt32(!(inStr != 0))
 164865 		} else if int32(c) == '\\' {
 164866 			i++
 164867 		} else if !(inStr != 0) {
 164868 			if int32(c) == '{' || int32(c) == '[' {
 164869 				nNest++
 164870 			}
 164871 			if int32(c) == '}' || int32(c) == ']' {
 164872 				nNest--
 164873 			}
 164874 		}
 164875 	}
 164876 	if U64(i) < (*JsonString)(unsafe.Pointer(pStr)).FnUsed {
 164877 		*(*U64)(unsafe.Pointer(pStr + 24)) -= U64(i)
 164878 		libc.Xmemmove(tls, z+1, z+uintptr(i+uint32(1)), (*JsonString)(unsafe.Pointer(pStr)).FnUsed-uint64(1))
 164879 		*(*int8)(unsafe.Pointer(z + uintptr((*JsonString)(unsafe.Pointer(pStr)).FnUsed))) = int8(0)
 164880 	} else {
 164881 		(*JsonString)(unsafe.Pointer(pStr)).FnUsed = uint64(1)
 164882 	}
 164883 }
 164884 
 164885 func jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) {
 164886 	var pStr uintptr
 164887 	var z uintptr
 164888 	var n U32
 164889 	_ = argc
 164890 	pStr = Xsqlite3_aggregate_context(tls, ctx, int32(unsafe.Sizeof(JsonString{})))
 164891 	if pStr != 0 {
 164892 		if (*JsonString)(unsafe.Pointer(pStr)).FzBuf == uintptr(0) {
 164893 			jsonInit(tls, pStr, ctx)
 164894 			jsonAppendChar(tls, pStr, int8('{'))
 164895 		} else if (*JsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) {
 164896 			jsonAppendChar(tls, pStr, int8(','))
 164897 		}
 164898 		(*JsonString)(unsafe.Pointer(pStr)).FpCtx = ctx
 164899 		z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 164900 		n = U32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))))
 164901 		jsonAppendString(tls, pStr, z, n)
 164902 		jsonAppendChar(tls, pStr, int8(':'))
 164903 		jsonAppendValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 164904 	}
 164905 }
 164906 
 164907 func jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) {
 164908 	var pStr uintptr
 164909 	pStr = Xsqlite3_aggregate_context(tls, ctx, 0)
 164910 	if pStr != 0 {
 164911 		jsonAppendChar(tls, pStr, int8('}'))
 164912 		if (*JsonString)(unsafe.Pointer(pStr)).FbErr != 0 {
 164913 			if int32((*JsonString)(unsafe.Pointer(pStr)).FbErr) == 1 {
 164914 				Xsqlite3_result_error_nomem(tls, ctx)
 164915 			}
 164916 
 164917 		} else if isFinal != 0 {
 164918 			Xsqlite3_result_text(tls, ctx, (*JsonString)(unsafe.Pointer(pStr)).FzBuf, int32((*JsonString)(unsafe.Pointer(pStr)).FnUsed),
 164919 				func() uintptr {
 164920 					if (*JsonString)(unsafe.Pointer(pStr)).FbStatic != 0 {
 164921 						return libc.UintptrFromInt32(-1)
 164922 					}
 164923 					return *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))
 164924 				}())
 164925 			(*JsonString)(unsafe.Pointer(pStr)).FbStatic = U8(1)
 164926 		} else {
 164927 			Xsqlite3_result_text(tls, ctx, (*JsonString)(unsafe.Pointer(pStr)).FzBuf, int32((*JsonString)(unsafe.Pointer(pStr)).FnUsed), libc.UintptrFromInt32(-1))
 164928 			(*JsonString)(unsafe.Pointer(pStr)).FnUsed--
 164929 		}
 164930 	} else {
 164931 		Xsqlite3_result_text(tls, ctx, ts+26162, 2, uintptr(0))
 164932 	}
 164933 	Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE))
 164934 }
 164935 
 164936 func jsonObjectValue(tls *libc.TLS, ctx uintptr) {
 164937 	jsonObjectCompute(tls, ctx, 0)
 164938 }
 164939 
 164940 func jsonObjectFinal(tls *libc.TLS, ctx uintptr) {
 164941 	jsonObjectCompute(tls, ctx, 1)
 164942 }
 164943 
 164944 // ***************************************************************************
 164945 //
 164946 // The json_each virtual table
 164947 type JsonEachCursor1 = struct {
 164948 	Fbase        Sqlite3_vtab_cursor
 164949 	FiRowid      U32
 164950 	FiBegin      U32
 164951 	Fi           U32
 164952 	FiEnd        U32
 164953 	FeType       U8
 164954 	FbRecursive  U8
 164955 	F__ccgo_pad1 [6]byte
 164956 	FzJson       uintptr
 164957 	FzRoot       uintptr
 164958 	FsParse      JsonParse
 164959 }
 164960 
 164961 // ***************************************************************************
 164962 //
 164963 // The json_each virtual table
 164964 type JsonEachCursor = JsonEachCursor1
 164965 
 164966 func jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 {
 164967 	var pNew uintptr
 164968 	var rc int32
 164969 
 164970 	_ = pzErr
 164971 	_ = argv
 164972 	_ = argc
 164973 	_ = pAux
 164974 	rc = Xsqlite3_declare_vtab(tls, db,
 164975 		ts+26165)
 164976 	if rc == SQLITE_OK {
 164977 		pNew = libc.AssignPtrUintptr(ppVtab, Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Sqlite3_vtab{}))))
 164978 		if pNew == uintptr(0) {
 164979 			return SQLITE_NOMEM
 164980 		}
 164981 		libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(Sqlite3_vtab{})))
 164982 		Xsqlite3_vtab_config(tls, db, SQLITE_VTAB_INNOCUOUS, 0)
 164983 	}
 164984 	return rc
 164985 }
 164986 
 164987 func jsonEachDisconnect(tls *libc.TLS, pVtab uintptr) int32 {
 164988 	Xsqlite3_free(tls, pVtab)
 164989 	return SQLITE_OK
 164990 }
 164991 
 164992 func jsonEachOpenEach(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 {
 164993 	var pCur uintptr
 164994 
 164995 	_ = p
 164996 	pCur = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(JsonEachCursor{})))
 164997 	if pCur == uintptr(0) {
 164998 		return SQLITE_NOMEM
 164999 	}
 165000 	libc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(JsonEachCursor{})))
 165001 	*(*uintptr)(unsafe.Pointer(ppCursor)) = pCur
 165002 	return SQLITE_OK
 165003 }
 165004 
 165005 func jsonEachOpenTree(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 {
 165006 	var rc int32 = jsonEachOpenEach(tls, p, ppCursor)
 165007 	if rc == SQLITE_OK {
 165008 		var pCur uintptr = *(*uintptr)(unsafe.Pointer(ppCursor))
 165009 		(*JsonEachCursor)(unsafe.Pointer(pCur)).FbRecursive = U8(1)
 165010 	}
 165011 	return rc
 165012 }
 165013 
 165014 func jsonEachCursorReset(tls *libc.TLS, p uintptr) {
 165015 	Xsqlite3_free(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FzJson)
 165016 	Xsqlite3_free(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot)
 165017 	jsonParseReset(tls, p+48)
 165018 	(*JsonEachCursor)(unsafe.Pointer(p)).FiRowid = U32(0)
 165019 	(*JsonEachCursor)(unsafe.Pointer(p)).Fi = U32(0)
 165020 	(*JsonEachCursor)(unsafe.Pointer(p)).FiEnd = U32(0)
 165021 	(*JsonEachCursor)(unsafe.Pointer(p)).FeType = U8(0)
 165022 	(*JsonEachCursor)(unsafe.Pointer(p)).FzJson = uintptr(0)
 165023 	(*JsonEachCursor)(unsafe.Pointer(p)).FzRoot = uintptr(0)
 165024 }
 165025 
 165026 func jsonEachClose(tls *libc.TLS, cur uintptr) int32 {
 165027 	var p uintptr = cur
 165028 	jsonEachCursorReset(tls, p)
 165029 	Xsqlite3_free(tls, cur)
 165030 	return SQLITE_OK
 165031 }
 165032 
 165033 func jsonEachEof(tls *libc.TLS, cur uintptr) int32 {
 165034 	var p uintptr = cur
 165035 	return libc.Bool32((*JsonEachCursor)(unsafe.Pointer(p)).Fi >= (*JsonEachCursor)(unsafe.Pointer(p)).FiEnd)
 165036 }
 165037 
 165038 func jsonEachNext(tls *libc.TLS, cur uintptr) int32 {
 165039 	var p uintptr = cur
 165040 	if (*JsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0 {
 165041 		if int32((*JsonNode)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode+uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*16)).FjnFlags)&JNODE_LABEL != 0 {
 165042 			(*JsonEachCursor)(unsafe.Pointer(p)).Fi++
 165043 		}
 165044 		(*JsonEachCursor)(unsafe.Pointer(p)).Fi++
 165045 		(*JsonEachCursor)(unsafe.Pointer(p)).FiRowid++
 165046 		if (*JsonEachCursor)(unsafe.Pointer(p)).Fi < (*JsonEachCursor)(unsafe.Pointer(p)).FiEnd {
 165047 			var iUp U32 = *(*U32)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaUp + uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*4))
 165048 			var pUp uintptr = (*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr(iUp)*16
 165049 			(*JsonEachCursor)(unsafe.Pointer(p)).FeType = (*JsonNode)(unsafe.Pointer(pUp)).FeType
 165050 			if int32((*JsonNode)(unsafe.Pointer(pUp)).FeType) == JSON_ARRAY {
 165051 				if iUp == (*JsonEachCursor)(unsafe.Pointer(p)).Fi-U32(1) {
 165052 					*(*U32)(unsafe.Pointer(pUp + 8)) = U32(0)
 165053 				} else {
 165054 					*(*U32)(unsafe.Pointer(pUp + 8))++
 165055 				}
 165056 			}
 165057 		}
 165058 	} else {
 165059 		switch int32((*JsonEachCursor)(unsafe.Pointer(p)).FeType) {
 165060 		case JSON_ARRAY:
 165061 			{
 165062 				*(*U32)(unsafe.Pointer(p + 16)) += jsonNodeSize(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode+uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*16)
 165063 				(*JsonEachCursor)(unsafe.Pointer(p)).FiRowid++
 165064 				break
 165065 
 165066 			}
 165067 			fallthrough
 165068 		case JSON_OBJECT:
 165069 			{
 165070 				*(*U32)(unsafe.Pointer(p + 16)) += U32(1) + jsonNodeSize(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode+uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi+U32(1))*16)
 165071 				(*JsonEachCursor)(unsafe.Pointer(p)).FiRowid++
 165072 				break
 165073 
 165074 			}
 165075 			fallthrough
 165076 		default:
 165077 			{
 165078 				(*JsonEachCursor)(unsafe.Pointer(p)).Fi = (*JsonEachCursor)(unsafe.Pointer(p)).FiEnd
 165079 				break
 165080 
 165081 			}
 165082 		}
 165083 	}
 165084 	return SQLITE_OK
 165085 }
 165086 
 165087 func jsonAppendObjectPathElement(tls *libc.TLS, pStr uintptr, pNode uintptr) {
 165088 	bp := tls.Alloc(16)
 165089 	defer tls.Free(16)
 165090 
 165091 	var jj int32
 165092 	var nn int32
 165093 	var z uintptr
 165094 
 165095 	z = *(*uintptr)(unsafe.Pointer(pNode + 8))
 165096 	nn = int32((*JsonNode)(unsafe.Pointer(pNode)).Fn)
 165097 
 165098 	if nn > 2 && int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + 1)))])&0x02 != 0 {
 165099 		for jj = 2; jj < nn-1 && int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(jj))))])&0x06 != 0; jj++ {
 165100 		}
 165101 		if jj == nn-1 {
 165102 			z++
 165103 			nn = nn - 2
 165104 		}
 165105 	}
 165106 	jsonPrintf(tls, nn+2, pStr, ts+26248, libc.VaList(bp, nn, z))
 165107 }
 165108 
 165109 func jsonEachComputePath(tls *libc.TLS, p uintptr, pStr uintptr, i U32) {
 165110 	bp := tls.Alloc(8)
 165111 	defer tls.Free(8)
 165112 
 165113 	var pNode uintptr
 165114 	var pUp uintptr
 165115 	var iUp U32
 165116 	if i == U32(0) {
 165117 		jsonAppendChar(tls, pStr, int8('$'))
 165118 		return
 165119 	}
 165120 	iUp = *(*U32)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaUp + uintptr(i)*4))
 165121 	jsonEachComputePath(tls, p, pStr, iUp)
 165122 	pNode = (*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr(i)*16
 165123 	pUp = (*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr(iUp)*16
 165124 	if int32((*JsonNode)(unsafe.Pointer(pUp)).FeType) == JSON_ARRAY {
 165125 		jsonPrintf(tls, 30, pStr, ts+26254, libc.VaList(bp, *(*U32)(unsafe.Pointer(pUp + 8))))
 165126 	} else {
 165127 		if int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags)&JNODE_LABEL == 0 {
 165128 			pNode -= 16
 165129 		}
 165130 		jsonAppendObjectPathElement(tls, pStr, pNode)
 165131 	}
 165132 }
 165133 
 165134 func jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 {
 165135 	bp := tls.Alloc(280)
 165136 	defer tls.Free(280)
 165137 
 165138 	var p uintptr = cur
 165139 	var pThis uintptr = (*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*16
 165140 	switch i {
 165141 	case JEACH_KEY:
 165142 		{
 165143 			if (*JsonEachCursor)(unsafe.Pointer(p)).Fi == U32(0) {
 165144 				break
 165145 			}
 165146 			if int32((*JsonEachCursor)(unsafe.Pointer(p)).FeType) == JSON_OBJECT {
 165147 				jsonReturn(tls, pThis, ctx, uintptr(0))
 165148 			} else if int32((*JsonEachCursor)(unsafe.Pointer(p)).FeType) == JSON_ARRAY {
 165149 				var iKey U32
 165150 				if (*JsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0 {
 165151 					if (*JsonEachCursor)(unsafe.Pointer(p)).FiRowid == U32(0) {
 165152 						break
 165153 					}
 165154 
 165155 					iKey = *(*U32)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr(*(*U32)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaUp + uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*4)))*16 + 8))
 165156 				} else {
 165157 					iKey = (*JsonEachCursor)(unsafe.Pointer(p)).FiRowid
 165158 				}
 165159 				Xsqlite3_result_int64(tls, ctx, Sqlite3_int64(iKey))
 165160 			}
 165161 			break
 165162 
 165163 		}
 165164 	case JEACH_VALUE:
 165165 		{
 165166 			if int32((*JsonNode)(unsafe.Pointer(pThis)).FjnFlags)&JNODE_LABEL != 0 {
 165167 				pThis += 16
 165168 			}
 165169 			jsonReturn(tls, pThis, ctx, uintptr(0))
 165170 			break
 165171 
 165172 		}
 165173 	case JEACH_TYPE:
 165174 		{
 165175 			if int32((*JsonNode)(unsafe.Pointer(pThis)).FjnFlags)&JNODE_LABEL != 0 {
 165176 				pThis += 16
 165177 			}
 165178 			Xsqlite3_result_text(tls, ctx, jsonType[(*JsonNode)(unsafe.Pointer(pThis)).FeType], -1, uintptr(0))
 165179 			break
 165180 
 165181 		}
 165182 	case JEACH_ATOM:
 165183 		{
 165184 			if int32((*JsonNode)(unsafe.Pointer(pThis)).FjnFlags)&JNODE_LABEL != 0 {
 165185 				pThis += 16
 165186 			}
 165187 			if int32((*JsonNode)(unsafe.Pointer(pThis)).FeType) >= JSON_ARRAY {
 165188 				break
 165189 			}
 165190 			jsonReturn(tls, pThis, ctx, uintptr(0))
 165191 			break
 165192 
 165193 		}
 165194 	case JEACH_ID:
 165195 		{
 165196 			Xsqlite3_result_int64(tls, ctx,
 165197 				Sqlite3_int64((*JsonEachCursor)(unsafe.Pointer(p)).Fi)+Sqlite3_int64(libc.Bool32(int32((*JsonNode)(unsafe.Pointer(pThis)).FjnFlags)&JNODE_LABEL != 0)))
 165198 			break
 165199 
 165200 		}
 165201 	case JEACH_PARENT:
 165202 		{
 165203 			if (*JsonEachCursor)(unsafe.Pointer(p)).Fi > (*JsonEachCursor)(unsafe.Pointer(p)).FiBegin && (*JsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0 {
 165204 				Xsqlite3_result_int64(tls, ctx, Sqlite3_int64(*(*U32)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaUp + uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*4))))
 165205 			}
 165206 			break
 165207 
 165208 		}
 165209 	case JEACH_FULLKEY:
 165210 		{
 165211 			jsonInit(tls, bp+8, ctx)
 165212 			if (*JsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0 {
 165213 				jsonEachComputePath(tls, p, bp+8, (*JsonEachCursor)(unsafe.Pointer(p)).Fi)
 165214 			} else {
 165215 				if (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot != 0 {
 165216 					jsonAppendRaw(tls, bp+8, (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot, uint32(int32(libc.Xstrlen(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot))))
 165217 				} else {
 165218 					jsonAppendChar(tls, bp+8, int8('$'))
 165219 				}
 165220 				if int32((*JsonEachCursor)(unsafe.Pointer(p)).FeType) == JSON_ARRAY {
 165221 					jsonPrintf(tls, 30, bp+8, ts+26254, libc.VaList(bp, (*JsonEachCursor)(unsafe.Pointer(p)).FiRowid))
 165222 				} else if int32((*JsonEachCursor)(unsafe.Pointer(p)).FeType) == JSON_OBJECT {
 165223 					jsonAppendObjectPathElement(tls, bp+8, pThis)
 165224 				}
 165225 			}
 165226 			jsonResult(tls, bp+8)
 165227 			break
 165228 
 165229 		}
 165230 	case JEACH_PATH:
 165231 		{
 165232 			if (*JsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0 {
 165233 				jsonInit(tls, bp+144, ctx)
 165234 				jsonEachComputePath(tls, p, bp+144, *(*U32)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaUp + uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*4)))
 165235 				jsonResult(tls, bp+144)
 165236 				break
 165237 			}
 165238 
 165239 		}
 165240 		fallthrough
 165241 	default:
 165242 		{
 165243 			var zRoot uintptr = (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot
 165244 			if zRoot == uintptr(0) {
 165245 				zRoot = ts + 26259
 165246 			}
 165247 			Xsqlite3_result_text(tls, ctx, zRoot, -1, uintptr(0))
 165248 			break
 165249 
 165250 		}
 165251 	case JEACH_JSON:
 165252 		{
 165253 			Xsqlite3_result_text(tls, ctx, (*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FzJson, -1, uintptr(0))
 165254 			break
 165255 
 165256 		}
 165257 	}
 165258 	return SQLITE_OK
 165259 }
 165260 
 165261 func jsonEachRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 {
 165262 	var p uintptr = cur
 165263 	*(*Sqlite_int64)(unsafe.Pointer(pRowid)) = Sqlite_int64((*JsonEachCursor)(unsafe.Pointer(p)).FiRowid)
 165264 	return SQLITE_OK
 165265 }
 165266 
 165267 func jsonEachBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 {
 165268 	bp := tls.Alloc(8)
 165269 	defer tls.Free(8)
 165270 
 165271 	var i int32
 165272 
 165273 	var unusableMask int32 = 0
 165274 	var idxMask int32 = 0
 165275 	var pConstraint uintptr
 165276 
 165277 	_ = tab
 165278 	*(*int32)(unsafe.Pointer(bp)) = libc.AssignPtrInt32(bp+1*4, -1)
 165279 	pConstraint = (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint
 165280 	i = 0
 165281 __1:
 165282 	if !(i < (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint) {
 165283 		goto __3
 165284 	}
 165285 	{
 165286 		var iCol int32
 165287 		var iMask int32
 165288 		if (*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).FiColumn < JEACH_JSON {
 165289 			goto __2
 165290 		}
 165291 		iCol = (*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).FiColumn - JEACH_JSON
 165292 
 165293 		iMask = int32(1) << iCol
 165294 		if int32((*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fusable) == 0 {
 165295 			unusableMask = unusableMask | iMask
 165296 		} else if int32((*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fop) == SQLITE_INDEX_CONSTRAINT_EQ {
 165297 			*(*int32)(unsafe.Pointer(bp + uintptr(iCol)*4)) = i
 165298 			idxMask = idxMask | iMask
 165299 		}
 165300 
 165301 	}
 165302 	goto __2
 165303 __2:
 165304 	i++
 165305 	pConstraint += 12
 165306 	goto __1
 165307 	goto __3
 165308 __3:
 165309 	;
 165310 	if (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnOrderBy > 0 &&
 165311 		(*sqlite3_index_orderby)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy)).FiColumn < 0 &&
 165312 		int32((*sqlite3_index_orderby)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy)).Fdesc) == 0 {
 165313 		(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).ForderByConsumed = 1
 165314 	}
 165315 
 165316 	if unusableMask & ^idxMask != 0 {
 165317 		return SQLITE_CONSTRAINT
 165318 	}
 165319 	if *(*int32)(unsafe.Pointer(bp)) < 0 {
 165320 		(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 0
 165321 	} else {
 165322 		(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 1.0
 165323 		i = *(*int32)(unsafe.Pointer(bp))
 165324 		(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = 1
 165325 		(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(i)*8)).Fomit = uint8(1)
 165326 		if *(*int32)(unsafe.Pointer(bp + 1*4)) < 0 {
 165327 			(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 1
 165328 		} else {
 165329 			i = *(*int32)(unsafe.Pointer(bp + 1*4))
 165330 			(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = 2
 165331 			(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(i)*8)).Fomit = uint8(1)
 165332 			(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 3
 165333 		}
 165334 	}
 165335 	return SQLITE_OK
 165336 }
 165337 
 165338 func jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 {
 165339 	bp := tls.Alloc(8)
 165340 	defer tls.Free(8)
 165341 
 165342 	var p uintptr = cur
 165343 	var z uintptr
 165344 	var zRoot uintptr = uintptr(0)
 165345 	var n Sqlite3_int64
 165346 
 165347 	_ = idxStr
 165348 	_ = argc
 165349 	jsonEachCursorReset(tls, p)
 165350 	if idxNum == 0 {
 165351 		return SQLITE_OK
 165352 	}
 165353 	z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 165354 	if z == uintptr(0) {
 165355 		return SQLITE_OK
 165356 	}
 165357 	n = Sqlite3_int64(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))))
 165358 	(*JsonEachCursor)(unsafe.Pointer(p)).FzJson = Xsqlite3_malloc64(tls, uint64(n+int64(1)))
 165359 	if (*JsonEachCursor)(unsafe.Pointer(p)).FzJson == uintptr(0) {
 165360 		return SQLITE_NOMEM
 165361 	}
 165362 	libc.Xmemcpy(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FzJson, z, Size_t(n)+uint64(1))
 165363 	if jsonParse(tls, p+48, uintptr(0), (*JsonEachCursor)(unsafe.Pointer(p)).FzJson) != 0 {
 165364 		var rc int32 = SQLITE_NOMEM
 165365 		if int32((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.Foom) == 0 {
 165366 			Xsqlite3_free(tls, (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg)
 165367 			(*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, ts+25969, 0)
 165368 			if (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 {
 165369 				rc = SQLITE_ERROR
 165370 			}
 165371 		}
 165372 		jsonEachCursorReset(tls, p)
 165373 		return rc
 165374 	} else if (*JsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0 && jsonParseFindParents(tls, p+48) != 0 {
 165375 		jsonEachCursorReset(tls, p)
 165376 		return SQLITE_NOMEM
 165377 	} else {
 165378 		var pNode uintptr = uintptr(0)
 165379 		if idxNum == 3 {
 165380 			*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 165381 			zRoot = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 165382 			if zRoot == uintptr(0) {
 165383 				return SQLITE_OK
 165384 			}
 165385 			n = Sqlite3_int64(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))
 165386 			(*JsonEachCursor)(unsafe.Pointer(p)).FzRoot = Xsqlite3_malloc64(tls, uint64(n+int64(1)))
 165387 			if (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot == uintptr(0) {
 165388 				return SQLITE_NOMEM
 165389 			}
 165390 			libc.Xmemcpy(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot, zRoot, Size_t(n)+uint64(1))
 165391 			if int32(*(*int8)(unsafe.Pointer(zRoot))) != '$' {
 165392 				*(*uintptr)(unsafe.Pointer(bp)) = zRoot
 165393 			} else {
 165394 				pNode = jsonLookupStep(tls, p+48, uint32(0), (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot+uintptr(1), uintptr(0), bp)
 165395 			}
 165396 			if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
 165397 				Xsqlite3_free(tls, (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg)
 165398 				(*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = jsonPathSyntaxError(tls, *(*uintptr)(unsafe.Pointer(bp)))
 165399 				jsonEachCursorReset(tls, p)
 165400 				if (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 {
 165401 					return SQLITE_ERROR
 165402 				}
 165403 				return SQLITE_NOMEM
 165404 			} else if pNode == uintptr(0) {
 165405 				return SQLITE_OK
 165406 			}
 165407 		} else {
 165408 			pNode = (*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode
 165409 		}
 165410 		(*JsonEachCursor)(unsafe.Pointer(p)).FiBegin = libc.AssignPtrUint32(p+16, U32(int32((int64(pNode)-int64((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode))/16)))
 165411 		(*JsonEachCursor)(unsafe.Pointer(p)).FeType = (*JsonNode)(unsafe.Pointer(pNode)).FeType
 165412 		if int32((*JsonEachCursor)(unsafe.Pointer(p)).FeType) >= JSON_ARRAY {
 165413 			*(*U32)(unsafe.Pointer(pNode + 8)) = U32(0)
 165414 			(*JsonEachCursor)(unsafe.Pointer(p)).FiEnd = (*JsonEachCursor)(unsafe.Pointer(p)).Fi + (*JsonNode)(unsafe.Pointer(pNode)).Fn + U32(1)
 165415 			if (*JsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0 {
 165416 				(*JsonEachCursor)(unsafe.Pointer(p)).FeType = (*JsonNode)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr(*(*U32)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaUp + uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*4)))*16)).FeType
 165417 				if (*JsonEachCursor)(unsafe.Pointer(p)).Fi > U32(0) && int32((*JsonNode)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode+uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi-U32(1))*16)).FjnFlags)&JNODE_LABEL != 0 {
 165418 					(*JsonEachCursor)(unsafe.Pointer(p)).Fi--
 165419 				}
 165420 			} else {
 165421 				(*JsonEachCursor)(unsafe.Pointer(p)).Fi++
 165422 			}
 165423 		} else {
 165424 			(*JsonEachCursor)(unsafe.Pointer(p)).FiEnd = (*JsonEachCursor)(unsafe.Pointer(p)).Fi + U32(1)
 165425 		}
 165426 	}
 165427 	return SQLITE_OK
 165428 }
 165429 
 165430 var jsonEachModule = Sqlite3_module{
 165431 	FxConnect:    0,
 165432 	FxBestIndex:  0,
 165433 	FxDisconnect: 0,
 165434 	FxOpen:       0,
 165435 	FxClose:      0,
 165436 	FxFilter:     0,
 165437 	FxNext:       0,
 165438 	FxEof:        0,
 165439 	FxColumn:     0,
 165440 	FxRowid:      0,
 165441 }
 165442 
 165443 var jsonTreeModule = Sqlite3_module{
 165444 	FxConnect:    0,
 165445 	FxBestIndex:  0,
 165446 	FxDisconnect: 0,
 165447 	FxOpen:       0,
 165448 	FxClose:      0,
 165449 	FxFilter:     0,
 165450 	FxNext:       0,
 165451 	FxEof:        0,
 165452 	FxColumn:     0,
 165453 	FxRowid:      0,
 165454 }
 165455 
 165456 // Register JSON functions.
 165457 func Xsqlite3RegisterJsonFunctions(tls *libc.TLS) {
 165458 	Xsqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&aJsonFunc)), int32(uint64(unsafe.Sizeof(aJsonFunc))/uint64(unsafe.Sizeof(FuncDef{}))))
 165459 }
 165460 
 165461 var aJsonFunc = [19]FuncDef{
 165462 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_DETERMINISTIC | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 26261},
 165463 	{FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_DETERMINISTIC | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 26266},
 165464 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_DETERMINISTIC | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 26277},
 165465 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_DETERMINISTIC | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 26277},
 165466 	{FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_DETERMINISTIC | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 26295},
 165467 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_DETERMINISTIC | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: uintptr(int64(JSON_JSON)), FxSFunc: 0, FzName: ts + 26308},
 165468 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_DETERMINISTIC | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: uintptr(int64(JSON_SQL)), FxSFunc: 0, FzName: ts + 26311},
 165469 	{FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_DETERMINISTIC | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 26315},
 165470 	{FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_DETERMINISTIC | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 26327},
 165471 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_DETERMINISTIC | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 26339},
 165472 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_DETERMINISTIC | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 26350},
 165473 	{FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_DETERMINISTIC | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 26361},
 165474 	{FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_DETERMINISTIC | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 26373},
 165475 	{FnArg: int8(-1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_DETERMINISTIC | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FpUserData: uintptr(int64(JSON_ISSET)), FxSFunc: 0, FzName: ts + 26386},
 165476 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_DETERMINISTIC | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 26395},
 165477 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_DETERMINISTIC | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 26395},
 165478 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_DETERMINISTIC | SQLITE_FUNC_CONSTANT | SQLITE_UTF8), FxSFunc: 0, FzName: ts + 26405},
 165479 	{FnArg: int8(1), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL | SQLITE_SUBTYPE | SQLITE_UTF8 | SQLITE_DETERMINISTIC), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 26416},
 165480 	{FnArg: int8(2), FfuncFlags: U32(SQLITE_FUNC_BUILTIN | SQLITE_UTF8 | 0*SQLITE_FUNC_NEEDCOLL | SQLITE_SUBTYPE | SQLITE_UTF8 | SQLITE_DETERMINISTIC), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 26433}}
 165481 
 165482 // Register the JSON table-valued functions
 165483 func Xsqlite3JsonTableFunctions(tls *libc.TLS, db uintptr) int32 {
 165484 	var rc int32 = SQLITE_OK
 165485 	var i uint32
 165486 	for i = uint32(0); uint64(i) < uint64(unsafe.Sizeof(aMod))/uint64(unsafe.Sizeof(struct {
 165487 		FzName   uintptr
 165488 		FpModule uintptr
 165489 	}{})) && rc == SQLITE_OK; i++ {
 165490 		rc = Xsqlite3_create_module(tls, db, aMod[i].FzName, aMod[i].FpModule, uintptr(0))
 165491 	}
 165492 	return rc
 165493 }
 165494 
 165495 var aMod = [2]struct {
 165496 	FzName   uintptr
 165497 	FpModule uintptr
 165498 }{
 165499 	{FzName: ts + 26451, FpModule: 0},
 165500 	{FzName: ts + 26461, FpModule: 0},
 165501 }
 165502 
 165503 type Rtree1 = struct {
 165504 	Fbase            Sqlite3_vtab
 165505 	Fdb              uintptr
 165506 	FiNodeSize       int32
 165507 	FnDim            U8
 165508 	FnDim2           U8
 165509 	FeCoordType      U8
 165510 	FnBytesPerCell   U8
 165511 	FinWrTrans       U8
 165512 	FnAux            U8
 165513 	FnAuxNotNull     U8
 165514 	F__ccgo_pad1     [1]byte
 165515 	FiDepth          int32
 165516 	FzDb             uintptr
 165517 	FzName           uintptr
 165518 	FnBusy           U32
 165519 	F__ccgo_pad2     [4]byte
 165520 	FnRowEst         I64
 165521 	FnCursor         U32
 165522 	FnNodeRef        U32
 165523 	FzReadAuxSql     uintptr
 165524 	FpDeleted        uintptr
 165525 	FiReinsertHeight int32
 165526 	F__ccgo_pad3     [4]byte
 165527 	FpNodeBlob       uintptr
 165528 	FpWriteNode      uintptr
 165529 	FpDeleteNode     uintptr
 165530 	FpReadRowid      uintptr
 165531 	FpWriteRowid     uintptr
 165532 	FpDeleteRowid    uintptr
 165533 	FpReadParent     uintptr
 165534 	FpWriteParent    uintptr
 165535 	FpDeleteParent   uintptr
 165536 	FpWriteAux       uintptr
 165537 	FaHash           [97]uintptr
 165538 }
 165539 
 165540 type Rtree = Rtree1
 165541 type RtreeCursor1 = struct {
 165542 	Fbase        Sqlite3_vtab_cursor
 165543 	FatEOF       U8
 165544 	FbPoint      U8
 165545 	FbAuxValid   U8
 165546 	F__ccgo_pad1 [1]byte
 165547 	FiStrategy   int32
 165548 	FnConstraint int32
 165549 	F__ccgo_pad2 [4]byte
 165550 	FaConstraint uintptr
 165551 	FnPointAlloc int32
 165552 	FnPoint      int32
 165553 	FmxLevel     int32
 165554 	F__ccgo_pad3 [4]byte
 165555 	FaPoint      uintptr
 165556 	FpReadAux    uintptr
 165557 	FsPoint      RtreeSearchPoint
 165558 	FaNode       [5]uintptr
 165559 	FanQueue     [41]U32
 165560 	F__ccgo_pad4 [4]byte
 165561 }
 165562 
 165563 type RtreeCursor = RtreeCursor1
 165564 type RtreeNode1 = struct {
 165565 	FpParent uintptr
 165566 	FiNode   I64
 165567 	FnRef    int32
 165568 	FisDirty int32
 165569 	FzData   uintptr
 165570 	FpNext   uintptr
 165571 }
 165572 
 165573 type RtreeNode = RtreeNode1
 165574 type RtreeCell1 = struct {
 165575 	FiRowid I64
 165576 	FaCoord [10]RtreeCoord
 165577 }
 165578 
 165579 type RtreeCell = RtreeCell1
 165580 type RtreeConstraint1 = struct {
 165581 	FiCoord int32
 165582 	Fop     int32
 165583 	Fu      struct{ FrValue RtreeDValue }
 165584 	FpInfo  uintptr
 165585 }
 165586 
 165587 type RtreeConstraint = RtreeConstraint1
 165588 type RtreeMatchArg1 = struct {
 165589 	FiSize       U32
 165590 	F__ccgo_pad1 [4]byte
 165591 	Fcb          RtreeGeomCallback
 165592 	FnParam      int32
 165593 	F__ccgo_pad2 [4]byte
 165594 	FapSqlParam  uintptr
 165595 	FaParam      [1]RtreeDValue
 165596 }
 165597 
 165598 type RtreeMatchArg = RtreeMatchArg1
 165599 type RtreeGeomCallback1 = struct {
 165600 	FxGeom       uintptr
 165601 	FxQueryFunc  uintptr
 165602 	FxDestructor uintptr
 165603 	FpContext    uintptr
 165604 }
 165605 
 165606 type RtreeGeomCallback = RtreeGeomCallback1
 165607 type RtreeCoord1 = struct{ Ff RtreeValue }
 165608 
 165609 type RtreeCoord = RtreeCoord1
 165610 type RtreeSearchPoint1 = struct {
 165611 	FrScore      RtreeDValue
 165612 	Fid          Sqlite3_int64
 165613 	FiLevel      U8
 165614 	FeWithin     U8
 165615 	FiCell       U8
 165616 	F__ccgo_pad1 [5]byte
 165617 }
 165618 
 165619 type RtreeSearchPoint = RtreeSearchPoint1
 165620 
 165621 // If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will
 165622 // only deal with integer coordinates.  No floating point operations
 165623 // will be done.
 165624 type RtreeDValue = float64
 165625 type RtreeValue = float32
 165626 
 165627 func readInt16(tls *libc.TLS, p uintptr) int32 {
 165628 	return int32(*(*U8)(unsafe.Pointer(p)))<<8 + int32(*(*U8)(unsafe.Pointer(p + 1)))
 165629 }
 165630 
 165631 func readCoord(tls *libc.TLS, p uintptr, pCoord uintptr) {
 165632 	*(*U32)(unsafe.Pointer(pCoord)) = libc.X_byteswap_ulong(tls, *(*U32)(unsafe.Pointer(p)))
 165633 }
 165634 
 165635 func readInt64(tls *libc.TLS, p uintptr) I64 {
 165636 	bp := tls.Alloc(8)
 165637 	defer tls.Free(8)
 165638 
 165639 	libc.Xmemcpy(tls, bp, p, uint64(8))
 165640 	return I64(libc.X_byteswap_uint64(tls, *(*U64)(unsafe.Pointer(bp))))
 165641 }
 165642 
 165643 func writeInt16(tls *libc.TLS, p uintptr, i int32) {
 165644 	*(*U8)(unsafe.Pointer(p)) = U8(i >> 8 & 0xFF)
 165645 	*(*U8)(unsafe.Pointer(p + 1)) = U8(i >> 0 & 0xFF)
 165646 }
 165647 
 165648 func writeCoord(tls *libc.TLS, p uintptr, pCoord uintptr) int32 {
 165649 	bp := tls.Alloc(4)
 165650 	defer tls.Free(4)
 165651 
 165652 	*(*U32)(unsafe.Pointer(bp)) = libc.X__builtin_bswap32(tls, *(*U32)(unsafe.Pointer(pCoord)))
 165653 	libc.Xmemcpy(tls, p, bp, uint64(4))
 165654 	return 4
 165655 }
 165656 
 165657 func writeInt64(tls *libc.TLS, p uintptr, i I64) int32 {
 165658 	bp := tls.Alloc(8)
 165659 	defer tls.Free(8)
 165660 	*(*I64)(unsafe.Pointer(bp)) = i
 165661 
 165662 	*(*I64)(unsafe.Pointer(bp)) = I64(libc.X__builtin_bswap64(tls, U64(*(*I64)(unsafe.Pointer(bp)))))
 165663 	libc.Xmemcpy(tls, p, bp, uint64(8))
 165664 	return 8
 165665 }
 165666 
 165667 func nodeReference(tls *libc.TLS, p uintptr) {
 165668 	if p != 0 {
 165669 		(*RtreeNode)(unsafe.Pointer(p)).FnRef++
 165670 	}
 165671 }
 165672 
 165673 func nodeZero(tls *libc.TLS, pRtree uintptr, p uintptr) {
 165674 	libc.Xmemset(tls, (*RtreeNode)(unsafe.Pointer(p)).FzData+2, 0, uint64((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize-2))
 165675 	(*RtreeNode)(unsafe.Pointer(p)).FisDirty = 1
 165676 }
 165677 
 165678 func nodeHash(tls *libc.TLS, iNode I64) uint32 {
 165679 	return uint32(iNode) % uint32(HASHSIZE)
 165680 }
 165681 
 165682 func nodeHashLookup(tls *libc.TLS, pRtree uintptr, iNode I64) uintptr {
 165683 	var p uintptr
 165684 	for p = *(*uintptr)(unsafe.Pointer(pRtree + 192 + uintptr(nodeHash(tls, iNode))*8)); p != 0 && (*RtreeNode)(unsafe.Pointer(p)).FiNode != iNode; p = (*RtreeNode)(unsafe.Pointer(p)).FpNext {
 165685 	}
 165686 	return p
 165687 }
 165688 
 165689 func nodeHashInsert(tls *libc.TLS, pRtree uintptr, pNode uintptr) {
 165690 	var iHash int32
 165691 
 165692 	iHash = int32(nodeHash(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode))
 165693 	(*RtreeNode)(unsafe.Pointer(pNode)).FpNext = *(*uintptr)(unsafe.Pointer(pRtree + 192 + uintptr(iHash)*8))
 165694 	*(*uintptr)(unsafe.Pointer(pRtree + 192 + uintptr(iHash)*8)) = pNode
 165695 }
 165696 
 165697 func nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) {
 165698 	var pp uintptr
 165699 	if (*RtreeNode)(unsafe.Pointer(pNode)).FiNode != int64(0) {
 165700 		pp = pRtree + 192 + uintptr(nodeHash(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode))*8
 165701 		for ; *(*uintptr)(unsafe.Pointer(pp)) != pNode; pp = *(*uintptr)(unsafe.Pointer(pp)) + 32 {
 165702 		}
 165703 		*(*uintptr)(unsafe.Pointer(pp)) = (*RtreeNode)(unsafe.Pointer(pNode)).FpNext
 165704 		(*RtreeNode)(unsafe.Pointer(pNode)).FpNext = uintptr(0)
 165705 	}
 165706 }
 165707 
 165708 func nodeNew(tls *libc.TLS, pRtree uintptr, pParent uintptr) uintptr {
 165709 	var pNode uintptr
 165710 	pNode = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(RtreeNode{}))+uint64((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize))
 165711 	if pNode != 0 {
 165712 		libc.Xmemset(tls, pNode, 0, uint64(unsafe.Sizeof(RtreeNode{}))+uint64((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize))
 165713 		(*RtreeNode)(unsafe.Pointer(pNode)).FzData = pNode + 1*40
 165714 		(*RtreeNode)(unsafe.Pointer(pNode)).FnRef = 1
 165715 		(*Rtree)(unsafe.Pointer(pRtree)).FnNodeRef++
 165716 		(*RtreeNode)(unsafe.Pointer(pNode)).FpParent = pParent
 165717 		(*RtreeNode)(unsafe.Pointer(pNode)).FisDirty = 1
 165718 		nodeReference(tls, pParent)
 165719 	}
 165720 	return pNode
 165721 }
 165722 
 165723 func nodeBlobReset(tls *libc.TLS, pRtree uintptr) {
 165724 	if (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob != 0 && int32((*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans) == 0 && (*Rtree)(unsafe.Pointer(pRtree)).FnCursor == U32(0) {
 165725 		var pBlob uintptr = (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob
 165726 		(*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob = uintptr(0)
 165727 		Xsqlite3_blob_close(tls, pBlob)
 165728 	}
 165729 }
 165730 
 165731 func nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode I64, pParent uintptr, ppNode uintptr) int32 {
 165732 	bp := tls.Alloc(8)
 165733 	defer tls.Free(8)
 165734 
 165735 	var rc int32 = SQLITE_OK
 165736 	var pNode uintptr = uintptr(0)
 165737 
 165738 	if libc.AssignUintptr(&pNode, nodeHashLookup(tls, pRtree, iNode)) != uintptr(0) {
 165739 		if pParent != 0 && pParent != (*RtreeNode)(unsafe.Pointer(pNode)).FpParent {
 165740 			return SQLITE_CORRUPT | int32(1)<<8
 165741 		}
 165742 		(*RtreeNode)(unsafe.Pointer(pNode)).FnRef++
 165743 		*(*uintptr)(unsafe.Pointer(ppNode)) = pNode
 165744 		return SQLITE_OK
 165745 	}
 165746 
 165747 	if (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob != 0 {
 165748 		var pBlob uintptr = (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob
 165749 		(*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob = uintptr(0)
 165750 		rc = Xsqlite3_blob_reopen(tls, pBlob, iNode)
 165751 		(*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob = pBlob
 165752 		if rc != 0 {
 165753 			nodeBlobReset(tls, pRtree)
 165754 			if rc == SQLITE_NOMEM {
 165755 				return SQLITE_NOMEM
 165756 			}
 165757 		}
 165758 	}
 165759 	if (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob == uintptr(0) {
 165760 		var zTab uintptr = Xsqlite3_mprintf(tls, ts+26471, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzName))
 165761 		if zTab == uintptr(0) {
 165762 			return SQLITE_NOMEM
 165763 		}
 165764 		rc = Xsqlite3_blob_open(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, zTab, ts+26479, iNode, 0,
 165765 			pRtree+112)
 165766 		Xsqlite3_free(tls, zTab)
 165767 	}
 165768 	if rc != 0 {
 165769 		nodeBlobReset(tls, pRtree)
 165770 		*(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0)
 165771 
 165772 		if rc == SQLITE_ERROR {
 165773 			rc = SQLITE_CORRUPT | int32(1)<<8
 165774 
 165775 		}
 165776 	} else if (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize == Xsqlite3_blob_bytes(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob) {
 165777 		pNode = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(RtreeNode{}))+uint64((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize))
 165778 		if !(pNode != 0) {
 165779 			rc = SQLITE_NOMEM
 165780 		} else {
 165781 			(*RtreeNode)(unsafe.Pointer(pNode)).FpParent = pParent
 165782 			(*RtreeNode)(unsafe.Pointer(pNode)).FzData = pNode + 1*40
 165783 			(*RtreeNode)(unsafe.Pointer(pNode)).FnRef = 1
 165784 			(*Rtree)(unsafe.Pointer(pRtree)).FnNodeRef++
 165785 			(*RtreeNode)(unsafe.Pointer(pNode)).FiNode = iNode
 165786 			(*RtreeNode)(unsafe.Pointer(pNode)).FisDirty = 0
 165787 			(*RtreeNode)(unsafe.Pointer(pNode)).FpNext = uintptr(0)
 165788 			rc = Xsqlite3_blob_read(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob, (*RtreeNode)(unsafe.Pointer(pNode)).FzData,
 165789 				(*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize, 0)
 165790 		}
 165791 	}
 165792 
 165793 	if rc == SQLITE_OK && pNode != 0 && iNode == int64(1) {
 165794 		(*Rtree)(unsafe.Pointer(pRtree)).FiDepth = readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData)
 165795 		if (*Rtree)(unsafe.Pointer(pRtree)).FiDepth > RTREE_MAX_DEPTH {
 165796 			rc = SQLITE_CORRUPT | int32(1)<<8
 165797 
 165798 		}
 165799 	}
 165800 
 165801 	if pNode != 0 && rc == SQLITE_OK {
 165802 		if readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2) > ((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize-4)/int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) {
 165803 			rc = SQLITE_CORRUPT | int32(1)<<8
 165804 
 165805 		}
 165806 	}
 165807 
 165808 	if rc == SQLITE_OK {
 165809 		if pNode != uintptr(0) {
 165810 			nodeReference(tls, pParent)
 165811 			nodeHashInsert(tls, pRtree, pNode)
 165812 		} else {
 165813 			rc = SQLITE_CORRUPT | int32(1)<<8
 165814 
 165815 		}
 165816 		*(*uintptr)(unsafe.Pointer(ppNode)) = pNode
 165817 	} else {
 165818 		if pNode != 0 {
 165819 			(*Rtree)(unsafe.Pointer(pRtree)).FnNodeRef--
 165820 			Xsqlite3_free(tls, pNode)
 165821 		}
 165822 		*(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0)
 165823 	}
 165824 
 165825 	return rc
 165826 }
 165827 
 165828 func nodeOverwriteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iCell int32) {
 165829 	var ii int32
 165830 	var p uintptr = (*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr(4+int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*iCell)
 165831 	p += uintptr(writeInt64(tls, p, (*RtreeCell)(unsafe.Pointer(pCell)).FiRowid))
 165832 	for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2); ii++ {
 165833 		p += uintptr(writeCoord(tls, p, pCell+8+uintptr(ii)*4))
 165834 	}
 165835 	(*RtreeNode)(unsafe.Pointer(pNode)).FisDirty = 1
 165836 }
 165837 
 165838 func nodeDeleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) {
 165839 	var pDst uintptr = (*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr(4+int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*iCell)
 165840 	var pSrc uintptr = pDst + uintptr((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)
 165841 	var nByte int32 = (readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2) - iCell - 1) * int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)
 165842 	libc.Xmemmove(tls, pDst, pSrc, uint64(nByte))
 165843 	writeInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2, readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2)-1)
 165844 	(*RtreeNode)(unsafe.Pointer(pNode)).FisDirty = 1
 165845 }
 165846 
 165847 func nodeInsertCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr) int32 {
 165848 	var nCell int32
 165849 	var nMaxCell int32
 165850 
 165851 	nMaxCell = ((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize - 4) / int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)
 165852 	nCell = readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2)
 165853 
 165854 	if nCell < nMaxCell {
 165855 		nodeOverwriteCell(tls, pRtree, pNode, pCell, nCell)
 165856 		writeInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2, nCell+1)
 165857 		(*RtreeNode)(unsafe.Pointer(pNode)).FisDirty = 1
 165858 	}
 165859 
 165860 	return libc.Bool32(nCell == nMaxCell)
 165861 }
 165862 
 165863 func nodeWrite(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 {
 165864 	var rc int32 = SQLITE_OK
 165865 	if (*RtreeNode)(unsafe.Pointer(pNode)).FisDirty != 0 {
 165866 		var p uintptr = (*Rtree)(unsafe.Pointer(pRtree)).FpWriteNode
 165867 		if (*RtreeNode)(unsafe.Pointer(pNode)).FiNode != 0 {
 165868 			Xsqlite3_bind_int64(tls, p, 1, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode)
 165869 		} else {
 165870 			Xsqlite3_bind_null(tls, p, 1)
 165871 		}
 165872 		Xsqlite3_bind_blob(tls, p, 2, (*RtreeNode)(unsafe.Pointer(pNode)).FzData, (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize, uintptr(0))
 165873 		Xsqlite3_step(tls, p)
 165874 		(*RtreeNode)(unsafe.Pointer(pNode)).FisDirty = 0
 165875 		rc = Xsqlite3_reset(tls, p)
 165876 		Xsqlite3_bind_null(tls, p, 2)
 165877 		if (*RtreeNode)(unsafe.Pointer(pNode)).FiNode == int64(0) && rc == SQLITE_OK {
 165878 			(*RtreeNode)(unsafe.Pointer(pNode)).FiNode = Xsqlite3_last_insert_rowid(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb)
 165879 			nodeHashInsert(tls, pRtree, pNode)
 165880 		}
 165881 	}
 165882 	return rc
 165883 }
 165884 
 165885 func nodeRelease(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 {
 165886 	var rc int32 = SQLITE_OK
 165887 	if pNode != 0 {
 165888 		(*RtreeNode)(unsafe.Pointer(pNode)).FnRef--
 165889 		if (*RtreeNode)(unsafe.Pointer(pNode)).FnRef == 0 {
 165890 			(*Rtree)(unsafe.Pointer(pRtree)).FnNodeRef--
 165891 			if (*RtreeNode)(unsafe.Pointer(pNode)).FiNode == int64(1) {
 165892 				(*Rtree)(unsafe.Pointer(pRtree)).FiDepth = -1
 165893 			}
 165894 			if (*RtreeNode)(unsafe.Pointer(pNode)).FpParent != 0 {
 165895 				rc = nodeRelease(tls, pRtree, (*RtreeNode)(unsafe.Pointer(pNode)).FpParent)
 165896 			}
 165897 			if rc == SQLITE_OK {
 165898 				rc = nodeWrite(tls, pRtree, pNode)
 165899 			}
 165900 			nodeHashDelete(tls, pRtree, pNode)
 165901 			Xsqlite3_free(tls, pNode)
 165902 		}
 165903 	}
 165904 	return rc
 165905 }
 165906 
 165907 func nodeGetRowid(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) I64 {
 165908 	return readInt64(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+uintptr(4+int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*iCell))
 165909 }
 165910 
 165911 func nodeGetCoord(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, iCoord int32, pCoord uintptr) {
 165912 	readCoord(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+uintptr(12+int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*iCell+4*iCoord), pCoord)
 165913 }
 165914 
 165915 func nodeGetCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, pCell uintptr) {
 165916 	var pData uintptr
 165917 	var pCoord uintptr
 165918 	var ii int32 = 0
 165919 	(*RtreeCell)(unsafe.Pointer(pCell)).FiRowid = nodeGetRowid(tls, pRtree, pNode, iCell)
 165920 	pData = (*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr(12+int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*iCell)
 165921 	pCoord = pCell + 8
 165922 	for __ccgo := true; __ccgo; __ccgo = ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) {
 165923 		readCoord(tls, pData, pCoord+uintptr(ii)*4)
 165924 		readCoord(tls, pData+uintptr(4), pCoord+uintptr(ii+1)*4)
 165925 		pData += uintptr(8)
 165926 		ii = ii + 2
 165927 	}
 165928 }
 165929 
 165930 func rtreeCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 {
 165931 	return rtreeInit(tls, db, pAux, argc, argv, ppVtab, pzErr, 1)
 165932 }
 165933 
 165934 func rtreeConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 {
 165935 	return rtreeInit(tls, db, pAux, argc, argv, ppVtab, pzErr, 0)
 165936 }
 165937 
 165938 func rtreeReference(tls *libc.TLS, pRtree uintptr) {
 165939 	(*Rtree)(unsafe.Pointer(pRtree)).FnBusy++
 165940 }
 165941 
 165942 func rtreeRelease(tls *libc.TLS, pRtree uintptr) {
 165943 	(*Rtree)(unsafe.Pointer(pRtree)).FnBusy--
 165944 	if (*Rtree)(unsafe.Pointer(pRtree)).FnBusy == U32(0) {
 165945 		(*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans = U8(0)
 165946 
 165947 		nodeBlobReset(tls, pRtree)
 165948 
 165949 		Xsqlite3_finalize(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteNode)
 165950 		Xsqlite3_finalize(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteNode)
 165951 		Xsqlite3_finalize(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid)
 165952 		Xsqlite3_finalize(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid)
 165953 		Xsqlite3_finalize(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteRowid)
 165954 		Xsqlite3_finalize(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadParent)
 165955 		Xsqlite3_finalize(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteParent)
 165956 		Xsqlite3_finalize(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteParent)
 165957 		Xsqlite3_finalize(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteAux)
 165958 		Xsqlite3_free(tls, (*Rtree)(unsafe.Pointer(pRtree)).FzReadAuxSql)
 165959 		Xsqlite3_free(tls, pRtree)
 165960 	}
 165961 }
 165962 
 165963 func rtreeDisconnect(tls *libc.TLS, pVtab uintptr) int32 {
 165964 	rtreeRelease(tls, pVtab)
 165965 	return SQLITE_OK
 165966 }
 165967 
 165968 func rtreeDestroy(tls *libc.TLS, pVtab uintptr) int32 {
 165969 	bp := tls.Alloc(48)
 165970 	defer tls.Free(48)
 165971 
 165972 	var pRtree uintptr = pVtab
 165973 	var rc int32
 165974 	var zCreate uintptr = Xsqlite3_mprintf(tls,
 165975 		ts+26484,
 165976 		libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName,
 165977 			(*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName,
 165978 			(*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName))
 165979 	if !(zCreate != 0) {
 165980 		rc = SQLITE_NOMEM
 165981 	} else {
 165982 		nodeBlobReset(tls, pRtree)
 165983 		rc = Xsqlite3_exec(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, zCreate, uintptr(0), uintptr(0), uintptr(0))
 165984 		Xsqlite3_free(tls, zCreate)
 165985 	}
 165986 	if rc == SQLITE_OK {
 165987 		rtreeRelease(tls, pRtree)
 165988 	}
 165989 
 165990 	return rc
 165991 }
 165992 
 165993 func rtreeOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 {
 165994 	var rc int32 = SQLITE_NOMEM
 165995 	var pRtree uintptr = pVTab
 165996 	var pCsr uintptr
 165997 
 165998 	pCsr = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(RtreeCursor{})))
 165999 	if pCsr != 0 {
 166000 		libc.Xmemset(tls, pCsr, 0, uint64(unsafe.Sizeof(RtreeCursor{})))
 166001 		(*RtreeCursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab = pVTab
 166002 		rc = SQLITE_OK
 166003 		(*Rtree)(unsafe.Pointer(pRtree)).FnCursor++
 166004 	}
 166005 	*(*uintptr)(unsafe.Pointer(ppCursor)) = pCsr
 166006 
 166007 	return rc
 166008 }
 166009 
 166010 func resetCursor(tls *libc.TLS, pCsr uintptr) {
 166011 	var pRtree uintptr = (*RtreeCursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
 166012 	var ii int32
 166013 	var pStmt uintptr
 166014 	if (*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint != 0 {
 166015 		var i int32
 166016 		for i = 0; i < (*RtreeCursor)(unsafe.Pointer(pCsr)).FnConstraint; i++ {
 166017 			var pInfo uintptr = (*RtreeConstraint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint + uintptr(i)*24)).FpInfo
 166018 			if pInfo != 0 {
 166019 				if (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FxDelUser != 0 {
 166020 					(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FxDelUser})).f(tls, (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FpUser)
 166021 				}
 166022 				Xsqlite3_free(tls, pInfo)
 166023 			}
 166024 		}
 166025 		Xsqlite3_free(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint)
 166026 		(*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = uintptr(0)
 166027 	}
 166028 	for ii = 0; ii < RTREE_CACHE_SZ; ii++ {
 166029 		nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(pCsr + 88 + uintptr(ii)*8)))
 166030 	}
 166031 	Xsqlite3_free(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FaPoint)
 166032 	pStmt = (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux
 166033 	libc.Xmemset(tls, pCsr, 0, uint64(unsafe.Sizeof(RtreeCursor{})))
 166034 	(*RtreeCursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab = pRtree
 166035 	(*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux = pStmt
 166036 
 166037 }
 166038 
 166039 func rtreeClose(tls *libc.TLS, cur uintptr) int32 {
 166040 	var pRtree uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab
 166041 	var pCsr uintptr = cur
 166042 
 166043 	resetCursor(tls, pCsr)
 166044 	Xsqlite3_finalize(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux)
 166045 	Xsqlite3_free(tls, pCsr)
 166046 	(*Rtree)(unsafe.Pointer(pRtree)).FnCursor--
 166047 	nodeBlobReset(tls, pRtree)
 166048 	return SQLITE_OK
 166049 }
 166050 
 166051 func rtreeEof(tls *libc.TLS, cur uintptr) int32 {
 166052 	var pCsr uintptr = cur
 166053 	return int32((*RtreeCursor)(unsafe.Pointer(pCsr)).FatEOF)
 166054 }
 166055 
 166056 func rtreeCallbackConstraint(tls *libc.TLS, pConstraint uintptr, eInt int32, pCellData uintptr, pSearch uintptr, prScore uintptr, peWithin uintptr) int32 {
 166057 	bp := tls.Alloc(92)
 166058 	defer tls.Free(92)
 166059 
 166060 	var pInfo uintptr = (*RtreeConstraint)(unsafe.Pointer(pConstraint)).FpInfo
 166061 	var nCoord int32 = (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FnCoord
 166062 	var rc int32
 166063 
 166064 	if (*RtreeConstraint)(unsafe.Pointer(pConstraint)).Fop == RTREE_QUERY && int32((*RtreeSearchPoint)(unsafe.Pointer(pSearch)).FiLevel) == 1 {
 166065 		(*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FiRowid = readInt64(tls, pCellData)
 166066 	}
 166067 	pCellData += uintptr(8)
 166068 	if eInt == 0 {
 166069 		switch nCoord {
 166070 		case 10:
 166071 			readCoord(tls, pCellData+uintptr(36), bp)
 166072 			*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 + 9*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp)))
 166073 			readCoord(tls, pCellData+uintptr(32), bp)
 166074 			*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 + 8*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp)))
 166075 			fallthrough
 166076 		case 8:
 166077 			readCoord(tls, pCellData+uintptr(28), bp)
 166078 			*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 + 7*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp)))
 166079 			readCoord(tls, pCellData+uintptr(24), bp)
 166080 			*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 + 6*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp)))
 166081 			fallthrough
 166082 		case 6:
 166083 			readCoord(tls, pCellData+uintptr(20), bp)
 166084 			*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 + 5*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp)))
 166085 			readCoord(tls, pCellData+uintptr(16), bp)
 166086 			*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 + 4*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp)))
 166087 			fallthrough
 166088 		case 4:
 166089 			readCoord(tls, pCellData+uintptr(12), bp)
 166090 			*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 + 3*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp)))
 166091 			readCoord(tls, pCellData+uintptr(8), bp)
 166092 			*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 + 2*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp)))
 166093 			fallthrough
 166094 		default:
 166095 			readCoord(tls, pCellData+uintptr(4), bp)
 166096 			*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 + 1*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp)))
 166097 			readCoord(tls, pCellData, bp)
 166098 			*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp)))
 166099 		}
 166100 	} else {
 166101 		switch nCoord {
 166102 		case 10:
 166103 			readCoord(tls, pCellData+uintptr(36), bp)
 166104 			*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 + 9*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp)))
 166105 			readCoord(tls, pCellData+uintptr(32), bp)
 166106 			*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 + 8*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp)))
 166107 			fallthrough
 166108 		case 8:
 166109 			readCoord(tls, pCellData+uintptr(28), bp)
 166110 			*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 + 7*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp)))
 166111 			readCoord(tls, pCellData+uintptr(24), bp)
 166112 			*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 + 6*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp)))
 166113 			fallthrough
 166114 		case 6:
 166115 			readCoord(tls, pCellData+uintptr(20), bp)
 166116 			*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 + 5*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp)))
 166117 			readCoord(tls, pCellData+uintptr(16), bp)
 166118 			*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 + 4*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp)))
 166119 			fallthrough
 166120 		case 4:
 166121 			readCoord(tls, pCellData+uintptr(12), bp)
 166122 			*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 + 3*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp)))
 166123 			readCoord(tls, pCellData+uintptr(8), bp)
 166124 			*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 + 2*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp)))
 166125 			fallthrough
 166126 		default:
 166127 			readCoord(tls, pCellData+uintptr(4), bp)
 166128 			*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 + 1*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp)))
 166129 			readCoord(tls, pCellData, bp)
 166130 			*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp)))
 166131 		}
 166132 	}
 166133 	if (*RtreeConstraint)(unsafe.Pointer(pConstraint)).Fop == RTREE_MATCH {
 166134 		*(*int32)(unsafe.Pointer(bp + 88)) = 0
 166135 		rc = (*struct {
 166136 			f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
 166137 		})(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(pConstraint + 8))})).f(tls, pInfo,
 166138 			nCoord, bp+8, bp+88)
 166139 		if *(*int32)(unsafe.Pointer(bp + 88)) == 0 {
 166140 			*(*int32)(unsafe.Pointer(peWithin)) = NOT_WITHIN
 166141 		}
 166142 		*(*Sqlite3_rtree_dbl)(unsafe.Pointer(prScore)) = 0.0
 166143 	} else {
 166144 		(*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FaCoord = bp + 8
 166145 		(*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FiLevel = int32((*RtreeSearchPoint)(unsafe.Pointer(pSearch)).FiLevel) - 1
 166146 		(*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FrScore = libc.AssignPtrFloat64(pInfo+80, (*RtreeSearchPoint)(unsafe.Pointer(pSearch)).FrScore)
 166147 		(*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FeWithin = libc.AssignPtrInt32(pInfo+88, int32((*RtreeSearchPoint)(unsafe.Pointer(pSearch)).FeWithin))
 166148 		rc = (*struct {
 166149 			f func(*libc.TLS, uintptr) int32
 166150 		})(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(pConstraint + 8))})).f(tls, pInfo)
 166151 		if (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FeWithin < *(*int32)(unsafe.Pointer(peWithin)) {
 166152 			*(*int32)(unsafe.Pointer(peWithin)) = (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FeWithin
 166153 		}
 166154 		if (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FrScore < *(*Sqlite3_rtree_dbl)(unsafe.Pointer(prScore)) || *(*Sqlite3_rtree_dbl)(unsafe.Pointer(prScore)) < 0.0 {
 166155 			*(*Sqlite3_rtree_dbl)(unsafe.Pointer(prScore)) = (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FrScore
 166156 		}
 166157 	}
 166158 	return rc
 166159 }
 166160 
 166161 func rtreeNonleafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uintptr, peWithin uintptr) {
 166162 	bp := tls.Alloc(16)
 166163 	defer tls.Free(16)
 166164 
 166165 	var val Sqlite3_rtree_dbl
 166166 
 166167 	pCellData += uintptr(8 + 4*((*RtreeConstraint)(unsafe.Pointer(p)).FiCoord&0xfe))
 166168 
 166169 	switch (*RtreeConstraint)(unsafe.Pointer(p)).Fop {
 166170 	case RTREE_TRUE:
 166171 		return
 166172 	case RTREE_FALSE:
 166173 		break
 166174 	case RTREE_EQ:
 166175 		{
 166176 			*(*U32)(unsafe.Pointer(bp)) = libc.X_byteswap_ulong(tls, *(*U32)(unsafe.Pointer(pCellData)))
 166177 			if eInt != 0 {
 166178 				val = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp)))
 166179 			} else {
 166180 				val = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp)))
 166181 			}
 166182 		}
 166183 
 166184 		if *(*RtreeDValue)(unsafe.Pointer(p + 8)) >= val {
 166185 			pCellData += uintptr(4)
 166186 			{
 166187 				*(*U32)(unsafe.Pointer(bp + 4)) = libc.X_byteswap_ulong(tls, *(*U32)(unsafe.Pointer(pCellData)))
 166188 				if eInt != 0 {
 166189 					val = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp + 4)))
 166190 				} else {
 166191 					val = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp + 4)))
 166192 				}
 166193 			}
 166194 
 166195 			if *(*RtreeDValue)(unsafe.Pointer(p + 8)) <= val {
 166196 				return
 166197 			}
 166198 		}
 166199 		break
 166200 	case RTREE_LE:
 166201 		fallthrough
 166202 	case RTREE_LT:
 166203 		{
 166204 			*(*U32)(unsafe.Pointer(bp + 8)) = libc.X_byteswap_ulong(tls, *(*U32)(unsafe.Pointer(pCellData)))
 166205 			if eInt != 0 {
 166206 				val = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp + 8)))
 166207 			} else {
 166208 				val = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp + 8)))
 166209 			}
 166210 		}
 166211 
 166212 		if *(*RtreeDValue)(unsafe.Pointer(p + 8)) >= val {
 166213 			return
 166214 		}
 166215 		break
 166216 
 166217 	default:
 166218 		pCellData += uintptr(4)
 166219 		{
 166220 			*(*U32)(unsafe.Pointer(bp + 12)) = libc.X_byteswap_ulong(tls, *(*U32)(unsafe.Pointer(pCellData)))
 166221 			if eInt != 0 {
 166222 				val = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp + 12)))
 166223 			} else {
 166224 				val = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp + 12)))
 166225 			}
 166226 		}
 166227 
 166228 		if *(*RtreeDValue)(unsafe.Pointer(p + 8)) <= val {
 166229 			return
 166230 		}
 166231 		break
 166232 	}
 166233 	*(*int32)(unsafe.Pointer(peWithin)) = NOT_WITHIN
 166234 }
 166235 
 166236 func rtreeLeafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uintptr, peWithin uintptr) {
 166237 	bp := tls.Alloc(4)
 166238 	defer tls.Free(4)
 166239 
 166240 	var xN RtreeDValue
 166241 
 166242 	pCellData += uintptr(8 + (*RtreeConstraint)(unsafe.Pointer(p)).FiCoord*4)
 166243 
 166244 	{
 166245 		*(*U32)(unsafe.Pointer(bp)) = libc.X_byteswap_ulong(tls, *(*U32)(unsafe.Pointer(pCellData)))
 166246 		if eInt != 0 {
 166247 			xN = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp)))
 166248 		} else {
 166249 			xN = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp)))
 166250 		}
 166251 	}
 166252 
 166253 	switch (*RtreeConstraint)(unsafe.Pointer(p)).Fop {
 166254 	case RTREE_TRUE:
 166255 		return
 166256 	case RTREE_FALSE:
 166257 		break
 166258 	case RTREE_LE:
 166259 		if xN <= *(*RtreeDValue)(unsafe.Pointer(p + 8)) {
 166260 			return
 166261 		}
 166262 		break
 166263 	case RTREE_LT:
 166264 		if xN < *(*RtreeDValue)(unsafe.Pointer(p + 8)) {
 166265 			return
 166266 		}
 166267 		break
 166268 	case RTREE_GE:
 166269 		if xN >= *(*RtreeDValue)(unsafe.Pointer(p + 8)) {
 166270 			return
 166271 		}
 166272 		break
 166273 	case RTREE_GT:
 166274 		if xN > *(*RtreeDValue)(unsafe.Pointer(p + 8)) {
 166275 			return
 166276 		}
 166277 		break
 166278 	default:
 166279 		if xN == *(*RtreeDValue)(unsafe.Pointer(p + 8)) {
 166280 			return
 166281 		}
 166282 		break
 166283 	}
 166284 	*(*int32)(unsafe.Pointer(peWithin)) = NOT_WITHIN
 166285 }
 166286 
 166287 func nodeRowidIndex(tls *libc.TLS, pRtree uintptr, pNode uintptr, iRowid I64, piIndex uintptr) int32 {
 166288 	var ii int32
 166289 	var nCell int32 = readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2)
 166290 
 166291 	for ii = 0; ii < nCell; ii++ {
 166292 		if nodeGetRowid(tls, pRtree, pNode, ii) == iRowid {
 166293 			*(*int32)(unsafe.Pointer(piIndex)) = ii
 166294 			return SQLITE_OK
 166295 		}
 166296 	}
 166297 
 166298 	return SQLITE_CORRUPT | int32(1)<<8
 166299 }
 166300 
 166301 func nodeParentIndex(tls *libc.TLS, pRtree uintptr, pNode uintptr, piIndex uintptr) int32 {
 166302 	var pParent uintptr = (*RtreeNode)(unsafe.Pointer(pNode)).FpParent
 166303 	if pParent != 0 {
 166304 		return nodeRowidIndex(tls, pRtree, pParent, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode, piIndex)
 166305 	} else {
 166306 		*(*int32)(unsafe.Pointer(piIndex)) = -1
 166307 		return SQLITE_OK
 166308 	}
 166309 	return int32(0)
 166310 }
 166311 
 166312 func rtreeSearchPointCompare(tls *libc.TLS, pA uintptr, pB uintptr) int32 {
 166313 	if (*RtreeSearchPoint)(unsafe.Pointer(pA)).FrScore < (*RtreeSearchPoint)(unsafe.Pointer(pB)).FrScore {
 166314 		return -1
 166315 	}
 166316 	if (*RtreeSearchPoint)(unsafe.Pointer(pA)).FrScore > (*RtreeSearchPoint)(unsafe.Pointer(pB)).FrScore {
 166317 		return +1
 166318 	}
 166319 	if int32((*RtreeSearchPoint)(unsafe.Pointer(pA)).FiLevel) < int32((*RtreeSearchPoint)(unsafe.Pointer(pB)).FiLevel) {
 166320 		return -1
 166321 	}
 166322 	if int32((*RtreeSearchPoint)(unsafe.Pointer(pA)).FiLevel) > int32((*RtreeSearchPoint)(unsafe.Pointer(pB)).FiLevel) {
 166323 		return +1
 166324 	}
 166325 	return 0
 166326 }
 166327 
 166328 func rtreeSearchPointSwap(tls *libc.TLS, p uintptr, i int32, j int32) {
 166329 	var t = *(*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(i)*24))
 166330 
 166331 	*(*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(i)*24)) = *(*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(j)*24))
 166332 	*(*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(j)*24)) = t
 166333 	i++
 166334 	j++
 166335 	if i < RTREE_CACHE_SZ {
 166336 		if j >= RTREE_CACHE_SZ {
 166337 			nodeRelease(tls, (*RtreeCursor)(unsafe.Pointer(p)).Fbase.FpVtab, *(*uintptr)(unsafe.Pointer(p + 88 + uintptr(i)*8)))
 166338 			*(*uintptr)(unsafe.Pointer(p + 88 + uintptr(i)*8)) = uintptr(0)
 166339 		} else {
 166340 			var pTemp uintptr = *(*uintptr)(unsafe.Pointer(p + 88 + uintptr(i)*8))
 166341 			*(*uintptr)(unsafe.Pointer(p + 88 + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(p + 88 + uintptr(j)*8))
 166342 			*(*uintptr)(unsafe.Pointer(p + 88 + uintptr(j)*8)) = pTemp
 166343 		}
 166344 	}
 166345 }
 166346 
 166347 func rtreeSearchPointFirst(tls *libc.TLS, pCur uintptr) uintptr {
 166348 	if (*RtreeCursor)(unsafe.Pointer(pCur)).FbPoint != 0 {
 166349 		return pCur + 64
 166350 	}
 166351 	if (*RtreeCursor)(unsafe.Pointer(pCur)).FnPoint != 0 {
 166352 		return (*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint
 166353 	}
 166354 	return uintptr(0)
 166355 }
 166356 
 166357 func rtreeNodeOfFirstSearchPoint(tls *libc.TLS, pCur uintptr, pRC uintptr) uintptr {
 166358 	var id Sqlite3_int64
 166359 	var ii int32 = 1 - int32((*RtreeCursor)(unsafe.Pointer(pCur)).FbPoint)
 166360 
 166361 	if *(*uintptr)(unsafe.Pointer(pCur + 88 + uintptr(ii)*8)) == uintptr(0) {
 166362 		if ii != 0 {
 166363 			id = (*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint)).Fid
 166364 		} else {
 166365 			id = (*RtreeCursor)(unsafe.Pointer(pCur)).FsPoint.Fid
 166366 		}
 166367 		*(*int32)(unsafe.Pointer(pRC)) = nodeAcquire(tls, (*RtreeCursor)(unsafe.Pointer(pCur)).Fbase.FpVtab, id, uintptr(0), pCur+88+uintptr(ii)*8)
 166368 	}
 166369 	return *(*uintptr)(unsafe.Pointer(pCur + 88 + uintptr(ii)*8))
 166370 }
 166371 
 166372 func rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore RtreeDValue, iLevel U8) uintptr {
 166373 	var i int32
 166374 	var j int32
 166375 	var pNew uintptr
 166376 	if (*RtreeCursor)(unsafe.Pointer(pCur)).FnPoint >= (*RtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc {
 166377 		var nNew int32 = (*RtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc*2 + 8
 166378 		pNew = Xsqlite3_realloc64(tls, (*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint, uint64(nNew)*uint64(unsafe.Sizeof(RtreeSearchPoint{})))
 166379 		if pNew == uintptr(0) {
 166380 			return uintptr(0)
 166381 		}
 166382 		(*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint = pNew
 166383 		(*RtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc = nNew
 166384 	}
 166385 	i = libc.PostIncInt32(&(*RtreeCursor)(unsafe.Pointer(pCur)).FnPoint, 1)
 166386 	pNew = (*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint + uintptr(i)*24
 166387 	(*RtreeSearchPoint)(unsafe.Pointer(pNew)).FrScore = rScore
 166388 	(*RtreeSearchPoint)(unsafe.Pointer(pNew)).FiLevel = iLevel
 166389 
 166390 	for i > 0 {
 166391 		var pParent uintptr
 166392 		j = (i - 1) / 2
 166393 		pParent = (*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint + uintptr(j)*24
 166394 		if rtreeSearchPointCompare(tls, pNew, pParent) >= 0 {
 166395 			break
 166396 		}
 166397 		rtreeSearchPointSwap(tls, pCur, j, i)
 166398 		i = j
 166399 		pNew = pParent
 166400 	}
 166401 	return pNew
 166402 }
 166403 
 166404 func rtreeSearchPointNew(tls *libc.TLS, pCur uintptr, rScore RtreeDValue, iLevel U8) uintptr {
 166405 	var pNew uintptr
 166406 	var pFirst uintptr
 166407 	pFirst = rtreeSearchPointFirst(tls, pCur)
 166408 	*(*U32)(unsafe.Pointer(pCur + 128 + uintptr(iLevel)*4))++
 166409 	if pFirst == uintptr(0) ||
 166410 		(*RtreeSearchPoint)(unsafe.Pointer(pFirst)).FrScore > rScore ||
 166411 		(*RtreeSearchPoint)(unsafe.Pointer(pFirst)).FrScore == rScore && int32((*RtreeSearchPoint)(unsafe.Pointer(pFirst)).FiLevel) > int32(iLevel) {
 166412 		if (*RtreeCursor)(unsafe.Pointer(pCur)).FbPoint != 0 {
 166413 			var ii int32
 166414 			pNew = rtreeEnqueue(tls, pCur, rScore, iLevel)
 166415 			if pNew == uintptr(0) {
 166416 				return uintptr(0)
 166417 			}
 166418 			ii = int32((int64(pNew)-int64((*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint))/24) + 1
 166419 
 166420 			if ii < RTREE_CACHE_SZ {
 166421 				*(*uintptr)(unsafe.Pointer(pCur + 88 + uintptr(ii)*8)) = *(*uintptr)(unsafe.Pointer(pCur + 88))
 166422 			} else {
 166423 				nodeRelease(tls, (*RtreeCursor)(unsafe.Pointer(pCur)).Fbase.FpVtab, *(*uintptr)(unsafe.Pointer(pCur + 88)))
 166424 			}
 166425 			*(*uintptr)(unsafe.Pointer(pCur + 88)) = uintptr(0)
 166426 			*(*RtreeSearchPoint)(unsafe.Pointer(pNew)) = (*RtreeCursor)(unsafe.Pointer(pCur)).FsPoint
 166427 		}
 166428 		(*RtreeCursor)(unsafe.Pointer(pCur)).FsPoint.FrScore = rScore
 166429 		(*RtreeCursor)(unsafe.Pointer(pCur)).FsPoint.FiLevel = iLevel
 166430 		(*RtreeCursor)(unsafe.Pointer(pCur)).FbPoint = U8(1)
 166431 		return pCur + 64
 166432 	} else {
 166433 		return rtreeEnqueue(tls, pCur, rScore, iLevel)
 166434 	}
 166435 	return uintptr(0)
 166436 }
 166437 
 166438 func rtreeSearchPointPop(tls *libc.TLS, p uintptr) {
 166439 	var i int32
 166440 	var j int32
 166441 	var k int32
 166442 	var n int32
 166443 	i = 1 - int32((*RtreeCursor)(unsafe.Pointer(p)).FbPoint)
 166444 
 166445 	if *(*uintptr)(unsafe.Pointer(p + 88 + uintptr(i)*8)) != 0 {
 166446 		nodeRelease(tls, (*RtreeCursor)(unsafe.Pointer(p)).Fbase.FpVtab, *(*uintptr)(unsafe.Pointer(p + 88 + uintptr(i)*8)))
 166447 		*(*uintptr)(unsafe.Pointer(p + 88 + uintptr(i)*8)) = uintptr(0)
 166448 	}
 166449 	if (*RtreeCursor)(unsafe.Pointer(p)).FbPoint != 0 {
 166450 		*(*U32)(unsafe.Pointer(p + 128 + uintptr((*RtreeCursor)(unsafe.Pointer(p)).FsPoint.FiLevel)*4))--
 166451 		(*RtreeCursor)(unsafe.Pointer(p)).FbPoint = U8(0)
 166452 	} else if (*RtreeCursor)(unsafe.Pointer(p)).FnPoint != 0 {
 166453 		*(*U32)(unsafe.Pointer(p + 128 + uintptr((*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint)).FiLevel)*4))--
 166454 		n = libc.PreDecInt32(&(*RtreeCursor)(unsafe.Pointer(p)).FnPoint, 1)
 166455 		*(*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint)) = *(*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(n)*24))
 166456 		if n < RTREE_CACHE_SZ-1 {
 166457 			*(*uintptr)(unsafe.Pointer(p + 88 + 1*8)) = *(*uintptr)(unsafe.Pointer(p + 88 + uintptr(n+1)*8))
 166458 			*(*uintptr)(unsafe.Pointer(p + 88 + uintptr(n+1)*8)) = uintptr(0)
 166459 		}
 166460 		i = 0
 166461 		for libc.AssignInt32(&j, i*2+1) < n {
 166462 			k = j + 1
 166463 			if k < n && rtreeSearchPointCompare(tls, (*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(k)*24, (*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(j)*24) < 0 {
 166464 				if rtreeSearchPointCompare(tls, (*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(k)*24, (*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(i)*24) < 0 {
 166465 					rtreeSearchPointSwap(tls, p, i, k)
 166466 					i = k
 166467 				} else {
 166468 					break
 166469 				}
 166470 			} else {
 166471 				if rtreeSearchPointCompare(tls, (*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(j)*24, (*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(i)*24) < 0 {
 166472 					rtreeSearchPointSwap(tls, p, i, j)
 166473 					i = j
 166474 				} else {
 166475 					break
 166476 				}
 166477 			}
 166478 		}
 166479 	}
 166480 }
 166481 
 166482 func rtreeStepToLeaf(tls *libc.TLS, pCur uintptr) int32 {
 166483 	bp := tls.Alloc(20)
 166484 	defer tls.Free(20)
 166485 
 166486 	var p uintptr
 166487 	var pRtree uintptr = (*RtreeCursor)(unsafe.Pointer(pCur)).Fbase.FpVtab
 166488 	var pNode uintptr
 166489 
 166490 	*(*int32)(unsafe.Pointer(bp)) = SQLITE_OK
 166491 	var nCell int32
 166492 	var nConstraint int32 = (*RtreeCursor)(unsafe.Pointer(pCur)).FnConstraint
 166493 	var ii int32
 166494 	var eInt int32
 166495 	var x RtreeSearchPoint
 166496 
 166497 	eInt = libc.Bool32(int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_INT32)
 166498 	for libc.AssignUintptr(&p, rtreeSearchPointFirst(tls, pCur)) != uintptr(0) && int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiLevel) > 0 {
 166499 		var pCellData uintptr
 166500 		pNode = rtreeNodeOfFirstSearchPoint(tls, pCur, bp)
 166501 		if *(*int32)(unsafe.Pointer(bp)) != 0 {
 166502 			return *(*int32)(unsafe.Pointer(bp))
 166503 		}
 166504 		nCell = readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2)
 166505 
 166506 		pCellData = (*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr(4+int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell))
 166507 		for int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell) < nCell {
 166508 			*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8)) = Sqlite3_rtree_dbl(-1)
 166509 			*(*int32)(unsafe.Pointer(bp + 16)) = FULLY_WITHIN
 166510 			for ii = 0; ii < nConstraint; ii++ {
 166511 				var pConstraint uintptr = (*RtreeCursor)(unsafe.Pointer(pCur)).FaConstraint + uintptr(ii)*24
 166512 				if (*RtreeConstraint)(unsafe.Pointer(pConstraint)).Fop >= RTREE_MATCH {
 166513 					*(*int32)(unsafe.Pointer(bp)) = rtreeCallbackConstraint(tls, pConstraint, eInt, pCellData, p,
 166514 						bp+8, bp+16)
 166515 					if *(*int32)(unsafe.Pointer(bp)) != 0 {
 166516 						return *(*int32)(unsafe.Pointer(bp))
 166517 					}
 166518 				} else if int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiLevel) == 1 {
 166519 					rtreeLeafConstraint(tls, pConstraint, eInt, pCellData, bp+16)
 166520 				} else {
 166521 					rtreeNonleafConstraint(tls, pConstraint, eInt, pCellData, bp+16)
 166522 				}
 166523 				if *(*int32)(unsafe.Pointer(bp + 16)) == NOT_WITHIN {
 166524 					(*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell++
 166525 					pCellData += uintptr((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)
 166526 					break
 166527 				}
 166528 			}
 166529 			if *(*int32)(unsafe.Pointer(bp + 16)) == NOT_WITHIN {
 166530 				continue
 166531 			}
 166532 			(*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell++
 166533 			x.FiLevel = U8(int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiLevel) - 1)
 166534 			if x.FiLevel != 0 {
 166535 				x.Fid = readInt64(tls, pCellData)
 166536 				for ii = 0; ii < (*RtreeCursor)(unsafe.Pointer(pCur)).FnPoint; ii++ {
 166537 					if (*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint+uintptr(ii)*24)).Fid == x.Fid {
 166538 						return SQLITE_CORRUPT | int32(1)<<8
 166539 					}
 166540 				}
 166541 				x.FiCell = U8(0)
 166542 			} else {
 166543 				x.Fid = (*RtreeSearchPoint)(unsafe.Pointer(p)).Fid
 166544 				x.FiCell = U8(int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell) - 1)
 166545 			}
 166546 			if int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell) >= nCell {
 166547 				rtreeSearchPointPop(tls, pCur)
 166548 			}
 166549 			if *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8)) < 0.0 {
 166550 				*(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8)) = 0.0
 166551 			}
 166552 			p = rtreeSearchPointNew(tls, pCur, *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8)), x.FiLevel)
 166553 			if p == uintptr(0) {
 166554 				return SQLITE_NOMEM
 166555 			}
 166556 			(*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = U8(*(*int32)(unsafe.Pointer(bp + 16)))
 166557 			(*RtreeSearchPoint)(unsafe.Pointer(p)).Fid = x.Fid
 166558 			(*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell = x.FiCell
 166559 
 166560 			break
 166561 		}
 166562 		if int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell) >= nCell {
 166563 			rtreeSearchPointPop(tls, pCur)
 166564 		}
 166565 	}
 166566 	(*RtreeCursor)(unsafe.Pointer(pCur)).FatEOF = U8(libc.Bool32(p == uintptr(0)))
 166567 	return SQLITE_OK
 166568 }
 166569 
 166570 func rtreeNext(tls *libc.TLS, pVtabCursor uintptr) int32 {
 166571 	var pCsr uintptr = pVtabCursor
 166572 	var rc int32 = SQLITE_OK
 166573 
 166574 	if (*RtreeCursor)(unsafe.Pointer(pCsr)).FbAuxValid != 0 {
 166575 		(*RtreeCursor)(unsafe.Pointer(pCsr)).FbAuxValid = U8(0)
 166576 		Xsqlite3_reset(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux)
 166577 	}
 166578 	rtreeSearchPointPop(tls, pCsr)
 166579 	rc = rtreeStepToLeaf(tls, pCsr)
 166580 	return rc
 166581 }
 166582 
 166583 func rtreeRowid(tls *libc.TLS, pVtabCursor uintptr, pRowid uintptr) int32 {
 166584 	bp := tls.Alloc(4)
 166585 	defer tls.Free(4)
 166586 
 166587 	var pCsr uintptr = pVtabCursor
 166588 	var p uintptr = rtreeSearchPointFirst(tls, pCsr)
 166589 	*(*int32)(unsafe.Pointer(bp)) = SQLITE_OK
 166590 	var pNode uintptr = rtreeNodeOfFirstSearchPoint(tls, pCsr, bp)
 166591 	if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && p != 0 {
 166592 		*(*Sqlite_int64)(unsafe.Pointer(pRowid)) = nodeGetRowid(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab, pNode, int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell))
 166593 	}
 166594 	return *(*int32)(unsafe.Pointer(bp))
 166595 }
 166596 
 166597 func rtreeColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 {
 166598 	bp := tls.Alloc(8)
 166599 	defer tls.Free(8)
 166600 
 166601 	var pRtree uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab
 166602 	var pCsr uintptr = cur
 166603 	var p uintptr = rtreeSearchPointFirst(tls, pCsr)
 166604 
 166605 	*(*int32)(unsafe.Pointer(bp)) = SQLITE_OK
 166606 	var pNode uintptr = rtreeNodeOfFirstSearchPoint(tls, pCsr, bp)
 166607 
 166608 	if *(*int32)(unsafe.Pointer(bp)) != 0 {
 166609 		return *(*int32)(unsafe.Pointer(bp))
 166610 	}
 166611 	if p == uintptr(0) {
 166612 		return SQLITE_OK
 166613 	}
 166614 	if i == 0 {
 166615 		Xsqlite3_result_int64(tls, ctx, nodeGetRowid(tls, pRtree, pNode, int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell)))
 166616 	} else if i <= int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) {
 166617 		nodeGetCoord(tls, pRtree, pNode, int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell), i-1, bp+4)
 166618 		if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
 166619 			Xsqlite3_result_double(tls, ctx, float64(*(*RtreeValue)(unsafe.Pointer(bp + 4))))
 166620 		} else {
 166621 			Xsqlite3_result_int(tls, ctx, *(*int32)(unsafe.Pointer(bp + 4)))
 166622 		}
 166623 	} else {
 166624 		if !(int32((*RtreeCursor)(unsafe.Pointer(pCsr)).FbAuxValid) != 0) {
 166625 			if (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux == uintptr(0) {
 166626 				*(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v3(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, (*Rtree)(unsafe.Pointer(pRtree)).FzReadAuxSql, -1, uint32(0),
 166627 					pCsr+56, uintptr(0))
 166628 				if *(*int32)(unsafe.Pointer(bp)) != 0 {
 166629 					return *(*int32)(unsafe.Pointer(bp))
 166630 				}
 166631 			}
 166632 			Xsqlite3_bind_int64(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux, 1,
 166633 				nodeGetRowid(tls, pRtree, pNode, int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell)))
 166634 			*(*int32)(unsafe.Pointer(bp)) = Xsqlite3_step(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux)
 166635 			if *(*int32)(unsafe.Pointer(bp)) == SQLITE_ROW {
 166636 				(*RtreeCursor)(unsafe.Pointer(pCsr)).FbAuxValid = U8(1)
 166637 			} else {
 166638 				Xsqlite3_reset(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux)
 166639 				if *(*int32)(unsafe.Pointer(bp)) == SQLITE_DONE {
 166640 					*(*int32)(unsafe.Pointer(bp)) = SQLITE_OK
 166641 				}
 166642 				return *(*int32)(unsafe.Pointer(bp))
 166643 			}
 166644 		}
 166645 		Xsqlite3_result_value(tls, ctx,
 166646 			Xsqlite3_column_value(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux, i-int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)+1))
 166647 	}
 166648 	return SQLITE_OK
 166649 }
 166650 
 166651 func findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid I64, ppLeaf uintptr, piNode uintptr) int32 {
 166652 	var rc int32
 166653 	*(*uintptr)(unsafe.Pointer(ppLeaf)) = uintptr(0)
 166654 	Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid, 1, iRowid)
 166655 	if Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid) == SQLITE_ROW {
 166656 		var iNode I64 = Xsqlite3_column_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid, 0)
 166657 		if piNode != 0 {
 166658 			*(*Sqlite3_int64)(unsafe.Pointer(piNode)) = iNode
 166659 		}
 166660 		rc = nodeAcquire(tls, pRtree, iNode, uintptr(0), ppLeaf)
 166661 		Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid)
 166662 	} else {
 166663 		rc = Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid)
 166664 	}
 166665 	return rc
 166666 }
 166667 
 166668 func deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) int32 {
 166669 	var pBlob uintptr
 166670 	var pSrc uintptr
 166671 	var pInfo uintptr
 166672 
 166673 	pSrc = Xsqlite3_value_pointer(tls, pValue, ts+26566)
 166674 	if pSrc == uintptr(0) {
 166675 		return SQLITE_ERROR
 166676 	}
 166677 	pInfo = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(Sqlite3_rtree_query_info{}))+uint64((*RtreeMatchArg)(unsafe.Pointer(pSrc)).FiSize))
 166678 	if !(pInfo != 0) {
 166679 		return SQLITE_NOMEM
 166680 	}
 166681 	libc.Xmemset(tls, pInfo, 0, uint64(unsafe.Sizeof(Sqlite3_rtree_query_info{})))
 166682 	pBlob = pInfo + 1*112
 166683 	libc.Xmemcpy(tls, pBlob, pSrc, uint64((*RtreeMatchArg)(unsafe.Pointer(pSrc)).FiSize))
 166684 	(*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FpContext = (*RtreeMatchArg)(unsafe.Pointer(pBlob)).Fcb.FpContext
 166685 	(*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FnParam = (*RtreeMatchArg)(unsafe.Pointer(pBlob)).FnParam
 166686 	(*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FaParam = pBlob + 56
 166687 	(*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FapSqlParam = (*RtreeMatchArg)(unsafe.Pointer(pBlob)).FapSqlParam
 166688 
 166689 	if (*RtreeMatchArg)(unsafe.Pointer(pBlob)).Fcb.FxGeom != 0 {
 166690 		*(*uintptr)(unsafe.Pointer(pCons + 8)) = (*RtreeMatchArg)(unsafe.Pointer(pBlob)).Fcb.FxGeom
 166691 	} else {
 166692 		(*RtreeConstraint)(unsafe.Pointer(pCons)).Fop = RTREE_QUERY
 166693 		*(*uintptr)(unsafe.Pointer(pCons + 8)) = (*RtreeMatchArg)(unsafe.Pointer(pBlob)).Fcb.FxQueryFunc
 166694 	}
 166695 	(*RtreeConstraint)(unsafe.Pointer(pCons)).FpInfo = pInfo
 166696 	return SQLITE_OK
 166697 }
 166698 
 166699 func rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 {
 166700 	bp := tls.Alloc(32)
 166701 	defer tls.Free(32)
 166702 
 166703 	var pRtree uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pVtabCursor)).FpVtab
 166704 	var pCsr uintptr = pVtabCursor
 166705 	*(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0)
 166706 	var ii int32
 166707 	var rc int32 = SQLITE_OK
 166708 	*(*int32)(unsafe.Pointer(bp + 16)) = 0
 166709 
 166710 	rtreeReference(tls, pRtree)
 166711 
 166712 	resetCursor(tls, pCsr)
 166713 
 166714 	(*RtreeCursor)(unsafe.Pointer(pCsr)).FiStrategy = idxNum
 166715 	if idxNum == 1 {
 166716 		var p uintptr
 166717 		var iRowid I64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv)))
 166718 		*(*I64)(unsafe.Pointer(bp + 8)) = int64(0)
 166719 		var eType int32 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv)))
 166720 		if eType == SQLITE_INTEGER ||
 166721 			eType == SQLITE_FLOAT && Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv))) == float64(iRowid) {
 166722 			rc = findLeafNode(tls, pRtree, iRowid, bp, bp+8)
 166723 		} else {
 166724 			rc = SQLITE_OK
 166725 			*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 166726 		}
 166727 		if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) {
 166728 			p = rtreeSearchPointNew(tls, pCsr, 0.0, uint8(0))
 166729 
 166730 			*(*uintptr)(unsafe.Pointer(pCsr + 88)) = *(*uintptr)(unsafe.Pointer(bp))
 166731 			(*RtreeSearchPoint)(unsafe.Pointer(p)).Fid = *(*I64)(unsafe.Pointer(bp + 8))
 166732 			(*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = U8(PARTLY_WITHIN)
 166733 			rc = nodeRowidIndex(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp)), iRowid, bp+16)
 166734 			(*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell = U8(*(*int32)(unsafe.Pointer(bp + 16)))
 166735 
 166736 		} else {
 166737 			(*RtreeCursor)(unsafe.Pointer(pCsr)).FatEOF = U8(1)
 166738 		}
 166739 	} else {
 166740 		rc = nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp+24)
 166741 		if rc == SQLITE_OK && argc > 0 {
 166742 			(*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(RtreeConstraint{}))*uint64(argc))
 166743 			(*RtreeCursor)(unsafe.Pointer(pCsr)).FnConstraint = argc
 166744 			if !(int32((*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint) != 0) {
 166745 				rc = SQLITE_NOMEM
 166746 			} else {
 166747 				libc.Xmemset(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint, 0, uint64(unsafe.Sizeof(RtreeConstraint{}))*uint64(argc))
 166748 				libc.Xmemset(tls, pCsr+128, 0, uint64(unsafe.Sizeof(U32(0)))*uint64((*Rtree)(unsafe.Pointer(pRtree)).FiDepth+1))
 166749 
 166750 				for ii = 0; ii < argc; ii++ {
 166751 					var p uintptr = (*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint + uintptr(ii)*24
 166752 					var eType int32 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))
 166753 					(*RtreeConstraint)(unsafe.Pointer(p)).Fop = int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(ii*2))))
 166754 					(*RtreeConstraint)(unsafe.Pointer(p)).FiCoord = int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(ii*2+1)))) - '0'
 166755 					if (*RtreeConstraint)(unsafe.Pointer(p)).Fop >= RTREE_MATCH {
 166756 						rc = deserializeGeometry(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)), p)
 166757 						if rc != SQLITE_OK {
 166758 							break
 166759 						}
 166760 						(*Sqlite3_rtree_query_info)(unsafe.Pointer((*RtreeConstraint)(unsafe.Pointer(p)).FpInfo)).FnCoord = int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)
 166761 						(*Sqlite3_rtree_query_info)(unsafe.Pointer((*RtreeConstraint)(unsafe.Pointer(p)).FpInfo)).FanQueue = pCsr + 128
 166762 						(*Sqlite3_rtree_query_info)(unsafe.Pointer((*RtreeConstraint)(unsafe.Pointer(p)).FpInfo)).FmxLevel = (*Rtree)(unsafe.Pointer(pRtree)).FiDepth + 1
 166763 					} else if eType == SQLITE_INTEGER || eType == SQLITE_FLOAT {
 166764 						*(*RtreeDValue)(unsafe.Pointer(p + 8)) = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))
 166765 					} else {
 166766 						*(*RtreeDValue)(unsafe.Pointer(p + 8)) = 0.0
 166767 						if eType == SQLITE_NULL {
 166768 							(*RtreeConstraint)(unsafe.Pointer(p)).Fop = RTREE_FALSE
 166769 						} else if (*RtreeConstraint)(unsafe.Pointer(p)).Fop == RTREE_LT || (*RtreeConstraint)(unsafe.Pointer(p)).Fop == RTREE_LE {
 166770 							(*RtreeConstraint)(unsafe.Pointer(p)).Fop = RTREE_TRUE
 166771 						} else {
 166772 							(*RtreeConstraint)(unsafe.Pointer(p)).Fop = RTREE_FALSE
 166773 						}
 166774 					}
 166775 				}
 166776 			}
 166777 		}
 166778 		if rc == SQLITE_OK {
 166779 			var pNew uintptr
 166780 
 166781 			pNew = rtreeSearchPointNew(tls, pCsr, 0.0, U8((*Rtree)(unsafe.Pointer(pRtree)).FiDepth+1))
 166782 			if pNew == uintptr(0) {
 166783 				return SQLITE_NOMEM
 166784 			}
 166785 			(*RtreeSearchPoint)(unsafe.Pointer(pNew)).Fid = int64(1)
 166786 			(*RtreeSearchPoint)(unsafe.Pointer(pNew)).FiCell = U8(0)
 166787 			(*RtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = U8(PARTLY_WITHIN)
 166788 
 166789 			*(*uintptr)(unsafe.Pointer(pCsr + 88)) = *(*uintptr)(unsafe.Pointer(bp + 24))
 166790 			*(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0)
 166791 
 166792 			rc = rtreeStepToLeaf(tls, pCsr)
 166793 		}
 166794 	}
 166795 
 166796 	nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 24)))
 166797 	rtreeRelease(tls, pRtree)
 166798 	return rc
 166799 }
 166800 
 166801 func rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 {
 166802 	bp := tls.Alloc(49)
 166803 	defer tls.Free(49)
 166804 
 166805 	var pRtree uintptr = tab
 166806 	var rc int32 = SQLITE_OK
 166807 	var ii int32
 166808 	var bMatch int32 = 0
 166809 	var nRow I64
 166810 
 166811 	var iIdx int32 = 0
 166812 
 166813 	libc.Xmemset(tls, bp+8, 0, uint64(unsafe.Sizeof([41]int8{})))
 166814 
 166815 	for ii = 0; ii < (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint; ii++ {
 166816 		if int32((*sqlite3_index_constraint)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint+uintptr(ii)*12)).Fop) == SQLITE_INDEX_CONSTRAINT_MATCH {
 166817 			bMatch = 1
 166818 		}
 166819 	}
 166820 
 166821 	for ii = 0; ii < (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint && iIdx < int32(uint64(unsafe.Sizeof([41]int8{}))-uint64(1)); ii++ {
 166822 		var p uintptr = (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(ii)*12
 166823 
 166824 		if bMatch == 0 && (*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0 &&
 166825 			(*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn <= 0 && int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_EQ {
 166826 			var jj int32
 166827 			for jj = 0; jj < ii; jj++ {
 166828 				(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(jj)*8)).FargvIndex = 0
 166829 				(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(jj)*8)).Fomit = uint8(0)
 166830 			}
 166831 			(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 1
 166832 			(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(ii)*8)).FargvIndex = 1
 166833 			(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(jj)*8)).Fomit = uint8(1)
 166834 
 166835 			(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 30.0
 166836 			(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(1)
 166837 			(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxFlags = SQLITE_INDEX_SCAN_UNIQUE
 166838 			return SQLITE_OK
 166839 		}
 166840 
 166841 		if (*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0 &&
 166842 			((*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn > 0 && (*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn <= int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) ||
 166843 				int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_MATCH) {
 166844 			var op U8
 166845 			switch int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) {
 166846 			case SQLITE_INDEX_CONSTRAINT_EQ:
 166847 				op = U8(RTREE_EQ)
 166848 				break
 166849 				fallthrough
 166850 			case SQLITE_INDEX_CONSTRAINT_GT:
 166851 				op = U8(RTREE_GT)
 166852 				break
 166853 				fallthrough
 166854 			case SQLITE_INDEX_CONSTRAINT_LE:
 166855 				op = U8(RTREE_LE)
 166856 				break
 166857 				fallthrough
 166858 			case SQLITE_INDEX_CONSTRAINT_LT:
 166859 				op = U8(RTREE_LT)
 166860 				break
 166861 				fallthrough
 166862 			case SQLITE_INDEX_CONSTRAINT_GE:
 166863 				op = U8(RTREE_GE)
 166864 				break
 166865 				fallthrough
 166866 			case SQLITE_INDEX_CONSTRAINT_MATCH:
 166867 				op = U8(RTREE_MATCH)
 166868 				break
 166869 				fallthrough
 166870 			default:
 166871 				op = U8(0)
 166872 				break
 166873 			}
 166874 			if op != 0 {
 166875 				*(*int8)(unsafe.Pointer(bp + 8 + uintptr(libc.PostIncInt32(&iIdx, 1)))) = int8(op)
 166876 				*(*int8)(unsafe.Pointer(bp + 8 + uintptr(libc.PostIncInt32(&iIdx, 1)))) = int8((*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn - 1 + '0')
 166877 				(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(ii)*8)).FargvIndex = iIdx / 2
 166878 				(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(ii)*8)).Fomit = uint8(1)
 166879 			}
 166880 		}
 166881 	}
 166882 
 166883 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 2
 166884 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FneedToFreeIdxStr = 1
 166885 	if iIdx > 0 && uintptr(0) == libc.AssignPtrUintptr(pIdxInfo+48, Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp, bp+8))) {
 166886 		return SQLITE_NOMEM
 166887 	}
 166888 
 166889 	nRow = (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst >> (iIdx / 2)
 166890 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 6.0 * float64(nRow)
 166891 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = nRow
 166892 
 166893 	return rc
 166894 }
 166895 
 166896 func cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) RtreeDValue {
 166897 	var area RtreeDValue = RtreeDValue(1)
 166898 
 166899 	if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
 166900 		switch int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim) {
 166901 		case 5:
 166902 			area = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(p + 8 + 9*4)) - *(*RtreeValue)(unsafe.Pointer(p + 8 + 8*4)))
 166903 			fallthrough
 166904 		case 4:
 166905 			area = area * float64(*(*RtreeValue)(unsafe.Pointer(p + 8 + 7*4))-*(*RtreeValue)(unsafe.Pointer(p + 8 + 6*4)))
 166906 			fallthrough
 166907 		case 3:
 166908 			area = area * float64(*(*RtreeValue)(unsafe.Pointer(p + 8 + 5*4))-*(*RtreeValue)(unsafe.Pointer(p + 8 + 4*4)))
 166909 			fallthrough
 166910 		case 2:
 166911 			area = area * float64(*(*RtreeValue)(unsafe.Pointer(p + 8 + 3*4))-*(*RtreeValue)(unsafe.Pointer(p + 8 + 2*4)))
 166912 			fallthrough
 166913 		default:
 166914 			area = area * float64(*(*RtreeValue)(unsafe.Pointer(p + 8 + 1*4))-*(*RtreeValue)(unsafe.Pointer(p + 8)))
 166915 		}
 166916 	} else {
 166917 		switch int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim) {
 166918 		case 5:
 166919 			area = RtreeDValue(I64(*(*int32)(unsafe.Pointer(p + 8 + 9*4))) - I64(*(*int32)(unsafe.Pointer(p + 8 + 8*4))))
 166920 			fallthrough
 166921 		case 4:
 166922 			area = area * float64(I64(*(*int32)(unsafe.Pointer(p + 8 + 7*4)))-I64(*(*int32)(unsafe.Pointer(p + 8 + 6*4))))
 166923 			fallthrough
 166924 		case 3:
 166925 			area = area * float64(I64(*(*int32)(unsafe.Pointer(p + 8 + 5*4)))-I64(*(*int32)(unsafe.Pointer(p + 8 + 4*4))))
 166926 			fallthrough
 166927 		case 2:
 166928 			area = area * float64(I64(*(*int32)(unsafe.Pointer(p + 8 + 3*4)))-I64(*(*int32)(unsafe.Pointer(p + 8 + 2*4))))
 166929 			fallthrough
 166930 		default:
 166931 			area = area * float64(I64(*(*int32)(unsafe.Pointer(p + 8 + 1*4)))-I64(*(*int32)(unsafe.Pointer(p + 8))))
 166932 		}
 166933 	}
 166934 	return area
 166935 }
 166936 
 166937 func cellMargin(tls *libc.TLS, pRtree uintptr, p uintptr) RtreeDValue {
 166938 	var margin RtreeDValue = RtreeDValue(0)
 166939 	var ii int32 = int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) - 2
 166940 	for __ccgo := true; __ccgo; __ccgo = ii >= 0 {
 166941 		margin = margin + (func() float64 {
 166942 			if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
 166943 				return float64(*(*RtreeValue)(unsafe.Pointer(p + 8 + uintptr(ii+1)*4)))
 166944 			}
 166945 			return float64(*(*int32)(unsafe.Pointer(p + 8 + uintptr(ii+1)*4)))
 166946 		}() - func() float64 {
 166947 			if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
 166948 				return float64(*(*RtreeValue)(unsafe.Pointer(p + 8 + uintptr(ii)*4)))
 166949 			}
 166950 			return float64(*(*int32)(unsafe.Pointer(p + 8 + uintptr(ii)*4)))
 166951 		}())
 166952 		ii = ii - 2
 166953 	}
 166954 	return margin
 166955 }
 166956 
 166957 func cellUnion(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) {
 166958 	var ii int32 = 0
 166959 	if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
 166960 		for __ccgo := true; __ccgo; __ccgo = ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) {
 166961 			*(*RtreeValue)(unsafe.Pointer(p1 + 8 + uintptr(ii)*4)) = func() float32 {
 166962 				if *(*RtreeValue)(unsafe.Pointer(p1 + 8 + uintptr(ii)*4)) < *(*RtreeValue)(unsafe.Pointer(p2 + 8 + uintptr(ii)*4)) {
 166963 					return *(*RtreeValue)(unsafe.Pointer(p1 + 8 + uintptr(ii)*4))
 166964 				}
 166965 				return *(*RtreeValue)(unsafe.Pointer(p2 + 8 + uintptr(ii)*4))
 166966 			}()
 166967 			*(*RtreeValue)(unsafe.Pointer(p1 + 8 + uintptr(ii+1)*4)) = func() float32 {
 166968 				if *(*RtreeValue)(unsafe.Pointer(p1 + 8 + uintptr(ii+1)*4)) > *(*RtreeValue)(unsafe.Pointer(p2 + 8 + uintptr(ii+1)*4)) {
 166969 					return *(*RtreeValue)(unsafe.Pointer(p1 + 8 + uintptr(ii+1)*4))
 166970 				}
 166971 				return *(*RtreeValue)(unsafe.Pointer(p2 + 8 + uintptr(ii+1)*4))
 166972 			}()
 166973 			ii = ii + 2
 166974 		}
 166975 	} else {
 166976 		for __ccgo1 := true; __ccgo1; __ccgo1 = ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) {
 166977 			*(*int32)(unsafe.Pointer(p1 + 8 + uintptr(ii)*4)) = func() int32 {
 166978 				if *(*int32)(unsafe.Pointer(p1 + 8 + uintptr(ii)*4)) < *(*int32)(unsafe.Pointer(p2 + 8 + uintptr(ii)*4)) {
 166979 					return *(*int32)(unsafe.Pointer(p1 + 8 + uintptr(ii)*4))
 166980 				}
 166981 				return *(*int32)(unsafe.Pointer(p2 + 8 + uintptr(ii)*4))
 166982 			}()
 166983 			*(*int32)(unsafe.Pointer(p1 + 8 + uintptr(ii+1)*4)) = func() int32 {
 166984 				if *(*int32)(unsafe.Pointer(p1 + 8 + uintptr(ii+1)*4)) > *(*int32)(unsafe.Pointer(p2 + 8 + uintptr(ii+1)*4)) {
 166985 					return *(*int32)(unsafe.Pointer(p1 + 8 + uintptr(ii+1)*4))
 166986 				}
 166987 				return *(*int32)(unsafe.Pointer(p2 + 8 + uintptr(ii+1)*4))
 166988 			}()
 166989 			ii = ii + 2
 166990 		}
 166991 	}
 166992 }
 166993 
 166994 func cellContains(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) int32 {
 166995 	var ii int32
 166996 	var isInt int32 = libc.Bool32(int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_INT32)
 166997 	for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2); ii = ii + 2 {
 166998 		var a1 uintptr = p1 + 8 + uintptr(ii)*4
 166999 		var a2 uintptr = p2 + 8 + uintptr(ii)*4
 167000 		if !(isInt != 0) && (*(*RtreeValue)(unsafe.Pointer(a2)) < *(*RtreeValue)(unsafe.Pointer(a1)) || *(*RtreeValue)(unsafe.Pointer(a2 + 1*4)) > *(*RtreeValue)(unsafe.Pointer(a1 + 1*4))) ||
 167001 			isInt != 0 && (*(*int32)(unsafe.Pointer(a2)) < *(*int32)(unsafe.Pointer(a1)) || *(*int32)(unsafe.Pointer(a2 + 1*4)) > *(*int32)(unsafe.Pointer(a1 + 1*4))) {
 167002 			return 0
 167003 		}
 167004 	}
 167005 	return 1
 167006 }
 167007 
 167008 func cellGrowth(tls *libc.TLS, pRtree uintptr, p uintptr, pCell uintptr) RtreeDValue {
 167009 	bp := tls.Alloc(48)
 167010 	defer tls.Free(48)
 167011 
 167012 	var area RtreeDValue
 167013 
 167014 	libc.Xmemcpy(tls, bp, p, uint64(unsafe.Sizeof(RtreeCell{})))
 167015 	area = cellArea(tls, pRtree, bp)
 167016 	cellUnion(tls, pRtree, bp, pCell)
 167017 	return cellArea(tls, pRtree, bp) - area
 167018 }
 167019 
 167020 func cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell int32) RtreeDValue {
 167021 	var ii int32
 167022 	var overlap RtreeDValue = 0.0
 167023 	for ii = 0; ii < nCell; ii++ {
 167024 		var jj int32
 167025 		var o RtreeDValue = RtreeDValue(1)
 167026 		for jj = 0; jj < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2); jj = jj + 2 {
 167027 			var x1 RtreeDValue
 167028 			var x2 RtreeDValue
 167029 			x1 = func() float64 {
 167030 				if func() float64 {
 167031 					if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
 167032 						return float64(*(*RtreeValue)(unsafe.Pointer(p + 8 + uintptr(jj)*4)))
 167033 					}
 167034 					return float64(*(*int32)(unsafe.Pointer(p + 8 + uintptr(jj)*4)))
 167035 				}() > func() float64 {
 167036 					if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
 167037 						return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj)*4)))
 167038 					}
 167039 					return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj)*4)))
 167040 				}() {
 167041 					return func() float64 {
 167042 						if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
 167043 							return float64(*(*RtreeValue)(unsafe.Pointer(p + 8 + uintptr(jj)*4)))
 167044 						}
 167045 						return float64(*(*int32)(unsafe.Pointer(p + 8 + uintptr(jj)*4)))
 167046 					}()
 167047 				}
 167048 				return func() float64 {
 167049 					if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
 167050 						return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj)*4)))
 167051 					}
 167052 					return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj)*4)))
 167053 				}()
 167054 			}()
 167055 			x2 = func() float64 {
 167056 				if func() float64 {
 167057 					if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
 167058 						return float64(*(*RtreeValue)(unsafe.Pointer(p + 8 + uintptr(jj+1)*4)))
 167059 					}
 167060 					return float64(*(*int32)(unsafe.Pointer(p + 8 + uintptr(jj+1)*4)))
 167061 				}() < func() float64 {
 167062 					if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
 167063 						return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj+1)*4)))
 167064 					}
 167065 					return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj+1)*4)))
 167066 				}() {
 167067 					return func() float64 {
 167068 						if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
 167069 							return float64(*(*RtreeValue)(unsafe.Pointer(p + 8 + uintptr(jj+1)*4)))
 167070 						}
 167071 						return float64(*(*int32)(unsafe.Pointer(p + 8 + uintptr(jj+1)*4)))
 167072 					}()
 167073 				}
 167074 				return func() float64 {
 167075 					if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
 167076 						return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj+1)*4)))
 167077 					}
 167078 					return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(jj+1)*4)))
 167079 				}()
 167080 			}()
 167081 			if x2 < x1 {
 167082 				o = RtreeDValue(0)
 167083 				break
 167084 			} else {
 167085 				o = o * (x2 - x1)
 167086 			}
 167087 		}
 167088 		overlap = overlap + o
 167089 	}
 167090 	return overlap
 167091 }
 167092 
 167093 func sChooseLeaf(tls *libc.TLS, pRtree uintptr, pCell uintptr, iHeight int32, ppLeaf uintptr) int32 {
 167094 	bp := tls.Alloc(64)
 167095 	defer tls.Free(64)
 167096 
 167097 	var rc int32
 167098 	var ii int32
 167099 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 167100 	rc = nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp)
 167101 
 167102 	for ii = 0; rc == SQLITE_OK && ii < (*Rtree)(unsafe.Pointer(pRtree)).FiDepth-iHeight; ii++ {
 167103 		var iCell int32
 167104 		var iBest Sqlite3_int64 = int64(0)
 167105 
 167106 		var fMinGrowth RtreeDValue = 0.0
 167107 		var fMinArea RtreeDValue = 0.0
 167108 
 167109 		var nCell int32 = readInt16(tls, (*RtreeNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzData+2)
 167110 
 167111 		*(*uintptr)(unsafe.Pointer(bp + 56)) = uintptr(0)
 167112 
 167113 		var aCell uintptr = uintptr(0)
 167114 
 167115 		for iCell = 0; iCell < nCell; iCell++ {
 167116 			var bBest int32 = 0
 167117 			var growth RtreeDValue
 167118 			var area RtreeDValue
 167119 			nodeGetCell(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp)), iCell, bp+8)
 167120 			growth = cellGrowth(tls, pRtree, bp+8, pCell)
 167121 			area = cellArea(tls, pRtree, bp+8)
 167122 			if iCell == 0 || growth < fMinGrowth || growth == fMinGrowth && area < fMinArea {
 167123 				bBest = 1
 167124 			}
 167125 			if bBest != 0 {
 167126 				fMinGrowth = growth
 167127 				fMinArea = area
 167128 				iBest = (*RtreeCell)(unsafe.Pointer(bp + 8)).FiRowid
 167129 			}
 167130 		}
 167131 
 167132 		Xsqlite3_free(tls, aCell)
 167133 		rc = nodeAcquire(tls, pRtree, iBest, *(*uintptr)(unsafe.Pointer(bp)), bp+56)
 167134 		nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp)))
 167135 		*(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(bp + 56))
 167136 	}
 167137 
 167138 	*(*uintptr)(unsafe.Pointer(ppLeaf)) = *(*uintptr)(unsafe.Pointer(bp))
 167139 	return rc
 167140 }
 167141 
 167142 func sAdjustTree(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr) int32 {
 167143 	bp := tls.Alloc(56)
 167144 	defer tls.Free(56)
 167145 
 167146 	var p uintptr = pNode
 167147 	var cnt int32 = 0
 167148 	var rc int32
 167149 	for (*RtreeNode)(unsafe.Pointer(p)).FpParent != 0 {
 167150 		var pParent uintptr = (*RtreeNode)(unsafe.Pointer(p)).FpParent
 167151 
 167152 		cnt++
 167153 		if cnt > 100 {
 167154 			return SQLITE_CORRUPT | int32(1)<<8
 167155 		}
 167156 		rc = nodeParentIndex(tls, pRtree, p, bp)
 167157 		if rc != SQLITE_OK {
 167158 			return SQLITE_CORRUPT | int32(1)<<8
 167159 		}
 167160 
 167161 		nodeGetCell(tls, pRtree, pParent, *(*int32)(unsafe.Pointer(bp)), bp+8)
 167162 		if !(cellContains(tls, pRtree, bp+8, pCell) != 0) {
 167163 			cellUnion(tls, pRtree, bp+8, pCell)
 167164 			nodeOverwriteCell(tls, pRtree, pParent, bp+8, *(*int32)(unsafe.Pointer(bp)))
 167165 		}
 167166 
 167167 		p = pParent
 167168 	}
 167169 	return SQLITE_OK
 167170 }
 167171 
 167172 func rowidWrite(tls *libc.TLS, pRtree uintptr, iRowid Sqlite3_int64, iNode Sqlite3_int64) int32 {
 167173 	Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid, 1, iRowid)
 167174 	Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid, 2, iNode)
 167175 	Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid)
 167176 	return Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid)
 167177 }
 167178 
 167179 func parentWrite(tls *libc.TLS, pRtree uintptr, iNode Sqlite3_int64, iPar Sqlite3_int64) int32 {
 167180 	Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteParent, 1, iNode)
 167181 	Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteParent, 2, iPar)
 167182 	Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteParent)
 167183 	return Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteParent)
 167184 }
 167185 
 167186 func sSortByDistance(tls *libc.TLS, aIdx uintptr, nIdx int32, aDistance uintptr, aSpare uintptr) {
 167187 	if nIdx > 1 {
 167188 		var iLeft int32 = 0
 167189 		var iRight int32 = 0
 167190 
 167191 		var nLeft int32 = nIdx / 2
 167192 		var nRight int32 = nIdx - nLeft
 167193 		var aLeft uintptr = aIdx
 167194 		var aRight uintptr = aIdx + uintptr(nLeft)*4
 167195 
 167196 		sSortByDistance(tls, aLeft, nLeft, aDistance, aSpare)
 167197 		sSortByDistance(tls, aRight, nRight, aDistance, aSpare)
 167198 
 167199 		libc.Xmemcpy(tls, aSpare, aLeft, uint64(unsafe.Sizeof(int32(0)))*uint64(nLeft))
 167200 		aLeft = aSpare
 167201 
 167202 		for iLeft < nLeft || iRight < nRight {
 167203 			if iLeft == nLeft {
 167204 				*(*int32)(unsafe.Pointer(aIdx + uintptr(iLeft+iRight)*4)) = *(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4))
 167205 				iRight++
 167206 			} else if iRight == nRight {
 167207 				*(*int32)(unsafe.Pointer(aIdx + uintptr(iLeft+iRight)*4)) = *(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4))
 167208 				iLeft++
 167209 			} else {
 167210 				var fLeft RtreeDValue = *(*RtreeDValue)(unsafe.Pointer(aDistance + uintptr(*(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4)))*8))
 167211 				var fRight RtreeDValue = *(*RtreeDValue)(unsafe.Pointer(aDistance + uintptr(*(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4)))*8))
 167212 				if fLeft < fRight {
 167213 					*(*int32)(unsafe.Pointer(aIdx + uintptr(iLeft+iRight)*4)) = *(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4))
 167214 					iLeft++
 167215 				} else {
 167216 					*(*int32)(unsafe.Pointer(aIdx + uintptr(iLeft+iRight)*4)) = *(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4))
 167217 					iRight++
 167218 				}
 167219 			}
 167220 		}
 167221 
 167222 	}
 167223 }
 167224 
 167225 func sSortByDimension(tls *libc.TLS, pRtree uintptr, aIdx uintptr, nIdx int32, iDim int32, aCell uintptr, aSpare uintptr) {
 167226 	if nIdx > 1 {
 167227 		var iLeft int32 = 0
 167228 		var iRight int32 = 0
 167229 
 167230 		var nLeft int32 = nIdx / 2
 167231 		var nRight int32 = nIdx - nLeft
 167232 		var aLeft uintptr = aIdx
 167233 		var aRight uintptr = aIdx + uintptr(nLeft)*4
 167234 
 167235 		sSortByDimension(tls, pRtree, aLeft, nLeft, iDim, aCell, aSpare)
 167236 		sSortByDimension(tls, pRtree, aRight, nRight, iDim, aCell, aSpare)
 167237 
 167238 		libc.Xmemcpy(tls, aSpare, aLeft, uint64(unsafe.Sizeof(int32(0)))*uint64(nLeft))
 167239 		aLeft = aSpare
 167240 		for iLeft < nLeft || iRight < nRight {
 167241 			var xleft1 RtreeDValue = func() float64 {
 167242 				if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
 167243 					return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4)))*48 + 8 + uintptr(iDim*2)*4)))
 167244 				}
 167245 				return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4)))*48 + 8 + uintptr(iDim*2)*4)))
 167246 			}()
 167247 			var xleft2 RtreeDValue = func() float64 {
 167248 				if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
 167249 					return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4)))*48 + 8 + uintptr(iDim*2+1)*4)))
 167250 				}
 167251 				return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4)))*48 + 8 + uintptr(iDim*2+1)*4)))
 167252 			}()
 167253 			var xright1 RtreeDValue = func() float64 {
 167254 				if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
 167255 					return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4)))*48 + 8 + uintptr(iDim*2)*4)))
 167256 				}
 167257 				return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4)))*48 + 8 + uintptr(iDim*2)*4)))
 167258 			}()
 167259 			var xright2 RtreeDValue = func() float64 {
 167260 				if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
 167261 					return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4)))*48 + 8 + uintptr(iDim*2+1)*4)))
 167262 				}
 167263 				return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(*(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4)))*48 + 8 + uintptr(iDim*2+1)*4)))
 167264 			}()
 167265 			if iLeft != nLeft && (iRight == nRight ||
 167266 				xleft1 < xright1 ||
 167267 				xleft1 == xright1 && xleft2 < xright2) {
 167268 				*(*int32)(unsafe.Pointer(aIdx + uintptr(iLeft+iRight)*4)) = *(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4))
 167269 				iLeft++
 167270 			} else {
 167271 				*(*int32)(unsafe.Pointer(aIdx + uintptr(iLeft+iRight)*4)) = *(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4))
 167272 				iRight++
 167273 			}
 167274 		}
 167275 
 167276 	}
 167277 }
 167278 
 167279 func splitNodeStartree(tls *libc.TLS, pRtree uintptr, aCell uintptr, nCell int32, pLeft uintptr, pRight uintptr, pBboxLeft uintptr, pBboxRight uintptr) int32 {
 167280 	bp := tls.Alloc(96)
 167281 	defer tls.Free(96)
 167282 
 167283 	var aaSorted uintptr
 167284 	var aSpare uintptr
 167285 	var ii int32
 167286 
 167287 	var iBestDim int32 = 0
 167288 	var iBestSplit int32 = 0
 167289 	var fBestMargin RtreeDValue = 0.0
 167290 
 167291 	var nByte Sqlite3_int64 = Sqlite3_int64(uint64(int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim)+1) * (uint64(unsafe.Sizeof(uintptr(0))) + uint64(nCell)*uint64(unsafe.Sizeof(int32(0)))))
 167292 
 167293 	aaSorted = Xsqlite3_malloc64(tls, uint64(nByte))
 167294 	if !(aaSorted != 0) {
 167295 		return SQLITE_NOMEM
 167296 	}
 167297 
 167298 	aSpare = aaSorted + uintptr((*Rtree)(unsafe.Pointer(pRtree)).FnDim)*8 + uintptr(int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim)*nCell)*4
 167299 	libc.Xmemset(tls, aaSorted, 0, uint64(nByte))
 167300 	for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim); ii++ {
 167301 		var jj int32
 167302 		*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*8)) = aaSorted + uintptr((*Rtree)(unsafe.Pointer(pRtree)).FnDim)*8 + uintptr(ii*nCell)*4
 167303 		for jj = 0; jj < nCell; jj++ {
 167304 			*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*8)) + uintptr(jj)*4)) = jj
 167305 		}
 167306 		sSortByDimension(tls, pRtree, *(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*8)), nCell, ii, aCell, aSpare)
 167307 	}
 167308 
 167309 	for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim); ii++ {
 167310 		var margin RtreeDValue = 0.0
 167311 		var fBestOverlap RtreeDValue = 0.0
 167312 		var fBestArea RtreeDValue = 0.0
 167313 		var iBestLeft int32 = 0
 167314 		var nLeft int32
 167315 
 167316 		for nLeft = ((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize - 4) / int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) / 3; nLeft <= nCell-((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize-4)/int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)/3; nLeft++ {
 167317 			var kk int32
 167318 			var overlap RtreeDValue
 167319 			var area RtreeDValue
 167320 
 167321 			libc.Xmemcpy(tls, bp, aCell+uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*8)))))*48, uint64(unsafe.Sizeof(RtreeCell{})))
 167322 			libc.Xmemcpy(tls, bp+48, aCell+uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*8)) + uintptr(nCell-1)*4)))*48, uint64(unsafe.Sizeof(RtreeCell{})))
 167323 			for kk = 1; kk < nCell-1; kk++ {
 167324 				if kk < nLeft {
 167325 					cellUnion(tls, pRtree, bp, aCell+uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*8)) + uintptr(kk)*4)))*48)
 167326 				} else {
 167327 					cellUnion(tls, pRtree, bp+48, aCell+uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*8)) + uintptr(kk)*4)))*48)
 167328 				}
 167329 			}
 167330 			margin = margin + cellMargin(tls, pRtree, bp)
 167331 			margin = margin + cellMargin(tls, pRtree, bp+48)
 167332 			overlap = cellOverlap(tls, pRtree, bp, bp+48, 1)
 167333 			area = cellArea(tls, pRtree, bp) + cellArea(tls, pRtree, bp+48)
 167334 			if nLeft == ((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize-4)/int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)/3 ||
 167335 				overlap < fBestOverlap ||
 167336 				overlap == fBestOverlap && area < fBestArea {
 167337 				iBestLeft = nLeft
 167338 				fBestOverlap = overlap
 167339 				fBestArea = area
 167340 			}
 167341 		}
 167342 
 167343 		if ii == 0 || margin < fBestMargin {
 167344 			iBestDim = ii
 167345 			fBestMargin = margin
 167346 			iBestSplit = iBestLeft
 167347 		}
 167348 	}
 167349 
 167350 	libc.Xmemcpy(tls, pBboxLeft, aCell+uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(iBestDim)*8)))))*48, uint64(unsafe.Sizeof(RtreeCell{})))
 167351 	libc.Xmemcpy(tls, pBboxRight, aCell+uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(iBestDim)*8)) + uintptr(iBestSplit)*4)))*48, uint64(unsafe.Sizeof(RtreeCell{})))
 167352 	for ii = 0; ii < nCell; ii++ {
 167353 		var pTarget uintptr
 167354 		if ii < iBestSplit {
 167355 			pTarget = pLeft
 167356 		} else {
 167357 			pTarget = pRight
 167358 		}
 167359 		var pBbox uintptr
 167360 		if ii < iBestSplit {
 167361 			pBbox = pBboxLeft
 167362 		} else {
 167363 			pBbox = pBboxRight
 167364 		}
 167365 		var pCell uintptr = aCell + uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(iBestDim)*8)) + uintptr(ii)*4)))*48
 167366 		nodeInsertCell(tls, pRtree, pTarget, pCell)
 167367 		cellUnion(tls, pRtree, pBbox, pCell)
 167368 	}
 167369 
 167370 	Xsqlite3_free(tls, aaSorted)
 167371 	return SQLITE_OK
 167372 }
 167373 
 167374 func updateMapping(tls *libc.TLS, pRtree uintptr, iRowid I64, pNode uintptr, iHeight int32) int32 {
 167375 	var xSetMapping uintptr
 167376 	xSetMapping = func() uintptr {
 167377 		if iHeight == 0 {
 167378 			return *(*uintptr)(unsafe.Pointer(&struct {
 167379 				f func(*libc.TLS, uintptr, Sqlite3_int64, Sqlite3_int64) int32
 167380 			}{rowidWrite}))
 167381 		}
 167382 		return *(*uintptr)(unsafe.Pointer(&struct {
 167383 			f func(*libc.TLS, uintptr, Sqlite3_int64, Sqlite3_int64) int32
 167384 		}{parentWrite}))
 167385 	}()
 167386 	if iHeight > 0 {
 167387 		var pChild uintptr = nodeHashLookup(tls, pRtree, iRowid)
 167388 		var p uintptr
 167389 		for p = pNode; p != 0; p = (*RtreeNode)(unsafe.Pointer(p)).FpParent {
 167390 			if p == pChild {
 167391 				return SQLITE_CORRUPT | int32(1)<<8
 167392 			}
 167393 		}
 167394 		if pChild != 0 {
 167395 			nodeRelease(tls, pRtree, (*RtreeNode)(unsafe.Pointer(pChild)).FpParent)
 167396 			nodeReference(tls, pNode)
 167397 			(*RtreeNode)(unsafe.Pointer(pChild)).FpParent = pNode
 167398 		}
 167399 	}
 167400 	if pNode == uintptr(0) {
 167401 		return SQLITE_ERROR
 167402 	}
 167403 	return (*struct {
 167404 		f func(*libc.TLS, uintptr, Sqlite3_int64, Sqlite3_int64) int32
 167405 	})(unsafe.Pointer(&struct{ uintptr }{xSetMapping})).f(tls, pRtree, iRowid, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode)
 167406 }
 167407 
 167408 func sSplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 {
 167409 	bp := tls.Alloc(100)
 167410 	defer tls.Free(100)
 167411 
 167412 	var i int32
 167413 	var newCellIsRight int32
 167414 	var rc int32
 167415 	var nCell int32
 167416 	var aCell uintptr
 167417 	var aiUsed uintptr
 167418 	var pLeft uintptr
 167419 	var pRight uintptr
 167420 
 167421 	var pParent uintptr
 167422 
 167423 	var iRowid I64
 167424 	var iRowid1 I64
 167425 	newCellIsRight = 0
 167426 	rc = SQLITE_OK
 167427 	nCell = readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2)
 167428 	pLeft = uintptr(0)
 167429 	pRight = uintptr(0)
 167430 
 167431 	aCell = Xsqlite3_malloc64(tls, (uint64(unsafe.Sizeof(RtreeCell{}))+uint64(unsafe.Sizeof(int32(0))))*uint64(nCell+1))
 167432 	if !!(aCell != 0) {
 167433 		goto __1
 167434 	}
 167435 	rc = SQLITE_NOMEM
 167436 	goto splitnode_out
 167437 __1:
 167438 	;
 167439 	aiUsed = aCell + uintptr(nCell+1)*48
 167440 	libc.Xmemset(tls, aiUsed, 0, uint64(unsafe.Sizeof(int32(0)))*uint64(nCell+1))
 167441 	i = 0
 167442 __2:
 167443 	if !(i < nCell) {
 167444 		goto __4
 167445 	}
 167446 	nodeGetCell(tls, pRtree, pNode, i, aCell+uintptr(i)*48)
 167447 	goto __3
 167448 __3:
 167449 	i++
 167450 	goto __2
 167451 	goto __4
 167452 __4:
 167453 	;
 167454 	nodeZero(tls, pRtree, pNode)
 167455 	libc.Xmemcpy(tls, aCell+uintptr(nCell)*48, pCell, uint64(unsafe.Sizeof(RtreeCell{})))
 167456 	nCell++
 167457 
 167458 	if !((*RtreeNode)(unsafe.Pointer(pNode)).FiNode == int64(1)) {
 167459 		goto __5
 167460 	}
 167461 	pRight = nodeNew(tls, pRtree, pNode)
 167462 	pLeft = nodeNew(tls, pRtree, pNode)
 167463 	(*Rtree)(unsafe.Pointer(pRtree)).FiDepth++
 167464 	(*RtreeNode)(unsafe.Pointer(pNode)).FisDirty = 1
 167465 	writeInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData, (*Rtree)(unsafe.Pointer(pRtree)).FiDepth)
 167466 	goto __6
 167467 __5:
 167468 	pLeft = pNode
 167469 	pRight = nodeNew(tls, pRtree, (*RtreeNode)(unsafe.Pointer(pLeft)).FpParent)
 167470 	(*RtreeNode)(unsafe.Pointer(pLeft)).FnRef++
 167471 __6:
 167472 	;
 167473 	if !(!(pLeft != 0) || !(pRight != 0)) {
 167474 		goto __7
 167475 	}
 167476 	rc = SQLITE_NOMEM
 167477 	goto splitnode_out
 167478 __7:
 167479 	;
 167480 	libc.Xmemset(tls, (*RtreeNode)(unsafe.Pointer(pLeft)).FzData, 0, uint64((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize))
 167481 	libc.Xmemset(tls, (*RtreeNode)(unsafe.Pointer(pRight)).FzData, 0, uint64((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize))
 167482 
 167483 	rc = splitNodeStartree(tls, pRtree, aCell, nCell, pLeft, pRight,
 167484 		bp, bp+48)
 167485 	if !(rc != SQLITE_OK) {
 167486 		goto __8
 167487 	}
 167488 	goto splitnode_out
 167489 __8:
 167490 	;
 167491 	if !(SQLITE_OK != libc.AssignInt32(&rc, nodeWrite(tls, pRtree, pRight)) ||
 167492 		int64(0) == (*RtreeNode)(unsafe.Pointer(pLeft)).FiNode && SQLITE_OK != libc.AssignInt32(&rc, nodeWrite(tls, pRtree, pLeft))) {
 167493 		goto __9
 167494 	}
 167495 	goto splitnode_out
 167496 __9:
 167497 	;
 167498 	(*RtreeCell)(unsafe.Pointer(bp + 48)).FiRowid = (*RtreeNode)(unsafe.Pointer(pRight)).FiNode
 167499 	(*RtreeCell)(unsafe.Pointer(bp)).FiRowid = (*RtreeNode)(unsafe.Pointer(pLeft)).FiNode
 167500 
 167501 	if !((*RtreeNode)(unsafe.Pointer(pNode)).FiNode == int64(1)) {
 167502 		goto __10
 167503 	}
 167504 	rc = rtreeInsertCell(tls, pRtree, (*RtreeNode)(unsafe.Pointer(pLeft)).FpParent, bp, iHeight+1)
 167505 	if !(rc != SQLITE_OK) {
 167506 		goto __12
 167507 	}
 167508 	goto splitnode_out
 167509 __12:
 167510 	;
 167511 	goto __11
 167512 __10:
 167513 	pParent = (*RtreeNode)(unsafe.Pointer(pLeft)).FpParent
 167514 	rc = nodeParentIndex(tls, pRtree, pLeft, bp+96)
 167515 	if !(rc == SQLITE_OK) {
 167516 		goto __13
 167517 	}
 167518 	nodeOverwriteCell(tls, pRtree, pParent, bp, *(*int32)(unsafe.Pointer(bp + 96)))
 167519 	rc = sAdjustTree(tls, pRtree, pParent, bp)
 167520 
 167521 __13:
 167522 	;
 167523 	if !(rc != SQLITE_OK) {
 167524 		goto __14
 167525 	}
 167526 	goto splitnode_out
 167527 __14:
 167528 	;
 167529 __11:
 167530 	;
 167531 	if !(libc.AssignInt32(&rc, rtreeInsertCell(tls, pRtree, (*RtreeNode)(unsafe.Pointer(pRight)).FpParent, bp+48, iHeight+1)) != 0) {
 167532 		goto __15
 167533 	}
 167534 	goto splitnode_out
 167535 __15:
 167536 	;
 167537 	i = 0
 167538 __16:
 167539 	if !(i < readInt16(tls, (*RtreeNode)(unsafe.Pointer(pRight)).FzData+2)) {
 167540 		goto __18
 167541 	}
 167542 	iRowid = nodeGetRowid(tls, pRtree, pRight, i)
 167543 	rc = updateMapping(tls, pRtree, iRowid, pRight, iHeight)
 167544 	if !(iRowid == (*RtreeCell)(unsafe.Pointer(pCell)).FiRowid) {
 167545 		goto __19
 167546 	}
 167547 	newCellIsRight = 1
 167548 __19:
 167549 	;
 167550 	if !(rc != SQLITE_OK) {
 167551 		goto __20
 167552 	}
 167553 	goto splitnode_out
 167554 __20:
 167555 	;
 167556 	goto __17
 167557 __17:
 167558 	i++
 167559 	goto __16
 167560 	goto __18
 167561 __18:
 167562 	;
 167563 	if !((*RtreeNode)(unsafe.Pointer(pNode)).FiNode == int64(1)) {
 167564 		goto __21
 167565 	}
 167566 	i = 0
 167567 __23:
 167568 	if !(i < readInt16(tls, (*RtreeNode)(unsafe.Pointer(pLeft)).FzData+2)) {
 167569 		goto __25
 167570 	}
 167571 	iRowid1 = nodeGetRowid(tls, pRtree, pLeft, i)
 167572 	rc = updateMapping(tls, pRtree, iRowid1, pLeft, iHeight)
 167573 	if !(rc != SQLITE_OK) {
 167574 		goto __26
 167575 	}
 167576 	goto splitnode_out
 167577 __26:
 167578 	;
 167579 	goto __24
 167580 __24:
 167581 	i++
 167582 	goto __23
 167583 	goto __25
 167584 __25:
 167585 	;
 167586 	goto __22
 167587 __21:
 167588 	if !(newCellIsRight == 0) {
 167589 		goto __27
 167590 	}
 167591 	rc = updateMapping(tls, pRtree, (*RtreeCell)(unsafe.Pointer(pCell)).FiRowid, pLeft, iHeight)
 167592 __27:
 167593 	;
 167594 __22:
 167595 	;
 167596 	if !(rc == SQLITE_OK) {
 167597 		goto __28
 167598 	}
 167599 	rc = nodeRelease(tls, pRtree, pRight)
 167600 	pRight = uintptr(0)
 167601 __28:
 167602 	;
 167603 	if !(rc == SQLITE_OK) {
 167604 		goto __29
 167605 	}
 167606 	rc = nodeRelease(tls, pRtree, pLeft)
 167607 	pLeft = uintptr(0)
 167608 __29:
 167609 	;
 167610 splitnode_out:
 167611 	nodeRelease(tls, pRtree, pRight)
 167612 	nodeRelease(tls, pRtree, pLeft)
 167613 	Xsqlite3_free(tls, aCell)
 167614 	return rc
 167615 }
 167616 
 167617 func fixLeafParent(tls *libc.TLS, pRtree uintptr, pLeaf uintptr) int32 {
 167618 	var rc int32 = SQLITE_OK
 167619 	var pChild uintptr = pLeaf
 167620 	for rc == SQLITE_OK && (*RtreeNode)(unsafe.Pointer(pChild)).FiNode != int64(1) && (*RtreeNode)(unsafe.Pointer(pChild)).FpParent == uintptr(0) {
 167621 		var rc2 int32 = SQLITE_OK
 167622 		Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadParent, 1, (*RtreeNode)(unsafe.Pointer(pChild)).FiNode)
 167623 		rc = Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadParent)
 167624 		if rc == SQLITE_ROW {
 167625 			var pTest uintptr
 167626 			var iNode I64
 167627 
 167628 			iNode = Xsqlite3_column_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadParent, 0)
 167629 			for pTest = pLeaf; pTest != 0 && (*RtreeNode)(unsafe.Pointer(pTest)).FiNode != iNode; pTest = (*RtreeNode)(unsafe.Pointer(pTest)).FpParent {
 167630 			}
 167631 			if pTest == uintptr(0) {
 167632 				rc2 = nodeAcquire(tls, pRtree, iNode, uintptr(0), pChild)
 167633 			}
 167634 		}
 167635 		rc = Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadParent)
 167636 		if rc == SQLITE_OK {
 167637 			rc = rc2
 167638 		}
 167639 		if rc == SQLITE_OK && !(int32((*RtreeNode)(unsafe.Pointer(pChild)).FpParent) != 0) {
 167640 			rc = SQLITE_CORRUPT | int32(1)<<8
 167641 		}
 167642 		pChild = (*RtreeNode)(unsafe.Pointer(pChild)).FpParent
 167643 	}
 167644 	return rc
 167645 }
 167646 
 167647 func removeNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, iHeight int32) int32 {
 167648 	bp := tls.Alloc(4)
 167649 	defer tls.Free(4)
 167650 
 167651 	var rc int32
 167652 	var rc2 int32
 167653 	var pParent uintptr = uintptr(0)
 167654 
 167655 	rc = nodeParentIndex(tls, pRtree, pNode, bp)
 167656 	if rc == SQLITE_OK {
 167657 		pParent = (*RtreeNode)(unsafe.Pointer(pNode)).FpParent
 167658 		(*RtreeNode)(unsafe.Pointer(pNode)).FpParent = uintptr(0)
 167659 		rc = deleteCell(tls, pRtree, pParent, *(*int32)(unsafe.Pointer(bp)), iHeight+1)
 167660 
 167661 	}
 167662 	rc2 = nodeRelease(tls, pRtree, pParent)
 167663 	if rc == SQLITE_OK {
 167664 		rc = rc2
 167665 	}
 167666 	if rc != SQLITE_OK {
 167667 		return rc
 167668 	}
 167669 
 167670 	Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteNode, 1, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode)
 167671 	Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteNode)
 167672 	if SQLITE_OK != libc.AssignInt32(&rc, Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteNode)) {
 167673 		return rc
 167674 	}
 167675 
 167676 	Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteParent, 1, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode)
 167677 	Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteParent)
 167678 	if SQLITE_OK != libc.AssignInt32(&rc, Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteParent)) {
 167679 		return rc
 167680 	}
 167681 
 167682 	nodeHashDelete(tls, pRtree, pNode)
 167683 	(*RtreeNode)(unsafe.Pointer(pNode)).FiNode = I64(iHeight)
 167684 	(*RtreeNode)(unsafe.Pointer(pNode)).FpNext = (*Rtree)(unsafe.Pointer(pRtree)).FpDeleted
 167685 	(*RtreeNode)(unsafe.Pointer(pNode)).FnRef++
 167686 	(*Rtree)(unsafe.Pointer(pRtree)).FpDeleted = pNode
 167687 
 167688 	return SQLITE_OK
 167689 }
 167690 
 167691 func fixBoundingBox(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 {
 167692 	bp := tls.Alloc(100)
 167693 	defer tls.Free(100)
 167694 
 167695 	var pParent uintptr = (*RtreeNode)(unsafe.Pointer(pNode)).FpParent
 167696 	var rc int32 = SQLITE_OK
 167697 	if pParent != 0 {
 167698 		var nCell int32 = readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2)
 167699 
 167700 		nodeGetCell(tls, pRtree, pNode, 0, bp)
 167701 		for *(*int32)(unsafe.Pointer(bp + 96)) = 1; *(*int32)(unsafe.Pointer(bp + 96)) < nCell; *(*int32)(unsafe.Pointer(bp + 96))++ {
 167702 			nodeGetCell(tls, pRtree, pNode, *(*int32)(unsafe.Pointer(bp + 96)), bp+48)
 167703 			cellUnion(tls, pRtree, bp, bp+48)
 167704 		}
 167705 		(*RtreeCell)(unsafe.Pointer(bp)).FiRowid = (*RtreeNode)(unsafe.Pointer(pNode)).FiNode
 167706 		rc = nodeParentIndex(tls, pRtree, pNode, bp+96)
 167707 		if rc == SQLITE_OK {
 167708 			nodeOverwriteCell(tls, pRtree, pParent, bp, *(*int32)(unsafe.Pointer(bp + 96)))
 167709 			rc = fixBoundingBox(tls, pRtree, pParent)
 167710 		}
 167711 	}
 167712 	return rc
 167713 }
 167714 
 167715 func deleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, iHeight int32) int32 {
 167716 	var pParent uintptr
 167717 	var rc int32
 167718 
 167719 	if SQLITE_OK != libc.AssignInt32(&rc, fixLeafParent(tls, pRtree, pNode)) {
 167720 		return rc
 167721 	}
 167722 
 167723 	nodeDeleteCell(tls, pRtree, pNode, iCell)
 167724 
 167725 	pParent = (*RtreeNode)(unsafe.Pointer(pNode)).FpParent
 167726 
 167727 	if pParent != 0 {
 167728 		if readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2) < ((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize-4)/int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)/3 {
 167729 			rc = removeNode(tls, pRtree, pNode, iHeight)
 167730 		} else {
 167731 			rc = fixBoundingBox(tls, pRtree, pNode)
 167732 		}
 167733 	}
 167734 
 167735 	return rc
 167736 }
 167737 
 167738 func sReinsert(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 {
 167739 	bp := tls.Alloc(48)
 167740 	defer tls.Free(48)
 167741 
 167742 	var aOrder uintptr
 167743 	var aSpare uintptr
 167744 	var aCell uintptr
 167745 	var aDistance uintptr
 167746 	var nCell int32
 167747 
 167748 	var iDim int32
 167749 	var ii int32
 167750 	var rc int32 = SQLITE_OK
 167751 	var n int32
 167752 
 167753 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(RtreeDValue(0)))*uint64(RTREE_MAX_DIMENSIONS))
 167754 
 167755 	nCell = readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2) + 1
 167756 	n = (nCell + 1) & libc.CplInt32(1)
 167757 
 167758 	aCell = Xsqlite3_malloc64(tls, uint64(n)*(uint64(unsafe.Sizeof(RtreeCell{}))+uint64(unsafe.Sizeof(int32(0)))+uint64(unsafe.Sizeof(int32(0)))+uint64(unsafe.Sizeof(RtreeDValue(0)))))
 167759 	if !(aCell != 0) {
 167760 		return SQLITE_NOMEM
 167761 	}
 167762 	aOrder = aCell + uintptr(n)*48
 167763 	aSpare = aOrder + uintptr(n)*4
 167764 	aDistance = aSpare + uintptr(n)*4
 167765 
 167766 	for ii = 0; ii < nCell; ii++ {
 167767 		if ii == nCell-1 {
 167768 			libc.Xmemcpy(tls, aCell+uintptr(ii)*48, pCell, uint64(unsafe.Sizeof(RtreeCell{})))
 167769 		} else {
 167770 			nodeGetCell(tls, pRtree, pNode, ii, aCell+uintptr(ii)*48)
 167771 		}
 167772 		*(*int32)(unsafe.Pointer(aOrder + uintptr(ii)*4)) = ii
 167773 		for iDim = 0; iDim < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim); iDim++ {
 167774 			*(*RtreeDValue)(unsafe.Pointer(bp + uintptr(iDim)*8)) += func() float64 {
 167775 				if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
 167776 					return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(iDim*2)*4)))
 167777 				}
 167778 				return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(iDim*2)*4)))
 167779 			}()
 167780 			*(*RtreeDValue)(unsafe.Pointer(bp + uintptr(iDim)*8)) += func() float64 {
 167781 				if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
 167782 					return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(iDim*2+1)*4)))
 167783 				}
 167784 				return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(iDim*2+1)*4)))
 167785 			}()
 167786 		}
 167787 	}
 167788 	for iDim = 0; iDim < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim); iDim++ {
 167789 		*(*RtreeDValue)(unsafe.Pointer(bp + uintptr(iDim)*8)) = *(*RtreeDValue)(unsafe.Pointer(bp + uintptr(iDim)*8)) / (float64(nCell) * RtreeDValue(2))
 167790 	}
 167791 
 167792 	for ii = 0; ii < nCell; ii++ {
 167793 		*(*RtreeDValue)(unsafe.Pointer(aDistance + uintptr(ii)*8)) = 0.0
 167794 		for iDim = 0; iDim < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim); iDim++ {
 167795 			var coord RtreeDValue = func() float64 {
 167796 				if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
 167797 					return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(iDim*2+1)*4)))
 167798 				}
 167799 				return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(iDim*2+1)*4)))
 167800 			}() - func() float64 {
 167801 				if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 {
 167802 					return float64(*(*RtreeValue)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(iDim*2)*4)))
 167803 				}
 167804 				return float64(*(*int32)(unsafe.Pointer(aCell + uintptr(ii)*48 + 8 + uintptr(iDim*2)*4)))
 167805 			}()
 167806 			*(*RtreeDValue)(unsafe.Pointer(aDistance + uintptr(ii)*8)) += (coord - *(*RtreeDValue)(unsafe.Pointer(bp + uintptr(iDim)*8))) * (coord - *(*RtreeDValue)(unsafe.Pointer(bp + uintptr(iDim)*8)))
 167807 		}
 167808 	}
 167809 
 167810 	sSortByDistance(tls, aOrder, nCell, aDistance, aSpare)
 167811 	nodeZero(tls, pRtree, pNode)
 167812 
 167813 	for ii = 0; rc == SQLITE_OK && ii < nCell-(((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize-4)/int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)/3+1); ii++ {
 167814 		var p uintptr = aCell + uintptr(*(*int32)(unsafe.Pointer(aOrder + uintptr(ii)*4)))*48
 167815 		nodeInsertCell(tls, pRtree, pNode, p)
 167816 		if (*RtreeCell)(unsafe.Pointer(p)).FiRowid == (*RtreeCell)(unsafe.Pointer(pCell)).FiRowid {
 167817 			if iHeight == 0 {
 167818 				rc = rowidWrite(tls, pRtree, (*RtreeCell)(unsafe.Pointer(p)).FiRowid, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode)
 167819 			} else {
 167820 				rc = parentWrite(tls, pRtree, (*RtreeCell)(unsafe.Pointer(p)).FiRowid, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode)
 167821 			}
 167822 		}
 167823 	}
 167824 	if rc == SQLITE_OK {
 167825 		rc = fixBoundingBox(tls, pRtree, pNode)
 167826 	}
 167827 	for ; rc == SQLITE_OK && ii < nCell; ii++ {
 167828 		var p uintptr = aCell + uintptr(*(*int32)(unsafe.Pointer(aOrder + uintptr(ii)*4)))*48
 167829 		rc = sChooseLeaf(tls, pRtree, p, iHeight, bp+40)
 167830 		if rc == SQLITE_OK {
 167831 			var rc2 int32
 167832 			rc = rtreeInsertCell(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 40)), p, iHeight)
 167833 			rc2 = nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 40)))
 167834 			if rc == SQLITE_OK {
 167835 				rc = rc2
 167836 			}
 167837 		}
 167838 	}
 167839 
 167840 	Xsqlite3_free(tls, aCell)
 167841 	return rc
 167842 }
 167843 
 167844 func rtreeInsertCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 {
 167845 	var rc int32 = SQLITE_OK
 167846 	if iHeight > 0 {
 167847 		var pChild uintptr = nodeHashLookup(tls, pRtree, (*RtreeCell)(unsafe.Pointer(pCell)).FiRowid)
 167848 		if pChild != 0 {
 167849 			nodeRelease(tls, pRtree, (*RtreeNode)(unsafe.Pointer(pChild)).FpParent)
 167850 			nodeReference(tls, pNode)
 167851 			(*RtreeNode)(unsafe.Pointer(pChild)).FpParent = pNode
 167852 		}
 167853 	}
 167854 	if nodeInsertCell(tls, pRtree, pNode, pCell) != 0 {
 167855 		if iHeight <= (*Rtree)(unsafe.Pointer(pRtree)).FiReinsertHeight || (*RtreeNode)(unsafe.Pointer(pNode)).FiNode == int64(1) {
 167856 			rc = sSplitNode(tls, pRtree, pNode, pCell, iHeight)
 167857 		} else {
 167858 			(*Rtree)(unsafe.Pointer(pRtree)).FiReinsertHeight = iHeight
 167859 			rc = sReinsert(tls, pRtree, pNode, pCell, iHeight)
 167860 		}
 167861 	} else {
 167862 		rc = sAdjustTree(tls, pRtree, pNode, pCell)
 167863 		if rc == SQLITE_OK {
 167864 			if iHeight == 0 {
 167865 				rc = rowidWrite(tls, pRtree, (*RtreeCell)(unsafe.Pointer(pCell)).FiRowid, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode)
 167866 			} else {
 167867 				rc = parentWrite(tls, pRtree, (*RtreeCell)(unsafe.Pointer(pCell)).FiRowid, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode)
 167868 			}
 167869 		}
 167870 	}
 167871 	return rc
 167872 }
 167873 
 167874 func reinsertNodeContent(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 {
 167875 	bp := tls.Alloc(56)
 167876 	defer tls.Free(56)
 167877 
 167878 	var ii int32
 167879 	var rc int32 = SQLITE_OK
 167880 	var nCell int32 = readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData+2)
 167881 
 167882 	for ii = 0; rc == SQLITE_OK && ii < nCell; ii++ {
 167883 		nodeGetCell(tls, pRtree, pNode, ii, bp)
 167884 
 167885 		rc = sChooseLeaf(tls, pRtree, bp, int32((*RtreeNode)(unsafe.Pointer(pNode)).FiNode), bp+48)
 167886 		if rc == SQLITE_OK {
 167887 			var rc2 int32
 167888 			rc = rtreeInsertCell(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 48)), bp, int32((*RtreeNode)(unsafe.Pointer(pNode)).FiNode))
 167889 			rc2 = nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 48)))
 167890 			if rc == SQLITE_OK {
 167891 				rc = rc2
 167892 			}
 167893 		}
 167894 	}
 167895 	return rc
 167896 }
 167897 
 167898 func rtreeNewRowid(tls *libc.TLS, pRtree uintptr, piRowid uintptr) int32 {
 167899 	var rc int32
 167900 	Xsqlite3_bind_null(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid, 1)
 167901 	Xsqlite3_bind_null(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid, 2)
 167902 	Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid)
 167903 	rc = Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid)
 167904 	*(*I64)(unsafe.Pointer(piRowid)) = Xsqlite3_last_insert_rowid(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb)
 167905 	return rc
 167906 }
 167907 
 167908 func rtreeDeleteRowid(tls *libc.TLS, pRtree uintptr, iDelete Sqlite3_int64) int32 {
 167909 	bp := tls.Alloc(32)
 167910 	defer tls.Free(32)
 167911 
 167912 	var rc int32
 167913 	*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 167914 
 167915 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 167916 
 167917 	rc = nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp)
 167918 
 167919 	if rc == SQLITE_OK {
 167920 		rc = findLeafNode(tls, pRtree, iDelete, bp+8, uintptr(0))
 167921 	}
 167922 
 167923 	if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 {
 167924 		var rc2 int32
 167925 		rc = nodeRowidIndex(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 8)), iDelete, bp+16)
 167926 		if rc == SQLITE_OK {
 167927 			rc = deleteCell(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*int32)(unsafe.Pointer(bp + 16)), 0)
 167928 		}
 167929 		rc2 = nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 8)))
 167930 		if rc == SQLITE_OK {
 167931 			rc = rc2
 167932 		}
 167933 	}
 167934 
 167935 	if rc == SQLITE_OK {
 167936 		Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteRowid, 1, iDelete)
 167937 		Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteRowid)
 167938 		rc = Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteRowid)
 167939 	}
 167940 
 167941 	if rc == SQLITE_OK && (*Rtree)(unsafe.Pointer(pRtree)).FiDepth > 0 && readInt16(tls, (*RtreeNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzData+2) == 1 {
 167942 		var rc2 int32
 167943 		*(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0)
 167944 		var iChild I64 = nodeGetRowid(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp)), 0)
 167945 		rc = nodeAcquire(tls, pRtree, iChild, *(*uintptr)(unsafe.Pointer(bp)), bp+24)
 167946 		if rc == SQLITE_OK {
 167947 			rc = removeNode(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 24)), (*Rtree)(unsafe.Pointer(pRtree)).FiDepth-1)
 167948 		}
 167949 		rc2 = nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 24)))
 167950 		if rc == SQLITE_OK {
 167951 			rc = rc2
 167952 		}
 167953 		if rc == SQLITE_OK {
 167954 			(*Rtree)(unsafe.Pointer(pRtree)).FiDepth--
 167955 			writeInt16(tls, (*RtreeNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzData, (*Rtree)(unsafe.Pointer(pRtree)).FiDepth)
 167956 			(*RtreeNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FisDirty = 1
 167957 		}
 167958 	}
 167959 
 167960 	for *(*uintptr)(unsafe.Pointer(bp + 8)) = (*Rtree)(unsafe.Pointer(pRtree)).FpDeleted; *(*uintptr)(unsafe.Pointer(bp + 8)) != 0; *(*uintptr)(unsafe.Pointer(bp + 8)) = (*Rtree)(unsafe.Pointer(pRtree)).FpDeleted {
 167961 		if rc == SQLITE_OK {
 167962 			rc = reinsertNodeContent(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 8)))
 167963 		}
 167964 		(*Rtree)(unsafe.Pointer(pRtree)).FpDeleted = (*RtreeNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FpNext
 167965 		(*Rtree)(unsafe.Pointer(pRtree)).FnNodeRef--
 167966 		Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
 167967 	}
 167968 
 167969 	if rc == SQLITE_OK {
 167970 		rc = nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp)))
 167971 	} else {
 167972 		nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp)))
 167973 	}
 167974 
 167975 	return rc
 167976 }
 167977 
 167978 func rtreeValueDown(tls *libc.TLS, v uintptr) RtreeValue {
 167979 	var d float64 = Xsqlite3_value_double(tls, v)
 167980 	var f float32 = float32(d)
 167981 	if float64(f) > d {
 167982 		f = float32(d * func() float64 {
 167983 			if d < float64(0) {
 167984 				return float64(1.0) + float64(1.0)/8388608.0
 167985 			}
 167986 			return float64(1.0) - float64(1.0)/8388608.0
 167987 		}())
 167988 	}
 167989 	return f
 167990 }
 167991 
 167992 func rtreeValueUp(tls *libc.TLS, v uintptr) RtreeValue {
 167993 	var d float64 = Xsqlite3_value_double(tls, v)
 167994 	var f float32 = float32(d)
 167995 	if float64(f) < d {
 167996 		f = float32(d * func() float64 {
 167997 			if d < float64(0) {
 167998 				return float64(1.0) - float64(1.0)/8388608.0
 167999 			}
 168000 			return float64(1.0) + float64(1.0)/8388608.0
 168001 		}())
 168002 	}
 168003 	return f
 168004 }
 168005 
 168006 func rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) int32 {
 168007 	bp := tls.Alloc(64)
 168008 	defer tls.Free(64)
 168009 
 168010 	*(*uintptr)(unsafe.Pointer(bp + 56)) = uintptr(0)
 168011 	var zSql uintptr
 168012 	var rc int32
 168013 
 168014 	zSql = Xsqlite3_mprintf(tls, ts+26580, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName))
 168015 	if zSql != 0 {
 168016 		rc = Xsqlite3_prepare_v2(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, zSql, -1, bp+56, uintptr(0))
 168017 	} else {
 168018 		rc = SQLITE_NOMEM
 168019 	}
 168020 	Xsqlite3_free(tls, zSql)
 168021 
 168022 	if rc == SQLITE_OK {
 168023 		if iCol == 0 {
 168024 			var zCol uintptr = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 56)), 0)
 168025 			(*Rtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls,
 168026 				ts+26600, libc.VaList(bp+16, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zCol))
 168027 		} else {
 168028 			var zCol1 uintptr = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 56)), iCol)
 168029 			var zCol2 uintptr = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 56)), iCol+1)
 168030 			(*Rtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls,
 168031 				ts+26632, libc.VaList(bp+32, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2))
 168032 		}
 168033 	}
 168034 
 168035 	Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 56)))
 168036 	return func() int32 {
 168037 		if rc == SQLITE_OK {
 168038 			return SQLITE_CONSTRAINT
 168039 		}
 168040 		return rc
 168041 	}()
 168042 }
 168043 
 168044 func rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRowid uintptr) int32 {
 168045 	bp := tls.Alloc(56)
 168046 	defer tls.Free(56)
 168047 
 168048 	var pRtree uintptr
 168049 	var rc int32
 168050 
 168051 	var bHaveRowid int32
 168052 	var steprc int32
 168053 	var ii int32
 168054 	var nn int32
 168055 	var rc2 int32
 168056 	var pUp uintptr
 168057 	var jj int32
 168058 
 168059 	pRtree = pVtab
 168060 	rc = SQLITE_OK
 168061 	bHaveRowid = 0
 168062 
 168063 	if !((*Rtree)(unsafe.Pointer(pRtree)).FnNodeRef != 0) {
 168064 		goto __1
 168065 	}
 168066 
 168067 	return SQLITE_LOCKED | int32(2)<<8
 168068 __1:
 168069 	;
 168070 	rtreeReference(tls, pRtree)
 168071 
 168072 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(RtreeCell{})))
 168073 
 168074 	if !(nData > 1) {
 168075 		goto __2
 168076 	}
 168077 	nn = nData - 4
 168078 
 168079 	if !(nn > int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)) {
 168080 		goto __3
 168081 	}
 168082 	nn = int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)
 168083 __3:
 168084 	;
 168085 	if !(int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32) {
 168086 		goto __4
 168087 	}
 168088 	ii = 0
 168089 __6:
 168090 	if !(ii < nn) {
 168091 		goto __8
 168092 	}
 168093 	*(*RtreeValue)(unsafe.Pointer(bp + 8 + uintptr(ii)*4)) = rtreeValueDown(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr(ii+3)*8)))
 168094 	*(*RtreeValue)(unsafe.Pointer(bp + 8 + uintptr(ii+1)*4)) = rtreeValueUp(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr(ii+4)*8)))
 168095 	if !(*(*RtreeValue)(unsafe.Pointer(bp + 8 + uintptr(ii)*4)) > *(*RtreeValue)(unsafe.Pointer(bp + 8 + uintptr(ii+1)*4))) {
 168096 		goto __9
 168097 	}
 168098 	rc = rtreeConstraintError(tls, pRtree, ii+1)
 168099 	goto constraint
 168100 __9:
 168101 	;
 168102 	goto __7
 168103 __7:
 168104 	ii = ii + 2
 168105 	goto __6
 168106 	goto __8
 168107 __8:
 168108 	;
 168109 	goto __5
 168110 __4:
 168111 	ii = 0
 168112 __10:
 168113 	if !(ii < nn) {
 168114 		goto __12
 168115 	}
 168116 	*(*int32)(unsafe.Pointer(bp + 8 + uintptr(ii)*4)) = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr(ii+3)*8)))
 168117 	*(*int32)(unsafe.Pointer(bp + 8 + uintptr(ii+1)*4)) = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr(ii+4)*8)))
 168118 	if !(*(*int32)(unsafe.Pointer(bp + 8 + uintptr(ii)*4)) > *(*int32)(unsafe.Pointer(bp + 8 + uintptr(ii+1)*4))) {
 168119 		goto __13
 168120 	}
 168121 	rc = rtreeConstraintError(tls, pRtree, ii+1)
 168122 	goto constraint
 168123 __13:
 168124 	;
 168125 	goto __11
 168126 __11:
 168127 	ii = ii + 2
 168128 	goto __10
 168129 	goto __12
 168130 __12:
 168131 	;
 168132 __5:
 168133 	;
 168134 	if !(Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(aData + 2*8))) != SQLITE_NULL) {
 168135 		goto __14
 168136 	}
 168137 	(*RtreeCell)(unsafe.Pointer(bp)).FiRowid = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(aData + 2*8)))
 168138 	if !(Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(aData))) == SQLITE_NULL ||
 168139 		Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(aData))) != (*RtreeCell)(unsafe.Pointer(bp)).FiRowid) {
 168140 		goto __15
 168141 	}
 168142 	Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid, 1, (*RtreeCell)(unsafe.Pointer(bp)).FiRowid)
 168143 	steprc = Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid)
 168144 	rc = Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid)
 168145 	if !(SQLITE_ROW == steprc) {
 168146 		goto __16
 168147 	}
 168148 	if !(Xsqlite3_vtab_on_conflict(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb) == SQLITE_REPLACE) {
 168149 		goto __17
 168150 	}
 168151 	rc = rtreeDeleteRowid(tls, pRtree, (*RtreeCell)(unsafe.Pointer(bp)).FiRowid)
 168152 	goto __18
 168153 __17:
 168154 	rc = rtreeConstraintError(tls, pRtree, 0)
 168155 	goto constraint
 168156 __18:
 168157 	;
 168158 __16:
 168159 	;
 168160 __15:
 168161 	;
 168162 	bHaveRowid = 1
 168163 __14:
 168164 	;
 168165 __2:
 168166 	;
 168167 	if !(Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(aData))) != SQLITE_NULL) {
 168168 		goto __19
 168169 	}
 168170 	rc = rtreeDeleteRowid(tls, pRtree, Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(aData))))
 168171 __19:
 168172 	;
 168173 	if !(rc == SQLITE_OK && nData > 1) {
 168174 		goto __20
 168175 	}
 168176 
 168177 	*(*uintptr)(unsafe.Pointer(bp + 48)) = uintptr(0)
 168178 
 168179 	if !(bHaveRowid == 0) {
 168180 		goto __21
 168181 	}
 168182 	rc = rtreeNewRowid(tls, pRtree, bp)
 168183 __21:
 168184 	;
 168185 	*(*Sqlite_int64)(unsafe.Pointer(pRowid)) = (*RtreeCell)(unsafe.Pointer(bp)).FiRowid
 168186 
 168187 	if !(rc == SQLITE_OK) {
 168188 		goto __22
 168189 	}
 168190 	rc = sChooseLeaf(tls, pRtree, bp, 0, bp+48)
 168191 __22:
 168192 	;
 168193 	if !(rc == SQLITE_OK) {
 168194 		goto __23
 168195 	}
 168196 	(*Rtree)(unsafe.Pointer(pRtree)).FiReinsertHeight = -1
 168197 	rc = rtreeInsertCell(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 48)), bp, 0)
 168198 	rc2 = nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 48)))
 168199 	if !(rc == SQLITE_OK) {
 168200 		goto __24
 168201 	}
 168202 	rc = rc2
 168203 __24:
 168204 	;
 168205 __23:
 168206 	;
 168207 	if !(rc == SQLITE_OK && (*Rtree)(unsafe.Pointer(pRtree)).FnAux != 0) {
 168208 		goto __25
 168209 	}
 168210 	pUp = (*Rtree)(unsafe.Pointer(pRtree)).FpWriteAux
 168211 	Xsqlite3_bind_int64(tls, pUp, 1, *(*Sqlite_int64)(unsafe.Pointer(pRowid)))
 168212 	jj = 0
 168213 __26:
 168214 	if !(jj < int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux)) {
 168215 		goto __28
 168216 	}
 168217 	Xsqlite3_bind_value(tls, pUp, jj+2, *(*uintptr)(unsafe.Pointer(aData + uintptr(int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)+3+jj)*8)))
 168218 	goto __27
 168219 __27:
 168220 	jj++
 168221 	goto __26
 168222 	goto __28
 168223 __28:
 168224 	;
 168225 	Xsqlite3_step(tls, pUp)
 168226 	rc = Xsqlite3_reset(tls, pUp)
 168227 __25:
 168228 	;
 168229 __20:
 168230 	;
 168231 constraint:
 168232 	rtreeRelease(tls, pRtree)
 168233 	return rc
 168234 }
 168235 
 168236 func rtreeBeginTransaction(tls *libc.TLS, pVtab uintptr) int32 {
 168237 	var pRtree uintptr = pVtab
 168238 
 168239 	(*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans++
 168240 	return SQLITE_OK
 168241 }
 168242 
 168243 func rtreeEndTransaction(tls *libc.TLS, pVtab uintptr) int32 {
 168244 	var pRtree uintptr = pVtab
 168245 	(*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans = U8(0)
 168246 	nodeBlobReset(tls, pRtree)
 168247 	return SQLITE_OK
 168248 }
 168249 
 168250 func rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) int32 {
 168251 	bp := tls.Alloc(72)
 168252 	defer tls.Free(72)
 168253 
 168254 	var pRtree uintptr = pVtab
 168255 	var rc int32 = SQLITE_NOMEM
 168256 	var zSql uintptr = Xsqlite3_mprintf(tls,
 168257 		ts+26669, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName))
 168258 	if zSql != 0 {
 168259 		nodeBlobReset(tls, pRtree)
 168260 		rc = Xsqlite3_exec(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0))
 168261 		Xsqlite3_free(tls, zSql)
 168262 	}
 168263 	return rc
 168264 }
 168265 
 168266 func rtreeSavepoint(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 {
 168267 	var pRtree uintptr = pVtab
 168268 	var iwt U8 = (*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans
 168269 	_ = iSavepoint
 168270 	(*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans = U8(0)
 168271 	nodeBlobReset(tls, pRtree)
 168272 	(*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans = iwt
 168273 	return SQLITE_OK
 168274 }
 168275 
 168276 func rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) int32 {
 168277 	bp := tls.Alloc(24)
 168278 	defer tls.Free(24)
 168279 
 168280 	var zFmt uintptr = ts + 26814
 168281 	var zSql uintptr
 168282 
 168283 	var rc int32
 168284 	var nRow I64 = int64(RTREE_MIN_ROWEST)
 168285 
 168286 	rc = Xsqlite3_table_column_metadata(tls,
 168287 		db, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, ts+12700, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0))
 168288 	if rc != SQLITE_OK {
 168289 		(*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST)
 168290 		if rc == SQLITE_ERROR {
 168291 			return SQLITE_OK
 168292 		}
 168293 		return rc
 168294 	}
 168295 	zSql = Xsqlite3_mprintf(tls, zFmt, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName))
 168296 	if zSql == uintptr(0) {
 168297 		rc = SQLITE_NOMEM
 168298 	} else {
 168299 		rc = Xsqlite3_prepare_v2(tls, db, zSql, -1, bp+16, uintptr(0))
 168300 		if rc == SQLITE_OK {
 168301 			if Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) == SQLITE_ROW {
 168302 				nRow = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), 0)
 168303 			}
 168304 			rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
 168305 		}
 168306 		Xsqlite3_free(tls, zSql)
 168307 	}
 168308 	(*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = func() int64 {
 168309 		if nRow > int64(RTREE_MIN_ROWEST) {
 168310 			return nRow
 168311 		}
 168312 		return int64(RTREE_MIN_ROWEST)
 168313 	}()
 168314 	return rc
 168315 }
 168316 
 168317 func rtreeShadowName(tls *libc.TLS, zName uintptr) int32 {
 168318 	var i uint32
 168319 	for i = uint32(0); uint64(i) < uint64(unsafe.Sizeof(azName1))/uint64(unsafe.Sizeof(uintptr(0))); i++ {
 168320 		if Xsqlite3_stricmp(tls, zName, azName1[i]) == 0 {
 168321 			return 1
 168322 		}
 168323 	}
 168324 	return 0
 168325 }
 168326 
 168327 var azName1 = [3]uintptr{
 168328 	ts + 26870, ts + 6412, ts + 17625,
 168329 }
 168330 
 168331 var rtreeModule = Sqlite3_module{
 168332 	FiVersion:    3,
 168333 	FxCreate:     0,
 168334 	FxConnect:    0,
 168335 	FxBestIndex:  0,
 168336 	FxDisconnect: 0,
 168337 	FxDestroy:    0,
 168338 	FxOpen:       0,
 168339 	FxClose:      0,
 168340 	FxFilter:     0,
 168341 	FxNext:       0,
 168342 	FxEof:        0,
 168343 	FxColumn:     0,
 168344 	FxRowid:      0,
 168345 	FxUpdate:     0,
 168346 	FxBegin:      0,
 168347 	FxSync:       0,
 168348 	FxCommit:     0,
 168349 	FxRollback:   0,
 168350 	FxRename:     0,
 168351 	FxSavepoint:  0,
 168352 	FxShadowName: 0,
 168353 }
 168354 
 168355 func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefix uintptr, isCreate int32) int32 {
 168356 	bp := tls.Alloc(232)
 168357 	defer tls.Free(232)
 168358 
 168359 	var rc int32 = SQLITE_OK
 168360 
 168361 	var i int32
 168362 	var f int32 = SQLITE_PREPARE_PERSISTENT | SQLITE_PREPARE_NO_VTAB
 168363 
 168364 	(*Rtree)(unsafe.Pointer(pRtree)).Fdb = db
 168365 
 168366 	if isCreate != 0 {
 168367 		var zCreate uintptr
 168368 		var p uintptr = Xsqlite3_str_new(tls, db)
 168369 		var ii int32
 168370 		Xsqlite3_str_appendf(tls, p,
 168371 			ts+26875,
 168372 			libc.VaList(bp, zDb, zPrefix))
 168373 		for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux); ii++ {
 168374 			Xsqlite3_str_appendf(tls, p, ts+26937, libc.VaList(bp+16, ii))
 168375 		}
 168376 		Xsqlite3_str_appendf(tls, p,
 168377 			ts+26942,
 168378 			libc.VaList(bp+24, zDb, zPrefix))
 168379 		Xsqlite3_str_appendf(tls, p,
 168380 			ts+27006,
 168381 			libc.VaList(bp+40, zDb, zPrefix))
 168382 		Xsqlite3_str_appendf(tls, p,
 168383 			ts+27076,
 168384 			libc.VaList(bp+56, zDb, zPrefix, (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize))
 168385 		zCreate = Xsqlite3_str_finish(tls, p)
 168386 		if !(zCreate != 0) {
 168387 			return SQLITE_NOMEM
 168388 		}
 168389 		rc = Xsqlite3_exec(tls, db, zCreate, uintptr(0), uintptr(0), uintptr(0))
 168390 		Xsqlite3_free(tls, zCreate)
 168391 		if rc != SQLITE_OK {
 168392 			return rc
 168393 		}
 168394 	}
 168395 
 168396 	*(*uintptr)(unsafe.Pointer(bp + 168)) = pRtree + 120
 168397 	*(*uintptr)(unsafe.Pointer(bp + 168 + 1*8)) = pRtree + 128
 168398 	*(*uintptr)(unsafe.Pointer(bp + 168 + 2*8)) = pRtree + 136
 168399 	*(*uintptr)(unsafe.Pointer(bp + 168 + 3*8)) = pRtree + 144
 168400 	*(*uintptr)(unsafe.Pointer(bp + 168 + 4*8)) = pRtree + 152
 168401 	*(*uintptr)(unsafe.Pointer(bp + 168 + 5*8)) = pRtree + 160
 168402 	*(*uintptr)(unsafe.Pointer(bp + 168 + 6*8)) = pRtree + 168
 168403 	*(*uintptr)(unsafe.Pointer(bp + 168 + 7*8)) = pRtree + 176
 168404 
 168405 	rc = rtreeQueryStat1(tls, db, pRtree)
 168406 	for i = 0; i < N_STATEMENT && rc == SQLITE_OK; i++ {
 168407 		var zSql uintptr
 168408 		var zFormat uintptr
 168409 		if i != 3 || int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux) == 0 {
 168410 			zFormat = azSql[i]
 168411 		} else {
 168412 			zFormat = ts + 27125
 168413 		}
 168414 		zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+80, zDb, zPrefix))
 168415 		if zSql != 0 {
 168416 			rc = Xsqlite3_prepare_v3(tls, db, zSql, -1, uint32(f), *(*uintptr)(unsafe.Pointer(bp + 168 + uintptr(i)*8)), uintptr(0))
 168417 		} else {
 168418 			rc = SQLITE_NOMEM
 168419 		}
 168420 		Xsqlite3_free(tls, zSql)
 168421 	}
 168422 	if (*Rtree)(unsafe.Pointer(pRtree)).FnAux != 0 {
 168423 		(*Rtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls,
 168424 			ts+27233,
 168425 			libc.VaList(bp+96, zDb, zPrefix))
 168426 		if (*Rtree)(unsafe.Pointer(pRtree)).FzReadAuxSql == uintptr(0) {
 168427 			rc = SQLITE_NOMEM
 168428 		} else {
 168429 			var p uintptr = Xsqlite3_str_new(tls, db)
 168430 			var ii int32
 168431 			var zSql uintptr
 168432 			Xsqlite3_str_appendf(tls, p, ts+27278, libc.VaList(bp+112, zDb, zPrefix))
 168433 			for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux); ii++ {
 168434 				if ii != 0 {
 168435 					Xsqlite3_str_append(tls, p, ts+14119, 1)
 168436 				}
 168437 				if ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) {
 168438 					Xsqlite3_str_appendf(tls, p, ts+27305, libc.VaList(bp+128, ii, ii+2, ii))
 168439 				} else {
 168440 					Xsqlite3_str_appendf(tls, p, ts+27327, libc.VaList(bp+152, ii, ii+2))
 168441 				}
 168442 			}
 168443 			Xsqlite3_str_appendf(tls, p, ts+27335, 0)
 168444 			zSql = Xsqlite3_str_finish(tls, p)
 168445 			if zSql == uintptr(0) {
 168446 				rc = SQLITE_NOMEM
 168447 			} else {
 168448 				rc = Xsqlite3_prepare_v3(tls, db, zSql, -1, uint32(f), pRtree+184, uintptr(0))
 168449 				Xsqlite3_free(tls, zSql)
 168450 			}
 168451 		}
 168452 	}
 168453 
 168454 	return rc
 168455 }
 168456 
 168457 var azSql = [8]uintptr{
 168458 	ts + 27351,
 168459 	ts + 27404,
 168460 	ts + 27449,
 168461 	ts + 27501,
 168462 	ts + 27555,
 168463 	ts + 27600,
 168464 	ts + 27658,
 168465 	ts + 27713,
 168466 }
 168467 
 168468 func getIntFromStmt(tls *libc.TLS, db uintptr, zSql uintptr, piVal uintptr) int32 {
 168469 	bp := tls.Alloc(8)
 168470 	defer tls.Free(8)
 168471 
 168472 	var rc int32 = SQLITE_NOMEM
 168473 	if zSql != 0 {
 168474 		*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 168475 		rc = Xsqlite3_prepare_v2(tls, db, zSql, -1, bp, uintptr(0))
 168476 		if rc == SQLITE_OK {
 168477 			if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) {
 168478 				*(*int32)(unsafe.Pointer(piVal)) = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0)
 168479 			}
 168480 			rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp)))
 168481 		}
 168482 	}
 168483 	return rc
 168484 }
 168485 
 168486 func getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzErr uintptr) int32 {
 168487 	bp := tls.Alloc(52)
 168488 	defer tls.Free(52)
 168489 
 168490 	var rc int32
 168491 	var zSql uintptr
 168492 	if isCreate != 0 {
 168493 		*(*int32)(unsafe.Pointer(bp + 48)) = 0
 168494 		zSql = Xsqlite3_mprintf(tls, ts+27760, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb))
 168495 		rc = getIntFromStmt(tls, db, zSql, bp+48)
 168496 		if rc == SQLITE_OK {
 168497 			(*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize = *(*int32)(unsafe.Pointer(bp + 48)) - 64
 168498 			if 4+int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*RTREE_MAXCELLS < (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize {
 168499 				(*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize = 4 + int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*RTREE_MAXCELLS
 168500 			}
 168501 		} else {
 168502 			*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db)))
 168503 		}
 168504 	} else {
 168505 		zSql = Xsqlite3_mprintf(tls,
 168506 			ts+27780,
 168507 			libc.VaList(bp+16, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName))
 168508 		rc = getIntFromStmt(tls, db, zSql, pRtree+32)
 168509 		if rc != SQLITE_OK {
 168510 			*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp+32, Xsqlite3_errmsg(tls, db)))
 168511 		} else if (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize < 512-64 {
 168512 			rc = SQLITE_CORRUPT | int32(1)<<8
 168513 
 168514 			*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+27837,
 168515 				libc.VaList(bp+40, (*Rtree)(unsafe.Pointer(pRtree)).FzName))
 168516 		}
 168517 	}
 168518 
 168519 	Xsqlite3_free(tls, zSql)
 168520 	return rc
 168521 }
 168522 
 168523 func rtreeTokenLength(tls *libc.TLS, z uintptr) int32 {
 168524 	bp := tls.Alloc(4)
 168525 	defer tls.Free(4)
 168526 
 168527 	*(*int32)(unsafe.Pointer(bp)) = 0
 168528 	return Xsqlite3GetToken(tls, z, bp)
 168529 }
 168530 
 168531 func rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr, isCreate int32) int32 {
 168532 	bp := tls.Alloc(136)
 168533 	defer tls.Free(136)
 168534 
 168535 	var rc int32
 168536 	var pRtree uintptr
 168537 	var nDb int32
 168538 	var nName int32
 168539 	var eCoordType int32
 168540 	var pSql uintptr
 168541 	var zSql uintptr
 168542 	var ii int32
 168543 	var iErr int32
 168544 
 168545 	var zArg uintptr
 168546 	rc = SQLITE_OK
 168547 	eCoordType = func() int32 {
 168548 		if pAux != 0 {
 168549 			return RTREE_COORD_INT32
 168550 		}
 168551 		return RTREE_COORD_REAL32
 168552 	}()
 168553 	ii = 4
 168554 	*(*[5]uintptr)(unsafe.Pointer(bp + 96)) = [5]uintptr{
 168555 		uintptr(0),
 168556 		ts + 27872,
 168557 		ts + 27915,
 168558 		ts + 27950,
 168559 		ts + 27986,
 168560 	}
 168561 
 168562 	if !(argc < 6 || argc > RTREE_MAX_AUX_COLUMN+3) {
 168563 		goto __1
 168564 	}
 168565 	*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 96 + uintptr(2+libc.Bool32(argc >= 6))*8))))
 168566 	return SQLITE_ERROR
 168567 __1:
 168568 	;
 168569 	Xsqlite3_vtab_config(tls, db, SQLITE_VTAB_CONSTRAINT_SUPPORT, libc.VaList(bp+8, 1))
 168570 
 168571 	nDb = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))
 168572 	nName = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8))))
 168573 	pRtree = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(Rtree{}))+uint64(nDb)+uint64(nName)+uint64(2))
 168574 	if !!(pRtree != 0) {
 168575 		goto __2
 168576 	}
 168577 	return SQLITE_NOMEM
 168578 __2:
 168579 	;
 168580 	libc.Xmemset(tls, pRtree, 0, uint64(unsafe.Sizeof(Rtree{}))+uint64(nDb)+uint64(nName)+uint64(2))
 168581 	(*Rtree)(unsafe.Pointer(pRtree)).FnBusy = U32(1)
 168582 	(*Rtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&rtreeModule))
 168583 	(*Rtree)(unsafe.Pointer(pRtree)).FzDb = pRtree + 1*968
 168584 	(*Rtree)(unsafe.Pointer(pRtree)).FzName = (*Rtree)(unsafe.Pointer(pRtree)).FzDb + uintptr(nDb+1)
 168585 	(*Rtree)(unsafe.Pointer(pRtree)).FeCoordType = U8(eCoordType)
 168586 	libc.Xmemcpy(tls, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(nDb))
 168587 	libc.Xmemcpy(tls, (*Rtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), uint64(nName))
 168588 
 168589 	pSql = Xsqlite3_str_new(tls, db)
 168590 	Xsqlite3_str_appendf(tls, pSql, ts+28023,
 168591 		libc.VaList(bp+16, rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8))))
 168592 	ii = 4
 168593 __3:
 168594 	if !(ii < argc) {
 168595 		goto __5
 168596 	}
 168597 	zArg = *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8))
 168598 	if !(int32(*(*int8)(unsafe.Pointer(zArg))) == '+') {
 168599 		goto __6
 168600 	}
 168601 	(*Rtree)(unsafe.Pointer(pRtree)).FnAux++
 168602 	Xsqlite3_str_appendf(tls, pSql, ts+28047, libc.VaList(bp+32, rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1)))
 168603 	goto __7
 168604 __6:
 168605 	if !(int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux) > 0) {
 168606 		goto __8
 168607 	}
 168608 	goto __5
 168609 	goto __9
 168610 __8:
 168611 	(*Rtree)(unsafe.Pointer(pRtree)).FnDim2++
 168612 	Xsqlite3_str_appendf(tls, pSql, azFormat[eCoordType],
 168613 		libc.VaList(bp+48, rtreeTokenLength(tls, zArg), zArg))
 168614 __9:
 168615 	;
 168616 __7:
 168617 	;
 168618 	goto __4
 168619 __4:
 168620 	ii++
 168621 	goto __3
 168622 	goto __5
 168623 __5:
 168624 	;
 168625 	Xsqlite3_str_appendf(tls, pSql, ts+28053, 0)
 168626 	zSql = Xsqlite3_str_finish(tls, pSql)
 168627 	if !!(zSql != 0) {
 168628 		goto __10
 168629 	}
 168630 	rc = SQLITE_NOMEM
 168631 	goto __11
 168632 __10:
 168633 	if !(ii < argc) {
 168634 		goto __12
 168635 	}
 168636 	*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(bp + 96 + 4*8))))
 168637 	rc = SQLITE_ERROR
 168638 	goto __13
 168639 __12:
 168640 	if !(SQLITE_OK != libc.AssignInt32(&rc, Xsqlite3_declare_vtab(tls, db, zSql))) {
 168641 		goto __14
 168642 	}
 168643 	*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp+72, Xsqlite3_errmsg(tls, db)))
 168644 __14:
 168645 	;
 168646 __13:
 168647 	;
 168648 __11:
 168649 	;
 168650 	Xsqlite3_free(tls, zSql)
 168651 	if !(rc != 0) {
 168652 		goto __15
 168653 	}
 168654 	goto rtreeInit_fail
 168655 __15:
 168656 	;
 168657 	(*Rtree)(unsafe.Pointer(pRtree)).FnDim = U8(int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) / 2)
 168658 	if !(int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim) < 1) {
 168659 		goto __16
 168660 	}
 168661 	iErr = 2
 168662 	goto __17
 168663 __16:
 168664 	if !(int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) > RTREE_MAX_DIMENSIONS*2) {
 168665 		goto __18
 168666 	}
 168667 	iErr = 3
 168668 	goto __19
 168669 __18:
 168670 	if !(int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)%2 != 0) {
 168671 		goto __20
 168672 	}
 168673 	iErr = 1
 168674 	goto __21
 168675 __20:
 168676 	iErr = 0
 168677 __21:
 168678 	;
 168679 __19:
 168680 	;
 168681 __17:
 168682 	;
 168683 	if !(iErr != 0) {
 168684 		goto __22
 168685 	}
 168686 	*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp+80, *(*uintptr)(unsafe.Pointer(bp + 96 + uintptr(iErr)*8))))
 168687 	goto rtreeInit_fail
 168688 __22:
 168689 	;
 168690 	(*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = U8(8 + int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)*4)
 168691 
 168692 	rc = getNodeSize(tls, db, pRtree, isCreate, pzErr)
 168693 	if !(rc != 0) {
 168694 		goto __23
 168695 	}
 168696 	goto rtreeInit_fail
 168697 __23:
 168698 	;
 168699 	rc = rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate)
 168700 	if !(rc != 0) {
 168701 		goto __24
 168702 	}
 168703 	*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp+88, Xsqlite3_errmsg(tls, db)))
 168704 	goto rtreeInit_fail
 168705 __24:
 168706 	;
 168707 	*(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree
 168708 	return SQLITE_OK
 168709 
 168710 rtreeInit_fail:
 168711 	if !(rc == SQLITE_OK) {
 168712 		goto __25
 168713 	}
 168714 	rc = SQLITE_ERROR
 168715 __25:
 168716 	;
 168717 	rtreeRelease(tls, pRtree)
 168718 	return rc
 168719 }
 168720 
 168721 var azFormat = [2]uintptr{ts + 28056, ts + 28067}
 168722 
 168723 func rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) {
 168724 	bp := tls.Alloc(1072)
 168725 	defer tls.Free(1072)
 168726 
 168727 	var ii int32
 168728 	var nData int32
 168729 	var errCode int32
 168730 	var pOut uintptr
 168731 
 168732 	_ = nArg
 168733 	libc.Xmemset(tls, bp+16, 0, uint64(unsafe.Sizeof(RtreeNode{})))
 168734 	libc.Xmemset(tls, bp+56, 0, uint64(unsafe.Sizeof(Rtree{})))
 168735 	(*Rtree)(unsafe.Pointer(bp + 56)).FnDim = U8(Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apArg))))
 168736 	if int32((*Rtree)(unsafe.Pointer(bp+56)).FnDim) < 1 || int32((*Rtree)(unsafe.Pointer(bp+56)).FnDim) > 5 {
 168737 		return
 168738 	}
 168739 	(*Rtree)(unsafe.Pointer(bp + 56)).FnDim2 = U8(int32((*Rtree)(unsafe.Pointer(bp+56)).FnDim) * 2)
 168740 	(*Rtree)(unsafe.Pointer(bp + 56)).FnBytesPerCell = U8(8 + 8*int32((*Rtree)(unsafe.Pointer(bp+56)).FnDim))
 168741 	(*RtreeNode)(unsafe.Pointer(bp + 16)).FzData = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8)))
 168742 	if (*RtreeNode)(unsafe.Pointer(bp+16)).FzData == uintptr(0) {
 168743 		return
 168744 	}
 168745 	nData = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8)))
 168746 	if nData < 4 {
 168747 		return
 168748 	}
 168749 	if nData < readInt16(tls, (*RtreeNode)(unsafe.Pointer(bp+16)).FzData+2)*int32((*Rtree)(unsafe.Pointer(bp+56)).FnBytesPerCell) {
 168750 		return
 168751 	}
 168752 
 168753 	pOut = Xsqlite3_str_new(tls, uintptr(0))
 168754 	for ii = 0; ii < readInt16(tls, (*RtreeNode)(unsafe.Pointer(bp+16)).FzData+2); ii++ {
 168755 		var jj int32
 168756 
 168757 		nodeGetCell(tls, bp+56, bp+16, ii, bp+1024)
 168758 		if ii > 0 {
 168759 			Xsqlite3_str_append(tls, pOut, ts+12272, 1)
 168760 		}
 168761 		Xsqlite3_str_appendf(tls, pOut, ts+28077, libc.VaList(bp, (*RtreeCell)(unsafe.Pointer(bp+1024)).FiRowid))
 168762 		for jj = 0; jj < int32((*Rtree)(unsafe.Pointer(bp+56)).FnDim2); jj++ {
 168763 			Xsqlite3_str_appendf(tls, pOut, ts+28083, libc.VaList(bp+8, float64(*(*RtreeValue)(unsafe.Pointer(bp + 1024 + 8 + uintptr(jj)*4)))))
 168764 		}
 168765 		Xsqlite3_str_append(tls, pOut, ts+28087, 1)
 168766 	}
 168767 	errCode = Xsqlite3_str_errcode(tls, pOut)
 168768 	Xsqlite3_result_text(tls, ctx, Xsqlite3_str_finish(tls, pOut), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
 168769 	Xsqlite3_result_error_code(tls, ctx, errCode)
 168770 }
 168771 
 168772 func rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) {
 168773 	_ = nArg
 168774 	if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg))) != SQLITE_BLOB ||
 168775 		Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg))) < 2 {
 168776 		Xsqlite3_result_error(tls, ctx, ts+28089, -1)
 168777 	} else {
 168778 		var zBlob uintptr = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg)))
 168779 		if zBlob != 0 {
 168780 			Xsqlite3_result_int(tls, ctx, readInt16(tls, zBlob))
 168781 		} else {
 168782 			Xsqlite3_result_error_nomem(tls, ctx)
 168783 		}
 168784 	}
 168785 }
 168786 
 168787 // Context object passed between the various routines that make up the
 168788 // implementation of integrity-check function rtreecheck().
 168789 type RtreeCheck1 = struct {
 168790 	Fdb            uintptr
 168791 	FzDb           uintptr
 168792 	FzTab          uintptr
 168793 	FbInt          int32
 168794 	FnDim          int32
 168795 	FpGetNode      uintptr
 168796 	FaCheckMapping [2]uintptr
 168797 	FnLeaf         int32
 168798 	FnNonLeaf      int32
 168799 	Frc            int32
 168800 	F__ccgo_pad1   [4]byte
 168801 	FzReport       uintptr
 168802 	FnErr          int32
 168803 	F__ccgo_pad2   [4]byte
 168804 }
 168805 
 168806 // Context object passed between the various routines that make up the
 168807 // implementation of integrity-check function rtreecheck().
 168808 type RtreeCheck = RtreeCheck1
 168809 
 168810 func rtreeCheckReset(tls *libc.TLS, pCheck uintptr, pStmt uintptr) {
 168811 	var rc int32 = Xsqlite3_reset(tls, pStmt)
 168812 	if (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK {
 168813 		(*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = rc
 168814 	}
 168815 }
 168816 
 168817 func rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) uintptr {
 168818 	bp := tls.Alloc(8)
 168819 	defer tls.Free(8)
 168820 
 168821 	var ap Va_list
 168822 	_ = ap
 168823 	var z uintptr
 168824 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 168825 
 168826 	ap = va
 168827 	z = Xsqlite3_vmprintf(tls, zFmt, ap)
 168828 
 168829 	if (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK {
 168830 		if z == uintptr(0) {
 168831 			(*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = SQLITE_NOMEM
 168832 		} else {
 168833 			(*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_prepare_v2(tls, (*RtreeCheck)(unsafe.Pointer(pCheck)).Fdb, z, -1, bp, uintptr(0))
 168834 		}
 168835 	}
 168836 
 168837 	Xsqlite3_free(tls, z)
 168838 	_ = ap
 168839 	return *(*uintptr)(unsafe.Pointer(bp))
 168840 }
 168841 
 168842 func rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) {
 168843 	bp := tls.Alloc(24)
 168844 	defer tls.Free(24)
 168845 
 168846 	var ap Va_list
 168847 	_ = ap
 168848 	ap = va
 168849 	if (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && (*RtreeCheck)(unsafe.Pointer(pCheck)).FnErr < RTREE_CHECK_MAX_ERROR {
 168850 		var z uintptr = Xsqlite3_vmprintf(tls, zFmt, ap)
 168851 		if z == uintptr(0) {
 168852 			(*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = SQLITE_NOMEM
 168853 		} else {
 168854 			(*RtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, ts+28122,
 168855 				libc.VaList(bp, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzReport, func() uintptr {
 168856 					if (*RtreeCheck)(unsafe.Pointer(pCheck)).FzReport != 0 {
 168857 						return ts + 5414
 168858 					}
 168859 					return ts + 1544
 168860 				}(), z))
 168861 			if (*RtreeCheck)(unsafe.Pointer(pCheck)).FzReport == uintptr(0) {
 168862 				(*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = SQLITE_NOMEM
 168863 			}
 168864 		}
 168865 		(*RtreeCheck)(unsafe.Pointer(pCheck)).FnErr++
 168866 	}
 168867 	_ = ap
 168868 }
 168869 
 168870 func rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode I64, pnNode uintptr) uintptr {
 168871 	bp := tls.Alloc(24)
 168872 	defer tls.Free(24)
 168873 
 168874 	var pRet uintptr = uintptr(0)
 168875 
 168876 	if (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && (*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode == uintptr(0) {
 168877 		(*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = rtreeCheckPrepare(tls, pCheck,
 168878 			ts+28129,
 168879 			libc.VaList(bp, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzTab))
 168880 	}
 168881 
 168882 	if (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK {
 168883 		Xsqlite3_bind_int64(tls, (*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, 1, iNode)
 168884 		if Xsqlite3_step(tls, (*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode) == SQLITE_ROW {
 168885 			var nNode int32 = Xsqlite3_column_bytes(tls, (*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, 0)
 168886 			var pNode uintptr = Xsqlite3_column_blob(tls, (*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, 0)
 168887 			pRet = Xsqlite3_malloc64(tls, uint64(nNode))
 168888 			if pRet == uintptr(0) {
 168889 				(*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = SQLITE_NOMEM
 168890 			} else {
 168891 				libc.Xmemcpy(tls, pRet, pNode, uint64(nNode))
 168892 				*(*int32)(unsafe.Pointer(pnNode)) = nNode
 168893 			}
 168894 		}
 168895 		rtreeCheckReset(tls, pCheck, (*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode)
 168896 		if (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && pRet == uintptr(0) {
 168897 			rtreeCheckAppendMsg(tls, pCheck, ts+28174, libc.VaList(bp+16, iNode))
 168898 		}
 168899 	}
 168900 
 168901 	return pRet
 168902 }
 168903 
 168904 func rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey I64, iVal I64) {
 168905 	bp := tls.Alloc(96)
 168906 	defer tls.Free(96)
 168907 
 168908 	var rc int32
 168909 	var pStmt uintptr
 168910 	*(*[2]uintptr)(unsafe.Pointer(bp + 80)) = [2]uintptr{
 168911 		ts + 28206,
 168912 		ts + 28260,
 168913 	}
 168914 
 168915 	if *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) == uintptr(0) {
 168916 		*(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) = rtreeCheckPrepare(tls, pCheck,
 168917 			*(*uintptr)(unsafe.Pointer(bp + 80 + uintptr(bLeaf)*8)), libc.VaList(bp, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzTab))
 168918 	}
 168919 	if (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc != SQLITE_OK {
 168920 		return
 168921 	}
 168922 
 168923 	pStmt = *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8))
 168924 	Xsqlite3_bind_int64(tls, pStmt, 1, iKey)
 168925 	rc = Xsqlite3_step(tls, pStmt)
 168926 	if rc == SQLITE_DONE {
 168927 		rtreeCheckAppendMsg(tls, pCheck, ts+28308,
 168928 			libc.VaList(bp+16, iKey, iVal, func() uintptr {
 168929 				if bLeaf != 0 {
 168930 					return ts + 28353
 168931 				}
 168932 				return ts + 28361
 168933 			}()))
 168934 	} else if rc == SQLITE_ROW {
 168935 		var ii I64 = Xsqlite3_column_int64(tls, pStmt, 0)
 168936 		if ii != iVal {
 168937 			rtreeCheckAppendMsg(tls, pCheck,
 168938 				ts+28370,
 168939 				libc.VaList(bp+40, iKey, ii, func() uintptr {
 168940 					if bLeaf != 0 {
 168941 						return ts + 28353
 168942 					}
 168943 					return ts + 28361
 168944 				}(), iKey, iVal))
 168945 		}
 168946 	}
 168947 	rtreeCheckReset(tls, pCheck, pStmt)
 168948 }
 168949 
 168950 func rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode I64, iCell int32, pCell uintptr, pParent uintptr) {
 168951 	bp := tls.Alloc(64)
 168952 	defer tls.Free(64)
 168953 
 168954 	var i int32
 168955 
 168956 	for i = 0; i < (*RtreeCheck)(unsafe.Pointer(pCheck)).FnDim; i++ {
 168957 		readCoord(tls, pCell+uintptr(4*2*i), bp+48)
 168958 		readCoord(tls, pCell+uintptr(4*(2*i+1)), bp+52)
 168959 
 168960 		if func() int32 {
 168961 			if (*RtreeCheck)(unsafe.Pointer(pCheck)).FbInt != 0 {
 168962 				return libc.Bool32(*(*int32)(unsafe.Pointer(bp + 48)) > *(*int32)(unsafe.Pointer(bp + 52)))
 168963 			}
 168964 			return libc.Bool32(*(*RtreeValue)(unsafe.Pointer(bp + 48)) > *(*RtreeValue)(unsafe.Pointer(bp + 52)))
 168965 		}() != 0 {
 168966 			rtreeCheckAppendMsg(tls, pCheck,
 168967 				ts+28428, libc.VaList(bp, i, iCell, iNode))
 168968 		}
 168969 
 168970 		if pParent != 0 {
 168971 			readCoord(tls, pParent+uintptr(4*2*i), bp+56)
 168972 			readCoord(tls, pParent+uintptr(4*(2*i+1)), bp+60)
 168973 
 168974 			if func() int32 {
 168975 				if (*RtreeCheck)(unsafe.Pointer(pCheck)).FbInt != 0 {
 168976 					return libc.Bool32(*(*int32)(unsafe.Pointer(bp + 48)) < *(*int32)(unsafe.Pointer(bp + 56)))
 168977 				}
 168978 				return libc.Bool32(*(*RtreeValue)(unsafe.Pointer(bp + 48)) < *(*RtreeValue)(unsafe.Pointer(bp + 56)))
 168979 			}() != 0 ||
 168980 				func() int32 {
 168981 					if (*RtreeCheck)(unsafe.Pointer(pCheck)).FbInt != 0 {
 168982 						return libc.Bool32(*(*int32)(unsafe.Pointer(bp + 52)) > *(*int32)(unsafe.Pointer(bp + 60)))
 168983 					}
 168984 					return libc.Bool32(*(*RtreeValue)(unsafe.Pointer(bp + 52)) > *(*RtreeValue)(unsafe.Pointer(bp + 60)))
 168985 				}() != 0 {
 168986 				rtreeCheckAppendMsg(tls, pCheck,
 168987 					ts+28476, libc.VaList(bp+24, i, iCell, iNode))
 168988 			}
 168989 		}
 168990 	}
 168991 }
 168992 
 168993 func rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintptr, iNode I64) {
 168994 	bp := tls.Alloc(52)
 168995 	defer tls.Free(52)
 168996 
 168997 	var aNode uintptr = uintptr(0)
 168998 	*(*int32)(unsafe.Pointer(bp + 48)) = 0
 168999 
 169000 	aNode = rtreeCheckGetNode(tls, pCheck, iNode, bp+48)
 169001 	if aNode != 0 {
 169002 		if *(*int32)(unsafe.Pointer(bp + 48)) < 4 {
 169003 			rtreeCheckAppendMsg(tls, pCheck,
 169004 				ts+28543, libc.VaList(bp, iNode, *(*int32)(unsafe.Pointer(bp + 48))))
 169005 		} else {
 169006 			var nCell int32
 169007 			var i int32
 169008 			if aParent == uintptr(0) {
 169009 				iDepth = readInt16(tls, aNode)
 169010 				if iDepth > RTREE_MAX_DEPTH {
 169011 					rtreeCheckAppendMsg(tls, pCheck, ts+28577, libc.VaList(bp+16, iDepth))
 169012 					Xsqlite3_free(tls, aNode)
 169013 					return
 169014 				}
 169015 			}
 169016 			nCell = readInt16(tls, aNode+2)
 169017 			if 4+nCell*(8+(*RtreeCheck)(unsafe.Pointer(pCheck)).FnDim*2*4) > *(*int32)(unsafe.Pointer(bp + 48)) {
 169018 				rtreeCheckAppendMsg(tls, pCheck,
 169019 					ts+28607,
 169020 					libc.VaList(bp+24, iNode, nCell, *(*int32)(unsafe.Pointer(bp + 48))))
 169021 			} else {
 169022 				for i = 0; i < nCell; i++ {
 169023 					var pCell uintptr = aNode + uintptr(4+i*(8+(*RtreeCheck)(unsafe.Pointer(pCheck)).FnDim*2*4))
 169024 					var iVal I64 = readInt64(tls, pCell)
 169025 					rtreeCheckCellCoord(tls, pCheck, iNode, i, pCell+8, aParent)
 169026 
 169027 					if iDepth > 0 {
 169028 						rtreeCheckMapping(tls, pCheck, 0, iVal, iNode)
 169029 						rtreeCheckNode(tls, pCheck, iDepth-1, pCell+8, iVal)
 169030 						(*RtreeCheck)(unsafe.Pointer(pCheck)).FnNonLeaf++
 169031 					} else {
 169032 						rtreeCheckMapping(tls, pCheck, 1, iVal, iNode)
 169033 						(*RtreeCheck)(unsafe.Pointer(pCheck)).FnLeaf++
 169034 					}
 169035 				}
 169036 			}
 169037 		}
 169038 		Xsqlite3_free(tls, aNode)
 169039 	}
 169040 }
 169041 
 169042 func rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect I64) {
 169043 	bp := tls.Alloc(48)
 169044 	defer tls.Free(48)
 169045 
 169046 	if (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK {
 169047 		var pCount uintptr
 169048 		pCount = rtreeCheckPrepare(tls, pCheck, ts+28662,
 169049 			libc.VaList(bp, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl))
 169050 		if pCount != 0 {
 169051 			if Xsqlite3_step(tls, pCount) == SQLITE_ROW {
 169052 				var nActual I64 = Xsqlite3_column_int64(tls, pCount, 0)
 169053 				if nActual != nExpect {
 169054 					rtreeCheckAppendMsg(tls, pCheck,
 169055 						ts+28693, libc.VaList(bp+24, zTbl, nExpect, nActual))
 169056 				}
 169057 			}
 169058 			(*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount)
 169059 		}
 169060 	}
 169061 }
 169062 
 169063 func rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzReport uintptr) int32 {
 169064 	bp := tls.Alloc(120)
 169065 	defer tls.Free(120)
 169066 
 169067 	var pStmt uintptr = uintptr(0)
 169068 	var bEnd int32 = 0
 169069 	var nAux int32 = 0
 169070 
 169071 	libc.Xmemset(tls, bp+32, 0, uint64(unsafe.Sizeof(RtreeCheck{})))
 169072 	(*RtreeCheck)(unsafe.Pointer(bp + 32)).Fdb = db
 169073 	(*RtreeCheck)(unsafe.Pointer(bp + 32)).FzDb = zDb
 169074 	(*RtreeCheck)(unsafe.Pointer(bp + 32)).FzTab = zTab
 169075 
 169076 	if Xsqlite3_get_autocommit(tls, db) != 0 {
 169077 		(*RtreeCheck)(unsafe.Pointer(bp + 32)).Frc = Xsqlite3_exec(tls, db, ts+15860, uintptr(0), uintptr(0), uintptr(0))
 169078 		bEnd = 1
 169079 	}
 169080 
 169081 	if (*RtreeCheck)(unsafe.Pointer(bp+32)).Frc == SQLITE_OK {
 169082 		pStmt = rtreeCheckPrepare(tls, bp+32, ts+28760, libc.VaList(bp, zDb, zTab))
 169083 		if pStmt != 0 {
 169084 			nAux = Xsqlite3_column_count(tls, pStmt) - 2
 169085 			Xsqlite3_finalize(tls, pStmt)
 169086 		} else if (*RtreeCheck)(unsafe.Pointer(bp+32)).Frc != SQLITE_NOMEM {
 169087 			(*RtreeCheck)(unsafe.Pointer(bp + 32)).Frc = SQLITE_OK
 169088 		}
 169089 	}
 169090 
 169091 	pStmt = rtreeCheckPrepare(tls, bp+32, ts+26580, libc.VaList(bp+16, zDb, zTab))
 169092 	if pStmt != 0 {
 169093 		var rc int32
 169094 		(*RtreeCheck)(unsafe.Pointer(bp + 32)).FnDim = (Xsqlite3_column_count(tls, pStmt) - 1 - nAux) / 2
 169095 		if (*RtreeCheck)(unsafe.Pointer(bp+32)).FnDim < 1 {
 169096 			rtreeCheckAppendMsg(tls, bp+32, ts+28788, 0)
 169097 		} else if SQLITE_ROW == Xsqlite3_step(tls, pStmt) {
 169098 			(*RtreeCheck)(unsafe.Pointer(bp + 32)).FbInt = libc.Bool32(Xsqlite3_column_type(tls, pStmt, 1) == SQLITE_INTEGER)
 169099 		}
 169100 		rc = Xsqlite3_finalize(tls, pStmt)
 169101 		if rc != SQLITE_CORRUPT {
 169102 			(*RtreeCheck)(unsafe.Pointer(bp + 32)).Frc = rc
 169103 		}
 169104 	}
 169105 
 169106 	if (*RtreeCheck)(unsafe.Pointer(bp+32)).FnDim >= 1 {
 169107 		if (*RtreeCheck)(unsafe.Pointer(bp+32)).Frc == SQLITE_OK {
 169108 			rtreeCheckNode(tls, bp+32, 0, uintptr(0), int64(1))
 169109 		}
 169110 		rtreeCheckCount(tls, bp+32, ts+28819, int64((*RtreeCheck)(unsafe.Pointer(bp+32)).FnLeaf))
 169111 		rtreeCheckCount(tls, bp+32, ts+28826, int64((*RtreeCheck)(unsafe.Pointer(bp+32)).FnNonLeaf))
 169112 	}
 169113 
 169114 	Xsqlite3_finalize(tls, (*RtreeCheck)(unsafe.Pointer(bp+32)).FpGetNode)
 169115 	Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 32 + 40)))
 169116 	Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 32 + 40 + 1*8)))
 169117 
 169118 	if bEnd != 0 {
 169119 		var rc int32 = Xsqlite3_exec(tls, db, ts+28834, uintptr(0), uintptr(0), uintptr(0))
 169120 		if (*RtreeCheck)(unsafe.Pointer(bp+32)).Frc == SQLITE_OK {
 169121 			(*RtreeCheck)(unsafe.Pointer(bp + 32)).Frc = rc
 169122 		}
 169123 	}
 169124 	*(*uintptr)(unsafe.Pointer(pzReport)) = (*RtreeCheck)(unsafe.Pointer(bp + 32)).FzReport
 169125 	return (*RtreeCheck)(unsafe.Pointer(bp + 32)).Frc
 169126 }
 169127 
 169128 func rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) {
 169129 	bp := tls.Alloc(8)
 169130 	defer tls.Free(8)
 169131 
 169132 	if nArg != 1 && nArg != 2 {
 169133 		Xsqlite3_result_error(tls, ctx,
 169134 			ts+28838, -1)
 169135 	} else {
 169136 		var rc int32
 169137 		*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 169138 		var zDb uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg)))
 169139 		var zTab uintptr
 169140 		if nArg == 1 {
 169141 			zTab = zDb
 169142 			zDb = ts + 7793
 169143 		} else {
 169144 			zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8)))
 169145 		}
 169146 		rc = rtreeCheckTable(tls, Xsqlite3_context_db_handle(tls, ctx), zDb, zTab, bp)
 169147 		if rc == SQLITE_OK {
 169148 			Xsqlite3_result_text(tls, ctx, func() uintptr {
 169149 				if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
 169150 					return *(*uintptr)(unsafe.Pointer(bp))
 169151 				}
 169152 				return ts + 19428
 169153 			}(), -1, libc.UintptrFromInt32(-1))
 169154 		} else {
 169155 			Xsqlite3_result_error_code(tls, ctx, rc)
 169156 		}
 169157 		Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp)))
 169158 	}
 169159 }
 169160 
 169161 // Datatype for coordinates
 169162 type GeoCoord = float32
 169163 
 169164 // Internal representation of a polygon.
 169165 //
 169166 // The polygon consists of a sequence of vertexes.  There is a line
 169167 // segment between each pair of vertexes, and one final segment from
 169168 // the last vertex back to the first.  (This differs from the GeoJSON
 169169 // standard in which the final vertex is a repeat of the first.)
 169170 //
 169171 // The polygon follows the right-hand rule.  The area to the right of
 169172 // each segment is "outside" and the area to the left is "inside".
 169173 //
 169174 // The on-disk representation consists of a 4-byte header followed by
 169175 // the values.  The 4-byte header is:
 169176 //
 169177 //	encoding    (1 byte)   0=big-endian, 1=little-endian
 169178 //	nvertex     (3 bytes)  Number of vertexes as a big-endian integer
 169179 //
 169180 // Enough space is allocated for 4 coordinates, to work around over-zealous
 169181 // warnings coming from some compiler (notably, clang). In reality, the size
 169182 // of each GeoPoly memory allocate is adjusted as necessary so that the
 169183 // GeoPoly.a[] array at the end is the appropriate size.
 169184 type GeoPoly1 = struct {
 169185 	FnVertex int32
 169186 	Fhdr     [4]uint8
 169187 	Fa       [8]GeoCoord
 169188 }
 169189 
 169190 // Internal representation of a polygon.
 169191 //
 169192 // The polygon consists of a sequence of vertexes.  There is a line
 169193 // segment between each pair of vertexes, and one final segment from
 169194 // the last vertex back to the first.  (This differs from the GeoJSON
 169195 // standard in which the final vertex is a repeat of the first.)
 169196 //
 169197 // The polygon follows the right-hand rule.  The area to the right of
 169198 // each segment is "outside" and the area to the left is "inside".
 169199 //
 169200 // The on-disk representation consists of a 4-byte header followed by
 169201 // the values.  The 4-byte header is:
 169202 //
 169203 //	encoding    (1 byte)   0=big-endian, 1=little-endian
 169204 //	nvertex     (3 bytes)  Number of vertexes as a big-endian integer
 169205 //
 169206 // Enough space is allocated for 4 coordinates, to work around over-zealous
 169207 // warnings coming from some compiler (notably, clang). In reality, the size
 169208 // of each GeoPoly memory allocate is adjusted as necessary so that the
 169209 // GeoPoly.a[] array at the end is the appropriate size.
 169210 type GeoPoly = GeoPoly1
 169211 
 169212 // State of a parse of a GeoJSON input.
 169213 type GeoParse1 = struct {
 169214 	Fz           uintptr
 169215 	FnVertex     int32
 169216 	FnAlloc      int32
 169217 	FnErr        int32
 169218 	F__ccgo_pad1 [4]byte
 169219 	Fa           uintptr
 169220 }
 169221 
 169222 // State of a parse of a GeoJSON input.
 169223 type GeoParse = GeoParse1
 169224 
 169225 func geopolySwab32(tls *libc.TLS, a uintptr) {
 169226 	var t uint8 = *(*uint8)(unsafe.Pointer(a))
 169227 	*(*uint8)(unsafe.Pointer(a)) = *(*uint8)(unsafe.Pointer(a + 3))
 169228 	*(*uint8)(unsafe.Pointer(a + 3)) = t
 169229 	t = *(*uint8)(unsafe.Pointer(a + 1))
 169230 	*(*uint8)(unsafe.Pointer(a + 1)) = *(*uint8)(unsafe.Pointer(a + 2))
 169231 	*(*uint8)(unsafe.Pointer(a + 2)) = t
 169232 }
 169233 
 169234 func geopolySkipSpace(tls *libc.TLS, p uintptr) int8 {
 169235 	for jsonIsSpace[*(*uint8)(unsafe.Pointer((*GeoParse)(unsafe.Pointer(p)).Fz))] != 0 {
 169236 		(*GeoParse)(unsafe.Pointer(p)).Fz++
 169237 	}
 169238 	return int8(*(*uint8)(unsafe.Pointer((*GeoParse)(unsafe.Pointer(p)).Fz)))
 169239 }
 169240 
 169241 func geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) int32 {
 169242 	bp := tls.Alloc(8)
 169243 	defer tls.Free(8)
 169244 
 169245 	var c int8 = geopolySkipSpace(tls, p)
 169246 	var z uintptr = (*GeoParse)(unsafe.Pointer(p)).Fz
 169247 	var j int32 = 0
 169248 	var seenDP int32 = 0
 169249 	var seenE int32 = 0
 169250 	if int32(c) == '-' {
 169251 		j = 1
 169252 		c = int8(*(*uint8)(unsafe.Pointer(z + uintptr(j))))
 169253 	}
 169254 	if int32(c) == '0' && int32(*(*uint8)(unsafe.Pointer(z + uintptr(j+1)))) >= '0' && int32(*(*uint8)(unsafe.Pointer(z + uintptr(j+1)))) <= '9' {
 169255 		return 0
 169256 	}
 169257 	for ; ; j++ {
 169258 		c = int8(*(*uint8)(unsafe.Pointer(z + uintptr(j))))
 169259 		if int32(Xsqlite3CtypeMap[uint8(c)])&0x04 != 0 {
 169260 			continue
 169261 		}
 169262 		if int32(c) == '.' {
 169263 			if int32(*(*uint8)(unsafe.Pointer(z + uintptr(j-1)))) == '-' {
 169264 				return 0
 169265 			}
 169266 			if seenDP != 0 {
 169267 				return 0
 169268 			}
 169269 			seenDP = 1
 169270 			continue
 169271 		}
 169272 		if int32(c) == 'e' || int32(c) == 'E' {
 169273 			if int32(*(*uint8)(unsafe.Pointer(z + uintptr(j-1)))) < '0' {
 169274 				return 0
 169275 			}
 169276 			if seenE != 0 {
 169277 				return -1
 169278 			}
 169279 			seenDP = libc.AssignInt32(&seenE, 1)
 169280 			c = int8(*(*uint8)(unsafe.Pointer(z + uintptr(j+1))))
 169281 			if int32(c) == '+' || int32(c) == '-' {
 169282 				j++
 169283 				c = int8(*(*uint8)(unsafe.Pointer(z + uintptr(j+1))))
 169284 			}
 169285 			if int32(c) < '0' || int32(c) > '9' {
 169286 				return 0
 169287 			}
 169288 			continue
 169289 		}
 169290 		break
 169291 	}
 169292 	if int32(*(*uint8)(unsafe.Pointer(z + uintptr(j-1)))) < '0' {
 169293 		return 0
 169294 	}
 169295 	if pVal != 0 {
 169296 		Xsqlite3AtoF(tls, (*GeoParse)(unsafe.Pointer(p)).Fz, bp, j, uint8(SQLITE_UTF8))
 169297 		*(*GeoCoord)(unsafe.Pointer(pVal)) = GeoCoord(*(*float64)(unsafe.Pointer(bp)))
 169298 	}
 169299 	*(*uintptr)(unsafe.Pointer(p)) += uintptr(j)
 169300 	return 1
 169301 }
 169302 
 169303 func geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) uintptr {
 169304 	bp := tls.Alloc(36)
 169305 	defer tls.Free(36)
 169306 
 169307 	var rc int32
 169308 	var aNew uintptr
 169309 	var ii int32
 169310 	var c int8
 169311 	var pOut uintptr
 169312 
 169313 	rc = SQLITE_OK
 169314 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(GeoParse{})))
 169315 	(*GeoParse)(unsafe.Pointer(bp)).Fz = z
 169316 	if !(int32(geopolySkipSpace(tls, bp)) == '[') {
 169317 		goto __1
 169318 	}
 169319 	(*GeoParse)(unsafe.Pointer(bp)).Fz++
 169320 __2:
 169321 	if !(int32(geopolySkipSpace(tls, bp)) == '[') {
 169322 		goto __3
 169323 	}
 169324 	ii = 0
 169325 	(*GeoParse)(unsafe.Pointer(bp)).Fz++
 169326 	if !((*GeoParse)(unsafe.Pointer(bp)).FnVertex >= (*GeoParse)(unsafe.Pointer(bp)).FnAlloc) {
 169327 		goto __4
 169328 	}
 169329 	(*GeoParse)(unsafe.Pointer(bp)).FnAlloc = (*GeoParse)(unsafe.Pointer(bp)).FnAlloc*2 + 16
 169330 	aNew = Xsqlite3_realloc64(tls, (*GeoParse)(unsafe.Pointer(bp)).Fa, uint64((*GeoParse)(unsafe.Pointer(bp)).FnAlloc)*uint64(unsafe.Sizeof(GeoCoord(0)))*uint64(2))
 169331 	if !(aNew == uintptr(0)) {
 169332 		goto __5
 169333 	}
 169334 	rc = SQLITE_NOMEM
 169335 	(*GeoParse)(unsafe.Pointer(bp)).FnErr++
 169336 	goto __3
 169337 __5:
 169338 	;
 169339 	(*GeoParse)(unsafe.Pointer(bp)).Fa = aNew
 169340 __4:
 169341 	;
 169342 __6:
 169343 	if !(geopolyParseNumber(tls, bp, func() uintptr {
 169344 		if ii <= 1 {
 169345 			return (*GeoParse)(unsafe.Pointer(bp)).Fa + uintptr((*GeoParse)(unsafe.Pointer(bp)).FnVertex*2+ii)*4
 169346 		}
 169347 		return uintptr(0)
 169348 	}()) != 0) {
 169349 		goto __7
 169350 	}
 169351 	ii++
 169352 	if !(ii == 2) {
 169353 		goto __8
 169354 	}
 169355 	(*GeoParse)(unsafe.Pointer(bp)).FnVertex++
 169356 __8:
 169357 	;
 169358 	c = geopolySkipSpace(tls, bp)
 169359 	(*GeoParse)(unsafe.Pointer(bp)).Fz++
 169360 	if !(int32(c) == ',') {
 169361 		goto __9
 169362 	}
 169363 	goto __6
 169364 __9:
 169365 	;
 169366 	if !(int32(c) == ']' && ii >= 2) {
 169367 		goto __10
 169368 	}
 169369 	goto __7
 169370 __10:
 169371 	;
 169372 	(*GeoParse)(unsafe.Pointer(bp)).FnErr++
 169373 	rc = SQLITE_ERROR
 169374 	goto parse_json_err
 169375 	goto __6
 169376 __7:
 169377 	;
 169378 	if !(int32(geopolySkipSpace(tls, bp)) == ',') {
 169379 		goto __11
 169380 	}
 169381 	(*GeoParse)(unsafe.Pointer(bp)).Fz++
 169382 	goto __2
 169383 __11:
 169384 	;
 169385 	goto __3
 169386 	goto __2
 169387 __3:
 169388 	;
 169389 	if !(int32(geopolySkipSpace(tls, bp)) == ']' &&
 169390 		(*GeoParse)(unsafe.Pointer(bp)).FnVertex >= 4 &&
 169391 		*(*GeoCoord)(unsafe.Pointer((*GeoParse)(unsafe.Pointer(bp)).Fa)) == *(*GeoCoord)(unsafe.Pointer((*GeoParse)(unsafe.Pointer(bp)).Fa + uintptr((*GeoParse)(unsafe.Pointer(bp)).FnVertex*2-2)*4)) &&
 169392 		*(*GeoCoord)(unsafe.Pointer((*GeoParse)(unsafe.Pointer(bp)).Fa + 1*4)) == *(*GeoCoord)(unsafe.Pointer((*GeoParse)(unsafe.Pointer(bp)).Fa + uintptr((*GeoParse)(unsafe.Pointer(bp)).FnVertex*2-1)*4)) &&
 169393 		func() bool { (*GeoParse)(unsafe.Pointer(bp)).Fz++; return int32(geopolySkipSpace(tls, bp)) == 0 }()) {
 169394 		goto __12
 169395 	}
 169396 	*(*int32)(unsafe.Pointer(bp + 32)) = 1
 169397 	(*GeoParse)(unsafe.Pointer(bp)).FnVertex--
 169398 	pOut = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(GeoPoly{}))+uint64(unsafe.Sizeof(GeoCoord(0)))*uint64(2)*uint64(Sqlite3_int64((*GeoParse)(unsafe.Pointer(bp)).FnVertex)-int64(4)))
 169399 	*(*int32)(unsafe.Pointer(bp + 32)) = 1
 169400 	if !(pOut == uintptr(0)) {
 169401 		goto __14
 169402 	}
 169403 	goto parse_json_err
 169404 __14:
 169405 	;
 169406 	(*GeoPoly)(unsafe.Pointer(pOut)).FnVertex = (*GeoParse)(unsafe.Pointer(bp)).FnVertex
 169407 	libc.Xmemcpy(tls, pOut+8, (*GeoParse)(unsafe.Pointer(bp)).Fa, uint64((*GeoParse)(unsafe.Pointer(bp)).FnVertex*2)*uint64(unsafe.Sizeof(GeoCoord(0))))
 169408 	*(*uint8)(unsafe.Pointer(pOut + 4)) = *(*uint8)(unsafe.Pointer(bp + 32))
 169409 	*(*uint8)(unsafe.Pointer(pOut + 4 + 1)) = uint8((*GeoParse)(unsafe.Pointer(bp)).FnVertex >> 16 & 0xff)
 169410 	*(*uint8)(unsafe.Pointer(pOut + 4 + 2)) = uint8((*GeoParse)(unsafe.Pointer(bp)).FnVertex >> 8 & 0xff)
 169411 	*(*uint8)(unsafe.Pointer(pOut + 4 + 3)) = uint8((*GeoParse)(unsafe.Pointer(bp)).FnVertex & 0xff)
 169412 	Xsqlite3_free(tls, (*GeoParse)(unsafe.Pointer(bp)).Fa)
 169413 	if !(pRc != 0) {
 169414 		goto __15
 169415 	}
 169416 	*(*int32)(unsafe.Pointer(pRc)) = SQLITE_OK
 169417 __15:
 169418 	;
 169419 	return pOut
 169420 	goto __13
 169421 __12:
 169422 	(*GeoParse)(unsafe.Pointer(bp)).FnErr++
 169423 	rc = SQLITE_ERROR
 169424 __13:
 169425 	;
 169426 __1:
 169427 	;
 169428 parse_json_err:
 169429 	if !(pRc != 0) {
 169430 		goto __16
 169431 	}
 169432 	*(*int32)(unsafe.Pointer(pRc)) = rc
 169433 __16:
 169434 	;
 169435 	Xsqlite3_free(tls, (*GeoParse)(unsafe.Pointer(bp)).Fa)
 169436 	return uintptr(0)
 169437 }
 169438 
 169439 func geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) uintptr {
 169440 	bp := tls.Alloc(4)
 169441 	defer tls.Free(4)
 169442 
 169443 	var p uintptr = uintptr(0)
 169444 	var nByte int32
 169445 
 169446 	if Xsqlite3_value_type(tls, pVal) == SQLITE_BLOB &&
 169447 		libc.AssignInt32(&nByte, Xsqlite3_value_bytes(tls, pVal)) >= int32(uint64(4)+uint64(6)*uint64(unsafe.Sizeof(GeoCoord(0)))) {
 169448 		var a uintptr = Xsqlite3_value_blob(tls, pVal)
 169449 		var nVertex int32
 169450 		if a == uintptr(0) {
 169451 			if pCtx != 0 {
 169452 				Xsqlite3_result_error_nomem(tls, pCtx)
 169453 			}
 169454 			return uintptr(0)
 169455 		}
 169456 		nVertex = int32(*(*uint8)(unsafe.Pointer(a + 1)))<<16 + int32(*(*uint8)(unsafe.Pointer(a + 2)))<<8 + int32(*(*uint8)(unsafe.Pointer(a + 3)))
 169457 		if (int32(*(*uint8)(unsafe.Pointer(a))) == 0 || int32(*(*uint8)(unsafe.Pointer(a))) == 1) &&
 169458 			uint64(nVertex*2)*uint64(unsafe.Sizeof(GeoCoord(0)))+uint64(4) == uint64(uint32(nByte)) {
 169459 			p = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(GeoPoly{}))+uint64((nVertex-1)*2)*uint64(unsafe.Sizeof(GeoCoord(0))))
 169460 			if p == uintptr(0) {
 169461 				if pRc != 0 {
 169462 					*(*int32)(unsafe.Pointer(pRc)) = SQLITE_NOMEM
 169463 				}
 169464 				if pCtx != 0 {
 169465 					Xsqlite3_result_error_nomem(tls, pCtx)
 169466 				}
 169467 			} else {
 169468 				*(*int32)(unsafe.Pointer(bp)) = 1
 169469 				(*GeoPoly)(unsafe.Pointer(p)).FnVertex = nVertex
 169470 				libc.Xmemcpy(tls, p+4, a, uint64(nByte))
 169471 				if int32(*(*uint8)(unsafe.Pointer(a))) != int32(*(*uint8)(unsafe.Pointer(bp))) {
 169472 					var ii int32
 169473 					for ii = 0; ii < nVertex; ii++ {
 169474 						geopolySwab32(tls, p+8+uintptr(ii*2)*4)
 169475 						geopolySwab32(tls, p+8+uintptr(ii*2+1)*4)
 169476 					}
 169477 					*(*uint8)(unsafe.Pointer(p + 4)) ^= uint8(1)
 169478 				}
 169479 			}
 169480 		}
 169481 		if pRc != 0 {
 169482 			*(*int32)(unsafe.Pointer(pRc)) = SQLITE_OK
 169483 		}
 169484 		return p
 169485 	} else if Xsqlite3_value_type(tls, pVal) == SQLITE_TEXT {
 169486 		var zJson uintptr = Xsqlite3_value_text(tls, pVal)
 169487 		if zJson == uintptr(0) {
 169488 			if pRc != 0 {
 169489 				*(*int32)(unsafe.Pointer(pRc)) = SQLITE_NOMEM
 169490 			}
 169491 			return uintptr(0)
 169492 		}
 169493 		return geopolyParseJson(tls, zJson, pRc)
 169494 	} else {
 169495 		if pRc != 0 {
 169496 			*(*int32)(unsafe.Pointer(pRc)) = SQLITE_ERROR
 169497 		}
 169498 		return uintptr(0)
 169499 	}
 169500 	return uintptr(0)
 169501 }
 169502 
 169503 func geopolyBlobFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 169504 	var p uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0))
 169505 	_ = argc
 169506 	if p != 0 {
 169507 		Xsqlite3_result_blob(tls, context, p+4,
 169508 			4+8*(*GeoPoly)(unsafe.Pointer(p)).FnVertex, libc.UintptrFromInt32(-1))
 169509 		Xsqlite3_free(tls, p)
 169510 	}
 169511 }
 169512 
 169513 func geopolyJsonFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 169514 	bp := tls.Alloc(32)
 169515 	defer tls.Free(32)
 169516 
 169517 	var p uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0))
 169518 	_ = argc
 169519 	if p != 0 {
 169520 		var db uintptr = Xsqlite3_context_db_handle(tls, context)
 169521 		var x uintptr = Xsqlite3_str_new(tls, db)
 169522 		var i int32
 169523 		Xsqlite3_str_append(tls, x, ts+28889, 1)
 169524 		for i = 0; i < (*GeoPoly)(unsafe.Pointer(p)).FnVertex; i++ {
 169525 			Xsqlite3_str_appendf(tls, x, ts+28891, libc.VaList(bp, float64(*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*2)*4))), float64(*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*2+1)*4)))))
 169526 		}
 169527 		Xsqlite3_str_appendf(tls, x, ts+28902, libc.VaList(bp+16, float64(*(*GeoCoord)(unsafe.Pointer(p + 8))), float64(*(*GeoCoord)(unsafe.Pointer(p + 8 + 1*4)))))
 169528 		Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
 169529 		Xsqlite3_free(tls, p)
 169530 	}
 169531 }
 169532 
 169533 func geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 169534 	bp := tls.Alloc(48)
 169535 	defer tls.Free(48)
 169536 
 169537 	var p uintptr
 169538 	if argc < 1 {
 169539 		return
 169540 	}
 169541 	p = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0))
 169542 	if p != 0 {
 169543 		var db uintptr = Xsqlite3_context_db_handle(tls, context)
 169544 		var x uintptr = Xsqlite3_str_new(tls, db)
 169545 		var i int32
 169546 		var cSep int8 = int8('\'')
 169547 		Xsqlite3_str_appendf(tls, x, ts+28913, 0)
 169548 		for i = 0; i < (*GeoPoly)(unsafe.Pointer(p)).FnVertex; i++ {
 169549 			Xsqlite3_str_appendf(tls, x, ts+28931, libc.VaList(bp, int32(cSep), float64(*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*2)*4))), float64(*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*2+1)*4)))))
 169550 			cSep = int8(' ')
 169551 		}
 169552 		Xsqlite3_str_appendf(tls, x, ts+28939, libc.VaList(bp+24, float64(*(*GeoCoord)(unsafe.Pointer(p + 8))), float64(*(*GeoCoord)(unsafe.Pointer(p + 8 + 1*4)))))
 169553 		for i = 1; i < argc; i++ {
 169554 			var z uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
 169555 			if z != 0 && *(*int8)(unsafe.Pointer(z)) != 0 {
 169556 				Xsqlite3_str_appendf(tls, x, ts+28947, libc.VaList(bp+40, z))
 169557 			}
 169558 		}
 169559 		Xsqlite3_str_appendf(tls, x, ts+28951, 0)
 169560 		Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
 169561 		Xsqlite3_free(tls, p)
 169562 	}
 169563 }
 169564 
 169565 func geopolyXformFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 169566 	var p uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0))
 169567 	var A float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 169568 	var B float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))
 169569 	var C float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)))
 169570 	var D float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 4*8)))
 169571 	var E float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 5*8)))
 169572 	var F float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 6*8)))
 169573 	var x1 GeoCoord
 169574 	var y1 GeoCoord
 169575 	var x0 GeoCoord
 169576 	var y0 GeoCoord
 169577 	var ii int32
 169578 	_ = argc
 169579 	if p != 0 {
 169580 		for ii = 0; ii < (*GeoPoly)(unsafe.Pointer(p)).FnVertex; ii++ {
 169581 			x0 = *(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2)*4))
 169582 			y0 = *(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2+1)*4))
 169583 			x1 = GeoCoord(A*float64(x0) + B*float64(y0) + E)
 169584 			y1 = GeoCoord(C*float64(x0) + D*float64(y0) + F)
 169585 			*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2)*4)) = x1
 169586 			*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2+1)*4)) = y1
 169587 		}
 169588 		Xsqlite3_result_blob(tls, context, p+4,
 169589 			4+8*(*GeoPoly)(unsafe.Pointer(p)).FnVertex, libc.UintptrFromInt32(-1))
 169590 		Xsqlite3_free(tls, p)
 169591 	}
 169592 }
 169593 
 169594 func geopolyArea(tls *libc.TLS, p uintptr) float64 {
 169595 	var rArea float64 = 0.0
 169596 	var ii int32
 169597 	for ii = 0; ii < (*GeoPoly)(unsafe.Pointer(p)).FnVertex-1; ii++ {
 169598 		rArea = rArea + float64((*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2)*4))-*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr((ii+1)*2)*4)))*
 169599 			(*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2+1)*4))+*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr((ii+1)*2+1)*4))))*
 169600 			0.5
 169601 	}
 169602 	rArea = rArea + float64((*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2)*4))-*(*GeoCoord)(unsafe.Pointer(p + 8)))*
 169603 		(*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2+1)*4))+*(*GeoCoord)(unsafe.Pointer(p + 8 + 1*4))))*
 169604 		0.5
 169605 	return rArea
 169606 }
 169607 
 169608 func geopolyAreaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 169609 	var p uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0))
 169610 	_ = argc
 169611 	if p != 0 {
 169612 		Xsqlite3_result_double(tls, context, geopolyArea(tls, p))
 169613 		Xsqlite3_free(tls, p)
 169614 	}
 169615 }
 169616 
 169617 func geopolyCcwFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 169618 	var p uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0))
 169619 	_ = argc
 169620 	if p != 0 {
 169621 		if geopolyArea(tls, p) < 0.0 {
 169622 			var ii int32
 169623 			var jj int32
 169624 			ii = 1
 169625 			jj = (*GeoPoly)(unsafe.Pointer(p)).FnVertex - 1
 169626 		__1:
 169627 			if !(ii < jj) {
 169628 				goto __3
 169629 			}
 169630 			{
 169631 				var t GeoCoord = *(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2)*4))
 169632 				*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2)*4)) = *(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(jj*2)*4))
 169633 				*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(jj*2)*4)) = t
 169634 				t = *(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2+1)*4))
 169635 				*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*2+1)*4)) = *(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(jj*2+1)*4))
 169636 				*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(jj*2+1)*4)) = t
 169637 
 169638 			}
 169639 			goto __2
 169640 		__2:
 169641 			ii++
 169642 			jj--
 169643 			goto __1
 169644 			goto __3
 169645 		__3:
 169646 		}
 169647 		Xsqlite3_result_blob(tls, context, p+4,
 169648 			4+8*(*GeoPoly)(unsafe.Pointer(p)).FnVertex, libc.UintptrFromInt32(-1))
 169649 		Xsqlite3_free(tls, p)
 169650 	}
 169651 }
 169652 
 169653 func geopolySine(tls *libc.TLS, r float64) float64 {
 169654 	if r >= float64(1.5)*3.1415926535897932385 {
 169655 		r = r - float64(2.0)*3.1415926535897932385
 169656 	}
 169657 	if r >= float64(0.5)*3.1415926535897932385 {
 169658 		return -geopolySine(tls, r-3.1415926535897932385)
 169659 	} else {
 169660 		var r2 float64 = r * r
 169661 		var r3 float64 = r2 * r
 169662 		var r5 float64 = r3 * r2
 169663 		return 0.9996949*r - 0.1656700*r3 + 0.0075134*r5
 169664 	}
 169665 	return float64(0)
 169666 }
 169667 
 169668 func geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 169669 	bp := tls.Alloc(4)
 169670 	defer tls.Free(4)
 169671 
 169672 	var x float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv)))
 169673 	var y float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 169674 	var r float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))
 169675 	var n int32 = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)))
 169676 
 169677 	var p uintptr
 169678 	_ = argc
 169679 
 169680 	if n < 3 || r <= 0.0 {
 169681 		return
 169682 	}
 169683 	if n > 1000 {
 169684 		n = 1000
 169685 	}
 169686 	p = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(GeoPoly{}))+uint64((n-1)*2)*uint64(unsafe.Sizeof(GeoCoord(0))))
 169687 	if p == uintptr(0) {
 169688 		Xsqlite3_result_error_nomem(tls, context)
 169689 		return
 169690 	}
 169691 	*(*int32)(unsafe.Pointer(bp)) = 1
 169692 	*(*uint8)(unsafe.Pointer(p + 4)) = *(*uint8)(unsafe.Pointer(bp))
 169693 	*(*uint8)(unsafe.Pointer(p + 4 + 1)) = uint8(0)
 169694 	*(*uint8)(unsafe.Pointer(p + 4 + 2)) = uint8(n >> 8 & 0xff)
 169695 	*(*uint8)(unsafe.Pointer(p + 4 + 3)) = uint8(n & 0xff)
 169696 	for *(*int32)(unsafe.Pointer(bp)) = 0; *(*int32)(unsafe.Pointer(bp)) < n; *(*int32)(unsafe.Pointer(bp))++ {
 169697 		var rAngle float64 = float64(2.0) * 3.1415926535897932385 * float64(*(*int32)(unsafe.Pointer(bp))) / float64(n)
 169698 		*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*2)*4)) = GeoCoord(x - r*geopolySine(tls, rAngle-float64(0.5)*3.1415926535897932385))
 169699 		*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*2+1)*4)) = GeoCoord(y + r*geopolySine(tls, rAngle))
 169700 	}
 169701 	Xsqlite3_result_blob(tls, context, p+4, 4+8*n, libc.UintptrFromInt32(-1))
 169702 	Xsqlite3_free(tls, p)
 169703 }
 169704 
 169705 func geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, pRc uintptr) uintptr {
 169706 	bp := tls.Alloc(4)
 169707 	defer tls.Free(4)
 169708 
 169709 	var pOut uintptr
 169710 	var p uintptr
 169711 	var mnX float32
 169712 	var mxX float32
 169713 	var mnY float32
 169714 	var mxY float32
 169715 	var r float64
 169716 
 169717 	pOut = uintptr(0)
 169718 	if !(pPoly == uintptr(0) && aCoord != uintptr(0)) {
 169719 		goto __1
 169720 	}
 169721 	p = uintptr(0)
 169722 	mnX = *(*RtreeValue)(unsafe.Pointer(aCoord))
 169723 	mxX = *(*RtreeValue)(unsafe.Pointer(aCoord + 1*4))
 169724 	mnY = *(*RtreeValue)(unsafe.Pointer(aCoord + 2*4))
 169725 	mxY = *(*RtreeValue)(unsafe.Pointer(aCoord + 3*4))
 169726 	goto geopolyBboxFill
 169727 	goto __2
 169728 __1:
 169729 	p = geopolyFuncParam(tls, context, pPoly, pRc)
 169730 __2:
 169731 	;
 169732 	if !(p != 0) {
 169733 		goto __3
 169734 	}
 169735 	mnX = libc.AssignFloat32(&mxX, *(*GeoCoord)(unsafe.Pointer(p + 8)))
 169736 	mnY = libc.AssignFloat32(&mxY, *(*GeoCoord)(unsafe.Pointer(p + 8 + 1*4)))
 169737 	*(*int32)(unsafe.Pointer(bp)) = 1
 169738 __5:
 169739 	if !(*(*int32)(unsafe.Pointer(bp)) < (*GeoPoly)(unsafe.Pointer(p)).FnVertex) {
 169740 		goto __7
 169741 	}
 169742 	r = float64(*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*2)*4)))
 169743 	if !(r < float64(mnX)) {
 169744 		goto __8
 169745 	}
 169746 	mnX = float32(r)
 169747 	goto __9
 169748 __8:
 169749 	if !(r > float64(mxX)) {
 169750 		goto __10
 169751 	}
 169752 	mxX = float32(r)
 169753 __10:
 169754 	;
 169755 __9:
 169756 	;
 169757 	r = float64(*(*GeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*2+1)*4)))
 169758 	if !(r < float64(mnY)) {
 169759 		goto __11
 169760 	}
 169761 	mnY = float32(r)
 169762 	goto __12
 169763 __11:
 169764 	if !(r > float64(mxY)) {
 169765 		goto __13
 169766 	}
 169767 	mxY = float32(r)
 169768 __13:
 169769 	;
 169770 __12:
 169771 	;
 169772 	goto __6
 169773 __6:
 169774 	*(*int32)(unsafe.Pointer(bp))++
 169775 	goto __5
 169776 	goto __7
 169777 __7:
 169778 	;
 169779 	if !(pRc != 0) {
 169780 		goto __14
 169781 	}
 169782 	*(*int32)(unsafe.Pointer(pRc)) = SQLITE_OK
 169783 __14:
 169784 	;
 169785 	if !(aCoord == uintptr(0)) {
 169786 		goto __15
 169787 	}
 169788 geopolyBboxFill:
 169789 	pOut = Xsqlite3_realloc64(tls, p, uint64(unsafe.Sizeof(GeoPoly{}))+uint64(unsafe.Sizeof(GeoCoord(0)))*uint64(2)*uint64(4-4))
 169790 	if !(pOut == uintptr(0)) {
 169791 		goto __17
 169792 	}
 169793 	Xsqlite3_free(tls, p)
 169794 	if !(context != 0) {
 169795 		goto __18
 169796 	}
 169797 	Xsqlite3_result_error_nomem(tls, context)
 169798 __18:
 169799 	;
 169800 	if !(pRc != 0) {
 169801 		goto __19
 169802 	}
 169803 	*(*int32)(unsafe.Pointer(pRc)) = SQLITE_NOMEM
 169804 __19:
 169805 	;
 169806 	return uintptr(0)
 169807 __17:
 169808 	;
 169809 	(*GeoPoly)(unsafe.Pointer(pOut)).FnVertex = 4
 169810 	*(*int32)(unsafe.Pointer(bp)) = 1
 169811 	*(*uint8)(unsafe.Pointer(pOut + 4)) = *(*uint8)(unsafe.Pointer(bp))
 169812 	*(*uint8)(unsafe.Pointer(pOut + 4 + 1)) = uint8(0)
 169813 	*(*uint8)(unsafe.Pointer(pOut + 4 + 2)) = uint8(0)
 169814 	*(*uint8)(unsafe.Pointer(pOut + 4 + 3)) = uint8(4)
 169815 	*(*GeoCoord)(unsafe.Pointer(pOut + 8)) = mnX
 169816 	*(*GeoCoord)(unsafe.Pointer(pOut + 8 + 1*4)) = mnY
 169817 	*(*GeoCoord)(unsafe.Pointer(pOut + 8 + 2*4)) = mxX
 169818 	*(*GeoCoord)(unsafe.Pointer(pOut + 8 + 3*4)) = mnY
 169819 	*(*GeoCoord)(unsafe.Pointer(pOut + 8 + 4*4)) = mxX
 169820 	*(*GeoCoord)(unsafe.Pointer(pOut + 8 + 5*4)) = mxY
 169821 	*(*GeoCoord)(unsafe.Pointer(pOut + 8 + 6*4)) = mnX
 169822 	*(*GeoCoord)(unsafe.Pointer(pOut + 8 + 7*4)) = mxY
 169823 	goto __16
 169824 __15:
 169825 	Xsqlite3_free(tls, p)
 169826 	*(*RtreeValue)(unsafe.Pointer(aCoord)) = mnX
 169827 	*(*RtreeValue)(unsafe.Pointer(aCoord + 1*4)) = mxX
 169828 	*(*RtreeValue)(unsafe.Pointer(aCoord + 2*4)) = mnY
 169829 	*(*RtreeValue)(unsafe.Pointer(aCoord + 3*4)) = mxY
 169830 __16:
 169831 	;
 169832 	goto __4
 169833 __3:
 169834 	if !(aCoord != 0) {
 169835 		goto __20
 169836 	}
 169837 	libc.Xmemset(tls, aCoord, 0, uint64(unsafe.Sizeof(RtreeCoord{}))*uint64(4))
 169838 __20:
 169839 	;
 169840 __4:
 169841 	;
 169842 	return pOut
 169843 }
 169844 
 169845 func geopolyBBoxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 169846 	var p uintptr = geopolyBBox(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0), uintptr(0))
 169847 	_ = argc
 169848 	if p != 0 {
 169849 		Xsqlite3_result_blob(tls, context, p+4,
 169850 			4+8*(*GeoPoly)(unsafe.Pointer(p)).FnVertex, libc.UintptrFromInt32(-1))
 169851 		Xsqlite3_free(tls, p)
 169852 	}
 169853 }
 169854 
 169855 // State vector for the geopoly_group_bbox() aggregate function.
 169856 type GeoBBox1 = struct {
 169857 	FisInit int32
 169858 	Fa      [4]RtreeCoord
 169859 }
 169860 
 169861 // State vector for the geopoly_group_bbox() aggregate function.
 169862 type GeoBBox = GeoBBox1
 169863 
 169864 func geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 169865 	bp := tls.Alloc(20)
 169866 	defer tls.Free(20)
 169867 
 169868 	*(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_OK
 169869 	_ = argc
 169870 	geopolyBBox(tls, context, *(*uintptr)(unsafe.Pointer(argv)), bp, bp+16)
 169871 	if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
 169872 		var pBBox uintptr
 169873 		pBBox = Xsqlite3_aggregate_context(tls, context, int32(unsafe.Sizeof(GeoBBox{})))
 169874 		if pBBox == uintptr(0) {
 169875 			return
 169876 		}
 169877 		if (*GeoBBox)(unsafe.Pointer(pBBox)).FisInit == 0 {
 169878 			(*GeoBBox)(unsafe.Pointer(pBBox)).FisInit = 1
 169879 			libc.Xmemcpy(tls, pBBox+4, bp, uint64(unsafe.Sizeof(RtreeCoord{}))*uint64(4))
 169880 		} else {
 169881 			if *(*RtreeValue)(unsafe.Pointer(bp)) < *(*RtreeValue)(unsafe.Pointer(pBBox + 4)) {
 169882 				*(*RtreeCoord)(unsafe.Pointer(pBBox + 4)) = *(*RtreeCoord)(unsafe.Pointer(bp))
 169883 			}
 169884 			if *(*RtreeValue)(unsafe.Pointer(bp + 1*4)) > *(*RtreeValue)(unsafe.Pointer(pBBox + 4 + 1*4)) {
 169885 				*(*RtreeCoord)(unsafe.Pointer(pBBox + 4 + 1*4)) = *(*RtreeCoord)(unsafe.Pointer(bp + 1*4))
 169886 			}
 169887 			if *(*RtreeValue)(unsafe.Pointer(bp + 2*4)) < *(*RtreeValue)(unsafe.Pointer(pBBox + 4 + 2*4)) {
 169888 				*(*RtreeCoord)(unsafe.Pointer(pBBox + 4 + 2*4)) = *(*RtreeCoord)(unsafe.Pointer(bp + 2*4))
 169889 			}
 169890 			if *(*RtreeValue)(unsafe.Pointer(bp + 3*4)) > *(*RtreeValue)(unsafe.Pointer(pBBox + 4 + 3*4)) {
 169891 				*(*RtreeCoord)(unsafe.Pointer(pBBox + 4 + 3*4)) = *(*RtreeCoord)(unsafe.Pointer(bp + 3*4))
 169892 			}
 169893 		}
 169894 	}
 169895 }
 169896 
 169897 func geopolyBBoxFinal(tls *libc.TLS, context uintptr) {
 169898 	var p uintptr
 169899 	var pBBox uintptr
 169900 	pBBox = Xsqlite3_aggregate_context(tls, context, 0)
 169901 	if pBBox == uintptr(0) {
 169902 		return
 169903 	}
 169904 	p = geopolyBBox(tls, context, uintptr(0), pBBox+4, uintptr(0))
 169905 	if p != 0 {
 169906 		Xsqlite3_result_blob(tls, context, p+4,
 169907 			4+8*(*GeoPoly)(unsafe.Pointer(p)).FnVertex, libc.UintptrFromInt32(-1))
 169908 		Xsqlite3_free(tls, p)
 169909 	}
 169910 }
 169911 
 169912 func pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 float64, x2 float64, y2 float64) int32 {
 169913 	var y float64
 169914 	if x0 == x1 && y0 == y1 {
 169915 		return 2
 169916 	}
 169917 	if x1 < x2 {
 169918 		if x0 <= x1 || x0 > x2 {
 169919 			return 0
 169920 		}
 169921 	} else if x1 > x2 {
 169922 		if x0 <= x2 || x0 > x1 {
 169923 			return 0
 169924 		}
 169925 	} else {
 169926 		if x0 != x1 {
 169927 			return 0
 169928 		}
 169929 		if y0 < y1 && y0 < y2 {
 169930 			return 0
 169931 		}
 169932 		if y0 > y1 && y0 > y2 {
 169933 			return 0
 169934 		}
 169935 		return 2
 169936 	}
 169937 	y = y1 + (y2-y1)*(x0-x1)/(x2-x1)
 169938 	if y0 == y {
 169939 		return 2
 169940 	}
 169941 	if y0 < y {
 169942 		return 1
 169943 	}
 169944 	return 0
 169945 }
 169946 
 169947 func geopolyContainsPointFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 169948 	var p1 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0))
 169949 	var x0 float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 169950 	var y0 float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))
 169951 	var v int32 = 0
 169952 	var cnt int32 = 0
 169953 	var ii int32
 169954 	_ = argc
 169955 
 169956 	if p1 == uintptr(0) {
 169957 		return
 169958 	}
 169959 	for ii = 0; ii < (*GeoPoly)(unsafe.Pointer(p1)).FnVertex-1; ii++ {
 169960 		v = pointBeneathLine(tls, x0, y0, float64(*(*GeoCoord)(unsafe.Pointer(p1 + 8 + uintptr(ii*2)*4))), float64(*(*GeoCoord)(unsafe.Pointer(p1 + 8 + uintptr(ii*2+1)*4))),
 169961 			float64(*(*GeoCoord)(unsafe.Pointer(p1 + 8 + uintptr((ii+1)*2)*4))), float64(*(*GeoCoord)(unsafe.Pointer(p1 + 8 + uintptr((ii+1)*2+1)*4))))
 169962 		if v == 2 {
 169963 			break
 169964 		}
 169965 		cnt = cnt + v
 169966 	}
 169967 	if v != 2 {
 169968 		v = pointBeneathLine(tls, x0, y0, float64(*(*GeoCoord)(unsafe.Pointer(p1 + 8 + uintptr(ii*2)*4))), float64(*(*GeoCoord)(unsafe.Pointer(p1 + 8 + uintptr(ii*2+1)*4))),
 169969 			float64(*(*GeoCoord)(unsafe.Pointer(p1 + 8))), float64(*(*GeoCoord)(unsafe.Pointer(p1 + 8 + 1*4))))
 169970 	}
 169971 	if v == 2 {
 169972 		Xsqlite3_result_int(tls, context, 1)
 169973 	} else if (v+cnt)&1 == 0 {
 169974 		Xsqlite3_result_int(tls, context, 0)
 169975 	} else {
 169976 		Xsqlite3_result_int(tls, context, 2)
 169977 	}
 169978 	Xsqlite3_free(tls, p1)
 169979 }
 169980 
 169981 func geopolyWithinFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 169982 	var p1 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0))
 169983 	var p2 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uintptr(0))
 169984 	_ = argc
 169985 	if p1 != 0 && p2 != 0 {
 169986 		var x int32 = geopolyOverlap(tls, p1, p2)
 169987 		if x < 0 {
 169988 			Xsqlite3_result_error_nomem(tls, context)
 169989 		} else {
 169990 			Xsqlite3_result_int(tls, context, func() int32 {
 169991 				if x == 2 {
 169992 					return 1
 169993 				}
 169994 				return func() int32 {
 169995 					if x == 4 {
 169996 						return 2
 169997 					}
 169998 					return 0
 169999 				}()
 170000 			}())
 170001 		}
 170002 	}
 170003 	Xsqlite3_free(tls, p1)
 170004 	Xsqlite3_free(tls, p2)
 170005 }
 170006 
 170007 // Objects used by the overlap algorihm.
 170008 type GeoEvent1 = struct {
 170009 	Fx           float64
 170010 	FeType       int32
 170011 	F__ccgo_pad1 [4]byte
 170012 	FpSeg        uintptr
 170013 	FpNext       uintptr
 170014 }
 170015 
 170016 // Objects used by the overlap algorihm.
 170017 type GeoEvent = GeoEvent1
 170018 type GeoSegment1 = struct {
 170019 	FC           float64
 170020 	FB           float64
 170021 	Fy           float64
 170022 	Fy0          float32
 170023 	Fside        uint8
 170024 	F__ccgo_pad1 [3]byte
 170025 	Fidx         uint32
 170026 	F__ccgo_pad2 [4]byte
 170027 	FpNext       uintptr
 170028 }
 170029 
 170030 type GeoSegment = GeoSegment1
 170031 type GeoOverlap1 = struct {
 170032 	FaEvent   uintptr
 170033 	FaSegment uintptr
 170034 	FnEvent   int32
 170035 	FnSegment int32
 170036 }
 170037 
 170038 type GeoOverlap = GeoOverlap1
 170039 
 170040 func geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 GeoCoord, y0 GeoCoord, x1 GeoCoord, y1 GeoCoord, side uint8, idx uint32) {
 170041 	var pSeg uintptr
 170042 	var pEvent uintptr
 170043 	if x0 == x1 {
 170044 		return
 170045 	}
 170046 	if x0 > x1 {
 170047 		var t GeoCoord = x0
 170048 		x0 = x1
 170049 		x1 = t
 170050 		t = y0
 170051 		y0 = y1
 170052 		y1 = t
 170053 	}
 170054 	pSeg = (*GeoOverlap)(unsafe.Pointer(p)).FaSegment + uintptr((*GeoOverlap)(unsafe.Pointer(p)).FnSegment)*48
 170055 	(*GeoOverlap)(unsafe.Pointer(p)).FnSegment++
 170056 	(*GeoSegment)(unsafe.Pointer(pSeg)).FC = float64((y1 - y0) / (x1 - x0))
 170057 	(*GeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(x1)*(*GeoSegment)(unsafe.Pointer(pSeg)).FC
 170058 	(*GeoSegment)(unsafe.Pointer(pSeg)).Fy0 = y0
 170059 	(*GeoSegment)(unsafe.Pointer(pSeg)).Fside = side
 170060 	(*GeoSegment)(unsafe.Pointer(pSeg)).Fidx = idx
 170061 	pEvent = (*GeoOverlap)(unsafe.Pointer(p)).FaEvent + uintptr((*GeoOverlap)(unsafe.Pointer(p)).FnEvent)*32
 170062 	(*GeoOverlap)(unsafe.Pointer(p)).FnEvent++
 170063 	(*GeoEvent)(unsafe.Pointer(pEvent)).Fx = float64(x0)
 170064 	(*GeoEvent)(unsafe.Pointer(pEvent)).FeType = 0
 170065 	(*GeoEvent)(unsafe.Pointer(pEvent)).FpSeg = pSeg
 170066 	pEvent = (*GeoOverlap)(unsafe.Pointer(p)).FaEvent + uintptr((*GeoOverlap)(unsafe.Pointer(p)).FnEvent)*32
 170067 	(*GeoOverlap)(unsafe.Pointer(p)).FnEvent++
 170068 	(*GeoEvent)(unsafe.Pointer(pEvent)).Fx = float64(x1)
 170069 	(*GeoEvent)(unsafe.Pointer(pEvent)).FeType = 1
 170070 	(*GeoEvent)(unsafe.Pointer(pEvent)).FpSeg = pSeg
 170071 }
 170072 
 170073 func geopolyAddSegments(tls *libc.TLS, p uintptr, pPoly uintptr, side uint8) {
 170074 	var i uint32
 170075 	var x uintptr
 170076 	for i = uint32(0); i < uint32((*GeoPoly)(unsafe.Pointer(pPoly)).FnVertex)-uint32(1); i++ {
 170077 		x = pPoly + 8 + uintptr(i*uint32(2))*4
 170078 		geopolyAddOneSegment(tls, p, *(*GeoCoord)(unsafe.Pointer(x)), *(*GeoCoord)(unsafe.Pointer(x + 1*4)), *(*GeoCoord)(unsafe.Pointer(x + 2*4)), *(*GeoCoord)(unsafe.Pointer(x + 3*4)), side, i)
 170079 	}
 170080 	x = pPoly + 8 + uintptr(i*uint32(2))*4
 170081 	geopolyAddOneSegment(tls, p, *(*GeoCoord)(unsafe.Pointer(x)), *(*GeoCoord)(unsafe.Pointer(x + 1*4)), *(*GeoCoord)(unsafe.Pointer(pPoly + 8)), *(*GeoCoord)(unsafe.Pointer(pPoly + 8 + 1*4)), side, i)
 170082 }
 170083 
 170084 func geopolyEventMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr {
 170085 	bp := tls.Alloc(32)
 170086 	defer tls.Free(32)
 170087 
 170088 	var pLast uintptr
 170089 	(*GeoEvent)(unsafe.Pointer(bp)).FpNext = uintptr(0)
 170090 	pLast = bp
 170091 	for pRight != 0 && pLeft != 0 {
 170092 		if (*GeoEvent)(unsafe.Pointer(pRight)).Fx <= (*GeoEvent)(unsafe.Pointer(pLeft)).Fx {
 170093 			(*GeoEvent)(unsafe.Pointer(pLast)).FpNext = pRight
 170094 			pLast = pRight
 170095 			pRight = (*GeoEvent)(unsafe.Pointer(pRight)).FpNext
 170096 		} else {
 170097 			(*GeoEvent)(unsafe.Pointer(pLast)).FpNext = pLeft
 170098 			pLast = pLeft
 170099 			pLeft = (*GeoEvent)(unsafe.Pointer(pLeft)).FpNext
 170100 		}
 170101 	}
 170102 	(*GeoEvent)(unsafe.Pointer(pLast)).FpNext = func() uintptr {
 170103 		if pRight != 0 {
 170104 			return pRight
 170105 		}
 170106 		return pLeft
 170107 	}()
 170108 	return (*GeoEvent)(unsafe.Pointer(bp)).FpNext
 170109 }
 170110 
 170111 func geopolySortEventsByX(tls *libc.TLS, aEvent uintptr, nEvent int32) uintptr {
 170112 	bp := tls.Alloc(400)
 170113 	defer tls.Free(400)
 170114 
 170115 	var mx int32 = 0
 170116 	var i int32
 170117 	var j int32
 170118 	var p uintptr
 170119 
 170120 	for i = 0; i < nEvent; i++ {
 170121 		p = aEvent + uintptr(i)*32
 170122 		(*GeoEvent)(unsafe.Pointer(p)).FpNext = uintptr(0)
 170123 		for j = 0; j < mx && *(*uintptr)(unsafe.Pointer(bp + uintptr(j)*8)) != 0; j++ {
 170124 			p = geopolyEventMerge(tls, *(*uintptr)(unsafe.Pointer(bp + uintptr(j)*8)), p)
 170125 			*(*uintptr)(unsafe.Pointer(bp + uintptr(j)*8)) = uintptr(0)
 170126 		}
 170127 		*(*uintptr)(unsafe.Pointer(bp + uintptr(j)*8)) = p
 170128 		if j >= mx {
 170129 			mx = j + 1
 170130 		}
 170131 	}
 170132 	p = uintptr(0)
 170133 	for i = 0; i < mx; i++ {
 170134 		p = geopolyEventMerge(tls, *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)), p)
 170135 	}
 170136 	return p
 170137 }
 170138 
 170139 func geopolySegmentMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr {
 170140 	bp := tls.Alloc(48)
 170141 	defer tls.Free(48)
 170142 
 170143 	var pLast uintptr
 170144 	(*GeoSegment)(unsafe.Pointer(bp)).FpNext = uintptr(0)
 170145 	pLast = bp
 170146 	for pRight != 0 && pLeft != 0 {
 170147 		var r float64 = (*GeoSegment)(unsafe.Pointer(pRight)).Fy - (*GeoSegment)(unsafe.Pointer(pLeft)).Fy
 170148 		if r == 0.0 {
 170149 			r = (*GeoSegment)(unsafe.Pointer(pRight)).FC - (*GeoSegment)(unsafe.Pointer(pLeft)).FC
 170150 		}
 170151 		if r < 0.0 {
 170152 			(*GeoSegment)(unsafe.Pointer(pLast)).FpNext = pRight
 170153 			pLast = pRight
 170154 			pRight = (*GeoSegment)(unsafe.Pointer(pRight)).FpNext
 170155 		} else {
 170156 			(*GeoSegment)(unsafe.Pointer(pLast)).FpNext = pLeft
 170157 			pLast = pLeft
 170158 			pLeft = (*GeoSegment)(unsafe.Pointer(pLeft)).FpNext
 170159 		}
 170160 	}
 170161 	(*GeoSegment)(unsafe.Pointer(pLast)).FpNext = func() uintptr {
 170162 		if pRight != 0 {
 170163 			return pRight
 170164 		}
 170165 		return pLeft
 170166 	}()
 170167 	return (*GeoSegment)(unsafe.Pointer(bp)).FpNext
 170168 }
 170169 
 170170 func geopolySortSegmentsByYAndC(tls *libc.TLS, pList uintptr) uintptr {
 170171 	bp := tls.Alloc(400)
 170172 	defer tls.Free(400)
 170173 
 170174 	var mx int32 = 0
 170175 	var i int32
 170176 	var p uintptr
 170177 
 170178 	for pList != 0 {
 170179 		p = pList
 170180 		pList = (*GeoSegment)(unsafe.Pointer(pList)).FpNext
 170181 		(*GeoSegment)(unsafe.Pointer(p)).FpNext = uintptr(0)
 170182 		for i = 0; i < mx && *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)) != 0; i++ {
 170183 			p = geopolySegmentMerge(tls, *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)), p)
 170184 			*(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)) = uintptr(0)
 170185 		}
 170186 		*(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)) = p
 170187 		if i >= mx {
 170188 			mx = i + 1
 170189 		}
 170190 	}
 170191 	p = uintptr(0)
 170192 	for i = 0; i < mx; i++ {
 170193 		p = geopolySegmentMerge(tls, *(*uintptr)(unsafe.Pointer(bp + uintptr(i)*8)), p)
 170194 	}
 170195 	return p
 170196 }
 170197 
 170198 func geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) int32 {
 170199 	bp := tls.Alloc(4)
 170200 	defer tls.Free(4)
 170201 
 170202 	var nVertex Sqlite3_int64
 170203 	var p uintptr
 170204 	var nByte Sqlite3_int64
 170205 	var pThisEvent uintptr
 170206 	var rX float64
 170207 	var rc int32
 170208 	var needSort int32
 170209 	var pActive uintptr
 170210 	var pSeg uintptr
 170211 
 170212 	var y float64
 170213 	var pPrev uintptr
 170214 	var iMask int32
 170215 	nVertex = Sqlite3_int64((*GeoPoly)(unsafe.Pointer(p1)).FnVertex + (*GeoPoly)(unsafe.Pointer(p2)).FnVertex + 2)
 170216 	rc = 0
 170217 	needSort = 0
 170218 	pActive = uintptr(0)
 170219 
 170220 	nByte = Sqlite3_int64(uint64(unsafe.Sizeof(GeoEvent{}))*uint64(nVertex)*uint64(2) +
 170221 		uint64(unsafe.Sizeof(GeoSegment{}))*uint64(nVertex) +
 170222 		uint64(unsafe.Sizeof(GeoOverlap{})))
 170223 	p = Xsqlite3_malloc64(tls, uint64(nByte))
 170224 	if !(p == uintptr(0)) {
 170225 		goto __1
 170226 	}
 170227 	return -1
 170228 __1:
 170229 	;
 170230 	(*GeoOverlap)(unsafe.Pointer(p)).FaEvent = p + 1*24
 170231 	(*GeoOverlap)(unsafe.Pointer(p)).FaSegment = (*GeoOverlap)(unsafe.Pointer(p)).FaEvent + uintptr(nVertex*int64(2))*32
 170232 	(*GeoOverlap)(unsafe.Pointer(p)).FnEvent = libc.AssignPtrInt32(p+20, 0)
 170233 	geopolyAddSegments(tls, p, p1, uint8(1))
 170234 	geopolyAddSegments(tls, p, p2, uint8(2))
 170235 	pThisEvent = geopolySortEventsByX(tls, (*GeoOverlap)(unsafe.Pointer(p)).FaEvent, (*GeoOverlap)(unsafe.Pointer(p)).FnEvent)
 170236 	if pThisEvent != 0 && (*GeoEvent)(unsafe.Pointer(pThisEvent)).Fx == 0.0 {
 170237 		rX = -1.0
 170238 	} else {
 170239 		rX = 0.0
 170240 	}
 170241 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof([4]uint8{})))
 170242 __2:
 170243 	if !(pThisEvent != 0) {
 170244 		goto __3
 170245 	}
 170246 	if !((*GeoEvent)(unsafe.Pointer(pThisEvent)).Fx != rX) {
 170247 		goto __4
 170248 	}
 170249 	pPrev = uintptr(0)
 170250 	iMask = 0
 170251 
 170252 	rX = (*GeoEvent)(unsafe.Pointer(pThisEvent)).Fx
 170253 	if !(needSort != 0) {
 170254 		goto __5
 170255 	}
 170256 
 170257 	pActive = geopolySortSegmentsByYAndC(tls, pActive)
 170258 	needSort = 0
 170259 __5:
 170260 	;
 170261 	pSeg = pActive
 170262 __6:
 170263 	if !(pSeg != 0) {
 170264 		goto __8
 170265 	}
 170266 	if !(pPrev != 0) {
 170267 		goto __9
 170268 	}
 170269 	if !((*GeoSegment)(unsafe.Pointer(pPrev)).Fy != (*GeoSegment)(unsafe.Pointer(pSeg)).Fy) {
 170270 		goto __10
 170271 	}
 170272 
 170273 	*(*uint8)(unsafe.Pointer(bp + uintptr(iMask))) = uint8(1)
 170274 __10:
 170275 	;
 170276 __9:
 170277 	;
 170278 	iMask = iMask ^ int32((*GeoSegment)(unsafe.Pointer(pSeg)).Fside)
 170279 	pPrev = pSeg
 170280 	goto __7
 170281 __7:
 170282 	pSeg = (*GeoSegment)(unsafe.Pointer(pSeg)).FpNext
 170283 	goto __6
 170284 	goto __8
 170285 __8:
 170286 	;
 170287 	pPrev = uintptr(0)
 170288 	pSeg = pActive
 170289 __11:
 170290 	if !(pSeg != 0) {
 170291 		goto __13
 170292 	}
 170293 	y = (*GeoSegment)(unsafe.Pointer(pSeg)).FC*rX + (*GeoSegment)(unsafe.Pointer(pSeg)).FB
 170294 
 170295 	(*GeoSegment)(unsafe.Pointer(pSeg)).Fy = y
 170296 	if !(pPrev != 0) {
 170297 		goto __14
 170298 	}
 170299 	if !((*GeoSegment)(unsafe.Pointer(pPrev)).Fy > (*GeoSegment)(unsafe.Pointer(pSeg)).Fy && int32((*GeoSegment)(unsafe.Pointer(pPrev)).Fside) != int32((*GeoSegment)(unsafe.Pointer(pSeg)).Fside)) {
 170300 		goto __15
 170301 	}
 170302 	rc = 1
 170303 
 170304 	goto geopolyOverlapDone
 170305 	goto __16
 170306 __15:
 170307 	if !((*GeoSegment)(unsafe.Pointer(pPrev)).Fy != (*GeoSegment)(unsafe.Pointer(pSeg)).Fy) {
 170308 		goto __17
 170309 	}
 170310 
 170311 	*(*uint8)(unsafe.Pointer(bp + uintptr(iMask))) = uint8(1)
 170312 __17:
 170313 	;
 170314 __16:
 170315 	;
 170316 __14:
 170317 	;
 170318 	iMask = iMask ^ int32((*GeoSegment)(unsafe.Pointer(pSeg)).Fside)
 170319 	pPrev = pSeg
 170320 	goto __12
 170321 __12:
 170322 	pSeg = (*GeoSegment)(unsafe.Pointer(pSeg)).FpNext
 170323 	goto __11
 170324 	goto __13
 170325 __13:
 170326 	;
 170327 __4:
 170328 	;
 170329 	if !((*GeoEvent)(unsafe.Pointer(pThisEvent)).FeType == 0) {
 170330 		goto __18
 170331 	}
 170332 
 170333 	pSeg = (*GeoEvent)(unsafe.Pointer(pThisEvent)).FpSeg
 170334 	(*GeoSegment)(unsafe.Pointer(pSeg)).Fy = float64((*GeoSegment)(unsafe.Pointer(pSeg)).Fy0)
 170335 	(*GeoSegment)(unsafe.Pointer(pSeg)).FpNext = pActive
 170336 	pActive = pSeg
 170337 	needSort = 1
 170338 	goto __19
 170339 __18:
 170340 	if !(pActive == (*GeoEvent)(unsafe.Pointer(pThisEvent)).FpSeg) {
 170341 		goto __20
 170342 	}
 170343 	if pActive != 0 {
 170344 		pActive = (*GeoSegment)(unsafe.Pointer(pActive)).FpNext
 170345 	} else {
 170346 		pActive = uintptr(0)
 170347 	}
 170348 	goto __21
 170349 __20:
 170350 	pSeg = pActive
 170351 __22:
 170352 	if !(pSeg != 0) {
 170353 		goto __24
 170354 	}
 170355 	if !((*GeoSegment)(unsafe.Pointer(pSeg)).FpNext == (*GeoEvent)(unsafe.Pointer(pThisEvent)).FpSeg) {
 170356 		goto __25
 170357 	}
 170358 	(*GeoSegment)(unsafe.Pointer(pSeg)).FpNext = func() uintptr {
 170359 		if (*GeoSegment)(unsafe.Pointer(pSeg)).FpNext != 0 {
 170360 			return (*GeoSegment)(unsafe.Pointer((*GeoSegment)(unsafe.Pointer(pSeg)).FpNext)).FpNext
 170361 		}
 170362 		return uintptr(0)
 170363 	}()
 170364 	goto __24
 170365 __25:
 170366 	;
 170367 	goto __23
 170368 __23:
 170369 	pSeg = (*GeoSegment)(unsafe.Pointer(pSeg)).FpNext
 170370 	goto __22
 170371 	goto __24
 170372 __24:
 170373 	;
 170374 __21:
 170375 	;
 170376 __19:
 170377 	;
 170378 	pThisEvent = (*GeoEvent)(unsafe.Pointer(pThisEvent)).FpNext
 170379 	goto __2
 170380 __3:
 170381 	;
 170382 	if !(int32(*(*uint8)(unsafe.Pointer(bp + 3))) == 0) {
 170383 		goto __26
 170384 	}
 170385 	rc = 0
 170386 	goto __27
 170387 __26:
 170388 	if !(int32(*(*uint8)(unsafe.Pointer(bp + 1))) != 0 && int32(*(*uint8)(unsafe.Pointer(bp + 2))) == 0) {
 170389 		goto __28
 170390 	}
 170391 	rc = 3
 170392 	goto __29
 170393 __28:
 170394 	if !(int32(*(*uint8)(unsafe.Pointer(bp + 1))) == 0 && int32(*(*uint8)(unsafe.Pointer(bp + 2))) != 0) {
 170395 		goto __30
 170396 	}
 170397 	rc = 2
 170398 	goto __31
 170399 __30:
 170400 	if !(int32(*(*uint8)(unsafe.Pointer(bp + 1))) == 0 && int32(*(*uint8)(unsafe.Pointer(bp + 2))) == 0) {
 170401 		goto __32
 170402 	}
 170403 	rc = 4
 170404 	goto __33
 170405 __32:
 170406 	rc = 1
 170407 __33:
 170408 	;
 170409 __31:
 170410 	;
 170411 __29:
 170412 	;
 170413 __27:
 170414 	;
 170415 geopolyOverlapDone:
 170416 	Xsqlite3_free(tls, p)
 170417 	return rc
 170418 }
 170419 
 170420 func geopolyOverlapFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 170421 	var p1 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0))
 170422 	var p2 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uintptr(0))
 170423 	_ = argc
 170424 	if p1 != 0 && p2 != 0 {
 170425 		var x int32 = geopolyOverlap(tls, p1, p2)
 170426 		if x < 0 {
 170427 			Xsqlite3_result_error_nomem(tls, context)
 170428 		} else {
 170429 			Xsqlite3_result_int(tls, context, x)
 170430 		}
 170431 	}
 170432 	Xsqlite3_free(tls, p1)
 170433 	Xsqlite3_free(tls, p2)
 170434 }
 170435 
 170436 func geopolyDebugFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 170437 	_ = context
 170438 	_ = argc
 170439 	_ = argv
 170440 }
 170441 
 170442 func geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr, isCreate int32) int32 {
 170443 	bp := tls.Alloc(32)
 170444 	defer tls.Free(32)
 170445 
 170446 	var rc int32
 170447 	var pRtree uintptr
 170448 	var nDb Sqlite3_int64
 170449 	var nName Sqlite3_int64
 170450 	var pSql uintptr
 170451 	var zSql uintptr
 170452 	var ii int32
 170453 	rc = SQLITE_OK
 170454 	_ = pAux
 170455 
 170456 	Xsqlite3_vtab_config(tls, db, SQLITE_VTAB_CONSTRAINT_SUPPORT, libc.VaList(bp, 1))
 170457 
 170458 	nDb = Sqlite3_int64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))
 170459 	nName = Sqlite3_int64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8))))
 170460 	pRtree = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(Rtree{}))+uint64(nDb)+uint64(nName)+uint64(2))
 170461 	if !!(pRtree != 0) {
 170462 		goto __1
 170463 	}
 170464 	return SQLITE_NOMEM
 170465 __1:
 170466 	;
 170467 	libc.Xmemset(tls, pRtree, 0, uint64(unsafe.Sizeof(Rtree{}))+uint64(nDb)+uint64(nName)+uint64(2))
 170468 	(*Rtree)(unsafe.Pointer(pRtree)).FnBusy = U32(1)
 170469 	(*Rtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&rtreeModule))
 170470 	(*Rtree)(unsafe.Pointer(pRtree)).FzDb = pRtree + 1*968
 170471 	(*Rtree)(unsafe.Pointer(pRtree)).FzName = (*Rtree)(unsafe.Pointer(pRtree)).FzDb + uintptr(nDb+int64(1))
 170472 	(*Rtree)(unsafe.Pointer(pRtree)).FeCoordType = U8(RTREE_COORD_REAL32)
 170473 	(*Rtree)(unsafe.Pointer(pRtree)).FnDim = U8(2)
 170474 	(*Rtree)(unsafe.Pointer(pRtree)).FnDim2 = U8(4)
 170475 	libc.Xmemcpy(tls, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(nDb))
 170476 	libc.Xmemcpy(tls, (*Rtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), uint64(nName))
 170477 
 170478 	pSql = Xsqlite3_str_new(tls, db)
 170479 	Xsqlite3_str_appendf(tls, pSql, ts+28964, 0)
 170480 	(*Rtree)(unsafe.Pointer(pRtree)).FnAux = U8(1)
 170481 	(*Rtree)(unsafe.Pointer(pRtree)).FnAuxNotNull = U8(1)
 170482 	ii = 3
 170483 __2:
 170484 	if !(ii < argc) {
 170485 		goto __4
 170486 	}
 170487 	(*Rtree)(unsafe.Pointer(pRtree)).FnAux++
 170488 	Xsqlite3_str_appendf(tls, pSql, ts+28986, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8))))
 170489 	goto __3
 170490 __3:
 170491 	ii++
 170492 	goto __2
 170493 	goto __4
 170494 __4:
 170495 	;
 170496 	Xsqlite3_str_appendf(tls, pSql, ts+28053, 0)
 170497 	zSql = Xsqlite3_str_finish(tls, pSql)
 170498 	if !!(zSql != 0) {
 170499 		goto __5
 170500 	}
 170501 	rc = SQLITE_NOMEM
 170502 	goto __6
 170503 __5:
 170504 	if !(SQLITE_OK != libc.AssignInt32(&rc, Xsqlite3_declare_vtab(tls, db, zSql))) {
 170505 		goto __7
 170506 	}
 170507 	*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db)))
 170508 __7:
 170509 	;
 170510 __6:
 170511 	;
 170512 	Xsqlite3_free(tls, zSql)
 170513 	if !(rc != 0) {
 170514 		goto __8
 170515 	}
 170516 	goto geopolyInit_fail
 170517 __8:
 170518 	;
 170519 	(*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = U8(8 + int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)*4)
 170520 
 170521 	rc = getNodeSize(tls, db, pRtree, isCreate, pzErr)
 170522 	if !(rc != 0) {
 170523 		goto __9
 170524 	}
 170525 	goto geopolyInit_fail
 170526 __9:
 170527 	;
 170528 	rc = rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate)
 170529 	if !(rc != 0) {
 170530 		goto __10
 170531 	}
 170532 	*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp+24, Xsqlite3_errmsg(tls, db)))
 170533 	goto geopolyInit_fail
 170534 __10:
 170535 	;
 170536 	*(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree
 170537 	return SQLITE_OK
 170538 
 170539 geopolyInit_fail:
 170540 	if !(rc == SQLITE_OK) {
 170541 		goto __11
 170542 	}
 170543 	rc = SQLITE_ERROR
 170544 __11:
 170545 	;
 170546 	rtreeRelease(tls, pRtree)
 170547 	return rc
 170548 }
 170549 
 170550 func geopolyCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 {
 170551 	return geopolyInit(tls, db, pAux, argc, argv, ppVtab, pzErr, 1)
 170552 }
 170553 
 170554 func geopolyConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 {
 170555 	return geopolyInit(tls, db, pAux, argc, argv, ppVtab, pzErr, 0)
 170556 }
 170557 
 170558 func geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 {
 170559 	bp := tls.Alloc(52)
 170560 	defer tls.Free(52)
 170561 
 170562 	var pRtree uintptr
 170563 	var pCsr uintptr
 170564 
 170565 	var p uintptr
 170566 	var iRowid I64
 170567 
 170568 	var p1 uintptr
 170569 	var pNew uintptr
 170570 	pRtree = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pVtabCursor)).FpVtab
 170571 	pCsr = pVtabCursor
 170572 	*(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0)
 170573 	*(*int32)(unsafe.Pointer(bp + 48)) = SQLITE_OK
 170574 	*(*int32)(unsafe.Pointer(bp + 16)) = 0
 170575 	_ = idxStr
 170576 
 170577 	rtreeReference(tls, pRtree)
 170578 
 170579 	resetCursor(tls, pCsr)
 170580 
 170581 	(*RtreeCursor)(unsafe.Pointer(pCsr)).FiStrategy = idxNum
 170582 	if !(idxNum == 1) {
 170583 		goto __1
 170584 	}
 170585 	iRowid = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv)))
 170586 	*(*I64)(unsafe.Pointer(bp + 8)) = int64(0)
 170587 	*(*int32)(unsafe.Pointer(bp + 48)) = findLeafNode(tls, pRtree, iRowid, bp, bp+8)
 170588 	if !(*(*int32)(unsafe.Pointer(bp + 48)) == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0)) {
 170589 		goto __3
 170590 	}
 170591 	p = rtreeSearchPointNew(tls, pCsr, 0.0, uint8(0))
 170592 
 170593 	*(*uintptr)(unsafe.Pointer(pCsr + 88)) = *(*uintptr)(unsafe.Pointer(bp))
 170594 	(*RtreeSearchPoint)(unsafe.Pointer(p)).Fid = *(*I64)(unsafe.Pointer(bp + 8))
 170595 	(*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = U8(PARTLY_WITHIN)
 170596 	*(*int32)(unsafe.Pointer(bp + 48)) = nodeRowidIndex(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp)), iRowid, bp+16)
 170597 	(*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell = U8(*(*int32)(unsafe.Pointer(bp + 16)))
 170598 
 170599 	goto __4
 170600 __3:
 170601 	(*RtreeCursor)(unsafe.Pointer(pCsr)).FatEOF = U8(1)
 170602 __4:
 170603 	;
 170604 	goto __2
 170605 __1:
 170606 	*(*int32)(unsafe.Pointer(bp + 48)) = nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp+24)
 170607 	if !(*(*int32)(unsafe.Pointer(bp + 48)) == SQLITE_OK && idxNum <= 3) {
 170608 		goto __5
 170609 	}
 170610 
 170611 	geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(argv)), bp+32, bp+48)
 170612 	if !(*(*int32)(unsafe.Pointer(bp + 48)) != 0) {
 170613 		goto __6
 170614 	}
 170615 	goto geopoly_filter_end
 170616 __6:
 170617 	;
 170618 	(*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = libc.AssignUintptr(&p1, Xsqlite3_malloc(tls, int32(uint64(unsafe.Sizeof(RtreeConstraint{}))*uint64(4))))
 170619 	(*RtreeCursor)(unsafe.Pointer(pCsr)).FnConstraint = 4
 170620 	if !(p1 == uintptr(0)) {
 170621 		goto __7
 170622 	}
 170623 	*(*int32)(unsafe.Pointer(bp + 48)) = SQLITE_NOMEM
 170624 	goto __8
 170625 __7:
 170626 	libc.Xmemset(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint, 0, uint64(unsafe.Sizeof(RtreeConstraint{}))*uint64(4))
 170627 	libc.Xmemset(tls, pCsr+128, 0, uint64(unsafe.Sizeof(U32(0)))*uint64((*Rtree)(unsafe.Pointer(pRtree)).FiDepth+1))
 170628 	if !(idxNum == 2) {
 170629 		goto __9
 170630 	}
 170631 
 170632 	(*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'B'
 170633 	(*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 0
 170634 	*(*RtreeDValue)(unsafe.Pointer(p1 + 8)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 32 + 1*4)))
 170635 	p1 += 24
 170636 	(*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'D'
 170637 	(*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 1
 170638 	*(*RtreeDValue)(unsafe.Pointer(p1 + 8)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 32)))
 170639 	p1 += 24
 170640 	(*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'B'
 170641 	(*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 2
 170642 	*(*RtreeDValue)(unsafe.Pointer(p1 + 8)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 32 + 3*4)))
 170643 	p1 += 24
 170644 	(*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'D'
 170645 	(*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 3
 170646 	*(*RtreeDValue)(unsafe.Pointer(p1 + 8)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 32 + 2*4)))
 170647 	goto __10
 170648 __9:
 170649 	(*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'D'
 170650 	(*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 0
 170651 	*(*RtreeDValue)(unsafe.Pointer(p1 + 8)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 32)))
 170652 	p1 += 24
 170653 	(*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'B'
 170654 	(*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 1
 170655 	*(*RtreeDValue)(unsafe.Pointer(p1 + 8)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 32 + 1*4)))
 170656 	p1 += 24
 170657 	(*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'D'
 170658 	(*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 2
 170659 	*(*RtreeDValue)(unsafe.Pointer(p1 + 8)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 32 + 2*4)))
 170660 	p1 += 24
 170661 	(*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'B'
 170662 	(*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 3
 170663 	*(*RtreeDValue)(unsafe.Pointer(p1 + 8)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 32 + 3*4)))
 170664 __10:
 170665 	;
 170666 __8:
 170667 	;
 170668 __5:
 170669 	;
 170670 	if !(*(*int32)(unsafe.Pointer(bp + 48)) == SQLITE_OK) {
 170671 		goto __11
 170672 	}
 170673 	pNew = rtreeSearchPointNew(tls, pCsr, 0.0, U8((*Rtree)(unsafe.Pointer(pRtree)).FiDepth+1))
 170674 	if !(pNew == uintptr(0)) {
 170675 		goto __12
 170676 	}
 170677 	*(*int32)(unsafe.Pointer(bp + 48)) = SQLITE_NOMEM
 170678 	goto geopoly_filter_end
 170679 __12:
 170680 	;
 170681 	(*RtreeSearchPoint)(unsafe.Pointer(pNew)).Fid = int64(1)
 170682 	(*RtreeSearchPoint)(unsafe.Pointer(pNew)).FiCell = U8(0)
 170683 	(*RtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = U8(PARTLY_WITHIN)
 170684 
 170685 	*(*uintptr)(unsafe.Pointer(pCsr + 88)) = *(*uintptr)(unsafe.Pointer(bp + 24))
 170686 	*(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0)
 170687 
 170688 	*(*int32)(unsafe.Pointer(bp + 48)) = rtreeStepToLeaf(tls, pCsr)
 170689 __11:
 170690 	;
 170691 __2:
 170692 	;
 170693 geopoly_filter_end:
 170694 	nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 24)))
 170695 	rtreeRelease(tls, pRtree)
 170696 	return *(*int32)(unsafe.Pointer(bp + 48))
 170697 }
 170698 
 170699 func geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 {
 170700 	var ii int32
 170701 	var iRowidTerm int32 = -1
 170702 	var iFuncTerm int32 = -1
 170703 	var idxNum int32 = 0
 170704 	_ = tab
 170705 
 170706 	for ii = 0; ii < (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint; ii++ {
 170707 		var p uintptr = (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(ii)*12
 170708 		if !(int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable) != 0) {
 170709 			continue
 170710 		}
 170711 		if (*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn < 0 && int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_EQ {
 170712 			iRowidTerm = ii
 170713 			break
 170714 		}
 170715 		if (*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn == 0 && int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) >= SQLITE_INDEX_CONSTRAINT_FUNCTION {
 170716 			iFuncTerm = ii
 170717 			idxNum = int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) - SQLITE_INDEX_CONSTRAINT_FUNCTION + 2
 170718 		}
 170719 	}
 170720 
 170721 	if iRowidTerm >= 0 {
 170722 		(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 1
 170723 		(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 17625
 170724 		(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8)).FargvIndex = 1
 170725 		(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8)).Fomit = uint8(1)
 170726 		(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 30.0
 170727 		(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(1)
 170728 		(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxFlags = SQLITE_INDEX_SCAN_UNIQUE
 170729 		return SQLITE_OK
 170730 	}
 170731 	if iFuncTerm >= 0 {
 170732 		(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = idxNum
 170733 		(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 28990
 170734 		(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8)).FargvIndex = 1
 170735 		(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8)).Fomit = uint8(0)
 170736 		(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 300.0
 170737 		(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(10)
 170738 		return SQLITE_OK
 170739 	}
 170740 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 4
 170741 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 28996
 170742 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 3000000.0
 170743 	(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000)
 170744 	return SQLITE_OK
 170745 }
 170746 
 170747 func geopolyColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 {
 170748 	bp := tls.Alloc(4)
 170749 	defer tls.Free(4)
 170750 
 170751 	var pRtree uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab
 170752 	var pCsr uintptr = cur
 170753 	var p uintptr = rtreeSearchPointFirst(tls, pCsr)
 170754 	*(*int32)(unsafe.Pointer(bp)) = SQLITE_OK
 170755 	var pNode uintptr = rtreeNodeOfFirstSearchPoint(tls, pCsr, bp)
 170756 
 170757 	if *(*int32)(unsafe.Pointer(bp)) != 0 {
 170758 		return *(*int32)(unsafe.Pointer(bp))
 170759 	}
 170760 	if p == uintptr(0) {
 170761 		return SQLITE_OK
 170762 	}
 170763 	if i == 0 && Xsqlite3_vtab_nochange(tls, ctx) != 0 {
 170764 		return SQLITE_OK
 170765 	}
 170766 	if i <= int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux) {
 170767 		if !(int32((*RtreeCursor)(unsafe.Pointer(pCsr)).FbAuxValid) != 0) {
 170768 			if (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux == uintptr(0) {
 170769 				*(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v3(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, (*Rtree)(unsafe.Pointer(pRtree)).FzReadAuxSql, -1, uint32(0),
 170770 					pCsr+56, uintptr(0))
 170771 				if *(*int32)(unsafe.Pointer(bp)) != 0 {
 170772 					return *(*int32)(unsafe.Pointer(bp))
 170773 				}
 170774 			}
 170775 			Xsqlite3_bind_int64(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux, 1,
 170776 				nodeGetRowid(tls, pRtree, pNode, int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell)))
 170777 			*(*int32)(unsafe.Pointer(bp)) = Xsqlite3_step(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux)
 170778 			if *(*int32)(unsafe.Pointer(bp)) == SQLITE_ROW {
 170779 				(*RtreeCursor)(unsafe.Pointer(pCsr)).FbAuxValid = U8(1)
 170780 			} else {
 170781 				Xsqlite3_reset(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux)
 170782 				if *(*int32)(unsafe.Pointer(bp)) == SQLITE_DONE {
 170783 					*(*int32)(unsafe.Pointer(bp)) = SQLITE_OK
 170784 				}
 170785 				return *(*int32)(unsafe.Pointer(bp))
 170786 			}
 170787 		}
 170788 		Xsqlite3_result_value(tls, ctx, Xsqlite3_column_value(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux, i+2))
 170789 	}
 170790 	return SQLITE_OK
 170791 }
 170792 
 170793 func geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRowid uintptr) int32 {
 170794 	bp := tls.Alloc(64)
 170795 	defer tls.Free(64)
 170796 
 170797 	var pRtree uintptr
 170798 
 170799 	var oldRowid I64
 170800 	var oldRowidValid int32
 170801 	var newRowid I64
 170802 	var newRowidValid int32
 170803 	var coordChange int32
 170804 	var steprc int32
 170805 	var rc2 int32
 170806 
 170807 	var p uintptr
 170808 	var pUp uintptr
 170809 	var jj int32
 170810 	var nChange int32
 170811 	pRtree = pVtab
 170812 	*(*int32)(unsafe.Pointer(bp + 48)) = SQLITE_OK
 170813 	coordChange = 0
 170814 
 170815 	if !((*Rtree)(unsafe.Pointer(pRtree)).FnNodeRef != 0) {
 170816 		goto __1
 170817 	}
 170818 
 170819 	return SQLITE_LOCKED | int32(2)<<8
 170820 __1:
 170821 	;
 170822 	rtreeReference(tls, pRtree)
 170823 
 170824 	oldRowidValid = libc.Bool32(Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(aData))) != SQLITE_NULL)
 170825 
 170826 	if oldRowidValid != 0 {
 170827 		oldRowid = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(aData)))
 170828 	} else {
 170829 		oldRowid = int64(0)
 170830 	}
 170831 	newRowidValid = libc.Bool32(nData > 1 && Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(aData + 1*8))) != SQLITE_NULL)
 170832 	if newRowidValid != 0 {
 170833 		newRowid = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(aData + 1*8)))
 170834 	} else {
 170835 		newRowid = int64(0)
 170836 	}
 170837 	(*RtreeCell)(unsafe.Pointer(bp)).FiRowid = newRowid
 170838 
 170839 	if !(nData > 1 &&
 170840 		(!(oldRowidValid != 0) ||
 170841 			!(Xsqlite3_value_nochange(tls, *(*uintptr)(unsafe.Pointer(aData + 2*8))) != 0) ||
 170842 			oldRowid != newRowid)) {
 170843 		goto __2
 170844 	}
 170845 
 170846 	geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + 2*8)), bp+8, bp+48)
 170847 	if !(*(*int32)(unsafe.Pointer(bp + 48)) != 0) {
 170848 		goto __3
 170849 	}
 170850 	if !(*(*int32)(unsafe.Pointer(bp + 48)) == SQLITE_ERROR) {
 170851 		goto __4
 170852 	}
 170853 	(*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, ts+29005, 0)
 170854 __4:
 170855 	;
 170856 	goto geopoly_update_end
 170857 __3:
 170858 	;
 170859 	coordChange = 1
 170860 
 170861 	if !(newRowidValid != 0 && (!(oldRowidValid != 0) || oldRowid != newRowid)) {
 170862 		goto __5
 170863 	}
 170864 	Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid, 1, (*RtreeCell)(unsafe.Pointer(bp)).FiRowid)
 170865 	steprc = Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid)
 170866 	*(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid)
 170867 	if !(SQLITE_ROW == steprc) {
 170868 		goto __6
 170869 	}
 170870 	if !(Xsqlite3_vtab_on_conflict(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb) == SQLITE_REPLACE) {
 170871 		goto __7
 170872 	}
 170873 	*(*int32)(unsafe.Pointer(bp + 48)) = rtreeDeleteRowid(tls, pRtree, (*RtreeCell)(unsafe.Pointer(bp)).FiRowid)
 170874 	goto __8
 170875 __7:
 170876 	*(*int32)(unsafe.Pointer(bp + 48)) = rtreeConstraintError(tls, pRtree, 0)
 170877 __8:
 170878 	;
 170879 __6:
 170880 	;
 170881 __5:
 170882 	;
 170883 __2:
 170884 	;
 170885 	if !(*(*int32)(unsafe.Pointer(bp + 48)) == SQLITE_OK && (nData == 1 || coordChange != 0 && oldRowidValid != 0)) {
 170886 		goto __9
 170887 	}
 170888 	*(*int32)(unsafe.Pointer(bp + 48)) = rtreeDeleteRowid(tls, pRtree, oldRowid)
 170889 __9:
 170890 	;
 170891 	if !(*(*int32)(unsafe.Pointer(bp + 48)) == SQLITE_OK && nData > 1 && coordChange != 0) {
 170892 		goto __10
 170893 	}
 170894 
 170895 	*(*uintptr)(unsafe.Pointer(bp + 56)) = uintptr(0)
 170896 	if !!(newRowidValid != 0) {
 170897 		goto __11
 170898 	}
 170899 	*(*int32)(unsafe.Pointer(bp + 48)) = rtreeNewRowid(tls, pRtree, bp)
 170900 __11:
 170901 	;
 170902 	*(*Sqlite_int64)(unsafe.Pointer(pRowid)) = (*RtreeCell)(unsafe.Pointer(bp)).FiRowid
 170903 	if !(*(*int32)(unsafe.Pointer(bp + 48)) == SQLITE_OK) {
 170904 		goto __12
 170905 	}
 170906 	*(*int32)(unsafe.Pointer(bp + 48)) = sChooseLeaf(tls, pRtree, bp, 0, bp+56)
 170907 __12:
 170908 	;
 170909 	if !(*(*int32)(unsafe.Pointer(bp + 48)) == SQLITE_OK) {
 170910 		goto __13
 170911 	}
 170912 	(*Rtree)(unsafe.Pointer(pRtree)).FiReinsertHeight = -1
 170913 	*(*int32)(unsafe.Pointer(bp + 48)) = rtreeInsertCell(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 56)), bp, 0)
 170914 	rc2 = nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 56)))
 170915 	if !(*(*int32)(unsafe.Pointer(bp + 48)) == SQLITE_OK) {
 170916 		goto __14
 170917 	}
 170918 	*(*int32)(unsafe.Pointer(bp + 48)) = rc2
 170919 __14:
 170920 	;
 170921 __13:
 170922 	;
 170923 __10:
 170924 	;
 170925 	if !(*(*int32)(unsafe.Pointer(bp + 48)) == SQLITE_OK && nData > 1) {
 170926 		goto __15
 170927 	}
 170928 	pUp = (*Rtree)(unsafe.Pointer(pRtree)).FpWriteAux
 170929 	nChange = 0
 170930 	Xsqlite3_bind_int64(tls, pUp, 1, (*RtreeCell)(unsafe.Pointer(bp)).FiRowid)
 170931 
 170932 	if !(Xsqlite3_value_nochange(tls, *(*uintptr)(unsafe.Pointer(aData + 2*8))) != 0) {
 170933 		goto __16
 170934 	}
 170935 	Xsqlite3_bind_null(tls, pUp, 2)
 170936 	goto __17
 170937 __16:
 170938 	p = uintptr(0)
 170939 	if !(Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(aData + 2*8))) == SQLITE_TEXT &&
 170940 		libc.AssignUintptr(&p, geopolyFuncParam(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + 2*8)), bp+48)) != uintptr(0) &&
 170941 		*(*int32)(unsafe.Pointer(bp + 48)) == SQLITE_OK) {
 170942 		goto __18
 170943 	}
 170944 	Xsqlite3_bind_blob(tls, pUp, 2, p+4, 4+8*(*GeoPoly)(unsafe.Pointer(p)).FnVertex, libc.UintptrFromInt32(-1))
 170945 	goto __19
 170946 __18:
 170947 	Xsqlite3_bind_value(tls, pUp, 2, *(*uintptr)(unsafe.Pointer(aData + 2*8)))
 170948 __19:
 170949 	;
 170950 	Xsqlite3_free(tls, p)
 170951 	nChange = 1
 170952 __17:
 170953 	;
 170954 	jj = 1
 170955 __20:
 170956 	if !(jj < nData-2) {
 170957 		goto __22
 170958 	}
 170959 	nChange++
 170960 	Xsqlite3_bind_value(tls, pUp, jj+2, *(*uintptr)(unsafe.Pointer(aData + uintptr(jj+2)*8)))
 170961 	goto __21
 170962 __21:
 170963 	jj++
 170964 	goto __20
 170965 	goto __22
 170966 __22:
 170967 	;
 170968 	if !(nChange != 0) {
 170969 		goto __23
 170970 	}
 170971 	Xsqlite3_step(tls, pUp)
 170972 	*(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_reset(tls, pUp)
 170973 __23:
 170974 	;
 170975 __15:
 170976 	;
 170977 geopoly_update_end:
 170978 	rtreeRelease(tls, pRtree)
 170979 	return *(*int32)(unsafe.Pointer(bp + 48))
 170980 }
 170981 
 170982 func geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) int32 {
 170983 	_ = pVtab
 170984 	_ = nArg
 170985 	if Xsqlite3_stricmp(tls, zName, ts+29045) == 0 {
 170986 		*(*uintptr)(unsafe.Pointer(pxFunc)) = *(*uintptr)(unsafe.Pointer(&struct {
 170987 			f func(*libc.TLS, uintptr, int32, uintptr)
 170988 		}{geopolyOverlapFunc}))
 170989 		*(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0)
 170990 		return SQLITE_INDEX_CONSTRAINT_FUNCTION
 170991 	}
 170992 	if Xsqlite3_stricmp(tls, zName, ts+29061) == 0 {
 170993 		*(*uintptr)(unsafe.Pointer(pxFunc)) = *(*uintptr)(unsafe.Pointer(&struct {
 170994 			f func(*libc.TLS, uintptr, int32, uintptr)
 170995 		}{geopolyWithinFunc}))
 170996 		*(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0)
 170997 		return SQLITE_INDEX_CONSTRAINT_FUNCTION + 1
 170998 	}
 170999 	return 0
 171000 }
 171001 
 171002 var geopolyModule = Sqlite3_module{
 171003 	FiVersion:      3,
 171004 	FxCreate:       0,
 171005 	FxConnect:      0,
 171006 	FxBestIndex:    0,
 171007 	FxDisconnect:   0,
 171008 	FxDestroy:      0,
 171009 	FxOpen:         0,
 171010 	FxClose:        0,
 171011 	FxFilter:       0,
 171012 	FxNext:         0,
 171013 	FxEof:          0,
 171014 	FxColumn:       0,
 171015 	FxRowid:        0,
 171016 	FxUpdate:       0,
 171017 	FxBegin:        0,
 171018 	FxSync:         0,
 171019 	FxCommit:       0,
 171020 	FxRollback:     0,
 171021 	FxFindFunction: 0,
 171022 	FxRename:       0,
 171023 	FxSavepoint:    0,
 171024 	FxShadowName:   0,
 171025 }
 171026 
 171027 func sqlite3_geopoly_init(tls *libc.TLS, db uintptr) int32 {
 171028 	var rc int32 = SQLITE_OK
 171029 	var i uint32
 171030 	for i = uint32(0); uint64(i) < uint64(unsafe.Sizeof(aFunc))/uint64(unsafe.Sizeof(struct {
 171031 		FxFunc       uintptr
 171032 		FnArg        int8
 171033 		FbPure       uint8
 171034 		F__ccgo_pad1 [6]byte
 171035 		FzName       uintptr
 171036 	}{})) && rc == SQLITE_OK; i++ {
 171037 		var enc int32
 171038 		if aFunc[i].FbPure != 0 {
 171039 			enc = SQLITE_UTF8 | SQLITE_DETERMINISTIC | SQLITE_INNOCUOUS
 171040 		} else {
 171041 			enc = SQLITE_UTF8 | SQLITE_DIRECTONLY
 171042 		}
 171043 		rc = Xsqlite3_create_function(tls, db, aFunc[i].FzName, int32(aFunc[i].FnArg),
 171044 			enc, uintptr(0),
 171045 			aFunc[i].FxFunc, uintptr(0), uintptr(0))
 171046 	}
 171047 	for i = uint32(0); uint64(i) < uint64(unsafe.Sizeof(aAgg))/uint64(unsafe.Sizeof(struct {
 171048 		FxStep  uintptr
 171049 		FxFinal uintptr
 171050 		FzName  uintptr
 171051 	}{})) && rc == SQLITE_OK; i++ {
 171052 		rc = Xsqlite3_create_function(tls, db, aAgg[i].FzName, 1,
 171053 			SQLITE_UTF8|SQLITE_DETERMINISTIC|SQLITE_INNOCUOUS, uintptr(0),
 171054 			uintptr(0), aAgg[i].FxStep, aAgg[i].FxFinal)
 171055 	}
 171056 	if rc == SQLITE_OK {
 171057 		rc = Xsqlite3_create_module_v2(tls, db, ts+29076, uintptr(unsafe.Pointer(&geopolyModule)), uintptr(0), uintptr(0))
 171058 	}
 171059 	return rc
 171060 }
 171061 
 171062 var aFunc = [12]struct {
 171063 	FxFunc       uintptr
 171064 	FnArg        int8
 171065 	FbPure       uint8
 171066 	F__ccgo_pad1 [6]byte
 171067 	FzName       uintptr
 171068 }{
 171069 	{FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 29084},
 171070 	{FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 29097},
 171071 	{FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 29110},
 171072 	{FxFunc: 0, FnArg: int8(-1), FbPure: uint8(1), FzName: ts + 29123},
 171073 	{FxFunc: 0, FnArg: int8(2), FbPure: uint8(1), FzName: ts + 29061},
 171074 	{FxFunc: 0, FnArg: int8(3), FbPure: uint8(1), FzName: ts + 29135},
 171075 	{FxFunc: 0, FnArg: int8(2), FbPure: uint8(1), FzName: ts + 29045},
 171076 	{FxFunc: 0, FnArg: int8(1), FzName: ts + 29158},
 171077 	{FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 29172},
 171078 	{FxFunc: 0, FnArg: int8(7), FbPure: uint8(1), FzName: ts + 29185},
 171079 	{FxFunc: 0, FnArg: int8(4), FbPure: uint8(1), FzName: ts + 29199},
 171080 	{FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 29215},
 171081 }
 171082 var aAgg = [1]struct {
 171083 	FxStep  uintptr
 171084 	FxFinal uintptr
 171085 	FzName  uintptr
 171086 }{
 171087 	{FxStep: 0, FxFinal: 0, FzName: ts + 29227},
 171088 }
 171089 
 171090 // Register the r-tree module with database handle db. This creates the
 171091 // virtual table module "rtree" and the debugging/analysis scalar
 171092 // function "rtreenode".
 171093 func Xsqlite3RtreeInit(tls *libc.TLS, db uintptr) int32 {
 171094 	var utf8 int32 = SQLITE_UTF8
 171095 	var rc int32
 171096 
 171097 	rc = Xsqlite3_create_function(tls, db, ts+29246, 2, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
 171098 		f func(*libc.TLS, uintptr, int32, uintptr)
 171099 	}{rtreenode})), uintptr(0), uintptr(0))
 171100 	if rc == SQLITE_OK {
 171101 		rc = Xsqlite3_create_function(tls, db, ts+29256, 1, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
 171102 			f func(*libc.TLS, uintptr, int32, uintptr)
 171103 		}{rtreedepth})), uintptr(0), uintptr(0))
 171104 	}
 171105 	if rc == SQLITE_OK {
 171106 		rc = Xsqlite3_create_function(tls, db, ts+29267, -1, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
 171107 			f func(*libc.TLS, uintptr, int32, uintptr)
 171108 		}{rtreecheck})), uintptr(0), uintptr(0))
 171109 	}
 171110 	if rc == SQLITE_OK {
 171111 		var c uintptr = uintptr(RTREE_COORD_REAL32)
 171112 		rc = Xsqlite3_create_module_v2(tls, db, ts+28990, uintptr(unsafe.Pointer(&rtreeModule)), c, uintptr(0))
 171113 	}
 171114 	if rc == SQLITE_OK {
 171115 		var c uintptr = uintptr(RTREE_COORD_INT32)
 171116 		rc = Xsqlite3_create_module_v2(tls, db, ts+29278, uintptr(unsafe.Pointer(&rtreeModule)), c, uintptr(0))
 171117 	}
 171118 	if rc == SQLITE_OK {
 171119 		rc = sqlite3_geopoly_init(tls, db)
 171120 	}
 171121 
 171122 	return rc
 171123 }
 171124 
 171125 func rtreeFreeCallback(tls *libc.TLS, p uintptr) {
 171126 	var pInfo uintptr = p
 171127 	if (*RtreeGeomCallback)(unsafe.Pointer(pInfo)).FxDestructor != 0 {
 171128 		(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*RtreeGeomCallback)(unsafe.Pointer(pInfo)).FxDestructor})).f(tls, (*RtreeGeomCallback)(unsafe.Pointer(pInfo)).FpContext)
 171129 	}
 171130 	Xsqlite3_free(tls, p)
 171131 }
 171132 
 171133 func rtreeMatchArgFree(tls *libc.TLS, pArg uintptr) {
 171134 	var i int32
 171135 	var p uintptr = pArg
 171136 	for i = 0; i < (*RtreeMatchArg)(unsafe.Pointer(p)).FnParam; i++ {
 171137 		Xsqlite3_value_free(tls, *(*uintptr)(unsafe.Pointer((*RtreeMatchArg)(unsafe.Pointer(p)).FapSqlParam + uintptr(i)*8)))
 171138 	}
 171139 	Xsqlite3_free(tls, p)
 171140 }
 171141 
 171142 func geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) {
 171143 	var pGeomCtx uintptr = Xsqlite3_user_data(tls, ctx)
 171144 	var pBlob uintptr
 171145 	var nBlob Sqlite3_int64
 171146 	var memErr int32 = 0
 171147 
 171148 	nBlob = Sqlite3_int64(uint64(unsafe.Sizeof(RtreeMatchArg{})) + uint64(nArg-1)*uint64(unsafe.Sizeof(RtreeDValue(0))) +
 171149 		uint64(nArg)*uint64(unsafe.Sizeof(uintptr(0))))
 171150 	pBlob = Xsqlite3_malloc64(tls, uint64(nBlob))
 171151 	if !(pBlob != 0) {
 171152 		Xsqlite3_result_error_nomem(tls, ctx)
 171153 	} else {
 171154 		var i int32
 171155 		(*RtreeMatchArg)(unsafe.Pointer(pBlob)).FiSize = U32(nBlob)
 171156 		(*RtreeMatchArg)(unsafe.Pointer(pBlob)).Fcb = *(*RtreeGeomCallback)(unsafe.Pointer(pGeomCtx))
 171157 		(*RtreeMatchArg)(unsafe.Pointer(pBlob)).FapSqlParam = pBlob + 56 + uintptr(nArg)*8
 171158 		(*RtreeMatchArg)(unsafe.Pointer(pBlob)).FnParam = nArg
 171159 		for i = 0; i < nArg; i++ {
 171160 			*(*uintptr)(unsafe.Pointer((*RtreeMatchArg)(unsafe.Pointer(pBlob)).FapSqlParam + uintptr(i)*8)) = Xsqlite3_value_dup(tls, *(*uintptr)(unsafe.Pointer(aArg + uintptr(i)*8)))
 171161 			if *(*uintptr)(unsafe.Pointer((*RtreeMatchArg)(unsafe.Pointer(pBlob)).FapSqlParam + uintptr(i)*8)) == uintptr(0) {
 171162 				memErr = 1
 171163 			}
 171164 			*(*RtreeDValue)(unsafe.Pointer(pBlob + 56 + uintptr(i)*8)) = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(aArg + uintptr(i)*8)))
 171165 		}
 171166 		if memErr != 0 {
 171167 			Xsqlite3_result_error_nomem(tls, ctx)
 171168 			rtreeMatchArgFree(tls, pBlob)
 171169 		} else {
 171170 			Xsqlite3_result_pointer(tls, ctx, pBlob, ts+26566, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{rtreeMatchArgFree})))
 171171 		}
 171172 	}
 171173 }
 171174 
 171175 // Register a new geometry function for use with the r-tree MATCH operator.
 171176 func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, xGeom uintptr, pContext uintptr) int32 {
 171177 	var pGeomCtx uintptr
 171178 
 171179 	pGeomCtx = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(RtreeGeomCallback{})))
 171180 	if !(pGeomCtx != 0) {
 171181 		return SQLITE_NOMEM
 171182 	}
 171183 	(*RtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = xGeom
 171184 	(*RtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = uintptr(0)
 171185 	(*RtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = uintptr(0)
 171186 	(*RtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext
 171187 	return Xsqlite3_create_function_v2(tls, db, zGeom, -1, SQLITE_ANY,
 171188 		pGeomCtx, *(*uintptr)(unsafe.Pointer(&struct {
 171189 			f func(*libc.TLS, uintptr, int32, uintptr)
 171190 		}{geomCallback})), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{rtreeFreeCallback})))
 171191 }
 171192 
 171193 // Register a new 2nd-generation geometry function for use with the
 171194 // r-tree MATCH operator.
 171195 func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, xQueryFunc uintptr, pContext uintptr, xDestructor uintptr) int32 {
 171196 	var pGeomCtx uintptr
 171197 
 171198 	pGeomCtx = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(RtreeGeomCallback{})))
 171199 	if !(pGeomCtx != 0) {
 171200 		if xDestructor != 0 {
 171201 			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{xDestructor})).f(tls, pContext)
 171202 		}
 171203 		return SQLITE_NOMEM
 171204 	}
 171205 	(*RtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = uintptr(0)
 171206 	(*RtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = xQueryFunc
 171207 	(*RtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = xDestructor
 171208 	(*RtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext
 171209 	return Xsqlite3_create_function_v2(tls, db, zQueryFunc, -1, SQLITE_ANY,
 171210 		pGeomCtx, *(*uintptr)(unsafe.Pointer(&struct {
 171211 			f func(*libc.TLS, uintptr, int32, uintptr)
 171212 		}{geomCallback})), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{rtreeFreeCallback})))
 171213 }
 171214 
 171215 type sqlite3rbu = struct {
 171216 	FeStage         int32
 171217 	F__ccgo_pad1    [4]byte
 171218 	FdbMain         uintptr
 171219 	FdbRbu          uintptr
 171220 	FzTarget        uintptr
 171221 	FzRbu           uintptr
 171222 	FzState         uintptr
 171223 	FzStateDb       [5]int8
 171224 	F__ccgo_pad2    [3]byte
 171225 	Frc             int32
 171226 	F__ccgo_pad3    [4]byte
 171227 	FzErrmsg        uintptr
 171228 	FnStep          int32
 171229 	FnProgress      int32
 171230 	Fobjiter        RbuObjIter
 171231 	FzVfsName       uintptr
 171232 	FpTargetFd      uintptr
 171233 	FnPagePerSector int32
 171234 	F__ccgo_pad4    [4]byte
 171235 	FiOalSz         I64
 171236 	FnPhaseOneStep  I64
 171237 	FpRenameArg     uintptr
 171238 	FxRename        uintptr
 171239 	FiMaxFrame      U32
 171240 	FmLock          U32
 171241 	FnFrame         int32
 171242 	FnFrameAlloc    int32
 171243 	FaFrame         uintptr
 171244 	Fpgsz           int32
 171245 	F__ccgo_pad5    [4]byte
 171246 	FaBuf           uintptr
 171247 	FiWalCksum      I64
 171248 	FszTemp         I64
 171249 	FszTempLimit    I64
 171250 	FnRbu           int32
 171251 	F__ccgo_pad6    [4]byte
 171252 	FpRbuFd         uintptr
 171253 }
 171254 
 171255 type Sqlite3rbu = sqlite3rbu
 171256 
 171257 type RbuFrame1 = struct {
 171258 	FiDbPage   U32
 171259 	FiWalFrame U32
 171260 }
 171261 
 171262 type RbuFrame = RbuFrame1
 171263 type RbuObjIter1 = struct {
 171264 	FpTblIter    uintptr
 171265 	FpIdxIter    uintptr
 171266 	FnTblCol     int32
 171267 	F__ccgo_pad1 [4]byte
 171268 	FazTblCol    uintptr
 171269 	FazTblType   uintptr
 171270 	FaiSrcOrder  uintptr
 171271 	FabTblPk     uintptr
 171272 	FabNotNull   uintptr
 171273 	FabIndexed   uintptr
 171274 	FeType       int32
 171275 	FbCleanup    int32
 171276 	FzTbl        uintptr
 171277 	FzDataTbl    uintptr
 171278 	FzIdx        uintptr
 171279 	FiTnum       int32
 171280 	FiPkTnum     int32
 171281 	FbUnique     int32
 171282 	FnIndex      int32
 171283 	FnCol        int32
 171284 	F__ccgo_pad2 [4]byte
 171285 	FpSelect     uintptr
 171286 	FpInsert     uintptr
 171287 	FpDelete     uintptr
 171288 	FpTmpInsert  uintptr
 171289 	FnIdxCol     int32
 171290 	F__ccgo_pad3 [4]byte
 171291 	FaIdxCol     uintptr
 171292 	FzIdxSql     uintptr
 171293 	FpRbuUpdate  uintptr
 171294 }
 171295 
 171296 type RbuObjIter = RbuObjIter1
 171297 type RbuState1 = struct {
 171298 	FeStage        int32
 171299 	F__ccgo_pad1   [4]byte
 171300 	FzTbl          uintptr
 171301 	FzDataTbl      uintptr
 171302 	FzIdx          uintptr
 171303 	FiWalCksum     I64
 171304 	FnRow          int32
 171305 	F__ccgo_pad2   [4]byte
 171306 	FnProgress     I64
 171307 	FiCookie       U32
 171308 	F__ccgo_pad3   [4]byte
 171309 	FiOalSz        I64
 171310 	FnPhaseOneStep I64
 171311 }
 171312 
 171313 type RbuState = RbuState1
 171314 type RbuSpan1 = struct {
 171315 	FzSpan       uintptr
 171316 	FnSpan       int32
 171317 	F__ccgo_pad1 [4]byte
 171318 }
 171319 
 171320 type RbuSpan = RbuSpan1
 171321 type rbu_vfs = struct {
 171322 	Fbase     Sqlite3_vfs
 171323 	FpRealVfs uintptr
 171324 	Fmutex    uintptr
 171325 	FpRbu     uintptr
 171326 	FpMain    uintptr
 171327 	FpMainRbu uintptr
 171328 }
 171329 
 171330 type Rbu_vfs = rbu_vfs
 171331 type rbu_file = struct {
 171332 	Fbase         Sqlite3_file
 171333 	FpReal        uintptr
 171334 	FpRbuVfs      uintptr
 171335 	FpRbu         uintptr
 171336 	Fsz           I64
 171337 	FopenFlags    int32
 171338 	FiCookie      U32
 171339 	FiWriteVer    U8
 171340 	FbNolock      U8
 171341 	F__ccgo_pad1  [2]byte
 171342 	FnShm         int32
 171343 	FapShm        uintptr
 171344 	FzDel         uintptr
 171345 	FzWal         uintptr
 171346 	FpWalFd       uintptr
 171347 	FpMainNext    uintptr
 171348 	FpMainRbuNext uintptr
 171349 }
 171350 
 171351 type Rbu_file = rbu_file
 171352 type RbuUpdateStmt1 = struct {
 171353 	FzMask   uintptr
 171354 	FpUpdate uintptr
 171355 	FpNext   uintptr
 171356 }
 171357 
 171358 type RbuUpdateStmt = RbuUpdateStmt1
 171359 
 171360 func rbuDeltaGetInt(tls *libc.TLS, pz uintptr, pLen uintptr) uint32 {
 171361 	var v uint32 = uint32(0)
 171362 	var c int32
 171363 	var z uintptr = *(*uintptr)(unsafe.Pointer(pz))
 171364 	var zStart uintptr = z
 171365 	for libc.AssignInt32(&c, int32(zValue[0x7f&int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))])) >= 0 {
 171366 		v = v<<6 + uint32(c)
 171367 	}
 171368 	z--
 171369 	*(*int32)(unsafe.Pointer(pLen)) -= int32((int64(z) - int64(zStart)) / 1)
 171370 	*(*uintptr)(unsafe.Pointer(pz)) = z
 171371 	return v
 171372 }
 171373 
 171374 var zValue = [128]int8{
 171375 	int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1),
 171376 	int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1),
 171377 	int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1),
 171378 	int8(0), int8(1), int8(2), int8(3), int8(4), int8(5), int8(6), int8(7), int8(8), int8(9), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1),
 171379 	int8(-1), int8(10), int8(11), int8(12), int8(13), int8(14), int8(15), int8(16), int8(17), int8(18), int8(19), int8(20), int8(21), int8(22), int8(23), int8(24),
 171380 	int8(25), int8(26), int8(27), int8(28), int8(29), int8(30), int8(31), int8(32), int8(33), int8(34), int8(35), int8(-1), int8(-1), int8(-1), int8(-1), int8(36),
 171381 	int8(-1), int8(37), int8(38), int8(39), int8(40), int8(41), int8(42), int8(43), int8(44), int8(45), int8(46), int8(47), int8(48), int8(49), int8(50), int8(51),
 171382 	int8(52), int8(53), int8(54), int8(55), int8(56), int8(57), int8(58), int8(59), int8(60), int8(61), int8(62), int8(-1), int8(-1), int8(-1), int8(63), int8(-1),
 171383 }
 171384 
 171385 func rbuDeltaApply(tls *libc.TLS, zSrc uintptr, lenSrc int32, zDelta uintptr, lenDelta int32, zOut uintptr) int32 {
 171386 	bp := tls.Alloc(12)
 171387 	defer tls.Free(12)
 171388 	*(*uintptr)(unsafe.Pointer(bp)) = zDelta
 171389 	*(*int32)(unsafe.Pointer(bp + 8)) = lenDelta
 171390 
 171391 	var limit uint32
 171392 	var total uint32 = uint32(0)
 171393 
 171394 	limit = rbuDeltaGetInt(tls, bp, bp+8)
 171395 	if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) != '\n' {
 171396 		return -1
 171397 	}
 171398 	*(*uintptr)(unsafe.Pointer(bp))++
 171399 	*(*int32)(unsafe.Pointer(bp + 8))--
 171400 	for *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) != 0 && *(*int32)(unsafe.Pointer(bp + 8)) > 0 {
 171401 		var cnt uint32
 171402 		var ofst uint32
 171403 		cnt = rbuDeltaGetInt(tls, bp, bp+8)
 171404 		switch int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) {
 171405 		case '@':
 171406 			{
 171407 				*(*uintptr)(unsafe.Pointer(bp))++
 171408 				*(*int32)(unsafe.Pointer(bp + 8))--
 171409 				ofst = rbuDeltaGetInt(tls, bp, bp+8)
 171410 				if *(*int32)(unsafe.Pointer(bp + 8)) > 0 && int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) != ',' {
 171411 					return -1
 171412 				}
 171413 				*(*uintptr)(unsafe.Pointer(bp))++
 171414 				*(*int32)(unsafe.Pointer(bp + 8))--
 171415 				total = total + cnt
 171416 				if total > limit {
 171417 					return -1
 171418 				}
 171419 				if int32(ofst+cnt) > lenSrc {
 171420 					return -1
 171421 				}
 171422 				libc.Xmemcpy(tls, zOut, zSrc+uintptr(ofst), uint64(cnt))
 171423 				zOut += uintptr(cnt)
 171424 				break
 171425 
 171426 			}
 171427 		case ':':
 171428 			{
 171429 				*(*uintptr)(unsafe.Pointer(bp))++
 171430 				*(*int32)(unsafe.Pointer(bp + 8))--
 171431 				total = total + cnt
 171432 				if total > limit {
 171433 					return -1
 171434 				}
 171435 				if int32(cnt) > *(*int32)(unsafe.Pointer(bp + 8)) {
 171436 					return -1
 171437 				}
 171438 				libc.Xmemcpy(tls, zOut, *(*uintptr)(unsafe.Pointer(bp)), uint64(cnt))
 171439 				zOut += uintptr(cnt)
 171440 				*(*uintptr)(unsafe.Pointer(bp)) += uintptr(cnt)
 171441 				*(*int32)(unsafe.Pointer(bp + 8)) -= int32(cnt)
 171442 				break
 171443 
 171444 			}
 171445 		case ';':
 171446 			{
 171447 				*(*uintptr)(unsafe.Pointer(bp))++
 171448 				*(*int32)(unsafe.Pointer(bp + 8))--
 171449 				*(*int8)(unsafe.Pointer(zOut)) = int8(0)
 171450 				if total != limit {
 171451 					return -1
 171452 				}
 171453 				return int32(total)
 171454 
 171455 			}
 171456 		default:
 171457 			{
 171458 				return -1
 171459 
 171460 			}
 171461 		}
 171462 	}
 171463 
 171464 	return -1
 171465 }
 171466 
 171467 func rbuDeltaOutputSize(tls *libc.TLS, zDelta uintptr, lenDelta int32) int32 {
 171468 	bp := tls.Alloc(12)
 171469 	defer tls.Free(12)
 171470 	*(*uintptr)(unsafe.Pointer(bp)) = zDelta
 171471 	*(*int32)(unsafe.Pointer(bp + 8)) = lenDelta
 171472 
 171473 	var size int32
 171474 	size = int32(rbuDeltaGetInt(tls, bp, bp+8))
 171475 	if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) != '\n' {
 171476 		return -1
 171477 	}
 171478 	return size
 171479 }
 171480 
 171481 func rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 171482 	var aDelta uintptr
 171483 	var nDelta int32
 171484 	var aOrig uintptr
 171485 	var nOrig int32
 171486 	var nOut int32
 171487 	var nOut2 int32
 171488 	var aOut uintptr
 171489 
 171490 	nOrig = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))
 171491 	aOrig = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv)))
 171492 	nDelta = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 171493 	aDelta = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))
 171494 
 171495 	nOut = rbuDeltaOutputSize(tls, aDelta, nDelta)
 171496 	if nOut < 0 {
 171497 		Xsqlite3_result_error(tls, context, ts+29288, -1)
 171498 		return
 171499 	}
 171500 
 171501 	aOut = Xsqlite3_malloc(tls, nOut+1)
 171502 	if aOut == uintptr(0) {
 171503 		Xsqlite3_result_error_nomem(tls, context)
 171504 	} else {
 171505 		nOut2 = rbuDeltaApply(tls, aOrig, nOrig, aDelta, nDelta, aOut)
 171506 		if nOut2 != nOut {
 171507 			Xsqlite3_free(tls, aOut)
 171508 			Xsqlite3_result_error(tls, context, ts+29288, -1)
 171509 		} else {
 171510 			Xsqlite3_result_blob(tls, context, aOut, nOut, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
 171511 		}
 171512 	}
 171513 }
 171514 
 171515 func prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg uintptr, zSql uintptr) int32 {
 171516 	bp := tls.Alloc(8)
 171517 	defer tls.Free(8)
 171518 
 171519 	var rc int32 = Xsqlite3_prepare_v2(tls, db, zSql, -1, ppStmt, uintptr(0))
 171520 	if rc != SQLITE_OK {
 171521 		*(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp, Xsqlite3_errmsg(tls, db)))
 171522 		*(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0)
 171523 	}
 171524 	return rc
 171525 }
 171526 
 171527 func resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) int32 {
 171528 	bp := tls.Alloc(8)
 171529 	defer tls.Free(8)
 171530 
 171531 	var rc int32 = Xsqlite3_reset(tls, pStmt)
 171532 	if rc != SQLITE_OK {
 171533 		*(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt))))
 171534 	}
 171535 	return rc
 171536 }
 171537 
 171538 func prepareFreeAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg uintptr, zSql uintptr) int32 {
 171539 	var rc int32
 171540 
 171541 	if zSql == uintptr(0) {
 171542 		rc = SQLITE_NOMEM
 171543 		*(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0)
 171544 	} else {
 171545 		rc = prepareAndCollectError(tls, db, ppStmt, pzErrmsg, zSql)
 171546 		Xsqlite3_free(tls, zSql)
 171547 	}
 171548 	return rc
 171549 }
 171550 
 171551 func rbuObjIterFreeCols(tls *libc.TLS, pIter uintptr) {
 171552 	var i int32
 171553 	for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ {
 171554 		Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)))
 171555 		Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(i)*8)))
 171556 	}
 171557 	Xsqlite3_free(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol)
 171558 	(*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol = uintptr(0)
 171559 	(*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType = uintptr(0)
 171560 	(*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder = uintptr(0)
 171561 	(*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk = uintptr(0)
 171562 	(*RbuObjIter)(unsafe.Pointer(pIter)).FabNotNull = uintptr(0)
 171563 	(*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol = 0
 171564 	(*RbuObjIter)(unsafe.Pointer(pIter)).FeType = 0
 171565 }
 171566 
 171567 func rbuObjIterClearStatements(tls *libc.TLS, pIter uintptr) {
 171568 	var pUp uintptr
 171569 
 171570 	Xsqlite3_finalize(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect)
 171571 	Xsqlite3_finalize(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpInsert)
 171572 	Xsqlite3_finalize(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpDelete)
 171573 	Xsqlite3_finalize(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpTmpInsert)
 171574 	pUp = (*RbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate
 171575 	for pUp != 0 {
 171576 		var pTmp uintptr = (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FpNext
 171577 		Xsqlite3_finalize(tls, (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate)
 171578 		Xsqlite3_free(tls, pUp)
 171579 		pUp = pTmp
 171580 	}
 171581 	Xsqlite3_free(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol)
 171582 	Xsqlite3_free(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdxSql)
 171583 
 171584 	(*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect = uintptr(0)
 171585 	(*RbuObjIter)(unsafe.Pointer(pIter)).FpInsert = uintptr(0)
 171586 	(*RbuObjIter)(unsafe.Pointer(pIter)).FpDelete = uintptr(0)
 171587 	(*RbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate = uintptr(0)
 171588 	(*RbuObjIter)(unsafe.Pointer(pIter)).FpTmpInsert = uintptr(0)
 171589 	(*RbuObjIter)(unsafe.Pointer(pIter)).FnCol = 0
 171590 	(*RbuObjIter)(unsafe.Pointer(pIter)).FnIdxCol = 0
 171591 	(*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol = uintptr(0)
 171592 	(*RbuObjIter)(unsafe.Pointer(pIter)).FzIdxSql = uintptr(0)
 171593 }
 171594 
 171595 func rbuObjIterFinalize(tls *libc.TLS, pIter uintptr) {
 171596 	rbuObjIterClearStatements(tls, pIter)
 171597 	Xsqlite3_finalize(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpTblIter)
 171598 	Xsqlite3_finalize(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpIdxIter)
 171599 	rbuObjIterFreeCols(tls, pIter)
 171600 	libc.Xmemset(tls, pIter, 0, uint64(unsafe.Sizeof(RbuObjIter{})))
 171601 }
 171602 
 171603 func rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 {
 171604 	var rc int32 = (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
 171605 	if rc == SQLITE_OK {
 171606 		rbuObjIterClearStatements(tls, pIter)
 171607 		if (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) {
 171608 			rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain,
 171609 				ts+29309, uintptr(0), uintptr(0), p+64)
 171610 		}
 171611 
 171612 		if rc == SQLITE_OK {
 171613 			if (*RbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 {
 171614 				rbuObjIterFreeCols(tls, pIter)
 171615 				(*RbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = 0
 171616 				rc = Xsqlite3_step(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpTblIter)
 171617 				if rc != SQLITE_ROW {
 171618 					rc = resetAndCollectError(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpTblIter, p+64)
 171619 					(*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl = uintptr(0)
 171620 				} else {
 171621 					(*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl = Xsqlite3_column_text(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpTblIter, 0)
 171622 					(*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl = Xsqlite3_column_text(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpTblIter, 1)
 171623 					if (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl != 0 && (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 {
 171624 						rc = SQLITE_OK
 171625 					} else {
 171626 						rc = SQLITE_NOMEM
 171627 					}
 171628 				}
 171629 			} else {
 171630 				if (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) {
 171631 					var pIdx uintptr = (*RbuObjIter)(unsafe.Pointer(pIter)).FpIdxIter
 171632 					rc = Xsqlite3_bind_text(tls, pIdx, 1, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, -1, uintptr(0))
 171633 				}
 171634 				if rc == SQLITE_OK {
 171635 					rc = Xsqlite3_step(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpIdxIter)
 171636 					if rc != SQLITE_ROW {
 171637 						rc = resetAndCollectError(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpIdxIter, p+64)
 171638 						(*RbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = 1
 171639 						(*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx = uintptr(0)
 171640 					} else {
 171641 						(*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx = Xsqlite3_column_text(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpIdxIter, 0)
 171642 						(*RbuObjIter)(unsafe.Pointer(pIter)).FiTnum = Xsqlite3_column_int(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpIdxIter, 1)
 171643 						(*RbuObjIter)(unsafe.Pointer(pIter)).FbUnique = Xsqlite3_column_int(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpIdxIter, 2)
 171644 						if (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx != 0 {
 171645 							rc = SQLITE_OK
 171646 						} else {
 171647 							rc = SQLITE_NOMEM
 171648 						}
 171649 					}
 171650 				}
 171651 			}
 171652 		}
 171653 	}
 171654 
 171655 	if rc != SQLITE_OK {
 171656 		rbuObjIterFinalize(tls, pIter)
 171657 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc
 171658 	}
 171659 	return rc
 171660 }
 171661 
 171662 func rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) {
 171663 	var p uintptr = Xsqlite3_user_data(tls, pCtx)
 171664 	var zIn uintptr
 171665 
 171666 	zIn = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv)))
 171667 	if zIn != 0 {
 171668 		if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
 171669 			if argc == 1 || 0 == Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) {
 171670 				Xsqlite3_result_text(tls, pCtx, zIn, -1, uintptr(0))
 171671 			}
 171672 		} else {
 171673 			if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, ts+26479, zIn, uint64(4)) == 0 {
 171674 				var i int32
 171675 				for i = 4; int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) >= '0' && int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) <= '9'; i++ {
 171676 				}
 171677 				if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) == '_' && *(*int8)(unsafe.Pointer(zIn + uintptr(i+1))) != 0 {
 171678 					Xsqlite3_result_text(tls, pCtx, zIn+uintptr(i+1), -1, uintptr(0))
 171679 				}
 171680 			}
 171681 		}
 171682 	}
 171683 }
 171684 
 171685 func rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) int32 {
 171686 	bp := tls.Alloc(8)
 171687 	defer tls.Free(8)
 171688 
 171689 	var rc int32
 171690 	libc.Xmemset(tls, pIter, 0, uint64(unsafe.Sizeof(RbuObjIter{})))
 171691 
 171692 	rc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64,
 171693 		Xsqlite3_mprintf(tls,
 171694 			ts+29480, libc.VaList(bp, func() uintptr {
 171695 				if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
 171696 					return ts + 29630
 171697 				}
 171698 				return ts + 1544
 171699 			}())))
 171700 
 171701 	if rc == SQLITE_OK {
 171702 		rc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64,
 171703 			ts+29671)
 171704 	}
 171705 
 171706 	(*RbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = 1
 171707 	(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc
 171708 	return rbuObjIterNext(tls, p, pIter)
 171709 }
 171710 
 171711 func rbuMPrintf(tls *libc.TLS, p uintptr, zFmt uintptr, va uintptr) uintptr {
 171712 	var zSql uintptr = uintptr(0)
 171713 	var ap Va_list
 171714 	_ = ap
 171715 	ap = va
 171716 	zSql = Xsqlite3_vmprintf(tls, zFmt, ap)
 171717 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 171718 		if zSql == uintptr(0) {
 171719 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
 171720 		}
 171721 	} else {
 171722 		Xsqlite3_free(tls, zSql)
 171723 		zSql = uintptr(0)
 171724 	}
 171725 	_ = ap
 171726 	return zSql
 171727 }
 171728 
 171729 func rbuMPrintfExec(tls *libc.TLS, p uintptr, db uintptr, zFmt uintptr, va uintptr) int32 {
 171730 	var ap Va_list
 171731 	_ = ap
 171732 	var zSql uintptr
 171733 	ap = va
 171734 	zSql = Xsqlite3_vmprintf(tls, zFmt, ap)
 171735 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 171736 		if zSql == uintptr(0) {
 171737 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
 171738 		} else {
 171739 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, zSql, uintptr(0), uintptr(0), p+64)
 171740 		}
 171741 	}
 171742 	Xsqlite3_free(tls, zSql)
 171743 	_ = ap
 171744 	return (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
 171745 }
 171746 
 171747 func rbuMalloc(tls *libc.TLS, p uintptr, nByte Sqlite3_int64) uintptr {
 171748 	var pRet uintptr = uintptr(0)
 171749 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 171750 		pRet = Xsqlite3_malloc64(tls, uint64(nByte))
 171751 		if pRet == uintptr(0) {
 171752 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
 171753 		} else {
 171754 			libc.Xmemset(tls, pRet, 0, uint64(nByte))
 171755 		}
 171756 	}
 171757 	return pRet
 171758 }
 171759 
 171760 func rbuAllocateIterArrays(tls *libc.TLS, p uintptr, pIter uintptr, nCol int32) {
 171761 	var nByte Sqlite3_int64 = Sqlite3_int64((uint64(2)*uint64(unsafe.Sizeof(uintptr(0))) + uint64(unsafe.Sizeof(int32(0))) + uint64(3)*uint64(unsafe.Sizeof(U8(0)))) * uint64(nCol))
 171762 	var azNew uintptr
 171763 
 171764 	azNew = rbuMalloc(tls, p, nByte)
 171765 	if azNew != 0 {
 171766 		(*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol = azNew
 171767 		(*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType = azNew + uintptr(nCol)*8
 171768 		(*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder = (*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(nCol)*8
 171769 		(*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk = (*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(nCol)*4
 171770 		(*RbuObjIter)(unsafe.Pointer(pIter)).FabNotNull = (*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(nCol)
 171771 		(*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed = (*RbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(nCol)
 171772 	}
 171773 }
 171774 
 171775 func rbuStrndup(tls *libc.TLS, zStr uintptr, pRc uintptr) uintptr {
 171776 	var zRet uintptr = uintptr(0)
 171777 
 171778 	if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
 171779 		if zStr != 0 {
 171780 			var nCopy Size_t = libc.Xstrlen(tls, zStr) + uint64(1)
 171781 			zRet = Xsqlite3_malloc64(tls, nCopy)
 171782 			if zRet != 0 {
 171783 				libc.Xmemcpy(tls, zRet, zStr, nCopy)
 171784 			} else {
 171785 				*(*int32)(unsafe.Pointer(pRc)) = SQLITE_NOMEM
 171786 			}
 171787 		}
 171788 	}
 171789 
 171790 	return zRet
 171791 }
 171792 
 171793 func rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) {
 171794 	bp := tls.Alloc(8)
 171795 	defer tls.Free(8)
 171796 
 171797 	var db uintptr = Xsqlite3_db_handle(tls, pStmt)
 171798 	var rc int32 = Xsqlite3_finalize(tls, pStmt)
 171799 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && rc != SQLITE_OK {
 171800 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc
 171801 		(*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp, Xsqlite3_errmsg(tls, db)))
 171802 	}
 171803 }
 171804 
 171805 func rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnum uintptr, piPk uintptr) {
 171806 	bp := tls.Alloc(64)
 171807 	defer tls.Free(64)
 171808 
 171809 	var zOrig uintptr
 171810 	var zIdx uintptr
 171811 	var i uint32
 171812 	*(*[4]uintptr)(unsafe.Pointer(bp + 32)) = [4]uintptr{uintptr(0), uintptr(0), uintptr(0), uintptr(0)}
 171813 
 171814 	*(*int32)(unsafe.Pointer(peType)) = RBU_PK_NOTABLE
 171815 	*(*int32)(unsafe.Pointer(piPk)) = 0
 171816 
 171817 	(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+32, p+64,
 171818 		Xsqlite3_mprintf(tls,
 171819 			ts+29796, libc.VaList(bp, zTab)))
 171820 	if !((*Sqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK || Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) != SQLITE_ROW) {
 171821 		goto __1
 171822 	}
 171823 
 171824 	goto rbuTableType_end
 171825 __1:
 171826 	;
 171827 	if !(Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), 0) != 0) {
 171828 		goto __2
 171829 	}
 171830 	*(*int32)(unsafe.Pointer(peType)) = RBU_PK_VTAB
 171831 	goto rbuTableType_end
 171832 __2:
 171833 	;
 171834 	*(*int32)(unsafe.Pointer(piTnum)) = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), 1)
 171835 
 171836 	(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+32+1*8, p+64,
 171837 		Xsqlite3_mprintf(tls, ts+29915, libc.VaList(bp+8, zTab)))
 171838 	if !((*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 0) {
 171839 		goto __3
 171840 	}
 171841 	goto rbuTableType_end
 171842 __3:
 171843 	;
 171844 __4:
 171845 	if !(Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 32 + 1*8))) == SQLITE_ROW) {
 171846 		goto __5
 171847 	}
 171848 	zOrig = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 32 + 1*8)), 3)
 171849 	zIdx = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 32 + 1*8)), 1)
 171850 	if !(zOrig != 0 && zIdx != 0 && int32(*(*U8)(unsafe.Pointer(zOrig))) == 'p') {
 171851 		goto __6
 171852 	}
 171853 	(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+32+2*8, p+64,
 171854 		Xsqlite3_mprintf(tls,
 171855 			ts+29936, libc.VaList(bp+16, zIdx)))
 171856 	if !((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) {
 171857 		goto __7
 171858 	}
 171859 	if !(Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 32 + 2*8))) == SQLITE_ROW) {
 171860 		goto __8
 171861 	}
 171862 	*(*int32)(unsafe.Pointer(piPk)) = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 32 + 2*8)), 0)
 171863 	*(*int32)(unsafe.Pointer(peType)) = RBU_PK_EXTERNAL
 171864 	goto __9
 171865 __8:
 171866 	*(*int32)(unsafe.Pointer(peType)) = RBU_PK_WITHOUT_ROWID
 171867 __9:
 171868 	;
 171869 __7:
 171870 	;
 171871 	goto rbuTableType_end
 171872 __6:
 171873 	;
 171874 	goto __4
 171875 __5:
 171876 	;
 171877 	(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+32+3*8, p+64,
 171878 		Xsqlite3_mprintf(tls, ts+29987, libc.VaList(bp+24, zTab)))
 171879 	if !((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) {
 171880 		goto __10
 171881 	}
 171882 __11:
 171883 	if !(Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 32 + 3*8))) == SQLITE_ROW) {
 171884 		goto __12
 171885 	}
 171886 	if !(Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 32 + 3*8)), 5) > 0) {
 171887 		goto __13
 171888 	}
 171889 	*(*int32)(unsafe.Pointer(peType)) = RBU_PK_IPK
 171890 	goto rbuTableType_end
 171891 __13:
 171892 	;
 171893 	goto __11
 171894 __12:
 171895 	;
 171896 	*(*int32)(unsafe.Pointer(peType)) = RBU_PK_NONE
 171897 __10:
 171898 	;
 171899 rbuTableType_end:
 171900 	i = uint32(0)
 171901 __14:
 171902 	if !(uint64(i) < uint64(unsafe.Sizeof([4]uintptr{}))/uint64(unsafe.Sizeof(uintptr(0)))) {
 171903 		goto __16
 171904 	}
 171905 	rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 32 + uintptr(i)*8)))
 171906 	goto __15
 171907 __15:
 171908 	i++
 171909 	goto __14
 171910 	goto __16
 171911 __16:
 171912 }
 171913 
 171914 func rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) {
 171915 	bp := tls.Alloc(32)
 171916 	defer tls.Free(32)
 171917 
 171918 	*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
 171919 	var bIndex int32 = 0
 171920 
 171921 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 171922 		libc.Xmemcpy(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, (*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk, uint64(unsafe.Sizeof(U8(0)))*uint64((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol))
 171923 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+16, p+64,
 171924 			Xsqlite3_mprintf(tls, ts+30008, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl)))
 171925 	}
 171926 
 171927 	(*RbuObjIter)(unsafe.Pointer(pIter)).FnIndex = 0
 171928 	for (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) {
 171929 		var zIdx uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), 1)
 171930 		var bPartial int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), 4)
 171931 		*(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0)
 171932 		if zIdx == uintptr(0) {
 171933 			break
 171934 		}
 171935 		if bPartial != 0 {
 171936 			libc.Xmemset(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, 0x01, uint64(unsafe.Sizeof(U8(0)))*uint64((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol))
 171937 		}
 171938 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+24, p+64,
 171939 			Xsqlite3_mprintf(tls, ts+30036, libc.VaList(bp+8, zIdx)))
 171940 		for (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 24))) {
 171941 			var iCid int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 24)), 1)
 171942 			if iCid >= 0 {
 171943 				*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(iCid))) = U8(1)
 171944 			}
 171945 			if iCid == -2 {
 171946 				libc.Xmemset(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, 0x01, uint64(unsafe.Sizeof(U8(0)))*uint64((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol))
 171947 			}
 171948 		}
 171949 		rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 24)))
 171950 		bIndex = 1
 171951 		(*RbuObjIter)(unsafe.Pointer(pIter)).FnIndex++
 171952 	}
 171953 
 171954 	if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_WITHOUT_ROWID {
 171955 		(*RbuObjIter)(unsafe.Pointer(pIter)).FnIndex--
 171956 	}
 171957 
 171958 	rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16)))
 171959 	if bIndex == 0 {
 171960 		(*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed = uintptr(0)
 171961 	}
 171962 }
 171963 
 171964 func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 {
 171965 	bp := tls.Alloc(72)
 171966 	defer tls.Free(72)
 171967 
 171968 	if (*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol == uintptr(0) {
 171969 		*(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0)
 171970 		var nCol int32 = 0
 171971 		var i int32
 171972 		var bRbuRowid int32 = 0
 171973 		var iOrder int32 = 0
 171974 		*(*int32)(unsafe.Pointer(bp + 56)) = 0
 171975 
 171976 		rbuTableType(tls, p, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, pIter+72, bp+56, pIter+108)
 171977 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NOTABLE {
 171978 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR
 171979 			(*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+20905, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl))
 171980 		}
 171981 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 0 {
 171982 			return (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
 171983 		}
 171984 		if (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) {
 171985 			(*RbuObjIter)(unsafe.Pointer(pIter)).FiTnum = *(*int32)(unsafe.Pointer(bp + 56))
 171986 		}
 171987 
 171988 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+64, p+64,
 171989 			Xsqlite3_mprintf(tls, ts+30065, libc.VaList(bp+8, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)))
 171990 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 171991 			nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp + 64)))
 171992 			rbuAllocateIterArrays(tls, p, pIter, nCol)
 171993 		}
 171994 		for i = 0; (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && i < nCol; i++ {
 171995 			var zName uintptr = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 64)), i)
 171996 			if Xsqlite3_strnicmp(tls, ts+30084, zName, 4) != 0 {
 171997 				var zCopy uintptr = rbuStrndup(tls, zName, p+56)
 171998 				*(*int32)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)*4)) = (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol
 171999 				*(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(libc.PostIncInt32(&(*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol, 1))*8)) = zCopy
 172000 			} else if 0 == Xsqlite3_stricmp(tls, ts+30089, zName) {
 172001 				bRbuRowid = 1
 172002 			}
 172003 		}
 172004 		Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 64)))
 172005 		*(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0)
 172006 
 172007 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK &&
 172008 			libc.Bool32((*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 &&
 172009 			bRbuRowid != libc.Bool32((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_VTAB || (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE) {
 172010 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR
 172011 			(*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls,
 172012 				ts+30099, libc.VaList(bp+16, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl,
 172013 					func() uintptr {
 172014 						if bRbuRowid != 0 {
 172015 							return ts + 30128
 172016 						}
 172017 						return ts + 30141
 172018 					}()))
 172019 		}
 172020 
 172021 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 172022 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+64, p+64,
 172023 				Xsqlite3_mprintf(tls, ts+30150, libc.VaList(bp+32, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl)))
 172024 		}
 172025 		for (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 64))) {
 172026 			var zName uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 64)), 1)
 172027 			if zName == uintptr(0) {
 172028 				break
 172029 			}
 172030 			for i = iOrder; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ {
 172031 				if 0 == libc.Xstrcmp(tls, zName, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8))) {
 172032 					break
 172033 				}
 172034 			}
 172035 			if i == (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol {
 172036 				(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR
 172037 				(*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+30172,
 172038 					libc.VaList(bp+40, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName))
 172039 			} else {
 172040 				var iPk int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 64)), 5)
 172041 				var bNotNull int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 64)), 3)
 172042 				var zType uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 64)), 2)
 172043 
 172044 				if i != iOrder {
 172045 					{
 172046 						var t int32 = *(*int32)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4))
 172047 						*(*int32)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4)) = *(*int32)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(iOrder)*4))
 172048 						*(*int32)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(iOrder)*4)) = t
 172049 					}
 172050 
 172051 					{
 172052 						var t uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8))
 172053 						*(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iOrder)*8))
 172054 						*(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iOrder)*8)) = t
 172055 					}
 172056 
 172057 				}
 172058 
 172059 				*(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iOrder)*8)) = rbuStrndup(tls, zType, p+56)
 172060 
 172061 				*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iOrder))) = U8(iPk)
 172062 				*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iOrder))) = U8(libc.Bool32(U8(bNotNull) != 0 || iPk != 0))
 172063 				iOrder++
 172064 			}
 172065 		}
 172066 
 172067 		rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 64)))
 172068 		rbuObjIterCacheIndexedCols(tls, p, pIter)
 172069 
 172070 	}
 172071 
 172072 	return (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
 172073 }
 172074 
 172075 func rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) uintptr {
 172076 	bp := tls.Alloc(24)
 172077 	defer tls.Free(24)
 172078 
 172079 	var zList uintptr = uintptr(0)
 172080 	var zSep uintptr = ts + 1544
 172081 	var i int32
 172082 	for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ {
 172083 		var z uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8))
 172084 		zList = rbuMPrintf(tls, p, ts+30199, libc.VaList(bp, zList, zSep, z))
 172085 		zSep = ts + 15971
 172086 	}
 172087 	return zList
 172088 }
 172089 
 172090 func rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, zSeparator uintptr, zPost uintptr) uintptr {
 172091 	bp := tls.Alloc(40)
 172092 	defer tls.Free(40)
 172093 
 172094 	var iPk int32 = 1
 172095 	var zRet uintptr = uintptr(0)
 172096 	var zSep uintptr = ts + 1544
 172097 	for 1 != 0 {
 172098 		var i int32
 172099 		for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ {
 172100 			if int32(*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == iPk {
 172101 				var zCol uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8))
 172102 				zRet = rbuMPrintf(tls, p, ts+30208, libc.VaList(bp, zRet, zSep, zPre, zCol, zPost))
 172103 				zSep = zSeparator
 172104 				break
 172105 			}
 172106 		}
 172107 		if i == (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol {
 172108 			break
 172109 		}
 172110 		iPk++
 172111 	}
 172112 	return zRet
 172113 }
 172114 
 172115 func rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, zWrite uintptr) uintptr {
 172116 	bp := tls.Alloc(80)
 172117 	defer tls.Free(80)
 172118 
 172119 	*(*uintptr)(unsafe.Pointer(bp + 72)) = uintptr(0)
 172120 	var zRet uintptr = uintptr(0)
 172121 	if bRowid != 0 {
 172122 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+72, p+64,
 172123 			Xsqlite3_mprintf(tls,
 172124 				ts+30221, libc.VaList(bp, zWrite, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl)))
 172125 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 72))) {
 172126 			var iMax Sqlite3_int64 = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 72)), 0)
 172127 			zRet = rbuMPrintf(tls, p, ts+30253, libc.VaList(bp+16, iMax))
 172128 		}
 172129 		rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 72)))
 172130 	} else {
 172131 		var zOrder uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+1544, ts+15971, ts+30276)
 172132 		var zSelect uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+30282, ts+30289, ts+6309)
 172133 		var zList uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+1544, ts+15971, ts+1544)
 172134 
 172135 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 172136 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+72, p+64,
 172137 				Xsqlite3_mprintf(tls,
 172138 					ts+30297,
 172139 					libc.VaList(bp+24, zSelect, zWrite, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder)))
 172140 			if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 72))) {
 172141 				var zVal uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 72)), 0)
 172142 				zRet = rbuMPrintf(tls, p, ts+30339, libc.VaList(bp+56, zList, zVal))
 172143 			}
 172144 			rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 72)))
 172145 		}
 172146 
 172147 		Xsqlite3_free(tls, zOrder)
 172148 		Xsqlite3_free(tls, zSelect)
 172149 		Xsqlite3_free(tls, zList)
 172150 	}
 172151 	return zRet
 172152 }
 172153 
 172154 func rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) uintptr {
 172155 	bp := tls.Alloc(192)
 172156 	defer tls.Free(192)
 172157 
 172158 	var zOrder uintptr
 172159 	var zLhs uintptr
 172160 	var zSelect uintptr
 172161 	var zVector uintptr
 172162 	var zRet uintptr
 172163 	var bFailed int32
 172164 	var zSep uintptr
 172165 	var iCol int32
 172166 
 172167 	var i int32
 172168 	var iCid int32
 172169 	var zCollate uintptr
 172170 	var zCol uintptr
 172171 	var zQuoted uintptr
 172172 
 172173 	zOrder = uintptr(0)
 172174 	zLhs = uintptr(0)
 172175 	zSelect = uintptr(0)
 172176 	zVector = uintptr(0)
 172177 	zRet = uintptr(0)
 172178 	bFailed = 0
 172179 	zSep = ts + 1544
 172180 	iCol = 0
 172181 	*(*uintptr)(unsafe.Pointer(bp + 176)) = uintptr(0)
 172182 
 172183 	(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+176, p+64,
 172184 		Xsqlite3_mprintf(tls, ts+30036, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx)))
 172185 __1:
 172186 	if !((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 176)))) {
 172187 		goto __2
 172188 	}
 172189 	iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 176)), 1)
 172190 	zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 176)), 4)
 172191 	if !(Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 176)), 3) != 0) {
 172192 		goto __3
 172193 	}
 172194 	bFailed = 1
 172195 	goto __2
 172196 __3:
 172197 	;
 172198 	if !(iCid < 0) {
 172199 		goto __4
 172200 	}
 172201 	if !((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_IPK) {
 172202 		goto __6
 172203 	}
 172204 	i = 0
 172205 __8:
 172206 	if !(int32(*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0) {
 172207 		goto __10
 172208 	}
 172209 	goto __9
 172210 __9:
 172211 	i++
 172212 	goto __8
 172213 	goto __10
 172214 __10:
 172215 	;
 172216 	zCol = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8))
 172217 	goto __7
 172218 __6:
 172219 	zCol = ts + 30359
 172220 __7:
 172221 	;
 172222 	goto __5
 172223 __4:
 172224 	zCol = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8))
 172225 __5:
 172226 	;
 172227 	zLhs = rbuMPrintf(tls, p, ts+30367,
 172228 		libc.VaList(bp+8, zLhs, zSep, zCol, zCollate))
 172229 	zOrder = rbuMPrintf(tls, p, ts+30388,
 172230 		libc.VaList(bp+40, zOrder, zSep, iCol, zCol, zCollate))
 172231 	zSelect = rbuMPrintf(tls, p, ts+30424,
 172232 		libc.VaList(bp+80, zSelect, zSep, iCol, zCol))
 172233 	zSep = ts + 15971
 172234 	iCol++
 172235 	goto __1
 172236 __2:
 172237 	;
 172238 	rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 176)))
 172239 	if !(bFailed != 0) {
 172240 		goto __11
 172241 	}
 172242 	goto index_start_out
 172243 __11:
 172244 	;
 172245 	if !((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) {
 172246 		goto __12
 172247 	}
 172248 	*(*uintptr)(unsafe.Pointer(bp + 184)) = uintptr(0)
 172249 
 172250 	(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+184, p+64,
 172251 		Xsqlite3_mprintf(tls, ts+30451,
 172252 			libc.VaList(bp+112, zSelect, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder)))
 172253 	if !((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 184)))) {
 172254 		goto __13
 172255 	}
 172256 	zSep = ts + 1544
 172257 	iCol = 0
 172258 __14:
 172259 	if !(iCol < (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol) {
 172260 		goto __16
 172261 	}
 172262 	zQuoted = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 184)), iCol)
 172263 	if !(zQuoted == uintptr(0)) {
 172264 		goto __17
 172265 	}
 172266 	(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
 172267 	goto __18
 172268 __17:
 172269 	if !(int32(*(*int8)(unsafe.Pointer(zQuoted))) == 'N') {
 172270 		goto __19
 172271 	}
 172272 	bFailed = 1
 172273 	goto __16
 172274 __19:
 172275 	;
 172276 __18:
 172277 	;
 172278 	zVector = rbuMPrintf(tls, p, ts+30499, libc.VaList(bp+136, zVector, zSep, zQuoted))
 172279 	zSep = ts + 15971
 172280 	goto __15
 172281 __15:
 172282 	iCol++
 172283 	goto __14
 172284 	goto __16
 172285 __16:
 172286 	;
 172287 	if !!(bFailed != 0) {
 172288 		goto __20
 172289 	}
 172290 	zRet = rbuMPrintf(tls, p, ts+30506, libc.VaList(bp+160, zLhs, zVector))
 172291 __20:
 172292 	;
 172293 __13:
 172294 	;
 172295 	rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 184)))
 172296 __12:
 172297 	;
 172298 index_start_out:
 172299 	Xsqlite3_free(tls, zOrder)
 172300 	Xsqlite3_free(tls, zSelect)
 172301 	Xsqlite3_free(tls, zVector)
 172302 	Xsqlite3_free(tls, zLhs)
 172303 	return zRet
 172304 }
 172305 
 172306 func rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposterCols uintptr, pzImposterPk uintptr, pzWhere uintptr, pnBind uintptr) uintptr {
 172307 	bp := tls.Alloc(208)
 172308 	defer tls.Free(208)
 172309 
 172310 	var rc int32 = (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
 172311 	var rc2 int32
 172312 	var zRet uintptr = uintptr(0)
 172313 	var zImpCols uintptr = uintptr(0)
 172314 	var zImpPK uintptr = uintptr(0)
 172315 	var zWhere uintptr = uintptr(0)
 172316 	var nBind int32 = 0
 172317 	var zCom uintptr = ts + 1544
 172318 	var zAnd uintptr = ts + 1544
 172319 	*(*uintptr)(unsafe.Pointer(bp + 200)) = uintptr(0)
 172320 
 172321 	if rc == SQLITE_OK {
 172322 		rc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+200, p+64,
 172323 			Xsqlite3_mprintf(tls, ts+30036, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx)))
 172324 	}
 172325 
 172326 	for rc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 200))) {
 172327 		var iCid int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 200)), 1)
 172328 		var bDesc int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 200)), 3)
 172329 		var zCollate uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 200)), 4)
 172330 		var zCol uintptr = uintptr(0)
 172331 		var zType uintptr
 172332 
 172333 		if iCid == -2 {
 172334 			var iSeq int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 200)), 0)
 172335 			zRet = Xsqlite3_mprintf(tls, ts+30518, libc.VaList(bp+8, zRet, zCom,
 172336 				(*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol+uintptr(iSeq)*16)).FnSpan, (*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol+uintptr(iSeq)*16)).FzSpan, zCollate))
 172337 			zType = ts + 1544
 172338 		} else {
 172339 			if iCid < 0 {
 172340 				if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_IPK {
 172341 					var i int32
 172342 					for i = 0; int32(*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0; i++ {
 172343 					}
 172344 
 172345 					zCol = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8))
 172346 				} else if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
 172347 					zCol = ts + 30359
 172348 				} else {
 172349 					zCol = ts + 30089
 172350 				}
 172351 				zType = ts + 1109
 172352 			} else {
 172353 				zCol = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8))
 172354 				zType = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8))
 172355 			}
 172356 			zRet = Xsqlite3_mprintf(tls, ts+30540, libc.VaList(bp+48, zRet, zCom, zCol, zCollate))
 172357 		}
 172358 
 172359 		if (*RbuObjIter)(unsafe.Pointer(pIter)).FbUnique == 0 || Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 200)), 5) != 0 {
 172360 			var zOrder uintptr = func() uintptr {
 172361 				if bDesc != 0 {
 172362 					return ts + 30276
 172363 				}
 172364 				return ts + 1544
 172365 			}()
 172366 			zImpPK = Xsqlite3_mprintf(tls, ts+30560,
 172367 				libc.VaList(bp+80, zImpPK, zCom, nBind, zCol, zOrder))
 172368 		}
 172369 		zImpCols = Xsqlite3_mprintf(tls, ts+30581,
 172370 			libc.VaList(bp+120, zImpCols, zCom, nBind, zCol, zType, zCollate))
 172371 		zWhere = Xsqlite3_mprintf(tls,
 172372 			ts+30614, libc.VaList(bp+168, zWhere, zAnd, nBind, zCol))
 172373 		if zRet == uintptr(0) || zImpPK == uintptr(0) || zImpCols == uintptr(0) || zWhere == uintptr(0) {
 172374 			rc = SQLITE_NOMEM
 172375 		}
 172376 		zCom = ts + 15971
 172377 		zAnd = ts + 22941
 172378 		nBind++
 172379 	}
 172380 
 172381 	rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 200)))
 172382 	if rc == SQLITE_OK {
 172383 		rc = rc2
 172384 	}
 172385 
 172386 	if rc != SQLITE_OK {
 172387 		Xsqlite3_free(tls, zRet)
 172388 		Xsqlite3_free(tls, zImpCols)
 172389 		Xsqlite3_free(tls, zImpPK)
 172390 		Xsqlite3_free(tls, zWhere)
 172391 		zRet = uintptr(0)
 172392 		zImpCols = uintptr(0)
 172393 		zImpPK = uintptr(0)
 172394 		zWhere = uintptr(0)
 172395 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc
 172396 	}
 172397 
 172398 	*(*uintptr)(unsafe.Pointer(pzImposterCols)) = zImpCols
 172399 	*(*uintptr)(unsafe.Pointer(pzImposterPk)) = zImpPK
 172400 	*(*uintptr)(unsafe.Pointer(pzWhere)) = zWhere
 172401 	*(*int32)(unsafe.Pointer(pnBind)) = nBind
 172402 	return zRet
 172403 }
 172404 
 172405 func rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr) uintptr {
 172406 	bp := tls.Alloc(64)
 172407 	defer tls.Free(64)
 172408 
 172409 	var zList uintptr = uintptr(0)
 172410 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 {
 172411 		var zS uintptr = ts + 1544
 172412 		var i int32
 172413 		for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ {
 172414 			if *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(i))) != 0 {
 172415 				var zCol uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8))
 172416 				zList = Xsqlite3_mprintf(tls, ts+30638, libc.VaList(bp, zList, zS, zObj, zCol))
 172417 			} else {
 172418 				zList = Xsqlite3_mprintf(tls, ts+30650, libc.VaList(bp+32, zList, zS))
 172419 			}
 172420 			zS = ts + 15971
 172421 			if zList == uintptr(0) {
 172422 				(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
 172423 				break
 172424 			}
 172425 		}
 172426 
 172427 		if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL || (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE {
 172428 			zList = rbuMPrintf(tls, p, ts+30659, libc.VaList(bp+48, zList, zObj))
 172429 		}
 172430 	}
 172431 	return zList
 172432 }
 172433 
 172434 func rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr {
 172435 	bp := tls.Alloc(80)
 172436 	defer tls.Free(80)
 172437 
 172438 	var zList uintptr = uintptr(0)
 172439 	if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_VTAB || (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE {
 172440 		zList = rbuMPrintf(tls, p, ts+30674, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+1))
 172441 	} else if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL {
 172442 		var zSep uintptr = ts + 1544
 172443 		var i int32
 172444 		for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ {
 172445 			if *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 {
 172446 				zList = rbuMPrintf(tls, p, ts+30688, libc.VaList(bp+8, zList, zSep, i, i+1))
 172447 				zSep = ts + 22941
 172448 			}
 172449 		}
 172450 		zList = rbuMPrintf(tls, p,
 172451 			ts+30700, libc.VaList(bp+40, zList))
 172452 
 172453 	} else {
 172454 		var zSep uintptr = ts + 1544
 172455 		var i int32
 172456 		for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ {
 172457 			if *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 {
 172458 				var zCol uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8))
 172459 				zList = rbuMPrintf(tls, p, ts+30750, libc.VaList(bp+48, zList, zSep, zCol, i+1))
 172460 				zSep = ts + 22941
 172461 			}
 172462 		}
 172463 	}
 172464 	return zList
 172465 }
 172466 
 172467 func rbuBadControlError(tls *libc.TLS, p uintptr) {
 172468 	(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR
 172469 	(*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+30763, 0)
 172470 }
 172471 
 172472 func rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr) uintptr {
 172473 	bp := tls.Alloc(112)
 172474 	defer tls.Free(112)
 172475 
 172476 	var zList uintptr = uintptr(0)
 172477 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 172478 		var i int32
 172479 
 172480 		if int32(libc.Xstrlen(tls, zMask)) != (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol {
 172481 			rbuBadControlError(tls, p)
 172482 		} else {
 172483 			var zSep uintptr = ts + 1544
 172484 			for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ {
 172485 				var c int8 = *(*int8)(unsafe.Pointer(zMask + uintptr(*(*int32)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4)))))
 172486 				if int32(c) == 'x' {
 172487 					zList = rbuMPrintf(tls, p, ts+30750,
 172488 						libc.VaList(bp, zList, zSep, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+1))
 172489 					zSep = ts + 15971
 172490 				} else if int32(c) == 'd' {
 172491 					zList = rbuMPrintf(tls, p, ts+30789,
 172492 						libc.VaList(bp+32, zList, zSep, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+1))
 172493 					zSep = ts + 15971
 172494 				} else if int32(c) == 'f' {
 172495 					zList = rbuMPrintf(tls, p, ts+30819,
 172496 						libc.VaList(bp+72, zList, zSep, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+1))
 172497 					zSep = ts + 15971
 172498 				}
 172499 			}
 172500 		}
 172501 	}
 172502 	return zList
 172503 }
 172504 
 172505 func rbuObjIterGetBindlist(tls *libc.TLS, p uintptr, nBind int32) uintptr {
 172506 	var zRet uintptr = uintptr(0)
 172507 	var nByte Sqlite3_int64 = int64(2)*Sqlite3_int64(nBind) + int64(1)
 172508 
 172509 	zRet = rbuMalloc(tls, p, nByte)
 172510 	if zRet != 0 {
 172511 		var i int32
 172512 		for i = 0; i < nBind; i++ {
 172513 			*(*int8)(unsafe.Pointer(zRet + uintptr(i*2))) = int8('?')
 172514 			*(*int8)(unsafe.Pointer(zRet + uintptr(i*2+1))) = func() int8 {
 172515 				if i+1 == nBind {
 172516 					return int8(0)
 172517 				}
 172518 				return int8(',')
 172519 			}()
 172520 		}
 172521 	}
 172522 	return zRet
 172523 }
 172524 
 172525 func rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) uintptr {
 172526 	bp := tls.Alloc(72)
 172527 	defer tls.Free(72)
 172528 
 172529 	var z uintptr = uintptr(0)
 172530 
 172531 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 172532 		var zSep uintptr = ts + 30856
 172533 		*(*uintptr)(unsafe.Pointer(bp + 56)) = uintptr(0)
 172534 		*(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0)
 172535 
 172536 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+56, p+64,
 172537 			Xsqlite3_mprintf(tls, ts+30008, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl)))
 172538 		for (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 56))) {
 172539 			var zOrig uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 56)), 3)
 172540 			if zOrig != 0 && libc.Xstrcmp(tls, zOrig, ts+17513) == 0 {
 172541 				var zIdx uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 56)), 1)
 172542 				if zIdx != 0 {
 172543 					(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+64, p+64,
 172544 						Xsqlite3_mprintf(tls, ts+30036, libc.VaList(bp+8, zIdx)))
 172545 				}
 172546 				break
 172547 			}
 172548 		}
 172549 		rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 56)))
 172550 
 172551 		for (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 64))) {
 172552 			if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 64)), 5) != 0 {
 172553 				var zCol uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 64)), 2)
 172554 				var zDesc uintptr
 172555 				if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 64)), 3) != 0 {
 172556 					zDesc = ts + 30276
 172557 				} else {
 172558 					zDesc = ts + 1544
 172559 				}
 172560 				z = rbuMPrintf(tls, p, ts+30869, libc.VaList(bp+16, z, zSep, zCol, zDesc))
 172561 				zSep = ts + 15971
 172562 			}
 172563 		}
 172564 		z = rbuMPrintf(tls, p, ts+30880, libc.VaList(bp+48, z))
 172565 		rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 64)))
 172566 	}
 172567 	return z
 172568 }
 172569 
 172570 func rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) {
 172571 	bp := tls.Alloc(184)
 172572 	defer tls.Free(184)
 172573 
 172574 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL {
 172575 		var tnum int32 = (*RbuObjIter)(unsafe.Pointer(pIter)).FiPkTnum
 172576 		*(*uintptr)(unsafe.Pointer(bp + 168)) = uintptr(0)
 172577 		var zIdx uintptr = uintptr(0)
 172578 		*(*uintptr)(unsafe.Pointer(bp + 176)) = uintptr(0)
 172579 		var zComma uintptr = ts + 1544
 172580 		var zCols uintptr = uintptr(0)
 172581 		var zPk uintptr = uintptr(0)
 172582 
 172583 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+168, p+64,
 172584 			ts+30884)
 172585 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 172586 			Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp + 168)), 1, tnum)
 172587 			if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 168))) {
 172588 				zIdx = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 168)), 0)
 172589 			}
 172590 		}
 172591 		if zIdx != 0 {
 172592 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+176, p+64,
 172593 				Xsqlite3_mprintf(tls, ts+30036, libc.VaList(bp, zIdx)))
 172594 		}
 172595 		rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 168)))
 172596 
 172597 		for (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 176))) {
 172598 			var bKey int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 176)), 5)
 172599 			if bKey != 0 {
 172600 				var iCid int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 176)), 1)
 172601 				var bDesc int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 176)), 3)
 172602 				var zCollate uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 176)), 4)
 172603 				zCols = rbuMPrintf(tls, p, ts+30934, libc.VaList(bp+8, zCols, zComma,
 172604 					iCid, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate))
 172605 				zPk = rbuMPrintf(tls, p, ts+30956, libc.VaList(bp+48, zPk, zComma, iCid, func() uintptr {
 172606 					if bDesc != 0 {
 172607 						return ts + 30276
 172608 					}
 172609 					return ts + 1544
 172610 				}()))
 172611 				zComma = ts + 15971
 172612 			}
 172613 		}
 172614 		zCols = rbuMPrintf(tls, p, ts+30966, libc.VaList(bp+80, zCols))
 172615 		rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 176)))
 172616 
 172617 		Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+88, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+7793, 1, tnum))
 172618 		rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain,
 172619 			ts+30981,
 172620 			libc.VaList(bp+120, zCols, zPk))
 172621 		Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+136, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+7793, 0, 0))
 172622 	}
 172623 }
 172624 
 172625 func rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) {
 172626 	bp := tls.Alloc(200)
 172627 	defer tls.Free(200)
 172628 
 172629 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*RbuObjIter)(unsafe.Pointer(pIter)).FeType != RBU_PK_VTAB {
 172630 		var tnum int32 = (*RbuObjIter)(unsafe.Pointer(pIter)).FiTnum
 172631 		var zComma uintptr = ts + 1544
 172632 		var zSql uintptr = uintptr(0)
 172633 		var iCol int32
 172634 		Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+7793, 0, 1))
 172635 
 172636 		for iCol = 0; (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && iCol < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; iCol++ {
 172637 			var zPk uintptr = ts + 1544
 172638 			var zCol uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCol)*8))
 172639 			*(*uintptr)(unsafe.Pointer(bp + 192)) = uintptr(0)
 172640 
 172641 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls,
 172642 				(*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+7793, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp+192, uintptr(0), uintptr(0), uintptr(0))
 172643 
 172644 			if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_IPK && *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iCol))) != 0 {
 172645 				zPk = ts + 31043
 172646 			}
 172647 			zSql = rbuMPrintf(tls, p, ts+31056,
 172648 				libc.VaList(bp+32, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp + 192)),
 172649 					func() uintptr {
 172650 						if *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 {
 172651 							return ts + 31083
 172652 						}
 172653 						return ts + 1544
 172654 					}()))
 172655 			zComma = ts + 15971
 172656 		}
 172657 
 172658 		if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_WITHOUT_ROWID {
 172659 			var zPk uintptr = rbuWithoutRowidPK(tls, p, pIter)
 172660 			if zPk != 0 {
 172661 				zSql = rbuMPrintf(tls, p, ts+31093, libc.VaList(bp+88, zSql, zPk))
 172662 			}
 172663 		}
 172664 
 172665 		Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+104, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+7793, 1, tnum))
 172666 		rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+31100,
 172667 			libc.VaList(bp+136, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql,
 172668 				func() uintptr {
 172669 					if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_WITHOUT_ROWID {
 172670 						return ts + 31132
 172671 					}
 172672 					return ts + 1544
 172673 				}()))
 172674 		Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+160, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+7793, 0, 0))
 172675 	}
 172676 }
 172677 
 172678 func rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zCollist uintptr, zRbuRowid uintptr) {
 172679 	bp := tls.Alloc(40)
 172680 	defer tls.Free(40)
 172681 
 172682 	var bRbuRowid int32 = libc.Bool32((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL || (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE)
 172683 	var zBind uintptr = rbuObjIterGetBindlist(tls, p, (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+1+bRbuRowid)
 172684 	if zBind != 0 {
 172685 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls,
 172686 			(*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls,
 172687 				ts+31147,
 172688 				libc.VaList(bp, p+48, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind)))
 172689 	}
 172690 }
 172691 
 172692 func rbuTmpInsertFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) {
 172693 	var p uintptr = Xsqlite3_user_data(tls, pCtx)
 172694 	var rc int32 = SQLITE_OK
 172695 	var i int32
 172696 
 172697 	if Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal))) != 0 {
 172698 		*(*I64)(unsafe.Pointer(p + 304)) += I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex)
 172699 	}
 172700 
 172701 	for i = 0; rc == SQLITE_OK && i < nVal; i++ {
 172702 		rc = Xsqlite3_bind_value(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FpTmpInsert, i+1, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8)))
 172703 	}
 172704 	if rc == SQLITE_OK {
 172705 		Xsqlite3_step(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FpTmpInsert)
 172706 		rc = Xsqlite3_reset(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FpTmpInsert)
 172707 	}
 172708 
 172709 	if rc != SQLITE_OK {
 172710 		Xsqlite3_result_error_code(tls, pCtx, rc)
 172711 	}
 172712 }
 172713 
 172714 func rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr {
 172715 	bp := tls.Alloc(12)
 172716 	defer tls.Free(12)
 172717 
 172718 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 172719 	*(*int32)(unsafe.Pointer(bp + 8)) = (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
 172720 	var zRet uintptr = uintptr(0)
 172721 
 172722 	if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
 172723 		*(*int32)(unsafe.Pointer(bp + 8)) = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64,
 172724 			ts+31204)
 172725 	}
 172726 	if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
 172727 		var rc2 int32
 172728 		*(*int32)(unsafe.Pointer(bp + 8)) = Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 1, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx, -1, uintptr(0))
 172729 		if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) {
 172730 			var zSql uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0)
 172731 			if zSql != 0 {
 172732 				(*RbuObjIter)(unsafe.Pointer(pIter)).FzIdxSql = libc.AssignUintptr(&zSql, rbuStrndup(tls, zSql, bp+8))
 172733 			}
 172734 			if zSql != 0 {
 172735 				var nParen int32 = 0
 172736 				var i int32
 172737 				var iIdxCol int32 = 0
 172738 				var nIdxAlloc int32 = 0
 172739 				for i = 0; *(*int8)(unsafe.Pointer(zSql + uintptr(i))) != 0; i++ {
 172740 					var c int8 = *(*int8)(unsafe.Pointer(zSql + uintptr(i)))
 172741 
 172742 					if iIdxCol == nIdxAlloc {
 172743 						var aIdxCol uintptr = Xsqlite3_realloc(tls,
 172744 							(*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol, int32(uint64(nIdxAlloc+16)*uint64(unsafe.Sizeof(RbuSpan{}))))
 172745 						if aIdxCol == uintptr(0) {
 172746 							*(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_NOMEM
 172747 							break
 172748 						}
 172749 						(*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol = aIdxCol
 172750 						nIdxAlloc = nIdxAlloc + 16
 172751 					}
 172752 
 172753 					if int32(c) == '(' {
 172754 						if nParen == 0 {
 172755 							(*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol)).FzSpan = zSql + uintptr(i+1)
 172756 						}
 172757 						nParen++
 172758 					} else if int32(c) == ')' {
 172759 						nParen--
 172760 						if nParen == 0 {
 172761 							var nSpan int32 = int32((int64(zSql+uintptr(i)) - int64((*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol+uintptr(iIdxCol)*16)).FzSpan)) / 1)
 172762 							(*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(libc.PostIncInt32(&iIdxCol, 1))*16)).FnSpan = nSpan
 172763 							i++
 172764 							break
 172765 						}
 172766 					} else if int32(c) == ',' && nParen == 1 {
 172767 						var nSpan int32 = int32((int64(zSql+uintptr(i)) - int64((*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol+uintptr(iIdxCol)*16)).FzSpan)) / 1)
 172768 						(*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(libc.PostIncInt32(&iIdxCol, 1))*16)).FnSpan = nSpan
 172769 						(*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iIdxCol)*16)).FzSpan = zSql + uintptr(i+1)
 172770 					} else if int32(c) == '"' || int32(c) == '\'' || int32(c) == '`' {
 172771 						for i++; 1 != 0; i++ {
 172772 							if int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i)))) == int32(c) {
 172773 								if int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i+1)))) != int32(c) {
 172774 									break
 172775 								}
 172776 								i++
 172777 							}
 172778 						}
 172779 					} else if int32(c) == '[' {
 172780 						for i++; 1 != 0; i++ {
 172781 							if int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i)))) == ']' {
 172782 								break
 172783 							}
 172784 						}
 172785 					} else if int32(c) == '-' && int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i+1)))) == '-' {
 172786 						for i = i + 2; *(*int8)(unsafe.Pointer(zSql + uintptr(i))) != 0 && int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i)))) != '\n'; i++ {
 172787 						}
 172788 						if int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i)))) == 0 {
 172789 							break
 172790 						}
 172791 					} else if int32(c) == '/' && int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i+1)))) == '*' {
 172792 						for i = i + 2; *(*int8)(unsafe.Pointer(zSql + uintptr(i))) != 0 && (int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i)))) != '*' || int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i+1)))) != '/'); i++ {
 172793 						}
 172794 						if int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i)))) == 0 {
 172795 							break
 172796 						}
 172797 						i++
 172798 					}
 172799 				}
 172800 				if *(*int8)(unsafe.Pointer(zSql + uintptr(i))) != 0 {
 172801 					zRet = rbuStrndup(tls, zSql+uintptr(i), bp+8)
 172802 				}
 172803 				(*RbuObjIter)(unsafe.Pointer(pIter)).FnIdxCol = iIdxCol
 172804 			}
 172805 		}
 172806 
 172807 		rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp)))
 172808 		if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
 172809 			*(*int32)(unsafe.Pointer(bp + 8)) = rc2
 172810 		}
 172811 	}
 172812 
 172813 	(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = *(*int32)(unsafe.Pointer(bp + 8))
 172814 	return zRet
 172815 }
 172816 
 172817 func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32) int32 {
 172818 	bp := tls.Alloc(628)
 172819 	defer tls.Free(628)
 172820 
 172821 	if (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect == uintptr(0) && rbuObjIterCacheTableInfo(tls, p, pIter) == SQLITE_OK {
 172822 		var tnum int32 = (*RbuObjIter)(unsafe.Pointer(pIter)).FiTnum
 172823 		var zCollist uintptr = uintptr(0)
 172824 		var pz uintptr = p + 64
 172825 		var zIdx uintptr = (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx
 172826 		var zLimit uintptr = uintptr(0)
 172827 
 172828 		if nOffset != 0 {
 172829 			zLimit = Xsqlite3_mprintf(tls, ts+31270, libc.VaList(bp, nOffset))
 172830 			if !(zLimit != 0) {
 172831 				(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
 172832 			}
 172833 		}
 172834 
 172835 		if zIdx != 0 {
 172836 			var zTbl uintptr = (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl
 172837 			*(*uintptr)(unsafe.Pointer(bp + 600)) = uintptr(0)
 172838 			*(*uintptr)(unsafe.Pointer(bp + 608)) = uintptr(0)
 172839 			*(*uintptr)(unsafe.Pointer(bp + 616)) = uintptr(0)
 172840 			var zBind uintptr = uintptr(0)
 172841 			var zPart uintptr = uintptr(0)
 172842 			*(*int32)(unsafe.Pointer(bp + 624)) = 0
 172843 
 172844 			zPart = rbuObjIterGetIndexWhere(tls, p, pIter)
 172845 			zCollist = rbuObjIterGetIndexCols(tls,
 172846 				p, pIter, bp+600, bp+608, bp+616, bp+624)
 172847 			zBind = rbuObjIterGetBindlist(tls, p, *(*int32)(unsafe.Pointer(bp + 624)))
 172848 
 172849 			Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+8, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+7793, 0, 1))
 172850 			Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+40, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+7793, 1, tnum))
 172851 			rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain,
 172852 				ts+31290,
 172853 				libc.VaList(bp+72, zTbl, *(*uintptr)(unsafe.Pointer(bp + 600)), *(*uintptr)(unsafe.Pointer(bp + 608))))
 172854 			Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+96, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+7793, 0, 0))
 172855 
 172856 			(*RbuObjIter)(unsafe.Pointer(pIter)).FnCol = *(*int32)(unsafe.Pointer(bp + 624))
 172857 			if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 172858 				(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls,
 172859 					(*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64,
 172860 					Xsqlite3_mprintf(tls, ts+31355, libc.VaList(bp+128, zTbl, zBind)))
 172861 			}
 172862 
 172863 			if libc.Bool32((*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 172864 				(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls,
 172865 					(*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64,
 172866 					Xsqlite3_mprintf(tls, ts+31391, libc.VaList(bp+144, zTbl, *(*uintptr)(unsafe.Pointer(bp + 616)))))
 172867 			}
 172868 
 172869 			if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 172870 				var zSql uintptr
 172871 				if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
 172872 					var zStart uintptr = uintptr(0)
 172873 					if nOffset != 0 {
 172874 						zStart = rbuVacuumIndexStart(tls, p, pIter)
 172875 						if zStart != 0 {
 172876 							Xsqlite3_free(tls, zLimit)
 172877 							zLimit = uintptr(0)
 172878 						}
 172879 					}
 172880 
 172881 					zSql = Xsqlite3_mprintf(tls,
 172882 						ts+31425,
 172883 						libc.VaList(bp+160, zCollist,
 172884 							(*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl,
 172885 							zPart,
 172886 							func() uintptr {
 172887 								if zStart != 0 {
 172888 									return func() uintptr {
 172889 										if zPart != 0 {
 172890 											return ts + 31486
 172891 										}
 172892 										return ts + 31490
 172893 									}()
 172894 								}
 172895 								return ts + 1544
 172896 							}(), zStart,
 172897 							zCollist, zLimit))
 172898 					Xsqlite3_free(tls, zStart)
 172899 				} else if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL || (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE {
 172900 					zSql = Xsqlite3_mprintf(tls,
 172901 						ts+31496,
 172902 						libc.VaList(bp+216, zCollist, p+48, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl,
 172903 							zPart, zCollist, zLimit))
 172904 				} else {
 172905 					zSql = Xsqlite3_mprintf(tls,
 172906 						ts+31557,
 172907 						libc.VaList(bp+264, zCollist, p+48, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart,
 172908 							zCollist, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl,
 172909 							zPart,
 172910 							func() uintptr {
 172911 								if zPart != 0 {
 172912 									return ts + 31486
 172913 								}
 172914 								return ts + 31490
 172915 							}(),
 172916 							zCollist, zLimit))
 172917 				}
 172918 				if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 172919 					(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, zSql)
 172920 				} else {
 172921 					Xsqlite3_free(tls, zSql)
 172922 				}
 172923 			}
 172924 
 172925 			Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 600)))
 172926 			Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 608)))
 172927 			Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 616)))
 172928 			Xsqlite3_free(tls, zBind)
 172929 			Xsqlite3_free(tls, zPart)
 172930 		} else {
 172931 			var bRbuRowid int32 = libc.Bool32((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_VTAB ||
 172932 				(*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE ||
 172933 				(*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL && (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0))
 172934 			var zTbl uintptr = (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl
 172935 			var zWrite uintptr
 172936 
 172937 			var zBindings uintptr = rbuObjIterGetBindlist(tls, p, (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+bRbuRowid)
 172938 			var zWhere uintptr = rbuObjIterGetWhere(tls, p, pIter)
 172939 			var zOldlist uintptr = rbuObjIterGetOldlist(tls, p, pIter, ts+7804)
 172940 			var zNewlist uintptr = rbuObjIterGetOldlist(tls, p, pIter, ts+7800)
 172941 
 172942 			zCollist = rbuObjIterGetCollist(tls, p, pIter)
 172943 			(*RbuObjIter)(unsafe.Pointer(pIter)).FnCol = (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol
 172944 
 172945 			rbuCreateImposterTable(tls, p, pIter)
 172946 			rbuCreateImposterTable2(tls, p, pIter)
 172947 			zWrite = func() uintptr {
 172948 				if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_VTAB {
 172949 					return ts + 1544
 172950 				}
 172951 				return ts + 31716
 172952 			}()
 172953 
 172954 			if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 172955 				(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz,
 172956 					Xsqlite3_mprintf(tls,
 172957 						ts+31725,
 172958 						libc.VaList(bp+344, zWrite, zTbl, zCollist, func() uintptr {
 172959 							if bRbuRowid != 0 {
 172960 								return ts + 31761
 172961 							}
 172962 							return ts + 1544
 172963 						}(), zBindings)))
 172964 			}
 172965 
 172966 			if libc.Bool32((*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 172967 				(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz,
 172968 					Xsqlite3_mprintf(tls,
 172969 						ts+31771, libc.VaList(bp+384, zWrite, zTbl, zWhere)))
 172970 			}
 172971 
 172972 			if libc.Bool32((*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 {
 172973 				var zRbuRowid uintptr = ts + 1544
 172974 				if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL || (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE {
 172975 					zRbuRowid = ts + 31799
 172976 				}
 172977 
 172978 				rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu,
 172979 					ts+31811, libc.VaList(bp+408, p+48, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, func() uintptr {
 172980 						if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL {
 172981 							return ts + 31887
 172982 						}
 172983 						return ts + 1544
 172984 					}(), (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))
 172985 
 172986 				rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain,
 172987 					ts+31904,
 172988 					libc.VaList(bp+440, zWrite, zTbl, zOldlist,
 172989 						zWrite, zTbl, zOldlist,
 172990 						zWrite, zTbl, zNewlist))
 172991 
 172992 				if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL || (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE {
 172993 					rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain,
 172994 						ts+32203,
 172995 						libc.VaList(bp+512, zWrite, zTbl, zNewlist))
 172996 				}
 172997 
 172998 				rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid)
 172999 			}
 173000 
 173001 			if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173002 				var zRbuRowid uintptr = ts + 1544
 173003 				var zStart uintptr = uintptr(0)
 173004 				var zOrder uintptr = uintptr(0)
 173005 				if bRbuRowid != 0 {
 173006 					if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
 173007 						zRbuRowid = ts + 32302
 173008 					} else {
 173009 						zRbuRowid = ts + 32312
 173010 					}
 173011 				}
 173012 
 173013 				if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
 173014 					if nOffset != 0 {
 173015 						zStart = rbuVacuumTableStart(tls, p, pIter, bRbuRowid, zWrite)
 173016 						if zStart != 0 {
 173017 							Xsqlite3_free(tls, zLimit)
 173018 							zLimit = uintptr(0)
 173019 						}
 173020 					}
 173021 					if bRbuRowid != 0 {
 173022 						zOrder = rbuMPrintf(tls, p, ts+30359, 0)
 173023 					} else {
 173024 						zOrder = rbuObjIterGetPkList(tls, p, pIter, ts+1544, ts+15971, ts+1544)
 173025 					}
 173026 				}
 173027 
 173028 				if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173029 					(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz,
 173030 						Xsqlite3_mprintf(tls,
 173031 							ts+32323,
 173032 							libc.VaList(bp+536, zCollist,
 173033 								func() uintptr {
 173034 									if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
 173035 										return ts + 32371
 173036 									}
 173037 									return ts + 1544
 173038 								}(),
 173039 								zRbuRowid,
 173040 								(*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, func() uintptr {
 173041 									if zStart != 0 {
 173042 										return zStart
 173043 									}
 173044 									return ts + 1544
 173045 								}(),
 173046 								func() uintptr {
 173047 									if zOrder != 0 {
 173048 										return ts + 24275
 173049 									}
 173050 									return ts + 1544
 173051 								}(), zOrder,
 173052 								zLimit)))
 173053 				}
 173054 				Xsqlite3_free(tls, zStart)
 173055 				Xsqlite3_free(tls, zOrder)
 173056 			}
 173057 
 173058 			Xsqlite3_free(tls, zWhere)
 173059 			Xsqlite3_free(tls, zOldlist)
 173060 			Xsqlite3_free(tls, zNewlist)
 173061 			Xsqlite3_free(tls, zBindings)
 173062 		}
 173063 		Xsqlite3_free(tls, zCollist)
 173064 		Xsqlite3_free(tls, zLimit)
 173065 	}
 173066 
 173067 	return (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
 173068 }
 173069 
 173070 func rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, ppStmt uintptr) int32 {
 173071 	bp := tls.Alloc(32)
 173072 	defer tls.Free(32)
 173073 
 173074 	var pp uintptr
 173075 	var pUp uintptr = uintptr(0)
 173076 	var nUp int32 = 0
 173077 
 173078 	*(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0)
 173079 
 173080 	for pp = pIter + 184; *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = *(*uintptr)(unsafe.Pointer(pp)) + 16 {
 173081 		pUp = *(*uintptr)(unsafe.Pointer(pp))
 173082 		if libc.Xstrcmp(tls, (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FzMask, zMask) == 0 {
 173083 			*(*uintptr)(unsafe.Pointer(pp)) = (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FpNext
 173084 			(*RbuUpdateStmt)(unsafe.Pointer(pUp)).FpNext = (*RbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate
 173085 			(*RbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate = pUp
 173086 			*(*uintptr)(unsafe.Pointer(ppStmt)) = (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate
 173087 			return SQLITE_OK
 173088 		}
 173089 		nUp++
 173090 	}
 173091 
 173092 	if nUp >= SQLITE_RBU_UPDATE_CACHESIZE {
 173093 		for pp = pIter + 184; *(*uintptr)(unsafe.Pointer(pp)) != pUp; pp = *(*uintptr)(unsafe.Pointer(pp)) + 16 {
 173094 		}
 173095 		*(*uintptr)(unsafe.Pointer(pp)) = uintptr(0)
 173096 		Xsqlite3_finalize(tls, (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate)
 173097 		(*RbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate = uintptr(0)
 173098 	} else {
 173099 		pUp = rbuMalloc(tls, p, int64(uint64(unsafe.Sizeof(RbuUpdateStmt{}))+uint64((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)+uint64(1)))
 173100 	}
 173101 
 173102 	if pUp != 0 {
 173103 		var zWhere uintptr = rbuObjIterGetWhere(tls, p, pIter)
 173104 		var zSet uintptr = rbuObjIterGetSetlist(tls, p, pIter, zMask)
 173105 		var zUpdate uintptr = uintptr(0)
 173106 
 173107 		(*RbuUpdateStmt)(unsafe.Pointer(pUp)).FzMask = pUp + 1*24
 173108 		libc.Xmemcpy(tls, (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FzMask, zMask, uint64((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol))
 173109 		(*RbuUpdateStmt)(unsafe.Pointer(pUp)).FpNext = (*RbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate
 173110 		(*RbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate = pUp
 173111 
 173112 		if zSet != 0 {
 173113 			var zPrefix uintptr = ts + 1544
 173114 
 173115 			if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType != RBU_PK_VTAB {
 173116 				zPrefix = ts + 31716
 173117 			}
 173118 			zUpdate = Xsqlite3_mprintf(tls, ts+32377,
 173119 				libc.VaList(bp, zPrefix, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere))
 173120 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls,
 173121 				(*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, pUp+8, p+64, zUpdate)
 173122 			*(*uintptr)(unsafe.Pointer(ppStmt)) = (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate
 173123 		}
 173124 		Xsqlite3_free(tls, zWhere)
 173125 		Xsqlite3_free(tls, zSet)
 173126 	}
 173127 
 173128 	return (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
 173129 }
 173130 
 173131 func rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) uintptr {
 173132 	bp := tls.Alloc(16)
 173133 	defer tls.Free(16)
 173134 
 173135 	*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 173136 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173137 		var flags int32 = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_URI
 173138 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_open_v2(tls, zName, bp+8, flags, func() uintptr {
 173139 			if bUseVfs != 0 {
 173140 				return (*Sqlite3rbu)(unsafe.Pointer(p)).FzVfsName
 173141 			}
 173142 			return uintptr(0)
 173143 		}())
 173144 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 0 {
 173145 			(*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))))
 173146 			Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
 173147 			*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 173148 		}
 173149 	}
 173150 	return *(*uintptr)(unsafe.Pointer(bp + 8))
 173151 }
 173152 
 173153 func rbuFreeState(tls *libc.TLS, p uintptr) {
 173154 	if p != 0 {
 173155 		Xsqlite3_free(tls, (*RbuState)(unsafe.Pointer(p)).FzTbl)
 173156 		Xsqlite3_free(tls, (*RbuState)(unsafe.Pointer(p)).FzDataTbl)
 173157 		Xsqlite3_free(tls, (*RbuState)(unsafe.Pointer(p)).FzIdx)
 173158 		Xsqlite3_free(tls, p)
 173159 	}
 173160 }
 173161 
 173162 func rbuLoadState(tls *libc.TLS, p uintptr) uintptr {
 173163 	bp := tls.Alloc(20)
 173164 	defer tls.Free(20)
 173165 
 173166 	var pRet uintptr = uintptr(0)
 173167 	*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 173168 
 173169 	var rc2 int32
 173170 
 173171 	pRet = rbuMalloc(tls, p, int64(unsafe.Sizeof(RbuState{})))
 173172 	if pRet == uintptr(0) {
 173173 		return uintptr(0)
 173174 	}
 173175 
 173176 	*(*int32)(unsafe.Pointer(bp + 16)) = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+8, p+64,
 173177 		Xsqlite3_mprintf(tls, ts+32407, libc.VaList(bp, p+48)))
 173178 	for *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) {
 173179 		switch Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), 0) {
 173180 		case RBU_STATE_STAGE:
 173181 			(*RbuState)(unsafe.Pointer(pRet)).FeStage = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), 1)
 173182 			if (*RbuState)(unsafe.Pointer(pRet)).FeStage != RBU_STAGE_OAL &&
 173183 				(*RbuState)(unsafe.Pointer(pRet)).FeStage != RBU_STAGE_MOVE &&
 173184 				(*RbuState)(unsafe.Pointer(pRet)).FeStage != RBU_STAGE_CKPT {
 173185 				(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT
 173186 			}
 173187 			break
 173188 
 173189 		case RBU_STATE_TBL:
 173190 			(*RbuState)(unsafe.Pointer(pRet)).FzTbl = rbuStrndup(tls, Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), 1), bp+16)
 173191 			break
 173192 
 173193 		case RBU_STATE_IDX:
 173194 			(*RbuState)(unsafe.Pointer(pRet)).FzIdx = rbuStrndup(tls, Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), 1), bp+16)
 173195 			break
 173196 
 173197 		case RBU_STATE_ROW:
 173198 			(*RbuState)(unsafe.Pointer(pRet)).FnRow = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), 1)
 173199 			break
 173200 
 173201 		case RBU_STATE_PROGRESS:
 173202 			(*RbuState)(unsafe.Pointer(pRet)).FnProgress = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), 1)
 173203 			break
 173204 
 173205 		case RBU_STATE_CKPT:
 173206 			(*RbuState)(unsafe.Pointer(pRet)).FiWalCksum = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), 1)
 173207 			break
 173208 
 173209 		case RBU_STATE_COOKIE:
 173210 			(*RbuState)(unsafe.Pointer(pRet)).FiCookie = U32(Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), 1))
 173211 			break
 173212 
 173213 		case RBU_STATE_OALSZ:
 173214 			(*RbuState)(unsafe.Pointer(pRet)).FiOalSz = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), 1)
 173215 			break
 173216 
 173217 		case RBU_STATE_PHASEONESTEP:
 173218 			(*RbuState)(unsafe.Pointer(pRet)).FnPhaseOneStep = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), 1)
 173219 			break
 173220 
 173221 		case RBU_STATE_DATATBL:
 173222 			(*RbuState)(unsafe.Pointer(pRet)).FzDataTbl = rbuStrndup(tls, Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), 1), bp+16)
 173223 			break
 173224 
 173225 		default:
 173226 			*(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_CORRUPT
 173227 			break
 173228 		}
 173229 	}
 173230 	rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
 173231 	if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
 173232 		*(*int32)(unsafe.Pointer(bp + 16)) = rc2
 173233 	}
 173234 
 173235 	(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = *(*int32)(unsafe.Pointer(bp + 16))
 173236 	return pRet
 173237 }
 173238 
 173239 func rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) {
 173240 	bp := tls.Alloc(56)
 173241 	defer tls.Free(56)
 173242 
 173243 	(*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu = rbuOpenDbhandle(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu, 1)
 173244 	(*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain = dbMain
 173245 
 173246 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
 173247 		Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+7793, SQLITE_FCNTL_RBUCNT, p)
 173248 		if (*Sqlite3rbu)(unsafe.Pointer(p)).FzState == uintptr(0) {
 173249 			var zFile uintptr = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+7793)
 173250 			(*Sqlite3rbu)(unsafe.Pointer(p)).FzState = rbuMPrintf(tls, p, ts+32437, libc.VaList(bp, zFile, zFile))
 173251 		}
 173252 	}
 173253 
 173254 	if (*Sqlite3rbu)(unsafe.Pointer(p)).FzState != 0 {
 173255 		rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+32465, libc.VaList(bp+16, (*Sqlite3rbu)(unsafe.Pointer(p)).FzState))
 173256 		libc.Xmemcpy(tls, p+48, ts+14829, uint64(4))
 173257 	} else {
 173258 		libc.Xmemcpy(tls, p+48, ts+7793, uint64(4))
 173259 	}
 173260 
 173261 	rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+32483, libc.VaList(bp+24, p+48))
 173262 
 173263 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
 173264 		var bOpen int32 = 0
 173265 		var rc int32
 173266 		(*Sqlite3rbu)(unsafe.Pointer(p)).FnRbu = 0
 173267 		(*Sqlite3rbu)(unsafe.Pointer(p)).FpRbuFd = uintptr(0)
 173268 		rc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+7793, SQLITE_FCNTL_RBUCNT, p)
 173269 		if rc != SQLITE_NOTFOUND {
 173270 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc
 173271 		}
 173272 		if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage >= RBU_STAGE_MOVE {
 173273 			bOpen = 1
 173274 		} else {
 173275 			var pState uintptr = rbuLoadState(tls, p)
 173276 			if pState != 0 {
 173277 				bOpen = libc.Bool32((*RbuState)(unsafe.Pointer(pState)).FeStage >= RBU_STAGE_MOVE)
 173278 				rbuFreeState(tls, pState)
 173279 			}
 173280 		}
 173281 		if bOpen != 0 {
 173282 			(*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain = rbuOpenDbhandle(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu, libc.Bool32((*Sqlite3rbu)(unsafe.Pointer(p)).FnRbu <= 1))
 173283 		}
 173284 	}
 173285 
 173286 	(*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = 0
 173287 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain == uintptr(0) {
 173288 		if !((*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) {
 173289 			(*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain = rbuOpenDbhandle(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget, 1)
 173290 		} else if (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpRbuFd)).FpWalFd != 0 {
 173291 			if pbRetry != 0 {
 173292 				(*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpRbuFd)).FbNolock = U8(0)
 173293 				Xsqlite3_close(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu)
 173294 				Xsqlite3_close(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain)
 173295 				(*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain = uintptr(0)
 173296 				(*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu = uintptr(0)
 173297 				*(*int32)(unsafe.Pointer(pbRetry)) = 1
 173298 				return
 173299 			}
 173300 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR
 173301 			(*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+32549, 0)
 173302 		} else {
 173303 			var zTarget uintptr
 173304 			var zExtra uintptr = uintptr(0)
 173305 			if libc.Xstrlen(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, ts+25622, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) {
 173306 				zExtra = (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5
 173307 				for *(*int8)(unsafe.Pointer(zExtra)) != 0 {
 173308 					if int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zExtra, 1)))) == '?' {
 173309 						break
 173310 					}
 173311 				}
 173312 				if int32(*(*int8)(unsafe.Pointer(zExtra))) == 0 {
 173313 					zExtra = uintptr(0)
 173314 				}
 173315 			}
 173316 
 173317 			zTarget = Xsqlite3_mprintf(tls, ts+32581,
 173318 				libc.VaList(bp+32, Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+7793),
 173319 					func() uintptr {
 173320 						if zExtra == uintptr(0) {
 173321 							return ts + 1544
 173322 						}
 173323 						return ts + 32613
 173324 					}(), func() uintptr {
 173325 						if zExtra == uintptr(0) {
 173326 							return ts + 1544
 173327 						}
 173328 						return zExtra
 173329 					}()))
 173330 
 173331 			if zTarget == uintptr(0) {
 173332 				(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
 173333 				return
 173334 			}
 173335 			(*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain = rbuOpenDbhandle(tls, p, zTarget, libc.Bool32((*Sqlite3rbu)(unsafe.Pointer(p)).FnRbu <= 1))
 173336 			Xsqlite3_free(tls, zTarget)
 173337 		}
 173338 	}
 173339 
 173340 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173341 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain,
 173342 			ts+32615, -1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct {
 173343 				f func(*libc.TLS, uintptr, int32, uintptr)
 173344 			}{rbuTmpInsertFunc})), uintptr(0), uintptr(0))
 173345 	}
 173346 
 173347 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173348 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain,
 173349 			ts+32630, 2, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
 173350 				f func(*libc.TLS, uintptr, int32, uintptr)
 173351 			}{rbuFossilDeltaFunc})), uintptr(0), uintptr(0))
 173352 	}
 173353 
 173354 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173355 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu,
 173356 			ts+32647, -1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct {
 173357 				f func(*libc.TLS, uintptr, int32, uintptr)
 173358 			}{rbuTargetNameFunc})), uintptr(0), uintptr(0))
 173359 	}
 173360 
 173361 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173362 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+7793, SQLITE_FCNTL_RBU, p)
 173363 	}
 173364 	rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+32663, 0)
 173365 
 173366 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173367 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+7793, SQLITE_FCNTL_RBU, p)
 173368 	}
 173369 
 173370 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_NOTFOUND {
 173371 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR
 173372 		(*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+32691, 0)
 173373 	}
 173374 }
 173375 
 173376 func rbuFileSuffix3(tls *libc.TLS, zBase uintptr, z uintptr) {
 173377 }
 173378 
 173379 func rbuShmChecksum(tls *libc.TLS, p uintptr) I64 {
 173380 	bp := tls.Alloc(8)
 173381 	defer tls.Free(8)
 173382 
 173383 	var iRet I64 = int64(0)
 173384 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173385 		var pDb uintptr = (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal
 173386 
 173387 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*struct {
 173388 			f func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32
 173389 		})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})).f(tls, pDb, 0, 32*1024, 0, bp)
 173390 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173391 			iRet = I64(*(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 10*4)))<<32 + I64(*(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 11*4)))
 173392 		}
 173393 	}
 173394 	return iRet
 173395 }
 173396 
 173397 func rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) {
 173398 	if pState == uintptr(0) {
 173399 		(*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = 0
 173400 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173401 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+32663, uintptr(0), uintptr(0), uintptr(0))
 173402 		}
 173403 	}
 173404 
 173405 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173406 		var rc2 int32
 173407 		(*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_CAPTURE
 173408 		rc2 = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+32709, uintptr(0), uintptr(0), uintptr(0))
 173409 		if rc2 != SQLITE_NOTICE {
 173410 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc2
 173411 		}
 173412 	}
 173413 
 173414 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Sqlite3rbu)(unsafe.Pointer(p)).FnFrame > 0 {
 173415 		(*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_CKPT
 173416 		(*Sqlite3rbu)(unsafe.Pointer(p)).FnStep = func() int32 {
 173417 			if pState != 0 {
 173418 				return (*RbuState)(unsafe.Pointer(pState)).FnRow
 173419 			}
 173420 			return 0
 173421 		}()
 173422 		(*Sqlite3rbu)(unsafe.Pointer(p)).FaBuf = rbuMalloc(tls, p, int64((*Sqlite3rbu)(unsafe.Pointer(p)).Fpgsz))
 173423 		(*Sqlite3rbu)(unsafe.Pointer(p)).FiWalCksum = rbuShmChecksum(tls, p)
 173424 	}
 173425 
 173426 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173427 		if (*Sqlite3rbu)(unsafe.Pointer(p)).FnFrame == 0 || pState != 0 && (*RbuState)(unsafe.Pointer(pState)).FiWalCksum != (*Sqlite3rbu)(unsafe.Pointer(p)).FiWalCksum {
 173428 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_DONE
 173429 			(*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_DONE
 173430 		} else {
 173431 			var nSectorSize int32
 173432 			var pDb uintptr = (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal
 173433 			var pWal uintptr = (*Rbu_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd)).FpReal
 173434 
 173435 			nSectorSize = (*struct {
 173436 				f func(*libc.TLS, uintptr) int32
 173437 			})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSectorSize})).f(tls, pDb)
 173438 			if nSectorSize > (*Sqlite3rbu)(unsafe.Pointer(p)).Fpgsz {
 173439 				(*Sqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector = nSectorSize / (*Sqlite3rbu)(unsafe.Pointer(p)).Fpgsz
 173440 			} else {
 173441 				(*Sqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector = 1
 173442 			}
 173443 
 173444 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*struct {
 173445 				f func(*libc.TLS, uintptr, int32) int32
 173446 			})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})).f(tls, pWal, SQLITE_SYNC_NORMAL)
 173447 		}
 173448 	}
 173449 }
 173450 
 173451 func rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff I64, iAmt int32) int32 {
 173452 	var mReq U32 = U32(int32(1)<<WAL_LOCK_WRITE | int32(1)<<WAL_LOCK_CKPT | int32(1)<<WAL_LOCK_READ0)
 173453 	var iFrame U32
 173454 
 173455 	if (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FmLock != mReq {
 173456 		(*Sqlite3rbu)(unsafe.Pointer(pRbu)).Frc = SQLITE_BUSY
 173457 		return SQLITE_NOTICE | int32(3)<<8
 173458 	}
 173459 
 173460 	(*Sqlite3rbu)(unsafe.Pointer(pRbu)).Fpgsz = iAmt
 173461 	if (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrame == (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrameAlloc {
 173462 		var nNew int32 = func() int32 {
 173463 			if (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrameAlloc != 0 {
 173464 				return (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrameAlloc
 173465 			}
 173466 			return 64
 173467 		}() * 2
 173468 		var aNew uintptr
 173469 		aNew = Xsqlite3_realloc64(tls, (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, uint64(nNew)*uint64(unsafe.Sizeof(RbuFrame{})))
 173470 		if aNew == uintptr(0) {
 173471 			return SQLITE_NOMEM
 173472 		}
 173473 		(*Sqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame = aNew
 173474 		(*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrameAlloc = nNew
 173475 	}
 173476 
 173477 	iFrame = U32((iOff-int64(32))/I64(iAmt+24)) + U32(1)
 173478 	if (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FiMaxFrame < iFrame {
 173479 		(*Sqlite3rbu)(unsafe.Pointer(pRbu)).FiMaxFrame = iFrame
 173480 	}
 173481 	(*RbuFrame)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame + uintptr((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrame)*8)).FiWalFrame = iFrame
 173482 	(*RbuFrame)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame + uintptr((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrame)*8)).FiDbPage = U32(0)
 173483 	(*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrame++
 173484 	return SQLITE_OK
 173485 }
 173486 
 173487 func rbuCaptureDbWrite(tls *libc.TLS, pRbu uintptr, iOff I64) int32 {
 173488 	(*RbuFrame)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame + uintptr((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrame-1)*8)).FiDbPage = U32(iOff/I64((*Sqlite3rbu)(unsafe.Pointer(pRbu)).Fpgsz)) + U32(1)
 173489 	return SQLITE_OK
 173490 }
 173491 
 173492 func rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) {
 173493 	var pWal uintptr = (*Rbu_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd)).FpReal
 173494 	var pDb uintptr = (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal
 173495 	var iOff I64
 173496 
 173497 	iOff = I64((*RbuFrame)(unsafe.Pointer(pFrame)).FiWalFrame-U32(1))*I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fpgsz+24) + int64(32) + int64(24)
 173498 	(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*struct {
 173499 		f func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32
 173500 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})).f(tls, pWal, (*Sqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Sqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff)
 173501 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 0 {
 173502 		return
 173503 	}
 173504 
 173505 	iOff = I64((*RbuFrame)(unsafe.Pointer(pFrame)).FiDbPage-U32(1)) * I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fpgsz)
 173506 	(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*struct {
 173507 		f func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32
 173508 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})).f(tls, pDb, (*Sqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Sqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff)
 173509 }
 173510 
 173511 func rbuLockDatabase(tls *libc.TLS, db uintptr) int32 {
 173512 	bp := tls.Alloc(8)
 173513 	defer tls.Free(8)
 173514 
 173515 	var rc int32 = SQLITE_OK
 173516 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 173517 	Xsqlite3_file_control(tls, db, ts+7793, SQLITE_FCNTL_FILE_POINTER, bp)
 173518 
 173519 	if (*Sqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods != 0 {
 173520 		rc = (*struct {
 173521 			f func(*libc.TLS, uintptr, int32) int32
 173522 		})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})).f(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_SHARED)
 173523 		if rc == SQLITE_OK {
 173524 			rc = (*struct {
 173525 				f func(*libc.TLS, uintptr, int32) int32
 173526 			})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})).f(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_EXCLUSIVE)
 173527 		}
 173528 	}
 173529 	return rc
 173530 }
 173531 
 173532 func rbuExclusiveCheckpoint(tls *libc.TLS, db uintptr) int32 {
 173533 	var zUri uintptr = Xsqlite3_db_filename(tls, db, uintptr(0))
 173534 	return Xsqlite3_uri_boolean(tls, zUri, ts+32744, 0)
 173535 }
 173536 
 173537 func rbuMoveOalFile(tls *libc.TLS, p uintptr) {
 173538 	bp := tls.Alloc(16)
 173539 	defer tls.Free(16)
 173540 
 173541 	var zBase uintptr = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+7793)
 173542 	var zMove uintptr = zBase
 173543 	var zOal uintptr
 173544 	var zWal uintptr
 173545 
 173546 	if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
 173547 		zMove = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+7793)
 173548 	}
 173549 	zOal = Xsqlite3_mprintf(tls, ts+32769, libc.VaList(bp, zMove))
 173550 	zWal = Xsqlite3_mprintf(tls, ts+32776, libc.VaList(bp+8, zMove))
 173551 
 173552 	if zWal == uintptr(0) || zOal == uintptr(0) {
 173553 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
 173554 	} else {
 173555 		var dbMain uintptr = uintptr(0)
 173556 		rbuFileSuffix3(tls, zBase, zWal)
 173557 		rbuFileSuffix3(tls, zBase, zOal)
 173558 
 173559 		rbuObjIterFinalize(tls, p+80)
 173560 		Xsqlite3_close(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu)
 173561 		Xsqlite3_close(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain)
 173562 		(*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain = uintptr(0)
 173563 		(*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu = uintptr(0)
 173564 
 173565 		dbMain = rbuOpenDbhandle(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget, 1)
 173566 		if dbMain != 0 {
 173567 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rbuLockDatabase(tls, dbMain)
 173568 		}
 173569 
 173570 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173571 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*struct {
 173572 				f func(*libc.TLS, uintptr, uintptr, uintptr) int32
 173573 			})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3rbu)(unsafe.Pointer(p)).FxRename})).f(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FpRenameArg, zOal, zWal)
 173574 		}
 173575 
 173576 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK ||
 173577 			(*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) ||
 173578 			rbuExclusiveCheckpoint(tls, dbMain) == 0 {
 173579 			Xsqlite3_close(tls, dbMain)
 173580 			dbMain = uintptr(0)
 173581 		}
 173582 
 173583 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173584 			rbuOpenDatabase(tls, p, dbMain, uintptr(0))
 173585 			rbuSetupCheckpoint(tls, p, uintptr(0))
 173586 		}
 173587 	}
 173588 
 173589 	Xsqlite3_free(tls, zWal)
 173590 	Xsqlite3_free(tls, zOal)
 173591 }
 173592 
 173593 func rbuStepType(tls *libc.TLS, p uintptr, pzMask uintptr) int32 {
 173594 	var iCol int32 = (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnCol
 173595 	var res int32 = 0
 173596 
 173597 	switch Xsqlite3_column_type(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FpSelect, iCol) {
 173598 	case SQLITE_INTEGER:
 173599 		{
 173600 			var iVal int32 = Xsqlite3_column_int(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FpSelect, iCol)
 173601 			switch iVal {
 173602 			case 0:
 173603 				res = RBU_INSERT
 173604 				break
 173605 			case 1:
 173606 				res = RBU_DELETE
 173607 				break
 173608 			case 2:
 173609 				res = RBU_REPLACE
 173610 				break
 173611 			case 3:
 173612 				res = RBU_IDX_DELETE
 173613 				break
 173614 			case 4:
 173615 				res = RBU_IDX_INSERT
 173616 				break
 173617 			}
 173618 			break
 173619 
 173620 		}
 173621 
 173622 	case SQLITE_TEXT:
 173623 		{
 173624 			var z uintptr = Xsqlite3_column_text(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FpSelect, iCol)
 173625 			if z == uintptr(0) {
 173626 				(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
 173627 			} else {
 173628 				*(*uintptr)(unsafe.Pointer(pzMask)) = z
 173629 			}
 173630 			res = RBU_UPDATE
 173631 
 173632 			break
 173633 
 173634 		}
 173635 
 173636 	default:
 173637 		break
 173638 	}
 173639 
 173640 	if res == 0 {
 173641 		rbuBadControlError(tls, p)
 173642 	}
 173643 	return res
 173644 }
 173645 
 173646 func rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) {
 173647 	var pIter uintptr = p + 80
 173648 	var pVal uintptr
 173649 	var pWriter uintptr
 173650 	var i int32
 173651 
 173652 	if eType == RBU_DELETE {
 173653 		*(*I64)(unsafe.Pointer(p + 304)) -= I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex)
 173654 	}
 173655 
 173656 	if eType == RBU_IDX_DELETE || eType == RBU_DELETE {
 173657 		pWriter = (*RbuObjIter)(unsafe.Pointer(pIter)).FpDelete
 173658 	} else {
 173659 		pWriter = (*RbuObjIter)(unsafe.Pointer(pIter)).FpInsert
 173660 	}
 173661 
 173662 	for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol; i++ {
 173663 		if eType == RBU_INSERT &&
 173664 			(*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) && (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_IPK && *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 &&
 173665 			Xsqlite3_column_type(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) == SQLITE_NULL {
 173666 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_MISMATCH
 173667 			(*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+25260, 0)
 173668 			return
 173669 		}
 173670 
 173671 		if eType == RBU_DELETE && int32(*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 {
 173672 			continue
 173673 		}
 173674 
 173675 		pVal = Xsqlite3_column_value(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i)
 173676 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_bind_value(tls, pWriter, i+1, pVal)
 173677 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 0 {
 173678 			return
 173679 		}
 173680 	}
 173681 	if (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) {
 173682 		if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_VTAB ||
 173683 			(*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE ||
 173684 			(*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL && (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
 173685 			pVal = Xsqlite3_column_value(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect, (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol+1)
 173686 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_bind_value(tls, pWriter, (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol+1, pVal)
 173687 		}
 173688 	}
 173689 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173690 		Xsqlite3_step(tls, pWriter)
 173691 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = resetAndCollectError(tls, pWriter, p+64)
 173692 	}
 173693 }
 173694 
 173695 func rbuStep(tls *libc.TLS, p uintptr) int32 {
 173696 	bp := tls.Alloc(16)
 173697 	defer tls.Free(16)
 173698 
 173699 	var pIter uintptr = p + 80
 173700 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 173701 	var eType int32 = rbuStepType(tls, p, bp)
 173702 
 173703 	if eType != 0 {
 173704 		if (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) && (eType == RBU_IDX_DELETE || eType == RBU_IDX_INSERT) {
 173705 			rbuBadControlError(tls, p)
 173706 		} else if eType == RBU_REPLACE {
 173707 			if (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) {
 173708 				*(*I64)(unsafe.Pointer(p + 304)) += I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex)
 173709 				rbuStepOneOp(tls, p, RBU_DELETE)
 173710 			}
 173711 			if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173712 				rbuStepOneOp(tls, p, RBU_INSERT)
 173713 			}
 173714 		} else if eType != RBU_UPDATE {
 173715 			rbuStepOneOp(tls, p, eType)
 173716 		} else {
 173717 			var pVal uintptr
 173718 			*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 173719 
 173720 			*(*I64)(unsafe.Pointer(p + 304)) -= I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex)
 173721 			rbuGetUpdateStmt(tls, p, pIter, *(*uintptr)(unsafe.Pointer(bp)), bp+8)
 173722 			if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 {
 173723 				var i int32
 173724 				for i = 0; (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol; i++ {
 173725 					var c int8 = *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + uintptr(*(*int32)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4)))))
 173726 					pVal = Xsqlite3_column_value(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i)
 173727 					if *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 || int32(c) != '.' {
 173728 						(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_bind_value(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), i+1, pVal)
 173729 					}
 173730 				}
 173731 				if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK &&
 173732 					((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_VTAB || (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE) {
 173733 					pVal = Xsqlite3_column_value(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect, (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol+1)
 173734 					(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_bind_value(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol+1, pVal)
 173735 				}
 173736 				if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173737 					Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
 173738 					(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = resetAndCollectError(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), p+64)
 173739 				}
 173740 			}
 173741 		}
 173742 	}
 173743 	return (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
 173744 }
 173745 
 173746 func rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) {
 173747 	bp := tls.Alloc(16)
 173748 	defer tls.Free(16)
 173749 
 173750 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173751 		var dbread uintptr = func() uintptr {
 173752 			if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
 173753 				return (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu
 173754 			}
 173755 			return (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain
 173756 		}()
 173757 		var iCookie int32 = 1000000
 173758 
 173759 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, dbread, bp+8, p+64,
 173760 			ts+32783)
 173761 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173762 			if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) {
 173763 				iCookie = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), 0)
 173764 			}
 173765 			rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8)))
 173766 		}
 173767 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173768 			rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+32805, libc.VaList(bp, iCookie+1))
 173769 		}
 173770 	}
 173771 }
 173772 
 173773 func rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) {
 173774 	bp := tls.Alloc(176)
 173775 	defer tls.Free(176)
 173776 
 173777 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK || (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_DONE {
 173778 		*(*uintptr)(unsafe.Pointer(bp + 168)) = uintptr(0)
 173779 		var pFd uintptr = func() uintptr {
 173780 			if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
 173781 				return (*Sqlite3rbu)(unsafe.Pointer(p)).FpRbuFd
 173782 			}
 173783 			return (*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd
 173784 		}()
 173785 		var rc int32
 173786 
 173787 		rc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+168, p+64,
 173788 			Xsqlite3_mprintf(tls,
 173789 				ts+32832,
 173790 				libc.VaList(bp, p+48,
 173791 					RBU_STATE_STAGE, eStage,
 173792 					RBU_STATE_TBL, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl,
 173793 					RBU_STATE_IDX, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx,
 173794 					RBU_STATE_ROW, (*Sqlite3rbu)(unsafe.Pointer(p)).FnStep,
 173795 					RBU_STATE_PROGRESS, (*Sqlite3rbu)(unsafe.Pointer(p)).FnProgress,
 173796 					RBU_STATE_CKPT, (*Sqlite3rbu)(unsafe.Pointer(p)).FiWalCksum,
 173797 					RBU_STATE_COOKIE, I64((*Rbu_file)(unsafe.Pointer(pFd)).FiCookie),
 173798 					RBU_STATE_OALSZ, (*Sqlite3rbu)(unsafe.Pointer(p)).FiOalSz,
 173799 					RBU_STATE_PHASEONESTEP, (*Sqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep,
 173800 					RBU_STATE_DATATBL, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl)))
 173801 
 173802 		if rc == SQLITE_OK {
 173803 			Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 168)))
 173804 			rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 168)))
 173805 		}
 173806 		if rc != SQLITE_OK {
 173807 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc
 173808 		}
 173809 	}
 173810 }
 173811 
 173812 func rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) {
 173813 	bp := tls.Alloc(32)
 173814 	defer tls.Free(32)
 173815 
 173816 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173817 		*(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0)
 173818 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+24, p+64,
 173819 			Xsqlite3_mprintf(tls, ts+32990, libc.VaList(bp, zPragma)))
 173820 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 24))) {
 173821 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+33005,
 173822 				libc.VaList(bp+8, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 24)), 0)))
 173823 		}
 173824 		rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 24)))
 173825 	}
 173826 }
 173827 
 173828 func rbuCreateTargetSchema(tls *libc.TLS, p uintptr) {
 173829 	bp := tls.Alloc(16)
 173830 	defer tls.Free(16)
 173831 
 173832 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 173833 	*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 173834 
 173835 	(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+33025, uintptr(0), uintptr(0), p+64)
 173836 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173837 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64,
 173838 			ts+33050)
 173839 	}
 173840 
 173841 	for (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == SQLITE_ROW {
 173842 		var zSql uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0)
 173843 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, zSql, uintptr(0), uintptr(0), p+64)
 173844 	}
 173845 	rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp)))
 173846 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK {
 173847 		return
 173848 	}
 173849 
 173850 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173851 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64,
 173852 			ts+33158)
 173853 	}
 173854 
 173855 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173856 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64,
 173857 			ts+33223)
 173858 	}
 173859 
 173860 	for (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == SQLITE_ROW {
 173861 		var i int32
 173862 		for i = 0; i < 5; i++ {
 173863 			Xsqlite3_bind_value(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), i+1, Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp)), i))
 173864 		}
 173865 		Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
 173866 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
 173867 	}
 173868 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173869 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+33267, uintptr(0), uintptr(0), p+64)
 173870 	}
 173871 
 173872 	rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp)))
 173873 	rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8)))
 173874 }
 173875 
 173876 // Step the RBU object.
 173877 func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) int32 {
 173878 	bp := tls.Alloc(24)
 173879 	defer tls.Free(24)
 173880 
 173881 	if p != 0 {
 173882 		switch (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage {
 173883 		case RBU_STAGE_OAL:
 173884 			{
 173885 				var pIter uintptr = p + 80
 173886 
 173887 				if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Sqlite3rbu)(unsafe.Pointer(p)).FnProgress == 0 && (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173888 					rbuCreateTargetSchema(tls, p)
 173889 					rbuCopyPragma(tls, p, ts+18619)
 173890 					rbuCopyPragma(tls, p, ts+17709)
 173891 				}
 173892 
 173893 				for (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 {
 173894 					if (*RbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 {
 173895 						if libc.Bool32((*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 {
 173896 							rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu,
 173897 								ts+33292, libc.VaList(bp, p+48, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))
 173898 						}
 173899 					} else {
 173900 						rbuObjIterPrepareAll(tls, p, pIter, 0)
 173901 
 173902 						if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173903 							var rc int32 = Xsqlite3_step(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect)
 173904 							if rc == SQLITE_ROW {
 173905 								(*Sqlite3rbu)(unsafe.Pointer(p)).FnProgress++
 173906 								(*Sqlite3rbu)(unsafe.Pointer(p)).FnStep++
 173907 								return rbuStep(tls, p)
 173908 							}
 173909 							(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect)
 173910 							(*Sqlite3rbu)(unsafe.Pointer(p)).FnStep = 0
 173911 						}
 173912 					}
 173913 
 173914 					rbuObjIterNext(tls, p, pIter)
 173915 				}
 173916 
 173917 				if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173918 					rbuSaveState(tls, p, RBU_STAGE_MOVE)
 173919 					rbuIncrSchemaCookie(tls, p)
 173920 					if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173921 						(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+15875, uintptr(0), uintptr(0), p+64)
 173922 					}
 173923 					if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173924 						(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+15875, uintptr(0), uintptr(0), p+64)
 173925 					}
 173926 					(*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_MOVE
 173927 				}
 173928 				break
 173929 
 173930 			}
 173931 			fallthrough
 173932 
 173933 		case RBU_STAGE_MOVE:
 173934 			{
 173935 				if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173936 					rbuMoveOalFile(tls, p)
 173937 					(*Sqlite3rbu)(unsafe.Pointer(p)).FnProgress++
 173938 				}
 173939 				break
 173940 
 173941 			}
 173942 			fallthrough
 173943 
 173944 		case RBU_STAGE_CKPT:
 173945 			{
 173946 				if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173947 					if (*Sqlite3rbu)(unsafe.Pointer(p)).FnStep >= (*Sqlite3rbu)(unsafe.Pointer(p)).FnFrame {
 173948 						var pDb uintptr = (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal
 173949 
 173950 						(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*struct {
 173951 							f func(*libc.TLS, uintptr, int32) int32
 173952 						})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})).f(tls, pDb, SQLITE_SYNC_NORMAL)
 173953 
 173954 						if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173955 							(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*struct {
 173956 								f func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32
 173957 							})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})).f(tls, pDb, 0, 32*1024, 0, bp+16)
 173958 							if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173959 								*(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 24*4)) = (*Sqlite3rbu)(unsafe.Pointer(p)).FiMaxFrame
 173960 							}
 173961 						}
 173962 
 173963 						if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173964 							(*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_DONE
 173965 							(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_DONE
 173966 						}
 173967 					} else {
 173968 						var iSector U32
 173969 						for __ccgo := true; __ccgo; __ccgo = (*Sqlite3rbu)(unsafe.Pointer(p)).FnStep < (*Sqlite3rbu)(unsafe.Pointer(p)).FnFrame &&
 173970 							iSector == ((*RbuFrame)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FaFrame+uintptr((*Sqlite3rbu)(unsafe.Pointer(p)).FnStep)*8)).FiDbPage-U32(1))/U32((*Sqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector) &&
 173971 							(*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 173972 							var pFrame uintptr = (*Sqlite3rbu)(unsafe.Pointer(p)).FaFrame + uintptr((*Sqlite3rbu)(unsafe.Pointer(p)).FnStep)*8
 173973 							iSector = ((*RbuFrame)(unsafe.Pointer(pFrame)).FiDbPage - U32(1)) / U32((*Sqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector)
 173974 							rbuCheckpointFrame(tls, p, pFrame)
 173975 							(*Sqlite3rbu)(unsafe.Pointer(p)).FnStep++
 173976 						}
 173977 					}
 173978 					(*Sqlite3rbu)(unsafe.Pointer(p)).FnProgress++
 173979 				}
 173980 				break
 173981 
 173982 			}
 173983 			fallthrough
 173984 
 173985 		default:
 173986 			break
 173987 		}
 173988 		return (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
 173989 	} else {
 173990 		return SQLITE_NOMEM
 173991 	}
 173992 	return int32(0)
 173993 }
 173994 
 173995 func rbuStrCompare(tls *libc.TLS, z1 uintptr, z2 uintptr) int32 {
 173996 	if z1 == uintptr(0) && z2 == uintptr(0) {
 173997 		return 0
 173998 	}
 173999 	if z1 == uintptr(0) || z2 == uintptr(0) {
 174000 		return 1
 174001 	}
 174002 	return libc.Bool32(Xsqlite3_stricmp(tls, z1, z2) != 0)
 174003 }
 174004 
 174005 func rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) {
 174006 	if (*RbuState)(unsafe.Pointer(pState)).FzTbl != 0 {
 174007 		var pIter uintptr = p + 80
 174008 		var rc int32 = SQLITE_OK
 174009 
 174010 		for rc == SQLITE_OK && (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 && ((*RbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 ||
 174011 			rbuStrCompare(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx, (*RbuState)(unsafe.Pointer(pState)).FzIdx) != 0 ||
 174012 			(*RbuState)(unsafe.Pointer(pState)).FzDataTbl == uintptr(0) && rbuStrCompare(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, (*RbuState)(unsafe.Pointer(pState)).FzTbl) != 0 ||
 174013 			(*RbuState)(unsafe.Pointer(pState)).FzDataTbl != 0 && rbuStrCompare(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, (*RbuState)(unsafe.Pointer(pState)).FzDataTbl) != 0) {
 174014 			rc = rbuObjIterNext(tls, p, pIter)
 174015 		}
 174016 
 174017 		if rc == SQLITE_OK && !(int32((*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl) != 0) {
 174018 			rc = SQLITE_ERROR
 174019 			(*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+33320, 0)
 174020 		}
 174021 
 174022 		if rc == SQLITE_OK {
 174023 			(*Sqlite3rbu)(unsafe.Pointer(p)).FnStep = (*RbuState)(unsafe.Pointer(pState)).FnRow
 174024 			rc = rbuObjIterPrepareAll(tls, p, p+80, (*Sqlite3rbu)(unsafe.Pointer(p)).FnStep)
 174025 		}
 174026 
 174027 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc
 174028 	}
 174029 }
 174030 
 174031 func rbuDeleteOalFile(tls *libc.TLS, p uintptr) {
 174032 	bp := tls.Alloc(16)
 174033 	defer tls.Free(16)
 174034 
 174035 	var zOal uintptr = rbuMPrintf(tls, p, ts+32769, libc.VaList(bp, (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget))
 174036 	if zOal != 0 {
 174037 		*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 174038 		Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+7793, SQLITE_FCNTL_VFS_POINTER, bp+8)
 174039 
 174040 		(*struct {
 174041 			f func(*libc.TLS, uintptr, uintptr, int32) int32
 174042 		})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FxDelete})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), zOal, 0)
 174043 		Xsqlite3_free(tls, zOal)
 174044 	}
 174045 }
 174046 
 174047 func rbuCreateVfs(tls *libc.TLS, p uintptr) {
 174048 	bp := tls.Alloc(76)
 174049 	defer tls.Free(76)
 174050 
 174051 	Xsqlite3_randomness(tls, int32(unsafe.Sizeof(int32(0))), bp+8)
 174052 	Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([64]int8{})), bp+12, ts+33345, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8))))
 174053 	(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3rbu_create_vfs(tls, bp+12, uintptr(0))
 174054 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 174055 		var pVfs uintptr = Xsqlite3_vfs_find(tls, bp+12)
 174056 
 174057 		(*Sqlite3rbu)(unsafe.Pointer(p)).FzVfsName = (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FzName
 174058 		(*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRbu = p
 174059 	}
 174060 }
 174061 
 174062 func rbuDeleteVfs(tls *libc.TLS, p uintptr) {
 174063 	if (*Sqlite3rbu)(unsafe.Pointer(p)).FzVfsName != 0 {
 174064 		Xsqlite3rbu_destroy_vfs(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzVfsName)
 174065 		(*Sqlite3rbu)(unsafe.Pointer(p)).FzVfsName = uintptr(0)
 174066 	}
 174067 }
 174068 
 174069 func rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) {
 174070 	bp := tls.Alloc(24)
 174071 	defer tls.Free(24)
 174072 
 174073 	var p uintptr = Xsqlite3_user_data(tls, pCtx)
 174074 	*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 174075 	*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
 174076 	var rc int32
 174077 	var db uintptr = func() uintptr {
 174078 		if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
 174079 			return (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu
 174080 		}
 174081 		return (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain
 174082 	}()
 174083 
 174084 	rc = prepareFreeAndCollectError(tls, db, bp+8, bp+16,
 174085 		Xsqlite3_mprintf(tls,
 174086 			ts+33356, libc.VaList(bp, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal))))))
 174087 	if rc != SQLITE_OK {
 174088 		Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 16)), -1)
 174089 	} else {
 174090 		var nIndex int32 = 0
 174091 		if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) {
 174092 			nIndex = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), 0)
 174093 		}
 174094 		rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
 174095 		if rc == SQLITE_OK {
 174096 			Xsqlite3_result_int(tls, pCtx, nIndex)
 174097 		} else {
 174098 			Xsqlite3_result_error(tls, pCtx, Xsqlite3_errmsg(tls, db), -1)
 174099 		}
 174100 	}
 174101 
 174102 	Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
 174103 }
 174104 
 174105 func rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) {
 174106 	bp := tls.Alloc(8)
 174107 	defer tls.Free(8)
 174108 
 174109 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 174110 		*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 174111 		var bExists int32 = 0
 174112 
 174113 		(*Sqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = int64(-1)
 174114 
 174115 		(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu,
 174116 			ts+33428, 1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct {
 174117 				f func(*libc.TLS, uintptr, int32, uintptr)
 174118 			}{rbuIndexCntFunc})), uintptr(0), uintptr(0))
 174119 
 174120 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 174121 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64,
 174122 				ts+33442)
 174123 		}
 174124 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 174125 			if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) {
 174126 				bExists = 1
 174127 			}
 174128 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp)))
 174129 		}
 174130 
 174131 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && bExists != 0 {
 174132 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64,
 174133 				ts+33499)
 174134 			if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 174135 				if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) {
 174136 					(*Sqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0)
 174137 				}
 174138 				(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp)))
 174139 			}
 174140 		}
 174141 	}
 174142 }
 174143 
 174144 func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) uintptr {
 174145 	bp := tls.Alloc(20)
 174146 	defer tls.Free(20)
 174147 
 174148 	var p uintptr
 174149 	var nTarget Size_t
 174150 	if zTarget != 0 {
 174151 		nTarget = libc.Xstrlen(tls, zTarget)
 174152 	} else {
 174153 		nTarget = uint64(0)
 174154 	}
 174155 	var nRbu Size_t = libc.Xstrlen(tls, zRbu)
 174156 	var nByte Size_t = uint64(unsafe.Sizeof(Sqlite3rbu{})) + nTarget + uint64(1) + nRbu + uint64(1)
 174157 
 174158 	p = Xsqlite3_malloc64(tls, nByte)
 174159 	if p != 0 {
 174160 		var pState uintptr = uintptr(0)
 174161 
 174162 		libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Sqlite3rbu{})))
 174163 		Xsqlite3rbu_rename_handler(tls, p, uintptr(0), uintptr(0))
 174164 		rbuCreateVfs(tls, p)
 174165 
 174166 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 174167 			var pCsr uintptr = p + 1*408
 174168 			*(*int32)(unsafe.Pointer(bp + 16)) = 0
 174169 			if zTarget != 0 {
 174170 				(*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget = pCsr
 174171 				libc.Xmemcpy(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget, zTarget, nTarget+uint64(1))
 174172 				pCsr += uintptr(nTarget + uint64(1))
 174173 			}
 174174 			(*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu = pCsr
 174175 			libc.Xmemcpy(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu, zRbu, nRbu+uint64(1))
 174176 			pCsr += uintptr(nRbu + uint64(1))
 174177 			if zState != 0 {
 174178 				(*Sqlite3rbu)(unsafe.Pointer(p)).FzState = rbuMPrintf(tls, p, ts+4493, libc.VaList(bp, zState))
 174179 			}
 174180 
 174181 			rbuOpenDatabase(tls, p, uintptr(0), bp+16)
 174182 			if *(*int32)(unsafe.Pointer(bp + 16)) != 0 {
 174183 				rbuOpenDatabase(tls, p, uintptr(0), uintptr(0))
 174184 			}
 174185 		}
 174186 
 174187 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 174188 			pState = rbuLoadState(tls, p)
 174189 
 174190 			if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 174191 				if (*RbuState)(unsafe.Pointer(pState)).FeStage == 0 {
 174192 					rbuDeleteOalFile(tls, p)
 174193 					rbuInitPhaseOneSteps(tls, p)
 174194 					(*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_OAL
 174195 				} else {
 174196 					(*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = (*RbuState)(unsafe.Pointer(pState)).FeStage
 174197 					(*Sqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = (*RbuState)(unsafe.Pointer(pState)).FnPhaseOneStep
 174198 				}
 174199 				(*Sqlite3rbu)(unsafe.Pointer(p)).FnProgress = int32((*RbuState)(unsafe.Pointer(pState)).FnProgress)
 174200 				(*Sqlite3rbu)(unsafe.Pointer(p)).FiOalSz = (*RbuState)(unsafe.Pointer(pState)).FiOalSz
 174201 			}
 174202 		}
 174203 
 174204 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd != 0 {
 174205 			if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL {
 174206 				(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR
 174207 				(*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+33573, 0)
 174208 			} else if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_MOVE {
 174209 				(*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_CKPT
 174210 				(*Sqlite3rbu)(unsafe.Pointer(p)).FnStep = 0
 174211 			}
 174212 		}
 174213 
 174214 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK &&
 174215 			((*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL || (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_MOVE) &&
 174216 			(*RbuState)(unsafe.Pointer(pState)).FeStage != 0 {
 174217 			var pFd uintptr = func() uintptr {
 174218 				if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
 174219 					return (*Sqlite3rbu)(unsafe.Pointer(p)).FpRbuFd
 174220 				}
 174221 				return (*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd
 174222 			}()
 174223 			if (*Rbu_file)(unsafe.Pointer(pFd)).FiCookie != (*RbuState)(unsafe.Pointer(pState)).FiCookie {
 174224 				(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_BUSY
 174225 				(*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+33605,
 174226 					libc.VaList(bp+8, func() uintptr {
 174227 						if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
 174228 							return ts + 33637
 174229 						}
 174230 						return ts + 33644
 174231 					}()))
 174232 			}
 174233 		}
 174234 
 174235 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 174236 			if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL {
 174237 				var db uintptr = (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain
 174238 				(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+15860, uintptr(0), uintptr(0), p+64)
 174239 
 174240 				if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 174241 					(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rbuObjIterFirst(tls, p, p+80)
 174242 				}
 174243 
 174244 				if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl == uintptr(0) {
 174245 					(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_DONE
 174246 					(*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_DONE
 174247 				} else {
 174248 					if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*RbuState)(unsafe.Pointer(pState)).FeStage == 0 && (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
 174249 						rbuCopyPragma(tls, p, ts+18333)
 174250 						rbuCopyPragma(tls, p, ts+17724)
 174251 					}
 174252 
 174253 					if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 174254 						(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, ts+33651, uintptr(0), uintptr(0), p+64)
 174255 					}
 174256 
 174257 					if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 174258 						var frc int32 = Xsqlite3_file_control(tls, db, ts+7793, SQLITE_FCNTL_ZIPVFS, uintptr(0))
 174259 						if frc == SQLITE_OK {
 174260 							(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls,
 174261 								db, ts+33667, uintptr(0), uintptr(0), p+64)
 174262 						}
 174263 					}
 174264 
 174265 					if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 174266 						rbuSetupOal(tls, p, pState)
 174267 					}
 174268 				}
 174269 			} else if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_MOVE {
 174270 			} else if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_CKPT {
 174271 				if !((*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) && rbuExclusiveCheckpoint(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain) != 0 {
 174272 					(*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_DONE
 174273 					rbuLockDatabase(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain)
 174274 					(*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_CKPT
 174275 				}
 174276 				rbuSetupCheckpoint(tls, p, pState)
 174277 			} else if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_DONE {
 174278 				(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_DONE
 174279 			} else {
 174280 				(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT
 174281 			}
 174282 		}
 174283 
 174284 		rbuFreeState(tls, pState)
 174285 	}
 174286 
 174287 	return p
 174288 }
 174289 
 174290 func rbuMisuseError(tls *libc.TLS) uintptr {
 174291 	var pRet uintptr
 174292 	pRet = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(Sqlite3rbu{})))
 174293 	if pRet != 0 {
 174294 		libc.Xmemset(tls, pRet, 0, uint64(unsafe.Sizeof(Sqlite3rbu{})))
 174295 		(*Sqlite3rbu)(unsafe.Pointer(pRet)).Frc = SQLITE_MISUSE
 174296 	}
 174297 	return pRet
 174298 }
 174299 
 174300 // Open and return a new RBU handle.
 174301 func Xsqlite3rbu_open(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) uintptr {
 174302 	if zTarget == uintptr(0) || zRbu == uintptr(0) {
 174303 		return rbuMisuseError(tls)
 174304 	}
 174305 	return openRbuHandle(tls, zTarget, zRbu, zState)
 174306 }
 174307 
 174308 // Open a handle to begin or resume an RBU VACUUM operation.
 174309 func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) uintptr {
 174310 	if zTarget == uintptr(0) {
 174311 		return rbuMisuseError(tls)
 174312 	}
 174313 	if zState != 0 {
 174314 		var n int32 = int32(libc.Xstrlen(tls, zState))
 174315 		if n >= 7 && 0 == libc.Xmemcmp(tls, ts+33691, zState+uintptr(n-7), uint64(7)) {
 174316 			return rbuMisuseError(tls)
 174317 		}
 174318 	}
 174319 
 174320 	return openRbuHandle(tls, uintptr(0), zTarget, zState)
 174321 }
 174322 
 174323 // Return the database handle used by pRbu.
 174324 func Xsqlite3rbu_db(tls *libc.TLS, pRbu uintptr, bRbu int32) uintptr {
 174325 	var db uintptr = uintptr(0)
 174326 	if pRbu != 0 {
 174327 		db = func() uintptr {
 174328 			if bRbu != 0 {
 174329 				return (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FdbRbu
 174330 			}
 174331 			return (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FdbMain
 174332 		}()
 174333 	}
 174334 	return db
 174335 }
 174336 
 174337 func rbuEditErrmsg(tls *libc.TLS, p uintptr) {
 174338 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_CONSTRAINT && (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg != 0 {
 174339 		var i uint32
 174340 		var nErrmsg Size_t = libc.Xstrlen(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg)
 174341 		for i = uint32(0); Size_t(i) < nErrmsg-uint64(8); i++ {
 174342 			if libc.Xmemcmp(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), ts+31716, uint64(8)) == 0 {
 174343 				var nDel int32 = 8
 174344 				for int32(*(*int8)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+uint32(nDel))))) >= '0' && int32(*(*int8)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+uint32(nDel))))) <= '9' {
 174345 					nDel++
 174346 				}
 174347 				libc.Xmemmove(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i+uint32(nDel)), nErrmsg+uint64(1)-Size_t(i)-Size_t(nDel))
 174348 				nErrmsg = nErrmsg - Size_t(nDel)
 174349 			}
 174350 		}
 174351 	}
 174352 }
 174353 
 174354 // Close the RBU handle.
 174355 func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) int32 {
 174356 	var rc int32
 174357 	if p != 0 {
 174358 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL {
 174359 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+15875, uintptr(0), uintptr(0), p+64)
 174360 		}
 174361 
 174362 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_CKPT {
 174363 			var pDb uintptr = (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal
 174364 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*struct {
 174365 				f func(*libc.TLS, uintptr, int32) int32
 174366 			})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})).f(tls, pDb, SQLITE_SYNC_NORMAL)
 174367 		}
 174368 
 174369 		rbuSaveState(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage)
 174370 
 174371 		if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL {
 174372 			(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+15875, uintptr(0), uintptr(0), p+64)
 174373 		}
 174374 
 174375 		rbuObjIterFinalize(tls, p+80)
 174376 
 174377 		if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK && (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu != 0 {
 174378 			var rc2 int32 = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+33699, uintptr(0), uintptr(0), uintptr(0))
 174379 			if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_DONE && rc2 != SQLITE_OK {
 174380 				(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc2
 174381 			}
 174382 		}
 174383 
 174384 		Xsqlite3_close(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu)
 174385 		Xsqlite3_close(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain)
 174386 
 174387 		rbuDeleteVfs(tls, p)
 174388 		Xsqlite3_free(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FaBuf)
 174389 		Xsqlite3_free(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FaFrame)
 174390 
 174391 		rbuEditErrmsg(tls, p)
 174392 		rc = (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
 174393 		if pzErrmsg != 0 {
 174394 			*(*uintptr)(unsafe.Pointer(pzErrmsg)) = (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg
 174395 		} else {
 174396 			Xsqlite3_free(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg)
 174397 		}
 174398 		Xsqlite3_free(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzState)
 174399 		Xsqlite3_free(tls, p)
 174400 	} else {
 174401 		rc = SQLITE_NOMEM
 174402 		*(*uintptr)(unsafe.Pointer(pzErrmsg)) = uintptr(0)
 174403 	}
 174404 	return rc
 174405 }
 174406 
 174407 // Return the total number of key-value operations (inserts, deletes or
 174408 // updates) that have been performed on the target database since the
 174409 // current RBU update was started.
 174410 func Xsqlite3rbu_progress(tls *libc.TLS, pRbu uintptr) Sqlite3_int64 {
 174411 	return Sqlite3_int64((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnProgress)
 174412 }
 174413 
 174414 // Return permyriadage progress indications for the two main stages of
 174415 // an RBU update.
 174416 func Xsqlite3rbu_bp_progress(tls *libc.TLS, p uintptr, pnOne uintptr, pnTwo uintptr) {
 174417 	var MAX_PROGRESS int32 = 10000
 174418 	switch (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage {
 174419 	case RBU_STAGE_OAL:
 174420 		if (*Sqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep > int64(0) {
 174421 			*(*int32)(unsafe.Pointer(pnOne)) = int32(I64(MAX_PROGRESS) * I64((*Sqlite3rbu)(unsafe.Pointer(p)).FnProgress) / (*Sqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep)
 174422 		} else {
 174423 			*(*int32)(unsafe.Pointer(pnOne)) = -1
 174424 		}
 174425 		*(*int32)(unsafe.Pointer(pnTwo)) = 0
 174426 		break
 174427 
 174428 	case RBU_STAGE_MOVE:
 174429 		*(*int32)(unsafe.Pointer(pnOne)) = MAX_PROGRESS
 174430 		*(*int32)(unsafe.Pointer(pnTwo)) = 0
 174431 		break
 174432 
 174433 	case RBU_STAGE_CKPT:
 174434 		*(*int32)(unsafe.Pointer(pnOne)) = MAX_PROGRESS
 174435 		*(*int32)(unsafe.Pointer(pnTwo)) = int32(I64(MAX_PROGRESS) * I64((*Sqlite3rbu)(unsafe.Pointer(p)).FnStep) / I64((*Sqlite3rbu)(unsafe.Pointer(p)).FnFrame))
 174436 		break
 174437 
 174438 	case RBU_STAGE_DONE:
 174439 		*(*int32)(unsafe.Pointer(pnOne)) = MAX_PROGRESS
 174440 		*(*int32)(unsafe.Pointer(pnTwo)) = MAX_PROGRESS
 174441 		break
 174442 
 174443 	default:
 174444 	}
 174445 }
 174446 
 174447 // Return the current state of the RBU vacuum or update operation.
 174448 func Xsqlite3rbu_state(tls *libc.TLS, p uintptr) int32 {
 174449 	bp := tls.Alloc(24)
 174450 	defer tls.Free(24)
 174451 
 174452 	*(*[6]int32)(unsafe.Pointer(bp)) = [6]int32{
 174453 		0, SQLITE_RBU_STATE_OAL, SQLITE_RBU_STATE_MOVE,
 174454 		0, SQLITE_RBU_STATE_CHECKPOINT, SQLITE_RBU_STATE_DONE,
 174455 	}
 174456 
 174457 	if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK && (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_DONE {
 174458 		return SQLITE_RBU_STATE_ERROR
 174459 	} else {
 174460 		return *(*int32)(unsafe.Pointer(bp + uintptr((*Sqlite3rbu)(unsafe.Pointer(p)).FeStage)*4))
 174461 	}
 174462 	return int32(0)
 174463 }
 174464 
 174465 func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) int32 {
 174466 	var rc int32 = (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
 174467 	if rc == SQLITE_DONE {
 174468 		return SQLITE_OK
 174469 	}
 174470 
 174471 	if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL {
 174472 		if rc == SQLITE_OK {
 174473 			rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+15875, uintptr(0), uintptr(0), uintptr(0))
 174474 		}
 174475 	}
 174476 
 174477 	if rc == SQLITE_OK && (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_CKPT {
 174478 		var pDb uintptr = (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal
 174479 		rc = (*struct {
 174480 			f func(*libc.TLS, uintptr, int32) int32
 174481 		})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})).f(tls, pDb, SQLITE_SYNC_NORMAL)
 174482 	}
 174483 
 174484 	(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc
 174485 	rbuSaveState(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage)
 174486 	rc = (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
 174487 
 174488 	if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL {
 174489 		if rc == SQLITE_OK {
 174490 			rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+15875, uintptr(0), uintptr(0), uintptr(0))
 174491 		}
 174492 		if rc == SQLITE_OK {
 174493 			var zBegin uintptr
 174494 			if (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) {
 174495 				zBegin = ts + 15860
 174496 			} else {
 174497 				zBegin = ts + 33651
 174498 			}
 174499 			rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, zBegin, uintptr(0), uintptr(0), uintptr(0))
 174500 		}
 174501 		if rc == SQLITE_OK {
 174502 			rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+33651, uintptr(0), uintptr(0), uintptr(0))
 174503 		}
 174504 	}
 174505 
 174506 	(*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc
 174507 	return rc
 174508 }
 174509 
 174510 func xDefaultRename(tls *libc.TLS, pArg uintptr, zOld uintptr, zNew uintptr) int32 {
 174511 	var rc int32 = SQLITE_OK
 174512 	if libc.Xrename(tls, zOld, zNew) != 0 {
 174513 		rc = SQLITE_IOERR
 174514 	} else {
 174515 		rc = SQLITE_OK
 174516 	}
 174517 	return rc
 174518 }
 174519 
 174520 func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, xRename uintptr) {
 174521 	if xRename != 0 {
 174522 		(*Sqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = xRename
 174523 		(*Sqlite3rbu)(unsafe.Pointer(pRbu)).FpRenameArg = pArg
 174524 	} else {
 174525 		(*Sqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = *(*uintptr)(unsafe.Pointer(&struct {
 174526 			f func(*libc.TLS, uintptr, uintptr, uintptr) int32
 174527 		}{xDefaultRename}))
 174528 		(*Sqlite3rbu)(unsafe.Pointer(pRbu)).FpRenameArg = uintptr(0)
 174529 	}
 174530 }
 174531 
 174532 func rbuUnlockShm(tls *libc.TLS, p uintptr) {
 174533 	if (*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0 {
 174534 		var xShmLock uintptr = (*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock
 174535 		var i int32
 174536 		for i = 0; i < SQLITE_SHM_NLOCK; i++ {
 174537 			if U32(int32(1)<<i)&(*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbu)).FmLock != 0 {
 174538 				(*struct {
 174539 					f func(*libc.TLS, uintptr, int32, int32, int32) int32
 174540 				})(unsafe.Pointer(&struct{ uintptr }{xShmLock})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, i, 1, SQLITE_SHM_UNLOCK|SQLITE_SHM_EXCLUSIVE)
 174541 			}
 174542 		}
 174543 		(*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbu)).FmLock = U32(0)
 174544 	}
 174545 }
 174546 
 174547 func rbuUpdateTempSize(tls *libc.TLS, pFd uintptr, nNew Sqlite3_int64) int32 {
 174548 	var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(pFd)).FpRbu
 174549 	var nDiff I64 = nNew - (*Rbu_file)(unsafe.Pointer(pFd)).Fsz
 174550 	*(*I64)(unsafe.Pointer(pRbu + 376)) += nDiff
 174551 	(*Rbu_file)(unsafe.Pointer(pFd)).Fsz = nNew
 174552 
 174553 	if (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTempLimit != 0 && (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTemp > (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTempLimit {
 174554 		return SQLITE_FULL
 174555 	}
 174556 	return SQLITE_OK
 174557 }
 174558 
 174559 func rbuMainlistAdd(tls *libc.TLS, p uintptr) {
 174560 	var pRbuVfs uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs
 174561 	var pIter uintptr
 174562 
 174563 	Xsqlite3_mutex_enter(tls, (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).Fmutex)
 174564 	if (*Rbu_file)(unsafe.Pointer(p)).FpRbu == uintptr(0) {
 174565 		for pIter = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMain; pIter != 0; pIter = (*Rbu_file)(unsafe.Pointer(pIter)).FpMainNext {
 174566 		}
 174567 		(*Rbu_file)(unsafe.Pointer(p)).FpMainNext = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMain
 174568 		(*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMain = p
 174569 	} else {
 174570 		for pIter = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMainRbu; pIter != 0 && pIter != p; pIter = (*Rbu_file)(unsafe.Pointer(pIter)).FpMainRbuNext {
 174571 		}
 174572 		if pIter == uintptr(0) {
 174573 			(*Rbu_file)(unsafe.Pointer(p)).FpMainRbuNext = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMainRbu
 174574 			(*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMainRbu = p
 174575 		}
 174576 	}
 174577 	Xsqlite3_mutex_leave(tls, (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).Fmutex)
 174578 }
 174579 
 174580 func rbuMainlistRemove(tls *libc.TLS, p uintptr) {
 174581 	var pp uintptr
 174582 	Xsqlite3_mutex_enter(tls, (*Rbu_vfs)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs)).Fmutex)
 174583 	for pp = (*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs + 192; *(*uintptr)(unsafe.Pointer(pp)) != 0 && *(*uintptr)(unsafe.Pointer(pp)) != p; pp = *(*uintptr)(unsafe.Pointer(pp)) + 88 {
 174584 	}
 174585 	if *(*uintptr)(unsafe.Pointer(pp)) != 0 {
 174586 		*(*uintptr)(unsafe.Pointer(pp)) = (*Rbu_file)(unsafe.Pointer(p)).FpMainNext
 174587 	}
 174588 	(*Rbu_file)(unsafe.Pointer(p)).FpMainNext = uintptr(0)
 174589 	for pp = (*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs + 200; *(*uintptr)(unsafe.Pointer(pp)) != 0 && *(*uintptr)(unsafe.Pointer(pp)) != p; pp = *(*uintptr)(unsafe.Pointer(pp)) + 96 {
 174590 	}
 174591 	if *(*uintptr)(unsafe.Pointer(pp)) != 0 {
 174592 		*(*uintptr)(unsafe.Pointer(pp)) = (*Rbu_file)(unsafe.Pointer(p)).FpMainRbuNext
 174593 	}
 174594 	(*Rbu_file)(unsafe.Pointer(p)).FpMainRbuNext = uintptr(0)
 174595 	Xsqlite3_mutex_leave(tls, (*Rbu_vfs)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs)).Fmutex)
 174596 }
 174597 
 174598 func rbuFindMaindb(tls *libc.TLS, pRbuVfs uintptr, zWal uintptr, bRbu int32) uintptr {
 174599 	var pDb uintptr
 174600 	Xsqlite3_mutex_enter(tls, (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).Fmutex)
 174601 	if bRbu != 0 {
 174602 		for pDb = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMainRbu; pDb != 0 && (*Rbu_file)(unsafe.Pointer(pDb)).FzWal != zWal; pDb = (*Rbu_file)(unsafe.Pointer(pDb)).FpMainRbuNext {
 174603 		}
 174604 	} else {
 174605 		for pDb = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMain; pDb != 0 && (*Rbu_file)(unsafe.Pointer(pDb)).FzWal != zWal; pDb = (*Rbu_file)(unsafe.Pointer(pDb)).FpMainNext {
 174606 		}
 174607 	}
 174608 	Xsqlite3_mutex_leave(tls, (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).Fmutex)
 174609 	return pDb
 174610 }
 174611 
 174612 func rbuVfsClose(tls *libc.TLS, pFile uintptr) int32 {
 174613 	var p uintptr = pFile
 174614 	var rc int32
 174615 	var i int32
 174616 
 174617 	for i = 0; i < (*Rbu_file)(unsafe.Pointer(p)).FnShm; i++ {
 174618 		Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FapShm + uintptr(i)*8)))
 174619 	}
 174620 	Xsqlite3_free(tls, (*Rbu_file)(unsafe.Pointer(p)).FapShm)
 174621 	(*Rbu_file)(unsafe.Pointer(p)).FapShm = uintptr(0)
 174622 	Xsqlite3_free(tls, (*Rbu_file)(unsafe.Pointer(p)).FzDel)
 174623 
 174624 	if (*Rbu_file)(unsafe.Pointer(p)).FopenFlags&SQLITE_OPEN_MAIN_DB != 0 {
 174625 		var pMeth uintptr = (*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods
 174626 		rbuMainlistRemove(tls, p)
 174627 		rbuUnlockShm(tls, p)
 174628 		if (*Sqlite3_io_methods)(unsafe.Pointer(pMeth)).FiVersion > 1 && (*Sqlite3_io_methods)(unsafe.Pointer(pMeth)).FxShmUnmap != 0 {
 174629 			(*struct {
 174630 				f func(*libc.TLS, uintptr, int32) int32
 174631 			})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_io_methods)(unsafe.Pointer(pMeth)).FxShmUnmap})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, 0)
 174632 		}
 174633 	} else if (*Rbu_file)(unsafe.Pointer(p)).FopenFlags&SQLITE_OPEN_DELETEONCLOSE != 0 && (*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0 {
 174634 		rbuUpdateTempSize(tls, p, int64(0))
 174635 	}
 174636 
 174637 	rc = (*struct {
 174638 		f func(*libc.TLS, uintptr) int32
 174639 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal)
 174640 	return rc
 174641 }
 174642 
 174643 func rbuGetU32(tls *libc.TLS, aBuf uintptr) U32 {
 174644 	return U32(*(*U8)(unsafe.Pointer(aBuf)))<<24 +
 174645 		U32(*(*U8)(unsafe.Pointer(aBuf + 1)))<<16 +
 174646 		U32(*(*U8)(unsafe.Pointer(aBuf + 2)))<<8 +
 174647 		U32(*(*U8)(unsafe.Pointer(aBuf + 3)))
 174648 }
 174649 
 174650 func rbuPutU32(tls *libc.TLS, aBuf uintptr, iVal U32) {
 174651 	*(*U8)(unsafe.Pointer(aBuf)) = U8(iVal >> 24 & U32(0xFF))
 174652 	*(*U8)(unsafe.Pointer(aBuf + 1)) = U8(iVal >> 16 & U32(0xFF))
 174653 	*(*U8)(unsafe.Pointer(aBuf + 2)) = U8(iVal >> 8 & U32(0xFF))
 174654 	*(*U8)(unsafe.Pointer(aBuf + 3)) = U8(iVal >> 0 & U32(0xFF))
 174655 }
 174656 
 174657 func rbuPutU16(tls *libc.TLS, aBuf uintptr, iVal U16) {
 174658 	*(*U8)(unsafe.Pointer(aBuf)) = U8(int32(iVal) >> 8 & 0xFF)
 174659 	*(*U8)(unsafe.Pointer(aBuf + 1)) = U8(int32(iVal) >> 0 & 0xFF)
 174660 }
 174661 
 174662 func rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 {
 174663 	var p uintptr = pFile
 174664 	var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbu
 174665 	var rc int32
 174666 
 174667 	if pRbu != 0 && (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_CAPTURE {
 174668 		rc = rbuCaptureWalRead(tls, (*Rbu_file)(unsafe.Pointer(p)).FpRbu, iOfst, iAmt)
 174669 	} else {
 174670 		if pRbu != 0 && (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_OAL &&
 174671 			(*Rbu_file)(unsafe.Pointer(p)).FopenFlags&SQLITE_OPEN_WAL != 0 &&
 174672 			iOfst >= (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FiOalSz {
 174673 			rc = SQLITE_OK
 174674 			libc.Xmemset(tls, zBuf, 0, uint64(iAmt))
 174675 		} else {
 174676 			rc = (*struct {
 174677 				f func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32
 174678 			})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst)
 174679 
 174680 			if pRbu != 0 && (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FzTarget == uintptr(0) &&
 174681 				rc == SQLITE_IOERR|int32(2)<<8 && iOfst == int64(0) &&
 174682 				(*Rbu_file)(unsafe.Pointer(p)).FopenFlags&SQLITE_OPEN_MAIN_DB != 0 &&
 174683 				(*Sqlite3rbu)(unsafe.Pointer(pRbu)).Frc == SQLITE_OK {
 174684 				var pFd uintptr = (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FpRbuFd
 174685 				rc = (*struct {
 174686 					f func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32
 174687 				})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FxRead})).f(tls, pFd, zBuf, iAmt, iOfst)
 174688 				if rc == SQLITE_OK {
 174689 					var aBuf uintptr = zBuf
 174690 					var iRoot U32
 174691 					if rbuGetU32(tls, aBuf+52) != 0 {
 174692 						iRoot = uint32(1)
 174693 					} else {
 174694 						iRoot = uint32(0)
 174695 					}
 174696 					rbuPutU32(tls, aBuf+52, iRoot)
 174697 					rbuPutU32(tls, aBuf+36, uint32(0))
 174698 					rbuPutU32(tls, aBuf+32, uint32(0))
 174699 					rbuPutU32(tls, aBuf+28, uint32(1))
 174700 					rbuPutU32(tls, aBuf+24, (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FpRbuFd)).FiCookie+U32(1))
 174701 
 174702 					if iAmt > 100 {
 174703 						libc.Xmemset(tls, aBuf+100, 0, uint64(iAmt-100))
 174704 						rbuPutU16(tls, aBuf+105, uint16(iAmt&0xFFFF))
 174705 						*(*U8)(unsafe.Pointer(aBuf + 100)) = U8(0x0D)
 174706 					}
 174707 				}
 174708 			}
 174709 		}
 174710 		if rc == SQLITE_OK && iOfst == int64(0) && (*Rbu_file)(unsafe.Pointer(p)).FopenFlags&SQLITE_OPEN_MAIN_DB != 0 {
 174711 			var pBuf uintptr = zBuf
 174712 			(*Rbu_file)(unsafe.Pointer(p)).FiCookie = rbuGetU32(tls, pBuf+24)
 174713 			(*Rbu_file)(unsafe.Pointer(p)).FiWriteVer = *(*U8)(unsafe.Pointer(pBuf + 19))
 174714 		}
 174715 	}
 174716 	return rc
 174717 }
 174718 
 174719 func rbuVfsWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 {
 174720 	var p uintptr = pFile
 174721 	var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbu
 174722 	var rc int32
 174723 
 174724 	if pRbu != 0 && (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_CAPTURE {
 174725 		rc = rbuCaptureDbWrite(tls, (*Rbu_file)(unsafe.Pointer(p)).FpRbu, iOfst)
 174726 	} else {
 174727 		if pRbu != 0 {
 174728 			if (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_OAL &&
 174729 				(*Rbu_file)(unsafe.Pointer(p)).FopenFlags&SQLITE_OPEN_WAL != 0 &&
 174730 				iOfst >= (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FiOalSz {
 174731 				(*Sqlite3rbu)(unsafe.Pointer(pRbu)).FiOalSz = Sqlite_int64(iAmt) + iOfst
 174732 			} else if (*Rbu_file)(unsafe.Pointer(p)).FopenFlags&SQLITE_OPEN_DELETEONCLOSE != 0 {
 174733 				var szNew I64 = Sqlite_int64(iAmt) + iOfst
 174734 				if szNew > (*Rbu_file)(unsafe.Pointer(p)).Fsz {
 174735 					rc = rbuUpdateTempSize(tls, p, szNew)
 174736 					if rc != SQLITE_OK {
 174737 						return rc
 174738 					}
 174739 				}
 174740 			}
 174741 		}
 174742 		rc = (*struct {
 174743 			f func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32
 174744 		})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxWrite})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst)
 174745 		if rc == SQLITE_OK && iOfst == int64(0) && (*Rbu_file)(unsafe.Pointer(p)).FopenFlags&SQLITE_OPEN_MAIN_DB != 0 {
 174746 			var pBuf uintptr = zBuf
 174747 			(*Rbu_file)(unsafe.Pointer(p)).FiCookie = rbuGetU32(tls, pBuf+24)
 174748 			(*Rbu_file)(unsafe.Pointer(p)).FiWriteVer = *(*U8)(unsafe.Pointer(pBuf + 19))
 174749 		}
 174750 	}
 174751 	return rc
 174752 }
 174753 
 174754 func rbuVfsTruncate(tls *libc.TLS, pFile uintptr, size Sqlite_int64) int32 {
 174755 	var p uintptr = pFile
 174756 	if (*Rbu_file)(unsafe.Pointer(p)).FopenFlags&SQLITE_OPEN_DELETEONCLOSE != 0 && (*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0 {
 174757 		var rc int32 = rbuUpdateTempSize(tls, p, size)
 174758 		if rc != SQLITE_OK {
 174759 			return rc
 174760 		}
 174761 	}
 174762 	return (*struct {
 174763 		f func(*libc.TLS, uintptr, Sqlite3_int64) int32
 174764 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxTruncate})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, size)
 174765 }
 174766 
 174767 func rbuVfsSync(tls *libc.TLS, pFile uintptr, flags int32) int32 {
 174768 	var p uintptr = pFile
 174769 	if (*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0 && (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbu)).FeStage == RBU_STAGE_CAPTURE {
 174770 		if (*Rbu_file)(unsafe.Pointer(p)).FopenFlags&SQLITE_OPEN_MAIN_DB != 0 {
 174771 			return SQLITE_NOTICE | int32(3)<<8
 174772 		}
 174773 		return SQLITE_OK
 174774 	}
 174775 	return (*struct {
 174776 		f func(*libc.TLS, uintptr, int32) int32
 174777 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxSync})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, flags)
 174778 }
 174779 
 174780 func rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 {
 174781 	var p uintptr = pFile
 174782 	var rc int32
 174783 	rc = (*struct {
 174784 		f func(*libc.TLS, uintptr, uintptr) int32
 174785 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxFileSize})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, pSize)
 174786 
 174787 	if rc == SQLITE_OK && *(*Sqlite_int64)(unsafe.Pointer(pSize)) == int64(0) &&
 174788 		(*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0 && (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbu)).FzTarget == uintptr(0) &&
 174789 		(*Rbu_file)(unsafe.Pointer(p)).FopenFlags&SQLITE_OPEN_MAIN_DB != 0 {
 174790 		*(*Sqlite_int64)(unsafe.Pointer(pSize)) = int64(1024)
 174791 	}
 174792 	return rc
 174793 }
 174794 
 174795 func rbuVfsLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 {
 174796 	var p uintptr = pFile
 174797 	var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbu
 174798 	var rc int32 = SQLITE_OK
 174799 
 174800 	if eLock == SQLITE_LOCK_EXCLUSIVE &&
 174801 		((*Rbu_file)(unsafe.Pointer(p)).FbNolock != 0 || pRbu != 0 && (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage != RBU_STAGE_DONE) {
 174802 		rc = SQLITE_BUSY
 174803 	} else {
 174804 		rc = (*struct {
 174805 			f func(*libc.TLS, uintptr, int32) int32
 174806 		})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxLock})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, eLock)
 174807 	}
 174808 
 174809 	return rc
 174810 }
 174811 
 174812 func rbuVfsUnlock(tls *libc.TLS, pFile uintptr, eLock int32) int32 {
 174813 	var p uintptr = pFile
 174814 	return (*struct {
 174815 		f func(*libc.TLS, uintptr, int32) int32
 174816 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxUnlock})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, eLock)
 174817 }
 174818 
 174819 func rbuVfsCheckReservedLock(tls *libc.TLS, pFile uintptr, pResOut uintptr) int32 {
 174820 	var p uintptr = pFile
 174821 	return (*struct {
 174822 		f func(*libc.TLS, uintptr, uintptr) int32
 174823 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxCheckReservedLock})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, pResOut)
 174824 }
 174825 
 174826 func rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 {
 174827 	bp := tls.Alloc(24)
 174828 	defer tls.Free(24)
 174829 
 174830 	var p uintptr = pFile
 174831 	var xControl uintptr = (*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxFileControl
 174832 	var rc int32
 174833 
 174834 	if op == SQLITE_FCNTL_RBU {
 174835 		var pRbu uintptr = pArg
 174836 
 174837 		rc = (*struct {
 174838 			f func(*libc.TLS, uintptr, int32, uintptr) int32
 174839 		})(unsafe.Pointer(&struct{ uintptr }{xControl})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, op, pArg)
 174840 
 174841 		if rc == SQLITE_NOTFOUND {
 174842 			*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
 174843 			rc = (*struct {
 174844 				f func(*libc.TLS, uintptr, int32, uintptr) int32
 174845 			})(unsafe.Pointer(&struct{ uintptr }{xControl})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, SQLITE_FCNTL_ZIPVFS, bp+16)
 174846 			if rc == SQLITE_OK {
 174847 				rc = SQLITE_ERROR
 174848 				(*Sqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, ts+33726, 0)
 174849 			} else if rc == SQLITE_NOTFOUND {
 174850 				(*Sqlite3rbu)(unsafe.Pointer(pRbu)).FpTargetFd = p
 174851 				(*Rbu_file)(unsafe.Pointer(p)).FpRbu = pRbu
 174852 				rbuMainlistAdd(tls, p)
 174853 				if (*Rbu_file)(unsafe.Pointer(p)).FpWalFd != 0 {
 174854 					(*Rbu_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpWalFd)).FpRbu = pRbu
 174855 				}
 174856 				rc = SQLITE_OK
 174857 			}
 174858 		}
 174859 		return rc
 174860 	} else if op == SQLITE_FCNTL_RBUCNT {
 174861 		var pRbu uintptr = pArg
 174862 		(*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnRbu++
 174863 		(*Sqlite3rbu)(unsafe.Pointer(pRbu)).FpRbuFd = p
 174864 		(*Rbu_file)(unsafe.Pointer(p)).FbNolock = U8(1)
 174865 	}
 174866 
 174867 	rc = (*struct {
 174868 		f func(*libc.TLS, uintptr, int32, uintptr) int32
 174869 	})(unsafe.Pointer(&struct{ uintptr }{xControl})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, op, pArg)
 174870 	if rc == SQLITE_OK && op == SQLITE_FCNTL_VFSNAME {
 174871 		var pRbuVfs uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs
 174872 		var zIn uintptr = *(*uintptr)(unsafe.Pointer(pArg))
 174873 		var zOut uintptr = Xsqlite3_mprintf(tls, ts+33749, libc.VaList(bp, (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn))
 174874 		*(*uintptr)(unsafe.Pointer(pArg)) = zOut
 174875 		if zOut == uintptr(0) {
 174876 			rc = SQLITE_NOMEM
 174877 		}
 174878 	}
 174879 
 174880 	return rc
 174881 }
 174882 
 174883 func rbuVfsSectorSize(tls *libc.TLS, pFile uintptr) int32 {
 174884 	var p uintptr = pFile
 174885 	return (*struct {
 174886 		f func(*libc.TLS, uintptr) int32
 174887 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxSectorSize})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal)
 174888 }
 174889 
 174890 func rbuVfsDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 {
 174891 	var p uintptr = pFile
 174892 	return (*struct {
 174893 		f func(*libc.TLS, uintptr) int32
 174894 	})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxDeviceCharacteristics})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal)
 174895 }
 174896 
 174897 func rbuVfsShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int32) int32 {
 174898 	var p uintptr = pFile
 174899 	var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbu
 174900 	var rc int32 = SQLITE_OK
 174901 
 174902 	if pRbu != 0 && ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_OAL ||
 174903 		(*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_MOVE ||
 174904 		(*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_DONE) {
 174905 		if ofst == WAL_LOCK_CKPT && n == 1 {
 174906 			rc = SQLITE_BUSY
 174907 		}
 174908 	} else {
 174909 		var bCapture int32 = 0
 174910 		if pRbu != 0 && (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_CAPTURE {
 174911 			bCapture = 1
 174912 		}
 174913 		if bCapture == 0 || 0 == flags&SQLITE_SHM_UNLOCK {
 174914 			rc = (*struct {
 174915 				f func(*libc.TLS, uintptr, int32, int32, int32) int32
 174916 			})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, ofst, n, flags)
 174917 			if bCapture != 0 && rc == SQLITE_OK {
 174918 				*(*U32)(unsafe.Pointer(pRbu + 332)) |= U32((int32(1)<<n - 1) << ofst)
 174919 			}
 174920 		}
 174921 	}
 174922 
 174923 	return rc
 174924 }
 174925 
 174926 func rbuVfsShmMap(tls *libc.TLS, pFile uintptr, iRegion int32, szRegion int32, isWrite int32, pp uintptr) int32 {
 174927 	var p uintptr = pFile
 174928 	var rc int32 = SQLITE_OK
 174929 	var eStage int32 = func() int32 {
 174930 		if (*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0 {
 174931 			return (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbu)).FeStage
 174932 		}
 174933 		return 0
 174934 	}()
 174935 
 174936 	if eStage == RBU_STAGE_OAL {
 174937 		var nByte Sqlite3_int64 = Sqlite3_int64(uint64(iRegion+1) * uint64(unsafe.Sizeof(uintptr(0))))
 174938 		var apNew uintptr = Xsqlite3_realloc64(tls, (*Rbu_file)(unsafe.Pointer(p)).FapShm, uint64(nByte))
 174939 
 174940 		if apNew == uintptr(0) {
 174941 			rc = SQLITE_NOMEM
 174942 		} else {
 174943 			libc.Xmemset(tls, apNew+uintptr((*Rbu_file)(unsafe.Pointer(p)).FnShm)*8, 0, uint64(unsafe.Sizeof(uintptr(0)))*uint64(1+iRegion-(*Rbu_file)(unsafe.Pointer(p)).FnShm))
 174944 			(*Rbu_file)(unsafe.Pointer(p)).FapShm = apNew
 174945 			(*Rbu_file)(unsafe.Pointer(p)).FnShm = iRegion + 1
 174946 		}
 174947 
 174948 		if rc == SQLITE_OK {
 174949 			var pNew uintptr = Xsqlite3_malloc64(tls, uint64(szRegion))
 174950 			if pNew == uintptr(0) {
 174951 				rc = SQLITE_NOMEM
 174952 			} else {
 174953 				libc.Xmemset(tls, pNew, 0, uint64(szRegion))
 174954 				*(*uintptr)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FapShm + uintptr(iRegion)*8)) = pNew
 174955 			}
 174956 		}
 174957 
 174958 		if rc == SQLITE_OK {
 174959 			*(*uintptr)(unsafe.Pointer(pp)) = *(*uintptr)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FapShm + uintptr(iRegion)*8))
 174960 		} else {
 174961 			*(*uintptr)(unsafe.Pointer(pp)) = uintptr(0)
 174962 		}
 174963 	} else {
 174964 		rc = (*struct {
 174965 			f func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32
 174966 		})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmMap})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, iRegion, szRegion, isWrite, pp)
 174967 	}
 174968 
 174969 	return rc
 174970 }
 174971 
 174972 func rbuVfsShmBarrier(tls *libc.TLS, pFile uintptr) {
 174973 	var p uintptr = pFile
 174974 	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmBarrier})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal)
 174975 }
 174976 
 174977 func rbuVfsShmUnmap(tls *libc.TLS, pFile uintptr, delFlag int32) int32 {
 174978 	var p uintptr = pFile
 174979 	var rc int32 = SQLITE_OK
 174980 	var eStage int32 = func() int32 {
 174981 		if (*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0 {
 174982 			return (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbu)).FeStage
 174983 		}
 174984 		return 0
 174985 	}()
 174986 
 174987 	if eStage == RBU_STAGE_OAL || eStage == RBU_STAGE_MOVE {
 174988 	} else {
 174989 		rbuUnlockShm(tls, p)
 174990 		rc = (*struct {
 174991 			f func(*libc.TLS, uintptr, int32) int32
 174992 		})(unsafe.Pointer(&struct{ uintptr }{(*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmUnmap})).f(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, delFlag)
 174993 	}
 174994 	return rc
 174995 }
 174996 
 174997 func rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 {
 174998 	var pRbuVfs uintptr = pVfs
 174999 	var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRealVfs
 175000 	var pFd uintptr = pFile
 175001 	var rc int32 = SQLITE_OK
 175002 	var zOpen uintptr = zName
 175003 	var oflags int32 = flags
 175004 
 175005 	libc.Xmemset(tls, pFd, 0, uint64(unsafe.Sizeof(Rbu_file{})))
 175006 	(*Rbu_file)(unsafe.Pointer(pFd)).FpReal = pFd + 1*104
 175007 	(*Rbu_file)(unsafe.Pointer(pFd)).FpRbuVfs = pRbuVfs
 175008 	(*Rbu_file)(unsafe.Pointer(pFd)).FopenFlags = flags
 175009 	if zName != 0 {
 175010 		if flags&SQLITE_OPEN_MAIN_DB != 0 {
 175011 			(*Rbu_file)(unsafe.Pointer(pFd)).FzWal = Xsqlite3_filename_wal(tls, zName)
 175012 		} else if flags&SQLITE_OPEN_WAL != 0 {
 175013 			var pDb uintptr = rbuFindMaindb(tls, pRbuVfs, zName, 0)
 175014 			if pDb != 0 {
 175015 				if (*Rbu_file)(unsafe.Pointer(pDb)).FpRbu != 0 && (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == RBU_STAGE_OAL {
 175016 					var nOpen Size_t
 175017 					if (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu)).FzTarget == uintptr(0) {
 175018 						zOpen = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, ts+7793)
 175019 						zOpen = Xsqlite3_filename_wal(tls, zOpen)
 175020 					}
 175021 					nOpen = libc.Xstrlen(tls, zOpen)
 175022 					*(*int8)(unsafe.Pointer(zOpen + uintptr(nOpen-uint64(3)))) = int8('o')
 175023 					(*Rbu_file)(unsafe.Pointer(pFd)).FpRbu = (*Rbu_file)(unsafe.Pointer(pDb)).FpRbu
 175024 				}
 175025 				(*Rbu_file)(unsafe.Pointer(pDb)).FpWalFd = pFd
 175026 			}
 175027 		}
 175028 	} else {
 175029 		(*Rbu_file)(unsafe.Pointer(pFd)).FpRbu = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRbu
 175030 	}
 175031 
 175032 	if oflags&SQLITE_OPEN_MAIN_DB != 0 &&
 175033 		Xsqlite3_uri_boolean(tls, zName, ts+33760, 0) != 0 {
 175034 		oflags = SQLITE_OPEN_TEMP_DB | SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_DELETEONCLOSE
 175035 		zOpen = uintptr(0)
 175036 	}
 175037 
 175038 	if rc == SQLITE_OK {
 175039 		rc = (*struct {
 175040 			f func(*libc.TLS, uintptr, Sqlite3_filename, uintptr, int32, uintptr) int32
 175041 		})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pRealVfs)).FxOpen})).f(tls, pRealVfs, zOpen, (*Rbu_file)(unsafe.Pointer(pFd)).FpReal, oflags, pOutFlags)
 175042 	}
 175043 	if (*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(pFd)).FpReal)).FpMethods != 0 {
 175044 		var pMeth uintptr = (*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(pFd)).FpReal)).FpMethods
 175045 
 175046 		if (*Sqlite3_io_methods)(unsafe.Pointer(pMeth)).FiVersion < 2 || (*Sqlite3_io_methods)(unsafe.Pointer(pMeth)).FxShmLock == uintptr(0) {
 175047 			(*Sqlite3_file)(unsafe.Pointer(pFile)).FpMethods = uintptr(unsafe.Pointer(&rbuvfs_io_methods1))
 175048 		} else {
 175049 			(*Sqlite3_file)(unsafe.Pointer(pFile)).FpMethods = uintptr(unsafe.Pointer(&rbuvfs_io_methods))
 175050 		}
 175051 		if flags&SQLITE_OPEN_MAIN_DB != 0 {
 175052 			rbuMainlistAdd(tls, pFd)
 175053 		}
 175054 	} else {
 175055 		Xsqlite3_free(tls, (*Rbu_file)(unsafe.Pointer(pFd)).FzDel)
 175056 	}
 175057 
 175058 	return rc
 175059 }
 175060 
 175061 var rbuvfs_io_methods = Sqlite3_io_methods{
 175062 	FiVersion:               2,
 175063 	FxClose:                 0,
 175064 	FxRead:                  0,
 175065 	FxWrite:                 0,
 175066 	FxTruncate:              0,
 175067 	FxSync:                  0,
 175068 	FxFileSize:              0,
 175069 	FxLock:                  0,
 175070 	FxUnlock:                0,
 175071 	FxCheckReservedLock:     0,
 175072 	FxFileControl:           0,
 175073 	FxSectorSize:            0,
 175074 	FxDeviceCharacteristics: 0,
 175075 	FxShmMap:                0,
 175076 	FxShmLock:               0,
 175077 	FxShmBarrier:            0,
 175078 	FxShmUnmap:              0,
 175079 }
 175080 var rbuvfs_io_methods1 = Sqlite3_io_methods{
 175081 	FiVersion:               1,
 175082 	FxClose:                 0,
 175083 	FxRead:                  0,
 175084 	FxWrite:                 0,
 175085 	FxTruncate:              0,
 175086 	FxSync:                  0,
 175087 	FxFileSize:              0,
 175088 	FxLock:                  0,
 175089 	FxUnlock:                0,
 175090 	FxCheckReservedLock:     0,
 175091 	FxFileControl:           0,
 175092 	FxSectorSize:            0,
 175093 	FxDeviceCharacteristics: 0,
 175094 }
 175095 
 175096 func rbuVfsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 {
 175097 	var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
 175098 	return (*struct {
 175099 		f func(*libc.TLS, uintptr, uintptr, int32) int32
 175100 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pRealVfs)).FxDelete})).f(tls, pRealVfs, zPath, dirSync)
 175101 }
 175102 
 175103 func rbuVfsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 {
 175104 	bp := tls.Alloc(8)
 175105 	defer tls.Free(8)
 175106 
 175107 	var pRbuVfs uintptr = pVfs
 175108 	var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRealVfs
 175109 	var rc int32
 175110 
 175111 	rc = (*struct {
 175112 		f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
 175113 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pRealVfs)).FxAccess})).f(tls, pRealVfs, zPath, flags, pResOut)
 175114 
 175115 	if rc == SQLITE_OK && flags == SQLITE_ACCESS_EXISTS {
 175116 		var pDb uintptr = rbuFindMaindb(tls, pRbuVfs, zPath, 1)
 175117 		if pDb != 0 && (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == RBU_STAGE_OAL {
 175118 			if *(*int32)(unsafe.Pointer(pResOut)) != 0 {
 175119 				rc = SQLITE_CANTOPEN
 175120 			} else {
 175121 				*(*Sqlite3_int64)(unsafe.Pointer(bp)) = int64(0)
 175122 				rc = rbuVfsFileSize(tls, pDb, bp)
 175123 				*(*int32)(unsafe.Pointer(pResOut)) = libc.Bool32(*(*Sqlite3_int64)(unsafe.Pointer(bp)) > int64(0))
 175124 			}
 175125 		}
 175126 	}
 175127 
 175128 	return rc
 175129 }
 175130 
 175131 func rbuVfsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 {
 175132 	var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
 175133 	return (*struct {
 175134 		f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
 175135 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pRealVfs)).FxFullPathname})).f(tls, pRealVfs, zPath, nOut, zOut)
 175136 }
 175137 
 175138 func rbuVfsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr {
 175139 	var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
 175140 	return (*struct {
 175141 		f func(*libc.TLS, uintptr, uintptr) uintptr
 175142 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pRealVfs)).FxDlOpen})).f(tls, pRealVfs, zPath)
 175143 }
 175144 
 175145 func rbuVfsDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) {
 175146 	var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
 175147 	(*struct {
 175148 		f func(*libc.TLS, uintptr, int32, uintptr)
 175149 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pRealVfs)).FxDlError})).f(tls, pRealVfs, nByte, zErrMsg)
 175150 }
 175151 
 175152 func rbuVfsDlSym(tls *libc.TLS, pVfs uintptr, pArg uintptr, zSym uintptr) uintptr {
 175153 	var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
 175154 	return (*struct {
 175155 		f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
 175156 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pRealVfs)).FxDlSym})).f(tls, pRealVfs, pArg, zSym)
 175157 }
 175158 
 175159 func rbuVfsDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) {
 175160 	var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
 175161 	(*struct {
 175162 		f func(*libc.TLS, uintptr, uintptr)
 175163 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pRealVfs)).FxDlClose})).f(tls, pRealVfs, pHandle)
 175164 }
 175165 
 175166 func rbuVfsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 {
 175167 	var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
 175168 	return (*struct {
 175169 		f func(*libc.TLS, uintptr, int32, uintptr) int32
 175170 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pRealVfs)).FxRandomness})).f(tls, pRealVfs, nByte, zBufOut)
 175171 }
 175172 
 175173 func rbuVfsSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 {
 175174 	var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
 175175 	return (*struct {
 175176 		f func(*libc.TLS, uintptr, int32) int32
 175177 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pRealVfs)).FxSleep})).f(tls, pRealVfs, nMicro)
 175178 }
 175179 
 175180 func rbuVfsCurrentTime(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 {
 175181 	var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
 175182 	return (*struct {
 175183 		f func(*libc.TLS, uintptr, uintptr) int32
 175184 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_vfs)(unsafe.Pointer(pRealVfs)).FxCurrentTime})).f(tls, pRealVfs, pTimeOut)
 175185 }
 175186 
 175187 func rbuVfsGetLastError(tls *libc.TLS, pVfs uintptr, a int32, b uintptr) int32 {
 175188 	return 0
 175189 }
 175190 
 175191 // Deregister and destroy an RBU vfs created by an earlier call to
 175192 // sqlite3rbu_create_vfs().
 175193 func Xsqlite3rbu_destroy_vfs(tls *libc.TLS, zName uintptr) {
 175194 	var pVfs uintptr = Xsqlite3_vfs_find(tls, zName)
 175195 	if pVfs != 0 && (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxOpen == *(*uintptr)(unsafe.Pointer(&struct {
 175196 		f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
 175197 	}{rbuVfsOpen})) {
 175198 		Xsqlite3_mutex_free(tls, (*Rbu_vfs)(unsafe.Pointer(pVfs)).Fmutex)
 175199 		Xsqlite3_vfs_unregister(tls, pVfs)
 175200 		Xsqlite3_free(tls, pVfs)
 175201 	}
 175202 }
 175203 
 175204 // Create an RBU VFS named zName that accesses the underlying file-system
 175205 // via existing VFS zParent. The new object is registered as a non-default
 175206 // VFS with SQLite before returning.
 175207 func Xsqlite3rbu_create_vfs(tls *libc.TLS, zName uintptr, zParent uintptr) int32 {
 175208 	var pNew uintptr = uintptr(0)
 175209 	var rc int32 = SQLITE_OK
 175210 	var nName Size_t
 175211 	var nByte Size_t
 175212 
 175213 	nName = libc.Xstrlen(tls, zName)
 175214 	nByte = uint64(unsafe.Sizeof(Rbu_vfs{})) + nName + uint64(1)
 175215 	pNew = Xsqlite3_malloc64(tls, nByte)
 175216 	if pNew == uintptr(0) {
 175217 		rc = SQLITE_NOMEM
 175218 	} else {
 175219 		var pParent uintptr
 175220 		libc.Xmemset(tls, pNew, 0, nByte)
 175221 		pParent = Xsqlite3_vfs_find(tls, zParent)
 175222 		if pParent == uintptr(0) {
 175223 			rc = SQLITE_NOTFOUND
 175224 		} else {
 175225 			var zSpace uintptr
 175226 			libc.Xmemcpy(tls, pNew, uintptr(unsafe.Pointer(&vfs_template)), uint64(unsafe.Sizeof(Sqlite3_vfs{})))
 175227 			(*Rbu_vfs)(unsafe.Pointer(pNew)).Fbase.FmxPathname = (*Sqlite3_vfs)(unsafe.Pointer(pParent)).FmxPathname
 175228 			(*Rbu_vfs)(unsafe.Pointer(pNew)).Fbase.FszOsFile = int32(uint64(unsafe.Sizeof(Rbu_file{})) + uint64((*Sqlite3_vfs)(unsafe.Pointer(pParent)).FszOsFile))
 175229 			(*Rbu_vfs)(unsafe.Pointer(pNew)).FpRealVfs = pParent
 175230 			(*Rbu_vfs)(unsafe.Pointer(pNew)).Fbase.FzName = libc.AssignUintptr(&zSpace, pNew+1*208)
 175231 			libc.Xmemcpy(tls, zSpace, zName, nName)
 175232 
 175233 			(*Rbu_vfs)(unsafe.Pointer(pNew)).Fmutex = Xsqlite3_mutex_alloc(tls, SQLITE_MUTEX_RECURSIVE)
 175234 			if (*Rbu_vfs)(unsafe.Pointer(pNew)).Fmutex == uintptr(0) {
 175235 				rc = SQLITE_NOMEM
 175236 			} else {
 175237 				rc = Xsqlite3_vfs_register(tls, pNew, 0)
 175238 			}
 175239 		}
 175240 
 175241 		if rc != SQLITE_OK {
 175242 			Xsqlite3_mutex_free(tls, (*Rbu_vfs)(unsafe.Pointer(pNew)).Fmutex)
 175243 			Xsqlite3_free(tls, pNew)
 175244 		}
 175245 	}
 175246 
 175247 	return rc
 175248 }
 175249 
 175250 var vfs_template = Sqlite3_vfs{
 175251 	FiVersion:      1,
 175252 	FxOpen:         0,
 175253 	FxDelete:       0,
 175254 	FxAccess:       0,
 175255 	FxFullPathname: 0,
 175256 	FxDlOpen:       0,
 175257 	FxDlError:      0,
 175258 	FxDlSym:        0,
 175259 	FxDlClose:      0,
 175260 	FxRandomness:   0,
 175261 	FxSleep:        0,
 175262 	FxCurrentTime:  0,
 175263 	FxGetLastError: 0,
 175264 }
 175265 
 175266 // Configure the aggregate temp file size limit for this RBU handle.
 175267 func Xsqlite3rbu_temp_size_limit(tls *libc.TLS, pRbu uintptr, n Sqlite3_int64) Sqlite3_int64 {
 175268 	if n >= int64(0) {
 175269 		(*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTempLimit = n
 175270 	}
 175271 	return (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTempLimit
 175272 }
 175273 
 175274 func Xsqlite3rbu_temp_size(tls *libc.TLS, pRbu uintptr) Sqlite3_int64 {
 175275 	return (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTemp
 175276 }
 175277 
 175278 type SessionTable1 = struct {
 175279 	FpNext    uintptr
 175280 	FzName    uintptr
 175281 	FnCol     int32
 175282 	FbStat1   int32
 175283 	FazCol    uintptr
 175284 	FabPK     uintptr
 175285 	FnEntry   int32
 175286 	FnChange  int32
 175287 	FapChange uintptr
 175288 }
 175289 
 175290 type SessionTable = SessionTable1
 175291 type SessionChange1 = struct {
 175292 	Fop          U8
 175293 	FbIndirect   U8
 175294 	F__ccgo_pad1 [2]byte
 175295 	FnMaxSize    int32
 175296 	FnRecord     int32
 175297 	F__ccgo_pad2 [4]byte
 175298 	FaRecord     uintptr
 175299 	FpNext       uintptr
 175300 }
 175301 
 175302 type SessionChange = SessionChange1
 175303 type SessionBuffer1 = struct {
 175304 	FaBuf   uintptr
 175305 	FnBuf   int32
 175306 	FnAlloc int32
 175307 }
 175308 
 175309 type SessionBuffer = SessionBuffer1
 175310 type SessionInput1 = struct {
 175311 	FbNoDiscard  int32
 175312 	FiCurrent    int32
 175313 	FiNext       int32
 175314 	F__ccgo_pad1 [4]byte
 175315 	FaData       uintptr
 175316 	FnData       int32
 175317 	F__ccgo_pad2 [4]byte
 175318 	Fbuf         SessionBuffer
 175319 	FxInput      uintptr
 175320 	FpIn         uintptr
 175321 	FbEof        int32
 175322 	F__ccgo_pad3 [4]byte
 175323 }
 175324 
 175325 type SessionInput = SessionInput1
 175326 
 175327 var sessions_strm_chunk_size int32 = SESSIONS_STRM_CHUNK_SIZE
 175328 
 175329 type SessionHook1 = struct {
 175330 	FpCtx   uintptr
 175331 	FxOld   uintptr
 175332 	FxNew   uintptr
 175333 	FxCount uintptr
 175334 	FxDepth uintptr
 175335 }
 175336 
 175337 type SessionHook = SessionHook1
 175338 
 175339 func sessionVarintPut(tls *libc.TLS, aBuf uintptr, iVal int32) int32 {
 175340 	return int32(func() uint8 {
 175341 		if U32(iVal) < U32(0x80) {
 175342 			return uint8(func() int32 { *(*U8)(unsafe.Pointer(aBuf)) = uint8(iVal); return 1 }())
 175343 		}
 175344 		return uint8(Xsqlite3PutVarint(tls, aBuf, uint64(iVal)))
 175345 	}())
 175346 }
 175347 
 175348 func sessionVarintLen(tls *libc.TLS, iVal int32) int32 {
 175349 	return Xsqlite3VarintLen(tls, uint64(iVal))
 175350 }
 175351 
 175352 func sessionVarintGet(tls *libc.TLS, aBuf uintptr, piVal uintptr) int32 {
 175353 	return int32(func() uint8 {
 175354 		if int32(*(*U8)(unsafe.Pointer(aBuf))) < int32(U8(0x80)) {
 175355 			return uint8(func() int32 { *(*int32)(unsafe.Pointer(piVal)) = int32(U32(*(*U8)(unsafe.Pointer(aBuf)))); return 1 }())
 175356 		}
 175357 		return Xsqlite3GetVarint32(tls, aBuf, piVal)
 175358 	}())
 175359 }
 175360 
 175361 func sessionGetI64(tls *libc.TLS, aRec uintptr) Sqlite3_int64 {
 175362 	var x U64 = U64(U32(*(*U8)(unsafe.Pointer(aRec)))<<24 | U32(int32(*(*U8)(unsafe.Pointer(aRec + 1)))<<16) | U32(int32(*(*U8)(unsafe.Pointer(aRec + 2)))<<8) | U32(*(*U8)(unsafe.Pointer(aRec + 3))))
 175363 	var y U32 = U32(*(*U8)(unsafe.Pointer(aRec + uintptr(4))))<<24 | U32(int32(*(*U8)(unsafe.Pointer(aRec + uintptr(4) + 1)))<<16) | U32(int32(*(*U8)(unsafe.Pointer(aRec + uintptr(4) + 2)))<<8) | U32(*(*U8)(unsafe.Pointer(aRec + uintptr(4) + 3)))
 175364 	x = x<<32 + U64(y)
 175365 	return Sqlite3_int64(x)
 175366 }
 175367 
 175368 func sessionPutI64(tls *libc.TLS, aBuf uintptr, i Sqlite3_int64) {
 175369 	*(*U8)(unsafe.Pointer(aBuf)) = U8(i >> 56 & int64(0xFF))
 175370 	*(*U8)(unsafe.Pointer(aBuf + 1)) = U8(i >> 48 & int64(0xFF))
 175371 	*(*U8)(unsafe.Pointer(aBuf + 2)) = U8(i >> 40 & int64(0xFF))
 175372 	*(*U8)(unsafe.Pointer(aBuf + 3)) = U8(i >> 32 & int64(0xFF))
 175373 	*(*U8)(unsafe.Pointer(aBuf + 4)) = U8(i >> 24 & int64(0xFF))
 175374 	*(*U8)(unsafe.Pointer(aBuf + 5)) = U8(i >> 16 & int64(0xFF))
 175375 	*(*U8)(unsafe.Pointer(aBuf + 6)) = U8(i >> 8 & int64(0xFF))
 175376 	*(*U8)(unsafe.Pointer(aBuf + 7)) = U8(i >> 0 & int64(0xFF))
 175377 }
 175378 
 175379 func sessionSerializeValue(tls *libc.TLS, aBuf uintptr, pValue uintptr, pnWrite uintptr) int32 {
 175380 	bp := tls.Alloc(16)
 175381 	defer tls.Free(16)
 175382 
 175383 	var nByte int32
 175384 
 175385 	if pValue != 0 {
 175386 		var eType int32
 175387 
 175388 		eType = Xsqlite3_value_type(tls, pValue)
 175389 		if aBuf != 0 {
 175390 			*(*U8)(unsafe.Pointer(aBuf)) = U8(eType)
 175391 		}
 175392 
 175393 		switch eType {
 175394 		case SQLITE_NULL:
 175395 			nByte = 1
 175396 			break
 175397 			fallthrough
 175398 
 175399 		case SQLITE_INTEGER:
 175400 			fallthrough
 175401 		case SQLITE_FLOAT:
 175402 			if aBuf != 0 {
 175403 				if eType == SQLITE_INTEGER {
 175404 					*(*U64)(unsafe.Pointer(bp)) = U64(Xsqlite3_value_int64(tls, pValue))
 175405 				} else {
 175406 					*(*float64)(unsafe.Pointer(bp + 8)) = Xsqlite3_value_double(tls, pValue)
 175407 					libc.Xmemcpy(tls, bp, bp+8, uint64(8))
 175408 				}
 175409 				sessionPutI64(tls, aBuf+1, int64(*(*U64)(unsafe.Pointer(bp))))
 175410 			}
 175411 			nByte = 9
 175412 			break
 175413 			fallthrough
 175414 
 175415 		default:
 175416 			{
 175417 				var z uintptr
 175418 				var n int32
 175419 				var nVarint int32
 175420 
 175421 				if eType == SQLITE_TEXT {
 175422 					z = Xsqlite3_value_text(tls, pValue)
 175423 				} else {
 175424 					z = Xsqlite3_value_blob(tls, pValue)
 175425 				}
 175426 				n = Xsqlite3_value_bytes(tls, pValue)
 175427 				if z == uintptr(0) && (eType != SQLITE_BLOB || n > 0) {
 175428 					return SQLITE_NOMEM
 175429 				}
 175430 				nVarint = sessionVarintLen(tls, n)
 175431 
 175432 				if aBuf != 0 {
 175433 					sessionVarintPut(tls, aBuf+1, n)
 175434 					if n > 0 {
 175435 						libc.Xmemcpy(tls, aBuf+uintptr(nVarint+1), z, uint64(n))
 175436 					}
 175437 				}
 175438 
 175439 				nByte = 1 + nVarint + n
 175440 				break
 175441 
 175442 			}
 175443 		}
 175444 	} else {
 175445 		nByte = 1
 175446 		if aBuf != 0 {
 175447 			*(*U8)(unsafe.Pointer(aBuf)) = U8(0)
 175448 		}
 175449 	}
 175450 
 175451 	if pnWrite != 0 {
 175452 		*(*Sqlite3_int64)(unsafe.Pointer(pnWrite)) += Sqlite3_int64(nByte)
 175453 	}
 175454 	return SQLITE_OK
 175455 }
 175456 
 175457 func sessionMalloc64(tls *libc.TLS, pSession uintptr, nByte I64) uintptr {
 175458 	var pRet uintptr = Xsqlite3_malloc64(tls, uint64(nByte))
 175459 	if pSession != 0 {
 175460 		*(*I64)(unsafe.Pointer(pSession + 56)) += I64(Xsqlite3_msize(tls, pRet))
 175461 	}
 175462 	return pRet
 175463 }
 175464 
 175465 func sessionFree(tls *libc.TLS, pSession uintptr, pFree uintptr) {
 175466 	if pSession != 0 {
 175467 		*(*I64)(unsafe.Pointer(pSession + 56)) -= I64(Xsqlite3_msize(tls, pFree))
 175468 	}
 175469 	Xsqlite3_free(tls, pFree)
 175470 }
 175471 
 175472 func sessionHashAppendI64(tls *libc.TLS, h uint32, i I64) uint32 {
 175473 	h = h<<3 ^ h ^ uint32(i&int64(0xFFFFFFFF))
 175474 	return h<<3 ^ h ^ uint32(i>>32&int64(0xFFFFFFFF))
 175475 }
 175476 
 175477 func sessionHashAppendBlob(tls *libc.TLS, h uint32, n int32, z uintptr) uint32 {
 175478 	var i int32
 175479 	for i = 0; i < n; i++ {
 175480 		h = h<<3 ^ h ^ uint32(*(*U8)(unsafe.Pointer(z + uintptr(i))))
 175481 	}
 175482 	return h
 175483 }
 175484 
 175485 func sessionHashAppendType(tls *libc.TLS, h uint32, eType int32) uint32 {
 175486 	return h<<3 ^ h ^ uint32(eType)
 175487 }
 175488 
 175489 func sessionPreupdateHash(tls *libc.TLS, pSession uintptr, pTab uintptr, bNew int32, piHash uintptr, pbNullPK uintptr) int32 {
 175490 	bp := tls.Alloc(24)
 175491 	defer tls.Free(24)
 175492 
 175493 	var h uint32 = uint32(0)
 175494 	var i int32
 175495 
 175496 	for i = 0; i < (*SessionTable)(unsafe.Pointer(pTab)).FnCol; i++ {
 175497 		if *(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i))) != 0 {
 175498 			var rc int32
 175499 			var eType int32
 175500 
 175501 			if bNew != 0 {
 175502 				rc = (*struct {
 175503 					f func(*libc.TLS, uintptr, int32, uintptr) int32
 175504 				})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxNew})).f(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, i, bp)
 175505 			} else {
 175506 				rc = (*struct {
 175507 					f func(*libc.TLS, uintptr, int32, uintptr) int32
 175508 				})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxOld})).f(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, i, bp)
 175509 			}
 175510 			if rc != SQLITE_OK {
 175511 				return rc
 175512 			}
 175513 
 175514 			eType = Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp)))
 175515 			h = sessionHashAppendType(tls, h, eType)
 175516 			if eType == SQLITE_INTEGER || eType == SQLITE_FLOAT {
 175517 				if eType == SQLITE_INTEGER {
 175518 					*(*I64)(unsafe.Pointer(bp + 8)) = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(bp)))
 175519 				} else {
 175520 					*(*float64)(unsafe.Pointer(bp + 16)) = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(bp)))
 175521 
 175522 					libc.Xmemcpy(tls, bp+8, bp+16, uint64(8))
 175523 				}
 175524 				h = sessionHashAppendI64(tls, h, *(*I64)(unsafe.Pointer(bp + 8)))
 175525 			} else if eType == SQLITE_TEXT || eType == SQLITE_BLOB {
 175526 				var z uintptr
 175527 				var n int32
 175528 				if eType == SQLITE_TEXT {
 175529 					z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(bp)))
 175530 				} else {
 175531 					z = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(bp)))
 175532 				}
 175533 				n = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)))
 175534 				if !(z != 0) && (eType != SQLITE_BLOB || n > 0) {
 175535 					return SQLITE_NOMEM
 175536 				}
 175537 				h = sessionHashAppendBlob(tls, h, n, z)
 175538 			} else {
 175539 				*(*int32)(unsafe.Pointer(pbNullPK)) = 1
 175540 			}
 175541 		}
 175542 	}
 175543 
 175544 	*(*int32)(unsafe.Pointer(piHash)) = int32(h % uint32((*SessionTable)(unsafe.Pointer(pTab)).FnChange))
 175545 	return SQLITE_OK
 175546 }
 175547 
 175548 func sessionSerialLen(tls *libc.TLS, a uintptr) int32 {
 175549 	bp := tls.Alloc(4)
 175550 	defer tls.Free(4)
 175551 
 175552 	var e int32 = int32(*(*U8)(unsafe.Pointer(a)))
 175553 
 175554 	if e == 0 || e == 0xFF {
 175555 		return 1
 175556 	}
 175557 	if e == SQLITE_NULL {
 175558 		return 1
 175559 	}
 175560 	if e == SQLITE_INTEGER || e == SQLITE_FLOAT {
 175561 		return 9
 175562 	}
 175563 	return sessionVarintGet(tls, a+1, bp) + 1 + *(*int32)(unsafe.Pointer(bp))
 175564 }
 175565 
 175566 func sessionChangeHash(tls *libc.TLS, pTab uintptr, bPkOnly int32, aRecord uintptr, nBucket int32) uint32 {
 175567 	bp := tls.Alloc(4)
 175568 	defer tls.Free(4)
 175569 
 175570 	var h uint32 = uint32(0)
 175571 	var i int32
 175572 	var a uintptr = aRecord
 175573 
 175574 	for i = 0; i < (*SessionTable)(unsafe.Pointer(pTab)).FnCol; i++ {
 175575 		var eType int32 = int32(*(*U8)(unsafe.Pointer(a)))
 175576 		var isPK int32 = int32(*(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i))))
 175577 		if bPkOnly != 0 && isPK == 0 {
 175578 			continue
 175579 		}
 175580 
 175581 		if isPK != 0 {
 175582 			a++
 175583 			h = sessionHashAppendType(tls, h, eType)
 175584 			if eType == SQLITE_INTEGER || eType == SQLITE_FLOAT {
 175585 				h = sessionHashAppendI64(tls, h, sessionGetI64(tls, a))
 175586 				a += uintptr(8)
 175587 			} else {
 175588 				a += uintptr(sessionVarintGet(tls, a, bp))
 175589 				h = sessionHashAppendBlob(tls, h, *(*int32)(unsafe.Pointer(bp)), a)
 175590 				a += uintptr(*(*int32)(unsafe.Pointer(bp)))
 175591 			}
 175592 		} else {
 175593 			a += uintptr(sessionSerialLen(tls, a))
 175594 		}
 175595 	}
 175596 	return h % uint32(nBucket)
 175597 }
 175598 
 175599 func sessionChangeEqual(tls *libc.TLS, pTab uintptr, bLeftPkOnly int32, aLeft uintptr, bRightPkOnly int32, aRight uintptr) int32 {
 175600 	var a1 uintptr = aLeft
 175601 	var a2 uintptr = aRight
 175602 	var iCol int32
 175603 
 175604 	for iCol = 0; iCol < (*SessionTable)(unsafe.Pointer(pTab)).FnCol; iCol++ {
 175605 		if *(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(iCol))) != 0 {
 175606 			var n1 int32 = sessionSerialLen(tls, a1)
 175607 			var n2 int32 = sessionSerialLen(tls, a2)
 175608 
 175609 			if n1 != n2 || libc.Xmemcmp(tls, a1, a2, uint64(n1)) != 0 {
 175610 				return 0
 175611 			}
 175612 			a1 += uintptr(n1)
 175613 			a2 += uintptr(n2)
 175614 		} else {
 175615 			if bLeftPkOnly == 0 {
 175616 				a1 += uintptr(sessionSerialLen(tls, a1))
 175617 			}
 175618 			if bRightPkOnly == 0 {
 175619 				a2 += uintptr(sessionSerialLen(tls, a2))
 175620 			}
 175621 		}
 175622 	}
 175623 
 175624 	return 1
 175625 }
 175626 
 175627 func sessionMergeRecord(tls *libc.TLS, paOut uintptr, nCol int32, aLeft uintptr, aRight uintptr) {
 175628 	var a1 uintptr = aLeft
 175629 	var a2 uintptr = aRight
 175630 	var aOut uintptr = *(*uintptr)(unsafe.Pointer(paOut))
 175631 	var iCol int32
 175632 
 175633 	for iCol = 0; iCol < nCol; iCol++ {
 175634 		var n1 int32 = sessionSerialLen(tls, a1)
 175635 		var n2 int32 = sessionSerialLen(tls, a2)
 175636 		if *(*U8)(unsafe.Pointer(a2)) != 0 {
 175637 			libc.Xmemcpy(tls, aOut, a2, uint64(n2))
 175638 			aOut += uintptr(n2)
 175639 		} else {
 175640 			libc.Xmemcpy(tls, aOut, a1, uint64(n1))
 175641 			aOut += uintptr(n1)
 175642 		}
 175643 		a1 += uintptr(n1)
 175644 		a2 += uintptr(n2)
 175645 	}
 175646 
 175647 	*(*uintptr)(unsafe.Pointer(paOut)) = aOut
 175648 }
 175649 
 175650 func sessionMergeValue(tls *libc.TLS, paOne uintptr, paTwo uintptr, pnVal uintptr) uintptr {
 175651 	var a1 uintptr = *(*uintptr)(unsafe.Pointer(paOne))
 175652 	var a2 uintptr = *(*uintptr)(unsafe.Pointer(paTwo))
 175653 	var pRet uintptr = uintptr(0)
 175654 	var n1 int32
 175655 
 175656 	if a2 != 0 {
 175657 		var n2 int32 = sessionSerialLen(tls, a2)
 175658 		if *(*U8)(unsafe.Pointer(a2)) != 0 {
 175659 			*(*int32)(unsafe.Pointer(pnVal)) = n2
 175660 			pRet = a2
 175661 		}
 175662 		*(*uintptr)(unsafe.Pointer(paTwo)) = a2 + uintptr(n2)
 175663 	}
 175664 
 175665 	n1 = sessionSerialLen(tls, a1)
 175666 	if pRet == uintptr(0) {
 175667 		*(*int32)(unsafe.Pointer(pnVal)) = n1
 175668 		pRet = a1
 175669 	}
 175670 	*(*uintptr)(unsafe.Pointer(paOne)) = a1 + uintptr(n1)
 175671 
 175672 	return pRet
 175673 }
 175674 
 175675 func sessionMergeUpdate(tls *libc.TLS, paOut uintptr, pTab uintptr, bPatchset int32, aOldRecord1 uintptr, aOldRecord2 uintptr, aNewRecord1 uintptr, aNewRecord2 uintptr) int32 {
 175676 	bp := tls.Alloc(52)
 175677 	defer tls.Free(52)
 175678 
 175679 	*(*uintptr)(unsafe.Pointer(bp)) = aOldRecord1
 175680 	*(*uintptr)(unsafe.Pointer(bp + 8)) = aOldRecord2
 175681 	*(*uintptr)(unsafe.Pointer(bp + 24)) = aNewRecord1
 175682 	*(*uintptr)(unsafe.Pointer(bp + 32)) = aNewRecord2
 175683 
 175684 	var aOut uintptr = *(*uintptr)(unsafe.Pointer(paOut))
 175685 	var i int32
 175686 
 175687 	if bPatchset == 0 {
 175688 		var bRequired int32 = 0
 175689 
 175690 		for i = 0; i < (*SessionTable)(unsafe.Pointer(pTab)).FnCol; i++ {
 175691 			var aOld uintptr
 175692 
 175693 			var aNew uintptr
 175694 
 175695 			aOld = sessionMergeValue(tls, bp, bp+8, bp+16)
 175696 			aNew = sessionMergeValue(tls, bp+24, bp+32, bp+40)
 175697 			if *(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i))) != 0 || *(*int32)(unsafe.Pointer(bp + 16)) != *(*int32)(unsafe.Pointer(bp + 40)) || libc.Xmemcmp(tls, aOld, aNew, uint64(*(*int32)(unsafe.Pointer(bp + 40)))) != 0 {
 175698 				if int32(*(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i)))) == 0 {
 175699 					bRequired = 1
 175700 				}
 175701 				libc.Xmemcpy(tls, aOut, aOld, uint64(*(*int32)(unsafe.Pointer(bp + 16))))
 175702 				aOut += uintptr(*(*int32)(unsafe.Pointer(bp + 16)))
 175703 			} else {
 175704 				*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&aOut, 1))) = U8(0)
 175705 			}
 175706 		}
 175707 
 175708 		if !(bRequired != 0) {
 175709 			return 0
 175710 		}
 175711 	}
 175712 
 175713 	*(*uintptr)(unsafe.Pointer(bp)) = aOldRecord1
 175714 	*(*uintptr)(unsafe.Pointer(bp + 8)) = aOldRecord2
 175715 	*(*uintptr)(unsafe.Pointer(bp + 24)) = aNewRecord1
 175716 	*(*uintptr)(unsafe.Pointer(bp + 32)) = aNewRecord2
 175717 	for i = 0; i < (*SessionTable)(unsafe.Pointer(pTab)).FnCol; i++ {
 175718 		var aOld uintptr
 175719 
 175720 		var aNew uintptr
 175721 
 175722 		aOld = sessionMergeValue(tls, bp, bp+8, bp+44)
 175723 		aNew = sessionMergeValue(tls, bp+24, bp+32, bp+48)
 175724 		if bPatchset == 0 &&
 175725 			(*(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i))) != 0 || *(*int32)(unsafe.Pointer(bp + 44)) == *(*int32)(unsafe.Pointer(bp + 48)) && 0 == libc.Xmemcmp(tls, aOld, aNew, uint64(*(*int32)(unsafe.Pointer(bp + 48))))) {
 175726 			*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&aOut, 1))) = U8(0)
 175727 		} else {
 175728 			libc.Xmemcpy(tls, aOut, aNew, uint64(*(*int32)(unsafe.Pointer(bp + 48))))
 175729 			aOut += uintptr(*(*int32)(unsafe.Pointer(bp + 48)))
 175730 		}
 175731 	}
 175732 
 175733 	*(*uintptr)(unsafe.Pointer(paOut)) = aOut
 175734 	return 1
 175735 }
 175736 
 175737 func sessionPreupdateEqual(tls *libc.TLS, pSession uintptr, pTab uintptr, pChange uintptr, op int32) int32 {
 175738 	bp := tls.Alloc(28)
 175739 	defer tls.Free(28)
 175740 
 175741 	var iCol int32
 175742 	var a uintptr = (*SessionChange)(unsafe.Pointer(pChange)).FaRecord
 175743 
 175744 	for iCol = 0; iCol < (*SessionTable)(unsafe.Pointer(pTab)).FnCol; iCol++ {
 175745 		if !(int32(*(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(iCol)))) != 0) {
 175746 			a += uintptr(sessionSerialLen(tls, a))
 175747 		} else {
 175748 			var rc int32
 175749 			_ = rc
 175750 			var eType int32 = int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&a, 1))))
 175751 
 175752 			if op == SQLITE_INSERT {
 175753 				rc = (*struct {
 175754 					f func(*libc.TLS, uintptr, int32, uintptr) int32
 175755 				})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxNew})).f(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, iCol, bp)
 175756 			} else {
 175757 				rc = (*struct {
 175758 					f func(*libc.TLS, uintptr, int32, uintptr) int32
 175759 				})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxOld})).f(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, iCol, bp)
 175760 			}
 175761 
 175762 			if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp))) != eType {
 175763 				return 0
 175764 			}
 175765 
 175766 			if eType == SQLITE_INTEGER || eType == SQLITE_FLOAT {
 175767 				*(*I64)(unsafe.Pointer(bp + 16)) = sessionGetI64(tls, a)
 175768 				a += uintptr(8)
 175769 				if eType == SQLITE_INTEGER {
 175770 					if Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(bp))) != *(*I64)(unsafe.Pointer(bp + 16)) {
 175771 						return 0
 175772 					}
 175773 				} else {
 175774 					libc.Xmemcpy(tls, bp+8, bp+16, uint64(8))
 175775 					if Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(bp))) != *(*float64)(unsafe.Pointer(bp + 8)) {
 175776 						return 0
 175777 					}
 175778 				}
 175779 			} else {
 175780 				var z uintptr
 175781 				a += uintptr(sessionVarintGet(tls, a, bp+24))
 175782 				if Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(bp))) != *(*int32)(unsafe.Pointer(bp + 24)) {
 175783 					return 0
 175784 				}
 175785 				if eType == SQLITE_TEXT {
 175786 					z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(bp)))
 175787 				} else {
 175788 					z = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(bp)))
 175789 				}
 175790 				if *(*int32)(unsafe.Pointer(bp + 24)) > 0 && libc.Xmemcmp(tls, a, z, uint64(*(*int32)(unsafe.Pointer(bp + 24)))) != 0 {
 175791 					return 0
 175792 				}
 175793 				a += uintptr(*(*int32)(unsafe.Pointer(bp + 24)))
 175794 			}
 175795 		}
 175796 	}
 175797 
 175798 	return 1
 175799 }
 175800 
 175801 func sessionGrowHash(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab uintptr) int32 {
 175802 	if (*SessionTable)(unsafe.Pointer(pTab)).FnChange == 0 || (*SessionTable)(unsafe.Pointer(pTab)).FnEntry >= (*SessionTable)(unsafe.Pointer(pTab)).FnChange/2 {
 175803 		var i int32
 175804 		var apNew uintptr
 175805 		var nNew Sqlite3_int64 = int64(2) * func() int64 {
 175806 			if (*SessionTable)(unsafe.Pointer(pTab)).FnChange != 0 {
 175807 				return int64((*SessionTable)(unsafe.Pointer(pTab)).FnChange)
 175808 			}
 175809 			return int64(128)
 175810 		}()
 175811 
 175812 		apNew = sessionMalloc64(tls,
 175813 			pSession, int64(uint64(unsafe.Sizeof(uintptr(0)))*uint64(nNew)))
 175814 		if apNew == uintptr(0) {
 175815 			if (*SessionTable)(unsafe.Pointer(pTab)).FnChange == 0 {
 175816 				return SQLITE_ERROR
 175817 			}
 175818 			return SQLITE_OK
 175819 		}
 175820 		libc.Xmemset(tls, apNew, 0, uint64(unsafe.Sizeof(uintptr(0)))*uint64(nNew))
 175821 
 175822 		for i = 0; i < (*SessionTable)(unsafe.Pointer(pTab)).FnChange; i++ {
 175823 			var p uintptr
 175824 			var pNext uintptr
 175825 			for p = *(*uintptr)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(i)*8)); p != 0; p = pNext {
 175826 				var bPkOnly int32 = libc.Bool32(int32((*SessionChange)(unsafe.Pointer(p)).Fop) == SQLITE_DELETE && bPatchset != 0)
 175827 				var iHash int32 = int32(sessionChangeHash(tls, pTab, bPkOnly, (*SessionChange)(unsafe.Pointer(p)).FaRecord, int32(nNew)))
 175828 				pNext = (*SessionChange)(unsafe.Pointer(p)).FpNext
 175829 				(*SessionChange)(unsafe.Pointer(p)).FpNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(iHash)*8))
 175830 				*(*uintptr)(unsafe.Pointer(apNew + uintptr(iHash)*8)) = p
 175831 			}
 175832 		}
 175833 
 175834 		sessionFree(tls, pSession, (*SessionTable)(unsafe.Pointer(pTab)).FapChange)
 175835 		(*SessionTable)(unsafe.Pointer(pTab)).FnChange = int32(nNew)
 175836 		(*SessionTable)(unsafe.Pointer(pTab)).FapChange = apNew
 175837 	}
 175838 
 175839 	return SQLITE_OK
 175840 }
 175841 
 175842 func sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, zThis uintptr, pnCol uintptr, pzTab uintptr, pazCol uintptr, pabPK uintptr) int32 {
 175843 	bp := tls.Alloc(24)
 175844 	defer tls.Free(24)
 175845 
 175846 	var zPragma uintptr
 175847 
 175848 	var rc int32
 175849 	var nByte Sqlite3_int64
 175850 	var nDbCol int32 = 0
 175851 	var nThis int32
 175852 	var i int32
 175853 	var pAlloc uintptr = uintptr(0)
 175854 	var azCol uintptr = uintptr(0)
 175855 	var abPK uintptr = uintptr(0)
 175856 
 175857 	nThis = Xsqlite3Strlen30(tls, zThis)
 175858 	if nThis == 12 && 0 == Xsqlite3_stricmp(tls, ts+12700, zThis) {
 175859 		rc = Xsqlite3_table_column_metadata(tls, db, zDb, zThis, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0))
 175860 		if rc == SQLITE_OK {
 175861 			zPragma = Xsqlite3_mprintf(tls,
 175862 				ts+33771, 0)
 175863 		} else if rc == SQLITE_ERROR {
 175864 			zPragma = Xsqlite3_mprintf(tls, ts+1544, 0)
 175865 		} else {
 175866 			*(*uintptr)(unsafe.Pointer(pazCol)) = uintptr(0)
 175867 			*(*uintptr)(unsafe.Pointer(pabPK)) = uintptr(0)
 175868 			*(*int32)(unsafe.Pointer(pnCol)) = 0
 175869 			if pzTab != 0 {
 175870 				*(*uintptr)(unsafe.Pointer(pzTab)) = uintptr(0)
 175871 			}
 175872 			return rc
 175873 		}
 175874 	} else {
 175875 		zPragma = Xsqlite3_mprintf(tls, ts+33892, libc.VaList(bp, zDb, zThis))
 175876 	}
 175877 	if !(zPragma != 0) {
 175878 		*(*uintptr)(unsafe.Pointer(pazCol)) = uintptr(0)
 175879 		*(*uintptr)(unsafe.Pointer(pabPK)) = uintptr(0)
 175880 		*(*int32)(unsafe.Pointer(pnCol)) = 0
 175881 		if pzTab != 0 {
 175882 			*(*uintptr)(unsafe.Pointer(pzTab)) = uintptr(0)
 175883 		}
 175884 		return SQLITE_NOMEM
 175885 	}
 175886 
 175887 	rc = Xsqlite3_prepare_v2(tls, db, zPragma, -1, bp+16, uintptr(0))
 175888 	Xsqlite3_free(tls, zPragma)
 175889 	if rc != SQLITE_OK {
 175890 		*(*uintptr)(unsafe.Pointer(pazCol)) = uintptr(0)
 175891 		*(*uintptr)(unsafe.Pointer(pabPK)) = uintptr(0)
 175892 		*(*int32)(unsafe.Pointer(pnCol)) = 0
 175893 		if pzTab != 0 {
 175894 			*(*uintptr)(unsafe.Pointer(pzTab)) = uintptr(0)
 175895 		}
 175896 		return rc
 175897 	}
 175898 
 175899 	nByte = Sqlite3_int64(nThis + 1)
 175900 	for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) {
 175901 		nByte = nByte + Sqlite3_int64(Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), 1))
 175902 		nDbCol++
 175903 	}
 175904 	rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
 175905 
 175906 	if rc == SQLITE_OK {
 175907 		nByte = Sqlite3_int64(uint64(nByte) + uint64(nDbCol)*(uint64(unsafe.Sizeof(uintptr(0)))+uint64(unsafe.Sizeof(U8(0)))+uint64(1)))
 175908 		pAlloc = sessionMalloc64(tls, pSession, nByte)
 175909 		if pAlloc == uintptr(0) {
 175910 			rc = SQLITE_NOMEM
 175911 		}
 175912 	}
 175913 	if rc == SQLITE_OK {
 175914 		azCol = pAlloc
 175915 		pAlloc = azCol + uintptr(nDbCol)*8
 175916 		abPK = pAlloc
 175917 		pAlloc = abPK + uintptr(nDbCol)
 175918 		if pzTab != 0 {
 175919 			libc.Xmemcpy(tls, pAlloc, zThis, uint64(nThis+1))
 175920 			*(*uintptr)(unsafe.Pointer(pzTab)) = pAlloc
 175921 			pAlloc += uintptr(nThis + 1)
 175922 		}
 175923 
 175924 		i = 0
 175925 		for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) {
 175926 			var nName int32 = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), 1)
 175927 			var zName uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), 1)
 175928 			if zName == uintptr(0) {
 175929 				break
 175930 			}
 175931 			libc.Xmemcpy(tls, pAlloc, zName, uint64(nName+1))
 175932 			*(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc
 175933 			pAlloc += uintptr(nName + 1)
 175934 			*(*U8)(unsafe.Pointer(abPK + uintptr(i))) = U8(Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), 5))
 175935 			i++
 175936 		}
 175937 		rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
 175938 
 175939 	}
 175940 
 175941 	if rc == SQLITE_OK {
 175942 		*(*uintptr)(unsafe.Pointer(pazCol)) = azCol
 175943 		*(*uintptr)(unsafe.Pointer(pabPK)) = abPK
 175944 		*(*int32)(unsafe.Pointer(pnCol)) = nDbCol
 175945 	} else {
 175946 		*(*uintptr)(unsafe.Pointer(pazCol)) = uintptr(0)
 175947 		*(*uintptr)(unsafe.Pointer(pabPK)) = uintptr(0)
 175948 		*(*int32)(unsafe.Pointer(pnCol)) = 0
 175949 		if pzTab != 0 {
 175950 			*(*uintptr)(unsafe.Pointer(pzTab)) = uintptr(0)
 175951 		}
 175952 		sessionFree(tls, pSession, azCol)
 175953 	}
 175954 	Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
 175955 	return rc
 175956 }
 175957 
 175958 func sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr) int32 {
 175959 	bp := tls.Alloc(8)
 175960 	defer tls.Free(8)
 175961 
 175962 	if (*SessionTable)(unsafe.Pointer(pTab)).FnCol == 0 {
 175963 		(*Sqlite3_session)(unsafe.Pointer(pSession)).Frc = sessionTableInfo(tls, pSession, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb, (*Sqlite3_session)(unsafe.Pointer(pSession)).FzDb,
 175964 			(*SessionTable)(unsafe.Pointer(pTab)).FzName, pTab+16, uintptr(0), pTab+24, bp)
 175965 		if (*Sqlite3_session)(unsafe.Pointer(pSession)).Frc == SQLITE_OK {
 175966 			var i int32
 175967 			for i = 0; i < (*SessionTable)(unsafe.Pointer(pTab)).FnCol; i++ {
 175968 				if *(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + uintptr(i))) != 0 {
 175969 					(*SessionTable)(unsafe.Pointer(pTab)).FabPK = *(*uintptr)(unsafe.Pointer(bp))
 175970 					break
 175971 				}
 175972 			}
 175973 			if 0 == Xsqlite3_stricmp(tls, ts+12700, (*SessionTable)(unsafe.Pointer(pTab)).FzName) {
 175974 				(*SessionTable)(unsafe.Pointer(pTab)).FbStat1 = 1
 175975 			}
 175976 
 175977 			if (*Sqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 {
 175978 				*(*I64)(unsafe.Pointer(pSession + 64)) += I64(Size_t(1+sessionVarintLen(tls, (*SessionTable)(unsafe.Pointer(pTab)).FnCol)+(*SessionTable)(unsafe.Pointer(pTab)).FnCol) + libc.Xstrlen(tls, (*SessionTable)(unsafe.Pointer(pTab)).FzName) + uint64(1))
 175979 			}
 175980 		}
 175981 	}
 175982 	return libc.Bool32((*Sqlite3_session)(unsafe.Pointer(pSession)).Frc != 0 || (*SessionTable)(unsafe.Pointer(pTab)).FabPK == uintptr(0))
 175983 }
 175984 
 175985 // Versions of the four methods in object SessionHook for use with the
 175986 // sqlite_stat1 table. The purpose of this is to substitute a zero-length
 175987 // blob each time a NULL value is read from the "idx" column of the
 175988 // sqlite_stat1 table.
 175989 type SessionStat1Ctx1 = struct {
 175990 	Fhook     SessionHook
 175991 	FpSession uintptr
 175992 }
 175993 
 175994 // Versions of the four methods in object SessionHook for use with the
 175995 // sqlite_stat1 table. The purpose of this is to substitute a zero-length
 175996 // blob each time a NULL value is read from the "idx" column of the
 175997 // sqlite_stat1 table.
 175998 type SessionStat1Ctx = SessionStat1Ctx1
 175999 
 176000 func sessionStat1Old(tls *libc.TLS, pCtx uintptr, iCol int32, ppVal uintptr) int32 {
 176001 	bp := tls.Alloc(8)
 176002 	defer tls.Free(8)
 176003 
 176004 	var p uintptr = pCtx
 176005 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 176006 	var rc int32 = (*struct {
 176007 		f func(*libc.TLS, uintptr, int32, uintptr) int32
 176008 	})(unsafe.Pointer(&struct{ uintptr }{(*SessionStat1Ctx)(unsafe.Pointer(p)).Fhook.FxOld})).f(tls, (*SessionStat1Ctx)(unsafe.Pointer(p)).Fhook.FpCtx, iCol, bp)
 176009 	if rc == SQLITE_OK && iCol == 1 && Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp))) == SQLITE_NULL {
 176010 		*(*uintptr)(unsafe.Pointer(bp)) = (*Sqlite3_session)(unsafe.Pointer((*SessionStat1Ctx)(unsafe.Pointer(p)).FpSession)).FpZeroBlob
 176011 	}
 176012 	*(*uintptr)(unsafe.Pointer(ppVal)) = *(*uintptr)(unsafe.Pointer(bp))
 176013 	return rc
 176014 }
 176015 
 176016 func sessionStat1New(tls *libc.TLS, pCtx uintptr, iCol int32, ppVal uintptr) int32 {
 176017 	bp := tls.Alloc(8)
 176018 	defer tls.Free(8)
 176019 
 176020 	var p uintptr = pCtx
 176021 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 176022 	var rc int32 = (*struct {
 176023 		f func(*libc.TLS, uintptr, int32, uintptr) int32
 176024 	})(unsafe.Pointer(&struct{ uintptr }{(*SessionStat1Ctx)(unsafe.Pointer(p)).Fhook.FxNew})).f(tls, (*SessionStat1Ctx)(unsafe.Pointer(p)).Fhook.FpCtx, iCol, bp)
 176025 	if rc == SQLITE_OK && iCol == 1 && Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp))) == SQLITE_NULL {
 176026 		*(*uintptr)(unsafe.Pointer(bp)) = (*Sqlite3_session)(unsafe.Pointer((*SessionStat1Ctx)(unsafe.Pointer(p)).FpSession)).FpZeroBlob
 176027 	}
 176028 	*(*uintptr)(unsafe.Pointer(ppVal)) = *(*uintptr)(unsafe.Pointer(bp))
 176029 	return rc
 176030 }
 176031 
 176032 func sessionStat1Count(tls *libc.TLS, pCtx uintptr) int32 {
 176033 	var p uintptr = pCtx
 176034 	return (*struct {
 176035 		f func(*libc.TLS, uintptr) int32
 176036 	})(unsafe.Pointer(&struct{ uintptr }{(*SessionStat1Ctx)(unsafe.Pointer(p)).Fhook.FxCount})).f(tls, (*SessionStat1Ctx)(unsafe.Pointer(p)).Fhook.FpCtx)
 176037 }
 176038 
 176039 func sessionStat1Depth(tls *libc.TLS, pCtx uintptr) int32 {
 176040 	var p uintptr = pCtx
 176041 	return (*struct {
 176042 		f func(*libc.TLS, uintptr) int32
 176043 	})(unsafe.Pointer(&struct{ uintptr }{(*SessionStat1Ctx)(unsafe.Pointer(p)).Fhook.FxDepth})).f(tls, (*SessionStat1Ctx)(unsafe.Pointer(p)).Fhook.FpCtx)
 176044 }
 176045 
 176046 func sessionUpdateMaxSize(tls *libc.TLS, op int32, pSession uintptr, pTab uintptr, pC uintptr) int32 {
 176047 	bp := tls.Alloc(44)
 176048 	defer tls.Free(44)
 176049 
 176050 	*(*I64)(unsafe.Pointer(bp + 8)) = int64(2)
 176051 	if int32((*SessionChange)(unsafe.Pointer(pC)).Fop) == SQLITE_INSERT {
 176052 		if op != SQLITE_DELETE {
 176053 			var ii int32
 176054 			for ii = 0; ii < (*SessionTable)(unsafe.Pointer(pTab)).FnCol; ii++ {
 176055 				*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 176056 				(*struct {
 176057 					f func(*libc.TLS, uintptr, int32, uintptr) int32
 176058 				})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxNew})).f(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, ii, bp)
 176059 				sessionSerializeValue(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp)), bp+8)
 176060 			}
 176061 		}
 176062 	} else if op == SQLITE_DELETE {
 176063 		*(*I64)(unsafe.Pointer(bp + 8)) += I64((*SessionChange)(unsafe.Pointer(pC)).FnRecord)
 176064 		if Xsqlite3_preupdate_blobwrite(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb) >= 0 {
 176065 			*(*I64)(unsafe.Pointer(bp + 8)) += I64((*SessionChange)(unsafe.Pointer(pC)).FnRecord)
 176066 		}
 176067 	} else {
 176068 		var ii int32
 176069 		var pCsr uintptr = (*SessionChange)(unsafe.Pointer(pC)).FaRecord
 176070 		for ii = 0; ii < (*SessionTable)(unsafe.Pointer(pTab)).FnCol; ii++ {
 176071 			var bChanged int32 = 1
 176072 			var nOld int32 = 0
 176073 			var eType int32
 176074 			*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
 176075 			(*struct {
 176076 				f func(*libc.TLS, uintptr, int32, uintptr) int32
 176077 			})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxNew})).f(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, ii, bp+16)
 176078 			if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) {
 176079 				return SQLITE_NOMEM
 176080 			}
 176081 
 176082 			eType = int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pCsr, 1))))
 176083 			switch eType {
 176084 			case SQLITE_NULL:
 176085 				bChanged = libc.Bool32(Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) != SQLITE_NULL)
 176086 				break
 176087 				fallthrough
 176088 
 176089 			case SQLITE_FLOAT:
 176090 				fallthrough
 176091 			case SQLITE_INTEGER:
 176092 				{
 176093 					if eType == Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) {
 176094 						*(*Sqlite3_int64)(unsafe.Pointer(bp + 32)) = sessionGetI64(tls, pCsr)
 176095 						if eType == SQLITE_INTEGER {
 176096 							bChanged = libc.Bool32(*(*Sqlite3_int64)(unsafe.Pointer(bp + 32)) != Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 16))))
 176097 						} else {
 176098 							libc.Xmemcpy(tls, bp+24, bp+32, uint64(8))
 176099 							bChanged = libc.Bool32(*(*float64)(unsafe.Pointer(bp + 24)) != Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(bp + 16))))
 176100 						}
 176101 					}
 176102 					nOld = 8
 176103 					pCsr += uintptr(8)
 176104 					break
 176105 
 176106 				}
 176107 				fallthrough
 176108 
 176109 			default:
 176110 				{
 176111 					nOld = sessionVarintGet(tls, pCsr, bp+40)
 176112 					pCsr += uintptr(nOld)
 176113 					nOld = nOld + *(*int32)(unsafe.Pointer(bp + 40))
 176114 
 176115 					if eType == Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) &&
 176116 						*(*int32)(unsafe.Pointer(bp + 40)) == Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) &&
 176117 						(*(*int32)(unsafe.Pointer(bp + 40)) == 0 || 0 == libc.Xmemcmp(tls, pCsr, Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(bp + 16))), uint64(*(*int32)(unsafe.Pointer(bp + 40))))) {
 176118 						bChanged = 0
 176119 					}
 176120 					pCsr += uintptr(*(*int32)(unsafe.Pointer(bp + 40)))
 176121 					break
 176122 
 176123 				}
 176124 			}
 176125 
 176126 			if bChanged != 0 && *(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(ii))) != 0 {
 176127 				*(*I64)(unsafe.Pointer(bp + 8)) = I64((*SessionChange)(unsafe.Pointer(pC)).FnRecord + 2)
 176128 				break
 176129 			}
 176130 
 176131 			if bChanged != 0 {
 176132 				*(*I64)(unsafe.Pointer(bp + 8)) += I64(1 + nOld)
 176133 				sessionSerializeValue(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 16)), bp+8)
 176134 			} else if *(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(ii))) != 0 {
 176135 				*(*I64)(unsafe.Pointer(bp + 8)) += I64(2 + nOld)
 176136 			} else {
 176137 				*(*I64)(unsafe.Pointer(bp + 8)) += int64(2)
 176138 			}
 176139 		}
 176140 	}
 176141 
 176142 	if *(*I64)(unsafe.Pointer(bp + 8)) > I64((*SessionChange)(unsafe.Pointer(pC)).FnMaxSize) {
 176143 		var nIncr int32 = int32(*(*I64)(unsafe.Pointer(bp + 8)) - I64((*SessionChange)(unsafe.Pointer(pC)).FnMaxSize))
 176144 		(*SessionChange)(unsafe.Pointer(pC)).FnMaxSize = int32(*(*I64)(unsafe.Pointer(bp + 8)))
 176145 		*(*I64)(unsafe.Pointer(pSession + 64)) += I64(nIncr)
 176146 	}
 176147 	return SQLITE_OK
 176148 }
 176149 
 176150 func sessionPreupdateOneChange(tls *libc.TLS, op int32, pSession uintptr, pTab uintptr) {
 176151 	bp := tls.Alloc(80)
 176152 	defer tls.Free(80)
 176153 
 176154 	var rc int32
 176155 
 176156 	var p uintptr
 176157 
 176158 	var i int32
 176159 
 176160 	var pC uintptr
 176161 	*(*int32)(unsafe.Pointer(bp + 52)) = 0
 176162 	rc = SQLITE_OK
 176163 	*(*SessionStat1Ctx)(unsafe.Pointer(bp)) = SessionStat1Ctx{}
 176164 
 176165 	if !((*Sqlite3_session)(unsafe.Pointer(pSession)).Frc != 0) {
 176166 		goto __1
 176167 	}
 176168 	return
 176169 __1:
 176170 	;
 176171 	if !(sessionInitTable(tls, pSession, pTab) != 0) {
 176172 		goto __2
 176173 	}
 176174 	return
 176175 __2:
 176176 	;
 176177 	if !((*SessionTable)(unsafe.Pointer(pTab)).FnCol != (*struct {
 176178 		f func(*libc.TLS, uintptr) int32
 176179 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxCount})).f(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx)) {
 176180 		goto __3
 176181 	}
 176182 	(*Sqlite3_session)(unsafe.Pointer(pSession)).Frc = SQLITE_SCHEMA
 176183 	return
 176184 __3:
 176185 	;
 176186 	if !(sessionGrowHash(tls, pSession, 0, pTab) != 0) {
 176187 		goto __4
 176188 	}
 176189 	(*Sqlite3_session)(unsafe.Pointer(pSession)).Frc = SQLITE_NOMEM
 176190 	return
 176191 __4:
 176192 	;
 176193 	if !((*SessionTable)(unsafe.Pointer(pTab)).FbStat1 != 0) {
 176194 		goto __5
 176195 	}
 176196 	(*SessionStat1Ctx)(unsafe.Pointer(bp)).Fhook = (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook
 176197 	(*SessionStat1Ctx)(unsafe.Pointer(bp)).FpSession = pSession
 176198 	(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx = bp
 176199 	(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxNew = *(*uintptr)(unsafe.Pointer(&struct {
 176200 		f func(*libc.TLS, uintptr, int32, uintptr) int32
 176201 	}{sessionStat1New}))
 176202 	(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxOld = *(*uintptr)(unsafe.Pointer(&struct {
 176203 		f func(*libc.TLS, uintptr, int32, uintptr) int32
 176204 	}{sessionStat1Old}))
 176205 	(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxCount = *(*uintptr)(unsafe.Pointer(&struct {
 176206 		f func(*libc.TLS, uintptr) int32
 176207 	}{sessionStat1Count}))
 176208 	(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxDepth = *(*uintptr)(unsafe.Pointer(&struct {
 176209 		f func(*libc.TLS, uintptr) int32
 176210 	}{sessionStat1Depth}))
 176211 	if !((*Sqlite3_session)(unsafe.Pointer(pSession)).FpZeroBlob == uintptr(0)) {
 176212 		goto __6
 176213 	}
 176214 	p = Xsqlite3ValueNew(tls, uintptr(0))
 176215 	if !(p == uintptr(0)) {
 176216 		goto __7
 176217 	}
 176218 	rc = SQLITE_NOMEM
 176219 	goto error_out
 176220 __7:
 176221 	;
 176222 	Xsqlite3ValueSetStr(tls, p, 0, ts+1544, uint8(0), uintptr(0))
 176223 	(*Sqlite3_session)(unsafe.Pointer(pSession)).FpZeroBlob = p
 176224 __6:
 176225 	;
 176226 __5:
 176227 	;
 176228 	rc = sessionPreupdateHash(tls, pSession, pTab, libc.Bool32(op == SQLITE_INSERT), bp+48, bp+52)
 176229 	if !(rc != SQLITE_OK) {
 176230 		goto __8
 176231 	}
 176232 	goto error_out
 176233 __8:
 176234 	;
 176235 	if !(*(*int32)(unsafe.Pointer(bp + 52)) == 0) {
 176236 		goto __9
 176237 	}
 176238 	pC = *(*uintptr)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(*(*int32)(unsafe.Pointer(bp + 48)))*8))
 176239 __10:
 176240 	if !(pC != 0) {
 176241 		goto __12
 176242 	}
 176243 	if !(sessionPreupdateEqual(tls, pSession, pTab, pC, op) != 0) {
 176244 		goto __13
 176245 	}
 176246 	goto __12
 176247 __13:
 176248 	;
 176249 	goto __11
 176250 __11:
 176251 	pC = (*SessionChange)(unsafe.Pointer(pC)).FpNext
 176252 	goto __10
 176253 	goto __12
 176254 __12:
 176255 	;
 176256 	if !(pC == uintptr(0)) {
 176257 		goto __14
 176258 	}
 176259 
 176260 	(*SessionTable)(unsafe.Pointer(pTab)).FnEntry++
 176261 
 176262 	*(*Sqlite3_int64)(unsafe.Pointer(bp + 64)) = Sqlite3_int64(unsafe.Sizeof(SessionChange{}))
 176263 	i = 0
 176264 __16:
 176265 	if !(i < (*SessionTable)(unsafe.Pointer(pTab)).FnCol) {
 176266 		goto __18
 176267 	}
 176268 	*(*uintptr)(unsafe.Pointer(bp + 56)) = uintptr(0)
 176269 	if !(op != SQLITE_INSERT) {
 176270 		goto __19
 176271 	}
 176272 	(*struct {
 176273 		f func(*libc.TLS, uintptr, int32, uintptr) int32
 176274 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxOld})).f(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, i, bp+56)
 176275 
 176276 	goto __20
 176277 __19:
 176278 	if !(*(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i))) != 0) {
 176279 		goto __21
 176280 	}
 176281 	(*struct {
 176282 		f func(*libc.TLS, uintptr, int32, uintptr) int32
 176283 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxNew})).f(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, i, bp+56)
 176284 
 176285 __21:
 176286 	;
 176287 __20:
 176288 	;
 176289 	rc = sessionSerializeValue(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 56)), bp+64)
 176290 	if !(rc != SQLITE_OK) {
 176291 		goto __22
 176292 	}
 176293 	goto error_out
 176294 __22:
 176295 	;
 176296 	goto __17
 176297 __17:
 176298 	i++
 176299 	goto __16
 176300 	goto __18
 176301 __18:
 176302 	;
 176303 	pC = sessionMalloc64(tls, pSession, *(*Sqlite3_int64)(unsafe.Pointer(bp + 64)))
 176304 	if !!(pC != 0) {
 176305 		goto __23
 176306 	}
 176307 	rc = SQLITE_NOMEM
 176308 	goto error_out
 176309 	goto __24
 176310 __23:
 176311 	libc.Xmemset(tls, pC, 0, uint64(unsafe.Sizeof(SessionChange{})))
 176312 	(*SessionChange)(unsafe.Pointer(pC)).FaRecord = pC + 1*32
 176313 __24:
 176314 	;
 176315 	*(*Sqlite3_int64)(unsafe.Pointer(bp + 64)) = int64(0)
 176316 	i = 0
 176317 __25:
 176318 	if !(i < (*SessionTable)(unsafe.Pointer(pTab)).FnCol) {
 176319 		goto __27
 176320 	}
 176321 	*(*uintptr)(unsafe.Pointer(bp + 72)) = uintptr(0)
 176322 	if !(op != SQLITE_INSERT) {
 176323 		goto __28
 176324 	}
 176325 	(*struct {
 176326 		f func(*libc.TLS, uintptr, int32, uintptr) int32
 176327 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxOld})).f(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, i, bp+72)
 176328 	goto __29
 176329 __28:
 176330 	if !(*(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i))) != 0) {
 176331 		goto __30
 176332 	}
 176333 	(*struct {
 176334 		f func(*libc.TLS, uintptr, int32, uintptr) int32
 176335 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxNew})).f(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, i, bp+72)
 176336 __30:
 176337 	;
 176338 __29:
 176339 	;
 176340 	sessionSerializeValue(tls, (*SessionChange)(unsafe.Pointer(pC)).FaRecord+uintptr(*(*Sqlite3_int64)(unsafe.Pointer(bp + 64))), *(*uintptr)(unsafe.Pointer(bp + 72)), bp+64)
 176341 	goto __26
 176342 __26:
 176343 	i++
 176344 	goto __25
 176345 	goto __27
 176346 __27:
 176347 	;
 176348 	if !((*Sqlite3_session)(unsafe.Pointer(pSession)).FbIndirect != 0 || (*struct {
 176349 		f func(*libc.TLS, uintptr) int32
 176350 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxDepth})).f(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx) != 0) {
 176351 		goto __31
 176352 	}
 176353 	(*SessionChange)(unsafe.Pointer(pC)).FbIndirect = U8(1)
 176354 __31:
 176355 	;
 176356 	(*SessionChange)(unsafe.Pointer(pC)).FnRecord = int32(*(*Sqlite3_int64)(unsafe.Pointer(bp + 64)))
 176357 	(*SessionChange)(unsafe.Pointer(pC)).Fop = U8(op)
 176358 	(*SessionChange)(unsafe.Pointer(pC)).FpNext = *(*uintptr)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(*(*int32)(unsafe.Pointer(bp + 48)))*8))
 176359 	*(*uintptr)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(*(*int32)(unsafe.Pointer(bp + 48)))*8)) = pC
 176360 
 176361 	goto __15
 176362 __14:
 176363 	if !((*SessionChange)(unsafe.Pointer(pC)).FbIndirect != 0) {
 176364 		goto __32
 176365 	}
 176366 
 176367 	if !((*struct {
 176368 		f func(*libc.TLS, uintptr) int32
 176369 	})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxDepth})).f(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx) == 0 &&
 176370 		(*Sqlite3_session)(unsafe.Pointer(pSession)).FbIndirect == 0) {
 176371 		goto __33
 176372 	}
 176373 	(*SessionChange)(unsafe.Pointer(pC)).FbIndirect = U8(0)
 176374 __33:
 176375 	;
 176376 __32:
 176377 	;
 176378 __15:
 176379 	;
 176380 	if !((*Sqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0) {
 176381 		goto __34
 176382 	}
 176383 	rc = sessionUpdateMaxSize(tls, op, pSession, pTab, pC)
 176384 __34:
 176385 	;
 176386 __9:
 176387 	;
 176388 error_out:
 176389 	if !((*SessionTable)(unsafe.Pointer(pTab)).FbStat1 != 0) {
 176390 		goto __35
 176391 	}
 176392 	(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook = (*SessionStat1Ctx)(unsafe.Pointer(bp)).Fhook
 176393 __35:
 176394 	;
 176395 	if !(rc != SQLITE_OK) {
 176396 		goto __36
 176397 	}
 176398 	(*Sqlite3_session)(unsafe.Pointer(pSession)).Frc = rc
 176399 __36:
 176400 }
 176401 
 176402 func sessionFindTable(tls *libc.TLS, pSession uintptr, zName uintptr, ppTab uintptr) int32 {
 176403 	var rc int32 = SQLITE_OK
 176404 	var nName int32 = Xsqlite3Strlen30(tls, zName)
 176405 	var pRet uintptr
 176406 
 176407 	for pRet = (*Sqlite3_session)(unsafe.Pointer(pSession)).FpTable; pRet != 0; pRet = (*SessionTable)(unsafe.Pointer(pRet)).FpNext {
 176408 		if 0 == Xsqlite3_strnicmp(tls, (*SessionTable)(unsafe.Pointer(pRet)).FzName, zName, nName+1) {
 176409 			break
 176410 		}
 176411 	}
 176412 
 176413 	if pRet == uintptr(0) && (*Sqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach != 0 {
 176414 		if (*Sqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter == uintptr(0) ||
 176415 			(*struct {
 176416 				f func(*libc.TLS, uintptr, uintptr) int32
 176417 			})(unsafe.Pointer(&struct{ uintptr }{(*Sqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter})).f(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).FpFilterCtx, zName) != 0 {
 176418 			rc = Xsqlite3session_attach(tls, pSession, zName)
 176419 			if rc == SQLITE_OK {
 176420 				pRet = (*Sqlite3_session)(unsafe.Pointer(pSession)).FpTable
 176421 				for pRet != 0 && (*SessionTable)(unsafe.Pointer(pRet)).FpNext != 0 {
 176422 					pRet = (*SessionTable)(unsafe.Pointer(pRet)).FpNext
 176423 				}
 176424 
 176425 			}
 176426 		}
 176427 	}
 176428 
 176429 	*(*uintptr)(unsafe.Pointer(ppTab)) = pRet
 176430 	return rc
 176431 }
 176432 
 176433 func xPreUpdate(tls *libc.TLS, pCtx uintptr, db uintptr, op int32, zDb uintptr, zName uintptr, iKey1 Sqlite3_int64, iKey2 Sqlite3_int64) {
 176434 	bp := tls.Alloc(8)
 176435 	defer tls.Free(8)
 176436 
 176437 	var pSession uintptr
 176438 	var nDb int32 = Xsqlite3Strlen30(tls, zDb)
 176439 
 176440 	_ = iKey1
 176441 	_ = iKey2
 176442 
 176443 	for pSession = pCtx; pSession != 0; pSession = (*Sqlite3_session)(unsafe.Pointer(pSession)).FpNext {
 176444 		if (*Sqlite3_session)(unsafe.Pointer(pSession)).FbEnable == 0 {
 176445 			continue
 176446 		}
 176447 		if (*Sqlite3_session)(unsafe.Pointer(pSession)).Frc != 0 {
 176448 			continue
 176449 		}
 176450 		if Xsqlite3_strnicmp(tls, zDb, (*Sqlite3_session)(unsafe.Pointer(pSession)).FzDb, nDb+1) != 0 {
 176451 			continue
 176452 		}
 176453 
 176454 		(*Sqlite3_session)(unsafe.Pointer(pSession)).Frc = sessionFindTable(tls, pSession, zName, bp)
 176455 		if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
 176456 			sessionPreupdateOneChange(tls, op, pSession, *(*uintptr)(unsafe.Pointer(bp)))
 176457 			if op == SQLITE_UPDATE {
 176458 				sessionPreupdateOneChange(tls, SQLITE_INSERT, pSession, *(*uintptr)(unsafe.Pointer(bp)))
 176459 			}
 176460 		}
 176461 	}
 176462 }
 176463 
 176464 func sessionPreupdateOld(tls *libc.TLS, pCtx uintptr, iVal int32, ppVal uintptr) int32 {
 176465 	return Xsqlite3_preupdate_old(tls, pCtx, iVal, ppVal)
 176466 }
 176467 
 176468 func sessionPreupdateNew(tls *libc.TLS, pCtx uintptr, iVal int32, ppVal uintptr) int32 {
 176469 	return Xsqlite3_preupdate_new(tls, pCtx, iVal, ppVal)
 176470 }
 176471 
 176472 func sessionPreupdateCount(tls *libc.TLS, pCtx uintptr) int32 {
 176473 	return Xsqlite3_preupdate_count(tls, pCtx)
 176474 }
 176475 
 176476 func sessionPreupdateDepth(tls *libc.TLS, pCtx uintptr) int32 {
 176477 	return Xsqlite3_preupdate_depth(tls, pCtx)
 176478 }
 176479 
 176480 func sessionPreupdateHooks(tls *libc.TLS, pSession uintptr) {
 176481 	(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx = (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb
 176482 	(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxOld = *(*uintptr)(unsafe.Pointer(&struct {
 176483 		f func(*libc.TLS, uintptr, int32, uintptr) int32
 176484 	}{sessionPreupdateOld}))
 176485 	(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxNew = *(*uintptr)(unsafe.Pointer(&struct {
 176486 		f func(*libc.TLS, uintptr, int32, uintptr) int32
 176487 	}{sessionPreupdateNew}))
 176488 	(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxCount = *(*uintptr)(unsafe.Pointer(&struct {
 176489 		f func(*libc.TLS, uintptr) int32
 176490 	}{sessionPreupdateCount}))
 176491 	(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxDepth = *(*uintptr)(unsafe.Pointer(&struct {
 176492 		f func(*libc.TLS, uintptr) int32
 176493 	}{sessionPreupdateDepth}))
 176494 }
 176495 
 176496 type SessionDiffCtx1 = struct {
 176497 	FpStmt       uintptr
 176498 	FnOldOff     int32
 176499 	F__ccgo_pad1 [4]byte
 176500 }
 176501 
 176502 type SessionDiffCtx = SessionDiffCtx1
 176503 
 176504 func sessionDiffOld(tls *libc.TLS, pCtx uintptr, iVal int32, ppVal uintptr) int32 {
 176505 	var p uintptr = pCtx
 176506 	*(*uintptr)(unsafe.Pointer(ppVal)) = Xsqlite3_column_value(tls, (*SessionDiffCtx)(unsafe.Pointer(p)).FpStmt, iVal+(*SessionDiffCtx)(unsafe.Pointer(p)).FnOldOff)
 176507 	return SQLITE_OK
 176508 }
 176509 
 176510 func sessionDiffNew(tls *libc.TLS, pCtx uintptr, iVal int32, ppVal uintptr) int32 {
 176511 	var p uintptr = pCtx
 176512 	*(*uintptr)(unsafe.Pointer(ppVal)) = Xsqlite3_column_value(tls, (*SessionDiffCtx)(unsafe.Pointer(p)).FpStmt, iVal)
 176513 	return SQLITE_OK
 176514 }
 176515 
 176516 func sessionDiffCount(tls *libc.TLS, pCtx uintptr) int32 {
 176517 	var p uintptr = pCtx
 176518 	if (*SessionDiffCtx)(unsafe.Pointer(p)).FnOldOff != 0 {
 176519 		return (*SessionDiffCtx)(unsafe.Pointer(p)).FnOldOff
 176520 	}
 176521 	return Xsqlite3_column_count(tls, (*SessionDiffCtx)(unsafe.Pointer(p)).FpStmt)
 176522 }
 176523 
 176524 func sessionDiffDepth(tls *libc.TLS, pCtx uintptr) int32 {
 176525 	_ = pCtx
 176526 	return 0
 176527 }
 176528 
 176529 func sessionDiffHooks(tls *libc.TLS, pSession uintptr, pDiffCtx uintptr) {
 176530 	(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx = pDiffCtx
 176531 	(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxOld = *(*uintptr)(unsafe.Pointer(&struct {
 176532 		f func(*libc.TLS, uintptr, int32, uintptr) int32
 176533 	}{sessionDiffOld}))
 176534 	(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxNew = *(*uintptr)(unsafe.Pointer(&struct {
 176535 		f func(*libc.TLS, uintptr, int32, uintptr) int32
 176536 	}{sessionDiffNew}))
 176537 	(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxCount = *(*uintptr)(unsafe.Pointer(&struct {
 176538 		f func(*libc.TLS, uintptr) int32
 176539 	}{sessionDiffCount}))
 176540 	(*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxDepth = *(*uintptr)(unsafe.Pointer(&struct {
 176541 		f func(*libc.TLS, uintptr) int32
 176542 	}{sessionDiffDepth}))
 176543 }
 176544 
 176545 func sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr, zTab uintptr, azCol uintptr, abPK uintptr) uintptr {
 176546 	bp := tls.Alloc(64)
 176547 	defer tls.Free(64)
 176548 
 176549 	var i int32
 176550 	var zSep uintptr = ts + 1544
 176551 	var zRet uintptr = uintptr(0)
 176552 
 176553 	for i = 0; i < nCol; i++ {
 176554 		if *(*U8)(unsafe.Pointer(abPK + uintptr(i))) != 0 {
 176555 			zRet = Xsqlite3_mprintf(tls, ts+33921,
 176556 				libc.VaList(bp, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8))))
 176557 			zSep = ts + 22941
 176558 			if zRet == uintptr(0) {
 176559 				break
 176560 			}
 176561 		}
 176562 	}
 176563 
 176564 	return zRet
 176565 }
 176566 
 176567 func sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr, zTab uintptr, azCol uintptr, abPK uintptr) uintptr {
 176568 	bp := tls.Alloc(64)
 176569 	defer tls.Free(64)
 176570 
 176571 	var i int32
 176572 	var zSep uintptr = ts + 1544
 176573 	var zRet uintptr = uintptr(0)
 176574 	var bHave int32 = 0
 176575 
 176576 	for i = 0; i < nCol; i++ {
 176577 		if int32(*(*U8)(unsafe.Pointer(abPK + uintptr(i)))) == 0 {
 176578 			bHave = 1
 176579 			zRet = Xsqlite3_mprintf(tls,
 176580 				ts+33955,
 176581 				libc.VaList(bp, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8))))
 176582 			zSep = ts + 33996
 176583 			if zRet == uintptr(0) {
 176584 				break
 176585 			}
 176586 		}
 176587 	}
 176588 
 176589 	if bHave == 0 {
 176590 		zRet = Xsqlite3_mprintf(tls, ts+8871, 0)
 176591 	}
 176592 
 176593 	return zRet
 176594 }
 176595 
 176596 func sessionSelectFindNew(tls *libc.TLS, zDb1 uintptr, zDb2 uintptr, zTbl uintptr, zExpr uintptr) uintptr {
 176597 	bp := tls.Alloc(40)
 176598 	defer tls.Free(40)
 176599 
 176600 	var zRet uintptr = Xsqlite3_mprintf(tls,
 176601 		ts+34001,
 176602 		libc.VaList(bp, zDb1, zTbl, zDb2, zTbl, zExpr))
 176603 	return zRet
 176604 }
 176605 
 176606 func sessionDiffFindNew(tls *libc.TLS, op int32, pSession uintptr, pTab uintptr, zDb1 uintptr, zDb2 uintptr, zExpr uintptr) int32 {
 176607 	bp := tls.Alloc(8)
 176608 	defer tls.Free(8)
 176609 
 176610 	var rc int32 = SQLITE_OK
 176611 	var zStmt uintptr = sessionSelectFindNew(tls, zDb1, zDb2, (*SessionTable)(unsafe.Pointer(pTab)).FzName, zExpr)
 176612 
 176613 	if zStmt == uintptr(0) {
 176614 		rc = SQLITE_NOMEM
 176615 	} else {
 176616 		rc = Xsqlite3_prepare(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb, zStmt, -1, bp, uintptr(0))
 176617 		if rc == SQLITE_OK {
 176618 			var pDiffCtx uintptr = (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx
 176619 			(*SessionDiffCtx)(unsafe.Pointer(pDiffCtx)).FpStmt = *(*uintptr)(unsafe.Pointer(bp))
 176620 			(*SessionDiffCtx)(unsafe.Pointer(pDiffCtx)).FnOldOff = 0
 176621 			for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) {
 176622 				sessionPreupdateOneChange(tls, op, pSession, pTab)
 176623 			}
 176624 			rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp)))
 176625 		}
 176626 		Xsqlite3_free(tls, zStmt)
 176627 	}
 176628 
 176629 	return rc
 176630 }
 176631 
 176632 func sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFrom uintptr, zExpr uintptr) int32 {
 176633 	bp := tls.Alloc(56)
 176634 	defer tls.Free(56)
 176635 
 176636 	var rc int32 = SQLITE_OK
 176637 
 176638 	var zExpr2 uintptr = sessionExprCompareOther(tls, (*SessionTable)(unsafe.Pointer(pTab)).FnCol,
 176639 		(*Sqlite3_session)(unsafe.Pointer(pSession)).FzDb, zFrom, (*SessionTable)(unsafe.Pointer(pTab)).FzName, (*SessionTable)(unsafe.Pointer(pTab)).FazCol, (*SessionTable)(unsafe.Pointer(pTab)).FabPK)
 176640 	if zExpr2 == uintptr(0) {
 176641 		rc = SQLITE_NOMEM
 176642 	} else {
 176643 		var zStmt uintptr = Xsqlite3_mprintf(tls,
 176644 			ts+34079,
 176645 			libc.VaList(bp, (*Sqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*SessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*SessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2))
 176646 		if zStmt == uintptr(0) {
 176647 			rc = SQLITE_NOMEM
 176648 		} else {
 176649 			rc = Xsqlite3_prepare(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb, zStmt, -1, bp+48, uintptr(0))
 176650 
 176651 			if rc == SQLITE_OK {
 176652 				var pDiffCtx uintptr = (*Sqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx
 176653 				(*SessionDiffCtx)(unsafe.Pointer(pDiffCtx)).FpStmt = *(*uintptr)(unsafe.Pointer(bp + 48))
 176654 				(*SessionDiffCtx)(unsafe.Pointer(pDiffCtx)).FnOldOff = (*SessionTable)(unsafe.Pointer(pTab)).FnCol
 176655 				for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 48))) {
 176656 					sessionPreupdateOneChange(tls, SQLITE_UPDATE, pSession, pTab)
 176657 				}
 176658 				rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 48)))
 176659 			}
 176660 			Xsqlite3_free(tls, zStmt)
 176661 		}
 176662 	}
 176663 
 176664 	return rc
 176665 }
 176666 
 176667 func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl uintptr, pzErrMsg uintptr) int32 {
 176668 	bp := tls.Alloc(48)
 176669 	defer tls.Free(48)
 176670 
 176671 	var zDb uintptr
 176672 	var rc int32
 176673 
 176674 	var i int32
 176675 	var bHasPk int32
 176676 	var bMismatch int32
 176677 
 176678 	var zExpr uintptr
 176679 	var db uintptr
 176680 
 176681 	zDb = (*Sqlite3_session)(unsafe.Pointer(pSession)).FzDb
 176682 	rc = (*Sqlite3_session)(unsafe.Pointer(pSession)).Frc
 176683 
 176684 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(SessionDiffCtx{})))
 176685 	sessionDiffHooks(tls, pSession, bp)
 176686 
 176687 	Xsqlite3_mutex_enter(tls, Xsqlite3_db_mutex(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb))
 176688 	if !(pzErrMsg != 0) {
 176689 		goto __1
 176690 	}
 176691 	*(*uintptr)(unsafe.Pointer(pzErrMsg)) = uintptr(0)
 176692 __1:
 176693 	;
 176694 	if !(rc == SQLITE_OK) {
 176695 		goto __2
 176696 	}
 176697 	zExpr = uintptr(0)
 176698 	db = (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb
 176699 
 176700 	rc = sessionFindTable(tls, pSession, zTbl, bp+16)
 176701 	if !(*(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0)) {
 176702 		goto __3
 176703 	}
 176704 	goto diff_out
 176705 __3:
 176706 	;
 176707 	if !(sessionInitTable(tls, pSession, *(*uintptr)(unsafe.Pointer(bp + 16))) != 0) {
 176708 		goto __4
 176709 	}
 176710 	rc = (*Sqlite3_session)(unsafe.Pointer(pSession)).Frc
 176711 	goto diff_out
 176712 __4:
 176713 	;
 176714 	if !(rc == SQLITE_OK) {
 176715 		goto __5
 176716 	}
 176717 	bHasPk = 0
 176718 	bMismatch = 0
 176719 	*(*uintptr)(unsafe.Pointer(bp + 32)) = uintptr(0)
 176720 	rc = sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), bp+32, bp+40)
 176721 	if !(rc == SQLITE_OK) {
 176722 		goto __6
 176723 	}
 176724 	if !((*SessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnCol != *(*int32)(unsafe.Pointer(bp + 24))) {
 176725 		goto __7
 176726 	}
 176727 	bMismatch = 1
 176728 	goto __8
 176729 __7:
 176730 	i = 0
 176731 __9:
 176732 	if !(i < *(*int32)(unsafe.Pointer(bp + 24))) {
 176733 		goto __11
 176734 	}
 176735 	if !(int32(*(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FabPK + uintptr(i)))) != int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i))))) {
 176736 		goto __12
 176737 	}
 176738 	bMismatch = 1
 176739 __12:
 176740 	;
 176741 	if !(Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)) + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FazCol + uintptr(i)*8))) != 0) {
 176742 		goto __13
 176743 	}
 176744 	bMismatch = 1
 176745 __13:
 176746 	;
 176747 	if !(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i))) != 0) {
 176748 		goto __14
 176749 	}
 176750 	bHasPk = 1
 176751 __14:
 176752 	;
 176753 	goto __10
 176754 __10:
 176755 	i++
 176756 	goto __9
 176757 	goto __11
 176758 __11:
 176759 	;
 176760 __8:
 176761 	;
 176762 __6:
 176763 	;
 176764 	Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 32)))
 176765 	if !(bMismatch != 0) {
 176766 		goto __15
 176767 	}
 176768 	if !(pzErrMsg != 0) {
 176769 		goto __16
 176770 	}
 176771 	*(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+34132, 0)
 176772 __16:
 176773 	;
 176774 	rc = SQLITE_SCHEMA
 176775 __15:
 176776 	;
 176777 	if !(bHasPk == 0) {
 176778 		goto __17
 176779 	}
 176780 
 176781 	goto diff_out
 176782 __17:
 176783 	;
 176784 __5:
 176785 	;
 176786 	if !(rc == SQLITE_OK) {
 176787 		goto __18
 176788 	}
 176789 	zExpr = sessionExprComparePK(tls, (*SessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnCol,
 176790 		zDb, zFrom, (*SessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FzName, (*SessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FazCol, (*SessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FabPK)
 176791 __18:
 176792 	;
 176793 	if !(rc == SQLITE_OK) {
 176794 		goto __19
 176795 	}
 176796 	rc = sessionDiffFindNew(tls, SQLITE_INSERT, pSession, *(*uintptr)(unsafe.Pointer(bp + 16)), zDb, zFrom, zExpr)
 176797 __19:
 176798 	;
 176799 	if !(rc == SQLITE_OK) {
 176800 		goto __20
 176801 	}
 176802 	rc = sessionDiffFindNew(tls, SQLITE_DELETE, pSession, *(*uintptr)(unsafe.Pointer(bp + 16)), zFrom, zDb, zExpr)
 176803 __20:
 176804 	;
 176805 	if !(rc == SQLITE_OK) {
 176806 		goto __21
 176807 	}
 176808 	rc = sessionDiffFindModified(tls, pSession, *(*uintptr)(unsafe.Pointer(bp + 16)), zFrom, zExpr)
 176809 __21:
 176810 	;
 176811 	Xsqlite3_free(tls, zExpr)
 176812 __2:
 176813 	;
 176814 diff_out:
 176815 	sessionPreupdateHooks(tls, pSession)
 176816 	Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb))
 176817 	return rc
 176818 }
 176819 
 176820 // Create a session object. This session object will record changes to
 176821 // database zDb attached to connection db.
 176822 func Xsqlite3session_create(tls *libc.TLS, db uintptr, zDb uintptr, ppSession uintptr) int32 {
 176823 	var pNew uintptr
 176824 	var pOld uintptr
 176825 	var nDb int32 = Xsqlite3Strlen30(tls, zDb)
 176826 
 176827 	*(*uintptr)(unsafe.Pointer(ppSession)) = uintptr(0)
 176828 
 176829 	pNew = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(Sqlite3_session{}))+uint64(nDb)+uint64(1))
 176830 	if !(pNew != 0) {
 176831 		return SQLITE_NOMEM
 176832 	}
 176833 	libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(Sqlite3_session{})))
 176834 	(*Sqlite3_session)(unsafe.Pointer(pNew)).Fdb = db
 176835 	(*Sqlite3_session)(unsafe.Pointer(pNew)).FzDb = pNew + 1*136
 176836 	(*Sqlite3_session)(unsafe.Pointer(pNew)).FbEnable = 1
 176837 	libc.Xmemcpy(tls, (*Sqlite3_session)(unsafe.Pointer(pNew)).FzDb, zDb, uint64(nDb+1))
 176838 	sessionPreupdateHooks(tls, pNew)
 176839 
 176840 	Xsqlite3_mutex_enter(tls, Xsqlite3_db_mutex(tls, db))
 176841 	pOld = Xsqlite3_preupdate_hook(tls, db, *(*uintptr)(unsafe.Pointer(&struct {
 176842 		f func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Sqlite3_int64, Sqlite3_int64)
 176843 	}{xPreUpdate})), pNew)
 176844 	(*Sqlite3_session)(unsafe.Pointer(pNew)).FpNext = pOld
 176845 	Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db))
 176846 
 176847 	*(*uintptr)(unsafe.Pointer(ppSession)) = pNew
 176848 	return SQLITE_OK
 176849 }
 176850 
 176851 func sessionDeleteTable(tls *libc.TLS, pSession uintptr, pList uintptr) {
 176852 	var pNext uintptr
 176853 	var pTab uintptr
 176854 
 176855 	for pTab = pList; pTab != 0; pTab = pNext {
 176856 		var i int32
 176857 		pNext = (*SessionTable)(unsafe.Pointer(pTab)).FpNext
 176858 		for i = 0; i < (*SessionTable)(unsafe.Pointer(pTab)).FnChange; i++ {
 176859 			var p uintptr
 176860 			var pNextChange uintptr
 176861 			for p = *(*uintptr)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(i)*8)); p != 0; p = pNextChange {
 176862 				pNextChange = (*SessionChange)(unsafe.Pointer(p)).FpNext
 176863 				sessionFree(tls, pSession, p)
 176864 			}
 176865 		}
 176866 		sessionFree(tls, pSession, (*SessionTable)(unsafe.Pointer(pTab)).FazCol)
 176867 		sessionFree(tls, pSession, (*SessionTable)(unsafe.Pointer(pTab)).FapChange)
 176868 		sessionFree(tls, pSession, pTab)
 176869 	}
 176870 }
 176871 
 176872 // Delete a session object previously allocated using sqlite3session_create().
 176873 func Xsqlite3session_delete(tls *libc.TLS, pSession uintptr) {
 176874 	bp := tls.Alloc(8)
 176875 	defer tls.Free(8)
 176876 
 176877 	var db uintptr = (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb
 176878 
 176879 	var pp uintptr
 176880 
 176881 	Xsqlite3_mutex_enter(tls, Xsqlite3_db_mutex(tls, db))
 176882 	*(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_preupdate_hook(tls, db, uintptr(0), uintptr(0))
 176883 	for pp = bp; *(*uintptr)(unsafe.Pointer(pp)) != uintptr(0); pp = *(*uintptr)(unsafe.Pointer(pp)) + 80 {
 176884 		if *(*uintptr)(unsafe.Pointer(pp)) == pSession {
 176885 			*(*uintptr)(unsafe.Pointer(pp)) = (*Sqlite3_session)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FpNext
 176886 			if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
 176887 				Xsqlite3_preupdate_hook(tls, db, *(*uintptr)(unsafe.Pointer(&struct {
 176888 					f func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Sqlite3_int64, Sqlite3_int64)
 176889 				}{xPreUpdate})), *(*uintptr)(unsafe.Pointer(bp)))
 176890 			}
 176891 			break
 176892 		}
 176893 	}
 176894 	Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db))
 176895 	Xsqlite3ValueFree(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).FpZeroBlob)
 176896 
 176897 	sessionDeleteTable(tls, pSession, (*Sqlite3_session)(unsafe.Pointer(pSession)).FpTable)
 176898 
 176899 	Xsqlite3_free(tls, pSession)
 176900 }
 176901 
 176902 // Set a table filter on a Session Object.
 176903 func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, xFilter uintptr, pCtx uintptr) {
 176904 	(*Sqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach = 1
 176905 	(*Sqlite3_session)(unsafe.Pointer(pSession)).FpFilterCtx = pCtx
 176906 	(*Sqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = xFilter
 176907 }
 176908 
 176909 // Attach a table to a session. All subsequent changes made to the table
 176910 // while the session object is enabled will be recorded.
 176911 //
 176912 // Only tables that have a PRIMARY KEY defined may be attached. It does
 176913 // not matter if the PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias)
 176914 // or not.
 176915 func Xsqlite3session_attach(tls *libc.TLS, pSession uintptr, zName uintptr) int32 {
 176916 	var rc int32 = SQLITE_OK
 176917 	Xsqlite3_mutex_enter(tls, Xsqlite3_db_mutex(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb))
 176918 
 176919 	if !(zName != 0) {
 176920 		(*Sqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach = 1
 176921 	} else {
 176922 		var pTab uintptr
 176923 		var nName int32
 176924 
 176925 		nName = Xsqlite3Strlen30(tls, zName)
 176926 		for pTab = (*Sqlite3_session)(unsafe.Pointer(pSession)).FpTable; pTab != 0; pTab = (*SessionTable)(unsafe.Pointer(pTab)).FpNext {
 176927 			if 0 == Xsqlite3_strnicmp(tls, (*SessionTable)(unsafe.Pointer(pTab)).FzName, zName, nName+1) {
 176928 				break
 176929 			}
 176930 		}
 176931 
 176932 		if !(pTab != 0) {
 176933 			var nByte int32 = int32(uint64(unsafe.Sizeof(SessionTable{})) + uint64(nName) + uint64(1))
 176934 			pTab = sessionMalloc64(tls, pSession, int64(nByte))
 176935 			if !(pTab != 0) {
 176936 				rc = SQLITE_NOMEM
 176937 			} else {
 176938 				var ppTab uintptr
 176939 				libc.Xmemset(tls, pTab, 0, uint64(unsafe.Sizeof(SessionTable{})))
 176940 				(*SessionTable)(unsafe.Pointer(pTab)).FzName = pTab + 1*56
 176941 				libc.Xmemcpy(tls, (*SessionTable)(unsafe.Pointer(pTab)).FzName, zName, uint64(nName+1))
 176942 				for ppTab = pSession + 88; *(*uintptr)(unsafe.Pointer(ppTab)) != 0; ppTab = *(*uintptr)(unsafe.Pointer(ppTab)) {
 176943 				}
 176944 				*(*uintptr)(unsafe.Pointer(ppTab)) = pTab
 176945 			}
 176946 		}
 176947 	}
 176948 
 176949 	Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb))
 176950 	return rc
 176951 }
 176952 
 176953 func sessionBufferGrow(tls *libc.TLS, p uintptr, nByte I64, pRc uintptr) int32 {
 176954 	var nReq I64 = I64((*SessionBuffer)(unsafe.Pointer(p)).FnBuf) + nByte
 176955 	if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK && nReq > I64((*SessionBuffer)(unsafe.Pointer(p)).FnAlloc) {
 176956 		var aNew uintptr
 176957 		var nNew I64
 176958 		if (*SessionBuffer)(unsafe.Pointer(p)).FnAlloc != 0 {
 176959 			nNew = int64((*SessionBuffer)(unsafe.Pointer(p)).FnAlloc)
 176960 		} else {
 176961 			nNew = int64(128)
 176962 		}
 176963 
 176964 		for __ccgo := true; __ccgo; __ccgo = nNew < nReq {
 176965 			nNew = nNew * int64(2)
 176966 		}
 176967 
 176968 		if nNew > int64(0x7FFFFF00-1) {
 176969 			nNew = int64(0x7FFFFF00 - 1)
 176970 			if nNew < nReq {
 176971 				*(*int32)(unsafe.Pointer(pRc)) = SQLITE_NOMEM
 176972 				return 1
 176973 			}
 176974 		}
 176975 
 176976 		aNew = Xsqlite3_realloc64(tls, (*SessionBuffer)(unsafe.Pointer(p)).FaBuf, uint64(nNew))
 176977 		if uintptr(0) == aNew {
 176978 			*(*int32)(unsafe.Pointer(pRc)) = SQLITE_NOMEM
 176979 		} else {
 176980 			(*SessionBuffer)(unsafe.Pointer(p)).FaBuf = aNew
 176981 			(*SessionBuffer)(unsafe.Pointer(p)).FnAlloc = int32(nNew)
 176982 		}
 176983 	}
 176984 	return libc.Bool32(*(*int32)(unsafe.Pointer(pRc)) != SQLITE_OK)
 176985 }
 176986 
 176987 func sessionAppendValue(tls *libc.TLS, p uintptr, pVal uintptr, pRc uintptr) {
 176988 	bp := tls.Alloc(12)
 176989 	defer tls.Free(12)
 176990 
 176991 	*(*int32)(unsafe.Pointer(bp + 8)) = *(*int32)(unsafe.Pointer(pRc))
 176992 	if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
 176993 		*(*Sqlite3_int64)(unsafe.Pointer(bp)) = int64(0)
 176994 		*(*int32)(unsafe.Pointer(bp + 8)) = sessionSerializeValue(tls, uintptr(0), pVal, bp)
 176995 		sessionBufferGrow(tls, p, *(*Sqlite3_int64)(unsafe.Pointer(bp)), bp+8)
 176996 		if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
 176997 			*(*int32)(unsafe.Pointer(bp + 8)) = sessionSerializeValue(tls, (*SessionBuffer)(unsafe.Pointer(p)).FaBuf+uintptr((*SessionBuffer)(unsafe.Pointer(p)).FnBuf), pVal, uintptr(0))
 176998 			*(*int32)(unsafe.Pointer(p + 8)) += int32(*(*Sqlite3_int64)(unsafe.Pointer(bp)))
 176999 		} else {
 177000 			*(*int32)(unsafe.Pointer(pRc)) = *(*int32)(unsafe.Pointer(bp + 8))
 177001 		}
 177002 	}
 177003 }
 177004 
 177005 func sessionAppendByte(tls *libc.TLS, p uintptr, v U8, pRc uintptr) {
 177006 	if 0 == sessionBufferGrow(tls, p, int64(1), pRc) {
 177007 		*(*U8)(unsafe.Pointer((*SessionBuffer)(unsafe.Pointer(p)).FaBuf + uintptr(libc.PostIncInt32(&(*SessionBuffer)(unsafe.Pointer(p)).FnBuf, 1)))) = v
 177008 	}
 177009 }
 177010 
 177011 func sessionAppendVarint(tls *libc.TLS, p uintptr, v int32, pRc uintptr) {
 177012 	if 0 == sessionBufferGrow(tls, p, int64(9), pRc) {
 177013 		*(*int32)(unsafe.Pointer(p + 8)) += sessionVarintPut(tls, (*SessionBuffer)(unsafe.Pointer(p)).FaBuf+uintptr((*SessionBuffer)(unsafe.Pointer(p)).FnBuf), v)
 177014 	}
 177015 }
 177016 
 177017 func sessionAppendBlob(tls *libc.TLS, p uintptr, aBlob uintptr, nBlob int32, pRc uintptr) {
 177018 	if nBlob > 0 && 0 == sessionBufferGrow(tls, p, int64(nBlob), pRc) {
 177019 		libc.Xmemcpy(tls, (*SessionBuffer)(unsafe.Pointer(p)).FaBuf+uintptr((*SessionBuffer)(unsafe.Pointer(p)).FnBuf), aBlob, uint64(nBlob))
 177020 		*(*int32)(unsafe.Pointer(p + 8)) += nBlob
 177021 	}
 177022 }
 177023 
 177024 func sessionAppendStr(tls *libc.TLS, p uintptr, zStr uintptr, pRc uintptr) {
 177025 	var nStr int32 = Xsqlite3Strlen30(tls, zStr)
 177026 	if 0 == sessionBufferGrow(tls, p, int64(nStr), pRc) {
 177027 		libc.Xmemcpy(tls, (*SessionBuffer)(unsafe.Pointer(p)).FaBuf+uintptr((*SessionBuffer)(unsafe.Pointer(p)).FnBuf), zStr, uint64(nStr))
 177028 		*(*int32)(unsafe.Pointer(p + 8)) += nStr
 177029 	}
 177030 }
 177031 
 177032 func sessionAppendInteger(tls *libc.TLS, p uintptr, iVal int32, pRc uintptr) {
 177033 	bp := tls.Alloc(32)
 177034 	defer tls.Free(32)
 177035 
 177036 	Xsqlite3_snprintf(tls, int32(uint64(unsafe.Sizeof([24]int8{}))-uint64(1)), bp+8, ts+6327, libc.VaList(bp, iVal))
 177037 	sessionAppendStr(tls, p, bp+8, pRc)
 177038 }
 177039 
 177040 func sessionAppendIdent(tls *libc.TLS, p uintptr, zStr uintptr, pRc uintptr) {
 177041 	var nStr int32 = Xsqlite3Strlen30(tls, zStr)*2 + 2 + 1
 177042 	if 0 == sessionBufferGrow(tls, p, int64(nStr), pRc) {
 177043 		var zOut uintptr = (*SessionBuffer)(unsafe.Pointer(p)).FaBuf + uintptr((*SessionBuffer)(unsafe.Pointer(p)).FnBuf)
 177044 		var zIn uintptr = zStr
 177045 		*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8('"')
 177046 		for *(*int8)(unsafe.Pointer(zIn)) != 0 {
 177047 			if int32(*(*int8)(unsafe.Pointer(zIn))) == '"' {
 177048 				*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8('"')
 177049 			}
 177050 			*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))
 177051 		}
 177052 		*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8('"')
 177053 		(*SessionBuffer)(unsafe.Pointer(p)).FnBuf = int32((int64(zOut) - int64((*SessionBuffer)(unsafe.Pointer(p)).FaBuf)) / 1)
 177054 	}
 177055 }
 177056 
 177057 func sessionAppendCol(tls *libc.TLS, p uintptr, pStmt uintptr, iCol int32, pRc uintptr) {
 177058 	bp := tls.Alloc(24)
 177059 	defer tls.Free(24)
 177060 
 177061 	if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
 177062 		var eType int32 = Xsqlite3_column_type(tls, pStmt, iCol)
 177063 		sessionAppendByte(tls, p, U8(eType), pRc)
 177064 		if eType == SQLITE_INTEGER || eType == SQLITE_FLOAT {
 177065 			if eType == SQLITE_INTEGER {
 177066 				*(*Sqlite3_int64)(unsafe.Pointer(bp)) = Xsqlite3_column_int64(tls, pStmt, iCol)
 177067 			} else {
 177068 				*(*float64)(unsafe.Pointer(bp + 8)) = Xsqlite3_column_double(tls, pStmt, iCol)
 177069 				libc.Xmemcpy(tls, bp, bp+8, uint64(8))
 177070 			}
 177071 			sessionPutI64(tls, bp+16, *(*Sqlite3_int64)(unsafe.Pointer(bp)))
 177072 			sessionAppendBlob(tls, p, bp+16, 8, pRc)
 177073 		}
 177074 		if eType == SQLITE_BLOB || eType == SQLITE_TEXT {
 177075 			var z uintptr
 177076 			var nByte int32
 177077 			if eType == SQLITE_BLOB {
 177078 				z = Xsqlite3_column_blob(tls, pStmt, iCol)
 177079 			} else {
 177080 				z = Xsqlite3_column_text(tls, pStmt, iCol)
 177081 			}
 177082 			nByte = Xsqlite3_column_bytes(tls, pStmt, iCol)
 177083 			if z != 0 || eType == SQLITE_BLOB && nByte == 0 {
 177084 				sessionAppendVarint(tls, p, nByte, pRc)
 177085 				sessionAppendBlob(tls, p, z, nByte, pRc)
 177086 			} else {
 177087 				*(*int32)(unsafe.Pointer(pRc)) = SQLITE_NOMEM
 177088 			}
 177089 		}
 177090 	}
 177091 }
 177092 
 177093 func sessionAppendUpdate(tls *libc.TLS, pBuf uintptr, bPatchset int32, pStmt uintptr, p uintptr, abPK uintptr) int32 {
 177094 	bp := tls.Alloc(48)
 177095 	defer tls.Free(48)
 177096 
 177097 	*(*int32)(unsafe.Pointer(bp)) = SQLITE_OK
 177098 	*(*SessionBuffer)(unsafe.Pointer(bp + 32)) = SessionBuffer{}
 177099 	var bNoop int32 = 1
 177100 	var nRewind int32 = (*SessionBuffer)(unsafe.Pointer(pBuf)).FnBuf
 177101 	var i int32
 177102 	var pCsr uintptr = (*SessionChange)(unsafe.Pointer(p)).FaRecord
 177103 
 177104 	sessionAppendByte(tls, pBuf, uint8(SQLITE_UPDATE), bp)
 177105 	sessionAppendByte(tls, pBuf, (*SessionChange)(unsafe.Pointer(p)).FbIndirect, bp)
 177106 	for i = 0; i < Xsqlite3_column_count(tls, pStmt); i++ {
 177107 		var bChanged int32 = 0
 177108 		var nAdvance int32
 177109 		var eType int32 = int32(*(*U8)(unsafe.Pointer(pCsr)))
 177110 		switch eType {
 177111 		case SQLITE_NULL:
 177112 			nAdvance = 1
 177113 			if Xsqlite3_column_type(tls, pStmt, i) != SQLITE_NULL {
 177114 				bChanged = 1
 177115 			}
 177116 			break
 177117 
 177118 		case SQLITE_FLOAT:
 177119 			fallthrough
 177120 		case SQLITE_INTEGER:
 177121 			{
 177122 				nAdvance = 9
 177123 				if eType == Xsqlite3_column_type(tls, pStmt, i) {
 177124 					*(*Sqlite3_int64)(unsafe.Pointer(bp + 16)) = sessionGetI64(tls, pCsr+1)
 177125 					if eType == SQLITE_INTEGER {
 177126 						if *(*Sqlite3_int64)(unsafe.Pointer(bp + 16)) == Xsqlite3_column_int64(tls, pStmt, i) {
 177127 							break
 177128 						}
 177129 					} else {
 177130 						libc.Xmemcpy(tls, bp+8, bp+16, uint64(8))
 177131 						if *(*float64)(unsafe.Pointer(bp + 8)) == Xsqlite3_column_double(tls, pStmt, i) {
 177132 							break
 177133 						}
 177134 					}
 177135 				}
 177136 				bChanged = 1
 177137 				break
 177138 
 177139 			}
 177140 
 177141 		default:
 177142 			{
 177143 				var nHdr int32 = 1 + sessionVarintGet(tls, pCsr+1, bp+24)
 177144 
 177145 				nAdvance = nHdr + *(*int32)(unsafe.Pointer(bp + 24))
 177146 				if eType == Xsqlite3_column_type(tls, pStmt, i) &&
 177147 					*(*int32)(unsafe.Pointer(bp + 24)) == Xsqlite3_column_bytes(tls, pStmt, i) &&
 177148 					(*(*int32)(unsafe.Pointer(bp + 24)) == 0 || 0 == libc.Xmemcmp(tls, pCsr+uintptr(nHdr), Xsqlite3_column_blob(tls, pStmt, i), uint64(*(*int32)(unsafe.Pointer(bp + 24))))) {
 177149 					break
 177150 				}
 177151 				bChanged = 1
 177152 
 177153 			}
 177154 		}
 177155 
 177156 		if bChanged != 0 {
 177157 			bNoop = 0
 177158 		}
 177159 
 177160 		if bPatchset == 0 {
 177161 			if bChanged != 0 || *(*U8)(unsafe.Pointer(abPK + uintptr(i))) != 0 {
 177162 				sessionAppendBlob(tls, pBuf, pCsr, nAdvance, bp)
 177163 			} else {
 177164 				sessionAppendByte(tls, pBuf, uint8(0), bp)
 177165 			}
 177166 		}
 177167 
 177168 		if bChanged != 0 || bPatchset != 0 && *(*U8)(unsafe.Pointer(abPK + uintptr(i))) != 0 {
 177169 			sessionAppendCol(tls, bp+32, pStmt, i, bp)
 177170 		} else {
 177171 			sessionAppendByte(tls, bp+32, uint8(0), bp)
 177172 		}
 177173 
 177174 		pCsr += uintptr(nAdvance)
 177175 	}
 177176 
 177177 	if bNoop != 0 {
 177178 		(*SessionBuffer)(unsafe.Pointer(pBuf)).FnBuf = nRewind
 177179 	} else {
 177180 		sessionAppendBlob(tls, pBuf, (*SessionBuffer)(unsafe.Pointer(bp+32)).FaBuf, (*SessionBuffer)(unsafe.Pointer(bp+32)).FnBuf, bp)
 177181 	}
 177182 	Xsqlite3_free(tls, (*SessionBuffer)(unsafe.Pointer(bp+32)).FaBuf)
 177183 
 177184 	return *(*int32)(unsafe.Pointer(bp))
 177185 }
 177186 
 177187 func sessionAppendDelete(tls *libc.TLS, pBuf uintptr, bPatchset int32, p uintptr, nCol int32, abPK uintptr) int32 {
 177188 	bp := tls.Alloc(8)
 177189 	defer tls.Free(8)
 177190 
 177191 	*(*int32)(unsafe.Pointer(bp)) = SQLITE_OK
 177192 
 177193 	sessionAppendByte(tls, pBuf, uint8(SQLITE_DELETE), bp)
 177194 	sessionAppendByte(tls, pBuf, (*SessionChange)(unsafe.Pointer(p)).FbIndirect, bp)
 177195 
 177196 	if bPatchset == 0 {
 177197 		sessionAppendBlob(tls, pBuf, (*SessionChange)(unsafe.Pointer(p)).FaRecord, (*SessionChange)(unsafe.Pointer(p)).FnRecord, bp)
 177198 	} else {
 177199 		var i int32
 177200 		var a uintptr = (*SessionChange)(unsafe.Pointer(p)).FaRecord
 177201 		for i = 0; i < nCol; i++ {
 177202 			var pStart uintptr = a
 177203 			var eType int32 = int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&a, 1))))
 177204 
 177205 			switch eType {
 177206 			case 0:
 177207 				fallthrough
 177208 			case SQLITE_NULL:
 177209 				break
 177210 				fallthrough
 177211 
 177212 			case SQLITE_FLOAT:
 177213 				fallthrough
 177214 			case SQLITE_INTEGER:
 177215 				a += uintptr(8)
 177216 				break
 177217 				fallthrough
 177218 
 177219 			default:
 177220 				{
 177221 					a += uintptr(sessionVarintGet(tls, a, bp+4))
 177222 					a += uintptr(*(*int32)(unsafe.Pointer(bp + 4)))
 177223 					break
 177224 
 177225 				}
 177226 			}
 177227 			if *(*U8)(unsafe.Pointer(abPK + uintptr(i))) != 0 {
 177228 				sessionAppendBlob(tls, pBuf, pStart, int32((int64(a)-int64(pStart))/1), bp)
 177229 			}
 177230 		}
 177231 
 177232 	}
 177233 
 177234 	return *(*int32)(unsafe.Pointer(bp))
 177235 }
 177236 
 177237 func sessionSelectStmt(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, nCol int32, azCol uintptr, abPK uintptr, ppStmt uintptr) int32 {
 177238 	bp := tls.Alloc(28)
 177239 	defer tls.Free(28)
 177240 
 177241 	*(*int32)(unsafe.Pointer(bp + 24)) = SQLITE_OK
 177242 	var zSql uintptr = uintptr(0)
 177243 	var nSql int32 = -1
 177244 
 177245 	if 0 == Xsqlite3_stricmp(tls, ts+12700, zTab) {
 177246 		zSql = Xsqlite3_mprintf(tls,
 177247 			ts+34159, libc.VaList(bp, zDb))
 177248 		if zSql == uintptr(0) {
 177249 			*(*int32)(unsafe.Pointer(bp + 24)) = SQLITE_NOMEM
 177250 		}
 177251 	} else {
 177252 		var i int32
 177253 		var zSep uintptr = ts + 1544
 177254 		*(*SessionBuffer)(unsafe.Pointer(bp + 8)) = SessionBuffer{}
 177255 
 177256 		sessionAppendStr(tls, bp+8, ts+34269, bp+24)
 177257 		sessionAppendIdent(tls, bp+8, zDb, bp+24)
 177258 		sessionAppendStr(tls, bp+8, ts+1557, bp+24)
 177259 		sessionAppendIdent(tls, bp+8, zTab, bp+24)
 177260 		sessionAppendStr(tls, bp+8, ts+34284, bp+24)
 177261 		for i = 0; i < nCol; i++ {
 177262 			if *(*U8)(unsafe.Pointer(abPK + uintptr(i))) != 0 {
 177263 				sessionAppendStr(tls, bp+8, zSep, bp+24)
 177264 				sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp+24)
 177265 				sessionAppendStr(tls, bp+8, ts+34292, bp+24)
 177266 				sessionAppendInteger(tls, bp+8, i+1, bp+24)
 177267 				zSep = ts + 22941
 177268 			}
 177269 		}
 177270 		zSql = (*SessionBuffer)(unsafe.Pointer(bp + 8)).FaBuf
 177271 		nSql = (*SessionBuffer)(unsafe.Pointer(bp + 8)).FnBuf
 177272 	}
 177273 
 177274 	if *(*int32)(unsafe.Pointer(bp + 24)) == SQLITE_OK {
 177275 		*(*int32)(unsafe.Pointer(bp + 24)) = Xsqlite3_prepare_v2(tls, db, zSql, nSql, ppStmt, uintptr(0))
 177276 	}
 177277 	Xsqlite3_free(tls, zSql)
 177278 	return *(*int32)(unsafe.Pointer(bp + 24))
 177279 }
 177280 
 177281 func sessionSelectBind(tls *libc.TLS, pSelect uintptr, nCol int32, abPK uintptr, pChange uintptr) int32 {
 177282 	bp := tls.Alloc(24)
 177283 	defer tls.Free(24)
 177284 
 177285 	var i int32
 177286 	var rc int32 = SQLITE_OK
 177287 	var a uintptr = (*SessionChange)(unsafe.Pointer(pChange)).FaRecord
 177288 
 177289 	for i = 0; i < nCol && rc == SQLITE_OK; i++ {
 177290 		var eType int32 = int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&a, 1))))
 177291 
 177292 		switch eType {
 177293 		case 0:
 177294 			fallthrough
 177295 		case SQLITE_NULL:
 177296 			break
 177297 
 177298 		case SQLITE_INTEGER:
 177299 			{
 177300 				if *(*U8)(unsafe.Pointer(abPK + uintptr(i))) != 0 {
 177301 					var iVal I64 = sessionGetI64(tls, a)
 177302 					rc = Xsqlite3_bind_int64(tls, pSelect, i+1, iVal)
 177303 				}
 177304 				a += uintptr(8)
 177305 				break
 177306 
 177307 			}
 177308 
 177309 		case SQLITE_FLOAT:
 177310 			{
 177311 				if *(*U8)(unsafe.Pointer(abPK + uintptr(i))) != 0 {
 177312 					*(*I64)(unsafe.Pointer(bp + 8)) = sessionGetI64(tls, a)
 177313 					libc.Xmemcpy(tls, bp, bp+8, uint64(8))
 177314 					rc = Xsqlite3_bind_double(tls, pSelect, i+1, *(*float64)(unsafe.Pointer(bp)))
 177315 				}
 177316 				a += uintptr(8)
 177317 				break
 177318 
 177319 			}
 177320 
 177321 		case SQLITE_TEXT:
 177322 			{
 177323 				a += uintptr(sessionVarintGet(tls, a, bp+16))
 177324 				if *(*U8)(unsafe.Pointer(abPK + uintptr(i))) != 0 {
 177325 					rc = Xsqlite3_bind_text(tls, pSelect, i+1, a, *(*int32)(unsafe.Pointer(bp + 16)), libc.UintptrFromInt32(-1))
 177326 				}
 177327 				a += uintptr(*(*int32)(unsafe.Pointer(bp + 16)))
 177328 				break
 177329 
 177330 			}
 177331 
 177332 		default:
 177333 			{
 177334 				a += uintptr(sessionVarintGet(tls, a, bp+20))
 177335 				if *(*U8)(unsafe.Pointer(abPK + uintptr(i))) != 0 {
 177336 					rc = Xsqlite3_bind_blob(tls, pSelect, i+1, a, *(*int32)(unsafe.Pointer(bp + 20)), libc.UintptrFromInt32(-1))
 177337 				}
 177338 				a += uintptr(*(*int32)(unsafe.Pointer(bp + 20)))
 177339 				break
 177340 
 177341 			}
 177342 		}
 177343 	}
 177344 
 177345 	return rc
 177346 }
 177347 
 177348 func sessionAppendTableHdr(tls *libc.TLS, pBuf uintptr, bPatchset int32, pTab uintptr, pRc uintptr) {
 177349 	sessionAppendByte(tls, pBuf, func() uint8 {
 177350 		if bPatchset != 0 {
 177351 			return uint8('P')
 177352 		}
 177353 		return uint8('T')
 177354 	}(), pRc)
 177355 	sessionAppendVarint(tls, pBuf, (*SessionTable)(unsafe.Pointer(pTab)).FnCol, pRc)
 177356 	sessionAppendBlob(tls, pBuf, (*SessionTable)(unsafe.Pointer(pTab)).FabPK, (*SessionTable)(unsafe.Pointer(pTab)).FnCol, pRc)
 177357 	sessionAppendBlob(tls, pBuf, (*SessionTable)(unsafe.Pointer(pTab)).FzName, int32(libc.Xstrlen(tls, (*SessionTable)(unsafe.Pointer(pTab)).FzName))+1, pRc)
 177358 }
 177359 
 177360 func sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) int32 {
 177361 	bp := tls.Alloc(56)
 177362 	defer tls.Free(56)
 177363 
 177364 	var db uintptr = (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb
 177365 	var pTab uintptr
 177366 	*(*SessionBuffer)(unsafe.Pointer(bp + 24)) = SessionBuffer{}
 177367 
 177368 	if xOutput == uintptr(0) {
 177369 		*(*int32)(unsafe.Pointer(pnChangeset)) = 0
 177370 		*(*uintptr)(unsafe.Pointer(ppChangeset)) = uintptr(0)
 177371 	}
 177372 
 177373 	if (*Sqlite3_session)(unsafe.Pointer(pSession)).Frc != 0 {
 177374 		return (*Sqlite3_session)(unsafe.Pointer(pSession)).Frc
 177375 	}
 177376 	*(*int32)(unsafe.Pointer(bp + 40)) = Xsqlite3_exec(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb, ts+34298, uintptr(0), uintptr(0), uintptr(0))
 177377 	if *(*int32)(unsafe.Pointer(bp + 40)) != SQLITE_OK {
 177378 		return *(*int32)(unsafe.Pointer(bp + 40))
 177379 	}
 177380 
 177381 	Xsqlite3_mutex_enter(tls, Xsqlite3_db_mutex(tls, db))
 177382 
 177383 	for pTab = (*Sqlite3_session)(unsafe.Pointer(pSession)).FpTable; *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK && pTab != 0; pTab = (*SessionTable)(unsafe.Pointer(pTab)).FpNext {
 177384 		if (*SessionTable)(unsafe.Pointer(pTab)).FnEntry != 0 {
 177385 			var zName uintptr = (*SessionTable)(unsafe.Pointer(pTab)).FzName
 177386 			*(*int32)(unsafe.Pointer(bp)) = 0
 177387 			*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
 177388 			*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 177389 			var i int32
 177390 			*(*uintptr)(unsafe.Pointer(bp + 48)) = uintptr(0)
 177391 			var nRewind int32 = (*SessionBuffer)(unsafe.Pointer(bp + 24)).FnBuf
 177392 			var nNoop int32
 177393 
 177394 			*(*int32)(unsafe.Pointer(bp + 40)) = sessionTableInfo(tls, uintptr(0), db, (*Sqlite3_session)(unsafe.Pointer(pSession)).FzDb, zName, bp, uintptr(0), bp+8, bp+16)
 177395 			if !(*(*int32)(unsafe.Pointer(bp + 40)) != 0) && ((*SessionTable)(unsafe.Pointer(pTab)).FnCol != *(*int32)(unsafe.Pointer(bp)) || libc.Xmemcmp(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), (*SessionTable)(unsafe.Pointer(pTab)).FabPK, uint64(*(*int32)(unsafe.Pointer(bp)))) != 0) {
 177396 				*(*int32)(unsafe.Pointer(bp + 40)) = SQLITE_SCHEMA
 177397 			}
 177398 
 177399 			sessionAppendTableHdr(tls, bp+24, bPatchset, pTab, bp+40)
 177400 
 177401 			if *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK {
 177402 				*(*int32)(unsafe.Pointer(bp + 40)) = sessionSelectStmt(tls,
 177403 					db, (*Sqlite3_session)(unsafe.Pointer(pSession)).FzDb, zName, *(*int32)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 16)), bp+48)
 177404 			}
 177405 
 177406 			nNoop = (*SessionBuffer)(unsafe.Pointer(bp + 24)).FnBuf
 177407 			for i = 0; i < (*SessionTable)(unsafe.Pointer(pTab)).FnChange && *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK; i++ {
 177408 				var p uintptr
 177409 
 177410 				for p = *(*uintptr)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(i)*8)); *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK && p != 0; p = (*SessionChange)(unsafe.Pointer(p)).FpNext {
 177411 					*(*int32)(unsafe.Pointer(bp + 40)) = sessionSelectBind(tls, *(*uintptr)(unsafe.Pointer(bp + 48)), *(*int32)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 16)), p)
 177412 					if *(*int32)(unsafe.Pointer(bp + 40)) != SQLITE_OK {
 177413 						continue
 177414 					}
 177415 					if Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 48))) == SQLITE_ROW {
 177416 						if int32((*SessionChange)(unsafe.Pointer(p)).Fop) == SQLITE_INSERT {
 177417 							var iCol int32
 177418 							sessionAppendByte(tls, bp+24, uint8(SQLITE_INSERT), bp+40)
 177419 							sessionAppendByte(tls, bp+24, (*SessionChange)(unsafe.Pointer(p)).FbIndirect, bp+40)
 177420 							for iCol = 0; iCol < *(*int32)(unsafe.Pointer(bp)); iCol++ {
 177421 								sessionAppendCol(tls, bp+24, *(*uintptr)(unsafe.Pointer(bp + 48)), iCol, bp+40)
 177422 							}
 177423 						} else {
 177424 							*(*int32)(unsafe.Pointer(bp + 40)) = sessionAppendUpdate(tls, bp+24, bPatchset, *(*uintptr)(unsafe.Pointer(bp + 48)), p, *(*uintptr)(unsafe.Pointer(bp + 16)))
 177425 						}
 177426 					} else if int32((*SessionChange)(unsafe.Pointer(p)).Fop) != SQLITE_INSERT {
 177427 						*(*int32)(unsafe.Pointer(bp + 40)) = sessionAppendDelete(tls, bp+24, bPatchset, p, *(*int32)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 16)))
 177428 					}
 177429 					if *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK {
 177430 						*(*int32)(unsafe.Pointer(bp + 40)) = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 48)))
 177431 					}
 177432 
 177433 					if xOutput != 0 &&
 177434 						*(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK &&
 177435 						(*SessionBuffer)(unsafe.Pointer(bp+24)).FnBuf > nNoop &&
 177436 						(*SessionBuffer)(unsafe.Pointer(bp+24)).FnBuf > sessions_strm_chunk_size {
 177437 						*(*int32)(unsafe.Pointer(bp + 40)) = (*struct {
 177438 							f func(*libc.TLS, uintptr, uintptr, int32) int32
 177439 						})(unsafe.Pointer(&struct{ uintptr }{xOutput})).f(tls, pOut, (*SessionBuffer)(unsafe.Pointer(bp+24)).FaBuf, (*SessionBuffer)(unsafe.Pointer(bp+24)).FnBuf)
 177440 						nNoop = -1
 177441 						(*SessionBuffer)(unsafe.Pointer(bp + 24)).FnBuf = 0
 177442 					}
 177443 
 177444 				}
 177445 			}
 177446 
 177447 			Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 48)))
 177448 			if (*SessionBuffer)(unsafe.Pointer(bp+24)).FnBuf == nNoop {
 177449 				(*SessionBuffer)(unsafe.Pointer(bp + 24)).FnBuf = nRewind
 177450 			}
 177451 			Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
 177452 		}
 177453 	}
 177454 
 177455 	if *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK {
 177456 		if xOutput == uintptr(0) {
 177457 			*(*int32)(unsafe.Pointer(pnChangeset)) = (*SessionBuffer)(unsafe.Pointer(bp + 24)).FnBuf
 177458 			*(*uintptr)(unsafe.Pointer(ppChangeset)) = (*SessionBuffer)(unsafe.Pointer(bp + 24)).FaBuf
 177459 			(*SessionBuffer)(unsafe.Pointer(bp + 24)).FaBuf = uintptr(0)
 177460 		} else if (*SessionBuffer)(unsafe.Pointer(bp+24)).FnBuf > 0 {
 177461 			*(*int32)(unsafe.Pointer(bp + 40)) = (*struct {
 177462 				f func(*libc.TLS, uintptr, uintptr, int32) int32
 177463 			})(unsafe.Pointer(&struct{ uintptr }{xOutput})).f(tls, pOut, (*SessionBuffer)(unsafe.Pointer(bp+24)).FaBuf, (*SessionBuffer)(unsafe.Pointer(bp+24)).FnBuf)
 177464 		}
 177465 	}
 177466 
 177467 	Xsqlite3_free(tls, (*SessionBuffer)(unsafe.Pointer(bp+24)).FaBuf)
 177468 	Xsqlite3_exec(tls, db, ts+34318, uintptr(0), uintptr(0), uintptr(0))
 177469 	Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db))
 177470 	return *(*int32)(unsafe.Pointer(bp + 40))
 177471 }
 177472 
 177473 // Obtain a changeset object containing all changes recorded by the
 177474 // session object passed as the first argument.
 177475 //
 177476 // It is the responsibility of the caller to eventually free the buffer
 177477 // using sqlite3_free().
 177478 func Xsqlite3session_changeset(tls *libc.TLS, pSession uintptr, pnChangeset uintptr, ppChangeset uintptr) int32 {
 177479 	var rc int32
 177480 
 177481 	if pnChangeset == uintptr(0) || ppChangeset == uintptr(0) {
 177482 		return SQLITE_MISUSE
 177483 	}
 177484 	rc = sessionGenerateChangeset(tls, pSession, 0, uintptr(0), uintptr(0), pnChangeset, ppChangeset)
 177485 
 177486 	return rc
 177487 }
 177488 
 177489 // Streaming version of sqlite3session_changeset().
 177490 func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) int32 {
 177491 	if xOutput == uintptr(0) {
 177492 		return SQLITE_MISUSE
 177493 	}
 177494 	return sessionGenerateChangeset(tls, pSession, 0, xOutput, pOut, uintptr(0), uintptr(0))
 177495 }
 177496 
 177497 // Streaming version of sqlite3session_patchset().
 177498 func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) int32 {
 177499 	if xOutput == uintptr(0) {
 177500 		return SQLITE_MISUSE
 177501 	}
 177502 	return sessionGenerateChangeset(tls, pSession, 1, xOutput, pOut, uintptr(0), uintptr(0))
 177503 }
 177504 
 177505 // Obtain a patchset object containing all changes recorded by the
 177506 // session object passed as the first argument.
 177507 //
 177508 // It is the responsibility of the caller to eventually free the buffer
 177509 // using sqlite3_free().
 177510 func Xsqlite3session_patchset(tls *libc.TLS, pSession uintptr, pnPatchset uintptr, ppPatchset uintptr) int32 {
 177511 	if pnPatchset == uintptr(0) || ppPatchset == uintptr(0) {
 177512 		return SQLITE_MISUSE
 177513 	}
 177514 	return sessionGenerateChangeset(tls, pSession, 1, uintptr(0), uintptr(0), pnPatchset, ppPatchset)
 177515 }
 177516 
 177517 // Enable or disable the session object passed as the first argument.
 177518 func Xsqlite3session_enable(tls *libc.TLS, pSession uintptr, bEnable int32) int32 {
 177519 	var ret int32
 177520 	Xsqlite3_mutex_enter(tls, Xsqlite3_db_mutex(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb))
 177521 	if bEnable >= 0 {
 177522 		(*Sqlite3_session)(unsafe.Pointer(pSession)).FbEnable = bEnable
 177523 	}
 177524 	ret = (*Sqlite3_session)(unsafe.Pointer(pSession)).FbEnable
 177525 	Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb))
 177526 	return ret
 177527 }
 177528 
 177529 // Enable or disable the session object passed as the first argument.
 177530 func Xsqlite3session_indirect(tls *libc.TLS, pSession uintptr, bIndirect int32) int32 {
 177531 	var ret int32
 177532 	Xsqlite3_mutex_enter(tls, Xsqlite3_db_mutex(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb))
 177533 	if bIndirect >= 0 {
 177534 		(*Sqlite3_session)(unsafe.Pointer(pSession)).FbIndirect = bIndirect
 177535 	}
 177536 	ret = (*Sqlite3_session)(unsafe.Pointer(pSession)).FbIndirect
 177537 	Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb))
 177538 	return ret
 177539 }
 177540 
 177541 // Return true if there have been no changes to monitored tables recorded
 177542 // by the session object passed as the only argument.
 177543 func Xsqlite3session_isempty(tls *libc.TLS, pSession uintptr) int32 {
 177544 	var ret int32 = 0
 177545 	var pTab uintptr
 177546 
 177547 	Xsqlite3_mutex_enter(tls, Xsqlite3_db_mutex(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb))
 177548 	for pTab = (*Sqlite3_session)(unsafe.Pointer(pSession)).FpTable; pTab != 0 && ret == 0; pTab = (*SessionTable)(unsafe.Pointer(pTab)).FpNext {
 177549 		ret = libc.Bool32((*SessionTable)(unsafe.Pointer(pTab)).FnEntry > 0)
 177550 	}
 177551 	Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, (*Sqlite3_session)(unsafe.Pointer(pSession)).Fdb))
 177552 
 177553 	return libc.Bool32(ret == 0)
 177554 }
 177555 
 177556 // Return the amount of heap memory in use.
 177557 func Xsqlite3session_memory_used(tls *libc.TLS, pSession uintptr) Sqlite3_int64 {
 177558 	return (*Sqlite3_session)(unsafe.Pointer(pSession)).FnMalloc
 177559 }
 177560 
 177561 // Configure the session object passed as the first argument.
 177562 func Xsqlite3session_object_config(tls *libc.TLS, pSession uintptr, op int32, pArg uintptr) int32 {
 177563 	var rc int32 = SQLITE_OK
 177564 	switch op {
 177565 	case SQLITE_SESSION_OBJCONFIG_SIZE:
 177566 		{
 177567 			var iArg int32 = *(*int32)(unsafe.Pointer(pArg))
 177568 			if iArg >= 0 {
 177569 				if (*Sqlite3_session)(unsafe.Pointer(pSession)).FpTable != 0 {
 177570 					rc = SQLITE_MISUSE
 177571 				} else {
 177572 					(*Sqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize = libc.Bool32(iArg != 0)
 177573 				}
 177574 			}
 177575 			*(*int32)(unsafe.Pointer(pArg)) = (*Sqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize
 177576 			break
 177577 
 177578 		}
 177579 
 177580 	default:
 177581 		rc = SQLITE_MISUSE
 177582 	}
 177583 
 177584 	return rc
 177585 }
 177586 
 177587 // Return the maximum size of sqlite3session_changeset() output.
 177588 func Xsqlite3session_changeset_size(tls *libc.TLS, pSession uintptr) Sqlite3_int64 {
 177589 	return (*Sqlite3_session)(unsafe.Pointer(pSession)).FnMaxChangesetSize
 177590 }
 177591 
 177592 func sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) int32 {
 177593 	var pRet uintptr
 177594 	var nByte int32
 177595 
 177596 	*(*uintptr)(unsafe.Pointer(pp)) = uintptr(0)
 177597 
 177598 	nByte = int32(unsafe.Sizeof(Sqlite3_changeset_iter{}))
 177599 	pRet = Xsqlite3_malloc(tls, nByte)
 177600 	if !(pRet != 0) {
 177601 		return SQLITE_NOMEM
 177602 	}
 177603 	libc.Xmemset(tls, pRet, 0, uint64(unsafe.Sizeof(Sqlite3_changeset_iter{})))
 177604 	(*Sqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FaData = pChangeset
 177605 	(*Sqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FnData = nChangeset
 177606 	(*Sqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = xInput
 177607 	(*Sqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FpIn = pIn
 177608 	(*Sqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FbEof = func() int32 {
 177609 		if xInput != 0 {
 177610 			return 0
 177611 		}
 177612 		return 1
 177613 	}()
 177614 	(*Sqlite3_changeset_iter)(unsafe.Pointer(pRet)).FbInvert = bInvert
 177615 	(*Sqlite3_changeset_iter)(unsafe.Pointer(pRet)).FbSkipEmpty = bSkipEmpty
 177616 
 177617 	*(*uintptr)(unsafe.Pointer(pp)) = pRet
 177618 	return SQLITE_OK
 177619 }
 177620 
 177621 // Create an iterator used to iterate through the contents of a changeset.
 177622 func Xsqlite3changeset_start(tls *libc.TLS, pp uintptr, nChangeset int32, pChangeset uintptr) int32 {
 177623 	return sessionChangesetStart(tls, pp, uintptr(0), uintptr(0), nChangeset, pChangeset, 0, 0)
 177624 }
 177625 
 177626 func Xsqlite3changeset_start_v2(tls *libc.TLS, pp uintptr, nChangeset int32, pChangeset uintptr, flags int32) int32 {
 177627 	var bInvert int32 = libc.BoolInt32(!!(flags&SQLITE_CHANGESETSTART_INVERT != 0))
 177628 	return sessionChangesetStart(tls, pp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInvert, 0)
 177629 }
 177630 
 177631 // Streaming version of sqlite3changeset_start().
 177632 func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr) int32 {
 177633 	return sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), 0, 0)
 177634 }
 177635 
 177636 func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, flags int32) int32 {
 177637 	var bInvert int32 = libc.BoolInt32(!!(flags&SQLITE_CHANGESETSTART_INVERT != 0))
 177638 	return sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), bInvert, 0)
 177639 }
 177640 
 177641 func sessionDiscardData(tls *libc.TLS, pIn uintptr) {
 177642 	if (*SessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*SessionInput)(unsafe.Pointer(pIn)).FiNext >= sessions_strm_chunk_size {
 177643 		var nMove int32 = (*SessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*SessionInput)(unsafe.Pointer(pIn)).FiNext
 177644 
 177645 		if nMove > 0 {
 177646 			libc.Xmemmove(tls, (*SessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*SessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*SessionInput)(unsafe.Pointer(pIn)).FiNext), uint64(nMove))
 177647 		}
 177648 		*(*int32)(unsafe.Pointer(pIn + 32 + 8)) -= (*SessionInput)(unsafe.Pointer(pIn)).FiNext
 177649 		(*SessionInput)(unsafe.Pointer(pIn)).FiNext = 0
 177650 		(*SessionInput)(unsafe.Pointer(pIn)).FnData = (*SessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf
 177651 	}
 177652 }
 177653 
 177654 func sessionInputBuffer(tls *libc.TLS, pIn uintptr, nByte int32) int32 {
 177655 	bp := tls.Alloc(8)
 177656 	defer tls.Free(8)
 177657 
 177658 	*(*int32)(unsafe.Pointer(bp)) = SQLITE_OK
 177659 	if (*SessionInput)(unsafe.Pointer(pIn)).FxInput != 0 {
 177660 		for !((*SessionInput)(unsafe.Pointer(pIn)).FbEof != 0) && (*SessionInput)(unsafe.Pointer(pIn)).FiNext+nByte >= (*SessionInput)(unsafe.Pointer(pIn)).FnData && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
 177661 			*(*int32)(unsafe.Pointer(bp + 4)) = sessions_strm_chunk_size
 177662 
 177663 			if (*SessionInput)(unsafe.Pointer(pIn)).FbNoDiscard == 0 {
 177664 				sessionDiscardData(tls, pIn)
 177665 			}
 177666 			if SQLITE_OK == sessionBufferGrow(tls, pIn+32, int64(*(*int32)(unsafe.Pointer(bp + 4))), bp) {
 177667 				*(*int32)(unsafe.Pointer(bp)) = (*struct {
 177668 					f func(*libc.TLS, uintptr, uintptr, uintptr) int32
 177669 				})(unsafe.Pointer(&struct{ uintptr }{(*SessionInput)(unsafe.Pointer(pIn)).FxInput})).f(tls, (*SessionInput)(unsafe.Pointer(pIn)).FpIn, (*SessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*SessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf), bp+4)
 177670 				if *(*int32)(unsafe.Pointer(bp + 4)) == 0 {
 177671 					(*SessionInput)(unsafe.Pointer(pIn)).FbEof = 1
 177672 				} else {
 177673 					*(*int32)(unsafe.Pointer(pIn + 32 + 8)) += *(*int32)(unsafe.Pointer(bp + 4))
 177674 				}
 177675 			}
 177676 
 177677 			(*SessionInput)(unsafe.Pointer(pIn)).FaData = (*SessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf
 177678 			(*SessionInput)(unsafe.Pointer(pIn)).FnData = (*SessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf
 177679 		}
 177680 	}
 177681 	return *(*int32)(unsafe.Pointer(bp))
 177682 }
 177683 
 177684 func sessionSkipRecord(tls *libc.TLS, ppRec uintptr, nCol int32) {
 177685 	bp := tls.Alloc(4)
 177686 	defer tls.Free(4)
 177687 
 177688 	var aRec uintptr = *(*uintptr)(unsafe.Pointer(ppRec))
 177689 	var i int32
 177690 	for i = 0; i < nCol; i++ {
 177691 		var eType int32 = int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&aRec, 1))))
 177692 		if eType == SQLITE_TEXT || eType == SQLITE_BLOB {
 177693 			aRec += uintptr(sessionVarintGet(tls, aRec, bp))
 177694 			aRec += uintptr(*(*int32)(unsafe.Pointer(bp)))
 177695 		} else if eType == SQLITE_INTEGER || eType == SQLITE_FLOAT {
 177696 			aRec += uintptr(8)
 177697 		}
 177698 	}
 177699 
 177700 	*(*uintptr)(unsafe.Pointer(ppRec)) = aRec
 177701 }
 177702 
 177703 func sessionValueSetStr(tls *libc.TLS, pVal uintptr, aData uintptr, nData int32, enc U8) int32 {
 177704 	var aCopy uintptr = Xsqlite3_malloc64(tls, uint64(Sqlite3_int64(nData)+int64(1)))
 177705 	if aCopy == uintptr(0) {
 177706 		return SQLITE_NOMEM
 177707 	}
 177708 	libc.Xmemcpy(tls, aCopy, aData, uint64(nData))
 177709 	Xsqlite3ValueSetStr(tls, pVal, nData, aCopy, enc, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
 177710 	return SQLITE_OK
 177711 }
 177712 
 177713 func sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, apOut uintptr, pbEmpty uintptr) int32 {
 177714 	bp := tls.Alloc(24)
 177715 	defer tls.Free(24)
 177716 
 177717 	var i int32
 177718 	var rc int32 = SQLITE_OK
 177719 
 177720 	if pbEmpty != 0 {
 177721 		*(*int32)(unsafe.Pointer(pbEmpty)) = 1
 177722 	}
 177723 	for i = 0; i < nCol && rc == SQLITE_OK; i++ {
 177724 		var eType int32 = 0
 177725 		if abPK != 0 && int32(*(*U8)(unsafe.Pointer(abPK + uintptr(i)))) == 0 {
 177726 			continue
 177727 		}
 177728 		rc = sessionInputBuffer(tls, pIn, 9)
 177729 		if rc == SQLITE_OK {
 177730 			if (*SessionInput)(unsafe.Pointer(pIn)).FiNext >= (*SessionInput)(unsafe.Pointer(pIn)).FnData {
 177731 				rc = Xsqlite3CorruptError(tls, 219169)
 177732 			} else {
 177733 				eType = int32(*(*U8)(unsafe.Pointer((*SessionInput)(unsafe.Pointer(pIn)).FaData + uintptr(libc.PostIncInt32(&(*SessionInput)(unsafe.Pointer(pIn)).FiNext, 1)))))
 177734 
 177735 				if eType != 0 {
 177736 					if pbEmpty != 0 {
 177737 						*(*int32)(unsafe.Pointer(pbEmpty)) = 0
 177738 					}
 177739 					*(*uintptr)(unsafe.Pointer(apOut + uintptr(i)*8)) = Xsqlite3ValueNew(tls, uintptr(0))
 177740 					if !(int32(*(*uintptr)(unsafe.Pointer(apOut + uintptr(i)*8))) != 0) {
 177741 						rc = SQLITE_NOMEM
 177742 					}
 177743 				}
 177744 			}
 177745 		}
 177746 
 177747 		if rc == SQLITE_OK {
 177748 			var aVal uintptr = (*SessionInput)(unsafe.Pointer(pIn)).FaData + uintptr((*SessionInput)(unsafe.Pointer(pIn)).FiNext)
 177749 			if eType == SQLITE_TEXT || eType == SQLITE_BLOB {
 177750 				*(*int32)(unsafe.Pointer(pIn + 8)) += sessionVarintGet(tls, aVal, bp)
 177751 				rc = sessionInputBuffer(tls, pIn, *(*int32)(unsafe.Pointer(bp)))
 177752 				if rc == SQLITE_OK {
 177753 					if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > (*SessionInput)(unsafe.Pointer(pIn)).FnData-(*SessionInput)(unsafe.Pointer(pIn)).FiNext {
 177754 						rc = Xsqlite3CorruptError(tls, 219189)
 177755 					} else {
 177756 						var enc U8 = func() uint8 {
 177757 							if eType == SQLITE_TEXT {
 177758 								return uint8(SQLITE_UTF8)
 177759 							}
 177760 							return uint8(0)
 177761 						}()
 177762 						rc = sessionValueSetStr(tls, *(*uintptr)(unsafe.Pointer(apOut + uintptr(i)*8)), (*SessionInput)(unsafe.Pointer(pIn)).FaData+uintptr((*SessionInput)(unsafe.Pointer(pIn)).FiNext), *(*int32)(unsafe.Pointer(bp)), enc)
 177763 						*(*int32)(unsafe.Pointer(pIn + 8)) += *(*int32)(unsafe.Pointer(bp))
 177764 					}
 177765 				}
 177766 			}
 177767 			if eType == SQLITE_INTEGER || eType == SQLITE_FLOAT {
 177768 				*(*Sqlite3_int64)(unsafe.Pointer(bp + 16)) = sessionGetI64(tls, aVal)
 177769 				if eType == SQLITE_INTEGER {
 177770 					Xsqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(apOut + uintptr(i)*8)), *(*Sqlite3_int64)(unsafe.Pointer(bp + 16)))
 177771 				} else {
 177772 					libc.Xmemcpy(tls, bp+8, bp+16, uint64(8))
 177773 					Xsqlite3VdbeMemSetDouble(tls, *(*uintptr)(unsafe.Pointer(apOut + uintptr(i)*8)), *(*float64)(unsafe.Pointer(bp + 8)))
 177774 				}
 177775 				*(*int32)(unsafe.Pointer(pIn + 8)) += 8
 177776 			}
 177777 		}
 177778 	}
 177779 
 177780 	return rc
 177781 }
 177782 
 177783 func sessionChangesetBufferTblhdr(tls *libc.TLS, pIn uintptr, pnByte uintptr) int32 {
 177784 	bp := tls.Alloc(4)
 177785 	defer tls.Free(4)
 177786 
 177787 	var rc int32 = SQLITE_OK
 177788 	*(*int32)(unsafe.Pointer(bp)) = 0
 177789 	var nRead int32 = 0
 177790 
 177791 	rc = sessionInputBuffer(tls, pIn, 9)
 177792 	if rc == SQLITE_OK {
 177793 		nRead = nRead + sessionVarintGet(tls, (*SessionInput)(unsafe.Pointer(pIn)).FaData+uintptr((*SessionInput)(unsafe.Pointer(pIn)).FiNext+nRead), bp)
 177794 
 177795 		if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > 65536 {
 177796 			rc = Xsqlite3CorruptError(tls, 219243)
 177797 		} else {
 177798 			rc = sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+100)
 177799 			nRead = nRead + *(*int32)(unsafe.Pointer(bp))
 177800 		}
 177801 	}
 177802 
 177803 	for rc == SQLITE_OK {
 177804 		for (*SessionInput)(unsafe.Pointer(pIn)).FiNext+nRead < (*SessionInput)(unsafe.Pointer(pIn)).FnData && *(*U8)(unsafe.Pointer((*SessionInput)(unsafe.Pointer(pIn)).FaData + uintptr((*SessionInput)(unsafe.Pointer(pIn)).FiNext+nRead))) != 0 {
 177805 			nRead++
 177806 		}
 177807 		if (*SessionInput)(unsafe.Pointer(pIn)).FiNext+nRead < (*SessionInput)(unsafe.Pointer(pIn)).FnData {
 177808 			break
 177809 		}
 177810 		rc = sessionInputBuffer(tls, pIn, nRead+100)
 177811 	}
 177812 	*(*int32)(unsafe.Pointer(pnByte)) = nRead + 1
 177813 	return rc
 177814 }
 177815 
 177816 func sessionChangesetBufferRecord(tls *libc.TLS, pIn uintptr, nCol int32, pnByte uintptr) int32 {
 177817 	bp := tls.Alloc(4)
 177818 	defer tls.Free(4)
 177819 
 177820 	var rc int32 = SQLITE_OK
 177821 	var nByte int32 = 0
 177822 	var i int32
 177823 	for i = 0; rc == SQLITE_OK && i < nCol; i++ {
 177824 		var eType int32
 177825 		rc = sessionInputBuffer(tls, pIn, nByte+10)
 177826 		if rc == SQLITE_OK {
 177827 			eType = int32(*(*U8)(unsafe.Pointer((*SessionInput)(unsafe.Pointer(pIn)).FaData + uintptr((*SessionInput)(unsafe.Pointer(pIn)).FiNext+libc.PostIncInt32(&nByte, 1)))))
 177828 			if eType == SQLITE_TEXT || eType == SQLITE_BLOB {
 177829 				nByte = nByte + sessionVarintGet(tls, (*SessionInput)(unsafe.Pointer(pIn)).FaData+uintptr((*SessionInput)(unsafe.Pointer(pIn)).FiNext+nByte), bp)
 177830 				nByte = nByte + *(*int32)(unsafe.Pointer(bp))
 177831 				rc = sessionInputBuffer(tls, pIn, nByte)
 177832 			} else if eType == SQLITE_INTEGER || eType == SQLITE_FLOAT {
 177833 				nByte = nByte + 8
 177834 			}
 177835 		}
 177836 	}
 177837 	*(*int32)(unsafe.Pointer(pnByte)) = nByte
 177838 	return rc
 177839 }
 177840 
 177841 func sessionChangesetReadTblhdr(tls *libc.TLS, p uintptr) int32 {
 177842 	bp := tls.Alloc(8)
 177843 	defer tls.Free(8)
 177844 
 177845 	*(*int32)(unsafe.Pointer(bp + 4)) = sessionChangesetBufferTblhdr(tls, p, bp)
 177846 	if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK {
 177847 		var nByte int32
 177848 		var nVarint int32
 177849 		nVarint = sessionVarintGet(tls, (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData+uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext), p+120)
 177850 		if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol > 0 {
 177851 			*(*int32)(unsafe.Pointer(bp)) -= nVarint
 177852 			*(*int32)(unsafe.Pointer(p + 8)) += nVarint
 177853 			nByte = int32(uint64((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*uint64(unsafe.Sizeof(uintptr(0)))*uint64(2) + uint64(*(*int32)(unsafe.Pointer(bp))))
 177854 			(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FnBuf = 0
 177855 			sessionBufferGrow(tls, p+72, int64(nByte), bp+4)
 177856 		} else {
 177857 			*(*int32)(unsafe.Pointer(bp + 4)) = Xsqlite3CorruptError(tls, 219331)
 177858 		}
 177859 	}
 177860 
 177861 	if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK {
 177862 		var iPK Size_t = uint64(unsafe.Sizeof(uintptr(0))) * uint64((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol) * uint64(2)
 177863 		libc.Xmemset(tls, (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FaBuf, 0, iPK)
 177864 		libc.Xmemcpy(tls, (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FaBuf+uintptr(iPK), (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData+uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext), uint64(*(*int32)(unsafe.Pointer(bp))))
 177865 		*(*int32)(unsafe.Pointer(p + 8)) += *(*int32)(unsafe.Pointer(bp))
 177866 	}
 177867 
 177868 	(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue = (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FaBuf
 177869 	if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue == uintptr(0) {
 177870 		(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK = uintptr(0)
 177871 		(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FzTab = uintptr(0)
 177872 	} else {
 177873 		(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK = (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol*2)*8
 177874 		(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FzTab = func() uintptr {
 177875 			if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK != 0 {
 177876 				return (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)
 177877 			}
 177878 			return uintptr(0)
 177879 		}()
 177880 	}
 177881 	return libc.AssignPtrInt32(p+100, *(*int32)(unsafe.Pointer(bp + 4)))
 177882 }
 177883 
 177884 func sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uintptr, pbNew uintptr, pbEmpty uintptr) int32 {
 177885 	var i int32
 177886 	var op U8
 177887 
 177888 	if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK {
 177889 		return (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc
 177890 	}
 177891 
 177892 	if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue != 0 {
 177893 		for i = 0; i < (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol*2; i++ {
 177894 			Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)))
 177895 		}
 177896 		libc.Xmemset(tls, (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue, 0, uint64(unsafe.Sizeof(uintptr(0)))*uint64((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*uint64(2))
 177897 	}
 177898 
 177899 	(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = sessionInputBuffer(tls, p, 2)
 177900 	if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK {
 177901 		return (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc
 177902 	}
 177903 
 177904 	if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext >= (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FnData {
 177905 		return SQLITE_DONE
 177906 	}
 177907 
 177908 	sessionDiscardData(tls, p)
 177909 	(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiCurrent = (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext
 177910 
 177911 	op = *(*U8)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(libc.PostIncInt32(&(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext, 1))))
 177912 	for int32(op) == 'T' || int32(op) == 'P' {
 177913 		if pbNew != 0 {
 177914 			*(*int32)(unsafe.Pointer(pbNew)) = 1
 177915 		}
 177916 		(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset = libc.Bool32(int32(op) == 'P')
 177917 		if sessionChangesetReadTblhdr(tls, p) != 0 {
 177918 			return (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc
 177919 		}
 177920 		if libc.AssignPtrInt32(p+100, sessionInputBuffer(tls, p, 2)) != 0 {
 177921 			return (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc
 177922 		}
 177923 		(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiCurrent = (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext
 177924 		if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext >= (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FnData {
 177925 			return SQLITE_DONE
 177926 		}
 177927 		op = *(*U8)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(libc.PostIncInt32(&(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext, 1))))
 177928 	}
 177929 
 177930 	if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FzTab == uintptr(0) || (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 {
 177931 		return libc.AssignPtrInt32(p+100, Xsqlite3CorruptError(tls, 219417))
 177932 	}
 177933 
 177934 	(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop = int32(op)
 177935 	(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbIndirect = int32(*(*U8)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(libc.PostIncInt32(&(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext, 1)))))
 177936 	if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != SQLITE_UPDATE && (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != SQLITE_DELETE && (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != SQLITE_INSERT {
 177937 		return libc.AssignPtrInt32(p+100, Xsqlite3CorruptError(tls, 219423))
 177938 	}
 177939 
 177940 	if paRec != 0 {
 177941 		var nVal int32
 177942 		if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset == 0 && int32(op) == SQLITE_UPDATE {
 177943 			nVal = (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol * 2
 177944 		} else if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && int32(op) == SQLITE_DELETE {
 177945 			nVal = 0
 177946 			for i = 0; i < (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol; i++ {
 177947 				if *(*U8)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 {
 177948 					nVal++
 177949 				}
 177950 			}
 177951 		} else {
 177952 			nVal = (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol
 177953 		}
 177954 		(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = sessionChangesetBufferRecord(tls, p, nVal, pnRec)
 177955 		if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK {
 177956 			return (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc
 177957 		}
 177958 		*(*uintptr)(unsafe.Pointer(paRec)) = (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext)
 177959 		*(*int32)(unsafe.Pointer(p + 8)) += *(*int32)(unsafe.Pointer(pnRec))
 177960 	} else {
 177961 		var apOld uintptr = func() uintptr {
 177962 			if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 {
 177963 				return (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*8
 177964 			}
 177965 			return (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue
 177966 		}()
 177967 		var apNew uintptr = func() uintptr {
 177968 			if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 {
 177969 				return (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue
 177970 			}
 177971 			return (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*8
 177972 		}()
 177973 
 177974 		if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != SQLITE_INSERT && ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset == 0 || (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop == SQLITE_DELETE) {
 177975 			var abPK uintptr
 177976 			if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 {
 177977 				abPK = (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK
 177978 			} else {
 177979 				abPK = uintptr(0)
 177980 			}
 177981 			(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = sessionReadRecord(tls, p, (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol, abPK, apOld, uintptr(0))
 177982 			if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK {
 177983 				return (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc
 177984 			}
 177985 		}
 177986 
 177987 		if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != SQLITE_DELETE {
 177988 			(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = sessionReadRecord(tls, p, (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol, uintptr(0), apNew, pbEmpty)
 177989 			if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK {
 177990 				return (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc
 177991 			}
 177992 		}
 177993 
 177994 		if ((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 || (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0) && (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop == SQLITE_UPDATE {
 177995 			for i = 0; i < (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol; i++ {
 177996 				if *(*U8)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 {
 177997 					*(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i+(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*8))
 177998 					if *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) == uintptr(0) {
 177999 						return libc.AssignPtrInt32(p+100, Xsqlite3CorruptError(tls, 219467))
 178000 					}
 178001 					*(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i+(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*8)) = uintptr(0)
 178002 				}
 178003 			}
 178004 		} else if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 {
 178005 			if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop == SQLITE_INSERT {
 178006 				(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop = SQLITE_DELETE
 178007 			} else if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop == SQLITE_DELETE {
 178008 				(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop = SQLITE_INSERT
 178009 			}
 178010 		}
 178011 
 178012 		if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset == 0 && (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fop == SQLITE_UPDATE {
 178013 			for i = 0; i < (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol; i++ {
 178014 				if int32(*(*U8)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr(i)))) == 0 && *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i+(*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*8)) == uintptr(0) {
 178015 					Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)))
 178016 					*(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) = uintptr(0)
 178017 				}
 178018 			}
 178019 		}
 178020 	}
 178021 
 178022 	return SQLITE_ROW
 178023 }
 178024 
 178025 func sessionChangesetNext(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uintptr, pbNew uintptr) int32 {
 178026 	bp := tls.Alloc(4)
 178027 	defer tls.Free(4)
 178028 
 178029 	var rc int32
 178030 	for __ccgo := true; __ccgo; __ccgo = rc == SQLITE_ROW && (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FbSkipEmpty != 0 && *(*int32)(unsafe.Pointer(bp)) != 0 {
 178031 		*(*int32)(unsafe.Pointer(bp)) = 0
 178032 		rc = sessionChangesetNextOne(tls, p, paRec, pnRec, pbNew, bp)
 178033 	}
 178034 	return rc
 178035 }
 178036 
 178037 // Advance an iterator created by sqlite3changeset_start() to the next
 178038 // change in the changeset. This function may return SQLITE_ROW, SQLITE_DONE
 178039 // or SQLITE_CORRUPT.
 178040 //
 178041 // This function may not be called on iterators passed to a conflict handler
 178042 // callback by changeset_apply().
 178043 func Xsqlite3changeset_next(tls *libc.TLS, p uintptr) int32 {
 178044 	return sessionChangesetNext(tls, p, uintptr(0), uintptr(0), uintptr(0))
 178045 }
 178046 
 178047 // The following function extracts information on the current change
 178048 // from a changeset iterator. It may only be called after changeset_next()
 178049 // has returned SQLITE_ROW.
 178050 func Xsqlite3changeset_op(tls *libc.TLS, pIter uintptr, pzTab uintptr, pnCol uintptr, pOp uintptr, pbIndirect uintptr) int32 {
 178051 	*(*int32)(unsafe.Pointer(pOp)) = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fop
 178052 	*(*int32)(unsafe.Pointer(pnCol)) = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol
 178053 	*(*uintptr)(unsafe.Pointer(pzTab)) = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab
 178054 	if pbIndirect != 0 {
 178055 		*(*int32)(unsafe.Pointer(pbIndirect)) = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect
 178056 	}
 178057 	return SQLITE_OK
 178058 }
 178059 
 178060 // Return information regarding the PRIMARY KEY and number of columns in
 178061 // the database table affected by the change that pIter currently points
 178062 // to. This function may only be called after changeset_next() returns
 178063 // SQLITE_ROW.
 178064 func Xsqlite3changeset_pk(tls *libc.TLS, pIter uintptr, pabPK uintptr, pnCol uintptr) int32 {
 178065 	*(*uintptr)(unsafe.Pointer(pabPK)) = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FabPK
 178066 	if pnCol != 0 {
 178067 		*(*int32)(unsafe.Pointer(pnCol)) = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol
 178068 	}
 178069 	return SQLITE_OK
 178070 }
 178071 
 178072 // This function may only be called while the iterator is pointing to an
 178073 // SQLITE_UPDATE or SQLITE_DELETE change (see sqlite3changeset_op()).
 178074 // Otherwise, SQLITE_MISUSE is returned.
 178075 //
 178076 // It sets *ppValue to point to an sqlite3_value structure containing the
 178077 // iVal'th value in the old.* record. Or, if that particular value is not
 178078 // included in the record (because the change is an UPDATE and the field
 178079 // was not modified and is not a PK column), set *ppValue to NULL.
 178080 //
 178081 // If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
 178082 // not modified. Otherwise, SQLITE_OK.
 178083 func Xsqlite3changeset_old(tls *libc.TLS, pIter uintptr, iVal int32, ppValue uintptr) int32 {
 178084 	if (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fop != SQLITE_UPDATE && (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fop != SQLITE_DELETE {
 178085 		return SQLITE_MISUSE
 178086 	}
 178087 	if iVal < 0 || iVal >= (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol {
 178088 		return SQLITE_RANGE
 178089 	}
 178090 	*(*uintptr)(unsafe.Pointer(ppValue)) = *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr(iVal)*8))
 178091 	return SQLITE_OK
 178092 }
 178093 
 178094 // This function may only be called while the iterator is pointing to an
 178095 // SQLITE_UPDATE or SQLITE_INSERT change (see sqlite3changeset_op()).
 178096 // Otherwise, SQLITE_MISUSE is returned.
 178097 //
 178098 // It sets *ppValue to point to an sqlite3_value structure containing the
 178099 // iVal'th value in the new.* record. Or, if that particular value is not
 178100 // included in the record (because the change is an UPDATE and the field
 178101 // was not modified), set *ppValue to NULL.
 178102 //
 178103 // If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is
 178104 // not modified. Otherwise, SQLITE_OK.
 178105 func Xsqlite3changeset_new(tls *libc.TLS, pIter uintptr, iVal int32, ppValue uintptr) int32 {
 178106 	if (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fop != SQLITE_UPDATE && (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fop != SQLITE_INSERT {
 178107 		return SQLITE_MISUSE
 178108 	}
 178109 	if iVal < 0 || iVal >= (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol {
 178110 		return SQLITE_RANGE
 178111 	}
 178112 	*(*uintptr)(unsafe.Pointer(ppValue)) = *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+iVal)*8))
 178113 	return SQLITE_OK
 178114 }
 178115 
 178116 // This function may only be called with a changeset iterator that has been
 178117 // passed to an SQLITE_CHANGESET_DATA or SQLITE_CHANGESET_CONFLICT
 178118 // conflict-handler function. Otherwise, SQLITE_MISUSE is returned.
 178119 //
 178120 // If successful, *ppValue is set to point to an sqlite3_value structure
 178121 // containing the iVal'th value of the conflicting record.
 178122 //
 178123 // If value iVal is out-of-range or some other error occurs, an SQLite error
 178124 // code is returned. Otherwise, SQLITE_OK.
 178125 func Xsqlite3changeset_conflict(tls *libc.TLS, pIter uintptr, iVal int32, ppValue uintptr) int32 {
 178126 	if !(int32((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict) != 0) {
 178127 		return SQLITE_MISUSE
 178128 	}
 178129 	if iVal < 0 || iVal >= (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol {
 178130 		return SQLITE_RANGE
 178131 	}
 178132 	*(*uintptr)(unsafe.Pointer(ppValue)) = Xsqlite3_column_value(tls, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict, iVal)
 178133 	return SQLITE_OK
 178134 }
 178135 
 178136 // This function may only be called with an iterator passed to an
 178137 // SQLITE_CHANGESET_FOREIGN_KEY conflict handler callback. In this case
 178138 // it sets the output variable to the total number of known foreign key
 178139 // violations in the destination database and returns SQLITE_OK.
 178140 //
 178141 // In all other cases this function returns SQLITE_MISUSE.
 178142 func Xsqlite3changeset_fk_conflicts(tls *libc.TLS, pIter uintptr, pnOut uintptr) int32 {
 178143 	if (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict != 0 || (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue != 0 {
 178144 		return SQLITE_MISUSE
 178145 	}
 178146 	*(*int32)(unsafe.Pointer(pnOut)) = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol
 178147 	return SQLITE_OK
 178148 }
 178149 
 178150 // Finalize an iterator allocated with sqlite3changeset_start().
 178151 //
 178152 // This function may not be called on iterators passed to a conflict handler
 178153 // callback by changeset_apply().
 178154 func Xsqlite3changeset_finalize(tls *libc.TLS, p uintptr) int32 {
 178155 	var rc int32 = SQLITE_OK
 178156 	if p != 0 {
 178157 		var i int32
 178158 		rc = (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Frc
 178159 		if (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue != 0 {
 178160 			for i = 0; i < (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol*2; i++ {
 178161 				Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)))
 178162 			}
 178163 		}
 178164 		Xsqlite3_free(tls, (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FaBuf)
 178165 		Xsqlite3_free(tls, (*Sqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.Fbuf.FaBuf)
 178166 		Xsqlite3_free(tls, p)
 178167 	}
 178168 	return rc
 178169 }
 178170 
 178171 func sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) int32 {
 178172 	bp := tls.Alloc(48)
 178173 	defer tls.Free(48)
 178174 
 178175 	var abPK uintptr
 178176 	var apVal uintptr
 178177 
 178178 	var nVar int32
 178179 
 178180 	var bIndirect int32
 178181 	var eType2 int32
 178182 	var pVal uintptr
 178183 	var pVal1 uintptr
 178184 	var iCol int32
 178185 	var eType U8
 178186 	*(*int32)(unsafe.Pointer(bp + 40)) = SQLITE_OK
 178187 	*(*int32)(unsafe.Pointer(bp + 20)) = 0
 178188 	abPK = uintptr(0)
 178189 	apVal = uintptr(0)
 178190 	*(*SessionBuffer)(unsafe.Pointer(bp + 24)) = SessionBuffer{}
 178191 
 178192 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(SessionBuffer{})))
 178193 
 178194 	if !(ppInverted != 0) {
 178195 		goto __1
 178196 	}
 178197 	*(*uintptr)(unsafe.Pointer(ppInverted)) = uintptr(0)
 178198 	*(*int32)(unsafe.Pointer(pnInverted)) = 0
 178199 __1:
 178200 	;
 178201 __2:
 178202 	if !(1 != 0) {
 178203 		goto __3
 178204 	}
 178205 
 178206 	if !(libc.AssignPtrInt32(bp+40, sessionInputBuffer(tls, pInput, 2)) != 0) {
 178207 		goto __4
 178208 	}
 178209 	goto finished_invert
 178210 __4:
 178211 	;
 178212 	if !((*SessionInput)(unsafe.Pointer(pInput)).FiNext >= (*SessionInput)(unsafe.Pointer(pInput)).FnData) {
 178213 		goto __5
 178214 	}
 178215 	goto __3
 178216 __5:
 178217 	;
 178218 	eType = *(*U8)(unsafe.Pointer((*SessionInput)(unsafe.Pointer(pInput)).FaData + uintptr((*SessionInput)(unsafe.Pointer(pInput)).FiNext)))
 178219 
 178220 	switch int32(eType) {
 178221 	case 'T':
 178222 		goto __7
 178223 
 178224 	case SQLITE_INSERT:
 178225 		goto __8
 178226 	case SQLITE_DELETE:
 178227 		goto __9
 178228 
 178229 	case SQLITE_UPDATE:
 178230 		goto __10
 178231 
 178232 	default:
 178233 		goto __11
 178234 	}
 178235 	goto __6
 178236 __7:
 178237 	(*SessionInput)(unsafe.Pointer(pInput)).FiNext++
 178238 	if !(libc.AssignPtrInt32(bp+40, sessionChangesetBufferTblhdr(tls, pInput, bp+16)) != 0) {
 178239 		goto __12
 178240 	}
 178241 	goto finished_invert
 178242 __12:
 178243 	;
 178244 	nVar = sessionVarintGet(tls, (*SessionInput)(unsafe.Pointer(pInput)).FaData+uintptr((*SessionInput)(unsafe.Pointer(pInput)).FiNext), bp+20)
 178245 	(*SessionBuffer)(unsafe.Pointer(bp + 24)).FnBuf = 0
 178246 	sessionAppendBlob(tls, bp+24, (*SessionInput)(unsafe.Pointer(pInput)).FaData+uintptr((*SessionInput)(unsafe.Pointer(pInput)).FiNext+nVar), *(*int32)(unsafe.Pointer(bp + 20)), bp+40)
 178247 	sessionAppendByte(tls, bp, eType, bp+40)
 178248 	sessionAppendBlob(tls, bp, (*SessionInput)(unsafe.Pointer(pInput)).FaData+uintptr((*SessionInput)(unsafe.Pointer(pInput)).FiNext), *(*int32)(unsafe.Pointer(bp + 16)), bp+40)
 178249 	if !(*(*int32)(unsafe.Pointer(bp + 40)) != 0) {
 178250 		goto __13
 178251 	}
 178252 	goto finished_invert
 178253 __13:
 178254 	;
 178255 	*(*int32)(unsafe.Pointer(pInput + 8)) += *(*int32)(unsafe.Pointer(bp + 16))
 178256 	Xsqlite3_free(tls, apVal)
 178257 	apVal = uintptr(0)
 178258 	abPK = (*SessionBuffer)(unsafe.Pointer(bp + 24)).FaBuf
 178259 	goto __6
 178260 
 178261 __8:
 178262 __9:
 178263 	bIndirect = int32(*(*U8)(unsafe.Pointer((*SessionInput)(unsafe.Pointer(pInput)).FaData + uintptr((*SessionInput)(unsafe.Pointer(pInput)).FiNext+1))))
 178264 	eType2 = func() int32 {
 178265 		if int32(eType) == SQLITE_DELETE {
 178266 			return SQLITE_INSERT
 178267 		}
 178268 		return SQLITE_DELETE
 178269 	}()
 178270 	*(*int32)(unsafe.Pointer(pInput + 8)) += 2
 178271 
 178272 	*(*int32)(unsafe.Pointer(bp + 40)) = sessionChangesetBufferRecord(tls, pInput, *(*int32)(unsafe.Pointer(bp + 20)), bp+44)
 178273 	sessionAppendByte(tls, bp, uint8(eType2), bp+40)
 178274 	sessionAppendByte(tls, bp, uint8(bIndirect), bp+40)
 178275 	sessionAppendBlob(tls, bp, (*SessionInput)(unsafe.Pointer(pInput)).FaData+uintptr((*SessionInput)(unsafe.Pointer(pInput)).FiNext), *(*int32)(unsafe.Pointer(bp + 44)), bp+40)
 178276 	*(*int32)(unsafe.Pointer(pInput + 8)) += *(*int32)(unsafe.Pointer(bp + 44))
 178277 	if !(*(*int32)(unsafe.Pointer(bp + 40)) != 0) {
 178278 		goto __14
 178279 	}
 178280 	goto finished_invert
 178281 __14:
 178282 	;
 178283 	goto __6
 178284 
 178285 __10:
 178286 	if !(uintptr(0) == apVal) {
 178287 		goto __15
 178288 	}
 178289 	apVal = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(uintptr(0)))*uint64(*(*int32)(unsafe.Pointer(bp + 20)))*uint64(2))
 178290 	if !(uintptr(0) == apVal) {
 178291 		goto __16
 178292 	}
 178293 	*(*int32)(unsafe.Pointer(bp + 40)) = SQLITE_NOMEM
 178294 	goto finished_invert
 178295 __16:
 178296 	;
 178297 	libc.Xmemset(tls, apVal, 0, uint64(unsafe.Sizeof(uintptr(0)))*uint64(*(*int32)(unsafe.Pointer(bp + 20)))*uint64(2))
 178298 __15:
 178299 	;
 178300 	sessionAppendByte(tls, bp, eType, bp+40)
 178301 	sessionAppendByte(tls, bp, *(*U8)(unsafe.Pointer((*SessionInput)(unsafe.Pointer(pInput)).FaData + uintptr((*SessionInput)(unsafe.Pointer(pInput)).FiNext+1))), bp+40)
 178302 
 178303 	*(*int32)(unsafe.Pointer(pInput + 8)) += 2
 178304 	*(*int32)(unsafe.Pointer(bp + 40)) = sessionReadRecord(tls, pInput, *(*int32)(unsafe.Pointer(bp + 20)), uintptr(0), apVal, uintptr(0))
 178305 	if !(*(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK) {
 178306 		goto __17
 178307 	}
 178308 	*(*int32)(unsafe.Pointer(bp + 40)) = sessionReadRecord(tls, pInput, *(*int32)(unsafe.Pointer(bp + 20)), uintptr(0), apVal+uintptr(*(*int32)(unsafe.Pointer(bp + 20)))*8, uintptr(0))
 178309 __17:
 178310 	;
 178311 	iCol = 0
 178312 __18:
 178313 	if !(iCol < *(*int32)(unsafe.Pointer(bp + 20))) {
 178314 		goto __20
 178315 	}
 178316 	pVal = *(*uintptr)(unsafe.Pointer(apVal + uintptr(iCol+func() int32 {
 178317 		if *(*U8)(unsafe.Pointer(abPK + uintptr(iCol))) != 0 {
 178318 			return 0
 178319 		}
 178320 		return *(*int32)(unsafe.Pointer(bp + 20))
 178321 	}())*8))
 178322 	sessionAppendValue(tls, bp, pVal, bp+40)
 178323 	goto __19
 178324 __19:
 178325 	iCol++
 178326 	goto __18
 178327 	goto __20
 178328 __20:
 178329 	;
 178330 	iCol = 0
 178331 __21:
 178332 	if !(iCol < *(*int32)(unsafe.Pointer(bp + 20))) {
 178333 		goto __23
 178334 	}
 178335 	pVal1 = func() uintptr {
 178336 		if *(*U8)(unsafe.Pointer(abPK + uintptr(iCol))) != 0 {
 178337 			return uintptr(0)
 178338 		}
 178339 		return *(*uintptr)(unsafe.Pointer(apVal + uintptr(iCol)*8))
 178340 	}()
 178341 	sessionAppendValue(tls, bp, pVal1, bp+40)
 178342 	goto __22
 178343 __22:
 178344 	iCol++
 178345 	goto __21
 178346 	goto __23
 178347 __23:
 178348 	;
 178349 	iCol = 0
 178350 __24:
 178351 	if !(iCol < *(*int32)(unsafe.Pointer(bp + 20))*2) {
 178352 		goto __26
 178353 	}
 178354 	Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(iCol)*8)))
 178355 	goto __25
 178356 __25:
 178357 	iCol++
 178358 	goto __24
 178359 	goto __26
 178360 __26:
 178361 	;
 178362 	libc.Xmemset(tls, apVal, 0, uint64(unsafe.Sizeof(uintptr(0)))*uint64(*(*int32)(unsafe.Pointer(bp + 20)))*uint64(2))
 178363 	if !(*(*int32)(unsafe.Pointer(bp + 40)) != SQLITE_OK) {
 178364 		goto __27
 178365 	}
 178366 	goto finished_invert
 178367 __27:
 178368 	;
 178369 	goto __6
 178370 
 178371 __11:
 178372 	*(*int32)(unsafe.Pointer(bp + 40)) = Xsqlite3CorruptError(tls, 219832)
 178373 	goto finished_invert
 178374 __6:
 178375 	;
 178376 	if !(xOutput != 0 && (*SessionBuffer)(unsafe.Pointer(bp)).FnBuf >= sessions_strm_chunk_size) {
 178377 		goto __28
 178378 	}
 178379 	*(*int32)(unsafe.Pointer(bp + 40)) = (*struct {
 178380 		f func(*libc.TLS, uintptr, uintptr, int32) int32
 178381 	})(unsafe.Pointer(&struct{ uintptr }{xOutput})).f(tls, pOut, (*SessionBuffer)(unsafe.Pointer(bp)).FaBuf, (*SessionBuffer)(unsafe.Pointer(bp)).FnBuf)
 178382 	(*SessionBuffer)(unsafe.Pointer(bp)).FnBuf = 0
 178383 	if !(*(*int32)(unsafe.Pointer(bp + 40)) != SQLITE_OK) {
 178384 		goto __29
 178385 	}
 178386 	goto finished_invert
 178387 __29:
 178388 	;
 178389 __28:
 178390 	;
 178391 	goto __2
 178392 __3:
 178393 	;
 178394 	if !(pnInverted != 0 && ppInverted != 0) {
 178395 		goto __30
 178396 	}
 178397 	*(*int32)(unsafe.Pointer(pnInverted)) = (*SessionBuffer)(unsafe.Pointer(bp)).FnBuf
 178398 	*(*uintptr)(unsafe.Pointer(ppInverted)) = (*SessionBuffer)(unsafe.Pointer(bp)).FaBuf
 178399 	(*SessionBuffer)(unsafe.Pointer(bp)).FaBuf = uintptr(0)
 178400 	goto __31
 178401 __30:
 178402 	if !((*SessionBuffer)(unsafe.Pointer(bp)).FnBuf > 0 && xOutput != uintptr(0)) {
 178403 		goto __32
 178404 	}
 178405 	*(*int32)(unsafe.Pointer(bp + 40)) = (*struct {
 178406 		f func(*libc.TLS, uintptr, uintptr, int32) int32
 178407 	})(unsafe.Pointer(&struct{ uintptr }{xOutput})).f(tls, pOut, (*SessionBuffer)(unsafe.Pointer(bp)).FaBuf, (*SessionBuffer)(unsafe.Pointer(bp)).FnBuf)
 178408 __32:
 178409 	;
 178410 __31:
 178411 	;
 178412 finished_invert:
 178413 	Xsqlite3_free(tls, (*SessionBuffer)(unsafe.Pointer(bp)).FaBuf)
 178414 	Xsqlite3_free(tls, apVal)
 178415 	Xsqlite3_free(tls, (*SessionBuffer)(unsafe.Pointer(bp+24)).FaBuf)
 178416 	return *(*int32)(unsafe.Pointer(bp + 40))
 178417 }
 178418 
 178419 // Invert a changeset object.
 178420 func Xsqlite3changeset_invert(tls *libc.TLS, nChangeset int32, pChangeset uintptr, pnInverted uintptr, ppInverted uintptr) int32 {
 178421 	bp := tls.Alloc(72)
 178422 	defer tls.Free(72)
 178423 
 178424 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(SessionInput{})))
 178425 	(*SessionInput)(unsafe.Pointer(bp)).FnData = nChangeset
 178426 	(*SessionInput)(unsafe.Pointer(bp)).FaData = pChangeset
 178427 
 178428 	return sessionChangesetInvert(tls, bp, uintptr(0), uintptr(0), pnInverted, ppInverted)
 178429 }
 178430 
 178431 // Streaming version of sqlite3changeset_invert().
 178432 func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) int32 {
 178433 	bp := tls.Alloc(72)
 178434 	defer tls.Free(72)
 178435 
 178436 	var rc int32
 178437 
 178438 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(SessionInput{})))
 178439 	(*SessionInput)(unsafe.Pointer(bp)).FxInput = xInput
 178440 	(*SessionInput)(unsafe.Pointer(bp)).FpIn = pIn
 178441 
 178442 	rc = sessionChangesetInvert(tls, bp, xOutput, pOut, uintptr(0), uintptr(0))
 178443 	Xsqlite3_free(tls, (*SessionInput)(unsafe.Pointer(bp)).Fbuf.FaBuf)
 178444 	return rc
 178445 }
 178446 
 178447 type SessionUpdate1 = struct {
 178448 	FpStmt uintptr
 178449 	FaMask uintptr
 178450 	FpNext uintptr
 178451 }
 178452 
 178453 type SessionUpdate = SessionUpdate1
 178454 
 178455 type SessionApplyCtx1 = struct {
 178456 	Fdb                 uintptr
 178457 	FpDelete            uintptr
 178458 	FpInsert            uintptr
 178459 	FpSelect            uintptr
 178460 	FnCol               int32
 178461 	F__ccgo_pad1        [4]byte
 178462 	FazCol              uintptr
 178463 	FabPK               uintptr
 178464 	FaUpdateMask        uintptr
 178465 	FpUp                uintptr
 178466 	FbStat1             int32
 178467 	FbDeferConstraints  int32
 178468 	FbInvertConstraints int32
 178469 	F__ccgo_pad2        [4]byte
 178470 	Fconstraints        SessionBuffer
 178471 	Frebase             SessionBuffer
 178472 	FbRebaseStarted     U8
 178473 	FbRebase            U8
 178474 	F__ccgo_pad3        [6]byte
 178475 }
 178476 
 178477 type SessionApplyCtx = SessionApplyCtx1
 178478 
 178479 func sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32, ppStmt uintptr) int32 {
 178480 	bp := tls.Alloc(20)
 178481 	defer tls.Free(20)
 178482 
 178483 	*(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_OK
 178484 	var pUp uintptr = uintptr(0)
 178485 	var nCol int32 = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol
 178486 	var nU32 int32 = ((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol + 33) / 32
 178487 	var ii int32
 178488 
 178489 	if (*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask == uintptr(0) {
 178490 		(*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask = Xsqlite3_malloc(tls, int32(uint64(nU32)*uint64(unsafe.Sizeof(U32(0)))))
 178491 		if (*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask == uintptr(0) {
 178492 			*(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_NOMEM
 178493 		}
 178494 	}
 178495 
 178496 	if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
 178497 		libc.Xmemset(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, 0, uint64(nU32)*uint64(unsafe.Sizeof(U32(0))))
 178498 		*(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_CORRUPT
 178499 		for ii = 0; ii < (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol; ii++ {
 178500 			if *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+ii)*8)) != 0 {
 178501 				*(*U32)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask + uintptr(ii/32)*4)) |= U32(int32(1) << (ii % 32))
 178502 				*(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_OK
 178503 			}
 178504 		}
 178505 	}
 178506 
 178507 	if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
 178508 		if bPatchset != 0 {
 178509 			*(*U32)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask + uintptr(nCol/32)*4)) |= U32(int32(1) << (nCol % 32))
 178510 		}
 178511 
 178512 		if (*SessionApplyCtx)(unsafe.Pointer(p)).FpUp != 0 {
 178513 			var nUp int32 = 0
 178514 			var pp uintptr = p + 64
 178515 			for 1 != 0 {
 178516 				nUp++
 178517 				if 0 == libc.Xmemcmp(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, (*SessionUpdate)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FaMask, uint64(nU32)*uint64(unsafe.Sizeof(U32(0)))) {
 178518 					pUp = *(*uintptr)(unsafe.Pointer(pp))
 178519 					*(*uintptr)(unsafe.Pointer(pp)) = (*SessionUpdate)(unsafe.Pointer(pUp)).FpNext
 178520 					(*SessionUpdate)(unsafe.Pointer(pUp)).FpNext = (*SessionApplyCtx)(unsafe.Pointer(p)).FpUp
 178521 					(*SessionApplyCtx)(unsafe.Pointer(p)).FpUp = pUp
 178522 					break
 178523 				}
 178524 
 178525 				if (*SessionUpdate)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FpNext != 0 {
 178526 					pp = *(*uintptr)(unsafe.Pointer(pp)) + 16
 178527 				} else {
 178528 					if nUp >= SESSION_UPDATE_CACHE_SZ {
 178529 						Xsqlite3_finalize(tls, (*SessionUpdate)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FpStmt)
 178530 						Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pp)))
 178531 						*(*uintptr)(unsafe.Pointer(pp)) = uintptr(0)
 178532 					}
 178533 					break
 178534 				}
 178535 			}
 178536 		}
 178537 
 178538 		if pUp == uintptr(0) {
 178539 			var nByte int32 = int32(uint64(unsafe.Sizeof(SessionUpdate{})) * uint64(nU32) * uint64(unsafe.Sizeof(U32(0))))
 178540 			var bStat1 int32 = libc.Bool32(Xsqlite3_stricmp(tls, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, ts+12700) == 0)
 178541 			pUp = Xsqlite3_malloc(tls, nByte)
 178542 			if pUp == uintptr(0) {
 178543 				*(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_NOMEM
 178544 			} else {
 178545 				var zSep uintptr = ts + 1544
 178546 
 178547 				libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(SessionBuffer{})))
 178548 				(*SessionUpdate)(unsafe.Pointer(pUp)).FaMask = pUp + 1*24
 178549 				libc.Xmemcpy(tls, (*SessionUpdate)(unsafe.Pointer(pUp)).FaMask, (*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, uint64(nU32)*uint64(unsafe.Sizeof(U32(0))))
 178550 
 178551 				sessionAppendStr(tls, bp, ts+34336, bp+16)
 178552 				sessionAppendIdent(tls, bp, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp+16)
 178553 				sessionAppendStr(tls, bp, ts+34349, bp+16)
 178554 
 178555 				for ii = 0; ii < (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol; ii++ {
 178556 					if int32(*(*U8)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii)))) == 0 && *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+ii)*8)) != 0 {
 178557 						sessionAppendStr(tls, bp, zSep, bp+16)
 178558 						sessionAppendIdent(tls, bp, *(*uintptr)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp+16)
 178559 						sessionAppendStr(tls, bp, ts+34355, bp+16)
 178560 						sessionAppendInteger(tls, bp, ii*2+1, bp+16)
 178561 						zSep = ts + 15971
 178562 					}
 178563 				}
 178564 
 178565 				zSep = ts + 1544
 178566 				sessionAppendStr(tls, bp, ts+34284, bp+16)
 178567 				for ii = 0; ii < (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol; ii++ {
 178568 					if *(*U8)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii))) != 0 || bPatchset == 0 && *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr(ii)*8)) != 0 {
 178569 						sessionAppendStr(tls, bp, zSep, bp+16)
 178570 						if bStat1 != 0 && ii == 1 {
 178571 							sessionAppendStr(tls, bp,
 178572 								ts+34360, bp+16)
 178573 						} else {
 178574 							sessionAppendIdent(tls, bp, *(*uintptr)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp+16)
 178575 							sessionAppendStr(tls, bp, ts+34292, bp+16)
 178576 							sessionAppendInteger(tls, bp, ii*2+2, bp+16)
 178577 						}
 178578 						zSep = ts + 22941
 178579 					}
 178580 				}
 178581 
 178582 				if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
 178583 					var zSql uintptr = (*SessionBuffer)(unsafe.Pointer(bp)).FaBuf
 178584 					*(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_prepare_v2(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).Fdb, zSql, (*SessionBuffer)(unsafe.Pointer(bp)).FnBuf, pUp, uintptr(0))
 178585 				}
 178586 
 178587 				if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK {
 178588 					Xsqlite3_free(tls, pUp)
 178589 					pUp = uintptr(0)
 178590 				} else {
 178591 					(*SessionUpdate)(unsafe.Pointer(pUp)).FpNext = (*SessionApplyCtx)(unsafe.Pointer(p)).FpUp
 178592 					(*SessionApplyCtx)(unsafe.Pointer(p)).FpUp = pUp
 178593 				}
 178594 				Xsqlite3_free(tls, (*SessionBuffer)(unsafe.Pointer(bp)).FaBuf)
 178595 			}
 178596 		}
 178597 	}
 178598 
 178599 	if pUp != 0 {
 178600 		*(*uintptr)(unsafe.Pointer(ppStmt)) = (*SessionUpdate)(unsafe.Pointer(pUp)).FpStmt
 178601 	} else {
 178602 		*(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0)
 178603 	}
 178604 	return *(*int32)(unsafe.Pointer(bp + 16))
 178605 }
 178606 
 178607 func sessionUpdateFree(tls *libc.TLS, p uintptr) {
 178608 	var pUp uintptr
 178609 	var pNext uintptr
 178610 	for pUp = (*SessionApplyCtx)(unsafe.Pointer(p)).FpUp; pUp != 0; pUp = pNext {
 178611 		pNext = (*SessionUpdate)(unsafe.Pointer(pUp)).FpNext
 178612 		Xsqlite3_finalize(tls, (*SessionUpdate)(unsafe.Pointer(pUp)).FpStmt)
 178613 		Xsqlite3_free(tls, pUp)
 178614 	}
 178615 	(*SessionApplyCtx)(unsafe.Pointer(p)).FpUp = uintptr(0)
 178616 	Xsqlite3_free(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask)
 178617 	(*SessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask = uintptr(0)
 178618 }
 178619 
 178620 func sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) int32 {
 178621 	bp := tls.Alloc(20)
 178622 	defer tls.Free(20)
 178623 
 178624 	var i int32
 178625 	var zSep uintptr = ts + 1544
 178626 	*(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_OK
 178627 	*(*SessionBuffer)(unsafe.Pointer(bp)) = SessionBuffer{}
 178628 	var nPk int32 = 0
 178629 
 178630 	sessionAppendStr(tls, bp, ts+34435, bp+16)
 178631 	sessionAppendIdent(tls, bp, zTab, bp+16)
 178632 	sessionAppendStr(tls, bp, ts+34284, bp+16)
 178633 
 178634 	for i = 0; i < (*SessionApplyCtx)(unsafe.Pointer(p)).FnCol; i++ {
 178635 		if *(*U8)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 {
 178636 			nPk++
 178637 			sessionAppendStr(tls, bp, zSep, bp+16)
 178638 			sessionAppendIdent(tls, bp, *(*uintptr)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp+16)
 178639 			sessionAppendStr(tls, bp, ts+34355, bp+16)
 178640 			sessionAppendInteger(tls, bp, i+1, bp+16)
 178641 			zSep = ts + 22941
 178642 		}
 178643 	}
 178644 
 178645 	if nPk < (*SessionApplyCtx)(unsafe.Pointer(p)).FnCol {
 178646 		sessionAppendStr(tls, bp, ts+34453, bp+16)
 178647 		sessionAppendInteger(tls, bp, (*SessionApplyCtx)(unsafe.Pointer(p)).FnCol+1, bp+16)
 178648 		sessionAppendStr(tls, bp, ts+33996, bp+16)
 178649 
 178650 		zSep = ts + 1544
 178651 		for i = 0; i < (*SessionApplyCtx)(unsafe.Pointer(p)).FnCol; i++ {
 178652 			if !(int32(*(*U8)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i)))) != 0) {
 178653 				sessionAppendStr(tls, bp, zSep, bp+16)
 178654 				sessionAppendIdent(tls, bp, *(*uintptr)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp+16)
 178655 				sessionAppendStr(tls, bp, ts+34292, bp+16)
 178656 				sessionAppendInteger(tls, bp, i+1, bp+16)
 178657 				zSep = ts + 34461
 178658 			}
 178659 		}
 178660 		sessionAppendStr(tls, bp, ts+6309, bp+16)
 178661 	}
 178662 
 178663 	if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
 178664 		*(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_prepare_v2(tls, db, (*SessionBuffer)(unsafe.Pointer(bp)).FaBuf, (*SessionBuffer)(unsafe.Pointer(bp)).FnBuf, p+8, uintptr(0))
 178665 	}
 178666 	Xsqlite3_free(tls, (*SessionBuffer)(unsafe.Pointer(bp)).FaBuf)
 178667 
 178668 	return *(*int32)(unsafe.Pointer(bp + 16))
 178669 }
 178670 
 178671 func sessionSelectRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) int32 {
 178672 	return sessionSelectStmt(tls,
 178673 		db, ts+7793, zTab, (*SessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*SessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*SessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24)
 178674 }
 178675 
 178676 func sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) int32 {
 178677 	bp := tls.Alloc(20)
 178678 	defer tls.Free(20)
 178679 
 178680 	*(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_OK
 178681 	var i int32
 178682 	*(*SessionBuffer)(unsafe.Pointer(bp)) = SessionBuffer{}
 178683 
 178684 	sessionAppendStr(tls, bp, ts+34466, bp+16)
 178685 	sessionAppendIdent(tls, bp, zTab, bp+16)
 178686 	sessionAppendStr(tls, bp, ts+22947, bp+16)
 178687 	for i = 0; i < (*SessionApplyCtx)(unsafe.Pointer(p)).FnCol; i++ {
 178688 		if i != 0 {
 178689 			sessionAppendStr(tls, bp, ts+15971, bp+16)
 178690 		}
 178691 		sessionAppendIdent(tls, bp, *(*uintptr)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp+16)
 178692 	}
 178693 
 178694 	sessionAppendStr(tls, bp, ts+34484, bp+16)
 178695 	for i = 1; i < (*SessionApplyCtx)(unsafe.Pointer(p)).FnCol; i++ {
 178696 		sessionAppendStr(tls, bp, ts+34495, bp+16)
 178697 	}
 178698 	sessionAppendStr(tls, bp, ts+6309, bp+16)
 178699 
 178700 	if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
 178701 		*(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_prepare_v2(tls, db, (*SessionBuffer)(unsafe.Pointer(bp)).FaBuf, (*SessionBuffer)(unsafe.Pointer(bp)).FnBuf, p+16, uintptr(0))
 178702 	}
 178703 	Xsqlite3_free(tls, (*SessionBuffer)(unsafe.Pointer(bp)).FaBuf)
 178704 	return *(*int32)(unsafe.Pointer(bp + 16))
 178705 }
 178706 
 178707 func sessionPrepare(tls *libc.TLS, db uintptr, pp uintptr, zSql uintptr) int32 {
 178708 	return Xsqlite3_prepare_v2(tls, db, zSql, -1, pp, uintptr(0))
 178709 }
 178710 
 178711 func sessionStat1Sql(tls *libc.TLS, db uintptr, p uintptr) int32 {
 178712 	var rc int32 = sessionSelectRow(tls, db, ts+12700, p)
 178713 	if rc == SQLITE_OK {
 178714 		rc = sessionPrepare(tls, db, p+16,
 178715 			ts+34499)
 178716 	}
 178717 	if rc == SQLITE_OK {
 178718 		rc = sessionPrepare(tls, db, p+8,
 178719 			ts+34612)
 178720 	}
 178721 	return rc
 178722 }
 178723 
 178724 func sessionBindValue(tls *libc.TLS, pStmt uintptr, i int32, pVal uintptr) int32 {
 178725 	var eType int32 = Xsqlite3_value_type(tls, pVal)
 178726 
 178727 	if (eType == SQLITE_TEXT || eType == SQLITE_BLOB) && (*Sqlite3_value)(unsafe.Pointer(pVal)).Fz == uintptr(0) {
 178728 		return SQLITE_NOMEM
 178729 	}
 178730 	return Xsqlite3_bind_value(tls, pStmt, i, pVal)
 178731 }
 178732 
 178733 func sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) int32 {
 178734 	bp := tls.Alloc(8)
 178735 	defer tls.Free(8)
 178736 
 178737 	var i int32
 178738 	var rc int32 = SQLITE_OK
 178739 
 178740 	for i = 0; rc == SQLITE_OK && i < nCol; i++ {
 178741 		if !(abPK != 0) || *(*U8)(unsafe.Pointer(abPK + uintptr(i))) != 0 {
 178742 			*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 178743 			(*struct {
 178744 				f func(*libc.TLS, uintptr, int32, uintptr) int32
 178745 			})(unsafe.Pointer(&struct{ uintptr }{xValue})).f(tls, pIter, i, bp)
 178746 			if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) {
 178747 				rc = Xsqlite3CorruptError(tls, 220310)
 178748 			} else {
 178749 				rc = sessionBindValue(tls, pStmt, i+1, *(*uintptr)(unsafe.Pointer(bp)))
 178750 			}
 178751 		}
 178752 	}
 178753 	return rc
 178754 }
 178755 
 178756 func sessionSeekToRow(tls *libc.TLS, pIter uintptr, abPK uintptr, pSelect uintptr) int32 {
 178757 	bp := tls.Alloc(16)
 178758 	defer tls.Free(16)
 178759 
 178760 	var rc int32
 178761 
 178762 	Xsqlite3changeset_op(tls, pIter, bp, bp+8, bp+12, uintptr(0))
 178763 	rc = sessionBindRow(tls, pIter,
 178764 		func() uintptr {
 178765 			if *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_INSERT {
 178766 				return *(*uintptr)(unsafe.Pointer(&struct {
 178767 					f func(*libc.TLS, uintptr, int32, uintptr) int32
 178768 				}{Xsqlite3changeset_new}))
 178769 			}
 178770 			return *(*uintptr)(unsafe.Pointer(&struct {
 178771 				f func(*libc.TLS, uintptr, int32, uintptr) int32
 178772 			}{Xsqlite3changeset_old}))
 178773 		}(),
 178774 		*(*int32)(unsafe.Pointer(bp + 8)), abPK, pSelect)
 178775 
 178776 	if rc == SQLITE_OK {
 178777 		rc = Xsqlite3_step(tls, pSelect)
 178778 		if rc != SQLITE_ROW {
 178779 			rc = Xsqlite3_reset(tls, pSelect)
 178780 		}
 178781 	}
 178782 
 178783 	return rc
 178784 }
 178785 
 178786 func sessionRebaseAdd(tls *libc.TLS, p uintptr, eType int32, pIter uintptr) int32 {
 178787 	bp := tls.Alloc(16)
 178788 	defer tls.Free(16)
 178789 
 178790 	*(*int32)(unsafe.Pointer(bp)) = SQLITE_OK
 178791 	if (*SessionApplyCtx)(unsafe.Pointer(p)).FbRebase != 0 {
 178792 		var i int32
 178793 		var eOp int32 = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fop
 178794 		if int32((*SessionApplyCtx)(unsafe.Pointer(p)).FbRebaseStarted) == 0 {
 178795 			var zTab uintptr = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab
 178796 			sessionAppendByte(tls, p+104, uint8('T'), bp)
 178797 			sessionAppendVarint(tls, p+104, (*SessionApplyCtx)(unsafe.Pointer(p)).FnCol, bp)
 178798 			sessionAppendBlob(tls, p+104, (*SessionApplyCtx)(unsafe.Pointer(p)).FabPK, (*SessionApplyCtx)(unsafe.Pointer(p)).FnCol, bp)
 178799 			sessionAppendBlob(tls, p+104, zTab, int32(libc.Xstrlen(tls, zTab))+1, bp)
 178800 			(*SessionApplyCtx)(unsafe.Pointer(p)).FbRebaseStarted = U8(1)
 178801 		}
 178802 
 178803 		sessionAppendByte(tls, p+104,
 178804 			func() uint8 {
 178805 				if eOp == SQLITE_DELETE {
 178806 					return uint8(SQLITE_DELETE)
 178807 				}
 178808 				return uint8(SQLITE_INSERT)
 178809 			}(), bp)
 178810 		sessionAppendByte(tls, p+104, uint8(libc.Bool32(eType == SQLITE_CHANGESET_REPLACE)), bp)
 178811 		for i = 0; i < (*SessionApplyCtx)(unsafe.Pointer(p)).FnCol; i++ {
 178812 			*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 178813 			if eOp == SQLITE_DELETE || eOp == SQLITE_UPDATE && *(*U8)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 {
 178814 				Xsqlite3changeset_old(tls, pIter, i, bp+8)
 178815 			} else {
 178816 				Xsqlite3changeset_new(tls, pIter, i, bp+8)
 178817 			}
 178818 			sessionAppendValue(tls, p+104, *(*uintptr)(unsafe.Pointer(bp + 8)), bp)
 178819 		}
 178820 	}
 178821 	return *(*int32)(unsafe.Pointer(bp))
 178822 }
 178823 
 178824 func sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr) int32 {
 178825 	bp := tls.Alloc(20)
 178826 	defer tls.Free(20)
 178827 
 178828 	var res int32 = 0
 178829 
 178830 	Xsqlite3changeset_op(tls, pIter, bp, bp+8, bp+12, uintptr(0))
 178831 
 178832 	if pbReplace != 0 {
 178833 		*(*int32)(unsafe.Pointer(bp + 16)) = sessionSeekToRow(tls, pIter, (*SessionApplyCtx)(unsafe.Pointer(p)).FabPK, (*SessionApplyCtx)(unsafe.Pointer(p)).FpSelect)
 178834 	} else {
 178835 		*(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_OK
 178836 	}
 178837 
 178838 	if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_ROW {
 178839 		(*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = (*SessionApplyCtx)(unsafe.Pointer(p)).FpSelect
 178840 		res = (*struct {
 178841 			f func(*libc.TLS, uintptr, int32, uintptr) int32
 178842 		})(unsafe.Pointer(&struct{ uintptr }{xConflict})).f(tls, pCtx, eType, pIter)
 178843 		(*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = uintptr(0)
 178844 		*(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_reset(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).FpSelect)
 178845 	} else if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
 178846 		if (*SessionApplyCtx)(unsafe.Pointer(p)).FbDeferConstraints != 0 && eType == SQLITE_CHANGESET_CONFLICT {
 178847 			var aBlob uintptr = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FaData + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiCurrent)
 178848 			var nBlob int32 = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiNext - (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiCurrent
 178849 			sessionAppendBlob(tls, p+88, aBlob, nBlob, bp+16)
 178850 			return SQLITE_OK
 178851 		} else {
 178852 			res = (*struct {
 178853 				f func(*libc.TLS, uintptr, int32, uintptr) int32
 178854 			})(unsafe.Pointer(&struct{ uintptr }{xConflict})).f(tls, pCtx, eType+1, pIter)
 178855 			if res == SQLITE_CHANGESET_REPLACE {
 178856 				*(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_MISUSE
 178857 			}
 178858 		}
 178859 	}
 178860 
 178861 	if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
 178862 		switch res {
 178863 		case SQLITE_CHANGESET_REPLACE:
 178864 			*(*int32)(unsafe.Pointer(pbReplace)) = 1
 178865 			break
 178866 			fallthrough
 178867 
 178868 		case SQLITE_CHANGESET_OMIT:
 178869 			break
 178870 			fallthrough
 178871 
 178872 		case SQLITE_CHANGESET_ABORT:
 178873 			*(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_ABORT
 178874 			break
 178875 			fallthrough
 178876 
 178877 		default:
 178878 			*(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_MISUSE
 178879 			break
 178880 		}
 178881 		if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
 178882 			*(*int32)(unsafe.Pointer(bp + 16)) = sessionRebaseAdd(tls, p, res, pIter)
 178883 		}
 178884 	}
 178885 
 178886 	return *(*int32)(unsafe.Pointer(bp + 16))
 178887 }
 178888 
 178889 func sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) int32 {
 178890 	bp := tls.Alloc(24)
 178891 	defer tls.Free(24)
 178892 
 178893 	var rc int32 = SQLITE_OK
 178894 
 178895 	Xsqlite3changeset_op(tls, pIter, bp, bp+8, bp+12, uintptr(0))
 178896 
 178897 	if *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_DELETE {
 178898 		var abPK uintptr = func() uintptr {
 178899 			if (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset != 0 {
 178900 				return (*SessionApplyCtx)(unsafe.Pointer(p)).FabPK
 178901 			}
 178902 			return uintptr(0)
 178903 		}()
 178904 		rc = sessionBindRow(tls, pIter, *(*uintptr)(unsafe.Pointer(&struct {
 178905 			f func(*libc.TLS, uintptr, int32, uintptr) int32
 178906 		}{Xsqlite3changeset_old})), *(*int32)(unsafe.Pointer(bp + 8)), abPK, (*SessionApplyCtx)(unsafe.Pointer(p)).FpDelete)
 178907 		if rc == SQLITE_OK && Xsqlite3_bind_parameter_count(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).FpDelete) > *(*int32)(unsafe.Pointer(bp + 8)) {
 178908 			rc = Xsqlite3_bind_int(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).FpDelete, *(*int32)(unsafe.Pointer(bp + 8))+1, libc.Bool32(pbRetry == uintptr(0) || abPK != 0))
 178909 		}
 178910 		if rc != SQLITE_OK {
 178911 			return rc
 178912 		}
 178913 
 178914 		Xsqlite3_step(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).FpDelete)
 178915 		rc = Xsqlite3_reset(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).FpDelete)
 178916 		if rc == SQLITE_OK && Xsqlite3_changes(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).Fdb) == 0 {
 178917 			rc = sessionConflictHandler(tls,
 178918 				SQLITE_CHANGESET_DATA, p, pIter, xConflict, pCtx, pbRetry)
 178919 		} else if rc&0xff == SQLITE_CONSTRAINT {
 178920 			rc = sessionConflictHandler(tls,
 178921 				SQLITE_CHANGESET_CONFLICT, p, pIter, xConflict, pCtx, uintptr(0))
 178922 		}
 178923 
 178924 	} else if *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_UPDATE {
 178925 		var i int32
 178926 		*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
 178927 		var bPatchset int32 = libc.Bool32(pbRetry == uintptr(0) || (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset != 0)
 178928 
 178929 		rc = sessionUpdateFind(tls, pIter, p, bPatchset, bp+16)
 178930 
 178931 		for i = 0; rc == SQLITE_OK && i < *(*int32)(unsafe.Pointer(bp + 8)); i++ {
 178932 			var pOld uintptr = *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr(i)*8))
 178933 			var pNew uintptr = *(*uintptr)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+i)*8))
 178934 			if *(*U8)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 || bPatchset == 0 && pOld != 0 {
 178935 				rc = sessionBindValue(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), i*2+2, pOld)
 178936 			}
 178937 			if rc == SQLITE_OK && pNew != 0 {
 178938 				rc = sessionBindValue(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), i*2+1, pNew)
 178939 			}
 178940 		}
 178941 		if rc != SQLITE_OK {
 178942 			return rc
 178943 		}
 178944 
 178945 		Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
 178946 		rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
 178947 
 178948 		if rc == SQLITE_OK && Xsqlite3_changes(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).Fdb) == 0 {
 178949 			rc = sessionConflictHandler(tls,
 178950 				SQLITE_CHANGESET_DATA, p, pIter, xConflict, pCtx, pbRetry)
 178951 
 178952 		} else if rc&0xff == SQLITE_CONSTRAINT {
 178953 			rc = sessionConflictHandler(tls,
 178954 				SQLITE_CHANGESET_CONFLICT, p, pIter, xConflict, pCtx, uintptr(0))
 178955 		}
 178956 
 178957 	} else {
 178958 		if (*SessionApplyCtx)(unsafe.Pointer(p)).FbStat1 != 0 {
 178959 			rc = sessionSeekToRow(tls, pIter, (*SessionApplyCtx)(unsafe.Pointer(p)).FabPK, (*SessionApplyCtx)(unsafe.Pointer(p)).FpSelect)
 178960 			if rc == SQLITE_ROW {
 178961 				rc = SQLITE_CONSTRAINT
 178962 				Xsqlite3_reset(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).FpSelect)
 178963 			}
 178964 		}
 178965 
 178966 		if rc == SQLITE_OK {
 178967 			rc = sessionBindRow(tls, pIter, *(*uintptr)(unsafe.Pointer(&struct {
 178968 				f func(*libc.TLS, uintptr, int32, uintptr) int32
 178969 			}{Xsqlite3changeset_new})), *(*int32)(unsafe.Pointer(bp + 8)), uintptr(0), (*SessionApplyCtx)(unsafe.Pointer(p)).FpInsert)
 178970 			if rc != SQLITE_OK {
 178971 				return rc
 178972 			}
 178973 
 178974 			Xsqlite3_step(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).FpInsert)
 178975 			rc = Xsqlite3_reset(tls, (*SessionApplyCtx)(unsafe.Pointer(p)).FpInsert)
 178976 		}
 178977 
 178978 		if rc&0xff == SQLITE_CONSTRAINT {
 178979 			rc = sessionConflictHandler(tls,
 178980 				SQLITE_CHANGESET_CONFLICT, p, pIter, xConflict, pCtx, pbReplace)
 178981 		}
 178982 	}
 178983 
 178984 	return rc
 178985 }
 178986 
 178987 func sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) int32 {
 178988 	bp := tls.Alloc(8)
 178989 	defer tls.Free(8)
 178990 
 178991 	*(*int32)(unsafe.Pointer(bp)) = 0
 178992 	*(*int32)(unsafe.Pointer(bp + 4)) = 0
 178993 	var rc int32
 178994 
 178995 	rc = sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, bp, bp+4)
 178996 	if rc == SQLITE_OK {
 178997 		if *(*int32)(unsafe.Pointer(bp + 4)) != 0 {
 178998 			rc = sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0))
 178999 		} else if *(*int32)(unsafe.Pointer(bp)) != 0 {
 179000 			rc = Xsqlite3_exec(tls, db, ts+34756, uintptr(0), uintptr(0), uintptr(0))
 179001 			if rc == SQLITE_OK {
 179002 				rc = sessionBindRow(tls, pIter,
 179003 					*(*uintptr)(unsafe.Pointer(&struct {
 179004 						f func(*libc.TLS, uintptr, int32, uintptr) int32
 179005 					}{Xsqlite3changeset_new})), (*SessionApplyCtx)(unsafe.Pointer(pApply)).FnCol, (*SessionApplyCtx)(unsafe.Pointer(pApply)).FabPK, (*SessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete)
 179006 				Xsqlite3_bind_int(tls, (*SessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete, (*SessionApplyCtx)(unsafe.Pointer(pApply)).FnCol+1, 1)
 179007 			}
 179008 			if rc == SQLITE_OK {
 179009 				Xsqlite3_step(tls, (*SessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete)
 179010 				rc = Xsqlite3_reset(tls, (*SessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete)
 179011 			}
 179012 			if rc == SQLITE_OK {
 179013 				rc = sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0))
 179014 			}
 179015 			if rc == SQLITE_OK {
 179016 				rc = Xsqlite3_exec(tls, db, ts+34777, uintptr(0), uintptr(0), uintptr(0))
 179017 			}
 179018 		}
 179019 	}
 179020 
 179021 	return rc
 179022 }
 179023 
 179024 func sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) int32 {
 179025 	bp := tls.Alloc(12)
 179026 	defer tls.Free(12)
 179027 
 179028 	*(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK
 179029 
 179030 	for (*SessionApplyCtx)(unsafe.Pointer(pApply)).Fconstraints.FnBuf != 0 {
 179031 		*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 179032 		var cons = (*SessionApplyCtx)(unsafe.Pointer(pApply)).Fconstraints
 179033 		libc.Xmemset(tls, pApply+88, 0, uint64(unsafe.Sizeof(SessionBuffer{})))
 179034 
 179035 		*(*int32)(unsafe.Pointer(bp + 8)) = sessionChangesetStart(tls,
 179036 			bp, uintptr(0), uintptr(0), cons.FnBuf, cons.FaBuf, (*SessionApplyCtx)(unsafe.Pointer(pApply)).FbInvertConstraints, 1)
 179037 		if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
 179038 			var nByte Size_t = uint64(2*(*SessionApplyCtx)(unsafe.Pointer(pApply)).FnCol) * uint64(unsafe.Sizeof(uintptr(0)))
 179039 			var rc2 int32
 179040 			(*Sqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FbPatchset = bPatchset
 179041 			(*Sqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzTab = zTab
 179042 			(*Sqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnCol = (*SessionApplyCtx)(unsafe.Pointer(pApply)).FnCol
 179043 			(*Sqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FabPK = (*SessionApplyCtx)(unsafe.Pointer(pApply)).FabPK
 179044 			sessionBufferGrow(tls, *(*uintptr)(unsafe.Pointer(bp))+72, int64(nByte), bp+8)
 179045 			(*Sqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FapValue = (*Sqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Ftblhdr.FaBuf
 179046 			if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
 179047 				libc.Xmemset(tls, (*Sqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FapValue, 0, nByte)
 179048 			}
 179049 
 179050 			for *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && SQLITE_ROW == Xsqlite3changeset_next(tls, *(*uintptr)(unsafe.Pointer(bp))) {
 179051 				*(*int32)(unsafe.Pointer(bp + 8)) = sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp)), pApply, xConflict, pCtx)
 179052 			}
 179053 
 179054 			rc2 = Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp)))
 179055 			if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
 179056 				*(*int32)(unsafe.Pointer(bp + 8)) = rc2
 179057 			}
 179058 		}
 179059 
 179060 		Xsqlite3_free(tls, cons.FaBuf)
 179061 		if *(*int32)(unsafe.Pointer(bp + 8)) != SQLITE_OK {
 179062 			break
 179063 		}
 179064 		if (*SessionApplyCtx)(unsafe.Pointer(pApply)).Fconstraints.FnBuf >= cons.FnBuf {
 179065 			(*SessionApplyCtx)(unsafe.Pointer(pApply)).FbDeferConstraints = 0
 179066 		}
 179067 	}
 179068 
 179069 	return *(*int32)(unsafe.Pointer(bp + 8))
 179070 }
 179071 
 179072 func sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) int32 {
 179073 	bp := tls.Alloc(368)
 179074 	defer tls.Free(368)
 179075 
 179076 	var schemaMismatch int32 = 0
 179077 	var rc int32 = SQLITE_OK
 179078 	*(*uintptr)(unsafe.Pointer(bp + 200)) = uintptr(0)
 179079 	var nTab int32 = 0
 179080 
 179081 	var bPatchset int32
 179082 
 179083 	(*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FbNoDiscard = 1
 179084 	libc.Xmemset(tls, bp+48, 0, uint64(unsafe.Sizeof(SessionApplyCtx{})))
 179085 	(*SessionApplyCtx)(unsafe.Pointer(bp + 48)).FbRebase = U8(libc.Bool32(ppRebase != 0 && pnRebase != 0))
 179086 	(*SessionApplyCtx)(unsafe.Pointer(bp + 48)).FbInvertConstraints = libc.BoolInt32(!!(flags&SQLITE_CHANGESETAPPLY_INVERT != 0))
 179087 	Xsqlite3_mutex_enter(tls, Xsqlite3_db_mutex(tls, db))
 179088 	if flags&SQLITE_CHANGESETAPPLY_NOSAVEPOINT == 0 {
 179089 		rc = Xsqlite3_exec(tls, db, ts+34796, uintptr(0), uintptr(0), uintptr(0))
 179090 	}
 179091 	if rc == SQLITE_OK {
 179092 		rc = Xsqlite3_exec(tls, db, ts+34822, uintptr(0), uintptr(0), uintptr(0))
 179093 	}
 179094 	for rc == SQLITE_OK && SQLITE_ROW == Xsqlite3changeset_next(tls, pIter) {
 179095 		Xsqlite3changeset_op(tls, pIter, bp+176, bp+184, bp+188, uintptr(0))
 179096 
 179097 		if *(*uintptr)(unsafe.Pointer(bp + 200)) == uintptr(0) || Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(bp + 176)), *(*uintptr)(unsafe.Pointer(bp + 200)), nTab+1) != 0 {
 179098 			rc = sessionRetryConstraints(tls,
 179099 				db, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp + 200)), bp+48, xConflict, pCtx)
 179100 			if rc != SQLITE_OK {
 179101 				break
 179102 			}
 179103 
 179104 			sessionUpdateFree(tls, bp+48)
 179105 			Xsqlite3_free(tls, (*SessionApplyCtx)(unsafe.Pointer(bp+48)).FazCol)
 179106 			Xsqlite3_finalize(tls, (*SessionApplyCtx)(unsafe.Pointer(bp+48)).FpDelete)
 179107 			Xsqlite3_finalize(tls, (*SessionApplyCtx)(unsafe.Pointer(bp+48)).FpInsert)
 179108 			Xsqlite3_finalize(tls, (*SessionApplyCtx)(unsafe.Pointer(bp+48)).FpSelect)
 179109 			(*SessionApplyCtx)(unsafe.Pointer(bp + 48)).Fdb = db
 179110 			(*SessionApplyCtx)(unsafe.Pointer(bp + 48)).FpDelete = uintptr(0)
 179111 			(*SessionApplyCtx)(unsafe.Pointer(bp + 48)).FpInsert = uintptr(0)
 179112 			(*SessionApplyCtx)(unsafe.Pointer(bp + 48)).FpSelect = uintptr(0)
 179113 			(*SessionApplyCtx)(unsafe.Pointer(bp + 48)).FnCol = 0
 179114 			(*SessionApplyCtx)(unsafe.Pointer(bp + 48)).FazCol = uintptr(0)
 179115 			(*SessionApplyCtx)(unsafe.Pointer(bp + 48)).FabPK = uintptr(0)
 179116 			(*SessionApplyCtx)(unsafe.Pointer(bp + 48)).FbStat1 = 0
 179117 			(*SessionApplyCtx)(unsafe.Pointer(bp + 48)).FbDeferConstraints = 1
 179118 			(*SessionApplyCtx)(unsafe.Pointer(bp + 48)).FbRebaseStarted = U8(0)
 179119 			libc.Xmemset(tls, bp+48+88, 0, uint64(unsafe.Sizeof(SessionBuffer{})))
 179120 
 179121 			schemaMismatch = libc.Bool32(xFilter != 0 && 0 == (*struct {
 179122 				f func(*libc.TLS, uintptr, uintptr) int32
 179123 			})(unsafe.Pointer(&struct{ uintptr }{xFilter})).f(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 176))))
 179124 			if schemaMismatch != 0 {
 179125 				*(*uintptr)(unsafe.Pointer(bp + 200)) = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 176))))
 179126 				if *(*uintptr)(unsafe.Pointer(bp + 200)) == uintptr(0) {
 179127 					rc = SQLITE_NOMEM
 179128 					break
 179129 				}
 179130 				nTab = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 200))))
 179131 				(*SessionApplyCtx)(unsafe.Pointer(bp + 48)).FazCol = *(*uintptr)(unsafe.Pointer(bp + 200))
 179132 			} else {
 179133 				var nMinCol int32 = 0
 179134 				var i int32
 179135 
 179136 				Xsqlite3changeset_pk(tls, pIter, bp+192, uintptr(0))
 179137 				rc = sessionTableInfo(tls, uintptr(0),
 179138 					db, ts+7793, *(*uintptr)(unsafe.Pointer(bp + 176)), bp+48+32, bp+200, bp+48+40, bp+48+48)
 179139 				if rc != SQLITE_OK {
 179140 					break
 179141 				}
 179142 				for i = 0; i < (*SessionApplyCtx)(unsafe.Pointer(bp+48)).FnCol; i++ {
 179143 					if *(*U8)(unsafe.Pointer((*SessionApplyCtx)(unsafe.Pointer(bp+48)).FabPK + uintptr(i))) != 0 {
 179144 						nMinCol = i + 1
 179145 					}
 179146 				}
 179147 
 179148 				if (*SessionApplyCtx)(unsafe.Pointer(bp+48)).FnCol == 0 {
 179149 					schemaMismatch = 1
 179150 					Xsqlite3_log(tls, SQLITE_SCHEMA,
 179151 						ts+34852, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 200))))
 179152 				} else if (*SessionApplyCtx)(unsafe.Pointer(bp+48)).FnCol < *(*int32)(unsafe.Pointer(bp + 184)) {
 179153 					schemaMismatch = 1
 179154 					Xsqlite3_log(tls, SQLITE_SCHEMA,
 179155 						ts+34896,
 179156 						libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp + 200)), (*SessionApplyCtx)(unsafe.Pointer(bp+48)).FnCol, *(*int32)(unsafe.Pointer(bp + 184))))
 179157 				} else if *(*int32)(unsafe.Pointer(bp + 184)) < nMinCol || libc.Xmemcmp(tls, (*SessionApplyCtx)(unsafe.Pointer(bp+48)).FabPK, *(*uintptr)(unsafe.Pointer(bp + 192)), uint64(*(*int32)(unsafe.Pointer(bp + 184)))) != 0 {
 179158 					schemaMismatch = 1
 179159 					Xsqlite3_log(tls, SQLITE_SCHEMA,
 179160 						ts+34967, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(bp + 200))))
 179161 				} else {
 179162 					(*SessionApplyCtx)(unsafe.Pointer(bp + 48)).FnCol = *(*int32)(unsafe.Pointer(bp + 184))
 179163 					if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp + 200)), ts+12700) {
 179164 						if libc.AssignInt32(&rc, sessionStat1Sql(tls, db, bp+48)) != 0 {
 179165 							break
 179166 						}
 179167 						(*SessionApplyCtx)(unsafe.Pointer(bp + 48)).FbStat1 = 1
 179168 					} else {
 179169 						if libc.AssignInt32(&rc, sessionSelectRow(tls, db, *(*uintptr)(unsafe.Pointer(bp + 200)), bp+48)) != 0 ||
 179170 							libc.AssignInt32(&rc, sessionDeleteRow(tls, db, *(*uintptr)(unsafe.Pointer(bp + 200)), bp+48)) != 0 ||
 179171 							libc.AssignInt32(&rc, sessionInsertRow(tls, db, *(*uintptr)(unsafe.Pointer(bp + 200)), bp+48)) != 0 {
 179172 							break
 179173 						}
 179174 						(*SessionApplyCtx)(unsafe.Pointer(bp + 48)).FbStat1 = 0
 179175 					}
 179176 				}
 179177 				nTab = Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(bp + 200)))
 179178 			}
 179179 		}
 179180 
 179181 		if schemaMismatch != 0 {
 179182 			continue
 179183 		}
 179184 
 179185 		rc = sessionApplyOneWithRetry(tls, db, pIter, bp+48, xConflict, pCtx)
 179186 	}
 179187 
 179188 	bPatchset = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset
 179189 	if rc == SQLITE_OK {
 179190 		rc = Xsqlite3changeset_finalize(tls, pIter)
 179191 	} else {
 179192 		Xsqlite3changeset_finalize(tls, pIter)
 179193 	}
 179194 
 179195 	if rc == SQLITE_OK {
 179196 		rc = sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp + 200)), bp+48, xConflict, pCtx)
 179197 	}
 179198 
 179199 	if rc == SQLITE_OK {
 179200 		Xsqlite3_db_status(tls, db, SQLITE_DBSTATUS_DEFERRED_FKS, bp+208, bp+212, 0)
 179201 		if *(*int32)(unsafe.Pointer(bp + 208)) != 0 {
 179202 			var res int32 = SQLITE_CHANGESET_ABORT
 179203 
 179204 			libc.Xmemset(tls, bp+216, 0, uint64(unsafe.Sizeof(Sqlite3_changeset_iter{})))
 179205 			(*Sqlite3_changeset_iter)(unsafe.Pointer(bp + 216)).FnCol = *(*int32)(unsafe.Pointer(bp + 208))
 179206 			res = (*struct {
 179207 				f func(*libc.TLS, uintptr, int32, uintptr) int32
 179208 			})(unsafe.Pointer(&struct{ uintptr }{xConflict})).f(tls, pCtx, SQLITE_CHANGESET_FOREIGN_KEY, bp+216)
 179209 			if res != SQLITE_CHANGESET_OMIT {
 179210 				rc = SQLITE_CONSTRAINT
 179211 			}
 179212 		}
 179213 	}
 179214 	Xsqlite3_exec(tls, db, ts+35027, uintptr(0), uintptr(0), uintptr(0))
 179215 
 179216 	if flags&SQLITE_CHANGESETAPPLY_NOSAVEPOINT == 0 {
 179217 		if rc == SQLITE_OK {
 179218 			rc = Xsqlite3_exec(tls, db, ts+35057, uintptr(0), uintptr(0), uintptr(0))
 179219 		} else {
 179220 			Xsqlite3_exec(tls, db, ts+35081, uintptr(0), uintptr(0), uintptr(0))
 179221 			Xsqlite3_exec(tls, db, ts+35057, uintptr(0), uintptr(0), uintptr(0))
 179222 		}
 179223 	}
 179224 
 179225 	if rc == SQLITE_OK && bPatchset == 0 && (*SessionApplyCtx)(unsafe.Pointer(bp+48)).FbRebase != 0 {
 179226 		*(*uintptr)(unsafe.Pointer(ppRebase)) = (*SessionApplyCtx)(unsafe.Pointer(bp + 48)).Frebase.FaBuf
 179227 		*(*int32)(unsafe.Pointer(pnRebase)) = (*SessionApplyCtx)(unsafe.Pointer(bp + 48)).Frebase.FnBuf
 179228 		(*SessionApplyCtx)(unsafe.Pointer(bp + 48)).Frebase.FaBuf = uintptr(0)
 179229 	}
 179230 	sessionUpdateFree(tls, bp+48)
 179231 	Xsqlite3_finalize(tls, (*SessionApplyCtx)(unsafe.Pointer(bp+48)).FpInsert)
 179232 	Xsqlite3_finalize(tls, (*SessionApplyCtx)(unsafe.Pointer(bp+48)).FpDelete)
 179233 	Xsqlite3_finalize(tls, (*SessionApplyCtx)(unsafe.Pointer(bp+48)).FpSelect)
 179234 	Xsqlite3_free(tls, (*SessionApplyCtx)(unsafe.Pointer(bp+48)).FazCol)
 179235 	Xsqlite3_free(tls, (*SessionApplyCtx)(unsafe.Pointer(bp+48)).Fconstraints.FaBuf)
 179236 	Xsqlite3_free(tls, (*SessionApplyCtx)(unsafe.Pointer(bp+48)).Frebase.FaBuf)
 179237 	Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db))
 179238 	return rc
 179239 }
 179240 
 179241 // Apply the changeset passed via pChangeset/nChangeset to the main
 179242 // database attached to handle "db".
 179243 func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) int32 {
 179244 	bp := tls.Alloc(8)
 179245 	defer tls.Free(8)
 179246 
 179247 	var bInv int32 = libc.BoolInt32(!!(flags&SQLITE_CHANGESETAPPLY_INVERT != 0))
 179248 	var rc int32 = sessionChangesetStart(tls, bp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInv, 1)
 179249 	if rc == SQLITE_OK {
 179250 		rc = sessionChangesetApply(tls,
 179251 			db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags)
 179252 	}
 179253 	return rc
 179254 }
 179255 
 179256 // Apply the changeset passed via pChangeset/nChangeset to the main database
 179257 // attached to handle "db". Invoke the supplied conflict handler callback
 179258 // to resolve any conflicts encountered while applying the change.
 179259 func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) int32 {
 179260 	return Xsqlite3changeset_apply_v2(tls,
 179261 		db, nChangeset, pChangeset, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0)
 179262 }
 179263 
 179264 // Apply the changeset passed via xInput/pIn to the main database
 179265 // attached to handle "db". Invoke the supplied conflict handler callback
 179266 // to resolve any conflicts encountered while applying the change.
 179267 func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) int32 {
 179268 	bp := tls.Alloc(8)
 179269 	defer tls.Free(8)
 179270 
 179271 	var bInverse int32 = libc.BoolInt32(!!(flags&SQLITE_CHANGESETAPPLY_INVERT != 0))
 179272 	var rc int32 = sessionChangesetStart(tls, bp, xInput, pIn, 0, uintptr(0), bInverse, 1)
 179273 	if rc == SQLITE_OK {
 179274 		rc = sessionChangesetApply(tls,
 179275 			db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags)
 179276 	}
 179277 	return rc
 179278 }
 179279 
 179280 func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) int32 {
 179281 	return Xsqlite3changeset_apply_v2_strm(tls,
 179282 		db, xInput, pIn, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0)
 179283 }
 179284 
 179285 func sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset int32, pExist uintptr, op2 int32, bIndirect int32, aRec uintptr, nRec int32, ppNew uintptr) int32 {
 179286 	bp := tls.Alloc(32)
 179287 	defer tls.Free(32)
 179288 
 179289 	var pNew uintptr = uintptr(0)
 179290 	var rc int32 = SQLITE_OK
 179291 
 179292 	if !(pExist != 0) {
 179293 		pNew = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(SessionChange{}))+uint64(nRec))
 179294 		if !(pNew != 0) {
 179295 			return SQLITE_NOMEM
 179296 		}
 179297 		libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(SessionChange{})))
 179298 		(*SessionChange)(unsafe.Pointer(pNew)).Fop = U8(op2)
 179299 		(*SessionChange)(unsafe.Pointer(pNew)).FbIndirect = U8(bIndirect)
 179300 		(*SessionChange)(unsafe.Pointer(pNew)).FaRecord = pNew + 1*32
 179301 		if bIndirect == 0 || bRebase == 0 {
 179302 			(*SessionChange)(unsafe.Pointer(pNew)).FnRecord = nRec
 179303 			libc.Xmemcpy(tls, (*SessionChange)(unsafe.Pointer(pNew)).FaRecord, aRec, uint64(nRec))
 179304 		} else {
 179305 			var i int32
 179306 			var pIn uintptr = aRec
 179307 			var pOut uintptr = (*SessionChange)(unsafe.Pointer(pNew)).FaRecord
 179308 			for i = 0; i < (*SessionTable)(unsafe.Pointer(pTab)).FnCol; i++ {
 179309 				var nIn int32 = sessionSerialLen(tls, pIn)
 179310 				if int32(*(*U8)(unsafe.Pointer(pIn))) == 0 {
 179311 					*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pOut, 1))) = U8(0)
 179312 				} else if int32(*(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i)))) == 0 {
 179313 					*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pOut, 1))) = U8(0xFF)
 179314 				} else {
 179315 					libc.Xmemcpy(tls, pOut, pIn, uint64(nIn))
 179316 					pOut += uintptr(nIn)
 179317 				}
 179318 				pIn += uintptr(nIn)
 179319 			}
 179320 			(*SessionChange)(unsafe.Pointer(pNew)).FnRecord = int32((int64(pOut) - int64((*SessionChange)(unsafe.Pointer(pNew)).FaRecord)) / 1)
 179321 		}
 179322 	} else if bRebase != 0 {
 179323 		if int32((*SessionChange)(unsafe.Pointer(pExist)).Fop) == SQLITE_DELETE && (*SessionChange)(unsafe.Pointer(pExist)).FbIndirect != 0 {
 179324 			*(*uintptr)(unsafe.Pointer(ppNew)) = pExist
 179325 		} else {
 179326 			var nByte Sqlite3_int64 = Sqlite3_int64(uint64(nRec+(*SessionChange)(unsafe.Pointer(pExist)).FnRecord) + uint64(unsafe.Sizeof(SessionChange{})))
 179327 			pNew = Xsqlite3_malloc64(tls, uint64(nByte))
 179328 			if pNew == uintptr(0) {
 179329 				rc = SQLITE_NOMEM
 179330 			} else {
 179331 				var i int32
 179332 				var a1 uintptr = (*SessionChange)(unsafe.Pointer(pExist)).FaRecord
 179333 				var a2 uintptr = aRec
 179334 				var pOut uintptr
 179335 
 179336 				libc.Xmemset(tls, pNew, 0, uint64(nByte))
 179337 				(*SessionChange)(unsafe.Pointer(pNew)).FbIndirect = U8(libc.Bool32(bIndirect != 0 || (*SessionChange)(unsafe.Pointer(pExist)).FbIndirect != 0))
 179338 				(*SessionChange)(unsafe.Pointer(pNew)).Fop = U8(op2)
 179339 				pOut = libc.AssignPtrUintptr(pNew+16, pNew+1*32)
 179340 
 179341 				for i = 0; i < (*SessionTable)(unsafe.Pointer(pTab)).FnCol; i++ {
 179342 					var n1 int32 = sessionSerialLen(tls, a1)
 179343 					var n2 int32 = sessionSerialLen(tls, a2)
 179344 					if int32(*(*U8)(unsafe.Pointer(a1))) == 0xFF || int32(*(*U8)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i)))) == 0 && bIndirect != 0 {
 179345 						*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pOut, 1))) = U8(0xFF)
 179346 					} else if int32(*(*U8)(unsafe.Pointer(a2))) == 0 {
 179347 						libc.Xmemcpy(tls, pOut, a1, uint64(n1))
 179348 						pOut += uintptr(n1)
 179349 					} else {
 179350 						libc.Xmemcpy(tls, pOut, a2, uint64(n2))
 179351 						pOut += uintptr(n2)
 179352 					}
 179353 					a1 += uintptr(n1)
 179354 					a2 += uintptr(n2)
 179355 				}
 179356 				(*SessionChange)(unsafe.Pointer(pNew)).FnRecord = int32((int64(pOut) - int64((*SessionChange)(unsafe.Pointer(pNew)).FaRecord)) / 1)
 179357 			}
 179358 			Xsqlite3_free(tls, pExist)
 179359 		}
 179360 	} else {
 179361 		var op1 int32 = int32((*SessionChange)(unsafe.Pointer(pExist)).Fop)
 179362 
 179363 		if op1 == SQLITE_INSERT && op2 == SQLITE_INSERT ||
 179364 			op1 == SQLITE_UPDATE && op2 == SQLITE_INSERT ||
 179365 			op1 == SQLITE_DELETE && op2 == SQLITE_UPDATE ||
 179366 			op1 == SQLITE_DELETE && op2 == SQLITE_DELETE {
 179367 			pNew = pExist
 179368 		} else if op1 == SQLITE_INSERT && op2 == SQLITE_DELETE {
 179369 			Xsqlite3_free(tls, pExist)
 179370 
 179371 		} else {
 179372 			var aExist uintptr = (*SessionChange)(unsafe.Pointer(pExist)).FaRecord
 179373 			var nByte Sqlite3_int64
 179374 
 179375 			nByte = Sqlite3_int64(uint64(unsafe.Sizeof(SessionChange{})) + uint64((*SessionChange)(unsafe.Pointer(pExist)).FnRecord) + uint64(nRec))
 179376 			pNew = Xsqlite3_malloc64(tls, uint64(nByte))
 179377 			if !(pNew != 0) {
 179378 				Xsqlite3_free(tls, pExist)
 179379 				return SQLITE_NOMEM
 179380 			}
 179381 			libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(SessionChange{})))
 179382 			(*SessionChange)(unsafe.Pointer(pNew)).FbIndirect = U8(libc.Bool32(bIndirect != 0 && (*SessionChange)(unsafe.Pointer(pExist)).FbIndirect != 0))
 179383 			*(*uintptr)(unsafe.Pointer(bp + 8)) = libc.AssignPtrUintptr(pNew+16, pNew+1*32)
 179384 
 179385 			if op1 == SQLITE_INSERT {
 179386 				*(*uintptr)(unsafe.Pointer(bp)) = aRec
 179387 
 179388 				(*SessionChange)(unsafe.Pointer(pNew)).Fop = U8(SQLITE_INSERT)
 179389 				if bPatchset == 0 {
 179390 					sessionSkipRecord(tls, bp, (*SessionTable)(unsafe.Pointer(pTab)).FnCol)
 179391 				}
 179392 				sessionMergeRecord(tls, bp+8, (*SessionTable)(unsafe.Pointer(pTab)).FnCol, aExist, *(*uintptr)(unsafe.Pointer(bp)))
 179393 			} else if op1 == SQLITE_DELETE {
 179394 				(*SessionChange)(unsafe.Pointer(pNew)).Fop = U8(SQLITE_UPDATE)
 179395 				if bPatchset != 0 {
 179396 					libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), aRec, uint64(nRec))
 179397 					*(*uintptr)(unsafe.Pointer(bp + 8)) += uintptr(nRec)
 179398 				} else {
 179399 					if 0 == sessionMergeUpdate(tls, bp+8, pTab, bPatchset, aExist, uintptr(0), aRec, uintptr(0)) {
 179400 						Xsqlite3_free(tls, pNew)
 179401 						pNew = uintptr(0)
 179402 					}
 179403 				}
 179404 			} else if op2 == SQLITE_UPDATE {
 179405 				*(*uintptr)(unsafe.Pointer(bp + 16)) = aExist
 179406 				*(*uintptr)(unsafe.Pointer(bp + 24)) = aRec
 179407 
 179408 				if bPatchset == 0 {
 179409 					sessionSkipRecord(tls, bp+16, (*SessionTable)(unsafe.Pointer(pTab)).FnCol)
 179410 					sessionSkipRecord(tls, bp+24, (*SessionTable)(unsafe.Pointer(pTab)).FnCol)
 179411 				}
 179412 				(*SessionChange)(unsafe.Pointer(pNew)).Fop = U8(SQLITE_UPDATE)
 179413 				if 0 == sessionMergeUpdate(tls, bp+8, pTab, bPatchset, aRec, aExist, *(*uintptr)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 24))) {
 179414 					Xsqlite3_free(tls, pNew)
 179415 					pNew = uintptr(0)
 179416 				}
 179417 			} else {
 179418 				(*SessionChange)(unsafe.Pointer(pNew)).Fop = U8(SQLITE_DELETE)
 179419 				if bPatchset != 0 {
 179420 					libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), aRec, uint64(nRec))
 179421 					*(*uintptr)(unsafe.Pointer(bp + 8)) += uintptr(nRec)
 179422 				} else {
 179423 					sessionMergeRecord(tls, bp+8, (*SessionTable)(unsafe.Pointer(pTab)).FnCol, aRec, aExist)
 179424 				}
 179425 			}
 179426 
 179427 			if pNew != 0 {
 179428 				(*SessionChange)(unsafe.Pointer(pNew)).FnRecord = int32((int64(*(*uintptr)(unsafe.Pointer(bp + 8))) - int64((*SessionChange)(unsafe.Pointer(pNew)).FaRecord)) / 1)
 179429 			}
 179430 			Xsqlite3_free(tls, pExist)
 179431 		}
 179432 	}
 179433 
 179434 	*(*uintptr)(unsafe.Pointer(ppNew)) = pNew
 179435 	return rc
 179436 }
 179437 
 179438 func sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase int32) int32 {
 179439 	bp := tls.Alloc(56)
 179440 	defer tls.Free(56)
 179441 
 179442 	var rc int32 = SQLITE_OK
 179443 	var pTab uintptr = uintptr(0)
 179444 
 179445 	for SQLITE_ROW == sessionChangesetNext(tls, pIter, bp, bp+8, uintptr(0)) {
 179446 		var iHash int32
 179447 
 179448 		var pExist uintptr = uintptr(0)
 179449 		var pp uintptr
 179450 
 179451 		if (*Sqlite3_changegroup)(unsafe.Pointer(pGrp)).FpList == uintptr(0) {
 179452 			(*Sqlite3_changegroup)(unsafe.Pointer(pGrp)).FbPatch = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset
 179453 		} else if (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset != (*Sqlite3_changegroup)(unsafe.Pointer(pGrp)).FbPatch {
 179454 			rc = SQLITE_ERROR
 179455 			break
 179456 		}
 179457 
 179458 		Xsqlite3changeset_op(tls, pIter, bp+16, bp+24, bp+28, bp+32)
 179459 		if !(pTab != 0) || Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), (*SessionTable)(unsafe.Pointer(pTab)).FzName) != 0 {
 179460 			var nNew int32 = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 16))))
 179461 
 179462 			Xsqlite3changeset_pk(tls, pIter, bp+40, uintptr(0))
 179463 			for pTab = (*Sqlite3_changegroup)(unsafe.Pointer(pGrp)).FpList; pTab != 0; pTab = (*SessionTable)(unsafe.Pointer(pTab)).FpNext {
 179464 				if 0 == Xsqlite3_strnicmp(tls, (*SessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer(bp + 16)), nNew+1) {
 179465 					break
 179466 				}
 179467 			}
 179468 			if !(pTab != 0) {
 179469 				var ppTab uintptr
 179470 
 179471 				pTab = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(SessionTable{}))+uint64(*(*int32)(unsafe.Pointer(bp + 24)))+uint64(nNew)+uint64(1))
 179472 				if !(pTab != 0) {
 179473 					rc = SQLITE_NOMEM
 179474 					break
 179475 				}
 179476 				libc.Xmemset(tls, pTab, 0, uint64(unsafe.Sizeof(SessionTable{})))
 179477 				(*SessionTable)(unsafe.Pointer(pTab)).FnCol = *(*int32)(unsafe.Pointer(bp + 24))
 179478 				(*SessionTable)(unsafe.Pointer(pTab)).FabPK = pTab + 1*56
 179479 				libc.Xmemcpy(tls, (*SessionTable)(unsafe.Pointer(pTab)).FabPK, *(*uintptr)(unsafe.Pointer(bp + 40)), uint64(*(*int32)(unsafe.Pointer(bp + 24))))
 179480 				(*SessionTable)(unsafe.Pointer(pTab)).FzName = (*SessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(*(*int32)(unsafe.Pointer(bp + 24)))
 179481 				libc.Xmemcpy(tls, (*SessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer(bp + 16)), uint64(nNew+1))
 179482 
 179483 				for ppTab = pGrp + 8; *(*uintptr)(unsafe.Pointer(ppTab)) != 0; ppTab = *(*uintptr)(unsafe.Pointer(ppTab)) {
 179484 				}
 179485 				*(*uintptr)(unsafe.Pointer(ppTab)) = pTab
 179486 			} else if (*SessionTable)(unsafe.Pointer(pTab)).FnCol != *(*int32)(unsafe.Pointer(bp + 24)) || libc.Xmemcmp(tls, (*SessionTable)(unsafe.Pointer(pTab)).FabPK, *(*uintptr)(unsafe.Pointer(bp + 40)), uint64(*(*int32)(unsafe.Pointer(bp + 24)))) != 0 {
 179487 				rc = SQLITE_SCHEMA
 179488 				break
 179489 			}
 179490 		}
 179491 
 179492 		if sessionGrowHash(tls, uintptr(0), (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, pTab) != 0 {
 179493 			rc = SQLITE_NOMEM
 179494 			break
 179495 		}
 179496 		iHash = int32(sessionChangeHash(tls,
 179497 			pTab, libc.Bool32((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset != 0 && *(*int32)(unsafe.Pointer(bp + 28)) == SQLITE_DELETE), *(*uintptr)(unsafe.Pointer(bp)), (*SessionTable)(unsafe.Pointer(pTab)).FnChange))
 179498 
 179499 		for pp = (*SessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(iHash)*8; *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = *(*uintptr)(unsafe.Pointer(pp)) + 24 {
 179500 			var bPkOnly1 int32 = 0
 179501 			var bPkOnly2 int32 = 0
 179502 			if (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset != 0 {
 179503 				bPkOnly1 = libc.Bool32(int32((*SessionChange)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).Fop) == SQLITE_DELETE)
 179504 				bPkOnly2 = libc.Bool32(*(*int32)(unsafe.Pointer(bp + 28)) == SQLITE_DELETE)
 179505 			}
 179506 			if sessionChangeEqual(tls, pTab, bPkOnly1, (*SessionChange)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FaRecord, bPkOnly2, *(*uintptr)(unsafe.Pointer(bp))) != 0 {
 179507 				pExist = *(*uintptr)(unsafe.Pointer(pp))
 179508 				*(*uintptr)(unsafe.Pointer(pp)) = (*SessionChange)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FpNext
 179509 				(*SessionTable)(unsafe.Pointer(pTab)).FnEntry--
 179510 				break
 179511 			}
 179512 		}
 179513 
 179514 		rc = sessionChangeMerge(tls, pTab, bRebase,
 179515 			(*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, pExist, *(*int32)(unsafe.Pointer(bp + 28)), *(*int32)(unsafe.Pointer(bp + 32)), *(*uintptr)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 8)), bp+48)
 179516 		if rc != 0 {
 179517 			break
 179518 		}
 179519 		if *(*uintptr)(unsafe.Pointer(bp + 48)) != 0 {
 179520 			(*SessionChange)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48)))).FpNext = *(*uintptr)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(iHash)*8))
 179521 			*(*uintptr)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(iHash)*8)) = *(*uintptr)(unsafe.Pointer(bp + 48))
 179522 			(*SessionTable)(unsafe.Pointer(pTab)).FnEntry++
 179523 		}
 179524 	}
 179525 
 179526 	if rc == SQLITE_OK {
 179527 		rc = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Frc
 179528 	}
 179529 	return rc
 179530 }
 179531 
 179532 func sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) int32 {
 179533 	bp := tls.Alloc(20)
 179534 	defer tls.Free(20)
 179535 
 179536 	*(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_OK
 179537 	*(*SessionBuffer)(unsafe.Pointer(bp)) = SessionBuffer{}
 179538 	var pTab uintptr
 179539 
 179540 	for pTab = (*Sqlite3_changegroup)(unsafe.Pointer(pGrp)).FpList; *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && pTab != 0; pTab = (*SessionTable)(unsafe.Pointer(pTab)).FpNext {
 179541 		var i int32
 179542 		if (*SessionTable)(unsafe.Pointer(pTab)).FnEntry == 0 {
 179543 			continue
 179544 		}
 179545 
 179546 		sessionAppendTableHdr(tls, bp, (*Sqlite3_changegroup)(unsafe.Pointer(pGrp)).FbPatch, pTab, bp+16)
 179547 		for i = 0; i < (*SessionTable)(unsafe.Pointer(pTab)).FnChange; i++ {
 179548 			var p uintptr
 179549 			for p = *(*uintptr)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(i)*8)); p != 0; p = (*SessionChange)(unsafe.Pointer(p)).FpNext {
 179550 				sessionAppendByte(tls, bp, (*SessionChange)(unsafe.Pointer(p)).Fop, bp+16)
 179551 				sessionAppendByte(tls, bp, (*SessionChange)(unsafe.Pointer(p)).FbIndirect, bp+16)
 179552 				sessionAppendBlob(tls, bp, (*SessionChange)(unsafe.Pointer(p)).FaRecord, (*SessionChange)(unsafe.Pointer(p)).FnRecord, bp+16)
 179553 				if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && xOutput != 0 && (*SessionBuffer)(unsafe.Pointer(bp)).FnBuf >= sessions_strm_chunk_size {
 179554 					*(*int32)(unsafe.Pointer(bp + 16)) = (*struct {
 179555 						f func(*libc.TLS, uintptr, uintptr, int32) int32
 179556 					})(unsafe.Pointer(&struct{ uintptr }{xOutput})).f(tls, pOut, (*SessionBuffer)(unsafe.Pointer(bp)).FaBuf, (*SessionBuffer)(unsafe.Pointer(bp)).FnBuf)
 179557 					(*SessionBuffer)(unsafe.Pointer(bp)).FnBuf = 0
 179558 				}
 179559 			}
 179560 		}
 179561 	}
 179562 
 179563 	if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
 179564 		if xOutput != 0 {
 179565 			if (*SessionBuffer)(unsafe.Pointer(bp)).FnBuf > 0 {
 179566 				*(*int32)(unsafe.Pointer(bp + 16)) = (*struct {
 179567 					f func(*libc.TLS, uintptr, uintptr, int32) int32
 179568 				})(unsafe.Pointer(&struct{ uintptr }{xOutput})).f(tls, pOut, (*SessionBuffer)(unsafe.Pointer(bp)).FaBuf, (*SessionBuffer)(unsafe.Pointer(bp)).FnBuf)
 179569 			}
 179570 		} else if ppOut != 0 {
 179571 			*(*uintptr)(unsafe.Pointer(ppOut)) = (*SessionBuffer)(unsafe.Pointer(bp)).FaBuf
 179572 			if pnOut != 0 {
 179573 				*(*int32)(unsafe.Pointer(pnOut)) = (*SessionBuffer)(unsafe.Pointer(bp)).FnBuf
 179574 			}
 179575 			(*SessionBuffer)(unsafe.Pointer(bp)).FaBuf = uintptr(0)
 179576 		}
 179577 	}
 179578 	Xsqlite3_free(tls, (*SessionBuffer)(unsafe.Pointer(bp)).FaBuf)
 179579 
 179580 	return *(*int32)(unsafe.Pointer(bp + 16))
 179581 }
 179582 
 179583 // Allocate a new, empty, sqlite3_changegroup.
 179584 func Xsqlite3changegroup_new(tls *libc.TLS, pp uintptr) int32 {
 179585 	var rc int32 = SQLITE_OK
 179586 	var p uintptr
 179587 	p = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Sqlite3_changegroup{})))
 179588 	if p == uintptr(0) {
 179589 		rc = SQLITE_NOMEM
 179590 	} else {
 179591 		libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Sqlite3_changegroup{})))
 179592 	}
 179593 	*(*uintptr)(unsafe.Pointer(pp)) = p
 179594 	return rc
 179595 }
 179596 
 179597 // Add the changeset currently stored in buffer pData, size nData bytes,
 179598 // to changeset-group p.
 179599 func Xsqlite3changegroup_add(tls *libc.TLS, pGrp uintptr, nData int32, pData uintptr) int32 {
 179600 	bp := tls.Alloc(8)
 179601 	defer tls.Free(8)
 179602 
 179603 	var rc int32
 179604 
 179605 	rc = Xsqlite3changeset_start(tls, bp, nData, pData)
 179606 	if rc == SQLITE_OK {
 179607 		rc = sessionChangesetToHash(tls, *(*uintptr)(unsafe.Pointer(bp)), pGrp, 0)
 179608 	}
 179609 	Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp)))
 179610 	return rc
 179611 }
 179612 
 179613 // Obtain a buffer containing a changeset representing the concatenation
 179614 // of all changesets added to the group so far.
 179615 func Xsqlite3changegroup_output(tls *libc.TLS, pGrp uintptr, pnData uintptr, ppData uintptr) int32 {
 179616 	return sessionChangegroupOutput(tls, pGrp, uintptr(0), uintptr(0), pnData, ppData)
 179617 }
 179618 
 179619 // Streaming versions of changegroup_add().
 179620 func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, pIn uintptr) int32 {
 179621 	bp := tls.Alloc(8)
 179622 	defer tls.Free(8)
 179623 
 179624 	var rc int32
 179625 
 179626 	rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn)
 179627 	if rc == SQLITE_OK {
 179628 		rc = sessionChangesetToHash(tls, *(*uintptr)(unsafe.Pointer(bp)), pGrp, 0)
 179629 	}
 179630 	Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp)))
 179631 	return rc
 179632 }
 179633 
 179634 // Streaming versions of changegroup_output().
 179635 func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr) int32 {
 179636 	return sessionChangegroupOutput(tls, pGrp, xOutput, pOut, uintptr(0), uintptr(0))
 179637 }
 179638 
 179639 // Delete a changegroup object.
 179640 func Xsqlite3changegroup_delete(tls *libc.TLS, pGrp uintptr) {
 179641 	if pGrp != 0 {
 179642 		sessionDeleteTable(tls, uintptr(0), (*Sqlite3_changegroup)(unsafe.Pointer(pGrp)).FpList)
 179643 		Xsqlite3_free(tls, pGrp)
 179644 	}
 179645 }
 179646 
 179647 // Combine two changesets together.
 179648 func Xsqlite3changeset_concat(tls *libc.TLS, nLeft int32, pLeft uintptr, nRight int32, pRight uintptr, pnOut uintptr, ppOut uintptr) int32 {
 179649 	bp := tls.Alloc(8)
 179650 	defer tls.Free(8)
 179651 
 179652 	var rc int32
 179653 
 179654 	rc = Xsqlite3changegroup_new(tls, bp)
 179655 	if rc == SQLITE_OK {
 179656 		rc = Xsqlite3changegroup_add(tls, *(*uintptr)(unsafe.Pointer(bp)), nLeft, pLeft)
 179657 	}
 179658 	if rc == SQLITE_OK {
 179659 		rc = Xsqlite3changegroup_add(tls, *(*uintptr)(unsafe.Pointer(bp)), nRight, pRight)
 179660 	}
 179661 	if rc == SQLITE_OK {
 179662 		rc = Xsqlite3changegroup_output(tls, *(*uintptr)(unsafe.Pointer(bp)), pnOut, ppOut)
 179663 	}
 179664 	Xsqlite3changegroup_delete(tls, *(*uintptr)(unsafe.Pointer(bp)))
 179665 
 179666 	return rc
 179667 }
 179668 
 179669 // Streaming version of sqlite3changeset_concat().
 179670 func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, xInputB uintptr, pInB uintptr, xOutput uintptr, pOut uintptr) int32 {
 179671 	bp := tls.Alloc(8)
 179672 	defer tls.Free(8)
 179673 
 179674 	var rc int32
 179675 
 179676 	rc = Xsqlite3changegroup_new(tls, bp)
 179677 	if rc == SQLITE_OK {
 179678 		rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputA, pInA)
 179679 	}
 179680 	if rc == SQLITE_OK {
 179681 		rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputB, pInB)
 179682 	}
 179683 	if rc == SQLITE_OK {
 179684 		rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut)
 179685 	}
 179686 	Xsqlite3changegroup_delete(tls, *(*uintptr)(unsafe.Pointer(bp)))
 179687 
 179688 	return rc
 179689 }
 179690 
 179691 func sessionAppendRecordMerge(tls *libc.TLS, pBuf uintptr, nCol int32, a1 uintptr, n1 int32, a2 uintptr, n2 int32, pRc uintptr) {
 179692 	sessionBufferGrow(tls, pBuf, int64(n1+n2), pRc)
 179693 	if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
 179694 		var i int32
 179695 		var pOut uintptr = (*SessionBuffer)(unsafe.Pointer(pBuf)).FaBuf + uintptr((*SessionBuffer)(unsafe.Pointer(pBuf)).FnBuf)
 179696 		for i = 0; i < nCol; i++ {
 179697 			var nn1 int32 = sessionSerialLen(tls, a1)
 179698 			var nn2 int32 = sessionSerialLen(tls, a2)
 179699 			if int32(*(*U8)(unsafe.Pointer(a1))) == 0 || int32(*(*U8)(unsafe.Pointer(a1))) == 0xFF {
 179700 				libc.Xmemcpy(tls, pOut, a2, uint64(nn2))
 179701 				pOut += uintptr(nn2)
 179702 			} else {
 179703 				libc.Xmemcpy(tls, pOut, a1, uint64(nn1))
 179704 				pOut += uintptr(nn1)
 179705 			}
 179706 			a1 += uintptr(nn1)
 179707 			a2 += uintptr(nn2)
 179708 		}
 179709 
 179710 		(*SessionBuffer)(unsafe.Pointer(pBuf)).FnBuf = int32((int64(pOut) - int64((*SessionBuffer)(unsafe.Pointer(pBuf)).FaBuf)) / 1)
 179711 
 179712 	}
 179713 }
 179714 
 179715 func sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRec uintptr, nRec int32, aChange uintptr, nChange int32, pRc uintptr) {
 179716 	sessionBufferGrow(tls, pBuf, int64(2+nRec+nChange), pRc)
 179717 	if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
 179718 		var bData int32 = 0
 179719 		var pOut uintptr = (*SessionBuffer)(unsafe.Pointer(pBuf)).FaBuf + uintptr((*SessionBuffer)(unsafe.Pointer(pBuf)).FnBuf)
 179720 		var i int32
 179721 		var a1 uintptr = aRec
 179722 		var a2 uintptr = aChange
 179723 
 179724 		*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pOut, 1))) = U8(SQLITE_UPDATE)
 179725 		*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pOut, 1))) = U8((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect)
 179726 		for i = 0; i < (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol; i++ {
 179727 			var n1 int32 = sessionSerialLen(tls, a1)
 179728 			var n2 int32 = sessionSerialLen(tls, a2)
 179729 			if *(*U8)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FabPK + uintptr(i))) != 0 || int32(*(*U8)(unsafe.Pointer(a2))) == 0 {
 179730 				if !(int32(*(*U8)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FabPK + uintptr(i)))) != 0) && *(*U8)(unsafe.Pointer(a1)) != 0 {
 179731 					bData = 1
 179732 				}
 179733 				libc.Xmemcpy(tls, pOut, a1, uint64(n1))
 179734 				pOut += uintptr(n1)
 179735 			} else if int32(*(*U8)(unsafe.Pointer(a2))) != 0xFF && *(*U8)(unsafe.Pointer(a1)) != 0 {
 179736 				bData = 1
 179737 				libc.Xmemcpy(tls, pOut, a2, uint64(n2))
 179738 				pOut += uintptr(n2)
 179739 			} else {
 179740 				*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pOut, 1))) = U8(0)
 179741 			}
 179742 			a1 += uintptr(n1)
 179743 			a2 += uintptr(n2)
 179744 		}
 179745 		if bData != 0 {
 179746 			a2 = aChange
 179747 			for i = 0; i < (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol; i++ {
 179748 				var n1 int32 = sessionSerialLen(tls, a1)
 179749 				var n2 int32 = sessionSerialLen(tls, a2)
 179750 				if *(*U8)(unsafe.Pointer((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FabPK + uintptr(i))) != 0 || int32(*(*U8)(unsafe.Pointer(a2))) != 0xFF {
 179751 					libc.Xmemcpy(tls, pOut, a1, uint64(n1))
 179752 					pOut += uintptr(n1)
 179753 				} else {
 179754 					*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pOut, 1))) = U8(0)
 179755 				}
 179756 				a1 += uintptr(n1)
 179757 				a2 += uintptr(n2)
 179758 			}
 179759 			(*SessionBuffer)(unsafe.Pointer(pBuf)).FnBuf = int32((int64(pOut) - int64((*SessionBuffer)(unsafe.Pointer(pBuf)).FaBuf)) / 1)
 179760 		}
 179761 	}
 179762 }
 179763 
 179764 func sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) int32 {
 179765 	bp := tls.Alloc(48)
 179766 	defer tls.Free(48)
 179767 
 179768 	*(*int32)(unsafe.Pointer(bp + 32)) = SQLITE_OK
 179769 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 179770 	*(*int32)(unsafe.Pointer(bp + 8)) = 0
 179771 	*(*int32)(unsafe.Pointer(bp + 12)) = 0
 179772 	var pTab uintptr = uintptr(0)
 179773 	*(*SessionBuffer)(unsafe.Pointer(bp + 16)) = SessionBuffer{}
 179774 
 179775 	for SQLITE_ROW == sessionChangesetNext(tls, pIter, bp, bp+8, bp+12) {
 179776 		var pChange uintptr = uintptr(0)
 179777 		var bDone int32 = 0
 179778 
 179779 		if *(*int32)(unsafe.Pointer(bp + 12)) != 0 {
 179780 			var zTab uintptr = (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab
 179781 			for pTab = (*Sqlite3_rebaser)(unsafe.Pointer(p)).Fgrp.FpList; pTab != 0; pTab = (*SessionTable)(unsafe.Pointer(pTab)).FpNext {
 179782 				if 0 == Xsqlite3_stricmp(tls, (*SessionTable)(unsafe.Pointer(pTab)).FzName, zTab) {
 179783 					break
 179784 				}
 179785 			}
 179786 			*(*int32)(unsafe.Pointer(bp + 12)) = 0
 179787 
 179788 			if (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset != 0 {
 179789 				*(*int32)(unsafe.Pointer(bp + 32)) = SQLITE_ERROR
 179790 			}
 179791 
 179792 			sessionAppendByte(tls, bp+16, func() uint8 {
 179793 				if (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset != 0 {
 179794 					return uint8('P')
 179795 				}
 179796 				return uint8('T')
 179797 			}(), bp+32)
 179798 			sessionAppendVarint(tls, bp+16, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol, bp+32)
 179799 			sessionAppendBlob(tls, bp+16, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FabPK, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol, bp+32)
 179800 			sessionAppendBlob(tls, bp+16, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, int32(libc.Xstrlen(tls, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab))+1, bp+32)
 179801 		}
 179802 
 179803 		if pTab != 0 && *(*int32)(unsafe.Pointer(bp + 32)) == SQLITE_OK {
 179804 			var iHash int32 = int32(sessionChangeHash(tls, pTab, 0, *(*uintptr)(unsafe.Pointer(bp)), (*SessionTable)(unsafe.Pointer(pTab)).FnChange))
 179805 
 179806 			for pChange = *(*uintptr)(unsafe.Pointer((*SessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(iHash)*8)); pChange != 0; pChange = (*SessionChange)(unsafe.Pointer(pChange)).FpNext {
 179807 				if sessionChangeEqual(tls, pTab, 0, *(*uintptr)(unsafe.Pointer(bp)), 0, (*SessionChange)(unsafe.Pointer(pChange)).FaRecord) != 0 {
 179808 					break
 179809 				}
 179810 			}
 179811 		}
 179812 
 179813 		if pChange != 0 {
 179814 			switch (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fop {
 179815 			case SQLITE_INSERT:
 179816 				if int32((*SessionChange)(unsafe.Pointer(pChange)).Fop) == SQLITE_INSERT {
 179817 					bDone = 1
 179818 					if int32((*SessionChange)(unsafe.Pointer(pChange)).FbIndirect) == 0 {
 179819 						sessionAppendByte(tls, bp+16, uint8(SQLITE_UPDATE), bp+32)
 179820 						sessionAppendByte(tls, bp+16, uint8((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp+32)
 179821 						sessionAppendBlob(tls, bp+16, (*SessionChange)(unsafe.Pointer(pChange)).FaRecord, (*SessionChange)(unsafe.Pointer(pChange)).FnRecord, bp+32)
 179822 						sessionAppendBlob(tls, bp+16, *(*uintptr)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 8)), bp+32)
 179823 					}
 179824 				}
 179825 				break
 179826 				fallthrough
 179827 
 179828 			case SQLITE_UPDATE:
 179829 				bDone = 1
 179830 				if int32((*SessionChange)(unsafe.Pointer(pChange)).Fop) == SQLITE_DELETE {
 179831 					if int32((*SessionChange)(unsafe.Pointer(pChange)).FbIndirect) == 0 {
 179832 						*(*uintptr)(unsafe.Pointer(bp + 40)) = *(*uintptr)(unsafe.Pointer(bp))
 179833 						sessionSkipRecord(tls, bp+40, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol)
 179834 						sessionAppendByte(tls, bp+16, uint8(SQLITE_INSERT), bp+32)
 179835 						sessionAppendByte(tls, bp+16, uint8((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp+32)
 179836 						sessionAppendRecordMerge(tls, bp+16, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol,
 179837 							*(*uintptr)(unsafe.Pointer(bp + 40)), int32(int64(*(*int32)(unsafe.Pointer(bp + 8)))-(int64(*(*uintptr)(unsafe.Pointer(bp + 40)))-int64(*(*uintptr)(unsafe.Pointer(bp))))/1),
 179838 							(*SessionChange)(unsafe.Pointer(pChange)).FaRecord, (*SessionChange)(unsafe.Pointer(pChange)).FnRecord, bp+32)
 179839 					}
 179840 				} else {
 179841 					sessionAppendPartialUpdate(tls, bp+16, pIter,
 179842 						*(*uintptr)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 8)), (*SessionChange)(unsafe.Pointer(pChange)).FaRecord, (*SessionChange)(unsafe.Pointer(pChange)).FnRecord, bp+32)
 179843 				}
 179844 				break
 179845 				fallthrough
 179846 
 179847 			default:
 179848 				bDone = 1
 179849 				if int32((*SessionChange)(unsafe.Pointer(pChange)).Fop) == SQLITE_INSERT {
 179850 					sessionAppendByte(tls, bp+16, uint8(SQLITE_DELETE), bp+32)
 179851 					sessionAppendByte(tls, bp+16, uint8((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp+32)
 179852 					sessionAppendRecordMerge(tls, bp+16, (*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol,
 179853 						(*SessionChange)(unsafe.Pointer(pChange)).FaRecord, (*SessionChange)(unsafe.Pointer(pChange)).FnRecord, *(*uintptr)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 8)), bp+32)
 179854 				}
 179855 				break
 179856 			}
 179857 		}
 179858 
 179859 		if bDone == 0 {
 179860 			sessionAppendByte(tls, bp+16, uint8((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fop), bp+32)
 179861 			sessionAppendByte(tls, bp+16, uint8((*Sqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp+32)
 179862 			sessionAppendBlob(tls, bp+16, *(*uintptr)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 8)), bp+32)
 179863 		}
 179864 		if *(*int32)(unsafe.Pointer(bp + 32)) == SQLITE_OK && xOutput != 0 && (*SessionBuffer)(unsafe.Pointer(bp+16)).FnBuf > sessions_strm_chunk_size {
 179865 			*(*int32)(unsafe.Pointer(bp + 32)) = (*struct {
 179866 				f func(*libc.TLS, uintptr, uintptr, int32) int32
 179867 			})(unsafe.Pointer(&struct{ uintptr }{xOutput})).f(tls, pOut, (*SessionBuffer)(unsafe.Pointer(bp+16)).FaBuf, (*SessionBuffer)(unsafe.Pointer(bp+16)).FnBuf)
 179868 			(*SessionBuffer)(unsafe.Pointer(bp + 16)).FnBuf = 0
 179869 		}
 179870 		if *(*int32)(unsafe.Pointer(bp + 32)) != 0 {
 179871 			break
 179872 		}
 179873 	}
 179874 
 179875 	if *(*int32)(unsafe.Pointer(bp + 32)) != SQLITE_OK {
 179876 		Xsqlite3_free(tls, (*SessionBuffer)(unsafe.Pointer(bp+16)).FaBuf)
 179877 		libc.Xmemset(tls, bp+16, 0, uint64(unsafe.Sizeof(SessionBuffer{})))
 179878 	}
 179879 
 179880 	if *(*int32)(unsafe.Pointer(bp + 32)) == SQLITE_OK {
 179881 		if xOutput != 0 {
 179882 			if (*SessionBuffer)(unsafe.Pointer(bp+16)).FnBuf > 0 {
 179883 				*(*int32)(unsafe.Pointer(bp + 32)) = (*struct {
 179884 					f func(*libc.TLS, uintptr, uintptr, int32) int32
 179885 				})(unsafe.Pointer(&struct{ uintptr }{xOutput})).f(tls, pOut, (*SessionBuffer)(unsafe.Pointer(bp+16)).FaBuf, (*SessionBuffer)(unsafe.Pointer(bp+16)).FnBuf)
 179886 			}
 179887 		} else if ppOut != 0 {
 179888 			*(*uintptr)(unsafe.Pointer(ppOut)) = (*SessionBuffer)(unsafe.Pointer(bp + 16)).FaBuf
 179889 			*(*int32)(unsafe.Pointer(pnOut)) = (*SessionBuffer)(unsafe.Pointer(bp + 16)).FnBuf
 179890 			(*SessionBuffer)(unsafe.Pointer(bp + 16)).FaBuf = uintptr(0)
 179891 		}
 179892 	}
 179893 	Xsqlite3_free(tls, (*SessionBuffer)(unsafe.Pointer(bp+16)).FaBuf)
 179894 	return *(*int32)(unsafe.Pointer(bp + 32))
 179895 }
 179896 
 179897 // Create a new rebaser object.
 179898 func Xsqlite3rebaser_create(tls *libc.TLS, ppNew uintptr) int32 {
 179899 	var rc int32 = SQLITE_OK
 179900 	var pNew uintptr
 179901 
 179902 	pNew = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Sqlite3_rebaser{})))
 179903 	if pNew == uintptr(0) {
 179904 		rc = SQLITE_NOMEM
 179905 	} else {
 179906 		libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(Sqlite3_rebaser{})))
 179907 	}
 179908 	*(*uintptr)(unsafe.Pointer(ppNew)) = pNew
 179909 	return rc
 179910 }
 179911 
 179912 // Call this one or more times to configure a rebaser.
 179913 func Xsqlite3rebaser_configure(tls *libc.TLS, p uintptr, nRebase int32, pRebase uintptr) int32 {
 179914 	bp := tls.Alloc(8)
 179915 	defer tls.Free(8)
 179916 
 179917 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 179918 	var rc int32
 179919 	rc = Xsqlite3changeset_start(tls, bp, nRebase, pRebase)
 179920 	if rc == SQLITE_OK {
 179921 		rc = sessionChangesetToHash(tls, *(*uintptr)(unsafe.Pointer(bp)), p, 1)
 179922 	}
 179923 	Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp)))
 179924 	return rc
 179925 }
 179926 
 179927 // Rebase a changeset according to current rebaser configuration
 179928 func Xsqlite3rebaser_rebase(tls *libc.TLS, p uintptr, nIn int32, pIn uintptr, pnOut uintptr, ppOut uintptr) int32 {
 179929 	bp := tls.Alloc(8)
 179930 	defer tls.Free(8)
 179931 
 179932 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 179933 	var rc int32 = Xsqlite3changeset_start(tls, bp, nIn, pIn)
 179934 
 179935 	if rc == SQLITE_OK {
 179936 		rc = sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), uintptr(0), uintptr(0), pnOut, ppOut)
 179937 		Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp)))
 179938 	}
 179939 
 179940 	return rc
 179941 }
 179942 
 179943 // Rebase a changeset according to current rebaser configuration
 179944 func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) int32 {
 179945 	bp := tls.Alloc(8)
 179946 	defer tls.Free(8)
 179947 
 179948 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 179949 	var rc int32 = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn)
 179950 
 179951 	if rc == SQLITE_OK {
 179952 		rc = sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut, uintptr(0), uintptr(0))
 179953 		Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp)))
 179954 	}
 179955 
 179956 	return rc
 179957 }
 179958 
 179959 // Destroy a rebaser object
 179960 func Xsqlite3rebaser_delete(tls *libc.TLS, p uintptr) {
 179961 	if p != 0 {
 179962 		sessionDeleteTable(tls, uintptr(0), (*Sqlite3_rebaser)(unsafe.Pointer(p)).Fgrp.FpList)
 179963 		Xsqlite3_free(tls, p)
 179964 	}
 179965 }
 179966 
 179967 // Global configuration
 179968 func Xsqlite3session_config(tls *libc.TLS, op int32, pArg uintptr) int32 {
 179969 	var rc int32 = SQLITE_OK
 179970 	switch op {
 179971 	case SQLITE_SESSION_CONFIG_STRMSIZE:
 179972 		{
 179973 			var pInt uintptr = pArg
 179974 			if *(*int32)(unsafe.Pointer(pInt)) > 0 {
 179975 				sessions_strm_chunk_size = *(*int32)(unsafe.Pointer(pInt))
 179976 			}
 179977 			*(*int32)(unsafe.Pointer(pInt)) = sessions_strm_chunk_size
 179978 			break
 179979 
 179980 		}
 179981 	default:
 179982 		rc = SQLITE_MISUSE
 179983 		break
 179984 	}
 179985 	return rc
 179986 }
 179987 
 179988 type Fts5Global1 = struct {
 179989 	Fapi      Fts5_api
 179990 	Fdb       uintptr
 179991 	FiNextId  I64
 179992 	FpAux     uintptr
 179993 	FpTok     uintptr
 179994 	FpDfltTok uintptr
 179995 	FpCsr     uintptr
 179996 }
 179997 
 179998 type Fts5Global = Fts5Global1
 179999 type Fts5Colset1 = struct {
 180000 	FnCol  int32
 180001 	FaiCol [1]int32
 180002 }
 180003 
 180004 type Fts5Colset = Fts5Colset1
 180005 
 180006 type Fts5Config1 = struct {
 180007 	Fdb               uintptr
 180008 	FzDb              uintptr
 180009 	FzName            uintptr
 180010 	FnCol             int32
 180011 	F__ccgo_pad1      [4]byte
 180012 	FazCol            uintptr
 180013 	FabUnindexed      uintptr
 180014 	FnPrefix          int32
 180015 	F__ccgo_pad2      [4]byte
 180016 	FaPrefix          uintptr
 180017 	FeContent         int32
 180018 	F__ccgo_pad3      [4]byte
 180019 	FzContent         uintptr
 180020 	FzContentRowid    uintptr
 180021 	FbColumnsize      int32
 180022 	FeDetail          int32
 180023 	FzContentExprlist uintptr
 180024 	FpTok             uintptr
 180025 	FpTokApi          uintptr
 180026 	FbLock            int32
 180027 	FePattern         int32
 180028 	FiCookie          int32
 180029 	Fpgsz             int32
 180030 	FnAutomerge       int32
 180031 	FnCrisisMerge     int32
 180032 	FnUsermerge       int32
 180033 	FnHashSize        int32
 180034 	FzRank            uintptr
 180035 	FzRankArgs        uintptr
 180036 	FpzErrmsg         uintptr
 180037 }
 180038 
 180039 type Fts5Config = Fts5Config1
 180040 
 180041 // Buffer object for the incremental building of string data.
 180042 type Fts5Buffer1 = struct {
 180043 	Fp      uintptr
 180044 	Fn      int32
 180045 	FnSpace int32
 180046 }
 180047 
 180048 // Buffer object for the incremental building of string data.
 180049 type Fts5Buffer = Fts5Buffer1
 180050 
 180051 type Fts5PoslistReader1 = struct {
 180052 	Fa           uintptr
 180053 	Fn           int32
 180054 	Fi           int32
 180055 	FbFlag       U8
 180056 	FbEof        U8
 180057 	F__ccgo_pad1 [6]byte
 180058 	FiPos        I64
 180059 }
 180060 
 180061 type Fts5PoslistReader = Fts5PoslistReader1
 180062 
 180063 type Fts5PoslistWriter1 = struct{ FiPrev I64 }
 180064 
 180065 type Fts5PoslistWriter = Fts5PoslistWriter1
 180066 
 180067 // Bucket of terms object used by the integrity-check in offsets=0 mode.
 180068 type Fts5Termset1 = struct{ FapHash [512]uintptr }
 180069 
 180070 // Bucket of terms object used by the integrity-check in offsets=0 mode.
 180071 type Fts5Termset = Fts5Termset1
 180072 
 180073 type Fts5Index1 = struct {
 180074 	FpConfig        uintptr
 180075 	FzDataTbl       uintptr
 180076 	FnWorkUnit      int32
 180077 	F__ccgo_pad1    [4]byte
 180078 	FpHash          uintptr
 180079 	FnPendingData   int32
 180080 	F__ccgo_pad2    [4]byte
 180081 	FiWriteRowid    I64
 180082 	FbDelete        int32
 180083 	Frc             int32
 180084 	FpReader        uintptr
 180085 	FpWriter        uintptr
 180086 	FpDeleter       uintptr
 180087 	FpIdxWriter     uintptr
 180088 	FpIdxDeleter    uintptr
 180089 	FpIdxSelect     uintptr
 180090 	FnRead          int32
 180091 	F__ccgo_pad3    [4]byte
 180092 	FpDataVersion   uintptr
 180093 	FiStructVersion I64
 180094 	FpStruct        uintptr
 180095 }
 180096 
 180097 type Fts5Index = Fts5Index1
 180098 type Fts5IndexIter1 = struct {
 180099 	FiRowid      I64
 180100 	FpData       uintptr
 180101 	FnData       int32
 180102 	FbEof        U8
 180103 	F__ccgo_pad1 [3]byte
 180104 }
 180105 
 180106 type Fts5IndexIter = Fts5IndexIter1
 180107 
 180108 // Virtual-table object.
 180109 type Fts5Table1 = struct {
 180110 	Fbase    Sqlite3_vtab
 180111 	FpConfig uintptr
 180112 	FpIndex  uintptr
 180113 }
 180114 
 180115 // Virtual-table object.
 180116 type Fts5Table = Fts5Table1
 180117 
 180118 // *************************************************************************
 180119 //
 180120 // Interface to code in fts5_hash.c.
 180121 type Fts5Hash1 = struct {
 180122 	FeDetail     int32
 180123 	F__ccgo_pad1 [4]byte
 180124 	FpnByte      uintptr
 180125 	FnEntry      int32
 180126 	FnSlot       int32
 180127 	FpScan       uintptr
 180128 	FaSlot       uintptr
 180129 }
 180130 
 180131 // *************************************************************************
 180132 //
 180133 // Interface to code in fts5_hash.c.
 180134 type Fts5Hash = Fts5Hash1
 180135 
 180136 type Fts5Storage1 = struct {
 180137 	FpConfig      uintptr
 180138 	FpIndex       uintptr
 180139 	FbTotalsValid int32
 180140 	F__ccgo_pad1  [4]byte
 180141 	FnTotalRow    I64
 180142 	FaTotalSize   uintptr
 180143 	FaStmt        [11]uintptr
 180144 }
 180145 
 180146 type Fts5Storage = Fts5Storage1
 180147 
 180148 // *************************************************************************
 180149 //
 180150 // Interface to code in fts5_expr.c.
 180151 type Fts5Expr1 = struct {
 180152 	FpIndex       uintptr
 180153 	FpConfig      uintptr
 180154 	FpRoot        uintptr
 180155 	FbDesc        int32
 180156 	FnPhrase      int32
 180157 	FapExprPhrase uintptr
 180158 }
 180159 
 180160 // *************************************************************************
 180161 //
 180162 // Interface to code in fts5_expr.c.
 180163 type Fts5Expr = Fts5Expr1
 180164 type Fts5ExprNode1 = struct {
 180165 	FeType       int32
 180166 	FbEof        int32
 180167 	FbNomatch    int32
 180168 	F__ccgo_pad1 [4]byte
 180169 	FxNext       uintptr
 180170 	FiRowid      I64
 180171 	FpNear       uintptr
 180172 	FnChild      int32
 180173 	F__ccgo_pad2 [4]byte
 180174 	FapChild     [1]uintptr
 180175 }
 180176 
 180177 type Fts5ExprNode = Fts5ExprNode1
 180178 type Fts5Parse1 = struct {
 180179 	FpConfig      uintptr
 180180 	FzErr         uintptr
 180181 	Frc           int32
 180182 	FnPhrase      int32
 180183 	FapPhrase     uintptr
 180184 	FpExpr        uintptr
 180185 	FbPhraseToAnd int32
 180186 	F__ccgo_pad1  [4]byte
 180187 }
 180188 
 180189 type Fts5Parse = Fts5Parse1
 180190 type Fts5Token1 = struct {
 180191 	Fp           uintptr
 180192 	Fn           int32
 180193 	F__ccgo_pad1 [4]byte
 180194 }
 180195 
 180196 type Fts5Token = Fts5Token1
 180197 type Fts5ExprPhrase1 = struct {
 180198 	FpNode       uintptr
 180199 	Fposlist     Fts5Buffer
 180200 	FnTerm       int32
 180201 	F__ccgo_pad1 [4]byte
 180202 	FaTerm       [1]Fts5ExprTerm
 180203 }
 180204 
 180205 type Fts5ExprPhrase = Fts5ExprPhrase1
 180206 type Fts5ExprNearset1 = struct {
 180207 	FnNear       int32
 180208 	F__ccgo_pad1 [4]byte
 180209 	FpColset     uintptr
 180210 	FnPhrase     int32
 180211 	F__ccgo_pad2 [4]byte
 180212 	FapPhrase    [1]uintptr
 180213 }
 180214 
 180215 type Fts5ExprNearset = Fts5ExprNearset1
 180216 
 180217 type Fts5PoslistPopulator1 = struct {
 180218 	Fwriter Fts5PoslistWriter
 180219 	FbOk    int32
 180220 	FbMiss  int32
 180221 }
 180222 
 180223 type Fts5PoslistPopulator = Fts5PoslistPopulator1
 180224 
 180225 // The next sections is a series of control #defines.
 180226 // various aspects of the generated parser.
 180227 //
 180228 //	fts5YYCODETYPE         is the data type used to store the integer codes
 180229 //	                   that represent terminal and non-terminal symbols.
 180230 //	                   "unsigned char" is used if there are fewer than
 180231 //	                   256 symbols.  Larger types otherwise.
 180232 //	fts5YYNOCODE           is a number of type fts5YYCODETYPE that is not used for
 180233 //	                   any terminal or nonterminal symbol.
 180234 //	fts5YYFALLBACK         If defined, this indicates that one or more tokens
 180235 //	                   (also known as: "terminal symbols") have fall-back
 180236 //	                   values which should be used if the original symbol
 180237 //	                   would not parse.  This permits keywords to sometimes
 180238 //	                   be used as identifiers, for example.
 180239 //	fts5YYACTIONTYPE       is the data type used for "action codes" - numbers
 180240 //	                   that indicate what to do in response to the next
 180241 //	                   token.
 180242 //	sqlite3Fts5ParserFTS5TOKENTYPE     is the data type used for minor type for terminal
 180243 //	                   symbols.  Background: A "minor type" is a semantic
 180244 //	                   value associated with a terminal or non-terminal
 180245 //	                   symbols.  For example, for an "ID" terminal symbol,
 180246 //	                   the minor type might be the name of the identifier.
 180247 //	                   Each non-terminal can have a different minor type.
 180248 //	                   Terminal symbols all have the same minor type, though.
 180249 //	                   This macros defines the minor type for terminal
 180250 //	                   symbols.
 180251 //	fts5YYMINORTYPE        is the data type used for all minor types.
 180252 //	                   This is typically a union of many types, one of
 180253 //	                   which is sqlite3Fts5ParserFTS5TOKENTYPE.  The entry in the union
 180254 //	                   for terminal symbols is called "fts5yy0".
 180255 //	fts5YYSTACKDEPTH       is the maximum depth of the parser's stack.  If
 180256 //	                   zero the stack is dynamically sized using realloc()
 180257 //	sqlite3Fts5ParserARG_SDECL     A static variable declaration for the %extra_argument
 180258 //	sqlite3Fts5ParserARG_PDECL     A parameter declaration for the %extra_argument
 180259 //	sqlite3Fts5ParserARG_PARAM     Code to pass %extra_argument as a subroutine parameter
 180260 //	sqlite3Fts5ParserARG_STORE     Code to store %extra_argument into fts5yypParser
 180261 //	sqlite3Fts5ParserARG_FETCH     Code to extract %extra_argument from fts5yypParser
 180262 //	sqlite3Fts5ParserCTX_*         As sqlite3Fts5ParserARG_ except for %extra_context
 180263 //	fts5YYERRORSYMBOL      is the code number of the error symbol.  If not
 180264 //	                   defined, then do no error processing.
 180265 //	fts5YYNSTATE           the combined number of states.
 180266 //	fts5YYNRULE            the number of rules in the grammar
 180267 //	fts5YYNFTS5TOKEN           Number of terminal symbols
 180268 //	fts5YY_MAX_SHIFT       Maximum value for shift actions
 180269 //	fts5YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions
 180270 //	fts5YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions
 180271 //	fts5YY_ERROR_ACTION    The fts5yy_action[] code for syntax error
 180272 //	fts5YY_ACCEPT_ACTION   The fts5yy_action[] code for accept
 180273 //	fts5YY_NO_ACTION       The fts5yy_action[] code for no-op
 180274 //	fts5YY_MIN_REDUCE      Minimum value for reduce actions
 180275 //	fts5YY_MAX_REDUCE      Maximum value for reduce actions
 180276 //
 180277 // ************ Begin control #defines ****************************************
 180278 type Fts5YYMINORTYPE = struct {
 180279 	F__ccgo_pad1 [0]uint64
 180280 	Ffts5yyinit  int32
 180281 	F__ccgo_pad2 [12]byte
 180282 }
 180283 
 180284 var fts5yy_action = [105]uint8{
 180285 	uint8(81), uint8(20), uint8(96), uint8(6), uint8(28), uint8(99), uint8(98), uint8(26), uint8(26), uint8(18),
 180286 	uint8(96), uint8(6), uint8(28), uint8(17), uint8(98), uint8(56), uint8(26), uint8(19), uint8(96), uint8(6),
 180287 	uint8(28), uint8(14), uint8(98), uint8(14), uint8(26), uint8(31), uint8(92), uint8(96), uint8(6), uint8(28),
 180288 	uint8(108), uint8(98), uint8(25), uint8(26), uint8(21), uint8(96), uint8(6), uint8(28), uint8(78), uint8(98),
 180289 	uint8(58), uint8(26), uint8(29), uint8(96), uint8(6), uint8(28), uint8(107), uint8(98), uint8(22), uint8(26),
 180290 	uint8(24), uint8(16), uint8(12), uint8(11), uint8(1), uint8(13), uint8(13), uint8(24), uint8(16), uint8(23),
 180291 	uint8(11), uint8(33), uint8(34), uint8(13), uint8(97), uint8(8), uint8(27), uint8(32), uint8(98), uint8(7),
 180292 	uint8(26), uint8(3), uint8(4), uint8(5), uint8(3), uint8(4), uint8(5), uint8(3), uint8(83), uint8(4),
 180293 	uint8(5), uint8(3), uint8(63), uint8(5), uint8(3), uint8(62), uint8(12), uint8(2), uint8(86), uint8(13),
 180294 	uint8(9), uint8(30), uint8(10), uint8(10), uint8(54), uint8(57), uint8(75), uint8(78), uint8(78), uint8(53),
 180295 	uint8(57), uint8(15), uint8(82), uint8(82), uint8(71),
 180296 }
 180297 var fts5yy_lookahead = [121]uint8{
 180298 	uint8(16), uint8(17), uint8(18), uint8(19), uint8(20), uint8(22), uint8(22), uint8(24), uint8(24), uint8(17),
 180299 	uint8(18), uint8(19), uint8(20), uint8(7), uint8(22), uint8(9), uint8(24), uint8(17), uint8(18), uint8(19),
 180300 	uint8(20), uint8(9), uint8(22), uint8(9), uint8(24), uint8(13), uint8(17), uint8(18), uint8(19), uint8(20),
 180301 	uint8(26), uint8(22), uint8(24), uint8(24), uint8(17), uint8(18), uint8(19), uint8(20), uint8(15), uint8(22),
 180302 	uint8(9), uint8(24), uint8(17), uint8(18), uint8(19), uint8(20), uint8(26), uint8(22), uint8(21), uint8(24),
 180303 	uint8(6), uint8(7), uint8(9), uint8(9), uint8(10), uint8(12), uint8(12), uint8(6), uint8(7), uint8(21),
 180304 	uint8(9), uint8(24), uint8(25), uint8(12), uint8(18), uint8(5), uint8(20), uint8(14), uint8(22), uint8(5),
 180305 	uint8(24), uint8(3), uint8(1), uint8(2), uint8(3), uint8(1), uint8(2), uint8(3), uint8(0), uint8(1),
 180306 	uint8(2), uint8(3), uint8(11), uint8(2), uint8(3), uint8(11), uint8(9), uint8(10), uint8(5), uint8(12),
 180307 	uint8(23), uint8(24), uint8(10), uint8(10), uint8(8), uint8(9), uint8(9), uint8(15), uint8(15), uint8(8),
 180308 	uint8(9), uint8(9), uint8(27), uint8(27), uint8(11), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27),
 180309 	uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27),
 180310 	uint8(27),
 180311 }
 180312 var fts5yy_shift_ofst = [35]uint8{
 180313 	uint8(44), uint8(44), uint8(44), uint8(44), uint8(44), uint8(44), uint8(51), uint8(77), uint8(43), uint8(12),
 180314 	uint8(14), uint8(83), uint8(82), uint8(14), uint8(23), uint8(23), uint8(31), uint8(31), uint8(71), uint8(74),
 180315 	uint8(78), uint8(81), uint8(86), uint8(91), uint8(6), uint8(53), uint8(53), uint8(60), uint8(64), uint8(68),
 180316 	uint8(53), uint8(87), uint8(92), uint8(53), uint8(93),
 180317 }
 180318 var fts5yy_reduce_ofst = [18]int8{
 180319 	int8(-16), int8(-8), int8(0), int8(9), int8(17), int8(25), int8(46), int8(-17), int8(-17), int8(37),
 180320 	int8(67), int8(4), int8(4), int8(8), int8(4), int8(20), int8(27), int8(38),
 180321 }
 180322 var fts5yy_default = [35]uint8{
 180323 	uint8(80), uint8(80), uint8(80), uint8(80), uint8(80), uint8(80), uint8(95), uint8(80), uint8(80), uint8(105),
 180324 	uint8(80), uint8(110), uint8(110), uint8(80), uint8(110), uint8(110), uint8(80), uint8(80), uint8(80), uint8(80),
 180325 	uint8(80), uint8(91), uint8(80), uint8(80), uint8(80), uint8(101), uint8(100), uint8(80), uint8(80), uint8(90),
 180326 	uint8(103), uint8(80), uint8(80), uint8(104), uint8(80),
 180327 }
 180328 
 180329 type fts5yyStackEntry = struct {
 180330 	Fstateno     uint8
 180331 	Fmajor       uint8
 180332 	F__ccgo_pad1 [6]byte
 180333 	Fminor       Fts5YYMINORTYPE
 180334 }
 180335 
 180336 type Fts5yyStackEntry = fts5yyStackEntry
 180337 
 180338 type fts5yyParser = struct {
 180339 	Ffts5yytos      uintptr
 180340 	FpParse         uintptr
 180341 	Ffts5yystack    [100]Fts5yyStackEntry
 180342 	Ffts5yystackEnd uintptr
 180343 }
 180344 
 180345 type Fts5yyParser = fts5yyParser
 180346 
 180347 func sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) {
 180348 	var fts5yypParser uintptr = fts5yypRawParser
 180349 
 180350 	(*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos = fts5yypParser + 16
 180351 	(*Fts5yyStackEntry)(unsafe.Pointer(fts5yypParser + 16)).Fstateno = uint8(0)
 180352 	(*Fts5yyStackEntry)(unsafe.Pointer(fts5yypParser + 16)).Fmajor = uint8(0)
 180353 	(*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yystackEnd = fts5yypParser + 16 + 99*24
 180354 }
 180355 
 180356 func sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) uintptr {
 180357 	var fts5yypParser uintptr
 180358 	fts5yypParser = (*struct{ f func(*libc.TLS, U64) uintptr })(unsafe.Pointer(&struct{ uintptr }{mallocProc})).f(tls, U64(unsafe.Sizeof(Fts5yyParser{})))
 180359 	if fts5yypParser != 0 {
 180360 		sqlite3Fts5ParserInit(tls, fts5yypParser)
 180361 	}
 180362 	return fts5yypParser
 180363 }
 180364 
 180365 func fts5yy_destructor(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor uint8, fts5yypminor uintptr) {
 180366 	var pParse uintptr = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse
 180367 	_ = pParse
 180368 
 180369 	switch int32(fts5yymajor) {
 180370 	case 16:
 180371 		{
 180372 			_ = pParse
 180373 		}
 180374 		break
 180375 	case 17:
 180376 		fallthrough
 180377 	case 18:
 180378 		fallthrough
 180379 	case 19:
 180380 		{
 180381 			sqlite3Fts5ParseNodeFree(tls, *(*uintptr)(unsafe.Pointer(fts5yypminor)))
 180382 		}
 180383 		break
 180384 	case 20:
 180385 		fallthrough
 180386 	case 21:
 180387 		{
 180388 			Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(fts5yypminor)))
 180389 		}
 180390 		break
 180391 	case 22:
 180392 		fallthrough
 180393 	case 23:
 180394 		{
 180395 			sqlite3Fts5ParseNearsetFree(tls, *(*uintptr)(unsafe.Pointer(fts5yypminor)))
 180396 		}
 180397 		break
 180398 	case 24:
 180399 		{
 180400 			sqlite3Fts5ParsePhraseFree(tls, *(*uintptr)(unsafe.Pointer(fts5yypminor)))
 180401 		}
 180402 		break
 180403 
 180404 	default:
 180405 		break
 180406 	}
 180407 }
 180408 
 180409 func fts5yy_pop_parser_stack(tls *libc.TLS, pParser uintptr) {
 180410 	var fts5yytos uintptr
 180411 
 180412 	fts5yytos = libc.PostDecUintptr(&(*Fts5yyParser)(unsafe.Pointer(pParser)).Ffts5yytos, 24)
 180413 	fts5yy_destructor(tls, pParser, (*Fts5yyStackEntry)(unsafe.Pointer(fts5yytos)).Fmajor, fts5yytos+8)
 180414 }
 180415 
 180416 func sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) {
 180417 	var pParser uintptr = p
 180418 	for (*Fts5yyParser)(unsafe.Pointer(pParser)).Ffts5yytos > pParser+16 {
 180419 		fts5yy_pop_parser_stack(tls, pParser)
 180420 	}
 180421 }
 180422 
 180423 func sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) {
 180424 	if p == uintptr(0) {
 180425 		return
 180426 	}
 180427 	sqlite3Fts5ParserFinalize(tls, p)
 180428 	(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{freeProc})).f(tls, p)
 180429 }
 180430 
 180431 func fts5yy_find_shift_action(tls *libc.TLS, iLookAhead uint8, stateno uint8) uint8 {
 180432 	var i int32
 180433 
 180434 	if int32(stateno) > Fts5YY_MAX_SHIFT {
 180435 		return stateno
 180436 	}
 180437 
 180438 	for __ccgo := true; __ccgo; __ccgo = 1 != 0 {
 180439 		i = int32(fts5yy_shift_ofst[stateno])
 180440 
 180441 		i = i + int32(iLookAhead)
 180442 
 180443 		if int32(fts5yy_lookahead[i]) != int32(iLookAhead) {
 180444 			return fts5yy_default[stateno]
 180445 		} else {
 180446 			return fts5yy_action[i]
 180447 		}
 180448 	}
 180449 	return uint8(0)
 180450 }
 180451 
 180452 func fts5yy_find_reduce_action(tls *libc.TLS, stateno uint8, iLookAhead uint8) uint8 {
 180453 	var i int32
 180454 
 180455 	i = int32(fts5yy_reduce_ofst[stateno])
 180456 
 180457 	i = i + int32(iLookAhead)
 180458 
 180459 	return fts5yy_action[i]
 180460 }
 180461 
 180462 func fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) {
 180463 	var pParse uintptr = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse
 180464 
 180465 	for (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos > fts5yypParser+16 {
 180466 		fts5yy_pop_parser_stack(tls, fts5yypParser)
 180467 	}
 180468 
 180469 	sqlite3Fts5ParseError(tls, pParse, ts+35109, 0)
 180470 
 180471 	(*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse
 180472 
 180473 }
 180474 
 180475 func fts5yy_shift(tls *libc.TLS, fts5yypParser uintptr, fts5yyNewState uint8, fts5yyMajor uint8, fts5yyMinor Fts5Token) {
 180476 	var fts5yytos uintptr
 180477 	(*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos += 24
 180478 	if (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos > (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yystackEnd {
 180479 		(*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos -= 24
 180480 		fts5yyStackOverflow(tls, fts5yypParser)
 180481 		return
 180482 	}
 180483 	if int32(fts5yyNewState) > Fts5YY_MAX_SHIFT {
 180484 		fts5yyNewState = uint8(int32(fts5yyNewState) + (Fts5YY_MIN_REDUCE - Fts5YY_MIN_SHIFTREDUCE))
 180485 	}
 180486 	fts5yytos = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos
 180487 	(*Fts5yyStackEntry)(unsafe.Pointer(fts5yytos)).Fstateno = fts5yyNewState
 180488 	(*Fts5yyStackEntry)(unsafe.Pointer(fts5yytos)).Fmajor = fts5yyMajor
 180489 	*(*Fts5Token)(unsafe.Pointer(fts5yytos + 8)) = fts5yyMinor
 180490 
 180491 }
 180492 
 180493 var fts5yyRuleInfoLhs = [28]uint8{
 180494 	uint8(16),
 180495 	uint8(20),
 180496 	uint8(20),
 180497 	uint8(20),
 180498 	uint8(20),
 180499 	uint8(21),
 180500 	uint8(21),
 180501 	uint8(17),
 180502 	uint8(17),
 180503 	uint8(17),
 180504 	uint8(17),
 180505 	uint8(17),
 180506 	uint8(17),
 180507 	uint8(19),
 180508 	uint8(19),
 180509 	uint8(18),
 180510 	uint8(18),
 180511 	uint8(22),
 180512 	uint8(22),
 180513 	uint8(22),
 180514 	uint8(23),
 180515 	uint8(23),
 180516 	uint8(25),
 180517 	uint8(25),
 180518 	uint8(24),
 180519 	uint8(24),
 180520 	uint8(26),
 180521 	uint8(26),
 180522 }
 180523 
 180524 var fts5yyRuleInfoNRhs = [28]int8{
 180525 	int8(-1),
 180526 	int8(-4),
 180527 	int8(-3),
 180528 	int8(-1),
 180529 	int8(-2),
 180530 	int8(-2),
 180531 	int8(-1),
 180532 	int8(-3),
 180533 	int8(-3),
 180534 	int8(-3),
 180535 	int8(-5),
 180536 	int8(-3),
 180537 	int8(-1),
 180538 	int8(-1),
 180539 	int8(-2),
 180540 	int8(-1),
 180541 	int8(-3),
 180542 	int8(-1),
 180543 	int8(-2),
 180544 	int8(-5),
 180545 	int8(-1),
 180546 	int8(-2),
 180547 	int8(0),
 180548 	int8(-2),
 180549 	int8(-4),
 180550 	int8(-2),
 180551 	int8(-1),
 180552 	int8(0),
 180553 }
 180554 
 180555 func fts5yy_reduce(tls *libc.TLS, fts5yypParser uintptr, fts5yyruleno uint32, fts5yyLookahead int32, fts5yyLookaheadToken Fts5Token) uint8 {
 180556 	bp := tls.Alloc(16)
 180557 	defer tls.Free(16)
 180558 
 180559 	var fts5yygoto int32
 180560 	var fts5yyact uint8
 180561 	var fts5yymsp uintptr
 180562 	var fts5yysize int32
 180563 	var pParse uintptr = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse
 180564 	_ = fts5yyLookahead
 180565 	_ = fts5yyLookaheadToken
 180566 	fts5yymsp = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos
 180567 
 180568 	{
 180569 		switch fts5yyruleno {
 180570 		case uint32(0):
 180571 			{
 180572 				sqlite3Fts5ParseFinished(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + 8)))
 180573 			}
 180574 			break
 180575 		case uint32(1):
 180576 			{
 180577 				*(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-3)*24 + 8)) = sqlite3Fts5ParseColsetInvert(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 180578 			}
 180579 			break
 180580 		case uint32(2):
 180581 			{
 180582 				*(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8))
 180583 			}
 180584 			break
 180585 		case uint32(3):
 180586 			{
 180587 				*(*uintptr)(unsafe.Pointer(bp)) = sqlite3Fts5ParseColset(tls, pParse, uintptr(0), fts5yymsp+8)
 180588 			}
 180589 			*(*uintptr)(unsafe.Pointer(fts5yymsp + 8)) = *(*uintptr)(unsafe.Pointer(bp))
 180590 			break
 180591 		case uint32(4):
 180592 			{
 180593 				*(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = sqlite3Fts5ParseColset(tls, pParse, uintptr(0), fts5yymsp+8)
 180594 				*(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = sqlite3Fts5ParseColsetInvert(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8)))
 180595 			}
 180596 			break
 180597 		case uint32(5):
 180598 			{
 180599 				*(*uintptr)(unsafe.Pointer(bp)) = sqlite3Fts5ParseColset(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8)), fts5yymsp+8)
 180600 			}
 180601 			*(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp))
 180602 			break
 180603 		case uint32(6):
 180604 			{
 180605 				*(*uintptr)(unsafe.Pointer(bp)) = sqlite3Fts5ParseColset(tls, pParse, uintptr(0), fts5yymsp+8)
 180606 			}
 180607 			*(*uintptr)(unsafe.Pointer(fts5yymsp + 8)) = *(*uintptr)(unsafe.Pointer(bp))
 180608 			break
 180609 		case uint32(7):
 180610 			{
 180611 				*(*uintptr)(unsafe.Pointer(bp)) = sqlite3Fts5ParseNode(tls, pParse, FTS5_AND, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*uintptr)(unsafe.Pointer(fts5yymsp + 8)), uintptr(0))
 180612 			}
 180613 			*(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp))
 180614 			break
 180615 		case uint32(8):
 180616 			{
 180617 				*(*uintptr)(unsafe.Pointer(bp)) = sqlite3Fts5ParseNode(tls, pParse, FTS5_OR, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*uintptr)(unsafe.Pointer(fts5yymsp + 8)), uintptr(0))
 180618 			}
 180619 			*(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp))
 180620 			break
 180621 		case uint32(9):
 180622 			{
 180623 				*(*uintptr)(unsafe.Pointer(bp)) = sqlite3Fts5ParseNode(tls, pParse, FTS5_NOT, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8)), *(*uintptr)(unsafe.Pointer(fts5yymsp + 8)), uintptr(0))
 180624 			}
 180625 			*(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp))
 180626 			break
 180627 		case uint32(10):
 180628 			{
 180629 				sqlite3Fts5ParseSetColset(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8)), *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-4)*24 + 8)))
 180630 				*(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8))
 180631 			}
 180632 			*(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp))
 180633 			break
 180634 		case uint32(11):
 180635 			{
 180636 				*(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8))
 180637 			}
 180638 			break
 180639 		case uint32(12):
 180640 			fallthrough
 180641 		case uint32(13):
 180642 			{
 180643 				*(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(fts5yymsp + 8))
 180644 			}
 180645 			*(*uintptr)(unsafe.Pointer(fts5yymsp + 8)) = *(*uintptr)(unsafe.Pointer(bp))
 180646 			break
 180647 		case uint32(14):
 180648 			{
 180649 				*(*uintptr)(unsafe.Pointer(bp)) = sqlite3Fts5ParseImplicitAnd(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8)), *(*uintptr)(unsafe.Pointer(fts5yymsp + 8)))
 180650 			}
 180651 			*(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp))
 180652 			break
 180653 		case uint32(15):
 180654 			{
 180655 				*(*uintptr)(unsafe.Pointer(bp)) = sqlite3Fts5ParseNode(tls, pParse, FTS5_STRING, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(fts5yymsp + 8)))
 180656 			}
 180657 			*(*uintptr)(unsafe.Pointer(fts5yymsp + 8)) = *(*uintptr)(unsafe.Pointer(bp))
 180658 			break
 180659 		case uint32(16):
 180660 			{
 180661 				*(*uintptr)(unsafe.Pointer(bp)) = sqlite3Fts5ParseNode(tls, pParse, FTS5_STRING, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(fts5yymsp + 8)))
 180662 				sqlite3Fts5ParseSetColset(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8)))
 180663 			}
 180664 			*(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp))
 180665 			break
 180666 		case uint32(17):
 180667 			{
 180668 				*(*uintptr)(unsafe.Pointer(bp)) = sqlite3Fts5ParseNearset(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(fts5yymsp + 8)))
 180669 			}
 180670 			*(*uintptr)(unsafe.Pointer(fts5yymsp + 8)) = *(*uintptr)(unsafe.Pointer(bp))
 180671 			break
 180672 		case uint32(18):
 180673 			{
 180674 				sqlite3Fts5ParseSetCaret(tls, *(*uintptr)(unsafe.Pointer(fts5yymsp + 8)))
 180675 				*(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = sqlite3Fts5ParseNearset(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(fts5yymsp + 8)))
 180676 			}
 180677 			break
 180678 		case uint32(19):
 180679 			{
 180680 				sqlite3Fts5ParseNear(tls, pParse, fts5yymsp+libc.UintptrFromInt32(-4)*24+8)
 180681 				sqlite3Fts5ParseSetDistance(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8)), fts5yymsp+libc.UintptrFromInt32(-1)*24+8)
 180682 				*(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8))
 180683 			}
 180684 			*(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-4)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp))
 180685 			break
 180686 		case uint32(20):
 180687 			{
 180688 				*(*uintptr)(unsafe.Pointer(bp)) = sqlite3Fts5ParseNearset(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(fts5yymsp + 8)))
 180689 			}
 180690 			*(*uintptr)(unsafe.Pointer(fts5yymsp + 8)) = *(*uintptr)(unsafe.Pointer(bp))
 180691 			break
 180692 		case uint32(21):
 180693 			{
 180694 				*(*uintptr)(unsafe.Pointer(bp)) = sqlite3Fts5ParseNearset(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8)), *(*uintptr)(unsafe.Pointer(fts5yymsp + 8)))
 180695 			}
 180696 			*(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp))
 180697 			break
 180698 		case uint32(22):
 180699 			{
 180700 				(*Fts5Token)(unsafe.Pointer(fts5yymsp + 1*24 + 8)).Fp = uintptr(0)
 180701 				(*Fts5Token)(unsafe.Pointer(fts5yymsp + 1*24 + 8)).Fn = 0
 180702 			}
 180703 			break
 180704 		case uint32(23):
 180705 			{
 180706 				*(*Fts5Token)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = *(*Fts5Token)(unsafe.Pointer(fts5yymsp + 8))
 180707 			}
 180708 			break
 180709 		case uint32(24):
 180710 			{
 180711 				*(*uintptr)(unsafe.Pointer(bp)) = sqlite3Fts5ParseTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-3)*24 + 8)), fts5yymsp+libc.UintptrFromInt32(-1)*24+8, *(*int32)(unsafe.Pointer(fts5yymsp + 8)))
 180712 			}
 180713 			*(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-3)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp))
 180714 			break
 180715 		case uint32(25):
 180716 			{
 180717 				*(*uintptr)(unsafe.Pointer(bp)) = sqlite3Fts5ParseTerm(tls, pParse, uintptr(0), fts5yymsp+libc.UintptrFromInt32(-1)*24+8, *(*int32)(unsafe.Pointer(fts5yymsp + 8)))
 180718 			}
 180719 			*(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8)) = *(*uintptr)(unsafe.Pointer(bp))
 180720 			break
 180721 		case uint32(26):
 180722 			{
 180723 				*(*int32)(unsafe.Pointer(fts5yymsp + 8)) = 1
 180724 			}
 180725 			break
 180726 		case uint32(27):
 180727 			{
 180728 				*(*int32)(unsafe.Pointer(fts5yymsp + 1*24 + 8)) = 0
 180729 			}
 180730 			break
 180731 		default:
 180732 			break
 180733 
 180734 		}
 180735 	}
 180736 
 180737 	fts5yygoto = int32(fts5yyRuleInfoLhs[fts5yyruleno])
 180738 	fts5yysize = int32(fts5yyRuleInfoNRhs[fts5yyruleno])
 180739 	fts5yyact = fts5yy_find_reduce_action(tls, (*Fts5yyStackEntry)(unsafe.Pointer(fts5yymsp+uintptr(fts5yysize)*24)).Fstateno, uint8(fts5yygoto))
 180740 
 180741 	fts5yymsp += 24 * uintptr(fts5yysize+1)
 180742 	(*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos = fts5yymsp
 180743 	(*Fts5yyStackEntry)(unsafe.Pointer(fts5yymsp)).Fstateno = fts5yyact
 180744 	(*Fts5yyStackEntry)(unsafe.Pointer(fts5yymsp)).Fmajor = uint8(fts5yygoto)
 180745 
 180746 	return fts5yyact
 180747 }
 180748 
 180749 func fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int32, fts5yyminor Fts5Token) {
 180750 	bp := tls.Alloc(16)
 180751 	defer tls.Free(16)
 180752 
 180753 	var pParse uintptr = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse
 180754 
 180755 	_ = fts5yymajor
 180756 	sqlite3Fts5ParseError(tls,
 180757 		pParse, ts+35137, libc.VaList(bp, fts5yyminor.Fn, fts5yyminor.Fp))
 180758 
 180759 	(*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse
 180760 
 180761 }
 180762 
 180763 func fts5yy_accept(tls *libc.TLS, fts5yypParser uintptr) {
 180764 	var pParse uintptr = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse
 180765 
 180766 	(*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse
 180767 
 180768 }
 180769 
 180770 func sqlite3Fts5Parser(tls *libc.TLS, fts5yyp uintptr, fts5yymajor int32, fts5yyminor Fts5Token, pParse uintptr) {
 180771 	bp := tls.Alloc(16)
 180772 	defer tls.Free(16)
 180773 
 180774 	var fts5yyact uint8
 180775 	var fts5yypParser uintptr = fts5yyp
 180776 
 180777 	(*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse
 180778 
 180779 	fts5yyact = (*Fts5yyStackEntry)(unsafe.Pointer((*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos)).Fstateno
 180780 
 180781 	for 1 != 0 {
 180782 		fts5yyact = fts5yy_find_shift_action(tls, uint8(fts5yymajor), fts5yyact)
 180783 		if int32(fts5yyact) >= Fts5YY_MIN_REDUCE {
 180784 			var fts5yyruleno uint32 = uint32(int32(fts5yyact) - Fts5YY_MIN_REDUCE)
 180785 
 180786 			if int32(fts5yyRuleInfoNRhs[fts5yyruleno]) == 0 {
 180787 				if (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos >= (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yystackEnd {
 180788 					fts5yyStackOverflow(tls, fts5yypParser)
 180789 					break
 180790 				}
 180791 			}
 180792 			fts5yyact = fts5yy_reduce(tls, fts5yypParser, fts5yyruleno, fts5yymajor, fts5yyminor)
 180793 		} else if int32(fts5yyact) <= Fts5YY_MAX_SHIFTREDUCE {
 180794 			fts5yy_shift(tls, fts5yypParser, fts5yyact, uint8(fts5yymajor), fts5yyminor)
 180795 			break
 180796 		} else if int32(fts5yyact) == Fts5YY_ACCEPT_ACTION {
 180797 			(*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos -= 24
 180798 			fts5yy_accept(tls, fts5yypParser)
 180799 			return
 180800 		} else {
 180801 			*(*Fts5Token)(unsafe.Pointer(bp)) = fts5yyminor
 180802 
 180803 			fts5yy_syntax_error(tls, fts5yypParser, fts5yymajor, fts5yyminor)
 180804 			fts5yy_destructor(tls, fts5yypParser, uint8(fts5yymajor), bp)
 180805 			break
 180806 		}
 180807 	}
 180808 	return
 180809 }
 180810 
 180811 func sqlite3Fts5ParserFallback(tls *libc.TLS, iToken int32) int32 {
 180812 	_ = iToken
 180813 	return 0
 180814 }
 180815 
 180816 // Object used to iterate through all "coalesced phrase instances" in
 180817 // a single column of the current row. If the phrase instances in the
 180818 // column being considered do not overlap, this object simply iterates
 180819 // through them. Or, if they do overlap (share one or more tokens in
 180820 // common), each set of overlapping instances is treated as a single
 180821 // match. See documentation for the highlight() auxiliary function for
 180822 // details.
 180823 //
 180824 // Usage is:
 180825 //
 180826 //	for(rc = fts5CInstIterNext(pApi, pFts, iCol, &iter);
 180827 //	   (rc==SQLITE_OK && 0==fts5CInstIterEof(&iter);
 180828 //	   rc = fts5CInstIterNext(&iter)
 180829 //	){
 180830 //	  printf("instance starts at %d, ends at %d\n", iter.iStart, iter.iEnd);
 180831 //	}
 180832 type CInstIter1 = struct {
 180833 	FpApi        uintptr
 180834 	FpFts        uintptr
 180835 	FiCol        int32
 180836 	FiInst       int32
 180837 	FnInst       int32
 180838 	FiStart      int32
 180839 	FiEnd        int32
 180840 	F__ccgo_pad1 [4]byte
 180841 }
 180842 
 180843 // Object used to iterate through all "coalesced phrase instances" in
 180844 // a single column of the current row. If the phrase instances in the
 180845 // column being considered do not overlap, this object simply iterates
 180846 // through them. Or, if they do overlap (share one or more tokens in
 180847 // common), each set of overlapping instances is treated as a single
 180848 // match. See documentation for the highlight() auxiliary function for
 180849 // details.
 180850 //
 180851 // Usage is:
 180852 //
 180853 //	for(rc = fts5CInstIterNext(pApi, pFts, iCol, &iter);
 180854 //	   (rc==SQLITE_OK && 0==fts5CInstIterEof(&iter);
 180855 //	   rc = fts5CInstIterNext(&iter)
 180856 //	){
 180857 //	  printf("instance starts at %d, ends at %d\n", iter.iStart, iter.iEnd);
 180858 //	}
 180859 type CInstIter = CInstIter1
 180860 
 180861 func fts5CInstIterNext(tls *libc.TLS, pIter uintptr) int32 {
 180862 	bp := tls.Alloc(12)
 180863 	defer tls.Free(12)
 180864 
 180865 	var rc int32 = SQLITE_OK
 180866 	(*CInstIter)(unsafe.Pointer(pIter)).FiStart = -1
 180867 	(*CInstIter)(unsafe.Pointer(pIter)).FiEnd = -1
 180868 
 180869 	for rc == SQLITE_OK && (*CInstIter)(unsafe.Pointer(pIter)).FiInst < (*CInstIter)(unsafe.Pointer(pIter)).FnInst {
 180870 		rc = (*struct {
 180871 			f func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32
 180872 		})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer((*CInstIter)(unsafe.Pointer(pIter)).FpApi)).FxInst})).f(tls, (*CInstIter)(unsafe.Pointer(pIter)).FpFts, (*CInstIter)(unsafe.Pointer(pIter)).FiInst, bp, bp+4, bp+8)
 180873 		if rc == SQLITE_OK {
 180874 			if *(*int32)(unsafe.Pointer(bp + 4)) == (*CInstIter)(unsafe.Pointer(pIter)).FiCol {
 180875 				var iEnd int32 = *(*int32)(unsafe.Pointer(bp + 8)) - 1 + (*struct {
 180876 					f func(*libc.TLS, uintptr, int32) int32
 180877 				})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer((*CInstIter)(unsafe.Pointer(pIter)).FpApi)).FxPhraseSize})).f(tls, (*CInstIter)(unsafe.Pointer(pIter)).FpFts, *(*int32)(unsafe.Pointer(bp)))
 180878 				if (*CInstIter)(unsafe.Pointer(pIter)).FiStart < 0 {
 180879 					(*CInstIter)(unsafe.Pointer(pIter)).FiStart = *(*int32)(unsafe.Pointer(bp + 8))
 180880 					(*CInstIter)(unsafe.Pointer(pIter)).FiEnd = iEnd
 180881 				} else if *(*int32)(unsafe.Pointer(bp + 8)) <= (*CInstIter)(unsafe.Pointer(pIter)).FiEnd {
 180882 					if iEnd > (*CInstIter)(unsafe.Pointer(pIter)).FiEnd {
 180883 						(*CInstIter)(unsafe.Pointer(pIter)).FiEnd = iEnd
 180884 					}
 180885 				} else {
 180886 					break
 180887 				}
 180888 			}
 180889 			(*CInstIter)(unsafe.Pointer(pIter)).FiInst++
 180890 		}
 180891 	}
 180892 
 180893 	return rc
 180894 }
 180895 
 180896 func fts5CInstIterInit(tls *libc.TLS, pApi uintptr, pFts uintptr, iCol int32, pIter uintptr) int32 {
 180897 	var rc int32
 180898 
 180899 	libc.Xmemset(tls, pIter, 0, uint64(unsafe.Sizeof(CInstIter{})))
 180900 	(*CInstIter)(unsafe.Pointer(pIter)).FpApi = pApi
 180901 	(*CInstIter)(unsafe.Pointer(pIter)).FpFts = pFts
 180902 	(*CInstIter)(unsafe.Pointer(pIter)).FiCol = iCol
 180903 	rc = (*struct {
 180904 		f func(*libc.TLS, uintptr, uintptr) int32
 180905 	})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxInstCount})).f(tls, pFts, pIter+24)
 180906 
 180907 	if rc == SQLITE_OK {
 180908 		rc = fts5CInstIterNext(tls, pIter)
 180909 	}
 180910 
 180911 	return rc
 180912 }
 180913 
 180914 // ************************************************************************
 180915 //
 180916 // Start of highlight() implementation.
 180917 type HighlightContext1 = struct {
 180918 	Fiter        CInstIter
 180919 	FiPos        int32
 180920 	FiRangeStart int32
 180921 	FiRangeEnd   int32
 180922 	F__ccgo_pad1 [4]byte
 180923 	FzOpen       uintptr
 180924 	FzClose      uintptr
 180925 	FzIn         uintptr
 180926 	FnIn         int32
 180927 	FiOff        int32
 180928 	FzOut        uintptr
 180929 }
 180930 
 180931 // ************************************************************************
 180932 //
 180933 // Start of highlight() implementation.
 180934 type HighlightContext = HighlightContext1
 180935 
 180936 func fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n int32) {
 180937 	bp := tls.Alloc(24)
 180938 	defer tls.Free(24)
 180939 
 180940 	if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK && z != 0 {
 180941 		if n < 0 {
 180942 			n = int32(libc.Xstrlen(tls, z))
 180943 		}
 180944 		(*HighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, ts+35168, libc.VaList(bp, (*HighlightContext)(unsafe.Pointer(p)).FzOut, n, z))
 180945 		if (*HighlightContext)(unsafe.Pointer(p)).FzOut == uintptr(0) {
 180946 			*(*int32)(unsafe.Pointer(pRc)) = SQLITE_NOMEM
 180947 		}
 180948 	}
 180949 }
 180950 
 180951 func fts5HighlightCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iStartOff int32, iEndOff int32) int32 {
 180952 	bp := tls.Alloc(4)
 180953 	defer tls.Free(4)
 180954 
 180955 	var p uintptr = pContext
 180956 	*(*int32)(unsafe.Pointer(bp)) = SQLITE_OK
 180957 	var iPos int32
 180958 
 180959 	_ = pToken
 180960 	_ = nToken
 180961 
 180962 	if tflags&FTS5_TOKEN_COLOCATED != 0 {
 180963 		return SQLITE_OK
 180964 	}
 180965 	iPos = libc.PostIncInt32(&(*HighlightContext)(unsafe.Pointer(p)).FiPos, 1)
 180966 
 180967 	if (*HighlightContext)(unsafe.Pointer(p)).FiRangeEnd > 0 {
 180968 		if iPos < (*HighlightContext)(unsafe.Pointer(p)).FiRangeStart || iPos > (*HighlightContext)(unsafe.Pointer(p)).FiRangeEnd {
 180969 			return SQLITE_OK
 180970 		}
 180971 		if (*HighlightContext)(unsafe.Pointer(p)).FiRangeStart != 0 && iPos == (*HighlightContext)(unsafe.Pointer(p)).FiRangeStart {
 180972 			(*HighlightContext)(unsafe.Pointer(p)).FiOff = iStartOff
 180973 		}
 180974 	}
 180975 
 180976 	if iPos == (*HighlightContext)(unsafe.Pointer(p)).Fiter.FiStart {
 180977 		fts5HighlightAppend(tls, bp, p, (*HighlightContext)(unsafe.Pointer(p)).FzIn+uintptr((*HighlightContext)(unsafe.Pointer(p)).FiOff), iStartOff-(*HighlightContext)(unsafe.Pointer(p)).FiOff)
 180978 		fts5HighlightAppend(tls, bp, p, (*HighlightContext)(unsafe.Pointer(p)).FzOpen, -1)
 180979 		(*HighlightContext)(unsafe.Pointer(p)).FiOff = iStartOff
 180980 	}
 180981 
 180982 	if iPos == (*HighlightContext)(unsafe.Pointer(p)).Fiter.FiEnd {
 180983 		if (*HighlightContext)(unsafe.Pointer(p)).FiRangeEnd != 0 && (*HighlightContext)(unsafe.Pointer(p)).Fiter.FiStart < (*HighlightContext)(unsafe.Pointer(p)).FiRangeStart {
 180984 			fts5HighlightAppend(tls, bp, p, (*HighlightContext)(unsafe.Pointer(p)).FzOpen, -1)
 180985 		}
 180986 		fts5HighlightAppend(tls, bp, p, (*HighlightContext)(unsafe.Pointer(p)).FzIn+uintptr((*HighlightContext)(unsafe.Pointer(p)).FiOff), iEndOff-(*HighlightContext)(unsafe.Pointer(p)).FiOff)
 180987 		fts5HighlightAppend(tls, bp, p, (*HighlightContext)(unsafe.Pointer(p)).FzClose, -1)
 180988 		(*HighlightContext)(unsafe.Pointer(p)).FiOff = iEndOff
 180989 		if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
 180990 			*(*int32)(unsafe.Pointer(bp)) = fts5CInstIterNext(tls, p)
 180991 		}
 180992 	}
 180993 
 180994 	if (*HighlightContext)(unsafe.Pointer(p)).FiRangeEnd > 0 && iPos == (*HighlightContext)(unsafe.Pointer(p)).FiRangeEnd {
 180995 		fts5HighlightAppend(tls, bp, p, (*HighlightContext)(unsafe.Pointer(p)).FzIn+uintptr((*HighlightContext)(unsafe.Pointer(p)).FiOff), iEndOff-(*HighlightContext)(unsafe.Pointer(p)).FiOff)
 180996 		(*HighlightContext)(unsafe.Pointer(p)).FiOff = iEndOff
 180997 		if iPos >= (*HighlightContext)(unsafe.Pointer(p)).Fiter.FiStart && iPos < (*HighlightContext)(unsafe.Pointer(p)).Fiter.FiEnd {
 180998 			fts5HighlightAppend(tls, bp, p, (*HighlightContext)(unsafe.Pointer(p)).FzClose, -1)
 180999 		}
 181000 	}
 181001 
 181002 	return *(*int32)(unsafe.Pointer(bp))
 181003 }
 181004 
 181005 func fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) {
 181006 	bp := tls.Alloc(100)
 181007 	defer tls.Free(100)
 181008 
 181009 	var iCol int32
 181010 
 181011 	if nVal != 3 {
 181012 		var zErr uintptr = ts + 35175
 181013 		Xsqlite3_result_error(tls, pCtx, zErr, -1)
 181014 		return
 181015 	}
 181016 
 181017 	iCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal)))
 181018 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(HighlightContext{})))
 181019 	(*HighlightContext)(unsafe.Pointer(bp)).FzOpen = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*8)))
 181020 	(*HighlightContext)(unsafe.Pointer(bp)).FzClose = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + 2*8)))
 181021 	*(*int32)(unsafe.Pointer(bp + 96)) = (*struct {
 181022 		f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
 181023 	})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnText})).f(tls, pFts, iCol, bp+72, bp+80)
 181024 
 181025 	if (*HighlightContext)(unsafe.Pointer(bp)).FzIn != 0 {
 181026 		if *(*int32)(unsafe.Pointer(bp + 96)) == SQLITE_OK {
 181027 			*(*int32)(unsafe.Pointer(bp + 96)) = fts5CInstIterInit(tls, pApi, pFts, iCol, bp)
 181028 		}
 181029 
 181030 		if *(*int32)(unsafe.Pointer(bp + 96)) == SQLITE_OK {
 181031 			*(*int32)(unsafe.Pointer(bp + 96)) = (*struct {
 181032 				f func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32
 181033 			})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxTokenize})).f(tls, pFts, (*HighlightContext)(unsafe.Pointer(bp)).FzIn, (*HighlightContext)(unsafe.Pointer(bp)).FnIn, bp, *(*uintptr)(unsafe.Pointer(&struct {
 181034 				f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
 181035 			}{fts5HighlightCb})))
 181036 		}
 181037 		fts5HighlightAppend(tls, bp+96, bp, (*HighlightContext)(unsafe.Pointer(bp)).FzIn+uintptr((*HighlightContext)(unsafe.Pointer(bp)).FiOff), (*HighlightContext)(unsafe.Pointer(bp)).FnIn-(*HighlightContext)(unsafe.Pointer(bp)).FiOff)
 181038 
 181039 		if *(*int32)(unsafe.Pointer(bp + 96)) == SQLITE_OK {
 181040 			Xsqlite3_result_text(tls, pCtx, (*HighlightContext)(unsafe.Pointer(bp)).FzOut, -1, libc.UintptrFromInt32(-1))
 181041 		}
 181042 		Xsqlite3_free(tls, (*HighlightContext)(unsafe.Pointer(bp)).FzOut)
 181043 	}
 181044 	if *(*int32)(unsafe.Pointer(bp + 96)) != SQLITE_OK {
 181045 		Xsqlite3_result_error_code(tls, pCtx, *(*int32)(unsafe.Pointer(bp + 96)))
 181046 	}
 181047 }
 181048 
 181049 // Context object passed to the fts5SentenceFinderCb() function.
 181050 type Fts5SFinder1 = struct {
 181051 	FiPos        int32
 181052 	FnFirstAlloc int32
 181053 	FnFirst      int32
 181054 	F__ccgo_pad1 [4]byte
 181055 	FaFirst      uintptr
 181056 	FzDoc        uintptr
 181057 }
 181058 
 181059 // Context object passed to the fts5SentenceFinderCb() function.
 181060 type Fts5SFinder = Fts5SFinder1
 181061 
 181062 func fts5SentenceFinderAdd(tls *libc.TLS, p uintptr, iAdd int32) int32 {
 181063 	if (*Fts5SFinder)(unsafe.Pointer(p)).FnFirstAlloc == (*Fts5SFinder)(unsafe.Pointer(p)).FnFirst {
 181064 		var nNew int32
 181065 		if (*Fts5SFinder)(unsafe.Pointer(p)).FnFirstAlloc != 0 {
 181066 			nNew = (*Fts5SFinder)(unsafe.Pointer(p)).FnFirstAlloc * 2
 181067 		} else {
 181068 			nNew = 64
 181069 		}
 181070 		var aNew uintptr
 181071 
 181072 		aNew = Xsqlite3_realloc64(tls, (*Fts5SFinder)(unsafe.Pointer(p)).FaFirst, uint64(nNew)*uint64(unsafe.Sizeof(int32(0))))
 181073 		if aNew == uintptr(0) {
 181074 			return SQLITE_NOMEM
 181075 		}
 181076 		(*Fts5SFinder)(unsafe.Pointer(p)).FaFirst = aNew
 181077 		(*Fts5SFinder)(unsafe.Pointer(p)).FnFirstAlloc = nNew
 181078 	}
 181079 	*(*int32)(unsafe.Pointer((*Fts5SFinder)(unsafe.Pointer(p)).FaFirst + uintptr(libc.PostIncInt32(&(*Fts5SFinder)(unsafe.Pointer(p)).FnFirst, 1))*4)) = iAdd
 181080 	return SQLITE_OK
 181081 }
 181082 
 181083 func fts5SentenceFinderCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iStartOff int32, iEndOff int32) int32 {
 181084 	var rc int32 = SQLITE_OK
 181085 
 181086 	_ = pToken
 181087 	_ = nToken
 181088 	_ = iEndOff
 181089 
 181090 	if tflags&FTS5_TOKEN_COLOCATED == 0 {
 181091 		var p uintptr = pContext
 181092 		if (*Fts5SFinder)(unsafe.Pointer(p)).FiPos > 0 {
 181093 			var i int32
 181094 			var c int8 = int8(0)
 181095 			for i = iStartOff - 1; i >= 0; i-- {
 181096 				c = *(*int8)(unsafe.Pointer((*Fts5SFinder)(unsafe.Pointer(p)).FzDoc + uintptr(i)))
 181097 				if int32(c) != ' ' && int32(c) != '\t' && int32(c) != '\n' && int32(c) != '\r' {
 181098 					break
 181099 				}
 181100 			}
 181101 			if i != iStartOff-1 && (int32(c) == '.' || int32(c) == ':') {
 181102 				rc = fts5SentenceFinderAdd(tls, p, (*Fts5SFinder)(unsafe.Pointer(p)).FiPos)
 181103 			}
 181104 		} else {
 181105 			rc = fts5SentenceFinderAdd(tls, p, 0)
 181106 		}
 181107 		(*Fts5SFinder)(unsafe.Pointer(p)).FiPos++
 181108 	}
 181109 	return rc
 181110 }
 181111 
 181112 func fts5SnippetScore(tls *libc.TLS, pApi uintptr, pFts uintptr, nDocsize int32, aSeen uintptr, iCol int32, iPos int32, nToken int32, pnScore uintptr, piPos uintptr) int32 {
 181113 	bp := tls.Alloc(16)
 181114 	defer tls.Free(16)
 181115 
 181116 	var rc int32
 181117 	var i int32
 181118 	*(*int32)(unsafe.Pointer(bp + 4)) = 0
 181119 	*(*int32)(unsafe.Pointer(bp + 8)) = 0
 181120 	*(*int32)(unsafe.Pointer(bp + 12)) = 0
 181121 	var iFirst int32 = -1
 181122 
 181123 	var nScore int32 = 0
 181124 	var iLast int32 = 0
 181125 	var iEnd Sqlite3_int64 = Sqlite3_int64(iPos) + Sqlite3_int64(nToken)
 181126 
 181127 	rc = (*struct {
 181128 		f func(*libc.TLS, uintptr, uintptr) int32
 181129 	})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxInstCount})).f(tls, pFts, bp)
 181130 	for i = 0; i < *(*int32)(unsafe.Pointer(bp)) && rc == SQLITE_OK; i++ {
 181131 		rc = (*struct {
 181132 			f func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32
 181133 		})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxInst})).f(tls, pFts, i, bp+4, bp+8, bp+12)
 181134 		if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8)) == iCol && *(*int32)(unsafe.Pointer(bp + 12)) >= iPos && Sqlite3_int64(*(*int32)(unsafe.Pointer(bp + 12))) < iEnd {
 181135 			nScore = nScore + func() int32 {
 181136 				if *(*uint8)(unsafe.Pointer(aSeen + uintptr(*(*int32)(unsafe.Pointer(bp + 4))))) != 0 {
 181137 					return 1
 181138 				}
 181139 				return 1000
 181140 			}()
 181141 			*(*uint8)(unsafe.Pointer(aSeen + uintptr(*(*int32)(unsafe.Pointer(bp + 4))))) = uint8(1)
 181142 			if iFirst < 0 {
 181143 				iFirst = *(*int32)(unsafe.Pointer(bp + 12))
 181144 			}
 181145 			iLast = *(*int32)(unsafe.Pointer(bp + 12)) + (*struct {
 181146 				f func(*libc.TLS, uintptr, int32) int32
 181147 			})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxPhraseSize})).f(tls, pFts, *(*int32)(unsafe.Pointer(bp + 4)))
 181148 		}
 181149 	}
 181150 
 181151 	*(*int32)(unsafe.Pointer(pnScore)) = nScore
 181152 	if piPos != 0 {
 181153 		var iAdj Sqlite3_int64 = Sqlite3_int64(iFirst - (nToken-(iLast-iFirst))/2)
 181154 		if iAdj+Sqlite3_int64(nToken) > Sqlite3_int64(nDocsize) {
 181155 			iAdj = Sqlite3_int64(nDocsize - nToken)
 181156 		}
 181157 		if iAdj < int64(0) {
 181158 			iAdj = int64(0)
 181159 		}
 181160 		*(*int32)(unsafe.Pointer(piPos)) = int32(iAdj)
 181161 	}
 181162 
 181163 	return rc
 181164 }
 181165 
 181166 func fts5ValueToText(tls *libc.TLS, pVal uintptr) uintptr {
 181167 	var zRet uintptr = Xsqlite3_value_text(tls, pVal)
 181168 	if zRet != 0 {
 181169 		return zRet
 181170 	}
 181171 	return ts + 1544
 181172 }
 181173 
 181174 func fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) {
 181175 	bp := tls.Alloc(172)
 181176 	defer tls.Free(172)
 181177 
 181178 	*(*int32)(unsafe.Pointer(bp + 168)) = SQLITE_OK
 181179 	var iCol int32
 181180 	var zEllips uintptr
 181181 	var nToken int32
 181182 	*(*int32)(unsafe.Pointer(bp + 96)) = 0
 181183 	var i int32
 181184 	var nPhrase int32
 181185 	var aSeen uintptr
 181186 	var iBestCol int32
 181187 	var iBestStart int32 = 0
 181188 	var nBestScore int32 = 0
 181189 	*(*int32)(unsafe.Pointer(bp + 164)) = 0
 181190 
 181191 	var nCol int32
 181192 
 181193 	if nVal != 5 {
 181194 		var zErr uintptr = ts + 35225
 181195 		Xsqlite3_result_error(tls, pCtx, zErr, -1)
 181196 		return
 181197 	}
 181198 
 181199 	nCol = (*struct {
 181200 		f func(*libc.TLS, uintptr) int32
 181201 	})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnCount})).f(tls, pFts)
 181202 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(HighlightContext{})))
 181203 	iCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal)))
 181204 	(*HighlightContext)(unsafe.Pointer(bp)).FzOpen = fts5ValueToText(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*8)))
 181205 	(*HighlightContext)(unsafe.Pointer(bp)).FzClose = fts5ValueToText(tls, *(*uintptr)(unsafe.Pointer(apVal + 2*8)))
 181206 	zEllips = fts5ValueToText(tls, *(*uintptr)(unsafe.Pointer(apVal + 3*8)))
 181207 	nToken = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal + 4*8)))
 181208 
 181209 	iBestCol = func() int32 {
 181210 		if iCol >= 0 {
 181211 			return iCol
 181212 		}
 181213 		return 0
 181214 	}()
 181215 	nPhrase = (*struct {
 181216 		f func(*libc.TLS, uintptr) int32
 181217 	})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxPhraseCount})).f(tls, pFts)
 181218 	aSeen = Xsqlite3_malloc(tls, nPhrase)
 181219 	if aSeen == uintptr(0) {
 181220 		*(*int32)(unsafe.Pointer(bp + 168)) = SQLITE_NOMEM
 181221 	}
 181222 	if *(*int32)(unsafe.Pointer(bp + 168)) == SQLITE_OK {
 181223 		*(*int32)(unsafe.Pointer(bp + 168)) = (*struct {
 181224 			f func(*libc.TLS, uintptr, uintptr) int32
 181225 		})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxInstCount})).f(tls, pFts, bp+96)
 181226 	}
 181227 
 181228 	libc.Xmemset(tls, bp+104, 0, uint64(unsafe.Sizeof(Fts5SFinder{})))
 181229 	for i = 0; i < nCol; i++ {
 181230 		if iCol < 0 || iCol == i {
 181231 			var ii int32
 181232 			(*Fts5SFinder)(unsafe.Pointer(bp + 104)).FiPos = 0
 181233 			(*Fts5SFinder)(unsafe.Pointer(bp + 104)).FnFirst = 0
 181234 			*(*int32)(unsafe.Pointer(bp + 168)) = (*struct {
 181235 				f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
 181236 			})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnText})).f(tls, pFts, i, bp+104+24, bp+136)
 181237 			if *(*int32)(unsafe.Pointer(bp + 168)) != SQLITE_OK {
 181238 				break
 181239 			}
 181240 			*(*int32)(unsafe.Pointer(bp + 168)) = (*struct {
 181241 				f func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32
 181242 			})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxTokenize})).f(tls, pFts,
 181243 				(*Fts5SFinder)(unsafe.Pointer(bp+104)).FzDoc, *(*int32)(unsafe.Pointer(bp + 136)), bp+104, *(*uintptr)(unsafe.Pointer(&struct {
 181244 					f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
 181245 				}{fts5SentenceFinderCb})))
 181246 			if *(*int32)(unsafe.Pointer(bp + 168)) != SQLITE_OK {
 181247 				break
 181248 			}
 181249 			*(*int32)(unsafe.Pointer(bp + 168)) = (*struct {
 181250 				f func(*libc.TLS, uintptr, int32, uintptr) int32
 181251 			})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnSize})).f(tls, pFts, i, bp+140)
 181252 			if *(*int32)(unsafe.Pointer(bp + 168)) != SQLITE_OK {
 181253 				break
 181254 			}
 181255 
 181256 			for ii = 0; *(*int32)(unsafe.Pointer(bp + 168)) == SQLITE_OK && ii < *(*int32)(unsafe.Pointer(bp + 96)); ii++ {
 181257 				var jj int32
 181258 
 181259 				*(*int32)(unsafe.Pointer(bp + 168)) = (*struct {
 181260 					f func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32
 181261 				})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxInst})).f(tls, pFts, ii, bp+144, bp+148, bp+152)
 181262 				if *(*int32)(unsafe.Pointer(bp + 148)) != i {
 181263 					continue
 181264 				}
 181265 				if *(*int32)(unsafe.Pointer(bp + 152)) > *(*int32)(unsafe.Pointer(bp + 140)) {
 181266 					*(*int32)(unsafe.Pointer(bp + 168)) = SQLITE_CORRUPT | int32(1)<<8
 181267 				}
 181268 				if *(*int32)(unsafe.Pointer(bp + 168)) != SQLITE_OK {
 181269 					continue
 181270 				}
 181271 				libc.Xmemset(tls, aSeen, 0, uint64(nPhrase))
 181272 				*(*int32)(unsafe.Pointer(bp + 168)) = fts5SnippetScore(tls, pApi, pFts, *(*int32)(unsafe.Pointer(bp + 140)), aSeen, i,
 181273 					*(*int32)(unsafe.Pointer(bp + 152)), nToken, bp+156, bp+160)
 181274 				if *(*int32)(unsafe.Pointer(bp + 168)) == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 156)) > nBestScore {
 181275 					nBestScore = *(*int32)(unsafe.Pointer(bp + 156))
 181276 					iBestCol = i
 181277 					iBestStart = *(*int32)(unsafe.Pointer(bp + 160))
 181278 					*(*int32)(unsafe.Pointer(bp + 164)) = *(*int32)(unsafe.Pointer(bp + 140))
 181279 				}
 181280 
 181281 				if *(*int32)(unsafe.Pointer(bp + 168)) == SQLITE_OK && (*Fts5SFinder)(unsafe.Pointer(bp+104)).FnFirst != 0 && *(*int32)(unsafe.Pointer(bp + 140)) > nToken {
 181282 					for jj = 0; jj < (*Fts5SFinder)(unsafe.Pointer(bp+104)).FnFirst-1; jj++ {
 181283 						if *(*int32)(unsafe.Pointer((*Fts5SFinder)(unsafe.Pointer(bp+104)).FaFirst + uintptr(jj+1)*4)) > *(*int32)(unsafe.Pointer(bp + 152)) {
 181284 							break
 181285 						}
 181286 					}
 181287 
 181288 					if *(*int32)(unsafe.Pointer((*Fts5SFinder)(unsafe.Pointer(bp+104)).FaFirst + uintptr(jj)*4)) < *(*int32)(unsafe.Pointer(bp + 152)) {
 181289 						libc.Xmemset(tls, aSeen, 0, uint64(nPhrase))
 181290 						*(*int32)(unsafe.Pointer(bp + 168)) = fts5SnippetScore(tls, pApi, pFts, *(*int32)(unsafe.Pointer(bp + 140)), aSeen, i,
 181291 							*(*int32)(unsafe.Pointer((*Fts5SFinder)(unsafe.Pointer(bp+104)).FaFirst + uintptr(jj)*4)), nToken, bp+156, uintptr(0))
 181292 
 181293 						*(*int32)(unsafe.Pointer(bp + 156)) += func() int32 {
 181294 							if *(*int32)(unsafe.Pointer((*Fts5SFinder)(unsafe.Pointer(bp+104)).FaFirst + uintptr(jj)*4)) == 0 {
 181295 								return 120
 181296 							}
 181297 							return 100
 181298 						}()
 181299 						if *(*int32)(unsafe.Pointer(bp + 168)) == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 156)) > nBestScore {
 181300 							nBestScore = *(*int32)(unsafe.Pointer(bp + 156))
 181301 							iBestCol = i
 181302 							iBestStart = *(*int32)(unsafe.Pointer((*Fts5SFinder)(unsafe.Pointer(bp+104)).FaFirst + uintptr(jj)*4))
 181303 							*(*int32)(unsafe.Pointer(bp + 164)) = *(*int32)(unsafe.Pointer(bp + 140))
 181304 						}
 181305 					}
 181306 				}
 181307 			}
 181308 		}
 181309 	}
 181310 
 181311 	if *(*int32)(unsafe.Pointer(bp + 168)) == SQLITE_OK {
 181312 		*(*int32)(unsafe.Pointer(bp + 168)) = (*struct {
 181313 			f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
 181314 		})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnText})).f(tls, pFts, iBestCol, bp+72, bp+80)
 181315 	}
 181316 	if *(*int32)(unsafe.Pointer(bp + 168)) == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 164)) == 0 {
 181317 		*(*int32)(unsafe.Pointer(bp + 168)) = (*struct {
 181318 			f func(*libc.TLS, uintptr, int32, uintptr) int32
 181319 		})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnSize})).f(tls, pFts, iBestCol, bp+164)
 181320 	}
 181321 	if (*HighlightContext)(unsafe.Pointer(bp)).FzIn != 0 {
 181322 		if *(*int32)(unsafe.Pointer(bp + 168)) == SQLITE_OK {
 181323 			*(*int32)(unsafe.Pointer(bp + 168)) = fts5CInstIterInit(tls, pApi, pFts, iBestCol, bp)
 181324 		}
 181325 
 181326 		(*HighlightContext)(unsafe.Pointer(bp)).FiRangeStart = iBestStart
 181327 		(*HighlightContext)(unsafe.Pointer(bp)).FiRangeEnd = iBestStart + nToken - 1
 181328 
 181329 		if iBestStart > 0 {
 181330 			fts5HighlightAppend(tls, bp+168, bp, zEllips, -1)
 181331 		}
 181332 
 181333 		for (*HighlightContext)(unsafe.Pointer(bp)).Fiter.FiStart >= 0 && (*HighlightContext)(unsafe.Pointer(bp)).Fiter.FiStart < iBestStart && *(*int32)(unsafe.Pointer(bp + 168)) == SQLITE_OK {
 181334 			*(*int32)(unsafe.Pointer(bp + 168)) = fts5CInstIterNext(tls, bp)
 181335 		}
 181336 
 181337 		if *(*int32)(unsafe.Pointer(bp + 168)) == SQLITE_OK {
 181338 			*(*int32)(unsafe.Pointer(bp + 168)) = (*struct {
 181339 				f func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32
 181340 			})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxTokenize})).f(tls, pFts, (*HighlightContext)(unsafe.Pointer(bp)).FzIn, (*HighlightContext)(unsafe.Pointer(bp)).FnIn, bp, *(*uintptr)(unsafe.Pointer(&struct {
 181341 				f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
 181342 			}{fts5HighlightCb})))
 181343 		}
 181344 		if (*HighlightContext)(unsafe.Pointer(bp)).FiRangeEnd >= *(*int32)(unsafe.Pointer(bp + 164))-1 {
 181345 			fts5HighlightAppend(tls, bp+168, bp, (*HighlightContext)(unsafe.Pointer(bp)).FzIn+uintptr((*HighlightContext)(unsafe.Pointer(bp)).FiOff), (*HighlightContext)(unsafe.Pointer(bp)).FnIn-(*HighlightContext)(unsafe.Pointer(bp)).FiOff)
 181346 		} else {
 181347 			fts5HighlightAppend(tls, bp+168, bp, zEllips, -1)
 181348 		}
 181349 	}
 181350 	if *(*int32)(unsafe.Pointer(bp + 168)) == SQLITE_OK {
 181351 		Xsqlite3_result_text(tls, pCtx, (*HighlightContext)(unsafe.Pointer(bp)).FzOut, -1, libc.UintptrFromInt32(-1))
 181352 	} else {
 181353 		Xsqlite3_result_error_code(tls, pCtx, *(*int32)(unsafe.Pointer(bp + 168)))
 181354 	}
 181355 	Xsqlite3_free(tls, (*HighlightContext)(unsafe.Pointer(bp)).FzOut)
 181356 	Xsqlite3_free(tls, aSeen)
 181357 	Xsqlite3_free(tls, (*Fts5SFinder)(unsafe.Pointer(bp+104)).FaFirst)
 181358 }
 181359 
 181360 // The first time the bm25() function is called for a query, an instance
 181361 // of the following structure is allocated and populated.
 181362 type Fts5Bm25Data1 = struct {
 181363 	FnPhrase     int32
 181364 	F__ccgo_pad1 [4]byte
 181365 	Favgdl       float64
 181366 	FaIDF        uintptr
 181367 	FaFreq       uintptr
 181368 }
 181369 
 181370 // The first time the bm25() function is called for a query, an instance
 181371 // of the following structure is allocated and populated.
 181372 type Fts5Bm25Data = Fts5Bm25Data1
 181373 
 181374 func fts5CountCb(tls *libc.TLS, pApi uintptr, pFts uintptr, pUserData uintptr) int32 {
 181375 	var pn uintptr = pUserData
 181376 	_ = pApi
 181377 	_ = pFts
 181378 	*(*Sqlite3_int64)(unsafe.Pointer(pn))++
 181379 	return SQLITE_OK
 181380 }
 181381 
 181382 func fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) int32 {
 181383 	bp := tls.Alloc(24)
 181384 	defer tls.Free(24)
 181385 
 181386 	var rc int32 = SQLITE_OK
 181387 	var p uintptr
 181388 
 181389 	p = (*struct {
 181390 		f func(*libc.TLS, uintptr, int32) uintptr
 181391 	})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxGetAuxdata})).f(tls, pFts, 0)
 181392 	if p == uintptr(0) {
 181393 		var nPhrase int32
 181394 		*(*Sqlite3_int64)(unsafe.Pointer(bp)) = int64(0)
 181395 		*(*Sqlite3_int64)(unsafe.Pointer(bp + 8)) = int64(0)
 181396 		var nByte Sqlite3_int64
 181397 		var i int32
 181398 
 181399 		nPhrase = (*struct {
 181400 			f func(*libc.TLS, uintptr) int32
 181401 		})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxPhraseCount})).f(tls, pFts)
 181402 		nByte = Sqlite3_int64(uint64(unsafe.Sizeof(Fts5Bm25Data{})) + uint64(nPhrase*2)*uint64(unsafe.Sizeof(float64(0))))
 181403 		p = Xsqlite3_malloc64(tls, uint64(nByte))
 181404 		if p == uintptr(0) {
 181405 			rc = SQLITE_NOMEM
 181406 		} else {
 181407 			libc.Xmemset(tls, p, 0, Size_t(nByte))
 181408 			(*Fts5Bm25Data)(unsafe.Pointer(p)).FnPhrase = nPhrase
 181409 			(*Fts5Bm25Data)(unsafe.Pointer(p)).FaIDF = p + 1*32
 181410 			(*Fts5Bm25Data)(unsafe.Pointer(p)).FaFreq = (*Fts5Bm25Data)(unsafe.Pointer(p)).FaIDF + uintptr(nPhrase)*8
 181411 		}
 181412 
 181413 		if rc == SQLITE_OK {
 181414 			rc = (*struct {
 181415 				f func(*libc.TLS, uintptr, uintptr) int32
 181416 			})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxRowCount})).f(tls, pFts, bp)
 181417 		}
 181418 
 181419 		if rc == SQLITE_OK {
 181420 			rc = (*struct {
 181421 				f func(*libc.TLS, uintptr, int32, uintptr) int32
 181422 			})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnTotalSize})).f(tls, pFts, -1, bp+8)
 181423 		}
 181424 		if rc == SQLITE_OK {
 181425 			(*Fts5Bm25Data)(unsafe.Pointer(p)).Favgdl = float64(*(*Sqlite3_int64)(unsafe.Pointer(bp + 8))) / float64(*(*Sqlite3_int64)(unsafe.Pointer(bp)))
 181426 		}
 181427 
 181428 		for i = 0; rc == SQLITE_OK && i < nPhrase; i++ {
 181429 			*(*Sqlite3_int64)(unsafe.Pointer(bp + 16)) = int64(0)
 181430 			rc = (*struct {
 181431 				f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
 181432 			})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxQueryPhrase})).f(tls, pFts, i, bp+16, *(*uintptr)(unsafe.Pointer(&struct {
 181433 				f func(*libc.TLS, uintptr, uintptr, uintptr) int32
 181434 			}{fts5CountCb})))
 181435 			if rc == SQLITE_OK {
 181436 				var idf float64 = libc.Xlog(tls, (float64(*(*Sqlite3_int64)(unsafe.Pointer(bp))-*(*Sqlite3_int64)(unsafe.Pointer(bp + 16)))+0.5)/(float64(*(*Sqlite3_int64)(unsafe.Pointer(bp + 16)))+0.5))
 181437 				if idf <= 0.0 {
 181438 					idf = 1e-6
 181439 				}
 181440 				*(*float64)(unsafe.Pointer((*Fts5Bm25Data)(unsafe.Pointer(p)).FaIDF + uintptr(i)*8)) = idf
 181441 			}
 181442 		}
 181443 
 181444 		if rc != SQLITE_OK {
 181445 			Xsqlite3_free(tls, p)
 181446 		} else {
 181447 			rc = (*struct {
 181448 				f func(*libc.TLS, uintptr, uintptr, uintptr) int32
 181449 			})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxSetAuxdata})).f(tls, pFts, p, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
 181450 		}
 181451 		if rc != SQLITE_OK {
 181452 			p = uintptr(0)
 181453 		}
 181454 	}
 181455 	*(*uintptr)(unsafe.Pointer(ppData)) = p
 181456 	return rc
 181457 }
 181458 
 181459 func fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) {
 181460 	bp := tls.Alloc(28)
 181461 	defer tls.Free(28)
 181462 
 181463 	var k1 float64 = 1.2
 181464 	var b float64 = 0.75
 181465 	var rc int32
 181466 	var score float64 = 0.0
 181467 
 181468 	var i int32
 181469 	*(*int32)(unsafe.Pointer(bp + 8)) = 0
 181470 	var D float64 = 0.0
 181471 	var aFreq uintptr = uintptr(0)
 181472 
 181473 	rc = fts5Bm25GetData(tls, pApi, pFts, bp)
 181474 	if rc == SQLITE_OK {
 181475 		aFreq = (*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaFreq
 181476 		libc.Xmemset(tls, aFreq, 0, uint64(unsafe.Sizeof(float64(0)))*uint64((*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnPhrase))
 181477 		rc = (*struct {
 181478 			f func(*libc.TLS, uintptr, uintptr) int32
 181479 		})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxInstCount})).f(tls, pFts, bp+8)
 181480 	}
 181481 	for i = 0; rc == SQLITE_OK && i < *(*int32)(unsafe.Pointer(bp + 8)); i++ {
 181482 		rc = (*struct {
 181483 			f func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32
 181484 		})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxInst})).f(tls, pFts, i, bp+12, bp+16, bp+20)
 181485 		if rc == SQLITE_OK {
 181486 			var w float64
 181487 			if nVal > *(*int32)(unsafe.Pointer(bp + 16)) {
 181488 				w = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(*(*int32)(unsafe.Pointer(bp + 16)))*8)))
 181489 			} else {
 181490 				w = 1.0
 181491 			}
 181492 			*(*float64)(unsafe.Pointer(aFreq + uintptr(*(*int32)(unsafe.Pointer(bp + 12)))*8)) += w
 181493 		}
 181494 	}
 181495 
 181496 	if rc == SQLITE_OK {
 181497 		rc = (*struct {
 181498 			f func(*libc.TLS, uintptr, int32, uintptr) int32
 181499 		})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnSize})).f(tls, pFts, -1, bp+24)
 181500 		D = float64(*(*int32)(unsafe.Pointer(bp + 24)))
 181501 	}
 181502 
 181503 	if rc == SQLITE_OK {
 181504 		for i = 0; i < (*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnPhrase; i++ {
 181505 			score = score + *(*float64)(unsafe.Pointer((*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8))*(*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8))*(k1+1.0)/(*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8))+k1*(float64(1)-b+b*D/(*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl)))
 181506 		}
 181507 		Xsqlite3_result_double(tls, pCtx, -1.0*score)
 181508 	} else {
 181509 		Xsqlite3_result_error_code(tls, pCtx, rc)
 181510 	}
 181511 }
 181512 
 181513 func sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) int32 {
 181514 	bp := tls.Alloc(96)
 181515 	defer tls.Free(96)
 181516 
 181517 	*(*[3]Builtin)(unsafe.Pointer(bp)) = [3]Builtin{
 181518 		{FzFunc: ts + 35273, FxFunc: *(*uintptr)(unsafe.Pointer(&struct {
 181519 			f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr)
 181520 		}{fts5SnippetFunction}))},
 181521 		{FzFunc: ts + 35281, FxFunc: *(*uintptr)(unsafe.Pointer(&struct {
 181522 			f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr)
 181523 		}{fts5HighlightFunction}))},
 181524 		{FzFunc: ts + 35291, FxFunc: *(*uintptr)(unsafe.Pointer(&struct {
 181525 			f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr)
 181526 		}{fts5Bm25Function}))},
 181527 	}
 181528 	var rc int32 = SQLITE_OK
 181529 	var i int32
 181530 
 181531 	for i = 0; rc == SQLITE_OK && i < int32(uint64(unsafe.Sizeof([3]Builtin{}))/uint64(unsafe.Sizeof(Builtin{}))); i++ {
 181532 		rc = (*struct {
 181533 			f func(*libc.TLS, uintptr, uintptr, uintptr, Fts5_extension_function, uintptr) int32
 181534 		})(unsafe.Pointer(&struct{ uintptr }{(*Fts5_api)(unsafe.Pointer(pApi)).FxCreateFunction})).f(tls, pApi,
 181535 			(*Builtin)(unsafe.Pointer(bp+uintptr(i)*32)).FzFunc,
 181536 			(*Builtin)(unsafe.Pointer(bp+uintptr(i)*32)).FpUserData,
 181537 			(*Builtin)(unsafe.Pointer(bp+uintptr(i)*32)).FxFunc,
 181538 			(*Builtin)(unsafe.Pointer(bp+uintptr(i)*32)).FxDestroy)
 181539 	}
 181540 
 181541 	return rc
 181542 }
 181543 
 181544 type Builtin = struct {
 181545 	FzFunc     uintptr
 181546 	FpUserData uintptr
 181547 	FxFunc     Fts5_extension_function
 181548 	FxDestroy  uintptr
 181549 }
 181550 
 181551 func sqlite3Fts5BufferSize(tls *libc.TLS, pRc uintptr, pBuf uintptr, nByte U32) int32 {
 181552 	if U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) < nByte {
 181553 		var nNew U64
 181554 		if (*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace != 0 {
 181555 			nNew = uint64((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace)
 181556 		} else {
 181557 			nNew = uint64(64)
 181558 		}
 181559 		var pNew uintptr
 181560 		for nNew < U64(nByte) {
 181561 			nNew = nNew * uint64(2)
 181562 		}
 181563 		pNew = Xsqlite3_realloc64(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp, nNew)
 181564 		if pNew == uintptr(0) {
 181565 			*(*int32)(unsafe.Pointer(pRc)) = SQLITE_NOMEM
 181566 			return 1
 181567 		} else {
 181568 			(*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace = int32(nNew)
 181569 			(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp = pNew
 181570 		}
 181571 	}
 181572 	return 0
 181573 }
 181574 
 181575 func sqlite3Fts5BufferAppendVarint(tls *libc.TLS, pRc uintptr, pBuf uintptr, iVal I64) {
 181576 	if func() int32 {
 181577 		if U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)+U32(9) <= U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) {
 181578 			return 0
 181579 		}
 181580 		return sqlite3Fts5BufferSize(tls, pRc, pBuf, uint32(9+(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn))
 181581 	}() != 0 {
 181582 		return
 181583 	}
 181584 	*(*int32)(unsafe.Pointer(pBuf + 8)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), uint64(iVal))
 181585 }
 181586 
 181587 func sqlite3Fts5Put32(tls *libc.TLS, aBuf uintptr, iVal int32) {
 181588 	*(*U8)(unsafe.Pointer(aBuf)) = U8(iVal >> 24 & 0x00FF)
 181589 	*(*U8)(unsafe.Pointer(aBuf + 1)) = U8(iVal >> 16 & 0x00FF)
 181590 	*(*U8)(unsafe.Pointer(aBuf + 2)) = U8(iVal >> 8 & 0x00FF)
 181591 	*(*U8)(unsafe.Pointer(aBuf + 3)) = U8(iVal >> 0 & 0x00FF)
 181592 }
 181593 
 181594 func sqlite3Fts5Get32(tls *libc.TLS, aBuf uintptr) int32 {
 181595 	return int32(U32(*(*U8)(unsafe.Pointer(aBuf)))<<24 + U32(int32(*(*U8)(unsafe.Pointer(aBuf + 1)))<<16) + U32(int32(*(*U8)(unsafe.Pointer(aBuf + 2)))<<8) + U32(*(*U8)(unsafe.Pointer(aBuf + 3))))
 181596 }
 181597 
 181598 func sqlite3Fts5BufferAppendBlob(tls *libc.TLS, pRc uintptr, pBuf uintptr, nData U32, pData uintptr) {
 181599 	if nData != 0 {
 181600 		if func() int32 {
 181601 			if U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)+nData <= U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) {
 181602 				return 0
 181603 			}
 181604 			return sqlite3Fts5BufferSize(tls, pRc, pBuf, nData+U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn))
 181605 		}() != 0 {
 181606 			return
 181607 		}
 181608 		libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), pData, uint64(nData))
 181609 		*(*int32)(unsafe.Pointer(pBuf + 8)) += int32(nData)
 181610 	}
 181611 }
 181612 
 181613 func sqlite3Fts5BufferAppendString(tls *libc.TLS, pRc uintptr, pBuf uintptr, zStr uintptr) {
 181614 	var nStr int32 = int32(libc.Xstrlen(tls, zStr))
 181615 	sqlite3Fts5BufferAppendBlob(tls, pRc, pBuf, uint32(nStr+1), zStr)
 181616 	(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn--
 181617 }
 181618 
 181619 func sqlite3Fts5BufferAppendPrintf(tls *libc.TLS, pRc uintptr, pBuf uintptr, zFmt uintptr, va uintptr) {
 181620 	if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
 181621 		var zTmp uintptr
 181622 		var ap Va_list
 181623 		_ = ap
 181624 		ap = va
 181625 		zTmp = Xsqlite3_vmprintf(tls, zFmt, ap)
 181626 		_ = ap
 181627 
 181628 		if zTmp == uintptr(0) {
 181629 			*(*int32)(unsafe.Pointer(pRc)) = SQLITE_NOMEM
 181630 		} else {
 181631 			sqlite3Fts5BufferAppendString(tls, pRc, pBuf, zTmp)
 181632 			Xsqlite3_free(tls, zTmp)
 181633 		}
 181634 	}
 181635 }
 181636 
 181637 func sqlite3Fts5Mprintf(tls *libc.TLS, pRc uintptr, zFmt uintptr, va uintptr) uintptr {
 181638 	var zRet uintptr = uintptr(0)
 181639 	if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
 181640 		var ap Va_list
 181641 		_ = ap
 181642 		ap = va
 181643 		zRet = Xsqlite3_vmprintf(tls, zFmt, ap)
 181644 		_ = ap
 181645 		if zRet == uintptr(0) {
 181646 			*(*int32)(unsafe.Pointer(pRc)) = SQLITE_NOMEM
 181647 		}
 181648 	}
 181649 	return zRet
 181650 }
 181651 
 181652 func sqlite3Fts5BufferFree(tls *libc.TLS, pBuf uintptr) {
 181653 	Xsqlite3_free(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp)
 181654 	libc.Xmemset(tls, pBuf, 0, uint64(unsafe.Sizeof(Fts5Buffer{})))
 181655 }
 181656 
 181657 func sqlite3Fts5BufferZero(tls *libc.TLS, pBuf uintptr) {
 181658 	(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn = 0
 181659 }
 181660 
 181661 func sqlite3Fts5BufferSet(tls *libc.TLS, pRc uintptr, pBuf uintptr, nData int32, pData uintptr) {
 181662 	(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn = 0
 181663 	sqlite3Fts5BufferAppendBlob(tls, pRc, pBuf, uint32(nData), pData)
 181664 }
 181665 
 181666 func sqlite3Fts5PoslistNext64(tls *libc.TLS, a uintptr, n int32, pi uintptr, piOff uintptr) int32 {
 181667 	bp := tls.Alloc(4)
 181668 	defer tls.Free(4)
 181669 
 181670 	var i int32 = *(*int32)(unsafe.Pointer(pi))
 181671 	if i >= n {
 181672 		*(*I64)(unsafe.Pointer(piOff)) = int64(-1)
 181673 		return 1
 181674 	} else {
 181675 		var iOff I64 = *(*I64)(unsafe.Pointer(piOff))
 181676 
 181677 		{
 181678 			*(*U32)(unsafe.Pointer(bp)) = U32(*(*U8)(unsafe.Pointer(a + uintptr(libc.PostIncInt32(&i, 1)))))
 181679 			if *(*U32)(unsafe.Pointer(bp))&U32(0x80) != 0 {
 181680 				i--
 181681 				i = i + sqlite3Fts5GetVarint32(tls, a+uintptr(i), bp)
 181682 			}
 181683 		}
 181684 
 181685 		if *(*U32)(unsafe.Pointer(bp)) <= U32(1) {
 181686 			if *(*U32)(unsafe.Pointer(bp)) == U32(0) {
 181687 				*(*int32)(unsafe.Pointer(pi)) = i
 181688 				return 0
 181689 			}
 181690 			{
 181691 				*(*U32)(unsafe.Pointer(bp)) = U32(*(*U8)(unsafe.Pointer(a + uintptr(libc.PostIncInt32(&i, 1)))))
 181692 				if *(*U32)(unsafe.Pointer(bp))&U32(0x80) != 0 {
 181693 					i--
 181694 					i = i + sqlite3Fts5GetVarint32(tls, a+uintptr(i), bp)
 181695 				}
 181696 			}
 181697 
 181698 			iOff = I64(*(*U32)(unsafe.Pointer(bp))) << 32
 181699 
 181700 			{
 181701 				*(*U32)(unsafe.Pointer(bp)) = U32(*(*U8)(unsafe.Pointer(a + uintptr(libc.PostIncInt32(&i, 1)))))
 181702 				if *(*U32)(unsafe.Pointer(bp))&U32(0x80) != 0 {
 181703 					i--
 181704 					i = i + sqlite3Fts5GetVarint32(tls, a+uintptr(i), bp)
 181705 				}
 181706 			}
 181707 
 181708 			if *(*U32)(unsafe.Pointer(bp)) < U32(2) {
 181709 				*(*I64)(unsafe.Pointer(piOff)) = int64(-1)
 181710 				return 1
 181711 			}
 181712 			*(*I64)(unsafe.Pointer(piOff)) = iOff + I64((*(*U32)(unsafe.Pointer(bp))-U32(2))&U32(0x7FFFFFFF))
 181713 		} else {
 181714 			*(*I64)(unsafe.Pointer(piOff)) = iOff&(int64(0x7FFFFFFF)<<32) + (iOff+I64(*(*U32)(unsafe.Pointer(bp))-U32(2)))&int64(0x7FFFFFFF)
 181715 		}
 181716 		*(*int32)(unsafe.Pointer(pi)) = i
 181717 
 181718 		return 0
 181719 	}
 181720 	return int32(0)
 181721 }
 181722 
 181723 func sqlite3Fts5PoslistReaderNext(tls *libc.TLS, pIter uintptr) int32 {
 181724 	if sqlite3Fts5PoslistNext64(tls, (*Fts5PoslistReader)(unsafe.Pointer(pIter)).Fa, (*Fts5PoslistReader)(unsafe.Pointer(pIter)).Fn, pIter+12, pIter+24) != 0 {
 181725 		(*Fts5PoslistReader)(unsafe.Pointer(pIter)).FbEof = U8(1)
 181726 	}
 181727 	return int32((*Fts5PoslistReader)(unsafe.Pointer(pIter)).FbEof)
 181728 }
 181729 
 181730 func sqlite3Fts5PoslistReaderInit(tls *libc.TLS, a uintptr, n int32, pIter uintptr) int32 {
 181731 	libc.Xmemset(tls, pIter, 0, uint64(unsafe.Sizeof(Fts5PoslistReader{})))
 181732 	(*Fts5PoslistReader)(unsafe.Pointer(pIter)).Fa = a
 181733 	(*Fts5PoslistReader)(unsafe.Pointer(pIter)).Fn = n
 181734 	sqlite3Fts5PoslistReaderNext(tls, pIter)
 181735 	return int32((*Fts5PoslistReader)(unsafe.Pointer(pIter)).FbEof)
 181736 }
 181737 
 181738 func sqlite3Fts5PoslistSafeAppend(tls *libc.TLS, pBuf uintptr, piPrev uintptr, iPos I64) {
 181739 	if iPos >= *(*I64)(unsafe.Pointer(piPrev)) {
 181740 		if iPos&colmask != *(*I64)(unsafe.Pointer(piPrev))&colmask {
 181741 			*(*U8)(unsafe.Pointer((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(libc.PostIncInt32(&(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn, 1)))) = U8(1)
 181742 			*(*int32)(unsafe.Pointer(pBuf + 8)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), uint64(iPos>>32))
 181743 			*(*I64)(unsafe.Pointer(piPrev)) = iPos & colmask
 181744 		}
 181745 		*(*int32)(unsafe.Pointer(pBuf + 8)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), uint64(iPos-*(*I64)(unsafe.Pointer(piPrev))+int64(2)))
 181746 		*(*I64)(unsafe.Pointer(piPrev)) = iPos
 181747 	}
 181748 }
 181749 
 181750 var colmask I64 = int64(0x7FFFFFFF) << 32
 181751 
 181752 func sqlite3Fts5PoslistWriterAppend(tls *libc.TLS, pBuf uintptr, pWriter uintptr, iPos I64) int32 {
 181753 	bp := tls.Alloc(4)
 181754 	defer tls.Free(4)
 181755 
 181756 	*(*int32)(unsafe.Pointer(bp)) = 0
 181757 	if func() int32 {
 181758 		if U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)+U32(5+5+5) <= U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) {
 181759 			return 0
 181760 		}
 181761 		return sqlite3Fts5BufferSize(tls, bp, pBuf, uint32(5+5+5+(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn))
 181762 	}() != 0 {
 181763 		return *(*int32)(unsafe.Pointer(bp))
 181764 	}
 181765 	sqlite3Fts5PoslistSafeAppend(tls, pBuf, pWriter, iPos)
 181766 	return SQLITE_OK
 181767 }
 181768 
 181769 func sqlite3Fts5MallocZero(tls *libc.TLS, pRc uintptr, nByte Sqlite3_int64) uintptr {
 181770 	var pRet uintptr = uintptr(0)
 181771 	if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
 181772 		pRet = Xsqlite3_malloc64(tls, uint64(nByte))
 181773 		if pRet == uintptr(0) {
 181774 			if nByte > int64(0) {
 181775 				*(*int32)(unsafe.Pointer(pRc)) = SQLITE_NOMEM
 181776 			}
 181777 		} else {
 181778 			libc.Xmemset(tls, pRet, 0, Size_t(nByte))
 181779 		}
 181780 	}
 181781 	return pRet
 181782 }
 181783 
 181784 func sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) uintptr {
 181785 	var zRet uintptr = uintptr(0)
 181786 	if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
 181787 		if nIn < 0 {
 181788 			nIn = int32(libc.Xstrlen(tls, pIn))
 181789 		}
 181790 		zRet = Xsqlite3_malloc(tls, nIn+1)
 181791 		if zRet != 0 {
 181792 			libc.Xmemcpy(tls, zRet, pIn, uint64(nIn))
 181793 			*(*int8)(unsafe.Pointer(zRet + uintptr(nIn))) = int8(0)
 181794 		} else {
 181795 			*(*int32)(unsafe.Pointer(pRc)) = SQLITE_NOMEM
 181796 		}
 181797 	}
 181798 	return zRet
 181799 }
 181800 
 181801 func sqlite3Fts5IsBareword(tls *libc.TLS, t int8) int32 {
 181802 	bp := tls.Alloc(128)
 181803 	defer tls.Free(128)
 181804 
 181805 	*(*[128]U8)(unsafe.Pointer(bp)) = [128]U8{
 181806 		U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0),
 181807 		U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(1), U8(0), U8(0), U8(0), U8(0), U8(0),
 181808 		U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0),
 181809 		U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0),
 181810 		U8(0), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1),
 181811 		U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(0), U8(0), U8(0), U8(0), U8(1),
 181812 		U8(0), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1),
 181813 		U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(0), U8(0), U8(0), U8(0), U8(0),
 181814 	}
 181815 
 181816 	return libc.Bool32(int32(t)&0x80 != 0 || *(*U8)(unsafe.Pointer(bp + uintptr(int32(t)))) != 0)
 181817 }
 181818 
 181819 // ************************************************************************
 181820 type Fts5TermsetEntry1 = struct {
 181821 	FpTerm uintptr
 181822 	FnTerm int32
 181823 	FiIdx  int32
 181824 	FpNext uintptr
 181825 }
 181826 
 181827 // ************************************************************************
 181828 type Fts5TermsetEntry = Fts5TermsetEntry1
 181829 
 181830 func sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) int32 {
 181831 	bp := tls.Alloc(4)
 181832 	defer tls.Free(4)
 181833 
 181834 	*(*int32)(unsafe.Pointer(bp)) = SQLITE_OK
 181835 	*(*uintptr)(unsafe.Pointer(pp)) = sqlite3Fts5MallocZero(tls, bp, int64(unsafe.Sizeof(Fts5Termset{})))
 181836 	return *(*int32)(unsafe.Pointer(bp))
 181837 }
 181838 
 181839 func sqlite3Fts5TermsetAdd(tls *libc.TLS, p uintptr, iIdx int32, pTerm uintptr, nTerm int32, pbPresent uintptr) int32 {
 181840 	bp := tls.Alloc(4)
 181841 	defer tls.Free(4)
 181842 
 181843 	*(*int32)(unsafe.Pointer(bp)) = SQLITE_OK
 181844 	*(*int32)(unsafe.Pointer(pbPresent)) = 0
 181845 	if p != 0 {
 181846 		var i int32
 181847 		var hash U32 = U32(13)
 181848 		var pEntry uintptr
 181849 
 181850 		for i = nTerm - 1; i >= 0; i-- {
 181851 			hash = hash<<3 ^ hash ^ U32(*(*int8)(unsafe.Pointer(pTerm + uintptr(i))))
 181852 		}
 181853 		hash = hash<<3 ^ hash ^ U32(iIdx)
 181854 		hash = hash % U32(int32(uint64(unsafe.Sizeof([512]uintptr{}))/uint64(unsafe.Sizeof(uintptr(0)))))
 181855 
 181856 		for pEntry = *(*uintptr)(unsafe.Pointer(p + uintptr(hash)*8)); pEntry != 0; pEntry = (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FpNext {
 181857 			if (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FiIdx == iIdx &&
 181858 				(*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FnTerm == nTerm &&
 181859 				libc.Xmemcmp(tls, (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FpTerm, pTerm, uint64(nTerm)) == 0 {
 181860 				*(*int32)(unsafe.Pointer(pbPresent)) = 1
 181861 				break
 181862 			}
 181863 		}
 181864 
 181865 		if pEntry == uintptr(0) {
 181866 			pEntry = sqlite3Fts5MallocZero(tls, bp, int64(uint64(unsafe.Sizeof(Fts5TermsetEntry{}))+uint64(nTerm)))
 181867 			if pEntry != 0 {
 181868 				(*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FpTerm = pEntry + 1*24
 181869 				(*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FnTerm = nTerm
 181870 				(*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FiIdx = iIdx
 181871 				libc.Xmemcpy(tls, (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FpTerm, pTerm, uint64(nTerm))
 181872 				(*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FpNext = *(*uintptr)(unsafe.Pointer(p + uintptr(hash)*8))
 181873 				*(*uintptr)(unsafe.Pointer(p + uintptr(hash)*8)) = pEntry
 181874 			}
 181875 		}
 181876 	}
 181877 
 181878 	return *(*int32)(unsafe.Pointer(bp))
 181879 }
 181880 
 181881 func sqlite3Fts5TermsetFree(tls *libc.TLS, p uintptr) {
 181882 	if p != 0 {
 181883 		var i U32
 181884 		for i = U32(0); i < U32(int32(uint64(unsafe.Sizeof([512]uintptr{}))/uint64(unsafe.Sizeof(uintptr(0))))); i++ {
 181885 			var pEntry uintptr = *(*uintptr)(unsafe.Pointer(p + uintptr(i)*8))
 181886 			for pEntry != 0 {
 181887 				var pDel uintptr = pEntry
 181888 				pEntry = (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FpNext
 181889 				Xsqlite3_free(tls, pDel)
 181890 			}
 181891 		}
 181892 		Xsqlite3_free(tls, p)
 181893 	}
 181894 }
 181895 
 181896 func fts5_iswhitespace(tls *libc.TLS, x int8) int32 {
 181897 	return libc.Bool32(int32(x) == ' ')
 181898 }
 181899 
 181900 func fts5_isopenquote(tls *libc.TLS, x int8) int32 {
 181901 	return libc.Bool32(int32(x) == '"' || int32(x) == '\'' || int32(x) == '[' || int32(x) == '`')
 181902 }
 181903 
 181904 func fts5ConfigSkipWhitespace(tls *libc.TLS, pIn uintptr) uintptr {
 181905 	var p uintptr = pIn
 181906 	if p != 0 {
 181907 		for fts5_iswhitespace(tls, *(*int8)(unsafe.Pointer(p))) != 0 {
 181908 			p++
 181909 		}
 181910 	}
 181911 	return p
 181912 }
 181913 
 181914 func fts5ConfigSkipBareword(tls *libc.TLS, pIn uintptr) uintptr {
 181915 	var p uintptr = pIn
 181916 	for sqlite3Fts5IsBareword(tls, *(*int8)(unsafe.Pointer(p))) != 0 {
 181917 		p++
 181918 	}
 181919 	if p == pIn {
 181920 		p = uintptr(0)
 181921 	}
 181922 	return p
 181923 }
 181924 
 181925 func fts5_isdigit(tls *libc.TLS, a int8) int32 {
 181926 	return libc.Bool32(int32(a) >= '0' && int32(a) <= '9')
 181927 }
 181928 
 181929 func fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) uintptr {
 181930 	var p uintptr = pIn
 181931 	switch int32(*(*int8)(unsafe.Pointer(p))) {
 181932 	case 'n':
 181933 		fallthrough
 181934 	case 'N':
 181935 		if Xsqlite3_strnicmp(tls, ts+7533, p, 4) == 0 {
 181936 			p = p + 4
 181937 		} else {
 181938 			p = uintptr(0)
 181939 		}
 181940 		break
 181941 
 181942 	case 'x':
 181943 		fallthrough
 181944 	case 'X':
 181945 		p++
 181946 		if int32(*(*int8)(unsafe.Pointer(p))) == '\'' {
 181947 			p++
 181948 			for int32(*(*int8)(unsafe.Pointer(p))) >= 'a' && int32(*(*int8)(unsafe.Pointer(p))) <= 'f' ||
 181949 				int32(*(*int8)(unsafe.Pointer(p))) >= 'A' && int32(*(*int8)(unsafe.Pointer(p))) <= 'F' ||
 181950 				int32(*(*int8)(unsafe.Pointer(p))) >= '0' && int32(*(*int8)(unsafe.Pointer(p))) <= '9' {
 181951 				p++
 181952 			}
 181953 			if int32(*(*int8)(unsafe.Pointer(p))) == '\'' && int64(0) == (int64(p)-int64(pIn))/1%int64(2) {
 181954 				p++
 181955 			} else {
 181956 				p = uintptr(0)
 181957 			}
 181958 		} else {
 181959 			p = uintptr(0)
 181960 		}
 181961 		break
 181962 
 181963 	case '\'':
 181964 		p++
 181965 		for p != 0 {
 181966 			if int32(*(*int8)(unsafe.Pointer(p))) == '\'' {
 181967 				p++
 181968 				if int32(*(*int8)(unsafe.Pointer(p))) != '\'' {
 181969 					break
 181970 				}
 181971 			}
 181972 			p++
 181973 			if int32(*(*int8)(unsafe.Pointer(p))) == 0 {
 181974 				p = uintptr(0)
 181975 			}
 181976 		}
 181977 		break
 181978 
 181979 	default:
 181980 		if int32(*(*int8)(unsafe.Pointer(p))) == '+' || int32(*(*int8)(unsafe.Pointer(p))) == '-' {
 181981 			p++
 181982 		}
 181983 		for fts5_isdigit(tls, *(*int8)(unsafe.Pointer(p))) != 0 {
 181984 			p++
 181985 		}
 181986 
 181987 		if int32(*(*int8)(unsafe.Pointer(p))) == '.' && fts5_isdigit(tls, *(*int8)(unsafe.Pointer(p + 1))) != 0 {
 181988 			p += uintptr(2)
 181989 			for fts5_isdigit(tls, *(*int8)(unsafe.Pointer(p))) != 0 {
 181990 				p++
 181991 			}
 181992 		}
 181993 		if p == pIn {
 181994 			p = uintptr(0)
 181995 		}
 181996 
 181997 		break
 181998 	}
 181999 
 182000 	return p
 182001 }
 182002 
 182003 func fts5Dequote(tls *libc.TLS, z uintptr) int32 {
 182004 	var q int8
 182005 	var iIn int32 = 1
 182006 	var iOut int32 = 0
 182007 	q = *(*int8)(unsafe.Pointer(z))
 182008 
 182009 	if int32(q) == '[' {
 182010 		q = int8(']')
 182011 	}
 182012 
 182013 	for *(*int8)(unsafe.Pointer(z + uintptr(iIn))) != 0 {
 182014 		if int32(*(*int8)(unsafe.Pointer(z + uintptr(iIn)))) == int32(q) {
 182015 			if int32(*(*int8)(unsafe.Pointer(z + uintptr(iIn+1)))) != int32(q) {
 182016 				iIn++
 182017 				break
 182018 			} else {
 182019 				iIn = iIn + 2
 182020 				*(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&iOut, 1)))) = q
 182021 			}
 182022 		} else {
 182023 			*(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&iOut, 1)))) = *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&iIn, 1))))
 182024 		}
 182025 	}
 182026 
 182027 	*(*int8)(unsafe.Pointer(z + uintptr(iOut))) = int8(0)
 182028 	return iIn
 182029 }
 182030 
 182031 func sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) {
 182032 	var quote int8
 182033 
 182034 	quote = *(*int8)(unsafe.Pointer(z))
 182035 	if int32(quote) == '[' || int32(quote) == '\'' || int32(quote) == '"' || int32(quote) == '`' {
 182036 		fts5Dequote(tls, z)
 182037 	}
 182038 }
 182039 
 182040 type Fts5Enum1 = struct {
 182041 	FzName       uintptr
 182042 	FeVal        int32
 182043 	F__ccgo_pad1 [4]byte
 182044 }
 182045 
 182046 type Fts5Enum = Fts5Enum1
 182047 
 182048 func fts5ConfigSetEnum(tls *libc.TLS, aEnum uintptr, zEnum uintptr, peVal uintptr) int32 {
 182049 	var nEnum int32 = int32(libc.Xstrlen(tls, zEnum))
 182050 	var i int32
 182051 	var iVal int32 = -1
 182052 
 182053 	for i = 0; (*Fts5Enum)(unsafe.Pointer(aEnum+uintptr(i)*16)).FzName != 0; i++ {
 182054 		if Xsqlite3_strnicmp(tls, (*Fts5Enum)(unsafe.Pointer(aEnum+uintptr(i)*16)).FzName, zEnum, nEnum) == 0 {
 182055 			if iVal >= 0 {
 182056 				return SQLITE_ERROR
 182057 			}
 182058 			iVal = (*Fts5Enum)(unsafe.Pointer(aEnum + uintptr(i)*16)).FeVal
 182059 		}
 182060 	}
 182061 
 182062 	*(*int32)(unsafe.Pointer(peVal)) = iVal
 182063 	if iVal < 0 {
 182064 		return SQLITE_ERROR
 182065 	}
 182066 	return SQLITE_OK
 182067 }
 182068 
 182069 func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCmd uintptr, zArg uintptr, pzErr uintptr) int32 {
 182070 	bp := tls.Alloc(112)
 182071 	defer tls.Free(112)
 182072 
 182073 	*(*int32)(unsafe.Pointer(bp + 40)) = SQLITE_OK
 182074 	var nCmd int32 = int32(libc.Xstrlen(tls, zCmd))
 182075 	if Xsqlite3_strnicmp(tls, ts+35296, zCmd, nCmd) == 0 {
 182076 		var nByte int32 = int32(uint64(unsafe.Sizeof(int32(0))) * uint64(FTS5_MAX_PREFIX_INDEXES))
 182077 		var p uintptr
 182078 		var bFirst int32 = 1
 182079 		if (*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) {
 182080 			(*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix = sqlite3Fts5MallocZero(tls, bp+40, int64(nByte))
 182081 			if *(*int32)(unsafe.Pointer(bp + 40)) != 0 {
 182082 				return *(*int32)(unsafe.Pointer(bp + 40))
 182083 			}
 182084 		}
 182085 
 182086 		p = zArg
 182087 		for 1 != 0 {
 182088 			var nPre int32 = 0
 182089 
 182090 			for int32(*(*int8)(unsafe.Pointer(p))) == ' ' {
 182091 				p++
 182092 			}
 182093 			if bFirst == 0 && int32(*(*int8)(unsafe.Pointer(p))) == ',' {
 182094 				p++
 182095 				for int32(*(*int8)(unsafe.Pointer(p))) == ' ' {
 182096 					p++
 182097 				}
 182098 			} else if int32(*(*int8)(unsafe.Pointer(p))) == 0 {
 182099 				break
 182100 			}
 182101 			if int32(*(*int8)(unsafe.Pointer(p))) < '0' || int32(*(*int8)(unsafe.Pointer(p))) > '9' {
 182102 				*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+35303, 0)
 182103 				*(*int32)(unsafe.Pointer(bp + 40)) = SQLITE_ERROR
 182104 				break
 182105 			}
 182106 
 182107 			if (*Fts5Config)(unsafe.Pointer(pConfig)).FnPrefix == FTS5_MAX_PREFIX_INDEXES {
 182108 				*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls,
 182109 					ts+35334, libc.VaList(bp, FTS5_MAX_PREFIX_INDEXES))
 182110 				*(*int32)(unsafe.Pointer(bp + 40)) = SQLITE_ERROR
 182111 				break
 182112 			}
 182113 
 182114 			for int32(*(*int8)(unsafe.Pointer(p))) >= '0' && int32(*(*int8)(unsafe.Pointer(p))) <= '9' && nPre < 1000 {
 182115 				nPre = nPre*10 + (int32(*(*int8)(unsafe.Pointer(p))) - '0')
 182116 				p++
 182117 			}
 182118 
 182119 			if nPre <= 0 || nPre >= 1000 {
 182120 				*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+35367, 0)
 182121 				*(*int32)(unsafe.Pointer(bp + 40)) = SQLITE_ERROR
 182122 				break
 182123 			}
 182124 
 182125 			*(*int32)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix + uintptr((*Fts5Config)(unsafe.Pointer(pConfig)).FnPrefix)*4)) = nPre
 182126 			(*Fts5Config)(unsafe.Pointer(pConfig)).FnPrefix++
 182127 			bFirst = 0
 182128 		}
 182129 
 182130 		return *(*int32)(unsafe.Pointer(bp + 40))
 182131 	}
 182132 
 182133 	if Xsqlite3_strnicmp(tls, ts+35404, zCmd, nCmd) == 0 {
 182134 		var p uintptr = zArg
 182135 		var nArg Sqlite3_int64 = Sqlite3_int64(libc.Xstrlen(tls, zArg) + uint64(1))
 182136 		var azArg uintptr = sqlite3Fts5MallocZero(tls, bp+40, int64(uint64(unsafe.Sizeof(uintptr(0)))*uint64(nArg)))
 182137 		var pDel uintptr = sqlite3Fts5MallocZero(tls, bp+40, nArg*int64(2))
 182138 		var pSpace uintptr = pDel
 182139 
 182140 		if azArg != 0 && pSpace != 0 {
 182141 			if (*Fts5Config)(unsafe.Pointer(pConfig)).FpTok != 0 {
 182142 				*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+35413, 0)
 182143 				*(*int32)(unsafe.Pointer(bp + 40)) = SQLITE_ERROR
 182144 			} else {
 182145 				for nArg = int64(0); p != 0 && *(*int8)(unsafe.Pointer(p)) != 0; nArg++ {
 182146 					var p2 uintptr = fts5ConfigSkipWhitespace(tls, p)
 182147 					if int32(*(*int8)(unsafe.Pointer(p2))) == '\'' {
 182148 						p = fts5ConfigSkipLiteral(tls, p2)
 182149 					} else {
 182150 						p = fts5ConfigSkipBareword(tls, p2)
 182151 					}
 182152 					if p != 0 {
 182153 						libc.Xmemcpy(tls, pSpace, p2, uint64((int64(p)-int64(p2))/1))
 182154 						*(*uintptr)(unsafe.Pointer(azArg + uintptr(nArg)*8)) = pSpace
 182155 						sqlite3Fts5Dequote(tls, pSpace)
 182156 						pSpace += uintptr((int64(p)-int64(p2))/1 + int64(1))
 182157 						p = fts5ConfigSkipWhitespace(tls, p)
 182158 					}
 182159 				}
 182160 				if p == uintptr(0) {
 182161 					*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+35446, 0)
 182162 					*(*int32)(unsafe.Pointer(bp + 40)) = SQLITE_ERROR
 182163 				} else {
 182164 					*(*int32)(unsafe.Pointer(bp + 40)) = sqlite3Fts5GetTokenizer(tls, pGlobal,
 182165 						azArg, int32(nArg), pConfig,
 182166 						pzErr)
 182167 				}
 182168 			}
 182169 		}
 182170 
 182171 		Xsqlite3_free(tls, azArg)
 182172 		Xsqlite3_free(tls, pDel)
 182173 		return *(*int32)(unsafe.Pointer(bp + 40))
 182174 	}
 182175 
 182176 	if Xsqlite3_strnicmp(tls, ts+35480, zCmd, nCmd) == 0 {
 182177 		if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL {
 182178 			*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+35488, 0)
 182179 			*(*int32)(unsafe.Pointer(bp + 40)) = SQLITE_ERROR
 182180 		} else {
 182181 			if *(*int8)(unsafe.Pointer(zArg)) != 0 {
 182182 				(*Fts5Config)(unsafe.Pointer(pConfig)).FeContent = FTS5_CONTENT_EXTERNAL
 182183 				(*Fts5Config)(unsafe.Pointer(pConfig)).FzContent = sqlite3Fts5Mprintf(tls, bp+40, ts+35520, libc.VaList(bp+8, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg))
 182184 			} else {
 182185 				(*Fts5Config)(unsafe.Pointer(pConfig)).FeContent = FTS5_CONTENT_NONE
 182186 			}
 182187 		}
 182188 		return *(*int32)(unsafe.Pointer(bp + 40))
 182189 	}
 182190 
 182191 	if Xsqlite3_strnicmp(tls, ts+35526, zCmd, nCmd) == 0 {
 182192 		if (*Fts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 {
 182193 			*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+35540, 0)
 182194 			*(*int32)(unsafe.Pointer(bp + 40)) = SQLITE_ERROR
 182195 		} else {
 182196 			(*Fts5Config)(unsafe.Pointer(pConfig)).FzContentRowid = sqlite3Fts5Strndup(tls, bp+40, zArg, -1)
 182197 		}
 182198 		return *(*int32)(unsafe.Pointer(bp + 40))
 182199 	}
 182200 
 182201 	if Xsqlite3_strnicmp(tls, ts+35578, zCmd, nCmd) == 0 {
 182202 		if int32(*(*int8)(unsafe.Pointer(zArg))) != '0' && int32(*(*int8)(unsafe.Pointer(zArg))) != '1' || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != 0 {
 182203 			*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+35589, 0)
 182204 			*(*int32)(unsafe.Pointer(bp + 40)) = SQLITE_ERROR
 182205 		} else {
 182206 			(*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize = libc.Bool32(int32(*(*int8)(unsafe.Pointer(zArg))) == '1')
 182207 		}
 182208 		return *(*int32)(unsafe.Pointer(bp + 40))
 182209 	}
 182210 
 182211 	if Xsqlite3_strnicmp(tls, ts+6427, zCmd, nCmd) == 0 {
 182212 		*(*[4]Fts5Enum)(unsafe.Pointer(bp + 48)) = [4]Fts5Enum{
 182213 			{FzName: ts + 9378, FeVal: FTS5_DETAIL_NONE},
 182214 			{FzName: ts + 18714},
 182215 			{FzName: ts + 35624, FeVal: FTS5_DETAIL_COLUMNS},
 182216 			{},
 182217 		}
 182218 
 182219 		if libc.AssignPtrInt32(bp+40, fts5ConfigSetEnum(tls, bp+48, zArg, pConfig+92)) != 0 {
 182220 			*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+35632, 0)
 182221 		}
 182222 		return *(*int32)(unsafe.Pointer(bp + 40))
 182223 	}
 182224 
 182225 	*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+35663, libc.VaList(bp+24, nCmd, zCmd))
 182226 	return SQLITE_ERROR
 182227 }
 182228 
 182229 func fts5ConfigDefaultTokenizer(tls *libc.TLS, pGlobal uintptr, pConfig uintptr) int32 {
 182230 	return sqlite3Fts5GetTokenizer(tls, pGlobal, uintptr(0), 0, pConfig, uintptr(0))
 182231 }
 182232 
 182233 func fts5ConfigGobbleWord(tls *libc.TLS, pRc uintptr, zIn uintptr, pzOut uintptr, pbQuoted uintptr) uintptr {
 182234 	var zRet uintptr = uintptr(0)
 182235 
 182236 	var nIn Sqlite3_int64 = Sqlite3_int64(libc.Xstrlen(tls, zIn))
 182237 	var zOut uintptr = Xsqlite3_malloc64(tls, uint64(nIn+int64(1)))
 182238 
 182239 	*(*int32)(unsafe.Pointer(pbQuoted)) = 0
 182240 	*(*uintptr)(unsafe.Pointer(pzOut)) = uintptr(0)
 182241 
 182242 	if zOut == uintptr(0) {
 182243 		*(*int32)(unsafe.Pointer(pRc)) = SQLITE_NOMEM
 182244 	} else {
 182245 		libc.Xmemcpy(tls, zOut, zIn, Size_t(nIn+int64(1)))
 182246 		if fts5_isopenquote(tls, *(*int8)(unsafe.Pointer(zOut))) != 0 {
 182247 			var ii int32 = fts5Dequote(tls, zOut)
 182248 			zRet = zIn + uintptr(ii)
 182249 			*(*int32)(unsafe.Pointer(pbQuoted)) = 1
 182250 		} else {
 182251 			zRet = fts5ConfigSkipBareword(tls, zIn)
 182252 			if zRet != 0 {
 182253 				*(*int8)(unsafe.Pointer(zOut + uintptr((int64(zRet)-int64(zIn))/1))) = int8(0)
 182254 			}
 182255 		}
 182256 	}
 182257 
 182258 	if zRet == uintptr(0) {
 182259 		Xsqlite3_free(tls, zOut)
 182260 	} else {
 182261 		*(*uintptr)(unsafe.Pointer(pzOut)) = zOut
 182262 	}
 182263 
 182264 	return zRet
 182265 }
 182266 
 182267 func fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr, pzErr uintptr) int32 {
 182268 	bp := tls.Alloc(16)
 182269 	defer tls.Free(16)
 182270 
 182271 	var rc int32 = SQLITE_OK
 182272 	if 0 == Xsqlite3_stricmp(tls, zCol, ts+23607) ||
 182273 		0 == Xsqlite3_stricmp(tls, zCol, ts+17625) {
 182274 		*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+35691, libc.VaList(bp, zCol))
 182275 		rc = SQLITE_ERROR
 182276 	} else if zArg != 0 {
 182277 		if 0 == Xsqlite3_stricmp(tls, zArg, ts+35721) {
 182278 			*(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr((*Fts5Config)(unsafe.Pointer(p)).FnCol))) = U8(1)
 182279 		} else {
 182280 			*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+35731, libc.VaList(bp+8, zArg))
 182281 			rc = SQLITE_ERROR
 182282 		}
 182283 	}
 182284 
 182285 	*(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(p)).FazCol + uintptr(libc.PostIncInt32(&(*Fts5Config)(unsafe.Pointer(p)).FnCol, 1))*8)) = zCol
 182286 	return rc
 182287 }
 182288 
 182289 func fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) int32 {
 182290 	bp := tls.Alloc(48)
 182291 	defer tls.Free(48)
 182292 
 182293 	var i int32
 182294 	*(*int32)(unsafe.Pointer(bp + 24)) = SQLITE_OK
 182295 	*(*Fts5Buffer)(unsafe.Pointer(bp + 32)) = Fts5Buffer{}
 182296 
 182297 	sqlite3Fts5BufferAppendPrintf(tls, bp+24, bp+32, ts+35762, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(p)).FzContentRowid))
 182298 	if (*Fts5Config)(unsafe.Pointer(p)).FeContent != FTS5_CONTENT_NONE {
 182299 		for i = 0; i < (*Fts5Config)(unsafe.Pointer(p)).FnCol; i++ {
 182300 			if (*Fts5Config)(unsafe.Pointer(p)).FeContent == FTS5_CONTENT_EXTERNAL {
 182301 				sqlite3Fts5BufferAppendPrintf(tls, bp+24, bp+32, ts+35767, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8))))
 182302 			} else {
 182303 				sqlite3Fts5BufferAppendPrintf(tls, bp+24, bp+32, ts+35774, libc.VaList(bp+16, i))
 182304 			}
 182305 		}
 182306 	}
 182307 
 182308 	(*Fts5Config)(unsafe.Pointer(p)).FzContentExprlist = (*Fts5Buffer)(unsafe.Pointer(bp + 32)).Fp
 182309 	return *(*int32)(unsafe.Pointer(bp + 24))
 182310 }
 182311 
 182312 func sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg int32, azArg uintptr, ppOut uintptr, pzErr uintptr) int32 {
 182313 	bp := tls.Alloc(76)
 182314 	defer tls.Free(76)
 182315 
 182316 	*(*int32)(unsafe.Pointer(bp + 40)) = SQLITE_OK
 182317 	var pRet uintptr
 182318 	var i int32
 182319 	var nByte Sqlite3_int64
 182320 
 182321 	*(*uintptr)(unsafe.Pointer(ppOut)) = libc.AssignUintptr(&pRet, Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Fts5Config{}))))
 182322 	if pRet == uintptr(0) {
 182323 		return SQLITE_NOMEM
 182324 	}
 182325 	libc.Xmemset(tls, pRet, 0, uint64(unsafe.Sizeof(Fts5Config{})))
 182326 	(*Fts5Config)(unsafe.Pointer(pRet)).Fdb = db
 182327 	(*Fts5Config)(unsafe.Pointer(pRet)).FiCookie = -1
 182328 
 182329 	nByte = Sqlite3_int64(uint64(nArg) * (uint64(unsafe.Sizeof(uintptr(0))) + uint64(unsafe.Sizeof(U8(0)))))
 182330 	(*Fts5Config)(unsafe.Pointer(pRet)).FazCol = sqlite3Fts5MallocZero(tls, bp+40, nByte)
 182331 	(*Fts5Config)(unsafe.Pointer(pRet)).FabUnindexed = func() uintptr {
 182332 		if (*Fts5Config)(unsafe.Pointer(pRet)).FazCol != 0 {
 182333 			return (*Fts5Config)(unsafe.Pointer(pRet)).FazCol + uintptr(nArg)*8
 182334 		}
 182335 		return uintptr(0)
 182336 	}()
 182337 	(*Fts5Config)(unsafe.Pointer(pRet)).FzDb = sqlite3Fts5Strndup(tls, bp+40, *(*uintptr)(unsafe.Pointer(azArg + 1*8)), -1)
 182338 	(*Fts5Config)(unsafe.Pointer(pRet)).FzName = sqlite3Fts5Strndup(tls, bp+40, *(*uintptr)(unsafe.Pointer(azArg + 2*8)), -1)
 182339 	(*Fts5Config)(unsafe.Pointer(pRet)).FbColumnsize = 1
 182340 	(*Fts5Config)(unsafe.Pointer(pRet)).FeDetail = FTS5_DETAIL_FULL
 182341 	if *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*Fts5Config)(unsafe.Pointer(pRet)).FzName, ts+23607) == 0 {
 182342 		*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+35782, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pRet)).FzName))
 182343 		*(*int32)(unsafe.Pointer(bp + 40)) = SQLITE_ERROR
 182344 	}
 182345 
 182346 	for i = 3; *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK && i < nArg; i++ {
 182347 		var zOrig uintptr = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8))
 182348 		var z uintptr
 182349 		*(*uintptr)(unsafe.Pointer(bp + 48)) = uintptr(0)
 182350 		*(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0)
 182351 		var bOption int32 = 0
 182352 		*(*int32)(unsafe.Pointer(bp + 56)) = 0
 182353 
 182354 		z = fts5ConfigGobbleWord(tls, bp+40, zOrig, bp+48, bp+56)
 182355 		z = fts5ConfigSkipWhitespace(tls, z)
 182356 		if z != 0 && int32(*(*int8)(unsafe.Pointer(z))) == '=' {
 182357 			bOption = 1
 182358 
 182359 			z++
 182360 			if *(*int32)(unsafe.Pointer(bp + 56)) != 0 {
 182361 				z = uintptr(0)
 182362 			}
 182363 		}
 182364 		z = fts5ConfigSkipWhitespace(tls, z)
 182365 		if z != 0 && *(*int8)(unsafe.Pointer(z)) != 0 {
 182366 			z = fts5ConfigGobbleWord(tls, bp+40, z, bp+64, bp+72)
 182367 			if z != 0 && *(*int8)(unsafe.Pointer(z)) != 0 {
 182368 				z = uintptr(0)
 182369 			}
 182370 		}
 182371 
 182372 		if *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK {
 182373 			if z == uintptr(0) {
 182374 				*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+35811, libc.VaList(bp+8, zOrig))
 182375 				*(*int32)(unsafe.Pointer(bp + 40)) = SQLITE_ERROR
 182376 			} else {
 182377 				if bOption != 0 {
 182378 					*(*int32)(unsafe.Pointer(bp + 40)) = fts5ConfigParseSpecial(tls, pGlobal, pRet,
 182379 						func() uintptr {
 182380 							if *(*uintptr)(unsafe.Pointer(bp + 48)) != 0 {
 182381 								return *(*uintptr)(unsafe.Pointer(bp + 48))
 182382 							}
 182383 							return ts + 1544
 182384 						}(),
 182385 						func() uintptr {
 182386 							if *(*uintptr)(unsafe.Pointer(bp + 64)) != 0 {
 182387 								return *(*uintptr)(unsafe.Pointer(bp + 64))
 182388 							}
 182389 							return ts + 1544
 182390 						}(),
 182391 						pzErr)
 182392 				} else {
 182393 					*(*int32)(unsafe.Pointer(bp + 40)) = fts5ConfigParseColumn(tls, pRet, *(*uintptr)(unsafe.Pointer(bp + 48)), *(*uintptr)(unsafe.Pointer(bp + 64)), pzErr)
 182394 					*(*uintptr)(unsafe.Pointer(bp + 48)) = uintptr(0)
 182395 				}
 182396 			}
 182397 		}
 182398 
 182399 		Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 48)))
 182400 		Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 64)))
 182401 	}
 182402 
 182403 	if *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pRet)).FpTok == uintptr(0) {
 182404 		*(*int32)(unsafe.Pointer(bp + 40)) = fts5ConfigDefaultTokenizer(tls, pGlobal, pRet)
 182405 	}
 182406 
 182407 	if *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pRet)).FzContent == uintptr(0) {
 182408 		var zTail uintptr = uintptr(0)
 182409 
 182410 		if (*Fts5Config)(unsafe.Pointer(pRet)).FeContent == FTS5_CONTENT_NORMAL {
 182411 			zTail = ts + 35480
 182412 		} else if (*Fts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 {
 182413 			zTail = ts + 35831
 182414 		}
 182415 
 182416 		if zTail != 0 {
 182417 			(*Fts5Config)(unsafe.Pointer(pRet)).FzContent = sqlite3Fts5Mprintf(tls,
 182418 				bp+40, ts+35839, libc.VaList(bp+16, (*Fts5Config)(unsafe.Pointer(pRet)).FzDb, (*Fts5Config)(unsafe.Pointer(pRet)).FzName, zTail))
 182419 		}
 182420 	}
 182421 
 182422 	if *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pRet)).FzContentRowid == uintptr(0) {
 182423 		(*Fts5Config)(unsafe.Pointer(pRet)).FzContentRowid = sqlite3Fts5Strndup(tls, bp+40, ts+17625, -1)
 182424 	}
 182425 
 182426 	if *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK {
 182427 		*(*int32)(unsafe.Pointer(bp + 40)) = fts5ConfigMakeExprlist(tls, pRet)
 182428 	}
 182429 
 182430 	if *(*int32)(unsafe.Pointer(bp + 40)) != SQLITE_OK {
 182431 		sqlite3Fts5ConfigFree(tls, pRet)
 182432 		*(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0)
 182433 	}
 182434 	return *(*int32)(unsafe.Pointer(bp + 40))
 182435 }
 182436 
 182437 func sqlite3Fts5ConfigFree(tls *libc.TLS, pConfig uintptr) {
 182438 	if pConfig != 0 {
 182439 		var i int32
 182440 		if (*Fts5Config)(unsafe.Pointer(pConfig)).FpTok != 0 {
 182441 			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Fts5_tokenizer)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FpTokApi)).FxDelete})).f(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FpTok)
 182442 		}
 182443 		Xsqlite3_free(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb)
 182444 		Xsqlite3_free(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)
 182445 		for i = 0; i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; i++ {
 182446 			Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))
 182447 		}
 182448 		Xsqlite3_free(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FazCol)
 182449 		Xsqlite3_free(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix)
 182450 		Xsqlite3_free(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FzRank)
 182451 		Xsqlite3_free(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FzRankArgs)
 182452 		Xsqlite3_free(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FzContent)
 182453 		Xsqlite3_free(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FzContentRowid)
 182454 		Xsqlite3_free(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FzContentExprlist)
 182455 		Xsqlite3_free(tls, pConfig)
 182456 	}
 182457 }
 182458 
 182459 func sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) int32 {
 182460 	bp := tls.Alloc(52)
 182461 	defer tls.Free(52)
 182462 
 182463 	var i int32
 182464 	*(*int32)(unsafe.Pointer(bp + 48)) = SQLITE_OK
 182465 	var zSql uintptr
 182466 
 182467 	zSql = sqlite3Fts5Mprintf(tls, bp+48, ts+35850, 0)
 182468 	for i = 0; zSql != 0 && i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; i++ {
 182469 		var zSep uintptr = func() uintptr {
 182470 			if i == 0 {
 182471 				return ts + 1544
 182472 			}
 182473 			return ts + 15971
 182474 		}()
 182475 		zSql = sqlite3Fts5Mprintf(tls, bp+48, ts+35866, libc.VaList(bp, zSql, zSep, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8))))
 182476 	}
 182477 	zSql = sqlite3Fts5Mprintf(tls, bp+48, ts+35873,
 182478 		libc.VaList(bp+24, zSql, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, ts+23607))
 182479 
 182480 	if zSql != 0 {
 182481 		*(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_declare_vtab(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql)
 182482 		Xsqlite3_free(tls, zSql)
 182483 	}
 182484 
 182485 	return *(*int32)(unsafe.Pointer(bp + 48))
 182486 }
 182487 
 182488 func sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, xToken uintptr) int32 {
 182489 	if pText == uintptr(0) {
 182490 		return SQLITE_OK
 182491 	}
 182492 	return (*struct {
 182493 		f func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32
 182494 	})(unsafe.Pointer(&struct{ uintptr }{(*Fts5_tokenizer)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FpTokApi)).FxTokenize})).f(tls,
 182495 		(*Fts5Config)(unsafe.Pointer(pConfig)).FpTok, pCtx, flags, pText, nText, xToken)
 182496 }
 182497 
 182498 func fts5ConfigSkipArgs(tls *libc.TLS, pIn uintptr) uintptr {
 182499 	var p uintptr = pIn
 182500 
 182501 	for 1 != 0 {
 182502 		p = fts5ConfigSkipWhitespace(tls, p)
 182503 		p = fts5ConfigSkipLiteral(tls, p)
 182504 		p = fts5ConfigSkipWhitespace(tls, p)
 182505 		if p == uintptr(0) || int32(*(*int8)(unsafe.Pointer(p))) == ')' {
 182506 			break
 182507 		}
 182508 		if int32(*(*int8)(unsafe.Pointer(p))) != ',' {
 182509 			p = uintptr(0)
 182510 			break
 182511 		}
 182512 		p++
 182513 	}
 182514 
 182515 	return p
 182516 }
 182517 
 182518 func sqlite3Fts5ConfigParseRank(tls *libc.TLS, zIn uintptr, pzRank uintptr, pzRankArgs uintptr) int32 {
 182519 	bp := tls.Alloc(4)
 182520 	defer tls.Free(4)
 182521 
 182522 	var p uintptr = zIn
 182523 	var pRank uintptr
 182524 	var zRank uintptr = uintptr(0)
 182525 	var zRankArgs uintptr = uintptr(0)
 182526 	*(*int32)(unsafe.Pointer(bp)) = SQLITE_OK
 182527 
 182528 	*(*uintptr)(unsafe.Pointer(pzRank)) = uintptr(0)
 182529 	*(*uintptr)(unsafe.Pointer(pzRankArgs)) = uintptr(0)
 182530 
 182531 	if p == uintptr(0) {
 182532 		*(*int32)(unsafe.Pointer(bp)) = SQLITE_ERROR
 182533 	} else {
 182534 		p = fts5ConfigSkipWhitespace(tls, p)
 182535 		pRank = p
 182536 		p = fts5ConfigSkipBareword(tls, p)
 182537 
 182538 		if p != 0 {
 182539 			zRank = sqlite3Fts5MallocZero(tls, bp, (int64(uintptr(1)+p)-int64(pRank))/1)
 182540 			if zRank != 0 {
 182541 				libc.Xmemcpy(tls, zRank, pRank, uint64((int64(p)-int64(pRank))/1))
 182542 			}
 182543 		} else {
 182544 			*(*int32)(unsafe.Pointer(bp)) = SQLITE_ERROR
 182545 		}
 182546 
 182547 		if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
 182548 			p = fts5ConfigSkipWhitespace(tls, p)
 182549 			if int32(*(*int8)(unsafe.Pointer(p))) != '(' {
 182550 				*(*int32)(unsafe.Pointer(bp)) = SQLITE_ERROR
 182551 			}
 182552 			p++
 182553 		}
 182554 		if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
 182555 			var pArgs uintptr
 182556 			p = fts5ConfigSkipWhitespace(tls, p)
 182557 			pArgs = p
 182558 			if int32(*(*int8)(unsafe.Pointer(p))) != ')' {
 182559 				p = fts5ConfigSkipArgs(tls, p)
 182560 				if p == uintptr(0) {
 182561 					*(*int32)(unsafe.Pointer(bp)) = SQLITE_ERROR
 182562 				} else {
 182563 					zRankArgs = sqlite3Fts5MallocZero(tls, bp, (int64(uintptr(1)+p)-int64(pArgs))/1)
 182564 					if zRankArgs != 0 {
 182565 						libc.Xmemcpy(tls, zRankArgs, pArgs, uint64((int64(p)-int64(pArgs))/1))
 182566 					}
 182567 				}
 182568 			}
 182569 		}
 182570 	}
 182571 
 182572 	if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK {
 182573 		Xsqlite3_free(tls, zRank)
 182574 
 182575 	} else {
 182576 		*(*uintptr)(unsafe.Pointer(pzRank)) = zRank
 182577 		*(*uintptr)(unsafe.Pointer(pzRankArgs)) = zRankArgs
 182578 	}
 182579 	return *(*int32)(unsafe.Pointer(bp))
 182580 }
 182581 
 182582 func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVal uintptr, pbBadkey uintptr) int32 {
 182583 	bp := tls.Alloc(16)
 182584 	defer tls.Free(16)
 182585 
 182586 	var rc int32 = SQLITE_OK
 182587 
 182588 	if 0 == Xsqlite3_stricmp(tls, zKey, ts+35899) {
 182589 		var pgsz int32 = 0
 182590 		if SQLITE_INTEGER == Xsqlite3_value_numeric_type(tls, pVal) {
 182591 			pgsz = Xsqlite3_value_int(tls, pVal)
 182592 		}
 182593 		if pgsz < 32 || pgsz > 64*1024 {
 182594 			*(*int32)(unsafe.Pointer(pbBadkey)) = 1
 182595 		} else {
 182596 			(*Fts5Config)(unsafe.Pointer(pConfig)).Fpgsz = pgsz
 182597 		}
 182598 	} else if 0 == Xsqlite3_stricmp(tls, zKey, ts+35904) {
 182599 		var nHashSize int32 = -1
 182600 		if SQLITE_INTEGER == Xsqlite3_value_numeric_type(tls, pVal) {
 182601 			nHashSize = Xsqlite3_value_int(tls, pVal)
 182602 		}
 182603 		if nHashSize <= 0 {
 182604 			*(*int32)(unsafe.Pointer(pbBadkey)) = 1
 182605 		} else {
 182606 			(*Fts5Config)(unsafe.Pointer(pConfig)).FnHashSize = nHashSize
 182607 		}
 182608 	} else if 0 == Xsqlite3_stricmp(tls, zKey, ts+35913) {
 182609 		var nAutomerge int32 = -1
 182610 		if SQLITE_INTEGER == Xsqlite3_value_numeric_type(tls, pVal) {
 182611 			nAutomerge = Xsqlite3_value_int(tls, pVal)
 182612 		}
 182613 		if nAutomerge < 0 || nAutomerge > 64 {
 182614 			*(*int32)(unsafe.Pointer(pbBadkey)) = 1
 182615 		} else {
 182616 			if nAutomerge == 1 {
 182617 				nAutomerge = FTS5_DEFAULT_AUTOMERGE
 182618 			}
 182619 			(*Fts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = nAutomerge
 182620 		}
 182621 	} else if 0 == Xsqlite3_stricmp(tls, zKey, ts+35923) {
 182622 		var nUsermerge int32 = -1
 182623 		if SQLITE_INTEGER == Xsqlite3_value_numeric_type(tls, pVal) {
 182624 			nUsermerge = Xsqlite3_value_int(tls, pVal)
 182625 		}
 182626 		if nUsermerge < 2 || nUsermerge > 16 {
 182627 			*(*int32)(unsafe.Pointer(pbBadkey)) = 1
 182628 		} else {
 182629 			(*Fts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = nUsermerge
 182630 		}
 182631 	} else if 0 == Xsqlite3_stricmp(tls, zKey, ts+35933) {
 182632 		var nCrisisMerge int32 = -1
 182633 		if SQLITE_INTEGER == Xsqlite3_value_numeric_type(tls, pVal) {
 182634 			nCrisisMerge = Xsqlite3_value_int(tls, pVal)
 182635 		}
 182636 		if nCrisisMerge < 0 {
 182637 			*(*int32)(unsafe.Pointer(pbBadkey)) = 1
 182638 		} else {
 182639 			if nCrisisMerge <= 1 {
 182640 				nCrisisMerge = FTS5_DEFAULT_CRISISMERGE
 182641 			}
 182642 			if nCrisisMerge >= FTS5_MAX_SEGMENT {
 182643 				nCrisisMerge = FTS5_MAX_SEGMENT - 1
 182644 			}
 182645 			(*Fts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = nCrisisMerge
 182646 		}
 182647 	} else if 0 == Xsqlite3_stricmp(tls, zKey, ts+23607) {
 182648 		var zIn uintptr = Xsqlite3_value_text(tls, pVal)
 182649 
 182650 		rc = sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8)
 182651 		if rc == SQLITE_OK {
 182652 			Xsqlite3_free(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FzRank)
 182653 			Xsqlite3_free(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FzRankArgs)
 182654 			(*Fts5Config)(unsafe.Pointer(pConfig)).FzRank = *(*uintptr)(unsafe.Pointer(bp))
 182655 			(*Fts5Config)(unsafe.Pointer(pConfig)).FzRankArgs = *(*uintptr)(unsafe.Pointer(bp + 8))
 182656 		} else if rc == SQLITE_ERROR {
 182657 			rc = SQLITE_OK
 182658 			*(*int32)(unsafe.Pointer(pbBadkey)) = 1
 182659 		}
 182660 	} else {
 182661 		*(*int32)(unsafe.Pointer(pbBadkey)) = 1
 182662 	}
 182663 	return rc
 182664 }
 182665 
 182666 func sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) int32 {
 182667 	bp := tls.Alloc(52)
 182668 	defer tls.Free(52)
 182669 
 182670 	var zSelect uintptr = ts + 35945
 182671 	var zSql uintptr
 182672 	*(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0)
 182673 	*(*int32)(unsafe.Pointer(bp + 32)) = SQLITE_OK
 182674 	var iVersion int32 = 0
 182675 
 182676 	(*Fts5Config)(unsafe.Pointer(pConfig)).Fpgsz = FTS5_DEFAULT_PAGE_SIZE
 182677 	(*Fts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = FTS5_DEFAULT_AUTOMERGE
 182678 	(*Fts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = FTS5_DEFAULT_USERMERGE
 182679 	(*Fts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = FTS5_DEFAULT_CRISISMERGE
 182680 	(*Fts5Config)(unsafe.Pointer(pConfig)).FnHashSize = 1024 * 1024
 182681 
 182682 	zSql = sqlite3Fts5Mprintf(tls, bp+32, zSelect, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
 182683 	if zSql != 0 {
 182684 		*(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_prepare_v2(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -1, bp+40, uintptr(0))
 182685 		Xsqlite3_free(tls, zSql)
 182686 	}
 182687 
 182688 	if *(*int32)(unsafe.Pointer(bp + 32)) == SQLITE_OK {
 182689 		for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) {
 182690 			var zK uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 40)), 0)
 182691 			var pVal uintptr = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp + 40)), 1)
 182692 			if 0 == Xsqlite3_stricmp(tls, zK, ts+35977) {
 182693 				iVersion = Xsqlite3_value_int(tls, pVal)
 182694 			} else {
 182695 				*(*int32)(unsafe.Pointer(bp + 48)) = 0
 182696 				sqlite3Fts5ConfigSetValue(tls, pConfig, zK, pVal, bp+48)
 182697 			}
 182698 		}
 182699 		*(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 40)))
 182700 	}
 182701 
 182702 	if *(*int32)(unsafe.Pointer(bp + 32)) == SQLITE_OK && iVersion != FTS5_CURRENT_VERSION {
 182703 		*(*int32)(unsafe.Pointer(bp + 32)) = SQLITE_ERROR
 182704 		if (*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg != 0 {
 182705 			*(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls,
 182706 				ts+35985,
 182707 				libc.VaList(bp+16, iVersion, FTS5_CURRENT_VERSION))
 182708 		}
 182709 	}
 182710 
 182711 	if *(*int32)(unsafe.Pointer(bp + 32)) == SQLITE_OK {
 182712 		(*Fts5Config)(unsafe.Pointer(pConfig)).FiCookie = iCookie
 182713 	}
 182714 	return *(*int32)(unsafe.Pointer(bp + 32))
 182715 }
 182716 
 182717 type Fts5ExprTerm1 = struct {
 182718 	FbPrefix     U8
 182719 	FbFirst      U8
 182720 	F__ccgo_pad1 [6]byte
 182721 	FzTerm       uintptr
 182722 	FpIter       uintptr
 182723 	FpSynonym    uintptr
 182724 }
 182725 
 182726 type Fts5ExprTerm = Fts5ExprTerm1
 182727 
 182728 func sqlite3Fts5ParseError(tls *libc.TLS, pParse uintptr, zFmt uintptr, va uintptr) {
 182729 	var ap Va_list
 182730 	_ = ap
 182731 	ap = va
 182732 	if (*Fts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK {
 182733 		(*Fts5Parse)(unsafe.Pointer(pParse)).FzErr = Xsqlite3_vmprintf(tls, zFmt, ap)
 182734 		(*Fts5Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR
 182735 	}
 182736 	_ = ap
 182737 }
 182738 
 182739 func fts5ExprIsspace(tls *libc.TLS, t int8) int32 {
 182740 	return libc.Bool32(int32(t) == ' ' || int32(t) == '\t' || int32(t) == '\n' || int32(t) == '\r')
 182741 }
 182742 
 182743 func fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr) int32 {
 182744 	bp := tls.Alloc(8)
 182745 	defer tls.Free(8)
 182746 
 182747 	var z uintptr = *(*uintptr)(unsafe.Pointer(pz))
 182748 	var tok int32
 182749 
 182750 	for fts5ExprIsspace(tls, *(*int8)(unsafe.Pointer(z))) != 0 {
 182751 		z++
 182752 	}
 182753 
 182754 	(*Fts5Token)(unsafe.Pointer(pToken)).Fp = z
 182755 	(*Fts5Token)(unsafe.Pointer(pToken)).Fn = 1
 182756 	switch int32(*(*int8)(unsafe.Pointer(z))) {
 182757 	case '(':
 182758 		tok = FTS5_LP
 182759 		break
 182760 	case ')':
 182761 		tok = FTS5_RP
 182762 		break
 182763 	case '{':
 182764 		tok = FTS5_LCP
 182765 		break
 182766 	case '}':
 182767 		tok = FTS5_RCP
 182768 		break
 182769 	case ':':
 182770 		tok = FTS5_COLON
 182771 		break
 182772 	case ',':
 182773 		tok = FTS5_COMMA
 182774 		break
 182775 	case '+':
 182776 		tok = FTS5_PLUS
 182777 		break
 182778 	case '*':
 182779 		tok = FTS5_STAR
 182780 		break
 182781 	case '-':
 182782 		tok = FTS5_MINUS
 182783 		break
 182784 	case '^':
 182785 		tok = FTS5_CARET
 182786 		break
 182787 	case 0:
 182788 		tok = FTS5_EOF
 182789 		break
 182790 
 182791 	case '"':
 182792 		{
 182793 			var z2 uintptr
 182794 			tok = FTS5_STRING
 182795 
 182796 			for z2 = z + 1; 1 != 0; z2++ {
 182797 				if int32(*(*int8)(unsafe.Pointer(z2))) == '"' {
 182798 					z2++
 182799 					if int32(*(*int8)(unsafe.Pointer(z2))) != '"' {
 182800 						break
 182801 					}
 182802 				}
 182803 				if int32(*(*int8)(unsafe.Pointer(z2))) == 0 {
 182804 					sqlite3Fts5ParseError(tls, pParse, ts+36050, 0)
 182805 					return FTS5_EOF
 182806 				}
 182807 			}
 182808 			(*Fts5Token)(unsafe.Pointer(pToken)).Fn = int32((int64(z2) - int64(z)) / 1)
 182809 			break
 182810 
 182811 		}
 182812 
 182813 	default:
 182814 		{
 182815 			var z2 uintptr
 182816 			if sqlite3Fts5IsBareword(tls, *(*int8)(unsafe.Pointer(z))) == 0 {
 182817 				sqlite3Fts5ParseError(tls, pParse, ts+36070, libc.VaList(bp, z))
 182818 				return FTS5_EOF
 182819 			}
 182820 			tok = FTS5_STRING
 182821 			for z2 = z + 1; sqlite3Fts5IsBareword(tls, *(*int8)(unsafe.Pointer(z2))) != 0; z2++ {
 182822 			}
 182823 			(*Fts5Token)(unsafe.Pointer(pToken)).Fn = int32((int64(z2) - int64(z)) / 1)
 182824 			if (*Fts5Token)(unsafe.Pointer(pToken)).Fn == 2 && libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+36101, uint64(2)) == 0 {
 182825 				tok = FTS5_OR
 182826 			}
 182827 			if (*Fts5Token)(unsafe.Pointer(pToken)).Fn == 3 && libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+36104, uint64(3)) == 0 {
 182828 				tok = FTS5_NOT
 182829 			}
 182830 			if (*Fts5Token)(unsafe.Pointer(pToken)).Fn == 3 && libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+31486, uint64(3)) == 0 {
 182831 				tok = FTS5_AND
 182832 			}
 182833 			break
 182834 
 182835 		}
 182836 	}
 182837 
 182838 	*(*uintptr)(unsafe.Pointer(pz)) = (*Fts5Token)(unsafe.Pointer(pToken)).Fp + uintptr((*Fts5Token)(unsafe.Pointer(pToken)).Fn)
 182839 	return tok
 182840 }
 182841 
 182842 func fts5ParseAlloc(tls *libc.TLS, t U64) uintptr {
 182843 	return Xsqlite3_malloc64(tls, uint64(Sqlite3_int64(t)))
 182844 }
 182845 
 182846 func fts5ParseFree(tls *libc.TLS, p uintptr) {
 182847 	Xsqlite3_free(tls, p)
 182848 }
 182849 
 182850 func sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCol int32, zExpr uintptr, ppNew uintptr, pzErr uintptr) int32 {
 182851 	bp := tls.Alloc(72)
 182852 	defer tls.Free(72)
 182853 
 182854 	*(*uintptr)(unsafe.Pointer(bp + 48)) = zExpr
 182855 	var t int32
 182856 	var pEngine uintptr
 182857 	var pNew uintptr
 182858 
 182859 	*(*uintptr)(unsafe.Pointer(ppNew)) = uintptr(0)
 182860 	*(*uintptr)(unsafe.Pointer(pzErr)) = uintptr(0)
 182861 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Fts5Parse{})))
 182862 	(*Fts5Parse)(unsafe.Pointer(bp)).FbPhraseToAnd = bPhraseToAnd
 182863 	pEngine = sqlite3Fts5ParserAlloc(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, U64) uintptr }{fts5ParseAlloc})))
 182864 	if pEngine == uintptr(0) {
 182865 		return SQLITE_NOMEM
 182866 	}
 182867 	(*Fts5Parse)(unsafe.Pointer(bp)).FpConfig = pConfig
 182868 
 182869 	for __ccgo := true; __ccgo; __ccgo = (*Fts5Parse)(unsafe.Pointer(bp)).Frc == SQLITE_OK && t != FTS5_EOF {
 182870 		t = fts5ExprGetToken(tls, bp, bp+48, bp+56)
 182871 		sqlite3Fts5Parser(tls, pEngine, t, *(*Fts5Token)(unsafe.Pointer(bp + 56)), bp)
 182872 	}
 182873 	sqlite3Fts5ParserFree(tls, pEngine, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5ParseFree})))
 182874 
 182875 	if iCol < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol && (*Fts5Parse)(unsafe.Pointer(bp)).FpExpr != 0 && (*Fts5Parse)(unsafe.Pointer(bp)).Frc == SQLITE_OK {
 182876 		var n int32 = int32(unsafe.Sizeof(Fts5Colset{}))
 182877 		var pColset uintptr = sqlite3Fts5MallocZero(tls, bp+16, int64(n))
 182878 		if pColset != 0 {
 182879 			(*Fts5Colset)(unsafe.Pointer(pColset)).FnCol = 1
 182880 			*(*int32)(unsafe.Pointer(pColset + 4)) = iCol
 182881 			sqlite3Fts5ParseSetColset(tls, bp, (*Fts5Parse)(unsafe.Pointer(bp)).FpExpr, pColset)
 182882 		}
 182883 	}
 182884 
 182885 	if (*Fts5Parse)(unsafe.Pointer(bp)).Frc == SQLITE_OK {
 182886 		*(*uintptr)(unsafe.Pointer(ppNew)) = libc.AssignUintptr(&pNew, Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Fts5Expr{}))))
 182887 		if pNew == uintptr(0) {
 182888 			(*Fts5Parse)(unsafe.Pointer(bp)).Frc = SQLITE_NOMEM
 182889 			sqlite3Fts5ParseNodeFree(tls, (*Fts5Parse)(unsafe.Pointer(bp)).FpExpr)
 182890 		} else {
 182891 			if !(int32((*Fts5Parse)(unsafe.Pointer(bp)).FpExpr) != 0) {
 182892 				var nByte int32 = int32(unsafe.Sizeof(Fts5ExprNode{}))
 182893 				(*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot = sqlite3Fts5MallocZero(tls, bp+16, int64(nByte))
 182894 				if (*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot != 0 {
 182895 					(*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FbEof = 1
 182896 				}
 182897 			} else {
 182898 				(*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot = (*Fts5Parse)(unsafe.Pointer(bp)).FpExpr
 182899 			}
 182900 			(*Fts5Expr)(unsafe.Pointer(pNew)).FpIndex = uintptr(0)
 182901 			(*Fts5Expr)(unsafe.Pointer(pNew)).FpConfig = pConfig
 182902 			(*Fts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase = (*Fts5Parse)(unsafe.Pointer(bp)).FapPhrase
 182903 			(*Fts5Expr)(unsafe.Pointer(pNew)).FnPhrase = (*Fts5Parse)(unsafe.Pointer(bp)).FnPhrase
 182904 			(*Fts5Expr)(unsafe.Pointer(pNew)).FbDesc = 0
 182905 			(*Fts5Parse)(unsafe.Pointer(bp)).FapPhrase = uintptr(0)
 182906 		}
 182907 	} else {
 182908 		sqlite3Fts5ParseNodeFree(tls, (*Fts5Parse)(unsafe.Pointer(bp)).FpExpr)
 182909 	}
 182910 
 182911 	Xsqlite3_free(tls, (*Fts5Parse)(unsafe.Pointer(bp)).FapPhrase)
 182912 	*(*uintptr)(unsafe.Pointer(pzErr)) = (*Fts5Parse)(unsafe.Pointer(bp)).FzErr
 182913 	return (*Fts5Parse)(unsafe.Pointer(bp)).Frc
 182914 }
 182915 
 182916 func fts5ExprCountChar(tls *libc.TLS, z uintptr, nByte int32) int32 {
 182917 	var nRet int32 = 0
 182918 	var ii int32
 182919 	for ii = 0; ii < nByte; ii++ {
 182920 		if int32(*(*int8)(unsafe.Pointer(z + uintptr(ii))))&0xC0 != 0x80 {
 182921 			nRet++
 182922 		}
 182923 	}
 182924 	return nRet
 182925 }
 182926 
 182927 func sqlite3Fts5ExprPattern(tls *libc.TLS, pConfig uintptr, bGlob int32, iCol int32, zText uintptr, pp uintptr) int32 {
 182928 	bp := tls.Alloc(3)
 182929 	defer tls.Free(3)
 182930 
 182931 	var nText I64 = I64(libc.Xstrlen(tls, zText))
 182932 	var zExpr uintptr = Xsqlite3_malloc64(tls, uint64(nText*int64(4)+int64(1)))
 182933 	var rc int32 = SQLITE_OK
 182934 
 182935 	if zExpr == uintptr(0) {
 182936 		rc = SQLITE_NOMEM
 182937 	} else {
 182938 		var iOut int32 = 0
 182939 		var i int32 = 0
 182940 		var iFirst int32 = 0
 182941 
 182942 		if bGlob == 0 {
 182943 			*(*int8)(unsafe.Pointer(bp)) = int8('_')
 182944 			*(*int8)(unsafe.Pointer(bp + 1)) = int8('%')
 182945 			*(*int8)(unsafe.Pointer(bp + 2)) = int8(0)
 182946 		} else {
 182947 			*(*int8)(unsafe.Pointer(bp)) = int8('*')
 182948 			*(*int8)(unsafe.Pointer(bp + 1)) = int8('?')
 182949 			*(*int8)(unsafe.Pointer(bp + 2)) = int8('[')
 182950 		}
 182951 
 182952 		for I64(i) <= nText {
 182953 			if I64(i) == nText ||
 182954 				int32(*(*int8)(unsafe.Pointer(zText + uintptr(i)))) == int32(*(*int8)(unsafe.Pointer(bp))) || int32(*(*int8)(unsafe.Pointer(zText + uintptr(i)))) == int32(*(*int8)(unsafe.Pointer(bp + 1))) || int32(*(*int8)(unsafe.Pointer(zText + uintptr(i)))) == int32(*(*int8)(unsafe.Pointer(bp + 2))) {
 182955 				if fts5ExprCountChar(tls, zText+uintptr(iFirst), i-iFirst) >= 3 {
 182956 					var jj int32
 182957 					*(*int8)(unsafe.Pointer(zExpr + uintptr(libc.PostIncInt32(&iOut, 1)))) = int8('"')
 182958 					for jj = iFirst; jj < i; jj++ {
 182959 						*(*int8)(unsafe.Pointer(zExpr + uintptr(libc.PostIncInt32(&iOut, 1)))) = *(*int8)(unsafe.Pointer(zText + uintptr(jj)))
 182960 						if int32(*(*int8)(unsafe.Pointer(zText + uintptr(jj)))) == '"' {
 182961 							*(*int8)(unsafe.Pointer(zExpr + uintptr(libc.PostIncInt32(&iOut, 1)))) = int8('"')
 182962 						}
 182963 					}
 182964 					*(*int8)(unsafe.Pointer(zExpr + uintptr(libc.PostIncInt32(&iOut, 1)))) = int8('"')
 182965 					*(*int8)(unsafe.Pointer(zExpr + uintptr(libc.PostIncInt32(&iOut, 1)))) = int8(' ')
 182966 				}
 182967 				if int32(*(*int8)(unsafe.Pointer(zText + uintptr(i)))) == int32(*(*int8)(unsafe.Pointer(bp + 2))) {
 182968 					i = i + 2
 182969 					if int32(*(*int8)(unsafe.Pointer(zText + uintptr(i-1)))) == '^' {
 182970 						i++
 182971 					}
 182972 					for I64(i) < nText && int32(*(*int8)(unsafe.Pointer(zText + uintptr(i)))) != ']' {
 182973 						i++
 182974 					}
 182975 				}
 182976 				iFirst = i + 1
 182977 			}
 182978 			i++
 182979 		}
 182980 		if iOut > 0 {
 182981 			var bAnd int32 = 0
 182982 			if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail != FTS5_DETAIL_FULL {
 182983 				bAnd = 1
 182984 				if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_NONE {
 182985 					iCol = (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol
 182986 				}
 182987 			}
 182988 			*(*int8)(unsafe.Pointer(zExpr + uintptr(iOut))) = int8(0)
 182989 			rc = sqlite3Fts5ExprNew(tls, pConfig, bAnd, iCol, zExpr, pp, (*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)
 182990 		} else {
 182991 			*(*uintptr)(unsafe.Pointer(pp)) = uintptr(0)
 182992 		}
 182993 		Xsqlite3_free(tls, zExpr)
 182994 	}
 182995 
 182996 	return rc
 182997 }
 182998 
 182999 func sqlite3Fts5ParseNodeFree(tls *libc.TLS, p uintptr) {
 183000 	if p != 0 {
 183001 		var i int32
 183002 		for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(p)).FnChild; i++ {
 183003 			sqlite3Fts5ParseNodeFree(tls, *(*uintptr)(unsafe.Pointer(p + 48 + uintptr(i)*8)))
 183004 		}
 183005 		sqlite3Fts5ParseNearsetFree(tls, (*Fts5ExprNode)(unsafe.Pointer(p)).FpNear)
 183006 		Xsqlite3_free(tls, p)
 183007 	}
 183008 }
 183009 
 183010 func sqlite3Fts5ExprFree(tls *libc.TLS, p uintptr) {
 183011 	if p != 0 {
 183012 		sqlite3Fts5ParseNodeFree(tls, (*Fts5Expr)(unsafe.Pointer(p)).FpRoot)
 183013 		Xsqlite3_free(tls, (*Fts5Expr)(unsafe.Pointer(p)).FapExprPhrase)
 183014 		Xsqlite3_free(tls, p)
 183015 	}
 183016 }
 183017 
 183018 func sqlite3Fts5ExprAnd(tls *libc.TLS, pp1 uintptr, p2 uintptr) int32 {
 183019 	bp := tls.Alloc(48)
 183020 	defer tls.Free(48)
 183021 
 183022 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Fts5Parse{})))
 183023 
 183024 	if *(*uintptr)(unsafe.Pointer(pp1)) != 0 {
 183025 		var p1 uintptr = *(*uintptr)(unsafe.Pointer(pp1))
 183026 		var nPhrase int32 = (*Fts5Expr)(unsafe.Pointer(p1)).FnPhrase + (*Fts5Expr)(unsafe.Pointer(p2)).FnPhrase
 183027 
 183028 		(*Fts5Expr)(unsafe.Pointer(p1)).FpRoot = sqlite3Fts5ParseNode(tls, bp, FTS5_AND, (*Fts5Expr)(unsafe.Pointer(p1)).FpRoot, (*Fts5Expr)(unsafe.Pointer(p2)).FpRoot, uintptr(0))
 183029 		(*Fts5Expr)(unsafe.Pointer(p2)).FpRoot = uintptr(0)
 183030 
 183031 		if (*Fts5Parse)(unsafe.Pointer(bp)).Frc == SQLITE_OK {
 183032 			var ap uintptr = Xsqlite3_realloc(tls,
 183033 				(*Fts5Expr)(unsafe.Pointer(p1)).FapExprPhrase, int32(uint64(nPhrase)*uint64(unsafe.Sizeof(uintptr(0)))))
 183034 			if ap == uintptr(0) {
 183035 				(*Fts5Parse)(unsafe.Pointer(bp)).Frc = SQLITE_NOMEM
 183036 			} else {
 183037 				var i int32
 183038 				libc.Xmemmove(tls, ap+uintptr((*Fts5Expr)(unsafe.Pointer(p2)).FnPhrase)*8, ap, uint64((*Fts5Expr)(unsafe.Pointer(p1)).FnPhrase)*uint64(unsafe.Sizeof(uintptr(0))))
 183039 				for i = 0; i < (*Fts5Expr)(unsafe.Pointer(p2)).FnPhrase; i++ {
 183040 					*(*uintptr)(unsafe.Pointer(ap + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(p2)).FapExprPhrase + uintptr(i)*8))
 183041 				}
 183042 				(*Fts5Expr)(unsafe.Pointer(p1)).FnPhrase = nPhrase
 183043 				(*Fts5Expr)(unsafe.Pointer(p1)).FapExprPhrase = ap
 183044 			}
 183045 		}
 183046 		Xsqlite3_free(tls, (*Fts5Expr)(unsafe.Pointer(p2)).FapExprPhrase)
 183047 		Xsqlite3_free(tls, p2)
 183048 	} else {
 183049 		*(*uintptr)(unsafe.Pointer(pp1)) = p2
 183050 	}
 183051 
 183052 	return (*Fts5Parse)(unsafe.Pointer(bp)).Frc
 183053 }
 183054 
 183055 func fts5ExprSynonymRowid(tls *libc.TLS, pTerm uintptr, bDesc int32, pbEof uintptr) I64 {
 183056 	var iRet I64 = int64(0)
 183057 	var bRetValid int32 = 0
 183058 	var p uintptr
 183059 
 183060 	for p = pTerm; p != 0; p = (*Fts5ExprTerm)(unsafe.Pointer(p)).FpSynonym {
 183061 		if 0 == int32((*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof) {
 183062 			var iRowid I64 = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FiRowid
 183063 			if bRetValid == 0 || bDesc != libc.Bool32(iRowid < iRet) {
 183064 				iRet = iRowid
 183065 				bRetValid = 1
 183066 			}
 183067 		}
 183068 	}
 183069 
 183070 	if pbEof != 0 && bRetValid == 0 {
 183071 		*(*int32)(unsafe.Pointer(pbEof)) = 1
 183072 	}
 183073 	return iRet
 183074 }
 183075 
 183076 func fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid I64, pBuf uintptr, pa uintptr, pn uintptr) int32 {
 183077 	bp := tls.Alloc(136)
 183078 	defer tls.Free(136)
 183079 
 183080 	var aIter uintptr
 183081 	var nIter int32
 183082 	var nAlloc int32
 183083 	var rc int32
 183084 	var p uintptr
 183085 	var nByte Sqlite3_int64
 183086 	var aNew uintptr
 183087 	var pIter uintptr
 183088 	var i int32
 183089 	var iMin I64
 183090 
 183091 	var iPrev I64
 183092 	aIter = bp
 183093 	nIter = 0
 183094 	nAlloc = 4
 183095 	rc = SQLITE_OK
 183096 
 183097 	p = pTerm
 183098 __1:
 183099 	if !(p != 0) {
 183100 		goto __3
 183101 	}
 183102 	pIter = (*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter
 183103 	if !(int32((*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof) == 0 && (*Fts5IndexIter)(unsafe.Pointer(pIter)).FiRowid == iRowid) {
 183104 		goto __4
 183105 	}
 183106 	if !((*Fts5IndexIter)(unsafe.Pointer(pIter)).FnData == 0) {
 183107 		goto __5
 183108 	}
 183109 	goto __2
 183110 __5:
 183111 	;
 183112 	if !(nIter == nAlloc) {
 183113 		goto __6
 183114 	}
 183115 	nByte = Sqlite3_int64(uint64(unsafe.Sizeof(Fts5PoslistReader{})) * uint64(nAlloc) * uint64(2))
 183116 	aNew = Xsqlite3_malloc64(tls, uint64(nByte))
 183117 	if !(aNew == uintptr(0)) {
 183118 		goto __7
 183119 	}
 183120 	rc = SQLITE_NOMEM
 183121 	goto synonym_poslist_out
 183122 __7:
 183123 	;
 183124 	libc.Xmemcpy(tls, aNew, aIter, uint64(unsafe.Sizeof(Fts5PoslistReader{}))*uint64(nIter))
 183125 	nAlloc = nAlloc * 2
 183126 	if !(aIter != bp) {
 183127 		goto __8
 183128 	}
 183129 	Xsqlite3_free(tls, aIter)
 183130 __8:
 183131 	;
 183132 	aIter = aNew
 183133 __6:
 183134 	;
 183135 	sqlite3Fts5PoslistReaderInit(tls, (*Fts5IndexIter)(unsafe.Pointer(pIter)).FpData, (*Fts5IndexIter)(unsafe.Pointer(pIter)).FnData, aIter+uintptr(nIter)*32)
 183136 
 183137 	nIter++
 183138 __4:
 183139 	;
 183140 	goto __2
 183141 __2:
 183142 	p = (*Fts5ExprTerm)(unsafe.Pointer(p)).FpSynonym
 183143 	goto __1
 183144 	goto __3
 183145 __3:
 183146 	;
 183147 	if !(nIter == 1) {
 183148 		goto __9
 183149 	}
 183150 	*(*uintptr)(unsafe.Pointer(pa)) = (*Fts5PoslistReader)(unsafe.Pointer(aIter)).Fa
 183151 	*(*int32)(unsafe.Pointer(pn)) = (*Fts5PoslistReader)(unsafe.Pointer(aIter)).Fn
 183152 	goto __10
 183153 __9:
 183154 	*(*Fts5PoslistWriter)(unsafe.Pointer(bp + 128)) = Fts5PoslistWriter{}
 183155 	iPrev = int64(-1)
 183156 	sqlite3Fts5BufferZero(tls, pBuf)
 183157 __11:
 183158 	if !(1 != 0) {
 183159 		goto __12
 183160 	}
 183161 	iMin = int64(0xffffffff) | int64(0x7fffffff)<<32
 183162 	i = 0
 183163 __13:
 183164 	if !(i < nIter) {
 183165 		goto __15
 183166 	}
 183167 	if !(int32((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(i)*32)).FbEof) == 0) {
 183168 		goto __16
 183169 	}
 183170 	if !((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(i)*32)).FiPos == iPrev) {
 183171 		goto __17
 183172 	}
 183173 	if !(sqlite3Fts5PoslistReaderNext(tls, aIter+uintptr(i)*32) != 0) {
 183174 		goto __18
 183175 	}
 183176 	goto __14
 183177 __18:
 183178 	;
 183179 __17:
 183180 	;
 183181 	if !((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(i)*32)).FiPos < iMin) {
 183182 		goto __19
 183183 	}
 183184 	iMin = (*Fts5PoslistReader)(unsafe.Pointer(aIter + uintptr(i)*32)).FiPos
 183185 __19:
 183186 	;
 183187 __16:
 183188 	;
 183189 	goto __14
 183190 __14:
 183191 	i++
 183192 	goto __13
 183193 	goto __15
 183194 __15:
 183195 	;
 183196 	if !(iMin == int64(0xffffffff)|int64(0x7fffffff)<<32 || rc != SQLITE_OK) {
 183197 		goto __20
 183198 	}
 183199 	goto __12
 183200 __20:
 183201 	;
 183202 	rc = sqlite3Fts5PoslistWriterAppend(tls, pBuf, bp+128, iMin)
 183203 	iPrev = iMin
 183204 	goto __11
 183205 __12:
 183206 	;
 183207 	if !(rc == SQLITE_OK) {
 183208 		goto __21
 183209 	}
 183210 	*(*uintptr)(unsafe.Pointer(pa)) = (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp
 183211 	*(*int32)(unsafe.Pointer(pn)) = (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn
 183212 __21:
 183213 	;
 183214 __10:
 183215 	;
 183216 synonym_poslist_out:
 183217 	if !(aIter != bp) {
 183218 		goto __22
 183219 	}
 183220 	Xsqlite3_free(tls, aIter)
 183221 __22:
 183222 	;
 183223 	return rc
 183224 }
 183225 
 183226 func fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMatch uintptr) int32 {
 183227 	bp := tls.Alloc(168)
 183228 	defer tls.Free(168)
 183229 
 183230 	var aIter uintptr
 183231 	var i int32
 183232 	var rc int32
 183233 	var bFirst int32
 183234 	var nByte Sqlite3_int64
 183235 
 183236 	var pTerm uintptr
 183237 
 183238 	var bFlag int32
 183239 
 183240 	var pPos uintptr
 183241 	var iAdj I64
 183242 	var bMatch int32
 183243 	var iPos I64
 183244 	*(*Fts5PoslistWriter)(unsafe.Pointer(bp + 160)) = Fts5PoslistWriter{}
 183245 	aIter = bp
 183246 	rc = SQLITE_OK
 183247 	bFirst = int32((*Fts5ExprTerm)(unsafe.Pointer(pPhrase + 32)).FbFirst)
 183248 
 183249 	sqlite3Fts5BufferZero(tls, pPhrase+8)
 183250 
 183251 	if !((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > int32(uint64(unsafe.Sizeof([4]Fts5PoslistReader{}))/uint64(unsafe.Sizeof(Fts5PoslistReader{})))) {
 183252 		goto __1
 183253 	}
 183254 	nByte = Sqlite3_int64(uint64(unsafe.Sizeof(Fts5PoslistReader{})) * uint64((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm))
 183255 	aIter = Xsqlite3_malloc64(tls, uint64(nByte))
 183256 	if !!(aIter != 0) {
 183257 		goto __2
 183258 	}
 183259 	return SQLITE_NOMEM
 183260 __2:
 183261 	;
 183262 __1:
 183263 	;
 183264 	libc.Xmemset(tls, aIter, 0, uint64(unsafe.Sizeof(Fts5PoslistReader{}))*uint64((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm))
 183265 
 183266 	i = 0
 183267 __3:
 183268 	if !(i < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm) {
 183269 		goto __5
 183270 	}
 183271 	pTerm = pPhrase + 32 + uintptr(i)*32
 183272 	*(*int32)(unsafe.Pointer(bp + 152)) = 0
 183273 	bFlag = 0
 183274 	*(*uintptr)(unsafe.Pointer(bp + 144)) = uintptr(0)
 183275 	if !((*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym != 0) {
 183276 		goto __6
 183277 	}
 183278 	*(*Fts5Buffer)(unsafe.Pointer(bp + 128)) = Fts5Buffer{}
 183279 	rc = fts5ExprSynonymList(tls, pTerm, (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid, bp+128, bp+144, bp+152)
 183280 	if !(rc != 0) {
 183281 		goto __8
 183282 	}
 183283 	Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 144)))
 183284 	goto ismatch_out
 183285 __8:
 183286 	;
 183287 	if !(*(*uintptr)(unsafe.Pointer(bp + 144)) == (*Fts5Buffer)(unsafe.Pointer(bp+128)).Fp) {
 183288 		goto __9
 183289 	}
 183290 	bFlag = 1
 183291 __9:
 183292 	;
 183293 	goto __7
 183294 __6:
 183295 	*(*uintptr)(unsafe.Pointer(bp + 144)) = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpIter)).FpData
 183296 	*(*int32)(unsafe.Pointer(bp + 152)) = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpIter)).FnData
 183297 __7:
 183298 	;
 183299 	sqlite3Fts5PoslistReaderInit(tls, *(*uintptr)(unsafe.Pointer(bp + 144)), *(*int32)(unsafe.Pointer(bp + 152)), aIter+uintptr(i)*32)
 183300 	(*Fts5PoslistReader)(unsafe.Pointer(aIter + uintptr(i)*32)).FbFlag = U8(bFlag)
 183301 	if !((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(i)*32)).FbEof != 0) {
 183302 		goto __10
 183303 	}
 183304 	goto ismatch_out
 183305 __10:
 183306 	;
 183307 	goto __4
 183308 __4:
 183309 	i++
 183310 	goto __3
 183311 	goto __5
 183312 __5:
 183313 	;
 183314 __11:
 183315 	if !(1 != 0) {
 183316 		goto __12
 183317 	}
 183318 	iPos = (*Fts5PoslistReader)(unsafe.Pointer(aIter)).FiPos
 183319 __13:
 183320 	bMatch = 1
 183321 	i = 0
 183322 __16:
 183323 	if !(i < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm) {
 183324 		goto __18
 183325 	}
 183326 	pPos = aIter + uintptr(i)*32
 183327 	iAdj = iPos + I64(i)
 183328 	if !((*Fts5PoslistReader)(unsafe.Pointer(pPos)).FiPos != iAdj) {
 183329 		goto __19
 183330 	}
 183331 	bMatch = 0
 183332 __20:
 183333 	if !((*Fts5PoslistReader)(unsafe.Pointer(pPos)).FiPos < iAdj) {
 183334 		goto __21
 183335 	}
 183336 	if !(sqlite3Fts5PoslistReaderNext(tls, pPos) != 0) {
 183337 		goto __22
 183338 	}
 183339 	goto ismatch_out
 183340 __22:
 183341 	;
 183342 	goto __20
 183343 __21:
 183344 	;
 183345 	if !((*Fts5PoslistReader)(unsafe.Pointer(pPos)).FiPos > iAdj) {
 183346 		goto __23
 183347 	}
 183348 	iPos = (*Fts5PoslistReader)(unsafe.Pointer(pPos)).FiPos - I64(i)
 183349 __23:
 183350 	;
 183351 __19:
 183352 	;
 183353 	goto __17
 183354 __17:
 183355 	i++
 183356 	goto __16
 183357 	goto __18
 183358 __18:
 183359 	;
 183360 	goto __14
 183361 __14:
 183362 	if bMatch == 0 {
 183363 		goto __13
 183364 	}
 183365 	goto __15
 183366 __15:
 183367 	;
 183368 	if !(bFirst == 0 || int32(iPos&int64(0x7FFFFFFF)) == 0) {
 183369 		goto __24
 183370 	}
 183371 	rc = sqlite3Fts5PoslistWriterAppend(tls, pPhrase+8, bp+160, iPos)
 183372 	if !(rc != SQLITE_OK) {
 183373 		goto __25
 183374 	}
 183375 	goto ismatch_out
 183376 __25:
 183377 	;
 183378 __24:
 183379 	;
 183380 	i = 0
 183381 __26:
 183382 	if !(i < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm) {
 183383 		goto __28
 183384 	}
 183385 	if !(sqlite3Fts5PoslistReaderNext(tls, aIter+uintptr(i)*32) != 0) {
 183386 		goto __29
 183387 	}
 183388 	goto ismatch_out
 183389 __29:
 183390 	;
 183391 	goto __27
 183392 __27:
 183393 	i++
 183394 	goto __26
 183395 	goto __28
 183396 __28:
 183397 	;
 183398 	goto __11
 183399 __12:
 183400 	;
 183401 ismatch_out:
 183402 	*(*int32)(unsafe.Pointer(pbMatch)) = libc.Bool32((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn > 0)
 183403 	i = 0
 183404 __30:
 183405 	if !(i < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm) {
 183406 		goto __32
 183407 	}
 183408 	if !((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(i)*32)).FbFlag != 0) {
 183409 		goto __33
 183410 	}
 183411 	Xsqlite3_free(tls, (*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(i)*32)).Fa)
 183412 __33:
 183413 	;
 183414 	goto __31
 183415 __31:
 183416 	i++
 183417 	goto __30
 183418 	goto __32
 183419 __32:
 183420 	;
 183421 	if !(aIter != bp) {
 183422 		goto __34
 183423 	}
 183424 	Xsqlite3_free(tls, aIter)
 183425 __34:
 183426 	;
 183427 	return rc
 183428 }
 183429 
 183430 type Fts5LookaheadReader1 = struct {
 183431 	Fa          uintptr
 183432 	Fn          int32
 183433 	Fi          int32
 183434 	FiPos       I64
 183435 	FiLookahead I64
 183436 }
 183437 
 183438 type Fts5LookaheadReader = Fts5LookaheadReader1
 183439 
 183440 func fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) int32 {
 183441 	(*Fts5LookaheadReader)(unsafe.Pointer(p)).FiPos = (*Fts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead
 183442 	if sqlite3Fts5PoslistNext64(tls, (*Fts5LookaheadReader)(unsafe.Pointer(p)).Fa, (*Fts5LookaheadReader)(unsafe.Pointer(p)).Fn, p+12, p+24) != 0 {
 183443 		(*Fts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead = int64(1) << 62
 183444 	}
 183445 	return libc.Bool32((*Fts5LookaheadReader)(unsafe.Pointer(p)).FiPos == int64(1)<<62)
 183446 }
 183447 
 183448 func fts5LookaheadReaderInit(tls *libc.TLS, a uintptr, n int32, p uintptr) int32 {
 183449 	libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Fts5LookaheadReader{})))
 183450 	(*Fts5LookaheadReader)(unsafe.Pointer(p)).Fa = a
 183451 	(*Fts5LookaheadReader)(unsafe.Pointer(p)).Fn = n
 183452 	fts5LookaheadReaderNext(tls, p)
 183453 	return fts5LookaheadReaderNext(tls, p)
 183454 }
 183455 
 183456 type Fts5NearTrimmer1 = struct {
 183457 	Freader Fts5LookaheadReader
 183458 	Fwriter Fts5PoslistWriter
 183459 	FpOut   uintptr
 183460 }
 183461 
 183462 type Fts5NearTrimmer = Fts5NearTrimmer1
 183463 
 183464 func fts5ExprNearIsMatch(tls *libc.TLS, pRc uintptr, pNear uintptr) int32 {
 183465 	bp := tls.Alloc(196)
 183466 	defer tls.Free(196)
 183467 
 183468 	var a uintptr
 183469 	var apPhrase uintptr
 183470 	var i int32
 183471 
 183472 	var bMatch int32
 183473 	var nByte Sqlite3_int64
 183474 	var pPoslist uintptr
 183475 	var pPos uintptr
 183476 	var iPos I64
 183477 	var pWriter uintptr
 183478 	var iAdv int32
 183479 	var iMin I64
 183480 	var iMax I64
 183481 	var bRet int32
 183482 	a = bp
 183483 	apPhrase = pNear + 24
 183484 	*(*int32)(unsafe.Pointer(bp + 192)) = *(*int32)(unsafe.Pointer(pRc))
 183485 
 183486 	if !((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase > int32(uint64(unsafe.Sizeof([4]Fts5NearTrimmer{}))/uint64(unsafe.Sizeof(Fts5NearTrimmer{})))) {
 183487 		goto __1
 183488 	}
 183489 	nByte = Sqlite3_int64(uint64(unsafe.Sizeof(Fts5NearTrimmer{})) * uint64((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase))
 183490 	a = sqlite3Fts5MallocZero(tls, bp+192, nByte)
 183491 	goto __2
 183492 __1:
 183493 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof([4]Fts5NearTrimmer{})))
 183494 __2:
 183495 	;
 183496 	if !(*(*int32)(unsafe.Pointer(bp + 192)) != SQLITE_OK) {
 183497 		goto __3
 183498 	}
 183499 	*(*int32)(unsafe.Pointer(pRc)) = *(*int32)(unsafe.Pointer(bp + 192))
 183500 	return 0
 183501 __3:
 183502 	;
 183503 	i = 0
 183504 __4:
 183505 	if !(i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase) {
 183506 		goto __6
 183507 	}
 183508 	pPoslist = *(*uintptr)(unsafe.Pointer(apPhrase + uintptr(i)*8)) + 8
 183509 	fts5LookaheadReaderInit(tls, (*Fts5Buffer)(unsafe.Pointer(pPoslist)).Fp, (*Fts5Buffer)(unsafe.Pointer(pPoslist)).Fn, a+uintptr(i)*48)
 183510 	(*Fts5Buffer)(unsafe.Pointer(pPoslist)).Fn = 0
 183511 	(*Fts5NearTrimmer)(unsafe.Pointer(a + uintptr(i)*48)).FpOut = pPoslist
 183512 	goto __5
 183513 __5:
 183514 	i++
 183515 	goto __4
 183516 	goto __6
 183517 __6:
 183518 	;
 183519 __7:
 183520 	if !(1 != 0) {
 183521 		goto __8
 183522 	}
 183523 
 183524 	iMax = (*Fts5NearTrimmer)(unsafe.Pointer(a)).Freader.FiPos
 183525 __9:
 183526 	bMatch = 1
 183527 	i = 0
 183528 __12:
 183529 	if !(i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase) {
 183530 		goto __14
 183531 	}
 183532 	pPos = a + uintptr(i)*48
 183533 	iMin = iMax - I64((*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 24 + uintptr(i)*8)))).FnTerm) - I64((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnNear)
 183534 	if !((*Fts5LookaheadReader)(unsafe.Pointer(pPos)).FiPos < iMin || (*Fts5LookaheadReader)(unsafe.Pointer(pPos)).FiPos > iMax) {
 183535 		goto __15
 183536 	}
 183537 	bMatch = 0
 183538 __16:
 183539 	if !((*Fts5LookaheadReader)(unsafe.Pointer(pPos)).FiPos < iMin) {
 183540 		goto __17
 183541 	}
 183542 	if !(fts5LookaheadReaderNext(tls, pPos) != 0) {
 183543 		goto __18
 183544 	}
 183545 	goto ismatch_out
 183546 __18:
 183547 	;
 183548 	goto __16
 183549 __17:
 183550 	;
 183551 	if !((*Fts5LookaheadReader)(unsafe.Pointer(pPos)).FiPos > iMax) {
 183552 		goto __19
 183553 	}
 183554 	iMax = (*Fts5LookaheadReader)(unsafe.Pointer(pPos)).FiPos
 183555 __19:
 183556 	;
 183557 __15:
 183558 	;
 183559 	goto __13
 183560 __13:
 183561 	i++
 183562 	goto __12
 183563 	goto __14
 183564 __14:
 183565 	;
 183566 	goto __10
 183567 __10:
 183568 	if bMatch == 0 {
 183569 		goto __9
 183570 	}
 183571 	goto __11
 183572 __11:
 183573 	;
 183574 	i = 0
 183575 __20:
 183576 	if !(i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase) {
 183577 		goto __22
 183578 	}
 183579 	iPos = (*Fts5NearTrimmer)(unsafe.Pointer(a + uintptr(i)*48)).Freader.FiPos
 183580 	pWriter = a + uintptr(i)*48 + 32
 183581 	if !((*Fts5Buffer)(unsafe.Pointer((*Fts5NearTrimmer)(unsafe.Pointer(a+uintptr(i)*48)).FpOut)).Fn == 0 || iPos != (*Fts5PoslistWriter)(unsafe.Pointer(pWriter)).FiPrev) {
 183582 		goto __23
 183583 	}
 183584 	sqlite3Fts5PoslistWriterAppend(tls, (*Fts5NearTrimmer)(unsafe.Pointer(a+uintptr(i)*48)).FpOut, pWriter, iPos)
 183585 __23:
 183586 	;
 183587 	goto __21
 183588 __21:
 183589 	i++
 183590 	goto __20
 183591 	goto __22
 183592 __22:
 183593 	;
 183594 	iAdv = 0
 183595 	iMin = (*Fts5NearTrimmer)(unsafe.Pointer(a)).Freader.FiLookahead
 183596 	i = 0
 183597 __24:
 183598 	if !(i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase) {
 183599 		goto __26
 183600 	}
 183601 	if !((*Fts5NearTrimmer)(unsafe.Pointer(a+uintptr(i)*48)).Freader.FiLookahead < iMin) {
 183602 		goto __27
 183603 	}
 183604 	iMin = (*Fts5NearTrimmer)(unsafe.Pointer(a + uintptr(i)*48)).Freader.FiLookahead
 183605 	iAdv = i
 183606 __27:
 183607 	;
 183608 	goto __25
 183609 __25:
 183610 	i++
 183611 	goto __24
 183612 	goto __26
 183613 __26:
 183614 	;
 183615 	if !(fts5LookaheadReaderNext(tls, a+uintptr(iAdv)*48) != 0) {
 183616 		goto __28
 183617 	}
 183618 	goto ismatch_out
 183619 __28:
 183620 	;
 183621 	goto __7
 183622 __8:
 183623 	;
 183624 ismatch_out:
 183625 	bRet = libc.Bool32((*Fts5Buffer)(unsafe.Pointer((*Fts5NearTrimmer)(unsafe.Pointer(a)).FpOut)).Fn > 0)
 183626 	*(*int32)(unsafe.Pointer(pRc)) = *(*int32)(unsafe.Pointer(bp + 192))
 183627 	if !(a != bp) {
 183628 		goto __29
 183629 	}
 183630 	Xsqlite3_free(tls, a)
 183631 __29:
 183632 	;
 183633 	return bRet
 183634 
 183635 	return int32(0)
 183636 }
 183637 
 183638 func fts5ExprAdvanceto(tls *libc.TLS, pIter uintptr, bDesc int32, piLast uintptr, pRc uintptr, pbEof uintptr) int32 {
 183639 	var iLast I64 = *(*I64)(unsafe.Pointer(piLast))
 183640 	var iRowid I64
 183641 
 183642 	iRowid = (*Fts5IndexIter)(unsafe.Pointer(pIter)).FiRowid
 183643 	if bDesc == 0 && iLast > iRowid || bDesc != 0 && iLast < iRowid {
 183644 		var rc int32 = sqlite3Fts5IterNextFrom(tls, pIter, iLast)
 183645 		if rc != 0 || (*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof != 0 {
 183646 			*(*int32)(unsafe.Pointer(pRc)) = rc
 183647 			*(*int32)(unsafe.Pointer(pbEof)) = 1
 183648 			return 1
 183649 		}
 183650 		iRowid = (*Fts5IndexIter)(unsafe.Pointer(pIter)).FiRowid
 183651 
 183652 	}
 183653 	*(*I64)(unsafe.Pointer(piLast)) = iRowid
 183654 
 183655 	return 0
 183656 }
 183657 
 183658 func fts5ExprSynonymAdvanceto(tls *libc.TLS, pTerm uintptr, bDesc int32, piLast uintptr, pRc uintptr) int32 {
 183659 	bp := tls.Alloc(4)
 183660 	defer tls.Free(4)
 183661 
 183662 	var rc int32 = SQLITE_OK
 183663 	var iLast I64 = *(*I64)(unsafe.Pointer(piLast))
 183664 	var p uintptr
 183665 	*(*int32)(unsafe.Pointer(bp)) = 0
 183666 
 183667 	for p = pTerm; rc == SQLITE_OK && p != 0; p = (*Fts5ExprTerm)(unsafe.Pointer(p)).FpSynonym {
 183668 		if int32((*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof) == 0 {
 183669 			var iRowid I64 = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FiRowid
 183670 			if bDesc == 0 && iLast > iRowid || bDesc != 0 && iLast < iRowid {
 183671 				rc = sqlite3Fts5IterNextFrom(tls, (*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter, iLast)
 183672 			}
 183673 		}
 183674 	}
 183675 
 183676 	if rc != SQLITE_OK {
 183677 		*(*int32)(unsafe.Pointer(pRc)) = rc
 183678 		*(*int32)(unsafe.Pointer(bp)) = 1
 183679 	} else {
 183680 		*(*I64)(unsafe.Pointer(piLast)) = fts5ExprSynonymRowid(tls, pTerm, bDesc, bp)
 183681 	}
 183682 	return *(*int32)(unsafe.Pointer(bp))
 183683 }
 183684 
 183685 func fts5ExprNearTest(tls *libc.TLS, pRc uintptr, pExpr uintptr, pNode uintptr) int32 {
 183686 	bp := tls.Alloc(8)
 183687 	defer tls.Free(8)
 183688 
 183689 	var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear
 183690 	*(*int32)(unsafe.Pointer(bp + 4)) = *(*int32)(unsafe.Pointer(pRc))
 183691 
 183692 	if (*Fts5Config)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FpConfig)).FeDetail != FTS5_DETAIL_FULL {
 183693 		var pTerm uintptr
 183694 		var pPhrase uintptr = *(*uintptr)(unsafe.Pointer(pNear + 24))
 183695 		(*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn = 0
 183696 		for pTerm = pPhrase + 32; pTerm != 0; pTerm = (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym {
 183697 			var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpIter
 183698 			if int32((*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof) == 0 {
 183699 				if (*Fts5IndexIter)(unsafe.Pointer(pIter)).FiRowid == (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid && (*Fts5IndexIter)(unsafe.Pointer(pIter)).FnData > 0 {
 183700 					(*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn = 1
 183701 				}
 183702 			}
 183703 		}
 183704 		return (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn
 183705 	} else {
 183706 		var i int32
 183707 
 183708 		for i = 0; *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK && i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; i++ {
 183709 			var pPhrase uintptr = *(*uintptr)(unsafe.Pointer(pNear + 24 + uintptr(i)*8))
 183710 			if (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 1 || (*Fts5ExprTerm)(unsafe.Pointer(pPhrase+32)).FpSynonym != 0 ||
 183711 				(*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset != 0 || (*Fts5ExprTerm)(unsafe.Pointer(pPhrase+32)).FbFirst != 0 {
 183712 				*(*int32)(unsafe.Pointer(bp)) = 0
 183713 				*(*int32)(unsafe.Pointer(bp + 4)) = fts5ExprPhraseIsMatch(tls, pNode, pPhrase, bp)
 183714 				if *(*int32)(unsafe.Pointer(bp)) == 0 {
 183715 					break
 183716 				}
 183717 			} else {
 183718 				var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer(pPhrase + 32)).FpIter
 183719 				sqlite3Fts5BufferSet(tls, bp+4, pPhrase+8, (*Fts5IndexIter)(unsafe.Pointer(pIter)).FnData, (*Fts5IndexIter)(unsafe.Pointer(pIter)).FpData)
 183720 			}
 183721 		}
 183722 
 183723 		*(*int32)(unsafe.Pointer(pRc)) = *(*int32)(unsafe.Pointer(bp + 4))
 183724 		if i == (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase && (i == 1 || fts5ExprNearIsMatch(tls, pRc, pNear) != 0) {
 183725 			return 1
 183726 		}
 183727 		return 0
 183728 	}
 183729 	return int32(0)
 183730 }
 183731 
 183732 func fts5ExprNearInitAll(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 {
 183733 	var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear
 183734 	var i int32
 183735 
 183736 	for i = 0; i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; i++ {
 183737 		var pPhrase uintptr = *(*uintptr)(unsafe.Pointer(pNear + 24 + uintptr(i)*8))
 183738 		if (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm == 0 {
 183739 			(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 1
 183740 			return SQLITE_OK
 183741 		} else {
 183742 			var j int32
 183743 			for j = 0; j < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm; j++ {
 183744 				var pTerm uintptr = pPhrase + 32 + uintptr(j)*32
 183745 				var p uintptr
 183746 				var bHit int32 = 0
 183747 
 183748 				for p = pTerm; p != 0; p = (*Fts5ExprTerm)(unsafe.Pointer(p)).FpSynonym {
 183749 					var rc int32
 183750 					if (*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter != 0 {
 183751 						sqlite3Fts5IterClose(tls, (*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)
 183752 						(*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter = uintptr(0)
 183753 					}
 183754 					rc = sqlite3Fts5IndexQuery(tls,
 183755 						(*Fts5Expr)(unsafe.Pointer(pExpr)).FpIndex, (*Fts5ExprTerm)(unsafe.Pointer(p)).FzTerm, int32(libc.Xstrlen(tls, (*Fts5ExprTerm)(unsafe.Pointer(p)).FzTerm)),
 183756 						func() int32 {
 183757 							if (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FbPrefix != 0 {
 183758 								return FTS5INDEX_QUERY_PREFIX
 183759 							}
 183760 							return 0
 183761 						}()|func() int32 {
 183762 							if (*Fts5Expr)(unsafe.Pointer(pExpr)).FbDesc != 0 {
 183763 								return FTS5INDEX_QUERY_DESC
 183764 							}
 183765 							return 0
 183766 						}(),
 183767 						(*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset,
 183768 						p+16)
 183769 
 183770 					if rc != SQLITE_OK {
 183771 						return rc
 183772 					}
 183773 					if 0 == int32((*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof) {
 183774 						bHit = 1
 183775 					}
 183776 				}
 183777 
 183778 				if bHit == 0 {
 183779 					(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 1
 183780 					return SQLITE_OK
 183781 				}
 183782 			}
 183783 		}
 183784 	}
 183785 
 183786 	(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 0
 183787 	return SQLITE_OK
 183788 }
 183789 
 183790 func fts5RowidCmp(tls *libc.TLS, pExpr uintptr, iLhs I64, iRhs I64) int32 {
 183791 	if (*Fts5Expr)(unsafe.Pointer(pExpr)).FbDesc == 0 {
 183792 		if iLhs < iRhs {
 183793 			return -1
 183794 		}
 183795 		return libc.Bool32(iLhs > iRhs)
 183796 	} else {
 183797 		if iLhs > iRhs {
 183798 			return -1
 183799 		}
 183800 		return libc.Bool32(iLhs < iRhs)
 183801 	}
 183802 	return int32(0)
 183803 }
 183804 
 183805 func fts5ExprSetEof(tls *libc.TLS, pNode uintptr) {
 183806 	var i int32
 183807 	(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 1
 183808 	(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0
 183809 	for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
 183810 		fts5ExprSetEof(tls, *(*uintptr)(unsafe.Pointer(pNode + 48 + uintptr(i)*8)))
 183811 	}
 183812 }
 183813 
 183814 func fts5ExprNodeZeroPoslist(tls *libc.TLS, pNode uintptr) {
 183815 	if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_STRING || (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_TERM {
 183816 		var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear
 183817 		var i int32
 183818 		for i = 0; i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; i++ {
 183819 			var pPhrase uintptr = *(*uintptr)(unsafe.Pointer(pNear + 24 + uintptr(i)*8))
 183820 			(*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn = 0
 183821 		}
 183822 	} else {
 183823 		var i int32
 183824 		for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
 183825 			fts5ExprNodeZeroPoslist(tls, *(*uintptr)(unsafe.Pointer(pNode + 48 + uintptr(i)*8)))
 183826 		}
 183827 	}
 183828 }
 183829 
 183830 func fts5NodeCompare(tls *libc.TLS, pExpr uintptr, p1 uintptr, p2 uintptr) int32 {
 183831 	if (*Fts5ExprNode)(unsafe.Pointer(p2)).FbEof != 0 {
 183832 		return -1
 183833 	}
 183834 	if (*Fts5ExprNode)(unsafe.Pointer(p1)).FbEof != 0 {
 183835 		return +1
 183836 	}
 183837 	return fts5RowidCmp(tls, pExpr, (*Fts5ExprNode)(unsafe.Pointer(p1)).FiRowid, (*Fts5ExprNode)(unsafe.Pointer(p2)).FiRowid)
 183838 }
 183839 
 183840 func fts5ExprNodeTest_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 {
 183841 	bp := tls.Alloc(12)
 183842 	defer tls.Free(12)
 183843 
 183844 	var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear
 183845 	var pLeft uintptr = *(*uintptr)(unsafe.Pointer(pNear + 24))
 183846 	*(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK
 183847 
 183848 	var i int32
 183849 	var j int32
 183850 	var bMatch int32
 183851 	var bDesc int32 = (*Fts5Expr)(unsafe.Pointer(pExpr)).FbDesc
 183852 
 183853 	if (*Fts5ExprTerm)(unsafe.Pointer(pLeft+32)).FpSynonym != 0 {
 183854 		*(*I64)(unsafe.Pointer(bp)) = fts5ExprSynonymRowid(tls, pLeft+32, bDesc, uintptr(0))
 183855 	} else {
 183856 		*(*I64)(unsafe.Pointer(bp)) = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(pLeft + 32)).FpIter)).FiRowid
 183857 	}
 183858 
 183859 	for __ccgo := true; __ccgo; __ccgo = bMatch == 0 {
 183860 		bMatch = 1
 183861 		for i = 0; i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; i++ {
 183862 			var pPhrase uintptr = *(*uintptr)(unsafe.Pointer(pNear + 24 + uintptr(i)*8))
 183863 			for j = 0; j < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm; j++ {
 183864 				var pTerm uintptr = pPhrase + 32 + uintptr(j)*32
 183865 				if (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym != 0 {
 183866 					var iRowid I64 = fts5ExprSynonymRowid(tls, pTerm, bDesc, uintptr(0))
 183867 					if iRowid == *(*I64)(unsafe.Pointer(bp)) {
 183868 						continue
 183869 					}
 183870 					bMatch = 0
 183871 					if fts5ExprSynonymAdvanceto(tls, pTerm, bDesc, bp, bp+8) != 0 {
 183872 						(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0
 183873 						(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 1
 183874 						return *(*int32)(unsafe.Pointer(bp + 8))
 183875 					}
 183876 				} else {
 183877 					var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer(pPhrase + 32 + uintptr(j)*32)).FpIter
 183878 					if (*Fts5IndexIter)(unsafe.Pointer(pIter)).FiRowid == *(*I64)(unsafe.Pointer(bp)) || (*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof != 0 {
 183879 						continue
 183880 					}
 183881 					bMatch = 0
 183882 					if fts5ExprAdvanceto(tls, pIter, bDesc, bp, bp+8, pNode+4) != 0 {
 183883 						return *(*int32)(unsafe.Pointer(bp + 8))
 183884 					}
 183885 				}
 183886 			}
 183887 		}
 183888 	}
 183889 
 183890 	(*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid = *(*I64)(unsafe.Pointer(bp))
 183891 	(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = libc.Bool32(0 == fts5ExprNearTest(tls, bp+8, pExpr, pNode) && *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK)
 183892 
 183893 	return *(*int32)(unsafe.Pointer(bp + 8))
 183894 }
 183895 
 183896 func fts5ExprNodeNext_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 {
 183897 	var pTerm uintptr = *(*uintptr)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 24)) + 32
 183898 	var rc int32 = SQLITE_OK
 183899 
 183900 	(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0
 183901 	if (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym != 0 {
 183902 		var bEof int32 = 1
 183903 		var p uintptr
 183904 
 183905 		var iRowid I64 = fts5ExprSynonymRowid(tls, pTerm, (*Fts5Expr)(unsafe.Pointer(pExpr)).FbDesc, uintptr(0))
 183906 
 183907 		for p = pTerm; p != 0; p = (*Fts5ExprTerm)(unsafe.Pointer(p)).FpSynonym {
 183908 			if int32((*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof) == 0 {
 183909 				var ii I64 = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FiRowid
 183910 				if ii == iRowid ||
 183911 					bFromValid != 0 && ii != iFrom && libc.Bool32(ii > iFrom) == (*Fts5Expr)(unsafe.Pointer(pExpr)).FbDesc {
 183912 					if bFromValid != 0 {
 183913 						rc = sqlite3Fts5IterNextFrom(tls, (*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter, iFrom)
 183914 					} else {
 183915 						rc = sqlite3Fts5IterNext(tls, (*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)
 183916 					}
 183917 					if rc != SQLITE_OK {
 183918 						break
 183919 					}
 183920 					if int32((*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof) == 0 {
 183921 						bEof = 0
 183922 					}
 183923 				} else {
 183924 					bEof = 0
 183925 				}
 183926 			}
 183927 		}
 183928 
 183929 		(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = libc.Bool32(rc != 0 || bEof != 0)
 183930 	} else {
 183931 		var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpIter
 183932 
 183933 		if bFromValid != 0 {
 183934 			rc = sqlite3Fts5IterNextFrom(tls, pIter, iFrom)
 183935 		} else {
 183936 			rc = sqlite3Fts5IterNext(tls, pIter)
 183937 		}
 183938 
 183939 		(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = libc.Bool32(rc != 0 || (*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof != 0)
 183940 	}
 183941 
 183942 	if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof == 0 {
 183943 		rc = fts5ExprNodeTest_STRING(tls, pExpr, pNode)
 183944 	}
 183945 
 183946 	return rc
 183947 }
 183948 
 183949 func fts5ExprNodeTest_TERM(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 {
 183950 	var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 24))
 183951 	var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer(pPhrase + 32)).FpIter
 183952 
 183953 	(*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn = (*Fts5IndexIter)(unsafe.Pointer(pIter)).FnData
 183954 	if (*Fts5Config)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FpConfig)).FeDetail == FTS5_DETAIL_FULL {
 183955 		(*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fp = (*Fts5IndexIter)(unsafe.Pointer(pIter)).FpData
 183956 	}
 183957 	(*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid = (*Fts5IndexIter)(unsafe.Pointer(pIter)).FiRowid
 183958 	(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = libc.Bool32((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn == 0)
 183959 	return SQLITE_OK
 183960 }
 183961 
 183962 func fts5ExprNodeNext_TERM(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 {
 183963 	var rc int32
 183964 	var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 24)) + 32)).FpIter
 183965 
 183966 	if bFromValid != 0 {
 183967 		rc = sqlite3Fts5IterNextFrom(tls, pIter, iFrom)
 183968 	} else {
 183969 		rc = sqlite3Fts5IterNext(tls, pIter)
 183970 	}
 183971 	if rc == SQLITE_OK && int32((*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof) == 0 {
 183972 		rc = fts5ExprNodeTest_TERM(tls, pExpr, pNode)
 183973 	} else {
 183974 		(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 1
 183975 		(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0
 183976 	}
 183977 	return rc
 183978 }
 183979 
 183980 func fts5ExprNodeTest_OR(tls *libc.TLS, pExpr uintptr, pNode uintptr) {
 183981 	var pNext uintptr = *(*uintptr)(unsafe.Pointer(pNode + 48))
 183982 	var i int32
 183983 
 183984 	for i = 1; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
 183985 		var pChild uintptr = *(*uintptr)(unsafe.Pointer(pNode + 48 + uintptr(i)*8))
 183986 		var cmp int32 = fts5NodeCompare(tls, pExpr, pNext, pChild)
 183987 		if cmp > 0 || cmp == 0 && (*Fts5ExprNode)(unsafe.Pointer(pChild)).FbNomatch == 0 {
 183988 			pNext = pChild
 183989 		}
 183990 	}
 183991 	(*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid = (*Fts5ExprNode)(unsafe.Pointer(pNext)).FiRowid
 183992 	(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = (*Fts5ExprNode)(unsafe.Pointer(pNext)).FbEof
 183993 	(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = (*Fts5ExprNode)(unsafe.Pointer(pNext)).FbNomatch
 183994 }
 183995 
 183996 func fts5ExprNodeNext_OR(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 {
 183997 	var i int32
 183998 	var iLast I64 = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid
 183999 
 184000 	for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
 184001 		var p1 uintptr = *(*uintptr)(unsafe.Pointer(pNode + 48 + uintptr(i)*8))
 184002 
 184003 		if (*Fts5ExprNode)(unsafe.Pointer(p1)).FbEof == 0 {
 184004 			if (*Fts5ExprNode)(unsafe.Pointer(p1)).FiRowid == iLast ||
 184005 				bFromValid != 0 && fts5RowidCmp(tls, pExpr, (*Fts5ExprNode)(unsafe.Pointer(p1)).FiRowid, iFrom) < 0 {
 184006 				var rc int32 = (*struct {
 184007 					f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
 184008 				})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer(p1)).FxNext})).f(tls, pExpr, p1, bFromValid, iFrom)
 184009 				if rc != SQLITE_OK {
 184010 					(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0
 184011 					return rc
 184012 				}
 184013 			}
 184014 		}
 184015 	}
 184016 
 184017 	fts5ExprNodeTest_OR(tls, pExpr, pNode)
 184018 	return SQLITE_OK
 184019 }
 184020 
 184021 func fts5ExprNodeTest_AND(tls *libc.TLS, pExpr uintptr, pAnd uintptr) int32 {
 184022 	var iChild int32
 184023 	var iLast I64 = (*Fts5ExprNode)(unsafe.Pointer(pAnd)).FiRowid
 184024 	var rc int32 = SQLITE_OK
 184025 	var bMatch int32
 184026 
 184027 	for __ccgo := true; __ccgo; __ccgo = bMatch == 0 {
 184028 		(*Fts5ExprNode)(unsafe.Pointer(pAnd)).FbNomatch = 0
 184029 		bMatch = 1
 184030 		for iChild = 0; iChild < (*Fts5ExprNode)(unsafe.Pointer(pAnd)).FnChild; iChild++ {
 184031 			var pChild uintptr = *(*uintptr)(unsafe.Pointer(pAnd + 48 + uintptr(iChild)*8))
 184032 			var cmp int32 = fts5RowidCmp(tls, pExpr, iLast, (*Fts5ExprNode)(unsafe.Pointer(pChild)).FiRowid)
 184033 			if cmp > 0 {
 184034 				rc = (*struct {
 184035 					f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
 184036 				})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer(pChild)).FxNext})).f(tls, pExpr, pChild, 1, iLast)
 184037 				if rc != SQLITE_OK {
 184038 					(*Fts5ExprNode)(unsafe.Pointer(pAnd)).FbNomatch = 0
 184039 					return rc
 184040 				}
 184041 			}
 184042 
 184043 			if (*Fts5ExprNode)(unsafe.Pointer(pChild)).FbEof != 0 {
 184044 				fts5ExprSetEof(tls, pAnd)
 184045 				bMatch = 1
 184046 				break
 184047 			} else if iLast != (*Fts5ExprNode)(unsafe.Pointer(pChild)).FiRowid {
 184048 				bMatch = 0
 184049 				iLast = (*Fts5ExprNode)(unsafe.Pointer(pChild)).FiRowid
 184050 			}
 184051 
 184052 			if (*Fts5ExprNode)(unsafe.Pointer(pChild)).FbNomatch != 0 {
 184053 				(*Fts5ExprNode)(unsafe.Pointer(pAnd)).FbNomatch = 1
 184054 			}
 184055 		}
 184056 	}
 184057 
 184058 	if (*Fts5ExprNode)(unsafe.Pointer(pAnd)).FbNomatch != 0 && pAnd != (*Fts5Expr)(unsafe.Pointer(pExpr)).FpRoot {
 184059 		fts5ExprNodeZeroPoslist(tls, pAnd)
 184060 	}
 184061 	(*Fts5ExprNode)(unsafe.Pointer(pAnd)).FiRowid = iLast
 184062 	return SQLITE_OK
 184063 }
 184064 
 184065 func fts5ExprNodeNext_AND(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 {
 184066 	var rc int32 = (*struct {
 184067 		f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
 184068 	})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNode + 48)))).FxNext})).f(tls, pExpr, *(*uintptr)(unsafe.Pointer(pNode + 48)), bFromValid, iFrom)
 184069 	if rc == SQLITE_OK {
 184070 		rc = fts5ExprNodeTest_AND(tls, pExpr, pNode)
 184071 	} else {
 184072 		(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0
 184073 	}
 184074 	return rc
 184075 }
 184076 
 184077 func fts5ExprNodeTest_NOT(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 {
 184078 	var rc int32 = SQLITE_OK
 184079 	var p1 uintptr = *(*uintptr)(unsafe.Pointer(pNode + 48))
 184080 	var p2 uintptr = *(*uintptr)(unsafe.Pointer(pNode + 48 + 1*8))
 184081 
 184082 	for rc == SQLITE_OK && (*Fts5ExprNode)(unsafe.Pointer(p1)).FbEof == 0 {
 184083 		var cmp int32 = fts5NodeCompare(tls, pExpr, p1, p2)
 184084 		if cmp > 0 {
 184085 			rc = (*struct {
 184086 				f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
 184087 			})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer(p2)).FxNext})).f(tls, pExpr, p2, 1, (*Fts5ExprNode)(unsafe.Pointer(p1)).FiRowid)
 184088 			cmp = fts5NodeCompare(tls, pExpr, p1, p2)
 184089 		}
 184090 
 184091 		if cmp != 0 || (*Fts5ExprNode)(unsafe.Pointer(p2)).FbNomatch != 0 {
 184092 			break
 184093 		}
 184094 		rc = (*struct {
 184095 			f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
 184096 		})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer(p1)).FxNext})).f(tls, pExpr, p1, 0, int64(0))
 184097 	}
 184098 	(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = (*Fts5ExprNode)(unsafe.Pointer(p1)).FbEof
 184099 	(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = (*Fts5ExprNode)(unsafe.Pointer(p1)).FbNomatch
 184100 	(*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid = (*Fts5ExprNode)(unsafe.Pointer(p1)).FiRowid
 184101 	if (*Fts5ExprNode)(unsafe.Pointer(p1)).FbEof != 0 {
 184102 		fts5ExprNodeZeroPoslist(tls, p2)
 184103 	}
 184104 	return rc
 184105 }
 184106 
 184107 func fts5ExprNodeNext_NOT(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 {
 184108 	var rc int32 = (*struct {
 184109 		f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
 184110 	})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNode + 48)))).FxNext})).f(tls, pExpr, *(*uintptr)(unsafe.Pointer(pNode + 48)), bFromValid, iFrom)
 184111 	if rc == SQLITE_OK {
 184112 		rc = fts5ExprNodeTest_NOT(tls, pExpr, pNode)
 184113 	}
 184114 	if rc != SQLITE_OK {
 184115 		(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0
 184116 	}
 184117 	return rc
 184118 }
 184119 
 184120 func fts5ExprNodeTest(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 {
 184121 	var rc int32 = SQLITE_OK
 184122 	if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof == 0 {
 184123 		switch (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType {
 184124 		case FTS5_STRING:
 184125 			{
 184126 				rc = fts5ExprNodeTest_STRING(tls, pExpr, pNode)
 184127 				break
 184128 
 184129 			}
 184130 			fallthrough
 184131 
 184132 		case FTS5_TERM:
 184133 			{
 184134 				rc = fts5ExprNodeTest_TERM(tls, pExpr, pNode)
 184135 				break
 184136 
 184137 			}
 184138 			fallthrough
 184139 
 184140 		case FTS5_AND:
 184141 			{
 184142 				rc = fts5ExprNodeTest_AND(tls, pExpr, pNode)
 184143 				break
 184144 
 184145 			}
 184146 			fallthrough
 184147 
 184148 		case FTS5_OR:
 184149 			{
 184150 				fts5ExprNodeTest_OR(tls, pExpr, pNode)
 184151 				break
 184152 
 184153 			}
 184154 			fallthrough
 184155 
 184156 		default:
 184157 			{
 184158 				rc = fts5ExprNodeTest_NOT(tls, pExpr, pNode)
 184159 				break
 184160 
 184161 			}
 184162 		}
 184163 	}
 184164 	return rc
 184165 }
 184166 
 184167 func fts5ExprNodeFirst(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 {
 184168 	var rc int32 = SQLITE_OK
 184169 	(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 0
 184170 	(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0
 184171 
 184172 	if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_TERM || (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_STRING {
 184173 		rc = fts5ExprNearInitAll(tls, pExpr, pNode)
 184174 	} else if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FxNext == uintptr(0) {
 184175 		(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 1
 184176 	} else {
 184177 		var i int32
 184178 		var nEof int32 = 0
 184179 		for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild && rc == SQLITE_OK; i++ {
 184180 			var pChild uintptr = *(*uintptr)(unsafe.Pointer(pNode + 48 + uintptr(i)*8))
 184181 			rc = fts5ExprNodeFirst(tls, pExpr, *(*uintptr)(unsafe.Pointer(pNode + 48 + uintptr(i)*8)))
 184182 
 184183 			nEof = nEof + (*Fts5ExprNode)(unsafe.Pointer(pChild)).FbEof
 184184 		}
 184185 		(*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid = (*Fts5ExprNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNode + 48)))).FiRowid
 184186 
 184187 		switch (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType {
 184188 		case FTS5_AND:
 184189 			if nEof > 0 {
 184190 				fts5ExprSetEof(tls, pNode)
 184191 			}
 184192 			break
 184193 			fallthrough
 184194 
 184195 		case FTS5_OR:
 184196 			if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild == nEof {
 184197 				fts5ExprSetEof(tls, pNode)
 184198 			}
 184199 			break
 184200 			fallthrough
 184201 
 184202 		default:
 184203 			(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = (*Fts5ExprNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNode + 48)))).FbEof
 184204 			break
 184205 		}
 184206 	}
 184207 
 184208 	if rc == SQLITE_OK {
 184209 		rc = fts5ExprNodeTest(tls, pExpr, pNode)
 184210 	}
 184211 	return rc
 184212 }
 184213 
 184214 func sqlite3Fts5ExprFirst(tls *libc.TLS, p uintptr, pIdx uintptr, iFirst I64, bDesc int32) int32 {
 184215 	var pRoot uintptr = (*Fts5Expr)(unsafe.Pointer(p)).FpRoot
 184216 	var rc int32
 184217 
 184218 	(*Fts5Expr)(unsafe.Pointer(p)).FpIndex = pIdx
 184219 	(*Fts5Expr)(unsafe.Pointer(p)).FbDesc = bDesc
 184220 	rc = fts5ExprNodeFirst(tls, p, pRoot)
 184221 
 184222 	if rc == SQLITE_OK &&
 184223 		0 == (*Fts5ExprNode)(unsafe.Pointer(pRoot)).FbEof &&
 184224 		fts5RowidCmp(tls, p, (*Fts5ExprNode)(unsafe.Pointer(pRoot)).FiRowid, iFirst) < 0 {
 184225 		rc = (*struct {
 184226 			f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
 184227 		})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer(pRoot)).FxNext})).f(tls, p, pRoot, 1, iFirst)
 184228 	}
 184229 
 184230 	for (*Fts5ExprNode)(unsafe.Pointer(pRoot)).FbNomatch != 0 && rc == SQLITE_OK {
 184231 		rc = (*struct {
 184232 			f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
 184233 		})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer(pRoot)).FxNext})).f(tls, p, pRoot, 0, int64(0))
 184234 	}
 184235 	return rc
 184236 }
 184237 
 184238 func sqlite3Fts5ExprNext(tls *libc.TLS, p uintptr, iLast I64) int32 {
 184239 	var rc int32
 184240 	var pRoot uintptr = (*Fts5Expr)(unsafe.Pointer(p)).FpRoot
 184241 
 184242 	for __ccgo := true; __ccgo; __ccgo = (*Fts5ExprNode)(unsafe.Pointer(pRoot)).FbNomatch != 0 {
 184243 		rc = (*struct {
 184244 			f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
 184245 		})(unsafe.Pointer(&struct{ uintptr }{(*Fts5ExprNode)(unsafe.Pointer(pRoot)).FxNext})).f(tls, p, pRoot, 0, int64(0))
 184246 
 184247 	}
 184248 	if fts5RowidCmp(tls, p, (*Fts5ExprNode)(unsafe.Pointer(pRoot)).FiRowid, iLast) > 0 {
 184249 		(*Fts5ExprNode)(unsafe.Pointer(pRoot)).FbEof = 1
 184250 	}
 184251 	return rc
 184252 }
 184253 
 184254 func sqlite3Fts5ExprEof(tls *libc.TLS, p uintptr) int32 {
 184255 	return (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(p)).FpRoot)).FbEof
 184256 }
 184257 
 184258 func sqlite3Fts5ExprRowid(tls *libc.TLS, p uintptr) I64 {
 184259 	return (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(p)).FpRoot)).FiRowid
 184260 }
 184261 
 184262 func fts5ParseStringFromToken(tls *libc.TLS, pToken uintptr, pz uintptr) int32 {
 184263 	bp := tls.Alloc(4)
 184264 	defer tls.Free(4)
 184265 
 184266 	*(*int32)(unsafe.Pointer(bp)) = SQLITE_OK
 184267 	*(*uintptr)(unsafe.Pointer(pz)) = sqlite3Fts5Strndup(tls, bp, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, (*Fts5Token)(unsafe.Pointer(pToken)).Fn)
 184268 	return *(*int32)(unsafe.Pointer(bp))
 184269 }
 184270 
 184271 func fts5ExprPhraseFree(tls *libc.TLS, pPhrase uintptr) {
 184272 	if pPhrase != 0 {
 184273 		var i int32
 184274 		for i = 0; i < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm; i++ {
 184275 			var pSyn uintptr
 184276 			var pNext uintptr
 184277 			var pTerm uintptr = pPhrase + 32 + uintptr(i)*32
 184278 			Xsqlite3_free(tls, (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FzTerm)
 184279 			sqlite3Fts5IterClose(tls, (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpIter)
 184280 			for pSyn = (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym; pSyn != 0; pSyn = pNext {
 184281 				pNext = (*Fts5ExprTerm)(unsafe.Pointer(pSyn)).FpSynonym
 184282 				sqlite3Fts5IterClose(tls, (*Fts5ExprTerm)(unsafe.Pointer(pSyn)).FpIter)
 184283 				sqlite3Fts5BufferFree(tls, pSyn+1*32)
 184284 				Xsqlite3_free(tls, pSyn)
 184285 			}
 184286 		}
 184287 		if (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.FnSpace > 0 {
 184288 			sqlite3Fts5BufferFree(tls, pPhrase+8)
 184289 		}
 184290 		Xsqlite3_free(tls, pPhrase)
 184291 	}
 184292 }
 184293 
 184294 func sqlite3Fts5ParseSetCaret(tls *libc.TLS, pPhrase uintptr) {
 184295 	if pPhrase != 0 && (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm != 0 {
 184296 		(*Fts5ExprTerm)(unsafe.Pointer(pPhrase + 32)).FbFirst = U8(1)
 184297 	}
 184298 }
 184299 
 184300 func sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhrase uintptr) uintptr {
 184301 	var SZALLOC int32 = 8
 184302 	var pRet uintptr = uintptr(0)
 184303 
 184304 	if (*Fts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK {
 184305 		if pPhrase == uintptr(0) {
 184306 			return pNear
 184307 		}
 184308 		if pNear == uintptr(0) {
 184309 			var nByte Sqlite3_int64
 184310 			nByte = Sqlite3_int64(uint64(unsafe.Sizeof(Fts5ExprNearset{})) + uint64(SZALLOC)*uint64(unsafe.Sizeof(uintptr(0))))
 184311 			pRet = Xsqlite3_malloc64(tls, uint64(nByte))
 184312 			if pRet == uintptr(0) {
 184313 				(*Fts5Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_NOMEM
 184314 			} else {
 184315 				libc.Xmemset(tls, pRet, 0, Size_t(nByte))
 184316 			}
 184317 		} else if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase%SZALLOC == 0 {
 184318 			var nNew int32 = (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase + SZALLOC
 184319 			var nByte Sqlite3_int64
 184320 
 184321 			nByte = Sqlite3_int64(uint64(unsafe.Sizeof(Fts5ExprNearset{})) + uint64(nNew)*uint64(unsafe.Sizeof(uintptr(0))))
 184322 			pRet = Xsqlite3_realloc64(tls, pNear, uint64(nByte))
 184323 			if pRet == uintptr(0) {
 184324 				(*Fts5Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_NOMEM
 184325 			}
 184326 		} else {
 184327 			pRet = pNear
 184328 		}
 184329 	}
 184330 
 184331 	if pRet == uintptr(0) {
 184332 		sqlite3Fts5ParseNearsetFree(tls, pNear)
 184333 		sqlite3Fts5ParsePhraseFree(tls, pPhrase)
 184334 	} else {
 184335 		if (*Fts5ExprNearset)(unsafe.Pointer(pRet)).FnPhrase > 0 {
 184336 			var pLast uintptr = *(*uintptr)(unsafe.Pointer(pRet + 24 + uintptr((*Fts5ExprNearset)(unsafe.Pointer(pRet)).FnPhrase-1)*8))
 184337 
 184338 			if (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm == 0 {
 184339 				fts5ExprPhraseFree(tls, pPhrase)
 184340 				(*Fts5ExprNearset)(unsafe.Pointer(pRet)).FnPhrase--
 184341 				(*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase--
 184342 				pPhrase = pLast
 184343 			} else if (*Fts5ExprPhrase)(unsafe.Pointer(pLast)).FnTerm == 0 {
 184344 				fts5ExprPhraseFree(tls, pLast)
 184345 				*(*uintptr)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase + uintptr((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase-2)*8)) = pPhrase
 184346 				(*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase--
 184347 				(*Fts5ExprNearset)(unsafe.Pointer(pRet)).FnPhrase--
 184348 			}
 184349 		}
 184350 		*(*uintptr)(unsafe.Pointer(pRet + 24 + uintptr(libc.PostIncInt32(&(*Fts5ExprNearset)(unsafe.Pointer(pRet)).FnPhrase, 1))*8)) = pPhrase
 184351 	}
 184352 	return pRet
 184353 }
 184354 
 184355 type TokenCtx1 = struct {
 184356 	FpPhrase     uintptr
 184357 	Frc          int32
 184358 	F__ccgo_pad1 [4]byte
 184359 }
 184360 
 184361 type TokenCtx = TokenCtx1
 184362 
 184363 func fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 {
 184364 	bp := tls.Alloc(4)
 184365 	defer tls.Free(4)
 184366 
 184367 	*(*int32)(unsafe.Pointer(bp)) = SQLITE_OK
 184368 	var SZALLOC int32 = 8
 184369 	var pCtx uintptr = pContext
 184370 	var pPhrase uintptr = (*TokenCtx)(unsafe.Pointer(pCtx)).FpPhrase
 184371 
 184372 	_ = iUnused1
 184373 	_ = iUnused2
 184374 
 184375 	if (*TokenCtx)(unsafe.Pointer(pCtx)).Frc != SQLITE_OK {
 184376 		return (*TokenCtx)(unsafe.Pointer(pCtx)).Frc
 184377 	}
 184378 	if nToken > FTS5_MAX_TOKEN_SIZE {
 184379 		nToken = FTS5_MAX_TOKEN_SIZE
 184380 	}
 184381 
 184382 	if pPhrase != 0 && (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0 && tflags&FTS5_TOKEN_COLOCATED != 0 {
 184383 		var pSyn uintptr
 184384 		var nByte Sqlite3_int64 = Sqlite3_int64(uint64(unsafe.Sizeof(Fts5ExprTerm{})) + uint64(unsafe.Sizeof(Fts5Buffer{})) + uint64(nToken) + uint64(1))
 184385 		pSyn = Xsqlite3_malloc64(tls, uint64(nByte))
 184386 		if pSyn == uintptr(0) {
 184387 			*(*int32)(unsafe.Pointer(bp)) = SQLITE_NOMEM
 184388 		} else {
 184389 			libc.Xmemset(tls, pSyn, 0, Size_t(nByte))
 184390 			(*Fts5ExprTerm)(unsafe.Pointer(pSyn)).FzTerm = pSyn + uintptr(uint64(unsafe.Sizeof(Fts5ExprTerm{}))) + uintptr(uint64(unsafe.Sizeof(Fts5Buffer{})))
 184391 			libc.Xmemcpy(tls, (*Fts5ExprTerm)(unsafe.Pointer(pSyn)).FzTerm, pToken, uint64(nToken))
 184392 			(*Fts5ExprTerm)(unsafe.Pointer(pSyn)).FpSynonym = (*Fts5ExprTerm)(unsafe.Pointer(pPhrase + 32 + uintptr((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm-1)*32)).FpSynonym
 184393 			(*Fts5ExprTerm)(unsafe.Pointer(pPhrase + 32 + uintptr((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm-1)*32)).FpSynonym = pSyn
 184394 		}
 184395 	} else {
 184396 		var pTerm uintptr
 184397 		if pPhrase == uintptr(0) || (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm%SZALLOC == 0 {
 184398 			var pNew uintptr
 184399 			var nNew int32 = SZALLOC + func() int32 {
 184400 				if pPhrase != 0 {
 184401 					return (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm
 184402 				}
 184403 				return 0
 184404 			}()
 184405 
 184406 			pNew = Xsqlite3_realloc64(tls, pPhrase,
 184407 				uint64(unsafe.Sizeof(Fts5ExprPhrase{}))+uint64(unsafe.Sizeof(Fts5ExprTerm{}))*uint64(nNew))
 184408 			if pNew == uintptr(0) {
 184409 				*(*int32)(unsafe.Pointer(bp)) = SQLITE_NOMEM
 184410 			} else {
 184411 				if pPhrase == uintptr(0) {
 184412 					libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(Fts5ExprPhrase{})))
 184413 				}
 184414 				(*TokenCtx)(unsafe.Pointer(pCtx)).FpPhrase = libc.AssignUintptr(&pPhrase, pNew)
 184415 				(*Fts5ExprPhrase)(unsafe.Pointer(pNew)).FnTerm = nNew - SZALLOC
 184416 			}
 184417 		}
 184418 
 184419 		if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
 184420 			pTerm = pPhrase + 32 + uintptr(libc.PostIncInt32(&(*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm, 1))*32
 184421 			libc.Xmemset(tls, pTerm, 0, uint64(unsafe.Sizeof(Fts5ExprTerm{})))
 184422 			(*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FzTerm = sqlite3Fts5Strndup(tls, bp, pToken, nToken)
 184423 		}
 184424 	}
 184425 
 184426 	(*TokenCtx)(unsafe.Pointer(pCtx)).Frc = *(*int32)(unsafe.Pointer(bp))
 184427 	return *(*int32)(unsafe.Pointer(bp))
 184428 }
 184429 
 184430 func sqlite3Fts5ParsePhraseFree(tls *libc.TLS, pPhrase uintptr) {
 184431 	fts5ExprPhraseFree(tls, pPhrase)
 184432 }
 184433 
 184434 func sqlite3Fts5ParseNearsetFree(tls *libc.TLS, pNear uintptr) {
 184435 	if pNear != 0 {
 184436 		var i int32
 184437 		for i = 0; i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; i++ {
 184438 			fts5ExprPhraseFree(tls, *(*uintptr)(unsafe.Pointer(pNear + 24 + uintptr(i)*8)))
 184439 		}
 184440 		Xsqlite3_free(tls, (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset)
 184441 		Xsqlite3_free(tls, pNear)
 184442 	}
 184443 }
 184444 
 184445 func sqlite3Fts5ParseFinished(tls *libc.TLS, pParse uintptr, p uintptr) {
 184446 	(*Fts5Parse)(unsafe.Pointer(pParse)).FpExpr = p
 184447 }
 184448 
 184449 func parseGrowPhraseArray(tls *libc.TLS, pParse uintptr) int32 {
 184450 	if (*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase%8 == 0 {
 184451 		var nByte Sqlite3_int64 = Sqlite3_int64(uint64(unsafe.Sizeof(uintptr(0))) * uint64((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase+8))
 184452 		var apNew uintptr
 184453 		apNew = Xsqlite3_realloc64(tls, (*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase, uint64(nByte))
 184454 		if apNew == uintptr(0) {
 184455 			(*Fts5Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_NOMEM
 184456 			return SQLITE_NOMEM
 184457 		}
 184458 		(*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase = apNew
 184459 	}
 184460 	return SQLITE_OK
 184461 }
 184462 
 184463 func sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToken uintptr, bPrefix int32) uintptr {
 184464 	bp := tls.Alloc(24)
 184465 	defer tls.Free(24)
 184466 
 184467 	var pConfig uintptr = (*Fts5Parse)(unsafe.Pointer(pParse)).FpConfig
 184468 
 184469 	var rc int32
 184470 	*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
 184471 
 184472 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(TokenCtx{})))
 184473 	(*TokenCtx)(unsafe.Pointer(bp)).FpPhrase = pAppend
 184474 
 184475 	rc = fts5ParseStringFromToken(tls, pToken, bp+16)
 184476 	if rc == SQLITE_OK {
 184477 		var flags int32 = FTS5_TOKENIZE_QUERY | func() int32 {
 184478 			if bPrefix != 0 {
 184479 				return FTS5_TOKENIZE_PREFIX
 184480 			}
 184481 			return 0
 184482 		}()
 184483 		var n int32
 184484 		sqlite3Fts5Dequote(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
 184485 		n = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 16))))
 184486 		rc = sqlite3Fts5Tokenize(tls, pConfig, flags, *(*uintptr)(unsafe.Pointer(bp + 16)), n, bp, *(*uintptr)(unsafe.Pointer(&struct {
 184487 			f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
 184488 		}{fts5ParseTokenize})))
 184489 	}
 184490 	Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
 184491 	if rc != 0 || libc.AssignInt32(&rc, (*TokenCtx)(unsafe.Pointer(bp)).Frc) != 0 {
 184492 		(*Fts5Parse)(unsafe.Pointer(pParse)).Frc = rc
 184493 		fts5ExprPhraseFree(tls, (*TokenCtx)(unsafe.Pointer(bp)).FpPhrase)
 184494 		(*TokenCtx)(unsafe.Pointer(bp)).FpPhrase = uintptr(0)
 184495 	} else {
 184496 		if pAppend == uintptr(0) {
 184497 			if parseGrowPhraseArray(tls, pParse) != 0 {
 184498 				fts5ExprPhraseFree(tls, (*TokenCtx)(unsafe.Pointer(bp)).FpPhrase)
 184499 				return uintptr(0)
 184500 			}
 184501 			(*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase++
 184502 		}
 184503 
 184504 		if (*TokenCtx)(unsafe.Pointer(bp)).FpPhrase == uintptr(0) {
 184505 			(*TokenCtx)(unsafe.Pointer(bp)).FpPhrase = sqlite3Fts5MallocZero(tls, pParse+16, int64(unsafe.Sizeof(Fts5ExprPhrase{})))
 184506 		} else if (*Fts5ExprPhrase)(unsafe.Pointer((*TokenCtx)(unsafe.Pointer(bp)).FpPhrase)).FnTerm != 0 {
 184507 			(*Fts5ExprTerm)(unsafe.Pointer((*TokenCtx)(unsafe.Pointer(bp)).FpPhrase + 32 + uintptr((*Fts5ExprPhrase)(unsafe.Pointer((*TokenCtx)(unsafe.Pointer(bp)).FpPhrase)).FnTerm-1)*32)).FbPrefix = U8(bPrefix)
 184508 		}
 184509 		*(*uintptr)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase + uintptr((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase-1)*8)) = (*TokenCtx)(unsafe.Pointer(bp)).FpPhrase
 184510 	}
 184511 
 184512 	return (*TokenCtx)(unsafe.Pointer(bp)).FpPhrase
 184513 }
 184514 
 184515 func sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, ppNew uintptr) int32 {
 184516 	bp := tls.Alloc(24)
 184517 	defer tls.Free(24)
 184518 
 184519 	*(*int32)(unsafe.Pointer(bp)) = SQLITE_OK
 184520 	var pOrig uintptr
 184521 	var pNew uintptr = uintptr(0)
 184522 	*(*TokenCtx)(unsafe.Pointer(bp + 8)) = TokenCtx{}
 184523 
 184524 	pOrig = *(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(iPhrase)*8))
 184525 	pNew = sqlite3Fts5MallocZero(tls, bp, int64(unsafe.Sizeof(Fts5Expr{})))
 184526 	if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
 184527 		(*Fts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase = sqlite3Fts5MallocZero(tls, bp,
 184528 			int64(unsafe.Sizeof(uintptr(0))))
 184529 	}
 184530 	if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
 184531 		(*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot = sqlite3Fts5MallocZero(tls, bp,
 184532 			int64(unsafe.Sizeof(Fts5ExprNode{})))
 184533 	}
 184534 	if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
 184535 		(*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = sqlite3Fts5MallocZero(tls, bp,
 184536 			int64(uint64(unsafe.Sizeof(Fts5ExprNearset{}))+uint64(unsafe.Sizeof(uintptr(0)))))
 184537 	}
 184538 	if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
 184539 		var pColsetOrig uintptr = (*Fts5ExprNearset)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer((*Fts5ExprPhrase)(unsafe.Pointer(pOrig)).FpNode)).FpNear)).FpColset
 184540 		if pColsetOrig != 0 {
 184541 			var nByte Sqlite3_int64
 184542 			var pColset uintptr
 184543 			nByte = Sqlite3_int64(uint64(unsafe.Sizeof(Fts5Colset{})) + uint64((*Fts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol-1)*uint64(unsafe.Sizeof(int32(0))))
 184544 			pColset = sqlite3Fts5MallocZero(tls, bp, nByte)
 184545 			if pColset != 0 {
 184546 				libc.Xmemcpy(tls, pColset, pColsetOrig, Size_t(nByte))
 184547 			}
 184548 			(*Fts5ExprNearset)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear)).FpColset = pColset
 184549 		}
 184550 	}
 184551 
 184552 	if (*Fts5ExprPhrase)(unsafe.Pointer(pOrig)).FnTerm != 0 {
 184553 		var i int32
 184554 		for i = 0; *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && i < (*Fts5ExprPhrase)(unsafe.Pointer(pOrig)).FnTerm; i++ {
 184555 			var tflags int32 = 0
 184556 			var p uintptr
 184557 			for p = pOrig + 32 + uintptr(i)*32; p != 0 && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK; p = (*Fts5ExprTerm)(unsafe.Pointer(p)).FpSynonym {
 184558 				var zTerm uintptr = (*Fts5ExprTerm)(unsafe.Pointer(p)).FzTerm
 184559 				*(*int32)(unsafe.Pointer(bp)) = fts5ParseTokenize(tls, bp+8, tflags, zTerm, int32(libc.Xstrlen(tls, zTerm)),
 184560 					0, 0)
 184561 				tflags = FTS5_TOKEN_COLOCATED
 184562 			}
 184563 			if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
 184564 				(*Fts5ExprTerm)(unsafe.Pointer((*TokenCtx)(unsafe.Pointer(bp+8)).FpPhrase + 32 + uintptr(i)*32)).FbPrefix = (*Fts5ExprTerm)(unsafe.Pointer(pOrig + 32 + uintptr(i)*32)).FbPrefix
 184565 				(*Fts5ExprTerm)(unsafe.Pointer((*TokenCtx)(unsafe.Pointer(bp+8)).FpPhrase + 32 + uintptr(i)*32)).FbFirst = (*Fts5ExprTerm)(unsafe.Pointer(pOrig + 32 + uintptr(i)*32)).FbFirst
 184566 			}
 184567 		}
 184568 	} else {
 184569 		(*TokenCtx)(unsafe.Pointer(bp + 8)).FpPhrase = sqlite3Fts5MallocZero(tls, bp, int64(unsafe.Sizeof(Fts5ExprPhrase{})))
 184570 	}
 184571 
 184572 	if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TokenCtx)(unsafe.Pointer(bp+8)).FpPhrase != 0 {
 184573 		(*Fts5Expr)(unsafe.Pointer(pNew)).FpIndex = (*Fts5Expr)(unsafe.Pointer(pExpr)).FpIndex
 184574 		(*Fts5Expr)(unsafe.Pointer(pNew)).FpConfig = (*Fts5Expr)(unsafe.Pointer(pExpr)).FpConfig
 184575 		(*Fts5Expr)(unsafe.Pointer(pNew)).FnPhrase = 1
 184576 		*(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase)) = (*TokenCtx)(unsafe.Pointer(bp + 8)).FpPhrase
 184577 		*(*uintptr)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear + 24)) = (*TokenCtx)(unsafe.Pointer(bp + 8)).FpPhrase
 184578 		(*Fts5ExprNearset)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear)).FnPhrase = 1
 184579 		(*Fts5ExprPhrase)(unsafe.Pointer((*TokenCtx)(unsafe.Pointer(bp + 8)).FpPhrase)).FpNode = (*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot
 184580 
 184581 		if (*Fts5ExprPhrase)(unsafe.Pointer(pOrig)).FnTerm == 1 &&
 184582 			(*Fts5ExprTerm)(unsafe.Pointer(pOrig+32)).FpSynonym == uintptr(0) &&
 184583 			int32((*Fts5ExprTerm)(unsafe.Pointer(pOrig+32)).FbFirst) == 0 {
 184584 			(*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FeType = FTS5_TERM
 184585 			(*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FxNext = *(*uintptr)(unsafe.Pointer(&struct {
 184586 				f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
 184587 			}{fts5ExprNodeNext_TERM}))
 184588 		} else {
 184589 			(*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FeType = FTS5_STRING
 184590 			(*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FxNext = *(*uintptr)(unsafe.Pointer(&struct {
 184591 				f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
 184592 			}{fts5ExprNodeNext_STRING}))
 184593 		}
 184594 	} else {
 184595 		sqlite3Fts5ExprFree(tls, pNew)
 184596 		fts5ExprPhraseFree(tls, (*TokenCtx)(unsafe.Pointer(bp+8)).FpPhrase)
 184597 		pNew = uintptr(0)
 184598 	}
 184599 
 184600 	*(*uintptr)(unsafe.Pointer(ppNew)) = pNew
 184601 	return *(*int32)(unsafe.Pointer(bp))
 184602 }
 184603 
 184604 func sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) {
 184605 	bp := tls.Alloc(16)
 184606 	defer tls.Free(16)
 184607 
 184608 	if (*Fts5Token)(unsafe.Pointer(pTok)).Fn != 4 || libc.Xmemcmp(tls, ts+36108, (*Fts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 {
 184609 		sqlite3Fts5ParseError(tls,
 184610 			pParse, ts+35137, libc.VaList(bp, (*Fts5Token)(unsafe.Pointer(pTok)).Fn, (*Fts5Token)(unsafe.Pointer(pTok)).Fp))
 184611 	}
 184612 }
 184613 
 184614 func sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, p uintptr) {
 184615 	bp := tls.Alloc(16)
 184616 	defer tls.Free(16)
 184617 
 184618 	if pNear != 0 {
 184619 		var nNear int32 = 0
 184620 		var i int32
 184621 		if (*Fts5Token)(unsafe.Pointer(p)).Fn != 0 {
 184622 			for i = 0; i < (*Fts5Token)(unsafe.Pointer(p)).Fn; i++ {
 184623 				var c int8 = *(*int8)(unsafe.Pointer((*Fts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))
 184624 				if int32(c) < '0' || int32(c) > '9' {
 184625 					sqlite3Fts5ParseError(tls,
 184626 						pParse, ts+36113, libc.VaList(bp, (*Fts5Token)(unsafe.Pointer(p)).Fn, (*Fts5Token)(unsafe.Pointer(p)).Fp))
 184627 					return
 184628 				}
 184629 				nNear = nNear*10 + (int32(*(*int8)(unsafe.Pointer((*Fts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - '0')
 184630 			}
 184631 		} else {
 184632 			nNear = FTS5_DEFAULT_NEARDIST
 184633 		}
 184634 		(*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnNear = nNear
 184635 	}
 184636 }
 184637 
 184638 func fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) uintptr {
 184639 	var nCol int32
 184640 	if p != 0 {
 184641 		nCol = (*Fts5Colset)(unsafe.Pointer(p)).FnCol
 184642 	} else {
 184643 		nCol = 0
 184644 	}
 184645 	var pNew uintptr
 184646 
 184647 	pNew = Xsqlite3_realloc64(tls, p, uint64(unsafe.Sizeof(Fts5Colset{}))+uint64(unsafe.Sizeof(int32(0)))*uint64(nCol))
 184648 	if pNew == uintptr(0) {
 184649 		(*Fts5Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_NOMEM
 184650 	} else {
 184651 		var aiCol uintptr = pNew + 4
 184652 		var i int32
 184653 		var j int32
 184654 		for i = 0; i < nCol; i++ {
 184655 			if *(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)) == iCol {
 184656 				return pNew
 184657 			}
 184658 			if *(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)) > iCol {
 184659 				break
 184660 			}
 184661 		}
 184662 		for j = nCol; j > i; j-- {
 184663 			*(*int32)(unsafe.Pointer(aiCol + uintptr(j)*4)) = *(*int32)(unsafe.Pointer(aiCol + uintptr(j-1)*4))
 184664 		}
 184665 		*(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)) = iCol
 184666 		(*Fts5Colset)(unsafe.Pointer(pNew)).FnCol = nCol + 1
 184667 
 184668 	}
 184669 
 184670 	return pNew
 184671 }
 184672 
 184673 func sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) uintptr {
 184674 	var pRet uintptr
 184675 	var nCol int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FnCol
 184676 
 184677 	pRet = sqlite3Fts5MallocZero(tls, pParse+16,
 184678 		int64(uint64(unsafe.Sizeof(Fts5Colset{}))+uint64(unsafe.Sizeof(int32(0)))*uint64(nCol)))
 184679 	if pRet != 0 {
 184680 		var i int32
 184681 		var iOld int32 = 0
 184682 		for i = 0; i < nCol; i++ {
 184683 			if iOld >= (*Fts5Colset)(unsafe.Pointer(p)).FnCol || *(*int32)(unsafe.Pointer(p + 4 + uintptr(iOld)*4)) != i {
 184684 				*(*int32)(unsafe.Pointer(pRet + 4 + uintptr(libc.PostIncInt32(&(*Fts5Colset)(unsafe.Pointer(pRet)).FnCol, 1))*4)) = i
 184685 			} else {
 184686 				iOld++
 184687 			}
 184688 		}
 184689 	}
 184690 
 184691 	Xsqlite3_free(tls, p)
 184692 	return pRet
 184693 }
 184694 
 184695 func sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p uintptr) uintptr {
 184696 	bp := tls.Alloc(8)
 184697 	defer tls.Free(8)
 184698 
 184699 	var pRet uintptr = uintptr(0)
 184700 	var iCol int32
 184701 	var z uintptr
 184702 
 184703 	z = sqlite3Fts5Strndup(tls, pParse+16, (*Fts5Token)(unsafe.Pointer(p)).Fp, (*Fts5Token)(unsafe.Pointer(p)).Fn)
 184704 	if (*Fts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK {
 184705 		var pConfig uintptr = (*Fts5Parse)(unsafe.Pointer(pParse)).FpConfig
 184706 		sqlite3Fts5Dequote(tls, z)
 184707 		for iCol = 0; iCol < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; iCol++ {
 184708 			if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(iCol)*8)), z) {
 184709 				break
 184710 			}
 184711 		}
 184712 		if iCol == (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol {
 184713 			sqlite3Fts5ParseError(tls, pParse, ts+21944, libc.VaList(bp, z))
 184714 		} else {
 184715 			pRet = fts5ParseColset(tls, pParse, pColset, iCol)
 184716 		}
 184717 		Xsqlite3_free(tls, z)
 184718 	}
 184719 
 184720 	if pRet == uintptr(0) {
 184721 		Xsqlite3_free(tls, pColset)
 184722 	}
 184723 
 184724 	return pRet
 184725 }
 184726 
 184727 func fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) uintptr {
 184728 	var pRet uintptr
 184729 	if pOrig != 0 {
 184730 		var nByte Sqlite3_int64 = Sqlite3_int64(uint64(unsafe.Sizeof(Fts5Colset{})) + uint64((*Fts5Colset)(unsafe.Pointer(pOrig)).FnCol-1)*uint64(unsafe.Sizeof(int32(0))))
 184731 		pRet = sqlite3Fts5MallocZero(tls, pRc, nByte)
 184732 		if pRet != 0 {
 184733 			libc.Xmemcpy(tls, pRet, pOrig, Size_t(nByte))
 184734 		}
 184735 	} else {
 184736 		pRet = uintptr(0)
 184737 	}
 184738 	return pRet
 184739 }
 184740 
 184741 func fts5MergeColset(tls *libc.TLS, pColset uintptr, pMerge uintptr) {
 184742 	var iIn int32 = 0
 184743 	var iMerge int32 = 0
 184744 	var iOut int32 = 0
 184745 
 184746 	for iIn < (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol && iMerge < (*Fts5Colset)(unsafe.Pointer(pMerge)).FnCol {
 184747 		var iDiff int32 = *(*int32)(unsafe.Pointer(pColset + 4 + uintptr(iIn)*4)) - *(*int32)(unsafe.Pointer(pMerge + 4 + uintptr(iMerge)*4))
 184748 		if iDiff == 0 {
 184749 			*(*int32)(unsafe.Pointer(pColset + 4 + uintptr(libc.PostIncInt32(&iOut, 1))*4)) = *(*int32)(unsafe.Pointer(pMerge + 4 + uintptr(iMerge)*4))
 184750 			iMerge++
 184751 			iIn++
 184752 		} else if iDiff > 0 {
 184753 			iMerge++
 184754 		} else {
 184755 			iIn++
 184756 		}
 184757 	}
 184758 	(*Fts5Colset)(unsafe.Pointer(pColset)).FnCol = iOut
 184759 }
 184760 
 184761 func fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pNode uintptr, pColset uintptr, ppFree uintptr) {
 184762 	if (*Fts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK {
 184763 		if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_STRING || (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_TERM {
 184764 			var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear
 184765 			if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset != 0 {
 184766 				fts5MergeColset(tls, (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset, pColset)
 184767 				if (*Fts5Colset)(unsafe.Pointer((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset)).FnCol == 0 {
 184768 					(*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType = FTS5_EOF
 184769 					(*Fts5ExprNode)(unsafe.Pointer(pNode)).FxNext = uintptr(0)
 184770 				}
 184771 			} else if *(*uintptr)(unsafe.Pointer(ppFree)) != 0 {
 184772 				(*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset = pColset
 184773 				*(*uintptr)(unsafe.Pointer(ppFree)) = uintptr(0)
 184774 			} else {
 184775 				(*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset = fts5CloneColset(tls, pParse+16, pColset)
 184776 			}
 184777 		} else {
 184778 			var i int32
 184779 
 184780 			for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
 184781 				fts5ParseSetColset(tls, pParse, *(*uintptr)(unsafe.Pointer(pNode + 48 + uintptr(i)*8)), pColset, ppFree)
 184782 			}
 184783 		}
 184784 	}
 184785 }
 184786 
 184787 func sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pColset uintptr) {
 184788 	bp := tls.Alloc(8)
 184789 	defer tls.Free(8)
 184790 
 184791 	*(*uintptr)(unsafe.Pointer(bp)) = pColset
 184792 	if (*Fts5Config)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail == FTS5_DETAIL_NONE {
 184793 		sqlite3Fts5ParseError(tls, pParse,
 184794 			ts+36142, 0)
 184795 	} else {
 184796 		fts5ParseSetColset(tls, pParse, pExpr, pColset, bp)
 184797 	}
 184798 	Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp)))
 184799 }
 184800 
 184801 func fts5ExprAssignXNext(tls *libc.TLS, pNode uintptr) {
 184802 	switch (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType {
 184803 	case FTS5_STRING:
 184804 		{
 184805 			var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear
 184806 			if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == 1 && (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 24)))).FnTerm == 1 &&
 184807 				(*Fts5ExprTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 24))+32)).FpSynonym == uintptr(0) &&
 184808 				int32((*Fts5ExprTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 24))+32)).FbFirst) == 0 {
 184809 				(*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType = FTS5_TERM
 184810 				(*Fts5ExprNode)(unsafe.Pointer(pNode)).FxNext = *(*uintptr)(unsafe.Pointer(&struct {
 184811 					f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
 184812 				}{fts5ExprNodeNext_TERM}))
 184813 			} else {
 184814 				(*Fts5ExprNode)(unsafe.Pointer(pNode)).FxNext = *(*uintptr)(unsafe.Pointer(&struct {
 184815 					f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
 184816 				}{fts5ExprNodeNext_STRING}))
 184817 			}
 184818 			break
 184819 
 184820 		}
 184821 
 184822 	case FTS5_OR:
 184823 		{
 184824 			(*Fts5ExprNode)(unsafe.Pointer(pNode)).FxNext = *(*uintptr)(unsafe.Pointer(&struct {
 184825 				f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
 184826 			}{fts5ExprNodeNext_OR}))
 184827 			break
 184828 
 184829 		}
 184830 
 184831 	case FTS5_AND:
 184832 		{
 184833 			(*Fts5ExprNode)(unsafe.Pointer(pNode)).FxNext = *(*uintptr)(unsafe.Pointer(&struct {
 184834 				f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
 184835 			}{fts5ExprNodeNext_AND}))
 184836 			break
 184837 
 184838 		}
 184839 
 184840 	default:
 184841 		{
 184842 			(*Fts5ExprNode)(unsafe.Pointer(pNode)).FxNext = *(*uintptr)(unsafe.Pointer(&struct {
 184843 				f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
 184844 			}{fts5ExprNodeNext_NOT}))
 184845 			break
 184846 
 184847 		}
 184848 
 184849 	}
 184850 }
 184851 
 184852 func fts5ExprAddChildren(tls *libc.TLS, p uintptr, pSub uintptr) {
 184853 	if (*Fts5ExprNode)(unsafe.Pointer(p)).FeType != FTS5_NOT && (*Fts5ExprNode)(unsafe.Pointer(pSub)).FeType == (*Fts5ExprNode)(unsafe.Pointer(p)).FeType {
 184854 		var nByte int32 = int32(uint64(unsafe.Sizeof(uintptr(0))) * uint64((*Fts5ExprNode)(unsafe.Pointer(pSub)).FnChild))
 184855 		libc.Xmemcpy(tls, p+48+uintptr((*Fts5ExprNode)(unsafe.Pointer(p)).FnChild)*8, pSub+48, uint64(nByte))
 184856 		*(*int32)(unsafe.Pointer(p + 40)) += (*Fts5ExprNode)(unsafe.Pointer(pSub)).FnChild
 184857 		Xsqlite3_free(tls, pSub)
 184858 	} else {
 184859 		*(*uintptr)(unsafe.Pointer(p + 48 + uintptr(libc.PostIncInt32(&(*Fts5ExprNode)(unsafe.Pointer(p)).FnChild, 1))*8)) = pSub
 184860 	}
 184861 }
 184862 
 184863 func fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) uintptr {
 184864 	var nTerm int32 = (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 24)))).FnTerm
 184865 	var ii int32
 184866 	var nByte int32
 184867 	var pRet uintptr
 184868 
 184869 	nByte = int32(uint64(unsafe.Sizeof(Fts5ExprNode{})) + uint64(nTerm)*uint64(unsafe.Sizeof(uintptr(0))))
 184870 	pRet = sqlite3Fts5MallocZero(tls, pParse+16, int64(nByte))
 184871 	if pRet != 0 {
 184872 		(*Fts5ExprNode)(unsafe.Pointer(pRet)).FeType = FTS5_AND
 184873 		(*Fts5ExprNode)(unsafe.Pointer(pRet)).FnChild = nTerm
 184874 		fts5ExprAssignXNext(tls, pRet)
 184875 		(*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase--
 184876 		for ii = 0; ii < nTerm; ii++ {
 184877 			var pPhrase uintptr = sqlite3Fts5MallocZero(tls,
 184878 				pParse+16, int64(unsafe.Sizeof(Fts5ExprPhrase{})))
 184879 			if pPhrase != 0 {
 184880 				if parseGrowPhraseArray(tls, pParse) != 0 {
 184881 					fts5ExprPhraseFree(tls, pPhrase)
 184882 				} else {
 184883 					*(*uintptr)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase + uintptr(libc.PostIncInt32(&(*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase, 1))*8)) = pPhrase
 184884 					(*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm = 1
 184885 					(*Fts5ExprTerm)(unsafe.Pointer(pPhrase + 32)).FzTerm = sqlite3Fts5Strndup(tls,
 184886 						pParse+16, (*Fts5ExprTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 24))+32+uintptr(ii)*32)).FzTerm, -1)
 184887 					*(*uintptr)(unsafe.Pointer(pRet + 48 + uintptr(ii)*8)) = sqlite3Fts5ParseNode(tls, pParse, FTS5_STRING,
 184888 						uintptr(0), uintptr(0), sqlite3Fts5ParseNearset(tls, pParse, uintptr(0), pPhrase))
 184889 				}
 184890 			}
 184891 		}
 184892 
 184893 		if (*Fts5Parse)(unsafe.Pointer(pParse)).Frc != 0 {
 184894 			sqlite3Fts5ParseNodeFree(tls, pRet)
 184895 			pRet = uintptr(0)
 184896 		} else {
 184897 			sqlite3Fts5ParseNearsetFree(tls, pNear)
 184898 		}
 184899 	}
 184900 
 184901 	return pRet
 184902 }
 184903 
 184904 func sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uintptr, pRight uintptr, pNear uintptr) uintptr {
 184905 	bp := tls.Alloc(8)
 184906 	defer tls.Free(8)
 184907 
 184908 	var pRet uintptr = uintptr(0)
 184909 
 184910 	if (*Fts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK {
 184911 		var nChild int32 = 0
 184912 		var nByte Sqlite3_int64
 184913 
 184914 		if eType == FTS5_STRING && pNear == uintptr(0) {
 184915 			return uintptr(0)
 184916 		}
 184917 		if eType != FTS5_STRING && pLeft == uintptr(0) {
 184918 			return pRight
 184919 		}
 184920 		if eType != FTS5_STRING && pRight == uintptr(0) {
 184921 			return pLeft
 184922 		}
 184923 
 184924 		if eType == FTS5_STRING &&
 184925 			(*Fts5Parse)(unsafe.Pointer(pParse)).FbPhraseToAnd != 0 &&
 184926 			(*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 24)))).FnTerm > 1 {
 184927 			pRet = fts5ParsePhraseToAnd(tls, pParse, pNear)
 184928 		} else {
 184929 			if eType == FTS5_NOT {
 184930 				nChild = 2
 184931 			} else if eType == FTS5_AND || eType == FTS5_OR {
 184932 				nChild = 2
 184933 				if (*Fts5ExprNode)(unsafe.Pointer(pLeft)).FeType == eType {
 184934 					nChild = nChild + ((*Fts5ExprNode)(unsafe.Pointer(pLeft)).FnChild - 1)
 184935 				}
 184936 				if (*Fts5ExprNode)(unsafe.Pointer(pRight)).FeType == eType {
 184937 					nChild = nChild + ((*Fts5ExprNode)(unsafe.Pointer(pRight)).FnChild - 1)
 184938 				}
 184939 			}
 184940 
 184941 			nByte = Sqlite3_int64(uint64(unsafe.Sizeof(Fts5ExprNode{})) + uint64(unsafe.Sizeof(uintptr(0)))*uint64(nChild-1))
 184942 			pRet = sqlite3Fts5MallocZero(tls, pParse+16, nByte)
 184943 
 184944 			if pRet != 0 {
 184945 				(*Fts5ExprNode)(unsafe.Pointer(pRet)).FeType = eType
 184946 				(*Fts5ExprNode)(unsafe.Pointer(pRet)).FpNear = pNear
 184947 				fts5ExprAssignXNext(tls, pRet)
 184948 				if eType == FTS5_STRING {
 184949 					var iPhrase int32
 184950 					for iPhrase = 0; iPhrase < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; iPhrase++ {
 184951 						(*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 24 + uintptr(iPhrase)*8)))).FpNode = pRet
 184952 						if (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 24 + uintptr(iPhrase)*8)))).FnTerm == 0 {
 184953 							(*Fts5ExprNode)(unsafe.Pointer(pRet)).FxNext = uintptr(0)
 184954 							(*Fts5ExprNode)(unsafe.Pointer(pRet)).FeType = FTS5_EOF
 184955 						}
 184956 					}
 184957 
 184958 					if (*Fts5Config)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail != FTS5_DETAIL_FULL {
 184959 						var pPhrase uintptr = *(*uintptr)(unsafe.Pointer(pNear + 24))
 184960 						if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != 1 ||
 184961 							(*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 1 ||
 184962 							(*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0 && (*Fts5ExprTerm)(unsafe.Pointer(pPhrase+32)).FbFirst != 0 {
 184963 							sqlite3Fts5ParseError(tls, pParse,
 184964 								ts+36195,
 184965 								libc.VaList(bp, func() uintptr {
 184966 									if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == 1 {
 184967 										return ts + 36245
 184968 									}
 184969 									return ts + 36108
 184970 								}()))
 184971 							Xsqlite3_free(tls, pRet)
 184972 							pRet = uintptr(0)
 184973 						}
 184974 					}
 184975 				} else {
 184976 					fts5ExprAddChildren(tls, pRet, pLeft)
 184977 					fts5ExprAddChildren(tls, pRet, pRight)
 184978 				}
 184979 			}
 184980 		}
 184981 	}
 184982 
 184983 	if pRet == uintptr(0) {
 184984 		sqlite3Fts5ParseNodeFree(tls, pLeft)
 184985 		sqlite3Fts5ParseNodeFree(tls, pRight)
 184986 		sqlite3Fts5ParseNearsetFree(tls, pNear)
 184987 	}
 184988 	return pRet
 184989 }
 184990 
 184991 func sqlite3Fts5ParseImplicitAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr {
 184992 	var pRet uintptr = uintptr(0)
 184993 	var pPrev uintptr
 184994 
 184995 	if (*Fts5Parse)(unsafe.Pointer(pParse)).Frc != 0 {
 184996 		sqlite3Fts5ParseNodeFree(tls, pLeft)
 184997 		sqlite3Fts5ParseNodeFree(tls, pRight)
 184998 	} else {
 184999 		if (*Fts5ExprNode)(unsafe.Pointer(pLeft)).FeType == FTS5_AND {
 185000 			pPrev = *(*uintptr)(unsafe.Pointer(pLeft + 48 + uintptr((*Fts5ExprNode)(unsafe.Pointer(pLeft)).FnChild-1)*8))
 185001 		} else {
 185002 			pPrev = pLeft
 185003 		}
 185004 
 185005 		if (*Fts5ExprNode)(unsafe.Pointer(pRight)).FeType == FTS5_EOF {
 185006 			sqlite3Fts5ParseNodeFree(tls, pRight)
 185007 			pRet = pLeft
 185008 			(*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase--
 185009 		} else if (*Fts5ExprNode)(unsafe.Pointer(pPrev)).FeType == FTS5_EOF {
 185010 			var ap uintptr
 185011 
 185012 			if pPrev == pLeft {
 185013 				pRet = pRight
 185014 			} else {
 185015 				*(*uintptr)(unsafe.Pointer(pLeft + 48 + uintptr((*Fts5ExprNode)(unsafe.Pointer(pLeft)).FnChild-1)*8)) = pRight
 185016 				pRet = pLeft
 185017 			}
 185018 
 185019 			ap = (*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase + uintptr((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase-1-(*Fts5ExprNearset)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer(pRight)).FpNear)).FnPhrase)*8
 185020 
 185021 			libc.Xmemmove(tls, ap, ap+1*8, uint64(unsafe.Sizeof(uintptr(0)))*uint64((*Fts5ExprNearset)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer(pRight)).FpNear)).FnPhrase))
 185022 			(*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase--
 185023 
 185024 			sqlite3Fts5ParseNodeFree(tls, pPrev)
 185025 		} else {
 185026 			pRet = sqlite3Fts5ParseNode(tls, pParse, FTS5_AND, pLeft, pRight, uintptr(0))
 185027 		}
 185028 	}
 185029 
 185030 	return pRet
 185031 }
 185032 
 185033 func sqlite3Fts5ExprInit(tls *libc.TLS, pGlobal uintptr, db uintptr) int32 {
 185034 	var rc int32 = SQLITE_OK
 185035 	_ = pGlobal
 185036 	_ = db
 185037 
 185038 	_ = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{sqlite3Fts5ParserFallback}))
 185039 
 185040 	return rc
 185041 }
 185042 
 185043 func sqlite3Fts5ExprPhraseCount(tls *libc.TLS, pExpr uintptr) int32 {
 185044 	return func() int32 {
 185045 		if pExpr != 0 {
 185046 			return (*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase
 185047 		}
 185048 		return 0
 185049 	}()
 185050 }
 185051 
 185052 func sqlite3Fts5ExprPhraseSize(tls *libc.TLS, pExpr uintptr, iPhrase int32) int32 {
 185053 	if iPhrase < 0 || iPhrase >= (*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase {
 185054 		return 0
 185055 	}
 185056 	return (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(iPhrase)*8)))).FnTerm
 185057 }
 185058 
 185059 func sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uintptr) int32 {
 185060 	var nRet int32
 185061 	var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(iPhrase)*8))
 185062 	var pNode uintptr = (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FpNode
 185063 	if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof == 0 && (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid == (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FpRoot)).FiRowid {
 185064 		*(*uintptr)(unsafe.Pointer(pa)) = (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fp
 185065 		nRet = (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn
 185066 	} else {
 185067 		*(*uintptr)(unsafe.Pointer(pa)) = uintptr(0)
 185068 		nRet = 0
 185069 	}
 185070 	return nRet
 185071 }
 185072 
 185073 func sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) uintptr {
 185074 	var pRet uintptr
 185075 	pRet = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(Fts5PoslistPopulator{}))*uint64((*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase))
 185076 	if pRet != 0 {
 185077 		var i int32
 185078 		libc.Xmemset(tls, pRet, 0, uint64(unsafe.Sizeof(Fts5PoslistPopulator{}))*uint64((*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase))
 185079 		for i = 0; i < (*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase; i++ {
 185080 			var pBuf uintptr = *(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(i)*8)) + 8
 185081 			var pNode uintptr = (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(i)*8)))).FpNode
 185082 
 185083 			if bLive != 0 && ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn == 0 || (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid != (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FpRoot)).FiRowid || (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof != 0) {
 185084 				(*Fts5PoslistPopulator)(unsafe.Pointer(pRet + uintptr(i)*16)).FbMiss = 1
 185085 			} else {
 185086 				(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn = 0
 185087 			}
 185088 		}
 185089 	}
 185090 	return pRet
 185091 }
 185092 
 185093 type Fts5ExprCtx1 = struct {
 185094 	FpExpr      uintptr
 185095 	FaPopulator uintptr
 185096 	FiOff       I64
 185097 }
 185098 
 185099 type Fts5ExprCtx = Fts5ExprCtx1
 185100 
 185101 func fts5ExprColsetTest(tls *libc.TLS, pColset uintptr, iCol int32) int32 {
 185102 	var i int32
 185103 	for i = 0; i < (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol; i++ {
 185104 		if *(*int32)(unsafe.Pointer(pColset + 4 + uintptr(i)*4)) == iCol {
 185105 			return 1
 185106 		}
 185107 	}
 185108 	return 0
 185109 }
 185110 
 185111 func fts5ExprPopulatePoslistsCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 {
 185112 	var p uintptr = pCtx
 185113 	var pExpr uintptr = (*Fts5ExprCtx)(unsafe.Pointer(p)).FpExpr
 185114 	var i int32
 185115 
 185116 	_ = iUnused1
 185117 	_ = iUnused2
 185118 
 185119 	if nToken > FTS5_MAX_TOKEN_SIZE {
 185120 		nToken = FTS5_MAX_TOKEN_SIZE
 185121 	}
 185122 	if tflags&FTS5_TOKEN_COLOCATED == 0 {
 185123 		(*Fts5ExprCtx)(unsafe.Pointer(p)).FiOff++
 185124 	}
 185125 	for i = 0; i < (*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase; i++ {
 185126 		var pTerm uintptr
 185127 		if (*Fts5PoslistPopulator)(unsafe.Pointer((*Fts5ExprCtx)(unsafe.Pointer(p)).FaPopulator+uintptr(i)*16)).FbOk == 0 {
 185128 			continue
 185129 		}
 185130 		for pTerm = *(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(i)*8)) + 32; pTerm != 0; pTerm = (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym {
 185131 			var nTerm int32 = int32(libc.Xstrlen(tls, (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FzTerm))
 185132 			if (nTerm == nToken || nTerm < nToken && (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FbPrefix != 0) &&
 185133 				libc.Xmemcmp(tls, (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FzTerm, pToken, uint64(nTerm)) == 0 {
 185134 				var rc int32 = sqlite3Fts5PoslistWriterAppend(tls,
 185135 					*(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(i)*8))+8, (*Fts5ExprCtx)(unsafe.Pointer(p)).FaPopulator+uintptr(i)*16, (*Fts5ExprCtx)(unsafe.Pointer(p)).FiOff)
 185136 				if rc != 0 {
 185137 					return rc
 185138 				}
 185139 				break
 185140 			}
 185141 		}
 185142 	}
 185143 	return SQLITE_OK
 185144 }
 185145 
 185146 func sqlite3Fts5ExprPopulatePoslists(tls *libc.TLS, pConfig uintptr, pExpr uintptr, aPopulator uintptr, iCol int32, z uintptr, n int32) int32 {
 185147 	bp := tls.Alloc(24)
 185148 	defer tls.Free(24)
 185149 
 185150 	var i int32
 185151 
 185152 	(*Fts5ExprCtx)(unsafe.Pointer(bp)).FpExpr = pExpr
 185153 	(*Fts5ExprCtx)(unsafe.Pointer(bp)).FaPopulator = aPopulator
 185154 	(*Fts5ExprCtx)(unsafe.Pointer(bp)).FiOff = I64(iCol)<<32 - int64(1)
 185155 
 185156 	for i = 0; i < (*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase; i++ {
 185157 		var pNode uintptr = (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(i)*8)))).FpNode
 185158 		var pColset uintptr = (*Fts5ExprNearset)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear)).FpColset
 185159 		if pColset != 0 && 0 == fts5ExprColsetTest(tls, pColset, iCol) ||
 185160 			(*Fts5PoslistPopulator)(unsafe.Pointer(aPopulator+uintptr(i)*16)).FbMiss != 0 {
 185161 			(*Fts5PoslistPopulator)(unsafe.Pointer(aPopulator + uintptr(i)*16)).FbOk = 0
 185162 		} else {
 185163 			(*Fts5PoslistPopulator)(unsafe.Pointer(aPopulator + uintptr(i)*16)).FbOk = 1
 185164 		}
 185165 	}
 185166 
 185167 	return sqlite3Fts5Tokenize(tls, pConfig,
 185168 		FTS5_TOKENIZE_DOCUMENT, z, n, bp, *(*uintptr)(unsafe.Pointer(&struct {
 185169 			f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
 185170 		}{fts5ExprPopulatePoslistsCb})))
 185171 }
 185172 
 185173 func fts5ExprClearPoslists(tls *libc.TLS, pNode uintptr) {
 185174 	if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_TERM || (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_STRING {
 185175 		(*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 24)))).Fposlist.Fn = 0
 185176 	} else {
 185177 		var i int32
 185178 		for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
 185179 			fts5ExprClearPoslists(tls, *(*uintptr)(unsafe.Pointer(pNode + 48 + uintptr(i)*8)))
 185180 		}
 185181 	}
 185182 }
 185183 
 185184 func fts5ExprCheckPoslists(tls *libc.TLS, pNode uintptr, iRowid I64) int32 {
 185185 	(*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid = iRowid
 185186 	(*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 0
 185187 	switch (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType {
 185188 	case FTS5_TERM:
 185189 		fallthrough
 185190 	case FTS5_STRING:
 185191 		return libc.Bool32((*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 24)))).Fposlist.Fn > 0)
 185192 
 185193 	case FTS5_AND:
 185194 		{
 185195 			var i int32
 185196 			for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
 185197 				if fts5ExprCheckPoslists(tls, *(*uintptr)(unsafe.Pointer(pNode + 48 + uintptr(i)*8)), iRowid) == 0 {
 185198 					fts5ExprClearPoslists(tls, pNode)
 185199 					return 0
 185200 				}
 185201 			}
 185202 			break
 185203 
 185204 		}
 185205 
 185206 	case FTS5_OR:
 185207 		{
 185208 			var i int32
 185209 			var bRet int32 = 0
 185210 			for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
 185211 				if fts5ExprCheckPoslists(tls, *(*uintptr)(unsafe.Pointer(pNode + 48 + uintptr(i)*8)), iRowid) != 0 {
 185212 					bRet = 1
 185213 				}
 185214 			}
 185215 			return bRet
 185216 
 185217 		}
 185218 
 185219 	default:
 185220 		{
 185221 			if 0 == fts5ExprCheckPoslists(tls, *(*uintptr)(unsafe.Pointer(pNode + 48)), iRowid) ||
 185222 				0 != fts5ExprCheckPoslists(tls, *(*uintptr)(unsafe.Pointer(pNode + 48 + 1*8)), iRowid) {
 185223 				fts5ExprClearPoslists(tls, pNode)
 185224 				return 0
 185225 			}
 185226 			break
 185227 
 185228 		}
 185229 	}
 185230 	return 1
 185231 }
 185232 
 185233 func sqlite3Fts5ExprCheckPoslists(tls *libc.TLS, pExpr uintptr, iRowid I64) {
 185234 	fts5ExprCheckPoslists(tls, (*Fts5Expr)(unsafe.Pointer(pExpr)).FpRoot, iRowid)
 185235 }
 185236 
 185237 func sqlite3Fts5ExprPhraseCollist(tls *libc.TLS, pExpr uintptr, iPhrase int32, ppCollist uintptr, pnCollist uintptr) int32 {
 185238 	var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(iPhrase)*8))
 185239 	var pNode uintptr = (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FpNode
 185240 	var rc int32 = SQLITE_OK
 185241 
 185242 	if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof == 0 &&
 185243 		(*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid == (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FpRoot)).FiRowid &&
 185244 		(*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn > 0 {
 185245 		var pTerm uintptr = pPhrase + 32
 185246 		if (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym != 0 {
 185247 			var pBuf uintptr = (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym + 1*32
 185248 			rc = fts5ExprSynonymList(tls,
 185249 				pTerm, (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid, pBuf, ppCollist, pnCollist)
 185250 		} else {
 185251 			*(*uintptr)(unsafe.Pointer(ppCollist)) = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(pPhrase + 32)).FpIter)).FpData
 185252 			*(*int32)(unsafe.Pointer(pnCollist)) = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(pPhrase + 32)).FpIter)).FnData
 185253 		}
 185254 	} else {
 185255 		*(*uintptr)(unsafe.Pointer(ppCollist)) = uintptr(0)
 185256 		*(*int32)(unsafe.Pointer(pnCollist)) = 0
 185257 	}
 185258 
 185259 	return rc
 185260 }
 185261 
 185262 type Fts5HashEntry1 = struct {
 185263 	FpHashNext  uintptr
 185264 	FpScanNext  uintptr
 185265 	FnAlloc     int32
 185266 	FiSzPoslist int32
 185267 	FnData      int32
 185268 	FnKey       int32
 185269 	FbDel       U8
 185270 	FbContent   U8
 185271 	FiCol       I16
 185272 	FiPos       int32
 185273 	FiRowid     I64
 185274 }
 185275 
 185276 type Fts5HashEntry = Fts5HashEntry1
 185277 
 185278 func sqlite3Fts5HashNew(tls *libc.TLS, pConfig uintptr, ppNew uintptr, pnByte uintptr) int32 {
 185279 	var rc int32 = SQLITE_OK
 185280 	var pNew uintptr
 185281 
 185282 	*(*uintptr)(unsafe.Pointer(ppNew)) = libc.AssignUintptr(&pNew, Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Fts5Hash{}))))
 185283 	if pNew == uintptr(0) {
 185284 		rc = SQLITE_NOMEM
 185285 	} else {
 185286 		var nByte Sqlite3_int64
 185287 		libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(Fts5Hash{})))
 185288 		(*Fts5Hash)(unsafe.Pointer(pNew)).FpnByte = pnByte
 185289 		(*Fts5Hash)(unsafe.Pointer(pNew)).FeDetail = (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail
 185290 
 185291 		(*Fts5Hash)(unsafe.Pointer(pNew)).FnSlot = 1024
 185292 		nByte = Sqlite3_int64(uint64(unsafe.Sizeof(uintptr(0))) * uint64((*Fts5Hash)(unsafe.Pointer(pNew)).FnSlot))
 185293 		(*Fts5Hash)(unsafe.Pointer(pNew)).FaSlot = Xsqlite3_malloc64(tls, uint64(nByte))
 185294 		if (*Fts5Hash)(unsafe.Pointer(pNew)).FaSlot == uintptr(0) {
 185295 			Xsqlite3_free(tls, pNew)
 185296 			*(*uintptr)(unsafe.Pointer(ppNew)) = uintptr(0)
 185297 			rc = SQLITE_NOMEM
 185298 		} else {
 185299 			libc.Xmemset(tls, (*Fts5Hash)(unsafe.Pointer(pNew)).FaSlot, 0, Size_t(nByte))
 185300 		}
 185301 	}
 185302 	return rc
 185303 }
 185304 
 185305 func sqlite3Fts5HashFree(tls *libc.TLS, pHash uintptr) {
 185306 	if pHash != 0 {
 185307 		sqlite3Fts5HashClear(tls, pHash)
 185308 		Xsqlite3_free(tls, (*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot)
 185309 		Xsqlite3_free(tls, pHash)
 185310 	}
 185311 }
 185312 
 185313 func sqlite3Fts5HashClear(tls *libc.TLS, pHash uintptr) {
 185314 	var i int32
 185315 	for i = 0; i < (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot; i++ {
 185316 		var pNext uintptr
 185317 		var pSlot uintptr
 185318 		for pSlot = *(*uintptr)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(i)*8)); pSlot != 0; pSlot = pNext {
 185319 			pNext = (*Fts5HashEntry)(unsafe.Pointer(pSlot)).FpHashNext
 185320 			Xsqlite3_free(tls, pSlot)
 185321 		}
 185322 	}
 185323 	libc.Xmemset(tls, (*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot, 0, uint64((*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot)*uint64(unsafe.Sizeof(uintptr(0))))
 185324 	(*Fts5Hash)(unsafe.Pointer(pHash)).FnEntry = 0
 185325 }
 185326 
 185327 func fts5HashKey(tls *libc.TLS, nSlot int32, p uintptr, n int32) uint32 {
 185328 	var i int32
 185329 	var h uint32 = uint32(13)
 185330 	for i = n - 1; i >= 0; i-- {
 185331 		h = h<<3 ^ h ^ uint32(*(*U8)(unsafe.Pointer(p + uintptr(i))))
 185332 	}
 185333 	return h % uint32(nSlot)
 185334 }
 185335 
 185336 func fts5HashKey2(tls *libc.TLS, nSlot int32, b U8, p uintptr, n int32) uint32 {
 185337 	var i int32
 185338 	var h uint32 = uint32(13)
 185339 	for i = n - 1; i >= 0; i-- {
 185340 		h = h<<3 ^ h ^ uint32(*(*U8)(unsafe.Pointer(p + uintptr(i))))
 185341 	}
 185342 	h = h<<3 ^ h ^ uint32(b)
 185343 	return h % uint32(nSlot)
 185344 }
 185345 
 185346 func fts5HashResize(tls *libc.TLS, pHash uintptr) int32 {
 185347 	var nNew int32 = (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot * 2
 185348 	var i int32
 185349 	var apNew uintptr
 185350 	var apOld uintptr = (*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot
 185351 
 185352 	apNew = Xsqlite3_malloc64(tls, uint64(nNew)*uint64(unsafe.Sizeof(uintptr(0))))
 185353 	if !(apNew != 0) {
 185354 		return SQLITE_NOMEM
 185355 	}
 185356 	libc.Xmemset(tls, apNew, 0, uint64(nNew)*uint64(unsafe.Sizeof(uintptr(0))))
 185357 
 185358 	for i = 0; i < (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot; i++ {
 185359 		for *(*uintptr)(unsafe.Pointer(apOld + uintptr(i)*8)) != 0 {
 185360 			var iHash uint32
 185361 			var p uintptr = *(*uintptr)(unsafe.Pointer(apOld + uintptr(i)*8))
 185362 			*(*uintptr)(unsafe.Pointer(apOld + uintptr(i)*8)) = (*Fts5HashEntry)(unsafe.Pointer(p)).FpHashNext
 185363 			iHash = fts5HashKey(tls, nNew, p+1*48,
 185364 				int32(libc.Xstrlen(tls, p+1*48)))
 185365 			(*Fts5HashEntry)(unsafe.Pointer(p)).FpHashNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(iHash)*8))
 185366 			*(*uintptr)(unsafe.Pointer(apNew + uintptr(iHash)*8)) = p
 185367 		}
 185368 	}
 185369 
 185370 	Xsqlite3_free(tls, apOld)
 185371 	(*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot = nNew
 185372 	(*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot = apNew
 185373 	return SQLITE_OK
 185374 }
 185375 
 185376 func fts5HashAddPoslistSize(tls *libc.TLS, pHash uintptr, p uintptr, p2 uintptr) int32 {
 185377 	var nRet int32 = 0
 185378 	if (*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist != 0 {
 185379 		var pPtr uintptr
 185380 		if p2 != 0 {
 185381 			pPtr = p2
 185382 		} else {
 185383 			pPtr = p
 185384 		}
 185385 		var nData int32 = (*Fts5HashEntry)(unsafe.Pointer(p)).FnData
 185386 		if (*Fts5Hash)(unsafe.Pointer(pHash)).FeDetail == FTS5_DETAIL_NONE {
 185387 			if (*Fts5HashEntry)(unsafe.Pointer(p)).FbDel != 0 {
 185388 				*(*U8)(unsafe.Pointer(pPtr + uintptr(libc.PostIncInt32(&nData, 1)))) = U8(0x00)
 185389 				if (*Fts5HashEntry)(unsafe.Pointer(p)).FbContent != 0 {
 185390 					*(*U8)(unsafe.Pointer(pPtr + uintptr(libc.PostIncInt32(&nData, 1)))) = U8(0x00)
 185391 				}
 185392 			}
 185393 		} else {
 185394 			var nSz int32 = nData - (*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist - 1
 185395 			var nPos int32 = nSz*2 + int32((*Fts5HashEntry)(unsafe.Pointer(p)).FbDel)
 185396 
 185397 			if nPos <= 127 {
 185398 				*(*U8)(unsafe.Pointer(pPtr + uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist))) = U8(nPos)
 185399 			} else {
 185400 				var nByte int32 = sqlite3Fts5GetVarintLen(tls, U32(nPos))
 185401 				libc.Xmemmove(tls, pPtr+uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist+nByte), pPtr+uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist+1), uint64(nSz))
 185402 				sqlite3Fts5PutVarint(tls, pPtr+uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist), uint64(nPos))
 185403 				nData = nData + (nByte - 1)
 185404 			}
 185405 		}
 185406 
 185407 		nRet = nData - (*Fts5HashEntry)(unsafe.Pointer(p)).FnData
 185408 		if p2 == uintptr(0) {
 185409 			(*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist = 0
 185410 			(*Fts5HashEntry)(unsafe.Pointer(p)).FbDel = U8(0)
 185411 			(*Fts5HashEntry)(unsafe.Pointer(p)).FbContent = U8(0)
 185412 			(*Fts5HashEntry)(unsafe.Pointer(p)).FnData = nData
 185413 		}
 185414 	}
 185415 	return nRet
 185416 }
 185417 
 185418 func sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid I64, iCol int32, iPos int32, bByte int8, pToken uintptr, nToken int32) int32 {
 185419 	var iHash uint32
 185420 	var p uintptr
 185421 	var pPtr uintptr
 185422 	var nIncr int32 = 0
 185423 	var bNew int32
 185424 
 185425 	bNew = libc.Bool32((*Fts5Hash)(unsafe.Pointer(pHash)).FeDetail == FTS5_DETAIL_FULL)
 185426 
 185427 	iHash = fts5HashKey2(tls, (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot, U8(bByte), pToken, nToken)
 185428 	for p = *(*uintptr)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(iHash)*8)); p != 0; p = (*Fts5HashEntry)(unsafe.Pointer(p)).FpHashNext {
 185429 		var zKey uintptr = p + 1*48
 185430 		if int32(*(*int8)(unsafe.Pointer(zKey))) == int32(bByte) &&
 185431 			(*Fts5HashEntry)(unsafe.Pointer(p)).FnKey == nToken &&
 185432 			libc.Xmemcmp(tls, zKey+1, pToken, uint64(nToken)) == 0 {
 185433 			break
 185434 		}
 185435 	}
 185436 
 185437 	if p == uintptr(0) {
 185438 		var zKey uintptr
 185439 		var nByte Sqlite3_int64 = Sqlite3_int64(uint64(unsafe.Sizeof(Fts5HashEntry{})) + uint64(nToken+1) + uint64(1) + uint64(64))
 185440 		if nByte < int64(128) {
 185441 			nByte = int64(128)
 185442 		}
 185443 
 185444 		if (*Fts5Hash)(unsafe.Pointer(pHash)).FnEntry*2 >= (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot {
 185445 			var rc int32 = fts5HashResize(tls, pHash)
 185446 			if rc != SQLITE_OK {
 185447 				return rc
 185448 			}
 185449 			iHash = fts5HashKey2(tls, (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot, U8(bByte), pToken, nToken)
 185450 		}
 185451 
 185452 		p = Xsqlite3_malloc64(tls, uint64(nByte))
 185453 		if !(p != 0) {
 185454 			return SQLITE_NOMEM
 185455 		}
 185456 		libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Fts5HashEntry{})))
 185457 		(*Fts5HashEntry)(unsafe.Pointer(p)).FnAlloc = int32(nByte)
 185458 		zKey = p + 1*48
 185459 		*(*int8)(unsafe.Pointer(zKey)) = bByte
 185460 		libc.Xmemcpy(tls, zKey+1, pToken, uint64(nToken))
 185461 
 185462 		(*Fts5HashEntry)(unsafe.Pointer(p)).FnKey = nToken
 185463 		*(*int8)(unsafe.Pointer(zKey + uintptr(nToken+1))) = int8(0)
 185464 		(*Fts5HashEntry)(unsafe.Pointer(p)).FnData = int32(uint64(nToken+1+1) + uint64(unsafe.Sizeof(Fts5HashEntry{})))
 185465 		(*Fts5HashEntry)(unsafe.Pointer(p)).FpHashNext = *(*uintptr)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(iHash)*8))
 185466 		*(*uintptr)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(iHash)*8)) = p
 185467 		(*Fts5Hash)(unsafe.Pointer(pHash)).FnEntry++
 185468 
 185469 		*(*int32)(unsafe.Pointer(p + 24)) += sqlite3Fts5PutVarint(tls, p+uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FnData), uint64(iRowid))
 185470 		(*Fts5HashEntry)(unsafe.Pointer(p)).FiRowid = iRowid
 185471 
 185472 		(*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist = (*Fts5HashEntry)(unsafe.Pointer(p)).FnData
 185473 		if (*Fts5Hash)(unsafe.Pointer(pHash)).FeDetail != FTS5_DETAIL_NONE {
 185474 			*(*int32)(unsafe.Pointer(p + 24)) += 1
 185475 			(*Fts5HashEntry)(unsafe.Pointer(p)).FiCol = func() int16 {
 185476 				if (*Fts5Hash)(unsafe.Pointer(pHash)).FeDetail == FTS5_DETAIL_FULL {
 185477 					return int16(0)
 185478 				}
 185479 				return int16(-1)
 185480 			}()
 185481 		}
 185482 
 185483 	} else {
 185484 		if (*Fts5HashEntry)(unsafe.Pointer(p)).FnAlloc-(*Fts5HashEntry)(unsafe.Pointer(p)).FnData < 9+4+1+3+5 {
 185485 			var nNew Sqlite3_int64 = Sqlite3_int64((*Fts5HashEntry)(unsafe.Pointer(p)).FnAlloc * 2)
 185486 			var pNew uintptr
 185487 			var pp uintptr
 185488 			pNew = Xsqlite3_realloc64(tls, p, uint64(nNew))
 185489 			if pNew == uintptr(0) {
 185490 				return SQLITE_NOMEM
 185491 			}
 185492 			(*Fts5HashEntry)(unsafe.Pointer(pNew)).FnAlloc = int32(nNew)
 185493 			for pp = (*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(iHash)*8; *(*uintptr)(unsafe.Pointer(pp)) != p; pp = *(*uintptr)(unsafe.Pointer(pp)) {
 185494 			}
 185495 			*(*uintptr)(unsafe.Pointer(pp)) = pNew
 185496 			p = pNew
 185497 		}
 185498 		nIncr = nIncr - (*Fts5HashEntry)(unsafe.Pointer(p)).FnData
 185499 	}
 185500 
 185501 	pPtr = p
 185502 
 185503 	if iRowid != (*Fts5HashEntry)(unsafe.Pointer(p)).FiRowid {
 185504 		var iDiff U64 = U64(iRowid) - U64((*Fts5HashEntry)(unsafe.Pointer(p)).FiRowid)
 185505 		fts5HashAddPoslistSize(tls, pHash, p, uintptr(0))
 185506 		*(*int32)(unsafe.Pointer(p + 24)) += sqlite3Fts5PutVarint(tls, pPtr+uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FnData), iDiff)
 185507 		(*Fts5HashEntry)(unsafe.Pointer(p)).FiRowid = iRowid
 185508 		bNew = 1
 185509 		(*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist = (*Fts5HashEntry)(unsafe.Pointer(p)).FnData
 185510 		if (*Fts5Hash)(unsafe.Pointer(pHash)).FeDetail != FTS5_DETAIL_NONE {
 185511 			*(*int32)(unsafe.Pointer(p + 24)) += 1
 185512 			(*Fts5HashEntry)(unsafe.Pointer(p)).FiCol = func() int16 {
 185513 				if (*Fts5Hash)(unsafe.Pointer(pHash)).FeDetail == FTS5_DETAIL_FULL {
 185514 					return int16(0)
 185515 				}
 185516 				return int16(-1)
 185517 			}()
 185518 			(*Fts5HashEntry)(unsafe.Pointer(p)).FiPos = 0
 185519 		}
 185520 	}
 185521 
 185522 	if iCol >= 0 {
 185523 		if (*Fts5Hash)(unsafe.Pointer(pHash)).FeDetail == FTS5_DETAIL_NONE {
 185524 			(*Fts5HashEntry)(unsafe.Pointer(p)).FbContent = U8(1)
 185525 		} else {
 185526 			if iCol != int32((*Fts5HashEntry)(unsafe.Pointer(p)).FiCol) {
 185527 				if (*Fts5Hash)(unsafe.Pointer(pHash)).FeDetail == FTS5_DETAIL_FULL {
 185528 					*(*U8)(unsafe.Pointer(pPtr + uintptr(libc.PostIncInt32(&(*Fts5HashEntry)(unsafe.Pointer(p)).FnData, 1)))) = U8(0x01)
 185529 					*(*int32)(unsafe.Pointer(p + 24)) += sqlite3Fts5PutVarint(tls, pPtr+uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FnData), uint64(iCol))
 185530 					(*Fts5HashEntry)(unsafe.Pointer(p)).FiCol = I16(iCol)
 185531 					(*Fts5HashEntry)(unsafe.Pointer(p)).FiPos = 0
 185532 				} else {
 185533 					bNew = 1
 185534 					(*Fts5HashEntry)(unsafe.Pointer(p)).FiCol = I16(libc.AssignInt32(&iPos, iCol))
 185535 				}
 185536 			}
 185537 
 185538 			if bNew != 0 {
 185539 				*(*int32)(unsafe.Pointer(p + 24)) += sqlite3Fts5PutVarint(tls, pPtr+uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FnData), uint64(iPos-(*Fts5HashEntry)(unsafe.Pointer(p)).FiPos+2))
 185540 				(*Fts5HashEntry)(unsafe.Pointer(p)).FiPos = iPos
 185541 			}
 185542 		}
 185543 	} else {
 185544 		(*Fts5HashEntry)(unsafe.Pointer(p)).FbDel = U8(1)
 185545 	}
 185546 
 185547 	nIncr = nIncr + (*Fts5HashEntry)(unsafe.Pointer(p)).FnData
 185548 	*(*int32)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(pHash)).FpnByte)) += nIncr
 185549 	return SQLITE_OK
 185550 }
 185551 
 185552 func fts5HashEntryMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr {
 185553 	bp := tls.Alloc(8)
 185554 	defer tls.Free(8)
 185555 
 185556 	var p1 uintptr = pLeft
 185557 	var p2 uintptr = pRight
 185558 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 185559 	var ppOut uintptr = bp
 185560 
 185561 	for p1 != 0 || p2 != 0 {
 185562 		if p1 == uintptr(0) {
 185563 			*(*uintptr)(unsafe.Pointer(ppOut)) = p2
 185564 			p2 = uintptr(0)
 185565 		} else if p2 == uintptr(0) {
 185566 			*(*uintptr)(unsafe.Pointer(ppOut)) = p1
 185567 			p1 = uintptr(0)
 185568 		} else {
 185569 			var i int32 = 0
 185570 			var zKey1 uintptr = p1 + 1*48
 185571 			var zKey2 uintptr = p2 + 1*48
 185572 			for int32(*(*int8)(unsafe.Pointer(zKey1 + uintptr(i)))) == int32(*(*int8)(unsafe.Pointer(zKey2 + uintptr(i)))) {
 185573 				i++
 185574 			}
 185575 
 185576 			if int32(U8(*(*int8)(unsafe.Pointer(zKey1 + uintptr(i))))) > int32(U8(*(*int8)(unsafe.Pointer(zKey2 + uintptr(i))))) {
 185577 				*(*uintptr)(unsafe.Pointer(ppOut)) = p2
 185578 				ppOut = p2 + 8
 185579 				p2 = (*Fts5HashEntry)(unsafe.Pointer(p2)).FpScanNext
 185580 			} else {
 185581 				*(*uintptr)(unsafe.Pointer(ppOut)) = p1
 185582 				ppOut = p1 + 8
 185583 				p1 = (*Fts5HashEntry)(unsafe.Pointer(p1)).FpScanNext
 185584 			}
 185585 			*(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0)
 185586 		}
 185587 	}
 185588 
 185589 	return *(*uintptr)(unsafe.Pointer(bp))
 185590 }
 185591 
 185592 func fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32, ppSorted uintptr) int32 {
 185593 	var nMergeSlot int32 = 32
 185594 	var ap uintptr
 185595 	var pList uintptr
 185596 	var iSlot int32
 185597 	var i int32
 185598 
 185599 	*(*uintptr)(unsafe.Pointer(ppSorted)) = uintptr(0)
 185600 	ap = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(uintptr(0)))*uint64(nMergeSlot))
 185601 	if !(ap != 0) {
 185602 		return SQLITE_NOMEM
 185603 	}
 185604 	libc.Xmemset(tls, ap, 0, uint64(unsafe.Sizeof(uintptr(0)))*uint64(nMergeSlot))
 185605 
 185606 	for iSlot = 0; iSlot < (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot; iSlot++ {
 185607 		var pIter uintptr
 185608 		for pIter = *(*uintptr)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(iSlot)*8)); pIter != 0; pIter = (*Fts5HashEntry)(unsafe.Pointer(pIter)).FpHashNext {
 185609 			if pTerm == uintptr(0) ||
 185610 				(*Fts5HashEntry)(unsafe.Pointer(pIter)).FnKey+1 >= nTerm && 0 == libc.Xmemcmp(tls, pIter+1*48, pTerm, uint64(nTerm)) {
 185611 				var pEntry uintptr = pIter
 185612 				(*Fts5HashEntry)(unsafe.Pointer(pEntry)).FpScanNext = uintptr(0)
 185613 				for i = 0; *(*uintptr)(unsafe.Pointer(ap + uintptr(i)*8)) != 0; i++ {
 185614 					pEntry = fts5HashEntryMerge(tls, pEntry, *(*uintptr)(unsafe.Pointer(ap + uintptr(i)*8)))
 185615 					*(*uintptr)(unsafe.Pointer(ap + uintptr(i)*8)) = uintptr(0)
 185616 				}
 185617 				*(*uintptr)(unsafe.Pointer(ap + uintptr(i)*8)) = pEntry
 185618 			}
 185619 		}
 185620 	}
 185621 
 185622 	pList = uintptr(0)
 185623 	for i = 0; i < nMergeSlot; i++ {
 185624 		pList = fts5HashEntryMerge(tls, pList, *(*uintptr)(unsafe.Pointer(ap + uintptr(i)*8)))
 185625 	}
 185626 
 185627 	(*Fts5Hash)(unsafe.Pointer(pHash)).FnEntry = 0
 185628 	Xsqlite3_free(tls, ap)
 185629 	*(*uintptr)(unsafe.Pointer(ppSorted)) = pList
 185630 	return SQLITE_OK
 185631 }
 185632 
 185633 func sqlite3Fts5HashQuery(tls *libc.TLS, pHash uintptr, nPre int32, pTerm uintptr, nTerm int32, ppOut uintptr, pnDoclist uintptr) int32 {
 185634 	var iHash uint32 = fts5HashKey(tls, (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot, pTerm, nTerm)
 185635 	var zKey uintptr = uintptr(0)
 185636 	var p uintptr
 185637 
 185638 	for p = *(*uintptr)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(iHash)*8)); p != 0; p = (*Fts5HashEntry)(unsafe.Pointer(p)).FpHashNext {
 185639 		zKey = p + 1*48
 185640 
 185641 		if nTerm == (*Fts5HashEntry)(unsafe.Pointer(p)).FnKey+1 && libc.Xmemcmp(tls, zKey, pTerm, uint64(nTerm)) == 0 {
 185642 			break
 185643 		}
 185644 	}
 185645 
 185646 	if p != 0 {
 185647 		var nHashPre int32 = int32(uint64(unsafe.Sizeof(Fts5HashEntry{})) + uint64(nTerm) + uint64(1))
 185648 		var nList int32 = (*Fts5HashEntry)(unsafe.Pointer(p)).FnData - nHashPre
 185649 		var pRet uintptr = libc.AssignPtrUintptr(ppOut, Xsqlite3_malloc64(tls, uint64(nPre+nList+10)))
 185650 		if pRet != 0 {
 185651 			var pFaux uintptr = pRet + uintptr(nPre-nHashPre)
 185652 			libc.Xmemcpy(tls, pRet+uintptr(nPre), p+uintptr(nHashPre), uint64(nList))
 185653 			nList = nList + fts5HashAddPoslistSize(tls, pHash, p, pFaux)
 185654 			*(*int32)(unsafe.Pointer(pnDoclist)) = nList
 185655 		} else {
 185656 			*(*int32)(unsafe.Pointer(pnDoclist)) = 0
 185657 			return SQLITE_NOMEM
 185658 		}
 185659 	} else {
 185660 		*(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0)
 185661 		*(*int32)(unsafe.Pointer(pnDoclist)) = 0
 185662 	}
 185663 
 185664 	return SQLITE_OK
 185665 }
 185666 
 185667 func sqlite3Fts5HashScanInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32) int32 {
 185668 	return fts5HashEntrySort(tls, p, pTerm, nTerm, p+24)
 185669 }
 185670 
 185671 func sqlite3Fts5HashScanNext(tls *libc.TLS, p uintptr) {
 185672 	(*Fts5Hash)(unsafe.Pointer(p)).FpScan = (*Fts5HashEntry)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(p)).FpScan)).FpScanNext
 185673 }
 185674 
 185675 func sqlite3Fts5HashScanEof(tls *libc.TLS, p uintptr) int32 {
 185676 	return libc.Bool32((*Fts5Hash)(unsafe.Pointer(p)).FpScan == uintptr(0))
 185677 }
 185678 
 185679 func sqlite3Fts5HashScanEntry(tls *libc.TLS, pHash uintptr, pzTerm uintptr, ppDoclist uintptr, pnDoclist uintptr) {
 185680 	var p uintptr
 185681 	if libc.AssignUintptr(&p, (*Fts5Hash)(unsafe.Pointer(pHash)).FpScan) != 0 {
 185682 		var zKey uintptr = p + 1*48
 185683 		var nTerm int32 = int32(libc.Xstrlen(tls, zKey))
 185684 		fts5HashAddPoslistSize(tls, pHash, p, uintptr(0))
 185685 		*(*uintptr)(unsafe.Pointer(pzTerm)) = zKey
 185686 		*(*uintptr)(unsafe.Pointer(ppDoclist)) = zKey + uintptr(nTerm+1)
 185687 		*(*int32)(unsafe.Pointer(pnDoclist)) = int32(uint64((*Fts5HashEntry)(unsafe.Pointer(p)).FnData) - (uint64(unsafe.Sizeof(Fts5HashEntry{})) + uint64(nTerm) + uint64(1)))
 185688 	} else {
 185689 		*(*uintptr)(unsafe.Pointer(pzTerm)) = uintptr(0)
 185690 		*(*uintptr)(unsafe.Pointer(ppDoclist)) = uintptr(0)
 185691 		*(*int32)(unsafe.Pointer(pnDoclist)) = 0
 185692 	}
 185693 }
 185694 
 185695 type Fts5Data1 = struct {
 185696 	Fp      uintptr
 185697 	Fnn     int32
 185698 	FszLeaf int32
 185699 }
 185700 
 185701 type Fts5Data = Fts5Data1
 185702 type Fts5DlidxIter1 = struct {
 185703 	FnLvl   int32
 185704 	FiSegid int32
 185705 	FaLvl   [1]Fts5DlidxLvl
 185706 }
 185707 
 185708 type Fts5DlidxIter = Fts5DlidxIter1
 185709 type Fts5DlidxLvl1 = struct {
 185710 	FpData     uintptr
 185711 	FiOff      int32
 185712 	FbEof      int32
 185713 	FiFirstOff int32
 185714 	FiLeafPgno int32
 185715 	FiRowid    I64
 185716 }
 185717 
 185718 type Fts5DlidxLvl = Fts5DlidxLvl1
 185719 type Fts5DlidxWriter1 = struct {
 185720 	Fpgno       int32
 185721 	FbPrevValid int32
 185722 	FiPrev      I64
 185723 	Fbuf        Fts5Buffer
 185724 }
 185725 
 185726 type Fts5DlidxWriter = Fts5DlidxWriter1
 185727 type Fts5Iter1 = struct {
 185728 	Fbase         Fts5IndexIter
 185729 	FpIndex       uintptr
 185730 	Fposlist      Fts5Buffer
 185731 	FpColset      uintptr
 185732 	FxSetOutputs  uintptr
 185733 	FnSeg         int32
 185734 	FbRev         int32
 185735 	FbSkipEmpty   U8
 185736 	F__ccgo_pad1  [7]byte
 185737 	FiSwitchRowid I64
 185738 	FaFirst       uintptr
 185739 	FaSeg         [1]Fts5SegIter
 185740 }
 185741 
 185742 type Fts5Iter = Fts5Iter1
 185743 type Fts5PageWriter1 = struct {
 185744 	Fpgno       int32
 185745 	FiPrevPgidx int32
 185746 	Fbuf        Fts5Buffer
 185747 	Fpgidx      Fts5Buffer
 185748 	Fterm       Fts5Buffer
 185749 }
 185750 
 185751 type Fts5PageWriter = Fts5PageWriter1
 185752 type Fts5SegIter1 = struct {
 185753 	FpSeg            uintptr
 185754 	Fflags           int32
 185755 	FiLeafPgno       int32
 185756 	FpLeaf           uintptr
 185757 	FpNextLeaf       uintptr
 185758 	FiLeafOffset     I64
 185759 	FxNext           uintptr
 185760 	FiTermLeafPgno   int32
 185761 	FiTermLeafOffset int32
 185762 	FiPgidxOff       int32
 185763 	FiEndofDoclist   int32
 185764 	FiRowidOffset    int32
 185765 	FnRowidOffset    int32
 185766 	FaRowidOffset    uintptr
 185767 	FpDlidx          uintptr
 185768 	Fterm            Fts5Buffer
 185769 	FiRowid          I64
 185770 	FnPos            int32
 185771 	FbDel            U8
 185772 	F__ccgo_pad1     [3]byte
 185773 }
 185774 
 185775 type Fts5SegIter = Fts5SegIter1
 185776 type Fts5DoclistIter1 = struct {
 185777 	FaEof     uintptr
 185778 	FiRowid   I64
 185779 	FaPoslist uintptr
 185780 	FnPoslist int32
 185781 	FnSize    int32
 185782 }
 185783 
 185784 type Fts5DoclistIter = Fts5DoclistIter1
 185785 type Fts5SegWriter1 = struct {
 185786 	FiSegid               int32
 185787 	F__ccgo_pad1          [4]byte
 185788 	Fwriter               Fts5PageWriter
 185789 	FiPrevRowid           I64
 185790 	FbFirstRowidInDoclist U8
 185791 	FbFirstRowidInPage    U8
 185792 	FbFirstTermInPage     U8
 185793 	F__ccgo_pad2          [1]byte
 185794 	FnLeafWritten         int32
 185795 	FnEmpty               int32
 185796 	FnDlidx               int32
 185797 	FaDlidx               uintptr
 185798 	Fbtterm               Fts5Buffer
 185799 	FiBtPage              int32
 185800 	F__ccgo_pad3          [4]byte
 185801 }
 185802 
 185803 type Fts5SegWriter = Fts5SegWriter1
 185804 type Fts5Structure1 = struct {
 185805 	FnRef          int32
 185806 	F__ccgo_pad1   [4]byte
 185807 	FnWriteCounter U64
 185808 	FnSegment      int32
 185809 	FnLevel        int32
 185810 	FaLevel        [1]Fts5StructureLevel
 185811 }
 185812 
 185813 type Fts5Structure = Fts5Structure1
 185814 type Fts5StructureLevel1 = struct {
 185815 	FnMerge int32
 185816 	FnSeg   int32
 185817 	FaSeg   uintptr
 185818 }
 185819 
 185820 type Fts5StructureLevel = Fts5StructureLevel1
 185821 type Fts5StructureSegment1 = struct {
 185822 	FiSegid    int32
 185823 	FpgnoFirst int32
 185824 	FpgnoLast  int32
 185825 }
 185826 
 185827 type Fts5StructureSegment = Fts5StructureSegment1
 185828 
 185829 type Fts5CResult1 = struct {
 185830 	FiFirst      U16
 185831 	FbTermEq     U8
 185832 	F__ccgo_pad1 [1]byte
 185833 }
 185834 
 185835 type Fts5CResult = Fts5CResult1
 185836 
 185837 func fts5PutU16(tls *libc.TLS, aOut uintptr, iVal U16) {
 185838 	*(*U8)(unsafe.Pointer(aOut)) = U8(int32(iVal) >> 8)
 185839 	*(*U8)(unsafe.Pointer(aOut + 1)) = U8(int32(iVal) & 0xFF)
 185840 }
 185841 
 185842 func fts5GetU16(tls *libc.TLS, aIn uintptr) U16 {
 185843 	return U16(int32(U16(*(*U8)(unsafe.Pointer(aIn))))<<8 + int32(*(*U8)(unsafe.Pointer(aIn + 1))))
 185844 }
 185845 
 185846 func fts5IdxMalloc(tls *libc.TLS, p uintptr, nByte Sqlite3_int64) uintptr {
 185847 	return sqlite3Fts5MallocZero(tls, p+52, nByte)
 185848 }
 185849 
 185850 func fts5BufferCompare(tls *libc.TLS, pLeft uintptr, pRight uintptr) int32 {
 185851 	var nCmp int32
 185852 	var res int32
 185853 	nCmp = func() int32 {
 185854 		if (*Fts5Buffer)(unsafe.Pointer(pLeft)).Fn < (*Fts5Buffer)(unsafe.Pointer(pRight)).Fn {
 185855 			return (*Fts5Buffer)(unsafe.Pointer(pLeft)).Fn
 185856 		}
 185857 		return (*Fts5Buffer)(unsafe.Pointer(pRight)).Fn
 185858 	}()
 185859 
 185860 	res = func() int32 {
 185861 		if nCmp <= 0 {
 185862 			return 0
 185863 		}
 185864 		return libc.Xmemcmp(tls, (*Fts5Buffer)(unsafe.Pointer(pLeft)).Fp, (*Fts5Buffer)(unsafe.Pointer(pRight)).Fp, uint64(nCmp))
 185865 	}()
 185866 	return func() int32 {
 185867 		if res == 0 {
 185868 			return (*Fts5Buffer)(unsafe.Pointer(pLeft)).Fn - (*Fts5Buffer)(unsafe.Pointer(pRight)).Fn
 185869 		}
 185870 		return res
 185871 	}()
 185872 }
 185873 
 185874 func fts5LeafFirstTermOff(tls *libc.TLS, pLeaf uintptr) int32 {
 185875 	bp := tls.Alloc(4)
 185876 	defer tls.Free(4)
 185877 
 185878 	sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr((*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf), bp)
 185879 	return *(*int32)(unsafe.Pointer(bp))
 185880 }
 185881 
 185882 func sqlite3Fts5IndexCloseReader(tls *libc.TLS, p uintptr) {
 185883 	if (*Fts5Index)(unsafe.Pointer(p)).FpReader != 0 {
 185884 		var pReader uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpReader
 185885 		(*Fts5Index)(unsafe.Pointer(p)).FpReader = uintptr(0)
 185886 		Xsqlite3_blob_close(tls, pReader)
 185887 	}
 185888 }
 185889 
 185890 func fts5DataRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr {
 185891 	var pRet uintptr = uintptr(0)
 185892 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 185893 		var rc int32 = SQLITE_OK
 185894 
 185895 		if (*Fts5Index)(unsafe.Pointer(p)).FpReader != 0 {
 185896 			var pBlob uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpReader
 185897 			(*Fts5Index)(unsafe.Pointer(p)).FpReader = uintptr(0)
 185898 			rc = Xsqlite3_blob_reopen(tls, pBlob, iRowid)
 185899 
 185900 			(*Fts5Index)(unsafe.Pointer(p)).FpReader = pBlob
 185901 			if rc != SQLITE_OK {
 185902 				sqlite3Fts5IndexCloseReader(tls, p)
 185903 			}
 185904 			if rc == SQLITE_ABORT {
 185905 				rc = SQLITE_OK
 185906 			}
 185907 		}
 185908 
 185909 		if (*Fts5Index)(unsafe.Pointer(p)).FpReader == uintptr(0) && rc == SQLITE_OK {
 185910 			var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
 185911 			rc = Xsqlite3_blob_open(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb,
 185912 				(*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl, ts+36252, iRowid, 0, p+56)
 185913 		}
 185914 
 185915 		if rc == SQLITE_ERROR {
 185916 			rc = SQLITE_CORRUPT | int32(1)<<8
 185917 		}
 185918 
 185919 		if rc == SQLITE_OK {
 185920 			var aOut uintptr = uintptr(0)
 185921 			var nByte int32 = Xsqlite3_blob_bytes(tls, (*Fts5Index)(unsafe.Pointer(p)).FpReader)
 185922 			var nAlloc Sqlite3_int64 = Sqlite3_int64(uint64(unsafe.Sizeof(Fts5Data{})) + uint64(nByte) + uint64(FTS5_DATA_PADDING))
 185923 			pRet = Xsqlite3_malloc64(tls, uint64(nAlloc))
 185924 			if pRet != 0 {
 185925 				(*Fts5Data)(unsafe.Pointer(pRet)).Fnn = nByte
 185926 				aOut = libc.AssignPtrUintptr(pRet, pRet+1*16)
 185927 			} else {
 185928 				rc = SQLITE_NOMEM
 185929 			}
 185930 
 185931 			if rc == SQLITE_OK {
 185932 				rc = Xsqlite3_blob_read(tls, (*Fts5Index)(unsafe.Pointer(p)).FpReader, aOut, nByte, 0)
 185933 			}
 185934 			if rc != SQLITE_OK {
 185935 				Xsqlite3_free(tls, pRet)
 185936 				pRet = uintptr(0)
 185937 			} else {
 185938 				*(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer(pRet)).Fp + uintptr(nByte))) = U8(0x00)
 185939 				*(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer(pRet)).Fp + uintptr(nByte+1))) = U8(0x00)
 185940 				(*Fts5Data)(unsafe.Pointer(pRet)).FszLeaf = int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pRet)).Fp+2))
 185941 			}
 185942 		}
 185943 		(*Fts5Index)(unsafe.Pointer(p)).Frc = rc
 185944 		(*Fts5Index)(unsafe.Pointer(p)).FnRead++
 185945 	}
 185946 
 185947 	return pRet
 185948 }
 185949 
 185950 func fts5DataRelease(tls *libc.TLS, pData uintptr) {
 185951 	Xsqlite3_free(tls, pData)
 185952 }
 185953 
 185954 func fts5LeafRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr {
 185955 	var pRet uintptr = fts5DataRead(tls, p, iRowid)
 185956 	if pRet != 0 {
 185957 		if (*Fts5Data)(unsafe.Pointer(pRet)).Fnn < 4 || (*Fts5Data)(unsafe.Pointer(pRet)).FszLeaf > (*Fts5Data)(unsafe.Pointer(pRet)).Fnn {
 185958 			(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 185959 			fts5DataRelease(tls, pRet)
 185960 			pRet = uintptr(0)
 185961 		}
 185962 	}
 185963 	return pRet
 185964 }
 185965 
 185966 func fts5IndexPrepareStmt(tls *libc.TLS, p uintptr, ppStmt uintptr, zSql uintptr) int32 {
 185967 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 185968 		if zSql != 0 {
 185969 			(*Fts5Index)(unsafe.Pointer(p)).Frc = Xsqlite3_prepare_v3(tls, (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fdb, zSql, -1,
 185970 				uint32(SQLITE_PREPARE_PERSISTENT|SQLITE_PREPARE_NO_VTAB),
 185971 				ppStmt, uintptr(0))
 185972 		} else {
 185973 			(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
 185974 		}
 185975 	}
 185976 	Xsqlite3_free(tls, zSql)
 185977 	return (*Fts5Index)(unsafe.Pointer(p)).Frc
 185978 }
 185979 
 185980 func fts5DataWrite(tls *libc.TLS, p uintptr, iRowid I64, pData uintptr, nData int32) {
 185981 	bp := tls.Alloc(16)
 185982 	defer tls.Free(16)
 185983 
 185984 	if (*Fts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK {
 185985 		return
 185986 	}
 185987 
 185988 	if (*Fts5Index)(unsafe.Pointer(p)).FpWriter == uintptr(0) {
 185989 		var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
 185990 		fts5IndexPrepareStmt(tls, p, p+64, Xsqlite3_mprintf(tls,
 185991 			ts+36258,
 185992 			libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)))
 185993 		if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
 185994 			return
 185995 		}
 185996 	}
 185997 
 185998 	Xsqlite3_bind_int64(tls, (*Fts5Index)(unsafe.Pointer(p)).FpWriter, 1, iRowid)
 185999 	Xsqlite3_bind_blob(tls, (*Fts5Index)(unsafe.Pointer(p)).FpWriter, 2, pData, nData, uintptr(0))
 186000 	Xsqlite3_step(tls, (*Fts5Index)(unsafe.Pointer(p)).FpWriter)
 186001 	(*Fts5Index)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, (*Fts5Index)(unsafe.Pointer(p)).FpWriter)
 186002 	Xsqlite3_bind_null(tls, (*Fts5Index)(unsafe.Pointer(p)).FpWriter, 2)
 186003 }
 186004 
 186005 func fts5DataDelete(tls *libc.TLS, p uintptr, iFirst I64, iLast I64) {
 186006 	bp := tls.Alloc(16)
 186007 	defer tls.Free(16)
 186008 
 186009 	if (*Fts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK {
 186010 		return
 186011 	}
 186012 
 186013 	if (*Fts5Index)(unsafe.Pointer(p)).FpDeleter == uintptr(0) {
 186014 		var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
 186015 		var zSql uintptr = Xsqlite3_mprintf(tls,
 186016 			ts+36309,
 186017 			libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
 186018 		if fts5IndexPrepareStmt(tls, p, p+72, zSql) != 0 {
 186019 			return
 186020 		}
 186021 	}
 186022 
 186023 	Xsqlite3_bind_int64(tls, (*Fts5Index)(unsafe.Pointer(p)).FpDeleter, 1, iFirst)
 186024 	Xsqlite3_bind_int64(tls, (*Fts5Index)(unsafe.Pointer(p)).FpDeleter, 2, iLast)
 186025 	Xsqlite3_step(tls, (*Fts5Index)(unsafe.Pointer(p)).FpDeleter)
 186026 	(*Fts5Index)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, (*Fts5Index)(unsafe.Pointer(p)).FpDeleter)
 186027 }
 186028 
 186029 func fts5DataRemoveSegment(tls *libc.TLS, p uintptr, iSegid int32) {
 186030 	bp := tls.Alloc(16)
 186031 	defer tls.Free(16)
 186032 
 186033 	var iFirst I64 = I64(iSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B) + int64(0)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B) + int64(0)<<FTS5_DATA_PAGE_B + int64(0)
 186034 	var iLast I64 = I64(iSegid+1)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B) + int64(0)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B) + int64(0)<<FTS5_DATA_PAGE_B + int64(0) - int64(1)
 186035 	fts5DataDelete(tls, p, iFirst, iLast)
 186036 	if (*Fts5Index)(unsafe.Pointer(p)).FpIdxDeleter == uintptr(0) {
 186037 		var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
 186038 		fts5IndexPrepareStmt(tls, p, p+88, Xsqlite3_mprintf(tls,
 186039 			ts+36358,
 186040 			libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)))
 186041 	}
 186042 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 186043 		Xsqlite3_bind_int(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxDeleter, 1, iSegid)
 186044 		Xsqlite3_step(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxDeleter)
 186045 		(*Fts5Index)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxDeleter)
 186046 	}
 186047 }
 186048 
 186049 func fts5StructureRelease(tls *libc.TLS, pStruct uintptr) {
 186050 	if pStruct != 0 && 0 >= libc.PreDecInt32(&(*Fts5Structure)(unsafe.Pointer(pStruct)).FnRef, 1) {
 186051 		var i int32
 186052 
 186053 		for i = 0; i < (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel; i++ {
 186054 			Xsqlite3_free(tls, (*Fts5StructureLevel)(unsafe.Pointer(pStruct+24+uintptr(i)*16)).FaSeg)
 186055 		}
 186056 		Xsqlite3_free(tls, pStruct)
 186057 	}
 186058 }
 186059 
 186060 func fts5StructureRef(tls *libc.TLS, pStruct uintptr) {
 186061 	(*Fts5Structure)(unsafe.Pointer(pStruct)).FnRef++
 186062 }
 186063 
 186064 func sqlite3Fts5StructureRef(tls *libc.TLS, p uintptr) uintptr {
 186065 	fts5StructureRef(tls, (*Fts5Index)(unsafe.Pointer(p)).FpStruct)
 186066 	return (*Fts5Index)(unsafe.Pointer(p)).FpStruct
 186067 }
 186068 
 186069 func sqlite3Fts5StructureRelease(tls *libc.TLS, p uintptr) {
 186070 	if p != 0 {
 186071 		fts5StructureRelease(tls, p)
 186072 	}
 186073 }
 186074 
 186075 func sqlite3Fts5StructureTest(tls *libc.TLS, p uintptr, pStruct uintptr) int32 {
 186076 	if (*Fts5Index)(unsafe.Pointer(p)).FpStruct != pStruct {
 186077 		return SQLITE_ABORT
 186078 	}
 186079 	return SQLITE_OK
 186080 }
 186081 
 186082 func fts5StructureMakeWritable(tls *libc.TLS, pRc uintptr, pp uintptr) {
 186083 	var p uintptr = *(*uintptr)(unsafe.Pointer(pp))
 186084 	if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK && (*Fts5Structure)(unsafe.Pointer(p)).FnRef > 1 {
 186085 		var nByte I64 = I64(uint64(unsafe.Sizeof(Fts5Structure{})) + uint64((*Fts5Structure)(unsafe.Pointer(p)).FnLevel-1)*uint64(unsafe.Sizeof(Fts5StructureLevel{})))
 186086 		var pNew uintptr
 186087 		pNew = sqlite3Fts5MallocZero(tls, pRc, nByte)
 186088 		if pNew != 0 {
 186089 			var i int32
 186090 			libc.Xmemcpy(tls, pNew, p, uint64(nByte))
 186091 			for i = 0; i < (*Fts5Structure)(unsafe.Pointer(p)).FnLevel; i++ {
 186092 				(*Fts5StructureLevel)(unsafe.Pointer(pNew + 24 + uintptr(i)*16)).FaSeg = uintptr(0)
 186093 			}
 186094 			for i = 0; i < (*Fts5Structure)(unsafe.Pointer(p)).FnLevel; i++ {
 186095 				var pLvl uintptr = pNew + 24 + uintptr(i)*16
 186096 				nByte = I64(uint64(unsafe.Sizeof(Fts5StructureSegment{})) * uint64((*Fts5StructureLevel)(unsafe.Pointer(pNew+24+uintptr(i)*16)).FnSeg))
 186097 				(*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg = sqlite3Fts5MallocZero(tls, pRc, nByte)
 186098 				if (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg == uintptr(0) {
 186099 					for i = 0; i < (*Fts5Structure)(unsafe.Pointer(p)).FnLevel; i++ {
 186100 						Xsqlite3_free(tls, (*Fts5StructureLevel)(unsafe.Pointer(pNew+24+uintptr(i)*16)).FaSeg)
 186101 					}
 186102 					Xsqlite3_free(tls, pNew)
 186103 					return
 186104 				}
 186105 				libc.Xmemcpy(tls, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg, (*Fts5StructureLevel)(unsafe.Pointer(p+24+uintptr(i)*16)).FaSeg, uint64(nByte))
 186106 			}
 186107 			(*Fts5Structure)(unsafe.Pointer(p)).FnRef--
 186108 			(*Fts5Structure)(unsafe.Pointer(pNew)).FnRef = 1
 186109 		}
 186110 		*(*uintptr)(unsafe.Pointer(pp)) = pNew
 186111 	}
 186112 }
 186113 
 186114 func fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie uintptr, ppOut uintptr) int32 {
 186115 	bp := tls.Alloc(16)
 186116 	defer tls.Free(16)
 186117 
 186118 	*(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK
 186119 	var i int32 = 0
 186120 	var iLvl int32
 186121 	*(*int32)(unsafe.Pointer(bp)) = 0
 186122 	*(*int32)(unsafe.Pointer(bp + 4)) = 0
 186123 	var nByte Sqlite3_int64
 186124 	var pRet uintptr = uintptr(0)
 186125 
 186126 	if piCookie != 0 {
 186127 		*(*int32)(unsafe.Pointer(piCookie)) = sqlite3Fts5Get32(tls, pData)
 186128 	}
 186129 	i = 4
 186130 
 186131 	i = i + sqlite3Fts5GetVarint32(tls, pData+uintptr(i), bp)
 186132 	i = i + sqlite3Fts5GetVarint32(tls, pData+uintptr(i), bp+4)
 186133 	if *(*int32)(unsafe.Pointer(bp)) > FTS5_MAX_SEGMENT || *(*int32)(unsafe.Pointer(bp)) < 0 ||
 186134 		*(*int32)(unsafe.Pointer(bp + 4)) > FTS5_MAX_SEGMENT || *(*int32)(unsafe.Pointer(bp + 4)) < 0 {
 186135 		return SQLITE_CORRUPT | int32(1)<<8
 186136 	}
 186137 	nByte = Sqlite3_int64(uint64(unsafe.Sizeof(Fts5Structure{})) + uint64(unsafe.Sizeof(Fts5StructureLevel{}))*uint64(*(*int32)(unsafe.Pointer(bp))-1))
 186138 	pRet = sqlite3Fts5MallocZero(tls, bp+8, nByte)
 186139 
 186140 	if pRet != 0 {
 186141 		(*Fts5Structure)(unsafe.Pointer(pRet)).FnRef = 1
 186142 		(*Fts5Structure)(unsafe.Pointer(pRet)).FnLevel = *(*int32)(unsafe.Pointer(bp))
 186143 		(*Fts5Structure)(unsafe.Pointer(pRet)).FnSegment = *(*int32)(unsafe.Pointer(bp + 4))
 186144 		i = i + int32(sqlite3Fts5GetVarint(tls, pData+uintptr(i), pRet+8))
 186145 
 186146 		for iLvl = 0; *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && iLvl < *(*int32)(unsafe.Pointer(bp)); iLvl++ {
 186147 			var pLvl uintptr = pRet + 24 + uintptr(iLvl)*16
 186148 			*(*int32)(unsafe.Pointer(bp + 12)) = 0
 186149 			var iSeg int32
 186150 
 186151 			if i >= nData {
 186152 				*(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_CORRUPT | int32(1)<<8
 186153 			} else {
 186154 				i = i + sqlite3Fts5GetVarint32(tls, pData+uintptr(i), pLvl)
 186155 				i = i + sqlite3Fts5GetVarint32(tls, pData+uintptr(i), bp+12)
 186156 				if *(*int32)(unsafe.Pointer(bp + 12)) < (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge {
 186157 					*(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_CORRUPT | int32(1)<<8
 186158 				}
 186159 				(*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg = sqlite3Fts5MallocZero(tls, bp+8,
 186160 					int64(uint64(*(*int32)(unsafe.Pointer(bp + 12)))*uint64(unsafe.Sizeof(Fts5StructureSegment{}))))
 186161 				*(*int32)(unsafe.Pointer(bp + 4)) -= *(*int32)(unsafe.Pointer(bp + 12))
 186162 			}
 186163 
 186164 			if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
 186165 				(*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg = *(*int32)(unsafe.Pointer(bp + 12))
 186166 				for iSeg = 0; iSeg < *(*int32)(unsafe.Pointer(bp + 12)); iSeg++ {
 186167 					var pSeg uintptr = (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg + uintptr(iSeg)*12
 186168 					if i >= nData {
 186169 						*(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_CORRUPT | int32(1)<<8
 186170 						break
 186171 					}
 186172 					i = i + sqlite3Fts5GetVarint32(tls, pData+uintptr(i), pSeg)
 186173 					i = i + sqlite3Fts5GetVarint32(tls, pData+uintptr(i), pSeg+4)
 186174 					i = i + sqlite3Fts5GetVarint32(tls, pData+uintptr(i), pSeg+8)
 186175 					if (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast < (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst {
 186176 						*(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_CORRUPT | int32(1)<<8
 186177 						break
 186178 					}
 186179 				}
 186180 				if iLvl > 0 && (*Fts5StructureLevel)(unsafe.Pointer(pLvl+libc.UintptrFromInt32(-1)*16)).FnMerge != 0 && *(*int32)(unsafe.Pointer(bp + 12)) == 0 {
 186181 					*(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_CORRUPT | int32(1)<<8
 186182 				}
 186183 				if iLvl == *(*int32)(unsafe.Pointer(bp))-1 && (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge != 0 {
 186184 					*(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_CORRUPT | int32(1)<<8
 186185 				}
 186186 			}
 186187 		}
 186188 		if *(*int32)(unsafe.Pointer(bp + 4)) != 0 && *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
 186189 			*(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_CORRUPT | int32(1)<<8
 186190 		}
 186191 
 186192 		if *(*int32)(unsafe.Pointer(bp + 8)) != SQLITE_OK {
 186193 			fts5StructureRelease(tls, pRet)
 186194 			pRet = uintptr(0)
 186195 		}
 186196 	}
 186197 
 186198 	*(*uintptr)(unsafe.Pointer(ppOut)) = pRet
 186199 	return *(*int32)(unsafe.Pointer(bp + 8))
 186200 }
 186201 
 186202 func fts5StructureAddLevel(tls *libc.TLS, pRc uintptr, ppStruct uintptr) {
 186203 	fts5StructureMakeWritable(tls, pRc, ppStruct)
 186204 	if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
 186205 		var pStruct uintptr = *(*uintptr)(unsafe.Pointer(ppStruct))
 186206 		var nLevel int32 = (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel
 186207 		var nByte Sqlite3_int64 = Sqlite3_int64(uint64(unsafe.Sizeof(Fts5Structure{})) + uint64(unsafe.Sizeof(Fts5StructureLevel{}))*uint64(nLevel+1))
 186208 
 186209 		pStruct = Xsqlite3_realloc64(tls, pStruct, uint64(nByte))
 186210 		if pStruct != 0 {
 186211 			libc.Xmemset(tls, pStruct+24+uintptr(nLevel)*16, 0, uint64(unsafe.Sizeof(Fts5StructureLevel{})))
 186212 			(*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel++
 186213 			*(*uintptr)(unsafe.Pointer(ppStruct)) = pStruct
 186214 		} else {
 186215 			*(*int32)(unsafe.Pointer(pRc)) = SQLITE_NOMEM
 186216 		}
 186217 	}
 186218 }
 186219 
 186220 func fts5StructureExtendLevel(tls *libc.TLS, pRc uintptr, pStruct uintptr, iLvl int32, nExtra int32, bInsert int32) {
 186221 	if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
 186222 		var pLvl uintptr = pStruct + 24 + uintptr(iLvl)*16
 186223 		var aNew uintptr
 186224 		var nByte Sqlite3_int64
 186225 
 186226 		nByte = Sqlite3_int64(uint64((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg+nExtra) * uint64(unsafe.Sizeof(Fts5StructureSegment{})))
 186227 		aNew = Xsqlite3_realloc64(tls, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg, uint64(nByte))
 186228 		if aNew != 0 {
 186229 			if bInsert == 0 {
 186230 				libc.Xmemset(tls, aNew+uintptr((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg)*12, 0, uint64(unsafe.Sizeof(Fts5StructureSegment{}))*uint64(nExtra))
 186231 			} else {
 186232 				var nMove int32 = int32(uint64((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg) * uint64(unsafe.Sizeof(Fts5StructureSegment{})))
 186233 				libc.Xmemmove(tls, aNew+uintptr(nExtra)*12, aNew, uint64(nMove))
 186234 				libc.Xmemset(tls, aNew, 0, uint64(unsafe.Sizeof(Fts5StructureSegment{}))*uint64(nExtra))
 186235 			}
 186236 			(*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg = aNew
 186237 		} else {
 186238 			*(*int32)(unsafe.Pointer(pRc)) = SQLITE_NOMEM
 186239 		}
 186240 	}
 186241 }
 186242 
 186243 func fts5StructureReadUncached(tls *libc.TLS, p uintptr) uintptr {
 186244 	bp := tls.Alloc(16)
 186245 	defer tls.Free(16)
 186246 
 186247 	*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 186248 	var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
 186249 
 186250 	var pData uintptr
 186251 
 186252 	pData = fts5DataRead(tls, p, int64(FTS5_STRUCTURE_ROWID))
 186253 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 186254 		libc.Xmemset(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp+uintptr((*Fts5Data)(unsafe.Pointer(pData)).Fnn), 0, uint64(FTS5_DATA_PADDING))
 186255 		(*Fts5Index)(unsafe.Pointer(p)).Frc = fts5StructureDecode(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp, (*Fts5Data)(unsafe.Pointer(pData)).Fnn, bp, bp+8)
 186256 		if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && ((*Fts5Config)(unsafe.Pointer(pConfig)).Fpgsz == 0 || (*Fts5Config)(unsafe.Pointer(pConfig)).FiCookie != *(*int32)(unsafe.Pointer(bp))) {
 186257 			(*Fts5Index)(unsafe.Pointer(p)).Frc = sqlite3Fts5ConfigLoad(tls, pConfig, *(*int32)(unsafe.Pointer(bp)))
 186258 		}
 186259 		fts5DataRelease(tls, pData)
 186260 		if (*Fts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK {
 186261 			fts5StructureRelease(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
 186262 			*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 186263 		}
 186264 	}
 186265 
 186266 	return *(*uintptr)(unsafe.Pointer(bp + 8))
 186267 }
 186268 
 186269 func fts5IndexDataVersion(tls *libc.TLS, p uintptr) I64 {
 186270 	bp := tls.Alloc(8)
 186271 	defer tls.Free(8)
 186272 
 186273 	var iVersion I64 = int64(0)
 186274 
 186275 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 186276 		if (*Fts5Index)(unsafe.Pointer(p)).FpDataVersion == uintptr(0) {
 186277 			(*Fts5Index)(unsafe.Pointer(p)).Frc = fts5IndexPrepareStmt(tls, p, p+112,
 186278 				Xsqlite3_mprintf(tls, ts+36398, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb)))
 186279 			if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
 186280 				return int64(0)
 186281 			}
 186282 		}
 186283 
 186284 		if SQLITE_ROW == Xsqlite3_step(tls, (*Fts5Index)(unsafe.Pointer(p)).FpDataVersion) {
 186285 			iVersion = Xsqlite3_column_int64(tls, (*Fts5Index)(unsafe.Pointer(p)).FpDataVersion, 0)
 186286 		}
 186287 		(*Fts5Index)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, (*Fts5Index)(unsafe.Pointer(p)).FpDataVersion)
 186288 	}
 186289 
 186290 	return iVersion
 186291 }
 186292 
 186293 func fts5StructureRead(tls *libc.TLS, p uintptr) uintptr {
 186294 	if (*Fts5Index)(unsafe.Pointer(p)).FpStruct == uintptr(0) {
 186295 		(*Fts5Index)(unsafe.Pointer(p)).FiStructVersion = fts5IndexDataVersion(tls, p)
 186296 		if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 186297 			(*Fts5Index)(unsafe.Pointer(p)).FpStruct = fts5StructureReadUncached(tls, p)
 186298 		}
 186299 	}
 186300 
 186301 	if (*Fts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK {
 186302 		return uintptr(0)
 186303 	}
 186304 
 186305 	fts5StructureRef(tls, (*Fts5Index)(unsafe.Pointer(p)).FpStruct)
 186306 	return (*Fts5Index)(unsafe.Pointer(p)).FpStruct
 186307 }
 186308 
 186309 func fts5StructureInvalidate(tls *libc.TLS, p uintptr) {
 186310 	if (*Fts5Index)(unsafe.Pointer(p)).FpStruct != 0 {
 186311 		fts5StructureRelease(tls, (*Fts5Index)(unsafe.Pointer(p)).FpStruct)
 186312 		(*Fts5Index)(unsafe.Pointer(p)).FpStruct = uintptr(0)
 186313 	}
 186314 }
 186315 
 186316 func fts5StructureWrite(tls *libc.TLS, p uintptr, pStruct uintptr) {
 186317 	bp := tls.Alloc(16)
 186318 	defer tls.Free(16)
 186319 
 186320 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 186321 		var iLvl int32
 186322 		var iCookie int32
 186323 
 186324 		libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Fts5Buffer{})))
 186325 
 186326 		iCookie = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FiCookie
 186327 		if iCookie < 0 {
 186328 			iCookie = 0
 186329 		}
 186330 
 186331 		if 0 == sqlite3Fts5BufferSize(tls, p+52, bp, uint32(4+9+9+9)) {
 186332 			sqlite3Fts5Put32(tls, (*Fts5Buffer)(unsafe.Pointer(bp)).Fp, iCookie)
 186333 			(*Fts5Buffer)(unsafe.Pointer(bp)).Fn = 4
 186334 			{
 186335 				*(*int32)(unsafe.Pointer(bp + 8)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(bp)).Fn), uint64((*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel))
 186336 			}
 186337 
 186338 			{
 186339 				*(*int32)(unsafe.Pointer(bp + 8)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(bp)).Fn), uint64((*Fts5Structure)(unsafe.Pointer(pStruct)).FnSegment))
 186340 			}
 186341 
 186342 			{
 186343 				*(*int32)(unsafe.Pointer(bp + 8)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(bp)).Fn), uint64(I64((*Fts5Structure)(unsafe.Pointer(pStruct)).FnWriteCounter)))
 186344 			}
 186345 
 186346 		}
 186347 
 186348 		for iLvl = 0; iLvl < (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel; iLvl++ {
 186349 			var iSeg int32
 186350 			var pLvl uintptr = pStruct + 24 + uintptr(iLvl)*16
 186351 			sqlite3Fts5BufferAppendVarint(tls, p+52, bp, I64((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge))
 186352 			sqlite3Fts5BufferAppendVarint(tls, p+52, bp, I64((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg))
 186353 
 186354 			for iSeg = 0; iSeg < (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg; iSeg++ {
 186355 				sqlite3Fts5BufferAppendVarint(tls, p+52, bp, I64((*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(iSeg)*12)).FiSegid))
 186356 				sqlite3Fts5BufferAppendVarint(tls, p+52, bp, I64((*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(iSeg)*12)).FpgnoFirst))
 186357 				sqlite3Fts5BufferAppendVarint(tls, p+52, bp, I64((*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(iSeg)*12)).FpgnoLast))
 186358 			}
 186359 		}
 186360 
 186361 		fts5DataWrite(tls, p, int64(FTS5_STRUCTURE_ROWID), (*Fts5Buffer)(unsafe.Pointer(bp)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp)).Fn)
 186362 		sqlite3Fts5BufferFree(tls, bp)
 186363 	}
 186364 }
 186365 
 186366 func fts5SegmentSize(tls *libc.TLS, pSeg uintptr) int32 {
 186367 	return 1 + (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast - (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst
 186368 }
 186369 
 186370 func fts5StructurePromoteTo(tls *libc.TLS, p uintptr, iPromote int32, szPromote int32, pStruct uintptr) {
 186371 	var il int32
 186372 	var is int32
 186373 	var pOut uintptr = pStruct + 24 + uintptr(iPromote)*16
 186374 
 186375 	if (*Fts5StructureLevel)(unsafe.Pointer(pOut)).FnMerge == 0 {
 186376 		for il = iPromote + 1; il < (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel; il++ {
 186377 			var pLvl uintptr = pStruct + 24 + uintptr(il)*16
 186378 			if (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge != 0 {
 186379 				return
 186380 			}
 186381 			for is = (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg - 1; is >= 0; is-- {
 186382 				var sz int32 = fts5SegmentSize(tls, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(is)*12)
 186383 				if sz > szPromote {
 186384 					return
 186385 				}
 186386 				fts5StructureExtendLevel(tls, p+52, pStruct, iPromote, 1, 1)
 186387 				if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
 186388 					return
 186389 				}
 186390 				libc.Xmemcpy(tls, (*Fts5StructureLevel)(unsafe.Pointer(pOut)).FaSeg, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(is)*12, uint64(unsafe.Sizeof(Fts5StructureSegment{})))
 186391 				(*Fts5StructureLevel)(unsafe.Pointer(pOut)).FnSeg++
 186392 				(*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg--
 186393 			}
 186394 		}
 186395 	}
 186396 }
 186397 
 186398 func fts5StructurePromote(tls *libc.TLS, p uintptr, iLvl int32, pStruct uintptr) {
 186399 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 186400 		var iTst int32
 186401 		var iPromote int32 = -1
 186402 		var szPromote int32 = 0
 186403 		var pSeg uintptr
 186404 		var szSeg int32
 186405 		var nSeg int32 = (*Fts5StructureLevel)(unsafe.Pointer(pStruct + 24 + uintptr(iLvl)*16)).FnSeg
 186406 
 186407 		if nSeg == 0 {
 186408 			return
 186409 		}
 186410 		pSeg = (*Fts5StructureLevel)(unsafe.Pointer(pStruct+24+uintptr(iLvl)*16)).FaSeg + uintptr((*Fts5StructureLevel)(unsafe.Pointer(pStruct+24+uintptr(iLvl)*16)).FnSeg-1)*12
 186411 		szSeg = 1 + (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast - (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst
 186412 
 186413 		for iTst = iLvl - 1; iTst >= 0 && (*Fts5StructureLevel)(unsafe.Pointer(pStruct+24+uintptr(iTst)*16)).FnSeg == 0; iTst-- {
 186414 		}
 186415 		if iTst >= 0 {
 186416 			var i int32
 186417 			var szMax int32 = 0
 186418 			var pTst uintptr = pStruct + 24 + uintptr(iTst)*16
 186419 
 186420 			for i = 0; i < (*Fts5StructureLevel)(unsafe.Pointer(pTst)).FnSeg; i++ {
 186421 				var sz int32 = (*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pTst)).FaSeg+uintptr(i)*12)).FpgnoLast - (*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pTst)).FaSeg+uintptr(i)*12)).FpgnoFirst + 1
 186422 				if sz > szMax {
 186423 					szMax = sz
 186424 				}
 186425 			}
 186426 			if szMax >= szSeg {
 186427 				iPromote = iTst
 186428 				szPromote = szMax
 186429 			}
 186430 		}
 186431 
 186432 		if iPromote < 0 {
 186433 			iPromote = iLvl
 186434 			szPromote = szSeg
 186435 		}
 186436 		fts5StructurePromoteTo(tls, p, iPromote, szPromote, pStruct)
 186437 	}
 186438 }
 186439 
 186440 func fts5DlidxLvlNext(tls *libc.TLS, pLvl uintptr) int32 {
 186441 	bp := tls.Alloc(8)
 186442 	defer tls.Free(8)
 186443 
 186444 	var pData uintptr = (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData
 186445 
 186446 	if (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff == 0 {
 186447 		(*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff = 1
 186448 		*(*int32)(unsafe.Pointer(pLvl + 8)) += sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp+1, pLvl+20)
 186449 		*(*int32)(unsafe.Pointer(pLvl + 8)) += int32(sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp+uintptr((*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff), pLvl+24))
 186450 		(*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiFirstOff = (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff
 186451 	} else {
 186452 		var iOff int32
 186453 		for iOff = (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff; iOff < (*Fts5Data)(unsafe.Pointer(pData)).Fnn; iOff++ {
 186454 			if *(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr(iOff))) != 0 {
 186455 				break
 186456 			}
 186457 		}
 186458 
 186459 		if iOff < (*Fts5Data)(unsafe.Pointer(pData)).Fnn {
 186460 			*(*int32)(unsafe.Pointer(pLvl + 20)) += iOff - (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff + 1
 186461 			iOff = iOff + int32(sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp+uintptr(iOff), bp))
 186462 			*(*I64)(unsafe.Pointer(pLvl + 24)) += *(*I64)(unsafe.Pointer(bp))
 186463 			(*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff = iOff
 186464 		} else {
 186465 			(*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FbEof = 1
 186466 		}
 186467 	}
 186468 
 186469 	return (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FbEof
 186470 }
 186471 
 186472 func fts5DlidxIterNextR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) int32 {
 186473 	var pLvl uintptr = pIter + 8 + uintptr(iLvl)*32
 186474 
 186475 	if fts5DlidxLvlNext(tls, pLvl) != 0 {
 186476 		if iLvl+1 < (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl {
 186477 			fts5DlidxIterNextR(tls, p, pIter, iLvl+1)
 186478 			if (*Fts5DlidxLvl)(unsafe.Pointer(pLvl+1*32)).FbEof == 0 {
 186479 				fts5DataRelease(tls, (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData)
 186480 				libc.Xmemset(tls, pLvl, 0, uint64(unsafe.Sizeof(Fts5DlidxLvl{})))
 186481 				(*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData = fts5DataRead(tls, p,
 186482 					I64((*Fts5DlidxIter)(unsafe.Pointer(pIter)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)+int64(1)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B)+I64(iLvl)<<FTS5_DATA_PAGE_B+I64((*Fts5DlidxLvl)(unsafe.Pointer(pLvl+1*32)).FiLeafPgno))
 186483 				if (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData != 0 {
 186484 					fts5DlidxLvlNext(tls, pLvl)
 186485 				}
 186486 			}
 186487 		}
 186488 	}
 186489 
 186490 	return (*Fts5DlidxLvl)(unsafe.Pointer(pIter + 8)).FbEof
 186491 }
 186492 
 186493 func fts5DlidxIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 {
 186494 	return fts5DlidxIterNextR(tls, p, pIter, 0)
 186495 }
 186496 
 186497 func fts5DlidxIterFirst(tls *libc.TLS, pIter uintptr) int32 {
 186498 	var i int32
 186499 	for i = 0; i < (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl; i++ {
 186500 		fts5DlidxLvlNext(tls, pIter+8+uintptr(i)*32)
 186501 	}
 186502 	return (*Fts5DlidxLvl)(unsafe.Pointer(pIter + 8)).FbEof
 186503 }
 186504 
 186505 func fts5DlidxIterEof(tls *libc.TLS, p uintptr, pIter uintptr) int32 {
 186506 	return libc.Bool32((*Fts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK || (*Fts5DlidxLvl)(unsafe.Pointer(pIter+8)).FbEof != 0)
 186507 }
 186508 
 186509 func fts5DlidxIterLast(tls *libc.TLS, p uintptr, pIter uintptr) {
 186510 	var i int32
 186511 
 186512 	for i = (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl - 1; (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && i >= 0; i-- {
 186513 		var pLvl uintptr = pIter + 8 + uintptr(i)*32
 186514 		for fts5DlidxLvlNext(tls, pLvl) == 0 {
 186515 		}
 186516 		(*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FbEof = 0
 186517 
 186518 		if i > 0 {
 186519 			var pChild uintptr = pLvl + libc.UintptrFromInt32(-1)*32
 186520 			fts5DataRelease(tls, (*Fts5DlidxLvl)(unsafe.Pointer(pChild)).FpData)
 186521 			libc.Xmemset(tls, pChild, 0, uint64(unsafe.Sizeof(Fts5DlidxLvl{})))
 186522 			(*Fts5DlidxLvl)(unsafe.Pointer(pChild)).FpData = fts5DataRead(tls, p,
 186523 				I64((*Fts5DlidxIter)(unsafe.Pointer(pIter)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)+int64(1)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B)+I64(i-1)<<FTS5_DATA_PAGE_B+I64((*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiLeafPgno))
 186524 		}
 186525 	}
 186526 }
 186527 
 186528 func fts5DlidxLvlPrev(tls *libc.TLS, pLvl uintptr) int32 {
 186529 	bp := tls.Alloc(8)
 186530 	defer tls.Free(8)
 186531 
 186532 	var iOff int32 = (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff
 186533 
 186534 	if iOff <= (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiFirstOff {
 186535 		(*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FbEof = 1
 186536 	} else {
 186537 		var a uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData)).Fp
 186538 
 186539 		var iLimit int32
 186540 		var ii int32
 186541 		var nZero int32 = 0
 186542 
 186543 		iLimit = func() int32 {
 186544 			if iOff > 9 {
 186545 				return iOff - 9
 186546 			}
 186547 			return 0
 186548 		}()
 186549 		for iOff--; iOff > iLimit; iOff-- {
 186550 			if int32(*(*U8)(unsafe.Pointer(a + uintptr(iOff-1))))&0x80 == 0 {
 186551 				break
 186552 			}
 186553 		}
 186554 
 186555 		sqlite3Fts5GetVarint(tls, a+uintptr(iOff), bp)
 186556 		*(*I64)(unsafe.Pointer(pLvl + 24)) -= *(*I64)(unsafe.Pointer(bp))
 186557 		(*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiLeafPgno--
 186558 
 186559 		for ii = iOff - 1; ii >= (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiFirstOff && int32(*(*U8)(unsafe.Pointer(a + uintptr(ii)))) == 0x00; ii-- {
 186560 			nZero++
 186561 		}
 186562 		if ii >= (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiFirstOff && int32(*(*U8)(unsafe.Pointer(a + uintptr(ii))))&0x80 != 0 {
 186563 			var bZero int32 = 0
 186564 			if ii-8 >= (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiFirstOff {
 186565 				var j int32
 186566 				for j = 1; j <= 8 && int32(*(*U8)(unsafe.Pointer(a + uintptr(ii-j))))&0x80 != 0; j++ {
 186567 				}
 186568 				bZero = libc.Bool32(j > 8)
 186569 			}
 186570 			if bZero == 0 {
 186571 				nZero--
 186572 			}
 186573 		}
 186574 		*(*int32)(unsafe.Pointer(pLvl + 20)) -= nZero
 186575 		(*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff = iOff - nZero
 186576 	}
 186577 
 186578 	return (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FbEof
 186579 }
 186580 
 186581 func fts5DlidxIterPrevR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) int32 {
 186582 	var pLvl uintptr = pIter + 8 + uintptr(iLvl)*32
 186583 
 186584 	if fts5DlidxLvlPrev(tls, pLvl) != 0 {
 186585 		if iLvl+1 < (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl {
 186586 			fts5DlidxIterPrevR(tls, p, pIter, iLvl+1)
 186587 			if (*Fts5DlidxLvl)(unsafe.Pointer(pLvl+1*32)).FbEof == 0 {
 186588 				fts5DataRelease(tls, (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData)
 186589 				libc.Xmemset(tls, pLvl, 0, uint64(unsafe.Sizeof(Fts5DlidxLvl{})))
 186590 				(*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData = fts5DataRead(tls, p,
 186591 					I64((*Fts5DlidxIter)(unsafe.Pointer(pIter)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)+int64(1)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B)+I64(iLvl)<<FTS5_DATA_PAGE_B+I64((*Fts5DlidxLvl)(unsafe.Pointer(pLvl+1*32)).FiLeafPgno))
 186592 				if (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData != 0 {
 186593 					for fts5DlidxLvlNext(tls, pLvl) == 0 {
 186594 					}
 186595 					(*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FbEof = 0
 186596 				}
 186597 			}
 186598 		}
 186599 	}
 186600 
 186601 	return (*Fts5DlidxLvl)(unsafe.Pointer(pIter + 8)).FbEof
 186602 }
 186603 
 186604 func fts5DlidxIterPrev(tls *libc.TLS, p uintptr, pIter uintptr) int32 {
 186605 	return fts5DlidxIterPrevR(tls, p, pIter, 0)
 186606 }
 186607 
 186608 func fts5DlidxIterFree(tls *libc.TLS, pIter uintptr) {
 186609 	if pIter != 0 {
 186610 		var i int32
 186611 		for i = 0; i < (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl; i++ {
 186612 			fts5DataRelease(tls, (*Fts5DlidxLvl)(unsafe.Pointer(pIter+8+uintptr(i)*32)).FpData)
 186613 		}
 186614 		Xsqlite3_free(tls, pIter)
 186615 	}
 186616 }
 186617 
 186618 func fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLeafPg int32) uintptr {
 186619 	var pIter uintptr = uintptr(0)
 186620 	var i int32
 186621 	var bDone int32 = 0
 186622 
 186623 	for i = 0; (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bDone == 0; i++ {
 186624 		var nByte Sqlite3_int64 = Sqlite3_int64(uint64(unsafe.Sizeof(Fts5DlidxIter{})) + uint64(i)*uint64(unsafe.Sizeof(Fts5DlidxLvl{})))
 186625 		var pNew uintptr
 186626 
 186627 		pNew = Xsqlite3_realloc64(tls, pIter, uint64(nByte))
 186628 		if pNew == uintptr(0) {
 186629 			(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
 186630 		} else {
 186631 			var iRowid I64 = I64(iSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B) + int64(1)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B) + I64(i)<<FTS5_DATA_PAGE_B + I64(iLeafPg)
 186632 			var pLvl uintptr = pNew + 8 + uintptr(i)*32
 186633 			pIter = pNew
 186634 			libc.Xmemset(tls, pLvl, 0, uint64(unsafe.Sizeof(Fts5DlidxLvl{})))
 186635 			(*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData = fts5DataRead(tls, p, iRowid)
 186636 			if (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData != 0 && int32(*(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer((*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData)).Fp)))&0x0001 == 0 {
 186637 				bDone = 1
 186638 			}
 186639 			(*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl = i + 1
 186640 		}
 186641 	}
 186642 
 186643 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 186644 		(*Fts5DlidxIter)(unsafe.Pointer(pIter)).FiSegid = iSegid
 186645 		if bRev == 0 {
 186646 			fts5DlidxIterFirst(tls, pIter)
 186647 		} else {
 186648 			fts5DlidxIterLast(tls, p, pIter)
 186649 		}
 186650 	}
 186651 
 186652 	if (*Fts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK {
 186653 		fts5DlidxIterFree(tls, pIter)
 186654 		pIter = uintptr(0)
 186655 	}
 186656 
 186657 	return pIter
 186658 }
 186659 
 186660 func fts5DlidxIterRowid(tls *libc.TLS, pIter uintptr) I64 {
 186661 	return (*Fts5DlidxLvl)(unsafe.Pointer(pIter + 8)).FiRowid
 186662 }
 186663 
 186664 func fts5DlidxIterPgno(tls *libc.TLS, pIter uintptr) int32 {
 186665 	return (*Fts5DlidxLvl)(unsafe.Pointer(pIter + 8)).FiLeafPgno
 186666 }
 186667 
 186668 func fts5SegIterNextPage(tls *libc.TLS, p uintptr, pIter uintptr) {
 186669 	var pLeaf uintptr
 186670 	var pSeg uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg
 186671 	fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)
 186672 	(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno++
 186673 	if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpNextLeaf != 0 {
 186674 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpNextLeaf
 186675 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FpNextLeaf = uintptr(0)
 186676 	} else if (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno <= (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast {
 186677 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = fts5LeafRead(tls, p,
 186678 			I64((*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)+int64(0)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B)+int64(0)<<FTS5_DATA_PAGE_B+I64((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno))
 186679 	} else {
 186680 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = uintptr(0)
 186681 	}
 186682 	pLeaf = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf
 186683 
 186684 	if pLeaf != 0 {
 186685 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff = (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf
 186686 		if (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf >= (*Fts5Data)(unsafe.Pointer(pLeaf)).Fnn {
 186687 			(*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (*Fts5Data)(unsafe.Pointer(pLeaf)).Fnn + 1
 186688 		} else {
 186689 			*(*int32)(unsafe.Pointer(pIter + 56)) += sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr((*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff), pIter+60)
 186690 		}
 186691 	}
 186692 }
 186693 
 186694 func fts5GetPoslistSize(tls *libc.TLS, p uintptr, pnSz uintptr, pbDel uintptr) int32 {
 186695 	bp := tls.Alloc(4)
 186696 	defer tls.Free(4)
 186697 
 186698 	var n int32 = 0
 186699 	{
 186700 		*(*int32)(unsafe.Pointer(bp)) = int32(*(*U8)(unsafe.Pointer(p + uintptr(libc.PostIncInt32(&n, 1)))))
 186701 		if *(*int32)(unsafe.Pointer(bp))&0x80 != 0 {
 186702 			n--
 186703 			n = n + sqlite3Fts5GetVarint32(tls, p+uintptr(n), bp)
 186704 		}
 186705 	}
 186706 
 186707 	*(*int32)(unsafe.Pointer(pnSz)) = *(*int32)(unsafe.Pointer(bp)) / 2
 186708 	*(*int32)(unsafe.Pointer(pbDel)) = *(*int32)(unsafe.Pointer(bp)) & 0x0001
 186709 	return n
 186710 }
 186711 
 186712 func fts5SegIterLoadNPos(tls *libc.TLS, p uintptr, pIter uintptr) {
 186713 	bp := tls.Alloc(4)
 186714 	defer tls.Free(4)
 186715 
 186716 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 186717 		var iOff int32 = int32((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset)
 186718 
 186719 		if (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == FTS5_DETAIL_NONE {
 186720 			var iEod int32 = func() int32 {
 186721 				if (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist < (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf {
 186722 					return (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist
 186723 				}
 186724 				return (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf
 186725 			}()
 186726 			(*Fts5SegIter)(unsafe.Pointer(pIter)).FbDel = U8(0)
 186727 			(*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos = 1
 186728 			if iOff < iEod && int32(*(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(iOff)))) == 0 {
 186729 				(*Fts5SegIter)(unsafe.Pointer(pIter)).FbDel = U8(1)
 186730 				iOff++
 186731 				if iOff < iEod && int32(*(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(iOff)))) == 0 {
 186732 					(*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos = 1
 186733 					iOff++
 186734 				} else {
 186735 					(*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos = 0
 186736 				}
 186737 			}
 186738 		} else {
 186739 			{
 186740 				*(*int32)(unsafe.Pointer(bp)) = int32(*(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(libc.PostIncInt32(&iOff, 1)))))
 186741 				if *(*int32)(unsafe.Pointer(bp))&0x80 != 0 {
 186742 					iOff--
 186743 					iOff = iOff + sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp+uintptr(iOff), bp)
 186744 				}
 186745 			}
 186746 
 186747 			(*Fts5SegIter)(unsafe.Pointer(pIter)).FbDel = U8(*(*int32)(unsafe.Pointer(bp)) & 0x0001)
 186748 			(*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos = *(*int32)(unsafe.Pointer(bp)) >> 1
 186749 
 186750 		}
 186751 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(iOff)
 186752 	}
 186753 }
 186754 
 186755 func fts5SegIterLoadRowid(tls *libc.TLS, p uintptr, pIter uintptr) {
 186756 	var a uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp
 186757 	var iOff I64 = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset
 186758 
 186759 	if iOff >= I64((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf) {
 186760 		fts5SegIterNextPage(tls, p, pIter)
 186761 		if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf == uintptr(0) {
 186762 			if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 186763 				(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 186764 			}
 186765 			return
 186766 		}
 186767 		iOff = int64(4)
 186768 		a = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp
 186769 	}
 186770 	iOff = iOff + I64(sqlite3Fts5GetVarint(tls, a+uintptr(iOff), pIter+104))
 186771 	(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = iOff
 186772 }
 186773 
 186774 func fts5SegIterLoadTerm(tls *libc.TLS, p uintptr, pIter uintptr, nKeep int32) {
 186775 	bp := tls.Alloc(8)
 186776 	defer tls.Free(8)
 186777 
 186778 	var a uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp
 186779 	var iOff I64 = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset
 186780 
 186781 	iOff = iOff + I64(sqlite3Fts5GetVarint32(tls, a+uintptr(iOff), bp))
 186782 	if iOff+I64(*(*int32)(unsafe.Pointer(bp))) > I64((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf) || nKeep > (*Fts5SegIter)(unsafe.Pointer(pIter)).Fterm.Fn || *(*int32)(unsafe.Pointer(bp)) == 0 {
 186783 		(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 186784 		return
 186785 	}
 186786 	(*Fts5SegIter)(unsafe.Pointer(pIter)).Fterm.Fn = nKeep
 186787 	sqlite3Fts5BufferAppendBlob(tls, p+52, pIter+88, uint32(*(*int32)(unsafe.Pointer(bp))), a+uintptr(iOff))
 186788 
 186789 	iOff = iOff + I64(*(*int32)(unsafe.Pointer(bp)))
 186790 	(*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafOffset = int32(iOff)
 186791 	(*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno
 186792 	(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = iOff
 186793 
 186794 	if (*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff >= (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn {
 186795 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn + 1
 186796 	} else {
 186797 		*(*int32)(unsafe.Pointer(pIter + 56)) += sqlite3Fts5GetVarint32(tls, a+uintptr((*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff), bp+4)
 186798 		*(*int32)(unsafe.Pointer(pIter + 60)) += *(*int32)(unsafe.Pointer(bp + 4))
 186799 	}
 186800 
 186801 	fts5SegIterLoadRowid(tls, p, pIter)
 186802 }
 186803 
 186804 func fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) {
 186805 	if (*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags&FTS5_SEGITER_REVERSE != 0 {
 186806 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FxNext = *(*uintptr)(unsafe.Pointer(&struct {
 186807 			f func(*libc.TLS, uintptr, uintptr, uintptr)
 186808 		}{fts5SegIterNext_Reverse}))
 186809 	} else if (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == FTS5_DETAIL_NONE {
 186810 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FxNext = *(*uintptr)(unsafe.Pointer(&struct {
 186811 			f func(*libc.TLS, uintptr, uintptr, uintptr)
 186812 		}{fts5SegIterNext_None}))
 186813 	} else {
 186814 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FxNext = *(*uintptr)(unsafe.Pointer(&struct {
 186815 			f func(*libc.TLS, uintptr, uintptr, uintptr)
 186816 		}{fts5SegIterNext}))
 186817 	}
 186818 }
 186819 
 186820 func fts5SegIterInit(tls *libc.TLS, p uintptr, pSeg uintptr, pIter uintptr) {
 186821 	if (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 {
 186822 		return
 186823 	}
 186824 
 186825 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 186826 		libc.Xmemset(tls, pIter, 0, uint64(unsafe.Sizeof(Fts5SegIter{})))
 186827 		fts5SegIterSetNext(tls, p, pIter)
 186828 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg = pSeg
 186829 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno = (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst - 1
 186830 		fts5SegIterNextPage(tls, p, pIter)
 186831 	}
 186832 
 186833 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 186834 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int64(4)
 186835 
 186836 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf + 1
 186837 		fts5SegIterLoadTerm(tls, p, pIter, 0)
 186838 		fts5SegIterLoadNPos(tls, p, pIter)
 186839 	}
 186840 }
 186841 
 186842 func fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) {
 186843 	bp := tls.Alloc(16)
 186844 	defer tls.Free(16)
 186845 
 186846 	var eDetail int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail
 186847 	var n int32 = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf
 186848 	var i int32 = int32((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset)
 186849 	var a uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp
 186850 	var iRowidOffset int32 = 0
 186851 
 186852 	if n > (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist {
 186853 		n = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist
 186854 	}
 186855 
 186856 	for 1 != 0 {
 186857 		*(*U64)(unsafe.Pointer(bp + 8)) = uint64(0)
 186858 
 186859 		if eDetail == FTS5_DETAIL_NONE {
 186860 			if i < n && int32(*(*U8)(unsafe.Pointer(a + uintptr(i)))) == 0 {
 186861 				i++
 186862 				if i < n && int32(*(*U8)(unsafe.Pointer(a + uintptr(i)))) == 0 {
 186863 					i++
 186864 				}
 186865 			}
 186866 		} else {
 186867 			i = i + fts5GetPoslistSize(tls, a+uintptr(i), bp, bp+4)
 186868 			i = i + *(*int32)(unsafe.Pointer(bp))
 186869 		}
 186870 		if i >= n {
 186871 			break
 186872 		}
 186873 		i = i + int32(sqlite3Fts5GetVarint(tls, a+uintptr(i), bp+8))
 186874 		*(*I64)(unsafe.Pointer(pIter + 104)) += I64(*(*U64)(unsafe.Pointer(bp + 8)))
 186875 
 186876 		if iRowidOffset >= (*Fts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset {
 186877 			var nNew int32 = (*Fts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset + 8
 186878 			var aNew uintptr = Xsqlite3_realloc64(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, uint64(nNew)*uint64(unsafe.Sizeof(int32(0))))
 186879 			if aNew == uintptr(0) {
 186880 				(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
 186881 				break
 186882 			}
 186883 			(*Fts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset = aNew
 186884 			(*Fts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset = nNew
 186885 		}
 186886 
 186887 		*(*int32)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset + uintptr(libc.PostIncInt32(&iRowidOffset, 1))*4)) = int32((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset)
 186888 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(i)
 186889 	}
 186890 	(*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowidOffset = iRowidOffset
 186891 	fts5SegIterLoadNPos(tls, p, pIter)
 186892 }
 186893 
 186894 func fts5SegIterReverseNewPage(tls *libc.TLS, p uintptr, pIter uintptr) {
 186895 	fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)
 186896 	(*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = uintptr(0)
 186897 	for (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno > (*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno {
 186898 		var pNew uintptr
 186899 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno--
 186900 		pNew = fts5DataRead(tls, p, I64((*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)+int64(0)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B)+int64(0)<<FTS5_DATA_PAGE_B+I64((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno))
 186901 		if pNew != 0 {
 186902 			if (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno == (*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno {
 186903 				if (*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafOffset < (*Fts5Data)(unsafe.Pointer(pNew)).FszLeaf {
 186904 					(*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = pNew
 186905 					(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64((*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafOffset)
 186906 				}
 186907 			} else {
 186908 				var iRowidOff int32
 186909 				iRowidOff = int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pNew)).Fp))
 186910 				if iRowidOff != 0 {
 186911 					if iRowidOff >= (*Fts5Data)(unsafe.Pointer(pNew)).FszLeaf {
 186912 						(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 186913 					} else {
 186914 						(*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = pNew
 186915 						(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(iRowidOff)
 186916 					}
 186917 				}
 186918 			}
 186919 
 186920 			if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf != 0 {
 186921 				var a uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset)
 186922 				*(*I64)(unsafe.Pointer(pIter + 32)) += I64(sqlite3Fts5GetVarint(tls, a, pIter+104))
 186923 				break
 186924 			} else {
 186925 				fts5DataRelease(tls, pNew)
 186926 			}
 186927 		}
 186928 	}
 186929 
 186930 	if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf != 0 {
 186931 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn + 1
 186932 		fts5SegIterReverseInitPage(tls, p, pIter)
 186933 	}
 186934 }
 186935 
 186936 func fts5MultiIterIsEmpty(tls *libc.TLS, p uintptr, pIter uintptr) int32 {
 186937 	var pSeg uintptr = pIter + 96 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*120
 186938 	return libc.Bool32((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf != 0 && (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos == 0)
 186939 }
 186940 
 186941 func fts5SegIterNext_Reverse(tls *libc.TLS, p uintptr, pIter uintptr, pbUnused uintptr) {
 186942 	bp := tls.Alloc(8)
 186943 	defer tls.Free(8)
 186944 
 186945 	_ = pbUnused
 186946 
 186947 	if (*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowidOffset > 0 {
 186948 		var a uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp
 186949 		var iOff int32
 186950 
 186951 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowidOffset--
 186952 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(*(*int32)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset + uintptr((*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowidOffset)*4)))
 186953 		fts5SegIterLoadNPos(tls, p, pIter)
 186954 		iOff = int32((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset)
 186955 		if (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail != FTS5_DETAIL_NONE {
 186956 			iOff = iOff + (*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos
 186957 		}
 186958 		sqlite3Fts5GetVarint(tls, a+uintptr(iOff), bp)
 186959 		*(*I64)(unsafe.Pointer(pIter + 104)) -= I64(*(*U64)(unsafe.Pointer(bp)))
 186960 	} else {
 186961 		fts5SegIterReverseNewPage(tls, p, pIter)
 186962 	}
 186963 }
 186964 
 186965 func fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) {
 186966 	bp := tls.Alloc(36)
 186967 	defer tls.Free(36)
 186968 
 186969 	var iOff int32
 186970 
 186971 	iOff = int32((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset)
 186972 
 186973 	if !((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg != 0 && iOff >= (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf) {
 186974 		goto __1
 186975 	}
 186976 	fts5SegIterNextPage(tls, p, pIter)
 186977 	if !((*Fts5Index)(unsafe.Pointer(p)).Frc != 0 || (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf == uintptr(0)) {
 186978 		goto __2
 186979 	}
 186980 	return
 186981 __2:
 186982 	;
 186983 	(*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowid = int64(0)
 186984 	iOff = 4
 186985 __1:
 186986 	;
 186987 	if !(iOff < (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist) {
 186988 		goto __3
 186989 	}
 186990 	iOff = iOff + int32(sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp+uintptr(iOff), bp))
 186991 	(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(iOff)
 186992 	*(*I64)(unsafe.Pointer(pIter + 104)) += *(*I64)(unsafe.Pointer(bp))
 186993 	goto __4
 186994 __3:
 186995 	if !((*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags&FTS5_SEGITER_ONETERM == 0) {
 186996 		goto __5
 186997 	}
 186998 	if !((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg != 0) {
 186999 		goto __7
 187000 	}
 187001 	*(*int32)(unsafe.Pointer(bp + 8)) = 0
 187002 	if !(iOff != fts5LeafFirstTermOff(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)) {
 187003 		goto __9
 187004 	}
 187005 	iOff = iOff + sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp+uintptr(iOff), bp+8)
 187006 __9:
 187007 	;
 187008 	(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(iOff)
 187009 	fts5SegIterLoadTerm(tls, p, pIter, *(*int32)(unsafe.Pointer(bp + 8)))
 187010 	goto __8
 187011 __7:
 187012 	*(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0)
 187013 	*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
 187014 	sqlite3Fts5HashScanNext(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash)
 187015 	sqlite3Fts5HashScanEntry(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash, bp+16, bp+24, bp+32)
 187016 	if !(*(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0)) {
 187017 		goto __10
 187018 	}
 187019 	goto next_none_eof
 187020 __10:
 187021 	;
 187022 	(*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp = *(*uintptr)(unsafe.Pointer(bp + 24))
 187023 	(*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn = *(*int32)(unsafe.Pointer(bp + 32))
 187024 	(*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf = *(*int32)(unsafe.Pointer(bp + 32))
 187025 	(*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = *(*int32)(unsafe.Pointer(bp + 32))
 187026 	sqlite3Fts5BufferSet(tls, p+52, pIter+88, int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))), *(*uintptr)(unsafe.Pointer(bp + 16)))
 187027 	(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(sqlite3Fts5GetVarint(tls, *(*uintptr)(unsafe.Pointer(bp + 24)), pIter+104))
 187028 __8:
 187029 	;
 187030 	if !(pbNewTerm != 0) {
 187031 		goto __11
 187032 	}
 187033 	*(*int32)(unsafe.Pointer(pbNewTerm)) = 1
 187034 __11:
 187035 	;
 187036 	goto __6
 187037 __5:
 187038 	goto next_none_eof
 187039 __6:
 187040 	;
 187041 __4:
 187042 	;
 187043 	fts5SegIterLoadNPos(tls, p, pIter)
 187044 
 187045 	return
 187046 next_none_eof:
 187047 	fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)
 187048 	(*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = uintptr(0)
 187049 }
 187050 
 187051 func fts5SegIterNext(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) {
 187052 	bp := tls.Alloc(44)
 187053 	defer tls.Free(44)
 187054 
 187055 	var pLeaf uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf
 187056 
 187057 	var bNewTerm int32 = 0
 187058 	*(*int32)(unsafe.Pointer(bp)) = 0
 187059 	var a uintptr
 187060 	var n int32
 187061 
 187062 	a = (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp
 187063 	n = (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf
 187064 
 187065 	*(*int32)(unsafe.Pointer(bp + 36)) = int32((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset + I64((*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos))
 187066 
 187067 	if *(*int32)(unsafe.Pointer(bp + 36)) < n {
 187068 		if *(*int32)(unsafe.Pointer(bp + 36)) >= (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist {
 187069 			bNewTerm = 1
 187070 			if *(*int32)(unsafe.Pointer(bp + 36)) != fts5LeafFirstTermOff(tls, pLeaf) {
 187071 				*(*int32)(unsafe.Pointer(bp + 36)) += sqlite3Fts5GetVarint32(tls, a+uintptr(*(*int32)(unsafe.Pointer(bp + 36))), bp)
 187072 			}
 187073 		} else {
 187074 			*(*int32)(unsafe.Pointer(bp + 36)) += int32(sqlite3Fts5GetVarint(tls, a+uintptr(*(*int32)(unsafe.Pointer(bp + 36))), bp+8))
 187075 			*(*I64)(unsafe.Pointer(pIter + 104)) += I64(*(*U64)(unsafe.Pointer(bp + 8)))
 187076 
 187077 		}
 187078 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(*(*int32)(unsafe.Pointer(bp + 36)))
 187079 
 187080 	} else if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg == uintptr(0) {
 187081 		*(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0)
 187082 		*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
 187083 		*(*int32)(unsafe.Pointer(bp + 32)) = 0
 187084 
 187085 		if 0 == (*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags&FTS5_SEGITER_ONETERM {
 187086 			sqlite3Fts5HashScanNext(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash)
 187087 			sqlite3Fts5HashScanEntry(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash, bp+16, bp+24, bp+32)
 187088 		}
 187089 		if *(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0) {
 187090 			fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)
 187091 			(*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = uintptr(0)
 187092 		} else {
 187093 			(*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp = *(*uintptr)(unsafe.Pointer(bp + 24))
 187094 			(*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn = *(*int32)(unsafe.Pointer(bp + 32))
 187095 			(*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf = *(*int32)(unsafe.Pointer(bp + 32))
 187096 			(*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = *(*int32)(unsafe.Pointer(bp + 32)) + 1
 187097 			sqlite3Fts5BufferSet(tls, p+52, pIter+88, int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))),
 187098 				*(*uintptr)(unsafe.Pointer(bp + 16)))
 187099 			(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(sqlite3Fts5GetVarint(tls, *(*uintptr)(unsafe.Pointer(bp + 24)), pIter+104))
 187100 			*(*int32)(unsafe.Pointer(pbNewTerm)) = 1
 187101 		}
 187102 	} else {
 187103 		*(*int32)(unsafe.Pointer(bp + 36)) = 0
 187104 
 187105 		for *(*int32)(unsafe.Pointer(bp + 36)) == 0 {
 187106 			fts5SegIterNextPage(tls, p, pIter)
 187107 			pLeaf = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf
 187108 			if pLeaf == uintptr(0) {
 187109 				break
 187110 			}
 187111 
 187112 			if libc.AssignPtrInt32(bp+36, int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp))) != 0 && *(*int32)(unsafe.Pointer(bp + 36)) < (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
 187113 				*(*int32)(unsafe.Pointer(bp + 36)) += int32(sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(*(*int32)(unsafe.Pointer(bp + 36))), pIter+104))
 187114 				(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(*(*int32)(unsafe.Pointer(bp + 36)))
 187115 
 187116 				if (*Fts5Data)(unsafe.Pointer(pLeaf)).Fnn > (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
 187117 					(*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff = (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf + sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr((*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf), pIter+60)
 187118 				}
 187119 			} else if (*Fts5Data)(unsafe.Pointer(pLeaf)).Fnn > (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
 187120 				(*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff = (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf + sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr((*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf), bp+36)
 187121 				(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(*(*int32)(unsafe.Pointer(bp + 36)))
 187122 				(*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = *(*int32)(unsafe.Pointer(bp + 36))
 187123 				bNewTerm = 1
 187124 			}
 187125 
 187126 			if *(*int32)(unsafe.Pointer(bp + 36)) > (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
 187127 				(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 187128 				return
 187129 			}
 187130 		}
 187131 	}
 187132 
 187133 	if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf != 0 {
 187134 		if bNewTerm != 0 {
 187135 			if (*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags&FTS5_SEGITER_ONETERM != 0 {
 187136 				fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)
 187137 				(*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = uintptr(0)
 187138 			} else {
 187139 				fts5SegIterLoadTerm(tls, p, pIter, *(*int32)(unsafe.Pointer(bp)))
 187140 				fts5SegIterLoadNPos(tls, p, pIter)
 187141 				if pbNewTerm != 0 {
 187142 					*(*int32)(unsafe.Pointer(pbNewTerm)) = 1
 187143 				}
 187144 			}
 187145 		} else {
 187146 			{
 187147 				*(*int32)(unsafe.Pointer(bp + 40)) = int32(*(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(libc.PostIncInt64(&(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset, 1)))))
 187148 				if *(*int32)(unsafe.Pointer(bp + 40))&0x80 != 0 {
 187149 					(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset--
 187150 					*(*I64)(unsafe.Pointer(pIter + 32)) += I64(sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp+uintptr((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset), bp+40))
 187151 				}
 187152 			}
 187153 
 187154 			(*Fts5SegIter)(unsafe.Pointer(pIter)).FbDel = U8(*(*int32)(unsafe.Pointer(bp + 40)) & 0x0001)
 187155 			(*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos = *(*int32)(unsafe.Pointer(bp + 40)) >> 1
 187156 
 187157 		}
 187158 	}
 187159 }
 187160 
 187161 func fts5SegIterReverse(tls *libc.TLS, p uintptr, pIter uintptr) {
 187162 	var pDlidx uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpDlidx
 187163 	var pLast uintptr = uintptr(0)
 187164 	var pgnoLast int32 = 0
 187165 
 187166 	if pDlidx != 0 {
 187167 		var iSegid int32 = (*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FiSegid
 187168 		pgnoLast = fts5DlidxIterPgno(tls, pDlidx)
 187169 		pLast = fts5LeafRead(tls, p, I64(iSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)+int64(0)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B)+int64(0)<<FTS5_DATA_PAGE_B+I64(pgnoLast))
 187170 	} else {
 187171 		var pLeaf uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf
 187172 
 187173 		var iPoslist int32
 187174 		if (*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno == (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno {
 187175 			iPoslist = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafOffset
 187176 		} else {
 187177 			iPoslist = 4
 187178 		}
 187179 		{
 187180 			var iEnd int32 = iPoslist + 9
 187181 			for int32(*(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(libc.PostIncInt32(&iPoslist, 1)))))&0x80 != 0 && iPoslist < iEnd {
 187182 			}
 187183 		}
 187184 
 187185 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(iPoslist)
 187186 
 187187 		if (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist >= (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
 187188 			var pgno int32
 187189 			var pSeg uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg
 187190 
 187191 			for pgno = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno + 1; !((*Fts5Index)(unsafe.Pointer(p)).Frc != 0) && pgno <= (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast; pgno++ {
 187192 				var iAbs I64 = I64((*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B) + int64(0)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B) + int64(0)<<FTS5_DATA_PAGE_B + I64(pgno)
 187193 				var pNew uintptr = fts5LeafRead(tls, p, iAbs)
 187194 				if pNew != 0 {
 187195 					var iRowid int32
 187196 					var bTermless int32
 187197 					iRowid = int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pNew)).Fp))
 187198 					bTermless = libc.Bool32((*Fts5Data)(unsafe.Pointer(pNew)).FszLeaf >= (*Fts5Data)(unsafe.Pointer(pNew)).Fnn)
 187199 					if iRowid != 0 {
 187200 						{
 187201 							var tmp uintptr
 187202 							tmp = pNew
 187203 							pNew = pLast
 187204 							pLast = tmp
 187205 						}
 187206 
 187207 						pgnoLast = pgno
 187208 					}
 187209 					fts5DataRelease(tls, pNew)
 187210 					if bTermless == 0 {
 187211 						break
 187212 					}
 187213 				}
 187214 			}
 187215 		}
 187216 	}
 187217 
 187218 	if pLast != 0 {
 187219 		var iOff int32
 187220 		fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)
 187221 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = pLast
 187222 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno = pgnoLast
 187223 		iOff = int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pLast)).Fp))
 187224 		if iOff > (*Fts5Data)(unsafe.Pointer(pLast)).FszLeaf {
 187225 			(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 187226 			return
 187227 		}
 187228 		iOff = iOff + int32(sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer(pLast)).Fp+uintptr(iOff), pIter+104))
 187229 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(iOff)
 187230 
 187231 		if (*Fts5Data)(unsafe.Pointer(pLast)).FszLeaf >= (*Fts5Data)(unsafe.Pointer(pLast)).Fnn {
 187232 			(*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (*Fts5Data)(unsafe.Pointer(pLast)).Fnn + 1
 187233 		} else {
 187234 			(*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = fts5LeafFirstTermOff(tls, pLast)
 187235 		}
 187236 	}
 187237 
 187238 	fts5SegIterReverseInitPage(tls, p, pIter)
 187239 }
 187240 
 187241 func fts5SegIterLoadDlidx(tls *libc.TLS, p uintptr, pIter uintptr) {
 187242 	var iSeg int32 = (*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FiSegid
 187243 	var bRev int32 = (*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags & FTS5_SEGITER_REVERSE
 187244 	var pLeaf uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf
 187245 
 187246 	if (*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno == (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno &&
 187247 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist < (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
 187248 		return
 187249 	}
 187250 
 187251 	(*Fts5SegIter)(unsafe.Pointer(pIter)).FpDlidx = fts5DlidxIterInit(tls, p, bRev, iSeg, (*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno)
 187252 }
 187253 
 187254 func fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uintptr, nTerm int32) {
 187255 	bp := tls.Alloc(20)
 187256 	defer tls.Free(20)
 187257 
 187258 	var a uintptr
 187259 	var n U32
 187260 	var nMatch U32
 187261 
 187262 	var iPgidx U32
 187263 	var bEndOfPage int32
 187264 	var nCmp U32
 187265 	var i U32
 187266 
 187267 	a = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp
 187268 	n = U32((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn)
 187269 	nMatch = U32(0)
 187270 	*(*U32)(unsafe.Pointer(bp + 8)) = U32(0)
 187271 	*(*U32)(unsafe.Pointer(bp + 4)) = U32(0)
 187272 	bEndOfPage = 0
 187273 
 187274 	iPgidx = U32((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf)
 187275 	iPgidx = iPgidx + U32(sqlite3Fts5GetVarint32(tls, a+uintptr(iPgidx), bp))
 187276 	*(*U32)(unsafe.Pointer(bp + 12)) = *(*U32)(unsafe.Pointer(bp))
 187277 	if !(*(*U32)(unsafe.Pointer(bp + 12)) > n) {
 187278 		goto __1
 187279 	}
 187280 	(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 187281 	return
 187282 __1:
 187283 	;
 187284 __2:
 187285 	if !(1 != 0) {
 187286 		goto __3
 187287 	}
 187288 
 187289 	*(*U32)(unsafe.Pointer(bp + 4)) = U32(*(*U8)(unsafe.Pointer(a + uintptr(libc.PostIncUint32(&*(*U32)(unsafe.Pointer(bp + 12)), 1)))))
 187290 	if !(*(*U32)(unsafe.Pointer(bp + 4))&U32(0x80) != 0) {
 187291 		goto __4
 187292 	}
 187293 	*(*U32)(unsafe.Pointer(bp + 12))--
 187294 	*(*U32)(unsafe.Pointer(bp + 12)) += U32(sqlite3Fts5GetVarint32(tls, a+uintptr(*(*U32)(unsafe.Pointer(bp + 12))), bp+4))
 187295 __4:
 187296 	;
 187297 	if !(*(*U32)(unsafe.Pointer(bp + 8)) < nMatch) {
 187298 		goto __5
 187299 	}
 187300 	goto search_failed
 187301 __5:
 187302 	;
 187303 	if !(*(*U32)(unsafe.Pointer(bp + 8)) == nMatch) {
 187304 		goto __6
 187305 	}
 187306 	nCmp = func() uint32 {
 187307 		if *(*U32)(unsafe.Pointer(bp + 4)) < U32(nTerm)-nMatch {
 187308 			return *(*U32)(unsafe.Pointer(bp + 4))
 187309 		}
 187310 		return U32(nTerm) - nMatch
 187311 	}()
 187312 	i = U32(0)
 187313 __7:
 187314 	if !(i < nCmp) {
 187315 		goto __9
 187316 	}
 187317 	if !(int32(*(*U8)(unsafe.Pointer(a + uintptr(*(*U32)(unsafe.Pointer(bp + 12))+i)))) != int32(*(*U8)(unsafe.Pointer(pTerm + uintptr(nMatch+i))))) {
 187318 		goto __10
 187319 	}
 187320 	goto __9
 187321 __10:
 187322 	;
 187323 	goto __8
 187324 __8:
 187325 	i++
 187326 	goto __7
 187327 	goto __9
 187328 __9:
 187329 	;
 187330 	nMatch = nMatch + i
 187331 
 187332 	if !(U32(nTerm) == nMatch) {
 187333 		goto __11
 187334 	}
 187335 	if !(i == *(*U32)(unsafe.Pointer(bp + 4))) {
 187336 		goto __13
 187337 	}
 187338 	goto search_success
 187339 	goto __14
 187340 __13:
 187341 	goto search_failed
 187342 __14:
 187343 	;
 187344 	goto __12
 187345 __11:
 187346 	if !(i < *(*U32)(unsafe.Pointer(bp + 4)) && int32(*(*U8)(unsafe.Pointer(a + uintptr(*(*U32)(unsafe.Pointer(bp + 12))+i)))) > int32(*(*U8)(unsafe.Pointer(pTerm + uintptr(nMatch))))) {
 187347 		goto __15
 187348 	}
 187349 	goto search_failed
 187350 __15:
 187351 	;
 187352 __12:
 187353 	;
 187354 __6:
 187355 	;
 187356 	if !(iPgidx >= n) {
 187357 		goto __16
 187358 	}
 187359 	bEndOfPage = 1
 187360 	goto __3
 187361 __16:
 187362 	;
 187363 	iPgidx = iPgidx + U32(sqlite3Fts5GetVarint32(tls, a+uintptr(iPgidx), bp+8))
 187364 	*(*U32)(unsafe.Pointer(bp)) += *(*U32)(unsafe.Pointer(bp + 8))
 187365 	*(*U32)(unsafe.Pointer(bp + 12)) = *(*U32)(unsafe.Pointer(bp))
 187366 
 187367 	if !(*(*U32)(unsafe.Pointer(bp + 12)) >= n) {
 187368 		goto __17
 187369 	}
 187370 	(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 187371 	return
 187372 __17:
 187373 	;
 187374 	*(*U32)(unsafe.Pointer(bp + 8)) = U32(*(*U8)(unsafe.Pointer(a + uintptr(libc.PostIncUint32(&*(*U32)(unsafe.Pointer(bp + 12)), 1)))))
 187375 	if !(*(*U32)(unsafe.Pointer(bp + 8))&U32(0x80) != 0) {
 187376 		goto __18
 187377 	}
 187378 	*(*U32)(unsafe.Pointer(bp + 12))--
 187379 	*(*U32)(unsafe.Pointer(bp + 12)) += U32(sqlite3Fts5GetVarint32(tls, a+uintptr(*(*U32)(unsafe.Pointer(bp + 12))), bp+8))
 187380 __18:
 187381 	;
 187382 	goto __2
 187383 __3:
 187384 	;
 187385 search_failed:
 187386 	if !(bGe == 0) {
 187387 		goto __19
 187388 	}
 187389 	fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)
 187390 	(*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = uintptr(0)
 187391 	return
 187392 	goto __20
 187393 __19:
 187394 	if !(bEndOfPage != 0) {
 187395 		goto __21
 187396 	}
 187397 __22:
 187398 	fts5SegIterNextPage(tls, p, pIter)
 187399 	if !((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf == uintptr(0)) {
 187400 		goto __25
 187401 	}
 187402 	return
 187403 __25:
 187404 	;
 187405 	a = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp
 187406 	if !(libc.Bool32((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf >= (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn) == 0) {
 187407 		goto __26
 187408 	}
 187409 	iPgidx = U32((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf)
 187410 	iPgidx = iPgidx + U32(sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp+uintptr(iPgidx), bp+12))
 187411 	if !(*(*U32)(unsafe.Pointer(bp + 12)) < U32(4) || I64(*(*U32)(unsafe.Pointer(bp + 12))) >= I64((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf)) {
 187412 		goto __27
 187413 	}
 187414 	(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 187415 	return
 187416 	goto __28
 187417 __27:
 187418 	*(*U32)(unsafe.Pointer(bp + 8)) = U32(0)
 187419 	*(*U32)(unsafe.Pointer(bp)) = *(*U32)(unsafe.Pointer(bp + 12))
 187420 	n = U32((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn)
 187421 	*(*U32)(unsafe.Pointer(bp + 12)) += U32(sqlite3Fts5GetVarint32(tls, a+uintptr(*(*U32)(unsafe.Pointer(bp + 12))), bp+4))
 187422 	goto __24
 187423 __28:
 187424 	;
 187425 __26:
 187426 	;
 187427 	goto __23
 187428 __23:
 187429 	if 1 != 0 {
 187430 		goto __22
 187431 	}
 187432 	goto __24
 187433 __24:
 187434 	;
 187435 __21:
 187436 	;
 187437 __20:
 187438 	;
 187439 search_success:
 187440 	if !(I64(*(*U32)(unsafe.Pointer(bp + 12)))+I64(*(*U32)(unsafe.Pointer(bp + 4))) > I64(n) || *(*U32)(unsafe.Pointer(bp + 4)) < U32(1)) {
 187441 		goto __29
 187442 	}
 187443 	(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 187444 	return
 187445 __29:
 187446 	;
 187447 	(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(*(*U32)(unsafe.Pointer(bp + 12)) + *(*U32)(unsafe.Pointer(bp + 4)))
 187448 	(*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafOffset = int32((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset)
 187449 	(*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno
 187450 
 187451 	sqlite3Fts5BufferSet(tls, p+52, pIter+88, int32(*(*U32)(unsafe.Pointer(bp + 8))), pTerm)
 187452 	sqlite3Fts5BufferAppendBlob(tls, p+52, pIter+88, *(*U32)(unsafe.Pointer(bp + 4)), a+uintptr(*(*U32)(unsafe.Pointer(bp + 12))))
 187453 
 187454 	if !(iPgidx >= n) {
 187455 		goto __30
 187456 	}
 187457 	(*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn + 1
 187458 	goto __31
 187459 __30:
 187460 	iPgidx = iPgidx + U32(sqlite3Fts5GetVarint32(tls, a+uintptr(iPgidx), bp+16))
 187461 	(*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = int32(*(*U32)(unsafe.Pointer(bp)) + U32(*(*int32)(unsafe.Pointer(bp + 16))))
 187462 __31:
 187463 	;
 187464 	(*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff = int32(iPgidx)
 187465 
 187466 	fts5SegIterLoadRowid(tls, p, pIter)
 187467 	fts5SegIterLoadNPos(tls, p, pIter)
 187468 }
 187469 
 187470 func fts5IdxSelectStmt(tls *libc.TLS, p uintptr) uintptr {
 187471 	bp := tls.Alloc(16)
 187472 	defer tls.Free(16)
 187473 
 187474 	if (*Fts5Index)(unsafe.Pointer(p)).FpIdxSelect == uintptr(0) {
 187475 		var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
 187476 		fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls,
 187477 			ts+36421,
 187478 			libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)))
 187479 	}
 187480 	return (*Fts5Index)(unsafe.Pointer(p)).FpIdxSelect
 187481 }
 187482 
 187483 func fts5SegIterSeekInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, flags int32, pSeg uintptr, pIter uintptr) {
 187484 	var iPg int32 = 1
 187485 	var bGe int32 = flags & FTS5INDEX_QUERY_SCAN
 187486 	var bDlidx int32 = 0
 187487 	var pIdxSelect uintptr = uintptr(0)
 187488 
 187489 	libc.Xmemset(tls, pIter, 0, uint64(unsafe.Sizeof(Fts5SegIter{})))
 187490 	(*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg = pSeg
 187491 
 187492 	pIdxSelect = fts5IdxSelectStmt(tls, p)
 187493 	if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
 187494 		return
 187495 	}
 187496 	Xsqlite3_bind_int(tls, pIdxSelect, 1, (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)
 187497 	Xsqlite3_bind_blob(tls, pIdxSelect, 2, pTerm, nTerm, uintptr(0))
 187498 	if SQLITE_ROW == Xsqlite3_step(tls, pIdxSelect) {
 187499 		var val I64 = I64(Xsqlite3_column_int(tls, pIdxSelect, 0))
 187500 		iPg = int32(val >> 1)
 187501 		bDlidx = int32(val & int64(0x0001))
 187502 	}
 187503 	(*Fts5Index)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, pIdxSelect)
 187504 	Xsqlite3_bind_null(tls, pIdxSelect, 2)
 187505 
 187506 	if iPg < (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst {
 187507 		iPg = (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst
 187508 		bDlidx = 0
 187509 	}
 187510 
 187511 	(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno = iPg - 1
 187512 	fts5SegIterNextPage(tls, p, pIter)
 187513 
 187514 	if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf != 0 {
 187515 		fts5LeafSeek(tls, p, bGe, pIter, pTerm, nTerm)
 187516 	}
 187517 
 187518 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bGe == 0 {
 187519 		*(*int32)(unsafe.Pointer(pIter + 8)) |= FTS5_SEGITER_ONETERM
 187520 		if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf != 0 {
 187521 			if flags&FTS5INDEX_QUERY_DESC != 0 {
 187522 				*(*int32)(unsafe.Pointer(pIter + 8)) |= FTS5_SEGITER_REVERSE
 187523 			}
 187524 			if bDlidx != 0 {
 187525 				fts5SegIterLoadDlidx(tls, p, pIter)
 187526 			}
 187527 			if flags&FTS5INDEX_QUERY_DESC != 0 {
 187528 				fts5SegIterReverse(tls, p, pIter)
 187529 			}
 187530 		}
 187531 	}
 187532 
 187533 	fts5SegIterSetNext(tls, p, pIter)
 187534 
 187535 }
 187536 
 187537 func fts5SegIterHashInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, flags int32, pIter uintptr) {
 187538 	bp := tls.Alloc(32)
 187539 	defer tls.Free(32)
 187540 
 187541 	*(*int32)(unsafe.Pointer(bp + 16)) = 0
 187542 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 187543 	var n int32 = 0
 187544 	*(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0)
 187545 
 187546 	if pTerm == uintptr(0) || flags&FTS5INDEX_QUERY_SCAN != 0 {
 187547 		*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 187548 
 187549 		(*Fts5Index)(unsafe.Pointer(p)).Frc = sqlite3Fts5HashScanInit(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash, pTerm, nTerm)
 187550 		sqlite3Fts5HashScanEntry(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash, bp, bp+8, bp+16)
 187551 		n = func() int32 {
 187552 			if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
 187553 				return int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp))))
 187554 			}
 187555 			return 0
 187556 		}()
 187557 		if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 {
 187558 			*(*uintptr)(unsafe.Pointer(bp + 24)) = fts5IdxMalloc(tls, p, int64(unsafe.Sizeof(Fts5Data{})))
 187559 			if *(*uintptr)(unsafe.Pointer(bp + 24)) != 0 {
 187560 				(*Fts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fp = *(*uintptr)(unsafe.Pointer(bp + 8))
 187561 			}
 187562 		}
 187563 	} else {
 187564 		(*Fts5Index)(unsafe.Pointer(p)).Frc = sqlite3Fts5HashQuery(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash, int32(unsafe.Sizeof(Fts5Data{})),
 187565 			pTerm, nTerm, bp+24, bp+16)
 187566 		if *(*uintptr)(unsafe.Pointer(bp + 24)) != 0 {
 187567 			(*Fts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fp = *(*uintptr)(unsafe.Pointer(bp + 24)) + 1*16
 187568 		}
 187569 		*(*uintptr)(unsafe.Pointer(bp)) = pTerm
 187570 		n = nTerm
 187571 		*(*int32)(unsafe.Pointer(pIter + 8)) |= FTS5_SEGITER_ONETERM
 187572 	}
 187573 
 187574 	if *(*uintptr)(unsafe.Pointer(bp + 24)) != 0 {
 187575 		sqlite3Fts5BufferSet(tls, p+52, pIter+88, n, *(*uintptr)(unsafe.Pointer(bp)))
 187576 		(*Fts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fnn = libc.AssignPtrInt32(*(*uintptr)(unsafe.Pointer(bp + 24))+12, *(*int32)(unsafe.Pointer(bp + 16)))
 187577 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = *(*uintptr)(unsafe.Pointer(bp + 24))
 187578 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fp, pIter+104))
 187579 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (*Fts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fnn
 187580 
 187581 		if flags&FTS5INDEX_QUERY_DESC != 0 {
 187582 			*(*int32)(unsafe.Pointer(pIter + 8)) |= FTS5_SEGITER_REVERSE
 187583 			fts5SegIterReverseInitPage(tls, p, pIter)
 187584 		} else {
 187585 			fts5SegIterLoadNPos(tls, p, pIter)
 187586 		}
 187587 	}
 187588 
 187589 	fts5SegIterSetNext(tls, p, pIter)
 187590 }
 187591 
 187592 func fts5SegIterClear(tls *libc.TLS, pIter uintptr) {
 187593 	sqlite3Fts5BufferFree(tls, pIter+88)
 187594 	fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)
 187595 	fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpNextLeaf)
 187596 	fts5DlidxIterFree(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpDlidx)
 187597 	Xsqlite3_free(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset)
 187598 	libc.Xmemset(tls, pIter, 0, uint64(unsafe.Sizeof(Fts5SegIter{})))
 187599 }
 187600 
 187601 func fts5MultiIterDoCompare(tls *libc.TLS, pIter uintptr, iOut int32) int32 {
 187602 	var i1 int32
 187603 	var i2 int32
 187604 	var iRes int32
 187605 	var p1 uintptr
 187606 	var p2 uintptr
 187607 	var pRes uintptr = (*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr(iOut)*4
 187608 
 187609 	if iOut >= (*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg/2 {
 187610 		i1 = (iOut - (*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg/2) * 2
 187611 		i2 = i1 + 1
 187612 	} else {
 187613 		i1 = int32((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr(iOut*2)*4)).FiFirst)
 187614 		i2 = int32((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr(iOut*2+1)*4)).FiFirst)
 187615 	}
 187616 	p1 = pIter + 96 + uintptr(i1)*120
 187617 	p2 = pIter + 96 + uintptr(i2)*120
 187618 
 187619 	(*Fts5CResult)(unsafe.Pointer(pRes)).FbTermEq = U8(0)
 187620 	if (*Fts5SegIter)(unsafe.Pointer(p1)).FpLeaf == uintptr(0) {
 187621 		iRes = i2
 187622 	} else if (*Fts5SegIter)(unsafe.Pointer(p2)).FpLeaf == uintptr(0) {
 187623 		iRes = i1
 187624 	} else {
 187625 		var res int32 = fts5BufferCompare(tls, p1+88, p2+88)
 187626 		if res == 0 {
 187627 			(*Fts5CResult)(unsafe.Pointer(pRes)).FbTermEq = U8(1)
 187628 			if (*Fts5SegIter)(unsafe.Pointer(p1)).FiRowid == (*Fts5SegIter)(unsafe.Pointer(p2)).FiRowid {
 187629 				(*Fts5SegIter)(unsafe.Pointer(p1)).FbDel = (*Fts5SegIter)(unsafe.Pointer(p2)).FbDel
 187630 				return i2
 187631 			}
 187632 			if libc.Bool32((*Fts5SegIter)(unsafe.Pointer(p1)).FiRowid > (*Fts5SegIter)(unsafe.Pointer(p2)).FiRowid) == (*Fts5Iter)(unsafe.Pointer(pIter)).FbRev {
 187633 				res = -1
 187634 			} else {
 187635 				res = +1
 187636 			}
 187637 		}
 187638 
 187639 		if res < 0 {
 187640 			iRes = i1
 187641 		} else {
 187642 			iRes = i2
 187643 		}
 187644 	}
 187645 
 187646 	(*Fts5CResult)(unsafe.Pointer(pRes)).FiFirst = U16(iRes)
 187647 	return 0
 187648 }
 187649 
 187650 func fts5SegIterGotoPage(tls *libc.TLS, p uintptr, pIter uintptr, iLeafPgno int32) {
 187651 	if iLeafPgno > (*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FpgnoLast {
 187652 		(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 187653 	} else {
 187654 		fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpNextLeaf)
 187655 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FpNextLeaf = uintptr(0)
 187656 		(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno = iLeafPgno - 1
 187657 		fts5SegIterNextPage(tls, p, pIter)
 187658 
 187659 		if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf != uintptr(0) {
 187660 			var iOff int32
 187661 			var a uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp
 187662 			var n int32 = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf
 187663 
 187664 			iOff = int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp))
 187665 			if iOff < 4 || iOff >= n {
 187666 				(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 187667 			} else {
 187668 				iOff = iOff + int32(sqlite3Fts5GetVarint(tls, a+uintptr(iOff), pIter+104))
 187669 				(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(iOff)
 187670 				fts5SegIterLoadNPos(tls, p, pIter)
 187671 			}
 187672 		}
 187673 	}
 187674 }
 187675 
 187676 func fts5SegIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64) {
 187677 	var bRev int32 = (*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags & FTS5_SEGITER_REVERSE
 187678 	var pDlidx uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpDlidx
 187679 	var iLeafPgno int32 = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno
 187680 	var bMove int32 = 1
 187681 
 187682 	if bRev == 0 {
 187683 		for !(fts5DlidxIterEof(tls, p, pDlidx) != 0) && iMatch > fts5DlidxIterRowid(tls, pDlidx) {
 187684 			iLeafPgno = fts5DlidxIterPgno(tls, pDlidx)
 187685 			fts5DlidxIterNext(tls, p, pDlidx)
 187686 		}
 187687 
 187688 		if iLeafPgno > (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno {
 187689 			fts5SegIterGotoPage(tls, p, pIter, iLeafPgno)
 187690 			bMove = 0
 187691 		}
 187692 	} else {
 187693 		for !(fts5DlidxIterEof(tls, p, pDlidx) != 0) && iMatch < fts5DlidxIterRowid(tls, pDlidx) {
 187694 			fts5DlidxIterPrev(tls, p, pDlidx)
 187695 		}
 187696 		iLeafPgno = fts5DlidxIterPgno(tls, pDlidx)
 187697 
 187698 		if iLeafPgno < (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno {
 187699 			(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno = iLeafPgno + 1
 187700 			fts5SegIterReverseNewPage(tls, p, pIter)
 187701 			bMove = 0
 187702 		}
 187703 	}
 187704 
 187705 	for __ccgo := true; __ccgo; __ccgo = (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 187706 		if bMove != 0 && (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 187707 			(*struct {
 187708 				f func(*libc.TLS, uintptr, uintptr, uintptr)
 187709 			})(unsafe.Pointer(&struct{ uintptr }{(*Fts5SegIter)(unsafe.Pointer(pIter)).FxNext})).f(tls, p, pIter, uintptr(0))
 187710 		}
 187711 		if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf == uintptr(0) {
 187712 			break
 187713 		}
 187714 		if bRev == 0 && (*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowid >= iMatch {
 187715 			break
 187716 		}
 187717 		if bRev != 0 && (*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowid <= iMatch {
 187718 			break
 187719 		}
 187720 		bMove = 1
 187721 	}
 187722 }
 187723 
 187724 func fts5MultiIterFree(tls *libc.TLS, pIter uintptr) {
 187725 	if pIter != 0 {
 187726 		var i int32
 187727 		for i = 0; i < (*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg; i++ {
 187728 			fts5SegIterClear(tls, pIter+96+uintptr(i)*120)
 187729 		}
 187730 		sqlite3Fts5BufferFree(tls, pIter+32)
 187731 		Xsqlite3_free(tls, pIter)
 187732 	}
 187733 }
 187734 
 187735 func fts5MultiIterAdvanced(tls *libc.TLS, p uintptr, pIter uintptr, iChanged int32, iMinset int32) {
 187736 	var i int32
 187737 	for i = ((*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg + iChanged) / 2; i >= iMinset && (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK; i = i / 2 {
 187738 		var iEq int32
 187739 		if libc.AssignInt32(&iEq, fts5MultiIterDoCompare(tls, pIter, i)) != 0 {
 187740 			var pSeg uintptr = pIter + 96 + uintptr(iEq)*120
 187741 
 187742 			(*struct {
 187743 				f func(*libc.TLS, uintptr, uintptr, uintptr)
 187744 			})(unsafe.Pointer(&struct{ uintptr }{(*Fts5SegIter)(unsafe.Pointer(pSeg)).FxNext})).f(tls, p, pSeg, uintptr(0))
 187745 			i = (*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg + iEq
 187746 		}
 187747 	}
 187748 }
 187749 
 187750 func fts5MultiIterAdvanceRowid(tls *libc.TLS, pIter uintptr, iChanged int32, ppFirst uintptr) int32 {
 187751 	var pNew uintptr = pIter + 96 + uintptr(iChanged)*120
 187752 
 187753 	if (*Fts5SegIter)(unsafe.Pointer(pNew)).FiRowid == (*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid ||
 187754 		libc.Bool32((*Fts5SegIter)(unsafe.Pointer(pNew)).FiRowid < (*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid) == (*Fts5Iter)(unsafe.Pointer(pIter)).FbRev {
 187755 		var i int32
 187756 		var pOther uintptr = pIter + 96 + uintptr(iChanged^0x0001)*120
 187757 		(*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid = func() int64 {
 187758 			if (*Fts5Iter)(unsafe.Pointer(pIter)).FbRev != 0 {
 187759 				return int64(-1) - (int64(0xffffffff) | int64(0x7fffffff)<<32)
 187760 			}
 187761 			return int64(0xffffffff) | int64(0x7fffffff)<<32
 187762 		}()
 187763 		for i = ((*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg + iChanged) / 2; 1 != 0; i = i / 2 {
 187764 			var pRes uintptr = (*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr(i)*4
 187765 
 187766 			if (*Fts5CResult)(unsafe.Pointer(pRes)).FbTermEq != 0 {
 187767 				if (*Fts5SegIter)(unsafe.Pointer(pNew)).FiRowid == (*Fts5SegIter)(unsafe.Pointer(pOther)).FiRowid {
 187768 					return 1
 187769 				} else if libc.Bool32((*Fts5SegIter)(unsafe.Pointer(pOther)).FiRowid > (*Fts5SegIter)(unsafe.Pointer(pNew)).FiRowid) == (*Fts5Iter)(unsafe.Pointer(pIter)).FbRev {
 187770 					(*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid = (*Fts5SegIter)(unsafe.Pointer(pOther)).FiRowid
 187771 					pNew = pOther
 187772 				} else if libc.Bool32((*Fts5SegIter)(unsafe.Pointer(pOther)).FiRowid > (*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid) == (*Fts5Iter)(unsafe.Pointer(pIter)).FbRev {
 187773 					(*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid = (*Fts5SegIter)(unsafe.Pointer(pOther)).FiRowid
 187774 				}
 187775 			}
 187776 			(*Fts5CResult)(unsafe.Pointer(pRes)).FiFirst = U16(int64((pNew - (pIter + 96)) / 120))
 187777 			if i == 1 {
 187778 				break
 187779 			}
 187780 
 187781 			pOther = pIter + 96 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+uintptr(i^0x0001)*4)).FiFirst)*120
 187782 		}
 187783 	}
 187784 
 187785 	*(*uintptr)(unsafe.Pointer(ppFirst)) = pNew
 187786 	return 0
 187787 }
 187788 
 187789 func fts5MultiIterSetEof(tls *libc.TLS, pIter uintptr) {
 187790 	var pSeg uintptr = pIter + 96 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*120
 187791 	(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FbEof = U8(libc.Bool32((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf == uintptr(0)))
 187792 	(*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid
 187793 }
 187794 
 187795 func fts5MultiIterNext(tls *libc.TLS, p uintptr, pIter uintptr, bFrom int32, iFrom I64) {
 187796 	bp := tls.Alloc(16)
 187797 	defer tls.Free(16)
 187798 
 187799 	var bUseFrom int32 = bFrom
 187800 
 187801 	for (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 187802 		var iFirst int32 = int32((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst + 1*4)).FiFirst)
 187803 		*(*int32)(unsafe.Pointer(bp)) = 0
 187804 		*(*uintptr)(unsafe.Pointer(bp + 8)) = pIter + 96 + uintptr(iFirst)*120
 187805 
 187806 		if bUseFrom != 0 && (*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FpDlidx != 0 {
 187807 			fts5SegIterNextFrom(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8)), iFrom)
 187808 		} else {
 187809 			(*struct {
 187810 				f func(*libc.TLS, uintptr, uintptr, uintptr)
 187811 			})(unsafe.Pointer(&struct{ uintptr }{(*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FxNext})).f(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8)), bp)
 187812 		}
 187813 
 187814 		if (*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FpLeaf == uintptr(0) || *(*int32)(unsafe.Pointer(bp)) != 0 ||
 187815 			fts5MultiIterAdvanceRowid(tls, pIter, iFirst, bp+8) != 0 {
 187816 			fts5MultiIterAdvanced(tls, p, pIter, iFirst, 1)
 187817 			fts5MultiIterSetEof(tls, pIter)
 187818 			*(*uintptr)(unsafe.Pointer(bp + 8)) = pIter + 96 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*120
 187819 			if (*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FpLeaf == uintptr(0) {
 187820 				return
 187821 			}
 187822 		}
 187823 
 187824 		if int32((*Fts5Iter)(unsafe.Pointer(pIter)).FbSkipEmpty) == 0 || (*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FnPos != 0 {
 187825 			(*struct {
 187826 				f func(*libc.TLS, uintptr, uintptr)
 187827 			})(unsafe.Pointer(&struct{ uintptr }{(*Fts5Iter)(unsafe.Pointer(pIter)).FxSetOutputs})).f(tls, pIter, *(*uintptr)(unsafe.Pointer(bp + 8)))
 187828 			return
 187829 		}
 187830 		bUseFrom = 0
 187831 	}
 187832 }
 187833 
 187834 func fts5MultiIterNext2(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) {
 187835 	bp := tls.Alloc(16)
 187836 	defer tls.Free(16)
 187837 
 187838 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 187839 		*(*int32)(unsafe.Pointer(pbNewTerm)) = 0
 187840 		for __ccgo := true; __ccgo; __ccgo = fts5MultiIterIsEmpty(tls, p, pIter) != 0 {
 187841 			var iFirst int32 = int32((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst + 1*4)).FiFirst)
 187842 			*(*uintptr)(unsafe.Pointer(bp + 8)) = pIter + 96 + uintptr(iFirst)*120
 187843 			*(*int32)(unsafe.Pointer(bp)) = 0
 187844 
 187845 			(*struct {
 187846 				f func(*libc.TLS, uintptr, uintptr, uintptr)
 187847 			})(unsafe.Pointer(&struct{ uintptr }{(*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FxNext})).f(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8)), bp)
 187848 			if (*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FpLeaf == uintptr(0) || *(*int32)(unsafe.Pointer(bp)) != 0 ||
 187849 				fts5MultiIterAdvanceRowid(tls, pIter, iFirst, bp+8) != 0 {
 187850 				fts5MultiIterAdvanced(tls, p, pIter, iFirst, 1)
 187851 				fts5MultiIterSetEof(tls, pIter)
 187852 				*(*int32)(unsafe.Pointer(pbNewTerm)) = 1
 187853 			}
 187854 
 187855 		}
 187856 	}
 187857 }
 187858 
 187859 func fts5IterSetOutputs_Noop(tls *libc.TLS, pUnused1 uintptr, pUnused2 uintptr) {
 187860 	_ = pUnused1
 187861 	_ = pUnused2
 187862 }
 187863 
 187864 func fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) uintptr {
 187865 	var pNew uintptr
 187866 	var nSlot int32
 187867 
 187868 	for nSlot = 2; nSlot < nSeg; nSlot = nSlot * 2 {
 187869 	}
 187870 	pNew = fts5IdxMalloc(tls, p,
 187871 		int64(uint64(unsafe.Sizeof(Fts5Iter{}))+uint64(unsafe.Sizeof(Fts5SegIter{}))*uint64(nSlot-1)+uint64(unsafe.Sizeof(Fts5CResult{}))*uint64(nSlot)))
 187872 	if pNew != 0 {
 187873 		(*Fts5Iter)(unsafe.Pointer(pNew)).FnSeg = nSlot
 187874 		(*Fts5Iter)(unsafe.Pointer(pNew)).FaFirst = pNew + 96 + uintptr(nSlot)*120
 187875 		(*Fts5Iter)(unsafe.Pointer(pNew)).FpIndex = p
 187876 		(*Fts5Iter)(unsafe.Pointer(pNew)).FxSetOutputs = *(*uintptr)(unsafe.Pointer(&struct {
 187877 			f func(*libc.TLS, uintptr, uintptr)
 187878 		}{fts5IterSetOutputs_Noop}))
 187879 	}
 187880 	return pNew
 187881 }
 187882 
 187883 func fts5PoslistCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) {
 187884 	_ = pUnused
 187885 
 187886 	if nChunk > 0 {
 187887 		{
 187888 			libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer(pContext)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pContext)).Fn), pChunk, uint64(nChunk))
 187889 			*(*int32)(unsafe.Pointer(pContext + 8)) += nChunk
 187890 		}
 187891 
 187892 	}
 187893 }
 187894 
 187895 type PoslistCallbackCtx1 = struct {
 187896 	FpBuf        uintptr
 187897 	FpColset     uintptr
 187898 	FeState      int32
 187899 	F__ccgo_pad1 [4]byte
 187900 }
 187901 
 187902 type PoslistCallbackCtx = PoslistCallbackCtx1
 187903 
 187904 type PoslistOffsetsCtx1 = struct {
 187905 	FpBuf    uintptr
 187906 	FpColset uintptr
 187907 	FiRead   int32
 187908 	FiWrite  int32
 187909 }
 187910 
 187911 type PoslistOffsetsCtx = PoslistOffsetsCtx1
 187912 
 187913 func fts5IndexColsetTest(tls *libc.TLS, pColset uintptr, iCol int32) int32 {
 187914 	var i int32
 187915 	for i = 0; i < (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol; i++ {
 187916 		if *(*int32)(unsafe.Pointer(pColset + 4 + uintptr(i)*4)) == iCol {
 187917 			return 1
 187918 		}
 187919 	}
 187920 	return 0
 187921 }
 187922 
 187923 func fts5PoslistOffsetsCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) {
 187924 	bp := tls.Alloc(4)
 187925 	defer tls.Free(4)
 187926 
 187927 	var pCtx uintptr = pContext
 187928 	_ = pUnused
 187929 
 187930 	if nChunk > 0 {
 187931 		var i int32 = 0
 187932 		for i < nChunk {
 187933 			i = i + sqlite3Fts5GetVarint32(tls, pChunk+uintptr(i), bp)
 187934 			*(*int32)(unsafe.Pointer(bp)) += (*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FiRead - 2
 187935 			(*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FiRead = *(*int32)(unsafe.Pointer(bp))
 187936 			if fts5IndexColsetTest(tls, (*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FpColset, *(*int32)(unsafe.Pointer(bp))) != 0 {
 187937 				{
 187938 					*(*int32)(unsafe.Pointer((*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FpBuf + 8)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer((*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer((*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fn), uint64(*(*int32)(unsafe.Pointer(bp))+2-(*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FiWrite))
 187939 				}
 187940 
 187941 				(*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FiWrite = *(*int32)(unsafe.Pointer(bp))
 187942 			}
 187943 		}
 187944 	}
 187945 }
 187946 
 187947 func fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) {
 187948 	bp := tls.Alloc(8)
 187949 	defer tls.Free(8)
 187950 
 187951 	var pCtx uintptr = pContext
 187952 	_ = pUnused
 187953 
 187954 	if nChunk > 0 {
 187955 		var i int32 = 0
 187956 		var iStart int32 = 0
 187957 
 187958 		if (*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState == 2 {
 187959 			{
 187960 				*(*int32)(unsafe.Pointer(bp)) = int32(*(*U8)(unsafe.Pointer(pChunk + uintptr(libc.PostIncInt32(&i, 1)))))
 187961 				if *(*int32)(unsafe.Pointer(bp))&0x80 != 0 {
 187962 					i--
 187963 					i = i + sqlite3Fts5GetVarint32(tls, pChunk+uintptr(i), bp)
 187964 				}
 187965 			}
 187966 
 187967 			if fts5IndexColsetTest(tls, (*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpColset, *(*int32)(unsafe.Pointer(bp))) != 0 {
 187968 				(*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState = 1
 187969 				{
 187970 					*(*int32)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf + 8)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fn), uint64(1))
 187971 				}
 187972 
 187973 			} else {
 187974 				(*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState = 0
 187975 			}
 187976 		}
 187977 
 187978 		for __ccgo := true; __ccgo; __ccgo = i < nChunk {
 187979 			for i < nChunk && int32(*(*U8)(unsafe.Pointer(pChunk + uintptr(i)))) != 0x01 {
 187980 				for int32(*(*U8)(unsafe.Pointer(pChunk + uintptr(i))))&0x80 != 0 {
 187981 					i++
 187982 				}
 187983 				i++
 187984 			}
 187985 			if (*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState != 0 {
 187986 				{
 187987 					libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fn), pChunk+uintptr(iStart), uint64(i-iStart))
 187988 					*(*int32)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf + 8)) += i - iStart
 187989 				}
 187990 
 187991 			}
 187992 			if i < nChunk {
 187993 				iStart = i
 187994 				i++
 187995 				if i >= nChunk {
 187996 					(*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState = 2
 187997 				} else {
 187998 					{
 187999 						*(*int32)(unsafe.Pointer(bp + 4)) = int32(*(*U8)(unsafe.Pointer(pChunk + uintptr(libc.PostIncInt32(&i, 1)))))
 188000 						if *(*int32)(unsafe.Pointer(bp + 4))&0x80 != 0 {
 188001 							i--
 188002 							i = i + sqlite3Fts5GetVarint32(tls, pChunk+uintptr(i), bp+4)
 188003 						}
 188004 					}
 188005 
 188006 					(*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState = fts5IndexColsetTest(tls, (*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpColset, *(*int32)(unsafe.Pointer(bp + 4)))
 188007 					if (*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState != 0 {
 188008 						{
 188009 							libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf)).Fn), pChunk+uintptr(iStart), uint64(i-iStart))
 188010 							*(*int32)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf + 8)) += i - iStart
 188011 						}
 188012 
 188013 						iStart = i
 188014 					}
 188015 				}
 188016 			}
 188017 		}
 188018 	}
 188019 }
 188020 
 188021 func fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChunk uintptr) {
 188022 	var nRem int32 = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos
 188023 	var pData uintptr = uintptr(0)
 188024 	var pChunk uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset)
 188025 	var nChunk int32 = func() int32 {
 188026 		if I64(nRem) < I64((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf)-(*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset {
 188027 			return nRem
 188028 		}
 188029 		return int32(I64((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf) - (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset)
 188030 	}()
 188031 	var pgno int32 = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafPgno
 188032 	var pgnoSave int32 = 0
 188033 
 188034 	if (*Fts5SegIter)(unsafe.Pointer(pSeg)).Fflags&FTS5_SEGITER_REVERSE == 0 {
 188035 		pgnoSave = pgno + 1
 188036 	}
 188037 
 188038 	for 1 != 0 {
 188039 		(*struct {
 188040 			f func(*libc.TLS, uintptr, uintptr, uintptr, int32)
 188041 		})(unsafe.Pointer(&struct{ uintptr }{xChunk})).f(tls, p, pCtx, pChunk, nChunk)
 188042 		nRem = nRem - nChunk
 188043 		fts5DataRelease(tls, pData)
 188044 		if nRem <= 0 {
 188045 			break
 188046 		} else if (*Fts5SegIter)(unsafe.Pointer(pSeg)).FpSeg == uintptr(0) {
 188047 			(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 188048 			return
 188049 		} else {
 188050 			pgno++
 188051 			pData = fts5LeafRead(tls, p, I64((*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpSeg)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)+int64(0)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B)+int64(0)<<FTS5_DATA_PAGE_B+I64(pgno))
 188052 			if pData == uintptr(0) {
 188053 				break
 188054 			}
 188055 			pChunk = (*Fts5Data)(unsafe.Pointer(pData)).Fp + 4
 188056 			nChunk = func() int32 {
 188057 				if nRem < (*Fts5Data)(unsafe.Pointer(pData)).FszLeaf-4 {
 188058 					return nRem
 188059 				}
 188060 				return (*Fts5Data)(unsafe.Pointer(pData)).FszLeaf - 4
 188061 			}()
 188062 			if pgno == pgnoSave {
 188063 				(*Fts5SegIter)(unsafe.Pointer(pSeg)).FpNextLeaf = pData
 188064 				pData = uintptr(0)
 188065 			}
 188066 		}
 188067 	}
 188068 }
 188069 
 188070 func fts5SegiterPoslist(tls *libc.TLS, p uintptr, pSeg uintptr, pColset uintptr, pBuf uintptr) {
 188071 	bp := tls.Alloc(48)
 188072 	defer tls.Free(48)
 188073 
 188074 	if 0 == func() int32 {
 188075 		if U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)+U32((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos+FTS5_DATA_ZERO_PADDING) <= U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) {
 188076 			return 0
 188077 		}
 188078 		return sqlite3Fts5BufferSize(tls, p+52, pBuf, uint32((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos+FTS5_DATA_ZERO_PADDING+(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn))
 188079 	}() {
 188080 		libc.Xmemset(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn+(*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos), 0, uint64(FTS5_DATA_ZERO_PADDING))
 188081 		if pColset == uintptr(0) {
 188082 			fts5ChunkIterate(tls, p, pSeg, pBuf, *(*uintptr)(unsafe.Pointer(&struct {
 188083 				f func(*libc.TLS, uintptr, uintptr, uintptr, int32)
 188084 			}{fts5PoslistCallback})))
 188085 		} else {
 188086 			if (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == FTS5_DETAIL_FULL {
 188087 				(*PoslistCallbackCtx)(unsafe.Pointer(bp)).FpBuf = pBuf
 188088 				(*PoslistCallbackCtx)(unsafe.Pointer(bp)).FpColset = pColset
 188089 				(*PoslistCallbackCtx)(unsafe.Pointer(bp)).FeState = fts5IndexColsetTest(tls, pColset, 0)
 188090 
 188091 				fts5ChunkIterate(tls, p, pSeg, bp, *(*uintptr)(unsafe.Pointer(&struct {
 188092 					f func(*libc.TLS, uintptr, uintptr, uintptr, int32)
 188093 				}{fts5PoslistFilterCallback})))
 188094 			} else {
 188095 				libc.Xmemset(tls, bp+24, 0, uint64(unsafe.Sizeof(PoslistOffsetsCtx{})))
 188096 				(*PoslistOffsetsCtx)(unsafe.Pointer(bp + 24)).FpBuf = pBuf
 188097 				(*PoslistOffsetsCtx)(unsafe.Pointer(bp + 24)).FpColset = pColset
 188098 				fts5ChunkIterate(tls, p, pSeg, bp+24, *(*uintptr)(unsafe.Pointer(&struct {
 188099 					f func(*libc.TLS, uintptr, uintptr, uintptr, int32)
 188100 				}{fts5PoslistOffsetsCallback})))
 188101 			}
 188102 		}
 188103 	}
 188104 }
 188105 
 188106 func fts5IndexExtractColset(tls *libc.TLS, pRc uintptr, pColset uintptr, pPos uintptr, nPos int32, pIter uintptr) {
 188107 	bp := tls.Alloc(4)
 188108 	defer tls.Free(4)
 188109 
 188110 	if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
 188111 		var p uintptr = pPos
 188112 		var aCopy uintptr = p
 188113 		var pEnd uintptr = p + uintptr(nPos)
 188114 		var i int32 = 0
 188115 		*(*int32)(unsafe.Pointer(bp)) = 0
 188116 
 188117 		if (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol > 1 && sqlite3Fts5BufferSize(tls, pRc, pIter+32, uint32(nPos)) != 0 {
 188118 			return
 188119 		}
 188120 
 188121 		for 1 != 0 {
 188122 			for *(*int32)(unsafe.Pointer(pColset + 4 + uintptr(i)*4)) < *(*int32)(unsafe.Pointer(bp)) {
 188123 				i++
 188124 				if i == (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol {
 188125 					(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp
 188126 					(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fn
 188127 					return
 188128 				}
 188129 			}
 188130 
 188131 			for p < pEnd && int32(*(*U8)(unsafe.Pointer(p))) != 0x01 {
 188132 				for int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))))&0x80 != 0 {
 188133 				}
 188134 			}
 188135 
 188136 			if *(*int32)(unsafe.Pointer(pColset + 4 + uintptr(i)*4)) == *(*int32)(unsafe.Pointer(bp)) {
 188137 				if (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol == 1 {
 188138 					(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = aCopy
 188139 					(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = int32((int64(p) - int64(aCopy)) / 1)
 188140 					return
 188141 				}
 188142 				{
 188143 					libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer(pIter+32)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pIter+32)).Fn), aCopy, uint64((int64(p)-int64(aCopy))/1))
 188144 					*(*int32)(unsafe.Pointer(pIter + 32 + 8)) += int32((int64(p) - int64(aCopy)) / 1)
 188145 				}
 188146 
 188147 			}
 188148 			if p >= pEnd {
 188149 				(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp
 188150 				(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fn
 188151 				return
 188152 			}
 188153 			aCopy = libc.PostIncUintptr(&p, 1)
 188154 			*(*int32)(unsafe.Pointer(bp)) = int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))))
 188155 			if *(*int32)(unsafe.Pointer(bp))&0x80 != 0 {
 188156 				p--
 188157 				p += uintptr(sqlite3Fts5GetVarint32(tls, p, bp))
 188158 			}
 188159 		}
 188160 	}
 188161 
 188162 }
 188163 
 188164 func fts5IterSetOutputs_None(tls *libc.TLS, pIter uintptr, pSeg uintptr) {
 188165 	(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid
 188166 	(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos
 188167 }
 188168 
 188169 func fts5IterSetOutputs_Nocolset(tls *libc.TLS, pIter uintptr, pSeg uintptr) {
 188170 	(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid
 188171 	(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos
 188172 
 188173 	if (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset+I64((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos) <= I64((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf) {
 188174 		(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset)
 188175 	} else {
 188176 		sqlite3Fts5BufferZero(tls, pIter+32)
 188177 		fts5SegiterPoslist(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pSeg, uintptr(0), pIter+32)
 188178 		(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp
 188179 	}
 188180 }
 188181 
 188182 func fts5IterSetOutputs_ZeroColset(tls *libc.TLS, pIter uintptr, pSeg uintptr) {
 188183 	_ = pSeg
 188184 	(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = 0
 188185 }
 188186 
 188187 func fts5IterSetOutputs_Col(tls *libc.TLS, pIter uintptr, pSeg uintptr) {
 188188 	sqlite3Fts5BufferZero(tls, pIter+32)
 188189 	fts5SegiterPoslist(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pSeg, (*Fts5Iter)(unsafe.Pointer(pIter)).FpColset, pIter+32)
 188190 	(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid
 188191 	(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp
 188192 	(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fn
 188193 }
 188194 
 188195 func fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) {
 188196 	var a uintptr
 188197 	var pEnd uintptr
 188198 	var iPrev int32
 188199 	var aiCol uintptr
 188200 	var aiColEnd uintptr
 188201 	var aOut uintptr
 188202 	var iPrevOut int32
 188203 
 188204 	if !((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset+I64((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos) > I64((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf)) {
 188205 		goto __1
 188206 	}
 188207 	fts5IterSetOutputs_Col(tls, pIter, pSeg)
 188208 	goto __2
 188209 __1:
 188210 	a = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset)
 188211 	pEnd = a + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos)
 188212 	iPrev = 0
 188213 	aiCol = (*Fts5Iter)(unsafe.Pointer(pIter)).FpColset + 4
 188214 	aiColEnd = aiCol + uintptr((*Fts5Colset)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FpColset)).FnCol)*4
 188215 	aOut = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp
 188216 	iPrevOut = 0
 188217 
 188218 	(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid
 188219 
 188220 __3:
 188221 	if !(a < pEnd) {
 188222 		goto __4
 188223 	}
 188224 	iPrev = iPrev + (int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&a, 1)))) - 2)
 188225 __5:
 188226 	if !(*(*int32)(unsafe.Pointer(aiCol)) < iPrev) {
 188227 		goto __6
 188228 	}
 188229 	aiCol += 4
 188230 	if !(aiCol == aiColEnd) {
 188231 		goto __7
 188232 	}
 188233 	goto setoutputs_col_out
 188234 __7:
 188235 	;
 188236 	goto __5
 188237 __6:
 188238 	;
 188239 	if !(*(*int32)(unsafe.Pointer(aiCol)) == iPrev) {
 188240 		goto __8
 188241 	}
 188242 	*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&aOut, 1))) = U8(iPrev - iPrevOut + 2)
 188243 	iPrevOut = iPrev
 188244 __8:
 188245 	;
 188246 	goto __3
 188247 __4:
 188248 	;
 188249 setoutputs_col_out:
 188250 	(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp
 188251 	(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = int32((int64(aOut) - int64((*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp)) / 1)
 188252 __2:
 188253 }
 188254 
 188255 func fts5IterSetOutputs_Full(tls *libc.TLS, pIter uintptr, pSeg uintptr) {
 188256 	var pColset uintptr = (*Fts5Iter)(unsafe.Pointer(pIter)).FpColset
 188257 	(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid
 188258 
 188259 	if (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset+I64((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos) <= I64((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf) {
 188260 		var a uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset)
 188261 		var pRc uintptr = (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex + 52
 188262 		sqlite3Fts5BufferZero(tls, pIter+32)
 188263 		fts5IndexExtractColset(tls, pRc, pColset, a, (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos, pIter)
 188264 	} else {
 188265 		sqlite3Fts5BufferZero(tls, pIter+32)
 188266 		fts5SegiterPoslist(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pSeg, pColset, pIter+32)
 188267 		(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp
 188268 		(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fn
 188269 	}
 188270 }
 188271 
 188272 func fts5IterSetOutputCb(tls *libc.TLS, pRc uintptr, pIter uintptr) {
 188273 	if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
 188274 		var pConfig uintptr = (*Fts5Index)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex)).FpConfig
 188275 		if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_NONE {
 188276 			(*Fts5Iter)(unsafe.Pointer(pIter)).FxSetOutputs = *(*uintptr)(unsafe.Pointer(&struct {
 188277 				f func(*libc.TLS, uintptr, uintptr)
 188278 			}{fts5IterSetOutputs_None}))
 188279 		} else if (*Fts5Iter)(unsafe.Pointer(pIter)).FpColset == uintptr(0) {
 188280 			(*Fts5Iter)(unsafe.Pointer(pIter)).FxSetOutputs = *(*uintptr)(unsafe.Pointer(&struct {
 188281 				f func(*libc.TLS, uintptr, uintptr)
 188282 			}{fts5IterSetOutputs_Nocolset}))
 188283 		} else if (*Fts5Colset)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FpColset)).FnCol == 0 {
 188284 			(*Fts5Iter)(unsafe.Pointer(pIter)).FxSetOutputs = *(*uintptr)(unsafe.Pointer(&struct {
 188285 				f func(*libc.TLS, uintptr, uintptr)
 188286 			}{fts5IterSetOutputs_ZeroColset}))
 188287 		} else if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_FULL {
 188288 			(*Fts5Iter)(unsafe.Pointer(pIter)).FxSetOutputs = *(*uintptr)(unsafe.Pointer(&struct {
 188289 				f func(*libc.TLS, uintptr, uintptr)
 188290 			}{fts5IterSetOutputs_Full}))
 188291 		} else {
 188292 			if (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol <= 100 {
 188293 				(*Fts5Iter)(unsafe.Pointer(pIter)).FxSetOutputs = *(*uintptr)(unsafe.Pointer(&struct {
 188294 					f func(*libc.TLS, uintptr, uintptr)
 188295 				}{fts5IterSetOutputs_Col100}))
 188296 				sqlite3Fts5BufferSize(tls, pRc, pIter+32, uint32((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol))
 188297 			} else {
 188298 				(*Fts5Iter)(unsafe.Pointer(pIter)).FxSetOutputs = *(*uintptr)(unsafe.Pointer(&struct {
 188299 					f func(*libc.TLS, uintptr, uintptr)
 188300 				}{fts5IterSetOutputs_Col}))
 188301 			}
 188302 		}
 188303 	}
 188304 }
 188305 
 188306 func fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, pColset uintptr, pTerm uintptr, nTerm int32, iLevel int32, nSegment int32, ppOut uintptr) {
 188307 	var nSeg int32
 188308 	var iIter int32
 188309 	var iSeg int32
 188310 	var pLvl uintptr
 188311 	var pNew uintptr
 188312 
 188313 	var pIter uintptr
 188314 	var pSeg uintptr
 188315 	var pIter1 uintptr
 188316 	var pEnd uintptr
 188317 	var pSeg1 uintptr
 188318 	var iEq int32
 188319 	var pSeg2 uintptr
 188320 	nSeg = 0
 188321 	iIter = 0
 188322 
 188323 	if !((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) {
 188324 		goto __1
 188325 	}
 188326 	if !(iLevel < 0) {
 188327 		goto __2
 188328 	}
 188329 
 188330 	nSeg = (*Fts5Structure)(unsafe.Pointer(pStruct)).FnSegment
 188331 	nSeg = nSeg + func() int32 {
 188332 		if (*Fts5Index)(unsafe.Pointer(p)).FpHash != 0 {
 188333 			return 1
 188334 		}
 188335 		return 0
 188336 	}()
 188337 	goto __3
 188338 __2:
 188339 	nSeg = func() int32 {
 188340 		if (*Fts5StructureLevel)(unsafe.Pointer(pStruct+24+uintptr(iLevel)*16)).FnSeg < nSegment {
 188341 			return (*Fts5StructureLevel)(unsafe.Pointer(pStruct + 24 + uintptr(iLevel)*16)).FnSeg
 188342 		}
 188343 		return nSegment
 188344 	}()
 188345 __3:
 188346 	;
 188347 __1:
 188348 	;
 188349 	*(*uintptr)(unsafe.Pointer(ppOut)) = libc.AssignUintptr(&pNew, fts5MultiIterAlloc(tls, p, nSeg))
 188350 	if !(pNew == uintptr(0)) {
 188351 		goto __4
 188352 	}
 188353 
 188354 	goto fts5MultiIterNew_post_check
 188355 __4:
 188356 	;
 188357 	(*Fts5Iter)(unsafe.Pointer(pNew)).FbRev = libc.Bool32(0 != flags&FTS5INDEX_QUERY_DESC)
 188358 	(*Fts5Iter)(unsafe.Pointer(pNew)).FbSkipEmpty = U8(libc.Bool32(0 != flags&FTS5INDEX_QUERY_SKIPEMPTY))
 188359 	(*Fts5Iter)(unsafe.Pointer(pNew)).FpColset = pColset
 188360 	if !(flags&FTS5INDEX_QUERY_NOOUTPUT == 0) {
 188361 		goto __5
 188362 	}
 188363 	fts5IterSetOutputCb(tls, p+52, pNew)
 188364 __5:
 188365 	;
 188366 	if !((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) {
 188367 		goto __6
 188368 	}
 188369 	if !(iLevel < 0) {
 188370 		goto __7
 188371 	}
 188372 	pEnd = pStruct + 24 + uintptr((*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel)*16
 188373 	if !((*Fts5Index)(unsafe.Pointer(p)).FpHash != 0) {
 188374 		goto __9
 188375 	}
 188376 
 188377 	pIter = pNew + 96 + uintptr(libc.PostIncInt32(&iIter, 1))*120
 188378 	fts5SegIterHashInit(tls, p, pTerm, nTerm, flags, pIter)
 188379 __9:
 188380 	;
 188381 	pLvl = pStruct + 24
 188382 __10:
 188383 	if !(pLvl < pEnd) {
 188384 		goto __12
 188385 	}
 188386 	iSeg = (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg - 1
 188387 __13:
 188388 	if !(iSeg >= 0) {
 188389 		goto __15
 188390 	}
 188391 	pSeg = (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg + uintptr(iSeg)*12
 188392 	pIter1 = pNew + 96 + uintptr(libc.PostIncInt32(&iIter, 1))*120
 188393 	if !(pTerm == uintptr(0)) {
 188394 		goto __16
 188395 	}
 188396 	fts5SegIterInit(tls, p, pSeg, pIter1)
 188397 	goto __17
 188398 __16:
 188399 	fts5SegIterSeekInit(tls, p, pTerm, nTerm, flags, pSeg, pIter1)
 188400 __17:
 188401 	;
 188402 	goto __14
 188403 __14:
 188404 	iSeg--
 188405 	goto __13
 188406 	goto __15
 188407 __15:
 188408 	;
 188409 	goto __11
 188410 __11:
 188411 	pLvl += 16
 188412 	goto __10
 188413 	goto __12
 188414 __12:
 188415 	;
 188416 	goto __8
 188417 __7:
 188418 	pLvl = pStruct + 24 + uintptr(iLevel)*16
 188419 	iSeg = nSeg - 1
 188420 __18:
 188421 	if !(iSeg >= 0) {
 188422 		goto __20
 188423 	}
 188424 	fts5SegIterInit(tls, p, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(iSeg)*12, pNew+96+uintptr(libc.PostIncInt32(&iIter, 1))*120)
 188425 	goto __19
 188426 __19:
 188427 	iSeg--
 188428 	goto __18
 188429 	goto __20
 188430 __20:
 188431 	;
 188432 __8:
 188433 	;
 188434 __6:
 188435 	;
 188436 	if !((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) {
 188437 		goto __21
 188438 	}
 188439 	iIter = (*Fts5Iter)(unsafe.Pointer(pNew)).FnSeg - 1
 188440 __23:
 188441 	if !(iIter > 0) {
 188442 		goto __25
 188443 	}
 188444 	if !(libc.AssignInt32(&iEq, fts5MultiIterDoCompare(tls, pNew, iIter)) != 0) {
 188445 		goto __26
 188446 	}
 188447 	pSeg1 = pNew + 96 + uintptr(iEq)*120
 188448 	if !((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) {
 188449 		goto __27
 188450 	}
 188451 	(*struct {
 188452 		f func(*libc.TLS, uintptr, uintptr, uintptr)
 188453 	})(unsafe.Pointer(&struct{ uintptr }{(*Fts5SegIter)(unsafe.Pointer(pSeg1)).FxNext})).f(tls, p, pSeg1, uintptr(0))
 188454 __27:
 188455 	;
 188456 	fts5MultiIterAdvanced(tls, p, pNew, iEq, iIter)
 188457 __26:
 188458 	;
 188459 	goto __24
 188460 __24:
 188461 	iIter--
 188462 	goto __23
 188463 	goto __25
 188464 __25:
 188465 	;
 188466 	fts5MultiIterSetEof(tls, pNew)
 188467 
 188468 	if !((*Fts5Iter)(unsafe.Pointer(pNew)).FbSkipEmpty != 0 && fts5MultiIterIsEmpty(tls, p, pNew) != 0) {
 188469 		goto __28
 188470 	}
 188471 	fts5MultiIterNext(tls, p, pNew, 0, int64(0))
 188472 	goto __29
 188473 __28:
 188474 	if !(int32((*Fts5Iter)(unsafe.Pointer(pNew)).Fbase.FbEof) == 0) {
 188475 		goto __30
 188476 	}
 188477 	pSeg2 = pNew + 96 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pNew)).FaFirst+1*4)).FiFirst)*120
 188478 	(*struct {
 188479 		f func(*libc.TLS, uintptr, uintptr)
 188480 	})(unsafe.Pointer(&struct{ uintptr }{(*Fts5Iter)(unsafe.Pointer(pNew)).FxSetOutputs})).f(tls, pNew, pSeg2)
 188481 __30:
 188482 	;
 188483 __29:
 188484 	;
 188485 	goto __22
 188486 __21:
 188487 	fts5MultiIterFree(tls, pNew)
 188488 	*(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0)
 188489 __22:
 188490 	;
 188491 fts5MultiIterNew_post_check:
 188492 	;
 188493 	return
 188494 }
 188495 
 188496 func fts5MultiIterNew2(tls *libc.TLS, p uintptr, pData uintptr, bDesc int32, ppOut uintptr) {
 188497 	var pNew uintptr
 188498 	pNew = fts5MultiIterAlloc(tls, p, 2)
 188499 	if pNew != 0 {
 188500 		var pIter uintptr = pNew + 96 + 1*120
 188501 
 188502 		(*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags = FTS5_SEGITER_ONETERM
 188503 		if (*Fts5Data)(unsafe.Pointer(pData)).FszLeaf > 0 {
 188504 			(*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = pData
 188505 			(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = I64(sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp, pIter+104))
 188506 			(*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (*Fts5Data)(unsafe.Pointer(pData)).Fnn
 188507 			(*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pNew)).FaFirst + 1*4)).FiFirst = U16(1)
 188508 			if bDesc != 0 {
 188509 				(*Fts5Iter)(unsafe.Pointer(pNew)).FbRev = 1
 188510 				*(*int32)(unsafe.Pointer(pIter + 8)) |= FTS5_SEGITER_REVERSE
 188511 				fts5SegIterReverseInitPage(tls, p, pIter)
 188512 			} else {
 188513 				fts5SegIterLoadNPos(tls, p, pIter)
 188514 			}
 188515 			pData = uintptr(0)
 188516 		} else {
 188517 			(*Fts5Iter)(unsafe.Pointer(pNew)).Fbase.FbEof = U8(1)
 188518 		}
 188519 		fts5SegIterSetNext(tls, p, pIter)
 188520 
 188521 		*(*uintptr)(unsafe.Pointer(ppOut)) = pNew
 188522 	}
 188523 
 188524 	fts5DataRelease(tls, pData)
 188525 }
 188526 
 188527 func fts5MultiIterEof(tls *libc.TLS, p uintptr, pIter uintptr) int32 {
 188528 	return libc.Bool32((*Fts5Index)(unsafe.Pointer(p)).Frc != 0 || (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FbEof != 0)
 188529 }
 188530 
 188531 func fts5MultiIterRowid(tls *libc.TLS, pIter uintptr) I64 {
 188532 	return (*Fts5SegIter)(unsafe.Pointer(pIter + 96 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*120)).FiRowid
 188533 }
 188534 
 188535 func fts5MultiIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64) {
 188536 	for 1 != 0 {
 188537 		var iRowid I64
 188538 		fts5MultiIterNext(tls, p, pIter, 1, iMatch)
 188539 		if fts5MultiIterEof(tls, p, pIter) != 0 {
 188540 			break
 188541 		}
 188542 		iRowid = fts5MultiIterRowid(tls, pIter)
 188543 		if (*Fts5Iter)(unsafe.Pointer(pIter)).FbRev == 0 && iRowid >= iMatch {
 188544 			break
 188545 		}
 188546 		if (*Fts5Iter)(unsafe.Pointer(pIter)).FbRev != 0 && iRowid <= iMatch {
 188547 			break
 188548 		}
 188549 	}
 188550 }
 188551 
 188552 func fts5MultiIterTerm(tls *libc.TLS, pIter uintptr, pn uintptr) uintptr {
 188553 	var p uintptr = pIter + 96 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*120
 188554 	*(*int32)(unsafe.Pointer(pn)) = (*Fts5SegIter)(unsafe.Pointer(p)).Fterm.Fn
 188555 	return (*Fts5SegIter)(unsafe.Pointer(p)).Fterm.Fp
 188556 }
 188557 
 188558 func fts5AllocateSegid(tls *libc.TLS, p uintptr, pStruct uintptr) int32 {
 188559 	bp := tls.Alloc(252)
 188560 	defer tls.Free(252)
 188561 
 188562 	var iSegid int32 = 0
 188563 
 188564 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 188565 		if (*Fts5Structure)(unsafe.Pointer(pStruct)).FnSegment >= FTS5_MAX_SEGMENT {
 188566 			(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_FULL
 188567 		} else {
 188568 			var iLvl int32
 188569 			var iSeg int32
 188570 			var i int32
 188571 			var mask U32
 188572 			libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof([63]U32{})))
 188573 			for iLvl = 0; iLvl < (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel; iLvl++ {
 188574 				for iSeg = 0; iSeg < (*Fts5StructureLevel)(unsafe.Pointer(pStruct+24+uintptr(iLvl)*16)).FnSeg; iSeg++ {
 188575 					var iId int32 = (*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pStruct+24+uintptr(iLvl)*16)).FaSeg + uintptr(iSeg)*12)).FiSegid
 188576 					if iId <= FTS5_MAX_SEGMENT && iId > 0 {
 188577 						*(*U32)(unsafe.Pointer(bp + uintptr((iId-1)/32)*4)) |= U32(1) << ((iId - 1) % 32)
 188578 					}
 188579 				}
 188580 			}
 188581 
 188582 			for i = 0; *(*U32)(unsafe.Pointer(bp + uintptr(i)*4)) == 0xFFFFFFFF; i++ {
 188583 			}
 188584 			mask = *(*U32)(unsafe.Pointer(bp + uintptr(i)*4))
 188585 			for iSegid = 0; mask&(U32(1)<<iSegid) != 0; iSegid++ {
 188586 			}
 188587 			iSegid = iSegid + (1 + i*32)
 188588 
 188589 		}
 188590 	}
 188591 
 188592 	return iSegid
 188593 }
 188594 
 188595 func fts5IndexDiscardData(tls *libc.TLS, p uintptr) {
 188596 	if (*Fts5Index)(unsafe.Pointer(p)).FpHash != 0 {
 188597 		sqlite3Fts5HashClear(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash)
 188598 		(*Fts5Index)(unsafe.Pointer(p)).FnPendingData = 0
 188599 	}
 188600 }
 188601 
 188602 func fts5PrefixCompress(tls *libc.TLS, nOld int32, pOld uintptr, pNew uintptr) int32 {
 188603 	var i int32
 188604 	for i = 0; i < nOld; i++ {
 188605 		if int32(*(*U8)(unsafe.Pointer(pOld + uintptr(i)))) != int32(*(*U8)(unsafe.Pointer(pNew + uintptr(i)))) {
 188606 			break
 188607 		}
 188608 	}
 188609 	return i
 188610 }
 188611 
 188612 func fts5WriteDlidxClear(tls *libc.TLS, p uintptr, pWriter uintptr, bFlush int32) {
 188613 	var i int32
 188614 
 188615 	for i = 0; i < (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx; i++ {
 188616 		var pDlidx uintptr = (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx + uintptr(i)*32
 188617 		if (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fbuf.Fn == 0 {
 188618 			break
 188619 		}
 188620 		if bFlush != 0 {
 188621 			fts5DataWrite(tls, p,
 188622 				I64((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)+int64(1)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B)+I64(i)<<FTS5_DATA_PAGE_B+I64((*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fpgno),
 188623 				(*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fbuf.Fp, (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fbuf.Fn)
 188624 		}
 188625 		sqlite3Fts5BufferZero(tls, pDlidx+16)
 188626 		(*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).FbPrevValid = 0
 188627 	}
 188628 }
 188629 
 188630 func fts5WriteDlidxGrow(tls *libc.TLS, p uintptr, pWriter uintptr, nLvl int32) int32 {
 188631 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && nLvl >= (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx {
 188632 		var aDlidx uintptr = Xsqlite3_realloc64(tls,
 188633 			(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(unsafe.Sizeof(Fts5DlidxWriter{}))*uint64(nLvl))
 188634 		if aDlidx == uintptr(0) {
 188635 			(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM
 188636 		} else {
 188637 			var nByte Size_t = uint64(unsafe.Sizeof(Fts5DlidxWriter{})) * uint64(nLvl-(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx)
 188638 			libc.Xmemset(tls, aDlidx+uintptr((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx)*32, 0, nByte)
 188639 			(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx = aDlidx
 188640 			(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx = nLvl
 188641 		}
 188642 	}
 188643 	return (*Fts5Index)(unsafe.Pointer(p)).Frc
 188644 }
 188645 
 188646 func fts5WriteFlushDlidx(tls *libc.TLS, p uintptr, pWriter uintptr) int32 {
 188647 	var bFlag int32 = 0
 188648 
 188649 	if (*Fts5DlidxWriter)(unsafe.Pointer((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx)).Fbuf.Fn > 0 && (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnEmpty >= FTS5_MIN_DLIDX_SIZE {
 188650 		bFlag = 1
 188651 	}
 188652 	fts5WriteDlidxClear(tls, p, pWriter, bFlag)
 188653 	(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnEmpty = 0
 188654 	return bFlag
 188655 }
 188656 
 188657 func fts5WriteFlushBtree(tls *libc.TLS, p uintptr, pWriter uintptr) {
 188658 	var bFlag int32
 188659 
 188660 	if (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiBtPage == 0 {
 188661 		return
 188662 	}
 188663 	bFlag = fts5WriteFlushDlidx(tls, p, pWriter)
 188664 
 188665 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 188666 		var z uintptr = func() uintptr {
 188667 			if (*Fts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fn > 0 {
 188668 				return (*Fts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fp
 188669 			}
 188670 			return ts + 1544
 188671 		}()
 188672 
 188673 		Xsqlite3_bind_blob(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter, 2, z, (*Fts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fn, uintptr(0))
 188674 		Xsqlite3_bind_int64(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter, 3, I64(bFlag)+I64((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiBtPage)<<1)
 188675 		Xsqlite3_step(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter)
 188676 		(*Fts5Index)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter)
 188677 		Xsqlite3_bind_null(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter, 2)
 188678 	}
 188679 	(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiBtPage = 0
 188680 }
 188681 
 188682 func fts5WriteBtreeTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32, pTerm uintptr) {
 188683 	fts5WriteFlushBtree(tls, p, pWriter)
 188684 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 188685 		sqlite3Fts5BufferSet(tls, p+52, pWriter+96, nTerm, pTerm)
 188686 		(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiBtPage = (*Fts5SegWriter)(unsafe.Pointer(pWriter)).Fwriter.Fpgno
 188687 	}
 188688 }
 188689 
 188690 func fts5WriteBtreeNoTerm(tls *libc.TLS, p uintptr, pWriter uintptr) {
 188691 	if (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage != 0 && (*Fts5DlidxWriter)(unsafe.Pointer((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx)).Fbuf.Fn > 0 {
 188692 		var pDlidx uintptr = (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx
 188693 
 188694 		sqlite3Fts5BufferAppendVarint(tls, p+52, pDlidx+16, int64(0))
 188695 	}
 188696 
 188697 	(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnEmpty++
 188698 }
 188699 
 188700 func fts5DlidxExtractFirstRowid(tls *libc.TLS, pBuf uintptr) I64 {
 188701 	bp := tls.Alloc(8)
 188702 	defer tls.Free(8)
 188703 
 188704 	var iOff int32
 188705 
 188706 	iOff = 1 + int32(sqlite3Fts5GetVarint(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+1, bp))
 188707 	sqlite3Fts5GetVarint(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr(iOff), bp)
 188708 	return *(*I64)(unsafe.Pointer(bp))
 188709 }
 188710 
 188711 func fts5WriteDlidxAppend(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64) {
 188712 	var i int32
 188713 	var bDone int32 = 0
 188714 
 188715 	for i = 0; (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bDone == 0; i++ {
 188716 		var iVal I64
 188717 		var pDlidx uintptr = (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx + uintptr(i)*32
 188718 
 188719 		if (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fbuf.Fn >= (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz {
 188720 			*(*U8)(unsafe.Pointer((*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fbuf.Fp)) = U8(0x01)
 188721 			fts5DataWrite(tls, p,
 188722 				I64((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)+int64(1)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B)+I64(i)<<FTS5_DATA_PAGE_B+I64((*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fpgno),
 188723 				(*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fbuf.Fp, (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fbuf.Fn)
 188724 			fts5WriteDlidxGrow(tls, p, pWriter, i+2)
 188725 			pDlidx = (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx + uintptr(i)*32
 188726 			if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx+1*32)).Fbuf.Fn == 0 {
 188727 				var iFirst I64 = fts5DlidxExtractFirstRowid(tls, pDlidx+16)
 188728 
 188729 				(*Fts5DlidxWriter)(unsafe.Pointer(pDlidx + 1*32)).Fpgno = (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fpgno
 188730 				sqlite3Fts5BufferAppendVarint(tls, p+52, pDlidx+1*32+16, int64(0))
 188731 				sqlite3Fts5BufferAppendVarint(tls, p+52, pDlidx+1*32+16, int64((*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fpgno))
 188732 				sqlite3Fts5BufferAppendVarint(tls, p+52, pDlidx+1*32+16, iFirst)
 188733 				(*Fts5DlidxWriter)(unsafe.Pointer(pDlidx + 1*32)).FbPrevValid = 1
 188734 				(*Fts5DlidxWriter)(unsafe.Pointer(pDlidx + 1*32)).FiPrev = iFirst
 188735 			}
 188736 
 188737 			sqlite3Fts5BufferZero(tls, pDlidx+16)
 188738 			(*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).FbPrevValid = 0
 188739 			(*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fpgno++
 188740 		} else {
 188741 			bDone = 1
 188742 		}
 188743 
 188744 		if (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).FbPrevValid != 0 {
 188745 			iVal = iRowid - (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).FiPrev
 188746 		} else {
 188747 			var iPgno I64 = func() int64 {
 188748 				if i == 0 {
 188749 					return int64((*Fts5SegWriter)(unsafe.Pointer(pWriter)).Fwriter.Fpgno)
 188750 				}
 188751 				return int64((*Fts5DlidxWriter)(unsafe.Pointer(pDlidx + libc.UintptrFromInt32(-1)*32)).Fpgno)
 188752 			}()
 188753 
 188754 			sqlite3Fts5BufferAppendVarint(tls, p+52, pDlidx+16, libc.BoolInt64(!(bDone != 0)))
 188755 			sqlite3Fts5BufferAppendVarint(tls, p+52, pDlidx+16, iPgno)
 188756 			iVal = iRowid
 188757 		}
 188758 
 188759 		sqlite3Fts5BufferAppendVarint(tls, p+52, pDlidx+16, iVal)
 188760 		(*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).FbPrevValid = 1
 188761 		(*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).FiPrev = iRowid
 188762 	}
 188763 }
 188764 
 188765 func fts5WriteFlushLeaf(tls *libc.TLS, p uintptr, pWriter uintptr) {
 188766 	var pPage uintptr = pWriter + 8
 188767 	var iRowid I64
 188768 
 188769 	fts5PutU16(tls, (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fp+2, U16((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn))
 188770 
 188771 	if (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstTermInPage != 0 {
 188772 		fts5WriteBtreeNoTerm(tls, p, pWriter)
 188773 	} else {
 188774 		sqlite3Fts5BufferAppendBlob(tls, p+52, pPage+8, uint32((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fn), (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fp)
 188775 	}
 188776 
 188777 	iRowid = I64((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B) + int64(0)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B) + int64(0)<<FTS5_DATA_PAGE_B + I64((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgno)
 188778 	fts5DataWrite(tls, p, iRowid, (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fp, (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn)
 188779 
 188780 	sqlite3Fts5BufferZero(tls, pPage+8)
 188781 	sqlite3Fts5BufferZero(tls, pPage+24)
 188782 	sqlite3Fts5BufferAppendBlob(tls, p+52, pPage+8, uint32(4), uintptr(unsafe.Pointer(&zero)))
 188783 	(*Fts5PageWriter)(unsafe.Pointer(pPage)).FiPrevPgidx = 0
 188784 	(*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgno++
 188785 
 188786 	(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnLeafWritten++
 188787 
 188788 	(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstTermInPage = U8(1)
 188789 	(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage = U8(1)
 188790 }
 188791 
 188792 var zero = [4]U8{U8(0x00), U8(0x00), U8(0x00), U8(0x00)}
 188793 
 188794 func fts5WriteAppendTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32, pTerm uintptr) {
 188795 	var nPrefix int32
 188796 	var pPage uintptr = pWriter + 8
 188797 	var pPgidx uintptr = pWriter + 8 + 24
 188798 	var nMin int32 = func() int32 {
 188799 		if (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fterm.Fn < nTerm {
 188800 			return (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fterm.Fn
 188801 		}
 188802 		return nTerm
 188803 	}()
 188804 
 188805 	if (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn+(*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn+nTerm+2 >= (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz {
 188806 		if (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn > 4 {
 188807 			fts5WriteFlushLeaf(tls, p, pWriter)
 188808 			if (*Fts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK {
 188809 				return
 188810 			}
 188811 		}
 188812 		if !(U32((*Fts5Buffer)(unsafe.Pointer(pPage+8)).Fn)+U32(nTerm+FTS5_DATA_PADDING) <= U32((*Fts5Buffer)(unsafe.Pointer(pPage+8)).FnSpace)) {
 188813 			sqlite3Fts5BufferSize(tls, p+52, pPage+8, uint32(nTerm+FTS5_DATA_PADDING+(*Fts5Buffer)(unsafe.Pointer(pPage+8)).Fn))
 188814 		}
 188815 	}
 188816 
 188817 	*(*int32)(unsafe.Pointer(pPgidx + 8)) += sqlite3Fts5PutVarint(tls,
 188818 		(*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn), uint64((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn-(*Fts5PageWriter)(unsafe.Pointer(pPage)).FiPrevPgidx))
 188819 	(*Fts5PageWriter)(unsafe.Pointer(pPage)).FiPrevPgidx = (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn
 188820 
 188821 	if (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstTermInPage != 0 {
 188822 		nPrefix = 0
 188823 		if (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgno != 1 {
 188824 			var n int32 = nTerm
 188825 			if (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fterm.Fn != 0 {
 188826 				n = 1 + fts5PrefixCompress(tls, nMin, (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fterm.Fp, pTerm)
 188827 			}
 188828 			fts5WriteBtreeTerm(tls, p, pWriter, n, pTerm)
 188829 			if (*Fts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK {
 188830 				return
 188831 			}
 188832 			pPage = pWriter + 8
 188833 		}
 188834 	} else {
 188835 		nPrefix = fts5PrefixCompress(tls, nMin, (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fterm.Fp, pTerm)
 188836 		sqlite3Fts5BufferAppendVarint(tls, p+52, pPage+8, I64(nPrefix))
 188837 	}
 188838 
 188839 	sqlite3Fts5BufferAppendVarint(tls, p+52, pPage+8, I64(nTerm)-I64(nPrefix))
 188840 	sqlite3Fts5BufferAppendBlob(tls, p+52, pPage+8, uint32(nTerm-nPrefix), pTerm+uintptr(nPrefix))
 188841 
 188842 	sqlite3Fts5BufferSet(tls, p+52, pPage+40, nTerm, pTerm)
 188843 	(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstTermInPage = U8(0)
 188844 
 188845 	(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage = U8(0)
 188846 	(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInDoclist = U8(1)
 188847 
 188848 	(*Fts5DlidxWriter)(unsafe.Pointer((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx)).Fpgno = (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgno
 188849 }
 188850 
 188851 func fts5WriteAppendRowid(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64) {
 188852 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 188853 		var pPage uintptr = pWriter + 8
 188854 
 188855 		if (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn+(*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fn >= (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz {
 188856 			fts5WriteFlushLeaf(tls, p, pWriter)
 188857 		}
 188858 
 188859 		if (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage != 0 {
 188860 			fts5PutU16(tls, (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fp, U16((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn))
 188861 			fts5WriteDlidxAppend(tls, p, pWriter, iRowid)
 188862 		}
 188863 
 188864 		if (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInDoclist != 0 || (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage != 0 {
 188865 			sqlite3Fts5BufferAppendVarint(tls, p+52, pPage+8, iRowid)
 188866 		} else {
 188867 			sqlite3Fts5BufferAppendVarint(tls, p+52, pPage+8, int64(U64(I64(U64(iRowid)))-U64((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiPrevRowid)))
 188868 		}
 188869 		(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiPrevRowid = iRowid
 188870 		(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInDoclist = U8(0)
 188871 		(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage = U8(0)
 188872 	}
 188873 }
 188874 
 188875 func fts5WriteAppendPoslistData(tls *libc.TLS, p uintptr, pWriter uintptr, aData uintptr, nData int32) {
 188876 	bp := tls.Alloc(8)
 188877 	defer tls.Free(8)
 188878 
 188879 	var pPage uintptr = pWriter + 8
 188880 	var a uintptr = aData
 188881 	var n int32 = nData
 188882 
 188883 	for (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK &&
 188884 		(*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn+(*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fn+n >= (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz {
 188885 		var nReq int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz - (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn - (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fn
 188886 		var nCopy int32 = 0
 188887 		for nCopy < nReq {
 188888 			nCopy = nCopy + int32(sqlite3Fts5GetVarint(tls, a+uintptr(nCopy), bp))
 188889 		}
 188890 		sqlite3Fts5BufferAppendBlob(tls, p+52, pPage+8, uint32(nCopy), a)
 188891 		a += uintptr(nCopy)
 188892 		n = n - nCopy
 188893 		fts5WriteFlushLeaf(tls, p, pWriter)
 188894 	}
 188895 	if n > 0 {
 188896 		sqlite3Fts5BufferAppendBlob(tls, p+52, pPage+8, uint32(n), a)
 188897 	}
 188898 }
 188899 
 188900 func fts5WriteFinish(tls *libc.TLS, p uintptr, pWriter uintptr, pnLeaf uintptr) {
 188901 	var i int32
 188902 	var pLeaf uintptr = pWriter + 8
 188903 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 188904 		if (*Fts5PageWriter)(unsafe.Pointer(pLeaf)).Fbuf.Fn > 4 {
 188905 			fts5WriteFlushLeaf(tls, p, pWriter)
 188906 		}
 188907 		*(*int32)(unsafe.Pointer(pnLeaf)) = (*Fts5PageWriter)(unsafe.Pointer(pLeaf)).Fpgno - 1
 188908 		if (*Fts5PageWriter)(unsafe.Pointer(pLeaf)).Fpgno > 1 {
 188909 			fts5WriteFlushBtree(tls, p, pWriter)
 188910 		}
 188911 	}
 188912 	sqlite3Fts5BufferFree(tls, pLeaf+40)
 188913 	sqlite3Fts5BufferFree(tls, pLeaf+8)
 188914 	sqlite3Fts5BufferFree(tls, pLeaf+24)
 188915 	sqlite3Fts5BufferFree(tls, pWriter+96)
 188916 
 188917 	for i = 0; i < (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx; i++ {
 188918 		sqlite3Fts5BufferFree(tls, (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx+uintptr(i)*32+16)
 188919 	}
 188920 	Xsqlite3_free(tls, (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx)
 188921 }
 188922 
 188923 func fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) {
 188924 	bp := tls.Alloc(16)
 188925 	defer tls.Free(16)
 188926 
 188927 	var nBuffer int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz + FTS5_DATA_PADDING
 188928 
 188929 	libc.Xmemset(tls, pWriter, 0, uint64(unsafe.Sizeof(Fts5SegWriter{})))
 188930 	(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiSegid = iSegid
 188931 
 188932 	fts5WriteDlidxGrow(tls, p, pWriter, 1)
 188933 	(*Fts5SegWriter)(unsafe.Pointer(pWriter)).Fwriter.Fpgno = 1
 188934 	(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstTermInPage = U8(1)
 188935 	(*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiBtPage = 1
 188936 
 188937 	sqlite3Fts5BufferSize(tls, p+52, pWriter+8+24, uint32(nBuffer))
 188938 	sqlite3Fts5BufferSize(tls, p+52, pWriter+8+8, uint32(nBuffer))
 188939 
 188940 	if (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter == uintptr(0) {
 188941 		var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
 188942 		fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls,
 188943 			ts+36505,
 188944 			libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)))
 188945 	}
 188946 
 188947 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 188948 		libc.Xmemset(tls, (*Fts5SegWriter)(unsafe.Pointer(pWriter)).Fwriter.Fbuf.Fp, 0, uint64(4))
 188949 		(*Fts5SegWriter)(unsafe.Pointer(pWriter)).Fwriter.Fbuf.Fn = 4
 188950 
 188951 		Xsqlite3_bind_int(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter, 1, (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiSegid)
 188952 	}
 188953 }
 188954 
 188955 func fts5TrimSegments(tls *libc.TLS, p uintptr, pIter uintptr) {
 188956 	bp := tls.Alloc(20)
 188957 	defer tls.Free(20)
 188958 
 188959 	var i int32
 188960 
 188961 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Fts5Buffer{})))
 188962 	for i = 0; i < (*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg && (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK; i++ {
 188963 		var pSeg uintptr = pIter + 96 + uintptr(i)*120
 188964 		if (*Fts5SegIter)(unsafe.Pointer(pSeg)).FpSeg == uintptr(0) {
 188965 		} else if (*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf == uintptr(0) {
 188966 			(*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpSeg)).FpgnoLast = 0
 188967 			(*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpSeg)).FpgnoFirst = 0
 188968 		} else {
 188969 			var iOff int32 = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiTermLeafOffset
 188970 			var iLeafRowid I64
 188971 			var pData uintptr
 188972 			var iId int32 = (*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpSeg)).FiSegid
 188973 			*(*[4]U8)(unsafe.Pointer(bp + 16)) = [4]U8{U8(0x00), U8(0x00), U8(0x00), U8(0x00)}
 188974 
 188975 			iLeafRowid = I64(iId)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B) + int64(0)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B) + int64(0)<<FTS5_DATA_PAGE_B + I64((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiTermLeafPgno)
 188976 			pData = fts5LeafRead(tls, p, iLeafRowid)
 188977 			if pData != 0 {
 188978 				if iOff > (*Fts5Data)(unsafe.Pointer(pData)).FszLeaf {
 188979 					(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 188980 				} else {
 188981 					sqlite3Fts5BufferZero(tls, bp)
 188982 					if !(U32((*Fts5Buffer)(unsafe.Pointer(bp)).Fn)+U32((*Fts5Data)(unsafe.Pointer(pData)).Fnn) <= U32((*Fts5Buffer)(unsafe.Pointer(bp)).FnSpace)) {
 188983 						sqlite3Fts5BufferSize(tls, p+52, bp, uint32((*Fts5Data)(unsafe.Pointer(pData)).Fnn+(*Fts5Buffer)(unsafe.Pointer(bp)).Fn))
 188984 					}
 188985 					sqlite3Fts5BufferAppendBlob(tls, p+52, bp, uint32(unsafe.Sizeof([4]U8{})), bp+16)
 188986 					sqlite3Fts5BufferAppendVarint(tls, p+52, bp, I64((*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fn))
 188987 					sqlite3Fts5BufferAppendBlob(tls, p+52, bp, uint32((*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fn), (*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fp)
 188988 					sqlite3Fts5BufferAppendBlob(tls, p+52, bp, uint32((*Fts5Data)(unsafe.Pointer(pData)).FszLeaf-iOff), (*Fts5Data)(unsafe.Pointer(pData)).Fp+uintptr(iOff))
 188989 					if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 188990 						fts5PutU16(tls, (*Fts5Buffer)(unsafe.Pointer(bp)).Fp+2, U16((*Fts5Buffer)(unsafe.Pointer(bp)).Fn))
 188991 					}
 188992 
 188993 					sqlite3Fts5BufferAppendVarint(tls, p+52, bp, int64(4))
 188994 					if (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafPgno == (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiTermLeafPgno &&
 188995 						(*Fts5SegIter)(unsafe.Pointer(pSeg)).FiEndofDoclist < (*Fts5Data)(unsafe.Pointer(pData)).FszLeaf &&
 188996 						(*Fts5SegIter)(unsafe.Pointer(pSeg)).FiPgidxOff <= (*Fts5Data)(unsafe.Pointer(pData)).Fnn {
 188997 						var nDiff int32 = (*Fts5Data)(unsafe.Pointer(pData)).FszLeaf - (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiEndofDoclist
 188998 						sqlite3Fts5BufferAppendVarint(tls, p+52, bp, I64((*Fts5Buffer)(unsafe.Pointer(bp)).Fn)-int64(1)-I64(nDiff)-int64(4))
 188999 						sqlite3Fts5BufferAppendBlob(tls, p+52, bp, uint32((*Fts5Data)(unsafe.Pointer(pData)).Fnn-(*Fts5SegIter)(unsafe.Pointer(pSeg)).FiPgidxOff), (*Fts5Data)(unsafe.Pointer(pData)).Fp+uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiPgidxOff))
 189000 					}
 189001 
 189002 					(*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpSeg)).FpgnoFirst = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiTermLeafPgno
 189003 					fts5DataDelete(tls, p, I64(iId)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)+int64(0)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B)+int64(0)<<FTS5_DATA_PAGE_B+int64(1), iLeafRowid)
 189004 					fts5DataWrite(tls, p, iLeafRowid, (*Fts5Buffer)(unsafe.Pointer(bp)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp)).Fn)
 189005 				}
 189006 				fts5DataRelease(tls, pData)
 189007 			}
 189008 		}
 189009 	}
 189010 	sqlite3Fts5BufferFree(tls, bp)
 189011 }
 189012 
 189013 func fts5MergeChunkCallback(tls *libc.TLS, p uintptr, pCtx uintptr, pChunk uintptr, nChunk int32) {
 189014 	var pWriter uintptr = pCtx
 189015 	fts5WriteAppendPoslistData(tls, p, pWriter, pChunk, nChunk)
 189016 }
 189017 
 189018 func fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32, pnRem uintptr) {
 189019 	bp := tls.Alloc(148)
 189020 	defer tls.Free(148)
 189021 
 189022 	var pStruct uintptr = *(*uintptr)(unsafe.Pointer(ppStruct))
 189023 	var pLvl uintptr = pStruct + 24 + uintptr(iLvl)*16
 189024 	var pLvlOut uintptr
 189025 	*(*uintptr)(unsafe.Pointer(bp + 136)) = uintptr(0)
 189026 	var nRem int32
 189027 	if pnRem != 0 {
 189028 		nRem = *(*int32)(unsafe.Pointer(pnRem))
 189029 	} else {
 189030 		nRem = 0
 189031 	}
 189032 	var nInput int32
 189033 
 189034 	var pSeg uintptr
 189035 
 189036 	var bOldest int32
 189037 	var eDetail int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail
 189038 	var flags int32 = FTS5INDEX_QUERY_NOOUTPUT
 189039 	var bTermWritten int32 = 0
 189040 
 189041 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Fts5SegWriter{})))
 189042 	libc.Xmemset(tls, bp+120, 0, uint64(unsafe.Sizeof(Fts5Buffer{})))
 189043 	if (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge != 0 {
 189044 		pLvlOut = pStruct + 24 + uintptr(iLvl+1)*16
 189045 
 189046 		nInput = (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge
 189047 		pSeg = (*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FaSeg + uintptr((*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FnSeg-1)*12
 189048 
 189049 		fts5WriteInit(tls, p, bp, (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)
 189050 		(*Fts5SegWriter)(unsafe.Pointer(bp)).Fwriter.Fpgno = (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast + 1
 189051 		(*Fts5SegWriter)(unsafe.Pointer(bp)).FiBtPage = 0
 189052 	} else {
 189053 		var iSegid int32 = fts5AllocateSegid(tls, p, pStruct)
 189054 
 189055 		if iLvl == (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel-1 {
 189056 			fts5StructureAddLevel(tls, p+52, ppStruct)
 189057 			pStruct = *(*uintptr)(unsafe.Pointer(ppStruct))
 189058 		}
 189059 		fts5StructureExtendLevel(tls, p+52, pStruct, iLvl+1, 1, 0)
 189060 		if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
 189061 			return
 189062 		}
 189063 		pLvl = pStruct + 24 + uintptr(iLvl)*16
 189064 		pLvlOut = pStruct + 24 + uintptr(iLvl+1)*16
 189065 
 189066 		fts5WriteInit(tls, p, bp, iSegid)
 189067 
 189068 		pSeg = (*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FaSeg + uintptr((*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FnSeg)*12
 189069 		(*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FnSeg++
 189070 		(*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst = 1
 189071 		(*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid = iSegid
 189072 		(*Fts5Structure)(unsafe.Pointer(pStruct)).FnSegment++
 189073 
 189074 		nInput = (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg
 189075 	}
 189076 	bOldest = libc.Bool32((*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FnSeg == 1 && (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel == iLvl+2)
 189077 
 189078 	for fts5MultiIterNew(tls, p, pStruct, flags, uintptr(0), uintptr(0), 0, iLvl, nInput, bp+136); fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp + 136))) == 0; fts5MultiIterNext(tls, p, *(*uintptr)(unsafe.Pointer(bp + 136)), 0, int64(0)) {
 189079 		var pSegIter uintptr = *(*uintptr)(unsafe.Pointer(bp + 136)) + 96 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136)))).FaFirst+1*4)).FiFirst)*120
 189080 		var nPos int32
 189081 
 189082 		var pTerm uintptr
 189083 
 189084 		pTerm = fts5MultiIterTerm(tls, *(*uintptr)(unsafe.Pointer(bp + 136)), bp+144)
 189085 		if *(*int32)(unsafe.Pointer(bp + 144)) != (*Fts5Buffer)(unsafe.Pointer(bp+120)).Fn || func() int32 {
 189086 			if *(*int32)(unsafe.Pointer(bp + 144)) <= 0 {
 189087 				return 0
 189088 			}
 189089 			return libc.Xmemcmp(tls, pTerm, (*Fts5Buffer)(unsafe.Pointer(bp+120)).Fp, uint64(*(*int32)(unsafe.Pointer(bp + 144))))
 189090 		}() != 0 {
 189091 			if pnRem != 0 && (*Fts5SegWriter)(unsafe.Pointer(bp)).FnLeafWritten > nRem {
 189092 				break
 189093 			}
 189094 			sqlite3Fts5BufferSet(tls, p+52, bp+120, *(*int32)(unsafe.Pointer(bp + 144)), pTerm)
 189095 			bTermWritten = 0
 189096 		}
 189097 
 189098 		if (*Fts5SegIter)(unsafe.Pointer(pSegIter)).FnPos == 0 && (bOldest != 0 || int32((*Fts5SegIter)(unsafe.Pointer(pSegIter)).FbDel) == 0) {
 189099 			continue
 189100 		}
 189101 
 189102 		if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bTermWritten == 0 {
 189103 			fts5WriteAppendTerm(tls, p, bp, *(*int32)(unsafe.Pointer(bp + 144)), pTerm)
 189104 			bTermWritten = 1
 189105 		}
 189106 
 189107 		fts5WriteAppendRowid(tls, p, bp, fts5MultiIterRowid(tls, *(*uintptr)(unsafe.Pointer(bp + 136))))
 189108 
 189109 		if eDetail == FTS5_DETAIL_NONE {
 189110 			if (*Fts5SegIter)(unsafe.Pointer(pSegIter)).FbDel != 0 {
 189111 				sqlite3Fts5BufferAppendVarint(tls, p+52, bp+8+8, int64(0))
 189112 				if (*Fts5SegIter)(unsafe.Pointer(pSegIter)).FnPos > 0 {
 189113 					sqlite3Fts5BufferAppendVarint(tls, p+52, bp+8+8, int64(0))
 189114 				}
 189115 			}
 189116 		} else {
 189117 			nPos = (*Fts5SegIter)(unsafe.Pointer(pSegIter)).FnPos*2 + int32((*Fts5SegIter)(unsafe.Pointer(pSegIter)).FbDel)
 189118 			sqlite3Fts5BufferAppendVarint(tls, p+52, bp+8+8, I64(nPos))
 189119 			fts5ChunkIterate(tls, p, pSegIter, bp, *(*uintptr)(unsafe.Pointer(&struct {
 189120 				f func(*libc.TLS, uintptr, uintptr, uintptr, int32)
 189121 			}{fts5MergeChunkCallback})))
 189122 		}
 189123 	}
 189124 
 189125 	fts5WriteFinish(tls, p, bp, pSeg+8)
 189126 
 189127 	if fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp + 136))) != 0 {
 189128 		var i int32
 189129 
 189130 		for i = 0; i < nInput; i++ {
 189131 			fts5DataRemoveSegment(tls, p, (*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(i)*12)).FiSegid)
 189132 		}
 189133 
 189134 		if (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg != nInput {
 189135 			var nMove int32 = int32(uint64((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg-nInput) * uint64(unsafe.Sizeof(Fts5StructureSegment{})))
 189136 			libc.Xmemmove(tls, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(nInput)*12, uint64(nMove))
 189137 		}
 189138 		*(*int32)(unsafe.Pointer(pStruct + 16)) -= nInput
 189139 		*(*int32)(unsafe.Pointer(pLvl + 4)) -= nInput
 189140 		(*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge = 0
 189141 		if (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast == 0 {
 189142 			(*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FnSeg--
 189143 			(*Fts5Structure)(unsafe.Pointer(pStruct)).FnSegment--
 189144 		}
 189145 	} else {
 189146 		fts5TrimSegments(tls, p, *(*uintptr)(unsafe.Pointer(bp + 136)))
 189147 		(*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge = nInput
 189148 	}
 189149 
 189150 	fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp + 136)))
 189151 	sqlite3Fts5BufferFree(tls, bp+120)
 189152 	if pnRem != 0 {
 189153 		*(*int32)(unsafe.Pointer(pnRem)) -= (*Fts5SegWriter)(unsafe.Pointer(bp)).FnLeafWritten
 189154 	}
 189155 }
 189156 
 189157 func fts5IndexMerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nPg int32, nMin int32) int32 {
 189158 	bp := tls.Alloc(12)
 189159 	defer tls.Free(12)
 189160 
 189161 	*(*int32)(unsafe.Pointer(bp + 8)) = nPg
 189162 	var bRet int32 = 0
 189163 	*(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(ppStruct))
 189164 	for *(*int32)(unsafe.Pointer(bp + 8)) > 0 && (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 189165 		var iLvl int32
 189166 		var iBestLvl int32 = 0
 189167 		var nBest int32 = 0
 189168 
 189169 		for iLvl = 0; iLvl < (*Fts5Structure)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnLevel; iLvl++ {
 189170 			var pLvl uintptr = *(*uintptr)(unsafe.Pointer(bp)) + 24 + uintptr(iLvl)*16
 189171 			if (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge != 0 {
 189172 				if (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge > nBest {
 189173 					iBestLvl = iLvl
 189174 					nBest = (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge
 189175 				}
 189176 				break
 189177 			}
 189178 			if (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg > nBest {
 189179 				nBest = (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg
 189180 				iBestLvl = iLvl
 189181 			}
 189182 		}
 189183 
 189184 		if nBest < nMin && (*Fts5StructureLevel)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))+24+uintptr(iBestLvl)*16)).FnMerge == 0 {
 189185 			break
 189186 		}
 189187 		bRet = 1
 189188 		fts5IndexMergeLevel(tls, p, bp, iBestLvl, bp+8)
 189189 		if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Fts5StructureLevel)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))+24+uintptr(iBestLvl)*16)).FnMerge == 0 {
 189190 			fts5StructurePromote(tls, p, iBestLvl+1, *(*uintptr)(unsafe.Pointer(bp)))
 189191 		}
 189192 	}
 189193 	*(*uintptr)(unsafe.Pointer(ppStruct)) = *(*uintptr)(unsafe.Pointer(bp))
 189194 	return bRet
 189195 }
 189196 
 189197 func fts5IndexAutomerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nLeaf int32) {
 189198 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FnAutomerge > 0 && *(*uintptr)(unsafe.Pointer(ppStruct)) != uintptr(0) {
 189199 		var pStruct uintptr = *(*uintptr)(unsafe.Pointer(ppStruct))
 189200 		var nWrite U64
 189201 		var nWork int32
 189202 		var nRem int32
 189203 
 189204 		nWrite = (*Fts5Structure)(unsafe.Pointer(pStruct)).FnWriteCounter
 189205 		nWork = int32((nWrite+U64(nLeaf))/U64((*Fts5Index)(unsafe.Pointer(p)).FnWorkUnit) - nWrite/U64((*Fts5Index)(unsafe.Pointer(p)).FnWorkUnit))
 189206 		*(*U64)(unsafe.Pointer(pStruct + 8)) += U64(nLeaf)
 189207 		nRem = (*Fts5Index)(unsafe.Pointer(p)).FnWorkUnit * nWork * (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel
 189208 
 189209 		fts5IndexMerge(tls, p, ppStruct, nRem, (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FnAutomerge)
 189210 	}
 189211 }
 189212 
 189213 func fts5IndexCrisismerge(tls *libc.TLS, p uintptr, ppStruct uintptr) {
 189214 	bp := tls.Alloc(8)
 189215 	defer tls.Free(8)
 189216 
 189217 	var nCrisis int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FnCrisisMerge
 189218 	*(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(ppStruct))
 189219 	var iLvl int32 = 0
 189220 
 189221 	for (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Fts5StructureLevel)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))+24+uintptr(iLvl)*16)).FnSeg >= nCrisis {
 189222 		fts5IndexMergeLevel(tls, p, bp, iLvl, uintptr(0))
 189223 
 189224 		fts5StructurePromote(tls, p, iLvl+1, *(*uintptr)(unsafe.Pointer(bp)))
 189225 		iLvl++
 189226 	}
 189227 	*(*uintptr)(unsafe.Pointer(ppStruct)) = *(*uintptr)(unsafe.Pointer(bp))
 189228 }
 189229 
 189230 func fts5IndexReturn(tls *libc.TLS, p uintptr) int32 {
 189231 	var rc int32 = (*Fts5Index)(unsafe.Pointer(p)).Frc
 189232 	(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_OK
 189233 	return rc
 189234 }
 189235 
 189236 type Fts5FlushCtx1 = struct {
 189237 	FpIdx   uintptr
 189238 	Fwriter Fts5SegWriter
 189239 }
 189240 
 189241 type Fts5FlushCtx = Fts5FlushCtx1
 189242 
 189243 func fts5PoslistPrefix(tls *libc.TLS, aBuf uintptr, nMax int32) int32 {
 189244 	bp := tls.Alloc(4)
 189245 	defer tls.Free(4)
 189246 
 189247 	var ret int32
 189248 
 189249 	ret = sqlite3Fts5GetVarint32(tls, aBuf, bp)
 189250 	if ret < nMax {
 189251 		for 1 != 0 {
 189252 			var i int32 = sqlite3Fts5GetVarint32(tls, aBuf+uintptr(ret), bp)
 189253 			if ret+i > nMax {
 189254 				break
 189255 			}
 189256 			ret = ret + i
 189257 		}
 189258 	}
 189259 	return ret
 189260 }
 189261 
 189262 func fts5FlushOneHash(tls *libc.TLS, p uintptr) {
 189263 	bp := tls.Alloc(176)
 189264 	defer tls.Free(176)
 189265 
 189266 	var pHash uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpHash
 189267 
 189268 	var iSegid int32
 189269 	*(*int32)(unsafe.Pointer(bp + 160)) = 0
 189270 
 189271 	*(*uintptr)(unsafe.Pointer(bp + 168)) = fts5StructureRead(tls, p)
 189272 	iSegid = fts5AllocateSegid(tls, p, *(*uintptr)(unsafe.Pointer(bp + 168)))
 189273 	fts5StructureInvalidate(tls, p)
 189274 
 189275 	if iSegid != 0 {
 189276 		var pgsz int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz
 189277 		var eDetail int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail
 189278 		var pSeg uintptr
 189279 		var pBuf uintptr
 189280 		var pPgidx uintptr
 189281 
 189282 		fts5WriteInit(tls, p, bp, iSegid)
 189283 
 189284 		pBuf = bp + 8 + 8
 189285 		pPgidx = bp + 8 + 24
 189286 
 189287 		if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 189288 			(*Fts5Index)(unsafe.Pointer(p)).Frc = sqlite3Fts5HashScanInit(tls, pHash, uintptr(0), 0)
 189289 		}
 189290 		for (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && 0 == sqlite3Fts5HashScanEof(tls, pHash) {
 189291 			sqlite3Fts5HashScanEntry(tls, pHash, bp+120, bp+128, bp+136)
 189292 			fts5WriteAppendTerm(tls, p, bp, int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 120)))), *(*uintptr)(unsafe.Pointer(bp + 120)))
 189293 			if (*Fts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK {
 189294 				break
 189295 			}
 189296 
 189297 			if pgsz >= (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn+(*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn+*(*int32)(unsafe.Pointer(bp + 136))+1 {
 189298 				{
 189299 					libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), *(*uintptr)(unsafe.Pointer(bp + 128)), uint64(*(*int32)(unsafe.Pointer(bp + 136))))
 189300 					*(*int32)(unsafe.Pointer(pBuf + 8)) += *(*int32)(unsafe.Pointer(bp + 136))
 189301 				}
 189302 
 189303 			} else {
 189304 				var iRowid I64 = int64(0)
 189305 				*(*U64)(unsafe.Pointer(bp + 144)) = uint64(0)
 189306 				var iOff int32 = 0
 189307 
 189308 				for (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && iOff < *(*int32)(unsafe.Pointer(bp + 136)) {
 189309 					iOff = iOff + int32(sqlite3Fts5GetVarint(tls, *(*uintptr)(unsafe.Pointer(bp + 128))+uintptr(iOff), bp+144))
 189310 					iRowid = I64(U64(iRowid) + *(*U64)(unsafe.Pointer(bp + 144)))
 189311 
 189312 					if (*Fts5SegWriter)(unsafe.Pointer(bp)).FbFirstRowidInPage != 0 {
 189313 						fts5PutU16(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp, U16((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn))
 189314 						*(*int32)(unsafe.Pointer(pBuf + 8)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), uint64(iRowid))
 189315 						(*Fts5SegWriter)(unsafe.Pointer(bp)).FbFirstRowidInPage = U8(0)
 189316 						fts5WriteDlidxAppend(tls, p, bp, iRowid)
 189317 						if (*Fts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK {
 189318 							break
 189319 						}
 189320 					} else {
 189321 						*(*int32)(unsafe.Pointer(pBuf + 8)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), *(*U64)(unsafe.Pointer(bp + 144)))
 189322 					}
 189323 
 189324 					if eDetail == FTS5_DETAIL_NONE {
 189325 						if iOff < *(*int32)(unsafe.Pointer(bp + 136)) && int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 128)) + uintptr(iOff)))) == 0 {
 189326 							*(*U8)(unsafe.Pointer((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(libc.PostIncInt32(&(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn, 1)))) = U8(0)
 189327 							iOff++
 189328 							if iOff < *(*int32)(unsafe.Pointer(bp + 136)) && int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 128)) + uintptr(iOff)))) == 0 {
 189329 								*(*U8)(unsafe.Pointer((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(libc.PostIncInt32(&(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn, 1)))) = U8(0)
 189330 								iOff++
 189331 							}
 189332 						}
 189333 						if (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn+(*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn >= pgsz {
 189334 							fts5WriteFlushLeaf(tls, p, bp)
 189335 						}
 189336 					} else {
 189337 						var nCopy int32 = fts5GetPoslistSize(tls, *(*uintptr)(unsafe.Pointer(bp + 128))+uintptr(iOff), bp+152, bp+156)
 189338 						nCopy = nCopy + *(*int32)(unsafe.Pointer(bp + 152))
 189339 						if (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn+(*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn+nCopy <= pgsz {
 189340 							{
 189341 								libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), *(*uintptr)(unsafe.Pointer(bp + 128))+uintptr(iOff), uint64(nCopy))
 189342 								*(*int32)(unsafe.Pointer(pBuf + 8)) += nCopy
 189343 							}
 189344 
 189345 						} else {
 189346 							var pPoslist uintptr = *(*uintptr)(unsafe.Pointer(bp + 128)) + uintptr(iOff)
 189347 							var iPos int32 = 0
 189348 							for (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 189349 								var nSpace int32 = pgsz - (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn - (*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn
 189350 								var n int32 = 0
 189351 								if nCopy-iPos <= nSpace {
 189352 									n = nCopy - iPos
 189353 								} else {
 189354 									n = fts5PoslistPrefix(tls, pPoslist+uintptr(iPos), nSpace)
 189355 								}
 189356 
 189357 								{
 189358 									libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), pPoslist+uintptr(iPos), uint64(n))
 189359 									*(*int32)(unsafe.Pointer(pBuf + 8)) += n
 189360 								}
 189361 
 189362 								iPos = iPos + n
 189363 								if (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn+(*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn >= pgsz {
 189364 									fts5WriteFlushLeaf(tls, p, bp)
 189365 								}
 189366 								if iPos >= nCopy {
 189367 									break
 189368 								}
 189369 							}
 189370 						}
 189371 						iOff = iOff + nCopy
 189372 					}
 189373 				}
 189374 			}
 189375 
 189376 			if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 189377 				sqlite3Fts5HashScanNext(tls, pHash)
 189378 			}
 189379 		}
 189380 		sqlite3Fts5HashClear(tls, pHash)
 189381 		fts5WriteFinish(tls, p, bp, bp+160)
 189382 
 189383 		if (*Fts5Structure)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 168)))).FnLevel == 0 {
 189384 			fts5StructureAddLevel(tls, p+52, bp+168)
 189385 		}
 189386 		fts5StructureExtendLevel(tls, p+52, *(*uintptr)(unsafe.Pointer(bp + 168)), 0, 1, 0)
 189387 		if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 189388 			pSeg = (*Fts5StructureLevel)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 168))+24)).FaSeg + uintptr(libc.PostIncInt32(&(*Fts5StructureLevel)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 168))+24)).FnSeg, 1))*12
 189389 			(*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid = iSegid
 189390 			(*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst = 1
 189391 			(*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast = *(*int32)(unsafe.Pointer(bp + 160))
 189392 			(*Fts5Structure)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 168)))).FnSegment++
 189393 		}
 189394 		fts5StructurePromote(tls, p, 0, *(*uintptr)(unsafe.Pointer(bp + 168)))
 189395 	}
 189396 
 189397 	fts5IndexAutomerge(tls, p, bp+168, *(*int32)(unsafe.Pointer(bp + 160)))
 189398 	fts5IndexCrisismerge(tls, p, bp+168)
 189399 	fts5StructureWrite(tls, p, *(*uintptr)(unsafe.Pointer(bp + 168)))
 189400 	fts5StructureRelease(tls, *(*uintptr)(unsafe.Pointer(bp + 168)))
 189401 }
 189402 
 189403 func fts5IndexFlush(tls *libc.TLS, p uintptr) {
 189404 	if (*Fts5Index)(unsafe.Pointer(p)).FnPendingData != 0 {
 189405 		(*Fts5Index)(unsafe.Pointer(p)).FnPendingData = 0
 189406 		fts5FlushOneHash(tls, p)
 189407 	}
 189408 }
 189409 
 189410 func fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) uintptr {
 189411 	var pNew uintptr = uintptr(0)
 189412 	var nByte Sqlite3_int64 = Sqlite3_int64(unsafe.Sizeof(Fts5Structure{}))
 189413 	var nSeg int32 = (*Fts5Structure)(unsafe.Pointer(pStruct)).FnSegment
 189414 	var i int32
 189415 
 189416 	if nSeg < 2 {
 189417 		return uintptr(0)
 189418 	}
 189419 	for i = 0; i < (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel; i++ {
 189420 		var nThis int32 = (*Fts5StructureLevel)(unsafe.Pointer(pStruct + 24 + uintptr(i)*16)).FnSeg
 189421 		if nThis == nSeg || nThis == nSeg-1 && (*Fts5StructureLevel)(unsafe.Pointer(pStruct+24+uintptr(i)*16)).FnMerge == nThis {
 189422 			fts5StructureRef(tls, pStruct)
 189423 			return pStruct
 189424 		}
 189425 
 189426 	}
 189427 
 189428 	nByte = Sqlite3_int64(uint64(nByte) + uint64((*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel+1)*uint64(unsafe.Sizeof(Fts5StructureLevel{})))
 189429 	pNew = sqlite3Fts5MallocZero(tls, p+52, nByte)
 189430 
 189431 	if pNew != 0 {
 189432 		var pLvl uintptr
 189433 		nByte = Sqlite3_int64(uint64(nSeg) * uint64(unsafe.Sizeof(Fts5StructureSegment{})))
 189434 		(*Fts5Structure)(unsafe.Pointer(pNew)).FnLevel = func() int32 {
 189435 			if (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel+1 < FTS5_MAX_LEVEL {
 189436 				return (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel + 1
 189437 			}
 189438 			return FTS5_MAX_LEVEL
 189439 		}()
 189440 		(*Fts5Structure)(unsafe.Pointer(pNew)).FnRef = 1
 189441 		(*Fts5Structure)(unsafe.Pointer(pNew)).FnWriteCounter = (*Fts5Structure)(unsafe.Pointer(pStruct)).FnWriteCounter
 189442 		pLvl = pNew + 24 + uintptr((*Fts5Structure)(unsafe.Pointer(pNew)).FnLevel-1)*16
 189443 		(*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg = sqlite3Fts5MallocZero(tls, p+52, nByte)
 189444 		if (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg != 0 {
 189445 			var iLvl int32
 189446 			var iSeg int32
 189447 			var iSegOut int32 = 0
 189448 
 189449 			for iLvl = (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel - 1; iLvl >= 0; iLvl-- {
 189450 				for iSeg = 0; iSeg < (*Fts5StructureLevel)(unsafe.Pointer(pStruct+24+uintptr(iLvl)*16)).FnSeg; iSeg++ {
 189451 					*(*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg + uintptr(iSegOut)*12)) = *(*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pStruct+24+uintptr(iLvl)*16)).FaSeg + uintptr(iSeg)*12))
 189452 					iSegOut++
 189453 				}
 189454 			}
 189455 			(*Fts5Structure)(unsafe.Pointer(pNew)).FnSegment = libc.AssignPtrInt32(pLvl+4, nSeg)
 189456 		} else {
 189457 			Xsqlite3_free(tls, pNew)
 189458 			pNew = uintptr(0)
 189459 		}
 189460 	}
 189461 
 189462 	return pNew
 189463 }
 189464 
 189465 func sqlite3Fts5IndexOptimize(tls *libc.TLS, p uintptr) int32 {
 189466 	bp := tls.Alloc(12)
 189467 	defer tls.Free(12)
 189468 
 189469 	var pStruct uintptr
 189470 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 189471 
 189472 	fts5IndexFlush(tls, p)
 189473 	pStruct = fts5StructureRead(tls, p)
 189474 	fts5StructureInvalidate(tls, p)
 189475 
 189476 	if pStruct != 0 {
 189477 		*(*uintptr)(unsafe.Pointer(bp)) = fts5IndexOptimizeStruct(tls, p, pStruct)
 189478 	}
 189479 	fts5StructureRelease(tls, pStruct)
 189480 
 189481 	if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
 189482 		var iLvl int32
 189483 		for iLvl = 0; (*Fts5StructureLevel)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))+24+uintptr(iLvl)*16)).FnSeg == 0; iLvl++ {
 189484 		}
 189485 		for (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Fts5StructureLevel)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))+24+uintptr(iLvl)*16)).FnSeg > 0 {
 189486 			*(*int32)(unsafe.Pointer(bp + 8)) = FTS5_OPT_WORK_UNIT
 189487 			fts5IndexMergeLevel(tls, p, bp, iLvl, bp+8)
 189488 		}
 189489 
 189490 		fts5StructureWrite(tls, p, *(*uintptr)(unsafe.Pointer(bp)))
 189491 		fts5StructureRelease(tls, *(*uintptr)(unsafe.Pointer(bp)))
 189492 	}
 189493 
 189494 	return fts5IndexReturn(tls, p)
 189495 }
 189496 
 189497 func sqlite3Fts5IndexMerge(tls *libc.TLS, p uintptr, nMerge int32) int32 {
 189498 	bp := tls.Alloc(8)
 189499 	defer tls.Free(8)
 189500 
 189501 	*(*uintptr)(unsafe.Pointer(bp)) = fts5StructureRead(tls, p)
 189502 	if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
 189503 		var nMin int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FnUsermerge
 189504 		fts5StructureInvalidate(tls, p)
 189505 		if nMerge < 0 {
 189506 			var pNew uintptr = fts5IndexOptimizeStruct(tls, p, *(*uintptr)(unsafe.Pointer(bp)))
 189507 			fts5StructureRelease(tls, *(*uintptr)(unsafe.Pointer(bp)))
 189508 			*(*uintptr)(unsafe.Pointer(bp)) = pNew
 189509 			nMin = 2
 189510 			nMerge = nMerge * -1
 189511 		}
 189512 		if *(*uintptr)(unsafe.Pointer(bp)) != 0 && (*Fts5Structure)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnLevel != 0 {
 189513 			if fts5IndexMerge(tls, p, bp, nMerge, nMin) != 0 {
 189514 				fts5StructureWrite(tls, p, *(*uintptr)(unsafe.Pointer(bp)))
 189515 			}
 189516 		}
 189517 		fts5StructureRelease(tls, *(*uintptr)(unsafe.Pointer(bp)))
 189518 	}
 189519 	return fts5IndexReturn(tls, p)
 189520 }
 189521 
 189522 func fts5AppendRowid(tls *libc.TLS, p uintptr, iDelta U64, pUnused uintptr, pBuf uintptr) {
 189523 	_ = pUnused
 189524 	sqlite3Fts5BufferAppendVarint(tls, p+52, pBuf, I64(iDelta))
 189525 }
 189526 
 189527 func fts5AppendPoslist(tls *libc.TLS, p uintptr, iDelta U64, pMulti uintptr, pBuf uintptr) {
 189528 	var nData int32 = (*Fts5Iter)(unsafe.Pointer(pMulti)).Fbase.FnData
 189529 	var nByte int32 = nData + 9 + 9 + FTS5_DATA_ZERO_PADDING
 189530 
 189531 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && 0 == func() int32 {
 189532 		if U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)+U32(nByte) <= U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) {
 189533 			return 0
 189534 		}
 189535 		return sqlite3Fts5BufferSize(tls, p+52, pBuf, uint32(nByte+(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn))
 189536 	}() {
 189537 		{
 189538 			*(*int32)(unsafe.Pointer(pBuf + 8)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), iDelta)
 189539 		}
 189540 
 189541 		{
 189542 			*(*int32)(unsafe.Pointer(pBuf + 8)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), uint64(nData*2))
 189543 		}
 189544 
 189545 		{
 189546 			libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), (*Fts5Iter)(unsafe.Pointer(pMulti)).Fbase.FpData, uint64(nData))
 189547 			*(*int32)(unsafe.Pointer(pBuf + 8)) += nData
 189548 		}
 189549 
 189550 		libc.Xmemset(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn), 0, uint64(FTS5_DATA_ZERO_PADDING))
 189551 	}
 189552 }
 189553 
 189554 func fts5DoclistIterNext(tls *libc.TLS, pIter uintptr) {
 189555 	bp := tls.Alloc(12)
 189556 	defer tls.Free(12)
 189557 
 189558 	var p uintptr = (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist + uintptr((*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnSize) + uintptr((*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnPoslist)
 189559 
 189560 	if p >= (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaEof {
 189561 		(*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist = uintptr(0)
 189562 	} else {
 189563 		p += uintptr(sqlite3Fts5GetVarint(tls, p, bp))
 189564 		*(*I64)(unsafe.Pointer(pIter + 8)) += *(*I64)(unsafe.Pointer(bp))
 189565 
 189566 		if int32(*(*U8)(unsafe.Pointer(p)))&0x80 != 0 {
 189567 			(*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnSize = sqlite3Fts5GetVarint32(tls, p, bp+8)
 189568 			(*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnPoslist = *(*int32)(unsafe.Pointer(bp + 8)) >> 1
 189569 		} else {
 189570 			(*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnPoslist = int32(*(*U8)(unsafe.Pointer(p))) >> 1
 189571 			(*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnSize = 1
 189572 		}
 189573 
 189574 		(*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist = p
 189575 		if (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist+uintptr((*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnPoslist) > (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaEof {
 189576 			(*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist = uintptr(0)
 189577 		}
 189578 	}
 189579 }
 189580 
 189581 func fts5DoclistIterInit(tls *libc.TLS, pBuf uintptr, pIter uintptr) {
 189582 	libc.Xmemset(tls, pIter, 0, uint64(unsafe.Sizeof(Fts5DoclistIter{})))
 189583 	if (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn > 0 {
 189584 		(*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist = (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp
 189585 		(*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaEof = (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)
 189586 		fts5DoclistIterNext(tls, pIter)
 189587 	}
 189588 }
 189589 
 189590 func fts5BufferSwap(tls *libc.TLS, p1 uintptr, p2 uintptr) {
 189591 	var tmp = *(*Fts5Buffer)(unsafe.Pointer(p1))
 189592 	*(*Fts5Buffer)(unsafe.Pointer(p1)) = *(*Fts5Buffer)(unsafe.Pointer(p2))
 189593 	*(*Fts5Buffer)(unsafe.Pointer(p2)) = tmp
 189594 }
 189595 
 189596 func fts5NextRowid(tls *libc.TLS, pBuf uintptr, piOff uintptr, piRowid uintptr) {
 189597 	bp := tls.Alloc(8)
 189598 	defer tls.Free(8)
 189599 
 189600 	var i int32 = *(*int32)(unsafe.Pointer(piOff))
 189601 	if i >= (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn {
 189602 		*(*int32)(unsafe.Pointer(piOff)) = -1
 189603 	} else {
 189604 		*(*int32)(unsafe.Pointer(piOff)) = i + int32(sqlite3Fts5GetVarint(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr(i), bp))
 189605 		*(*I64)(unsafe.Pointer(piRowid)) += I64(*(*U64)(unsafe.Pointer(bp)))
 189606 	}
 189607 }
 189608 
 189609 func fts5MergeRowidLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBuf uintptr) {
 189610 	bp := tls.Alloc(48)
 189611 	defer tls.Free(48)
 189612 
 189613 	*(*int32)(unsafe.Pointer(bp + 16)) = 0
 189614 	*(*int32)(unsafe.Pointer(bp + 32)) = 0
 189615 	*(*I64)(unsafe.Pointer(bp + 24)) = int64(0)
 189616 	*(*I64)(unsafe.Pointer(bp + 40)) = int64(0)
 189617 	var iOut I64 = int64(0)
 189618 	var p2 uintptr = aBuf
 189619 
 189620 	_ = nBuf
 189621 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Fts5Buffer{})))
 189622 
 189623 	sqlite3Fts5BufferSize(tls, p+52, bp, uint32((*Fts5Buffer)(unsafe.Pointer(p1)).Fn+(*Fts5Buffer)(unsafe.Pointer(p2)).Fn))
 189624 	if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
 189625 		return
 189626 	}
 189627 
 189628 	fts5NextRowid(tls, p1, bp+16, bp+24)
 189629 	fts5NextRowid(tls, p2, bp+32, bp+40)
 189630 	for *(*int32)(unsafe.Pointer(bp + 16)) >= 0 || *(*int32)(unsafe.Pointer(bp + 32)) >= 0 {
 189631 		if *(*int32)(unsafe.Pointer(bp + 16)) >= 0 && (*(*int32)(unsafe.Pointer(bp + 32)) < 0 || *(*I64)(unsafe.Pointer(bp + 24)) < *(*I64)(unsafe.Pointer(bp + 40))) {
 189632 			{
 189633 				*(*int32)(unsafe.Pointer(bp + 8)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(bp)).Fn), uint64(*(*I64)(unsafe.Pointer(bp + 24))-iOut))
 189634 			}
 189635 
 189636 			iOut = *(*I64)(unsafe.Pointer(bp + 24))
 189637 			fts5NextRowid(tls, p1, bp+16, bp+24)
 189638 		} else {
 189639 			{
 189640 				*(*int32)(unsafe.Pointer(bp + 8)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(bp)).Fn), uint64(*(*I64)(unsafe.Pointer(bp + 40))-iOut))
 189641 			}
 189642 
 189643 			iOut = *(*I64)(unsafe.Pointer(bp + 40))
 189644 			if *(*int32)(unsafe.Pointer(bp + 16)) >= 0 && *(*I64)(unsafe.Pointer(bp + 24)) == *(*I64)(unsafe.Pointer(bp + 40)) {
 189645 				fts5NextRowid(tls, p1, bp+16, bp+24)
 189646 			}
 189647 			fts5NextRowid(tls, p2, bp+32, bp+40)
 189648 		}
 189649 	}
 189650 
 189651 	fts5BufferSwap(tls, bp, p1)
 189652 	sqlite3Fts5BufferFree(tls, bp)
 189653 }
 189654 
 189655 type PrefixMerger1 = struct {
 189656 	Fiter        Fts5DoclistIter
 189657 	FiPos        I64
 189658 	FiOff        int32
 189659 	F__ccgo_pad1 [4]byte
 189660 	FaPos        uintptr
 189661 	FpNext       uintptr
 189662 }
 189663 
 189664 type PrefixMerger = PrefixMerger1
 189665 
 189666 func fts5PrefixMergerInsertByRowid(tls *libc.TLS, ppHead uintptr, p uintptr) {
 189667 	if (*PrefixMerger)(unsafe.Pointer(p)).Fiter.FaPoslist != 0 {
 189668 		var pp uintptr = ppHead
 189669 		for *(*uintptr)(unsafe.Pointer(pp)) != 0 && (*PrefixMerger)(unsafe.Pointer(p)).Fiter.FiRowid > (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).Fiter.FiRowid {
 189670 			pp = *(*uintptr)(unsafe.Pointer(pp)) + 56
 189671 		}
 189672 		(*PrefixMerger)(unsafe.Pointer(p)).FpNext = *(*uintptr)(unsafe.Pointer(pp))
 189673 		*(*uintptr)(unsafe.Pointer(pp)) = p
 189674 	}
 189675 }
 189676 
 189677 func fts5PrefixMergerInsertByPosition(tls *libc.TLS, ppHead uintptr, p uintptr) {
 189678 	if (*PrefixMerger)(unsafe.Pointer(p)).FiPos >= int64(0) {
 189679 		var pp uintptr = ppHead
 189680 		for *(*uintptr)(unsafe.Pointer(pp)) != 0 && (*PrefixMerger)(unsafe.Pointer(p)).FiPos > (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FiPos {
 189681 			pp = *(*uintptr)(unsafe.Pointer(pp)) + 56
 189682 		}
 189683 		(*PrefixMerger)(unsafe.Pointer(p)).FpNext = *(*uintptr)(unsafe.Pointer(pp))
 189684 		*(*uintptr)(unsafe.Pointer(pp)) = p
 189685 	}
 189686 }
 189687 
 189688 func fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBuf uintptr) {
 189689 	bp := tls.Alloc(1072)
 189690 	defer tls.Free(1072)
 189691 
 189692 	*(*uintptr)(unsafe.Pointer(bp + 1024)) = uintptr(0)
 189693 	var i int32
 189694 	var nOut int32 = 0
 189695 	*(*Fts5Buffer)(unsafe.Pointer(bp + 1032)) = Fts5Buffer{}
 189696 	*(*Fts5Buffer)(unsafe.Pointer(bp + 1048)) = Fts5Buffer{}
 189697 	var iLastRowid I64 = int64(0)
 189698 
 189699 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(PrefixMerger{}))*uint64(nBuf+1))
 189700 	*(*uintptr)(unsafe.Pointer(bp + 1024)) = bp + uintptr(nBuf)*64
 189701 	fts5DoclistIterInit(tls, p1, *(*uintptr)(unsafe.Pointer(bp + 1024)))
 189702 	for i = 0; i < nBuf; i++ {
 189703 		fts5DoclistIterInit(tls, aBuf+uintptr(i)*16, bp+uintptr(i)*64)
 189704 		fts5PrefixMergerInsertByRowid(tls, bp+1024, bp+uintptr(i)*64)
 189705 		nOut = nOut + (*Fts5Buffer)(unsafe.Pointer(aBuf+uintptr(i)*16)).Fn
 189706 	}
 189707 	if nOut == 0 {
 189708 		return
 189709 	}
 189710 	nOut = nOut + ((*Fts5Buffer)(unsafe.Pointer(p1)).Fn + 9 + 10*nBuf)
 189711 
 189712 	if sqlite3Fts5BufferSize(tls, p+52, bp+1032, uint32(nOut)) != 0 {
 189713 		return
 189714 	}
 189715 
 189716 	for *(*uintptr)(unsafe.Pointer(bp + 1024)) != 0 {
 189717 		{
 189718 			{
 189719 				*(*int32)(unsafe.Pointer(bp + 1032 + 8)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(bp+1032)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(bp+1032)).Fn), U64((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024)))).Fiter.FiRowid)-U64(iLastRowid))
 189720 			}
 189721 			iLastRowid = (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024)))).Fiter.FiRowid
 189722 		}
 189723 
 189724 		if (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024)))).FpNext != 0 && iLastRowid == (*PrefixMerger)(unsafe.Pointer((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024)))).FpNext)).Fiter.FiRowid {
 189725 			*(*I64)(unsafe.Pointer(bp + 1064)) = int64(0)
 189726 			var nTmp int32 = FTS5_DATA_ZERO_PADDING
 189727 			var nMerge int32 = 0
 189728 			var pSave uintptr = *(*uintptr)(unsafe.Pointer(bp + 1024))
 189729 			var pThis uintptr = uintptr(0)
 189730 			var nTail int32 = 0
 189731 
 189732 			*(*uintptr)(unsafe.Pointer(bp + 1024)) = uintptr(0)
 189733 			for pSave != 0 && (*PrefixMerger)(unsafe.Pointer(pSave)).Fiter.FiRowid == iLastRowid {
 189734 				var pNext uintptr = (*PrefixMerger)(unsafe.Pointer(pSave)).FpNext
 189735 				(*PrefixMerger)(unsafe.Pointer(pSave)).FiOff = 0
 189736 				(*PrefixMerger)(unsafe.Pointer(pSave)).FiPos = int64(0)
 189737 				(*PrefixMerger)(unsafe.Pointer(pSave)).FaPos = (*PrefixMerger)(unsafe.Pointer(pSave)).Fiter.FaPoslist + uintptr((*PrefixMerger)(unsafe.Pointer(pSave)).Fiter.FnSize)
 189738 				sqlite3Fts5PoslistNext64(tls, (*PrefixMerger)(unsafe.Pointer(pSave)).FaPos, (*PrefixMerger)(unsafe.Pointer(pSave)).Fiter.FnPoslist, pSave+40, pSave+32)
 189739 				nTmp = nTmp + ((*PrefixMerger)(unsafe.Pointer(pSave)).Fiter.FnPoslist + 10)
 189740 				nMerge++
 189741 				fts5PrefixMergerInsertByPosition(tls, bp+1024, pSave)
 189742 				pSave = pNext
 189743 			}
 189744 
 189745 			if *(*uintptr)(unsafe.Pointer(bp + 1024)) == uintptr(0) || (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024)))).FpNext == uintptr(0) {
 189746 				(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 189747 				break
 189748 			}
 189749 
 189750 			if sqlite3Fts5BufferSize(tls, p+52, bp+1048, uint32(nTmp+nMerge*10)) != 0 {
 189751 				break
 189752 			}
 189753 			sqlite3Fts5BufferZero(tls, bp+1048)
 189754 
 189755 			pThis = *(*uintptr)(unsafe.Pointer(bp + 1024))
 189756 			*(*uintptr)(unsafe.Pointer(bp + 1024)) = (*PrefixMerger)(unsafe.Pointer(pThis)).FpNext
 189757 			sqlite3Fts5PoslistSafeAppend(tls, bp+1048, bp+1064, (*PrefixMerger)(unsafe.Pointer(pThis)).FiPos)
 189758 			sqlite3Fts5PoslistNext64(tls, (*PrefixMerger)(unsafe.Pointer(pThis)).FaPos, (*PrefixMerger)(unsafe.Pointer(pThis)).Fiter.FnPoslist, pThis+40, pThis+32)
 189759 			fts5PrefixMergerInsertByPosition(tls, bp+1024, pThis)
 189760 
 189761 			for (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024)))).FpNext != 0 {
 189762 				pThis = *(*uintptr)(unsafe.Pointer(bp + 1024))
 189763 				if (*PrefixMerger)(unsafe.Pointer(pThis)).FiPos != *(*I64)(unsafe.Pointer(bp + 1064)) {
 189764 					sqlite3Fts5PoslistSafeAppend(tls, bp+1048, bp+1064, (*PrefixMerger)(unsafe.Pointer(pThis)).FiPos)
 189765 				}
 189766 				sqlite3Fts5PoslistNext64(tls, (*PrefixMerger)(unsafe.Pointer(pThis)).FaPos, (*PrefixMerger)(unsafe.Pointer(pThis)).Fiter.FnPoslist, pThis+40, pThis+32)
 189767 				*(*uintptr)(unsafe.Pointer(bp + 1024)) = (*PrefixMerger)(unsafe.Pointer(pThis)).FpNext
 189768 				fts5PrefixMergerInsertByPosition(tls, bp+1024, pThis)
 189769 			}
 189770 
 189771 			if (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024)))).FiPos != *(*I64)(unsafe.Pointer(bp + 1064)) {
 189772 				sqlite3Fts5PoslistSafeAppend(tls, bp+1048, bp+1064, (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024)))).FiPos)
 189773 			}
 189774 			nTail = (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024)))).Fiter.FnPoslist - (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024)))).FiOff
 189775 
 189776 			if (*Fts5Buffer)(unsafe.Pointer(bp+1048)).Fn+nTail > nTmp-FTS5_DATA_ZERO_PADDING {
 189777 				if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 189778 					(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 189779 				}
 189780 				break
 189781 			}
 189782 			{
 189783 				*(*int32)(unsafe.Pointer(bp + 1032 + 8)) += sqlite3Fts5PutVarint(tls, (*Fts5Buffer)(unsafe.Pointer(bp+1032)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(bp+1032)).Fn), uint64(((*Fts5Buffer)(unsafe.Pointer(bp+1048)).Fn+nTail)*2))
 189784 			}
 189785 
 189786 			{
 189787 				libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer(bp+1032)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(bp+1032)).Fn), (*Fts5Buffer)(unsafe.Pointer(bp+1048)).Fp, uint64((*Fts5Buffer)(unsafe.Pointer(bp+1048)).Fn))
 189788 				*(*int32)(unsafe.Pointer(bp + 1032 + 8)) += (*Fts5Buffer)(unsafe.Pointer(bp + 1048)).Fn
 189789 			}
 189790 
 189791 			if nTail > 0 {
 189792 				{
 189793 					libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer(bp+1032)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(bp+1032)).Fn), (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024)))).FaPos+uintptr((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024)))).FiOff), uint64(nTail))
 189794 					*(*int32)(unsafe.Pointer(bp + 1032 + 8)) += nTail
 189795 				}
 189796 
 189797 			}
 189798 
 189799 			*(*uintptr)(unsafe.Pointer(bp + 1024)) = pSave
 189800 			for i = 0; i < nBuf+1; i++ {
 189801 				var pX uintptr = bp + uintptr(i)*64
 189802 				if (*PrefixMerger)(unsafe.Pointer(pX)).Fiter.FaPoslist != 0 && (*PrefixMerger)(unsafe.Pointer(pX)).Fiter.FiRowid == iLastRowid {
 189803 					fts5DoclistIterNext(tls, pX)
 189804 					fts5PrefixMergerInsertByRowid(tls, bp+1024, pX)
 189805 				}
 189806 			}
 189807 
 189808 		} else {
 189809 			var pThis uintptr = *(*uintptr)(unsafe.Pointer(bp + 1024))
 189810 			var pI uintptr = pThis
 189811 			{
 189812 				libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer(bp+1032)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(bp+1032)).Fn), (*Fts5DoclistIter)(unsafe.Pointer(pI)).FaPoslist, uint64((*Fts5DoclistIter)(unsafe.Pointer(pI)).FnPoslist+(*Fts5DoclistIter)(unsafe.Pointer(pI)).FnSize))
 189813 				*(*int32)(unsafe.Pointer(bp + 1032 + 8)) += (*Fts5DoclistIter)(unsafe.Pointer(pI)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(pI)).FnSize
 189814 			}
 189815 
 189816 			fts5DoclistIterNext(tls, pI)
 189817 			*(*uintptr)(unsafe.Pointer(bp + 1024)) = (*PrefixMerger)(unsafe.Pointer(pThis)).FpNext
 189818 			fts5PrefixMergerInsertByRowid(tls, bp+1024, pThis)
 189819 		}
 189820 	}
 189821 
 189822 	sqlite3Fts5BufferFree(tls, p1)
 189823 	sqlite3Fts5BufferFree(tls, bp+1048)
 189824 	libc.Xmemset(tls, (*Fts5Buffer)(unsafe.Pointer(bp+1032)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(bp+1032)).Fn), 0, uint64(FTS5_DATA_ZERO_PADDING))
 189825 	*(*Fts5Buffer)(unsafe.Pointer(p1)) = *(*Fts5Buffer)(unsafe.Pointer(bp + 1032))
 189826 }
 189827 
 189828 func fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pToken uintptr, nToken int32, pColset uintptr, ppIter uintptr) {
 189829 	bp := tls.Alloc(32)
 189830 	defer tls.Free(32)
 189831 
 189832 	var pStruct uintptr
 189833 	var aBuf uintptr
 189834 	var nBuf int32 = 32
 189835 	var nMerge int32 = 1
 189836 	var xMerge uintptr
 189837 	var xAppend uintptr
 189838 	if (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == FTS5_DETAIL_NONE {
 189839 		xMerge = *(*uintptr)(unsafe.Pointer(&struct {
 189840 			f func(*libc.TLS, uintptr, uintptr, int32, uintptr)
 189841 		}{fts5MergeRowidLists}))
 189842 		xAppend = *(*uintptr)(unsafe.Pointer(&struct {
 189843 			f func(*libc.TLS, uintptr, U64, uintptr, uintptr)
 189844 		}{fts5AppendRowid}))
 189845 	} else {
 189846 		nMerge = FTS5_MERGE_NLIST - 1
 189847 		nBuf = nMerge * 8
 189848 		xMerge = *(*uintptr)(unsafe.Pointer(&struct {
 189849 			f func(*libc.TLS, uintptr, uintptr, int32, uintptr)
 189850 		}{fts5MergePrefixLists}))
 189851 		xAppend = *(*uintptr)(unsafe.Pointer(&struct {
 189852 			f func(*libc.TLS, uintptr, U64, uintptr, uintptr)
 189853 		}{fts5AppendPoslist}))
 189854 	}
 189855 
 189856 	aBuf = fts5IdxMalloc(tls, p, int64(uint64(unsafe.Sizeof(Fts5Buffer{}))*uint64(nBuf)))
 189857 	pStruct = fts5StructureRead(tls, p)
 189858 
 189859 	if aBuf != 0 && pStruct != 0 {
 189860 		var flags int32 = FTS5INDEX_QUERY_SCAN |
 189861 			FTS5INDEX_QUERY_SKIPEMPTY |
 189862 			FTS5INDEX_QUERY_NOOUTPUT
 189863 		var i int32
 189864 		var iLastRowid I64 = int64(0)
 189865 		*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
 189866 		var pData uintptr
 189867 
 189868 		*(*int32)(unsafe.Pointer(bp + 28)) = 1
 189869 
 189870 		libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Fts5Buffer{})))
 189871 		if iIdx != 0 {
 189872 			*(*int32)(unsafe.Pointer(bp + 24)) = 0
 189873 			var f2 int32 = FTS5INDEX_QUERY_SKIPEMPTY | FTS5INDEX_QUERY_NOOUTPUT
 189874 			*(*U8)(unsafe.Pointer(pToken)) = U8('0')
 189875 			fts5MultiIterNew(tls, p, pStruct, f2, pColset, pToken, nToken, -1, 0, bp+16)
 189876 			fts5IterSetOutputCb(tls, p+52, *(*uintptr)(unsafe.Pointer(bp + 16)))
 189877 			for ; fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16))) == 0; fts5MultiIterNext2(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16)), bp+24) {
 189878 				var pSeg uintptr = *(*uintptr)(unsafe.Pointer(bp + 16)) + 96 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FaFirst+1*4)).FiFirst)*120
 189879 				(*struct {
 189880 					f func(*libc.TLS, uintptr, uintptr)
 189881 				})(unsafe.Pointer(&struct{ uintptr }{(*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FxSetOutputs})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), pSeg)
 189882 				if (*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbase.FnData != 0 {
 189883 					(*struct {
 189884 						f func(*libc.TLS, uintptr, U64, uintptr, uintptr)
 189885 					})(unsafe.Pointer(&struct{ uintptr }{xAppend})).f(tls, p, U64((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbase.FiRowid)-U64(iLastRowid), *(*uintptr)(unsafe.Pointer(bp + 16)), bp)
 189886 					iLastRowid = (*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbase.FiRowid
 189887 				}
 189888 			}
 189889 			fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
 189890 		}
 189891 
 189892 		*(*U8)(unsafe.Pointer(pToken)) = U8('0' + iIdx)
 189893 		fts5MultiIterNew(tls, p, pStruct, flags, pColset, pToken, nToken, -1, 0, bp+16)
 189894 		fts5IterSetOutputCb(tls, p+52, *(*uintptr)(unsafe.Pointer(bp + 16)))
 189895 		for ; fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16))) == 0; fts5MultiIterNext2(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16)), bp+28) {
 189896 			var pSeg uintptr = *(*uintptr)(unsafe.Pointer(bp + 16)) + 96 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FaFirst+1*4)).FiFirst)*120
 189897 			var nTerm int32 = (*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fn
 189898 			var pTerm uintptr = (*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fp
 189899 			(*struct {
 189900 				f func(*libc.TLS, uintptr, uintptr)
 189901 			})(unsafe.Pointer(&struct{ uintptr }{(*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FxSetOutputs})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), pSeg)
 189902 
 189903 			if *(*int32)(unsafe.Pointer(bp + 28)) != 0 {
 189904 				if nTerm < nToken || libc.Xmemcmp(tls, pToken, pTerm, uint64(nToken)) != 0 {
 189905 					break
 189906 				}
 189907 			}
 189908 
 189909 			if (*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbase.FnData == 0 {
 189910 				continue
 189911 			}
 189912 
 189913 			if (*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbase.FiRowid <= iLastRowid && (*Fts5Buffer)(unsafe.Pointer(bp)).Fn > 0 {
 189914 				for i = 0; (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Fts5Buffer)(unsafe.Pointer(bp)).Fn != 0; i++ {
 189915 					var i1 int32 = i * nMerge
 189916 					var iStore int32
 189917 
 189918 					for iStore = i1; iStore < i1+nMerge; iStore++ {
 189919 						if (*Fts5Buffer)(unsafe.Pointer(aBuf+uintptr(iStore)*16)).Fn == 0 {
 189920 							fts5BufferSwap(tls, bp, aBuf+uintptr(iStore)*16)
 189921 							sqlite3Fts5BufferZero(tls, bp)
 189922 							break
 189923 						}
 189924 					}
 189925 					if iStore == i1+nMerge {
 189926 						(*struct {
 189927 							f func(*libc.TLS, uintptr, uintptr, int32, uintptr)
 189928 						})(unsafe.Pointer(&struct{ uintptr }{xMerge})).f(tls, p, bp, nMerge, aBuf+uintptr(i1)*16)
 189929 						for iStore = i1; iStore < i1+nMerge; iStore++ {
 189930 							sqlite3Fts5BufferZero(tls, aBuf+uintptr(iStore)*16)
 189931 						}
 189932 					}
 189933 				}
 189934 				iLastRowid = int64(0)
 189935 			}
 189936 
 189937 			(*struct {
 189938 				f func(*libc.TLS, uintptr, U64, uintptr, uintptr)
 189939 			})(unsafe.Pointer(&struct{ uintptr }{xAppend})).f(tls, p, U64((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbase.FiRowid)-U64(iLastRowid), *(*uintptr)(unsafe.Pointer(bp + 16)), bp)
 189940 			iLastRowid = (*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbase.FiRowid
 189941 		}
 189942 
 189943 		for i = 0; i < nBuf; i = i + nMerge {
 189944 			var iFree int32
 189945 			if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 189946 				(*struct {
 189947 					f func(*libc.TLS, uintptr, uintptr, int32, uintptr)
 189948 				})(unsafe.Pointer(&struct{ uintptr }{xMerge})).f(tls, p, bp, nMerge, aBuf+uintptr(i)*16)
 189949 			}
 189950 			for iFree = i; iFree < i+nMerge; iFree++ {
 189951 				sqlite3Fts5BufferFree(tls, aBuf+uintptr(iFree)*16)
 189952 			}
 189953 		}
 189954 		fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
 189955 
 189956 		pData = fts5IdxMalloc(tls, p, int64(uint64(unsafe.Sizeof(Fts5Data{}))+uint64((*Fts5Buffer)(unsafe.Pointer(bp)).Fn)+uint64(FTS5_DATA_ZERO_PADDING)))
 189957 		if pData != 0 {
 189958 			(*Fts5Data)(unsafe.Pointer(pData)).Fp = pData + 1*16
 189959 			(*Fts5Data)(unsafe.Pointer(pData)).Fnn = libc.AssignPtrInt32(pData+12, (*Fts5Buffer)(unsafe.Pointer(bp)).Fn)
 189960 			if (*Fts5Buffer)(unsafe.Pointer(bp)).Fn != 0 {
 189961 				libc.Xmemcpy(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp)).Fp, uint64((*Fts5Buffer)(unsafe.Pointer(bp)).Fn))
 189962 			}
 189963 			fts5MultiIterNew2(tls, p, pData, bDesc, ppIter)
 189964 		}
 189965 		sqlite3Fts5BufferFree(tls, bp)
 189966 	}
 189967 
 189968 	fts5StructureRelease(tls, pStruct)
 189969 	Xsqlite3_free(tls, aBuf)
 189970 }
 189971 
 189972 func sqlite3Fts5IndexBeginWrite(tls *libc.TLS, p uintptr, bDelete int32, iRowid I64) int32 {
 189973 	if (*Fts5Index)(unsafe.Pointer(p)).FpHash == uintptr(0) {
 189974 		(*Fts5Index)(unsafe.Pointer(p)).Frc = sqlite3Fts5HashNew(tls, (*Fts5Index)(unsafe.Pointer(p)).FpConfig, p+24, p+32)
 189975 	}
 189976 
 189977 	if iRowid < (*Fts5Index)(unsafe.Pointer(p)).FiWriteRowid ||
 189978 		iRowid == (*Fts5Index)(unsafe.Pointer(p)).FiWriteRowid && (*Fts5Index)(unsafe.Pointer(p)).FbDelete == 0 ||
 189979 		(*Fts5Index)(unsafe.Pointer(p)).FnPendingData > (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FnHashSize {
 189980 		fts5IndexFlush(tls, p)
 189981 	}
 189982 
 189983 	(*Fts5Index)(unsafe.Pointer(p)).FiWriteRowid = iRowid
 189984 	(*Fts5Index)(unsafe.Pointer(p)).FbDelete = bDelete
 189985 	return fts5IndexReturn(tls, p)
 189986 }
 189987 
 189988 func sqlite3Fts5IndexSync(tls *libc.TLS, p uintptr) int32 {
 189989 	fts5IndexFlush(tls, p)
 189990 	sqlite3Fts5IndexCloseReader(tls, p)
 189991 	return fts5IndexReturn(tls, p)
 189992 }
 189993 
 189994 func sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) int32 {
 189995 	sqlite3Fts5IndexCloseReader(tls, p)
 189996 	fts5IndexDiscardData(tls, p)
 189997 	fts5StructureInvalidate(tls, p)
 189998 
 189999 	return SQLITE_OK
 190000 }
 190001 
 190002 func sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) int32 {
 190003 	bp := tls.Alloc(40)
 190004 	defer tls.Free(40)
 190005 
 190006 	fts5StructureInvalidate(tls, p)
 190007 	fts5IndexDiscardData(tls, p)
 190008 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Fts5Structure{})))
 190009 	fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), ts+1544, 0)
 190010 	fts5StructureWrite(tls, p, bp)
 190011 	return fts5IndexReturn(tls, p)
 190012 }
 190013 
 190014 func sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uintptr, pzErr uintptr) int32 {
 190015 	bp := tls.Alloc(12)
 190016 	defer tls.Free(12)
 190017 
 190018 	*(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK
 190019 	var p uintptr
 190020 
 190021 	*(*uintptr)(unsafe.Pointer(pp)) = libc.AssignUintptr(&p, sqlite3Fts5MallocZero(tls, bp+8, int64(unsafe.Sizeof(Fts5Index{}))))
 190022 	if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
 190023 		(*Fts5Index)(unsafe.Pointer(p)).FpConfig = pConfig
 190024 		(*Fts5Index)(unsafe.Pointer(p)).FnWorkUnit = FTS5_WORK_UNIT
 190025 		(*Fts5Index)(unsafe.Pointer(p)).FzDataTbl = sqlite3Fts5Mprintf(tls, bp+8, ts+36562, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
 190026 		if (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl != 0 && bCreate != 0 {
 190027 			*(*int32)(unsafe.Pointer(bp + 8)) = sqlite3Fts5CreateTable(tls,
 190028 				pConfig, ts+26479, ts+36570, 0, pzErr)
 190029 			if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
 190030 				*(*int32)(unsafe.Pointer(bp + 8)) = sqlite3Fts5CreateTable(tls, pConfig, ts+12840,
 190031 					ts+36605,
 190032 					1, pzErr)
 190033 			}
 190034 			if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
 190035 				*(*int32)(unsafe.Pointer(bp + 8)) = sqlite3Fts5IndexReinit(tls, p)
 190036 			}
 190037 		}
 190038 	}
 190039 
 190040 	if *(*int32)(unsafe.Pointer(bp + 8)) != 0 {
 190041 		sqlite3Fts5IndexClose(tls, p)
 190042 		*(*uintptr)(unsafe.Pointer(pp)) = uintptr(0)
 190043 	}
 190044 	return *(*int32)(unsafe.Pointer(bp + 8))
 190045 }
 190046 
 190047 func sqlite3Fts5IndexClose(tls *libc.TLS, p uintptr) int32 {
 190048 	var rc int32 = SQLITE_OK
 190049 	if p != 0 {
 190050 		fts5StructureInvalidate(tls, p)
 190051 		Xsqlite3_finalize(tls, (*Fts5Index)(unsafe.Pointer(p)).FpWriter)
 190052 		Xsqlite3_finalize(tls, (*Fts5Index)(unsafe.Pointer(p)).FpDeleter)
 190053 		Xsqlite3_finalize(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter)
 190054 		Xsqlite3_finalize(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxDeleter)
 190055 		Xsqlite3_finalize(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxSelect)
 190056 		Xsqlite3_finalize(tls, (*Fts5Index)(unsafe.Pointer(p)).FpDataVersion)
 190057 		sqlite3Fts5HashFree(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash)
 190058 		Xsqlite3_free(tls, (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl)
 190059 		Xsqlite3_free(tls, p)
 190060 	}
 190061 	return rc
 190062 }
 190063 
 190064 func sqlite3Fts5IndexCharlenToBytelen(tls *libc.TLS, p uintptr, nByte int32, nChar int32) int32 {
 190065 	var n int32 = 0
 190066 	var i int32
 190067 	for i = 0; i < nChar; i++ {
 190068 		if n >= nByte {
 190069 			return 0
 190070 		}
 190071 		if int32(uint8(*(*int8)(unsafe.Pointer(p + uintptr(libc.PostIncInt32(&n, 1)))))) >= 0xc0 {
 190072 			if n >= nByte {
 190073 				return 0
 190074 			}
 190075 			for int32(*(*int8)(unsafe.Pointer(p + uintptr(n))))&0xc0 == 0x80 {
 190076 				n++
 190077 				if n >= nByte {
 190078 					if i+1 == nChar {
 190079 						break
 190080 					}
 190081 					return 0
 190082 				}
 190083 			}
 190084 		}
 190085 	}
 190086 	return n
 190087 }
 190088 
 190089 func fts5IndexCharlen(tls *libc.TLS, pIn uintptr, nIn int32) int32 {
 190090 	var nChar int32 = 0
 190091 	var i int32 = 0
 190092 	for i < nIn {
 190093 		if int32(uint8(*(*int8)(unsafe.Pointer(pIn + uintptr(libc.PostIncInt32(&i, 1)))))) >= 0xc0 {
 190094 			for i < nIn && int32(*(*int8)(unsafe.Pointer(pIn + uintptr(i))))&0xc0 == 0x80 {
 190095 				i++
 190096 			}
 190097 		}
 190098 		nChar++
 190099 	}
 190100 	return nChar
 190101 }
 190102 
 190103 func sqlite3Fts5IndexWrite(tls *libc.TLS, p uintptr, iCol int32, iPos int32, pToken uintptr, nToken int32) int32 {
 190104 	var i int32
 190105 	var rc int32 = SQLITE_OK
 190106 	var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
 190107 
 190108 	rc = sqlite3Fts5HashWrite(tls,
 190109 		(*Fts5Index)(unsafe.Pointer(p)).FpHash, (*Fts5Index)(unsafe.Pointer(p)).FiWriteRowid, iCol, iPos, int8('0'), pToken, nToken)
 190110 
 190111 	for i = 0; i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnPrefix && rc == SQLITE_OK; i++ {
 190112 		var nChar int32 = *(*int32)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix + uintptr(i)*4))
 190113 		var nByte int32 = sqlite3Fts5IndexCharlenToBytelen(tls, pToken, nToken, nChar)
 190114 		if nByte != 0 {
 190115 			rc = sqlite3Fts5HashWrite(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash,
 190116 				(*Fts5Index)(unsafe.Pointer(p)).FiWriteRowid, iCol, iPos, int8('0'+i+1), pToken,
 190117 				nByte)
 190118 		}
 190119 	}
 190120 
 190121 	return rc
 190122 }
 190123 
 190124 func sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int32, flags int32, pColset uintptr, ppIter uintptr) int32 {
 190125 	bp := tls.Alloc(24)
 190126 	defer tls.Free(24)
 190127 
 190128 	var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
 190129 	*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
 190130 	*(*Fts5Buffer)(unsafe.Pointer(bp)) = Fts5Buffer{}
 190131 
 190132 	if sqlite3Fts5BufferSize(tls, p+52, bp, uint32(nToken+1)) == 0 {
 190133 		var iIdx int32 = 0
 190134 		var iPrefixIdx int32 = 0
 190135 		if nToken > 0 {
 190136 			libc.Xmemcpy(tls, (*Fts5Buffer)(unsafe.Pointer(bp)).Fp+1, pToken, uint64(nToken))
 190137 		}
 190138 
 190139 		if flags&FTS5INDEX_QUERY_PREFIX != 0 {
 190140 			var nChar int32 = fts5IndexCharlen(tls, pToken, nToken)
 190141 			for iIdx = 1; iIdx <= (*Fts5Config)(unsafe.Pointer(pConfig)).FnPrefix; iIdx++ {
 190142 				var nIdxChar int32 = *(*int32)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix + uintptr(iIdx-1)*4))
 190143 				if nIdxChar == nChar {
 190144 					break
 190145 				}
 190146 				if nIdxChar == nChar+1 {
 190147 					iPrefixIdx = iIdx
 190148 				}
 190149 			}
 190150 		}
 190151 
 190152 		if iIdx <= (*Fts5Config)(unsafe.Pointer(pConfig)).FnPrefix {
 190153 			var pStruct uintptr = fts5StructureRead(tls, p)
 190154 			*(*U8)(unsafe.Pointer((*Fts5Buffer)(unsafe.Pointer(bp)).Fp)) = U8('0' + iIdx)
 190155 			if pStruct != 0 {
 190156 				fts5MultiIterNew(tls, p, pStruct, flags|FTS5INDEX_QUERY_SKIPEMPTY,
 190157 					pColset, (*Fts5Buffer)(unsafe.Pointer(bp)).Fp, nToken+1, -1, 0, bp+16)
 190158 				fts5StructureRelease(tls, pStruct)
 190159 			}
 190160 		} else {
 190161 			var bDesc int32 = libc.Bool32(flags&FTS5INDEX_QUERY_DESC != 0)
 190162 			fts5SetupPrefixIter(tls, p, bDesc, iPrefixIdx, (*Fts5Buffer)(unsafe.Pointer(bp)).Fp, nToken+1, pColset, bp+16)
 190163 			if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) {
 190164 			} else {
 190165 				fts5IterSetOutputCb(tls, p+52, *(*uintptr)(unsafe.Pointer(bp + 16)))
 190166 				if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 190167 					var pSeg uintptr = *(*uintptr)(unsafe.Pointer(bp + 16)) + 96 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FaFirst+1*4)).FiFirst)*120
 190168 					if (*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf != 0 {
 190169 						(*struct {
 190170 							f func(*libc.TLS, uintptr, uintptr)
 190171 						})(unsafe.Pointer(&struct{ uintptr }{(*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FxSetOutputs})).f(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), pSeg)
 190172 					}
 190173 				}
 190174 			}
 190175 		}
 190176 
 190177 		if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
 190178 			sqlite3Fts5IterClose(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
 190179 			*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
 190180 			sqlite3Fts5IndexCloseReader(tls, p)
 190181 		}
 190182 
 190183 		*(*uintptr)(unsafe.Pointer(ppIter)) = *(*uintptr)(unsafe.Pointer(bp + 16))
 190184 		sqlite3Fts5BufferFree(tls, bp)
 190185 	}
 190186 	return fts5IndexReturn(tls, p)
 190187 }
 190188 
 190189 func sqlite3Fts5IterNext(tls *libc.TLS, pIndexIter uintptr) int32 {
 190190 	var pIter uintptr = pIndexIter
 190191 
 190192 	fts5MultiIterNext(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pIter, 0, int64(0))
 190193 	return fts5IndexReturn(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex)
 190194 }
 190195 
 190196 func sqlite3Fts5IterNextScan(tls *libc.TLS, pIndexIter uintptr) int32 {
 190197 	var pIter uintptr = pIndexIter
 190198 	var p uintptr = (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex
 190199 
 190200 	fts5MultiIterNext(tls, p, pIter, 0, int64(0))
 190201 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 190202 		var pSeg uintptr = pIter + 96 + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*120
 190203 		if (*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf != 0 && int32(*(*U8)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fp))) != '0' {
 190204 			fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)
 190205 			(*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf = uintptr(0)
 190206 			(*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FbEof = U8(1)
 190207 		}
 190208 	}
 190209 
 190210 	return fts5IndexReturn(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex)
 190211 }
 190212 
 190213 func sqlite3Fts5IterNextFrom(tls *libc.TLS, pIndexIter uintptr, iMatch I64) int32 {
 190214 	var pIter uintptr = pIndexIter
 190215 	fts5MultiIterNextFrom(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pIter, iMatch)
 190216 	return fts5IndexReturn(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex)
 190217 }
 190218 
 190219 func sqlite3Fts5IterTerm(tls *libc.TLS, pIndexIter uintptr, pn uintptr) uintptr {
 190220 	bp := tls.Alloc(4)
 190221 	defer tls.Free(4)
 190222 
 190223 	var z uintptr = fts5MultiIterTerm(tls, pIndexIter, bp)
 190224 
 190225 	*(*int32)(unsafe.Pointer(pn)) = *(*int32)(unsafe.Pointer(bp)) - 1
 190226 	return func() uintptr {
 190227 		if z != 0 {
 190228 			return z + 1
 190229 		}
 190230 		return uintptr(0)
 190231 	}()
 190232 }
 190233 
 190234 func sqlite3Fts5IterClose(tls *libc.TLS, pIndexIter uintptr) {
 190235 	if pIndexIter != 0 {
 190236 		var pIter uintptr = pIndexIter
 190237 		var pIndex uintptr = (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex
 190238 		fts5MultiIterFree(tls, pIter)
 190239 		sqlite3Fts5IndexCloseReader(tls, pIndex)
 190240 	}
 190241 }
 190242 
 190243 func sqlite3Fts5IndexGetAverages(tls *libc.TLS, p uintptr, pnRow uintptr, anSize uintptr) int32 {
 190244 	var nCol int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FnCol
 190245 	var pData uintptr
 190246 
 190247 	*(*I64)(unsafe.Pointer(pnRow)) = int64(0)
 190248 	libc.Xmemset(tls, anSize, 0, uint64(unsafe.Sizeof(I64(0)))*uint64(nCol))
 190249 	pData = fts5DataRead(tls, p, int64(FTS5_AVERAGES_ROWID))
 190250 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Fts5Data)(unsafe.Pointer(pData)).Fnn != 0 {
 190251 		var i int32 = 0
 190252 		var iCol int32
 190253 		i = i + int32(sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp+uintptr(i), pnRow))
 190254 		for iCol = 0; i < (*Fts5Data)(unsafe.Pointer(pData)).Fnn && iCol < nCol; iCol++ {
 190255 			i = i + int32(sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp+uintptr(i), anSize+uintptr(iCol)*8))
 190256 		}
 190257 	}
 190258 
 190259 	fts5DataRelease(tls, pData)
 190260 	return fts5IndexReturn(tls, p)
 190261 }
 190262 
 190263 func sqlite3Fts5IndexSetAverages(tls *libc.TLS, p uintptr, pData uintptr, nData int32) int32 {
 190264 	fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), pData, nData)
 190265 	return fts5IndexReturn(tls, p)
 190266 }
 190267 
 190268 func sqlite3Fts5IndexReads(tls *libc.TLS, p uintptr) int32 {
 190269 	return (*Fts5Index)(unsafe.Pointer(p)).FnRead
 190270 }
 190271 
 190272 func sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) int32 {
 190273 	bp := tls.Alloc(16)
 190274 	defer tls.Free(16)
 190275 
 190276 	var rc int32
 190277 	var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
 190278 
 190279 	*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 190280 
 190281 	sqlite3Fts5Put32(tls, bp, iNew)
 190282 
 190283 	rc = Xsqlite3_blob_open(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl,
 190284 		ts+36252, int64(FTS5_STRUCTURE_ROWID), 1, bp+8)
 190285 	if rc == SQLITE_OK {
 190286 		Xsqlite3_blob_write(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), bp, 4, 0)
 190287 		rc = Xsqlite3_blob_close(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
 190288 	}
 190289 
 190290 	return rc
 190291 }
 190292 
 190293 func sqlite3Fts5IndexLoadConfig(tls *libc.TLS, p uintptr) int32 {
 190294 	var pStruct uintptr
 190295 	pStruct = fts5StructureRead(tls, p)
 190296 	fts5StructureRelease(tls, pStruct)
 190297 	return fts5IndexReturn(tls, p)
 190298 }
 190299 
 190300 func sqlite3Fts5IndexEntryCksum(tls *libc.TLS, iRowid I64, iCol int32, iPos int32, iIdx int32, pTerm uintptr, nTerm int32) U64 {
 190301 	var i int32
 190302 	var ret U64 = U64(iRowid)
 190303 	ret = ret + (ret<<3 + U64(iCol))
 190304 	ret = ret + (ret<<3 + U64(iPos))
 190305 	if iIdx >= 0 {
 190306 		ret = ret + (ret<<3 + U64('0'+iIdx))
 190307 	}
 190308 	for i = 0; i < nTerm; i++ {
 190309 		ret = ret + (ret<<3 + U64(*(*int8)(unsafe.Pointer(pTerm + uintptr(i)))))
 190310 	}
 190311 	return ret
 190312 }
 190313 
 190314 func fts5IndexIntegrityCheckEmpty(tls *libc.TLS, p uintptr, pSeg uintptr, iFirst int32, iNoRowid int32, iLast int32) {
 190315 	var i int32
 190316 
 190317 	for i = iFirst; (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && i <= iLast; i++ {
 190318 		var pLeaf uintptr = fts5DataRead(tls, p, I64((*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B)+int64(0)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B)+int64(0)<<FTS5_DATA_PAGE_B+I64(i))
 190319 		if pLeaf != 0 {
 190320 			if !((*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf >= (*Fts5Data)(unsafe.Pointer(pLeaf)).Fnn) {
 190321 				(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 190322 			}
 190323 			if i >= iNoRowid && 0 != int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp)) {
 190324 				(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 190325 			}
 190326 		}
 190327 		fts5DataRelease(tls, pLeaf)
 190328 	}
 190329 }
 190330 
 190331 func fts5IntegrityCheckPgidx(tls *libc.TLS, p uintptr, pLeaf uintptr) {
 190332 	bp := tls.Alloc(48)
 190333 	defer tls.Free(48)
 190334 
 190335 	var iTermOff int32 = 0
 190336 	var ii int32
 190337 
 190338 	*(*Fts5Buffer)(unsafe.Pointer(bp + 8)) = Fts5Buffer{}
 190339 	*(*Fts5Buffer)(unsafe.Pointer(bp + 32)) = Fts5Buffer{}
 190340 
 190341 	ii = (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf
 190342 	for ii < (*Fts5Data)(unsafe.Pointer(pLeaf)).Fnn && (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 190343 		var res int32
 190344 		var iOff int32
 190345 
 190346 		ii = ii + sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(ii), bp)
 190347 		iTermOff = iTermOff + *(*int32)(unsafe.Pointer(bp))
 190348 		iOff = iTermOff
 190349 
 190350 		if iOff >= (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
 190351 			(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 190352 		} else if iTermOff == *(*int32)(unsafe.Pointer(bp)) {
 190353 			iOff = iOff + sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(iOff), bp+4)
 190354 			if iOff+*(*int32)(unsafe.Pointer(bp + 4)) > (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
 190355 				(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 190356 			} else {
 190357 				sqlite3Fts5BufferSet(tls, p+52, bp+8, *(*int32)(unsafe.Pointer(bp + 4)), (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(iOff))
 190358 			}
 190359 		} else {
 190360 			iOff = iOff + sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(iOff), bp+24)
 190361 			iOff = iOff + sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(iOff), bp+28)
 190362 			if *(*int32)(unsafe.Pointer(bp + 24)) > (*Fts5Buffer)(unsafe.Pointer(bp+8)).Fn || iOff+*(*int32)(unsafe.Pointer(bp + 28)) > (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
 190363 				(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 190364 			} else {
 190365 				(*Fts5Buffer)(unsafe.Pointer(bp + 8)).Fn = *(*int32)(unsafe.Pointer(bp + 24))
 190366 				sqlite3Fts5BufferAppendBlob(tls, p+52, bp+8, uint32(*(*int32)(unsafe.Pointer(bp + 28))), (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(iOff))
 190367 			}
 190368 
 190369 			if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 190370 				res = fts5BufferCompare(tls, bp+8, bp+32)
 190371 				if res <= 0 {
 190372 					(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 190373 				}
 190374 			}
 190375 		}
 190376 		sqlite3Fts5BufferSet(tls, p+52, bp+32, (*Fts5Buffer)(unsafe.Pointer(bp+8)).Fn, (*Fts5Buffer)(unsafe.Pointer(bp+8)).Fp)
 190377 	}
 190378 
 190379 	sqlite3Fts5BufferFree(tls, bp+8)
 190380 	sqlite3Fts5BufferFree(tls, bp+32)
 190381 }
 190382 
 190383 func fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) {
 190384 	bp := tls.Alloc(48)
 190385 	defer tls.Free(48)
 190386 
 190387 	var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
 190388 	*(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0)
 190389 	var rc2 int32
 190390 	var iIdxPrevLeaf int32 = (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst - 1
 190391 	var iDlidxPrevLeaf int32 = (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast
 190392 
 190393 	if (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 {
 190394 		return
 190395 	}
 190396 
 190397 	fts5IndexPrepareStmt(tls, p, bp+24, Xsqlite3_mprintf(tls,
 190398 		ts+36649,
 190399 		libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)))
 190400 
 190401 	for (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 24))) {
 190402 		var iRow I64
 190403 		var pLeaf uintptr
 190404 
 190405 		var zIdxTerm uintptr = Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp + 24)), 1)
 190406 		var nIdxTerm int32 = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 24)), 1)
 190407 		var iIdxLeaf int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 24)), 2)
 190408 		var bIdxDlidx int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 24)), 3)
 190409 
 190410 		if iIdxLeaf < (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst {
 190411 			continue
 190412 		}
 190413 		iRow = I64((*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B) + int64(0)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B) + int64(0)<<FTS5_DATA_PAGE_B + I64(iIdxLeaf)
 190414 		pLeaf = fts5LeafRead(tls, p, iRow)
 190415 		if pLeaf == uintptr(0) {
 190416 			break
 190417 		}
 190418 
 190419 		if (*Fts5Data)(unsafe.Pointer(pLeaf)).Fnn <= (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
 190420 			(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 190421 		} else {
 190422 			var iOff int32
 190423 			var iRowidOff int32
 190424 
 190425 			var res int32
 190426 
 190427 			iOff = fts5LeafFirstTermOff(tls, pLeaf)
 190428 			iRowidOff = int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp))
 190429 			if iRowidOff >= iOff || iOff >= (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
 190430 				(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 190431 			} else {
 190432 				iOff = iOff + sqlite3Fts5GetVarint32(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(iOff), bp+32)
 190433 				res = func() int32 {
 190434 					if func() int32 {
 190435 						if *(*int32)(unsafe.Pointer(bp + 32)) < nIdxTerm {
 190436 							return *(*int32)(unsafe.Pointer(bp + 32))
 190437 						}
 190438 						return nIdxTerm
 190439 					}() <= 0 {
 190440 						return 0
 190441 					}
 190442 					return libc.Xmemcmp(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(iOff), zIdxTerm, func() uint64 {
 190443 						if *(*int32)(unsafe.Pointer(bp + 32)) < nIdxTerm {
 190444 							return uint64(*(*int32)(unsafe.Pointer(bp + 32)))
 190445 						}
 190446 						return uint64(nIdxTerm)
 190447 					}())
 190448 				}()
 190449 				if res == 0 {
 190450 					res = *(*int32)(unsafe.Pointer(bp + 32)) - nIdxTerm
 190451 				}
 190452 				if res < 0 {
 190453 					(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 190454 				}
 190455 			}
 190456 
 190457 			fts5IntegrityCheckPgidx(tls, p, pLeaf)
 190458 		}
 190459 		fts5DataRelease(tls, pLeaf)
 190460 		if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
 190461 			break
 190462 		}
 190463 
 190464 		fts5IndexIntegrityCheckEmpty(tls,
 190465 			p, pSeg, iIdxPrevLeaf+1, iDlidxPrevLeaf+1, iIdxLeaf-1)
 190466 		if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
 190467 			break
 190468 		}
 190469 
 190470 		if bIdxDlidx != 0 {
 190471 			var pDlidx uintptr = uintptr(0)
 190472 			var iPrevLeaf int32 = iIdxLeaf
 190473 			var iSegid int32 = (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid
 190474 			var iPg int32 = 0
 190475 			var iKey I64
 190476 
 190477 			for pDlidx = fts5DlidxIterInit(tls, p, 0, iSegid, iIdxLeaf); fts5DlidxIterEof(tls, p, pDlidx) == 0; fts5DlidxIterNext(tls, p, pDlidx) {
 190478 				for iPg = iPrevLeaf + 1; iPg < fts5DlidxIterPgno(tls, pDlidx); iPg++ {
 190479 					iKey = I64(iSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B) + int64(0)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B) + int64(0)<<FTS5_DATA_PAGE_B + I64(iPg)
 190480 					pLeaf = fts5DataRead(tls, p, iKey)
 190481 					if pLeaf != 0 {
 190482 						if int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp)) != 0 {
 190483 							(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 190484 						}
 190485 						fts5DataRelease(tls, pLeaf)
 190486 					}
 190487 				}
 190488 				iPrevLeaf = fts5DlidxIterPgno(tls, pDlidx)
 190489 
 190490 				iKey = I64(iSegid)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B+FTS5_DATA_DLI_B) + int64(0)<<(FTS5_DATA_PAGE_B+FTS5_DATA_HEIGHT_B) + int64(0)<<FTS5_DATA_PAGE_B + I64(iPrevLeaf)
 190491 				pLeaf = fts5DataRead(tls, p, iKey)
 190492 				if pLeaf != 0 {
 190493 					var iRowidOff int32 = int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp))
 190494 
 190495 					if iRowidOff >= (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
 190496 						(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 190497 					} else {
 190498 						sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr(iRowidOff), bp+40)
 190499 						if *(*I64)(unsafe.Pointer(bp + 40)) != fts5DlidxIterRowid(tls, pDlidx) {
 190500 							(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 190501 						}
 190502 					}
 190503 					fts5DataRelease(tls, pLeaf)
 190504 				}
 190505 			}
 190506 
 190507 			iDlidxPrevLeaf = iPg
 190508 			fts5DlidxIterFree(tls, pDlidx)
 190509 
 190510 		} else {
 190511 			iDlidxPrevLeaf = (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast
 190512 
 190513 		}
 190514 
 190515 		iIdxPrevLeaf = iIdxLeaf
 190516 	}
 190517 
 190518 	rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 24)))
 190519 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK {
 190520 		(*Fts5Index)(unsafe.Pointer(p)).Frc = rc2
 190521 	}
 190522 
 190523 }
 190524 
 190525 func sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum U64, bUseCksum int32) int32 {
 190526 	bp := tls.Alloc(48)
 190527 	defer tls.Free(48)
 190528 
 190529 	var eDetail int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail
 190530 	var cksum2 U64 = uint64(0)
 190531 	*(*Fts5Buffer)(unsafe.Pointer(bp + 16)) = Fts5Buffer{}
 190532 
 190533 	var pStruct uintptr
 190534 	var iLvl int32
 190535 	var iSeg int32
 190536 
 190537 	var flags int32 = FTS5INDEX_QUERY_NOOUTPUT
 190538 
 190539 	pStruct = fts5StructureRead(tls, p)
 190540 	if pStruct == uintptr(0) {
 190541 		return fts5IndexReturn(tls, p)
 190542 	}
 190543 
 190544 	for iLvl = 0; iLvl < (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel; iLvl++ {
 190545 		for iSeg = 0; iSeg < (*Fts5StructureLevel)(unsafe.Pointer(pStruct+24+uintptr(iLvl)*16)).FnSeg; iSeg++ {
 190546 			var pSeg uintptr = (*Fts5StructureLevel)(unsafe.Pointer(pStruct+24+uintptr(iLvl)*16)).FaSeg + uintptr(iSeg)*12
 190547 			fts5IndexIntegrityCheckSegment(tls, p, pSeg)
 190548 		}
 190549 	}
 190550 
 190551 	for fts5MultiIterNew(tls, p, pStruct, flags, uintptr(0), uintptr(0), 0, -1, 0, bp); fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp))) == 0; fts5MultiIterNext(tls, p, *(*uintptr)(unsafe.Pointer(bp)), 0, int64(0)) {
 190552 		*(*I64)(unsafe.Pointer(bp + 40)) = int64(0)
 190553 		*(*int32)(unsafe.Pointer(bp + 32)) = 0
 190554 		var iRowid I64 = fts5MultiIterRowid(tls, *(*uintptr)(unsafe.Pointer(bp)))
 190555 		var z uintptr = fts5MultiIterTerm(tls, *(*uintptr)(unsafe.Pointer(bp)), bp+8)
 190556 
 190557 		if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
 190558 			break
 190559 		}
 190560 
 190561 		if eDetail == FTS5_DETAIL_NONE {
 190562 			if 0 == fts5MultiIterIsEmpty(tls, p, *(*uintptr)(unsafe.Pointer(bp))) {
 190563 				cksum2 = cksum2 ^ sqlite3Fts5IndexEntryCksum(tls, iRowid, 0, 0, -1, z, *(*int32)(unsafe.Pointer(bp + 8)))
 190564 			}
 190565 		} else {
 190566 			(*Fts5Buffer)(unsafe.Pointer(bp + 16)).Fn = 0
 190567 			fts5SegiterPoslist(tls, p, *(*uintptr)(unsafe.Pointer(bp))+96+uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaFirst+1*4)).FiFirst)*120, uintptr(0), bp+16)
 190568 			sqlite3Fts5BufferAppendBlob(tls, p+52, bp+16, uint32(4), ts+36735)
 190569 			for 0 == sqlite3Fts5PoslistNext64(tls, (*Fts5Buffer)(unsafe.Pointer(bp+16)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp+16)).Fn, bp+32, bp+40) {
 190570 				var iCol int32 = int32(*(*I64)(unsafe.Pointer(bp + 40)) >> 32)
 190571 				var iTokOff int32 = int32(*(*I64)(unsafe.Pointer(bp + 40)) & int64(0x7FFFFFFF))
 190572 				cksum2 = cksum2 ^ sqlite3Fts5IndexEntryCksum(tls, iRowid, iCol, iTokOff, -1, z, *(*int32)(unsafe.Pointer(bp + 8)))
 190573 			}
 190574 		}
 190575 	}
 190576 
 190577 	fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp)))
 190578 	if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bUseCksum != 0 && cksum != cksum2 {
 190579 		(*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_CORRUPT | int32(1)<<8
 190580 	}
 190581 
 190582 	fts5StructureRelease(tls, pStruct)
 190583 	sqlite3Fts5BufferFree(tls, bp+16)
 190584 	return fts5IndexReturn(tls, p)
 190585 }
 190586 
 190587 func sqlite3Fts5IndexInit(tls *libc.TLS, db uintptr) int32 {
 190588 	return SQLITE_OK
 190589 	_ = db
 190590 	return int32(0)
 190591 }
 190592 
 190593 func sqlite3Fts5IndexReset(tls *libc.TLS, p uintptr) int32 {
 190594 	if fts5IndexDataVersion(tls, p) != (*Fts5Index)(unsafe.Pointer(p)).FiStructVersion {
 190595 		fts5StructureInvalidate(tls, p)
 190596 	}
 190597 	return fts5IndexReturn(tls, p)
 190598 }
 190599 
 190600 type Fts5Auxdata1 = struct {
 190601 	FpAux    uintptr
 190602 	FpPtr    uintptr
 190603 	FxDelete uintptr
 190604 	FpNext   uintptr
 190605 }
 190606 
 190607 type Fts5Auxdata = Fts5Auxdata1
 190608 type Fts5Auxiliary1 = struct {
 190609 	FpGlobal   uintptr
 190610 	FzFunc     uintptr
 190611 	FpUserData uintptr
 190612 	FxFunc     Fts5_extension_function
 190613 	FxDestroy  uintptr
 190614 	FpNext     uintptr
 190615 }
 190616 
 190617 type Fts5Auxiliary = Fts5Auxiliary1
 190618 type Fts5Cursor1 = struct {
 190619 	Fbase         Sqlite3_vtab_cursor
 190620 	FpNext        uintptr
 190621 	FaColumnSize  uintptr
 190622 	FiCsrId       I64
 190623 	FePlan        int32
 190624 	FbDesc        int32
 190625 	FiFirstRowid  I64
 190626 	FiLastRowid   I64
 190627 	FpStmt        uintptr
 190628 	FpExpr        uintptr
 190629 	FpSorter      uintptr
 190630 	Fcsrflags     int32
 190631 	F__ccgo_pad1  [4]byte
 190632 	FiSpecial     I64
 190633 	FzRank        uintptr
 190634 	FzRankArgs    uintptr
 190635 	FpRank        uintptr
 190636 	FnRankArg     int32
 190637 	F__ccgo_pad2  [4]byte
 190638 	FapRankArg    uintptr
 190639 	FpRankArgStmt uintptr
 190640 	FpAux         uintptr
 190641 	FpAuxdata     uintptr
 190642 	FaInstIter    uintptr
 190643 	FnInstAlloc   int32
 190644 	FnInstCount   int32
 190645 	FaInst        uintptr
 190646 }
 190647 
 190648 type Fts5Cursor = Fts5Cursor1
 190649 type Fts5FullTable1 = struct {
 190650 	Fp        Fts5Table
 190651 	FpStorage uintptr
 190652 	FpGlobal  uintptr
 190653 	FpSortCsr uintptr
 190654 }
 190655 
 190656 type Fts5FullTable = Fts5FullTable1
 190657 type Fts5Sorter1 = struct {
 190658 	FpStmt    uintptr
 190659 	FiRowid   I64
 190660 	FaPoslist uintptr
 190661 	FnIdx     int32
 190662 	FaIdx     [1]int32
 190663 }
 190664 
 190665 type Fts5Sorter = Fts5Sorter1
 190666 type Fts5TokenizerModule1 = struct {
 190667 	FzName     uintptr
 190668 	FpUserData uintptr
 190669 	Fx         Fts5_tokenizer
 190670 	FxDestroy  uintptr
 190671 	FpNext     uintptr
 190672 }
 190673 
 190674 type Fts5TokenizerModule = Fts5TokenizerModule1
 190675 
 190676 // NOTES ON TRANSACTIONS:
 190677 //
 190678 // SQLite invokes the following virtual table methods as transactions are
 190679 // opened and closed by the user:
 190680 //
 190681 //	xBegin():    Start of a new transaction.
 190682 //	xSync():     Initial part of two-phase commit.
 190683 //	xCommit():   Final part of two-phase commit.
 190684 //	xRollback(): Rollback the transaction.
 190685 //
 190686 // Anything that is required as part of a commit that may fail is performed
 190687 // in the xSync() callback. Current versions of SQLite ignore any errors
 190688 // returned by xCommit().
 190689 //
 190690 // And as sub-transactions are opened/closed:
 190691 //
 190692 //	xSavepoint(int S):  Open savepoint S.
 190693 //	xRelease(int S):    Commit and close savepoint S.
 190694 //	xRollbackTo(int S): Rollback to start of savepoint S.
 190695 //
 190696 // During a write-transaction the fts5_index.c module may cache some data
 190697 // in-memory. It is flushed to disk whenever xSync(), xRelease() or
 190698 // xSavepoint() is called. And discarded whenever xRollback() or xRollbackTo()
 190699 // is called.
 190700 //
 190701 // Additionally, if SQLITE_DEBUG is defined, an instance of the following
 190702 // structure is used to record the current transaction state. This information
 190703 // is not required, but it is used in the assert() statements executed by
 190704 // function fts5CheckTransactionState() (see below).
 190705 type Fts5TransactionState = struct {
 190706 	FeState     int32
 190707 	FiSavepoint int32
 190708 }
 190709 
 190710 type Fts5MatchPhrase = struct {
 190711 	FpPoslist    uintptr
 190712 	FnTerm       int32
 190713 	F__ccgo_pad1 [4]byte
 190714 }
 190715 
 190716 func fts5IsContentless(tls *libc.TLS, pTab uintptr) int32 {
 190717 	return libc.Bool32((*Fts5Config)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FeContent == FTS5_CONTENT_NONE)
 190718 }
 190719 
 190720 func fts5FreeVtab(tls *libc.TLS, pTab uintptr) {
 190721 	if pTab != 0 {
 190722 		sqlite3Fts5IndexClose(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)
 190723 		sqlite3Fts5StorageClose(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
 190724 		sqlite3Fts5ConfigFree(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)
 190725 		Xsqlite3_free(tls, pTab)
 190726 	}
 190727 }
 190728 
 190729 func fts5DisconnectMethod(tls *libc.TLS, pVtab uintptr) int32 {
 190730 	fts5FreeVtab(tls, pVtab)
 190731 	return SQLITE_OK
 190732 }
 190733 
 190734 func fts5DestroyMethod(tls *libc.TLS, pVtab uintptr) int32 {
 190735 	var pTab uintptr = pVtab
 190736 	var rc int32 = sqlite3Fts5DropAll(tls, (*Fts5Table)(unsafe.Pointer(pTab)).FpConfig)
 190737 	if rc == SQLITE_OK {
 190738 		fts5FreeVtab(tls, pVtab)
 190739 	}
 190740 	return rc
 190741 }
 190742 
 190743 func fts5InitVtab(tls *libc.TLS, bCreate int32, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVTab uintptr, pzErr uintptr) int32 {
 190744 	bp := tls.Alloc(16)
 190745 	defer tls.Free(16)
 190746 
 190747 	var pGlobal uintptr = pAux
 190748 	var azConfig uintptr = argv
 190749 	*(*int32)(unsafe.Pointer(bp)) = SQLITE_OK
 190750 	*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 190751 	var pTab uintptr = uintptr(0)
 190752 
 190753 	pTab = sqlite3Fts5MallocZero(tls, bp, int64(unsafe.Sizeof(Fts5FullTable{})))
 190754 	if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
 190755 		*(*int32)(unsafe.Pointer(bp)) = sqlite3Fts5ConfigParse(tls, pGlobal, db, argc, azConfig, bp+8, pzErr)
 190756 
 190757 	}
 190758 	if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
 190759 		(*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig = *(*uintptr)(unsafe.Pointer(bp + 8))
 190760 		(*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal = pGlobal
 190761 	}
 190762 
 190763 	if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
 190764 		*(*int32)(unsafe.Pointer(bp)) = sqlite3Fts5IndexOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), bCreate, pTab+32, pzErr)
 190765 	}
 190766 
 190767 	if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
 190768 		*(*int32)(unsafe.Pointer(bp)) = sqlite3Fts5StorageOpen(tls,
 190769 			*(*uintptr)(unsafe.Pointer(bp + 8)), (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex, bCreate, pTab+40, pzErr)
 190770 	}
 190771 
 190772 	if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
 190773 		*(*int32)(unsafe.Pointer(bp)) = sqlite3Fts5ConfigDeclareVtab(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
 190774 	}
 190775 
 190776 	if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
 190777 		(*Fts5Config)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FpzErrmsg = pzErr
 190778 		*(*int32)(unsafe.Pointer(bp)) = sqlite3Fts5IndexLoadConfig(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)
 190779 		sqlite3Fts5IndexRollback(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)
 190780 		(*Fts5Config)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FpzErrmsg = uintptr(0)
 190781 	}
 190782 
 190783 	if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK {
 190784 		fts5FreeVtab(tls, pTab)
 190785 		pTab = uintptr(0)
 190786 	} else if bCreate != 0 {
 190787 	}
 190788 	*(*uintptr)(unsafe.Pointer(ppVTab)) = pTab
 190789 	return *(*int32)(unsafe.Pointer(bp))
 190790 }
 190791 
 190792 func fts5ConnectMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 {
 190793 	return fts5InitVtab(tls, 0, db, pAux, argc, argv, ppVtab, pzErr)
 190794 }
 190795 
 190796 func fts5CreateMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 {
 190797 	return fts5InitVtab(tls, 1, db, pAux, argc, argv, ppVtab, pzErr)
 190798 }
 190799 
 190800 func fts5SetUniqueFlag(tls *libc.TLS, pIdxInfo uintptr) {
 190801 	{
 190802 		*(*int32)(unsafe.Pointer(pIdxInfo + 80)) |= SQLITE_INDEX_SCAN_UNIQUE
 190803 
 190804 	}
 190805 }
 190806 
 190807 func fts5UsePatternMatch(tls *libc.TLS, pConfig uintptr, p uintptr) int32 {
 190808 	if (*Fts5Config)(unsafe.Pointer(pConfig)).FePattern == FTS5_PATTERN_GLOB && int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == FTS5_PATTERN_GLOB {
 190809 		return 1
 190810 	}
 190811 	if (*Fts5Config)(unsafe.Pointer(pConfig)).FePattern == FTS5_PATTERN_LIKE &&
 190812 		(int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == FTS5_PATTERN_LIKE || int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == FTS5_PATTERN_GLOB) {
 190813 		return 1
 190814 	}
 190815 	return 0
 190816 }
 190817 
 190818 func fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 {
 190819 	bp := tls.Alloc(16)
 190820 	defer tls.Free(16)
 190821 
 190822 	var pTab uintptr = pVTab
 190823 	var pConfig uintptr = (*Fts5Table)(unsafe.Pointer(pTab)).FpConfig
 190824 	var nCol int32 = (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol
 190825 	var idxFlags int32 = 0
 190826 	var i int32
 190827 	var idxStr uintptr
 190828 	var iIdxStr int32 = 0
 190829 	var iCons int32 = 0
 190830 
 190831 	var bSeenEq int32 = 0
 190832 	var bSeenGt int32 = 0
 190833 	var bSeenLt int32 = 0
 190834 	var bSeenMatch int32 = 0
 190835 	var bSeenRank int32 = 0
 190836 
 190837 	if (*Fts5Config)(unsafe.Pointer(pConfig)).FbLock != 0 {
 190838 		(*Fts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls,
 190839 			ts+36740, 0)
 190840 		return SQLITE_ERROR
 190841 	}
 190842 
 190843 	idxStr = Xsqlite3_malloc(tls, (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*8+1)
 190844 	if idxStr == uintptr(0) {
 190845 		return SQLITE_NOMEM
 190846 	}
 190847 	(*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FidxStr = idxStr
 190848 	(*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FneedToFreeIdxStr = 1
 190849 
 190850 	for i = 0; i < (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint; i++ {
 190851 		var p uintptr = (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraint + uintptr(i)*12
 190852 		var iCol int32 = (*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn
 190853 		if int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_MATCH ||
 190854 			int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_EQ && iCol >= nCol {
 190855 			if int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable) == 0 || iCol < 0 {
 190856 				(*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = 1e50
 190857 
 190858 				*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr))) = int8(0)
 190859 				return SQLITE_OK
 190860 			} else {
 190861 				if iCol == nCol+1 {
 190862 					if bSeenRank != 0 {
 190863 						continue
 190864 					}
 190865 					*(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = int8('r')
 190866 					bSeenRank = 1
 190867 				} else if iCol >= 0 {
 190868 					bSeenMatch = 1
 190869 					*(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = int8('M')
 190870 					Xsqlite3_snprintf(tls, 6, idxStr+uintptr(iIdxStr), ts+6327, libc.VaList(bp, iCol))
 190871 					idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr)))
 190872 
 190873 				}
 190874 				(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&iCons, 1)
 190875 				(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).Fomit = uint8(1)
 190876 			}
 190877 		} else if (*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0 {
 190878 			if iCol >= 0 && iCol < nCol && fts5UsePatternMatch(tls, pConfig, p) != 0 {
 190879 				*(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = func() int8 {
 190880 					if int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == FTS5_PATTERN_LIKE {
 190881 						return int8('L')
 190882 					}
 190883 					return int8('G')
 190884 				}()
 190885 				Xsqlite3_snprintf(tls, 6, idxStr+uintptr(iIdxStr), ts+6327, libc.VaList(bp+8, iCol))
 190886 				idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr)))
 190887 				(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&iCons, 1)
 190888 
 190889 			} else if bSeenEq == 0 && int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_EQ && iCol < 0 {
 190890 				*(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = int8('=')
 190891 				bSeenEq = 1
 190892 				(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&iCons, 1)
 190893 			}
 190894 		}
 190895 	}
 190896 
 190897 	if bSeenEq == 0 {
 190898 		for i = 0; i < (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint; i++ {
 190899 			var p uintptr = (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraint + uintptr(i)*12
 190900 			if (*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn < 0 && (*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0 {
 190901 				var op int32 = int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop)
 190902 				if op == SQLITE_INDEX_CONSTRAINT_LT || op == SQLITE_INDEX_CONSTRAINT_LE {
 190903 					if bSeenLt != 0 {
 190904 						continue
 190905 					}
 190906 					*(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = int8('<')
 190907 					(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&iCons, 1)
 190908 					bSeenLt = 1
 190909 				} else if op == SQLITE_INDEX_CONSTRAINT_GT || op == SQLITE_INDEX_CONSTRAINT_GE {
 190910 					if bSeenGt != 0 {
 190911 						continue
 190912 					}
 190913 					*(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = int8('>')
 190914 					(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&iCons, 1)
 190915 					bSeenGt = 1
 190916 				}
 190917 			}
 190918 		}
 190919 	}
 190920 	*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr))) = int8(0)
 190921 
 190922 	if (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnOrderBy == 1 {
 190923 		var iSort int32 = (*sqlite3_index_orderby)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaOrderBy)).FiColumn
 190924 		if iSort == (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol+1 && bSeenMatch != 0 {
 190925 			idxFlags = idxFlags | FTS5_BI_ORDER_RANK
 190926 		} else if iSort == -1 {
 190927 			idxFlags = idxFlags | FTS5_BI_ORDER_ROWID
 190928 		}
 190929 		if idxFlags&(FTS5_BI_ORDER_RANK|FTS5_BI_ORDER_ROWID) != 0 {
 190930 			(*Sqlite3_index_info)(unsafe.Pointer(pInfo)).ForderByConsumed = 1
 190931 			if (*sqlite3_index_orderby)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaOrderBy)).Fdesc != 0 {
 190932 				idxFlags = idxFlags | FTS5_BI_ORDER_DESC
 190933 			}
 190934 		}
 190935 	}
 190936 
 190937 	if bSeenEq != 0 {
 190938 		(*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = func() float64 {
 190939 			if bSeenMatch != 0 {
 190940 				return 100.0
 190941 			}
 190942 			return 10.0
 190943 		}()
 190944 		if bSeenMatch == 0 {
 190945 			fts5SetUniqueFlag(tls, pInfo)
 190946 		}
 190947 	} else if bSeenLt != 0 && bSeenGt != 0 {
 190948 		(*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = func() float64 {
 190949 			if bSeenMatch != 0 {
 190950 				return 500.0
 190951 			}
 190952 			return 250000.0
 190953 		}()
 190954 	} else if bSeenLt != 0 || bSeenGt != 0 {
 190955 		(*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = func() float64 {
 190956 			if bSeenMatch != 0 {
 190957 				return 750.0
 190958 			}
 190959 			return 750000.0
 190960 		}()
 190961 	} else {
 190962 		(*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = func() float64 {
 190963 			if bSeenMatch != 0 {
 190964 				return 1000.0
 190965 			}
 190966 			return 1000000.0
 190967 		}()
 190968 	}
 190969 
 190970 	(*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FidxNum = idxFlags
 190971 	return SQLITE_OK
 190972 }
 190973 
 190974 func fts5NewTransaction(tls *libc.TLS, pTab uintptr) int32 {
 190975 	var pCsr uintptr
 190976 	for pCsr = (*Fts5Global)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal)).FpCsr; pCsr != 0; pCsr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpNext {
 190977 		if (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab == pTab {
 190978 			return SQLITE_OK
 190979 		}
 190980 	}
 190981 	return sqlite3Fts5StorageReset(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
 190982 }
 190983 
 190984 func fts5OpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 {
 190985 	var pTab uintptr = pVTab
 190986 	var pConfig uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig
 190987 	var pCsr uintptr = uintptr(0)
 190988 	var nByte Sqlite3_int64
 190989 	var rc int32
 190990 
 190991 	rc = fts5NewTransaction(tls, pTab)
 190992 	if rc == SQLITE_OK {
 190993 		nByte = Sqlite3_int64(uint64(unsafe.Sizeof(Fts5Cursor{})) + uint64((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)*uint64(unsafe.Sizeof(int32(0))))
 190994 		pCsr = Xsqlite3_malloc64(tls, uint64(nByte))
 190995 		if pCsr != 0 {
 190996 			var pGlobal uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal
 190997 			libc.Xmemset(tls, pCsr, 0, Size_t(nByte))
 190998 			(*Fts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize = pCsr + 1*184
 190999 			(*Fts5Cursor)(unsafe.Pointer(pCsr)).FpNext = (*Fts5Global)(unsafe.Pointer(pGlobal)).FpCsr
 191000 			(*Fts5Global)(unsafe.Pointer(pGlobal)).FpCsr = pCsr
 191001 			(*Fts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId = libc.PreIncInt64(&(*Fts5Global)(unsafe.Pointer(pGlobal)).FiNextId, 1)
 191002 		} else {
 191003 			rc = SQLITE_NOMEM
 191004 		}
 191005 	}
 191006 	*(*uintptr)(unsafe.Pointer(ppCsr)) = pCsr
 191007 	return rc
 191008 }
 191009 
 191010 func fts5StmtType(tls *libc.TLS, pCsr uintptr) int32 {
 191011 	if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_SCAN {
 191012 		if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FbDesc != 0 {
 191013 			return FTS5_STMT_SCAN_DESC
 191014 		}
 191015 		return FTS5_STMT_SCAN_ASC
 191016 	}
 191017 	return FTS5_STMT_LOOKUP
 191018 }
 191019 
 191020 func fts5CsrNewrow(tls *libc.TLS, pCsr uintptr) {
 191021 	*(*int32)(unsafe.Pointer(pCsr + 80)) |= FTS5CSR_REQUIRE_CONTENT | FTS5CSR_REQUIRE_DOCSIZE | FTS5CSR_REQUIRE_INST | FTS5CSR_REQUIRE_POSLIST
 191022 }
 191023 
 191024 func fts5FreeCursorComponents(tls *libc.TLS, pCsr uintptr) {
 191025 	var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
 191026 	var pData uintptr
 191027 	var pNext uintptr
 191028 
 191029 	Xsqlite3_free(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInstIter)
 191030 	Xsqlite3_free(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst)
 191031 	if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt != 0 {
 191032 		var eStmt int32 = fts5StmtType(tls, pCsr)
 191033 		sqlite3Fts5StorageStmtRelease(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, eStmt, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt)
 191034 	}
 191035 	if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter != 0 {
 191036 		var pSorter uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter
 191037 		Xsqlite3_finalize(tls, (*Fts5Sorter)(unsafe.Pointer(pSorter)).FpStmt)
 191038 		Xsqlite3_free(tls, pSorter)
 191039 	}
 191040 
 191041 	if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan != FTS5_PLAN_SOURCE {
 191042 		sqlite3Fts5ExprFree(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr)
 191043 	}
 191044 
 191045 	for pData = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAuxdata; pData != 0; pData = pNext {
 191046 		pNext = (*Fts5Auxdata)(unsafe.Pointer(pData)).FpNext
 191047 		if (*Fts5Auxdata)(unsafe.Pointer(pData)).FxDelete != 0 {
 191048 			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Fts5Auxdata)(unsafe.Pointer(pData)).FxDelete})).f(tls, (*Fts5Auxdata)(unsafe.Pointer(pData)).FpPtr)
 191049 		}
 191050 		Xsqlite3_free(tls, pData)
 191051 	}
 191052 
 191053 	Xsqlite3_finalize(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpRankArgStmt)
 191054 	Xsqlite3_free(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FapRankArg)
 191055 
 191056 	if (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fcsrflags&FTS5CSR_FREE_ZRANK != 0 {
 191057 		Xsqlite3_free(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRank)
 191058 		Xsqlite3_free(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs)
 191059 	}
 191060 
 191061 	sqlite3Fts5IndexCloseReader(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)
 191062 	libc.Xmemset(tls, pCsr+32, 0, uint64(unsafe.Sizeof(Fts5Cursor{}))-uint64((int64(pCsr+32)-int64(pCsr))/1))
 191063 }
 191064 
 191065 func fts5CloseMethod(tls *libc.TLS, pCursor uintptr) int32 {
 191066 	if pCursor != 0 {
 191067 		var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab
 191068 		var pCsr uintptr = pCursor
 191069 		var pp uintptr
 191070 
 191071 		fts5FreeCursorComponents(tls, pCsr)
 191072 
 191073 		for pp = (*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal + 72; *(*uintptr)(unsafe.Pointer(pp)) != pCsr; pp = *(*uintptr)(unsafe.Pointer(pp)) + 8 {
 191074 		}
 191075 		*(*uintptr)(unsafe.Pointer(pp)) = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpNext
 191076 
 191077 		Xsqlite3_free(tls, pCsr)
 191078 	}
 191079 	return SQLITE_OK
 191080 }
 191081 
 191082 func fts5SorterNext(tls *libc.TLS, pCsr uintptr) int32 {
 191083 	bp := tls.Alloc(4)
 191084 	defer tls.Free(4)
 191085 
 191086 	var pSorter uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter
 191087 	var rc int32
 191088 
 191089 	rc = Xsqlite3_step(tls, (*Fts5Sorter)(unsafe.Pointer(pSorter)).FpStmt)
 191090 	if rc == SQLITE_DONE {
 191091 		rc = SQLITE_OK
 191092 		*(*int32)(unsafe.Pointer(pCsr + 80)) |= FTS5CSR_EOF | FTS5CSR_REQUIRE_CONTENT
 191093 	} else if rc == SQLITE_ROW {
 191094 		var a uintptr
 191095 		var aBlob uintptr
 191096 		var nBlob int32
 191097 		var i int32
 191098 		var iOff int32 = 0
 191099 		rc = SQLITE_OK
 191100 
 191101 		(*Fts5Sorter)(unsafe.Pointer(pSorter)).FiRowid = Xsqlite3_column_int64(tls, (*Fts5Sorter)(unsafe.Pointer(pSorter)).FpStmt, 0)
 191102 		nBlob = Xsqlite3_column_bytes(tls, (*Fts5Sorter)(unsafe.Pointer(pSorter)).FpStmt, 1)
 191103 		aBlob = libc.AssignUintptr(&a, Xsqlite3_column_blob(tls, (*Fts5Sorter)(unsafe.Pointer(pSorter)).FpStmt, 1))
 191104 
 191105 		if nBlob > 0 {
 191106 			for i = 0; i < (*Fts5Sorter)(unsafe.Pointer(pSorter)).FnIdx-1; i++ {
 191107 				a += uintptr(sqlite3Fts5GetVarint32(tls, a, bp))
 191108 				iOff = iOff + *(*int32)(unsafe.Pointer(bp))
 191109 				*(*int32)(unsafe.Pointer(pSorter + 28 + uintptr(i)*4)) = iOff
 191110 			}
 191111 			*(*int32)(unsafe.Pointer(pSorter + 28 + uintptr(i)*4)) = int32((int64(aBlob+uintptr(nBlob)) - int64(a)) / 1)
 191112 			(*Fts5Sorter)(unsafe.Pointer(pSorter)).FaPoslist = a
 191113 		}
 191114 
 191115 		fts5CsrNewrow(tls, pCsr)
 191116 	}
 191117 
 191118 	return rc
 191119 }
 191120 
 191121 func fts5TripCursors(tls *libc.TLS, pTab uintptr) {
 191122 	var pCsr uintptr
 191123 	for pCsr = (*Fts5Global)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal)).FpCsr; pCsr != 0; pCsr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpNext {
 191124 		if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_MATCH &&
 191125 			(*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab == pTab {
 191126 			*(*int32)(unsafe.Pointer(pCsr + 80)) |= FTS5CSR_REQUIRE_RESEEK
 191127 		}
 191128 	}
 191129 }
 191130 
 191131 func fts5CursorReseek(tls *libc.TLS, pCsr uintptr, pbSkip uintptr) int32 {
 191132 	var rc int32 = SQLITE_OK
 191133 
 191134 	if (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fcsrflags&FTS5CSR_REQUIRE_RESEEK != 0 {
 191135 		var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
 191136 		var bDesc int32 = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FbDesc
 191137 		var iRowid I64 = sqlite3Fts5ExprRowid(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr)
 191138 
 191139 		rc = sqlite3Fts5ExprFirst(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex, iRowid, bDesc)
 191140 		if rc == SQLITE_OK && iRowid != sqlite3Fts5ExprRowid(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) {
 191141 			*(*int32)(unsafe.Pointer(pbSkip)) = 1
 191142 		}
 191143 
 191144 		*(*int32)(unsafe.Pointer(pCsr + 80)) &= libc.CplInt32(FTS5CSR_REQUIRE_RESEEK)
 191145 		fts5CsrNewrow(tls, pCsr)
 191146 		if sqlite3Fts5ExprEof(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) != 0 {
 191147 			*(*int32)(unsafe.Pointer(pCsr + 80)) |= FTS5CSR_EOF
 191148 			*(*int32)(unsafe.Pointer(pbSkip)) = 1
 191149 		}
 191150 	}
 191151 	return rc
 191152 }
 191153 
 191154 func fts5NextMethod(tls *libc.TLS, pCursor uintptr) int32 {
 191155 	bp := tls.Alloc(12)
 191156 	defer tls.Free(12)
 191157 
 191158 	var pCsr uintptr = pCursor
 191159 	var rc int32
 191160 
 191161 	if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan < 3 {
 191162 		*(*int32)(unsafe.Pointer(bp + 8)) = 0
 191163 		if libc.AssignInt32(&rc, fts5CursorReseek(tls, pCsr, bp+8)) != 0 || *(*int32)(unsafe.Pointer(bp + 8)) != 0 {
 191164 			return rc
 191165 		}
 191166 		rc = sqlite3Fts5ExprNext(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid)
 191167 		*(*int32)(unsafe.Pointer(pCsr + 80)) |= sqlite3Fts5ExprEof(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr)
 191168 		fts5CsrNewrow(tls, pCsr)
 191169 	} else {
 191170 		switch (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan {
 191171 		case FTS5_PLAN_SPECIAL:
 191172 			{
 191173 				*(*int32)(unsafe.Pointer(pCsr + 80)) |= FTS5CSR_EOF
 191174 				rc = SQLITE_OK
 191175 				break
 191176 
 191177 			}
 191178 			fallthrough
 191179 
 191180 		case FTS5_PLAN_SORTED_MATCH:
 191181 			{
 191182 				rc = fts5SorterNext(tls, pCsr)
 191183 				break
 191184 
 191185 			}
 191186 			fallthrough
 191187 
 191188 		default:
 191189 			{
 191190 				var pConfig uintptr = (*Fts5Table)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FpConfig
 191191 				(*Fts5Config)(unsafe.Pointer(pConfig)).FbLock++
 191192 				rc = Xsqlite3_step(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt)
 191193 				(*Fts5Config)(unsafe.Pointer(pConfig)).FbLock--
 191194 				if rc != SQLITE_ROW {
 191195 					*(*int32)(unsafe.Pointer(pCsr + 80)) |= FTS5CSR_EOF
 191196 					rc = Xsqlite3_reset(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt)
 191197 					if rc != SQLITE_OK {
 191198 						(*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls,
 191199 							ts+4493, libc.VaList(bp, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb)))
 191200 					}
 191201 				} else {
 191202 					rc = SQLITE_OK
 191203 				}
 191204 				break
 191205 
 191206 			}
 191207 		}
 191208 	}
 191209 
 191210 	return rc
 191211 }
 191212 
 191213 func fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt uintptr, va uintptr) int32 {
 191214 	bp := tls.Alloc(16)
 191215 	defer tls.Free(16)
 191216 
 191217 	*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 191218 	var rc int32
 191219 	var zSql uintptr
 191220 	var ap Va_list
 191221 	_ = ap
 191222 
 191223 	ap = va
 191224 	zSql = Xsqlite3_vmprintf(tls, zFmt, ap)
 191225 	if zSql == uintptr(0) {
 191226 		rc = SQLITE_NOMEM
 191227 	} else {
 191228 		rc = Xsqlite3_prepare_v3(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -1,
 191229 			uint32(SQLITE_PREPARE_PERSISTENT), bp+8, uintptr(0))
 191230 		if rc != SQLITE_OK {
 191231 			*(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb)))
 191232 		}
 191233 		Xsqlite3_free(tls, zSql)
 191234 	}
 191235 
 191236 	_ = ap
 191237 	*(*uintptr)(unsafe.Pointer(ppStmt)) = *(*uintptr)(unsafe.Pointer(bp + 8))
 191238 	return rc
 191239 }
 191240 
 191241 func fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int32) int32 {
 191242 	bp := tls.Alloc(56)
 191243 	defer tls.Free(56)
 191244 
 191245 	var pConfig uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig
 191246 	var pSorter uintptr
 191247 	var nPhrase int32
 191248 	var nByte Sqlite3_int64
 191249 	var rc int32
 191250 	var zRank uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRank
 191251 	var zRankArgs uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs
 191252 
 191253 	nPhrase = sqlite3Fts5ExprPhraseCount(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr)
 191254 	nByte = Sqlite3_int64(uint64(unsafe.Sizeof(Fts5Sorter{})) + uint64(unsafe.Sizeof(int32(0)))*uint64(nPhrase-1))
 191255 	pSorter = Xsqlite3_malloc64(tls, uint64(nByte))
 191256 	if pSorter == uintptr(0) {
 191257 		return SQLITE_NOMEM
 191258 	}
 191259 	libc.Xmemset(tls, pSorter, 0, Size_t(nByte))
 191260 	(*Fts5Sorter)(unsafe.Pointer(pSorter)).FnIdx = nPhrase
 191261 
 191262 	rc = fts5PrepareStatement(tls, pSorter, pConfig,
 191263 		ts+36779,
 191264 		libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName,
 191265 			func() uintptr {
 191266 				if zRankArgs != 0 {
 191267 					return ts + 15971
 191268 				}
 191269 				return ts + 1544
 191270 			}(),
 191271 			func() uintptr {
 191272 				if zRankArgs != 0 {
 191273 					return zRankArgs
 191274 				}
 191275 				return ts + 1544
 191276 			}(),
 191277 			func() uintptr {
 191278 				if bDesc != 0 {
 191279 					return ts + 36834
 191280 				}
 191281 				return ts + 36839
 191282 			}()))
 191283 
 191284 	(*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter = pSorter
 191285 	if rc == SQLITE_OK {
 191286 		(*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr = pCsr
 191287 		rc = fts5SorterNext(tls, pCsr)
 191288 		(*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr = uintptr(0)
 191289 	}
 191290 
 191291 	if rc != SQLITE_OK {
 191292 		Xsqlite3_finalize(tls, (*Fts5Sorter)(unsafe.Pointer(pSorter)).FpStmt)
 191293 		Xsqlite3_free(tls, pSorter)
 191294 		(*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter = uintptr(0)
 191295 	}
 191296 
 191297 	return rc
 191298 }
 191299 
 191300 func fts5CursorFirst(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int32) int32 {
 191301 	var rc int32
 191302 	var pExpr uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr
 191303 	rc = sqlite3Fts5ExprFirst(tls, pExpr, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid, bDesc)
 191304 	if sqlite3Fts5ExprEof(tls, pExpr) != 0 {
 191305 		*(*int32)(unsafe.Pointer(pCsr + 80)) |= FTS5CSR_EOF
 191306 	}
 191307 	fts5CsrNewrow(tls, pCsr)
 191308 	return rc
 191309 }
 191310 
 191311 func fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr) int32 {
 191312 	bp := tls.Alloc(16)
 191313 	defer tls.Free(16)
 191314 
 191315 	var rc int32 = SQLITE_OK
 191316 	var z uintptr = zQuery
 191317 	var n int32
 191318 
 191319 	for int32(*(*int8)(unsafe.Pointer(z))) == ' ' {
 191320 		z++
 191321 	}
 191322 	for n = 0; *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 && int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) != ' '; n++ {
 191323 	}
 191324 
 191325 	(*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan = FTS5_PLAN_SPECIAL
 191326 
 191327 	if n == 5 && 0 == Xsqlite3_strnicmp(tls, ts+36843, z, n) {
 191328 		(*Fts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = I64(sqlite3Fts5IndexReads(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex))
 191329 	} else if n == 2 && 0 == Xsqlite3_strnicmp(tls, ts+6409, z, n) {
 191330 		(*Fts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId
 191331 	} else {
 191332 		(*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, ts+36849, libc.VaList(bp, n, z))
 191333 		rc = SQLITE_ERROR
 191334 	}
 191335 
 191336 	return rc
 191337 }
 191338 
 191339 func fts5FindAuxiliary(tls *libc.TLS, pTab uintptr, zName uintptr) uintptr {
 191340 	var pAux uintptr
 191341 
 191342 	for pAux = (*Fts5Global)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal)).FpAux; pAux != 0; pAux = (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FpNext {
 191343 		if Xsqlite3_stricmp(tls, zName, (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FzFunc) == 0 {
 191344 			return pAux
 191345 		}
 191346 	}
 191347 
 191348 	return uintptr(0)
 191349 }
 191350 
 191351 func fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) int32 {
 191352 	bp := tls.Alloc(32)
 191353 	defer tls.Free(32)
 191354 
 191355 	var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
 191356 	var pConfig uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig
 191357 	*(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_OK
 191358 	var pAux uintptr = uintptr(0)
 191359 	var zRank uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRank
 191360 	var zRankArgs uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs
 191361 
 191362 	if zRankArgs != 0 {
 191363 		var zSql uintptr = sqlite3Fts5Mprintf(tls, bp+16, ts+36877, libc.VaList(bp, zRankArgs))
 191364 		if zSql != 0 {
 191365 			*(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0)
 191366 			*(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_prepare_v3(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -1,
 191367 				uint32(SQLITE_PREPARE_PERSISTENT), bp+24, uintptr(0))
 191368 			Xsqlite3_free(tls, zSql)
 191369 
 191370 			if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
 191371 				if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 24))) {
 191372 					var nByte Sqlite3_int64
 191373 					(*Fts5Cursor)(unsafe.Pointer(pCsr)).FnRankArg = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp + 24)))
 191374 					nByte = Sqlite3_int64(uint64(unsafe.Sizeof(uintptr(0))) * uint64((*Fts5Cursor)(unsafe.Pointer(pCsr)).FnRankArg))
 191375 					(*Fts5Cursor)(unsafe.Pointer(pCsr)).FapRankArg = sqlite3Fts5MallocZero(tls, bp+16, nByte)
 191376 					if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
 191377 						var i int32
 191378 						for i = 0; i < (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnRankArg; i++ {
 191379 							*(*uintptr)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FapRankArg + uintptr(i)*8)) = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp + 24)), i)
 191380 						}
 191381 					}
 191382 					(*Fts5Cursor)(unsafe.Pointer(pCsr)).FpRankArgStmt = *(*uintptr)(unsafe.Pointer(bp + 24))
 191383 				} else {
 191384 					*(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 24)))
 191385 
 191386 				}
 191387 			}
 191388 		}
 191389 	}
 191390 
 191391 	if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
 191392 		pAux = fts5FindAuxiliary(tls, pTab, zRank)
 191393 		if pAux == uintptr(0) {
 191394 			(*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, ts+36887, libc.VaList(bp+8, zRank))
 191395 			*(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_ERROR
 191396 		}
 191397 	}
 191398 
 191399 	(*Fts5Cursor)(unsafe.Pointer(pCsr)).FpRank = pAux
 191400 	return *(*int32)(unsafe.Pointer(bp + 16))
 191401 }
 191402 
 191403 func fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank uintptr) int32 {
 191404 	bp := tls.Alloc(24)
 191405 	defer tls.Free(24)
 191406 
 191407 	var rc int32 = SQLITE_OK
 191408 	if pRank != 0 {
 191409 		var z uintptr = Xsqlite3_value_text(tls, pRank)
 191410 		*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 191411 		*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
 191412 
 191413 		if z == uintptr(0) {
 191414 			if Xsqlite3_value_type(tls, pRank) == SQLITE_NULL {
 191415 				rc = SQLITE_ERROR
 191416 			}
 191417 		} else {
 191418 			rc = sqlite3Fts5ConfigParseRank(tls, z, bp+8, bp+16)
 191419 		}
 191420 		if rc == SQLITE_OK {
 191421 			(*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRank = *(*uintptr)(unsafe.Pointer(bp + 8))
 191422 			(*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = *(*uintptr)(unsafe.Pointer(bp + 16))
 191423 			*(*int32)(unsafe.Pointer(pCsr + 80)) |= FTS5CSR_FREE_ZRANK
 191424 		} else if rc == SQLITE_ERROR {
 191425 			(*Sqlite3_vtab)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls,
 191426 				ts+36908, libc.VaList(bp, z))
 191427 		}
 191428 	} else {
 191429 		if (*Fts5Config)(unsafe.Pointer(pConfig)).FzRank != 0 {
 191430 			(*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRank = (*Fts5Config)(unsafe.Pointer(pConfig)).FzRank
 191431 			(*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = (*Fts5Config)(unsafe.Pointer(pConfig)).FzRankArgs
 191432 		} else {
 191433 			(*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRank = ts + 35291
 191434 			(*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0)
 191435 		}
 191436 	}
 191437 	return rc
 191438 }
 191439 
 191440 func fts5GetRowidLimit(tls *libc.TLS, pVal uintptr, iDefault I64) I64 {
 191441 	if pVal != 0 {
 191442 		var eType int32 = Xsqlite3_value_numeric_type(tls, pVal)
 191443 		if eType == SQLITE_INTEGER {
 191444 			return Xsqlite3_value_int64(tls, pVal)
 191445 		}
 191446 	}
 191447 	return iDefault
 191448 }
 191449 
 191450 func fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, nVal int32, apVal uintptr) int32 {
 191451 	bp := tls.Alloc(16)
 191452 	defer tls.Free(16)
 191453 
 191454 	var pTab uintptr
 191455 	var pConfig uintptr
 191456 	var pCsr uintptr
 191457 	var rc int32
 191458 	var bDesc int32
 191459 	var bOrderByRank int32
 191460 	var pRank uintptr
 191461 	var pRowidEq uintptr
 191462 	var pRowidLe uintptr
 191463 	var pRowidGe uintptr
 191464 	var iCol int32
 191465 	var pzErrmsg uintptr
 191466 	var i int32
 191467 	var iIdxStr int32
 191468 
 191469 	var pzErr uintptr
 191470 	var zText uintptr
 191471 	var bGlob int32
 191472 	var zText1 uintptr
 191473 	pTab = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab
 191474 	pConfig = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig
 191475 	pCsr = pCursor
 191476 	rc = SQLITE_OK
 191477 	pRank = uintptr(0)
 191478 	pRowidEq = uintptr(0)
 191479 	pRowidLe = uintptr(0)
 191480 	pRowidGe = uintptr(0)
 191481 	pzErrmsg = (*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg
 191482 	iIdxStr = 0
 191483 	*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 191484 
 191485 	if !((*Fts5Config)(unsafe.Pointer(pConfig)).FbLock != 0) {
 191486 		goto __1
 191487 	}
 191488 	(*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls,
 191489 		ts+36740, 0)
 191490 	return SQLITE_ERROR
 191491 __1:
 191492 	;
 191493 	if !((*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan != 0) {
 191494 		goto __2
 191495 	}
 191496 	fts5FreeCursorComponents(tls, pCsr)
 191497 	libc.Xmemset(tls, pCsr+32, 0, uint64(unsafe.Sizeof(Fts5Cursor{}))-uint64((int64(pCsr+32)-int64(pCsr))/1))
 191498 __2:
 191499 	;
 191500 	(*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg = pTab + 16
 191501 
 191502 	i = 0
 191503 __3:
 191504 	if !(i < nVal) {
 191505 		goto __5
 191506 	}
 191507 	switch int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1))))) {
 191508 	case 'r':
 191509 		goto __7
 191510 	case 'M':
 191511 		goto __8
 191512 	case 'L':
 191513 		goto __9
 191514 	case 'G':
 191515 		goto __10
 191516 	case '=':
 191517 		goto __11
 191518 	case '<':
 191519 		goto __12
 191520 	default:
 191521 		goto __13
 191522 	}
 191523 	goto __6
 191524 __7:
 191525 	pRank = *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))
 191526 	goto __6
 191527 __8:
 191528 	zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8)))
 191529 	if !(zText == uintptr(0)) {
 191530 		goto __14
 191531 	}
 191532 	zText = ts + 1544
 191533 __14:
 191534 	;
 191535 	iCol = 0
 191536 __15:
 191537 	iCol = iCol*10 + (int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) - '0')
 191538 	iIdxStr++
 191539 	goto __16
 191540 __16:
 191541 	if int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) >= '0' && int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) <= '9' {
 191542 		goto __15
 191543 	}
 191544 	goto __17
 191545 __17:
 191546 	;
 191547 	if !(int32(*(*int8)(unsafe.Pointer(zText))) == '*') {
 191548 		goto __18
 191549 	}
 191550 
 191551 	rc = fts5SpecialMatch(tls, pTab, pCsr, zText+1)
 191552 	goto filter_out
 191553 	goto __19
 191554 __18:
 191555 	pzErr = pTab + 16
 191556 	rc = sqlite3Fts5ExprNew(tls, pConfig, 0, iCol, zText, bp+8, pzErr)
 191557 	if !(rc == SQLITE_OK) {
 191558 		goto __20
 191559 	}
 191560 	rc = sqlite3Fts5ExprAnd(tls, pCsr+64, *(*uintptr)(unsafe.Pointer(bp + 8)))
 191561 	*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 191562 __20:
 191563 	;
 191564 	if !(rc != SQLITE_OK) {
 191565 		goto __21
 191566 	}
 191567 	goto filter_out
 191568 __21:
 191569 	;
 191570 __19:
 191571 	;
 191572 	goto __6
 191573 
 191574 __9:
 191575 __10:
 191576 	bGlob = libc.Bool32(int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr-1)))) == 'G')
 191577 	zText1 = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8)))
 191578 	iCol = 0
 191579 __22:
 191580 	iCol = iCol*10 + (int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) - '0')
 191581 	iIdxStr++
 191582 	goto __23
 191583 __23:
 191584 	if int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) >= '0' && int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) <= '9' {
 191585 		goto __22
 191586 	}
 191587 	goto __24
 191588 __24:
 191589 	;
 191590 	if !(zText1 != 0) {
 191591 		goto __25
 191592 	}
 191593 	rc = sqlite3Fts5ExprPattern(tls, pConfig, bGlob, iCol, zText1, bp+8)
 191594 __25:
 191595 	;
 191596 	if !(rc == SQLITE_OK) {
 191597 		goto __26
 191598 	}
 191599 	rc = sqlite3Fts5ExprAnd(tls, pCsr+64, *(*uintptr)(unsafe.Pointer(bp + 8)))
 191600 	*(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0)
 191601 __26:
 191602 	;
 191603 	if !(rc != SQLITE_OK) {
 191604 		goto __27
 191605 	}
 191606 	goto filter_out
 191607 __27:
 191608 	;
 191609 	goto __6
 191610 
 191611 __11:
 191612 	pRowidEq = *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))
 191613 	goto __6
 191614 __12:
 191615 	pRowidLe = *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))
 191616 	goto __6
 191617 __13:
 191618 	;
 191619 	pRowidGe = *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))
 191620 	goto __6
 191621 __6:
 191622 	;
 191623 	goto __4
 191624 __4:
 191625 	i++
 191626 	goto __3
 191627 	goto __5
 191628 __5:
 191629 	;
 191630 	bOrderByRank = func() int32 {
 191631 		if idxNum&FTS5_BI_ORDER_RANK != 0 {
 191632 			return 1
 191633 		}
 191634 		return 0
 191635 	}()
 191636 	(*Fts5Cursor)(unsafe.Pointer(pCsr)).FbDesc = libc.AssignInt32(&bDesc, func() int32 {
 191637 		if idxNum&FTS5_BI_ORDER_DESC != 0 {
 191638 			return 1
 191639 		}
 191640 		return 0
 191641 	}())
 191642 
 191643 	if !(pRowidEq != 0) {
 191644 		goto __28
 191645 	}
 191646 	pRowidLe = libc.AssignUintptr(&pRowidGe, pRowidEq)
 191647 __28:
 191648 	;
 191649 	if !(bDesc != 0) {
 191650 		goto __29
 191651 	}
 191652 	(*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid = fts5GetRowidLimit(tls, pRowidLe, int64(0xffffffff)|int64(0x7fffffff)<<32)
 191653 	(*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid = fts5GetRowidLimit(tls, pRowidGe, int64(-1)-(int64(0xffffffff)|int64(0x7fffffff)<<32))
 191654 	goto __30
 191655 __29:
 191656 	(*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid = fts5GetRowidLimit(tls, pRowidLe, int64(0xffffffff)|int64(0x7fffffff)<<32)
 191657 	(*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid = fts5GetRowidLimit(tls, pRowidGe, int64(-1)-(int64(0xffffffff)|int64(0x7fffffff)<<32))
 191658 __30:
 191659 	;
 191660 	if !((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr != 0) {
 191661 		goto __31
 191662 	}
 191663 
 191664 	if !((*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FbDesc != 0) {
 191665 		goto __33
 191666 	}
 191667 	(*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid = (*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FiFirstRowid
 191668 	(*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid = (*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FiLastRowid
 191669 	goto __34
 191670 __33:
 191671 	(*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid = (*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FiLastRowid
 191672 	(*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid = (*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FiFirstRowid
 191673 __34:
 191674 	;
 191675 	(*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan = FTS5_PLAN_SOURCE
 191676 	(*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr = (*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FpExpr
 191677 	rc = fts5CursorFirst(tls, pTab, pCsr, bDesc)
 191678 	goto __32
 191679 __31:
 191680 	if !((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr != 0) {
 191681 		goto __35
 191682 	}
 191683 	rc = fts5CursorParseRank(tls, pConfig, pCsr, pRank)
 191684 	if !(rc == SQLITE_OK) {
 191685 		goto __37
 191686 	}
 191687 	if !(bOrderByRank != 0) {
 191688 		goto __38
 191689 	}
 191690 	(*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan = FTS5_PLAN_SORTED_MATCH
 191691 	rc = fts5CursorFirstSorted(tls, pTab, pCsr, bDesc)
 191692 	goto __39
 191693 __38:
 191694 	(*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan = FTS5_PLAN_MATCH
 191695 	rc = fts5CursorFirst(tls, pTab, pCsr, bDesc)
 191696 __39:
 191697 	;
 191698 __37:
 191699 	;
 191700 	goto __36
 191701 __35:
 191702 	if !((*Fts5Config)(unsafe.Pointer(pConfig)).FzContent == uintptr(0)) {
 191703 		goto __40
 191704 	}
 191705 	*(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls,
 191706 		ts+36941, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
 191707 	rc = SQLITE_ERROR
 191708 	goto __41
 191709 __40:
 191710 	(*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan = func() int32 {
 191711 		if pRowidEq != 0 {
 191712 			return FTS5_PLAN_ROWID
 191713 		}
 191714 		return FTS5_PLAN_SCAN
 191715 	}()
 191716 	rc = sqlite3Fts5StorageStmt(tls,
 191717 		(*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, fts5StmtType(tls, pCsr), pCsr+56, pTab+16)
 191718 	if !(rc == SQLITE_OK) {
 191719 		goto __42
 191720 	}
 191721 	if !(pRowidEq != uintptr(0)) {
 191722 		goto __43
 191723 	}
 191724 
 191725 	Xsqlite3_bind_value(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, 1, pRowidEq)
 191726 	goto __44
 191727 __43:
 191728 	Xsqlite3_bind_int64(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, 1, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid)
 191729 	Xsqlite3_bind_int64(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, 2, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid)
 191730 __44:
 191731 	;
 191732 	rc = fts5NextMethod(tls, pCursor)
 191733 __42:
 191734 	;
 191735 __41:
 191736 	;
 191737 __36:
 191738 	;
 191739 __32:
 191740 	;
 191741 filter_out:
 191742 	sqlite3Fts5ExprFree(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
 191743 	(*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg = pzErrmsg
 191744 	return rc
 191745 }
 191746 
 191747 func fts5EofMethod(tls *libc.TLS, pCursor uintptr) int32 {
 191748 	var pCsr uintptr = pCursor
 191749 	return func() int32 {
 191750 		if (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fcsrflags&FTS5CSR_EOF != 0 {
 191751 			return 1
 191752 		}
 191753 		return 0
 191754 	}()
 191755 }
 191756 
 191757 func fts5CursorRowid(tls *libc.TLS, pCsr uintptr) I64 {
 191758 	if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter != 0 {
 191759 		return (*Fts5Sorter)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter)).FiRowid
 191760 	} else {
 191761 		return sqlite3Fts5ExprRowid(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr)
 191762 	}
 191763 	return I64(0)
 191764 }
 191765 
 191766 func fts5RowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 {
 191767 	var pCsr uintptr = pCursor
 191768 	var ePlan int32 = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan
 191769 
 191770 	switch ePlan {
 191771 	case FTS5_PLAN_SPECIAL:
 191772 		*(*Sqlite_int64)(unsafe.Pointer(pRowid)) = int64(0)
 191773 		break
 191774 
 191775 	case FTS5_PLAN_SOURCE:
 191776 		fallthrough
 191777 	case FTS5_PLAN_MATCH:
 191778 		fallthrough
 191779 	case FTS5_PLAN_SORTED_MATCH:
 191780 		*(*Sqlite_int64)(unsafe.Pointer(pRowid)) = fts5CursorRowid(tls, pCsr)
 191781 		break
 191782 
 191783 	default:
 191784 		*(*Sqlite_int64)(unsafe.Pointer(pRowid)) = Xsqlite3_column_int64(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, 0)
 191785 		break
 191786 	}
 191787 
 191788 	return SQLITE_OK
 191789 }
 191790 
 191791 func fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) int32 {
 191792 	bp := tls.Alloc(8)
 191793 	defer tls.Free(8)
 191794 
 191795 	var rc int32 = SQLITE_OK
 191796 
 191797 	if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt == uintptr(0) {
 191798 		var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
 191799 		var eStmt int32 = fts5StmtType(tls, pCsr)
 191800 		rc = sqlite3Fts5StorageStmt(tls,
 191801 			(*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, eStmt, pCsr+56, func() uintptr {
 191802 				if bErrormsg != 0 {
 191803 					return pTab + 16
 191804 				}
 191805 				return uintptr(0)
 191806 			}())
 191807 
 191808 	}
 191809 
 191810 	if rc == SQLITE_OK && (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fcsrflags&FTS5CSR_REQUIRE_CONTENT != 0 {
 191811 		var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
 191812 
 191813 		Xsqlite3_reset(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt)
 191814 		Xsqlite3_bind_int64(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, 1, fts5CursorRowid(tls, pCsr))
 191815 		(*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pTab)).FpConfig)).FbLock++
 191816 		rc = Xsqlite3_step(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt)
 191817 		(*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pTab)).FpConfig)).FbLock--
 191818 		if rc == SQLITE_ROW {
 191819 			rc = SQLITE_OK
 191820 			*(*int32)(unsafe.Pointer(pCsr + 80)) &= libc.CplInt32(FTS5CSR_REQUIRE_CONTENT)
 191821 		} else {
 191822 			rc = Xsqlite3_reset(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt)
 191823 			if rc == SQLITE_OK {
 191824 				rc = SQLITE_CORRUPT | int32(1)<<8
 191825 			} else if (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pTab)).FpConfig)).FpzErrmsg != 0 {
 191826 				*(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pTab)).FpConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls,
 191827 					ts+4493, libc.VaList(bp, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pTab)).FpConfig)).Fdb)))
 191828 			}
 191829 		}
 191830 	}
 191831 	return rc
 191832 }
 191833 
 191834 func fts5SetVtabError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) {
 191835 	var ap Va_list
 191836 	_ = ap
 191837 	ap = va
 191838 
 191839 	(*Fts5FullTable)(unsafe.Pointer(p)).Fp.Fbase.FzErrMsg = Xsqlite3_vmprintf(tls, zFormat, ap)
 191840 	_ = ap
 191841 }
 191842 
 191843 func fts5SpecialInsert(tls *libc.TLS, pTab uintptr, zCmd uintptr, pVal uintptr) int32 {
 191844 	bp := tls.Alloc(4)
 191845 	defer tls.Free(4)
 191846 
 191847 	var pConfig uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig
 191848 	var rc int32 = SQLITE_OK
 191849 	*(*int32)(unsafe.Pointer(bp)) = 0
 191850 
 191851 	if 0 == Xsqlite3_stricmp(tls, ts+36977, zCmd) {
 191852 		if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL {
 191853 			fts5SetVtabError(tls, pTab,
 191854 				ts+36988, 0)
 191855 			rc = SQLITE_ERROR
 191856 		} else {
 191857 			rc = sqlite3Fts5StorageDeleteAll(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
 191858 		}
 191859 	} else if 0 == Xsqlite3_stricmp(tls, ts+37068, zCmd) {
 191860 		if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NONE {
 191861 			fts5SetVtabError(tls, pTab,
 191862 				ts+37076, 0)
 191863 			rc = SQLITE_ERROR
 191864 		} else {
 191865 			rc = sqlite3Fts5StorageRebuild(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
 191866 		}
 191867 	} else if 0 == Xsqlite3_stricmp(tls, ts+18313, zCmd) {
 191868 		rc = sqlite3Fts5StorageOptimize(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
 191869 	} else if 0 == Xsqlite3_stricmp(tls, ts+37132, zCmd) {
 191870 		var nMerge int32 = Xsqlite3_value_int(tls, pVal)
 191871 		rc = sqlite3Fts5StorageMerge(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, nMerge)
 191872 	} else if 0 == Xsqlite3_stricmp(tls, ts+37138, zCmd) {
 191873 		var iArg int32 = Xsqlite3_value_int(tls, pVal)
 191874 		rc = sqlite3Fts5StorageIntegrity(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iArg)
 191875 	} else {
 191876 		rc = sqlite3Fts5IndexLoadConfig(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)
 191877 		if rc == SQLITE_OK {
 191878 			rc = sqlite3Fts5ConfigSetValue(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig, zCmd, pVal, bp)
 191879 		}
 191880 		if rc == SQLITE_OK {
 191881 			if *(*int32)(unsafe.Pointer(bp)) != 0 {
 191882 				rc = SQLITE_ERROR
 191883 			} else {
 191884 				rc = sqlite3Fts5StorageConfigValue(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, zCmd, pVal, 0)
 191885 			}
 191886 		}
 191887 	}
 191888 	return rc
 191889 }
 191890 
 191891 func fts5SpecialDelete(tls *libc.TLS, pTab uintptr, apVal uintptr) int32 {
 191892 	var rc int32 = SQLITE_OK
 191893 	var eType1 int32 = Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*8)))
 191894 	if eType1 == SQLITE_INTEGER {
 191895 		var iDel Sqlite3_int64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*8)))
 191896 		rc = sqlite3Fts5StorageDelete(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iDel, apVal+2*8)
 191897 	}
 191898 	return rc
 191899 }
 191900 
 191901 func fts5StorageInsert(tls *libc.TLS, pRc uintptr, pTab uintptr, apVal uintptr, piRowid uintptr) {
 191902 	var rc int32 = *(*int32)(unsafe.Pointer(pRc))
 191903 	if rc == SQLITE_OK {
 191904 		rc = sqlite3Fts5StorageContentInsert(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, apVal, piRowid)
 191905 	}
 191906 	if rc == SQLITE_OK {
 191907 		rc = sqlite3Fts5StorageIndexInsert(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, apVal, *(*I64)(unsafe.Pointer(piRowid)))
 191908 	}
 191909 	*(*int32)(unsafe.Pointer(pRc)) = rc
 191910 }
 191911 
 191912 func fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, pRowid uintptr) int32 {
 191913 	bp := tls.Alloc(20)
 191914 	defer tls.Free(20)
 191915 
 191916 	var pTab uintptr = pVtab
 191917 	var pConfig uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig
 191918 	var eType0 int32
 191919 	*(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_OK
 191920 
 191921 	(*Fts5Config)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FpzErrmsg = pTab + 16
 191922 
 191923 	fts5TripCursors(tls, pTab)
 191924 
 191925 	eType0 = Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal)))
 191926 	if eType0 == SQLITE_NULL &&
 191927 		Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(2+(*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)*8))) != SQLITE_NULL {
 191928 		var z uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(2+(*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)*8)))
 191929 		if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL &&
 191930 			0 == Xsqlite3_stricmp(tls, ts+18848, z) {
 191931 			*(*int32)(unsafe.Pointer(bp + 16)) = fts5SpecialDelete(tls, pTab, apVal)
 191932 		} else {
 191933 			*(*int32)(unsafe.Pointer(bp + 16)) = fts5SpecialInsert(tls, pTab, z, *(*uintptr)(unsafe.Pointer(apVal + uintptr(2+(*Fts5Config)(unsafe.Pointer(pConfig)).FnCol+1)*8)))
 191934 		}
 191935 	} else {
 191936 		var eConflict int32 = SQLITE_ABORT
 191937 		if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL {
 191938 			eConflict = Xsqlite3_vtab_on_conflict(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb)
 191939 		}
 191940 
 191941 		if eType0 == SQLITE_INTEGER && fts5IsContentless(tls, pTab) != 0 {
 191942 			(*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls,
 191943 				ts+37154,
 191944 				libc.VaList(bp, func() uintptr {
 191945 					if nArg > 1 {
 191946 						return ts + 21845
 191947 					}
 191948 					return ts + 37191
 191949 				}(), (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
 191950 			*(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_ERROR
 191951 		} else if nArg == 1 {
 191952 			var iDel I64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal)))
 191953 			*(*int32)(unsafe.Pointer(bp + 16)) = sqlite3Fts5StorageDelete(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iDel, uintptr(0))
 191954 		} else {
 191955 			var eType1 int32 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*8)))
 191956 
 191957 			if eType1 != SQLITE_INTEGER && eType1 != SQLITE_NULL {
 191958 				*(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_MISMATCH
 191959 			} else if eType0 != SQLITE_INTEGER {
 191960 				if eConflict == SQLITE_REPLACE && eType1 == SQLITE_INTEGER {
 191961 					var iNew I64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*8)))
 191962 					*(*int32)(unsafe.Pointer(bp + 16)) = sqlite3Fts5StorageDelete(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iNew, uintptr(0))
 191963 				}
 191964 				fts5StorageInsert(tls, bp+16, pTab, apVal, pRowid)
 191965 			} else {
 191966 				var iOld I64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal)))
 191967 				var iNew I64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*8)))
 191968 				if eType1 == SQLITE_INTEGER && iOld != iNew {
 191969 					if eConflict == SQLITE_REPLACE {
 191970 						*(*int32)(unsafe.Pointer(bp + 16)) = sqlite3Fts5StorageDelete(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iOld, uintptr(0))
 191971 						if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
 191972 							*(*int32)(unsafe.Pointer(bp + 16)) = sqlite3Fts5StorageDelete(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iNew, uintptr(0))
 191973 						}
 191974 						fts5StorageInsert(tls, bp+16, pTab, apVal, pRowid)
 191975 					} else {
 191976 						*(*int32)(unsafe.Pointer(bp + 16)) = sqlite3Fts5StorageContentInsert(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, apVal, pRowid)
 191977 						if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
 191978 							*(*int32)(unsafe.Pointer(bp + 16)) = sqlite3Fts5StorageDelete(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iOld, uintptr(0))
 191979 						}
 191980 						if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
 191981 							*(*int32)(unsafe.Pointer(bp + 16)) = sqlite3Fts5StorageIndexInsert(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, apVal, *(*Sqlite_int64)(unsafe.Pointer(pRowid)))
 191982 						}
 191983 					}
 191984 				} else {
 191985 					*(*int32)(unsafe.Pointer(bp + 16)) = sqlite3Fts5StorageDelete(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iOld, uintptr(0))
 191986 					fts5StorageInsert(tls, bp+16, pTab, apVal, pRowid)
 191987 				}
 191988 			}
 191989 		}
 191990 	}
 191991 
 191992 	(*Fts5Config)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FpzErrmsg = uintptr(0)
 191993 	return *(*int32)(unsafe.Pointer(bp + 16))
 191994 }
 191995 
 191996 func fts5SyncMethod(tls *libc.TLS, pVtab uintptr) int32 {
 191997 	var rc int32
 191998 	var pTab uintptr = pVtab
 191999 
 192000 	(*Fts5Config)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FpzErrmsg = pTab + 16
 192001 	fts5TripCursors(tls, pTab)
 192002 	rc = sqlite3Fts5StorageSync(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
 192003 	(*Fts5Config)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FpzErrmsg = uintptr(0)
 192004 	return rc
 192005 }
 192006 
 192007 func fts5BeginMethod(tls *libc.TLS, pVtab uintptr) int32 {
 192008 	fts5NewTransaction(tls, pVtab)
 192009 	return SQLITE_OK
 192010 }
 192011 
 192012 func fts5CommitMethod(tls *libc.TLS, pVtab uintptr) int32 {
 192013 	_ = pVtab
 192014 
 192015 	return SQLITE_OK
 192016 }
 192017 
 192018 func fts5RollbackMethod(tls *libc.TLS, pVtab uintptr) int32 {
 192019 	var rc int32
 192020 	var pTab uintptr = pVtab
 192021 
 192022 	rc = sqlite3Fts5StorageRollback(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
 192023 	return rc
 192024 }
 192025 
 192026 func fts5ApiUserData(tls *libc.TLS, pCtx uintptr) uintptr {
 192027 	var pCsr uintptr = pCtx
 192028 	return (*Fts5Auxiliary)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAux)).FpUserData
 192029 }
 192030 
 192031 func fts5ApiColumnCount(tls *libc.TLS, pCtx uintptr) int32 {
 192032 	var pCsr uintptr = pCtx
 192033 	return (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FpConfig)).FnCol
 192034 }
 192035 
 192036 func fts5ApiColumnTotalSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr) int32 {
 192037 	var pCsr uintptr = pCtx
 192038 	var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
 192039 	return sqlite3Fts5StorageSize(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iCol, pnToken)
 192040 }
 192041 
 192042 func fts5ApiRowCount(tls *libc.TLS, pCtx uintptr, pnRow uintptr) int32 {
 192043 	var pCsr uintptr = pCtx
 192044 	var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
 192045 	return sqlite3Fts5StorageRowCount(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, pnRow)
 192046 }
 192047 
 192048 func fts5ApiTokenize(tls *libc.TLS, pCtx uintptr, pText uintptr, nText int32, pUserData uintptr, xToken uintptr) int32 {
 192049 	var pCsr uintptr = pCtx
 192050 	var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
 192051 	return sqlite3Fts5Tokenize(tls,
 192052 		(*Fts5Table)(unsafe.Pointer(pTab)).FpConfig, FTS5_TOKENIZE_AUX, pText, nText, pUserData, xToken)
 192053 }
 192054 
 192055 func fts5ApiPhraseCount(tls *libc.TLS, pCtx uintptr) int32 {
 192056 	var pCsr uintptr = pCtx
 192057 	return sqlite3Fts5ExprPhraseCount(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr)
 192058 }
 192059 
 192060 func fts5ApiPhraseSize(tls *libc.TLS, pCtx uintptr, iPhrase int32) int32 {
 192061 	var pCsr uintptr = pCtx
 192062 	return sqlite3Fts5ExprPhraseSize(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, iPhrase)
 192063 }
 192064 
 192065 func fts5ApiColumnText(tls *libc.TLS, pCtx uintptr, iCol int32, pz uintptr, pn uintptr) int32 {
 192066 	var rc int32 = SQLITE_OK
 192067 	var pCsr uintptr = pCtx
 192068 	if fts5IsContentless(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab) != 0 ||
 192069 		(*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_SPECIAL {
 192070 		*(*uintptr)(unsafe.Pointer(pz)) = uintptr(0)
 192071 		*(*int32)(unsafe.Pointer(pn)) = 0
 192072 	} else {
 192073 		rc = fts5SeekCursor(tls, pCsr, 0)
 192074 		if rc == SQLITE_OK {
 192075 			*(*uintptr)(unsafe.Pointer(pz)) = Xsqlite3_column_text(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, iCol+1)
 192076 			*(*int32)(unsafe.Pointer(pn)) = Xsqlite3_column_bytes(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, iCol+1)
 192077 		}
 192078 	}
 192079 	return rc
 192080 }
 192081 
 192082 func fts5CsrPoslist(tls *libc.TLS, pCsr uintptr, iPhrase int32, pa uintptr, pn uintptr) int32 {
 192083 	bp := tls.Alloc(12)
 192084 	defer tls.Free(12)
 192085 
 192086 	var pConfig uintptr = (*Fts5Table)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FpConfig
 192087 	var rc int32 = SQLITE_OK
 192088 	var bLive int32 = libc.Bool32((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter == uintptr(0))
 192089 
 192090 	if (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fcsrflags&FTS5CSR_REQUIRE_POSLIST != 0 {
 192091 		if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail != FTS5_DETAIL_FULL {
 192092 			var aPopulator uintptr
 192093 			var i int32
 192094 			aPopulator = sqlite3Fts5ExprClearPoslists(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, bLive)
 192095 			if aPopulator == uintptr(0) {
 192096 				rc = SQLITE_NOMEM
 192097 			}
 192098 			for i = 0; i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol && rc == SQLITE_OK; i++ {
 192099 				rc = fts5ApiColumnText(tls, pCsr, i, bp, bp+8)
 192100 				if rc == SQLITE_OK {
 192101 					rc = sqlite3Fts5ExprPopulatePoslists(tls,
 192102 						pConfig, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, aPopulator, i, *(*uintptr)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 8)))
 192103 				}
 192104 			}
 192105 			Xsqlite3_free(tls, aPopulator)
 192106 
 192107 			if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter != 0 {
 192108 				sqlite3Fts5ExprCheckPoslists(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, (*Fts5Sorter)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter)).FiRowid)
 192109 			}
 192110 		}
 192111 		*(*int32)(unsafe.Pointer(pCsr + 80)) &= libc.CplInt32(FTS5CSR_REQUIRE_POSLIST)
 192112 	}
 192113 
 192114 	if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter != 0 && (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_FULL {
 192115 		var pSorter uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter
 192116 		var i1 int32 = func() int32 {
 192117 			if iPhrase == 0 {
 192118 				return 0
 192119 			}
 192120 			return *(*int32)(unsafe.Pointer(pSorter + 28 + uintptr(iPhrase-1)*4))
 192121 		}()
 192122 		*(*int32)(unsafe.Pointer(pn)) = *(*int32)(unsafe.Pointer(pSorter + 28 + uintptr(iPhrase)*4)) - i1
 192123 		*(*uintptr)(unsafe.Pointer(pa)) = (*Fts5Sorter)(unsafe.Pointer(pSorter)).FaPoslist + uintptr(i1)
 192124 	} else {
 192125 		*(*int32)(unsafe.Pointer(pn)) = sqlite3Fts5ExprPoslist(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, iPhrase, pa)
 192126 	}
 192127 
 192128 	return rc
 192129 }
 192130 
 192131 func fts5CacheInstArray(tls *libc.TLS, pCsr uintptr) int32 {
 192132 	bp := tls.Alloc(20)
 192133 	defer tls.Free(20)
 192134 
 192135 	*(*int32)(unsafe.Pointer(bp)) = SQLITE_OK
 192136 	var aIter uintptr
 192137 	var nIter int32
 192138 	var nCol int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FpConfig)).FnCol
 192139 
 192140 	nIter = sqlite3Fts5ExprPhraseCount(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr)
 192141 	if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInstIter == uintptr(0) {
 192142 		var nByte Sqlite3_int64 = Sqlite3_int64(uint64(unsafe.Sizeof(Fts5PoslistReader{})) * uint64(nIter))
 192143 		(*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInstIter = sqlite3Fts5MallocZero(tls, bp, nByte)
 192144 	}
 192145 	aIter = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInstIter
 192146 
 192147 	if aIter != 0 {
 192148 		var nInst int32 = 0
 192149 		var i int32
 192150 
 192151 		for i = 0; i < nIter && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK; i++ {
 192152 			*(*int32)(unsafe.Pointer(bp)) = fts5CsrPoslist(tls, pCsr, i, bp+8, bp+16)
 192153 			if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
 192154 				sqlite3Fts5PoslistReaderInit(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*int32)(unsafe.Pointer(bp + 16)), aIter+uintptr(i)*32)
 192155 			}
 192156 		}
 192157 
 192158 		if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
 192159 			for 1 != 0 {
 192160 				var aInst uintptr
 192161 				var iBest int32 = -1
 192162 				for i = 0; i < nIter; i++ {
 192163 					if int32((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(i)*32)).FbEof) == 0 &&
 192164 						(iBest < 0 || (*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(i)*32)).FiPos < (*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(iBest)*32)).FiPos) {
 192165 						iBest = i
 192166 					}
 192167 				}
 192168 				if iBest < 0 {
 192169 					break
 192170 				}
 192171 
 192172 				nInst++
 192173 				if nInst >= (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstAlloc {
 192174 					var nNewSize int32
 192175 					if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstAlloc != 0 {
 192176 						nNewSize = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstAlloc * 2
 192177 					} else {
 192178 						nNewSize = 32
 192179 					}
 192180 					aInst = Xsqlite3_realloc64(tls,
 192181 						(*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst, uint64(nNewSize)*uint64(unsafe.Sizeof(int32(0)))*uint64(3))
 192182 					if aInst != 0 {
 192183 						(*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst = aInst
 192184 						(*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstAlloc = nNewSize
 192185 					} else {
 192186 						nInst--
 192187 						*(*int32)(unsafe.Pointer(bp)) = SQLITE_NOMEM
 192188 						break
 192189 					}
 192190 				}
 192191 
 192192 				aInst = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst + uintptr(3*(nInst-1))*4
 192193 				*(*int32)(unsafe.Pointer(aInst)) = iBest
 192194 				*(*int32)(unsafe.Pointer(aInst + 1*4)) = int32((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(iBest)*32)).FiPos >> 32)
 192195 				*(*int32)(unsafe.Pointer(aInst + 2*4)) = int32((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(iBest)*32)).FiPos & int64(0x7FFFFFFF))
 192196 				if *(*int32)(unsafe.Pointer(aInst + 1*4)) < 0 || *(*int32)(unsafe.Pointer(aInst + 1*4)) >= nCol {
 192197 					*(*int32)(unsafe.Pointer(bp)) = SQLITE_CORRUPT | int32(1)<<8
 192198 					break
 192199 				}
 192200 				sqlite3Fts5PoslistReaderNext(tls, aIter+uintptr(iBest)*32)
 192201 			}
 192202 		}
 192203 
 192204 		(*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstCount = nInst
 192205 		*(*int32)(unsafe.Pointer(pCsr + 80)) &= libc.CplInt32(FTS5CSR_REQUIRE_INST)
 192206 	}
 192207 	return *(*int32)(unsafe.Pointer(bp))
 192208 }
 192209 
 192210 func fts5ApiInstCount(tls *libc.TLS, pCtx uintptr, pnInst uintptr) int32 {
 192211 	var pCsr uintptr = pCtx
 192212 	var rc int32 = SQLITE_OK
 192213 	if (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fcsrflags&FTS5CSR_REQUIRE_INST == 0 ||
 192214 		SQLITE_OK == libc.AssignInt32(&rc, fts5CacheInstArray(tls, pCsr)) {
 192215 		*(*int32)(unsafe.Pointer(pnInst)) = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstCount
 192216 	}
 192217 	return rc
 192218 }
 192219 
 192220 func fts5ApiInst(tls *libc.TLS, pCtx uintptr, iIdx int32, piPhrase uintptr, piCol uintptr, piOff uintptr) int32 {
 192221 	var pCsr uintptr = pCtx
 192222 	var rc int32 = SQLITE_OK
 192223 	if (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fcsrflags&FTS5CSR_REQUIRE_INST == 0 ||
 192224 		SQLITE_OK == libc.AssignInt32(&rc, fts5CacheInstArray(tls, pCsr)) {
 192225 		if iIdx < 0 || iIdx >= (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstCount {
 192226 			rc = SQLITE_RANGE
 192227 		} else {
 192228 			*(*int32)(unsafe.Pointer(piPhrase)) = *(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst + uintptr(iIdx*3)*4))
 192229 			*(*int32)(unsafe.Pointer(piCol)) = *(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst + uintptr(iIdx*3+1)*4))
 192230 			*(*int32)(unsafe.Pointer(piOff)) = *(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst + uintptr(iIdx*3+2)*4))
 192231 		}
 192232 	}
 192233 	return rc
 192234 }
 192235 
 192236 func fts5ApiRowid(tls *libc.TLS, pCtx uintptr) Sqlite3_int64 {
 192237 	return fts5CursorRowid(tls, pCtx)
 192238 }
 192239 
 192240 func fts5ColumnSizeCb(tls *libc.TLS, pContext uintptr, tflags int32, pUnused uintptr, nUnused int32, iUnused1 int32, iUnused2 int32) int32 {
 192241 	var pCnt uintptr = pContext
 192242 	_ = pUnused
 192243 	_ = nUnused
 192244 	_ = iUnused1
 192245 	_ = iUnused2
 192246 	if tflags&FTS5_TOKEN_COLOCATED == 0 {
 192247 		*(*int32)(unsafe.Pointer(pCnt))++
 192248 	}
 192249 	return SQLITE_OK
 192250 }
 192251 
 192252 func fts5ApiColumnSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr) int32 {
 192253 	bp := tls.Alloc(12)
 192254 	defer tls.Free(12)
 192255 
 192256 	var pCsr uintptr = pCtx
 192257 	var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
 192258 	var pConfig uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig
 192259 	var rc int32 = SQLITE_OK
 192260 
 192261 	if (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fcsrflags&FTS5CSR_REQUIRE_DOCSIZE != 0 {
 192262 		if (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 {
 192263 			var iRowid I64 = fts5CursorRowid(tls, pCsr)
 192264 			rc = sqlite3Fts5StorageDocsize(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iRowid, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize)
 192265 		} else if (*Fts5Config)(unsafe.Pointer(pConfig)).FzContent == uintptr(0) {
 192266 			var i int32
 192267 			for i = 0; i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; i++ {
 192268 				if int32(*(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i)))) == 0 {
 192269 					*(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize + uintptr(i)*4)) = -1
 192270 				}
 192271 			}
 192272 		} else {
 192273 			var i int32
 192274 			for i = 0; rc == SQLITE_OK && i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; i++ {
 192275 				if int32(*(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i)))) == 0 {
 192276 					var p uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize + uintptr(i)*4
 192277 					*(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize + uintptr(i)*4)) = 0
 192278 					rc = fts5ApiColumnText(tls, pCtx, i, bp, bp+8)
 192279 					if rc == SQLITE_OK {
 192280 						rc = sqlite3Fts5Tokenize(tls,
 192281 							pConfig, FTS5_TOKENIZE_AUX, *(*uintptr)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 8)), p, *(*uintptr)(unsafe.Pointer(&struct {
 192282 								f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
 192283 							}{fts5ColumnSizeCb})))
 192284 					}
 192285 				}
 192286 			}
 192287 		}
 192288 		*(*int32)(unsafe.Pointer(pCsr + 80)) &= libc.CplInt32(FTS5CSR_REQUIRE_DOCSIZE)
 192289 	}
 192290 	if iCol < 0 {
 192291 		var i int32
 192292 		*(*int32)(unsafe.Pointer(pnToken)) = 0
 192293 		for i = 0; i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; i++ {
 192294 			*(*int32)(unsafe.Pointer(pnToken)) += *(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize + uintptr(i)*4))
 192295 		}
 192296 	} else if iCol < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol {
 192297 		*(*int32)(unsafe.Pointer(pnToken)) = *(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize + uintptr(iCol)*4))
 192298 	} else {
 192299 		*(*int32)(unsafe.Pointer(pnToken)) = 0
 192300 		rc = SQLITE_RANGE
 192301 	}
 192302 	return rc
 192303 }
 192304 
 192305 func fts5ApiSetAuxdata(tls *libc.TLS, pCtx uintptr, pPtr uintptr, xDelete uintptr) int32 {
 192306 	bp := tls.Alloc(4)
 192307 	defer tls.Free(4)
 192308 
 192309 	var pCsr uintptr = pCtx
 192310 	var pData uintptr
 192311 
 192312 	for pData = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAuxdata; pData != 0; pData = (*Fts5Auxdata)(unsafe.Pointer(pData)).FpNext {
 192313 		if (*Fts5Auxdata)(unsafe.Pointer(pData)).FpAux == (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAux {
 192314 			break
 192315 		}
 192316 	}
 192317 
 192318 	if pData != 0 {
 192319 		if (*Fts5Auxdata)(unsafe.Pointer(pData)).FxDelete != 0 {
 192320 			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Fts5Auxdata)(unsafe.Pointer(pData)).FxDelete})).f(tls, (*Fts5Auxdata)(unsafe.Pointer(pData)).FpPtr)
 192321 		}
 192322 	} else {
 192323 		*(*int32)(unsafe.Pointer(bp)) = SQLITE_OK
 192324 		pData = sqlite3Fts5MallocZero(tls, bp, int64(unsafe.Sizeof(Fts5Auxdata{})))
 192325 		if pData == uintptr(0) {
 192326 			if xDelete != 0 {
 192327 				(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{xDelete})).f(tls, pPtr)
 192328 			}
 192329 			return *(*int32)(unsafe.Pointer(bp))
 192330 		}
 192331 		(*Fts5Auxdata)(unsafe.Pointer(pData)).FpAux = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAux
 192332 		(*Fts5Auxdata)(unsafe.Pointer(pData)).FpNext = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAuxdata
 192333 		(*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAuxdata = pData
 192334 	}
 192335 
 192336 	(*Fts5Auxdata)(unsafe.Pointer(pData)).FxDelete = xDelete
 192337 	(*Fts5Auxdata)(unsafe.Pointer(pData)).FpPtr = pPtr
 192338 	return SQLITE_OK
 192339 }
 192340 
 192341 func fts5ApiGetAuxdata(tls *libc.TLS, pCtx uintptr, bClear int32) uintptr {
 192342 	var pCsr uintptr = pCtx
 192343 	var pData uintptr
 192344 	var pRet uintptr = uintptr(0)
 192345 
 192346 	for pData = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAuxdata; pData != 0; pData = (*Fts5Auxdata)(unsafe.Pointer(pData)).FpNext {
 192347 		if (*Fts5Auxdata)(unsafe.Pointer(pData)).FpAux == (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAux {
 192348 			break
 192349 		}
 192350 	}
 192351 
 192352 	if pData != 0 {
 192353 		pRet = (*Fts5Auxdata)(unsafe.Pointer(pData)).FpPtr
 192354 		if bClear != 0 {
 192355 			(*Fts5Auxdata)(unsafe.Pointer(pData)).FpPtr = uintptr(0)
 192356 			(*Fts5Auxdata)(unsafe.Pointer(pData)).FxDelete = uintptr(0)
 192357 		}
 192358 	}
 192359 
 192360 	return pRet
 192361 }
 192362 
 192363 func fts5ApiPhraseNext(tls *libc.TLS, pUnused uintptr, pIter uintptr, piCol uintptr, piOff uintptr) {
 192364 	bp := tls.Alloc(4)
 192365 	defer tls.Free(4)
 192366 
 192367 	_ = pUnused
 192368 	if (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa >= (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb {
 192369 		*(*int32)(unsafe.Pointer(piCol)) = -1
 192370 		*(*int32)(unsafe.Pointer(piOff)) = -1
 192371 	} else {
 192372 		*(*uintptr)(unsafe.Pointer(pIter)) += uintptr(sqlite3Fts5GetVarint32(tls, (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa, bp))
 192373 		if *(*int32)(unsafe.Pointer(bp)) == 1 {
 192374 			*(*uintptr)(unsafe.Pointer(pIter)) += uintptr(sqlite3Fts5GetVarint32(tls, (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa, bp))
 192375 			*(*int32)(unsafe.Pointer(piCol)) = *(*int32)(unsafe.Pointer(bp))
 192376 			*(*int32)(unsafe.Pointer(piOff)) = 0
 192377 			*(*uintptr)(unsafe.Pointer(pIter)) += uintptr(sqlite3Fts5GetVarint32(tls, (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa, bp))
 192378 		}
 192379 		*(*int32)(unsafe.Pointer(piOff)) += *(*int32)(unsafe.Pointer(bp)) - 2
 192380 	}
 192381 }
 192382 
 192383 func fts5ApiPhraseFirst(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter uintptr, piCol uintptr, piOff uintptr) int32 {
 192384 	bp := tls.Alloc(4)
 192385 	defer tls.Free(4)
 192386 
 192387 	var pCsr uintptr = pCtx
 192388 
 192389 	var rc int32 = fts5CsrPoslist(tls, pCsr, iPhrase, pIter, bp)
 192390 	if rc == SQLITE_OK {
 192391 		(*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb = func() uintptr {
 192392 			if (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa != 0 {
 192393 				return (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp)))
 192394 			}
 192395 			return uintptr(0)
 192396 		}()
 192397 		*(*int32)(unsafe.Pointer(piCol)) = 0
 192398 		*(*int32)(unsafe.Pointer(piOff)) = 0
 192399 		fts5ApiPhraseNext(tls, pCtx, pIter, piCol, piOff)
 192400 	}
 192401 	return rc
 192402 }
 192403 
 192404 func fts5ApiPhraseNextColumn(tls *libc.TLS, pCtx uintptr, pIter uintptr, piCol uintptr) {
 192405 	bp := tls.Alloc(8)
 192406 	defer tls.Free(8)
 192407 
 192408 	var pCsr uintptr = pCtx
 192409 	var pConfig uintptr = (*Fts5Table)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FpConfig
 192410 
 192411 	if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_COLUMNS {
 192412 		if (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa >= (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb {
 192413 			*(*int32)(unsafe.Pointer(piCol)) = -1
 192414 		} else {
 192415 			*(*uintptr)(unsafe.Pointer(pIter)) += uintptr(sqlite3Fts5GetVarint32(tls, (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa, bp))
 192416 			*(*int32)(unsafe.Pointer(piCol)) += *(*int32)(unsafe.Pointer(bp)) - 2
 192417 		}
 192418 	} else {
 192419 		for 1 != 0 {
 192420 			if (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa >= (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb {
 192421 				*(*int32)(unsafe.Pointer(piCol)) = -1
 192422 				return
 192423 			}
 192424 			if int32(*(*uint8)(unsafe.Pointer((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa))) == 0x01 {
 192425 				break
 192426 			}
 192427 			*(*uintptr)(unsafe.Pointer(pIter)) += uintptr(sqlite3Fts5GetVarint32(tls, (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa, bp+4))
 192428 		}
 192429 		*(*uintptr)(unsafe.Pointer(pIter)) += uintptr(1 + sqlite3Fts5GetVarint32(tls, (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa+1, piCol))
 192430 	}
 192431 }
 192432 
 192433 func fts5ApiPhraseFirstColumn(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter uintptr, piCol uintptr) int32 {
 192434 	bp := tls.Alloc(8)
 192435 	defer tls.Free(8)
 192436 
 192437 	var rc int32 = SQLITE_OK
 192438 	var pCsr uintptr = pCtx
 192439 	var pConfig uintptr = (*Fts5Table)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FpConfig
 192440 
 192441 	if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_COLUMNS {
 192442 		var pSorter uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter
 192443 
 192444 		if pSorter != 0 {
 192445 			var i1 int32 = func() int32 {
 192446 				if iPhrase == 0 {
 192447 					return 0
 192448 				}
 192449 				return *(*int32)(unsafe.Pointer(pSorter + 28 + uintptr(iPhrase-1)*4))
 192450 			}()
 192451 			*(*int32)(unsafe.Pointer(bp)) = *(*int32)(unsafe.Pointer(pSorter + 28 + uintptr(iPhrase)*4)) - i1
 192452 			(*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa = (*Fts5Sorter)(unsafe.Pointer(pSorter)).FaPoslist + uintptr(i1)
 192453 		} else {
 192454 			rc = sqlite3Fts5ExprPhraseCollist(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, iPhrase, pIter, bp)
 192455 		}
 192456 		if rc == SQLITE_OK {
 192457 			(*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb = func() uintptr {
 192458 				if (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa != 0 {
 192459 					return (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp)))
 192460 				}
 192461 				return uintptr(0)
 192462 			}()
 192463 			*(*int32)(unsafe.Pointer(piCol)) = 0
 192464 			fts5ApiPhraseNextColumn(tls, pCtx, pIter, piCol)
 192465 		}
 192466 	} else {
 192467 		rc = fts5CsrPoslist(tls, pCsr, iPhrase, pIter, bp+4)
 192468 		if rc == SQLITE_OK {
 192469 			(*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb = func() uintptr {
 192470 				if (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa != 0 {
 192471 					return (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp + 4)))
 192472 				}
 192473 				return uintptr(0)
 192474 			}()
 192475 			if *(*int32)(unsafe.Pointer(bp + 4)) <= 0 {
 192476 				*(*int32)(unsafe.Pointer(piCol)) = -1
 192477 			} else if int32(*(*uint8)(unsafe.Pointer((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa))) == 0x01 {
 192478 				*(*uintptr)(unsafe.Pointer(pIter)) += uintptr(1 + sqlite3Fts5GetVarint32(tls, (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa+1, piCol))
 192479 			} else {
 192480 				*(*int32)(unsafe.Pointer(piCol)) = 0
 192481 			}
 192482 		}
 192483 	}
 192484 
 192485 	return rc
 192486 }
 192487 
 192488 var sFts5Api = Fts5ExtensionApi{
 192489 	FiVersion:           2,
 192490 	FxUserData:          0,
 192491 	FxColumnCount:       0,
 192492 	FxRowCount:          0,
 192493 	FxColumnTotalSize:   0,
 192494 	FxTokenize:          0,
 192495 	FxPhraseCount:       0,
 192496 	FxPhraseSize:        0,
 192497 	FxInstCount:         0,
 192498 	FxInst:              0,
 192499 	FxRowid:             0,
 192500 	FxColumnText:        0,
 192501 	FxColumnSize:        0,
 192502 	FxQueryPhrase:       0,
 192503 	FxSetAuxdata:        0,
 192504 	FxGetAuxdata:        0,
 192505 	FxPhraseFirst:       0,
 192506 	FxPhraseNext:        0,
 192507 	FxPhraseFirstColumn: 0,
 192508 	FxPhraseNextColumn:  0,
 192509 }
 192510 
 192511 func fts5ApiQueryPhrase(tls *libc.TLS, pCtx uintptr, iPhrase int32, pUserData uintptr, xCallback uintptr) int32 {
 192512 	bp := tls.Alloc(8)
 192513 	defer tls.Free(8)
 192514 
 192515 	var pCsr uintptr = pCtx
 192516 	var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
 192517 	var rc int32
 192518 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 192519 
 192520 	rc = fts5OpenMethod(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab, bp)
 192521 	if rc == SQLITE_OK {
 192522 		(*Fts5Cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FePlan = FTS5_PLAN_MATCH
 192523 		(*Fts5Cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FiFirstRowid = int64(-1) - (int64(0xffffffff) | int64(0x7fffffff)<<32)
 192524 		(*Fts5Cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FiLastRowid = int64(0xffffffff) | int64(0x7fffffff)<<32
 192525 		(*Fts5Cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FpVtab = pTab
 192526 		rc = sqlite3Fts5ExprClonePhrase(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, iPhrase, *(*uintptr)(unsafe.Pointer(bp))+64)
 192527 	}
 192528 
 192529 	if rc == SQLITE_OK {
 192530 		for rc = fts5CursorFirst(tls, pTab, *(*uintptr)(unsafe.Pointer(bp)), 0); rc == SQLITE_OK && (*Fts5Cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fcsrflags&FTS5CSR_EOF == 0; rc = fts5NextMethod(tls, *(*uintptr)(unsafe.Pointer(bp))) {
 192531 			rc = (*struct {
 192532 				f func(*libc.TLS, uintptr, uintptr, uintptr) int32
 192533 			})(unsafe.Pointer(&struct{ uintptr }{xCallback})).f(tls, uintptr(unsafe.Pointer(&sFts5Api)), *(*uintptr)(unsafe.Pointer(bp)), pUserData)
 192534 			if rc != SQLITE_OK {
 192535 				if rc == SQLITE_DONE {
 192536 					rc = SQLITE_OK
 192537 				}
 192538 				break
 192539 			}
 192540 		}
 192541 	}
 192542 
 192543 	fts5CloseMethod(tls, *(*uintptr)(unsafe.Pointer(bp)))
 192544 	return rc
 192545 }
 192546 
 192547 func fts5ApiInvoke(tls *libc.TLS, pAux uintptr, pCsr uintptr, context uintptr, argc int32, argv uintptr) {
 192548 	(*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAux = pAux
 192549 	(*struct {
 192550 		f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr)
 192551 	})(unsafe.Pointer(&struct{ uintptr }{(*Fts5Auxiliary)(unsafe.Pointer(pAux)).FxFunc})).f(tls, uintptr(unsafe.Pointer(&sFts5Api)), pCsr, context, argc, argv)
 192552 	(*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAux = uintptr(0)
 192553 }
 192554 
 192555 func fts5CursorFromCsrid(tls *libc.TLS, pGlobal uintptr, iCsrId I64) uintptr {
 192556 	var pCsr uintptr
 192557 	for pCsr = (*Fts5Global)(unsafe.Pointer(pGlobal)).FpCsr; pCsr != 0; pCsr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpNext {
 192558 		if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId == iCsrId {
 192559 			break
 192560 		}
 192561 	}
 192562 	return pCsr
 192563 }
 192564 
 192565 func fts5ApiCallback(tls *libc.TLS, context uintptr, argc int32, argv uintptr) {
 192566 	bp := tls.Alloc(8)
 192567 	defer tls.Free(8)
 192568 
 192569 	var pAux uintptr
 192570 	var pCsr uintptr
 192571 	var iCsrId I64
 192572 
 192573 	pAux = Xsqlite3_user_data(tls, context)
 192574 	iCsrId = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv)))
 192575 
 192576 	pCsr = fts5CursorFromCsrid(tls, (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FpGlobal, iCsrId)
 192577 	if pCsr == uintptr(0) || (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == 0 {
 192578 		var zErr uintptr = Xsqlite3_mprintf(tls, ts+37203, libc.VaList(bp, iCsrId))
 192579 		Xsqlite3_result_error(tls, context, zErr, -1)
 192580 		Xsqlite3_free(tls, zErr)
 192581 	} else {
 192582 		fts5ApiInvoke(tls, pAux, pCsr, context, argc-1, argv+1*8)
 192583 	}
 192584 }
 192585 
 192586 func sqlite3Fts5TableFromCsrid(tls *libc.TLS, pGlobal uintptr, iCsrId I64) uintptr {
 192587 	var pCsr uintptr
 192588 	pCsr = fts5CursorFromCsrid(tls, pGlobal, iCsrId)
 192589 	if pCsr != 0 {
 192590 		return (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
 192591 	}
 192592 	return uintptr(0)
 192593 }
 192594 
 192595 func fts5PoslistBlob(tls *libc.TLS, pCtx uintptr, pCsr uintptr) int32 {
 192596 	bp := tls.Alloc(68)
 192597 	defer tls.Free(68)
 192598 
 192599 	var i int32
 192600 	*(*int32)(unsafe.Pointer(bp + 24)) = SQLITE_OK
 192601 	var nPhrase int32 = sqlite3Fts5ExprPhraseCount(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr)
 192602 
 192603 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Fts5Buffer{})))
 192604 	switch (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FpConfig)).FeDetail {
 192605 	case FTS5_DETAIL_FULL:
 192606 		for i = 0; i < nPhrase-1; i++ {
 192607 			var nByte int32 = sqlite3Fts5ExprPoslist(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, i, bp+16)
 192608 			sqlite3Fts5BufferAppendVarint(tls, bp+24, bp, int64(nByte))
 192609 		}
 192610 
 192611 		for i = 0; i < nPhrase; i++ {
 192612 			var nPoslist int32
 192613 			nPoslist = sqlite3Fts5ExprPoslist(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, i, bp+32)
 192614 			sqlite3Fts5BufferAppendBlob(tls, bp+24, bp, uint32(nPoslist), *(*uintptr)(unsafe.Pointer(bp + 32)))
 192615 		}
 192616 		break
 192617 
 192618 	case FTS5_DETAIL_COLUMNS:
 192619 		for i = 0; *(*int32)(unsafe.Pointer(bp + 24)) == SQLITE_OK && i < nPhrase-1; i++ {
 192620 			*(*int32)(unsafe.Pointer(bp + 24)) = sqlite3Fts5ExprPhraseCollist(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, i, bp+40, bp+48)
 192621 			sqlite3Fts5BufferAppendVarint(tls, bp+24, bp, int64(*(*int32)(unsafe.Pointer(bp + 48))))
 192622 		}
 192623 
 192624 		for i = 0; *(*int32)(unsafe.Pointer(bp + 24)) == SQLITE_OK && i < nPhrase; i++ {
 192625 			*(*int32)(unsafe.Pointer(bp + 24)) = sqlite3Fts5ExprPhraseCollist(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, i, bp+56, bp+64)
 192626 			sqlite3Fts5BufferAppendBlob(tls, bp+24, bp, uint32(*(*int32)(unsafe.Pointer(bp + 64))), *(*uintptr)(unsafe.Pointer(bp + 56)))
 192627 		}
 192628 		break
 192629 
 192630 	default:
 192631 		break
 192632 	}
 192633 
 192634 	Xsqlite3_result_blob(tls, pCtx, (*Fts5Buffer)(unsafe.Pointer(bp)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp)).Fn, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
 192635 	return *(*int32)(unsafe.Pointer(bp + 24))
 192636 }
 192637 
 192638 func fts5ColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32) int32 {
 192639 	var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab
 192640 	var pConfig uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig
 192641 	var pCsr uintptr = pCursor
 192642 	var rc int32 = SQLITE_OK
 192643 
 192644 	if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_SPECIAL {
 192645 		if iCol == (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol {
 192646 			Xsqlite3_result_int64(tls, pCtx, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial)
 192647 		}
 192648 	} else if iCol == (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol {
 192649 		Xsqlite3_result_int64(tls, pCtx, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId)
 192650 	} else if iCol == (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol+1 {
 192651 		if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_SOURCE {
 192652 			fts5PoslistBlob(tls, pCtx, pCsr)
 192653 		} else if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_MATCH ||
 192654 			(*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_SORTED_MATCH {
 192655 			if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpRank != 0 || SQLITE_OK == libc.AssignInt32(&rc, fts5FindRankFunction(tls, pCsr)) {
 192656 				fts5ApiInvoke(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpRank, pCsr, pCtx, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnRankArg, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FapRankArg)
 192657 			}
 192658 		}
 192659 	} else if !(fts5IsContentless(tls, pTab) != 0) {
 192660 		(*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg = pTab + 16
 192661 		rc = fts5SeekCursor(tls, pCsr, 1)
 192662 		if rc == SQLITE_OK {
 192663 			Xsqlite3_result_value(tls, pCtx, Xsqlite3_column_value(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, iCol+1))
 192664 		}
 192665 		(*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg = uintptr(0)
 192666 	}
 192667 	return rc
 192668 }
 192669 
 192670 func fts5FindFunctionMethod(tls *libc.TLS, pVtab uintptr, nUnused int32, zName uintptr, pxFunc uintptr, ppArg uintptr) int32 {
 192671 	var pTab uintptr = pVtab
 192672 	var pAux uintptr
 192673 
 192674 	_ = nUnused
 192675 	pAux = fts5FindAuxiliary(tls, pTab, zName)
 192676 	if pAux != 0 {
 192677 		*(*uintptr)(unsafe.Pointer(pxFunc)) = *(*uintptr)(unsafe.Pointer(&struct {
 192678 			f func(*libc.TLS, uintptr, int32, uintptr)
 192679 		}{fts5ApiCallback}))
 192680 		*(*uintptr)(unsafe.Pointer(ppArg)) = pAux
 192681 		return 1
 192682 	}
 192683 
 192684 	return 0
 192685 }
 192686 
 192687 func fts5RenameMethod(tls *libc.TLS, pVtab uintptr, zName uintptr) int32 {
 192688 	var pTab uintptr = pVtab
 192689 	return sqlite3Fts5StorageRename(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, zName)
 192690 }
 192691 
 192692 func sqlite3Fts5FlushToDisk(tls *libc.TLS, pTab uintptr) int32 {
 192693 	fts5TripCursors(tls, pTab)
 192694 	return sqlite3Fts5StorageSync(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
 192695 }
 192696 
 192697 func fts5SavepointMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 {
 192698 	_ = iSavepoint
 192699 
 192700 	return sqlite3Fts5FlushToDisk(tls, pVtab)
 192701 }
 192702 
 192703 func fts5ReleaseMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 {
 192704 	_ = iSavepoint
 192705 
 192706 	return sqlite3Fts5FlushToDisk(tls, pVtab)
 192707 }
 192708 
 192709 func fts5RollbackToMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 {
 192710 	var pTab uintptr = pVtab
 192711 	_ = iSavepoint
 192712 
 192713 	fts5TripCursors(tls, pTab)
 192714 	return sqlite3Fts5StorageRollback(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
 192715 }
 192716 
 192717 func fts5CreateAux(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr, xFunc Fts5_extension_function, xDestroy uintptr) int32 {
 192718 	var pGlobal uintptr = pApi
 192719 	var rc int32 = Xsqlite3_overload_function(tls, (*Fts5Global)(unsafe.Pointer(pGlobal)).Fdb, zName, -1)
 192720 	if rc == SQLITE_OK {
 192721 		var pAux uintptr
 192722 		var nName Sqlite3_int64
 192723 		var nByte Sqlite3_int64
 192724 
 192725 		nName = Sqlite3_int64(libc.Xstrlen(tls, zName) + uint64(1))
 192726 		nByte = Sqlite3_int64(uint64(unsafe.Sizeof(Fts5Auxiliary{})) + uint64(nName))
 192727 		pAux = Xsqlite3_malloc64(tls, uint64(nByte))
 192728 		if pAux != 0 {
 192729 			libc.Xmemset(tls, pAux, 0, Size_t(nByte))
 192730 			(*Fts5Auxiliary)(unsafe.Pointer(pAux)).FzFunc = pAux + 1*48
 192731 			libc.Xmemcpy(tls, (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FzFunc, zName, uint64(nName))
 192732 			(*Fts5Auxiliary)(unsafe.Pointer(pAux)).FpGlobal = pGlobal
 192733 			(*Fts5Auxiliary)(unsafe.Pointer(pAux)).FpUserData = pUserData
 192734 			(*Fts5Auxiliary)(unsafe.Pointer(pAux)).FxFunc = xFunc
 192735 			(*Fts5Auxiliary)(unsafe.Pointer(pAux)).FxDestroy = xDestroy
 192736 			(*Fts5Auxiliary)(unsafe.Pointer(pAux)).FpNext = (*Fts5Global)(unsafe.Pointer(pGlobal)).FpAux
 192737 			(*Fts5Global)(unsafe.Pointer(pGlobal)).FpAux = pAux
 192738 		} else {
 192739 			rc = SQLITE_NOMEM
 192740 		}
 192741 	}
 192742 
 192743 	return rc
 192744 }
 192745 
 192746 func fts5CreateTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr, pTokenizer uintptr, xDestroy uintptr) int32 {
 192747 	var pGlobal uintptr = pApi
 192748 	var pNew uintptr
 192749 	var nName Sqlite3_int64
 192750 	var nByte Sqlite3_int64
 192751 	var rc int32 = SQLITE_OK
 192752 
 192753 	nName = Sqlite3_int64(libc.Xstrlen(tls, zName) + uint64(1))
 192754 	nByte = Sqlite3_int64(uint64(unsafe.Sizeof(Fts5TokenizerModule{})) + uint64(nName))
 192755 	pNew = Xsqlite3_malloc64(tls, uint64(nByte))
 192756 	if pNew != 0 {
 192757 		libc.Xmemset(tls, pNew, 0, Size_t(nByte))
 192758 		(*Fts5TokenizerModule)(unsafe.Pointer(pNew)).FzName = pNew + 1*56
 192759 		libc.Xmemcpy(tls, (*Fts5TokenizerModule)(unsafe.Pointer(pNew)).FzName, zName, uint64(nName))
 192760 		(*Fts5TokenizerModule)(unsafe.Pointer(pNew)).FpUserData = pUserData
 192761 		(*Fts5TokenizerModule)(unsafe.Pointer(pNew)).Fx = *(*Fts5_tokenizer)(unsafe.Pointer(pTokenizer))
 192762 		(*Fts5TokenizerModule)(unsafe.Pointer(pNew)).FxDestroy = xDestroy
 192763 		(*Fts5TokenizerModule)(unsafe.Pointer(pNew)).FpNext = (*Fts5Global)(unsafe.Pointer(pGlobal)).FpTok
 192764 		(*Fts5Global)(unsafe.Pointer(pGlobal)).FpTok = pNew
 192765 		if (*Fts5TokenizerModule)(unsafe.Pointer(pNew)).FpNext == uintptr(0) {
 192766 			(*Fts5Global)(unsafe.Pointer(pGlobal)).FpDfltTok = pNew
 192767 		}
 192768 	} else {
 192769 		rc = SQLITE_NOMEM
 192770 	}
 192771 
 192772 	return rc
 192773 }
 192774 
 192775 func fts5LocateTokenizer(tls *libc.TLS, pGlobal uintptr, zName uintptr) uintptr {
 192776 	var pMod uintptr = uintptr(0)
 192777 
 192778 	if zName == uintptr(0) {
 192779 		pMod = (*Fts5Global)(unsafe.Pointer(pGlobal)).FpDfltTok
 192780 	} else {
 192781 		for pMod = (*Fts5Global)(unsafe.Pointer(pGlobal)).FpTok; pMod != 0; pMod = (*Fts5TokenizerModule)(unsafe.Pointer(pMod)).FpNext {
 192782 			if Xsqlite3_stricmp(tls, zName, (*Fts5TokenizerModule)(unsafe.Pointer(pMod)).FzName) == 0 {
 192783 				break
 192784 			}
 192785 		}
 192786 	}
 192787 
 192788 	return pMod
 192789 }
 192790 
 192791 func fts5FindTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, ppUserData uintptr, pTokenizer uintptr) int32 {
 192792 	var rc int32 = SQLITE_OK
 192793 	var pMod uintptr
 192794 
 192795 	pMod = fts5LocateTokenizer(tls, pApi, zName)
 192796 	if pMod != 0 {
 192797 		*(*Fts5_tokenizer)(unsafe.Pointer(pTokenizer)) = (*Fts5TokenizerModule)(unsafe.Pointer(pMod)).Fx
 192798 		*(*uintptr)(unsafe.Pointer(ppUserData)) = (*Fts5TokenizerModule)(unsafe.Pointer(pMod)).FpUserData
 192799 	} else {
 192800 		libc.Xmemset(tls, pTokenizer, 0, uint64(unsafe.Sizeof(Fts5_tokenizer{})))
 192801 		rc = SQLITE_ERROR
 192802 	}
 192803 
 192804 	return rc
 192805 }
 192806 
 192807 func sqlite3Fts5GetTokenizer(tls *libc.TLS, pGlobal uintptr, azArg uintptr, nArg int32, pConfig uintptr, pzErr uintptr) int32 {
 192808 	bp := tls.Alloc(8)
 192809 	defer tls.Free(8)
 192810 
 192811 	var pMod uintptr
 192812 	var rc int32 = SQLITE_OK
 192813 
 192814 	pMod = fts5LocateTokenizer(tls, pGlobal, func() uintptr {
 192815 		if nArg == 0 {
 192816 			return uintptr(0)
 192817 		}
 192818 		return *(*uintptr)(unsafe.Pointer(azArg))
 192819 	}())
 192820 	if pMod == uintptr(0) {
 192821 		rc = SQLITE_ERROR
 192822 		*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+37224, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(azArg))))
 192823 	} else {
 192824 		rc = (*struct {
 192825 			f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
 192826 		})(unsafe.Pointer(&struct{ uintptr }{(*Fts5TokenizerModule)(unsafe.Pointer(pMod)).Fx.FxCreate})).f(tls,
 192827 			(*Fts5TokenizerModule)(unsafe.Pointer(pMod)).FpUserData, func() uintptr {
 192828 				if azArg != 0 {
 192829 					return azArg + 1*8
 192830 				}
 192831 				return uintptr(0)
 192832 			}(), func() int32 {
 192833 				if nArg != 0 {
 192834 					return nArg - 1
 192835 				}
 192836 				return 0
 192837 			}(), pConfig+104)
 192838 		(*Fts5Config)(unsafe.Pointer(pConfig)).FpTokApi = pMod + 16
 192839 		if rc != SQLITE_OK {
 192840 			if pzErr != 0 {
 192841 				*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+37246, 0)
 192842 			}
 192843 		} else {
 192844 			(*Fts5Config)(unsafe.Pointer(pConfig)).FePattern = sqlite3Fts5TokenizerPattern(tls,
 192845 				(*Fts5TokenizerModule)(unsafe.Pointer(pMod)).Fx.FxCreate, (*Fts5Config)(unsafe.Pointer(pConfig)).FpTok)
 192846 		}
 192847 	}
 192848 
 192849 	if rc != SQLITE_OK {
 192850 		(*Fts5Config)(unsafe.Pointer(pConfig)).FpTokApi = uintptr(0)
 192851 		(*Fts5Config)(unsafe.Pointer(pConfig)).FpTok = uintptr(0)
 192852 	}
 192853 
 192854 	return rc
 192855 }
 192856 
 192857 func fts5ModuleDestroy(tls *libc.TLS, pCtx uintptr) {
 192858 	var pTok uintptr
 192859 	var pNextTok uintptr
 192860 	var pAux uintptr
 192861 	var pNextAux uintptr
 192862 	var pGlobal uintptr = pCtx
 192863 
 192864 	for pAux = (*Fts5Global)(unsafe.Pointer(pGlobal)).FpAux; pAux != 0; pAux = pNextAux {
 192865 		pNextAux = (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FpNext
 192866 		if (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FxDestroy != 0 {
 192867 			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Fts5Auxiliary)(unsafe.Pointer(pAux)).FxDestroy})).f(tls, (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FpUserData)
 192868 		}
 192869 		Xsqlite3_free(tls, pAux)
 192870 	}
 192871 
 192872 	for pTok = (*Fts5Global)(unsafe.Pointer(pGlobal)).FpTok; pTok != 0; pTok = pNextTok {
 192873 		pNextTok = (*Fts5TokenizerModule)(unsafe.Pointer(pTok)).FpNext
 192874 		if (*Fts5TokenizerModule)(unsafe.Pointer(pTok)).FxDestroy != 0 {
 192875 			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*Fts5TokenizerModule)(unsafe.Pointer(pTok)).FxDestroy})).f(tls, (*Fts5TokenizerModule)(unsafe.Pointer(pTok)).FpUserData)
 192876 		}
 192877 		Xsqlite3_free(tls, pTok)
 192878 	}
 192879 
 192880 	Xsqlite3_free(tls, pGlobal)
 192881 }
 192882 
 192883 func fts5Fts5Func(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) {
 192884 	var pGlobal uintptr = Xsqlite3_user_data(tls, pCtx)
 192885 	var ppApi uintptr
 192886 	_ = nArg
 192887 
 192888 	ppApi = Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(apArg)), ts+37277)
 192889 	if ppApi != 0 {
 192890 		*(*uintptr)(unsafe.Pointer(ppApi)) = pGlobal
 192891 	}
 192892 }
 192893 
 192894 func fts5SourceIdFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apUnused uintptr) {
 192895 	_ = nArg
 192896 	_ = apUnused
 192897 	Xsqlite3_result_text(tls, pCtx, ts+37290, -1, libc.UintptrFromInt32(-1))
 192898 }
 192899 
 192900 func fts5ShadowName(tls *libc.TLS, zName uintptr) int32 {
 192901 	var i uint32
 192902 	for i = uint32(0); uint64(i) < uint64(unsafe.Sizeof(azName2))/uint64(unsafe.Sizeof(uintptr(0))); i++ {
 192903 		if Xsqlite3_stricmp(tls, zName, azName2[i]) == 0 {
 192904 			return 1
 192905 		}
 192906 	}
 192907 	return 0
 192908 }
 192909 
 192910 var azName2 = [5]uintptr{
 192911 	ts + 37381, ts + 35480, ts + 26479, ts + 35831, ts + 12840,
 192912 }
 192913 
 192914 func fts5Init(tls *libc.TLS, db uintptr) int32 {
 192915 	var rc int32
 192916 	var pGlobal uintptr = uintptr(0)
 192917 
 192918 	pGlobal = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Fts5Global{})))
 192919 	if pGlobal == uintptr(0) {
 192920 		rc = SQLITE_NOMEM
 192921 	} else {
 192922 		var p uintptr = pGlobal
 192923 		libc.Xmemset(tls, pGlobal, 0, uint64(unsafe.Sizeof(Fts5Global{})))
 192924 		(*Fts5Global)(unsafe.Pointer(pGlobal)).Fdb = db
 192925 		(*Fts5Global)(unsafe.Pointer(pGlobal)).Fapi.FiVersion = 2
 192926 		(*Fts5Global)(unsafe.Pointer(pGlobal)).Fapi.FxCreateFunction = *(*uintptr)(unsafe.Pointer(&struct {
 192927 			f func(*libc.TLS, uintptr, uintptr, uintptr, Fts5_extension_function, uintptr) int32
 192928 		}{fts5CreateAux}))
 192929 		(*Fts5Global)(unsafe.Pointer(pGlobal)).Fapi.FxCreateTokenizer = *(*uintptr)(unsafe.Pointer(&struct {
 192930 			f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32
 192931 		}{fts5CreateTokenizer}))
 192932 		(*Fts5Global)(unsafe.Pointer(pGlobal)).Fapi.FxFindTokenizer = *(*uintptr)(unsafe.Pointer(&struct {
 192933 			f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32
 192934 		}{fts5FindTokenizer}))
 192935 		rc = Xsqlite3_create_module_v2(tls, db, ts+37388, uintptr(unsafe.Pointer(&fts5Mod)), p, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5ModuleDestroy})))
 192936 		if rc == SQLITE_OK {
 192937 			rc = sqlite3Fts5IndexInit(tls, db)
 192938 		}
 192939 		if rc == SQLITE_OK {
 192940 			rc = sqlite3Fts5ExprInit(tls, pGlobal, db)
 192941 		}
 192942 		if rc == SQLITE_OK {
 192943 			rc = sqlite3Fts5AuxInit(tls, pGlobal)
 192944 		}
 192945 		if rc == SQLITE_OK {
 192946 			rc = sqlite3Fts5TokenizerInit(tls, pGlobal)
 192947 		}
 192948 		if rc == SQLITE_OK {
 192949 			rc = sqlite3Fts5VocabInit(tls, pGlobal, db)
 192950 		}
 192951 		if rc == SQLITE_OK {
 192952 			rc = Xsqlite3_create_function(tls,
 192953 				db, ts+37388, 1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct {
 192954 					f func(*libc.TLS, uintptr, int32, uintptr)
 192955 				}{fts5Fts5Func})), uintptr(0), uintptr(0))
 192956 		}
 192957 		if rc == SQLITE_OK {
 192958 			rc = Xsqlite3_create_function(tls,
 192959 				db, ts+37393, 0,
 192960 				SQLITE_UTF8|SQLITE_DETERMINISTIC|SQLITE_INNOCUOUS,
 192961 				p, *(*uintptr)(unsafe.Pointer(&struct {
 192962 					f func(*libc.TLS, uintptr, int32, uintptr)
 192963 				}{fts5SourceIdFunc})), uintptr(0), uintptr(0))
 192964 		}
 192965 	}
 192966 
 192967 	return rc
 192968 }
 192969 
 192970 var fts5Mod = Sqlite3_module{
 192971 	FiVersion:      3,
 192972 	FxCreate:       0,
 192973 	FxConnect:      0,
 192974 	FxBestIndex:    0,
 192975 	FxDisconnect:   0,
 192976 	FxDestroy:      0,
 192977 	FxOpen:         0,
 192978 	FxClose:        0,
 192979 	FxFilter:       0,
 192980 	FxNext:         0,
 192981 	FxEof:          0,
 192982 	FxColumn:       0,
 192983 	FxRowid:        0,
 192984 	FxUpdate:       0,
 192985 	FxBegin:        0,
 192986 	FxSync:         0,
 192987 	FxCommit:       0,
 192988 	FxRollback:     0,
 192989 	FxFindFunction: 0,
 192990 	FxRename:       0,
 192991 	FxSavepoint:    0,
 192992 	FxRelease:      0,
 192993 	FxRollbackTo:   0,
 192994 	FxShadowName:   0,
 192995 }
 192996 
 192997 // The following functions are used to register the module with SQLite. If
 192998 // this module is being built as part of the SQLite core (SQLITE_CORE is
 192999 // defined), then sqlite3_open() will call sqlite3Fts5Init() directly.
 193000 //
 193001 // Or, if this module is being built as a loadable extension,
 193002 // sqlite3Fts5Init() is omitted and the two standard entry points
 193003 // sqlite3_fts_init() and sqlite3_fts5_init() defined instead.
 193004 func Xsqlite3Fts5Init(tls *libc.TLS, db uintptr) int32 {
 193005 	return fts5Init(tls, db)
 193006 }
 193007 
 193008 func fts5StorageGetStmt(tls *libc.TLS, p uintptr, eStmt int32, ppStmt uintptr, pzErrMsg uintptr) int32 {
 193009 	bp := tls.Alloc(216)
 193010 	defer tls.Free(216)
 193011 
 193012 	var rc int32 = SQLITE_OK
 193013 
 193014 	if *(*uintptr)(unsafe.Pointer(p + 40 + uintptr(eStmt)*8)) == uintptr(0) {
 193015 		*(*[11]uintptr)(unsafe.Pointer(bp + 128)) = [11]uintptr{
 193016 			ts + 37408,
 193017 			ts + 37476,
 193018 			ts + 37545,
 193019 			ts + 37578,
 193020 			ts + 37617,
 193021 			ts + 37657,
 193022 			ts + 37696,
 193023 			ts + 37737,
 193024 			ts + 37776,
 193025 			ts + 37818,
 193026 			ts + 37858,
 193027 		}
 193028 		var pC uintptr = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig
 193029 		var zSql uintptr = uintptr(0)
 193030 
 193031 		switch eStmt {
 193032 		case FTS5_STMT_SCAN:
 193033 			zSql = Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(bp + 128 + uintptr(eStmt)*8)),
 193034 				libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pC)).FzContentExprlist, (*Fts5Config)(unsafe.Pointer(pC)).FzContent))
 193035 			break
 193036 			fallthrough
 193037 
 193038 		case FTS5_STMT_SCAN_ASC:
 193039 			fallthrough
 193040 		case FTS5_STMT_SCAN_DESC:
 193041 			zSql = Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(bp + 128 + uintptr(eStmt)*8)), libc.VaList(bp+16, (*Fts5Config)(unsafe.Pointer(pC)).FzContentExprlist,
 193042 				(*Fts5Config)(unsafe.Pointer(pC)).FzContent, (*Fts5Config)(unsafe.Pointer(pC)).FzContentRowid, (*Fts5Config)(unsafe.Pointer(pC)).FzContentRowid,
 193043 				(*Fts5Config)(unsafe.Pointer(pC)).FzContentRowid))
 193044 			break
 193045 			fallthrough
 193046 
 193047 		case FTS5_STMT_LOOKUP:
 193048 			zSql = Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(bp + 128 + uintptr(eStmt)*8)),
 193049 				libc.VaList(bp+56, (*Fts5Config)(unsafe.Pointer(pC)).FzContentExprlist, (*Fts5Config)(unsafe.Pointer(pC)).FzContent, (*Fts5Config)(unsafe.Pointer(pC)).FzContentRowid))
 193050 			break
 193051 			fallthrough
 193052 
 193053 		case FTS5_STMT_INSERT_CONTENT:
 193054 			fallthrough
 193055 		case FTS5_STMT_REPLACE_CONTENT:
 193056 			{
 193057 				var nCol int32 = (*Fts5Config)(unsafe.Pointer(pC)).FnCol + 1
 193058 				var zBind uintptr
 193059 				var i int32
 193060 
 193061 				zBind = Xsqlite3_malloc64(tls, uint64(1+nCol*2))
 193062 				if zBind != 0 {
 193063 					for i = 0; i < nCol; i++ {
 193064 						*(*int8)(unsafe.Pointer(zBind + uintptr(i*2))) = int8('?')
 193065 						*(*int8)(unsafe.Pointer(zBind + uintptr(i*2+1))) = int8(',')
 193066 					}
 193067 					*(*int8)(unsafe.Pointer(zBind + uintptr(i*2-1))) = int8(0)
 193068 					zSql = Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(bp + 128 + uintptr(eStmt)*8)), libc.VaList(bp+80, (*Fts5Config)(unsafe.Pointer(pC)).FzDb, (*Fts5Config)(unsafe.Pointer(pC)).FzName, zBind))
 193069 					Xsqlite3_free(tls, zBind)
 193070 				}
 193071 				break
 193072 
 193073 			}
 193074 			fallthrough
 193075 
 193076 		default:
 193077 			zSql = Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(bp + 128 + uintptr(eStmt)*8)), libc.VaList(bp+104, (*Fts5Config)(unsafe.Pointer(pC)).FzDb, (*Fts5Config)(unsafe.Pointer(pC)).FzName))
 193078 			break
 193079 		}
 193080 
 193081 		if zSql == uintptr(0) {
 193082 			rc = SQLITE_NOMEM
 193083 		} else {
 193084 			var f int32 = SQLITE_PREPARE_PERSISTENT
 193085 			if eStmt > FTS5_STMT_LOOKUP {
 193086 				f = f | SQLITE_PREPARE_NO_VTAB
 193087 			}
 193088 			(*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FbLock++
 193089 			rc = Xsqlite3_prepare_v3(tls, (*Fts5Config)(unsafe.Pointer(pC)).Fdb, zSql, -1, uint32(f), p+40+uintptr(eStmt)*8, uintptr(0))
 193090 			(*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FbLock--
 193091 			Xsqlite3_free(tls, zSql)
 193092 			if rc != SQLITE_OK && pzErrMsg != 0 {
 193093 				*(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+4493, libc.VaList(bp+120, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer(pC)).Fdb)))
 193094 			}
 193095 		}
 193096 	}
 193097 
 193098 	*(*uintptr)(unsafe.Pointer(ppStmt)) = *(*uintptr)(unsafe.Pointer(p + 40 + uintptr(eStmt)*8))
 193099 	Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(ppStmt)))
 193100 	return rc
 193101 }
 193102 
 193103 func fts5ExecPrintf(tls *libc.TLS, db uintptr, pzErr uintptr, zFormat uintptr, va uintptr) int32 {
 193104 	var rc int32
 193105 	var ap Va_list
 193106 	_ = ap
 193107 	var zSql uintptr
 193108 
 193109 	ap = va
 193110 	zSql = Xsqlite3_vmprintf(tls, zFormat, ap)
 193111 
 193112 	if zSql == uintptr(0) {
 193113 		rc = SQLITE_NOMEM
 193114 	} else {
 193115 		rc = Xsqlite3_exec(tls, db, zSql, uintptr(0), uintptr(0), pzErr)
 193116 		Xsqlite3_free(tls, zSql)
 193117 	}
 193118 
 193119 	_ = ap
 193120 	return rc
 193121 }
 193122 
 193123 func sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) int32 {
 193124 	bp := tls.Alloc(80)
 193125 	defer tls.Free(80)
 193126 
 193127 	var rc int32 = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0),
 193128 		ts+37881,
 193129 		libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName,
 193130 			(*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName,
 193131 			(*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
 193132 	if rc == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 {
 193133 		rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0),
 193134 			ts+37985,
 193135 			libc.VaList(bp+48, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
 193136 	}
 193137 	if rc == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL {
 193138 		rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0),
 193139 			ts+38023,
 193140 			libc.VaList(bp+64, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
 193141 	}
 193142 	return rc
 193143 }
 193144 
 193145 func fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail uintptr, zName uintptr) {
 193146 	bp := tls.Alloc(40)
 193147 	defer tls.Free(40)
 193148 
 193149 	if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK {
 193150 		*(*int32)(unsafe.Pointer(pRc)) = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0),
 193151 			ts+38061,
 193152 			libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail))
 193153 	}
 193154 }
 193155 
 193156 func sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) int32 {
 193157 	bp := tls.Alloc(4)
 193158 	defer tls.Free(4)
 193159 
 193160 	var pConfig uintptr = (*Fts5Storage)(unsafe.Pointer(pStorage)).FpConfig
 193161 	*(*int32)(unsafe.Pointer(bp)) = sqlite3Fts5StorageSync(tls, pStorage)
 193162 
 193163 	fts5StorageRenameOne(tls, pConfig, bp, ts+26479, zName)
 193164 	fts5StorageRenameOne(tls, pConfig, bp, ts+12840, zName)
 193165 	fts5StorageRenameOne(tls, pConfig, bp, ts+37381, zName)
 193166 	if (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 {
 193167 		fts5StorageRenameOne(tls, pConfig, bp, ts+35831, zName)
 193168 	}
 193169 	if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL {
 193170 		fts5StorageRenameOne(tls, pConfig, bp, ts+35480, zName)
 193171 	}
 193172 	return *(*int32)(unsafe.Pointer(bp))
 193173 }
 193174 
 193175 func sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDefn uintptr, bWithout int32, pzErr uintptr) int32 {
 193176 	bp := tls.Alloc(72)
 193177 	defer tls.Free(72)
 193178 
 193179 	var rc int32
 193180 	*(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0)
 193181 
 193182 	rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, bp+64, ts+38103,
 193183 		libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn,
 193184 			func() uintptr {
 193185 				if bWithout != 0 {
 193186 					return ts + 31132
 193187 				}
 193188 				return ts + 1544
 193189 			}()))
 193190 	if *(*uintptr)(unsafe.Pointer(bp + 64)) != 0 {
 193191 		*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls,
 193192 			ts+38133,
 193193 			libc.VaList(bp+40, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp + 64))))
 193194 		Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 64)))
 193195 	}
 193196 
 193197 	return rc
 193198 }
 193199 
 193200 func sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCreate int32, pp uintptr, pzErr uintptr) int32 {
 193201 	bp := tls.Alloc(8)
 193202 	defer tls.Free(8)
 193203 
 193204 	var rc int32 = SQLITE_OK
 193205 	var p uintptr
 193206 	var nByte Sqlite3_int64
 193207 
 193208 	nByte = Sqlite3_int64(uint64(unsafe.Sizeof(Fts5Storage{})) +
 193209 		uint64((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)*uint64(unsafe.Sizeof(I64(0))))
 193210 	*(*uintptr)(unsafe.Pointer(pp)) = libc.AssignUintptr(&p, Xsqlite3_malloc64(tls, uint64(nByte)))
 193211 	if !(p != 0) {
 193212 		return SQLITE_NOMEM
 193213 	}
 193214 
 193215 	libc.Xmemset(tls, p, 0, Size_t(nByte))
 193216 	(*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize = p + 1*128
 193217 	(*Fts5Storage)(unsafe.Pointer(p)).FpConfig = pConfig
 193218 	(*Fts5Storage)(unsafe.Pointer(p)).FpIndex = pIndex
 193219 
 193220 	if bCreate != 0 {
 193221 		if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL {
 193222 			var nDefn int32 = 32 + (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol*10
 193223 			var zDefn uintptr = Xsqlite3_malloc64(tls, uint64(int64(32)+Sqlite3_int64((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)*int64(10)))
 193224 			if zDefn == uintptr(0) {
 193225 				rc = SQLITE_NOMEM
 193226 			} else {
 193227 				var i int32
 193228 				var iOff int32
 193229 				Xsqlite3_snprintf(tls, nDefn, zDefn, ts+38177, 0)
 193230 				iOff = int32(libc.Xstrlen(tls, zDefn))
 193231 				for i = 0; i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; i++ {
 193232 					Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), ts+38200, libc.VaList(bp, i))
 193233 					iOff = iOff + int32(libc.Xstrlen(tls, zDefn+uintptr(iOff)))
 193234 				}
 193235 				rc = sqlite3Fts5CreateTable(tls, pConfig, ts+35480, zDefn, 0, pzErr)
 193236 			}
 193237 			Xsqlite3_free(tls, zDefn)
 193238 		}
 193239 
 193240 		if rc == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 {
 193241 			rc = sqlite3Fts5CreateTable(tls,
 193242 				pConfig, ts+35831, ts+38206, 0, pzErr)
 193243 		}
 193244 		if rc == SQLITE_OK {
 193245 			rc = sqlite3Fts5CreateTable(tls,
 193246 				pConfig, ts+37381, ts+38238, 1, pzErr)
 193247 		}
 193248 		if rc == SQLITE_OK {
 193249 			rc = sqlite3Fts5StorageConfigValue(tls, p, ts+35977, uintptr(0), FTS5_CURRENT_VERSION)
 193250 		}
 193251 	}
 193252 
 193253 	if rc != 0 {
 193254 		sqlite3Fts5StorageClose(tls, p)
 193255 		*(*uintptr)(unsafe.Pointer(pp)) = uintptr(0)
 193256 	}
 193257 	return rc
 193258 }
 193259 
 193260 func sqlite3Fts5StorageClose(tls *libc.TLS, p uintptr) int32 {
 193261 	var rc int32 = SQLITE_OK
 193262 	if p != 0 {
 193263 		var i int32
 193264 
 193265 		for i = 0; i < int32(uint64(unsafe.Sizeof([11]uintptr{}))/uint64(unsafe.Sizeof(uintptr(0)))); i++ {
 193266 			Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(p + 40 + uintptr(i)*8)))
 193267 		}
 193268 
 193269 		Xsqlite3_free(tls, p)
 193270 	}
 193271 	return rc
 193272 }
 193273 
 193274 type Fts5InsertCtx1 = struct {
 193275 	FpStorage uintptr
 193276 	FiCol     int32
 193277 	FszCol    int32
 193278 }
 193279 
 193280 type Fts5InsertCtx = Fts5InsertCtx1
 193281 
 193282 func fts5StorageInsertCallback(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 {
 193283 	var pCtx uintptr = pContext
 193284 	var pIdx uintptr = (*Fts5Storage)(unsafe.Pointer((*Fts5InsertCtx)(unsafe.Pointer(pCtx)).FpStorage)).FpIndex
 193285 	_ = iUnused1
 193286 	_ = iUnused2
 193287 	if nToken > FTS5_MAX_TOKEN_SIZE {
 193288 		nToken = FTS5_MAX_TOKEN_SIZE
 193289 	}
 193290 	if tflags&FTS5_TOKEN_COLOCATED == 0 || (*Fts5InsertCtx)(unsafe.Pointer(pCtx)).FszCol == 0 {
 193291 		(*Fts5InsertCtx)(unsafe.Pointer(pCtx)).FszCol++
 193292 	}
 193293 	return sqlite3Fts5IndexWrite(tls, pIdx, (*Fts5InsertCtx)(unsafe.Pointer(pCtx)).FiCol, (*Fts5InsertCtx)(unsafe.Pointer(pCtx)).FszCol-1, pToken, nToken)
 193294 }
 193295 
 193296 func fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel I64, apVal uintptr) int32 {
 193297 	bp := tls.Alloc(24)
 193298 	defer tls.Free(24)
 193299 
 193300 	var pConfig uintptr = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig
 193301 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 193302 	var rc int32
 193303 	var rc2 int32
 193304 	var iCol int32
 193305 
 193306 	if apVal == uintptr(0) {
 193307 		rc = fts5StorageGetStmt(tls, p, FTS5_STMT_LOOKUP, bp, uintptr(0))
 193308 		if rc != SQLITE_OK {
 193309 			return rc
 193310 		}
 193311 		Xsqlite3_bind_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 1, iDel)
 193312 		if Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) != SQLITE_ROW {
 193313 			return Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp)))
 193314 		}
 193315 	}
 193316 
 193317 	(*Fts5InsertCtx)(unsafe.Pointer(bp + 8)).FpStorage = p
 193318 	(*Fts5InsertCtx)(unsafe.Pointer(bp + 8)).FiCol = -1
 193319 	rc = sqlite3Fts5IndexBeginWrite(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, 1, iDel)
 193320 	for iCol = 1; rc == SQLITE_OK && iCol <= (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; iCol++ {
 193321 		if int32(*(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(iCol-1)))) == 0 {
 193322 			var zText uintptr
 193323 			var nText int32
 193324 
 193325 			if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
 193326 				zText = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol)
 193327 				nText = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol)
 193328 			} else if apVal != 0 {
 193329 				zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(iCol-1)*8)))
 193330 				nText = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(iCol-1)*8)))
 193331 			} else {
 193332 				continue
 193333 			}
 193334 			(*Fts5InsertCtx)(unsafe.Pointer(bp + 8)).FszCol = 0
 193335 			rc = sqlite3Fts5Tokenize(tls, pConfig, FTS5_TOKENIZE_DOCUMENT,
 193336 				zText, nText, bp+8, *(*uintptr)(unsafe.Pointer(&struct {
 193337 					f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
 193338 				}{fts5StorageInsertCallback})))
 193339 			*(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(iCol-1)*8)) -= I64((*Fts5InsertCtx)(unsafe.Pointer(bp + 8)).FszCol)
 193340 			if *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(iCol-1)*8)) < int64(0) {
 193341 				rc = SQLITE_CORRUPT | int32(1)<<8
 193342 			}
 193343 		}
 193344 	}
 193345 	if rc == SQLITE_OK && (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow < int64(1) {
 193346 		rc = SQLITE_CORRUPT | int32(1)<<8
 193347 	} else {
 193348 		(*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow--
 193349 	}
 193350 
 193351 	rc2 = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp)))
 193352 	if rc == SQLITE_OK {
 193353 		rc = rc2
 193354 	}
 193355 	return rc
 193356 }
 193357 
 193358 func fts5StorageInsertDocsize(tls *libc.TLS, p uintptr, iRowid I64, pBuf uintptr) int32 {
 193359 	bp := tls.Alloc(8)
 193360 	defer tls.Free(8)
 193361 
 193362 	var rc int32 = SQLITE_OK
 193363 	if (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FbColumnsize != 0 {
 193364 		*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 193365 		rc = fts5StorageGetStmt(tls, p, FTS5_STMT_REPLACE_DOCSIZE, bp, uintptr(0))
 193366 		if rc == SQLITE_OK {
 193367 			Xsqlite3_bind_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 1, iRowid)
 193368 			Xsqlite3_bind_blob(tls, *(*uintptr)(unsafe.Pointer(bp)), 2, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn, uintptr(0))
 193369 			Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp)))
 193370 			rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp)))
 193371 			Xsqlite3_bind_null(tls, *(*uintptr)(unsafe.Pointer(bp)), 2)
 193372 		}
 193373 	}
 193374 	return rc
 193375 }
 193376 
 193377 func fts5StorageLoadTotals(tls *libc.TLS, p uintptr, bCache int32) int32 {
 193378 	var rc int32 = SQLITE_OK
 193379 	if (*Fts5Storage)(unsafe.Pointer(p)).FbTotalsValid == 0 {
 193380 		rc = sqlite3Fts5IndexGetAverages(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, p+24, (*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize)
 193381 		(*Fts5Storage)(unsafe.Pointer(p)).FbTotalsValid = bCache
 193382 	}
 193383 	return rc
 193384 }
 193385 
 193386 func fts5StorageSaveTotals(tls *libc.TLS, p uintptr) int32 {
 193387 	bp := tls.Alloc(20)
 193388 	defer tls.Free(20)
 193389 
 193390 	var nCol int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FnCol
 193391 	var i int32
 193392 
 193393 	*(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_OK
 193394 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Fts5Buffer{})))
 193395 
 193396 	sqlite3Fts5BufferAppendVarint(tls, bp+16, bp, (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow)
 193397 	for i = 0; i < nCol; i++ {
 193398 		sqlite3Fts5BufferAppendVarint(tls, bp+16, bp, *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(i)*8)))
 193399 	}
 193400 	if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
 193401 		*(*int32)(unsafe.Pointer(bp + 16)) = sqlite3Fts5IndexSetAverages(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, (*Fts5Buffer)(unsafe.Pointer(bp)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp)).Fn)
 193402 	}
 193403 	Xsqlite3_free(tls, (*Fts5Buffer)(unsafe.Pointer(bp)).Fp)
 193404 
 193405 	return *(*int32)(unsafe.Pointer(bp + 16))
 193406 }
 193407 
 193408 func sqlite3Fts5StorageDelete(tls *libc.TLS, p uintptr, iDel I64, apVal uintptr) int32 {
 193409 	bp := tls.Alloc(8)
 193410 	defer tls.Free(8)
 193411 
 193412 	var pConfig uintptr = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig
 193413 	var rc int32
 193414 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 193415 
 193416 	rc = fts5StorageLoadTotals(tls, p, 1)
 193417 
 193418 	if rc == SQLITE_OK {
 193419 		rc = fts5StorageDeleteFromIndex(tls, p, iDel, apVal)
 193420 	}
 193421 
 193422 	if rc == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 {
 193423 		rc = fts5StorageGetStmt(tls, p, FTS5_STMT_DELETE_DOCSIZE, bp, uintptr(0))
 193424 		if rc == SQLITE_OK {
 193425 			Xsqlite3_bind_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 1, iDel)
 193426 			Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp)))
 193427 			rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp)))
 193428 		}
 193429 	}
 193430 
 193431 	if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL {
 193432 		if rc == SQLITE_OK {
 193433 			rc = fts5StorageGetStmt(tls, p, FTS5_STMT_DELETE_CONTENT, bp, uintptr(0))
 193434 		}
 193435 		if rc == SQLITE_OK {
 193436 			Xsqlite3_bind_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 1, iDel)
 193437 			Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp)))
 193438 			rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp)))
 193439 		}
 193440 	}
 193441 
 193442 	return rc
 193443 }
 193444 
 193445 func sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) int32 {
 193446 	bp := tls.Alloc(48)
 193447 	defer tls.Free(48)
 193448 
 193449 	var pConfig uintptr = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig
 193450 	var rc int32
 193451 
 193452 	(*Fts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0
 193453 
 193454 	rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0),
 193455 		ts+38255,
 193456 		libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName,
 193457 			(*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
 193458 	if rc == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 {
 193459 		rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0),
 193460 			ts+38305,
 193461 			libc.VaList(bp+32, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
 193462 	}
 193463 
 193464 	if rc == SQLITE_OK {
 193465 		rc = sqlite3Fts5IndexReinit(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex)
 193466 	}
 193467 	if rc == SQLITE_OK {
 193468 		rc = sqlite3Fts5StorageConfigValue(tls, p, ts+35977, uintptr(0), FTS5_CURRENT_VERSION)
 193469 	}
 193470 	return rc
 193471 }
 193472 
 193473 func sqlite3Fts5StorageRebuild(tls *libc.TLS, p uintptr) int32 {
 193474 	bp := tls.Alloc(44)
 193475 	defer tls.Free(44)
 193476 
 193477 	*(*Fts5Buffer)(unsafe.Pointer(bp + 24)) = Fts5Buffer{}
 193478 	var pConfig uintptr = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig
 193479 	*(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0)
 193480 
 193481 	var rc2 int32
 193482 
 193483 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Fts5InsertCtx{})))
 193484 	(*Fts5InsertCtx)(unsafe.Pointer(bp)).FpStorage = p
 193485 	*(*int32)(unsafe.Pointer(bp + 40)) = sqlite3Fts5StorageDeleteAll(tls, p)
 193486 	if *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK {
 193487 		*(*int32)(unsafe.Pointer(bp + 40)) = fts5StorageLoadTotals(tls, p, 1)
 193488 	}
 193489 
 193490 	if *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK {
 193491 		*(*int32)(unsafe.Pointer(bp + 40)) = fts5StorageGetStmt(tls, p, FTS5_STMT_SCAN, bp+16, uintptr(0))
 193492 	}
 193493 
 193494 	for *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK && SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) {
 193495 		var iRowid I64 = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), 0)
 193496 
 193497 		sqlite3Fts5BufferZero(tls, bp+24)
 193498 		*(*int32)(unsafe.Pointer(bp + 40)) = sqlite3Fts5IndexBeginWrite(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, 0, iRowid)
 193499 		for (*Fts5InsertCtx)(unsafe.Pointer(bp)).FiCol = 0; *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK && (*Fts5InsertCtx)(unsafe.Pointer(bp)).FiCol < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; (*Fts5InsertCtx)(unsafe.Pointer(bp)).FiCol++ {
 193500 			(*Fts5InsertCtx)(unsafe.Pointer(bp)).FszCol = 0
 193501 			if int32(*(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr((*Fts5InsertCtx)(unsafe.Pointer(bp)).FiCol)))) == 0 {
 193502 				var zText uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), (*Fts5InsertCtx)(unsafe.Pointer(bp)).FiCol+1)
 193503 				var nText int32 = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), (*Fts5InsertCtx)(unsafe.Pointer(bp)).FiCol+1)
 193504 				*(*int32)(unsafe.Pointer(bp + 40)) = sqlite3Fts5Tokenize(tls, pConfig,
 193505 					FTS5_TOKENIZE_DOCUMENT,
 193506 					zText, nText,
 193507 					bp,
 193508 					*(*uintptr)(unsafe.Pointer(&struct {
 193509 						f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
 193510 					}{fts5StorageInsertCallback})))
 193511 			}
 193512 			sqlite3Fts5BufferAppendVarint(tls, bp+40, bp+24, int64((*Fts5InsertCtx)(unsafe.Pointer(bp)).FszCol))
 193513 			*(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr((*Fts5InsertCtx)(unsafe.Pointer(bp)).FiCol)*8)) += I64((*Fts5InsertCtx)(unsafe.Pointer(bp)).FszCol)
 193514 		}
 193515 		(*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow++
 193516 
 193517 		if *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK {
 193518 			*(*int32)(unsafe.Pointer(bp + 40)) = fts5StorageInsertDocsize(tls, p, iRowid, bp+24)
 193519 		}
 193520 	}
 193521 	Xsqlite3_free(tls, (*Fts5Buffer)(unsafe.Pointer(bp+24)).Fp)
 193522 	rc2 = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 16)))
 193523 	if *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK {
 193524 		*(*int32)(unsafe.Pointer(bp + 40)) = rc2
 193525 	}
 193526 
 193527 	if *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK {
 193528 		*(*int32)(unsafe.Pointer(bp + 40)) = fts5StorageSaveTotals(tls, p)
 193529 	}
 193530 	return *(*int32)(unsafe.Pointer(bp + 40))
 193531 }
 193532 
 193533 func sqlite3Fts5StorageOptimize(tls *libc.TLS, p uintptr) int32 {
 193534 	return sqlite3Fts5IndexOptimize(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex)
 193535 }
 193536 
 193537 func sqlite3Fts5StorageMerge(tls *libc.TLS, p uintptr, nMerge int32) int32 {
 193538 	return sqlite3Fts5IndexMerge(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, nMerge)
 193539 }
 193540 
 193541 func sqlite3Fts5StorageReset(tls *libc.TLS, p uintptr) int32 {
 193542 	return sqlite3Fts5IndexReset(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex)
 193543 }
 193544 
 193545 func fts5StorageNewRowid(tls *libc.TLS, p uintptr, piRowid uintptr) int32 {
 193546 	bp := tls.Alloc(8)
 193547 	defer tls.Free(8)
 193548 
 193549 	var rc int32 = SQLITE_MISMATCH
 193550 	if (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FbColumnsize != 0 {
 193551 		*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 193552 		rc = fts5StorageGetStmt(tls, p, FTS5_STMT_REPLACE_DOCSIZE, bp, uintptr(0))
 193553 		if rc == SQLITE_OK {
 193554 			Xsqlite3_bind_null(tls, *(*uintptr)(unsafe.Pointer(bp)), 1)
 193555 			Xsqlite3_bind_null(tls, *(*uintptr)(unsafe.Pointer(bp)), 2)
 193556 			Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp)))
 193557 			rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp)))
 193558 		}
 193559 		if rc == SQLITE_OK {
 193560 			*(*I64)(unsafe.Pointer(piRowid)) = Xsqlite3_last_insert_rowid(tls, (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).Fdb)
 193561 		}
 193562 	}
 193563 	return rc
 193564 }
 193565 
 193566 func sqlite3Fts5StorageContentInsert(tls *libc.TLS, p uintptr, apVal uintptr, piRowid uintptr) int32 {
 193567 	bp := tls.Alloc(8)
 193568 	defer tls.Free(8)
 193569 
 193570 	var pConfig uintptr = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig
 193571 	var rc int32 = SQLITE_OK
 193572 
 193573 	if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL {
 193574 		if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*8))) == SQLITE_INTEGER {
 193575 			*(*I64)(unsafe.Pointer(piRowid)) = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*8)))
 193576 		} else {
 193577 			rc = fts5StorageNewRowid(tls, p, piRowid)
 193578 		}
 193579 	} else {
 193580 		*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 193581 		var i int32
 193582 		rc = fts5StorageGetStmt(tls, p, FTS5_STMT_INSERT_CONTENT, bp, uintptr(0))
 193583 		for i = 1; rc == SQLITE_OK && i <= (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol+1; i++ {
 193584 			rc = Xsqlite3_bind_value(tls, *(*uintptr)(unsafe.Pointer(bp)), i, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8)))
 193585 		}
 193586 		if rc == SQLITE_OK {
 193587 			Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp)))
 193588 			rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp)))
 193589 		}
 193590 		*(*I64)(unsafe.Pointer(piRowid)) = Xsqlite3_last_insert_rowid(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb)
 193591 	}
 193592 
 193593 	return rc
 193594 }
 193595 
 193596 func sqlite3Fts5StorageIndexInsert(tls *libc.TLS, p uintptr, apVal uintptr, iRowid I64) int32 {
 193597 	bp := tls.Alloc(36)
 193598 	defer tls.Free(36)
 193599 
 193600 	var pConfig uintptr = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig
 193601 	*(*int32)(unsafe.Pointer(bp + 32)) = SQLITE_OK
 193602 
 193603 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Fts5Buffer{})))
 193604 	(*Fts5InsertCtx)(unsafe.Pointer(bp + 16)).FpStorage = p
 193605 	*(*int32)(unsafe.Pointer(bp + 32)) = fts5StorageLoadTotals(tls, p, 1)
 193606 
 193607 	if *(*int32)(unsafe.Pointer(bp + 32)) == SQLITE_OK {
 193608 		*(*int32)(unsafe.Pointer(bp + 32)) = sqlite3Fts5IndexBeginWrite(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, 0, iRowid)
 193609 	}
 193610 	for (*Fts5InsertCtx)(unsafe.Pointer(bp + 16)).FiCol = 0; *(*int32)(unsafe.Pointer(bp + 32)) == SQLITE_OK && (*Fts5InsertCtx)(unsafe.Pointer(bp+16)).FiCol < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; (*Fts5InsertCtx)(unsafe.Pointer(bp+16)).FiCol++ {
 193611 		(*Fts5InsertCtx)(unsafe.Pointer(bp + 16)).FszCol = 0
 193612 		if int32(*(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr((*Fts5InsertCtx)(unsafe.Pointer(bp+16)).FiCol)))) == 0 {
 193613 			var zText uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr((*Fts5InsertCtx)(unsafe.Pointer(bp+16)).FiCol+2)*8)))
 193614 			var nText int32 = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr((*Fts5InsertCtx)(unsafe.Pointer(bp+16)).FiCol+2)*8)))
 193615 			*(*int32)(unsafe.Pointer(bp + 32)) = sqlite3Fts5Tokenize(tls, pConfig,
 193616 				FTS5_TOKENIZE_DOCUMENT,
 193617 				zText, nText,
 193618 				bp+16,
 193619 				*(*uintptr)(unsafe.Pointer(&struct {
 193620 					f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
 193621 				}{fts5StorageInsertCallback})))
 193622 		}
 193623 		sqlite3Fts5BufferAppendVarint(tls, bp+32, bp, int64((*Fts5InsertCtx)(unsafe.Pointer(bp+16)).FszCol))
 193624 		*(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr((*Fts5InsertCtx)(unsafe.Pointer(bp+16)).FiCol)*8)) += I64((*Fts5InsertCtx)(unsafe.Pointer(bp + 16)).FszCol)
 193625 	}
 193626 	(*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow++
 193627 
 193628 	if *(*int32)(unsafe.Pointer(bp + 32)) == SQLITE_OK {
 193629 		*(*int32)(unsafe.Pointer(bp + 32)) = fts5StorageInsertDocsize(tls, p, iRowid, bp)
 193630 	}
 193631 	Xsqlite3_free(tls, (*Fts5Buffer)(unsafe.Pointer(bp)).Fp)
 193632 
 193633 	return *(*int32)(unsafe.Pointer(bp + 32))
 193634 }
 193635 
 193636 func fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) int32 {
 193637 	bp := tls.Alloc(32)
 193638 	defer tls.Free(32)
 193639 
 193640 	var pConfig uintptr = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig
 193641 	var zSql uintptr
 193642 	var rc int32
 193643 
 193644 	zSql = Xsqlite3_mprintf(tls, ts+38334,
 193645 		libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix))
 193646 	if zSql == uintptr(0) {
 193647 		rc = SQLITE_NOMEM
 193648 	} else {
 193649 		*(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0)
 193650 		rc = Xsqlite3_prepare_v2(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -1, bp+24, uintptr(0))
 193651 		if rc == SQLITE_OK {
 193652 			if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 24))) {
 193653 				*(*I64)(unsafe.Pointer(pnRow)) = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 24)), 0)
 193654 			}
 193655 			rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 24)))
 193656 		}
 193657 	}
 193658 
 193659 	Xsqlite3_free(tls, zSql)
 193660 	return rc
 193661 }
 193662 
 193663 // Context object used by sqlite3Fts5StorageIntegrity().
 193664 type Fts5IntegrityCtx1 = struct {
 193665 	FiRowid   I64
 193666 	FiCol     int32
 193667 	FszCol    int32
 193668 	Fcksum    U64
 193669 	FpTermset uintptr
 193670 	FpConfig  uintptr
 193671 }
 193672 
 193673 // Context object used by sqlite3Fts5StorageIntegrity().
 193674 type Fts5IntegrityCtx = Fts5IntegrityCtx1
 193675 
 193676 func fts5StorageIntegrityCallback(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 {
 193677 	bp := tls.Alloc(4)
 193678 	defer tls.Free(4)
 193679 
 193680 	var pCtx uintptr = pContext
 193681 	var pTermset uintptr = (*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FpTermset
 193682 
 193683 	var ii int32
 193684 	var rc int32 = SQLITE_OK
 193685 	var iPos int32
 193686 	var iCol int32
 193687 
 193688 	_ = iUnused1
 193689 	_ = iUnused2
 193690 	if nToken > FTS5_MAX_TOKEN_SIZE {
 193691 		nToken = FTS5_MAX_TOKEN_SIZE
 193692 	}
 193693 
 193694 	if tflags&FTS5_TOKEN_COLOCATED == 0 || (*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FszCol == 0 {
 193695 		(*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FszCol++
 193696 	}
 193697 
 193698 	switch (*Fts5Config)(unsafe.Pointer((*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FpConfig)).FeDetail {
 193699 	case FTS5_DETAIL_FULL:
 193700 		iPos = (*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FszCol - 1
 193701 		iCol = (*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FiCol
 193702 		break
 193703 
 193704 	case FTS5_DETAIL_COLUMNS:
 193705 		iPos = (*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FiCol
 193706 		iCol = 0
 193707 		break
 193708 
 193709 	default:
 193710 		iPos = 0
 193711 		iCol = 0
 193712 		break
 193713 	}
 193714 
 193715 	rc = sqlite3Fts5TermsetAdd(tls, pTermset, 0, pToken, nToken, bp)
 193716 	if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp)) == 0 {
 193717 		*(*U64)(unsafe.Pointer(pCtx + 16)) ^= sqlite3Fts5IndexEntryCksum(tls,
 193718 			(*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FiRowid, iCol, iPos, 0, pToken, nToken)
 193719 	}
 193720 
 193721 	for ii = 0; rc == SQLITE_OK && ii < (*Fts5Config)(unsafe.Pointer((*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FpConfig)).FnPrefix; ii++ {
 193722 		var nChar int32 = *(*int32)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer((*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FpConfig)).FaPrefix + uintptr(ii)*4))
 193723 		var nByte int32 = sqlite3Fts5IndexCharlenToBytelen(tls, pToken, nToken, nChar)
 193724 		if nByte != 0 {
 193725 			rc = sqlite3Fts5TermsetAdd(tls, pTermset, ii+1, pToken, nByte, bp)
 193726 			if *(*int32)(unsafe.Pointer(bp)) == 0 {
 193727 				*(*U64)(unsafe.Pointer(pCtx + 16)) ^= sqlite3Fts5IndexEntryCksum(tls,
 193728 					(*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FiRowid, iCol, iPos, ii+1, pToken, nByte)
 193729 			}
 193730 		}
 193731 	}
 193732 
 193733 	return rc
 193734 }
 193735 
 193736 func sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) int32 {
 193737 	bp := tls.Alloc(64)
 193738 	defer tls.Free(64)
 193739 
 193740 	var pConfig uintptr = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig
 193741 	var rc int32 = SQLITE_OK
 193742 	var aColSize uintptr
 193743 	var aTotalSize uintptr
 193744 
 193745 	var bUseCksum int32
 193746 
 193747 	libc.Xmemset(tls, bp, 0, uint64(unsafe.Sizeof(Fts5IntegrityCtx{})))
 193748 	(*Fts5IntegrityCtx)(unsafe.Pointer(bp)).FpConfig = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig
 193749 	aTotalSize = Xsqlite3_malloc64(tls, uint64((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)*(uint64(unsafe.Sizeof(int32(0)))+uint64(unsafe.Sizeof(I64(0)))))
 193750 	if !(aTotalSize != 0) {
 193751 		return SQLITE_NOMEM
 193752 	}
 193753 	aColSize = aTotalSize + uintptr((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)*8
 193754 	libc.Xmemset(tls, aTotalSize, 0, uint64(unsafe.Sizeof(I64(0)))*uint64((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol))
 193755 
 193756 	bUseCksum = libc.Bool32((*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL ||
 193757 		(*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_EXTERNAL && iArg != 0)
 193758 	if bUseCksum != 0 {
 193759 		rc = fts5StorageGetStmt(tls, p, FTS5_STMT_SCAN, bp+40, uintptr(0))
 193760 		if rc == SQLITE_OK {
 193761 			var rc2 int32
 193762 			for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) {
 193763 				var i int32
 193764 				(*Fts5IntegrityCtx)(unsafe.Pointer(bp)).FiRowid = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 40)), 0)
 193765 				(*Fts5IntegrityCtx)(unsafe.Pointer(bp)).FszCol = 0
 193766 				if (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 {
 193767 					rc = sqlite3Fts5StorageDocsize(tls, p, (*Fts5IntegrityCtx)(unsafe.Pointer(bp)).FiRowid, aColSize)
 193768 				}
 193769 				if rc == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_NONE {
 193770 					rc = sqlite3Fts5TermsetNew(tls, bp+24)
 193771 				}
 193772 				for i = 0; rc == SQLITE_OK && i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; i++ {
 193773 					if *(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i))) != 0 {
 193774 						continue
 193775 					}
 193776 					(*Fts5IntegrityCtx)(unsafe.Pointer(bp)).FiCol = i
 193777 					(*Fts5IntegrityCtx)(unsafe.Pointer(bp)).FszCol = 0
 193778 					if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_COLUMNS {
 193779 						rc = sqlite3Fts5TermsetNew(tls, bp+24)
 193780 					}
 193781 					if rc == SQLITE_OK {
 193782 						var zText uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 40)), i+1)
 193783 						var nText int32 = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 40)), i+1)
 193784 						rc = sqlite3Fts5Tokenize(tls, pConfig,
 193785 							FTS5_TOKENIZE_DOCUMENT,
 193786 							zText, nText,
 193787 							bp,
 193788 							*(*uintptr)(unsafe.Pointer(&struct {
 193789 								f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
 193790 							}{fts5StorageIntegrityCallback})))
 193791 					}
 193792 					if rc == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 && (*Fts5IntegrityCtx)(unsafe.Pointer(bp)).FszCol != *(*int32)(unsafe.Pointer(aColSize + uintptr(i)*4)) {
 193793 						rc = SQLITE_CORRUPT | int32(1)<<8
 193794 					}
 193795 					*(*I64)(unsafe.Pointer(aTotalSize + uintptr(i)*8)) += I64((*Fts5IntegrityCtx)(unsafe.Pointer(bp)).FszCol)
 193796 					if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_COLUMNS {
 193797 						sqlite3Fts5TermsetFree(tls, (*Fts5IntegrityCtx)(unsafe.Pointer(bp)).FpTermset)
 193798 						(*Fts5IntegrityCtx)(unsafe.Pointer(bp)).FpTermset = uintptr(0)
 193799 					}
 193800 				}
 193801 				sqlite3Fts5TermsetFree(tls, (*Fts5IntegrityCtx)(unsafe.Pointer(bp)).FpTermset)
 193802 				(*Fts5IntegrityCtx)(unsafe.Pointer(bp)).FpTermset = uintptr(0)
 193803 
 193804 				if rc != SQLITE_OK {
 193805 					break
 193806 				}
 193807 			}
 193808 			rc2 = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 40)))
 193809 			if rc == SQLITE_OK {
 193810 				rc = rc2
 193811 			}
 193812 		}
 193813 
 193814 		if rc == SQLITE_OK {
 193815 			var i int32
 193816 			rc = fts5StorageLoadTotals(tls, p, 0)
 193817 			for i = 0; rc == SQLITE_OK && i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; i++ {
 193818 				if *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(i)*8)) != *(*I64)(unsafe.Pointer(aTotalSize + uintptr(i)*8)) {
 193819 					rc = SQLITE_CORRUPT | int32(1)<<8
 193820 				}
 193821 			}
 193822 		}
 193823 
 193824 		if rc == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL {
 193825 			*(*I64)(unsafe.Pointer(bp + 48)) = int64(0)
 193826 			rc = fts5StorageCount(tls, p, ts+35480, bp+48)
 193827 			if rc == SQLITE_OK && *(*I64)(unsafe.Pointer(bp + 48)) != (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow {
 193828 				rc = SQLITE_CORRUPT | int32(1)<<8
 193829 			}
 193830 		}
 193831 		if rc == SQLITE_OK && (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 {
 193832 			*(*I64)(unsafe.Pointer(bp + 56)) = int64(0)
 193833 			rc = fts5StorageCount(tls, p, ts+35831, bp+56)
 193834 			if rc == SQLITE_OK && *(*I64)(unsafe.Pointer(bp + 56)) != (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow {
 193835 				rc = SQLITE_CORRUPT | int32(1)<<8
 193836 			}
 193837 		}
 193838 	}
 193839 
 193840 	if rc == SQLITE_OK {
 193841 		rc = sqlite3Fts5IndexIntegrityCheck(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, (*Fts5IntegrityCtx)(unsafe.Pointer(bp)).Fcksum, bUseCksum)
 193842 	}
 193843 
 193844 	Xsqlite3_free(tls, aTotalSize)
 193845 	return rc
 193846 }
 193847 
 193848 func sqlite3Fts5StorageStmt(tls *libc.TLS, p uintptr, eStmt int32, pp uintptr, pzErrMsg uintptr) int32 {
 193849 	var rc int32
 193850 
 193851 	rc = fts5StorageGetStmt(tls, p, eStmt, pp, pzErrMsg)
 193852 	if rc == SQLITE_OK {
 193853 		*(*uintptr)(unsafe.Pointer(p + 40 + uintptr(eStmt)*8)) = uintptr(0)
 193854 	}
 193855 	return rc
 193856 }
 193857 
 193858 func sqlite3Fts5StorageStmtRelease(tls *libc.TLS, p uintptr, eStmt int32, pStmt uintptr) {
 193859 	if *(*uintptr)(unsafe.Pointer(p + 40 + uintptr(eStmt)*8)) == uintptr(0) {
 193860 		Xsqlite3_reset(tls, pStmt)
 193861 		*(*uintptr)(unsafe.Pointer(p + 40 + uintptr(eStmt)*8)) = pStmt
 193862 	} else {
 193863 		Xsqlite3_finalize(tls, pStmt)
 193864 	}
 193865 }
 193866 
 193867 func fts5StorageDecodeSizeArray(tls *libc.TLS, aCol uintptr, nCol int32, aBlob uintptr, nBlob int32) int32 {
 193868 	var i int32
 193869 	var iOff int32 = 0
 193870 	for i = 0; i < nCol; i++ {
 193871 		if iOff >= nBlob {
 193872 			return 1
 193873 		}
 193874 		iOff = iOff + sqlite3Fts5GetVarint32(tls, aBlob+uintptr(iOff), aCol+uintptr(i)*4)
 193875 	}
 193876 	return libc.Bool32(iOff != nBlob)
 193877 }
 193878 
 193879 func sqlite3Fts5StorageDocsize(tls *libc.TLS, p uintptr, iRowid I64, aCol uintptr) int32 {
 193880 	bp := tls.Alloc(8)
 193881 	defer tls.Free(8)
 193882 
 193883 	var nCol int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FnCol
 193884 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 193885 	var rc int32
 193886 
 193887 	rc = fts5StorageGetStmt(tls, p, FTS5_STMT_LOOKUP_DOCSIZE, bp, uintptr(0))
 193888 	if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
 193889 		var bCorrupt int32 = 1
 193890 
 193891 		Xsqlite3_bind_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 1, iRowid)
 193892 		if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) {
 193893 			var aBlob uintptr = Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp)), 0)
 193894 			var nBlob int32 = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), 0)
 193895 			if 0 == fts5StorageDecodeSizeArray(tls, aCol, nCol, aBlob, nBlob) {
 193896 				bCorrupt = 0
 193897 			}
 193898 		}
 193899 		rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp)))
 193900 		if bCorrupt != 0 && rc == SQLITE_OK {
 193901 			rc = SQLITE_CORRUPT | int32(1)<<8
 193902 		}
 193903 	} else {
 193904 	}
 193905 
 193906 	return rc
 193907 }
 193908 
 193909 func sqlite3Fts5StorageSize(tls *libc.TLS, p uintptr, iCol int32, pnToken uintptr) int32 {
 193910 	var rc int32 = fts5StorageLoadTotals(tls, p, 0)
 193911 	if rc == SQLITE_OK {
 193912 		*(*I64)(unsafe.Pointer(pnToken)) = int64(0)
 193913 		if iCol < 0 {
 193914 			var i int32
 193915 			for i = 0; i < (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FnCol; i++ {
 193916 				*(*I64)(unsafe.Pointer(pnToken)) += *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(i)*8))
 193917 			}
 193918 		} else if iCol < (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FnCol {
 193919 			*(*I64)(unsafe.Pointer(pnToken)) = *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(iCol)*8))
 193920 		} else {
 193921 			rc = SQLITE_RANGE
 193922 		}
 193923 	}
 193924 	return rc
 193925 }
 193926 
 193927 func sqlite3Fts5StorageRowCount(tls *libc.TLS, p uintptr, pnRow uintptr) int32 {
 193928 	var rc int32 = fts5StorageLoadTotals(tls, p, 0)
 193929 	if rc == SQLITE_OK {
 193930 		*(*I64)(unsafe.Pointer(pnRow)) = (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow
 193931 		if (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow <= int64(0) {
 193932 			rc = SQLITE_CORRUPT | int32(1)<<8
 193933 		}
 193934 	}
 193935 	return rc
 193936 }
 193937 
 193938 func sqlite3Fts5StorageSync(tls *libc.TLS, p uintptr) int32 {
 193939 	var rc int32 = SQLITE_OK
 193940 	var iLastRowid I64 = Xsqlite3_last_insert_rowid(tls, (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).Fdb)
 193941 	if (*Fts5Storage)(unsafe.Pointer(p)).FbTotalsValid != 0 {
 193942 		rc = fts5StorageSaveTotals(tls, p)
 193943 		(*Fts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0
 193944 	}
 193945 	if rc == SQLITE_OK {
 193946 		rc = sqlite3Fts5IndexSync(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex)
 193947 	}
 193948 	Xsqlite3_set_last_insert_rowid(tls, (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).Fdb, iLastRowid)
 193949 	return rc
 193950 }
 193951 
 193952 func sqlite3Fts5StorageRollback(tls *libc.TLS, p uintptr) int32 {
 193953 	(*Fts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0
 193954 	return sqlite3Fts5IndexRollback(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex)
 193955 }
 193956 
 193957 func sqlite3Fts5StorageConfigValue(tls *libc.TLS, p uintptr, z uintptr, pVal uintptr, iVal int32) int32 {
 193958 	bp := tls.Alloc(8)
 193959 	defer tls.Free(8)
 193960 
 193961 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 193962 	var rc int32 = fts5StorageGetStmt(tls, p, FTS5_STMT_REPLACE_CONFIG, bp, uintptr(0))
 193963 	if rc == SQLITE_OK {
 193964 		Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 1, z, -1, uintptr(0))
 193965 		if pVal != 0 {
 193966 			Xsqlite3_bind_value(tls, *(*uintptr)(unsafe.Pointer(bp)), 2, pVal)
 193967 		} else {
 193968 			Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 2, iVal)
 193969 		}
 193970 		Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp)))
 193971 		rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp)))
 193972 		Xsqlite3_bind_null(tls, *(*uintptr)(unsafe.Pointer(bp)), 1)
 193973 	}
 193974 	if rc == SQLITE_OK && pVal != 0 {
 193975 		var iNew int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FiCookie + 1
 193976 		rc = sqlite3Fts5IndexSetCookie(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, iNew)
 193977 		if rc == SQLITE_OK {
 193978 			(*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FiCookie = iNew
 193979 		}
 193980 	}
 193981 	return rc
 193982 }
 193983 
 193984 var aAsciiTokenChar = [128]uint8{
 193985 	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
 193986 	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
 193987 	uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
 193988 	uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
 193989 	uint8(0), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1),
 193990 	uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
 193991 	uint8(0), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1),
 193992 	uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
 193993 }
 193994 
 193995 type AsciiTokenizer1 = struct{ FaTokenChar [128]uint8 }
 193996 
 193997 type AsciiTokenizer = AsciiTokenizer1
 193998 
 193999 func fts5AsciiAddExceptions(tls *libc.TLS, p uintptr, zArg uintptr, bTokenChars int32) {
 194000 	var i int32
 194001 	for i = 0; *(*int8)(unsafe.Pointer(zArg + uintptr(i))) != 0; i++ {
 194002 		if int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i))))&0x80 == 0 {
 194003 			*(*uint8)(unsafe.Pointer(p + uintptr(int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i))))))) = uint8(bTokenChars)
 194004 		}
 194005 	}
 194006 }
 194007 
 194008 func fts5AsciiDelete(tls *libc.TLS, p uintptr) {
 194009 	Xsqlite3_free(tls, p)
 194010 }
 194011 
 194012 func fts5AsciiCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 {
 194013 	var rc int32 = SQLITE_OK
 194014 	var p uintptr = uintptr(0)
 194015 	_ = pUnused
 194016 	if nArg%2 != 0 {
 194017 		rc = SQLITE_ERROR
 194018 	} else {
 194019 		p = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(AsciiTokenizer{})))
 194020 		if p == uintptr(0) {
 194021 			rc = SQLITE_NOMEM
 194022 		} else {
 194023 			var i int32
 194024 			libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(AsciiTokenizer{})))
 194025 			libc.Xmemcpy(tls, p, uintptr(unsafe.Pointer(&aAsciiTokenChar)), uint64(unsafe.Sizeof(aAsciiTokenChar)))
 194026 			for i = 0; rc == SQLITE_OK && i < nArg; i = i + 2 {
 194027 				var zArg uintptr = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+1)*8))
 194028 				if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+38366) {
 194029 					fts5AsciiAddExceptions(tls, p, zArg, 1)
 194030 				} else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+38377) {
 194031 					fts5AsciiAddExceptions(tls, p, zArg, 0)
 194032 				} else {
 194033 					rc = SQLITE_ERROR
 194034 				}
 194035 			}
 194036 			if rc != SQLITE_OK {
 194037 				fts5AsciiDelete(tls, p)
 194038 				p = uintptr(0)
 194039 			}
 194040 		}
 194041 	}
 194042 
 194043 	*(*uintptr)(unsafe.Pointer(ppOut)) = p
 194044 	return rc
 194045 }
 194046 
 194047 func asciiFold(tls *libc.TLS, aOut uintptr, aIn uintptr, nByte int32) {
 194048 	var i int32
 194049 	for i = 0; i < nByte; i++ {
 194050 		var c int8 = *(*int8)(unsafe.Pointer(aIn + uintptr(i)))
 194051 		if int32(c) >= 'A' && int32(c) <= 'Z' {
 194052 			c = int8(int32(c) + 32)
 194053 		}
 194054 		*(*int8)(unsafe.Pointer(aOut + uintptr(i))) = c
 194055 	}
 194056 }
 194057 
 194058 func fts5AsciiTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) int32 {
 194059 	bp := tls.Alloc(64)
 194060 	defer tls.Free(64)
 194061 
 194062 	var p uintptr = pTokenizer
 194063 	var rc int32 = SQLITE_OK
 194064 	var ie int32
 194065 	var is int32 = 0
 194066 
 194067 	var nFold int32 = int32(unsafe.Sizeof([64]int8{}))
 194068 	var pFold uintptr = bp
 194069 	var a uintptr = p
 194070 
 194071 	_ = iUnused
 194072 
 194073 	for is < nText && rc == SQLITE_OK {
 194074 		var nByte int32
 194075 
 194076 		for is < nText && (int32(*(*int8)(unsafe.Pointer(pText + uintptr(is))))&0x80 == 0 && int32(*(*uint8)(unsafe.Pointer(a + uintptr(int32(*(*int8)(unsafe.Pointer(pText + uintptr(is)))))))) == 0) {
 194077 			is++
 194078 		}
 194079 		if is == nText {
 194080 			break
 194081 		}
 194082 
 194083 		ie = is + 1
 194084 		for ie < nText && (int32(*(*int8)(unsafe.Pointer(pText + uintptr(ie))))&0x80 != 0 || *(*uint8)(unsafe.Pointer(a + uintptr(int32(*(*int8)(unsafe.Pointer(pText + uintptr(ie))))))) != 0) {
 194085 			ie++
 194086 		}
 194087 
 194088 		nByte = ie - is
 194089 		if nByte > nFold {
 194090 			if pFold != bp {
 194091 				Xsqlite3_free(tls, pFold)
 194092 			}
 194093 			pFold = Xsqlite3_malloc64(tls, uint64(Sqlite3_int64(nByte)*int64(2)))
 194094 			if pFold == uintptr(0) {
 194095 				rc = SQLITE_NOMEM
 194096 				break
 194097 			}
 194098 			nFold = nByte * 2
 194099 		}
 194100 		asciiFold(tls, pFold, pText+uintptr(is), nByte)
 194101 
 194102 		rc = (*struct {
 194103 			f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
 194104 		})(unsafe.Pointer(&struct{ uintptr }{xToken})).f(tls, pCtx, 0, pFold, nByte, is, ie)
 194105 		is = ie + 1
 194106 	}
 194107 
 194108 	if pFold != bp {
 194109 		Xsqlite3_free(tls, pFold)
 194110 	}
 194111 	if rc == SQLITE_DONE {
 194112 		rc = SQLITE_OK
 194113 	}
 194114 	return rc
 194115 }
 194116 
 194117 type Unicode61Tokenizer1 = struct {
 194118 	FaTokenChar       [128]uint8
 194119 	FaFold            uintptr
 194120 	FnFold            int32
 194121 	FeRemoveDiacritic int32
 194122 	FnException       int32
 194123 	F__ccgo_pad1      [4]byte
 194124 	FaiException      uintptr
 194125 	FaCategory        [32]uint8
 194126 }
 194127 
 194128 type Unicode61Tokenizer = Unicode61Tokenizer1
 194129 
 194130 func fts5UnicodeAddExceptions(tls *libc.TLS, p uintptr, z uintptr, bTokenChars int32) int32 {
 194131 	var rc int32 = SQLITE_OK
 194132 	var n int32 = int32(libc.Xstrlen(tls, z))
 194133 	var aNew uintptr
 194134 
 194135 	if n > 0 {
 194136 		aNew = Xsqlite3_realloc64(tls, (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaiException,
 194137 			uint64(n+(*Unicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint64(unsafe.Sizeof(int32(0))))
 194138 		if aNew != 0 {
 194139 			var nNew int32 = (*Unicode61Tokenizer)(unsafe.Pointer(p)).FnException
 194140 			var zCsr uintptr = z
 194141 			var zTerm uintptr = z + uintptr(n)
 194142 			for zCsr < zTerm {
 194143 				var iCode U32
 194144 				var bToken int32
 194145 				iCode = U32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zCsr, 1))))
 194146 				if iCode >= U32(0xc0) {
 194147 					iCode = U32(sqlite3Utf8Trans1[iCode-U32(0xc0)])
 194148 					for zCsr != zTerm && int32(*(*uint8)(unsafe.Pointer(zCsr)))&0xc0 == 0x80 {
 194149 						iCode = iCode<<6 + U32(0x3f&int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zCsr, 1)))))
 194150 					}
 194151 					if iCode < U32(0x80) || iCode&0xFFFFF800 == U32(0xD800) || iCode&0xFFFFFFFE == U32(0xFFFE) {
 194152 						iCode = U32(0xFFFD)
 194153 					}
 194154 				}
 194155 
 194156 				if iCode < U32(128) {
 194157 					*(*uint8)(unsafe.Pointer(p + uintptr(iCode))) = uint8(bTokenChars)
 194158 				} else {
 194159 					bToken = int32(*(*uint8)(unsafe.Pointer(p + 160 + uintptr(sqlite3Fts5UnicodeCategory(tls, iCode)))))
 194160 
 194161 					if bToken != bTokenChars && sqlite3Fts5UnicodeIsdiacritic(tls, int32(iCode)) == 0 {
 194162 						var i int32
 194163 						for i = 0; i < nNew; i++ {
 194164 							if U32(*(*int32)(unsafe.Pointer(aNew + uintptr(i)*4))) > iCode {
 194165 								break
 194166 							}
 194167 						}
 194168 						libc.Xmemmove(tls, aNew+uintptr(i+1)*4, aNew+uintptr(i)*4, uint64(nNew-i)*uint64(unsafe.Sizeof(int32(0))))
 194169 						*(*int32)(unsafe.Pointer(aNew + uintptr(i)*4)) = int32(iCode)
 194170 						nNew++
 194171 					}
 194172 				}
 194173 			}
 194174 			(*Unicode61Tokenizer)(unsafe.Pointer(p)).FaiException = aNew
 194175 			(*Unicode61Tokenizer)(unsafe.Pointer(p)).FnException = nNew
 194176 		} else {
 194177 			rc = SQLITE_NOMEM
 194178 		}
 194179 	}
 194180 
 194181 	return rc
 194182 }
 194183 
 194184 func fts5UnicodeIsException(tls *libc.TLS, p uintptr, iCode int32) int32 {
 194185 	if (*Unicode61Tokenizer)(unsafe.Pointer(p)).FnException > 0 {
 194186 		var a uintptr = (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaiException
 194187 		var iLo int32 = 0
 194188 		var iHi int32 = (*Unicode61Tokenizer)(unsafe.Pointer(p)).FnException - 1
 194189 
 194190 		for iHi >= iLo {
 194191 			var iTest int32 = (iHi + iLo) / 2
 194192 			if iCode == *(*int32)(unsafe.Pointer(a + uintptr(iTest)*4)) {
 194193 				return 1
 194194 			} else if iCode > *(*int32)(unsafe.Pointer(a + uintptr(iTest)*4)) {
 194195 				iLo = iTest + 1
 194196 			} else {
 194197 				iHi = iTest - 1
 194198 			}
 194199 		}
 194200 	}
 194201 
 194202 	return 0
 194203 }
 194204 
 194205 func fts5UnicodeDelete(tls *libc.TLS, pTok uintptr) {
 194206 	if pTok != 0 {
 194207 		var p uintptr = pTok
 194208 		Xsqlite3_free(tls, (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaiException)
 194209 		Xsqlite3_free(tls, (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold)
 194210 		Xsqlite3_free(tls, p)
 194211 	}
 194212 	return
 194213 }
 194214 
 194215 func unicodeSetCategories(tls *libc.TLS, p uintptr, zCat uintptr) int32 {
 194216 	var z uintptr = zCat
 194217 
 194218 	for *(*int8)(unsafe.Pointer(z)) != 0 {
 194219 		for int32(*(*int8)(unsafe.Pointer(z))) == ' ' || int32(*(*int8)(unsafe.Pointer(z))) == '\t' {
 194220 			z++
 194221 		}
 194222 		if *(*int8)(unsafe.Pointer(z)) != 0 && sqlite3Fts5UnicodeCatParse(tls, z, p+160) != 0 {
 194223 			return SQLITE_ERROR
 194224 		}
 194225 		for int32(*(*int8)(unsafe.Pointer(z))) != ' ' && int32(*(*int8)(unsafe.Pointer(z))) != '\t' && int32(*(*int8)(unsafe.Pointer(z))) != 0 {
 194226 			z++
 194227 		}
 194228 	}
 194229 
 194230 	sqlite3Fts5UnicodeAscii(tls, p+160, p)
 194231 	return SQLITE_OK
 194232 }
 194233 
 194234 func fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 {
 194235 	var rc int32 = SQLITE_OK
 194236 	var p uintptr = uintptr(0)
 194237 
 194238 	_ = pUnused
 194239 
 194240 	if nArg%2 != 0 {
 194241 		rc = SQLITE_ERROR
 194242 	} else {
 194243 		p = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Unicode61Tokenizer{})))
 194244 		if p != 0 {
 194245 			var zCat uintptr = ts + 38388
 194246 			var i int32
 194247 			libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Unicode61Tokenizer{})))
 194248 
 194249 			(*Unicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = FTS5_REMOVE_DIACRITICS_SIMPLE
 194250 			(*Unicode61Tokenizer)(unsafe.Pointer(p)).FnFold = 64
 194251 			(*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, uint64((*Unicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint64(unsafe.Sizeof(int8(0))))
 194252 			if (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold == uintptr(0) {
 194253 				rc = SQLITE_NOMEM
 194254 			}
 194255 
 194256 			for i = 0; rc == SQLITE_OK && i < nArg; i = i + 2 {
 194257 				if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+38397) {
 194258 					zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+1)*8))
 194259 				}
 194260 			}
 194261 
 194262 			if rc == SQLITE_OK {
 194263 				rc = unicodeSetCategories(tls, p, zCat)
 194264 			}
 194265 
 194266 			for i = 0; rc == SQLITE_OK && i < nArg; i = i + 2 {
 194267 				var zArg uintptr = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+1)*8))
 194268 				if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+38408) {
 194269 					if int32(*(*int8)(unsafe.Pointer(zArg))) != '0' && int32(*(*int8)(unsafe.Pointer(zArg))) != '1' && int32(*(*int8)(unsafe.Pointer(zArg))) != '2' || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 {
 194270 						rc = SQLITE_ERROR
 194271 					} else {
 194272 						(*Unicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = int32(*(*int8)(unsafe.Pointer(zArg))) - '0'
 194273 
 194274 					}
 194275 				} else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+38366) {
 194276 					rc = fts5UnicodeAddExceptions(tls, p, zArg, 1)
 194277 				} else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+38377) {
 194278 					rc = fts5UnicodeAddExceptions(tls, p, zArg, 0)
 194279 				} else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+38397) {
 194280 				} else {
 194281 					rc = SQLITE_ERROR
 194282 				}
 194283 			}
 194284 
 194285 		} else {
 194286 			rc = SQLITE_NOMEM
 194287 		}
 194288 		if rc != SQLITE_OK {
 194289 			fts5UnicodeDelete(tls, p)
 194290 			p = uintptr(0)
 194291 		}
 194292 		*(*uintptr)(unsafe.Pointer(ppOut)) = p
 194293 	}
 194294 	return rc
 194295 }
 194296 
 194297 func fts5UnicodeIsAlnum(tls *libc.TLS, p uintptr, iCode int32) int32 {
 194298 	return int32(*(*uint8)(unsafe.Pointer(p + 160 + uintptr(sqlite3Fts5UnicodeCategory(tls, U32(iCode)))))) ^
 194299 		fts5UnicodeIsException(tls, p, iCode)
 194300 }
 194301 
 194302 func fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) int32 {
 194303 	var p uintptr
 194304 	var rc int32
 194305 	var a uintptr
 194306 	var zTerm uintptr
 194307 	var zCsr uintptr
 194308 
 194309 	var aFold uintptr
 194310 	var nFold int32
 194311 	var pEnd uintptr
 194312 	var iCode U32
 194313 	var zOut uintptr
 194314 	var is int32
 194315 	var ie int32
 194316 	p = pTokenizer
 194317 	rc = SQLITE_OK
 194318 	a = p
 194319 	zTerm = pText + uintptr(nText)
 194320 	zCsr = pText
 194321 	aFold = (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold
 194322 	nFold = (*Unicode61Tokenizer)(unsafe.Pointer(p)).FnFold
 194323 	pEnd = aFold + uintptr(nFold-6)
 194324 
 194325 	_ = iUnused
 194326 
 194327 __1:
 194328 	if !(rc == SQLITE_OK) {
 194329 		goto __2
 194330 	}
 194331 	zOut = aFold
 194332 
 194333 __3:
 194334 	if !(1 != 0) {
 194335 		goto __4
 194336 	}
 194337 	if !(zCsr >= zTerm) {
 194338 		goto __5
 194339 	}
 194340 	goto tokenize_done
 194341 __5:
 194342 	;
 194343 	if !(int32(*(*uint8)(unsafe.Pointer(zCsr)))&0x80 != 0) {
 194344 		goto __6
 194345 	}
 194346 
 194347 	is = int32((int64(zCsr) - int64(pText)) / 1)
 194348 	iCode = U32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zCsr, 1))))
 194349 	if !(iCode >= U32(0xc0)) {
 194350 		goto __8
 194351 	}
 194352 	iCode = U32(sqlite3Utf8Trans1[iCode-U32(0xc0)])
 194353 __9:
 194354 	if !(zCsr != zTerm && int32(*(*uint8)(unsafe.Pointer(zCsr)))&0xc0 == 0x80) {
 194355 		goto __10
 194356 	}
 194357 	iCode = iCode<<6 + U32(0x3f&int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zCsr, 1)))))
 194358 	goto __9
 194359 __10:
 194360 	;
 194361 	if !(iCode < U32(0x80) || iCode&0xFFFFF800 == U32(0xD800) || iCode&0xFFFFFFFE == U32(0xFFFE)) {
 194362 		goto __11
 194363 	}
 194364 	iCode = U32(0xFFFD)
 194365 __11:
 194366 	;
 194367 __8:
 194368 	;
 194369 	if !(fts5UnicodeIsAlnum(tls, p, int32(iCode)) != 0) {
 194370 		goto __12
 194371 	}
 194372 	goto non_ascii_tokenchar
 194373 __12:
 194374 	;
 194375 	goto __7
 194376 __6:
 194377 	if !(*(*uint8)(unsafe.Pointer(a + uintptr(*(*uint8)(unsafe.Pointer(zCsr))))) != 0) {
 194378 		goto __13
 194379 	}
 194380 	is = int32((int64(zCsr) - int64(pText)) / 1)
 194381 	goto ascii_tokenchar
 194382 __13:
 194383 	;
 194384 	zCsr++
 194385 __7:
 194386 	;
 194387 	goto __3
 194388 __4:
 194389 	;
 194390 __14:
 194391 	if !(zCsr < zTerm) {
 194392 		goto __15
 194393 	}
 194394 
 194395 	if !(zOut > pEnd) {
 194396 		goto __16
 194397 	}
 194398 	aFold = Xsqlite3_malloc64(tls, uint64(Sqlite3_int64(nFold)*int64(2)))
 194399 	if !(aFold == uintptr(0)) {
 194400 		goto __17
 194401 	}
 194402 	rc = SQLITE_NOMEM
 194403 	goto tokenize_done
 194404 __17:
 194405 	;
 194406 	zOut = aFold + uintptr((int64(zOut)-int64((*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold))/1)
 194407 	libc.Xmemcpy(tls, aFold, (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold, uint64(nFold))
 194408 	Xsqlite3_free(tls, (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold)
 194409 	(*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold = aFold
 194410 	(*Unicode61Tokenizer)(unsafe.Pointer(p)).FnFold = libc.AssignInt32(&nFold, nFold*2)
 194411 	pEnd = aFold + uintptr(nFold-6)
 194412 __16:
 194413 	;
 194414 	if !(int32(*(*uint8)(unsafe.Pointer(zCsr)))&0x80 != 0) {
 194415 		goto __18
 194416 	}
 194417 
 194418 	iCode = U32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zCsr, 1))))
 194419 	if !(iCode >= U32(0xc0)) {
 194420 		goto __20
 194421 	}
 194422 	iCode = U32(sqlite3Utf8Trans1[iCode-U32(0xc0)])
 194423 __21:
 194424 	if !(zCsr != zTerm && int32(*(*uint8)(unsafe.Pointer(zCsr)))&0xc0 == 0x80) {
 194425 		goto __22
 194426 	}
 194427 	iCode = iCode<<6 + U32(0x3f&int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zCsr, 1)))))
 194428 	goto __21
 194429 __22:
 194430 	;
 194431 	if !(iCode < U32(0x80) || iCode&0xFFFFF800 == U32(0xD800) || iCode&0xFFFFFFFE == U32(0xFFFE)) {
 194432 		goto __23
 194433 	}
 194434 	iCode = U32(0xFFFD)
 194435 __23:
 194436 	;
 194437 __20:
 194438 	;
 194439 	if !(fts5UnicodeIsAlnum(tls, p, int32(iCode)) != 0 || sqlite3Fts5UnicodeIsdiacritic(tls, int32(iCode)) != 0) {
 194440 		goto __24
 194441 	}
 194442 non_ascii_tokenchar:
 194443 	iCode = U32(sqlite3Fts5UnicodeFold(tls, int32(iCode), (*Unicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic))
 194444 	if !(iCode != 0) {
 194445 		goto __26
 194446 	}
 194447 	if !(iCode < U32(0x00080)) {
 194448 		goto __27
 194449 	}
 194450 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(U8(iCode & U32(0xFF)))
 194451 	goto __28
 194452 __27:
 194453 	if !(iCode < U32(0x00800)) {
 194454 		goto __29
 194455 	}
 194456 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0xC0 + int32(U8(iCode>>6&U32(0x1F))))
 194457 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode&U32(0x3F))))
 194458 	goto __30
 194459 __29:
 194460 	if !(iCode < U32(0x10000)) {
 194461 		goto __31
 194462 	}
 194463 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0xE0 + int32(U8(iCode>>12&U32(0x0F))))
 194464 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode>>6&U32(0x3F))))
 194465 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode&U32(0x3F))))
 194466 	goto __32
 194467 __31:
 194468 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0xF0 + int32(U8(iCode>>18&U32(0x07))))
 194469 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode>>12&U32(0x3F))))
 194470 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode>>6&U32(0x3F))))
 194471 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode&U32(0x3F))))
 194472 __32:
 194473 	;
 194474 __30:
 194475 	;
 194476 __28:
 194477 	;
 194478 __26:
 194479 	;
 194480 	goto __25
 194481 __24:
 194482 	goto __15
 194483 __25:
 194484 	;
 194485 	goto __19
 194486 __18:
 194487 	if !(int32(*(*uint8)(unsafe.Pointer(a + uintptr(*(*uint8)(unsafe.Pointer(zCsr)))))) == 0) {
 194488 		goto __33
 194489 	}
 194490 
 194491 	goto __15
 194492 	goto __34
 194493 __33:
 194494 ascii_tokenchar:
 194495 	if !(int32(*(*uint8)(unsafe.Pointer(zCsr))) >= 'A' && int32(*(*uint8)(unsafe.Pointer(zCsr))) <= 'Z') {
 194496 		goto __35
 194497 	}
 194498 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(int32(*(*uint8)(unsafe.Pointer(zCsr))) + 32)
 194499 	goto __36
 194500 __35:
 194501 	*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(*(*uint8)(unsafe.Pointer(zCsr)))
 194502 __36:
 194503 	;
 194504 	zCsr++
 194505 __34:
 194506 	;
 194507 __19:
 194508 	;
 194509 	ie = int32((int64(zCsr) - int64(pText)) / 1)
 194510 	goto __14
 194511 __15:
 194512 	;
 194513 	rc = (*struct {
 194514 		f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
 194515 	})(unsafe.Pointer(&struct{ uintptr }{xToken})).f(tls, pCtx, 0, aFold, int32((int64(zOut)-int64(aFold))/1), is, ie)
 194516 	goto __1
 194517 __2:
 194518 	;
 194519 tokenize_done:
 194520 	if !(rc == SQLITE_DONE) {
 194521 		goto __37
 194522 	}
 194523 	rc = SQLITE_OK
 194524 __37:
 194525 	;
 194526 	return rc
 194527 }
 194528 
 194529 type PorterTokenizer1 = struct {
 194530 	Ftokenizer  Fts5_tokenizer
 194531 	FpTokenizer uintptr
 194532 	FaBuf       [128]int8
 194533 }
 194534 
 194535 type PorterTokenizer = PorterTokenizer1
 194536 
 194537 func fts5PorterDelete(tls *libc.TLS, pTok uintptr) {
 194538 	if pTok != 0 {
 194539 		var p uintptr = pTok
 194540 		if (*PorterTokenizer)(unsafe.Pointer(p)).FpTokenizer != 0 {
 194541 			(*struct{ f func(*libc.TLS, uintptr) })(unsafe.Pointer(&struct{ uintptr }{(*PorterTokenizer)(unsafe.Pointer(p)).Ftokenizer.FxDelete})).f(tls, (*PorterTokenizer)(unsafe.Pointer(p)).FpTokenizer)
 194542 		}
 194543 		Xsqlite3_free(tls, p)
 194544 	}
 194545 }
 194546 
 194547 func fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 {
 194548 	bp := tls.Alloc(8)
 194549 	defer tls.Free(8)
 194550 
 194551 	var pApi uintptr = pCtx
 194552 	var rc int32 = SQLITE_OK
 194553 	var pRet uintptr
 194554 	*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
 194555 	var zBase uintptr = ts + 38426
 194556 
 194557 	if nArg > 0 {
 194558 		zBase = *(*uintptr)(unsafe.Pointer(azArg))
 194559 	}
 194560 
 194561 	pRet = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(PorterTokenizer{})))
 194562 	if pRet != 0 {
 194563 		libc.Xmemset(tls, pRet, 0, uint64(unsafe.Sizeof(PorterTokenizer{})))
 194564 		rc = (*struct {
 194565 			f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32
 194566 		})(unsafe.Pointer(&struct{ uintptr }{(*Fts5_api)(unsafe.Pointer(pApi)).FxFindTokenizer})).f(tls, pApi, zBase, bp, pRet)
 194567 	} else {
 194568 		rc = SQLITE_NOMEM
 194569 	}
 194570 	if rc == SQLITE_OK {
 194571 		var nArg2 int32 = func() int32 {
 194572 			if nArg > 0 {
 194573 				return nArg - 1
 194574 			}
 194575 			return 0
 194576 		}()
 194577 		var azArg2 uintptr = func() uintptr {
 194578 			if nArg2 != 0 {
 194579 				return azArg + 1*8
 194580 			}
 194581 			return uintptr(0)
 194582 		}()
 194583 		rc = (*struct {
 194584 			f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
 194585 		})(unsafe.Pointer(&struct{ uintptr }{(*PorterTokenizer)(unsafe.Pointer(pRet)).Ftokenizer.FxCreate})).f(tls, *(*uintptr)(unsafe.Pointer(bp)), azArg2, nArg2, pRet+24)
 194586 	}
 194587 
 194588 	if rc != SQLITE_OK {
 194589 		fts5PorterDelete(tls, pRet)
 194590 		pRet = uintptr(0)
 194591 	}
 194592 	*(*uintptr)(unsafe.Pointer(ppOut)) = pRet
 194593 	return rc
 194594 }
 194595 
 194596 type PorterContext1 = struct {
 194597 	FpCtx   uintptr
 194598 	FxToken uintptr
 194599 	FaBuf   uintptr
 194600 }
 194601 
 194602 type PorterContext = PorterContext1
 194603 
 194604 type PorterRule1 = struct {
 194605 	FzSuffix     uintptr
 194606 	FnSuffix     int32
 194607 	F__ccgo_pad1 [4]byte
 194608 	FxCond       uintptr
 194609 	FzOutput     uintptr
 194610 	FnOutput     int32
 194611 	F__ccgo_pad2 [4]byte
 194612 }
 194613 
 194614 type PorterRule = PorterRule1
 194615 
 194616 func fts5PorterIsVowel(tls *libc.TLS, c int8, bYIsVowel int32) int32 {
 194617 	return libc.Bool32(int32(c) == 'a' || int32(c) == 'e' || int32(c) == 'i' || int32(c) == 'o' || int32(c) == 'u' || bYIsVowel != 0 && int32(c) == 'y')
 194618 }
 194619 
 194620 func fts5PorterGobbleVC(tls *libc.TLS, zStem uintptr, nStem int32, bPrevCons int32) int32 {
 194621 	var i int32
 194622 	var bCons int32 = bPrevCons
 194623 
 194624 	for i = 0; i < nStem; i++ {
 194625 		if 0 == libc.AssignInt32(&bCons, libc.BoolInt32(!(fts5PorterIsVowel(tls, *(*int8)(unsafe.Pointer(zStem + uintptr(i))), bCons) != 0))) {
 194626 			break
 194627 		}
 194628 	}
 194629 
 194630 	for i++; i < nStem; i++ {
 194631 		if libc.AssignInt32(&bCons, libc.BoolInt32(!(fts5PorterIsVowel(tls, *(*int8)(unsafe.Pointer(zStem + uintptr(i))), bCons) != 0))) != 0 {
 194632 			return i + 1
 194633 		}
 194634 	}
 194635 	return 0
 194636 }
 194637 
 194638 func fts5Porter_MGt0(tls *libc.TLS, zStem uintptr, nStem int32) int32 {
 194639 	return libc.BoolInt32(!!(fts5PorterGobbleVC(tls, zStem, nStem, 0) != 0))
 194640 }
 194641 
 194642 func fts5Porter_MGt1(tls *libc.TLS, zStem uintptr, nStem int32) int32 {
 194643 	var n int32
 194644 	n = fts5PorterGobbleVC(tls, zStem, nStem, 0)
 194645 	if n != 0 && fts5PorterGobbleVC(tls, zStem+uintptr(n), nStem-n, 1) != 0 {
 194646 		return 1
 194647 	}
 194648 	return 0
 194649 }
 194650 
 194651 func fts5Porter_MEq1(tls *libc.TLS, zStem uintptr, nStem int32) int32 {
 194652 	var n int32
 194653 	n = fts5PorterGobbleVC(tls, zStem, nStem, 0)
 194654 	if n != 0 && 0 == fts5PorterGobbleVC(tls, zStem+uintptr(n), nStem-n, 1) {
 194655 		return 1
 194656 	}
 194657 	return 0
 194658 }
 194659 
 194660 func fts5Porter_Ostar(tls *libc.TLS, zStem uintptr, nStem int32) int32 {
 194661 	if int32(*(*int8)(unsafe.Pointer(zStem + uintptr(nStem-1)))) == 'w' || int32(*(*int8)(unsafe.Pointer(zStem + uintptr(nStem-1)))) == 'x' || int32(*(*int8)(unsafe.Pointer(zStem + uintptr(nStem-1)))) == 'y' {
 194662 		return 0
 194663 	} else {
 194664 		var i int32
 194665 		var mask int32 = 0
 194666 		var bCons int32 = 0
 194667 		for i = 0; i < nStem; i++ {
 194668 			bCons = libc.BoolInt32(!(fts5PorterIsVowel(tls, *(*int8)(unsafe.Pointer(zStem + uintptr(i))), bCons) != 0))
 194669 
 194670 			mask = mask<<1 + bCons
 194671 		}
 194672 		return libc.Bool32(mask&0x0007 == 0x0005)
 194673 	}
 194674 	return int32(0)
 194675 }
 194676 
 194677 func fts5Porter_MGt1_and_S_or_T(tls *libc.TLS, zStem uintptr, nStem int32) int32 {
 194678 	return libc.Bool32((int32(*(*int8)(unsafe.Pointer(zStem + uintptr(nStem-1)))) == 's' || int32(*(*int8)(unsafe.Pointer(zStem + uintptr(nStem-1)))) == 't') &&
 194679 		fts5Porter_MGt1(tls, zStem, nStem) != 0)
 194680 }
 194681 
 194682 func fts5Porter_Vowel(tls *libc.TLS, zStem uintptr, nStem int32) int32 {
 194683 	var i int32
 194684 	for i = 0; i < nStem; i++ {
 194685 		if fts5PorterIsVowel(tls, *(*int8)(unsafe.Pointer(zStem + uintptr(i))), libc.Bool32(i > 0)) != 0 {
 194686 			return 1
 194687 		}
 194688 	}
 194689 	return 0
 194690 }
 194691 
 194692 func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 {
 194693 	var ret int32 = 0
 194694 	var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf))
 194695 	switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-2)))) {
 194696 	case 'a':
 194697 		if nBuf > 2 && 0 == libc.Xmemcmp(tls, ts+38436, aBuf+uintptr(nBuf-2), uint64(2)) {
 194698 			if fts5Porter_MGt1(tls, aBuf, nBuf-2) != 0 {
 194699 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 2
 194700 			}
 194701 		}
 194702 		break
 194703 
 194704 	case 'c':
 194705 		if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+38439, aBuf+uintptr(nBuf-4), uint64(4)) {
 194706 			if fts5Porter_MGt1(tls, aBuf, nBuf-4) != 0 {
 194707 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4
 194708 			}
 194709 		} else if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+38444, aBuf+uintptr(nBuf-4), uint64(4)) {
 194710 			if fts5Porter_MGt1(tls, aBuf, nBuf-4) != 0 {
 194711 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4
 194712 			}
 194713 		}
 194714 		break
 194715 
 194716 	case 'e':
 194717 		if nBuf > 2 && 0 == libc.Xmemcmp(tls, ts+38449, aBuf+uintptr(nBuf-2), uint64(2)) {
 194718 			if fts5Porter_MGt1(tls, aBuf, nBuf-2) != 0 {
 194719 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 2
 194720 			}
 194721 		}
 194722 		break
 194723 
 194724 	case 'i':
 194725 		if nBuf > 2 && 0 == libc.Xmemcmp(tls, ts+38452, aBuf+uintptr(nBuf-2), uint64(2)) {
 194726 			if fts5Porter_MGt1(tls, aBuf, nBuf-2) != 0 {
 194727 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 2
 194728 			}
 194729 		}
 194730 		break
 194731 
 194732 	case 'l':
 194733 		if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+38455, aBuf+uintptr(nBuf-4), uint64(4)) {
 194734 			if fts5Porter_MGt1(tls, aBuf, nBuf-4) != 0 {
 194735 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4
 194736 			}
 194737 		} else if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+38460, aBuf+uintptr(nBuf-4), uint64(4)) {
 194738 			if fts5Porter_MGt1(tls, aBuf, nBuf-4) != 0 {
 194739 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4
 194740 			}
 194741 		}
 194742 		break
 194743 
 194744 	case 'n':
 194745 		if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+38465, aBuf+uintptr(nBuf-3), uint64(3)) {
 194746 			if fts5Porter_MGt1(tls, aBuf, nBuf-3) != 0 {
 194747 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3
 194748 			}
 194749 		} else if nBuf > 5 && 0 == libc.Xmemcmp(tls, ts+38469, aBuf+uintptr(nBuf-5), uint64(5)) {
 194750 			if fts5Porter_MGt1(tls, aBuf, nBuf-5) != 0 {
 194751 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 5
 194752 			}
 194753 		} else if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+38475, aBuf+uintptr(nBuf-4), uint64(4)) {
 194754 			if fts5Porter_MGt1(tls, aBuf, nBuf-4) != 0 {
 194755 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4
 194756 			}
 194757 		} else if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+38480, aBuf+uintptr(nBuf-3), uint64(3)) {
 194758 			if fts5Porter_MGt1(tls, aBuf, nBuf-3) != 0 {
 194759 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3
 194760 			}
 194761 		}
 194762 		break
 194763 
 194764 	case 'o':
 194765 		if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+38484, aBuf+uintptr(nBuf-3), uint64(3)) {
 194766 			if fts5Porter_MGt1_and_S_or_T(tls, aBuf, nBuf-3) != 0 {
 194767 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3
 194768 			}
 194769 		} else if nBuf > 2 && 0 == libc.Xmemcmp(tls, ts+38488, aBuf+uintptr(nBuf-2), uint64(2)) {
 194770 			if fts5Porter_MGt1(tls, aBuf, nBuf-2) != 0 {
 194771 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 2
 194772 			}
 194773 		}
 194774 		break
 194775 
 194776 	case 's':
 194777 		if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+38491, aBuf+uintptr(nBuf-3), uint64(3)) {
 194778 			if fts5Porter_MGt1(tls, aBuf, nBuf-3) != 0 {
 194779 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3
 194780 			}
 194781 		}
 194782 		break
 194783 
 194784 	case 't':
 194785 		if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+38495, aBuf+uintptr(nBuf-3), uint64(3)) {
 194786 			if fts5Porter_MGt1(tls, aBuf, nBuf-3) != 0 {
 194787 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3
 194788 			}
 194789 		} else if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+38499, aBuf+uintptr(nBuf-3), uint64(3)) {
 194790 			if fts5Porter_MGt1(tls, aBuf, nBuf-3) != 0 {
 194791 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3
 194792 			}
 194793 		}
 194794 		break
 194795 
 194796 	case 'u':
 194797 		if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+38503, aBuf+uintptr(nBuf-3), uint64(3)) {
 194798 			if fts5Porter_MGt1(tls, aBuf, nBuf-3) != 0 {
 194799 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3
 194800 			}
 194801 		}
 194802 		break
 194803 
 194804 	case 'v':
 194805 		if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+38507, aBuf+uintptr(nBuf-3), uint64(3)) {
 194806 			if fts5Porter_MGt1(tls, aBuf, nBuf-3) != 0 {
 194807 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3
 194808 			}
 194809 		}
 194810 		break
 194811 
 194812 	case 'z':
 194813 		if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+38511, aBuf+uintptr(nBuf-3), uint64(3)) {
 194814 			if fts5Porter_MGt1(tls, aBuf, nBuf-3) != 0 {
 194815 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3
 194816 			}
 194817 		}
 194818 		break
 194819 
 194820 	}
 194821 	return ret
 194822 }
 194823 
 194824 func fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 {
 194825 	var ret int32 = 0
 194826 	var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf))
 194827 	switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-2)))) {
 194828 	case 'a':
 194829 		if nBuf > 2 && 0 == libc.Xmemcmp(tls, ts+38515, aBuf+uintptr(nBuf-2), uint64(2)) {
 194830 			libc.Xmemcpy(tls, aBuf+uintptr(nBuf-2), ts+38495, uint64(3))
 194831 			*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 2 + 3
 194832 			ret = 1
 194833 		}
 194834 		break
 194835 
 194836 	case 'b':
 194837 		if nBuf > 2 && 0 == libc.Xmemcmp(tls, ts+38518, aBuf+uintptr(nBuf-2), uint64(2)) {
 194838 			libc.Xmemcpy(tls, aBuf+uintptr(nBuf-2), ts+38521, uint64(3))
 194839 			*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 2 + 3
 194840 			ret = 1
 194841 		}
 194842 		break
 194843 
 194844 	case 'i':
 194845 		if nBuf > 2 && 0 == libc.Xmemcmp(tls, ts+38525, aBuf+uintptr(nBuf-2), uint64(2)) {
 194846 			libc.Xmemcpy(tls, aBuf+uintptr(nBuf-2), ts+38511, uint64(3))
 194847 			*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 2 + 3
 194848 			ret = 1
 194849 		}
 194850 		break
 194851 
 194852 	}
 194853 	return ret
 194854 }
 194855 
 194856 func fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 {
 194857 	var ret int32 = 0
 194858 	var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf))
 194859 	switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-2)))) {
 194860 	case 'a':
 194861 		if nBuf > 7 && 0 == libc.Xmemcmp(tls, ts+38528, aBuf+uintptr(nBuf-7), uint64(7)) {
 194862 			if fts5Porter_MGt0(tls, aBuf, nBuf-7) != 0 {
 194863 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-7), ts+38495, uint64(3))
 194864 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 7 + 3
 194865 			}
 194866 		} else if nBuf > 6 && 0 == libc.Xmemcmp(tls, ts+38536, aBuf+uintptr(nBuf-6), uint64(6)) {
 194867 			if fts5Porter_MGt0(tls, aBuf, nBuf-6) != 0 {
 194868 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-6), ts+38543, uint64(4))
 194869 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 6 + 4
 194870 			}
 194871 		}
 194872 		break
 194873 
 194874 	case 'c':
 194875 		if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+38548, aBuf+uintptr(nBuf-4), uint64(4)) {
 194876 			if fts5Porter_MGt0(tls, aBuf, nBuf-4) != 0 {
 194877 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-4), ts+38444, uint64(4))
 194878 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4 + 4
 194879 			}
 194880 		} else if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+38553, aBuf+uintptr(nBuf-4), uint64(4)) {
 194881 			if fts5Porter_MGt0(tls, aBuf, nBuf-4) != 0 {
 194882 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-4), ts+38439, uint64(4))
 194883 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4 + 4
 194884 			}
 194885 		}
 194886 		break
 194887 
 194888 	case 'e':
 194889 		if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+38558, aBuf+uintptr(nBuf-4), uint64(4)) {
 194890 			if fts5Porter_MGt0(tls, aBuf, nBuf-4) != 0 {
 194891 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-4), ts+38511, uint64(3))
 194892 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4 + 3
 194893 			}
 194894 		}
 194895 		break
 194896 
 194897 	case 'g':
 194898 		if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+38563, aBuf+uintptr(nBuf-4), uint64(4)) {
 194899 			if fts5Porter_MGt0(tls, aBuf, nBuf-4) != 0 {
 194900 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-4), ts+16837, uint64(3))
 194901 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4 + 3
 194902 			}
 194903 		}
 194904 		break
 194905 
 194906 	case 'l':
 194907 		if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+38568, aBuf+uintptr(nBuf-3), uint64(3)) {
 194908 			if fts5Porter_MGt0(tls, aBuf, nBuf-3) != 0 {
 194909 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-3), ts+38521, uint64(3))
 194910 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3 + 3
 194911 			}
 194912 		} else if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+38572, aBuf+uintptr(nBuf-4), uint64(4)) {
 194913 			if fts5Porter_MGt0(tls, aBuf, nBuf-4) != 0 {
 194914 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-4), ts+38436, uint64(2))
 194915 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4 + 2
 194916 			}
 194917 		} else if nBuf > 5 && 0 == libc.Xmemcmp(tls, ts+38577, aBuf+uintptr(nBuf-5), uint64(5)) {
 194918 			if fts5Porter_MGt0(tls, aBuf, nBuf-5) != 0 {
 194919 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-5), ts+38480, uint64(3))
 194920 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 5 + 3
 194921 			}
 194922 		} else if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+38583, aBuf+uintptr(nBuf-3), uint64(3)) {
 194923 			if fts5Porter_MGt0(tls, aBuf, nBuf-3) != 0 {
 194924 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-3), ts+38587, uint64(1))
 194925 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3 + 1
 194926 			}
 194927 		} else if nBuf > 5 && 0 == libc.Xmemcmp(tls, ts+38589, aBuf+uintptr(nBuf-5), uint64(5)) {
 194928 			if fts5Porter_MGt0(tls, aBuf, nBuf-5) != 0 {
 194929 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-5), ts+38503, uint64(3))
 194930 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 5 + 3
 194931 			}
 194932 		}
 194933 		break
 194934 
 194935 	case 'o':
 194936 		if nBuf > 7 && 0 == libc.Xmemcmp(tls, ts+38595, aBuf+uintptr(nBuf-7), uint64(7)) {
 194937 			if fts5Porter_MGt0(tls, aBuf, nBuf-7) != 0 {
 194938 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-7), ts+38511, uint64(3))
 194939 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 7 + 3
 194940 			}
 194941 		} else if nBuf > 5 && 0 == libc.Xmemcmp(tls, ts+38603, aBuf+uintptr(nBuf-5), uint64(5)) {
 194942 			if fts5Porter_MGt0(tls, aBuf, nBuf-5) != 0 {
 194943 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-5), ts+38495, uint64(3))
 194944 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 5 + 3
 194945 			}
 194946 		} else if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+38609, aBuf+uintptr(nBuf-4), uint64(4)) {
 194947 			if fts5Porter_MGt0(tls, aBuf, nBuf-4) != 0 {
 194948 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-4), ts+38495, uint64(3))
 194949 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4 + 3
 194950 			}
 194951 		}
 194952 		break
 194953 
 194954 	case 's':
 194955 		if nBuf > 5 && 0 == libc.Xmemcmp(tls, ts+38614, aBuf+uintptr(nBuf-5), uint64(5)) {
 194956 			if fts5Porter_MGt0(tls, aBuf, nBuf-5) != 0 {
 194957 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-5), ts+38436, uint64(2))
 194958 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 5 + 2
 194959 			}
 194960 		} else if nBuf > 7 && 0 == libc.Xmemcmp(tls, ts+38620, aBuf+uintptr(nBuf-7), uint64(7)) {
 194961 			if fts5Porter_MGt0(tls, aBuf, nBuf-7) != 0 {
 194962 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-7), ts+38507, uint64(3))
 194963 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 7 + 3
 194964 			}
 194965 		} else if nBuf > 7 && 0 == libc.Xmemcmp(tls, ts+38628, aBuf+uintptr(nBuf-7), uint64(7)) {
 194966 			if fts5Porter_MGt0(tls, aBuf, nBuf-7) != 0 {
 194967 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-7), ts+38636, uint64(3))
 194968 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 7 + 3
 194969 			}
 194970 		} else if nBuf > 7 && 0 == libc.Xmemcmp(tls, ts+38640, aBuf+uintptr(nBuf-7), uint64(7)) {
 194971 			if fts5Porter_MGt0(tls, aBuf, nBuf-7) != 0 {
 194972 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-7), ts+38503, uint64(3))
 194973 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 7 + 3
 194974 			}
 194975 		}
 194976 		break
 194977 
 194978 	case 't':
 194979 		if nBuf > 5 && 0 == libc.Xmemcmp(tls, ts+38648, aBuf+uintptr(nBuf-5), uint64(5)) {
 194980 			if fts5Porter_MGt0(tls, aBuf, nBuf-5) != 0 {
 194981 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-5), ts+38436, uint64(2))
 194982 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 5 + 2
 194983 			}
 194984 		} else if nBuf > 5 && 0 == libc.Xmemcmp(tls, ts+38654, aBuf+uintptr(nBuf-5), uint64(5)) {
 194985 			if fts5Porter_MGt0(tls, aBuf, nBuf-5) != 0 {
 194986 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-5), ts+38507, uint64(3))
 194987 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 5 + 3
 194988 			}
 194989 		} else if nBuf > 6 && 0 == libc.Xmemcmp(tls, ts+38660, aBuf+uintptr(nBuf-6), uint64(6)) {
 194990 			if fts5Porter_MGt0(tls, aBuf, nBuf-6) != 0 {
 194991 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-6), ts+38521, uint64(3))
 194992 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 6 + 3
 194993 			}
 194994 		}
 194995 		break
 194996 
 194997 	}
 194998 	return ret
 194999 }
 195000 
 195001 func fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 {
 195002 	var ret int32 = 0
 195003 	var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf))
 195004 	switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-2)))) {
 195005 	case 'a':
 195006 		if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+38667, aBuf+uintptr(nBuf-4), uint64(4)) {
 195007 			if fts5Porter_MGt0(tls, aBuf, nBuf-4) != 0 {
 195008 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-4), ts+38452, uint64(2))
 195009 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4 + 2
 195010 			}
 195011 		}
 195012 		break
 195013 
 195014 	case 's':
 195015 		if nBuf > 4 && 0 == libc.Xmemcmp(tls, ts+38672, aBuf+uintptr(nBuf-4), uint64(4)) {
 195016 			if fts5Porter_MGt0(tls, aBuf, nBuf-4) != 0 {
 195017 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 4
 195018 			}
 195019 		}
 195020 		break
 195021 
 195022 	case 't':
 195023 		if nBuf > 5 && 0 == libc.Xmemcmp(tls, ts+38677, aBuf+uintptr(nBuf-5), uint64(5)) {
 195024 			if fts5Porter_MGt0(tls, aBuf, nBuf-5) != 0 {
 195025 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-5), ts+38452, uint64(2))
 195026 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 5 + 2
 195027 			}
 195028 		} else if nBuf > 5 && 0 == libc.Xmemcmp(tls, ts+38683, aBuf+uintptr(nBuf-5), uint64(5)) {
 195029 			if fts5Porter_MGt0(tls, aBuf, nBuf-5) != 0 {
 195030 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-5), ts+38452, uint64(2))
 195031 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 5 + 2
 195032 			}
 195033 		}
 195034 		break
 195035 
 195036 	case 'u':
 195037 		if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+38636, aBuf+uintptr(nBuf-3), uint64(3)) {
 195038 			if fts5Porter_MGt0(tls, aBuf, nBuf-3) != 0 {
 195039 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3
 195040 			}
 195041 		}
 195042 		break
 195043 
 195044 	case 'v':
 195045 		if nBuf > 5 && 0 == libc.Xmemcmp(tls, ts+38689, aBuf+uintptr(nBuf-5), uint64(5)) {
 195046 			if fts5Porter_MGt0(tls, aBuf, nBuf-5) != 0 {
 195047 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 5
 195048 			}
 195049 		}
 195050 		break
 195051 
 195052 	case 'z':
 195053 		if nBuf > 5 && 0 == libc.Xmemcmp(tls, ts+38695, aBuf+uintptr(nBuf-5), uint64(5)) {
 195054 			if fts5Porter_MGt0(tls, aBuf, nBuf-5) != 0 {
 195055 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-5), ts+38436, uint64(2))
 195056 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 5 + 2
 195057 			}
 195058 		}
 195059 		break
 195060 
 195061 	}
 195062 	return ret
 195063 }
 195064 
 195065 func fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 {
 195066 	var ret int32 = 0
 195067 	var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf))
 195068 	switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-2)))) {
 195069 	case 'e':
 195070 		if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+38701, aBuf+uintptr(nBuf-3), uint64(3)) {
 195071 			if fts5Porter_MGt0(tls, aBuf, nBuf-3) != 0 {
 195072 				libc.Xmemcpy(tls, aBuf+uintptr(nBuf-3), ts+38705, uint64(2))
 195073 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3 + 2
 195074 			}
 195075 		} else if nBuf > 2 && 0 == libc.Xmemcmp(tls, ts+38708, aBuf+uintptr(nBuf-2), uint64(2)) {
 195076 			if fts5Porter_Vowel(tls, aBuf, nBuf-2) != 0 {
 195077 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 2
 195078 				ret = 1
 195079 			}
 195080 		}
 195081 		break
 195082 
 195083 	case 'n':
 195084 		if nBuf > 3 && 0 == libc.Xmemcmp(tls, ts+38711, aBuf+uintptr(nBuf-3), uint64(3)) {
 195085 			if fts5Porter_Vowel(tls, aBuf, nBuf-3) != 0 {
 195086 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 3
 195087 				ret = 1
 195088 			}
 195089 		}
 195090 		break
 195091 
 195092 	}
 195093 	return ret
 195094 }
 195095 
 195096 func fts5PorterStep1A(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) {
 195097 	var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf))
 195098 	if int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-1)))) == 's' {
 195099 		if int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-2)))) == 'e' {
 195100 			if nBuf > 4 && int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-4)))) == 's' && int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-3)))) == 's' ||
 195101 				nBuf > 3 && int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-3)))) == 'i' {
 195102 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 2
 195103 			} else {
 195104 				*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 1
 195105 			}
 195106 		} else if int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-2)))) != 's' {
 195107 			*(*int32)(unsafe.Pointer(pnBuf)) = nBuf - 1
 195108 		}
 195109 	}
 195110 }
 195111 
 195112 func fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nToken int32, iStart int32, iEnd int32) int32 {
 195113 	bp := tls.Alloc(4)
 195114 	defer tls.Free(4)
 195115 
 195116 	var p uintptr
 195117 	var aBuf uintptr
 195118 
 195119 	var c int8
 195120 	p = pCtx
 195121 
 195122 	if !(nToken > FTS5_PORTER_MAX_TOKEN || nToken < 3) {
 195123 		goto __1
 195124 	}
 195125 	goto pass_through
 195126 __1:
 195127 	;
 195128 	aBuf = (*PorterContext)(unsafe.Pointer(p)).FaBuf
 195129 	*(*int32)(unsafe.Pointer(bp)) = nToken
 195130 	libc.Xmemcpy(tls, aBuf, pToken, uint64(*(*int32)(unsafe.Pointer(bp))))
 195131 
 195132 	fts5PorterStep1A(tls, aBuf, bp)
 195133 	if !(fts5PorterStep1B(tls, aBuf, bp) != 0) {
 195134 		goto __2
 195135 	}
 195136 	if !(fts5PorterStep1B2(tls, aBuf, bp) == 0) {
 195137 		goto __3
 195138 	}
 195139 	c = *(*int8)(unsafe.Pointer(aBuf + uintptr(*(*int32)(unsafe.Pointer(bp))-1)))
 195140 	if !(fts5PorterIsVowel(tls, c, 0) == 0 &&
 195141 		int32(c) != 'l' && int32(c) != 's' && int32(c) != 'z' && int32(c) == int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(*(*int32)(unsafe.Pointer(bp))-2))))) {
 195142 		goto __4
 195143 	}
 195144 	*(*int32)(unsafe.Pointer(bp))--
 195145 	goto __5
 195146 __4:
 195147 	if !(fts5Porter_MEq1(tls, aBuf, *(*int32)(unsafe.Pointer(bp))) != 0 && fts5Porter_Ostar(tls, aBuf, *(*int32)(unsafe.Pointer(bp))) != 0) {
 195148 		goto __6
 195149 	}
 195150 	*(*int8)(unsafe.Pointer(aBuf + uintptr(libc.PostIncInt32(&*(*int32)(unsafe.Pointer(bp)), 1)))) = int8('e')
 195151 __6:
 195152 	;
 195153 __5:
 195154 	;
 195155 __3:
 195156 	;
 195157 __2:
 195158 	;
 195159 	if !(int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(*(*int32)(unsafe.Pointer(bp))-1)))) == 'y' && fts5Porter_Vowel(tls, aBuf, *(*int32)(unsafe.Pointer(bp))-1) != 0) {
 195160 		goto __7
 195161 	}
 195162 	*(*int8)(unsafe.Pointer(aBuf + uintptr(*(*int32)(unsafe.Pointer(bp))-1))) = int8('i')
 195163 __7:
 195164 	;
 195165 	fts5PorterStep2(tls, aBuf, bp)
 195166 	fts5PorterStep3(tls, aBuf, bp)
 195167 	fts5PorterStep4(tls, aBuf, bp)
 195168 
 195169 	if !(int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(*(*int32)(unsafe.Pointer(bp))-1)))) == 'e') {
 195170 		goto __8
 195171 	}
 195172 	if !(fts5Porter_MGt1(tls, aBuf, *(*int32)(unsafe.Pointer(bp))-1) != 0 ||
 195173 		fts5Porter_MEq1(tls, aBuf, *(*int32)(unsafe.Pointer(bp))-1) != 0 && !(fts5Porter_Ostar(tls, aBuf, *(*int32)(unsafe.Pointer(bp))-1) != 0)) {
 195174 		goto __9
 195175 	}
 195176 	*(*int32)(unsafe.Pointer(bp))--
 195177 __9:
 195178 	;
 195179 __8:
 195180 	;
 195181 	if !(*(*int32)(unsafe.Pointer(bp)) > 1 && int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(*(*int32)(unsafe.Pointer(bp))-1)))) == 'l' &&
 195182 		int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(*(*int32)(unsafe.Pointer(bp))-2)))) == 'l' && fts5Porter_MGt1(tls, aBuf, *(*int32)(unsafe.Pointer(bp))-1) != 0) {
 195183 		goto __10
 195184 	}
 195185 	*(*int32)(unsafe.Pointer(bp))--
 195186 __10:
 195187 	;
 195188 	return (*struct {
 195189 		f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
 195190 	})(unsafe.Pointer(&struct{ uintptr }{(*PorterContext)(unsafe.Pointer(p)).FxToken})).f(tls, (*PorterContext)(unsafe.Pointer(p)).FpCtx, tflags, aBuf, *(*int32)(unsafe.Pointer(bp)), iStart, iEnd)
 195191 
 195192 pass_through:
 195193 	return (*struct {
 195194 		f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
 195195 	})(unsafe.Pointer(&struct{ uintptr }{(*PorterContext)(unsafe.Pointer(p)).FxToken})).f(tls, (*PorterContext)(unsafe.Pointer(p)).FpCtx, tflags, pToken, nToken, iStart, iEnd)
 195196 }
 195197 
 195198 func fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, xToken uintptr) int32 {
 195199 	bp := tls.Alloc(24)
 195200 	defer tls.Free(24)
 195201 
 195202 	var p uintptr = pTokenizer
 195203 
 195204 	(*PorterContext)(unsafe.Pointer(bp)).FxToken = xToken
 195205 	(*PorterContext)(unsafe.Pointer(bp)).FpCtx = pCtx
 195206 	(*PorterContext)(unsafe.Pointer(bp)).FaBuf = p + 32
 195207 	return (*struct {
 195208 		f func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32
 195209 	})(unsafe.Pointer(&struct{ uintptr }{(*PorterTokenizer)(unsafe.Pointer(p)).Ftokenizer.FxTokenize})).f(tls,
 195210 		(*PorterTokenizer)(unsafe.Pointer(p)).FpTokenizer, bp, flags, pText, nText, *(*uintptr)(unsafe.Pointer(&struct {
 195211 			f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
 195212 		}{fts5PorterCb})))
 195213 }
 195214 
 195215 // *************************************************************************
 195216 //
 195217 // Start of trigram implementation.
 195218 type TrigramTokenizer1 = struct{ FbFold int32 }
 195219 
 195220 // *************************************************************************
 195221 //
 195222 // Start of trigram implementation.
 195223 type TrigramTokenizer = TrigramTokenizer1
 195224 
 195225 func fts5TriDelete(tls *libc.TLS, p uintptr) {
 195226 	Xsqlite3_free(tls, p)
 195227 }
 195228 
 195229 func fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 {
 195230 	var rc int32 = SQLITE_OK
 195231 	var pNew uintptr = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(TrigramTokenizer{})))
 195232 	_ = pUnused
 195233 	if pNew == uintptr(0) {
 195234 		rc = SQLITE_NOMEM
 195235 	} else {
 195236 		var i int32
 195237 		(*TrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = 1
 195238 		for i = 0; rc == SQLITE_OK && i < nArg; i = i + 2 {
 195239 			var zArg uintptr = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+1)*8))
 195240 			if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+38715) {
 195241 				if int32(*(*int8)(unsafe.Pointer(zArg))) != '0' && int32(*(*int8)(unsafe.Pointer(zArg))) != '1' || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 {
 195242 					rc = SQLITE_ERROR
 195243 				} else {
 195244 					(*TrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = libc.Bool32(int32(*(*int8)(unsafe.Pointer(zArg))) == '0')
 195245 				}
 195246 			} else {
 195247 				rc = SQLITE_ERROR
 195248 			}
 195249 		}
 195250 		if rc != SQLITE_OK {
 195251 			fts5TriDelete(tls, pNew)
 195252 			pNew = uintptr(0)
 195253 		}
 195254 	}
 195255 	*(*uintptr)(unsafe.Pointer(ppOut)) = pNew
 195256 	return rc
 195257 }
 195258 
 195259 func fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, xToken uintptr) int32 {
 195260 	bp := tls.Alloc(32)
 195261 	defer tls.Free(32)
 195262 
 195263 	var p uintptr = pTok
 195264 	var rc int32 = SQLITE_OK
 195265 
 195266 	var zIn uintptr = pText
 195267 	var zEof uintptr = zIn + uintptr(nText)
 195268 	var iCode U32
 195269 
 195270 	_ = unusedFlags
 195271 	for 1 != 0 {
 195272 		var zOut uintptr = bp
 195273 		var iStart int32 = int32((int64(zIn) - int64(pText)) / 1)
 195274 		var zNext uintptr
 195275 
 195276 		iCode = U32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))
 195277 		if iCode >= U32(0xc0) {
 195278 			iCode = U32(sqlite3Utf8Trans1[iCode-U32(0xc0)])
 195279 			for zIn != zEof && int32(*(*uint8)(unsafe.Pointer(zIn)))&0xc0 == 0x80 {
 195280 				iCode = iCode<<6 + U32(0x3f&int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))))
 195281 			}
 195282 			if iCode < U32(0x80) || iCode&0xFFFFF800 == U32(0xD800) || iCode&0xFFFFFFFE == U32(0xFFFE) {
 195283 				iCode = U32(0xFFFD)
 195284 			}
 195285 		}
 195286 
 195287 		if iCode == U32(0) {
 195288 			break
 195289 		}
 195290 		zNext = zIn
 195291 		if zIn < zEof {
 195292 			if (*TrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 {
 195293 				iCode = U32(sqlite3Fts5UnicodeFold(tls, int32(iCode), 0))
 195294 			}
 195295 			{
 195296 				if iCode < U32(0x00080) {
 195297 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(U8(iCode & U32(0xFF)))
 195298 				} else if iCode < U32(0x00800) {
 195299 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0xC0 + int32(U8(iCode>>6&U32(0x1F))))
 195300 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode&U32(0x3F))))
 195301 				} else if iCode < U32(0x10000) {
 195302 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0xE0 + int32(U8(iCode>>12&U32(0x0F))))
 195303 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode>>6&U32(0x3F))))
 195304 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode&U32(0x3F))))
 195305 				} else {
 195306 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0xF0 + int32(U8(iCode>>18&U32(0x07))))
 195307 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode>>12&U32(0x3F))))
 195308 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode>>6&U32(0x3F))))
 195309 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode&U32(0x3F))))
 195310 				}
 195311 			}
 195312 
 195313 			iCode = U32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))
 195314 			if iCode >= U32(0xc0) {
 195315 				iCode = U32(sqlite3Utf8Trans1[iCode-U32(0xc0)])
 195316 				for zIn != zEof && int32(*(*uint8)(unsafe.Pointer(zIn)))&0xc0 == 0x80 {
 195317 					iCode = iCode<<6 + U32(0x3f&int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))))
 195318 				}
 195319 				if iCode < U32(0x80) || iCode&0xFFFFF800 == U32(0xD800) || iCode&0xFFFFFFFE == U32(0xFFFE) {
 195320 					iCode = U32(0xFFFD)
 195321 				}
 195322 			}
 195323 
 195324 			if iCode == U32(0) {
 195325 				break
 195326 			}
 195327 		} else {
 195328 			break
 195329 		}
 195330 		if zIn < zEof {
 195331 			if (*TrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 {
 195332 				iCode = U32(sqlite3Fts5UnicodeFold(tls, int32(iCode), 0))
 195333 			}
 195334 			{
 195335 				if iCode < U32(0x00080) {
 195336 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(U8(iCode & U32(0xFF)))
 195337 				} else if iCode < U32(0x00800) {
 195338 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0xC0 + int32(U8(iCode>>6&U32(0x1F))))
 195339 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode&U32(0x3F))))
 195340 				} else if iCode < U32(0x10000) {
 195341 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0xE0 + int32(U8(iCode>>12&U32(0x0F))))
 195342 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode>>6&U32(0x3F))))
 195343 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode&U32(0x3F))))
 195344 				} else {
 195345 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0xF0 + int32(U8(iCode>>18&U32(0x07))))
 195346 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode>>12&U32(0x3F))))
 195347 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode>>6&U32(0x3F))))
 195348 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode&U32(0x3F))))
 195349 				}
 195350 			}
 195351 
 195352 			iCode = U32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))
 195353 			if iCode >= U32(0xc0) {
 195354 				iCode = U32(sqlite3Utf8Trans1[iCode-U32(0xc0)])
 195355 				for zIn != zEof && int32(*(*uint8)(unsafe.Pointer(zIn)))&0xc0 == 0x80 {
 195356 					iCode = iCode<<6 + U32(0x3f&int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))))
 195357 				}
 195358 				if iCode < U32(0x80) || iCode&0xFFFFF800 == U32(0xD800) || iCode&0xFFFFFFFE == U32(0xFFFE) {
 195359 					iCode = U32(0xFFFD)
 195360 				}
 195361 			}
 195362 
 195363 			if iCode == U32(0) {
 195364 				break
 195365 			}
 195366 			if (*TrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 {
 195367 				iCode = U32(sqlite3Fts5UnicodeFold(tls, int32(iCode), 0))
 195368 			}
 195369 			{
 195370 				if iCode < U32(0x00080) {
 195371 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(U8(iCode & U32(0xFF)))
 195372 				} else if iCode < U32(0x00800) {
 195373 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0xC0 + int32(U8(iCode>>6&U32(0x1F))))
 195374 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode&U32(0x3F))))
 195375 				} else if iCode < U32(0x10000) {
 195376 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0xE0 + int32(U8(iCode>>12&U32(0x0F))))
 195377 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode>>6&U32(0x3F))))
 195378 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode&U32(0x3F))))
 195379 				} else {
 195380 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0xF0 + int32(U8(iCode>>18&U32(0x07))))
 195381 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode>>12&U32(0x3F))))
 195382 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode>>6&U32(0x3F))))
 195383 					*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(0x80 + int32(U8(iCode&U32(0x3F))))
 195384 				}
 195385 			}
 195386 
 195387 		} else {
 195388 			break
 195389 		}
 195390 		rc = (*struct {
 195391 			f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
 195392 		})(unsafe.Pointer(&struct{ uintptr }{xToken})).f(tls, pCtx, 0, bp, int32(int64((zOut-bp)/1)), iStart, int32(int64((uintptr(iStart)+zOut-bp)/1)))
 195393 		if rc != SQLITE_OK {
 195394 			break
 195395 		}
 195396 		zIn = zNext
 195397 	}
 195398 
 195399 	return rc
 195400 }
 195401 
 195402 func sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) int32 {
 195403 	if xCreate == *(*uintptr)(unsafe.Pointer(&struct {
 195404 		f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
 195405 	}{fts5TriCreate})) {
 195406 		var p uintptr = pTok
 195407 		if (*TrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 {
 195408 			return FTS5_PATTERN_LIKE
 195409 		}
 195410 		return FTS5_PATTERN_GLOB
 195411 	}
 195412 	return FTS5_PATTERN_NONE
 195413 }
 195414 
 195415 func sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) int32 {
 195416 	bp := tls.Alloc(128)
 195417 	defer tls.Free(128)
 195418 
 195419 	*(*[4]BuiltinTokenizer)(unsafe.Pointer(bp)) = [4]BuiltinTokenizer{
 195420 		{FzName: ts + 38426, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct {
 195421 			f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
 195422 		}{fts5UnicodeCreate})), FxDelete: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5UnicodeDelete})), FxTokenize: *(*uintptr)(unsafe.Pointer(&struct {
 195423 			f func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32
 195424 		}{fts5UnicodeTokenize}))}},
 195425 		{FzName: ts + 38730, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct {
 195426 			f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
 195427 		}{fts5AsciiCreate})), FxDelete: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5AsciiDelete})), FxTokenize: *(*uintptr)(unsafe.Pointer(&struct {
 195428 			f func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32
 195429 		}{fts5AsciiTokenize}))}},
 195430 		{FzName: ts + 38736, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct {
 195431 			f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
 195432 		}{fts5PorterCreate})), FxDelete: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5PorterDelete})), FxTokenize: *(*uintptr)(unsafe.Pointer(&struct {
 195433 			f func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32
 195434 		}{fts5PorterTokenize}))}},
 195435 		{FzName: ts + 38743, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct {
 195436 			f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
 195437 		}{fts5TriCreate})), FxDelete: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5TriDelete})), FxTokenize: *(*uintptr)(unsafe.Pointer(&struct {
 195438 			f func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32
 195439 		}{fts5TriTokenize}))}},
 195440 	}
 195441 
 195442 	var rc int32 = SQLITE_OK
 195443 	var i int32
 195444 
 195445 	for i = 0; rc == SQLITE_OK && i < int32(uint64(unsafe.Sizeof([4]BuiltinTokenizer{}))/uint64(unsafe.Sizeof(BuiltinTokenizer{}))); i++ {
 195446 		rc = (*struct {
 195447 			f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32
 195448 		})(unsafe.Pointer(&struct{ uintptr }{(*Fts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer})).f(tls, pApi,
 195449 			(*BuiltinTokenizer)(unsafe.Pointer(bp+uintptr(i)*32)).FzName,
 195450 			pApi,
 195451 			bp+uintptr(i)*32+8,
 195452 			uintptr(0))
 195453 	}
 195454 
 195455 	return rc
 195456 }
 195457 
 195458 type BuiltinTokenizer = struct {
 195459 	FzName uintptr
 195460 	Fx     Fts5_tokenizer
 195461 }
 195462 
 195463 func fts5_remove_diacritic(tls *libc.TLS, c int32, bComplex int32) int32 {
 195464 	bp := tls.Alloc(378)
 195465 	defer tls.Free(378)
 195466 
 195467 	*(*[126]uint16)(unsafe.Pointer(bp)) = [126]uint16{
 195468 		uint16(0), uint16(1797), uint16(1848), uint16(1859), uint16(1891), uint16(1928), uint16(1940), uint16(1995),
 195469 		uint16(2024), uint16(2040), uint16(2060), uint16(2110), uint16(2168), uint16(2206), uint16(2264), uint16(2286),
 195470 		uint16(2344), uint16(2383), uint16(2472), uint16(2488), uint16(2516), uint16(2596), uint16(2668), uint16(2732),
 195471 		uint16(2782), uint16(2842), uint16(2894), uint16(2954), uint16(2984), uint16(3000), uint16(3028), uint16(3336),
 195472 		uint16(3456), uint16(3696), uint16(3712), uint16(3728), uint16(3744), uint16(3766), uint16(3832), uint16(3896),
 195473 		uint16(3912), uint16(3928), uint16(3944), uint16(3968), uint16(4008), uint16(4040), uint16(4056), uint16(4106),
 195474 		uint16(4138), uint16(4170), uint16(4202), uint16(4234), uint16(4266), uint16(4296), uint16(4312), uint16(4344),
 195475 		uint16(4408), uint16(4424), uint16(4442), uint16(4472), uint16(4488), uint16(4504), uint16(6148), uint16(6198),
 195476 		uint16(6264), uint16(6280), uint16(6360), uint16(6429), uint16(6505), uint16(6529), uint16(61448), uint16(61468),
 195477 		uint16(61512), uint16(61534), uint16(61592), uint16(61610), uint16(61642), uint16(61672), uint16(61688), uint16(61704),
 195478 		uint16(61726), uint16(61784), uint16(61800), uint16(61816), uint16(61836), uint16(61880), uint16(61896), uint16(61914),
 195479 		uint16(61948), uint16(61998), uint16(62062), uint16(62122), uint16(62154), uint16(62184), uint16(62200), uint16(62218),
 195480 		uint16(62252), uint16(62302), uint16(62364), uint16(62410), uint16(62442), uint16(62478), uint16(62536), uint16(62554),
 195481 		uint16(62584), uint16(62604), uint16(62640), uint16(62648), uint16(62656), uint16(62664), uint16(62730), uint16(62766),
 195482 		uint16(62830), uint16(62890), uint16(62924), uint16(62974), uint16(63032), uint16(63050), uint16(63082), uint16(63118),
 195483 		uint16(63182), uint16(63242), uint16(63274), uint16(63310), uint16(63368), uint16(63390),
 195484 	}
 195485 	*(*[126]uint8)(unsafe.Pointer(bp + 252)) = [126]uint8{
 195486 		uint8(0), uint8('a'), uint8('c'), uint8('e'), uint8('i'), uint8('n'),
 195487 		uint8('o'), uint8('u'), uint8('y'), uint8('y'), uint8('a'), uint8('c'),
 195488 		uint8('d'), uint8('e'), uint8('e'), uint8('g'), uint8('h'), uint8('i'),
 195489 		uint8('j'), uint8('k'), uint8('l'), uint8('n'), uint8('o'), uint8('r'),
 195490 		uint8('s'), uint8('t'), uint8('u'), uint8('u'), uint8('w'), uint8('y'),
 195491 		uint8('z'), uint8('o'), uint8('u'), uint8('a'), uint8('i'), uint8('o'),
 195492 		uint8('u'), uint8('u' | int32(uint8(0x80))), uint8('a' | int32(uint8(0x80))), uint8('g'), uint8('k'), uint8('o'),
 195493 		uint8('o' | int32(uint8(0x80))), uint8('j'), uint8('g'), uint8('n'), uint8('a' | int32(uint8(0x80))), uint8('a'),
 195494 		uint8('e'), uint8('i'), uint8('o'), uint8('r'), uint8('u'), uint8('s'),
 195495 		uint8('t'), uint8('h'), uint8('a'), uint8('e'), uint8('o' | int32(uint8(0x80))), uint8('o'),
 195496 		uint8('o' | int32(uint8(0x80))), uint8('y'), uint8(0), uint8(0), uint8(0), uint8(0),
 195497 		uint8(0), uint8(0), uint8(0), uint8(0), uint8('a'), uint8('b'),
 195498 		uint8('c' | int32(uint8(0x80))), uint8('d'), uint8('d'), uint8('e' | int32(uint8(0x80))), uint8('e'), uint8('e' | int32(uint8(0x80))),
 195499 		uint8('f'), uint8('g'), uint8('h'), uint8('h'), uint8('i'), uint8('i' | int32(uint8(0x80))),
 195500 		uint8('k'), uint8('l'), uint8('l' | int32(uint8(0x80))), uint8('l'), uint8('m'), uint8('n'),
 195501 		uint8('o' | int32(uint8(0x80))), uint8('p'), uint8('r'), uint8('r' | int32(uint8(0x80))), uint8('r'), uint8('s'),
 195502 		uint8('s' | int32(uint8(0x80))), uint8('t'), uint8('u'), uint8('u' | int32(uint8(0x80))), uint8('v'), uint8('w'),
 195503 		uint8('w'), uint8('x'), uint8('y'), uint8('z'), uint8('h'), uint8('t'),
 195504 		uint8('w'), uint8('y'), uint8('a'), uint8('a' | int32(uint8(0x80))), uint8('a' | int32(uint8(0x80))), uint8('a' | int32(uint8(0x80))),
 195505 		uint8('e'), uint8('e' | int32(uint8(0x80))), uint8('e' | int32(uint8(0x80))), uint8('i'), uint8('o'), uint8('o' | int32(uint8(0x80))),
 195506 		uint8('o' | int32(uint8(0x80))), uint8('o' | int32(uint8(0x80))), uint8('u'), uint8('u' | int32(uint8(0x80))), uint8('u' | int32(uint8(0x80))), uint8('y'),
 195507 	}
 195508 
 195509 	var key uint32 = uint32(c)<<3 | uint32(0x00000007)
 195510 	var iRes int32 = 0
 195511 	var iHi int32 = int32(uint64(unsafe.Sizeof([126]uint16{}))/uint64(unsafe.Sizeof(uint16(0))) - uint64(1))
 195512 	var iLo int32 = 0
 195513 	for iHi >= iLo {
 195514 		var iTest int32 = (iHi + iLo) / 2
 195515 		if key >= uint32(*(*uint16)(unsafe.Pointer(bp + uintptr(iTest)*2))) {
 195516 			iRes = iTest
 195517 			iLo = iTest + 1
 195518 		} else {
 195519 			iHi = iTest - 1
 195520 		}
 195521 	}
 195522 
 195523 	if bComplex == 0 && int32(*(*uint8)(unsafe.Pointer(bp + 252 + uintptr(iRes))))&0x80 != 0 {
 195524 		return c
 195525 	}
 195526 	if c > int32(*(*uint16)(unsafe.Pointer(bp + uintptr(iRes)*2)))>>3+int32(*(*uint16)(unsafe.Pointer(bp + uintptr(iRes)*2)))&0x07 {
 195527 		return c
 195528 	}
 195529 	return int32(*(*uint8)(unsafe.Pointer(bp + 252 + uintptr(iRes)))) & 0x7F
 195530 }
 195531 
 195532 func sqlite3Fts5UnicodeIsdiacritic(tls *libc.TLS, c int32) int32 {
 195533 	var mask0 uint32 = uint32(0x08029FDF)
 195534 	var mask1 uint32 = uint32(0x000361F8)
 195535 	if c < 768 || c > 817 {
 195536 		return 0
 195537 	}
 195538 	if c < 768+32 {
 195539 		return int32(mask0 & (uint32(1) << (c - 768)))
 195540 	}
 195541 	return int32(mask1 & (uint32(1) << (c - 768 - 32)))
 195542 }
 195543 
 195544 func sqlite3Fts5UnicodeFold(tls *libc.TLS, c int32, eRemoveDiacritic int32) int32 {
 195545 	var ret int32 = c
 195546 
 195547 	if c < 128 {
 195548 		if c >= 'A' && c <= 'Z' {
 195549 			ret = c + ('a' - 'A')
 195550 		}
 195551 	} else if c < 65536 {
 195552 		var p uintptr
 195553 		var iHi int32 = int32(uint64(unsafe.Sizeof(aEntry))/uint64(unsafe.Sizeof(TableEntry{})) - uint64(1))
 195554 		var iLo int32 = 0
 195555 		var iRes int32 = -1
 195556 
 195557 		for iHi >= iLo {
 195558 			var iTest int32 = (iHi + iLo) / 2
 195559 			var cmp int32 = c - int32(aEntry[iTest].FiCode)
 195560 			if cmp >= 0 {
 195561 				iRes = iTest
 195562 				iLo = iTest + 1
 195563 			} else {
 195564 				iHi = iTest - 1
 195565 			}
 195566 		}
 195567 
 195568 		p = uintptr(unsafe.Pointer(&aEntry)) + uintptr(iRes)*4
 195569 		if c < int32((*TableEntry)(unsafe.Pointer(p)).FiCode)+int32((*TableEntry)(unsafe.Pointer(p)).FnRange) && 0 == 0x01&int32((*TableEntry)(unsafe.Pointer(p)).Fflags)&(int32((*TableEntry)(unsafe.Pointer(p)).FiCode)^c) {
 195570 			ret = (c + int32(aiOff[int32((*TableEntry)(unsafe.Pointer(p)).Fflags)>>1])) & 0x0000FFFF
 195571 
 195572 		}
 195573 
 195574 		if eRemoveDiacritic != 0 {
 195575 			ret = fts5_remove_diacritic(tls, ret, libc.Bool32(eRemoveDiacritic == 2))
 195576 		}
 195577 	} else if c >= 66560 && c < 66600 {
 195578 		ret = c + 40
 195579 	}
 195580 
 195581 	return ret
 195582 }
 195583 
 195584 // Each entry in the following array defines a rule for folding a range
 195585 // of codepoints to lower case. The rule applies to a range of nRange
 195586 // codepoints starting at codepoint iCode.
 195587 //
 195588 // If the least significant bit in flags is clear, then the rule applies
 195589 // to all nRange codepoints (i.e. all nRange codepoints are upper case and
 195590 // need to be folded). Or, if it is set, then the rule only applies to
 195591 // every second codepoint in the range, starting with codepoint C.
 195592 //
 195593 // The 7 most significant bits in flags are an index into the aiOff[]
 195594 // array. If a specific codepoint C does require folding, then its lower
 195595 // case equivalent is ((C + aiOff[flags>>1]) & 0xFFFF).
 195596 //
 195597 // The contents of this array are generated by parsing the CaseFolding.txt
 195598 // file distributed as part of the "Unicode Character Database". See
 195599 // http://www.unicode.org for details.
 195600 type TableEntry = struct {
 195601 	FiCode  uint16
 195602 	Fflags  uint8
 195603 	FnRange uint8
 195604 }
 195605 
 195606 var aEntry = [163]TableEntry{
 195607 	{FiCode: uint16(65), Fflags: uint8(14), FnRange: uint8(26)}, {FiCode: uint16(181), Fflags: uint8(64), FnRange: uint8(1)}, {FiCode: uint16(192), Fflags: uint8(14), FnRange: uint8(23)},
 195608 	{FiCode: uint16(216), Fflags: uint8(14), FnRange: uint8(7)}, {FiCode: uint16(256), Fflags: uint8(1), FnRange: uint8(48)}, {FiCode: uint16(306), Fflags: uint8(1), FnRange: uint8(6)},
 195609 	{FiCode: uint16(313), Fflags: uint8(1), FnRange: uint8(16)}, {FiCode: uint16(330), Fflags: uint8(1), FnRange: uint8(46)}, {FiCode: uint16(376), Fflags: uint8(116), FnRange: uint8(1)},
 195610 	{FiCode: uint16(377), Fflags: uint8(1), FnRange: uint8(6)}, {FiCode: uint16(383), Fflags: uint8(104), FnRange: uint8(1)}, {FiCode: uint16(385), Fflags: uint8(50), FnRange: uint8(1)},
 195611 	{FiCode: uint16(386), Fflags: uint8(1), FnRange: uint8(4)}, {FiCode: uint16(390), Fflags: uint8(44), FnRange: uint8(1)}, {FiCode: uint16(391), FnRange: uint8(1)},
 195612 	{FiCode: uint16(393), Fflags: uint8(42), FnRange: uint8(2)}, {FiCode: uint16(395), FnRange: uint8(1)}, {FiCode: uint16(398), Fflags: uint8(32), FnRange: uint8(1)},
 195613 	{FiCode: uint16(399), Fflags: uint8(38), FnRange: uint8(1)}, {FiCode: uint16(400), Fflags: uint8(40), FnRange: uint8(1)}, {FiCode: uint16(401), FnRange: uint8(1)},
 195614 	{FiCode: uint16(403), Fflags: uint8(42), FnRange: uint8(1)}, {FiCode: uint16(404), Fflags: uint8(46), FnRange: uint8(1)}, {FiCode: uint16(406), Fflags: uint8(52), FnRange: uint8(1)},
 195615 	{FiCode: uint16(407), Fflags: uint8(48), FnRange: uint8(1)}, {FiCode: uint16(408), FnRange: uint8(1)}, {FiCode: uint16(412), Fflags: uint8(52), FnRange: uint8(1)},
 195616 	{FiCode: uint16(413), Fflags: uint8(54), FnRange: uint8(1)}, {FiCode: uint16(415), Fflags: uint8(56), FnRange: uint8(1)}, {FiCode: uint16(416), Fflags: uint8(1), FnRange: uint8(6)},
 195617 	{FiCode: uint16(422), Fflags: uint8(60), FnRange: uint8(1)}, {FiCode: uint16(423), FnRange: uint8(1)}, {FiCode: uint16(425), Fflags: uint8(60), FnRange: uint8(1)},
 195618 	{FiCode: uint16(428), FnRange: uint8(1)}, {FiCode: uint16(430), Fflags: uint8(60), FnRange: uint8(1)}, {FiCode: uint16(431), FnRange: uint8(1)},
 195619 	{FiCode: uint16(433), Fflags: uint8(58), FnRange: uint8(2)}, {FiCode: uint16(435), Fflags: uint8(1), FnRange: uint8(4)}, {FiCode: uint16(439), Fflags: uint8(62), FnRange: uint8(1)},
 195620 	{FiCode: uint16(440), FnRange: uint8(1)}, {FiCode: uint16(444), FnRange: uint8(1)}, {FiCode: uint16(452), Fflags: uint8(2), FnRange: uint8(1)},
 195621 	{FiCode: uint16(453), FnRange: uint8(1)}, {FiCode: uint16(455), Fflags: uint8(2), FnRange: uint8(1)}, {FiCode: uint16(456), FnRange: uint8(1)},
 195622 	{FiCode: uint16(458), Fflags: uint8(2), FnRange: uint8(1)}, {FiCode: uint16(459), Fflags: uint8(1), FnRange: uint8(18)}, {FiCode: uint16(478), Fflags: uint8(1), FnRange: uint8(18)},
 195623 	{FiCode: uint16(497), Fflags: uint8(2), FnRange: uint8(1)}, {FiCode: uint16(498), Fflags: uint8(1), FnRange: uint8(4)}, {FiCode: uint16(502), Fflags: uint8(122), FnRange: uint8(1)},
 195624 	{FiCode: uint16(503), Fflags: uint8(134), FnRange: uint8(1)}, {FiCode: uint16(504), Fflags: uint8(1), FnRange: uint8(40)}, {FiCode: uint16(544), Fflags: uint8(110), FnRange: uint8(1)},
 195625 	{FiCode: uint16(546), Fflags: uint8(1), FnRange: uint8(18)}, {FiCode: uint16(570), Fflags: uint8(70), FnRange: uint8(1)}, {FiCode: uint16(571), FnRange: uint8(1)},
 195626 	{FiCode: uint16(573), Fflags: uint8(108), FnRange: uint8(1)}, {FiCode: uint16(574), Fflags: uint8(68), FnRange: uint8(1)}, {FiCode: uint16(577), FnRange: uint8(1)},
 195627 	{FiCode: uint16(579), Fflags: uint8(106), FnRange: uint8(1)}, {FiCode: uint16(580), Fflags: uint8(28), FnRange: uint8(1)}, {FiCode: uint16(581), Fflags: uint8(30), FnRange: uint8(1)},
 195628 	{FiCode: uint16(582), Fflags: uint8(1), FnRange: uint8(10)}, {FiCode: uint16(837), Fflags: uint8(36), FnRange: uint8(1)}, {FiCode: uint16(880), Fflags: uint8(1), FnRange: uint8(4)},
 195629 	{FiCode: uint16(886), FnRange: uint8(1)}, {FiCode: uint16(902), Fflags: uint8(18), FnRange: uint8(1)}, {FiCode: uint16(904), Fflags: uint8(16), FnRange: uint8(3)},
 195630 	{FiCode: uint16(908), Fflags: uint8(26), FnRange: uint8(1)}, {FiCode: uint16(910), Fflags: uint8(24), FnRange: uint8(2)}, {FiCode: uint16(913), Fflags: uint8(14), FnRange: uint8(17)},
 195631 	{FiCode: uint16(931), Fflags: uint8(14), FnRange: uint8(9)}, {FiCode: uint16(962), FnRange: uint8(1)}, {FiCode: uint16(975), Fflags: uint8(4), FnRange: uint8(1)},
 195632 	{FiCode: uint16(976), Fflags: uint8(140), FnRange: uint8(1)}, {FiCode: uint16(977), Fflags: uint8(142), FnRange: uint8(1)}, {FiCode: uint16(981), Fflags: uint8(146), FnRange: uint8(1)},
 195633 	{FiCode: uint16(982), Fflags: uint8(144), FnRange: uint8(1)}, {FiCode: uint16(984), Fflags: uint8(1), FnRange: uint8(24)}, {FiCode: uint16(1008), Fflags: uint8(136), FnRange: uint8(1)},
 195634 	{FiCode: uint16(1009), Fflags: uint8(138), FnRange: uint8(1)}, {FiCode: uint16(1012), Fflags: uint8(130), FnRange: uint8(1)}, {FiCode: uint16(1013), Fflags: uint8(128), FnRange: uint8(1)},
 195635 	{FiCode: uint16(1015), FnRange: uint8(1)}, {FiCode: uint16(1017), Fflags: uint8(152), FnRange: uint8(1)}, {FiCode: uint16(1018), FnRange: uint8(1)},
 195636 	{FiCode: uint16(1021), Fflags: uint8(110), FnRange: uint8(3)}, {FiCode: uint16(1024), Fflags: uint8(34), FnRange: uint8(16)}, {FiCode: uint16(1040), Fflags: uint8(14), FnRange: uint8(32)},
 195637 	{FiCode: uint16(1120), Fflags: uint8(1), FnRange: uint8(34)}, {FiCode: uint16(1162), Fflags: uint8(1), FnRange: uint8(54)}, {FiCode: uint16(1216), Fflags: uint8(6), FnRange: uint8(1)},
 195638 	{FiCode: uint16(1217), Fflags: uint8(1), FnRange: uint8(14)}, {FiCode: uint16(1232), Fflags: uint8(1), FnRange: uint8(88)}, {FiCode: uint16(1329), Fflags: uint8(22), FnRange: uint8(38)},
 195639 	{FiCode: uint16(4256), Fflags: uint8(66), FnRange: uint8(38)}, {FiCode: uint16(4295), Fflags: uint8(66), FnRange: uint8(1)}, {FiCode: uint16(4301), Fflags: uint8(66), FnRange: uint8(1)},
 195640 	{FiCode: uint16(7680), Fflags: uint8(1), FnRange: uint8(150)}, {FiCode: uint16(7835), Fflags: uint8(132), FnRange: uint8(1)}, {FiCode: uint16(7838), Fflags: uint8(96), FnRange: uint8(1)},
 195641 	{FiCode: uint16(7840), Fflags: uint8(1), FnRange: uint8(96)}, {FiCode: uint16(7944), Fflags: uint8(150), FnRange: uint8(8)}, {FiCode: uint16(7960), Fflags: uint8(150), FnRange: uint8(6)},
 195642 	{FiCode: uint16(7976), Fflags: uint8(150), FnRange: uint8(8)}, {FiCode: uint16(7992), Fflags: uint8(150), FnRange: uint8(8)}, {FiCode: uint16(8008), Fflags: uint8(150), FnRange: uint8(6)},
 195643 	{FiCode: uint16(8025), Fflags: uint8(151), FnRange: uint8(8)}, {FiCode: uint16(8040), Fflags: uint8(150), FnRange: uint8(8)}, {FiCode: uint16(8072), Fflags: uint8(150), FnRange: uint8(8)},
 195644 	{FiCode: uint16(8088), Fflags: uint8(150), FnRange: uint8(8)}, {FiCode: uint16(8104), Fflags: uint8(150), FnRange: uint8(8)}, {FiCode: uint16(8120), Fflags: uint8(150), FnRange: uint8(2)},
 195645 	{FiCode: uint16(8122), Fflags: uint8(126), FnRange: uint8(2)}, {FiCode: uint16(8124), Fflags: uint8(148), FnRange: uint8(1)}, {FiCode: uint16(8126), Fflags: uint8(100), FnRange: uint8(1)},
 195646 	{FiCode: uint16(8136), Fflags: uint8(124), FnRange: uint8(4)}, {FiCode: uint16(8140), Fflags: uint8(148), FnRange: uint8(1)}, {FiCode: uint16(8152), Fflags: uint8(150), FnRange: uint8(2)},
 195647 	{FiCode: uint16(8154), Fflags: uint8(120), FnRange: uint8(2)}, {FiCode: uint16(8168), Fflags: uint8(150), FnRange: uint8(2)}, {FiCode: uint16(8170), Fflags: uint8(118), FnRange: uint8(2)},
 195648 	{FiCode: uint16(8172), Fflags: uint8(152), FnRange: uint8(1)}, {FiCode: uint16(8184), Fflags: uint8(112), FnRange: uint8(2)}, {FiCode: uint16(8186), Fflags: uint8(114), FnRange: uint8(2)},
 195649 	{FiCode: uint16(8188), Fflags: uint8(148), FnRange: uint8(1)}, {FiCode: uint16(8486), Fflags: uint8(98), FnRange: uint8(1)}, {FiCode: uint16(8490), Fflags: uint8(92), FnRange: uint8(1)},
 195650 	{FiCode: uint16(8491), Fflags: uint8(94), FnRange: uint8(1)}, {FiCode: uint16(8498), Fflags: uint8(12), FnRange: uint8(1)}, {FiCode: uint16(8544), Fflags: uint8(8), FnRange: uint8(16)},
 195651 	{FiCode: uint16(8579), FnRange: uint8(1)}, {FiCode: uint16(9398), Fflags: uint8(10), FnRange: uint8(26)}, {FiCode: uint16(11264), Fflags: uint8(22), FnRange: uint8(47)},
 195652 	{FiCode: uint16(11360), FnRange: uint8(1)}, {FiCode: uint16(11362), Fflags: uint8(88), FnRange: uint8(1)}, {FiCode: uint16(11363), Fflags: uint8(102), FnRange: uint8(1)},
 195653 	{FiCode: uint16(11364), Fflags: uint8(90), FnRange: uint8(1)}, {FiCode: uint16(11367), Fflags: uint8(1), FnRange: uint8(6)}, {FiCode: uint16(11373), Fflags: uint8(84), FnRange: uint8(1)},
 195654 	{FiCode: uint16(11374), Fflags: uint8(86), FnRange: uint8(1)}, {FiCode: uint16(11375), Fflags: uint8(80), FnRange: uint8(1)}, {FiCode: uint16(11376), Fflags: uint8(82), FnRange: uint8(1)},
 195655 	{FiCode: uint16(11378), FnRange: uint8(1)}, {FiCode: uint16(11381), FnRange: uint8(1)}, {FiCode: uint16(11390), Fflags: uint8(78), FnRange: uint8(2)},
 195656 	{FiCode: uint16(11392), Fflags: uint8(1), FnRange: uint8(100)}, {FiCode: uint16(11499), Fflags: uint8(1), FnRange: uint8(4)}, {FiCode: uint16(11506), FnRange: uint8(1)},
 195657 	{FiCode: uint16(42560), Fflags: uint8(1), FnRange: uint8(46)}, {FiCode: uint16(42624), Fflags: uint8(1), FnRange: uint8(24)}, {FiCode: uint16(42786), Fflags: uint8(1), FnRange: uint8(14)},
 195658 	{FiCode: uint16(42802), Fflags: uint8(1), FnRange: uint8(62)}, {FiCode: uint16(42873), Fflags: uint8(1), FnRange: uint8(4)}, {FiCode: uint16(42877), Fflags: uint8(76), FnRange: uint8(1)},
 195659 	{FiCode: uint16(42878), Fflags: uint8(1), FnRange: uint8(10)}, {FiCode: uint16(42891), FnRange: uint8(1)}, {FiCode: uint16(42893), Fflags: uint8(74), FnRange: uint8(1)},
 195660 	{FiCode: uint16(42896), Fflags: uint8(1), FnRange: uint8(4)}, {FiCode: uint16(42912), Fflags: uint8(1), FnRange: uint8(10)}, {FiCode: uint16(42922), Fflags: uint8(72), FnRange: uint8(1)},
 195661 	{FiCode: uint16(65313), Fflags: uint8(14), FnRange: uint8(26)},
 195662 }
 195663 var aiOff = [77]uint16{
 195664 	uint16(1), uint16(2), uint16(8), uint16(15), uint16(16), uint16(26), uint16(28), uint16(32),
 195665 	uint16(37), uint16(38), uint16(40), uint16(48), uint16(63), uint16(64), uint16(69), uint16(71),
 195666 	uint16(79), uint16(80), uint16(116), uint16(202), uint16(203), uint16(205), uint16(206), uint16(207),
 195667 	uint16(209), uint16(210), uint16(211), uint16(213), uint16(214), uint16(217), uint16(218), uint16(219),
 195668 	uint16(775), uint16(7264), uint16(10792), uint16(10795), uint16(23228), uint16(23256), uint16(30204), uint16(54721),
 195669 	uint16(54753), uint16(54754), uint16(54756), uint16(54787), uint16(54793), uint16(54809), uint16(57153), uint16(57274),
 195670 	uint16(57921), uint16(58019), uint16(58363), uint16(61722), uint16(65268), uint16(65341), uint16(65373), uint16(65406),
 195671 	uint16(65408), uint16(65410), uint16(65415), uint16(65424), uint16(65436), uint16(65439), uint16(65450), uint16(65462),
 195672 	uint16(65472), uint16(65476), uint16(65478), uint16(65480), uint16(65482), uint16(65488), uint16(65506), uint16(65511),
 195673 	uint16(65514), uint16(65521), uint16(65527), uint16(65528), uint16(65529),
 195674 }
 195675 
 195676 func sqlite3Fts5UnicodeCatParse(tls *libc.TLS, zCat uintptr, aArray uintptr) int32 {
 195677 	*(*U8)(unsafe.Pointer(aArray)) = U8(1)
 195678 	switch int32(*(*int8)(unsafe.Pointer(zCat))) {
 195679 	case 'C':
 195680 		switch int32(*(*int8)(unsafe.Pointer(zCat + 1))) {
 195681 		case 'c':
 195682 			*(*U8)(unsafe.Pointer(aArray + 1)) = U8(1)
 195683 			break
 195684 		case 'f':
 195685 			*(*U8)(unsafe.Pointer(aArray + 2)) = U8(1)
 195686 			break
 195687 		case 'n':
 195688 			*(*U8)(unsafe.Pointer(aArray + 3)) = U8(1)
 195689 			break
 195690 		case 's':
 195691 			*(*U8)(unsafe.Pointer(aArray + 4)) = U8(1)
 195692 			break
 195693 		case 'o':
 195694 			*(*U8)(unsafe.Pointer(aArray + 31)) = U8(1)
 195695 			break
 195696 		case '*':
 195697 			*(*U8)(unsafe.Pointer(aArray + 1)) = U8(1)
 195698 			*(*U8)(unsafe.Pointer(aArray + 2)) = U8(1)
 195699 			*(*U8)(unsafe.Pointer(aArray + 3)) = U8(1)
 195700 			*(*U8)(unsafe.Pointer(aArray + 4)) = U8(1)
 195701 			*(*U8)(unsafe.Pointer(aArray + 31)) = U8(1)
 195702 			break
 195703 		default:
 195704 			return 1
 195705 		}
 195706 		break
 195707 
 195708 	case 'L':
 195709 		switch int32(*(*int8)(unsafe.Pointer(zCat + 1))) {
 195710 		case 'l':
 195711 			*(*U8)(unsafe.Pointer(aArray + 5)) = U8(1)
 195712 			break
 195713 		case 'm':
 195714 			*(*U8)(unsafe.Pointer(aArray + 6)) = U8(1)
 195715 			break
 195716 		case 'o':
 195717 			*(*U8)(unsafe.Pointer(aArray + 7)) = U8(1)
 195718 			break
 195719 		case 't':
 195720 			*(*U8)(unsafe.Pointer(aArray + 8)) = U8(1)
 195721 			break
 195722 		case 'u':
 195723 			*(*U8)(unsafe.Pointer(aArray + 9)) = U8(1)
 195724 			break
 195725 		case 'C':
 195726 			*(*U8)(unsafe.Pointer(aArray + 30)) = U8(1)
 195727 			break
 195728 		case '*':
 195729 			*(*U8)(unsafe.Pointer(aArray + 5)) = U8(1)
 195730 			*(*U8)(unsafe.Pointer(aArray + 6)) = U8(1)
 195731 			*(*U8)(unsafe.Pointer(aArray + 7)) = U8(1)
 195732 			*(*U8)(unsafe.Pointer(aArray + 8)) = U8(1)
 195733 			*(*U8)(unsafe.Pointer(aArray + 9)) = U8(1)
 195734 			*(*U8)(unsafe.Pointer(aArray + 30)) = U8(1)
 195735 			break
 195736 		default:
 195737 			return 1
 195738 		}
 195739 		break
 195740 
 195741 	case 'M':
 195742 		switch int32(*(*int8)(unsafe.Pointer(zCat + 1))) {
 195743 		case 'c':
 195744 			*(*U8)(unsafe.Pointer(aArray + 10)) = U8(1)
 195745 			break
 195746 		case 'e':
 195747 			*(*U8)(unsafe.Pointer(aArray + 11)) = U8(1)
 195748 			break
 195749 		case 'n':
 195750 			*(*U8)(unsafe.Pointer(aArray + 12)) = U8(1)
 195751 			break
 195752 		case '*':
 195753 			*(*U8)(unsafe.Pointer(aArray + 10)) = U8(1)
 195754 			*(*U8)(unsafe.Pointer(aArray + 11)) = U8(1)
 195755 			*(*U8)(unsafe.Pointer(aArray + 12)) = U8(1)
 195756 			break
 195757 		default:
 195758 			return 1
 195759 		}
 195760 		break
 195761 
 195762 	case 'N':
 195763 		switch int32(*(*int8)(unsafe.Pointer(zCat + 1))) {
 195764 		case 'd':
 195765 			*(*U8)(unsafe.Pointer(aArray + 13)) = U8(1)
 195766 			break
 195767 		case 'l':
 195768 			*(*U8)(unsafe.Pointer(aArray + 14)) = U8(1)
 195769 			break
 195770 		case 'o':
 195771 			*(*U8)(unsafe.Pointer(aArray + 15)) = U8(1)
 195772 			break
 195773 		case '*':
 195774 			*(*U8)(unsafe.Pointer(aArray + 13)) = U8(1)
 195775 			*(*U8)(unsafe.Pointer(aArray + 14)) = U8(1)
 195776 			*(*U8)(unsafe.Pointer(aArray + 15)) = U8(1)
 195777 			break
 195778 		default:
 195779 			return 1
 195780 		}
 195781 		break
 195782 
 195783 	case 'P':
 195784 		switch int32(*(*int8)(unsafe.Pointer(zCat + 1))) {
 195785 		case 'c':
 195786 			*(*U8)(unsafe.Pointer(aArray + 16)) = U8(1)
 195787 			break
 195788 		case 'd':
 195789 			*(*U8)(unsafe.Pointer(aArray + 17)) = U8(1)
 195790 			break
 195791 		case 'e':
 195792 			*(*U8)(unsafe.Pointer(aArray + 18)) = U8(1)
 195793 			break
 195794 		case 'f':
 195795 			*(*U8)(unsafe.Pointer(aArray + 19)) = U8(1)
 195796 			break
 195797 		case 'i':
 195798 			*(*U8)(unsafe.Pointer(aArray + 20)) = U8(1)
 195799 			break
 195800 		case 'o':
 195801 			*(*U8)(unsafe.Pointer(aArray + 21)) = U8(1)
 195802 			break
 195803 		case 's':
 195804 			*(*U8)(unsafe.Pointer(aArray + 22)) = U8(1)
 195805 			break
 195806 		case '*':
 195807 			*(*U8)(unsafe.Pointer(aArray + 16)) = U8(1)
 195808 			*(*U8)(unsafe.Pointer(aArray + 17)) = U8(1)
 195809 			*(*U8)(unsafe.Pointer(aArray + 18)) = U8(1)
 195810 			*(*U8)(unsafe.Pointer(aArray + 19)) = U8(1)
 195811 			*(*U8)(unsafe.Pointer(aArray + 20)) = U8(1)
 195812 			*(*U8)(unsafe.Pointer(aArray + 21)) = U8(1)
 195813 			*(*U8)(unsafe.Pointer(aArray + 22)) = U8(1)
 195814 			break
 195815 		default:
 195816 			return 1
 195817 		}
 195818 		break
 195819 
 195820 	case 'S':
 195821 		switch int32(*(*int8)(unsafe.Pointer(zCat + 1))) {
 195822 		case 'c':
 195823 			*(*U8)(unsafe.Pointer(aArray + 23)) = U8(1)
 195824 			break
 195825 		case 'k':
 195826 			*(*U8)(unsafe.Pointer(aArray + 24)) = U8(1)
 195827 			break
 195828 		case 'm':
 195829 			*(*U8)(unsafe.Pointer(aArray + 25)) = U8(1)
 195830 			break
 195831 		case 'o':
 195832 			*(*U8)(unsafe.Pointer(aArray + 26)) = U8(1)
 195833 			break
 195834 		case '*':
 195835 			*(*U8)(unsafe.Pointer(aArray + 23)) = U8(1)
 195836 			*(*U8)(unsafe.Pointer(aArray + 24)) = U8(1)
 195837 			*(*U8)(unsafe.Pointer(aArray + 25)) = U8(1)
 195838 			*(*U8)(unsafe.Pointer(aArray + 26)) = U8(1)
 195839 			break
 195840 		default:
 195841 			return 1
 195842 		}
 195843 		break
 195844 
 195845 	case 'Z':
 195846 		switch int32(*(*int8)(unsafe.Pointer(zCat + 1))) {
 195847 		case 'l':
 195848 			*(*U8)(unsafe.Pointer(aArray + 27)) = U8(1)
 195849 			break
 195850 		case 'p':
 195851 			*(*U8)(unsafe.Pointer(aArray + 28)) = U8(1)
 195852 			break
 195853 		case 's':
 195854 			*(*U8)(unsafe.Pointer(aArray + 29)) = U8(1)
 195855 			break
 195856 		case '*':
 195857 			*(*U8)(unsafe.Pointer(aArray + 27)) = U8(1)
 195858 			*(*U8)(unsafe.Pointer(aArray + 28)) = U8(1)
 195859 			*(*U8)(unsafe.Pointer(aArray + 29)) = U8(1)
 195860 			break
 195861 		default:
 195862 			return 1
 195863 		}
 195864 		break
 195865 
 195866 	}
 195867 	return 0
 195868 }
 195869 
 195870 var aFts5UnicodeBlock = [17]U16{
 195871 	U16(0), U16(1471), U16(1753), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760),
 195872 	U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1763), U16(1765),
 195873 }
 195874 var aFts5UnicodeMap = [1765]U16{
 195875 	U16(0), U16(32), U16(33), U16(36), U16(37), U16(40), U16(41), U16(42), U16(43), U16(44),
 195876 	U16(45), U16(46), U16(48), U16(58), U16(60), U16(63), U16(65), U16(91), U16(92), U16(93),
 195877 	U16(94), U16(95), U16(96), U16(97), U16(123), U16(124), U16(125), U16(126), U16(127), U16(160),
 195878 	U16(161), U16(162), U16(166), U16(167), U16(168), U16(169), U16(170), U16(171), U16(172), U16(173),
 195879 	U16(174), U16(175), U16(176), U16(177), U16(178), U16(180), U16(181), U16(182), U16(184), U16(185),
 195880 	U16(186), U16(187), U16(188), U16(191), U16(192), U16(215), U16(216), U16(223), U16(247), U16(248),
 195881 	U16(256), U16(312), U16(313), U16(329), U16(330), U16(377), U16(383), U16(385), U16(387), U16(388),
 195882 	U16(391), U16(394), U16(396), U16(398), U16(402), U16(403), U16(405), U16(406), U16(409), U16(412),
 195883 	U16(414), U16(415), U16(417), U16(418), U16(423), U16(427), U16(428), U16(431), U16(434), U16(436),
 195884 	U16(437), U16(440), U16(442), U16(443), U16(444), U16(446), U16(448), U16(452), U16(453), U16(454),
 195885 	U16(455), U16(456), U16(457), U16(458), U16(459), U16(460), U16(461), U16(477), U16(478), U16(496),
 195886 	U16(497), U16(498), U16(499), U16(500), U16(503), U16(505), U16(506), U16(564), U16(570), U16(572),
 195887 	U16(573), U16(575), U16(577), U16(580), U16(583), U16(584), U16(592), U16(660), U16(661), U16(688),
 195888 	U16(706), U16(710), U16(722), U16(736), U16(741), U16(748), U16(749), U16(750), U16(751), U16(768),
 195889 	U16(880), U16(884), U16(885), U16(886), U16(890), U16(891), U16(894), U16(900), U16(902), U16(903),
 195890 	U16(904), U16(908), U16(910), U16(912), U16(913), U16(931), U16(940), U16(975), U16(977), U16(978),
 195891 	U16(981), U16(984), U16(1008), U16(1012), U16(1014), U16(1015), U16(1018), U16(1020), U16(1021), U16(1072),
 195892 	U16(1120), U16(1154), U16(1155), U16(1160), U16(1162), U16(1217), U16(1231), U16(1232), U16(1329), U16(1369),
 195893 	U16(1370), U16(1377), U16(1417), U16(1418), U16(1423), U16(1425), U16(1470), U16(1471), U16(1472), U16(1473),
 195894 	U16(1475), U16(1476), U16(1478), U16(1479), U16(1488), U16(1520), U16(1523), U16(1536), U16(1542), U16(1545),
 195895 	U16(1547), U16(1548), U16(1550), U16(1552), U16(1563), U16(1566), U16(1568), U16(1600), U16(1601), U16(1611),
 195896 	U16(1632), U16(1642), U16(1646), U16(1648), U16(1649), U16(1748), U16(1749), U16(1750), U16(1757), U16(1758),
 195897 	U16(1759), U16(1765), U16(1767), U16(1769), U16(1770), U16(1774), U16(1776), U16(1786), U16(1789), U16(1791),
 195898 	U16(1792), U16(1807), U16(1808), U16(1809), U16(1810), U16(1840), U16(1869), U16(1958), U16(1969), U16(1984),
 195899 	U16(1994), U16(2027), U16(2036), U16(2038), U16(2039), U16(2042), U16(2048), U16(2070), U16(2074), U16(2075),
 195900 	U16(2084), U16(2085), U16(2088), U16(2089), U16(2096), U16(2112), U16(2137), U16(2142), U16(2208), U16(2210),
 195901 	U16(2276), U16(2304), U16(2307), U16(2308), U16(2362), U16(2363), U16(2364), U16(2365), U16(2366), U16(2369),
 195902 	U16(2377), U16(2381), U16(2382), U16(2384), U16(2385), U16(2392), U16(2402), U16(2404), U16(2406), U16(2416),
 195903 	U16(2417), U16(2418), U16(2425), U16(2433), U16(2434), U16(2437), U16(2447), U16(2451), U16(2474), U16(2482),
 195904 	U16(2486), U16(2492), U16(2493), U16(2494), U16(2497), U16(2503), U16(2507), U16(2509), U16(2510), U16(2519),
 195905 	U16(2524), U16(2527), U16(2530), U16(2534), U16(2544), U16(2546), U16(2548), U16(2554), U16(2555), U16(2561),
 195906 	U16(2563), U16(2565), U16(2575), U16(2579), U16(2602), U16(2610), U16(2613), U16(2616), U16(2620), U16(2622),
 195907 	U16(2625), U16(2631), U16(2635), U16(2641), U16(2649), U16(2654), U16(2662), U16(2672), U16(2674), U16(2677),
 195908 	U16(2689), U16(2691), U16(2693), U16(2703), U16(2707), U16(2730), U16(2738), U16(2741), U16(2748), U16(2749),
 195909 	U16(2750), U16(2753), U16(2759), U16(2761), U16(2763), U16(2765), U16(2768), U16(2784), U16(2786), U16(2790),
 195910 	U16(2800), U16(2801), U16(2817), U16(2818), U16(2821), U16(2831), U16(2835), U16(2858), U16(2866), U16(2869),
 195911 	U16(2876), U16(2877), U16(2878), U16(2879), U16(2880), U16(2881), U16(2887), U16(2891), U16(2893), U16(2902),
 195912 	U16(2903), U16(2908), U16(2911), U16(2914), U16(2918), U16(2928), U16(2929), U16(2930), U16(2946), U16(2947),
 195913 	U16(2949), U16(2958), U16(2962), U16(2969), U16(2972), U16(2974), U16(2979), U16(2984), U16(2990), U16(3006),
 195914 	U16(3008), U16(3009), U16(3014), U16(3018), U16(3021), U16(3024), U16(3031), U16(3046), U16(3056), U16(3059),
 195915 	U16(3065), U16(3066), U16(3073), U16(3077), U16(3086), U16(3090), U16(3114), U16(3125), U16(3133), U16(3134),
 195916 	U16(3137), U16(3142), U16(3146), U16(3157), U16(3160), U16(3168), U16(3170), U16(3174), U16(3192), U16(3199),
 195917 	U16(3202), U16(3205), U16(3214), U16(3218), U16(3242), U16(3253), U16(3260), U16(3261), U16(3262), U16(3263),
 195918 	U16(3264), U16(3270), U16(3271), U16(3274), U16(3276), U16(3285), U16(3294), U16(3296), U16(3298), U16(3302),
 195919 	U16(3313), U16(3330), U16(3333), U16(3342), U16(3346), U16(3389), U16(3390), U16(3393), U16(3398), U16(3402),
 195920 	U16(3405), U16(3406), U16(3415), U16(3424), U16(3426), U16(3430), U16(3440), U16(3449), U16(3450), U16(3458),
 195921 	U16(3461), U16(3482), U16(3507), U16(3517), U16(3520), U16(3530), U16(3535), U16(3538), U16(3542), U16(3544),
 195922 	U16(3570), U16(3572), U16(3585), U16(3633), U16(3634), U16(3636), U16(3647), U16(3648), U16(3654), U16(3655),
 195923 	U16(3663), U16(3664), U16(3674), U16(3713), U16(3716), U16(3719), U16(3722), U16(3725), U16(3732), U16(3737),
 195924 	U16(3745), U16(3749), U16(3751), U16(3754), U16(3757), U16(3761), U16(3762), U16(3764), U16(3771), U16(3773),
 195925 	U16(3776), U16(3782), U16(3784), U16(3792), U16(3804), U16(3840), U16(3841), U16(3844), U16(3859), U16(3860),
 195926 	U16(3861), U16(3864), U16(3866), U16(3872), U16(3882), U16(3892), U16(3893), U16(3894), U16(3895), U16(3896),
 195927 	U16(3897), U16(3898), U16(3899), U16(3900), U16(3901), U16(3902), U16(3904), U16(3913), U16(3953), U16(3967),
 195928 	U16(3968), U16(3973), U16(3974), U16(3976), U16(3981), U16(3993), U16(4030), U16(4038), U16(4039), U16(4046),
 195929 	U16(4048), U16(4053), U16(4057), U16(4096), U16(4139), U16(4141), U16(4145), U16(4146), U16(4152), U16(4153),
 195930 	U16(4155), U16(4157), U16(4159), U16(4160), U16(4170), U16(4176), U16(4182), U16(4184), U16(4186), U16(4190),
 195931 	U16(4193), U16(4194), U16(4197), U16(4199), U16(4206), U16(4209), U16(4213), U16(4226), U16(4227), U16(4229),
 195932 	U16(4231), U16(4237), U16(4238), U16(4239), U16(4240), U16(4250), U16(4253), U16(4254), U16(4256), U16(4295),
 195933 	U16(4301), U16(4304), U16(4347), U16(4348), U16(4349), U16(4682), U16(4688), U16(4696), U16(4698), U16(4704),
 195934 	U16(4746), U16(4752), U16(4786), U16(4792), U16(4800), U16(4802), U16(4808), U16(4824), U16(4882), U16(4888),
 195935 	U16(4957), U16(4960), U16(4969), U16(4992), U16(5008), U16(5024), U16(5120), U16(5121), U16(5741), U16(5743),
 195936 	U16(5760), U16(5761), U16(5787), U16(5788), U16(5792), U16(5867), U16(5870), U16(5888), U16(5902), U16(5906),
 195937 	U16(5920), U16(5938), U16(5941), U16(5952), U16(5970), U16(5984), U16(5998), U16(6002), U16(6016), U16(6068),
 195938 	U16(6070), U16(6071), U16(6078), U16(6086), U16(6087), U16(6089), U16(6100), U16(6103), U16(6104), U16(6107),
 195939 	U16(6108), U16(6109), U16(6112), U16(6128), U16(6144), U16(6150), U16(6151), U16(6155), U16(6158), U16(6160),
 195940 	U16(6176), U16(6211), U16(6212), U16(6272), U16(6313), U16(6314), U16(6320), U16(6400), U16(6432), U16(6435),
 195941 	U16(6439), U16(6441), U16(6448), U16(6450), U16(6451), U16(6457), U16(6464), U16(6468), U16(6470), U16(6480),
 195942 	U16(6512), U16(6528), U16(6576), U16(6593), U16(6600), U16(6608), U16(6618), U16(6622), U16(6656), U16(6679),
 195943 	U16(6681), U16(6686), U16(6688), U16(6741), U16(6742), U16(6743), U16(6744), U16(6752), U16(6753), U16(6754),
 195944 	U16(6755), U16(6757), U16(6765), U16(6771), U16(6783), U16(6784), U16(6800), U16(6816), U16(6823), U16(6824),
 195945 	U16(6912), U16(6916), U16(6917), U16(6964), U16(6965), U16(6966), U16(6971), U16(6972), U16(6973), U16(6978),
 195946 	U16(6979), U16(6981), U16(6992), U16(7002), U16(7009), U16(7019), U16(7028), U16(7040), U16(7042), U16(7043),
 195947 	U16(7073), U16(7074), U16(7078), U16(7080), U16(7082), U16(7083), U16(7084), U16(7086), U16(7088), U16(7098),
 195948 	U16(7142), U16(7143), U16(7144), U16(7146), U16(7149), U16(7150), U16(7151), U16(7154), U16(7164), U16(7168),
 195949 	U16(7204), U16(7212), U16(7220), U16(7222), U16(7227), U16(7232), U16(7245), U16(7248), U16(7258), U16(7288),
 195950 	U16(7294), U16(7360), U16(7376), U16(7379), U16(7380), U16(7393), U16(7394), U16(7401), U16(7405), U16(7406),
 195951 	U16(7410), U16(7412), U16(7413), U16(7424), U16(7468), U16(7531), U16(7544), U16(7545), U16(7579), U16(7616),
 195952 	U16(7676), U16(7680), U16(7830), U16(7838), U16(7936), U16(7944), U16(7952), U16(7960), U16(7968), U16(7976),
 195953 	U16(7984), U16(7992), U16(8000), U16(8008), U16(8016), U16(8025), U16(8027), U16(8029), U16(8031), U16(8033),
 195954 	U16(8040), U16(8048), U16(8064), U16(8072), U16(8080), U16(8088), U16(8096), U16(8104), U16(8112), U16(8118),
 195955 	U16(8120), U16(8124), U16(8125), U16(8126), U16(8127), U16(8130), U16(8134), U16(8136), U16(8140), U16(8141),
 195956 	U16(8144), U16(8150), U16(8152), U16(8157), U16(8160), U16(8168), U16(8173), U16(8178), U16(8182), U16(8184),
 195957 	U16(8188), U16(8189), U16(8192), U16(8203), U16(8208), U16(8214), U16(8216), U16(8217), U16(8218), U16(8219),
 195958 	U16(8221), U16(8222), U16(8223), U16(8224), U16(8232), U16(8233), U16(8234), U16(8239), U16(8240), U16(8249),
 195959 	U16(8250), U16(8251), U16(8255), U16(8257), U16(8260), U16(8261), U16(8262), U16(8263), U16(8274), U16(8275),
 195960 	U16(8276), U16(8277), U16(8287), U16(8288), U16(8298), U16(8304), U16(8305), U16(8308), U16(8314), U16(8317),
 195961 	U16(8318), U16(8319), U16(8320), U16(8330), U16(8333), U16(8334), U16(8336), U16(8352), U16(8400), U16(8413),
 195962 	U16(8417), U16(8418), U16(8421), U16(8448), U16(8450), U16(8451), U16(8455), U16(8456), U16(8458), U16(8459),
 195963 	U16(8462), U16(8464), U16(8467), U16(8468), U16(8469), U16(8470), U16(8472), U16(8473), U16(8478), U16(8484),
 195964 	U16(8485), U16(8486), U16(8487), U16(8488), U16(8489), U16(8490), U16(8494), U16(8495), U16(8496), U16(8500),
 195965 	U16(8501), U16(8505), U16(8506), U16(8508), U16(8510), U16(8512), U16(8517), U16(8519), U16(8522), U16(8523),
 195966 	U16(8524), U16(8526), U16(8527), U16(8528), U16(8544), U16(8579), U16(8581), U16(8585), U16(8592), U16(8597),
 195967 	U16(8602), U16(8604), U16(8608), U16(8609), U16(8611), U16(8612), U16(8614), U16(8615), U16(8622), U16(8623),
 195968 	U16(8654), U16(8656), U16(8658), U16(8659), U16(8660), U16(8661), U16(8692), U16(8960), U16(8968), U16(8972),
 195969 	U16(8992), U16(8994), U16(9001), U16(9002), U16(9003), U16(9084), U16(9085), U16(9115), U16(9140), U16(9180),
 195970 	U16(9186), U16(9216), U16(9280), U16(9312), U16(9372), U16(9450), U16(9472), U16(9655), U16(9656), U16(9665),
 195971 	U16(9666), U16(9720), U16(9728), U16(9839), U16(9840), U16(9985), U16(10088), U16(10089), U16(10090), U16(10091),
 195972 	U16(10092), U16(10093), U16(10094), U16(10095), U16(10096), U16(10097), U16(10098), U16(10099), U16(10100), U16(10101),
 195973 	U16(10102), U16(10132), U16(10176), U16(10181), U16(10182), U16(10183), U16(10214), U16(10215), U16(10216), U16(10217),
 195974 	U16(10218), U16(10219), U16(10220), U16(10221), U16(10222), U16(10223), U16(10224), U16(10240), U16(10496), U16(10627),
 195975 	U16(10628), U16(10629), U16(10630), U16(10631), U16(10632), U16(10633), U16(10634), U16(10635), U16(10636), U16(10637),
 195976 	U16(10638), U16(10639), U16(10640), U16(10641), U16(10642), U16(10643), U16(10644), U16(10645), U16(10646), U16(10647),
 195977 	U16(10648), U16(10649), U16(10712), U16(10713), U16(10714), U16(10715), U16(10716), U16(10748), U16(10749), U16(10750),
 195978 	U16(11008), U16(11056), U16(11077), U16(11079), U16(11088), U16(11264), U16(11312), U16(11360), U16(11363), U16(11365),
 195979 	U16(11367), U16(11374), U16(11377), U16(11378), U16(11380), U16(11381), U16(11383), U16(11388), U16(11390), U16(11393),
 195980 	U16(11394), U16(11492), U16(11493), U16(11499), U16(11503), U16(11506), U16(11513), U16(11517), U16(11518), U16(11520),
 195981 	U16(11559), U16(11565), U16(11568), U16(11631), U16(11632), U16(11647), U16(11648), U16(11680), U16(11688), U16(11696),
 195982 	U16(11704), U16(11712), U16(11720), U16(11728), U16(11736), U16(11744), U16(11776), U16(11778), U16(11779), U16(11780),
 195983 	U16(11781), U16(11782), U16(11785), U16(11786), U16(11787), U16(11788), U16(11789), U16(11790), U16(11799), U16(11800),
 195984 	U16(11802), U16(11803), U16(11804), U16(11805), U16(11806), U16(11808), U16(11809), U16(11810), U16(11811), U16(11812),
 195985 	U16(11813), U16(11814), U16(11815), U16(11816), U16(11817), U16(11818), U16(11823), U16(11824), U16(11834), U16(11904),
 195986 	U16(11931), U16(12032), U16(12272), U16(12288), U16(12289), U16(12292), U16(12293), U16(12294), U16(12295), U16(12296),
 195987 	U16(12297), U16(12298), U16(12299), U16(12300), U16(12301), U16(12302), U16(12303), U16(12304), U16(12305), U16(12306),
 195988 	U16(12308), U16(12309), U16(12310), U16(12311), U16(12312), U16(12313), U16(12314), U16(12315), U16(12316), U16(12317),
 195989 	U16(12318), U16(12320), U16(12321), U16(12330), U16(12334), U16(12336), U16(12337), U16(12342), U16(12344), U16(12347),
 195990 	U16(12348), U16(12349), U16(12350), U16(12353), U16(12441), U16(12443), U16(12445), U16(12447), U16(12448), U16(12449),
 195991 	U16(12539), U16(12540), U16(12543), U16(12549), U16(12593), U16(12688), U16(12690), U16(12694), U16(12704), U16(12736),
 195992 	U16(12784), U16(12800), U16(12832), U16(12842), U16(12872), U16(12880), U16(12881), U16(12896), U16(12928), U16(12938),
 195993 	U16(12977), U16(12992), U16(13056), U16(13312), U16(19893), U16(19904), U16(19968), U16(40908), U16(40960), U16(40981),
 195994 	U16(40982), U16(42128), U16(42192), U16(42232), U16(42238), U16(42240), U16(42508), U16(42509), U16(42512), U16(42528),
 195995 	U16(42538), U16(42560), U16(42606), U16(42607), U16(42608), U16(42611), U16(42612), U16(42622), U16(42623), U16(42624),
 195996 	U16(42655), U16(42656), U16(42726), U16(42736), U16(42738), U16(42752), U16(42775), U16(42784), U16(42786), U16(42800),
 195997 	U16(42802), U16(42864), U16(42865), U16(42873), U16(42878), U16(42888), U16(42889), U16(42891), U16(42896), U16(42912),
 195998 	U16(43000), U16(43002), U16(43003), U16(43010), U16(43011), U16(43014), U16(43015), U16(43019), U16(43020), U16(43043),
 195999 	U16(43045), U16(43047), U16(43048), U16(43056), U16(43062), U16(43064), U16(43065), U16(43072), U16(43124), U16(43136),
 196000 	U16(43138), U16(43188), U16(43204), U16(43214), U16(43216), U16(43232), U16(43250), U16(43256), U16(43259), U16(43264),
 196001 	U16(43274), U16(43302), U16(43310), U16(43312), U16(43335), U16(43346), U16(43359), U16(43360), U16(43392), U16(43395),
 196002 	U16(43396), U16(43443), U16(43444), U16(43446), U16(43450), U16(43452), U16(43453), U16(43457), U16(43471), U16(43472),
 196003 	U16(43486), U16(43520), U16(43561), U16(43567), U16(43569), U16(43571), U16(43573), U16(43584), U16(43587), U16(43588),
 196004 	U16(43596), U16(43597), U16(43600), U16(43612), U16(43616), U16(43632), U16(43633), U16(43639), U16(43642), U16(43643),
 196005 	U16(43648), U16(43696), U16(43697), U16(43698), U16(43701), U16(43703), U16(43705), U16(43710), U16(43712), U16(43713),
 196006 	U16(43714), U16(43739), U16(43741), U16(43742), U16(43744), U16(43755), U16(43756), U16(43758), U16(43760), U16(43762),
 196007 	U16(43763), U16(43765), U16(43766), U16(43777), U16(43785), U16(43793), U16(43808), U16(43816), U16(43968), U16(44003),
 196008 	U16(44005), U16(44006), U16(44008), U16(44009), U16(44011), U16(44012), U16(44013), U16(44016), U16(44032), U16(55203),
 196009 	U16(55216), U16(55243), U16(55296), U16(56191), U16(56319), U16(57343), U16(57344), U16(63743), U16(63744), U16(64112),
 196010 	U16(64256), U16(64275), U16(64285), U16(64286), U16(64287), U16(64297), U16(64298), U16(64312), U16(64318), U16(64320),
 196011 	U16(64323), U16(64326), U16(64434), U16(64467), U16(64830), U16(64831), U16(64848), U16(64914), U16(65008), U16(65020),
 196012 	U16(65021), U16(65024), U16(65040), U16(65047), U16(65048), U16(65049), U16(65056), U16(65072), U16(65073), U16(65075),
 196013 	U16(65077), U16(65078), U16(65079), U16(65080), U16(65081), U16(65082), U16(65083), U16(65084), U16(65085), U16(65086),
 196014 	U16(65087), U16(65088), U16(65089), U16(65090), U16(65091), U16(65092), U16(65093), U16(65095), U16(65096), U16(65097),
 196015 	U16(65101), U16(65104), U16(65108), U16(65112), U16(65113), U16(65114), U16(65115), U16(65116), U16(65117), U16(65118),
 196016 	U16(65119), U16(65122), U16(65123), U16(65124), U16(65128), U16(65129), U16(65130), U16(65136), U16(65142), U16(65279),
 196017 	U16(65281), U16(65284), U16(65285), U16(65288), U16(65289), U16(65290), U16(65291), U16(65292), U16(65293), U16(65294),
 196018 	U16(65296), U16(65306), U16(65308), U16(65311), U16(65313), U16(65339), U16(65340), U16(65341), U16(65342), U16(65343),
 196019 	U16(65344), U16(65345), U16(65371), U16(65372), U16(65373), U16(65374), U16(65375), U16(65376), U16(65377), U16(65378),
 196020 	U16(65379), U16(65380), U16(65382), U16(65392), U16(65393), U16(65438), U16(65440), U16(65474), U16(65482), U16(65490),
 196021 	U16(65498), U16(65504), U16(65506), U16(65507), U16(65508), U16(65509), U16(65512), U16(65513), U16(65517), U16(65529),
 196022 	U16(65532), U16(0), U16(13), U16(40), U16(60), U16(63), U16(80), U16(128), U16(256), U16(263),
 196023 	U16(311), U16(320), U16(373), U16(377), U16(394), U16(400), U16(464), U16(509), U16(640), U16(672),
 196024 	U16(768), U16(800), U16(816), U16(833), U16(834), U16(842), U16(896), U16(927), U16(928), U16(968),
 196025 	U16(976), U16(977), U16(1024), U16(1064), U16(1104), U16(1184), U16(2048), U16(2056), U16(2058), U16(2103),
 196026 	U16(2108), U16(2111), U16(2135), U16(2136), U16(2304), U16(2326), U16(2335), U16(2336), U16(2367), U16(2432),
 196027 	U16(2494), U16(2560), U16(2561), U16(2565), U16(2572), U16(2576), U16(2581), U16(2585), U16(2616), U16(2623),
 196028 	U16(2624), U16(2640), U16(2656), U16(2685), U16(2687), U16(2816), U16(2873), U16(2880), U16(2904), U16(2912),
 196029 	U16(2936), U16(3072), U16(3680), U16(4096), U16(4097), U16(4098), U16(4099), U16(4152), U16(4167), U16(4178),
 196030 	U16(4198), U16(4224), U16(4226), U16(4227), U16(4272), U16(4275), U16(4279), U16(4281), U16(4283), U16(4285),
 196031 	U16(4286), U16(4304), U16(4336), U16(4352), U16(4355), U16(4391), U16(4396), U16(4397), U16(4406), U16(4416),
 196032 	U16(4480), U16(4482), U16(4483), U16(4531), U16(4534), U16(4543), U16(4545), U16(4549), U16(4560), U16(5760),
 196033 	U16(5803), U16(5804), U16(5805), U16(5806), U16(5808), U16(5814), U16(5815), U16(5824), U16(8192), U16(9216),
 196034 	U16(9328), U16(12288), U16(26624), U16(28416), U16(28496), U16(28497), U16(28559), U16(28563), U16(45056), U16(53248),
 196035 	U16(53504), U16(53545), U16(53605), U16(53607), U16(53610), U16(53613), U16(53619), U16(53627), U16(53635), U16(53637),
 196036 	U16(53644), U16(53674), U16(53678), U16(53760), U16(53826), U16(53829), U16(54016), U16(54112), U16(54272), U16(54298),
 196037 	U16(54324), U16(54350), U16(54358), U16(54376), U16(54402), U16(54428), U16(54430), U16(54434), U16(54437), U16(54441),
 196038 	U16(54446), U16(54454), U16(54459), U16(54461), U16(54469), U16(54480), U16(54506), U16(54532), U16(54535), U16(54541),
 196039 	U16(54550), U16(54558), U16(54584), U16(54587), U16(54592), U16(54598), U16(54602), U16(54610), U16(54636), U16(54662),
 196040 	U16(54688), U16(54714), U16(54740), U16(54766), U16(54792), U16(54818), U16(54844), U16(54870), U16(54896), U16(54922),
 196041 	U16(54952), U16(54977), U16(54978), U16(55003), U16(55004), U16(55010), U16(55035), U16(55036), U16(55061), U16(55062),
 196042 	U16(55068), U16(55093), U16(55094), U16(55119), U16(55120), U16(55126), U16(55151), U16(55152), U16(55177), U16(55178),
 196043 	U16(55184), U16(55209), U16(55210), U16(55235), U16(55236), U16(55242), U16(55246), U16(60928), U16(60933), U16(60961),
 196044 	U16(60964), U16(60967), U16(60969), U16(60980), U16(60985), U16(60987), U16(60994), U16(60999), U16(61001), U16(61003),
 196045 	U16(61005), U16(61009), U16(61012), U16(61015), U16(61017), U16(61019), U16(61021), U16(61023), U16(61025), U16(61028),
 196046 	U16(61031), U16(61036), U16(61044), U16(61049), U16(61054), U16(61056), U16(61067), U16(61089), U16(61093), U16(61099),
 196047 	U16(61168), U16(61440), U16(61488), U16(61600), U16(61617), U16(61633), U16(61649), U16(61696), U16(61712), U16(61744),
 196048 	U16(61808), U16(61926), U16(61968), U16(62016), U16(62032), U16(62208), U16(62256), U16(62263), U16(62336), U16(62368),
 196049 	U16(62406), U16(62432), U16(62464), U16(62528), U16(62530), U16(62713), U16(62720), U16(62784), U16(62800), U16(62971),
 196050 	U16(63045), U16(63104), U16(63232), U16(0), U16(42710), U16(42752), U16(46900), U16(46912), U16(47133), U16(63488),
 196051 	U16(1), U16(32), U16(256), U16(0), U16(65533),
 196052 }
 196053 var aFts5UnicodeData = [1765]U16{
 196054 	U16(1025), U16(61), U16(117), U16(55), U16(117), U16(54), U16(50), U16(53), U16(57), U16(53),
 196055 	U16(49), U16(85), U16(333), U16(85), U16(121), U16(85), U16(841), U16(54), U16(53), U16(50),
 196056 	U16(56), U16(48), U16(56), U16(837), U16(54), U16(57), U16(50), U16(57), U16(1057), U16(61),
 196057 	U16(53), U16(151), U16(58), U16(53), U16(56), U16(58), U16(39), U16(52), U16(57), U16(34),
 196058 	U16(58), U16(56), U16(58), U16(57), U16(79), U16(56), U16(37), U16(85), U16(56), U16(47),
 196059 	U16(39), U16(51), U16(111), U16(53), U16(745), U16(57), U16(233), U16(773), U16(57), U16(261),
 196060 	U16(1822), U16(37), U16(542), U16(37), U16(1534), U16(222), U16(69), U16(73), U16(37), U16(126),
 196061 	U16(126), U16(73), U16(69), U16(137), U16(37), U16(73), U16(37), U16(105), U16(101), U16(73),
 196062 	U16(37), U16(73), U16(37), U16(190), U16(158), U16(37), U16(126), U16(126), U16(73), U16(37),
 196063 	U16(126), U16(94), U16(37), U16(39), U16(94), U16(69), U16(135), U16(41), U16(40), U16(37),
 196064 	U16(41), U16(40), U16(37), U16(41), U16(40), U16(37), U16(542), U16(37), U16(606), U16(37),
 196065 	U16(41), U16(40), U16(37), U16(126), U16(73), U16(37), U16(1886), U16(197), U16(73), U16(37),
 196066 	U16(73), U16(69), U16(126), U16(105), U16(37), U16(286), U16(2181), U16(39), U16(869), U16(582),
 196067 	U16(152), U16(390), U16(472), U16(166), U16(248), U16(38), U16(56), U16(38), U16(568), U16(3596),
 196068 	U16(158), U16(38), U16(56), U16(94), U16(38), U16(101), U16(53), U16(88), U16(41), U16(53),
 196069 	U16(105), U16(41), U16(73), U16(37), U16(553), U16(297), U16(1125), U16(94), U16(37), U16(105),
 196070 	U16(101), U16(798), U16(133), U16(94), U16(57), U16(126), U16(94), U16(37), U16(1641), U16(1541),
 196071 	U16(1118), U16(58), U16(172), U16(75), U16(1790), U16(478), U16(37), U16(2846), U16(1225), U16(38),
 196072 	U16(213), U16(1253), U16(53), U16(49), U16(55), U16(1452), U16(49), U16(44), U16(53), U16(76),
 196073 	U16(53), U16(76), U16(53), U16(44), U16(871), U16(103), U16(85), U16(162), U16(121), U16(85),
 196074 	U16(55), U16(85), U16(90), U16(364), U16(53), U16(85), U16(1031), U16(38), U16(327), U16(684),
 196075 	U16(333), U16(149), U16(71), U16(44), U16(3175), U16(53), U16(39), U16(236), U16(34), U16(58),
 196076 	U16(204), U16(70), U16(76), U16(58), U16(140), U16(71), U16(333), U16(103), U16(90), U16(39),
 196077 	U16(469), U16(34), U16(39), U16(44), U16(967), U16(876), U16(2855), U16(364), U16(39), U16(333),
 196078 	U16(1063), U16(300), U16(70), U16(58), U16(117), U16(38), U16(711), U16(140), U16(38), U16(300),
 196079 	U16(38), U16(108), U16(38), U16(172), U16(501), U16(807), U16(108), U16(53), U16(39), U16(359),
 196080 	U16(876), U16(108), U16(42), U16(1735), U16(44), U16(42), U16(44), U16(39), U16(106), U16(268),
 196081 	U16(138), U16(44), U16(74), U16(39), U16(236), U16(327), U16(76), U16(85), U16(333), U16(53),
 196082 	U16(38), U16(199), U16(231), U16(44), U16(74), U16(263), U16(71), U16(711), U16(231), U16(39),
 196083 	U16(135), U16(44), U16(39), U16(106), U16(140), U16(74), U16(74), U16(44), U16(39), U16(42),
 196084 	U16(71), U16(103), U16(76), U16(333), U16(71), U16(87), U16(207), U16(58), U16(55), U16(76),
 196085 	U16(42), U16(199), U16(71), U16(711), U16(231), U16(71), U16(71), U16(71), U16(44), U16(106),
 196086 	U16(76), U16(76), U16(108), U16(44), U16(135), U16(39), U16(333), U16(76), U16(103), U16(44),
 196087 	U16(76), U16(42), U16(295), U16(103), U16(711), U16(231), U16(71), U16(167), U16(44), U16(39),
 196088 	U16(106), U16(172), U16(76), U16(42), U16(74), U16(44), U16(39), U16(71), U16(76), U16(333),
 196089 	U16(53), U16(55), U16(44), U16(74), U16(263), U16(71), U16(711), U16(231), U16(71), U16(167),
 196090 	U16(44), U16(39), U16(42), U16(44), U16(42), U16(140), U16(74), U16(74), U16(44), U16(44),
 196091 	U16(42), U16(71), U16(103), U16(76), U16(333), U16(58), U16(39), U16(207), U16(44), U16(39),
 196092 	U16(199), U16(103), U16(135), U16(71), U16(39), U16(71), U16(71), U16(103), U16(391), U16(74),
 196093 	U16(44), U16(74), U16(106), U16(106), U16(44), U16(39), U16(42), U16(333), U16(111), U16(218),
 196094 	U16(55), U16(58), U16(106), U16(263), U16(103), U16(743), U16(327), U16(167), U16(39), U16(108),
 196095 	U16(138), U16(108), U16(140), U16(76), U16(71), U16(71), U16(76), U16(333), U16(239), U16(58),
 196096 	U16(74), U16(263), U16(103), U16(743), U16(327), U16(167), U16(44), U16(39), U16(42), U16(44),
 196097 	U16(170), U16(44), U16(74), U16(74), U16(76), U16(74), U16(39), U16(71), U16(76), U16(333),
 196098 	U16(71), U16(74), U16(263), U16(103), U16(1319), U16(39), U16(106), U16(140), U16(106), U16(106),
 196099 	U16(44), U16(39), U16(42), U16(71), U16(76), U16(333), U16(207), U16(58), U16(199), U16(74),
 196100 	U16(583), U16(775), U16(295), U16(39), U16(231), U16(44), U16(106), U16(108), U16(44), U16(266),
 196101 	U16(74), U16(53), U16(1543), U16(44), U16(71), U16(236), U16(55), U16(199), U16(38), U16(268),
 196102 	U16(53), U16(333), U16(85), U16(71), U16(39), U16(71), U16(39), U16(39), U16(135), U16(231),
 196103 	U16(103), U16(39), U16(39), U16(71), U16(135), U16(44), U16(71), U16(204), U16(76), U16(39),
 196104 	U16(167), U16(38), U16(204), U16(333), U16(135), U16(39), U16(122), U16(501), U16(58), U16(53),
 196105 	U16(122), U16(76), U16(218), U16(333), U16(335), U16(58), U16(44), U16(58), U16(44), U16(58),
 196106 	U16(44), U16(54), U16(50), U16(54), U16(50), U16(74), U16(263), U16(1159), U16(460), U16(42),
 196107 	U16(172), U16(53), U16(76), U16(167), U16(364), U16(1164), U16(282), U16(44), U16(218), U16(90),
 196108 	U16(181), U16(154), U16(85), U16(1383), U16(74), U16(140), U16(42), U16(204), U16(42), U16(76),
 196109 	U16(74), U16(76), U16(39), U16(333), U16(213), U16(199), U16(74), U16(76), U16(135), U16(108),
 196110 	U16(39), U16(106), U16(71), U16(234), U16(103), U16(140), U16(423), U16(44), U16(74), U16(76),
 196111 	U16(202), U16(44), U16(39), U16(42), U16(333), U16(106), U16(44), U16(90), U16(1225), U16(41),
 196112 	U16(41), U16(1383), U16(53), U16(38), U16(10631), U16(135), U16(231), U16(39), U16(135), U16(1319),
 196113 	U16(135), U16(1063), U16(135), U16(231), U16(39), U16(135), U16(487), U16(1831), U16(135), U16(2151),
 196114 	U16(108), U16(309), U16(655), U16(519), U16(346), U16(2727), U16(49), U16(19847), U16(85), U16(551),
 196115 	U16(61), U16(839), U16(54), U16(50), U16(2407), U16(117), U16(110), U16(423), U16(135), U16(108),
 196116 	U16(583), U16(108), U16(85), U16(583), U16(76), U16(423), U16(103), U16(76), U16(1671), U16(76),
 196117 	U16(42), U16(236), U16(266), U16(44), U16(74), U16(364), U16(117), U16(38), U16(117), U16(55),
 196118 	U16(39), U16(44), U16(333), U16(335), U16(213), U16(49), U16(149), U16(108), U16(61), U16(333),
 196119 	U16(1127), U16(38), U16(1671), U16(1319), U16(44), U16(39), U16(2247), U16(935), U16(108), U16(138),
 196120 	U16(76), U16(106), U16(74), U16(44), U16(202), U16(108), U16(58), U16(85), U16(333), U16(967),
 196121 	U16(167), U16(1415), U16(554), U16(231), U16(74), U16(333), U16(47), U16(1114), U16(743), U16(76),
 196122 	U16(106), U16(85), U16(1703), U16(42), U16(44), U16(42), U16(236), U16(44), U16(42), U16(44),
 196123 	U16(74), U16(268), U16(202), U16(332), U16(44), U16(333), U16(333), U16(245), U16(38), U16(213),
 196124 	U16(140), U16(42), U16(1511), U16(44), U16(42), U16(172), U16(42), U16(44), U16(170), U16(44),
 196125 	U16(74), U16(231), U16(333), U16(245), U16(346), U16(300), U16(314), U16(76), U16(42), U16(967),
 196126 	U16(42), U16(140), U16(74), U16(76), U16(42), U16(44), U16(74), U16(71), U16(333), U16(1415),
 196127 	U16(44), U16(42), U16(76), U16(106), U16(44), U16(42), U16(108), U16(74), U16(149), U16(1159),
 196128 	U16(266), U16(268), U16(74), U16(76), U16(181), U16(333), U16(103), U16(333), U16(967), U16(198),
 196129 	U16(85), U16(277), U16(108), U16(53), U16(428), U16(42), U16(236), U16(135), U16(44), U16(135),
 196130 	U16(74), U16(44), U16(71), U16(1413), U16(2022), U16(421), U16(38), U16(1093), U16(1190), U16(1260),
 196131 	U16(140), U16(4830), U16(261), U16(3166), U16(261), U16(265), U16(197), U16(201), U16(261), U16(265),
 196132 	U16(261), U16(265), U16(197), U16(201), U16(261), U16(41), U16(41), U16(41), U16(94), U16(229),
 196133 	U16(265), U16(453), U16(261), U16(264), U16(261), U16(264), U16(261), U16(264), U16(165), U16(69),
 196134 	U16(137), U16(40), U16(56), U16(37), U16(120), U16(101), U16(69), U16(137), U16(40), U16(120),
 196135 	U16(133), U16(69), U16(137), U16(120), U16(261), U16(169), U16(120), U16(101), U16(69), U16(137),
 196136 	U16(40), U16(88), U16(381), U16(162), U16(209), U16(85), U16(52), U16(51), U16(54), U16(84),
 196137 	U16(51), U16(54), U16(52), U16(277), U16(59), U16(60), U16(162), U16(61), U16(309), U16(52),
 196138 	U16(51), U16(149), U16(80), U16(117), U16(57), U16(54), U16(50), U16(373), U16(57), U16(53),
 196139 	U16(48), U16(341), U16(61), U16(162), U16(194), U16(47), U16(38), U16(207), U16(121), U16(54),
 196140 	U16(50), U16(38), U16(335), U16(121), U16(54), U16(50), U16(422), U16(855), U16(428), U16(139),
 196141 	U16(44), U16(107), U16(396), U16(90), U16(41), U16(154), U16(41), U16(90), U16(37), U16(105),
 196142 	U16(69), U16(105), U16(37), U16(58), U16(41), U16(90), U16(57), U16(169), U16(218), U16(41),
 196143 	U16(58), U16(41), U16(58), U16(41), U16(58), U16(137), U16(58), U16(37), U16(137), U16(37),
 196144 	U16(135), U16(37), U16(90), U16(69), U16(73), U16(185), U16(94), U16(101), U16(58), U16(57),
 196145 	U16(90), U16(37), U16(58), U16(527), U16(1134), U16(94), U16(142), U16(47), U16(185), U16(186),
 196146 	U16(89), U16(154), U16(57), U16(90), U16(57), U16(90), U16(57), U16(250), U16(57), U16(1018),
 196147 	U16(89), U16(90), U16(57), U16(58), U16(57), U16(1018), U16(8601), U16(282), U16(153), U16(666),
 196148 	U16(89), U16(250), U16(54), U16(50), U16(2618), U16(57), U16(986), U16(825), U16(1306), U16(217),
 196149 	U16(602), U16(1274), U16(378), U16(1935), U16(2522), U16(719), U16(5882), U16(57), U16(314), U16(57),
 196150 	U16(1754), U16(281), U16(3578), U16(57), U16(4634), U16(3322), U16(54), U16(50), U16(54), U16(50),
 196151 	U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50),
 196152 	U16(975), U16(1434), U16(185), U16(54), U16(50), U16(1017), U16(54), U16(50), U16(54), U16(50),
 196153 	U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(537), U16(8218), U16(4217), U16(54),
 196154 	U16(50), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(54),
 196155 	U16(50), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(54),
 196156 	U16(50), U16(2041), U16(54), U16(50), U16(54), U16(50), U16(1049), U16(54), U16(50), U16(8281),
 196157 	U16(1562), U16(697), U16(90), U16(217), U16(346), U16(1513), U16(1509), U16(126), U16(73), U16(69),
 196158 	U16(254), U16(105), U16(37), U16(94), U16(37), U16(94), U16(165), U16(70), U16(105), U16(37),
 196159 	U16(3166), U16(37), U16(218), U16(158), U16(108), U16(94), U16(149), U16(47), U16(85), U16(1221),
 196160 	U16(37), U16(37), U16(1799), U16(38), U16(53), U16(44), U16(743), U16(231), U16(231), U16(231),
 196161 	U16(231), U16(231), U16(231), U16(231), U16(231), U16(1036), U16(85), U16(52), U16(51), U16(52),
 196162 	U16(51), U16(117), U16(52), U16(51), U16(53), U16(52), U16(51), U16(309), U16(49), U16(85),
 196163 	U16(49), U16(53), U16(52), U16(51), U16(85), U16(52), U16(51), U16(54), U16(50), U16(54),
 196164 	U16(50), U16(54), U16(50), U16(54), U16(50), U16(181), U16(38), U16(341), U16(81), U16(858),
 196165 	U16(2874), U16(6874), U16(410), U16(61), U16(117), U16(58), U16(38), U16(39), U16(46), U16(54),
 196166 	U16(50), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(90),
 196167 	U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(49), U16(54),
 196168 	U16(82), U16(58), U16(302), U16(140), U16(74), U16(49), U16(166), U16(90), U16(110), U16(38),
 196169 	U16(39), U16(53), U16(90), U16(2759), U16(76), U16(88), U16(70), U16(39), U16(49), U16(2887),
 196170 	U16(53), U16(102), U16(39), U16(1319), U16(3015), U16(90), U16(143), U16(346), U16(871), U16(1178),
 196171 	U16(519), U16(1018), U16(335), U16(986), U16(271), U16(58), U16(495), U16(1050), U16(335), U16(1274),
 196172 	U16(495), U16(2042), U16(8218), U16(39), U16(39), U16(2074), U16(39), U16(39), U16(679), U16(38),
 196173 	U16(36583), U16(1786), U16(1287), U16(198), U16(85), U16(8583), U16(38), U16(117), U16(519), U16(333),
 196174 	U16(71), U16(1502), U16(39), U16(44), U16(107), U16(53), U16(332), U16(53), U16(38), U16(798),
 196175 	U16(44), U16(2247), U16(334), U16(76), U16(213), U16(760), U16(294), U16(88), U16(478), U16(69),
 196176 	U16(2014), U16(38), U16(261), U16(190), U16(350), U16(38), U16(88), U16(158), U16(158), U16(382),
 196177 	U16(70), U16(37), U16(231), U16(44), U16(103), U16(44), U16(135), U16(44), U16(743), U16(74),
 196178 	U16(76), U16(42), U16(154), U16(207), U16(90), U16(55), U16(58), U16(1671), U16(149), U16(74),
 196179 	U16(1607), U16(522), U16(44), U16(85), U16(333), U16(588), U16(199), U16(117), U16(39), U16(333),
 196180 	U16(903), U16(268), U16(85), U16(743), U16(364), U16(74), U16(53), U16(935), U16(108), U16(42),
 196181 	U16(1511), U16(44), U16(74), U16(140), U16(74), U16(44), U16(138), U16(437), U16(38), U16(333),
 196182 	U16(85), U16(1319), U16(204), U16(74), U16(76), U16(74), U16(76), U16(103), U16(44), U16(263),
 196183 	U16(44), U16(42), U16(333), U16(149), U16(519), U16(38), U16(199), U16(122), U16(39), U16(42),
 196184 	U16(1543), U16(44), U16(39), U16(108), U16(71), U16(76), U16(167), U16(76), U16(39), U16(44),
 196185 	U16(39), U16(71), U16(38), U16(85), U16(359), U16(42), U16(76), U16(74), U16(85), U16(39),
 196186 	U16(70), U16(42), U16(44), U16(199), U16(199), U16(199), U16(231), U16(231), U16(1127), U16(74),
 196187 	U16(44), U16(74), U16(44), U16(74), U16(53), U16(42), U16(44), U16(333), U16(39), U16(39),
 196188 	U16(743), U16(1575), U16(36), U16(68), U16(68), U16(36), U16(63), U16(63), U16(11719), U16(3399),
 196189 	U16(229), U16(165), U16(39), U16(44), U16(327), U16(57), U16(423), U16(167), U16(39), U16(71),
 196190 	U16(71), U16(3463), U16(536), U16(11623), U16(54), U16(50), U16(2055), U16(1735), U16(391), U16(55),
 196191 	U16(58), U16(524), U16(245), U16(54), U16(50), U16(53), U16(236), U16(53), U16(81), U16(80),
 196192 	U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50),
 196193 	U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(85), U16(54), U16(50), U16(149),
 196194 	U16(112), U16(117), U16(149), U16(49), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50),
 196195 	U16(117), U16(57), U16(49), U16(121), U16(53), U16(55), U16(85), U16(167), U16(4327), U16(34),
 196196 	U16(117), U16(55), U16(117), U16(54), U16(50), U16(53), U16(57), U16(53), U16(49), U16(85),
 196197 	U16(333), U16(85), U16(121), U16(85), U16(841), U16(54), U16(53), U16(50), U16(56), U16(48),
 196198 	U16(56), U16(837), U16(54), U16(57), U16(50), U16(57), U16(54), U16(50), U16(53), U16(54),
 196199 	U16(50), U16(85), U16(327), U16(38), U16(1447), U16(70), U16(999), U16(199), U16(199), U16(199),
 196200 	U16(103), U16(87), U16(57), U16(56), U16(58), U16(87), U16(58), U16(153), U16(90), U16(98),
 196201 	U16(90), U16(391), U16(839), U16(615), U16(71), U16(487), U16(455), U16(3943), U16(117), U16(1455),
 196202 	U16(314), U16(1710), U16(143), U16(570), U16(47), U16(410), U16(1466), U16(44), U16(935), U16(1575),
 196203 	U16(999), U16(143), U16(551), U16(46), U16(263), U16(46), U16(967), U16(53), U16(1159), U16(263),
 196204 	U16(53), U16(174), U16(1289), U16(1285), U16(2503), U16(333), U16(199), U16(39), U16(1415), U16(71),
 196205 	U16(39), U16(743), U16(53), U16(271), U16(711), U16(207), U16(53), U16(839), U16(53), U16(1799),
 196206 	U16(71), U16(39), U16(108), U16(76), U16(140), U16(135), U16(103), U16(871), U16(108), U16(44),
 196207 	U16(271), U16(309), U16(935), U16(79), U16(53), U16(1735), U16(245), U16(711), U16(271), U16(615),
 196208 	U16(271), U16(2343), U16(1007), U16(42), U16(44), U16(42), U16(1703), U16(492), U16(245), U16(655),
 196209 	U16(333), U16(76), U16(42), U16(1447), U16(106), U16(140), U16(74), U16(76), U16(85), U16(34),
 196210 	U16(149), U16(807), U16(333), U16(108), U16(1159), U16(172), U16(42), U16(268), U16(333), U16(149),
 196211 	U16(76), U16(42), U16(1543), U16(106), U16(300), U16(74), U16(135), U16(149), U16(333), U16(1383),
 196212 	U16(44), U16(42), U16(44), U16(74), U16(204), U16(42), U16(44), U16(333), U16(28135), U16(3182),
 196213 	U16(149), U16(34279), U16(18215), U16(2215), U16(39), U16(1482), U16(140), U16(422), U16(71), U16(7898),
 196214 	U16(1274), U16(1946), U16(74), U16(108), U16(122), U16(202), U16(258), U16(268), U16(90), U16(236),
 196215 	U16(986), U16(140), U16(1562), U16(2138), U16(108), U16(58), U16(2810), U16(591), U16(841), U16(837),
 196216 	U16(841), U16(229), U16(581), U16(841), U16(837), U16(41), U16(73), U16(41), U16(73), U16(137),
 196217 	U16(265), U16(133), U16(37), U16(229), U16(357), U16(841), U16(837), U16(73), U16(137), U16(265),
 196218 	U16(233), U16(837), U16(73), U16(137), U16(169), U16(41), U16(233), U16(837), U16(841), U16(837),
 196219 	U16(841), U16(837), U16(841), U16(837), U16(841), U16(837), U16(841), U16(837), U16(841), U16(901),
 196220 	U16(809), U16(57), U16(805), U16(57), U16(197), U16(809), U16(57), U16(805), U16(57), U16(197),
 196221 	U16(809), U16(57), U16(805), U16(57), U16(197), U16(809), U16(57), U16(805), U16(57), U16(197),
 196222 	U16(809), U16(57), U16(805), U16(57), U16(197), U16(94), U16(1613), U16(135), U16(871), U16(71),
 196223 	U16(39), U16(39), U16(327), U16(135), U16(39), U16(39), U16(39), U16(39), U16(39), U16(39),
 196224 	U16(103), U16(71), U16(39), U16(39), U16(39), U16(39), U16(39), U16(39), U16(71), U16(39),
 196225 	U16(135), U16(231), U16(135), U16(135), U16(39), U16(327), U16(551), U16(103), U16(167), U16(551),
 196226 	U16(89), U16(1434), U16(3226), U16(506), U16(474), U16(506), U16(506), U16(367), U16(1018), U16(1946),
 196227 	U16(1402), U16(954), U16(1402), U16(314), U16(90), U16(1082), U16(218), U16(2266), U16(666), U16(1210),
 196228 	U16(186), U16(570), U16(2042), U16(58), U16(5850), U16(154), U16(2010), U16(154), U16(794), U16(2266),
 196229 	U16(378), U16(2266), U16(3738), U16(39), U16(39), U16(39), U16(39), U16(39), U16(39), U16(17351),
 196230 	U16(34), U16(3074), U16(7692), U16(63), U16(63),
 196231 }
 196232 
 196233 func sqlite3Fts5UnicodeCategory(tls *libc.TLS, iCode U32) int32 {
 196234 	var iRes int32 = -1
 196235 	var iHi int32
 196236 	var iLo int32
 196237 	var ret int32
 196238 	var iKey U16
 196239 
 196240 	if iCode >= U32(int32(1)<<20) {
 196241 		return 0
 196242 	}
 196243 	iLo = int32(aFts5UnicodeBlock[iCode>>16])
 196244 	iHi = int32(aFts5UnicodeBlock[U32(1)+iCode>>16])
 196245 	iKey = U16(iCode & U32(0xFFFF))
 196246 	for iHi > iLo {
 196247 		var iTest int32 = (iHi + iLo) / 2
 196248 
 196249 		if int32(iKey) >= int32(aFts5UnicodeMap[iTest]) {
 196250 			iRes = iTest
 196251 			iLo = iTest + 1
 196252 		} else {
 196253 			iHi = iTest
 196254 		}
 196255 	}
 196256 
 196257 	if iRes < 0 {
 196258 		return 0
 196259 	}
 196260 	if int32(iKey) >= int32(aFts5UnicodeMap[iRes])+int32(aFts5UnicodeData[iRes])>>5 {
 196261 		return 0
 196262 	}
 196263 	ret = int32(aFts5UnicodeData[iRes]) & 0x1F
 196264 	if ret != 30 {
 196265 		return ret
 196266 	}
 196267 	if (int32(iKey)-int32(aFts5UnicodeMap[iRes]))&0x01 != 0 {
 196268 		return 5
 196269 	}
 196270 	return 9
 196271 }
 196272 
 196273 func sqlite3Fts5UnicodeAscii(tls *libc.TLS, aArray uintptr, aAscii uintptr) {
 196274 	var i int32 = 0
 196275 	var iTbl int32 = 0
 196276 	for i < 128 {
 196277 		var bToken int32 = int32(*(*U8)(unsafe.Pointer(aArray + uintptr(int32(aFts5UnicodeData[iTbl])&0x1F))))
 196278 		var n int32 = int32(aFts5UnicodeData[iTbl])>>5 + i
 196279 		for ; i < 128 && i < n; i++ {
 196280 			*(*U8)(unsafe.Pointer(aAscii + uintptr(i))) = U8(bToken)
 196281 		}
 196282 		iTbl++
 196283 	}
 196284 	*(*U8)(unsafe.Pointer(aAscii)) = U8(0)
 196285 }
 196286 
 196287 func sqlite3Fts5GetVarint32(tls *libc.TLS, p uintptr, v uintptr) int32 {
 196288 	bp := tls.Alloc(8)
 196289 	defer tls.Free(8)
 196290 
 196291 	var a U32
 196292 	var b U32
 196293 
 196294 	a = U32(*(*uint8)(unsafe.Pointer(p)))
 196295 
 196296 	if !(a&U32(0x80) != 0) {
 196297 		*(*U32)(unsafe.Pointer(v)) = a
 196298 		return 1
 196299 	}
 196300 
 196301 	p++
 196302 	b = U32(*(*uint8)(unsafe.Pointer(p)))
 196303 
 196304 	if !(b&U32(0x80) != 0) {
 196305 		a = a & U32(0x7f)
 196306 		a = a << 7
 196307 		*(*U32)(unsafe.Pointer(v)) = a | b
 196308 		return 2
 196309 	}
 196310 
 196311 	p++
 196312 	a = a << 14
 196313 	a = a | U32(*(*uint8)(unsafe.Pointer(p)))
 196314 
 196315 	if !(a&U32(0x80) != 0) {
 196316 		a = a & U32(int32(0x7f)<<14|0x7f)
 196317 		b = b & U32(0x7f)
 196318 		b = b << 7
 196319 		*(*U32)(unsafe.Pointer(v)) = a | b
 196320 		return 3
 196321 	}
 196322 
 196323 	{
 196324 		var n U8
 196325 		p -= uintptr(2)
 196326 		n = sqlite3Fts5GetVarint(tls, p, bp)
 196327 		*(*U32)(unsafe.Pointer(v)) = U32(*(*U64)(unsafe.Pointer(bp))) & U32(0x7FFFFFFF)
 196328 
 196329 		return int32(n)
 196330 
 196331 	}
 196332 	return int32(0)
 196333 }
 196334 
 196335 func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 {
 196336 	var a U32
 196337 	var b U32
 196338 	var s U32
 196339 
 196340 	a = U32(*(*uint8)(unsafe.Pointer(p)))
 196341 
 196342 	if !(a&U32(0x80) != 0) {
 196343 		*(*U64)(unsafe.Pointer(v)) = U64(a)
 196344 		return U8(1)
 196345 	}
 196346 
 196347 	p++
 196348 	b = U32(*(*uint8)(unsafe.Pointer(p)))
 196349 
 196350 	if !(b&U32(0x80) != 0) {
 196351 		a = a & U32(0x7f)
 196352 		a = a << 7
 196353 		a = a | b
 196354 		*(*U64)(unsafe.Pointer(v)) = U64(a)
 196355 		return U8(2)
 196356 	}
 196357 
 196358 	p++
 196359 	a = a << 14
 196360 	a = a | U32(*(*uint8)(unsafe.Pointer(p)))
 196361 
 196362 	if !(a&U32(0x80) != 0) {
 196363 		a = a & U32(SLOT_2_0)
 196364 		b = b & U32(0x7f)
 196365 		b = b << 7
 196366 		a = a | b
 196367 		*(*U64)(unsafe.Pointer(v)) = U64(a)
 196368 		return U8(3)
 196369 	}
 196370 
 196371 	a = a & U32(SLOT_2_0)
 196372 	p++
 196373 	b = b << 14
 196374 	b = b | U32(*(*uint8)(unsafe.Pointer(p)))
 196375 
 196376 	if !(b&U32(0x80) != 0) {
 196377 		b = b & U32(SLOT_2_0)
 196378 
 196379 		a = a << 7
 196380 		a = a | b
 196381 		*(*U64)(unsafe.Pointer(v)) = U64(a)
 196382 		return U8(4)
 196383 	}
 196384 
 196385 	b = b & U32(SLOT_2_0)
 196386 	s = a
 196387 
 196388 	p++
 196389 	a = a << 14
 196390 	a = a | U32(*(*uint8)(unsafe.Pointer(p)))
 196391 
 196392 	if !(a&U32(0x80) != 0) {
 196393 		b = b << 7
 196394 		a = a | b
 196395 		s = s >> 18
 196396 		*(*U64)(unsafe.Pointer(v)) = U64(s)<<32 | U64(a)
 196397 		return U8(5)
 196398 	}
 196399 
 196400 	s = s << 7
 196401 	s = s | b
 196402 
 196403 	p++
 196404 	b = b << 14
 196405 	b = b | U32(*(*uint8)(unsafe.Pointer(p)))
 196406 
 196407 	if !(b&U32(0x80) != 0) {
 196408 		a = a & U32(SLOT_2_0)
 196409 		a = a << 7
 196410 		a = a | b
 196411 		s = s >> 18
 196412 		*(*U64)(unsafe.Pointer(v)) = U64(s)<<32 | U64(a)
 196413 		return U8(6)
 196414 	}
 196415 
 196416 	p++
 196417 	a = a << 14
 196418 	a = a | U32(*(*uint8)(unsafe.Pointer(p)))
 196419 
 196420 	if !(a&U32(0x80) != 0) {
 196421 		a = a & SLOT_4_2_0
 196422 		b = b & U32(SLOT_2_0)
 196423 		b = b << 7
 196424 		a = a | b
 196425 		s = s >> 11
 196426 		*(*U64)(unsafe.Pointer(v)) = U64(s)<<32 | U64(a)
 196427 		return U8(7)
 196428 	}
 196429 
 196430 	a = a & U32(SLOT_2_0)
 196431 	p++
 196432 	b = b << 14
 196433 	b = b | U32(*(*uint8)(unsafe.Pointer(p)))
 196434 
 196435 	if !(b&U32(0x80) != 0) {
 196436 		b = b & SLOT_4_2_0
 196437 
 196438 		a = a << 7
 196439 		a = a | b
 196440 		s = s >> 4
 196441 		*(*U64)(unsafe.Pointer(v)) = U64(s)<<32 | U64(a)
 196442 		return U8(8)
 196443 	}
 196444 
 196445 	p++
 196446 	a = a << 15
 196447 	a = a | U32(*(*uint8)(unsafe.Pointer(p)))
 196448 
 196449 	b = b & U32(SLOT_2_0)
 196450 	b = b << 8
 196451 	a = a | b
 196452 
 196453 	s = s << 4
 196454 	b = U32(*(*uint8)(unsafe.Pointer(p + libc.UintptrFromInt32(-4))))
 196455 	b = b & U32(0x7f)
 196456 	b = b >> 3
 196457 	s = s | b
 196458 
 196459 	*(*U64)(unsafe.Pointer(v)) = U64(s)<<32 | U64(a)
 196460 
 196461 	return U8(9)
 196462 }
 196463 
 196464 func fts5PutVarint64(tls *libc.TLS, p uintptr, v U64) int32 {
 196465 	bp := tls.Alloc(10)
 196466 	defer tls.Free(10)
 196467 
 196468 	var i int32
 196469 	var j int32
 196470 	var n int32
 196471 
 196472 	if v&(uint64(0xff000000)<<32) != 0 {
 196473 		*(*uint8)(unsafe.Pointer(p + 8)) = U8(v)
 196474 		v >>= 8
 196475 		for i = 7; i >= 0; i-- {
 196476 			*(*uint8)(unsafe.Pointer(p + uintptr(i))) = U8(v&uint64(0x7f) | uint64(0x80))
 196477 			v >>= 7
 196478 		}
 196479 		return 9
 196480 	}
 196481 	n = 0
 196482 	for __ccgo := true; __ccgo; __ccgo = v != uint64(0) {
 196483 		*(*U8)(unsafe.Pointer(bp + uintptr(libc.PostIncInt32(&n, 1)))) = U8(v&uint64(0x7f) | uint64(0x80))
 196484 		v >>= 7
 196485 	}
 196486 	*(*U8)(unsafe.Pointer(bp)) &= U8(0x7f)
 196487 
 196488 	i = 0
 196489 	j = n - 1
 196490 __1:
 196491 	if !(j >= 0) {
 196492 		goto __3
 196493 	}
 196494 	{
 196495 		*(*uint8)(unsafe.Pointer(p + uintptr(i))) = *(*U8)(unsafe.Pointer(bp + uintptr(j)))
 196496 
 196497 	}
 196498 	goto __2
 196499 __2:
 196500 	j--
 196501 	i++
 196502 	goto __1
 196503 	goto __3
 196504 __3:
 196505 	;
 196506 	return n
 196507 }
 196508 
 196509 func sqlite3Fts5PutVarint(tls *libc.TLS, p uintptr, v U64) int32 {
 196510 	if v <= uint64(0x7f) {
 196511 		*(*uint8)(unsafe.Pointer(p)) = uint8(v & uint64(0x7f))
 196512 		return 1
 196513 	}
 196514 	if v <= uint64(0x3fff) {
 196515 		*(*uint8)(unsafe.Pointer(p)) = uint8(v>>7&uint64(0x7f) | uint64(0x80))
 196516 		*(*uint8)(unsafe.Pointer(p + 1)) = uint8(v & uint64(0x7f))
 196517 		return 2
 196518 	}
 196519 	return fts5PutVarint64(tls, p, v)
 196520 }
 196521 
 196522 func sqlite3Fts5GetVarintLen(tls *libc.TLS, iVal U32) int32 {
 196523 	if iVal < U32(int32(1)<<14) {
 196524 		return 2
 196525 	}
 196526 	if iVal < U32(int32(1)<<21) {
 196527 		return 3
 196528 	}
 196529 	if iVal < U32(int32(1)<<28) {
 196530 		return 4
 196531 	}
 196532 	return 5
 196533 }
 196534 
 196535 type Fts5VocabTable1 = struct {
 196536 	Fbase     Sqlite3_vtab
 196537 	FzFts5Tbl uintptr
 196538 	FzFts5Db  uintptr
 196539 	Fdb       uintptr
 196540 	FpGlobal  uintptr
 196541 	FeType    int32
 196542 	FbBusy    uint32
 196543 }
 196544 
 196545 type Fts5VocabTable = Fts5VocabTable1
 196546 type Fts5VocabCursor1 = struct {
 196547 	Fbase        Sqlite3_vtab_cursor
 196548 	FpStmt       uintptr
 196549 	FpFts5       uintptr
 196550 	FbEof        int32
 196551 	F__ccgo_pad1 [4]byte
 196552 	FpIter       uintptr
 196553 	FpStruct     uintptr
 196554 	FnLeTerm     int32
 196555 	F__ccgo_pad2 [4]byte
 196556 	FzLeTerm     uintptr
 196557 	FiCol        int32
 196558 	F__ccgo_pad3 [4]byte
 196559 	FaCnt        uintptr
 196560 	FaDoc        uintptr
 196561 	Frowid       I64
 196562 	Fterm        Fts5Buffer
 196563 	FiInstPos    I64
 196564 	FiInstOff    int32
 196565 	F__ccgo_pad4 [4]byte
 196566 }
 196567 
 196568 type Fts5VocabCursor = Fts5VocabCursor1
 196569 
 196570 func fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uintptr) int32 {
 196571 	bp := tls.Alloc(12)
 196572 	defer tls.Free(12)
 196573 
 196574 	*(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK
 196575 	var zCopy uintptr = sqlite3Fts5Strndup(tls, bp+8, zType, -1)
 196576 	if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK {
 196577 		sqlite3Fts5Dequote(tls, zCopy)
 196578 		if Xsqlite3_stricmp(tls, zCopy, ts+38751) == 0 {
 196579 			*(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL
 196580 		} else if Xsqlite3_stricmp(tls, zCopy, ts+38755) == 0 {
 196581 			*(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_ROW
 196582 		} else if Xsqlite3_stricmp(tls, zCopy, ts+38759) == 0 {
 196583 			*(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_INSTANCE
 196584 		} else {
 196585 			*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+38768, libc.VaList(bp, zCopy))
 196586 			*(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_ERROR
 196587 		}
 196588 		Xsqlite3_free(tls, zCopy)
 196589 	}
 196590 
 196591 	return *(*int32)(unsafe.Pointer(bp + 8))
 196592 }
 196593 
 196594 func fts5VocabDisconnectMethod(tls *libc.TLS, pVtab uintptr) int32 {
 196595 	var pTab uintptr = pVtab
 196596 	Xsqlite3_free(tls, pTab)
 196597 	return SQLITE_OK
 196598 }
 196599 
 196600 func fts5VocabDestroyMethod(tls *libc.TLS, pVtab uintptr) int32 {
 196601 	var pTab uintptr = pVtab
 196602 	Xsqlite3_free(tls, pTab)
 196603 	return SQLITE_OK
 196604 }
 196605 
 196606 func fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVTab uintptr, pzErr uintptr) int32 {
 196607 	bp := tls.Alloc(36)
 196608 	defer tls.Free(36)
 196609 
 196610 	*(*[3]uintptr)(unsafe.Pointer(bp + 8)) = [3]uintptr{
 196611 		ts + 38802,
 196612 		ts + 38842,
 196613 		ts + 38877,
 196614 	}
 196615 
 196616 	var pRet uintptr = uintptr(0)
 196617 	*(*int32)(unsafe.Pointer(bp + 32)) = SQLITE_OK
 196618 	var bDb int32
 196619 
 196620 	bDb = libc.Bool32(argc == 6 && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, ts+24768, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0)
 196621 
 196622 	if argc != 5 && bDb == 0 {
 196623 		*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+38920, 0)
 196624 		*(*int32)(unsafe.Pointer(bp + 32)) = SQLITE_ERROR
 196625 	} else {
 196626 		var nByte int32
 196627 		var zDb uintptr
 196628 		if bDb != 0 {
 196629 			zDb = *(*uintptr)(unsafe.Pointer(argv + 3*8))
 196630 		} else {
 196631 			zDb = *(*uintptr)(unsafe.Pointer(argv + 1*8))
 196632 		}
 196633 		var zTab uintptr
 196634 		if bDb != 0 {
 196635 			zTab = *(*uintptr)(unsafe.Pointer(argv + 4*8))
 196636 		} else {
 196637 			zTab = *(*uintptr)(unsafe.Pointer(argv + 3*8))
 196638 		}
 196639 		var zType uintptr
 196640 		if bDb != 0 {
 196641 			zType = *(*uintptr)(unsafe.Pointer(argv + 5*8))
 196642 		} else {
 196643 			zType = *(*uintptr)(unsafe.Pointer(argv + 4*8))
 196644 		}
 196645 		var nDb int32 = int32(libc.Xstrlen(tls, zDb)) + 1
 196646 		var nTab int32 = int32(libc.Xstrlen(tls, zTab)) + 1
 196647 		*(*int32)(unsafe.Pointer(bp)) = 0
 196648 
 196649 		*(*int32)(unsafe.Pointer(bp + 32)) = fts5VocabTableType(tls, zType, pzErr, bp)
 196650 		if *(*int32)(unsafe.Pointer(bp + 32)) == SQLITE_OK {
 196651 			*(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_declare_vtab(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*8)))
 196652 		}
 196653 
 196654 		nByte = int32(uint64(unsafe.Sizeof(Fts5VocabTable{})) + uint64(nDb) + uint64(nTab))
 196655 		pRet = sqlite3Fts5MallocZero(tls, bp+32, int64(nByte))
 196656 		if pRet != 0 {
 196657 			(*Fts5VocabTable)(unsafe.Pointer(pRet)).FpGlobal = pAux
 196658 			(*Fts5VocabTable)(unsafe.Pointer(pRet)).FeType = *(*int32)(unsafe.Pointer(bp))
 196659 			(*Fts5VocabTable)(unsafe.Pointer(pRet)).Fdb = db
 196660 			(*Fts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl = pRet + 1*64
 196661 			(*Fts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db = (*Fts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl + uintptr(nTab)
 196662 			libc.Xmemcpy(tls, (*Fts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, uint64(nTab))
 196663 			libc.Xmemcpy(tls, (*Fts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, uint64(nDb))
 196664 			sqlite3Fts5Dequote(tls, (*Fts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl)
 196665 			sqlite3Fts5Dequote(tls, (*Fts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db)
 196666 		}
 196667 	}
 196668 
 196669 	*(*uintptr)(unsafe.Pointer(ppVTab)) = pRet
 196670 	return *(*int32)(unsafe.Pointer(bp + 32))
 196671 }
 196672 
 196673 func fts5VocabConnectMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 {
 196674 	return fts5VocabInitVtab(tls, db, pAux, argc, argv, ppVtab, pzErr)
 196675 }
 196676 
 196677 func fts5VocabCreateMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 {
 196678 	return fts5VocabInitVtab(tls, db, pAux, argc, argv, ppVtab, pzErr)
 196679 }
 196680 
 196681 func fts5VocabBestIndexMethod(tls *libc.TLS, pUnused uintptr, pInfo uintptr) int32 {
 196682 	var i int32
 196683 	var iTermEq int32 = -1
 196684 	var iTermGe int32 = -1
 196685 	var iTermLe int32 = -1
 196686 	var idxNum int32 = 0
 196687 	var nArg int32 = 0
 196688 
 196689 	_ = pUnused
 196690 
 196691 	for i = 0; i < (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint; i++ {
 196692 		var p uintptr = (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraint + uintptr(i)*12
 196693 		if int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable) == 0 {
 196694 			continue
 196695 		}
 196696 		if (*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn == 0 {
 196697 			if int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_EQ {
 196698 				iTermEq = i
 196699 			}
 196700 			if int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_LE {
 196701 				iTermLe = i
 196702 			}
 196703 			if int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_LT {
 196704 				iTermLe = i
 196705 			}
 196706 			if int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_GE {
 196707 				iTermGe = i
 196708 			}
 196709 			if int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_GT {
 196710 				iTermGe = i
 196711 			}
 196712 		}
 196713 	}
 196714 
 196715 	if iTermEq >= 0 {
 196716 		idxNum = idxNum | FTS5_VOCAB_TERM_EQ
 196717 		(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(iTermEq)*8)).FargvIndex = libc.PreIncInt32(&nArg, 1)
 196718 		(*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = float64(100)
 196719 	} else {
 196720 		(*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = float64(1000000)
 196721 		if iTermGe >= 0 {
 196722 			idxNum = idxNum | FTS5_VOCAB_TERM_GE
 196723 			(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(iTermGe)*8)).FargvIndex = libc.PreIncInt32(&nArg, 1)
 196724 			(*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost / float64(2)
 196725 		}
 196726 		if iTermLe >= 0 {
 196727 			idxNum = idxNum | FTS5_VOCAB_TERM_LE
 196728 			(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(iTermLe)*8)).FargvIndex = libc.PreIncInt32(&nArg, 1)
 196729 			(*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost / float64(2)
 196730 		}
 196731 	}
 196732 
 196733 	if (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnOrderBy == 1 &&
 196734 		(*sqlite3_index_orderby)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaOrderBy)).FiColumn == 0 &&
 196735 		int32((*sqlite3_index_orderby)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaOrderBy)).Fdesc) == 0 {
 196736 		(*Sqlite3_index_info)(unsafe.Pointer(pInfo)).ForderByConsumed = 1
 196737 	}
 196738 
 196739 	(*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FidxNum = idxNum
 196740 	return SQLITE_OK
 196741 }
 196742 
 196743 func fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 {
 196744 	bp := tls.Alloc(80)
 196745 	defer tls.Free(80)
 196746 
 196747 	var pTab uintptr = pVTab
 196748 	var pFts5 uintptr = uintptr(0)
 196749 	var pCsr uintptr = uintptr(0)
 196750 	*(*int32)(unsafe.Pointer(bp + 64)) = SQLITE_OK
 196751 	*(*uintptr)(unsafe.Pointer(bp + 72)) = uintptr(0)
 196752 	var zSql uintptr = uintptr(0)
 196753 
 196754 	if (*Fts5VocabTable)(unsafe.Pointer(pTab)).FbBusy != 0 {
 196755 		(*Sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls,
 196756 			ts+38953, libc.VaList(bp, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl))
 196757 		return SQLITE_ERROR
 196758 	}
 196759 	zSql = sqlite3Fts5Mprintf(tls, bp+64,
 196760 		ts+38984,
 196761 		libc.VaList(bp+16, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl))
 196762 	if zSql != 0 {
 196763 		*(*int32)(unsafe.Pointer(bp + 64)) = Xsqlite3_prepare_v2(tls, (*Fts5VocabTable)(unsafe.Pointer(pTab)).Fdb, zSql, -1, bp+72, uintptr(0))
 196764 	}
 196765 	Xsqlite3_free(tls, zSql)
 196766 
 196767 	if *(*int32)(unsafe.Pointer(bp + 64)) == SQLITE_ERROR {
 196768 		*(*int32)(unsafe.Pointer(bp + 64)) = SQLITE_OK
 196769 	}
 196770 
 196771 	(*Fts5VocabTable)(unsafe.Pointer(pTab)).FbBusy = uint32(1)
 196772 	if *(*uintptr)(unsafe.Pointer(bp + 72)) != 0 && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 72))) == SQLITE_ROW {
 196773 		var iId I64 = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 72)), 0)
 196774 		pFts5 = sqlite3Fts5TableFromCsrid(tls, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FpGlobal, iId)
 196775 	}
 196776 	(*Fts5VocabTable)(unsafe.Pointer(pTab)).FbBusy = uint32(0)
 196777 
 196778 	if *(*int32)(unsafe.Pointer(bp + 64)) == SQLITE_OK {
 196779 		if pFts5 == uintptr(0) {
 196780 			*(*int32)(unsafe.Pointer(bp + 64)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 72)))
 196781 			*(*uintptr)(unsafe.Pointer(bp + 72)) = uintptr(0)
 196782 			if *(*int32)(unsafe.Pointer(bp + 64)) == SQLITE_OK {
 196783 				(*Sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls,
 196784 					ts+39035, libc.VaList(bp+48, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl))
 196785 				*(*int32)(unsafe.Pointer(bp + 64)) = SQLITE_ERROR
 196786 			}
 196787 		} else {
 196788 			*(*int32)(unsafe.Pointer(bp + 64)) = sqlite3Fts5FlushToDisk(tls, pFts5)
 196789 		}
 196790 	}
 196791 
 196792 	if *(*int32)(unsafe.Pointer(bp + 64)) == SQLITE_OK {
 196793 		var nByte I64 = I64(uint64((*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pFts5)).FpConfig)).FnCol)*uint64(unsafe.Sizeof(I64(0)))*uint64(2) + uint64(unsafe.Sizeof(Fts5VocabCursor{})))
 196794 		pCsr = sqlite3Fts5MallocZero(tls, bp+64, nByte)
 196795 	}
 196796 
 196797 	if pCsr != 0 {
 196798 		(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5 = pFts5
 196799 		(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpStmt = *(*uintptr)(unsafe.Pointer(bp + 72))
 196800 		(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt = pCsr + 1*128
 196801 		(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc = (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt + uintptr((*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pFts5)).FpConfig)).FnCol)*8
 196802 	} else {
 196803 		Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 72)))
 196804 	}
 196805 
 196806 	*(*uintptr)(unsafe.Pointer(ppCsr)) = pCsr
 196807 	return *(*int32)(unsafe.Pointer(bp + 64))
 196808 }
 196809 
 196810 func fts5VocabResetCursor(tls *libc.TLS, pCsr uintptr) {
 196811 	(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Frowid = int64(0)
 196812 	sqlite3Fts5IterClose(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)
 196813 	sqlite3Fts5StructureRelease(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpStruct)
 196814 	(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpStruct = uintptr(0)
 196815 	(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter = uintptr(0)
 196816 	Xsqlite3_free(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm)
 196817 	(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm = -1
 196818 	(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm = uintptr(0)
 196819 	(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof = 0
 196820 }
 196821 
 196822 func fts5VocabCloseMethod(tls *libc.TLS, pCursor uintptr) int32 {
 196823 	var pCsr uintptr = pCursor
 196824 	fts5VocabResetCursor(tls, pCsr)
 196825 	sqlite3Fts5BufferFree(tls, pCsr+96)
 196826 	Xsqlite3_finalize(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpStmt)
 196827 	Xsqlite3_free(tls, pCsr)
 196828 	return SQLITE_OK
 196829 }
 196830 
 196831 func fts5VocabInstanceNewTerm(tls *libc.TLS, pCsr uintptr) int32 {
 196832 	bp := tls.Alloc(8)
 196833 	defer tls.Free(8)
 196834 
 196835 	*(*int32)(unsafe.Pointer(bp + 4)) = SQLITE_OK
 196836 
 196837 	if (*Fts5IndexIter)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)).FbEof != 0 {
 196838 		(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof = 1
 196839 	} else {
 196840 		var zTerm uintptr
 196841 
 196842 		zTerm = sqlite3Fts5IterTerm(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter, bp)
 196843 		if (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm >= 0 {
 196844 			var nCmp int32 = func() int32 {
 196845 				if *(*int32)(unsafe.Pointer(bp)) < (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm {
 196846 					return *(*int32)(unsafe.Pointer(bp))
 196847 				}
 196848 				return (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm
 196849 			}()
 196850 			var bCmp int32 = libc.Xmemcmp(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm, zTerm, uint64(nCmp))
 196851 			if bCmp < 0 || bCmp == 0 && (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm < *(*int32)(unsafe.Pointer(bp)) {
 196852 				(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof = 1
 196853 			}
 196854 		}
 196855 
 196856 		sqlite3Fts5BufferSet(tls, bp+4, pCsr+96, *(*int32)(unsafe.Pointer(bp)), zTerm)
 196857 	}
 196858 	return *(*int32)(unsafe.Pointer(bp + 4))
 196859 }
 196860 
 196861 func fts5VocabInstanceNext(tls *libc.TLS, pCsr uintptr) int32 {
 196862 	var eDetail int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FeDetail
 196863 	var rc int32 = SQLITE_OK
 196864 	var pIter uintptr = (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter
 196865 	var pp uintptr = pCsr + 112
 196866 	var po uintptr = pCsr + 120
 196867 
 196868 	for eDetail == FTS5_DETAIL_NONE ||
 196869 		sqlite3Fts5PoslistNext64(tls, (*Fts5IndexIter)(unsafe.Pointer(pIter)).FpData, (*Fts5IndexIter)(unsafe.Pointer(pIter)).FnData, po, pp) != 0 {
 196870 		(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiInstPos = int64(0)
 196871 		(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiInstOff = 0
 196872 
 196873 		rc = sqlite3Fts5IterNextScan(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)
 196874 		if rc == SQLITE_OK {
 196875 			rc = fts5VocabInstanceNewTerm(tls, pCsr)
 196876 			if (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof != 0 || eDetail == FTS5_DETAIL_NONE {
 196877 				break
 196878 			}
 196879 		}
 196880 		if rc != 0 {
 196881 			(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof = 1
 196882 			break
 196883 		}
 196884 	}
 196885 
 196886 	return rc
 196887 }
 196888 
 196889 func fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) int32 {
 196890 	bp := tls.Alloc(24)
 196891 	defer tls.Free(24)
 196892 
 196893 	var pCsr uintptr = pCursor
 196894 	var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab
 196895 	var nCol int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FnCol
 196896 
 196897 	*(*int32)(unsafe.Pointer(bp + 4)) = sqlite3Fts5StructureTest(tls, (*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpIndex, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpStruct)
 196898 	if *(*int32)(unsafe.Pointer(bp + 4)) != SQLITE_OK {
 196899 		return *(*int32)(unsafe.Pointer(bp + 4))
 196900 	}
 196901 	(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Frowid++
 196902 
 196903 	if (*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType == FTS5_VOCAB_INSTANCE {
 196904 		return fts5VocabInstanceNext(tls, pCsr)
 196905 	}
 196906 
 196907 	if (*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType == FTS5_VOCAB_COL {
 196908 		for (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol++; (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol < nCol; (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol++ {
 196909 			if *(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc + uintptr((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol)*8)) != 0 {
 196910 				break
 196911 			}
 196912 		}
 196913 	}
 196914 
 196915 	if (*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType != FTS5_VOCAB_COL || (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol >= nCol {
 196916 		if (*Fts5IndexIter)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)).FbEof != 0 {
 196917 			(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof = 1
 196918 		} else {
 196919 			var zTerm uintptr
 196920 
 196921 			zTerm = sqlite3Fts5IterTerm(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter, bp)
 196922 
 196923 			if (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm >= 0 {
 196924 				var nCmp int32 = func() int32 {
 196925 					if *(*int32)(unsafe.Pointer(bp)) < (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm {
 196926 						return *(*int32)(unsafe.Pointer(bp))
 196927 					}
 196928 					return (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm
 196929 				}()
 196930 				var bCmp int32 = libc.Xmemcmp(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm, zTerm, uint64(nCmp))
 196931 				if bCmp < 0 || bCmp == 0 && (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm < *(*int32)(unsafe.Pointer(bp)) {
 196932 					(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof = 1
 196933 					return SQLITE_OK
 196934 				}
 196935 			}
 196936 
 196937 			sqlite3Fts5BufferSet(tls, bp+4, pCsr+96, *(*int32)(unsafe.Pointer(bp)), zTerm)
 196938 			libc.Xmemset(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt, 0, uint64(nCol)*uint64(unsafe.Sizeof(I64(0))))
 196939 			libc.Xmemset(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc, 0, uint64(nCol)*uint64(unsafe.Sizeof(I64(0))))
 196940 			(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol = 0
 196941 
 196942 			for *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK {
 196943 				var eDetail int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FeDetail
 196944 				var pPos uintptr
 196945 				var nPos int32
 196946 				*(*I64)(unsafe.Pointer(bp + 16)) = int64(0)
 196947 				*(*int32)(unsafe.Pointer(bp + 8)) = 0
 196948 
 196949 				pPos = (*Fts5IndexIter)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)).FpData
 196950 				nPos = (*Fts5IndexIter)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)).FnData
 196951 
 196952 				switch (*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType {
 196953 				case FTS5_VOCAB_ROW:
 196954 					if eDetail == FTS5_DETAIL_FULL {
 196955 						for 0 == sqlite3Fts5PoslistNext64(tls, pPos, nPos, bp+8, bp+16) {
 196956 							*(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt))++
 196957 						}
 196958 					}
 196959 					*(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc))++
 196960 					break
 196961 					fallthrough
 196962 
 196963 				case FTS5_VOCAB_COL:
 196964 					if eDetail == FTS5_DETAIL_FULL {
 196965 						var iCol int32 = -1
 196966 						for 0 == sqlite3Fts5PoslistNext64(tls, pPos, nPos, bp+8, bp+16) {
 196967 							var ii int32 = int32(*(*I64)(unsafe.Pointer(bp + 16)) >> 32)
 196968 							if iCol != ii {
 196969 								if ii >= nCol {
 196970 									*(*int32)(unsafe.Pointer(bp + 4)) = SQLITE_CORRUPT | int32(1)<<8
 196971 									break
 196972 								}
 196973 								*(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc + uintptr(ii)*8))++
 196974 								iCol = ii
 196975 							}
 196976 							*(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt + uintptr(ii)*8))++
 196977 						}
 196978 					} else if eDetail == FTS5_DETAIL_COLUMNS {
 196979 						for 0 == sqlite3Fts5PoslistNext64(tls, pPos, nPos, bp+8, bp+16) {
 196980 							if *(*I64)(unsafe.Pointer(bp + 16)) >= I64(nCol) {
 196981 								*(*int32)(unsafe.Pointer(bp + 4)) = SQLITE_CORRUPT | int32(1)<<8
 196982 								break
 196983 							}
 196984 							*(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc + uintptr(*(*I64)(unsafe.Pointer(bp + 16)))*8))++
 196985 						}
 196986 					} else {
 196987 						*(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc))++
 196988 					}
 196989 					break
 196990 					fallthrough
 196991 
 196992 				default:
 196993 					break
 196994 				}
 196995 
 196996 				if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK {
 196997 					*(*int32)(unsafe.Pointer(bp + 4)) = sqlite3Fts5IterNextScan(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)
 196998 				}
 196999 				if (*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType == FTS5_VOCAB_INSTANCE {
 197000 					break
 197001 				}
 197002 
 197003 				if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK {
 197004 					zTerm = sqlite3Fts5IterTerm(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter, bp)
 197005 					if *(*int32)(unsafe.Pointer(bp)) != (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Fterm.Fn ||
 197006 						*(*int32)(unsafe.Pointer(bp)) > 0 && libc.Xmemcmp(tls, zTerm, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Fterm.Fp, uint64(*(*int32)(unsafe.Pointer(bp)))) != 0 {
 197007 						break
 197008 					}
 197009 					if (*Fts5IndexIter)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)).FbEof != 0 {
 197010 						break
 197011 					}
 197012 				}
 197013 			}
 197014 		}
 197015 	}
 197016 
 197017 	if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK && (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof == 0 && (*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType == FTS5_VOCAB_COL {
 197018 		for ; (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol < nCol && *(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc + uintptr((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol)*8)) == int64(0); (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol++ {
 197019 		}
 197020 		if (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol == nCol {
 197021 			*(*int32)(unsafe.Pointer(bp + 4)) = SQLITE_CORRUPT | int32(1)<<8
 197022 		}
 197023 	}
 197024 	return *(*int32)(unsafe.Pointer(bp + 4))
 197025 }
 197026 
 197027 func fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnused uintptr, nUnused int32, apVal uintptr) int32 {
 197028 	var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab
 197029 	var pCsr uintptr = pCursor
 197030 	var eType int32 = (*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType
 197031 	var rc int32 = SQLITE_OK
 197032 
 197033 	var iVal int32 = 0
 197034 	var f int32 = FTS5INDEX_QUERY_SCAN
 197035 	var zTerm uintptr = uintptr(0)
 197036 	var nTerm int32 = 0
 197037 
 197038 	var pEq uintptr = uintptr(0)
 197039 	var pGe uintptr = uintptr(0)
 197040 	var pLe uintptr = uintptr(0)
 197041 
 197042 	_ = zUnused
 197043 	_ = nUnused
 197044 
 197045 	fts5VocabResetCursor(tls, pCsr)
 197046 	if idxNum&FTS5_VOCAB_TERM_EQ != 0 {
 197047 		pEq = *(*uintptr)(unsafe.Pointer(apVal + uintptr(libc.PostIncInt32(&iVal, 1))*8))
 197048 	}
 197049 	if idxNum&FTS5_VOCAB_TERM_GE != 0 {
 197050 		pGe = *(*uintptr)(unsafe.Pointer(apVal + uintptr(libc.PostIncInt32(&iVal, 1))*8))
 197051 	}
 197052 	if idxNum&FTS5_VOCAB_TERM_LE != 0 {
 197053 		pLe = *(*uintptr)(unsafe.Pointer(apVal + uintptr(libc.PostIncInt32(&iVal, 1))*8))
 197054 	}
 197055 
 197056 	if pEq != 0 {
 197057 		zTerm = Xsqlite3_value_text(tls, pEq)
 197058 		nTerm = Xsqlite3_value_bytes(tls, pEq)
 197059 		f = 0
 197060 	} else {
 197061 		if pGe != 0 {
 197062 			zTerm = Xsqlite3_value_text(tls, pGe)
 197063 			nTerm = Xsqlite3_value_bytes(tls, pGe)
 197064 		}
 197065 		if pLe != 0 {
 197066 			var zCopy uintptr = Xsqlite3_value_text(tls, pLe)
 197067 			if zCopy == uintptr(0) {
 197068 				zCopy = ts + 1544
 197069 			}
 197070 			(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm = Xsqlite3_value_bytes(tls, pLe)
 197071 			(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm = Xsqlite3_malloc(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm+1)
 197072 			if (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm == uintptr(0) {
 197073 				rc = SQLITE_NOMEM
 197074 			} else {
 197075 				libc.Xmemcpy(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm, zCopy, uint64((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm+1))
 197076 			}
 197077 		}
 197078 	}
 197079 
 197080 	if rc == SQLITE_OK {
 197081 		var pIndex uintptr = (*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpIndex
 197082 		rc = sqlite3Fts5IndexQuery(tls, pIndex, zTerm, nTerm, f, uintptr(0), pCsr+32)
 197083 		if rc == SQLITE_OK {
 197084 			(*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpStruct = sqlite3Fts5StructureRef(tls, pIndex)
 197085 		}
 197086 	}
 197087 	if rc == SQLITE_OK && eType == FTS5_VOCAB_INSTANCE {
 197088 		rc = fts5VocabInstanceNewTerm(tls, pCsr)
 197089 	}
 197090 	if rc == SQLITE_OK && !((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof != 0) &&
 197091 		(eType != FTS5_VOCAB_INSTANCE ||
 197092 			(*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FeDetail != FTS5_DETAIL_NONE) {
 197093 		rc = fts5VocabNextMethod(tls, pCursor)
 197094 	}
 197095 
 197096 	return rc
 197097 }
 197098 
 197099 func fts5VocabEofMethod(tls *libc.TLS, pCursor uintptr) int32 {
 197100 	var pCsr uintptr = pCursor
 197101 	return (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof
 197102 }
 197103 
 197104 func fts5VocabColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32) int32 {
 197105 	var pCsr uintptr = pCursor
 197106 	var eDetail int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FeDetail
 197107 	var eType int32 = (*Fts5VocabTable)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FeType
 197108 	var iVal I64 = int64(0)
 197109 
 197110 	if iCol == 0 {
 197111 		Xsqlite3_result_text(tls,
 197112 			pCtx, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Fterm.Fp, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Fterm.Fn, libc.UintptrFromInt32(-1))
 197113 	} else if eType == FTS5_VOCAB_COL {
 197114 		if iCol == 1 {
 197115 			if eDetail != FTS5_DETAIL_NONE {
 197116 				var z uintptr = *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FazCol + uintptr((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol)*8))
 197117 				Xsqlite3_result_text(tls, pCtx, z, -1, uintptr(0))
 197118 			}
 197119 		} else if iCol == 2 {
 197120 			iVal = *(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc + uintptr((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol)*8))
 197121 		} else {
 197122 			iVal = *(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt + uintptr((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol)*8))
 197123 		}
 197124 	} else if eType == FTS5_VOCAB_ROW {
 197125 		if iCol == 1 {
 197126 			iVal = *(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc))
 197127 		} else {
 197128 			iVal = *(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt))
 197129 		}
 197130 	} else {
 197131 		switch iCol {
 197132 		case 1:
 197133 			Xsqlite3_result_int64(tls, pCtx, (*Fts5IndexIter)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)).FiRowid)
 197134 			break
 197135 			fallthrough
 197136 		case 2:
 197137 			{
 197138 				var ii int32 = -1
 197139 				if eDetail == FTS5_DETAIL_FULL {
 197140 					ii = int32((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiInstPos >> 32)
 197141 				} else if eDetail == FTS5_DETAIL_COLUMNS {
 197142 					ii = int32((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiInstPos)
 197143 				}
 197144 				if ii >= 0 && ii < (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FnCol {
 197145 					var z uintptr = *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FazCol + uintptr(ii)*8))
 197146 					Xsqlite3_result_text(tls, pCtx, z, -1, uintptr(0))
 197147 				}
 197148 				break
 197149 
 197150 			}
 197151 			fallthrough
 197152 		default:
 197153 			{
 197154 				if eDetail == FTS5_DETAIL_FULL {
 197155 					var ii int32 = int32((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiInstPos & int64(0x7FFFFFFF))
 197156 					Xsqlite3_result_int(tls, pCtx, ii)
 197157 				}
 197158 				break
 197159 
 197160 			}
 197161 		}
 197162 	}
 197163 
 197164 	if iVal > int64(0) {
 197165 		Xsqlite3_result_int64(tls, pCtx, iVal)
 197166 	}
 197167 	return SQLITE_OK
 197168 }
 197169 
 197170 func fts5VocabRowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 {
 197171 	var pCsr uintptr = pCursor
 197172 	*(*Sqlite_int64)(unsafe.Pointer(pRowid)) = (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Frowid
 197173 	return SQLITE_OK
 197174 }
 197175 
 197176 func sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) int32 {
 197177 	var p uintptr = pGlobal
 197178 
 197179 	return Xsqlite3_create_module_v2(tls, db, ts+39061, uintptr(unsafe.Pointer(&fts5Vocab)), p, uintptr(0))
 197180 }
 197181 
 197182 var fts5Vocab = Sqlite3_module{
 197183 	FiVersion:    2,
 197184 	FxCreate:     0,
 197185 	FxConnect:    0,
 197186 	FxBestIndex:  0,
 197187 	FxDisconnect: 0,
 197188 	FxDestroy:    0,
 197189 	FxOpen:       0,
 197190 	FxClose:      0,
 197191 	FxFilter:     0,
 197192 	FxNext:       0,
 197193 	FxEof:        0,
 197194 	FxColumn:     0,
 197195 	FxRowid:      0,
 197196 }
 197197 
 197198 // ************* End of stmt.c ***********************************************
 197199 // Return the source-id for this library
 197200 func Xsqlite3_sourceid(tls *libc.TLS) uintptr {
 197201 	return ts + 39071
 197202 }
 197203 
 197204 func init() {
 197205 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&Xsqlite3aEQb)) + 0)) = uintptr(unsafe.Pointer(&Xsqlite3UpperToLower)) + 210
 197206 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&Xsqlite3aGTb)) + 0)) = uintptr(unsafe.Pointer(&Xsqlite3UpperToLower)) + 216
 197207 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&Xsqlite3aLTb)) + 0)) = uintptr(unsafe.Pointer(&Xsqlite3UpperToLower)) + 204
 197208 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 0)) = geopolyBBoxStep
 197209 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 8)) = geopolyBBoxFinal
 197210 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 24)) = renameColumnFunc
 197211 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 96)) = renameTableFunc
 197212 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 168)) = renameTableTest
 197213 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 240)) = dropColumnFunc
 197214 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 312)) = renameQuotefixFunc
 197215 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 24)) = versionFunc
 197216 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 96)) = versionFunc
 197217 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 168)) = versionFunc
 197218 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 240)) = versionFunc
 197219 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 312)) = soundexFunc
 197220 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 384)) = loadExt
 197221 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 456)) = loadExt
 197222 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 528)) = compileoptionusedFunc
 197223 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 600)) = compileoptiongetFunc
 197224 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 672)) = versionFunc
 197225 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 744)) = versionFunc
 197226 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 816)) = versionFunc
 197227 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 888)) = versionFunc
 197228 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 960)) = trimFunc
 197229 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1032)) = trimFunc
 197230 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1104)) = trimFunc
 197231 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1176)) = trimFunc
 197232 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1248)) = trimFunc
 197233 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1320)) = trimFunc
 197234 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1392)) = minmaxFunc
 197235 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1536)) = minmaxStep
 197236 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1544)) = minMaxFinalize
 197237 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1552)) = minMaxValue
 197238 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1608)) = minmaxFunc
 197239 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1752)) = minmaxStep
 197240 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1760)) = minMaxFinalize
 197241 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1768)) = minMaxValue
 197242 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1824)) = typeofFunc
 197243 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1896)) = subtypeFunc
 197244 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1968)) = lengthFunc
 197245 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2040)) = instrFunc
 197246 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2112)) = printfFunc
 197247 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2184)) = printfFunc
 197248 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2256)) = unicodeFunc
 197249 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2328)) = charFunc
 197250 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2400)) = absFunc
 197251 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2472)) = roundFunc
 197252 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2544)) = roundFunc
 197253 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2616)) = upperFunc
 197254 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2688)) = lowerFunc
 197255 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2760)) = hexFunc
 197256 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2832)) = unhexFunc
 197257 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2904)) = unhexFunc
 197258 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2976)) = versionFunc
 197259 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3048)) = randomFunc
 197260 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3120)) = randomBlob
 197261 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3192)) = nullifFunc
 197262 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3264)) = versionFunc
 197263 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3336)) = sourceidFunc
 197264 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3408)) = errlogFunc
 197265 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3480)) = quoteFunc
 197266 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3552)) = last_insert_rowid
 197267 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3624)) = changes
 197268 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3696)) = total_changes
 197269 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3768)) = replaceFunc
 197270 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3840)) = zeroblobFunc
 197271 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3912)) = substrFunc
 197272 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3984)) = substrFunc
 197273 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4056)) = substrFunc
 197274 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4128)) = substrFunc
 197275 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4200)) = sumStep
 197276 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4208)) = sumFinalize
 197277 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4216)) = sumFinalize
 197278 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4224)) = sumInverse
 197279 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4272)) = sumStep
 197280 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4280)) = totalFinalize
 197281 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4288)) = totalFinalize
 197282 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4296)) = sumInverse
 197283 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4344)) = sumStep
 197284 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4352)) = avgFinalize
 197285 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4360)) = avgFinalize
 197286 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4368)) = sumInverse
 197287 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4416)) = countStep
 197288 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4424)) = countFinalize
 197289 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4432)) = countFinalize
 197290 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4440)) = countInverse
 197291 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4488)) = countStep
 197292 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4496)) = countFinalize
 197293 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4504)) = countFinalize
 197294 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4512)) = countInverse
 197295 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4560)) = groupConcatStep
 197296 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4568)) = groupConcatFinalize
 197297 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4576)) = groupConcatValue
 197298 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4584)) = groupConcatInverse
 197299 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4632)) = groupConcatStep
 197300 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4640)) = groupConcatFinalize
 197301 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4648)) = groupConcatValue
 197302 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4656)) = groupConcatInverse
 197303 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4688)) = uintptr(unsafe.Pointer(&globInfo))
 197304 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4704)) = likeFunc
 197305 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4760)) = uintptr(unsafe.Pointer(&likeInfoNorm))
 197306 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4776)) = likeFunc
 197307 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4832)) = uintptr(unsafe.Pointer(&likeInfoNorm))
 197308 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4848)) = likeFunc
 197309 	*(*func(*libc.TLS, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 5048)) = xCeil
 197310 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 5064)) = ceilingFunc
 197311 	*(*func(*libc.TLS, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 5120)) = xCeil
 197312 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 5136)) = ceilingFunc
 197313 	*(*func(*libc.TLS, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 5192)) = xFloor
 197314 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 5208)) = ceilingFunc
 197315 	*(*func(*libc.TLS, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 5264)) = libc.Xtrunc
 197316 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 5280)) = ceilingFunc
 197317 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 5352)) = logFunc
 197318 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 5424)) = logFunc
 197319 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 5496)) = logFunc
 197320 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 5568)) = logFunc
 197321 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 5640)) = logFunc
 197322 	*(*func(*libc.TLS, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 5696)) = libc.Xexp
 197323 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 5712)) = math1Func
 197324 	*(*func(*libc.TLS, float64, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 5768)) = libc.Xpow
 197325 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 5784)) = math2Func
 197326 	*(*func(*libc.TLS, float64, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 5840)) = libc.Xpow
 197327 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 5856)) = math2Func
 197328 	*(*func(*libc.TLS, float64, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 5912)) = libc.Xfmod
 197329 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 5928)) = math2Func
 197330 	*(*func(*libc.TLS, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 5984)) = libc.Xacos
 197331 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6000)) = math1Func
 197332 	*(*func(*libc.TLS, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6056)) = libc.Xasin
 197333 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6072)) = math1Func
 197334 	*(*func(*libc.TLS, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6128)) = libc.Xatan
 197335 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6144)) = math1Func
 197336 	*(*func(*libc.TLS, float64, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6200)) = libc.Xatan2
 197337 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6216)) = math2Func
 197338 	*(*func(*libc.TLS, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6272)) = libc.Xcos
 197339 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6288)) = math1Func
 197340 	*(*func(*libc.TLS, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6344)) = libc.Xsin
 197341 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6360)) = math1Func
 197342 	*(*func(*libc.TLS, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6416)) = libc.Xtan
 197343 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6432)) = math1Func
 197344 	*(*func(*libc.TLS, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6488)) = libc.Xcosh
 197345 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6504)) = math1Func
 197346 	*(*func(*libc.TLS, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6560)) = libc.Xsinh
 197347 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6576)) = math1Func
 197348 	*(*func(*libc.TLS, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6632)) = libc.Xtanh
 197349 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6648)) = math1Func
 197350 	*(*func(*libc.TLS, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6704)) = libc.Xacosh
 197351 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6720)) = math1Func
 197352 	*(*func(*libc.TLS, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6776)) = libc.Xasinh
 197353 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6792)) = math1Func
 197354 	*(*func(*libc.TLS, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6848)) = libc.Xatanh
 197355 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6864)) = math1Func
 197356 	*(*func(*libc.TLS, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6920)) = libc.Xsqrt
 197357 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6936)) = math1Func
 197358 	*(*func(*libc.TLS, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 6992)) = degToRad
 197359 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 7008)) = math1Func
 197360 	*(*func(*libc.TLS, float64) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 7064)) = radToDeg
 197361 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 7080)) = math1Func
 197362 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 7152)) = piFunc
 197363 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 7224)) = signFunc
 197364 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 7296)) = versionFunc
 197365 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 7368)) = versionFunc
 197366 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 8)) = uintptr(unsafe.Pointer(&Xsqlite3Config))
 197367 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 24)) = juliandayFunc
 197368 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 80)) = uintptr(unsafe.Pointer(&Xsqlite3Config))
 197369 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 96)) = unixepochFunc
 197370 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 152)) = uintptr(unsafe.Pointer(&Xsqlite3Config))
 197371 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 168)) = dateFunc
 197372 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 224)) = uintptr(unsafe.Pointer(&Xsqlite3Config))
 197373 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 240)) = timeFunc
 197374 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 296)) = uintptr(unsafe.Pointer(&Xsqlite3Config))
 197375 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 312)) = datetimeFunc
 197376 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 368)) = uintptr(unsafe.Pointer(&Xsqlite3Config))
 197377 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 384)) = strftimeFunc
 197378 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 456)) = ctimeFunc
 197379 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 528)) = ctimestampFunc
 197380 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 600)) = cdateFunc
 197381 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 0)) = geopolyAreaFunc
 197382 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 24)) = geopolyBlobFunc
 197383 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 48)) = geopolyJsonFunc
 197384 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 72)) = geopolySvgFunc
 197385 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 96)) = geopolyWithinFunc
 197386 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 120)) = geopolyContainsPointFunc
 197387 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 144)) = geopolyOverlapFunc
 197388 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 168)) = geopolyDebugFunc
 197389 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 192)) = geopolyBBoxFunc
 197390 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 216)) = geopolyXformFunc
 197391 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 240)) = geopolyRegularFunc
 197392 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 264)) = geopolyCcwFunc
 197393 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 24)) = jsonRemoveFunc
 197394 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 96)) = jsonArrayFunc
 197395 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 168)) = jsonArrayLengthFunc
 197396 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 240)) = jsonArrayLengthFunc
 197397 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 312)) = jsonExtractFunc
 197398 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 384)) = jsonExtractFunc
 197399 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 456)) = jsonExtractFunc
 197400 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 528)) = jsonSetFunc
 197401 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 600)) = jsonObjectFunc
 197402 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 672)) = jsonPatchFunc
 197403 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 744)) = jsonQuoteFunc
 197404 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 816)) = jsonRemoveFunc
 197405 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 888)) = jsonReplaceFunc
 197406 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 960)) = jsonSetFunc
 197407 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 1032)) = jsonTypeFunc
 197408 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 1104)) = jsonTypeFunc
 197409 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 1176)) = jsonValidFunc
 197410 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 1248)) = jsonArrayStep
 197411 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 1256)) = jsonArrayFinal
 197412 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 1264)) = jsonArrayValue
 197413 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 1272)) = jsonGroupInverse
 197414 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 1320)) = jsonObjectStep
 197415 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 1328)) = jsonObjectFinal
 197416 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 1336)) = jsonObjectValue
 197417 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aJsonFunc)) + 1344)) = jsonGroupInverse
 197418 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aMod)) + 8)) = uintptr(unsafe.Pointer(&jsonEachModule))
 197419 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aMod)) + 24)) = uintptr(unsafe.Pointer(&jsonTreeModule))
 197420 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 8)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) WINBOOL }{libc.XAreFileApisANSI}))
 197421 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 80)) = *(*uintptr)(unsafe.Pointer(&struct {
 197422 		f func(*libc.TLS, HANDLE) WINBOOL
 197423 	}{libc.XCloseHandle}))
 197424 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 104)) = *(*uintptr)(unsafe.Pointer(&struct {
 197425 		f func(*libc.TLS, LPCSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES, DWORD, DWORD, HANDLE) HANDLE
 197426 	}{libc.XCreateFileA}))
 197427 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 128)) = *(*uintptr)(unsafe.Pointer(&struct {
 197428 		f func(*libc.TLS, LPCWSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES, DWORD, DWORD, HANDLE) HANDLE
 197429 	}{libc.XCreateFileW}))
 197430 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 152)) = *(*uintptr)(unsafe.Pointer(&struct {
 197431 		f func(*libc.TLS, HANDLE, LPSECURITY_ATTRIBUTES, DWORD, DWORD, DWORD, LPCSTR) HANDLE
 197432 	}{libc.XCreateFileMappingA}))
 197433 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 176)) = *(*uintptr)(unsafe.Pointer(&struct {
 197434 		f func(*libc.TLS, HANDLE, LPSECURITY_ATTRIBUTES, DWORD, DWORD, DWORD, LPCWSTR) HANDLE
 197435 	}{libc.XCreateFileMappingW}))
 197436 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 200)) = *(*uintptr)(unsafe.Pointer(&struct {
 197437 		f func(*libc.TLS, LPSECURITY_ATTRIBUTES, WINBOOL, LPCWSTR) HANDLE
 197438 	}{libc.XCreateMutexW}))
 197439 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 224)) = *(*uintptr)(unsafe.Pointer(&struct {
 197440 		f func(*libc.TLS, LPCSTR) WINBOOL
 197441 	}{libc.XDeleteFileA}))
 197442 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 248)) = *(*uintptr)(unsafe.Pointer(&struct {
 197443 		f func(*libc.TLS, LPCWSTR) WINBOOL
 197444 	}{libc.XDeleteFileW}))
 197445 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 320)) = *(*uintptr)(unsafe.Pointer(&struct {
 197446 		f func(*libc.TLS, HANDLE) WINBOOL
 197447 	}{libc.XFlushFileBuffers}))
 197448 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 344)) = *(*uintptr)(unsafe.Pointer(&struct {
 197449 		f func(*libc.TLS, DWORD, LPCVOID, DWORD, DWORD, LPSTR, DWORD, uintptr) DWORD
 197450 	}{libc.XFormatMessageA}))
 197451 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 368)) = *(*uintptr)(unsafe.Pointer(&struct {
 197452 		f func(*libc.TLS, DWORD, LPCVOID, DWORD, DWORD, LPWSTR, DWORD, uintptr) DWORD
 197453 	}{libc.XFormatMessageW}))
 197454 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 392)) = *(*uintptr)(unsafe.Pointer(&struct {
 197455 		f func(*libc.TLS, HMODULE) WINBOOL
 197456 	}{libc.XFreeLibrary}))
 197457 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 416)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) DWORD }{libc.XGetCurrentProcessId}))
 197458 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 440)) = *(*uintptr)(unsafe.Pointer(&struct {
 197459 		f func(*libc.TLS, LPCSTR, LPDWORD, LPDWORD, LPDWORD, LPDWORD) WINBOOL
 197460 	}{libc.XGetDiskFreeSpaceA}))
 197461 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 464)) = *(*uintptr)(unsafe.Pointer(&struct {
 197462 		f func(*libc.TLS, LPCWSTR, LPDWORD, LPDWORD, LPDWORD, LPDWORD) WINBOOL
 197463 	}{libc.XGetDiskFreeSpaceW}))
 197464 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 488)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, LPCSTR) DWORD }{libc.XGetFileAttributesA}))
 197465 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 512)) = *(*uintptr)(unsafe.Pointer(&struct {
 197466 		f func(*libc.TLS, LPCWSTR) DWORD
 197467 	}{libc.XGetFileAttributesW}))
 197468 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 536)) = *(*uintptr)(unsafe.Pointer(&struct {
 197469 		f func(*libc.TLS, LPCWSTR, GET_FILEEX_INFO_LEVELS, LPVOID) WINBOOL
 197470 	}{libc.XGetFileAttributesExW}))
 197471 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 560)) = *(*uintptr)(unsafe.Pointer(&struct {
 197472 		f func(*libc.TLS, HANDLE, LPDWORD) DWORD
 197473 	}{libc.XGetFileSize}))
 197474 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 584)) = *(*uintptr)(unsafe.Pointer(&struct {
 197475 		f func(*libc.TLS, LPCSTR, DWORD, LPSTR, uintptr) DWORD
 197476 	}{libc.XGetFullPathNameA}))
 197477 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 608)) = *(*uintptr)(unsafe.Pointer(&struct {
 197478 		f func(*libc.TLS, LPCWSTR, DWORD, LPWSTR, uintptr) DWORD
 197479 	}{libc.XGetFullPathNameW}))
 197480 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 632)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) DWORD }{libc.XGetLastError}))
 197481 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 656)) = *(*uintptr)(unsafe.Pointer(&struct {
 197482 		f func(*libc.TLS, HMODULE, LPCSTR) FARPROC
 197483 	}{libc.XGetProcAddress}))
 197484 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 680)) = *(*uintptr)(unsafe.Pointer(&struct {
 197485 		f func(*libc.TLS, LPSYSTEM_INFO)
 197486 	}{libc.XGetSystemInfo}))
 197487 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 704)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, LPSYSTEMTIME) }{libc.XGetSystemTime}))
 197488 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 728)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, LPFILETIME) }{libc.XGetSystemTimeAsFileTime}))
 197489 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 752)) = *(*uintptr)(unsafe.Pointer(&struct {
 197490 		f func(*libc.TLS, DWORD, LPSTR) DWORD
 197491 	}{libc.XGetTempPathA}))
 197492 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 776)) = *(*uintptr)(unsafe.Pointer(&struct {
 197493 		f func(*libc.TLS, DWORD, LPWSTR) DWORD
 197494 	}{libc.XGetTempPathW}))
 197495 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 800)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) DWORD }{libc.XGetTickCount}))
 197496 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 824)) = *(*uintptr)(unsafe.Pointer(&struct {
 197497 		f func(*libc.TLS, LPOSVERSIONINFOA) WINBOOL
 197498 	}{libc.XGetVersionExA}))
 197499 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 848)) = *(*uintptr)(unsafe.Pointer(&struct {
 197500 		f func(*libc.TLS, LPOSVERSIONINFOW) WINBOOL
 197501 	}{libc.XGetVersionExW}))
 197502 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 872)) = *(*uintptr)(unsafe.Pointer(&struct {
 197503 		f func(*libc.TLS, HANDLE, DWORD, SIZE_T) LPVOID
 197504 	}{libc.XHeapAlloc}))
 197505 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 896)) = *(*uintptr)(unsafe.Pointer(&struct {
 197506 		f func(*libc.TLS, DWORD, SIZE_T, SIZE_T) HANDLE
 197507 	}{libc.XHeapCreate}))
 197508 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 920)) = *(*uintptr)(unsafe.Pointer(&struct {
 197509 		f func(*libc.TLS, HANDLE) WINBOOL
 197510 	}{libc.XHeapDestroy}))
 197511 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 944)) = *(*uintptr)(unsafe.Pointer(&struct {
 197512 		f func(*libc.TLS, HANDLE, DWORD, LPVOID) WINBOOL
 197513 	}{libc.XHeapFree}))
 197514 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 968)) = *(*uintptr)(unsafe.Pointer(&struct {
 197515 		f func(*libc.TLS, HANDLE, DWORD, LPVOID, SIZE_T) LPVOID
 197516 	}{libc.XHeapReAlloc}))
 197517 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 992)) = *(*uintptr)(unsafe.Pointer(&struct {
 197518 		f func(*libc.TLS, HANDLE, DWORD, LPCVOID) SIZE_T
 197519 	}{libc.XHeapSize}))
 197520 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1016)) = *(*uintptr)(unsafe.Pointer(&struct {
 197521 		f func(*libc.TLS, HANDLE, DWORD, LPCVOID) WINBOOL
 197522 	}{libc.XHeapValidate}))
 197523 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1040)) = *(*uintptr)(unsafe.Pointer(&struct {
 197524 		f func(*libc.TLS, HANDLE, DWORD) SIZE_T
 197525 	}{libc.XHeapCompact}))
 197526 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1064)) = *(*uintptr)(unsafe.Pointer(&struct {
 197527 		f func(*libc.TLS, LPCSTR) HMODULE
 197528 	}{libc.XLoadLibraryA}))
 197529 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1088)) = *(*uintptr)(unsafe.Pointer(&struct {
 197530 		f func(*libc.TLS, LPCWSTR) HMODULE
 197531 	}{libc.XLoadLibraryW}))
 197532 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1112)) = *(*uintptr)(unsafe.Pointer(&struct {
 197533 		f func(*libc.TLS, HLOCAL) HLOCAL
 197534 	}{libc.XLocalFree}))
 197535 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1136)) = *(*uintptr)(unsafe.Pointer(&struct {
 197536 		f func(*libc.TLS, HANDLE, DWORD, DWORD, DWORD, DWORD) WINBOOL
 197537 	}{libc.XLockFile}))
 197538 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1160)) = *(*uintptr)(unsafe.Pointer(&struct {
 197539 		f func(*libc.TLS, HANDLE, DWORD, DWORD, DWORD, DWORD, LPOVERLAPPED) WINBOOL
 197540 	}{libc.XLockFileEx}))
 197541 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1184)) = *(*uintptr)(unsafe.Pointer(&struct {
 197542 		f func(*libc.TLS, HANDLE, DWORD, DWORD, DWORD, SIZE_T) LPVOID
 197543 	}{libc.XMapViewOfFile}))
 197544 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1208)) = *(*uintptr)(unsafe.Pointer(&struct {
 197545 		f func(*libc.TLS, UINT, DWORD, LPCCH, int32, LPWSTR, int32) int32
 197546 	}{libc.XMultiByteToWideChar}))
 197547 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1232)) = *(*uintptr)(unsafe.Pointer(&struct {
 197548 		f func(*libc.TLS, uintptr) WINBOOL
 197549 	}{libc.XQueryPerformanceCounter}))
 197550 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1256)) = *(*uintptr)(unsafe.Pointer(&struct {
 197551 		f func(*libc.TLS, HANDLE, LPVOID, DWORD, LPDWORD, LPOVERLAPPED) WINBOOL
 197552 	}{libc.XReadFile}))
 197553 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1280)) = *(*uintptr)(unsafe.Pointer(&struct {
 197554 		f func(*libc.TLS, HANDLE) WINBOOL
 197555 	}{libc.XSetEndOfFile}))
 197556 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1304)) = *(*uintptr)(unsafe.Pointer(&struct {
 197557 		f func(*libc.TLS, HANDLE, LONG, PLONG, DWORD) DWORD
 197558 	}{libc.XSetFilePointer}))
 197559 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1328)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, DWORD) }{libc.XSleep}))
 197560 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1352)) = *(*uintptr)(unsafe.Pointer(&struct {
 197561 		f func(*libc.TLS, uintptr, LPFILETIME) WINBOOL
 197562 	}{libc.XSystemTimeToFileTime}))
 197563 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1376)) = *(*uintptr)(unsafe.Pointer(&struct {
 197564 		f func(*libc.TLS, HANDLE, DWORD, DWORD, DWORD, DWORD) WINBOOL
 197565 	}{libc.XUnlockFile}))
 197566 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1400)) = *(*uintptr)(unsafe.Pointer(&struct {
 197567 		f func(*libc.TLS, HANDLE, DWORD, DWORD, DWORD, LPOVERLAPPED) WINBOOL
 197568 	}{libc.XUnlockFileEx}))
 197569 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1424)) = *(*uintptr)(unsafe.Pointer(&struct {
 197570 		f func(*libc.TLS, LPCVOID) WINBOOL
 197571 	}{libc.XUnmapViewOfFile}))
 197572 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1448)) = *(*uintptr)(unsafe.Pointer(&struct {
 197573 		f func(*libc.TLS, UINT, DWORD, LPCWCH, int32, LPSTR, int32, LPCCH, LPBOOL) int32
 197574 	}{libc.XWideCharToMultiByte}))
 197575 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1472)) = *(*uintptr)(unsafe.Pointer(&struct {
 197576 		f func(*libc.TLS, HANDLE, LPCVOID, DWORD, LPDWORD, LPOVERLAPPED) WINBOOL
 197577 	}{libc.XWriteFile}))
 197578 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1520)) = *(*uintptr)(unsafe.Pointer(&struct {
 197579 		f func(*libc.TLS, HANDLE, DWORD) DWORD
 197580 	}{libc.XWaitForSingleObject}))
 197581 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1544)) = *(*uintptr)(unsafe.Pointer(&struct {
 197582 		f func(*libc.TLS, HANDLE, DWORD, WINBOOL) DWORD
 197583 	}{libc.XWaitForSingleObjectEx}))
 197584 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1736)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, LPCSTR) }{libc.XOutputDebugStringA}))
 197585 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1760)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, LPCWSTR) }{libc.XOutputDebugStringW}))
 197586 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1784)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) HANDLE }{libc.XGetProcessHeap}))
 197587 	*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 1904)) = *(*uintptr)(unsafe.Pointer(&struct {
 197588 		f func(*libc.TLS, LPCVOID, SIZE_T) WINBOOL
 197589 	}{libc.XFlushViewOfFile}))
 197590 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 24)) = row_numberStepFunc
 197591 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 32)) = row_numberValueFunc
 197592 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 40)) = row_numberValueFunc
 197593 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 48)) = noopStepFunc
 197594 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 56)) = uintptr(unsafe.Pointer(&row_numberName))
 197595 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 96)) = dense_rankStepFunc
 197596 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 104)) = dense_rankValueFunc
 197597 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 112)) = dense_rankValueFunc
 197598 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 120)) = noopStepFunc
 197599 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 128)) = uintptr(unsafe.Pointer(&dense_rankName))
 197600 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 168)) = rankStepFunc
 197601 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 176)) = rankValueFunc
 197602 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 184)) = rankValueFunc
 197603 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 192)) = noopStepFunc
 197604 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 200)) = uintptr(unsafe.Pointer(&rankName))
 197605 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 240)) = percent_rankStepFunc
 197606 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 248)) = percent_rankValueFunc
 197607 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 256)) = percent_rankValueFunc
 197608 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 264)) = percent_rankInvFunc
 197609 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 272)) = uintptr(unsafe.Pointer(&percent_rankName))
 197610 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 312)) = cume_distStepFunc
 197611 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 320)) = cume_distValueFunc
 197612 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 328)) = cume_distValueFunc
 197613 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 336)) = cume_distInvFunc
 197614 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 344)) = uintptr(unsafe.Pointer(&cume_distName))
 197615 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 384)) = ntileStepFunc
 197616 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 392)) = ntileValueFunc
 197617 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 400)) = ntileValueFunc
 197618 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 408)) = ntileInvFunc
 197619 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 416)) = uintptr(unsafe.Pointer(&ntileName))
 197620 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 456)) = last_valueStepFunc
 197621 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 464)) = last_valueFinalizeFunc
 197622 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 472)) = last_valueValueFunc
 197623 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 480)) = last_valueInvFunc
 197624 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 488)) = uintptr(unsafe.Pointer(&last_valueName))
 197625 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 528)) = nth_valueStepFunc
 197626 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 536)) = nth_valueFinalizeFunc
 197627 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 544)) = noopValueFunc
 197628 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 552)) = noopStepFunc
 197629 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 560)) = uintptr(unsafe.Pointer(&nth_valueName))
 197630 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 600)) = first_valueStepFunc
 197631 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 608)) = first_valueFinalizeFunc
 197632 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 616)) = noopValueFunc
 197633 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 624)) = noopStepFunc
 197634 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 632)) = uintptr(unsafe.Pointer(&first_valueName))
 197635 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 672)) = noopStepFunc
 197636 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 680)) = noopValueFunc
 197637 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 688)) = noopValueFunc
 197638 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 696)) = noopStepFunc
 197639 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 704)) = uintptr(unsafe.Pointer(&leadName))
 197640 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 744)) = noopStepFunc
 197641 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 752)) = noopValueFunc
 197642 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 760)) = noopValueFunc
 197643 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 768)) = noopStepFunc
 197644 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 776)) = uintptr(unsafe.Pointer(&leadName))
 197645 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 816)) = noopStepFunc
 197646 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 824)) = noopValueFunc
 197647 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 832)) = noopValueFunc
 197648 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 840)) = noopStepFunc
 197649 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 848)) = uintptr(unsafe.Pointer(&leadName))
 197650 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 888)) = noopStepFunc
 197651 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 896)) = noopValueFunc
 197652 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 904)) = noopValueFunc
 197653 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 912)) = noopStepFunc
 197654 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 920)) = uintptr(unsafe.Pointer(&lagName))
 197655 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 960)) = noopStepFunc
 197656 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 968)) = noopValueFunc
 197657 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 976)) = noopValueFunc
 197658 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 984)) = noopStepFunc
 197659 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 992)) = uintptr(unsafe.Pointer(&lagName))
 197660 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1032)) = noopStepFunc
 197661 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1040)) = noopValueFunc
 197662 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1048)) = noopValueFunc
 197663 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1056)) = noopStepFunc
 197664 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1064)) = uintptr(unsafe.Pointer(&lagName))
 197665 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&attach_func)) + 24)) = attachFunc
 197666 	*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 0)) = sqlite3MemMalloc
 197667 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 8)) = sqlite3MemFree
 197668 	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 16)) = sqlite3MemRealloc
 197669 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 24)) = sqlite3MemSize
 197670 	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 32)) = sqlite3MemRoundup
 197671 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 40)) = sqlite3MemInit
 197672 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 48)) = sqlite3MemShutdown
 197673 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 16)) = pcache1Init
 197674 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 24)) = pcache1Shutdown
 197675 	*(*func(*libc.TLS, int32, int32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 32)) = pcache1Create
 197676 	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 40)) = pcache1Cachesize
 197677 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 48)) = pcache1Pagecount
 197678 	*(*func(*libc.TLS, uintptr, uint32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 56)) = pcache1Fetch
 197679 	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 64)) = pcache1Unpin
 197680 	*(*func(*libc.TLS, uintptr, uintptr, uint32, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 72)) = pcache1Rekey
 197681 	*(*func(*libc.TLS, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 80)) = pcache1Truncate
 197682 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 88)) = pcache1Destroy
 197683 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 96)) = pcache1Shrink
 197684 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&detach_func)) + 24)) = detachFunc
 197685 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 8)) = fts5CreateMethod
 197686 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 16)) = fts5ConnectMethod
 197687 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 24)) = fts5BestIndexMethod
 197688 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 32)) = fts5DisconnectMethod
 197689 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 40)) = fts5DestroyMethod
 197690 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 48)) = fts5OpenMethod
 197691 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 56)) = fts5CloseMethod
 197692 	*(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 64)) = fts5FilterMethod
 197693 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 72)) = fts5NextMethod
 197694 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 80)) = fts5EofMethod
 197695 	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 88)) = fts5ColumnMethod
 197696 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 96)) = fts5RowidMethod
 197697 	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 104)) = fts5UpdateMethod
 197698 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 112)) = fts5BeginMethod
 197699 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 120)) = fts5SyncMethod
 197700 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 128)) = fts5CommitMethod
 197701 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 136)) = fts5RollbackMethod
 197702 	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 144)) = fts5FindFunctionMethod
 197703 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 152)) = fts5RenameMethod
 197704 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 160)) = fts5SavepointMethod
 197705 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 168)) = fts5ReleaseMethod
 197706 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 176)) = fts5RollbackToMethod
 197707 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 184)) = fts5ShadowName
 197708 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 8)) = fts5VocabCreateMethod
 197709 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 16)) = fts5VocabConnectMethod
 197710 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 24)) = fts5VocabBestIndexMethod
 197711 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 32)) = fts5VocabDisconnectMethod
 197712 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 40)) = fts5VocabDestroyMethod
 197713 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 48)) = fts5VocabOpenMethod
 197714 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 56)) = fts5VocabCloseMethod
 197715 	*(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 64)) = fts5VocabFilterMethod
 197716 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 72)) = fts5VocabNextMethod
 197717 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 80)) = fts5VocabEofMethod
 197718 	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 88)) = fts5VocabColumnMethod
 197719 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 96)) = fts5VocabRowidMethod
 197720 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 8)) = geopolyCreate
 197721 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 16)) = geopolyConnect
 197722 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 24)) = geopolyBestIndex
 197723 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 32)) = rtreeDisconnect
 197724 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 40)) = rtreeDestroy
 197725 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 48)) = rtreeOpen
 197726 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 56)) = rtreeClose
 197727 	*(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 64)) = geopolyFilter
 197728 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 72)) = rtreeNext
 197729 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 80)) = rtreeEof
 197730 	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 88)) = geopolyColumn
 197731 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 96)) = rtreeRowid
 197732 	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 104)) = geopolyUpdate
 197733 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 112)) = rtreeBeginTransaction
 197734 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 120)) = rtreeEndTransaction
 197735 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 128)) = rtreeEndTransaction
 197736 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 136)) = rtreeEndTransaction
 197737 	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 144)) = geopolyFindFunction
 197738 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 152)) = rtreeRename
 197739 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 160)) = rtreeSavepoint
 197740 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 184)) = rtreeShadowName
 197741 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 16)) = jsonEachConnect
 197742 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 24)) = jsonEachBestIndex
 197743 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 32)) = jsonEachDisconnect
 197744 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 48)) = jsonEachOpenEach
 197745 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 56)) = jsonEachClose
 197746 	*(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 64)) = jsonEachFilter
 197747 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 72)) = jsonEachNext
 197748 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 80)) = jsonEachEof
 197749 	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 88)) = jsonEachColumn
 197750 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 96)) = jsonEachRowid
 197751 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 16)) = jsonEachConnect
 197752 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 24)) = jsonEachBestIndex
 197753 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 32)) = jsonEachDisconnect
 197754 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 48)) = jsonEachOpenTree
 197755 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 56)) = jsonEachClose
 197756 	*(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 64)) = jsonEachFilter
 197757 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 72)) = jsonEachNext
 197758 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 80)) = jsonEachEof
 197759 	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 88)) = jsonEachColumn
 197760 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 96)) = jsonEachRowid
 197761 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 8)) = memdbClose
 197762 	*(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 16)) = memdbRead
 197763 	*(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 24)) = memdbWrite
 197764 	*(*func(*libc.TLS, uintptr, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 32)) = memdbTruncate
 197765 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 40)) = memdbSync
 197766 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 48)) = memdbFileSize
 197767 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 56)) = memdbLock
 197768 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 64)) = memdbUnlock
 197769 	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 80)) = memdbFileControl
 197770 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 96)) = memdbDeviceCharacteristics
 197771 	*(*func(*libc.TLS, uintptr, Sqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 136)) = memdbFetch
 197772 	*(*func(*libc.TLS, uintptr, Sqlite3_int64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 144)) = memdbUnfetch
 197773 	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 40)) = memdbOpen
 197774 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 56)) = memdbAccess
 197775 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 64)) = memdbFullPathname
 197776 	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 72)) = memdbDlOpen
 197777 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 80)) = memdbDlError
 197778 	*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 88)) = memdbDlSym
 197779 	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 96)) = memdbDlClose
 197780 	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 104)) = memdbRandomness
 197781 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 112)) = memdbSleep
 197782 	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 128)) = memdbGetLastError
 197783 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 136)) = memdbCurrentTimeInt64
 197784 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 16)) = pragmaVtabConnect
 197785 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 24)) = pragmaVtabBestIndex
 197786 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 32)) = pragmaVtabDisconnect
 197787 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 48)) = pragmaVtabOpen
 197788 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 56)) = pragmaVtabClose
 197789 	*(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 64)) = pragmaVtabFilter
 197790 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 72)) = pragmaVtabNext
 197791 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 80)) = pragmaVtabEof
 197792 	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 88)) = pragmaVtabColumn
 197793 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 96)) = pragmaVtabRowid
 197794 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 8)) = rbuVfsClose
 197795 	*(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 16)) = rbuVfsRead
 197796 	*(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 24)) = rbuVfsWrite
 197797 	*(*func(*libc.TLS, uintptr, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 32)) = rbuVfsTruncate
 197798 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 40)) = rbuVfsSync
 197799 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 48)) = rbuVfsFileSize
 197800 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 56)) = rbuVfsLock
 197801 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 64)) = rbuVfsUnlock
 197802 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 72)) = rbuVfsCheckReservedLock
 197803 	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 80)) = rbuVfsFileControl
 197804 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 88)) = rbuVfsSectorSize
 197805 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 96)) = rbuVfsDeviceCharacteristics
 197806 	*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 104)) = rbuVfsShmMap
 197807 	*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 112)) = rbuVfsShmLock
 197808 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 120)) = rbuVfsShmBarrier
 197809 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 128)) = rbuVfsShmUnmap
 197810 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods1)) + 8)) = rbuVfsClose
 197811 	*(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods1)) + 16)) = rbuVfsRead
 197812 	*(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods1)) + 24)) = rbuVfsWrite
 197813 	*(*func(*libc.TLS, uintptr, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods1)) + 32)) = rbuVfsTruncate
 197814 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods1)) + 40)) = rbuVfsSync
 197815 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods1)) + 48)) = rbuVfsFileSize
 197816 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods1)) + 56)) = rbuVfsLock
 197817 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods1)) + 64)) = rbuVfsUnlock
 197818 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods1)) + 72)) = rbuVfsCheckReservedLock
 197819 	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods1)) + 80)) = rbuVfsFileControl
 197820 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods1)) + 88)) = rbuVfsSectorSize
 197821 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods1)) + 96)) = rbuVfsDeviceCharacteristics
 197822 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 8)) = rtreeCreate
 197823 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 16)) = rtreeConnect
 197824 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 24)) = rtreeBestIndex
 197825 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 32)) = rtreeDisconnect
 197826 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 40)) = rtreeDestroy
 197827 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 48)) = rtreeOpen
 197828 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 56)) = rtreeClose
 197829 	*(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 64)) = rtreeFilter
 197830 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 72)) = rtreeNext
 197831 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 80)) = rtreeEof
 197832 	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 88)) = rtreeColumn
 197833 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 96)) = rtreeRowid
 197834 	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 104)) = rtreeUpdate
 197835 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 112)) = rtreeBeginTransaction
 197836 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 120)) = rtreeEndTransaction
 197837 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 128)) = rtreeEndTransaction
 197838 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 136)) = rtreeEndTransaction
 197839 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 152)) = rtreeRename
 197840 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 160)) = rtreeSavepoint
 197841 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 184)) = rtreeShadowName
 197842 	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 8)) = fts5ApiUserData
 197843 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 16)) = fts5ApiColumnCount
 197844 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 24)) = fts5ApiRowCount
 197845 	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 32)) = fts5ApiColumnTotalSize
 197846 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 40)) = fts5ApiTokenize
 197847 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 48)) = fts5ApiPhraseCount
 197848 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 56)) = fts5ApiPhraseSize
 197849 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 64)) = fts5ApiInstCount
 197850 	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 72)) = fts5ApiInst
 197851 	*(*func(*libc.TLS, uintptr) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 80)) = fts5ApiRowid
 197852 	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 88)) = fts5ApiColumnText
 197853 	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 96)) = fts5ApiColumnSize
 197854 	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 104)) = fts5ApiQueryPhrase
 197855 	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 112)) = fts5ApiSetAuxdata
 197856 	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 120)) = fts5ApiGetAuxdata
 197857 	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 128)) = fts5ApiPhraseFirst
 197858 	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 136)) = fts5ApiPhraseNext
 197859 	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 144)) = fts5ApiPhraseFirstColumn
 197860 	*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 152)) = fts5ApiPhraseNextColumn
 197861 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 8)) = memjrnlClose
 197862 	*(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 16)) = memjrnlRead
 197863 	*(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 24)) = memjrnlWrite
 197864 	*(*func(*libc.TLS, uintptr, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 32)) = memjrnlTruncate
 197865 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 40)) = memjrnlSync
 197866 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 48)) = memjrnlFileSize
 197867 	*(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 0)) = noopMutexInit
 197868 	*(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 8)) = noopMutexEnd
 197869 	*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 16)) = noopMutexAlloc
 197870 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 24)) = noopMutexFree
 197871 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 32)) = noopMutexEnter
 197872 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 40)) = noopMutexTry
 197873 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 48)) = noopMutexLeave
 197874 	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 0)) = Xsqlite3_aggregate_context
 197875 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 8)) = Xsqlite3_aggregate_count
 197876 	*(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 16)) = Xsqlite3_bind_blob
 197877 	*(*func(*libc.TLS, uintptr, int32, float64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 24)) = Xsqlite3_bind_double
 197878 	*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 32)) = Xsqlite3_bind_int
 197879 	*(*func(*libc.TLS, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 40)) = Xsqlite3_bind_int64
 197880 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 48)) = Xsqlite3_bind_null
 197881 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 56)) = Xsqlite3_bind_parameter_count
 197882 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 64)) = Xsqlite3_bind_parameter_index
 197883 	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 72)) = Xsqlite3_bind_parameter_name
 197884 	*(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 80)) = Xsqlite3_bind_text
 197885 	*(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 88)) = Xsqlite3_bind_text16
 197886 	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 96)) = Xsqlite3_bind_value
 197887 	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 104)) = Xsqlite3_busy_handler
 197888 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 112)) = Xsqlite3_busy_timeout
 197889 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 120)) = Xsqlite3_changes
 197890 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 128)) = Xsqlite3_close
 197891 	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 136)) = Xsqlite3_collation_needed
 197892 	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 144)) = Xsqlite3_collation_needed16
 197893 	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 152)) = Xsqlite3_column_blob
 197894 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 160)) = Xsqlite3_column_bytes
 197895 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 168)) = Xsqlite3_column_bytes16
 197896 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 176)) = Xsqlite3_column_count
 197897 	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 184)) = Xsqlite3_column_database_name
 197898 	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 192)) = Xsqlite3_column_database_name16
 197899 	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 200)) = Xsqlite3_column_decltype
 197900 	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 208)) = Xsqlite3_column_decltype16
 197901 	*(*func(*libc.TLS, uintptr, int32) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 216)) = Xsqlite3_column_double
 197902 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 224)) = Xsqlite3_column_int
 197903 	*(*func(*libc.TLS, uintptr, int32) Sqlite_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 232)) = Xsqlite3_column_int64
 197904 	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 240)) = Xsqlite3_column_name
 197905 	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 248)) = Xsqlite3_column_name16
 197906 	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 256)) = Xsqlite3_column_origin_name
 197907 	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 264)) = Xsqlite3_column_origin_name16
 197908 	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 272)) = Xsqlite3_column_table_name
 197909 	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 280)) = Xsqlite3_column_table_name16
 197910 	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 288)) = Xsqlite3_column_text
 197911 	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 296)) = Xsqlite3_column_text16
 197912 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 304)) = Xsqlite3_column_type
 197913 	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 312)) = Xsqlite3_column_value
 197914 	*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 320)) = Xsqlite3_commit_hook
 197915 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 328)) = Xsqlite3_complete
 197916 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 336)) = Xsqlite3_complete16
 197917 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 344)) = Xsqlite3_create_collation
 197918 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 352)) = Xsqlite3_create_collation16
 197919 	*(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 360)) = Xsqlite3_create_function
 197920 	*(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 368)) = Xsqlite3_create_function16
 197921 	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 376)) = Xsqlite3_create_module
 197922 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 384)) = Xsqlite3_data_count
 197923 	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 392)) = Xsqlite3_db_handle
 197924 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 400)) = Xsqlite3_declare_vtab
 197925 	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 408)) = Xsqlite3_enable_shared_cache
 197926 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 416)) = Xsqlite3_errcode
 197927 	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 424)) = Xsqlite3_errmsg
 197928 	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 432)) = Xsqlite3_errmsg16
 197929 	*(*func(*libc.TLS, uintptr, uintptr, Sqlite3_callback, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 440)) = Xsqlite3_exec
 197930 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 448)) = Xsqlite3_expired
 197931 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 456)) = Xsqlite3_finalize
 197932 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 464)) = Xsqlite3_free
 197933 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 472)) = Xsqlite3_free_table
 197934 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 480)) = Xsqlite3_get_autocommit
 197935 	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 488)) = Xsqlite3_get_auxdata
 197936 	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 496)) = Xsqlite3_get_table
 197937 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 512)) = Xsqlite3_interrupt
 197938 	*(*func(*libc.TLS, uintptr) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 520)) = Xsqlite3_last_insert_rowid
 197939 	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 528)) = Xsqlite3_libversion
 197940 	*(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 536)) = Xsqlite3_libversion_number
 197941 	*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 544)) = Xsqlite3_malloc
 197942 	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 552)) = Xsqlite3_mprintf
 197943 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 560)) = Xsqlite3_open
 197944 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 568)) = Xsqlite3_open16
 197945 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 576)) = Xsqlite3_prepare
 197946 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 584)) = Xsqlite3_prepare16
 197947 	*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 592)) = Xsqlite3_profile
 197948 	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 600)) = Xsqlite3_progress_handler
 197949 	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 608)) = Xsqlite3_realloc
 197950 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 616)) = Xsqlite3_reset
 197951 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 624)) = Xsqlite3_result_blob
 197952 	*(*func(*libc.TLS, uintptr, float64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 632)) = Xsqlite3_result_double
 197953 	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 640)) = Xsqlite3_result_error
 197954 	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 648)) = Xsqlite3_result_error16
 197955 	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 656)) = Xsqlite3_result_int
 197956 	*(*func(*libc.TLS, uintptr, I64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 664)) = Xsqlite3_result_int64
 197957 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 672)) = Xsqlite3_result_null
 197958 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 680)) = Xsqlite3_result_text
 197959 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 688)) = Xsqlite3_result_text16
 197960 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 696)) = Xsqlite3_result_text16be
 197961 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 704)) = Xsqlite3_result_text16le
 197962 	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 712)) = Xsqlite3_result_value
 197963 	*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 720)) = Xsqlite3_rollback_hook
 197964 	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 728)) = Xsqlite3_set_authorizer
 197965 	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 736)) = Xsqlite3_set_auxdata
 197966 	*(*func(*libc.TLS, int32, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 744)) = Xsqlite3_snprintf
 197967 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 752)) = Xsqlite3_step
 197968 	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 760)) = Xsqlite3_table_column_metadata
 197969 	*(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 768)) = Xsqlite3_thread_cleanup
 197970 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 776)) = Xsqlite3_total_changes
 197971 	*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 784)) = Xsqlite3_trace
 197972 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 792)) = Xsqlite3_transfer_bindings
 197973 	*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 800)) = Xsqlite3_update_hook
 197974 	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 808)) = Xsqlite3_user_data
 197975 	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 816)) = Xsqlite3_value_blob
 197976 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 824)) = Xsqlite3_value_bytes
 197977 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 832)) = Xsqlite3_value_bytes16
 197978 	*(*func(*libc.TLS, uintptr) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 840)) = Xsqlite3_value_double
 197979 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 848)) = Xsqlite3_value_int
 197980 	*(*func(*libc.TLS, uintptr) Sqlite_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 856)) = Xsqlite3_value_int64
 197981 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 864)) = Xsqlite3_value_numeric_type
 197982 	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 872)) = Xsqlite3_value_text
 197983 	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 880)) = Xsqlite3_value_text16
 197984 	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 888)) = Xsqlite3_value_text16be
 197985 	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 896)) = Xsqlite3_value_text16le
 197986 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 904)) = Xsqlite3_value_type
 197987 	*(*func(*libc.TLS, uintptr, Va_list) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 912)) = Xsqlite3_vmprintf
 197988 	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 920)) = Xsqlite3_overload_function
 197989 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 928)) = Xsqlite3_prepare_v2
 197990 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 936)) = Xsqlite3_prepare16_v2
 197991 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 944)) = Xsqlite3_clear_bindings
 197992 	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 952)) = Xsqlite3_create_module_v2
 197993 	*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 960)) = Xsqlite3_bind_zeroblob
 197994 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 968)) = Xsqlite3_blob_bytes
 197995 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 976)) = Xsqlite3_blob_close
 197996 	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, Sqlite_int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 984)) = Xsqlite3_blob_open
 197997 	*(*func(*libc.TLS, uintptr, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 992)) = Xsqlite3_blob_read
 197998 	*(*func(*libc.TLS, uintptr, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1000)) = Xsqlite3_blob_write
 197999 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1008)) = Xsqlite3_create_collation_v2
 198000 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1016)) = Xsqlite3_file_control
 198001 	*(*func(*libc.TLS, int32) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1024)) = Xsqlite3_memory_highwater
 198002 	*(*func(*libc.TLS) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1032)) = Xsqlite3_memory_used
 198003 	*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1040)) = Xsqlite3_mutex_alloc
 198004 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1048)) = Xsqlite3_mutex_enter
 198005 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1056)) = Xsqlite3_mutex_free
 198006 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1064)) = Xsqlite3_mutex_leave
 198007 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1072)) = Xsqlite3_mutex_try
 198008 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1080)) = Xsqlite3_open_v2
 198009 	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1088)) = Xsqlite3_release_memory
 198010 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1096)) = Xsqlite3_result_error_nomem
 198011 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1104)) = Xsqlite3_result_error_toobig
 198012 	*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1112)) = Xsqlite3_sleep
 198013 	*(*func(*libc.TLS, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1120)) = Xsqlite3_soft_heap_limit
 198014 	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1128)) = Xsqlite3_vfs_find
 198015 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1136)) = Xsqlite3_vfs_register
 198016 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1144)) = Xsqlite3_vfs_unregister
 198017 	*(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1152)) = Xsqlite3_threadsafe
 198018 	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1160)) = Xsqlite3_result_zeroblob
 198019 	*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1168)) = Xsqlite3_result_error_code
 198020 	*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1176)) = Xsqlite3_test_control
 198021 	*(*func(*libc.TLS, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1184)) = Xsqlite3_randomness
 198022 	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1192)) = Xsqlite3_context_db_handle
 198023 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1200)) = Xsqlite3_extended_result_codes
 198024 	*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1208)) = Xsqlite3_limit
 198025 	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1216)) = Xsqlite3_next_stmt
 198026 	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1224)) = Xsqlite3_sql
 198027 	*(*func(*libc.TLS, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1232)) = Xsqlite3_status
 198028 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1240)) = Xsqlite3_backup_finish
 198029 	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1248)) = Xsqlite3_backup_init
 198030 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1256)) = Xsqlite3_backup_pagecount
 198031 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1264)) = Xsqlite3_backup_remaining
 198032 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1272)) = Xsqlite3_backup_step
 198033 	*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1280)) = Xsqlite3_compileoption_get
 198034 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1288)) = Xsqlite3_compileoption_used
 198035 	*(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1296)) = Xsqlite3_create_function_v2
 198036 	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1304)) = Xsqlite3_db_config
 198037 	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1312)) = Xsqlite3_db_mutex
 198038 	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1320)) = Xsqlite3_db_status
 198039 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1328)) = Xsqlite3_extended_errcode
 198040 	*(*func(*libc.TLS, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1336)) = Xsqlite3_log
 198041 	*(*func(*libc.TLS, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1344)) = Xsqlite3_soft_heap_limit64
 198042 	*(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1352)) = Xsqlite3_sourceid
 198043 	*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1360)) = Xsqlite3_stmt_status
 198044 	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1368)) = Xsqlite3_strnicmp
 198045 	*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1376)) = Xsqlite3_unlock_notify
 198046 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1384)) = Xsqlite3_wal_autocheckpoint
 198047 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1392)) = Xsqlite3_wal_checkpoint
 198048 	*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1400)) = Xsqlite3_wal_hook
 198049 	*(*func(*libc.TLS, uintptr, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1408)) = Xsqlite3_blob_reopen
 198050 	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1416)) = Xsqlite3_vtab_config
 198051 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1424)) = Xsqlite3_vtab_on_conflict
 198052 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1432)) = Xsqlite3_close_v2
 198053 	*(*func(*libc.TLS, uintptr, uintptr) Sqlite3_filename)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1440)) = Xsqlite3_db_filename
 198054 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1448)) = Xsqlite3_db_readonly
 198055 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1456)) = Xsqlite3_db_release_memory
 198056 	*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1464)) = Xsqlite3_errstr
 198057 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1472)) = Xsqlite3_stmt_busy
 198058 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1480)) = Xsqlite3_stmt_readonly
 198059 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1488)) = Xsqlite3_stricmp
 198060 	*(*func(*libc.TLS, Sqlite3_filename, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1496)) = Xsqlite3_uri_boolean
 198061 	*(*func(*libc.TLS, Sqlite3_filename, uintptr, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1504)) = Xsqlite3_uri_int64
 198062 	*(*func(*libc.TLS, Sqlite3_filename, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1512)) = Xsqlite3_uri_parameter
 198063 	*(*func(*libc.TLS, int32, uintptr, uintptr, Va_list) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1520)) = Xsqlite3_vsnprintf
 198064 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1528)) = Xsqlite3_wal_checkpoint_v2
 198065 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1536)) = Xsqlite3_auto_extension
 198066 	*(*func(*libc.TLS, uintptr, int32, uintptr, Sqlite3_uint64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1544)) = Xsqlite3_bind_blob64
 198067 	*(*func(*libc.TLS, uintptr, int32, uintptr, Sqlite3_uint64, uintptr, uint8) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1552)) = Xsqlite3_bind_text64
 198068 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1560)) = Xsqlite3_cancel_auto_extension
 198069 	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1568)) = Xsqlite3_load_extension
 198070 	*(*func(*libc.TLS, Sqlite3_uint64) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1576)) = Xsqlite3_malloc64
 198071 	*(*func(*libc.TLS, uintptr) Sqlite3_uint64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1584)) = Xsqlite3_msize
 198072 	*(*func(*libc.TLS, uintptr, Sqlite3_uint64) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1592)) = Xsqlite3_realloc64
 198073 	*(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1600)) = Xsqlite3_reset_auto_extension
 198074 	*(*func(*libc.TLS, uintptr, uintptr, Sqlite3_uint64, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1608)) = Xsqlite3_result_blob64
 198075 	*(*func(*libc.TLS, uintptr, uintptr, Sqlite3_uint64, uintptr, uint8))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1616)) = Xsqlite3_result_text64
 198076 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1624)) = Xsqlite3_strglob
 198077 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1632)) = *(*uintptr)(unsafe.Pointer(&struct {
 198078 		f func(*libc.TLS, uintptr) uintptr
 198079 	}{Xsqlite3_value_dup}))
 198080 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1640)) = Xsqlite3_value_free
 198081 	*(*func(*libc.TLS, uintptr, U64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1648)) = Xsqlite3_result_zeroblob64
 198082 	*(*func(*libc.TLS, uintptr, int32, Sqlite3_uint64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1656)) = Xsqlite3_bind_zeroblob64
 198083 	*(*func(*libc.TLS, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1664)) = Xsqlite3_value_subtype
 198084 	*(*func(*libc.TLS, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1672)) = Xsqlite3_result_subtype
 198085 	*(*func(*libc.TLS, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1680)) = Xsqlite3_status64
 198086 	*(*func(*libc.TLS, uintptr, uintptr, uint32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1688)) = Xsqlite3_strlike
 198087 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1696)) = Xsqlite3_db_cacheflush
 198088 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1704)) = Xsqlite3_system_errno
 198089 	*(*func(*libc.TLS, uintptr, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1712)) = Xsqlite3_trace_v2
 198090 	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1720)) = Xsqlite3_expanded_sql
 198091 	*(*func(*libc.TLS, uintptr, Sqlite3_int64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1728)) = Xsqlite3_set_last_insert_rowid
 198092 	*(*func(*libc.TLS, uintptr, uintptr, int32, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1736)) = Xsqlite3_prepare_v3
 198093 	*(*func(*libc.TLS, uintptr, uintptr, int32, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1744)) = Xsqlite3_prepare16_v3
 198094 	*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1752)) = Xsqlite3_bind_pointer
 198095 	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1760)) = Xsqlite3_result_pointer
 198096 	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1768)) = Xsqlite3_value_pointer
 198097 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1776)) = Xsqlite3_vtab_nochange
 198098 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1784)) = Xsqlite3_value_nochange
 198099 	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1792)) = Xsqlite3_vtab_collation
 198100 	*(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1800)) = Xsqlite3_keyword_count
 198101 	*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1808)) = Xsqlite3_keyword_name
 198102 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1816)) = Xsqlite3_keyword_check
 198103 	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1824)) = Xsqlite3_str_new
 198104 	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1832)) = Xsqlite3_str_finish
 198105 	*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1840)) = Xsqlite3_str_appendf
 198106 	*(*func(*libc.TLS, uintptr, uintptr, Va_list))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1848)) = Xsqlite3_str_vappendf
 198107 	*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1856)) = Xsqlite3_str_append
 198108 	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1864)) = Xsqlite3_str_appendall
 198109 	*(*func(*libc.TLS, uintptr, int32, int8))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1872)) = Xsqlite3_str_appendchar
 198110 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1880)) = Xsqlite3_str_reset
 198111 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1888)) = Xsqlite3_str_errcode
 198112 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1896)) = Xsqlite3_str_length
 198113 	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1904)) = Xsqlite3_str_value
 198114 	*(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1912)) = Xsqlite3_create_window_function
 198115 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1928)) = Xsqlite3_stmt_isexplain
 198116 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1936)) = Xsqlite3_value_frombind
 198117 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1944)) = Xsqlite3_drop_modules
 198118 	*(*func(*libc.TLS, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1952)) = Xsqlite3_hard_heap_limit64
 198119 	*(*func(*libc.TLS, Sqlite3_filename, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1960)) = Xsqlite3_uri_key
 198120 	*(*func(*libc.TLS, Sqlite3_filename) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1968)) = Xsqlite3_filename_database
 198121 	*(*func(*libc.TLS, Sqlite3_filename) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1976)) = Xsqlite3_filename_journal
 198122 	*(*func(*libc.TLS, Sqlite3_filename) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1984)) = Xsqlite3_filename_wal
 198123 	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) Sqlite3_filename)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1992)) = Xsqlite3_create_filename
 198124 	*(*func(*libc.TLS, Sqlite3_filename))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2000)) = Xsqlite3_free_filename
 198125 	*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2008)) = Xsqlite3_database_file_object
 198126 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2016)) = Xsqlite3_txn_state
 198127 	*(*func(*libc.TLS, uintptr) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2024)) = Xsqlite3_changes64
 198128 	*(*func(*libc.TLS, uintptr) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2032)) = Xsqlite3_total_changes64
 198129 	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2040)) = Xsqlite3_autovacuum_pages
 198130 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2048)) = Xsqlite3_error_offset
 198131 	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2056)) = Xsqlite3_vtab_rhs_value
 198132 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2064)) = Xsqlite3_vtab_distinct
 198133 	*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2072)) = Xsqlite3_vtab_in
 198134 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2080)) = Xsqlite3_vtab_in_first
 198135 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2088)) = Xsqlite3_vtab_in_next
 198136 	*(*func(*libc.TLS, uintptr, uintptr, uintptr, Sqlite3_int64, Sqlite3_int64, uint32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2096)) = Xsqlite3_deserialize
 198137 	*(*func(*libc.TLS, uintptr, uintptr, uintptr, uint32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2104)) = Xsqlite3_serialize
 198138 	*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2112)) = Xsqlite3_db_name
 198139 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2120)) = Xsqlite3_value_encoding
 198140 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2128)) = Xsqlite3_is_interrupted
 198141 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 0)) = Xsqlite3Fts5Init
 198142 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 8)) = Xsqlite3RtreeInit
 198143 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 16)) = sqlite3TestExtInit
 198144 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 24)) = Xsqlite3JsonTableFunctions
 198145 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statGetFuncdef)) + 24)) = statGet
 198146 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statInitFuncdef)) + 24)) = statInit
 198147 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statPushFuncdef)) + 24)) = statPush
 198148 	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 40)) = rbuVfsOpen
 198149 	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 48)) = rbuVfsDelete
 198150 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 56)) = rbuVfsAccess
 198151 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 64)) = rbuVfsFullPathname
 198152 	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 72)) = rbuVfsDlOpen
 198153 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 80)) = rbuVfsDlError
 198154 	*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 88)) = rbuVfsDlSym
 198155 	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 96)) = rbuVfsDlClose
 198156 	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 104)) = rbuVfsRandomness
 198157 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 112)) = rbuVfsSleep
 198158 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 120)) = rbuVfsCurrentTime
 198159 	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 128)) = rbuVfsGetLastError
 198160 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&winAppData)) + 0)) = uintptr(unsafe.Pointer(&winIoMethod))
 198161 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoMethod)) + 8)) = winClose
 198162 	*(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoMethod)) + 16)) = winRead
 198163 	*(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoMethod)) + 24)) = winWrite
 198164 	*(*func(*libc.TLS, uintptr, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoMethod)) + 32)) = winTruncate
 198165 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoMethod)) + 40)) = winSync
 198166 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoMethod)) + 48)) = winFileSize
 198167 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoMethod)) + 56)) = winLock
 198168 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoMethod)) + 64)) = winUnlock
 198169 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoMethod)) + 72)) = winCheckReservedLock
 198170 	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoMethod)) + 80)) = winFileControl
 198171 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoMethod)) + 88)) = winSectorSize
 198172 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoMethod)) + 96)) = winDeviceCharacteristics
 198173 	*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoMethod)) + 104)) = winShmMap
 198174 	*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoMethod)) + 112)) = winShmLock
 198175 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoMethod)) + 120)) = winShmBarrier
 198176 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoMethod)) + 128)) = winShmUnmap
 198177 	*(*func(*libc.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoMethod)) + 136)) = winFetch
 198178 	*(*func(*libc.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoMethod)) + 144)) = winUnfetch
 198179 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoNolockMethod)) + 8)) = winClose
 198180 	*(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoNolockMethod)) + 16)) = winRead
 198181 	*(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoNolockMethod)) + 24)) = winWrite
 198182 	*(*func(*libc.TLS, uintptr, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoNolockMethod)) + 32)) = winTruncate
 198183 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoNolockMethod)) + 40)) = winSync
 198184 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoNolockMethod)) + 48)) = winFileSize
 198185 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoNolockMethod)) + 56)) = winNolockLock
 198186 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoNolockMethod)) + 64)) = winNolockUnlock
 198187 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoNolockMethod)) + 72)) = winNolockCheckReservedLock
 198188 	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoNolockMethod)) + 80)) = winFileControl
 198189 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoNolockMethod)) + 88)) = winSectorSize
 198190 	*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoNolockMethod)) + 96)) = winDeviceCharacteristics
 198191 	*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoNolockMethod)) + 104)) = winShmMap
 198192 	*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoNolockMethod)) + 112)) = winShmLock
 198193 	*(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoNolockMethod)) + 120)) = winShmBarrier
 198194 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoNolockMethod)) + 128)) = winShmUnmap
 198195 	*(*func(*libc.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoNolockMethod)) + 136)) = winFetch
 198196 	*(*func(*libc.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winIoNolockMethod)) + 144)) = winUnfetch
 198197 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathNolockVfs)) + 32)) = uintptr(unsafe.Pointer(&winNolockAppData))
 198198 	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathNolockVfs)) + 40)) = winOpen
 198199 	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathNolockVfs)) + 48)) = winDelete
 198200 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathNolockVfs)) + 56)) = winAccess
 198201 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathNolockVfs)) + 64)) = winFullPathname
 198202 	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathNolockVfs)) + 72)) = winDlOpen
 198203 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathNolockVfs)) + 80)) = winDlError
 198204 	*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathNolockVfs)) + 88)) = winDlSym
 198205 	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathNolockVfs)) + 96)) = winDlClose
 198206 	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathNolockVfs)) + 104)) = winRandomness
 198207 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathNolockVfs)) + 112)) = winSleep
 198208 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathNolockVfs)) + 120)) = winCurrentTime
 198209 	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathNolockVfs)) + 128)) = winGetLastError
 198210 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathNolockVfs)) + 136)) = winCurrentTimeInt64
 198211 	*(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathNolockVfs)) + 144)) = winSetSystemCall
 198212 	*(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathNolockVfs)) + 152)) = winGetSystemCall
 198213 	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathNolockVfs)) + 160)) = winNextSystemCall
 198214 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathVfs)) + 32)) = uintptr(unsafe.Pointer(&winAppData))
 198215 	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathVfs)) + 40)) = winOpen
 198216 	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathVfs)) + 48)) = winDelete
 198217 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathVfs)) + 56)) = winAccess
 198218 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathVfs)) + 64)) = winFullPathname
 198219 	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathVfs)) + 72)) = winDlOpen
 198220 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathVfs)) + 80)) = winDlError
 198221 	*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathVfs)) + 88)) = winDlSym
 198222 	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathVfs)) + 96)) = winDlClose
 198223 	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathVfs)) + 104)) = winRandomness
 198224 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathVfs)) + 112)) = winSleep
 198225 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathVfs)) + 120)) = winCurrentTime
 198226 	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathVfs)) + 128)) = winGetLastError
 198227 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathVfs)) + 136)) = winCurrentTimeInt64
 198228 	*(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathVfs)) + 144)) = winSetSystemCall
 198229 	*(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathVfs)) + 152)) = winGetSystemCall
 198230 	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&winLongPathVfs)) + 160)) = winNextSystemCall
 198231 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&winNolockAppData)) + 0)) = uintptr(unsafe.Pointer(&winIoNolockMethod))
 198232 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&winNolockVfs)) + 32)) = uintptr(unsafe.Pointer(&winNolockAppData))
 198233 	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winNolockVfs)) + 40)) = winOpen
 198234 	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winNolockVfs)) + 48)) = winDelete
 198235 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winNolockVfs)) + 56)) = winAccess
 198236 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winNolockVfs)) + 64)) = winFullPathname
 198237 	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&winNolockVfs)) + 72)) = winDlOpen
 198238 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&winNolockVfs)) + 80)) = winDlError
 198239 	*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&winNolockVfs)) + 88)) = winDlSym
 198240 	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&winNolockVfs)) + 96)) = winDlClose
 198241 	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winNolockVfs)) + 104)) = winRandomness
 198242 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winNolockVfs)) + 112)) = winSleep
 198243 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winNolockVfs)) + 120)) = winCurrentTime
 198244 	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winNolockVfs)) + 128)) = winGetLastError
 198245 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winNolockVfs)) + 136)) = winCurrentTimeInt64
 198246 	*(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winNolockVfs)) + 144)) = winSetSystemCall
 198247 	*(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&winNolockVfs)) + 152)) = winGetSystemCall
 198248 	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&winNolockVfs)) + 160)) = winNextSystemCall
 198249 	*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&winVfs)) + 32)) = uintptr(unsafe.Pointer(&winAppData))
 198250 	*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winVfs)) + 40)) = winOpen
 198251 	*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winVfs)) + 48)) = winDelete
 198252 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winVfs)) + 56)) = winAccess
 198253 	*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winVfs)) + 64)) = winFullPathname
 198254 	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&winVfs)) + 72)) = winDlOpen
 198255 	*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&winVfs)) + 80)) = winDlError
 198256 	*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&winVfs)) + 88)) = winDlSym
 198257 	*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&winVfs)) + 96)) = winDlClose
 198258 	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winVfs)) + 104)) = winRandomness
 198259 	*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winVfs)) + 112)) = winSleep
 198260 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winVfs)) + 120)) = winCurrentTime
 198261 	*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winVfs)) + 128)) = winGetLastError
 198262 	*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winVfs)) + 136)) = winCurrentTimeInt64
 198263 	*(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&winVfs)) + 144)) = winSetSystemCall
 198264 	*(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&winVfs)) + 152)) = winGetSystemCall
 198265 	*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&winVfs)) + 160)) = winNextSystemCall
 198266 }
 198267 
 198268 var ts1 = "3.41.2\x00ATOMIC_INTRINSICS=1\x00COMPILER=msvc-1900\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00ENABLE_COLUMN_METADATA\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=127\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=1073741823\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_NOOP\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00BINARY\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00local time unavailable\x00second\x00minute\x00hour\x00\x00\x00day\x00\x00\x00\x00month\x00\x00year\x00\x00\x00auto\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x00%02d\x00%06.3f\x00%03d\x00%.16g\x00%lld\x00%04d\x00date\x00time\x00datetime\x00strftime\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x000123456789ABCDEF0123456789abcdef\x00-x0\x00X0\x00%\x00NaN\x00Inf\x00\x00NULL\x00(NULL)\x00.\x00(join-%u)\x00(subquery-%u)\x00thstndrd\x00922337203685477580\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSmaller\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfPos\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenRead\x00OpenWrite\x00BitNot\x00OpenDup\x00OpenAutoindex\x00String8\x00OpenEphemeral\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00Real\x00DropTrigger\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00AreFileApisANSI\x00CharLowerW\x00CharUpperW\x00CloseHandle\x00CreateFileA\x00CreateFileW\x00CreateFileMappingA\x00CreateFileMappingW\x00CreateMutexW\x00DeleteFileA\x00DeleteFileW\x00FileTimeToLocalFileTime\x00FileTimeToSystemTime\x00FlushFileBuffers\x00FormatMessageA\x00FormatMessageW\x00FreeLibrary\x00GetCurrentProcessId\x00GetDiskFreeSpaceA\x00GetDiskFreeSpaceW\x00GetFileAttributesA\x00GetFileAttributesW\x00GetFileAttributesExW\x00GetFileSize\x00GetFullPathNameA\x00GetFullPathNameW\x00GetLastError\x00GetProcAddressA\x00GetSystemInfo\x00GetSystemTime\x00GetSystemTimeAsFileTime\x00GetTempPathA\x00GetTempPathW\x00GetTickCount\x00GetVersionExA\x00GetVersionExW\x00HeapAlloc\x00HeapCreate\x00HeapDestroy\x00HeapFree\x00HeapReAlloc\x00HeapSize\x00HeapValidate\x00HeapCompact\x00LoadLibraryA\x00LoadLibraryW\x00LocalFree\x00LockFile\x00LockFileEx\x00MapViewOfFile\x00MultiByteToWideChar\x00QueryPerformanceCounter\x00ReadFile\x00SetEndOfFile\x00SetFilePointer\x00Sleep\x00SystemTimeToFileTime\x00UnlockFile\x00UnlockFileEx\x00UnmapViewOfFile\x00WideCharToMultiByte\x00WriteFile\x00CreateEventExW\x00WaitForSingleObject\x00WaitForSingleObjectEx\x00SetFilePointerEx\x00GetFileInformationByHandleEx\x00MapViewOfFileFromApp\x00CreateFile2\x00LoadPackagedLibrary\x00GetTickCount64\x00GetNativeSystemInfo\x00OutputDebugStringA\x00OutputDebugStringW\x00GetProcessHeap\x00CreateFileMappingFromApp\x00InterlockedCompareExchange\x00UuidCreate\x00UuidCreateSequential\x00FlushViewOfFile\x00%s\x00OsError 0x%lx (%lu)\x00os_win.c:%d: (%lu) %s(%s) - %s\x00delayed %dms for lock/sharing conflict at line %d\x00winSeekFile\x00winClose\x00winRead\x00winWrite1\x00winWrite2\x00winTruncate1\x00winTruncate2\x00winSync1\x00winSync2\x00winFileSize\x00winUnlockReadLock\x00winUnlock\x00winLockSharedMemory\x00%s-shm\x00readonly_shm\x00winOpenShm\x00winShmMap1\x00winShmMap2\x00winShmMap3\x00winUnmapfile1\x00winUnmapfile2\x00winMapfile1\x00winMapfile2\x00etilqs_\x00winGetTempname1\x00winGetTempname2\x00winGetTempname3\x00winGetTempname4\x00winGetTempname5\x00abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\x00exclusive\x00winOpen\x00psow\x00winDelete\x00winAccess\x00%s%c%s\x00winFullPathname1\x00winFullPathname2\x00winFullPathname3\x00winFullPathname4\x00win32\x00win32-longpath\x00win32-none\x00win32-longpath-none\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00SQLite format 3\x00:memory:\x00@  \x00\n\x00invalid page number %d\x002nd reference to page %d\x00Failed to read ptrmap key=%d\x00Bad ptr map entry key=%d expected=(%d,%d) got=(%d,%d)\x00failed to get page %d\x00freelist leaf count too big on page %d\x00%s is %d but should be %d\x00size\x00overflow list length\x00Page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00On tree page %u cell %d: \x00On page %u at right child: \x00Offset %d out of range %d..%d\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %d bytes reported as %d on page %u\x00Main freelist: \x00max rootpage (%d) disagrees with header (%d)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %d is never used\x00Pointer map page %d is referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00B\x00,%s%s%s\x00N.\x00)\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00?\x008\x0016LE\x0016BE\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00cannot change %s wal mode from within a transaction\x00into\x00out of\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: [%s] %s\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00cannot open value of type %s\x00null\x00real\x00integer\x00no such rowid: %lld\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\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00IN(...) element has %d term%s - expected %d\x00s\x000\x00too many arguments on function %T\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00%sLIST SUBQUERY %d\x00CORRELATED \x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00B\x00C\x00D\x00E\x00F\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND   name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X'      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');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND   sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\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\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') ELSE raise(ABORT,'NOT NULL constraint failed') END  FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00cannot %s %s \"%s\"\x00drop column from\x00rename columns of\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X'  AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00error in %s %s%s%s: %s\x00 \x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00cannot drop %s column: \"%s\"\x00PRIMARY KEY\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00sqlite_returning\x00cannot use RETURNING in a trigger\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n  \x00,\n  \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master 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'\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00stat\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\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\x00unsupported use of NULLS %s\x00FIRST\x00LAST\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00CREATE%s INDEX %.*s\x00 UNIQUE\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00a JOIN clause is required before %s\x00ON\x00USING\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!.20e\x00%Q\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00glob\x00ceil\x00ceiling\x00floor\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00dll\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_store_directory\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\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00onoffalseyestruextrafull\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00w\x00a\x00sissii\x00utf8\x00utf16le\x00utf16be\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00wrong # of entries in index \x00ok\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00rename\x00drop column\x00add column\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00naturaleftouterightfullinnercross\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00USE TEMP B-TREE FOR %sORDER BY\x00RIGHT PART OF \x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00SCAN %d CONSTANT ROW%s\x00S\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\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\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00SCAN %s%s%s\x00 USING COVERING INDEX \x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00trigger %T already exists\x00cannot create trigger on system table\x00cannot create %s trigger on view: %S\x00BEFORE\x00AFTER\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00%s RETURNING is not available on virtual tables\x00DELETE\x00UPDATE\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00ATTACH %Q AS vacuum_db\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO vacuum_db.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM vacuum_db.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO vacuum_db.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00<expr>\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00%s %S\x00SEARCH\x00SCAN\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX %d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00row_number\x00dense_rank\x00rank\x00percent_rank\x00cume_dist\x00ntile\x00last_value\x00nth_value\x00first_value\x00lead\x00lag\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00%s clause should come after %s not before\x00ORDER BY\x00LIMIT\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00parser stack overflow\x00unknown table option: %.*s\x00set list\x00near \"%T\": syntax error\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\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\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\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00mode\x00access\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00shared\x00private\x00ro\x00rw\x00rwc\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00[0]\x00JSON path error near '%q'\x00json_%s() needs an odd number of arguments\x00$[\x00$.\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00.%.*s\x00[%d]\x00$\x00json\x00json_array\x00json_array_length\x00json_extract\x00->\x00->>\x00json_insert\x00json_object\x00json_patch\x00json_quote\x00json_remove\x00json_replace\x00json_set\x00json_type\x00json_valid\x00json_group_array\x00json_group_object\x00json_each\x00json_tree\x00%s_node\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node'   RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid'  RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00);\x00,%.*s REAL\x00,%.*s INT\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00Mapping (%lld -> %lld) missing from %s table\x00%_rowid\x00%_parent\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00END\x00wrong number of arguments to function rtreecheck()\x00[\x00[%!g,%!g],\x00[%!g,%!g]]\x00<polyline points=\x00%c%g,%g\x00 %g,%g'\x00 %s\x00></polyline>\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL  %s ORDER BY name\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE'   FROM main.sqlite_schema   WHERE type='index' AND tbl_name = ?\x00SELECT  (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage  FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00table %q %s rbu_rowid column\x00may not have\x00requires\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00 NOT NULL\x00%z, %z\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00 WITHOUT ROWID\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00AND\x00WHERE\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00, _rowid_\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00, 0 AS rbu_rowid\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN   SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN   SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN   SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN   SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x000 AS \x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00file:%s-vactmp?rbu_memory=1%s%s\x00&\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q)  \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence'  ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00database modified during rbu %s\x00vacuum\x00update\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00SELECT 0, 'tbl',  '', 0, '', 1     UNION ALL SELECT 1, 'idx',  '', 0, '', 2     UNION ALL SELECT 2, 'stat', '', 0, '', 0\x00PRAGMA '%q'.table_info('%q')\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00SELECT * FROM \"%w\".\"%w\" WHERE NOT EXISTS (  SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00SELECT * FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00table schemas do not match\x00SELECT tbl, ?2, stat FROM %Q.sqlite_stat1 WHERE tbl IS ?1 AND idx IS (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00SELECT * FROM \x00 WHERE \x00 IS ?\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00snippet\x00highlight\x00bm25\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00columns\x00malformed detail=... directive\x00unrecognized option: \"%.*s\"\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00fts5: %s queries are not supported (detail!=full)\x00phrase\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00DESC\x00ASC\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%s: table does not support scanning\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00cannot %s contentless fts5 table: %s\x00DELETE from\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2023-03-22 11:56:21 0d1fc92f94cb6b76bffe3ec34d69cffde2924203304e8ffc4155597af0c191da\x00config\x00fts5\x00fts5_source_id\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00ascii\x00porter\x00trigram\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002023-03-22 11:56:21 0d1fc92f94cb6b76bffe3ec34d69cffde2924203304e8ffc4155597af0c191da\x00"
 198269 var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data